earthsdk3 3.11.1-beta.1 → 3.11.1
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/dist/earthsdk3.iife.js +28 -28
- package/dist/earthsdk3.js +295 -12
- package/dist/earthsdk3.umd.cjs +4 -4
- package/dist/types/ESObjectManager/index.d.ts +22 -0
- package/dist/types/ESObjects/general/ES3DTileset/index.d.ts +2 -0
- package/dist/types/ESObjects/general/ESAlarm.d.ts +1 -0
- package/dist/types/ESObjects/general/ESApertureEffect.d.ts +1 -0
- package/dist/types/ESObjects/general/ESAreaMeasurement.d.ts +1 -0
- package/dist/types/ESObjects/general/ESAttackArrow.d.ts +1 -0
- package/dist/types/ESObjects/general/ESBlastParticleSystem.d.ts +1 -0
- package/dist/types/ESObjects/general/ESBoxClipping.d.ts +1 -0
- package/dist/types/ESObjects/general/ESCameraView.d.ts +1 -0
- package/dist/types/ESObjects/general/ESCameraVisibleRange.d.ts +2 -0
- package/dist/types/ESObjects/general/ESCar.d.ts +1 -0
- package/dist/types/ESObjects/general/ESCityBasePoint.d.ts +1 -0
- package/dist/types/ESObjects/general/ESClassification.d.ts +1 -0
- package/dist/types/ESObjects/general/ESClippingPlane.d.ts +1 -0
- package/dist/types/ESObjects/general/ESCustomPrimitive/index.d.ts +66 -0
- package/dist/types/ESObjects/general/ESCylinder.d.ts +1 -0
- package/dist/types/ESObjects/general/ESCzml.d.ts +1 -0
- package/dist/types/ESObjects/general/ESDataMesh.d.ts +1 -0
- package/dist/types/ESObjects/general/ESDatasmithRuntimeModel.d.ts +1 -0
- package/dist/types/ESObjects/general/ESDirectionMeasurement.d.ts +1 -0
- package/dist/types/ESObjects/general/ESDistanceMeasurement.d.ts +1 -0
- package/dist/types/ESObjects/general/ESDynamicWater.d.ts +1 -0
- package/dist/types/ESObjects/general/ESEntityCluster.d.ts +1 -0
- package/dist/types/ESObjects/general/ESExcavate.d.ts +1 -0
- package/dist/types/ESObjects/general/ESFeatureLayer/FeatureLayer.d.ts +12 -0
- package/dist/types/ESObjects/general/ESFireParticleSystem.d.ts +1 -0
- package/dist/types/ESObjects/general/ESFireWall.d.ts +10 -0
- package/dist/types/ESObjects/general/ESForestTileset.d.ts +2 -0
- package/dist/types/ESObjects/general/ESFountainParticleSystem.d.ts +1 -0
- package/dist/types/ESObjects/general/ESGaussianSplatting.d.ts +1 -0
- package/dist/types/ESObjects/general/ESGeHistoryImagery/index.d.ts +18 -2
- package/dist/types/ESObjects/general/ESGeHistoryImagery/type.d.ts +7 -0
- package/dist/types/ESObjects/general/ESGeoBezierPath/index.d.ts +25 -0
- package/dist/types/ESObjects/general/ESGeoDivTextPoi.d.ts +1 -0
- package/dist/types/ESObjects/general/ESGeoExtrudedPolygon.d.ts +1 -0
- package/dist/types/ESObjects/general/ESGeoIcon.d.ts +14 -0
- package/dist/types/ESObjects/general/ESGeoLineString.d.ts +1 -0
- package/dist/types/ESObjects/general/ESGeoPoint.d.ts +16 -0
- package/dist/types/ESObjects/general/ESGeoPoints/index.d.ts +4 -0
- package/dist/types/ESObjects/general/ESGeoPolygon.d.ts +1 -0
- package/dist/types/ESObjects/general/ESGeoPolygonWithFire.d.ts +1 -0
- package/dist/types/ESObjects/general/ESGeoRectangle.d.ts +1 -0
- package/dist/types/ESObjects/general/ESGeoSmoothPolygon.d.ts +20 -0
- package/dist/types/ESObjects/general/ESGeoWater.d.ts +1 -0
- package/dist/types/ESObjects/general/ESGltfModel.d.ts +2 -1
- package/dist/types/ESObjects/general/ESHeightLimitAnalysis.d.ts +1 -0
- package/dist/types/ESObjects/general/ESHeightMeasurement.d.ts +2 -0
- package/dist/types/ESObjects/general/ESHole.d.ts +1 -0
- package/dist/types/ESObjects/general/ESHuman.d.ts +1 -0
- package/dist/types/ESObjects/general/ESHumanFountain.d.ts +2 -3
- package/dist/types/ESObjects/general/ESHumanPoi.d.ts +1 -0
- package/dist/types/ESObjects/general/ESHumans.d.ts +10 -0
- package/dist/types/ESObjects/general/ESImageLabel.d.ts +2 -0
- package/dist/types/ESObjects/general/ESKml.d.ts +21 -0
- package/dist/types/ESObjects/general/ESLandSlide.d.ts +1 -0
- package/dist/types/ESObjects/general/ESLevelRuntimeModel.d.ts +1 -0
- package/dist/types/ESObjects/general/ESLocalCircle.d.ts +1 -0
- package/dist/types/ESObjects/general/ESLocalLineString.d.ts +21 -0
- package/dist/types/ESObjects/general/ESLocalLineStringZ.d.ts +25 -0
- package/dist/types/ESObjects/general/ESLocalPolygon.d.ts +1 -0
- package/dist/types/ESObjects/general/ESLocalPolygonZ.d.ts +1 -0
- package/dist/types/ESObjects/general/ESLocalRectangle.d.ts +1 -0
- package/dist/types/ESObjects/general/ESLocalSkyBox.d.ts +1 -0
- package/dist/types/ESObjects/general/ESLocationMeasurement.d.ts +2 -0
- package/dist/types/ESObjects/general/ESMVTLayer.d.ts +4 -0
- package/dist/types/ESObjects/general/ESNavigator.d.ts +2 -0
- package/dist/types/ESObjects/general/ESParticleSystemPrimitive.d.ts +1 -0
- package/dist/types/ESObjects/general/ESPath/ESPathImpl/PolylineResetting.d.ts +4 -0
- package/dist/types/ESObjects/general/ESPipeFence.d.ts +2 -0
- package/dist/types/ESObjects/general/ESPipeline.d.ts +2 -0
- package/dist/types/ESObjects/general/ESPipeserTileset.d.ts +1 -0
- package/dist/types/ESObjects/general/ESPit.d.ts +1 -0
- package/dist/types/ESObjects/general/ESPoi2D.d.ts +1 -0
- package/dist/types/ESObjects/general/ESPoi3D.d.ts +1 -0
- package/dist/types/ESObjects/general/ESPoiTileset.d.ts +1 -0
- package/dist/types/ESObjects/general/ESPolygonFence.d.ts +1 -0
- package/dist/types/ESObjects/general/ESPolygonFlattenedPlane.d.ts +2 -0
- package/dist/types/ESObjects/general/ESPolygonWithHole.d.ts +1 -0
- package/dist/types/ESObjects/general/ESPolygonsFlattenedPlane.d.ts +2 -0
- package/dist/types/ESObjects/general/ESRectangle.d.ts +2 -0
- package/dist/types/ESObjects/general/ESRoad.d.ts +19 -0
- package/dist/types/ESObjects/general/ESScale.d.ts +1 -0
- package/dist/types/ESObjects/general/ESSignalInterference.d.ts +22 -0
- package/dist/types/ESObjects/general/ESSignalTransmission.d.ts +25 -0
- package/dist/types/ESObjects/general/ESSquadCombatArrow.d.ts +2 -0
- package/dist/types/ESObjects/general/ESStaticMesh.d.ts +1 -0
- package/dist/types/ESObjects/general/ESSurfaceAreaMeasurement.d.ts +1 -0
- package/dist/types/ESObjects/general/ESTerrainLayer.d.ts +1 -0
- package/dist/types/ESObjects/general/ESTerrainLayerEditing/EditingESGeoPolygon.d.ts +8 -0
- package/dist/types/ESObjects/general/ESTextLabel.d.ts +6 -0
- package/dist/types/ESObjects/general/ESUEWidget.d.ts +2 -0
- package/dist/types/ESObjects/general/ESUnrealActor.d.ts +1 -0
- package/dist/types/ESObjects/general/ESVideoFusion.d.ts +1 -0
- package/dist/types/ESObjects/general/ESViewShed.d.ts +1 -0
- package/dist/types/ESObjects/general/ESViewerStatusBar.d.ts +1 -0
- package/dist/types/ESObjects/general/ESViewerStatusBarScale.d.ts +1 -0
- package/dist/types/ESObjects/general/ESVisibilityAnalysis.d.ts +2 -0
- package/dist/types/ESObjects/general/ESVolumeMeasurement.d.ts +1 -0
- package/dist/types/ESObjects/general/ESWidget.d.ts +1 -0
- package/dist/types/ESObjects/general/ESXYZLayer.d.ts +48 -0
- package/package.json +1 -1
package/dist/earthsdk3.iife.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
var EarthSDK3=(function(b){"use strict";var l4=Object.defineProperty;var u4=(b,Xn,Yr)=>Xn in b?l4(b,Xn,{enumerable:!0,configurable:!0,writable:!0,value:Yr}):b[Xn]=Yr;var p=(b,Xn,Yr)=>u4(b,typeof Xn!="symbol"?Xn+"":Xn,Yr);var T_,k_;function Xn(){var n;const i=((n=window==null?void 0:window.navigator)==null?void 0:n.userAgent)??"unknown";let e="Unknown";/Windows/.test(i)?e="Windows":/Macintosh/.test(i)?e="MacOS":/Linux/.test(i)?e="Linux":/Android/.test(i)?e="Android":/iOS|iPhone|iPad|iPod/.test(i)&&(e="iOS");let t="Unknown";return/x64|x86_64|Win64|WOW64/.test(i)?t="x64":/x86|i686|Win32/.test(i)?t="x86":/arm64|aarch64/.test(i)?t="arm64":/arm/.test(i)&&(t="arm"),{os:e.toLocaleLowerCase(),arch:t.toLocaleLowerCase()}}const Yr=Date.now();function rp(i){var l;const{os:e,arch:t}=Xn(),n={version:i.version,commitdate:i.date,commitId:i.commitId,runningTime:(Date.now()-Yr)/1e3/60|0,date:new Date().toLocaleString(),href:((l=window==null?void 0:window.location)==null?void 0:l.href)??"unknown",os:e,arch:t},o={method:"GET",headers:new Headers,redirect:"follow"},h=window.encodeURIComponent(JSON.stringify(n));fetch(`https://account.bjxbsj.cn/api/product/record?product=EarthSDKJS&content=${h}`,o).then(d=>d.text()).then(d=>console.log(d)).catch(d=>console.log("error",d))}b.copyright=void 0;try{const i="earthsdk3",e="3.11.1-beta.1",t="2026-07-
|
|
1
|
+
var EarthSDK3=(function(b){"use strict";var l4=Object.defineProperty;var u4=(b,Xn,Yr)=>Xn in b?l4(b,Xn,{enumerable:!0,configurable:!0,writable:!0,value:Yr}):b[Xn]=Yr;var p=(b,Xn,Yr)=>u4(b,typeof Xn!="symbol"?Xn+"":Xn,Yr);var T_,k_;function Xn(){var n;const i=((n=window==null?void 0:window.navigator)==null?void 0:n.userAgent)??"unknown";let e="Unknown";/Windows/.test(i)?e="Windows":/Macintosh/.test(i)?e="MacOS":/Linux/.test(i)?e="Linux":/Android/.test(i)?e="Android":/iOS|iPhone|iPad|iPod/.test(i)&&(e="iOS");let t="Unknown";return/x64|x86_64|Win64|WOW64/.test(i)?t="x64":/x86|i686|Win32/.test(i)?t="x86":/arm64|aarch64/.test(i)?t="arm64":/arm/.test(i)&&(t="arm"),{os:e.toLocaleLowerCase(),arch:t.toLocaleLowerCase()}}const Yr=Date.now();function rp(i){var l;const{os:e,arch:t}=Xn(),n={version:i.version,commitdate:i.date,commitId:i.commitId,runningTime:(Date.now()-Yr)/1e3/60|0,date:new Date().toLocaleString(),href:((l=window==null?void 0:window.location)==null?void 0:l.href)??"unknown",os:e,arch:t},o={method:"GET",headers:new Headers,redirect:"follow"},h=window.encodeURIComponent(JSON.stringify(n));fetch(`https://account.bjxbsj.cn/api/product/record?product=EarthSDKJS&content=${h}`,o).then(d=>d.text()).then(d=>console.log(d)).catch(d=>console.log("error",d))}b.copyright=void 0;try{const i="earthsdk3",e="3.11.1-beta.1",t="2026-07-28T08:01:04.000Z",n="北京西部世界科技有限公司",s="地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn",o="1556a78ab71d1ebcf231adb5033946e3a37fcbf8",l=((Date.now()-1785225664e3)/36e5).toFixed(1),d=`%c🌏 ${i}%c ${e}.${o.slice(0,8)}.${t} (距今${l}个小时)
|
|
2
2
|
%c${s?s+`
|
|
3
3
|
`:""}当前网站正在使用${i},此软件版权归${n}所有
|
|
4
|
-
`;b.copyright=Object.freeze({get owner(){return"北京西部世界科技有限公司"},get ownerlink(){return OWNERLINK_},get gituri(){return GITURI_&&GITURI_.replace("${commitId}","
|
|
4
|
+
`;b.copyright=Object.freeze({get owner(){return"北京西部世界科技有限公司"},get ownerlink(){return OWNERLINK_},get gituri(){return GITURI_&&GITURI_.replace("${commitId}","1556a78ab71d1ebcf231adb5033946e3a37fcbf8")},get info(){return d},get date(){return"2026-07-28T08:01:04.000Z"},get author(){return"suplyang"},get version(){return"3.11.1-beta.1"},get name(){return"earthsdk3"},get commitId(){return"1556a78ab71d1ebcf231adb5033946e3a37fcbf8"},print(){console.info(this.info,`
|
|
5
5
|
font-size: 18px;
|
|
6
6
|
font-weight: 1000;
|
|
7
7
|
line-height: 1;
|
|
@@ -18,9 +18,9 @@ var EarthSDK3=(function(b){"use strict";var l4=Object.defineProperty;var u4=(b,X
|
|
|
18
18
|
color: rgb(0, 120, 215);
|
|
19
19
|
padding-bottom: 2px;
|
|
20
20
|
padding-left: 35px;
|
|
21
|
-
`)}}),window.g_XE3CopyRights=window.g_XE3CopyRights||{},window.g_XE3CopyRights[i]=b.copyright,window.g_XE3SendProductUsageInfo=window.g_XE3SendProductUsageInfo||!0,window.g_XE3SendProductUsageInfo&&(setTimeout(()=>rp(b.copyright),6e4),setInterval(()=>rp(b.copyright),864e5)),window.g_earthsdk_copyright_print=window.g_earthsdk_copyright_print??!0,window.g_earthsdk_copyright_print&&b.copyright.print()}catch{console.warn("版本信息有误!")}const ap=new Set;function Jr(i,e=i){ap.has(e)||(ap.add(e),console.warn(i))}function wo(i){const e=$h(i),t=()=>e[0][e[1]],n=o=>{try{e[0][e[1]]=o}catch(h){Jr(`setValue error, obj(${e[0].constructor.name}) prop(${e[1]}) error(${h})`)}},s=e[0][e[2]];return[t,n,s]}function x1(){return!0}function b1(){throw new Error("throwOnDestroyed")}function op(i){for(var e in i)typeof i[e]=="function"&&(i[e]=b1);i.isDestroyed=x1}const Cu=class Cu{constructor(){p(this,"_memId",++Cu._lastMemId);p(this,"_disposers")}get __v_skip(){return!0}get memId(){return this._memId}get disposers(){return this._disposers||(this._disposers=[]),this._disposers}dispose(e){return this.disposers.push(e),e}d(e){return this.dispose(e)}disposeVar(e){return this.disposers.push(()=>e.destroy()),e}dv(e){return this.disposeVar(e)}tryDisposeVar(e){return this.disposers.push(()=>e.tryDestroy()),e}tdv(e){return this.tryDisposeVar(e)}autoDispose(e){return typeof e=="function"?this.dispose(e):this.disposeVar(e)}ad(e){return typeof e=="function"?this.dispose(e):this.disposeVar(e)}isDestroyed(){return!1}destroyImp(){}destroy(){if(this._toDestroyEvent&&this._toDestroyEvent.emit(),this.destroyImp(),this._disposers)try{const e=this._disposers,t=e.length;for(let n=t-1;n>=0;--n)e[n]();e.length=0,this._disposers=void 0}catch(e){console.error(`destroy get error! ${e}`)}return op(this)}tryDestory(){if(!this.isDestroyed())return this.destroy()}};p(Cu,"_lastMemId",-1);let st=Cu,Uu;function hp(i){Uu=i}Object.defineProperties(st.prototype,{toDestroyEvent:{get(){if(this._toDestroyEvent===void 0){if(!Uu)throw new Error("Destroyable EventCtor not registered yet!");this._toDestroyEvent=this.disposeVar(new Uu)}return this._toDestroyEvent}}});class Vh{constructor(e,t,n=!1){p(this,"_freeElements");p(this,"_usedElementsCount");p(this,"_usedElements");p(this,"_nextCreateID");p(this,"_scratchObjs");this._createDefaultFunc=e,this._destroyFunc=t,this._freeElements=[],this._usedElementsCount=0,this._nextCreateID=1,this._scratchObjs=[],n&&(this._usedElements=[])}get usedElementsCount(){return this._usedElementsCount}get freeElementsCount(){return this._freeElements.length}_getCreateID(){return this._nextCreateID++}_create(){let e;return this._freeElements.length>0?e=this._freeElements.pop():e=this._createDefaultFunc&&this._createDefaultFunc()||{},e._cid=this._getCreateID(),e}create(){return this._create()}multiCreate(e){this._scratchObjs.length=0;for(let t=0;t<e;++t)this._scratchObjs.push(this._create());return this._scratchObjs}_destroy(e){this._destroyFunc&&this._destroyFunc(e),e._cid=void 0}destroy(...e){const t=e.length;for(let n=0;n<t;++n)this._destroy(e[n])}}function P1(){return{item:void 0,previous:void 0,next:void 0}}function C1(i){i.item=void 0,i.previous=void 0,i.next=void 0}const lp=new Vh(P1,C1,!0);function Vu(i,e,t){const n=lp.create();return n.item=i,n.previous=e,n.next=t,n}function up(i){if(!i)throw new Error("node is undefined!");lp.destroy(i)}function qu(i,e){e.previous&&e.next?(e.previous.next=e.next,e.next.previous=e.previous):e.previous?(e.previous.next=void 0,i.tail=e.previous):e.next?(e.next.previous=void 0,i.head=e.next):(i.head=void 0,i.tail=void 0),e.next=void 0,e.previous=void 0}class cp{constructor(e){p(this,"head");p(this,"tail");p(this,"_length");const{needLength:t}=e||{needLength:!0};this.head=void 0,this.tail=void 0,t&&(this._length=0)}_incrementLength(){typeof this._length=="number"&&++this._length}_decrementLength(){typeof this._length=="number"&&--this._length}_setLength(e){typeof this._length=="number"&&(this._length=e)}get length(){return this._length}get empty(){return!this.head}*[Symbol.iterator](){let e=this.head;for(;e;)yield e,e=e.next}remove(e){if(!e)throw new Error("node is undefined!");qu(this,e),this._decrementLength(),up(e)}getNode(e){let t=this.head;for(;t!==null;){if(!t)throw new Error("current is undefined!");if(t.item===e)return t;t=t.next}}moveAfter(e,t){if(e!==t){qu(this,t);var n=e.next;e.next=t,this.tail===e?this.tail=t:n&&(n.previous=t),t.next=n,t.previous=e}}moveBefore(e,t){if(e!==t){qu(this,t);var n=e.previous;e.previous=t,this.head===e?this.head=t:n&&(n.next=t),t.previous=n,t.next=e}}insertBefore(e,t){const n=Vu(t,e.previous,e);return e.previous&&(e.previous.next=n),e.previous=n,this.head===e&&(this.head=n),this._incrementLength(),n}insertAfter(e,t){const n=Vu(t,e,e.next);return e.next&&(e.next.previous=n),e.next=n,this.tail===e&&(this.tail=n),this._incrementLength(),n}_setFirstNode(e){if(this.head||this.tail)throw new Error("_setFirstNode error!");const t=Vu(e,void 0,void 0);if(this.head=t,this.tail=t,this._incrementLength(),this._length!==1)throw new Error("_setFirstNode error! this._length !== 1");return t}push(e){return this.tail?this.insertAfter(this.tail,e):this._setFirstNode(e)}pop(){if(!this.tail)throw new Error("DoublyLinkedList is empty!");const e=this.tail.item;return this.remove(this.tail),e}shift(){if(!this.head)throw new Error("DoublyLinkedList is empty!");const e=this.head.item;return this.remove(this.head),e}unshift(e){return this.head?this.insertBefore(this.head,e):this._setFirstNode(e)}removeAll(){let e=this.head;for(;e;){const t=e.next;up(e),e=t}this.head=void 0,this.tail=void 0,this._setLength(0)}}function I1(){return{func:void 0,scope:void 0,_hasRemoved:!1,_once:!1}}function M1(i){i.func=void 0,i.scope=void 0,i._hasRemoved=!1,i._once=!1}const Ys=new Vh(I1,M1,!0);class $u{constructor(){p(this,"__dll");p(this,"__currentListenerStack")}get _dll(){return this.__dll=this.__dll??new cp({needLength:!0}),this.__dll}_pushCurrentListener(e){this.__currentListenerStack?Array.isArray(this.__currentListenerStack)?this.__currentListenerStack.push(e):this.__currentListenerStack=[this.__currentListenerStack,e]:this.__currentListenerStack=e}_popCurrentListener(){if(this.__currentListenerStack)Array.isArray(this.__currentListenerStack)?this.__currentListenerStack.pop():this.__currentListenerStack=void 0;else throw new Error("cannot pop!")}_hasCurrentListener(e){return this.__currentListenerStack?Array.isArray(this.__currentListenerStack)?this.__currentListenerStack.indexOf(e)!==-1:this.__currentListenerStack===e:!1}do(...e){if(this.__dll&&!this._dll.empty){let t=this._dll.head;for(;t;){const n=t.item;n._hasRemoved||(this._pushCurrentListener(n),n.func.call(n.scope,...e),this._popCurrentListener());const s=t.next;n._once&&!n._hasRemoved&&(this.remove(t),t=void 0),t&&this._clearHasRemoved(t),t=s}}}get empty(){if(!this.__dll||this._dll.empty)return!0;let e=!0,t=this._dll.head;for(;t;){if(!t.item._hasRemoved){e=!1;break}t=t.next}return e}isHandlerValid(e){return!e.item._hasRemoved}nextHandler(e){if(!e.item._hasRemoved)throw new Error("handler has removed!");let t=e.next;for(;t&&t.item._hasRemoved;)t=t.next;return t}prevHandler(e){if(!e.item._hasRemoved)throw new Error("handler has removed!");let t=e.previous;for(;t&&t.item._hasRemoved;)t=t.previous;return t}moveAfter(e,t){if(e.item._hasRemoved||t.item._hasRemoved)throw new Error("handler or nextHandler has removed!");return this._dll.moveAfter(e,t)}moveBefore(e,t){if(e.item._hasRemoved||t.item._hasRemoved)throw new Error("handler or prevHandler has removed!");return this._dll.moveBefore(e,t)}insertBefore(e,t,n,s=!1){if(e.item._hasRemoved)throw new Error("handler has removed!");const o=Ys.create();return o.func=t,o.scope=n,o._once=s,this._dll.insertBefore(e,o)}insertAfter(e,t,n,s=!1){if(e.item._hasRemoved)throw new Error("handler has removed!");const o=Ys.create();return o.func=t,o.scope=n,o._once=s,this._dll.insertAfter(e,o)}_clearHasRemoved(e){e.item._hasRemoved&&!this._hasCurrentListener(e.item)&&(Ys.destroy(e.item),this._dll.remove(e))}remove(e){if(!e.item||e.item._hasRemoved)throw new Error("handler has removed!");this._hasCurrentListener(e.item)?e.item._hasRemoved=!0:(Ys.destroy(e.item),this._dll.remove(e))}removeAll(){if(this.__dll&&!this._dll.empty){let e=this._dll.head;for(;e;){const t=e.next;e.item._hasRemoved||this.remove(e),e=t}}}destroy(){if(!this.__dll)return;let e=this._dll.head;for(;e;){const t=e.next,n=e;this._hasCurrentListener(n.item)||(console.warn("Event has remove item that on current stack!"),console.warn(`${n.item.func.toString()}`)),Ys.destroy(n.item),this._dll.remove(n),e=t}this.__dll=void 0,this.__currentListenerStack=void 0}push(e,t,n=!1){const s=Ys.create();return s.func=e,s.scope=t,s._once=n,this._dll.push(s)}pop(){const e=this.tail;if(!e)throw new Error("pop error!");this.remove(e)}shift(){const e=this.head;if(!e)throw new Error("shift error!");this.remove(e)}unshift(e,t,n=!1){const s=Ys.create();return s.func=e,s.scope=t,s._once=n,this._dll.unshift(s)}get tail(){let e=this._dll.tail;for(;e&&e.item._hasRemoved;)e=e.previous;return e}get head(){let e=this._dll.head;for(;e&&e.item._hasRemoved;)e=e.previous;return e}}class Eo{constructor(){p(this,"_listenerHandler");p(this,"_cid")}_reset(e,t){this._listenerHandler=e,this._cid=t}clone(e){return e=e??new Eo,e._reset(this._listenerHandler,this._cid),e}get valid(){if(typeof this._listenerHandler<"u"&&typeof this._cid=="number"){const e=this._listenerHandler._cid;if(typeof e<"u"&&this._cid===e)return!0}return!1}}class Wu extends Eo{}let H=class extends st{constructor(){super(...arguments);p(this,"__pipe");p(this,"beforeCallback");p(this,"afterCallback")}get _pipe(){return this.__pipe=this.__pipe??new $u,this.__pipe}get empty(){return!this.__pipe||this._pipe.empty}emit(...t){!this.isDestroyed()&&this.beforeCallback&&this.beforeCallback(...t),!this.isDestroyed()&&this._pipe.do(...t),!this.isDestroyed()&&this.afterCallback&&this.afterCallback(...t)}on(t,n,s=!1,o){const h=s?this._pipe.unshift(t,n,!1):this._pipe.push(t,n,!1);return o=o??new Wu,o._reset(h,h._cid),o}disposableOn(t,n,s=!1,o){const h=this.on(t,n,s,o);return()=>{h.valid&&this.off(h)}}don(t,n,s=!1,o){return this.disposableOn(t,n,s,o)}disposableWeakOn(t,n,s=!1,o){const h=new st,l=()=>{!h.isDestroyed()&&h.destroy()};return h.dispose(this.disposableOn(t,n,s,o)),h.dispose(this.toDestroyEvent.disposableOn(l)),l}dwon(t,n,s=!1,o){return this.disposableWeakOn(t,n,s,o)}once(t,n,s=!1,o){const h=s?this._pipe.unshift(t,n,!0):this._pipe.push(t,n,!0);return o=o??new Wu,o._reset(h,h._cid),o}disposableOnce(t,n,s=!1,o){const h=this.once(t,n,s,o);return()=>h.valid&&this.off(h)}donce(t,n,s=!1,o){const h=this.once(t,n,s,o);return()=>h.valid&&this.off(h)}off(t){if(!t.valid)throw new Error("handler is not valid!");this._pipe.remove(t._listenerHandler),t._reset()}reset(){this._pipe.removeAll()}destroyImp(){this.empty||(Jr("The event is destroying with listeners!"),this._pipe.removeAll())}};hp(H);function Kr(i,e){return e=e??new Eo,e._reset(i,i._cid),e}class T1{constructor(){p(this,"__pipe")}get _pipe(){return this.__pipe=this.__pipe??new $u,this.__pipe}get empty(){return!this.__pipe||this._pipe.empty}do(...e){return this._pipe.do(...e)}isHandlerValid(e){return e.valid?this._pipe.isHandlerValid(e._listenerHandler):!1}moveAfter(e,t){if(!e.valid||!t.valid)throw new Error("handler or nextHander is not valid!");return this._pipe.moveAfter(e._listenerHandler,t._listenerHandler)}moveBefore(e,t){if(!e.valid||!t.valid)throw new Error("handler or nextHander is not valid!");return this._pipe.moveAfter(e._listenerHandler,t._listenerHandler)}insertBefore(e,t,n,s=!1,o){if(!e.valid)throw new Error("handler is not valid!");const h=this._pipe.insertBefore(e._listenerHandler,t,n,s);return Kr(h,o)}insertAfter(e,t,n,s=!1,o){if(!e.valid)throw new Error("handler is not valid!");const h=this._pipe.insertAfter(e._listenerHandler,t,n,s);return Kr(h,o)}remove(e){if(!e.valid)throw new Error("handler is not valid!");return this._pipe.remove(e._listenerHandler)}removeAll(){return this._pipe.removeAll()}push(e,t,n=!1,s){const o=this._pipe.push(e,t,n);return Kr(o,s)}pop(){return this._pipe.pop()}shift(){return this._pipe.shift()}unshift(e,t,n=!1,s){const o=this._pipe.unshift(e,t,n);return Kr(o,s)}getTail(e){const t=this._pipe.tail;if(t)return Kr(t,e)}getHead(e){const t=this._pipe.head;if(t)return Kr(t,e)}}class Ne extends st{constructor(t,n,s){super();p(this,"_changed");p(this,"_value");p(this,"_oldValue");p(this,"toChangeFunc");this._equalsFunc=n,this._assignFunc=s,this._value=this._assignFunc&&this._assignFunc(t,void 0)||t}get assignFunc(){return this._assignFunc}get equalsFunc(){return this._equalsFunc}equals(t){return this._equalsFunc?this._equalsFunc(this._value,t):this._value===t}set value(t){if(this._equalsFunc?!this._equalsFunc(this._value,t):this._value!==t){if(this.toChangeFunc&&!this.toChangeFunc(t,this._value))return;this._assignFunc?(this._oldValue=this._assignFunc(this._value,this._oldValue),this._value=this._assignFunc(t,this._value)):(this._oldValue=this._value,this._value=t),this._changed&&this._changed.emit(t,this._oldValue)}}get value(){return this._value}get changed(){return this._changed||(this._changed=this.disposeVar(new H)),this._changed}forceChange(){this._changed&&this._changed.emit(this._value,this._value)}}function it(i,e,t){return new Ne(i,e,t)}function vt(i){return new Ne(i,(e,t)=>e.length!==t.length?!1:e.every((n,s)=>n===t[s]),(e,t)=>{const n=t||new Array(e.length);return n.length=e.length,e.forEach((s,o)=>n[o]=s),n})}function Wt(i){return it(i,(e,t)=>e===void 0||t===void 0?e===void 0&&t===void 0:e.length!==t.length?!1:e.every((n,s)=>n===t[s]),(e,t)=>{if(!e)return;const n=t||new Array(e.length);return n.length=e.length,e.forEach((s,o)=>n[o]=s),n})}function qh(i,e,t){return it(i,(n,s)=>n.length!==s.length?!1:n.every((o,h)=>e&&e(o,s[h])||o===s[h]),(n,s)=>{const o=s||new Array(n.length);return o.length=n.length,n.forEach((h,l)=>{o[l]=t?t(h):h}),o})}function ms(i,e,t){return it(i,(n,s)=>n===void 0||s===void 0?n===void 0&&s===void 0:n.length!==s.length?!1:n.every((o,h)=>e&&e(o,s[h])||o===s[h]),(n,s)=>{if(!n)return;const o=s||new Array(n.length);return o.length=n.length,n.forEach((h,l)=>{o[l]=t?t(h):h}),o})}function At(i){return new Ne(i,(e,t)=>e===t||e!==void 0&&t!==void 0&&JSON.stringify(e)===JSON.stringify(t),(e,t)=>{if(e!==void 0)return JSON.parse(JSON.stringify(e))})}function re(i){return new Ne(i,(e,t)=>e===t||e!==void 0&&t!==void 0&&JSON.stringify(e)===JSON.stringify(t),(e,t)=>{if(e!==void 0)return JSON.parse(JSON.stringify(e))})}function k1(i){return new Ne(i,(e,t)=>{if(e===t)return!0;if(e===void 0||t===void 0)return!1;const n=Object.keys(e),s=Object.keys(t);return n.length!==s.length?!1:n.every((o,h)=>o===s[h]&&e[o]===t[o])},(e,t)=>e&&{...e})}function O1(i){return new Ne(i,(e,t)=>{if(e===t)return!0;if(e===void 0||t===void 0)return!1;const n=Object.keys(e),s=Object.keys(t);return n.length!==s.length?!1:n.every((o,h)=>o===s[h]&&e[o]===t[o])},(e,t)=>e&&{...e})}function N1(i){return qh(i,(e,t)=>e.every((n,s)=>n===t[s]),e=>[...e])}function Hu(i){return ms(i,(e,t)=>e.every((n,s)=>n===t[s]),e=>[...e])}function R1(i){return qh(i,(e,t)=>JSON.stringify(e)===JSON.stringify(t),e=>JSON.parse(JSON.stringify(e)))}function A1(i){return ms(i,(e,t)=>JSON.stringify(e)===JSON.stringify(t),e=>JSON.parse(JSON.stringify(e)))}function vs(i){return Hu(i)}function Xu(i){return ms(i,(e,t)=>e.length===t.length&&e.every((n,s)=>n.every((o,h)=>o===t[s][h])),e=>e.map(t=>[...t]))}function D1(i){return ms(i,(e,t)=>e.length===t.length&&e.every((n,s)=>n.every((o,h)=>o===t[s][h])),e=>e.map(t=>[...t]))}function $h(i){const e=i instanceof Ne?[i,"value","changed"]:[...i];return e[2]=e[2]||e[1]+"Changed",e}function Yu(i,e,t,n=!1){e[2]=e[2]||e[1]+"Changed";const s=()=>{const o=e[0][e[1]];t?i[0][i[1]]=t(o):i[0][i[1]]=o};return s(),n?e[0][e[2]].disposableWeakOn(s):e[0][e[2]].disposableOn(s)}function L1(i,e,t,n,s=!1){const o=Yu(i,e,t,s),h=Yu(e,i,n,s);return()=>(o(),h())}function Q(i,e,t,n=!1){const s=i instanceof Ne?[i,"value","changed"]:i,o=e instanceof Ne?[e,"value","changed"]:e;return Yu(s,o,t,n)}function mt(i,e,t,n,s=!1){const o=$h(i),h=$h(e);return L1(o,h,t,n,s)}function F1(i,e,t,n=!1){const[s]=wo(e);return mt(i,e,o=>o??t,o=>{if(!(o===t&&s()===void 0))return o},n)}function Zr(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(i){var e=Math.random()*16|0,t=i==="x"?e:e&3|8;return t.toString(16)})}function Wh(i,e){if(!window||!window.setTimeout||!window.clearTimeout)throw new Error("目前只适合在浏览器中使用!");let t=0;function n(){t>0&&(window.clearTimeout(t),t=0)}function s(...o){n(),t=window.setTimeout(i,e,...o)}return[s,n]}function Ju(i,e,...t){const n=setInterval(i,e,...t);return()=>clearInterval(n)}function Ku(i,e,...t){const n=setTimeout(i,e,...t);return()=>clearTimeout(n)}function Hh(i,...e){let t;const n=()=>{const s=performance.now();i(s,...e),t=requestAnimationFrame(n)};return n(),()=>typeof t<"u"&&(cancelAnimationFrame(t),t=void 0)}function Qr(i,...e){let t;return t=requestAnimationFrame(()=>{const s=performance.now();i(s,...e)}),()=>typeof t<"u"&&(cancelAnimationFrame(t),t=void 0)}function So(i,...e){let t=!1,n;return new Promise((s,o)=>{n=o,s()}).then(()=>{!t&&i(...e)}).catch(s=>{console.error(s)}),()=>(t=!0)&&n&&(n("nextMicroTask cancelled!"),n=void 0)}class Xh extends H{constructor(t,n,...s){super();p(this,"_cancellFunc");this._nextFunc=t,this.dispose(()=>{this._cancellFunc&&(this._cancellFunc(),this._cancellFunc=void 0)}),s.forEach(o=>this.dispose(o[n?"dwon":"don"](()=>{this.next()})))}next(){this._cancellFunc||(this._cancellFunc=this._nextFunc(()=>(this._cancellFunc=void 0,this.emit())))}flush(){this._cancellFunc&&(this._cancellFunc(),this._cancellFunc=void 0,this.emit())}}class Zu extends Xh{constructor(...e){super(So,!1,...e)}}function G1(...i){return new Zu(...i)}class j1 extends Xh{constructor(...e){super(So,!0,...e)}}function B1(...i){return new Zu(...i)}class Yh extends Xh{constructor(...e){super(Qr,!1,...e)}}function we(...i){return new Yh(...i)}function z1(i,e){return new Yh(...i).don(e())}class dp extends Xh{constructor(...e){super(Qr,!0,...e)}}function U1(...i){return new dp(...i)}function Me(i,e,t={time:"don",immediate:!1}){const n=new Yh(...Array.isArray(i)?i:[i]),s=n[t.time??"don"](e);return(t.immediate??!1)&&e(),()=>{s(),n.destroy()}}function xo(i){let e;if(typeof i.next=="function")e=i;else if(typeof i[Symbol.iterator]=="function")e=i[Symbol.iterator]();else throw new Error("iteratorOrIterable error!");return e}function Qu(i,e){let t=!1;const n=xo(i);let s=-1;for(;;){const{done:o,value:h}=n.next();if(o)break;if(e(h,++s)){t=!0;break}}return t}function tc(i,e){return!Qu(i,(n,s)=>!e(n,s))}function bo(i,e,t,n){const s=i;if(!s[e]){const o=n(),h=Object.fromEntries(Object.entries(o).filter(([l,d])=>{const f=Object.getPrototypeOf(t),v=l in f;if(v){const m=d instanceof Ne?d.value:d;i[l]=m}return!v}).map(([l,d])=>d instanceof Ne?[l,d]:[l,Array.isArray(d)?Wt(d):it(d)]));s[e]=h}return s[e]}function ys(i,e){var n;const t=Symbol(`${(n=i==null?void 0:i.constructor)==null?void 0:n.name}-createDefaultProps`);i.constructor.__xbsj_dpSymbol=t,i.constructor.__xbsj_createDefaultProps=e;for(let[s,o]of Object.entries(e()))if(!Reflect.has(i,s)){const h=function(l){var v,m;if(l[t])return;const d=[];let f=Object.getPrototypeOf(l);for(;f;)d.push(f),f=Object.getPrototypeOf(f);d.reverse();for(let y of d){const w=(v=y.constructor)==null?void 0:v.__xbsj_dpSymbol;if(!w)continue;const S=(m=y.constructor)==null?void 0:m.__xbsj_createDefaultProps;S&&bo(l,w,y,S)}};Object.defineProperties(i,{[s]:{get(){return h(this),bo(this,t,i,e)[s].value},set(l){h(this);const d=bo(this,t,i,e)[s];if(!d){console.error("!propObj");debugger}d.value=l}},[`${s}Changed`]:{get(){return h(this),bo(this,t,i,e)[s].changed}},[`${s}React`]:{get(){return h(this),bo(this,t,i,e)[s]}}})}}const Po=new WeakMap;function yn(i,e,t){Po.has(i)||Po.set(i,{});const n=Po.get(i);n[e]=t}function _i(i,e){return Po.has(i)?Po.get(i)[e]:void 0}function _n(i,e){const t=xo(i);let n=0;for(;;){const{done:s,value:o}=t.next();if(s)break;e(o,n++)}}function Co(i,e,t){const n=xo(i);let s=t,o=0;for(;;){const{done:h,value:l}=n.next();if(h)break;s=e(s,l,o++)}return s}const V1=i=>++i;function ec(i){return Co(i,V1,0)}function Yn(i){return Co(i,(e,t)=>e>t?e:t,Number.NEGATIVE_INFINITY)}function _s(i){return Co(i,(e,t)=>e<t?e:t,Number.POSITIVE_INFINITY)}function fp(i,e){let t=i;for(let n of e)t=t[n];return t}function q1(i,e,t){if(e.length===0)throw new Error("props的数量必须大于0");const n=e.length-1,s=e[n];let o=i;for(let h=0;h<n;++h){const l=e[h];typeof o[l]>"u"&&(o[l]={}),o=o[l]}o[s]=t}function*Js(i,e){const t=xo(i);for(;;){const{done:n,value:s}=t.next();if(n)break;yield fp(s,e)}}class Io extends st{constructor(){super();p(this,"_innerObj");p(this,"_toChangeEvent");p(this,"_changedEvent");this._innerObj=[],this.dispose(()=>{if(this.length=0,this._innerObj.length>0)throw new Error("this._innerObj.length > 0");this._toChangeEvent&&this._toChangeEvent.reset(),this._innerObj=void 0})}get toChangeEvent(){return this._toChangeEvent||(this._toChangeEvent=new H),this._toChangeEvent}get changedEvent(){return this._changedEvent||(this._changedEvent=new H),this._changedEvent}_resetArray(t){this._toChangeEvent&&this._toChangeEvent.emit([{start:0,deleteCount:this._innerObj.length,items:t}],this);const{length:n}=t;this._innerObj.length=n;for(let s=0;s<n;++s)this._innerObj[s]=t[s];this._changedEvent&&this._changedEvent.emit(this)}splice(t,n,...s){const{length:o}=this._innerObj;t=t>this._innerObj.length?this._innerObj.length:t,t>o?t=o:t<0&&(t+=o,t<0&&(t=0));const h=this._innerObj.length-t;if(n>h?n=h:n<0&&(n=0),arguments.length===1){this._toChangeEvent&&this._toChangeEvent.emit([{start:t,deleteCount:this._innerObj.length-t,items:[]}],this);const l=this._innerObj.splice(t);return this._changedEvent&&this._changedEvent.emit(this),l}else if(arguments.length===2){this._toChangeEvent&&this._toChangeEvent.emit([{start:t,deleteCount:n,items:[]}],this);const l=this._innerObj.splice(t,n);return this._changedEvent&&this._changedEvent.emit(this),l}else{this._toChangeEvent&&this._toChangeEvent.emit([{start:t,deleteCount:n,items:s}],this);const l=this._innerObj.splice(t,n,...s);return this._changedEvent&&this._changedEvent.emit(this),l}}pop(){if(this._innerObj.length===0)return;if(this._toChangeEvent){const n=this._innerObj.length-1,s=1,o=[];this._toChangeEvent.emit([{start:n,deleteCount:s,items:o}],this)}const t=this._innerObj.pop();return this._changedEvent&&this._changedEvent.emit(this),t}push(...t){if(this._toChangeEvent){const s=this._innerObj.length;this._toChangeEvent.emit([{start:s,deleteCount:0,items:t}],this)}const n=this._innerObj.push(...t);return this._changedEvent&&this._changedEvent.emit(this),n}get length(){return this._innerObj.length}set length(t){if(t<0)throw new Error("value < 0");const{length:n}=this._innerObj;if(n!==t){if(this._toChangeEvent){let s,o,h;n>t?(s=t,o=n-t,h=[]):(s=n,o=0,h=new Array(t-n)),this._toChangeEvent.emit([{start:s,deleteCount:o,items:h}],this)}this._innerObj.length=t,this._changedEvent&&this._changedEvent.emit(this)}}get(t){return this._innerObj[t]}set(t,n){const{length:s}=this._innerObj;if(t<0||t>=s)throw new Error("index < 0 || index >= length");this._toChangeEvent&&this._toChangeEvent.emit([{start:t,deleteCount:1,items:[n]}],this),this._innerObj[t]=n,this._changedEvent&&this._changedEvent.emit(this)}indexOf(t){return this._innerObj.indexOf(t)}[Symbol.iterator](){return this._innerObj[Symbol.iterator]()}}function ic(i,e,...t){let n=i;for(let s of t){if(!n[s])if(e)n[s]={};else return;n=n[s]}return n}function $1(i,e,t){typeof t>"u"&&(e.endsWith(".gltf")?t="model/gltf+json":e.endsWith(".bin")?t="application/octet-stream":e.endsWith(".glb")?t="model/gltf-binary":e.endsWith(".jpg")||e.endsWith(".jpeg")?t="image/jpeg":e.endsWith(".png")?t="image/png":e.endsWith(".glsl")?t="text/plain":e.endsWith(".json")?t="application/json":e.endsWith(".b3dm")||e.endsWith(".i3dm")||e.endsWith("pnts")||e.endsWith("cmpt")?t="application/octet-stream":console.warn(`save ${e}: MimeType无法确定!`));const n=new Blob([i],{type:t||""});let s=URL.createObjectURL(n);var o=document.createElement("a"),h=new MouseEvent("click");o.download=e,o.href=s,o.dispatchEvent(h),URL.revokeObjectURL(s)}function W1(i,e){const t=document.createElement("a"),n=new MouseEvent("click");t.download=e||"下载",t.href=i,t.dispatchEvent(n)}function H1(){return new Promise((i,e)=>{const t=performance.now();requestAnimationFrame(n=>i(n>t))})}const Jh=i=>{let e,t;return t=n=>{n=performance.now(),e=requestAnimationFrame(t),i(n)},e=requestAnimationFrame(t),()=>{cancelAnimationFrame(e)}};function nc(i,e,t=Jh){let n=Number.NEGATIVE_INFINITY,s;function o(d){d-n>e&&s&&(i(...s),s=void 0,n=d)}const h=t&&t(o)||void 0;function l(...d){s=d}return[l,h]}const gp=[];function pp(i,e,t){if(gp.includes(i)){console.warn(`_loadJs ${i} has loaded before!`),e&&e();return}var n=document.getElementsByTagName("head")[0],s=document.createElement("script");s.setAttribute("type","text/javascript"),s.setAttribute("src",i),s.onload=s.onreadystatechange=function(){this.readyState&&this.readyState!=="complete"||(gp.push(i),e&&e(),s.onload=s.onreadystatechange=null)},s.onerror=(o,h,l,d,f)=>{t(f)},n.appendChild(s)}function sc(i,e=!0){if(e){const t=window.L;window.L&&(window.L=void 0);const n=window.define;return window.define&&(window.define=void 0),new Promise((s,o)=>{pp(i,s,o)}).then(()=>(window.define=n,window.L=t,Promise.resolve()))}else return new Promise((t,n)=>{pp(i,t,n)})}async function mp(i,e=""){return new Promise((t,n)=>{var s=new Image;s.crossOrigin=e,s.src=i,s.onload=()=>t(s),s.onerror=o=>n(o)})}class X1 extends st{constructor(e){super(),this._owner=e}get owner(){return this._owner}}function vp(i,e){if(i.length%3!==0)throw new Error("positions.length % 3 !== 0");const t=i.length/3;function*n(h){for(let l=0;l<t;++l)yield i[l*3+h]}const s=(e==null?void 0:e.min)??[NaN,NaN,NaN],o=(e==null?void 0:e.max)??[NaN,NaN,NaN];return s[0]=_s(n(0))??NaN,s[1]=_s(n(1))??NaN,s[2]=_s(n(2))??NaN,o[0]=Yn(n(0))??NaN,o[1]=Yn(n(1))??NaN,o[2]=Yn(n(2))??NaN,{min:s,max:o}}async function Y1(i,e=fetch){const t=await e(i);return t.ok?await t.arrayBuffer():void 0}class J1 extends st{constructor(t){super();p(this,"_map",new Map);p(this,"_array",[]);p(this,"_createEvent",this.dv(new H));p(this,"_updateEvent",this.dv(new H));p(this,"_destroyEvent",this.dv(new H));this._idFunc=t,this.d(()=>{this._array.length>0&&console.warn("EventFromArrayUpdating: destroy with non-empty array, will trigger destroy event for all items")})}get createEvent(){return this._createEvent}get updateEvent(){return this._updateEvent}get destroyEvent(){return this._destroyEvent}update(t,n={toDel:!0,toAdd:!0,toUpdate:!0}){const{toDel:s=!0,toAdd:o=!0,toUpdate:h=!0}=n;for(let d of this._array)d.updated=!1;const l=t.length;for(let d=0;d<l;++d){const f=t[d],v=this._idFunc(f,d);if(this._map.has(v)){if(h){const m=this._map.get(v);if(!m)throw new Error("!edwi");m.updated=!0,m.item=f,this._updateEvent.emit(v,f)}}else if(o){const m={item:f,id:v,updated:!0};this._array.push(m),this._map.set(v,m),this._createEvent.emit(v,f)}}if(s){const d=this._array.filter(f=>!f.updated);this._array=this._array.filter(f=>f.updated);for(let f of d)this._map.delete(f.id);for(let f of d)this._destroyEvent.emit(f.id,f.item)}}}function Kh(i,...e){if(i>16)throw new Error("length > 16");const t=new Array(i);for(let n=0;n<i;++n)t[n]=e[n]??0;return t}class Zh{constructor(e,t){this._xyzw=e,this._length=t}set 0(e){this._xyzw.x=e}set 1(e){this._xyzw.y=e}set 2(e){this._xyzw.z=e}set 3(e){this._xyzw.w=e}get 0(){return this._xyzw.x??0}get 1(){return this._xyzw.y??0}get 2(){return this._xyzw.z??0}get 3(){return this._xyzw.w??0}get length(){return this._length}}function K1(i){return new Zh(i,2)}function Z1(i){return new Zh(i,3)}function Q1(i){return new Zh(i,4)}class tw{constructor(e,t,n,s){this._array=e,this._length=t,this._start=n,this._stride=s}get length(){return this._length}set 0(e){this._array[this._start+0*this._stride]=e}set 1(e){this._array[this._start+1*this._stride]=e}set 2(e){this._array[this._start+2*this._stride]=e}set 3(e){this._array[this._start+3*this._stride]=e}set 4(e){this._array[this._start+4*this._stride]=e}set 5(e){this._array[this._start+5*this._stride]=e}set 6(e){this._array[this._start+6*this._stride]=e}set 7(e){this._array[this._start+7*this._stride]=e}set 8(e){this._array[this._start+8*this._stride]=e}set 9(e){this._array[this._start+9*this._stride]=e}set 10(e){this._array[this._start+10*this._stride]=e}set 11(e){this._array[this._start+11*this._stride]=e}set 12(e){this._array[this._start+12*this._stride]=e}set 13(e){this._array[this._start+13*this._stride]=e}set 14(e){this._array[this._start+14*this._stride]=e}set 15(e){this._array[this._start+15*this._stride]=e}set 16(e){this._array[this._start+16*this._stride]=e}get 0(){return this._array[this._start+0*this._stride]}get 1(){return this._array[this._start+1*this._stride]}get 2(){return this._array[this._start+2*this._stride]}get 3(){return this._array[this._start+3*this._stride]}get 4(){return this._array[this._start+4*this._stride]}get 5(){return this._array[this._start+5*this._stride]}get 6(){return this._array[this._start+6*this._stride]}get 7(){return this._array[this._start+7*this._stride]}get 8(){return this._array[this._start+8*this._stride]}get 9(){return this._array[this._start+9*this._stride]}get 10(){return this._array[this._start+10*this._stride]}get 11(){return this._array[this._start+11*this._stride]}get 12(){return this._array[this._start+12*this._stride]}get 13(){return this._array[this._start+13*this._stride]}get 14(){return this._array[this._start+14*this._stride]}get 15(){return this._array[this._start+15*this._stride]}get 16(){return this._array[this._start+16*this._stride]}}function ew(i,e,t=0,n=1){return new tw(i,e,t,n)}b.Vector=void 0,(i=>{function e(A,...at){if(A=A||Kh(at.length),at.length>A.length)throw new Error("args.length > target.length");return A instanceof Float64Array?A.set(at):G(at,A),A}i.set=e;function t(A,at){const Pt=A.length;for(let It=0;It<Pt;++It)if(!at(A[It],It))return!1;return!0}i.every=t;function n(A,at,Pt){const It=A.length;let se=Pt;for(let le=0;le<It;++le)se=at(se,A[le],le);return se}i.reduce=n;function*s(A){for(let at=0;at<A.length;++at)yield A[at]}i.itr=s;const o=(A,at)=>A+=at*at;function h(A){return n(A,o,0)}i.magnitudeSquared=h;function l(A){const at=h(A);return Math.sqrt(at)}i.magnitude=l;function d(A,at=1e-5){const Pt=h(A);return Math.abs(Pt-1)<at}i.isNormalized=d;let f;const v=(A,at,Pt)=>A+at*f[Pt];function m(A,at){return V(A,at),f=at,n(A,v,0)}i.dot=m;let y;const w=(A,at,Pt)=>A+=(at-y[Pt])*(at-y[Pt]);function S(A,at){return V(A,at),y=at,n(A,w,0)}i.distanceSquared=S;function T(A,at){return Math.sqrt(S(A,at))}i.distance=T;let N;const j=(A,at)=>A===N[at];function C(A,at){return V(A,at),N=at,t(A,j)}i.equals=C;let k,M;const D=(A,at)=>Math.abs(A-k[at])<M;function L(A,at,Pt=0){return V(A,at),k=at,M=Pt,t(A,D)}i.equalsEpsilon=L;function V(A,at){if(A.length!==at.length)throw new Error("left.length !== right.length")}function x(A,at,Pt){const It=A.length;Pt=Pt||Kh(It),V(A,Pt);for(let se=0;se<It;++se)Pt[se]=at(A[se],se);return Pt}i.op1=x;function I(A,at,Pt,It){V(A,at),It&&V(A,It);const se=A.length;It=It||Kh(se);for(let le=0;le<se;++le)It[le]=Pt(A[le],at[le]);return It}i.op2=I;const R=A=>A;function G(A,at){return x(A,R,at)}i.clone=G;let F=0;const U=(A,at)=>A*F;function z(A,at,Pt){return F=at,x(A,U,Pt)}i.multiplyByScalar=z;function $(A,at,Pt=0){const It=h(A);if(It<=Pt)return;const se=Math.sqrt(It);return z(A,1/se,at)}i.normalize=$;function W(A,at){return z(A,-1,at)}i.negate=W;const X=A=>Math.abs(A);function Y(A,at){return x(A,X,at)}i.abs=Y;const et=A=>A-Math.floor(A);function J(A,at){return x(A,et,at)}i.fract=J;const rt=(A,at)=>A-at;function ht(A,at,Pt){return I(A,at,rt,Pt)}i.subtract=ht;const Ot=(A,at)=>A+at;function ct(A,at,Pt){return I(A,at,Ot,Pt)}i.add=ct;const _t=(A,at)=>A*at;function Ct(A,at,Pt){return I(A,at,_t,Pt)}i.multiply=Ct;const Lt=(A,at)=>A/at;function K(A,at,Pt){return I(A,at,Lt,Pt)}i.divide=K;let Qt;const zt=(A,at)=>A*(1-Qt)+at*Qt;function gt(A,at,Pt,It){return Qt=Pt,I(A,at,zt,It)}i.lerp=gt})(b.Vector||(b.Vector={}));function Qh(i,e=0,t=1){return i<e?e:i>t?t:i}class tl extends st{constructor(t,n,s,o,h,l,d,f){super();p(this,"__status");p(this,"_statusChangedEvent");p(this,"_forceCancelFunc");p(this,"_startEvent");p(this,"_progressEvent");p(this,"_completeEvent");p(this,"_cancelEvent");p(this,"_cancelledEvent");p(this,"_errorEvent");p(this,"_finishedEvent");p(this,"_processingID",-1);this._startProcessingFunc=t,this.startFunc=n,this.progressFunc=s,this.completeFunc=o,this.cancelFunc=h,this.cancelledFunc=l,this.errorFunc=d,this.finishedFunc=f,this._status="Initial",this.dispose(()=>{var v;return(v=this._statusChangedEvent)==null?void 0:v.destroy()}),this.dispose(()=>{var v;return(v=this._startEvent)==null?void 0:v.destroy()}),this.dispose(()=>{var v;return(v=this._progressEvent)==null?void 0:v.destroy()}),this.dispose(()=>{var v;return(v=this._completeEvent)==null?void 0:v.destroy()}),this.dispose(()=>{var v;return(v=this._cancelEvent)==null?void 0:v.destroy()}),this.dispose(()=>{var v;return(v=this._cancelledEvent)==null?void 0:v.destroy()}),this.dispose(()=>{var v;return(v=this._errorEvent)==null?void 0:v.destroy()}),this.dispose(()=>{var v;return(v=this._finishedEvent)==null?void 0:v.destroy()}),this.dispose(()=>this.reset())}get startEvent(){return this._startEvent=this._startEvent||new H,this._startEvent}get progressEvent(){return this._progressEvent=this._progressEvent||new H,this._progressEvent}get completeEvent(){return this._completeEvent=this._completeEvent||new H,this._completeEvent}get cancelEvent(){return this._cancelEvent=this._cancelEvent||new H,this._cancelEvent}get cancelledEvent(){return this._cancelledEvent=this._cancelledEvent||new H,this._cancelledEvent}get errorEvent(){return this._errorEvent=this._errorEvent||new H,this._errorEvent}get finishedEvent(){return this._finishedEvent=this._finishedEvent||new H,this._finishedEvent}_completeFunc(t,n){this.processingID===t&&this._status==="Running"&&(this._status="Completed",this.completeFunc&&this.completeFunc(n),this._completeEvent&&this._completeEvent.emit(n),this.finishedFunc&&this.finishedFunc({status:"Completed",value:n}),this._finishedEvent&&this._finishedEvent.emit({status:"Completed",value:n}))}_cancelFunc(t){this._status==="Running"&&(this._status="Cancelling",this.cancelFunc&&this.cancelFunc(t),this._cancelEvent&&this._cancelEvent.emit(t))}_cancelledFunc(t){this._status==="Cancelling"&&(this._status="Cancelled",this.cancelledFunc&&this.cancelledFunc(t),this._cancelledEvent&&this._cancelledEvent.emit(t),this.finishedFunc&&this.finishedFunc({status:"Cancelled",cancelError:t}),this._finishedEvent&&this._finishedEvent.emit({status:"Cancelled",cancelError:t}))}_errorFunc(t,n){this.processingID===t&&this._status==="Running"&&(this._status="Error",this.errorFunc&&this.errorFunc(n),this._errorEvent&&this._errorEvent.emit(n),this.finishedFunc&&this.finishedFunc({status:"Error",error:n}),this._finishedEvent&&this._finishedEvent.emit({status:"Error",error:n}))}_progressFunc(t,n){this.processingID===t&&this._status==="Running"&&(this.progressFunc&&this.progressFunc(n),this._progressEvent&&this._progressEvent.emit(n))}_startFunc(...t){if(this._status==="Initial"){this._status="Running";const n=++this._processingID,s={completeFunc:this._completeFunc.bind(this,n),errorFunc:this._errorFunc.bind(this,n),progressFunc:this._progressFunc.bind(this,n),cancelFunc:this._cancel.bind(this,n),processingID:n},o=this._startProcessingFunc(s,...t);return this._forceCancelFunc=o,this.startFunc&&this.startFunc(...t),this._startEvent&&this._startEvent.emit(...t),n}else return console.warn("this._status !== 'Initial' but start again!"),-1}set _status(t){if(this.__status!==t){const n=this.__status;this.__status=t,this._statusChangedEvent&&this._statusChangedEvent.emit(t,n)}}get _status(){return this.__status}get processingID(){return this._processingID}get statusChangedEvent(){return this._statusChangedEvent||(this._statusChangedEvent=new H),this._statusChangedEvent}reset(t){this._status==="Running"&&this.cancel(t),this._status==="Cancelled"||this._status==="Error"||this._status==="Completed"?this._status="Initial":this._status==="Cancelling"&&console.warn("Cannot reset! (this._status === 'Cancelling')")}get status(){return this._status}cancel(t,n=this.processingID){return this._cancel(n,t)}_cancel(t,n){if(this.processingID===t)if(this._status==="Running"){if(!this._forceCancelFunc)throw new Error("this._forceCancelFunc is undefined!");this._cancelFunc(n);const s=this._forceCancelFunc(n);if(this._forceCancelFunc=void 0,s&&s instanceof Promise)return s.then(()=>{this._cancelledFunc(n)});this._cancelledFunc(n)}else console.warn("this._status !== 'Running' but cancel")}start(...t){try{return this._startFunc(...t)}catch(n){console.error(`processing start error: ${n}`)}}restart(t,...n){try{return this.isRunning&&this.cancel(t),this.isFinished&&this.reset(t),this.isInitial?this._startFunc(...n):(console.warn("restart failed!"),-1)}catch(s){console.error(`processing restart error: ${s}`)}}get isCompleted(){return this._status==="Completed"}get isCancelled(){return this._status==="Cancelled"}get isCancelling(){return this._status==="Cancelling"}get isError(){return this._status==="Error"}get isInitial(){return this._status==="Initial"}get isRunning(){return this._status==="Running"}get isFinished(){return this.isCancelled||this.isCompleted||this.isError}}let rc=class extends Error{};function yp(i,e){typeof i=="function"?i(e):i.cancelFunc=e}class ac extends tl{constructor(t=300){super(({progressFunc:n,completeFunc:s,errorFunc:o})=>{const[h,l]=Wh(()=>{if(!this._lastDebounceValue)throw new Error("!this._lastDebounceValue");n([this._lastDebounceValue,this._debouncTimes]),this._debouncTimes=0},this._delayTime);return this._d=h,()=>{l()}});p(this,"_lastDebounceValue");p(this,"_debouncTimes",0);p(this,"_d");this._delayTime=t}get delayTime(){return this._delayTime}debounce(...t){this.isRunning?(++this._debouncTimes,this._lastDebounceValue=t,this._d&&this._d()):console.warn("Debouncing is not running!")}}function _p(i,e,...t){const n=new AbortController;let s=n.signal,[o,h]=t;if(h!=null&&h.signal)throw console.error("init?.signal"),new Error("init?.signal");h=h||{},h.signal=s;let l=!1;yp(i,()=>{l=!0,n.abort()});let d=fetch(o,h);return e&&(d=d.then(f=>{if(!f.ok)return f;if(!f.body)throw Error("ReadableStream not yet supported in this browser.");const v=f.headers.get("content-length"),m=v?parseInt(v,10):0;let y=0;return new Response(new ReadableStream({start(w){if(!f.body)throw new Error("!response.body");const S=f.body.getReader();T();function T(){S.read().then(({done:N,value:j})=>{if(N){w.close();return}if(!j)throw new Error("!value");if(!e)throw new Error("!progressFunc");y+=j.byteLength,e(y,m),w.enqueue(j),T()}).catch(N=>{w.error(N)})}}}),{status:f.status,statusText:f.statusText,headers:f.headers})}).catch(f=>{throw l?(f instanceof Error&&f.code!==20&&console.error("error.code !== 20"),console.log("fetching cancelled!"),new rc("fetching cancelled!")):(f instanceof Error&&f.code===20&&console.error("error.code === 20"),f)})),d}function wp(...i){if(i.length>=1)if(typeof i[0]=="function"||typeof i[0]>"u"){const e={};let t=_p(e,...i);const{cancelFunc:n}=e;if(!n)throw new Error("!cancelResult.cancelFunc");return[n,t]}else return _p(...i);throw new Error("cancelableFetch args error!")}class iw extends tl{constructor(t,...n){super(({progressFunc:s,completeFunc:o,errorFunc:h},...l)=>{const d={};let f={loaded:0,total:0};const v=(w,S)=>{f.loaded=w,f.total=S,s(f)},m=this._fetchArgs||l;if(m.length===0)throw new Error("fetchArgs.length === 0");if(wp(d,v,...m).then(t).then(o).catch(w=>{w instanceof rc||h(w)}),!d.cancelFunc)throw new Error("!cancelResult.cancelFunc");return d.cancelFunc});p(this,"_fetchArgs");n.length>0&&(this._fetchArgs=n)}get fetchArgs(){return this._fetchArgs}}function oc(i,e,t,n){const s="_"+e,o="_"+e+"Changed",h=e+"Changed";Object.defineProperties(i.prototype,{[e]:{get(){return typeof this[s]>"u"&&typeof t<"u"&&(this[s]=t),this[s]},set(l){if(typeof this[s]>"u"&&typeof t<"u"&&(this[s]=t),n?!n(this[s],l):this[s]!==l){const d=this[s];this[s]=l,this[o]&&this[o].emit(l,d)}}},[h]:{get(){return typeof this[o]>"u"&&(this[o]=new H,typeof this.dispose<"u"&&this.dispose(()=>this[o].destroy())),this[o]}}})}class hc extends tl{constructor(t,n=!0){super(({progressFunc:s,completeFunc:o,errorFunc:h})=>(this._intervalFunc=s,this._intervalID&&console.error("this._intervalID should be undefined!"),this.leading&&s(),this._intervalID=setInterval(s,this.intervalTime),()=>{if(!this._intervalID)throw console.error("this._intervalID should not be undefined!"),new Error("this._intervalID should not be undefined!");clearInterval(this._intervalID),this._intervalID=void 0}));p(this,"_intervalID");p(this,"_intervalFunc");this.intervalTime=t,this.leading=n,this.dispose(this.intervalTimeChanged.disposableOn(()=>{this._intervalID&&this._intervalFunc&&(clearInterval(this._intervalID),this._intervalID=setInterval(this._intervalFunc,this.intervalTime))}))}}oc(hc,"leading",!0),oc(hc,"intervalTime",500);function nw(i,e){let t,n;const s=new Promise((h,l)=>{n=l,t=globalThis.setTimeout(()=>{t=void 0,h()},i)}),o=h=>{t&&(clearTimeout(t),t=void 0),n&&n(h??new rc("sleep cancel error!"))};if(typeof e=="boolean"&&e)return[o,s];if(e)return yp(e,o),s}class sw{constructor(e=0,t=0,n=0,s,o){p(this,"_processData");p(this,"_lastUpdateTimeStamp",0);this.startTime=e,this.duration=t,this.delay=n,this.proccessFunc=s,this.completeFunc=o,this._processData={ratio:0,timeStamp:0,timeStampFromStart:0,timeStampFromLastUpdate:0}}update(e){const t=(e-this.startTime)/this.duration;t>=0&&(this._processData.ratio=t,this._processData.timeStamp=e,this._processData.timeStampFromStart=e-this.startTime,this._processData.timeStampFromLastUpdate=e-this._lastUpdateTimeStamp,this._lastUpdateTimeStamp=e,this.proccessFunc&&this.proccessFunc(this._processData),t>=1&&this.completeFunc&&this.completeFunc())}start(){this.startTime=performance.now()+this.delay,this._lastUpdateTimeStamp=this.startTime}}class Ep extends tl{constructor(t=1e3,n=0,s=Jh){let o;function h(){o&&o()}super(({progressFunc:d,completeFunc:f,errorFunc:v})=>{const m=this.startUpdateFunc&&this.startUpdateFunc(this._base.update.bind(this._base))||void 0;return this._base.startTime=performance.now(),this._base.duration=this.duration,this._base.delay=this.delay,this._base.proccessFunc=d,this._base.completeFunc=()=>{m&&m(),f()},this._base.start(),o=m,h});p(this,"_base");p(this,"duration");p(this,"delay");p(this,"startUpdateFunc");this._base=new sw,this.duration=t,this.delay=n,this.startUpdateFunc=s}get startTime(){return this._base.startTime}}class rw extends st{constructor(t){super();p(this,"_target",0);p(this,"_current",0);p(this,"_start",0);p(this,"_timing",new Ep(Number.POSITIVE_INFINITY));p(this,"_currentChanged");this._duration=t,this._timing.progressFunc=({ratio:n})=>{n=n<0?0:n>1?1:n;const s=this._start*(1-n)+this._target*n;this._current=s,this._currentChanged&&this._currentChanged.emit(this._target,this._current)},this.dispose(()=>{this._timing.isRunning&&this._timing.cancel(),this._timing.destroy()})}reset(t,n=t){this._timing.isRunning&&this._timing.cancel(),this._target=t,this._current=n,this._start=t}set target(t){if(this._target!==t){this._target=t,this._timing.isRunning&&this._timing.cancel(),this._timing.reset(),this._start=this._current;const n=Math.abs(this._target-this._start);this._timing.duration=n*this._duration,this._timing.start()}}get target(){return this._target}get current(){return this._current}get currentChanged(){return this._currentChanged||(this._currentChanged=new H),this._currentChanged}}function Sp(i,e){e=e||[];const t=i.parentNode;return t?Sp(t,e.concat(t)):e}function aw(i){const e=i.composedPath&&i.composedPath()||i.path,t=i.target;if(e!=null)return e.indexOf(window)<0?e.concat(window):e;if(t===window)return[window];if(t===null)throw new Error("target === null");return[t].concat(Sp(t),window)}function $e(i,e=!1){const{offsetX:t,offsetY:n}=i;let s=t,o=n;{const h=aw(i);for(let l=0;l<h.length;++l){const d=h[l];if(d!==i.currentTarget&&d instanceof HTMLElement)s+=d.clientLeft,o+=d.clientTop,s+=d.offsetLeft,o+=d.offsetTop;else break}}return e?[s*window.devicePixelRatio,o*window.devicePixelRatio]:[s,o]}function ta(i,e=!1){const t=i.target,n=i.currentTarget||i.__xbsj_lastCurrentTarget__;if(!t||!n)return[i.clientX,i.clientY];const s=t.getBoundingClientRect(),o=n.getBoundingClientRect(),h=s.left+i.offsetX,l=s.top+i.offsetY,d=h-o.left,f=l-o.top;return e?[d*window.devicePixelRatio,f*window.devicePixelRatio]:[d,f]}class xp extends st{constructor(t){super();p(this,"_clickEvent",new H);p(this,"_dbclickEvent",new H);p(this,"_downEvent",new H);p(this,"_upEvent",new H);p(this,"_moveEvent",new H);p(this,"_debouncing",new ac(300));this.dispose(()=>{this._clickEvent.destroy(),this._dbclickEvent.destroy(),this._downEvent.destroy(),this._upEvent.destroy(),this._moveEvent.destroy(),this._debouncing.destroy()});let n=!1,s=[0,0],o=!1;this._debouncing.progressFunc=([[v,m,y],w])=>{w===1?this._clickEvent.emit(v,m,y):w>=2?this._dbclickEvent.emit(v,m,y):console.error("point click should not be here!")},this._debouncing.start(),this.dispose(()=>{this._debouncing.isRunning&&this._debouncing.cancel(),this._debouncing.destroy()});const h=v=>{n=!0;const[m,y]=$e(v);s[0]=m,s[1]=y,this._downEvent.emit(m,y,v)},l=v=>{const[m,y]=$e(v);n&&!o&&this._debouncing.debounce(m,y,v),n=!1,o=!1,this._upEvent.emit(m,y,v)},d=v=>{const[m,y]=$e(v);if(n&&!o){const[w,S]=s;(Math.abs(m-w)>3||Math.abs(y-S)>3)&&(o=!0)}this._moveEvent.emit(m,y,v)},f=()=>{n=!1,o=!1};t.addEventListener("pointerdown",h),t.addEventListener("pointerup",l),t.addEventListener("pointermove",d),t.addEventListener("pointerout",f),this.dispose(()=>{t.removeEventListener("pointerdown",h),t.removeEventListener("pointerup",l),t.removeEventListener("pointermove",d),t.removeEventListener("pointerout",f)})}get clickEvent(){return this._clickEvent}get dbclickEvent(){return this._dbclickEvent}get downEvent(){return this._downEvent}get upEvent(){return this._upEvent}get moveEvent(){return this._moveEvent}}class lc extends st{constructor(){super();p(this,"_pickRectEvent",this.disposeVar(new H));p(this,"_updateRectEvent",this.disposeVar(new H));p(this,"_pointerActionEvent",this.disposeVar(new H));p(this,"_active",this.disposeVar(it(!1)));p(this,"_pickRect",{left0:0,top0:0,left1:0,top1:0});let t=0,n=0,s=0,o=0;this.dispose(this._pointerActionEvent.disposableOn(({type:h,left:l,top:d})=>{h==="PointerDown"?(this._active.value=!0,t=l,n=d,s=l,o=d,this._setPickRect({left0:t,top0:n,left1:s,top1:o}),this._updateRectEvent.emit(this._pickRect)):h==="PointerMove"?this._active.value&&(s=l,o=d,this._setPickRect({left0:t,top0:n,left1:s,top1:o}),this._updateRectEvent.emit(this._pickRect)):h==="PointerUp"&&this._active.value&&(this._active.value=!1,s=l,o=d,this._setPickRect({left0:t,top0:n,left1:s,top1:o}),this._updateRectEvent.emit(this._pickRect),this._pickRectEvent.emit(this._pickRect))}))}_setPickRect({left0:t,left1:n,top0:s,top1:o}){this._pickRect.left0=t,this._pickRect.left1=n,this._pickRect.top0=s,this._pickRect.top1=o}pointerDown(t,n){this._pointerActionEvent.emit({type:"PointerDown",left:t,top:n})}pointerMove(t,n){this._pointerActionEvent.emit({type:"PointerMove",left:t,top:n})}pointerUp(t,n){this._pointerActionEvent.emit({type:"PointerUp",left:t,top:n})}reset(){this._setPickRect({left0:0,top0:0,left1:0,top1:0}),this._updateRectEvent.emit(this._pickRect),this._pickRectEvent.emit(this._pickRect)}get activeEvent(){return this._active.changed}get updateRectEvent(){return this._updateRectEvent}get pickRectEvent(){return this._pickRectEvent}static getLeftTopAndSize(t,n){n=n||{left:0,top:0,width:0,height:0,forward:!0};const{left0:s,top0:o,left1:h,top1:l}=t;return n.width=Math.abs(s-h),n.height=Math.abs(o-l),n.left=Math.min(s,h),n.top=Math.min(o,l),n.forward=h>s,n}static contains(t,n,s){const{left:o,top:h,width:l,height:d}=s;return t>o&&t<=o+l&&n>=h&&n<=h+d}}class ow extends lc{constructor(e){super();const t=this.disposeVar(new xp(e));this.dispose(t.downEvent.disposableOn((h,l,d)=>d.altKey&&this.pointerDown(h,l))),this.dispose(t.moveEvent.disposableOn((h,l)=>this.pointerMove(h,l))),this.dispose(t.upEvent.disposableOn((h,l)=>this.pointerUp(h,l)));const n=document.createElement("div");n.style.backgroundColor="rgba(0, 0, 0, 0)",n.style.border="2px dashed red",n.style.position="absolute",n.style.boxSizing="border-box",n.style.pointerEvents="none",n.style.height="0px",n.style.width="0px",n.style.left="0px",n.style.top="0px",n.style.display="none",e.appendChild(n),this.dispose(()=>e.removeChild(n)),this.dispose(this.activeEvent.disposableOn(h=>{n.style.display=h?"block":"none"}));const s=()=>{this.reset()};e.addEventListener("contextmenu",s),this.dispose(()=>e.removeEventListener("contextmenu",s));const o={left:0,top:0,width:0,height:0,forward:!1};this.dispose(this.updateRectEvent.disposableOn(h=>{if(lc.getLeftTopAndSize(h,o)){const{left:l,top:d,width:f,height:v}=o;n.style.height=`${v|0}px`,n.style.width=`${f|0}px`,n.style.left=`${l|0}px`,n.style.top=`${d|0}px`}}))}}class tn extends Error{}function ws(i,e){_i(i,"_promise_cancel")&&console.warn("setPromiseCancel warn: promise has cancelFunc!"),yn(i,"_promise_cancel",e)}function ea(i){return _i(i,"_promise_cancel")}function ia(i){return!!ea(i)}function uc(i,e){const t=ea(i);return t?(t(e),!0):!1}function cc(i){const[e,t]=i;return ws(t,e),t}function na(i){let e;const t=new Promise((n,s)=>{e=s,i.then(n).catch(s)});return ws(t,e),t}function hw(i){let e,t;var n=new Promise((s,o)=>{t=i.disposableOn((...h)=>{t&&t(),s(h)}),e=h=>{t&&t(),o(h)}});return[e,n]}function lw(i){const e=new H,t=new H;return i.then(n=>{e.isDestroyed()||e.emit(n)}).catch(n=>{t.isDestroyed()||t.emit(n)}),[e,t]}class dc extends st{constructor(){super();p(this,"_cancelled",!1);p(this,"_cancelError");p(this,"_promiseSet",new Set);p(this,"_disposer")}get disposer(){return this._disposer=this._disposer||new st,this._disposer}destroyImp(){this.finally()}cancel(t){var n;if(!this._cancelled){this._cancelled=!0,(n=this._disposer)==null||n.destroy(),this._cancelError=t;for(let s of this._promiseSet)uc(s);this._promiseSet.clear()}}get cancelFuncsNum(){return Co(this._promiseSet,t=>t+1,0)}finally(){this._disposer&&!this._disposer.isDestroyed()&&this._disposer.destroy(),this._promiseSet.clear()}check(){if(this._cancelled)throw this._cancelError??new tn("cancel from CancelManager!")}promise(t){return this._promiseSet.add(t),t.finally(()=>(this._promiseSet.delete(t),this.check()))}promiseAny(t){const n=[],s=t.map(o=>(this._promiseSet.add(o),ia(o)&&n.push(ea(o)),o.finally(()=>this._promiseSet.delete(o))));return Promise.any(s).finally(()=>(n.forEach((o=>o(new tn("cancel from promiseAny!")))),n.length=0))}promiseAll(t){const n=[],s=t.map(o=>(this._promiseSet.add(o),ia(o)&&n.push(ea(o)),o.finally(()=>this._promiseSet.delete(o))));return Promise.all(s).finally(()=>(n.forEach((o=>o(new tn("cancel from promiseAll!")))),n.length=0))}promiseRace(t){const n=[],s=t.map(o=>(this._promiseSet.add(o),ia(o)&&n.push(ea(o)),o.finally(()=>this._promiseSet.delete(o))));return Promise.race(s).finally(()=>(n.forEach((o=>o(new tn("cancel from promiseRace!")))),n.length=0))}}class Re extends st{constructor(t){super();p(this,"_status","Initial");p(this,"_completeEvent");p(this,"_errorEvent");p(this,"_completeFunc");p(this,"_errorFunc");p(this,"_cancelFunc");p(this,"_runningId",-1);this._startFunc=t,this.dispose(()=>this.isRunning&&this.cancel())}get errorEvent(){return this._errorEvent||(this._errorEvent=new H),this._errorEvent}get completeEvent(){return this._completeEvent||(this._completeEvent=new H),this._completeEvent}get errorFunc(){return this._errorFunc}get completeFunc(){return this._completeFunc}set errorFunc(t){this._errorFunc!==t&&(this._errorFunc=t)}set completeFunc(t){this._completeFunc!==t&&(this._completeFunc=t)}start(...t){if(this._status!=="Initial")return;const n=++this._runningId;this._status="Running",this._cancelFunc=this._startFunc({completeFunc:s=>{var o;n===this._runningId&&this._status==="Running"&&(this._status="Completed",this._completeFunc&&this._completeFunc(s),(o=this._completeEvent)==null||o.emit(s))},errorFunc:s=>{var o;n===this._runningId&&this._status==="Running"&&(this._status="Error",this._errorFunc&&this._errorFunc(s),(o=this._errorEvent)==null||o.emit(s))},runningingID:n},...t)}cancel(t=new tn("")){var n;if(this._status==="Running"){if(!this._cancelFunc)throw new Error("!this._cancelFunc");this._status="Error",this._errorFunc&&this._errorFunc(t),(n=this._errorEvent)==null||n.emit(t),this._cancelFunc(t),this._cancelFunc=void 0}}reset(){this._status==="Running"&&console.error("processing cannot reset while running. you can first cancel it!"),(this._status==="Completed"||this._status==="Error")&&(this._status="Initial")}get status(){return this._status}get isInitial(){return this._status==="Initial"}get isRunning(){return this._status==="Running"}get isCompleted(){return this._status==="Completed"}get isError(){return this._status==="Error"}get runningId(){return this._runningId}restart(t=new tn(""),...n){this.isRunning&&this.cancel(t),this.reset(),this.start(...n)}restartIfNotRunning(...t){this.isRunning||(this.reset(),this.start(...t))}}function Mo(i){return(e,...t)=>{const n=new dc,{completeFunc:s,errorFunc:o}=e,h=i(n,...t).then(s).catch(o).finally(()=>n.destroy());return ws(h,n.cancel.bind(n)),l=>uc(h,l)}}class uw extends Re{constructor(){super(({errorFunc:t},n,s)=>{try{const[o,h]=Wh(n,s);return this._doFunc=o,h}catch(o){return t(o),()=>{}}});p(this,"_doFunc")}do(...t){this._doFunc&&this._doFunc(...t)}}class cw extends Re{constructor(t,n){super(({errorFunc:s})=>{try{const[o,h]=Wh(t,n);return this._doFunc=o,h}catch(o){return s(o),()=>{}}});p(this,"_doFunc")}do(...t){this._doFunc&&this._doFunc(...t)}}function dw(i){return new Re(Mo((e,...t)=>e.promise(i(...t))))}function fw(i,...e){return new Re(Mo(t=>t.promise(i(...e))))}function el(i){return dw((...e)=>{const t=i(...e);return ia(t)?t:na(t)})}function fc(i,...e){return fw(()=>{const t=i(...e);return ia(t)?t:na(t)})}function gw(i){let e;const t=new Promise((n,s)=>{e=()=>{i(),s()}});return ws(t,e),t}function pw(i,...e){const t=new dc,n=i(t,...e).finally(()=>t.destroy());return ws(n,t.cancel.bind(t)),n}function wi(i){return new Re(Mo(i))}function mw(i,...e){return new Re(Mo(t=>i(t,...e)))}function bp(i,...e){const t=new AbortController;let n=t.signal,[s,o]=e;if(o!=null&&o.signal)throw console.error("init?.signal"),new Error("init?.signal");o=o||{},o.signal&&console.warn("revocableFetch error: init.signal would be override!"),o.signal=n;let h=!1;const l=()=>{h=!0,t.abort()};let d=fetch(s,o);return i&&(d=d.then(f=>{if(!f.ok)return f;if(!f.body)throw Error("ReadableStream not yet supported in this browser.");const v=f.headers.get("content-length");v||console.warn("response.headers.get('content-length') is undefined... cannot get contentLength!");const m=v?parseInt(v,10):0;let y=0;return new Response(new ReadableStream({start(w){if(!f.body)throw new Error("!response.body");const S=f.body.getReader();T();function T(){S.read().then(({done:N,value:j})=>{if(N){w.close();return}if(!j)throw new Error("!value");if(!i)throw new Error("!progressFunc");y+=j.byteLength,i(y,m),w.enqueue(j),T()}).catch(N=>{w.error(N)})}}}),{status:f.status,statusText:f.statusText,headers:f.headers})}).catch(f=>{throw h?(f instanceof Error&&f.code!==20&&console.error("error.code !== 20"),console.log("fetching cancelled!"),new tn(`fetching cancelled! error: ${f}`)):(f instanceof Error&&f.code===20&&console.error("error.code === 20"),f)})),ws(d,l),d}function vw(i,...e){return bp(i,...e)}function gc(...i){return bp(void 0,...i)}function yw(){return el(gc)}function _w(...i){return fc(gc,...i)}function pc(i,...e){let t=-1;var n=new Promise((s,o)=>{i.isRunning&&i.cancel(),i.reset();const h=new st;h.dispose(i.completeEvent.disposableOn(l=>{if(s(l),h.isDestroyed()){debugger;console.error(`disposer is destroyed! ${h}`);return}h.destroy()})),h.dispose(i.errorEvent.disposableOn(l=>{if(o(l),h.isDestroyed()){debugger;console.error(`disposer is destroyed! ${h}`);return}h.destroy()})),i.start(...e),t=i.runningId});return[s=>t===i.runningId&&i.isRunning&&i.cancel(s),n]}function wn(i,e,...t){try{return e(...t)}catch(n){i(n)}}function ww(){return new Re(({completeFunc:i,errorFunc:e},t)=>Qr(()=>wn(e,()=>{t&&t(),i()})))}function Ew(i){return new Re(({completeFunc:e,errorFunc:t})=>Qr(()=>wn(t,()=>{i&&i(),e()})))}function Sw(){return new Re(({completeFunc:i,errorFunc:e},t)=>So(()=>{wn(e,()=>{t&&t(),i()})}))}function xw(i){return new Re(({completeFunc:e,errorFunc:t})=>So(()=>{wn(t,()=>{i&&i(),e()})}))}function Pp(){return new Re(({completeFunc:i,errorFunc:e},t,n)=>Ku(()=>{wn(e,()=>{t&&t(),i()})},n??1e3))}function Cp(i,e){return new Re(({completeFunc:t,errorFunc:n})=>Ku(()=>{wn(n,()=>{i&&i(),t()})},e??1e3))}function bw(){return new Re(({errorFunc:i},e,t=1e3)=>Ju(()=>wn(i,e),t))}function Pw(i,e=1e3){return new Re(({errorFunc:t})=>Ju(()=>wn(t,i),e))}function To(){return new Re(({errorFunc:i},e)=>Hh(t=>wn(i,e,t)))}function sa(i){return new Re(({errorFunc:e})=>Hh(t=>wn(e,i,t)))}function ko(i,...e){let t,n;const s=new Promise((h,l)=>{n=l,t=globalThis.setTimeout(()=>{t=void 0,h(e)},i)});return ws(s,h=>{t&&(clearTimeout(t),t=void 0),n&&n(h??new tn("sleep cancel error!"))}),s}function Cw(){return el(ko)}function Iw(i,...e){return fc(ko,i,...e)}function Ks(i,e,...t){return i.promise(cc(pc(wi(async(n,...s)=>(i.disposer.dispose(()=>{n.isDestroyed()||n.cancel()}),await e(n,...s))),...t)))}function Mw(i,e,...t){return i.promise(cc(pc(e,...t)))}class Tw extends Re{constructor(){super(({errorFunc:t},n,s)=>{try{const[o,h]=nc(n,s);return this._doFunc=o,h}catch(o){return t(o),()=>{}}});p(this,"_doFunc")}do(...t){this._doFunc&&this._doFunc(...t)}}class kw extends Re{constructor(t,n){super(({errorFunc:s})=>{try{const[o,h]=nc(t,n);return this._doFunc=o,h}catch(o){return s(o),()=>{}}});p(this,"_doFunc")}do(...t){this._doFunc&&this._doFunc(...t)}}class il extends st{constructor(t=1e3,n=Jh){super();p(this,"_speed");p(this,"_speedChangedEvent");p(this,"_duration");p(this,"_durationChangedEvent");p(this,"_loop");p(this,"startUpdateFunc");p(this,"_updateBindThis");p(this,"_cancelStartUpdateFunc");p(this,"_startTimeStamp");p(this,"_playingChangedEvent");p(this,"_startPlayingEvent");p(this,"_stopPlayingEvent");p(this,"_loopChangedEvent");p(this,"_currentTime",this.disposeVar(it(0)));this._speed=1,this._duration=t,this._loop=!1,this.startUpdateFunc=n,this._updateBindThis=this._update.bind(this),this.dispose(()=>{this._cancelStartUpdateFunc&&(this._cancelStartUpdateFunc(),this._cancelStartUpdateFunc=void 0)}),this._startTimeStamp=Number.NaN,this.dispose(()=>{this._startPlayingEvent&&this._startPlayingEvent.reset(),this._stopPlayingEvent&&this._stopPlayingEvent.reset()})}get startPlayingEvent(){return this._startPlayingEvent=this._startPlayingEvent||new H,this._startPlayingEvent}get stopPlayingEvent(){return this._stopPlayingEvent=this._stopPlayingEvent||new H,this._stopPlayingEvent}get currentTimeChangedEvent(){return this._currentTime.changed}get loopChangedEvent(){return this._loopChangedEvent=this._loopChangedEvent||new H,this._loopChangedEvent}set loop(t){this._loop!==t&&(this._loop=t,this._loopChangedEvent&&this._loopChangedEvent.emit(this._loop))}get loop(){return this._loop}_update(t){if(Number.isNaN(this._startTimeStamp))console.warn("Number.isNaN(this._startTimeStamp)");else{const n=(t-this._startTimeStamp)*this._speed;this._setCurrentTimeInner(n)}}get currentTime(){return this._currentTime.value}set currentTime(t){this._setCurrentTimeInner(t),this._resetStartTime()}_setCurrentTimeInner(t){this._currentTime.value!==t&&(this._duration<=0?this._currentTime.value=0:t<0?this.loop?this._currentTime.value=this._duration+t%this._duration:(this._currentTime.value=0,this.playing&&this._stopPlaying()):t>this._duration?this.loop?this._currentTime.value=t%this._duration:(this._currentTime.value=this._duration,this.playing&&this._stopPlaying()):this._currentTime.value=t)}get durationChangedEvent(){return this._durationChangedEvent||(this._durationChangedEvent=new H),this._durationChangedEvent}get duration(){return this._duration}set duration(t){var n;if(t<0)console.warn("duration sholud greater than 0!");else if(this._duration!==t){const s=this._duration;this._duration=t,this._currentTime.value>this._duration&&(this._currentTime.value=this._duration),(n=this._durationChangedEvent)==null||n.emit(this._duration,s)}}get speedChangedEvent(){return this._speedChangedEvent||(this._speedChangedEvent=new H),this._speedChangedEvent}get speed(){return this._speed}set speed(t){var n;if(this._speed!==t&&t!==0){const s=this._speed;this._speed=t,this._resetStartTime(),(n=this._speedChangedEvent)==null||n.emit(this._speed,s)}}_resetStartTime(){this._startTimeStamp=performance.now()-this._currentTime.value/this._speed}_startPlaying(){var t,n;this._resetStartTime(),this._cancelStartUpdateFunc=this.startUpdateFunc(this._updateBindThis),(t=this._startPlayingEvent)==null||t.emit(this._currentTime.value),(n=this._playingChangedEvent)==null||n.emit(!0)}_stopPlaying(){var t,n;if(!this._cancelStartUpdateFunc)throw new Error("this._cancelStartUpdateFunc is undefined!");this._cancelStartUpdateFunc(),this._cancelStartUpdateFunc=void 0,(t=this._stopPlayingEvent)==null||t.emit(this._currentTime.value),(n=this._playingChangedEvent)==null||n.emit(!1)}get playingChangedEvent(){return this._playingChangedEvent||(this._playingChangedEvent=new H),this._playingChangedEvent}get playing(){return!!this._cancelStartUpdateFunc}set playing(t){!!this._cancelStartUpdateFunc!==t&&(t?this._startPlaying():this._stopPlaying())}}class Oo extends st{constructor(t){super();p(this,"_stop",this.disposeVar(it(0)));p(this,"_current",this.disposeVar(it(0)));p(this,"_start",this.disposeVar(it(0)));p(this,"_player",this.disposeVar(new il(200)));this.dispose(this._player.currentTimeChangedEvent.disposableOn(n=>{let s=n/this._player.duration;s=s>1?1:s<0?0:s;const o=this._start.value,h=this._stop.value;this._current.value=o+(h-o)*s})),this.duration=t}get current(){return this._current.value}get currentChanged(){return this._current.changed}get source(){return this._start.value}get sourceChanged(){return this._start.changed}get target(){return this._stop.value}get targetChanged(){return this._stop.changed}get duration(){return this._player.duration}set duration(t){this._player.duration=t}set target(t){this._start.value=this._current.value,this._stop.value=t,this._player.currentTime=0,this._player.playing=!0}reset(t){this._start.value=t,this._current.value=t,this._stop.value=t,this._player.playing=!1}}let Ip=-1;class ce extends H{constructor(e,t,n,s){super(),this._domElement=e,this._type=t,this.callback=s;const o=h=>(h.__xbsj_listenerNo__=++Ip,h.__xbsj_listenerTime__=Date.now(),h.__xbsj_lastCurrentTarget__=h.currentTarget,this.emit(h),this.callback&&this.callback(h));this._domElement.addEventListener(this._type,o,n),this.dispose(()=>this._domElement.removeEventListener(this._type,o,n))}static getLastLisenNo(){return Ip}static getCurrentTarget(e){return e.__xbsj_lastCurrentTarget__}static getListenerNo(e){return e.__xbsj_listenerNo__}static getListenerTime(e){return e.__xbsj_listenerTime__}static on(e,t){const n=ce.getLastLisenNo();return e.disposableOn(s=>{const o=ce.getListenerNo(s);(o===void 0||o>n)&&t(s)})}get element(){return this._domElement}static create(e,t,n){return new ce(e,t,n)}}class mc extends st{constructor(){super();p(this,"_clickEvent",this.disposeVar(new H));p(this,"_dbclickEvent",this.disposeVar(new H));p(this,"_pointerdownEvent",this.disposeVar(new H));p(this,"_pointerupEvent",this.disposeVar(new H));p(this,"_pointermoveEvent",this.disposeVar(new H));p(this,"_pointeroutEvent",this.disposeVar(new H));p(this,"dbClickDelayTime",300);p(this,"nativeClickDelayTime",500);p(this,"clickMovementTolerantPixelSize",3);p(this,"debugging",!1);p(this,"_enabled",this.disposeVar(it(!0)));const t=this.disposeVar(wi(async s=>{do{const o=await Ks(s,d=>new Promise((f,v)=>{d.disposer.dispose(v),d.disposer.dispose(ce.on(this._pointerdownEvent,f))})),h=$e(o);if(this.debugging&&console.log(`鼠标按下 ${h.toString()}`),!await Ks(s,d=>new Promise((f,v)=>{d.disposer.dispose(v);const m=setTimeout(()=>f(!0),this.nativeClickDelayTime);d.disposer.dispose(()=>clearTimeout(m)),d.disposer.dispose(ce.on(this._pointermoveEvent,y=>{const[w,S]=$e(y),[T,N]=h;(Math.abs(w-T)>3||Math.abs(S-N)>3)&&f(!1)})),d.disposer.dispose(ce.on(this._pointeroutEvent,()=>f(!1))),d.disposer.dispose(ce.on(this._pointerupEvent,()=>f(!0)))}))){this.debugging&&console.log("取消1");continue}const l=await Ks(s,d=>new Promise((f,v)=>{d.disposer.dispose(v);const m=setTimeout(()=>f("timeout"),this.dbClickDelayTime);d.disposer.dispose(()=>clearTimeout(m)),d.disposer.dispose(ce.on(this._pointermoveEvent,y=>{const[w,S]=$e(y),[T,N]=h;(Math.abs(w-T)>3||Math.abs(S-N)>3)&&f("moved")})),d.disposer.dispose(ce.on(this._pointerdownEvent,f)),d.disposer.dispose(ce.on(this._pointeroutEvent,()=>f("pointouted"))),d.disposer.dispose(ce.on(this._pointerupEvent,()=>f("pointuped")))}));if(typeof l=="string"){this.debugging&&console.log(`触发单击事件!取消双击监听!error: ${l}`),this._clickEvent.emit(o);continue}if(!await Ks(s,d=>new Promise((f,v)=>{d.disposer.dispose(v);const m=setTimeout(()=>f(!1),this.nativeClickDelayTime);d.disposer.dispose(()=>clearTimeout(m)),d.disposer.dispose(ce.on(this._pointermoveEvent,y=>{const[w,S]=$e(y),[T,N]=h;(Math.abs(w-T)>3||Math.abs(S-N)>3)&&f(!1)})),d.disposer.dispose(ce.on(this._pointeroutEvent,()=>f(!1))),d.disposer.dispose(ce.on(this._pointerupEvent,()=>f(!0)))}))){this.debugging&&console.log("取消2");continue}this.debugging&&console.log("触发双击事件!"),this._dbclickEvent.emit(l)}while(!0)})),n=s=>{s?t.restart():t.isRunning&&t.cancel()};n(this.enabled),this.dispose(this.enabledChanged.disposableOn(n))}get clickEvent(){return this._clickEvent}get dbclickEvent(){return this._dbclickEvent}pointerDown(t){this._pointerdownEvent.emit(t)}pointerUp(t){this._pointerupEvent.emit(t)}pointerMove(t){this._pointermoveEvent.emit(t)}pointerOut(t){this._pointeroutEvent.emit(t)}get enabled(){return this._enabled.value}set enabled(t){this._enabled.value=t}get enabledChanged(){return this._enabled.changed}}class Ow extends st{constructor(t,n){super();p(this,"_pointerClick",this.disposeVar(new mc));this._div=t;const{div:s,pointerClick:o}=this,h=v=>o.pointerDown(v),l=v=>o.pointerMove(v),d=v=>o.pointerOut(v),f=v=>o.pointerUp(v);s.addEventListener("pointerdown",h,n),s.addEventListener("pointermove",l,n),s.addEventListener("pointerout",d,n),s.addEventListener("pointerup",f,n),this.dispose(()=>{s.removeEventListener("pointerdown",h,n),s.removeEventListener("pointermove",l,n),s.removeEventListener("pointerout",d,n),s.removeEventListener("pointerup",f,n)})}get div(){return this._div}get pointerClick(){return this._pointerClick}get clickEvent(){return this.pointerClick.clickEvent}get dbclickEvent(){return this.pointerClick.dbclickEvent}}class Mp extends st{constructor(){super();p(this,"_hoverEvent",this.disposeVar(new H));p(this,"_hoverOutEvent",this.disposeVar(new H));p(this,"_pointerdownEvent",this.disposeVar(new H));p(this,"_pointerupEvent",this.disposeVar(new H));p(this,"_pointermoveEvent",this.disposeVar(new H));p(this,"_pointeroutEvent",this.disposeVar(new H));p(this,"delayTime",800);const t=this.disposeVar(Pp()),n=f=>{this._hoverOutEvent.emit()},s=f=>{this._hoverOutEvent.emit()};let o;const h=()=>{if(!o){console.warn("!lastPointerEvent");return}this._hoverEvent.emit(o)},l=f=>{o=f,t.restart(void 0,h,this.delayTime),this._hoverOutEvent.emit()},d=f=>{t.cancel(),this._hoverOutEvent.emit()};this.dispose(this._pointerdownEvent.disposableOn(n)),this.dispose(this._pointerupEvent.disposableOn(s)),this.dispose(this._pointermoveEvent.disposableOn(l)),this.dispose(this._pointeroutEvent.disposableOn(d))}get hoverEvent(){return this._hoverEvent}get hoverOutEvent(){return this._hoverOutEvent}pointerDown(t){this._pointerdownEvent.emit(t)}pointerUp(t){this._pointerupEvent.emit(t)}pointerMove(t){this._pointermoveEvent.emit(t)}pointerOut(t){this._pointeroutEvent.emit(t)}}class Nw extends st{constructor(t,n=1500){super();p(this,"_hoverEvent",new H);p(this,"_hoverOutEvent",new H);const s=new ac(n);this.dispose(()=>s.destroy());let o=0,h=0,l;s.progressFunc=()=>this._hoverEvent.emit(o,h,l);const d=y=>{!s.isRunning&&s.restart(),l=y,[o,h]=$e(y),s.debounce(),this._hoverOutEvent.emit()},f=y=>{!s.isRunning&&s.restart(),l=y,[o,h]=$e(l),s.debounce(),this._hoverOutEvent.emit()},v=y=>{!s.isRunning&&s.restart(),l=y,[o,h]=$e(l),s.debounce(),this._hoverOutEvent.emit()},m=y=>{s.isRunning&&s.cancel(),this._hoverOutEvent.emit()};t.addEventListener("pointerdown",d),t.addEventListener("pointerup",f),t.addEventListener("pointermove",v),t.addEventListener("pointerout",m),this.dispose(()=>{t.removeEventListener("pointerdown",d),t.removeEventListener("pointerup",f),t.removeEventListener("pointermove",v),t.removeEventListener("pointerout",m)})}get hoverEvent(){return this._hoverEvent}get hoverOutEvent(){return this._hoverOutEvent}}class Tp extends st{constructor(t,n={}){super();p(this,"_needRedrawEvent");p(this,"_needPickRedrawEvent");p(this,"_id",Zr());p(this,"_clickEvent");p(this,"_clickOutEvent");p(this,"_dbclickEvent");p(this,"_dbclickOutEvent");p(this,"_actived",!1);p(this,"_activedChanged");p(this,"_hovered",!1);p(this,"_hoveredChanged");p(this,"_selected",!1);p(this,"_selectedChanged");p(this,"_opacity",1);p(this,"_opacityChanged");p(this,"_show",!0);p(this,"_showChanged");this._canvasPrimitivesContext=t;const{needRedraw:s=!0,needPickRedraw:o=!0}=n;s&&(this._needRedrawEvent=new H),o&&(this._needPickRedrawEvent=new H),this._canvasPrimitivesContext.addPoi(this),this.dispose(()=>this._canvasPrimitivesContext.removePoi(this)),this.dispose(this.showChanged.disposableOn(()=>{this.needRedraw(),this.needPickRedraw()})),this.dispose(this.opacityChanged.disposableOn(()=>this.needRedraw()))}get id(){return this._id}set id(t){this._id=t}get context(){return this._canvasPrimitivesContext}needRedraw(){this._needRedrawEvent?this._needRedrawEvent.emit():console.warn("no needRedrawEvent!")}needPickRedraw(){this._needPickRedrawEvent?this._needPickRedrawEvent.emit():console.warn("no needPickRedrawEvent!")}hasClickEvent(){return!!this._clickEvent}get clickEvent(){return this._clickEvent=this._clickEvent||new H,this._clickEvent}hasClickOutEvent(){return!!this._clickOutEvent}get clickOutEvent(){return this._clickOutEvent=this._clickOutEvent||new H,this._clickOutEvent}hasDbclickEvent(){return!!this._dbclickEvent}get dbclickEvent(){return this._dbclickEvent=this._dbclickEvent||new H,this._dbclickEvent}hasDbclickOutEvent(){return!!this._dbclickOutEvent}get dbclickOutEvent(){return this._dbclickOutEvent=this._dbclickOutEvent||new H,this._dbclickOutEvent}set actived(t){this._actived!==t&&(this._actived=t,this._activedChanged&&this._activedChanged.emit(t,this))}get actived(){return this._actived}get activedChanged(){return this._activedChanged=this._activedChanged||new H,this._activedChanged}set hovered(t){this._hovered!==t&&(this._hovered=t,this._hoveredChanged&&this._hoveredChanged.emit(t,this))}get hovered(){return this._hovered}get hoveredChanged(){return this._hoveredChanged=this._hoveredChanged||new H,this._hoveredChanged}set selected(t){this._selected!==t&&(this._selected=t,this._selectedChanged&&this._selectedChanged.emit(t,this))}get selected(){return this._selected}get selectedChanged(){return this._selectedChanged=this._selectedChanged||new H,this._selectedChanged}set opacity(t){this._opacity!==t&&(this._opacity=t,this._opacityChanged&&this._opacityChanged.emit(t,this))}get opacity(){return this._opacity}get opacityChanged(){return this._opacityChanged=this._opacityChanged||new H,this._opacityChanged}set show(t){this._show!==t&&(this._show=t,this._showChanged&&this._showChanged.emit(t,this))}get show(){return this._show}get showChanged(){return this._showChanged=this._showChanged||new H,this._showChanged}}class vc extends Tp{constructor(t,n=[0,0],s=0){super(t);p(this,"_winPosAndDepthChanged");this._winPos=n,this._depth=s,this.dispose(this.winPosAndDepthChanged.disposableOn(()=>{this.needRedraw(),this.needPickRedraw()}))}set winPos(t){(this._winPos[0]!==t[0]||this._winPos[1]!==t[1])&&(this._winPos[0]=t[0],this._winPos[1]=t[1],this._winPosAndDepthChanged&&this._winPosAndDepthChanged.emit(this._winPos,this._depth))}get winPos(){return this._winPos}set depth(t){this._depth!==t&&(this._depth=t,this._winPosAndDepthChanged&&this._winPosAndDepthChanged.emit(this._winPos,this._depth))}get depth(){return this._depth}get winPosAndDepthChanged(){return this._winPosAndDepthChanged||(this._winPosAndDepthChanged=new H),this._winPosAndDepthChanged}}function Zs(i,e,t,n){const[s,o]=i,[h,l,d,f]=n,v=e[0]*t[0],m=e[1]*t[1],y=s-(v*h+d),w=o-(m*l+f);return{left:y,top:w,right:y+v,bottom:w+m}}function Qs(i,e,t,n,s){i.beginPath(),i.moveTo(e,t),i.lineTo(e-n*.5,t-n*.5),i.arc(e,t-n,n*.7071067811865475,Math.PI*.75,Math.PI*.25),i.lineTo(e,t),i.fillStyle=s,i.fill()}function Rw(i,e,t,n,s,o){if(i.beginPath(),i.moveTo(e+n,t),i.arc(e,t,n,0,2*Math.PI),o){const h=i.createRadialGradient(e,t,0,e,t,n);h.addColorStop(0,s),h.addColorStop(1,s.replace(/[\d\.]+\)$/,"0)")),i.fillStyle=h}else i.fillStyle=s;i.fill()}function kp(i,e,t,n,s,o){i.beginPath(),i.moveTo(e+o,t),i.lineTo(e+n-o,t),i.arcTo(e+n,t,e+n,t+o,o),i.lineTo(e+n,t+s-o),i.arcTo(e+n,t+s,e+n-o,t+s,o),i.lineTo(e+o,t+s),i.arcTo(e,t+s,e,t+s-o,o),i.lineTo(e,t+o),i.arcTo(e,t,e+o,t,o)}function Op(i,e,t,n,s,o){i.font=s;const h=i.measureText(n),l=h.actualBoundingBoxLeft+h.actualBoundingBoxRight,d=Number.isFinite(h.fontBoundingBoxAscent)?h.fontBoundingBoxAscent:h.actualBoundingBoxAscent,f=Number.isFinite(h.fontBoundingBoxDescent)?h.fontBoundingBoxDescent:h.actualBoundingBoxDescent;let v=d+f;i.fillStyle=o,i.fillText(n,e-l*.5,t+v*.5-f)}function Np(i){const{width:e,height:t}=i,n=e instanceof SVGAnimatedLength?e.baseVal.SVG_LENGTHTYPE_PX:e,s=t instanceof SVGAnimatedLength?t.baseVal.SVG_LENGTHTYPE_PX:t,o=document.createElement("canvas");o.width=n,o.height=s;const h=o.getContext("2d");if(!h)throw new Error("!cavnasCtx");return h.drawImage(i,0,0,n,s),o}function Rp(i,e){const{width:t,height:n}=i,s=i.getContext("2d");if(!s)throw new Error("!cavnasCtx");const[o,h,l]=e.map(m=>m*255|0),d=s.getImageData(0,0,t,n),f=d.data;for(var v=0;v<f.length;v+=4)f[v]=o,f[v+1]=h,f[v+2]=l;s.putImageData(d,0,0)}function yc(i,e,t,n=[.5,1,0,0],s,o="12px Arial",h=2,l="#FFF",d="#000A"){i.font=o;const f=i.measureText(s),v=f.actualBoundingBoxLeft+f.actualBoundingBoxRight,m=f.fontBoundingBoxAscent+f.fontBoundingBoxDescent,y=e,w=t,S=v+h*2,T=m+h*2,{left:N,top:j,bottom:C}=Zs([y,w],[S,T],[1,1],n);i.fillStyle=d,kp(i,N,j,S,T,h),i.fill(),i.fillStyle=l,i.fillText(s,N+h,C-h-f.fontBoundingBoxDescent)}function No(i){return("00"+i.toString(16).toUpperCase()).substr(-2)}function Ro(i){const[e,t,n,s]=i.map(o=>o*255|0);return`#${No(e)}${No(t)}${No(n)}${No(s)}`}function _c(i,e){const[t,n,s]=e,o=`${t}-${n}-${s}`;let h=_i(i,o);return h||(h=Np(i),Rp(h,e),yn(i,o,h)),h}class Aw extends vc{constructor(t,n,s=[32,32],o=[.5,1,0,0],h="#F00F"){super(t);p(this,"_tooltip","");p(this,"_title","");p(this,"__scale",[1,1]);p(this,"_tooltipAlpha",0);p(this,"_bgColor",[.3,.3,.3,.8]);p(this,"_bgColorHexStr",Ro(this._bgColor));p(this,"_fgColor",[1,1,1,1]);p(this,"_fgColorHexStr",Ro(this._fgColor));this._image=n,this._size=s,this._originRatioAndOffset=o,this._defaultColorStr=h;const l=new Oo(100),d=new Oo(100);this.dispose(()=>{l.destroy(),d.destroy()});const f=()=>{if(this._clickEvent&&!this._clickEvent.empty){const v=(1+.08*d.current)*(1+.08*l.current);this._scale=[v,v],this._tooltipAlpha=l.current}};this.dispose(this.activedChanged.disposableOn(v=>{d.target=v?1:0,this.needRedraw()})),this.dispose(this.hoveredChanged.disposableOn(v=>{l.target=v?1:0,this.needRedraw()})),this.dispose(this.selectedChanged.disposableOn(()=>{this.needRedraw()})),this.dispose(d.currentChanged.disposableOn(f)),this.dispose(l.currentChanged.disposableOn(f))}set size(t){const[n,s]=t,[o,h]=this._size;(o!==n||h!==s)&&(this._size[0]=n,this._size[1]=s,this.needRedraw(),this.needPickRedraw())}get size(){return this._size}set _scale(t){const[n,s]=t,[o,h]=this.__scale;(o!==n||h!==s)&&(this.__scale[0]=n,this.__scale[1]=s,this.needRedraw(),this.needPickRedraw())}get _scale(){return this.__scale}set fgColor(t){if(!this._fgColor.every((n,s)=>t[s]===n)){const[n,s,o,h]=t;this._fgColor.splice(0,4,n,s,o,h),this._fgColorHexStr=Ro(this._fgColor),this.needRedraw()}}get fgColor(){return this._fgColor}set bgColor(t){if(!this._bgColor.every((n,s)=>t[s]===n)){const[n,s,o,h]=t;this._bgColor.splice(0,4,n,s,o,h),this._bgColorHexStr=Ro(this._bgColor),this.needRedraw()}}get bgColor(){return this._bgColor}set originRatioAndOffset(t){const[n,s,o,h]=this._originRatioAndOffset,[l,d,f,v]=t;(n!==l||s!==d||o!==f||h!==v)&&(this._originRatioAndOffset.splice(0,4,l,d,f,v),this.needRedraw(),this.needPickRedraw())}get originRatioAndOffset(){return this._originRatioAndOffset}set image(t){this._image!==t&&(this._image=t,this.needRedraw())}get image(){return this._image}set defaultColorStr(t){this._defaultColorStr!==t&&(this._defaultColorStr=t,this.needRedraw())}get defaultColorStr(){return this._defaultColorStr}set tooltip(t){this._tooltip!==t&&(this._tooltip=t,this.needRedraw())}get tooltip(){return this._tooltip}set title(t){this._title!==t&&(this._title=t,this.needRedraw())}get title(){return this._title}draw(t){if(!this._show)return;const[n,s]=this._winPos,o=this._size[0]*this.__scale[0],h=this._size[1]*this.__scale[1],{left:l,top:d}=Zs([n,s],this._size,this.__scale,this._originRatioAndOffset),f=t.globalAlpha;if(t.globalAlpha=this.opacity,this._image){if(this.selected){const v=_c(this._image,[1,0,0]),{left:m,top:y}=Zs([n,s+3],[o+6,h+6],[1,1],this._originRatioAndOffset);t.drawImage(v,m,y,o+6,h+6)}if(this.actived){const[v,m,y,w]=this._fgColor,S=_c(this._image,[v,m,y]),{left:T,top:N}=Zs([n,s+4],[o+8,h+8],[1,1],this._originRatioAndOffset);t.drawImage(S,T,N,o+8,h+8)}if(this.hovered){const[v,m,y,w]=this._bgColor,S=_c(this._image,[v,m,y]),{left:T,top:N}=Zs([n,s+2],[o+4,h+4],[1,1],this._originRatioAndOffset);t.drawImage(S,T,N,o+4,h+4)}t.drawImage(this._image,l,d,o,h)}else t.fillStyle=this._fgColorHexStr,t.fillRect(l,d,o,h);if(this._title!==""&&yc(t,n+20,s-16,[0,.5,0,0],this._title,"14px Arial",4,this._fgColorHexStr,this._bgColorHexStr),t.globalAlpha=f,this._hovered&&this._tooltip!==""){const v=t.globalAlpha;t.globalAlpha=this._tooltipAlpha,yc(t,n,s-42,[.5,1,0,0],this._tooltip,"12px Arial",4,this._fgColorHexStr,this._bgColorHexStr),t.globalAlpha=v}}drawForPick(t,n){if(!this._show)return;const[s,o]=this._winPos,h=n("default"),l=this._size[0]*this.__scale[0],d=this._size[1]*this.__scale[1],{left:f,top:v}=Zs([s,o],this._size,this.__scale,this._originRatioAndOffset);t.fillStyle=h,t.fillRect(f,v,l,d)}}class Dw extends vc{constructor(t){super(t);p(this,"_width",16);p(this,"_text","");p(this,"_fillStyle","#0F0");p(this,"_scale",1);p(this,"_scaleChanged");this.dispose(this.scaleChanged.disposableOn(h=>{this.needRedraw(),this.needPickRedraw()}));const n=this.disposeVar(new Oo(100)),s=this.disposeVar(new Oo(100)),o=()=>{this._clickEvent&&!this._clickEvent.empty&&(this.scale=(1+.1*s.current)*(1+.2*n.current))};this.dispose(s.currentChanged.disposableOn(o)),this.dispose(n.currentChanged.disposableOn(o)),this.dispose(this.activedChanged.disposableOn(h=>{s.target=h?1:0,this.needRedraw()})),this.dispose(this.hoveredChanged.disposableOn(h=>{n.target=h?1:0,this.needRedraw()})),this.dispose(this.selectedChanged.disposableOn(h=>{this.needRedraw()}))}set scale(t){this._scale!==t&&(this._scale=t,this._scaleChanged&&this._scaleChanged.emit(t,this))}get scale(){return this._scale}get scaleChanged(){return this._scaleChanged||(this._scaleChanged=new H),this._scaleChanged}set width(t){this._width!==t&&(this._width=t,this.needRedraw(),this.needPickRedraw())}get width(){return this._width}set text(t){this._text!==t&&(this._text=t,this.needRedraw())}get text(){return this._text}set fillStyle(t){this._fillStyle!==t&&(this._fillStyle=t,this.needRedraw())}get fillStyle(){return this._fillStyle}draw(t){if(!this._show)return;const[n,s]=this._winPos,o=t.globalAlpha;t.globalAlpha=this.opacity;const h=this._width*this._scale;this.selected&&Qs(t,n,s+3,h+3,"#F00"),this.actived&&this._clickEvent&&!this._clickEvent.empty&&Qs(t,n,s+5,h+5,"#FFF"),this.hovered?Qs(t,n,s+3,h+3,"#000A"):Qs(t,n,s+1,h+1,"#000A"),Qs(t,n,s,h,this._fillStyle);const l=this._scale>1.2?"bold 14px Arial":"bold 10px Arial";Op(t,n,s-h,this._text,l,"#000"),t.globalAlpha=o}drawForPick(t,n){if(!this._show)return;const[s,o]=this._winPos,h=this._width*this._scale,l=n("default");Qs(t,s,o,h,l)}}const Ap=new ArrayBuffer(4),Dp=new Uint32Array(Ap),tr=new Uint8Array(Ap);function Lp(i){if(i>=16777215)throw new Error("uint32 > 0xFFFFFF");return Dp[0]=i,[tr[0],tr[1],tr[2]]}function Fp(i,e,t){return tr[0]=i,tr[1]=e,tr[2]=t,tr[3]=0,Dp[0]}class Gp extends st{constructor(){super(...arguments);p(this,"_pickColors",new Array(16777215));p(this,"_pickColorIndex",0)}reset(){for(let t=0;t<this._pickColorIndex;++t){const n=this._pickColors[t];if(!n)throw console.error("this._pickColors[i] should not be undefined!"),new Error("this._pickColors[i] should not be undefined!");n.poi=null,n.tag=""}this._pickColorIndex=0}createPickColor(t,n){const s=this._pickColorIndex;++this._pickColorIndex;const o=this._pickColors[s];o?(o.poi=t,o.tag=n):this._pickColors[s]={poi:t,tag:n};const[h,l,d]=Lp(s);return[h,l,d]}getPickInfoFromColor(t,n,s){const o=Fp(t,n,s);if(o>=this._pickColorIndex){console.error("index >= this._pickColorIndex");return}const h=this._pickColors[o];if(!h){console.error("!this._pickColors[index]");return}return h}destroyImp(){this.reset()}}const jp=(i,e)=>e.depth-i.depth;class Lw extends st{constructor(){super();p(this,"_pois",[]);p(this,"_canvasElement");p(this,"_ctx");p(this,"_offscreenCanvasElement");p(this,"_offscreenCanvasElement2");p(this,"_offscreenCtx");p(this,"_offscreenCtx2");p(this,"_size",[0,0]);p(this,"_needRedraw",!1);p(this,"_needPickRedraw",!1);p(this,"_pickColorManager",new Gp);const t=document.createElement("canvas");t.style.width="100%",t.style.height="100%",this._canvasElement=t;const n=t.getContext("2d");if(n===null)throw new Error("cannot get context 2d!");this._ctx=n,this._offscreenCanvasElement=document.createElement("canvas"),this._offscreenCtx=this._offscreenCanvasElement.getContext("2d"),this._offscreenCtx.imageSmoothingEnabled=!1,this._offscreenCanvasElement2=document.createElement("canvas"),this._offscreenCtx2=this._offscreenCanvasElement2.getContext("2d"),this._offscreenCtx2.imageSmoothingEnabled=!1,this.disposeVar(sa(()=>{const[o,h]=this._size,{clientWidth:l,clientHeight:d}=this._canvasElement;(o!==l||h!==d)&&(this._size[0]=l,this._size[1]=d,this._canvasElement.width=l,this._canvasElement.height=d,this._offscreenCanvasElement.width=l,this._offscreenCanvasElement.height=d,this._offscreenCanvasElement2.width=l,this._offscreenCanvasElement2.height=d,this._dirty()),this._needRedraw&&(this._needRedraw=!1,this._draw())})).start()}get element(){return this._canvasElement}get pois(){return this._pois}_dirty(){this._needRedraw=!0,this._needPickRedraw=!0}get size(){return this._size}addPoi(t){if(typeof _i(t,"listenHandler")<"u"){console.error("可能有poi重复加载poiManager中!");return}if(this._pois.indexOf(t)!==-1){console.error("同一个poi加了多次!");return}this._pois.push(t),this._dirty();const n=t._needRedrawEvent;if(n){const o=n.on(()=>{this._needRedraw=!0});yn(t,"needRedrawEventHandler",o)}const s=t._needPickRedrawEvent;if(s){const o=s.on(()=>{this._needPickRedraw=!0});yn(t,"needPickRedrawEventHandler",o)}}removePoi(t){const n=this._pois.indexOf(t);if(n===-1){console.error("删除一个不存在的poi!");return}this._pois.splice(n,1),this._dirty();const s=t._needRedrawEvent;if(s){const h=_i(t,"needRedrawEventHandler");h?s.off(h):console.error("poi没有listenHandler!")}const o=t._needPickRedrawEvent;if(o){const h=_i(t,"needPickRedrawEventHandler");h?o.off(h):console.error("poi没有listenHandler!")}}_draw(){this._pois.sort(jp);const[t,n]=this._size;this._ctx.clearRect(0,0,t,n),this._pois.forEach(s=>s.draw(this._ctx))}pick(t,n,s,o){return this._needPickRedraw&&(this._needPickRedraw=!1,this._pickDraw()),this._getPickInfo(t,n,s,o)}_pickDraw(){this._pickColorManager.reset(),this._pois.sort(jp);const[t,n]=this._size;this._offscreenCtx.clearRect(0,0,t,n),this._pois.forEach(s=>{const o=h=>{const[l,d,f]=this._pickColorManager.createPickColor(s,h);return`rgb(${l}, ${d}, ${f})`};s.drawForPick(this._offscreenCtx,o)})}_getPickInfo(t,n,s,o){const h=this._offscreenCtx.getImageData(t,n,s,o),l=[],d=h.data.length/4;for(let f=0;f<d;++f){const v=h.data[f*4+0],m=h.data[f*4+1],y=h.data[f*4+2];if(h.data[f*4+3]===255){const S=this._pickColorManager.getPickInfoFromColor(v,m,y);if(S&&S.poi&&!l.includes(S)){let T=!0;{const[N,j]=this._size;this._offscreenCtx2.clearRect(0,0,N,j);const C=V=>"rgb(255, 255, 255)";S.poi.drawForPick(this._offscreenCtx2,C);const k=this._offscreenCtx2.getImageData(t,n,s,o),M=k.data[f*4+0],D=k.data[f*4+1],L=k.data[f*4+2];k.data[f*4+3],M===255&&D===255&&L===255||(T=!1)}T&&l.push(S)}}}return l}}class wc extends st{constructor(){super(...arguments);p(this,"_closeEvent");p(this,"_show",!0);p(this,"_showChanged");p(this,"_opacity",1);p(this,"_opacityChanged");p(this,"_winPos",[0,0]);p(this,"_winPosChanged")}set winPos(t){const[n,s]=t,[o,h]=this._winPos;(n!==o||s!==h)&&(this._winPos[0]=n,this._winPos[1]=s,this._winPosChanged&&this._winPosChanged.emit(this._winPos))}get winPos(){return this._winPos}get winPosChanged(){return this._winPosChanged=this._winPosChanged||new H,this._winPosChanged}set opacity(t){this._opacity!==t&&(this._opacity=t,this._opacityChanged&&this._opacityChanged.emit(this._opacity))}get opacity(){return this._opacity}get opacityChanged(){return this._opacityChanged=this._opacityChanged||new H,this._opacityChanged}set show(t){this._show!==t&&(this._show=t,this._showChanged&&this._showChanged.emit(this._show))}get show(){return this._show}get showChanged(){return this._showChanged=this._showChanged||new H,this._showChanged}get closeEvent(){return this._closeEvent||(this._closeEvent=new H),this._closeEvent}}const Ec=new WeakMap;function Sc(i){if(!Ec.has(i)){const e=new Vh(()=>new i,t=>t.reset());Ec.set(i,e)}return Ec.get(i)}class xc extends wc{constructor(){super();p(this,"_div");p(this,"_contentDiv");p(this,"_originOffsetX",0);p(this,"_originOffsetY",0);p(this,"_originRatioX",.5);p(this,"_originRatioY",1);p(this,"_divChanged",new H);const t=document.createElement("div");t.style.cssText="width: 0px; height: 0px; position: absolute; opacity: 1.0; visibility: visible;";const n=document.createElement("div");n.style.cssText=`position: absolute; left: ${-this._originOffsetX}px; top: ${-this._originOffsetY}px; transform: translateX(-${100*this._originRatioX}%) translateY(-${100*this._originRatioY}%); margin: 0; padding: 0; pointer-events: none;`;const s=document.createElement("div");this._contentDiv=s,n.appendChild(s),t.appendChild(n),this._div=t,this.dispose(this._divChanged.disposableOn(()=>{n.style.left=`${-this._originOffsetX}px`,n.style.top=`${-this._originOffsetY}px`,n.style.transform=`translateX(-${100*this._originRatioX}%) translateY(-${100*this._originRatioY}%)`})),this.dispose(this.winPosChanged.disposableOn(([o,h])=>{this._div.style.left=`${o}px`,this._div.style.top=`${h}px`})),this.dispose(this.opacityChanged.disposableOn(o=>{this._div.style.opacity=`${o}`})),this.dispose(this.showChanged.disposableOn(o=>{this._div.style.visibility=o?"visible":"hidden"}))}get contentDiv(){return this._contentDiv}reset(){}get originOffsetX(){return this._originOffsetX}set originOffsetX(t){this._originOffsetX!==t&&(this._originOffsetX=t,this._divChanged.emit())}get originOffsetY(){return this._originOffsetY}set originOffsetY(t){this._originOffsetY!==t&&(this._originOffsetY=t,this._divChanged.emit())}get originRatioX(){return this._originRatioX}set originRatioX(t){this._originRatioX!==t&&(this._originRatioX=t,this._divChanged.emit())}get originRatioY(){return this._originRatioY}set originRatioY(t){this._originRatioY!==t&&(this._originRatioY=t,this._divChanged.emit())}get element(){return this._div}}class Bp extends st{constructor(t,n){super();p(this,"_floatDiv");p(this,"_show",!1);p(this,"_showChanged");this._customDivClass=t,this._divContainer=n,this.dispose(()=>{this.show=!1})}_updateDivPoi(){if(this._show){const{floatDiv:n}=this;n.element.parentElement||this._divContainer.appendChild(n.element)}else{const{_floatDiv:n}=this;n&&n.element.parentElement&&this._divContainer.removeChild(n.element)}}set show(t){this._show!==t&&(this._show=t,this._updateDivPoi(),this._showChanged&&this._showChanged.emit(t))}get show(){return this._show}get floatDiv(){if(!this._floatDiv){const t=Sc(this._customDivClass).create();this.dispose(()=>{Sc(this._customDivClass).destroy(t)}),this._floatDiv=t}return this._floatDiv}get showChanged(){return this._showChanged||(this._showChanged=new H),this._showChanged}}const Fw=["top","bottom","left","right"];function Gw(i){return Object.entries(i).map(([e,t])=>Fw.includes(e)?`${e}: ${t}px; `:"").join("")}function zp(i,e,t){const n=document.createElement("div");n.style.cssText=`position: absolute; ${Gw(t)} background-color: ${i}; border-radius: ${e}px;`;const s='<svg viewBox="0 0 1024 1024" style="display: block;" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2420" xmlns:xlink="http://www.w3.org/1999/xlink" width="32" height="32"><defs><style type="text/css"></style></defs><path d="M512 128C300.8 128 128 300.8 128 512s172.8 384 384 384 384-172.8 384-384S723.2 128 512 128zM512 832c-179.2 0-320-140.8-320-320s140.8-320 320-320 320 140.8 320 320S691.2 832 512 832z" p-id="2421" fill="#ffffff"></path><path d="M672 352c-12.8-12.8-32-12.8-44.8 0L512 467.2 396.8 352C384 339.2 364.8 339.2 352 352S339.2 384 352 396.8L467.2 512 352 627.2c-12.8 12.8-12.8 32 0 44.8s32 12.8 44.8 0L512 556.8l115.2 115.2c12.8 12.8 32 12.8 44.8 0s12.8-32 0-44.8L556.8 512l115.2-115.2C684.8 384 684.8 364.8 672 352z" p-id="2422" fill="#ffffff"></path></svg>';return n.innerHTML=s,n}function Up(i,e,t="rgba(0,0,0,0.7)"){const n=document.createElement("div");n.style.cssText=`margin: 0 auto; width: ${i}px; height: ${e}px; position: relative; pointer-events: none;`;const s=document.createElement("div");return s.style.cssText=`position: absolute; left: 0px; top: 0px; width: 0; height: 0; border-left: ${i*.5}px solid transparent; border-right: ${i*.5}px solid transparent; border-top: ${e}px solid ${t};`,n.appendChild(s),[n,s]}class Vp extends xc{constructor(){super();p(this,"_borderDiv");p(this,"_closeDiv");p(this,"_innerContentDiv");p(this,"_colorStr","rgba(0, 0, 0, 0.7)");p(this,"_divColorChanged",new H);p(this,"_borderRadius",10);const t=document.createElement("div");t.style.cssText=`position: relative; background-color: ${this._colorStr}; border-radius: ${this._borderRadius}px; padding: 5px; pointer-events: all;`,this._borderDiv=t;const n=zp(this._colorStr,10,{top:3,right:3}),[s,o]=Up(2*this._borderRadius,2*this._borderRadius,this._colorStr),h=document.createElement("div");this._innerContentDiv=h,t.appendChild(h),t.appendChild(n),this.contentDiv.appendChild(t),this.contentDiv.appendChild(s),n.style.opacity="0.1",n.onmouseenter=()=>{n.style.opacity="1.0"},n.onmouseleave=()=>{n.style.opacity="0.1"},n.onclick=()=>{this._closeEvent&&this._closeEvent.emit()},this._closeDiv=n,this.dispose(this._divColorChanged.disposableOn(()=>{o.style.borderTopColor=this._colorStr,t.style.backgroundColor=this._colorStr,s.style.width=`${this._borderRadius*2}px`,s.style.height=`${this._borderRadius*2}px`,o.style.borderLeft=`${this._borderRadius}px`,o.style.borderRight=`${this._borderRadius}px`,o.style.borderTop=`${this._borderRadius*2}px`}));const l=d=>{d.key==="Escape"&&this._closeEvent&&this._closeEvent.emit()};document.body.addEventListener("keydown",l,!0),this.dispose(()=>{document.removeEventListener("keydown",l,!0)})}get borderDiv(){return this._borderDiv}get innerContentDiv(){return this._innerContentDiv}reset(){this.show=!1,this.opacity=0,this._closeDiv.style.opacity="0.1",super.reset()}get colorStr(){return this._colorStr}set colorStr(t){this._colorStr!==t&&(this._colorStr=t,this._divColorChanged.emit())}get borderRadius(){return this._borderRadius}set borderRadius(t){this._borderRadius!==t&&(this._borderRadius=t,this._divColorChanged.emit())}}class jw extends Vp{constructor(){super();p(this,"_iframe");p(this,"_iframeMessageEvent");const t=document.createElement("iframe");t.style.cssText="width: 100%; height: 100%; border-width: 0px; border-radius: 5px; display: block;",t.src="http://www.weather.com.cn/live/index.shtml",this._iframe=t,this.innerContentDiv.appendChild(t);const n=s=>{s.source===this._iframe.contentWindow&&(this._iframeMessageEvent?this._iframeMessageEvent.emit(s):console.warn(`iframe消息接收到未处理!data: ${s.data}`))};window.addEventListener("message",n),this.dispose(()=>{window.removeEventListener("message",n)})}reset(){super.reset(),this.src=""}set src(t){this._iframe.src!==t&&(this._iframe.src=t)}get src(){return this._iframe.src}get iframe(){return this._iframe}get iframeMessageEvent(){return this._iframeMessageEvent=this._iframeMessageEvent||new H,this._iframeMessageEvent}}class Bw extends wc{constructor(){super();p(this,"_div");p(this,"_contentContainer");p(this,"_text","");const t=document.createElement("div");this._div=t,t.style.cssText="width: 0px; height: 0px; position: absolute; opacity: 1.0; visibility: visible; transition: opacity 0.5s;";const n=document.createElement("div");n.style.cssText="position: absolute; left: 0px; bottom: 0px; transform: translateX(-50%); margin: 0; padding: 0; pointer-events: none;";const s=document.createElement("div");s.style.cssText="position: relative; background-color: rgba(0, 0, 0, 0.7); border-radius: 5px; padding: 3px; pointer-events: all; color: white; white-space: nowrap;",s.innerText=this._text,this._div.appendChild(n),n.appendChild(s),this._contentContainer=s,this._div=t,this.dispose(this.winPosChanged.disposableOn(([o,h])=>{this._div.style.left=`${o}px`,this._div.style.top=`${h-50}px`})),this.dispose(this.opacityChanged.disposableOn(o=>{this._div.style.opacity=`${o}`})),this.dispose(this.showChanged.disposableOn(o=>{this._div.style.visibility=o?"visible":"hidden"}))}get element(){return this._div}reset(){this.opacity=1,this.show=!0}set text(t){this._text!==t&&(this._text=t,this._contentContainer.innerText=t)}get text(){return this._text}}class zw extends xc{constructor(){super(),this.contentDiv.style.backgroundColor="rgba(0, 0, 0, 0.8)",this.contentDiv.style.borderRadius="3px",this.contentDiv.style.color="rgb(255, 255, 255)",this.contentDiv.style.padding="1px 5px 1px 5px",this.contentDiv.style.fontSize="12px",this.contentDiv.style.whiteSpace="nowrap",this.contentDiv.innerText="未定义光标信息!",this.originRatioX=0,this.originRatioY=0,this.originOffsetX=-16}}class Uw extends st{constructor(t,n){super();p(this,"_cursorDiv");p(this,"_pointerOut",this.disposeVar(it(!1)));p(this,"_show",this.disposeVar(it(!0)));this._cursorDiv=new Bp(n,t),this.dispose(()=>this._cursorDiv.destroy());const s=h=>{const[l,d]=$e(h);this._cursorDiv.floatDiv.winPos=[l,d]};t.addEventListener("pointermove",s),this.dispose(()=>t.removeEventListener("pointermove",s));const o=()=>{this._cursorDiv.show=this.show&&this._pointerOut.value};o(),this.dispose(this.showChanged.disposableOn(o)),this.dispose(this._pointerOut.changed.disposableOn(o))}set show(t){this._show.value=t}get show(){return this._show.value}get showChanged(){return this._show.changed}reset(){this._pointerOut.value=!1}get cursorDiv(){return this._cursorDiv}set text(t){this._cursorDiv.floatDiv.contentDiv.innerText=t}get text(){return this._cursorDiv.floatDiv.contentDiv.innerText}}function Ao(i,e,t){if(!(i.tree===e.tree&&i!==e&&!i.isAncestorOf(e))||i.tree!==e.tree||!i.parent)return!1;if(!i.parent.children)throw console.error("当前节点的父节点没有子节点?这是不可能的!"),new Error("当前节点的父节点没有子节点?这是不可能的!");return!(e===i||i.isAncestorOf(e)||t!=="inner"&&!e.parent||t==="inner"&&!e.children)}function nl(i,e,t){if(!i.tree||!e.tree||i.tree!==e.tree)return;if(!i.parent){console.warn("当前节点没有父节点,那么该节点无法被移动!");return}if(!i.parent.children)throw console.error("当前节点的父节点没有子节点?这是不可能的!"),new Error("当前节点的父节点没有子节点?这是不可能的!");if(e===i){console.warn("自身不能拖放到自身!");return}if(i.isAncestorOf(e)){console.warn("当前节点不能拖放到它自身的后代节点之上!");return}if(t!=="inner"&&!e.parent){console.warn("目标节点没有父节点,无法拖放!");return}if(t==="inner"&&!e.children){console.warn("无法移动到目标节点的子节点中,因为目标节点不是组节点!");return}i.tree._startTransaction();const n=i.parent.children.indexOf(i);if(i.parent.children.splice(n,1),t!=="inner"){const{parent:s}=e;if(!s||!s.children)throw new Error("!parent");const o=s.children.indexOf(e);t==="before"?s.children.splice(o,0,i):t==="after"&&s.children.splice(o+1,0,i)}else e.children.push(i);i.tree._stopTransaction()}function qp(i,e,t){return tc(i,n=>Ao(n,e,t))}function $p(i,e,t){for(let n of i)Ao(n,e,t)?nl(n,e,t):console.warn(`treeItem(id: ${n.id}) cannot move...`)}const Vw={checked:1,unchecked:2,indeterminate:3},qw=["checked","unchecked","indeterminate"];class Wp extends st{constructor(t){super();p(this,"_collapsed",this.disposeVar(it(!1)));p(this,"_checkedStatus",this.disposeVar(it("unchecked")));p(this,"_selected",this.disposeVar(it(!1)));p(this,"_moveToPositionMode",this.disposeVar(it("none")));p(this,"_updateCheckedStatusFromChildrenEvent",this.disposeVar(new H));this._treeItem=t;const n=()=>this._treeItem.tree&&this._treeItem.tree.itemsChanged.emit([this._treeItem]);this.dispose(this._collapsed.changed.disposableOn(n)),this.dispose(this._checkedStatus.changed.disposableOn(n)),this.dispose(this._selected.changed.disposableOn(n)),this.dispose(this._moveToPositionMode.changed.disposableOn(n)),this.dispose(this._checkedStatus.changed.disposableOn(()=>this._treeItem.parent&&this._treeItem.parent.uiTreeObject.updateCheckedStatusFromChildren())),this.dispose(this._treeItem.childrenChangedEvent.disposableOn(()=>{this.updateCheckedStatusFromChildren()}));const s=this.disposeVar(we(this._updateCheckedStatusFromChildrenEvent));this.dispose(s.disposableOn(()=>{if(!this._treeItem.children)return;let o=0;Qu(this._treeItem.children,h=>(o|=Vw[h.uiTreeObject.checkedStatus],o===3)),o>0&&(this._checkedStatus.value=qw[o-1])})),this.dispose(this._treeItem.childrenResetedEvent.disposableOn(o=>{!o&&this.checkedStatus==="indeterminate"&&(this._checkedStatus.value="unchecked")}));{const o=(h,l,d=!0)=>{if(l)h.selectedItems.push(this._treeItem);else{const f=h.selectedItems.indexOf(this._treeItem);f===-1?d&&console.error("selectedItems index -1"):h.selectedItems.splice(f,1)}};this.dispose(this._selected.changed.disposableOn(h=>{const{tree:l}=this._treeItem;l&&o(l,h)})),this.dispose(()=>this.selected=!1)}}get treeItem(){return this._treeItem}get collapsed(){return this._collapsed.value}set collapsed(t){this._collapsed.value=t}get collapsedChanged(){return this._collapsed.changed}get checkedStatus(){return this._checkedStatus.value}check(t){const n=t?"checked":"unchecked";if(this._checkedStatus.value!==n&&(this._checkedStatus.value=n,this._treeItem.children))for(let s of this._treeItem.children)s.uiTreeObject.check(t)}updateCheckedStatusFromChildren(){this._updateCheckedStatusFromChildrenEvent.emit()}get checkedStatusChanged(){return this._checkedStatus.changed}get selected(){return this._selected.value}set selected(t){this._selected.value=t}get selectedChanged(){return this._selected.changed}get moveToPositionMode(){return this._moveToPositionMode.value}set moveToPositionMode(t){this._moveToPositionMode.value=t}get moveToPositionModeChanged(){return this._moveToPositionMode.changed}}const hn=class hn extends st{constructor(t,n=!1,s){super();p(this,"_children");p(this,"_childrenResetedEvent");p(this,"_childrenToChangeEvent");p(this,"_childrenChangedEvent");p(this,"_parent",this.disposeVar(it(void 0)));p(this,"_level",this.disposeVar(it(0)));p(this,"_id");p(this,"_uiTreeObject",this.disposeVar(new Wp(this)));this._tree=t,this._hasChildren=n,this._id=s??Zr(),this._id!=="_ROOT"&&hn.wm.has(this._id)&&console.warn(`创建了id(${this._id})相同的树节点,会导致之前的树节点无法索引!`),hn.wm.set(this._id,this),this.dispose(()=>{if(this._id!=="_ROOT"&&!hn.wm.has(this._id)){console.warn(`树节点(${this._id})不在wm树上!`);return}hn.wm.delete(this._id)}),this.dispose(this._parent.changed.disposableOn(()=>{this._updateLevel()})),this.dispose(this._level.changed.disposableOn(()=>{if(this.children)for(let o of this.children)o._updateLevel()})),hn.allTreeItems.set(this._id,this),this.dispose(()=>{hn.allTreeItems.delete(this._id)})}static getFromId(t){return hn.wm.get(t)}get uiTreeObject(){return this._uiTreeObject}get id(){return this._id}_updateLevel(){this.parent&&(this._level.value=this.parent.level+1)}get parent(){return this._parent.value}get parentChanged(){return this._parent.changed}get children(){if(this._hasChildren){if(!this._children){const t=this.disposeVar(new Io);this._children=t,this.dispose(t.toChangeEvent.disposableOn((o,h)=>{for(let l of o){const{start:d,deleteCount:f,items:v}=l;for(let m=d;m<d+f;++m)h.get(m)._parent.value=void 0;for(let m of v){if(m.parent)throw console.error("请检查新增的treeItem是否正在使用!"),new Error("item.parent should not exist!");m._parent.value=this}}}));const n=new Set,s=new Set;this.dispose(t.toChangeEvent.disposableOn((o,h)=>{var l;if(this.tree){n.clear(),s.clear();for(let d of o){const{start:f,deleteCount:v,items:m}=d;for(let y=f;y<f+v;++y)n.add(h.get(y));for(let y of m)s.add(y)}for(let d of n)s.has(d)&&(n.delete(d),s.delete(d));(l=this.tree)==null||l.itemChildrenToChange.emit(this,o,n,s)}})),this.dispose(t.changedEvent.disposableOn(()=>{var o;(o=this.tree)==null||o.itemChildrenChanged.emit(this)})),this.dispose(t.toChangeEvent.disposableOn((...o)=>this._childrenToChangeEvent&&this._childrenToChangeEvent.emit(...o))),this.dispose(t.changedEvent.disposableOn((...o)=>this._childrenChangedEvent&&this._childrenChangedEvent.emit(...o)))}return this._children}else return}get childrenResetedEvent(){return this._childrenResetedEvent||(this._childrenResetedEvent=new H),this._childrenResetedEvent}get childrenToChangeEvent(){return this._childrenToChangeEvent||(this._childrenToChangeEvent=new H),this._childrenToChangeEvent}get childrenChangedEvent(){return this._childrenChangedEvent||(this._childrenChangedEvent=new H),this._childrenChangedEvent}resetChildren(t=!1){this._children&&(this._children.length=0),this._hasChildren=t,this._childrenResetedEvent&&this._childrenResetedEvent.emit(t)}*getDescendants(t){const n=this,s=[],o=[];for(n.children&&n.children.length>0&&(!t||t(n))&&(s.push(0),o.push(n.children));s.length>0;){const h=s[s.length-1],l=o[o.length-1],d=l.get(h);yield d,h<l.length-1?++s[s.length-1]:(o.pop(),s.pop()),d.children&&d.children.length>0&&(!t||t(d))&&(s.push(0),o.push(d.children))}}*getAncestors(t){let n=this.parent;for(;n&&(yield n,!(t&&!t(n)));)n=n.parent}isDescendantOf(t){for(let n of this.getAncestors())if(n===t)return!0;return!1}isAncestorOf(t){return t.isDescendantOf(this)}get level(){return this._level.value}get levelChanged(){return this._level.changed}get tree(){return this._tree}canMoveTo(t,n){return Ao(this,t,n)}moveTo(t,n){nl(this,t,n)}detachFromParent(){if(!this.parent||!this.parent.children)return;const t=this.parent.children.indexOf(this);this.parent.children.splice(t,1)}insertNewTreeItem(t,n){if(n&&n.tree!==this.tree)return console.warn("newTreeItem.tree !== this.tree"),!1;if(this.children&&t.startsWith("Inner"))return n&&this.children.push(n),!0;if(t==="Inner")return!1;const s=this.parent;if(!s||!s.children)return!1;const o=s.children.indexOf(this);return t.endsWith("Before")?n&&s.children.splice(o,0,n):t.endsWith("After")&&n&&s.children.splice(o+1,0,n),!0}};p(hn,"wm",new Map),p(hn,"allTreeItems",new Map);let Do=hn;class Hp extends st{constructor(t){super();p(this,"_redrawEvent",this.disposeVar(new H));p(this,"_containerScrollTop",this.disposeVar(it(0)));p(this,"_containerClientHeight",this.disposeVar(it(-1)));p(this,"_container",this.disposeVar(it(void 0)));p(this,"_redrawInfo",{topFreeSpaceHeight:0,topUnvisibleItemNum:0,middleTreeItems:[],bottomFreeSpaceHeight:0,bottomUnvisibleItemNum:0});this._tree=t;const n=this._containerClientHeight,s=this._containerScrollTop,o=this._tree._forceRedrawEvent,h=this.disposeVar(we(this._tree.itemDivHeightChanged,this._tree.itemChildrenChanged,this._tree.itemsChanged,n.changed,s.changed,o)),{redrawInfo:l}=this,d=v=>{const m=v.uiTreeObject;return!!v.children&&(!m||!m.collapsed)};this.dispose(h.disposableOn(()=>{if(l.topFreeSpaceHeight=0,l.topUnvisibleItemNum=0,l.middleTreeItems.length=0,l.bottomFreeSpaceHeight=0,l.bottomUnvisibleItemNum=0,this._containerClientHeight.value>=0){const v=ec(this._tree.getDescendants(d)),m=this._tree.itemDivHeight,y=m*v,w=Yn([_s([Yn([y-n.value,0]),s.value]),0]),S=w/m|0,T=Math.ceil((w-S*m+n.value)/m)|0;S>0&&(l.topUnvisibleItemNum=S,l.topFreeSpaceHeight=S*this._tree.itemDivHeight);const N=S+T;let j=0;for(let k of this._tree.getDescendants(d)){if(j>=N)break;j>=S&&l.middleTreeItems.push(k),++j}const C=v-S-T;C>0&&(l.bottomUnvisibleItemNum=C,l.bottomFreeSpaceHeight=C*this._tree.itemDivHeight)}else for(let v of this._tree.getDescendants(d))l.middleTreeItems.push(v);this._redrawEvent.emit(l)}));let f;this.dispose(()=>f&&(f.destroy(),f=void 0)),this.dispose(this.containerChanged.disposableOn(v=>{f&&(f.destroy(),f=void 0),v&&(f=To(),f.start(()=>{const{scrollTop:m,clientHeight:y}=v;typeof m>"u"||typeof y>"u"?Jr("createUiTreeWithContainer error: conainter has no scrollTop or clientHeight property!"):(this.containerScrollTop=m,this.containerClientHeight=y)}))}))}get container(){return this._container.value}set container(t){this._container.value=t}get containerChanged(){return this._container.changed}get redrawInfo(){return this._redrawInfo}getTreeItemPos(t){const n=h=>{const l=h.uiTreeObject;return!!h.children&&(!l||!l.collapsed)};let s=0,o=!1;for(let h of this._tree.getDescendants(n)){if(h===t){o=!0;break}++s}if(o)return[s,s*this._tree.itemDivHeight]}collapseAll(){console.log("collapseAll");for(let t of this.tree.root.getDescendants()){const n=t.uiTreeObject;n.collapsed=!0}}expandAll(){console.log("expandAll");for(let t of this.tree.root.getDescendants()){const n=t.uiTreeObject;n.collapsed=!1}}get tree(){return this._tree}get redrawEvent(){return this._redrawEvent}set containerScrollTop(t){this._containerScrollTop.value=t}get containerScrollTop(){return this._containerScrollTop.value}get containerScrollTopChanged(){return this._containerScrollTop.changed}set containerClientHeight(t){this._containerClientHeight.value=t}get containerClientHeight(){return this._containerClientHeight.value}get containerClientHeightChanged(){return this._containerClientHeight.changed}*getAllItems(t){for(let n of this._tree.getDescendants())(!t||t(n))&&(yield n)}getAllSelectedItems(){return this.getAllItems(t=>t.uiTreeObject.selected)}getAllCheckedItems(){return this.getAllItems(t=>t.uiTreeObject.checkedStatus==="checked")}getAllCheckedLeafItems(){return this.getAllItems(t=>!t.children&&t.uiTreeObject.checkedStatus==="checked")}selectAllItems(t){for(let n of this.getAllItems())(!t||!t.includes(n))&&(n.uiTreeObject.selected=!0)}clearAllSelectedItems(t){for(let n of this.getAllSelectedItems())(!t||!t.includes(n))&&(n.uiTreeObject.selected=!1)}checkAllItems(t){for(let n of this.getAllItems())(!t||!t.includes(n))&&n.uiTreeObject.check(!0)}clearAllCheckedItems(t){for(let n of this.getAllCheckedItems())(!t||!t.includes(n))&&n.uiTreeObject.check(!1)}}const As=class As extends st{constructor(t){super();p(this,"_root",this.disposeVar(new Do(this,!0,"_ROOT")));p(this,"_itemChildrenChanged",this.disposeVar(new H));p(this,"_itemChildrenToChange",this.disposeVar(new H));p(this,"_itemsAdded",this.disposeVar(new H));p(this,"_itemsDeleted",this.disposeVar(new H));p(this,"_itemsChanged",this.disposeVar(new H));p(this,"_transactionStack",0);p(this,"_addedItems",new Set);p(this,"_deletedItems",new Set);p(this,"_selectedItems",this.disposeVar(new Io));p(this,"_itemDivHeight",this.disposeVar(it(As.defaultItemDivHeight)));p(this,"_forceRedrawEvent",this.disposeVar(new H));p(this,"_uiTree",this.disposeVar(new Hp(this)));this._root._tree.value=this,this.dispose(this._itemChildrenToChange.disposableOn((n,s)=>{if(!n.children){console.error("!item.children");return}for(let o of s){const{start:h,deleteCount:l,items:d}=o;for(let f=h;f<h+l;++f){const v=n.children.get(f);this._deletedItems.has(v)?console.error(`this._deletedItems.has(currentItem(${v.id}))`):this._deletedItems.add(v)}for(let f of d)this._deletedItems.has(f)?this._deletedItems.delete(f):this._addedItems.add(f)}this._execTransaction()})),t!==void 0&&(this.itemDivHeight=t)}get selectedItems(){return this._selectedItems}get lastSelectedItem(){return this._selectedItems.length>0?this._selectedItems.get(this._selectedItems.length-1):void 0}get itemDivHeight(){return this._itemDivHeight.value}set itemDivHeight(t){this._itemDivHeight.value=t}get itemDivHeightChanged(){return this._itemDivHeight.changed}forceRedraw(){this._forceRedrawEvent.emit()}get uiTree(){return this._uiTree}get root(){return this._root}get children(){return this._root.children}getDescendants(t){return this._root.getDescendants(t)}getTreeItemFromId(t){let n;for(let s of this.getDescendants())if(s.id===t){n=s;break}return n}_startTransaction(){this._transactionStack===0&&(this._deletedItems.size>0&&(console.warn("this._deletedItems.size > 0"),this._deletedItems.clear()),this._addedItems.size>0&&(console.warn("this._addedItems.size > 0"),this._addedItems.clear())),++this._transactionStack}_stopTransaction(){--this._transactionStack,this._execTransaction()}_execTransaction(){this._transactionStack===0&&(this._deletedItems.size>0&&(this._itemsDeleted.emit([...this._deletedItems]),this._deletedItems.clear()),this._addedItems.size>0&&(this._itemsAdded.emit([...this._addedItems]),this._addedItems.clear()))}get itemChildrenChanged(){return this._itemChildrenChanged}get itemChildrenToChange(){return this._itemChildrenToChange}get itemsChanged(){return this._itemsChanged}get itemsAdded(){return this._itemsAdded}get itemsDeleted(){return this._itemsDeleted}};p(As,"defaultItemDivHeight",24),p(As,"canMoveToTreeItem",Ao),p(As,"moveToTreeItem",nl),p(As,"canMoveToTreeItems",qp),p(As,"moveToTreeItems",$p);let er=As;class xe extends st{constructor(t,n,s=!0,o){super();p(this,"_obj",this.disposeVar(it(void 0)));this._resetEvent=t,this._createFunc=n;const h=this._resetEvent,l=this._createFunc,d=()=>{this._obj.value&&(this._obj.value.destroy(),this._obj.value=void 0)};this.dispose(d);const f=(...v)=>{d(),this._obj.value=l(...v)};s&&(o?this._obj.value=l(...o):this._obj.value=l()),this.dispose(h.disposableOn(f))}get obj(){return this._obj.value}get objChanged(){return this._obj.changed}}class $w extends st{constructor(t,n=!0,s){super();p(this,"_event",this.disposeVar(new H));p(this,"_objResettingWithEvent");this._createFunc=t,this._execOnInit=n,this._initParams=s,this._objResettingWithEvent=this.disposeVar(new xe(this._event,this._createFunc,this._execOnInit,this._initParams))}get obj(){return this._objResettingWithEvent.obj}get objChanged(){return this._objResettingWithEvent.objChanged}reset(...t){this._event.emit(...t)}}const Iu=class Iu extends st{constructor(){super();p(this,"_set",new Set);p(this,"_toChangeEvent",this.dv(new H));p(this,"_changedEvent",this.dv(new H));p(this,"main");this.dispose(()=>{this._set.size!==0&&(Iu.warnOnDestroying&&console.warn("this._set.size > 0"),this.clear())})}get toChange(){return this._toChangeEvent}get changed(){return this._changedEvent}add(...t){if(t.length==2&&typeof t[1]=="boolean")t[1]&&(this.main=t[0]);else for(let n of t)this._toChangeEvent.emit([],[n]),this._set.add(n),this._changedEvent.emit([],[n])}delete(...t){for(let n of t)this.main&&this.main==n&&(this.main=void 0),this._toChangeEvent.emit([n],[]),this._set.delete(n),this._changedEvent.emit([n],[])}disposableAdd(...t){return t.length==2&&typeof t[1]=="boolean"?(t[1]&&(this.main=t[0]),this.add(t[0]),()=>this.delete(t[0])):(this.add(...t),()=>this.delete(...t))}get size(){return this._set.size}clear(){const t=[...this._set];this._toChangeEvent.emit([],t),this._set.clear(),this._changedEvent.emit([],t),this.main=void 0}values(){return this._set.values()}};p(Iu,"warnOnDestroying",!0);let sl=Iu;async function Xp(i){const e=[],t=[],n=i.entries();for await(const[s,o]of n){const h=o;h.kind==="file"?e.push(s):h.kind==="directory"&&t.push(s)}return{files:e,dirs:t}}async function bc(i){return await(await i.getFile()).text()}async function Yp(i){const e=await bc(i);try{return JSON.parse(e)}catch{return}}async function Jp(i){return await(await i.getFile()).arrayBuffer()}class Kp extends st{constructor(e){super(),this._rootDirHandle=e}get rootDirHandle(){return this._rootDirHandle}async getSubFilesAndDirs(){return await Xp(this._rootDirHandle)}async getDir(e){let t=this._rootDirHandle;for(const n of e)if(t=await(t==null?void 0:t.getDirectoryHandle(n)),!t){console.log(`getDirectoryHandle ${n} failed`);return}return t}async getFile(e,t){const n=await this.getDir(e);if(n)try{return await n.getFileHandle(t)}catch(s){console.error(`未能获取当前文件 ${e.join("/")}/${t} error: ${s}`,s);return}}}class Zp extends st{constructor(t){super();p(this,"_startRootDirId",0);p(this,"_dirMap",new Map);this._prefix=t}get prefix(){return this._prefix}async getRootDirId(t){let n;try{console.log("window.showDirectoryPicker begin"),n=await window.showDirectoryPicker({id:t,mode:"read"}),console.log("window.showDirectoryPicker end",n)}catch(s){console.error(`LocalFileServer getRootDirId failed: ${s}`,s);return}if(n){const s=++this._startRootDirId,o=`${this._prefix}${s}`;return this._dirMap.set(o,new Kp(n)),o}}getRootDir(t){return this._dirMap.get(t)}async getFile(t){const n=t.split("/");if(n.length<2){console.warn(`LocalFileServer getFile failed: ${t}`);return}const s=n[0],o=this._dirMap.get(s);if(!o){console.warn(`LocalFileServer getFile failed: ${t}`);return}const h=n.slice(1,n.length-1),l=n[n.length-1],d=await o.getFile(h,l);if(!d){console.warn(`LocalFileServer getFile failed: ${t}`);return}return d}async getText(t){const n=await this.getFile(t);if(n)return await bc(n)}async getArrayBuffer(t){const n=await this.getFile(t);if(n)return await Jp(n)}async getJson(t){const n=await this.getFile(t);if(n)return await Yp(n)}async getLocalFilePath(t,n,s){const o=await this.getRootDirId(n);if(!o){console.warn("getRootDirId error!");return}const h=this.getRootDir(o);if(!h){console.warn("getRootDir error!");return}const l=await h.getSubFilesAndDirs();if(!l.files){console.warn("getSubFilesAndDirs error! 找不到符合要求的文件!");return}const d=t?l.files.filter(f=>t.some(v=>f.endsWith(v))):l.files;if(d.length===0){console.warn("找不到符合要求的文件!");return}return`https://${o}/${d[0]}`}}const Qp=new Zp("xe2_local");async function Ww(i,e,t){return await Qp.getLocalFilePath(i,e,t)}class tm extends st{constructor(t,n){super();p(this,"_processing");this._complexImage=t,this._imageUri=n,this._processing=this.disposeVar(wi(async s=>{const o=this._complexImage,h=await s.promise(mp(this._imageUri,this._complexImage.crossOrigin));h&&h instanceof HTMLImageElement&&(o.size=[h.naturalWidth,h.naturalHeight],o.pixelFormat="RGBA",o.copyTexture({source:h}))})),this._processing.start()}get processing(){return this._processing}}const em=["DEPTH_COMPONENT","DEPTH_STENCIL","ALPHA","RED","RG","RGB","RGBA","LUMINANCE","LUMINANCE_ALPHA","RGB_DXT1","RGBA_DXT1","RGBA_DXT3","RGBA_DXT5","RGB_PVRTC_4BPPV1","RGB_PVRTC_2BPPV1","RGBA_PVRTC_4BPPV1","RGBA_PVRTC_2BPPV1","RGBA_ASTC","RGB_ETC1","RGB8_ETC2","RGBA8_ETC2_EAC","RGBA_BC7"],im=["img","gif","video","flv","hls"];let Hw=class extends st{constructor(t,n){super();p(this,"_element");this._complexImage=t,this._videoSrc=n;var s=document.createElement("video");s.src=this._videoSrc,s.style.position="absolute",s.style.top="0px",s.style.left="0px",s.style.zIndex="-100",s.style.visibility="hidden",s.style.width="0px",s.style.height="0px";{const o=()=>{s.crossOrigin=this._complexImage.crossOrigin};o(),this.dispose(this._complexImage.crossOriginChanged.disposableOn(o))}{const o=()=>{s.autoplay=this._complexImage.autoplay};o(),this.dispose(this._complexImage.autoplayChanged.disposableOn(o))}{const o=()=>{s.loop=this._complexImage.loop};o(),this.dispose(this._complexImage.loopChanged.disposableOn(o))}s.muted=!0,document.body.appendChild(s),this._element=s,this.dispose(()=>document.body.removeChild(s))}get element(){return this._element}};class nm extends st{constructor(t,n){super();p(this,"_videoDom");p(this,"_update");this._complexImage=t,this._imageUri=n,this._videoDom=this.disposeVar(new Hw(this._complexImage,this._imageUri)),this._update=this.disposeVar(sa(()=>this.update())),this._update.start()}get videoDom(){return this._videoDom}get videoElement(){return this._videoDom.element}update(){if(this.videoElement.readyState<2)return;const t=this._complexImage,{videoWidth:n,videoHeight:s}=this.videoElement;t.size=[n,s],t.pixelFormat="RGBA",t.copyTexture({source:this.videoElement})}}function Pc(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}function Xw(i){if(Object.prototype.hasOwnProperty.call(i,"__esModule"))return i;var e=i.default;if(typeof e=="function"){var t=function n(){return this instanceof n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(i).forEach(function(n){var s=Object.getOwnPropertyDescriptor(i,n);Object.defineProperty(t,n,s.get?s:{enumerable:!0,get:function(){return i[n]}})}),t}var Cc={},Jn={},sm;function rm(){if(sm)return Jn;sm=1,Object.defineProperty(Jn,"__esModule",{value:!0}),Jn.loop=Jn.conditional=Jn.parse=void 0;var i=function n(s,o){var h=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},l=arguments.length>3&&arguments[3]!==void 0?arguments[3]:h;if(Array.isArray(o))o.forEach(function(f){return n(s,f,h,l)});else if(typeof o=="function")o(s,h,l,n);else{var d=Object.keys(o)[0];Array.isArray(o[d])?(l[d]={},n(s,o[d],h,l[d])):l[d]=o[d](s,h,l,n)}return h};Jn.parse=i;var e=function(s,o){return function(h,l,d,f){o(h,l,d)&&f(h,s,l,d)}};Jn.conditional=e;var t=function(s,o){return function(h,l,d,f){for(var v=[],m=h.pos;o(h,l,d);){var y={};if(f(h,s,l,y),h.pos===m)break;m=h.pos,v.push(y)}return v}};return Jn.loop=t,Jn}var be={},am;function om(){if(am)return be;am=1,Object.defineProperty(be,"__esModule",{value:!0}),be.readBits=be.readArray=be.readUnsigned=be.readString=be.peekBytes=be.readBytes=be.peekByte=be.readByte=be.buildStream=void 0;var i=function(m){return{data:m,pos:0}};be.buildStream=i;var e=function(){return function(m){return m.data[m.pos++]}};be.readByte=e;var t=function(){var m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return function(y){return y.data[y.pos+m]}};be.peekByte=t;var n=function(m){return function(y){return y.data.subarray(y.pos,y.pos+=m)}};be.readBytes=n;var s=function(m){return function(y){return y.data.subarray(y.pos,y.pos+m)}};be.peekBytes=s;var o=function(m){return function(y){return Array.from(n(m)(y)).map(function(w){return String.fromCharCode(w)}).join("")}};be.readString=o;var h=function(m){return function(y){var w=n(2)(y);return m?(w[1]<<8)+w[0]:(w[0]<<8)+w[1]}};be.readUnsigned=h;var l=function(m,y){return function(w,S,T){for(var N=typeof y=="function"?y(w,S,T):y,j=n(m),C=new Array(N),k=0;k<N;k++)C[k]=j(w);return C}};be.readArray=l;var d=function(m,y,w){for(var S=0,T=0;T<w;T++)S+=m[y+T]&&Math.pow(2,w-T-1);return S},f=function(m){return function(y){for(var w=e()(y),S=new Array(8),T=0;T<8;T++)S[7-T]=!!(w&1<<T);return Object.keys(m).reduce(function(N,j){var C=m[j];return C.length?N[j]=d(S,C.index,C.length):N[j]=S[C.index],N},{})}};return be.readBits=f,be}var hm;function Yw(){return hm||(hm=1,(function(i){Object.defineProperty(i,"__esModule",{value:!0}),i.default=void 0;var e=rm(),t=om(),n={blocks:function(y){for(var w=0,S=[],T=y.data.length,N=0,j=(0,t.readByte)()(y);j!==w&&j;j=(0,t.readByte)()(y)){if(y.pos+j>=T){var C=T-y.pos;S.push((0,t.readBytes)(C)(y)),N+=C;break}S.push((0,t.readBytes)(j)(y)),N+=j}for(var k=new Uint8Array(N),M=0,D=0;D<S.length;D++)k.set(S[D],M),M+=S[D].length;return k}},s=(0,e.conditional)({gce:[{codes:(0,t.readBytes)(2)},{byteSize:(0,t.readByte)()},{extras:(0,t.readBits)({future:{index:0,length:3},disposal:{index:3,length:3},userInput:{index:6},transparentColorGiven:{index:7}})},{delay:(0,t.readUnsigned)(!0)},{transparentColorIndex:(0,t.readByte)()},{terminator:(0,t.readByte)()}]},function(m){var y=(0,t.peekBytes)(2)(m);return y[0]===33&&y[1]===249}),o=(0,e.conditional)({image:[{code:(0,t.readByte)()},{descriptor:[{left:(0,t.readUnsigned)(!0)},{top:(0,t.readUnsigned)(!0)},{width:(0,t.readUnsigned)(!0)},{height:(0,t.readUnsigned)(!0)},{lct:(0,t.readBits)({exists:{index:0},interlaced:{index:1},sort:{index:2},future:{index:3,length:2},size:{index:5,length:3}})}]},(0,e.conditional)({lct:(0,t.readArray)(3,function(m,y,w){return Math.pow(2,w.descriptor.lct.size+1)})},function(m,y,w){return w.descriptor.lct.exists}),{data:[{minCodeSize:(0,t.readByte)()},n]}]},function(m){return(0,t.peekByte)()(m)===44}),h=(0,e.conditional)({text:[{codes:(0,t.readBytes)(2)},{blockSize:(0,t.readByte)()},{preData:function(y,w,S){return(0,t.readBytes)(S.text.blockSize)(y)}},n]},function(m){var y=(0,t.peekBytes)(2)(m);return y[0]===33&&y[1]===1}),l=(0,e.conditional)({application:[{codes:(0,t.readBytes)(2)},{blockSize:(0,t.readByte)()},{id:function(y,w,S){return(0,t.readString)(S.blockSize)(y)}},n]},function(m){var y=(0,t.peekBytes)(2)(m);return y[0]===33&&y[1]===255}),d=(0,e.conditional)({comment:[{codes:(0,t.readBytes)(2)},n]},function(m){var y=(0,t.peekBytes)(2)(m);return y[0]===33&&y[1]===254}),f=[{header:[{signature:(0,t.readString)(3)},{version:(0,t.readString)(3)}]},{lsd:[{width:(0,t.readUnsigned)(!0)},{height:(0,t.readUnsigned)(!0)},{gct:(0,t.readBits)({exists:{index:0},resolution:{index:1,length:3},sort:{index:4},size:{index:5,length:3}})},{backgroundColorIndex:(0,t.readByte)()},{pixelAspectRatio:(0,t.readByte)()}]},(0,e.conditional)({gct:(0,t.readArray)(3,function(m,y){return Math.pow(2,y.lsd.gct.size+1)})},function(m,y){return y.lsd.gct.exists}),{frames:(0,e.loop)([s,l,d,o,h],function(m){var y=(0,t.peekByte)()(m);return y===33||y===44})}],v=f;i.default=v})(Cc)),Cc}var Jw=Yw();const Kw=Pc(Jw);var Zw=rm(),Qw=om();const tE=(i,e)=>{const t=new Array(i.length),n=i.length/e,s=function(v,m){const y=i.slice(m*e,(m+1)*e);t.splice.apply(t,[v*e,e].concat(y))},o=[0,4,2,1],h=[8,8,4,2];for(var l=0,d=0;d<4;d++)for(var f=o[d];f<n;f+=h[d])s(f,l),l++;return t},eE=(i,e,t)=>{const o=t;var h,l,d,f,v,m,y,D,w,S,M,T,L,V,I,x;const N=new Array(t),j=new Array(4096),C=new Array(4096),k=new Array(4097);for(T=i,l=1<<T,v=l+1,h=l+2,y=-1,f=T+1,d=(1<<f)-1,w=0;w<l;w++)j[w]=0,C[w]=w;var M,D,L,V,x,I;for(M=D=L=V=x=I=0,S=0;S<o;){if(V===0){if(D<f){M+=e[I]<<D,D+=8,I++;continue}if(w=M&d,M>>=f,D-=f,w>h||w==v)break;if(w==l){f=T+1,d=(1<<f)-1,h=l+2,y=-1;continue}if(y==-1){k[V++]=C[w],y=w,L=w;continue}for(m=w,w==h&&(k[V++]=L,w=y);w>l;)k[V++]=C[w],w=j[w];L=C[w]&255,k[V++]=L,h<4096&&(j[h]=y,C[h]=L,h++,(h&d)===0&&h<4096&&(f++,d+=h)),y=m}V--,N[x++]=k[V],S++}for(S=x;S<o;S++)N[S]=0;return N},iE=i=>{const e=new Uint8Array(i);return Zw.parse(Qw.buildStream(e),Kw)},nE=i=>{const e=i.pixels.length,t=new Uint8ClampedArray(e*4);for(var n=0;n<e;n++){const s=n*4,o=i.pixels[n],h=i.colorTable[o]||[0,0,0];t[s]=h[0],t[s+1]=h[1],t[s+2]=h[2],t[s+3]=o!==i.transparentIndex?255:0}return t},sE=(i,e,t)=>{if(!i.image){console.warn("gif frame does not have associated image.");return}const{image:n}=i,s=n.descriptor.width*n.descriptor.height;var o=eE(n.data.minCodeSize,n.data.blocks,s);n.descriptor.lct.interlaced&&(o=tE(o,n.descriptor.width));const h={pixels:o,dims:{top:i.image.descriptor.top,left:i.image.descriptor.left,width:i.image.descriptor.width,height:i.image.descriptor.height}};return n.descriptor.lct&&n.descriptor.lct.exists?h.colorTable=n.lct:h.colorTable=e,i.gce&&(h.delay=(i.gce.delay||10)*10,h.disposalType=i.gce.extras.disposal,i.gce.extras.transparentColorGiven&&(h.transparentIndex=i.gce.transparentColorIndex)),h.patch=nE(h),h},rE=(i,e)=>i.frames.filter(t=>t.image).map(t=>sE(t,i.gct));async function lm(i){const t=await(await fetch(i)).arrayBuffer(),n=iE(t),s=rE(n);return{gif:n,gifFrames:s,arrayBuffer:t}}function um(i,e,t){return i<e?e:i>t?t:i}class cm extends il{constructor(t,n=!0,s){super();p(this,"_gifFrames",this.disposeVar(it(void 0)));p(this,"_gifDurations",[]);p(this,"_gifDuration",this.disposeVar(it(0)));p(this,"_gifSize",this.disposeVar(it([0,0],(t,n)=>t.every((s,o)=>s===n[o]),t=>[...t])));p(this,"_autoPlayOnLoad",this.disposeVar(it(!0)));p(this,"_gifCanvas");this._container=t,this.loop=!0;const o=document.createElement("canvas");this._gifCanvas=o,o.style.width="100%",o.style.height="100%";const h=o.getContext("2d");this._container&&this._container.appendChild(o),this.dispose(()=>this._container&&this._container.removeChild(o));let l;this.dispose(this._gifFrames.changed.disposableOn(f=>{if(!f||f.length===0){o.width=0,o.height=0;return}const{width:v,height:m}=f[0].dims;this._gifSize.value=[v,m];const y=f.length;let w=0;this._gifDurations.length=0;for(let S=0;S<y;++S)w+=f[S].delay,this._gifDurations.push(w);this._gifDuration.value=this._gifDurations[this._gifDurations.length-1],o.width=v,o.height=m,l=h.createImageData(v,m),this.currentTimeChangedEvent.emit(this.currentTime,this.currentTime),this._autoPlayOnLoad.value&&(this.currentTime=0,this.playing=!0)}));let d=-1;this.dispose(this.currentTimeChangedEvent.disposableOn(f=>{const v=um(f/this.duration,0,1),m=this.gifDuration*v,y=this._gifFrames.value;if(y&&y.length>0){const w=this._getFrame(m);if(w===d)return;d=w;const S=y[w];if(S.disposalType!==0&&S.disposalType!==1&&S.disposalType!==2&&Jr(`gif parsed get disposalType ${S.disposalType}... frame: ${w} size: ${JSON.stringify(S.dims)}`,`gif parsed get disposalType ${S.disposalType}...`),l&&(w===0||S.disposalType===2)&&l.data.fill(0),l){const[T,N]=this._gifSize.value,{width:j,height:C,left:k,top:M}=S.dims;if(C>N)throw new Error("height > canvasHeight");for(let D=0;D<C;++D)for(let L=0;L<j;++L){const V=D*j+L,x=M+D,I=k+L,R=x*T+I,G=l.data,F=S.patch,U=F[V*4+3]/255;G[R*4+0]=G[R*4+0]*(1-U)+F[V*4+0]*U|0,G[R*4+1]=G[R*4+1]*(1-U)+F[V*4+1]*U|0,G[R*4+2]=G[R*4+2]*(1-U)+F[V*4+2]*U|0,G[R*4+3]=um(G[R*4+3]+F[V*4+3],0,255)|0}h.putImageData(l,0,0)}}else Jr("gif资源未加载!无法播放!")})),this.dispose(this._gifDuration.changed.disposableOn(()=>{this.duration=this.gifDuration})),this._autoPlayOnLoad.value=n,this._gifFrames.value=s}get gifCanvas(){return this._gifCanvas}set gifFrames(t){this._gifFrames.value=t}get gifFrames(){return this._gifFrames.value}get gifFramesChanged(){return this._gifFrames.changed}get gifSize(){return this._gifSize.value}get gifSizeChanged(){return this._gifSize.changed}get gifDuration(){return this._gifDuration.value}get gifDurationChanged(){return this._gifDuration.changed}get autoPlayOnLoad(){return this._autoPlayOnLoad.value}set autoPlayOnLoad(t){this._autoPlayOnLoad.value=t}get autoPlayOnLoadChanged(){return this._autoPlayOnLoad.changed}_getFrame(t){const n=this._gifDurations.length;for(let s=0;s<n;++s)if(t<=this._gifDurations[s])return s;throw new Error("should not be here")}}class dm extends st{constructor(t){super();p(this,"_player");p(this,"_url",this.disposeVar(it("")));p(this,"_loadGifFramesProcessing",this.disposeVar(el(t=>na(lm(t)))));this._player=this.disposeVar(new cm(t)),this._player.autoPlayOnLoad=!0,this._loadGifFramesProcessing.completeFunc=({gifFrames:n})=>this._player.gifFrames=n,this.dispose(this._url.changed.disposableOn(n=>{this._player.gifFrames=void 0,this._loadGifFramesProcessing.restart(new tn(`reload gif(${n})`),n)}))}get player(){return this._player}set url(t){this._url.value=t}get url(){return this._url.value}get loadedEvent(){return this._loadGifFramesProcessing.completeEvent}get size(){return this._player.gifSize}get sizeChanged(){return this._player.gifSizeChanged}get duration(){return this._player.gifDuration}get durationChanged(){return this._player.gifDurationChanged}}class fm extends st{constructor(t,n){super();p(this,"_gif",this.disposeVar(new dm));p(this,"_update");this._complexImage=t,this._imageUri=n,this._gif.url=this._imageUri,this._update=this.disposeVar(sa(()=>this.update())),this._update.start()}get gif(){return this._gif}update(){const{player:t}=this._gif;if(!t.gifFrames)return;const n=this._complexImage,{width:s,height:o}=t.gifCanvas;n.size=[s,o],n.pixelFormat="RGBA",n.copyTexture({source:t.gifCanvas});{const h=()=>{t.autoPlayOnLoad=this._complexImage.autoplay};h(),this.dispose(this._complexImage.autoplayChanged.disposableOn(h))}{const h=()=>{t.loop=this._complexImage.loop};h(),this.dispose(this._complexImage.loopChanged.disposableOn(h))}}}function gm(i,e){const[t,n,s]=wo(i),o=it(void 0),h=()=>{const l=t()??e;o.value=l&&St.context.getStrFromEnv(l)};return h(),s&&o.d(s.don(h)),o.d(St.context.environmentVariablesChanged.don(h)),o}function pm(i){const e=/\${(.*?)\}/g;if(!e.test(i))return i;const t=i.replace(e,(n,s)=>{const o=St.context.getEnv(s);return o===void 0?(console.warn(`环境变量(${s})不存在,无法进行转换`),"{env-error}"):o});return pm(t)}class aE extends st{constructor(t){super();p(this,"_sceneObjRefs",new Map);p(this,"_refs",{});p(this,"_refsChanged",this.dv(new H));const n=(s,o,h)=>{if(h){const l=this.getLastSceneObject(h),d=this._sceneObjRefs.get(h);if(!d)console.warn(`this._sceneObjRefs中不存在ref(${h}), 可能系统存在逻辑问题`);else{const v=d.indexOf(s);v===-1?console.warn(`this._sceneObjRefs中不存在当前对象(id: ${s.id} type: ${s.typeName})!可能系统存在逻辑问题`):(d.splice(v,1),d.length===0&&this._sceneObjRefs.delete(h))}const f=this.getLastSceneObject(h);this._refs[h]=f,this._refsChanged.emit(f,l)}if(o){const l=this.getLastSceneObject(o),d=this._sceneObjRefs.get(o);d?(d.push(s),d.length>0&&console.warn(`同时存在多个ref${o}相同的场景对象!
|
|
21
|
+
`)}}),window.g_XE3CopyRights=window.g_XE3CopyRights||{},window.g_XE3CopyRights[i]=b.copyright,window.g_XE3SendProductUsageInfo=window.g_XE3SendProductUsageInfo||!0,window.g_XE3SendProductUsageInfo&&(setTimeout(()=>rp(b.copyright),6e4),setInterval(()=>rp(b.copyright),864e5)),window.g_earthsdk_copyright_print=window.g_earthsdk_copyright_print??!0,window.g_earthsdk_copyright_print&&b.copyright.print()}catch{console.warn("版本信息有误!")}const ap=new Set;function Jr(i,e=i){ap.has(e)||(ap.add(e),console.warn(i))}function wo(i){const e=$h(i),t=()=>e[0][e[1]],n=o=>{try{e[0][e[1]]=o}catch(h){Jr(`setValue error, obj(${e[0].constructor.name}) prop(${e[1]}) error(${h})`)}},s=e[0][e[2]];return[t,n,s]}function x1(){return!0}function b1(){throw new Error("throwOnDestroyed")}function op(i){for(var e in i)typeof i[e]=="function"&&(i[e]=b1);i.isDestroyed=x1}const Cu=class Cu{constructor(){p(this,"_memId",++Cu._lastMemId);p(this,"_disposers")}get __v_skip(){return!0}get memId(){return this._memId}get disposers(){return this._disposers||(this._disposers=[]),this._disposers}dispose(e){return this.disposers.push(e),e}d(e){return this.dispose(e)}disposeVar(e){return this.disposers.push(()=>e.destroy()),e}dv(e){return this.disposeVar(e)}tryDisposeVar(e){return this.disposers.push(()=>e.tryDestroy()),e}tdv(e){return this.tryDisposeVar(e)}autoDispose(e){return typeof e=="function"?this.dispose(e):this.disposeVar(e)}ad(e){return typeof e=="function"?this.dispose(e):this.disposeVar(e)}isDestroyed(){return!1}destroyImp(){}destroy(){if(this._toDestroyEvent&&this._toDestroyEvent.emit(),this.destroyImp(),this._disposers)try{const e=this._disposers,t=e.length;for(let n=t-1;n>=0;--n)e[n]();e.length=0,this._disposers=void 0}catch(e){console.error(`destroy get error! ${e}`)}return op(this)}tryDestory(){if(!this.isDestroyed())return this.destroy()}};p(Cu,"_lastMemId",-1);let st=Cu,Uu;function hp(i){Uu=i}Object.defineProperties(st.prototype,{toDestroyEvent:{get(){if(this._toDestroyEvent===void 0){if(!Uu)throw new Error("Destroyable EventCtor not registered yet!");this._toDestroyEvent=this.disposeVar(new Uu)}return this._toDestroyEvent}}});class Vh{constructor(e,t,n=!1){p(this,"_freeElements");p(this,"_usedElementsCount");p(this,"_usedElements");p(this,"_nextCreateID");p(this,"_scratchObjs");this._createDefaultFunc=e,this._destroyFunc=t,this._freeElements=[],this._usedElementsCount=0,this._nextCreateID=1,this._scratchObjs=[],n&&(this._usedElements=[])}get usedElementsCount(){return this._usedElementsCount}get freeElementsCount(){return this._freeElements.length}_getCreateID(){return this._nextCreateID++}_create(){let e;return this._freeElements.length>0?e=this._freeElements.pop():e=this._createDefaultFunc&&this._createDefaultFunc()||{},e._cid=this._getCreateID(),e}create(){return this._create()}multiCreate(e){this._scratchObjs.length=0;for(let t=0;t<e;++t)this._scratchObjs.push(this._create());return this._scratchObjs}_destroy(e){this._destroyFunc&&this._destroyFunc(e),e._cid=void 0}destroy(...e){const t=e.length;for(let n=0;n<t;++n)this._destroy(e[n])}}function P1(){return{item:void 0,previous:void 0,next:void 0}}function C1(i){i.item=void 0,i.previous=void 0,i.next=void 0}const lp=new Vh(P1,C1,!0);function Vu(i,e,t){const n=lp.create();return n.item=i,n.previous=e,n.next=t,n}function up(i){if(!i)throw new Error("node is undefined!");lp.destroy(i)}function qu(i,e){e.previous&&e.next?(e.previous.next=e.next,e.next.previous=e.previous):e.previous?(e.previous.next=void 0,i.tail=e.previous):e.next?(e.next.previous=void 0,i.head=e.next):(i.head=void 0,i.tail=void 0),e.next=void 0,e.previous=void 0}class cp{constructor(e){p(this,"head");p(this,"tail");p(this,"_length");const{needLength:t}=e||{needLength:!0};this.head=void 0,this.tail=void 0,t&&(this._length=0)}_incrementLength(){typeof this._length=="number"&&++this._length}_decrementLength(){typeof this._length=="number"&&--this._length}_setLength(e){typeof this._length=="number"&&(this._length=e)}get length(){return this._length}get empty(){return!this.head}*[Symbol.iterator](){let e=this.head;for(;e;)yield e,e=e.next}remove(e){if(!e)throw new Error("node is undefined!");qu(this,e),this._decrementLength(),up(e)}getNode(e){let t=this.head;for(;t!==null;){if(!t)throw new Error("current is undefined!");if(t.item===e)return t;t=t.next}}moveAfter(e,t){if(e!==t){qu(this,t);var n=e.next;e.next=t,this.tail===e?this.tail=t:n&&(n.previous=t),t.next=n,t.previous=e}}moveBefore(e,t){if(e!==t){qu(this,t);var n=e.previous;e.previous=t,this.head===e?this.head=t:n&&(n.next=t),t.previous=n,t.next=e}}insertBefore(e,t){const n=Vu(t,e.previous,e);return e.previous&&(e.previous.next=n),e.previous=n,this.head===e&&(this.head=n),this._incrementLength(),n}insertAfter(e,t){const n=Vu(t,e,e.next);return e.next&&(e.next.previous=n),e.next=n,this.tail===e&&(this.tail=n),this._incrementLength(),n}_setFirstNode(e){if(this.head||this.tail)throw new Error("_setFirstNode error!");const t=Vu(e,void 0,void 0);if(this.head=t,this.tail=t,this._incrementLength(),this._length!==1)throw new Error("_setFirstNode error! this._length !== 1");return t}push(e){return this.tail?this.insertAfter(this.tail,e):this._setFirstNode(e)}pop(){if(!this.tail)throw new Error("DoublyLinkedList is empty!");const e=this.tail.item;return this.remove(this.tail),e}shift(){if(!this.head)throw new Error("DoublyLinkedList is empty!");const e=this.head.item;return this.remove(this.head),e}unshift(e){return this.head?this.insertBefore(this.head,e):this._setFirstNode(e)}removeAll(){let e=this.head;for(;e;){const t=e.next;up(e),e=t}this.head=void 0,this.tail=void 0,this._setLength(0)}}function I1(){return{func:void 0,scope:void 0,_hasRemoved:!1,_once:!1}}function M1(i){i.func=void 0,i.scope=void 0,i._hasRemoved=!1,i._once=!1}const Ys=new Vh(I1,M1,!0);class $u{constructor(){p(this,"__dll");p(this,"__currentListenerStack")}get _dll(){return this.__dll=this.__dll??new cp({needLength:!0}),this.__dll}_pushCurrentListener(e){this.__currentListenerStack?Array.isArray(this.__currentListenerStack)?this.__currentListenerStack.push(e):this.__currentListenerStack=[this.__currentListenerStack,e]:this.__currentListenerStack=e}_popCurrentListener(){if(this.__currentListenerStack)Array.isArray(this.__currentListenerStack)?this.__currentListenerStack.pop():this.__currentListenerStack=void 0;else throw new Error("cannot pop!")}_hasCurrentListener(e){return this.__currentListenerStack?Array.isArray(this.__currentListenerStack)?this.__currentListenerStack.indexOf(e)!==-1:this.__currentListenerStack===e:!1}do(...e){if(this.__dll&&!this._dll.empty){let t=this._dll.head;for(;t;){const n=t.item;n._hasRemoved||(this._pushCurrentListener(n),n.func.call(n.scope,...e),this._popCurrentListener());const s=t.next;n._once&&!n._hasRemoved&&(this.remove(t),t=void 0),t&&this._clearHasRemoved(t),t=s}}}get empty(){if(!this.__dll||this._dll.empty)return!0;let e=!0,t=this._dll.head;for(;t;){if(!t.item._hasRemoved){e=!1;break}t=t.next}return e}isHandlerValid(e){return!e.item._hasRemoved}nextHandler(e){if(!e.item._hasRemoved)throw new Error("handler has removed!");let t=e.next;for(;t&&t.item._hasRemoved;)t=t.next;return t}prevHandler(e){if(!e.item._hasRemoved)throw new Error("handler has removed!");let t=e.previous;for(;t&&t.item._hasRemoved;)t=t.previous;return t}moveAfter(e,t){if(e.item._hasRemoved||t.item._hasRemoved)throw new Error("handler or nextHandler has removed!");return this._dll.moveAfter(e,t)}moveBefore(e,t){if(e.item._hasRemoved||t.item._hasRemoved)throw new Error("handler or prevHandler has removed!");return this._dll.moveBefore(e,t)}insertBefore(e,t,n,s=!1){if(e.item._hasRemoved)throw new Error("handler has removed!");const o=Ys.create();return o.func=t,o.scope=n,o._once=s,this._dll.insertBefore(e,o)}insertAfter(e,t,n,s=!1){if(e.item._hasRemoved)throw new Error("handler has removed!");const o=Ys.create();return o.func=t,o.scope=n,o._once=s,this._dll.insertAfter(e,o)}_clearHasRemoved(e){e.item._hasRemoved&&!this._hasCurrentListener(e.item)&&(Ys.destroy(e.item),this._dll.remove(e))}remove(e){if(!e.item||e.item._hasRemoved)throw new Error("handler has removed!");this._hasCurrentListener(e.item)?e.item._hasRemoved=!0:(Ys.destroy(e.item),this._dll.remove(e))}removeAll(){if(this.__dll&&!this._dll.empty){let e=this._dll.head;for(;e;){const t=e.next;e.item._hasRemoved||this.remove(e),e=t}}}destroy(){if(!this.__dll)return;let e=this._dll.head;for(;e;){const t=e.next,n=e;this._hasCurrentListener(n.item)||(console.warn("Event has remove item that on current stack!"),console.warn(`${n.item.func.toString()}`)),Ys.destroy(n.item),this._dll.remove(n),e=t}this.__dll=void 0,this.__currentListenerStack=void 0}push(e,t,n=!1){const s=Ys.create();return s.func=e,s.scope=t,s._once=n,this._dll.push(s)}pop(){const e=this.tail;if(!e)throw new Error("pop error!");this.remove(e)}shift(){const e=this.head;if(!e)throw new Error("shift error!");this.remove(e)}unshift(e,t,n=!1){const s=Ys.create();return s.func=e,s.scope=t,s._once=n,this._dll.unshift(s)}get tail(){let e=this._dll.tail;for(;e&&e.item._hasRemoved;)e=e.previous;return e}get head(){let e=this._dll.head;for(;e&&e.item._hasRemoved;)e=e.previous;return e}}class Eo{constructor(){p(this,"_listenerHandler");p(this,"_cid")}_reset(e,t){this._listenerHandler=e,this._cid=t}clone(e){return e=e??new Eo,e._reset(this._listenerHandler,this._cid),e}get valid(){if(typeof this._listenerHandler<"u"&&typeof this._cid=="number"){const e=this._listenerHandler._cid;if(typeof e<"u"&&this._cid===e)return!0}return!1}}class Wu extends Eo{}let H=class extends st{constructor(){super(...arguments);p(this,"__pipe");p(this,"beforeCallback");p(this,"afterCallback")}get _pipe(){return this.__pipe=this.__pipe??new $u,this.__pipe}get empty(){return!this.__pipe||this._pipe.empty}emit(...t){!this.isDestroyed()&&this.beforeCallback&&this.beforeCallback(...t),!this.isDestroyed()&&this._pipe.do(...t),!this.isDestroyed()&&this.afterCallback&&this.afterCallback(...t)}on(t,n,s=!1,o){const h=s?this._pipe.unshift(t,n,!1):this._pipe.push(t,n,!1);return o=o??new Wu,o._reset(h,h._cid),o}disposableOn(t,n,s=!1,o){const h=this.on(t,n,s,o);return()=>{h.valid&&this.off(h)}}don(t,n,s=!1,o){return this.disposableOn(t,n,s,o)}disposableWeakOn(t,n,s=!1,o){const h=new st,l=()=>{!h.isDestroyed()&&h.destroy()};return h.dispose(this.disposableOn(t,n,s,o)),h.dispose(this.toDestroyEvent.disposableOn(l)),l}dwon(t,n,s=!1,o){return this.disposableWeakOn(t,n,s,o)}once(t,n,s=!1,o){const h=s?this._pipe.unshift(t,n,!0):this._pipe.push(t,n,!0);return o=o??new Wu,o._reset(h,h._cid),o}disposableOnce(t,n,s=!1,o){const h=this.once(t,n,s,o);return()=>h.valid&&this.off(h)}donce(t,n,s=!1,o){const h=this.once(t,n,s,o);return()=>h.valid&&this.off(h)}off(t){if(!t.valid)throw new Error("handler is not valid!");this._pipe.remove(t._listenerHandler),t._reset()}reset(){this._pipe.removeAll()}destroyImp(){this.empty||(Jr("The event is destroying with listeners!"),this._pipe.removeAll())}};hp(H);function Kr(i,e){return e=e??new Eo,e._reset(i,i._cid),e}class T1{constructor(){p(this,"__pipe")}get _pipe(){return this.__pipe=this.__pipe??new $u,this.__pipe}get empty(){return!this.__pipe||this._pipe.empty}do(...e){return this._pipe.do(...e)}isHandlerValid(e){return e.valid?this._pipe.isHandlerValid(e._listenerHandler):!1}moveAfter(e,t){if(!e.valid||!t.valid)throw new Error("handler or nextHander is not valid!");return this._pipe.moveAfter(e._listenerHandler,t._listenerHandler)}moveBefore(e,t){if(!e.valid||!t.valid)throw new Error("handler or nextHander is not valid!");return this._pipe.moveAfter(e._listenerHandler,t._listenerHandler)}insertBefore(e,t,n,s=!1,o){if(!e.valid)throw new Error("handler is not valid!");const h=this._pipe.insertBefore(e._listenerHandler,t,n,s);return Kr(h,o)}insertAfter(e,t,n,s=!1,o){if(!e.valid)throw new Error("handler is not valid!");const h=this._pipe.insertAfter(e._listenerHandler,t,n,s);return Kr(h,o)}remove(e){if(!e.valid)throw new Error("handler is not valid!");return this._pipe.remove(e._listenerHandler)}removeAll(){return this._pipe.removeAll()}push(e,t,n=!1,s){const o=this._pipe.push(e,t,n);return Kr(o,s)}pop(){return this._pipe.pop()}shift(){return this._pipe.shift()}unshift(e,t,n=!1,s){const o=this._pipe.unshift(e,t,n);return Kr(o,s)}getTail(e){const t=this._pipe.tail;if(t)return Kr(t,e)}getHead(e){const t=this._pipe.head;if(t)return Kr(t,e)}}class Ne extends st{constructor(t,n,s){super();p(this,"_changed");p(this,"_value");p(this,"_oldValue");p(this,"toChangeFunc");this._equalsFunc=n,this._assignFunc=s,this._value=this._assignFunc&&this._assignFunc(t,void 0)||t}get assignFunc(){return this._assignFunc}get equalsFunc(){return this._equalsFunc}equals(t){return this._equalsFunc?this._equalsFunc(this._value,t):this._value===t}set value(t){if(this._equalsFunc?!this._equalsFunc(this._value,t):this._value!==t){if(this.toChangeFunc&&!this.toChangeFunc(t,this._value))return;this._assignFunc?(this._oldValue=this._assignFunc(this._value,this._oldValue),this._value=this._assignFunc(t,this._value)):(this._oldValue=this._value,this._value=t),this._changed&&this._changed.emit(t,this._oldValue)}}get value(){return this._value}get changed(){return this._changed||(this._changed=this.disposeVar(new H)),this._changed}forceChange(){this._changed&&this._changed.emit(this._value,this._value)}}function it(i,e,t){return new Ne(i,e,t)}function vt(i){return new Ne(i,(e,t)=>e.length!==t.length?!1:e.every((n,s)=>n===t[s]),(e,t)=>{const n=t||new Array(e.length);return n.length=e.length,e.forEach((s,o)=>n[o]=s),n})}function Wt(i){return it(i,(e,t)=>e===void 0||t===void 0?e===void 0&&t===void 0:e.length!==t.length?!1:e.every((n,s)=>n===t[s]),(e,t)=>{if(!e)return;const n=t||new Array(e.length);return n.length=e.length,e.forEach((s,o)=>n[o]=s),n})}function qh(i,e,t){return it(i,(n,s)=>n.length!==s.length?!1:n.every((o,h)=>e&&e(o,s[h])||o===s[h]),(n,s)=>{const o=s||new Array(n.length);return o.length=n.length,n.forEach((h,l)=>{o[l]=t?t(h):h}),o})}function ms(i,e,t){return it(i,(n,s)=>n===void 0||s===void 0?n===void 0&&s===void 0:n.length!==s.length?!1:n.every((o,h)=>e&&e(o,s[h])||o===s[h]),(n,s)=>{if(!n)return;const o=s||new Array(n.length);return o.length=n.length,n.forEach((h,l)=>{o[l]=t?t(h):h}),o})}function At(i){return new Ne(i,(e,t)=>e===t||e!==void 0&&t!==void 0&&JSON.stringify(e)===JSON.stringify(t),(e,t)=>{if(e!==void 0)return JSON.parse(JSON.stringify(e))})}function se(i){return new Ne(i,(e,t)=>e===t||e!==void 0&&t!==void 0&&JSON.stringify(e)===JSON.stringify(t),(e,t)=>{if(e!==void 0)return JSON.parse(JSON.stringify(e))})}function k1(i){return new Ne(i,(e,t)=>{if(e===t)return!0;if(e===void 0||t===void 0)return!1;const n=Object.keys(e),s=Object.keys(t);return n.length!==s.length?!1:n.every((o,h)=>o===s[h]&&e[o]===t[o])},(e,t)=>e&&{...e})}function O1(i){return new Ne(i,(e,t)=>{if(e===t)return!0;if(e===void 0||t===void 0)return!1;const n=Object.keys(e),s=Object.keys(t);return n.length!==s.length?!1:n.every((o,h)=>o===s[h]&&e[o]===t[o])},(e,t)=>e&&{...e})}function N1(i){return qh(i,(e,t)=>e.every((n,s)=>n===t[s]),e=>[...e])}function Hu(i){return ms(i,(e,t)=>e.every((n,s)=>n===t[s]),e=>[...e])}function R1(i){return qh(i,(e,t)=>JSON.stringify(e)===JSON.stringify(t),e=>JSON.parse(JSON.stringify(e)))}function A1(i){return ms(i,(e,t)=>JSON.stringify(e)===JSON.stringify(t),e=>JSON.parse(JSON.stringify(e)))}function vs(i){return Hu(i)}function Xu(i){return ms(i,(e,t)=>e.length===t.length&&e.every((n,s)=>n.every((o,h)=>o===t[s][h])),e=>e.map(t=>[...t]))}function D1(i){return ms(i,(e,t)=>e.length===t.length&&e.every((n,s)=>n.every((o,h)=>o===t[s][h])),e=>e.map(t=>[...t]))}function $h(i){const e=i instanceof Ne?[i,"value","changed"]:[...i];return e[2]=e[2]||e[1]+"Changed",e}function Yu(i,e,t,n=!1){e[2]=e[2]||e[1]+"Changed";const s=()=>{const o=e[0][e[1]];t?i[0][i[1]]=t(o):i[0][i[1]]=o};return s(),n?e[0][e[2]].disposableWeakOn(s):e[0][e[2]].disposableOn(s)}function L1(i,e,t,n,s=!1){const o=Yu(i,e,t,s),h=Yu(e,i,n,s);return()=>(o(),h())}function Q(i,e,t,n=!1){const s=i instanceof Ne?[i,"value","changed"]:i,o=e instanceof Ne?[e,"value","changed"]:e;return Yu(s,o,t,n)}function mt(i,e,t,n,s=!1){const o=$h(i),h=$h(e);return L1(o,h,t,n,s)}function F1(i,e,t,n=!1){const[s]=wo(e);return mt(i,e,o=>o??t,o=>{if(!(o===t&&s()===void 0))return o},n)}function Zr(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(i){var e=Math.random()*16|0,t=i==="x"?e:e&3|8;return t.toString(16)})}function Wh(i,e){if(!window||!window.setTimeout||!window.clearTimeout)throw new Error("目前只适合在浏览器中使用!");let t=0;function n(){t>0&&(window.clearTimeout(t),t=0)}function s(...o){n(),t=window.setTimeout(i,e,...o)}return[s,n]}function Ju(i,e,...t){const n=setInterval(i,e,...t);return()=>clearInterval(n)}function Ku(i,e,...t){const n=setTimeout(i,e,...t);return()=>clearTimeout(n)}function Hh(i,...e){let t;const n=()=>{const s=performance.now();i(s,...e),t=requestAnimationFrame(n)};return n(),()=>typeof t<"u"&&(cancelAnimationFrame(t),t=void 0)}function Qr(i,...e){let t;return t=requestAnimationFrame(()=>{const s=performance.now();i(s,...e)}),()=>typeof t<"u"&&(cancelAnimationFrame(t),t=void 0)}function So(i,...e){let t=!1,n;return new Promise((s,o)=>{n=o,s()}).then(()=>{!t&&i(...e)}).catch(s=>{console.error(s)}),()=>(t=!0)&&n&&(n("nextMicroTask cancelled!"),n=void 0)}class Xh extends H{constructor(t,n,...s){super();p(this,"_cancellFunc");this._nextFunc=t,this.dispose(()=>{this._cancellFunc&&(this._cancellFunc(),this._cancellFunc=void 0)}),s.forEach(o=>this.dispose(o[n?"dwon":"don"](()=>{this.next()})))}next(){this._cancellFunc||(this._cancellFunc=this._nextFunc(()=>(this._cancellFunc=void 0,this.emit())))}flush(){this._cancellFunc&&(this._cancellFunc(),this._cancellFunc=void 0,this.emit())}}class Zu extends Xh{constructor(...e){super(So,!1,...e)}}function G1(...i){return new Zu(...i)}class j1 extends Xh{constructor(...e){super(So,!0,...e)}}function B1(...i){return new Zu(...i)}class Yh extends Xh{constructor(...e){super(Qr,!1,...e)}}function we(...i){return new Yh(...i)}function z1(i,e){return new Yh(...i).don(e())}class dp extends Xh{constructor(...e){super(Qr,!0,...e)}}function U1(...i){return new dp(...i)}function Me(i,e,t={time:"don",immediate:!1}){const n=new Yh(...Array.isArray(i)?i:[i]),s=n[t.time??"don"](e);return(t.immediate??!1)&&e(),()=>{s(),n.destroy()}}function xo(i){let e;if(typeof i.next=="function")e=i;else if(typeof i[Symbol.iterator]=="function")e=i[Symbol.iterator]();else throw new Error("iteratorOrIterable error!");return e}function Qu(i,e){let t=!1;const n=xo(i);let s=-1;for(;;){const{done:o,value:h}=n.next();if(o)break;if(e(h,++s)){t=!0;break}}return t}function tc(i,e){return!Qu(i,(n,s)=>!e(n,s))}function bo(i,e,t,n){const s=i;if(!s[e]){const o=n(),h=Object.fromEntries(Object.entries(o).filter(([l,d])=>{const f=Object.getPrototypeOf(t),v=l in f;if(v){const m=d instanceof Ne?d.value:d;i[l]=m}return!v}).map(([l,d])=>d instanceof Ne?[l,d]:[l,Array.isArray(d)?Wt(d):it(d)]));s[e]=h}return s[e]}function ys(i,e){var n;const t=Symbol(`${(n=i==null?void 0:i.constructor)==null?void 0:n.name}-createDefaultProps`);i.constructor.__xbsj_dpSymbol=t,i.constructor.__xbsj_createDefaultProps=e;for(let[s,o]of Object.entries(e()))if(!Reflect.has(i,s)){const h=function(l){var v,m;if(l[t])return;const d=[];let f=Object.getPrototypeOf(l);for(;f;)d.push(f),f=Object.getPrototypeOf(f);d.reverse();for(let y of d){const w=(v=y.constructor)==null?void 0:v.__xbsj_dpSymbol;if(!w)continue;const S=(m=y.constructor)==null?void 0:m.__xbsj_createDefaultProps;S&&bo(l,w,y,S)}};Object.defineProperties(i,{[s]:{get(){return h(this),bo(this,t,i,e)[s].value},set(l){h(this);const d=bo(this,t,i,e)[s];if(!d){console.error("!propObj");debugger}d.value=l}},[`${s}Changed`]:{get(){return h(this),bo(this,t,i,e)[s].changed}},[`${s}React`]:{get(){return h(this),bo(this,t,i,e)[s]}}})}}const Po=new WeakMap;function yn(i,e,t){Po.has(i)||Po.set(i,{});const n=Po.get(i);n[e]=t}function _i(i,e){return Po.has(i)?Po.get(i)[e]:void 0}function _n(i,e){const t=xo(i);let n=0;for(;;){const{done:s,value:o}=t.next();if(s)break;e(o,n++)}}function Co(i,e,t){const n=xo(i);let s=t,o=0;for(;;){const{done:h,value:l}=n.next();if(h)break;s=e(s,l,o++)}return s}const V1=i=>++i;function ec(i){return Co(i,V1,0)}function Yn(i){return Co(i,(e,t)=>e>t?e:t,Number.NEGATIVE_INFINITY)}function _s(i){return Co(i,(e,t)=>e<t?e:t,Number.POSITIVE_INFINITY)}function fp(i,e){let t=i;for(let n of e)t=t[n];return t}function q1(i,e,t){if(e.length===0)throw new Error("props的数量必须大于0");const n=e.length-1,s=e[n];let o=i;for(let h=0;h<n;++h){const l=e[h];typeof o[l]>"u"&&(o[l]={}),o=o[l]}o[s]=t}function*Js(i,e){const t=xo(i);for(;;){const{done:n,value:s}=t.next();if(n)break;yield fp(s,e)}}class Io extends st{constructor(){super();p(this,"_innerObj");p(this,"_toChangeEvent");p(this,"_changedEvent");this._innerObj=[],this.dispose(()=>{if(this.length=0,this._innerObj.length>0)throw new Error("this._innerObj.length > 0");this._toChangeEvent&&this._toChangeEvent.reset(),this._innerObj=void 0})}get toChangeEvent(){return this._toChangeEvent||(this._toChangeEvent=new H),this._toChangeEvent}get changedEvent(){return this._changedEvent||(this._changedEvent=new H),this._changedEvent}_resetArray(t){this._toChangeEvent&&this._toChangeEvent.emit([{start:0,deleteCount:this._innerObj.length,items:t}],this);const{length:n}=t;this._innerObj.length=n;for(let s=0;s<n;++s)this._innerObj[s]=t[s];this._changedEvent&&this._changedEvent.emit(this)}splice(t,n,...s){const{length:o}=this._innerObj;t=t>this._innerObj.length?this._innerObj.length:t,t>o?t=o:t<0&&(t+=o,t<0&&(t=0));const h=this._innerObj.length-t;if(n>h?n=h:n<0&&(n=0),arguments.length===1){this._toChangeEvent&&this._toChangeEvent.emit([{start:t,deleteCount:this._innerObj.length-t,items:[]}],this);const l=this._innerObj.splice(t);return this._changedEvent&&this._changedEvent.emit(this),l}else if(arguments.length===2){this._toChangeEvent&&this._toChangeEvent.emit([{start:t,deleteCount:n,items:[]}],this);const l=this._innerObj.splice(t,n);return this._changedEvent&&this._changedEvent.emit(this),l}else{this._toChangeEvent&&this._toChangeEvent.emit([{start:t,deleteCount:n,items:s}],this);const l=this._innerObj.splice(t,n,...s);return this._changedEvent&&this._changedEvent.emit(this),l}}pop(){if(this._innerObj.length===0)return;if(this._toChangeEvent){const n=this._innerObj.length-1,s=1,o=[];this._toChangeEvent.emit([{start:n,deleteCount:s,items:o}],this)}const t=this._innerObj.pop();return this._changedEvent&&this._changedEvent.emit(this),t}push(...t){if(this._toChangeEvent){const s=this._innerObj.length;this._toChangeEvent.emit([{start:s,deleteCount:0,items:t}],this)}const n=this._innerObj.push(...t);return this._changedEvent&&this._changedEvent.emit(this),n}get length(){return this._innerObj.length}set length(t){if(t<0)throw new Error("value < 0");const{length:n}=this._innerObj;if(n!==t){if(this._toChangeEvent){let s,o,h;n>t?(s=t,o=n-t,h=[]):(s=n,o=0,h=new Array(t-n)),this._toChangeEvent.emit([{start:s,deleteCount:o,items:h}],this)}this._innerObj.length=t,this._changedEvent&&this._changedEvent.emit(this)}}get(t){return this._innerObj[t]}set(t,n){const{length:s}=this._innerObj;if(t<0||t>=s)throw new Error("index < 0 || index >= length");this._toChangeEvent&&this._toChangeEvent.emit([{start:t,deleteCount:1,items:[n]}],this),this._innerObj[t]=n,this._changedEvent&&this._changedEvent.emit(this)}indexOf(t){return this._innerObj.indexOf(t)}[Symbol.iterator](){return this._innerObj[Symbol.iterator]()}}function ic(i,e,...t){let n=i;for(let s of t){if(!n[s])if(e)n[s]={};else return;n=n[s]}return n}function $1(i,e,t){typeof t>"u"&&(e.endsWith(".gltf")?t="model/gltf+json":e.endsWith(".bin")?t="application/octet-stream":e.endsWith(".glb")?t="model/gltf-binary":e.endsWith(".jpg")||e.endsWith(".jpeg")?t="image/jpeg":e.endsWith(".png")?t="image/png":e.endsWith(".glsl")?t="text/plain":e.endsWith(".json")?t="application/json":e.endsWith(".b3dm")||e.endsWith(".i3dm")||e.endsWith("pnts")||e.endsWith("cmpt")?t="application/octet-stream":console.warn(`save ${e}: MimeType无法确定!`));const n=new Blob([i],{type:t||""});let s=URL.createObjectURL(n);var o=document.createElement("a"),h=new MouseEvent("click");o.download=e,o.href=s,o.dispatchEvent(h),URL.revokeObjectURL(s)}function W1(i,e){const t=document.createElement("a"),n=new MouseEvent("click");t.download=e||"下载",t.href=i,t.dispatchEvent(n)}function H1(){return new Promise((i,e)=>{const t=performance.now();requestAnimationFrame(n=>i(n>t))})}const Jh=i=>{let e,t;return t=n=>{n=performance.now(),e=requestAnimationFrame(t),i(n)},e=requestAnimationFrame(t),()=>{cancelAnimationFrame(e)}};function nc(i,e,t=Jh){let n=Number.NEGATIVE_INFINITY,s;function o(d){d-n>e&&s&&(i(...s),s=void 0,n=d)}const h=t&&t(o)||void 0;function l(...d){s=d}return[l,h]}const gp=[];function pp(i,e,t){if(gp.includes(i)){console.warn(`_loadJs ${i} has loaded before!`),e&&e();return}var n=document.getElementsByTagName("head")[0],s=document.createElement("script");s.setAttribute("type","text/javascript"),s.setAttribute("src",i),s.onload=s.onreadystatechange=function(){this.readyState&&this.readyState!=="complete"||(gp.push(i),e&&e(),s.onload=s.onreadystatechange=null)},s.onerror=(o,h,l,d,f)=>{t(f)},n.appendChild(s)}function sc(i,e=!0){if(e){const t=window.L;window.L&&(window.L=void 0);const n=window.define;return window.define&&(window.define=void 0),new Promise((s,o)=>{pp(i,s,o)}).then(()=>(window.define=n,window.L=t,Promise.resolve()))}else return new Promise((t,n)=>{pp(i,t,n)})}async function mp(i,e=""){return new Promise((t,n)=>{var s=new Image;s.crossOrigin=e,s.src=i,s.onload=()=>t(s),s.onerror=o=>n(o)})}class X1 extends st{constructor(e){super(),this._owner=e}get owner(){return this._owner}}function vp(i,e){if(i.length%3!==0)throw new Error("positions.length % 3 !== 0");const t=i.length/3;function*n(h){for(let l=0;l<t;++l)yield i[l*3+h]}const s=(e==null?void 0:e.min)??[NaN,NaN,NaN],o=(e==null?void 0:e.max)??[NaN,NaN,NaN];return s[0]=_s(n(0))??NaN,s[1]=_s(n(1))??NaN,s[2]=_s(n(2))??NaN,o[0]=Yn(n(0))??NaN,o[1]=Yn(n(1))??NaN,o[2]=Yn(n(2))??NaN,{min:s,max:o}}async function Y1(i,e=fetch){const t=await e(i);return t.ok?await t.arrayBuffer():void 0}class J1 extends st{constructor(t){super();p(this,"_map",new Map);p(this,"_array",[]);p(this,"_createEvent",this.dv(new H));p(this,"_updateEvent",this.dv(new H));p(this,"_destroyEvent",this.dv(new H));this._idFunc=t,this.d(()=>{this._array.length>0&&console.warn("EventFromArrayUpdating: destroy with non-empty array, will trigger destroy event for all items")})}get createEvent(){return this._createEvent}get updateEvent(){return this._updateEvent}get destroyEvent(){return this._destroyEvent}update(t,n={toDel:!0,toAdd:!0,toUpdate:!0}){const{toDel:s=!0,toAdd:o=!0,toUpdate:h=!0}=n;for(let d of this._array)d.updated=!1;const l=t.length;for(let d=0;d<l;++d){const f=t[d],v=this._idFunc(f,d);if(this._map.has(v)){if(h){const m=this._map.get(v);if(!m)throw new Error("!edwi");m.updated=!0,m.item=f,this._updateEvent.emit(v,f)}}else if(o){const m={item:f,id:v,updated:!0};this._array.push(m),this._map.set(v,m),this._createEvent.emit(v,f)}}if(s){const d=this._array.filter(f=>!f.updated);this._array=this._array.filter(f=>f.updated);for(let f of d)this._map.delete(f.id);for(let f of d)this._destroyEvent.emit(f.id,f.item)}}}function Kh(i,...e){if(i>16)throw new Error("length > 16");const t=new Array(i);for(let n=0;n<i;++n)t[n]=e[n]??0;return t}class Zh{constructor(e,t){this._xyzw=e,this._length=t}set 0(e){this._xyzw.x=e}set 1(e){this._xyzw.y=e}set 2(e){this._xyzw.z=e}set 3(e){this._xyzw.w=e}get 0(){return this._xyzw.x??0}get 1(){return this._xyzw.y??0}get 2(){return this._xyzw.z??0}get 3(){return this._xyzw.w??0}get length(){return this._length}}function K1(i){return new Zh(i,2)}function Z1(i){return new Zh(i,3)}function Q1(i){return new Zh(i,4)}class tw{constructor(e,t,n,s){this._array=e,this._length=t,this._start=n,this._stride=s}get length(){return this._length}set 0(e){this._array[this._start+0*this._stride]=e}set 1(e){this._array[this._start+1*this._stride]=e}set 2(e){this._array[this._start+2*this._stride]=e}set 3(e){this._array[this._start+3*this._stride]=e}set 4(e){this._array[this._start+4*this._stride]=e}set 5(e){this._array[this._start+5*this._stride]=e}set 6(e){this._array[this._start+6*this._stride]=e}set 7(e){this._array[this._start+7*this._stride]=e}set 8(e){this._array[this._start+8*this._stride]=e}set 9(e){this._array[this._start+9*this._stride]=e}set 10(e){this._array[this._start+10*this._stride]=e}set 11(e){this._array[this._start+11*this._stride]=e}set 12(e){this._array[this._start+12*this._stride]=e}set 13(e){this._array[this._start+13*this._stride]=e}set 14(e){this._array[this._start+14*this._stride]=e}set 15(e){this._array[this._start+15*this._stride]=e}set 16(e){this._array[this._start+16*this._stride]=e}get 0(){return this._array[this._start+0*this._stride]}get 1(){return this._array[this._start+1*this._stride]}get 2(){return this._array[this._start+2*this._stride]}get 3(){return this._array[this._start+3*this._stride]}get 4(){return this._array[this._start+4*this._stride]}get 5(){return this._array[this._start+5*this._stride]}get 6(){return this._array[this._start+6*this._stride]}get 7(){return this._array[this._start+7*this._stride]}get 8(){return this._array[this._start+8*this._stride]}get 9(){return this._array[this._start+9*this._stride]}get 10(){return this._array[this._start+10*this._stride]}get 11(){return this._array[this._start+11*this._stride]}get 12(){return this._array[this._start+12*this._stride]}get 13(){return this._array[this._start+13*this._stride]}get 14(){return this._array[this._start+14*this._stride]}get 15(){return this._array[this._start+15*this._stride]}get 16(){return this._array[this._start+16*this._stride]}}function ew(i,e,t=0,n=1){return new tw(i,e,t,n)}b.Vector=void 0,(i=>{function e(A,...at){if(A=A||Kh(at.length),at.length>A.length)throw new Error("args.length > target.length");return A instanceof Float64Array?A.set(at):G(at,A),A}i.set=e;function t(A,at){const Pt=A.length;for(let It=0;It<Pt;++It)if(!at(A[It],It))return!1;return!0}i.every=t;function n(A,at,Pt){const It=A.length;let re=Pt;for(let le=0;le<It;++le)re=at(re,A[le],le);return re}i.reduce=n;function*s(A){for(let at=0;at<A.length;++at)yield A[at]}i.itr=s;const o=(A,at)=>A+=at*at;function h(A){return n(A,o,0)}i.magnitudeSquared=h;function l(A){const at=h(A);return Math.sqrt(at)}i.magnitude=l;function d(A,at=1e-5){const Pt=h(A);return Math.abs(Pt-1)<at}i.isNormalized=d;let f;const v=(A,at,Pt)=>A+at*f[Pt];function m(A,at){return V(A,at),f=at,n(A,v,0)}i.dot=m;let y;const w=(A,at,Pt)=>A+=(at-y[Pt])*(at-y[Pt]);function S(A,at){return V(A,at),y=at,n(A,w,0)}i.distanceSquared=S;function T(A,at){return Math.sqrt(S(A,at))}i.distance=T;let N;const j=(A,at)=>A===N[at];function C(A,at){return V(A,at),N=at,t(A,j)}i.equals=C;let k,M;const D=(A,at)=>Math.abs(A-k[at])<M;function L(A,at,Pt=0){return V(A,at),k=at,M=Pt,t(A,D)}i.equalsEpsilon=L;function V(A,at){if(A.length!==at.length)throw new Error("left.length !== right.length")}function x(A,at,Pt){const It=A.length;Pt=Pt||Kh(It),V(A,Pt);for(let re=0;re<It;++re)Pt[re]=at(A[re],re);return Pt}i.op1=x;function I(A,at,Pt,It){V(A,at),It&&V(A,It);const re=A.length;It=It||Kh(re);for(let le=0;le<re;++le)It[le]=Pt(A[le],at[le]);return It}i.op2=I;const R=A=>A;function G(A,at){return x(A,R,at)}i.clone=G;let F=0;const U=(A,at)=>A*F;function z(A,at,Pt){return F=at,x(A,U,Pt)}i.multiplyByScalar=z;function $(A,at,Pt=0){const It=h(A);if(It<=Pt)return;const re=Math.sqrt(It);return z(A,1/re,at)}i.normalize=$;function W(A,at){return z(A,-1,at)}i.negate=W;const X=A=>Math.abs(A);function Y(A,at){return x(A,X,at)}i.abs=Y;const et=A=>A-Math.floor(A);function J(A,at){return x(A,et,at)}i.fract=J;const rt=(A,at)=>A-at;function ht(A,at,Pt){return I(A,at,rt,Pt)}i.subtract=ht;const Ot=(A,at)=>A+at;function ct(A,at,Pt){return I(A,at,Ot,Pt)}i.add=ct;const _t=(A,at)=>A*at;function Ct(A,at,Pt){return I(A,at,_t,Pt)}i.multiply=Ct;const Lt=(A,at)=>A/at;function K(A,at,Pt){return I(A,at,Lt,Pt)}i.divide=K;let Qt;const zt=(A,at)=>A*(1-Qt)+at*Qt;function gt(A,at,Pt,It){return Qt=Pt,I(A,at,zt,It)}i.lerp=gt})(b.Vector||(b.Vector={}));function Qh(i,e=0,t=1){return i<e?e:i>t?t:i}class tl extends st{constructor(t,n,s,o,h,l,d,f){super();p(this,"__status");p(this,"_statusChangedEvent");p(this,"_forceCancelFunc");p(this,"_startEvent");p(this,"_progressEvent");p(this,"_completeEvent");p(this,"_cancelEvent");p(this,"_cancelledEvent");p(this,"_errorEvent");p(this,"_finishedEvent");p(this,"_processingID",-1);this._startProcessingFunc=t,this.startFunc=n,this.progressFunc=s,this.completeFunc=o,this.cancelFunc=h,this.cancelledFunc=l,this.errorFunc=d,this.finishedFunc=f,this._status="Initial",this.dispose(()=>{var v;return(v=this._statusChangedEvent)==null?void 0:v.destroy()}),this.dispose(()=>{var v;return(v=this._startEvent)==null?void 0:v.destroy()}),this.dispose(()=>{var v;return(v=this._progressEvent)==null?void 0:v.destroy()}),this.dispose(()=>{var v;return(v=this._completeEvent)==null?void 0:v.destroy()}),this.dispose(()=>{var v;return(v=this._cancelEvent)==null?void 0:v.destroy()}),this.dispose(()=>{var v;return(v=this._cancelledEvent)==null?void 0:v.destroy()}),this.dispose(()=>{var v;return(v=this._errorEvent)==null?void 0:v.destroy()}),this.dispose(()=>{var v;return(v=this._finishedEvent)==null?void 0:v.destroy()}),this.dispose(()=>this.reset())}get startEvent(){return this._startEvent=this._startEvent||new H,this._startEvent}get progressEvent(){return this._progressEvent=this._progressEvent||new H,this._progressEvent}get completeEvent(){return this._completeEvent=this._completeEvent||new H,this._completeEvent}get cancelEvent(){return this._cancelEvent=this._cancelEvent||new H,this._cancelEvent}get cancelledEvent(){return this._cancelledEvent=this._cancelledEvent||new H,this._cancelledEvent}get errorEvent(){return this._errorEvent=this._errorEvent||new H,this._errorEvent}get finishedEvent(){return this._finishedEvent=this._finishedEvent||new H,this._finishedEvent}_completeFunc(t,n){this.processingID===t&&this._status==="Running"&&(this._status="Completed",this.completeFunc&&this.completeFunc(n),this._completeEvent&&this._completeEvent.emit(n),this.finishedFunc&&this.finishedFunc({status:"Completed",value:n}),this._finishedEvent&&this._finishedEvent.emit({status:"Completed",value:n}))}_cancelFunc(t){this._status==="Running"&&(this._status="Cancelling",this.cancelFunc&&this.cancelFunc(t),this._cancelEvent&&this._cancelEvent.emit(t))}_cancelledFunc(t){this._status==="Cancelling"&&(this._status="Cancelled",this.cancelledFunc&&this.cancelledFunc(t),this._cancelledEvent&&this._cancelledEvent.emit(t),this.finishedFunc&&this.finishedFunc({status:"Cancelled",cancelError:t}),this._finishedEvent&&this._finishedEvent.emit({status:"Cancelled",cancelError:t}))}_errorFunc(t,n){this.processingID===t&&this._status==="Running"&&(this._status="Error",this.errorFunc&&this.errorFunc(n),this._errorEvent&&this._errorEvent.emit(n),this.finishedFunc&&this.finishedFunc({status:"Error",error:n}),this._finishedEvent&&this._finishedEvent.emit({status:"Error",error:n}))}_progressFunc(t,n){this.processingID===t&&this._status==="Running"&&(this.progressFunc&&this.progressFunc(n),this._progressEvent&&this._progressEvent.emit(n))}_startFunc(...t){if(this._status==="Initial"){this._status="Running";const n=++this._processingID,s={completeFunc:this._completeFunc.bind(this,n),errorFunc:this._errorFunc.bind(this,n),progressFunc:this._progressFunc.bind(this,n),cancelFunc:this._cancel.bind(this,n),processingID:n},o=this._startProcessingFunc(s,...t);return this._forceCancelFunc=o,this.startFunc&&this.startFunc(...t),this._startEvent&&this._startEvent.emit(...t),n}else return console.warn("this._status !== 'Initial' but start again!"),-1}set _status(t){if(this.__status!==t){const n=this.__status;this.__status=t,this._statusChangedEvent&&this._statusChangedEvent.emit(t,n)}}get _status(){return this.__status}get processingID(){return this._processingID}get statusChangedEvent(){return this._statusChangedEvent||(this._statusChangedEvent=new H),this._statusChangedEvent}reset(t){this._status==="Running"&&this.cancel(t),this._status==="Cancelled"||this._status==="Error"||this._status==="Completed"?this._status="Initial":this._status==="Cancelling"&&console.warn("Cannot reset! (this._status === 'Cancelling')")}get status(){return this._status}cancel(t,n=this.processingID){return this._cancel(n,t)}_cancel(t,n){if(this.processingID===t)if(this._status==="Running"){if(!this._forceCancelFunc)throw new Error("this._forceCancelFunc is undefined!");this._cancelFunc(n);const s=this._forceCancelFunc(n);if(this._forceCancelFunc=void 0,s&&s instanceof Promise)return s.then(()=>{this._cancelledFunc(n)});this._cancelledFunc(n)}else console.warn("this._status !== 'Running' but cancel")}start(...t){try{return this._startFunc(...t)}catch(n){console.error(`processing start error: ${n}`)}}restart(t,...n){try{return this.isRunning&&this.cancel(t),this.isFinished&&this.reset(t),this.isInitial?this._startFunc(...n):(console.warn("restart failed!"),-1)}catch(s){console.error(`processing restart error: ${s}`)}}get isCompleted(){return this._status==="Completed"}get isCancelled(){return this._status==="Cancelled"}get isCancelling(){return this._status==="Cancelling"}get isError(){return this._status==="Error"}get isInitial(){return this._status==="Initial"}get isRunning(){return this._status==="Running"}get isFinished(){return this.isCancelled||this.isCompleted||this.isError}}let rc=class extends Error{};function yp(i,e){typeof i=="function"?i(e):i.cancelFunc=e}class ac extends tl{constructor(t=300){super(({progressFunc:n,completeFunc:s,errorFunc:o})=>{const[h,l]=Wh(()=>{if(!this._lastDebounceValue)throw new Error("!this._lastDebounceValue");n([this._lastDebounceValue,this._debouncTimes]),this._debouncTimes=0},this._delayTime);return this._d=h,()=>{l()}});p(this,"_lastDebounceValue");p(this,"_debouncTimes",0);p(this,"_d");this._delayTime=t}get delayTime(){return this._delayTime}debounce(...t){this.isRunning?(++this._debouncTimes,this._lastDebounceValue=t,this._d&&this._d()):console.warn("Debouncing is not running!")}}function _p(i,e,...t){const n=new AbortController;let s=n.signal,[o,h]=t;if(h!=null&&h.signal)throw console.error("init?.signal"),new Error("init?.signal");h=h||{},h.signal=s;let l=!1;yp(i,()=>{l=!0,n.abort()});let d=fetch(o,h);return e&&(d=d.then(f=>{if(!f.ok)return f;if(!f.body)throw Error("ReadableStream not yet supported in this browser.");const v=f.headers.get("content-length"),m=v?parseInt(v,10):0;let y=0;return new Response(new ReadableStream({start(w){if(!f.body)throw new Error("!response.body");const S=f.body.getReader();T();function T(){S.read().then(({done:N,value:j})=>{if(N){w.close();return}if(!j)throw new Error("!value");if(!e)throw new Error("!progressFunc");y+=j.byteLength,e(y,m),w.enqueue(j),T()}).catch(N=>{w.error(N)})}}}),{status:f.status,statusText:f.statusText,headers:f.headers})}).catch(f=>{throw l?(f instanceof Error&&f.code!==20&&console.error("error.code !== 20"),console.log("fetching cancelled!"),new rc("fetching cancelled!")):(f instanceof Error&&f.code===20&&console.error("error.code === 20"),f)})),d}function wp(...i){if(i.length>=1)if(typeof i[0]=="function"||typeof i[0]>"u"){const e={};let t=_p(e,...i);const{cancelFunc:n}=e;if(!n)throw new Error("!cancelResult.cancelFunc");return[n,t]}else return _p(...i);throw new Error("cancelableFetch args error!")}class iw extends tl{constructor(t,...n){super(({progressFunc:s,completeFunc:o,errorFunc:h},...l)=>{const d={};let f={loaded:0,total:0};const v=(w,S)=>{f.loaded=w,f.total=S,s(f)},m=this._fetchArgs||l;if(m.length===0)throw new Error("fetchArgs.length === 0");if(wp(d,v,...m).then(t).then(o).catch(w=>{w instanceof rc||h(w)}),!d.cancelFunc)throw new Error("!cancelResult.cancelFunc");return d.cancelFunc});p(this,"_fetchArgs");n.length>0&&(this._fetchArgs=n)}get fetchArgs(){return this._fetchArgs}}function oc(i,e,t,n){const s="_"+e,o="_"+e+"Changed",h=e+"Changed";Object.defineProperties(i.prototype,{[e]:{get(){return typeof this[s]>"u"&&typeof t<"u"&&(this[s]=t),this[s]},set(l){if(typeof this[s]>"u"&&typeof t<"u"&&(this[s]=t),n?!n(this[s],l):this[s]!==l){const d=this[s];this[s]=l,this[o]&&this[o].emit(l,d)}}},[h]:{get(){return typeof this[o]>"u"&&(this[o]=new H,typeof this.dispose<"u"&&this.dispose(()=>this[o].destroy())),this[o]}}})}class hc extends tl{constructor(t,n=!0){super(({progressFunc:s,completeFunc:o,errorFunc:h})=>(this._intervalFunc=s,this._intervalID&&console.error("this._intervalID should be undefined!"),this.leading&&s(),this._intervalID=setInterval(s,this.intervalTime),()=>{if(!this._intervalID)throw console.error("this._intervalID should not be undefined!"),new Error("this._intervalID should not be undefined!");clearInterval(this._intervalID),this._intervalID=void 0}));p(this,"_intervalID");p(this,"_intervalFunc");this.intervalTime=t,this.leading=n,this.dispose(this.intervalTimeChanged.disposableOn(()=>{this._intervalID&&this._intervalFunc&&(clearInterval(this._intervalID),this._intervalID=setInterval(this._intervalFunc,this.intervalTime))}))}}oc(hc,"leading",!0),oc(hc,"intervalTime",500);function nw(i,e){let t,n;const s=new Promise((h,l)=>{n=l,t=globalThis.setTimeout(()=>{t=void 0,h()},i)}),o=h=>{t&&(clearTimeout(t),t=void 0),n&&n(h??new rc("sleep cancel error!"))};if(typeof e=="boolean"&&e)return[o,s];if(e)return yp(e,o),s}class sw{constructor(e=0,t=0,n=0,s,o){p(this,"_processData");p(this,"_lastUpdateTimeStamp",0);this.startTime=e,this.duration=t,this.delay=n,this.proccessFunc=s,this.completeFunc=o,this._processData={ratio:0,timeStamp:0,timeStampFromStart:0,timeStampFromLastUpdate:0}}update(e){const t=(e-this.startTime)/this.duration;t>=0&&(this._processData.ratio=t,this._processData.timeStamp=e,this._processData.timeStampFromStart=e-this.startTime,this._processData.timeStampFromLastUpdate=e-this._lastUpdateTimeStamp,this._lastUpdateTimeStamp=e,this.proccessFunc&&this.proccessFunc(this._processData),t>=1&&this.completeFunc&&this.completeFunc())}start(){this.startTime=performance.now()+this.delay,this._lastUpdateTimeStamp=this.startTime}}class Ep extends tl{constructor(t=1e3,n=0,s=Jh){let o;function h(){o&&o()}super(({progressFunc:d,completeFunc:f,errorFunc:v})=>{const m=this.startUpdateFunc&&this.startUpdateFunc(this._base.update.bind(this._base))||void 0;return this._base.startTime=performance.now(),this._base.duration=this.duration,this._base.delay=this.delay,this._base.proccessFunc=d,this._base.completeFunc=()=>{m&&m(),f()},this._base.start(),o=m,h});p(this,"_base");p(this,"duration");p(this,"delay");p(this,"startUpdateFunc");this._base=new sw,this.duration=t,this.delay=n,this.startUpdateFunc=s}get startTime(){return this._base.startTime}}class rw extends st{constructor(t){super();p(this,"_target",0);p(this,"_current",0);p(this,"_start",0);p(this,"_timing",new Ep(Number.POSITIVE_INFINITY));p(this,"_currentChanged");this._duration=t,this._timing.progressFunc=({ratio:n})=>{n=n<0?0:n>1?1:n;const s=this._start*(1-n)+this._target*n;this._current=s,this._currentChanged&&this._currentChanged.emit(this._target,this._current)},this.dispose(()=>{this._timing.isRunning&&this._timing.cancel(),this._timing.destroy()})}reset(t,n=t){this._timing.isRunning&&this._timing.cancel(),this._target=t,this._current=n,this._start=t}set target(t){if(this._target!==t){this._target=t,this._timing.isRunning&&this._timing.cancel(),this._timing.reset(),this._start=this._current;const n=Math.abs(this._target-this._start);this._timing.duration=n*this._duration,this._timing.start()}}get target(){return this._target}get current(){return this._current}get currentChanged(){return this._currentChanged||(this._currentChanged=new H),this._currentChanged}}function Sp(i,e){e=e||[];const t=i.parentNode;return t?Sp(t,e.concat(t)):e}function aw(i){const e=i.composedPath&&i.composedPath()||i.path,t=i.target;if(e!=null)return e.indexOf(window)<0?e.concat(window):e;if(t===window)return[window];if(t===null)throw new Error("target === null");return[t].concat(Sp(t),window)}function $e(i,e=!1){const{offsetX:t,offsetY:n}=i;let s=t,o=n;{const h=aw(i);for(let l=0;l<h.length;++l){const d=h[l];if(d!==i.currentTarget&&d instanceof HTMLElement)s+=d.clientLeft,o+=d.clientTop,s+=d.offsetLeft,o+=d.offsetTop;else break}}return e?[s*window.devicePixelRatio,o*window.devicePixelRatio]:[s,o]}function ta(i,e=!1){const t=i.target,n=i.currentTarget||i.__xbsj_lastCurrentTarget__;if(!t||!n)return[i.clientX,i.clientY];const s=t.getBoundingClientRect(),o=n.getBoundingClientRect(),h=s.left+i.offsetX,l=s.top+i.offsetY,d=h-o.left,f=l-o.top;return e?[d*window.devicePixelRatio,f*window.devicePixelRatio]:[d,f]}class xp extends st{constructor(t){super();p(this,"_clickEvent",new H);p(this,"_dbclickEvent",new H);p(this,"_downEvent",new H);p(this,"_upEvent",new H);p(this,"_moveEvent",new H);p(this,"_debouncing",new ac(300));this.dispose(()=>{this._clickEvent.destroy(),this._dbclickEvent.destroy(),this._downEvent.destroy(),this._upEvent.destroy(),this._moveEvent.destroy(),this._debouncing.destroy()});let n=!1,s=[0,0],o=!1;this._debouncing.progressFunc=([[v,m,y],w])=>{w===1?this._clickEvent.emit(v,m,y):w>=2?this._dbclickEvent.emit(v,m,y):console.error("point click should not be here!")},this._debouncing.start(),this.dispose(()=>{this._debouncing.isRunning&&this._debouncing.cancel(),this._debouncing.destroy()});const h=v=>{n=!0;const[m,y]=$e(v);s[0]=m,s[1]=y,this._downEvent.emit(m,y,v)},l=v=>{const[m,y]=$e(v);n&&!o&&this._debouncing.debounce(m,y,v),n=!1,o=!1,this._upEvent.emit(m,y,v)},d=v=>{const[m,y]=$e(v);if(n&&!o){const[w,S]=s;(Math.abs(m-w)>3||Math.abs(y-S)>3)&&(o=!0)}this._moveEvent.emit(m,y,v)},f=()=>{n=!1,o=!1};t.addEventListener("pointerdown",h),t.addEventListener("pointerup",l),t.addEventListener("pointermove",d),t.addEventListener("pointerout",f),this.dispose(()=>{t.removeEventListener("pointerdown",h),t.removeEventListener("pointerup",l),t.removeEventListener("pointermove",d),t.removeEventListener("pointerout",f)})}get clickEvent(){return this._clickEvent}get dbclickEvent(){return this._dbclickEvent}get downEvent(){return this._downEvent}get upEvent(){return this._upEvent}get moveEvent(){return this._moveEvent}}class lc extends st{constructor(){super();p(this,"_pickRectEvent",this.disposeVar(new H));p(this,"_updateRectEvent",this.disposeVar(new H));p(this,"_pointerActionEvent",this.disposeVar(new H));p(this,"_active",this.disposeVar(it(!1)));p(this,"_pickRect",{left0:0,top0:0,left1:0,top1:0});let t=0,n=0,s=0,o=0;this.dispose(this._pointerActionEvent.disposableOn(({type:h,left:l,top:d})=>{h==="PointerDown"?(this._active.value=!0,t=l,n=d,s=l,o=d,this._setPickRect({left0:t,top0:n,left1:s,top1:o}),this._updateRectEvent.emit(this._pickRect)):h==="PointerMove"?this._active.value&&(s=l,o=d,this._setPickRect({left0:t,top0:n,left1:s,top1:o}),this._updateRectEvent.emit(this._pickRect)):h==="PointerUp"&&this._active.value&&(this._active.value=!1,s=l,o=d,this._setPickRect({left0:t,top0:n,left1:s,top1:o}),this._updateRectEvent.emit(this._pickRect),this._pickRectEvent.emit(this._pickRect))}))}_setPickRect({left0:t,left1:n,top0:s,top1:o}){this._pickRect.left0=t,this._pickRect.left1=n,this._pickRect.top0=s,this._pickRect.top1=o}pointerDown(t,n){this._pointerActionEvent.emit({type:"PointerDown",left:t,top:n})}pointerMove(t,n){this._pointerActionEvent.emit({type:"PointerMove",left:t,top:n})}pointerUp(t,n){this._pointerActionEvent.emit({type:"PointerUp",left:t,top:n})}reset(){this._setPickRect({left0:0,top0:0,left1:0,top1:0}),this._updateRectEvent.emit(this._pickRect),this._pickRectEvent.emit(this._pickRect)}get activeEvent(){return this._active.changed}get updateRectEvent(){return this._updateRectEvent}get pickRectEvent(){return this._pickRectEvent}static getLeftTopAndSize(t,n){n=n||{left:0,top:0,width:0,height:0,forward:!0};const{left0:s,top0:o,left1:h,top1:l}=t;return n.width=Math.abs(s-h),n.height=Math.abs(o-l),n.left=Math.min(s,h),n.top=Math.min(o,l),n.forward=h>s,n}static contains(t,n,s){const{left:o,top:h,width:l,height:d}=s;return t>o&&t<=o+l&&n>=h&&n<=h+d}}class ow extends lc{constructor(e){super();const t=this.disposeVar(new xp(e));this.dispose(t.downEvent.disposableOn((h,l,d)=>d.altKey&&this.pointerDown(h,l))),this.dispose(t.moveEvent.disposableOn((h,l)=>this.pointerMove(h,l))),this.dispose(t.upEvent.disposableOn((h,l)=>this.pointerUp(h,l)));const n=document.createElement("div");n.style.backgroundColor="rgba(0, 0, 0, 0)",n.style.border="2px dashed red",n.style.position="absolute",n.style.boxSizing="border-box",n.style.pointerEvents="none",n.style.height="0px",n.style.width="0px",n.style.left="0px",n.style.top="0px",n.style.display="none",e.appendChild(n),this.dispose(()=>e.removeChild(n)),this.dispose(this.activeEvent.disposableOn(h=>{n.style.display=h?"block":"none"}));const s=()=>{this.reset()};e.addEventListener("contextmenu",s),this.dispose(()=>e.removeEventListener("contextmenu",s));const o={left:0,top:0,width:0,height:0,forward:!1};this.dispose(this.updateRectEvent.disposableOn(h=>{if(lc.getLeftTopAndSize(h,o)){const{left:l,top:d,width:f,height:v}=o;n.style.height=`${v|0}px`,n.style.width=`${f|0}px`,n.style.left=`${l|0}px`,n.style.top=`${d|0}px`}}))}}class tn extends Error{}function ws(i,e){_i(i,"_promise_cancel")&&console.warn("setPromiseCancel warn: promise has cancelFunc!"),yn(i,"_promise_cancel",e)}function ea(i){return _i(i,"_promise_cancel")}function ia(i){return!!ea(i)}function uc(i,e){const t=ea(i);return t?(t(e),!0):!1}function cc(i){const[e,t]=i;return ws(t,e),t}function na(i){let e;const t=new Promise((n,s)=>{e=s,i.then(n).catch(s)});return ws(t,e),t}function hw(i){let e,t;var n=new Promise((s,o)=>{t=i.disposableOn((...h)=>{t&&t(),s(h)}),e=h=>{t&&t(),o(h)}});return[e,n]}function lw(i){const e=new H,t=new H;return i.then(n=>{e.isDestroyed()||e.emit(n)}).catch(n=>{t.isDestroyed()||t.emit(n)}),[e,t]}class dc extends st{constructor(){super();p(this,"_cancelled",!1);p(this,"_cancelError");p(this,"_promiseSet",new Set);p(this,"_disposer")}get disposer(){return this._disposer=this._disposer||new st,this._disposer}destroyImp(){this.finally()}cancel(t){var n;if(!this._cancelled){this._cancelled=!0,(n=this._disposer)==null||n.destroy(),this._cancelError=t;for(let s of this._promiseSet)uc(s);this._promiseSet.clear()}}get cancelFuncsNum(){return Co(this._promiseSet,t=>t+1,0)}finally(){this._disposer&&!this._disposer.isDestroyed()&&this._disposer.destroy(),this._promiseSet.clear()}check(){if(this._cancelled)throw this._cancelError??new tn("cancel from CancelManager!")}promise(t){return this._promiseSet.add(t),t.finally(()=>(this._promiseSet.delete(t),this.check()))}promiseAny(t){const n=[],s=t.map(o=>(this._promiseSet.add(o),ia(o)&&n.push(ea(o)),o.finally(()=>this._promiseSet.delete(o))));return Promise.any(s).finally(()=>(n.forEach((o=>o(new tn("cancel from promiseAny!")))),n.length=0))}promiseAll(t){const n=[],s=t.map(o=>(this._promiseSet.add(o),ia(o)&&n.push(ea(o)),o.finally(()=>this._promiseSet.delete(o))));return Promise.all(s).finally(()=>(n.forEach((o=>o(new tn("cancel from promiseAll!")))),n.length=0))}promiseRace(t){const n=[],s=t.map(o=>(this._promiseSet.add(o),ia(o)&&n.push(ea(o)),o.finally(()=>this._promiseSet.delete(o))));return Promise.race(s).finally(()=>(n.forEach((o=>o(new tn("cancel from promiseRace!")))),n.length=0))}}class Re extends st{constructor(t){super();p(this,"_status","Initial");p(this,"_completeEvent");p(this,"_errorEvent");p(this,"_completeFunc");p(this,"_errorFunc");p(this,"_cancelFunc");p(this,"_runningId",-1);this._startFunc=t,this.dispose(()=>this.isRunning&&this.cancel())}get errorEvent(){return this._errorEvent||(this._errorEvent=new H),this._errorEvent}get completeEvent(){return this._completeEvent||(this._completeEvent=new H),this._completeEvent}get errorFunc(){return this._errorFunc}get completeFunc(){return this._completeFunc}set errorFunc(t){this._errorFunc!==t&&(this._errorFunc=t)}set completeFunc(t){this._completeFunc!==t&&(this._completeFunc=t)}start(...t){if(this._status!=="Initial")return;const n=++this._runningId;this._status="Running",this._cancelFunc=this._startFunc({completeFunc:s=>{var o;n===this._runningId&&this._status==="Running"&&(this._status="Completed",this._completeFunc&&this._completeFunc(s),(o=this._completeEvent)==null||o.emit(s))},errorFunc:s=>{var o;n===this._runningId&&this._status==="Running"&&(this._status="Error",this._errorFunc&&this._errorFunc(s),(o=this._errorEvent)==null||o.emit(s))},runningingID:n},...t)}cancel(t=new tn("")){var n;if(this._status==="Running"){if(!this._cancelFunc)throw new Error("!this._cancelFunc");this._status="Error",this._errorFunc&&this._errorFunc(t),(n=this._errorEvent)==null||n.emit(t),this._cancelFunc(t),this._cancelFunc=void 0}}reset(){this._status==="Running"&&console.error("processing cannot reset while running. you can first cancel it!"),(this._status==="Completed"||this._status==="Error")&&(this._status="Initial")}get status(){return this._status}get isInitial(){return this._status==="Initial"}get isRunning(){return this._status==="Running"}get isCompleted(){return this._status==="Completed"}get isError(){return this._status==="Error"}get runningId(){return this._runningId}restart(t=new tn(""),...n){this.isRunning&&this.cancel(t),this.reset(),this.start(...n)}restartIfNotRunning(...t){this.isRunning||(this.reset(),this.start(...t))}}function Mo(i){return(e,...t)=>{const n=new dc,{completeFunc:s,errorFunc:o}=e,h=i(n,...t).then(s).catch(o).finally(()=>n.destroy());return ws(h,n.cancel.bind(n)),l=>uc(h,l)}}class uw extends Re{constructor(){super(({errorFunc:t},n,s)=>{try{const[o,h]=Wh(n,s);return this._doFunc=o,h}catch(o){return t(o),()=>{}}});p(this,"_doFunc")}do(...t){this._doFunc&&this._doFunc(...t)}}class cw extends Re{constructor(t,n){super(({errorFunc:s})=>{try{const[o,h]=Wh(t,n);return this._doFunc=o,h}catch(o){return s(o),()=>{}}});p(this,"_doFunc")}do(...t){this._doFunc&&this._doFunc(...t)}}function dw(i){return new Re(Mo((e,...t)=>e.promise(i(...t))))}function fw(i,...e){return new Re(Mo(t=>t.promise(i(...e))))}function el(i){return dw((...e)=>{const t=i(...e);return ia(t)?t:na(t)})}function fc(i,...e){return fw(()=>{const t=i(...e);return ia(t)?t:na(t)})}function gw(i){let e;const t=new Promise((n,s)=>{e=()=>{i(),s()}});return ws(t,e),t}function pw(i,...e){const t=new dc,n=i(t,...e).finally(()=>t.destroy());return ws(n,t.cancel.bind(t)),n}function wi(i){return new Re(Mo(i))}function mw(i,...e){return new Re(Mo(t=>i(t,...e)))}function bp(i,...e){const t=new AbortController;let n=t.signal,[s,o]=e;if(o!=null&&o.signal)throw console.error("init?.signal"),new Error("init?.signal");o=o||{},o.signal&&console.warn("revocableFetch error: init.signal would be override!"),o.signal=n;let h=!1;const l=()=>{h=!0,t.abort()};let d=fetch(s,o);return i&&(d=d.then(f=>{if(!f.ok)return f;if(!f.body)throw Error("ReadableStream not yet supported in this browser.");const v=f.headers.get("content-length");v||console.warn("response.headers.get('content-length') is undefined... cannot get contentLength!");const m=v?parseInt(v,10):0;let y=0;return new Response(new ReadableStream({start(w){if(!f.body)throw new Error("!response.body");const S=f.body.getReader();T();function T(){S.read().then(({done:N,value:j})=>{if(N){w.close();return}if(!j)throw new Error("!value");if(!i)throw new Error("!progressFunc");y+=j.byteLength,i(y,m),w.enqueue(j),T()}).catch(N=>{w.error(N)})}}}),{status:f.status,statusText:f.statusText,headers:f.headers})}).catch(f=>{throw h?(f instanceof Error&&f.code!==20&&console.error("error.code !== 20"),console.log("fetching cancelled!"),new tn(`fetching cancelled! error: ${f}`)):(f instanceof Error&&f.code===20&&console.error("error.code === 20"),f)})),ws(d,l),d}function vw(i,...e){return bp(i,...e)}function gc(...i){return bp(void 0,...i)}function yw(){return el(gc)}function _w(...i){return fc(gc,...i)}function pc(i,...e){let t=-1;var n=new Promise((s,o)=>{i.isRunning&&i.cancel(),i.reset();const h=new st;h.dispose(i.completeEvent.disposableOn(l=>{if(s(l),h.isDestroyed()){debugger;console.error(`disposer is destroyed! ${h}`);return}h.destroy()})),h.dispose(i.errorEvent.disposableOn(l=>{if(o(l),h.isDestroyed()){debugger;console.error(`disposer is destroyed! ${h}`);return}h.destroy()})),i.start(...e),t=i.runningId});return[s=>t===i.runningId&&i.isRunning&&i.cancel(s),n]}function wn(i,e,...t){try{return e(...t)}catch(n){i(n)}}function ww(){return new Re(({completeFunc:i,errorFunc:e},t)=>Qr(()=>wn(e,()=>{t&&t(),i()})))}function Ew(i){return new Re(({completeFunc:e,errorFunc:t})=>Qr(()=>wn(t,()=>{i&&i(),e()})))}function Sw(){return new Re(({completeFunc:i,errorFunc:e},t)=>So(()=>{wn(e,()=>{t&&t(),i()})}))}function xw(i){return new Re(({completeFunc:e,errorFunc:t})=>So(()=>{wn(t,()=>{i&&i(),e()})}))}function Pp(){return new Re(({completeFunc:i,errorFunc:e},t,n)=>Ku(()=>{wn(e,()=>{t&&t(),i()})},n??1e3))}function Cp(i,e){return new Re(({completeFunc:t,errorFunc:n})=>Ku(()=>{wn(n,()=>{i&&i(),t()})},e??1e3))}function bw(){return new Re(({errorFunc:i},e,t=1e3)=>Ju(()=>wn(i,e),t))}function Pw(i,e=1e3){return new Re(({errorFunc:t})=>Ju(()=>wn(t,i),e))}function To(){return new Re(({errorFunc:i},e)=>Hh(t=>wn(i,e,t)))}function sa(i){return new Re(({errorFunc:e})=>Hh(t=>wn(e,i,t)))}function ko(i,...e){let t,n;const s=new Promise((h,l)=>{n=l,t=globalThis.setTimeout(()=>{t=void 0,h(e)},i)});return ws(s,h=>{t&&(clearTimeout(t),t=void 0),n&&n(h??new tn("sleep cancel error!"))}),s}function Cw(){return el(ko)}function Iw(i,...e){return fc(ko,i,...e)}function Ks(i,e,...t){return i.promise(cc(pc(wi(async(n,...s)=>(i.disposer.dispose(()=>{n.isDestroyed()||n.cancel()}),await e(n,...s))),...t)))}function Mw(i,e,...t){return i.promise(cc(pc(e,...t)))}class Tw extends Re{constructor(){super(({errorFunc:t},n,s)=>{try{const[o,h]=nc(n,s);return this._doFunc=o,h}catch(o){return t(o),()=>{}}});p(this,"_doFunc")}do(...t){this._doFunc&&this._doFunc(...t)}}class kw extends Re{constructor(t,n){super(({errorFunc:s})=>{try{const[o,h]=nc(t,n);return this._doFunc=o,h}catch(o){return s(o),()=>{}}});p(this,"_doFunc")}do(...t){this._doFunc&&this._doFunc(...t)}}class il extends st{constructor(t=1e3,n=Jh){super();p(this,"_speed");p(this,"_speedChangedEvent");p(this,"_duration");p(this,"_durationChangedEvent");p(this,"_loop");p(this,"startUpdateFunc");p(this,"_updateBindThis");p(this,"_cancelStartUpdateFunc");p(this,"_startTimeStamp");p(this,"_playingChangedEvent");p(this,"_startPlayingEvent");p(this,"_stopPlayingEvent");p(this,"_loopChangedEvent");p(this,"_currentTime",this.disposeVar(it(0)));this._speed=1,this._duration=t,this._loop=!1,this.startUpdateFunc=n,this._updateBindThis=this._update.bind(this),this.dispose(()=>{this._cancelStartUpdateFunc&&(this._cancelStartUpdateFunc(),this._cancelStartUpdateFunc=void 0)}),this._startTimeStamp=Number.NaN,this.dispose(()=>{this._startPlayingEvent&&this._startPlayingEvent.reset(),this._stopPlayingEvent&&this._stopPlayingEvent.reset()})}get startPlayingEvent(){return this._startPlayingEvent=this._startPlayingEvent||new H,this._startPlayingEvent}get stopPlayingEvent(){return this._stopPlayingEvent=this._stopPlayingEvent||new H,this._stopPlayingEvent}get currentTimeChangedEvent(){return this._currentTime.changed}get loopChangedEvent(){return this._loopChangedEvent=this._loopChangedEvent||new H,this._loopChangedEvent}set loop(t){this._loop!==t&&(this._loop=t,this._loopChangedEvent&&this._loopChangedEvent.emit(this._loop))}get loop(){return this._loop}_update(t){if(Number.isNaN(this._startTimeStamp))console.warn("Number.isNaN(this._startTimeStamp)");else{const n=(t-this._startTimeStamp)*this._speed;this._setCurrentTimeInner(n)}}get currentTime(){return this._currentTime.value}set currentTime(t){this._setCurrentTimeInner(t),this._resetStartTime()}_setCurrentTimeInner(t){this._currentTime.value!==t&&(this._duration<=0?this._currentTime.value=0:t<0?this.loop?this._currentTime.value=this._duration+t%this._duration:(this._currentTime.value=0,this.playing&&this._stopPlaying()):t>this._duration?this.loop?this._currentTime.value=t%this._duration:(this._currentTime.value=this._duration,this.playing&&this._stopPlaying()):this._currentTime.value=t)}get durationChangedEvent(){return this._durationChangedEvent||(this._durationChangedEvent=new H),this._durationChangedEvent}get duration(){return this._duration}set duration(t){var n;if(t<0)console.warn("duration sholud greater than 0!");else if(this._duration!==t){const s=this._duration;this._duration=t,this._currentTime.value>this._duration&&(this._currentTime.value=this._duration),(n=this._durationChangedEvent)==null||n.emit(this._duration,s)}}get speedChangedEvent(){return this._speedChangedEvent||(this._speedChangedEvent=new H),this._speedChangedEvent}get speed(){return this._speed}set speed(t){var n;if(this._speed!==t&&t!==0){const s=this._speed;this._speed=t,this._resetStartTime(),(n=this._speedChangedEvent)==null||n.emit(this._speed,s)}}_resetStartTime(){this._startTimeStamp=performance.now()-this._currentTime.value/this._speed}_startPlaying(){var t,n;this._resetStartTime(),this._cancelStartUpdateFunc=this.startUpdateFunc(this._updateBindThis),(t=this._startPlayingEvent)==null||t.emit(this._currentTime.value),(n=this._playingChangedEvent)==null||n.emit(!0)}_stopPlaying(){var t,n;if(!this._cancelStartUpdateFunc)throw new Error("this._cancelStartUpdateFunc is undefined!");this._cancelStartUpdateFunc(),this._cancelStartUpdateFunc=void 0,(t=this._stopPlayingEvent)==null||t.emit(this._currentTime.value),(n=this._playingChangedEvent)==null||n.emit(!1)}get playingChangedEvent(){return this._playingChangedEvent||(this._playingChangedEvent=new H),this._playingChangedEvent}get playing(){return!!this._cancelStartUpdateFunc}set playing(t){!!this._cancelStartUpdateFunc!==t&&(t?this._startPlaying():this._stopPlaying())}}class Oo extends st{constructor(t){super();p(this,"_stop",this.disposeVar(it(0)));p(this,"_current",this.disposeVar(it(0)));p(this,"_start",this.disposeVar(it(0)));p(this,"_player",this.disposeVar(new il(200)));this.dispose(this._player.currentTimeChangedEvent.disposableOn(n=>{let s=n/this._player.duration;s=s>1?1:s<0?0:s;const o=this._start.value,h=this._stop.value;this._current.value=o+(h-o)*s})),this.duration=t}get current(){return this._current.value}get currentChanged(){return this._current.changed}get source(){return this._start.value}get sourceChanged(){return this._start.changed}get target(){return this._stop.value}get targetChanged(){return this._stop.changed}get duration(){return this._player.duration}set duration(t){this._player.duration=t}set target(t){this._start.value=this._current.value,this._stop.value=t,this._player.currentTime=0,this._player.playing=!0}reset(t){this._start.value=t,this._current.value=t,this._stop.value=t,this._player.playing=!1}}let Ip=-1;class ce extends H{constructor(e,t,n,s){super(),this._domElement=e,this._type=t,this.callback=s;const o=h=>(h.__xbsj_listenerNo__=++Ip,h.__xbsj_listenerTime__=Date.now(),h.__xbsj_lastCurrentTarget__=h.currentTarget,this.emit(h),this.callback&&this.callback(h));this._domElement.addEventListener(this._type,o,n),this.dispose(()=>this._domElement.removeEventListener(this._type,o,n))}static getLastLisenNo(){return Ip}static getCurrentTarget(e){return e.__xbsj_lastCurrentTarget__}static getListenerNo(e){return e.__xbsj_listenerNo__}static getListenerTime(e){return e.__xbsj_listenerTime__}static on(e,t){const n=ce.getLastLisenNo();return e.disposableOn(s=>{const o=ce.getListenerNo(s);(o===void 0||o>n)&&t(s)})}get element(){return this._domElement}static create(e,t,n){return new ce(e,t,n)}}class mc extends st{constructor(){super();p(this,"_clickEvent",this.disposeVar(new H));p(this,"_dbclickEvent",this.disposeVar(new H));p(this,"_pointerdownEvent",this.disposeVar(new H));p(this,"_pointerupEvent",this.disposeVar(new H));p(this,"_pointermoveEvent",this.disposeVar(new H));p(this,"_pointeroutEvent",this.disposeVar(new H));p(this,"dbClickDelayTime",300);p(this,"nativeClickDelayTime",500);p(this,"clickMovementTolerantPixelSize",3);p(this,"debugging",!1);p(this,"_enabled",this.disposeVar(it(!0)));const t=this.disposeVar(wi(async s=>{do{const o=await Ks(s,d=>new Promise((f,v)=>{d.disposer.dispose(v),d.disposer.dispose(ce.on(this._pointerdownEvent,f))})),h=$e(o);if(this.debugging&&console.log(`鼠标按下 ${h.toString()}`),!await Ks(s,d=>new Promise((f,v)=>{d.disposer.dispose(v);const m=setTimeout(()=>f(!0),this.nativeClickDelayTime);d.disposer.dispose(()=>clearTimeout(m)),d.disposer.dispose(ce.on(this._pointermoveEvent,y=>{const[w,S]=$e(y),[T,N]=h;(Math.abs(w-T)>3||Math.abs(S-N)>3)&&f(!1)})),d.disposer.dispose(ce.on(this._pointeroutEvent,()=>f(!1))),d.disposer.dispose(ce.on(this._pointerupEvent,()=>f(!0)))}))){this.debugging&&console.log("取消1");continue}const l=await Ks(s,d=>new Promise((f,v)=>{d.disposer.dispose(v);const m=setTimeout(()=>f("timeout"),this.dbClickDelayTime);d.disposer.dispose(()=>clearTimeout(m)),d.disposer.dispose(ce.on(this._pointermoveEvent,y=>{const[w,S]=$e(y),[T,N]=h;(Math.abs(w-T)>3||Math.abs(S-N)>3)&&f("moved")})),d.disposer.dispose(ce.on(this._pointerdownEvent,f)),d.disposer.dispose(ce.on(this._pointeroutEvent,()=>f("pointouted"))),d.disposer.dispose(ce.on(this._pointerupEvent,()=>f("pointuped")))}));if(typeof l=="string"){this.debugging&&console.log(`触发单击事件!取消双击监听!error: ${l}`),this._clickEvent.emit(o);continue}if(!await Ks(s,d=>new Promise((f,v)=>{d.disposer.dispose(v);const m=setTimeout(()=>f(!1),this.nativeClickDelayTime);d.disposer.dispose(()=>clearTimeout(m)),d.disposer.dispose(ce.on(this._pointermoveEvent,y=>{const[w,S]=$e(y),[T,N]=h;(Math.abs(w-T)>3||Math.abs(S-N)>3)&&f(!1)})),d.disposer.dispose(ce.on(this._pointeroutEvent,()=>f(!1))),d.disposer.dispose(ce.on(this._pointerupEvent,()=>f(!0)))}))){this.debugging&&console.log("取消2");continue}this.debugging&&console.log("触发双击事件!"),this._dbclickEvent.emit(l)}while(!0)})),n=s=>{s?t.restart():t.isRunning&&t.cancel()};n(this.enabled),this.dispose(this.enabledChanged.disposableOn(n))}get clickEvent(){return this._clickEvent}get dbclickEvent(){return this._dbclickEvent}pointerDown(t){this._pointerdownEvent.emit(t)}pointerUp(t){this._pointerupEvent.emit(t)}pointerMove(t){this._pointermoveEvent.emit(t)}pointerOut(t){this._pointeroutEvent.emit(t)}get enabled(){return this._enabled.value}set enabled(t){this._enabled.value=t}get enabledChanged(){return this._enabled.changed}}class Ow extends st{constructor(t,n){super();p(this,"_pointerClick",this.disposeVar(new mc));this._div=t;const{div:s,pointerClick:o}=this,h=v=>o.pointerDown(v),l=v=>o.pointerMove(v),d=v=>o.pointerOut(v),f=v=>o.pointerUp(v);s.addEventListener("pointerdown",h,n),s.addEventListener("pointermove",l,n),s.addEventListener("pointerout",d,n),s.addEventListener("pointerup",f,n),this.dispose(()=>{s.removeEventListener("pointerdown",h,n),s.removeEventListener("pointermove",l,n),s.removeEventListener("pointerout",d,n),s.removeEventListener("pointerup",f,n)})}get div(){return this._div}get pointerClick(){return this._pointerClick}get clickEvent(){return this.pointerClick.clickEvent}get dbclickEvent(){return this.pointerClick.dbclickEvent}}class Mp extends st{constructor(){super();p(this,"_hoverEvent",this.disposeVar(new H));p(this,"_hoverOutEvent",this.disposeVar(new H));p(this,"_pointerdownEvent",this.disposeVar(new H));p(this,"_pointerupEvent",this.disposeVar(new H));p(this,"_pointermoveEvent",this.disposeVar(new H));p(this,"_pointeroutEvent",this.disposeVar(new H));p(this,"delayTime",800);const t=this.disposeVar(Pp()),n=f=>{this._hoverOutEvent.emit()},s=f=>{this._hoverOutEvent.emit()};let o;const h=()=>{if(!o){console.warn("!lastPointerEvent");return}this._hoverEvent.emit(o)},l=f=>{o=f,t.restart(void 0,h,this.delayTime),this._hoverOutEvent.emit()},d=f=>{t.cancel(),this._hoverOutEvent.emit()};this.dispose(this._pointerdownEvent.disposableOn(n)),this.dispose(this._pointerupEvent.disposableOn(s)),this.dispose(this._pointermoveEvent.disposableOn(l)),this.dispose(this._pointeroutEvent.disposableOn(d))}get hoverEvent(){return this._hoverEvent}get hoverOutEvent(){return this._hoverOutEvent}pointerDown(t){this._pointerdownEvent.emit(t)}pointerUp(t){this._pointerupEvent.emit(t)}pointerMove(t){this._pointermoveEvent.emit(t)}pointerOut(t){this._pointeroutEvent.emit(t)}}class Nw extends st{constructor(t,n=1500){super();p(this,"_hoverEvent",new H);p(this,"_hoverOutEvent",new H);const s=new ac(n);this.dispose(()=>s.destroy());let o=0,h=0,l;s.progressFunc=()=>this._hoverEvent.emit(o,h,l);const d=y=>{!s.isRunning&&s.restart(),l=y,[o,h]=$e(y),s.debounce(),this._hoverOutEvent.emit()},f=y=>{!s.isRunning&&s.restart(),l=y,[o,h]=$e(l),s.debounce(),this._hoverOutEvent.emit()},v=y=>{!s.isRunning&&s.restart(),l=y,[o,h]=$e(l),s.debounce(),this._hoverOutEvent.emit()},m=y=>{s.isRunning&&s.cancel(),this._hoverOutEvent.emit()};t.addEventListener("pointerdown",d),t.addEventListener("pointerup",f),t.addEventListener("pointermove",v),t.addEventListener("pointerout",m),this.dispose(()=>{t.removeEventListener("pointerdown",d),t.removeEventListener("pointerup",f),t.removeEventListener("pointermove",v),t.removeEventListener("pointerout",m)})}get hoverEvent(){return this._hoverEvent}get hoverOutEvent(){return this._hoverOutEvent}}class Tp extends st{constructor(t,n={}){super();p(this,"_needRedrawEvent");p(this,"_needPickRedrawEvent");p(this,"_id",Zr());p(this,"_clickEvent");p(this,"_clickOutEvent");p(this,"_dbclickEvent");p(this,"_dbclickOutEvent");p(this,"_actived",!1);p(this,"_activedChanged");p(this,"_hovered",!1);p(this,"_hoveredChanged");p(this,"_selected",!1);p(this,"_selectedChanged");p(this,"_opacity",1);p(this,"_opacityChanged");p(this,"_show",!0);p(this,"_showChanged");this._canvasPrimitivesContext=t;const{needRedraw:s=!0,needPickRedraw:o=!0}=n;s&&(this._needRedrawEvent=new H),o&&(this._needPickRedrawEvent=new H),this._canvasPrimitivesContext.addPoi(this),this.dispose(()=>this._canvasPrimitivesContext.removePoi(this)),this.dispose(this.showChanged.disposableOn(()=>{this.needRedraw(),this.needPickRedraw()})),this.dispose(this.opacityChanged.disposableOn(()=>this.needRedraw()))}get id(){return this._id}set id(t){this._id=t}get context(){return this._canvasPrimitivesContext}needRedraw(){this._needRedrawEvent?this._needRedrawEvent.emit():console.warn("no needRedrawEvent!")}needPickRedraw(){this._needPickRedrawEvent?this._needPickRedrawEvent.emit():console.warn("no needPickRedrawEvent!")}hasClickEvent(){return!!this._clickEvent}get clickEvent(){return this._clickEvent=this._clickEvent||new H,this._clickEvent}hasClickOutEvent(){return!!this._clickOutEvent}get clickOutEvent(){return this._clickOutEvent=this._clickOutEvent||new H,this._clickOutEvent}hasDbclickEvent(){return!!this._dbclickEvent}get dbclickEvent(){return this._dbclickEvent=this._dbclickEvent||new H,this._dbclickEvent}hasDbclickOutEvent(){return!!this._dbclickOutEvent}get dbclickOutEvent(){return this._dbclickOutEvent=this._dbclickOutEvent||new H,this._dbclickOutEvent}set actived(t){this._actived!==t&&(this._actived=t,this._activedChanged&&this._activedChanged.emit(t,this))}get actived(){return this._actived}get activedChanged(){return this._activedChanged=this._activedChanged||new H,this._activedChanged}set hovered(t){this._hovered!==t&&(this._hovered=t,this._hoveredChanged&&this._hoveredChanged.emit(t,this))}get hovered(){return this._hovered}get hoveredChanged(){return this._hoveredChanged=this._hoveredChanged||new H,this._hoveredChanged}set selected(t){this._selected!==t&&(this._selected=t,this._selectedChanged&&this._selectedChanged.emit(t,this))}get selected(){return this._selected}get selectedChanged(){return this._selectedChanged=this._selectedChanged||new H,this._selectedChanged}set opacity(t){this._opacity!==t&&(this._opacity=t,this._opacityChanged&&this._opacityChanged.emit(t,this))}get opacity(){return this._opacity}get opacityChanged(){return this._opacityChanged=this._opacityChanged||new H,this._opacityChanged}set show(t){this._show!==t&&(this._show=t,this._showChanged&&this._showChanged.emit(t,this))}get show(){return this._show}get showChanged(){return this._showChanged=this._showChanged||new H,this._showChanged}}class vc extends Tp{constructor(t,n=[0,0],s=0){super(t);p(this,"_winPosAndDepthChanged");this._winPos=n,this._depth=s,this.dispose(this.winPosAndDepthChanged.disposableOn(()=>{this.needRedraw(),this.needPickRedraw()}))}set winPos(t){(this._winPos[0]!==t[0]||this._winPos[1]!==t[1])&&(this._winPos[0]=t[0],this._winPos[1]=t[1],this._winPosAndDepthChanged&&this._winPosAndDepthChanged.emit(this._winPos,this._depth))}get winPos(){return this._winPos}set depth(t){this._depth!==t&&(this._depth=t,this._winPosAndDepthChanged&&this._winPosAndDepthChanged.emit(this._winPos,this._depth))}get depth(){return this._depth}get winPosAndDepthChanged(){return this._winPosAndDepthChanged||(this._winPosAndDepthChanged=new H),this._winPosAndDepthChanged}}function Zs(i,e,t,n){const[s,o]=i,[h,l,d,f]=n,v=e[0]*t[0],m=e[1]*t[1],y=s-(v*h+d),w=o-(m*l+f);return{left:y,top:w,right:y+v,bottom:w+m}}function Qs(i,e,t,n,s){i.beginPath(),i.moveTo(e,t),i.lineTo(e-n*.5,t-n*.5),i.arc(e,t-n,n*.7071067811865475,Math.PI*.75,Math.PI*.25),i.lineTo(e,t),i.fillStyle=s,i.fill()}function Rw(i,e,t,n,s,o){if(i.beginPath(),i.moveTo(e+n,t),i.arc(e,t,n,0,2*Math.PI),o){const h=i.createRadialGradient(e,t,0,e,t,n);h.addColorStop(0,s),h.addColorStop(1,s.replace(/[\d\.]+\)$/,"0)")),i.fillStyle=h}else i.fillStyle=s;i.fill()}function kp(i,e,t,n,s,o){i.beginPath(),i.moveTo(e+o,t),i.lineTo(e+n-o,t),i.arcTo(e+n,t,e+n,t+o,o),i.lineTo(e+n,t+s-o),i.arcTo(e+n,t+s,e+n-o,t+s,o),i.lineTo(e+o,t+s),i.arcTo(e,t+s,e,t+s-o,o),i.lineTo(e,t+o),i.arcTo(e,t,e+o,t,o)}function Op(i,e,t,n,s,o){i.font=s;const h=i.measureText(n),l=h.actualBoundingBoxLeft+h.actualBoundingBoxRight,d=Number.isFinite(h.fontBoundingBoxAscent)?h.fontBoundingBoxAscent:h.actualBoundingBoxAscent,f=Number.isFinite(h.fontBoundingBoxDescent)?h.fontBoundingBoxDescent:h.actualBoundingBoxDescent;let v=d+f;i.fillStyle=o,i.fillText(n,e-l*.5,t+v*.5-f)}function Np(i){const{width:e,height:t}=i,n=e instanceof SVGAnimatedLength?e.baseVal.SVG_LENGTHTYPE_PX:e,s=t instanceof SVGAnimatedLength?t.baseVal.SVG_LENGTHTYPE_PX:t,o=document.createElement("canvas");o.width=n,o.height=s;const h=o.getContext("2d");if(!h)throw new Error("!cavnasCtx");return h.drawImage(i,0,0,n,s),o}function Rp(i,e){const{width:t,height:n}=i,s=i.getContext("2d");if(!s)throw new Error("!cavnasCtx");const[o,h,l]=e.map(m=>m*255|0),d=s.getImageData(0,0,t,n),f=d.data;for(var v=0;v<f.length;v+=4)f[v]=o,f[v+1]=h,f[v+2]=l;s.putImageData(d,0,0)}function yc(i,e,t,n=[.5,1,0,0],s,o="12px Arial",h=2,l="#FFF",d="#000A"){i.font=o;const f=i.measureText(s),v=f.actualBoundingBoxLeft+f.actualBoundingBoxRight,m=f.fontBoundingBoxAscent+f.fontBoundingBoxDescent,y=e,w=t,S=v+h*2,T=m+h*2,{left:N,top:j,bottom:C}=Zs([y,w],[S,T],[1,1],n);i.fillStyle=d,kp(i,N,j,S,T,h),i.fill(),i.fillStyle=l,i.fillText(s,N+h,C-h-f.fontBoundingBoxDescent)}function No(i){return("00"+i.toString(16).toUpperCase()).substr(-2)}function Ro(i){const[e,t,n,s]=i.map(o=>o*255|0);return`#${No(e)}${No(t)}${No(n)}${No(s)}`}function _c(i,e){const[t,n,s]=e,o=`${t}-${n}-${s}`;let h=_i(i,o);return h||(h=Np(i),Rp(h,e),yn(i,o,h)),h}class Aw extends vc{constructor(t,n,s=[32,32],o=[.5,1,0,0],h="#F00F"){super(t);p(this,"_tooltip","");p(this,"_title","");p(this,"__scale",[1,1]);p(this,"_tooltipAlpha",0);p(this,"_bgColor",[.3,.3,.3,.8]);p(this,"_bgColorHexStr",Ro(this._bgColor));p(this,"_fgColor",[1,1,1,1]);p(this,"_fgColorHexStr",Ro(this._fgColor));this._image=n,this._size=s,this._originRatioAndOffset=o,this._defaultColorStr=h;const l=new Oo(100),d=new Oo(100);this.dispose(()=>{l.destroy(),d.destroy()});const f=()=>{if(this._clickEvent&&!this._clickEvent.empty){const v=(1+.08*d.current)*(1+.08*l.current);this._scale=[v,v],this._tooltipAlpha=l.current}};this.dispose(this.activedChanged.disposableOn(v=>{d.target=v?1:0,this.needRedraw()})),this.dispose(this.hoveredChanged.disposableOn(v=>{l.target=v?1:0,this.needRedraw()})),this.dispose(this.selectedChanged.disposableOn(()=>{this.needRedraw()})),this.dispose(d.currentChanged.disposableOn(f)),this.dispose(l.currentChanged.disposableOn(f))}set size(t){const[n,s]=t,[o,h]=this._size;(o!==n||h!==s)&&(this._size[0]=n,this._size[1]=s,this.needRedraw(),this.needPickRedraw())}get size(){return this._size}set _scale(t){const[n,s]=t,[o,h]=this.__scale;(o!==n||h!==s)&&(this.__scale[0]=n,this.__scale[1]=s,this.needRedraw(),this.needPickRedraw())}get _scale(){return this.__scale}set fgColor(t){if(!this._fgColor.every((n,s)=>t[s]===n)){const[n,s,o,h]=t;this._fgColor.splice(0,4,n,s,o,h),this._fgColorHexStr=Ro(this._fgColor),this.needRedraw()}}get fgColor(){return this._fgColor}set bgColor(t){if(!this._bgColor.every((n,s)=>t[s]===n)){const[n,s,o,h]=t;this._bgColor.splice(0,4,n,s,o,h),this._bgColorHexStr=Ro(this._bgColor),this.needRedraw()}}get bgColor(){return this._bgColor}set originRatioAndOffset(t){const[n,s,o,h]=this._originRatioAndOffset,[l,d,f,v]=t;(n!==l||s!==d||o!==f||h!==v)&&(this._originRatioAndOffset.splice(0,4,l,d,f,v),this.needRedraw(),this.needPickRedraw())}get originRatioAndOffset(){return this._originRatioAndOffset}set image(t){this._image!==t&&(this._image=t,this.needRedraw())}get image(){return this._image}set defaultColorStr(t){this._defaultColorStr!==t&&(this._defaultColorStr=t,this.needRedraw())}get defaultColorStr(){return this._defaultColorStr}set tooltip(t){this._tooltip!==t&&(this._tooltip=t,this.needRedraw())}get tooltip(){return this._tooltip}set title(t){this._title!==t&&(this._title=t,this.needRedraw())}get title(){return this._title}draw(t){if(!this._show)return;const[n,s]=this._winPos,o=this._size[0]*this.__scale[0],h=this._size[1]*this.__scale[1],{left:l,top:d}=Zs([n,s],this._size,this.__scale,this._originRatioAndOffset),f=t.globalAlpha;if(t.globalAlpha=this.opacity,this._image){if(this.selected){const v=_c(this._image,[1,0,0]),{left:m,top:y}=Zs([n,s+3],[o+6,h+6],[1,1],this._originRatioAndOffset);t.drawImage(v,m,y,o+6,h+6)}if(this.actived){const[v,m,y,w]=this._fgColor,S=_c(this._image,[v,m,y]),{left:T,top:N}=Zs([n,s+4],[o+8,h+8],[1,1],this._originRatioAndOffset);t.drawImage(S,T,N,o+8,h+8)}if(this.hovered){const[v,m,y,w]=this._bgColor,S=_c(this._image,[v,m,y]),{left:T,top:N}=Zs([n,s+2],[o+4,h+4],[1,1],this._originRatioAndOffset);t.drawImage(S,T,N,o+4,h+4)}t.drawImage(this._image,l,d,o,h)}else t.fillStyle=this._fgColorHexStr,t.fillRect(l,d,o,h);if(this._title!==""&&yc(t,n+20,s-16,[0,.5,0,0],this._title,"14px Arial",4,this._fgColorHexStr,this._bgColorHexStr),t.globalAlpha=f,this._hovered&&this._tooltip!==""){const v=t.globalAlpha;t.globalAlpha=this._tooltipAlpha,yc(t,n,s-42,[.5,1,0,0],this._tooltip,"12px Arial",4,this._fgColorHexStr,this._bgColorHexStr),t.globalAlpha=v}}drawForPick(t,n){if(!this._show)return;const[s,o]=this._winPos,h=n("default"),l=this._size[0]*this.__scale[0],d=this._size[1]*this.__scale[1],{left:f,top:v}=Zs([s,o],this._size,this.__scale,this._originRatioAndOffset);t.fillStyle=h,t.fillRect(f,v,l,d)}}class Dw extends vc{constructor(t){super(t);p(this,"_width",16);p(this,"_text","");p(this,"_fillStyle","#0F0");p(this,"_scale",1);p(this,"_scaleChanged");this.dispose(this.scaleChanged.disposableOn(h=>{this.needRedraw(),this.needPickRedraw()}));const n=this.disposeVar(new Oo(100)),s=this.disposeVar(new Oo(100)),o=()=>{this._clickEvent&&!this._clickEvent.empty&&(this.scale=(1+.1*s.current)*(1+.2*n.current))};this.dispose(s.currentChanged.disposableOn(o)),this.dispose(n.currentChanged.disposableOn(o)),this.dispose(this.activedChanged.disposableOn(h=>{s.target=h?1:0,this.needRedraw()})),this.dispose(this.hoveredChanged.disposableOn(h=>{n.target=h?1:0,this.needRedraw()})),this.dispose(this.selectedChanged.disposableOn(h=>{this.needRedraw()}))}set scale(t){this._scale!==t&&(this._scale=t,this._scaleChanged&&this._scaleChanged.emit(t,this))}get scale(){return this._scale}get scaleChanged(){return this._scaleChanged||(this._scaleChanged=new H),this._scaleChanged}set width(t){this._width!==t&&(this._width=t,this.needRedraw(),this.needPickRedraw())}get width(){return this._width}set text(t){this._text!==t&&(this._text=t,this.needRedraw())}get text(){return this._text}set fillStyle(t){this._fillStyle!==t&&(this._fillStyle=t,this.needRedraw())}get fillStyle(){return this._fillStyle}draw(t){if(!this._show)return;const[n,s]=this._winPos,o=t.globalAlpha;t.globalAlpha=this.opacity;const h=this._width*this._scale;this.selected&&Qs(t,n,s+3,h+3,"#F00"),this.actived&&this._clickEvent&&!this._clickEvent.empty&&Qs(t,n,s+5,h+5,"#FFF"),this.hovered?Qs(t,n,s+3,h+3,"#000A"):Qs(t,n,s+1,h+1,"#000A"),Qs(t,n,s,h,this._fillStyle);const l=this._scale>1.2?"bold 14px Arial":"bold 10px Arial";Op(t,n,s-h,this._text,l,"#000"),t.globalAlpha=o}drawForPick(t,n){if(!this._show)return;const[s,o]=this._winPos,h=this._width*this._scale,l=n("default");Qs(t,s,o,h,l)}}const Ap=new ArrayBuffer(4),Dp=new Uint32Array(Ap),tr=new Uint8Array(Ap);function Lp(i){if(i>=16777215)throw new Error("uint32 > 0xFFFFFF");return Dp[0]=i,[tr[0],tr[1],tr[2]]}function Fp(i,e,t){return tr[0]=i,tr[1]=e,tr[2]=t,tr[3]=0,Dp[0]}class Gp extends st{constructor(){super(...arguments);p(this,"_pickColors",new Array(16777215));p(this,"_pickColorIndex",0)}reset(){for(let t=0;t<this._pickColorIndex;++t){const n=this._pickColors[t];if(!n)throw console.error("this._pickColors[i] should not be undefined!"),new Error("this._pickColors[i] should not be undefined!");n.poi=null,n.tag=""}this._pickColorIndex=0}createPickColor(t,n){const s=this._pickColorIndex;++this._pickColorIndex;const o=this._pickColors[s];o?(o.poi=t,o.tag=n):this._pickColors[s]={poi:t,tag:n};const[h,l,d]=Lp(s);return[h,l,d]}getPickInfoFromColor(t,n,s){const o=Fp(t,n,s);if(o>=this._pickColorIndex){console.error("index >= this._pickColorIndex");return}const h=this._pickColors[o];if(!h){console.error("!this._pickColors[index]");return}return h}destroyImp(){this.reset()}}const jp=(i,e)=>e.depth-i.depth;class Lw extends st{constructor(){super();p(this,"_pois",[]);p(this,"_canvasElement");p(this,"_ctx");p(this,"_offscreenCanvasElement");p(this,"_offscreenCanvasElement2");p(this,"_offscreenCtx");p(this,"_offscreenCtx2");p(this,"_size",[0,0]);p(this,"_needRedraw",!1);p(this,"_needPickRedraw",!1);p(this,"_pickColorManager",new Gp);const t=document.createElement("canvas");t.style.width="100%",t.style.height="100%",this._canvasElement=t;const n=t.getContext("2d");if(n===null)throw new Error("cannot get context 2d!");this._ctx=n,this._offscreenCanvasElement=document.createElement("canvas"),this._offscreenCtx=this._offscreenCanvasElement.getContext("2d"),this._offscreenCtx.imageSmoothingEnabled=!1,this._offscreenCanvasElement2=document.createElement("canvas"),this._offscreenCtx2=this._offscreenCanvasElement2.getContext("2d"),this._offscreenCtx2.imageSmoothingEnabled=!1,this.disposeVar(sa(()=>{const[o,h]=this._size,{clientWidth:l,clientHeight:d}=this._canvasElement;(o!==l||h!==d)&&(this._size[0]=l,this._size[1]=d,this._canvasElement.width=l,this._canvasElement.height=d,this._offscreenCanvasElement.width=l,this._offscreenCanvasElement.height=d,this._offscreenCanvasElement2.width=l,this._offscreenCanvasElement2.height=d,this._dirty()),this._needRedraw&&(this._needRedraw=!1,this._draw())})).start()}get element(){return this._canvasElement}get pois(){return this._pois}_dirty(){this._needRedraw=!0,this._needPickRedraw=!0}get size(){return this._size}addPoi(t){if(typeof _i(t,"listenHandler")<"u"){console.error("可能有poi重复加载poiManager中!");return}if(this._pois.indexOf(t)!==-1){console.error("同一个poi加了多次!");return}this._pois.push(t),this._dirty();const n=t._needRedrawEvent;if(n){const o=n.on(()=>{this._needRedraw=!0});yn(t,"needRedrawEventHandler",o)}const s=t._needPickRedrawEvent;if(s){const o=s.on(()=>{this._needPickRedraw=!0});yn(t,"needPickRedrawEventHandler",o)}}removePoi(t){const n=this._pois.indexOf(t);if(n===-1){console.error("删除一个不存在的poi!");return}this._pois.splice(n,1),this._dirty();const s=t._needRedrawEvent;if(s){const h=_i(t,"needRedrawEventHandler");h?s.off(h):console.error("poi没有listenHandler!")}const o=t._needPickRedrawEvent;if(o){const h=_i(t,"needPickRedrawEventHandler");h?o.off(h):console.error("poi没有listenHandler!")}}_draw(){this._pois.sort(jp);const[t,n]=this._size;this._ctx.clearRect(0,0,t,n),this._pois.forEach(s=>s.draw(this._ctx))}pick(t,n,s,o){return this._needPickRedraw&&(this._needPickRedraw=!1,this._pickDraw()),this._getPickInfo(t,n,s,o)}_pickDraw(){this._pickColorManager.reset(),this._pois.sort(jp);const[t,n]=this._size;this._offscreenCtx.clearRect(0,0,t,n),this._pois.forEach(s=>{const o=h=>{const[l,d,f]=this._pickColorManager.createPickColor(s,h);return`rgb(${l}, ${d}, ${f})`};s.drawForPick(this._offscreenCtx,o)})}_getPickInfo(t,n,s,o){const h=this._offscreenCtx.getImageData(t,n,s,o),l=[],d=h.data.length/4;for(let f=0;f<d;++f){const v=h.data[f*4+0],m=h.data[f*4+1],y=h.data[f*4+2];if(h.data[f*4+3]===255){const S=this._pickColorManager.getPickInfoFromColor(v,m,y);if(S&&S.poi&&!l.includes(S)){let T=!0;{const[N,j]=this._size;this._offscreenCtx2.clearRect(0,0,N,j);const C=V=>"rgb(255, 255, 255)";S.poi.drawForPick(this._offscreenCtx2,C);const k=this._offscreenCtx2.getImageData(t,n,s,o),M=k.data[f*4+0],D=k.data[f*4+1],L=k.data[f*4+2];k.data[f*4+3],M===255&&D===255&&L===255||(T=!1)}T&&l.push(S)}}}return l}}class wc extends st{constructor(){super(...arguments);p(this,"_closeEvent");p(this,"_show",!0);p(this,"_showChanged");p(this,"_opacity",1);p(this,"_opacityChanged");p(this,"_winPos",[0,0]);p(this,"_winPosChanged")}set winPos(t){const[n,s]=t,[o,h]=this._winPos;(n!==o||s!==h)&&(this._winPos[0]=n,this._winPos[1]=s,this._winPosChanged&&this._winPosChanged.emit(this._winPos))}get winPos(){return this._winPos}get winPosChanged(){return this._winPosChanged=this._winPosChanged||new H,this._winPosChanged}set opacity(t){this._opacity!==t&&(this._opacity=t,this._opacityChanged&&this._opacityChanged.emit(this._opacity))}get opacity(){return this._opacity}get opacityChanged(){return this._opacityChanged=this._opacityChanged||new H,this._opacityChanged}set show(t){this._show!==t&&(this._show=t,this._showChanged&&this._showChanged.emit(this._show))}get show(){return this._show}get showChanged(){return this._showChanged=this._showChanged||new H,this._showChanged}get closeEvent(){return this._closeEvent||(this._closeEvent=new H),this._closeEvent}}const Ec=new WeakMap;function Sc(i){if(!Ec.has(i)){const e=new Vh(()=>new i,t=>t.reset());Ec.set(i,e)}return Ec.get(i)}class xc extends wc{constructor(){super();p(this,"_div");p(this,"_contentDiv");p(this,"_originOffsetX",0);p(this,"_originOffsetY",0);p(this,"_originRatioX",.5);p(this,"_originRatioY",1);p(this,"_divChanged",new H);const t=document.createElement("div");t.style.cssText="width: 0px; height: 0px; position: absolute; opacity: 1.0; visibility: visible;";const n=document.createElement("div");n.style.cssText=`position: absolute; left: ${-this._originOffsetX}px; top: ${-this._originOffsetY}px; transform: translateX(-${100*this._originRatioX}%) translateY(-${100*this._originRatioY}%); margin: 0; padding: 0; pointer-events: none;`;const s=document.createElement("div");this._contentDiv=s,n.appendChild(s),t.appendChild(n),this._div=t,this.dispose(this._divChanged.disposableOn(()=>{n.style.left=`${-this._originOffsetX}px`,n.style.top=`${-this._originOffsetY}px`,n.style.transform=`translateX(-${100*this._originRatioX}%) translateY(-${100*this._originRatioY}%)`})),this.dispose(this.winPosChanged.disposableOn(([o,h])=>{this._div.style.left=`${o}px`,this._div.style.top=`${h}px`})),this.dispose(this.opacityChanged.disposableOn(o=>{this._div.style.opacity=`${o}`})),this.dispose(this.showChanged.disposableOn(o=>{this._div.style.visibility=o?"visible":"hidden"}))}get contentDiv(){return this._contentDiv}reset(){}get originOffsetX(){return this._originOffsetX}set originOffsetX(t){this._originOffsetX!==t&&(this._originOffsetX=t,this._divChanged.emit())}get originOffsetY(){return this._originOffsetY}set originOffsetY(t){this._originOffsetY!==t&&(this._originOffsetY=t,this._divChanged.emit())}get originRatioX(){return this._originRatioX}set originRatioX(t){this._originRatioX!==t&&(this._originRatioX=t,this._divChanged.emit())}get originRatioY(){return this._originRatioY}set originRatioY(t){this._originRatioY!==t&&(this._originRatioY=t,this._divChanged.emit())}get element(){return this._div}}class Bp extends st{constructor(t,n){super();p(this,"_floatDiv");p(this,"_show",!1);p(this,"_showChanged");this._customDivClass=t,this._divContainer=n,this.dispose(()=>{this.show=!1})}_updateDivPoi(){if(this._show){const{floatDiv:n}=this;n.element.parentElement||this._divContainer.appendChild(n.element)}else{const{_floatDiv:n}=this;n&&n.element.parentElement&&this._divContainer.removeChild(n.element)}}set show(t){this._show!==t&&(this._show=t,this._updateDivPoi(),this._showChanged&&this._showChanged.emit(t))}get show(){return this._show}get floatDiv(){if(!this._floatDiv){const t=Sc(this._customDivClass).create();this.dispose(()=>{Sc(this._customDivClass).destroy(t)}),this._floatDiv=t}return this._floatDiv}get showChanged(){return this._showChanged||(this._showChanged=new H),this._showChanged}}const Fw=["top","bottom","left","right"];function Gw(i){return Object.entries(i).map(([e,t])=>Fw.includes(e)?`${e}: ${t}px; `:"").join("")}function zp(i,e,t){const n=document.createElement("div");n.style.cssText=`position: absolute; ${Gw(t)} background-color: ${i}; border-radius: ${e}px;`;const s='<svg viewBox="0 0 1024 1024" style="display: block;" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2420" xmlns:xlink="http://www.w3.org/1999/xlink" width="32" height="32"><defs><style type="text/css"></style></defs><path d="M512 128C300.8 128 128 300.8 128 512s172.8 384 384 384 384-172.8 384-384S723.2 128 512 128zM512 832c-179.2 0-320-140.8-320-320s140.8-320 320-320 320 140.8 320 320S691.2 832 512 832z" p-id="2421" fill="#ffffff"></path><path d="M672 352c-12.8-12.8-32-12.8-44.8 0L512 467.2 396.8 352C384 339.2 364.8 339.2 352 352S339.2 384 352 396.8L467.2 512 352 627.2c-12.8 12.8-12.8 32 0 44.8s32 12.8 44.8 0L512 556.8l115.2 115.2c12.8 12.8 32 12.8 44.8 0s12.8-32 0-44.8L556.8 512l115.2-115.2C684.8 384 684.8 364.8 672 352z" p-id="2422" fill="#ffffff"></path></svg>';return n.innerHTML=s,n}function Up(i,e,t="rgba(0,0,0,0.7)"){const n=document.createElement("div");n.style.cssText=`margin: 0 auto; width: ${i}px; height: ${e}px; position: relative; pointer-events: none;`;const s=document.createElement("div");return s.style.cssText=`position: absolute; left: 0px; top: 0px; width: 0; height: 0; border-left: ${i*.5}px solid transparent; border-right: ${i*.5}px solid transparent; border-top: ${e}px solid ${t};`,n.appendChild(s),[n,s]}class Vp extends xc{constructor(){super();p(this,"_borderDiv");p(this,"_closeDiv");p(this,"_innerContentDiv");p(this,"_colorStr","rgba(0, 0, 0, 0.7)");p(this,"_divColorChanged",new H);p(this,"_borderRadius",10);const t=document.createElement("div");t.style.cssText=`position: relative; background-color: ${this._colorStr}; border-radius: ${this._borderRadius}px; padding: 5px; pointer-events: all;`,this._borderDiv=t;const n=zp(this._colorStr,10,{top:3,right:3}),[s,o]=Up(2*this._borderRadius,2*this._borderRadius,this._colorStr),h=document.createElement("div");this._innerContentDiv=h,t.appendChild(h),t.appendChild(n),this.contentDiv.appendChild(t),this.contentDiv.appendChild(s),n.style.opacity="0.1",n.onmouseenter=()=>{n.style.opacity="1.0"},n.onmouseleave=()=>{n.style.opacity="0.1"},n.onclick=()=>{this._closeEvent&&this._closeEvent.emit()},this._closeDiv=n,this.dispose(this._divColorChanged.disposableOn(()=>{o.style.borderTopColor=this._colorStr,t.style.backgroundColor=this._colorStr,s.style.width=`${this._borderRadius*2}px`,s.style.height=`${this._borderRadius*2}px`,o.style.borderLeft=`${this._borderRadius}px`,o.style.borderRight=`${this._borderRadius}px`,o.style.borderTop=`${this._borderRadius*2}px`}));const l=d=>{d.key==="Escape"&&this._closeEvent&&this._closeEvent.emit()};document.body.addEventListener("keydown",l,!0),this.dispose(()=>{document.removeEventListener("keydown",l,!0)})}get borderDiv(){return this._borderDiv}get innerContentDiv(){return this._innerContentDiv}reset(){this.show=!1,this.opacity=0,this._closeDiv.style.opacity="0.1",super.reset()}get colorStr(){return this._colorStr}set colorStr(t){this._colorStr!==t&&(this._colorStr=t,this._divColorChanged.emit())}get borderRadius(){return this._borderRadius}set borderRadius(t){this._borderRadius!==t&&(this._borderRadius=t,this._divColorChanged.emit())}}class jw extends Vp{constructor(){super();p(this,"_iframe");p(this,"_iframeMessageEvent");const t=document.createElement("iframe");t.style.cssText="width: 100%; height: 100%; border-width: 0px; border-radius: 5px; display: block;",t.src="http://www.weather.com.cn/live/index.shtml",this._iframe=t,this.innerContentDiv.appendChild(t);const n=s=>{s.source===this._iframe.contentWindow&&(this._iframeMessageEvent?this._iframeMessageEvent.emit(s):console.warn(`iframe消息接收到未处理!data: ${s.data}`))};window.addEventListener("message",n),this.dispose(()=>{window.removeEventListener("message",n)})}reset(){super.reset(),this.src=""}set src(t){this._iframe.src!==t&&(this._iframe.src=t)}get src(){return this._iframe.src}get iframe(){return this._iframe}get iframeMessageEvent(){return this._iframeMessageEvent=this._iframeMessageEvent||new H,this._iframeMessageEvent}}class Bw extends wc{constructor(){super();p(this,"_div");p(this,"_contentContainer");p(this,"_text","");const t=document.createElement("div");this._div=t,t.style.cssText="width: 0px; height: 0px; position: absolute; opacity: 1.0; visibility: visible; transition: opacity 0.5s;";const n=document.createElement("div");n.style.cssText="position: absolute; left: 0px; bottom: 0px; transform: translateX(-50%); margin: 0; padding: 0; pointer-events: none;";const s=document.createElement("div");s.style.cssText="position: relative; background-color: rgba(0, 0, 0, 0.7); border-radius: 5px; padding: 3px; pointer-events: all; color: white; white-space: nowrap;",s.innerText=this._text,this._div.appendChild(n),n.appendChild(s),this._contentContainer=s,this._div=t,this.dispose(this.winPosChanged.disposableOn(([o,h])=>{this._div.style.left=`${o}px`,this._div.style.top=`${h-50}px`})),this.dispose(this.opacityChanged.disposableOn(o=>{this._div.style.opacity=`${o}`})),this.dispose(this.showChanged.disposableOn(o=>{this._div.style.visibility=o?"visible":"hidden"}))}get element(){return this._div}reset(){this.opacity=1,this.show=!0}set text(t){this._text!==t&&(this._text=t,this._contentContainer.innerText=t)}get text(){return this._text}}class zw extends xc{constructor(){super(),this.contentDiv.style.backgroundColor="rgba(0, 0, 0, 0.8)",this.contentDiv.style.borderRadius="3px",this.contentDiv.style.color="rgb(255, 255, 255)",this.contentDiv.style.padding="1px 5px 1px 5px",this.contentDiv.style.fontSize="12px",this.contentDiv.style.whiteSpace="nowrap",this.contentDiv.innerText="未定义光标信息!",this.originRatioX=0,this.originRatioY=0,this.originOffsetX=-16}}class Uw extends st{constructor(t,n){super();p(this,"_cursorDiv");p(this,"_pointerOut",this.disposeVar(it(!1)));p(this,"_show",this.disposeVar(it(!0)));this._cursorDiv=new Bp(n,t),this.dispose(()=>this._cursorDiv.destroy());const s=h=>{const[l,d]=$e(h);this._cursorDiv.floatDiv.winPos=[l,d]};t.addEventListener("pointermove",s),this.dispose(()=>t.removeEventListener("pointermove",s));const o=()=>{this._cursorDiv.show=this.show&&this._pointerOut.value};o(),this.dispose(this.showChanged.disposableOn(o)),this.dispose(this._pointerOut.changed.disposableOn(o))}set show(t){this._show.value=t}get show(){return this._show.value}get showChanged(){return this._show.changed}reset(){this._pointerOut.value=!1}get cursorDiv(){return this._cursorDiv}set text(t){this._cursorDiv.floatDiv.contentDiv.innerText=t}get text(){return this._cursorDiv.floatDiv.contentDiv.innerText}}function Ao(i,e,t){if(!(i.tree===e.tree&&i!==e&&!i.isAncestorOf(e))||i.tree!==e.tree||!i.parent)return!1;if(!i.parent.children)throw console.error("当前节点的父节点没有子节点?这是不可能的!"),new Error("当前节点的父节点没有子节点?这是不可能的!");return!(e===i||i.isAncestorOf(e)||t!=="inner"&&!e.parent||t==="inner"&&!e.children)}function nl(i,e,t){if(!i.tree||!e.tree||i.tree!==e.tree)return;if(!i.parent){console.warn("当前节点没有父节点,那么该节点无法被移动!");return}if(!i.parent.children)throw console.error("当前节点的父节点没有子节点?这是不可能的!"),new Error("当前节点的父节点没有子节点?这是不可能的!");if(e===i){console.warn("自身不能拖放到自身!");return}if(i.isAncestorOf(e)){console.warn("当前节点不能拖放到它自身的后代节点之上!");return}if(t!=="inner"&&!e.parent){console.warn("目标节点没有父节点,无法拖放!");return}if(t==="inner"&&!e.children){console.warn("无法移动到目标节点的子节点中,因为目标节点不是组节点!");return}i.tree._startTransaction();const n=i.parent.children.indexOf(i);if(i.parent.children.splice(n,1),t!=="inner"){const{parent:s}=e;if(!s||!s.children)throw new Error("!parent");const o=s.children.indexOf(e);t==="before"?s.children.splice(o,0,i):t==="after"&&s.children.splice(o+1,0,i)}else e.children.push(i);i.tree._stopTransaction()}function qp(i,e,t){return tc(i,n=>Ao(n,e,t))}function $p(i,e,t){for(let n of i)Ao(n,e,t)?nl(n,e,t):console.warn(`treeItem(id: ${n.id}) cannot move...`)}const Vw={checked:1,unchecked:2,indeterminate:3},qw=["checked","unchecked","indeterminate"];class Wp extends st{constructor(t){super();p(this,"_collapsed",this.disposeVar(it(!1)));p(this,"_checkedStatus",this.disposeVar(it("unchecked")));p(this,"_selected",this.disposeVar(it(!1)));p(this,"_moveToPositionMode",this.disposeVar(it("none")));p(this,"_updateCheckedStatusFromChildrenEvent",this.disposeVar(new H));this._treeItem=t;const n=()=>this._treeItem.tree&&this._treeItem.tree.itemsChanged.emit([this._treeItem]);this.dispose(this._collapsed.changed.disposableOn(n)),this.dispose(this._checkedStatus.changed.disposableOn(n)),this.dispose(this._selected.changed.disposableOn(n)),this.dispose(this._moveToPositionMode.changed.disposableOn(n)),this.dispose(this._checkedStatus.changed.disposableOn(()=>this._treeItem.parent&&this._treeItem.parent.uiTreeObject.updateCheckedStatusFromChildren())),this.dispose(this._treeItem.childrenChangedEvent.disposableOn(()=>{this.updateCheckedStatusFromChildren()}));const s=this.disposeVar(we(this._updateCheckedStatusFromChildrenEvent));this.dispose(s.disposableOn(()=>{if(!this._treeItem.children)return;let o=0;Qu(this._treeItem.children,h=>(o|=Vw[h.uiTreeObject.checkedStatus],o===3)),o>0&&(this._checkedStatus.value=qw[o-1])})),this.dispose(this._treeItem.childrenResetedEvent.disposableOn(o=>{!o&&this.checkedStatus==="indeterminate"&&(this._checkedStatus.value="unchecked")}));{const o=(h,l,d=!0)=>{if(l)h.selectedItems.push(this._treeItem);else{const f=h.selectedItems.indexOf(this._treeItem);f===-1?d&&console.error("selectedItems index -1"):h.selectedItems.splice(f,1)}};this.dispose(this._selected.changed.disposableOn(h=>{const{tree:l}=this._treeItem;l&&o(l,h)})),this.dispose(()=>this.selected=!1)}}get treeItem(){return this._treeItem}get collapsed(){return this._collapsed.value}set collapsed(t){this._collapsed.value=t}get collapsedChanged(){return this._collapsed.changed}get checkedStatus(){return this._checkedStatus.value}check(t){const n=t?"checked":"unchecked";if(this._checkedStatus.value!==n&&(this._checkedStatus.value=n,this._treeItem.children))for(let s of this._treeItem.children)s.uiTreeObject.check(t)}updateCheckedStatusFromChildren(){this._updateCheckedStatusFromChildrenEvent.emit()}get checkedStatusChanged(){return this._checkedStatus.changed}get selected(){return this._selected.value}set selected(t){this._selected.value=t}get selectedChanged(){return this._selected.changed}get moveToPositionMode(){return this._moveToPositionMode.value}set moveToPositionMode(t){this._moveToPositionMode.value=t}get moveToPositionModeChanged(){return this._moveToPositionMode.changed}}const hn=class hn extends st{constructor(t,n=!1,s){super();p(this,"_children");p(this,"_childrenResetedEvent");p(this,"_childrenToChangeEvent");p(this,"_childrenChangedEvent");p(this,"_parent",this.disposeVar(it(void 0)));p(this,"_level",this.disposeVar(it(0)));p(this,"_id");p(this,"_uiTreeObject",this.disposeVar(new Wp(this)));this._tree=t,this._hasChildren=n,this._id=s??Zr(),this._id!=="_ROOT"&&hn.wm.has(this._id)&&console.warn(`创建了id(${this._id})相同的树节点,会导致之前的树节点无法索引!`),hn.wm.set(this._id,this),this.dispose(()=>{if(this._id!=="_ROOT"&&!hn.wm.has(this._id)){console.warn(`树节点(${this._id})不在wm树上!`);return}hn.wm.delete(this._id)}),this.dispose(this._parent.changed.disposableOn(()=>{this._updateLevel()})),this.dispose(this._level.changed.disposableOn(()=>{if(this.children)for(let o of this.children)o._updateLevel()})),hn.allTreeItems.set(this._id,this),this.dispose(()=>{hn.allTreeItems.delete(this._id)})}static getFromId(t){return hn.wm.get(t)}get uiTreeObject(){return this._uiTreeObject}get id(){return this._id}_updateLevel(){this.parent&&(this._level.value=this.parent.level+1)}get parent(){return this._parent.value}get parentChanged(){return this._parent.changed}get children(){if(this._hasChildren){if(!this._children){const t=this.disposeVar(new Io);this._children=t,this.dispose(t.toChangeEvent.disposableOn((o,h)=>{for(let l of o){const{start:d,deleteCount:f,items:v}=l;for(let m=d;m<d+f;++m)h.get(m)._parent.value=void 0;for(let m of v){if(m.parent)throw console.error("请检查新增的treeItem是否正在使用!"),new Error("item.parent should not exist!");m._parent.value=this}}}));const n=new Set,s=new Set;this.dispose(t.toChangeEvent.disposableOn((o,h)=>{var l;if(this.tree){n.clear(),s.clear();for(let d of o){const{start:f,deleteCount:v,items:m}=d;for(let y=f;y<f+v;++y)n.add(h.get(y));for(let y of m)s.add(y)}for(let d of n)s.has(d)&&(n.delete(d),s.delete(d));(l=this.tree)==null||l.itemChildrenToChange.emit(this,o,n,s)}})),this.dispose(t.changedEvent.disposableOn(()=>{var o;(o=this.tree)==null||o.itemChildrenChanged.emit(this)})),this.dispose(t.toChangeEvent.disposableOn((...o)=>this._childrenToChangeEvent&&this._childrenToChangeEvent.emit(...o))),this.dispose(t.changedEvent.disposableOn((...o)=>this._childrenChangedEvent&&this._childrenChangedEvent.emit(...o)))}return this._children}else return}get childrenResetedEvent(){return this._childrenResetedEvent||(this._childrenResetedEvent=new H),this._childrenResetedEvent}get childrenToChangeEvent(){return this._childrenToChangeEvent||(this._childrenToChangeEvent=new H),this._childrenToChangeEvent}get childrenChangedEvent(){return this._childrenChangedEvent||(this._childrenChangedEvent=new H),this._childrenChangedEvent}resetChildren(t=!1){this._children&&(this._children.length=0),this._hasChildren=t,this._childrenResetedEvent&&this._childrenResetedEvent.emit(t)}*getDescendants(t){const n=this,s=[],o=[];for(n.children&&n.children.length>0&&(!t||t(n))&&(s.push(0),o.push(n.children));s.length>0;){const h=s[s.length-1],l=o[o.length-1],d=l.get(h);yield d,h<l.length-1?++s[s.length-1]:(o.pop(),s.pop()),d.children&&d.children.length>0&&(!t||t(d))&&(s.push(0),o.push(d.children))}}*getAncestors(t){let n=this.parent;for(;n&&(yield n,!(t&&!t(n)));)n=n.parent}isDescendantOf(t){for(let n of this.getAncestors())if(n===t)return!0;return!1}isAncestorOf(t){return t.isDescendantOf(this)}get level(){return this._level.value}get levelChanged(){return this._level.changed}get tree(){return this._tree}canMoveTo(t,n){return Ao(this,t,n)}moveTo(t,n){nl(this,t,n)}detachFromParent(){if(!this.parent||!this.parent.children)return;const t=this.parent.children.indexOf(this);this.parent.children.splice(t,1)}insertNewTreeItem(t,n){if(n&&n.tree!==this.tree)return console.warn("newTreeItem.tree !== this.tree"),!1;if(this.children&&t.startsWith("Inner"))return n&&this.children.push(n),!0;if(t==="Inner")return!1;const s=this.parent;if(!s||!s.children)return!1;const o=s.children.indexOf(this);return t.endsWith("Before")?n&&s.children.splice(o,0,n):t.endsWith("After")&&n&&s.children.splice(o+1,0,n),!0}};p(hn,"wm",new Map),p(hn,"allTreeItems",new Map);let Do=hn;class Hp extends st{constructor(t){super();p(this,"_redrawEvent",this.disposeVar(new H));p(this,"_containerScrollTop",this.disposeVar(it(0)));p(this,"_containerClientHeight",this.disposeVar(it(-1)));p(this,"_container",this.disposeVar(it(void 0)));p(this,"_redrawInfo",{topFreeSpaceHeight:0,topUnvisibleItemNum:0,middleTreeItems:[],bottomFreeSpaceHeight:0,bottomUnvisibleItemNum:0});this._tree=t;const n=this._containerClientHeight,s=this._containerScrollTop,o=this._tree._forceRedrawEvent,h=this.disposeVar(we(this._tree.itemDivHeightChanged,this._tree.itemChildrenChanged,this._tree.itemsChanged,n.changed,s.changed,o)),{redrawInfo:l}=this,d=v=>{const m=v.uiTreeObject;return!!v.children&&(!m||!m.collapsed)};this.dispose(h.disposableOn(()=>{if(l.topFreeSpaceHeight=0,l.topUnvisibleItemNum=0,l.middleTreeItems.length=0,l.bottomFreeSpaceHeight=0,l.bottomUnvisibleItemNum=0,this._containerClientHeight.value>=0){const v=ec(this._tree.getDescendants(d)),m=this._tree.itemDivHeight,y=m*v,w=Yn([_s([Yn([y-n.value,0]),s.value]),0]),S=w/m|0,T=Math.ceil((w-S*m+n.value)/m)|0;S>0&&(l.topUnvisibleItemNum=S,l.topFreeSpaceHeight=S*this._tree.itemDivHeight);const N=S+T;let j=0;for(let k of this._tree.getDescendants(d)){if(j>=N)break;j>=S&&l.middleTreeItems.push(k),++j}const C=v-S-T;C>0&&(l.bottomUnvisibleItemNum=C,l.bottomFreeSpaceHeight=C*this._tree.itemDivHeight)}else for(let v of this._tree.getDescendants(d))l.middleTreeItems.push(v);this._redrawEvent.emit(l)}));let f;this.dispose(()=>f&&(f.destroy(),f=void 0)),this.dispose(this.containerChanged.disposableOn(v=>{f&&(f.destroy(),f=void 0),v&&(f=To(),f.start(()=>{const{scrollTop:m,clientHeight:y}=v;typeof m>"u"||typeof y>"u"?Jr("createUiTreeWithContainer error: conainter has no scrollTop or clientHeight property!"):(this.containerScrollTop=m,this.containerClientHeight=y)}))}))}get container(){return this._container.value}set container(t){this._container.value=t}get containerChanged(){return this._container.changed}get redrawInfo(){return this._redrawInfo}getTreeItemPos(t){const n=h=>{const l=h.uiTreeObject;return!!h.children&&(!l||!l.collapsed)};let s=0,o=!1;for(let h of this._tree.getDescendants(n)){if(h===t){o=!0;break}++s}if(o)return[s,s*this._tree.itemDivHeight]}collapseAll(){console.log("collapseAll");for(let t of this.tree.root.getDescendants()){const n=t.uiTreeObject;n.collapsed=!0}}expandAll(){console.log("expandAll");for(let t of this.tree.root.getDescendants()){const n=t.uiTreeObject;n.collapsed=!1}}get tree(){return this._tree}get redrawEvent(){return this._redrawEvent}set containerScrollTop(t){this._containerScrollTop.value=t}get containerScrollTop(){return this._containerScrollTop.value}get containerScrollTopChanged(){return this._containerScrollTop.changed}set containerClientHeight(t){this._containerClientHeight.value=t}get containerClientHeight(){return this._containerClientHeight.value}get containerClientHeightChanged(){return this._containerClientHeight.changed}*getAllItems(t){for(let n of this._tree.getDescendants())(!t||t(n))&&(yield n)}getAllSelectedItems(){return this.getAllItems(t=>t.uiTreeObject.selected)}getAllCheckedItems(){return this.getAllItems(t=>t.uiTreeObject.checkedStatus==="checked")}getAllCheckedLeafItems(){return this.getAllItems(t=>!t.children&&t.uiTreeObject.checkedStatus==="checked")}selectAllItems(t){for(let n of this.getAllItems())(!t||!t.includes(n))&&(n.uiTreeObject.selected=!0)}clearAllSelectedItems(t){for(let n of this.getAllSelectedItems())(!t||!t.includes(n))&&(n.uiTreeObject.selected=!1)}checkAllItems(t){for(let n of this.getAllItems())(!t||!t.includes(n))&&n.uiTreeObject.check(!0)}clearAllCheckedItems(t){for(let n of this.getAllCheckedItems())(!t||!t.includes(n))&&n.uiTreeObject.check(!1)}}const As=class As extends st{constructor(t){super();p(this,"_root",this.disposeVar(new Do(this,!0,"_ROOT")));p(this,"_itemChildrenChanged",this.disposeVar(new H));p(this,"_itemChildrenToChange",this.disposeVar(new H));p(this,"_itemsAdded",this.disposeVar(new H));p(this,"_itemsDeleted",this.disposeVar(new H));p(this,"_itemsChanged",this.disposeVar(new H));p(this,"_transactionStack",0);p(this,"_addedItems",new Set);p(this,"_deletedItems",new Set);p(this,"_selectedItems",this.disposeVar(new Io));p(this,"_itemDivHeight",this.disposeVar(it(As.defaultItemDivHeight)));p(this,"_forceRedrawEvent",this.disposeVar(new H));p(this,"_uiTree",this.disposeVar(new Hp(this)));this._root._tree.value=this,this.dispose(this._itemChildrenToChange.disposableOn((n,s)=>{if(!n.children){console.error("!item.children");return}for(let o of s){const{start:h,deleteCount:l,items:d}=o;for(let f=h;f<h+l;++f){const v=n.children.get(f);this._deletedItems.has(v)?console.error(`this._deletedItems.has(currentItem(${v.id}))`):this._deletedItems.add(v)}for(let f of d)this._deletedItems.has(f)?this._deletedItems.delete(f):this._addedItems.add(f)}this._execTransaction()})),t!==void 0&&(this.itemDivHeight=t)}get selectedItems(){return this._selectedItems}get lastSelectedItem(){return this._selectedItems.length>0?this._selectedItems.get(this._selectedItems.length-1):void 0}get itemDivHeight(){return this._itemDivHeight.value}set itemDivHeight(t){this._itemDivHeight.value=t}get itemDivHeightChanged(){return this._itemDivHeight.changed}forceRedraw(){this._forceRedrawEvent.emit()}get uiTree(){return this._uiTree}get root(){return this._root}get children(){return this._root.children}getDescendants(t){return this._root.getDescendants(t)}getTreeItemFromId(t){let n;for(let s of this.getDescendants())if(s.id===t){n=s;break}return n}_startTransaction(){this._transactionStack===0&&(this._deletedItems.size>0&&(console.warn("this._deletedItems.size > 0"),this._deletedItems.clear()),this._addedItems.size>0&&(console.warn("this._addedItems.size > 0"),this._addedItems.clear())),++this._transactionStack}_stopTransaction(){--this._transactionStack,this._execTransaction()}_execTransaction(){this._transactionStack===0&&(this._deletedItems.size>0&&(this._itemsDeleted.emit([...this._deletedItems]),this._deletedItems.clear()),this._addedItems.size>0&&(this._itemsAdded.emit([...this._addedItems]),this._addedItems.clear()))}get itemChildrenChanged(){return this._itemChildrenChanged}get itemChildrenToChange(){return this._itemChildrenToChange}get itemsChanged(){return this._itemsChanged}get itemsAdded(){return this._itemsAdded}get itemsDeleted(){return this._itemsDeleted}};p(As,"defaultItemDivHeight",24),p(As,"canMoveToTreeItem",Ao),p(As,"moveToTreeItem",nl),p(As,"canMoveToTreeItems",qp),p(As,"moveToTreeItems",$p);let er=As;class xe extends st{constructor(t,n,s=!0,o){super();p(this,"_obj",this.disposeVar(it(void 0)));this._resetEvent=t,this._createFunc=n;const h=this._resetEvent,l=this._createFunc,d=()=>{this._obj.value&&(this._obj.value.destroy(),this._obj.value=void 0)};this.dispose(d);const f=(...v)=>{d(),this._obj.value=l(...v)};s&&(o?this._obj.value=l(...o):this._obj.value=l()),this.dispose(h.disposableOn(f))}get obj(){return this._obj.value}get objChanged(){return this._obj.changed}}class $w extends st{constructor(t,n=!0,s){super();p(this,"_event",this.disposeVar(new H));p(this,"_objResettingWithEvent");this._createFunc=t,this._execOnInit=n,this._initParams=s,this._objResettingWithEvent=this.disposeVar(new xe(this._event,this._createFunc,this._execOnInit,this._initParams))}get obj(){return this._objResettingWithEvent.obj}get objChanged(){return this._objResettingWithEvent.objChanged}reset(...t){this._event.emit(...t)}}const Iu=class Iu extends st{constructor(){super();p(this,"_set",new Set);p(this,"_toChangeEvent",this.dv(new H));p(this,"_changedEvent",this.dv(new H));p(this,"main");this.dispose(()=>{this._set.size!==0&&(Iu.warnOnDestroying&&console.warn("this._set.size > 0"),this.clear())})}get toChange(){return this._toChangeEvent}get changed(){return this._changedEvent}add(...t){if(t.length==2&&typeof t[1]=="boolean")t[1]&&(this.main=t[0]);else for(let n of t)this._toChangeEvent.emit([],[n]),this._set.add(n),this._changedEvent.emit([],[n])}delete(...t){for(let n of t)this.main&&this.main==n&&(this.main=void 0),this._toChangeEvent.emit([n],[]),this._set.delete(n),this._changedEvent.emit([n],[])}disposableAdd(...t){return t.length==2&&typeof t[1]=="boolean"?(t[1]&&(this.main=t[0]),this.add(t[0]),()=>this.delete(t[0])):(this.add(...t),()=>this.delete(...t))}get size(){return this._set.size}clear(){const t=[...this._set];this._toChangeEvent.emit([],t),this._set.clear(),this._changedEvent.emit([],t),this.main=void 0}values(){return this._set.values()}};p(Iu,"warnOnDestroying",!0);let sl=Iu;async function Xp(i){const e=[],t=[],n=i.entries();for await(const[s,o]of n){const h=o;h.kind==="file"?e.push(s):h.kind==="directory"&&t.push(s)}return{files:e,dirs:t}}async function bc(i){return await(await i.getFile()).text()}async function Yp(i){const e=await bc(i);try{return JSON.parse(e)}catch{return}}async function Jp(i){return await(await i.getFile()).arrayBuffer()}class Kp extends st{constructor(e){super(),this._rootDirHandle=e}get rootDirHandle(){return this._rootDirHandle}async getSubFilesAndDirs(){return await Xp(this._rootDirHandle)}async getDir(e){let t=this._rootDirHandle;for(const n of e)if(t=await(t==null?void 0:t.getDirectoryHandle(n)),!t){console.log(`getDirectoryHandle ${n} failed`);return}return t}async getFile(e,t){const n=await this.getDir(e);if(n)try{return await n.getFileHandle(t)}catch(s){console.error(`未能获取当前文件 ${e.join("/")}/${t} error: ${s}`,s);return}}}class Zp extends st{constructor(t){super();p(this,"_startRootDirId",0);p(this,"_dirMap",new Map);this._prefix=t}get prefix(){return this._prefix}async getRootDirId(t){let n;try{console.log("window.showDirectoryPicker begin"),n=await window.showDirectoryPicker({id:t,mode:"read"}),console.log("window.showDirectoryPicker end",n)}catch(s){console.error(`LocalFileServer getRootDirId failed: ${s}`,s);return}if(n){const s=++this._startRootDirId,o=`${this._prefix}${s}`;return this._dirMap.set(o,new Kp(n)),o}}getRootDir(t){return this._dirMap.get(t)}async getFile(t){const n=t.split("/");if(n.length<2){console.warn(`LocalFileServer getFile failed: ${t}`);return}const s=n[0],o=this._dirMap.get(s);if(!o){console.warn(`LocalFileServer getFile failed: ${t}`);return}const h=n.slice(1,n.length-1),l=n[n.length-1],d=await o.getFile(h,l);if(!d){console.warn(`LocalFileServer getFile failed: ${t}`);return}return d}async getText(t){const n=await this.getFile(t);if(n)return await bc(n)}async getArrayBuffer(t){const n=await this.getFile(t);if(n)return await Jp(n)}async getJson(t){const n=await this.getFile(t);if(n)return await Yp(n)}async getLocalFilePath(t,n,s){const o=await this.getRootDirId(n);if(!o){console.warn("getRootDirId error!");return}const h=this.getRootDir(o);if(!h){console.warn("getRootDir error!");return}const l=await h.getSubFilesAndDirs();if(!l.files){console.warn("getSubFilesAndDirs error! 找不到符合要求的文件!");return}const d=t?l.files.filter(f=>t.some(v=>f.endsWith(v))):l.files;if(d.length===0){console.warn("找不到符合要求的文件!");return}return`https://${o}/${d[0]}`}}const Qp=new Zp("xe2_local");async function Ww(i,e,t){return await Qp.getLocalFilePath(i,e,t)}class tm extends st{constructor(t,n){super();p(this,"_processing");this._complexImage=t,this._imageUri=n,this._processing=this.disposeVar(wi(async s=>{const o=this._complexImage,h=await s.promise(mp(this._imageUri,this._complexImage.crossOrigin));h&&h instanceof HTMLImageElement&&(o.size=[h.naturalWidth,h.naturalHeight],o.pixelFormat="RGBA",o.copyTexture({source:h}))})),this._processing.start()}get processing(){return this._processing}}const em=["DEPTH_COMPONENT","DEPTH_STENCIL","ALPHA","RED","RG","RGB","RGBA","LUMINANCE","LUMINANCE_ALPHA","RGB_DXT1","RGBA_DXT1","RGBA_DXT3","RGBA_DXT5","RGB_PVRTC_4BPPV1","RGB_PVRTC_2BPPV1","RGBA_PVRTC_4BPPV1","RGBA_PVRTC_2BPPV1","RGBA_ASTC","RGB_ETC1","RGB8_ETC2","RGBA8_ETC2_EAC","RGBA_BC7"],im=["img","gif","video","flv","hls"];let Hw=class extends st{constructor(t,n){super();p(this,"_element");this._complexImage=t,this._videoSrc=n;var s=document.createElement("video");s.src=this._videoSrc,s.style.position="absolute",s.style.top="0px",s.style.left="0px",s.style.zIndex="-100",s.style.visibility="hidden",s.style.width="0px",s.style.height="0px";{const o=()=>{s.crossOrigin=this._complexImage.crossOrigin};o(),this.dispose(this._complexImage.crossOriginChanged.disposableOn(o))}{const o=()=>{s.autoplay=this._complexImage.autoplay};o(),this.dispose(this._complexImage.autoplayChanged.disposableOn(o))}{const o=()=>{s.loop=this._complexImage.loop};o(),this.dispose(this._complexImage.loopChanged.disposableOn(o))}s.muted=!0,document.body.appendChild(s),this._element=s,this.dispose(()=>document.body.removeChild(s))}get element(){return this._element}};class nm extends st{constructor(t,n){super();p(this,"_videoDom");p(this,"_update");this._complexImage=t,this._imageUri=n,this._videoDom=this.disposeVar(new Hw(this._complexImage,this._imageUri)),this._update=this.disposeVar(sa(()=>this.update())),this._update.start()}get videoDom(){return this._videoDom}get videoElement(){return this._videoDom.element}update(){if(this.videoElement.readyState<2)return;const t=this._complexImage,{videoWidth:n,videoHeight:s}=this.videoElement;t.size=[n,s],t.pixelFormat="RGBA",t.copyTexture({source:this.videoElement})}}function Pc(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}function Xw(i){if(Object.prototype.hasOwnProperty.call(i,"__esModule"))return i;var e=i.default;if(typeof e=="function"){var t=function n(){return this instanceof n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(i).forEach(function(n){var s=Object.getOwnPropertyDescriptor(i,n);Object.defineProperty(t,n,s.get?s:{enumerable:!0,get:function(){return i[n]}})}),t}var Cc={},Jn={},sm;function rm(){if(sm)return Jn;sm=1,Object.defineProperty(Jn,"__esModule",{value:!0}),Jn.loop=Jn.conditional=Jn.parse=void 0;var i=function n(s,o){var h=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},l=arguments.length>3&&arguments[3]!==void 0?arguments[3]:h;if(Array.isArray(o))o.forEach(function(f){return n(s,f,h,l)});else if(typeof o=="function")o(s,h,l,n);else{var d=Object.keys(o)[0];Array.isArray(o[d])?(l[d]={},n(s,o[d],h,l[d])):l[d]=o[d](s,h,l,n)}return h};Jn.parse=i;var e=function(s,o){return function(h,l,d,f){o(h,l,d)&&f(h,s,l,d)}};Jn.conditional=e;var t=function(s,o){return function(h,l,d,f){for(var v=[],m=h.pos;o(h,l,d);){var y={};if(f(h,s,l,y),h.pos===m)break;m=h.pos,v.push(y)}return v}};return Jn.loop=t,Jn}var be={},am;function om(){if(am)return be;am=1,Object.defineProperty(be,"__esModule",{value:!0}),be.readBits=be.readArray=be.readUnsigned=be.readString=be.peekBytes=be.readBytes=be.peekByte=be.readByte=be.buildStream=void 0;var i=function(m){return{data:m,pos:0}};be.buildStream=i;var e=function(){return function(m){return m.data[m.pos++]}};be.readByte=e;var t=function(){var m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return function(y){return y.data[y.pos+m]}};be.peekByte=t;var n=function(m){return function(y){return y.data.subarray(y.pos,y.pos+=m)}};be.readBytes=n;var s=function(m){return function(y){return y.data.subarray(y.pos,y.pos+m)}};be.peekBytes=s;var o=function(m){return function(y){return Array.from(n(m)(y)).map(function(w){return String.fromCharCode(w)}).join("")}};be.readString=o;var h=function(m){return function(y){var w=n(2)(y);return m?(w[1]<<8)+w[0]:(w[0]<<8)+w[1]}};be.readUnsigned=h;var l=function(m,y){return function(w,S,T){for(var N=typeof y=="function"?y(w,S,T):y,j=n(m),C=new Array(N),k=0;k<N;k++)C[k]=j(w);return C}};be.readArray=l;var d=function(m,y,w){for(var S=0,T=0;T<w;T++)S+=m[y+T]&&Math.pow(2,w-T-1);return S},f=function(m){return function(y){for(var w=e()(y),S=new Array(8),T=0;T<8;T++)S[7-T]=!!(w&1<<T);return Object.keys(m).reduce(function(N,j){var C=m[j];return C.length?N[j]=d(S,C.index,C.length):N[j]=S[C.index],N},{})}};return be.readBits=f,be}var hm;function Yw(){return hm||(hm=1,(function(i){Object.defineProperty(i,"__esModule",{value:!0}),i.default=void 0;var e=rm(),t=om(),n={blocks:function(y){for(var w=0,S=[],T=y.data.length,N=0,j=(0,t.readByte)()(y);j!==w&&j;j=(0,t.readByte)()(y)){if(y.pos+j>=T){var C=T-y.pos;S.push((0,t.readBytes)(C)(y)),N+=C;break}S.push((0,t.readBytes)(j)(y)),N+=j}for(var k=new Uint8Array(N),M=0,D=0;D<S.length;D++)k.set(S[D],M),M+=S[D].length;return k}},s=(0,e.conditional)({gce:[{codes:(0,t.readBytes)(2)},{byteSize:(0,t.readByte)()},{extras:(0,t.readBits)({future:{index:0,length:3},disposal:{index:3,length:3},userInput:{index:6},transparentColorGiven:{index:7}})},{delay:(0,t.readUnsigned)(!0)},{transparentColorIndex:(0,t.readByte)()},{terminator:(0,t.readByte)()}]},function(m){var y=(0,t.peekBytes)(2)(m);return y[0]===33&&y[1]===249}),o=(0,e.conditional)({image:[{code:(0,t.readByte)()},{descriptor:[{left:(0,t.readUnsigned)(!0)},{top:(0,t.readUnsigned)(!0)},{width:(0,t.readUnsigned)(!0)},{height:(0,t.readUnsigned)(!0)},{lct:(0,t.readBits)({exists:{index:0},interlaced:{index:1},sort:{index:2},future:{index:3,length:2},size:{index:5,length:3}})}]},(0,e.conditional)({lct:(0,t.readArray)(3,function(m,y,w){return Math.pow(2,w.descriptor.lct.size+1)})},function(m,y,w){return w.descriptor.lct.exists}),{data:[{minCodeSize:(0,t.readByte)()},n]}]},function(m){return(0,t.peekByte)()(m)===44}),h=(0,e.conditional)({text:[{codes:(0,t.readBytes)(2)},{blockSize:(0,t.readByte)()},{preData:function(y,w,S){return(0,t.readBytes)(S.text.blockSize)(y)}},n]},function(m){var y=(0,t.peekBytes)(2)(m);return y[0]===33&&y[1]===1}),l=(0,e.conditional)({application:[{codes:(0,t.readBytes)(2)},{blockSize:(0,t.readByte)()},{id:function(y,w,S){return(0,t.readString)(S.blockSize)(y)}},n]},function(m){var y=(0,t.peekBytes)(2)(m);return y[0]===33&&y[1]===255}),d=(0,e.conditional)({comment:[{codes:(0,t.readBytes)(2)},n]},function(m){var y=(0,t.peekBytes)(2)(m);return y[0]===33&&y[1]===254}),f=[{header:[{signature:(0,t.readString)(3)},{version:(0,t.readString)(3)}]},{lsd:[{width:(0,t.readUnsigned)(!0)},{height:(0,t.readUnsigned)(!0)},{gct:(0,t.readBits)({exists:{index:0},resolution:{index:1,length:3},sort:{index:4},size:{index:5,length:3}})},{backgroundColorIndex:(0,t.readByte)()},{pixelAspectRatio:(0,t.readByte)()}]},(0,e.conditional)({gct:(0,t.readArray)(3,function(m,y){return Math.pow(2,y.lsd.gct.size+1)})},function(m,y){return y.lsd.gct.exists}),{frames:(0,e.loop)([s,l,d,o,h],function(m){var y=(0,t.peekByte)()(m);return y===33||y===44})}],v=f;i.default=v})(Cc)),Cc}var Jw=Yw();const Kw=Pc(Jw);var Zw=rm(),Qw=om();const tE=(i,e)=>{const t=new Array(i.length),n=i.length/e,s=function(v,m){const y=i.slice(m*e,(m+1)*e);t.splice.apply(t,[v*e,e].concat(y))},o=[0,4,2,1],h=[8,8,4,2];for(var l=0,d=0;d<4;d++)for(var f=o[d];f<n;f+=h[d])s(f,l),l++;return t},eE=(i,e,t)=>{const o=t;var h,l,d,f,v,m,y,D,w,S,M,T,L,V,I,x;const N=new Array(t),j=new Array(4096),C=new Array(4096),k=new Array(4097);for(T=i,l=1<<T,v=l+1,h=l+2,y=-1,f=T+1,d=(1<<f)-1,w=0;w<l;w++)j[w]=0,C[w]=w;var M,D,L,V,x,I;for(M=D=L=V=x=I=0,S=0;S<o;){if(V===0){if(D<f){M+=e[I]<<D,D+=8,I++;continue}if(w=M&d,M>>=f,D-=f,w>h||w==v)break;if(w==l){f=T+1,d=(1<<f)-1,h=l+2,y=-1;continue}if(y==-1){k[V++]=C[w],y=w,L=w;continue}for(m=w,w==h&&(k[V++]=L,w=y);w>l;)k[V++]=C[w],w=j[w];L=C[w]&255,k[V++]=L,h<4096&&(j[h]=y,C[h]=L,h++,(h&d)===0&&h<4096&&(f++,d+=h)),y=m}V--,N[x++]=k[V],S++}for(S=x;S<o;S++)N[S]=0;return N},iE=i=>{const e=new Uint8Array(i);return Zw.parse(Qw.buildStream(e),Kw)},nE=i=>{const e=i.pixels.length,t=new Uint8ClampedArray(e*4);for(var n=0;n<e;n++){const s=n*4,o=i.pixels[n],h=i.colorTable[o]||[0,0,0];t[s]=h[0],t[s+1]=h[1],t[s+2]=h[2],t[s+3]=o!==i.transparentIndex?255:0}return t},sE=(i,e,t)=>{if(!i.image){console.warn("gif frame does not have associated image.");return}const{image:n}=i,s=n.descriptor.width*n.descriptor.height;var o=eE(n.data.minCodeSize,n.data.blocks,s);n.descriptor.lct.interlaced&&(o=tE(o,n.descriptor.width));const h={pixels:o,dims:{top:i.image.descriptor.top,left:i.image.descriptor.left,width:i.image.descriptor.width,height:i.image.descriptor.height}};return n.descriptor.lct&&n.descriptor.lct.exists?h.colorTable=n.lct:h.colorTable=e,i.gce&&(h.delay=(i.gce.delay||10)*10,h.disposalType=i.gce.extras.disposal,i.gce.extras.transparentColorGiven&&(h.transparentIndex=i.gce.transparentColorIndex)),h.patch=nE(h),h},rE=(i,e)=>i.frames.filter(t=>t.image).map(t=>sE(t,i.gct));async function lm(i){const t=await(await fetch(i)).arrayBuffer(),n=iE(t),s=rE(n);return{gif:n,gifFrames:s,arrayBuffer:t}}function um(i,e,t){return i<e?e:i>t?t:i}class cm extends il{constructor(t,n=!0,s){super();p(this,"_gifFrames",this.disposeVar(it(void 0)));p(this,"_gifDurations",[]);p(this,"_gifDuration",this.disposeVar(it(0)));p(this,"_gifSize",this.disposeVar(it([0,0],(t,n)=>t.every((s,o)=>s===n[o]),t=>[...t])));p(this,"_autoPlayOnLoad",this.disposeVar(it(!0)));p(this,"_gifCanvas");this._container=t,this.loop=!0;const o=document.createElement("canvas");this._gifCanvas=o,o.style.width="100%",o.style.height="100%";const h=o.getContext("2d");this._container&&this._container.appendChild(o),this.dispose(()=>this._container&&this._container.removeChild(o));let l;this.dispose(this._gifFrames.changed.disposableOn(f=>{if(!f||f.length===0){o.width=0,o.height=0;return}const{width:v,height:m}=f[0].dims;this._gifSize.value=[v,m];const y=f.length;let w=0;this._gifDurations.length=0;for(let S=0;S<y;++S)w+=f[S].delay,this._gifDurations.push(w);this._gifDuration.value=this._gifDurations[this._gifDurations.length-1],o.width=v,o.height=m,l=h.createImageData(v,m),this.currentTimeChangedEvent.emit(this.currentTime,this.currentTime),this._autoPlayOnLoad.value&&(this.currentTime=0,this.playing=!0)}));let d=-1;this.dispose(this.currentTimeChangedEvent.disposableOn(f=>{const v=um(f/this.duration,0,1),m=this.gifDuration*v,y=this._gifFrames.value;if(y&&y.length>0){const w=this._getFrame(m);if(w===d)return;d=w;const S=y[w];if(S.disposalType!==0&&S.disposalType!==1&&S.disposalType!==2&&Jr(`gif parsed get disposalType ${S.disposalType}... frame: ${w} size: ${JSON.stringify(S.dims)}`,`gif parsed get disposalType ${S.disposalType}...`),l&&(w===0||S.disposalType===2)&&l.data.fill(0),l){const[T,N]=this._gifSize.value,{width:j,height:C,left:k,top:M}=S.dims;if(C>N)throw new Error("height > canvasHeight");for(let D=0;D<C;++D)for(let L=0;L<j;++L){const V=D*j+L,x=M+D,I=k+L,R=x*T+I,G=l.data,F=S.patch,U=F[V*4+3]/255;G[R*4+0]=G[R*4+0]*(1-U)+F[V*4+0]*U|0,G[R*4+1]=G[R*4+1]*(1-U)+F[V*4+1]*U|0,G[R*4+2]=G[R*4+2]*(1-U)+F[V*4+2]*U|0,G[R*4+3]=um(G[R*4+3]+F[V*4+3],0,255)|0}h.putImageData(l,0,0)}}else Jr("gif资源未加载!无法播放!")})),this.dispose(this._gifDuration.changed.disposableOn(()=>{this.duration=this.gifDuration})),this._autoPlayOnLoad.value=n,this._gifFrames.value=s}get gifCanvas(){return this._gifCanvas}set gifFrames(t){this._gifFrames.value=t}get gifFrames(){return this._gifFrames.value}get gifFramesChanged(){return this._gifFrames.changed}get gifSize(){return this._gifSize.value}get gifSizeChanged(){return this._gifSize.changed}get gifDuration(){return this._gifDuration.value}get gifDurationChanged(){return this._gifDuration.changed}get autoPlayOnLoad(){return this._autoPlayOnLoad.value}set autoPlayOnLoad(t){this._autoPlayOnLoad.value=t}get autoPlayOnLoadChanged(){return this._autoPlayOnLoad.changed}_getFrame(t){const n=this._gifDurations.length;for(let s=0;s<n;++s)if(t<=this._gifDurations[s])return s;throw new Error("should not be here")}}class dm extends st{constructor(t){super();p(this,"_player");p(this,"_url",this.disposeVar(it("")));p(this,"_loadGifFramesProcessing",this.disposeVar(el(t=>na(lm(t)))));this._player=this.disposeVar(new cm(t)),this._player.autoPlayOnLoad=!0,this._loadGifFramesProcessing.completeFunc=({gifFrames:n})=>this._player.gifFrames=n,this.dispose(this._url.changed.disposableOn(n=>{this._player.gifFrames=void 0,this._loadGifFramesProcessing.restart(new tn(`reload gif(${n})`),n)}))}get player(){return this._player}set url(t){this._url.value=t}get url(){return this._url.value}get loadedEvent(){return this._loadGifFramesProcessing.completeEvent}get size(){return this._player.gifSize}get sizeChanged(){return this._player.gifSizeChanged}get duration(){return this._player.gifDuration}get durationChanged(){return this._player.gifDurationChanged}}class fm extends st{constructor(t,n){super();p(this,"_gif",this.disposeVar(new dm));p(this,"_update");this._complexImage=t,this._imageUri=n,this._gif.url=this._imageUri,this._update=this.disposeVar(sa(()=>this.update())),this._update.start()}get gif(){return this._gif}update(){const{player:t}=this._gif;if(!t.gifFrames)return;const n=this._complexImage,{width:s,height:o}=t.gifCanvas;n.size=[s,o],n.pixelFormat="RGBA",n.copyTexture({source:t.gifCanvas});{const h=()=>{t.autoPlayOnLoad=this._complexImage.autoplay};h(),this.dispose(this._complexImage.autoplayChanged.disposableOn(h))}{const h=()=>{t.loop=this._complexImage.loop};h(),this.dispose(this._complexImage.loopChanged.disposableOn(h))}}}function gm(i,e){const[t,n,s]=wo(i),o=it(void 0),h=()=>{const l=t()??e;o.value=l&&St.context.getStrFromEnv(l)};return h(),s&&o.d(s.don(h)),o.d(St.context.environmentVariablesChanged.don(h)),o}function pm(i){const e=/\${(.*?)\}/g;if(!e.test(i))return i;const t=i.replace(e,(n,s)=>{const o=St.context.getEnv(s);return o===void 0?(console.warn(`环境变量(${s})不存在,无法进行转换`),"{env-error}"):o});return pm(t)}class aE extends st{constructor(t){super();p(this,"_sceneObjRefs",new Map);p(this,"_refs",{});p(this,"_refsChanged",this.dv(new H));const n=(s,o,h)=>{if(h){const l=this.getLastSceneObject(h),d=this._sceneObjRefs.get(h);if(!d)console.warn(`this._sceneObjRefs中不存在ref(${h}), 可能系统存在逻辑问题`);else{const v=d.indexOf(s);v===-1?console.warn(`this._sceneObjRefs中不存在当前对象(id: ${s.id} type: ${s.typeName})!可能系统存在逻辑问题`):(d.splice(v,1),d.length===0&&this._sceneObjRefs.delete(h))}const f=this.getLastSceneObject(h);this._refs[h]=f,this._refsChanged.emit(f,l)}if(o){const l=this.getLastSceneObject(o),d=this._sceneObjRefs.get(o);d?(d.push(s),d.length>0&&console.warn(`同时存在多个ref${o}相同的场景对象!
|
|
22
22
|
${d.map(v=>`${v.id} ${v.typeName}
|
|
23
|
-
`).join(" ")}`)):this._sceneObjRefs.set(o,[s]);const f=this.getLastSceneObject(o);this._refs[o]=f,this._refsChanged.emit(f,l)}};this.d(t.sceneObjCreatedEvent.don(s=>{const o=(h,l)=>n(s,h,l);s.ref&&o(s.ref,void 0),s.refChanged.don(o)})),this.d(t.sceneObjToDestroyEvent.don(s=>{s.ref&&n(s,void 0,s.ref)}))}get sceneObjRefs(){return this._sceneObjRefs}get refs(){return this._refs}get refsChanged(){return this._refsChanged}getLastSceneObject(t){const n=this.getSceneObjects(t);if(n)return n[n.length-1]}getSceneObjects(t){const n=this._sceneObjRefs.get(t);if(!(!n||n.length===0))return n}}class oE extends st{constructor(){super();p(this,"_esObjConstructors",new Map);p(this,"_sceneObjs",new Map);p(this,"_sceneObjCreatedEvent",new H);p(this,"_sceneObjToDestroyEvent",new H);p(this,"_refsManager",this.dv(new aE(this)));p(this,"_environmentVariables",window.ESSDK_ENV||{});p(this,"_environmentVariablesChanged",this.dv(new H))}get typeNames(){return this._esObjConstructors.keys()}get sceneObjs(){return this._sceneObjs.values()}get sceneObjCreatedEvent(){return this._sceneObjCreatedEvent}get sceneObjToDestroyEvent(){return this._sceneObjToDestroyEvent}get refsManager(){return this._refsManager}get $refs(){return this._refsManager.refs}register(t,n,s){return this._esObjConstructors.has(t)&&console.warn(`register warn: ${t} has registered ! will be override!`),this._esObjConstructors.set(t,n),s&&yn(n,"__sceneObjExtraInfo",s),t}_addSceneObject(t){this._sceneObjs.set(t.id,t),this._sceneObjCreatedEvent.emit(t),t.d(()=>this._deleteSceneObject(t))}addSceneObject(t){this._addSceneObject(t)}_deleteSceneObject(t){this._sceneObjToDestroyEvent.emit(t),this._sceneObjs.delete(t.id)}deleteSceneObject(t){this._deleteSceneObject(t)}createSceneObjectFromClass(t,n){if(!n||this._sceneObjs.has(n)){const o=Zr();n&&console.warn(`已存在相同id的对象!id自动变更!${n} -> ${o} 请注意:id变更可能导致引用失效!`),n=o}if(!n)throw new Error("id不能为空!");const s=new t(n);return s.id!==n&&(console.warn(`sceneObj.id(${s.id}) !== id(${n}) sceneObjectType: ${s.typeName}`),console.warn("出现这种问题有可能是自定义的场景对象,没有在构造函数中传递id参数!示例如下:"),console.warn("class XXX extends XXX { constructor(id) { super(id); } }")),this._addSceneObject(s),s}createSceneObject(t,n){if(typeof t=="string"){const s=this._getSceneObjConstructor(t);if(!s){console.warn(`Cannot find SceneObjectType: ${t}`);return}return this.createSceneObjectFromClass(s,n)}else return this.createSceneObjectFromClass(t,n)}createSceneObjectFromUrl(t,n){let s;const o=t.toLowerCase();if(o.includes(".gltf")||o.includes(".glb")?s="ESGltfModel":o.includes("tileset.json")?s="ES3DTileset":o.includes("layer.json")||o.includes("ion://1")?s="ESTerrainLayer":o.includes(".jpg")||o.includes(".png")||o.includes(".jpeg")||o.includes(".webp")||o.includes("image/jpg")||o.includes("image/png")||o.includes("image/jpeg")||o.includes("image/webp")?s="ESImageLabel":(o.includes("/tilemapresource.xml")||o.includes("ion://")||o.includes("wms")||o.includes("wmts")||o.includes("{x}")||o.includes("{y}")||o.includes("{z}"))&&(s="ESImageryLayer"),!!s)return this.createSceneObjectFromJson({type:s,id:n,url:t})}createSceneObjectFromJson(t){const n=this.createSceneObject(t.type,t.id);return n&&(n.json=t),n}destroySceneObject(t){return this._deleteSceneObject(t),t.destroy(),t.isDestroyed()}getSceneObjectById(t){return this._sceneObjs.get(t)}getSceneObject(t){if(!t&&t!="")return Array.from(this._sceneObjs.values());if(typeof t=="function"){const n=[];for(const s of this._sceneObjs.values())s instanceof t&&n.push(s);return n}if(t.startsWith("ES")){const n=[];for(const s of this._sceneObjs.values())s.typeName===t&&n.push(s);return n}return this._sceneObjs.get(t)}_getSceneObjConstructor(t){const n=this._esObjConstructors.get(t);if(n)return n}getProps(t){const n=this._getSceneObjConstructor(t);if(!n){console.warn(`cannot get constructor from type: ${t}`);return}return _i(n,"__sceneObjExtraInfo")}setProps(t,n){const s=this._getSceneObjConstructor(t);if(!s){console.warn(`cannot get constructor from type: ${t}`);return}let o=_i(s,"__sceneObjExtraInfo");o||(o={},yn(s,"__sceneObjExtraInfo",o)),Object.assign(o,n)}getProp(t,n){const s=this.getProps(t);return s&&s[n]}setProp(t,n,s){this.setProps(t,{[n]:s})}get environmentVariables(){return this._environmentVariables}set environmentVariables(t){for(let[n,s]of Object.entries(t))this.setEnv(n,s)}get environmentVariablesChanged(){return this._environmentVariablesChanged}setEnv(t,n){if(this._environmentVariables[t]!==n){const s=this._environmentVariables[t];this._environmentVariables[t]=n,this._environmentVariablesChanged.emit(t,n,s)}window.ESSDK_ENV={...this._environmentVariables}}getEnv(t){return this._environmentVariables[t]}getStrFromEnv(t){return pm(t)}createEnvStrReact(t,n){return gm(t,n)}createEvnStrReact(t,n){return gm(t,n)}}const Ft=class Ft extends st{constructor(t){super();p(this,"_components",this.dv(new sl));p(this,"_viewerAttached",this.dv(new H));p(this,"_viewerDetached",this.dv(new H));p(this,"_attachedViewers",(()=>{const t=new Set;return this.d(this._viewerAttached.don(n=>{n.actived&&(this.activeViewer=n),n.ad(n.activedChanged.don(s=>{s&&t.has(n)&&(this.activeViewer=n)})),t.add(n)})),this.d(this._viewerDetached.don(n=>{t.delete(n),this.activeViewer==n&&(this.activeViewer=void 0)})),t})());p(this,"_activeViewer",this.dv(it(void 0)));p(this,"_reloadEvent",this.dv(new H));p(this,"_readyEvent",this.dv(new H));p(this,"_createdEvent",this.dv(new H));p(this,"_flushEvent",this.dv(new H));p(this,"_id");p(this,"_updateFuncReact",this.dv(it(void 0)));p(this,"_toDestroyFuncReact",this.dv(it(void 0)));p(this,"_parentID");t!==void 0&&(typeof t!="string"?console.warn(`对象id必须是字符串类型,当前id的类型是${typeof t},值为${t}`):t.trim()===""?console.warn("场景对象创建时的id不能是空字符串!"):t.trim()!==t&&console.warn(`id前后有空字符串!id: ${t}`)),this._id=t??Zr(),this._initName();{const n=()=>{if(this.execOnceFuncStr)try{Function(`"use strict";return (${this.execOnceFuncStr})`)()(this)}catch(s){console.warn(`execOnceFuncStr不能转成函数!或者函数执行时错误!id: ${this.id} ${this.typeName} error: ${s}`)}};n(),this.d(this.execOnceFuncStrChanged.don(n))}{const n=()=>{if(this.updateFuncStr)try{this.updateFunc=Function(`"use strict";return (${this.updateFuncStr})`)()}catch(o){console.warn(`updateFuncStr不能转成函数!或者函数执行时错误!id: ${this.id} ${this.typeName} error: ${o}`)}};n(),this.d(this.updateFuncStrChanged.don(n));let s;this.d(()=>s&&s.destroy()),this.d(this.updateFuncChanged.don(()=>{s&&s.cancel(),this.updateFunc&&(s=s||To(),s.restart(void 0,o=>{this.updateFunc&&this.updateFunc(this,o)}))}))}{const n=()=>{try{this.toDestroyFunc=this.toDestroyFuncStr&&Function(`"use strict";return (${this.toDestroyFuncStr})`)()||void 0}catch(s){console.warn(`toDestroyFuncStr不能转成函数!或者函数执行时错误!id: ${this.id} ${this.typeName} error: ${s}`),this.toDestroyFunc=void 0}};n(),this.d(this.toDestroyFuncStrChanged.don(n)),this.d(this.toDestroyEvent.don(()=>{this.toDestroyFunc&&this.toDestroyFunc(this)}))}}static getParentClass(){return Object.getPrototypeOf(this)}static register(t,n,s){ys(n.prototype,n.createDefaultProps);const o=n.createDefaultProps();n.defaults&&(n.defaults={});for(const h of Object.keys(o))n.defaults[h]=o[h]instanceof Ne?o[h].value:o[h];return this.innerRegister(t,n,s),t}static get envs(){return Ft.context.environmentVariables}static get $refs(){return Ft.context.refsManager.refs}get components(){return this._components}get viewerAttached(){return this._viewerAttached}get viewerDetached(){return this._viewerDetached}get attachedViewers(){return this._attachedViewers}get activeViewer(){return this._activeViewer.value}set activeViewer(t){this._activeViewer.value=t}get activeViewerChanged(){return this._activeViewer.changed}removefromViewer(t){this.attachedViewers.has(t)&&t.delete(this)}get reloadEvent(){return this._reloadEvent}reload(){this._reloadEvent.emit()}get readyEvent(){return this._readyEvent}addToViewer(t){this.attachedViewers.has(t)||t.add(this)}registerAttachedObject(t){const n=new Map;this.d(()=>{n.size>0&&console.warn("viewerPropSceneObjects.size > 0")}),this.d(this._viewerAttached.don(s=>{const o=t(s);o&&n.set(s,o)})),this.d(this._viewerDetached.don(s=>{if(!n.has(s))return;const o=n.get(s);o&&(o.destroy(),n.delete(s))}))}createAttachedObject(t){const n=new Map,s=(()=>{for(let[d,f]of n.entries())f.destroy();n.clear()}),o=d=>{const f=t(d);f&&n.set(d,f)};for(let d of this.attachedViewers)o(d);const h=this._viewerAttached.don(o),l=this._viewerDetached.don(d=>{if(!n.has(d))return;const f=n.get(d);f&&(f.destroy(),n.delete(d))});return()=>{l(),h(),s()}}registerAttachedObjectForContainer(t){this.registerAttachedObject(n=>new hE(n,t))}get createdEvent(){return this._createdEvent}get flushEvent(){return this._flushEvent}flush(){this.flushEvent.emit()}get id(){return this._id}get typeName(){return this.constructor.type}_initName(){this.name=`${this.typeName}_${(""+this.id).slice(-4)}`}get defaultProps(){return this.constructor.createDefaultProps()}_innerGetJson(t=!0){const n={id:this.id,type:this.typeName};for(let s of Object.keys(this.defaultProps))if(t){let o,h=this.defaultProps[s];h instanceof Ne?o=h.equals(this[s]):o=h===this[s],o||(n[s]=this[s])}else n[s]=this[s];return n}_innerSetJson(t,n,s){if(!(t instanceof Object)||t.type&&t.type!==this.typeName){console.error(`value.type && value.type${t.type} !== this.typeName${this.typeName}`);return}t.id&&t.id!==this.id&&console.warn(`value.id === undefined || value.id${t.id} !== this.id(${this.id})`);const o=n||[];o.push("id","type");const h=Object.keys(this.defaultProps).filter(l=>!o.includes(l));for(let l of h)if(l in t)this[l]=t[l]===null?void 0:t[l];else if(!(s??!1)){let d=this.defaultProps[l];d instanceof Ne&&(d=d.value),this[l]=d}}get completeJson(){return this._innerGetJson(!1)}get json(){return this._innerGetJson()}set json(t){this._innerSetJson(t)}get _jsonStr(){return JSON.stringify(this.json,null,4)}set _jsonStr(t){this._innerSetJson(JSON.parse(t))}get updateFunc(){return this._updateFuncReact.value}set updateFunc(t){this._updateFuncReact.value=t}get updateFuncChanged(){return this._updateFuncReact.changed}get toDestroyFunc(){return this._toDestroyFuncReact.value}set toDestroyFunc(t){this._toDestroyFuncReact.value=t}get toDestroyFuncChanged(){return this._toDestroyFuncReact.changed}get parentID(){return this._parentID??this.id}set parentID(t){this._parentID=t}getESProperties(){return{defaultMenu:"general",basic:[],general:[new Tt([this,"typeName"],"类型",void 0,!1,!0),new Tt([this,"id"],"id",void 0,!1,!0),new Tt([this,"name"],"名称"),new Tc("JSON",()=>this._jsonStr,t=>t&&(this._jsonStr=t))],dataSource:[],location:[],coordinate:[],style:[],more:[new Tt([this,"ref"],"ref",void 0,!0),new Mt([this,"extras"],"extras",{},void 0,!0)]}}};p(Ft,"context",new oE),p(Ft,"innerRegister",Ft.context.register.bind(Ft.context)),p(Ft,"defaults",{}),p(Ft,"createDefaultProps",()=>({name:"未命名场景对象",ref:void 0,extras:At(void 0),devTags:Wt(void 0),execOnceFuncStr:void 0,updateFuncStr:void 0,toDestroyFuncStr:void 0})),p(Ft,"type",Ft.register("ESSceneObject",Ft,{chsName:"场景类",tags:["ESObjects","base"],description:""})),p(Ft,"create",Ft.context.createSceneObject.bind(Ft.context)),p(Ft,"createFromUrl",Ft.context.createSceneObjectFromUrl.bind(Ft.context)),p(Ft,"createFromClass",Ft.context.createSceneObjectFromClass.bind(Ft.context)),p(Ft,"createFromJson",Ft.context.createSceneObjectFromJson.bind(Ft.context)),p(Ft,"destroySceneObject",Ft.context.destroySceneObject.bind(Ft.context)),p(Ft,"getSceneObjById",Ft.context.getSceneObjectById.bind(Ft.context)),p(Ft,"getSceneObj",Ft.context.getSceneObject.bind(Ft.context)),p(Ft,"getEnv",Ft.context.getEnv.bind(Ft.context)),p(Ft,"setEnv",Ft.context.setEnv.bind(Ft.context)),p(Ft,"getStrFromEnv",Ft.context.getStrFromEnv.bind(Ft.context)),p(Ft,"getSceneObjectById",Ft.context.getSceneObjectById.bind(Ft.context)),p(Ft,"getSceneObject",Ft.context.getSceneObject.bind(Ft.context));let St=Ft;class hE extends st{constructor(e,t){super(),this.dv(new xe(e.subContainerChanged,()=>{if(e.subContainer)return t(e,e.subContainer)}))}}const Mu=class Mu extends st{constructor(t,n,s){super();p(this,"_id",++Mu._accumId);this._name=t,this._description=n,this._callFunction=s}get id(){return this._id}get name(){return this._name}get description(){return this._description}get callFunction(){return this._callFunction}};p(Mu,"_accumId",-1);let Es=Mu;class Ic extends Es{constructor(e,t,n,s,o,h){super(e,t,h??(()=>{})),this._withUndefined=n,this._readonly=s,this._defaultValue=o}get withUndefined(){return this._withUndefined}get readonly(){return this._readonly}get defaultValue(){return this._defaultValue instanceof Function?this._defaultValue():this._defaultValue}}class ei extends Ic{constructor(t,n,s,o,h,l,d){var v;const f=t instanceof Ne?"未获取到属性名":t[1].toString();super(n??f,l??f,o??!1,h??!1,s,d);p(this,"_propName");p(this,"_typeName");this._reactVar=t,this._propName=f;try{this._typeName=t instanceof Ne?"未获取到对象类型":(v=t[0])==null?void 0:v.typeName}catch{this._typeName="未获取到对象类型"}}get reactVar(){return this._reactVar}get propName(){return this._propName}get typeName(){return this._typeName}}class nt extends ei{get type(){return"BooleanProperty"}}class Tt extends ei{get type(){return"StringProperty"}}class q extends ei{get type(){return"NumberProperty"}}class ge extends ei{get type(){return"Number2Property"}}class Te extends ei{get type(){return"Number3Property"}}class ui extends ei{get type(){return"Number4Property"}}class jt extends ui{get type(){return"ColorProperty"}}class rl extends q{get type(){return"DashPatternProperty"}}class Ei extends ei{get type(){return"DateProperty"}}class Mc extends ei{get type(){return"DatesProperty"}}class yt extends Es{constructor(t,n,s){super(t??"",s??"");p(this,"_placement");this._placement=n}get type(){return"DivideProperty"}get placement(){return this._placement}}class xt extends ei{constructor(e,t,n,s,o,h,l){super(e,n,s,o,h,l),this._enums=t}get type(){return"EnumProperty"}get enums(){return this._enums}}class Ai extends ei{constructor(e,t,n,s,o,h,l){super(e,t,n,o,h,l),this._sampleValue=s}get sampleValue(){return this._sampleValue}get type(){return"EvalStringProperty"}}class Lo extends ei{constructor(e,t,n,s,o,h,l){super(e,t,n,o,h,l),this._sampleValue=s}get sampleValue(){return this._sampleValue}get type(){return"LongStringProperty"}}class kt extends Es{constructor(t,n,s,o){const h=t??"Unnamed Function";super(h,o??h);p(this,"_paramsLength");this._func=n,this._defaultParams=s,this._paramsLength=this._func.length??0}get paramsLength(){return this._paramsLength}get defaultParams(){return this._defaultParams}get isOpen(){return this._defaultParams.length!==this._paramsLength}get func(){return this._func}run(...t){this._func(...t)}get type(){return"MethodProperty"}}class ke extends ei{constructor(e,t,n,s,o,h,l,d){super(e,s,o,h,l,d),this._step=t,this._minMax=n}get type(){return"NumberSliderProperty"}get minMax(){return this._minMax}get step(){return this._step}}class en extends Te{get type(){return"PositionProperty"}}class ra extends Te{get type(){return"RotationProperty"}}function lE(i,e){const[t,n,s]=wo(i),[o,h,l]=wo(e),d=it((t()??0)/(o()??3e3)),f=()=>{const v=d.value,m=o()??3e3,y=t()??0;if(!Number.isFinite(m)||!Number.isFinite(y)){console.warn(`duration || currentTime error: duration: ${m} currentTime: ${y}`);return}Math.abs(v*m-y)<.001||(m<=0?d.value=0:d.value=y/m)};return d.dispose(s.disposableOn(f)),d.dispose(l.disposableOn(f)),d.dispose(d.changed.disposableOn(()=>{const v=d.value,m=o()??3e3,y=t()??0;if(!Number.isFinite(m)||!Number.isFinite(y)){console.warn(`duration || currentTime error: duration: ${m} currentTime: ${y}`);return}Math.abs(v*m-y)<.001||n(v*m)})),d}class aa extends Es{constructor(t,n,s,o,h,l){super(o??"播放器",l??"播放器");p(this,"_defaults",{playing:!1,ratio:0,loop:!1});this._playingReact=t,this._ratioReact=n,this._loopReact=s,h&&(this._defaults.playing=h.playing??this._defaults.playing,this._defaults.ratio=h.ratio??this._defaults.ratio,this._defaults.loop=h.loop??this._defaults.loop)}get type(){return"PlayerProperty"}get playingReact(){return this._playingReact}get ratioReact(){return this._ratioReact}get loopReact(){return this._loopReact}get defaults(){return this._defaults}}p(aa,"createPlayingRatio",lE);class mm extends Es{constructor(t,n,s,o,h,l){const d=o??"视角播放器";super(d,l??d);p(this,"_defaults",{playing:!1,loop:!1});this._playingReact=t,this._stopFn=n,this._loopReact=s,h&&(this._defaults.playing=h.playing??this._defaults.playing,this._defaults.loop=h.loop??this._defaults.loop)}get type(){return"ViewPlayerProperty"}get playingReact(){return this._playingReact}get loopReact(){return this._loopReact}get stopFn(){return this._stopFn}get defaults(){return this._defaults}}class ue extends ei{constructor(e,t,n,s,o,h,l){super(e,t,n,o,h,l),this._sampleValue=s}get sampleValue(){return this._sampleValue}get type(){return"JsonArrayProperty"}}class Mt extends ei{constructor(e,t,n,s,o,h,l){super(e,t,n,o,h,l),this._sampleValue=s}get sampleValue(){return this._sampleValue}get type(){return"JsonProperty"}}class Tc extends Ic{constructor(e,t,n,s,o,h){super(e,h??e,s??!1,o??!1),this._getFunc=t,this._setFunc=n}get getFunc(){return this._getFunc}get setFunc(){return this._setFunc}get type(){return"GetSetProperty"}}var dt=(i=>(i.Place="place",i.BrushErase="brushErase",i.Translation="translation",i.Rotation="rotation",i.Scale="scale",i.DoublePointsAppend="doublePointsAppend",i.DoublePointsModify="doublePointsModify",i.CircularAppend="circularAppend",i.CircularInsert="circularInsert",i.LineStringAppend="lineStringAppend",i.LineStringInsert="lineStringInsert",i.ScatterAppend="scatterAppend",i.ScatterModify="scatterModify",i.VisibilityAppend="visibilityAppend",i.VisibilityModify="visibilityModify",i.HeightModify="heightModify",i.SinglePoint="singlePoint",i.DoublePoints="doublePoints",i))(dt||{});const kc=[["地形","TERRAIN"],["3D Tiles","CESIUM_3D_TILE"],["地形和3D Tiles","BOTH"]],Oc=[["直箭头","straightArrow"],["燕尾箭头","swallowTailArrow"]];var vm=(i=>(i.DECIMAL_DEGREE="DECIMAL_DEGREE",i.DEGREES_DECIMAL_MINUTES="DEGREES_DECIMAL_MINUTES",i.SEXAGESIMAL_DEGREE="SEXAGESIMAL_DEGREE",i))(vm||{});class uE{constructor(e){this.childPickedInfo=e}}class cE{constructor(e,t,n,s,o,h){this.pickResult=e,this.sceneObject=t,this.tilesetPickInfo=n,this.geojsonPickInfo=s,this.attachedInfo=o,this.screenPosition=h}assign(e){e!=null&&e.pickedResult&&(this.pickResult=e.pickedResult),e!=null&&e.sceneObject&&(this.sceneObject=e.sceneObject),e!=null&&e.tilesetPickInfo&&(this.tilesetPickInfo=e.tilesetPickInfo),e!=null&&e.geojsonPickInfo&&(this.geojsonPickInfo=e.geojsonPickInfo),e!=null&&e.attachedInfo&&(this.attachedInfo=e.attachedInfo),e!=null&&e.screenPosition&&(this.screenPosition=e.screenPosition)}}const Se=class Se extends St{constructor(t){super(t);p(this,"_editing",this.dv(it(!1)));p(this,"editingID");p(this,"editingBindMode","singlePoint");p(this,"_deprecated",[]);p(this,"_flyInEvent",this.dv(new H));p(this,"_flyToEvent",this.dv(new H));p(this,"_flyOverEvent",this.disposeVar(new H));p(this,"_pickedEvent",this.dv(new H));p(this,"_calcFlyToParamEvent",this.dv(new H));p(this,"_calcFlyInParamEvent",this.dv(new H));p(this,"useCalcFlyToParamInESObjectWithLocation",!1);Sm(this,this.updateEditing)}supportEditingModes(){return this.constructor.supportEditingModes}get editing(){return this._editing.value}set editing(t){this._editing.value=t}get editingChanged(){return this._editing.changed}updateEditing(){}_deprecatedWarning(){const t=this._deprecated;for(let n=0;n<t.length;n++){const s=t[n];typeof s=="string"?Reflect.has(this,s+"Changed")&&this.d(this[s+"Changed"].don(()=>{console.warn(`注意:${this.typeName} 的 ${s} 属性下版本将会被移除!`)})):Object.keys(s).forEach(o=>{Reflect.has(this,o+"Changed")&&this.d(this[o+"Changed"].don(l=>{const d=s[o];typeof d=="string"?console.warn(`注意:${this.typeName} 的 ${o} 属性下版本将会被移除!`):Object.keys(d).forEach((f=>{l===f&&console.warn(`注意:${this.typeName} 的 ${o} 属性值 ${f} 下版本将会被移除,推荐使用属性值 ${d[f]}`)}))}))})}}get flyInEvent(){return this._flyInEvent}flyIn(t=1){this._flyInEvent.emit(t,Se._lastFlyInId)}get flyToEvent(){return this._flyToEvent}flyTo(t=1){this._flyToEvent.emit(t,Se._lastFlyToId)}get flyOverEvent(){return this._flyOverEvent}get pickedEvent(){return this._pickedEvent}get calcFlyToParamEvent(){return this._calcFlyToParamEvent}calcFlyToParam(){this._calcFlyToParamEvent.emit()}get calcFlyInParamEvent(){return this._calcFlyInParamEvent}calcFlyInParam(){this._calcFlyInParamEvent.emit()}emptyFlyToParam(){this.flyToParam=void 0}emptyFlyInParam(){this.flyInParam=void 0}async getBoundSphere(t){return await t.getBoundSphere(this.id)}getESProperties(){const t={...super.getESProperties()};return{...t,general:[...t.general,new nt([this,"show"],"是否显示",Se.defaults.show),new nt([this,"collision"],"开启碰撞",Se.defaults.collision),new nt([this,"allowPicking"],"允许拾取",Se.defaults.allowPicking),new kt("保存观察视角",()=>this.calcFlyToParam(),[]),new kt("清空飞向参数",()=>this.emptyFlyToParam(),[]),new kt("保存飞入参数",()=>this.calcFlyInParam(),[]),new kt("清空飞入参数",()=>this.emptyFlyInParam(),[])],more:[...t.more,new yt("飞行定位"),new kt("飞向",n=>this.flyTo(n),[1],"flyTo"),new Mt([this,"flyToParam"],"飞行参数",void 0,void 0,!0),new q([this,"flyToDistance"],"flyToDistance",void 0,!0),new q([this,"flyToHeading"],"flyToHeading",void 0,!0),new q([this,"flyToPitch"],"flyToPitch",void 0,!0),new q([this,"flyToFlyDuration"],"flyToFlyDuration",void 0,!0),new q([this,"flyToHDelta"],"flyToHDelta",void 0,!0),new q([this,"flyToPDelta"],"flyToPDelta",void 0,!0),new yt("飞入参数"),new kt("飞入",n=>this.flyIn(n),[1],"flyIn"),new Mt([this,"flyInParam"],"飞入参数",void 0,void 0,!0)]}}get flyToDistance(){return this.flyToParam&&this.flyToParam.distance}get flyToHeading(){return this.flyToParam&&this.flyToParam.heading}get flyToPitch(){return this.flyToParam&&this.flyToParam.pitch}get flyToFlyDuration(){return this.flyToParam&&this.flyToParam.flyDuration}get flyToHDelta(){return this.flyToParam&&this.flyToParam.hDelta}get flyToPDelta(){return this.flyToParam&&this.flyToParam.pDelta}get flyToDistanceChanged(){return this.flyToParamChanged}get flyToHeadingChanged(){return this.flyToParamChanged}get flyToPitchChanged(){return this.flyToParamChanged}get flyToFlyDurationChanged(){return this.flyToParamChanged}get flyToHDeltaChanged(){return this.flyToParamChanged}get flyToPDeltaChanged(){return this.flyToParamChanged}set flyToDistance(t){this.flyToParam=t!==void 0?{...this.flyToParam??Se.defaultFlyToParam,distance:t}:void 0}set flyToHeading(t){this.flyToParam=t!==void 0?{...this.flyToParam??Se.defaultFlyToParam,heading:t}:void 0}set flyToPitch(t){this.flyToParam=t!==void 0?{...this.flyToParam??Se.defaultFlyToParam,pitch:t}:void 0}set flyToFlyDuration(t){this.flyToParam=t!==void 0?{...this.flyToParam??Se.defaultFlyToParam,flyDuration:t}:void 0}set flyToHDelta(t){this.flyToParam=t!==void 0?{...this.flyToParam??Se.defaultFlyToParam,hDelta:t}:void 0}set flyToPDelta(t){this.flyToParam=t!==void 0?{...this.flyToParam??Se.defaultFlyToParam,pDelta:t}:void 0}};p(Se,"createDefaultProps",()=>({...St.createDefaultProps(),show:!0,collision:!0,allowPicking:!1,flyToParam:re(void 0),flyInParam:re(void 0)})),p(Se,"type",Se.register("ESVisualObject",Se,{chsName:"可视化对象",tags:["ESObjects","base"],description:"可视化对象"})),p(Se,"supportEditingModes",[]),p(Se,"defaultFlyToParam",{distance:0,heading:0,pitch:0,flyDuration:1,hDelta:0,pDelta:0}),p(Se,"defaultFlyInParam",{position:[0,0,0],rotation:[0,0,0],flyDuration:1}),p(Se,"_lastFlyInId",0),p(Se,"_lastFlyToId",0);let Ht=Se;class ym extends st{constructor(){super();p(this,"_data",this.dv(it(void 0)))}set data(t){this._data.value=t}get data(){return this._data.value}get dataChanged(){return this._data.changed}}class _m extends st{constructor(){super(...arguments);p(this,"_dragStartEvent",this.dv(new H));p(this,"_dragOverEvent",this.dv(new H));p(this,"_dragLeaveEvent",this.dv(new H));p(this,"_dropEvent",this.dv(new H))}dragStart(t){this._dragStartEvent.emit(t)}dragOver(t){this._dragOverEvent.emit(t)}dragLeave(t){this._dragLeaveEvent.emit(t)}drop(t){this._dropEvent.emit(t)}}function dE(i,e){e&&(Reflect.has(e,"editing")?e.editing=!0:Reflect.has(e,"positionEditing")&&(e.positionEditing=!0))}function fE(i){["Czm3DTiles","View","ESCameraView","OlView","GeoCameraController"].includes(i.typeName)||(Reflect.has(i,"editing")?i.editing=!0:Reflect.has(i,"positionEditing")&&(i.positionEditing=!0)),typeof i.execOnCreating=="function"&&i.execOnCreating()}function al(i,e){_i(i,"__treeItem")&&console.error("setSceneObjectTreeItem error!"),yn(i,"__treeItem",e)}function gE(i){return _i(i,"__treeItem")}function pE(i){if(!(i.startsWith("./")||i.startsWith("../")||i.startsWith("/")))return i;const e=document.createElement("a");e.href=i;const t=e.href;return e.remove(),t}function Nc(i){if(typeof i!="string")return!1;try{const e=JSON.parse(i);return typeof e=="object"&&e!==null}catch{return!1}}function mE(i){try{return new DOMParser().parseFromString(i,"application/xml").getElementsByTagName("parsererror").length===0}catch{return!1}}function vE(i){return i instanceof Function?i():i}function wm(i,e){for(let t of i)if(e.includes(t))return!0;return!1}function Fo(i,e){const t=i,n=e;return t===void 0||t.length===0||n===void 0||n.length===0?!0:wm(t,n)}function yE(i){const e=setTimeout(()=>{i(),clearTimeout(e)})}function oa(i){let e=i%360;return e=e<0?360+e:e,e}function Em(i){return oa(i+180)-180}function ol(i,e,t){let n=oa(i),s=oa(e);Math.abs(n-s)>180&&(n<s?n+=360:s+=360);const o=n*(1-t)+s*t;return Em(o)}function Rc(i,e,t,n){return n=n||[0,0,0],n[0]=ol(i[0],e[0],t),n[1]=ol(i[1],e[1],t),n[2]=ol(i[2],e[2],t),n}function Sm(i,e,t="editing"){const n=new st;i.ad(n);const s=e.bind(i);return n.ad(new xe(i.activeViewerChanged,()=>{const o=new st;let h=i.activeViewer;return h?(o.ad(i[`${t}Changed`].don(()=>{var l;i[`${t}`]?s():(l=(i.components.main??i).editingID)!=null&&l.includes("inner")&&i.activeViewer&&i.activeViewer.stopEditing()})),o.ad(h.editingEvent.don(l=>{if(l.objectIDs.includes(i.id)&&l.type==="end"){const d=i.components.main??i;d.editingID&&(l.editingID.includes(d.editingID)?(d.editingID=void 0,i[t]=!1):i[t]=!d.editingID.includes("outer"))}}))):o.ad(i[`${t}Changed`].don(()=>{i[`${t}`]=!1})),o})),i[`${t}`]&&s(),n}function _E(i){return i}function wE(i){if(i==null)return _E;var e,t,n=i.scale[0],s=i.scale[1],o=i.translate[0],h=i.translate[1];return function(l,d){d||(e=t=0);var f=2,v=l.length,m=new Array(v);for(m[0]=(e+=l[0])*n+o,m[1]=(t+=l[1])*s+h;f<v;)m[f]=l[f],++f;return m}}function EE(i,e){for(var t,n=i.length,s=n-e;s<--n;)t=i[s],i[s++]=i[n],i[n]=t}function SE(i,e){return typeof e=="string"&&(e=i.objects[e]),e.type==="GeometryCollection"?{type:"FeatureCollection",features:e.geometries.map(function(t){return xm(i,t)})}:xm(i,e)}function xm(i,e){var t=e.id,n=e.bbox,s=e.properties==null?{}:e.properties,o=xE(i,e);return t==null&&n==null?{type:"Feature",properties:s,geometry:o}:n==null?{type:"Feature",id:t,properties:s,geometry:o}:{type:"Feature",id:t,bbox:n,properties:s,geometry:o}}function xE(i,e){var t=wE(i.transform),n=i.arcs;function s(v,m){m.length&&m.pop();for(var y=n[v<0?~v:v],w=0,S=y.length;w<S;++w)m.push(t(y[w],w));v<0&&EE(m,S)}function o(v){return t(v)}function h(v){for(var m=[],y=0,w=v.length;y<w;++y)s(v[y],m);return m.length<2&&m.push(m[0]),m}function l(v){for(var m=h(v);m.length<4;)m.push(m[0]);return m}function d(v){return v.map(l)}function f(v){var m=v.type,y;switch(m){case"GeometryCollection":return{type:m,geometries:v.geometries.map(f)};case"Point":y=o(v.coordinates);break;case"MultiPoint":y=v.coordinates.map(o);break;case"LineString":y=h(v.arcs);break;case"MultiLineString":y=v.arcs.map(h);break;case"Polygon":y=d(v.arcs);break;case"MultiPolygon":y=v.arcs.map(d);break;default:return null}return{type:m,coordinates:y}}return f(e)}function bm(i){var t;const e=Array.isArray(i)?"feature":((t=i.type)==null?void 0:t.toLowerCase())??"";switch(e){case"geometrycollection":return bE(i);case"topology":const n=i.objects,s=[];for(const o in n){const h=SE(i,n[o]);s.push(...h.features)}return{type:"FeatureCollection",features:s};case"feature":return{type:"FeatureCollection",features:Array.isArray(i)?i:[i]};case"featurecollection":return i;default:return console.warn(`GeoJson数据转换可能有误,数据类型${e}`),{type:"FeatureCollection",features:Array.isArray(i.features)?i.features:[]}}}function bE(i,e){const t=[],n=i.geometries||[];function s(o,h={}){!o||!o.type||(o.type==="GeometryCollection"&&Array.isArray(o.geometries)?o.geometries.forEach(l=>s(l,h)):t.push({type:"Feature",geometry:o,properties:{...o.properties||{},...h}}))}return n.forEach(o=>s(o,{})),{type:"FeatureCollection",features:t}}function PE(i){const e=i.cloneNode(!0);e.style.position="fixed",e.style.visibility="hidden",e.style.pointerEvents="none",e.style.top="0",e.style.left="0",e.style.display="inline-block",document.body.appendChild(e);const t=e.getBoundingClientRect();return document.body.removeChild(e),{x:t.x,y:t.y,width:t.width,height:t.height}}function CE(i,e,t=!1){var m,y,w,S,T,N;const n=[],s=[],o=[],h=[],l=[],d=new Set,f=new Map;if(e!=null&&e.features)for(const j of e.features){const C=((m=j.id)==null?void 0:m.toString())||((w=(y=j.properties)==null?void 0:y.id)==null?void 0:w.toString());C&&(d.add(C),f.set(C,j))}if(i!=null&&i.features)for(const j of i.features){const C=((S=j.id)==null?void 0:S.toString())||((N=(T=j.properties)==null?void 0:T.id)==null?void 0:N.toString());if(C)if(d.has(C)){if(t){const k=f.get(C);k&&Pm(k,j)?h.push(C):l.push(C)}n.push(C)}else s.push(C)}for(const j of d)n.includes(j)||o.push(j);const v={unchangedIds:n,newIds:s,removedIds:o};return t&&(v.contentUnchangedIds=h,v.contentUpdatedIds=l),v}function Pm(i,e){return Cm(i.geometry,e.geometry)?JSON.stringify(i.properties)===JSON.stringify(e.properties):!1}function Cm(i,e){if(i===e)return!0;if(!i||!e||i.type!==e.type)return!1;const t=i.coordinates,n=e.coordinates;if(i.type==="Point")return IE(t,n);if(i.type==="LineString"||i.type==="MultiPoint")return hl(t,n);if(i.type==="Polygon"){if(t.length!==n.length)return!1;for(let s=0;s<t.length;s++)if(!hl(t[s],n[s]))return!1;return!0}if(i.type==="MultiLineString"){if(t.length!==n.length)return!1;for(let s=0;s<t.length;s++)if(!hl(t[s],n[s]))return!1;return!0}if(i.type==="MultiPolygon"){if(t.length!==n.length)return!1;for(let s=0;s<t.length;s++){const o=t[s],h=n[s];if(o.length!==h.length)return!1;for(let l=0;l<o.length;l++)if(!hl(o[l],h[l]))return!1}return!0}return JSON.stringify(i)===JSON.stringify(e)}function IE(i,e){if(!i||!e)return i===e;if(i.length!==e.length)return!1;for(let t=0;t<i.length;t++)if(Math.abs(i[t]-e[t])>1e-10)return!1;return!0}function hl(i,e){if(i===e)return!0;if(!i||!e||i.length!==e.length)return!1;for(let t=0;t<i.length;t++){const n=i[t],s=e[t];if(n.length!==s.length)return!1;for(let o=0;o<n.length;o++)if(Math.abs(n[o]-s[o])>1e-10)return!1}return!0}class Ac extends st{constructor(t){super();p(this,"_sceneObject",this.dv(it(void 0)));this._id=t,this.d(()=>{this._sceneObject.value=void 0});const n=St.getSceneObjById(this._id);n&&(this._sceneObject.value=n),this.d(St.context.sceneObjCreatedEvent.don(s=>{s.id===this._id&&(this._sceneObject.value=s)})),this.d(St.context.sceneObjToDestroyEvent.don(s=>{s.id===this._id&&(this._sceneObject.value=void 0)}))}get sceneObject(){return this._sceneObject.value}get sceneObjectChanged(){return this._sceneObject.changed}get id(){return this._id}}class ME extends st{constructor(t,n){super();p(this,"_sofi");this._id=t,this._sofi=this.dv(new Ac(this._id));{const s=()=>{n.sceneObject=this._sofi.sceneObject};s(),this.d(this._sofi.sceneObjectChanged.don(s))}}}class Im extends st{constructor(){super();p(this,"_id",this.dv(it(void 0)));p(this,"_sceneObject",this.dv(it(void 0)));p(this,"_resetting",this.dv(new xe(this.idChanged,()=>{const{id:t}=this;if(t===void 0||t===""){this.sceneObject=void 0;return}return new ME(t,this)})))}get id(){return this._id.value}get idChanged(){return this._id.changed}set id(t){this._id.value=t}get sceneObject(){return this._sceneObject.value}get sceneObjectChanged(){return this._sceneObject.changed}set sceneObject(t){this._sceneObject.value=t}get resetting(){return this._resetting}}class TE extends st{constructor(t,n,s,o){super();p(this,"_sceneObjectId",this.dv(new Im));this._id=t,this._startTimeStamp=n,this._duration=s,this._parent=o,this._sceneObjectId.id=this._id;const h=()=>{if(!this.player)return;const{currentTime:l=0}=this._parent,d=l-this._startTimeStamp;this.player.currentTime=Qh(d,0,this._duration)*(this.player.speed??1)};h(),this.d(this._parent.currentTimeChanged.don(h)),this.d(this.playerChanged.don(h))}get player(){return this._sceneObjectId.sceneObject instanceof Di?this._sceneObjectId.sceneObject:void 0}get playerChanged(){return this._sceneObjectId.sceneObjectChanged}}const kE=`
|
|
23
|
+
`).join(" ")}`)):this._sceneObjRefs.set(o,[s]);const f=this.getLastSceneObject(o);this._refs[o]=f,this._refsChanged.emit(f,l)}};this.d(t.sceneObjCreatedEvent.don(s=>{const o=(h,l)=>n(s,h,l);s.ref&&o(s.ref,void 0),s.refChanged.don(o)})),this.d(t.sceneObjToDestroyEvent.don(s=>{s.ref&&n(s,void 0,s.ref)}))}get sceneObjRefs(){return this._sceneObjRefs}get refs(){return this._refs}get refsChanged(){return this._refsChanged}getLastSceneObject(t){const n=this.getSceneObjects(t);if(n)return n[n.length-1]}getSceneObjects(t){const n=this._sceneObjRefs.get(t);if(!(!n||n.length===0))return n}}class oE extends st{constructor(){super();p(this,"_esObjConstructors",new Map);p(this,"_sceneObjs",new Map);p(this,"_sceneObjCreatedEvent",new H);p(this,"_sceneObjToDestroyEvent",new H);p(this,"_refsManager",this.dv(new aE(this)));p(this,"_environmentVariables",window.ESSDK_ENV||{});p(this,"_environmentVariablesChanged",this.dv(new H))}get typeNames(){return this._esObjConstructors.keys()}get sceneObjs(){return this._sceneObjs.values()}get sceneObjCreatedEvent(){return this._sceneObjCreatedEvent}get sceneObjToDestroyEvent(){return this._sceneObjToDestroyEvent}get refsManager(){return this._refsManager}get $refs(){return this._refsManager.refs}register(t,n,s){return this._esObjConstructors.has(t)&&console.warn(`register warn: ${t} has registered ! will be override!`),this._esObjConstructors.set(t,n),s&&yn(n,"__sceneObjExtraInfo",s),t}_addSceneObject(t){this._sceneObjs.set(t.id,t),this._sceneObjCreatedEvent.emit(t),t.d(()=>this._deleteSceneObject(t))}addSceneObject(t){this._addSceneObject(t)}_deleteSceneObject(t){this._sceneObjToDestroyEvent.emit(t),this._sceneObjs.delete(t.id)}deleteSceneObject(t){this._deleteSceneObject(t)}createSceneObjectFromClass(t,n){if(!n||this._sceneObjs.has(n)){const o=Zr();n&&console.warn(`已存在相同id的对象!id自动变更!${n} -> ${o} 请注意:id变更可能导致引用失效!`),n=o}if(!n)throw new Error("id不能为空!");const s=new t(n);return s.id!==n&&(console.warn(`sceneObj.id(${s.id}) !== id(${n}) sceneObjectType: ${s.typeName}`),console.warn("出现这种问题有可能是自定义的场景对象,没有在构造函数中传递id参数!示例如下:"),console.warn("class XXX extends XXX { constructor(id) { super(id); } }")),this._addSceneObject(s),s}createSceneObject(t,n){if(typeof t=="string"){const s=this._getSceneObjConstructor(t);if(!s){console.warn(`Cannot find SceneObjectType: ${t}`);return}return this.createSceneObjectFromClass(s,n)}else return this.createSceneObjectFromClass(t,n)}createSceneObjectFromUrl(t,n){let s;const o=t.toLowerCase();if(o.includes(".gltf")||o.includes(".glb")?s="ESGltfModel":o.includes("tileset.json")?s="ES3DTileset":o.includes("layer.json")||o.includes("ion://1")?s="ESTerrainLayer":o.includes(".jpg")||o.includes(".png")||o.includes(".jpeg")||o.includes(".webp")||o.includes("image/jpg")||o.includes("image/png")||o.includes("image/jpeg")||o.includes("image/webp")?s="ESImageLabel":(o.includes("/tilemapresource.xml")||o.includes("ion://")||o.includes("wms")||o.includes("wmts")||o.includes("{x}")||o.includes("{y}")||o.includes("{z}"))&&(s="ESImageryLayer"),!!s)return this.createSceneObjectFromJson({type:s,id:n,url:t})}createSceneObjectFromJson(t){const n=this.createSceneObject(t.type,t.id);return n&&(n.json=t),n}destroySceneObject(t){return this._deleteSceneObject(t),t.destroy(),t.isDestroyed()}getSceneObjectById(t){return this._sceneObjs.get(t)}getSceneObject(t){if(!t&&t!="")return Array.from(this._sceneObjs.values());if(typeof t=="function"){const n=[];for(const s of this._sceneObjs.values())s instanceof t&&n.push(s);return n}if(t.startsWith("ES")){const n=[];for(const s of this._sceneObjs.values())s.typeName===t&&n.push(s);return n}return this._sceneObjs.get(t)}_getSceneObjConstructor(t){const n=this._esObjConstructors.get(t);if(n)return n}getProps(t){const n=this._getSceneObjConstructor(t);if(!n){console.warn(`cannot get constructor from type: ${t}`);return}return _i(n,"__sceneObjExtraInfo")}setProps(t,n){const s=this._getSceneObjConstructor(t);if(!s){console.warn(`cannot get constructor from type: ${t}`);return}let o=_i(s,"__sceneObjExtraInfo");o||(o={},yn(s,"__sceneObjExtraInfo",o)),Object.assign(o,n)}getProp(t,n){const s=this.getProps(t);return s&&s[n]}setProp(t,n,s){this.setProps(t,{[n]:s})}get environmentVariables(){return this._environmentVariables}set environmentVariables(t){for(let[n,s]of Object.entries(t))this.setEnv(n,s)}get environmentVariablesChanged(){return this._environmentVariablesChanged}setEnv(t,n){if(this._environmentVariables[t]!==n){const s=this._environmentVariables[t];this._environmentVariables[t]=n,this._environmentVariablesChanged.emit(t,n,s)}window.ESSDK_ENV={...this._environmentVariables}}getEnv(t){return this._environmentVariables[t]}getStrFromEnv(t){return pm(t)}createEnvStrReact(t,n){return gm(t,n)}createEvnStrReact(t,n){return gm(t,n)}}const Ft=class Ft extends st{constructor(t){super();p(this,"_components",this.dv(new sl));p(this,"_viewerAttached",this.dv(new H));p(this,"_viewerDetached",this.dv(new H));p(this,"_attachedViewers",(()=>{const t=new Set;return this.d(this._viewerAttached.don(n=>{n.actived&&(this.activeViewer=n),n.ad(n.activedChanged.don(s=>{s&&t.has(n)&&(this.activeViewer=n)})),t.add(n)})),this.d(this._viewerDetached.don(n=>{t.delete(n),this.activeViewer==n&&(this.activeViewer=void 0)})),t})());p(this,"_activeViewer",this.dv(it(void 0)));p(this,"_reloadEvent",this.dv(new H));p(this,"_readyEvent",this.dv(new H));p(this,"_createdEvent",this.dv(new H));p(this,"_flushEvent",this.dv(new H));p(this,"_id");p(this,"_updateFuncReact",this.dv(it(void 0)));p(this,"_toDestroyFuncReact",this.dv(it(void 0)));p(this,"_parentID");t!==void 0&&(typeof t!="string"?console.warn(`对象id必须是字符串类型,当前id的类型是${typeof t},值为${t}`):t.trim()===""?console.warn("场景对象创建时的id不能是空字符串!"):t.trim()!==t&&console.warn(`id前后有空字符串!id: ${t}`)),this._id=t??Zr(),this._initName();{const n=()=>{if(this.execOnceFuncStr)try{Function(`"use strict";return (${this.execOnceFuncStr})`)()(this)}catch(s){console.warn(`execOnceFuncStr不能转成函数!或者函数执行时错误!id: ${this.id} ${this.typeName} error: ${s}`)}};n(),this.d(this.execOnceFuncStrChanged.don(n))}{const n=()=>{if(this.updateFuncStr)try{this.updateFunc=Function(`"use strict";return (${this.updateFuncStr})`)()}catch(o){console.warn(`updateFuncStr不能转成函数!或者函数执行时错误!id: ${this.id} ${this.typeName} error: ${o}`)}};n(),this.d(this.updateFuncStrChanged.don(n));let s;this.d(()=>s&&s.destroy()),this.d(this.updateFuncChanged.don(()=>{s&&s.cancel(),this.updateFunc&&(s=s||To(),s.restart(void 0,o=>{this.updateFunc&&this.updateFunc(this,o)}))}))}{const n=()=>{try{this.toDestroyFunc=this.toDestroyFuncStr&&Function(`"use strict";return (${this.toDestroyFuncStr})`)()||void 0}catch(s){console.warn(`toDestroyFuncStr不能转成函数!或者函数执行时错误!id: ${this.id} ${this.typeName} error: ${s}`),this.toDestroyFunc=void 0}};n(),this.d(this.toDestroyFuncStrChanged.don(n)),this.d(this.toDestroyEvent.don(()=>{this.toDestroyFunc&&this.toDestroyFunc(this)}))}}static getParentClass(){return Object.getPrototypeOf(this)}static register(t,n,s){ys(n.prototype,n.createDefaultProps);const o=n.createDefaultProps();n.defaults&&(n.defaults={});for(const h of Object.keys(o))n.defaults[h]=o[h]instanceof Ne?o[h].value:o[h];return this.innerRegister(t,n,s),t}static get envs(){return Ft.context.environmentVariables}static get $refs(){return Ft.context.refsManager.refs}get components(){return this._components}get viewerAttached(){return this._viewerAttached}get viewerDetached(){return this._viewerDetached}get attachedViewers(){return this._attachedViewers}get activeViewer(){return this._activeViewer.value}set activeViewer(t){this._activeViewer.value=t}get activeViewerChanged(){return this._activeViewer.changed}removefromViewer(t){this.attachedViewers.has(t)&&t.delete(this)}get reloadEvent(){return this._reloadEvent}reload(){this._reloadEvent.emit()}get readyEvent(){return this._readyEvent}addToViewer(t){this.attachedViewers.has(t)||t.add(this)}registerAttachedObject(t){const n=new Map;this.d(()=>{n.size>0&&console.warn("viewerPropSceneObjects.size > 0")}),this.d(this._viewerAttached.don(s=>{const o=t(s);o&&n.set(s,o)})),this.d(this._viewerDetached.don(s=>{if(!n.has(s))return;const o=n.get(s);o&&(o.destroy(),n.delete(s))}))}createAttachedObject(t){const n=new Map,s=(()=>{for(let[d,f]of n.entries())f.destroy();n.clear()}),o=d=>{const f=t(d);f&&n.set(d,f)};for(let d of this.attachedViewers)o(d);const h=this._viewerAttached.don(o),l=this._viewerDetached.don(d=>{if(!n.has(d))return;const f=n.get(d);f&&(f.destroy(),n.delete(d))});return()=>{l(),h(),s()}}registerAttachedObjectForContainer(t){this.registerAttachedObject(n=>new hE(n,t))}get createdEvent(){return this._createdEvent}get flushEvent(){return this._flushEvent}flush(){this.flushEvent.emit()}get id(){return this._id}get typeName(){return this.constructor.type}_initName(){this.name=`${this.typeName}_${(""+this.id).slice(-4)}`}get defaultProps(){return this.constructor.createDefaultProps()}_innerGetJson(t=!0){const n={id:this.id,type:this.typeName};for(let s of Object.keys(this.defaultProps))if(t){let o,h=this.defaultProps[s];h instanceof Ne?o=h.equals(this[s]):o=h===this[s],o||(n[s]=this[s])}else n[s]=this[s];return n}_innerSetJson(t,n,s){if(!(t instanceof Object)||t.type&&t.type!==this.typeName){console.error(`value.type && value.type${t.type} !== this.typeName${this.typeName}`);return}t.id&&t.id!==this.id&&console.warn(`value.id === undefined || value.id${t.id} !== this.id(${this.id})`);const o=n||[];o.push("id","type");const h=Object.keys(this.defaultProps).filter(l=>!o.includes(l));for(let l of h)if(l in t)this[l]=t[l]===null?void 0:t[l];else if(!(s??!1)){let d=this.defaultProps[l];d instanceof Ne&&(d=d.value),this[l]=d}}get completeJson(){return this._innerGetJson(!1)}get json(){return this._innerGetJson()}set json(t){this._innerSetJson(t)}get _jsonStr(){return JSON.stringify(this.json,null,4)}set _jsonStr(t){this._innerSetJson(JSON.parse(t))}get updateFunc(){return this._updateFuncReact.value}set updateFunc(t){this._updateFuncReact.value=t}get updateFuncChanged(){return this._updateFuncReact.changed}get toDestroyFunc(){return this._toDestroyFuncReact.value}set toDestroyFunc(t){this._toDestroyFuncReact.value=t}get toDestroyFuncChanged(){return this._toDestroyFuncReact.changed}get parentID(){return this._parentID??this.id}set parentID(t){this._parentID=t}getESProperties(){return{defaultMenu:"general",basic:[],general:[new Tt([this,"typeName"],"类型",void 0,!1,!0),new Tt([this,"id"],"id",void 0,!1,!0),new Tt([this,"name"],"名称"),new Tc("JSON",()=>this._jsonStr,t=>t&&(this._jsonStr=t))],dataSource:[],location:[],coordinate:[],style:[],more:[new Tt([this,"ref"],"ref",void 0,!0),new Mt([this,"extras"],"extras",{},void 0,!0)]}}};p(Ft,"context",new oE),p(Ft,"innerRegister",Ft.context.register.bind(Ft.context)),p(Ft,"defaults",{}),p(Ft,"createDefaultProps",()=>({name:"未命名场景对象",ref:void 0,extras:At(void 0),devTags:Wt(void 0),execOnceFuncStr:void 0,updateFuncStr:void 0,toDestroyFuncStr:void 0})),p(Ft,"type",Ft.register("ESSceneObject",Ft,{chsName:"场景类",tags:["ESObjects","base"],description:""})),p(Ft,"create",Ft.context.createSceneObject.bind(Ft.context)),p(Ft,"createFromUrl",Ft.context.createSceneObjectFromUrl.bind(Ft.context)),p(Ft,"createFromClass",Ft.context.createSceneObjectFromClass.bind(Ft.context)),p(Ft,"createFromJson",Ft.context.createSceneObjectFromJson.bind(Ft.context)),p(Ft,"destroySceneObject",Ft.context.destroySceneObject.bind(Ft.context)),p(Ft,"getSceneObjById",Ft.context.getSceneObjectById.bind(Ft.context)),p(Ft,"getSceneObj",Ft.context.getSceneObject.bind(Ft.context)),p(Ft,"getEnv",Ft.context.getEnv.bind(Ft.context)),p(Ft,"setEnv",Ft.context.setEnv.bind(Ft.context)),p(Ft,"getStrFromEnv",Ft.context.getStrFromEnv.bind(Ft.context)),p(Ft,"getSceneObjectById",Ft.context.getSceneObjectById.bind(Ft.context)),p(Ft,"getSceneObject",Ft.context.getSceneObject.bind(Ft.context));let St=Ft;class hE extends st{constructor(e,t){super(),this.dv(new xe(e.subContainerChanged,()=>{if(e.subContainer)return t(e,e.subContainer)}))}}const Mu=class Mu extends st{constructor(t,n,s){super();p(this,"_id",++Mu._accumId);this._name=t,this._description=n,this._callFunction=s}get id(){return this._id}get name(){return this._name}get description(){return this._description}get callFunction(){return this._callFunction}};p(Mu,"_accumId",-1);let Es=Mu;class Ic extends Es{constructor(e,t,n,s,o,h){super(e,t,h??(()=>{})),this._withUndefined=n,this._readonly=s,this._defaultValue=o}get withUndefined(){return this._withUndefined}get readonly(){return this._readonly}get defaultValue(){return this._defaultValue instanceof Function?this._defaultValue():this._defaultValue}}class ei extends Ic{constructor(t,n,s,o,h,l,d){var v;const f=t instanceof Ne?"未获取到属性名":t[1].toString();super(n??f,l??f,o??!1,h??!1,s,d);p(this,"_propName");p(this,"_typeName");this._reactVar=t,this._propName=f;try{this._typeName=t instanceof Ne?"未获取到对象类型":(v=t[0])==null?void 0:v.typeName}catch{this._typeName="未获取到对象类型"}}get reactVar(){return this._reactVar}get propName(){return this._propName}get typeName(){return this._typeName}}class nt extends ei{get type(){return"BooleanProperty"}}class Tt extends ei{get type(){return"StringProperty"}}class q extends ei{get type(){return"NumberProperty"}}class ge extends ei{get type(){return"Number2Property"}}class Te extends ei{get type(){return"Number3Property"}}class ui extends ei{get type(){return"Number4Property"}}class jt extends ui{get type(){return"ColorProperty"}}class rl extends q{get type(){return"DashPatternProperty"}}class Ei extends ei{get type(){return"DateProperty"}}class Mc extends ei{get type(){return"DatesProperty"}}class yt extends Es{constructor(t,n,s){super(t??"",s??"");p(this,"_placement");this._placement=n}get type(){return"DivideProperty"}get placement(){return this._placement}}class xt extends ei{constructor(e,t,n,s,o,h,l){super(e,n,s,o,h,l),this._enums=t}get type(){return"EnumProperty"}get enums(){return this._enums}}class Ai extends ei{constructor(e,t,n,s,o,h,l){super(e,t,n,o,h,l),this._sampleValue=s}get sampleValue(){return this._sampleValue}get type(){return"EvalStringProperty"}}class Lo extends ei{constructor(e,t,n,s,o,h,l){super(e,t,n,o,h,l),this._sampleValue=s}get sampleValue(){return this._sampleValue}get type(){return"LongStringProperty"}}class kt extends Es{constructor(t,n,s,o){const h=t??"Unnamed Function";super(h,o??h);p(this,"_paramsLength");this._func=n,this._defaultParams=s,this._paramsLength=this._func.length??0}get paramsLength(){return this._paramsLength}get defaultParams(){return this._defaultParams}get isOpen(){return this._defaultParams.length!==this._paramsLength}get func(){return this._func}run(...t){this._func(...t)}get type(){return"MethodProperty"}}class ke extends ei{constructor(e,t,n,s,o,h,l,d){super(e,s,o,h,l,d),this._step=t,this._minMax=n}get type(){return"NumberSliderProperty"}get minMax(){return this._minMax}get step(){return this._step}}class en extends Te{get type(){return"PositionProperty"}}class ra extends Te{get type(){return"RotationProperty"}}function lE(i,e){const[t,n,s]=wo(i),[o,h,l]=wo(e),d=it((t()??0)/(o()??3e3)),f=()=>{const v=d.value,m=o()??3e3,y=t()??0;if(!Number.isFinite(m)||!Number.isFinite(y)){console.warn(`duration || currentTime error: duration: ${m} currentTime: ${y}`);return}Math.abs(v*m-y)<.001||(m<=0?d.value=0:d.value=y/m)};return d.dispose(s.disposableOn(f)),d.dispose(l.disposableOn(f)),d.dispose(d.changed.disposableOn(()=>{const v=d.value,m=o()??3e3,y=t()??0;if(!Number.isFinite(m)||!Number.isFinite(y)){console.warn(`duration || currentTime error: duration: ${m} currentTime: ${y}`);return}Math.abs(v*m-y)<.001||n(v*m)})),d}class aa extends Es{constructor(t,n,s,o,h,l){super(o??"播放器",l??"播放器");p(this,"_defaults",{playing:!1,ratio:0,loop:!1});this._playingReact=t,this._ratioReact=n,this._loopReact=s,h&&(this._defaults.playing=h.playing??this._defaults.playing,this._defaults.ratio=h.ratio??this._defaults.ratio,this._defaults.loop=h.loop??this._defaults.loop)}get type(){return"PlayerProperty"}get playingReact(){return this._playingReact}get ratioReact(){return this._ratioReact}get loopReact(){return this._loopReact}get defaults(){return this._defaults}}p(aa,"createPlayingRatio",lE);class mm extends Es{constructor(t,n,s,o,h,l){const d=o??"视角播放器";super(d,l??d);p(this,"_defaults",{playing:!1,loop:!1});this._playingReact=t,this._stopFn=n,this._loopReact=s,h&&(this._defaults.playing=h.playing??this._defaults.playing,this._defaults.loop=h.loop??this._defaults.loop)}get type(){return"ViewPlayerProperty"}get playingReact(){return this._playingReact}get loopReact(){return this._loopReact}get stopFn(){return this._stopFn}get defaults(){return this._defaults}}class ue extends ei{constructor(e,t,n,s,o,h,l){super(e,t,n,o,h,l),this._sampleValue=s}get sampleValue(){return this._sampleValue}get type(){return"JsonArrayProperty"}}class Mt extends ei{constructor(e,t,n,s,o,h,l){super(e,t,n,o,h,l),this._sampleValue=s}get sampleValue(){return this._sampleValue}get type(){return"JsonProperty"}}class Tc extends Ic{constructor(e,t,n,s,o,h){super(e,h??e,s??!1,o??!1),this._getFunc=t,this._setFunc=n}get getFunc(){return this._getFunc}get setFunc(){return this._setFunc}get type(){return"GetSetProperty"}}var dt=(i=>(i.Place="place",i.BrushErase="brushErase",i.Translation="translation",i.Rotation="rotation",i.Scale="scale",i.DoublePointsAppend="doublePointsAppend",i.DoublePointsModify="doublePointsModify",i.CircularAppend="circularAppend",i.CircularInsert="circularInsert",i.LineStringAppend="lineStringAppend",i.LineStringInsert="lineStringInsert",i.ScatterAppend="scatterAppend",i.ScatterModify="scatterModify",i.VisibilityAppend="visibilityAppend",i.VisibilityModify="visibilityModify",i.HeightModify="heightModify",i.SinglePoint="singlePoint",i.DoublePoints="doublePoints",i))(dt||{});const kc=[["地形","TERRAIN"],["3D Tiles","CESIUM_3D_TILE"],["地形和3D Tiles","BOTH"]],Oc=[["直箭头","straightArrow"],["燕尾箭头","swallowTailArrow"]];var vm=(i=>(i.DECIMAL_DEGREE="DECIMAL_DEGREE",i.DEGREES_DECIMAL_MINUTES="DEGREES_DECIMAL_MINUTES",i.SEXAGESIMAL_DEGREE="SEXAGESIMAL_DEGREE",i))(vm||{});class uE{constructor(e){this.childPickedInfo=e}}class cE{constructor(e,t,n,s,o,h){this.pickResult=e,this.sceneObject=t,this.tilesetPickInfo=n,this.geojsonPickInfo=s,this.attachedInfo=o,this.screenPosition=h}assign(e){e!=null&&e.pickedResult&&(this.pickResult=e.pickedResult),e!=null&&e.sceneObject&&(this.sceneObject=e.sceneObject),e!=null&&e.tilesetPickInfo&&(this.tilesetPickInfo=e.tilesetPickInfo),e!=null&&e.geojsonPickInfo&&(this.geojsonPickInfo=e.geojsonPickInfo),e!=null&&e.attachedInfo&&(this.attachedInfo=e.attachedInfo),e!=null&&e.screenPosition&&(this.screenPosition=e.screenPosition)}}const Se=class Se extends St{constructor(t){super(t);p(this,"_editing",this.dv(it(!1)));p(this,"editingID");p(this,"editingBindMode","singlePoint");p(this,"_deprecated",[]);p(this,"_flyInEvent",this.dv(new H));p(this,"_flyToEvent",this.dv(new H));p(this,"_flyOverEvent",this.disposeVar(new H));p(this,"_pickedEvent",this.dv(new H));p(this,"_calcFlyToParamEvent",this.dv(new H));p(this,"_calcFlyInParamEvent",this.dv(new H));p(this,"useCalcFlyToParamInESObjectWithLocation",!1);Sm(this,this.updateEditing)}supportEditingModes(){return this.constructor.supportEditingModes}get editing(){return this._editing.value}set editing(t){this._editing.value=t}get editingChanged(){return this._editing.changed}updateEditing(){}_deprecatedWarning(){const t=this._deprecated;for(let n=0;n<t.length;n++){const s=t[n];typeof s=="string"?Reflect.has(this,s+"Changed")&&this.d(this[s+"Changed"].don(()=>{console.warn(`注意:${this.typeName} 的 ${s} 属性下版本将会被移除!`)})):Object.keys(s).forEach(o=>{Reflect.has(this,o+"Changed")&&this.d(this[o+"Changed"].don(l=>{const d=s[o];typeof d=="string"?console.warn(`注意:${this.typeName} 的 ${o} 属性下版本将会被移除!`):Object.keys(d).forEach((f=>{l===f&&console.warn(`注意:${this.typeName} 的 ${o} 属性值 ${f} 下版本将会被移除,推荐使用属性值 ${d[f]}`)}))}))})}}get flyInEvent(){return this._flyInEvent}flyIn(t=1){this._flyInEvent.emit(t,Se._lastFlyInId)}get flyToEvent(){return this._flyToEvent}flyTo(t=1){this._flyToEvent.emit(t,Se._lastFlyToId)}get flyOverEvent(){return this._flyOverEvent}get pickedEvent(){return this._pickedEvent}get calcFlyToParamEvent(){return this._calcFlyToParamEvent}calcFlyToParam(){this._calcFlyToParamEvent.emit()}get calcFlyInParamEvent(){return this._calcFlyInParamEvent}calcFlyInParam(){this._calcFlyInParamEvent.emit()}emptyFlyToParam(){this.flyToParam=void 0}emptyFlyInParam(){this.flyInParam=void 0}async getBoundSphere(t){return await t.getBoundSphere(this.id)}getESProperties(){const t={...super.getESProperties()};return{...t,general:[...t.general,new nt([this,"show"],"是否显示",Se.defaults.show),new nt([this,"collision"],"开启碰撞",Se.defaults.collision),new nt([this,"allowPicking"],"允许拾取",Se.defaults.allowPicking),new kt("保存观察视角",()=>this.calcFlyToParam(),[]),new kt("清空飞向参数",()=>this.emptyFlyToParam(),[]),new kt("保存飞入参数",()=>this.calcFlyInParam(),[]),new kt("清空飞入参数",()=>this.emptyFlyInParam(),[])],more:[...t.more,new yt("飞行定位"),new kt("飞向",n=>this.flyTo(n),[1],"flyTo"),new Mt([this,"flyToParam"],"飞行参数",void 0,void 0,!0),new q([this,"flyToDistance"],"flyToDistance",void 0,!0),new q([this,"flyToHeading"],"flyToHeading",void 0,!0),new q([this,"flyToPitch"],"flyToPitch",void 0,!0),new q([this,"flyToFlyDuration"],"flyToFlyDuration",void 0,!0),new q([this,"flyToHDelta"],"flyToHDelta",void 0,!0),new q([this,"flyToPDelta"],"flyToPDelta",void 0,!0),new yt("飞入参数"),new kt("飞入",n=>this.flyIn(n),[1],"flyIn"),new Mt([this,"flyInParam"],"飞入参数",void 0,void 0,!0)]}}get flyToDistance(){return this.flyToParam&&this.flyToParam.distance}get flyToHeading(){return this.flyToParam&&this.flyToParam.heading}get flyToPitch(){return this.flyToParam&&this.flyToParam.pitch}get flyToFlyDuration(){return this.flyToParam&&this.flyToParam.flyDuration}get flyToHDelta(){return this.flyToParam&&this.flyToParam.hDelta}get flyToPDelta(){return this.flyToParam&&this.flyToParam.pDelta}get flyToDistanceChanged(){return this.flyToParamChanged}get flyToHeadingChanged(){return this.flyToParamChanged}get flyToPitchChanged(){return this.flyToParamChanged}get flyToFlyDurationChanged(){return this.flyToParamChanged}get flyToHDeltaChanged(){return this.flyToParamChanged}get flyToPDeltaChanged(){return this.flyToParamChanged}set flyToDistance(t){this.flyToParam=t!==void 0?{...this.flyToParam??Se.defaultFlyToParam,distance:t}:void 0}set flyToHeading(t){this.flyToParam=t!==void 0?{...this.flyToParam??Se.defaultFlyToParam,heading:t}:void 0}set flyToPitch(t){this.flyToParam=t!==void 0?{...this.flyToParam??Se.defaultFlyToParam,pitch:t}:void 0}set flyToFlyDuration(t){this.flyToParam=t!==void 0?{...this.flyToParam??Se.defaultFlyToParam,flyDuration:t}:void 0}set flyToHDelta(t){this.flyToParam=t!==void 0?{...this.flyToParam??Se.defaultFlyToParam,hDelta:t}:void 0}set flyToPDelta(t){this.flyToParam=t!==void 0?{...this.flyToParam??Se.defaultFlyToParam,pDelta:t}:void 0}};p(Se,"createDefaultProps",()=>({...St.createDefaultProps(),show:!0,collision:!0,allowPicking:!1,flyToParam:se(void 0),flyInParam:se(void 0)})),p(Se,"type",Se.register("ESVisualObject",Se,{chsName:"可视化对象",tags:["ESObjects","base"],description:"可视化对象"})),p(Se,"supportEditingModes",[]),p(Se,"defaultFlyToParam",{distance:0,heading:0,pitch:0,flyDuration:1,hDelta:0,pDelta:0}),p(Se,"defaultFlyInParam",{position:[0,0,0],rotation:[0,0,0],flyDuration:1}),p(Se,"_lastFlyInId",0),p(Se,"_lastFlyToId",0);let Ht=Se;class ym extends st{constructor(){super();p(this,"_data",this.dv(it(void 0)))}set data(t){this._data.value=t}get data(){return this._data.value}get dataChanged(){return this._data.changed}}class _m extends st{constructor(){super(...arguments);p(this,"_dragStartEvent",this.dv(new H));p(this,"_dragOverEvent",this.dv(new H));p(this,"_dragLeaveEvent",this.dv(new H));p(this,"_dropEvent",this.dv(new H))}dragStart(t){this._dragStartEvent.emit(t)}dragOver(t){this._dragOverEvent.emit(t)}dragLeave(t){this._dragLeaveEvent.emit(t)}drop(t){this._dropEvent.emit(t)}}function dE(i,e){e&&(Reflect.has(e,"editing")?e.editing=!0:Reflect.has(e,"positionEditing")&&(e.positionEditing=!0))}function fE(i){["Czm3DTiles","View","ESCameraView","OlView","GeoCameraController"].includes(i.typeName)||(Reflect.has(i,"editing")?i.editing=!0:Reflect.has(i,"positionEditing")&&(i.positionEditing=!0)),typeof i.execOnCreating=="function"&&i.execOnCreating()}function al(i,e){_i(i,"__treeItem")&&console.error("setSceneObjectTreeItem error!"),yn(i,"__treeItem",e)}function gE(i){return _i(i,"__treeItem")}function pE(i){if(!(i.startsWith("./")||i.startsWith("../")||i.startsWith("/")))return i;const e=document.createElement("a");e.href=i;const t=e.href;return e.remove(),t}function Nc(i){if(typeof i!="string")return!1;try{const e=JSON.parse(i);return typeof e=="object"&&e!==null}catch{return!1}}function mE(i){try{return new DOMParser().parseFromString(i,"application/xml").getElementsByTagName("parsererror").length===0}catch{return!1}}function vE(i){return i instanceof Function?i():i}function wm(i,e){for(let t of i)if(e.includes(t))return!0;return!1}function Fo(i,e){const t=i,n=e;return t===void 0||t.length===0||n===void 0||n.length===0?!0:wm(t,n)}function yE(i){const e=setTimeout(()=>{i(),clearTimeout(e)})}function oa(i){let e=i%360;return e=e<0?360+e:e,e}function Em(i){return oa(i+180)-180}function ol(i,e,t){let n=oa(i),s=oa(e);Math.abs(n-s)>180&&(n<s?n+=360:s+=360);const o=n*(1-t)+s*t;return Em(o)}function Rc(i,e,t,n){return n=n||[0,0,0],n[0]=ol(i[0],e[0],t),n[1]=ol(i[1],e[1],t),n[2]=ol(i[2],e[2],t),n}function Sm(i,e,t="editing"){const n=new st;i.ad(n);const s=e.bind(i);return n.ad(new xe(i.activeViewerChanged,()=>{const o=new st;let h=i.activeViewer;return h?(o.ad(i[`${t}Changed`].don(()=>{var l;i[`${t}`]?s():(l=(i.components.main??i).editingID)!=null&&l.includes("inner")&&i.activeViewer&&i.activeViewer.stopEditing()})),o.ad(h.editingEvent.don(l=>{if(l.objectIDs.includes(i.id)&&l.type==="end"){const d=i.components.main??i;d.editingID&&(l.editingID.includes(d.editingID)?(d.editingID=void 0,i[t]=!1):i[t]=!d.editingID.includes("outer"))}}))):o.ad(i[`${t}Changed`].don(()=>{i[`${t}`]=!1})),o})),i[`${t}`]&&s(),n}function _E(i){return i}function wE(i){if(i==null)return _E;var e,t,n=i.scale[0],s=i.scale[1],o=i.translate[0],h=i.translate[1];return function(l,d){d||(e=t=0);var f=2,v=l.length,m=new Array(v);for(m[0]=(e+=l[0])*n+o,m[1]=(t+=l[1])*s+h;f<v;)m[f]=l[f],++f;return m}}function EE(i,e){for(var t,n=i.length,s=n-e;s<--n;)t=i[s],i[s++]=i[n],i[n]=t}function SE(i,e){return typeof e=="string"&&(e=i.objects[e]),e.type==="GeometryCollection"?{type:"FeatureCollection",features:e.geometries.map(function(t){return xm(i,t)})}:xm(i,e)}function xm(i,e){var t=e.id,n=e.bbox,s=e.properties==null?{}:e.properties,o=xE(i,e);return t==null&&n==null?{type:"Feature",properties:s,geometry:o}:n==null?{type:"Feature",id:t,properties:s,geometry:o}:{type:"Feature",id:t,bbox:n,properties:s,geometry:o}}function xE(i,e){var t=wE(i.transform),n=i.arcs;function s(v,m){m.length&&m.pop();for(var y=n[v<0?~v:v],w=0,S=y.length;w<S;++w)m.push(t(y[w],w));v<0&&EE(m,S)}function o(v){return t(v)}function h(v){for(var m=[],y=0,w=v.length;y<w;++y)s(v[y],m);return m.length<2&&m.push(m[0]),m}function l(v){for(var m=h(v);m.length<4;)m.push(m[0]);return m}function d(v){return v.map(l)}function f(v){var m=v.type,y;switch(m){case"GeometryCollection":return{type:m,geometries:v.geometries.map(f)};case"Point":y=o(v.coordinates);break;case"MultiPoint":y=v.coordinates.map(o);break;case"LineString":y=h(v.arcs);break;case"MultiLineString":y=v.arcs.map(h);break;case"Polygon":y=d(v.arcs);break;case"MultiPolygon":y=v.arcs.map(d);break;default:return null}return{type:m,coordinates:y}}return f(e)}function bm(i){var t;const e=Array.isArray(i)?"feature":((t=i.type)==null?void 0:t.toLowerCase())??"";switch(e){case"geometrycollection":return bE(i);case"topology":const n=i.objects,s=[];for(const o in n){const h=SE(i,n[o]);s.push(...h.features)}return{type:"FeatureCollection",features:s};case"feature":return{type:"FeatureCollection",features:Array.isArray(i)?i:[i]};case"featurecollection":return i;default:return console.warn(`GeoJson数据转换可能有误,数据类型${e}`),{type:"FeatureCollection",features:Array.isArray(i.features)?i.features:[]}}}function bE(i,e){const t=[],n=i.geometries||[];function s(o,h={}){!o||!o.type||(o.type==="GeometryCollection"&&Array.isArray(o.geometries)?o.geometries.forEach(l=>s(l,h)):t.push({type:"Feature",geometry:o,properties:{...o.properties||{},...h}}))}return n.forEach(o=>s(o,{})),{type:"FeatureCollection",features:t}}function PE(i){const e=i.cloneNode(!0);e.style.position="fixed",e.style.visibility="hidden",e.style.pointerEvents="none",e.style.top="0",e.style.left="0",e.style.display="inline-block",document.body.appendChild(e);const t=e.getBoundingClientRect();return document.body.removeChild(e),{x:t.x,y:t.y,width:t.width,height:t.height}}function CE(i,e,t=!1){var m,y,w,S,T,N;const n=[],s=[],o=[],h=[],l=[],d=new Set,f=new Map;if(e!=null&&e.features)for(const j of e.features){const C=((m=j.id)==null?void 0:m.toString())||((w=(y=j.properties)==null?void 0:y.id)==null?void 0:w.toString());C&&(d.add(C),f.set(C,j))}if(i!=null&&i.features)for(const j of i.features){const C=((S=j.id)==null?void 0:S.toString())||((N=(T=j.properties)==null?void 0:T.id)==null?void 0:N.toString());if(C)if(d.has(C)){if(t){const k=f.get(C);k&&Pm(k,j)?h.push(C):l.push(C)}n.push(C)}else s.push(C)}for(const j of d)n.includes(j)||o.push(j);const v={unchangedIds:n,newIds:s,removedIds:o};return t&&(v.contentUnchangedIds=h,v.contentUpdatedIds=l),v}function Pm(i,e){return Cm(i.geometry,e.geometry)?JSON.stringify(i.properties)===JSON.stringify(e.properties):!1}function Cm(i,e){if(i===e)return!0;if(!i||!e||i.type!==e.type)return!1;const t=i.coordinates,n=e.coordinates;if(i.type==="Point")return IE(t,n);if(i.type==="LineString"||i.type==="MultiPoint")return hl(t,n);if(i.type==="Polygon"){if(t.length!==n.length)return!1;for(let s=0;s<t.length;s++)if(!hl(t[s],n[s]))return!1;return!0}if(i.type==="MultiLineString"){if(t.length!==n.length)return!1;for(let s=0;s<t.length;s++)if(!hl(t[s],n[s]))return!1;return!0}if(i.type==="MultiPolygon"){if(t.length!==n.length)return!1;for(let s=0;s<t.length;s++){const o=t[s],h=n[s];if(o.length!==h.length)return!1;for(let l=0;l<o.length;l++)if(!hl(o[l],h[l]))return!1}return!0}return JSON.stringify(i)===JSON.stringify(e)}function IE(i,e){if(!i||!e)return i===e;if(i.length!==e.length)return!1;for(let t=0;t<i.length;t++)if(Math.abs(i[t]-e[t])>1e-10)return!1;return!0}function hl(i,e){if(i===e)return!0;if(!i||!e||i.length!==e.length)return!1;for(let t=0;t<i.length;t++){const n=i[t],s=e[t];if(n.length!==s.length)return!1;for(let o=0;o<n.length;o++)if(Math.abs(n[o]-s[o])>1e-10)return!1}return!0}class Ac extends st{constructor(t){super();p(this,"_sceneObject",this.dv(it(void 0)));this._id=t,this.d(()=>{this._sceneObject.value=void 0});const n=St.getSceneObjById(this._id);n&&(this._sceneObject.value=n),this.d(St.context.sceneObjCreatedEvent.don(s=>{s.id===this._id&&(this._sceneObject.value=s)})),this.d(St.context.sceneObjToDestroyEvent.don(s=>{s.id===this._id&&(this._sceneObject.value=void 0)}))}get sceneObject(){return this._sceneObject.value}get sceneObjectChanged(){return this._sceneObject.changed}get id(){return this._id}}class ME extends st{constructor(t,n){super();p(this,"_sofi");this._id=t,this._sofi=this.dv(new Ac(this._id));{const s=()=>{n.sceneObject=this._sofi.sceneObject};s(),this.d(this._sofi.sceneObjectChanged.don(s))}}}class Im extends st{constructor(){super();p(this,"_id",this.dv(it(void 0)));p(this,"_sceneObject",this.dv(it(void 0)));p(this,"_resetting",this.dv(new xe(this.idChanged,()=>{const{id:t}=this;if(t===void 0||t===""){this.sceneObject=void 0;return}return new ME(t,this)})))}get id(){return this._id.value}get idChanged(){return this._id.changed}set id(t){this._id.value=t}get sceneObject(){return this._sceneObject.value}get sceneObjectChanged(){return this._sceneObject.changed}set sceneObject(t){this._sceneObject.value=t}get resetting(){return this._resetting}}class TE extends st{constructor(t,n,s,o){super();p(this,"_sceneObjectId",this.dv(new Im));this._id=t,this._startTimeStamp=n,this._duration=s,this._parent=o,this._sceneObjectId.id=this._id;const h=()=>{if(!this.player)return;const{currentTime:l=0}=this._parent,d=l-this._startTimeStamp;this.player.currentTime=Qh(d,0,this._duration)*(this.player.speed??1)};h(),this.d(this._parent.currentTimeChanged.don(h)),this.d(this.playerChanged.don(h))}get player(){return this._sceneObjectId.sceneObject instanceof Di?this._sceneObjectId.sceneObject:void 0}get playerChanged(){return this._sceneObjectId.sceneObjectChanged}}const kE=`
|
|
24
24
|
用来配置子播放器,它是一个数组形式,数组的每个元素仍然是一个数组,形式是[子播放器的ID, 起始时间, 持续时间]。
|
|
25
25
|
注意时间的单位是毫秒。
|
|
26
26
|
示例如下:
|
|
@@ -43,11 +43,11 @@ of digits after the zone letter and two 100km letters - front
|
|
|
43
43
|
half for easting meters, second half for
|
|
44
44
|
northing meters`+i;var y=m/2,w=0,S=0,T,N,j,C,k;return y>0&&(T=1e5/Math.pow(10,y),N=i.substring(o,o+y),w=parseFloat(N)*T,j=i.substring(o+y),S=parseFloat(j)*T),C=w+f,k=S+v,{easting:C,northing:k,zoneLetter:l,zoneNumber:h,accuracy:T}}function HS(i,e){for(var t=r0.charCodeAt(e-1),n=1e5,s=!1;t!==i.charCodeAt(0);){if(t++,t===fi&&t++,t===Gi&&t++,t>$o){if(s)throw"Bad character: "+i;t=ca,s=!0}n+=1e5}return n}function XS(i,e){if(i>"V")throw"MGRSPoint given invalid Northing "+i;for(var t=a0.charCodeAt(e-1),n=0,s=!1;t!==i.charCodeAt(0);){if(t++,t===fi&&t++,t===Gi&&t++,t>qo){if(s)throw"Bad character: "+i;t=ca,s=!0}n+=1e5}return n}function YS(i){var e;switch(i){case"C":e=11e5;break;case"D":e=2e6;break;case"E":e=28e5;break;case"F":e=37e5;break;case"G":e=46e5;break;case"H":e=55e5;break;case"J":e=64e5;break;case"K":e=73e5;break;case"L":e=82e5;break;case"M":e=91e5;break;case"N":e=0;break;case"P":e=8e5;break;case"Q":e=17e5;break;case"R":e=26e5;break;case"S":e=35e5;break;case"T":e=44e5;break;case"U":e=53e5;break;case"V":e=62e5;break;case"W":e=7e6;break;case"X":e=79e5;break;default:e=-1}if(e>=0)return e;throw"Invalid zone letter: "+i}function da(i,e,t){if(!(this instanceof da))return new da(i,e,t);if(Array.isArray(i))this.x=i[0],this.y=i[1],this.z=i[2]||0;else if(typeof i=="object")this.x=i.x,this.y=i.y,this.z=i.z||0;else if(typeof i=="string"&&typeof e>"u"){var n=i.split(",");this.x=parseFloat(n[0]),this.y=parseFloat(n[1]),this.z=parseFloat(n[2])||0}else this.x=i,this.y=e,this.z=t||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}da.fromMGRS=function(i){return new da(h0(i))},da.prototype.toMGRS=function(i){return o0([this.x,this.y],i)};var JS=1,KS=.25,d0=.046875,f0=.01953125,g0=.01068115234375,ZS=.75,QS=.46875,tx=.013020833333333334,ex=.007120768229166667,ix=.3645833333333333,nx=.005696614583333333,sx=.3076171875;function $c(i){var e=[];e[0]=JS-i*(KS+i*(d0+i*(f0+i*g0))),e[1]=i*(ZS-i*(d0+i*(f0+i*g0)));var t=i*i;return e[2]=t*(QS-i*(tx+i*ex)),t*=i,e[3]=t*(ix-i*nx),e[4]=t*i*sx,e}function fa(i,e,t,n){return t*=e,e*=e,n[0]*i-t*(n[1]+e*(n[2]+e*(n[3]+e*n[4])))}var rx=20;function Wc(i,e,t){for(var n=1/(1-e),s=i,o=rx;o;--o){var h=Math.sin(s),l=1-e*h*h;if(l=(fa(s,h,Math.cos(s),t)-i)*(l*Math.sqrt(l))*n,s-=l,Math.abs(l)<ft)return s}return s}function ax(){this.x0=this.x0!==void 0?this.x0:0,this.y0=this.y0!==void 0?this.y0:0,this.long0=this.long0!==void 0?this.long0:0,this.lat0=this.lat0!==void 0?this.lat0:0,this.es&&(this.en=$c(this.es),this.ml0=fa(this.lat0,Math.sin(this.lat0),Math.cos(this.lat0),this.en))}function ox(i){var e=i.x,t=i.y,n=wt(e-this.long0,this.over),s,o,h,l=Math.sin(t),d=Math.cos(t);if(this.es){var v=d*n,m=Math.pow(v,2),y=this.ep2*Math.pow(d,2),w=Math.pow(y,2),S=Math.abs(d)>ft?Math.tan(t):0,T=Math.pow(S,2),N=Math.pow(T,2);s=1-this.es*Math.pow(l,2),v=v/Math.sqrt(s);var j=fa(t,l,d,this.en);o=this.a*(this.k0*v*(1+m/6*(1-T+y+m/20*(5-18*T+N+14*y-58*T*y+m/42*(61+179*N-N*T-479*T)))))+this.x0,h=this.a*(this.k0*(j-this.ml0+l*n*v/2*(1+m/12*(5-T+9*y+4*w+m/30*(61+N-58*T+270*y-330*T*y+m/56*(1385+543*N-N*T-3111*T))))))+this.y0}else{var f=d*Math.sin(n);if(Math.abs(Math.abs(f)-1)<ft)return 93;if(o=.5*this.a*this.k0*Math.log((1+f)/(1-f))+this.x0,h=d*Math.cos(n)/Math.sqrt(1-Math.pow(f,2)),f=Math.abs(h),f>=1){if(f-1>ft)return 93;h=0}else h=Math.acos(h);t<0&&(h=-h),h=this.a*this.k0*(h-this.lat0)+this.y0}return i.x=o,i.y=h,i}function hx(i){var e,t,n,s,o=(i.x-this.x0)*(1/this.a),h=(i.y-this.y0)*(1/this.a);if(this.es)if(e=this.ml0+h/this.k0,t=Wc(e,this.es,this.en),Math.abs(t)<lt){var m=Math.sin(t),y=Math.cos(t),w=Math.abs(y)>ft?Math.tan(t):0,S=this.ep2*Math.pow(y,2),T=Math.pow(S,2),N=Math.pow(w,2),j=Math.pow(N,2);e=1-this.es*Math.pow(m,2);var C=o*Math.sqrt(e)/this.k0,k=Math.pow(C,2);e=e*w,n=t-e*k/(1-this.es)*.5*(1-k/12*(5+3*N-9*S*N+S-4*T-k/30*(61+90*N-252*S*N+45*j+46*S-k/56*(1385+3633*N+4095*j+1574*j*N)))),s=wt(this.long0+C*(1-k/6*(1+2*N+S-k/20*(5+28*N+24*j+8*S*N+6*S-k/42*(61+662*N+1320*j+720*j*N))))/y,this.over)}else n=lt*Uo(h),s=0;else{var l=Math.exp(o/this.k0),d=.5*(l-1/l),f=this.lat0+h/this.k0,v=Math.cos(f);e=Math.sqrt((1-Math.pow(v,2))/(1+Math.pow(d,2))),n=Math.asin(e),h<0&&(n=-n),d===0&&v===0?s=0:s=wt(Math.atan2(d,v)+this.long0,this.over)}return i.x=s,i.y=n,i}var lx=["Fast_Transverse_Mercator","Fast Transverse Mercator"];const vl={init:ax,forward:ox,inverse:hx,names:lx};function p0(i){var e=Math.exp(i);return e=(e-1/e)/2,e}function gi(i,e){i=Math.abs(i),e=Math.abs(e);var t=Math.max(i,e),n=Math.min(i,e)/(t||1);return t*Math.sqrt(1+Math.pow(n,2))}function ux(i){var e=1+i,t=e-1;return t===0?i:i*Math.log(e)/t}function cx(i){var e=Math.abs(i);return e=ux(e*(1+e/(gi(1,e)+1))),i<0?-e:e}function Hc(i,e){for(var t=2*Math.cos(2*e),n=i.length-1,s=i[n],o=0,h;--n>=0;)h=-o+t*s+i[n],o=s,s=h;return e+h*Math.sin(2*e)}function dx(i,e){for(var t=2*Math.cos(e),n=i.length-1,s=i[n],o=0,h;--n>=0;)h=-o+t*s+i[n],o=s,s=h;return Math.sin(e)*h}function fx(i){var e=Math.exp(i);return e=(e+1/e)/2,e}function m0(i,e,t){for(var n=Math.sin(e),s=Math.cos(e),o=p0(t),h=fx(t),l=2*s*h,d=-2*n*o,f=i.length-1,v=i[f],m=0,y=0,w=0,S,T;--f>=0;)S=y,T=m,y=v,m=w,v=-S+l*y-d*m+i[f],w=-T+d*y+l*m;return l=n*h,d=s*o,[l*v-d*w,l*w+d*v]}function gx(){if(!this.approx&&(isNaN(this.es)||this.es<=0))throw new Error('Incorrect elliptical usage. Try using the +approx option in the proj string, or PROJECTION["Fast_Transverse_Mercator"] in the WKT.');this.approx&&(vl.init.apply(this),this.forward=vl.forward,this.inverse=vl.inverse),this.x0=this.x0!==void 0?this.x0:0,this.y0=this.y0!==void 0?this.y0:0,this.long0=this.long0!==void 0?this.long0:0,this.lat0=this.lat0!==void 0?this.lat0:0,this.cgb=[],this.cbg=[],this.utg=[],this.gtu=[];var i=this.es/(1+Math.sqrt(1-this.es)),e=i/(2-i),t=e;this.cgb[0]=e*(2+e*(-.6666666666666666+e*(-2+e*(2.577777777777778+e*(.5777777777777777+e*-4.228148148148148))))),this.cbg[0]=e*(-2+e*(.6666666666666666+e*(1.3333333333333333+e*(-1.8222222222222222+e*(.7111111111111111+e*.9824338624338624))))),t=t*e,this.cgb[1]=t*(2.3333333333333335+e*(-1.6+e*(-5.044444444444444+e*(8.584126984126984+e*2.458201058201058)))),this.cbg[1]=t*(1.6666666666666667+e*(-1.0666666666666667+e*(-1.4444444444444444+e*(2.86984126984127+e*-1.6105820105820106)))),t=t*e,this.cgb[2]=t*(3.7333333333333334+e*(-3.8857142857142857+e*(-12.019047619047619+e*26.03668430335097))),this.cbg[2]=t*(-1.7333333333333334+e*(1.619047619047619+e*(1.6+e*-4.474779541446208))),t=t*e,this.cgb[3]=t*(6.792063492063492+e*(-9.485714285714286+e*-28.188500881834216)),this.cbg[3]=t*(1.9634920634920634+e*(-2.4+e*-1.7518165784832451)),t=t*e,this.cgb[4]=t*(13.250793650793652+e*-23.22238255571589),this.cbg[4]=t*(-2.3301587301587303+e*3.5144460477793813),t=t*e,this.cgb[5]=t*27.011268237934903,this.cbg[5]=t*2.8496841430174764,t=Math.pow(e,2),this.Qn=this.k0/(1+e)*(1+t*(.25+t*(.015625+t/256))),this.utg[0]=e*(-.5+e*(.6666666666666666+e*(-.3854166666666667+e*(.002777777777777778+e*(.158203125+e*-.15905919312169312))))),this.gtu[0]=e*(.5+e*(-.6666666666666666+e*(.3125+e*(.22777777777777777+e*(-.4409722222222222+e*.20875661375661375))))),this.utg[1]=t*(-.020833333333333332+e*(-.06666666666666667+e*(.3034722222222222+e*(-.4380952380952381+e*.2890188388723545)))),this.gtu[1]=t*(.2708333333333333+e*(-.6+e*(.38680555555555557+e*(.44603174603174606+e*-1.0248393063822752)))),t=t*e,this.utg[2]=t*(-.035416666666666666+e*(.04404761904761905+e*(.046651785714285715+e*-.06138668430335097))),this.gtu[2]=t*(.25416666666666665+e*(-.7357142857142858+e*(.5603050595238095+e*.9237378747795415))),t=t*e,this.utg[3]=t*(-.02726314484126984+e*(.021825396825396824+e*.11439745921516754)),this.gtu[3]=t*(.30729786706349205+e*(-1.0654761904761905+e*.9096203979276896)),t=t*e,this.utg[4]=t*(-.02841641865079365+e*.027268468414301746),this.gtu[4]=t*(.4306671626984127+e*-1.713007555715889),t=t*e,this.utg[5]=t*-.03233083094085698,this.gtu[5]=t*.6650675310896665;var n=Hc(this.cbg,this.lat0);this.Zb=-this.Qn*(n+dx(this.gtu,2*n))}function px(i){var e=wt(i.x-this.long0,this.over),t=i.y;t=Hc(this.cbg,t);var n=Math.sin(t),s=Math.cos(t),o=Math.sin(e),h=Math.cos(e);t=Math.atan2(n,h*s),e=Math.atan2(o*s,gi(n,s*h)),e=cx(Math.tan(e));var l=m0(this.gtu,2*t,2*e);t=t+l[0],e=e+l[1];var d,f;return Math.abs(e)<=2.623395162778?(d=this.a*(this.Qn*e)+this.x0,f=this.a*(this.Qn*t+this.Zb)+this.y0):(d=1/0,f=1/0),i.x=d,i.y=f,i}function mx(i){var e=(i.x-this.x0)*(1/this.a),t=(i.y-this.y0)*(1/this.a);t=(t-this.Zb)/this.Qn,e=e/this.Qn;var n,s;if(Math.abs(e)<=2.623395162778){var o=m0(this.utg,2*t,2*e);t=t+o[0],e=e+o[1],e=Math.atan(p0(e));var h=Math.sin(t),l=Math.cos(t),d=Math.sin(e),f=Math.cos(e);t=Math.atan2(h*f,gi(d,f*l)),e=Math.atan2(d,f*l),n=wt(e+this.long0,this.over),s=Hc(this.cgb,t)}else n=1/0,s=1/0;return i.x=n,i.y=s,i}var vx=["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc","Transverse_Mercator","Transverse Mercator","Gauss Kruger","Gauss_Kruger","tmerc"];const yl={init:gx,forward:px,inverse:mx,names:vx};function yx(i,e){if(i===void 0){if(i=Math.floor((wt(e)+Math.PI)*30/Math.PI)+1,i<0)return 0;if(i>60)return 60}return i}var _x="etmerc";function wx(){var i=yx(this.zone,this.long0);if(i===void 0)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(i)-183)*Ee,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,yl.init.apply(this),this.forward=yl.forward,this.inverse=yl.inverse}var Ex=["Universal Transverse Mercator System","utm"];const Sx={init:wx,names:Ex,dependsOn:_x};function Xc(i,e){return Math.pow((1-i)/(1+i),e)}var xx=20;function bx(){var i=Math.sin(this.lat0),e=Math.cos(this.lat0);e*=e,this.rc=Math.sqrt(1-this.es)/(1-this.es*i*i),this.C=Math.sqrt(1+this.es*e*e/(1-this.es)),this.phic0=Math.asin(i/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+ie)/(Math.pow(Math.tan(.5*this.lat0+ie),this.C)*Xc(this.e*i,this.ratexp))}function Px(i){var e=i.x,t=i.y;return i.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*t+ie),this.C)*Xc(this.e*Math.sin(t),this.ratexp))-lt,i.x=this.C*e,i}function Cx(i){for(var e=1e-14,t=i.x/this.C,n=i.y,s=Math.pow(Math.tan(.5*n+ie)/this.K,1/this.C),o=xx;o>0&&(n=2*Math.atan(s*Xc(this.e*Math.sin(i.y),-.5*this.e))-lt,!(Math.abs(n-i.y)<e));--o)i.y=n;return o?(i.x=t,i.y=n,i):null}const Yc={init:bx,forward:Px,inverse:Cx};function Ix(){Yc.init.apply(this),this.rc&&(this.sinc0=Math.sin(this.phic0),this.cosc0=Math.cos(this.phic0),this.R2=2*this.rc,this.title||(this.title="Oblique Stereographic Alternative"))}function Mx(i){var e,t,n,s;return i.x=wt(i.x-this.long0,this.over),Yc.forward.apply(this,[i]),e=Math.sin(i.y),t=Math.cos(i.y),n=Math.cos(i.x),s=this.k0*this.R2/(1+this.sinc0*e+this.cosc0*t*n),i.x=s*t*Math.sin(i.x),i.y=s*(this.cosc0*e-this.sinc0*t*n),i.x=this.a*i.x+this.x0,i.y=this.a*i.y+this.y0,i}function Tx(i){var e,t,n,s,o;if(i.x=(i.x-this.x0)/this.a,i.y=(i.y-this.y0)/this.a,i.x/=this.k0,i.y/=this.k0,o=gi(i.x,i.y)){var h=2*Math.atan2(o,this.R2);e=Math.sin(h),t=Math.cos(h),s=Math.asin(t*this.sinc0+i.y*e*this.cosc0/o),n=Math.atan2(i.x*e,o*this.cosc0*t-i.y*this.sinc0*e)}else s=this.phic0,n=0;return i.x=n,i.y=s,Yc.inverse.apply(this,[i]),i.x=wt(i.x+this.long0,this.over),i}var kx=["Stereographic_North_Pole","Oblique_Stereographic","sterea","Oblique Stereographic Alternative","Double_Stereographic"];const Ox={init:Ix,forward:Mx,inverse:Tx,names:kx};function Jc(i,e,t){return e*=t,Math.tan(.5*(lt+i))*Math.pow((1-e)/(1+e),.5*t)}function Nx(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.coslat0=Math.cos(this.lat0),this.sinlat0=Math.sin(this.lat0),this.sphere?this.k0===1&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=ft&&(this.k0=.5*(1+Uo(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=ft&&(this.lat0>0?this.con=1:this.con=-1),this.cons=Math.sqrt(Math.pow(1+this.e,1+this.e)*Math.pow(1-this.e,1-this.e)),this.k0===1&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=ft&&Math.abs(Math.cos(this.lat_ts))>ft&&(this.k0=.5*this.cons*En(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/nn(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=En(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(Jc(this.lat0,this.sinlat0,this.e))-lt,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))}function Rx(i){var e=i.x,t=i.y,n=Math.sin(t),s=Math.cos(t),o,h,l,d,f,v,m=wt(e-this.long0,this.over);return Math.abs(Math.abs(e-this.long0)-Math.PI)<=ft&&Math.abs(t+this.lat0)<=ft?(i.x=NaN,i.y=NaN,i):this.sphere?(o=2*this.k0/(1+this.sinlat0*n+this.coslat0*s*Math.cos(m)),i.x=this.a*o*s*Math.sin(m)+this.x0,i.y=this.a*o*(this.coslat0*n-this.sinlat0*s*Math.cos(m))+this.y0,i):(h=2*Math.atan(Jc(t,n,this.e))-lt,d=Math.cos(h),l=Math.sin(h),Math.abs(this.coslat0)<=ft?(f=nn(this.e,t*this.con,this.con*n),v=2*this.a*this.k0*f/this.cons,i.x=this.x0+v*Math.sin(e-this.long0),i.y=this.y0-this.con*v*Math.cos(e-this.long0),i):(Math.abs(this.sinlat0)<ft?(o=2*this.a*this.k0/(1+d*Math.cos(m)),i.y=o*l):(o=2*this.a*this.k0*this.ms1/(this.cosX0*(1+this.sinX0*l+this.cosX0*d*Math.cos(m))),i.y=o*(this.cosX0*l-this.sinX0*d*Math.cos(m))+this.y0),i.x=o*d*Math.sin(m)+this.x0,i))}function Ax(i){i.x-=this.x0,i.y-=this.y0;var e,t,n,s,o,h=Math.sqrt(i.x*i.x+i.y*i.y);if(this.sphere){var l=2*Math.atan(h/(2*this.a*this.k0));return e=this.long0,t=this.lat0,h<=ft?(i.x=e,i.y=t,i):(t=Math.asin(Math.cos(l)*this.sinlat0+i.y*Math.sin(l)*this.coslat0/h),Math.abs(this.coslat0)<ft?this.lat0>0?e=wt(this.long0+Math.atan2(i.x,-1*i.y),this.over):e=wt(this.long0+Math.atan2(i.x,i.y),this.over):e=wt(this.long0+Math.atan2(i.x*Math.sin(l),h*this.coslat0*Math.cos(l)-i.y*this.sinlat0*Math.sin(l)),this.over),i.x=e,i.y=t,i)}else if(Math.abs(this.coslat0)<=ft){if(h<=ft)return t=this.lat0,e=this.long0,i.x=e,i.y=t,i;i.x*=this.con,i.y*=this.con,n=h*this.cons/(2*this.a*this.k0),t=this.con*Vo(this.e,n),e=this.con*wt(this.con*this.long0+Math.atan2(i.x,-1*i.y),this.over)}else s=2*Math.atan(h*this.cosX0/(2*this.a*this.k0*this.ms1)),e=this.long0,h<=ft?o=this.X0:(o=Math.asin(Math.cos(s)*this.sinX0+i.y*Math.sin(s)*this.cosX0/h),e=wt(this.long0+Math.atan2(i.x*Math.sin(s),h*this.cosX0*Math.cos(s)-i.y*this.sinX0*Math.sin(s)),this.over)),t=-1*Vo(this.e,Math.tan(.5*(lt+o)));return i.x=e,i.y=t,i}var Dx=["stere","Stereographic_South_Pole","Polar_Stereographic_variant_A","Polar_Stereographic_variant_B","Polar_Stereographic"];const Lx={init:Nx,forward:Rx,inverse:Ax,names:Dx,ssfn_:Jc};function Fx(){var i=this.lat0;this.lambda0=this.long0;var e=Math.sin(i),t=this.a,n=this.rf,s=1/n,o=2*s-Math.pow(s,2),h=this.e=Math.sqrt(o);this.R=this.k0*t*Math.sqrt(1-o)/(1-o*Math.pow(e,2)),this.alpha=Math.sqrt(1+o/(1-o)*Math.pow(Math.cos(i),4)),this.b0=Math.asin(e/this.alpha);var l=Math.log(Math.tan(Math.PI/4+this.b0/2)),d=Math.log(Math.tan(Math.PI/4+i/2)),f=Math.log((1+h*e)/(1-h*e));this.K=l-this.alpha*d+this.alpha*h/2*f}function Gx(i){var e=Math.log(Math.tan(Math.PI/4-i.y/2)),t=this.e/2*Math.log((1+this.e*Math.sin(i.y))/(1-this.e*Math.sin(i.y))),n=-this.alpha*(e+t)+this.K,s=2*(Math.atan(Math.exp(n))-Math.PI/4),o=this.alpha*(i.x-this.lambda0),h=Math.atan(Math.sin(o)/(Math.sin(this.b0)*Math.tan(s)+Math.cos(this.b0)*Math.cos(o))),l=Math.asin(Math.cos(this.b0)*Math.sin(s)-Math.sin(this.b0)*Math.cos(s)*Math.cos(o));return i.y=this.R/2*Math.log((1+Math.sin(l))/(1-Math.sin(l)))+this.y0,i.x=this.R*h+this.x0,i}function jx(i){for(var e=i.x-this.x0,t=i.y-this.y0,n=e/this.R,s=2*(Math.atan(Math.exp(t/this.R))-Math.PI/4),o=Math.asin(Math.cos(this.b0)*Math.sin(s)+Math.sin(this.b0)*Math.cos(s)*Math.cos(n)),h=Math.atan(Math.sin(n)/(Math.cos(this.b0)*Math.cos(n)-Math.sin(this.b0)*Math.tan(s))),l=this.lambda0+h/this.alpha,d=0,f=o,v=-1e3,m=0;Math.abs(f-v)>1e-7;){if(++m>20)return;d=1/this.alpha*(Math.log(Math.tan(Math.PI/4+o/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(f))/2)),v=f,f=2*Math.atan(Math.exp(d))-Math.PI/2}return i.x=l,i.y=f,i}var Bx=["somerc"];const zx={init:Fx,forward:Gx,inverse:jx,names:Bx};var ga=1e-7;function Ux(i){var e=["Hotine_Oblique_Mercator","Hotine_Oblique_Mercator_variant_A","Hotine_Oblique_Mercator_Azimuth_Natural_Origin"],t=typeof i.projName=="object"?Object.keys(i.projName)[0]:i.projName;return"no_uoff"in i||"no_off"in i||e.indexOf(t)!==-1||e.indexOf(Hm(t))!==-1}function Vx(){var i,e,t,n,s,o,h,l,d,f,v=0,m,y=0,w=0,S=0,T=0,N=0,j=0;this.no_off=Ux(this),this.no_rot="no_rot"in this;var C=!1;"alpha"in this&&(C=!0);var k=!1;if("rectified_grid_angle"in this&&(k=!0),C&&(j=this.alpha),k&&(v=this.rectified_grid_angle),C||k)y=this.longc;else if(w=this.long1,T=this.lat1,S=this.long2,N=this.lat2,Math.abs(T-N)<=ga||(i=Math.abs(T))<=ga||Math.abs(i-lt)<=ga||Math.abs(Math.abs(this.lat0)-lt)<=ga||Math.abs(Math.abs(N)-lt)<=ga)throw new Error;var M=1-this.es;e=Math.sqrt(M),Math.abs(this.lat0)>ft?(l=Math.sin(this.lat0),t=Math.cos(this.lat0),i=1-this.es*l*l,this.B=t*t,this.B=Math.sqrt(1+this.es*this.B*this.B/M),this.A=this.B*this.k0*e/i,n=this.B*e/(t*Math.sqrt(i)),s=n*n-1,s<=0?s=0:(s=Math.sqrt(s),this.lat0<0&&(s=-s)),this.E=s+=n,this.E*=Math.pow(nn(this.e,this.lat0,l),this.B)):(this.B=1/e,this.A=this.k0,this.E=n=s=1),C||k?(C?(m=Math.asin(Math.sin(j)/n),k||(v=j)):(m=v,j=Math.asin(n*Math.sin(m))),this.lam0=y-Math.asin(.5*(s-1/s)*Math.tan(m))/this.B):(o=Math.pow(nn(this.e,T,Math.sin(T)),this.B),h=Math.pow(nn(this.e,N,Math.sin(N)),this.B),s=this.E/o,d=(h-o)/(h+o),f=this.E*this.E,f=(f-h*o)/(f+h*o),i=w-S,i<-Math.PI?S-=Bo:i>Math.PI&&(S+=Bo),this.lam0=wt(.5*(w+S)-Math.atan(f*Math.tan(.5*this.B*(w-S))/d)/this.B,this.over),m=Math.atan(2*Math.sin(this.B*wt(w-this.lam0,this.over))/(s-1/s)),v=j=Math.asin(n*Math.sin(m))),this.singam=Math.sin(m),this.cosgam=Math.cos(m),this.sinrot=Math.sin(v),this.cosrot=Math.cos(v),this.rB=1/this.B,this.ArB=this.A*this.rB,this.BrA=1/this.ArB,this.no_off?this.u_0=0:(this.u_0=Math.abs(this.ArB*Math.atan(Math.sqrt(n*n-1)/Math.cos(j))),this.lat0<0&&(this.u_0=-this.u_0)),s=.5*m,this.v_pole_n=this.ArB*Math.log(Math.tan(ie-s)),this.v_pole_s=this.ArB*Math.log(Math.tan(ie+s))}function qx(i){var e={},t,n,s,o,h,l,d,f;if(i.x=i.x-this.lam0,Math.abs(Math.abs(i.y)-lt)>ft){if(h=this.E/Math.pow(nn(this.e,i.y,Math.sin(i.y)),this.B),l=1/h,t=.5*(h-l),n=.5*(h+l),o=Math.sin(this.B*i.x),s=(t*this.singam-o*this.cosgam)/n,Math.abs(Math.abs(s)-1)<ft)throw new Error;f=.5*this.ArB*Math.log((1-s)/(1+s)),l=Math.cos(this.B*i.x),Math.abs(l)<ga?d=this.A*i.x:d=this.ArB*Math.atan2(t*this.cosgam+o*this.singam,l)}else f=i.y>0?this.v_pole_n:this.v_pole_s,d=this.ArB*i.y;return this.no_rot?(e.x=d,e.y=f):(d-=this.u_0,e.x=f*this.cosrot+d*this.sinrot,e.y=d*this.cosrot-f*this.sinrot),e.x=this.a*e.x+this.x0,e.y=this.a*e.y+this.y0,e}function $x(i){var e,t,n,s,o,h,l,d={};if(i.x=(i.x-this.x0)*(1/this.a),i.y=(i.y-this.y0)*(1/this.a),this.no_rot?(t=i.y,e=i.x):(t=i.x*this.cosrot-i.y*this.sinrot,e=i.y*this.cosrot+i.x*this.sinrot+this.u_0),n=Math.exp(-this.BrA*t),s=.5*(n-1/n),o=.5*(n+1/n),h=Math.sin(this.BrA*e),l=(h*this.cosgam+s*this.singam)/o,Math.abs(Math.abs(l)-1)<ft)d.x=0,d.y=l<0?-lt:lt;else{if(d.y=this.E/Math.sqrt((1+l)/(1-l)),d.y=Vo(this.e,Math.pow(d.y,1/this.B)),d.y===1/0)throw new Error;d.x=-this.rB*Math.atan2(s*this.cosgam-h*this.singam,Math.cos(this.BrA*e))}return d.x+=this.lam0,d}var Wx=["Hotine_Oblique_Mercator","Hotine Oblique Mercator","Hotine_Oblique_Mercator_variant_A","Hotine_Oblique_Mercator_Variant_B","Hotine_Oblique_Mercator_Azimuth_Natural_Origin","Hotine_Oblique_Mercator_Two_Point_Natural_Origin","Hotine_Oblique_Mercator_Azimuth_Center","Oblique_Mercator","omerc"];const Hx={init:Vx,forward:qx,inverse:$x,names:Wx};function Xx(){if(this.lat2||(this.lat2=this.lat1),this.k0||(this.k0=1),this.x0=this.x0||0,this.y0=this.y0||0,!(Math.abs(this.lat1+this.lat2)<ft)){var i=this.b/this.a;this.e=Math.sqrt(1-i*i);var e=Math.sin(this.lat1),t=Math.cos(this.lat1),n=En(this.e,e,t),s=nn(this.e,this.lat1,e),o=Math.sin(this.lat2),h=Math.cos(this.lat2),l=En(this.e,o,h),d=nn(this.e,this.lat2,o),f=Math.abs(Math.abs(this.lat0)-lt)<ft?0:nn(this.e,this.lat0,Math.sin(this.lat0));Math.abs(this.lat1-this.lat2)>ft?this.ns=Math.log(n/l)/Math.log(s/d):this.ns=e,isNaN(this.ns)&&(this.ns=e),this.f0=n/(this.ns*Math.pow(s,this.ns)),this.rh=this.a*this.f0*Math.pow(f,this.ns),this.title||(this.title="Lambert Conformal Conic")}}function Yx(i){var e=i.x,t=i.y;Math.abs(2*Math.abs(t)-Math.PI)<=ft&&(t=Uo(t)*(lt-2*ft));var n=Math.abs(Math.abs(t)-lt),s,o;if(n>ft)s=nn(this.e,t,Math.sin(t)),o=this.a*this.f0*Math.pow(s,this.ns);else{if(n=t*this.ns,n<=0)return null;o=0}var h=this.ns*wt(e-this.long0,this.over);return i.x=this.k0*(o*Math.sin(h))+this.x0,i.y=this.k0*(this.rh-o*Math.cos(h))+this.y0,i}function Jx(i){var e,t,n,s,o,h=(i.x-this.x0)/this.k0,l=this.rh-(i.y-this.y0)/this.k0;this.ns>0?(e=Math.sqrt(h*h+l*l),t=1):(e=-Math.sqrt(h*h+l*l),t=-1);var d=0;if(e!==0&&(d=Math.atan2(t*h,t*l)),e!==0||this.ns>0){if(t=1/this.ns,n=Math.pow(e/(this.a*this.f0),t),s=Vo(this.e,n),s===-9999)return null}else s=-lt;return o=wt(d/this.ns+this.long0,this.over),i.x=o,i.y=s,i}var Kx=["Lambert Tangential Conformal Conic Projection","Lambert_Conformal_Conic","Lambert_Conformal_Conic_1SP","Lambert_Conformal_Conic_2SP","lcc","Lambert Conic Conformal (1SP)","Lambert Conic Conformal (2SP)"];const Zx={init:Xx,forward:Yx,inverse:Jx,names:Kx};function Qx(){this.a=6377397155e-3,this.es=.006674372230614,this.e=Math.sqrt(this.es),this.lat0||(this.lat0=.863937979737193),this.long0||(this.long0=.4334234309119251),this.k0||(this.k0=.9999),this.s45=.785398163397448,this.s90=2*this.s45,this.fi0=this.lat0,this.e2=this.es,this.e=Math.sqrt(this.e2),this.alfa=Math.sqrt(1+this.e2*Math.pow(Math.cos(this.fi0),4)/(1-this.e2)),this.uq=1.04216856380474,this.u0=Math.asin(Math.sin(this.fi0)/this.alfa),this.g=Math.pow((1+this.e*Math.sin(this.fi0))/(1-this.e*Math.sin(this.fi0)),this.alfa*this.e/2),this.k=Math.tan(this.u0/2+this.s45)/Math.pow(Math.tan(this.fi0/2+this.s45),this.alfa)*this.g,this.k1=this.k0,this.n0=this.a*Math.sqrt(1-this.e2)/(1-this.e2*Math.pow(Math.sin(this.fi0),2)),this.s0=1.37008346281555,this.n=Math.sin(this.s0),this.ro0=this.k1*this.n0/Math.tan(this.s0),this.ad=this.s90-this.uq}function tb(i){var e,t,n,s,o,h,l,d=i.x,f=i.y,v=wt(d-this.long0,this.over);return e=Math.pow((1+this.e*Math.sin(f))/(1-this.e*Math.sin(f)),this.alfa*this.e/2),t=2*(Math.atan(this.k*Math.pow(Math.tan(f/2+this.s45),this.alfa)/e)-this.s45),n=-v*this.alfa,s=Math.asin(Math.cos(this.ad)*Math.sin(t)+Math.sin(this.ad)*Math.cos(t)*Math.cos(n)),o=Math.asin(Math.cos(t)*Math.sin(n)/Math.cos(s)),h=this.n*o,l=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(s/2+this.s45),this.n),i.y=l*Math.cos(h)/1,i.x=l*Math.sin(h)/1,this.czech||(i.y*=-1,i.x*=-1),i}function eb(i){var e,t,n,s,o,h,l,d,f=i.x;i.x=i.y,i.y=f,this.czech||(i.y*=-1,i.x*=-1),h=Math.sqrt(i.x*i.x+i.y*i.y),o=Math.atan2(i.y,i.x),s=o/Math.sin(this.s0),n=2*(Math.atan(Math.pow(this.ro0/h,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),e=Math.asin(Math.cos(this.ad)*Math.sin(n)-Math.sin(this.ad)*Math.cos(n)*Math.cos(s)),t=Math.asin(Math.cos(n)*Math.sin(s)/Math.cos(e)),i.x=this.long0-t/this.alfa,l=e,d=0;var v=0;do i.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(e/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(l))/(1-this.e*Math.sin(l)),this.e/2))-this.s45),Math.abs(l-i.y)<1e-10&&(d=1),l=i.y,v+=1;while(d===0&&v<15);return v>=15?null:i}var ib=["Krovak","Krovak Modified","Krovak (North Orientated)","Krovak Modified (North Orientated)","krovak"];const nb={init:Qx,forward:tb,inverse:eb,names:ib};function ii(i,e,t,n,s){return i*s-e*Math.sin(2*s)+t*Math.sin(4*s)-n*Math.sin(6*s)}function Wo(i){return 1-.25*i*(1+i/16*(3+1.25*i))}function Ho(i){return .375*i*(1+.25*i*(1+.46875*i))}function Xo(i){return .05859375*i*i*(1+.75*i)}function Yo(i){return i*i*i*.011393229166666666}function Kc(i,e,t){var n=e*t;return i/Math.sqrt(1-n*n)}function bs(i){return Math.abs(i)<lt?i:i-Uo(i)*Math.PI}function _l(i,e,t,n,s){var o,h;o=i/e;for(var l=0;l<15;l++)if(h=(i-(e*o-t*Math.sin(2*o)+n*Math.sin(4*o)-s*Math.sin(6*o)))/(e-2*t*Math.cos(2*o)+4*n*Math.cos(4*o)-6*s*Math.cos(6*o)),o+=h,Math.abs(h)<=1e-10)return o;return NaN}function sb(){this.sphere||(this.e0=Wo(this.es),this.e1=Ho(this.es),this.e2=Xo(this.es),this.e3=Yo(this.es),this.ml0=this.a*ii(this.e0,this.e1,this.e2,this.e3,this.lat0))}function rb(i){var e,t,n=i.x,s=i.y;if(n=wt(n-this.long0,this.over),this.sphere)e=this.a*Math.asin(Math.cos(s)*Math.sin(n)),t=this.a*(Math.atan2(Math.tan(s),Math.cos(n))-this.lat0);else{var o=Math.sin(s),h=Math.cos(s),l=Kc(this.a,this.e,o),d=Math.tan(s)*Math.tan(s),f=n*Math.cos(s),v=f*f,m=this.es*h*h/(1-this.es),y=this.a*ii(this.e0,this.e1,this.e2,this.e3,s);e=l*f*(1-v*d*(.16666666666666666-(8-d+8*m)*v/120)),t=y-this.ml0+l*o/h*v*(.5+(5-d+6*m)*v/24)}return i.x=e+this.x0,i.y=t+this.y0,i}function ab(i){i.x-=this.x0,i.y-=this.y0;var e=i.x/this.a,t=i.y/this.a,n,s;if(this.sphere){var o=t+this.lat0;n=Math.asin(Math.sin(o)*Math.cos(e)),s=Math.atan2(Math.tan(e),Math.cos(o))}else{var h=this.ml0/this.a+t,l=_l(h,this.e0,this.e1,this.e2,this.e3);if(Math.abs(Math.abs(l)-lt)<=ft)return i.x=this.long0,i.y=lt,t<0&&(i.y*=-1),i;var d=Kc(this.a,this.e,Math.sin(l)),f=d*d*d/this.a/this.a*(1-this.es),v=Math.pow(Math.tan(l),2),m=e*this.a/d,y=m*m;n=l-d*Math.tan(l)/f*m*m*(.5-(1+3*v)*m*m/24),s=m*(1-y*(v/3+(1+3*v)*v*y/15))/Math.cos(l)}return i.x=wt(s+this.long0,this.over),i.y=bs(n),i}var ob=["Cassini","Cassini_Soldner","cass"];const hb={init:sb,forward:rb,inverse:ab,names:ob};function Ps(i,e){var t;return i>1e-7?(t=i*e,(1-i*i)*(e/(1-t*t)-.5/i*Math.log((1-t)/(1+t)))):2*e}var Zc=1,Qc=2,td=3,wl=4;function lb(){var i=Math.abs(this.lat0);if(Math.abs(i-lt)<ft?this.mode=this.lat0<0?Zc:Qc:Math.abs(i)<ft?this.mode=td:this.mode=wl,this.es>0){var e;switch(this.qp=Ps(this.e,1),this.mmf=.5/(1-this.es),this.apa=yb(this.es),this.mode){case Qc:this.dd=1;break;case Zc:this.dd=1;break;case td:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case wl:this.rq=Math.sqrt(.5*this.qp),e=Math.sin(this.lat0),this.sinb1=Ps(this.e,e)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*e*e)*this.rq*this.cosb1),this.ymf=(this.xmf=this.rq)/this.dd,this.xmf*=this.dd;break}}else this.mode===wl&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))}function ub(i){var e,t,n,s,o,h,l,d,f,v,m=i.x,y=i.y;if(m=wt(m-this.long0,this.over),this.sphere){if(o=Math.sin(y),v=Math.cos(y),n=Math.cos(m),this.mode===this.OBLIQ||this.mode===this.EQUIT){if(t=this.mode===this.EQUIT?1+v*n:1+this.sinph0*o+this.cosph0*v*n,t<=ft)return null;t=Math.sqrt(2/t),e=t*v*Math.sin(m),t*=this.mode===this.EQUIT?o:this.cosph0*o-this.sinph0*v*n}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(n=-n),Math.abs(y+this.lat0)<ft)return null;t=ie-y*.5,t=2*(this.mode===this.S_POLE?Math.cos(t):Math.sin(t)),e=t*Math.sin(m),t*=n}}else{switch(l=0,d=0,f=0,n=Math.cos(m),s=Math.sin(m),o=Math.sin(y),h=Ps(this.e,o),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(l=h/this.qp,d=Math.sqrt(1-l*l)),this.mode){case this.OBLIQ:f=1+this.sinb1*l+this.cosb1*d*n;break;case this.EQUIT:f=1+d*n;break;case this.N_POLE:f=lt+y,h=this.qp-h;break;case this.S_POLE:f=y-lt,h=this.qp+h;break}if(Math.abs(f)<ft)return null;switch(this.mode){case this.OBLIQ:case this.EQUIT:f=Math.sqrt(2/f),this.mode===this.OBLIQ?t=this.ymf*f*(this.cosb1*l-this.sinb1*d*n):t=(f=Math.sqrt(2/(1+d*n)))*l*this.ymf,e=this.xmf*f*d*s;break;case this.N_POLE:case this.S_POLE:h>=0?(e=(f=Math.sqrt(h))*s,t=n*(this.mode===this.S_POLE?f:-f)):e=t=0;break}}return i.x=this.a*e+this.x0,i.y=this.a*t+this.y0,i}function cb(i){i.x-=this.x0,i.y-=this.y0;var e=i.x/this.a,t=i.y/this.a,n,s,o,h,l,d,f;if(this.sphere){var v=0,m,y=0;if(m=Math.sqrt(e*e+t*t),s=m*.5,s>1)return null;switch(s=2*Math.asin(s),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(y=Math.sin(s),v=Math.cos(s)),this.mode){case this.EQUIT:s=Math.abs(m)<=ft?0:Math.asin(t*y/m),e*=y,t=v*m;break;case this.OBLIQ:s=Math.abs(m)<=ft?this.lat0:Math.asin(v*this.sinph0+t*y*this.cosph0/m),e*=y*this.cosph0,t=(v-Math.sin(s)*this.sinph0)*m;break;case this.N_POLE:t=-t,s=lt-s;break;case this.S_POLE:s-=lt;break}n=t===0&&(this.mode===this.EQUIT||this.mode===this.OBLIQ)?0:Math.atan2(e,t)}else{if(f=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(e/=this.dd,t*=this.dd,d=Math.sqrt(e*e+t*t),d<ft)return i.x=this.long0,i.y=this.lat0,i;h=2*Math.asin(.5*d/this.rq),o=Math.cos(h),e*=h=Math.sin(h),this.mode===this.OBLIQ?(f=o*this.sinb1+t*h*this.cosb1/d,l=this.qp*f,t=d*this.cosb1*o-t*this.sinb1*h):(f=t*h/d,l=this.qp*f,t=d*o)}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(t=-t),l=e*e+t*t,!l)return i.x=this.long0,i.y=this.lat0,i;f=1-l/this.qp,this.mode===this.S_POLE&&(f=-f)}n=Math.atan2(e,t),s=_b(Math.asin(f),this.apa)}return i.x=wt(this.long0+n,this.over),i.y=s,i}var db=.3333333333333333,fb=.17222222222222222,gb=.10257936507936508,pb=.06388888888888888,mb=.0664021164021164,vb=.016415012942191543;function yb(i){var e,t=[];return t[0]=i*db,e=i*i,t[0]+=e*fb,t[1]=e*pb,e*=i,t[0]+=e*gb,t[1]+=e*mb,t[2]=e*vb,t}function _b(i,e){var t=i+i;return i+e[0]*Math.sin(t)+e[1]*Math.sin(t+t)+e[2]*Math.sin(t+t+t)}var wb=["Lambert Azimuthal Equal Area","Lambert_Azimuthal_Equal_Area","laea"];const Eb={init:lb,forward:ub,inverse:cb,names:wb,S_POLE:Zc,N_POLE:Qc,EQUIT:td,OBLIQ:wl};function Cs(i){return Math.abs(i)>1&&(i=i>1?1:-1),Math.asin(i)}function Sb(){Math.abs(this.lat1+this.lat2)<ft||(this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e3=Math.sqrt(this.es),this.sin_po=Math.sin(this.lat1),this.cos_po=Math.cos(this.lat1),this.t1=this.sin_po,this.con=this.sin_po,this.ms1=En(this.e3,this.sin_po,this.cos_po),this.qs1=Ps(this.e3,this.sin_po),this.sin_po=Math.sin(this.lat2),this.cos_po=Math.cos(this.lat2),this.t2=this.sin_po,this.ms2=En(this.e3,this.sin_po,this.cos_po),this.qs2=Ps(this.e3,this.sin_po),this.sin_po=Math.sin(this.lat0),this.cos_po=Math.cos(this.lat0),this.t3=this.sin_po,this.qs0=Ps(this.e3,this.sin_po),Math.abs(this.lat1-this.lat2)>ft?this.ns0=(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1):this.ns0=this.con,this.c=this.ms1*this.ms1+this.ns0*this.qs1,this.rh=this.a*Math.sqrt(this.c-this.ns0*this.qs0)/this.ns0)}function xb(i){var e=i.x,t=i.y;this.sin_phi=Math.sin(t),this.cos_phi=Math.cos(t);var n=Ps(this.e3,this.sin_phi),s=this.a*Math.sqrt(this.c-this.ns0*n)/this.ns0,o=this.ns0*wt(e-this.long0,this.over),h=s*Math.sin(o)+this.x0,l=this.rh-s*Math.cos(o)+this.y0;return i.x=h,i.y=l,i}function bb(i){var e,t,n,s,o,h;return i.x-=this.x0,i.y=this.rh-i.y+this.y0,this.ns0>=0?(e=Math.sqrt(i.x*i.x+i.y*i.y),n=1):(e=-Math.sqrt(i.x*i.x+i.y*i.y),n=-1),s=0,e!==0&&(s=Math.atan2(n*i.x,n*i.y)),n=e*this.ns0/this.a,this.sphere?h=Math.asin((this.c-n*n)/(2*this.ns0)):(t=(this.c-n*n)/this.ns0,h=this.phi1z(this.e3,t)),o=wt(s/this.ns0+this.long0,this.over),i.x=o,i.y=h,i}function Pb(i,e){var t,n,s,o,h,l=Cs(.5*e);if(i<ft)return l;for(var d=i*i,f=1;f<=25;f++)if(t=Math.sin(l),n=Math.cos(l),s=i*t,o=1-s*s,h=.5*o*o/n*(e/(1-d)-t/o+.5/i*Math.log((1-s)/(1+s))),l=l+h,Math.abs(h)<=1e-7)return l;return null}var Cb=["Albers_Conic_Equal_Area","Albers_Equal_Area","Albers","aea"];const Ib={init:Sb,forward:xb,inverse:bb,names:Cb,phi1z:Pb};function Mb(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0),this.infinity_dist=1e3*this.a,this.rc=1}function Tb(i){var e,t,n,s,o,h,l,d,f=i.x,v=i.y;return n=wt(f-this.long0,this.over),e=Math.sin(v),t=Math.cos(v),s=Math.cos(n),h=this.sin_p14*e+this.cos_p14*t*s,o=1,h>0||Math.abs(h)<=ft?(l=this.x0+this.a*o*t*Math.sin(n)/h,d=this.y0+this.a*o*(this.cos_p14*e-this.sin_p14*t*s)/h):(l=this.x0+this.infinity_dist*t*Math.sin(n),d=this.y0+this.infinity_dist*(this.cos_p14*e-this.sin_p14*t*s)),i.x=l,i.y=d,i}function kb(i){var e,t,n,s,o,h;return i.x=(i.x-this.x0)/this.a,i.y=(i.y-this.y0)/this.a,i.x/=this.k0,i.y/=this.k0,(e=Math.sqrt(i.x*i.x+i.y*i.y))?(s=Math.atan2(e,this.rc),t=Math.sin(s),n=Math.cos(s),h=Cs(n*this.sin_p14+i.y*t*this.cos_p14/e),o=Math.atan2(i.x*t,e*this.cos_p14*n-i.y*this.sin_p14*t),o=wt(this.long0+o,this.over)):(h=this.phic0,o=0),i.x=o,i.y=h,i}var Ob=["gnom"];const Nb={init:Mb,forward:Tb,inverse:kb,names:Ob};function Rb(i,e){var t=1-(1-i*i)/(2*i)*Math.log((1-i)/(1+i));if(Math.abs(Math.abs(e)-t)<1e-6)return e<0?-1*lt:lt;for(var n=Math.asin(.5*e),s,o,h,l,d=0;d<30;d++)if(o=Math.sin(n),h=Math.cos(n),l=i*o,s=Math.pow(1-l*l,2)/(2*h)*(e/(1-i*i)-o/(1-l*l)+.5/i*Math.log((1-l)/(1+l))),n+=s,Math.abs(s)<=1e-10)return n;return NaN}function Ab(){this.sphere||(this.k0=En(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))}function Db(i){var e=i.x,t=i.y,n,s,o=wt(e-this.long0,this.over);if(this.sphere)n=this.x0+this.a*o*Math.cos(this.lat_ts),s=this.y0+this.a*Math.sin(t)/Math.cos(this.lat_ts);else{var h=Ps(this.e,Math.sin(t));n=this.x0+this.a*this.k0*o,s=this.y0+this.a*h*.5/this.k0}return i.x=n,i.y=s,i}function Lb(i){i.x-=this.x0,i.y-=this.y0;var e,t;return this.sphere?(e=wt(this.long0+i.x/this.a/Math.cos(this.lat_ts),this.over),t=Math.asin(i.y/this.a*Math.cos(this.lat_ts))):(t=Rb(this.e,2*i.y*this.k0/this.a),e=wt(this.long0+i.x/(this.a*this.k0),this.over)),i.x=e,i.y=t,i}var Fb=["cea"];const Gb={init:Ab,forward:Db,inverse:Lb,names:Fb};function jb(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Equidistant Cylindrical (Plate Carre)",this.rc=Math.cos(this.lat_ts)}function Bb(i){var e=i.x,t=i.y,n=wt(e-this.long0,this.over),s=bs(t-this.lat0);return i.x=this.x0+this.a*n*this.rc,i.y=this.y0+this.a*s,i}function zb(i){var e=i.x,t=i.y;return i.x=wt(this.long0+(e-this.x0)/(this.a*this.rc),this.over),i.y=bs(this.lat0+(t-this.y0)/this.a),i}var Ub=["Equirectangular","Equidistant_Cylindrical","Equidistant_Cylindrical_Spherical","eqc"];const Vb={init:jb,forward:Bb,inverse:zb,names:Ub};var v0=20;function qb(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=Wo(this.es),this.e1=Ho(this.es),this.e2=Xo(this.es),this.e3=Yo(this.es),this.ml0=this.a*ii(this.e0,this.e1,this.e2,this.e3,this.lat0)}function $b(i){var e=i.x,t=i.y,n,s,o,h=wt(e-this.long0,this.over);if(o=h*Math.sin(t),this.sphere)Math.abs(t)<=ft?(n=this.a*h,s=-1*this.a*this.lat0):(n=this.a*Math.sin(o)/Math.tan(t),s=this.a*(bs(t-this.lat0)+(1-Math.cos(o))/Math.tan(t)));else if(Math.abs(t)<=ft)n=this.a*h,s=-1*this.ml0;else{var l=Kc(this.a,this.e,Math.sin(t))/Math.tan(t);n=l*Math.sin(o),s=this.a*ii(this.e0,this.e1,this.e2,this.e3,t)-this.ml0+l*(1-Math.cos(o))}return i.x=n+this.x0,i.y=s+this.y0,i}function Wb(i){var e,t,n,s,o,h,l,d,f;if(n=i.x-this.x0,s=i.y-this.y0,this.sphere)if(Math.abs(s+this.a*this.lat0)<=ft)e=wt(n/this.a+this.long0,this.over),t=0;else{h=this.lat0+s/this.a,l=n*n/this.a/this.a+h*h,d=h;var v;for(o=v0;o;--o)if(v=Math.tan(d),f=-1*(h*(d*v+1)-d-.5*(d*d+l)*v)/((d-h)/v-1),d+=f,Math.abs(f)<=ft){t=d;break}e=wt(this.long0+Math.asin(n*Math.tan(d)/this.a)/Math.sin(t),this.over)}else if(Math.abs(s+this.ml0)<=ft)t=0,e=wt(this.long0+n/this.a,this.over);else{h=(this.ml0+s)/this.a,l=n*n/this.a/this.a+h*h,d=h;var m,y,w,S,T;for(o=v0;o;--o)if(T=this.e*Math.sin(d),m=Math.sqrt(1-T*T)*Math.tan(d),y=this.a*ii(this.e0,this.e1,this.e2,this.e3,d),w=this.e0-2*this.e1*Math.cos(2*d)+4*this.e2*Math.cos(4*d)-6*this.e3*Math.cos(6*d),S=y/this.a,f=(h*(m*S+1)-S-.5*m*(S*S+l))/(this.es*Math.sin(2*d)*(S*S+l-2*h*S)/(4*m)+(h-S)*(m*w-2/Math.sin(2*d))-w),d-=f,Math.abs(f)<=ft){t=d;break}m=Math.sqrt(1-this.es*Math.pow(Math.sin(t),2))*Math.tan(t),e=wt(this.long0+Math.asin(n*m/this.a)/Math.sin(t),this.over)}return i.x=e,i.y=t,i}var Hb=["Polyconic","American_Polyconic","poly"];const Xb={init:qb,forward:$b,inverse:Wb,names:Hb};function Yb(){this.A=[],this.A[1]=.6399175073,this.A[2]=-.1358797613,this.A[3]=.063294409,this.A[4]=-.02526853,this.A[5]=.0117879,this.A[6]=-.0055161,this.A[7]=.0026906,this.A[8]=-.001333,this.A[9]=67e-5,this.A[10]=-34e-5,this.B_re=[],this.B_im=[],this.B_re[1]=.7557853228,this.B_im[1]=0,this.B_re[2]=.249204646,this.B_im[2]=.003371507,this.B_re[3]=-.001541739,this.B_im[3]=.04105856,this.B_re[4]=-.10162907,this.B_im[4]=.01727609,this.B_re[5]=-.26623489,this.B_im[5]=-.36249218,this.B_re[6]=-.6870983,this.B_im[6]=-1.1651967,this.C_re=[],this.C_im=[],this.C_re[1]=1.3231270439,this.C_im[1]=0,this.C_re[2]=-.577245789,this.C_im[2]=-.007809598,this.C_re[3]=.508307513,this.C_im[3]=-.112208952,this.C_re[4]=-.15094762,this.C_im[4]=.18200602,this.C_re[5]=1.01418179,this.C_im[5]=1.64497696,this.C_re[6]=1.9660549,this.C_im[6]=2.5127645,this.D=[],this.D[1]=1.5627014243,this.D[2]=.5185406398,this.D[3]=-.03333098,this.D[4]=-.1052906,this.D[5]=-.0368594,this.D[6]=.007317,this.D[7]=.0122,this.D[8]=.00394,this.D[9]=-.0013}function Jb(i){var e,t=i.x,n=i.y,s=n-this.lat0,o=t-this.long0,h=s/jo*1e-5,l=o,d=1,f=0;for(e=1;e<=10;e++)d=d*h,f=f+this.A[e]*d;var v=f,m=l,y=1,w=0,S,T,N=0,j=0;for(e=1;e<=6;e++)S=y*v-w*m,T=w*v+y*m,y=S,w=T,N=N+this.B_re[e]*y-this.B_im[e]*w,j=j+this.B_im[e]*y+this.B_re[e]*w;return i.x=j*this.a+this.x0,i.y=N*this.a+this.y0,i}function Kb(i){var e,t=i.x,n=i.y,s=t-this.x0,o=n-this.y0,h=o/this.a,l=s/this.a,d=1,f=0,v,m,y=0,w=0;for(e=1;e<=6;e++)v=d*h-f*l,m=f*h+d*l,d=v,f=m,y=y+this.C_re[e]*d-this.C_im[e]*f,w=w+this.C_im[e]*d+this.C_re[e]*f;for(var S=0;S<this.iterations;S++){var T=y,N=w,j,C,k=h,M=l;for(e=2;e<=6;e++)j=T*y-N*w,C=N*y+T*w,T=j,N=C,k=k+(e-1)*(this.B_re[e]*T-this.B_im[e]*N),M=M+(e-1)*(this.B_im[e]*T+this.B_re[e]*N);T=1,N=0;var D=this.B_re[1],L=this.B_im[1];for(e=2;e<=6;e++)j=T*y-N*w,C=N*y+T*w,T=j,N=C,D=D+e*(this.B_re[e]*T-this.B_im[e]*N),L=L+e*(this.B_im[e]*T+this.B_re[e]*N);var V=D*D+L*L;y=(k*D+M*L)/V,w=(M*D-k*L)/V}var x=y,I=w,R=1,G=0;for(e=1;e<=9;e++)R=R*x,G=G+this.D[e]*R;var F=this.lat0+G*jo*1e5,U=this.long0+I;return i.x=U,i.y=F,i}var Zb=["New_Zealand_Map_Grid","nzmg"];const Qb={init:Yb,forward:Jb,inverse:Kb,names:Zb};function tP(){}function eP(i){var e=i.x,t=i.y,n=wt(e-this.long0,this.over),s=this.x0+this.a*n,o=this.y0+this.a*Math.log(Math.tan(Math.PI/4+t/2.5))*1.25;return i.x=s,i.y=o,i}function iP(i){i.x-=this.x0,i.y-=this.y0;var e=wt(this.long0+i.x/this.a,this.over),t=2.5*(Math.atan(Math.exp(.8*i.y/this.a))-Math.PI/4);return i.x=e,i.y=t,i}var nP=["Miller_Cylindrical","mill"];const sP={init:tP,forward:eP,inverse:iP,names:nP};var rP=20;function aP(){this.long0=this.long0||0,this.sphere?(this.n=1,this.m=0,this.es=0,this.C_y=Math.sqrt((this.m+1)/this.n),this.C_x=this.C_y/(this.m+1)):this.en=$c(this.es)}function oP(i){var e,t,n=i.x,s=i.y;if(n=wt(n-this.long0,this.over),this.sphere){if(!this.m)s=this.n!==1?Math.asin(this.n*Math.sin(s)):s;else for(var o=this.n*Math.sin(s),h=rP;h;--h){var l=(this.m*s+Math.sin(s)-o)/(this.m+Math.cos(s));if(s-=l,Math.abs(l)<ft)break}e=this.a*this.C_x*n*(this.m+Math.cos(s)),t=this.a*this.C_y*s}else{var d=Math.sin(s),f=Math.cos(s);t=this.a*fa(s,d,f,this.en),e=this.a*n*f/Math.sqrt(1-this.es*d*d)}return i.x=e,i.y=t,i}function hP(i){var e,t,n,s;return i.x-=this.x0,n=i.x/this.a,i.y-=this.y0,e=i.y/this.a,this.sphere?(e/=this.C_y,n=n/(this.C_x*(this.m+Math.cos(e))),this.m?e=Cs((this.m*e+Math.sin(e))/this.n):this.n!==1&&(e=Cs(Math.sin(e)/this.n)),n=wt(n+this.long0,this.over),e=bs(e)):(e=Wc(i.y/this.a,this.es,this.en),s=Math.abs(e),s<lt?(s=Math.sin(e),t=this.long0+i.x*Math.sqrt(1-this.es*s*s)/(this.a*Math.cos(e)),n=wt(t,this.over)):s-ft<lt&&(n=this.long0)),i.x=n,i.y=e,i}var lP=["Sinusoidal","sinu"];const uP={init:aP,forward:oP,inverse:hP,names:lP};function cP(){this.x0=this.x0!==void 0?this.x0:0,this.y0=this.y0!==void 0?this.y0:0,this.long0=this.long0!==void 0?this.long0:0}function dP(i){for(var e=i.x,t=i.y,n=wt(e-this.long0,this.over),s=t,o=Math.PI*Math.sin(t);;){var h=-(s+Math.sin(s)-o)/(1+Math.cos(s));if(s+=h,Math.abs(h)<ft)break}s/=2,Math.PI/2-Math.abs(t)<ft&&(n=0);var l=.900316316158*this.a*n*Math.cos(s)+this.x0,d=1.4142135623731*this.a*Math.sin(s)+this.y0;return i.x=l,i.y=d,i}function fP(i){var e,t;i.x-=this.x0,i.y-=this.y0,t=i.y/(1.4142135623731*this.a),Math.abs(t)>.999999999999&&(t=.999999999999),e=Math.asin(t);var n=wt(this.long0+i.x/(.900316316158*this.a*Math.cos(e)),this.over);n<-Math.PI&&(n=-Math.PI),n>Math.PI&&(n=Math.PI),t=(2*e+Math.sin(2*e))/Math.PI,Math.abs(t)>1&&(t=1);var s=Math.asin(t);return i.x=n,i.y=s,i}var gP=["Mollweide","moll"];const pP={init:cP,forward:dP,inverse:fP,names:gP};function mP(){Math.abs(this.lat1+this.lat2)<ft||(this.lat2=this.lat2||this.lat1,this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=Wo(this.es),this.e1=Ho(this.es),this.e2=Xo(this.es),this.e3=Yo(this.es),this.sin_phi=Math.sin(this.lat1),this.cos_phi=Math.cos(this.lat1),this.ms1=En(this.e,this.sin_phi,this.cos_phi),this.ml1=ii(this.e0,this.e1,this.e2,this.e3,this.lat1),Math.abs(this.lat1-this.lat2)<ft?this.ns=this.sin_phi:(this.sin_phi=Math.sin(this.lat2),this.cos_phi=Math.cos(this.lat2),this.ms2=En(this.e,this.sin_phi,this.cos_phi),this.ml2=ii(this.e0,this.e1,this.e2,this.e3,this.lat2),this.ns=(this.ms1-this.ms2)/(this.ml2-this.ml1)),this.g=this.ml1+this.ms1/this.ns,this.ml0=ii(this.e0,this.e1,this.e2,this.e3,this.lat0),this.rh=this.a*(this.g-this.ml0))}function vP(i){var e=i.x,t=i.y,n;if(this.sphere)n=this.a*(this.g-t);else{var s=ii(this.e0,this.e1,this.e2,this.e3,t);n=this.a*(this.g-s)}var o=this.ns*wt(e-this.long0,this.over),h=this.x0+n*Math.sin(o),l=this.y0+this.rh-n*Math.cos(o);return i.x=h,i.y=l,i}function yP(i){i.x-=this.x0,i.y=this.rh-i.y+this.y0;var e,t,n,s;this.ns>=0?(t=Math.sqrt(i.x*i.x+i.y*i.y),e=1):(t=-Math.sqrt(i.x*i.x+i.y*i.y),e=-1);var o=0;if(t!==0&&(o=Math.atan2(e*i.x,e*i.y)),this.sphere)return s=wt(this.long0+o/this.ns,this.over),n=bs(this.g-t/this.a),i.x=s,i.y=n,i;var h=this.g-t/this.a;return n=_l(h,this.e0,this.e1,this.e2,this.e3),s=wt(this.long0+o/this.ns,this.over),i.x=s,i.y=n,i}var _P=["Equidistant_Conic","eqdc"];const wP={init:mP,forward:vP,inverse:yP,names:_P};function EP(){this.R=this.a}function SP(i){var e=i.x,t=i.y,n=wt(e-this.long0,this.over),s,o;Math.abs(t)<=ft&&(s=this.x0+this.R*n,o=this.y0);var h=Cs(2*Math.abs(t/Math.PI));(Math.abs(n)<=ft||Math.abs(Math.abs(t)-lt)<=ft)&&(s=this.x0,t>=0?o=this.y0+Math.PI*this.R*Math.tan(.5*h):o=this.y0+Math.PI*this.R*-Math.tan(.5*h));var l=.5*Math.abs(Math.PI/n-n/Math.PI),d=l*l,f=Math.sin(h),v=Math.cos(h),m=v/(f+v-1),y=m*m,w=m*(2/f-1),S=w*w,T=Math.PI*this.R*(l*(m-S)+Math.sqrt(d*(m-S)*(m-S)-(S+d)*(y-S)))/(S+d);n<0&&(T=-T),s=this.x0+T;var N=d+m;return T=Math.PI*this.R*(w*N-l*Math.sqrt((S+d)*(d+1)-N*N))/(S+d),t>=0?o=this.y0+T:o=this.y0-T,i.x=s,i.y=o,i}function xP(i){var e,t,n,s,o,h,l,d,f,v,m,y,w;return i.x-=this.x0,i.y-=this.y0,m=Math.PI*this.R,n=i.x/m,s=i.y/m,o=n*n+s*s,h=-Math.abs(s)*(1+o),l=h-2*s*s+n*n,d=-2*h+1+2*s*s+o*o,w=s*s/d+(2*l*l*l/d/d/d-9*h*l/d/d)/27,f=(h-l*l/3/d)/d,v=2*Math.sqrt(-f/3),m=3*w/f/v,Math.abs(m)>1&&(m>=0?m=1:m=-1),y=Math.acos(m)/3,i.y>=0?t=(-v*Math.cos(y+Math.PI/3)-l/3/d)*Math.PI:t=-(-v*Math.cos(y+Math.PI/3)-l/3/d)*Math.PI,Math.abs(n)<ft?e=this.long0:e=wt(this.long0+Math.PI*(o-1+Math.sqrt(1+2*(n*n-s*s)+o*o))/2/n,this.over),i.x=e,i.y=t,i}var bP=["Van_der_Grinten_I","VanDerGrinten","Van_der_Grinten","vandg"];const PP={init:EP,forward:SP,inverse:xP,names:bP};function CP(i,e,t,n,s,o){const h=n-e,l=Math.atan((1-o)*Math.tan(i)),d=Math.atan((1-o)*Math.tan(t)),f=Math.sin(l),v=Math.cos(l),m=Math.sin(d),y=Math.cos(d);let w=h,S,T=100,N,j,C,k,M,D,L,V,x,I,R,G,F,U;do{if(N=Math.sin(w),j=Math.cos(w),C=Math.sqrt(y*N*(y*N)+(v*m-f*y*j)*(v*m-f*y*j)),C===0)return{azi1:0,s12:0};k=f*m+v*y*j,M=Math.atan2(C,k),D=v*y*N/C,L=1-D*D,V=L!==0?k-2*f*m/L:0,x=o/16*L*(4+o*(4-3*L)),S=w,w=h+(1-x)*o*D*(M+x*C*(V+x*k*(-1+2*V*V)))}while(Math.abs(w-S)>1e-12&&--T>0);return T===0?{azi1:NaN,s12:NaN}:(I=L*(s*s-s*(1-o)*(s*(1-o)))/(s*(1-o)*(s*(1-o))),R=1+I/16384*(4096+I*(-768+I*(320-175*I))),G=I/1024*(256+I*(-128+I*(74-47*I))),F=G*C*(V+G/4*(k*(-1+2*V*V)-G/6*V*(-3+4*C*C)*(-3+4*V*V))),U=s*(1-o)*R*(M-F),{azi1:Math.atan2(y*N,v*m-f*y*j),s12:U})}function IP(i,e,t,n,s,o){const h=Math.atan((1-o)*Math.tan(i)),l=Math.sin(h),d=Math.cos(h),f=Math.sin(t),v=Math.cos(t),m=Math.atan2(l,d*v),y=d*f,w=1-y*y,S=w*(s*s-s*(1-o)*(s*(1-o)))/(s*(1-o)*(s*(1-o))),T=1+S/16384*(4096+S*(-768+S*(320-175*S))),N=S/1024*(256+S*(-128+S*(74-47*S)));let j=n/(s*(1-o)*T),C,k=100,M,D,L,V;do M=Math.cos(2*m+j),D=Math.sin(j),L=Math.cos(j),V=N*D*(M+N/4*(L*(-1+2*M*M)-N/6*M*(-3+4*D*D)*(-3+4*M*M))),C=j,j=n/(s*(1-o)*T)+V;while(Math.abs(j-C)>1e-12&&--k>0);if(k===0)return{lat2:NaN,lon2:NaN};const x=l*D-d*L*v,I=Math.atan2(l*L+d*D*v,(1-o)*Math.sqrt(y*y+x*x)),R=Math.atan2(D*f,d*L-l*D*v),G=o/16*w*(4+o*(4-3*w)),F=R-(1-G)*o*y*(j+G*D*(M+G*L*(-1+2*M*M))),U=e+F;return{lat2:I,lon2:U}}function MP(){this.sin_p12=Math.sin(this.lat0),this.cos_p12=Math.cos(this.lat0),this.f=this.es/(1+Math.sqrt(1-this.es))}function TP(i){var e=i.x,t=i.y,n=Math.sin(i.y),s=Math.cos(i.y),o=wt(e-this.long0,this.over),h,l,d,f,v,m,y,w,S,T,N;return this.sphere?Math.abs(this.sin_p12-1)<=ft?(i.x=this.x0+this.a*(lt-t)*Math.sin(o),i.y=this.y0-this.a*(lt-t)*Math.cos(o),i):Math.abs(this.sin_p12+1)<=ft?(i.x=this.x0+this.a*(lt+t)*Math.sin(o),i.y=this.y0+this.a*(lt+t)*Math.cos(o),i):(S=this.sin_p12*n+this.cos_p12*s*Math.cos(o),y=Math.acos(S),w=y?y/Math.sin(y):1,i.x=this.x0+this.a*w*s*Math.sin(o),i.y=this.y0+this.a*w*(this.cos_p12*n-this.sin_p12*s*Math.cos(o)),i):(h=Wo(this.es),l=Ho(this.es),d=Xo(this.es),f=Yo(this.es),Math.abs(this.sin_p12-1)<=ft?(v=this.a*ii(h,l,d,f,lt),m=this.a*ii(h,l,d,f,t),i.x=this.x0+(v-m)*Math.sin(o),i.y=this.y0-(v-m)*Math.cos(o),i):Math.abs(this.sin_p12+1)<=ft?(v=this.a*ii(h,l,d,f,lt),m=this.a*ii(h,l,d,f,t),i.x=this.x0+(v+m)*Math.sin(o),i.y=this.y0+(v+m)*Math.cos(o),i):Math.abs(e)<ft&&Math.abs(t-this.lat0)<ft?(i.x=i.y=0,i):(T=CP(this.lat0,this.long0,t,e,this.a,this.f),N=T.azi1,i.x=T.s12*Math.sin(N),i.y=T.s12*Math.cos(N),i))}function kP(i){i.x-=this.x0,i.y-=this.y0;var e,t,n,s,o,h,l,d,f,v,m,y,w,S,T,N;return this.sphere?(e=Math.sqrt(i.x*i.x+i.y*i.y),e>2*lt*this.a?void 0:(t=e/this.a,n=Math.sin(t),s=Math.cos(t),o=this.long0,Math.abs(e)<=ft?h=this.lat0:(h=Cs(s*this.sin_p12+i.y*n*this.cos_p12/e),l=Math.abs(this.lat0)-lt,Math.abs(l)<=ft?this.lat0>=0?o=wt(this.long0+Math.atan2(i.x,-i.y),this.over):o=wt(this.long0-Math.atan2(-i.x,i.y),this.over):o=wt(this.long0+Math.atan2(i.x*n,e*this.cos_p12*s-i.y*this.sin_p12*n),this.over)),i.x=o,i.y=h,i)):(d=Wo(this.es),f=Ho(this.es),v=Xo(this.es),m=Yo(this.es),Math.abs(this.sin_p12-1)<=ft?(y=this.a*ii(d,f,v,m,lt),e=Math.sqrt(i.x*i.x+i.y*i.y),w=y-e,h=_l(w/this.a,d,f,v,m),o=wt(this.long0+Math.atan2(i.x,-1*i.y),this.over),i.x=o,i.y=h,i):Math.abs(this.sin_p12+1)<=ft?(y=this.a*ii(d,f,v,m,lt),e=Math.sqrt(i.x*i.x+i.y*i.y),w=e-y,h=_l(w/this.a,d,f,v,m),o=wt(this.long0+Math.atan2(i.x,i.y),this.over),i.x=o,i.y=h,i):(S=Math.atan2(i.x,i.y),T=Math.sqrt(i.x*i.x+i.y*i.y),N=IP(this.lat0,this.long0,S,T,this.a,this.f),i.x=N.lon2,i.y=N.lat2,i))}var OP=["Azimuthal_Equidistant","aeqd"];const NP={init:MP,forward:TP,inverse:kP,names:OP};function RP(){this.sin_p14=Math.sin(this.lat0||0),this.cos_p14=Math.cos(this.lat0||0)}function AP(i){var e,t,n,s,o,h,l,d,f=i.x,v=i.y;return n=wt(f-(this.long0||0),this.over),e=Math.sin(v),t=Math.cos(v),s=Math.cos(n),h=this.sin_p14*e+this.cos_p14*t*s,o=1,(h>0||Math.abs(h)<=ft)&&(l=this.a*o*t*Math.sin(n),d=(this.y0||0)+this.a*o*(this.cos_p14*e-this.sin_p14*t*s)),i.x=l,i.y=d,i}function DP(i){var e,t,n,s,o,h,l,d,f;return i.x-=this.x0||0,i.y-=this.y0||0,e=Math.sqrt(i.x*i.x+i.y*i.y),t=Cs(e/this.a),n=Math.sin(t),s=Math.cos(t),d=this.long0||0,f=this.lat0||0,h=d,Math.abs(e)<=ft?(l=f,i.x=h,i.y=l,i):(l=Cs(s*this.sin_p14+i.y*n*this.cos_p14/e),o=Math.abs(f)-lt,Math.abs(o)<=ft?(f>=0?h=wt(d+Math.atan2(i.x,-i.y),this.over):h=wt(d-Math.atan2(-i.x,i.y),this.over),i.x=h,i.y=l,i):(h=wt(d+Math.atan2(i.x*n,e*this.cos_p14*s-i.y*this.sin_p14*n),this.over),i.x=h,i.y=l,i))}var LP=["ortho"];const FP={init:RP,forward:AP,inverse:DP,names:LP};var pe={FRONT:1,RIGHT:2,BACK:3,LEFT:4,TOP:5,BOTTOM:6},ne={AREA_0:1,AREA_1:2,AREA_2:3,AREA_3:4};function GP(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Quadrilateralized Spherical Cube",this.lat0>=lt-ie/2?this.face=pe.TOP:this.lat0<=-(lt-ie/2)?this.face=pe.BOTTOM:Math.abs(this.long0)<=ie?this.face=pe.FRONT:Math.abs(this.long0)<=lt+ie?this.face=this.long0>0?pe.RIGHT:pe.LEFT:this.face=pe.BACK,this.es!==0&&(this.one_minus_f=1-(this.a-this.b)/this.a,this.one_minus_f_squared=this.one_minus_f*this.one_minus_f)}function jP(i){var e={x:0,y:0},t,n,s,o,h,l,d={value:0};if(i.x-=this.long0,this.es!==0?t=Math.atan(this.one_minus_f_squared*Math.tan(i.y)):t=i.y,n=i.x,this.face===pe.TOP)o=lt-t,n>=ie&&n<=lt+ie?(d.value=ne.AREA_0,s=n-lt):n>lt+ie||n<=-(lt+ie)?(d.value=ne.AREA_1,s=n>0?n-Pe:n+Pe):n>-(lt+ie)&&n<=-ie?(d.value=ne.AREA_2,s=n+lt):(d.value=ne.AREA_3,s=n);else if(this.face===pe.BOTTOM)o=lt+t,n>=ie&&n<=lt+ie?(d.value=ne.AREA_0,s=-n+lt):n<ie&&n>=-ie?(d.value=ne.AREA_1,s=-n):n<-ie&&n>=-(lt+ie)?(d.value=ne.AREA_2,s=-n-lt):(d.value=ne.AREA_3,s=n>0?-n+Pe:-n-Pe);else{var f,v,m,y,w,S,T;this.face===pe.RIGHT?n=pa(n,+lt):this.face===pe.BACK?n=pa(n,+Pe):this.face===pe.LEFT&&(n=pa(n,-lt)),y=Math.sin(t),w=Math.cos(t),S=Math.sin(n),T=Math.cos(n),f=w*T,v=w*S,m=y,this.face===pe.FRONT?(o=Math.acos(f),s=El(o,m,v,d)):this.face===pe.RIGHT?(o=Math.acos(v),s=El(o,m,-f,d)):this.face===pe.BACK?(o=Math.acos(-f),s=El(o,m,-v,d)):this.face===pe.LEFT?(o=Math.acos(-v),s=El(o,m,f,d)):(o=s=0,d.value=ne.AREA_0)}return l=Math.atan(12/Pe*(s+Math.acos(Math.sin(s)*Math.cos(ie))-lt)),h=Math.sqrt((1-Math.cos(o))/(Math.cos(l)*Math.cos(l))/(1-Math.cos(Math.atan(1/Math.cos(s))))),d.value===ne.AREA_1?l+=lt:d.value===ne.AREA_2?l+=Pe:d.value===ne.AREA_3&&(l+=1.5*Pe),e.x=h*Math.cos(l),e.y=h*Math.sin(l),e.x=e.x*this.a+this.x0,e.y=e.y*this.a+this.y0,i.x=e.x,i.y=e.y,i}function BP(i){var e={lam:0,phi:0},t,n,s,o,h,l,d,f,v,m={value:0};if(i.x=(i.x-this.x0)/this.a,i.y=(i.y-this.y0)/this.a,n=Math.atan(Math.sqrt(i.x*i.x+i.y*i.y)),t=Math.atan2(i.y,i.x),i.x>=0&&i.x>=Math.abs(i.y)?m.value=ne.AREA_0:i.y>=0&&i.y>=Math.abs(i.x)?(m.value=ne.AREA_1,t-=lt):i.x<0&&-i.x>=Math.abs(i.y)?(m.value=ne.AREA_2,t=t<0?t+Pe:t-Pe):(m.value=ne.AREA_3,t+=lt),v=Pe/12*Math.tan(t),h=Math.sin(v)/(Math.cos(v)-1/Math.sqrt(2)),l=Math.atan(h),s=Math.cos(t),o=Math.tan(n),d=1-s*s*o*o*(1-Math.cos(Math.atan(1/Math.cos(l)))),d<-1?d=-1:d>1&&(d=1),this.face===pe.TOP)f=Math.acos(d),e.phi=lt-f,m.value===ne.AREA_0?e.lam=l+lt:m.value===ne.AREA_1?e.lam=l<0?l+Pe:l-Pe:m.value===ne.AREA_2?e.lam=l-lt:e.lam=l;else if(this.face===pe.BOTTOM)f=Math.acos(d),e.phi=f-lt,m.value===ne.AREA_0?e.lam=-l+lt:m.value===ne.AREA_1?e.lam=-l:m.value===ne.AREA_2?e.lam=-l-lt:e.lam=l<0?-l-Pe:-l+Pe;else{var y,w,S;y=d,v=y*y,v>=1?S=0:S=Math.sqrt(1-v)*Math.sin(l),v+=S*S,v>=1?w=0:w=Math.sqrt(1-v),m.value===ne.AREA_1?(v=w,w=-S,S=v):m.value===ne.AREA_2?(w=-w,S=-S):m.value===ne.AREA_3&&(v=w,w=S,S=-v),this.face===pe.RIGHT?(v=y,y=-w,w=v):this.face===pe.BACK?(y=-y,w=-w):this.face===pe.LEFT&&(v=y,y=w,w=-v),e.phi=Math.acos(-S)-lt,e.lam=Math.atan2(w,y),this.face===pe.RIGHT?e.lam=pa(e.lam,-lt):this.face===pe.BACK?e.lam=pa(e.lam,-Pe):this.face===pe.LEFT&&(e.lam=pa(e.lam,+lt))}if(this.es!==0){var T,N,j;T=e.phi<0?1:0,N=Math.tan(e.phi),j=this.b/Math.sqrt(N*N+this.one_minus_f_squared),e.phi=Math.atan(Math.sqrt(this.a*this.a-j*j)/(this.one_minus_f*j)),T&&(e.phi=-e.phi)}return e.lam+=this.long0,i.x=e.lam,i.y=e.phi,i}function El(i,e,t,n){var s;return i<ft?(n.value=ne.AREA_0,s=0):(s=Math.atan2(e,t),Math.abs(s)<=ie?n.value=ne.AREA_0:s>ie&&s<=lt+ie?(n.value=ne.AREA_1,s-=lt):s>lt+ie||s<=-(lt+ie)?(n.value=ne.AREA_2,s=s>=0?s-Pe:s+Pe):(n.value=ne.AREA_3,s+=lt)),s}function pa(i,e){var t=i+e;return t<-Pe?t+=Bo:t>+Pe&&(t-=Bo),t}var zP=["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"];const UP={init:GP,forward:jP,inverse:BP,names:zP};var ed=[[1,22199e-21,-715515e-10,31103e-10],[.9986,-482243e-9,-24897e-9,-13309e-10],[.9954,-83103e-8,-448605e-10,-986701e-12],[.99,-.00135364,-59661e-9,36777e-10],[.9822,-.00167442,-449547e-11,-572411e-11],[.973,-.00214868,-903571e-10,18736e-12],[.96,-.00305085,-900761e-10,164917e-11],[.9427,-.00382792,-653386e-10,-26154e-10],[.9216,-.00467746,-10457e-8,481243e-11],[.8962,-.00536223,-323831e-10,-543432e-11],[.8679,-.00609363,-113898e-9,332484e-11],[.835,-.00698325,-640253e-10,934959e-12],[.7986,-.00755338,-500009e-10,935324e-12],[.7597,-.00798324,-35971e-9,-227626e-11],[.7186,-.00851367,-701149e-10,-86303e-10],[.6732,-.00986209,-199569e-9,191974e-10],[.6213,-.010418,883923e-10,624051e-11],[.5722,-.00906601,182e-6,624051e-11],[.5322,-.00677797,275608e-9,624051e-11]],Jo=[[-520417e-23,.0124,121431e-23,-845284e-16],[.062,.0124,-126793e-14,422642e-15],[.124,.0124,507171e-14,-160604e-14],[.186,.0123999,-190189e-13,600152e-14],[.248,.0124002,710039e-13,-224e-10],[.31,.0123992,-264997e-12,835986e-13],[.372,.0124029,988983e-12,-311994e-12],[.434,.0123893,-369093e-11,-435621e-12],[.4958,.0123198,-102252e-10,-345523e-12],[.5571,.0121916,-154081e-10,-582288e-12],[.6176,.0119938,-241424e-10,-525327e-12],[.6769,.011713,-320223e-10,-516405e-12],[.7346,.0113541,-397684e-10,-609052e-12],[.7903,.0109107,-489042e-10,-104739e-11],[.8435,.0103431,-64615e-9,-140374e-14],[.8936,.00969686,-64636e-9,-8547e-9],[.9394,.00840947,-192841e-9,-42106e-10],[.9761,.00616527,-256e-6,-42106e-10],[1,.00328947,-319159e-9,-42106e-10]],y0=.8487,_0=1.3523,w0=ci/5,VP=1/w0,ma=18,Sl=function(i,e){return i[0]+e*(i[1]+e*(i[2]+e*i[3]))},qP=function(i,e){return i[1]+e*(2*i[2]+e*3*i[3])};function $P(i,e,t,n){for(var s=e;n;--n){var o=i(s);if(s-=o,Math.abs(o)<t)break}return s}function WP(){this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.es=0,this.title=this.title||"Robinson"}function HP(i){var e=wt(i.x-this.long0,this.over),t=Math.abs(i.y),n=Math.floor(t*w0);n<0?n=0:n>=ma&&(n=ma-1),t=ci*(t-VP*n);var s={x:Sl(ed[n],t)*e,y:Sl(Jo[n],t)};return i.y<0&&(s.y=-s.y),s.x=s.x*this.a*y0+this.x0,s.y=s.y*this.a*_0+this.y0,s}function XP(i){var e={x:(i.x-this.x0)/(this.a*y0),y:Math.abs(i.y-this.y0)/(this.a*_0)};if(e.y>=1)e.x/=ed[ma][0],e.y=i.y<0?-lt:lt;else{var t=Math.floor(e.y*ma);for(t<0?t=0:t>=ma&&(t=ma-1);;)if(Jo[t][0]>e.y)--t;else if(Jo[t+1][0]<=e.y)++t;else break;var n=Jo[t],s=5*(e.y-n[0])/(Jo[t+1][0]-n[0]);s=$P(function(o){return(Sl(n,o)-e.y)/qP(n,o)},s,ft,100),e.x/=Sl(ed[t],s),e.y=(5*t+s)*Ee,i.y<0&&(e.y=-e.y)}return e.x=wt(e.x+this.long0,this.over),e}var YP=["Robinson","robin"];const JP={init:WP,forward:HP,inverse:XP,names:YP};function KP(){this.name="geocent"}function ZP(i){var e=Jm(i,this.es,this.a);return e}function QP(i){var e=Km(i,this.es,this.a,this.b);return e}var tC=["Geocentric","geocentric","geocent","Geocent"];const eC={init:KP,forward:ZP,inverse:QP,names:tC};var We={N_POLE:0,S_POLE:1,EQUIT:2,OBLIQ:3},Ko={h:{def:1e5,num:!0},azi:{def:0,num:!0,degrees:!0},tilt:{def:0,num:!0,degrees:!0},long0:{def:0,num:!0},lat0:{def:0,num:!0}};function iC(){if(Object.keys(Ko).forEach((function(t){if(typeof this[t]>"u")this[t]=Ko[t].def;else{if(Ko[t].num&&isNaN(this[t]))throw new Error("Invalid parameter value, must be numeric "+t+" = "+this[t]);Ko[t].num&&(this[t]=parseFloat(this[t]))}Ko[t].degrees&&(this[t]=this[t]*Ee)}).bind(this)),Math.abs(Math.abs(this.lat0)-lt)<ft?this.mode=this.lat0<0?We.S_POLE:We.N_POLE:Math.abs(this.lat0)<ft?this.mode=We.EQUIT:(this.mode=We.OBLIQ,this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0)),this.pn1=this.h/this.a,this.pn1<=0||this.pn1>1e10)throw new Error("Invalid height");this.p=1+this.pn1,this.rp=1/this.p,this.h1=1/this.pn1,this.pfact=(this.p+1)*this.h1,this.es=0;var i=this.tilt,e=this.azi;this.cg=Math.cos(e),this.sg=Math.sin(e),this.cw=Math.cos(i),this.sw=Math.sin(i)}function nC(i){i.x-=this.long0;var e=Math.sin(i.y),t=Math.cos(i.y),n=Math.cos(i.x),s,o;switch(this.mode){case We.OBLIQ:o=this.sinph0*e+this.cosph0*t*n;break;case We.EQUIT:o=t*n;break;case We.S_POLE:o=-e;break;case We.N_POLE:o=e;break}switch(o=this.pn1/(this.p-o),s=o*t*Math.sin(i.x),this.mode){case We.OBLIQ:o*=this.cosph0*e-this.sinph0*t*n;break;case We.EQUIT:o*=e;break;case We.N_POLE:o*=-(t*n);break;case We.S_POLE:o*=t*n;break}var h,l;return h=o*this.cg+s*this.sg,l=1/(h*this.sw*this.h1+this.cw),s=(s*this.cg-o*this.sg)*this.cw*l,o=h*l,i.x=s*this.a,i.y=o*this.a,i}function sC(i){i.x/=this.a,i.y/=this.a;var e={x:i.x,y:i.y},t,n,s;s=1/(this.pn1-i.y*this.sw),t=this.pn1*i.x*s,n=this.pn1*i.y*this.cw*s,i.x=t*this.cg+n*this.sg,i.y=n*this.cg-t*this.sg;var o=gi(i.x,i.y);if(Math.abs(o)<ft)e.x=0,e.y=i.y;else{var h,l;switch(l=1-o*o*this.pfact,l=(this.p-Math.sqrt(l))/(this.pn1/o+o/this.pn1),h=Math.sqrt(1-l*l),this.mode){case We.OBLIQ:e.y=Math.asin(h*this.sinph0+i.y*l*this.cosph0/o),i.y=(h-this.sinph0*Math.sin(e.y))*o,i.x*=l*this.cosph0;break;case We.EQUIT:e.y=Math.asin(i.y*l/o),i.y=h*o,i.x*=l;break;case We.N_POLE:e.y=Math.asin(h),i.y=-i.y;break;case We.S_POLE:e.y=-Math.asin(h);break}e.x=Math.atan2(i.x,i.y)}return i.x=e.x+this.long0,i.y=e.y,i}var rC=["Tilted_Perspective","tpers"];const aC={init:iC,forward:nC,inverse:sC,names:rC};function oC(){if(this.flip_axis=this.sweep==="x"?1:0,this.h=Number(this.h),this.radius_g_1=this.h/this.a,this.radius_g_1<=0||this.radius_g_1>1e10)throw new Error;if(this.radius_g=1+this.radius_g_1,this.C=this.radius_g*this.radius_g-1,this.es!==0){var i=1-this.es,e=1/i;this.radius_p=Math.sqrt(i),this.radius_p2=i,this.radius_p_inv2=e,this.shape="ellipse"}else this.radius_p=1,this.radius_p2=1,this.radius_p_inv2=1,this.shape="sphere";this.title||(this.title="Geostationary Satellite View")}function hC(i){var e=i.x,t=i.y,n,s,o,h;if(e=e-this.long0,this.shape==="ellipse"){t=Math.atan(this.radius_p2*Math.tan(t));var l=this.radius_p/gi(this.radius_p*Math.cos(t),Math.sin(t));if(s=l*Math.cos(e)*Math.cos(t),o=l*Math.sin(e)*Math.cos(t),h=l*Math.sin(t),(this.radius_g-s)*s-o*o-h*h*this.radius_p_inv2<0)return i.x=Number.NaN,i.y=Number.NaN,i;n=this.radius_g-s,this.flip_axis?(i.x=this.radius_g_1*Math.atan(o/gi(h,n)),i.y=this.radius_g_1*Math.atan(h/n)):(i.x=this.radius_g_1*Math.atan(o/n),i.y=this.radius_g_1*Math.atan(h/gi(o,n)))}else this.shape==="sphere"&&(n=Math.cos(t),s=Math.cos(e)*n,o=Math.sin(e)*n,h=Math.sin(t),n=this.radius_g-s,this.flip_axis?(i.x=this.radius_g_1*Math.atan(o/gi(h,n)),i.y=this.radius_g_1*Math.atan(h/n)):(i.x=this.radius_g_1*Math.atan(o/n),i.y=this.radius_g_1*Math.atan(h/gi(o,n))));return i.x=i.x*this.a,i.y=i.y*this.a,i}function lC(i){var e=-1,t=0,n=0,s,o,h,l;if(i.x=i.x/this.a,i.y=i.y/this.a,this.shape==="ellipse"){this.flip_axis?(n=Math.tan(i.y/this.radius_g_1),t=Math.tan(i.x/this.radius_g_1)*gi(1,n)):(t=Math.tan(i.x/this.radius_g_1),n=Math.tan(i.y/this.radius_g_1)*gi(1,t));var d=n/this.radius_p;if(s=t*t+d*d+e*e,o=2*this.radius_g*e,h=o*o-4*s*this.C,h<0)return i.x=Number.NaN,i.y=Number.NaN,i;l=(-o-Math.sqrt(h))/(2*s),e=this.radius_g+l*e,t*=l,n*=l,i.x=Math.atan2(t,e),i.y=Math.atan(n*Math.cos(i.x)/e),i.y=Math.atan(this.radius_p_inv2*Math.tan(i.y))}else if(this.shape==="sphere"){if(this.flip_axis?(n=Math.tan(i.y/this.radius_g_1),t=Math.tan(i.x/this.radius_g_1)*Math.sqrt(1+n*n)):(t=Math.tan(i.x/this.radius_g_1),n=Math.tan(i.y/this.radius_g_1)*Math.sqrt(1+t*t)),s=t*t+n*n+e*e,o=2*this.radius_g*e,h=o*o-4*s*this.C,h<0)return i.x=Number.NaN,i.y=Number.NaN,i;l=(-o-Math.sqrt(h))/(2*s),e=this.radius_g+l*e,t*=l,n*=l,i.x=Math.atan2(t,e),i.y=Math.atan(n*Math.cos(i.x)/e)}return i.x=i.x+this.long0,i}var uC=["Geostationary Satellite View","Geostationary_Satellite","geos"];const cC={init:oC,forward:hC,inverse:lC,names:uC};var Zo=1.340264,Qo=-.081106,th=893e-6,eh=.003796,xl=Math.sqrt(3)/2;function dC(){this.es=0,this.long0=this.long0!==void 0?this.long0:0,this.x0=this.x0!==void 0?this.x0:0,this.y0=this.y0!==void 0?this.y0:0}function fC(i){var e=wt(i.x-this.long0,this.over),t=i.y,n=Math.asin(xl*Math.sin(t)),s=n*n,o=s*s*s;return i.x=e*Math.cos(n)/(xl*(Zo+3*Qo*s+o*(7*th+9*eh*s))),i.y=n*(Zo+Qo*s+o*(th+eh*s)),i.x=this.a*i.x+this.x0,i.y=this.a*i.y+this.y0,i}function gC(i){i.x=(i.x-this.x0)/this.a,i.y=(i.y-this.y0)/this.a;var e=1e-9,t=12,n=i.y,s,o,h,l,d,f;for(f=0;f<t&&(s=n*n,o=s*s*s,h=n*(Zo+Qo*s+o*(th+eh*s))-i.y,l=Zo+3*Qo*s+o*(7*th+9*eh*s),n-=d=h/l,!(Math.abs(d)<e));++f);return s=n*n,o=s*s*s,i.x=xl*i.x*(Zo+3*Qo*s+o*(7*th+9*eh*s))/Math.cos(n),i.y=Math.asin(Math.sin(n)/xl),i.x=wt(i.x+this.long0,this.over),i}var pC=["eqearth","Equal Earth","Equal_Earth"];const mC={init:dC,forward:fC,inverse:gC,names:pC};var ih=1e-10;function vC(){var i;if(this.phi1=this.lat1,Math.abs(this.phi1)<ih)throw new Error;this.es?(this.en=$c(this.es),this.m1=fa(this.phi1,this.am1=Math.sin(this.phi1),i=Math.cos(this.phi1),this.en),this.am1=i/(Math.sqrt(1-this.es*this.am1*this.am1)*this.am1),this.inverse=_C,this.forward=yC):(Math.abs(this.phi1)+ih>=lt?this.cphi1=0:this.cphi1=1/Math.tan(this.phi1),this.inverse=EC,this.forward=wC)}function yC(i){var e=wt(i.x-(this.long0||0),this.over),t=i.y,n,s,o;return n=this.am1+this.m1-fa(t,s=Math.sin(t),o=Math.cos(t),this.en),s=o*e/(n*Math.sqrt(1-this.es*s*s)),i.x=n*Math.sin(s),i.y=this.am1-n*Math.cos(s),i.x=this.a*i.x+(this.x0||0),i.y=this.a*i.y+(this.y0||0),i}function _C(i){i.x=(i.x-(this.x0||0))/this.a,i.y=(i.y-(this.y0||0))/this.a;var e,t,n,s;if(t=gi(i.x,i.y=this.am1-i.y),s=Wc(this.am1+this.m1-t,this.es,this.en),(e=Math.abs(s))<lt)e=Math.sin(s),n=t*Math.atan2(i.x,i.y)*Math.sqrt(1-this.es*e*e)/Math.cos(s);else if(Math.abs(e-lt)<=ih)n=0;else throw new Error;return i.x=wt(n+(this.long0||0),this.over),i.y=bs(s),i}function wC(i){var e=wt(i.x-(this.long0||0),this.over),t=i.y,n,s;return s=this.cphi1+this.phi1-t,Math.abs(s)>ih?(i.x=s*Math.sin(n=e*Math.cos(t)/s),i.y=this.cphi1-s*Math.cos(n)):i.x=i.y=0,i.x=this.a*i.x+(this.x0||0),i.y=this.a*i.y+(this.y0||0),i}function EC(i){i.x=(i.x-(this.x0||0))/this.a,i.y=(i.y-(this.y0||0))/this.a;var e,t,n=gi(i.x,i.y=this.cphi1-i.y);if(t=this.cphi1+this.phi1-n,Math.abs(t)>lt)throw new Error;return Math.abs(Math.abs(t)-lt)<=ih?e=0:e=n*Math.atan2(i.x,i.y)/Math.cos(t),i.x=wt(e+(this.long0||0),this.over),i.y=bs(t),i}var SC=["bonne","Bonne (Werner lat_1=90)"];const xC={init:vC,names:SC},E0={OBLIQUE:{forward:MC,inverse:kC},TRANSVERSE:{forward:TC,inverse:OC}},bl={ROTATE:{o_alpha:"oAlpha",o_lon_c:"oLongC",o_lat_c:"oLatC"},NEW_POLE:{o_lat_p:"oLatP",o_lon_p:"oLongP"},NEW_EQUATOR:{o_lon_1:"oLong1",o_lat_1:"oLat1",o_lon_2:"oLong2",o_lat_2:"oLat2"}};function bC(){if(this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.title=this.title||"General Oblique Transformation",this.isIdentity=$m.includes(this.o_proj),!this.o_proj)throw new Error("Missing parameter: o_proj");if(this.o_proj==="ob_tran")throw new Error("Invalid value for o_proj: "+this.o_proj);const i=this.projStr.replace("+proj=ob_tran","").replace("+o_proj=","+proj=").trim(),e=Fi(i);if(!e)throw new Error("Invalid parameter: o_proj. Unknown projection "+this.o_proj);e.long0=0,this.obliqueProjection=e;let t;const n=Object.keys(bl),s=l=>{if(typeof this[l]>"u")return;const d=parseFloat(this[l])*Ee;if(isNaN(d))throw new Error("Invalid value for "+l+": "+this[l]);return d};for(let l=0;l<n.length;l++){const d=n[l],f=bl[d],v=Object.entries(f);if(v.some(([y])=>typeof this[y]<"u")){t=f;for(let y=0;y<v.length;y++){const[w,S]=v[y],T=s(w);if(typeof T>"u")throw new Error("Missing parameter: "+w+".");this[S]=T}break}}if(!t)throw new Error("No valid parameters provided for ob_tran projection.");const{lamp:o,phip:h}=IC(this,t);this.lamp=o,Math.abs(h)>ft?(this.cphip=Math.cos(h),this.sphip=Math.sin(h),this.projectionType=E0.OBLIQUE):this.projectionType=E0.TRANSVERSE}function PC(i){return this.projectionType.forward(this,i)}function CC(i){return this.projectionType.inverse(this,i)}function IC(i,e){let t,n;if(e===bl.ROTATE){let s=i.oLongC,o=i.oLatC,h=i.oAlpha;if(Math.abs(Math.abs(o)-lt)<=ft)throw new Error("Invalid value for o_lat_c: "+i.o_lat_c+" should be < 90°");n=s+Math.atan2(-1*Math.cos(h),-1*Math.sin(h)*Math.sin(o)),t=Math.asin(Math.cos(o)*Math.sin(h))}else if(e===bl.NEW_POLE)n=i.oLongP,t=i.oLatP;else{let s=i.oLong1,o=i.oLat1,h=i.oLong2,l=i.oLat2,d=Math.abs(o);if(Math.abs(o)>lt-ft)throw new Error("Invalid value for o_lat_1: "+i.o_lat_1+" should be < 90°");if(Math.abs(l)>lt-ft)throw new Error("Invalid value for o_lat_2: "+i.o_lat_2+" should be < 90°");if(Math.abs(o-l)<ft)throw new Error("Invalid value for o_lat_1 and o_lat_2: o_lat_1 should be different from o_lat_2");if(d<ft)throw new Error("Invalid value for o_lat_1: o_lat_1 should be different from zero");n=Math.atan2(Math.cos(o)*Math.sin(l)*Math.cos(s)-Math.sin(o)*Math.cos(l)*Math.cos(h),Math.sin(o)*Math.cos(l)*Math.sin(h)-Math.cos(o)*Math.sin(l)*Math.sin(s)),t=Math.atan(-1*Math.cos(n-s)/Math.tan(o))}return{lamp:n,phip:t}}function MC(i,e){let{x:t,y:n}=e;t+=i.long0;const s=Math.cos(t),o=Math.sin(n),h=Math.cos(n);e.x=wt(Math.atan2(h*Math.sin(t),i.sphip*h*s+i.cphip*o)+i.lamp),e.y=Math.asin(i.sphip*o-i.cphip*h*s);const l=i.obliqueProjection.forward(e);return i.isIdentity&&(l.x*=ci,l.y*=ci),l}function TC(i,e){let{x:t,y:n}=e;t+=i.long0;const s=Math.cos(n),o=Math.cos(t);e.x=wt(Math.atan2(s*Math.sin(t),Math.sin(n))+i.lamp),e.y=Math.asin(-1*s*o);const h=i.obliqueProjection.forward(e);return i.isIdentity&&(h.x*=ci,h.y*=ci),h}function kC(i,e){i.isIdentity&&(e.x*=Ee,e.y*=Ee);const t=i.obliqueProjection.inverse(e);let{x:n,y:s}=t;if(n<Number.MAX_VALUE){n-=i.lamp;const o=Math.cos(n),h=Math.sin(s),l=Math.cos(s);e.x=Math.atan2(l*Math.sin(n),i.sphip*l*o-i.cphip*h),e.y=Math.asin(i.sphip*h+i.cphip*l*o)}return e.x=wt(e.x+i.long0),e}function OC(i,e){i.isIdentity&&(e.x*=Ee,e.y*=Ee);const t=i.obliqueProjection.inverse(e);let{x:n,y:s}=t;if(n<Number.MAX_VALUE){const o=Math.cos(s);n-=i.lamp,e.x=Math.atan2(o*Math.sin(n),-1*Math.sin(s)),e.y=Math.asin(o*Math.cos(n))}return e.x=wt(e.x+i.long0),e}var NC=["General Oblique Transformation","General_Oblique_Transformation","ob_tran"];const RC={init:bC,forward:PC,inverse:CC,names:NC};function AC(i){i.Proj.projections.add(vl),i.Proj.projections.add(yl),i.Proj.projections.add(Sx),i.Proj.projections.add(Ox),i.Proj.projections.add(Lx),i.Proj.projections.add(zx),i.Proj.projections.add(Hx),i.Proj.projections.add(Zx),i.Proj.projections.add(nb),i.Proj.projections.add(hb),i.Proj.projections.add(Eb),i.Proj.projections.add(Ib),i.Proj.projections.add(Nb),i.Proj.projections.add(Gb),i.Proj.projections.add(Vb),i.Proj.projections.add(Xb),i.Proj.projections.add(Qb),i.Proj.projections.add(sP),i.Proj.projections.add(uP),i.Proj.projections.add(pP),i.Proj.projections.add(wP),i.Proj.projections.add(PP),i.Proj.projections.add(NP),i.Proj.projections.add(FP),i.Proj.projections.add(UP),i.Proj.projections.add(JP),i.Proj.projections.add(eC),i.Proj.projections.add(aC),i.Proj.projections.add(cC),i.Proj.projections.add(mC),i.Proj.projections.add(xC),i.Proj.projections.add(RC)}const id=Object.assign(jS,{defaultDatum:"WGS84",Proj:Fi,WGS84:new Fi("WGS84"),Point:da,toPoint:e0,defs:Be,nadgrid:ES,transform:pl,mgrs:BS,version:"__VERSION__"});AC(id);const S0=id("+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees","+proj=geocent +datum=WGS84");function sn(i){return S0.forward(i)}function nd(i){return S0.inverse(i)}const x0=id("+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees","+proj=merc +a=6378137 +b=6378137 +lat_ts=0 +lon_0=0 +x_0=0 +y_0=0 +k=1 +units=m +nadgrids=@null +wktext +no_defs +type=crs");function DC(i){const e=x0.forward([i[0],i[1]]);return[e[0],e[1],i[2]]}function LC(i){const e=x0.inverse([i[0],i[1]]);return[e[0],e[1],i[2]]}var Le=63710088e-1,b0={centimeters:Le*100,centimetres:Le*100,degrees:360/(2*Math.PI),feet:Le*3.28084,inches:Le*39.37,kilometers:Le/1e3,kilometres:Le/1e3,meters:Le,metres:Le,miles:Le/1609.344,millimeters:Le*1e3,millimetres:Le*1e3,nauticalmiles:Le/1852,radians:1,yards:Le*1.0936};function ni(i,e,t={}){const n={type:"Feature"};return(t.id===0||t.id)&&(n.id=t.id),t.bbox&&(n.bbox=t.bbox),n.properties=e||{},n.geometry=i,n}function Xt(i,e,t={}){if(!i)throw new Error("coordinates is required");if(!Array.isArray(i))throw new Error("coordinates must be an Array");if(i.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!hd(i[0])||!hd(i[1]))throw new Error("coordinates must contain numbers");return ni({type:"Point",coordinates:i},e,t)}function de(i,e,t={}){for(const s of i){if(s.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");if(s[s.length-1].length!==s[0].length)throw new Error("First and last Position are not equivalent.");for(let o=0;o<s[s.length-1].length;o++)if(s[s.length-1][o]!==s[0][o])throw new Error("First and last Position are not equivalent.")}return ni({type:"Polygon",coordinates:i},e,t)}function sd(i,e,t={}){return ae(i.map(n=>de(n,e)),t)}function Ce(i,e,t={}){if(i.length<2)throw new Error("coordinates must be an array of two or more positions");return ni({type:"LineString",coordinates:i},e,t)}function ae(i,e={}){const t={type:"FeatureCollection"};return e.id&&(t.id=e.id),e.bbox&&(t.bbox=e.bbox),t.features=i,t}function FC(i,e,t={}){return ni({type:"MultiLineString",coordinates:i},e,t)}function rd(i,e,t={}){return ni({type:"MultiPolygon",coordinates:i},e,t)}function ad(i,e="kilometers"){const t=b0[e];if(!t)throw new Error(e+" units is invalid");return i*t}function od(i,e="kilometers"){const t=b0[e];if(!t)throw new Error(e+" units is invalid");return i/t}function va(i){return i%(2*Math.PI)*180/Math.PI}function Fe(i){return i%360*Math.PI/180}function nh(i,e="kilometers",t="kilometers"){if(!(i>=0))throw new Error("length must be a positive number");return ad(od(i,e),t)}function hd(i){return!isNaN(i)&&i!==null&&!Array.isArray(i)}function GC(i){return i!==null&&typeof i=="object"&&!Array.isArray(i)}function jC(i){if(!i)throw new Error("bbox is required");if(!Array.isArray(i))throw new Error("bbox must be an Array");if(i.length!==4&&i.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");i.forEach(e=>{if(!hd(e))throw new Error("bbox must only contain numbers")})}function Ie(i){if(!i)throw new Error("coord is required");if(!Array.isArray(i)){if(i.type==="Feature"&&i.geometry!==null&&i.geometry.type==="Point")return[...i.geometry.coordinates];if(i.type==="Point")return[...i.coordinates]}if(Array.isArray(i)&&i.length>=2&&!Array.isArray(i[0])&&!Array.isArray(i[1]))return[...i];throw new Error("coord must be GeoJSON Point or an Array of numbers")}function Si(i){if(Array.isArray(i))return i;if(i.type==="Feature"){if(i.geometry!==null)return i.geometry.coordinates}else if(i.coordinates)return i.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}function P0(i,e,t){if(!i)throw new Error("No feature passed");if(!t)throw new Error(".featureOf() requires a name");if(!i||i.type!=="Feature"||!i.geometry)throw new Error("Invalid input to "+t+", Feature with geometry required");if(!i.geometry||i.geometry.type!==e)throw new Error("Invalid input to "+t+": must be a "+e+", given "+i.geometry.type)}function BC(i,e,t){if(!i)throw new Error("No featureCollection passed");if(!i||i.type!=="FeatureCollection")throw new Error("Invalid input to "+t+", FeatureCollection required");for(const n of i.features){if(!n||n.type!=="Feature"||!n.geometry)throw new Error("Invalid input to "+t+", Feature with geometry required");if(!n.geometry||n.geometry.type!==e)throw new Error("Invalid input to "+t+": must be a "+e+", given "+n.geometry.type)}}function Sn(i){return i.type==="Feature"?i.geometry:i}function ld(i,e){return i.type==="FeatureCollection"?"FeatureCollection":i.type==="GeometryCollection"?"GeometryCollection":i.type==="Feature"&&i.geometry!==null?i.geometry.type:i.type}function sh(i,e,t={}){if(t.final===!0)return zC(i,e);const n=Ie(i),s=Ie(e),o=Fe(n[0]),h=Fe(s[0]),l=Fe(n[1]),d=Fe(s[1]),f=Math.sin(h-o)*Math.cos(d),v=Math.cos(l)*Math.sin(d)-Math.sin(l)*Math.cos(d)*Math.cos(h-o);return va(Math.atan2(f,v))}function zC(i,e){let t=sh(e,i);return t=(t+180)%360,t}function xn(i,e,t,n={}){const s=Ie(i),o=Fe(s[0]),h=Fe(s[1]),l=Fe(t),d=od(e,n.units),f=Math.asin(Math.sin(h)*Math.cos(d)+Math.cos(h)*Math.sin(d)*Math.cos(l)),v=o+Math.atan2(Math.sin(l)*Math.sin(d)*Math.cos(h),Math.cos(d)-Math.sin(h)*Math.sin(f)),m=va(v),y=va(f);return s[2]!==void 0?Xt([m,y,s[2]],n.properties):Xt([m,y],n.properties)}function pi(i,e,t={}){var n=Ie(i),s=Ie(e),o=Fe(s[1]-n[1]),h=Fe(s[0]-n[0]),l=Fe(n[1]),d=Fe(s[1]),f=Math.pow(Math.sin(o/2),2)+Math.pow(Math.sin(h/2),2)*Math.cos(l)*Math.cos(d);return ad(2*Math.atan2(Math.sqrt(f),Math.sqrt(1-f)),t.units)}function ud(i,e,t={}){const s=Sn(i).coordinates;let o=0;for(let h=0;h<s.length&&!(e>=o&&h===s.length-1);h++)if(o>=e){const l=e-o;if(l){const d=sh(s[h],s[h-1])-180;return xn(s[h],l,d,t)}else return Xt(s[h])}else o+=pi(s[h],s[h+1],t);return Xt(s[s.length-1])}function UC(i,e,t={}){let n;return t.final?n=C0(Ie(e),Ie(i)):n=C0(Ie(i),Ie(e)),n>180?-(360-n):n}function C0(i,e){const t=Fe(i[1]),n=Fe(e[1]);let s=Fe(e[0]-i[0]);s>Math.PI&&(s-=2*Math.PI),s<-Math.PI&&(s+=2*Math.PI);const o=Math.log(Math.tan(n/2+Math.PI/4)/Math.tan(t/2+Math.PI/4)),h=Math.atan2(s,o);return(va(h)+360)%360}function rr(i,e,t){if(i!==null)for(var n,s,o,h,l,d,f,v=0,m=0,y,w=i.type,S=w==="FeatureCollection",T=w==="Feature",N=S?i.features.length:1,j=0;j<N;j++){f=S?i.features[j].geometry:T?i.geometry:i,y=f?f.type==="GeometryCollection":!1,l=y?f.geometries.length:1;for(var C=0;C<l;C++){var k=0,M=0;if(h=y?f.geometries[C]:f,h!==null){d=h.coordinates;var D=h.type;switch(v=t&&(D==="Polygon"||D==="MultiPolygon")?1:0,D){case null:break;case"Point":if(e(d,m,j,k,M)===!1)return!1;m++,k++;break;case"LineString":case"MultiPoint":for(n=0;n<d.length;n++){if(e(d[n],m,j,k,M)===!1)return!1;m++,D==="MultiPoint"&&k++}D==="LineString"&&k++;break;case"Polygon":case"MultiLineString":for(n=0;n<d.length;n++){for(s=0;s<d[n].length-v;s++){if(e(d[n][s],m,j,k,M)===!1)return!1;m++}D==="MultiLineString"&&k++,D==="Polygon"&&M++}D==="Polygon"&&k++;break;case"MultiPolygon":for(n=0;n<d.length;n++){for(M=0,s=0;s<d[n].length;s++){for(o=0;o<d[n][s].length-v;o++){if(e(d[n][s][o],m,j,k,M)===!1)return!1;m++}M++}k++}break;case"GeometryCollection":for(n=0;n<h.geometries.length;n++)if(rr(h.geometries[n],e,t)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function Is(i,e){if(i.type==="Feature")e(i,0);else if(i.type==="FeatureCollection")for(var t=0;t<i.features.length&&e(i.features[t],t)!==!1;t++);}function VC(i,e,t){var n=t;return Is(i,function(s,o){o===0&&t===void 0?n=s:n=e(n,s,o)}),n}function ar(i,e){var t,n,s,o,h,l,d,f,v,m,y=0,w=i.type==="FeatureCollection",S=i.type==="Feature",T=w?i.features.length:1;for(t=0;t<T;t++){for(l=w?i.features[t].geometry:S?i.geometry:i,f=w?i.features[t].properties:S?i.properties:{},v=w?i.features[t].bbox:S?i.bbox:void 0,m=w?i.features[t].id:S?i.id:void 0,d=l?l.type==="GeometryCollection":!1,h=d?l.geometries.length:1,s=0;s<h;s++){if(o=d?l.geometries[s]:l,o===null){if(e(null,y,f,v,m)===!1)return!1;continue}switch(o.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(e(o,y,f,v,m)===!1)return!1;break}case"GeometryCollection":{for(n=0;n<o.geometries.length;n++)if(e(o.geometries[n],y,f,v,m)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}y++}}function qC(i,e,t){var n=t;return ar(i,function(s,o,h,l,d){n=e(n,s,o,h,l,d)}),n}function Ms(i,e){ar(i,function(t,n,s,o,h){var l=t===null?null:t.type;switch(l){case null:case"Point":case"LineString":case"Polygon":return e(ni(t,s,{bbox:o,id:h}),n,0)===!1?!1:void 0}var d;switch(l){case"MultiPoint":d="Point";break;case"MultiLineString":d="LineString";break;case"MultiPolygon":d="Polygon";break}for(var f=0;f<t.coordinates.length;f++){var v=t.coordinates[f],m={type:d,coordinates:v};if(e(ni(m,s),n,f)===!1)return!1}})}function I0(i,e){Ms(i,function(t,n,s){var o=0;if(t.geometry){var h=t.geometry.type;if(!(h==="Point"||h==="MultiPoint")){var l,d=0,f=0,v=0;if(rr(t,function(m,y,w,S,T){if(l===void 0||n>d||S>f||T>v){l=m,d=n,f=S,v=T,o=0;return}var N=Ce([l,m],t.properties);if(e(N,n,s,T,o)===!1)return!1;o++,l=m})===!1)return!1}}})}function $C(i,e,t){var n=t,s=!1;return I0(i,function(o,h,l,d,f){s===!1&&t===void 0?n=o:n=e(n,o,h,l,d,f),s=!0}),n}function WC(i){return qC(i,(e,t)=>e+HC(t),0)}function HC(i){let e=0,t;switch(i.type){case"Polygon":return M0(i.coordinates);case"MultiPolygon":for(t=0;t<i.coordinates.length;t++)e+=M0(i.coordinates[t]);return e;case"Point":case"MultiPoint":case"LineString":case"MultiLineString":return 0}return 0}function M0(i){let e=0;if(i&&i.length>0){e+=Math.abs(T0(i[0]));for(let t=1;t<i.length;t++)e-=Math.abs(T0(i[t]))}return e}var XC=Le*Le/2,cd=Math.PI/180;function T0(i){const e=i.length-1;if(e<=2)return 0;let t=0,n=0;for(;n<e;){const s=i[n],o=i[n+1===e?0:n+1],h=i[n+2>=e?(n+2)%e:n+2],l=s[0]*cd,d=o[1]*cd,f=h[0]*cd;t+=(f-l)*Math.sin(d),n++}return t*XC}function He(i,e={}){if(i.bbox!=null&&e.recompute!==!0)return i.bbox;const t=[1/0,1/0,-1/0,-1/0];return rr(i,n=>{t[0]>n[0]&&(t[0]=n[0]),t[1]>n[1]&&(t[1]=n[1]),t[2]<n[0]&&(t[2]=n[0]),t[3]<n[1]&&(t[3]=n[1])}),t}const Zn=11102230246251565e-32,Xe=134217729,YC=(3+8*Zn)*Zn;function dd(i,e,t,n,s){let o,h,l,d,f=e[0],v=n[0],m=0,y=0;v>f==v>-f?(o=f,f=e[++m]):(o=v,v=n[++y]);let w=0;if(m<i&&y<t)for(v>f==v>-f?(h=f+o,l=o-(h-f),f=e[++m]):(h=v+o,l=o-(h-v),v=n[++y]),o=h,l!==0&&(s[w++]=l);m<i&&y<t;)v>f==v>-f?(h=o+f,d=h-o,l=o-(h-d)+(f-d),f=e[++m]):(h=o+v,d=h-o,l=o-(h-d)+(v-d),v=n[++y]),o=h,l!==0&&(s[w++]=l);for(;m<i;)h=o+f,d=h-o,l=o-(h-d)+(f-d),f=e[++m],o=h,l!==0&&(s[w++]=l);for(;y<t;)h=o+v,d=h-o,l=o-(h-d)+(v-d),v=n[++y],o=h,l!==0&&(s[w++]=l);return(o!==0||w===0)&&(s[w++]=o),w}function JC(i,e){let t=e[0];for(let n=1;n<i;n++)t+=e[n];return t}function rh(i){return new Float64Array(i)}const KC=(3+16*Zn)*Zn,ZC=(2+12*Zn)*Zn,QC=(9+64*Zn)*Zn*Zn,ya=rh(4),k0=rh(8),O0=rh(12),N0=rh(16),si=rh(4);function tI(i,e,t,n,s,o,h){let l,d,f,v,m,y,w,S,T,N,j,C,k,M,D,L,V,x;const I=i-s,R=t-s,G=e-o,F=n-o;M=I*F,y=Xe*I,w=y-(y-I),S=I-w,y=Xe*F,T=y-(y-F),N=F-T,D=S*N-(M-w*T-S*T-w*N),L=G*R,y=Xe*G,w=y-(y-G),S=G-w,y=Xe*R,T=y-(y-R),N=R-T,V=S*N-(L-w*T-S*T-w*N),j=D-V,m=D-j,ya[0]=D-(j+m)+(m-V),C=M+j,m=C-M,k=M-(C-m)+(j-m),j=k-L,m=k-j,ya[1]=k-(j+m)+(m-L),x=C+j,m=x-C,ya[2]=C-(x-m)+(j-m),ya[3]=x;let U=JC(4,ya),z=ZC*h;if(U>=z||-U>=z||(m=i-I,l=i-(I+m)+(m-s),m=t-R,f=t-(R+m)+(m-s),m=e-G,d=e-(G+m)+(m-o),m=n-F,v=n-(F+m)+(m-o),l===0&&d===0&&f===0&&v===0)||(z=QC*h+YC*Math.abs(U),U+=I*v+F*l-(G*f+R*d),U>=z||-U>=z))return U;M=l*F,y=Xe*l,w=y-(y-l),S=l-w,y=Xe*F,T=y-(y-F),N=F-T,D=S*N-(M-w*T-S*T-w*N),L=d*R,y=Xe*d,w=y-(y-d),S=d-w,y=Xe*R,T=y-(y-R),N=R-T,V=S*N-(L-w*T-S*T-w*N),j=D-V,m=D-j,si[0]=D-(j+m)+(m-V),C=M+j,m=C-M,k=M-(C-m)+(j-m),j=k-L,m=k-j,si[1]=k-(j+m)+(m-L),x=C+j,m=x-C,si[2]=C-(x-m)+(j-m),si[3]=x;const $=dd(4,ya,4,si,k0);M=I*v,y=Xe*I,w=y-(y-I),S=I-w,y=Xe*v,T=y-(y-v),N=v-T,D=S*N-(M-w*T-S*T-w*N),L=G*f,y=Xe*G,w=y-(y-G),S=G-w,y=Xe*f,T=y-(y-f),N=f-T,V=S*N-(L-w*T-S*T-w*N),j=D-V,m=D-j,si[0]=D-(j+m)+(m-V),C=M+j,m=C-M,k=M-(C-m)+(j-m),j=k-L,m=k-j,si[1]=k-(j+m)+(m-L),x=C+j,m=x-C,si[2]=C-(x-m)+(j-m),si[3]=x;const W=dd($,k0,4,si,O0);M=l*v,y=Xe*l,w=y-(y-l),S=l-w,y=Xe*v,T=y-(y-v),N=v-T,D=S*N-(M-w*T-S*T-w*N),L=d*f,y=Xe*d,w=y-(y-d),S=d-w,y=Xe*f,T=y-(y-f),N=f-T,V=S*N-(L-w*T-S*T-w*N),j=D-V,m=D-j,si[0]=D-(j+m)+(m-V),C=M+j,m=C-M,k=M-(C-m)+(j-m),j=k-L,m=k-j,si[1]=k-(j+m)+(m-L),x=C+j,m=x-C,si[2]=C-(x-m)+(j-m),si[3]=x;const X=dd(W,O0,4,si,N0);return N0[X-1]}function eI(i,e,t,n,s,o){const h=(e-o)*(t-s),l=(i-s)*(n-o),d=h-l,f=Math.abs(h+l);return Math.abs(d)>=KC*f?d:-tI(i,e,t,n,s,o,f)}function iI(i,e){var t,n,s=0,o,h,l,d,f,v,m,y=i[0],w=i[1],S=e.length;for(t=0;t<S;t++){n=0;var T=e[t],N=T.length-1;if(v=T[0],v[0]!==T[N][0]&&v[1]!==T[N][1])throw new Error("First and last coordinates in a ring must be the same");for(h=v[0]-y,l=v[1]-w,n;n<N;n++){if(m=T[n+1],d=m[0]-y,f=m[1]-w,l===0&&f===0){if(d<=0&&h>=0||h<=0&&d>=0)return 0}else if(f>=0&&l<=0||f<=0&&l>=0){if(o=eI(h,d,l,f,0,0),o===0)return 0;(o>0&&f>0&&l<=0||o<0&&f<=0&&l>0)&&s++}v=m,l=f,h=d}}return s%2!==0}function Oe(i,e,t={}){if(!i)throw new Error("point is required");if(!e)throw new Error("polygon is required");const n=Ie(i),s=Sn(e),o=s.type,h=e.bbox;let l=s.coordinates;if(h&&nI(n,h)===!1)return!1;o==="Polygon"&&(l=[l]);let d=!1;for(var f=0;f<l.length;++f){const v=iI(n,l[f]);if(v===0)return!t.ignoreBoundary;v&&(d=!0)}return d}function nI(i,e){return e[0]<=i[0]&&e[1]<=i[1]&&e[2]>=i[0]&&e[3]>=i[1]}function Qn(i,e,t={}){const n=Ie(i),s=Si(e);for(let o=0;o<s.length-1;o++){let h=!1;if(t.ignoreEndVertices&&(o===0&&(h="start"),o===s.length-2&&(h="end"),o===0&&o+1===s.length-1&&(h="both")),sI(s[o],s[o+1],n,h,typeof t.epsilon>"u"?null:t.epsilon))return!0}return!1}function sI(i,e,t,n,s){const o=t[0],h=t[1],l=i[0],d=i[1],f=e[0],v=e[1],m=t[0]-l,y=t[1]-d,w=f-l,S=v-d,T=m*S-y*w;if(s!==null){if(Math.abs(T)>s)return!1}else if(T!==0)return!1;if(Math.abs(w)===Math.abs(S)&&Math.abs(w)===0)return n?!1:t[0]===i[0]&&t[1]===i[1];if(n){if(n==="start")return Math.abs(w)>=Math.abs(S)?w>0?l<o&&o<=f:f<=o&&o<l:S>0?d<h&&h<=v:v<=h&&h<d;if(n==="end")return Math.abs(w)>=Math.abs(S)?w>0?l<=o&&o<f:f<o&&o<=l:S>0?d<=h&&h<v:v<h&&h<=d;if(n==="both")return Math.abs(w)>=Math.abs(S)?w>0?l<o&&o<f:f<o&&o<l:S>0?d<h&&h<v:v<h&&h<d}else return Math.abs(w)>=Math.abs(S)?w>0?l<=o&&o<=f:f<=o&&o<=l:S>0?d<=h&&h<=v:v<=h&&h<=d;return!1}function rI(i,e,t,n,s){R0(i,e,t||0,n||i.length-1,s||aI)}function R0(i,e,t,n,s){for(;n>t;){if(n-t>600){var o=n-t+1,h=e-t+1,l=Math.log(o),d=.5*Math.exp(2*l/3),f=.5*Math.sqrt(l*d*(o-d)/o)*(h-o/2<0?-1:1),v=Math.max(t,Math.floor(e-h*d/o+f)),m=Math.min(n,Math.floor(e+(o-h)*d/o+f));R0(i,e,v,m,s)}var y=i[e],w=t,S=n;for(ah(i,t,e),s(i[n],y)>0&&ah(i,t,n);w<S;){for(ah(i,w,S),w++,S--;s(i[w],y)<0;)w++;for(;s(i[S],y)>0;)S--}s(i[t],y)===0?ah(i,t,S):(S++,ah(i,S,n)),S<=e&&(t=S+1),e<=S&&(n=S-1)}}function ah(i,e,t){var n=i[e];i[e]=i[t],i[t]=n}function aI(i,e){return i<e?-1:i>e?1:0}let oI=class{constructor(e=9){this._maxEntries=Math.max(4,e),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()}all(){return this._all(this.data,[])}search(e){let t=this.data;const n=[];if(!Cl(e,t))return n;const s=this.toBBox,o=[];for(;t;){for(let h=0;h<t.children.length;h++){const l=t.children[h],d=t.leaf?s(l):l;Cl(e,d)&&(t.leaf?n.push(l):gd(e,d)?this._all(l,n):o.push(l))}t=o.pop()}return n}collides(e){let t=this.data;if(!Cl(e,t))return!1;const n=[];for(;t;){for(let s=0;s<t.children.length;s++){const o=t.children[s],h=t.leaf?this.toBBox(o):o;if(Cl(e,h)){if(t.leaf||gd(e,h))return!0;n.push(o)}}t=n.pop()}return!1}load(e){if(!(e&&e.length))return this;if(e.length<this._minEntries){for(let n=0;n<e.length;n++)this.insert(e[n]);return this}let t=this._build(e.slice(),0,e.length-1,0);if(!this.data.children.length)this.data=t;else if(this.data.height===t.height)this._splitRoot(this.data,t);else{if(this.data.height<t.height){const n=this.data;this.data=t,t=n}this._insert(t,this.data.height-t.height-1,!0)}return this}insert(e){return e&&this._insert(e,this.data.height-1),this}clear(){return this.data=wa([]),this}remove(e,t){if(!e)return this;let n=this.data;const s=this.toBBox(e),o=[],h=[];let l,d,f;for(;n||o.length;){if(n||(n=o.pop(),d=o[o.length-1],l=h.pop(),f=!0),n.leaf){const v=hI(e,n.children,t);if(v!==-1)return n.children.splice(v,1),o.push(n),this._condense(o),this}!f&&!n.leaf&&gd(n,s)?(o.push(n),h.push(l),l=0,d=n,n=n.children[0]):d?(l++,n=d.children[l],f=!1):n=null}return this}toBBox(e){return e}compareMinX(e,t){return e.minX-t.minX}compareMinY(e,t){return e.minY-t.minY}toJSON(){return this.data}fromJSON(e){return this.data=e,this}_all(e,t){const n=[];for(;e;)e.leaf?t.push(...e.children):n.push(...e.children),e=n.pop();return t}_build(e,t,n,s){const o=n-t+1;let h=this._maxEntries,l;if(o<=h)return l=wa(e.slice(t,n+1)),_a(l,this.toBBox),l;s||(s=Math.ceil(Math.log(o)/Math.log(h)),h=Math.ceil(o/Math.pow(h,s-1))),l=wa([]),l.leaf=!1,l.height=s;const d=Math.ceil(o/h),f=d*Math.ceil(Math.sqrt(h));A0(e,t,n,f,this.compareMinX);for(let v=t;v<=n;v+=f){const m=Math.min(v+f-1,n);A0(e,v,m,d,this.compareMinY);for(let y=v;y<=m;y+=d){const w=Math.min(y+d-1,m);l.children.push(this._build(e,y,w,s-1))}}return _a(l,this.toBBox),l}_chooseSubtree(e,t,n,s){for(;s.push(t),!(t.leaf||s.length-1===n);){let o=1/0,h=1/0,l;for(let d=0;d<t.children.length;d++){const f=t.children[d],v=fd(f),m=cI(e,f)-v;m<h?(h=m,o=v<o?v:o,l=f):m===h&&v<o&&(o=v,l=f)}t=l||t.children[0]}return t}_insert(e,t,n){const s=n?e:this.toBBox(e),o=[],h=this._chooseSubtree(s,this.data,t,o);for(h.children.push(e),hh(h,s);t>=0&&o[t].children.length>this._maxEntries;)this._split(o,t),t--;this._adjustParentBBoxes(s,o,t)}_split(e,t){const n=e[t],s=n.children.length,o=this._minEntries;this._chooseSplitAxis(n,o,s);const h=this._chooseSplitIndex(n,o,s),l=wa(n.children.splice(h,n.children.length-h));l.height=n.height,l.leaf=n.leaf,_a(n,this.toBBox),_a(l,this.toBBox),t?e[t-1].children.push(l):this._splitRoot(n,l)}_splitRoot(e,t){this.data=wa([e,t]),this.data.height=e.height+1,this.data.leaf=!1,_a(this.data,this.toBBox)}_chooseSplitIndex(e,t,n){let s,o=1/0,h=1/0;for(let l=t;l<=n-t;l++){const d=oh(e,0,l,this.toBBox),f=oh(e,l,n,this.toBBox),v=dI(d,f),m=fd(d)+fd(f);v<o?(o=v,s=l,h=m<h?m:h):v===o&&m<h&&(h=m,s=l)}return s||n-t}_chooseSplitAxis(e,t,n){const s=e.leaf?this.compareMinX:lI,o=e.leaf?this.compareMinY:uI,h=this._allDistMargin(e,t,n,s),l=this._allDistMargin(e,t,n,o);h<l&&e.children.sort(s)}_allDistMargin(e,t,n,s){e.children.sort(s);const o=this.toBBox,h=oh(e,0,t,o),l=oh(e,n-t,n,o);let d=Pl(h)+Pl(l);for(let f=t;f<n-t;f++){const v=e.children[f];hh(h,e.leaf?o(v):v),d+=Pl(h)}for(let f=n-t-1;f>=t;f--){const v=e.children[f];hh(l,e.leaf?o(v):v),d+=Pl(l)}return d}_adjustParentBBoxes(e,t,n){for(let s=n;s>=0;s--)hh(t[s],e)}_condense(e){for(let t=e.length-1,n;t>=0;t--)e[t].children.length===0?t>0?(n=e[t-1].children,n.splice(n.indexOf(e[t]),1)):this.clear():_a(e[t],this.toBBox)}};function hI(i,e,t){if(!t)return e.indexOf(i);for(let n=0;n<e.length;n++)if(t(i,e[n]))return n;return-1}function _a(i,e){oh(i,0,i.children.length,e,i)}function oh(i,e,t,n,s){s||(s=wa(null)),s.minX=1/0,s.minY=1/0,s.maxX=-1/0,s.maxY=-1/0;for(let o=e;o<t;o++){const h=i.children[o];hh(s,i.leaf?n(h):h)}return s}function hh(i,e){return i.minX=Math.min(i.minX,e.minX),i.minY=Math.min(i.minY,e.minY),i.maxX=Math.max(i.maxX,e.maxX),i.maxY=Math.max(i.maxY,e.maxY),i}function lI(i,e){return i.minX-e.minX}function uI(i,e){return i.minY-e.minY}function fd(i){return(i.maxX-i.minX)*(i.maxY-i.minY)}function Pl(i){return i.maxX-i.minX+(i.maxY-i.minY)}function cI(i,e){return(Math.max(e.maxX,i.maxX)-Math.min(e.minX,i.minX))*(Math.max(e.maxY,i.maxY)-Math.min(e.minY,i.minY))}function dI(i,e){const t=Math.max(i.minX,e.minX),n=Math.max(i.minY,e.minY),s=Math.min(i.maxX,e.maxX),o=Math.min(i.maxY,e.maxY);return Math.max(0,s-t)*Math.max(0,o-n)}function gd(i,e){return i.minX<=e.minX&&i.minY<=e.minY&&e.maxX<=i.maxX&&e.maxY<=i.maxY}function Cl(i,e){return e.minX<=i.maxX&&e.minY<=i.maxY&&e.maxX>=i.minX&&e.maxY>=i.minY}function wa(i){return{children:i,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function A0(i,e,t,n,s){const o=[e,t];for(;o.length;){if(t=o.pop(),e=o.pop(),t-e<=n)continue;const h=e+Math.ceil((t-e)/n/2)*n;rI(i,h,e,t,s),o.push(e,h,h,t)}}function pd(i){var e;if(i.bbox)e=i.bbox;else if(Array.isArray(i)&&i.length===4)e=i;else if(Array.isArray(i)&&i.length===6)e=[i[0],i[1],i[3],i[4]];else if(i.type==="Feature")e=He(i);else if(i.type==="FeatureCollection")e=He(i);else throw new Error("invalid geojson");return{minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]}}var fI=class{constructor(i=9){this.tree=new oI(i),this.tree.toBBox=pd}insert(i){if(i.type!=="Feature")throw new Error("invalid feature");return i.bbox=i.bbox?i.bbox:He(i),this.tree.insert(i),this}load(i){var e=[];return Array.isArray(i)?i.forEach(function(t){if(t.type!=="Feature")throw new Error("invalid features");t.bbox=t.bbox?t.bbox:He(t),e.push(t)}):Is(i,function(t){if(t.type!=="Feature")throw new Error("invalid features");t.bbox=t.bbox?t.bbox:He(t),e.push(t)}),this.tree.load(e),this}remove(i,e){if(i.type!=="Feature")throw new Error("invalid feature");return i.bbox=i.bbox?i.bbox:He(i),this.tree.remove(i,e),this}clear(){return this.tree.clear(),this}search(i){var e=this.tree.search(pd(i));return ae(e)}collides(i){return this.tree.collides(pd(i))}all(){const i=this.tree.all();return ae(i)}toJSON(){return this.tree.toJSON()}fromJSON(i){return this.tree.fromJSON(i),this}};function D0(i){return new fI(i)}function gI(i,e){if(e=e??{},!GC(e))throw new Error("options is invalid");var t=e.precision,n=e.coordinates,s=e.mutate;if(t=t==null||isNaN(t)?6:t,n=n==null||isNaN(n)?3:n,!i)throw new Error("<geojson> is required");if(typeof t!="number")throw new Error("<precision> must be a number");if(typeof n!="number")throw new Error("<coordinates> must be a number");(s===!1||s===void 0)&&(i=JSON.parse(JSON.stringify(i)));var o=Math.pow(10,t);return rr(i,function(h){pI(h,o,n)}),i}function pI(i,e,t){i.length>t&&i.splice(t,i.length);for(var n=0;n<i.length;n++)i[n]=Math.round(i[n]*e)/e;return i}function mI(i){if(!i)throw new Error("geojson is required");const e=[];return Ms(i,t=>{vI(t,e)}),ae(e)}function vI(i,e){let t=[];const n=i.geometry;if(n!==null){switch(n.type){case"Polygon":t=Si(n);break;case"LineString":t=[Si(n)]}t.forEach(s=>{yI(s,i.properties).forEach(h=>{h.id=e.length,e.push(h)})})}}function yI(i,e){const t=[];return i.reduce((n,s)=>{const o=Ce([n,s],e);return o.bbox=_I(n,s),t.push(o),s}),t}function _I(i,e){const t=i[0],n=i[1],s=e[0],o=e[1],h=t<s?t:s,l=n<o?n:o,d=t>s?t:s,f=n>o?n:o;return[h,l,d,f]}let L0=class{constructor(e=[],t=wI){if(this.data=e,this.length=this.data.length,this.compare=t,this.length>0)for(let n=(this.length>>1)-1;n>=0;n--)this._down(n)}push(e){this.data.push(e),this.length++,this._up(this.length-1)}pop(){if(this.length===0)return;const e=this.data[0],t=this.data.pop();return this.length--,this.length>0&&(this.data[0]=t,this._down(0)),e}peek(){return this.data[0]}_up(e){const{data:t,compare:n}=this,s=t[e];for(;e>0;){const o=e-1>>1,h=t[o];if(n(s,h)>=0)break;t[e]=h,e=o}t[e]=s}_down(e){const{data:t,compare:n}=this,s=this.length>>1,o=t[e];for(;e<s;){let h=(e<<1)+1,l=t[h];const d=h+1;if(d<this.length&&n(t[d],l)<0&&(h=d,l=t[d]),n(l,o)>=0)break;t[e]=l,e=h}t[e]=o}};function wI(i,e){return i<e?-1:i>e?1:0}function F0(i,e){return i.p.x>e.p.x?1:i.p.x<e.p.x?-1:i.p.y!==e.p.y?i.p.y>e.p.y?1:-1:1}function EI(i,e){return i.rightSweepEvent.p.x>e.rightSweepEvent.p.x?1:i.rightSweepEvent.p.x<e.rightSweepEvent.p.x?-1:i.rightSweepEvent.p.y!==e.rightSweepEvent.p.y?i.rightSweepEvent.p.y<e.rightSweepEvent.p.y?1:-1:1}class G0{constructor(e,t,n,s){this.p={x:e[0],y:e[1]},this.featureId=t,this.ringId=n,this.eventId=s,this.otherEvent=null,this.isLeftEndpoint=null}isSamePoint(e){return this.p.x===e.p.x&&this.p.y===e.p.y}}function SI(i,e){if(i.type==="FeatureCollection"){const t=i.features;for(let n=0;n<t.length;n++)j0(t[n],e)}else j0(i,e)}let Il=0,Ml=0,Tl=0;function j0(i,e){const t=i.type==="Feature"?i.geometry:i;let n=t.coordinates;(t.type==="Polygon"||t.type==="MultiLineString")&&(n=[n]),t.type==="LineString"&&(n=[[n]]);for(let s=0;s<n.length;s++)for(let o=0;o<n[s].length;o++){let h=n[s][o][0],l=null;Ml=Ml+1;for(let d=0;d<n[s][o].length-1;d++){l=n[s][o][d+1];const f=new G0(h,Il,Ml,Tl),v=new G0(l,Il,Ml,Tl+1);f.otherEvent=v,v.otherEvent=f,F0(f,v)>0?(v.isLeftEndpoint=!0,f.isLeftEndpoint=!1):(f.isLeftEndpoint=!0,v.isLeftEndpoint=!1),e.push(f),e.push(v),h=l,Tl=Tl+1}}Il=Il+1}let xI=class{constructor(e){this.leftSweepEvent=e,this.rightSweepEvent=e.otherEvent}};function bI(i,e){if(i===null||e===null||i.leftSweepEvent.ringId===e.leftSweepEvent.ringId&&(i.rightSweepEvent.isSamePoint(e.leftSweepEvent)||i.rightSweepEvent.isSamePoint(e.leftSweepEvent)||i.rightSweepEvent.isSamePoint(e.rightSweepEvent)||i.leftSweepEvent.isSamePoint(e.leftSweepEvent)||i.leftSweepEvent.isSamePoint(e.rightSweepEvent)))return!1;const t=i.leftSweepEvent.p.x,n=i.leftSweepEvent.p.y,s=i.rightSweepEvent.p.x,o=i.rightSweepEvent.p.y,h=e.leftSweepEvent.p.x,l=e.leftSweepEvent.p.y,d=e.rightSweepEvent.p.x,f=e.rightSweepEvent.p.y,v=(f-l)*(s-t)-(d-h)*(o-n),m=(d-h)*(n-l)-(f-l)*(t-h),y=(s-t)*(n-l)-(o-n)*(t-h);if(v===0)return!1;const w=m/v,S=y/v;if(w>=0&&w<=1&&S>=0&&S<=1){const T=t+w*(s-t),N=n+w*(o-n);return[T,N]}return!1}function PI(i,e){e=e||!1;const t=[],n=new L0([],EI);for(;i.length;){const s=i.pop();if(s.isLeftEndpoint){const o=new xI(s);for(let h=0;h<n.data.length;h++){const l=n.data[h];if(e&&l.leftSweepEvent.featureId===s.featureId)continue;const d=bI(o,l);d!==!1&&t.push(d)}n.push(o)}else s.isLeftEndpoint===!1&&n.pop()}return t}function CI(i,e){const t=new L0([],F0);return SI(i,t),PI(t,e)}var II=CI;function or(i,e,t={}){const{removeDuplicates:n=!0,ignoreSelfIntersections:s=!0}=t;let o=[];i.type==="FeatureCollection"?o=o.concat(i.features):i.type==="Feature"?o.push(i):(i.type==="LineString"||i.type==="Polygon"||i.type==="MultiLineString"||i.type==="MultiPolygon")&&o.push(ni(i)),e.type==="FeatureCollection"?o=o.concat(e.features):e.type==="Feature"?o.push(e):(e.type==="LineString"||e.type==="Polygon"||e.type==="MultiLineString"||e.type==="MultiPolygon")&&o.push(ni(e));const h=II(ae(o),s);let l=[];if(n){const d={};h.forEach(f=>{const v=f.join(",");d[v]||(d[v]=!0,l.push(f))})}else l=h;return ae(l.map(d=>Xt(d)))}var MI=Object.defineProperty,TI=Object.defineProperties,kI=Object.getOwnPropertyDescriptors,B0=Object.getOwnPropertySymbols,OI=Object.prototype.hasOwnProperty,NI=Object.prototype.propertyIsEnumerable,z0=(i,e,t)=>e in i?MI(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,RI=(i,e)=>{for(var t in e||(e={}))OI.call(e,t)&&z0(i,t,e[t]);if(B0)for(var t of B0(e))NI.call(e,t)&&z0(i,t,e[t]);return i},AI=(i,e)=>TI(i,kI(e));function md(i,e,t={}){if(!i||!e)throw new Error("lines and inputPoint are required arguments");const n=Ie(e);let s=Xt([1/0,1/0],{lineStringIndex:-1,segmentIndex:-1,totalDistance:-1,lineDistance:-1,segmentDistance:-1,pointDistance:1/0,multiFeatureIndex:-1,index:-1,location:-1,dist:1/0}),o=0,h=0,l=-1;return Ms(i,function(d,f,v){l!==v&&(l=v,h=0);const m=Si(d);for(let y=0;y<m.length-1;y++){const w=Xt(m[y]),S=Ie(w),T=Xt(m[y+1]),N=Ie(T),j=pi(w,T,t);let C,k;N[0]===n[0]&&N[1]===n[1]?[C,k]=[N,!0]:S[0]===n[0]&&S[1]===n[1]?[C,k]=[S,!1]:[C,k]=FI(S,N,n);const M=pi(e,C,t);if(M<s.properties.pointDistance){const D=pi(w,C,t);s=Xt(C,{lineStringIndex:v,segmentIndex:k?y+1:y,totalDistance:o+D,lineDistance:h+D,segmentDistance:D,pointDistance:M,multiFeatureIndex:-1,index:-1,location:-1,dist:1/0}),s.properties=AI(RI({},s.properties),{multiFeatureIndex:s.properties.lineStringIndex,index:s.properties.segmentIndex,location:s.properties.totalDistance,dist:s.properties.pointDistance})}o+=j,h+=j}}),s}function hr(i,e){const[t,n,s]=i,[o,h,l]=e;return t*o+n*h+s*l}function lh(i,e){const[t,n,s]=i,[o,h,l]=e;return[n*l-s*h,s*o-t*l,t*h-n*o]}function DI(i){return Math.sqrt(Math.pow(i[0],2)+Math.pow(i[1],2)+Math.pow(i[2],2))}function U0(i){const e=DI(i);return[i[0]/e,i[1]/e,i[2]/e]}function vd(i){const e=Fe(i[1]),t=Fe(i[0]);return[Math.cos(e)*Math.cos(t),Math.cos(e)*Math.sin(t),Math.sin(e)]}function LI(i){const[e,t,n]=i,s=Math.min(Math.max(n,-1),1),o=va(Math.asin(s));return[va(Math.atan2(t,e)),o]}function FI(i,e,t){const n=vd(i),s=vd(e),o=vd(t),h=lh(n,s);if(h[0]===0&&h[1]===0&&h[2]===0)return hr(n,s)>0?[[...e],!0]:[[...t],!1];const l=lh(h,o);if(l[0]===0&&l[1]===0&&l[2]===0)return[[...e],!0];const d=lh(l,h),f=U0(d),v=[-f[0],-f[1],-f[2]],m=hr(o,f)>hr(o,v)?f:v,y=U0(h),w=hr(lh(n,m),y),S=hr(lh(m,s),y);return w>=0&&S>=0?[LI(m),!1]:hr(n,o)>hr(s,o)?[[...i],!1]:[[...e],!0]}function V0(i,e){if(!i)throw new Error("line is required");if(!e)throw new Error("splitter is required");const t=ld(i),n=ld(e);if(t!=="LineString")throw new Error("line must be LineString");if(n==="FeatureCollection")throw new Error("splitter cannot be a FeatureCollection");if(n==="GeometryCollection")throw new Error("splitter cannot be a GeometryCollection");var s=gI(e,{precision:7});switch(i.type!=="Feature"&&(i=ni(i)),n){case"Point":return yd(i,s);case"MultiPoint":return q0(i,s);case"LineString":case"MultiLineString":case"Polygon":case"MultiPolygon":return q0(i,or(i,s,{ignoreSelfIntersections:!0}))}}function q0(i,e){var t=[],n=D0();return Ms(e,function(s){if(t.forEach(function(l,d){l.id=d}),!t.length)t=yd(i,s).features,n.load(ae(t));else{var o=n.search(s);if(o.features.length){var h=$0(s,o);t=t.filter(function(l){return l.id!==h.id}),n.remove(h),Is(yd(h,s),function(l){t.push(l),n.insert(l)})}}}),ae(t)}function yd(i,e){var t=[],n=Si(i)[0],s=Si(i)[i.geometry.coordinates.length-1];if(_d(n,Ie(e))||_d(s,Ie(e)))return ae([i]);var o=D0(),h=mI(i);o.load(h);var l=o.search(e);if(!l.features.length)return ae([i]);var d=$0(e,l),f=[n],v=VC(h,function(m,y,w){var S=Si(y)[1],T=Ie(e);return w===d.id?(m.push(T),t.push(Ce(m)),_d(T,S)?[T]:[T,S]):(m.push(S),m)},f);return v.length>1&&t.push(Ce(v)),ae(t)}function $0(i,e){if(!e.features.length)throw new Error("lines must contain features");if(e.features.length===1)return e.features[0];var t,n=1/0;return Is(e,function(s){var o=md(s,i),h=o.properties.pointDistance;h<n&&(t=s,n=h)}),t}function _d(i,e){return i[0]===e[0]&&i[1]===e[1]}function GI(i,e){const t=Sn(i),n=Sn(e),s=t.type,o=n.type,h=t.coordinates,l=n.coordinates;switch(s){case"Point":switch(o){case"Point":return Ed(h,l);default:throw new Error("feature2 "+o+" geometry not supported")}case"MultiPoint":switch(o){case"Point":return zI(t,n);case"MultiPoint":return UI(t,n);default:throw new Error("feature2 "+o+" geometry not supported")}case"LineString":switch(o){case"Point":return Qn(n,t,{ignoreEndVertices:!0});case"LineString":return $I(t,n);case"MultiPoint":return VI(t,n);default:throw new Error("feature2 "+o+" geometry not supported")}case"Polygon":switch(o){case"Point":return Oe(n,t,{ignoreBoundary:!0});case"LineString":return HI(t,n);case"Polygon":return wd(t,n);case"MultiPoint":return qI(t,n);case"MultiPolygon":return BI(t,n);default:throw new Error("feature2 "+o+" geometry not supported")}case"MultiPolygon":switch(o){case"Polygon":return jI(t,n);default:throw new Error("feature2 "+o+" geometry not supported")}default:throw new Error("feature1 "+s+" geometry not supported")}}function jI(i,e){return i.coordinates.some(t=>wd({type:"Polygon",coordinates:t},e))}function BI(i,e){return e.coordinates.every(t=>wd(i,{type:"Polygon",coordinates:t}))}function zI(i,e){let t,n=!1;for(t=0;t<i.coordinates.length;t++)if(Ed(i.coordinates[t],e.coordinates)){n=!0;break}return n}function UI(i,e){for(const t of e.coordinates){let n=!1;for(const s of i.coordinates)if(Ed(t,s)){n=!0;break}if(!n)return!1}return!0}function VI(i,e){let t=!1;for(const n of e.coordinates)if(Qn(n,i,{ignoreEndVertices:!0})&&(t=!0),!Qn(n,i))return!1;return!!t}function qI(i,e){for(const t of e.coordinates)if(!Oe(t,i,{ignoreBoundary:!0}))return!1;return!0}function $I(i,e){let t=!1;for(const n of e.coordinates)if(Qn({type:"Point",coordinates:n},i,{ignoreEndVertices:!0})&&(t=!0),!Qn({type:"Point",coordinates:n},i,{ignoreEndVertices:!1}))return!1;return t}function WI(i,e){const t=i.coordinates,n=[];for(let s=0;s<t.length-1;s++){const o=Ce([t[s],t[s+1]]),h=V0(o,ni(e));h.features.length===0?n.push(o):n.push(...h.features)}return ae(n)}function HI(i,e){const t=He(i),n=He(e);if(!W0(t,n))return!1;for(const h of e.coordinates)if(!Oe(h,i))return!1;let s=!1;const o=WI(e,i);for(const h of o.features){const l=XI(h.geometry.coordinates[0],h.geometry.coordinates[1]);if(!Oe(l,i))return!1;!s&&Oe(l,i,{ignoreBoundary:!0})&&(s=!0)}return s}function wd(i,e){if(i.type==="Feature"&&i.geometry===null||e.type==="Feature"&&e.geometry===null)return!1;const t=He(i),n=He(e);if(!W0(t,n))return!1;const s=Sn(e).coordinates;for(const o of s)for(const h of o)if(!Oe(h,i))return!1;return!0}function W0(i,e){return!(i[0]>e[0]||i[2]<e[2]||i[1]>e[1]||i[3]<e[3])}function Ed(i,e){return i[0]===e[0]&&i[1]===e[1]}function XI(i,e){return[(i[0]+e[0])/2,(i[1]+e[1])/2]}function Sd(i,e={}){const t=Sn(i);switch(!e.properties&&i.type==="Feature"&&(e.properties=i.properties),t.type){case"Polygon":return YI(t,e);case"MultiPolygon":return JI(t,e);default:throw new Error("invalid poly")}}function YI(i,e={}){const n=Sn(i).coordinates,s=e.properties?e.properties:i.type==="Feature"?i.properties:{};return H0(n,s)}function JI(i,e={}){const n=Sn(i).coordinates,s=e.properties?e.properties:i.type==="Feature"?i.properties:{},o=[];return n.forEach(h=>{o.push(H0(h,s))}),ae(o)}function H0(i,e){return i.length>1?FC(i,e):Ce(i[0],e)}function KI(i,e,{ignoreSelfIntersections:t=!0}={ignoreSelfIntersections:!0}){let n=!0;return Ms(i,s=>{Ms(e,o=>{if(n===!1)return!1;n=ZI(s.geometry,o.geometry,t)})}),n}function ZI(i,e,t){switch(i.type){case"Point":switch(e.type){case"Point":return!iM(i.coordinates,e.coordinates);case"LineString":return!X0(e,i);case"Polygon":return!Oe(i,e)}break;case"LineString":switch(e.type){case"Point":return!X0(i,e);case"LineString":return!QI(i,e,t);case"Polygon":return!Y0(e,i,t)}break;case"Polygon":switch(e.type){case"Point":return!Oe(e,i);case"LineString":return!Y0(i,e,t);case"Polygon":return!tM(e,i,t)}}return!1}function X0(i,e){for(let t=0;t<i.coordinates.length-1;t++)if(eM(i.coordinates[t],i.coordinates[t+1],e.coordinates))return!0;return!1}function QI(i,e,t){return or(i,e,{ignoreSelfIntersections:t}).features.length>0}function Y0(i,e,t){for(const s of e.coordinates)if(Oe(s,i))return!0;return or(e,Sd(i),{ignoreSelfIntersections:t}).features.length>0}function tM(i,e,t){for(const s of i.coordinates[0])if(Oe(s,e))return!0;for(const s of e.coordinates[0])if(Oe(s,i))return!0;return or(Sd(i),Sd(e),{ignoreSelfIntersections:t}).features.length>0}function eM(i,e,t){const n=t[0]-i[0],s=t[1]-i[1],o=e[0]-i[0],h=e[1]-i[1];return n*h-s*o!==0?!1:Math.abs(o)>=Math.abs(h)?o>0?i[0]<=t[0]&&t[0]<=e[0]:e[0]<=t[0]&&t[0]<=i[0]:h>0?i[1]<=t[1]&&t[1]<=e[1]:e[1]<=t[1]&&t[1]<=i[1]}function iM(i,e){return i[0]===e[0]&&i[1]===e[1]}function nM(i,e,{ignoreSelfIntersections:t=!0}={}){let n=!1;return Ms(i,s=>{Ms(e,o=>{if(n===!0)return!0;n=!KI(s.geometry,o.geometry,{ignoreSelfIntersections:t})})}),n}function J0(i,e){var t=Sn(i),n=Sn(e),s=t.type,o=n.type;switch(s){case"Point":switch(o){case"MultiPoint":return sM(t,n);case"LineString":return Qn(t,n,{ignoreEndVertices:!0});case"Polygon":case"MultiPolygon":return Oe(t,n,{ignoreBoundary:!0});default:throw new Error("feature2 "+o+" geometry not supported")}case"MultiPoint":switch(o){case"MultiPoint":return rM(t,n);case"LineString":return aM(t,n);case"Polygon":case"MultiPolygon":return oM(t,n);default:throw new Error("feature2 "+o+" geometry not supported")}case"LineString":switch(o){case"LineString":return hM(t,n);case"Polygon":case"MultiPolygon":return uM(t,n);default:throw new Error("feature2 "+o+" geometry not supported")}case"Polygon":switch(o){case"Polygon":case"MultiPolygon":return cM(t,n);default:throw new Error("feature2 "+o+" geometry not supported")}default:throw new Error("feature1 "+s+" geometry not supported")}}function sM(i,e){var t,n=!1;for(t=0;t<e.coordinates.length;t++)if(Z0(e.coordinates[t],i.coordinates)){n=!0;break}return n}function rM(i,e){for(var t=0;t<i.coordinates.length;t++){for(var n=!1,s=0;s<e.coordinates.length;s++)Z0(i.coordinates[t],e.coordinates[s])&&(n=!0);if(!n)return!1}return!0}function aM(i,e){for(var t=!1,n=0;n<i.coordinates.length;n++){if(!Qn(i.coordinates[n],e))return!1;t||(t=Qn(i.coordinates[n],e,{ignoreEndVertices:!0}))}return t}function oM(i,e){for(var t=!0,n=!1,s=0;s<i.coordinates.length;s++){if(n=Oe(i.coordinates[s],e),!n){t=!1;break}n=Oe(i.coordinates[s],e,{ignoreBoundary:!0})}return t&&n}function hM(i,e){for(var t=0;t<i.coordinates.length;t++)if(!Qn(i.coordinates[t],e))return!1;return!0}function lM(i,e){const t=i.coordinates,n=[];for(let s=0;s<t.length-1;s++){const o=Ce([t[s],t[s+1]]),h=V0(o,ni(e));h.features.length===0?n.push(o):n.push(...h.features)}return ae(n)}function uM(i,e){const t=He(e),n=He(i);if(!K0(t,n))return!1;for(const h of i.coordinates)if(!Oe(h,e))return!1;let s=!1;const o=lM(i,e);for(const h of o.features){const l=dM(h.geometry.coordinates[0],h.geometry.coordinates[1]);if(!Oe(l,e))return!1;!s&&Oe(l,e,{ignoreBoundary:!0})&&(s=!0)}return s}function cM(i,e){var t=He(i),n=He(e);if(!K0(n,t))return!1;for(var s=0;s<i.coordinates[0].length;s++)if(!Oe(i.coordinates[0][s],e))return!1;return!0}function K0(i,e){return!(i[0]>e[0]||i[2]<e[2]||i[1]>e[1]||i[3]<e[3])}function Z0(i,e){return i[0]===e[0]&&i[1]===e[1]}function dM(i,e){return[(i[0]+e[0])/2,(i[1]+e[1])/2]}function Q0(i,e={}){const t=He(i),n=(t[0]+t[2])/2,s=(t[1]+t[3])/2;return Xt([n,s],e.properties,e)}var kl={exports:{}},fM=kl.exports,tv;function gM(){return tv||(tv=1,(function(i,e){(function(t,n){i.exports=n()})(fM,(function(){function t(c,r){(r==null||r>c.length)&&(r=c.length);for(var a=0,u=Array(r);a<r;a++)u[a]=c[a];return u}function n(c,r,a){return r=v(r),(function(u,g){if(g&&(typeof g=="object"||typeof g=="function"))return g;if(g!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return(function(_){if(_===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return _})(u)})(c,y()?Reflect.construct(r,a||[],v(c).constructor):r.apply(c,a))}function s(c,r){if(!(c instanceof r))throw new TypeError("Cannot call a class as a function")}function o(c,r,a){if(y())return Reflect.construct.apply(null,arguments);var u=[null];u.push.apply(u,r);var g=new(c.bind.apply(c,u));return a&&w(g,a.prototype),g}function h(c,r){for(var a=0;a<r.length;a++){var u=r[a];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(c,N(u.key),u)}}function l(c,r,a){return r&&h(c.prototype,r),a&&h(c,a),Object.defineProperty(c,"prototype",{writable:!1}),c}function d(c,r){var a=typeof Symbol<"u"&&c[Symbol.iterator]||c["@@iterator"];if(!a){if(Array.isArray(c)||(a=j(c))||r){a&&(c=a);var u=0,g=function(){};return{s:g,n:function(){return u>=c.length?{done:!0}:{done:!1,value:c[u++]}},e:function(O){throw O},f:g}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
45
45
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var _,E=!0,P=!1;return{s:function(){a=a.call(c)},n:function(){var O=a.next();return E=O.done,O},e:function(O){P=!0,_=O},f:function(){try{E||a.return==null||a.return()}finally{if(P)throw _}}}}function f(){return f=typeof Reflect<"u"&&Reflect.get?Reflect.get.bind():function(c,r,a){var u=(function(_,E){for(;!{}.hasOwnProperty.call(_,E)&&(_=v(_))!==null;);return _})(c,r);if(u){var g=Object.getOwnPropertyDescriptor(u,r);return g.get?g.get.call(arguments.length<3?c:a):g.value}},f.apply(null,arguments)}function v(c){return v=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},v(c)}function m(c,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function");c.prototype=Object.create(r&&r.prototype,{constructor:{value:c,writable:!0,configurable:!0}}),Object.defineProperty(c,"prototype",{writable:!1}),r&&w(c,r)}function y(){try{var c=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch{}return(y=function(){return!!c})()}function w(c,r){return w=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,u){return a.__proto__=u,a},w(c,r)}function S(c,r,a,u){var g=f(v(1&u?c.prototype:c),r,a);return 2&u&&typeof g=="function"?function(_){return g.apply(a,_)}:g}function T(c){return(function(r){if(Array.isArray(r))return t(r)})(c)||(function(r){if(typeof Symbol<"u"&&r[Symbol.iterator]!=null||r["@@iterator"]!=null)return Array.from(r)})(c)||j(c)||(function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
46
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function N(c){var r=(function(a,u){if(typeof a!="object"||!a)return a;var g=a[Symbol.toPrimitive];if(g!==void 0){var _=g.call(a,u);if(typeof _!="object")return _;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(a)})(c,"string");return typeof r=="symbol"?r:r+""}function j(c,r){if(c){if(typeof c=="string")return t(c,r);var a={}.toString.call(c).slice(8,-1);return a==="Object"&&c.constructor&&(a=c.constructor.name),a==="Map"||a==="Set"?Array.from(c):a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?t(c,r):void 0}}function C(c){var r=typeof Map=="function"?new Map:void 0;return C=function(a){if(a===null||!(function(g){try{return Function.toString.call(g).indexOf("[native code]")!==-1}catch{return typeof g=="function"}})(a))return a;if(typeof a!="function")throw new TypeError("Super expression must either be null or a function");if(r!==void 0){if(r.has(a))return r.get(a);r.set(a,u)}function u(){return o(a,arguments,v(this).constructor)}return u.prototype=Object.create(a.prototype,{constructor:{value:u,enumerable:!1,writable:!0,configurable:!0}}),w(u,a)},C(c)}var k=(function(){function c(){s(this,c),c.constructor_.apply(this,arguments)}return l(c,[{key:"getEndCapStyle",value:function(){return this._endCapStyle}},{key:"isSingleSided",value:function(){return this._isSingleSided}},{key:"setQuadrantSegments",value:function(r){this._quadrantSegments=r,this._quadrantSegments===0&&(this._joinStyle=c.JOIN_BEVEL),this._quadrantSegments<0&&(this._joinStyle=c.JOIN_MITRE,this._mitreLimit=Math.abs(this._quadrantSegments)),r<=0&&(this._quadrantSegments=1),this._joinStyle!==c.JOIN_ROUND&&(this._quadrantSegments=c.DEFAULT_QUADRANT_SEGMENTS)}},{key:"getJoinStyle",value:function(){return this._joinStyle}},{key:"setJoinStyle",value:function(r){this._joinStyle=r}},{key:"setSimplifyFactor",value:function(r){this._simplifyFactor=r<0?0:r}},{key:"getSimplifyFactor",value:function(){return this._simplifyFactor}},{key:"getQuadrantSegments",value:function(){return this._quadrantSegments}},{key:"setEndCapStyle",value:function(r){this._endCapStyle=r}},{key:"getMitreLimit",value:function(){return this._mitreLimit}},{key:"setMitreLimit",value:function(r){this._mitreLimit=r}},{key:"setSingleSided",value:function(r){this._isSingleSided=r}}],[{key:"constructor_",value:function(){if(this._quadrantSegments=c.DEFAULT_QUADRANT_SEGMENTS,this._endCapStyle=c.CAP_ROUND,this._joinStyle=c.JOIN_ROUND,this._mitreLimit=c.DEFAULT_MITRE_LIMIT,this._isSingleSided=!1,this._simplifyFactor=c.DEFAULT_SIMPLIFY_FACTOR,arguments.length!==0){if(arguments.length===1){var r=arguments[0];this.setQuadrantSegments(r)}else if(arguments.length===2){var a=arguments[0],u=arguments[1];this.setQuadrantSegments(a),this.setEndCapStyle(u)}else if(arguments.length===4){var g=arguments[0],_=arguments[1],E=arguments[2],P=arguments[3];this.setQuadrantSegments(g),this.setEndCapStyle(_),this.setJoinStyle(E),this.setMitreLimit(P)}}}},{key:"bufferDistanceError",value:function(r){var a=Math.PI/2/r;return 1-Math.cos(a/2)}}])})();k.CAP_ROUND=1,k.CAP_FLAT=2,k.CAP_SQUARE=3,k.JOIN_ROUND=1,k.JOIN_MITRE=2,k.JOIN_BEVEL=3,k.DEFAULT_QUADRANT_SEGMENTS=8,k.DEFAULT_MITRE_LIMIT=5,k.DEFAULT_SIMPLIFY_FACTOR=.01;var M=(function(c){function r(a){var u;return s(this,r),(u=n(this,r,[a])).name=Object.keys({Exception:r})[0],u}return m(r,c),l(r,[{key:"toString",value:function(){return this.message}}])})(C(Error)),D=(function(c){function r(a){var u;return s(this,r),(u=n(this,r,[a])).name=Object.keys({IllegalArgumentException:r})[0],u}return m(r,c),l(r)})(M),L=(function(){return l((function c(){s(this,c)}),[{key:"filter",value:function(c){}}])})();function V(){}function x(){}function I(){}var R,G,F,U,z,$,W,X,Y=(function(){return l((function c(){s(this,c)}),null,[{key:"equalsWithTolerance",value:function(c,r,a){return Math.abs(c-r)<=a}}])})(),et=(function(){return l((function c(r,a){s(this,c),this.low=a||0,this.high=r||0}),null,[{key:"toBinaryString",value:function(c){var r,a="";for(r=2147483648;r>0;r>>>=1)a+=(c.high&r)===r?"1":"0";for(r=2147483648;r>0;r>>>=1)a+=(c.low&r)===r?"1":"0";return a}}])})();function J(){}function rt(){}J.NaN=NaN,J.isNaN=function(c){return Number.isNaN(c)},J.isInfinite=function(c){return!Number.isFinite(c)},J.MAX_VALUE=Number.MAX_VALUE,J.POSITIVE_INFINITY=Number.POSITIVE_INFINITY,J.NEGATIVE_INFINITY=Number.NEGATIVE_INFINITY,typeof Float64Array=="function"&&typeof Int32Array=="function"?($=2146435072,W=new Float64Array(1),X=new Int32Array(W.buffer),J.doubleToLongBits=function(c){W[0]=c;var r=0|X[0],a=0|X[1];return(a&$)===$&&1048575&a&&r!==0&&(r=0,a=2146959360),new et(a,r)},J.longBitsToDouble=function(c){return X[0]=c.low,X[1]=c.high,W[0]}):(R=1023,G=Math.log2,F=Math.floor,U=Math.pow,z=(function(){for(var c=53;c>0;c--){var r=U(2,c)-1;if(F(G(r))+1===c)return r}return 0})(),J.doubleToLongBits=function(c){var r,a,u,g,_,E,P,O,B;if(c<0||1/c===Number.NEGATIVE_INFINITY?(E=-2147483648,c=-c):E=0,c===0)return new et(O=E,B=0);if(c===1/0)return new et(O=2146435072|E,B=0);if(c!=c)return new et(O=2146959360,B=0);if(g=0,B=0,(r=F(c))>1)if(r<=z)(g=F(G(r)))<=20?(B=0,O=r<<20-g&1048575):(B=r%(a=U(2,u=g-20))<<32-u,O=r/a&1048575);else for(u=r,B=0;(u=F(a=u/2))!==0;)g++,B>>>=1,B|=(1&O)<<31,O>>>=1,a!==u&&(O|=524288);if(P=g+R,_=r===0,r=c-r,g<52&&r!==0)for(u=0;;){if((a=2*r)>=1?(r=a-1,_?(P--,_=!1):(u<<=1,u|=1,g++)):(r=a,_?--P==0&&(g++,_=!1):(u<<=1,g++)),g===20)O|=u,u=0;else if(g===52){B|=u;break}if(a===1){g<20?O|=u<<20-g:g<52&&(B|=u<<52-g);break}}return O|=P<<20,new et(O|=E,B)},J.longBitsToDouble=function(c){var r,a,u,g,_=c.high,E=c.low,P=_&1<<31?-1:1;for(u=((2146435072&_)>>20)-R,g=0,a=524288,r=1;r<=20;r++)_&a&&(g+=U(2,-r)),a>>>=1;for(a=-2147483648,r=21;r<=52;r++)E&a&&(g+=U(2,-r)),a>>>=1;if(u===-1023){if(g===0)return 0*P;u=-1022}else{if(u===1024)return g===0?P/0:NaN;g+=1}return P*g*U(2,u)});var ht=(function(c){function r(a){var u;return s(this,r),(u=n(this,r,[a])).name=Object.keys({RuntimeException:r})[0],u}return m(r,c),l(r)})(M),Ot=(function(c){function r(){var a;return s(this,r),a=n(this,r),r.constructor_.apply(a,arguments),a}return m(r,c),l(r,null,[{key:"constructor_",value:function(){if(arguments.length===0)ht.constructor_.call(this);else if(arguments.length===1){var a=arguments[0];ht.constructor_.call(this,a)}}}])})(ht),ct=(function(){function c(){s(this,c)}return l(c,null,[{key:"shouldNeverReachHere",value:function(){if(arguments.length===0)c.shouldNeverReachHere(null);else if(arguments.length===1){var r=arguments[0];throw new Ot("Should never reach here"+(r!==null?": "+r:""))}}},{key:"isTrue",value:function(){if(arguments.length===1){var r=arguments[0];c.isTrue(r,null)}else if(arguments.length===2){var a=arguments[1];if(!arguments[0])throw a===null?new Ot:new Ot(a)}}},{key:"equals",value:function(){if(arguments.length===2){var r=arguments[0],a=arguments[1];c.equals(r,a,null)}else if(arguments.length===3){var u=arguments[0],g=arguments[1],_=arguments[2];if(!g.equals(u))throw new Ot("Expected "+u+" but encountered "+g+(_!==null?": "+_:""))}}}])})(),_t=new ArrayBuffer(8),Ct=new Float64Array(_t),Lt=new Int32Array(_t),K=(function(){function c(){s(this,c),c.constructor_.apply(this,arguments)}return l(c,[{key:"getM",value:function(){return J.NaN}},{key:"setOrdinate",value:function(r,a){switch(r){case c.X:this.x=a;break;case c.Y:this.y=a;break;case c.Z:this.setZ(a);break;default:throw new D("Invalid ordinate index: "+r)}}},{key:"equals2D",value:function(){if(arguments.length===1){var r=arguments[0];return this.x===r.x&&this.y===r.y}if(arguments.length===2){var a=arguments[0],u=arguments[1];return!!Y.equalsWithTolerance(this.x,a.x,u)&&!!Y.equalsWithTolerance(this.y,a.y,u)}}},{key:"setM",value:function(r){throw new D("Invalid ordinate index: "+c.M)}},{key:"getZ",value:function(){return this.z}},{key:"getOrdinate",value:function(r){switch(r){case c.X:return this.x;case c.Y:return this.y;case c.Z:return this.getZ()}throw new D("Invalid ordinate index: "+r)}},{key:"equals3D",value:function(r){return this.x===r.x&&this.y===r.y&&(this.getZ()===r.getZ()||J.isNaN(this.getZ())&&J.isNaN(r.getZ()))}},{key:"equals",value:function(r){return r instanceof c&&this.equals2D(r)}},{key:"equalInZ",value:function(r,a){return Y.equalsWithTolerance(this.getZ(),r.getZ(),a)}},{key:"setX",value:function(r){this.x=r}},{key:"compareTo",value:function(r){var a=r;return this.x<a.x?-1:this.x>a.x?1:this.y<a.y?-1:this.y>a.y?1:0}},{key:"getX",value:function(){return this.x}},{key:"setZ",value:function(r){this.z=r}},{key:"clone",value:function(){try{return null}catch(r){if(r instanceof CloneNotSupportedException)return ct.shouldNeverReachHere("this shouldn't happen because this class is Cloneable"),null;throw r}}},{key:"copy",value:function(){return new c(this)}},{key:"toString",value:function(){return"("+this.x+", "+this.y+", "+this.getZ()+")"}},{key:"distance3D",value:function(r){var a=this.x-r.x,u=this.y-r.y,g=this.getZ()-r.getZ();return Math.sqrt(a*a+u*u+g*g)}},{key:"getY",value:function(){return this.y}},{key:"setY",value:function(r){this.y=r}},{key:"distance",value:function(r){var a=this.x-r.x,u=this.y-r.y;return Math.sqrt(a*a+u*u)}},{key:"hashCode",value:function(){var r=17;return r=37*(r=37*r+c.hashCode(this.x))+c.hashCode(this.y)}},{key:"setCoordinate",value:function(r){this.x=r.x,this.y=r.y,this.z=r.getZ()}},{key:"interfaces_",get:function(){return[V,x,I]}}],[{key:"constructor_",value:function(){if(this.x=null,this.y=null,this.z=null,arguments.length===0)c.constructor_.call(this,0,0);else if(arguments.length===1){var r=arguments[0];c.constructor_.call(this,r.x,r.y,r.getZ())}else if(arguments.length===2){var a=arguments[0],u=arguments[1];c.constructor_.call(this,a,u,c.NULL_ORDINATE)}else if(arguments.length===3){var g=arguments[0],_=arguments[1],E=arguments[2];this.x=g,this.y=_,this.z=E}}},{key:"hashCode",value:function(r){return Ct[0]=r,Lt[0]^Lt[1]}}])})(),Qt=(function(){function c(){s(this,c),c.constructor_.apply(this,arguments)}return l(c,[{key:"compare",value:function(r,a){var u=c.compare(r.x,a.x);if(u!==0)return u;var g=c.compare(r.y,a.y);return g!==0?g:this._dimensionsToTest<=2?0:c.compare(r.getZ(),a.getZ())}},{key:"interfaces_",get:function(){return[rt]}}],[{key:"constructor_",value:function(){if(this._dimensionsToTest=2,arguments.length===0)c.constructor_.call(this,2);else if(arguments.length===1){var r=arguments[0];if(r!==2&&r!==3)throw new D("only 2 or 3 dimensions may be specified");this._dimensionsToTest=r}}},{key:"compare",value:function(r,a){return r<a?-1:r>a?1:J.isNaN(r)?J.isNaN(a)?0:-1:J.isNaN(a)?1:0}}])})();K.DimensionalComparator=Qt,K.NULL_ORDINATE=J.NaN,K.X=0,K.Y=1,K.Z=2,K.M=3;var zt=(function(){function c(){s(this,c),c.constructor_.apply(this,arguments)}return l(c,[{key:"getArea",value:function(){return this.getWidth()*this.getHeight()}},{key:"equals",value:function(r){if(!(r instanceof c))return!1;var a=r;return this.isNull()?a.isNull():this._maxx===a.getMaxX()&&this._maxy===a.getMaxY()&&this._minx===a.getMinX()&&this._miny===a.getMinY()}},{key:"intersection",value:function(r){if(this.isNull()||r.isNull()||!this.intersects(r))return new c;var a=this._minx>r._minx?this._minx:r._minx,u=this._miny>r._miny?this._miny:r._miny;return new c(a,this._maxx<r._maxx?this._maxx:r._maxx,u,this._maxy<r._maxy?this._maxy:r._maxy)}},{key:"isNull",value:function(){return this._maxx<this._minx}},{key:"getMaxX",value:function(){return this._maxx}},{key:"covers",value:function(){if(arguments.length===1){if(arguments[0]instanceof K){var r=arguments[0];return this.covers(r.x,r.y)}if(arguments[0]instanceof c){var a=arguments[0];return!this.isNull()&&!a.isNull()&&a.getMinX()>=this._minx&&a.getMaxX()<=this._maxx&&a.getMinY()>=this._miny&&a.getMaxY()<=this._maxy}}else if(arguments.length===2){var u=arguments[0],g=arguments[1];return!this.isNull()&&u>=this._minx&&u<=this._maxx&&g>=this._miny&&g<=this._maxy}}},{key:"intersects",value:function(){if(arguments.length===1){if(arguments[0]instanceof c){var r=arguments[0];return!this.isNull()&&!r.isNull()&&!(r._minx>this._maxx||r._maxx<this._minx||r._miny>this._maxy||r._maxy<this._miny)}if(arguments[0]instanceof K){var a=arguments[0];return this.intersects(a.x,a.y)}}else if(arguments.length===2){if(arguments[0]instanceof K&&arguments[1]instanceof K){var u=arguments[0],g=arguments[1];return!this.isNull()&&!((u.x<g.x?u.x:g.x)>this._maxx)&&!((u.x>g.x?u.x:g.x)<this._minx)&&!((u.y<g.y?u.y:g.y)>this._maxy)&&!((u.y>g.y?u.y:g.y)<this._miny)}if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var _=arguments[0],E=arguments[1];return!this.isNull()&&!(_>this._maxx||_<this._minx||E>this._maxy||E<this._miny)}}}},{key:"getMinY",value:function(){return this._miny}},{key:"getDiameter",value:function(){if(this.isNull())return 0;var r=this.getWidth(),a=this.getHeight();return Math.sqrt(r*r+a*a)}},{key:"getMinX",value:function(){return this._minx}},{key:"expandToInclude",value:function(){if(arguments.length===1){if(arguments[0]instanceof K){var r=arguments[0];this.expandToInclude(r.x,r.y)}else if(arguments[0]instanceof c){var a=arguments[0];if(a.isNull())return null;this.isNull()?(this._minx=a.getMinX(),this._maxx=a.getMaxX(),this._miny=a.getMinY(),this._maxy=a.getMaxY()):(a._minx<this._minx&&(this._minx=a._minx),a._maxx>this._maxx&&(this._maxx=a._maxx),a._miny<this._miny&&(this._miny=a._miny),a._maxy>this._maxy&&(this._maxy=a._maxy))}}else if(arguments.length===2){var u=arguments[0],g=arguments[1];this.isNull()?(this._minx=u,this._maxx=u,this._miny=g,this._maxy=g):(u<this._minx&&(this._minx=u),u>this._maxx&&(this._maxx=u),g<this._miny&&(this._miny=g),g>this._maxy&&(this._maxy=g))}}},{key:"minExtent",value:function(){if(this.isNull())return 0;var r=this.getWidth(),a=this.getHeight();return r<a?r:a}},{key:"getWidth",value:function(){return this.isNull()?0:this._maxx-this._minx}},{key:"compareTo",value:function(r){var a=r;return this.isNull()?a.isNull()?0:-1:a.isNull()?1:this._minx<a._minx?-1:this._minx>a._minx?1:this._miny<a._miny?-1:this._miny>a._miny?1:this._maxx<a._maxx?-1:this._maxx>a._maxx?1:this._maxy<a._maxy?-1:this._maxy>a._maxy?1:0}},{key:"translate",value:function(r,a){if(this.isNull())return null;this.init(this.getMinX()+r,this.getMaxX()+r,this.getMinY()+a,this.getMaxY()+a)}},{key:"copy",value:function(){return new c(this)}},{key:"toString",value:function(){return"Env["+this._minx+" : "+this._maxx+", "+this._miny+" : "+this._maxy+"]"}},{key:"setToNull",value:function(){this._minx=0,this._maxx=-1,this._miny=0,this._maxy=-1}},{key:"disjoint",value:function(r){return!(!this.isNull()&&!r.isNull())||r._minx>this._maxx||r._maxx<this._minx||r._miny>this._maxy||r._maxy<this._miny}},{key:"getHeight",value:function(){return this.isNull()?0:this._maxy-this._miny}},{key:"maxExtent",value:function(){if(this.isNull())return 0;var r=this.getWidth(),a=this.getHeight();return r>a?r:a}},{key:"expandBy",value:function(){if(arguments.length===1){var r=arguments[0];this.expandBy(r,r)}else if(arguments.length===2){var a=arguments[0],u=arguments[1];if(this.isNull())return null;this._minx-=a,this._maxx+=a,this._miny-=u,this._maxy+=u,(this._minx>this._maxx||this._miny>this._maxy)&&this.setToNull()}}},{key:"contains",value:function(){if(arguments.length===1){if(arguments[0]instanceof c){var r=arguments[0];return this.covers(r)}if(arguments[0]instanceof K){var a=arguments[0];return this.covers(a)}}else if(arguments.length===2){var u=arguments[0],g=arguments[1];return this.covers(u,g)}}},{key:"centre",value:function(){return this.isNull()?null:new K((this.getMinX()+this.getMaxX())/2,(this.getMinY()+this.getMaxY())/2)}},{key:"init",value:function(){if(arguments.length===0)this.setToNull();else if(arguments.length===1){if(arguments[0]instanceof K){var r=arguments[0];this.init(r.x,r.x,r.y,r.y)}else if(arguments[0]instanceof c){var a=arguments[0];this._minx=a._minx,this._maxx=a._maxx,this._miny=a._miny,this._maxy=a._maxy}}else if(arguments.length===2){var u=arguments[0],g=arguments[1];this.init(u.x,g.x,u.y,g.y)}else if(arguments.length===4){var _=arguments[0],E=arguments[1],P=arguments[2],O=arguments[3];_<E?(this._minx=_,this._maxx=E):(this._minx=E,this._maxx=_),P<O?(this._miny=P,this._maxy=O):(this._miny=O,this._maxy=P)}}},{key:"getMaxY",value:function(){return this._maxy}},{key:"distance",value:function(r){if(this.intersects(r))return 0;var a=0;this._maxx<r._minx?a=r._minx-this._maxx:this._minx>r._maxx&&(a=this._minx-r._maxx);var u=0;return this._maxy<r._miny?u=r._miny-this._maxy:this._miny>r._maxy&&(u=this._miny-r._maxy),a===0?u:u===0?a:Math.sqrt(a*a+u*u)}},{key:"hashCode",value:function(){var r=17;return r=37*(r=37*(r=37*(r=37*r+K.hashCode(this._minx))+K.hashCode(this._maxx))+K.hashCode(this._miny))+K.hashCode(this._maxy)}},{key:"interfaces_",get:function(){return[V,I]}}],[{key:"constructor_",value:function(){if(this._minx=null,this._maxx=null,this._miny=null,this._maxy=null,arguments.length===0)this.init();else if(arguments.length===1){if(arguments[0]instanceof K){var r=arguments[0];this.init(r.x,r.x,r.y,r.y)}else if(arguments[0]instanceof c){var a=arguments[0];this.init(a)}}else if(arguments.length===2){var u=arguments[0],g=arguments[1];this.init(u.x,g.x,u.y,g.y)}else if(arguments.length===4){var _=arguments[0],E=arguments[1],P=arguments[2],O=arguments[3];this.init(_,E,P,O)}}},{key:"intersects",value:function(){if(arguments.length===3){var r=arguments[0],a=arguments[1],u=arguments[2];return u.x>=(r.x<a.x?r.x:a.x)&&u.x<=(r.x>a.x?r.x:a.x)&&u.y>=(r.y<a.y?r.y:a.y)&&u.y<=(r.y>a.y?r.y:a.y)}if(arguments.length===4){var g=arguments[0],_=arguments[1],E=arguments[2],P=arguments[3],O=Math.min(E.x,P.x),B=Math.max(E.x,P.x),Z=Math.min(g.x,_.x),tt=Math.max(g.x,_.x);return!(Z>B)&&!(tt<O)&&(O=Math.min(E.y,P.y),B=Math.max(E.y,P.y),Z=Math.min(g.y,_.y),tt=Math.max(g.y,_.y),!(Z>B)&&!(tt<O))}}}])})(),gt=(function(){function c(){s(this,c),c.constructor_.apply(this,arguments)}return l(c,[{key:"isGeometryCollection",value:function(){return this.getTypeCode()===c.TYPECODE_GEOMETRYCOLLECTION}},{key:"getFactory",value:function(){return this._factory}},{key:"getGeometryN",value:function(r){return this}},{key:"getArea",value:function(){return 0}},{key:"isRectangle",value:function(){return!1}},{key:"equalsExact",value:function(r){return this===r||this.equalsExact(r,0)}},{key:"geometryChanged",value:function(){this.apply(c.geometryChangedFilter)}},{key:"geometryChangedAction",value:function(){this._envelope=null}},{key:"equalsNorm",value:function(r){return r!==null&&this.norm().equalsExact(r.norm())}},{key:"getLength",value:function(){return 0}},{key:"getNumGeometries",value:function(){return 1}},{key:"compareTo",value:function(){var r;if(arguments.length===1){var a=arguments[0];return r=a,this.getTypeCode()!==r.getTypeCode()?this.getTypeCode()-r.getTypeCode():this.isEmpty()&&r.isEmpty()?0:this.isEmpty()?-1:r.isEmpty()?1:this.compareToSameClass(a)}if(arguments.length===2){var u=arguments[0],g=arguments[1];return r=u,this.getTypeCode()!==r.getTypeCode()?this.getTypeCode()-r.getTypeCode():this.isEmpty()&&r.isEmpty()?0:this.isEmpty()?-1:r.isEmpty()?1:this.compareToSameClass(u,g)}}},{key:"getUserData",value:function(){return this._userData}},{key:"getSRID",value:function(){return this._SRID}},{key:"getEnvelope",value:function(){return this.getFactory().toGeometry(this.getEnvelopeInternal())}},{key:"checkNotGeometryCollection",value:function(r){if(r.getTypeCode()===c.TYPECODE_GEOMETRYCOLLECTION)throw new D("This method does not support GeometryCollection arguments")}},{key:"equal",value:function(r,a,u){return u===0?r.equals(a):r.distance(a)<=u}},{key:"norm",value:function(){var r=this.copy();return r.normalize(),r}},{key:"reverse",value:function(){var r=this.reverseInternal();return this.envelope!=null&&(r.envelope=this.envelope.copy()),r.setSRID(this.getSRID()),r}},{key:"copy",value:function(){var r=this.copyInternal();return r.envelope=this._envelope==null?null:this._envelope.copy(),r._SRID=this._SRID,r._userData=this._userData,r}},{key:"getPrecisionModel",value:function(){return this._factory.getPrecisionModel()}},{key:"getEnvelopeInternal",value:function(){return this._envelope===null&&(this._envelope=this.computeEnvelopeInternal()),new zt(this._envelope)}},{key:"setSRID",value:function(r){this._SRID=r}},{key:"setUserData",value:function(r){this._userData=r}},{key:"compare",value:function(r,a){for(var u=r.iterator(),g=a.iterator();u.hasNext()&&g.hasNext();){var _=u.next(),E=g.next(),P=_.compareTo(E);if(P!==0)return P}return u.hasNext()?1:g.hasNext()?-1:0}},{key:"hashCode",value:function(){return this.getEnvelopeInternal().hashCode()}},{key:"isEquivalentClass",value:function(r){return this.getClass()===r.getClass()}},{key:"isGeometryCollectionOrDerived",value:function(){return this.getTypeCode()===c.TYPECODE_GEOMETRYCOLLECTION||this.getTypeCode()===c.TYPECODE_MULTIPOINT||this.getTypeCode()===c.TYPECODE_MULTILINESTRING||this.getTypeCode()===c.TYPECODE_MULTIPOLYGON}},{key:"interfaces_",get:function(){return[x,V,I]}},{key:"getClass",value:function(){return c}}],[{key:"hasNonEmptyElements",value:function(r){for(var a=0;a<r.length;a++)if(!r[a].isEmpty())return!0;return!1}},{key:"hasNullElements",value:function(r){for(var a=0;a<r.length;a++)if(r[a]===null)return!0;return!1}}])})();gt.constructor_=function(c){c&&(this._envelope=null,this._userData=null,this._factory=c,this._SRID=c.getSRID())},gt.TYPECODE_POINT=0,gt.TYPECODE_MULTIPOINT=1,gt.TYPECODE_LINESTRING=2,gt.TYPECODE_LINEARRING=3,gt.TYPECODE_MULTILINESTRING=4,gt.TYPECODE_POLYGON=5,gt.TYPECODE_MULTIPOLYGON=6,gt.TYPECODE_GEOMETRYCOLLECTION=7,gt.TYPENAME_POINT="Point",gt.TYPENAME_MULTIPOINT="MultiPoint",gt.TYPENAME_LINESTRING="LineString",gt.TYPENAME_LINEARRING="LinearRing",gt.TYPENAME_MULTILINESTRING="MultiLineString",gt.TYPENAME_POLYGON="Polygon",gt.TYPENAME_MULTIPOLYGON="MultiPolygon",gt.TYPENAME_GEOMETRYCOLLECTION="GeometryCollection",gt.geometryChangedFilter={get interfaces_(){return[L]},filter:function(c){c.geometryChangedAction()}};var A=(function(){function c(){s(this,c)}return l(c,null,[{key:"toLocationSymbol",value:function(r){switch(r){case c.EXTERIOR:return"e";case c.BOUNDARY:return"b";case c.INTERIOR:return"i";case c.NONE:return"-"}throw new D("Unknown location value: "+r)}}])})();A.INTERIOR=0,A.BOUNDARY=1,A.EXTERIOR=2,A.NONE=-1;var at=(function(){return l((function c(){s(this,c)}),[{key:"add",value:function(){}},{key:"addAll",value:function(){}},{key:"isEmpty",value:function(){}},{key:"iterator",value:function(){}},{key:"size",value:function(){}},{key:"toArray",value:function(){}},{key:"remove",value:function(){}}])})(),Pt=(function(c){function r(a){var u;return s(this,r),(u=n(this,r,[a])).name=Object.keys({NoSuchElementException:r})[0],u}return m(r,c),l(r)})(M),It=(function(c){function r(a){var u;return s(this,r),(u=n(this,r,[a])).name=Object.keys({UnsupportedOperationException:r})[0],u}return m(r,c),l(r)})(M),se=(function(c){function r(){return s(this,r),n(this,r,arguments)}return m(r,c),l(r,[{key:"contains",value:function(){}}])})(at),le=(function(c){function r(a){var u;return s(this,r),(u=n(this,r)).map=new Map,a instanceof at&&u.addAll(a),u}return m(r,c),l(r,[{key:"contains",value:function(a){var u=a.hashCode?a.hashCode():a;return!!this.map.has(u)}},{key:"add",value:function(a){var u=a.hashCode?a.hashCode():a;return!this.map.has(u)&&!!this.map.set(u,a)}},{key:"addAll",value:function(a){var u,g=d(a);try{for(g.s();!(u=g.n()).done;){var _=u.value;this.add(_)}}catch(E){g.e(E)}finally{g.f()}return!0}},{key:"remove",value:function(){throw new It}},{key:"size",value:function(){return this.map.size}},{key:"isEmpty",value:function(){return this.map.size===0}},{key:"toArray",value:function(){return Array.from(this.map.values())}},{key:"iterator",value:function(){return new Vn(this.map)}},{key:Symbol.iterator,value:function(){return this.map}}])})(se),Vn=(function(){return l((function c(r){s(this,c),this.iterator=r.values();var a=this.iterator.next(),u=a.done,g=a.value;this.done=u,this.value=g}),[{key:"next",value:function(){if(this.done)throw new Pt;var c=this.value,r=this.iterator.next(),a=r.done,u=r.value;return this.done=a,this.value=u,c}},{key:"hasNext",value:function(){return!this.done}},{key:"remove",value:function(){throw new It}}])})(),ut=(function(){function c(){s(this,c)}return l(c,null,[{key:"opposite",value:function(r){return r===c.LEFT?c.RIGHT:r===c.RIGHT?c.LEFT:r}}])})();ut.ON=0,ut.LEFT=1,ut.RIGHT=2;var Tu=(function(c){function r(a){var u;return s(this,r),(u=n(this,r,[a])).name=Object.keys({EmptyStackException:r})[0],u}return m(r,c),l(r)})(M),ku=(function(c){function r(a){var u;return s(this,r),(u=n(this,r,[a])).name=Object.keys({IndexOutOfBoundsException:r})[0],u}return m(r,c),l(r)})(M),ds=(function(c){function r(){return s(this,r),n(this,r,arguments)}return m(r,c),l(r,[{key:"get",value:function(){}},{key:"set",value:function(){}},{key:"isEmpty",value:function(){}}])})(at),Fg=(function(c){function r(){var a;return s(this,r),(a=n(this,r)).array=[],a}return m(r,c),l(r,[{key:"add",value:function(a){return this.array.push(a),!0}},{key:"get",value:function(a){if(a<0||a>=this.size())throw new ku;return this.array[a]}},{key:"push",value:function(a){return this.array.push(a),a}},{key:"pop",value:function(){if(this.array.length===0)throw new Tu;return this.array.pop()}},{key:"peek",value:function(){if(this.array.length===0)throw new Tu;return this.array[this.array.length-1]}},{key:"empty",value:function(){return this.array.length===0}},{key:"isEmpty",value:function(){return this.empty()}},{key:"search",value:function(a){return this.array.indexOf(a)}},{key:"size",value:function(){return this.array.length}},{key:"toArray",value:function(){return this.array.slice()}}])})(ds);function Vt(c,r){return c.interfaces_&&c.interfaces_.indexOf(r)>-1}var Ws=(function(){return l((function c(r){s(this,c),this.str=r}),[{key:"append",value:function(c){this.str+=c}},{key:"setCharAt",value:function(c,r){this.str=this.str.substr(0,c)+r+this.str.substr(c+1)}},{key:"toString",value:function(){return this.str}}])})(),Hs=(function(){function c(r){s(this,c),this.value=r}return l(c,[{key:"intValue",value:function(){return this.value}},{key:"compareTo",value:function(r){return this.value<r?-1:this.value>r?1:0}}],[{key:"compare",value:function(r,a){return r<a?-1:r>a?1:0}},{key:"isNan",value:function(r){return Number.isNaN(r)}},{key:"valueOf",value:function(r){return new c(r)}}])})(),Gg=(function(){return l((function c(){s(this,c)}),null,[{key:"isWhitespace",value:function(c){return c<=32&&c>=0||c===127}},{key:"toUpperCase",value:function(c){return c.toUpperCase()}}])})(),Bt=(function(){function c(){s(this,c),c.constructor_.apply(this,arguments)}return l(c,[{key:"le",value:function(r){return this._hi<r._hi||this._hi===r._hi&&this._lo<=r._lo}},{key:"extractSignificantDigits",value:function(r,a){var u=this.abs(),g=c.magnitude(u._hi),_=c.TEN.pow(g);(u=u.divide(_)).gt(c.TEN)?(u=u.divide(c.TEN),g+=1):u.lt(c.ONE)&&(u=u.multiply(c.TEN),g-=1);for(var E=g+1,P=new Ws,O=c.MAX_PRINT_DIGITS-1,B=0;B<=O;B++){r&&B===E&&P.append(".");var Z=Math.trunc(u._hi);if(Z<0)break;var tt=!1,ot=0;Z>9?(tt=!0,ot="9"):ot="0"+Z,P.append(ot),u=u.subtract(c.valueOf(Z)).multiply(c.TEN),tt&&u.selfAdd(c.TEN);var Et=!0,Nt=c.magnitude(u._hi);if(Nt<0&&Math.abs(Nt)>=O-B&&(Et=!1),!Et)break}return a[0]=g,P.toString()}},{key:"sqr",value:function(){return this.multiply(this)}},{key:"doubleValue",value:function(){return this._hi+this._lo}},{key:"subtract",value:function(){if(arguments[0]instanceof c){var r=arguments[0];return this.add(r.negate())}if(typeof arguments[0]=="number"){var a=arguments[0];return this.add(-a)}}},{key:"equals",value:function(){if(arguments.length===1&&arguments[0]instanceof c){var r=arguments[0];return this._hi===r._hi&&this._lo===r._lo}}},{key:"isZero",value:function(){return this._hi===0&&this._lo===0}},{key:"selfSubtract",value:function(){if(arguments[0]instanceof c){var r=arguments[0];return this.isNaN()?this:this.selfAdd(-r._hi,-r._lo)}if(typeof arguments[0]=="number"){var a=arguments[0];return this.isNaN()?this:this.selfAdd(-a,0)}}},{key:"getSpecialNumberString",value:function(){return this.isZero()?"0.0":this.isNaN()?"NaN ":null}},{key:"min",value:function(r){return this.le(r)?this:r}},{key:"selfDivide",value:function(){if(arguments.length===1){if(arguments[0]instanceof c){var r=arguments[0];return this.selfDivide(r._hi,r._lo)}if(typeof arguments[0]=="number"){var a=arguments[0];return this.selfDivide(a,0)}}else if(arguments.length===2){var u,g,_,E,P=arguments[0],O=arguments[1],B=null,Z=null,tt=null,ot=null;return _=this._hi/P,ot=(B=(tt=c.SPLIT*_)-(B=tt-_))*(Z=(ot=c.SPLIT*P)-(Z=ot-P))-(E=_*P)+B*(g=P-Z)+(u=_-B)*Z+u*g,ot=_+(tt=(this._hi-E-ot+this._lo-_*O)/P),this._hi=ot,this._lo=_-ot+tt,this}}},{key:"dump",value:function(){return"DD<"+this._hi+", "+this._lo+">"}},{key:"divide",value:function(){if(arguments[0]instanceof c){var r,a,u,g,_=arguments[0],E=null,P=null,O=null,B=null;return r=(u=this._hi/_._hi)-(E=(O=c.SPLIT*u)-(E=O-u)),B=E*(P=(B=c.SPLIT*_._hi)-(P=B-_._hi))-(g=u*_._hi)+E*(a=_._hi-P)+r*P+r*a,new c(B=u+(O=(this._hi-g-B+this._lo-u*_._lo)/_._hi),u-B+O)}if(typeof arguments[0]=="number"){var Z=arguments[0];return J.isNaN(Z)?c.createNaN():c.copy(this).selfDivide(Z,0)}}},{key:"ge",value:function(r){return this._hi>r._hi||this._hi===r._hi&&this._lo>=r._lo}},{key:"pow",value:function(r){if(r===0)return c.valueOf(1);var a=new c(this),u=c.valueOf(1),g=Math.abs(r);if(g>1)for(;g>0;)g%2==1&&u.selfMultiply(a),(g/=2)>0&&(a=a.sqr());else u=a;return r<0?u.reciprocal():u}},{key:"ceil",value:function(){if(this.isNaN())return c.NaN;var r=Math.ceil(this._hi),a=0;return r===this._hi&&(a=Math.ceil(this._lo)),new c(r,a)}},{key:"compareTo",value:function(r){var a=r;return this._hi<a._hi?-1:this._hi>a._hi?1:this._lo<a._lo?-1:this._lo>a._lo?1:0}},{key:"rint",value:function(){return this.isNaN()?this:this.add(.5).floor()}},{key:"setValue",value:function(){if(arguments[0]instanceof c){var r=arguments[0];return this.init(r),this}if(typeof arguments[0]=="number"){var a=arguments[0];return this.init(a),this}}},{key:"max",value:function(r){return this.ge(r)?this:r}},{key:"sqrt",value:function(){if(this.isZero())return c.valueOf(0);if(this.isNegative())return c.NaN;var r=1/Math.sqrt(this._hi),a=this._hi*r,u=c.valueOf(a),g=this.subtract(u.sqr())._hi*(.5*r);return u.add(g)}},{key:"selfAdd",value:function(){if(arguments.length===1){if(arguments[0]instanceof c){var r=arguments[0];return this.selfAdd(r._hi,r._lo)}if(typeof arguments[0]=="number"){var a,u,g,_,E,P=arguments[0],O=null;return O=(g=this._hi+P)-(_=g-this._hi),u=(E=(O=P-_+(this._hi-O))+this._lo)+(g-(a=g+E)),this._hi=a+u,this._lo=u+(a-this._hi),this}}else if(arguments.length===2){var B,Z,tt,ot,Et=arguments[0],Nt=arguments[1],Dt=null,Zt=null,Yt=null;tt=this._hi+Et,Z=this._lo+Nt,Zt=tt-(Yt=tt-this._hi),Dt=Z-(ot=Z-this._lo);var oe=(B=tt+(Yt=(Zt=Et-Yt+(this._hi-Zt))+Z))+(Yt=(Dt=Nt-ot+(this._lo-Dt))+(Yt+(tt-B))),qe=Yt+(B-oe);return this._hi=oe,this._lo=qe,this}}},{key:"selfMultiply",value:function(){if(arguments.length===1){if(arguments[0]instanceof c){var r=arguments[0];return this.selfMultiply(r._hi,r._lo)}if(typeof arguments[0]=="number"){var a=arguments[0];return this.selfMultiply(a,0)}}else if(arguments.length===2){var u,g,_=arguments[0],E=arguments[1],P=null,O=null,B=null,Z=null;P=(B=c.SPLIT*this._hi)-this._hi,Z=c.SPLIT*_,P=B-P,u=this._hi-P,O=Z-_;var tt=(B=this._hi*_)+(Z=P*(O=Z-O)-B+P*(g=_-O)+u*O+u*g+(this._hi*E+this._lo*_)),ot=Z+(P=B-tt);return this._hi=tt,this._lo=ot,this}}},{key:"selfSqr",value:function(){return this.selfMultiply(this)}},{key:"floor",value:function(){if(this.isNaN())return c.NaN;var r=Math.floor(this._hi),a=0;return r===this._hi&&(a=Math.floor(this._lo)),new c(r,a)}},{key:"negate",value:function(){return this.isNaN()?this:new c(-this._hi,-this._lo)}},{key:"clone",value:function(){try{return null}catch(r){if(r instanceof CloneNotSupportedException)return null;throw r}}},{key:"multiply",value:function(){if(arguments[0]instanceof c){var r=arguments[0];return r.isNaN()?c.createNaN():c.copy(this).selfMultiply(r)}if(typeof arguments[0]=="number"){var a=arguments[0];return J.isNaN(a)?c.createNaN():c.copy(this).selfMultiply(a,0)}}},{key:"isNaN",value:function(){return J.isNaN(this._hi)}},{key:"intValue",value:function(){return Math.trunc(this._hi)}},{key:"toString",value:function(){var r=c.magnitude(this._hi);return r>=-3&&r<=20?this.toStandardNotation():this.toSciNotation()}},{key:"toStandardNotation",value:function(){var r=this.getSpecialNumberString();if(r!==null)return r;var a=new Array(1).fill(null),u=this.extractSignificantDigits(!0,a),g=a[0]+1,_=u;if(u.charAt(0)===".")_="0"+u;else if(g<0)_="0."+c.stringOfChar("0",-g)+u;else if(u.indexOf(".")===-1){var E=g-u.length;_=u+c.stringOfChar("0",E)+".0"}return this.isNegative()?"-"+_:_}},{key:"reciprocal",value:function(){var r,a,u,g,_=null,E=null,P=null,O=null;r=(u=1/this._hi)-(_=(P=c.SPLIT*u)-(_=P-u)),E=(O=c.SPLIT*this._hi)-this._hi;var B=u+(P=(1-(g=u*this._hi)-(O=_*(E=O-E)-g+_*(a=this._hi-E)+r*E+r*a)-u*this._lo)/this._hi);return new c(B,u-B+P)}},{key:"toSciNotation",value:function(){if(this.isZero())return c.SCI_NOT_ZERO;var r=this.getSpecialNumberString();if(r!==null)return r;var a=new Array(1).fill(null),u=this.extractSignificantDigits(!1,a),g=c.SCI_NOT_EXPONENT_CHAR+a[0];if(u.charAt(0)==="0")throw new IllegalStateException("Found leading zero: "+u);var _="";u.length>1&&(_=u.substring(1));var E=u.charAt(0)+"."+_;return this.isNegative()?"-"+E+g:E+g}},{key:"abs",value:function(){return this.isNaN()?c.NaN:this.isNegative()?this.negate():new c(this)}},{key:"isPositive",value:function(){return this._hi>0||this._hi===0&&this._lo>0}},{key:"lt",value:function(r){return this._hi<r._hi||this._hi===r._hi&&this._lo<r._lo}},{key:"add",value:function(){if(arguments[0]instanceof c){var r=arguments[0];return c.copy(this).selfAdd(r)}if(typeof arguments[0]=="number"){var a=arguments[0];return c.copy(this).selfAdd(a)}}},{key:"init",value: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 c){var a=arguments[0];this._hi=a._hi,this._lo=a._lo}}else if(arguments.length===2){var u=arguments[0],g=arguments[1];this._hi=u,this._lo=g}}},{key:"gt",value:function(r){return this._hi>r._hi||this._hi===r._hi&&this._lo>r._lo}},{key:"isNegative",value:function(){return this._hi<0||this._hi===0&&this._lo<0}},{key:"trunc",value:function(){return this.isNaN()?c.NaN:this.isPositive()?this.floor():this.ceil()}},{key:"signum",value:function(){return this._hi>0?1:this._hi<0?-1:this._lo>0?1:this._lo<0?-1:0}},{key:"interfaces_",get:function(){return[I,V,x]}}],[{key:"constructor_",value:function(){if(this._hi=0,this._lo=0,arguments.length===0)this.init(0);else if(arguments.length===1){if(typeof arguments[0]=="number"){var r=arguments[0];this.init(r)}else if(arguments[0]instanceof c){var a=arguments[0];this.init(a)}else if(typeof arguments[0]=="string"){var u=arguments[0];c.constructor_.call(this,c.parse(u))}}else if(arguments.length===2){var g=arguments[0],_=arguments[1];this.init(g,_)}}},{key:"determinant",value:function(){if(typeof arguments[3]=="number"&&typeof arguments[2]=="number"&&typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var r=arguments[0],a=arguments[1],u=arguments[2],g=arguments[3];return c.determinant(c.valueOf(r),c.valueOf(a),c.valueOf(u),c.valueOf(g))}if(arguments[3]instanceof c&&arguments[2]instanceof c&&arguments[0]instanceof c&&arguments[1]instanceof c){var _=arguments[1],E=arguments[2],P=arguments[3];return arguments[0].multiply(P).selfSubtract(_.multiply(E))}}},{key:"sqr",value:function(r){return c.valueOf(r).selfMultiply(r)}},{key:"valueOf",value:function(){if(typeof arguments[0]=="string"){var r=arguments[0];return c.parse(r)}if(typeof arguments[0]=="number")return new c(arguments[0])}},{key:"sqrt",value:function(r){return c.valueOf(r).sqrt()}},{key:"parse",value:function(r){for(var a=0,u=r.length;Gg.isWhitespace(r.charAt(a));)a++;var g=!1;if(a<u){var _=r.charAt(a);_!=="-"&&_!=="+"||(a++,_==="-"&&(g=!0))}for(var E=new c,P=0,O=0,B=0,Z=!1;!(a>=u);){var tt=r.charAt(a);if(a++,Gg.isDigit(tt)){var ot=tt-"0";E.selfMultiply(c.TEN),E.selfAdd(ot),P++}else{if(tt!=="."){if(tt==="e"||tt==="E"){var Et=r.substring(a);try{B=Hs.parseInt(Et)}catch(oe){throw oe instanceof NumberFormatException?new NumberFormatException("Invalid exponent "+Et+" in string "+r):oe}break}throw new NumberFormatException("Unexpected character '"+tt+"' at position "+a+" in string "+r)}O=P,Z=!0}}var Nt=E;Z||(O=P);var Dt=P-O-B;if(Dt===0)Nt=E;else if(Dt>0){var Zt=c.TEN.pow(Dt);Nt=E.divide(Zt)}else if(Dt<0){var Yt=c.TEN.pow(-Dt);Nt=E.multiply(Yt)}return g?Nt.negate():Nt}},{key:"createNaN",value:function(){return new c(J.NaN,J.NaN)}},{key:"copy",value:function(r){return new c(r)}},{key:"magnitude",value:function(r){var a=Math.abs(r),u=Math.log(a)/Math.log(10),g=Math.trunc(Math.floor(u));return 10*Math.pow(10,g)<=a&&(g+=1),g}},{key:"stringOfChar",value:function(r,a){for(var u=new Ws,g=0;g<a;g++)u.append(r);return u.toString()}}])})();Bt.PI=new Bt(3.141592653589793,12246467991473532e-32),Bt.TWO_PI=new Bt(6.283185307179586,24492935982947064e-32),Bt.PI_2=new Bt(1.5707963267948966,6123233995736766e-32),Bt.E=new Bt(2.718281828459045,14456468917292502e-32),Bt.NaN=new Bt(J.NaN,J.NaN),Bt.EPS=123259516440783e-46,Bt.SPLIT=134217729,Bt.MAX_PRINT_DIGITS=32,Bt.TEN=Bt.valueOf(10),Bt.ONE=Bt.valueOf(1),Bt.SCI_NOT_EXPONENT_CHAR="E",Bt.SCI_NOT_ZERO="0.0E0";var jg=(function(){function c(){s(this,c)}return l(c,null,[{key:"orientationIndex",value:function(r,a,u){var g=c.orientationIndexFilter(r,a,u);if(g<=1)return g;var _=Bt.valueOf(a.x).selfAdd(-r.x),E=Bt.valueOf(a.y).selfAdd(-r.y),P=Bt.valueOf(u.x).selfAdd(-a.x),O=Bt.valueOf(u.y).selfAdd(-a.y);return _.selfMultiply(O).selfSubtract(E.selfMultiply(P)).signum()}},{key:"signOfDet2x2",value:function(){if(arguments[3]instanceof Bt&&arguments[2]instanceof Bt&&arguments[0]instanceof Bt&&arguments[1]instanceof Bt){var r=arguments[1],a=arguments[2],u=arguments[3];return arguments[0].multiply(u).selfSubtract(r.multiply(a)).signum()}if(typeof arguments[3]=="number"&&typeof arguments[2]=="number"&&typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var g=arguments[0],_=arguments[1],E=arguments[2],P=arguments[3],O=Bt.valueOf(g),B=Bt.valueOf(_),Z=Bt.valueOf(E),tt=Bt.valueOf(P);return O.multiply(tt).selfSubtract(B.multiply(Z)).signum()}}},{key:"intersection",value:function(r,a,u,g){var _=new Bt(r.y).selfSubtract(a.y),E=new Bt(a.x).selfSubtract(r.x),P=new Bt(r.x).selfMultiply(a.y).selfSubtract(new Bt(a.x).selfMultiply(r.y)),O=new Bt(u.y).selfSubtract(g.y),B=new Bt(g.x).selfSubtract(u.x),Z=new Bt(u.x).selfMultiply(g.y).selfSubtract(new Bt(g.x).selfMultiply(u.y)),tt=E.multiply(Z).selfSubtract(B.multiply(P)),ot=O.multiply(P).selfSubtract(_.multiply(Z)),Et=_.multiply(B).selfSubtract(O.multiply(E)),Nt=tt.selfDivide(Et).doubleValue(),Dt=ot.selfDivide(Et).doubleValue();return J.isNaN(Nt)||J.isInfinite(Nt)||J.isNaN(Dt)||J.isInfinite(Dt)?null:new K(Nt,Dt)}},{key:"orientationIndexFilter",value:function(r,a,u){var g=null,_=(r.x-u.x)*(a.y-u.y),E=(r.y-u.y)*(a.x-u.x),P=_-E;if(_>0){if(E<=0)return c.signum(P);g=_+E}else{if(!(_<0)||E>=0)return c.signum(P);g=-_-E}var O=c.DP_SAFE_EPSILON*g;return P>=O||-P>=O?c.signum(P):2}},{key:"signum",value:function(r){return r>0?1:r<0?-1:0}}])})();jg.DP_SAFE_EPSILON=1e-15;var Kt=(function(){return l((function c(){s(this,c)}),[{key:"getM",value:function(c){if(this.hasM()){var r=this.getDimension()-this.getMeasures();return this.getOrdinate(c,r)}return J.NaN}},{key:"setOrdinate",value:function(c,r,a){}},{key:"getZ",value:function(c){return this.hasZ()?this.getOrdinate(c,2):J.NaN}},{key:"size",value:function(){}},{key:"getOrdinate",value:function(c,r){}},{key:"getCoordinate",value:function(){}},{key:"getCoordinateCopy",value:function(c){}},{key:"createCoordinate",value:function(){}},{key:"getDimension",value:function(){}},{key:"hasM",value:function(){return this.getMeasures()>0}},{key:"getX",value:function(c){}},{key:"hasZ",value:function(){return this.getDimension()-this.getMeasures()>2}},{key:"getMeasures",value:function(){return 0}},{key:"expandEnvelope",value:function(c){}},{key:"copy",value:function(){}},{key:"getY",value:function(c){}},{key:"toCoordinateArray",value:function(){}},{key:"interfaces_",get:function(){return[x]}}])})();Kt.X=0,Kt.Y=1,Kt.Z=2,Kt.M=3;var Ut=(function(){function c(){s(this,c)}return l(c,null,[{key:"index",value:function(r,a,u){return jg.orientationIndex(r,a,u)}},{key:"isCCW",value:function(){if(arguments[0]instanceof Array){var r=arguments[0],a=r.length-1;if(a<3)throw new D("Ring has fewer than 4 points, so orientation cannot be determined");for(var u=r[0],g=0,_=1;_<=a;_++){var E=r[_];E.y>u.y&&(u=E,g=_)}var P=g;do(P-=1)<0&&(P=a);while(r[P].equals2D(u)&&P!==g);var O=g;do O=(O+1)%a;while(r[O].equals2D(u)&&O!==g);var B=r[P],Z=r[O];if(B.equals2D(u)||Z.equals2D(u)||B.equals2D(Z))return!1;var tt=c.index(B,u,Z);return tt===0?B.x>Z.x:tt>0}if(Vt(arguments[0],Kt)){var ot=arguments[0],Et=ot.size()-1;if(Et<3)throw new D("Ring has fewer than 4 points, so orientation cannot be determined");for(var Nt=ot.getCoordinate(0),Dt=0,Zt=1;Zt<=Et;Zt++){var Yt=ot.getCoordinate(Zt);Yt.y>Nt.y&&(Nt=Yt,Dt=Zt)}var oe=null,qe=Dt;do(qe-=1)<0&&(qe=Et),oe=ot.getCoordinate(qe);while(oe.equals2D(Nt)&&qe!==Dt);var ti=null,Xr=Dt;do Xr=(Xr+1)%Et,ti=ot.getCoordinate(Xr);while(ti.equals2D(Nt)&&Xr!==Dt);if(oe.equals2D(Nt)||ti.equals2D(Nt)||oe.equals2D(ti))return!1;var zh=c.index(oe,Nt,ti);return zh===0?oe.x>ti.x:zh>0}}}])})();Ut.CLOCKWISE=-1,Ut.RIGHT=Ut.CLOCKWISE,Ut.COUNTERCLOCKWISE=1,Ut.LEFT=Ut.COUNTERCLOCKWISE,Ut.COLLINEAR=0,Ut.STRAIGHT=Ut.COLLINEAR;var rN=(function(){return l((function c(){s(this,c),c.constructor_.apply(this,arguments)}),[{key:"getCoordinate",value:function(){return this._minCoord}},{key:"getRightmostSide",value:function(c,r){var a=this.getRightmostSideOfSegment(c,r);return a<0&&(a=this.getRightmostSideOfSegment(c,r-1)),a<0&&(this._minCoord=null,this.checkForRightmostCoordinate(c)),a}},{key:"findRightmostEdgeAtVertex",value:function(){var c=this._minDe.getEdge().getCoordinates();ct.isTrue(this._minIndex>0&&this._minIndex<c.length,"rightmost point expected to be interior vertex of edge");var r=c[this._minIndex-1],a=c[this._minIndex+1],u=Ut.index(this._minCoord,a,r),g=!1;(r.y<this._minCoord.y&&a.y<this._minCoord.y&&u===Ut.COUNTERCLOCKWISE||r.y>this._minCoord.y&&a.y>this._minCoord.y&&u===Ut.CLOCKWISE)&&(g=!0),g&&(this._minIndex=this._minIndex-1)}},{key:"getRightmostSideOfSegment",value:function(c,r){var a=c.getEdge().getCoordinates();if(r<0||r+1>=a.length||a[r].y===a[r+1].y)return-1;var u=ut.LEFT;return a[r].y<a[r+1].y&&(u=ut.RIGHT),u}},{key:"getEdge",value:function(){return this._orientedDe}},{key:"checkForRightmostCoordinate",value:function(c){for(var r=c.getEdge().getCoordinates(),a=0;a<r.length-1;a++)(this._minCoord===null||r[a].x>this._minCoord.x)&&(this._minDe=c,this._minIndex=a,this._minCoord=r[a])}},{key:"findRightmostEdgeAtNode",value:function(){var c=this._minDe.getNode().getEdges();this._minDe=c.getRightmostEdge(),this._minDe.isForward()||(this._minDe=this._minDe.getSym(),this._minIndex=this._minDe.getEdge().getCoordinates().length-1)}},{key:"findEdge",value:function(c){for(var r=c.iterator();r.hasNext();){var a=r.next();a.isForward()&&this.checkForRightmostCoordinate(a)}ct.isTrue(this._minIndex!==0||this._minCoord.equals(this._minDe.getCoordinate()),"inconsistency in rightmost processing"),this._minIndex===0?this.findRightmostEdgeAtNode():this.findRightmostEdgeAtVertex(),this._orientedDe=this._minDe,this.getRightmostSide(this._minDe,this._minIndex)===ut.LEFT&&(this._orientedDe=this._minDe.getSym())}}],[{key:"constructor_",value:function(){this._minIndex=-1,this._minCoord=null,this._minDe=null,this._orientedDe=null}}])})(),fs=(function(c){function r(a,u){var g;return s(this,r),(g=n(this,r,[u?a+" [ "+u+" ]":a])).pt=u?new K(u):void 0,g.name=Object.keys({TopologyException:r})[0],g}return m(r,c),l(r,[{key:"getCoordinate",value:function(){return this.pt}}])})(ht),aN=(function(){return l((function c(){s(this,c),this.array=[]}),[{key:"addLast",value:function(c){this.array.push(c)}},{key:"removeFirst",value:function(){return this.array.shift()}},{key:"isEmpty",value:function(){return this.array.length===0}}])})(),Gt=(function(c){function r(a){var u;return s(this,r),(u=n(this,r)).array=[],a instanceof at&&u.addAll(a),u}return m(r,c),l(r,[{key:"interfaces_",get:function(){return[ds,at]}},{key:"ensureCapacity",value:function(){}},{key:"add",value:function(a){return arguments.length===1?this.array.push(a):this.array.splice(arguments[0],0,arguments[1]),!0}},{key:"clear",value:function(){this.array=[]}},{key:"addAll",value:function(a){var u,g=d(a);try{for(g.s();!(u=g.n()).done;){var _=u.value;this.array.push(_)}}catch(E){g.e(E)}finally{g.f()}}},{key:"set",value:function(a,u){var g=this.array[a];return this.array[a]=u,g}},{key:"iterator",value:function(){return new oN(this)}},{key:"get",value:function(a){if(a<0||a>=this.size())throw new ku;return this.array[a]}},{key:"isEmpty",value:function(){return this.array.length===0}},{key:"sort",value:function(a){a?this.array.sort((function(u,g){return a.compare(u,g)})):this.array.sort()}},{key:"size",value:function(){return this.array.length}},{key:"toArray",value:function(){return this.array.slice()}},{key:"remove",value:function(a){for(var u=0,g=this.array.length;u<g;u++)if(this.array[u]===a)return!!this.array.splice(u,1);return!1}},{key:Symbol.iterator,value:function(){return this.array.values()}}])})(ds),oN=(function(){return l((function c(r){s(this,c),this.arrayList=r,this.position=0}),[{key:"next",value:function(){if(this.position===this.arrayList.size())throw new Pt;return this.arrayList.get(this.position++)}},{key:"hasNext",value:function(){return this.position<this.arrayList.size()}},{key:"set",value:function(c){return this.arrayList.set(this.position-1,c)}},{key:"remove",value:function(){this.arrayList.remove(this.arrayList.get(this.position))}}])})(),hN=(function(){return l((function c(){s(this,c),c.constructor_.apply(this,arguments)}),[{key:"clearVisitedEdges",value:function(){for(var c=this._dirEdgeList.iterator();c.hasNext();)c.next().setVisited(!1)}},{key:"getRightmostCoordinate",value:function(){return this._rightMostCoord}},{key:"computeNodeDepth",value:function(c){for(var r=null,a=c.getEdges().iterator();a.hasNext();){var u=a.next();if(u.isVisited()||u.getSym().isVisited()){r=u;break}}if(r===null)throw new fs("unable to find edge to compute depths at "+c.getCoordinate());c.getEdges().computeDepths(r);for(var g=c.getEdges().iterator();g.hasNext();){var _=g.next();_.setVisited(!0),this.copySymDepths(_)}}},{key:"computeDepth",value:function(c){this.clearVisitedEdges();var r=this._finder.getEdge();r.getNode(),r.getLabel(),r.setEdgeDepths(ut.RIGHT,c),this.copySymDepths(r),this.computeDepths(r)}},{key:"create",value:function(c){this.addReachable(c),this._finder.findEdge(this._dirEdgeList),this._rightMostCoord=this._finder.getCoordinate()}},{key:"findResultEdges",value:function(){for(var c=this._dirEdgeList.iterator();c.hasNext();){var r=c.next();r.getDepth(ut.RIGHT)>=1&&r.getDepth(ut.LEFT)<=0&&!r.isInteriorAreaEdge()&&r.setInResult(!0)}}},{key:"computeDepths",value:function(c){var r=new le,a=new aN,u=c.getNode();for(a.addLast(u),r.add(u),c.setVisited(!0);!a.isEmpty();){var g=a.removeFirst();r.add(g),this.computeNodeDepth(g);for(var _=g.getEdges().iterator();_.hasNext();){var E=_.next().getSym();if(!E.isVisited()){var P=E.getNode();r.contains(P)||(a.addLast(P),r.add(P))}}}}},{key:"compareTo",value:function(c){var r=c;return this._rightMostCoord.x<r._rightMostCoord.x?-1:this._rightMostCoord.x>r._rightMostCoord.x?1:0}},{key:"getEnvelope",value:function(){if(this._env===null){for(var c=new zt,r=this._dirEdgeList.iterator();r.hasNext();)for(var a=r.next().getEdge().getCoordinates(),u=0;u<a.length-1;u++)c.expandToInclude(a[u]);this._env=c}return this._env}},{key:"addReachable",value:function(c){var r=new Fg;for(r.add(c);!r.empty();){var a=r.pop();this.add(a,r)}}},{key:"copySymDepths",value:function(c){var r=c.getSym();r.setDepth(ut.LEFT,c.getDepth(ut.RIGHT)),r.setDepth(ut.RIGHT,c.getDepth(ut.LEFT))}},{key:"add",value:function(c,r){c.setVisited(!0),this._nodes.add(c);for(var a=c.getEdges().iterator();a.hasNext();){var u=a.next();this._dirEdgeList.add(u);var g=u.getSym().getNode();g.isVisited()||r.push(g)}}},{key:"getNodes",value:function(){return this._nodes}},{key:"getDirectedEdges",value:function(){return this._dirEdgeList}},{key:"interfaces_",get:function(){return[V]}}],[{key:"constructor_",value:function(){this._finder=null,this._dirEdgeList=new Gt,this._nodes=new Gt,this._rightMostCoord=null,this._env=null,this._finder=new rN}}])})(),Bg=(function(){return l((function c(){s(this,c)}),null,[{key:"intersection",value:function(c,r,a,u){var g=c.x<r.x?c.x:r.x,_=c.y<r.y?c.y:r.y,E=c.x>r.x?c.x:r.x,P=c.y>r.y?c.y:r.y,O=a.x<u.x?a.x:u.x,B=a.y<u.y?a.y:u.y,Z=a.x>u.x?a.x:u.x,tt=a.y>u.y?a.y:u.y,ot=((g>O?g:O)+(E<Z?E:Z))/2,Et=((_>B?_:B)+(P<tt?P:tt))/2,Nt=c.x-ot,Dt=c.y-Et,Zt=r.x-ot,Yt=r.y-Et,oe=a.x-ot,qe=a.y-Et,ti=u.x-ot,Xr=u.y-Et,zh=Dt-Yt,m1=Zt-Nt,v1=Nt*Yt-Zt*Dt,y1=qe-Xr,_1=ti-oe,w1=oe*Xr-ti*qe,E1=zh*_1-y1*m1,ip=(m1*w1-_1*v1)/E1,np=(y1*v1-zh*w1)/E1;return J.isNaN(ip)||J.isInfinite(ip)||J.isNaN(np)||J.isInfinite(np)?null:new K(ip+ot,np+Et)}}])})(),Yi=(function(){return l((function c(){s(this,c)}),null,[{key:"arraycopy",value:function(c,r,a,u,g){for(var _=0,E=r;E<r+g;E++)a[u+_]=c[E],_++}},{key:"getProperty",value:function(c){return{"line.separator":`
|
|
47
|
-
`}[c]}}])})(),Rh=(function(){function c(){s(this,c)}return l(c,null,[{key:"log10",value:function(r){var a=Math.log(r);return J.isInfinite(a)||J.isNaN(a)?a:a/c.LOG_10}},{key:"min",value:function(r,a,u,g){var _=r;return a<_&&(_=a),u<_&&(_=u),g<_&&(_=g),_}},{key:"clamp",value:function(){if(typeof arguments[2]=="number"&&typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var r=arguments[0],a=arguments[1],u=arguments[2];return r<a?a:r>u?u:r}if(Number.isInteger(arguments[2])&&Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var g=arguments[0],_=arguments[1],E=arguments[2];return g<_?_:g>E?E:g}}},{key:"wrap",value:function(r,a){return r<0?a- -r%a:r%a}},{key:"max",value:function(){if(arguments.length===3){var r=arguments[1],a=arguments[2],u=arguments[0];return r>u&&(u=r),a>u&&(u=a),u}if(arguments.length===4){var g=arguments[1],_=arguments[2],E=arguments[3],P=arguments[0];return g>P&&(P=g),_>P&&(P=_),E>P&&(P=E),P}}},{key:"average",value:function(r,a){return(r+a)/2}}])})();Rh.LOG_10=Math.log(10);var qn=(function(){function c(){s(this,c)}return l(c,null,[{key:"segmentToSegment",value:function(r,a,u,g){if(r.equals(a))return c.pointToSegment(r,u,g);if(u.equals(g))return c.pointToSegment(g,r,a);var _=!1;if(zt.intersects(r,a,u,g)){var E=(a.x-r.x)*(g.y-u.y)-(a.y-r.y)*(g.x-u.x);if(E===0)_=!0;else{var P=(r.y-u.y)*(g.x-u.x)-(r.x-u.x)*(g.y-u.y),O=((r.y-u.y)*(a.x-r.x)-(r.x-u.x)*(a.y-r.y))/E,B=P/E;(B<0||B>1||O<0||O>1)&&(_=!0)}}else _=!0;return _?Rh.min(c.pointToSegment(r,u,g),c.pointToSegment(a,u,g),c.pointToSegment(u,r,a),c.pointToSegment(g,r,a)):0}},{key:"pointToSegment",value:function(r,a,u){if(a.x===u.x&&a.y===u.y)return r.distance(a);var g=(u.x-a.x)*(u.x-a.x)+(u.y-a.y)*(u.y-a.y),_=((r.x-a.x)*(u.x-a.x)+(r.y-a.y)*(u.y-a.y))/g;if(_<=0)return r.distance(a);if(_>=1)return r.distance(u);var E=((a.y-r.y)*(u.x-a.x)-(a.x-r.x)*(u.y-a.y))/g;return Math.abs(E)*Math.sqrt(g)}},{key:"pointToLinePerpendicular",value:function(r,a,u){var g=(u.x-a.x)*(u.x-a.x)+(u.y-a.y)*(u.y-a.y),_=((a.y-r.y)*(u.x-a.x)-(a.x-r.x)*(u.y-a.y))/g;return Math.abs(_)*Math.sqrt(g)}},{key:"pointToSegmentString",value:function(r,a){if(a.length===0)throw new D("Line array must contain at least one vertex");for(var u=r.distance(a[0]),g=0;g<a.length-1;g++){var _=c.pointToSegment(r,a[g],a[g+1]);_<u&&(u=_)}return u}}])})(),O_=(function(){return l((function c(){s(this,c)}),[{key:"create",value:function(){if(arguments.length===1)arguments[0]instanceof Array||Vt(arguments[0],Kt);else if(arguments.length!==2){if(arguments.length===3){var c=arguments[0],r=arguments[1];return this.create(c,r)}}}}])})(),Ou=(function(){return l((function c(){s(this,c)}),[{key:"filter",value:function(c){}}])})(),lN=(function(){return l((function c(){s(this,c)}),null,[{key:"ofLine",value:function(c){var r=c.size();if(r<=1)return 0;var a=0,u=new K;c.getCoordinate(0,u);for(var g=u.x,_=u.y,E=1;E<r;E++){c.getCoordinate(E,u);var P=u.x,O=u.y,B=P-g,Z=O-_;a+=Math.sqrt(B*B+Z*Z),g=P,_=O}return a}}])})(),N_=l((function c(){s(this,c)})),Ur=(function(){function c(){s(this,c)}return l(c,null,[{key:"copyCoord",value:function(r,a,u,g){for(var _=Math.min(r.getDimension(),u.getDimension()),E=0;E<_;E++)u.setOrdinate(g,E,r.getOrdinate(a,E))}},{key:"isRing",value:function(r){var a=r.size();return a===0||!(a<=3)&&r.getOrdinate(0,Kt.X)===r.getOrdinate(a-1,Kt.X)&&r.getOrdinate(0,Kt.Y)===r.getOrdinate(a-1,Kt.Y)}},{key:"scroll",value:function(){if(arguments.length===2){if(Vt(arguments[0],Kt)&&Number.isInteger(arguments[1])){var r=arguments[0],a=arguments[1];c.scroll(r,a,c.isRing(r))}else if(Vt(arguments[0],Kt)&&arguments[1]instanceof K){var u=arguments[0],g=arguments[1],_=c.indexOf(g,u);if(_<=0)return null;c.scroll(u,_)}}else if(arguments.length===3){var E=arguments[0],P=arguments[1],O=arguments[2];if(P<=0)return null;for(var B=E.copy(),Z=O?E.size()-1:E.size(),tt=0;tt<Z;tt++)for(var ot=0;ot<E.getDimension();ot++)E.setOrdinate(tt,ot,B.getOrdinate((P+tt)%Z,ot));if(O)for(var Et=0;Et<E.getDimension();Et++)E.setOrdinate(Z,Et,E.getOrdinate(0,Et))}}},{key:"isEqual",value:function(r,a){var u=r.size();if(u!==a.size())return!1;for(var g=Math.min(r.getDimension(),a.getDimension()),_=0;_<u;_++)for(var E=0;E<g;E++){var P=r.getOrdinate(_,E),O=a.getOrdinate(_,E);if(r.getOrdinate(_,E)!==a.getOrdinate(_,E)&&(!J.isNaN(P)||!J.isNaN(O)))return!1}return!0}},{key:"minCoordinateIndex",value:function(){if(arguments.length===1){var r=arguments[0];return c.minCoordinateIndex(r,0,r.size()-1)}if(arguments.length===3){for(var a=arguments[0],u=arguments[2],g=-1,_=null,E=arguments[1];E<=u;E++){var P=a.getCoordinate(E);(_===null||_.compareTo(P)>0)&&(_=P,g=E)}return g}}},{key:"extend",value:function(r,a,u){var g=r.create(u,a.getDimension()),_=a.size();if(c.copy(a,0,g,0,_),_>0)for(var E=_;E<u;E++)c.copy(a,_-1,g,E,1);return g}},{key:"reverse",value:function(r){for(var a=r.size()-1,u=Math.trunc(a/2),g=0;g<=u;g++)c.swap(r,g,a-g)}},{key:"swap",value:function(r,a,u){if(a===u)return null;for(var g=0;g<r.getDimension();g++){var _=r.getOrdinate(a,g);r.setOrdinate(a,g,r.getOrdinate(u,g)),r.setOrdinate(u,g,_)}}},{key:"copy",value:function(r,a,u,g,_){for(var E=0;E<_;E++)c.copyCoord(r,a+E,u,g+E)}},{key:"ensureValidRing",value:function(r,a){var u=a.size();return u===0?a:u<=3?c.createClosedRing(r,a,4):a.getOrdinate(0,Kt.X)===a.getOrdinate(u-1,Kt.X)&&a.getOrdinate(0,Kt.Y)===a.getOrdinate(u-1,Kt.Y)?a:c.createClosedRing(r,a,u+1)}},{key:"indexOf",value:function(r,a){for(var u=0;u<a.size();u++)if(r.x===a.getOrdinate(u,Kt.X)&&r.y===a.getOrdinate(u,Kt.Y))return u;return-1}},{key:"createClosedRing",value:function(r,a,u){var g=r.create(u,a.getDimension()),_=a.size();c.copy(a,0,g,0,_);for(var E=_;E<u;E++)c.copy(a,0,g,E,1);return g}},{key:"minCoordinate",value:function(r){for(var a=null,u=0;u<r.size();u++){var g=r.getCoordinate(u);(a===null||a.compareTo(g)>0)&&(a=g)}return a}}])})(),pt=(function(){function c(){s(this,c)}return l(c,null,[{key:"toDimensionSymbol",value:function(r){switch(r){case c.FALSE:return c.SYM_FALSE;case c.TRUE:return c.SYM_TRUE;case c.DONTCARE:return c.SYM_DONTCARE;case c.P:return c.SYM_P;case c.L:return c.SYM_L;case c.A:return c.SYM_A}throw new D("Unknown dimension value: "+r)}},{key:"toDimensionValue",value:function(r){switch(Gg.toUpperCase(r)){case c.SYM_FALSE:return c.FALSE;case c.SYM_TRUE:return c.TRUE;case c.SYM_DONTCARE:return c.DONTCARE;case c.SYM_P:return c.P;case c.SYM_L:return c.L;case c.SYM_A:return c.A}throw new D("Unknown dimension symbol: "+r)}}])})();pt.P=0,pt.L=1,pt.A=2,pt.FALSE=-1,pt.TRUE=-2,pt.DONTCARE=-3,pt.SYM_FALSE="F",pt.SYM_TRUE="T",pt.SYM_DONTCARE="*",pt.SYM_P="0",pt.SYM_L="1",pt.SYM_A="2";var Nu=(function(){return l((function c(){s(this,c)}),[{key:"filter",value:function(c){}}])})(),Ru=(function(){return l((function c(){s(this,c)}),[{key:"filter",value:function(c,r){}},{key:"isDone",value:function(){}},{key:"isGeometryChanged",value:function(){}}])})(),Ah=(function(c){function r(){var a;return s(this,r),a=n(this,r),r.constructor_.apply(a,arguments),a}return m(r,c),l(r,[{key:"computeEnvelopeInternal",value:function(){return this.isEmpty()?new zt:this._points.expandEnvelope(new zt)}},{key:"isRing",value:function(){return this.isClosed()&&this.isSimple()}},{key:"getCoordinates",value:function(){return this._points.toCoordinateArray()}},{key:"copyInternal",value:function(){return new r(this._points.copy(),this._factory)}},{key:"equalsExact",value:function(){if(arguments.length===2&&typeof arguments[1]=="number"&&arguments[0]instanceof gt){var a=arguments[0],u=arguments[1];if(!this.isEquivalentClass(a))return!1;var g=a;if(this._points.size()!==g._points.size())return!1;for(var _=0;_<this._points.size();_++)if(!this.equal(this._points.getCoordinate(_),g._points.getCoordinate(_),u))return!1;return!0}return S(r,"equalsExact",this,1).apply(this,arguments)}},{key:"normalize",value:function(){for(var a=0;a<Math.trunc(this._points.size()/2);a++){var u=this._points.size()-1-a;if(!this._points.getCoordinate(a).equals(this._points.getCoordinate(u))){if(this._points.getCoordinate(a).compareTo(this._points.getCoordinate(u))>0){var g=this._points.copy();Ur.reverse(g),this._points=g}return null}}}},{key:"getCoordinate",value:function(){return this.isEmpty()?null:this._points.getCoordinate(0)}},{key:"getBoundaryDimension",value:function(){return this.isClosed()?pt.FALSE:0}},{key:"isClosed",value:function(){return!this.isEmpty()&&this.getCoordinateN(0).equals2D(this.getCoordinateN(this.getNumPoints()-1))}},{key:"reverseInternal",value:function(){var a=this._points.copy();return Ur.reverse(a),this.getFactory().createLineString(a)}},{key:"getEndPoint",value:function(){return this.isEmpty()?null:this.getPointN(this.getNumPoints()-1)}},{key:"getTypeCode",value:function(){return gt.TYPECODE_LINESTRING}},{key:"getDimension",value:function(){return 1}},{key:"getLength",value:function(){return lN.ofLine(this._points)}},{key:"getNumPoints",value:function(){return this._points.size()}},{key:"compareToSameClass",value:function(){if(arguments.length===1){for(var a=arguments[0],u=0,g=0;u<this._points.size()&&g<a._points.size();){var _=this._points.getCoordinate(u).compareTo(a._points.getCoordinate(g));if(_!==0)return _;u++,g++}return u<this._points.size()?1:g<a._points.size()?-1:0}if(arguments.length===2){var E=arguments[0];return arguments[1].compare(this._points,E._points)}}},{key:"apply",value:function(){if(Vt(arguments[0],Ou))for(var a=arguments[0],u=0;u<this._points.size();u++)a.filter(this._points.getCoordinate(u));else if(Vt(arguments[0],Ru)){var g=arguments[0];if(this._points.size()===0)return null;for(var _=0;_<this._points.size()&&(g.filter(this._points,_),!g.isDone());_++);g.isGeometryChanged()&&this.geometryChanged()}else Vt(arguments[0],Nu)?arguments[0].filter(this):Vt(arguments[0],L)&&arguments[0].filter(this)}},{key:"getBoundary",value:function(){throw new It}},{key:"isEquivalentClass",value:function(a){return a instanceof r}},{key:"getCoordinateN",value:function(a){return this._points.getCoordinate(a)}},{key:"getGeometryType",value:function(){return gt.TYPENAME_LINESTRING}},{key:"getCoordinateSequence",value:function(){return this._points}},{key:"isEmpty",value:function(){return this._points.size()===0}},{key:"init",value:function(a){if(a===null&&(a=this.getFactory().getCoordinateSequenceFactory().create([])),a.size()===1)throw new D("Invalid number of points in LineString (found "+a.size()+" - must be 0 or >= 2)");this._points=a}},{key:"isCoordinate",value:function(a){for(var u=0;u<this._points.size();u++)if(this._points.getCoordinate(u).equals(a))return!0;return!1}},{key:"getStartPoint",value:function(){return this.isEmpty()?null:this.getPointN(0)}},{key:"getPointN",value:function(a){return this.getFactory().createPoint(this._points.getCoordinate(a))}},{key:"interfaces_",get:function(){return[N_]}}],[{key:"constructor_",value:function(){if(this._points=null,arguments.length!==0){if(arguments.length===2){var a=arguments[0],u=arguments[1];gt.constructor_.call(this,u),this.init(a)}}}}])})(gt),R_=l((function c(){s(this,c)})),zg=(function(c){function r(){var a;return s(this,r),a=n(this,r),r.constructor_.apply(a,arguments),a}return m(r,c),l(r,[{key:"computeEnvelopeInternal",value:function(){if(this.isEmpty())return new zt;var a=new zt;return a.expandToInclude(this._coordinates.getX(0),this._coordinates.getY(0)),a}},{key:"getCoordinates",value:function(){return this.isEmpty()?[]:[this.getCoordinate()]}},{key:"copyInternal",value:function(){return new r(this._coordinates.copy(),this._factory)}},{key:"equalsExact",value:function(){if(arguments.length===2&&typeof arguments[1]=="number"&&arguments[0]instanceof gt){var a=arguments[0],u=arguments[1];return!!this.isEquivalentClass(a)&&(!(!this.isEmpty()||!a.isEmpty())||this.isEmpty()===a.isEmpty()&&this.equal(a.getCoordinate(),this.getCoordinate(),u))}return S(r,"equalsExact",this,1).apply(this,arguments)}},{key:"normalize",value:function(){}},{key:"getCoordinate",value:function(){return this._coordinates.size()!==0?this._coordinates.getCoordinate(0):null}},{key:"getBoundaryDimension",value:function(){return pt.FALSE}},{key:"reverseInternal",value:function(){return this.getFactory().createPoint(this._coordinates.copy())}},{key:"getTypeCode",value:function(){return gt.TYPECODE_POINT}},{key:"getDimension",value:function(){return 0}},{key:"getNumPoints",value:function(){return this.isEmpty()?0:1}},{key:"getX",value:function(){if(this.getCoordinate()===null)throw new IllegalStateException("getX called on empty Point");return this.getCoordinate().x}},{key:"compareToSameClass",value:function(){if(arguments.length===1){var a=arguments[0];return this.getCoordinate().compareTo(a.getCoordinate())}if(arguments.length===2){var u=arguments[0];return arguments[1].compare(this._coordinates,u._coordinates)}}},{key:"apply",value:function(){if(Vt(arguments[0],Ou)){var a=arguments[0];if(this.isEmpty())return null;a.filter(this.getCoordinate())}else if(Vt(arguments[0],Ru)){var u=arguments[0];if(this.isEmpty())return null;u.filter(this._coordinates,0),u.isGeometryChanged()&&this.geometryChanged()}else Vt(arguments[0],Nu)?arguments[0].filter(this):Vt(arguments[0],L)&&arguments[0].filter(this)}},{key:"getBoundary",value:function(){return this.getFactory().createGeometryCollection()}},{key:"getGeometryType",value:function(){return gt.TYPENAME_POINT}},{key:"getCoordinateSequence",value:function(){return this._coordinates}},{key:"getY",value:function(){if(this.getCoordinate()===null)throw new IllegalStateException("getY called on empty Point");return this.getCoordinate().y}},{key:"isEmpty",value:function(){return this._coordinates.size()===0}},{key:"init",value:function(a){a===null&&(a=this.getFactory().getCoordinateSequenceFactory().create([])),ct.isTrue(a.size()<=1),this._coordinates=a}},{key:"isSimple",value:function(){return!0}},{key:"interfaces_",get:function(){return[R_]}}],[{key:"constructor_",value:function(){this._coordinates=null;var a=arguments[0],u=arguments[1];gt.constructor_.call(this,u),this.init(a)}}])})(gt),A_=(function(){function c(){s(this,c)}return l(c,null,[{key:"ofRing",value:function(){if(arguments[0]instanceof Array){var r=arguments[0];return Math.abs(c.ofRingSigned(r))}if(Vt(arguments[0],Kt)){var a=arguments[0];return Math.abs(c.ofRingSigned(a))}}},{key:"ofRingSigned",value:function(){if(arguments[0]instanceof Array){var r=arguments[0];if(r.length<3)return 0;for(var a=0,u=r[0].x,g=1;g<r.length-1;g++){var _=r[g].x-u,E=r[g+1].y;a+=_*(r[g-1].y-E)}return a/2}if(Vt(arguments[0],Kt)){var P=arguments[0],O=P.size();if(O<3)return 0;var B=new K,Z=new K,tt=new K;P.getCoordinate(0,Z),P.getCoordinate(1,tt);var ot=Z.x;tt.x-=ot;for(var Et=0,Nt=1;Nt<O-1;Nt++)B.y=Z.y,Z.x=tt.x,Z.y=tt.y,P.getCoordinate(Nt+1,tt),tt.x-=ot,Et+=Z.x*(B.y-tt.y);return Et/2}}}])})(),Vr=(function(){return l((function c(){s(this,c)}),null,[{key:"sort",value:function(){var c=arguments,r=arguments[0];if(arguments.length===1)r.sort((function(ot,Et){return ot.compareTo(Et)}));else if(arguments.length===2)r.sort((function(ot,Et){return c[1].compare(ot,Et)}));else if(arguments.length===3){var a=r.slice(arguments[1],arguments[2]);a.sort();var u=r.slice(0,arguments[1]).concat(a,r.slice(arguments[2],r.length));r.splice(0,r.length);var g,_=d(u);try{for(_.s();!(g=_.n()).done;){var E=g.value;r.push(E)}}catch(ot){_.e(ot)}finally{_.f()}}else if(arguments.length===4){var P=r.slice(arguments[1],arguments[2]);P.sort((function(ot,Et){return c[3].compare(ot,Et)}));var O=r.slice(0,arguments[1]).concat(P,r.slice(arguments[2],r.length));r.splice(0,r.length);var B,Z=d(O);try{for(Z.s();!(B=Z.n()).done;){var tt=B.value;r.push(tt)}}catch(ot){Z.e(ot)}finally{Z.f()}}}},{key:"asList",value:function(c){var r,a=new Gt,u=d(c);try{for(u.s();!(r=u.n()).done;){var g=r.value;a.add(g)}}catch(_){u.e(_)}finally{u.f()}return a}},{key:"copyOf",value:function(c,r){return c.slice(0,r)}}])})(),D_=l((function c(){s(this,c)})),Au=(function(c){function r(){var a;return s(this,r),a=n(this,r),r.constructor_.apply(a,arguments),a}return m(r,c),l(r,[{key:"computeEnvelopeInternal",value:function(){return this._shell.getEnvelopeInternal()}},{key:"getCoordinates",value:function(){if(this.isEmpty())return[];for(var a=new Array(this.getNumPoints()).fill(null),u=-1,g=this._shell.getCoordinates(),_=0;_<g.length;_++)a[++u]=g[_];for(var E=0;E<this._holes.length;E++)for(var P=this._holes[E].getCoordinates(),O=0;O<P.length;O++)a[++u]=P[O];return a}},{key:"getArea",value:function(){var a=0;a+=A_.ofRing(this._shell.getCoordinateSequence());for(var u=0;u<this._holes.length;u++)a-=A_.ofRing(this._holes[u].getCoordinateSequence());return a}},{key:"copyInternal",value:function(){for(var a=this._shell.copy(),u=new Array(this._holes.length).fill(null),g=0;g<this._holes.length;g++)u[g]=this._holes[g].copy();return new r(a,u,this._factory)}},{key:"isRectangle",value:function(){if(this.getNumInteriorRing()!==0||this._shell===null||this._shell.getNumPoints()!==5)return!1;for(var a=this._shell.getCoordinateSequence(),u=this.getEnvelopeInternal(),g=0;g<5;g++){var _=a.getX(g);if(_!==u.getMinX()&&_!==u.getMaxX())return!1;var E=a.getY(g);if(E!==u.getMinY()&&E!==u.getMaxY())return!1}for(var P=a.getX(0),O=a.getY(0),B=1;B<=4;B++){var Z=a.getX(B),tt=a.getY(B);if(Z!==P==(tt!==O))return!1;P=Z,O=tt}return!0}},{key:"equalsExact",value:function(){if(arguments.length===2&&typeof arguments[1]=="number"&&arguments[0]instanceof gt){var a=arguments[0],u=arguments[1];if(!this.isEquivalentClass(a))return!1;var g=a,_=this._shell,E=g._shell;if(!_.equalsExact(E,u)||this._holes.length!==g._holes.length)return!1;for(var P=0;P<this._holes.length;P++)if(!this._holes[P].equalsExact(g._holes[P],u))return!1;return!0}return S(r,"equalsExact",this,1).apply(this,arguments)}},{key:"normalize",value:function(){if(arguments.length===0){this._shell=this.normalized(this._shell,!0);for(var a=0;a<this._holes.length;a++)this._holes[a]=this.normalized(this._holes[a],!1);Vr.sort(this._holes)}else if(arguments.length===2){var u=arguments[0],g=arguments[1];if(u.isEmpty())return null;var _=u.getCoordinateSequence(),E=Ur.minCoordinateIndex(_,0,_.size()-2);Ur.scroll(_,E,!0),Ut.isCCW(_)===g&&Ur.reverse(_)}}},{key:"getCoordinate",value:function(){return this._shell.getCoordinate()}},{key:"getNumInteriorRing",value:function(){return this._holes.length}},{key:"getBoundaryDimension",value:function(){return 1}},{key:"reverseInternal",value:function(){for(var a=this.getExteriorRing().reverse(),u=new Array(this.getNumInteriorRing()).fill(null),g=0;g<u.length;g++)u[g]=this.getInteriorRingN(g).reverse();return this.getFactory().createPolygon(a,u)}},{key:"getTypeCode",value:function(){return gt.TYPECODE_POLYGON}},{key:"getDimension",value:function(){return 2}},{key:"getLength",value:function(){var a=0;a+=this._shell.getLength();for(var u=0;u<this._holes.length;u++)a+=this._holes[u].getLength();return a}},{key:"getNumPoints",value:function(){for(var a=this._shell.getNumPoints(),u=0;u<this._holes.length;u++)a+=this._holes[u].getNumPoints();return a}},{key:"convexHull",value:function(){return this.getExteriorRing().convexHull()}},{key:"normalized",value:function(a,u){var g=a.copy();return this.normalize(g,u),g}},{key:"compareToSameClass",value:function(){if(arguments.length===1){var a=arguments[0],u=this._shell,g=a._shell;return u.compareToSameClass(g)}if(arguments.length===2){var _=arguments[1],E=arguments[0],P=this._shell,O=E._shell,B=P.compareToSameClass(O,_);if(B!==0)return B;for(var Z=this.getNumInteriorRing(),tt=E.getNumInteriorRing(),ot=0;ot<Z&&ot<tt;){var Et=this.getInteriorRingN(ot),Nt=E.getInteriorRingN(ot),Dt=Et.compareToSameClass(Nt,_);if(Dt!==0)return Dt;ot++}return ot<Z?1:ot<tt?-1:0}}},{key:"apply",value:function(){if(Vt(arguments[0],Ou)){var a=arguments[0];this._shell.apply(a);for(var u=0;u<this._holes.length;u++)this._holes[u].apply(a)}else if(Vt(arguments[0],Ru)){var g=arguments[0];if(this._shell.apply(g),!g.isDone())for(var _=0;_<this._holes.length&&(this._holes[_].apply(g),!g.isDone());_++);g.isGeometryChanged()&&this.geometryChanged()}else if(Vt(arguments[0],Nu))arguments[0].filter(this);else if(Vt(arguments[0],L)){var E=arguments[0];E.filter(this),this._shell.apply(E);for(var P=0;P<this._holes.length;P++)this._holes[P].apply(E)}}},{key:"getBoundary",value:function(){if(this.isEmpty())return this.getFactory().createMultiLineString();var a=new Array(this._holes.length+1).fill(null);a[0]=this._shell;for(var u=0;u<this._holes.length;u++)a[u+1]=this._holes[u];return a.length<=1?this.getFactory().createLinearRing(a[0].getCoordinateSequence()):this.getFactory().createMultiLineString(a)}},{key:"getGeometryType",value:function(){return gt.TYPENAME_POLYGON}},{key:"getExteriorRing",value:function(){return this._shell}},{key:"isEmpty",value:function(){return this._shell.isEmpty()}},{key:"getInteriorRingN",value:function(a){return this._holes[a]}},{key:"interfaces_",get:function(){return[D_]}}],[{key:"constructor_",value:function(){this._shell=null,this._holes=null;var a=arguments[0],u=arguments[1],g=arguments[2];if(gt.constructor_.call(this,g),a===null&&(a=this.getFactory().createLinearRing()),u===null&&(u=[]),gt.hasNullElements(u))throw new D("holes must not contain null elements");if(a.isEmpty()&>.hasNonEmptyElements(u))throw new D("shell is empty but holes are not");this._shell=a,this._holes=u}}])})(gt),uN=(function(c){function r(){return s(this,r),n(this,r,arguments)}return m(r,c),l(r)})(se),L_=(function(c){function r(a){var u;return s(this,r),(u=n(this,r)).array=[],a instanceof at&&u.addAll(a),u}return m(r,c),l(r,[{key:"contains",value:function(a){var u,g=d(this.array);try{for(g.s();!(u=g.n()).done;)if(u.value.compareTo(a)===0)return!0}catch(_){g.e(_)}finally{g.f()}return!1}},{key:"add",value:function(a){if(this.contains(a))return!1;for(var u=0,g=this.array.length;u<g;u++)if(this.array[u].compareTo(a)===1)return!!this.array.splice(u,0,a);return this.array.push(a),!0}},{key:"addAll",value:function(a){var u,g=d(a);try{for(g.s();!(u=g.n()).done;){var _=u.value;this.add(_)}}catch(E){g.e(E)}finally{g.f()}return!0}},{key:"remove",value:function(){throw new It}},{key:"size",value:function(){return this.array.length}},{key:"isEmpty",value:function(){return this.array.length===0}},{key:"toArray",value:function(){return this.array.slice()}},{key:"iterator",value:function(){return new cN(this.array)}}])})(uN),cN=(function(){return l((function c(r){s(this,c),this.array=r,this.position=0}),[{key:"next",value:function(){if(this.position===this.array.length)throw new Pt;return this.array[this.position++]}},{key:"hasNext",value:function(){return this.position<this.array.length}},{key:"remove",value:function(){throw new It}}])})(),Oi=(function(c){function r(){var a;return s(this,r),a=n(this,r),r.constructor_.apply(a,arguments),a}return m(r,c),l(r,[{key:"computeEnvelopeInternal",value:function(){for(var a=new zt,u=0;u<this._geometries.length;u++)a.expandToInclude(this._geometries[u].getEnvelopeInternal());return a}},{key:"getGeometryN",value:function(a){return this._geometries[a]}},{key:"getCoordinates",value:function(){for(var a=new Array(this.getNumPoints()).fill(null),u=-1,g=0;g<this._geometries.length;g++)for(var _=this._geometries[g].getCoordinates(),E=0;E<_.length;E++)a[++u]=_[E];return a}},{key:"getArea",value:function(){for(var a=0,u=0;u<this._geometries.length;u++)a+=this._geometries[u].getArea();return a}},{key:"copyInternal",value:function(){for(var a=new Array(this._geometries.length).fill(null),u=0;u<a.length;u++)a[u]=this._geometries[u].copy();return new r(a,this._factory)}},{key:"equalsExact",value:function(){if(arguments.length===2&&typeof arguments[1]=="number"&&arguments[0]instanceof gt){var a=arguments[0],u=arguments[1];if(!this.isEquivalentClass(a))return!1;var g=a;if(this._geometries.length!==g._geometries.length)return!1;for(var _=0;_<this._geometries.length;_++)if(!this._geometries[_].equalsExact(g._geometries[_],u))return!1;return!0}return S(r,"equalsExact",this,1).apply(this,arguments)}},{key:"normalize",value:function(){for(var a=0;a<this._geometries.length;a++)this._geometries[a].normalize();Vr.sort(this._geometries)}},{key:"getCoordinate",value:function(){return this.isEmpty()?null:this._geometries[0].getCoordinate()}},{key:"getBoundaryDimension",value:function(){for(var a=pt.FALSE,u=0;u<this._geometries.length;u++)a=Math.max(a,this._geometries[u].getBoundaryDimension());return a}},{key:"reverseInternal",value:function(){for(var a=this._geometries.length,u=new Gt(a),g=0;g<a;g++)u.add(this._geometries[g].reverse());return this.getFactory().buildGeometry(u)}},{key:"getTypeCode",value:function(){return gt.TYPECODE_GEOMETRYCOLLECTION}},{key:"getDimension",value:function(){for(var a=pt.FALSE,u=0;u<this._geometries.length;u++)a=Math.max(a,this._geometries[u].getDimension());return a}},{key:"getLength",value:function(){for(var a=0,u=0;u<this._geometries.length;u++)a+=this._geometries[u].getLength();return a}},{key:"getNumPoints",value:function(){for(var a=0,u=0;u<this._geometries.length;u++)a+=this._geometries[u].getNumPoints();return a}},{key:"getNumGeometries",value:function(){return this._geometries.length}},{key:"compareToSameClass",value:function(){if(arguments.length===1){var a=arguments[0],u=new L_(Vr.asList(this._geometries)),g=new L_(Vr.asList(a._geometries));return this.compare(u,g)}if(arguments.length===2){for(var _=arguments[1],E=arguments[0],P=this.getNumGeometries(),O=E.getNumGeometries(),B=0;B<P&&B<O;){var Z=this.getGeometryN(B),tt=E.getGeometryN(B),ot=Z.compareToSameClass(tt,_);if(ot!==0)return ot;B++}return B<P?1:B<O?-1:0}}},{key:"apply",value:function(){if(Vt(arguments[0],Ou))for(var a=arguments[0],u=0;u<this._geometries.length;u++)this._geometries[u].apply(a);else if(Vt(arguments[0],Ru)){var g=arguments[0];if(this._geometries.length===0)return null;for(var _=0;_<this._geometries.length&&(this._geometries[_].apply(g),!g.isDone());_++);g.isGeometryChanged()&&this.geometryChanged()}else if(Vt(arguments[0],Nu)){var E=arguments[0];E.filter(this);for(var P=0;P<this._geometries.length;P++)this._geometries[P].apply(E)}else if(Vt(arguments[0],L)){var O=arguments[0];O.filter(this);for(var B=0;B<this._geometries.length;B++)this._geometries[B].apply(O)}}},{key:"getBoundary",value:function(){return gt.checkNotGeometryCollection(this),ct.shouldNeverReachHere(),null}},{key:"getGeometryType",value:function(){return gt.TYPENAME_GEOMETRYCOLLECTION}},{key:"isEmpty",value:function(){for(var a=0;a<this._geometries.length;a++)if(!this._geometries[a].isEmpty())return!1;return!0}}],[{key:"constructor_",value:function(){if(this._geometries=null,arguments.length!==0){if(arguments.length===2){var a=arguments[0],u=arguments[1];if(gt.constructor_.call(this,u),a===null&&(a=[]),gt.hasNullElements(a))throw new D("geometries must not contain null elements");this._geometries=a}}}}])})(gt),Ug=(function(c){function r(){var a;return s(this,r),a=n(this,r),r.constructor_.apply(a,arguments),a}return m(r,c),l(r,[{key:"copyInternal",value:function(){for(var a=new Array(this._geometries.length).fill(null),u=0;u<a.length;u++)a[u]=this._geometries[u].copy();return new r(a,this._factory)}},{key:"isValid",value:function(){return!0}},{key:"equalsExact",value:function(){if(arguments.length===2&&typeof arguments[1]=="number"&&arguments[0]instanceof gt){var a=arguments[0],u=arguments[1];return!!this.isEquivalentClass(a)&&S(r,"equalsExact",this,1).call(this,a,u)}return S(r,"equalsExact",this,1).apply(this,arguments)}},{key:"getCoordinate",value:function(){if(arguments.length===1&&Number.isInteger(arguments[0])){var a=arguments[0];return this._geometries[a].getCoordinate()}return S(r,"getCoordinate",this,1).apply(this,arguments)}},{key:"getBoundaryDimension",value:function(){return pt.FALSE}},{key:"getTypeCode",value:function(){return gt.TYPECODE_MULTIPOINT}},{key:"getDimension",value:function(){return 0}},{key:"getBoundary",value:function(){return this.getFactory().createGeometryCollection()}},{key:"getGeometryType",value:function(){return gt.TYPENAME_MULTIPOINT}},{key:"interfaces_",get:function(){return[R_]}}],[{key:"constructor_",value:function(){var a=arguments[0],u=arguments[1];Oi.constructor_.call(this,a,u)}}])})(Oi),Dh=(function(c){function r(){var a;return s(this,r),a=n(this,r),r.constructor_.apply(a,arguments),a}return m(r,c),l(r,[{key:"copyInternal",value:function(){return new r(this._points.copy(),this._factory)}},{key:"getBoundaryDimension",value:function(){return pt.FALSE}},{key:"isClosed",value:function(){return!!this.isEmpty()||S(r,"isClosed",this,1).call(this)}},{key:"reverseInternal",value:function(){var a=this._points.copy();return Ur.reverse(a),this.getFactory().createLinearRing(a)}},{key:"getTypeCode",value:function(){return gt.TYPECODE_LINEARRING}},{key:"validateConstruction",value:function(){if(!this.isEmpty()&&!S(r,"isClosed",this,1).call(this))throw new D("Points of LinearRing do not form a closed linestring");if(this.getCoordinateSequence().size()>=1&&this.getCoordinateSequence().size()<r.MINIMUM_VALID_SIZE)throw new D("Invalid number of points in LinearRing (found "+this.getCoordinateSequence().size()+" - must be 0 or >= 4)")}},{key:"getGeometryType",value:function(){return gt.TYPENAME_LINEARRING}}],[{key:"constructor_",value:function(){var a=arguments[0],u=arguments[1];Ah.constructor_.call(this,a,u),this.validateConstruction()}}])})(Ah);Dh.MINIMUM_VALID_SIZE=4;var qr=(function(c){function r(){var a;return s(this,r),a=n(this,r),r.constructor_.apply(a,arguments),a}return m(r,c),l(r,[{key:"setOrdinate",value:function(a,u){switch(a){case r.X:this.x=u;break;case r.Y:this.y=u;break;default:throw new D("Invalid ordinate index: "+a)}}},{key:"getZ",value:function(){return K.NULL_ORDINATE}},{key:"getOrdinate",value:function(a){switch(a){case r.X:return this.x;case r.Y:return this.y}throw new D("Invalid ordinate index: "+a)}},{key:"setZ",value:function(a){throw new D("CoordinateXY dimension 2 does not support z-ordinate")}},{key:"copy",value:function(){return new r(this)}},{key:"toString",value:function(){return"("+this.x+", "+this.y+")"}},{key:"setCoordinate",value:function(a){this.x=a.x,this.y=a.y,this.z=a.getZ()}}],[{key:"constructor_",value:function(){if(arguments.length===0)K.constructor_.call(this);else if(arguments.length===1){if(arguments[0]instanceof r){var a=arguments[0];K.constructor_.call(this,a.x,a.y)}else if(arguments[0]instanceof K){var u=arguments[0];K.constructor_.call(this,u.x,u.y)}}else if(arguments.length===2){var g=arguments[0],_=arguments[1];K.constructor_.call(this,g,_,K.NULL_ORDINATE)}}}])})(K);qr.X=0,qr.Y=1,qr.Z=-1,qr.M=-1;var $r=(function(c){function r(){var a;return s(this,r),a=n(this,r),r.constructor_.apply(a,arguments),a}return m(r,c),l(r,[{key:"getM",value:function(){return this._m}},{key:"setOrdinate",value:function(a,u){switch(a){case r.X:this.x=u;break;case r.Y:this.y=u;break;case r.M:this._m=u;break;default:throw new D("Invalid ordinate index: "+a)}}},{key:"setM",value:function(a){this._m=a}},{key:"getZ",value:function(){return K.NULL_ORDINATE}},{key:"getOrdinate",value:function(a){switch(a){case r.X:return this.x;case r.Y:return this.y;case r.M:return this._m}throw new D("Invalid ordinate index: "+a)}},{key:"setZ",value:function(a){throw new D("CoordinateXY dimension 2 does not support z-ordinate")}},{key:"copy",value:function(){return new r(this)}},{key:"toString",value:function(){return"("+this.x+", "+this.y+" m="+this.getM()+")"}},{key:"setCoordinate",value:function(a){this.x=a.x,this.y=a.y,this.z=a.getZ(),this._m=a.getM()}}],[{key:"constructor_",value:function(){if(this._m=null,arguments.length===0)K.constructor_.call(this),this._m=0;else if(arguments.length===1){if(arguments[0]instanceof r){var a=arguments[0];K.constructor_.call(this,a.x,a.y),this._m=a._m}else if(arguments[0]instanceof K){var u=arguments[0];K.constructor_.call(this,u.x,u.y),this._m=this.getM()}}else if(arguments.length===3){var g=arguments[0],_=arguments[1],E=arguments[2];K.constructor_.call(this,g,_,K.NULL_ORDINATE),this._m=E}}}])})(K);$r.X=0,$r.Y=1,$r.Z=-1,$r.M=2;var Vg=(function(c){function r(){var a;return s(this,r),a=n(this,r),r.constructor_.apply(a,arguments),a}return m(r,c),l(r,[{key:"getM",value:function(){return this._m}},{key:"setOrdinate",value:function(a,u){switch(a){case K.X:this.x=u;break;case K.Y:this.y=u;break;case K.Z:this.z=u;break;case K.M:this._m=u;break;default:throw new D("Invalid ordinate index: "+a)}}},{key:"setM",value:function(a){this._m=a}},{key:"getOrdinate",value:function(a){switch(a){case K.X:return this.x;case K.Y:return this.y;case K.Z:return this.getZ();case K.M:return this.getM()}throw new D("Invalid ordinate index: "+a)}},{key:"copy",value:function(){return new r(this)}},{key:"toString",value:function(){return"("+this.x+", "+this.y+", "+this.getZ()+" m="+this.getM()+")"}},{key:"setCoordinate",value:function(a){this.x=a.x,this.y=a.y,this.z=a.getZ(),this._m=a.getM()}}],[{key:"constructor_",value:function(){if(this._m=null,arguments.length===0)K.constructor_.call(this),this._m=0;else if(arguments.length===1){if(arguments[0]instanceof r){var a=arguments[0];K.constructor_.call(this,a),this._m=a._m}else if(arguments[0]instanceof K){var u=arguments[0];K.constructor_.call(this,u),this._m=this.getM()}}else if(arguments.length===4){var g=arguments[0],_=arguments[1],E=arguments[2],P=arguments[3];K.constructor_.call(this,g,_,E),this._m=P}}}])})(K),Du=(function(){function c(){s(this,c)}return l(c,null,[{key:"measures",value:function(r){return r instanceof qr?0:r instanceof $r||r instanceof Vg?1:0}},{key:"dimension",value:function(r){return r instanceof qr?2:r instanceof $r?3:r instanceof Vg?4:3}},{key:"create",value:function(){if(arguments.length===1){var r=arguments[0];return c.create(r,0)}if(arguments.length===2){var a=arguments[0],u=arguments[1];return a===2?new qr:a===3&&u===0?new K:a===3&&u===1?new $r:a===4&&u===1?new Vg:new K}}}])})(),Lh=(function(c){function r(){var a;return s(this,r),a=n(this,r),r.constructor_.apply(a,arguments),a}return m(r,c),l(r,[{key:"getCoordinate",value:function(a){return this.get(a)}},{key:"addAll",value:function(){if(arguments.length===2&&typeof arguments[1]=="boolean"&&Vt(arguments[0],at)){for(var a=arguments[1],u=!1,g=arguments[0].iterator();g.hasNext();)this.add(g.next(),a),u=!0;return u}return S(r,"addAll",this,1).apply(this,arguments)}},{key:"clone",value:function(){for(var a=S(r,"clone",this,1).call(this),u=0;u<this.size();u++)a.add(u,this.get(u).clone());return a}},{key:"toCoordinateArray",value:function(){if(arguments.length===0)return this.toArray(r.coordArrayType);if(arguments.length===1){if(arguments[0])return this.toArray(r.coordArrayType);for(var a=this.size(),u=new Array(a).fill(null),g=0;g<a;g++)u[g]=this.get(a-g-1);return u}}},{key:"add",value:function(){if(arguments.length===1){var a=arguments[0];return S(r,"add",this,1).call(this,a)}if(arguments.length===2){if(arguments[0]instanceof Array&&typeof arguments[1]=="boolean"){var u=arguments[0],g=arguments[1];return this.add(u,g,!0),!0}if(arguments[0]instanceof K&&typeof arguments[1]=="boolean"){var _=arguments[0];if(!arguments[1]&&this.size()>=1&&this.get(this.size()-1).equals2D(_))return null;S(r,"add",this,1).call(this,_)}else if(arguments[0]instanceof Object&&typeof arguments[1]=="boolean"){var E=arguments[0],P=arguments[1];return this.add(E,P),!0}}else if(arguments.length===3){if(typeof arguments[2]=="boolean"&&arguments[0]instanceof Array&&typeof arguments[1]=="boolean"){var O=arguments[0],B=arguments[1];if(arguments[2])for(var Z=0;Z<O.length;Z++)this.add(O[Z],B);else for(var tt=O.length-1;tt>=0;tt--)this.add(O[tt],B);return!0}if(typeof arguments[2]=="boolean"&&Number.isInteger(arguments[0])&&arguments[1]instanceof K){var ot=arguments[0],Et=arguments[1];if(!arguments[2]){var Nt=this.size();if(Nt>0&&(ot>0&&this.get(ot-1).equals2D(Et)||ot<Nt&&this.get(ot).equals2D(Et)))return null}S(r,"add",this,1).call(this,ot,Et)}}else if(arguments.length===4){var Dt=arguments[0],Zt=arguments[1],Yt=arguments[2],oe=arguments[3],qe=1;Yt>oe&&(qe=-1);for(var ti=Yt;ti!==oe;ti+=qe)this.add(Dt[ti],Zt);return!0}}},{key:"closeRing",value:function(){if(this.size()>0){var a=this.get(0).copy();this.add(a,!1)}}}],[{key:"constructor_",value:function(){if(arguments.length!==0){if(arguments.length===1){var a=arguments[0];this.ensureCapacity(a.length),this.add(a,!0)}else if(arguments.length===2){var u=arguments[0],g=arguments[1];this.ensureCapacity(u.length),this.add(u,g)}}}}])})(Gt);Lh.coordArrayType=new Array(0).fill(null);var De=(function(){function c(){s(this,c)}return l(c,null,[{key:"isRing",value:function(r){return!(r.length<4)&&!!r[0].equals2D(r[r.length-1])}},{key:"ptNotInList",value:function(r,a){for(var u=0;u<r.length;u++){var g=r[u];if(c.indexOf(g,a)<0)return g}return null}},{key:"scroll",value:function(r,a){var u=c.indexOf(a,r);if(u<0)return null;var g=new Array(r.length).fill(null);Yi.arraycopy(r,u,g,0,r.length-u),Yi.arraycopy(r,0,g,r.length-u,u),Yi.arraycopy(g,0,r,0,r.length)}},{key:"equals",value:function(){if(arguments.length===2){var r=arguments[0],a=arguments[1];if(r===a)return!0;if(r===null||a===null||r.length!==a.length)return!1;for(var u=0;u<r.length;u++)if(!r[u].equals(a[u]))return!1;return!0}if(arguments.length===3){var g=arguments[0],_=arguments[1],E=arguments[2];if(g===_)return!0;if(g===null||_===null||g.length!==_.length)return!1;for(var P=0;P<g.length;P++)if(E.compare(g[P],_[P])!==0)return!1;return!0}}},{key:"intersection",value:function(r,a){for(var u=new Lh,g=0;g<r.length;g++)a.intersects(r[g])&&u.add(r[g],!0);return u.toCoordinateArray()}},{key:"measures",value:function(r){if(r===null||r.length===0)return 0;var a,u=0,g=d(r);try{for(g.s();!(a=g.n()).done;){var _=a.value;u=Math.max(u,Du.measures(_))}}catch(E){g.e(E)}finally{g.f()}return u}},{key:"hasRepeatedPoints",value:function(r){for(var a=1;a<r.length;a++)if(r[a-1].equals(r[a]))return!0;return!1}},{key:"removeRepeatedPoints",value:function(r){return c.hasRepeatedPoints(r)?new Lh(r,!1).toCoordinateArray():r}},{key:"reverse",value:function(r){for(var a=r.length-1,u=Math.trunc(a/2),g=0;g<=u;g++){var _=r[g];r[g]=r[a-g],r[a-g]=_}}},{key:"removeNull",value:function(r){for(var a=0,u=0;u<r.length;u++)r[u]!==null&&a++;var g=new Array(a).fill(null);if(a===0)return g;for(var _=0,E=0;E<r.length;E++)r[E]!==null&&(g[_++]=r[E]);return g}},{key:"copyDeep",value:function(){if(arguments.length===1){for(var r=arguments[0],a=new Array(r.length).fill(null),u=0;u<r.length;u++)a[u]=r[u].copy();return a}if(arguments.length===5)for(var g=arguments[0],_=arguments[1],E=arguments[2],P=arguments[3],O=arguments[4],B=0;B<O;B++)E[P+B]=g[_+B].copy()}},{key:"isEqualReversed",value:function(r,a){for(var u=0;u<r.length;u++){var g=r[u],_=a[r.length-u-1];if(g.compareTo(_)!==0)return!1}return!0}},{key:"envelope",value:function(r){for(var a=new zt,u=0;u<r.length;u++)a.expandToInclude(r[u]);return a}},{key:"toCoordinateArray",value:function(r){return r.toArray(c.coordArrayType)}},{key:"dimension",value:function(r){if(r===null||r.length===0)return 3;var a,u=0,g=d(r);try{for(g.s();!(a=g.n()).done;){var _=a.value;u=Math.max(u,Du.dimension(_))}}catch(E){g.e(E)}finally{g.f()}return u}},{key:"atLeastNCoordinatesOrNothing",value:function(r,a){return a.length>=r?a:[]}},{key:"indexOf",value:function(r,a){for(var u=0;u<a.length;u++)if(r.equals(a[u]))return u;return-1}},{key:"increasingDirection",value:function(r){for(var a=0;a<Math.trunc(r.length/2);a++){var u=r.length-1-a,g=r[a].compareTo(r[u]);if(g!==0)return g}return 1}},{key:"compare",value:function(r,a){for(var u=0;u<r.length&&u<a.length;){var g=r[u].compareTo(a[u]);if(g!==0)return g;u++}return u<a.length?-1:u<r.length?1:0}},{key:"minCoordinate",value:function(r){for(var a=null,u=0;u<r.length;u++)(a===null||a.compareTo(r[u])>0)&&(a=r[u]);return a}},{key:"extract",value:function(r,a,u){a=Rh.clamp(a,0,r.length);var g=(u=Rh.clamp(u,-1,r.length))-a+1;u<0&&(g=0),a>=r.length&&(g=0),u<a&&(g=0);var _=new Array(g).fill(null);if(g===0)return _;for(var E=0,P=a;P<=u;P++)_[E++]=r[P];return _}}])})(),dN=(function(){return l((function c(){s(this,c)}),[{key:"compare",value:function(c,r){var a=c,u=r;return De.compare(a,u)}},{key:"interfaces_",get:function(){return[rt]}}])})(),fN=(function(){return l((function c(){s(this,c)}),[{key:"compare",value:function(c,r){var a=c,u=r;if(a.length<u.length)return-1;if(a.length>u.length)return 1;if(a.length===0)return 0;var g=De.compare(a,u);return De.isEqualReversed(a,u)?0:g}},{key:"OLDcompare",value:function(c,r){var a=c,u=r;if(a.length<u.length)return-1;if(a.length>u.length)return 1;if(a.length===0)return 0;for(var g=De.increasingDirection(a),_=De.increasingDirection(u),E=g>0?0:a.length-1,P=_>0?0:a.length-1,O=0;O<a.length;O++){var B=a[E].compareTo(u[P]);if(B!==0)return B;E+=g,P+=_}return 0}},{key:"interfaces_",get:function(){return[rt]}}])})();De.ForwardComparator=dN,De.BidirectionalComparator=fN,De.coordArrayType=new Array(0).fill(null);var Lu=(function(){return l((function c(r){s(this,c),this.str=r}),[{key:"append",value:function(c){this.str+=c}},{key:"setCharAt",value:function(c,r){this.str=this.str.substr(0,c)+r+this.str.substr(c+1)}},{key:"toString",value:function(){return this.str}}])})(),Fh=(function(){function c(){s(this,c),c.constructor_.apply(this,arguments)}return l(c,[{key:"getM",value:function(r){return this.hasM()?this._coordinates[r].getM():J.NaN}},{key:"setOrdinate",value:function(r,a,u){switch(a){case Kt.X:this._coordinates[r].x=u;break;case Kt.Y:this._coordinates[r].y=u;break;default:this._coordinates[r].setOrdinate(a,u)}}},{key:"getZ",value:function(r){return this.hasZ()?this._coordinates[r].getZ():J.NaN}},{key:"size",value:function(){return this._coordinates.length}},{key:"getOrdinate",value:function(r,a){switch(a){case Kt.X:return this._coordinates[r].x;case Kt.Y:return this._coordinates[r].y;default:return this._coordinates[r].getOrdinate(a)}}},{key:"getCoordinate",value:function(){if(arguments.length===1){var r=arguments[0];return this._coordinates[r]}if(arguments.length===2){var a=arguments[0];arguments[1].setCoordinate(this._coordinates[a])}}},{key:"getCoordinateCopy",value:function(r){var a=this.createCoordinate();return a.setCoordinate(this._coordinates[r]),a}},{key:"createCoordinate",value:function(){return Du.create(this.getDimension(),this.getMeasures())}},{key:"getDimension",value:function(){return this._dimension}},{key:"getX",value:function(r){return this._coordinates[r].x}},{key:"getMeasures",value:function(){return this._measures}},{key:"expandEnvelope",value:function(r){for(var a=0;a<this._coordinates.length;a++)r.expandToInclude(this._coordinates[a]);return r}},{key:"copy",value:function(){for(var r=new Array(this.size()).fill(null),a=0;a<this._coordinates.length;a++){var u=this.createCoordinate();u.setCoordinate(this._coordinates[a]),r[a]=u}return new c(r,this._dimension,this._measures)}},{key:"toString",value:function(){if(this._coordinates.length>0){var r=new Lu(17*this._coordinates.length);r.append("("),r.append(this._coordinates[0]);for(var a=1;a<this._coordinates.length;a++)r.append(", "),r.append(this._coordinates[a]);return r.append(")"),r.toString()}return"()"}},{key:"getY",value:function(r){return this._coordinates[r].y}},{key:"toCoordinateArray",value:function(){return this._coordinates}},{key:"interfaces_",get:function(){return[Kt,I]}}],[{key:"constructor_",value:function(){if(this._dimension=3,this._measures=0,this._coordinates=null,arguments.length===1){if(arguments[0]instanceof Array){var r=arguments[0];c.constructor_.call(this,r,De.dimension(r),De.measures(r))}else if(Number.isInteger(arguments[0])){var a=arguments[0];this._coordinates=new Array(a).fill(null);for(var u=0;u<a;u++)this._coordinates[u]=new K}else if(Vt(arguments[0],Kt)){var g=arguments[0];if(g===null)return this._coordinates=new Array(0).fill(null),null;this._dimension=g.getDimension(),this._measures=g.getMeasures(),this._coordinates=new Array(g.size()).fill(null);for(var _=0;_<this._coordinates.length;_++)this._coordinates[_]=g.getCoordinateCopy(_)}}else if(arguments.length===2){if(arguments[0]instanceof Array&&Number.isInteger(arguments[1])){var E=arguments[0],P=arguments[1];c.constructor_.call(this,E,P,De.measures(E))}else if(Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var O=arguments[0],B=arguments[1];this._coordinates=new Array(O).fill(null),this._dimension=B;for(var Z=0;Z<O;Z++)this._coordinates[Z]=Du.create(B)}}else if(arguments.length===3){if(Number.isInteger(arguments[2])&&arguments[0]instanceof Array&&Number.isInteger(arguments[1])){var tt=arguments[0],ot=arguments[1],Et=arguments[2];this._dimension=ot,this._measures=Et,this._coordinates=tt===null?new Array(0).fill(null):tt}else if(Number.isInteger(arguments[2])&&Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var Nt=arguments[0],Dt=arguments[1],Zt=arguments[2];this._coordinates=new Array(Nt).fill(null),this._dimension=Dt,this._measures=Zt;for(var Yt=0;Yt<Nt;Yt++)this._coordinates[Yt]=this.createCoordinate()}}}}])})(),qg=(function(){function c(){s(this,c)}return l(c,[{key:"readResolve",value:function(){return c.instance()}},{key:"create",value:function(){if(arguments.length===1){if(arguments[0]instanceof Array)return new Fh(arguments[0]);if(Vt(arguments[0],Kt))return new Fh(arguments[0])}else{if(arguments.length===2){var r=arguments[1];return r>3&&(r=3),r<2&&(r=2),new Fh(arguments[0],r)}if(arguments.length===3){var a=arguments[2],u=arguments[1]-a;return a>1&&(a=1),u>3&&(u=3),u<2&&(u=2),new Fh(arguments[0],u+a,a)}}}},{key:"interfaces_",get:function(){return[O_,I]}}],[{key:"instance",value:function(){return c.instanceObject}}])})();qg.instanceObject=new qg;var $g=(function(c){function r(){var a;return s(this,r),a=n(this,r),r.constructor_.apply(a,arguments),a}return m(r,c),l(r,[{key:"copyInternal",value:function(){for(var a=new Array(this._geometries.length).fill(null),u=0;u<a.length;u++)a[u]=this._geometries[u].copy();return new r(a,this._factory)}},{key:"equalsExact",value:function(){if(arguments.length===2&&typeof arguments[1]=="number"&&arguments[0]instanceof gt){var a=arguments[0],u=arguments[1];return!!this.isEquivalentClass(a)&&S(r,"equalsExact",this,1).call(this,a,u)}return S(r,"equalsExact",this,1).apply(this,arguments)}},{key:"getBoundaryDimension",value:function(){return 1}},{key:"getTypeCode",value:function(){return gt.TYPECODE_MULTIPOLYGON}},{key:"getDimension",value:function(){return 2}},{key:"getBoundary",value:function(){if(this.isEmpty())return this.getFactory().createMultiLineString();for(var a=new Gt,u=0;u<this._geometries.length;u++)for(var g=this._geometries[u].getBoundary(),_=0;_<g.getNumGeometries();_++)a.add(g.getGeometryN(_));var E=new Array(a.size()).fill(null);return this.getFactory().createMultiLineString(a.toArray(E))}},{key:"getGeometryType",value:function(){return gt.TYPENAME_MULTIPOLYGON}},{key:"interfaces_",get:function(){return[D_]}}],[{key:"constructor_",value:function(){var a=arguments[0],u=arguments[1];Oi.constructor_.call(this,a,u)}}])})(Oi),F_=(function(){return l((function c(){s(this,c)}),[{key:"get",value:function(){}},{key:"put",value:function(){}},{key:"size",value:function(){}},{key:"values",value:function(){}},{key:"entrySet",value:function(){}}])})(),gN=(function(c){function r(){var a;return s(this,r),(a=n(this,r)).map=new Map,a}return m(r,c),l(r,[{key:"get",value:function(a){return this.map.get(a)||null}},{key:"put",value:function(a,u){return this.map.set(a,u),u}},{key:"values",value:function(){for(var a=new Gt,u=this.map.values(),g=u.next();!g.done;)a.add(g.value),g=u.next();return a}},{key:"entrySet",value:function(){var a=new le;return this.map.entries().forEach((function(u){return a.add(u)})),a}},{key:"size",value:function(){return this.map.size()}}])})(F_),mn=(function(){function c(){s(this,c),c.constructor_.apply(this,arguments)}return l(c,[{key:"equals",value:function(r){if(!(r instanceof c))return!1;var a=r;return this._modelType===a._modelType&&this._scale===a._scale}},{key:"compareTo",value:function(r){var a=r,u=this.getMaximumSignificantDigits(),g=a.getMaximumSignificantDigits();return Hs.compare(u,g)}},{key:"getScale",value:function(){return this._scale}},{key:"isFloating",value:function(){return this._modelType===c.FLOATING||this._modelType===c.FLOATING_SINGLE}},{key:"getType",value:function(){return this._modelType}},{key:"toString",value:function(){var r="UNKNOWN";return this._modelType===c.FLOATING?r="Floating":this._modelType===c.FLOATING_SINGLE?r="Floating-Single":this._modelType===c.FIXED&&(r="Fixed (Scale="+this.getScale()+")"),r}},{key:"makePrecise",value:function(){if(typeof arguments[0]=="number"){var r=arguments[0];return J.isNaN(r)||this._modelType===c.FLOATING_SINGLE?r:this._modelType===c.FIXED?Math.round(r*this._scale)/this._scale:r}if(arguments[0]instanceof K){var a=arguments[0];if(this._modelType===c.FLOATING)return null;a.x=this.makePrecise(a.x),a.y=this.makePrecise(a.y)}}},{key:"getMaximumSignificantDigits",value:function(){var r=16;return this._modelType===c.FLOATING?r=16:this._modelType===c.FLOATING_SINGLE?r=6:this._modelType===c.FIXED&&(r=1+Math.trunc(Math.ceil(Math.log(this.getScale())/Math.log(10)))),r}},{key:"setScale",value:function(r){this._scale=Math.abs(r)}},{key:"interfaces_",get:function(){return[I,V]}}],[{key:"constructor_",value:function(){if(this._modelType=null,this._scale=null,arguments.length===0)this._modelType=c.FLOATING;else if(arguments.length===1){if(arguments[0]instanceof fo){var r=arguments[0];this._modelType=r,r===c.FIXED&&this.setScale(1)}else if(typeof arguments[0]=="number"){var a=arguments[0];this._modelType=c.FIXED,this.setScale(a)}else if(arguments[0]instanceof c){var u=arguments[0];this._modelType=u._modelType,this._scale=u._scale}}}},{key:"mostPrecise",value:function(r,a){return r.compareTo(a)>=0?r:a}}])})(),fo=(function(){function c(){s(this,c),c.constructor_.apply(this,arguments)}return l(c,[{key:"readResolve",value:function(){return c.nameToTypeMap.get(this._name)}},{key:"toString",value:function(){return this._name}},{key:"interfaces_",get:function(){return[I]}}],[{key:"constructor_",value:function(){this._name=null;var r=arguments[0];this._name=r,c.nameToTypeMap.put(r,this)}}])})();fo.nameToTypeMap=new gN,mn.Type=fo,mn.FIXED=new fo("FIXED"),mn.FLOATING=new fo("FLOATING"),mn.FLOATING_SINGLE=new fo("FLOATING SINGLE"),mn.maximumPreciseValue=9007199254740992;var Wg=(function(c){function r(){var a;return s(this,r),a=n(this,r),r.constructor_.apply(a,arguments),a}return m(r,c),l(r,[{key:"copyInternal",value:function(){for(var a=new Array(this._geometries.length).fill(null),u=0;u<a.length;u++)a[u]=this._geometries[u].copy();return new r(a,this._factory)}},{key:"equalsExact",value:function(){if(arguments.length===2&&typeof arguments[1]=="number"&&arguments[0]instanceof gt){var a=arguments[0],u=arguments[1];return!!this.isEquivalentClass(a)&&S(r,"equalsExact",this,1).call(this,a,u)}return S(r,"equalsExact",this,1).apply(this,arguments)}},{key:"getBoundaryDimension",value:function(){return this.isClosed()?pt.FALSE:0}},{key:"isClosed",value:function(){if(this.isEmpty())return!1;for(var a=0;a<this._geometries.length;a++)if(!this._geometries[a].isClosed())return!1;return!0}},{key:"getTypeCode",value:function(){return gt.TYPECODE_MULTILINESTRING}},{key:"getDimension",value:function(){return 1}},{key:"getBoundary",value:function(){throw new It}},{key:"getGeometryType",value:function(){return gt.TYPENAME_MULTILINESTRING}},{key:"interfaces_",get:function(){return[N_]}}],[{key:"constructor_",value:function(){var a=arguments[0],u=arguments[1];Oi.constructor_.call(this,a,u)}}])})(Oi),go=(function(){function c(){s(this,c),c.constructor_.apply(this,arguments)}return l(c,[{key:"createEmpty",value:function(r){switch(r){case-1:return this.createGeometryCollection();case 0:return this.createPoint();case 1:return this.createLineString();case 2:return this.createPolygon();default:throw new D("Invalid dimension: "+r)}}},{key:"toGeometry",value:function(r){return r.isNull()?this.createPoint():r.getMinX()===r.getMaxX()&&r.getMinY()===r.getMaxY()?this.createPoint(new K(r.getMinX(),r.getMinY())):r.getMinX()===r.getMaxX()||r.getMinY()===r.getMaxY()?this.createLineString([new K(r.getMinX(),r.getMinY()),new K(r.getMaxX(),r.getMaxY())]):this.createPolygon(this.createLinearRing([new K(r.getMinX(),r.getMinY()),new K(r.getMinX(),r.getMaxY()),new K(r.getMaxX(),r.getMaxY()),new K(r.getMaxX(),r.getMinY()),new K(r.getMinX(),r.getMinY())]),null)}},{key:"createLineString",value:function(){if(arguments.length===0)return this.createLineString(this.getCoordinateSequenceFactory().create([]));if(arguments.length===1){if(arguments[0]instanceof Array){var r=arguments[0];return this.createLineString(r!==null?this.getCoordinateSequenceFactory().create(r):null)}if(Vt(arguments[0],Kt))return new Ah(arguments[0],this)}}},{key:"createMultiLineString",value:function(){return arguments.length===0?new Wg(null,this):arguments.length===1?new Wg(arguments[0],this):void 0}},{key:"buildGeometry",value:function(r){for(var a=null,u=!1,g=!1,_=r.iterator();_.hasNext();){var E=_.next(),P=E.getTypeCode();a===null&&(a=P),P!==a&&(u=!0),E instanceof Oi&&(g=!0)}if(a===null)return this.createGeometryCollection();if(u||g)return this.createGeometryCollection(c.toGeometryArray(r));var O=r.iterator().next();if(r.size()>1){if(O instanceof Au)return this.createMultiPolygon(c.toPolygonArray(r));if(O instanceof Ah)return this.createMultiLineString(c.toLineStringArray(r));if(O instanceof zg)return this.createMultiPoint(c.toPointArray(r));ct.shouldNeverReachHere("Unhandled geometry type: "+O.getGeometryType())}return O}},{key:"createMultiPointFromCoords",value:function(r){return this.createMultiPoint(r!==null?this.getCoordinateSequenceFactory().create(r):null)}},{key:"createPoint",value:function(){if(arguments.length===0)return this.createPoint(this.getCoordinateSequenceFactory().create([]));if(arguments.length===1){if(arguments[0]instanceof K){var r=arguments[0];return this.createPoint(r!==null?this.getCoordinateSequenceFactory().create([r]):null)}if(Vt(arguments[0],Kt))return new zg(arguments[0],this)}}},{key:"getCoordinateSequenceFactory",value:function(){return this._coordinateSequenceFactory}},{key:"createPolygon",value:function(){if(arguments.length===0)return this.createPolygon(null,null);if(arguments.length===1){if(Vt(arguments[0],Kt)){var r=arguments[0];return this.createPolygon(this.createLinearRing(r))}if(arguments[0]instanceof Array){var a=arguments[0];return this.createPolygon(this.createLinearRing(a))}if(arguments[0]instanceof Dh){var u=arguments[0];return this.createPolygon(u,null)}}else if(arguments.length===2)return new Au(arguments[0],arguments[1],this)}},{key:"getSRID",value:function(){return this._SRID}},{key:"createGeometryCollection",value:function(){return arguments.length===0?new Oi(null,this):arguments.length===1?new Oi(arguments[0],this):void 0}},{key:"getPrecisionModel",value:function(){return this._precisionModel}},{key:"createLinearRing",value:function(){if(arguments.length===0)return this.createLinearRing(this.getCoordinateSequenceFactory().create([]));if(arguments.length===1){if(arguments[0]instanceof Array){var r=arguments[0];return this.createLinearRing(r!==null?this.getCoordinateSequenceFactory().create(r):null)}if(Vt(arguments[0],Kt))return new Dh(arguments[0],this)}}},{key:"createMultiPolygon",value:function(){return arguments.length===0?new $g(null,this):arguments.length===1?new $g(arguments[0],this):void 0}},{key:"createMultiPoint",value:function(){if(arguments.length===0)return new Ug(null,this);if(arguments.length===1){if(arguments[0]instanceof Array)return new Ug(arguments[0],this);if(Vt(arguments[0],Kt)){var r=arguments[0];if(r===null)return this.createMultiPoint(new Array(0).fill(null));for(var a=new Array(r.size()).fill(null),u=0;u<r.size();u++){var g=this.getCoordinateSequenceFactory().create(1,r.getDimension(),r.getMeasures());Ur.copy(r,u,g,0,1),a[u]=this.createPoint(g)}return this.createMultiPoint(a)}}}},{key:"interfaces_",get:function(){return[I]}}],[{key:"constructor_",value:function(){if(this._precisionModel=null,this._coordinateSequenceFactory=null,this._SRID=null,arguments.length===0)c.constructor_.call(this,new mn,0);else if(arguments.length===1){if(Vt(arguments[0],O_)){var r=arguments[0];c.constructor_.call(this,new mn,0,r)}else if(arguments[0]instanceof mn){var a=arguments[0];c.constructor_.call(this,a,0,c.getDefaultCoordinateSequenceFactory())}}else if(arguments.length===2){var u=arguments[0],g=arguments[1];c.constructor_.call(this,u,g,c.getDefaultCoordinateSequenceFactory())}else if(arguments.length===3){var _=arguments[0],E=arguments[1],P=arguments[2];this._precisionModel=_,this._coordinateSequenceFactory=P,this._SRID=E}}},{key:"toMultiPolygonArray",value:function(r){var a=new Array(r.size()).fill(null);return r.toArray(a)}},{key:"toGeometryArray",value:function(r){if(r===null)return null;var a=new Array(r.size()).fill(null);return r.toArray(a)}},{key:"getDefaultCoordinateSequenceFactory",value:function(){return qg.instance()}},{key:"toMultiLineStringArray",value:function(r){var a=new Array(r.size()).fill(null);return r.toArray(a)}},{key:"toLineStringArray",value:function(r){var a=new Array(r.size()).fill(null);return r.toArray(a)}},{key:"toMultiPointArray",value:function(r){var a=new Array(r.size()).fill(null);return r.toArray(a)}},{key:"toLinearRingArray",value:function(r){var a=new Array(r.size()).fill(null);return r.toArray(a)}},{key:"toPointArray",value:function(r){var a=new Array(r.size()).fill(null);return r.toArray(a)}},{key:"toPolygonArray",value:function(r){var a=new Array(r.size()).fill(null);return r.toArray(a)}},{key:"createPointFromInternalCoord",value:function(r,a){return a.getPrecisionModel().makePrecise(r),a.getFactory().createPoint(r)}}])})(),Hg="XY",pN="XYZ",mN="XYM",vN="XYZM",G_={POINT:"Point",LINE_STRING:"LineString",LINEAR_RING:"LinearRing",POLYGON:"Polygon",MULTI_POINT:"MultiPoint",MULTI_LINE_STRING:"MultiLineString",MULTI_POLYGON:"MultiPolygon",GEOMETRY_COLLECTION:"GeometryCollection",CIRCLE:"Circle"},j_="EMPTY",Fu=1,gs=2,Xs=3,B_=4,po=5,yN=6;for(var _N in G_)G_[_N].toUpperCase();var wN=(function(){return l((function c(r){s(this,c),this.wkt=r,this.index_=-1}),[{key:"isAlpha_",value:function(c){return c>="a"&&c<="z"||c>="A"&&c<="Z"}},{key:"isNumeric_",value:function(c,r){return c>="0"&&c<="9"||c=="."&&!(r!==void 0&&r)}},{key:"isWhiteSpace_",value:function(c){return c==" "||c==" "||c=="\r"||c==`
|
|
46
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function N(c){var r=(function(a,u){if(typeof a!="object"||!a)return a;var g=a[Symbol.toPrimitive];if(g!==void 0){var _=g.call(a,u);if(typeof _!="object")return _;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(a)})(c,"string");return typeof r=="symbol"?r:r+""}function j(c,r){if(c){if(typeof c=="string")return t(c,r);var a={}.toString.call(c).slice(8,-1);return a==="Object"&&c.constructor&&(a=c.constructor.name),a==="Map"||a==="Set"?Array.from(c):a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?t(c,r):void 0}}function C(c){var r=typeof Map=="function"?new Map:void 0;return C=function(a){if(a===null||!(function(g){try{return Function.toString.call(g).indexOf("[native code]")!==-1}catch{return typeof g=="function"}})(a))return a;if(typeof a!="function")throw new TypeError("Super expression must either be null or a function");if(r!==void 0){if(r.has(a))return r.get(a);r.set(a,u)}function u(){return o(a,arguments,v(this).constructor)}return u.prototype=Object.create(a.prototype,{constructor:{value:u,enumerable:!1,writable:!0,configurable:!0}}),w(u,a)},C(c)}var k=(function(){function c(){s(this,c),c.constructor_.apply(this,arguments)}return l(c,[{key:"getEndCapStyle",value:function(){return this._endCapStyle}},{key:"isSingleSided",value:function(){return this._isSingleSided}},{key:"setQuadrantSegments",value:function(r){this._quadrantSegments=r,this._quadrantSegments===0&&(this._joinStyle=c.JOIN_BEVEL),this._quadrantSegments<0&&(this._joinStyle=c.JOIN_MITRE,this._mitreLimit=Math.abs(this._quadrantSegments)),r<=0&&(this._quadrantSegments=1),this._joinStyle!==c.JOIN_ROUND&&(this._quadrantSegments=c.DEFAULT_QUADRANT_SEGMENTS)}},{key:"getJoinStyle",value:function(){return this._joinStyle}},{key:"setJoinStyle",value:function(r){this._joinStyle=r}},{key:"setSimplifyFactor",value:function(r){this._simplifyFactor=r<0?0:r}},{key:"getSimplifyFactor",value:function(){return this._simplifyFactor}},{key:"getQuadrantSegments",value:function(){return this._quadrantSegments}},{key:"setEndCapStyle",value:function(r){this._endCapStyle=r}},{key:"getMitreLimit",value:function(){return this._mitreLimit}},{key:"setMitreLimit",value:function(r){this._mitreLimit=r}},{key:"setSingleSided",value:function(r){this._isSingleSided=r}}],[{key:"constructor_",value:function(){if(this._quadrantSegments=c.DEFAULT_QUADRANT_SEGMENTS,this._endCapStyle=c.CAP_ROUND,this._joinStyle=c.JOIN_ROUND,this._mitreLimit=c.DEFAULT_MITRE_LIMIT,this._isSingleSided=!1,this._simplifyFactor=c.DEFAULT_SIMPLIFY_FACTOR,arguments.length!==0){if(arguments.length===1){var r=arguments[0];this.setQuadrantSegments(r)}else if(arguments.length===2){var a=arguments[0],u=arguments[1];this.setQuadrantSegments(a),this.setEndCapStyle(u)}else if(arguments.length===4){var g=arguments[0],_=arguments[1],E=arguments[2],P=arguments[3];this.setQuadrantSegments(g),this.setEndCapStyle(_),this.setJoinStyle(E),this.setMitreLimit(P)}}}},{key:"bufferDistanceError",value:function(r){var a=Math.PI/2/r;return 1-Math.cos(a/2)}}])})();k.CAP_ROUND=1,k.CAP_FLAT=2,k.CAP_SQUARE=3,k.JOIN_ROUND=1,k.JOIN_MITRE=2,k.JOIN_BEVEL=3,k.DEFAULT_QUADRANT_SEGMENTS=8,k.DEFAULT_MITRE_LIMIT=5,k.DEFAULT_SIMPLIFY_FACTOR=.01;var M=(function(c){function r(a){var u;return s(this,r),(u=n(this,r,[a])).name=Object.keys({Exception:r})[0],u}return m(r,c),l(r,[{key:"toString",value:function(){return this.message}}])})(C(Error)),D=(function(c){function r(a){var u;return s(this,r),(u=n(this,r,[a])).name=Object.keys({IllegalArgumentException:r})[0],u}return m(r,c),l(r)})(M),L=(function(){return l((function c(){s(this,c)}),[{key:"filter",value:function(c){}}])})();function V(){}function x(){}function I(){}var R,G,F,U,z,$,W,X,Y=(function(){return l((function c(){s(this,c)}),null,[{key:"equalsWithTolerance",value:function(c,r,a){return Math.abs(c-r)<=a}}])})(),et=(function(){return l((function c(r,a){s(this,c),this.low=a||0,this.high=r||0}),null,[{key:"toBinaryString",value:function(c){var r,a="";for(r=2147483648;r>0;r>>>=1)a+=(c.high&r)===r?"1":"0";for(r=2147483648;r>0;r>>>=1)a+=(c.low&r)===r?"1":"0";return a}}])})();function J(){}function rt(){}J.NaN=NaN,J.isNaN=function(c){return Number.isNaN(c)},J.isInfinite=function(c){return!Number.isFinite(c)},J.MAX_VALUE=Number.MAX_VALUE,J.POSITIVE_INFINITY=Number.POSITIVE_INFINITY,J.NEGATIVE_INFINITY=Number.NEGATIVE_INFINITY,typeof Float64Array=="function"&&typeof Int32Array=="function"?($=2146435072,W=new Float64Array(1),X=new Int32Array(W.buffer),J.doubleToLongBits=function(c){W[0]=c;var r=0|X[0],a=0|X[1];return(a&$)===$&&1048575&a&&r!==0&&(r=0,a=2146959360),new et(a,r)},J.longBitsToDouble=function(c){return X[0]=c.low,X[1]=c.high,W[0]}):(R=1023,G=Math.log2,F=Math.floor,U=Math.pow,z=(function(){for(var c=53;c>0;c--){var r=U(2,c)-1;if(F(G(r))+1===c)return r}return 0})(),J.doubleToLongBits=function(c){var r,a,u,g,_,E,P,O,B;if(c<0||1/c===Number.NEGATIVE_INFINITY?(E=-2147483648,c=-c):E=0,c===0)return new et(O=E,B=0);if(c===1/0)return new et(O=2146435072|E,B=0);if(c!=c)return new et(O=2146959360,B=0);if(g=0,B=0,(r=F(c))>1)if(r<=z)(g=F(G(r)))<=20?(B=0,O=r<<20-g&1048575):(B=r%(a=U(2,u=g-20))<<32-u,O=r/a&1048575);else for(u=r,B=0;(u=F(a=u/2))!==0;)g++,B>>>=1,B|=(1&O)<<31,O>>>=1,a!==u&&(O|=524288);if(P=g+R,_=r===0,r=c-r,g<52&&r!==0)for(u=0;;){if((a=2*r)>=1?(r=a-1,_?(P--,_=!1):(u<<=1,u|=1,g++)):(r=a,_?--P==0&&(g++,_=!1):(u<<=1,g++)),g===20)O|=u,u=0;else if(g===52){B|=u;break}if(a===1){g<20?O|=u<<20-g:g<52&&(B|=u<<52-g);break}}return O|=P<<20,new et(O|=E,B)},J.longBitsToDouble=function(c){var r,a,u,g,_=c.high,E=c.low,P=_&1<<31?-1:1;for(u=((2146435072&_)>>20)-R,g=0,a=524288,r=1;r<=20;r++)_&a&&(g+=U(2,-r)),a>>>=1;for(a=-2147483648,r=21;r<=52;r++)E&a&&(g+=U(2,-r)),a>>>=1;if(u===-1023){if(g===0)return 0*P;u=-1022}else{if(u===1024)return g===0?P/0:NaN;g+=1}return P*g*U(2,u)});var ht=(function(c){function r(a){var u;return s(this,r),(u=n(this,r,[a])).name=Object.keys({RuntimeException:r})[0],u}return m(r,c),l(r)})(M),Ot=(function(c){function r(){var a;return s(this,r),a=n(this,r),r.constructor_.apply(a,arguments),a}return m(r,c),l(r,null,[{key:"constructor_",value:function(){if(arguments.length===0)ht.constructor_.call(this);else if(arguments.length===1){var a=arguments[0];ht.constructor_.call(this,a)}}}])})(ht),ct=(function(){function c(){s(this,c)}return l(c,null,[{key:"shouldNeverReachHere",value:function(){if(arguments.length===0)c.shouldNeverReachHere(null);else if(arguments.length===1){var r=arguments[0];throw new Ot("Should never reach here"+(r!==null?": "+r:""))}}},{key:"isTrue",value:function(){if(arguments.length===1){var r=arguments[0];c.isTrue(r,null)}else if(arguments.length===2){var a=arguments[1];if(!arguments[0])throw a===null?new Ot:new Ot(a)}}},{key:"equals",value:function(){if(arguments.length===2){var r=arguments[0],a=arguments[1];c.equals(r,a,null)}else if(arguments.length===3){var u=arguments[0],g=arguments[1],_=arguments[2];if(!g.equals(u))throw new Ot("Expected "+u+" but encountered "+g+(_!==null?": "+_:""))}}}])})(),_t=new ArrayBuffer(8),Ct=new Float64Array(_t),Lt=new Int32Array(_t),K=(function(){function c(){s(this,c),c.constructor_.apply(this,arguments)}return l(c,[{key:"getM",value:function(){return J.NaN}},{key:"setOrdinate",value:function(r,a){switch(r){case c.X:this.x=a;break;case c.Y:this.y=a;break;case c.Z:this.setZ(a);break;default:throw new D("Invalid ordinate index: "+r)}}},{key:"equals2D",value:function(){if(arguments.length===1){var r=arguments[0];return this.x===r.x&&this.y===r.y}if(arguments.length===2){var a=arguments[0],u=arguments[1];return!!Y.equalsWithTolerance(this.x,a.x,u)&&!!Y.equalsWithTolerance(this.y,a.y,u)}}},{key:"setM",value:function(r){throw new D("Invalid ordinate index: "+c.M)}},{key:"getZ",value:function(){return this.z}},{key:"getOrdinate",value:function(r){switch(r){case c.X:return this.x;case c.Y:return this.y;case c.Z:return this.getZ()}throw new D("Invalid ordinate index: "+r)}},{key:"equals3D",value:function(r){return this.x===r.x&&this.y===r.y&&(this.getZ()===r.getZ()||J.isNaN(this.getZ())&&J.isNaN(r.getZ()))}},{key:"equals",value:function(r){return r instanceof c&&this.equals2D(r)}},{key:"equalInZ",value:function(r,a){return Y.equalsWithTolerance(this.getZ(),r.getZ(),a)}},{key:"setX",value:function(r){this.x=r}},{key:"compareTo",value:function(r){var a=r;return this.x<a.x?-1:this.x>a.x?1:this.y<a.y?-1:this.y>a.y?1:0}},{key:"getX",value:function(){return this.x}},{key:"setZ",value:function(r){this.z=r}},{key:"clone",value:function(){try{return null}catch(r){if(r instanceof CloneNotSupportedException)return ct.shouldNeverReachHere("this shouldn't happen because this class is Cloneable"),null;throw r}}},{key:"copy",value:function(){return new c(this)}},{key:"toString",value:function(){return"("+this.x+", "+this.y+", "+this.getZ()+")"}},{key:"distance3D",value:function(r){var a=this.x-r.x,u=this.y-r.y,g=this.getZ()-r.getZ();return Math.sqrt(a*a+u*u+g*g)}},{key:"getY",value:function(){return this.y}},{key:"setY",value:function(r){this.y=r}},{key:"distance",value:function(r){var a=this.x-r.x,u=this.y-r.y;return Math.sqrt(a*a+u*u)}},{key:"hashCode",value:function(){var r=17;return r=37*(r=37*r+c.hashCode(this.x))+c.hashCode(this.y)}},{key:"setCoordinate",value:function(r){this.x=r.x,this.y=r.y,this.z=r.getZ()}},{key:"interfaces_",get:function(){return[V,x,I]}}],[{key:"constructor_",value:function(){if(this.x=null,this.y=null,this.z=null,arguments.length===0)c.constructor_.call(this,0,0);else if(arguments.length===1){var r=arguments[0];c.constructor_.call(this,r.x,r.y,r.getZ())}else if(arguments.length===2){var a=arguments[0],u=arguments[1];c.constructor_.call(this,a,u,c.NULL_ORDINATE)}else if(arguments.length===3){var g=arguments[0],_=arguments[1],E=arguments[2];this.x=g,this.y=_,this.z=E}}},{key:"hashCode",value:function(r){return Ct[0]=r,Lt[0]^Lt[1]}}])})(),Qt=(function(){function c(){s(this,c),c.constructor_.apply(this,arguments)}return l(c,[{key:"compare",value:function(r,a){var u=c.compare(r.x,a.x);if(u!==0)return u;var g=c.compare(r.y,a.y);return g!==0?g:this._dimensionsToTest<=2?0:c.compare(r.getZ(),a.getZ())}},{key:"interfaces_",get:function(){return[rt]}}],[{key:"constructor_",value:function(){if(this._dimensionsToTest=2,arguments.length===0)c.constructor_.call(this,2);else if(arguments.length===1){var r=arguments[0];if(r!==2&&r!==3)throw new D("only 2 or 3 dimensions may be specified");this._dimensionsToTest=r}}},{key:"compare",value:function(r,a){return r<a?-1:r>a?1:J.isNaN(r)?J.isNaN(a)?0:-1:J.isNaN(a)?1:0}}])})();K.DimensionalComparator=Qt,K.NULL_ORDINATE=J.NaN,K.X=0,K.Y=1,K.Z=2,K.M=3;var zt=(function(){function c(){s(this,c),c.constructor_.apply(this,arguments)}return l(c,[{key:"getArea",value:function(){return this.getWidth()*this.getHeight()}},{key:"equals",value:function(r){if(!(r instanceof c))return!1;var a=r;return this.isNull()?a.isNull():this._maxx===a.getMaxX()&&this._maxy===a.getMaxY()&&this._minx===a.getMinX()&&this._miny===a.getMinY()}},{key:"intersection",value:function(r){if(this.isNull()||r.isNull()||!this.intersects(r))return new c;var a=this._minx>r._minx?this._minx:r._minx,u=this._miny>r._miny?this._miny:r._miny;return new c(a,this._maxx<r._maxx?this._maxx:r._maxx,u,this._maxy<r._maxy?this._maxy:r._maxy)}},{key:"isNull",value:function(){return this._maxx<this._minx}},{key:"getMaxX",value:function(){return this._maxx}},{key:"covers",value:function(){if(arguments.length===1){if(arguments[0]instanceof K){var r=arguments[0];return this.covers(r.x,r.y)}if(arguments[0]instanceof c){var a=arguments[0];return!this.isNull()&&!a.isNull()&&a.getMinX()>=this._minx&&a.getMaxX()<=this._maxx&&a.getMinY()>=this._miny&&a.getMaxY()<=this._maxy}}else if(arguments.length===2){var u=arguments[0],g=arguments[1];return!this.isNull()&&u>=this._minx&&u<=this._maxx&&g>=this._miny&&g<=this._maxy}}},{key:"intersects",value:function(){if(arguments.length===1){if(arguments[0]instanceof c){var r=arguments[0];return!this.isNull()&&!r.isNull()&&!(r._minx>this._maxx||r._maxx<this._minx||r._miny>this._maxy||r._maxy<this._miny)}if(arguments[0]instanceof K){var a=arguments[0];return this.intersects(a.x,a.y)}}else if(arguments.length===2){if(arguments[0]instanceof K&&arguments[1]instanceof K){var u=arguments[0],g=arguments[1];return!this.isNull()&&!((u.x<g.x?u.x:g.x)>this._maxx)&&!((u.x>g.x?u.x:g.x)<this._minx)&&!((u.y<g.y?u.y:g.y)>this._maxy)&&!((u.y>g.y?u.y:g.y)<this._miny)}if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var _=arguments[0],E=arguments[1];return!this.isNull()&&!(_>this._maxx||_<this._minx||E>this._maxy||E<this._miny)}}}},{key:"getMinY",value:function(){return this._miny}},{key:"getDiameter",value:function(){if(this.isNull())return 0;var r=this.getWidth(),a=this.getHeight();return Math.sqrt(r*r+a*a)}},{key:"getMinX",value:function(){return this._minx}},{key:"expandToInclude",value:function(){if(arguments.length===1){if(arguments[0]instanceof K){var r=arguments[0];this.expandToInclude(r.x,r.y)}else if(arguments[0]instanceof c){var a=arguments[0];if(a.isNull())return null;this.isNull()?(this._minx=a.getMinX(),this._maxx=a.getMaxX(),this._miny=a.getMinY(),this._maxy=a.getMaxY()):(a._minx<this._minx&&(this._minx=a._minx),a._maxx>this._maxx&&(this._maxx=a._maxx),a._miny<this._miny&&(this._miny=a._miny),a._maxy>this._maxy&&(this._maxy=a._maxy))}}else if(arguments.length===2){var u=arguments[0],g=arguments[1];this.isNull()?(this._minx=u,this._maxx=u,this._miny=g,this._maxy=g):(u<this._minx&&(this._minx=u),u>this._maxx&&(this._maxx=u),g<this._miny&&(this._miny=g),g>this._maxy&&(this._maxy=g))}}},{key:"minExtent",value:function(){if(this.isNull())return 0;var r=this.getWidth(),a=this.getHeight();return r<a?r:a}},{key:"getWidth",value:function(){return this.isNull()?0:this._maxx-this._minx}},{key:"compareTo",value:function(r){var a=r;return this.isNull()?a.isNull()?0:-1:a.isNull()?1:this._minx<a._minx?-1:this._minx>a._minx?1:this._miny<a._miny?-1:this._miny>a._miny?1:this._maxx<a._maxx?-1:this._maxx>a._maxx?1:this._maxy<a._maxy?-1:this._maxy>a._maxy?1:0}},{key:"translate",value:function(r,a){if(this.isNull())return null;this.init(this.getMinX()+r,this.getMaxX()+r,this.getMinY()+a,this.getMaxY()+a)}},{key:"copy",value:function(){return new c(this)}},{key:"toString",value:function(){return"Env["+this._minx+" : "+this._maxx+", "+this._miny+" : "+this._maxy+"]"}},{key:"setToNull",value:function(){this._minx=0,this._maxx=-1,this._miny=0,this._maxy=-1}},{key:"disjoint",value:function(r){return!(!this.isNull()&&!r.isNull())||r._minx>this._maxx||r._maxx<this._minx||r._miny>this._maxy||r._maxy<this._miny}},{key:"getHeight",value:function(){return this.isNull()?0:this._maxy-this._miny}},{key:"maxExtent",value:function(){if(this.isNull())return 0;var r=this.getWidth(),a=this.getHeight();return r>a?r:a}},{key:"expandBy",value:function(){if(arguments.length===1){var r=arguments[0];this.expandBy(r,r)}else if(arguments.length===2){var a=arguments[0],u=arguments[1];if(this.isNull())return null;this._minx-=a,this._maxx+=a,this._miny-=u,this._maxy+=u,(this._minx>this._maxx||this._miny>this._maxy)&&this.setToNull()}}},{key:"contains",value:function(){if(arguments.length===1){if(arguments[0]instanceof c){var r=arguments[0];return this.covers(r)}if(arguments[0]instanceof K){var a=arguments[0];return this.covers(a)}}else if(arguments.length===2){var u=arguments[0],g=arguments[1];return this.covers(u,g)}}},{key:"centre",value:function(){return this.isNull()?null:new K((this.getMinX()+this.getMaxX())/2,(this.getMinY()+this.getMaxY())/2)}},{key:"init",value:function(){if(arguments.length===0)this.setToNull();else if(arguments.length===1){if(arguments[0]instanceof K){var r=arguments[0];this.init(r.x,r.x,r.y,r.y)}else if(arguments[0]instanceof c){var a=arguments[0];this._minx=a._minx,this._maxx=a._maxx,this._miny=a._miny,this._maxy=a._maxy}}else if(arguments.length===2){var u=arguments[0],g=arguments[1];this.init(u.x,g.x,u.y,g.y)}else if(arguments.length===4){var _=arguments[0],E=arguments[1],P=arguments[2],O=arguments[3];_<E?(this._minx=_,this._maxx=E):(this._minx=E,this._maxx=_),P<O?(this._miny=P,this._maxy=O):(this._miny=O,this._maxy=P)}}},{key:"getMaxY",value:function(){return this._maxy}},{key:"distance",value:function(r){if(this.intersects(r))return 0;var a=0;this._maxx<r._minx?a=r._minx-this._maxx:this._minx>r._maxx&&(a=this._minx-r._maxx);var u=0;return this._maxy<r._miny?u=r._miny-this._maxy:this._miny>r._maxy&&(u=this._miny-r._maxy),a===0?u:u===0?a:Math.sqrt(a*a+u*u)}},{key:"hashCode",value:function(){var r=17;return r=37*(r=37*(r=37*(r=37*r+K.hashCode(this._minx))+K.hashCode(this._maxx))+K.hashCode(this._miny))+K.hashCode(this._maxy)}},{key:"interfaces_",get:function(){return[V,I]}}],[{key:"constructor_",value:function(){if(this._minx=null,this._maxx=null,this._miny=null,this._maxy=null,arguments.length===0)this.init();else if(arguments.length===1){if(arguments[0]instanceof K){var r=arguments[0];this.init(r.x,r.x,r.y,r.y)}else if(arguments[0]instanceof c){var a=arguments[0];this.init(a)}}else if(arguments.length===2){var u=arguments[0],g=arguments[1];this.init(u.x,g.x,u.y,g.y)}else if(arguments.length===4){var _=arguments[0],E=arguments[1],P=arguments[2],O=arguments[3];this.init(_,E,P,O)}}},{key:"intersects",value:function(){if(arguments.length===3){var r=arguments[0],a=arguments[1],u=arguments[2];return u.x>=(r.x<a.x?r.x:a.x)&&u.x<=(r.x>a.x?r.x:a.x)&&u.y>=(r.y<a.y?r.y:a.y)&&u.y<=(r.y>a.y?r.y:a.y)}if(arguments.length===4){var g=arguments[0],_=arguments[1],E=arguments[2],P=arguments[3],O=Math.min(E.x,P.x),B=Math.max(E.x,P.x),Z=Math.min(g.x,_.x),tt=Math.max(g.x,_.x);return!(Z>B)&&!(tt<O)&&(O=Math.min(E.y,P.y),B=Math.max(E.y,P.y),Z=Math.min(g.y,_.y),tt=Math.max(g.y,_.y),!(Z>B)&&!(tt<O))}}}])})(),gt=(function(){function c(){s(this,c),c.constructor_.apply(this,arguments)}return l(c,[{key:"isGeometryCollection",value:function(){return this.getTypeCode()===c.TYPECODE_GEOMETRYCOLLECTION}},{key:"getFactory",value:function(){return this._factory}},{key:"getGeometryN",value:function(r){return this}},{key:"getArea",value:function(){return 0}},{key:"isRectangle",value:function(){return!1}},{key:"equalsExact",value:function(r){return this===r||this.equalsExact(r,0)}},{key:"geometryChanged",value:function(){this.apply(c.geometryChangedFilter)}},{key:"geometryChangedAction",value:function(){this._envelope=null}},{key:"equalsNorm",value:function(r){return r!==null&&this.norm().equalsExact(r.norm())}},{key:"getLength",value:function(){return 0}},{key:"getNumGeometries",value:function(){return 1}},{key:"compareTo",value:function(){var r;if(arguments.length===1){var a=arguments[0];return r=a,this.getTypeCode()!==r.getTypeCode()?this.getTypeCode()-r.getTypeCode():this.isEmpty()&&r.isEmpty()?0:this.isEmpty()?-1:r.isEmpty()?1:this.compareToSameClass(a)}if(arguments.length===2){var u=arguments[0],g=arguments[1];return r=u,this.getTypeCode()!==r.getTypeCode()?this.getTypeCode()-r.getTypeCode():this.isEmpty()&&r.isEmpty()?0:this.isEmpty()?-1:r.isEmpty()?1:this.compareToSameClass(u,g)}}},{key:"getUserData",value:function(){return this._userData}},{key:"getSRID",value:function(){return this._SRID}},{key:"getEnvelope",value:function(){return this.getFactory().toGeometry(this.getEnvelopeInternal())}},{key:"checkNotGeometryCollection",value:function(r){if(r.getTypeCode()===c.TYPECODE_GEOMETRYCOLLECTION)throw new D("This method does not support GeometryCollection arguments")}},{key:"equal",value:function(r,a,u){return u===0?r.equals(a):r.distance(a)<=u}},{key:"norm",value:function(){var r=this.copy();return r.normalize(),r}},{key:"reverse",value:function(){var r=this.reverseInternal();return this.envelope!=null&&(r.envelope=this.envelope.copy()),r.setSRID(this.getSRID()),r}},{key:"copy",value:function(){var r=this.copyInternal();return r.envelope=this._envelope==null?null:this._envelope.copy(),r._SRID=this._SRID,r._userData=this._userData,r}},{key:"getPrecisionModel",value:function(){return this._factory.getPrecisionModel()}},{key:"getEnvelopeInternal",value:function(){return this._envelope===null&&(this._envelope=this.computeEnvelopeInternal()),new zt(this._envelope)}},{key:"setSRID",value:function(r){this._SRID=r}},{key:"setUserData",value:function(r){this._userData=r}},{key:"compare",value:function(r,a){for(var u=r.iterator(),g=a.iterator();u.hasNext()&&g.hasNext();){var _=u.next(),E=g.next(),P=_.compareTo(E);if(P!==0)return P}return u.hasNext()?1:g.hasNext()?-1:0}},{key:"hashCode",value:function(){return this.getEnvelopeInternal().hashCode()}},{key:"isEquivalentClass",value:function(r){return this.getClass()===r.getClass()}},{key:"isGeometryCollectionOrDerived",value:function(){return this.getTypeCode()===c.TYPECODE_GEOMETRYCOLLECTION||this.getTypeCode()===c.TYPECODE_MULTIPOINT||this.getTypeCode()===c.TYPECODE_MULTILINESTRING||this.getTypeCode()===c.TYPECODE_MULTIPOLYGON}},{key:"interfaces_",get:function(){return[x,V,I]}},{key:"getClass",value:function(){return c}}],[{key:"hasNonEmptyElements",value:function(r){for(var a=0;a<r.length;a++)if(!r[a].isEmpty())return!0;return!1}},{key:"hasNullElements",value:function(r){for(var a=0;a<r.length;a++)if(r[a]===null)return!0;return!1}}])})();gt.constructor_=function(c){c&&(this._envelope=null,this._userData=null,this._factory=c,this._SRID=c.getSRID())},gt.TYPECODE_POINT=0,gt.TYPECODE_MULTIPOINT=1,gt.TYPECODE_LINESTRING=2,gt.TYPECODE_LINEARRING=3,gt.TYPECODE_MULTILINESTRING=4,gt.TYPECODE_POLYGON=5,gt.TYPECODE_MULTIPOLYGON=6,gt.TYPECODE_GEOMETRYCOLLECTION=7,gt.TYPENAME_POINT="Point",gt.TYPENAME_MULTIPOINT="MultiPoint",gt.TYPENAME_LINESTRING="LineString",gt.TYPENAME_LINEARRING="LinearRing",gt.TYPENAME_MULTILINESTRING="MultiLineString",gt.TYPENAME_POLYGON="Polygon",gt.TYPENAME_MULTIPOLYGON="MultiPolygon",gt.TYPENAME_GEOMETRYCOLLECTION="GeometryCollection",gt.geometryChangedFilter={get interfaces_(){return[L]},filter:function(c){c.geometryChangedAction()}};var A=(function(){function c(){s(this,c)}return l(c,null,[{key:"toLocationSymbol",value:function(r){switch(r){case c.EXTERIOR:return"e";case c.BOUNDARY:return"b";case c.INTERIOR:return"i";case c.NONE:return"-"}throw new D("Unknown location value: "+r)}}])})();A.INTERIOR=0,A.BOUNDARY=1,A.EXTERIOR=2,A.NONE=-1;var at=(function(){return l((function c(){s(this,c)}),[{key:"add",value:function(){}},{key:"addAll",value:function(){}},{key:"isEmpty",value:function(){}},{key:"iterator",value:function(){}},{key:"size",value:function(){}},{key:"toArray",value:function(){}},{key:"remove",value:function(){}}])})(),Pt=(function(c){function r(a){var u;return s(this,r),(u=n(this,r,[a])).name=Object.keys({NoSuchElementException:r})[0],u}return m(r,c),l(r)})(M),It=(function(c){function r(a){var u;return s(this,r),(u=n(this,r,[a])).name=Object.keys({UnsupportedOperationException:r})[0],u}return m(r,c),l(r)})(M),re=(function(c){function r(){return s(this,r),n(this,r,arguments)}return m(r,c),l(r,[{key:"contains",value:function(){}}])})(at),le=(function(c){function r(a){var u;return s(this,r),(u=n(this,r)).map=new Map,a instanceof at&&u.addAll(a),u}return m(r,c),l(r,[{key:"contains",value:function(a){var u=a.hashCode?a.hashCode():a;return!!this.map.has(u)}},{key:"add",value:function(a){var u=a.hashCode?a.hashCode():a;return!this.map.has(u)&&!!this.map.set(u,a)}},{key:"addAll",value:function(a){var u,g=d(a);try{for(g.s();!(u=g.n()).done;){var _=u.value;this.add(_)}}catch(E){g.e(E)}finally{g.f()}return!0}},{key:"remove",value:function(){throw new It}},{key:"size",value:function(){return this.map.size}},{key:"isEmpty",value:function(){return this.map.size===0}},{key:"toArray",value:function(){return Array.from(this.map.values())}},{key:"iterator",value:function(){return new Vn(this.map)}},{key:Symbol.iterator,value:function(){return this.map}}])})(re),Vn=(function(){return l((function c(r){s(this,c),this.iterator=r.values();var a=this.iterator.next(),u=a.done,g=a.value;this.done=u,this.value=g}),[{key:"next",value:function(){if(this.done)throw new Pt;var c=this.value,r=this.iterator.next(),a=r.done,u=r.value;return this.done=a,this.value=u,c}},{key:"hasNext",value:function(){return!this.done}},{key:"remove",value:function(){throw new It}}])})(),ut=(function(){function c(){s(this,c)}return l(c,null,[{key:"opposite",value:function(r){return r===c.LEFT?c.RIGHT:r===c.RIGHT?c.LEFT:r}}])})();ut.ON=0,ut.LEFT=1,ut.RIGHT=2;var Tu=(function(c){function r(a){var u;return s(this,r),(u=n(this,r,[a])).name=Object.keys({EmptyStackException:r})[0],u}return m(r,c),l(r)})(M),ku=(function(c){function r(a){var u;return s(this,r),(u=n(this,r,[a])).name=Object.keys({IndexOutOfBoundsException:r})[0],u}return m(r,c),l(r)})(M),ds=(function(c){function r(){return s(this,r),n(this,r,arguments)}return m(r,c),l(r,[{key:"get",value:function(){}},{key:"set",value:function(){}},{key:"isEmpty",value:function(){}}])})(at),Fg=(function(c){function r(){var a;return s(this,r),(a=n(this,r)).array=[],a}return m(r,c),l(r,[{key:"add",value:function(a){return this.array.push(a),!0}},{key:"get",value:function(a){if(a<0||a>=this.size())throw new ku;return this.array[a]}},{key:"push",value:function(a){return this.array.push(a),a}},{key:"pop",value:function(){if(this.array.length===0)throw new Tu;return this.array.pop()}},{key:"peek",value:function(){if(this.array.length===0)throw new Tu;return this.array[this.array.length-1]}},{key:"empty",value:function(){return this.array.length===0}},{key:"isEmpty",value:function(){return this.empty()}},{key:"search",value:function(a){return this.array.indexOf(a)}},{key:"size",value:function(){return this.array.length}},{key:"toArray",value:function(){return this.array.slice()}}])})(ds);function Vt(c,r){return c.interfaces_&&c.interfaces_.indexOf(r)>-1}var Ws=(function(){return l((function c(r){s(this,c),this.str=r}),[{key:"append",value:function(c){this.str+=c}},{key:"setCharAt",value:function(c,r){this.str=this.str.substr(0,c)+r+this.str.substr(c+1)}},{key:"toString",value:function(){return this.str}}])})(),Hs=(function(){function c(r){s(this,c),this.value=r}return l(c,[{key:"intValue",value:function(){return this.value}},{key:"compareTo",value:function(r){return this.value<r?-1:this.value>r?1:0}}],[{key:"compare",value:function(r,a){return r<a?-1:r>a?1:0}},{key:"isNan",value:function(r){return Number.isNaN(r)}},{key:"valueOf",value:function(r){return new c(r)}}])})(),Gg=(function(){return l((function c(){s(this,c)}),null,[{key:"isWhitespace",value:function(c){return c<=32&&c>=0||c===127}},{key:"toUpperCase",value:function(c){return c.toUpperCase()}}])})(),Bt=(function(){function c(){s(this,c),c.constructor_.apply(this,arguments)}return l(c,[{key:"le",value:function(r){return this._hi<r._hi||this._hi===r._hi&&this._lo<=r._lo}},{key:"extractSignificantDigits",value:function(r,a){var u=this.abs(),g=c.magnitude(u._hi),_=c.TEN.pow(g);(u=u.divide(_)).gt(c.TEN)?(u=u.divide(c.TEN),g+=1):u.lt(c.ONE)&&(u=u.multiply(c.TEN),g-=1);for(var E=g+1,P=new Ws,O=c.MAX_PRINT_DIGITS-1,B=0;B<=O;B++){r&&B===E&&P.append(".");var Z=Math.trunc(u._hi);if(Z<0)break;var tt=!1,ot=0;Z>9?(tt=!0,ot="9"):ot="0"+Z,P.append(ot),u=u.subtract(c.valueOf(Z)).multiply(c.TEN),tt&&u.selfAdd(c.TEN);var Et=!0,Nt=c.magnitude(u._hi);if(Nt<0&&Math.abs(Nt)>=O-B&&(Et=!1),!Et)break}return a[0]=g,P.toString()}},{key:"sqr",value:function(){return this.multiply(this)}},{key:"doubleValue",value:function(){return this._hi+this._lo}},{key:"subtract",value:function(){if(arguments[0]instanceof c){var r=arguments[0];return this.add(r.negate())}if(typeof arguments[0]=="number"){var a=arguments[0];return this.add(-a)}}},{key:"equals",value:function(){if(arguments.length===1&&arguments[0]instanceof c){var r=arguments[0];return this._hi===r._hi&&this._lo===r._lo}}},{key:"isZero",value:function(){return this._hi===0&&this._lo===0}},{key:"selfSubtract",value:function(){if(arguments[0]instanceof c){var r=arguments[0];return this.isNaN()?this:this.selfAdd(-r._hi,-r._lo)}if(typeof arguments[0]=="number"){var a=arguments[0];return this.isNaN()?this:this.selfAdd(-a,0)}}},{key:"getSpecialNumberString",value:function(){return this.isZero()?"0.0":this.isNaN()?"NaN ":null}},{key:"min",value:function(r){return this.le(r)?this:r}},{key:"selfDivide",value:function(){if(arguments.length===1){if(arguments[0]instanceof c){var r=arguments[0];return this.selfDivide(r._hi,r._lo)}if(typeof arguments[0]=="number"){var a=arguments[0];return this.selfDivide(a,0)}}else if(arguments.length===2){var u,g,_,E,P=arguments[0],O=arguments[1],B=null,Z=null,tt=null,ot=null;return _=this._hi/P,ot=(B=(tt=c.SPLIT*_)-(B=tt-_))*(Z=(ot=c.SPLIT*P)-(Z=ot-P))-(E=_*P)+B*(g=P-Z)+(u=_-B)*Z+u*g,ot=_+(tt=(this._hi-E-ot+this._lo-_*O)/P),this._hi=ot,this._lo=_-ot+tt,this}}},{key:"dump",value:function(){return"DD<"+this._hi+", "+this._lo+">"}},{key:"divide",value:function(){if(arguments[0]instanceof c){var r,a,u,g,_=arguments[0],E=null,P=null,O=null,B=null;return r=(u=this._hi/_._hi)-(E=(O=c.SPLIT*u)-(E=O-u)),B=E*(P=(B=c.SPLIT*_._hi)-(P=B-_._hi))-(g=u*_._hi)+E*(a=_._hi-P)+r*P+r*a,new c(B=u+(O=(this._hi-g-B+this._lo-u*_._lo)/_._hi),u-B+O)}if(typeof arguments[0]=="number"){var Z=arguments[0];return J.isNaN(Z)?c.createNaN():c.copy(this).selfDivide(Z,0)}}},{key:"ge",value:function(r){return this._hi>r._hi||this._hi===r._hi&&this._lo>=r._lo}},{key:"pow",value:function(r){if(r===0)return c.valueOf(1);var a=new c(this),u=c.valueOf(1),g=Math.abs(r);if(g>1)for(;g>0;)g%2==1&&u.selfMultiply(a),(g/=2)>0&&(a=a.sqr());else u=a;return r<0?u.reciprocal():u}},{key:"ceil",value:function(){if(this.isNaN())return c.NaN;var r=Math.ceil(this._hi),a=0;return r===this._hi&&(a=Math.ceil(this._lo)),new c(r,a)}},{key:"compareTo",value:function(r){var a=r;return this._hi<a._hi?-1:this._hi>a._hi?1:this._lo<a._lo?-1:this._lo>a._lo?1:0}},{key:"rint",value:function(){return this.isNaN()?this:this.add(.5).floor()}},{key:"setValue",value:function(){if(arguments[0]instanceof c){var r=arguments[0];return this.init(r),this}if(typeof arguments[0]=="number"){var a=arguments[0];return this.init(a),this}}},{key:"max",value:function(r){return this.ge(r)?this:r}},{key:"sqrt",value:function(){if(this.isZero())return c.valueOf(0);if(this.isNegative())return c.NaN;var r=1/Math.sqrt(this._hi),a=this._hi*r,u=c.valueOf(a),g=this.subtract(u.sqr())._hi*(.5*r);return u.add(g)}},{key:"selfAdd",value:function(){if(arguments.length===1){if(arguments[0]instanceof c){var r=arguments[0];return this.selfAdd(r._hi,r._lo)}if(typeof arguments[0]=="number"){var a,u,g,_,E,P=arguments[0],O=null;return O=(g=this._hi+P)-(_=g-this._hi),u=(E=(O=P-_+(this._hi-O))+this._lo)+(g-(a=g+E)),this._hi=a+u,this._lo=u+(a-this._hi),this}}else if(arguments.length===2){var B,Z,tt,ot,Et=arguments[0],Nt=arguments[1],Dt=null,Zt=null,Yt=null;tt=this._hi+Et,Z=this._lo+Nt,Zt=tt-(Yt=tt-this._hi),Dt=Z-(ot=Z-this._lo);var oe=(B=tt+(Yt=(Zt=Et-Yt+(this._hi-Zt))+Z))+(Yt=(Dt=Nt-ot+(this._lo-Dt))+(Yt+(tt-B))),qe=Yt+(B-oe);return this._hi=oe,this._lo=qe,this}}},{key:"selfMultiply",value:function(){if(arguments.length===1){if(arguments[0]instanceof c){var r=arguments[0];return this.selfMultiply(r._hi,r._lo)}if(typeof arguments[0]=="number"){var a=arguments[0];return this.selfMultiply(a,0)}}else if(arguments.length===2){var u,g,_=arguments[0],E=arguments[1],P=null,O=null,B=null,Z=null;P=(B=c.SPLIT*this._hi)-this._hi,Z=c.SPLIT*_,P=B-P,u=this._hi-P,O=Z-_;var tt=(B=this._hi*_)+(Z=P*(O=Z-O)-B+P*(g=_-O)+u*O+u*g+(this._hi*E+this._lo*_)),ot=Z+(P=B-tt);return this._hi=tt,this._lo=ot,this}}},{key:"selfSqr",value:function(){return this.selfMultiply(this)}},{key:"floor",value:function(){if(this.isNaN())return c.NaN;var r=Math.floor(this._hi),a=0;return r===this._hi&&(a=Math.floor(this._lo)),new c(r,a)}},{key:"negate",value:function(){return this.isNaN()?this:new c(-this._hi,-this._lo)}},{key:"clone",value:function(){try{return null}catch(r){if(r instanceof CloneNotSupportedException)return null;throw r}}},{key:"multiply",value:function(){if(arguments[0]instanceof c){var r=arguments[0];return r.isNaN()?c.createNaN():c.copy(this).selfMultiply(r)}if(typeof arguments[0]=="number"){var a=arguments[0];return J.isNaN(a)?c.createNaN():c.copy(this).selfMultiply(a,0)}}},{key:"isNaN",value:function(){return J.isNaN(this._hi)}},{key:"intValue",value:function(){return Math.trunc(this._hi)}},{key:"toString",value:function(){var r=c.magnitude(this._hi);return r>=-3&&r<=20?this.toStandardNotation():this.toSciNotation()}},{key:"toStandardNotation",value:function(){var r=this.getSpecialNumberString();if(r!==null)return r;var a=new Array(1).fill(null),u=this.extractSignificantDigits(!0,a),g=a[0]+1,_=u;if(u.charAt(0)===".")_="0"+u;else if(g<0)_="0."+c.stringOfChar("0",-g)+u;else if(u.indexOf(".")===-1){var E=g-u.length;_=u+c.stringOfChar("0",E)+".0"}return this.isNegative()?"-"+_:_}},{key:"reciprocal",value:function(){var r,a,u,g,_=null,E=null,P=null,O=null;r=(u=1/this._hi)-(_=(P=c.SPLIT*u)-(_=P-u)),E=(O=c.SPLIT*this._hi)-this._hi;var B=u+(P=(1-(g=u*this._hi)-(O=_*(E=O-E)-g+_*(a=this._hi-E)+r*E+r*a)-u*this._lo)/this._hi);return new c(B,u-B+P)}},{key:"toSciNotation",value:function(){if(this.isZero())return c.SCI_NOT_ZERO;var r=this.getSpecialNumberString();if(r!==null)return r;var a=new Array(1).fill(null),u=this.extractSignificantDigits(!1,a),g=c.SCI_NOT_EXPONENT_CHAR+a[0];if(u.charAt(0)==="0")throw new IllegalStateException("Found leading zero: "+u);var _="";u.length>1&&(_=u.substring(1));var E=u.charAt(0)+"."+_;return this.isNegative()?"-"+E+g:E+g}},{key:"abs",value:function(){return this.isNaN()?c.NaN:this.isNegative()?this.negate():new c(this)}},{key:"isPositive",value:function(){return this._hi>0||this._hi===0&&this._lo>0}},{key:"lt",value:function(r){return this._hi<r._hi||this._hi===r._hi&&this._lo<r._lo}},{key:"add",value:function(){if(arguments[0]instanceof c){var r=arguments[0];return c.copy(this).selfAdd(r)}if(typeof arguments[0]=="number"){var a=arguments[0];return c.copy(this).selfAdd(a)}}},{key:"init",value: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 c){var a=arguments[0];this._hi=a._hi,this._lo=a._lo}}else if(arguments.length===2){var u=arguments[0],g=arguments[1];this._hi=u,this._lo=g}}},{key:"gt",value:function(r){return this._hi>r._hi||this._hi===r._hi&&this._lo>r._lo}},{key:"isNegative",value:function(){return this._hi<0||this._hi===0&&this._lo<0}},{key:"trunc",value:function(){return this.isNaN()?c.NaN:this.isPositive()?this.floor():this.ceil()}},{key:"signum",value:function(){return this._hi>0?1:this._hi<0?-1:this._lo>0?1:this._lo<0?-1:0}},{key:"interfaces_",get:function(){return[I,V,x]}}],[{key:"constructor_",value:function(){if(this._hi=0,this._lo=0,arguments.length===0)this.init(0);else if(arguments.length===1){if(typeof arguments[0]=="number"){var r=arguments[0];this.init(r)}else if(arguments[0]instanceof c){var a=arguments[0];this.init(a)}else if(typeof arguments[0]=="string"){var u=arguments[0];c.constructor_.call(this,c.parse(u))}}else if(arguments.length===2){var g=arguments[0],_=arguments[1];this.init(g,_)}}},{key:"determinant",value:function(){if(typeof arguments[3]=="number"&&typeof arguments[2]=="number"&&typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var r=arguments[0],a=arguments[1],u=arguments[2],g=arguments[3];return c.determinant(c.valueOf(r),c.valueOf(a),c.valueOf(u),c.valueOf(g))}if(arguments[3]instanceof c&&arguments[2]instanceof c&&arguments[0]instanceof c&&arguments[1]instanceof c){var _=arguments[1],E=arguments[2],P=arguments[3];return arguments[0].multiply(P).selfSubtract(_.multiply(E))}}},{key:"sqr",value:function(r){return c.valueOf(r).selfMultiply(r)}},{key:"valueOf",value:function(){if(typeof arguments[0]=="string"){var r=arguments[0];return c.parse(r)}if(typeof arguments[0]=="number")return new c(arguments[0])}},{key:"sqrt",value:function(r){return c.valueOf(r).sqrt()}},{key:"parse",value:function(r){for(var a=0,u=r.length;Gg.isWhitespace(r.charAt(a));)a++;var g=!1;if(a<u){var _=r.charAt(a);_!=="-"&&_!=="+"||(a++,_==="-"&&(g=!0))}for(var E=new c,P=0,O=0,B=0,Z=!1;!(a>=u);){var tt=r.charAt(a);if(a++,Gg.isDigit(tt)){var ot=tt-"0";E.selfMultiply(c.TEN),E.selfAdd(ot),P++}else{if(tt!=="."){if(tt==="e"||tt==="E"){var Et=r.substring(a);try{B=Hs.parseInt(Et)}catch(oe){throw oe instanceof NumberFormatException?new NumberFormatException("Invalid exponent "+Et+" in string "+r):oe}break}throw new NumberFormatException("Unexpected character '"+tt+"' at position "+a+" in string "+r)}O=P,Z=!0}}var Nt=E;Z||(O=P);var Dt=P-O-B;if(Dt===0)Nt=E;else if(Dt>0){var Zt=c.TEN.pow(Dt);Nt=E.divide(Zt)}else if(Dt<0){var Yt=c.TEN.pow(-Dt);Nt=E.multiply(Yt)}return g?Nt.negate():Nt}},{key:"createNaN",value:function(){return new c(J.NaN,J.NaN)}},{key:"copy",value:function(r){return new c(r)}},{key:"magnitude",value:function(r){var a=Math.abs(r),u=Math.log(a)/Math.log(10),g=Math.trunc(Math.floor(u));return 10*Math.pow(10,g)<=a&&(g+=1),g}},{key:"stringOfChar",value:function(r,a){for(var u=new Ws,g=0;g<a;g++)u.append(r);return u.toString()}}])})();Bt.PI=new Bt(3.141592653589793,12246467991473532e-32),Bt.TWO_PI=new Bt(6.283185307179586,24492935982947064e-32),Bt.PI_2=new Bt(1.5707963267948966,6123233995736766e-32),Bt.E=new Bt(2.718281828459045,14456468917292502e-32),Bt.NaN=new Bt(J.NaN,J.NaN),Bt.EPS=123259516440783e-46,Bt.SPLIT=134217729,Bt.MAX_PRINT_DIGITS=32,Bt.TEN=Bt.valueOf(10),Bt.ONE=Bt.valueOf(1),Bt.SCI_NOT_EXPONENT_CHAR="E",Bt.SCI_NOT_ZERO="0.0E0";var jg=(function(){function c(){s(this,c)}return l(c,null,[{key:"orientationIndex",value:function(r,a,u){var g=c.orientationIndexFilter(r,a,u);if(g<=1)return g;var _=Bt.valueOf(a.x).selfAdd(-r.x),E=Bt.valueOf(a.y).selfAdd(-r.y),P=Bt.valueOf(u.x).selfAdd(-a.x),O=Bt.valueOf(u.y).selfAdd(-a.y);return _.selfMultiply(O).selfSubtract(E.selfMultiply(P)).signum()}},{key:"signOfDet2x2",value:function(){if(arguments[3]instanceof Bt&&arguments[2]instanceof Bt&&arguments[0]instanceof Bt&&arguments[1]instanceof Bt){var r=arguments[1],a=arguments[2],u=arguments[3];return arguments[0].multiply(u).selfSubtract(r.multiply(a)).signum()}if(typeof arguments[3]=="number"&&typeof arguments[2]=="number"&&typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var g=arguments[0],_=arguments[1],E=arguments[2],P=arguments[3],O=Bt.valueOf(g),B=Bt.valueOf(_),Z=Bt.valueOf(E),tt=Bt.valueOf(P);return O.multiply(tt).selfSubtract(B.multiply(Z)).signum()}}},{key:"intersection",value:function(r,a,u,g){var _=new Bt(r.y).selfSubtract(a.y),E=new Bt(a.x).selfSubtract(r.x),P=new Bt(r.x).selfMultiply(a.y).selfSubtract(new Bt(a.x).selfMultiply(r.y)),O=new Bt(u.y).selfSubtract(g.y),B=new Bt(g.x).selfSubtract(u.x),Z=new Bt(u.x).selfMultiply(g.y).selfSubtract(new Bt(g.x).selfMultiply(u.y)),tt=E.multiply(Z).selfSubtract(B.multiply(P)),ot=O.multiply(P).selfSubtract(_.multiply(Z)),Et=_.multiply(B).selfSubtract(O.multiply(E)),Nt=tt.selfDivide(Et).doubleValue(),Dt=ot.selfDivide(Et).doubleValue();return J.isNaN(Nt)||J.isInfinite(Nt)||J.isNaN(Dt)||J.isInfinite(Dt)?null:new K(Nt,Dt)}},{key:"orientationIndexFilter",value:function(r,a,u){var g=null,_=(r.x-u.x)*(a.y-u.y),E=(r.y-u.y)*(a.x-u.x),P=_-E;if(_>0){if(E<=0)return c.signum(P);g=_+E}else{if(!(_<0)||E>=0)return c.signum(P);g=-_-E}var O=c.DP_SAFE_EPSILON*g;return P>=O||-P>=O?c.signum(P):2}},{key:"signum",value:function(r){return r>0?1:r<0?-1:0}}])})();jg.DP_SAFE_EPSILON=1e-15;var Kt=(function(){return l((function c(){s(this,c)}),[{key:"getM",value:function(c){if(this.hasM()){var r=this.getDimension()-this.getMeasures();return this.getOrdinate(c,r)}return J.NaN}},{key:"setOrdinate",value:function(c,r,a){}},{key:"getZ",value:function(c){return this.hasZ()?this.getOrdinate(c,2):J.NaN}},{key:"size",value:function(){}},{key:"getOrdinate",value:function(c,r){}},{key:"getCoordinate",value:function(){}},{key:"getCoordinateCopy",value:function(c){}},{key:"createCoordinate",value:function(){}},{key:"getDimension",value:function(){}},{key:"hasM",value:function(){return this.getMeasures()>0}},{key:"getX",value:function(c){}},{key:"hasZ",value:function(){return this.getDimension()-this.getMeasures()>2}},{key:"getMeasures",value:function(){return 0}},{key:"expandEnvelope",value:function(c){}},{key:"copy",value:function(){}},{key:"getY",value:function(c){}},{key:"toCoordinateArray",value:function(){}},{key:"interfaces_",get:function(){return[x]}}])})();Kt.X=0,Kt.Y=1,Kt.Z=2,Kt.M=3;var Ut=(function(){function c(){s(this,c)}return l(c,null,[{key:"index",value:function(r,a,u){return jg.orientationIndex(r,a,u)}},{key:"isCCW",value:function(){if(arguments[0]instanceof Array){var r=arguments[0],a=r.length-1;if(a<3)throw new D("Ring has fewer than 4 points, so orientation cannot be determined");for(var u=r[0],g=0,_=1;_<=a;_++){var E=r[_];E.y>u.y&&(u=E,g=_)}var P=g;do(P-=1)<0&&(P=a);while(r[P].equals2D(u)&&P!==g);var O=g;do O=(O+1)%a;while(r[O].equals2D(u)&&O!==g);var B=r[P],Z=r[O];if(B.equals2D(u)||Z.equals2D(u)||B.equals2D(Z))return!1;var tt=c.index(B,u,Z);return tt===0?B.x>Z.x:tt>0}if(Vt(arguments[0],Kt)){var ot=arguments[0],Et=ot.size()-1;if(Et<3)throw new D("Ring has fewer than 4 points, so orientation cannot be determined");for(var Nt=ot.getCoordinate(0),Dt=0,Zt=1;Zt<=Et;Zt++){var Yt=ot.getCoordinate(Zt);Yt.y>Nt.y&&(Nt=Yt,Dt=Zt)}var oe=null,qe=Dt;do(qe-=1)<0&&(qe=Et),oe=ot.getCoordinate(qe);while(oe.equals2D(Nt)&&qe!==Dt);var ti=null,Xr=Dt;do Xr=(Xr+1)%Et,ti=ot.getCoordinate(Xr);while(ti.equals2D(Nt)&&Xr!==Dt);if(oe.equals2D(Nt)||ti.equals2D(Nt)||oe.equals2D(ti))return!1;var zh=c.index(oe,Nt,ti);return zh===0?oe.x>ti.x:zh>0}}}])})();Ut.CLOCKWISE=-1,Ut.RIGHT=Ut.CLOCKWISE,Ut.COUNTERCLOCKWISE=1,Ut.LEFT=Ut.COUNTERCLOCKWISE,Ut.COLLINEAR=0,Ut.STRAIGHT=Ut.COLLINEAR;var rN=(function(){return l((function c(){s(this,c),c.constructor_.apply(this,arguments)}),[{key:"getCoordinate",value:function(){return this._minCoord}},{key:"getRightmostSide",value:function(c,r){var a=this.getRightmostSideOfSegment(c,r);return a<0&&(a=this.getRightmostSideOfSegment(c,r-1)),a<0&&(this._minCoord=null,this.checkForRightmostCoordinate(c)),a}},{key:"findRightmostEdgeAtVertex",value:function(){var c=this._minDe.getEdge().getCoordinates();ct.isTrue(this._minIndex>0&&this._minIndex<c.length,"rightmost point expected to be interior vertex of edge");var r=c[this._minIndex-1],a=c[this._minIndex+1],u=Ut.index(this._minCoord,a,r),g=!1;(r.y<this._minCoord.y&&a.y<this._minCoord.y&&u===Ut.COUNTERCLOCKWISE||r.y>this._minCoord.y&&a.y>this._minCoord.y&&u===Ut.CLOCKWISE)&&(g=!0),g&&(this._minIndex=this._minIndex-1)}},{key:"getRightmostSideOfSegment",value:function(c,r){var a=c.getEdge().getCoordinates();if(r<0||r+1>=a.length||a[r].y===a[r+1].y)return-1;var u=ut.LEFT;return a[r].y<a[r+1].y&&(u=ut.RIGHT),u}},{key:"getEdge",value:function(){return this._orientedDe}},{key:"checkForRightmostCoordinate",value:function(c){for(var r=c.getEdge().getCoordinates(),a=0;a<r.length-1;a++)(this._minCoord===null||r[a].x>this._minCoord.x)&&(this._minDe=c,this._minIndex=a,this._minCoord=r[a])}},{key:"findRightmostEdgeAtNode",value:function(){var c=this._minDe.getNode().getEdges();this._minDe=c.getRightmostEdge(),this._minDe.isForward()||(this._minDe=this._minDe.getSym(),this._minIndex=this._minDe.getEdge().getCoordinates().length-1)}},{key:"findEdge",value:function(c){for(var r=c.iterator();r.hasNext();){var a=r.next();a.isForward()&&this.checkForRightmostCoordinate(a)}ct.isTrue(this._minIndex!==0||this._minCoord.equals(this._minDe.getCoordinate()),"inconsistency in rightmost processing"),this._minIndex===0?this.findRightmostEdgeAtNode():this.findRightmostEdgeAtVertex(),this._orientedDe=this._minDe,this.getRightmostSide(this._minDe,this._minIndex)===ut.LEFT&&(this._orientedDe=this._minDe.getSym())}}],[{key:"constructor_",value:function(){this._minIndex=-1,this._minCoord=null,this._minDe=null,this._orientedDe=null}}])})(),fs=(function(c){function r(a,u){var g;return s(this,r),(g=n(this,r,[u?a+" [ "+u+" ]":a])).pt=u?new K(u):void 0,g.name=Object.keys({TopologyException:r})[0],g}return m(r,c),l(r,[{key:"getCoordinate",value:function(){return this.pt}}])})(ht),aN=(function(){return l((function c(){s(this,c),this.array=[]}),[{key:"addLast",value:function(c){this.array.push(c)}},{key:"removeFirst",value:function(){return this.array.shift()}},{key:"isEmpty",value:function(){return this.array.length===0}}])})(),Gt=(function(c){function r(a){var u;return s(this,r),(u=n(this,r)).array=[],a instanceof at&&u.addAll(a),u}return m(r,c),l(r,[{key:"interfaces_",get:function(){return[ds,at]}},{key:"ensureCapacity",value:function(){}},{key:"add",value:function(a){return arguments.length===1?this.array.push(a):this.array.splice(arguments[0],0,arguments[1]),!0}},{key:"clear",value:function(){this.array=[]}},{key:"addAll",value:function(a){var u,g=d(a);try{for(g.s();!(u=g.n()).done;){var _=u.value;this.array.push(_)}}catch(E){g.e(E)}finally{g.f()}}},{key:"set",value:function(a,u){var g=this.array[a];return this.array[a]=u,g}},{key:"iterator",value:function(){return new oN(this)}},{key:"get",value:function(a){if(a<0||a>=this.size())throw new ku;return this.array[a]}},{key:"isEmpty",value:function(){return this.array.length===0}},{key:"sort",value:function(a){a?this.array.sort((function(u,g){return a.compare(u,g)})):this.array.sort()}},{key:"size",value:function(){return this.array.length}},{key:"toArray",value:function(){return this.array.slice()}},{key:"remove",value:function(a){for(var u=0,g=this.array.length;u<g;u++)if(this.array[u]===a)return!!this.array.splice(u,1);return!1}},{key:Symbol.iterator,value:function(){return this.array.values()}}])})(ds),oN=(function(){return l((function c(r){s(this,c),this.arrayList=r,this.position=0}),[{key:"next",value:function(){if(this.position===this.arrayList.size())throw new Pt;return this.arrayList.get(this.position++)}},{key:"hasNext",value:function(){return this.position<this.arrayList.size()}},{key:"set",value:function(c){return this.arrayList.set(this.position-1,c)}},{key:"remove",value:function(){this.arrayList.remove(this.arrayList.get(this.position))}}])})(),hN=(function(){return l((function c(){s(this,c),c.constructor_.apply(this,arguments)}),[{key:"clearVisitedEdges",value:function(){for(var c=this._dirEdgeList.iterator();c.hasNext();)c.next().setVisited(!1)}},{key:"getRightmostCoordinate",value:function(){return this._rightMostCoord}},{key:"computeNodeDepth",value:function(c){for(var r=null,a=c.getEdges().iterator();a.hasNext();){var u=a.next();if(u.isVisited()||u.getSym().isVisited()){r=u;break}}if(r===null)throw new fs("unable to find edge to compute depths at "+c.getCoordinate());c.getEdges().computeDepths(r);for(var g=c.getEdges().iterator();g.hasNext();){var _=g.next();_.setVisited(!0),this.copySymDepths(_)}}},{key:"computeDepth",value:function(c){this.clearVisitedEdges();var r=this._finder.getEdge();r.getNode(),r.getLabel(),r.setEdgeDepths(ut.RIGHT,c),this.copySymDepths(r),this.computeDepths(r)}},{key:"create",value:function(c){this.addReachable(c),this._finder.findEdge(this._dirEdgeList),this._rightMostCoord=this._finder.getCoordinate()}},{key:"findResultEdges",value:function(){for(var c=this._dirEdgeList.iterator();c.hasNext();){var r=c.next();r.getDepth(ut.RIGHT)>=1&&r.getDepth(ut.LEFT)<=0&&!r.isInteriorAreaEdge()&&r.setInResult(!0)}}},{key:"computeDepths",value:function(c){var r=new le,a=new aN,u=c.getNode();for(a.addLast(u),r.add(u),c.setVisited(!0);!a.isEmpty();){var g=a.removeFirst();r.add(g),this.computeNodeDepth(g);for(var _=g.getEdges().iterator();_.hasNext();){var E=_.next().getSym();if(!E.isVisited()){var P=E.getNode();r.contains(P)||(a.addLast(P),r.add(P))}}}}},{key:"compareTo",value:function(c){var r=c;return this._rightMostCoord.x<r._rightMostCoord.x?-1:this._rightMostCoord.x>r._rightMostCoord.x?1:0}},{key:"getEnvelope",value:function(){if(this._env===null){for(var c=new zt,r=this._dirEdgeList.iterator();r.hasNext();)for(var a=r.next().getEdge().getCoordinates(),u=0;u<a.length-1;u++)c.expandToInclude(a[u]);this._env=c}return this._env}},{key:"addReachable",value:function(c){var r=new Fg;for(r.add(c);!r.empty();){var a=r.pop();this.add(a,r)}}},{key:"copySymDepths",value:function(c){var r=c.getSym();r.setDepth(ut.LEFT,c.getDepth(ut.RIGHT)),r.setDepth(ut.RIGHT,c.getDepth(ut.LEFT))}},{key:"add",value:function(c,r){c.setVisited(!0),this._nodes.add(c);for(var a=c.getEdges().iterator();a.hasNext();){var u=a.next();this._dirEdgeList.add(u);var g=u.getSym().getNode();g.isVisited()||r.push(g)}}},{key:"getNodes",value:function(){return this._nodes}},{key:"getDirectedEdges",value:function(){return this._dirEdgeList}},{key:"interfaces_",get:function(){return[V]}}],[{key:"constructor_",value:function(){this._finder=null,this._dirEdgeList=new Gt,this._nodes=new Gt,this._rightMostCoord=null,this._env=null,this._finder=new rN}}])})(),Bg=(function(){return l((function c(){s(this,c)}),null,[{key:"intersection",value:function(c,r,a,u){var g=c.x<r.x?c.x:r.x,_=c.y<r.y?c.y:r.y,E=c.x>r.x?c.x:r.x,P=c.y>r.y?c.y:r.y,O=a.x<u.x?a.x:u.x,B=a.y<u.y?a.y:u.y,Z=a.x>u.x?a.x:u.x,tt=a.y>u.y?a.y:u.y,ot=((g>O?g:O)+(E<Z?E:Z))/2,Et=((_>B?_:B)+(P<tt?P:tt))/2,Nt=c.x-ot,Dt=c.y-Et,Zt=r.x-ot,Yt=r.y-Et,oe=a.x-ot,qe=a.y-Et,ti=u.x-ot,Xr=u.y-Et,zh=Dt-Yt,m1=Zt-Nt,v1=Nt*Yt-Zt*Dt,y1=qe-Xr,_1=ti-oe,w1=oe*Xr-ti*qe,E1=zh*_1-y1*m1,ip=(m1*w1-_1*v1)/E1,np=(y1*v1-zh*w1)/E1;return J.isNaN(ip)||J.isInfinite(ip)||J.isNaN(np)||J.isInfinite(np)?null:new K(ip+ot,np+Et)}}])})(),Yi=(function(){return l((function c(){s(this,c)}),null,[{key:"arraycopy",value:function(c,r,a,u,g){for(var _=0,E=r;E<r+g;E++)a[u+_]=c[E],_++}},{key:"getProperty",value:function(c){return{"line.separator":`
|
|
47
|
+
`}[c]}}])})(),Rh=(function(){function c(){s(this,c)}return l(c,null,[{key:"log10",value:function(r){var a=Math.log(r);return J.isInfinite(a)||J.isNaN(a)?a:a/c.LOG_10}},{key:"min",value:function(r,a,u,g){var _=r;return a<_&&(_=a),u<_&&(_=u),g<_&&(_=g),_}},{key:"clamp",value:function(){if(typeof arguments[2]=="number"&&typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var r=arguments[0],a=arguments[1],u=arguments[2];return r<a?a:r>u?u:r}if(Number.isInteger(arguments[2])&&Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var g=arguments[0],_=arguments[1],E=arguments[2];return g<_?_:g>E?E:g}}},{key:"wrap",value:function(r,a){return r<0?a- -r%a:r%a}},{key:"max",value:function(){if(arguments.length===3){var r=arguments[1],a=arguments[2],u=arguments[0];return r>u&&(u=r),a>u&&(u=a),u}if(arguments.length===4){var g=arguments[1],_=arguments[2],E=arguments[3],P=arguments[0];return g>P&&(P=g),_>P&&(P=_),E>P&&(P=E),P}}},{key:"average",value:function(r,a){return(r+a)/2}}])})();Rh.LOG_10=Math.log(10);var qn=(function(){function c(){s(this,c)}return l(c,null,[{key:"segmentToSegment",value:function(r,a,u,g){if(r.equals(a))return c.pointToSegment(r,u,g);if(u.equals(g))return c.pointToSegment(g,r,a);var _=!1;if(zt.intersects(r,a,u,g)){var E=(a.x-r.x)*(g.y-u.y)-(a.y-r.y)*(g.x-u.x);if(E===0)_=!0;else{var P=(r.y-u.y)*(g.x-u.x)-(r.x-u.x)*(g.y-u.y),O=((r.y-u.y)*(a.x-r.x)-(r.x-u.x)*(a.y-r.y))/E,B=P/E;(B<0||B>1||O<0||O>1)&&(_=!0)}}else _=!0;return _?Rh.min(c.pointToSegment(r,u,g),c.pointToSegment(a,u,g),c.pointToSegment(u,r,a),c.pointToSegment(g,r,a)):0}},{key:"pointToSegment",value:function(r,a,u){if(a.x===u.x&&a.y===u.y)return r.distance(a);var g=(u.x-a.x)*(u.x-a.x)+(u.y-a.y)*(u.y-a.y),_=((r.x-a.x)*(u.x-a.x)+(r.y-a.y)*(u.y-a.y))/g;if(_<=0)return r.distance(a);if(_>=1)return r.distance(u);var E=((a.y-r.y)*(u.x-a.x)-(a.x-r.x)*(u.y-a.y))/g;return Math.abs(E)*Math.sqrt(g)}},{key:"pointToLinePerpendicular",value:function(r,a,u){var g=(u.x-a.x)*(u.x-a.x)+(u.y-a.y)*(u.y-a.y),_=((a.y-r.y)*(u.x-a.x)-(a.x-r.x)*(u.y-a.y))/g;return Math.abs(_)*Math.sqrt(g)}},{key:"pointToSegmentString",value:function(r,a){if(a.length===0)throw new D("Line array must contain at least one vertex");for(var u=r.distance(a[0]),g=0;g<a.length-1;g++){var _=c.pointToSegment(r,a[g],a[g+1]);_<u&&(u=_)}return u}}])})(),O_=(function(){return l((function c(){s(this,c)}),[{key:"create",value:function(){if(arguments.length===1)arguments[0]instanceof Array||Vt(arguments[0],Kt);else if(arguments.length!==2){if(arguments.length===3){var c=arguments[0],r=arguments[1];return this.create(c,r)}}}}])})(),Ou=(function(){return l((function c(){s(this,c)}),[{key:"filter",value:function(c){}}])})(),lN=(function(){return l((function c(){s(this,c)}),null,[{key:"ofLine",value:function(c){var r=c.size();if(r<=1)return 0;var a=0,u=new K;c.getCoordinate(0,u);for(var g=u.x,_=u.y,E=1;E<r;E++){c.getCoordinate(E,u);var P=u.x,O=u.y,B=P-g,Z=O-_;a+=Math.sqrt(B*B+Z*Z),g=P,_=O}return a}}])})(),N_=l((function c(){s(this,c)})),Ur=(function(){function c(){s(this,c)}return l(c,null,[{key:"copyCoord",value:function(r,a,u,g){for(var _=Math.min(r.getDimension(),u.getDimension()),E=0;E<_;E++)u.setOrdinate(g,E,r.getOrdinate(a,E))}},{key:"isRing",value:function(r){var a=r.size();return a===0||!(a<=3)&&r.getOrdinate(0,Kt.X)===r.getOrdinate(a-1,Kt.X)&&r.getOrdinate(0,Kt.Y)===r.getOrdinate(a-1,Kt.Y)}},{key:"scroll",value:function(){if(arguments.length===2){if(Vt(arguments[0],Kt)&&Number.isInteger(arguments[1])){var r=arguments[0],a=arguments[1];c.scroll(r,a,c.isRing(r))}else if(Vt(arguments[0],Kt)&&arguments[1]instanceof K){var u=arguments[0],g=arguments[1],_=c.indexOf(g,u);if(_<=0)return null;c.scroll(u,_)}}else if(arguments.length===3){var E=arguments[0],P=arguments[1],O=arguments[2];if(P<=0)return null;for(var B=E.copy(),Z=O?E.size()-1:E.size(),tt=0;tt<Z;tt++)for(var ot=0;ot<E.getDimension();ot++)E.setOrdinate(tt,ot,B.getOrdinate((P+tt)%Z,ot));if(O)for(var Et=0;Et<E.getDimension();Et++)E.setOrdinate(Z,Et,E.getOrdinate(0,Et))}}},{key:"isEqual",value:function(r,a){var u=r.size();if(u!==a.size())return!1;for(var g=Math.min(r.getDimension(),a.getDimension()),_=0;_<u;_++)for(var E=0;E<g;E++){var P=r.getOrdinate(_,E),O=a.getOrdinate(_,E);if(r.getOrdinate(_,E)!==a.getOrdinate(_,E)&&(!J.isNaN(P)||!J.isNaN(O)))return!1}return!0}},{key:"minCoordinateIndex",value:function(){if(arguments.length===1){var r=arguments[0];return c.minCoordinateIndex(r,0,r.size()-1)}if(arguments.length===3){for(var a=arguments[0],u=arguments[2],g=-1,_=null,E=arguments[1];E<=u;E++){var P=a.getCoordinate(E);(_===null||_.compareTo(P)>0)&&(_=P,g=E)}return g}}},{key:"extend",value:function(r,a,u){var g=r.create(u,a.getDimension()),_=a.size();if(c.copy(a,0,g,0,_),_>0)for(var E=_;E<u;E++)c.copy(a,_-1,g,E,1);return g}},{key:"reverse",value:function(r){for(var a=r.size()-1,u=Math.trunc(a/2),g=0;g<=u;g++)c.swap(r,g,a-g)}},{key:"swap",value:function(r,a,u){if(a===u)return null;for(var g=0;g<r.getDimension();g++){var _=r.getOrdinate(a,g);r.setOrdinate(a,g,r.getOrdinate(u,g)),r.setOrdinate(u,g,_)}}},{key:"copy",value:function(r,a,u,g,_){for(var E=0;E<_;E++)c.copyCoord(r,a+E,u,g+E)}},{key:"ensureValidRing",value:function(r,a){var u=a.size();return u===0?a:u<=3?c.createClosedRing(r,a,4):a.getOrdinate(0,Kt.X)===a.getOrdinate(u-1,Kt.X)&&a.getOrdinate(0,Kt.Y)===a.getOrdinate(u-1,Kt.Y)?a:c.createClosedRing(r,a,u+1)}},{key:"indexOf",value:function(r,a){for(var u=0;u<a.size();u++)if(r.x===a.getOrdinate(u,Kt.X)&&r.y===a.getOrdinate(u,Kt.Y))return u;return-1}},{key:"createClosedRing",value:function(r,a,u){var g=r.create(u,a.getDimension()),_=a.size();c.copy(a,0,g,0,_);for(var E=_;E<u;E++)c.copy(a,0,g,E,1);return g}},{key:"minCoordinate",value:function(r){for(var a=null,u=0;u<r.size();u++){var g=r.getCoordinate(u);(a===null||a.compareTo(g)>0)&&(a=g)}return a}}])})(),pt=(function(){function c(){s(this,c)}return l(c,null,[{key:"toDimensionSymbol",value:function(r){switch(r){case c.FALSE:return c.SYM_FALSE;case c.TRUE:return c.SYM_TRUE;case c.DONTCARE:return c.SYM_DONTCARE;case c.P:return c.SYM_P;case c.L:return c.SYM_L;case c.A:return c.SYM_A}throw new D("Unknown dimension value: "+r)}},{key:"toDimensionValue",value:function(r){switch(Gg.toUpperCase(r)){case c.SYM_FALSE:return c.FALSE;case c.SYM_TRUE:return c.TRUE;case c.SYM_DONTCARE:return c.DONTCARE;case c.SYM_P:return c.P;case c.SYM_L:return c.L;case c.SYM_A:return c.A}throw new D("Unknown dimension symbol: "+r)}}])})();pt.P=0,pt.L=1,pt.A=2,pt.FALSE=-1,pt.TRUE=-2,pt.DONTCARE=-3,pt.SYM_FALSE="F",pt.SYM_TRUE="T",pt.SYM_DONTCARE="*",pt.SYM_P="0",pt.SYM_L="1",pt.SYM_A="2";var Nu=(function(){return l((function c(){s(this,c)}),[{key:"filter",value:function(c){}}])})(),Ru=(function(){return l((function c(){s(this,c)}),[{key:"filter",value:function(c,r){}},{key:"isDone",value:function(){}},{key:"isGeometryChanged",value:function(){}}])})(),Ah=(function(c){function r(){var a;return s(this,r),a=n(this,r),r.constructor_.apply(a,arguments),a}return m(r,c),l(r,[{key:"computeEnvelopeInternal",value:function(){return this.isEmpty()?new zt:this._points.expandEnvelope(new zt)}},{key:"isRing",value:function(){return this.isClosed()&&this.isSimple()}},{key:"getCoordinates",value:function(){return this._points.toCoordinateArray()}},{key:"copyInternal",value:function(){return new r(this._points.copy(),this._factory)}},{key:"equalsExact",value:function(){if(arguments.length===2&&typeof arguments[1]=="number"&&arguments[0]instanceof gt){var a=arguments[0],u=arguments[1];if(!this.isEquivalentClass(a))return!1;var g=a;if(this._points.size()!==g._points.size())return!1;for(var _=0;_<this._points.size();_++)if(!this.equal(this._points.getCoordinate(_),g._points.getCoordinate(_),u))return!1;return!0}return S(r,"equalsExact",this,1).apply(this,arguments)}},{key:"normalize",value:function(){for(var a=0;a<Math.trunc(this._points.size()/2);a++){var u=this._points.size()-1-a;if(!this._points.getCoordinate(a).equals(this._points.getCoordinate(u))){if(this._points.getCoordinate(a).compareTo(this._points.getCoordinate(u))>0){var g=this._points.copy();Ur.reverse(g),this._points=g}return null}}}},{key:"getCoordinate",value:function(){return this.isEmpty()?null:this._points.getCoordinate(0)}},{key:"getBoundaryDimension",value:function(){return this.isClosed()?pt.FALSE:0}},{key:"isClosed",value:function(){return!this.isEmpty()&&this.getCoordinateN(0).equals2D(this.getCoordinateN(this.getNumPoints()-1))}},{key:"reverseInternal",value:function(){var a=this._points.copy();return Ur.reverse(a),this.getFactory().createLineString(a)}},{key:"getEndPoint",value:function(){return this.isEmpty()?null:this.getPointN(this.getNumPoints()-1)}},{key:"getTypeCode",value:function(){return gt.TYPECODE_LINESTRING}},{key:"getDimension",value:function(){return 1}},{key:"getLength",value:function(){return lN.ofLine(this._points)}},{key:"getNumPoints",value:function(){return this._points.size()}},{key:"compareToSameClass",value:function(){if(arguments.length===1){for(var a=arguments[0],u=0,g=0;u<this._points.size()&&g<a._points.size();){var _=this._points.getCoordinate(u).compareTo(a._points.getCoordinate(g));if(_!==0)return _;u++,g++}return u<this._points.size()?1:g<a._points.size()?-1:0}if(arguments.length===2){var E=arguments[0];return arguments[1].compare(this._points,E._points)}}},{key:"apply",value:function(){if(Vt(arguments[0],Ou))for(var a=arguments[0],u=0;u<this._points.size();u++)a.filter(this._points.getCoordinate(u));else if(Vt(arguments[0],Ru)){var g=arguments[0];if(this._points.size()===0)return null;for(var _=0;_<this._points.size()&&(g.filter(this._points,_),!g.isDone());_++);g.isGeometryChanged()&&this.geometryChanged()}else Vt(arguments[0],Nu)?arguments[0].filter(this):Vt(arguments[0],L)&&arguments[0].filter(this)}},{key:"getBoundary",value:function(){throw new It}},{key:"isEquivalentClass",value:function(a){return a instanceof r}},{key:"getCoordinateN",value:function(a){return this._points.getCoordinate(a)}},{key:"getGeometryType",value:function(){return gt.TYPENAME_LINESTRING}},{key:"getCoordinateSequence",value:function(){return this._points}},{key:"isEmpty",value:function(){return this._points.size()===0}},{key:"init",value:function(a){if(a===null&&(a=this.getFactory().getCoordinateSequenceFactory().create([])),a.size()===1)throw new D("Invalid number of points in LineString (found "+a.size()+" - must be 0 or >= 2)");this._points=a}},{key:"isCoordinate",value:function(a){for(var u=0;u<this._points.size();u++)if(this._points.getCoordinate(u).equals(a))return!0;return!1}},{key:"getStartPoint",value:function(){return this.isEmpty()?null:this.getPointN(0)}},{key:"getPointN",value:function(a){return this.getFactory().createPoint(this._points.getCoordinate(a))}},{key:"interfaces_",get:function(){return[N_]}}],[{key:"constructor_",value:function(){if(this._points=null,arguments.length!==0){if(arguments.length===2){var a=arguments[0],u=arguments[1];gt.constructor_.call(this,u),this.init(a)}}}}])})(gt),R_=l((function c(){s(this,c)})),zg=(function(c){function r(){var a;return s(this,r),a=n(this,r),r.constructor_.apply(a,arguments),a}return m(r,c),l(r,[{key:"computeEnvelopeInternal",value:function(){if(this.isEmpty())return new zt;var a=new zt;return a.expandToInclude(this._coordinates.getX(0),this._coordinates.getY(0)),a}},{key:"getCoordinates",value:function(){return this.isEmpty()?[]:[this.getCoordinate()]}},{key:"copyInternal",value:function(){return new r(this._coordinates.copy(),this._factory)}},{key:"equalsExact",value:function(){if(arguments.length===2&&typeof arguments[1]=="number"&&arguments[0]instanceof gt){var a=arguments[0],u=arguments[1];return!!this.isEquivalentClass(a)&&(!(!this.isEmpty()||!a.isEmpty())||this.isEmpty()===a.isEmpty()&&this.equal(a.getCoordinate(),this.getCoordinate(),u))}return S(r,"equalsExact",this,1).apply(this,arguments)}},{key:"normalize",value:function(){}},{key:"getCoordinate",value:function(){return this._coordinates.size()!==0?this._coordinates.getCoordinate(0):null}},{key:"getBoundaryDimension",value:function(){return pt.FALSE}},{key:"reverseInternal",value:function(){return this.getFactory().createPoint(this._coordinates.copy())}},{key:"getTypeCode",value:function(){return gt.TYPECODE_POINT}},{key:"getDimension",value:function(){return 0}},{key:"getNumPoints",value:function(){return this.isEmpty()?0:1}},{key:"getX",value:function(){if(this.getCoordinate()===null)throw new IllegalStateException("getX called on empty Point");return this.getCoordinate().x}},{key:"compareToSameClass",value:function(){if(arguments.length===1){var a=arguments[0];return this.getCoordinate().compareTo(a.getCoordinate())}if(arguments.length===2){var u=arguments[0];return arguments[1].compare(this._coordinates,u._coordinates)}}},{key:"apply",value:function(){if(Vt(arguments[0],Ou)){var a=arguments[0];if(this.isEmpty())return null;a.filter(this.getCoordinate())}else if(Vt(arguments[0],Ru)){var u=arguments[0];if(this.isEmpty())return null;u.filter(this._coordinates,0),u.isGeometryChanged()&&this.geometryChanged()}else Vt(arguments[0],Nu)?arguments[0].filter(this):Vt(arguments[0],L)&&arguments[0].filter(this)}},{key:"getBoundary",value:function(){return this.getFactory().createGeometryCollection()}},{key:"getGeometryType",value:function(){return gt.TYPENAME_POINT}},{key:"getCoordinateSequence",value:function(){return this._coordinates}},{key:"getY",value:function(){if(this.getCoordinate()===null)throw new IllegalStateException("getY called on empty Point");return this.getCoordinate().y}},{key:"isEmpty",value:function(){return this._coordinates.size()===0}},{key:"init",value:function(a){a===null&&(a=this.getFactory().getCoordinateSequenceFactory().create([])),ct.isTrue(a.size()<=1),this._coordinates=a}},{key:"isSimple",value:function(){return!0}},{key:"interfaces_",get:function(){return[R_]}}],[{key:"constructor_",value:function(){this._coordinates=null;var a=arguments[0],u=arguments[1];gt.constructor_.call(this,u),this.init(a)}}])})(gt),A_=(function(){function c(){s(this,c)}return l(c,null,[{key:"ofRing",value:function(){if(arguments[0]instanceof Array){var r=arguments[0];return Math.abs(c.ofRingSigned(r))}if(Vt(arguments[0],Kt)){var a=arguments[0];return Math.abs(c.ofRingSigned(a))}}},{key:"ofRingSigned",value:function(){if(arguments[0]instanceof Array){var r=arguments[0];if(r.length<3)return 0;for(var a=0,u=r[0].x,g=1;g<r.length-1;g++){var _=r[g].x-u,E=r[g+1].y;a+=_*(r[g-1].y-E)}return a/2}if(Vt(arguments[0],Kt)){var P=arguments[0],O=P.size();if(O<3)return 0;var B=new K,Z=new K,tt=new K;P.getCoordinate(0,Z),P.getCoordinate(1,tt);var ot=Z.x;tt.x-=ot;for(var Et=0,Nt=1;Nt<O-1;Nt++)B.y=Z.y,Z.x=tt.x,Z.y=tt.y,P.getCoordinate(Nt+1,tt),tt.x-=ot,Et+=Z.x*(B.y-tt.y);return Et/2}}}])})(),Vr=(function(){return l((function c(){s(this,c)}),null,[{key:"sort",value:function(){var c=arguments,r=arguments[0];if(arguments.length===1)r.sort((function(ot,Et){return ot.compareTo(Et)}));else if(arguments.length===2)r.sort((function(ot,Et){return c[1].compare(ot,Et)}));else if(arguments.length===3){var a=r.slice(arguments[1],arguments[2]);a.sort();var u=r.slice(0,arguments[1]).concat(a,r.slice(arguments[2],r.length));r.splice(0,r.length);var g,_=d(u);try{for(_.s();!(g=_.n()).done;){var E=g.value;r.push(E)}}catch(ot){_.e(ot)}finally{_.f()}}else if(arguments.length===4){var P=r.slice(arguments[1],arguments[2]);P.sort((function(ot,Et){return c[3].compare(ot,Et)}));var O=r.slice(0,arguments[1]).concat(P,r.slice(arguments[2],r.length));r.splice(0,r.length);var B,Z=d(O);try{for(Z.s();!(B=Z.n()).done;){var tt=B.value;r.push(tt)}}catch(ot){Z.e(ot)}finally{Z.f()}}}},{key:"asList",value:function(c){var r,a=new Gt,u=d(c);try{for(u.s();!(r=u.n()).done;){var g=r.value;a.add(g)}}catch(_){u.e(_)}finally{u.f()}return a}},{key:"copyOf",value:function(c,r){return c.slice(0,r)}}])})(),D_=l((function c(){s(this,c)})),Au=(function(c){function r(){var a;return s(this,r),a=n(this,r),r.constructor_.apply(a,arguments),a}return m(r,c),l(r,[{key:"computeEnvelopeInternal",value:function(){return this._shell.getEnvelopeInternal()}},{key:"getCoordinates",value:function(){if(this.isEmpty())return[];for(var a=new Array(this.getNumPoints()).fill(null),u=-1,g=this._shell.getCoordinates(),_=0;_<g.length;_++)a[++u]=g[_];for(var E=0;E<this._holes.length;E++)for(var P=this._holes[E].getCoordinates(),O=0;O<P.length;O++)a[++u]=P[O];return a}},{key:"getArea",value:function(){var a=0;a+=A_.ofRing(this._shell.getCoordinateSequence());for(var u=0;u<this._holes.length;u++)a-=A_.ofRing(this._holes[u].getCoordinateSequence());return a}},{key:"copyInternal",value:function(){for(var a=this._shell.copy(),u=new Array(this._holes.length).fill(null),g=0;g<this._holes.length;g++)u[g]=this._holes[g].copy();return new r(a,u,this._factory)}},{key:"isRectangle",value:function(){if(this.getNumInteriorRing()!==0||this._shell===null||this._shell.getNumPoints()!==5)return!1;for(var a=this._shell.getCoordinateSequence(),u=this.getEnvelopeInternal(),g=0;g<5;g++){var _=a.getX(g);if(_!==u.getMinX()&&_!==u.getMaxX())return!1;var E=a.getY(g);if(E!==u.getMinY()&&E!==u.getMaxY())return!1}for(var P=a.getX(0),O=a.getY(0),B=1;B<=4;B++){var Z=a.getX(B),tt=a.getY(B);if(Z!==P==(tt!==O))return!1;P=Z,O=tt}return!0}},{key:"equalsExact",value:function(){if(arguments.length===2&&typeof arguments[1]=="number"&&arguments[0]instanceof gt){var a=arguments[0],u=arguments[1];if(!this.isEquivalentClass(a))return!1;var g=a,_=this._shell,E=g._shell;if(!_.equalsExact(E,u)||this._holes.length!==g._holes.length)return!1;for(var P=0;P<this._holes.length;P++)if(!this._holes[P].equalsExact(g._holes[P],u))return!1;return!0}return S(r,"equalsExact",this,1).apply(this,arguments)}},{key:"normalize",value:function(){if(arguments.length===0){this._shell=this.normalized(this._shell,!0);for(var a=0;a<this._holes.length;a++)this._holes[a]=this.normalized(this._holes[a],!1);Vr.sort(this._holes)}else if(arguments.length===2){var u=arguments[0],g=arguments[1];if(u.isEmpty())return null;var _=u.getCoordinateSequence(),E=Ur.minCoordinateIndex(_,0,_.size()-2);Ur.scroll(_,E,!0),Ut.isCCW(_)===g&&Ur.reverse(_)}}},{key:"getCoordinate",value:function(){return this._shell.getCoordinate()}},{key:"getNumInteriorRing",value:function(){return this._holes.length}},{key:"getBoundaryDimension",value:function(){return 1}},{key:"reverseInternal",value:function(){for(var a=this.getExteriorRing().reverse(),u=new Array(this.getNumInteriorRing()).fill(null),g=0;g<u.length;g++)u[g]=this.getInteriorRingN(g).reverse();return this.getFactory().createPolygon(a,u)}},{key:"getTypeCode",value:function(){return gt.TYPECODE_POLYGON}},{key:"getDimension",value:function(){return 2}},{key:"getLength",value:function(){var a=0;a+=this._shell.getLength();for(var u=0;u<this._holes.length;u++)a+=this._holes[u].getLength();return a}},{key:"getNumPoints",value:function(){for(var a=this._shell.getNumPoints(),u=0;u<this._holes.length;u++)a+=this._holes[u].getNumPoints();return a}},{key:"convexHull",value:function(){return this.getExteriorRing().convexHull()}},{key:"normalized",value:function(a,u){var g=a.copy();return this.normalize(g,u),g}},{key:"compareToSameClass",value:function(){if(arguments.length===1){var a=arguments[0],u=this._shell,g=a._shell;return u.compareToSameClass(g)}if(arguments.length===2){var _=arguments[1],E=arguments[0],P=this._shell,O=E._shell,B=P.compareToSameClass(O,_);if(B!==0)return B;for(var Z=this.getNumInteriorRing(),tt=E.getNumInteriorRing(),ot=0;ot<Z&&ot<tt;){var Et=this.getInteriorRingN(ot),Nt=E.getInteriorRingN(ot),Dt=Et.compareToSameClass(Nt,_);if(Dt!==0)return Dt;ot++}return ot<Z?1:ot<tt?-1:0}}},{key:"apply",value:function(){if(Vt(arguments[0],Ou)){var a=arguments[0];this._shell.apply(a);for(var u=0;u<this._holes.length;u++)this._holes[u].apply(a)}else if(Vt(arguments[0],Ru)){var g=arguments[0];if(this._shell.apply(g),!g.isDone())for(var _=0;_<this._holes.length&&(this._holes[_].apply(g),!g.isDone());_++);g.isGeometryChanged()&&this.geometryChanged()}else if(Vt(arguments[0],Nu))arguments[0].filter(this);else if(Vt(arguments[0],L)){var E=arguments[0];E.filter(this),this._shell.apply(E);for(var P=0;P<this._holes.length;P++)this._holes[P].apply(E)}}},{key:"getBoundary",value:function(){if(this.isEmpty())return this.getFactory().createMultiLineString();var a=new Array(this._holes.length+1).fill(null);a[0]=this._shell;for(var u=0;u<this._holes.length;u++)a[u+1]=this._holes[u];return a.length<=1?this.getFactory().createLinearRing(a[0].getCoordinateSequence()):this.getFactory().createMultiLineString(a)}},{key:"getGeometryType",value:function(){return gt.TYPENAME_POLYGON}},{key:"getExteriorRing",value:function(){return this._shell}},{key:"isEmpty",value:function(){return this._shell.isEmpty()}},{key:"getInteriorRingN",value:function(a){return this._holes[a]}},{key:"interfaces_",get:function(){return[D_]}}],[{key:"constructor_",value:function(){this._shell=null,this._holes=null;var a=arguments[0],u=arguments[1],g=arguments[2];if(gt.constructor_.call(this,g),a===null&&(a=this.getFactory().createLinearRing()),u===null&&(u=[]),gt.hasNullElements(u))throw new D("holes must not contain null elements");if(a.isEmpty()&>.hasNonEmptyElements(u))throw new D("shell is empty but holes are not");this._shell=a,this._holes=u}}])})(gt),uN=(function(c){function r(){return s(this,r),n(this,r,arguments)}return m(r,c),l(r)})(re),L_=(function(c){function r(a){var u;return s(this,r),(u=n(this,r)).array=[],a instanceof at&&u.addAll(a),u}return m(r,c),l(r,[{key:"contains",value:function(a){var u,g=d(this.array);try{for(g.s();!(u=g.n()).done;)if(u.value.compareTo(a)===0)return!0}catch(_){g.e(_)}finally{g.f()}return!1}},{key:"add",value:function(a){if(this.contains(a))return!1;for(var u=0,g=this.array.length;u<g;u++)if(this.array[u].compareTo(a)===1)return!!this.array.splice(u,0,a);return this.array.push(a),!0}},{key:"addAll",value:function(a){var u,g=d(a);try{for(g.s();!(u=g.n()).done;){var _=u.value;this.add(_)}}catch(E){g.e(E)}finally{g.f()}return!0}},{key:"remove",value:function(){throw new It}},{key:"size",value:function(){return this.array.length}},{key:"isEmpty",value:function(){return this.array.length===0}},{key:"toArray",value:function(){return this.array.slice()}},{key:"iterator",value:function(){return new cN(this.array)}}])})(uN),cN=(function(){return l((function c(r){s(this,c),this.array=r,this.position=0}),[{key:"next",value:function(){if(this.position===this.array.length)throw new Pt;return this.array[this.position++]}},{key:"hasNext",value:function(){return this.position<this.array.length}},{key:"remove",value:function(){throw new It}}])})(),Oi=(function(c){function r(){var a;return s(this,r),a=n(this,r),r.constructor_.apply(a,arguments),a}return m(r,c),l(r,[{key:"computeEnvelopeInternal",value:function(){for(var a=new zt,u=0;u<this._geometries.length;u++)a.expandToInclude(this._geometries[u].getEnvelopeInternal());return a}},{key:"getGeometryN",value:function(a){return this._geometries[a]}},{key:"getCoordinates",value:function(){for(var a=new Array(this.getNumPoints()).fill(null),u=-1,g=0;g<this._geometries.length;g++)for(var _=this._geometries[g].getCoordinates(),E=0;E<_.length;E++)a[++u]=_[E];return a}},{key:"getArea",value:function(){for(var a=0,u=0;u<this._geometries.length;u++)a+=this._geometries[u].getArea();return a}},{key:"copyInternal",value:function(){for(var a=new Array(this._geometries.length).fill(null),u=0;u<a.length;u++)a[u]=this._geometries[u].copy();return new r(a,this._factory)}},{key:"equalsExact",value:function(){if(arguments.length===2&&typeof arguments[1]=="number"&&arguments[0]instanceof gt){var a=arguments[0],u=arguments[1];if(!this.isEquivalentClass(a))return!1;var g=a;if(this._geometries.length!==g._geometries.length)return!1;for(var _=0;_<this._geometries.length;_++)if(!this._geometries[_].equalsExact(g._geometries[_],u))return!1;return!0}return S(r,"equalsExact",this,1).apply(this,arguments)}},{key:"normalize",value:function(){for(var a=0;a<this._geometries.length;a++)this._geometries[a].normalize();Vr.sort(this._geometries)}},{key:"getCoordinate",value:function(){return this.isEmpty()?null:this._geometries[0].getCoordinate()}},{key:"getBoundaryDimension",value:function(){for(var a=pt.FALSE,u=0;u<this._geometries.length;u++)a=Math.max(a,this._geometries[u].getBoundaryDimension());return a}},{key:"reverseInternal",value:function(){for(var a=this._geometries.length,u=new Gt(a),g=0;g<a;g++)u.add(this._geometries[g].reverse());return this.getFactory().buildGeometry(u)}},{key:"getTypeCode",value:function(){return gt.TYPECODE_GEOMETRYCOLLECTION}},{key:"getDimension",value:function(){for(var a=pt.FALSE,u=0;u<this._geometries.length;u++)a=Math.max(a,this._geometries[u].getDimension());return a}},{key:"getLength",value:function(){for(var a=0,u=0;u<this._geometries.length;u++)a+=this._geometries[u].getLength();return a}},{key:"getNumPoints",value:function(){for(var a=0,u=0;u<this._geometries.length;u++)a+=this._geometries[u].getNumPoints();return a}},{key:"getNumGeometries",value:function(){return this._geometries.length}},{key:"compareToSameClass",value:function(){if(arguments.length===1){var a=arguments[0],u=new L_(Vr.asList(this._geometries)),g=new L_(Vr.asList(a._geometries));return this.compare(u,g)}if(arguments.length===2){for(var _=arguments[1],E=arguments[0],P=this.getNumGeometries(),O=E.getNumGeometries(),B=0;B<P&&B<O;){var Z=this.getGeometryN(B),tt=E.getGeometryN(B),ot=Z.compareToSameClass(tt,_);if(ot!==0)return ot;B++}return B<P?1:B<O?-1:0}}},{key:"apply",value:function(){if(Vt(arguments[0],Ou))for(var a=arguments[0],u=0;u<this._geometries.length;u++)this._geometries[u].apply(a);else if(Vt(arguments[0],Ru)){var g=arguments[0];if(this._geometries.length===0)return null;for(var _=0;_<this._geometries.length&&(this._geometries[_].apply(g),!g.isDone());_++);g.isGeometryChanged()&&this.geometryChanged()}else if(Vt(arguments[0],Nu)){var E=arguments[0];E.filter(this);for(var P=0;P<this._geometries.length;P++)this._geometries[P].apply(E)}else if(Vt(arguments[0],L)){var O=arguments[0];O.filter(this);for(var B=0;B<this._geometries.length;B++)this._geometries[B].apply(O)}}},{key:"getBoundary",value:function(){return gt.checkNotGeometryCollection(this),ct.shouldNeverReachHere(),null}},{key:"getGeometryType",value:function(){return gt.TYPENAME_GEOMETRYCOLLECTION}},{key:"isEmpty",value:function(){for(var a=0;a<this._geometries.length;a++)if(!this._geometries[a].isEmpty())return!1;return!0}}],[{key:"constructor_",value:function(){if(this._geometries=null,arguments.length!==0){if(arguments.length===2){var a=arguments[0],u=arguments[1];if(gt.constructor_.call(this,u),a===null&&(a=[]),gt.hasNullElements(a))throw new D("geometries must not contain null elements");this._geometries=a}}}}])})(gt),Ug=(function(c){function r(){var a;return s(this,r),a=n(this,r),r.constructor_.apply(a,arguments),a}return m(r,c),l(r,[{key:"copyInternal",value:function(){for(var a=new Array(this._geometries.length).fill(null),u=0;u<a.length;u++)a[u]=this._geometries[u].copy();return new r(a,this._factory)}},{key:"isValid",value:function(){return!0}},{key:"equalsExact",value:function(){if(arguments.length===2&&typeof arguments[1]=="number"&&arguments[0]instanceof gt){var a=arguments[0],u=arguments[1];return!!this.isEquivalentClass(a)&&S(r,"equalsExact",this,1).call(this,a,u)}return S(r,"equalsExact",this,1).apply(this,arguments)}},{key:"getCoordinate",value:function(){if(arguments.length===1&&Number.isInteger(arguments[0])){var a=arguments[0];return this._geometries[a].getCoordinate()}return S(r,"getCoordinate",this,1).apply(this,arguments)}},{key:"getBoundaryDimension",value:function(){return pt.FALSE}},{key:"getTypeCode",value:function(){return gt.TYPECODE_MULTIPOINT}},{key:"getDimension",value:function(){return 0}},{key:"getBoundary",value:function(){return this.getFactory().createGeometryCollection()}},{key:"getGeometryType",value:function(){return gt.TYPENAME_MULTIPOINT}},{key:"interfaces_",get:function(){return[R_]}}],[{key:"constructor_",value:function(){var a=arguments[0],u=arguments[1];Oi.constructor_.call(this,a,u)}}])})(Oi),Dh=(function(c){function r(){var a;return s(this,r),a=n(this,r),r.constructor_.apply(a,arguments),a}return m(r,c),l(r,[{key:"copyInternal",value:function(){return new r(this._points.copy(),this._factory)}},{key:"getBoundaryDimension",value:function(){return pt.FALSE}},{key:"isClosed",value:function(){return!!this.isEmpty()||S(r,"isClosed",this,1).call(this)}},{key:"reverseInternal",value:function(){var a=this._points.copy();return Ur.reverse(a),this.getFactory().createLinearRing(a)}},{key:"getTypeCode",value:function(){return gt.TYPECODE_LINEARRING}},{key:"validateConstruction",value:function(){if(!this.isEmpty()&&!S(r,"isClosed",this,1).call(this))throw new D("Points of LinearRing do not form a closed linestring");if(this.getCoordinateSequence().size()>=1&&this.getCoordinateSequence().size()<r.MINIMUM_VALID_SIZE)throw new D("Invalid number of points in LinearRing (found "+this.getCoordinateSequence().size()+" - must be 0 or >= 4)")}},{key:"getGeometryType",value:function(){return gt.TYPENAME_LINEARRING}}],[{key:"constructor_",value:function(){var a=arguments[0],u=arguments[1];Ah.constructor_.call(this,a,u),this.validateConstruction()}}])})(Ah);Dh.MINIMUM_VALID_SIZE=4;var qr=(function(c){function r(){var a;return s(this,r),a=n(this,r),r.constructor_.apply(a,arguments),a}return m(r,c),l(r,[{key:"setOrdinate",value:function(a,u){switch(a){case r.X:this.x=u;break;case r.Y:this.y=u;break;default:throw new D("Invalid ordinate index: "+a)}}},{key:"getZ",value:function(){return K.NULL_ORDINATE}},{key:"getOrdinate",value:function(a){switch(a){case r.X:return this.x;case r.Y:return this.y}throw new D("Invalid ordinate index: "+a)}},{key:"setZ",value:function(a){throw new D("CoordinateXY dimension 2 does not support z-ordinate")}},{key:"copy",value:function(){return new r(this)}},{key:"toString",value:function(){return"("+this.x+", "+this.y+")"}},{key:"setCoordinate",value:function(a){this.x=a.x,this.y=a.y,this.z=a.getZ()}}],[{key:"constructor_",value:function(){if(arguments.length===0)K.constructor_.call(this);else if(arguments.length===1){if(arguments[0]instanceof r){var a=arguments[0];K.constructor_.call(this,a.x,a.y)}else if(arguments[0]instanceof K){var u=arguments[0];K.constructor_.call(this,u.x,u.y)}}else if(arguments.length===2){var g=arguments[0],_=arguments[1];K.constructor_.call(this,g,_,K.NULL_ORDINATE)}}}])})(K);qr.X=0,qr.Y=1,qr.Z=-1,qr.M=-1;var $r=(function(c){function r(){var a;return s(this,r),a=n(this,r),r.constructor_.apply(a,arguments),a}return m(r,c),l(r,[{key:"getM",value:function(){return this._m}},{key:"setOrdinate",value:function(a,u){switch(a){case r.X:this.x=u;break;case r.Y:this.y=u;break;case r.M:this._m=u;break;default:throw new D("Invalid ordinate index: "+a)}}},{key:"setM",value:function(a){this._m=a}},{key:"getZ",value:function(){return K.NULL_ORDINATE}},{key:"getOrdinate",value:function(a){switch(a){case r.X:return this.x;case r.Y:return this.y;case r.M:return this._m}throw new D("Invalid ordinate index: "+a)}},{key:"setZ",value:function(a){throw new D("CoordinateXY dimension 2 does not support z-ordinate")}},{key:"copy",value:function(){return new r(this)}},{key:"toString",value:function(){return"("+this.x+", "+this.y+" m="+this.getM()+")"}},{key:"setCoordinate",value:function(a){this.x=a.x,this.y=a.y,this.z=a.getZ(),this._m=a.getM()}}],[{key:"constructor_",value:function(){if(this._m=null,arguments.length===0)K.constructor_.call(this),this._m=0;else if(arguments.length===1){if(arguments[0]instanceof r){var a=arguments[0];K.constructor_.call(this,a.x,a.y),this._m=a._m}else if(arguments[0]instanceof K){var u=arguments[0];K.constructor_.call(this,u.x,u.y),this._m=this.getM()}}else if(arguments.length===3){var g=arguments[0],_=arguments[1],E=arguments[2];K.constructor_.call(this,g,_,K.NULL_ORDINATE),this._m=E}}}])})(K);$r.X=0,$r.Y=1,$r.Z=-1,$r.M=2;var Vg=(function(c){function r(){var a;return s(this,r),a=n(this,r),r.constructor_.apply(a,arguments),a}return m(r,c),l(r,[{key:"getM",value:function(){return this._m}},{key:"setOrdinate",value:function(a,u){switch(a){case K.X:this.x=u;break;case K.Y:this.y=u;break;case K.Z:this.z=u;break;case K.M:this._m=u;break;default:throw new D("Invalid ordinate index: "+a)}}},{key:"setM",value:function(a){this._m=a}},{key:"getOrdinate",value:function(a){switch(a){case K.X:return this.x;case K.Y:return this.y;case K.Z:return this.getZ();case K.M:return this.getM()}throw new D("Invalid ordinate index: "+a)}},{key:"copy",value:function(){return new r(this)}},{key:"toString",value:function(){return"("+this.x+", "+this.y+", "+this.getZ()+" m="+this.getM()+")"}},{key:"setCoordinate",value:function(a){this.x=a.x,this.y=a.y,this.z=a.getZ(),this._m=a.getM()}}],[{key:"constructor_",value:function(){if(this._m=null,arguments.length===0)K.constructor_.call(this),this._m=0;else if(arguments.length===1){if(arguments[0]instanceof r){var a=arguments[0];K.constructor_.call(this,a),this._m=a._m}else if(arguments[0]instanceof K){var u=arguments[0];K.constructor_.call(this,u),this._m=this.getM()}}else if(arguments.length===4){var g=arguments[0],_=arguments[1],E=arguments[2],P=arguments[3];K.constructor_.call(this,g,_,E),this._m=P}}}])})(K),Du=(function(){function c(){s(this,c)}return l(c,null,[{key:"measures",value:function(r){return r instanceof qr?0:r instanceof $r||r instanceof Vg?1:0}},{key:"dimension",value:function(r){return r instanceof qr?2:r instanceof $r?3:r instanceof Vg?4:3}},{key:"create",value:function(){if(arguments.length===1){var r=arguments[0];return c.create(r,0)}if(arguments.length===2){var a=arguments[0],u=arguments[1];return a===2?new qr:a===3&&u===0?new K:a===3&&u===1?new $r:a===4&&u===1?new Vg:new K}}}])})(),Lh=(function(c){function r(){var a;return s(this,r),a=n(this,r),r.constructor_.apply(a,arguments),a}return m(r,c),l(r,[{key:"getCoordinate",value:function(a){return this.get(a)}},{key:"addAll",value:function(){if(arguments.length===2&&typeof arguments[1]=="boolean"&&Vt(arguments[0],at)){for(var a=arguments[1],u=!1,g=arguments[0].iterator();g.hasNext();)this.add(g.next(),a),u=!0;return u}return S(r,"addAll",this,1).apply(this,arguments)}},{key:"clone",value:function(){for(var a=S(r,"clone",this,1).call(this),u=0;u<this.size();u++)a.add(u,this.get(u).clone());return a}},{key:"toCoordinateArray",value:function(){if(arguments.length===0)return this.toArray(r.coordArrayType);if(arguments.length===1){if(arguments[0])return this.toArray(r.coordArrayType);for(var a=this.size(),u=new Array(a).fill(null),g=0;g<a;g++)u[g]=this.get(a-g-1);return u}}},{key:"add",value:function(){if(arguments.length===1){var a=arguments[0];return S(r,"add",this,1).call(this,a)}if(arguments.length===2){if(arguments[0]instanceof Array&&typeof arguments[1]=="boolean"){var u=arguments[0],g=arguments[1];return this.add(u,g,!0),!0}if(arguments[0]instanceof K&&typeof arguments[1]=="boolean"){var _=arguments[0];if(!arguments[1]&&this.size()>=1&&this.get(this.size()-1).equals2D(_))return null;S(r,"add",this,1).call(this,_)}else if(arguments[0]instanceof Object&&typeof arguments[1]=="boolean"){var E=arguments[0],P=arguments[1];return this.add(E,P),!0}}else if(arguments.length===3){if(typeof arguments[2]=="boolean"&&arguments[0]instanceof Array&&typeof arguments[1]=="boolean"){var O=arguments[0],B=arguments[1];if(arguments[2])for(var Z=0;Z<O.length;Z++)this.add(O[Z],B);else for(var tt=O.length-1;tt>=0;tt--)this.add(O[tt],B);return!0}if(typeof arguments[2]=="boolean"&&Number.isInteger(arguments[0])&&arguments[1]instanceof K){var ot=arguments[0],Et=arguments[1];if(!arguments[2]){var Nt=this.size();if(Nt>0&&(ot>0&&this.get(ot-1).equals2D(Et)||ot<Nt&&this.get(ot).equals2D(Et)))return null}S(r,"add",this,1).call(this,ot,Et)}}else if(arguments.length===4){var Dt=arguments[0],Zt=arguments[1],Yt=arguments[2],oe=arguments[3],qe=1;Yt>oe&&(qe=-1);for(var ti=Yt;ti!==oe;ti+=qe)this.add(Dt[ti],Zt);return!0}}},{key:"closeRing",value:function(){if(this.size()>0){var a=this.get(0).copy();this.add(a,!1)}}}],[{key:"constructor_",value:function(){if(arguments.length!==0){if(arguments.length===1){var a=arguments[0];this.ensureCapacity(a.length),this.add(a,!0)}else if(arguments.length===2){var u=arguments[0],g=arguments[1];this.ensureCapacity(u.length),this.add(u,g)}}}}])})(Gt);Lh.coordArrayType=new Array(0).fill(null);var De=(function(){function c(){s(this,c)}return l(c,null,[{key:"isRing",value:function(r){return!(r.length<4)&&!!r[0].equals2D(r[r.length-1])}},{key:"ptNotInList",value:function(r,a){for(var u=0;u<r.length;u++){var g=r[u];if(c.indexOf(g,a)<0)return g}return null}},{key:"scroll",value:function(r,a){var u=c.indexOf(a,r);if(u<0)return null;var g=new Array(r.length).fill(null);Yi.arraycopy(r,u,g,0,r.length-u),Yi.arraycopy(r,0,g,r.length-u,u),Yi.arraycopy(g,0,r,0,r.length)}},{key:"equals",value:function(){if(arguments.length===2){var r=arguments[0],a=arguments[1];if(r===a)return!0;if(r===null||a===null||r.length!==a.length)return!1;for(var u=0;u<r.length;u++)if(!r[u].equals(a[u]))return!1;return!0}if(arguments.length===3){var g=arguments[0],_=arguments[1],E=arguments[2];if(g===_)return!0;if(g===null||_===null||g.length!==_.length)return!1;for(var P=0;P<g.length;P++)if(E.compare(g[P],_[P])!==0)return!1;return!0}}},{key:"intersection",value:function(r,a){for(var u=new Lh,g=0;g<r.length;g++)a.intersects(r[g])&&u.add(r[g],!0);return u.toCoordinateArray()}},{key:"measures",value:function(r){if(r===null||r.length===0)return 0;var a,u=0,g=d(r);try{for(g.s();!(a=g.n()).done;){var _=a.value;u=Math.max(u,Du.measures(_))}}catch(E){g.e(E)}finally{g.f()}return u}},{key:"hasRepeatedPoints",value:function(r){for(var a=1;a<r.length;a++)if(r[a-1].equals(r[a]))return!0;return!1}},{key:"removeRepeatedPoints",value:function(r){return c.hasRepeatedPoints(r)?new Lh(r,!1).toCoordinateArray():r}},{key:"reverse",value:function(r){for(var a=r.length-1,u=Math.trunc(a/2),g=0;g<=u;g++){var _=r[g];r[g]=r[a-g],r[a-g]=_}}},{key:"removeNull",value:function(r){for(var a=0,u=0;u<r.length;u++)r[u]!==null&&a++;var g=new Array(a).fill(null);if(a===0)return g;for(var _=0,E=0;E<r.length;E++)r[E]!==null&&(g[_++]=r[E]);return g}},{key:"copyDeep",value:function(){if(arguments.length===1){for(var r=arguments[0],a=new Array(r.length).fill(null),u=0;u<r.length;u++)a[u]=r[u].copy();return a}if(arguments.length===5)for(var g=arguments[0],_=arguments[1],E=arguments[2],P=arguments[3],O=arguments[4],B=0;B<O;B++)E[P+B]=g[_+B].copy()}},{key:"isEqualReversed",value:function(r,a){for(var u=0;u<r.length;u++){var g=r[u],_=a[r.length-u-1];if(g.compareTo(_)!==0)return!1}return!0}},{key:"envelope",value:function(r){for(var a=new zt,u=0;u<r.length;u++)a.expandToInclude(r[u]);return a}},{key:"toCoordinateArray",value:function(r){return r.toArray(c.coordArrayType)}},{key:"dimension",value:function(r){if(r===null||r.length===0)return 3;var a,u=0,g=d(r);try{for(g.s();!(a=g.n()).done;){var _=a.value;u=Math.max(u,Du.dimension(_))}}catch(E){g.e(E)}finally{g.f()}return u}},{key:"atLeastNCoordinatesOrNothing",value:function(r,a){return a.length>=r?a:[]}},{key:"indexOf",value:function(r,a){for(var u=0;u<a.length;u++)if(r.equals(a[u]))return u;return-1}},{key:"increasingDirection",value:function(r){for(var a=0;a<Math.trunc(r.length/2);a++){var u=r.length-1-a,g=r[a].compareTo(r[u]);if(g!==0)return g}return 1}},{key:"compare",value:function(r,a){for(var u=0;u<r.length&&u<a.length;){var g=r[u].compareTo(a[u]);if(g!==0)return g;u++}return u<a.length?-1:u<r.length?1:0}},{key:"minCoordinate",value:function(r){for(var a=null,u=0;u<r.length;u++)(a===null||a.compareTo(r[u])>0)&&(a=r[u]);return a}},{key:"extract",value:function(r,a,u){a=Rh.clamp(a,0,r.length);var g=(u=Rh.clamp(u,-1,r.length))-a+1;u<0&&(g=0),a>=r.length&&(g=0),u<a&&(g=0);var _=new Array(g).fill(null);if(g===0)return _;for(var E=0,P=a;P<=u;P++)_[E++]=r[P];return _}}])})(),dN=(function(){return l((function c(){s(this,c)}),[{key:"compare",value:function(c,r){var a=c,u=r;return De.compare(a,u)}},{key:"interfaces_",get:function(){return[rt]}}])})(),fN=(function(){return l((function c(){s(this,c)}),[{key:"compare",value:function(c,r){var a=c,u=r;if(a.length<u.length)return-1;if(a.length>u.length)return 1;if(a.length===0)return 0;var g=De.compare(a,u);return De.isEqualReversed(a,u)?0:g}},{key:"OLDcompare",value:function(c,r){var a=c,u=r;if(a.length<u.length)return-1;if(a.length>u.length)return 1;if(a.length===0)return 0;for(var g=De.increasingDirection(a),_=De.increasingDirection(u),E=g>0?0:a.length-1,P=_>0?0:a.length-1,O=0;O<a.length;O++){var B=a[E].compareTo(u[P]);if(B!==0)return B;E+=g,P+=_}return 0}},{key:"interfaces_",get:function(){return[rt]}}])})();De.ForwardComparator=dN,De.BidirectionalComparator=fN,De.coordArrayType=new Array(0).fill(null);var Lu=(function(){return l((function c(r){s(this,c),this.str=r}),[{key:"append",value:function(c){this.str+=c}},{key:"setCharAt",value:function(c,r){this.str=this.str.substr(0,c)+r+this.str.substr(c+1)}},{key:"toString",value:function(){return this.str}}])})(),Fh=(function(){function c(){s(this,c),c.constructor_.apply(this,arguments)}return l(c,[{key:"getM",value:function(r){return this.hasM()?this._coordinates[r].getM():J.NaN}},{key:"setOrdinate",value:function(r,a,u){switch(a){case Kt.X:this._coordinates[r].x=u;break;case Kt.Y:this._coordinates[r].y=u;break;default:this._coordinates[r].setOrdinate(a,u)}}},{key:"getZ",value:function(r){return this.hasZ()?this._coordinates[r].getZ():J.NaN}},{key:"size",value:function(){return this._coordinates.length}},{key:"getOrdinate",value:function(r,a){switch(a){case Kt.X:return this._coordinates[r].x;case Kt.Y:return this._coordinates[r].y;default:return this._coordinates[r].getOrdinate(a)}}},{key:"getCoordinate",value:function(){if(arguments.length===1){var r=arguments[0];return this._coordinates[r]}if(arguments.length===2){var a=arguments[0];arguments[1].setCoordinate(this._coordinates[a])}}},{key:"getCoordinateCopy",value:function(r){var a=this.createCoordinate();return a.setCoordinate(this._coordinates[r]),a}},{key:"createCoordinate",value:function(){return Du.create(this.getDimension(),this.getMeasures())}},{key:"getDimension",value:function(){return this._dimension}},{key:"getX",value:function(r){return this._coordinates[r].x}},{key:"getMeasures",value:function(){return this._measures}},{key:"expandEnvelope",value:function(r){for(var a=0;a<this._coordinates.length;a++)r.expandToInclude(this._coordinates[a]);return r}},{key:"copy",value:function(){for(var r=new Array(this.size()).fill(null),a=0;a<this._coordinates.length;a++){var u=this.createCoordinate();u.setCoordinate(this._coordinates[a]),r[a]=u}return new c(r,this._dimension,this._measures)}},{key:"toString",value:function(){if(this._coordinates.length>0){var r=new Lu(17*this._coordinates.length);r.append("("),r.append(this._coordinates[0]);for(var a=1;a<this._coordinates.length;a++)r.append(", "),r.append(this._coordinates[a]);return r.append(")"),r.toString()}return"()"}},{key:"getY",value:function(r){return this._coordinates[r].y}},{key:"toCoordinateArray",value:function(){return this._coordinates}},{key:"interfaces_",get:function(){return[Kt,I]}}],[{key:"constructor_",value:function(){if(this._dimension=3,this._measures=0,this._coordinates=null,arguments.length===1){if(arguments[0]instanceof Array){var r=arguments[0];c.constructor_.call(this,r,De.dimension(r),De.measures(r))}else if(Number.isInteger(arguments[0])){var a=arguments[0];this._coordinates=new Array(a).fill(null);for(var u=0;u<a;u++)this._coordinates[u]=new K}else if(Vt(arguments[0],Kt)){var g=arguments[0];if(g===null)return this._coordinates=new Array(0).fill(null),null;this._dimension=g.getDimension(),this._measures=g.getMeasures(),this._coordinates=new Array(g.size()).fill(null);for(var _=0;_<this._coordinates.length;_++)this._coordinates[_]=g.getCoordinateCopy(_)}}else if(arguments.length===2){if(arguments[0]instanceof Array&&Number.isInteger(arguments[1])){var E=arguments[0],P=arguments[1];c.constructor_.call(this,E,P,De.measures(E))}else if(Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var O=arguments[0],B=arguments[1];this._coordinates=new Array(O).fill(null),this._dimension=B;for(var Z=0;Z<O;Z++)this._coordinates[Z]=Du.create(B)}}else if(arguments.length===3){if(Number.isInteger(arguments[2])&&arguments[0]instanceof Array&&Number.isInteger(arguments[1])){var tt=arguments[0],ot=arguments[1],Et=arguments[2];this._dimension=ot,this._measures=Et,this._coordinates=tt===null?new Array(0).fill(null):tt}else if(Number.isInteger(arguments[2])&&Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var Nt=arguments[0],Dt=arguments[1],Zt=arguments[2];this._coordinates=new Array(Nt).fill(null),this._dimension=Dt,this._measures=Zt;for(var Yt=0;Yt<Nt;Yt++)this._coordinates[Yt]=this.createCoordinate()}}}}])})(),qg=(function(){function c(){s(this,c)}return l(c,[{key:"readResolve",value:function(){return c.instance()}},{key:"create",value:function(){if(arguments.length===1){if(arguments[0]instanceof Array)return new Fh(arguments[0]);if(Vt(arguments[0],Kt))return new Fh(arguments[0])}else{if(arguments.length===2){var r=arguments[1];return r>3&&(r=3),r<2&&(r=2),new Fh(arguments[0],r)}if(arguments.length===3){var a=arguments[2],u=arguments[1]-a;return a>1&&(a=1),u>3&&(u=3),u<2&&(u=2),new Fh(arguments[0],u+a,a)}}}},{key:"interfaces_",get:function(){return[O_,I]}}],[{key:"instance",value:function(){return c.instanceObject}}])})();qg.instanceObject=new qg;var $g=(function(c){function r(){var a;return s(this,r),a=n(this,r),r.constructor_.apply(a,arguments),a}return m(r,c),l(r,[{key:"copyInternal",value:function(){for(var a=new Array(this._geometries.length).fill(null),u=0;u<a.length;u++)a[u]=this._geometries[u].copy();return new r(a,this._factory)}},{key:"equalsExact",value:function(){if(arguments.length===2&&typeof arguments[1]=="number"&&arguments[0]instanceof gt){var a=arguments[0],u=arguments[1];return!!this.isEquivalentClass(a)&&S(r,"equalsExact",this,1).call(this,a,u)}return S(r,"equalsExact",this,1).apply(this,arguments)}},{key:"getBoundaryDimension",value:function(){return 1}},{key:"getTypeCode",value:function(){return gt.TYPECODE_MULTIPOLYGON}},{key:"getDimension",value:function(){return 2}},{key:"getBoundary",value:function(){if(this.isEmpty())return this.getFactory().createMultiLineString();for(var a=new Gt,u=0;u<this._geometries.length;u++)for(var g=this._geometries[u].getBoundary(),_=0;_<g.getNumGeometries();_++)a.add(g.getGeometryN(_));var E=new Array(a.size()).fill(null);return this.getFactory().createMultiLineString(a.toArray(E))}},{key:"getGeometryType",value:function(){return gt.TYPENAME_MULTIPOLYGON}},{key:"interfaces_",get:function(){return[D_]}}],[{key:"constructor_",value:function(){var a=arguments[0],u=arguments[1];Oi.constructor_.call(this,a,u)}}])})(Oi),F_=(function(){return l((function c(){s(this,c)}),[{key:"get",value:function(){}},{key:"put",value:function(){}},{key:"size",value:function(){}},{key:"values",value:function(){}},{key:"entrySet",value:function(){}}])})(),gN=(function(c){function r(){var a;return s(this,r),(a=n(this,r)).map=new Map,a}return m(r,c),l(r,[{key:"get",value:function(a){return this.map.get(a)||null}},{key:"put",value:function(a,u){return this.map.set(a,u),u}},{key:"values",value:function(){for(var a=new Gt,u=this.map.values(),g=u.next();!g.done;)a.add(g.value),g=u.next();return a}},{key:"entrySet",value:function(){var a=new le;return this.map.entries().forEach((function(u){return a.add(u)})),a}},{key:"size",value:function(){return this.map.size()}}])})(F_),mn=(function(){function c(){s(this,c),c.constructor_.apply(this,arguments)}return l(c,[{key:"equals",value:function(r){if(!(r instanceof c))return!1;var a=r;return this._modelType===a._modelType&&this._scale===a._scale}},{key:"compareTo",value:function(r){var a=r,u=this.getMaximumSignificantDigits(),g=a.getMaximumSignificantDigits();return Hs.compare(u,g)}},{key:"getScale",value:function(){return this._scale}},{key:"isFloating",value:function(){return this._modelType===c.FLOATING||this._modelType===c.FLOATING_SINGLE}},{key:"getType",value:function(){return this._modelType}},{key:"toString",value:function(){var r="UNKNOWN";return this._modelType===c.FLOATING?r="Floating":this._modelType===c.FLOATING_SINGLE?r="Floating-Single":this._modelType===c.FIXED&&(r="Fixed (Scale="+this.getScale()+")"),r}},{key:"makePrecise",value:function(){if(typeof arguments[0]=="number"){var r=arguments[0];return J.isNaN(r)||this._modelType===c.FLOATING_SINGLE?r:this._modelType===c.FIXED?Math.round(r*this._scale)/this._scale:r}if(arguments[0]instanceof K){var a=arguments[0];if(this._modelType===c.FLOATING)return null;a.x=this.makePrecise(a.x),a.y=this.makePrecise(a.y)}}},{key:"getMaximumSignificantDigits",value:function(){var r=16;return this._modelType===c.FLOATING?r=16:this._modelType===c.FLOATING_SINGLE?r=6:this._modelType===c.FIXED&&(r=1+Math.trunc(Math.ceil(Math.log(this.getScale())/Math.log(10)))),r}},{key:"setScale",value:function(r){this._scale=Math.abs(r)}},{key:"interfaces_",get:function(){return[I,V]}}],[{key:"constructor_",value:function(){if(this._modelType=null,this._scale=null,arguments.length===0)this._modelType=c.FLOATING;else if(arguments.length===1){if(arguments[0]instanceof fo){var r=arguments[0];this._modelType=r,r===c.FIXED&&this.setScale(1)}else if(typeof arguments[0]=="number"){var a=arguments[0];this._modelType=c.FIXED,this.setScale(a)}else if(arguments[0]instanceof c){var u=arguments[0];this._modelType=u._modelType,this._scale=u._scale}}}},{key:"mostPrecise",value:function(r,a){return r.compareTo(a)>=0?r:a}}])})(),fo=(function(){function c(){s(this,c),c.constructor_.apply(this,arguments)}return l(c,[{key:"readResolve",value:function(){return c.nameToTypeMap.get(this._name)}},{key:"toString",value:function(){return this._name}},{key:"interfaces_",get:function(){return[I]}}],[{key:"constructor_",value:function(){this._name=null;var r=arguments[0];this._name=r,c.nameToTypeMap.put(r,this)}}])})();fo.nameToTypeMap=new gN,mn.Type=fo,mn.FIXED=new fo("FIXED"),mn.FLOATING=new fo("FLOATING"),mn.FLOATING_SINGLE=new fo("FLOATING SINGLE"),mn.maximumPreciseValue=9007199254740992;var Wg=(function(c){function r(){var a;return s(this,r),a=n(this,r),r.constructor_.apply(a,arguments),a}return m(r,c),l(r,[{key:"copyInternal",value:function(){for(var a=new Array(this._geometries.length).fill(null),u=0;u<a.length;u++)a[u]=this._geometries[u].copy();return new r(a,this._factory)}},{key:"equalsExact",value:function(){if(arguments.length===2&&typeof arguments[1]=="number"&&arguments[0]instanceof gt){var a=arguments[0],u=arguments[1];return!!this.isEquivalentClass(a)&&S(r,"equalsExact",this,1).call(this,a,u)}return S(r,"equalsExact",this,1).apply(this,arguments)}},{key:"getBoundaryDimension",value:function(){return this.isClosed()?pt.FALSE:0}},{key:"isClosed",value:function(){if(this.isEmpty())return!1;for(var a=0;a<this._geometries.length;a++)if(!this._geometries[a].isClosed())return!1;return!0}},{key:"getTypeCode",value:function(){return gt.TYPECODE_MULTILINESTRING}},{key:"getDimension",value:function(){return 1}},{key:"getBoundary",value:function(){throw new It}},{key:"getGeometryType",value:function(){return gt.TYPENAME_MULTILINESTRING}},{key:"interfaces_",get:function(){return[N_]}}],[{key:"constructor_",value:function(){var a=arguments[0],u=arguments[1];Oi.constructor_.call(this,a,u)}}])})(Oi),go=(function(){function c(){s(this,c),c.constructor_.apply(this,arguments)}return l(c,[{key:"createEmpty",value:function(r){switch(r){case-1:return this.createGeometryCollection();case 0:return this.createPoint();case 1:return this.createLineString();case 2:return this.createPolygon();default:throw new D("Invalid dimension: "+r)}}},{key:"toGeometry",value:function(r){return r.isNull()?this.createPoint():r.getMinX()===r.getMaxX()&&r.getMinY()===r.getMaxY()?this.createPoint(new K(r.getMinX(),r.getMinY())):r.getMinX()===r.getMaxX()||r.getMinY()===r.getMaxY()?this.createLineString([new K(r.getMinX(),r.getMinY()),new K(r.getMaxX(),r.getMaxY())]):this.createPolygon(this.createLinearRing([new K(r.getMinX(),r.getMinY()),new K(r.getMinX(),r.getMaxY()),new K(r.getMaxX(),r.getMaxY()),new K(r.getMaxX(),r.getMinY()),new K(r.getMinX(),r.getMinY())]),null)}},{key:"createLineString",value:function(){if(arguments.length===0)return this.createLineString(this.getCoordinateSequenceFactory().create([]));if(arguments.length===1){if(arguments[0]instanceof Array){var r=arguments[0];return this.createLineString(r!==null?this.getCoordinateSequenceFactory().create(r):null)}if(Vt(arguments[0],Kt))return new Ah(arguments[0],this)}}},{key:"createMultiLineString",value:function(){return arguments.length===0?new Wg(null,this):arguments.length===1?new Wg(arguments[0],this):void 0}},{key:"buildGeometry",value:function(r){for(var a=null,u=!1,g=!1,_=r.iterator();_.hasNext();){var E=_.next(),P=E.getTypeCode();a===null&&(a=P),P!==a&&(u=!0),E instanceof Oi&&(g=!0)}if(a===null)return this.createGeometryCollection();if(u||g)return this.createGeometryCollection(c.toGeometryArray(r));var O=r.iterator().next();if(r.size()>1){if(O instanceof Au)return this.createMultiPolygon(c.toPolygonArray(r));if(O instanceof Ah)return this.createMultiLineString(c.toLineStringArray(r));if(O instanceof zg)return this.createMultiPoint(c.toPointArray(r));ct.shouldNeverReachHere("Unhandled geometry type: "+O.getGeometryType())}return O}},{key:"createMultiPointFromCoords",value:function(r){return this.createMultiPoint(r!==null?this.getCoordinateSequenceFactory().create(r):null)}},{key:"createPoint",value:function(){if(arguments.length===0)return this.createPoint(this.getCoordinateSequenceFactory().create([]));if(arguments.length===1){if(arguments[0]instanceof K){var r=arguments[0];return this.createPoint(r!==null?this.getCoordinateSequenceFactory().create([r]):null)}if(Vt(arguments[0],Kt))return new zg(arguments[0],this)}}},{key:"getCoordinateSequenceFactory",value:function(){return this._coordinateSequenceFactory}},{key:"createPolygon",value:function(){if(arguments.length===0)return this.createPolygon(null,null);if(arguments.length===1){if(Vt(arguments[0],Kt)){var r=arguments[0];return this.createPolygon(this.createLinearRing(r))}if(arguments[0]instanceof Array){var a=arguments[0];return this.createPolygon(this.createLinearRing(a))}if(arguments[0]instanceof Dh){var u=arguments[0];return this.createPolygon(u,null)}}else if(arguments.length===2)return new Au(arguments[0],arguments[1],this)}},{key:"getSRID",value:function(){return this._SRID}},{key:"createGeometryCollection",value:function(){return arguments.length===0?new Oi(null,this):arguments.length===1?new Oi(arguments[0],this):void 0}},{key:"getPrecisionModel",value:function(){return this._precisionModel}},{key:"createLinearRing",value:function(){if(arguments.length===0)return this.createLinearRing(this.getCoordinateSequenceFactory().create([]));if(arguments.length===1){if(arguments[0]instanceof Array){var r=arguments[0];return this.createLinearRing(r!==null?this.getCoordinateSequenceFactory().create(r):null)}if(Vt(arguments[0],Kt))return new Dh(arguments[0],this)}}},{key:"createMultiPolygon",value:function(){return arguments.length===0?new $g(null,this):arguments.length===1?new $g(arguments[0],this):void 0}},{key:"createMultiPoint",value:function(){if(arguments.length===0)return new Ug(null,this);if(arguments.length===1){if(arguments[0]instanceof Array)return new Ug(arguments[0],this);if(Vt(arguments[0],Kt)){var r=arguments[0];if(r===null)return this.createMultiPoint(new Array(0).fill(null));for(var a=new Array(r.size()).fill(null),u=0;u<r.size();u++){var g=this.getCoordinateSequenceFactory().create(1,r.getDimension(),r.getMeasures());Ur.copy(r,u,g,0,1),a[u]=this.createPoint(g)}return this.createMultiPoint(a)}}}},{key:"interfaces_",get:function(){return[I]}}],[{key:"constructor_",value:function(){if(this._precisionModel=null,this._coordinateSequenceFactory=null,this._SRID=null,arguments.length===0)c.constructor_.call(this,new mn,0);else if(arguments.length===1){if(Vt(arguments[0],O_)){var r=arguments[0];c.constructor_.call(this,new mn,0,r)}else if(arguments[0]instanceof mn){var a=arguments[0];c.constructor_.call(this,a,0,c.getDefaultCoordinateSequenceFactory())}}else if(arguments.length===2){var u=arguments[0],g=arguments[1];c.constructor_.call(this,u,g,c.getDefaultCoordinateSequenceFactory())}else if(arguments.length===3){var _=arguments[0],E=arguments[1],P=arguments[2];this._precisionModel=_,this._coordinateSequenceFactory=P,this._SRID=E}}},{key:"toMultiPolygonArray",value:function(r){var a=new Array(r.size()).fill(null);return r.toArray(a)}},{key:"toGeometryArray",value:function(r){if(r===null)return null;var a=new Array(r.size()).fill(null);return r.toArray(a)}},{key:"getDefaultCoordinateSequenceFactory",value:function(){return qg.instance()}},{key:"toMultiLineStringArray",value:function(r){var a=new Array(r.size()).fill(null);return r.toArray(a)}},{key:"toLineStringArray",value:function(r){var a=new Array(r.size()).fill(null);return r.toArray(a)}},{key:"toMultiPointArray",value:function(r){var a=new Array(r.size()).fill(null);return r.toArray(a)}},{key:"toLinearRingArray",value:function(r){var a=new Array(r.size()).fill(null);return r.toArray(a)}},{key:"toPointArray",value:function(r){var a=new Array(r.size()).fill(null);return r.toArray(a)}},{key:"toPolygonArray",value:function(r){var a=new Array(r.size()).fill(null);return r.toArray(a)}},{key:"createPointFromInternalCoord",value:function(r,a){return a.getPrecisionModel().makePrecise(r),a.getFactory().createPoint(r)}}])})(),Hg="XY",pN="XYZ",mN="XYM",vN="XYZM",G_={POINT:"Point",LINE_STRING:"LineString",LINEAR_RING:"LinearRing",POLYGON:"Polygon",MULTI_POINT:"MultiPoint",MULTI_LINE_STRING:"MultiLineString",MULTI_POLYGON:"MultiPolygon",GEOMETRY_COLLECTION:"GeometryCollection",CIRCLE:"Circle"},j_="EMPTY",Fu=1,gs=2,Xs=3,B_=4,po=5,yN=6;for(var _N in G_)G_[_N].toUpperCase();var wN=(function(){return l((function c(r){s(this,c),this.wkt=r,this.index_=-1}),[{key:"isAlpha_",value:function(c){return c>="a"&&c<="z"||c>="A"&&c<="Z"}},{key:"isNumeric_",value:function(c,r){return c>="0"&&c<="9"||c=="."&&!(r!==void 0&&r)}},{key:"isWhiteSpace_",value:function(c){return c==" "||c==" "||c=="\r"||c==`
|
|
48
48
|
`}},{key:"nextChar_",value:function(){return this.wkt.charAt(++this.index_)}},{key:"nextToken",value:function(){var c,r=this.nextChar_(),a=this.index_,u=r;if(r=="(")c=gs;else if(r==",")c=po;else if(r==")")c=Xs;else if(this.isNumeric_(r)||r=="-")c=B_,u=this.readNumber_();else if(this.isAlpha_(r))c=Fu,u=this.readText_();else{if(this.isWhiteSpace_(r))return this.nextToken();if(r!=="")throw new Error("Unexpected character: "+r);c=yN}return{position:a,value:u,type:c}}},{key:"readNumber_",value:function(){var c,r=this.index_,a=!1,u=!1;do c=="."?a=!0:c!="e"&&c!="E"||(u=!0),c=this.nextChar_();while(this.isNumeric_(c,a)||!u&&(c=="e"||c=="E")||u&&(c=="-"||c=="+"));return parseFloat(this.wkt.substring(r,this.index_--))}},{key:"readText_",value:function(){var c,r=this.index_;do c=this.nextChar_();while(this.isAlpha_(c));return this.wkt.substring(r,this.index_--).toUpperCase()}}])})(),EN=(function(){return l((function c(r,a){s(this,c),this.lexer_=r,this.token_,this.layout_=Hg,this.factory=a}),[{key:"consume_",value:function(){this.token_=this.lexer_.nextToken()}},{key:"isTokenType",value:function(c){return this.token_.type==c}},{key:"match",value:function(c){var r=this.isTokenType(c);return r&&this.consume_(),r}},{key:"parse",value:function(){return this.consume_(),this.parseGeometry_()}},{key:"parseGeometryLayout_",value:function(){var c=Hg,r=this.token_;if(this.isTokenType(Fu)){var a=r.value;a==="Z"?c=pN:a==="M"?c=mN:a==="ZM"&&(c=vN),c!==Hg&&this.consume_()}return c}},{key:"parseGeometryCollectionText_",value:function(){if(this.match(gs)){var c=[];do c.push(this.parseGeometry_());while(this.match(po));if(this.match(Xs))return c}else if(this.isEmptyGeometry_())return[];throw new Error(this.formatErrorMessage_())}},{key:"parsePointText_",value:function(){if(this.match(gs)){var c=this.parsePoint_();if(this.match(Xs))return c}else if(this.isEmptyGeometry_())return null;throw new Error(this.formatErrorMessage_())}},{key:"parseLineStringText_",value:function(){if(this.match(gs)){var c=this.parsePointList_();if(this.match(Xs))return c}else if(this.isEmptyGeometry_())return[];throw new Error(this.formatErrorMessage_())}},{key:"parsePolygonText_",value:function(){if(this.match(gs)){var c=this.parseLineStringTextList_();if(this.match(Xs))return c}else if(this.isEmptyGeometry_())return[];throw new Error(this.formatErrorMessage_())}},{key:"parseMultiPointText_",value:function(){var c;if(this.match(gs)){if(c=this.token_.type==gs?this.parsePointTextList_():this.parsePointList_(),this.match(Xs))return c}else if(this.isEmptyGeometry_())return[];throw new Error(this.formatErrorMessage_())}},{key:"parseMultiLineStringText_",value:function(){if(this.match(gs)){var c=this.parseLineStringTextList_();if(this.match(Xs))return c}else if(this.isEmptyGeometry_())return[];throw new Error(this.formatErrorMessage_())}},{key:"parseMultiPolygonText_",value:function(){if(this.match(gs)){var c=this.parsePolygonTextList_();if(this.match(Xs))return c}else if(this.isEmptyGeometry_())return[];throw new Error(this.formatErrorMessage_())}},{key:"parsePoint_",value:function(){for(var c=[],r=this.layout_.length,a=0;a<r;++a){var u=this.token_;if(!this.match(B_))break;c.push(u.value)}if(c.length==r)return c;throw new Error(this.formatErrorMessage_())}},{key:"parsePointList_",value:function(){for(var c=[this.parsePoint_()];this.match(po);)c.push(this.parsePoint_());return c}},{key:"parsePointTextList_",value:function(){for(var c=[this.parsePointText_()];this.match(po);)c.push(this.parsePointText_());return c}},{key:"parseLineStringTextList_",value:function(){for(var c=[this.parseLineStringText_()];this.match(po);)c.push(this.parseLineStringText_());return c}},{key:"parsePolygonTextList_",value:function(){for(var c=[this.parsePolygonText_()];this.match(po);)c.push(this.parsePolygonText_());return c}},{key:"isEmptyGeometry_",value:function(){var c=this.isTokenType(Fu)&&this.token_.value==j_;return c&&this.consume_(),c}},{key:"formatErrorMessage_",value:function(){return"Unexpected `"+this.token_.value+"` at position "+this.token_.position+" in `"+this.lexer_.wkt+"`"}},{key:"parseGeometry_",value:function(){var c=this.factory,r=function(Dt){return o(K,T(Dt))},a=function(Dt){var Zt=Dt.map((function(Yt){return c.createLinearRing(Yt.map(r))}));return Zt.length>1?c.createPolygon(Zt[0],Zt.slice(1)):c.createPolygon(Zt[0])},u=this.token_;if(this.match(Fu)){var g=u.value;if(this.layout_=this.parseGeometryLayout_(),g=="GEOMETRYCOLLECTION"){var _=this.parseGeometryCollectionText_();return c.createGeometryCollection(_)}switch(g){case"POINT":var E=this.parsePointText_();return E?c.createPoint(o(K,T(E))):c.createPoint();case"LINESTRING":var P=this.parseLineStringText_().map(r);return c.createLineString(P);case"LINEARRING":var O=this.parseLineStringText_().map(r);return c.createLinearRing(O);case"POLYGON":var B=this.parsePolygonText_();return B&&B.length!==0?a(B):c.createPolygon();case"MULTIPOINT":var Z=this.parseMultiPointText_();if(!Z||Z.length===0)return c.createMultiPoint();var tt=Z.map(r).map((function(Dt){return c.createPoint(Dt)}));return c.createMultiPoint(tt);case"MULTILINESTRING":var ot=this.parseMultiLineStringText_().map((function(Dt){return c.createLineString(Dt.map(r))}));return c.createMultiLineString(ot);case"MULTIPOLYGON":var Et=this.parseMultiPolygonText_();if(!Et||Et.length===0)return c.createMultiPolygon();var Nt=Et.map(a);return c.createMultiPolygon(Nt);default:throw new Error("Invalid geometry type: "+g)}}throw new Error(this.formatErrorMessage_())}}])})();function z_(c){if(c.isEmpty())return"";var r=c.getCoordinate(),a=[r.x,r.y];return r.z===void 0||Number.isNaN(r.z)||a.push(r.z),r.m===void 0||Number.isNaN(r.m)||a.push(r.m),a.join(" ")}function Gh(c){for(var r=c.getCoordinates().map((function(_){var E=[_.x,_.y];return _.z===void 0||Number.isNaN(_.z)||E.push(_.z),_.m===void 0||Number.isNaN(_.m)||E.push(_.m),E})),a=[],u=0,g=r.length;u<g;++u)a.push(r[u].join(" "));return a.join(", ")}function U_(c){var r=[];r.push("("+Gh(c.getExteriorRing())+")");for(var a=0,u=c.getNumInteriorRing();a<u;++a)r.push("("+Gh(c.getInteriorRingN(a))+")");return r.join(", ")}var SN={Point:z_,LineString:Gh,LinearRing:Gh,Polygon:U_,MultiPoint:function(c){for(var r=[],a=0,u=c.getNumGeometries();a<u;++a)r.push("("+z_(c.getGeometryN(a))+")");return r.join(", ")},MultiLineString:function(c){for(var r=[],a=0,u=c.getNumGeometries();a<u;++a)r.push("("+Gh(c.getGeometryN(a))+")");return r.join(", ")},MultiPolygon:function(c){for(var r=[],a=0,u=c.getNumGeometries();a<u;++a)r.push("("+U_(c.getGeometryN(a))+")");return r.join(", ")},GeometryCollection:function(c){for(var r=[],a=0,u=c.getNumGeometries();a<u;++a)r.push(V_(c.getGeometryN(a)));return r.join(", ")}};function V_(c){var r=c.getGeometryType(),a=SN[r];r=r.toUpperCase();var u=(function(g){var _="";if(g.isEmpty())return _;var E=g.getCoordinate();return E.z===void 0||Number.isNaN(E.z)||(_+="Z"),E.m===void 0||Number.isNaN(E.m)||(_+="M"),_})(c);return u.length>0&&(r+=" "+u),c.isEmpty()?r+" "+j_:r+" ("+a(c)+")"}var xN=(function(){return l((function c(r){s(this,c),this.geometryFactory=r||new go,this.precisionModel=this.geometryFactory.getPrecisionModel()}),[{key:"read",value:function(c){var r=new wN(c);return new EN(r,this.geometryFactory).parse()}},{key:"write",value:function(c){return V_(c)}}])})(),Xg=(function(){return l((function c(r){s(this,c),this.parser=new xN(r)}),[{key:"write",value:function(c){return this.parser.write(c)}}],[{key:"toLineString",value:function(c,r){if(arguments.length!==2)throw new Error("Not implemented");return"LINESTRING ( "+c.x+" "+c.y+", "+r.x+" "+r.y+" )"}}])})(),fe=(function(){function c(){s(this,c),c.constructor_.apply(this,arguments)}return l(c,[{key:"getIndexAlongSegment",value:function(r,a){return this.computeIntLineIndex(),this._intLineIndex[r][a]}},{key:"getTopologySummary",value:function(){var r=new Lu;return this.isEndPoint()&&r.append(" endpoint"),this._isProper&&r.append(" proper"),this.isCollinear()&&r.append(" collinear"),r.toString()}},{key:"computeIntersection",value:function(r,a,u,g){this._inputLines[0][0]=r,this._inputLines[0][1]=a,this._inputLines[1][0]=u,this._inputLines[1][1]=g,this._result=this.computeIntersect(r,a,u,g)}},{key:"getIntersectionNum",value:function(){return this._result}},{key:"computeIntLineIndex",value:function(){if(arguments.length===0)this._intLineIndex===null&&(this._intLineIndex=Array(2).fill().map((function(){return Array(2)})),this.computeIntLineIndex(0),this.computeIntLineIndex(1));else if(arguments.length===1){var r=arguments[0];this.getEdgeDistance(r,0)>this.getEdgeDistance(r,1)?(this._intLineIndex[r][0]=0,this._intLineIndex[r][1]=1):(this._intLineIndex[r][0]=1,this._intLineIndex[r][1]=0)}}},{key:"isProper",value:function(){return this.hasIntersection()&&this._isProper}},{key:"setPrecisionModel",value:function(r){this._precisionModel=r}},{key:"isInteriorIntersection",value:function(){if(arguments.length===0)return!!this.isInteriorIntersection(0)||!!this.isInteriorIntersection(1);if(arguments.length===1){for(var r=arguments[0],a=0;a<this._result;a++)if(!this._intPt[a].equals2D(this._inputLines[r][0])&&!this._intPt[a].equals2D(this._inputLines[r][1]))return!0;return!1}}},{key:"getIntersection",value:function(r){return this._intPt[r]}},{key:"isEndPoint",value:function(){return this.hasIntersection()&&!this._isProper}},{key:"hasIntersection",value:function(){return this._result!==c.NO_INTERSECTION}},{key:"getEdgeDistance",value:function(r,a){return c.computeEdgeDistance(this._intPt[a],this._inputLines[r][0],this._inputLines[r][1])}},{key:"isCollinear",value:function(){return this._result===c.COLLINEAR_INTERSECTION}},{key:"toString",value:function(){return Xg.toLineString(this._inputLines[0][0],this._inputLines[0][1])+" - "+Xg.toLineString(this._inputLines[1][0],this._inputLines[1][1])+this.getTopologySummary()}},{key:"getEndpoint",value:function(r,a){return this._inputLines[r][a]}},{key:"isIntersection",value:function(r){for(var a=0;a<this._result;a++)if(this._intPt[a].equals2D(r))return!0;return!1}},{key:"getIntersectionAlongSegment",value:function(r,a){return this.computeIntLineIndex(),this._intPt[this._intLineIndex[r][a]]}}],[{key:"constructor_",value:function(){this._result=null,this._inputLines=Array(2).fill().map((function(){return Array(2)})),this._intPt=new Array(2).fill(null),this._intLineIndex=null,this._isProper=null,this._pa=null,this._pb=null,this._precisionModel=null,this._intPt[0]=new K,this._intPt[1]=new K,this._pa=this._intPt[0],this._pb=this._intPt[1],this._result=0}},{key:"computeEdgeDistance",value:function(r,a,u){var g=Math.abs(u.x-a.x),_=Math.abs(u.y-a.y),E=-1;if(r.equals(a))E=0;else if(r.equals(u))E=g>_?g:_;else{var P=Math.abs(r.x-a.x),O=Math.abs(r.y-a.y);(E=g>_?P:O)!==0||r.equals(a)||(E=Math.max(P,O))}return ct.isTrue(!(E===0&&!r.equals(a)),"Bad distance calculation"),E}},{key:"nonRobustComputeEdgeDistance",value:function(r,a,u){var g=r.x-a.x,_=r.y-a.y,E=Math.sqrt(g*g+_*_);return ct.isTrue(!(E===0&&!r.equals(a)),"Invalid distance calculation"),E}}])})();fe.DONT_INTERSECT=0,fe.DO_INTERSECT=1,fe.COLLINEAR=2,fe.NO_INTERSECTION=0,fe.POINT_INTERSECTION=1,fe.COLLINEAR_INTERSECTION=2;var Wr=(function(c){function r(){return s(this,r),n(this,r)}return m(r,c),l(r,[{key:"isInSegmentEnvelopes",value:function(a){var u=new zt(this._inputLines[0][0],this._inputLines[0][1]),g=new zt(this._inputLines[1][0],this._inputLines[1][1]);return u.contains(a)&&g.contains(a)}},{key:"computeIntersection",value:function(){if(arguments.length!==3)return S(r,"computeIntersection",this,1).apply(this,arguments);var a=arguments[0],u=arguments[1],g=arguments[2];if(this._isProper=!1,zt.intersects(u,g,a)&&Ut.index(u,g,a)===0&&Ut.index(g,u,a)===0)return this._isProper=!0,(a.equals(u)||a.equals(g))&&(this._isProper=!1),this._result=fe.POINT_INTERSECTION,null;this._result=fe.NO_INTERSECTION}},{key:"intersection",value:function(a,u,g,_){var E=this.intersectionSafe(a,u,g,_);return this.isInSegmentEnvelopes(E)||(E=new K(r.nearestEndpoint(a,u,g,_))),this._precisionModel!==null&&this._precisionModel.makePrecise(E),E}},{key:"checkDD",value:function(a,u,g,_,E){var P=jg.intersection(a,u,g,_),O=this.isInSegmentEnvelopes(P);Yi.out.println("DD in env = "+O+" --------------------- "+P),E.distance(P)>1e-4&&Yi.out.println("Distance = "+E.distance(P))}},{key:"intersectionSafe",value:function(a,u,g,_){var E=Bg.intersection(a,u,g,_);return E===null&&(E=r.nearestEndpoint(a,u,g,_)),E}},{key:"computeCollinearIntersection",value:function(a,u,g,_){var E=zt.intersects(a,u,g),P=zt.intersects(a,u,_),O=zt.intersects(g,_,a),B=zt.intersects(g,_,u);return E&&P?(this._intPt[0]=g,this._intPt[1]=_,fe.COLLINEAR_INTERSECTION):O&&B?(this._intPt[0]=a,this._intPt[1]=u,fe.COLLINEAR_INTERSECTION):E&&O?(this._intPt[0]=g,this._intPt[1]=a,!g.equals(a)||P||B?fe.COLLINEAR_INTERSECTION:fe.POINT_INTERSECTION):E&&B?(this._intPt[0]=g,this._intPt[1]=u,!g.equals(u)||P||O?fe.COLLINEAR_INTERSECTION:fe.POINT_INTERSECTION):P&&O?(this._intPt[0]=_,this._intPt[1]=a,!_.equals(a)||E||B?fe.COLLINEAR_INTERSECTION:fe.POINT_INTERSECTION):P&&B?(this._intPt[0]=_,this._intPt[1]=u,!_.equals(u)||E||O?fe.COLLINEAR_INTERSECTION:fe.POINT_INTERSECTION):fe.NO_INTERSECTION}},{key:"computeIntersect",value:function(a,u,g,_){if(this._isProper=!1,!zt.intersects(a,u,g,_))return fe.NO_INTERSECTION;var E=Ut.index(a,u,g),P=Ut.index(a,u,_);if(E>0&&P>0||E<0&&P<0)return fe.NO_INTERSECTION;var O=Ut.index(g,_,a),B=Ut.index(g,_,u);return O>0&&B>0||O<0&&B<0?fe.NO_INTERSECTION:E===0&&P===0&&O===0&&B===0?this.computeCollinearIntersection(a,u,g,_):(E===0||P===0||O===0||B===0?(this._isProper=!1,a.equals2D(g)||a.equals2D(_)?this._intPt[0]=a:u.equals2D(g)||u.equals2D(_)?this._intPt[0]=u:E===0?this._intPt[0]=new K(g):P===0?this._intPt[0]=new K(_):O===0?this._intPt[0]=new K(a):B===0&&(this._intPt[0]=new K(u))):(this._isProper=!0,this._intPt[0]=this.intersection(a,u,g,_)),fe.POINT_INTERSECTION)}}],[{key:"nearestEndpoint",value:function(a,u,g,_){var E=a,P=qn.pointToSegment(a,g,_),O=qn.pointToSegment(u,g,_);return O<P&&(P=O,E=u),(O=qn.pointToSegment(g,a,u))<P&&(P=O,E=g),(O=qn.pointToSegment(_,a,u))<P&&(P=O,E=_),E}}])})(fe),bN=(function(){function c(){s(this,c),c.constructor_.apply(this,arguments)}return l(c,[{key:"countSegment",value:function(r,a){if(r.x<this._p.x&&a.x<this._p.x)return null;if(this._p.x===a.x&&this._p.y===a.y)return this._isPointOnSegment=!0,null;if(r.y===this._p.y&&a.y===this._p.y){var u=r.x,g=a.x;return u>g&&(u=a.x,g=r.x),this._p.x>=u&&this._p.x<=g&&(this._isPointOnSegment=!0),null}if(r.y>this._p.y&&a.y<=this._p.y||a.y>this._p.y&&r.y<=this._p.y){var _=Ut.index(r,a,this._p);if(_===Ut.COLLINEAR)return this._isPointOnSegment=!0,null;a.y<r.y&&(_=-_),_===Ut.LEFT&&this._crossingCount++}}},{key:"isPointInPolygon",value:function(){return this.getLocation()!==A.EXTERIOR}},{key:"getLocation",value:function(){return this._isPointOnSegment?A.BOUNDARY:this._crossingCount%2==1?A.INTERIOR:A.EXTERIOR}},{key:"isOnSegment",value:function(){return this._isPointOnSegment}}],[{key:"constructor_",value:function(){this._p=null,this._crossingCount=0,this._isPointOnSegment=!1;var r=arguments[0];this._p=r}},{key:"locatePointInRing",value:function(){if(arguments[0]instanceof K&&Vt(arguments[1],Kt)){for(var r=arguments[1],a=new c(arguments[0]),u=new K,g=new K,_=1;_<r.size();_++)if(r.getCoordinate(_,u),r.getCoordinate(_-1,g),a.countSegment(u,g),a.isOnSegment())return a.getLocation();return a.getLocation()}if(arguments[0]instanceof K&&arguments[1]instanceof Array){for(var E=arguments[1],P=new c(arguments[0]),O=1;O<E.length;O++){var B=E[O],Z=E[O-1];if(P.countSegment(B,Z),P.isOnSegment())return P.getLocation()}return P.getLocation()}}}])})(),Yg=(function(){function c(){s(this,c)}return l(c,null,[{key:"isOnLine",value:function(){if(arguments[0]instanceof K&&Vt(arguments[1],Kt)){for(var r=arguments[0],a=arguments[1],u=new Wr,g=new K,_=new K,E=a.size(),P=1;P<E;P++)if(a.getCoordinate(P-1,g),a.getCoordinate(P,_),u.computeIntersection(r,g,_),u.hasIntersection())return!0;return!1}if(arguments[0]instanceof K&&arguments[1]instanceof Array){for(var O=arguments[0],B=arguments[1],Z=new Wr,tt=1;tt<B.length;tt++){var ot=B[tt-1],Et=B[tt];if(Z.computeIntersection(O,ot,Et),Z.hasIntersection())return!0}return!1}}},{key:"locateInRing",value:function(r,a){return bN.locatePointInRing(r,a)}},{key:"isInRing",value:function(r,a){return c.locateInRing(r,a)!==A.EXTERIOR}}])})(),Ji=(function(){function c(){s(this,c),c.constructor_.apply(this,arguments)}return l(c,[{key:"setAllLocations",value:function(r){for(var a=0;a<this.location.length;a++)this.location[a]=r}},{key:"isNull",value:function(){for(var r=0;r<this.location.length;r++)if(this.location[r]!==A.NONE)return!1;return!0}},{key:"setAllLocationsIfNull",value:function(r){for(var a=0;a<this.location.length;a++)this.location[a]===A.NONE&&(this.location[a]=r)}},{key:"isLine",value:function(){return this.location.length===1}},{key:"merge",value:function(r){if(r.location.length>this.location.length){var a=new Array(3).fill(null);a[ut.ON]=this.location[ut.ON],a[ut.LEFT]=A.NONE,a[ut.RIGHT]=A.NONE,this.location=a}for(var u=0;u<this.location.length;u++)this.location[u]===A.NONE&&u<r.location.length&&(this.location[u]=r.location[u])}},{key:"getLocations",value:function(){return this.location}},{key:"flip",value:function(){if(this.location.length<=1)return null;var r=this.location[ut.LEFT];this.location[ut.LEFT]=this.location[ut.RIGHT],this.location[ut.RIGHT]=r}},{key:"toString",value:function(){var r=new Ws;return this.location.length>1&&r.append(A.toLocationSymbol(this.location[ut.LEFT])),r.append(A.toLocationSymbol(this.location[ut.ON])),this.location.length>1&&r.append(A.toLocationSymbol(this.location[ut.RIGHT])),r.toString()}},{key:"setLocations",value:function(r,a,u){this.location[ut.ON]=r,this.location[ut.LEFT]=a,this.location[ut.RIGHT]=u}},{key:"get",value:function(r){return r<this.location.length?this.location[r]:A.NONE}},{key:"isArea",value:function(){return this.location.length>1}},{key:"isAnyNull",value:function(){for(var r=0;r<this.location.length;r++)if(this.location[r]===A.NONE)return!0;return!1}},{key:"setLocation",value:function(){if(arguments.length===1){var r=arguments[0];this.setLocation(ut.ON,r)}else if(arguments.length===2){var a=arguments[0],u=arguments[1];this.location[a]=u}}},{key:"init",value:function(r){this.location=new Array(r).fill(null),this.setAllLocations(A.NONE)}},{key:"isEqualOnSide",value:function(r,a){return this.location[a]===r.location[a]}},{key:"allPositionsEqual",value:function(r){for(var a=0;a<this.location.length;a++)if(this.location[a]!==r)return!1;return!0}}],[{key:"constructor_",value:function(){if(this.location=null,arguments.length===1){if(arguments[0]instanceof Array){var r=arguments[0];this.init(r.length)}else if(Number.isInteger(arguments[0])){var a=arguments[0];this.init(1),this.location[ut.ON]=a}else if(arguments[0]instanceof c){var u=arguments[0];if(this.init(u.location.length),u!==null)for(var g=0;g<this.location.length;g++)this.location[g]=u.location[g]}}else if(arguments.length===3){var _=arguments[0],E=arguments[1],P=arguments[2];this.init(3),this.location[ut.ON]=_,this.location[ut.LEFT]=E,this.location[ut.RIGHT]=P}}}])})(),Ki=(function(){function c(){s(this,c),c.constructor_.apply(this,arguments)}return l(c,[{key:"getGeometryCount",value:function(){var r=0;return this.elt[0].isNull()||r++,this.elt[1].isNull()||r++,r}},{key:"setAllLocations",value:function(r,a){this.elt[r].setAllLocations(a)}},{key:"isNull",value:function(r){return this.elt[r].isNull()}},{key:"setAllLocationsIfNull",value:function(){if(arguments.length===1){var r=arguments[0];this.setAllLocationsIfNull(0,r),this.setAllLocationsIfNull(1,r)}else if(arguments.length===2){var a=arguments[0],u=arguments[1];this.elt[a].setAllLocationsIfNull(u)}}},{key:"isLine",value:function(r){return this.elt[r].isLine()}},{key:"merge",value:function(r){for(var a=0;a<2;a++)this.elt[a]===null&&r.elt[a]!==null?this.elt[a]=new Ji(r.elt[a]):this.elt[a].merge(r.elt[a])}},{key:"flip",value:function(){this.elt[0].flip(),this.elt[1].flip()}},{key:"getLocation",value:function(){if(arguments.length===1){var r=arguments[0];return this.elt[r].get(ut.ON)}if(arguments.length===2){var a=arguments[0],u=arguments[1];return this.elt[a].get(u)}}},{key:"toString",value:function(){var r=new Ws;return this.elt[0]!==null&&(r.append("A:"),r.append(this.elt[0].toString())),this.elt[1]!==null&&(r.append(" B:"),r.append(this.elt[1].toString())),r.toString()}},{key:"isArea",value:function(){if(arguments.length===0)return this.elt[0].isArea()||this.elt[1].isArea();if(arguments.length===1){var r=arguments[0];return this.elt[r].isArea()}}},{key:"isAnyNull",value:function(r){return this.elt[r].isAnyNull()}},{key:"setLocation",value:function(){if(arguments.length===2){var r=arguments[0],a=arguments[1];this.elt[r].setLocation(ut.ON,a)}else if(arguments.length===3){var u=arguments[0],g=arguments[1],_=arguments[2];this.elt[u].setLocation(g,_)}}},{key:"isEqualOnSide",value:function(r,a){return this.elt[0].isEqualOnSide(r.elt[0],a)&&this.elt[1].isEqualOnSide(r.elt[1],a)}},{key:"allPositionsEqual",value:function(r,a){return this.elt[r].allPositionsEqual(a)}},{key:"toLine",value:function(r){this.elt[r].isArea()&&(this.elt[r]=new Ji(this.elt[r].location[0]))}}],[{key:"constructor_",value:function(){if(this.elt=new Array(2).fill(null),arguments.length===1){if(Number.isInteger(arguments[0])){var r=arguments[0];this.elt[0]=new Ji(r),this.elt[1]=new Ji(r)}else if(arguments[0]instanceof c){var a=arguments[0];this.elt[0]=new Ji(a.elt[0]),this.elt[1]=new Ji(a.elt[1])}}else if(arguments.length===2){var u=arguments[0],g=arguments[1];this.elt[0]=new Ji(A.NONE),this.elt[1]=new Ji(A.NONE),this.elt[u].setLocation(g)}else if(arguments.length===3){var _=arguments[0],E=arguments[1],P=arguments[2];this.elt[0]=new Ji(_,E,P),this.elt[1]=new Ji(_,E,P)}else if(arguments.length===4){var O=arguments[0],B=arguments[1],Z=arguments[2],tt=arguments[3];this.elt[0]=new Ji(A.NONE,A.NONE,A.NONE),this.elt[1]=new Ji(A.NONE,A.NONE,A.NONE),this.elt[O].setLocations(B,Z,tt)}}},{key:"toLineLabel",value:function(r){for(var a=new c(A.NONE),u=0;u<2;u++)a.setLocation(u,r.getLocation(u));return a}}])})(),Gu=(function(){return l((function c(){s(this,c),c.constructor_.apply(this,arguments)}),[{key:"computeRing",value:function(){if(this._ring!==null)return null;for(var c=new Array(this._pts.size()).fill(null),r=0;r<this._pts.size();r++)c[r]=this._pts.get(r);this._ring=this._geometryFactory.createLinearRing(c),this._isHole=Ut.isCCW(this._ring.getCoordinates())}},{key:"isIsolated",value:function(){return this._label.getGeometryCount()===1}},{key:"computePoints",value:function(c){this._startDe=c;var r=c,a=!0;do{if(r===null)throw new fs("Found null DirectedEdge");if(r.getEdgeRing()===this)throw new fs("Directed Edge visited twice during ring-building at "+r.getCoordinate());this._edges.add(r);var u=r.getLabel();ct.isTrue(u.isArea()),this.mergeLabel(u),this.addPoints(r.getEdge(),r.isForward(),a),a=!1,this.setEdgeRing(r,this),r=this.getNext(r)}while(r!==this._startDe)}},{key:"getLinearRing",value:function(){return this._ring}},{key:"getCoordinate",value:function(c){return this._pts.get(c)}},{key:"computeMaxNodeDegree",value:function(){this._maxNodeDegree=0;var c=this._startDe;do{var r=c.getNode().getEdges().getOutgoingDegree(this);r>this._maxNodeDegree&&(this._maxNodeDegree=r),c=this.getNext(c)}while(c!==this._startDe);this._maxNodeDegree*=2}},{key:"addPoints",value:function(c,r,a){var u=c.getCoordinates();if(r){var g=1;a&&(g=0);for(var _=g;_<u.length;_++)this._pts.add(u[_])}else{var E=u.length-2;a&&(E=u.length-1);for(var P=E;P>=0;P--)this._pts.add(u[P])}}},{key:"isHole",value:function(){return this._isHole}},{key:"setInResult",value:function(){var c=this._startDe;do c.getEdge().setInResult(!0),c=c.getNext();while(c!==this._startDe)}},{key:"containsPoint",value:function(c){var r=this.getLinearRing();if(!r.getEnvelopeInternal().contains(c)||!Yg.isInRing(c,r.getCoordinates()))return!1;for(var a=this._holes.iterator();a.hasNext();)if(a.next().containsPoint(c))return!1;return!0}},{key:"addHole",value:function(c){this._holes.add(c)}},{key:"isShell",value:function(){return this._shell===null}},{key:"getLabel",value:function(){return this._label}},{key:"getEdges",value:function(){return this._edges}},{key:"getMaxNodeDegree",value:function(){return this._maxNodeDegree<0&&this.computeMaxNodeDegree(),this._maxNodeDegree}},{key:"getShell",value:function(){return this._shell}},{key:"mergeLabel",value:function(){if(arguments.length===1){var c=arguments[0];this.mergeLabel(c,0),this.mergeLabel(c,1)}else if(arguments.length===2){var r=arguments[1],a=arguments[0].getLocation(r,ut.RIGHT);if(a===A.NONE)return null;if(this._label.getLocation(r)===A.NONE)return this._label.setLocation(r,a),null}}},{key:"setShell",value:function(c){this._shell=c,c!==null&&c.addHole(this)}},{key:"toPolygon",value:function(c){for(var r=new Array(this._holes.size()).fill(null),a=0;a<this._holes.size();a++)r[a]=this._holes.get(a).getLinearRing();return c.createPolygon(this.getLinearRing(),r)}}],[{key:"constructor_",value:function(){if(this._startDe=null,this._maxNodeDegree=-1,this._edges=new Gt,this._pts=new Gt,this._label=new Ki(A.NONE),this._ring=null,this._isHole=null,this._shell=null,this._holes=new Gt,this._geometryFactory=null,arguments.length!==0){if(arguments.length===2){var c=arguments[0],r=arguments[1];this._geometryFactory=r,this.computePoints(c),this.computeRing()}}}}])})(),PN=(function(c){function r(){var a;return s(this,r),a=n(this,r),r.constructor_.apply(a,arguments),a}return m(r,c),l(r,[{key:"setEdgeRing",value:function(a,u){a.setMinEdgeRing(u)}},{key:"getNext",value:function(a){return a.getNextMin()}}],[{key:"constructor_",value:function(){var a=arguments[0],u=arguments[1];Gu.constructor_.call(this,a,u)}}])})(Gu),CN=(function(c){function r(){var a;return s(this,r),a=n(this,r),r.constructor_.apply(a,arguments),a}return m(r,c),l(r,[{key:"buildMinimalRings",value:function(){var a=new Gt,u=this._startDe;do{if(u.getMinEdgeRing()===null){var g=new PN(u,this._geometryFactory);a.add(g)}u=u.getNext()}while(u!==this._startDe);return a}},{key:"setEdgeRing",value:function(a,u){a.setEdgeRing(u)}},{key:"linkDirectedEdgesForMinimalEdgeRings",value:function(){var a=this._startDe;do a.getNode().getEdges().linkMinimalDirectedEdges(this),a=a.getNext();while(a!==this._startDe)}},{key:"getNext",value:function(a){return a.getNext()}}],[{key:"constructor_",value:function(){var a=arguments[0],u=arguments[1];Gu.constructor_.call(this,a,u)}}])})(Gu),q_=(function(){return l((function c(){s(this,c),c.constructor_.apply(this,arguments)}),[{key:"setVisited",value:function(c){this._isVisited=c}},{key:"setInResult",value:function(c){this._isInResult=c}},{key:"isCovered",value:function(){return this._isCovered}},{key:"isCoveredSet",value:function(){return this._isCoveredSet}},{key:"setLabel",value:function(c){this._label=c}},{key:"getLabel",value:function(){return this._label}},{key:"setCovered",value:function(c){this._isCovered=c,this._isCoveredSet=!0}},{key:"updateIM",value:function(c){ct.isTrue(this._label.getGeometryCount()>=2,"found partial label"),this.computeIM(c)}},{key:"isInResult",value:function(){return this._isInResult}},{key:"isVisited",value:function(){return this._isVisited}}],[{key:"constructor_",value:function(){if(this._label=null,this._isInResult=!1,this._isCovered=!1,this._isCoveredSet=!1,this._isVisited=!1,arguments.length!==0){if(arguments.length===1){var c=arguments[0];this._label=c}}}}])})(),ju=(function(c){function r(){var a;return s(this,r),a=n(this,r),r.constructor_.apply(a,arguments),a}return m(r,c),l(r,[{key:"isIncidentEdgeInResult",value:function(){for(var a=this.getEdges().getEdges().iterator();a.hasNext();)if(a.next().getEdge().isInResult())return!0;return!1}},{key:"isIsolated",value:function(){return this._label.getGeometryCount()===1}},{key:"getCoordinate",value:function(){return this._coord}},{key:"print",value:function(a){a.println("node "+this._coord+" lbl: "+this._label)}},{key:"computeIM",value:function(a){}},{key:"computeMergedLocation",value:function(a,u){var g=A.NONE;if(g=this._label.getLocation(u),!a.isNull(u)){var _=a.getLocation(u);g!==A.BOUNDARY&&(g=_)}return g}},{key:"setLabel",value:function(){if(arguments.length!==2||!Number.isInteger(arguments[1])||!Number.isInteger(arguments[0]))return S(r,"setLabel",this,1).apply(this,arguments);var a=arguments[0],u=arguments[1];this._label===null?this._label=new Ki(a,u):this._label.setLocation(a,u)}},{key:"getEdges",value:function(){return this._edges}},{key:"mergeLabel",value:function(){if(arguments[0]instanceof r){var a=arguments[0];this.mergeLabel(a._label)}else if(arguments[0]instanceof Ki)for(var u=arguments[0],g=0;g<2;g++){var _=this.computeMergedLocation(u,g);this._label.getLocation(g)===A.NONE&&this._label.setLocation(g,_)}}},{key:"add",value:function(a){this._edges.insert(a),a.setNode(this)}},{key:"setLabelBoundary",value:function(a){if(this._label===null)return null;var u=A.NONE;this._label!==null&&(u=this._label.getLocation(a));var g=null;switch(u){case A.BOUNDARY:g=A.INTERIOR;break;case A.INTERIOR:default:g=A.BOUNDARY}this._label.setLocation(a,g)}}],[{key:"constructor_",value:function(){this._coord=null,this._edges=null;var a=arguments[0],u=arguments[1];this._coord=a,this._edges=u,this._label=new Ki(0,A.NONE)}}])})(q_),IN=(function(c){function r(){return s(this,r),n(this,r,arguments)}return m(r,c),l(r)})(F_);function $_(c){return c==null?0:c.color}function ee(c){return c==null?null:c.parent}function $n(c,r){c!==null&&(c.color=r)}function Jg(c){return c==null?null:c.left}function W_(c){return c==null?null:c.right}var jh=(function(c){function r(){var a;return s(this,r),(a=n(this,r)).root_=null,a.size_=0,a}return m(r,c),l(r,[{key:"get",value:function(a){for(var u=this.root_;u!==null;){var g=a.compareTo(u.key);if(g<0)u=u.left;else{if(!(g>0))return u.value;u=u.right}}return null}},{key:"put",value:function(a,u){if(this.root_===null)return this.root_={key:a,value:u,left:null,right:null,parent:null,color:0,getValue:function(){return this.value},getKey:function(){return this.key}},this.size_=1,null;var g,_,E=this.root_;do if(g=E,(_=a.compareTo(E.key))<0)E=E.left;else{if(!(_>0)){var P=E.value;return E.value=u,P}E=E.right}while(E!==null);var O={key:a,left:null,right:null,value:u,parent:g,color:0,getValue:function(){return this.value},getKey:function(){return this.key}};return _<0?g.left=O:g.right=O,this.fixAfterInsertion(O),this.size_++,null}},{key:"fixAfterInsertion",value:function(a){var u;for(a.color=1;a!=null&&a!==this.root_&&a.parent.color===1;)ee(a)===Jg(ee(ee(a)))?$_(u=W_(ee(ee(a))))===1?($n(ee(a),0),$n(u,0),$n(ee(ee(a)),1),a=ee(ee(a))):(a===W_(ee(a))&&(a=ee(a),this.rotateLeft(a)),$n(ee(a),0),$n(ee(ee(a)),1),this.rotateRight(ee(ee(a)))):$_(u=Jg(ee(ee(a))))===1?($n(ee(a),0),$n(u,0),$n(ee(ee(a)),1),a=ee(ee(a))):(a===Jg(ee(a))&&(a=ee(a),this.rotateRight(a)),$n(ee(a),0),$n(ee(ee(a)),1),this.rotateLeft(ee(ee(a))));this.root_.color=0}},{key:"values",value:function(){var a=new Gt,u=this.getFirstEntry();if(u!==null)for(a.add(u.value);(u=r.successor(u))!==null;)a.add(u.value);return a}},{key:"entrySet",value:function(){var a=new le,u=this.getFirstEntry();if(u!==null)for(a.add(u);(u=r.successor(u))!==null;)a.add(u);return a}},{key:"rotateLeft",value:function(a){if(a!=null){var u=a.right;a.right=u.left,u.left!=null&&(u.left.parent=a),u.parent=a.parent,a.parent==null?this.root_=u:a.parent.left===a?a.parent.left=u:a.parent.right=u,u.left=a,a.parent=u}}},{key:"rotateRight",value:function(a){if(a!=null){var u=a.left;a.left=u.right,u.right!=null&&(u.right.parent=a),u.parent=a.parent,a.parent==null?this.root_=u:a.parent.right===a?a.parent.right=u:a.parent.left=u,u.right=a,a.parent=u}}},{key:"getFirstEntry",value:function(){var a=this.root_;if(a!=null)for(;a.left!=null;)a=a.left;return a}},{key:"size",value:function(){return this.size_}},{key:"containsKey",value:function(a){for(var u=this.root_;u!==null;){var g=a.compareTo(u.key);if(g<0)u=u.left;else{if(!(g>0))return!0;u=u.right}}return!1}}],[{key:"successor",value:function(a){var u;if(a===null)return null;if(a.right!==null){for(u=a.right;u.left!==null;)u=u.left;return u}u=a.parent;for(var g=a;u!==null&&g===u.right;)g=u,u=u.parent;return u}}])})(IN),H_=(function(){return l((function c(){s(this,c),c.constructor_.apply(this,arguments)}),[{key:"find",value:function(c){return this.nodeMap.get(c)}},{key:"addNode",value:function(){if(arguments[0]instanceof K){var c=arguments[0],r=this.nodeMap.get(c);return r===null&&(r=this.nodeFact.createNode(c),this.nodeMap.put(c,r)),r}if(arguments[0]instanceof ju){var a=arguments[0],u=this.nodeMap.get(a.getCoordinate());return u===null?(this.nodeMap.put(a.getCoordinate(),a),a):(u.mergeLabel(a),u)}}},{key:"print",value:function(c){for(var r=this.iterator();r.hasNext();)r.next().print(c)}},{key:"iterator",value:function(){return this.nodeMap.values().iterator()}},{key:"values",value:function(){return this.nodeMap.values()}},{key:"getBoundaryNodes",value:function(c){for(var r=new Gt,a=this.iterator();a.hasNext();){var u=a.next();u.getLabel().getLocation(c)===A.BOUNDARY&&r.add(u)}return r}},{key:"add",value:function(c){var r=c.getCoordinate();this.addNode(r).add(c)}}],[{key:"constructor_",value:function(){this.nodeMap=new jh,this.nodeFact=null;var c=arguments[0];this.nodeFact=c}}])})(),li=(function(){function c(){s(this,c)}return l(c,null,[{key:"isNorthern",value:function(r){return r===c.NE||r===c.NW}},{key:"isOpposite",value:function(r,a){return r!==a&&(r-a+4)%4===2}},{key:"commonHalfPlane",value:function(r,a){if(r===a)return r;if((r-a+4)%4===2)return-1;var u=r<a?r:a;return u===0&&(r>a?r:a)===3?3:u}},{key:"isInHalfPlane",value:function(r,a){return a===c.SE?r===c.SE||r===c.SW:r===a||r===a+1}},{key:"quadrant",value:function(){if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var r=arguments[0],a=arguments[1];if(r===0&&a===0)throw new D("Cannot compute the quadrant for point ( "+r+", "+a+" )");return r>=0?a>=0?c.NE:c.SE:a>=0?c.NW:c.SW}if(arguments[0]instanceof K&&arguments[1]instanceof K){var u=arguments[0],g=arguments[1];if(g.x===u.x&&g.y===u.y)throw new D("Cannot compute the quadrant for two identical points "+u);return g.x>=u.x?g.y>=u.y?c.NE:c.SE:g.y>=u.y?c.NW:c.SW}}}])})();li.NE=0,li.NW=1,li.SW=2,li.SE=3;var X_=(function(){function c(){s(this,c),c.constructor_.apply(this,arguments)}return l(c,[{key:"compareDirection",value:function(r){return this._dx===r._dx&&this._dy===r._dy?0:this._quadrant>r._quadrant?1:this._quadrant<r._quadrant?-1:Ut.index(r._p0,r._p1,this._p1)}},{key:"getDy",value:function(){return this._dy}},{key:"getCoordinate",value:function(){return this._p0}},{key:"setNode",value:function(r){this._node=r}},{key:"print",value:function(r){var a=Math.atan2(this._dy,this._dx),u=this.getClass().getName(),g=u.lastIndexOf("."),_=u.substring(g+1);r.print(" "+_+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+a+" "+this._label)}},{key:"compareTo",value:function(r){var a=r;return this.compareDirection(a)}},{key:"getDirectedCoordinate",value:function(){return this._p1}},{key:"getDx",value:function(){return this._dx}},{key:"getLabel",value:function(){return this._label}},{key:"getEdge",value:function(){return this._edge}},{key:"getQuadrant",value:function(){return this._quadrant}},{key:"getNode",value:function(){return this._node}},{key:"toString",value:function(){var r=Math.atan2(this._dy,this._dx),a=this.getClass().getName(),u=a.lastIndexOf(".");return" "+a.substring(u+1)+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+r+" "+this._label}},{key:"computeLabel",value:function(r){}},{key:"init",value:function(r,a){this._p0=r,this._p1=a,this._dx=a.x-r.x,this._dy=a.y-r.y,this._quadrant=li.quadrant(this._dx,this._dy),ct.isTrue(!(this._dx===0&&this._dy===0),"EdgeEnd with identical endpoints found")}},{key:"interfaces_",get:function(){return[V]}}],[{key:"constructor_",value:function(){if(this._edge=null,this._label=null,this._node=null,this._p0=null,this._p1=null,this._dx=null,this._dy=null,this._quadrant=null,arguments.length===1){var r=arguments[0];this._edge=r}else if(arguments.length===3){var a=arguments[0],u=arguments[1],g=arguments[2];c.constructor_.call(this,a,u,g,null)}else if(arguments.length===4){var _=arguments[0],E=arguments[1],P=arguments[2],O=arguments[3];c.constructor_.call(this,_),this.init(E,P),this._label=O}}}])})(),Kg=(function(c){function r(){var a;return s(this,r),a=n(this,r),r.constructor_.apply(a,arguments),a}return m(r,c),l(r,[{key:"getNextMin",value:function(){return this._nextMin}},{key:"getDepth",value:function(a){return this._depth[a]}},{key:"setVisited",value:function(a){this._isVisited=a}},{key:"computeDirectedLabel",value:function(){this._label=new Ki(this._edge.getLabel()),this._isForward||this._label.flip()}},{key:"getNext",value:function(){return this._next}},{key:"setDepth",value:function(a,u){if(this._depth[a]!==-999&&this._depth[a]!==u)throw new fs("assigned depths do not match",this.getCoordinate());this._depth[a]=u}},{key:"isInteriorAreaEdge",value:function(){for(var a=!0,u=0;u<2;u++)this._label.isArea(u)&&this._label.getLocation(u,ut.LEFT)===A.INTERIOR&&this._label.getLocation(u,ut.RIGHT)===A.INTERIOR||(a=!1);return a}},{key:"setNextMin",value:function(a){this._nextMin=a}},{key:"print",value:function(a){S(r,"print",this,1).call(this,a),a.print(" "+this._depth[ut.LEFT]+"/"+this._depth[ut.RIGHT]),a.print(" ("+this.getDepthDelta()+")"),this._isInResult&&a.print(" inResult")}},{key:"setMinEdgeRing",value:function(a){this._minEdgeRing=a}},{key:"isLineEdge",value:function(){var a=this._label.isLine(0)||this._label.isLine(1),u=!this._label.isArea(0)||this._label.allPositionsEqual(0,A.EXTERIOR),g=!this._label.isArea(1)||this._label.allPositionsEqual(1,A.EXTERIOR);return a&&u&&g}},{key:"setEdgeRing",value:function(a){this._edgeRing=a}},{key:"getMinEdgeRing",value:function(){return this._minEdgeRing}},{key:"getDepthDelta",value:function(){var a=this._edge.getDepthDelta();return this._isForward||(a=-a),a}},{key:"setInResult",value:function(a){this._isInResult=a}},{key:"getSym",value:function(){return this._sym}},{key:"isForward",value:function(){return this._isForward}},{key:"getEdge",value:function(){return this._edge}},{key:"printEdge",value:function(a){this.print(a),a.print(" "),this._isForward?this._edge.print(a):this._edge.printReverse(a)}},{key:"setSym",value:function(a){this._sym=a}},{key:"setVisitedEdge",value:function(a){this.setVisited(a),this._sym.setVisited(a)}},{key:"setEdgeDepths",value:function(a,u){var g=this.getEdge().getDepthDelta();this._isForward||(g=-g);var _=1;a===ut.LEFT&&(_=-1);var E=ut.opposite(a),P=u+g*_;this.setDepth(a,u),this.setDepth(E,P)}},{key:"getEdgeRing",value:function(){return this._edgeRing}},{key:"isInResult",value:function(){return this._isInResult}},{key:"setNext",value:function(a){this._next=a}},{key:"isVisited",value:function(){return this._isVisited}}],[{key:"constructor_",value:function(){this._isForward=null,this._isInResult=!1,this._isVisited=!1,this._sym=null,this._next=null,this._nextMin=null,this._edgeRing=null,this._minEdgeRing=null,this._depth=[0,-999,-999];var a=arguments[0],u=arguments[1];if(X_.constructor_.call(this,a),this._isForward=u,u)this.init(a.getCoordinate(0),a.getCoordinate(1));else{var g=a.getNumPoints()-1;this.init(a.getCoordinate(g),a.getCoordinate(g-1))}this.computeDirectedLabel()}},{key:"depthFactor",value:function(a,u){return a===A.EXTERIOR&&u===A.INTERIOR?1:a===A.INTERIOR&&u===A.EXTERIOR?-1:0}}])})(X_),Y_=(function(){return l((function c(){s(this,c)}),[{key:"createNode",value:function(c){return new ju(c,null)}}])})(),J_=(function(){return l((function c(){s(this,c),c.constructor_.apply(this,arguments)}),[{key:"printEdges",value:function(c){c.println("Edges:");for(var r=0;r<this._edges.size();r++){c.println("edge "+r+":");var a=this._edges.get(r);a.print(c),a.eiList.print(c)}}},{key:"find",value:function(c){return this._nodes.find(c)}},{key:"addNode",value:function(){if(arguments[0]instanceof ju){var c=arguments[0];return this._nodes.addNode(c)}if(arguments[0]instanceof K){var r=arguments[0];return this._nodes.addNode(r)}}},{key:"getNodeIterator",value:function(){return this._nodes.iterator()}},{key:"linkResultDirectedEdges",value:function(){for(var c=this._nodes.iterator();c.hasNext();)c.next().getEdges().linkResultDirectedEdges()}},{key:"debugPrintln",value:function(c){Yi.out.println(c)}},{key:"isBoundaryNode",value:function(c,r){var a=this._nodes.find(r);if(a===null)return!1;var u=a.getLabel();return u!==null&&u.getLocation(c)===A.BOUNDARY}},{key:"linkAllDirectedEdges",value:function(){for(var c=this._nodes.iterator();c.hasNext();)c.next().getEdges().linkAllDirectedEdges()}},{key:"matchInSameDirection",value:function(c,r,a,u){return!!c.equals(a)&&Ut.index(c,r,u)===Ut.COLLINEAR&&li.quadrant(c,r)===li.quadrant(a,u)}},{key:"getEdgeEnds",value:function(){return this._edgeEndList}},{key:"debugPrint",value:function(c){Yi.out.print(c)}},{key:"getEdgeIterator",value:function(){return this._edges.iterator()}},{key:"findEdgeInSameDirection",value:function(c,r){for(var a=0;a<this._edges.size();a++){var u=this._edges.get(a),g=u.getCoordinates();if(this.matchInSameDirection(c,r,g[0],g[1])||this.matchInSameDirection(c,r,g[g.length-1],g[g.length-2]))return u}return null}},{key:"insertEdge",value:function(c){this._edges.add(c)}},{key:"findEdgeEnd",value:function(c){for(var r=this.getEdgeEnds().iterator();r.hasNext();){var a=r.next();if(a.getEdge()===c)return a}return null}},{key:"addEdges",value:function(c){for(var r=c.iterator();r.hasNext();){var a=r.next();this._edges.add(a);var u=new Kg(a,!0),g=new Kg(a,!1);u.setSym(g),g.setSym(u),this.add(u),this.add(g)}}},{key:"add",value:function(c){this._nodes.add(c),this._edgeEndList.add(c)}},{key:"getNodes",value:function(){return this._nodes.values()}},{key:"findEdge",value:function(c,r){for(var a=0;a<this._edges.size();a++){var u=this._edges.get(a),g=u.getCoordinates();if(c.equals(g[0])&&r.equals(g[1]))return u}return null}}],[{key:"constructor_",value:function(){if(this._edges=new Gt,this._nodes=null,this._edgeEndList=new Gt,arguments.length===0)this._nodes=new H_(new Y_);else if(arguments.length===1){var c=arguments[0];this._nodes=new H_(c)}}},{key:"linkResultDirectedEdges",value:function(c){for(var r=c.iterator();r.hasNext();)r.next().getEdges().linkResultDirectedEdges()}}])})(),MN=(function(){function c(){s(this,c),c.constructor_.apply(this,arguments)}return l(c,[{key:"sortShellsAndHoles",value:function(r,a,u){for(var g=r.iterator();g.hasNext();){var _=g.next();_.isHole()?u.add(_):a.add(_)}}},{key:"computePolygons",value:function(r){for(var a=new Gt,u=r.iterator();u.hasNext();){var g=u.next().toPolygon(this._geometryFactory);a.add(g)}return a}},{key:"placeFreeHoles",value:function(r,a){for(var u=a.iterator();u.hasNext();){var g=u.next();if(g.getShell()===null){var _=c.findEdgeRingContaining(g,r);if(_===null)throw new fs("unable to assign hole to a shell",g.getCoordinate(0));g.setShell(_)}}}},{key:"buildMinimalEdgeRings",value:function(r,a,u){for(var g=new Gt,_=r.iterator();_.hasNext();){var E=_.next();if(E.getMaxNodeDegree()>2){E.linkDirectedEdgesForMinimalEdgeRings();var P=E.buildMinimalRings(),O=this.findShell(P);O!==null?(this.placePolygonHoles(O,P),a.add(O)):u.addAll(P)}else g.add(E)}return g}},{key:"buildMaximalEdgeRings",value:function(r){for(var a=new Gt,u=r.iterator();u.hasNext();){var g=u.next();if(g.isInResult()&&g.getLabel().isArea()&&g.getEdgeRing()===null){var _=new CN(g,this._geometryFactory);a.add(_),_.setInResult()}}return a}},{key:"placePolygonHoles",value:function(r,a){for(var u=a.iterator();u.hasNext();){var g=u.next();g.isHole()&&g.setShell(r)}}},{key:"getPolygons",value:function(){return this.computePolygons(this._shellList)}},{key:"findShell",value:function(r){for(var a=0,u=null,g=r.iterator();g.hasNext();){var _=g.next();_.isHole()||(u=_,a++)}return ct.isTrue(a<=1,"found two shells in MinimalEdgeRing list"),u}},{key:"add",value:function(){if(arguments.length===1){var r=arguments[0];this.add(r.getEdgeEnds(),r.getNodes())}else if(arguments.length===2){var a=arguments[0],u=arguments[1];J_.linkResultDirectedEdges(u);var g=this.buildMaximalEdgeRings(a),_=new Gt,E=this.buildMinimalEdgeRings(g,this._shellList,_);this.sortShellsAndHoles(E,this._shellList,_),this.placeFreeHoles(this._shellList,_)}}}],[{key:"constructor_",value:function(){this._geometryFactory=null,this._shellList=new Gt;var r=arguments[0];this._geometryFactory=r}},{key:"findEdgeRingContaining",value:function(r,a){for(var u=r.getLinearRing(),g=u.getEnvelopeInternal(),_=u.getCoordinateN(0),E=null,P=null,O=a.iterator();O.hasNext();){var B=O.next(),Z=B.getLinearRing(),tt=Z.getEnvelopeInternal();if(!tt.equals(g)&&tt.contains(g)){_=De.ptNotInList(u.getCoordinates(),Z.getCoordinates());var ot=!1;Yg.isInRing(_,Z.getCoordinates())&&(ot=!0),ot&&(E===null||P.contains(tt))&&(P=(E=B).getLinearRing().getEnvelopeInternal())}}return E}}])})(),K_=(function(){return l((function c(){s(this,c)}),[{key:"getBounds",value:function(){}}])})(),ps=(function(){return l((function c(){s(this,c),c.constructor_.apply(this,arguments)}),[{key:"getItem",value:function(){return this._item}},{key:"getBounds",value:function(){return this._bounds}},{key:"interfaces_",get:function(){return[K_,I]}}],[{key:"constructor_",value:function(){this._bounds=null,this._item=null;var c=arguments[0],r=arguments[1];this._bounds=c,this._item=r}}])})(),Bu=(function(){return l((function c(){s(this,c),c.constructor_.apply(this,arguments)}),[{key:"poll",value:function(){if(this.isEmpty())return null;var c=this._items.get(1);return this._items.set(1,this._items.get(this._size)),this._size-=1,this.reorder(1),c}},{key:"size",value:function(){return this._size}},{key:"reorder",value:function(c){for(var r=null,a=this._items.get(c);2*c<=this._size&&((r=2*c)!==this._size&&this._items.get(r+1).compareTo(this._items.get(r))<0&&r++,this._items.get(r).compareTo(a)<0);c=r)this._items.set(c,this._items.get(r));this._items.set(c,a)}},{key:"clear",value:function(){this._size=0,this._items.clear()}},{key:"peek",value:function(){return this.isEmpty()?null:this._items.get(1)}},{key:"isEmpty",value:function(){return this._size===0}},{key:"add",value:function(c){this._items.add(null),this._size+=1;var r=this._size;for(this._items.set(0,c);c.compareTo(this._items.get(Math.trunc(r/2)))<0;r/=2)this._items.set(r,this._items.get(Math.trunc(r/2)));this._items.set(r,c)}}],[{key:"constructor_",value:function(){this._size=null,this._items=null,this._size=0,this._items=new Gt,this._items.add(null)}}])})(),TN=(function(){return l((function c(){s(this,c)}),[{key:"insert",value:function(c,r){}},{key:"remove",value:function(c,r){}},{key:"query",value:function(){}}])})(),Zi=(function(){return l((function c(){s(this,c),c.constructor_.apply(this,arguments)}),[{key:"getLevel",value:function(){return this._level}},{key:"size",value:function(){return this._childBoundables.size()}},{key:"getChildBoundables",value:function(){return this._childBoundables}},{key:"addChildBoundable",value:function(c){ct.isTrue(this._bounds===null),this._childBoundables.add(c)}},{key:"isEmpty",value:function(){return this._childBoundables.isEmpty()}},{key:"getBounds",value:function(){return this._bounds===null&&(this._bounds=this.computeBounds()),this._bounds}},{key:"interfaces_",get:function(){return[K_,I]}}],[{key:"constructor_",value:function(){if(this._childBoundables=new Gt,this._bounds=null,this._level=null,arguments.length!==0){if(arguments.length===1){var c=arguments[0];this._level=c}}}}])})(),mo={reverseOrder:function(){return{compare:function(c,r){return r.compareTo(c)}}},min:function(c){return mo.sort(c),c.get(0)},sort:function(c,r){var a=c.toArray();r?Vr.sort(a,r):Vr.sort(a);for(var u=c.iterator(),g=0,_=a.length;g<_;g++)u.next(),u.set(a[g])},singletonList:function(c){var r=new Gt;return r.add(c),r}},kN=(function(){function c(){s(this,c)}return l(c,null,[{key:"maxDistance",value:function(r,a,u,g,_,E,P,O){var B=c.distance(r,a,_,E);return B=Math.max(B,c.distance(r,a,P,O)),B=Math.max(B,c.distance(u,g,_,E)),B=Math.max(B,c.distance(u,g,P,O))}},{key:"distance",value:function(r,a,u,g){var _=u-r,E=g-a;return Math.sqrt(_*_+E*E)}},{key:"maximumDistance",value:function(r,a){var u=Math.min(r.getMinX(),a.getMinX()),g=Math.min(r.getMinY(),a.getMinY()),_=Math.max(r.getMaxX(),a.getMaxX()),E=Math.max(r.getMaxY(),a.getMaxY());return c.distance(u,g,_,E)}},{key:"minMaxDistance",value:function(r,a){var u=r.getMinX(),g=r.getMinY(),_=r.getMaxX(),E=r.getMaxY(),P=a.getMinX(),O=a.getMinY(),B=a.getMaxX(),Z=a.getMaxY(),tt=c.maxDistance(u,g,u,E,P,O,P,Z);return tt=Math.min(tt,c.maxDistance(u,g,u,E,P,O,B,O)),tt=Math.min(tt,c.maxDistance(u,g,u,E,B,Z,P,Z)),tt=Math.min(tt,c.maxDistance(u,g,u,E,B,Z,B,O)),tt=Math.min(tt,c.maxDistance(u,g,_,g,P,O,P,Z)),tt=Math.min(tt,c.maxDistance(u,g,_,g,P,O,B,O)),tt=Math.min(tt,c.maxDistance(u,g,_,g,B,Z,P,Z)),tt=Math.min(tt,c.maxDistance(u,g,_,g,B,Z,B,O)),tt=Math.min(tt,c.maxDistance(_,E,u,E,P,O,P,Z)),tt=Math.min(tt,c.maxDistance(_,E,u,E,P,O,B,O)),tt=Math.min(tt,c.maxDistance(_,E,u,E,B,Z,P,Z)),tt=Math.min(tt,c.maxDistance(_,E,u,E,B,Z,B,O)),tt=Math.min(tt,c.maxDistance(_,E,_,g,P,O,P,Z)),tt=Math.min(tt,c.maxDistance(_,E,_,g,P,O,B,O)),tt=Math.min(tt,c.maxDistance(_,E,_,g,B,Z,P,Z)),tt=Math.min(tt,c.maxDistance(_,E,_,g,B,Z,B,O))}}])})(),vo=(function(){function c(){s(this,c),c.constructor_.apply(this,arguments)}return l(c,[{key:"maximumDistance",value:function(){return kN.maximumDistance(this._boundable1.getBounds(),this._boundable2.getBounds())}},{key:"expandToQueue",value:function(r,a){var u=c.isComposite(this._boundable1),g=c.isComposite(this._boundable2);if(u&&g)return c.area(this._boundable1)>c.area(this._boundable2)?(this.expand(this._boundable1,this._boundable2,!1,r,a),null):(this.expand(this._boundable2,this._boundable1,!0,r,a),null);if(u)return this.expand(this._boundable1,this._boundable2,!1,r,a),null;if(g)return this.expand(this._boundable2,this._boundable1,!0,r,a),null;throw new D("neither boundable is composite")}},{key:"isLeaves",value:function(){return!(c.isComposite(this._boundable1)||c.isComposite(this._boundable2))}},{key:"compareTo",value:function(r){var a=r;return this._distance<a._distance?-1:this._distance>a._distance?1:0}},{key:"expand",value:function(r,a,u,g,_){for(var E=r.getChildBoundables().iterator();E.hasNext();){var P=E.next(),O=null;(O=u?new c(a,P,this._itemDistance):new c(P,a,this._itemDistance)).getDistance()<_&&g.add(O)}}},{key:"getBoundable",value:function(r){return r===0?this._boundable1:this._boundable2}},{key:"getDistance",value:function(){return this._distance}},{key:"distance",value:function(){return this.isLeaves()?this._itemDistance.distance(this._boundable1,this._boundable2):this._boundable1.getBounds().distance(this._boundable2.getBounds())}},{key:"interfaces_",get:function(){return[V]}}],[{key:"constructor_",value:function(){this._boundable1=null,this._boundable2=null,this._distance=null,this._itemDistance=null;var r=arguments[0],a=arguments[1],u=arguments[2];this._boundable1=r,this._boundable2=a,this._itemDistance=u,this._distance=this.distance()}},{key:"area",value:function(r){return r.getBounds().getArea()}},{key:"isComposite",value:function(r){return r instanceof Zi}}])})(),Z_=(function(){return l((function c(){s(this,c)}),[{key:"visitItem",value:function(c){}}])})(),yo=(function(){function c(){s(this,c),c.constructor_.apply(this,arguments)}return l(c,[{key:"queryInternal",value:function(){if(Vt(arguments[2],Z_)&&arguments[0]instanceof Object&&arguments[1]instanceof Zi)for(var r=arguments[0],a=arguments[2],u=arguments[1].getChildBoundables(),g=0;g<u.size();g++){var _=u.get(g);this.getIntersectsOp().intersects(_.getBounds(),r)&&(_ instanceof Zi?this.queryInternal(r,_,a):_ instanceof ps?a.visitItem(_.getItem()):ct.shouldNeverReachHere())}else if(Vt(arguments[2],ds)&&arguments[0]instanceof Object&&arguments[1]instanceof Zi)for(var E=arguments[0],P=arguments[2],O=arguments[1].getChildBoundables(),B=0;B<O.size();B++){var Z=O.get(B);this.getIntersectsOp().intersects(Z.getBounds(),E)&&(Z instanceof Zi?this.queryInternal(E,Z,P):Z instanceof ps?P.add(Z.getItem()):ct.shouldNeverReachHere())}}},{key:"getNodeCapacity",value:function(){return this._nodeCapacity}},{key:"lastNode",value:function(r){return r.get(r.size()-1)}},{key:"size",value:function(){if(arguments.length===0)return this.isEmpty()?0:(this.build(),this.size(this._root));if(arguments.length===1){for(var r=0,a=arguments[0].getChildBoundables().iterator();a.hasNext();){var u=a.next();u instanceof Zi?r+=this.size(u):u instanceof ps&&(r+=1)}return r}}},{key:"removeItem",value:function(r,a){for(var u=null,g=r.getChildBoundables().iterator();g.hasNext();){var _=g.next();_ instanceof ps&&_.getItem()===a&&(u=_)}return u!==null&&(r.getChildBoundables().remove(u),!0)}},{key:"itemsTree",value:function(){if(arguments.length===0){this.build();var r=this.itemsTree(this._root);return r===null?new Gt:r}if(arguments.length===1){for(var a=arguments[0],u=new Gt,g=a.getChildBoundables().iterator();g.hasNext();){var _=g.next();if(_ instanceof Zi){var E=this.itemsTree(_);E!==null&&u.add(E)}else _ instanceof ps?u.add(_.getItem()):ct.shouldNeverReachHere()}return u.size()<=0?null:u}}},{key:"insert",value:function(r,a){ct.isTrue(!this._built,"Cannot insert items into an STR packed R-tree after it has been built."),this._itemBoundables.add(new ps(r,a))}},{key:"boundablesAtLevel",value:function(){if(arguments.length===1){var r=arguments[0],a=new Gt;return this.boundablesAtLevel(r,this._root,a),a}if(arguments.length===3){var u=arguments[0],g=arguments[1],_=arguments[2];if(ct.isTrue(u>-2),g.getLevel()===u)return _.add(g),null;for(var E=g.getChildBoundables().iterator();E.hasNext();){var P=E.next();P instanceof Zi?this.boundablesAtLevel(u,P,_):(ct.isTrue(P instanceof ps),u===-1&&_.add(P))}return null}}},{key:"query",value:function(){if(arguments.length===1){var r=arguments[0];this.build();var a=new Gt;return this.isEmpty()||this.getIntersectsOp().intersects(this._root.getBounds(),r)&&this.queryInternal(r,this._root,a),a}if(arguments.length===2){var u=arguments[0],g=arguments[1];if(this.build(),this.isEmpty())return null;this.getIntersectsOp().intersects(this._root.getBounds(),u)&&this.queryInternal(u,this._root,g)}}},{key:"build",value:function(){if(this._built)return null;this._root=this._itemBoundables.isEmpty()?this.createNode(0):this.createHigherLevels(this._itemBoundables,-1),this._itemBoundables=null,this._built=!0}},{key:"getRoot",value:function(){return this.build(),this._root}},{key:"remove",value:function(){if(arguments.length===2){var r=arguments[0],a=arguments[1];return this.build(),!!this.getIntersectsOp().intersects(this._root.getBounds(),r)&&this.remove(r,this._root,a)}if(arguments.length===3){var u=arguments[0],g=arguments[1],_=arguments[2],E=this.removeItem(g,_);if(E)return!0;for(var P=null,O=g.getChildBoundables().iterator();O.hasNext();){var B=O.next();if(this.getIntersectsOp().intersects(B.getBounds(),u)&&B instanceof Zi&&(E=this.remove(u,B,_))){P=B;break}}return P!==null&&P.getChildBoundables().isEmpty()&&g.getChildBoundables().remove(P),E}}},{key:"createHigherLevels",value:function(r,a){ct.isTrue(!r.isEmpty());var u=this.createParentBoundables(r,a+1);return u.size()===1?u.get(0):this.createHigherLevels(u,a+1)}},{key:"depth",value:function(){if(arguments.length===0)return this.isEmpty()?0:(this.build(),this.depth(this._root));if(arguments.length===1){for(var r=0,a=arguments[0].getChildBoundables().iterator();a.hasNext();){var u=a.next();if(u instanceof Zi){var g=this.depth(u);g>r&&(r=g)}}return r+1}}},{key:"createParentBoundables",value:function(r,a){ct.isTrue(!r.isEmpty());var u=new Gt;u.add(this.createNode(a));var g=new Gt(r);mo.sort(g,this.getComparator());for(var _=g.iterator();_.hasNext();){var E=_.next();this.lastNode(u).getChildBoundables().size()===this.getNodeCapacity()&&u.add(this.createNode(a)),this.lastNode(u).addChildBoundable(E)}return u}},{key:"isEmpty",value:function(){return this._built?this._root.isEmpty():this._itemBoundables.isEmpty()}},{key:"interfaces_",get:function(){return[I]}}],[{key:"constructor_",value:function(){if(this._root=null,this._built=!1,this._itemBoundables=new Gt,this._nodeCapacity=null,arguments.length===0)c.constructor_.call(this,c.DEFAULT_NODE_CAPACITY);else if(arguments.length===1){var r=arguments[0];ct.isTrue(r>1,"Node capacity must be greater than 1"),this._nodeCapacity=r}}},{key:"compareDoubles",value:function(r,a){return r>a?1:r<a?-1:0}}])})();yo.IntersectsOp=function(){},yo.DEFAULT_NODE_CAPACITY=10;var ON=(function(){return l((function c(){s(this,c)}),[{key:"distance",value:function(c,r){}}])})(),Wn=(function(c){function r(){var a;return s(this,r),a=n(this,r),r.constructor_.apply(a,arguments),a}return m(r,c),l(r,[{key:"createParentBoundablesFromVerticalSlices",value:function(a,u){ct.isTrue(a.length>0);for(var g=new Gt,_=0;_<a.length;_++)g.addAll(this.createParentBoundablesFromVerticalSlice(a[_],u));return g}},{key:"nearestNeighbourK",value:function(){if(arguments.length===2){var a=arguments[0],u=arguments[1];return this.nearestNeighbourK(a,J.POSITIVE_INFINITY,u)}if(arguments.length===3){var g=arguments[0],_=arguments[2],E=arguments[1],P=new Bu;P.add(g);for(var O=new Bu;!P.isEmpty()&&E>=0;){var B=P.poll(),Z=B.getDistance();if(Z>=E)break;B.isLeaves()?O.size()<_?O.add(B):(O.peek().getDistance()>Z&&(O.poll(),O.add(B)),E=O.peek().getDistance()):B.expandToQueue(P,E)}return r.getItems(O)}}},{key:"createNode",value:function(a){return new Q_(a)}},{key:"size",value:function(){return arguments.length===0?S(r,"size",this,1).call(this):S(r,"size",this,1).apply(this,arguments)}},{key:"insert",value:function(){if(!(arguments.length===2&&arguments[1]instanceof Object&&arguments[0]instanceof zt))return S(r,"insert",this,1).apply(this,arguments);var a=arguments[0],u=arguments[1];if(a.isNull())return null;S(r,"insert",this,1).call(this,a,u)}},{key:"getIntersectsOp",value:function(){return r.intersectsOp}},{key:"verticalSlices",value:function(a,u){for(var g=Math.trunc(Math.ceil(a.size()/u)),_=new Array(u).fill(null),E=a.iterator(),P=0;P<u;P++){_[P]=new Gt;for(var O=0;E.hasNext()&&O<g;){var B=E.next();_[P].add(B),O++}}return _}},{key:"query",value:function(){if(arguments.length===1){var a=arguments[0];return S(r,"query",this,1).call(this,a)}if(arguments.length===2){var u=arguments[0],g=arguments[1];S(r,"query",this,1).call(this,u,g)}}},{key:"getComparator",value:function(){return r.yComparator}},{key:"createParentBoundablesFromVerticalSlice",value:function(a,u){return S(r,"createParentBoundables",this,1).call(this,a,u)}},{key:"remove",value:function(){if(arguments.length===2&&arguments[1]instanceof Object&&arguments[0]instanceof zt){var a=arguments[0],u=arguments[1];return S(r,"remove",this,1).call(this,a,u)}return S(r,"remove",this,1).apply(this,arguments)}},{key:"depth",value:function(){return arguments.length===0?S(r,"depth",this,1).call(this):S(r,"depth",this,1).apply(this,arguments)}},{key:"createParentBoundables",value:function(a,u){ct.isTrue(!a.isEmpty());var g=Math.trunc(Math.ceil(a.size()/this.getNodeCapacity())),_=new Gt(a);mo.sort(_,r.xComparator);var E=this.verticalSlices(_,Math.trunc(Math.ceil(Math.sqrt(g))));return this.createParentBoundablesFromVerticalSlices(E,u)}},{key:"nearestNeighbour",value:function(){if(arguments.length===1){if(Vt(arguments[0],ON)){var a=arguments[0];if(this.isEmpty())return null;var u=new vo(this.getRoot(),this.getRoot(),a);return this.nearestNeighbour(u)}if(arguments[0]instanceof vo){var g=arguments[0],_=J.POSITIVE_INFINITY,E=null,P=new Bu;for(P.add(g);!P.isEmpty()&&_>0;){var O=P.poll(),B=O.getDistance();if(B>=_)break;O.isLeaves()?(_=B,E=O):O.expandToQueue(P,_)}return E===null?null:[E.getBoundable(0).getItem(),E.getBoundable(1).getItem()]}}else{if(arguments.length===2){var Z=arguments[0],tt=arguments[1];if(this.isEmpty()||Z.isEmpty())return null;var ot=new vo(this.getRoot(),Z.getRoot(),tt);return this.nearestNeighbour(ot)}if(arguments.length===3){var Et=arguments[2],Nt=new ps(arguments[0],arguments[1]),Dt=new vo(this.getRoot(),Nt,Et);return this.nearestNeighbour(Dt)[0]}if(arguments.length===4){var Zt=arguments[2],Yt=arguments[3],oe=new ps(arguments[0],arguments[1]),qe=new vo(this.getRoot(),oe,Zt);return this.nearestNeighbourK(qe,Yt)}}}},{key:"isWithinDistance",value:function(){if(arguments.length===2){var a=arguments[0],u=arguments[1],g=J.POSITIVE_INFINITY,_=new Bu;for(_.add(a);!_.isEmpty();){var E=_.poll(),P=E.getDistance();if(P>u)return!1;if(E.maximumDistance()<=u)return!0;if(E.isLeaves()){if((g=P)<=u)return!0}else E.expandToQueue(_,g)}return!1}if(arguments.length===3){var O=arguments[0],B=arguments[1],Z=arguments[2],tt=new vo(this.getRoot(),O.getRoot(),B);return this.isWithinDistance(tt,Z)}}},{key:"interfaces_",get:function(){return[TN,I]}}],[{key:"constructor_",value:function(){if(arguments.length===0)r.constructor_.call(this,r.DEFAULT_NODE_CAPACITY);else if(arguments.length===1){var a=arguments[0];yo.constructor_.call(this,a)}}},{key:"centreX",value:function(a){return r.avg(a.getMinX(),a.getMaxX())}},{key:"avg",value:function(a,u){return(a+u)/2}},{key:"getItems",value:function(a){for(var u=new Array(a.size()).fill(null),g=0;!a.isEmpty();){var _=a.poll();u[g]=_.getBoundable(0).getItem(),g++}return u}},{key:"centreY",value:function(a){return r.avg(a.getMinY(),a.getMaxY())}}])})(yo),Q_=(function(c){function r(){var a;return s(this,r),a=n(this,r),r.constructor_.apply(a,arguments),a}return m(r,c),l(r,[{key:"computeBounds",value:function(){for(var a=null,u=this.getChildBoundables().iterator();u.hasNext();){var g=u.next();a===null?a=new zt(g.getBounds()):a.expandToInclude(g.getBounds())}return a}}],[{key:"constructor_",value:function(){var a=arguments[0];Zi.constructor_.call(this,a)}}])})(Zi);Wn.STRtreeNode=Q_,Wn.xComparator=new((function(){return l((function c(){s(this,c)}),[{key:"interfaces_",get:function(){return[rt]}},{key:"compare",value:function(c,r){return yo.compareDoubles(Wn.centreX(c.getBounds()),Wn.centreX(r.getBounds()))}}])})()),Wn.yComparator=new((function(){return l((function c(){s(this,c)}),[{key:"interfaces_",get:function(){return[rt]}},{key:"compare",value:function(c,r){return yo.compareDoubles(Wn.centreY(c.getBounds()),Wn.centreY(r.getBounds()))}}])})()),Wn.intersectsOp=new((function(){return l((function c(){s(this,c)}),[{key:"interfaces_",get:function(){return[IntersectsOp]}},{key:"intersects",value:function(c,r){return c.intersects(r)}}])})()),Wn.DEFAULT_NODE_CAPACITY=10;var NN=(function(){function c(){s(this,c)}return l(c,null,[{key:"relativeSign",value:function(r,a){return r<a?-1:r>a?1:0}},{key:"compare",value:function(r,a,u){if(a.equals2D(u))return 0;var g=c.relativeSign(a.x,u.x),_=c.relativeSign(a.y,u.y);switch(r){case 0:return c.compareValue(g,_);case 1:return c.compareValue(_,g);case 2:return c.compareValue(_,-g);case 3:return c.compareValue(-g,_);case 4:return c.compareValue(-g,-_);case 5:return c.compareValue(-_,-g);case 6:return c.compareValue(-_,g);case 7:return c.compareValue(g,-_)}return ct.shouldNeverReachHere("invalid octant value"),0}},{key:"compareValue",value:function(r,a){return r<0?-1:r>0?1:a<0?-1:a>0?1:0}}])})(),RN=(function(){return l((function c(){s(this,c),c.constructor_.apply(this,arguments)}),[{key:"getCoordinate",value:function(){return this.coord}},{key:"print",value:function(c){c.print(this.coord),c.print(" seg # = "+this.segmentIndex)}},{key:"compareTo",value:function(c){var r=c;return this.segmentIndex<r.segmentIndex?-1:this.segmentIndex>r.segmentIndex?1:this.coord.equals2D(r.coord)?0:this._isInterior?r._isInterior?NN.compare(this._segmentOctant,this.coord,r.coord):1:-1}},{key:"isEndPoint",value:function(c){return this.segmentIndex===0&&!this._isInterior||this.segmentIndex===c}},{key:"toString",value:function(){return this.segmentIndex+":"+this.coord.toString()}},{key:"isInterior",value:function(){return this._isInterior}},{key:"interfaces_",get:function(){return[V]}}],[{key:"constructor_",value:function(){this._segString=null,this.coord=null,this.segmentIndex=null,this._segmentOctant=null,this._isInterior=null;var c=arguments[0],r=arguments[1],a=arguments[2],u=arguments[3];this._segString=c,this.coord=new K(r),this.segmentIndex=a,this._segmentOctant=u,this._isInterior=!r.equals2D(c.getCoordinate(a))}}])})(),AN=(function(){return l((function c(){s(this,c)}),[{key:"hasNext",value:function(){}},{key:"next",value:function(){}},{key:"remove",value:function(){}}])})(),DN=(function(){return l((function c(){s(this,c),c.constructor_.apply(this,arguments)}),[{key:"getSplitCoordinates",value:function(){var c=new Lh;this.addEndpoints();for(var r=this.iterator(),a=r.next();r.hasNext();){var u=r.next();this.addEdgeCoordinates(a,u,c),a=u}return c.toCoordinateArray()}},{key:"addCollapsedNodes",value:function(){var c=new Gt;this.findCollapsesFromInsertedNodes(c),this.findCollapsesFromExistingVertices(c);for(var r=c.iterator();r.hasNext();){var a=r.next().intValue();this.add(this._edge.getCoordinate(a),a)}}},{key:"createSplitEdgePts",value:function(c,r){var a=r.segmentIndex-c.segmentIndex+2;if(a===2)return[new K(c.coord),new K(r.coord)];var u=this._edge.getCoordinate(r.segmentIndex),g=r.isInterior()||!r.coord.equals2D(u);g||a--;var _=new Array(a).fill(null),E=0;_[E++]=new K(c.coord);for(var P=c.segmentIndex+1;P<=r.segmentIndex;P++)_[E++]=this._edge.getCoordinate(P);return g&&(_[E]=new K(r.coord)),_}},{key:"print",value:function(c){c.println("Intersections:");for(var r=this.iterator();r.hasNext();)r.next().print(c)}},{key:"findCollapsesFromExistingVertices",value:function(c){for(var r=0;r<this._edge.size()-2;r++){var a=this._edge.getCoordinate(r);this._edge.getCoordinate(r+1);var u=this._edge.getCoordinate(r+2);a.equals2D(u)&&c.add(Hs.valueOf(r+1))}}},{key:"addEdgeCoordinates",value:function(c,r,a){var u=this.createSplitEdgePts(c,r);a.add(u,!1)}},{key:"iterator",value:function(){return this._nodeMap.values().iterator()}},{key:"addSplitEdges",value:function(c){this.addEndpoints(),this.addCollapsedNodes();for(var r=this.iterator(),a=r.next();r.hasNext();){var u=r.next(),g=this.createSplitEdge(a,u);c.add(g),a=u}}},{key:"findCollapseIndex",value:function(c,r,a){if(!c.coord.equals2D(r.coord))return!1;var u=r.segmentIndex-c.segmentIndex;return r.isInterior()||u--,u===1&&(a[0]=c.segmentIndex+1,!0)}},{key:"findCollapsesFromInsertedNodes",value:function(c){for(var r=new Array(1).fill(null),a=this.iterator(),u=a.next();a.hasNext();){var g=a.next();this.findCollapseIndex(u,g,r)&&c.add(Hs.valueOf(r[0])),u=g}}},{key:"getEdge",value:function(){return this._edge}},{key:"addEndpoints",value:function(){var c=this._edge.size()-1;this.add(this._edge.getCoordinate(0),0),this.add(this._edge.getCoordinate(c),c)}},{key:"createSplitEdge",value:function(c,r){var a=this.createSplitEdgePts(c,r);return new Hr(a,this._edge.getData())}},{key:"add",value:function(c,r){var a=new RN(this._edge,c,r,this._edge.getSegmentOctant(r)),u=this._nodeMap.get(a);return u!==null?(ct.isTrue(u.coord.equals2D(c),"Found equal nodes with different coordinates"),u):(this._nodeMap.put(a,a),a)}},{key:"checkSplitEdgesCorrectness",value:function(c){var r=this._edge.getCoordinates(),a=c.get(0).getCoordinate(0);if(!a.equals2D(r[0]))throw new ht("bad split edge start point at "+a);var u=c.get(c.size()-1).getCoordinates(),g=u[u.length-1];if(!g.equals2D(r[r.length-1]))throw new ht("bad split edge end point at "+g)}}],[{key:"constructor_",value:function(){this._nodeMap=new jh,this._edge=null;var c=arguments[0];this._edge=c}}])})(),LN=(function(){function c(){s(this,c)}return l(c,null,[{key:"octant",value:function(){if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var r=arguments[0],a=arguments[1];if(r===0&&a===0)throw new D("Cannot compute the octant for point ( "+r+", "+a+" )");var u=Math.abs(r),g=Math.abs(a);return r>=0?a>=0?u>=g?0:1:u>=g?7:6:a>=0?u>=g?3:2:u>=g?4:5}if(arguments[0]instanceof K&&arguments[1]instanceof K){var _=arguments[0],E=arguments[1],P=E.x-_.x,O=E.y-_.y;if(P===0&&O===0)throw new D("Cannot compute the octant for two identical points "+_);return c.octant(P,O)}}}])})(),FN=(function(){return l((function c(){s(this,c)}),[{key:"getCoordinates",value:function(){}},{key:"size",value:function(){}},{key:"getCoordinate",value:function(c){}},{key:"isClosed",value:function(){}},{key:"setData",value:function(c){}},{key:"getData",value:function(){}}])})(),GN=(function(){return l((function c(){s(this,c)}),[{key:"addIntersection",value:function(c,r){}},{key:"interfaces_",get:function(){return[FN]}}])})(),Hr=(function(){function c(){s(this,c),c.constructor_.apply(this,arguments)}return l(c,[{key:"getCoordinates",value:function(){return this._pts}},{key:"size",value:function(){return this._pts.length}},{key:"getCoordinate",value:function(r){return this._pts[r]}},{key:"isClosed",value:function(){return this._pts[0].equals(this._pts[this._pts.length-1])}},{key:"getSegmentOctant",value:function(r){return r===this._pts.length-1?-1:this.safeOctant(this.getCoordinate(r),this.getCoordinate(r+1))}},{key:"setData",value:function(r){this._data=r}},{key:"safeOctant",value:function(r,a){return r.equals2D(a)?0:LN.octant(r,a)}},{key:"getData",value:function(){return this._data}},{key:"addIntersection",value:function(){if(arguments.length===2){var r=arguments[0],a=arguments[1];this.addIntersectionNode(r,a)}else if(arguments.length===4){var u=arguments[1],g=arguments[3],_=new K(arguments[0].getIntersection(g));this.addIntersection(_,u)}}},{key:"toString",value:function(){return Xg.toLineString(new Fh(this._pts))}},{key:"getNodeList",value:function(){return this._nodeList}},{key:"addIntersectionNode",value:function(r,a){var u=a,g=u+1;if(g<this._pts.length){var _=this._pts[g];r.equals2D(_)&&(u=g)}return this._nodeList.add(r,u)}},{key:"addIntersections",value:function(r,a,u){for(var g=0;g<r.getIntersectionNum();g++)this.addIntersection(r,a,u,g)}},{key:"interfaces_",get:function(){return[GN]}}],[{key:"constructor_",value:function(){this._nodeList=new DN(this),this._pts=null,this._data=null;var r=arguments[0],a=arguments[1];this._pts=r,this._data=a}},{key:"getNodedSubstrings",value:function(){if(arguments.length===1){var r=arguments[0],a=new Gt;return c.getNodedSubstrings(r,a),a}if(arguments.length===2)for(var u=arguments[1],g=arguments[0].iterator();g.hasNext();)g.next().getNodeList().addSplitEdges(u)}}])})(),Ni=(function(){function c(){s(this,c),c.constructor_.apply(this,arguments)}return l(c,[{key:"minX",value:function(){return Math.min(this.p0.x,this.p1.x)}},{key:"orientationIndex",value:function(){if(arguments[0]instanceof c){var r=arguments[0],a=Ut.index(this.p0,this.p1,r.p0),u=Ut.index(this.p0,this.p1,r.p1);return a>=0&&u>=0||a<=0&&u<=0?Math.max(a,u):0}if(arguments[0]instanceof K){var g=arguments[0];return Ut.index(this.p0,this.p1,g)}}},{key:"toGeometry",value:function(r){return r.createLineString([this.p0,this.p1])}},{key:"isVertical",value:function(){return this.p0.x===this.p1.x}},{key:"equals",value:function(r){if(!(r instanceof c))return!1;var a=r;return this.p0.equals(a.p0)&&this.p1.equals(a.p1)}},{key:"intersection",value:function(r){var a=new Wr;return a.computeIntersection(this.p0,this.p1,r.p0,r.p1),a.hasIntersection()?a.getIntersection(0):null}},{key:"project",value:function(){if(arguments[0]instanceof K){var r=arguments[0];if(r.equals(this.p0)||r.equals(this.p1))return new K(r);var a=this.projectionFactor(r),u=new K;return u.x=this.p0.x+a*(this.p1.x-this.p0.x),u.y=this.p0.y+a*(this.p1.y-this.p0.y),u}if(arguments[0]instanceof c){var g=arguments[0],_=this.projectionFactor(g.p0),E=this.projectionFactor(g.p1);if(_>=1&&E>=1||_<=0&&E<=0)return null;var P=this.project(g.p0);_<0&&(P=this.p0),_>1&&(P=this.p1);var O=this.project(g.p1);return E<0&&(O=this.p0),E>1&&(O=this.p1),new c(P,O)}}},{key:"normalize",value:function(){this.p1.compareTo(this.p0)<0&&this.reverse()}},{key:"angle",value:function(){return Math.atan2(this.p1.y-this.p0.y,this.p1.x-this.p0.x)}},{key:"getCoordinate",value:function(r){return r===0?this.p0:this.p1}},{key:"distancePerpendicular",value:function(r){return qn.pointToLinePerpendicular(r,this.p0,this.p1)}},{key:"minY",value:function(){return Math.min(this.p0.y,this.p1.y)}},{key:"midPoint",value:function(){return c.midPoint(this.p0,this.p1)}},{key:"projectionFactor",value:function(r){if(r.equals(this.p0))return 0;if(r.equals(this.p1))return 1;var a=this.p1.x-this.p0.x,u=this.p1.y-this.p0.y,g=a*a+u*u;return g<=0?J.NaN:((r.x-this.p0.x)*a+(r.y-this.p0.y)*u)/g}},{key:"closestPoints",value:function(r){var a=this.intersection(r);if(a!==null)return[a,a];var u=new Array(2).fill(null),g=J.MAX_VALUE,_=null,E=this.closestPoint(r.p0);g=E.distance(r.p0),u[0]=E,u[1]=r.p0;var P=this.closestPoint(r.p1);(_=P.distance(r.p1))<g&&(g=_,u[0]=P,u[1]=r.p1);var O=r.closestPoint(this.p0);(_=O.distance(this.p0))<g&&(g=_,u[0]=this.p0,u[1]=O);var B=r.closestPoint(this.p1);return(_=B.distance(this.p1))<g&&(g=_,u[0]=this.p1,u[1]=B),u}},{key:"closestPoint",value:function(r){var a=this.projectionFactor(r);return a>0&&a<1?this.project(r):this.p0.distance(r)<this.p1.distance(r)?this.p0:this.p1}},{key:"maxX",value:function(){return Math.max(this.p0.x,this.p1.x)}},{key:"getLength",value:function(){return this.p0.distance(this.p1)}},{key:"compareTo",value:function(r){var a=r,u=this.p0.compareTo(a.p0);return u!==0?u:this.p1.compareTo(a.p1)}},{key:"reverse",value:function(){var r=this.p0;this.p0=this.p1,this.p1=r}},{key:"equalsTopo",value:function(r){return this.p0.equals(r.p0)&&this.p1.equals(r.p1)||this.p0.equals(r.p1)&&this.p1.equals(r.p0)}},{key:"lineIntersection",value:function(r){return Bg.intersection(this.p0,this.p1,r.p0,r.p1)}},{key:"maxY",value:function(){return Math.max(this.p0.y,this.p1.y)}},{key:"pointAlongOffset",value:function(r,a){var u=this.p0.x+r*(this.p1.x-this.p0.x),g=this.p0.y+r*(this.p1.y-this.p0.y),_=this.p1.x-this.p0.x,E=this.p1.y-this.p0.y,P=Math.sqrt(_*_+E*E),O=0,B=0;if(a!==0){if(P<=0)throw new IllegalStateException("Cannot compute offset from zero-length line segment");O=a*_/P,B=a*E/P}return new K(u-B,g+O)}},{key:"setCoordinates",value:function(){if(arguments.length===1){var r=arguments[0];this.setCoordinates(r.p0,r.p1)}else if(arguments.length===2){var a=arguments[0],u=arguments[1];this.p0.x=a.x,this.p0.y=a.y,this.p1.x=u.x,this.p1.y=u.y}}},{key:"segmentFraction",value:function(r){var a=this.projectionFactor(r);return a<0?a=0:(a>1||J.isNaN(a))&&(a=1),a}},{key:"toString",value:function(){return"LINESTRING( "+this.p0.x+" "+this.p0.y+", "+this.p1.x+" "+this.p1.y+")"}},{key:"isHorizontal",value:function(){return this.p0.y===this.p1.y}},{key:"reflect",value:function(r){var a=this.p1.getY()-this.p0.getY(),u=this.p0.getX()-this.p1.getX(),g=this.p0.getY()*(this.p1.getX()-this.p0.getX())-this.p0.getX()*(this.p1.getY()-this.p0.getY()),_=a*a+u*u,E=a*a-u*u,P=r.getX(),O=r.getY();return new K((-E*P-2*a*u*O-2*a*g)/_,(E*O-2*a*u*P-2*u*g)/_)}},{key:"distance",value:function(){if(arguments[0]instanceof c){var r=arguments[0];return qn.segmentToSegment(this.p0,this.p1,r.p0,r.p1)}if(arguments[0]instanceof K){var a=arguments[0];return qn.pointToSegment(a,this.p0,this.p1)}}},{key:"pointAlong",value:function(r){var a=new K;return a.x=this.p0.x+r*(this.p1.x-this.p0.x),a.y=this.p0.y+r*(this.p1.y-this.p0.y),a}},{key:"hashCode",value:function(){var r=J.doubleToLongBits(this.p0.x);r^=31*J.doubleToLongBits(this.p0.y);var a=Math.trunc(r)^Math.trunc(r>>32),u=J.doubleToLongBits(this.p1.x);return u^=31*J.doubleToLongBits(this.p1.y),a^(Math.trunc(u)^Math.trunc(u>>32))}},{key:"interfaces_",get:function(){return[V,I]}}],[{key:"constructor_",value:function(){if(this.p0=null,this.p1=null,arguments.length===0)c.constructor_.call(this,new K,new K);else if(arguments.length===1){var r=arguments[0];c.constructor_.call(this,r.p0,r.p1)}else if(arguments.length===2){var a=arguments[0],u=arguments[1];this.p0=a,this.p1=u}else if(arguments.length===4){var g=arguments[0],_=arguments[1],E=arguments[2],P=arguments[3];c.constructor_.call(this,new K(g,_),new K(E,P))}}},{key:"midPoint",value:function(r,a){return new K((r.x+a.x)/2,(r.y+a.y)/2)}}])})(),jN=(function(){return l((function c(){s(this,c),c.constructor_.apply(this,arguments)}),[{key:"overlap",value:function(){if(arguments.length!==2){if(arguments.length===4){var c=arguments[1],r=arguments[2],a=arguments[3];arguments[0].getLineSegment(c,this._overlapSeg1),r.getLineSegment(a,this._overlapSeg2),this.overlap(this._overlapSeg1,this._overlapSeg2)}}}}],[{key:"constructor_",value:function(){this._overlapSeg1=new Ni,this._overlapSeg2=new Ni}}])})(),t1=(function(){return l((function c(){s(this,c),c.constructor_.apply(this,arguments)}),[{key:"getLineSegment",value:function(c,r){r.p0=this._pts[c],r.p1=this._pts[c+1]}},{key:"computeSelect",value:function(c,r,a,u){var g=this._pts[r],_=this._pts[a];if(a-r==1)return u.select(this,r),null;if(!c.intersects(g,_))return null;var E=Math.trunc((r+a)/2);r<E&&this.computeSelect(c,r,E,u),E<a&&this.computeSelect(c,E,a,u)}},{key:"getCoordinates",value:function(){for(var c=new Array(this._end-this._start+1).fill(null),r=0,a=this._start;a<=this._end;a++)c[r++]=this._pts[a];return c}},{key:"computeOverlaps",value:function(){if(arguments.length===2){var c=arguments[0],r=arguments[1];this.computeOverlaps(this._start,this._end,c,c._start,c._end,r)}else if(arguments.length===6){var a=arguments[0],u=arguments[1],g=arguments[2],_=arguments[3],E=arguments[4],P=arguments[5];if(u-a==1&&E-_==1)return P.overlap(this,a,g,_),null;if(!this.overlaps(a,u,g,_,E))return null;var O=Math.trunc((a+u)/2),B=Math.trunc((_+E)/2);a<O&&(_<B&&this.computeOverlaps(a,O,g,_,B,P),B<E&&this.computeOverlaps(a,O,g,B,E,P)),O<u&&(_<B&&this.computeOverlaps(O,u,g,_,B,P),B<E&&this.computeOverlaps(O,u,g,B,E,P))}}},{key:"setId",value:function(c){this._id=c}},{key:"select",value:function(c,r){this.computeSelect(c,this._start,this._end,r)}},{key:"getEnvelope",value:function(){if(this._env===null){var c=this._pts[this._start],r=this._pts[this._end];this._env=new zt(c,r)}return this._env}},{key:"overlaps",value:function(c,r,a,u,g){return zt.intersects(this._pts[c],this._pts[r],a._pts[u],a._pts[g])}},{key:"getEndIndex",value:function(){return this._end}},{key:"getStartIndex",value:function(){return this._start}},{key:"getContext",value:function(){return this._context}},{key:"getId",value:function(){return this._id}}],[{key:"constructor_",value:function(){this._pts=null,this._start=null,this._end=null,this._env=null,this._context=null,this._id=null;var c=arguments[0],r=arguments[1],a=arguments[2],u=arguments[3];this._pts=c,this._start=r,this._end=a,this._context=u}}])})(),BN=(function(){function c(){s(this,c)}return l(c,null,[{key:"findChainEnd",value:function(r,a){for(var u=a;u<r.length-1&&r[u].equals2D(r[u+1]);)u++;if(u>=r.length-1)return r.length-1;for(var g=li.quadrant(r[u],r[u+1]),_=a+1;_<r.length&&!(!r[_-1].equals2D(r[_])&&li.quadrant(r[_-1],r[_])!==g);)_++;return _-1}},{key:"getChains",value:function(){if(arguments.length===1){var r=arguments[0];return c.getChains(r,null)}if(arguments.length===2){var a=arguments[0],u=arguments[1],g=new Gt,_=0;do{var E=c.findChainEnd(a,_),P=new t1(a,_,E,u);g.add(P),_=E}while(_<a.length-1);return g}}}])})(),Zg=(function(){return l((function c(){s(this,c)}),[{key:"computeNodes",value:function(c){}},{key:"getNodedSubstrings",value:function(){}}])})(),e1=(function(){return l((function c(){s(this,c),c.constructor_.apply(this,arguments)}),[{key:"setSegmentIntersector",value:function(c){this._segInt=c}},{key:"interfaces_",get:function(){return[Zg]}}],[{key:"constructor_",value:function(){if(this._segInt=null,arguments.length!==0){if(arguments.length===1){var c=arguments[0];this.setSegmentIntersector(c)}}}}])})(),Qg=(function(c){function r(){var a;return s(this,r),a=n(this,r),r.constructor_.apply(a,arguments),a}return m(r,c),l(r,[{key:"getMonotoneChains",value:function(){return this._monoChains}},{key:"getNodedSubstrings",value:function(){return Hr.getNodedSubstrings(this._nodedSegStrings)}},{key:"getIndex",value:function(){return this._index}},{key:"add",value:function(a){for(var u=BN.getChains(a.getCoordinates(),a).iterator();u.hasNext();){var g=u.next();g.setId(this._idCounter++),this._index.insert(g.getEnvelope(),g),this._monoChains.add(g)}}},{key:"computeNodes",value:function(a){this._nodedSegStrings=a;for(var u=a.iterator();u.hasNext();)this.add(u.next());this.intersectChains()}},{key:"intersectChains",value:function(){for(var a=new i1(this._segInt),u=this._monoChains.iterator();u.hasNext();)for(var g=u.next(),_=this._index.query(g.getEnvelope()).iterator();_.hasNext();){var E=_.next();if(E.getId()>g.getId()&&(g.computeOverlaps(E,a),this._nOverlaps++),this._segInt.isDone())return null}}}],[{key:"constructor_",value:function(){if(this._monoChains=new Gt,this._index=new Wn,this._idCounter=0,this._nodedSegStrings=null,this._nOverlaps=0,arguments.length!==0){if(arguments.length===1){var a=arguments[0];e1.constructor_.call(this,a)}}}}])})(e1),i1=(function(c){function r(){var a;return s(this,r),a=n(this,r),r.constructor_.apply(a,arguments),a}return m(r,c),l(r,[{key:"overlap",value:function(){if(arguments.length!==4)return S(r,"overlap",this,1).apply(this,arguments);var a=arguments[1],u=arguments[2],g=arguments[3],_=arguments[0].getContext(),E=u.getContext();this._si.processIntersections(_,a,E,g)}}],[{key:"constructor_",value:function(){this._si=null;var a=arguments[0];this._si=a}}])})(jN);Qg.SegmentOverlapAction=i1;var vn=(function(){function c(){s(this,c),c.constructor_.apply(this,arguments)}return l(c,[{key:"isDeletable",value:function(r,a,u,g){var _=this._inputLine[r],E=this._inputLine[a],P=this._inputLine[u];return!!this.isConcave(_,E,P)&&!!this.isShallow(_,E,P,g)&&this.isShallowSampled(_,E,r,u,g)}},{key:"deleteShallowConcavities",value:function(){for(var r=1,a=this.findNextNonDeletedIndex(r),u=this.findNextNonDeletedIndex(a),g=!1;u<this._inputLine.length;){var _=!1;this.isDeletable(r,a,u,this._distanceTol)&&(this._isDeleted[a]=c.DELETE,_=!0,g=!0),r=_?u:a,a=this.findNextNonDeletedIndex(r),u=this.findNextNonDeletedIndex(a)}return g}},{key:"isShallowConcavity",value:function(r,a,u,g){return Ut.index(r,a,u)===this._angleOrientation&&qn.pointToSegment(a,r,u)<g}},{key:"isShallowSampled",value:function(r,a,u,g,_){var E=Math.trunc((g-u)/c.NUM_PTS_TO_CHECK);E<=0&&(E=1);for(var P=u;P<g;P+=E)if(!this.isShallow(r,a,this._inputLine[P],_))return!1;return!0}},{key:"isConcave",value:function(r,a,u){var g=Ut.index(r,a,u)===this._angleOrientation;return g}},{key:"simplify",value:function(r){this._distanceTol=Math.abs(r),r<0&&(this._angleOrientation=Ut.CLOCKWISE),this._isDeleted=new Array(this._inputLine.length).fill(null);var a=!1;do a=this.deleteShallowConcavities();while(a);return this.collapseLine()}},{key:"findNextNonDeletedIndex",value:function(r){for(var a=r+1;a<this._inputLine.length&&this._isDeleted[a]===c.DELETE;)a++;return a}},{key:"isShallow",value:function(r,a,u,g){return qn.pointToSegment(a,r,u)<g}},{key:"collapseLine",value:function(){for(var r=new Lh,a=0;a<this._inputLine.length;a++)this._isDeleted[a]!==c.DELETE&&r.add(this._inputLine[a]);return r.toCoordinateArray()}}],[{key:"constructor_",value:function(){this._inputLine=null,this._distanceTol=null,this._isDeleted=null,this._angleOrientation=Ut.COUNTERCLOCKWISE;var r=arguments[0];this._inputLine=r}},{key:"simplify",value:function(r,a){return new c(r).simplify(a)}}])})();vn.INIT=0,vn.DELETE=1,vn.KEEP=1,vn.NUM_PTS_TO_CHECK=10;var n1=(function(){function c(){s(this,c),c.constructor_.apply(this,arguments)}return l(c,[{key:"getCoordinates",value:function(){return this._ptList.toArray(c.COORDINATE_ARRAY_TYPE)}},{key:"setPrecisionModel",value:function(r){this._precisionModel=r}},{key:"addPt",value:function(r){var a=new K(r);if(this._precisionModel.makePrecise(a),this.isRedundant(a))return null;this._ptList.add(a)}},{key:"reverse",value:function(){}},{key:"addPts",value:function(r,a){if(a)for(var u=0;u<r.length;u++)this.addPt(r[u]);else for(var g=r.length-1;g>=0;g--)this.addPt(r[g])}},{key:"isRedundant",value:function(r){if(this._ptList.size()<1)return!1;var a=this._ptList.get(this._ptList.size()-1);return r.distance(a)<this._minimimVertexDistance}},{key:"toString",value:function(){return new go().createLineString(this.getCoordinates()).toString()}},{key:"closeRing",value:function(){if(this._ptList.size()<1)return null;var r=new K(this._ptList.get(0)),a=this._ptList.get(this._ptList.size()-1);if(r.equals(a))return null;this._ptList.add(r)}},{key:"setMinimumVertexDistance",value:function(r){this._minimimVertexDistance=r}}],[{key:"constructor_",value:function(){this._ptList=null,this._precisionModel=null,this._minimimVertexDistance=0,this._ptList=new Gt}}])})();n1.COORDINATE_ARRAY_TYPE=new Array(0).fill(null);var Ri=(function(){function c(){s(this,c)}return l(c,null,[{key:"toDegrees",value:function(r){return 180*r/Math.PI}},{key:"normalize",value:function(r){for(;r>Math.PI;)r-=c.PI_TIMES_2;for(;r<=-Math.PI;)r+=c.PI_TIMES_2;return r}},{key:"angle",value:function(){if(arguments.length===1){var r=arguments[0];return Math.atan2(r.y,r.x)}if(arguments.length===2){var a=arguments[0],u=arguments[1],g=u.x-a.x,_=u.y-a.y;return Math.atan2(_,g)}}},{key:"isAcute",value:function(r,a,u){var g=r.x-a.x,_=r.y-a.y;return g*(u.x-a.x)+_*(u.y-a.y)>0}},{key:"isObtuse",value:function(r,a,u){var g=r.x-a.x,_=r.y-a.y;return g*(u.x-a.x)+_*(u.y-a.y)<0}},{key:"interiorAngle",value:function(r,a,u){var g=c.angle(a,r),_=c.angle(a,u);return Math.abs(_-g)}},{key:"normalizePositive",value:function(r){if(r<0){for(;r<0;)r+=c.PI_TIMES_2;r>=c.PI_TIMES_2&&(r=0)}else{for(;r>=c.PI_TIMES_2;)r-=c.PI_TIMES_2;r<0&&(r=0)}return r}},{key:"angleBetween",value:function(r,a,u){var g=c.angle(a,r),_=c.angle(a,u);return c.diff(g,_)}},{key:"diff",value:function(r,a){var u=null;return(u=r<a?a-r:r-a)>Math.PI&&(u=2*Math.PI-u),u}},{key:"toRadians",value:function(r){return r*Math.PI/180}},{key:"getTurn",value:function(r,a){var u=Math.sin(a-r);return u>0?c.COUNTERCLOCKWISE:u<0?c.CLOCKWISE:c.NONE}},{key:"angleBetweenOriented",value:function(r,a,u){var g=c.angle(a,r),_=c.angle(a,u)-g;return _<=-Math.PI?_+c.PI_TIMES_2:_>Math.PI?_-c.PI_TIMES_2:_}}])})();Ri.PI_TIMES_2=2*Math.PI,Ri.PI_OVER_2=Math.PI/2,Ri.PI_OVER_4=Math.PI/4,Ri.COUNTERCLOCKWISE=Ut.COUNTERCLOCKWISE,Ri.CLOCKWISE=Ut.CLOCKWISE,Ri.NONE=Ut.COLLINEAR;var Bh=(function(){function c(){s(this,c),c.constructor_.apply(this,arguments)}return l(c,[{key:"addNextSegment",value:function(r,a){if(this._s0=this._s1,this._s1=this._s2,this._s2=r,this._seg0.setCoordinates(this._s0,this._s1),this.computeOffsetSegment(this._seg0,this._side,this._distance,this._offset0),this._seg1.setCoordinates(this._s1,this._s2),this.computeOffsetSegment(this._seg1,this._side,this._distance,this._offset1),this._s1.equals(this._s2))return null;var u=Ut.index(this._s0,this._s1,this._s2),g=u===Ut.CLOCKWISE&&this._side===ut.LEFT||u===Ut.COUNTERCLOCKWISE&&this._side===ut.RIGHT;u===0?this.addCollinear(a):g?this.addOutsideTurn(u,a):this.addInsideTurn(u,a)}},{key:"addLineEndCap",value:function(r,a){var u=new Ni(r,a),g=new Ni;this.computeOffsetSegment(u,ut.LEFT,this._distance,g);var _=new Ni;this.computeOffsetSegment(u,ut.RIGHT,this._distance,_);var E=a.x-r.x,P=a.y-r.y,O=Math.atan2(P,E);switch(this._bufParams.getEndCapStyle()){case k.CAP_ROUND:this._segList.addPt(g.p1),this.addDirectedFillet(a,O+Math.PI/2,O-Math.PI/2,Ut.CLOCKWISE,this._distance),this._segList.addPt(_.p1);break;case k.CAP_FLAT:this._segList.addPt(g.p1),this._segList.addPt(_.p1);break;case k.CAP_SQUARE:var B=new K;B.x=Math.abs(this._distance)*Math.cos(O),B.y=Math.abs(this._distance)*Math.sin(O);var Z=new K(g.p1.x+B.x,g.p1.y+B.y),tt=new K(_.p1.x+B.x,_.p1.y+B.y);this._segList.addPt(Z),this._segList.addPt(tt)}}},{key:"getCoordinates",value:function(){return this._segList.getCoordinates()}},{key:"addMitreJoin",value:function(r,a,u,g){var _=Bg.intersection(a.p0,a.p1,u.p0,u.p1);if(_!==null&&(g<=0?1:_.distance(r)/Math.abs(g))<=this._bufParams.getMitreLimit())return this._segList.addPt(_),null;this.addLimitedMitreJoin(a,u,g,this._bufParams.getMitreLimit())}},{key:"addOutsideTurn",value:function(r,a){if(this._offset0.p1.distance(this._offset1.p0)<this._distance*c.OFFSET_SEGMENT_SEPARATION_FACTOR)return this._segList.addPt(this._offset0.p1),null;this._bufParams.getJoinStyle()===k.JOIN_MITRE?this.addMitreJoin(this._s1,this._offset0,this._offset1,this._distance):this._bufParams.getJoinStyle()===k.JOIN_BEVEL?this.addBevelJoin(this._offset0,this._offset1):(a&&this._segList.addPt(this._offset0.p1),this.addCornerFillet(this._s1,this._offset0.p1,this._offset1.p0,r,this._distance),this._segList.addPt(this._offset1.p0))}},{key:"createSquare",value:function(r){this._segList.addPt(new K(r.x+this._distance,r.y+this._distance)),this._segList.addPt(new K(r.x+this._distance,r.y-this._distance)),this._segList.addPt(new K(r.x-this._distance,r.y-this._distance)),this._segList.addPt(new K(r.x-this._distance,r.y+this._distance)),this._segList.closeRing()}},{key:"addSegments",value:function(r,a){this._segList.addPts(r,a)}},{key:"addFirstSegment",value:function(){this._segList.addPt(this._offset1.p0)}},{key:"addCornerFillet",value:function(r,a,u,g,_){var E=a.x-r.x,P=a.y-r.y,O=Math.atan2(P,E),B=u.x-r.x,Z=u.y-r.y,tt=Math.atan2(Z,B);g===Ut.CLOCKWISE?O<=tt&&(O+=2*Math.PI):O>=tt&&(O-=2*Math.PI),this._segList.addPt(a),this.addDirectedFillet(r,O,tt,g,_),this._segList.addPt(u)}},{key:"addLastSegment",value:function(){this._segList.addPt(this._offset1.p1)}},{key:"initSideSegments",value:function(r,a,u){this._s1=r,this._s2=a,this._side=u,this._seg1.setCoordinates(r,a),this.computeOffsetSegment(this._seg1,u,this._distance,this._offset1)}},{key:"addLimitedMitreJoin",value:function(r,a,u,g){var _=this._seg0.p1,E=Ri.angle(_,this._seg0.p0),P=Ri.angleBetweenOriented(this._seg0.p0,_,this._seg1.p1)/2,O=Ri.normalize(E+P),B=Ri.normalize(O+Math.PI),Z=g*u,tt=u-Z*Math.abs(Math.sin(P)),ot=_.x+Z*Math.cos(B),Et=_.y+Z*Math.sin(B),Nt=new K(ot,Et),Dt=new Ni(_,Nt),Zt=Dt.pointAlongOffset(1,tt),Yt=Dt.pointAlongOffset(1,-tt);this._side===ut.LEFT?(this._segList.addPt(Zt),this._segList.addPt(Yt)):(this._segList.addPt(Yt),this._segList.addPt(Zt))}},{key:"addDirectedFillet",value:function(r,a,u,g,_){var E=g===Ut.CLOCKWISE?-1:1,P=Math.abs(a-u),O=Math.trunc(P/this._filletAngleQuantum+.5);if(O<1)return null;for(var B=P/O,Z=new K,tt=0;tt<O;tt++){var ot=a+E*tt*B;Z.x=r.x+_*Math.cos(ot),Z.y=r.y+_*Math.sin(ot),this._segList.addPt(Z)}}},{key:"computeOffsetSegment",value:function(r,a,u,g){var _=a===ut.LEFT?1:-1,E=r.p1.x-r.p0.x,P=r.p1.y-r.p0.y,O=Math.sqrt(E*E+P*P),B=_*u*E/O,Z=_*u*P/O;g.p0.x=r.p0.x-Z,g.p0.y=r.p0.y+B,g.p1.x=r.p1.x-Z,g.p1.y=r.p1.y+B}},{key:"addInsideTurn",value:function(r,a){if(this._li.computeIntersection(this._offset0.p0,this._offset0.p1,this._offset1.p0,this._offset1.p1),this._li.hasIntersection())this._segList.addPt(this._li.getIntersection(0));else if(this._hasNarrowConcaveAngle=!0,this._offset0.p1.distance(this._offset1.p0)<this._distance*c.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR)this._segList.addPt(this._offset0.p1);else{if(this._segList.addPt(this._offset0.p1),this._closingSegLengthFactor>0){var u=new K((this._closingSegLengthFactor*this._offset0.p1.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset0.p1.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(u);var g=new K((this._closingSegLengthFactor*this._offset1.p0.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset1.p0.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(g)}else this._segList.addPt(this._s1);this._segList.addPt(this._offset1.p0)}}},{key:"createCircle",value:function(r){var a=new K(r.x+this._distance,r.y);this._segList.addPt(a),this.addDirectedFillet(r,0,2*Math.PI,-1,this._distance),this._segList.closeRing()}},{key:"addBevelJoin",value:function(r,a){this._segList.addPt(r.p1),this._segList.addPt(a.p0)}},{key:"init",value:function(r){this._distance=r,this._maxCurveSegmentError=r*(1-Math.cos(this._filletAngleQuantum/2)),this._segList=new n1,this._segList.setPrecisionModel(this._precisionModel),this._segList.setMinimumVertexDistance(r*c.CURVE_VERTEX_SNAP_DISTANCE_FACTOR)}},{key:"addCollinear",value:function(r){this._li.computeIntersection(this._s0,this._s1,this._s1,this._s2),this._li.getIntersectionNum()>=2&&(this._bufParams.getJoinStyle()===k.JOIN_BEVEL||this._bufParams.getJoinStyle()===k.JOIN_MITRE?(r&&this._segList.addPt(this._offset0.p1),this._segList.addPt(this._offset1.p0)):this.addCornerFillet(this._s1,this._offset0.p1,this._offset1.p0,Ut.CLOCKWISE,this._distance))}},{key:"closeRing",value:function(){this._segList.closeRing()}},{key:"hasNarrowConcaveAngle",value:function(){return this._hasNarrowConcaveAngle}}],[{key:"constructor_",value:function(){this._maxCurveSegmentError=0,this._filletAngleQuantum=null,this._closingSegLengthFactor=1,this._segList=null,this._distance=0,this._precisionModel=null,this._bufParams=null,this._li=null,this._s0=null,this._s1=null,this._s2=null,this._seg0=new Ni,this._seg1=new Ni,this._offset0=new Ni,this._offset1=new Ni,this._side=0,this._hasNarrowConcaveAngle=!1;var r=arguments[0],a=arguments[1],u=arguments[2];this._precisionModel=r,this._bufParams=a,this._li=new Wr,this._filletAngleQuantum=Math.PI/2/a.getQuadrantSegments(),a.getQuadrantSegments()>=8&&a.getJoinStyle()===k.JOIN_ROUND&&(this._closingSegLengthFactor=c.MAX_CLOSING_SEG_LEN_FACTOR),this.init(u)}}])})();Bh.OFFSET_SEGMENT_SEPARATION_FACTOR=.001,Bh.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR=.001,Bh.CURVE_VERTEX_SNAP_DISTANCE_FACTOR=1e-6,Bh.MAX_CLOSING_SEG_LEN_FACTOR=80;var zN=(function(){function c(){s(this,c),c.constructor_.apply(this,arguments)}return l(c,[{key:"getOffsetCurve",value:function(r,a){if(this._distance=a,a===0)return null;var u=a<0,g=Math.abs(a),_=this.getSegGen(g);r.length<=1?this.computePointCurve(r[0],_):this.computeOffsetCurve(r,u,_);var E=_.getCoordinates();return u&&De.reverse(E),E}},{key:"computeSingleSidedBufferCurve",value:function(r,a,u){var g=this.simplifyTolerance(this._distance);if(a){u.addSegments(r,!0);var _=vn.simplify(r,-g),E=_.length-1;u.initSideSegments(_[E],_[E-1],ut.LEFT),u.addFirstSegment();for(var P=E-2;P>=0;P--)u.addNextSegment(_[P],!0)}else{u.addSegments(r,!1);var O=vn.simplify(r,g),B=O.length-1;u.initSideSegments(O[0],O[1],ut.LEFT),u.addFirstSegment();for(var Z=2;Z<=B;Z++)u.addNextSegment(O[Z],!0)}u.addLastSegment(),u.closeRing()}},{key:"computeRingBufferCurve",value:function(r,a,u){var g=this.simplifyTolerance(this._distance);a===ut.RIGHT&&(g=-g);var _=vn.simplify(r,g),E=_.length-1;u.initSideSegments(_[E-1],_[0],a);for(var P=1;P<=E;P++){var O=P!==1;u.addNextSegment(_[P],O)}u.closeRing()}},{key:"computeLineBufferCurve",value:function(r,a){var u=this.simplifyTolerance(this._distance),g=vn.simplify(r,u),_=g.length-1;a.initSideSegments(g[0],g[1],ut.LEFT);for(var E=2;E<=_;E++)a.addNextSegment(g[E],!0);a.addLastSegment(),a.addLineEndCap(g[_-1],g[_]);var P=vn.simplify(r,-u),O=P.length-1;a.initSideSegments(P[O],P[O-1],ut.LEFT);for(var B=O-2;B>=0;B--)a.addNextSegment(P[B],!0);a.addLastSegment(),a.addLineEndCap(P[1],P[0]),a.closeRing()}},{key:"computePointCurve",value:function(r,a){switch(this._bufParams.getEndCapStyle()){case k.CAP_ROUND:a.createCircle(r);break;case k.CAP_SQUARE:a.createSquare(r)}}},{key:"getLineCurve",value:function(r,a){if(this._distance=a,this.isLineOffsetEmpty(a))return null;var u=Math.abs(a),g=this.getSegGen(u);if(r.length<=1)this.computePointCurve(r[0],g);else if(this._bufParams.isSingleSided()){var _=a<0;this.computeSingleSidedBufferCurve(r,_,g)}else this.computeLineBufferCurve(r,g);return g.getCoordinates()}},{key:"getBufferParameters",value:function(){return this._bufParams}},{key:"simplifyTolerance",value:function(r){return r*this._bufParams.getSimplifyFactor()}},{key:"getRingCurve",value:function(r,a,u){if(this._distance=u,r.length<=2)return this.getLineCurve(r,u);if(u===0)return c.copyCoordinates(r);var g=this.getSegGen(u);return this.computeRingBufferCurve(r,a,g),g.getCoordinates()}},{key:"computeOffsetCurve",value:function(r,a,u){var g=this.simplifyTolerance(this._distance);if(a){var _=vn.simplify(r,-g),E=_.length-1;u.initSideSegments(_[E],_[E-1],ut.LEFT),u.addFirstSegment();for(var P=E-2;P>=0;P--)u.addNextSegment(_[P],!0)}else{var O=vn.simplify(r,g),B=O.length-1;u.initSideSegments(O[0],O[1],ut.LEFT),u.addFirstSegment();for(var Z=2;Z<=B;Z++)u.addNextSegment(O[Z],!0)}u.addLastSegment()}},{key:"isLineOffsetEmpty",value:function(r){return r===0||r<0&&!this._bufParams.isSingleSided()}},{key:"getSegGen",value:function(r){return new Bh(this._precisionModel,this._bufParams,r)}}],[{key:"constructor_",value:function(){this._distance=0,this._precisionModel=null,this._bufParams=null;var r=arguments[0],a=arguments[1];this._precisionModel=r,this._bufParams=a}},{key:"copyCoordinates",value:function(r){for(var a=new Array(r.length).fill(null),u=0;u<a.length;u++)a[u]=new K(r[u]);return a}}])})(),s1=(function(){return l((function c(){s(this,c),c.constructor_.apply(this,arguments)}),[{key:"findStabbedSegments",value:function(){if(arguments.length===1){for(var c=arguments[0],r=new Gt,a=this._subgraphs.iterator();a.hasNext();){var u=a.next(),g=u.getEnvelope();c.y<g.getMinY()||c.y>g.getMaxY()||this.findStabbedSegments(c,u.getDirectedEdges(),r)}return r}if(arguments.length===3){if(Vt(arguments[2],ds)&&arguments[0]instanceof K&&arguments[1]instanceof Kg){for(var _=arguments[0],E=arguments[1],P=arguments[2],O=E.getEdge().getCoordinates(),B=0;B<O.length-1;B++)if(this._seg.p0=O[B],this._seg.p1=O[B+1],this._seg.p0.y>this._seg.p1.y&&this._seg.reverse(),!(Math.max(this._seg.p0.x,this._seg.p1.x)<_.x||this._seg.isHorizontal()||_.y<this._seg.p0.y||_.y>this._seg.p1.y||Ut.index(this._seg.p0,this._seg.p1,_)===Ut.RIGHT)){var Z=E.getDepth(ut.LEFT);this._seg.p0.equals(O[B])||(Z=E.getDepth(ut.RIGHT));var tt=new r1(this._seg,Z);P.add(tt)}}else if(Vt(arguments[2],ds)&&arguments[0]instanceof K&&Vt(arguments[1],ds))for(var ot=arguments[0],Et=arguments[2],Nt=arguments[1].iterator();Nt.hasNext();){var Dt=Nt.next();Dt.isForward()&&this.findStabbedSegments(ot,Dt,Et)}}}},{key:"getDepth",value:function(c){var r=this.findStabbedSegments(c);return r.size()===0?0:mo.min(r)._leftDepth}}],[{key:"constructor_",value:function(){this._subgraphs=null,this._seg=new Ni;var c=arguments[0];this._subgraphs=c}}])})(),r1=(function(){return l((function c(){s(this,c),c.constructor_.apply(this,arguments)}),[{key:"compareTo",value:function(c){var r=c;if(this._upwardSeg.minX()>=r._upwardSeg.maxX())return 1;if(this._upwardSeg.maxX()<=r._upwardSeg.minX())return-1;var a=this._upwardSeg.orientationIndex(r._upwardSeg);return a!==0||(a=-1*r._upwardSeg.orientationIndex(this._upwardSeg))!==0?a:this._upwardSeg.compareTo(r._upwardSeg)}},{key:"compareX",value:function(c,r){var a=c.p0.compareTo(r.p0);return a!==0?a:c.p1.compareTo(r.p1)}},{key:"toString",value:function(){return this._upwardSeg.toString()}},{key:"interfaces_",get:function(){return[V]}}],[{key:"constructor_",value:function(){this._upwardSeg=null,this._leftDepth=null;var c=arguments[0],r=arguments[1];this._upwardSeg=new Ni(c),this._leftDepth=r}}])})();s1.DepthSegment=r1;var a1=(function(c){function r(){var a;return s(this,r),a=n(this,r),r.constructor_.apply(a,arguments),a}return m(r,c),l(r,null,[{key:"constructor_",value:function(){M.constructor_.call(this,"Projective point not representable on the Cartesian plane.")}}])})(M),tp=(function(){function c(){s(this,c),c.constructor_.apply(this,arguments)}return l(c,[{key:"getY",value:function(){var r=this.y/this.w;if(J.isNaN(r)||J.isInfinite(r))throw new a1;return r}},{key:"getX",value:function(){var r=this.x/this.w;if(J.isNaN(r)||J.isInfinite(r))throw new a1;return r}},{key:"getCoordinate",value:function(){var r=new K;return r.x=this.getX(),r.y=this.getY(),r}}],[{key:"constructor_",value:function(){if(this.x=null,this.y=null,this.w=null,arguments.length===0)this.x=0,this.y=0,this.w=1;else if(arguments.length===1){var r=arguments[0];this.x=r.x,this.y=r.y,this.w=1}else if(arguments.length===2){if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var a=arguments[0],u=arguments[1];this.x=a,this.y=u,this.w=1}else if(arguments[0]instanceof c&&arguments[1]instanceof c){var g=arguments[0],_=arguments[1];this.x=g.y*_.w-_.y*g.w,this.y=_.x*g.w-g.x*_.w,this.w=g.x*_.y-_.x*g.y}else if(arguments[0]instanceof K&&arguments[1]instanceof K){var E=arguments[0],P=arguments[1];this.x=E.y-P.y,this.y=P.x-E.x,this.w=E.x*P.y-P.x*E.y}}else if(arguments.length===3){var O=arguments[0],B=arguments[1],Z=arguments[2];this.x=O,this.y=B,this.w=Z}else if(arguments.length===4){var tt=arguments[0],ot=arguments[1],Et=arguments[2],Nt=arguments[3],Dt=tt.y-ot.y,Zt=ot.x-tt.x,Yt=tt.x*ot.y-ot.x*tt.y,oe=Et.y-Nt.y,qe=Nt.x-Et.x,ti=Et.x*Nt.y-Nt.x*Et.y;this.x=Zt*ti-qe*Yt,this.y=oe*Yt-Dt*ti,this.w=Dt*qe-oe*Zt}}}])})(),UN=(function(){function c(){s(this,c),c.constructor_.apply(this,arguments)}return l(c,[{key:"area",value:function(){return c.area(this.p0,this.p1,this.p2)}},{key:"signedArea",value:function(){return c.signedArea(this.p0,this.p1,this.p2)}},{key:"interpolateZ",value:function(r){if(r===null)throw new D("Supplied point is null.");return c.interpolateZ(r,this.p0,this.p1,this.p2)}},{key:"longestSideLength",value:function(){return c.longestSideLength(this.p0,this.p1,this.p2)}},{key:"isAcute",value:function(){return c.isAcute(this.p0,this.p1,this.p2)}},{key:"circumcentre",value:function(){return c.circumcentre(this.p0,this.p1,this.p2)}},{key:"area3D",value:function(){return c.area3D(this.p0,this.p1,this.p2)}},{key:"centroid",value:function(){return c.centroid(this.p0,this.p1,this.p2)}},{key:"inCentre",value:function(){return c.inCentre(this.p0,this.p1,this.p2)}}],[{key:"constructor_",value:function(){this.p0=null,this.p1=null,this.p2=null;var r=arguments[0],a=arguments[1],u=arguments[2];this.p0=r,this.p1=a,this.p2=u}},{key:"area",value:function(r,a,u){return Math.abs(((u.x-r.x)*(a.y-r.y)-(a.x-r.x)*(u.y-r.y))/2)}},{key:"signedArea",value:function(r,a,u){return((u.x-r.x)*(a.y-r.y)-(a.x-r.x)*(u.y-r.y))/2}},{key:"det",value:function(r,a,u,g){return r*g-a*u}},{key:"interpolateZ",value:function(r,a,u,g){var _=a.x,E=a.y,P=u.x-_,O=g.x-_,B=u.y-E,Z=g.y-E,tt=P*Z-O*B,ot=r.x-_,Et=r.y-E,Nt=(Z*ot-O*Et)/tt,Dt=(-B*ot+P*Et)/tt;return a.getZ()+Nt*(u.getZ()-a.getZ())+Dt*(g.getZ()-a.getZ())}},{key:"longestSideLength",value:function(r,a,u){var g=r.distance(a),_=a.distance(u),E=u.distance(r),P=g;return _>P&&(P=_),E>P&&(P=E),P}},{key:"circumcentreDD",value:function(r,a,u){var g=Bt.valueOf(r.x).subtract(u.x),_=Bt.valueOf(r.y).subtract(u.y),E=Bt.valueOf(a.x).subtract(u.x),P=Bt.valueOf(a.y).subtract(u.y),O=Bt.determinant(g,_,E,P).multiply(2),B=g.sqr().add(_.sqr()),Z=E.sqr().add(P.sqr()),tt=Bt.determinant(_,B,P,Z),ot=Bt.determinant(g,B,E,Z),Et=Bt.valueOf(u.x).subtract(tt.divide(O)).doubleValue(),Nt=Bt.valueOf(u.y).add(ot.divide(O)).doubleValue();return new K(Et,Nt)}},{key:"isAcute",value:function(r,a,u){return!!Ri.isAcute(r,a,u)&&!!Ri.isAcute(a,u,r)&&!!Ri.isAcute(u,r,a)}},{key:"circumcentre",value:function(r,a,u){var g=u.x,_=u.y,E=r.x-g,P=r.y-_,O=a.x-g,B=a.y-_,Z=2*c.det(E,P,O,B),tt=c.det(P,E*E+P*P,B,O*O+B*B),ot=c.det(E,E*E+P*P,O,O*O+B*B);return new K(g-tt/Z,_+ot/Z)}},{key:"perpendicularBisector",value:function(r,a){var u=a.x-r.x,g=a.y-r.y,_=new tp(r.x+u/2,r.y+g/2,1),E=new tp(r.x-g+u/2,r.y+u+g/2,1);return new tp(_,E)}},{key:"angleBisector",value:function(r,a,u){var g=a.distance(r),_=g/(g+a.distance(u)),E=u.x-r.x,P=u.y-r.y;return new K(r.x+_*E,r.y+_*P)}},{key:"area3D",value:function(r,a,u){var g=a.x-r.x,_=a.y-r.y,E=a.getZ()-r.getZ(),P=u.x-r.x,O=u.y-r.y,B=u.getZ()-r.getZ(),Z=_*B-E*O,tt=E*P-g*B,ot=g*O-_*P,Et=Z*Z+tt*tt+ot*ot,Nt=Math.sqrt(Et)/2;return Nt}},{key:"centroid",value:function(r,a,u){var g=(r.x+a.x+u.x)/3,_=(r.y+a.y+u.y)/3;return new K(g,_)}},{key:"inCentre",value:function(r,a,u){var g=a.distance(u),_=r.distance(u),E=r.distance(a),P=g+_+E,O=(g*r.x+_*a.x+E*u.x)/P,B=(g*r.y+_*a.y+E*u.y)/P;return new K(O,B)}}])})(),VN=(function(){return l((function c(){s(this,c),c.constructor_.apply(this,arguments)}),[{key:"addRingSide",value:function(c,r,a,u,g){if(r===0&&c.length<Dh.MINIMUM_VALID_SIZE)return null;var _=u,E=g;c.length>=Dh.MINIMUM_VALID_SIZE&&Ut.isCCW(c)&&(_=g,E=u,a=ut.opposite(a));var P=this._curveBuilder.getRingCurve(c,a,r);this.addCurve(P,_,E)}},{key:"addRingBothSides",value:function(c,r){this.addRingSide(c,r,ut.LEFT,A.EXTERIOR,A.INTERIOR),this.addRingSide(c,r,ut.RIGHT,A.INTERIOR,A.EXTERIOR)}},{key:"addPoint",value:function(c){if(this._distance<=0)return null;var r=c.getCoordinates(),a=this._curveBuilder.getLineCurve(r,this._distance);this.addCurve(a,A.EXTERIOR,A.INTERIOR)}},{key:"addPolygon",value:function(c){var r=this._distance,a=ut.LEFT;this._distance<0&&(r=-this._distance,a=ut.RIGHT);var u=c.getExteriorRing(),g=De.removeRepeatedPoints(u.getCoordinates());if(this._distance<0&&this.isErodedCompletely(u,this._distance)||this._distance<=0&&g.length<3)return null;this.addRingSide(g,r,a,A.EXTERIOR,A.INTERIOR);for(var _=0;_<c.getNumInteriorRing();_++){var E=c.getInteriorRingN(_),P=De.removeRepeatedPoints(E.getCoordinates());this._distance>0&&this.isErodedCompletely(E,-this._distance)||this.addRingSide(P,r,ut.opposite(a),A.INTERIOR,A.EXTERIOR)}}},{key:"isTriangleErodedCompletely",value:function(c,r){var a=new UN(c[0],c[1],c[2]),u=a.inCentre();return qn.pointToSegment(u,a.p0,a.p1)<Math.abs(r)}},{key:"addLineString",value:function(c){if(this._curveBuilder.isLineOffsetEmpty(this._distance))return null;var r=De.removeRepeatedPoints(c.getCoordinates());if(De.isRing(r)&&!this._curveBuilder.getBufferParameters().isSingleSided())this.addRingBothSides(r,this._distance);else{var a=this._curveBuilder.getLineCurve(r,this._distance);this.addCurve(a,A.EXTERIOR,A.INTERIOR)}}},{key:"addCurve",value:function(c,r,a){if(c===null||c.length<2)return null;var u=new Hr(c,new Ki(0,A.BOUNDARY,r,a));this._curveList.add(u)}},{key:"getCurves",value:function(){return this.add(this._inputGeom),this._curveList}},{key:"add",value:function(c){if(c.isEmpty())return null;if(c instanceof Au)this.addPolygon(c);else if(c instanceof Ah)this.addLineString(c);else if(c instanceof zg)this.addPoint(c);else if(c instanceof Ug)this.addCollection(c);else if(c instanceof Wg)this.addCollection(c);else if(c instanceof $g)this.addCollection(c);else{if(!(c instanceof Oi))throw new It(c.getGeometryType());this.addCollection(c)}}},{key:"isErodedCompletely",value:function(c,r){var a=c.getCoordinates();if(a.length<4)return r<0;if(a.length===4)return this.isTriangleErodedCompletely(a,r);var u=c.getEnvelopeInternal(),g=Math.min(u.getHeight(),u.getWidth());return r<0&&2*Math.abs(r)>g}},{key:"addCollection",value:function(c){for(var r=0;r<c.getNumGeometries();r++){var a=c.getGeometryN(r);this.add(a)}}}],[{key:"constructor_",value:function(){this._inputGeom=null,this._distance=null,this._curveBuilder=null,this._curveList=new Gt;var c=arguments[0],r=arguments[1],a=arguments[2];this._inputGeom=c,this._distance=r,this._curveBuilder=a}}])})(),qN=(function(){return l((function c(){s(this,c)}),[{key:"locate",value:function(c){}}])})(),$N=(function(){function c(){s(this,c),c.constructor_.apply(this,arguments)}return l(c,[{key:"next",value:function(){if(this._atStart)return this._atStart=!1,c.isAtomic(this._parent)&&this._index++,this._parent;if(this._subcollectionIterator!==null){if(this._subcollectionIterator.hasNext())return this._subcollectionIterator.next();this._subcollectionIterator=null}if(this._index>=this._max)throw new Pt;var r=this._parent.getGeometryN(this._index++);return r instanceof Oi?(this._subcollectionIterator=new c(r),this._subcollectionIterator.next()):r}},{key:"remove",value:function(){throw new It(this.getClass().getName())}},{key:"hasNext",value:function(){if(this._atStart)return!0;if(this._subcollectionIterator!==null){if(this._subcollectionIterator.hasNext())return!0;this._subcollectionIterator=null}return!(this._index>=this._max)}},{key:"interfaces_",get:function(){return[AN]}}],[{key:"constructor_",value:function(){this._parent=null,this._atStart=null,this._max=null,this._index=null,this._subcollectionIterator=null;var r=arguments[0];this._parent=r,this._atStart=!0,this._index=0,this._max=r.getNumGeometries()}},{key:"isAtomic",value:function(r){return!(r instanceof Oi)}}])})(),WN=(function(){function c(){s(this,c),c.constructor_.apply(this,arguments)}return l(c,[{key:"locate",value:function(r){return c.locate(r,this._geom)}},{key:"interfaces_",get:function(){return[qN]}}],[{key:"constructor_",value:function(){this._geom=null;var r=arguments[0];this._geom=r}},{key:"locatePointInPolygon",value:function(r,a){if(a.isEmpty())return A.EXTERIOR;var u=a.getExteriorRing(),g=c.locatePointInRing(r,u);if(g!==A.INTERIOR)return g;for(var _=0;_<a.getNumInteriorRing();_++){var E=a.getInteriorRingN(_),P=c.locatePointInRing(r,E);if(P===A.BOUNDARY)return A.BOUNDARY;if(P===A.INTERIOR)return A.EXTERIOR}return A.INTERIOR}},{key:"locatePointInRing",value:function(r,a){return a.getEnvelopeInternal().intersects(r)?Yg.locateInRing(r,a.getCoordinates()):A.EXTERIOR}},{key:"containsPointInPolygon",value:function(r,a){return A.EXTERIOR!==c.locatePointInPolygon(r,a)}},{key:"locateInGeometry",value:function(r,a){if(a instanceof Au)return c.locatePointInPolygon(r,a);if(a instanceof Oi)for(var u=new $N(a);u.hasNext();){var g=u.next();if(g!==a){var _=c.locateInGeometry(r,g);if(_!==A.EXTERIOR)return _}}return A.EXTERIOR}},{key:"isContained",value:function(r,a){return A.EXTERIOR!==c.locate(r,a)}},{key:"locate",value:function(r,a){return a.isEmpty()?A.EXTERIOR:a.getEnvelopeInternal().intersects(r)?c.locateInGeometry(r,a):A.EXTERIOR}}])})(),HN=(function(){return l((function c(){s(this,c),c.constructor_.apply(this,arguments)}),[{key:"getNextCW",value:function(c){this.getEdges();var r=this._edgeList.indexOf(c),a=r-1;return r===0&&(a=this._edgeList.size()-1),this._edgeList.get(a)}},{key:"propagateSideLabels",value:function(c){for(var r=A.NONE,a=this.iterator();a.hasNext();){var u=a.next().getLabel();u.isArea(c)&&u.getLocation(c,ut.LEFT)!==A.NONE&&(r=u.getLocation(c,ut.LEFT))}if(r===A.NONE)return null;for(var g=r,_=this.iterator();_.hasNext();){var E=_.next(),P=E.getLabel();if(P.getLocation(c,ut.ON)===A.NONE&&P.setLocation(c,ut.ON,g),P.isArea(c)){var O=P.getLocation(c,ut.LEFT),B=P.getLocation(c,ut.RIGHT);if(B!==A.NONE){if(B!==g)throw new fs("side location conflict",E.getCoordinate());O===A.NONE&&ct.shouldNeverReachHere("found single null side (at "+E.getCoordinate()+")"),g=O}else ct.isTrue(P.getLocation(c,ut.LEFT)===A.NONE,"found single null side"),P.setLocation(c,ut.RIGHT,g),P.setLocation(c,ut.LEFT,g)}}}},{key:"getCoordinate",value:function(){var c=this.iterator();return c.hasNext()?c.next().getCoordinate():null}},{key:"print",value:function(c){Yi.out.println("EdgeEndStar: "+this.getCoordinate());for(var r=this.iterator();r.hasNext();)r.next().print(c)}},{key:"isAreaLabelsConsistent",value:function(c){return this.computeEdgeEndLabels(c.getBoundaryNodeRule()),this.checkAreaLabelsConsistent(0)}},{key:"checkAreaLabelsConsistent",value:function(c){var r=this.getEdges();if(r.size()<=0)return!0;var a=r.size()-1,u=r.get(a).getLabel().getLocation(c,ut.LEFT);ct.isTrue(u!==A.NONE,"Found unlabelled area edge");for(var g=u,_=this.iterator();_.hasNext();){var E=_.next().getLabel();ct.isTrue(E.isArea(c),"Found non-area edge");var P=E.getLocation(c,ut.LEFT),O=E.getLocation(c,ut.RIGHT);if(P===O||O!==g)return!1;g=P}return!0}},{key:"findIndex",value:function(c){this.iterator();for(var r=0;r<this._edgeList.size();r++)if(this._edgeList.get(r)===c)return r;return-1}},{key:"iterator",value:function(){return this.getEdges().iterator()}},{key:"getEdges",value:function(){return this._edgeList===null&&(this._edgeList=new Gt(this._edgeMap.values())),this._edgeList}},{key:"getLocation",value:function(c,r,a){return this._ptInAreaLocation[c]===A.NONE&&(this._ptInAreaLocation[c]=WN.locate(r,a[c].getGeometry())),this._ptInAreaLocation[c]}},{key:"toString",value:function(){var c=new Ws;c.append("EdgeEndStar: "+this.getCoordinate()),c.append(`
|
|
49
49
|
`);for(var r=this.iterator();r.hasNext();){var a=r.next();c.append(a),c.append(`
|
|
50
|
-
`)}return c.toString()}},{key:"computeEdgeEndLabels",value:function(c){for(var r=this.iterator();r.hasNext();)r.next().computeLabel(c)}},{key:"computeLabelling",value:function(c){this.computeEdgeEndLabels(c[0].getBoundaryNodeRule()),this.propagateSideLabels(0),this.propagateSideLabels(1);for(var r=[!1,!1],a=this.iterator();a.hasNext();)for(var u=a.next().getLabel(),g=0;g<2;g++)u.isLine(g)&&u.getLocation(g)===A.BOUNDARY&&(r[g]=!0);for(var _=this.iterator();_.hasNext();)for(var E=_.next(),P=E.getLabel(),O=0;O<2;O++)if(P.isAnyNull(O)){var B=A.NONE;if(r[O])B=A.EXTERIOR;else{var Z=E.getCoordinate();B=this.getLocation(O,Z,c)}P.setAllLocationsIfNull(O,B)}}},{key:"getDegree",value:function(){return this._edgeMap.size()}},{key:"insertEdgeEnd",value:function(c,r){this._edgeMap.put(c,r),this._edgeList=null}}],[{key:"constructor_",value:function(){this._edgeMap=new jh,this._edgeList=null,this._ptInAreaLocation=[A.NONE,A.NONE]}}])})(),XN=(function(c){function r(){var a;return s(this,r),a=n(this,r),r.constructor_.apply(a,arguments),a}return m(r,c),l(r,[{key:"linkResultDirectedEdges",value:function(){this.getResultAreaEdges();for(var a=null,u=null,g=this._SCANNING_FOR_INCOMING,_=0;_<this._resultAreaEdgeList.size();_++){var E=this._resultAreaEdgeList.get(_),P=E.getSym();if(E.getLabel().isArea())switch(a===null&&E.isInResult()&&(a=E),g){case this._SCANNING_FOR_INCOMING:if(!P.isInResult())continue;u=P,g=this._LINKING_TO_OUTGOING;break;case this._LINKING_TO_OUTGOING:if(!E.isInResult())continue;u.setNext(E),g=this._SCANNING_FOR_INCOMING}}if(g===this._LINKING_TO_OUTGOING){if(a===null)throw new fs("no outgoing dirEdge found",this.getCoordinate());ct.isTrue(a.isInResult(),"unable to link last incoming dirEdge"),u.setNext(a)}}},{key:"insert",value:function(a){var u=a;this.insertEdgeEnd(u,u)}},{key:"getRightmostEdge",value:function(){var a=this.getEdges(),u=a.size();if(u<1)return null;var g=a.get(0);if(u===1)return g;var _=a.get(u-1),E=g.getQuadrant(),P=_.getQuadrant();return li.isNorthern(E)&&li.isNorthern(P)?g:li.isNorthern(E)||li.isNorthern(P)?g.getDy()!==0?g:_.getDy()!==0?_:(ct.shouldNeverReachHere("found two horizontal edges incident on node"),null):_}},{key:"print",value:function(a){Yi.out.println("DirectedEdgeStar: "+this.getCoordinate());for(var u=this.iterator();u.hasNext();){var g=u.next();a.print("out "),g.print(a),a.println(),a.print("in "),g.getSym().print(a),a.println()}}},{key:"getResultAreaEdges",value:function(){if(this._resultAreaEdgeList!==null)return this._resultAreaEdgeList;this._resultAreaEdgeList=new Gt;for(var a=this.iterator();a.hasNext();){var u=a.next();(u.isInResult()||u.getSym().isInResult())&&this._resultAreaEdgeList.add(u)}return this._resultAreaEdgeList}},{key:"updateLabelling",value:function(a){for(var u=this.iterator();u.hasNext();){var g=u.next().getLabel();g.setAllLocationsIfNull(0,a.getLocation(0)),g.setAllLocationsIfNull(1,a.getLocation(1))}}},{key:"linkAllDirectedEdges",value:function(){this.getEdges();for(var a=null,u=null,g=this._edgeList.size()-1;g>=0;g--){var _=this._edgeList.get(g),E=_.getSym();u===null&&(u=E),a!==null&&E.setNext(a),a=_}u.setNext(a)}},{key:"computeDepths",value:function(){if(arguments.length===1){var a=arguments[0],u=this.findIndex(a),g=a.getDepth(ut.LEFT),_=a.getDepth(ut.RIGHT),E=this.computeDepths(u+1,this._edgeList.size(),g);if(this.computeDepths(0,u,E)!==_)throw new fs("depth mismatch at "+a.getCoordinate())}else if(arguments.length===3){for(var P=arguments[1],O=arguments[2],B=arguments[0];B<P;B++){var Z=this._edgeList.get(B);Z.setEdgeDepths(ut.RIGHT,O),O=Z.getDepth(ut.LEFT)}return O}}},{key:"mergeSymLabels",value:function(){for(var a=this.iterator();a.hasNext();){var u=a.next();u.getLabel().merge(u.getSym().getLabel())}}},{key:"linkMinimalDirectedEdges",value:function(a){for(var u=null,g=null,_=this._SCANNING_FOR_INCOMING,E=this._resultAreaEdgeList.size()-1;E>=0;E--){var P=this._resultAreaEdgeList.get(E),O=P.getSym();switch(u===null&&P.getEdgeRing()===a&&(u=P),_){case this._SCANNING_FOR_INCOMING:if(O.getEdgeRing()!==a)continue;g=O,_=this._LINKING_TO_OUTGOING;break;case this._LINKING_TO_OUTGOING:if(P.getEdgeRing()!==a)continue;g.setNextMin(P),_=this._SCANNING_FOR_INCOMING}}_===this._LINKING_TO_OUTGOING&&(ct.isTrue(u!==null,"found null for first outgoing dirEdge"),ct.isTrue(u.getEdgeRing()===a,"unable to link last incoming dirEdge"),g.setNextMin(u))}},{key:"getOutgoingDegree",value:function(){if(arguments.length===0){for(var a=0,u=this.iterator();u.hasNext();)u.next().isInResult()&&a++;return a}if(arguments.length===1){for(var g=arguments[0],_=0,E=this.iterator();E.hasNext();)E.next().getEdgeRing()===g&&_++;return _}}},{key:"getLabel",value:function(){return this._label}},{key:"findCoveredLineEdges",value:function(){for(var a=A.NONE,u=this.iterator();u.hasNext();){var g=u.next(),_=g.getSym();if(!g.isLineEdge()){if(g.isInResult()){a=A.INTERIOR;break}if(_.isInResult()){a=A.EXTERIOR;break}}}if(a===A.NONE)return null;for(var E=a,P=this.iterator();P.hasNext();){var O=P.next(),B=O.getSym();O.isLineEdge()?O.getEdge().setCovered(E===A.INTERIOR):(O.isInResult()&&(E=A.EXTERIOR),B.isInResult()&&(E=A.INTERIOR))}}},{key:"computeLabelling",value:function(a){S(r,"computeLabelling",this,1).call(this,a),this._label=new Ki(A.NONE);for(var u=this.iterator();u.hasNext();)for(var g=u.next().getEdge().getLabel(),_=0;_<2;_++){var E=g.getLocation(_);E!==A.INTERIOR&&E!==A.BOUNDARY||this._label.setLocation(_,A.INTERIOR)}}}],[{key:"constructor_",value:function(){this._resultAreaEdgeList=null,this._label=null,this._SCANNING_FOR_INCOMING=1,this._LINKING_TO_OUTGOING=2}}])})(HN),YN=(function(c){function r(){return s(this,r),n(this,r)}return m(r,c),l(r,[{key:"createNode",value:function(a){return new ju(a,new XN)}}])})(Y_),o1=(function(){function c(){s(this,c),c.constructor_.apply(this,arguments)}return l(c,[{key:"compareTo",value:function(r){var a=r;return c.compareOriented(this._pts,this._orientation,a._pts,a._orientation)}},{key:"interfaces_",get:function(){return[V]}}],[{key:"constructor_",value:function(){this._pts=null,this._orientation=null;var r=arguments[0];this._pts=r,this._orientation=c.orientation(r)}},{key:"orientation",value:function(r){return De.increasingDirection(r)===1}},{key:"compareOriented",value:function(r,a,u,g){for(var _=a?1:-1,E=g?1:-1,P=a?r.length:-1,O=g?u.length:-1,B=a?0:r.length-1,Z=g?0:u.length-1;;){var tt=r[B].compareTo(u[Z]);if(tt!==0)return tt;var ot=(B+=_)===P,Et=(Z+=E)===O;if(ot&&!Et)return-1;if(!ot&&Et)return 1;if(ot&&Et)return 0}}}])})(),JN=(function(){return l((function c(){s(this,c),c.constructor_.apply(this,arguments)}),[{key:"print",value:function(c){c.print("MULTILINESTRING ( ");for(var r=0;r<this._edges.size();r++){var a=this._edges.get(r);r>0&&c.print(","),c.print("(");for(var u=a.getCoordinates(),g=0;g<u.length;g++)g>0&&c.print(","),c.print(u[g].x+" "+u[g].y);c.println(")")}c.print(") ")}},{key:"addAll",value:function(c){for(var r=c.iterator();r.hasNext();)this.add(r.next())}},{key:"findEdgeIndex",value:function(c){for(var r=0;r<this._edges.size();r++)if(this._edges.get(r).equals(c))return r;return-1}},{key:"iterator",value:function(){return this._edges.iterator()}},{key:"getEdges",value:function(){return this._edges}},{key:"get",value:function(c){return this._edges.get(c)}},{key:"findEqualEdge",value:function(c){var r=new o1(c.getCoordinates());return this._ocaMap.get(r)}},{key:"add",value:function(c){this._edges.add(c);var r=new o1(c.getCoordinates());this._ocaMap.put(r,c)}}],[{key:"constructor_",value:function(){this._edges=new Gt,this._ocaMap=new jh}}])})(),h1=(function(){return l((function c(){s(this,c)}),[{key:"processIntersections",value:function(c,r,a,u){}},{key:"isDone",value:function(){}}])})(),KN=(function(){function c(){s(this,c),c.constructor_.apply(this,arguments)}return l(c,[{key:"isTrivialIntersection",value:function(r,a,u,g){if(r===u&&this._li.getIntersectionNum()===1){if(c.isAdjacentSegments(a,g))return!0;if(r.isClosed()){var _=r.size()-1;if(a===0&&g===_||g===0&&a===_)return!0}}return!1}},{key:"getProperIntersectionPoint",value:function(){return this._properIntersectionPoint}},{key:"hasProperInteriorIntersection",value:function(){return this._hasProperInterior}},{key:"getLineIntersector",value:function(){return this._li}},{key:"hasProperIntersection",value:function(){return this._hasProper}},{key:"processIntersections",value:function(r,a,u,g){if(r===u&&a===g)return null;this.numTests++;var _=r.getCoordinates()[a],E=r.getCoordinates()[a+1],P=u.getCoordinates()[g],O=u.getCoordinates()[g+1];this._li.computeIntersection(_,E,P,O),this._li.hasIntersection()&&(this.numIntersections++,this._li.isInteriorIntersection()&&(this.numInteriorIntersections++,this._hasInterior=!0),this.isTrivialIntersection(r,a,u,g)||(this._hasIntersection=!0,r.addIntersections(this._li,a,0),u.addIntersections(this._li,g,1),this._li.isProper()&&(this.numProperIntersections++,this._hasProper=!0,this._hasProperInterior=!0)))}},{key:"hasIntersection",value:function(){return this._hasIntersection}},{key:"isDone",value:function(){return!1}},{key:"hasInteriorIntersection",value:function(){return this._hasInterior}},{key:"interfaces_",get:function(){return[h1]}}],[{key:"constructor_",value:function(){this._hasIntersection=!1,this._hasProper=!1,this._hasProperInterior=!1,this._hasInterior=!1,this._properIntersectionPoint=null,this._li=null,this._isSelfIntersection=null,this.numIntersections=0,this.numInteriorIntersections=0,this.numProperIntersections=0,this.numTests=0;var r=arguments[0];this._li=r}},{key:"isAdjacentSegments",value:function(r,a){return Math.abs(r-a)===1}}])})(),ZN=(function(){return l((function c(){s(this,c),c.constructor_.apply(this,arguments)}),[{key:"getSegmentIndex",value:function(){return this.segmentIndex}},{key:"getCoordinate",value:function(){return this.coord}},{key:"print",value:function(c){c.print(this.coord),c.print(" seg # = "+this.segmentIndex),c.println(" dist = "+this.dist)}},{key:"compareTo",value:function(c){var r=c;return this.compare(r.segmentIndex,r.dist)}},{key:"isEndPoint",value:function(c){return this.segmentIndex===0&&this.dist===0||this.segmentIndex===c}},{key:"toString",value:function(){return this.coord+" seg # = "+this.segmentIndex+" dist = "+this.dist}},{key:"getDistance",value:function(){return this.dist}},{key:"compare",value:function(c,r){return this.segmentIndex<c?-1:this.segmentIndex>c?1:this.dist<r?-1:this.dist>r?1:0}},{key:"interfaces_",get:function(){return[V]}}],[{key:"constructor_",value:function(){this.coord=null,this.segmentIndex=null,this.dist=null;var c=arguments[0],r=arguments[1],a=arguments[2];this.coord=new K(c),this.segmentIndex=r,this.dist=a}}])})(),QN=(function(){return l((function c(){s(this,c),c.constructor_.apply(this,arguments)}),[{key:"print",value:function(c){c.println("Intersections:");for(var r=this.iterator();r.hasNext();)r.next().print(c)}},{key:"iterator",value:function(){return this._nodeMap.values().iterator()}},{key:"addSplitEdges",value:function(c){this.addEndpoints();for(var r=this.iterator(),a=r.next();r.hasNext();){var u=r.next(),g=this.createSplitEdge(a,u);c.add(g),a=u}}},{key:"addEndpoints",value:function(){var c=this.edge.pts.length-1;this.add(this.edge.pts[0],0,0),this.add(this.edge.pts[c],c,0)}},{key:"createSplitEdge",value:function(c,r){var a=r.segmentIndex-c.segmentIndex+2,u=this.edge.pts[r.segmentIndex],g=r.dist>0||!r.coord.equals2D(u);g||a--;var _=new Array(a).fill(null),E=0;_[E++]=new K(c.coord);for(var P=c.segmentIndex+1;P<=r.segmentIndex;P++)_[E++]=this.edge.pts[P];return g&&(_[E]=r.coord),new u1(_,new Ki(this.edge._label))}},{key:"add",value:function(c,r,a){var u=new ZN(c,r,a),g=this._nodeMap.get(u);return g!==null?g:(this._nodeMap.put(u,u),u)}},{key:"isIntersection",value:function(c){for(var r=this.iterator();r.hasNext();)if(r.next().coord.equals(c))return!0;return!1}}],[{key:"constructor_",value:function(){this._nodeMap=new jh,this.edge=null;var c=arguments[0];this.edge=c}}])})(),t4=(function(){function c(){s(this,c),c.constructor_.apply(this,arguments)}return l(c,[{key:"isIntersects",value:function(){return!this.isDisjoint()}},{key:"isCovers",value:function(){return(c.isTrue(this._matrix[A.INTERIOR][A.INTERIOR])||c.isTrue(this._matrix[A.INTERIOR][A.BOUNDARY])||c.isTrue(this._matrix[A.BOUNDARY][A.INTERIOR])||c.isTrue(this._matrix[A.BOUNDARY][A.BOUNDARY]))&&this._matrix[A.EXTERIOR][A.INTERIOR]===pt.FALSE&&this._matrix[A.EXTERIOR][A.BOUNDARY]===pt.FALSE}},{key:"isCoveredBy",value:function(){return(c.isTrue(this._matrix[A.INTERIOR][A.INTERIOR])||c.isTrue(this._matrix[A.INTERIOR][A.BOUNDARY])||c.isTrue(this._matrix[A.BOUNDARY][A.INTERIOR])||c.isTrue(this._matrix[A.BOUNDARY][A.BOUNDARY]))&&this._matrix[A.INTERIOR][A.EXTERIOR]===pt.FALSE&&this._matrix[A.BOUNDARY][A.EXTERIOR]===pt.FALSE}},{key:"set",value:function(){if(arguments.length===1)for(var r=arguments[0],a=0;a<r.length;a++){var u=Math.trunc(a/3),g=a%3;this._matrix[u][g]=pt.toDimensionValue(r.charAt(a))}else if(arguments.length===3){var _=arguments[0],E=arguments[1],P=arguments[2];this._matrix[_][E]=P}}},{key:"isContains",value:function(){return c.isTrue(this._matrix[A.INTERIOR][A.INTERIOR])&&this._matrix[A.EXTERIOR][A.INTERIOR]===pt.FALSE&&this._matrix[A.EXTERIOR][A.BOUNDARY]===pt.FALSE}},{key:"setAtLeast",value:function(){if(arguments.length===1)for(var r=arguments[0],a=0;a<r.length;a++){var u=Math.trunc(a/3),g=a%3;this.setAtLeast(u,g,pt.toDimensionValue(r.charAt(a)))}else if(arguments.length===3){var _=arguments[0],E=arguments[1],P=arguments[2];this._matrix[_][E]<P&&(this._matrix[_][E]=P)}}},{key:"setAtLeastIfValid",value:function(r,a,u){r>=0&&a>=0&&this.setAtLeast(r,a,u)}},{key:"isWithin",value:function(){return c.isTrue(this._matrix[A.INTERIOR][A.INTERIOR])&&this._matrix[A.INTERIOR][A.EXTERIOR]===pt.FALSE&&this._matrix[A.BOUNDARY][A.EXTERIOR]===pt.FALSE}},{key:"isTouches",value:function(r,a){return r>a?this.isTouches(a,r):(r===pt.A&&a===pt.A||r===pt.L&&a===pt.L||r===pt.L&&a===pt.A||r===pt.P&&a===pt.A||r===pt.P&&a===pt.L)&&this._matrix[A.INTERIOR][A.INTERIOR]===pt.FALSE&&(c.isTrue(this._matrix[A.INTERIOR][A.BOUNDARY])||c.isTrue(this._matrix[A.BOUNDARY][A.INTERIOR])||c.isTrue(this._matrix[A.BOUNDARY][A.BOUNDARY]))}},{key:"isOverlaps",value:function(r,a){return r===pt.P&&a===pt.P||r===pt.A&&a===pt.A?c.isTrue(this._matrix[A.INTERIOR][A.INTERIOR])&&c.isTrue(this._matrix[A.INTERIOR][A.EXTERIOR])&&c.isTrue(this._matrix[A.EXTERIOR][A.INTERIOR]):r===pt.L&&a===pt.L&&this._matrix[A.INTERIOR][A.INTERIOR]===1&&c.isTrue(this._matrix[A.INTERIOR][A.EXTERIOR])&&c.isTrue(this._matrix[A.EXTERIOR][A.INTERIOR])}},{key:"isEquals",value:function(r,a){return r===a&&c.isTrue(this._matrix[A.INTERIOR][A.INTERIOR])&&this._matrix[A.INTERIOR][A.EXTERIOR]===pt.FALSE&&this._matrix[A.BOUNDARY][A.EXTERIOR]===pt.FALSE&&this._matrix[A.EXTERIOR][A.INTERIOR]===pt.FALSE&&this._matrix[A.EXTERIOR][A.BOUNDARY]===pt.FALSE}},{key:"toString",value:function(){for(var r=new Lu("123456789"),a=0;a<3;a++)for(var u=0;u<3;u++)r.setCharAt(3*a+u,pt.toDimensionSymbol(this._matrix[a][u]));return r.toString()}},{key:"setAll",value:function(r){for(var a=0;a<3;a++)for(var u=0;u<3;u++)this._matrix[a][u]=r}},{key:"get",value:function(r,a){return this._matrix[r][a]}},{key:"transpose",value:function(){var r=this._matrix[1][0];return this._matrix[1][0]=this._matrix[0][1],this._matrix[0][1]=r,r=this._matrix[2][0],this._matrix[2][0]=this._matrix[0][2],this._matrix[0][2]=r,r=this._matrix[2][1],this._matrix[2][1]=this._matrix[1][2],this._matrix[1][2]=r,this}},{key:"matches",value:function(r){if(r.length!==9)throw new D("Should be length 9: "+r);for(var a=0;a<3;a++)for(var u=0;u<3;u++)if(!c.matches(this._matrix[a][u],r.charAt(3*a+u)))return!1;return!0}},{key:"add",value:function(r){for(var a=0;a<3;a++)for(var u=0;u<3;u++)this.setAtLeast(a,u,r.get(a,u))}},{key:"isDisjoint",value:function(){return this._matrix[A.INTERIOR][A.INTERIOR]===pt.FALSE&&this._matrix[A.INTERIOR][A.BOUNDARY]===pt.FALSE&&this._matrix[A.BOUNDARY][A.INTERIOR]===pt.FALSE&&this._matrix[A.BOUNDARY][A.BOUNDARY]===pt.FALSE}},{key:"isCrosses",value:function(r,a){return r===pt.P&&a===pt.L||r===pt.P&&a===pt.A||r===pt.L&&a===pt.A?c.isTrue(this._matrix[A.INTERIOR][A.INTERIOR])&&c.isTrue(this._matrix[A.INTERIOR][A.EXTERIOR]):r===pt.L&&a===pt.P||r===pt.A&&a===pt.P||r===pt.A&&a===pt.L?c.isTrue(this._matrix[A.INTERIOR][A.INTERIOR])&&c.isTrue(this._matrix[A.EXTERIOR][A.INTERIOR]):r===pt.L&&a===pt.L&&this._matrix[A.INTERIOR][A.INTERIOR]===0}},{key:"interfaces_",get:function(){return[x]}}],[{key:"constructor_",value:function(){if(this._matrix=null,arguments.length===0)this._matrix=Array(3).fill().map((function(){return Array(3)})),this.setAll(pt.FALSE);else if(arguments.length===1){if(typeof arguments[0]=="string"){var r=arguments[0];c.constructor_.call(this),this.set(r)}else if(arguments[0]instanceof c){var a=arguments[0];c.constructor_.call(this),this._matrix[A.INTERIOR][A.INTERIOR]=a._matrix[A.INTERIOR][A.INTERIOR],this._matrix[A.INTERIOR][A.BOUNDARY]=a._matrix[A.INTERIOR][A.BOUNDARY],this._matrix[A.INTERIOR][A.EXTERIOR]=a._matrix[A.INTERIOR][A.EXTERIOR],this._matrix[A.BOUNDARY][A.INTERIOR]=a._matrix[A.BOUNDARY][A.INTERIOR],this._matrix[A.BOUNDARY][A.BOUNDARY]=a._matrix[A.BOUNDARY][A.BOUNDARY],this._matrix[A.BOUNDARY][A.EXTERIOR]=a._matrix[A.BOUNDARY][A.EXTERIOR],this._matrix[A.EXTERIOR][A.INTERIOR]=a._matrix[A.EXTERIOR][A.INTERIOR],this._matrix[A.EXTERIOR][A.BOUNDARY]=a._matrix[A.EXTERIOR][A.BOUNDARY],this._matrix[A.EXTERIOR][A.EXTERIOR]=a._matrix[A.EXTERIOR][A.EXTERIOR]}}}},{key:"matches",value:function(){if(Number.isInteger(arguments[0])&&typeof arguments[1]=="string"){var r=arguments[0],a=arguments[1];return a===pt.SYM_DONTCARE||a===pt.SYM_TRUE&&(r>=0||r===pt.TRUE)||a===pt.SYM_FALSE&&r===pt.FALSE||a===pt.SYM_P&&r===pt.P||a===pt.SYM_L&&r===pt.L||a===pt.SYM_A&&r===pt.A}if(typeof arguments[0]=="string"&&typeof arguments[1]=="string"){var u=arguments[1];return new c(arguments[0]).matches(u)}}},{key:"isTrue",value:function(r){return r>=0||r===pt.TRUE}}])})(),e4=(function(){function c(){s(this,c),c.constructor_.apply(this,arguments)}return l(c,[{key:"size",value:function(){return this._size}},{key:"addAll",value:function(r){return r===null||r.length===0?null:(this.ensureCapacity(this._size+r.length),Yi.arraycopy(r,0,this._data,this._size,r.length),void(this._size+=r.length))}},{key:"ensureCapacity",value:function(r){if(r<=this._data.length)return null;var a=Math.max(r,2*this._data.length);this._data=Vr.copyOf(this._data,a)}},{key:"toArray",value:function(){var r=new Array(this._size).fill(null);return Yi.arraycopy(this._data,0,r,0,this._size),r}},{key:"add",value:function(r){this.ensureCapacity(this._size+1),this._data[this._size]=r,++this._size}}],[{key:"constructor_",value:function(){if(this._data=null,this._size=0,arguments.length===0)c.constructor_.call(this,10);else if(arguments.length===1){var r=arguments[0];this._data=new Array(r).fill(null)}}}])})(),i4=(function(){function c(){s(this,c)}return l(c,[{key:"getChainStartIndices",value:function(r){var a=0,u=new e4(Math.trunc(r.length/2));u.add(a);do{var g=this.findChainEnd(r,a);u.add(g),a=g}while(a<r.length-1);return u.toArray()}},{key:"findChainEnd",value:function(r,a){for(var u=li.quadrant(r[a],r[a+1]),g=a+1;g<r.length&&li.quadrant(r[g-1],r[g])===u;)g++;return g-1}},{key:"OLDgetChainStartIndices",value:function(r){var a=0,u=new Gt;u.add(a);do{var g=this.findChainEnd(r,a);u.add(g),a=g}while(a<r.length-1);return c.toIntArray(u)}}],[{key:"toIntArray",value:function(r){for(var a=new Array(r.size()).fill(null),u=0;u<a.length;u++)a[u]=r.get(u).intValue();return a}}])})(),n4=(function(){return l((function c(){s(this,c),c.constructor_.apply(this,arguments)}),[{key:"getCoordinates",value:function(){return this.pts}},{key:"getMaxX",value:function(c){var r=this.pts[this.startIndex[c]].x,a=this.pts[this.startIndex[c+1]].x;return r>a?r:a}},{key:"getMinX",value:function(c){var r=this.pts[this.startIndex[c]].x,a=this.pts[this.startIndex[c+1]].x;return r<a?r:a}},{key:"computeIntersectsForChain",value:function(){if(arguments.length===4){var c=arguments[0],r=arguments[1],a=arguments[2],u=arguments[3];this.computeIntersectsForChain(this.startIndex[c],this.startIndex[c+1],r,r.startIndex[a],r.startIndex[a+1],u)}else if(arguments.length===6){var g=arguments[0],_=arguments[1],E=arguments[2],P=arguments[3],O=arguments[4],B=arguments[5];if(_-g==1&&O-P==1)return B.addIntersections(this.e,g,E.e,P),null;if(!this.overlaps(g,_,E,P,O))return null;var Z=Math.trunc((g+_)/2),tt=Math.trunc((P+O)/2);g<Z&&(P<tt&&this.computeIntersectsForChain(g,Z,E,P,tt,B),tt<O&&this.computeIntersectsForChain(g,Z,E,tt,O,B)),Z<_&&(P<tt&&this.computeIntersectsForChain(Z,_,E,P,tt,B),tt<O&&this.computeIntersectsForChain(Z,_,E,tt,O,B))}}},{key:"overlaps",value:function(c,r,a,u,g){return zt.intersects(this.pts[c],this.pts[r],a.pts[u],a.pts[g])}},{key:"getStartIndexes",value:function(){return this.startIndex}},{key:"computeIntersects",value:function(c,r){for(var a=0;a<this.startIndex.length-1;a++)for(var u=0;u<c.startIndex.length-1;u++)this.computeIntersectsForChain(a,c,u,r)}}],[{key:"constructor_",value:function(){this.e=null,this.pts=null,this.startIndex=null;var c=arguments[0];this.e=c,this.pts=c.getCoordinates();var r=new i4;this.startIndex=r.getChainStartIndices(this.pts)}}])})(),l1=(function(){function c(){s(this,c),c.constructor_.apply(this,arguments)}return l(c,[{key:"getDepth",value:function(r,a){return this._depth[r][a]}},{key:"setDepth",value:function(r,a,u){this._depth[r][a]=u}},{key:"isNull",value:function(){if(arguments.length===0){for(var r=0;r<2;r++)for(var a=0;a<3;a++)if(this._depth[r][a]!==c.NULL_VALUE)return!1;return!0}if(arguments.length===1){var u=arguments[0];return this._depth[u][1]===c.NULL_VALUE}if(arguments.length===2){var g=arguments[0],_=arguments[1];return this._depth[g][_]===c.NULL_VALUE}}},{key:"normalize",value:function(){for(var r=0;r<2;r++)if(!this.isNull(r)){var a=this._depth[r][1];this._depth[r][2]<a&&(a=this._depth[r][2]),a<0&&(a=0);for(var u=1;u<3;u++){var g=0;this._depth[r][u]>a&&(g=1),this._depth[r][u]=g}}}},{key:"getDelta",value:function(r){return this._depth[r][ut.RIGHT]-this._depth[r][ut.LEFT]}},{key:"getLocation",value:function(r,a){return this._depth[r][a]<=0?A.EXTERIOR:A.INTERIOR}},{key:"toString",value:function(){return"A: "+this._depth[0][1]+","+this._depth[0][2]+" B: "+this._depth[1][1]+","+this._depth[1][2]}},{key:"add",value:function(){if(arguments.length===1)for(var r=arguments[0],a=0;a<2;a++)for(var u=1;u<3;u++){var g=r.getLocation(a,u);g!==A.EXTERIOR&&g!==A.INTERIOR||(this.isNull(a,u)?this._depth[a][u]=c.depthAtLocation(g):this._depth[a][u]+=c.depthAtLocation(g))}else if(arguments.length===3){var _=arguments[0],E=arguments[1];arguments[2]===A.INTERIOR&&this._depth[_][E]++}}}],[{key:"constructor_",value:function(){this._depth=Array(2).fill().map((function(){return Array(3)}));for(var r=0;r<2;r++)for(var a=0;a<3;a++)this._depth[r][a]=c.NULL_VALUE}},{key:"depthAtLocation",value:function(r){return r===A.EXTERIOR?0:r===A.INTERIOR?1:c.NULL_VALUE}}])})();l1.NULL_VALUE=-1;var u1=(function(c){function r(){var a;return s(this,r),a=n(this,r),r.constructor_.apply(a,arguments),a}return m(r,c),l(r,[{key:"getDepth",value:function(){return this._depth}},{key:"getCollapsedEdge",value:function(){var a=new Array(2).fill(null);return a[0]=this.pts[0],a[1]=this.pts[1],new r(a,Ki.toLineLabel(this._label))}},{key:"isIsolated",value:function(){return this._isIsolated}},{key:"getCoordinates",value:function(){return this.pts}},{key:"setIsolated",value:function(a){this._isIsolated=a}},{key:"setName",value:function(a){this._name=a}},{key:"equals",value:function(a){if(!(a instanceof r))return!1;var u=a;if(this.pts.length!==u.pts.length)return!1;for(var g=!0,_=!0,E=this.pts.length,P=0;P<this.pts.length;P++)if(this.pts[P].equals2D(u.pts[P])||(g=!1),this.pts[P].equals2D(u.pts[--E])||(_=!1),!g&&!_)return!1;return!0}},{key:"getCoordinate",value:function(){if(arguments.length===0)return this.pts.length>0?this.pts[0]:null;if(arguments.length===1){var a=arguments[0];return this.pts[a]}}},{key:"print",value:function(a){a.print("edge "+this._name+": "),a.print("LINESTRING (");for(var u=0;u<this.pts.length;u++)u>0&&a.print(","),a.print(this.pts[u].x+" "+this.pts[u].y);a.print(") "+this._label+" "+this._depthDelta)}},{key:"computeIM",value:function(a){r.updateIM(this._label,a)}},{key:"isCollapsed",value:function(){return!!this._label.isArea()&&this.pts.length===3&&!!this.pts[0].equals(this.pts[2])}},{key:"isClosed",value:function(){return this.pts[0].equals(this.pts[this.pts.length-1])}},{key:"getMaximumSegmentIndex",value:function(){return this.pts.length-1}},{key:"getDepthDelta",value:function(){return this._depthDelta}},{key:"getNumPoints",value:function(){return this.pts.length}},{key:"printReverse",value:function(a){a.print("edge "+this._name+": ");for(var u=this.pts.length-1;u>=0;u--)a.print(this.pts[u]+" ");a.println("")}},{key:"getMonotoneChainEdge",value:function(){return this._mce===null&&(this._mce=new n4(this)),this._mce}},{key:"getEnvelope",value:function(){if(this._env===null){this._env=new zt;for(var a=0;a<this.pts.length;a++)this._env.expandToInclude(this.pts[a])}return this._env}},{key:"addIntersection",value:function(a,u,g,_){var E=new K(a.getIntersection(_)),P=u,O=a.getEdgeDistance(g,_),B=P+1;if(B<this.pts.length){var Z=this.pts[B];E.equals2D(Z)&&(P=B,O=0)}this.eiList.add(E,P,O)}},{key:"toString",value:function(){var a=new Lu;a.append("edge "+this._name+": "),a.append("LINESTRING (");for(var u=0;u<this.pts.length;u++)u>0&&a.append(","),a.append(this.pts[u].x+" "+this.pts[u].y);return a.append(") "+this._label+" "+this._depthDelta),a.toString()}},{key:"isPointwiseEqual",value:function(a){if(this.pts.length!==a.pts.length)return!1;for(var u=0;u<this.pts.length;u++)if(!this.pts[u].equals2D(a.pts[u]))return!1;return!0}},{key:"setDepthDelta",value:function(a){this._depthDelta=a}},{key:"getEdgeIntersectionList",value:function(){return this.eiList}},{key:"addIntersections",value:function(a,u,g){for(var _=0;_<a.getIntersectionNum();_++)this.addIntersection(a,u,g,_)}}],[{key:"constructor_",value:function(){if(this.pts=null,this._env=null,this.eiList=new QN(this),this._name=null,this._mce=null,this._isIsolated=!0,this._depth=new l1,this._depthDelta=0,arguments.length===1){var a=arguments[0];r.constructor_.call(this,a,null)}else if(arguments.length===2){var u=arguments[0],g=arguments[1];this.pts=u,this._label=g}}},{key:"updateIM",value:function(){if(!(arguments.length===2&&arguments[1]instanceof t4&&arguments[0]instanceof Ki))return S(r,"updateIM",this).apply(this,arguments);var a=arguments[0],u=arguments[1];u.setAtLeastIfValid(a.getLocation(0,ut.ON),a.getLocation(1,ut.ON),1),a.isArea()&&(u.setAtLeastIfValid(a.getLocation(0,ut.LEFT),a.getLocation(1,ut.LEFT),2),u.setAtLeastIfValid(a.getLocation(0,ut.RIGHT),a.getLocation(1,ut.RIGHT),2))}}])})(q_),c1=(function(){function c(){s(this,c),c.constructor_.apply(this,arguments)}return l(c,[{key:"setWorkingPrecisionModel",value:function(r){this._workingPrecisionModel=r}},{key:"insertUniqueEdge",value:function(r){var a=this._edgeList.findEqualEdge(r);if(a!==null){var u=a.getLabel(),g=r.getLabel();a.isPointwiseEqual(r)||(g=new Ki(r.getLabel())).flip(),u.merge(g);var _=c.depthDelta(g),E=a.getDepthDelta()+_;a.setDepthDelta(E)}else this._edgeList.add(r),r.setDepthDelta(c.depthDelta(r.getLabel()))}},{key:"buildSubgraphs",value:function(r,a){for(var u=new Gt,g=r.iterator();g.hasNext();){var _=g.next(),E=_.getRightmostCoordinate(),P=new s1(u).getDepth(E);_.computeDepth(P),_.findResultEdges(),u.add(_),a.add(_.getDirectedEdges(),_.getNodes())}}},{key:"createSubgraphs",value:function(r){for(var a=new Gt,u=r.getNodes().iterator();u.hasNext();){var g=u.next();if(!g.isVisited()){var _=new hN;_.create(g),a.add(_)}}return mo.sort(a,mo.reverseOrder()),a}},{key:"createEmptyResultGeometry",value:function(){return this._geomFact.createPolygon()}},{key:"getNoder",value:function(r){if(this._workingNoder!==null)return this._workingNoder;var a=new Qg,u=new Wr;return u.setPrecisionModel(r),a.setSegmentIntersector(new KN(u)),a}},{key:"buffer",value:function(r,a){var u=this._workingPrecisionModel;u===null&&(u=r.getPrecisionModel()),this._geomFact=r.getFactory();var g=new zN(u,this._bufParams),_=new VN(r,a,g).getCurves();if(_.size()<=0)return this.createEmptyResultGeometry();this.computeNodedEdges(_,u),this._graph=new J_(new YN),this._graph.addEdges(this._edgeList.getEdges());var E=this.createSubgraphs(this._graph),P=new MN(this._geomFact);this.buildSubgraphs(E,P);var O=P.getPolygons();return O.size()<=0?this.createEmptyResultGeometry():this._geomFact.buildGeometry(O)}},{key:"computeNodedEdges",value:function(r,a){var u=this.getNoder(a);u.computeNodes(r);for(var g=u.getNodedSubstrings().iterator();g.hasNext();){var _=g.next(),E=_.getCoordinates();if(E.length!==2||!E[0].equals2D(E[1])){var P=_.getData(),O=new u1(_.getCoordinates(),new Ki(P));this.insertUniqueEdge(O)}}}},{key:"setNoder",value:function(r){this._workingNoder=r}}],[{key:"constructor_",value:function(){this._bufParams=null,this._workingPrecisionModel=null,this._workingNoder=null,this._geomFact=null,this._graph=null,this._edgeList=new JN;var r=arguments[0];this._bufParams=r}},{key:"depthDelta",value:function(r){var a=r.getLocation(0,ut.LEFT),u=r.getLocation(0,ut.RIGHT);return a===A.INTERIOR&&u===A.EXTERIOR?1:a===A.EXTERIOR&&u===A.INTERIOR?-1:0}},{key:"convertSegStrings",value:function(r){for(var a=new go,u=new Gt;r.hasNext();){var g=r.next(),_=a.createLineString(g.getCoordinates());u.add(_)}return a.buildGeometry(u)}}])})(),s4=(function(){function c(){s(this,c),c.constructor_.apply(this,arguments)}return l(c,[{key:"rescale",value:function(){if(Vt(arguments[0],at))for(var r=arguments[0].iterator();r.hasNext();){var a=r.next();this.rescale(a.getCoordinates())}else if(arguments[0]instanceof Array){for(var u=arguments[0],g=0;g<u.length;g++)u[g].x=u[g].x/this._scaleFactor+this._offsetX,u[g].y=u[g].y/this._scaleFactor+this._offsetY;u.length===2&&u[0].equals2D(u[1])&&Yi.out.println(u)}}},{key:"scale",value:function(){if(Vt(arguments[0],at)){for(var r=arguments[0],a=new Gt(r.size()),u=r.iterator();u.hasNext();){var g=u.next();a.add(new Hr(this.scale(g.getCoordinates()),g.getData()))}return a}if(arguments[0]instanceof Array){for(var _=arguments[0],E=new Array(_.length).fill(null),P=0;P<_.length;P++)E[P]=new K(Math.round((_[P].x-this._offsetX)*this._scaleFactor),Math.round((_[P].y-this._offsetY)*this._scaleFactor),_[P].getZ());return De.removeRepeatedPoints(E)}}},{key:"isIntegerPrecision",value:function(){return this._scaleFactor===1}},{key:"getNodedSubstrings",value:function(){var r=this._noder.getNodedSubstrings();return this._isScaled&&this.rescale(r),r}},{key:"computeNodes",value:function(r){var a=r;this._isScaled&&(a=this.scale(r)),this._noder.computeNodes(a)}},{key:"interfaces_",get:function(){return[Zg]}}],[{key:"constructor_",value:function(){if(this._noder=null,this._scaleFactor=null,this._offsetX=null,this._offsetY=null,this._isScaled=!1,arguments.length===2){var r=arguments[0],a=arguments[1];c.constructor_.call(this,r,a,0,0)}else if(arguments.length===4){var u=arguments[0],g=arguments[1];this._noder=u,this._scaleFactor=g,this._isScaled=!this.isIntegerPrecision()}}}])})(),d1=(function(){function c(){s(this,c),c.constructor_.apply(this,arguments)}return l(c,[{key:"checkEndPtVertexIntersections",value:function(){if(arguments.length===0)for(var r=this._segStrings.iterator();r.hasNext();){var a=r.next().getCoordinates();this.checkEndPtVertexIntersections(a[0],this._segStrings),this.checkEndPtVertexIntersections(a[a.length-1],this._segStrings)}else if(arguments.length===2){for(var u=arguments[0],g=arguments[1].iterator();g.hasNext();)for(var _=g.next().getCoordinates(),E=1;E<_.length-1;E++)if(_[E].equals(u))throw new ht("found endpt/interior pt intersection at index "+E+" :pt "+u)}}},{key:"checkInteriorIntersections",value:function(){if(arguments.length===0)for(var r=this._segStrings.iterator();r.hasNext();)for(var a=r.next(),u=this._segStrings.iterator();u.hasNext();){var g=u.next();this.checkInteriorIntersections(a,g)}else if(arguments.length===2)for(var _=arguments[0],E=arguments[1],P=_.getCoordinates(),O=E.getCoordinates(),B=0;B<P.length-1;B++)for(var Z=0;Z<O.length-1;Z++)this.checkInteriorIntersections(_,B,E,Z);else if(arguments.length===4){var tt=arguments[0],ot=arguments[1],Et=arguments[2],Nt=arguments[3];if(tt===Et&&ot===Nt)return null;var Dt=tt.getCoordinates()[ot],Zt=tt.getCoordinates()[ot+1],Yt=Et.getCoordinates()[Nt],oe=Et.getCoordinates()[Nt+1];if(this._li.computeIntersection(Dt,Zt,Yt,oe),this._li.hasIntersection()&&(this._li.isProper()||this.hasInteriorIntersection(this._li,Dt,Zt)||this.hasInteriorIntersection(this._li,Yt,oe)))throw new ht("found non-noded intersection at "+Dt+"-"+Zt+" and "+Yt+"-"+oe)}}},{key:"checkValid",value:function(){this.checkEndPtVertexIntersections(),this.checkInteriorIntersections(),this.checkCollapses()}},{key:"checkCollapses",value:function(){if(arguments.length===0)for(var r=this._segStrings.iterator();r.hasNext();){var a=r.next();this.checkCollapses(a)}else if(arguments.length===1)for(var u=arguments[0].getCoordinates(),g=0;g<u.length-2;g++)this.checkCollapse(u[g],u[g+1],u[g+2])}},{key:"hasInteriorIntersection",value:function(r,a,u){for(var g=0;g<r.getIntersectionNum();g++){var _=r.getIntersection(g);if(!_.equals(a)&&!_.equals(u))return!0}return!1}},{key:"checkCollapse",value:function(r,a,u){if(r.equals(u))throw new ht("found non-noded collapse at "+c.fact.createLineString([r,a,u]))}}],[{key:"constructor_",value:function(){this._li=new Wr,this._segStrings=null;var r=arguments[0];this._segStrings=r}}])})();d1.fact=new go;var ep=(function(){function c(){s(this,c),c.constructor_.apply(this,arguments)}return l(c,[{key:"intersectsScaled",value:function(r,a){var u=Math.min(r.x,a.x),g=Math.max(r.x,a.x),_=Math.min(r.y,a.y),E=Math.max(r.y,a.y),P=this._maxx<u||this._minx>g||this._maxy<_||this._miny>E;if(P)return!1;var O=this.intersectsToleranceSquare(r,a);return ct.isTrue(!(P&&O),"Found bad envelope test"),O}},{key:"initCorners",value:function(r){var a=.5;this._minx=r.x-a,this._maxx=r.x+a,this._miny=r.y-a,this._maxy=r.y+a,this._corner[0]=new K(this._maxx,this._maxy),this._corner[1]=new K(this._minx,this._maxy),this._corner[2]=new K(this._minx,this._miny),this._corner[3]=new K(this._maxx,this._miny)}},{key:"intersects",value:function(r,a){return this._scaleFactor===1?this.intersectsScaled(r,a):(this.copyScaled(r,this._p0Scaled),this.copyScaled(a,this._p1Scaled),this.intersectsScaled(this._p0Scaled,this._p1Scaled))}},{key:"scale",value:function(r){return Math.round(r*this._scaleFactor)}},{key:"getCoordinate",value:function(){return this._originalPt}},{key:"copyScaled",value:function(r,a){a.x=this.scale(r.x),a.y=this.scale(r.y)}},{key:"getSafeEnvelope",value:function(){if(this._safeEnv===null){var r=c.SAFE_ENV_EXPANSION_FACTOR/this._scaleFactor;this._safeEnv=new zt(this._originalPt.x-r,this._originalPt.x+r,this._originalPt.y-r,this._originalPt.y+r)}return this._safeEnv}},{key:"intersectsPixelClosure",value:function(r,a){return this._li.computeIntersection(r,a,this._corner[0],this._corner[1]),!!this._li.hasIntersection()||(this._li.computeIntersection(r,a,this._corner[1],this._corner[2]),!!this._li.hasIntersection()||(this._li.computeIntersection(r,a,this._corner[2],this._corner[3]),!!this._li.hasIntersection()||(this._li.computeIntersection(r,a,this._corner[3],this._corner[0]),!!this._li.hasIntersection())))}},{key:"intersectsToleranceSquare",value:function(r,a){var u=!1,g=!1;return this._li.computeIntersection(r,a,this._corner[0],this._corner[1]),!!this._li.isProper()||(this._li.computeIntersection(r,a,this._corner[1],this._corner[2]),!!this._li.isProper()||(this._li.hasIntersection()&&(u=!0),this._li.computeIntersection(r,a,this._corner[2],this._corner[3]),!!this._li.isProper()||(this._li.hasIntersection()&&(g=!0),this._li.computeIntersection(r,a,this._corner[3],this._corner[0]),!!this._li.isProper()||!(!u||!g)||!!r.equals(this._pt)||!!a.equals(this._pt))))}},{key:"addSnappedNode",value:function(r,a){var u=r.getCoordinate(a),g=r.getCoordinate(a+1);return!!this.intersects(u,g)&&(r.addIntersection(this.getCoordinate(),a),!0)}}],[{key:"constructor_",value:function(){this._li=null,this._pt=null,this._originalPt=null,this._ptScaled=null,this._p0Scaled=null,this._p1Scaled=null,this._scaleFactor=null,this._minx=null,this._maxx=null,this._miny=null,this._maxy=null,this._corner=new Array(4).fill(null),this._safeEnv=null;var r=arguments[0],a=arguments[1],u=arguments[2];if(this._originalPt=r,this._pt=r,this._scaleFactor=a,this._li=u,a<=0)throw new D("Scale factor must be non-zero");a!==1&&(this._pt=new K(this.scale(r.x),this.scale(r.y)),this._p0Scaled=new K,this._p1Scaled=new K),this.initCorners(this._pt)}}])})();ep.SAFE_ENV_EXPANSION_FACTOR=.75;var r4=(function(){return l((function c(){s(this,c),c.constructor_.apply(this,arguments)}),[{key:"select",value:function(){if(arguments.length!==1){if(arguments.length===2){var c=arguments[1];arguments[0].getLineSegment(c,this.selectedSegment),this.select(this.selectedSegment)}}}}],[{key:"constructor_",value:function(){this.selectedSegment=new Ni}}])})(),f1=(function(){return l((function c(){s(this,c),c.constructor_.apply(this,arguments)}),[{key:"snap",value:function(){if(arguments.length===1){var c=arguments[0];return this.snap(c,null,-1)}if(arguments.length===3){var r=arguments[0],a=arguments[1],u=arguments[2],g=r.getSafeEnvelope(),_=new g1(r,a,u);return this._index.query(g,new((function(){return l((function E(){s(this,E)}),[{key:"interfaces_",get:function(){return[Z_]}},{key:"visitItem",value:function(E){E.select(g,_)}}])})())),_.isNodeAdded()}}}],[{key:"constructor_",value:function(){this._index=null;var c=arguments[0];this._index=c}}])})(),g1=(function(c){function r(){var a;return s(this,r),a=n(this,r),r.constructor_.apply(a,arguments),a}return m(r,c),l(r,[{key:"isNodeAdded",value:function(){return this._isNodeAdded}},{key:"select",value:function(){if(!(arguments.length===2&&Number.isInteger(arguments[1])&&arguments[0]instanceof t1))return S(r,"select",this,1).apply(this,arguments);var a=arguments[1],u=arguments[0].getContext();if(this._parentEdge===u&&(a===this._hotPixelVertexIndex||a+1===this._hotPixelVertexIndex))return null;this._isNodeAdded|=this._hotPixel.addSnappedNode(u,a)}}],[{key:"constructor_",value:function(){this._hotPixel=null,this._parentEdge=null,this._hotPixelVertexIndex=null,this._isNodeAdded=!1;var a=arguments[0],u=arguments[1],g=arguments[2];this._hotPixel=a,this._parentEdge=u,this._hotPixelVertexIndex=g}}])})(r4);f1.HotPixelSnapAction=g1;var a4=(function(){return l((function c(){s(this,c),c.constructor_.apply(this,arguments)}),[{key:"processIntersections",value:function(c,r,a,u){if(c===a&&r===u)return null;var g=c.getCoordinates()[r],_=c.getCoordinates()[r+1],E=a.getCoordinates()[u],P=a.getCoordinates()[u+1];if(this._li.computeIntersection(g,_,E,P),this._li.hasIntersection()&&this._li.isInteriorIntersection()){for(var O=0;O<this._li.getIntersectionNum();O++)this._interiorIntersections.add(this._li.getIntersection(O));c.addIntersections(this._li,r,0),a.addIntersections(this._li,u,1)}}},{key:"isDone",value:function(){return!1}},{key:"getInteriorIntersections",value:function(){return this._interiorIntersections}},{key:"interfaces_",get:function(){return[h1]}}],[{key:"constructor_",value:function(){this._li=null,this._interiorIntersections=null;var c=arguments[0];this._li=c,this._interiorIntersections=new Gt}}])})(),o4=(function(){return l((function c(){s(this,c),c.constructor_.apply(this,arguments)}),[{key:"checkCorrectness",value:function(c){var r=Hr.getNodedSubstrings(c),a=new d1(r);try{a.checkValid()}catch(u){if(!(u instanceof M))throw u;u.printStackTrace()}}},{key:"getNodedSubstrings",value:function(){return Hr.getNodedSubstrings(this._nodedSegStrings)}},{key:"snapRound",value:function(c,r){var a=this.findInteriorIntersections(c,r);this.computeIntersectionSnaps(a),this.computeVertexSnaps(c)}},{key:"findInteriorIntersections",value:function(c,r){var a=new a4(r);return this._noder.setSegmentIntersector(a),this._noder.computeNodes(c),a.getInteriorIntersections()}},{key:"computeVertexSnaps",value:function(){if(Vt(arguments[0],at))for(var c=arguments[0].iterator();c.hasNext();){var r=c.next();this.computeVertexSnaps(r)}else if(arguments[0]instanceof Hr)for(var a=arguments[0],u=a.getCoordinates(),g=0;g<u.length;g++){var _=new ep(u[g],this._scaleFactor,this._li);this._pointSnapper.snap(_,a,g)&&a.addIntersection(u[g],g)}}},{key:"computeNodes",value:function(c){this._nodedSegStrings=c,this._noder=new Qg,this._pointSnapper=new f1(this._noder.getIndex()),this.snapRound(c,this._li)}},{key:"computeIntersectionSnaps",value:function(c){for(var r=c.iterator();r.hasNext();){var a=r.next(),u=new ep(a,this._scaleFactor,this._li);this._pointSnapper.snap(u)}}},{key:"interfaces_",get:function(){return[Zg]}}],[{key:"constructor_",value:function(){this._pm=null,this._li=null,this._scaleFactor=null,this._noder=null,this._pointSnapper=null,this._nodedSegStrings=null;var c=arguments[0];this._pm=c,this._li=new Wr,this._li.setPrecisionModel(c),this._scaleFactor=c.getScale()}}])})(),_o=(function(){function c(){s(this,c),c.constructor_.apply(this,arguments)}return l(c,[{key:"bufferFixedPrecision",value:function(r){var a=new s4(new o4(new mn(1)),r.getScale()),u=new c1(this._bufParams);u.setWorkingPrecisionModel(r),u.setNoder(a),this._resultGeometry=u.buffer(this._argGeom,this._distance)}},{key:"bufferReducedPrecision",value:function(){if(arguments.length===0){for(var r=c.MAX_PRECISION_DIGITS;r>=0;r--){try{this.bufferReducedPrecision(r)}catch(_){if(!(_ instanceof fs))throw _;this._saveException=_}if(this._resultGeometry!==null)return null}throw this._saveException}if(arguments.length===1){var a=arguments[0],u=c.precisionScaleFactor(this._argGeom,this._distance,a),g=new mn(u);this.bufferFixedPrecision(g)}}},{key:"computeGeometry",value:function(){if(this.bufferOriginalPrecision(),this._resultGeometry!==null)return null;var r=this._argGeom.getFactory().getPrecisionModel();r.getType()===mn.FIXED?this.bufferFixedPrecision(r):this.bufferReducedPrecision()}},{key:"setQuadrantSegments",value:function(r){this._bufParams.setQuadrantSegments(r)}},{key:"bufferOriginalPrecision",value:function(){try{var r=new c1(this._bufParams);this._resultGeometry=r.buffer(this._argGeom,this._distance)}catch(a){if(!(a instanceof ht))throw a;this._saveException=a}}},{key:"getResultGeometry",value:function(r){return this._distance=r,this.computeGeometry(),this._resultGeometry}},{key:"setEndCapStyle",value:function(r){this._bufParams.setEndCapStyle(r)}}],[{key:"constructor_",value:function(){if(this._argGeom=null,this._distance=null,this._bufParams=new k,this._resultGeometry=null,this._saveException=null,arguments.length===1){var r=arguments[0];this._argGeom=r}else if(arguments.length===2){var a=arguments[0],u=arguments[1];this._argGeom=a,this._bufParams=u}}},{key:"bufferOp",value:function(){if(arguments.length===2){var r=arguments[1];return new c(arguments[0]).getResultGeometry(r)}if(arguments.length===3){if(Number.isInteger(arguments[2])&&arguments[0]instanceof gt&&typeof arguments[1]=="number"){var a=arguments[1],u=arguments[2],g=new c(arguments[0]);return g.setQuadrantSegments(u),g.getResultGeometry(a)}if(arguments[2]instanceof k&&arguments[0]instanceof gt&&typeof arguments[1]=="number"){var _=arguments[1];return new c(arguments[0],arguments[2]).getResultGeometry(_)}}else if(arguments.length===4){var E=arguments[1],P=arguments[2],O=arguments[3],B=new c(arguments[0]);return B.setQuadrantSegments(P),B.setEndCapStyle(O),B.getResultGeometry(E)}}},{key:"precisionScaleFactor",value:function(r,a,u){var g=r.getEnvelopeInternal(),_=Rh.max(Math.abs(g.getMaxX()),Math.abs(g.getMaxY()),Math.abs(g.getMinX()),Math.abs(g.getMinY()))+2*(a>0?a:0),E=u-Math.trunc(Math.log(_)/Math.log(10)+1);return Math.pow(10,E)}}])})();_o.CAP_ROUND=k.CAP_ROUND,_o.CAP_BUTT=k.CAP_FLAT,_o.CAP_FLAT=k.CAP_FLAT,_o.CAP_SQUARE=k.CAP_SQUARE,_o.MAX_PRECISION_DIGITS=12;var h4=["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"],p1=(function(){return l((function c(r){s(this,c),this.geometryFactory=r||new go}),[{key:"read",value:function(c){var r,a=(r=typeof c=="string"?JSON.parse(c):c).type;if(!Qi[a])throw new Error("Unknown GeoJSON type: "+r.type);return h4.indexOf(a)!==-1?Qi[a].call(this,r.coordinates):a==="GeometryCollection"?Qi[a].call(this,r.geometries):Qi[a].call(this,r)}},{key:"write",value:function(c){var r=c.getGeometryType();if(!Hn[r])throw new Error("Geometry is not supported");return Hn[r].call(this,c)}}])})(),Qi={Feature:function(c){var r={};for(var a in c)r[a]=c[a];if(c.geometry){var u=c.geometry.type;if(!Qi[u])throw new Error("Unknown GeoJSON type: "+c.type);r.geometry=this.read(c.geometry)}return c.bbox&&(r.bbox=Qi.bbox.call(this,c.bbox)),r},FeatureCollection:function(c){var r={};if(c.features){r.features=[];for(var a=0;a<c.features.length;++a)r.features.push(this.read(c.features[a]))}return c.bbox&&(r.bbox=this.parse.bbox.call(this,c.bbox)),r},coordinates:function(c){for(var r=[],a=0;a<c.length;++a){var u=c[a];r.push(o(K,T(u)))}return r},bbox:function(c){return this.geometryFactory.createLinearRing([new K(c[0],c[1]),new K(c[2],c[1]),new K(c[2],c[3]),new K(c[0],c[3]),new K(c[0],c[1])])},Point:function(c){var r=o(K,T(c));return this.geometryFactory.createPoint(r)},MultiPoint:function(c){for(var r=[],a=0;a<c.length;++a)r.push(Qi.Point.call(this,c[a]));return this.geometryFactory.createMultiPoint(r)},LineString:function(c){var r=Qi.coordinates.call(this,c);return this.geometryFactory.createLineString(r)},MultiLineString:function(c){for(var r=[],a=0;a<c.length;++a)r.push(Qi.LineString.call(this,c[a]));return this.geometryFactory.createMultiLineString(r)},Polygon:function(c){for(var r=Qi.coordinates.call(this,c[0]),a=this.geometryFactory.createLinearRing(r),u=[],g=1;g<c.length;++g){var _=c[g],E=Qi.coordinates.call(this,_),P=this.geometryFactory.createLinearRing(E);u.push(P)}return this.geometryFactory.createPolygon(a,u)},MultiPolygon:function(c){for(var r=[],a=0;a<c.length;++a){var u=c[a];r.push(Qi.Polygon.call(this,u))}return this.geometryFactory.createMultiPolygon(r)},GeometryCollection:function(c){for(var r=[],a=0;a<c.length;++a){var u=c[a];r.push(this.read(u))}return this.geometryFactory.createGeometryCollection(r)}},Hn={coordinate:function(c){var r=[c.x,c.y];return c.z&&r.push(c.z),c.m&&r.push(c.m),r},Point:function(c){return{type:"Point",coordinates:Hn.coordinate.call(this,c.getCoordinate())}},MultiPoint:function(c){for(var r=[],a=0;a<c._geometries.length;++a){var u=c._geometries[a],g=Hn.Point.call(this,u);r.push(g.coordinates)}return{type:"MultiPoint",coordinates:r}},LineString:function(c){for(var r=[],a=c.getCoordinates(),u=0;u<a.length;++u){var g=a[u];r.push(Hn.coordinate.call(this,g))}return{type:"LineString",coordinates:r}},MultiLineString:function(c){for(var r=[],a=0;a<c._geometries.length;++a){var u=c._geometries[a],g=Hn.LineString.call(this,u);r.push(g.coordinates)}return{type:"MultiLineString",coordinates:r}},Polygon:function(c){var r=[],a=Hn.LineString.call(this,c._shell);r.push(a.coordinates);for(var u=0;u<c._holes.length;++u){var g=c._holes[u],_=Hn.LineString.call(this,g);r.push(_.coordinates)}return{type:"Polygon",coordinates:r}},MultiPolygon:function(c){for(var r=[],a=0;a<c._geometries.length;++a){var u=c._geometries[a],g=Hn.Polygon.call(this,u);r.push(g.coordinates)}return{type:"MultiPolygon",coordinates:r}},GeometryCollection:function(c){for(var r=[],a=0;a<c._geometries.length;++a){var u=c._geometries[a],g=u.getGeometryType();r.push(Hn[g].call(this,u))}return{type:"GeometryCollection",geometries:r}}};return{BufferOp:_o,GeoJSONReader:(function(){return l((function c(r){s(this,c),this.parser=new p1(r||new go)}),[{key:"read",value:function(c){return this.parser.read(c)}}])})(),GeoJSONWriter:(function(){return l((function c(){s(this,c),this.parser=new p1(this.geometryFactory)}),[{key:"write",value:function(c){return this.parser.write(c)}}])})()}}))})(kl)),kl.exports}var pM=gM();const mM=Pc(pM);function Ts(){return new Ol}function Ol(){this.reset()}Ol.prototype={constructor:Ol,reset:function(){this.s=this.t=0},add:function(i){ev(Nl,i,this.t),ev(this,Nl.s,this.s),this.s?this.t+=Nl.t:this.s=Nl.t},valueOf:function(){return this.s}};var Nl=new Ol;function ev(i,e,t){var n=i.s=e+t,s=n-e,o=n-s;i.t=e-o+(t-s)}var he=1e-6,te=Math.PI,bn=te/2,iv=te/4,Pn=te*2,ks=180/te,ji=te/180,Ge=Math.abs,vM=Math.atan,Ea=Math.atan2,me=Math.cos,ve=Math.sin,Sa=Math.sqrt;function nv(i){return i>1?0:i<-1?te:Math.acos(i)}function lr(i){return i>1?bn:i<-1?-bn:Math.asin(i)}function uh(){}function Rl(i,e){i&&rv.hasOwnProperty(i.type)&&rv[i.type](i,e)}var sv={Feature:function(i,e){Rl(i.geometry,e)},FeatureCollection:function(i,e){for(var t=i.features,n=-1,s=t.length;++n<s;)Rl(t[n].geometry,e)}},rv={Sphere:function(i,e){e.sphere()},Point:function(i,e){i=i.coordinates,e.point(i[0],i[1],i[2])},MultiPoint:function(i,e){for(var t=i.coordinates,n=-1,s=t.length;++n<s;)i=t[n],e.point(i[0],i[1],i[2])},LineString:function(i,e){xd(i.coordinates,e,0)},MultiLineString:function(i,e){for(var t=i.coordinates,n=-1,s=t.length;++n<s;)xd(t[n],e,0)},Polygon:function(i,e){av(i.coordinates,e)},MultiPolygon:function(i,e){for(var t=i.coordinates,n=-1,s=t.length;++n<s;)av(t[n],e)},GeometryCollection:function(i,e){for(var t=i.geometries,n=-1,s=t.length;++n<s;)Rl(t[n],e)}};function xd(i,e,t){var n=-1,s=i.length-t,o;for(e.lineStart();++n<s;)o=i[n],e.point(o[0],o[1],o[2]);e.lineEnd()}function av(i,e){var t=-1,n=i.length;for(e.polygonStart();++t<n;)xd(i[t],e,1);e.polygonEnd()}function yM(i,e){i&&sv.hasOwnProperty(i.type)?sv[i.type](i,e):Rl(i,e)}Ts(),Ts();function bd(i){return[Ea(i[1],i[0]),lr(i[2])]}function xa(i){var e=i[0],t=i[1],n=me(t);return[n*me(e),n*ve(e),ve(t)]}function Al(i,e){return i[0]*e[0]+i[1]*e[1]+i[2]*e[2]}function Dl(i,e){return[i[1]*e[2]-i[2]*e[1],i[2]*e[0]-i[0]*e[2],i[0]*e[1]-i[1]*e[0]]}function Pd(i,e){i[0]+=e[0],i[1]+=e[1],i[2]+=e[2]}function Ll(i,e){return[i[0]*e,i[1]*e,i[2]*e]}function Cd(i){var e=Sa(i[0]*i[0]+i[1]*i[1]+i[2]*i[2]);i[0]/=e,i[1]/=e,i[2]/=e}Ts();function ov(i,e){function t(n,s){return n=i(n,s),e(n[0],n[1])}return i.invert&&e.invert&&(t.invert=function(n,s){return n=e.invert(n,s),n&&i.invert(n[0],n[1])}),t}function Id(i,e){return[i>te?i-Pn:i<-te?i+Pn:i,e]}Id.invert=Id;function _M(i,e,t){return(i%=Pn)?e||t?ov(lv(i),uv(e,t)):lv(i):e||t?uv(e,t):Id}function hv(i){return function(e,t){return e+=i,[e>te?e-Pn:e<-te?e+Pn:e,t]}}function lv(i){var e=hv(i);return e.invert=hv(-i),e}function uv(i,e){var t=me(i),n=ve(i),s=me(e),o=ve(e);function h(l,d){var f=me(d),v=me(l)*f,m=ve(l)*f,y=ve(d),w=y*t+v*n;return[Ea(m*s-w*o,v*t-y*n),lr(w*s+m*o)]}return h.invert=function(l,d){var f=me(d),v=me(l)*f,m=ve(l)*f,y=ve(d),w=y*s-m*o;return[Ea(m*s+y*o,v*t+w*n),lr(w*t-v*n)]},h}function wM(i,e,t,n,s,o){if(t){var h=me(e),l=ve(e),d=n*t;s==null?(s=e+n*Pn,o=e-d/2):(s=cv(h,s),o=cv(h,o),(n>0?s<o:s>o)&&(s+=n*Pn));for(var f,v=s;n>0?v>o:v<o;v-=d)f=bd([h,-l*me(v),-l*ve(v)]),i.point(f[0],f[1])}}function cv(i,e){e=xa(e),e[0]-=i,Cd(e);var t=nv(-e[1]);return((-e[2]<0?-t:t)+Pn-he)%Pn}function dv(){var i=[],e;return{point:function(t,n){e.push([t,n])},lineStart:function(){i.push(e=[])},lineEnd:uh,rejoin:function(){i.length>1&&i.push(i.pop().concat(i.shift()))},result:function(){var t=i;return i=[],e=null,t}}}function EM(i,e,t,n,s,o){var h=i[0],l=i[1],d=e[0],f=e[1],v=0,m=1,y=d-h,w=f-l,S;if(S=t-h,!(!y&&S>0)){if(S/=y,y<0){if(S<v)return;S<m&&(m=S)}else if(y>0){if(S>m)return;S>v&&(v=S)}if(S=s-h,!(!y&&S<0)){if(S/=y,y<0){if(S>m)return;S>v&&(v=S)}else if(y>0){if(S<v)return;S<m&&(m=S)}if(S=n-l,!(!w&&S>0)){if(S/=w,w<0){if(S<v)return;S<m&&(m=S)}else if(w>0){if(S>m)return;S>v&&(v=S)}if(S=o-l,!(!w&&S<0)){if(S/=w,w<0){if(S>m)return;S>v&&(v=S)}else if(w>0){if(S<v)return;S<m&&(m=S)}return v>0&&(i[0]=h+v*y,i[1]=l+v*w),m<1&&(e[0]=h+m*y,e[1]=l+m*w),!0}}}}}function Fl(i,e){return Ge(i[0]-e[0])<he&&Ge(i[1]-e[1])<he}function Gl(i,e,t,n){this.x=i,this.z=e,this.o=t,this.e=n,this.v=!1,this.n=this.p=null}function fv(i,e,t,n,s){var o=[],h=[],l,d;if(i.forEach(function(S){if(!((T=S.length-1)<=0)){var T,N=S[0],j=S[T],C;if(Fl(N,j)){for(s.lineStart(),l=0;l<T;++l)s.point((N=S[l])[0],N[1]);s.lineEnd();return}o.push(C=new Gl(N,S,null,!0)),h.push(C.o=new Gl(N,null,C,!1)),o.push(C=new Gl(j,S,null,!1)),h.push(C.o=new Gl(j,null,C,!0))}}),!!o.length){for(h.sort(e),gv(o),gv(h),l=0,d=h.length;l<d;++l)h[l].e=t=!t;for(var f=o[0],v,m;;){for(var y=f,w=!0;y.v;)if((y=y.n)===f)return;v=y.z,s.lineStart();do{if(y.v=y.o.v=!0,y.e){if(w)for(l=0,d=v.length;l<d;++l)s.point((m=v[l])[0],m[1]);else n(y.x,y.n.x,1,s);y=y.n}else{if(w)for(v=y.p.z,l=v.length-1;l>=0;--l)s.point((m=v[l])[0],m[1]);else n(y.x,y.p.x,-1,s);y=y.p}y=y.o,v=y.z,w=!w}while(!y.v);s.lineEnd()}}}function gv(i){if(e=i.length){for(var e,t=0,n=i[0],s;++t<e;)n.n=s=i[t],s.p=n,n=s;n.n=s=i[0],s.p=n}}function pv(i,e){return i<e?-1:i>e?1:i>=e?0:NaN}function SM(i){return i.length===1&&(i=xM(i)),{left:function(e,t,n,s){for(n==null&&(n=0),s==null&&(s=e.length);n<s;){var o=n+s>>>1;i(e[o],t)<0?n=o+1:s=o}return n},right:function(e,t,n,s){for(n==null&&(n=0),s==null&&(s=e.length);n<s;){var o=n+s>>>1;i(e[o],t)>0?s=o:n=o+1}return n}}}function xM(i){return function(e,t){return pv(i(e),t)}}SM(pv);function mv(i){for(var e=i.length,t,n=-1,s=0,o,h;++n<e;)s+=i[n].length;for(o=new Array(s);--e>=0;)for(h=i[e],t=h.length;--t>=0;)o[--s]=h[t];return o}var ch=1e9,jl=-ch;function bM(i,e,t,n){function s(f,v){return i<=f&&f<=t&&e<=v&&v<=n}function o(f,v,m,y){var w=0,S=0;if(f==null||(w=h(f,m))!==(S=h(v,m))||d(f,v)<0^m>0)do y.point(w===0||w===3?i:t,w>1?n:e);while((w=(w+m+4)%4)!==S);else y.point(v[0],v[1])}function h(f,v){return Ge(f[0]-i)<he?v>0?0:3:Ge(f[0]-t)<he?v>0?2:1:Ge(f[1]-e)<he?v>0?1:0:v>0?3:2}function l(f,v){return d(f.x,v.x)}function d(f,v){var m=h(f,1),y=h(v,1);return m!==y?m-y:m===0?v[1]-f[1]:m===1?f[0]-v[0]:m===2?f[1]-v[1]:v[0]-f[0]}return function(f){var v=f,m=dv(),y,w,S,T,N,j,C,k,M,D,L,V={point:x,lineStart:F,lineEnd:U,polygonStart:R,polygonEnd:G};function x($,W){s($,W)&&v.point($,W)}function I(){for(var $=0,W=0,X=w.length;W<X;++W)for(var Y=w[W],et=1,J=Y.length,rt=Y[0],ht,Ot,ct=rt[0],_t=rt[1];et<J;++et)ht=ct,Ot=_t,rt=Y[et],ct=rt[0],_t=rt[1],Ot<=n?_t>n&&(ct-ht)*(n-Ot)>(_t-Ot)*(i-ht)&&++$:_t<=n&&(ct-ht)*(n-Ot)<(_t-Ot)*(i-ht)&&--$;return $}function R(){v=m,y=[],w=[],L=!0}function G(){var $=I(),W=L&&$,X=(y=mv(y)).length;(W||X)&&(f.polygonStart(),W&&(f.lineStart(),o(null,null,1,f),f.lineEnd()),X&&fv(y,l,$,o,f),f.polygonEnd()),v=f,y=w=S=null}function F(){V.point=z,w&&w.push(S=[]),D=!0,M=!1,C=k=NaN}function U(){y&&(z(T,N),j&&M&&m.rejoin(),y.push(m.result())),V.point=x,M&&v.lineEnd()}function z($,W){var X=s($,W);if(w&&S.push([$,W]),D)T=$,N=W,j=X,D=!1,X&&(v.lineStart(),v.point($,W));else if(X&&M)v.point($,W);else{var Y=[C=Math.max(jl,Math.min(ch,C)),k=Math.max(jl,Math.min(ch,k))],et=[$=Math.max(jl,Math.min(ch,$)),W=Math.max(jl,Math.min(ch,W))];EM(Y,et,i,e,t,n)?(M||(v.lineStart(),v.point(Y[0],Y[1])),v.point(et[0],et[1]),X||v.lineEnd(),L=!1):X&&(v.lineStart(),v.point($,W),L=!1)}C=$,k=W,M=X}return V}}var Md=Ts();function PM(i,e){var t=e[0],n=e[1],s=[ve(t),-me(t),0],o=0,h=0;Md.reset();for(var l=0,d=i.length;l<d;++l)if(v=(f=i[l]).length)for(var f,v,m=f[v-1],y=m[0],w=m[1]/2+iv,S=ve(w),T=me(w),N=0;N<v;++N,y=C,S=M,T=D,m=j){var j=f[N],C=j[0],k=j[1]/2+iv,M=ve(k),D=me(k),L=C-y,V=L>=0?1:-1,x=V*L,I=x>te,R=S*M;if(Md.add(Ea(R*V*ve(x),T*D+R*me(x))),o+=I?L+V*Pn:L,I^y>=t^C>=t){var G=Dl(xa(m),xa(j));Cd(G);var F=Dl(s,G);Cd(F);var U=(I^L>=0?-1:1)*lr(F[2]);(n>U||n===U&&(G[0]||G[1]))&&(h+=I^L>=0?1:-1)}}return(o<-he||o<he&&Md<-he)^h&1}Ts();function vv(i){return i}Ts(),Ts();var ba=1/0,Bl=ba,dh=-ba,zl=dh,yv={point:CM,lineStart:uh,lineEnd:uh,polygonStart:uh,polygonEnd:uh,result:function(){var i=[[ba,Bl],[dh,zl]];return dh=zl=-(Bl=ba=1/0),i}};function CM(i,e){i<ba&&(ba=i),i>dh&&(dh=i),e<Bl&&(Bl=e),e>zl&&(zl=e)}Ts();function _v(i,e,t,n){return function(s,o){var h=e(o),l=s.invert(n[0],n[1]),d=dv(),f=e(d),v=!1,m,y,w,S={point:T,lineStart:j,lineEnd:C,polygonStart:function(){S.point=k,S.lineStart=M,S.lineEnd=D,y=[],m=[]},polygonEnd:function(){S.point=T,S.lineStart=j,S.lineEnd=C,y=mv(y);var L=PM(m,l);y.length?(v||(o.polygonStart(),v=!0),fv(y,MM,L,t,o)):L&&(v||(o.polygonStart(),v=!0),o.lineStart(),t(null,null,1,o),o.lineEnd()),v&&(o.polygonEnd(),v=!1),y=m=null},sphere:function(){o.polygonStart(),o.lineStart(),t(null,null,1,o),o.lineEnd(),o.polygonEnd()}};function T(L,V){var x=s(L,V);i(L=x[0],V=x[1])&&o.point(L,V)}function N(L,V){var x=s(L,V);h.point(x[0],x[1])}function j(){S.point=N,h.lineStart()}function C(){S.point=T,h.lineEnd()}function k(L,V){w.push([L,V]);var x=s(L,V);f.point(x[0],x[1])}function M(){f.lineStart(),w=[]}function D(){k(w[0][0],w[0][1]),f.lineEnd();var L=f.clean(),V=d.result(),x,I=V.length,R,G,F;if(w.pop(),m.push(w),w=null,!!I){if(L&1){if(G=V[0],(R=G.length-1)>0){for(v||(o.polygonStart(),v=!0),o.lineStart(),x=0;x<R;++x)o.point((F=G[x])[0],F[1]);o.lineEnd()}return}I>1&&L&2&&V.push(V.pop().concat(V.shift())),y.push(V.filter(IM))}}return S}}function IM(i){return i.length>1}function MM(i,e){return((i=i.x)[0]<0?i[1]-bn-he:bn-i[1])-((e=e.x)[0]<0?e[1]-bn-he:bn-e[1])}const wv=_v(function(){return!0},TM,OM,[-te,-bn]);function TM(i){var e=NaN,t=NaN,n=NaN,s;return{lineStart:function(){i.lineStart(),s=1},point:function(o,h){var l=o>0?te:-te,d=Ge(o-e);Ge(d-te)<he?(i.point(e,t=(t+h)/2>0?bn:-bn),i.point(n,t),i.lineEnd(),i.lineStart(),i.point(l,t),i.point(o,t),s=0):n!==l&&d>=te&&(Ge(e-n)<he&&(e-=n*he),Ge(o-l)<he&&(o-=l*he),t=kM(e,t,o,h),i.point(n,t),i.lineEnd(),i.lineStart(),i.point(l,t),s=0),i.point(e=o,t=h),n=l},lineEnd:function(){i.lineEnd(),e=t=NaN},clean:function(){return 2-s}}}function kM(i,e,t,n){var s,o,h=ve(i-t);return Ge(h)>he?vM((ve(e)*(o=me(n))*ve(t)-ve(n)*(s=me(e))*ve(i))/(s*o*h)):(e+n)/2}function OM(i,e,t,n){var s;if(i==null)s=t*bn,n.point(-te,s),n.point(0,s),n.point(te,s),n.point(te,0),n.point(te,-s),n.point(0,-s),n.point(-te,-s),n.point(-te,0),n.point(-te,s);else if(Ge(i[0]-e[0])>he){var o=i[0]<e[0]?te:-te;s=t*o/2,n.point(-o,s),n.point(0,s),n.point(o,s)}else n.point(e[0],e[1])}function NM(i,e){var t=me(i),n=t>0,s=Ge(t)>he;function o(v,m,y,w){wM(w,i,e,y,v,m)}function h(v,m){return me(v)*me(m)>t}function l(v){var m,y,w,S,T;return{lineStart:function(){S=w=!1,T=1},point:function(N,j){var C=[N,j],k,M=h(N,j),D=n?M?0:f(N,j):M?f(N+(N<0?te:-te),j):0;if(!m&&(S=w=M)&&v.lineStart(),M!==w&&(k=d(m,C),(!k||Fl(m,k)||Fl(C,k))&&(C[0]+=he,C[1]+=he,M=h(C[0],C[1]))),M!==w)T=0,M?(v.lineStart(),k=d(C,m),v.point(k[0],k[1])):(k=d(m,C),v.point(k[0],k[1]),v.lineEnd()),m=k;else if(s&&m&&n^M){var L;!(D&y)&&(L=d(C,m,!0))&&(T=0,n?(v.lineStart(),v.point(L[0][0],L[0][1]),v.point(L[1][0],L[1][1]),v.lineEnd()):(v.point(L[1][0],L[1][1]),v.lineEnd(),v.lineStart(),v.point(L[0][0],L[0][1])))}M&&(!m||!Fl(m,C))&&v.point(C[0],C[1]),m=C,w=M,y=D},lineEnd:function(){w&&v.lineEnd(),m=null},clean:function(){return T|(S&&w)<<1}}}function d(v,m,y){var w=xa(v),S=xa(m),T=[1,0,0],N=Dl(w,S),j=Al(N,N),C=N[0],k=j-C*C;if(!k)return!y&&v;var M=t*j/k,D=-t*C/k,L=Dl(T,N),V=Ll(T,M),x=Ll(N,D);Pd(V,x);var I=L,R=Al(V,I),G=Al(I,I),F=R*R-G*(Al(V,V)-1);if(!(F<0)){var U=Sa(F),z=Ll(I,(-R-U)/G);if(Pd(z,V),z=bd(z),!y)return z;var $=v[0],W=m[0],X=v[1],Y=m[1],et;W<$&&(et=$,$=W,W=et);var J=W-$,rt=Ge(J-te)<he,ht=rt||J<he;if(!rt&&Y<X&&(et=X,X=Y,Y=et),ht?rt?X+Y>0^z[1]<(Ge(z[0]-$)<he?X:Y):X<=z[1]&&z[1]<=Y:J>te^($<=z[0]&&z[0]<=W)){var Ot=Ll(I,(-R+U)/G);return Pd(Ot,V),[z,bd(Ot)]}}}function f(v,m){var y=n?i:te-i,w=0;return v<-y?w|=1:v>y&&(w|=2),m<-y?w|=4:m>y&&(w|=8),w}return _v(h,l,o,n?[0,-i]:[-te,i-te])}function Ev(i){return function(e){var t=new Td;for(var n in i)t[n]=i[n];return t.stream=e,t}}function Td(){}Td.prototype={constructor:Td,point:function(i,e){this.stream.point(i,e)},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()}};function Sv(i,e,t){var n=e[1][0]-e[0][0],s=e[1][1]-e[0][1],o=i.clipExtent&&i.clipExtent();i.scale(150).translate([0,0]),o!=null&&i.clipExtent(null),yM(t,i.stream(yv));var h=yv.result(),l=Math.min(n/(h[1][0]-h[0][0]),s/(h[1][1]-h[0][1])),d=+e[0][0]+(n-l*(h[1][0]+h[0][0]))/2,f=+e[0][1]+(s-l*(h[1][1]+h[0][1]))/2;return o!=null&&i.clipExtent(o),i.scale(l*150).translate([d,f])}function RM(i,e,t){return Sv(i,[[0,0],e],t)}var xv=16,AM=me(30*ji);function bv(i,e){return+e?LM(i,e):DM(i)}function DM(i){return Ev({point:function(e,t){e=i(e,t),this.stream.point(e[0],e[1])}})}function LM(i,e){function t(n,s,o,h,l,d,f,v,m,y,w,S,T,N){var j=f-n,C=v-s,k=j*j+C*C;if(k>4*e&&T--){var M=h+y,D=l+w,L=d+S,V=Sa(M*M+D*D+L*L),x=lr(L/=V),I=Ge(Ge(L)-1)<he||Ge(o-m)<he?(o+m)/2:Ea(D,M),R=i(I,x),G=R[0],F=R[1],U=G-n,z=F-s,$=C*U-j*z;($*$/k>e||Ge((j*U+C*z)/k-.5)>.3||h*y+l*w+d*S<AM)&&(t(n,s,o,h,l,d,G,F,I,M/=V,D/=V,L,T,N),N.point(G,F),t(G,F,I,M,D,L,f,v,m,y,w,S,T,N))}}return function(n){var s,o,h,l,d,f,v,m,y,w,S,T,N={point:j,lineStart:C,lineEnd:M,polygonStart:function(){n.polygonStart(),N.lineStart=D},polygonEnd:function(){n.polygonEnd(),N.lineStart=C}};function j(x,I){x=i(x,I),n.point(x[0],x[1])}function C(){m=NaN,N.point=k,n.lineStart()}function k(x,I){var R=xa([x,I]),G=i(x,I);t(m,y,v,w,S,T,m=G[0],y=G[1],v=x,w=R[0],S=R[1],T=R[2],xv,n),n.point(m,y)}function M(){N.point=j,n.lineEnd()}function D(){C(),N.point=L,N.lineEnd=V}function L(x,I){k(s=x,I),o=m,h=y,l=w,d=S,f=T,N.point=k}function V(){t(m,y,v,w,S,T,o,h,s,l,d,f,xv,n),N.lineEnd=M,M()}return N}}var FM=Ev({point:function(i,e){this.stream.point(i*ji,e*ji)}});function GM(i){return jM(function(){return i})()}function jM(i){var e,t=150,n=480,s=250,o,h,l=0,d=0,f=0,v=0,m=0,y,w,S=null,T=wv,N=null,j,C,k,M=vv,D=.5,L=bv(G,D),V,x;function I(z){return z=w(z[0]*ji,z[1]*ji),[z[0]*t+o,h-z[1]*t]}function R(z){return z=w.invert((z[0]-o)/t,(h-z[1])/t),z&&[z[0]*ks,z[1]*ks]}function G(z,$){return z=e(z,$),[z[0]*t+o,h-z[1]*t]}I.stream=function(z){return V&&x===z?V:V=FM(T(y,L(M(x=z))))},I.clipAngle=function(z){return arguments.length?(T=+z?NM(S=z*ji,6*ji):(S=null,wv),U()):S*ks},I.clipExtent=function(z){return arguments.length?(M=z==null?(N=j=C=k=null,vv):bM(N=+z[0][0],j=+z[0][1],C=+z[1][0],k=+z[1][1]),U()):N==null?null:[[N,j],[C,k]]},I.scale=function(z){return arguments.length?(t=+z,F()):t},I.translate=function(z){return arguments.length?(n=+z[0],s=+z[1],F()):[n,s]},I.center=function(z){return arguments.length?(l=z[0]%360*ji,d=z[1]%360*ji,F()):[l*ks,d*ks]},I.rotate=function(z){return arguments.length?(f=z[0]%360*ji,v=z[1]%360*ji,m=z.length>2?z[2]%360*ji:0,F()):[f*ks,v*ks,m*ks]},I.precision=function(z){return arguments.length?(L=bv(G,D=z*z),U()):Sa(D)},I.fitExtent=function(z,$){return Sv(I,z,$)},I.fitSize=function(z,$){return RM(I,z,$)};function F(){w=ov(y=_M(f,v,m),e);var z=e(l,d);return o=n-z[0]*t,h=s+z[1]*t,U()}function U(){return V=x=null,I}return function(){return e=i.apply(this,arguments),I.invert=e.invert&&R,F()}}function Pv(i){return function(e,t){var n=me(e),s=me(t),o=i(n*s);return[o*s*ve(e),o*ve(t)]}}function Cv(i){return function(e,t){var n=Sa(e*e+t*t),s=i(n),o=ve(s),h=me(s);return[Ea(e*o,n*h),lr(n&&t*o/n)]}}var BM=Pv(function(i){return Sa(2/(1+i))});BM.invert=Cv(function(i){return 2*lr(i/2)});var Iv=Pv(function(i){return(i=nv(i))&&i/ve(i)});Iv.invert=Cv(function(i){return i});function zM(){return GM(Iv).scale(79.4188).clipAngle(179.999)}function Mv(i,e){return[i,e]}Mv.invert=Mv;var{BufferOp:UM,GeoJSONReader:VM,GeoJSONWriter:qM}=mM;function $M(i,e,t){t=t||{};var n=t.units||"kilometers",s=t.steps||8;if(!i)throw new Error("geojson is required");if(typeof t!="object")throw new Error("options must be an object");if(typeof s!="number")throw new Error("steps must be an number");if(e===void 0)throw new Error("radius is required");if(s<=0)throw new Error("steps must be greater than 0");var o=[];switch(i.type){case"GeometryCollection":return ar(i,function(h){var l=Ul(h,e,n,s);l&&o.push(l)}),ae(o);case"FeatureCollection":return Is(i,function(h){var l=Ul(h,e,n,s);l&&Is(l,function(d){d&&o.push(d)})}),ae(o)}return Ul(i,e,n,s)}function Ul(i,e,t,n){var s=i.properties||{},o=i.type==="Feature"?i.geometry:i;if(o.type==="GeometryCollection"){var h=[];return ar(i,function(T){var N=Ul(T,e,t,n);N&&h.push(N)}),ae(h)}var l=WM(o),d={type:o.type,coordinates:kv(o.coordinates,l)},f=new VM,v=f.read(d),m=ad(od(e,t),"meters"),y=UM.bufferOp(v,m,n),w=new qM;if(y=w.write(y),!Tv(y.coordinates)){var S={type:y.type,coordinates:Ov(y.coordinates,l)};return ni(S,s)}}function Tv(i){return Array.isArray(i[0])?Tv(i[0]):isNaN(i[0])}function kv(i,e){return typeof i[0]!="object"?e(i):i.map(function(t){return kv(t,e)})}function Ov(i,e){return typeof i[0]!="object"?e.invert(i):i.map(function(t){return Ov(t,e)})}function WM(i){var e=Q0(i).geometry.coordinates,t=[-e[0],-e[1]];return zM().rotate(t).scale(Le)}function kd(i,e={}){let t=0,n=0,s=0;return rr(i,function(o){t+=o[0],n+=o[1],s++},!0),Xt([t/s,n/s],e.properties)}var Vl={exports:{}},ql={exports:{}},HM=ql.exports,Nv;function XM(){return Nv||(Nv=1,(function(i,e){(function(t,n){i.exports=n()})(HM,function(){function t(C,k,M,D,L){(function V(x,I,R,G,F){for(;G>R;){if(G-R>600){var U=G-R+1,z=I-R+1,$=Math.log(U),W=.5*Math.exp(2*$/3),X=.5*Math.sqrt($*W*(U-W)/U)*(z-U/2<0?-1:1),Y=Math.max(R,Math.floor(I-z*W/U+X)),et=Math.min(G,Math.floor(I+(U-z)*W/U+X));V(x,I,Y,et,F)}var J=x[I],rt=R,ht=G;for(n(x,R,I),F(x[G],J)>0&&n(x,R,G);rt<ht;){for(n(x,rt,ht),rt++,ht--;F(x[rt],J)<0;)rt++;for(;F(x[ht],J)>0;)ht--}F(x[R],J)===0?n(x,R,ht):n(x,++ht,G),ht<=I&&(R=ht+1),I<=ht&&(G=ht-1)}})(C,k,M||0,D||C.length-1,L||s)}function n(C,k,M){var D=C[k];C[k]=C[M],C[M]=D}function s(C,k){return C<k?-1:C>k?1:0}var o=function(C){C===void 0&&(C=9),this._maxEntries=Math.max(4,C),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function h(C,k,M){if(!M)return k.indexOf(C);for(var D=0;D<k.length;D++)if(M(C,k[D]))return D;return-1}function l(C,k){d(C,0,C.children.length,k,C)}function d(C,k,M,D,L){L||(L=N(null)),L.minX=1/0,L.minY=1/0,L.maxX=-1/0,L.maxY=-1/0;for(var V=k;V<M;V++){var x=C.children[V];f(L,C.leaf?D(x):x)}return L}function f(C,k){return C.minX=Math.min(C.minX,k.minX),C.minY=Math.min(C.minY,k.minY),C.maxX=Math.max(C.maxX,k.maxX),C.maxY=Math.max(C.maxY,k.maxY),C}function v(C,k){return C.minX-k.minX}function m(C,k){return C.minY-k.minY}function y(C){return(C.maxX-C.minX)*(C.maxY-C.minY)}function w(C){return C.maxX-C.minX+(C.maxY-C.minY)}function S(C,k){return C.minX<=k.minX&&C.minY<=k.minY&&k.maxX<=C.maxX&&k.maxY<=C.maxY}function T(C,k){return k.minX<=C.maxX&&k.minY<=C.maxY&&k.maxX>=C.minX&&k.maxY>=C.minY}function N(C){return{children:C,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function j(C,k,M,D,L){for(var V=[k,M];V.length;)if(!((M=V.pop())-(k=V.pop())<=D)){var x=k+Math.ceil((M-k)/D/2)*D;t(C,x,k,M,L),V.push(k,x,x,M)}}return o.prototype.all=function(){return this._all(this.data,[])},o.prototype.search=function(C){var k=this.data,M=[];if(!T(C,k))return M;for(var D=this.toBBox,L=[];k;){for(var V=0;V<k.children.length;V++){var x=k.children[V],I=k.leaf?D(x):x;T(C,I)&&(k.leaf?M.push(x):S(C,I)?this._all(x,M):L.push(x))}k=L.pop()}return M},o.prototype.collides=function(C){var k=this.data;if(!T(C,k))return!1;for(var M=[];k;){for(var D=0;D<k.children.length;D++){var L=k.children[D],V=k.leaf?this.toBBox(L):L;if(T(C,V)){if(k.leaf||S(C,V))return!0;M.push(L)}}k=M.pop()}return!1},o.prototype.load=function(C){if(!C||!C.length)return this;if(C.length<this._minEntries){for(var k=0;k<C.length;k++)this.insert(C[k]);return this}var M=this._build(C.slice(),0,C.length-1,0);if(this.data.children.length)if(this.data.height===M.height)this._splitRoot(this.data,M);else{if(this.data.height<M.height){var D=this.data;this.data=M,M=D}this._insert(M,this.data.height-M.height-1,!0)}else this.data=M;return this},o.prototype.insert=function(C){return C&&this._insert(C,this.data.height-1),this},o.prototype.clear=function(){return this.data=N([]),this},o.prototype.remove=function(C,k){if(!C)return this;for(var M,D,L,V=this.data,x=this.toBBox(C),I=[],R=[];V||I.length;){if(V||(V=I.pop(),D=I[I.length-1],M=R.pop(),L=!0),V.leaf){var G=h(C,V.children,k);if(G!==-1)return V.children.splice(G,1),I.push(V),this._condense(I),this}L||V.leaf||!S(V,x)?D?(M++,V=D.children[M],L=!1):V=null:(I.push(V),R.push(M),M=0,D=V,V=V.children[0])}return this},o.prototype.toBBox=function(C){return C},o.prototype.compareMinX=function(C,k){return C.minX-k.minX},o.prototype.compareMinY=function(C,k){return C.minY-k.minY},o.prototype.toJSON=function(){return this.data},o.prototype.fromJSON=function(C){return this.data=C,this},o.prototype._all=function(C,k){for(var M=[];C;)C.leaf?k.push.apply(k,C.children):M.push.apply(M,C.children),C=M.pop();return k},o.prototype._build=function(C,k,M,D){var L,V=M-k+1,x=this._maxEntries;if(V<=x)return l(L=N(C.slice(k,M+1)),this.toBBox),L;D||(D=Math.ceil(Math.log(V)/Math.log(x)),x=Math.ceil(V/Math.pow(x,D-1))),(L=N([])).leaf=!1,L.height=D;var I=Math.ceil(V/x),R=I*Math.ceil(Math.sqrt(x));j(C,k,M,R,this.compareMinX);for(var G=k;G<=M;G+=R){var F=Math.min(G+R-1,M);j(C,G,F,I,this.compareMinY);for(var U=G;U<=F;U+=I){var z=Math.min(U+I-1,F);L.children.push(this._build(C,U,z,D-1))}}return l(L,this.toBBox),L},o.prototype._chooseSubtree=function(C,k,M,D){for(;D.push(k),!k.leaf&&D.length-1!==M;){for(var L=1/0,V=1/0,x=void 0,I=0;I<k.children.length;I++){var R=k.children[I],G=y(R),F=(U=C,z=R,(Math.max(z.maxX,U.maxX)-Math.min(z.minX,U.minX))*(Math.max(z.maxY,U.maxY)-Math.min(z.minY,U.minY))-G);F<V?(V=F,L=G<L?G:L,x=R):F===V&&G<L&&(L=G,x=R)}k=x||k.children[0]}var U,z;return k},o.prototype._insert=function(C,k,M){var D=M?C:this.toBBox(C),L=[],V=this._chooseSubtree(D,this.data,k,L);for(V.children.push(C),f(V,D);k>=0&&L[k].children.length>this._maxEntries;)this._split(L,k),k--;this._adjustParentBBoxes(D,L,k)},o.prototype._split=function(C,k){var M=C[k],D=M.children.length,L=this._minEntries;this._chooseSplitAxis(M,L,D);var V=this._chooseSplitIndex(M,L,D),x=N(M.children.splice(V,M.children.length-V));x.height=M.height,x.leaf=M.leaf,l(M,this.toBBox),l(x,this.toBBox),k?C[k-1].children.push(x):this._splitRoot(M,x)},o.prototype._splitRoot=function(C,k){this.data=N([C,k]),this.data.height=C.height+1,this.data.leaf=!1,l(this.data,this.toBBox)},o.prototype._chooseSplitIndex=function(C,k,M){for(var D,L,V,x,I,R,G,F=1/0,U=1/0,z=k;z<=M-k;z++){var $=d(C,0,z,this.toBBox),W=d(C,z,M,this.toBBox),X=(L=$,V=W,x=void 0,I=void 0,R=void 0,G=void 0,x=Math.max(L.minX,V.minX),I=Math.max(L.minY,V.minY),R=Math.min(L.maxX,V.maxX),G=Math.min(L.maxY,V.maxY),Math.max(0,R-x)*Math.max(0,G-I)),Y=y($)+y(W);X<F?(F=X,D=z,U=Y<U?Y:U):X===F&&Y<U&&(U=Y,D=z)}return D||M-k},o.prototype._chooseSplitAxis=function(C,k,M){var D=C.leaf?this.compareMinX:v,L=C.leaf?this.compareMinY:m;this._allDistMargin(C,k,M,D)<this._allDistMargin(C,k,M,L)&&C.children.sort(D)},o.prototype._allDistMargin=function(C,k,M,D){C.children.sort(D);for(var L=this.toBBox,V=d(C,0,k,L),x=d(C,M-k,M,L),I=w(V)+w(x),R=k;R<M-k;R++){var G=C.children[R];f(V,C.leaf?L(G):G),I+=w(V)}for(var F=M-k-1;F>=k;F--){var U=C.children[F];f(x,C.leaf?L(U):U),I+=w(x)}return I},o.prototype._adjustParentBBoxes=function(C,k,M){for(var D=M;D>=0;D--)f(k[D],C)},o.prototype._condense=function(C){for(var k=C.length-1,M=void 0;k>=0;k--)C[k].children.length===0?k>0?(M=C[k-1].children).splice(M.indexOf(C[k]),1):this.clear():l(C[k],this.toBBox)},o})})(ql)),ql.exports}class YM{constructor(e=[],t=JM){if(this.data=e,this.length=this.data.length,this.compare=t,this.length>0)for(let n=(this.length>>1)-1;n>=0;n--)this._down(n)}push(e){this.data.push(e),this.length++,this._up(this.length-1)}pop(){if(this.length===0)return;const e=this.data[0],t=this.data.pop();return this.length--,this.length>0&&(this.data[0]=t,this._down(0)),e}peek(){return this.data[0]}_up(e){const{data:t,compare:n}=this,s=t[e];for(;e>0;){const o=e-1>>1,h=t[o];if(n(s,h)>=0)break;t[e]=h,e=o}t[e]=s}_down(e){const{data:t,compare:n}=this,s=this.length>>1,o=t[e];for(;e<s;){let h=(e<<1)+1,l=t[h];const d=h+1;if(d<this.length&&n(t[d],l)<0&&(h=d,l=t[d]),n(l,o)>=0)break;t[e]=l,e=h}t[e]=o}}function JM(i,e){return i<e?-1:i>e?1:0}const KM=Xw(Object.freeze(Object.defineProperty({__proto__:null,default:YM},Symbol.toStringTag,{value:"Module"})));var fh={exports:{}},Od,Rv;function ZM(){return Rv||(Rv=1,Od=function(e,t,n,s){var o=e[0],h=e[1],l=!1;n===void 0&&(n=0),s===void 0&&(s=t.length);for(var d=(s-n)/2,f=0,v=d-1;f<d;v=f++){var m=t[n+f*2+0],y=t[n+f*2+1],w=t[n+v*2+0],S=t[n+v*2+1],T=y>h!=S>h&&o<(w-m)*(h-y)/(S-y)+m;T&&(l=!l)}return l}),Od}var Nd,Av;function QM(){return Av||(Av=1,Nd=function(e,t,n,s){var o=e[0],h=e[1],l=!1;n===void 0&&(n=0),s===void 0&&(s=t.length);for(var d=s-n,f=0,v=d-1;f<d;v=f++){var m=t[f+n][0],y=t[f+n][1],w=t[v+n][0],S=t[v+n][1],T=y>h!=S>h&&o<(w-m)*(h-y)/(S-y)+m;T&&(l=!l)}return l}),Nd}var Dv;function tT(){if(Dv)return fh.exports;Dv=1;var i=ZM(),e=QM();return fh.exports=function(n,s,o,h){return s.length>0&&Array.isArray(s[0])?e(n,s,o,h):i(n,s,o,h)},fh.exports.nested=e,fh.exports.flat=i,fh.exports}var gh={exports:{}},eT=gh.exports,Lv;function iT(){return Lv||(Lv=1,(function(i,e){(function(t,n){n(e)})(eT,function(t){const s=33306690738754706e-32;function o(T,N,j,C,k){let M,D,L,V,x=N[0],I=C[0],R=0,G=0;I>x==I>-x?(M=x,x=N[++R]):(M=I,I=C[++G]);let F=0;if(R<T&&G<j)for(I>x==I>-x?(L=M-((D=x+M)-x),x=N[++R]):(L=M-((D=I+M)-I),I=C[++G]),M=D,L!==0&&(k[F++]=L);R<T&&G<j;)I>x==I>-x?(L=M-((D=M+x)-(V=D-M))+(x-V),x=N[++R]):(L=M-((D=M+I)-(V=D-M))+(I-V),I=C[++G]),M=D,L!==0&&(k[F++]=L);for(;R<T;)L=M-((D=M+x)-(V=D-M))+(x-V),x=N[++R],M=D,L!==0&&(k[F++]=L);for(;G<j;)L=M-((D=M+I)-(V=D-M))+(I-V),I=C[++G],M=D,L!==0&&(k[F++]=L);return M===0&&F!==0||(k[F++]=M),F}function h(T){return new Float64Array(T)}const l=33306690738754716e-32,d=22204460492503146e-32,f=11093356479670487e-47,v=h(4),m=h(8),y=h(12),w=h(16),S=h(4);t.orient2d=function(T,N,j,C,k,M){const D=(N-M)*(j-k),L=(T-k)*(C-M),V=D-L;if(D===0||L===0||D>0!=L>0)return V;const x=Math.abs(D+L);return Math.abs(V)>=l*x?V:-(function(I,R,G,F,U,z,$){let W,X,Y,et,J,rt,ht,Ot,ct,_t,Ct,Lt,K,Qt,zt,gt,A,at;const Pt=I-U,It=G-U,se=R-z,le=F-z;J=(zt=(Ot=Pt-(ht=(rt=134217729*Pt)-(rt-Pt)))*(_t=le-(ct=(rt=134217729*le)-(rt-le)))-((Qt=Pt*le)-ht*ct-Ot*ct-ht*_t))-(Ct=zt-(A=(Ot=se-(ht=(rt=134217729*se)-(rt-se)))*(_t=It-(ct=(rt=134217729*It)-(rt-It)))-((gt=se*It)-ht*ct-Ot*ct-ht*_t))),v[0]=zt-(Ct+J)+(J-A),J=(K=Qt-((Lt=Qt+Ct)-(J=Lt-Qt))+(Ct-J))-(Ct=K-gt),v[1]=K-(Ct+J)+(J-gt),J=(at=Lt+Ct)-Lt,v[2]=Lt-(at-J)+(Ct-J),v[3]=at;let Vn=(function(Fg,Vt){let Ws=Vt[0];for(let Hs=1;Hs<Fg;Hs++)Ws+=Vt[Hs];return Ws})(4,v),ut=d*$;if(Vn>=ut||-Vn>=ut||(W=I-(Pt+(J=I-Pt))+(J-U),Y=G-(It+(J=G-It))+(J-U),X=R-(se+(J=R-se))+(J-z),et=F-(le+(J=F-le))+(J-z),W===0&&X===0&&Y===0&&et===0)||(ut=f*$+s*Math.abs(Vn),(Vn+=Pt*et+le*W-(se*Y+It*X))>=ut||-Vn>=ut))return Vn;J=(zt=(Ot=W-(ht=(rt=134217729*W)-(rt-W)))*(_t=le-(ct=(rt=134217729*le)-(rt-le)))-((Qt=W*le)-ht*ct-Ot*ct-ht*_t))-(Ct=zt-(A=(Ot=X-(ht=(rt=134217729*X)-(rt-X)))*(_t=It-(ct=(rt=134217729*It)-(rt-It)))-((gt=X*It)-ht*ct-Ot*ct-ht*_t))),S[0]=zt-(Ct+J)+(J-A),J=(K=Qt-((Lt=Qt+Ct)-(J=Lt-Qt))+(Ct-J))-(Ct=K-gt),S[1]=K-(Ct+J)+(J-gt),J=(at=Lt+Ct)-Lt,S[2]=Lt-(at-J)+(Ct-J),S[3]=at;const Tu=o(4,v,4,S,m);J=(zt=(Ot=Pt-(ht=(rt=134217729*Pt)-(rt-Pt)))*(_t=et-(ct=(rt=134217729*et)-(rt-et)))-((Qt=Pt*et)-ht*ct-Ot*ct-ht*_t))-(Ct=zt-(A=(Ot=se-(ht=(rt=134217729*se)-(rt-se)))*(_t=Y-(ct=(rt=134217729*Y)-(rt-Y)))-((gt=se*Y)-ht*ct-Ot*ct-ht*_t))),S[0]=zt-(Ct+J)+(J-A),J=(K=Qt-((Lt=Qt+Ct)-(J=Lt-Qt))+(Ct-J))-(Ct=K-gt),S[1]=K-(Ct+J)+(J-gt),J=(at=Lt+Ct)-Lt,S[2]=Lt-(at-J)+(Ct-J),S[3]=at;const ku=o(Tu,m,4,S,y);J=(zt=(Ot=W-(ht=(rt=134217729*W)-(rt-W)))*(_t=et-(ct=(rt=134217729*et)-(rt-et)))-((Qt=W*et)-ht*ct-Ot*ct-ht*_t))-(Ct=zt-(A=(Ot=X-(ht=(rt=134217729*X)-(rt-X)))*(_t=Y-(ct=(rt=134217729*Y)-(rt-Y)))-((gt=X*Y)-ht*ct-Ot*ct-ht*_t))),S[0]=zt-(Ct+J)+(J-A),J=(K=Qt-((Lt=Qt+Ct)-(J=Lt-Qt))+(Ct-J))-(Ct=K-gt),S[1]=K-(Ct+J)+(J-gt),J=(at=Lt+Ct)-Lt,S[2]=Lt-(at-J)+(Ct-J),S[3]=at;const ds=o(ku,y,4,S,w);return w[ds-1]})(T,N,j,C,k,M,x)},t.orient2dfast=function(T,N,j,C,k,M){return(N-M)*(j-k)-(T-k)*(C-M)},Object.defineProperty(t,"__esModule",{value:!0})})})(gh,gh.exports)),gh.exports}var Fv;function nT(){if(Fv)return Vl.exports;Fv=1;var i=XM(),e=KM,t=tT(),n=iT().orient2d;e.default&&(e=e.default),Vl.exports=s,Vl.exports.default=s;function s(M,D,L){D=Math.max(0,D===void 0?2:D),L=L||0;var V=w(M),x=new i(16);x.toBBox=function(ht){return{minX:ht[0],minY:ht[1],maxX:ht[0],maxY:ht[1]}},x.compareMinX=function(ht,Ot){return ht[0]-Ot[0]},x.compareMinY=function(ht,Ot){return ht[1]-Ot[1]},x.load(M);for(var I=[],R=0,G;R<V.length;R++){var F=V[R];x.remove(F),G=S(F,G),I.push(G)}var U=new i(16);for(R=0;R<I.length;R++)U.insert(y(I[R]));for(var z=D*D,$=L*L;I.length;){var W=I.shift(),X=W.p,Y=W.next.p,et=T(X,Y);if(!(et<$)){var J=et/z;F=o(x,W.prev.p,X,Y,W.next.next.p,J,U),F&&Math.min(T(F,X),T(F,Y))<=J&&(I.push(W),I.push(S(F,W)),x.remove(F),U.remove(W),U.insert(y(W)),U.insert(y(W.next)))}}W=G;var rt=[];do rt.push(W.p),W=W.next;while(W!==G);return rt.push(W.p),rt}function o(M,D,L,V,x,I,R){for(var G=new e([],h),F=M.data;F;){for(var U=0;U<F.children.length;U++){var z=F.children[U],$=F.leaf?N(z,L,V):l(L,V,z);$>I||G.push({node:z,dist:$})}for(;G.length&&!G.peek().node.children;){var W=G.pop(),X=W.node,Y=N(X,D,L),et=N(X,V,x);if(W.dist<Y&&W.dist<et&&f(L,X,R)&&f(V,X,R))return X}F=G.pop(),F&&(F=F.node)}return null}function h(M,D){return M.dist-D.dist}function l(M,D,L){if(d(M,L)||d(D,L))return 0;var V=j(M[0],M[1],D[0],D[1],L.minX,L.minY,L.maxX,L.minY);if(V===0)return 0;var x=j(M[0],M[1],D[0],D[1],L.minX,L.minY,L.minX,L.maxY);if(x===0)return 0;var I=j(M[0],M[1],D[0],D[1],L.maxX,L.minY,L.maxX,L.maxY);if(I===0)return 0;var R=j(M[0],M[1],D[0],D[1],L.minX,L.maxY,L.maxX,L.maxY);return R===0?0:Math.min(V,x,I,R)}function d(M,D){return M[0]>=D.minX&&M[0]<=D.maxX&&M[1]>=D.minY&&M[1]<=D.maxY}function f(M,D,L){for(var V=Math.min(M[0],D[0]),x=Math.min(M[1],D[1]),I=Math.max(M[0],D[0]),R=Math.max(M[1],D[1]),G=L.search({minX:V,minY:x,maxX:I,maxY:R}),F=0;F<G.length;F++)if(m(G[F].p,G[F].next.p,M,D))return!1;return!0}function v(M,D,L){return n(M[0],M[1],D[0],D[1],L[0],L[1])}function m(M,D,L,V){return M!==V&&D!==L&&v(M,D,L)>0!=v(M,D,V)>0&&v(L,V,M)>0!=v(L,V,D)>0}function y(M){var D=M.p,L=M.next.p;return M.minX=Math.min(D[0],L[0]),M.minY=Math.min(D[1],L[1]),M.maxX=Math.max(D[0],L[0]),M.maxY=Math.max(D[1],L[1]),M}function w(M){for(var D=M[0],L=M[0],V=M[0],x=M[0],I=0;I<M.length;I++){var R=M[I];R[0]<D[0]&&(D=R),R[0]>V[0]&&(V=R),R[1]<L[1]&&(L=R),R[1]>x[1]&&(x=R)}var G=[D,L,V,x],F=G.slice();for(I=0;I<M.length;I++)t(M[I],G)||F.push(M[I]);return k(F)}function S(M,D){var L={p:M,prev:null,next:null,minX:0,minY:0,maxX:0,maxY:0};return D?(L.next=D.next,L.prev=D,D.next.prev=L,D.next=L):(L.prev=L,L.next=L),L}function T(M,D){var L=M[0]-D[0],V=M[1]-D[1];return L*L+V*V}function N(M,D,L){var V=D[0],x=D[1],I=L[0]-V,R=L[1]-x;if(I!==0||R!==0){var G=((M[0]-V)*I+(M[1]-x)*R)/(I*I+R*R);G>1?(V=L[0],x=L[1]):G>0&&(V+=I*G,x+=R*G)}return I=M[0]-V,R=M[1]-x,I*I+R*R}function j(M,D,L,V,x,I,R,G){var F=L-M,U=V-D,z=R-x,$=G-I,W=M-x,X=D-I,Y=F*F+U*U,et=F*z+U*$,J=z*z+$*$,rt=F*W+U*X,ht=z*W+$*X,Ot=Y*J-et*et,ct,_t,Ct,Lt,K=Ot,Qt=Ot;Ot===0?(_t=0,K=1,Lt=ht,Qt=J):(_t=et*ht-J*rt,Lt=Y*ht-et*rt,_t<0?(_t=0,Lt=ht,Qt=J):_t>K&&(_t=K,Lt=ht+et,Qt=J)),Lt<0?(Lt=0,-rt<0?_t=0:-rt>Y?_t=K:(_t=-rt,K=Y)):Lt>Qt&&(Lt=Qt,-rt+et<0?_t=0:-rt+et>Y?_t=K:(_t=-rt+et,K=Y)),ct=_t===0?0:_t/K,Ct=Lt===0?0:Lt/Qt;var zt=(1-ct)*M+ct*L,gt=(1-ct)*D+ct*V,A=(1-Ct)*x+Ct*R,at=(1-Ct)*I+Ct*G,Pt=A-zt,It=at-gt;return Pt*Pt+It*It}function C(M,D){return M[0]===D[0]?M[1]-D[1]:M[0]-D[0]}function k(M){M.sort(C);for(var D=[],L=0;L<M.length;L++){for(;D.length>=2&&v(D[D.length-2],D[D.length-1],M[L])<=0;)D.pop();D.push(M[L])}for(var V=[],x=M.length-1;x>=0;x--){for(;V.length>=2&&v(V[V.length-2],V[V.length-1],M[x])<=0;)V.pop();V.push(M[x])}return V.pop(),D.pop(),D.concat(V)}return Vl.exports}var sT=nT();const rT=Pc(sT);function aT(i,e={}){e.concavity=e.concavity||1/0;const t=[];if(rr(i,s=>{t.push([s[0],s[1]])}),!t.length)return null;const n=rT(t,e.concavity);return n.length>3?de([n]):null}function Gv(i,e={}){switch(ld(i)){case"Point":return Xt(Ie(i),e.properties);case"Polygon":var t=[];rr(i,function(M){t.push(M)});var n=kd(i,{properties:e.properties}),s=n.geometry.coordinates,o=0,h=0,l=0,d,f,v,m,y,w,S,T,N=t.map(function(M){return[M[0]-s[0],M[1]-s[1]]});for(d=0;d<t.length-1;d++)f=N[d],m=f[0],w=f[1],v=N[d+1],y=v[0],S=v[1],T=m*S-y*w,l+=T,o+=(m+y)*T,h+=(w+S)*T;if(l===0)return n;var j=l*.5,C=1/(6*j);return Xt([s[0]+C*o,s[1]+C*h],e.properties);default:var k=aT(i);return k?Gv(k,{properties:e.properties}):kd(i,{properties:e.properties})}}function oT(i,e,t={}){const n=t.steps||64,s=t.properties?t.properties:!Array.isArray(i)&&i.type==="Feature"&&i.properties?i.properties:{},o=[];for(let h=0;h<n;h++)o.push(xn(i,e,h*-360/n,t).geometry.coordinates);return o.push(o[0]),de([o],s)}function hT(i){if(!i)throw new Error("geojson is required");switch(i.type){case"Feature":return jv(i);case"FeatureCollection":return lT(i);case"Point":case"LineString":case"Polygon":case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"GeometryCollection":return Rd(i);default:throw new Error("unknown GeoJSON type")}}function jv(i){const e={type:"Feature"};return Object.keys(i).forEach(t=>{switch(t){case"type":case"properties":case"geometry":return;default:e[t]=i[t]}}),e.properties=Bv(i.properties),i.geometry==null?e.geometry=null:e.geometry=Rd(i.geometry),e}function Bv(i){const e={};return i&&Object.keys(i).forEach(t=>{const n=i[t];typeof n=="object"?n===null?e[t]=null:Array.isArray(n)?e[t]=n.map(s=>s):e[t]=Bv(n):e[t]=n}),e}function lT(i){const e={type:"FeatureCollection"};return Object.keys(i).forEach(t=>{switch(t){case"type":case"features":return;default:e[t]=i[t]}}),e.features=i.features.map(t=>jv(t)),e}function Rd(i){const e={type:i.type};return i.bbox&&(e.bbox=i.bbox),i.type==="GeometryCollection"?(e.geometries=i.geometries.map(t=>Rd(t)),e):(e.coordinates=zv(i.coordinates),e)}function zv(i){const e=i;return typeof e[0]!="object"?e.slice():e.map(t=>zv(t))}var uT=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,Ad=Math.ceil,Bi=Math.floor,mi="[BigNumber Error] ",Uv=mi+"Number primitive has more than 15 significant digits: ",rn=1e14,qt=14,Dd=9007199254740991,Ld=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],Os=1e7,je=1e9;function Vv(i){var e,t,n,s=C.prototype={constructor:C,toString:null,valueOf:null},o=new C(1),h=20,l=4,d=-7,f=21,v=-1e7,m=1e7,y=!1,w=1,S=0,T={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},N="0123456789abcdefghijklmnopqrstuvwxyz",j=!0;function C(x,I){var R,G,F,U,z,$,W,X,Y=this;if(!(Y instanceof C))return new C(x,I);if(I==null){if(x&&x._isBigNumber===!0){Y.s=x.s,!x.c||x.e>m?Y.c=Y.e=null:x.e<v?Y.c=[Y.e=0]:(Y.e=x.e,Y.c=x.c.slice());return}if(($=typeof x=="number")&&x*0==0){if(Y.s=1/x<0?(x=-x,-1):1,x===~~x){for(U=0,z=x;z>=10;z/=10,U++);U>m?Y.c=Y.e=null:(Y.e=U,Y.c=[x]);return}X=String(x)}else{if(!uT.test(X=String(x)))return n(Y,X,$);Y.s=X.charCodeAt(0)==45?(X=X.slice(1),-1):1}(U=X.indexOf("."))>-1&&(X=X.replace(".","")),(z=X.search(/e/i))>0?(U<0&&(U=z),U+=+X.slice(z+1),X=X.substring(0,z)):U<0&&(U=X.length)}else{if(ye(I,2,N.length,"Base"),I==10&&j)return Y=new C(x),L(Y,h+Y.e+1,l);if(X=String(x),$=typeof x=="number"){if(x*0!=0)return n(Y,X,$,I);if(Y.s=1/x<0?(X=X.slice(1),-1):1,C.DEBUG&&X.replace(/^0\.0*|\./,"").length>15)throw Error(Uv+x)}else Y.s=X.charCodeAt(0)===45?(X=X.slice(1),-1):1;for(R=N.slice(0,I),U=z=0,W=X.length;z<W;z++)if(R.indexOf(G=X.charAt(z))<0){if(G=="."){if(z>U){U=W;continue}}else if(!F&&(X==X.toUpperCase()&&(X=X.toLowerCase())||X==X.toLowerCase()&&(X=X.toUpperCase()))){F=!0,z=-1,U=0;continue}return n(Y,String(x),$,I)}$=!1,X=t(X,I,10,Y.s),(U=X.indexOf("."))>-1?X=X.replace(".",""):U=X.length}for(z=0;X.charCodeAt(z)===48;z++);for(W=X.length;X.charCodeAt(--W)===48;);if(X=X.slice(z,++W)){if(W-=z,$&&C.DEBUG&&W>15&&(x>Dd||x!==Bi(x)))throw Error(Uv+Y.s*x);if((U=U-z-1)>m)Y.c=Y.e=null;else if(U<v)Y.c=[Y.e=0];else{if(Y.e=U,Y.c=[],z=(U+1)%qt,U<0&&(z+=qt),z<W){for(z&&Y.c.push(+X.slice(0,z)),W-=qt;z<W;)Y.c.push(+X.slice(z,z+=qt));z=qt-(X=X.slice(z)).length}else z-=W;for(;z--;X+="0");Y.c.push(+X)}}else Y.c=[Y.e=0]}C.clone=Vv,C.ROUND_UP=0,C.ROUND_DOWN=1,C.ROUND_CEIL=2,C.ROUND_FLOOR=3,C.ROUND_HALF_UP=4,C.ROUND_HALF_DOWN=5,C.ROUND_HALF_EVEN=6,C.ROUND_HALF_CEIL=7,C.ROUND_HALF_FLOOR=8,C.EUCLID=9,C.config=C.set=function(x){var I,R;if(x!=null)if(typeof x=="object"){if(x.hasOwnProperty(I="DECIMAL_PLACES")&&(R=x[I],ye(R,0,je,I),h=R),x.hasOwnProperty(I="ROUNDING_MODE")&&(R=x[I],ye(R,0,8,I),l=R),x.hasOwnProperty(I="EXPONENTIAL_AT")&&(R=x[I],R&&R.pop?(ye(R[0],-je,0,I),ye(R[1],0,je,I),d=R[0],f=R[1]):(ye(R,-je,je,I),d=-(f=R<0?-R:R))),x.hasOwnProperty(I="RANGE"))if(R=x[I],R&&R.pop)ye(R[0],-je,-1,I),ye(R[1],1,je,I),v=R[0],m=R[1];else if(ye(R,-je,je,I),R)v=-(m=R<0?-R:R);else throw Error(mi+I+" cannot be zero: "+R);if(x.hasOwnProperty(I="CRYPTO"))if(R=x[I],R===!!R)if(R)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))y=R;else throw y=!R,Error(mi+"crypto unavailable");else y=R;else throw Error(mi+I+" not true or false: "+R);if(x.hasOwnProperty(I="MODULO_MODE")&&(R=x[I],ye(R,0,9,I),w=R),x.hasOwnProperty(I="POW_PRECISION")&&(R=x[I],ye(R,0,je,I),S=R),x.hasOwnProperty(I="FORMAT"))if(R=x[I],typeof R=="object")T=R;else throw Error(mi+I+" not an object: "+R);if(x.hasOwnProperty(I="ALPHABET"))if(R=x[I],typeof R=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(R))j=R.slice(0,10)=="0123456789",N=R;else throw Error(mi+I+" invalid: "+R)}else throw Error(mi+"Object expected: "+x);return{DECIMAL_PLACES:h,ROUNDING_MODE:l,EXPONENTIAL_AT:[d,f],RANGE:[v,m],CRYPTO:y,MODULO_MODE:w,POW_PRECISION:S,FORMAT:T,ALPHABET:N}},C.isBigNumber=function(x){if(!x||x._isBigNumber!==!0)return!1;if(!C.DEBUG)return!0;var I,R,G=x.c,F=x.e,U=x.s;t:if({}.toString.call(G)=="[object Array]"){if((U===1||U===-1)&&F>=-je&&F<=je&&F===Bi(F)){if(G[0]===0){if(F===0&&G.length===1)return!0;break t}if(I=(F+1)%qt,I<1&&(I+=qt),String(G[0]).length==I){for(I=0;I<G.length;I++)if(R=G[I],R<0||R>=rn||R!==Bi(R))break t;if(R!==0)return!0}}}else if(G===null&&F===null&&(U===null||U===1||U===-1))return!0;throw Error(mi+"Invalid BigNumber: "+x)},C.maximum=C.max=function(){return M(arguments,-1)},C.minimum=C.min=function(){return M(arguments,1)},C.random=(function(){var x=9007199254740992,I=Math.random()*x&2097151?function(){return Bi(Math.random()*x)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(R){var G,F,U,z,$,W=0,X=[],Y=new C(o);if(R==null?R=h:ye(R,0,je),z=Ad(R/qt),y)if(crypto.getRandomValues){for(G=crypto.getRandomValues(new Uint32Array(z*=2));W<z;)$=G[W]*131072+(G[W+1]>>>11),$>=9e15?(F=crypto.getRandomValues(new Uint32Array(2)),G[W]=F[0],G[W+1]=F[1]):(X.push($%1e14),W+=2);W=z/2}else if(crypto.randomBytes){for(G=crypto.randomBytes(z*=7);W<z;)$=(G[W]&31)*281474976710656+G[W+1]*1099511627776+G[W+2]*4294967296+G[W+3]*16777216+(G[W+4]<<16)+(G[W+5]<<8)+G[W+6],$>=9e15?crypto.randomBytes(7).copy(G,W):(X.push($%1e14),W+=7);W=z/7}else throw y=!1,Error(mi+"crypto unavailable");if(!y)for(;W<z;)$=I(),$<9e15&&(X[W++]=$%1e14);for(z=X[--W],R%=qt,z&&R&&($=Ld[qt-R],X[W]=Bi(z/$)*$);X[W]===0;X.pop(),W--);if(W<0)X=[U=0];else{for(U=-1;X[0]===0;X.splice(0,1),U-=qt);for(W=1,$=X[0];$>=10;$/=10,W++);W<qt&&(U-=qt-W)}return Y.e=U,Y.c=X,Y}})(),C.sum=function(){for(var x=1,I=arguments,R=new C(I[0]);x<I.length;)R=R.plus(I[x++]);return R},t=(function(){var x="0123456789";function I(R,G,F,U){for(var z,$=[0],W,X=0,Y=R.length;X<Y;){for(W=$.length;W--;$[W]*=G);for($[0]+=U.indexOf(R.charAt(X++)),z=0;z<$.length;z++)$[z]>F-1&&($[z+1]==null&&($[z+1]=0),$[z+1]+=$[z]/F|0,$[z]%=F)}return $.reverse()}return function(R,G,F,U,z){var $,W,X,Y,et,J,rt,ht,Ot=R.indexOf("."),ct=h,_t=l;for(Ot>=0&&(Y=S,S=0,R=R.replace(".",""),ht=new C(G),J=ht.pow(R.length-Ot),S=Y,ht.c=I(ts(Ui(J.c),J.e,"0"),10,F,x),ht.e=ht.c.length),rt=I(R,G,F,z?($=N,x):($=x,N)),X=Y=rt.length;rt[--Y]==0;rt.pop());if(!rt[0])return $.charAt(0);if(Ot<0?--X:(J.c=rt,J.e=X,J.s=U,J=e(J,ht,ct,_t,F),rt=J.c,et=J.r,X=J.e),W=X+ct+1,Ot=rt[W],Y=F/2,et=et||W<0||rt[W+1]!=null,et=_t<4?(Ot!=null||et)&&(_t==0||_t==(J.s<0?3:2)):Ot>Y||Ot==Y&&(_t==4||et||_t==6&&rt[W-1]&1||_t==(J.s<0?8:7)),W<1||!rt[0])R=et?ts($.charAt(1),-ct,$.charAt(0)):$.charAt(0);else{if(rt.length=W,et)for(--F;++rt[--W]>F;)rt[W]=0,W||(++X,rt=[1].concat(rt));for(Y=rt.length;!rt[--Y];);for(Ot=0,R="";Ot<=Y;R+=$.charAt(rt[Ot++]));R=ts(R,X,$.charAt(0))}return R}})(),e=(function(){function x(G,F,U){var z,$,W,X,Y=0,et=G.length,J=F%Os,rt=F/Os|0;for(G=G.slice();et--;)W=G[et]%Os,X=G[et]/Os|0,z=rt*W+X*J,$=J*W+z%Os*Os+Y,Y=($/U|0)+(z/Os|0)+rt*X,G[et]=$%U;return Y&&(G=[Y].concat(G)),G}function I(G,F,U,z){var $,W;if(U!=z)W=U>z?1:-1;else for($=W=0;$<U;$++)if(G[$]!=F[$]){W=G[$]>F[$]?1:-1;break}return W}function R(G,F,U,z){for(var $=0;U--;)G[U]-=$,$=G[U]<F[U]?1:0,G[U]=$*z+G[U]-F[U];for(;!G[0]&&G.length>1;G.splice(0,1));}return function(G,F,U,z,$){var W,X,Y,et,J,rt,ht,Ot,ct,_t,Ct,Lt,K,Qt,zt,gt,A,at=G.s==F.s?1:-1,Pt=G.c,It=F.c;if(!Pt||!Pt[0]||!It||!It[0])return new C(!G.s||!F.s||(Pt?It&&Pt[0]==It[0]:!It)?NaN:Pt&&Pt[0]==0||!It?at*0:at/0);for(Ot=new C(at),ct=Ot.c=[],X=G.e-F.e,at=U+X+1,$||($=rn,X=zi(G.e/qt)-zi(F.e/qt),at=at/qt|0),Y=0;It[Y]==(Pt[Y]||0);Y++);if(It[Y]>(Pt[Y]||0)&&X--,at<0)ct.push(1),et=!0;else{for(Qt=Pt.length,gt=It.length,Y=0,at+=2,J=Bi($/(It[0]+1)),J>1&&(It=x(It,J,$),Pt=x(Pt,J,$),gt=It.length,Qt=Pt.length),K=gt,_t=Pt.slice(0,gt),Ct=_t.length;Ct<gt;_t[Ct++]=0);A=It.slice(),A=[0].concat(A),zt=It[0],It[1]>=$/2&&zt++;do{if(J=0,W=I(It,_t,gt,Ct),W<0){if(Lt=_t[0],gt!=Ct&&(Lt=Lt*$+(_t[1]||0)),J=Bi(Lt/zt),J>1)for(J>=$&&(J=$-1),rt=x(It,J,$),ht=rt.length,Ct=_t.length;I(rt,_t,ht,Ct)==1;)J--,R(rt,gt<ht?A:It,ht,$),ht=rt.length,W=1;else J==0&&(W=J=1),rt=It.slice(),ht=rt.length;if(ht<Ct&&(rt=[0].concat(rt)),R(_t,rt,Ct,$),Ct=_t.length,W==-1)for(;I(It,_t,gt,Ct)<1;)J++,R(_t,gt<Ct?A:It,Ct,$),Ct=_t.length}else W===0&&(J++,_t=[0]);ct[Y++]=J,_t[0]?_t[Ct++]=Pt[K]||0:(_t=[Pt[K]],Ct=1)}while((K++<Qt||_t[0]!=null)&&at--);et=_t[0]!=null,ct[0]||ct.splice(0,1)}if($==rn){for(Y=1,at=ct[0];at>=10;at/=10,Y++);L(Ot,U+(Ot.e=Y+X*qt-1)+1,z,et)}else Ot.e=X,Ot.r=+et;return Ot}})();function k(x,I,R,G){var F,U,z,$,W;if(R==null?R=l:ye(R,0,8),!x.c)return x.toString();if(F=x.c[0],z=x.e,I==null)W=Ui(x.c),W=G==1||G==2&&(z<=d||z>=f)?Wl(W,z):ts(W,z,"0");else if(x=L(new C(x),I,R),U=x.e,W=Ui(x.c),$=W.length,G==1||G==2&&(I<=U||U<=d)){for(;$<I;W+="0",$++);W=Wl(W,U)}else if(I-=z+(G===2&&U>z),W=ts(W,U,"0"),U+1>$){if(--I>0)for(W+=".";I--;W+="0");}else if(I+=U-$,I>0)for(U+1==$&&(W+=".");I--;W+="0");return x.s<0&&F?"-"+W:W}function M(x,I){for(var R,G,F=1,U=new C(x[0]);F<x.length;F++)G=new C(x[F]),(!G.s||(R=ur(U,G))===I||R===0&&U.s===I)&&(U=G);return U}function D(x,I,R){for(var G=1,F=I.length;!I[--F];I.pop());for(F=I[0];F>=10;F/=10,G++);return(R=G+R*qt-1)>m?x.c=x.e=null:R<v?x.c=[x.e=0]:(x.e=R,x.c=I),x}n=(function(){var x=/^(-?)0([xbo])(?=\w[\w.]*$)/i,I=/^([^.]+)\.$/,R=/^\.([^.]+)$/,G=/^-?(Infinity|NaN)$/,F=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(U,z,$,W){var X,Y=$?z:z.replace(F,"");if(G.test(Y))U.s=isNaN(Y)?null:Y<0?-1:1;else{if(!$&&(Y=Y.replace(x,function(et,J,rt){return X=(rt=rt.toLowerCase())=="x"?16:rt=="b"?2:8,!W||W==X?J:et}),W&&(X=W,Y=Y.replace(I,"$1").replace(R,"0.$1")),z!=Y))return new C(Y,X);if(C.DEBUG)throw Error(mi+"Not a"+(W?" base "+W:"")+" number: "+z);U.s=null}U.c=U.e=null}})();function L(x,I,R,G){var F,U,z,$,W,X,Y,et=x.c,J=Ld;if(et){t:{for(F=1,$=et[0];$>=10;$/=10,F++);if(U=I-F,U<0)U+=qt,z=I,W=et[X=0],Y=Bi(W/J[F-z-1]%10);else if(X=Ad((U+1)/qt),X>=et.length)if(G){for(;et.length<=X;et.push(0));W=Y=0,F=1,U%=qt,z=U-qt+1}else break t;else{for(W=$=et[X],F=1;$>=10;$/=10,F++);U%=qt,z=U-qt+F,Y=z<0?0:Bi(W/J[F-z-1]%10)}if(G=G||I<0||et[X+1]!=null||(z<0?W:W%J[F-z-1]),G=R<4?(Y||G)&&(R==0||R==(x.s<0?3:2)):Y>5||Y==5&&(R==4||G||R==6&&(U>0?z>0?W/J[F-z]:0:et[X-1])%10&1||R==(x.s<0?8:7)),I<1||!et[0])return et.length=0,G?(I-=x.e+1,et[0]=J[(qt-I%qt)%qt],x.e=-I||0):et[0]=x.e=0,x;if(U==0?(et.length=X,$=1,X--):(et.length=X+1,$=J[qt-U],et[X]=z>0?Bi(W/J[F-z]%J[z])*$:0),G)for(;;)if(X==0){for(U=1,z=et[0];z>=10;z/=10,U++);for(z=et[0]+=$,$=1;z>=10;z/=10,$++);U!=$&&(x.e++,et[0]==rn&&(et[0]=1));break}else{if(et[X]+=$,et[X]!=rn)break;et[X--]=0,$=1}for(U=et.length;et[--U]===0;et.pop());}x.e>m?x.c=x.e=null:x.e<v&&(x.c=[x.e=0])}return x}function V(x){var I,R=x.e;return R===null?x.toString():(I=Ui(x.c),I=R<=d||R>=f?Wl(I,R):ts(I,R,"0"),x.s<0?"-"+I:I)}return s.absoluteValue=s.abs=function(){var x=new C(this);return x.s<0&&(x.s=1),x},s.comparedTo=function(x,I){return ur(this,new C(x,I))},s.decimalPlaces=s.dp=function(x,I){var R,G,F,U=this;if(x!=null)return ye(x,0,je),I==null?I=l:ye(I,0,8),L(new C(U),x+U.e+1,I);if(!(R=U.c))return null;if(G=((F=R.length-1)-zi(this.e/qt))*qt,F=R[F])for(;F%10==0;F/=10,G--);return G<0&&(G=0),G},s.dividedBy=s.div=function(x,I){return e(this,new C(x,I),h,l)},s.dividedToIntegerBy=s.idiv=function(x,I){return e(this,new C(x,I),0,1)},s.exponentiatedBy=s.pow=function(x,I){var R,G,F,U,z,$,W,X,Y,et=this;if(x=new C(x),x.c&&!x.isInteger())throw Error(mi+"Exponent not an integer: "+V(x));if(I!=null&&(I=new C(I)),$=x.e>14,!et.c||!et.c[0]||et.c[0]==1&&!et.e&&et.c.length==1||!x.c||!x.c[0])return Y=new C(Math.pow(+V(et),$?x.s*(2-$l(x)):+V(x))),I?Y.mod(I):Y;if(W=x.s<0,I){if(I.c?!I.c[0]:!I.s)return new C(NaN);G=!W&&et.isInteger()&&I.isInteger(),G&&(et=et.mod(I))}else{if(x.e>9&&(et.e>0||et.e<-1||(et.e==0?et.c[0]>1||$&&et.c[1]>=24e7:et.c[0]<8e13||$&&et.c[0]<=9999975e7)))return U=et.s<0&&$l(x)?-0:0,et.e>-1&&(U=1/U),new C(W?1/U:U);S&&(U=Ad(S/qt+2))}for($?(R=new C(.5),W&&(x.s=1),X=$l(x)):(F=Math.abs(+V(x)),X=F%2),Y=new C(o);;){if(X){if(Y=Y.times(et),!Y.c)break;U?Y.c.length>U&&(Y.c.length=U):G&&(Y=Y.mod(I))}if(F){if(F=Bi(F/2),F===0)break;X=F%2}else if(x=x.times(R),L(x,x.e+1,1),x.e>14)X=$l(x);else{if(F=+V(x),F===0)break;X=F%2}et=et.times(et),U?et.c&&et.c.length>U&&(et.c.length=U):G&&(et=et.mod(I))}return G?Y:(W&&(Y=o.div(Y)),I?Y.mod(I):U?L(Y,S,l,z):Y)},s.integerValue=function(x){var I=new C(this);return x==null?x=l:ye(x,0,8),L(I,I.e+1,x)},s.isEqualTo=s.eq=function(x,I){return ur(this,new C(x,I))===0},s.isFinite=function(){return!!this.c},s.isGreaterThan=s.gt=function(x,I){return ur(this,new C(x,I))>0},s.isGreaterThanOrEqualTo=s.gte=function(x,I){return(I=ur(this,new C(x,I)))===1||I===0},s.isInteger=function(){return!!this.c&&zi(this.e/qt)>this.c.length-2},s.isLessThan=s.lt=function(x,I){return ur(this,new C(x,I))<0},s.isLessThanOrEqualTo=s.lte=function(x,I){return(I=ur(this,new C(x,I)))===-1||I===0},s.isNaN=function(){return!this.s},s.isNegative=function(){return this.s<0},s.isPositive=function(){return this.s>0},s.isZero=function(){return!!this.c&&this.c[0]==0},s.minus=function(x,I){var R,G,F,U,z=this,$=z.s;if(x=new C(x,I),I=x.s,!$||!I)return new C(NaN);if($!=I)return x.s=-I,z.plus(x);var W=z.e/qt,X=x.e/qt,Y=z.c,et=x.c;if(!W||!X){if(!Y||!et)return Y?(x.s=-I,x):new C(et?z:NaN);if(!Y[0]||!et[0])return et[0]?(x.s=-I,x):new C(Y[0]?z:l==3?-0:0)}if(W=zi(W),X=zi(X),Y=Y.slice(),$=W-X){for((U=$<0)?($=-$,F=Y):(X=W,F=et),F.reverse(),I=$;I--;F.push(0));F.reverse()}else for(G=(U=($=Y.length)<(I=et.length))?$:I,$=I=0;I<G;I++)if(Y[I]!=et[I]){U=Y[I]<et[I];break}if(U&&(F=Y,Y=et,et=F,x.s=-x.s),I=(G=et.length)-(R=Y.length),I>0)for(;I--;Y[R++]=0);for(I=rn-1;G>$;){if(Y[--G]<et[G]){for(R=G;R&&!Y[--R];Y[R]=I);--Y[R],Y[G]+=rn}Y[G]-=et[G]}for(;Y[0]==0;Y.splice(0,1),--X);return Y[0]?D(x,Y,X):(x.s=l==3?-1:1,x.c=[x.e=0],x)},s.modulo=s.mod=function(x,I){var R,G,F=this;return x=new C(x,I),!F.c||!x.s||x.c&&!x.c[0]?new C(NaN):!x.c||F.c&&!F.c[0]?new C(F):(w==9?(G=x.s,x.s=1,R=e(F,x,0,3),x.s=G,R.s*=G):R=e(F,x,0,w),x=F.minus(R.times(x)),!x.c[0]&&w==1&&(x.s=F.s),x)},s.multipliedBy=s.times=function(x,I){var R,G,F,U,z,$,W,X,Y,et,J,rt,ht,Ot,ct,_t=this,Ct=_t.c,Lt=(x=new C(x,I)).c;if(!Ct||!Lt||!Ct[0]||!Lt[0])return!_t.s||!x.s||Ct&&!Ct[0]&&!Lt||Lt&&!Lt[0]&&!Ct?x.c=x.e=x.s=null:(x.s*=_t.s,!Ct||!Lt?x.c=x.e=null:(x.c=[0],x.e=0)),x;for(G=zi(_t.e/qt)+zi(x.e/qt),x.s*=_t.s,W=Ct.length,et=Lt.length,W<et&&(ht=Ct,Ct=Lt,Lt=ht,F=W,W=et,et=F),F=W+et,ht=[];F--;ht.push(0));for(Ot=rn,ct=Os,F=et;--F>=0;){for(R=0,J=Lt[F]%ct,rt=Lt[F]/ct|0,z=W,U=F+z;U>F;)X=Ct[--z]%ct,Y=Ct[z]/ct|0,$=rt*X+Y*J,X=J*X+$%ct*ct+ht[U]+R,R=(X/Ot|0)+($/ct|0)+rt*Y,ht[U--]=X%Ot;ht[U]=R}return R?++G:ht.splice(0,1),D(x,ht,G)},s.negated=function(){var x=new C(this);return x.s=-x.s||null,x},s.plus=function(x,I){var R,G=this,F=G.s;if(x=new C(x,I),I=x.s,!F||!I)return new C(NaN);if(F!=I)return x.s=-I,G.minus(x);var U=G.e/qt,z=x.e/qt,$=G.c,W=x.c;if(!U||!z){if(!$||!W)return new C(F/0);if(!$[0]||!W[0])return W[0]?x:new C($[0]?G:F*0)}if(U=zi(U),z=zi(z),$=$.slice(),F=U-z){for(F>0?(z=U,R=W):(F=-F,R=$),R.reverse();F--;R.push(0));R.reverse()}for(F=$.length,I=W.length,F-I<0&&(R=W,W=$,$=R,I=F),F=0;I;)F=($[--I]=$[I]+W[I]+F)/rn|0,$[I]=rn===$[I]?0:$[I]%rn;return F&&($=[F].concat($),++z),D(x,$,z)},s.precision=s.sd=function(x,I){var R,G,F,U=this;if(x!=null&&x!==!!x)return ye(x,1,je),I==null?I=l:ye(I,0,8),L(new C(U),x,I);if(!(R=U.c))return null;if(F=R.length-1,G=F*qt+1,F=R[F]){for(;F%10==0;F/=10,G--);for(F=R[0];F>=10;F/=10,G++);}return x&&U.e+1>G&&(G=U.e+1),G},s.shiftedBy=function(x){return ye(x,-Dd,Dd),this.times("1e"+x)},s.squareRoot=s.sqrt=function(){var x,I,R,G,F,U=this,z=U.c,$=U.s,W=U.e,X=h+4,Y=new C("0.5");if($!==1||!z||!z[0])return new C(!$||$<0&&(!z||z[0])?NaN:z?U:1/0);if($=Math.sqrt(+V(U)),$==0||$==1/0?(I=Ui(z),(I.length+W)%2==0&&(I+="0"),$=Math.sqrt(+I),W=zi((W+1)/2)-(W<0||W%2),$==1/0?I="5e"+W:(I=$.toExponential(),I=I.slice(0,I.indexOf("e")+1)+W),R=new C(I)):R=new C($+""),R.c[0]){for(W=R.e,$=W+X,$<3&&($=0);;)if(F=R,R=Y.times(F.plus(e(U,F,X,1))),Ui(F.c).slice(0,$)===(I=Ui(R.c)).slice(0,$))if(R.e<W&&--$,I=I.slice($-3,$+1),I=="9999"||!G&&I=="4999"){if(!G&&(L(F,F.e+h+2,0),F.times(F).eq(U))){R=F;break}X+=4,$+=4,G=1}else{(!+I||!+I.slice(1)&&I.charAt(0)=="5")&&(L(R,R.e+h+2,1),x=!R.times(R).eq(U));break}}return L(R,R.e+h+1,l,x)},s.toExponential=function(x,I){return x!=null&&(ye(x,0,je),x++),k(this,x,I,1)},s.toFixed=function(x,I){return x!=null&&(ye(x,0,je),x=x+this.e+1),k(this,x,I)},s.toFormat=function(x,I,R){var G,F=this;if(R==null)x!=null&&I&&typeof I=="object"?(R=I,I=null):x&&typeof x=="object"?(R=x,x=I=null):R=T;else if(typeof R!="object")throw Error(mi+"Argument not an object: "+R);if(G=F.toFixed(x,I),F.c){var U,z=G.split("."),$=+R.groupSize,W=+R.secondaryGroupSize,X=R.groupSeparator||"",Y=z[0],et=z[1],J=F.s<0,rt=J?Y.slice(1):Y,ht=rt.length;if(W&&(U=$,$=W,W=U,ht-=U),$>0&&ht>0){for(U=ht%$||$,Y=rt.substr(0,U);U<ht;U+=$)Y+=X+rt.substr(U,$);W>0&&(Y+=X+rt.slice(U)),J&&(Y="-"+Y)}G=et?Y+(R.decimalSeparator||"")+((W=+R.fractionGroupSize)?et.replace(new RegExp("\\d{"+W+"}\\B","g"),"$&"+(R.fractionGroupSeparator||"")):et):Y}return(R.prefix||"")+G+(R.suffix||"")},s.toFraction=function(x){var I,R,G,F,U,z,$,W,X,Y,et,J,rt=this,ht=rt.c;if(x!=null&&($=new C(x),!$.isInteger()&&($.c||$.s!==1)||$.lt(o)))throw Error(mi+"Argument "+($.isInteger()?"out of range: ":"not an integer: ")+V($));if(!ht)return new C(rt);for(I=new C(o),X=R=new C(o),G=W=new C(o),J=Ui(ht),U=I.e=J.length-rt.e-1,I.c[0]=Ld[(z=U%qt)<0?qt+z:z],x=!x||$.comparedTo(I)>0?U>0?I:X:$,z=m,m=1/0,$=new C(J),W.c[0]=0;Y=e($,I,0,1),F=R.plus(Y.times(G)),F.comparedTo(x)!=1;)R=G,G=F,X=W.plus(Y.times(F=X)),W=F,I=$.minus(Y.times(F=I)),$=F;return F=e(x.minus(R),G,0,1),W=W.plus(F.times(X)),R=R.plus(F.times(G)),W.s=X.s=rt.s,U=U*2,et=e(X,G,U,l).minus(rt).abs().comparedTo(e(W,R,U,l).minus(rt).abs())<1?[X,G]:[W,R],m=z,et},s.toNumber=function(){return+V(this)},s.toPrecision=function(x,I){return x!=null&&ye(x,1,je),k(this,x,I,2)},s.toString=function(x){var I,R=this,G=R.s,F=R.e;return F===null?G?(I="Infinity",G<0&&(I="-"+I)):I="NaN":(x==null?I=F<=d||F>=f?Wl(Ui(R.c),F):ts(Ui(R.c),F,"0"):x===10&&j?(R=L(new C(R),h+F+1,l),I=ts(Ui(R.c),R.e,"0")):(ye(x,2,N.length,"Base"),I=t(ts(Ui(R.c),F,"0"),10,x,G,!0)),G<0&&R.c[0]&&(I="-"+I)),I},s.valueOf=s.toJSON=function(){return V(this)},s._isBigNumber=!0,s[Symbol.toStringTag]="BigNumber",s[Symbol.for("nodejs.util.inspect.custom")]=s.valueOf,i!=null&&C.set(i),C}function zi(i){var e=i|0;return i>0||i===e?e:e-1}function Ui(i){for(var e,t,n=1,s=i.length,o=i[0]+"";n<s;){for(e=i[n++]+"",t=qt-e.length;t--;e="0"+e);o+=e}for(s=o.length;o.charCodeAt(--s)===48;);return o.slice(0,s+1||1)}function ur(i,e){var t,n,s=i.c,o=e.c,h=i.s,l=e.s,d=i.e,f=e.e;if(!h||!l)return null;if(t=s&&!s[0],n=o&&!o[0],t||n)return t?n?0:-l:h;if(h!=l)return h;if(t=h<0,n=d==f,!s||!o)return n?0:!s^t?1:-1;if(!n)return d>f^t?1:-1;for(l=(d=s.length)<(f=o.length)?d:f,h=0;h<l;h++)if(s[h]!=o[h])return s[h]>o[h]^t?1:-1;return d==f?0:d>f^t?1:-1}function ye(i,e,t,n){if(i<e||i>t||i!==Bi(i))throw Error(mi+(n||"Argument")+(typeof i=="number"?i<e||i>t?" out of range: ":" not an integer: ":" not a primitive number: ")+String(i))}function $l(i){var e=i.c.length-1;return zi(i.e/qt)==e&&i.c[e]%2!=0}function Wl(i,e){return(i.length>1?i.charAt(0)+"."+i.slice(1):i)+(e<0?"e":"e+")+e}function ts(i,e,t){var n,s;if(e<0){for(s=t+".";++e;s+=t);i=s+i}else if(n=i.length,++e>n){for(s=t,e-=n;--e;s+=t);i+=s}else e<n&&(i=i.slice(0,e)+"."+i.slice(e));return i}var Cn=Vv(),cT=class{constructor(i){p(this,"key");p(this,"left",null);p(this,"right",null);this.key=i}},ph=class extends cT{constructor(i){super(i)}},dT=class{constructor(){p(this,"size",0);p(this,"modificationCount",0);p(this,"splayCount",0)}splay(i){const e=this.root;if(e==null)return this.compare(i,i),-1;let t=null,n=null,s=null,o=null,h=e;const l=this.compare;let d;for(;;)if(d=l(h.key,i),d>0){let f=h.left;if(f==null||(d=l(f.key,i),d>0&&(h.left=f.right,f.right=h,h=f,f=h.left,f==null)))break;t==null?n=h:t.left=h,t=h,h=f}else if(d<0){let f=h.right;if(f==null||(d=l(f.key,i),d<0&&(h.right=f.left,f.left=h,h=f,f=h.right,f==null)))break;s==null?o=h:s.right=h,s=h,h=f}else break;return s!=null&&(s.right=h.left,h.left=o),t!=null&&(t.left=h.right,h.right=n),this.root!==h&&(this.root=h,this.splayCount++),d}splayMin(i){let e=i,t=e.left;for(;t!=null;){const n=t;e.left=n.right,n.right=e,e=n,t=e.left}return e}splayMax(i){let e=i,t=e.right;for(;t!=null;){const n=t;e.right=n.left,n.left=e,e=n,t=e.right}return e}_delete(i){if(this.root==null||this.splay(i)!=0)return null;let t=this.root;const n=t,s=t.left;if(this.size--,s==null)this.root=t.right;else{const o=t.right;t=this.splayMax(s),t.right=o,this.root=t}return this.modificationCount++,n}addNewRoot(i,e){this.size++,this.modificationCount++;const t=this.root;if(t==null){this.root=i;return}e<0?(i.left=t,i.right=t.right,t.right=null):(i.right=t,i.left=t.left,t.left=null),this.root=i}_first(){const i=this.root;return i==null?null:(this.root=this.splayMin(i),this.root)}_last(){const i=this.root;return i==null?null:(this.root=this.splayMax(i),this.root)}clear(){this.root=null,this.size=0,this.modificationCount++}has(i){return this.validKey(i)&&this.splay(i)==0}defaultCompare(){return(i,e)=>i<e?-1:i>e?1:0}wrap(){return{getRoot:()=>this.root,setRoot:i=>{this.root=i},getSize:()=>this.size,getModificationCount:()=>this.modificationCount,getSplayCount:()=>this.splayCount,setSplayCount:i=>{this.splayCount=i},splay:i=>this.splay(i),has:i=>this.has(i)}}},Hl=class Uh extends dT{constructor(t,n){super();p(this,"root",null);p(this,"compare");p(this,"validKey");p(this,T_,"[object Set]");this.compare=t??this.defaultCompare(),this.validKey=n??(s=>s!=null&&s!=null)}delete(t){return this.validKey(t)?this._delete(t)!=null:!1}deleteAll(t){for(const n of t)this.delete(n)}forEach(t){const n=this[Symbol.iterator]();let s;for(;s=n.next(),!s.done;)t(s.value,s.value,this)}add(t){const n=this.splay(t);return n!=0&&this.addNewRoot(new ph(t),n),this}addAndReturn(t){const n=this.splay(t);return n!=0&&this.addNewRoot(new ph(t),n),this.root.key}addAll(t){for(const n of t)this.add(n)}isEmpty(){return this.root==null}isNotEmpty(){return this.root!=null}single(){if(this.size==0)throw"Bad state: No element";if(this.size>1)throw"Bad state: Too many element";return this.root.key}first(){if(this.size==0)throw"Bad state: No element";return this._first().key}last(){if(this.size==0)throw"Bad state: No element";return this._last().key}lastBefore(t){if(t==null)throw"Invalid arguments(s)";if(this.root==null)return null;if(this.splay(t)<0)return this.root.key;let s=this.root.left;if(s==null)return null;let o=s.right;for(;o!=null;)s=o,o=s.right;return s.key}firstAfter(t){if(t==null)throw"Invalid arguments(s)";if(this.root==null)return null;if(this.splay(t)>0)return this.root.key;let s=this.root.right;if(s==null)return null;let o=s.left;for(;o!=null;)s=o,o=s.left;return s.key}retainAll(t){const n=new Uh(this.compare,this.validKey),s=this.modificationCount;for(const o of t){if(s!=this.modificationCount)throw"Concurrent modification during iteration.";this.validKey(o)&&this.splay(o)==0&&n.add(this.root.key)}n.size!=this.size&&(this.root=n.root,this.size=n.size,this.modificationCount++)}lookup(t){return!this.validKey(t)||this.splay(t)!=0?null:this.root.key}intersection(t){const n=new Uh(this.compare,this.validKey);for(const s of this)t.has(s)&&n.add(s);return n}difference(t){const n=new Uh(this.compare,this.validKey);for(const s of this)t.has(s)||n.add(s);return n}union(t){const n=this.clone();return n.addAll(t),n}clone(){const t=new Uh(this.compare,this.validKey);return t.size=this.size,t.root=this.copyNode(this.root),t}copyNode(t){if(t==null)return null;function n(o,h){let l,d;do{if(l=o.left,d=o.right,l!=null){const f=new ph(l.key);h.left=f,n(l,f)}if(d!=null){const f=new ph(d.key);h.right=f,o=d,h=f}}while(d!=null)}const s=new ph(t.key);return n(t,s),s}toSet(){return this.clone()}entries(){return new gT(this.wrap())}keys(){return this[Symbol.iterator]()}values(){return this[Symbol.iterator]()}[(k_=Symbol.iterator,T_=Symbol.toStringTag,k_)](){return new fT(this.wrap())}},qv=class{constructor(i){p(this,"tree");p(this,"path",new Array);p(this,"modificationCount",null);p(this,"splayCount");this.tree=i,this.splayCount=i.getSplayCount()}[Symbol.iterator](){return this}next(){return this.moveNext()?{done:!1,value:this.current()}:{done:!0,value:null}}current(){if(!this.path.length)return null;const i=this.path[this.path.length-1];return this.getValue(i)}rebuildPath(i){this.path.splice(0,this.path.length),this.tree.splay(i),this.path.push(this.tree.getRoot()),this.splayCount=this.tree.getSplayCount()}findLeftMostDescendent(i){for(;i!=null;)this.path.push(i),i=i.left}moveNext(){if(this.modificationCount!=this.tree.getModificationCount()){if(this.modificationCount==null){this.modificationCount=this.tree.getModificationCount();let t=this.tree.getRoot();for(;t!=null;)this.path.push(t),t=t.left;return this.path.length>0}throw"Concurrent modification during iteration."}if(!this.path.length)return!1;this.splayCount!=this.tree.getSplayCount()&&this.rebuildPath(this.path[this.path.length-1].key);let i=this.path[this.path.length-1],e=i.right;if(e!=null){for(;e!=null;)this.path.push(e),e=e.left;return!0}for(this.path.pop();this.path.length&&this.path[this.path.length-1].right===i;)i=this.path.pop();return this.path.length>0}},fT=class extends qv{getValue(i){return i.key}},gT=class extends qv{getValue(i){return[i.key,i.key]}},$v=i=>()=>i,Fd=i=>{const e=i?(t,n)=>n.minus(t).abs().isLessThanOrEqualTo(i):$v(!1);return(t,n)=>e(t,n)?0:t.comparedTo(n)};function pT(i){const e=i?(t,n,s,o,h)=>t.exponentiatedBy(2).isLessThanOrEqualTo(o.minus(n).exponentiatedBy(2).plus(h.minus(s).exponentiatedBy(2)).times(i)):$v(!1);return(t,n,s)=>{const o=t.x,h=t.y,l=s.x,d=s.y,f=h.minus(d).times(n.x.minus(l)).minus(o.minus(l).times(n.y.minus(d)));return e(f,o,h,l,d)?0:f.comparedTo(0)}}var mT=i=>i,vT=i=>{if(i){const e=new Hl(Fd(i)),t=new Hl(Fd(i)),n=(o,h)=>h.addAndReturn(o),s=o=>({x:n(o.x,e),y:n(o.y,t)});return s({x:new Cn(0),y:new Cn(0)}),s}return mT},Gd=i=>({set:e=>{es=Gd(e)},reset:()=>Gd(i),compare:Fd(i),snap:vT(i),orient:pT(i)}),es=Gd(),mh=(i,e)=>i.ll.x.isLessThanOrEqualTo(e.x)&&e.x.isLessThanOrEqualTo(i.ur.x)&&i.ll.y.isLessThanOrEqualTo(e.y)&&e.y.isLessThanOrEqualTo(i.ur.y),jd=(i,e)=>{if(e.ur.x.isLessThan(i.ll.x)||i.ur.x.isLessThan(e.ll.x)||e.ur.y.isLessThan(i.ll.y)||i.ur.y.isLessThan(e.ll.y))return null;const t=i.ll.x.isLessThan(e.ll.x)?e.ll.x:i.ll.x,n=i.ur.x.isLessThan(e.ur.x)?i.ur.x:e.ur.x,s=i.ll.y.isLessThan(e.ll.y)?e.ll.y:i.ll.y,o=i.ur.y.isLessThan(e.ur.y)?i.ur.y:e.ur.y;return{ll:{x:t,y:s},ur:{x:n,y:o}}},Xl=(i,e)=>i.x.times(e.y).minus(i.y.times(e.x)),Wv=(i,e)=>i.x.times(e.x).plus(i.y.times(e.y)),Yl=i=>Wv(i,i).sqrt(),yT=(i,e,t)=>{const n={x:e.x.minus(i.x),y:e.y.minus(i.y)},s={x:t.x.minus(i.x),y:t.y.minus(i.y)};return Xl(s,n).div(Yl(s)).div(Yl(n))},_T=(i,e,t)=>{const n={x:e.x.minus(i.x),y:e.y.minus(i.y)},s={x:t.x.minus(i.x),y:t.y.minus(i.y)};return Wv(s,n).div(Yl(s)).div(Yl(n))},Hv=(i,e,t)=>e.y.isZero()?null:{x:i.x.plus(e.x.div(e.y).times(t.minus(i.y))),y:t},Xv=(i,e,t)=>e.x.isZero()?null:{x:t,y:i.y.plus(e.y.div(e.x).times(t.minus(i.x)))},wT=(i,e,t,n)=>{if(e.x.isZero())return Xv(t,n,i.x);if(n.x.isZero())return Xv(i,e,t.x);if(e.y.isZero())return Hv(t,n,i.y);if(n.y.isZero())return Hv(i,e,t.y);const s=Xl(e,n);if(s.isZero())return null;const o={x:t.x.minus(i.x),y:t.y.minus(i.y)},h=Xl(o,e).div(s),l=Xl(o,n).div(s),d=i.x.plus(l.times(e.x)),f=t.x.plus(h.times(n.x)),v=i.y.plus(l.times(e.y)),m=t.y.plus(h.times(n.y)),y=d.plus(f).div(2),w=v.plus(m).div(2);return{x:y,y:w}},In=class S1{constructor(e,t){p(this,"point");p(this,"isLeft");p(this,"segment");p(this,"otherSE");p(this,"consumedBy");e.events===void 0?e.events=[this]:e.events.push(this),this.point=e,this.isLeft=t}static compare(e,t){const n=S1.comparePoints(e.point,t.point);return n!==0?n:(e.point!==t.point&&e.link(t),e.isLeft!==t.isLeft?e.isLeft?1:-1:Jl.compare(e.segment,t.segment))}static comparePoints(e,t){return e.x.isLessThan(t.x)?-1:e.x.isGreaterThan(t.x)?1:e.y.isLessThan(t.y)?-1:e.y.isGreaterThan(t.y)?1:0}link(e){if(e.point===this.point)throw new Error("Tried to link already linked events");const t=e.point.events;for(let n=0,s=t.length;n<s;n++){const o=t[n];this.point.events.push(o),o.point=this.point}this.checkForConsuming()}checkForConsuming(){const e=this.point.events.length;for(let t=0;t<e;t++){const n=this.point.events[t];if(n.segment.consumedBy===void 0)for(let s=t+1;s<e;s++){const o=this.point.events[s];o.consumedBy===void 0&&n.otherSE.point.events===o.otherSE.point.events&&n.segment.consume(o.segment)}}}getAvailableLinkedEvents(){const e=[];for(let t=0,n=this.point.events.length;t<n;t++){const s=this.point.events[t];s!==this&&!s.segment.ringOut&&s.segment.isInResult()&&e.push(s)}return e}getLeftmostComparator(e){const t=new Map,n=s=>{const o=s.otherSE;t.set(s,{sine:yT(this.point,e.point,o.point),cosine:_T(this.point,e.point,o.point)})};return(s,o)=>{t.has(s)||n(s),t.has(o)||n(o);const{sine:h,cosine:l}=t.get(s),{sine:d,cosine:f}=t.get(o);return h.isGreaterThanOrEqualTo(0)&&d.isGreaterThanOrEqualTo(0)?l.isLessThan(f)?1:l.isGreaterThan(f)?-1:0:h.isLessThan(0)&&d.isLessThan(0)?l.isLessThan(f)?-1:l.isGreaterThan(f)?1:0:d.isLessThan(h)?-1:d.isGreaterThan(h)?1:0}}},ET=class sp{constructor(e){p(this,"events");p(this,"poly");p(this,"_isExteriorRing");p(this,"_enclosingRing");this.events=e;for(let t=0,n=e.length;t<n;t++)e[t].segment.ringOut=this;this.poly=null}static factory(e){const t=[];for(let n=0,s=e.length;n<s;n++){const o=e[n];if(!o.isInResult()||o.ringOut)continue;let h=null,l=o.leftSE,d=o.rightSE;const f=[l],v=l.point,m=[];for(;h=l,l=d,f.push(l),l.point!==v;)for(;;){const y=l.getAvailableLinkedEvents();if(y.length===0){const T=f[0].point,N=f[f.length-1].point;throw new Error(`Unable to complete output ring starting at [${T.x}, ${T.y}]. Last matching segment found ends at [${N.x}, ${N.y}].`)}if(y.length===1){d=y[0].otherSE;break}let w=null;for(let T=0,N=m.length;T<N;T++)if(m[T].point===l.point){w=T;break}if(w!==null){const T=m.splice(w)[0],N=f.splice(T.index);N.unshift(N[0].otherSE),t.push(new sp(N.reverse()));continue}m.push({index:f.length,point:l.point});const S=l.getLeftmostComparator(h);d=y.sort(S)[0].otherSE;break}t.push(new sp(f))}return t}getGeom(){let e=this.events[0].point;const t=[e];for(let f=1,v=this.events.length-1;f<v;f++){const m=this.events[f].point,y=this.events[f+1].point;es.orient(m,e,y)!==0&&(t.push(m),e=m)}if(t.length===1)return null;const n=t[0],s=t[1];es.orient(n,e,s)===0&&t.shift(),t.push(t[0]);const o=this.isExteriorRing()?1:-1,h=this.isExteriorRing()?0:t.length-1,l=this.isExteriorRing()?t.length:-1,d=[];for(let f=h;f!=l;f+=o)d.push([t[f].x.toNumber(),t[f].y.toNumber()]);return d}isExteriorRing(){if(this._isExteriorRing===void 0){const e=this.enclosingRing();this._isExteriorRing=e?!e.isExteriorRing():!0}return this._isExteriorRing}enclosingRing(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}_calcEnclosingRing(){var s,o;let e=this.events[0];for(let h=1,l=this.events.length;h<l;h++){const d=this.events[h];In.compare(e,d)>0&&(e=d)}let t=e.segment.prevInResult(),n=t?t.prevInResult():null;for(;;){if(!t)return null;if(!n)return t.ringOut;if(n.ringOut!==t.ringOut)return((s=n.ringOut)==null?void 0:s.enclosingRing())!==t.ringOut?t.ringOut:(o=t.ringOut)==null?void 0:o.enclosingRing();t=n.prevInResult(),n=t?t.prevInResult():null}}},Yv=class{constructor(i){p(this,"exteriorRing");p(this,"interiorRings");this.exteriorRing=i,i.poly=this,this.interiorRings=[]}addInterior(i){this.interiorRings.push(i),i.poly=this}getGeom(){const i=this.exteriorRing.getGeom();if(i===null)return null;const e=[i];for(let t=0,n=this.interiorRings.length;t<n;t++){const s=this.interiorRings[t].getGeom();s!==null&&e.push(s)}return e}},ST=class{constructor(i){p(this,"rings");p(this,"polys");this.rings=i,this.polys=this._composePolys(i)}getGeom(){const i=[];for(let e=0,t=this.polys.length;e<t;e++){const n=this.polys[e].getGeom();n!==null&&i.push(n)}return i}_composePolys(i){var t;const e=[];for(let n=0,s=i.length;n<s;n++){const o=i[n];if(!o.poly)if(o.isExteriorRing())e.push(new Yv(o));else{const h=o.enclosingRing();h!=null&&h.poly||e.push(new Yv(h)),(t=h==null?void 0:h.poly)==null||t.addInterior(o)}}return e}},xT=class{constructor(i,e=Jl.compare){p(this,"queue");p(this,"tree");p(this,"segments");this.queue=i,this.tree=new Hl(e),this.segments=[]}process(i){const e=i.segment,t=[];if(i.consumedBy)return i.isLeft?this.queue.delete(i.otherSE):this.tree.delete(e),t;i.isLeft&&this.tree.add(e);let n=e,s=e;do n=this.tree.lastBefore(n);while(n!=null&&n.consumedBy!=null);do s=this.tree.firstAfter(s);while(s!=null&&s.consumedBy!=null);if(i.isLeft){let o=null;if(n){const l=n.getIntersection(e);if(l!==null&&(e.isAnEndpoint(l)||(o=l),!n.isAnEndpoint(l))){const d=this._splitSafely(n,l);for(let f=0,v=d.length;f<v;f++)t.push(d[f])}}let h=null;if(s){const l=s.getIntersection(e);if(l!==null&&(e.isAnEndpoint(l)||(h=l),!s.isAnEndpoint(l))){const d=this._splitSafely(s,l);for(let f=0,v=d.length;f<v;f++)t.push(d[f])}}if(o!==null||h!==null){let l=null;o===null?l=h:h===null?l=o:l=In.comparePoints(o,h)<=0?o:h,this.queue.delete(e.rightSE),t.push(e.rightSE);const d=e.split(l);for(let f=0,v=d.length;f<v;f++)t.push(d[f])}t.length>0?(this.tree.delete(e),t.push(i)):(this.segments.push(e),e.prev=n)}else{if(n&&s){const o=n.getIntersection(s);if(o!==null){if(!n.isAnEndpoint(o)){const h=this._splitSafely(n,o);for(let l=0,d=h.length;l<d;l++)t.push(h[l])}if(!s.isAnEndpoint(o)){const h=this._splitSafely(s,o);for(let l=0,d=h.length;l<d;l++)t.push(h[l])}}}this.tree.delete(e)}return t}_splitSafely(i,e){this.tree.delete(i);const t=i.rightSE;this.queue.delete(t);const n=i.split(e);return n.push(t),i.consumedBy===void 0&&this.tree.add(i),n}},bT=class{constructor(){p(this,"type");p(this,"numMultiPolys")}run(i,e,t){vh.type=i;const n=[new Kv(e,!0)];for(let f=0,v=t.length;f<v;f++)n.push(new Kv(t[f],!1));if(vh.numMultiPolys=n.length,vh.type==="difference"){const f=n[0];let v=1;for(;v<n.length;)jd(n[v].bbox,f.bbox)!==null?v++:n.splice(v,1)}if(vh.type==="intersection")for(let f=0,v=n.length;f<v;f++){const m=n[f];for(let y=f+1,w=n.length;y<w;y++)if(jd(m.bbox,n[y].bbox)===null)return[]}const s=new Hl(In.compare);for(let f=0,v=n.length;f<v;f++){const m=n[f].getSweepEvents();for(let y=0,w=m.length;y<w;y++)s.add(m[y])}const o=new xT(s);let h=null;for(s.size!=0&&(h=s.first(),s.delete(h));h;){const f=o.process(h);for(let v=0,m=f.length;v<m;v++){const y=f[v];y.consumedBy===void 0&&s.add(y)}s.size!=0?(h=s.first(),s.delete(h)):h=null}es.reset();const l=ET.factory(o.segments);return new ST(l).getGeom()}},vh=new bT,yh=vh,PT=0,Jl=class zu{constructor(e,t,n,s){p(this,"id");p(this,"leftSE");p(this,"rightSE");p(this,"rings");p(this,"windings");p(this,"ringOut");p(this,"consumedBy");p(this,"prev");p(this,"_prevInResult");p(this,"_beforeState");p(this,"_afterState");p(this,"_isInResult");this.id=++PT,this.leftSE=e,e.segment=this,e.otherSE=t,this.rightSE=t,t.segment=this,t.otherSE=e,this.rings=n,this.windings=s}static compare(e,t){const n=e.leftSE.point.x,s=t.leftSE.point.x,o=e.rightSE.point.x,h=t.rightSE.point.x;if(h.isLessThan(n))return 1;if(o.isLessThan(s))return-1;const l=e.leftSE.point.y,d=t.leftSE.point.y,f=e.rightSE.point.y,v=t.rightSE.point.y;if(n.isLessThan(s)){if(d.isLessThan(l)&&d.isLessThan(f))return 1;if(d.isGreaterThan(l)&&d.isGreaterThan(f))return-1;const m=e.comparePoint(t.leftSE.point);if(m<0)return 1;if(m>0)return-1;const y=t.comparePoint(e.rightSE.point);return y!==0?y:-1}if(n.isGreaterThan(s)){if(l.isLessThan(d)&&l.isLessThan(v))return-1;if(l.isGreaterThan(d)&&l.isGreaterThan(v))return 1;const m=t.comparePoint(e.leftSE.point);if(m!==0)return m;const y=e.comparePoint(t.rightSE.point);return y<0?1:y>0?-1:1}if(l.isLessThan(d))return-1;if(l.isGreaterThan(d))return 1;if(o.isLessThan(h)){const m=t.comparePoint(e.rightSE.point);if(m!==0)return m}if(o.isGreaterThan(h)){const m=e.comparePoint(t.rightSE.point);if(m<0)return 1;if(m>0)return-1}if(!o.eq(h)){const m=f.minus(l),y=o.minus(n),w=v.minus(d),S=h.minus(s);if(m.isGreaterThan(y)&&w.isLessThan(S))return 1;if(m.isLessThan(y)&&w.isGreaterThan(S))return-1}return o.isGreaterThan(h)?1:o.isLessThan(h)||f.isLessThan(v)?-1:f.isGreaterThan(v)?1:e.id<t.id?-1:e.id>t.id?1:0}static fromRing(e,t,n){let s,o,h;const l=In.comparePoints(e,t);if(l<0)s=e,o=t,h=1;else if(l>0)s=t,o=e,h=-1;else throw new Error(`Tried to create degenerate segment at [${e.x}, ${e.y}]`);const d=new In(s,!0),f=new In(o,!1);return new zu(d,f,[n],[h])}replaceRightSE(e){this.rightSE=e,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}bbox(){const e=this.leftSE.point.y,t=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:e.isLessThan(t)?e:t},ur:{x:this.rightSE.point.x,y:e.isGreaterThan(t)?e:t}}}vector(){return{x:this.rightSE.point.x.minus(this.leftSE.point.x),y:this.rightSE.point.y.minus(this.leftSE.point.y)}}isAnEndpoint(e){return e.x.eq(this.leftSE.point.x)&&e.y.eq(this.leftSE.point.y)||e.x.eq(this.rightSE.point.x)&&e.y.eq(this.rightSE.point.y)}comparePoint(e){return es.orient(this.leftSE.point,e,this.rightSE.point)}getIntersection(e){const t=this.bbox(),n=e.bbox(),s=jd(t,n);if(s===null)return null;const o=this.leftSE.point,h=this.rightSE.point,l=e.leftSE.point,d=e.rightSE.point,f=mh(t,l)&&this.comparePoint(l)===0,v=mh(n,o)&&e.comparePoint(o)===0,m=mh(t,d)&&this.comparePoint(d)===0,y=mh(n,h)&&e.comparePoint(h)===0;if(v&&f)return y&&!m?h:!y&&m?d:null;if(v)return m&&o.x.eq(d.x)&&o.y.eq(d.y)?null:o;if(f)return y&&h.x.eq(l.x)&&h.y.eq(l.y)?null:l;if(y&&m)return null;if(y)return h;if(m)return d;const w=wT(o,this.vector(),l,e.vector());return w===null||!mh(s,w)?null:es.snap(w)}split(e){const t=[],n=e.events!==void 0,s=new In(e,!0),o=new In(e,!1),h=this.rightSE;this.replaceRightSE(o),t.push(o),t.push(s);const l=new zu(s,h,this.rings.slice(),this.windings.slice());return In.comparePoints(l.leftSE.point,l.rightSE.point)>0&&l.swapEvents(),In.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),n&&(s.checkForConsuming(),o.checkForConsuming()),t}swapEvents(){const e=this.rightSE;this.rightSE=this.leftSE,this.leftSE=e,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let t=0,n=this.windings.length;t<n;t++)this.windings[t]*=-1}consume(e){let t=this,n=e;for(;t.consumedBy;)t=t.consumedBy;for(;n.consumedBy;)n=n.consumedBy;const s=zu.compare(t,n);if(s!==0){if(s>0){const o=t;t=n,n=o}if(t.prev===n){const o=t;t=n,n=o}for(let o=0,h=n.rings.length;o<h;o++){const l=n.rings[o],d=n.windings[o],f=t.rings.indexOf(l);f===-1?(t.rings.push(l),t.windings.push(d)):t.windings[f]+=d}n.rings=null,n.windings=null,n.consumedBy=t,n.leftSE.consumedBy=t.leftSE,n.rightSE.consumedBy=t.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{const e=this.prev.consumedBy||this.prev;this._beforeState=e.afterState()}return this._beforeState}afterState(){if(this._afterState!==void 0)return this._afterState;const e=this.beforeState();this._afterState={rings:e.rings.slice(0),windings:e.windings.slice(0),multiPolys:[]};const t=this._afterState.rings,n=this._afterState.windings,s=this._afterState.multiPolys;for(let l=0,d=this.rings.length;l<d;l++){const f=this.rings[l],v=this.windings[l],m=t.indexOf(f);m===-1?(t.push(f),n.push(v)):n[m]+=v}const o=[],h=[];for(let l=0,d=t.length;l<d;l++){if(n[l]===0)continue;const f=t[l],v=f.poly;if(h.indexOf(v)===-1)if(f.isExterior)o.push(v);else{h.indexOf(v)===-1&&h.push(v);const m=o.indexOf(f.poly);m!==-1&&o.splice(m,1)}}for(let l=0,d=o.length;l<d;l++){const f=o[l].multiPoly;s.indexOf(f)===-1&&s.push(f)}return this._afterState}isInResult(){if(this.consumedBy)return!1;if(this._isInResult!==void 0)return this._isInResult;const e=this.beforeState().multiPolys,t=this.afterState().multiPolys;switch(yh.type){case"union":{const n=e.length===0,s=t.length===0;this._isInResult=n!==s;break}case"intersection":{let n,s;e.length<t.length?(n=e.length,s=t.length):(n=t.length,s=e.length),this._isInResult=s===yh.numMultiPolys&&n<s;break}case"xor":{const n=Math.abs(e.length-t.length);this._isInResult=n%2===1;break}case"difference":{const n=s=>s.length===1&&s[0].isSubject;this._isInResult=n(e)!==n(t);break}}return this._isInResult}},Jv=class{constructor(i,e,t){p(this,"poly");p(this,"isExterior");p(this,"segments");p(this,"bbox");if(!Array.isArray(i)||i.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=e,this.isExterior=t,this.segments=[],typeof i[0][0]!="number"||typeof i[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");const n=es.snap({x:new Cn(i[0][0]),y:new Cn(i[0][1])});this.bbox={ll:{x:n.x,y:n.y},ur:{x:n.x,y:n.y}};let s=n;for(let o=1,h=i.length;o<h;o++){if(typeof i[o][0]!="number"||typeof i[o][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");const l=es.snap({x:new Cn(i[o][0]),y:new Cn(i[o][1])});l.x.eq(s.x)&&l.y.eq(s.y)||(this.segments.push(Jl.fromRing(s,l,this)),l.x.isLessThan(this.bbox.ll.x)&&(this.bbox.ll.x=l.x),l.y.isLessThan(this.bbox.ll.y)&&(this.bbox.ll.y=l.y),l.x.isGreaterThan(this.bbox.ur.x)&&(this.bbox.ur.x=l.x),l.y.isGreaterThan(this.bbox.ur.y)&&(this.bbox.ur.y=l.y),s=l)}(!n.x.eq(s.x)||!n.y.eq(s.y))&&this.segments.push(Jl.fromRing(s,n,this))}getSweepEvents(){const i=[];for(let e=0,t=this.segments.length;e<t;e++){const n=this.segments[e];i.push(n.leftSE),i.push(n.rightSE)}return i}},CT=class{constructor(i,e){p(this,"multiPoly");p(this,"exteriorRing");p(this,"interiorRings");p(this,"bbox");if(!Array.isArray(i))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new Jv(i[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 t=1,n=i.length;t<n;t++){const s=new Jv(i[t],this,!1);s.bbox.ll.x.isLessThan(this.bbox.ll.x)&&(this.bbox.ll.x=s.bbox.ll.x),s.bbox.ll.y.isLessThan(this.bbox.ll.y)&&(this.bbox.ll.y=s.bbox.ll.y),s.bbox.ur.x.isGreaterThan(this.bbox.ur.x)&&(this.bbox.ur.x=s.bbox.ur.x),s.bbox.ur.y.isGreaterThan(this.bbox.ur.y)&&(this.bbox.ur.y=s.bbox.ur.y),this.interiorRings.push(s)}this.multiPoly=e}getSweepEvents(){const i=this.exteriorRing.getSweepEvents();for(let e=0,t=this.interiorRings.length;e<t;e++){const n=this.interiorRings[e].getSweepEvents();for(let s=0,o=n.length;s<o;s++)i.push(n[s])}return i}},Kv=class{constructor(i,e){p(this,"isSubject");p(this,"polys");p(this,"bbox");if(!Array.isArray(i))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof i[0][0][0]=="number"&&(i=[i])}catch{}this.polys=[],this.bbox={ll:{x:new Cn(Number.POSITIVE_INFINITY),y:new Cn(Number.POSITIVE_INFINITY)},ur:{x:new Cn(Number.NEGATIVE_INFINITY),y:new Cn(Number.NEGATIVE_INFINITY)}};for(let t=0,n=i.length;t<n;t++){const s=new CT(i[t],this);s.bbox.ll.x.isLessThan(this.bbox.ll.x)&&(this.bbox.ll.x=s.bbox.ll.x),s.bbox.ll.y.isLessThan(this.bbox.ll.y)&&(this.bbox.ll.y=s.bbox.ll.y),s.bbox.ur.x.isGreaterThan(this.bbox.ur.x)&&(this.bbox.ur.x=s.bbox.ur.x),s.bbox.ur.y.isGreaterThan(this.bbox.ur.y)&&(this.bbox.ur.y=s.bbox.ur.y),this.polys.push(s)}this.isSubject=e}getSweepEvents(){const i=[];for(let e=0,t=this.polys.length;e<t;e++){const n=this.polys[e].getSweepEvents();for(let s=0,o=n.length;s<o;s++)i.push(n[s])}return i}},IT=(i,...e)=>yh.run("union",i,e),MT=(i,...e)=>yh.run("intersection",i,e),TT=(i,...e)=>yh.run("difference",i,e);es.set;function kT(i){const e=[];if(ar(i,s=>{e.push(s.coordinates)}),e.length<2)throw new Error("Must have at least two features");const t=i.features[0].properties||{},n=TT(e[0],...e.slice(1));return n.length===0?null:n.length===1?de(n[0],t):rd(n,t)}function Kl(i,e,t={}){const n=Ie(i),s=Ie(e);s[0]+=s[0]-n[0]>180?-360:n[0]-s[0]>180?360:0;const o=OT(n,s);return nh(o,"meters",t.units)}function OT(i,e,t){t=t===void 0?Le:Number(t);const n=t,s=i[1]*Math.PI/180,o=e[1]*Math.PI/180,h=o-s;let l=Math.abs(e[0]-i[0])*Math.PI/180;l>Math.PI&&(l-=2*Math.PI);const d=Math.log(Math.tan(o/2+Math.PI/4)/Math.tan(s/2+Math.PI/4)),f=Math.abs(d)>1e-11?h/d:Math.cos(s);return Math.sqrt(h*h+f*f*l*l)*n}function NT(i,e,t,n={}){const s=e<0;let o=nh(Math.abs(e),n.units,"meters");s&&(o=-Math.abs(o));const h=Ie(i),l=RT(h,o,t);return l[0]+=l[0]-h[0]>180?-360:h[0]-l[0]>180?360:0,Xt(l,n.properties)}function RT(i,e,t,n){n=n===void 0?Le:Number(n);const s=e/n,o=i[0]*Math.PI/180,h=Fe(i[1]),l=Fe(t),d=s*Math.cos(l);let f=h+d;Math.abs(f)>Math.PI/2&&(f=f>0?Math.PI-f:-Math.PI-f);const v=Math.log(Math.tan(f/2+Math.PI/4)/Math.tan(h/2+Math.PI/4)),m=Math.abs(v)>1e-11?d/v:Math.cos(h),y=s*Math.sin(l)/m;return[((o+y)*180/Math.PI+540)%360-180,f*180/Math.PI]}function _h(i,e={}){const t=[];if(ar(i,s=>{t.push(s.coordinates)}),t.length<2)throw new Error("Must specify at least 2 geometries");const n=MT(t[0],...t.slice(1));return n.length===0?null:n.length===1?de(n[0],e.properties):rd(n,e.properties)}function AT(i,e,t={}){const n=JSON.stringify(t.properties||{}),[s,o,h,l]=i,d=(o+l)/2,f=(s+h)/2,m=e*2/pi([s,d],[h,d],t)*(h-s),w=e*2/pi([f,o],[f,l],t)*(l-o),S=m/2,T=S*2,N=Math.sqrt(3)/2*w,j=h-s,C=l-o,k=3/4*T,M=N,D=(j-T)/(T-S/2),L=Math.floor(D),V=(L*k-S/2-j)/2-S/2+k/2,x=Math.floor((C-N)/N);let I=(C-x*N)/2;const R=x*N-C>N/2;R&&(I-=N/4);const G=[],F=[];for(let z=0;z<6;z++){const $=2*Math.PI/6*z;G.push(Math.cos($)),F.push(Math.sin($))}const U=[];for(let z=0;z<=L;z++)for(let $=0;$<=x;$++){const W=z%2===1;if($===0&&W||$===0&&R)continue;const X=z*k+s-V;let Y=$*M+o+I;if(W&&(Y-=N/2),t.triangles===!0)LT([X,Y],m/2,w/2,JSON.parse(n),G,F).forEach(function(et){t.mask?_h(ae([t.mask,et]))&&U.push(et):U.push(et)});else{const et=DT([X,Y],m/2,w/2,JSON.parse(n),G,F);t.mask?_h(ae([t.mask,et]))&&U.push(et):U.push(et)}}return ae(U)}function DT(i,e,t,n,s,o){const h=[];for(let l=0;l<6;l++){const d=i[0]+e*s[l],f=i[1]+t*o[l];h.push([d,f])}return h.push(h[0].slice()),de([h],n)}function LT(i,e,t,n,s,o){const h=[];for(let l=0;l<6;l++){const d=[];d.push(i),d.push([i[0]+e*s[l],i[1]+t*o[l]]),d.push([i[0]+e*s[(l+1)%6],i[1]+t*o[(l+1)%6]]),d.push(i),h.push(de([d],n))}return h}function FT(i,e,t={}){t.mask&&!t.units&&(t.units="kilometers");for(var n=[],s=i[0],o=i[1],h=i[2],l=i[3],d=e/pi([s,o],[h,o],t),f=d*(h-s),v=e/pi([s,o],[s,l],t),m=v*(l-o),y=h-s,w=l-o,S=Math.floor(y/f),T=Math.floor(w/m),N=(y-S*f)/2,j=(w-T*m)/2,C=s+N;C<=h;){for(var k=o+j;k<=l;){var M=Xt([C,k],t.properties);t.mask?J0(M,t.mask)&&n.push(M):n.push(M),k+=m}C+=f}return ae(n)}function GT(i,e,t,n={}){const s=[],o=i[0],h=i[1],l=i[2],d=i[3],f=l-o,v=nh(e,n.units,"degrees"),m=d-h,y=nh(t,n.units,"degrees"),w=Math.floor(Math.abs(f)/v),S=Math.floor(Math.abs(m)/y),T=(f-w*v)/2,N=(m-S*y)/2;let j=o+T;for(let C=0;C<w;C++){let k=h+N;for(let M=0;M<S;M++){const D=de([[[j,k],[j,k+y],[j+v,k+y],[j+v,k],[j,k]]],n.properties);n.mask?nM(n.mask,D)&&s.push(D):s.push(D),k+=y}j+=v}return ae(s)}function jT(i,e,t={}){return GT(i,e,e,t)}function BT(i,e,t={}){for(var n=[],s=e/pi([i[0],i[1]],[i[2],i[1]],t),o=s*(i[2]-i[0]),h=e/pi([i[0],i[1]],[i[0],i[3]],t),l=h*(i[3]-i[1]),d=0,f=i[0];f<=i[2];){for(var v=0,m=i[1];m<=i[3];){var y=null,w=null;d%2===0&&v%2===0?(y=de([[[f,m],[f,m+l],[f+o,m],[f,m]]],t.properties),w=de([[[f,m+l],[f+o,m+l],[f+o,m],[f,m+l]]],t.properties)):d%2===0&&v%2===1?(y=de([[[f,m],[f+o,m+l],[f+o,m],[f,m]]],t.properties),w=de([[[f,m],[f,m+l],[f+o,m+l],[f,m]]],t.properties)):v%2===0&&d%2===1?(y=de([[[f,m],[f,m+l],[f+o,m+l],[f,m]]],t.properties),w=de([[[f,m],[f+o,m+l],[f+o,m],[f,m]]],t.properties)):v%2===1&&d%2===1&&(y=de([[[f,m],[f,m+l],[f+o,m],[f,m]]],t.properties),w=de([[[f,m+l],[f+o,m+l],[f+o,m],[f,m+l]]],t.properties)),t.mask?(_h(ae([t.mask,y]))&&n.push(y),_h(ae([t.mask,w]))&&n.push(w)):(n.push(y),n.push(w)),m+=l,v++}d++,f+=o}return ae(n)}function zT(i,e,t){var n,s,o,h;if(t=t||{},typeof t!="object")throw new Error("options is invalid");if(!i)throw new Error("points is required");if(BC(i,"Point","input must contain Points"),!e)throw new Error("cellSize is required");var l=(n=t.gridType)!=null?n:"square",d=(s=t.property)!=null?s:"elevation",f=(o=t.weight)!=null?o:1,v=(h=t.bbox)!=null?h:He(i);if(f!==void 0&&typeof f!="number")throw new Error("weight must be a number");jC(v);var m;switch(l){case"point":case"points":m=FT(v,e,t);break;case"square":case"squares":m=jT(v,e,t);break;case"hex":case"hexes":m=AT(v,e,t);break;case"triangle":case"triangles":m=BT(v,e,t);break;default:throw new Error("invalid gridType")}var y=[];return Is(m,function(w){var S,T=0,N=0;Is(i,function(C){var k,M=l==="point"?w:kd(w),D=pi(M,C,t),L;if(d!==void 0&&(L=(k=C.properties)==null?void 0:k[d]),L===void 0&&(L=C.geometry.coordinates[2]),L===void 0)throw new Error("zValue is missing");D===0&&(T=L);var V=1/Math.pow(D,f);N+=V,T+=V*L});var j=hT(w);(S=j.properties)!=null||(j.properties={}),j.properties[d]=T/N,y.push(j)}),ae(y)}function Zv(i,e={}){return $C(i,(t,n)=>{const s=n.geometry.coordinates;return t+pi(s[0],s[1],e)},0)}function UT(i,e){const t=pi(i,e),n=sh(i,e);return xn(i,t/2,n)}function VT(i,e,t={}){var n,s;const o=(n=t.method)!=null?n:"geodesic",h=(s=t.units)!=null?s:"kilometers";if(!i)throw new Error("pt is required");if(Array.isArray(i)?i=Xt(i):i.type==="Point"?i=ni(i):P0(i,"Point","point"),!e)throw new Error("line is required");Array.isArray(e)?e=Ce(e):e.type==="LineString"?e=ni(e):P0(e,"LineString","line");let l=1/0;const d=i.geometry.coordinates;return I0(e,f=>{if(f){const v=f.geometry.coordinates[0],m=f.geometry.coordinates[1],y=qT(d,v,m,{method:o});y<l&&(l=y)}}),nh(l,"degrees",h)}function qT(i,e,t,n){if(n.method==="geodesic")return md(Ce([e,t]).geometry,i,{units:"degrees"}).properties.pointDistance;const s=[t[0]-e[0],t[1]-e[1]],o=[i[0]-e[0],i[1]-e[1]],h=Qv(o,s);if(h<=0)return Kl(i,e,{units:"degrees"});const l=Qv(s,s);if(l<=h)return Kl(i,t,{units:"degrees"});const d=h/l,f=[e[0]+d*s[0],e[1]+d*s[1]];return Kl(i,f,{units:"degrees"})}function Qv(i,e){return i[0]*e[0]+i[1]*e[1]}function $T(i,e={}){const t=[];if(ar(i,s=>{t.push(s.coordinates)}),t.length<2)throw new Error("Must have at least 2 geometries");const n=IT(t[0],...t.slice(1));return n.length===0?null:n.length===1?de(n[0],e.properties):rd(n,e.properties)}function WT(i,e){const t=i[0],n=i[i.length-1];(t[0]!==n[0]||t[1]!==n[1]||t[2]!==n[2])&&i.push(t);const s=Xt(e),o=de([i]);return Oe(s,o)}function HT(i,e){const t=Ce(i);return ud(t,e,{units:"meters"}).geometry.coordinates}function Bd(i){if((i[0][0]!==i[i.length-1][0]||i[0][1]!==i[i.length-1][1]||i[0][2]!==i[i.length-1][2])&&i.push(i[0]),i.length<=3)return 0;const e=de([i]);return WC(e)}function XT(i){(i[0][0]!==i[i.length-1][0]||i[0][1]!==i[i.length-1][1]||i[0][2]!==i[i.length-1][2])&&i.push(i[0]);const e=de([i]),n=Gv(e).geometry.coordinates;return[n[0],n[1],n[2]??i[0][2]??0]}function zd(...i){let[e,t,n,s]=i;const[o,h,l]=e;if(Array.isArray(t)){const[d,f,v]=t,m=Math.sqrt(d*d+f*f);let y=0;m>0&&(y=Math.atan2(d,f)*(180/Math.PI),y<0&&(y+=360));const w=xn(Xt([o,h]),m,y,{units:"meters"});return!w||!w.geometry||!w.geometry.coordinates?void 0:(n=n||[0,0,0],n[0]=w.geometry.coordinates[0],n[1]=w.geometry.coordinates[1],n[2]=l+(v||0),n)}else{const d=xn(Xt([o,h]),t,n,{units:"meters"});return!d||!d.geometry||!d.geometry.coordinates?void 0:(s=s||[0,0,0],s[0]=d.geometry.coordinates[0],s[1]=d.geometry.coordinates[1],s[2]=l,s)}}function Zl(i,e){return pi(Xt(i),Xt(e),{units:"meters"})}function wh(i,e){return sh(Xt(i),Xt(e))}function YT(i,e){return or(Ce(i),Ce(e))}function JT(i,e){const t=Xt(i),n=Xt(e),s=UT(t,n),o=(i[2]+e[2])/2;return[...s.geometry.coordinates,o]}function KT(i,e){const t=Xt(e),n=Ce(i);return md(n,t,{units:"meters"})}function ZT(i,e){const t=Xt(i),n=Ce(e);return VT(t,n,{units:"meters"})}function QT(i,e,t,n){const[s,o,h]=i,l=NT(Xt([s,o]),e,t,{units:"meters"});if(!(!l||!l.geometry||!l.geometry.coordinates))return n=n||[0,0,0],n[0]=l.geometry.coordinates[0],n[1]=l.geometry.coordinates[1],n[2]=h,n}function ty(i,e){return Kl(Xt(i),Xt(e),{units:"meters"})}function tk(i,e){return UC(Xt(i),Xt(e))}function ey(i,e){(i[0][0]!==i[i.length-1][0]||i[0][1]!==i[i.length-1][1]||i[0][2]!==i[i.length-1][2])&&i.push(i[0]),(e[0][0]!==e[e.length-1][0]||e[0][1]!==e[e.length-1][1]||e[0][2]!==e[e.length-1][2])&&e.push(e[0]);const t=_h(sd([[i],[e]]));if(t)return t.geometry.coordinates}function iy(i,e){(i[0][0]!==i[i.length-1][0]||i[0][1]!==i[i.length-1][1]||i[0][2]!==i[i.length-1][2])&&i.push(i[0]),(e[0][0]!==e[e.length-1][0]||e[0][1]!==e[e.length-1][1]||e[0][2]!==e[e.length-1][2])&&e.push(e[0]);const t=$T(sd([[i],[e]]));if(t)return t.geometry.coordinates}function ny(i,e=500,t="meters"){const n=$M(Ce(i),e,{units:t});if(n)return n.geometry.coordinates}function sy(i,e){(i[0][0]!==i[i.length-1][0]||i[0][1]!==i[i.length-1][1]||i[0][2]!==i[i.length-1][2])&&i.push(i[0]),(e[0][0]!==e[e.length-1][0]||e[0][1]!==e[e.length-1][1]||e[0][2]!==e[e.length-1][2])&&e.push(e[0]);const t=kT(sd([[i],[e]]));if(t)return t.geometry.coordinates}function ry(i,e,t=10,n="meters"){return oT(i,e,{steps:t,units:n}).geometry.coordinates}function Ud(i,e){(i[0][0]!==i[i.length-1][0]||i[0][1]!==i[i.length-1][1]||i[0][2]!==i[i.length-1][2])&&i.push(i[0]),(e[0][0]!==e[e.length-1][0]||e[0][1]!==e[e.length-1][1]||e[0][2]!==e[e.length-1][2])&&e.push(e[0]);const t=de([i]),n=de([e]);return GI(t,n)?"oneBig":J0(t,n)?"twoBig":!1}function Ql(i){const e=_s(Js(i,["0"])),t=_s(Js(i,["1"])),n=_s(Js(i,["2"])),s=Yn(Js(i,["0"])),o=Yn(Js(i,["1"])),h=Yn(Js(i,["2"]));return{minPos:[e,t,n],maxPos:[s,o,h],center:[(e+s)*.5,(t+o)*.5,(n+h)*.5]}}function ay(i){const{minPos:e,maxPos:t,center:n}=Ql(i);if(e.some(l=>!Number.isFinite(l)||t.some(d=>!Number.isFinite(d))||n.some(d=>!Number.isFinite(d)))){console.warn("geoCenterAndRadiusFromPositions error: minPos.some(e => !Number.isFinite(e) || maxPos.some(e => !Number.isFinite(e)) || center.some(e => !Number.isFinite(e))");return}const s=Zl(e,t);let o=s*.5;const h=Math.abs(e[2]-t[2]);return h!=0&&(o=Math.sqrt(s*s+h*h)*.5),{center:n,radius:o}}function oy(i,e){const t=sn(i),n=sn(e);return b.Vector.distance(t,n)}function is(i,e){const t=[],n=i.length;let s=0;for(let o=0;o<n-1;++o){if(e===void 0||e==="GEODESIC"){const h=Zl(i[o],i[o+1]),l=Math.abs(i[o][2]-i[o+1][2]);if(l===0)s+=h;else{const d=Math.sqrt(h*h+l*l);s+=d}}else if(e==="RHUMB"){const h=ty(i[o],i[o+1]),l=Math.abs(i[o][2]-i[o+1][2]);if(l===0)s+=h;else{const d=Math.sqrt(h*h+l*l);s+=d}}else if(e==="NONE"){const h=oy(i[o],i[o+1]);s+=h}else console.warn(`未知的arcType: ${e},导致距离无法计算!`);t.push(s)}return t}function Vd(i){const e="__getXyzFromPostion";let t=_i(i,e);return(!t||!b.Vector.equals(t[0],i))&&(t=[[...i],sn(i)],yn(i,e,t)),t[1]}class ek{constructor(e={}){p(this,"points");p(this,"duration");p(this,"sharpness");p(this,"centers");p(this,"controls");p(this,"stepLength");p(this,"length");p(this,"delay");p(this,"steps");this.points=e.points||[],this.duration=e.duration||1e4,this.sharpness=e.sharpness||.85,this.centers=[],this.controls=[],this.stepLength=e.stepLength||60,this.length=this.points.length,this.delay=0;for(let t=0;t<this.length;t++)this.points[t].z=this.points[t].z||0;for(let t=0;t<this.length-1;t++){const n=this.points[t],s=this.points[t+1];this.centers.push({x:(n.x+s.x)/2,y:(n.y+s.y)/2,z:(n.z+s.z)/2})}this.controls.push([this.points[0],this.points[0]]);for(let t=0;t<this.centers.length-1;t++){const n=this.points[t+1].x-(this.centers[t].x+this.centers[t+1].x)/2,s=this.points[t+1].y-(this.centers[t].y+this.centers[t+1].y)/2,o=this.points[t+1].z-(this.centers[t].z+this.centers[t+1].z)/2;this.controls.push([{x:(1-this.sharpness)*this.points[t+1].x+this.sharpness*(this.centers[t].x+n),y:(1-this.sharpness)*this.points[t+1].y+this.sharpness*(this.centers[t].y+s),z:(1-this.sharpness)*this.points[t+1].z+this.sharpness*(this.centers[t].z+o)},{x:(1-this.sharpness)*this.points[t+1].x+this.sharpness*(this.centers[t+1].x+n),y:(1-this.sharpness)*this.points[t+1].y+this.sharpness*(this.centers[t+1].y+s),z:(1-this.sharpness)*this.points[t+1].z+this.sharpness*(this.centers[t+1].z+o)}])}this.controls.push([this.points[this.length-1],this.points[this.length-1]]),this.steps=this.cacheSteps(this.stepLength)}cacheSteps(e){const t=[];let n=this.pos(0);t.push(0);for(let s=0;s<this.duration;s+=10){const o=this.pos(s);Math.sqrt((o.x-n.x)*(o.x-n.x)+(o.y-n.y)*(o.y-n.y)+(o.z-n.z)*(o.z-n.z))>e&&(t.push(s),n=o)}return t}vector(e){const t=this.pos(e+10),n=this.pos(e-10);return{angle:180*Math.atan2(t.y-n.y,t.x-n.x)/3.14,speed:Math.sqrt((n.x-t.x)*(n.x-t.x)+(n.y-t.y)*(n.y-t.y)+(n.z-t.z)*(n.z-t.z))}}pos(e){let t=e-this.delay;t<0&&(t=0),t>this.duration&&(t=this.duration-1);const n=t/this.duration;if(n>=1)return this.points[this.length-1];const s=Math.floor((this.points.length-1)*n),o=(this.length-1)*n-s;return ik(o,this.points[s],this.controls[s][1],this.controls[s+1][0],this.points[s+1])}}function ik(i,e,t,n,s){const o=nk(i);return{x:s.x*o[0]+n.x*o[1]+t.x*o[2]+e.x*o[3],y:s.y*o[0]+n.y*o[1]+t.y*o[2]+e.y*o[3],z:s.z*o[0]+n.z*o[1]+t.z*o[2]+e.z*o[3]}}function nk(i){const e=i*i;return[e*i,3*e*(1-i),3*i*(1-i)*(1-i),(1-i)*(1-i)*(1-i)]}function sk(i,e){e===void 0&&(e={});var t=e.resolution||1e3,n=e.sharpness||.85;const s=[],o=i.map(f=>{const[v,m,y]=sn(f);return{x:v,y:m,z:y}});for(var h=new ek({duration:t,points:o,sharpness:n}),l=function(f){var v=h.pos(f);const m=nd([v.x,v.y,v.z]);s.push(m)},d=0;d<h.duration;d+=10)l(d);return l(h.duration),s}function Pa(i,e,t){return sk(i,{resolution:e,sharpness:t})}function tu(i){return ms(i,(e,t)=>e[0]===t[0]&&e[1]===t[1],e=>[...e])}function hy(i,e){const t=new Array;for(let n of i)t.push(e(n));return t}function eu(i,e){return i===void 0&&e===void 0?!0:!i||!e?!1:i[0]===e[0]&&i[1]===e[1]&&i[2]===e[2]}function ly(i,e,t){var s;((s=e.attachedViewers.values().toArray()[0])==null?void 0:s.getEngineObject(e))?t.call(i):requestAnimationFrame(()=>ly(i,e,t))}function rk(i,e,t,n=!0){n&&t(),i.dispose(e.disposableOn(t))}function ak(i,e){const{type:t,id:n}=i;if(t){const s=St.create(t,n);if(s)return s.json=i,s;console.warn(`cannot create sceneObject from type(${t})`)}else console.warn(`cannot create sceneObject from type(${t})`)}function uy(i){const e=i.children&&tc(i.children,n=>{if(!(n instanceof ri))throw new Error("!(treeItem instanceof SceneTreeItem)");return!n.show})||!1,t=i.sceneTree.getSceneObjectShowFunc(i.sceneObject);return!e||t}class ri extends Do{constructor(t,n=!1,s,o,h=!0){super(t,n,s);p(this,"_dragDrop");p(this,"_showChangedNotAffectChildren",!1);p(this,"_showChangedNotAffectParent",!1);p(this,"_type",this.dv(it("Unknown")));p(this,"_isExport",this.dv(it(!0)));const l=()=>this.tree&&this.tree.itemsChanged.emit([this]);this.dispose(this.nameChanged.disposableOn(l)),this.name=`未命名条目(${this.id})`,this.extras=o,this._isExport.value=h;let d;const f=()=>{d&&(d(),d=void 0)};this.dispose(f),this.dispose(this.sceneObjectChanged.disposableOn(v=>{f(),v&&(d=mt([this,"name"],[v,"name"]))})),this.dispose(this.showChanged.disposableOn(v=>{if(t.setSceneObjectShowFunc(this.sceneObject,v),this.tree&&this.tree.forceRedraw(),this.children&&!this._showChangedNotAffectChildren)for(let m of this.children)m instanceof ri&&(m._showChangedNotAffectParent=!0,m.show=v,m._showChangedNotAffectParent=!1);this.parent&&this.parent instanceof ri&&!this._showChangedNotAffectParent&&(this.parent._showChangedNotAffectChildren=!0,this.parent.show=uy(this.parent),this.parent._showChangedNotAffectChildren=!1)})),this.dv(new xe(this.sceneObjectChanged,()=>{if(!this.sceneObject)return;const v=new st;if("show"in this.sceneObject&&"showChanged"in this.sceneObject&&this.sceneObject.showChanged instanceof H){const m=()=>{this.show=t.getSceneObjectShowFunc(this.sceneObject)};m(),v.dispose(this.sceneObject.showChanged.disposableOn(m))}else if("enabled"in this.sceneObject&&"enabledChanged"in this.sceneObject&&this.sceneObject.enabledChanged instanceof H){const m=()=>{this.show=t.getSceneObjectShowFunc(this.sceneObject)};m(),v.dispose(this.sceneObject.enabledChanged.disposableOn(m))}return v})),this.childrenChangedEvent.disposableOn(()=>{const v=uy(this);this._showChangedNotAffectChildren=!0,this.show=v,this._showChangedNotAffectChildren=!1});{const v=()=>{let m="Unknown";this.sceneObject?m=this.sceneObject.typeName:this.children&&(m="Folder"),this._type.value=m};this.dispose(this.sceneObjectChanged.disposableOn(v)),this.dispose(this.childrenResetedEvent.disposableOn(v)),v()}}get dragDrop(){return this._dragDrop||(this._dragDrop=this.dv(this.sceneTree.createTreeItemDragDropFunc(this))),this._dragDrop}get type(){return this._type.value}get typeChanged(){return this._type.changed}get isExport(){return this._isExport.value}get isExportChanged(){return this._isExport.changed}set isExport(t){this._isExport.value=t}get sceneTree(){return this.tree}get jsonStr(){return JSON.stringify(this.json,void 0," ")}set jsonStr(t){try{this.json=JSON.parse(t)}catch(n){console.error(`sceneTreeItem.jsonStr error ${n}`,n)}}get completeJson(){const t=this.children&&[...this.children].filter(n=>n.isExport).map(n=>n.completeJson);return{name:this.name,show:this.show?void 0:!1,collapsed:this.uiTreeObject.collapsed?!0:void 0,sceneObj:this.sceneObject&&this.sceneObject.completeJson,children:t,extras:this.extras}}get json(){const t=this.children&&[...this.children].filter(n=>n.isExport).map(n=>n.json);return{name:this.name,show:this.show?void 0:!1,collapsed:this.uiTreeObject.collapsed?!0:void 0,sceneObj:this.sceneObject&&this.sceneObject.json,children:t,extras:this.extras}}set json(t){if(t.name!==void 0&&(this.name=t.name),this.extras=t.extras,this._showChangedNotAffectChildren=!0,this._showChangedNotAffectParent=!0,this.show=t.show??!0,this._showChangedNotAffectChildren=!1,this._showChangedNotAffectParent=!1,this.uiTreeObject.collapsed=t.collapsed??!1,this.sceneObject=void 0,t.sceneObj&&(this.sceneObject=this.sceneTree.createSceneObjectFunc(t.sceneObj,this)),!!t.children){if(this.resetChildren(!0),!this.children)throw new Error("resetChildren(true) cannot get children!");for(let n of t.children){const s=new ri(this.tree,!0);s.json=n,this.children.push(s)}}}clone(){try{const t=new ri(this.sceneTree,!!this.children,void 0,this.extras,this.isExport);return t.json=this.json,t.name=this.sceneTree.getSceneTreeItemCloneNameFunc(this),t}catch(t){console.error(`SceneTreeItem.clone error: ${t}`,t)}}insertNewTreeItem(t,n){if(t==="FolderInnerOrAfter"||t==="FolderInnerOrBefore"||t==="FolderInner"){if(n&&n.tree!==this.tree)return console.warn("newTreeItem.tree !== this.tree"),!1;if(this.children&&!(t.includes("Or")&&this.sceneObject))return n&&this.children.push(n),!0;if(t==="FolderInner")return!1;if(t==="FolderInnerOrAfter")return super.insertNewTreeItem("After",n);if(t==="FolderInnerOrBefore")return super.insertNewTreeItem("Before",n);throw new Error("should not be here!")}else return super.insertNewTreeItem(t,n)}}(i=>{i.createDefaultProps=()=>({name:"未命名条目",nameEditing:!1,sceneObject:void 0,show:!0,extras:re(void 0)})})(ri||(ri={})),ys(ri.prototype,ri.createDefaultProps);function cy(i,e,t){let{offsetY:n}=e;if(!e.target||!("clientTop"in e.target))return"none";n+=2,n+=e.target.clientTop;let s="none";return i.children?n<=t*.3?s="before":n>=t*.7?!i.uiTreeObject.collapsed&&i.children.length>0?s="inner":s="after":s="inner":n<=t*.5?s="before":s="after",s}class dy extends _m{constructor(e){super(),this._treeItem=e;const{dragStartDataManager:t}=this._treeItem.sceneTree;let n="none";const s=this.disposeVar(Cp(()=>{this._treeItem.uiTreeObject.moveToPositionMode=n,console.log(`uiTreeObject.moveToPositionMode = lastDragMode(${n});`)},200));function o(h){n!==h&&(n=h,s.restart())}this.dispose(this._dragStartEvent.disposableOn(h=>{t.data={type:"UITreeA",value:this._treeItem}})),this.dispose(this._dragOverEvent.disposableOn(h=>{if(!h.dataTransfer)return;h.preventDefault();const l=t;if(l.data&&l.data.type==="UITreeA"&&l.data.value!==void 0){const d=l.data.value,f=this._treeItem,{tree:v}=f;if(v){const m=[...v.selectedItems];~m.indexOf(d)||m.push(d);const y=cy(f,h,v.itemDivHeight);if(y!=="none"&&er.canMoveToTreeItems(m,f,y)){h.dataTransfer.dropEffect="move",o(y);return}}}h.dataTransfer.dropEffect="none",o("none")})),this.dispose(this._dropEvent.disposableOn(h=>{const l=t;if(!(l.data&&l.data.type==="UITreeA"&&l.data.value!==void 0))return;const d=l.data.value,f=this._treeItem,{tree:v}=f;if(!v)return;const m=[...v.selectedItems];~m.indexOf(d)||m.push(d);const y=cy(f,h,v.itemDivHeight);y!=="none"&&er.canMoveToTreeItems(m,f,y)&&(er.moveToTreeItems(m,f,y),l.data=void 0,o("none"))})),this.dispose(this._dragLeaveEvent.disposableOn(()=>{n="none",s.restart()}))}}function ok(i){if(!(i instanceof ri))throw new Error("defaultCreateTreeItemDragDrop !(treeItem instanceof SceneTreeItem)");return new dy(i)}function hk(i){let e=!1;return i&&("show"in i?e=i.show??!0:"enabled"in i&&(e=i.enabled??!0)),e}function lk(i,e){i&&("show"in i?i.show=e:"enabled"in i&&(i.enabled=e))}const uk=["EnvironmentVariables","ScriptsLoader","SceneScript","ScriptLoader"];function ck(i){const e=[],{root:t={}}=i,n=[t];for(;n.length>0;){const s=n.pop();if(!s)throw new Error("!todo");if(s.children){for(let o of s.children)if(o.children&&n.unshift(o),o.sceneObj){const{type:h=void 0}=o.sceneObj;h||(console.warn("sceneObjJson has no type! treeItem.sceneObj: "),console.warn(o.sceneObj)),h&&uk.includes(h)&&e.push(o.sceneObj)}}}return e}async function dk(i,e){const t=ck(i);let n=0;const s=t.length;for(let o of t)if(++n,e){const h=n/s;e(h,n,s)}}class fy extends st{constructor(t,n){super();p(this,"treeItemContexMenuCallback");this._sceneTree=t,this._projectManager=n}get sceneTree(){return this._sceneTree}}class fk extends st{constructor(t){super();p(this,"_jsonLoadingEvent",this.disposeVar(new H));p(this,"_setJsonProcessing",this.disposeVar(wi(async(t,n)=>{this._jsonLoadingEvent.emit({type:"init"}),this._jsonLoadingEvent.emit({type:"loading"}),n&&await t.promise(this._sceneTree.preloadFunc(n)),this._setJson(n),this._jsonLoadingEvent.emit({type:"loaded"})})));this._sceneTree=t,this._setJsonProcessing.errorFunc=n=>{this._jsonLoadingEvent.emit({type:"error",error:n})}}get jsonLoadingEvent(){return this._jsonLoadingEvent}_setJson(t){try{this._sceneTree.setJson(t||{})}catch(n){console.error(`json数据装配时发生错误!error: ${n}`)}}get json(){return this._sceneTree.getJson()}set json(t){this._setJsonProcessing.restart(new tn("JSON重新赋值!"),t)}get jsonStr(){return JSON.stringify(this.json,void 0," ")}set jsonStr(t){this.json=JSON.parse(t)}}function gk(i){return i.name+"_clone"}function qd(i,e,t){if(i instanceof ri)return i.insertNewTreeItem(e,t);{const n={FolderInnerOrAfter:"InnerOrAfter",FolderInnerOrBefore:"InnerOrBefore",FolderInner:"Inner",InnerOrAfter:"InnerOrAfter",InnerOrBefore:"InnerOrBefore",Inner:"Inner",After:"After",Before:"Before"};return i.insertNewTreeItem(n[e],t)}}function pk(i){[i,...i.getDescendants()].forEach(e=>e.destroy())}const vi=class vi extends er{constructor(t,n,s,o){super(s);p(this,"_jsonLoading",this.disposeVar(new fk(this)));p(this,"createSceneObjectFunc",vi.defaultCreateSceneObjectFunc);p(this,"createTreeItemDragDropFunc",vi.defaultCreateTreeItemDragDropFunc);p(this,"preloadFunc",vi.defaultPreload);p(this,"getSceneObjectShowFunc",vi.defaultGetSceneObjectShow);p(this,"setSceneObjectShowFunc",vi.defaultSetSceneObjectShow);p(this,"getSceneTreeItemCloneNameFunc",vi.defaultGetSceneTreeItemCloneNameFunc);p(this,"debug",!1);p(this,"_contextMenu",this.disposeVar(new fy(this,this.projectManager)));p(this,"_showPropUiOnSelecting",this.disposeVar(it(!0)));this._name=t,this._dragStartDataManager=n,this._projectManager=o,this.dispose(this.selectedItems.changedEvent.disposableOn(()=>{var l,d;window.lssn=this.lastSelectedItem,window.lsso=(l=this.lastSelectedItem)==null?void 0:l.sceneObject,this.debug&&console.log(((d=this.lastSelectedItem)==null?void 0:d.sceneObject)??"select null")}));const{sceneObjectsManager:h}=this._projectManager;this.dispose(this.itemsDeleted.disposableOn(l=>{for(let d of l){const f=d,{sceneObject:v}=f;v&&h.deleteSceneObject(v)&&v.destroy()&&al(v,void 0);for(let m of f.getDescendants()){const{sceneObject:y}=m;y&&h.deleteSceneObject(y)&&y.destroy()&&al(y,void 0)}pk(d)}})),this.dispose(this.itemsAdded.disposableOn(l=>{for(let d of l){const f=d;f.sceneObject&&h.addSceneObject(f.sceneObject)&&al(f.sceneObject,f)}}))}get json(){return this._jsonLoading.json}set json(t){this._jsonLoading.json=t}get jsonStr(){return this._jsonLoading.jsonStr}set jsonStr(t){this._jsonLoading.jsonStr=t}get jsonLoadingEvent(){return this._jsonLoading.jsonLoadingEvent}get name(){return this._name}get projectManager(){return this._projectManager}get contextMenu(){return this._contextMenu}get showPropUiOnSelecting(){return this._showPropUiOnSelecting.value}set showPropUiOnSelecting(t){this._showPropUiOnSelecting.value=t}get showPropUiOnSelectingChanged(){return this._showPropUiOnSelecting.changed}get sceneUiTree(){return this.uiTree}getTreeItemFromSceneObjId(t){const n=this.getDescendants();let s;for(let o of n)if(o.sceneObject&&o.sceneObject.id===t){s=o;break}return s}getTreeItemsFromSceneObjType(t){const n=this.getDescendants(),s=[],o=Array.isArray(t)?t:[t];for(let h of n)h.sceneObject&&o.includes(h.sceneObject.typeName)&&s.push(h);return s}getTreeItemsFromSceneObjName(t){var o;const n=this.getDescendants(),s=[];for(let h of n)(o=h.sceneObject)!=null&&o.name.includes(t)&&s.push(h);return s}get dragStartDataManager(){return this._dragStartDataManager}get completeJson(){return{root:{children:[...this.children].filter(t=>t.isExport).map(t=>t.completeJson)}}}getJson(){return{root:{children:[...this.children].filter(t=>t.isExport).map(t=>t.json)}}}setJson(t){var s;t.root=t.root||{};const n=t.root.children??[];this.root.resetChildren(!0);for(let o of n){const h=new ri(this,!0);h.json=o,(s=this.root.children)==null||s.push(h)}}testAddNewTreeItem(t,n){const s=t||this.lastSelectedItem||this.root;return s?qd(s,n):!1}addNewTreeItem(t,n,s,o){const h=t||this.lastSelectedItem||this.root;if(h&&qd(h,n)){const l=new ri(this,s);if(l.sceneObject=o,!qd(h,n,l))throw new Error("currentTreeItem.insertNewTreeItem return false!");return l}}createSceneObjectTreeItem(t,n,s,o){const h=o??"FolderInnerOrAfter";if(!this.testAddNewTreeItem(s,h)){console.warn(`cannot addNewTreeItem! currentTreeItem(${s?s.id:"root"})`);return}const l=St.create(t,n);return l?this.addNewTreeItem(s,o??"FolderInnerOrAfter",!0,l):void 0}createGroupTreeItem(t,n,s,o){const h=o??"FolderInnerOrAfter";if(!this.testAddNewTreeItem(s,h)){console.warn(`cannot addNewTreeItem! currentTreeItem(${s?s.id:"root"})`);return}const l=this.addNewTreeItem(s,o??"FolderInnerOrAfter",!0);if(!l){console.warn("addNewTreeItem error!");return}return l.name=t??"未命名组节点",l}createSceneObjectTreeItemFromClass(t,n,s,o){const h=o??"FolderInnerOrAfter";if(!this.testAddNewTreeItem(s,h))return;const l=St.createFromClass(t,n);return l?this.addNewTreeItem(s,h,!0,l):void 0}createSceneObjectTreeItemFromJson(t,n,s){const o=s??"FolderInnerOrAfter";if(!this.testAddNewTreeItem(n,o))return;const h=St.createFromJson(t);return console.log(h),h?this.addNewTreeItem(n,s??"FolderInnerOrAfter",!0,h):void 0}destroySceneObjectTreeItem(t){if(t===this.root){console.warn("cannot destroy root! please use function destroyAllSceneObjectTreeItems!");return}t.detachFromParent()}destroyAllSceneObjectTreeItems(){if(!this.root.children)return;const t=[...this.root.children];for(let n of t)this.destroySceneObjectTreeItem(n)}};p(vi,"defaultCreateSceneObjectFunc",ak),p(vi,"defaultCreateTreeItemDragDropFunc",ok),p(vi,"defaultPreload",dk),p(vi,"defaultGetSceneObjectShow",hk),p(vi,"defaultSetSceneObjectShow",lk),p(vi,"defaultGetSceneTreeItemCloneNameFunc",gk);let Eh=vi;const $d={saturation:.35,brightness:1.4,gamma:.8,atmosphereScatteringIntensity:5,groundColor:[0,.09411764705882353,.3137254901960784,1]};class mk extends st{constructor(t){super();p(this,"_currentPosition",this.disposeVar(Wt(void 0)));p(this,"_currentRotation",this.disposeVar(Wt(void 0)));p(this,"_currentHeading",this.disposeVar(it(void 0)));p(this,"_isRotating",this.disposeVar(it(!1)));p(this,"_isGround",this.disposeVar(it(!1)));p(this,"_startPosition",[0,0,0]);p(this,"_startRotation",[0,0,0]);p(this,"_processing",this.disposeVar(wi(async(t,n,s,o)=>{const{currentPosition:h,currentRotation:l}=this;if(!h||o<=0||!l){this._currentPosition.value=n,this._currentRotation.value=s;return}const d=this._startPosition;d.splice(0,3,...h);const f=this._startRotation;f.splice(0,3,...l);let v=Date.now();const m=wh(d,n);this._currentHeading.value=m;const w=Zl(d,n)/o,S=[s[0]-f[0],s[1]-f[1],s[2]-f[2]],T=n[2]-d[2];await t.promise(new Promise(N=>{t.disposer.dispose(Hh(async()=>{let j=Date.now()-v;j=j<0?0:j,j=j>o?o:j;const C=j*w,k=zd(d,C,m);if(this.isGround&&k){const M=await this._esviewer.getTerrainHeight([k[0],k[1]]);this._currentPosition.value=[k[0],k[1],M??0]}else k&&(k[2]+=T*(j/o)),this._currentPosition.value=k;if(this.isRotating){const[M,D,L]=S,V=j/o;this._currentRotation.value=[f[0]+M*V,f[1]+D*V,f[2]+L*V]}j===o&&(this._currentPosition.value=n,this.isRotating&&(this._currentRotation.value=s),this.isRotating=!1,this.isGround=!1,N())}))}))})));this._esviewer=t}get currentPosition(){return this._currentPosition.value}get currentPositionChanged(){return this._currentPosition.changed}get currentRotation(){return this._currentRotation.value}get currentRotationChanged(){return this._currentRotation.changed}get currentHeading(){return this._currentHeading.value}get currentHeadingChanged(){return this._currentHeading.changed}get isRotating(){return this._isRotating.value}set isRotating(t){this._isRotating.value=t}get isRotatingChanged(){return this._isRotating.changed}get isGround(){return this._isGround.value}set isGround(t){this._isGround.value=t}get isGroundChanged(){return this._isGround.changed}get processing(){return this._processing}restart(t,n,s){this._processing.restart(void 0,t,n,s)}cancel(){this._processing.cancel()}}const vk=.06,gy=1.5,py=2,my=70,vy=60;function cr(i){return Xt(i)}function Mn(i,e,t){const n=cr(i),s=xn(n,t,e,{units:"meters"}),[o,h]=Si(s);return[o,h,i[2]]}function iu(i,e){return sh(cr(i),cr(e))}function nu(i,e,t,n,s=1e3){const o=Ce([Si(xn(cr(i),s,(e+180)%360,{units:"meters"})),i,Si(xn(cr(i),s,e,{units:"meters"}))]),h=Ce([Si(xn(cr(t),s,(n+180)%360,{units:"meters"})),t,Si(xn(cr(t),s,n,{units:"meters"}))]),l=or(o,h);if(l.features.length>0){const[d,f]=Si(l.features[0]);return[d,f,(i[2]+t[2])/2]}return t}function yy(i,e,t,n){const s=(t-90+360)%360,o=(t+90+360)%360;i.leftPoints.push(Mn(e,s-my,n*gy)),i.headPoints.push(Mn(e,s-vy,n*py)),i.headPoints.push(e),i.headPoints.push(Mn(e,o+vy,n*py)),i.rightPoints.push(Mn(e,o+my,n*gy))}function yk(i,e,t,n){const s=(e-90+360)%360,o=(e+90+360)%360,h=t*vk*Math.min(.3,1-n);return{leftPoint:Mn(i,s,h),rightPoint:Mn(i,o,h),verticalLen:h}}function _k(i,e){if(!i||i.length<2)return;const t=e==="swallowTailArrow",n=i.length,s=n-1,o=Math.max(...is(i,"NONE")),h={leftPoints:[],rightPoints:[],headPoints:[]};let l;for(let w=0;w<n;w++){const S=i[w],T=w==s?i[i.length-2]:i[w+1],N=w==s?iu(T,S):iu(S,T),{leftPoint:j,rightPoint:C,verticalLen:k}=yk(S,N,o,w/n);w===0?(h.leftPoints.push(j),h.rightPoints.push(C),t&&(h.tailPoint=Mn(S,N,k))):w===s?yy(h,S,N,k):l!==void 0?(h.leftPoints.push(nu(h.leftPoints[w-1],l,j,N,o)),h.rightPoints.push(nu(h.rightPoints[w-1],l,C,N,o))):(h.leftPoints.push(j),h.rightPoints.push(C)),l=N}const d=h.leftPoints,f=h.rightPoints,v=d.length>=2?Pa(d):d,m=f.length>=2?Pa(f):f,y=[...v,...h.headPoints,...m.reverse()];return h.tailPoint&&y.push(h.tailPoint),y.push(h.leftPoints[0]),y}function wk(i,e,t,n){const s=Ce([[i[0],i[1]],[e[0],e[1]]]),o=Ce([[t[0],t[1]],[n[0],n[1]]]);return or(s,o).features.length>0}function Ek(i,e,t,n){const s=(e-90+360)%360,o=(e+90+360)%360,h=t*Math.min(.3,1-n);return{leftPoint:Mn(i,s,h),rightPoint:Mn(i,o,h),verticalLen:h}}function Sk(i,e){if(!i||i.length<3)return;const t=e==="swallowTailArrow",n=i.length,s=n-1,o=i.slice(0,2),h=Ql(o),l=is(o,"NONE").pop()??0,d=Math.max(...is(i,"NONE")),f={leftPoints:[],rightPoints:[],headPoints:[]};let v;for(let N=1;N<n;N++){const j=N===1?h.center:i[N],C=N===s?i[n-2]:i[N+1],k=N===s?iu(C,j):iu(j,C);let{leftPoint:M,rightPoint:D,verticalLen:L}=Ek(j,k,l,N/n);if(N===1)f.leftPoints.push(o[0]),f.rightPoints.push(o[1]),t&&(f.tailPoint=Mn(j,k,l));else if(N===s)yy(f,j,k,L);else if(v!==void 0){if(N===2&&wk(f.leftPoints[0],M,f.rightPoints[0],D)){const x=f.leftPoints[0];f.leftPoints[0]=f.rightPoints[0],f.rightPoints[0]=x}const V=N-2;f.leftPoints.push(nu(f.leftPoints[V],v,M,k,d)),f.rightPoints.push(nu(f.rightPoints[V],v,D,k,d))}else f.leftPoints.push(M),f.rightPoints.push(D);v=k}let m=f.leftPoints,y=f.rightPoints;const w=m.length>=2?Pa(m):m,S=y.length>=2?Pa(y):y,T=[...w,...f.headPoints,...S.reverse()];return f.tailPoint&&T.push(f.tailPoint),T.push(m[0]),T}function Wd(i,e,t=!1){return t?Sk(i,e):_k(i,e)}function _y(i){let e=0;function t(n,s){s++,e=Math.max(s,e),n.forEach(o=>{Array.isArray(o)&&t(o,s)})}return t(i,0),e}const kn=class kn extends Ht{constructor(t){super(t);p(this,"editingBindMode","lineString");p(this,"_area",this.dv(it(0)));p(this,"_perimeter",this.dv(it(0)));this.d(Me(this.pointsChanged,()=>{this._updateArea(),this._updatePerimeter()},{immediate:!0}))}updateEditing(){var n;const t=[];this.editingBindMode=="doublePoints"?t.push(dt.DoublePoints):this.editingBindMode=="lineString"?t.push(dt.LineStringAppend,dt.LineStringInsert,dt.Translation):this.editingBindMode=="circular"?(t.push(dt.CircularAppend,dt.CircularInsert,dt.Translation),this.supportEditingModes().includes(dt.HeightModify)&&t.push(dt.HeightModify)):this.editingBindMode=="visibility"?t.push(dt.VisibilityAppend,dt.VisibilityModify):this.editingBindMode=="scatter"&&t.push(dt.ScatterAppend,dt.ScatterModify),(n=this.activeViewer)==null||n.startEditing(this,t,{callSource:"inner"})}get area(){return this._area.value}get areaChanged(){return this._area.changed}get perimeter(){return this._perimeter.value}get perimeterChanged(){return this._perimeter.changed}_updateArea(){this._area.value=this.getArea()??0}_updatePerimeter(){this._perimeter.value=this.getPerimeter()??0}getArea(){if(this.points&&this.points.length>=3)return Bd([...this.points])}getDistance(){if(this.points&&this.points.length>=2){const t=is(this.points,"GEODESIC");return t[t.length-1]}else return}getPerimeter(){if(this.points&&this.points.length>=3){const t=[...this.points,this.points[0]],n=is(t,"GEODESIC");return n[n.length-1]}else return}getIntersect(t){if(this.points&&this.points.length>=3&&t.length>=3){const n=ey(this.points,t);if(!n)return;const s=n[0][0][0];if(Array.isArray(s)){const o=[...n],h=[];return o.forEach(l=>{const d=l[0].map(f=>[...f,0]);h.push(d)}),h}else return[[...n][0].map(l=>[...l,0])]}else return}getUnion(t){if(this.points&&this.points.length>=3&&t.length>=3){const n=iy(this.points,t);if(!n)return;const s=n[0][0][0];if(Array.isArray(s)){const o=[...n],h=[];return o.forEach(l=>{const d=l[0].map(f=>[...f,0]);h.push(d)}),h}else return[[...n][0].map(l=>[...l,0])]}else return}getDifference(t){if(this.points&&this.points.length>=3&&t.length>=3){let n=[...t];const s=t[0],o=t[t.length-1];s[0]===o[0]&&s[1]===o[1]&&s[2]===o[2]||n.push(s);const h=sy([...this.points,this.points[0]],[...n]);if(!h)return{status:"undefined",positions:void 0};const l=[...h];if(_y(l)===3){const d=l.map(y=>y.map(w=>[...w,0]));if(d.length<=1)return{status:"notIncluded",positions:d};const f=d[0],v=d[1];return Ud([...f],[...v])==="oneBig"?{status:"included",positions:d}:{status:"notIncluded",positions:d}}else if(_y(l)===4){const f=[...l.map(m=>m.map(y=>y.map(w=>[...w,0])))],v=[];return f.forEach(m=>{v.push(m[0])}),{status:"notIncluded",positions:v}}else return{status:"undefined",positions:void 0}}else return{status:"undefined",positions:void 0}}getBuffer(t=500,n){if(this.points&&this.points.length>=2){const s=ny(this.points,t,n);return s?[s[0].map(o=>[...o,0])]:void 0}else return}geoPolygonOverlap(t){if(this.points&&this.points.length>=3&&t.length>=3){const n=Ud(this.points,t);return n==="oneBig"?!0:n==="twoBig"?!1:void 0}else return}getESProperties(){const t={...super.getESProperties()};return{...t,defaultMenu:"style",coordinate:[...t.coordinate,new nt([this,"editing"],"编辑",!1),new ue([this,"points"],"位置数组",kn.defaults.points,void 0,!0)],style:[...t.style,new yt("点样式"),new nt([this,"pointed"],"开启",!1),new q([this,"pointSize"],"点大小",1),new xt([this,"pointSizeType"],[["screen","screen"],["world","world"]],"点类型","screen"),new jt([this,"pointColor"],"点颜色",[1,1,1,1]),new jt([this,"pointOutlineColor"],"轮廓颜色",kn.defaults.pointStyle.outlineColor),new q([this,"pointOutlineWidth"],"轮廓宽度",kn.defaults.pointStyle.outlineWidth),new yt("线样式"),new nt([this,"stroked"],"开启线样式",!0),new nt([this,"strokeGround"],"贴地",!1),new q([this,"strokeWidth"],"线宽",1),new xt([this,"strokeWidthType"],[["screen","screen"],["world","world"]],"线类型","screen"),new jt([this,"strokeColor"],"线颜色",[1,1,1,1]),new yt("面样式"),new nt([this,"filled"],"开启",!1),new nt([this,"fillGround"],"贴地",!1),new jt([this,"fillColor"],"填充颜色",[1,1,1,1])],more:[...t.more,new yt("点样式集合"),new Tt([this,"pointMaterial"],"点材质"),new Mt([this,"pointMaterialParams"],"点材质参数",{}),new yt("线样式集合"),new Tt([this,"strokeMaterial"],"线材质"),new Mt([this,"strokeMaterialParams"],"线材质参数",{}),new yt("面样式集合"),new Tt([this,"fillMaterial"],"面材质"),new Mt([this,"fillMaterialParams"],"面材质参数",{})]}}get pointSize(){return this.pointStyle.size}set pointSize(t){this.pointStyle={...this.pointStyle,size:t}}get pointSizeChanged(){return this.pointStyleChanged}get pointSizeType(){return this.pointStyle.sizeType}set pointSizeType(t){this.pointStyle={...this.pointStyle,sizeType:t}}get pointSizeTypeChanged(){return this.pointStyleChanged}get pointColor(){return this.pointStyle.color}set pointColor(t){this.pointStyle={...this.pointStyle,color:[...t]}}get pointColorChanged(){return this.pointStyleChanged}get pointOutlineColor(){return this.pointStyle.outlineColor}set pointOutlineColor(t){this.pointStyle={...this.pointStyle,outlineColor:[...t]}}get pointOutlineColorChanged(){return this.pointStyleChanged}get pointOutlineWidth(){return this.pointStyle.outlineWidth}set pointOutlineWidth(t){this.pointStyle={...this.pointStyle,outlineWidth:t}}get pointOutlineWidthChanged(){return this.pointStyleChanged}get pointMaterial(){return this.pointStyle.material}set pointMaterial(t){this.pointStyle={...this.pointStyle,material:t}}get pointMaterialChanged(){return this.pointStyleChanged}get pointMaterialParams(){return this.pointStyle.materialParams}set pointMaterialParams(t){this.pointStyle={...this.pointStyle,materialParams:t}}get pointMaterialParamsChanged(){return this.pointStyleChanged}get strokeWidth(){return this.strokeStyle.width}set strokeWidth(t){this.strokeStyle={...this.strokeStyle,width:t}}get strokeWidthChanged(){return this.strokeStyleChanged}get strokeWidthType(){return this.strokeStyle.widthType}set strokeWidthType(t){this.strokeStyle={...this.strokeStyle,widthType:t}}get strokeWidthTypeChanged(){return this.strokeStyleChanged}get strokeColor(){return this.strokeStyle.color}set strokeColor(t){this.strokeStyle={...this.strokeStyle,color:[...t]}}get strokeColorChanged(){return this.strokeStyleChanged}get strokeMaterial(){return this.strokeStyle.material}set strokeMaterial(t){this.strokeStyle={...this.strokeStyle,material:t}}get strokeMaterialChanged(){return this.strokeStyleChanged}get strokeMaterialParams(){return this.strokeStyle.materialParams}set strokeMaterialParams(t){this.strokeStyle={...this.strokeStyle,materialParams:t}}get strokeMaterialParamsChanged(){return this.strokeStyleChanged}get strokeGround(){return this.strokeStyle.ground}set strokeGround(t){this.strokeStyle={...this.strokeStyle,ground:t}}get strokeGroundChanged(){return this.strokeStyleChanged}get fillColor(){return this.fillStyle.color}set fillColor(t){this.fillStyle={...this.fillStyle,color:[...t]}}get fillColorChanged(){return this.fillStyleChanged}get fillMaterial(){return this.fillStyle.material}set fillMaterial(t){this.fillStyle={...this.fillStyle,material:t}}get fillMaterialChanged(){return this.fillStyleChanged}get fillMaterialParams(){return this.fillStyle.materialParams}set fillMaterialParams(t){this.fillStyle={...this.fillStyle,materialParams:t}}get fillMaterialParamsChanged(){return this.fillStyleChanged}get fillGround(){return this.fillStyle.ground}set fillGround(t){this.fillStyle={...this.fillStyle,ground:t}}get fillGroundChanged(){return this.fillStyleChanged}};p(kn,"createDefaultProps",()=>({...Ht.createDefaultProps(),pointed:!1,pointStyle:At({size:10,sizeType:"screen",color:[1,1,1,1],material:"",materialParams:{},outlineColor:[1,0,0,1],outlineWidth:2}),stroked:!1,strokeStyle:At({width:1,widthType:"screen",color:[1,1,1,1],material:"",materialParams:{},ground:!1}),filled:!1,fillStyle:At({color:[1,1,1,1],material:"",materialParams:{},ground:!1}),points:vs([])})),p(kn,"type",kn.register("ESGeoVector",kn,{chsName:"地理矢量",tags:["ESObjects","base"],description:"地理矢量"})),p(kn,"supportEditingModes",[...Ht.supportEditingModes,dt.Translation]);let Rt=kn;const mr=class mr extends Ht{constructor(){super(...arguments);p(this,"_statusDis",this.dv(it(!0)));p(this,"_smoothMoveEvent",this.dv(new H));p(this,"_smoothMoveWithRotationEvent",this.dv(new H));p(this,"_smoothMoveOnGroundEvent",this.dv(new H));p(this,"_smoothMoveWithRotationOnGroundEvent",this.dv(new H));p(this,"_automaticLandingEvent",this.dv(new H));p(this,"_smoothMoveKeepPitchEvent",this.dv(new H));p(this,"_smoothMoveRelativelyEvent",this.dv(new H));p(this,"_smoothMoveRelativelyWithRotationEvent",this.dv(new H));p(this,"useCalcFlyToParamInESObjectWithLocation",!0)}updateEditing(){var n;const t=[];this.editingBindMode=="singlePoint"?(t.push(dt.SinglePoint),["ESLocationMeasurement"].includes(this.typeName)||t.push(dt.Rotation),["ESClippingPlane","ESLocationMeasurement","ESLocalRectangle","ESBoxClipping"].includes(this.typeName)||t.push(dt.Scale)):this.editingBindMode=="doublePoints"&&t.push(dt.DoublePoints),(n=this.activeViewer)==null||n.startEditing(this,t,{callSource:"inner"})}get statusDis(){return this._statusDis.value}get statusDisChanged(){return this._statusDis.changed}get smoothMoveEvent(){return this._smoothMoveEvent}smoothMove(t,n){this._smoothMoveEvent.emit(t,n)}get smoothMoveWithRotationEvent(){return this._smoothMoveWithRotationEvent}smoothMoveWithRotation(t,n,s){this._smoothMoveWithRotationEvent.emit(t,n,s)}get smoothMoveOnGroundEvent(){return this._smoothMoveOnGroundEvent}smoothMoveOnGround(t,n,s,o){this._smoothMoveOnGroundEvent.emit(t,n,s,o)}get smoothMoveWithRotationOnGroundEvent(){return this._smoothMoveWithRotationOnGroundEvent}smoothMoveWithRotationOnGround(t,n,s,o,h){this._smoothMoveWithRotationOnGroundEvent.emit(t,n,s,o,h)}get automaticLandingEvent(){return this._automaticLandingEvent}automaticLanding(){const t=this.collision;this.collision=!1,setTimeout(()=>{this._automaticLandingEvent.emit(t)},100)}get smoothMoveKeepPitchEvent(){return this._smoothMoveKeepPitchEvent}smoothMoveKeepPitch(t,n){this._smoothMoveKeepPitchEvent.emit(t,n)}get smoothMoveRelativelyEvent(){return this._smoothMoveRelativelyEvent}smoothMoveRelatively(t,n){this._smoothMoveRelativelyEvent.emit(t,n)}get smoothMoveRelativelyWithRotationEvent(){return this._smoothMoveRelativelyWithRotationEvent}smoothMoveRelativelyWithRotation(t,n,s){this._smoothMoveRelativelyWithRotationEvent.emit(t,n,s)}getESProperties(){const t={...super.getESProperties()},n=[...t.location,new nt([this,"editing"],"是否编辑"),new kt("自动落地",this.automaticLanding.bind(this),[]),new en([this,"position"],"位置数组",[0,0,0]),new ra([this,"rotation"],"姿态数组",[0,0,0]),new Te([this,"scale"],"缩放",[1,1,1]),new q([this,"minVisibleDistance"],"最小可见距离",0),new q([this,"maxVisibleDistance"],"最大可见距离",0)];return["ESHuman","ESGltfModel","ESFountainParticleSystem","ESHumanFountain"].includes(this.typeName)&&n.push(new Te([this,"positionOffset"],"位置偏移",[0,0,0])),{...t,defaultMenu:"basic",location:n,more:[...t.more,new kt("平滑移动",this.smoothMove.bind(this),[[0,0,0],0]),new kt("固定方向平滑移动",this.smoothMoveKeepPitch.bind(this),[[0,0,0],0]),new kt("平滑偏移",this.smoothMoveWithRotation.bind(this),[[0,0,0],[0,0,0],0]),new kt("贴地平滑移动",this.smoothMoveOnGround.bind(this),[0,0,0,""]),new kt("贴地平滑偏移",this.smoothMoveWithRotationOnGround.bind(this),[[0,0,0],0,0,0,""]),new kt("相对平滑移动",this.smoothMoveRelatively.bind(this),[[0,0,0],0]),new kt("相对平滑偏移",this.smoothMoveRelativelyWithRotation.bind(this),[[0,0,0],[0,0,0],0]),new nt([this,"enableVisibleDistance"],"是否应用距离显隐")]}}get pointSize(){return this.pointStyle.size}set pointSize(t){this.pointStyle={...this.pointStyle,size:t}}get pointSizeChanged(){return this.pointStyleChanged}get pointSizeType(){return this.pointStyle.sizeType}set pointSizeType(t){this.pointStyle={...this.pointStyle,sizeType:t}}get pointSizeTypeChanged(){return this.pointStyleChanged}get pointColor(){return this.pointStyle.color}set pointColor(t){this.pointStyle={...this.pointStyle,color:[...t]}}get pointColorChanged(){return this.pointStyleChanged}get pointMaterial(){return this.pointStyle.material}set pointMaterial(t){this.pointStyle={...this.pointStyle,material:t}}get pointMaterialChanged(){return this.pointStyleChanged}get pointMaterialParams(){return this.pointStyle.materialParams}set pointMaterialParams(t){this.pointStyle={...this.pointStyle,materialParams:t}}get pointMaterialParamsChanged(){return this.pointStyleChanged}};p(mr,"createDefaultProps",()=>({...Ht.createDefaultProps(),pointed:!1,pointStyle:At({size:1,sizeType:"screen",color:[1,1,1,1],material:"",materialParams:{},outlineColor:[1,0,0,1],outlineWidth:2}),position:vt([0,0,0]),rotation:vt([0,0,0]),positionOffset:vt([0,0,0]),scale:vt([1,1,1]),minVisibleDistance:it(0),maxVisibleDistance:it(0)})),p(mr,"type",mr.register("ESObjectWithLocation",mr,{chsName:"对象位置",tags:["ESObjects","base"],description:"对象位置"})),p(mr,"supportEditingModes",[...Ht.supportEditingModes,dt.SinglePoint,dt.Place,dt.Translation,dt.Rotation,dt.Scale,dt.DoublePoints,dt.DoublePointsAppend,dt.DoublePointsModify]);let bt=mr;const Na=class Na extends bt{getESProperties(){const e={...super.getESProperties()};return{...e,style:[...e.style,new yt("点样式集合"),new nt([this,"pointed"],"开启点样式",!1),new q([this,"pointSize"],"点大小",1),new xt([this,"pointSizeType"],[["screen","screen"],["world","world"]],"点类型","screen"),new jt([this,"pointColor"],"点颜色",[1,1,1,1]),new yt("线样式集合"),new nt([this,"stroked"],"开启线样式",!1),new nt([this,"strokeGround"],"是否贴地(线)",!1),new q([this,"strokeWidth"],"线宽",1),new xt([this,"strokeWidthType"],[["screen","screen"],["world","world"]],"线类型","screen"),new jt([this,"strokeColor"],"线颜色",[1,1,1,1]),new yt("面样式集合"),new nt([this,"filled"],"开启填充样式",!1),new nt([this,"fillGround"],"是否贴地",!1),new jt([this,"fillColor"],"填充颜色",[1,1,1,1])],more:[...e.more,new yt("点样式"),new Tt([this,"pointMaterial"],"点材质",""),new Mt([this,"pointMaterialParams"],"点材质参数",{}),new yt("线样式"),new Tt([this,"strokeMaterial"],"线材质",""),new Mt([this,"strokeMaterialParams"],"线材质参数",{}),new yt("填充样式"),new Tt([this,"fillMaterial"],"面材质",""),new Mt([this,"fillMaterialParams"],"面材质参数",{})]}}get strokeWidth(){return this.strokeStyle.width}set strokeWidth(e){this.strokeStyle={...this.strokeStyle,width:e}}get strokeWidthChanged(){return this.strokeStyleChanged}get strokeWidthType(){return this.strokeStyle.widthType}set strokeWidthType(e){this.strokeStyle={...this.strokeStyle,widthType:e}}get strokeWidthTypeChanged(){return this.strokeStyleChanged}get strokeColor(){return this.strokeStyle.color}set strokeColor(e){this.strokeStyle={...this.strokeStyle,color:[...e]}}get strokeColorChanged(){return this.strokeStyleChanged}get strokeMaterial(){return this.strokeStyle.material}set strokeMaterial(e){this.strokeStyle={...this.strokeStyle,material:e}}get strokeMaterialChanged(){return this.strokeStyleChanged}get strokeMaterialParams(){return this.strokeStyle.materialParams}set strokeMaterialParams(e){this.strokeStyle={...this.strokeStyle,materialParams:e}}get strokeMaterialParamsChanged(){return this.strokeStyleChanged}get strokeGround(){return this.strokeStyle.ground}set strokeGround(e){this.strokeStyle={...this.strokeStyle,ground:e}}get strokeGroundChanged(){return this.strokeStyleChanged}get fillColor(){return this.fillStyle.color}set fillColor(e){this.fillStyle={...this.fillStyle,color:[...e]}}get fillColorChanged(){return this.fillStyleChanged}get fillMaterial(){return this.fillStyle.material}set fillMaterial(e){this.fillStyle={...this.fillStyle,material:e}}get fillMaterialChanged(){return this.fillStyleChanged}get fillMaterialParams(){return this.fillStyle.materialParams}set fillMaterialParams(e){this.fillStyle={...this.fillStyle,materialParams:e}}get fillMaterialParamsChanged(){return this.fillStyleChanged}get fillGround(){return this.fillStyle.ground}set fillGround(e){this.fillStyle={...this.fillStyle,ground:e}}get fillGroundChanged(){return this.fillStyleChanged}};p(Na,"createDefaultProps",()=>({...bt.createDefaultProps(),pointed:!1,pointStyle:At({size:1,sizeType:"screen",color:[1,1,1,1],material:"",materialParams:{},outlineColor:[1,0,0,1],outlineWidth:1}),stroked:!1,strokeStyle:At({width:1,widthType:"screen",color:[1,1,1,1],material:"",materialParams:{},ground:!1}),filled:!1,fillStyle:At({color:[1,1,1,1],material:"",materialParams:{},ground:!1})})),p(Na,"type",Na.register("ESLocalVector",Na,{chsName:"本地矢量",tags:["ESObjects","base"],description:"本地矢量对象"}));let Ns=Na;const kh=class kh extends Ns{};p(kh,"type",kh.register("ESLocalVector2D",kh,{chsName:"本地矢量2D",tags:["ESObjects","base"],description:"本地矢量2D对象"}));let an=kh;const xk=[["固定朝向",0],["面向屏幕旋转",1],["绕自身Z轴旋转",2]],bk=[["单面不透明",0],["双面不透明",1],["单面遮罩",2],["双面遮罩",3],["单面透明",4],["双面透明",5],["单面未遮挡透明",6],["双面未遮挡透明",7]],Ra=class Ra extends bt{constructor(){super(...arguments);p(this,"_widgetEvent",this.dv(new H))}get widgetEvent(){return this._widgetEvent}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new nt([this,"screenRender"],"屏幕渲染",!0),new nt([this,"sizeByContent"],"尺寸自适应",!0),new ge([this,"size"],"尺寸大小",[100,100]),new ge([this,"anchor"],"偏移比例",[.5,1]),new ge([this,"offset"],"像素偏移",[0,0]),new xt([this,"renderMode"],bk,"渲染模式",0),new xt([this,"rotationType"],xk,"漫游旋转类型",1),new Tt([this,"actorTag"],"绑定对象"),new Tt([this,"socketName"],"插槽名称"),new Te([this,"positionOffset"],"位置偏移"),new Te([this,"rotationOffset"],"相对姿态")],more:[...t.more,new q([this,"zOrder"],"排序",0)]}}};p(Ra,"createDefaultProps",()=>({...bt.createDefaultProps(),screenRender:!0,size:vt([100,100]),anchor:vt([.5,1]),offset:vt([0,0]),sizeByContent:!0,renderMode:0,rotationType:1,zOrder:0,actorTag:"",socketName:"",positionOffset:vt([0,0,0]),rotationOffset:vt([0,0,0])})),p(Ra,"type",Ra.register("ESLabel",Ra,{chsName:"标签",tags:["ESObjects","base"],description:"标签对象"}));let xi=Ra;const _e=class _e extends St{constructor(t){super(t);p(this,"_testEvent",this.dv(new H))}get testEvent(){return this._testEvent}func(t,n=!0){t.includes("completeJson")&&console.log("ESTestObject.completeJson",this.completeJson),t.includes("json")&&console.log("ESTestObject.json",this.json),n&&console.log("ESTestObject func"),this._testEvent.emit(t,n)}func1(t,n){t.includes("completeJson")&&console.log("ESTestObject.completeJson",this.completeJson),t.includes("json")&&console.log("ESTestObject.json",this.json),n&&console.log("ESTestObject func"),this._testEvent.emit(t,n)}getPadding(){return this.padding}getESProperties(){return{defaultMenu:"basic",basic:[new Tt([this,"typeName"],"类型",void 0,!1,!0),new Tt([this,"id"],"id",void 0,!1,!0),new Tt([this,"name"],"名称"),new Tt([this,"ref"],"引用",void 0,!0),new Mt([this,"extras"],"扩展属性",{},void 0,!0),new Tc("JSON",()=>this._jsonStr,t=>t&&(this._jsonStr=t))],general:[new nt([this,"show"],"是否显示",_e.defaults.show),new jt([this,"color"],"颜色",_e.defaults.color),new xt([this,"paramType"],[["screen","screen"],["world","world"]],"参数类型",_e.defaults.paramType),new Lo([this,"text"],"内容",_e.defaults.text)],dataSource:[new Ei([this,"startTime"],"开始时间",_e.defaults.startTime),new Ai([this,"code"],"js代码",_e.defaults.code),new Mc([this,"times"],"时间组",_e.defaults.times),new Tt([this,"url"],"服务地址",_e.defaults.url),new kt("func",this.func.bind(this),[["completeJson","json"]]),new kt("func1",(t,n)=>this.func1(t,n),[["completeJson","json"],!0])],location:[new Te([this,"positionOffset"],"位置偏移",_e.defaults.positionOffset),new en([this,"position"],"位置数组",_e.defaults.position),new ra([this,"rotation"],"姿态数组",_e.defaults.rotation)],coordinate:[new q([this,"height"],"高度(m)",_e.defaults.height),new ue([this,"points"],"位置数组",_e.defaults.points)],style:[new ui([this,"padding"],"内边距",_e.defaults.padding),new ge([this,"offset"],"像素偏移",_e.defaults.offset),new yt("样式"),new rl([this,"dashPattern"],"虚线图案",255),new yt("样式2"),new jt([this,"color"],"颜色",_e.defaults.color),new Mt([this,"strokeStyle"],"线样式参数",_e.defaults.strokeStyle)],more:[]}}};p(_e,"createDefaultProps",()=>({...St.createDefaultProps(),show:!0,url:"http://localhost:8080/earthsdk3/earthsdk3.gltf",height:100,position:vt([116.39,39.9,100]),rotation:vt([0,-90,0]),points:vs([]),color:vt([1,0,0,1]),strokeStyle:At({width:1,widthType:"screen",color:[1,1,1,1],material:"",materialParams:{},ground:!1}),paramType:"screen",text:"默认",code:'console.log("hello world")',dashPattern:255,startTime:Date.now(),times:vt([]),offset:vt([10,0]),positionOffset:vt([0,2,0]),padding:vt([0,2,0,2])})),p(_e,"type",_e.register("ESTestObject",_e,{chsName:"测试对象",tags:["ESObjects","base"],description:'ESTestObject 是 earthsdk3 场景对象的规范示例(测试对象),用于演示对象的标准写法:规范的注册元数据、带 JSDoc 的响应式属性、带 JSDoc 的方法、以及业务事件的声明模式。对象json示例: { "id": "test_xxx", "type": "ESTestObject", "name": "测试对象", "show": true, "position": [116.39, 39.9, 100], "url": "http://localhost:8080/earthsdk3/earthsdk3.gltf" }'}));let Hd=_e;const On=class On extends Ht{constructor(t){super(t);p(this,"_refreshTilesetEvent",this.dv(new H));p(this,"_tilesetReadyEvent",this.dv(new H));p(this,"_supportEdit",this.dv(it(!0)));p(this,"_highlightFeatureEvent",this.dv(new H));p(this,"_highlightFeatureAndFlyToEvent",this.dv(new H));p(this,"_strokeFeatureEvent",this.disposeVar(new H));p(this,"_getFeatureTableEvent",this.dv(new H));p(this,"_featureTableResultEvent",this.dv(new H));p(this,"_getMaterialNameListEvent",this.disposeVar(new H));p(this,"_setFeatureStyleEvent",this.dv(new H));p(this,"_setFeatureColorEvent",this.dv(new H));p(this,"_setFeatureVisableEvent",this.dv(new H));p(this,"_resetFeatureStyleEvent",this.dv(new H));p(this,"setMaterialInfoEvent",this.ad(new H));p(this,"_setMaterialEvent",this.disposeVar(new H));p(this,"_clippingPlanesId",this.dv(it("")));p(this,"_clippingPlaneIds",this.dv(it([])));p(this,"_flattenedPlaneId",this.dv(it("")));p(this,"_flattenedPlaneEnabled",this.dv(it(!1)));p(this,"_clippingPlaneId",this.dv(it("")));p(this,"_excavateId",this.dv(vt([])))}updateEditing(){var t;(t=this.activeViewer)==null||t.startEditing(this,[dt.Translation,dt.Rotation],{callSource:"inner"})}get refreshTilesetEvent(){return this._refreshTilesetEvent}refreshTileset(){this._refreshTilesetEvent.emit()}get tilesetReady(){return this._tilesetReadyEvent}get supportEdit(){return this._supportEdit.value}set supportEdit(t){this._supportEdit.value=t}get supportEditChanged(){return this._supportEdit.changed}get highlightFeatureEvent(){return this._highlightFeatureEvent}highlightFeature(t,n){this._highlightFeatureEvent.emit(t,n)}get highlightFeatureAndFlyToEvent(){return this._highlightFeatureAndFlyToEvent}highlightFeatureAndFlyTo(t,n,s,o){this._highlightFeatureAndFlyToEvent.emit(t,n,s,o)}get strokeFeatureEvent(){return this._strokeFeatureEvent}strokeFeature(t,n=[1,0,0,1]){this._strokeFeatureEvent.emit(t,n)}get getFeatureTableEvent(){return this._getFeatureTableEvent}getFeatureTable(){return Promise.race([new Promise(t=>{const n=this.d(this._featureTableResultEvent.donce(t));this._getFeatureTableEvent.emit(),setTimeout(()=>{n(),t(void 0)},2e3)})])}get getMaterialNameListEvent(){return this._getMaterialNameListEvent}getMaterialNameList(){return new Promise(t=>{const n=new st;n.d(this.getMaterialNameListEvent.don(s=>{s!=="start"&&(n.destroy(),t(s))})),this.getMaterialNameListEvent.emit("start"),setTimeout(()=>{n.isDestroyed()||(n.destroy(),t(void 0))},2e3)})}get setFeatureStyleEvent(){return this._setFeatureStyleEvent}setFeatureStyle(t,n=!1){this._setFeatureStyleEvent.emit(t,n)}get setFeatureColorEvent(){return this._setFeatureColorEvent}setFeatureColor(t,n,s=!1){this._setFeatureColorEvent.emit(t,typeof n=="string"?JSON.parse(n):n,s)}get setFeatureVisableEvent(){return this._setFeatureVisableEvent}setFeatureVisable(t,n,s=!1){this._setFeatureVisableEvent.emit(t,typeof n=="string"?JSON.parse(n):n,s)}get resetFeatureStyleEvent(){return this._resetFeatureStyleEvent}resetFeatureStyle(t){this._resetFeatureStyleEvent.emit(t)}get setMaterialEvent(){return this._setMaterialEvent}setMaterial(t){return new Promise(n=>{const s=new st;s.ad(this.setMaterialInfoEvent.donce(o=>{s.destroy(),n(o)})),this._setMaterialEvent.emit(t)})}get clippingPlanesId(){return this._clippingPlanesId.value}set clippingPlanesId(t){this._clippingPlanesId.value=t}get clippingPlanesIdChanged(){return this._clippingPlanesId.changed}get clippingPlaneIds(){return this._clippingPlaneIds.value}set clippingPlaneIds(t){this._clippingPlaneIds.value=t}get clippingPlaneIdsChanged(){return this._clippingPlaneIds.changed}get flattenedPlaneId(){return this._flattenedPlaneId.value}set flattenedPlaneId(t){this._flattenedPlaneId.value=t}get flattenedPlaneIdChanged(){return this._flattenedPlaneId.changed}get flattenedPlaneEnabled(){return this._flattenedPlaneEnabled.value}set flattenedPlaneEnabled(t){this._flattenedPlaneEnabled.value=t}get flattenedPlaneEnabledChanged(){return this._flattenedPlaneEnabled.changed}get clippingPlaneId(){return this._clippingPlaneId.value}set clippingPlaneId(t){this._clippingPlaneId.value=t}get clippingPlaneIdChanged(){return this._clippingPlaneId.changed}get excavateId(){return this._excavateId.value}set excavateId(t){this._excavateId.value=t}get excavateIdChanged(){return this._excavateId.changed}setLight122(){this.czmEnvironmentMapManager={...$d}}getESProperties(){const t={...super.getESProperties()};return{...t,defaultMenu:"dataSource",basic:[...t.basic,new ke([this,"maximumScreenSpaceError"],1,[0,256],"精度",16),new xt([this,"materialMode"],[["常规","normal"],["科技感","technology"]],"材质模式","normal",!0),new xt([this,"colorBlendMode"],[["默认","HIGHLIGHT"],["替换","REPLACE"],["混合","MIX"]],"颜色模式","HIGHLIGHT"),new Mt([this,"materialOverrideMap"],"材质替换",On.defaults.materialOverrideMap)],dataSource:[...t.dataSource,new Mt([this,"url"],"服务地址",On.defaults.url,void 0,!0)],coordinate:[...t.coordinate,new nt([this,"editing"],"编辑",!1,!0),new Te([this,"offset"],"偏移",[0,0,0],!0),new ra([this,"rotation"],"旋转",[0,0,0])],more:[...t.more,new Mt([this,"materialParams"],"materialParams",On.defaults.materialParams),new kt("高亮要素",this.highlightFeature.bind(this),["id_value","rgba(255,0,0,1)"],"highlightFeature"),new kt("高亮并且定位到要素",this.highlightFeatureAndFlyTo.bind(this),["id_value",[1116.39,39.9,100,1e3],"rgba(255,0,0,1)",1],"highlightFeatureAndFlyTo"),new kt("要素着色控制",this.setFeatureColor.bind(this),["height",[{minValue:1e5,color:[1,0,0,1]},{maxValue:5e5,color:[1,1,0,1]}]],"setFeatureColor"),new kt("要素可见性控制",this.setFeatureVisable.bind(this),["height",[{minValue:1e5,visable:!0},{maxValue:5e5,visable:!1}]],"setFeatureVisable"),new kt("重置样式",()=>this.resetFeatureStyle(),[],"resetFeatureStyle"),new yt("ue"),new kt("刷新 tileset",()=>this.refreshTileset(),[],"refreshTileset"),new Tt([this,"actorTag"]),new nt([this,"highlight"],"是否高亮"),new jt([this,"highlightColor"]),new q([this,"highlightID"]),new yt("czm"),new ge([this,"czmImageBasedLightingFactor"],"反射强度"),new q([this,"czmAtmosphereScatteringIntensity"],"大气散射强度"),new Mt([this,"czmEnvironmentMapManager"],"动态环境贴图管理器"),new q([this,"czmMaximumMemoryUsage"],"最大内存"),new yt("常用"),new xt([this,"czmClassificationType"],[["NONE","NONE"],["TERRAIN","TERRAIN"],["CESIUM_3D_TILE","CESIUM_3D_TILE"],["BOTH","BOTH"]],"czmClassificationType","NONE",!0),new Mt([this,"czmStyleJson"],"czmStyle"),new nt([this,"czmBackFaceCulling"]),new nt([this,"czmSkipLevelOfDetail"]),new nt([this,"czmDebugWireframe"]),new q([this,"cacheBytes"],"最大缓存",536870912),new yt("调试信息"),new nt([this,"czmDebugShowBoundingVolume"]),new nt([this,"czmDebugShowContentBoundingVolume"]),new yt("裁剪"),new nt([this,"clippingPlaneEnabled"]),new nt([this,"unionClippingRegions"]),new jt([this,"clippingPlaneEdgeColor"]),new q([this,"clippingPlaneEdgeWidth"])]}}};p(On,"createDefaultProps",()=>({...Ht.createDefaultProps(),url:"",actorTag:"",materialMode:"normal",highlight:!1,maximumScreenSpaceError:16,highlightID:0,highlightColor:vt([1,0,0,1]),offset:Wt([0,0,0]),rotation:vt([0,0,0]),czmImageBasedLightingFactor:vt([1,1]),czmEnvironmentMapManager:re(void 0),czmLuminanceAtZenith:2,czmAtmosphereScatteringIntensity:2,czmMaximumMemoryUsage:512,czmClassificationType:"NONE",czmStyleJson:At({}),czmBackFaceCulling:!0,czmDebugShowBoundingVolume:!1,czmDebugShowContentBoundingVolume:!1,czmSkipLevelOfDetail:!1,cacheBytes:536870912,colorBlendMode:"HIGHLIGHT",clippingPlaneEnabled:!0,unionClippingRegions:!0,clippingPlaneEdgeColor:vt([1,1,1,1]),clippingPlaneEdgeWidth:2,materialParams:{baseColor:[0,.5,1]},allowPicking:!0,materialOverrideMap:re({}),featureIdLabel:0,splitDirection:"NONE",czmDebugWireframe:!1})),p(On,"type",On.register("ES3DTileset",On,{chsName:"3DTileset",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:`ES3DTileset 是 EarthSDK3 中用于管理和加载 3D Tiles 数据的核心可视化对象。
|
|
50
|
+
`)}return c.toString()}},{key:"computeEdgeEndLabels",value:function(c){for(var r=this.iterator();r.hasNext();)r.next().computeLabel(c)}},{key:"computeLabelling",value:function(c){this.computeEdgeEndLabels(c[0].getBoundaryNodeRule()),this.propagateSideLabels(0),this.propagateSideLabels(1);for(var r=[!1,!1],a=this.iterator();a.hasNext();)for(var u=a.next().getLabel(),g=0;g<2;g++)u.isLine(g)&&u.getLocation(g)===A.BOUNDARY&&(r[g]=!0);for(var _=this.iterator();_.hasNext();)for(var E=_.next(),P=E.getLabel(),O=0;O<2;O++)if(P.isAnyNull(O)){var B=A.NONE;if(r[O])B=A.EXTERIOR;else{var Z=E.getCoordinate();B=this.getLocation(O,Z,c)}P.setAllLocationsIfNull(O,B)}}},{key:"getDegree",value:function(){return this._edgeMap.size()}},{key:"insertEdgeEnd",value:function(c,r){this._edgeMap.put(c,r),this._edgeList=null}}],[{key:"constructor_",value:function(){this._edgeMap=new jh,this._edgeList=null,this._ptInAreaLocation=[A.NONE,A.NONE]}}])})(),XN=(function(c){function r(){var a;return s(this,r),a=n(this,r),r.constructor_.apply(a,arguments),a}return m(r,c),l(r,[{key:"linkResultDirectedEdges",value:function(){this.getResultAreaEdges();for(var a=null,u=null,g=this._SCANNING_FOR_INCOMING,_=0;_<this._resultAreaEdgeList.size();_++){var E=this._resultAreaEdgeList.get(_),P=E.getSym();if(E.getLabel().isArea())switch(a===null&&E.isInResult()&&(a=E),g){case this._SCANNING_FOR_INCOMING:if(!P.isInResult())continue;u=P,g=this._LINKING_TO_OUTGOING;break;case this._LINKING_TO_OUTGOING:if(!E.isInResult())continue;u.setNext(E),g=this._SCANNING_FOR_INCOMING}}if(g===this._LINKING_TO_OUTGOING){if(a===null)throw new fs("no outgoing dirEdge found",this.getCoordinate());ct.isTrue(a.isInResult(),"unable to link last incoming dirEdge"),u.setNext(a)}}},{key:"insert",value:function(a){var u=a;this.insertEdgeEnd(u,u)}},{key:"getRightmostEdge",value:function(){var a=this.getEdges(),u=a.size();if(u<1)return null;var g=a.get(0);if(u===1)return g;var _=a.get(u-1),E=g.getQuadrant(),P=_.getQuadrant();return li.isNorthern(E)&&li.isNorthern(P)?g:li.isNorthern(E)||li.isNorthern(P)?g.getDy()!==0?g:_.getDy()!==0?_:(ct.shouldNeverReachHere("found two horizontal edges incident on node"),null):_}},{key:"print",value:function(a){Yi.out.println("DirectedEdgeStar: "+this.getCoordinate());for(var u=this.iterator();u.hasNext();){var g=u.next();a.print("out "),g.print(a),a.println(),a.print("in "),g.getSym().print(a),a.println()}}},{key:"getResultAreaEdges",value:function(){if(this._resultAreaEdgeList!==null)return this._resultAreaEdgeList;this._resultAreaEdgeList=new Gt;for(var a=this.iterator();a.hasNext();){var u=a.next();(u.isInResult()||u.getSym().isInResult())&&this._resultAreaEdgeList.add(u)}return this._resultAreaEdgeList}},{key:"updateLabelling",value:function(a){for(var u=this.iterator();u.hasNext();){var g=u.next().getLabel();g.setAllLocationsIfNull(0,a.getLocation(0)),g.setAllLocationsIfNull(1,a.getLocation(1))}}},{key:"linkAllDirectedEdges",value:function(){this.getEdges();for(var a=null,u=null,g=this._edgeList.size()-1;g>=0;g--){var _=this._edgeList.get(g),E=_.getSym();u===null&&(u=E),a!==null&&E.setNext(a),a=_}u.setNext(a)}},{key:"computeDepths",value:function(){if(arguments.length===1){var a=arguments[0],u=this.findIndex(a),g=a.getDepth(ut.LEFT),_=a.getDepth(ut.RIGHT),E=this.computeDepths(u+1,this._edgeList.size(),g);if(this.computeDepths(0,u,E)!==_)throw new fs("depth mismatch at "+a.getCoordinate())}else if(arguments.length===3){for(var P=arguments[1],O=arguments[2],B=arguments[0];B<P;B++){var Z=this._edgeList.get(B);Z.setEdgeDepths(ut.RIGHT,O),O=Z.getDepth(ut.LEFT)}return O}}},{key:"mergeSymLabels",value:function(){for(var a=this.iterator();a.hasNext();){var u=a.next();u.getLabel().merge(u.getSym().getLabel())}}},{key:"linkMinimalDirectedEdges",value:function(a){for(var u=null,g=null,_=this._SCANNING_FOR_INCOMING,E=this._resultAreaEdgeList.size()-1;E>=0;E--){var P=this._resultAreaEdgeList.get(E),O=P.getSym();switch(u===null&&P.getEdgeRing()===a&&(u=P),_){case this._SCANNING_FOR_INCOMING:if(O.getEdgeRing()!==a)continue;g=O,_=this._LINKING_TO_OUTGOING;break;case this._LINKING_TO_OUTGOING:if(P.getEdgeRing()!==a)continue;g.setNextMin(P),_=this._SCANNING_FOR_INCOMING}}_===this._LINKING_TO_OUTGOING&&(ct.isTrue(u!==null,"found null for first outgoing dirEdge"),ct.isTrue(u.getEdgeRing()===a,"unable to link last incoming dirEdge"),g.setNextMin(u))}},{key:"getOutgoingDegree",value:function(){if(arguments.length===0){for(var a=0,u=this.iterator();u.hasNext();)u.next().isInResult()&&a++;return a}if(arguments.length===1){for(var g=arguments[0],_=0,E=this.iterator();E.hasNext();)E.next().getEdgeRing()===g&&_++;return _}}},{key:"getLabel",value:function(){return this._label}},{key:"findCoveredLineEdges",value:function(){for(var a=A.NONE,u=this.iterator();u.hasNext();){var g=u.next(),_=g.getSym();if(!g.isLineEdge()){if(g.isInResult()){a=A.INTERIOR;break}if(_.isInResult()){a=A.EXTERIOR;break}}}if(a===A.NONE)return null;for(var E=a,P=this.iterator();P.hasNext();){var O=P.next(),B=O.getSym();O.isLineEdge()?O.getEdge().setCovered(E===A.INTERIOR):(O.isInResult()&&(E=A.EXTERIOR),B.isInResult()&&(E=A.INTERIOR))}}},{key:"computeLabelling",value:function(a){S(r,"computeLabelling",this,1).call(this,a),this._label=new Ki(A.NONE);for(var u=this.iterator();u.hasNext();)for(var g=u.next().getEdge().getLabel(),_=0;_<2;_++){var E=g.getLocation(_);E!==A.INTERIOR&&E!==A.BOUNDARY||this._label.setLocation(_,A.INTERIOR)}}}],[{key:"constructor_",value:function(){this._resultAreaEdgeList=null,this._label=null,this._SCANNING_FOR_INCOMING=1,this._LINKING_TO_OUTGOING=2}}])})(HN),YN=(function(c){function r(){return s(this,r),n(this,r)}return m(r,c),l(r,[{key:"createNode",value:function(a){return new ju(a,new XN)}}])})(Y_),o1=(function(){function c(){s(this,c),c.constructor_.apply(this,arguments)}return l(c,[{key:"compareTo",value:function(r){var a=r;return c.compareOriented(this._pts,this._orientation,a._pts,a._orientation)}},{key:"interfaces_",get:function(){return[V]}}],[{key:"constructor_",value:function(){this._pts=null,this._orientation=null;var r=arguments[0];this._pts=r,this._orientation=c.orientation(r)}},{key:"orientation",value:function(r){return De.increasingDirection(r)===1}},{key:"compareOriented",value:function(r,a,u,g){for(var _=a?1:-1,E=g?1:-1,P=a?r.length:-1,O=g?u.length:-1,B=a?0:r.length-1,Z=g?0:u.length-1;;){var tt=r[B].compareTo(u[Z]);if(tt!==0)return tt;var ot=(B+=_)===P,Et=(Z+=E)===O;if(ot&&!Et)return-1;if(!ot&&Et)return 1;if(ot&&Et)return 0}}}])})(),JN=(function(){return l((function c(){s(this,c),c.constructor_.apply(this,arguments)}),[{key:"print",value:function(c){c.print("MULTILINESTRING ( ");for(var r=0;r<this._edges.size();r++){var a=this._edges.get(r);r>0&&c.print(","),c.print("(");for(var u=a.getCoordinates(),g=0;g<u.length;g++)g>0&&c.print(","),c.print(u[g].x+" "+u[g].y);c.println(")")}c.print(") ")}},{key:"addAll",value:function(c){for(var r=c.iterator();r.hasNext();)this.add(r.next())}},{key:"findEdgeIndex",value:function(c){for(var r=0;r<this._edges.size();r++)if(this._edges.get(r).equals(c))return r;return-1}},{key:"iterator",value:function(){return this._edges.iterator()}},{key:"getEdges",value:function(){return this._edges}},{key:"get",value:function(c){return this._edges.get(c)}},{key:"findEqualEdge",value:function(c){var r=new o1(c.getCoordinates());return this._ocaMap.get(r)}},{key:"add",value:function(c){this._edges.add(c);var r=new o1(c.getCoordinates());this._ocaMap.put(r,c)}}],[{key:"constructor_",value:function(){this._edges=new Gt,this._ocaMap=new jh}}])})(),h1=(function(){return l((function c(){s(this,c)}),[{key:"processIntersections",value:function(c,r,a,u){}},{key:"isDone",value:function(){}}])})(),KN=(function(){function c(){s(this,c),c.constructor_.apply(this,arguments)}return l(c,[{key:"isTrivialIntersection",value:function(r,a,u,g){if(r===u&&this._li.getIntersectionNum()===1){if(c.isAdjacentSegments(a,g))return!0;if(r.isClosed()){var _=r.size()-1;if(a===0&&g===_||g===0&&a===_)return!0}}return!1}},{key:"getProperIntersectionPoint",value:function(){return this._properIntersectionPoint}},{key:"hasProperInteriorIntersection",value:function(){return this._hasProperInterior}},{key:"getLineIntersector",value:function(){return this._li}},{key:"hasProperIntersection",value:function(){return this._hasProper}},{key:"processIntersections",value:function(r,a,u,g){if(r===u&&a===g)return null;this.numTests++;var _=r.getCoordinates()[a],E=r.getCoordinates()[a+1],P=u.getCoordinates()[g],O=u.getCoordinates()[g+1];this._li.computeIntersection(_,E,P,O),this._li.hasIntersection()&&(this.numIntersections++,this._li.isInteriorIntersection()&&(this.numInteriorIntersections++,this._hasInterior=!0),this.isTrivialIntersection(r,a,u,g)||(this._hasIntersection=!0,r.addIntersections(this._li,a,0),u.addIntersections(this._li,g,1),this._li.isProper()&&(this.numProperIntersections++,this._hasProper=!0,this._hasProperInterior=!0)))}},{key:"hasIntersection",value:function(){return this._hasIntersection}},{key:"isDone",value:function(){return!1}},{key:"hasInteriorIntersection",value:function(){return this._hasInterior}},{key:"interfaces_",get:function(){return[h1]}}],[{key:"constructor_",value:function(){this._hasIntersection=!1,this._hasProper=!1,this._hasProperInterior=!1,this._hasInterior=!1,this._properIntersectionPoint=null,this._li=null,this._isSelfIntersection=null,this.numIntersections=0,this.numInteriorIntersections=0,this.numProperIntersections=0,this.numTests=0;var r=arguments[0];this._li=r}},{key:"isAdjacentSegments",value:function(r,a){return Math.abs(r-a)===1}}])})(),ZN=(function(){return l((function c(){s(this,c),c.constructor_.apply(this,arguments)}),[{key:"getSegmentIndex",value:function(){return this.segmentIndex}},{key:"getCoordinate",value:function(){return this.coord}},{key:"print",value:function(c){c.print(this.coord),c.print(" seg # = "+this.segmentIndex),c.println(" dist = "+this.dist)}},{key:"compareTo",value:function(c){var r=c;return this.compare(r.segmentIndex,r.dist)}},{key:"isEndPoint",value:function(c){return this.segmentIndex===0&&this.dist===0||this.segmentIndex===c}},{key:"toString",value:function(){return this.coord+" seg # = "+this.segmentIndex+" dist = "+this.dist}},{key:"getDistance",value:function(){return this.dist}},{key:"compare",value:function(c,r){return this.segmentIndex<c?-1:this.segmentIndex>c?1:this.dist<r?-1:this.dist>r?1:0}},{key:"interfaces_",get:function(){return[V]}}],[{key:"constructor_",value:function(){this.coord=null,this.segmentIndex=null,this.dist=null;var c=arguments[0],r=arguments[1],a=arguments[2];this.coord=new K(c),this.segmentIndex=r,this.dist=a}}])})(),QN=(function(){return l((function c(){s(this,c),c.constructor_.apply(this,arguments)}),[{key:"print",value:function(c){c.println("Intersections:");for(var r=this.iterator();r.hasNext();)r.next().print(c)}},{key:"iterator",value:function(){return this._nodeMap.values().iterator()}},{key:"addSplitEdges",value:function(c){this.addEndpoints();for(var r=this.iterator(),a=r.next();r.hasNext();){var u=r.next(),g=this.createSplitEdge(a,u);c.add(g),a=u}}},{key:"addEndpoints",value:function(){var c=this.edge.pts.length-1;this.add(this.edge.pts[0],0,0),this.add(this.edge.pts[c],c,0)}},{key:"createSplitEdge",value:function(c,r){var a=r.segmentIndex-c.segmentIndex+2,u=this.edge.pts[r.segmentIndex],g=r.dist>0||!r.coord.equals2D(u);g||a--;var _=new Array(a).fill(null),E=0;_[E++]=new K(c.coord);for(var P=c.segmentIndex+1;P<=r.segmentIndex;P++)_[E++]=this.edge.pts[P];return g&&(_[E]=r.coord),new u1(_,new Ki(this.edge._label))}},{key:"add",value:function(c,r,a){var u=new ZN(c,r,a),g=this._nodeMap.get(u);return g!==null?g:(this._nodeMap.put(u,u),u)}},{key:"isIntersection",value:function(c){for(var r=this.iterator();r.hasNext();)if(r.next().coord.equals(c))return!0;return!1}}],[{key:"constructor_",value:function(){this._nodeMap=new jh,this.edge=null;var c=arguments[0];this.edge=c}}])})(),t4=(function(){function c(){s(this,c),c.constructor_.apply(this,arguments)}return l(c,[{key:"isIntersects",value:function(){return!this.isDisjoint()}},{key:"isCovers",value:function(){return(c.isTrue(this._matrix[A.INTERIOR][A.INTERIOR])||c.isTrue(this._matrix[A.INTERIOR][A.BOUNDARY])||c.isTrue(this._matrix[A.BOUNDARY][A.INTERIOR])||c.isTrue(this._matrix[A.BOUNDARY][A.BOUNDARY]))&&this._matrix[A.EXTERIOR][A.INTERIOR]===pt.FALSE&&this._matrix[A.EXTERIOR][A.BOUNDARY]===pt.FALSE}},{key:"isCoveredBy",value:function(){return(c.isTrue(this._matrix[A.INTERIOR][A.INTERIOR])||c.isTrue(this._matrix[A.INTERIOR][A.BOUNDARY])||c.isTrue(this._matrix[A.BOUNDARY][A.INTERIOR])||c.isTrue(this._matrix[A.BOUNDARY][A.BOUNDARY]))&&this._matrix[A.INTERIOR][A.EXTERIOR]===pt.FALSE&&this._matrix[A.BOUNDARY][A.EXTERIOR]===pt.FALSE}},{key:"set",value:function(){if(arguments.length===1)for(var r=arguments[0],a=0;a<r.length;a++){var u=Math.trunc(a/3),g=a%3;this._matrix[u][g]=pt.toDimensionValue(r.charAt(a))}else if(arguments.length===3){var _=arguments[0],E=arguments[1],P=arguments[2];this._matrix[_][E]=P}}},{key:"isContains",value:function(){return c.isTrue(this._matrix[A.INTERIOR][A.INTERIOR])&&this._matrix[A.EXTERIOR][A.INTERIOR]===pt.FALSE&&this._matrix[A.EXTERIOR][A.BOUNDARY]===pt.FALSE}},{key:"setAtLeast",value:function(){if(arguments.length===1)for(var r=arguments[0],a=0;a<r.length;a++){var u=Math.trunc(a/3),g=a%3;this.setAtLeast(u,g,pt.toDimensionValue(r.charAt(a)))}else if(arguments.length===3){var _=arguments[0],E=arguments[1],P=arguments[2];this._matrix[_][E]<P&&(this._matrix[_][E]=P)}}},{key:"setAtLeastIfValid",value:function(r,a,u){r>=0&&a>=0&&this.setAtLeast(r,a,u)}},{key:"isWithin",value:function(){return c.isTrue(this._matrix[A.INTERIOR][A.INTERIOR])&&this._matrix[A.INTERIOR][A.EXTERIOR]===pt.FALSE&&this._matrix[A.BOUNDARY][A.EXTERIOR]===pt.FALSE}},{key:"isTouches",value:function(r,a){return r>a?this.isTouches(a,r):(r===pt.A&&a===pt.A||r===pt.L&&a===pt.L||r===pt.L&&a===pt.A||r===pt.P&&a===pt.A||r===pt.P&&a===pt.L)&&this._matrix[A.INTERIOR][A.INTERIOR]===pt.FALSE&&(c.isTrue(this._matrix[A.INTERIOR][A.BOUNDARY])||c.isTrue(this._matrix[A.BOUNDARY][A.INTERIOR])||c.isTrue(this._matrix[A.BOUNDARY][A.BOUNDARY]))}},{key:"isOverlaps",value:function(r,a){return r===pt.P&&a===pt.P||r===pt.A&&a===pt.A?c.isTrue(this._matrix[A.INTERIOR][A.INTERIOR])&&c.isTrue(this._matrix[A.INTERIOR][A.EXTERIOR])&&c.isTrue(this._matrix[A.EXTERIOR][A.INTERIOR]):r===pt.L&&a===pt.L&&this._matrix[A.INTERIOR][A.INTERIOR]===1&&c.isTrue(this._matrix[A.INTERIOR][A.EXTERIOR])&&c.isTrue(this._matrix[A.EXTERIOR][A.INTERIOR])}},{key:"isEquals",value:function(r,a){return r===a&&c.isTrue(this._matrix[A.INTERIOR][A.INTERIOR])&&this._matrix[A.INTERIOR][A.EXTERIOR]===pt.FALSE&&this._matrix[A.BOUNDARY][A.EXTERIOR]===pt.FALSE&&this._matrix[A.EXTERIOR][A.INTERIOR]===pt.FALSE&&this._matrix[A.EXTERIOR][A.BOUNDARY]===pt.FALSE}},{key:"toString",value:function(){for(var r=new Lu("123456789"),a=0;a<3;a++)for(var u=0;u<3;u++)r.setCharAt(3*a+u,pt.toDimensionSymbol(this._matrix[a][u]));return r.toString()}},{key:"setAll",value:function(r){for(var a=0;a<3;a++)for(var u=0;u<3;u++)this._matrix[a][u]=r}},{key:"get",value:function(r,a){return this._matrix[r][a]}},{key:"transpose",value:function(){var r=this._matrix[1][0];return this._matrix[1][0]=this._matrix[0][1],this._matrix[0][1]=r,r=this._matrix[2][0],this._matrix[2][0]=this._matrix[0][2],this._matrix[0][2]=r,r=this._matrix[2][1],this._matrix[2][1]=this._matrix[1][2],this._matrix[1][2]=r,this}},{key:"matches",value:function(r){if(r.length!==9)throw new D("Should be length 9: "+r);for(var a=0;a<3;a++)for(var u=0;u<3;u++)if(!c.matches(this._matrix[a][u],r.charAt(3*a+u)))return!1;return!0}},{key:"add",value:function(r){for(var a=0;a<3;a++)for(var u=0;u<3;u++)this.setAtLeast(a,u,r.get(a,u))}},{key:"isDisjoint",value:function(){return this._matrix[A.INTERIOR][A.INTERIOR]===pt.FALSE&&this._matrix[A.INTERIOR][A.BOUNDARY]===pt.FALSE&&this._matrix[A.BOUNDARY][A.INTERIOR]===pt.FALSE&&this._matrix[A.BOUNDARY][A.BOUNDARY]===pt.FALSE}},{key:"isCrosses",value:function(r,a){return r===pt.P&&a===pt.L||r===pt.P&&a===pt.A||r===pt.L&&a===pt.A?c.isTrue(this._matrix[A.INTERIOR][A.INTERIOR])&&c.isTrue(this._matrix[A.INTERIOR][A.EXTERIOR]):r===pt.L&&a===pt.P||r===pt.A&&a===pt.P||r===pt.A&&a===pt.L?c.isTrue(this._matrix[A.INTERIOR][A.INTERIOR])&&c.isTrue(this._matrix[A.EXTERIOR][A.INTERIOR]):r===pt.L&&a===pt.L&&this._matrix[A.INTERIOR][A.INTERIOR]===0}},{key:"interfaces_",get:function(){return[x]}}],[{key:"constructor_",value:function(){if(this._matrix=null,arguments.length===0)this._matrix=Array(3).fill().map((function(){return Array(3)})),this.setAll(pt.FALSE);else if(arguments.length===1){if(typeof arguments[0]=="string"){var r=arguments[0];c.constructor_.call(this),this.set(r)}else if(arguments[0]instanceof c){var a=arguments[0];c.constructor_.call(this),this._matrix[A.INTERIOR][A.INTERIOR]=a._matrix[A.INTERIOR][A.INTERIOR],this._matrix[A.INTERIOR][A.BOUNDARY]=a._matrix[A.INTERIOR][A.BOUNDARY],this._matrix[A.INTERIOR][A.EXTERIOR]=a._matrix[A.INTERIOR][A.EXTERIOR],this._matrix[A.BOUNDARY][A.INTERIOR]=a._matrix[A.BOUNDARY][A.INTERIOR],this._matrix[A.BOUNDARY][A.BOUNDARY]=a._matrix[A.BOUNDARY][A.BOUNDARY],this._matrix[A.BOUNDARY][A.EXTERIOR]=a._matrix[A.BOUNDARY][A.EXTERIOR],this._matrix[A.EXTERIOR][A.INTERIOR]=a._matrix[A.EXTERIOR][A.INTERIOR],this._matrix[A.EXTERIOR][A.BOUNDARY]=a._matrix[A.EXTERIOR][A.BOUNDARY],this._matrix[A.EXTERIOR][A.EXTERIOR]=a._matrix[A.EXTERIOR][A.EXTERIOR]}}}},{key:"matches",value:function(){if(Number.isInteger(arguments[0])&&typeof arguments[1]=="string"){var r=arguments[0],a=arguments[1];return a===pt.SYM_DONTCARE||a===pt.SYM_TRUE&&(r>=0||r===pt.TRUE)||a===pt.SYM_FALSE&&r===pt.FALSE||a===pt.SYM_P&&r===pt.P||a===pt.SYM_L&&r===pt.L||a===pt.SYM_A&&r===pt.A}if(typeof arguments[0]=="string"&&typeof arguments[1]=="string"){var u=arguments[1];return new c(arguments[0]).matches(u)}}},{key:"isTrue",value:function(r){return r>=0||r===pt.TRUE}}])})(),e4=(function(){function c(){s(this,c),c.constructor_.apply(this,arguments)}return l(c,[{key:"size",value:function(){return this._size}},{key:"addAll",value:function(r){return r===null||r.length===0?null:(this.ensureCapacity(this._size+r.length),Yi.arraycopy(r,0,this._data,this._size,r.length),void(this._size+=r.length))}},{key:"ensureCapacity",value:function(r){if(r<=this._data.length)return null;var a=Math.max(r,2*this._data.length);this._data=Vr.copyOf(this._data,a)}},{key:"toArray",value:function(){var r=new Array(this._size).fill(null);return Yi.arraycopy(this._data,0,r,0,this._size),r}},{key:"add",value:function(r){this.ensureCapacity(this._size+1),this._data[this._size]=r,++this._size}}],[{key:"constructor_",value:function(){if(this._data=null,this._size=0,arguments.length===0)c.constructor_.call(this,10);else if(arguments.length===1){var r=arguments[0];this._data=new Array(r).fill(null)}}}])})(),i4=(function(){function c(){s(this,c)}return l(c,[{key:"getChainStartIndices",value:function(r){var a=0,u=new e4(Math.trunc(r.length/2));u.add(a);do{var g=this.findChainEnd(r,a);u.add(g),a=g}while(a<r.length-1);return u.toArray()}},{key:"findChainEnd",value:function(r,a){for(var u=li.quadrant(r[a],r[a+1]),g=a+1;g<r.length&&li.quadrant(r[g-1],r[g])===u;)g++;return g-1}},{key:"OLDgetChainStartIndices",value:function(r){var a=0,u=new Gt;u.add(a);do{var g=this.findChainEnd(r,a);u.add(g),a=g}while(a<r.length-1);return c.toIntArray(u)}}],[{key:"toIntArray",value:function(r){for(var a=new Array(r.size()).fill(null),u=0;u<a.length;u++)a[u]=r.get(u).intValue();return a}}])})(),n4=(function(){return l((function c(){s(this,c),c.constructor_.apply(this,arguments)}),[{key:"getCoordinates",value:function(){return this.pts}},{key:"getMaxX",value:function(c){var r=this.pts[this.startIndex[c]].x,a=this.pts[this.startIndex[c+1]].x;return r>a?r:a}},{key:"getMinX",value:function(c){var r=this.pts[this.startIndex[c]].x,a=this.pts[this.startIndex[c+1]].x;return r<a?r:a}},{key:"computeIntersectsForChain",value:function(){if(arguments.length===4){var c=arguments[0],r=arguments[1],a=arguments[2],u=arguments[3];this.computeIntersectsForChain(this.startIndex[c],this.startIndex[c+1],r,r.startIndex[a],r.startIndex[a+1],u)}else if(arguments.length===6){var g=arguments[0],_=arguments[1],E=arguments[2],P=arguments[3],O=arguments[4],B=arguments[5];if(_-g==1&&O-P==1)return B.addIntersections(this.e,g,E.e,P),null;if(!this.overlaps(g,_,E,P,O))return null;var Z=Math.trunc((g+_)/2),tt=Math.trunc((P+O)/2);g<Z&&(P<tt&&this.computeIntersectsForChain(g,Z,E,P,tt,B),tt<O&&this.computeIntersectsForChain(g,Z,E,tt,O,B)),Z<_&&(P<tt&&this.computeIntersectsForChain(Z,_,E,P,tt,B),tt<O&&this.computeIntersectsForChain(Z,_,E,tt,O,B))}}},{key:"overlaps",value:function(c,r,a,u,g){return zt.intersects(this.pts[c],this.pts[r],a.pts[u],a.pts[g])}},{key:"getStartIndexes",value:function(){return this.startIndex}},{key:"computeIntersects",value:function(c,r){for(var a=0;a<this.startIndex.length-1;a++)for(var u=0;u<c.startIndex.length-1;u++)this.computeIntersectsForChain(a,c,u,r)}}],[{key:"constructor_",value:function(){this.e=null,this.pts=null,this.startIndex=null;var c=arguments[0];this.e=c,this.pts=c.getCoordinates();var r=new i4;this.startIndex=r.getChainStartIndices(this.pts)}}])})(),l1=(function(){function c(){s(this,c),c.constructor_.apply(this,arguments)}return l(c,[{key:"getDepth",value:function(r,a){return this._depth[r][a]}},{key:"setDepth",value:function(r,a,u){this._depth[r][a]=u}},{key:"isNull",value:function(){if(arguments.length===0){for(var r=0;r<2;r++)for(var a=0;a<3;a++)if(this._depth[r][a]!==c.NULL_VALUE)return!1;return!0}if(arguments.length===1){var u=arguments[0];return this._depth[u][1]===c.NULL_VALUE}if(arguments.length===2){var g=arguments[0],_=arguments[1];return this._depth[g][_]===c.NULL_VALUE}}},{key:"normalize",value:function(){for(var r=0;r<2;r++)if(!this.isNull(r)){var a=this._depth[r][1];this._depth[r][2]<a&&(a=this._depth[r][2]),a<0&&(a=0);for(var u=1;u<3;u++){var g=0;this._depth[r][u]>a&&(g=1),this._depth[r][u]=g}}}},{key:"getDelta",value:function(r){return this._depth[r][ut.RIGHT]-this._depth[r][ut.LEFT]}},{key:"getLocation",value:function(r,a){return this._depth[r][a]<=0?A.EXTERIOR:A.INTERIOR}},{key:"toString",value:function(){return"A: "+this._depth[0][1]+","+this._depth[0][2]+" B: "+this._depth[1][1]+","+this._depth[1][2]}},{key:"add",value:function(){if(arguments.length===1)for(var r=arguments[0],a=0;a<2;a++)for(var u=1;u<3;u++){var g=r.getLocation(a,u);g!==A.EXTERIOR&&g!==A.INTERIOR||(this.isNull(a,u)?this._depth[a][u]=c.depthAtLocation(g):this._depth[a][u]+=c.depthAtLocation(g))}else if(arguments.length===3){var _=arguments[0],E=arguments[1];arguments[2]===A.INTERIOR&&this._depth[_][E]++}}}],[{key:"constructor_",value:function(){this._depth=Array(2).fill().map((function(){return Array(3)}));for(var r=0;r<2;r++)for(var a=0;a<3;a++)this._depth[r][a]=c.NULL_VALUE}},{key:"depthAtLocation",value:function(r){return r===A.EXTERIOR?0:r===A.INTERIOR?1:c.NULL_VALUE}}])})();l1.NULL_VALUE=-1;var u1=(function(c){function r(){var a;return s(this,r),a=n(this,r),r.constructor_.apply(a,arguments),a}return m(r,c),l(r,[{key:"getDepth",value:function(){return this._depth}},{key:"getCollapsedEdge",value:function(){var a=new Array(2).fill(null);return a[0]=this.pts[0],a[1]=this.pts[1],new r(a,Ki.toLineLabel(this._label))}},{key:"isIsolated",value:function(){return this._isIsolated}},{key:"getCoordinates",value:function(){return this.pts}},{key:"setIsolated",value:function(a){this._isIsolated=a}},{key:"setName",value:function(a){this._name=a}},{key:"equals",value:function(a){if(!(a instanceof r))return!1;var u=a;if(this.pts.length!==u.pts.length)return!1;for(var g=!0,_=!0,E=this.pts.length,P=0;P<this.pts.length;P++)if(this.pts[P].equals2D(u.pts[P])||(g=!1),this.pts[P].equals2D(u.pts[--E])||(_=!1),!g&&!_)return!1;return!0}},{key:"getCoordinate",value:function(){if(arguments.length===0)return this.pts.length>0?this.pts[0]:null;if(arguments.length===1){var a=arguments[0];return this.pts[a]}}},{key:"print",value:function(a){a.print("edge "+this._name+": "),a.print("LINESTRING (");for(var u=0;u<this.pts.length;u++)u>0&&a.print(","),a.print(this.pts[u].x+" "+this.pts[u].y);a.print(") "+this._label+" "+this._depthDelta)}},{key:"computeIM",value:function(a){r.updateIM(this._label,a)}},{key:"isCollapsed",value:function(){return!!this._label.isArea()&&this.pts.length===3&&!!this.pts[0].equals(this.pts[2])}},{key:"isClosed",value:function(){return this.pts[0].equals(this.pts[this.pts.length-1])}},{key:"getMaximumSegmentIndex",value:function(){return this.pts.length-1}},{key:"getDepthDelta",value:function(){return this._depthDelta}},{key:"getNumPoints",value:function(){return this.pts.length}},{key:"printReverse",value:function(a){a.print("edge "+this._name+": ");for(var u=this.pts.length-1;u>=0;u--)a.print(this.pts[u]+" ");a.println("")}},{key:"getMonotoneChainEdge",value:function(){return this._mce===null&&(this._mce=new n4(this)),this._mce}},{key:"getEnvelope",value:function(){if(this._env===null){this._env=new zt;for(var a=0;a<this.pts.length;a++)this._env.expandToInclude(this.pts[a])}return this._env}},{key:"addIntersection",value:function(a,u,g,_){var E=new K(a.getIntersection(_)),P=u,O=a.getEdgeDistance(g,_),B=P+1;if(B<this.pts.length){var Z=this.pts[B];E.equals2D(Z)&&(P=B,O=0)}this.eiList.add(E,P,O)}},{key:"toString",value:function(){var a=new Lu;a.append("edge "+this._name+": "),a.append("LINESTRING (");for(var u=0;u<this.pts.length;u++)u>0&&a.append(","),a.append(this.pts[u].x+" "+this.pts[u].y);return a.append(") "+this._label+" "+this._depthDelta),a.toString()}},{key:"isPointwiseEqual",value:function(a){if(this.pts.length!==a.pts.length)return!1;for(var u=0;u<this.pts.length;u++)if(!this.pts[u].equals2D(a.pts[u]))return!1;return!0}},{key:"setDepthDelta",value:function(a){this._depthDelta=a}},{key:"getEdgeIntersectionList",value:function(){return this.eiList}},{key:"addIntersections",value:function(a,u,g){for(var _=0;_<a.getIntersectionNum();_++)this.addIntersection(a,u,g,_)}}],[{key:"constructor_",value:function(){if(this.pts=null,this._env=null,this.eiList=new QN(this),this._name=null,this._mce=null,this._isIsolated=!0,this._depth=new l1,this._depthDelta=0,arguments.length===1){var a=arguments[0];r.constructor_.call(this,a,null)}else if(arguments.length===2){var u=arguments[0],g=arguments[1];this.pts=u,this._label=g}}},{key:"updateIM",value:function(){if(!(arguments.length===2&&arguments[1]instanceof t4&&arguments[0]instanceof Ki))return S(r,"updateIM",this).apply(this,arguments);var a=arguments[0],u=arguments[1];u.setAtLeastIfValid(a.getLocation(0,ut.ON),a.getLocation(1,ut.ON),1),a.isArea()&&(u.setAtLeastIfValid(a.getLocation(0,ut.LEFT),a.getLocation(1,ut.LEFT),2),u.setAtLeastIfValid(a.getLocation(0,ut.RIGHT),a.getLocation(1,ut.RIGHT),2))}}])})(q_),c1=(function(){function c(){s(this,c),c.constructor_.apply(this,arguments)}return l(c,[{key:"setWorkingPrecisionModel",value:function(r){this._workingPrecisionModel=r}},{key:"insertUniqueEdge",value:function(r){var a=this._edgeList.findEqualEdge(r);if(a!==null){var u=a.getLabel(),g=r.getLabel();a.isPointwiseEqual(r)||(g=new Ki(r.getLabel())).flip(),u.merge(g);var _=c.depthDelta(g),E=a.getDepthDelta()+_;a.setDepthDelta(E)}else this._edgeList.add(r),r.setDepthDelta(c.depthDelta(r.getLabel()))}},{key:"buildSubgraphs",value:function(r,a){for(var u=new Gt,g=r.iterator();g.hasNext();){var _=g.next(),E=_.getRightmostCoordinate(),P=new s1(u).getDepth(E);_.computeDepth(P),_.findResultEdges(),u.add(_),a.add(_.getDirectedEdges(),_.getNodes())}}},{key:"createSubgraphs",value:function(r){for(var a=new Gt,u=r.getNodes().iterator();u.hasNext();){var g=u.next();if(!g.isVisited()){var _=new hN;_.create(g),a.add(_)}}return mo.sort(a,mo.reverseOrder()),a}},{key:"createEmptyResultGeometry",value:function(){return this._geomFact.createPolygon()}},{key:"getNoder",value:function(r){if(this._workingNoder!==null)return this._workingNoder;var a=new Qg,u=new Wr;return u.setPrecisionModel(r),a.setSegmentIntersector(new KN(u)),a}},{key:"buffer",value:function(r,a){var u=this._workingPrecisionModel;u===null&&(u=r.getPrecisionModel()),this._geomFact=r.getFactory();var g=new zN(u,this._bufParams),_=new VN(r,a,g).getCurves();if(_.size()<=0)return this.createEmptyResultGeometry();this.computeNodedEdges(_,u),this._graph=new J_(new YN),this._graph.addEdges(this._edgeList.getEdges());var E=this.createSubgraphs(this._graph),P=new MN(this._geomFact);this.buildSubgraphs(E,P);var O=P.getPolygons();return O.size()<=0?this.createEmptyResultGeometry():this._geomFact.buildGeometry(O)}},{key:"computeNodedEdges",value:function(r,a){var u=this.getNoder(a);u.computeNodes(r);for(var g=u.getNodedSubstrings().iterator();g.hasNext();){var _=g.next(),E=_.getCoordinates();if(E.length!==2||!E[0].equals2D(E[1])){var P=_.getData(),O=new u1(_.getCoordinates(),new Ki(P));this.insertUniqueEdge(O)}}}},{key:"setNoder",value:function(r){this._workingNoder=r}}],[{key:"constructor_",value:function(){this._bufParams=null,this._workingPrecisionModel=null,this._workingNoder=null,this._geomFact=null,this._graph=null,this._edgeList=new JN;var r=arguments[0];this._bufParams=r}},{key:"depthDelta",value:function(r){var a=r.getLocation(0,ut.LEFT),u=r.getLocation(0,ut.RIGHT);return a===A.INTERIOR&&u===A.EXTERIOR?1:a===A.EXTERIOR&&u===A.INTERIOR?-1:0}},{key:"convertSegStrings",value:function(r){for(var a=new go,u=new Gt;r.hasNext();){var g=r.next(),_=a.createLineString(g.getCoordinates());u.add(_)}return a.buildGeometry(u)}}])})(),s4=(function(){function c(){s(this,c),c.constructor_.apply(this,arguments)}return l(c,[{key:"rescale",value:function(){if(Vt(arguments[0],at))for(var r=arguments[0].iterator();r.hasNext();){var a=r.next();this.rescale(a.getCoordinates())}else if(arguments[0]instanceof Array){for(var u=arguments[0],g=0;g<u.length;g++)u[g].x=u[g].x/this._scaleFactor+this._offsetX,u[g].y=u[g].y/this._scaleFactor+this._offsetY;u.length===2&&u[0].equals2D(u[1])&&Yi.out.println(u)}}},{key:"scale",value:function(){if(Vt(arguments[0],at)){for(var r=arguments[0],a=new Gt(r.size()),u=r.iterator();u.hasNext();){var g=u.next();a.add(new Hr(this.scale(g.getCoordinates()),g.getData()))}return a}if(arguments[0]instanceof Array){for(var _=arguments[0],E=new Array(_.length).fill(null),P=0;P<_.length;P++)E[P]=new K(Math.round((_[P].x-this._offsetX)*this._scaleFactor),Math.round((_[P].y-this._offsetY)*this._scaleFactor),_[P].getZ());return De.removeRepeatedPoints(E)}}},{key:"isIntegerPrecision",value:function(){return this._scaleFactor===1}},{key:"getNodedSubstrings",value:function(){var r=this._noder.getNodedSubstrings();return this._isScaled&&this.rescale(r),r}},{key:"computeNodes",value:function(r){var a=r;this._isScaled&&(a=this.scale(r)),this._noder.computeNodes(a)}},{key:"interfaces_",get:function(){return[Zg]}}],[{key:"constructor_",value:function(){if(this._noder=null,this._scaleFactor=null,this._offsetX=null,this._offsetY=null,this._isScaled=!1,arguments.length===2){var r=arguments[0],a=arguments[1];c.constructor_.call(this,r,a,0,0)}else if(arguments.length===4){var u=arguments[0],g=arguments[1];this._noder=u,this._scaleFactor=g,this._isScaled=!this.isIntegerPrecision()}}}])})(),d1=(function(){function c(){s(this,c),c.constructor_.apply(this,arguments)}return l(c,[{key:"checkEndPtVertexIntersections",value:function(){if(arguments.length===0)for(var r=this._segStrings.iterator();r.hasNext();){var a=r.next().getCoordinates();this.checkEndPtVertexIntersections(a[0],this._segStrings),this.checkEndPtVertexIntersections(a[a.length-1],this._segStrings)}else if(arguments.length===2){for(var u=arguments[0],g=arguments[1].iterator();g.hasNext();)for(var _=g.next().getCoordinates(),E=1;E<_.length-1;E++)if(_[E].equals(u))throw new ht("found endpt/interior pt intersection at index "+E+" :pt "+u)}}},{key:"checkInteriorIntersections",value:function(){if(arguments.length===0)for(var r=this._segStrings.iterator();r.hasNext();)for(var a=r.next(),u=this._segStrings.iterator();u.hasNext();){var g=u.next();this.checkInteriorIntersections(a,g)}else if(arguments.length===2)for(var _=arguments[0],E=arguments[1],P=_.getCoordinates(),O=E.getCoordinates(),B=0;B<P.length-1;B++)for(var Z=0;Z<O.length-1;Z++)this.checkInteriorIntersections(_,B,E,Z);else if(arguments.length===4){var tt=arguments[0],ot=arguments[1],Et=arguments[2],Nt=arguments[3];if(tt===Et&&ot===Nt)return null;var Dt=tt.getCoordinates()[ot],Zt=tt.getCoordinates()[ot+1],Yt=Et.getCoordinates()[Nt],oe=Et.getCoordinates()[Nt+1];if(this._li.computeIntersection(Dt,Zt,Yt,oe),this._li.hasIntersection()&&(this._li.isProper()||this.hasInteriorIntersection(this._li,Dt,Zt)||this.hasInteriorIntersection(this._li,Yt,oe)))throw new ht("found non-noded intersection at "+Dt+"-"+Zt+" and "+Yt+"-"+oe)}}},{key:"checkValid",value:function(){this.checkEndPtVertexIntersections(),this.checkInteriorIntersections(),this.checkCollapses()}},{key:"checkCollapses",value:function(){if(arguments.length===0)for(var r=this._segStrings.iterator();r.hasNext();){var a=r.next();this.checkCollapses(a)}else if(arguments.length===1)for(var u=arguments[0].getCoordinates(),g=0;g<u.length-2;g++)this.checkCollapse(u[g],u[g+1],u[g+2])}},{key:"hasInteriorIntersection",value:function(r,a,u){for(var g=0;g<r.getIntersectionNum();g++){var _=r.getIntersection(g);if(!_.equals(a)&&!_.equals(u))return!0}return!1}},{key:"checkCollapse",value:function(r,a,u){if(r.equals(u))throw new ht("found non-noded collapse at "+c.fact.createLineString([r,a,u]))}}],[{key:"constructor_",value:function(){this._li=new Wr,this._segStrings=null;var r=arguments[0];this._segStrings=r}}])})();d1.fact=new go;var ep=(function(){function c(){s(this,c),c.constructor_.apply(this,arguments)}return l(c,[{key:"intersectsScaled",value:function(r,a){var u=Math.min(r.x,a.x),g=Math.max(r.x,a.x),_=Math.min(r.y,a.y),E=Math.max(r.y,a.y),P=this._maxx<u||this._minx>g||this._maxy<_||this._miny>E;if(P)return!1;var O=this.intersectsToleranceSquare(r,a);return ct.isTrue(!(P&&O),"Found bad envelope test"),O}},{key:"initCorners",value:function(r){var a=.5;this._minx=r.x-a,this._maxx=r.x+a,this._miny=r.y-a,this._maxy=r.y+a,this._corner[0]=new K(this._maxx,this._maxy),this._corner[1]=new K(this._minx,this._maxy),this._corner[2]=new K(this._minx,this._miny),this._corner[3]=new K(this._maxx,this._miny)}},{key:"intersects",value:function(r,a){return this._scaleFactor===1?this.intersectsScaled(r,a):(this.copyScaled(r,this._p0Scaled),this.copyScaled(a,this._p1Scaled),this.intersectsScaled(this._p0Scaled,this._p1Scaled))}},{key:"scale",value:function(r){return Math.round(r*this._scaleFactor)}},{key:"getCoordinate",value:function(){return this._originalPt}},{key:"copyScaled",value:function(r,a){a.x=this.scale(r.x),a.y=this.scale(r.y)}},{key:"getSafeEnvelope",value:function(){if(this._safeEnv===null){var r=c.SAFE_ENV_EXPANSION_FACTOR/this._scaleFactor;this._safeEnv=new zt(this._originalPt.x-r,this._originalPt.x+r,this._originalPt.y-r,this._originalPt.y+r)}return this._safeEnv}},{key:"intersectsPixelClosure",value:function(r,a){return this._li.computeIntersection(r,a,this._corner[0],this._corner[1]),!!this._li.hasIntersection()||(this._li.computeIntersection(r,a,this._corner[1],this._corner[2]),!!this._li.hasIntersection()||(this._li.computeIntersection(r,a,this._corner[2],this._corner[3]),!!this._li.hasIntersection()||(this._li.computeIntersection(r,a,this._corner[3],this._corner[0]),!!this._li.hasIntersection())))}},{key:"intersectsToleranceSquare",value:function(r,a){var u=!1,g=!1;return this._li.computeIntersection(r,a,this._corner[0],this._corner[1]),!!this._li.isProper()||(this._li.computeIntersection(r,a,this._corner[1],this._corner[2]),!!this._li.isProper()||(this._li.hasIntersection()&&(u=!0),this._li.computeIntersection(r,a,this._corner[2],this._corner[3]),!!this._li.isProper()||(this._li.hasIntersection()&&(g=!0),this._li.computeIntersection(r,a,this._corner[3],this._corner[0]),!!this._li.isProper()||!(!u||!g)||!!r.equals(this._pt)||!!a.equals(this._pt))))}},{key:"addSnappedNode",value:function(r,a){var u=r.getCoordinate(a),g=r.getCoordinate(a+1);return!!this.intersects(u,g)&&(r.addIntersection(this.getCoordinate(),a),!0)}}],[{key:"constructor_",value:function(){this._li=null,this._pt=null,this._originalPt=null,this._ptScaled=null,this._p0Scaled=null,this._p1Scaled=null,this._scaleFactor=null,this._minx=null,this._maxx=null,this._miny=null,this._maxy=null,this._corner=new Array(4).fill(null),this._safeEnv=null;var r=arguments[0],a=arguments[1],u=arguments[2];if(this._originalPt=r,this._pt=r,this._scaleFactor=a,this._li=u,a<=0)throw new D("Scale factor must be non-zero");a!==1&&(this._pt=new K(this.scale(r.x),this.scale(r.y)),this._p0Scaled=new K,this._p1Scaled=new K),this.initCorners(this._pt)}}])})();ep.SAFE_ENV_EXPANSION_FACTOR=.75;var r4=(function(){return l((function c(){s(this,c),c.constructor_.apply(this,arguments)}),[{key:"select",value:function(){if(arguments.length!==1){if(arguments.length===2){var c=arguments[1];arguments[0].getLineSegment(c,this.selectedSegment),this.select(this.selectedSegment)}}}}],[{key:"constructor_",value:function(){this.selectedSegment=new Ni}}])})(),f1=(function(){return l((function c(){s(this,c),c.constructor_.apply(this,arguments)}),[{key:"snap",value:function(){if(arguments.length===1){var c=arguments[0];return this.snap(c,null,-1)}if(arguments.length===3){var r=arguments[0],a=arguments[1],u=arguments[2],g=r.getSafeEnvelope(),_=new g1(r,a,u);return this._index.query(g,new((function(){return l((function E(){s(this,E)}),[{key:"interfaces_",get:function(){return[Z_]}},{key:"visitItem",value:function(E){E.select(g,_)}}])})())),_.isNodeAdded()}}}],[{key:"constructor_",value:function(){this._index=null;var c=arguments[0];this._index=c}}])})(),g1=(function(c){function r(){var a;return s(this,r),a=n(this,r),r.constructor_.apply(a,arguments),a}return m(r,c),l(r,[{key:"isNodeAdded",value:function(){return this._isNodeAdded}},{key:"select",value:function(){if(!(arguments.length===2&&Number.isInteger(arguments[1])&&arguments[0]instanceof t1))return S(r,"select",this,1).apply(this,arguments);var a=arguments[1],u=arguments[0].getContext();if(this._parentEdge===u&&(a===this._hotPixelVertexIndex||a+1===this._hotPixelVertexIndex))return null;this._isNodeAdded|=this._hotPixel.addSnappedNode(u,a)}}],[{key:"constructor_",value:function(){this._hotPixel=null,this._parentEdge=null,this._hotPixelVertexIndex=null,this._isNodeAdded=!1;var a=arguments[0],u=arguments[1],g=arguments[2];this._hotPixel=a,this._parentEdge=u,this._hotPixelVertexIndex=g}}])})(r4);f1.HotPixelSnapAction=g1;var a4=(function(){return l((function c(){s(this,c),c.constructor_.apply(this,arguments)}),[{key:"processIntersections",value:function(c,r,a,u){if(c===a&&r===u)return null;var g=c.getCoordinates()[r],_=c.getCoordinates()[r+1],E=a.getCoordinates()[u],P=a.getCoordinates()[u+1];if(this._li.computeIntersection(g,_,E,P),this._li.hasIntersection()&&this._li.isInteriorIntersection()){for(var O=0;O<this._li.getIntersectionNum();O++)this._interiorIntersections.add(this._li.getIntersection(O));c.addIntersections(this._li,r,0),a.addIntersections(this._li,u,1)}}},{key:"isDone",value:function(){return!1}},{key:"getInteriorIntersections",value:function(){return this._interiorIntersections}},{key:"interfaces_",get:function(){return[h1]}}],[{key:"constructor_",value:function(){this._li=null,this._interiorIntersections=null;var c=arguments[0];this._li=c,this._interiorIntersections=new Gt}}])})(),o4=(function(){return l((function c(){s(this,c),c.constructor_.apply(this,arguments)}),[{key:"checkCorrectness",value:function(c){var r=Hr.getNodedSubstrings(c),a=new d1(r);try{a.checkValid()}catch(u){if(!(u instanceof M))throw u;u.printStackTrace()}}},{key:"getNodedSubstrings",value:function(){return Hr.getNodedSubstrings(this._nodedSegStrings)}},{key:"snapRound",value:function(c,r){var a=this.findInteriorIntersections(c,r);this.computeIntersectionSnaps(a),this.computeVertexSnaps(c)}},{key:"findInteriorIntersections",value:function(c,r){var a=new a4(r);return this._noder.setSegmentIntersector(a),this._noder.computeNodes(c),a.getInteriorIntersections()}},{key:"computeVertexSnaps",value:function(){if(Vt(arguments[0],at))for(var c=arguments[0].iterator();c.hasNext();){var r=c.next();this.computeVertexSnaps(r)}else if(arguments[0]instanceof Hr)for(var a=arguments[0],u=a.getCoordinates(),g=0;g<u.length;g++){var _=new ep(u[g],this._scaleFactor,this._li);this._pointSnapper.snap(_,a,g)&&a.addIntersection(u[g],g)}}},{key:"computeNodes",value:function(c){this._nodedSegStrings=c,this._noder=new Qg,this._pointSnapper=new f1(this._noder.getIndex()),this.snapRound(c,this._li)}},{key:"computeIntersectionSnaps",value:function(c){for(var r=c.iterator();r.hasNext();){var a=r.next(),u=new ep(a,this._scaleFactor,this._li);this._pointSnapper.snap(u)}}},{key:"interfaces_",get:function(){return[Zg]}}],[{key:"constructor_",value:function(){this._pm=null,this._li=null,this._scaleFactor=null,this._noder=null,this._pointSnapper=null,this._nodedSegStrings=null;var c=arguments[0];this._pm=c,this._li=new Wr,this._li.setPrecisionModel(c),this._scaleFactor=c.getScale()}}])})(),_o=(function(){function c(){s(this,c),c.constructor_.apply(this,arguments)}return l(c,[{key:"bufferFixedPrecision",value:function(r){var a=new s4(new o4(new mn(1)),r.getScale()),u=new c1(this._bufParams);u.setWorkingPrecisionModel(r),u.setNoder(a),this._resultGeometry=u.buffer(this._argGeom,this._distance)}},{key:"bufferReducedPrecision",value:function(){if(arguments.length===0){for(var r=c.MAX_PRECISION_DIGITS;r>=0;r--){try{this.bufferReducedPrecision(r)}catch(_){if(!(_ instanceof fs))throw _;this._saveException=_}if(this._resultGeometry!==null)return null}throw this._saveException}if(arguments.length===1){var a=arguments[0],u=c.precisionScaleFactor(this._argGeom,this._distance,a),g=new mn(u);this.bufferFixedPrecision(g)}}},{key:"computeGeometry",value:function(){if(this.bufferOriginalPrecision(),this._resultGeometry!==null)return null;var r=this._argGeom.getFactory().getPrecisionModel();r.getType()===mn.FIXED?this.bufferFixedPrecision(r):this.bufferReducedPrecision()}},{key:"setQuadrantSegments",value:function(r){this._bufParams.setQuadrantSegments(r)}},{key:"bufferOriginalPrecision",value:function(){try{var r=new c1(this._bufParams);this._resultGeometry=r.buffer(this._argGeom,this._distance)}catch(a){if(!(a instanceof ht))throw a;this._saveException=a}}},{key:"getResultGeometry",value:function(r){return this._distance=r,this.computeGeometry(),this._resultGeometry}},{key:"setEndCapStyle",value:function(r){this._bufParams.setEndCapStyle(r)}}],[{key:"constructor_",value:function(){if(this._argGeom=null,this._distance=null,this._bufParams=new k,this._resultGeometry=null,this._saveException=null,arguments.length===1){var r=arguments[0];this._argGeom=r}else if(arguments.length===2){var a=arguments[0],u=arguments[1];this._argGeom=a,this._bufParams=u}}},{key:"bufferOp",value:function(){if(arguments.length===2){var r=arguments[1];return new c(arguments[0]).getResultGeometry(r)}if(arguments.length===3){if(Number.isInteger(arguments[2])&&arguments[0]instanceof gt&&typeof arguments[1]=="number"){var a=arguments[1],u=arguments[2],g=new c(arguments[0]);return g.setQuadrantSegments(u),g.getResultGeometry(a)}if(arguments[2]instanceof k&&arguments[0]instanceof gt&&typeof arguments[1]=="number"){var _=arguments[1];return new c(arguments[0],arguments[2]).getResultGeometry(_)}}else if(arguments.length===4){var E=arguments[1],P=arguments[2],O=arguments[3],B=new c(arguments[0]);return B.setQuadrantSegments(P),B.setEndCapStyle(O),B.getResultGeometry(E)}}},{key:"precisionScaleFactor",value:function(r,a,u){var g=r.getEnvelopeInternal(),_=Rh.max(Math.abs(g.getMaxX()),Math.abs(g.getMaxY()),Math.abs(g.getMinX()),Math.abs(g.getMinY()))+2*(a>0?a:0),E=u-Math.trunc(Math.log(_)/Math.log(10)+1);return Math.pow(10,E)}}])})();_o.CAP_ROUND=k.CAP_ROUND,_o.CAP_BUTT=k.CAP_FLAT,_o.CAP_FLAT=k.CAP_FLAT,_o.CAP_SQUARE=k.CAP_SQUARE,_o.MAX_PRECISION_DIGITS=12;var h4=["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"],p1=(function(){return l((function c(r){s(this,c),this.geometryFactory=r||new go}),[{key:"read",value:function(c){var r,a=(r=typeof c=="string"?JSON.parse(c):c).type;if(!Qi[a])throw new Error("Unknown GeoJSON type: "+r.type);return h4.indexOf(a)!==-1?Qi[a].call(this,r.coordinates):a==="GeometryCollection"?Qi[a].call(this,r.geometries):Qi[a].call(this,r)}},{key:"write",value:function(c){var r=c.getGeometryType();if(!Hn[r])throw new Error("Geometry is not supported");return Hn[r].call(this,c)}}])})(),Qi={Feature:function(c){var r={};for(var a in c)r[a]=c[a];if(c.geometry){var u=c.geometry.type;if(!Qi[u])throw new Error("Unknown GeoJSON type: "+c.type);r.geometry=this.read(c.geometry)}return c.bbox&&(r.bbox=Qi.bbox.call(this,c.bbox)),r},FeatureCollection:function(c){var r={};if(c.features){r.features=[];for(var a=0;a<c.features.length;++a)r.features.push(this.read(c.features[a]))}return c.bbox&&(r.bbox=this.parse.bbox.call(this,c.bbox)),r},coordinates:function(c){for(var r=[],a=0;a<c.length;++a){var u=c[a];r.push(o(K,T(u)))}return r},bbox:function(c){return this.geometryFactory.createLinearRing([new K(c[0],c[1]),new K(c[2],c[1]),new K(c[2],c[3]),new K(c[0],c[3]),new K(c[0],c[1])])},Point:function(c){var r=o(K,T(c));return this.geometryFactory.createPoint(r)},MultiPoint:function(c){for(var r=[],a=0;a<c.length;++a)r.push(Qi.Point.call(this,c[a]));return this.geometryFactory.createMultiPoint(r)},LineString:function(c){var r=Qi.coordinates.call(this,c);return this.geometryFactory.createLineString(r)},MultiLineString:function(c){for(var r=[],a=0;a<c.length;++a)r.push(Qi.LineString.call(this,c[a]));return this.geometryFactory.createMultiLineString(r)},Polygon:function(c){for(var r=Qi.coordinates.call(this,c[0]),a=this.geometryFactory.createLinearRing(r),u=[],g=1;g<c.length;++g){var _=c[g],E=Qi.coordinates.call(this,_),P=this.geometryFactory.createLinearRing(E);u.push(P)}return this.geometryFactory.createPolygon(a,u)},MultiPolygon:function(c){for(var r=[],a=0;a<c.length;++a){var u=c[a];r.push(Qi.Polygon.call(this,u))}return this.geometryFactory.createMultiPolygon(r)},GeometryCollection:function(c){for(var r=[],a=0;a<c.length;++a){var u=c[a];r.push(this.read(u))}return this.geometryFactory.createGeometryCollection(r)}},Hn={coordinate:function(c){var r=[c.x,c.y];return c.z&&r.push(c.z),c.m&&r.push(c.m),r},Point:function(c){return{type:"Point",coordinates:Hn.coordinate.call(this,c.getCoordinate())}},MultiPoint:function(c){for(var r=[],a=0;a<c._geometries.length;++a){var u=c._geometries[a],g=Hn.Point.call(this,u);r.push(g.coordinates)}return{type:"MultiPoint",coordinates:r}},LineString:function(c){for(var r=[],a=c.getCoordinates(),u=0;u<a.length;++u){var g=a[u];r.push(Hn.coordinate.call(this,g))}return{type:"LineString",coordinates:r}},MultiLineString:function(c){for(var r=[],a=0;a<c._geometries.length;++a){var u=c._geometries[a],g=Hn.LineString.call(this,u);r.push(g.coordinates)}return{type:"MultiLineString",coordinates:r}},Polygon:function(c){var r=[],a=Hn.LineString.call(this,c._shell);r.push(a.coordinates);for(var u=0;u<c._holes.length;++u){var g=c._holes[u],_=Hn.LineString.call(this,g);r.push(_.coordinates)}return{type:"Polygon",coordinates:r}},MultiPolygon:function(c){for(var r=[],a=0;a<c._geometries.length;++a){var u=c._geometries[a],g=Hn.Polygon.call(this,u);r.push(g.coordinates)}return{type:"MultiPolygon",coordinates:r}},GeometryCollection:function(c){for(var r=[],a=0;a<c._geometries.length;++a){var u=c._geometries[a],g=u.getGeometryType();r.push(Hn[g].call(this,u))}return{type:"GeometryCollection",geometries:r}}};return{BufferOp:_o,GeoJSONReader:(function(){return l((function c(r){s(this,c),this.parser=new p1(r||new go)}),[{key:"read",value:function(c){return this.parser.read(c)}}])})(),GeoJSONWriter:(function(){return l((function c(){s(this,c),this.parser=new p1(this.geometryFactory)}),[{key:"write",value:function(c){return this.parser.write(c)}}])})()}}))})(kl)),kl.exports}var pM=gM();const mM=Pc(pM);function Ts(){return new Ol}function Ol(){this.reset()}Ol.prototype={constructor:Ol,reset:function(){this.s=this.t=0},add:function(i){ev(Nl,i,this.t),ev(this,Nl.s,this.s),this.s?this.t+=Nl.t:this.s=Nl.t},valueOf:function(){return this.s}};var Nl=new Ol;function ev(i,e,t){var n=i.s=e+t,s=n-e,o=n-s;i.t=e-o+(t-s)}var he=1e-6,te=Math.PI,bn=te/2,iv=te/4,Pn=te*2,ks=180/te,ji=te/180,Ge=Math.abs,vM=Math.atan,Ea=Math.atan2,me=Math.cos,ve=Math.sin,Sa=Math.sqrt;function nv(i){return i>1?0:i<-1?te:Math.acos(i)}function lr(i){return i>1?bn:i<-1?-bn:Math.asin(i)}function uh(){}function Rl(i,e){i&&rv.hasOwnProperty(i.type)&&rv[i.type](i,e)}var sv={Feature:function(i,e){Rl(i.geometry,e)},FeatureCollection:function(i,e){for(var t=i.features,n=-1,s=t.length;++n<s;)Rl(t[n].geometry,e)}},rv={Sphere:function(i,e){e.sphere()},Point:function(i,e){i=i.coordinates,e.point(i[0],i[1],i[2])},MultiPoint:function(i,e){for(var t=i.coordinates,n=-1,s=t.length;++n<s;)i=t[n],e.point(i[0],i[1],i[2])},LineString:function(i,e){xd(i.coordinates,e,0)},MultiLineString:function(i,e){for(var t=i.coordinates,n=-1,s=t.length;++n<s;)xd(t[n],e,0)},Polygon:function(i,e){av(i.coordinates,e)},MultiPolygon:function(i,e){for(var t=i.coordinates,n=-1,s=t.length;++n<s;)av(t[n],e)},GeometryCollection:function(i,e){for(var t=i.geometries,n=-1,s=t.length;++n<s;)Rl(t[n],e)}};function xd(i,e,t){var n=-1,s=i.length-t,o;for(e.lineStart();++n<s;)o=i[n],e.point(o[0],o[1],o[2]);e.lineEnd()}function av(i,e){var t=-1,n=i.length;for(e.polygonStart();++t<n;)xd(i[t],e,1);e.polygonEnd()}function yM(i,e){i&&sv.hasOwnProperty(i.type)?sv[i.type](i,e):Rl(i,e)}Ts(),Ts();function bd(i){return[Ea(i[1],i[0]),lr(i[2])]}function xa(i){var e=i[0],t=i[1],n=me(t);return[n*me(e),n*ve(e),ve(t)]}function Al(i,e){return i[0]*e[0]+i[1]*e[1]+i[2]*e[2]}function Dl(i,e){return[i[1]*e[2]-i[2]*e[1],i[2]*e[0]-i[0]*e[2],i[0]*e[1]-i[1]*e[0]]}function Pd(i,e){i[0]+=e[0],i[1]+=e[1],i[2]+=e[2]}function Ll(i,e){return[i[0]*e,i[1]*e,i[2]*e]}function Cd(i){var e=Sa(i[0]*i[0]+i[1]*i[1]+i[2]*i[2]);i[0]/=e,i[1]/=e,i[2]/=e}Ts();function ov(i,e){function t(n,s){return n=i(n,s),e(n[0],n[1])}return i.invert&&e.invert&&(t.invert=function(n,s){return n=e.invert(n,s),n&&i.invert(n[0],n[1])}),t}function Id(i,e){return[i>te?i-Pn:i<-te?i+Pn:i,e]}Id.invert=Id;function _M(i,e,t){return(i%=Pn)?e||t?ov(lv(i),uv(e,t)):lv(i):e||t?uv(e,t):Id}function hv(i){return function(e,t){return e+=i,[e>te?e-Pn:e<-te?e+Pn:e,t]}}function lv(i){var e=hv(i);return e.invert=hv(-i),e}function uv(i,e){var t=me(i),n=ve(i),s=me(e),o=ve(e);function h(l,d){var f=me(d),v=me(l)*f,m=ve(l)*f,y=ve(d),w=y*t+v*n;return[Ea(m*s-w*o,v*t-y*n),lr(w*s+m*o)]}return h.invert=function(l,d){var f=me(d),v=me(l)*f,m=ve(l)*f,y=ve(d),w=y*s-m*o;return[Ea(m*s+y*o,v*t+w*n),lr(w*t-v*n)]},h}function wM(i,e,t,n,s,o){if(t){var h=me(e),l=ve(e),d=n*t;s==null?(s=e+n*Pn,o=e-d/2):(s=cv(h,s),o=cv(h,o),(n>0?s<o:s>o)&&(s+=n*Pn));for(var f,v=s;n>0?v>o:v<o;v-=d)f=bd([h,-l*me(v),-l*ve(v)]),i.point(f[0],f[1])}}function cv(i,e){e=xa(e),e[0]-=i,Cd(e);var t=nv(-e[1]);return((-e[2]<0?-t:t)+Pn-he)%Pn}function dv(){var i=[],e;return{point:function(t,n){e.push([t,n])},lineStart:function(){i.push(e=[])},lineEnd:uh,rejoin:function(){i.length>1&&i.push(i.pop().concat(i.shift()))},result:function(){var t=i;return i=[],e=null,t}}}function EM(i,e,t,n,s,o){var h=i[0],l=i[1],d=e[0],f=e[1],v=0,m=1,y=d-h,w=f-l,S;if(S=t-h,!(!y&&S>0)){if(S/=y,y<0){if(S<v)return;S<m&&(m=S)}else if(y>0){if(S>m)return;S>v&&(v=S)}if(S=s-h,!(!y&&S<0)){if(S/=y,y<0){if(S>m)return;S>v&&(v=S)}else if(y>0){if(S<v)return;S<m&&(m=S)}if(S=n-l,!(!w&&S>0)){if(S/=w,w<0){if(S<v)return;S<m&&(m=S)}else if(w>0){if(S>m)return;S>v&&(v=S)}if(S=o-l,!(!w&&S<0)){if(S/=w,w<0){if(S>m)return;S>v&&(v=S)}else if(w>0){if(S<v)return;S<m&&(m=S)}return v>0&&(i[0]=h+v*y,i[1]=l+v*w),m<1&&(e[0]=h+m*y,e[1]=l+m*w),!0}}}}}function Fl(i,e){return Ge(i[0]-e[0])<he&&Ge(i[1]-e[1])<he}function Gl(i,e,t,n){this.x=i,this.z=e,this.o=t,this.e=n,this.v=!1,this.n=this.p=null}function fv(i,e,t,n,s){var o=[],h=[],l,d;if(i.forEach(function(S){if(!((T=S.length-1)<=0)){var T,N=S[0],j=S[T],C;if(Fl(N,j)){for(s.lineStart(),l=0;l<T;++l)s.point((N=S[l])[0],N[1]);s.lineEnd();return}o.push(C=new Gl(N,S,null,!0)),h.push(C.o=new Gl(N,null,C,!1)),o.push(C=new Gl(j,S,null,!1)),h.push(C.o=new Gl(j,null,C,!0))}}),!!o.length){for(h.sort(e),gv(o),gv(h),l=0,d=h.length;l<d;++l)h[l].e=t=!t;for(var f=o[0],v,m;;){for(var y=f,w=!0;y.v;)if((y=y.n)===f)return;v=y.z,s.lineStart();do{if(y.v=y.o.v=!0,y.e){if(w)for(l=0,d=v.length;l<d;++l)s.point((m=v[l])[0],m[1]);else n(y.x,y.n.x,1,s);y=y.n}else{if(w)for(v=y.p.z,l=v.length-1;l>=0;--l)s.point((m=v[l])[0],m[1]);else n(y.x,y.p.x,-1,s);y=y.p}y=y.o,v=y.z,w=!w}while(!y.v);s.lineEnd()}}}function gv(i){if(e=i.length){for(var e,t=0,n=i[0],s;++t<e;)n.n=s=i[t],s.p=n,n=s;n.n=s=i[0],s.p=n}}function pv(i,e){return i<e?-1:i>e?1:i>=e?0:NaN}function SM(i){return i.length===1&&(i=xM(i)),{left:function(e,t,n,s){for(n==null&&(n=0),s==null&&(s=e.length);n<s;){var o=n+s>>>1;i(e[o],t)<0?n=o+1:s=o}return n},right:function(e,t,n,s){for(n==null&&(n=0),s==null&&(s=e.length);n<s;){var o=n+s>>>1;i(e[o],t)>0?s=o:n=o+1}return n}}}function xM(i){return function(e,t){return pv(i(e),t)}}SM(pv);function mv(i){for(var e=i.length,t,n=-1,s=0,o,h;++n<e;)s+=i[n].length;for(o=new Array(s);--e>=0;)for(h=i[e],t=h.length;--t>=0;)o[--s]=h[t];return o}var ch=1e9,jl=-ch;function bM(i,e,t,n){function s(f,v){return i<=f&&f<=t&&e<=v&&v<=n}function o(f,v,m,y){var w=0,S=0;if(f==null||(w=h(f,m))!==(S=h(v,m))||d(f,v)<0^m>0)do y.point(w===0||w===3?i:t,w>1?n:e);while((w=(w+m+4)%4)!==S);else y.point(v[0],v[1])}function h(f,v){return Ge(f[0]-i)<he?v>0?0:3:Ge(f[0]-t)<he?v>0?2:1:Ge(f[1]-e)<he?v>0?1:0:v>0?3:2}function l(f,v){return d(f.x,v.x)}function d(f,v){var m=h(f,1),y=h(v,1);return m!==y?m-y:m===0?v[1]-f[1]:m===1?f[0]-v[0]:m===2?f[1]-v[1]:v[0]-f[0]}return function(f){var v=f,m=dv(),y,w,S,T,N,j,C,k,M,D,L,V={point:x,lineStart:F,lineEnd:U,polygonStart:R,polygonEnd:G};function x($,W){s($,W)&&v.point($,W)}function I(){for(var $=0,W=0,X=w.length;W<X;++W)for(var Y=w[W],et=1,J=Y.length,rt=Y[0],ht,Ot,ct=rt[0],_t=rt[1];et<J;++et)ht=ct,Ot=_t,rt=Y[et],ct=rt[0],_t=rt[1],Ot<=n?_t>n&&(ct-ht)*(n-Ot)>(_t-Ot)*(i-ht)&&++$:_t<=n&&(ct-ht)*(n-Ot)<(_t-Ot)*(i-ht)&&--$;return $}function R(){v=m,y=[],w=[],L=!0}function G(){var $=I(),W=L&&$,X=(y=mv(y)).length;(W||X)&&(f.polygonStart(),W&&(f.lineStart(),o(null,null,1,f),f.lineEnd()),X&&fv(y,l,$,o,f),f.polygonEnd()),v=f,y=w=S=null}function F(){V.point=z,w&&w.push(S=[]),D=!0,M=!1,C=k=NaN}function U(){y&&(z(T,N),j&&M&&m.rejoin(),y.push(m.result())),V.point=x,M&&v.lineEnd()}function z($,W){var X=s($,W);if(w&&S.push([$,W]),D)T=$,N=W,j=X,D=!1,X&&(v.lineStart(),v.point($,W));else if(X&&M)v.point($,W);else{var Y=[C=Math.max(jl,Math.min(ch,C)),k=Math.max(jl,Math.min(ch,k))],et=[$=Math.max(jl,Math.min(ch,$)),W=Math.max(jl,Math.min(ch,W))];EM(Y,et,i,e,t,n)?(M||(v.lineStart(),v.point(Y[0],Y[1])),v.point(et[0],et[1]),X||v.lineEnd(),L=!1):X&&(v.lineStart(),v.point($,W),L=!1)}C=$,k=W,M=X}return V}}var Md=Ts();function PM(i,e){var t=e[0],n=e[1],s=[ve(t),-me(t),0],o=0,h=0;Md.reset();for(var l=0,d=i.length;l<d;++l)if(v=(f=i[l]).length)for(var f,v,m=f[v-1],y=m[0],w=m[1]/2+iv,S=ve(w),T=me(w),N=0;N<v;++N,y=C,S=M,T=D,m=j){var j=f[N],C=j[0],k=j[1]/2+iv,M=ve(k),D=me(k),L=C-y,V=L>=0?1:-1,x=V*L,I=x>te,R=S*M;if(Md.add(Ea(R*V*ve(x),T*D+R*me(x))),o+=I?L+V*Pn:L,I^y>=t^C>=t){var G=Dl(xa(m),xa(j));Cd(G);var F=Dl(s,G);Cd(F);var U=(I^L>=0?-1:1)*lr(F[2]);(n>U||n===U&&(G[0]||G[1]))&&(h+=I^L>=0?1:-1)}}return(o<-he||o<he&&Md<-he)^h&1}Ts();function vv(i){return i}Ts(),Ts();var ba=1/0,Bl=ba,dh=-ba,zl=dh,yv={point:CM,lineStart:uh,lineEnd:uh,polygonStart:uh,polygonEnd:uh,result:function(){var i=[[ba,Bl],[dh,zl]];return dh=zl=-(Bl=ba=1/0),i}};function CM(i,e){i<ba&&(ba=i),i>dh&&(dh=i),e<Bl&&(Bl=e),e>zl&&(zl=e)}Ts();function _v(i,e,t,n){return function(s,o){var h=e(o),l=s.invert(n[0],n[1]),d=dv(),f=e(d),v=!1,m,y,w,S={point:T,lineStart:j,lineEnd:C,polygonStart:function(){S.point=k,S.lineStart=M,S.lineEnd=D,y=[],m=[]},polygonEnd:function(){S.point=T,S.lineStart=j,S.lineEnd=C,y=mv(y);var L=PM(m,l);y.length?(v||(o.polygonStart(),v=!0),fv(y,MM,L,t,o)):L&&(v||(o.polygonStart(),v=!0),o.lineStart(),t(null,null,1,o),o.lineEnd()),v&&(o.polygonEnd(),v=!1),y=m=null},sphere:function(){o.polygonStart(),o.lineStart(),t(null,null,1,o),o.lineEnd(),o.polygonEnd()}};function T(L,V){var x=s(L,V);i(L=x[0],V=x[1])&&o.point(L,V)}function N(L,V){var x=s(L,V);h.point(x[0],x[1])}function j(){S.point=N,h.lineStart()}function C(){S.point=T,h.lineEnd()}function k(L,V){w.push([L,V]);var x=s(L,V);f.point(x[0],x[1])}function M(){f.lineStart(),w=[]}function D(){k(w[0][0],w[0][1]),f.lineEnd();var L=f.clean(),V=d.result(),x,I=V.length,R,G,F;if(w.pop(),m.push(w),w=null,!!I){if(L&1){if(G=V[0],(R=G.length-1)>0){for(v||(o.polygonStart(),v=!0),o.lineStart(),x=0;x<R;++x)o.point((F=G[x])[0],F[1]);o.lineEnd()}return}I>1&&L&2&&V.push(V.pop().concat(V.shift())),y.push(V.filter(IM))}}return S}}function IM(i){return i.length>1}function MM(i,e){return((i=i.x)[0]<0?i[1]-bn-he:bn-i[1])-((e=e.x)[0]<0?e[1]-bn-he:bn-e[1])}const wv=_v(function(){return!0},TM,OM,[-te,-bn]);function TM(i){var e=NaN,t=NaN,n=NaN,s;return{lineStart:function(){i.lineStart(),s=1},point:function(o,h){var l=o>0?te:-te,d=Ge(o-e);Ge(d-te)<he?(i.point(e,t=(t+h)/2>0?bn:-bn),i.point(n,t),i.lineEnd(),i.lineStart(),i.point(l,t),i.point(o,t),s=0):n!==l&&d>=te&&(Ge(e-n)<he&&(e-=n*he),Ge(o-l)<he&&(o-=l*he),t=kM(e,t,o,h),i.point(n,t),i.lineEnd(),i.lineStart(),i.point(l,t),s=0),i.point(e=o,t=h),n=l},lineEnd:function(){i.lineEnd(),e=t=NaN},clean:function(){return 2-s}}}function kM(i,e,t,n){var s,o,h=ve(i-t);return Ge(h)>he?vM((ve(e)*(o=me(n))*ve(t)-ve(n)*(s=me(e))*ve(i))/(s*o*h)):(e+n)/2}function OM(i,e,t,n){var s;if(i==null)s=t*bn,n.point(-te,s),n.point(0,s),n.point(te,s),n.point(te,0),n.point(te,-s),n.point(0,-s),n.point(-te,-s),n.point(-te,0),n.point(-te,s);else if(Ge(i[0]-e[0])>he){var o=i[0]<e[0]?te:-te;s=t*o/2,n.point(-o,s),n.point(0,s),n.point(o,s)}else n.point(e[0],e[1])}function NM(i,e){var t=me(i),n=t>0,s=Ge(t)>he;function o(v,m,y,w){wM(w,i,e,y,v,m)}function h(v,m){return me(v)*me(m)>t}function l(v){var m,y,w,S,T;return{lineStart:function(){S=w=!1,T=1},point:function(N,j){var C=[N,j],k,M=h(N,j),D=n?M?0:f(N,j):M?f(N+(N<0?te:-te),j):0;if(!m&&(S=w=M)&&v.lineStart(),M!==w&&(k=d(m,C),(!k||Fl(m,k)||Fl(C,k))&&(C[0]+=he,C[1]+=he,M=h(C[0],C[1]))),M!==w)T=0,M?(v.lineStart(),k=d(C,m),v.point(k[0],k[1])):(k=d(m,C),v.point(k[0],k[1]),v.lineEnd()),m=k;else if(s&&m&&n^M){var L;!(D&y)&&(L=d(C,m,!0))&&(T=0,n?(v.lineStart(),v.point(L[0][0],L[0][1]),v.point(L[1][0],L[1][1]),v.lineEnd()):(v.point(L[1][0],L[1][1]),v.lineEnd(),v.lineStart(),v.point(L[0][0],L[0][1])))}M&&(!m||!Fl(m,C))&&v.point(C[0],C[1]),m=C,w=M,y=D},lineEnd:function(){w&&v.lineEnd(),m=null},clean:function(){return T|(S&&w)<<1}}}function d(v,m,y){var w=xa(v),S=xa(m),T=[1,0,0],N=Dl(w,S),j=Al(N,N),C=N[0],k=j-C*C;if(!k)return!y&&v;var M=t*j/k,D=-t*C/k,L=Dl(T,N),V=Ll(T,M),x=Ll(N,D);Pd(V,x);var I=L,R=Al(V,I),G=Al(I,I),F=R*R-G*(Al(V,V)-1);if(!(F<0)){var U=Sa(F),z=Ll(I,(-R-U)/G);if(Pd(z,V),z=bd(z),!y)return z;var $=v[0],W=m[0],X=v[1],Y=m[1],et;W<$&&(et=$,$=W,W=et);var J=W-$,rt=Ge(J-te)<he,ht=rt||J<he;if(!rt&&Y<X&&(et=X,X=Y,Y=et),ht?rt?X+Y>0^z[1]<(Ge(z[0]-$)<he?X:Y):X<=z[1]&&z[1]<=Y:J>te^($<=z[0]&&z[0]<=W)){var Ot=Ll(I,(-R+U)/G);return Pd(Ot,V),[z,bd(Ot)]}}}function f(v,m){var y=n?i:te-i,w=0;return v<-y?w|=1:v>y&&(w|=2),m<-y?w|=4:m>y&&(w|=8),w}return _v(h,l,o,n?[0,-i]:[-te,i-te])}function Ev(i){return function(e){var t=new Td;for(var n in i)t[n]=i[n];return t.stream=e,t}}function Td(){}Td.prototype={constructor:Td,point:function(i,e){this.stream.point(i,e)},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()}};function Sv(i,e,t){var n=e[1][0]-e[0][0],s=e[1][1]-e[0][1],o=i.clipExtent&&i.clipExtent();i.scale(150).translate([0,0]),o!=null&&i.clipExtent(null),yM(t,i.stream(yv));var h=yv.result(),l=Math.min(n/(h[1][0]-h[0][0]),s/(h[1][1]-h[0][1])),d=+e[0][0]+(n-l*(h[1][0]+h[0][0]))/2,f=+e[0][1]+(s-l*(h[1][1]+h[0][1]))/2;return o!=null&&i.clipExtent(o),i.scale(l*150).translate([d,f])}function RM(i,e,t){return Sv(i,[[0,0],e],t)}var xv=16,AM=me(30*ji);function bv(i,e){return+e?LM(i,e):DM(i)}function DM(i){return Ev({point:function(e,t){e=i(e,t),this.stream.point(e[0],e[1])}})}function LM(i,e){function t(n,s,o,h,l,d,f,v,m,y,w,S,T,N){var j=f-n,C=v-s,k=j*j+C*C;if(k>4*e&&T--){var M=h+y,D=l+w,L=d+S,V=Sa(M*M+D*D+L*L),x=lr(L/=V),I=Ge(Ge(L)-1)<he||Ge(o-m)<he?(o+m)/2:Ea(D,M),R=i(I,x),G=R[0],F=R[1],U=G-n,z=F-s,$=C*U-j*z;($*$/k>e||Ge((j*U+C*z)/k-.5)>.3||h*y+l*w+d*S<AM)&&(t(n,s,o,h,l,d,G,F,I,M/=V,D/=V,L,T,N),N.point(G,F),t(G,F,I,M,D,L,f,v,m,y,w,S,T,N))}}return function(n){var s,o,h,l,d,f,v,m,y,w,S,T,N={point:j,lineStart:C,lineEnd:M,polygonStart:function(){n.polygonStart(),N.lineStart=D},polygonEnd:function(){n.polygonEnd(),N.lineStart=C}};function j(x,I){x=i(x,I),n.point(x[0],x[1])}function C(){m=NaN,N.point=k,n.lineStart()}function k(x,I){var R=xa([x,I]),G=i(x,I);t(m,y,v,w,S,T,m=G[0],y=G[1],v=x,w=R[0],S=R[1],T=R[2],xv,n),n.point(m,y)}function M(){N.point=j,n.lineEnd()}function D(){C(),N.point=L,N.lineEnd=V}function L(x,I){k(s=x,I),o=m,h=y,l=w,d=S,f=T,N.point=k}function V(){t(m,y,v,w,S,T,o,h,s,l,d,f,xv,n),N.lineEnd=M,M()}return N}}var FM=Ev({point:function(i,e){this.stream.point(i*ji,e*ji)}});function GM(i){return jM(function(){return i})()}function jM(i){var e,t=150,n=480,s=250,o,h,l=0,d=0,f=0,v=0,m=0,y,w,S=null,T=wv,N=null,j,C,k,M=vv,D=.5,L=bv(G,D),V,x;function I(z){return z=w(z[0]*ji,z[1]*ji),[z[0]*t+o,h-z[1]*t]}function R(z){return z=w.invert((z[0]-o)/t,(h-z[1])/t),z&&[z[0]*ks,z[1]*ks]}function G(z,$){return z=e(z,$),[z[0]*t+o,h-z[1]*t]}I.stream=function(z){return V&&x===z?V:V=FM(T(y,L(M(x=z))))},I.clipAngle=function(z){return arguments.length?(T=+z?NM(S=z*ji,6*ji):(S=null,wv),U()):S*ks},I.clipExtent=function(z){return arguments.length?(M=z==null?(N=j=C=k=null,vv):bM(N=+z[0][0],j=+z[0][1],C=+z[1][0],k=+z[1][1]),U()):N==null?null:[[N,j],[C,k]]},I.scale=function(z){return arguments.length?(t=+z,F()):t},I.translate=function(z){return arguments.length?(n=+z[0],s=+z[1],F()):[n,s]},I.center=function(z){return arguments.length?(l=z[0]%360*ji,d=z[1]%360*ji,F()):[l*ks,d*ks]},I.rotate=function(z){return arguments.length?(f=z[0]%360*ji,v=z[1]%360*ji,m=z.length>2?z[2]%360*ji:0,F()):[f*ks,v*ks,m*ks]},I.precision=function(z){return arguments.length?(L=bv(G,D=z*z),U()):Sa(D)},I.fitExtent=function(z,$){return Sv(I,z,$)},I.fitSize=function(z,$){return RM(I,z,$)};function F(){w=ov(y=_M(f,v,m),e);var z=e(l,d);return o=n-z[0]*t,h=s+z[1]*t,U()}function U(){return V=x=null,I}return function(){return e=i.apply(this,arguments),I.invert=e.invert&&R,F()}}function Pv(i){return function(e,t){var n=me(e),s=me(t),o=i(n*s);return[o*s*ve(e),o*ve(t)]}}function Cv(i){return function(e,t){var n=Sa(e*e+t*t),s=i(n),o=ve(s),h=me(s);return[Ea(e*o,n*h),lr(n&&t*o/n)]}}var BM=Pv(function(i){return Sa(2/(1+i))});BM.invert=Cv(function(i){return 2*lr(i/2)});var Iv=Pv(function(i){return(i=nv(i))&&i/ve(i)});Iv.invert=Cv(function(i){return i});function zM(){return GM(Iv).scale(79.4188).clipAngle(179.999)}function Mv(i,e){return[i,e]}Mv.invert=Mv;var{BufferOp:UM,GeoJSONReader:VM,GeoJSONWriter:qM}=mM;function $M(i,e,t){t=t||{};var n=t.units||"kilometers",s=t.steps||8;if(!i)throw new Error("geojson is required");if(typeof t!="object")throw new Error("options must be an object");if(typeof s!="number")throw new Error("steps must be an number");if(e===void 0)throw new Error("radius is required");if(s<=0)throw new Error("steps must be greater than 0");var o=[];switch(i.type){case"GeometryCollection":return ar(i,function(h){var l=Ul(h,e,n,s);l&&o.push(l)}),ae(o);case"FeatureCollection":return Is(i,function(h){var l=Ul(h,e,n,s);l&&Is(l,function(d){d&&o.push(d)})}),ae(o)}return Ul(i,e,n,s)}function Ul(i,e,t,n){var s=i.properties||{},o=i.type==="Feature"?i.geometry:i;if(o.type==="GeometryCollection"){var h=[];return ar(i,function(T){var N=Ul(T,e,t,n);N&&h.push(N)}),ae(h)}var l=WM(o),d={type:o.type,coordinates:kv(o.coordinates,l)},f=new VM,v=f.read(d),m=ad(od(e,t),"meters"),y=UM.bufferOp(v,m,n),w=new qM;if(y=w.write(y),!Tv(y.coordinates)){var S={type:y.type,coordinates:Ov(y.coordinates,l)};return ni(S,s)}}function Tv(i){return Array.isArray(i[0])?Tv(i[0]):isNaN(i[0])}function kv(i,e){return typeof i[0]!="object"?e(i):i.map(function(t){return kv(t,e)})}function Ov(i,e){return typeof i[0]!="object"?e.invert(i):i.map(function(t){return Ov(t,e)})}function WM(i){var e=Q0(i).geometry.coordinates,t=[-e[0],-e[1]];return zM().rotate(t).scale(Le)}function kd(i,e={}){let t=0,n=0,s=0;return rr(i,function(o){t+=o[0],n+=o[1],s++},!0),Xt([t/s,n/s],e.properties)}var Vl={exports:{}},ql={exports:{}},HM=ql.exports,Nv;function XM(){return Nv||(Nv=1,(function(i,e){(function(t,n){i.exports=n()})(HM,function(){function t(C,k,M,D,L){(function V(x,I,R,G,F){for(;G>R;){if(G-R>600){var U=G-R+1,z=I-R+1,$=Math.log(U),W=.5*Math.exp(2*$/3),X=.5*Math.sqrt($*W*(U-W)/U)*(z-U/2<0?-1:1),Y=Math.max(R,Math.floor(I-z*W/U+X)),et=Math.min(G,Math.floor(I+(U-z)*W/U+X));V(x,I,Y,et,F)}var J=x[I],rt=R,ht=G;for(n(x,R,I),F(x[G],J)>0&&n(x,R,G);rt<ht;){for(n(x,rt,ht),rt++,ht--;F(x[rt],J)<0;)rt++;for(;F(x[ht],J)>0;)ht--}F(x[R],J)===0?n(x,R,ht):n(x,++ht,G),ht<=I&&(R=ht+1),I<=ht&&(G=ht-1)}})(C,k,M||0,D||C.length-1,L||s)}function n(C,k,M){var D=C[k];C[k]=C[M],C[M]=D}function s(C,k){return C<k?-1:C>k?1:0}var o=function(C){C===void 0&&(C=9),this._maxEntries=Math.max(4,C),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function h(C,k,M){if(!M)return k.indexOf(C);for(var D=0;D<k.length;D++)if(M(C,k[D]))return D;return-1}function l(C,k){d(C,0,C.children.length,k,C)}function d(C,k,M,D,L){L||(L=N(null)),L.minX=1/0,L.minY=1/0,L.maxX=-1/0,L.maxY=-1/0;for(var V=k;V<M;V++){var x=C.children[V];f(L,C.leaf?D(x):x)}return L}function f(C,k){return C.minX=Math.min(C.minX,k.minX),C.minY=Math.min(C.minY,k.minY),C.maxX=Math.max(C.maxX,k.maxX),C.maxY=Math.max(C.maxY,k.maxY),C}function v(C,k){return C.minX-k.minX}function m(C,k){return C.minY-k.minY}function y(C){return(C.maxX-C.minX)*(C.maxY-C.minY)}function w(C){return C.maxX-C.minX+(C.maxY-C.minY)}function S(C,k){return C.minX<=k.minX&&C.minY<=k.minY&&k.maxX<=C.maxX&&k.maxY<=C.maxY}function T(C,k){return k.minX<=C.maxX&&k.minY<=C.maxY&&k.maxX>=C.minX&&k.maxY>=C.minY}function N(C){return{children:C,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function j(C,k,M,D,L){for(var V=[k,M];V.length;)if(!((M=V.pop())-(k=V.pop())<=D)){var x=k+Math.ceil((M-k)/D/2)*D;t(C,x,k,M,L),V.push(k,x,x,M)}}return o.prototype.all=function(){return this._all(this.data,[])},o.prototype.search=function(C){var k=this.data,M=[];if(!T(C,k))return M;for(var D=this.toBBox,L=[];k;){for(var V=0;V<k.children.length;V++){var x=k.children[V],I=k.leaf?D(x):x;T(C,I)&&(k.leaf?M.push(x):S(C,I)?this._all(x,M):L.push(x))}k=L.pop()}return M},o.prototype.collides=function(C){var k=this.data;if(!T(C,k))return!1;for(var M=[];k;){for(var D=0;D<k.children.length;D++){var L=k.children[D],V=k.leaf?this.toBBox(L):L;if(T(C,V)){if(k.leaf||S(C,V))return!0;M.push(L)}}k=M.pop()}return!1},o.prototype.load=function(C){if(!C||!C.length)return this;if(C.length<this._minEntries){for(var k=0;k<C.length;k++)this.insert(C[k]);return this}var M=this._build(C.slice(),0,C.length-1,0);if(this.data.children.length)if(this.data.height===M.height)this._splitRoot(this.data,M);else{if(this.data.height<M.height){var D=this.data;this.data=M,M=D}this._insert(M,this.data.height-M.height-1,!0)}else this.data=M;return this},o.prototype.insert=function(C){return C&&this._insert(C,this.data.height-1),this},o.prototype.clear=function(){return this.data=N([]),this},o.prototype.remove=function(C,k){if(!C)return this;for(var M,D,L,V=this.data,x=this.toBBox(C),I=[],R=[];V||I.length;){if(V||(V=I.pop(),D=I[I.length-1],M=R.pop(),L=!0),V.leaf){var G=h(C,V.children,k);if(G!==-1)return V.children.splice(G,1),I.push(V),this._condense(I),this}L||V.leaf||!S(V,x)?D?(M++,V=D.children[M],L=!1):V=null:(I.push(V),R.push(M),M=0,D=V,V=V.children[0])}return this},o.prototype.toBBox=function(C){return C},o.prototype.compareMinX=function(C,k){return C.minX-k.minX},o.prototype.compareMinY=function(C,k){return C.minY-k.minY},o.prototype.toJSON=function(){return this.data},o.prototype.fromJSON=function(C){return this.data=C,this},o.prototype._all=function(C,k){for(var M=[];C;)C.leaf?k.push.apply(k,C.children):M.push.apply(M,C.children),C=M.pop();return k},o.prototype._build=function(C,k,M,D){var L,V=M-k+1,x=this._maxEntries;if(V<=x)return l(L=N(C.slice(k,M+1)),this.toBBox),L;D||(D=Math.ceil(Math.log(V)/Math.log(x)),x=Math.ceil(V/Math.pow(x,D-1))),(L=N([])).leaf=!1,L.height=D;var I=Math.ceil(V/x),R=I*Math.ceil(Math.sqrt(x));j(C,k,M,R,this.compareMinX);for(var G=k;G<=M;G+=R){var F=Math.min(G+R-1,M);j(C,G,F,I,this.compareMinY);for(var U=G;U<=F;U+=I){var z=Math.min(U+I-1,F);L.children.push(this._build(C,U,z,D-1))}}return l(L,this.toBBox),L},o.prototype._chooseSubtree=function(C,k,M,D){for(;D.push(k),!k.leaf&&D.length-1!==M;){for(var L=1/0,V=1/0,x=void 0,I=0;I<k.children.length;I++){var R=k.children[I],G=y(R),F=(U=C,z=R,(Math.max(z.maxX,U.maxX)-Math.min(z.minX,U.minX))*(Math.max(z.maxY,U.maxY)-Math.min(z.minY,U.minY))-G);F<V?(V=F,L=G<L?G:L,x=R):F===V&&G<L&&(L=G,x=R)}k=x||k.children[0]}var U,z;return k},o.prototype._insert=function(C,k,M){var D=M?C:this.toBBox(C),L=[],V=this._chooseSubtree(D,this.data,k,L);for(V.children.push(C),f(V,D);k>=0&&L[k].children.length>this._maxEntries;)this._split(L,k),k--;this._adjustParentBBoxes(D,L,k)},o.prototype._split=function(C,k){var M=C[k],D=M.children.length,L=this._minEntries;this._chooseSplitAxis(M,L,D);var V=this._chooseSplitIndex(M,L,D),x=N(M.children.splice(V,M.children.length-V));x.height=M.height,x.leaf=M.leaf,l(M,this.toBBox),l(x,this.toBBox),k?C[k-1].children.push(x):this._splitRoot(M,x)},o.prototype._splitRoot=function(C,k){this.data=N([C,k]),this.data.height=C.height+1,this.data.leaf=!1,l(this.data,this.toBBox)},o.prototype._chooseSplitIndex=function(C,k,M){for(var D,L,V,x,I,R,G,F=1/0,U=1/0,z=k;z<=M-k;z++){var $=d(C,0,z,this.toBBox),W=d(C,z,M,this.toBBox),X=(L=$,V=W,x=void 0,I=void 0,R=void 0,G=void 0,x=Math.max(L.minX,V.minX),I=Math.max(L.minY,V.minY),R=Math.min(L.maxX,V.maxX),G=Math.min(L.maxY,V.maxY),Math.max(0,R-x)*Math.max(0,G-I)),Y=y($)+y(W);X<F?(F=X,D=z,U=Y<U?Y:U):X===F&&Y<U&&(U=Y,D=z)}return D||M-k},o.prototype._chooseSplitAxis=function(C,k,M){var D=C.leaf?this.compareMinX:v,L=C.leaf?this.compareMinY:m;this._allDistMargin(C,k,M,D)<this._allDistMargin(C,k,M,L)&&C.children.sort(D)},o.prototype._allDistMargin=function(C,k,M,D){C.children.sort(D);for(var L=this.toBBox,V=d(C,0,k,L),x=d(C,M-k,M,L),I=w(V)+w(x),R=k;R<M-k;R++){var G=C.children[R];f(V,C.leaf?L(G):G),I+=w(V)}for(var F=M-k-1;F>=k;F--){var U=C.children[F];f(x,C.leaf?L(U):U),I+=w(x)}return I},o.prototype._adjustParentBBoxes=function(C,k,M){for(var D=M;D>=0;D--)f(k[D],C)},o.prototype._condense=function(C){for(var k=C.length-1,M=void 0;k>=0;k--)C[k].children.length===0?k>0?(M=C[k-1].children).splice(M.indexOf(C[k]),1):this.clear():l(C[k],this.toBBox)},o})})(ql)),ql.exports}class YM{constructor(e=[],t=JM){if(this.data=e,this.length=this.data.length,this.compare=t,this.length>0)for(let n=(this.length>>1)-1;n>=0;n--)this._down(n)}push(e){this.data.push(e),this.length++,this._up(this.length-1)}pop(){if(this.length===0)return;const e=this.data[0],t=this.data.pop();return this.length--,this.length>0&&(this.data[0]=t,this._down(0)),e}peek(){return this.data[0]}_up(e){const{data:t,compare:n}=this,s=t[e];for(;e>0;){const o=e-1>>1,h=t[o];if(n(s,h)>=0)break;t[e]=h,e=o}t[e]=s}_down(e){const{data:t,compare:n}=this,s=this.length>>1,o=t[e];for(;e<s;){let h=(e<<1)+1,l=t[h];const d=h+1;if(d<this.length&&n(t[d],l)<0&&(h=d,l=t[d]),n(l,o)>=0)break;t[e]=l,e=h}t[e]=o}}function JM(i,e){return i<e?-1:i>e?1:0}const KM=Xw(Object.freeze(Object.defineProperty({__proto__:null,default:YM},Symbol.toStringTag,{value:"Module"})));var fh={exports:{}},Od,Rv;function ZM(){return Rv||(Rv=1,Od=function(e,t,n,s){var o=e[0],h=e[1],l=!1;n===void 0&&(n=0),s===void 0&&(s=t.length);for(var d=(s-n)/2,f=0,v=d-1;f<d;v=f++){var m=t[n+f*2+0],y=t[n+f*2+1],w=t[n+v*2+0],S=t[n+v*2+1],T=y>h!=S>h&&o<(w-m)*(h-y)/(S-y)+m;T&&(l=!l)}return l}),Od}var Nd,Av;function QM(){return Av||(Av=1,Nd=function(e,t,n,s){var o=e[0],h=e[1],l=!1;n===void 0&&(n=0),s===void 0&&(s=t.length);for(var d=s-n,f=0,v=d-1;f<d;v=f++){var m=t[f+n][0],y=t[f+n][1],w=t[v+n][0],S=t[v+n][1],T=y>h!=S>h&&o<(w-m)*(h-y)/(S-y)+m;T&&(l=!l)}return l}),Nd}var Dv;function tT(){if(Dv)return fh.exports;Dv=1;var i=ZM(),e=QM();return fh.exports=function(n,s,o,h){return s.length>0&&Array.isArray(s[0])?e(n,s,o,h):i(n,s,o,h)},fh.exports.nested=e,fh.exports.flat=i,fh.exports}var gh={exports:{}},eT=gh.exports,Lv;function iT(){return Lv||(Lv=1,(function(i,e){(function(t,n){n(e)})(eT,function(t){const s=33306690738754706e-32;function o(T,N,j,C,k){let M,D,L,V,x=N[0],I=C[0],R=0,G=0;I>x==I>-x?(M=x,x=N[++R]):(M=I,I=C[++G]);let F=0;if(R<T&&G<j)for(I>x==I>-x?(L=M-((D=x+M)-x),x=N[++R]):(L=M-((D=I+M)-I),I=C[++G]),M=D,L!==0&&(k[F++]=L);R<T&&G<j;)I>x==I>-x?(L=M-((D=M+x)-(V=D-M))+(x-V),x=N[++R]):(L=M-((D=M+I)-(V=D-M))+(I-V),I=C[++G]),M=D,L!==0&&(k[F++]=L);for(;R<T;)L=M-((D=M+x)-(V=D-M))+(x-V),x=N[++R],M=D,L!==0&&(k[F++]=L);for(;G<j;)L=M-((D=M+I)-(V=D-M))+(I-V),I=C[++G],M=D,L!==0&&(k[F++]=L);return M===0&&F!==0||(k[F++]=M),F}function h(T){return new Float64Array(T)}const l=33306690738754716e-32,d=22204460492503146e-32,f=11093356479670487e-47,v=h(4),m=h(8),y=h(12),w=h(16),S=h(4);t.orient2d=function(T,N,j,C,k,M){const D=(N-M)*(j-k),L=(T-k)*(C-M),V=D-L;if(D===0||L===0||D>0!=L>0)return V;const x=Math.abs(D+L);return Math.abs(V)>=l*x?V:-(function(I,R,G,F,U,z,$){let W,X,Y,et,J,rt,ht,Ot,ct,_t,Ct,Lt,K,Qt,zt,gt,A,at;const Pt=I-U,It=G-U,re=R-z,le=F-z;J=(zt=(Ot=Pt-(ht=(rt=134217729*Pt)-(rt-Pt)))*(_t=le-(ct=(rt=134217729*le)-(rt-le)))-((Qt=Pt*le)-ht*ct-Ot*ct-ht*_t))-(Ct=zt-(A=(Ot=re-(ht=(rt=134217729*re)-(rt-re)))*(_t=It-(ct=(rt=134217729*It)-(rt-It)))-((gt=re*It)-ht*ct-Ot*ct-ht*_t))),v[0]=zt-(Ct+J)+(J-A),J=(K=Qt-((Lt=Qt+Ct)-(J=Lt-Qt))+(Ct-J))-(Ct=K-gt),v[1]=K-(Ct+J)+(J-gt),J=(at=Lt+Ct)-Lt,v[2]=Lt-(at-J)+(Ct-J),v[3]=at;let Vn=(function(Fg,Vt){let Ws=Vt[0];for(let Hs=1;Hs<Fg;Hs++)Ws+=Vt[Hs];return Ws})(4,v),ut=d*$;if(Vn>=ut||-Vn>=ut||(W=I-(Pt+(J=I-Pt))+(J-U),Y=G-(It+(J=G-It))+(J-U),X=R-(re+(J=R-re))+(J-z),et=F-(le+(J=F-le))+(J-z),W===0&&X===0&&Y===0&&et===0)||(ut=f*$+s*Math.abs(Vn),(Vn+=Pt*et+le*W-(re*Y+It*X))>=ut||-Vn>=ut))return Vn;J=(zt=(Ot=W-(ht=(rt=134217729*W)-(rt-W)))*(_t=le-(ct=(rt=134217729*le)-(rt-le)))-((Qt=W*le)-ht*ct-Ot*ct-ht*_t))-(Ct=zt-(A=(Ot=X-(ht=(rt=134217729*X)-(rt-X)))*(_t=It-(ct=(rt=134217729*It)-(rt-It)))-((gt=X*It)-ht*ct-Ot*ct-ht*_t))),S[0]=zt-(Ct+J)+(J-A),J=(K=Qt-((Lt=Qt+Ct)-(J=Lt-Qt))+(Ct-J))-(Ct=K-gt),S[1]=K-(Ct+J)+(J-gt),J=(at=Lt+Ct)-Lt,S[2]=Lt-(at-J)+(Ct-J),S[3]=at;const Tu=o(4,v,4,S,m);J=(zt=(Ot=Pt-(ht=(rt=134217729*Pt)-(rt-Pt)))*(_t=et-(ct=(rt=134217729*et)-(rt-et)))-((Qt=Pt*et)-ht*ct-Ot*ct-ht*_t))-(Ct=zt-(A=(Ot=re-(ht=(rt=134217729*re)-(rt-re)))*(_t=Y-(ct=(rt=134217729*Y)-(rt-Y)))-((gt=re*Y)-ht*ct-Ot*ct-ht*_t))),S[0]=zt-(Ct+J)+(J-A),J=(K=Qt-((Lt=Qt+Ct)-(J=Lt-Qt))+(Ct-J))-(Ct=K-gt),S[1]=K-(Ct+J)+(J-gt),J=(at=Lt+Ct)-Lt,S[2]=Lt-(at-J)+(Ct-J),S[3]=at;const ku=o(Tu,m,4,S,y);J=(zt=(Ot=W-(ht=(rt=134217729*W)-(rt-W)))*(_t=et-(ct=(rt=134217729*et)-(rt-et)))-((Qt=W*et)-ht*ct-Ot*ct-ht*_t))-(Ct=zt-(A=(Ot=X-(ht=(rt=134217729*X)-(rt-X)))*(_t=Y-(ct=(rt=134217729*Y)-(rt-Y)))-((gt=X*Y)-ht*ct-Ot*ct-ht*_t))),S[0]=zt-(Ct+J)+(J-A),J=(K=Qt-((Lt=Qt+Ct)-(J=Lt-Qt))+(Ct-J))-(Ct=K-gt),S[1]=K-(Ct+J)+(J-gt),J=(at=Lt+Ct)-Lt,S[2]=Lt-(at-J)+(Ct-J),S[3]=at;const ds=o(ku,y,4,S,w);return w[ds-1]})(T,N,j,C,k,M,x)},t.orient2dfast=function(T,N,j,C,k,M){return(N-M)*(j-k)-(T-k)*(C-M)},Object.defineProperty(t,"__esModule",{value:!0})})})(gh,gh.exports)),gh.exports}var Fv;function nT(){if(Fv)return Vl.exports;Fv=1;var i=XM(),e=KM,t=tT(),n=iT().orient2d;e.default&&(e=e.default),Vl.exports=s,Vl.exports.default=s;function s(M,D,L){D=Math.max(0,D===void 0?2:D),L=L||0;var V=w(M),x=new i(16);x.toBBox=function(ht){return{minX:ht[0],minY:ht[1],maxX:ht[0],maxY:ht[1]}},x.compareMinX=function(ht,Ot){return ht[0]-Ot[0]},x.compareMinY=function(ht,Ot){return ht[1]-Ot[1]},x.load(M);for(var I=[],R=0,G;R<V.length;R++){var F=V[R];x.remove(F),G=S(F,G),I.push(G)}var U=new i(16);for(R=0;R<I.length;R++)U.insert(y(I[R]));for(var z=D*D,$=L*L;I.length;){var W=I.shift(),X=W.p,Y=W.next.p,et=T(X,Y);if(!(et<$)){var J=et/z;F=o(x,W.prev.p,X,Y,W.next.next.p,J,U),F&&Math.min(T(F,X),T(F,Y))<=J&&(I.push(W),I.push(S(F,W)),x.remove(F),U.remove(W),U.insert(y(W)),U.insert(y(W.next)))}}W=G;var rt=[];do rt.push(W.p),W=W.next;while(W!==G);return rt.push(W.p),rt}function o(M,D,L,V,x,I,R){for(var G=new e([],h),F=M.data;F;){for(var U=0;U<F.children.length;U++){var z=F.children[U],$=F.leaf?N(z,L,V):l(L,V,z);$>I||G.push({node:z,dist:$})}for(;G.length&&!G.peek().node.children;){var W=G.pop(),X=W.node,Y=N(X,D,L),et=N(X,V,x);if(W.dist<Y&&W.dist<et&&f(L,X,R)&&f(V,X,R))return X}F=G.pop(),F&&(F=F.node)}return null}function h(M,D){return M.dist-D.dist}function l(M,D,L){if(d(M,L)||d(D,L))return 0;var V=j(M[0],M[1],D[0],D[1],L.minX,L.minY,L.maxX,L.minY);if(V===0)return 0;var x=j(M[0],M[1],D[0],D[1],L.minX,L.minY,L.minX,L.maxY);if(x===0)return 0;var I=j(M[0],M[1],D[0],D[1],L.maxX,L.minY,L.maxX,L.maxY);if(I===0)return 0;var R=j(M[0],M[1],D[0],D[1],L.minX,L.maxY,L.maxX,L.maxY);return R===0?0:Math.min(V,x,I,R)}function d(M,D){return M[0]>=D.minX&&M[0]<=D.maxX&&M[1]>=D.minY&&M[1]<=D.maxY}function f(M,D,L){for(var V=Math.min(M[0],D[0]),x=Math.min(M[1],D[1]),I=Math.max(M[0],D[0]),R=Math.max(M[1],D[1]),G=L.search({minX:V,minY:x,maxX:I,maxY:R}),F=0;F<G.length;F++)if(m(G[F].p,G[F].next.p,M,D))return!1;return!0}function v(M,D,L){return n(M[0],M[1],D[0],D[1],L[0],L[1])}function m(M,D,L,V){return M!==V&&D!==L&&v(M,D,L)>0!=v(M,D,V)>0&&v(L,V,M)>0!=v(L,V,D)>0}function y(M){var D=M.p,L=M.next.p;return M.minX=Math.min(D[0],L[0]),M.minY=Math.min(D[1],L[1]),M.maxX=Math.max(D[0],L[0]),M.maxY=Math.max(D[1],L[1]),M}function w(M){for(var D=M[0],L=M[0],V=M[0],x=M[0],I=0;I<M.length;I++){var R=M[I];R[0]<D[0]&&(D=R),R[0]>V[0]&&(V=R),R[1]<L[1]&&(L=R),R[1]>x[1]&&(x=R)}var G=[D,L,V,x],F=G.slice();for(I=0;I<M.length;I++)t(M[I],G)||F.push(M[I]);return k(F)}function S(M,D){var L={p:M,prev:null,next:null,minX:0,minY:0,maxX:0,maxY:0};return D?(L.next=D.next,L.prev=D,D.next.prev=L,D.next=L):(L.prev=L,L.next=L),L}function T(M,D){var L=M[0]-D[0],V=M[1]-D[1];return L*L+V*V}function N(M,D,L){var V=D[0],x=D[1],I=L[0]-V,R=L[1]-x;if(I!==0||R!==0){var G=((M[0]-V)*I+(M[1]-x)*R)/(I*I+R*R);G>1?(V=L[0],x=L[1]):G>0&&(V+=I*G,x+=R*G)}return I=M[0]-V,R=M[1]-x,I*I+R*R}function j(M,D,L,V,x,I,R,G){var F=L-M,U=V-D,z=R-x,$=G-I,W=M-x,X=D-I,Y=F*F+U*U,et=F*z+U*$,J=z*z+$*$,rt=F*W+U*X,ht=z*W+$*X,Ot=Y*J-et*et,ct,_t,Ct,Lt,K=Ot,Qt=Ot;Ot===0?(_t=0,K=1,Lt=ht,Qt=J):(_t=et*ht-J*rt,Lt=Y*ht-et*rt,_t<0?(_t=0,Lt=ht,Qt=J):_t>K&&(_t=K,Lt=ht+et,Qt=J)),Lt<0?(Lt=0,-rt<0?_t=0:-rt>Y?_t=K:(_t=-rt,K=Y)):Lt>Qt&&(Lt=Qt,-rt+et<0?_t=0:-rt+et>Y?_t=K:(_t=-rt+et,K=Y)),ct=_t===0?0:_t/K,Ct=Lt===0?0:Lt/Qt;var zt=(1-ct)*M+ct*L,gt=(1-ct)*D+ct*V,A=(1-Ct)*x+Ct*R,at=(1-Ct)*I+Ct*G,Pt=A-zt,It=at-gt;return Pt*Pt+It*It}function C(M,D){return M[0]===D[0]?M[1]-D[1]:M[0]-D[0]}function k(M){M.sort(C);for(var D=[],L=0;L<M.length;L++){for(;D.length>=2&&v(D[D.length-2],D[D.length-1],M[L])<=0;)D.pop();D.push(M[L])}for(var V=[],x=M.length-1;x>=0;x--){for(;V.length>=2&&v(V[V.length-2],V[V.length-1],M[x])<=0;)V.pop();V.push(M[x])}return V.pop(),D.pop(),D.concat(V)}return Vl.exports}var sT=nT();const rT=Pc(sT);function aT(i,e={}){e.concavity=e.concavity||1/0;const t=[];if(rr(i,s=>{t.push([s[0],s[1]])}),!t.length)return null;const n=rT(t,e.concavity);return n.length>3?de([n]):null}function Gv(i,e={}){switch(ld(i)){case"Point":return Xt(Ie(i),e.properties);case"Polygon":var t=[];rr(i,function(M){t.push(M)});var n=kd(i,{properties:e.properties}),s=n.geometry.coordinates,o=0,h=0,l=0,d,f,v,m,y,w,S,T,N=t.map(function(M){return[M[0]-s[0],M[1]-s[1]]});for(d=0;d<t.length-1;d++)f=N[d],m=f[0],w=f[1],v=N[d+1],y=v[0],S=v[1],T=m*S-y*w,l+=T,o+=(m+y)*T,h+=(w+S)*T;if(l===0)return n;var j=l*.5,C=1/(6*j);return Xt([s[0]+C*o,s[1]+C*h],e.properties);default:var k=aT(i);return k?Gv(k,{properties:e.properties}):kd(i,{properties:e.properties})}}function oT(i,e,t={}){const n=t.steps||64,s=t.properties?t.properties:!Array.isArray(i)&&i.type==="Feature"&&i.properties?i.properties:{},o=[];for(let h=0;h<n;h++)o.push(xn(i,e,h*-360/n,t).geometry.coordinates);return o.push(o[0]),de([o],s)}function hT(i){if(!i)throw new Error("geojson is required");switch(i.type){case"Feature":return jv(i);case"FeatureCollection":return lT(i);case"Point":case"LineString":case"Polygon":case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"GeometryCollection":return Rd(i);default:throw new Error("unknown GeoJSON type")}}function jv(i){const e={type:"Feature"};return Object.keys(i).forEach(t=>{switch(t){case"type":case"properties":case"geometry":return;default:e[t]=i[t]}}),e.properties=Bv(i.properties),i.geometry==null?e.geometry=null:e.geometry=Rd(i.geometry),e}function Bv(i){const e={};return i&&Object.keys(i).forEach(t=>{const n=i[t];typeof n=="object"?n===null?e[t]=null:Array.isArray(n)?e[t]=n.map(s=>s):e[t]=Bv(n):e[t]=n}),e}function lT(i){const e={type:"FeatureCollection"};return Object.keys(i).forEach(t=>{switch(t){case"type":case"features":return;default:e[t]=i[t]}}),e.features=i.features.map(t=>jv(t)),e}function Rd(i){const e={type:i.type};return i.bbox&&(e.bbox=i.bbox),i.type==="GeometryCollection"?(e.geometries=i.geometries.map(t=>Rd(t)),e):(e.coordinates=zv(i.coordinates),e)}function zv(i){const e=i;return typeof e[0]!="object"?e.slice():e.map(t=>zv(t))}var uT=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,Ad=Math.ceil,Bi=Math.floor,mi="[BigNumber Error] ",Uv=mi+"Number primitive has more than 15 significant digits: ",rn=1e14,qt=14,Dd=9007199254740991,Ld=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],Os=1e7,je=1e9;function Vv(i){var e,t,n,s=C.prototype={constructor:C,toString:null,valueOf:null},o=new C(1),h=20,l=4,d=-7,f=21,v=-1e7,m=1e7,y=!1,w=1,S=0,T={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},N="0123456789abcdefghijklmnopqrstuvwxyz",j=!0;function C(x,I){var R,G,F,U,z,$,W,X,Y=this;if(!(Y instanceof C))return new C(x,I);if(I==null){if(x&&x._isBigNumber===!0){Y.s=x.s,!x.c||x.e>m?Y.c=Y.e=null:x.e<v?Y.c=[Y.e=0]:(Y.e=x.e,Y.c=x.c.slice());return}if(($=typeof x=="number")&&x*0==0){if(Y.s=1/x<0?(x=-x,-1):1,x===~~x){for(U=0,z=x;z>=10;z/=10,U++);U>m?Y.c=Y.e=null:(Y.e=U,Y.c=[x]);return}X=String(x)}else{if(!uT.test(X=String(x)))return n(Y,X,$);Y.s=X.charCodeAt(0)==45?(X=X.slice(1),-1):1}(U=X.indexOf("."))>-1&&(X=X.replace(".","")),(z=X.search(/e/i))>0?(U<0&&(U=z),U+=+X.slice(z+1),X=X.substring(0,z)):U<0&&(U=X.length)}else{if(ye(I,2,N.length,"Base"),I==10&&j)return Y=new C(x),L(Y,h+Y.e+1,l);if(X=String(x),$=typeof x=="number"){if(x*0!=0)return n(Y,X,$,I);if(Y.s=1/x<0?(X=X.slice(1),-1):1,C.DEBUG&&X.replace(/^0\.0*|\./,"").length>15)throw Error(Uv+x)}else Y.s=X.charCodeAt(0)===45?(X=X.slice(1),-1):1;for(R=N.slice(0,I),U=z=0,W=X.length;z<W;z++)if(R.indexOf(G=X.charAt(z))<0){if(G=="."){if(z>U){U=W;continue}}else if(!F&&(X==X.toUpperCase()&&(X=X.toLowerCase())||X==X.toLowerCase()&&(X=X.toUpperCase()))){F=!0,z=-1,U=0;continue}return n(Y,String(x),$,I)}$=!1,X=t(X,I,10,Y.s),(U=X.indexOf("."))>-1?X=X.replace(".",""):U=X.length}for(z=0;X.charCodeAt(z)===48;z++);for(W=X.length;X.charCodeAt(--W)===48;);if(X=X.slice(z,++W)){if(W-=z,$&&C.DEBUG&&W>15&&(x>Dd||x!==Bi(x)))throw Error(Uv+Y.s*x);if((U=U-z-1)>m)Y.c=Y.e=null;else if(U<v)Y.c=[Y.e=0];else{if(Y.e=U,Y.c=[],z=(U+1)%qt,U<0&&(z+=qt),z<W){for(z&&Y.c.push(+X.slice(0,z)),W-=qt;z<W;)Y.c.push(+X.slice(z,z+=qt));z=qt-(X=X.slice(z)).length}else z-=W;for(;z--;X+="0");Y.c.push(+X)}}else Y.c=[Y.e=0]}C.clone=Vv,C.ROUND_UP=0,C.ROUND_DOWN=1,C.ROUND_CEIL=2,C.ROUND_FLOOR=3,C.ROUND_HALF_UP=4,C.ROUND_HALF_DOWN=5,C.ROUND_HALF_EVEN=6,C.ROUND_HALF_CEIL=7,C.ROUND_HALF_FLOOR=8,C.EUCLID=9,C.config=C.set=function(x){var I,R;if(x!=null)if(typeof x=="object"){if(x.hasOwnProperty(I="DECIMAL_PLACES")&&(R=x[I],ye(R,0,je,I),h=R),x.hasOwnProperty(I="ROUNDING_MODE")&&(R=x[I],ye(R,0,8,I),l=R),x.hasOwnProperty(I="EXPONENTIAL_AT")&&(R=x[I],R&&R.pop?(ye(R[0],-je,0,I),ye(R[1],0,je,I),d=R[0],f=R[1]):(ye(R,-je,je,I),d=-(f=R<0?-R:R))),x.hasOwnProperty(I="RANGE"))if(R=x[I],R&&R.pop)ye(R[0],-je,-1,I),ye(R[1],1,je,I),v=R[0],m=R[1];else if(ye(R,-je,je,I),R)v=-(m=R<0?-R:R);else throw Error(mi+I+" cannot be zero: "+R);if(x.hasOwnProperty(I="CRYPTO"))if(R=x[I],R===!!R)if(R)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))y=R;else throw y=!R,Error(mi+"crypto unavailable");else y=R;else throw Error(mi+I+" not true or false: "+R);if(x.hasOwnProperty(I="MODULO_MODE")&&(R=x[I],ye(R,0,9,I),w=R),x.hasOwnProperty(I="POW_PRECISION")&&(R=x[I],ye(R,0,je,I),S=R),x.hasOwnProperty(I="FORMAT"))if(R=x[I],typeof R=="object")T=R;else throw Error(mi+I+" not an object: "+R);if(x.hasOwnProperty(I="ALPHABET"))if(R=x[I],typeof R=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(R))j=R.slice(0,10)=="0123456789",N=R;else throw Error(mi+I+" invalid: "+R)}else throw Error(mi+"Object expected: "+x);return{DECIMAL_PLACES:h,ROUNDING_MODE:l,EXPONENTIAL_AT:[d,f],RANGE:[v,m],CRYPTO:y,MODULO_MODE:w,POW_PRECISION:S,FORMAT:T,ALPHABET:N}},C.isBigNumber=function(x){if(!x||x._isBigNumber!==!0)return!1;if(!C.DEBUG)return!0;var I,R,G=x.c,F=x.e,U=x.s;t:if({}.toString.call(G)=="[object Array]"){if((U===1||U===-1)&&F>=-je&&F<=je&&F===Bi(F)){if(G[0]===0){if(F===0&&G.length===1)return!0;break t}if(I=(F+1)%qt,I<1&&(I+=qt),String(G[0]).length==I){for(I=0;I<G.length;I++)if(R=G[I],R<0||R>=rn||R!==Bi(R))break t;if(R!==0)return!0}}}else if(G===null&&F===null&&(U===null||U===1||U===-1))return!0;throw Error(mi+"Invalid BigNumber: "+x)},C.maximum=C.max=function(){return M(arguments,-1)},C.minimum=C.min=function(){return M(arguments,1)},C.random=(function(){var x=9007199254740992,I=Math.random()*x&2097151?function(){return Bi(Math.random()*x)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(R){var G,F,U,z,$,W=0,X=[],Y=new C(o);if(R==null?R=h:ye(R,0,je),z=Ad(R/qt),y)if(crypto.getRandomValues){for(G=crypto.getRandomValues(new Uint32Array(z*=2));W<z;)$=G[W]*131072+(G[W+1]>>>11),$>=9e15?(F=crypto.getRandomValues(new Uint32Array(2)),G[W]=F[0],G[W+1]=F[1]):(X.push($%1e14),W+=2);W=z/2}else if(crypto.randomBytes){for(G=crypto.randomBytes(z*=7);W<z;)$=(G[W]&31)*281474976710656+G[W+1]*1099511627776+G[W+2]*4294967296+G[W+3]*16777216+(G[W+4]<<16)+(G[W+5]<<8)+G[W+6],$>=9e15?crypto.randomBytes(7).copy(G,W):(X.push($%1e14),W+=7);W=z/7}else throw y=!1,Error(mi+"crypto unavailable");if(!y)for(;W<z;)$=I(),$<9e15&&(X[W++]=$%1e14);for(z=X[--W],R%=qt,z&&R&&($=Ld[qt-R],X[W]=Bi(z/$)*$);X[W]===0;X.pop(),W--);if(W<0)X=[U=0];else{for(U=-1;X[0]===0;X.splice(0,1),U-=qt);for(W=1,$=X[0];$>=10;$/=10,W++);W<qt&&(U-=qt-W)}return Y.e=U,Y.c=X,Y}})(),C.sum=function(){for(var x=1,I=arguments,R=new C(I[0]);x<I.length;)R=R.plus(I[x++]);return R},t=(function(){var x="0123456789";function I(R,G,F,U){for(var z,$=[0],W,X=0,Y=R.length;X<Y;){for(W=$.length;W--;$[W]*=G);for($[0]+=U.indexOf(R.charAt(X++)),z=0;z<$.length;z++)$[z]>F-1&&($[z+1]==null&&($[z+1]=0),$[z+1]+=$[z]/F|0,$[z]%=F)}return $.reverse()}return function(R,G,F,U,z){var $,W,X,Y,et,J,rt,ht,Ot=R.indexOf("."),ct=h,_t=l;for(Ot>=0&&(Y=S,S=0,R=R.replace(".",""),ht=new C(G),J=ht.pow(R.length-Ot),S=Y,ht.c=I(ts(Ui(J.c),J.e,"0"),10,F,x),ht.e=ht.c.length),rt=I(R,G,F,z?($=N,x):($=x,N)),X=Y=rt.length;rt[--Y]==0;rt.pop());if(!rt[0])return $.charAt(0);if(Ot<0?--X:(J.c=rt,J.e=X,J.s=U,J=e(J,ht,ct,_t,F),rt=J.c,et=J.r,X=J.e),W=X+ct+1,Ot=rt[W],Y=F/2,et=et||W<0||rt[W+1]!=null,et=_t<4?(Ot!=null||et)&&(_t==0||_t==(J.s<0?3:2)):Ot>Y||Ot==Y&&(_t==4||et||_t==6&&rt[W-1]&1||_t==(J.s<0?8:7)),W<1||!rt[0])R=et?ts($.charAt(1),-ct,$.charAt(0)):$.charAt(0);else{if(rt.length=W,et)for(--F;++rt[--W]>F;)rt[W]=0,W||(++X,rt=[1].concat(rt));for(Y=rt.length;!rt[--Y];);for(Ot=0,R="";Ot<=Y;R+=$.charAt(rt[Ot++]));R=ts(R,X,$.charAt(0))}return R}})(),e=(function(){function x(G,F,U){var z,$,W,X,Y=0,et=G.length,J=F%Os,rt=F/Os|0;for(G=G.slice();et--;)W=G[et]%Os,X=G[et]/Os|0,z=rt*W+X*J,$=J*W+z%Os*Os+Y,Y=($/U|0)+(z/Os|0)+rt*X,G[et]=$%U;return Y&&(G=[Y].concat(G)),G}function I(G,F,U,z){var $,W;if(U!=z)W=U>z?1:-1;else for($=W=0;$<U;$++)if(G[$]!=F[$]){W=G[$]>F[$]?1:-1;break}return W}function R(G,F,U,z){for(var $=0;U--;)G[U]-=$,$=G[U]<F[U]?1:0,G[U]=$*z+G[U]-F[U];for(;!G[0]&&G.length>1;G.splice(0,1));}return function(G,F,U,z,$){var W,X,Y,et,J,rt,ht,Ot,ct,_t,Ct,Lt,K,Qt,zt,gt,A,at=G.s==F.s?1:-1,Pt=G.c,It=F.c;if(!Pt||!Pt[0]||!It||!It[0])return new C(!G.s||!F.s||(Pt?It&&Pt[0]==It[0]:!It)?NaN:Pt&&Pt[0]==0||!It?at*0:at/0);for(Ot=new C(at),ct=Ot.c=[],X=G.e-F.e,at=U+X+1,$||($=rn,X=zi(G.e/qt)-zi(F.e/qt),at=at/qt|0),Y=0;It[Y]==(Pt[Y]||0);Y++);if(It[Y]>(Pt[Y]||0)&&X--,at<0)ct.push(1),et=!0;else{for(Qt=Pt.length,gt=It.length,Y=0,at+=2,J=Bi($/(It[0]+1)),J>1&&(It=x(It,J,$),Pt=x(Pt,J,$),gt=It.length,Qt=Pt.length),K=gt,_t=Pt.slice(0,gt),Ct=_t.length;Ct<gt;_t[Ct++]=0);A=It.slice(),A=[0].concat(A),zt=It[0],It[1]>=$/2&&zt++;do{if(J=0,W=I(It,_t,gt,Ct),W<0){if(Lt=_t[0],gt!=Ct&&(Lt=Lt*$+(_t[1]||0)),J=Bi(Lt/zt),J>1)for(J>=$&&(J=$-1),rt=x(It,J,$),ht=rt.length,Ct=_t.length;I(rt,_t,ht,Ct)==1;)J--,R(rt,gt<ht?A:It,ht,$),ht=rt.length,W=1;else J==0&&(W=J=1),rt=It.slice(),ht=rt.length;if(ht<Ct&&(rt=[0].concat(rt)),R(_t,rt,Ct,$),Ct=_t.length,W==-1)for(;I(It,_t,gt,Ct)<1;)J++,R(_t,gt<Ct?A:It,Ct,$),Ct=_t.length}else W===0&&(J++,_t=[0]);ct[Y++]=J,_t[0]?_t[Ct++]=Pt[K]||0:(_t=[Pt[K]],Ct=1)}while((K++<Qt||_t[0]!=null)&&at--);et=_t[0]!=null,ct[0]||ct.splice(0,1)}if($==rn){for(Y=1,at=ct[0];at>=10;at/=10,Y++);L(Ot,U+(Ot.e=Y+X*qt-1)+1,z,et)}else Ot.e=X,Ot.r=+et;return Ot}})();function k(x,I,R,G){var F,U,z,$,W;if(R==null?R=l:ye(R,0,8),!x.c)return x.toString();if(F=x.c[0],z=x.e,I==null)W=Ui(x.c),W=G==1||G==2&&(z<=d||z>=f)?Wl(W,z):ts(W,z,"0");else if(x=L(new C(x),I,R),U=x.e,W=Ui(x.c),$=W.length,G==1||G==2&&(I<=U||U<=d)){for(;$<I;W+="0",$++);W=Wl(W,U)}else if(I-=z+(G===2&&U>z),W=ts(W,U,"0"),U+1>$){if(--I>0)for(W+=".";I--;W+="0");}else if(I+=U-$,I>0)for(U+1==$&&(W+=".");I--;W+="0");return x.s<0&&F?"-"+W:W}function M(x,I){for(var R,G,F=1,U=new C(x[0]);F<x.length;F++)G=new C(x[F]),(!G.s||(R=ur(U,G))===I||R===0&&U.s===I)&&(U=G);return U}function D(x,I,R){for(var G=1,F=I.length;!I[--F];I.pop());for(F=I[0];F>=10;F/=10,G++);return(R=G+R*qt-1)>m?x.c=x.e=null:R<v?x.c=[x.e=0]:(x.e=R,x.c=I),x}n=(function(){var x=/^(-?)0([xbo])(?=\w[\w.]*$)/i,I=/^([^.]+)\.$/,R=/^\.([^.]+)$/,G=/^-?(Infinity|NaN)$/,F=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(U,z,$,W){var X,Y=$?z:z.replace(F,"");if(G.test(Y))U.s=isNaN(Y)?null:Y<0?-1:1;else{if(!$&&(Y=Y.replace(x,function(et,J,rt){return X=(rt=rt.toLowerCase())=="x"?16:rt=="b"?2:8,!W||W==X?J:et}),W&&(X=W,Y=Y.replace(I,"$1").replace(R,"0.$1")),z!=Y))return new C(Y,X);if(C.DEBUG)throw Error(mi+"Not a"+(W?" base "+W:"")+" number: "+z);U.s=null}U.c=U.e=null}})();function L(x,I,R,G){var F,U,z,$,W,X,Y,et=x.c,J=Ld;if(et){t:{for(F=1,$=et[0];$>=10;$/=10,F++);if(U=I-F,U<0)U+=qt,z=I,W=et[X=0],Y=Bi(W/J[F-z-1]%10);else if(X=Ad((U+1)/qt),X>=et.length)if(G){for(;et.length<=X;et.push(0));W=Y=0,F=1,U%=qt,z=U-qt+1}else break t;else{for(W=$=et[X],F=1;$>=10;$/=10,F++);U%=qt,z=U-qt+F,Y=z<0?0:Bi(W/J[F-z-1]%10)}if(G=G||I<0||et[X+1]!=null||(z<0?W:W%J[F-z-1]),G=R<4?(Y||G)&&(R==0||R==(x.s<0?3:2)):Y>5||Y==5&&(R==4||G||R==6&&(U>0?z>0?W/J[F-z]:0:et[X-1])%10&1||R==(x.s<0?8:7)),I<1||!et[0])return et.length=0,G?(I-=x.e+1,et[0]=J[(qt-I%qt)%qt],x.e=-I||0):et[0]=x.e=0,x;if(U==0?(et.length=X,$=1,X--):(et.length=X+1,$=J[qt-U],et[X]=z>0?Bi(W/J[F-z]%J[z])*$:0),G)for(;;)if(X==0){for(U=1,z=et[0];z>=10;z/=10,U++);for(z=et[0]+=$,$=1;z>=10;z/=10,$++);U!=$&&(x.e++,et[0]==rn&&(et[0]=1));break}else{if(et[X]+=$,et[X]!=rn)break;et[X--]=0,$=1}for(U=et.length;et[--U]===0;et.pop());}x.e>m?x.c=x.e=null:x.e<v&&(x.c=[x.e=0])}return x}function V(x){var I,R=x.e;return R===null?x.toString():(I=Ui(x.c),I=R<=d||R>=f?Wl(I,R):ts(I,R,"0"),x.s<0?"-"+I:I)}return s.absoluteValue=s.abs=function(){var x=new C(this);return x.s<0&&(x.s=1),x},s.comparedTo=function(x,I){return ur(this,new C(x,I))},s.decimalPlaces=s.dp=function(x,I){var R,G,F,U=this;if(x!=null)return ye(x,0,je),I==null?I=l:ye(I,0,8),L(new C(U),x+U.e+1,I);if(!(R=U.c))return null;if(G=((F=R.length-1)-zi(this.e/qt))*qt,F=R[F])for(;F%10==0;F/=10,G--);return G<0&&(G=0),G},s.dividedBy=s.div=function(x,I){return e(this,new C(x,I),h,l)},s.dividedToIntegerBy=s.idiv=function(x,I){return e(this,new C(x,I),0,1)},s.exponentiatedBy=s.pow=function(x,I){var R,G,F,U,z,$,W,X,Y,et=this;if(x=new C(x),x.c&&!x.isInteger())throw Error(mi+"Exponent not an integer: "+V(x));if(I!=null&&(I=new C(I)),$=x.e>14,!et.c||!et.c[0]||et.c[0]==1&&!et.e&&et.c.length==1||!x.c||!x.c[0])return Y=new C(Math.pow(+V(et),$?x.s*(2-$l(x)):+V(x))),I?Y.mod(I):Y;if(W=x.s<0,I){if(I.c?!I.c[0]:!I.s)return new C(NaN);G=!W&&et.isInteger()&&I.isInteger(),G&&(et=et.mod(I))}else{if(x.e>9&&(et.e>0||et.e<-1||(et.e==0?et.c[0]>1||$&&et.c[1]>=24e7:et.c[0]<8e13||$&&et.c[0]<=9999975e7)))return U=et.s<0&&$l(x)?-0:0,et.e>-1&&(U=1/U),new C(W?1/U:U);S&&(U=Ad(S/qt+2))}for($?(R=new C(.5),W&&(x.s=1),X=$l(x)):(F=Math.abs(+V(x)),X=F%2),Y=new C(o);;){if(X){if(Y=Y.times(et),!Y.c)break;U?Y.c.length>U&&(Y.c.length=U):G&&(Y=Y.mod(I))}if(F){if(F=Bi(F/2),F===0)break;X=F%2}else if(x=x.times(R),L(x,x.e+1,1),x.e>14)X=$l(x);else{if(F=+V(x),F===0)break;X=F%2}et=et.times(et),U?et.c&&et.c.length>U&&(et.c.length=U):G&&(et=et.mod(I))}return G?Y:(W&&(Y=o.div(Y)),I?Y.mod(I):U?L(Y,S,l,z):Y)},s.integerValue=function(x){var I=new C(this);return x==null?x=l:ye(x,0,8),L(I,I.e+1,x)},s.isEqualTo=s.eq=function(x,I){return ur(this,new C(x,I))===0},s.isFinite=function(){return!!this.c},s.isGreaterThan=s.gt=function(x,I){return ur(this,new C(x,I))>0},s.isGreaterThanOrEqualTo=s.gte=function(x,I){return(I=ur(this,new C(x,I)))===1||I===0},s.isInteger=function(){return!!this.c&&zi(this.e/qt)>this.c.length-2},s.isLessThan=s.lt=function(x,I){return ur(this,new C(x,I))<0},s.isLessThanOrEqualTo=s.lte=function(x,I){return(I=ur(this,new C(x,I)))===-1||I===0},s.isNaN=function(){return!this.s},s.isNegative=function(){return this.s<0},s.isPositive=function(){return this.s>0},s.isZero=function(){return!!this.c&&this.c[0]==0},s.minus=function(x,I){var R,G,F,U,z=this,$=z.s;if(x=new C(x,I),I=x.s,!$||!I)return new C(NaN);if($!=I)return x.s=-I,z.plus(x);var W=z.e/qt,X=x.e/qt,Y=z.c,et=x.c;if(!W||!X){if(!Y||!et)return Y?(x.s=-I,x):new C(et?z:NaN);if(!Y[0]||!et[0])return et[0]?(x.s=-I,x):new C(Y[0]?z:l==3?-0:0)}if(W=zi(W),X=zi(X),Y=Y.slice(),$=W-X){for((U=$<0)?($=-$,F=Y):(X=W,F=et),F.reverse(),I=$;I--;F.push(0));F.reverse()}else for(G=(U=($=Y.length)<(I=et.length))?$:I,$=I=0;I<G;I++)if(Y[I]!=et[I]){U=Y[I]<et[I];break}if(U&&(F=Y,Y=et,et=F,x.s=-x.s),I=(G=et.length)-(R=Y.length),I>0)for(;I--;Y[R++]=0);for(I=rn-1;G>$;){if(Y[--G]<et[G]){for(R=G;R&&!Y[--R];Y[R]=I);--Y[R],Y[G]+=rn}Y[G]-=et[G]}for(;Y[0]==0;Y.splice(0,1),--X);return Y[0]?D(x,Y,X):(x.s=l==3?-1:1,x.c=[x.e=0],x)},s.modulo=s.mod=function(x,I){var R,G,F=this;return x=new C(x,I),!F.c||!x.s||x.c&&!x.c[0]?new C(NaN):!x.c||F.c&&!F.c[0]?new C(F):(w==9?(G=x.s,x.s=1,R=e(F,x,0,3),x.s=G,R.s*=G):R=e(F,x,0,w),x=F.minus(R.times(x)),!x.c[0]&&w==1&&(x.s=F.s),x)},s.multipliedBy=s.times=function(x,I){var R,G,F,U,z,$,W,X,Y,et,J,rt,ht,Ot,ct,_t=this,Ct=_t.c,Lt=(x=new C(x,I)).c;if(!Ct||!Lt||!Ct[0]||!Lt[0])return!_t.s||!x.s||Ct&&!Ct[0]&&!Lt||Lt&&!Lt[0]&&!Ct?x.c=x.e=x.s=null:(x.s*=_t.s,!Ct||!Lt?x.c=x.e=null:(x.c=[0],x.e=0)),x;for(G=zi(_t.e/qt)+zi(x.e/qt),x.s*=_t.s,W=Ct.length,et=Lt.length,W<et&&(ht=Ct,Ct=Lt,Lt=ht,F=W,W=et,et=F),F=W+et,ht=[];F--;ht.push(0));for(Ot=rn,ct=Os,F=et;--F>=0;){for(R=0,J=Lt[F]%ct,rt=Lt[F]/ct|0,z=W,U=F+z;U>F;)X=Ct[--z]%ct,Y=Ct[z]/ct|0,$=rt*X+Y*J,X=J*X+$%ct*ct+ht[U]+R,R=(X/Ot|0)+($/ct|0)+rt*Y,ht[U--]=X%Ot;ht[U]=R}return R?++G:ht.splice(0,1),D(x,ht,G)},s.negated=function(){var x=new C(this);return x.s=-x.s||null,x},s.plus=function(x,I){var R,G=this,F=G.s;if(x=new C(x,I),I=x.s,!F||!I)return new C(NaN);if(F!=I)return x.s=-I,G.minus(x);var U=G.e/qt,z=x.e/qt,$=G.c,W=x.c;if(!U||!z){if(!$||!W)return new C(F/0);if(!$[0]||!W[0])return W[0]?x:new C($[0]?G:F*0)}if(U=zi(U),z=zi(z),$=$.slice(),F=U-z){for(F>0?(z=U,R=W):(F=-F,R=$),R.reverse();F--;R.push(0));R.reverse()}for(F=$.length,I=W.length,F-I<0&&(R=W,W=$,$=R,I=F),F=0;I;)F=($[--I]=$[I]+W[I]+F)/rn|0,$[I]=rn===$[I]?0:$[I]%rn;return F&&($=[F].concat($),++z),D(x,$,z)},s.precision=s.sd=function(x,I){var R,G,F,U=this;if(x!=null&&x!==!!x)return ye(x,1,je),I==null?I=l:ye(I,0,8),L(new C(U),x,I);if(!(R=U.c))return null;if(F=R.length-1,G=F*qt+1,F=R[F]){for(;F%10==0;F/=10,G--);for(F=R[0];F>=10;F/=10,G++);}return x&&U.e+1>G&&(G=U.e+1),G},s.shiftedBy=function(x){return ye(x,-Dd,Dd),this.times("1e"+x)},s.squareRoot=s.sqrt=function(){var x,I,R,G,F,U=this,z=U.c,$=U.s,W=U.e,X=h+4,Y=new C("0.5");if($!==1||!z||!z[0])return new C(!$||$<0&&(!z||z[0])?NaN:z?U:1/0);if($=Math.sqrt(+V(U)),$==0||$==1/0?(I=Ui(z),(I.length+W)%2==0&&(I+="0"),$=Math.sqrt(+I),W=zi((W+1)/2)-(W<0||W%2),$==1/0?I="5e"+W:(I=$.toExponential(),I=I.slice(0,I.indexOf("e")+1)+W),R=new C(I)):R=new C($+""),R.c[0]){for(W=R.e,$=W+X,$<3&&($=0);;)if(F=R,R=Y.times(F.plus(e(U,F,X,1))),Ui(F.c).slice(0,$)===(I=Ui(R.c)).slice(0,$))if(R.e<W&&--$,I=I.slice($-3,$+1),I=="9999"||!G&&I=="4999"){if(!G&&(L(F,F.e+h+2,0),F.times(F).eq(U))){R=F;break}X+=4,$+=4,G=1}else{(!+I||!+I.slice(1)&&I.charAt(0)=="5")&&(L(R,R.e+h+2,1),x=!R.times(R).eq(U));break}}return L(R,R.e+h+1,l,x)},s.toExponential=function(x,I){return x!=null&&(ye(x,0,je),x++),k(this,x,I,1)},s.toFixed=function(x,I){return x!=null&&(ye(x,0,je),x=x+this.e+1),k(this,x,I)},s.toFormat=function(x,I,R){var G,F=this;if(R==null)x!=null&&I&&typeof I=="object"?(R=I,I=null):x&&typeof x=="object"?(R=x,x=I=null):R=T;else if(typeof R!="object")throw Error(mi+"Argument not an object: "+R);if(G=F.toFixed(x,I),F.c){var U,z=G.split("."),$=+R.groupSize,W=+R.secondaryGroupSize,X=R.groupSeparator||"",Y=z[0],et=z[1],J=F.s<0,rt=J?Y.slice(1):Y,ht=rt.length;if(W&&(U=$,$=W,W=U,ht-=U),$>0&&ht>0){for(U=ht%$||$,Y=rt.substr(0,U);U<ht;U+=$)Y+=X+rt.substr(U,$);W>0&&(Y+=X+rt.slice(U)),J&&(Y="-"+Y)}G=et?Y+(R.decimalSeparator||"")+((W=+R.fractionGroupSize)?et.replace(new RegExp("\\d{"+W+"}\\B","g"),"$&"+(R.fractionGroupSeparator||"")):et):Y}return(R.prefix||"")+G+(R.suffix||"")},s.toFraction=function(x){var I,R,G,F,U,z,$,W,X,Y,et,J,rt=this,ht=rt.c;if(x!=null&&($=new C(x),!$.isInteger()&&($.c||$.s!==1)||$.lt(o)))throw Error(mi+"Argument "+($.isInteger()?"out of range: ":"not an integer: ")+V($));if(!ht)return new C(rt);for(I=new C(o),X=R=new C(o),G=W=new C(o),J=Ui(ht),U=I.e=J.length-rt.e-1,I.c[0]=Ld[(z=U%qt)<0?qt+z:z],x=!x||$.comparedTo(I)>0?U>0?I:X:$,z=m,m=1/0,$=new C(J),W.c[0]=0;Y=e($,I,0,1),F=R.plus(Y.times(G)),F.comparedTo(x)!=1;)R=G,G=F,X=W.plus(Y.times(F=X)),W=F,I=$.minus(Y.times(F=I)),$=F;return F=e(x.minus(R),G,0,1),W=W.plus(F.times(X)),R=R.plus(F.times(G)),W.s=X.s=rt.s,U=U*2,et=e(X,G,U,l).minus(rt).abs().comparedTo(e(W,R,U,l).minus(rt).abs())<1?[X,G]:[W,R],m=z,et},s.toNumber=function(){return+V(this)},s.toPrecision=function(x,I){return x!=null&&ye(x,1,je),k(this,x,I,2)},s.toString=function(x){var I,R=this,G=R.s,F=R.e;return F===null?G?(I="Infinity",G<0&&(I="-"+I)):I="NaN":(x==null?I=F<=d||F>=f?Wl(Ui(R.c),F):ts(Ui(R.c),F,"0"):x===10&&j?(R=L(new C(R),h+F+1,l),I=ts(Ui(R.c),R.e,"0")):(ye(x,2,N.length,"Base"),I=t(ts(Ui(R.c),F,"0"),10,x,G,!0)),G<0&&R.c[0]&&(I="-"+I)),I},s.valueOf=s.toJSON=function(){return V(this)},s._isBigNumber=!0,s[Symbol.toStringTag]="BigNumber",s[Symbol.for("nodejs.util.inspect.custom")]=s.valueOf,i!=null&&C.set(i),C}function zi(i){var e=i|0;return i>0||i===e?e:e-1}function Ui(i){for(var e,t,n=1,s=i.length,o=i[0]+"";n<s;){for(e=i[n++]+"",t=qt-e.length;t--;e="0"+e);o+=e}for(s=o.length;o.charCodeAt(--s)===48;);return o.slice(0,s+1||1)}function ur(i,e){var t,n,s=i.c,o=e.c,h=i.s,l=e.s,d=i.e,f=e.e;if(!h||!l)return null;if(t=s&&!s[0],n=o&&!o[0],t||n)return t?n?0:-l:h;if(h!=l)return h;if(t=h<0,n=d==f,!s||!o)return n?0:!s^t?1:-1;if(!n)return d>f^t?1:-1;for(l=(d=s.length)<(f=o.length)?d:f,h=0;h<l;h++)if(s[h]!=o[h])return s[h]>o[h]^t?1:-1;return d==f?0:d>f^t?1:-1}function ye(i,e,t,n){if(i<e||i>t||i!==Bi(i))throw Error(mi+(n||"Argument")+(typeof i=="number"?i<e||i>t?" out of range: ":" not an integer: ":" not a primitive number: ")+String(i))}function $l(i){var e=i.c.length-1;return zi(i.e/qt)==e&&i.c[e]%2!=0}function Wl(i,e){return(i.length>1?i.charAt(0)+"."+i.slice(1):i)+(e<0?"e":"e+")+e}function ts(i,e,t){var n,s;if(e<0){for(s=t+".";++e;s+=t);i=s+i}else if(n=i.length,++e>n){for(s=t,e-=n;--e;s+=t);i+=s}else e<n&&(i=i.slice(0,e)+"."+i.slice(e));return i}var Cn=Vv(),cT=class{constructor(i){p(this,"key");p(this,"left",null);p(this,"right",null);this.key=i}},ph=class extends cT{constructor(i){super(i)}},dT=class{constructor(){p(this,"size",0);p(this,"modificationCount",0);p(this,"splayCount",0)}splay(i){const e=this.root;if(e==null)return this.compare(i,i),-1;let t=null,n=null,s=null,o=null,h=e;const l=this.compare;let d;for(;;)if(d=l(h.key,i),d>0){let f=h.left;if(f==null||(d=l(f.key,i),d>0&&(h.left=f.right,f.right=h,h=f,f=h.left,f==null)))break;t==null?n=h:t.left=h,t=h,h=f}else if(d<0){let f=h.right;if(f==null||(d=l(f.key,i),d<0&&(h.right=f.left,f.left=h,h=f,f=h.right,f==null)))break;s==null?o=h:s.right=h,s=h,h=f}else break;return s!=null&&(s.right=h.left,h.left=o),t!=null&&(t.left=h.right,h.right=n),this.root!==h&&(this.root=h,this.splayCount++),d}splayMin(i){let e=i,t=e.left;for(;t!=null;){const n=t;e.left=n.right,n.right=e,e=n,t=e.left}return e}splayMax(i){let e=i,t=e.right;for(;t!=null;){const n=t;e.right=n.left,n.left=e,e=n,t=e.right}return e}_delete(i){if(this.root==null||this.splay(i)!=0)return null;let t=this.root;const n=t,s=t.left;if(this.size--,s==null)this.root=t.right;else{const o=t.right;t=this.splayMax(s),t.right=o,this.root=t}return this.modificationCount++,n}addNewRoot(i,e){this.size++,this.modificationCount++;const t=this.root;if(t==null){this.root=i;return}e<0?(i.left=t,i.right=t.right,t.right=null):(i.right=t,i.left=t.left,t.left=null),this.root=i}_first(){const i=this.root;return i==null?null:(this.root=this.splayMin(i),this.root)}_last(){const i=this.root;return i==null?null:(this.root=this.splayMax(i),this.root)}clear(){this.root=null,this.size=0,this.modificationCount++}has(i){return this.validKey(i)&&this.splay(i)==0}defaultCompare(){return(i,e)=>i<e?-1:i>e?1:0}wrap(){return{getRoot:()=>this.root,setRoot:i=>{this.root=i},getSize:()=>this.size,getModificationCount:()=>this.modificationCount,getSplayCount:()=>this.splayCount,setSplayCount:i=>{this.splayCount=i},splay:i=>this.splay(i),has:i=>this.has(i)}}},Hl=class Uh extends dT{constructor(t,n){super();p(this,"root",null);p(this,"compare");p(this,"validKey");p(this,T_,"[object Set]");this.compare=t??this.defaultCompare(),this.validKey=n??(s=>s!=null&&s!=null)}delete(t){return this.validKey(t)?this._delete(t)!=null:!1}deleteAll(t){for(const n of t)this.delete(n)}forEach(t){const n=this[Symbol.iterator]();let s;for(;s=n.next(),!s.done;)t(s.value,s.value,this)}add(t){const n=this.splay(t);return n!=0&&this.addNewRoot(new ph(t),n),this}addAndReturn(t){const n=this.splay(t);return n!=0&&this.addNewRoot(new ph(t),n),this.root.key}addAll(t){for(const n of t)this.add(n)}isEmpty(){return this.root==null}isNotEmpty(){return this.root!=null}single(){if(this.size==0)throw"Bad state: No element";if(this.size>1)throw"Bad state: Too many element";return this.root.key}first(){if(this.size==0)throw"Bad state: No element";return this._first().key}last(){if(this.size==0)throw"Bad state: No element";return this._last().key}lastBefore(t){if(t==null)throw"Invalid arguments(s)";if(this.root==null)return null;if(this.splay(t)<0)return this.root.key;let s=this.root.left;if(s==null)return null;let o=s.right;for(;o!=null;)s=o,o=s.right;return s.key}firstAfter(t){if(t==null)throw"Invalid arguments(s)";if(this.root==null)return null;if(this.splay(t)>0)return this.root.key;let s=this.root.right;if(s==null)return null;let o=s.left;for(;o!=null;)s=o,o=s.left;return s.key}retainAll(t){const n=new Uh(this.compare,this.validKey),s=this.modificationCount;for(const o of t){if(s!=this.modificationCount)throw"Concurrent modification during iteration.";this.validKey(o)&&this.splay(o)==0&&n.add(this.root.key)}n.size!=this.size&&(this.root=n.root,this.size=n.size,this.modificationCount++)}lookup(t){return!this.validKey(t)||this.splay(t)!=0?null:this.root.key}intersection(t){const n=new Uh(this.compare,this.validKey);for(const s of this)t.has(s)&&n.add(s);return n}difference(t){const n=new Uh(this.compare,this.validKey);for(const s of this)t.has(s)||n.add(s);return n}union(t){const n=this.clone();return n.addAll(t),n}clone(){const t=new Uh(this.compare,this.validKey);return t.size=this.size,t.root=this.copyNode(this.root),t}copyNode(t){if(t==null)return null;function n(o,h){let l,d;do{if(l=o.left,d=o.right,l!=null){const f=new ph(l.key);h.left=f,n(l,f)}if(d!=null){const f=new ph(d.key);h.right=f,o=d,h=f}}while(d!=null)}const s=new ph(t.key);return n(t,s),s}toSet(){return this.clone()}entries(){return new gT(this.wrap())}keys(){return this[Symbol.iterator]()}values(){return this[Symbol.iterator]()}[(k_=Symbol.iterator,T_=Symbol.toStringTag,k_)](){return new fT(this.wrap())}},qv=class{constructor(i){p(this,"tree");p(this,"path",new Array);p(this,"modificationCount",null);p(this,"splayCount");this.tree=i,this.splayCount=i.getSplayCount()}[Symbol.iterator](){return this}next(){return this.moveNext()?{done:!1,value:this.current()}:{done:!0,value:null}}current(){if(!this.path.length)return null;const i=this.path[this.path.length-1];return this.getValue(i)}rebuildPath(i){this.path.splice(0,this.path.length),this.tree.splay(i),this.path.push(this.tree.getRoot()),this.splayCount=this.tree.getSplayCount()}findLeftMostDescendent(i){for(;i!=null;)this.path.push(i),i=i.left}moveNext(){if(this.modificationCount!=this.tree.getModificationCount()){if(this.modificationCount==null){this.modificationCount=this.tree.getModificationCount();let t=this.tree.getRoot();for(;t!=null;)this.path.push(t),t=t.left;return this.path.length>0}throw"Concurrent modification during iteration."}if(!this.path.length)return!1;this.splayCount!=this.tree.getSplayCount()&&this.rebuildPath(this.path[this.path.length-1].key);let i=this.path[this.path.length-1],e=i.right;if(e!=null){for(;e!=null;)this.path.push(e),e=e.left;return!0}for(this.path.pop();this.path.length&&this.path[this.path.length-1].right===i;)i=this.path.pop();return this.path.length>0}},fT=class extends qv{getValue(i){return i.key}},gT=class extends qv{getValue(i){return[i.key,i.key]}},$v=i=>()=>i,Fd=i=>{const e=i?(t,n)=>n.minus(t).abs().isLessThanOrEqualTo(i):$v(!1);return(t,n)=>e(t,n)?0:t.comparedTo(n)};function pT(i){const e=i?(t,n,s,o,h)=>t.exponentiatedBy(2).isLessThanOrEqualTo(o.minus(n).exponentiatedBy(2).plus(h.minus(s).exponentiatedBy(2)).times(i)):$v(!1);return(t,n,s)=>{const o=t.x,h=t.y,l=s.x,d=s.y,f=h.minus(d).times(n.x.minus(l)).minus(o.minus(l).times(n.y.minus(d)));return e(f,o,h,l,d)?0:f.comparedTo(0)}}var mT=i=>i,vT=i=>{if(i){const e=new Hl(Fd(i)),t=new Hl(Fd(i)),n=(o,h)=>h.addAndReturn(o),s=o=>({x:n(o.x,e),y:n(o.y,t)});return s({x:new Cn(0),y:new Cn(0)}),s}return mT},Gd=i=>({set:e=>{es=Gd(e)},reset:()=>Gd(i),compare:Fd(i),snap:vT(i),orient:pT(i)}),es=Gd(),mh=(i,e)=>i.ll.x.isLessThanOrEqualTo(e.x)&&e.x.isLessThanOrEqualTo(i.ur.x)&&i.ll.y.isLessThanOrEqualTo(e.y)&&e.y.isLessThanOrEqualTo(i.ur.y),jd=(i,e)=>{if(e.ur.x.isLessThan(i.ll.x)||i.ur.x.isLessThan(e.ll.x)||e.ur.y.isLessThan(i.ll.y)||i.ur.y.isLessThan(e.ll.y))return null;const t=i.ll.x.isLessThan(e.ll.x)?e.ll.x:i.ll.x,n=i.ur.x.isLessThan(e.ur.x)?i.ur.x:e.ur.x,s=i.ll.y.isLessThan(e.ll.y)?e.ll.y:i.ll.y,o=i.ur.y.isLessThan(e.ur.y)?i.ur.y:e.ur.y;return{ll:{x:t,y:s},ur:{x:n,y:o}}},Xl=(i,e)=>i.x.times(e.y).minus(i.y.times(e.x)),Wv=(i,e)=>i.x.times(e.x).plus(i.y.times(e.y)),Yl=i=>Wv(i,i).sqrt(),yT=(i,e,t)=>{const n={x:e.x.minus(i.x),y:e.y.minus(i.y)},s={x:t.x.minus(i.x),y:t.y.minus(i.y)};return Xl(s,n).div(Yl(s)).div(Yl(n))},_T=(i,e,t)=>{const n={x:e.x.minus(i.x),y:e.y.minus(i.y)},s={x:t.x.minus(i.x),y:t.y.minus(i.y)};return Wv(s,n).div(Yl(s)).div(Yl(n))},Hv=(i,e,t)=>e.y.isZero()?null:{x:i.x.plus(e.x.div(e.y).times(t.minus(i.y))),y:t},Xv=(i,e,t)=>e.x.isZero()?null:{x:t,y:i.y.plus(e.y.div(e.x).times(t.minus(i.x)))},wT=(i,e,t,n)=>{if(e.x.isZero())return Xv(t,n,i.x);if(n.x.isZero())return Xv(i,e,t.x);if(e.y.isZero())return Hv(t,n,i.y);if(n.y.isZero())return Hv(i,e,t.y);const s=Xl(e,n);if(s.isZero())return null;const o={x:t.x.minus(i.x),y:t.y.minus(i.y)},h=Xl(o,e).div(s),l=Xl(o,n).div(s),d=i.x.plus(l.times(e.x)),f=t.x.plus(h.times(n.x)),v=i.y.plus(l.times(e.y)),m=t.y.plus(h.times(n.y)),y=d.plus(f).div(2),w=v.plus(m).div(2);return{x:y,y:w}},In=class S1{constructor(e,t){p(this,"point");p(this,"isLeft");p(this,"segment");p(this,"otherSE");p(this,"consumedBy");e.events===void 0?e.events=[this]:e.events.push(this),this.point=e,this.isLeft=t}static compare(e,t){const n=S1.comparePoints(e.point,t.point);return n!==0?n:(e.point!==t.point&&e.link(t),e.isLeft!==t.isLeft?e.isLeft?1:-1:Jl.compare(e.segment,t.segment))}static comparePoints(e,t){return e.x.isLessThan(t.x)?-1:e.x.isGreaterThan(t.x)?1:e.y.isLessThan(t.y)?-1:e.y.isGreaterThan(t.y)?1:0}link(e){if(e.point===this.point)throw new Error("Tried to link already linked events");const t=e.point.events;for(let n=0,s=t.length;n<s;n++){const o=t[n];this.point.events.push(o),o.point=this.point}this.checkForConsuming()}checkForConsuming(){const e=this.point.events.length;for(let t=0;t<e;t++){const n=this.point.events[t];if(n.segment.consumedBy===void 0)for(let s=t+1;s<e;s++){const o=this.point.events[s];o.consumedBy===void 0&&n.otherSE.point.events===o.otherSE.point.events&&n.segment.consume(o.segment)}}}getAvailableLinkedEvents(){const e=[];for(let t=0,n=this.point.events.length;t<n;t++){const s=this.point.events[t];s!==this&&!s.segment.ringOut&&s.segment.isInResult()&&e.push(s)}return e}getLeftmostComparator(e){const t=new Map,n=s=>{const o=s.otherSE;t.set(s,{sine:yT(this.point,e.point,o.point),cosine:_T(this.point,e.point,o.point)})};return(s,o)=>{t.has(s)||n(s),t.has(o)||n(o);const{sine:h,cosine:l}=t.get(s),{sine:d,cosine:f}=t.get(o);return h.isGreaterThanOrEqualTo(0)&&d.isGreaterThanOrEqualTo(0)?l.isLessThan(f)?1:l.isGreaterThan(f)?-1:0:h.isLessThan(0)&&d.isLessThan(0)?l.isLessThan(f)?-1:l.isGreaterThan(f)?1:0:d.isLessThan(h)?-1:d.isGreaterThan(h)?1:0}}},ET=class sp{constructor(e){p(this,"events");p(this,"poly");p(this,"_isExteriorRing");p(this,"_enclosingRing");this.events=e;for(let t=0,n=e.length;t<n;t++)e[t].segment.ringOut=this;this.poly=null}static factory(e){const t=[];for(let n=0,s=e.length;n<s;n++){const o=e[n];if(!o.isInResult()||o.ringOut)continue;let h=null,l=o.leftSE,d=o.rightSE;const f=[l],v=l.point,m=[];for(;h=l,l=d,f.push(l),l.point!==v;)for(;;){const y=l.getAvailableLinkedEvents();if(y.length===0){const T=f[0].point,N=f[f.length-1].point;throw new Error(`Unable to complete output ring starting at [${T.x}, ${T.y}]. Last matching segment found ends at [${N.x}, ${N.y}].`)}if(y.length===1){d=y[0].otherSE;break}let w=null;for(let T=0,N=m.length;T<N;T++)if(m[T].point===l.point){w=T;break}if(w!==null){const T=m.splice(w)[0],N=f.splice(T.index);N.unshift(N[0].otherSE),t.push(new sp(N.reverse()));continue}m.push({index:f.length,point:l.point});const S=l.getLeftmostComparator(h);d=y.sort(S)[0].otherSE;break}t.push(new sp(f))}return t}getGeom(){let e=this.events[0].point;const t=[e];for(let f=1,v=this.events.length-1;f<v;f++){const m=this.events[f].point,y=this.events[f+1].point;es.orient(m,e,y)!==0&&(t.push(m),e=m)}if(t.length===1)return null;const n=t[0],s=t[1];es.orient(n,e,s)===0&&t.shift(),t.push(t[0]);const o=this.isExteriorRing()?1:-1,h=this.isExteriorRing()?0:t.length-1,l=this.isExteriorRing()?t.length:-1,d=[];for(let f=h;f!=l;f+=o)d.push([t[f].x.toNumber(),t[f].y.toNumber()]);return d}isExteriorRing(){if(this._isExteriorRing===void 0){const e=this.enclosingRing();this._isExteriorRing=e?!e.isExteriorRing():!0}return this._isExteriorRing}enclosingRing(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}_calcEnclosingRing(){var s,o;let e=this.events[0];for(let h=1,l=this.events.length;h<l;h++){const d=this.events[h];In.compare(e,d)>0&&(e=d)}let t=e.segment.prevInResult(),n=t?t.prevInResult():null;for(;;){if(!t)return null;if(!n)return t.ringOut;if(n.ringOut!==t.ringOut)return((s=n.ringOut)==null?void 0:s.enclosingRing())!==t.ringOut?t.ringOut:(o=t.ringOut)==null?void 0:o.enclosingRing();t=n.prevInResult(),n=t?t.prevInResult():null}}},Yv=class{constructor(i){p(this,"exteriorRing");p(this,"interiorRings");this.exteriorRing=i,i.poly=this,this.interiorRings=[]}addInterior(i){this.interiorRings.push(i),i.poly=this}getGeom(){const i=this.exteriorRing.getGeom();if(i===null)return null;const e=[i];for(let t=0,n=this.interiorRings.length;t<n;t++){const s=this.interiorRings[t].getGeom();s!==null&&e.push(s)}return e}},ST=class{constructor(i){p(this,"rings");p(this,"polys");this.rings=i,this.polys=this._composePolys(i)}getGeom(){const i=[];for(let e=0,t=this.polys.length;e<t;e++){const n=this.polys[e].getGeom();n!==null&&i.push(n)}return i}_composePolys(i){var t;const e=[];for(let n=0,s=i.length;n<s;n++){const o=i[n];if(!o.poly)if(o.isExteriorRing())e.push(new Yv(o));else{const h=o.enclosingRing();h!=null&&h.poly||e.push(new Yv(h)),(t=h==null?void 0:h.poly)==null||t.addInterior(o)}}return e}},xT=class{constructor(i,e=Jl.compare){p(this,"queue");p(this,"tree");p(this,"segments");this.queue=i,this.tree=new Hl(e),this.segments=[]}process(i){const e=i.segment,t=[];if(i.consumedBy)return i.isLeft?this.queue.delete(i.otherSE):this.tree.delete(e),t;i.isLeft&&this.tree.add(e);let n=e,s=e;do n=this.tree.lastBefore(n);while(n!=null&&n.consumedBy!=null);do s=this.tree.firstAfter(s);while(s!=null&&s.consumedBy!=null);if(i.isLeft){let o=null;if(n){const l=n.getIntersection(e);if(l!==null&&(e.isAnEndpoint(l)||(o=l),!n.isAnEndpoint(l))){const d=this._splitSafely(n,l);for(let f=0,v=d.length;f<v;f++)t.push(d[f])}}let h=null;if(s){const l=s.getIntersection(e);if(l!==null&&(e.isAnEndpoint(l)||(h=l),!s.isAnEndpoint(l))){const d=this._splitSafely(s,l);for(let f=0,v=d.length;f<v;f++)t.push(d[f])}}if(o!==null||h!==null){let l=null;o===null?l=h:h===null?l=o:l=In.comparePoints(o,h)<=0?o:h,this.queue.delete(e.rightSE),t.push(e.rightSE);const d=e.split(l);for(let f=0,v=d.length;f<v;f++)t.push(d[f])}t.length>0?(this.tree.delete(e),t.push(i)):(this.segments.push(e),e.prev=n)}else{if(n&&s){const o=n.getIntersection(s);if(o!==null){if(!n.isAnEndpoint(o)){const h=this._splitSafely(n,o);for(let l=0,d=h.length;l<d;l++)t.push(h[l])}if(!s.isAnEndpoint(o)){const h=this._splitSafely(s,o);for(let l=0,d=h.length;l<d;l++)t.push(h[l])}}}this.tree.delete(e)}return t}_splitSafely(i,e){this.tree.delete(i);const t=i.rightSE;this.queue.delete(t);const n=i.split(e);return n.push(t),i.consumedBy===void 0&&this.tree.add(i),n}},bT=class{constructor(){p(this,"type");p(this,"numMultiPolys")}run(i,e,t){vh.type=i;const n=[new Kv(e,!0)];for(let f=0,v=t.length;f<v;f++)n.push(new Kv(t[f],!1));if(vh.numMultiPolys=n.length,vh.type==="difference"){const f=n[0];let v=1;for(;v<n.length;)jd(n[v].bbox,f.bbox)!==null?v++:n.splice(v,1)}if(vh.type==="intersection")for(let f=0,v=n.length;f<v;f++){const m=n[f];for(let y=f+1,w=n.length;y<w;y++)if(jd(m.bbox,n[y].bbox)===null)return[]}const s=new Hl(In.compare);for(let f=0,v=n.length;f<v;f++){const m=n[f].getSweepEvents();for(let y=0,w=m.length;y<w;y++)s.add(m[y])}const o=new xT(s);let h=null;for(s.size!=0&&(h=s.first(),s.delete(h));h;){const f=o.process(h);for(let v=0,m=f.length;v<m;v++){const y=f[v];y.consumedBy===void 0&&s.add(y)}s.size!=0?(h=s.first(),s.delete(h)):h=null}es.reset();const l=ET.factory(o.segments);return new ST(l).getGeom()}},vh=new bT,yh=vh,PT=0,Jl=class zu{constructor(e,t,n,s){p(this,"id");p(this,"leftSE");p(this,"rightSE");p(this,"rings");p(this,"windings");p(this,"ringOut");p(this,"consumedBy");p(this,"prev");p(this,"_prevInResult");p(this,"_beforeState");p(this,"_afterState");p(this,"_isInResult");this.id=++PT,this.leftSE=e,e.segment=this,e.otherSE=t,this.rightSE=t,t.segment=this,t.otherSE=e,this.rings=n,this.windings=s}static compare(e,t){const n=e.leftSE.point.x,s=t.leftSE.point.x,o=e.rightSE.point.x,h=t.rightSE.point.x;if(h.isLessThan(n))return 1;if(o.isLessThan(s))return-1;const l=e.leftSE.point.y,d=t.leftSE.point.y,f=e.rightSE.point.y,v=t.rightSE.point.y;if(n.isLessThan(s)){if(d.isLessThan(l)&&d.isLessThan(f))return 1;if(d.isGreaterThan(l)&&d.isGreaterThan(f))return-1;const m=e.comparePoint(t.leftSE.point);if(m<0)return 1;if(m>0)return-1;const y=t.comparePoint(e.rightSE.point);return y!==0?y:-1}if(n.isGreaterThan(s)){if(l.isLessThan(d)&&l.isLessThan(v))return-1;if(l.isGreaterThan(d)&&l.isGreaterThan(v))return 1;const m=t.comparePoint(e.leftSE.point);if(m!==0)return m;const y=e.comparePoint(t.rightSE.point);return y<0?1:y>0?-1:1}if(l.isLessThan(d))return-1;if(l.isGreaterThan(d))return 1;if(o.isLessThan(h)){const m=t.comparePoint(e.rightSE.point);if(m!==0)return m}if(o.isGreaterThan(h)){const m=e.comparePoint(t.rightSE.point);if(m<0)return 1;if(m>0)return-1}if(!o.eq(h)){const m=f.minus(l),y=o.minus(n),w=v.minus(d),S=h.minus(s);if(m.isGreaterThan(y)&&w.isLessThan(S))return 1;if(m.isLessThan(y)&&w.isGreaterThan(S))return-1}return o.isGreaterThan(h)?1:o.isLessThan(h)||f.isLessThan(v)?-1:f.isGreaterThan(v)?1:e.id<t.id?-1:e.id>t.id?1:0}static fromRing(e,t,n){let s,o,h;const l=In.comparePoints(e,t);if(l<0)s=e,o=t,h=1;else if(l>0)s=t,o=e,h=-1;else throw new Error(`Tried to create degenerate segment at [${e.x}, ${e.y}]`);const d=new In(s,!0),f=new In(o,!1);return new zu(d,f,[n],[h])}replaceRightSE(e){this.rightSE=e,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}bbox(){const e=this.leftSE.point.y,t=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:e.isLessThan(t)?e:t},ur:{x:this.rightSE.point.x,y:e.isGreaterThan(t)?e:t}}}vector(){return{x:this.rightSE.point.x.minus(this.leftSE.point.x),y:this.rightSE.point.y.minus(this.leftSE.point.y)}}isAnEndpoint(e){return e.x.eq(this.leftSE.point.x)&&e.y.eq(this.leftSE.point.y)||e.x.eq(this.rightSE.point.x)&&e.y.eq(this.rightSE.point.y)}comparePoint(e){return es.orient(this.leftSE.point,e,this.rightSE.point)}getIntersection(e){const t=this.bbox(),n=e.bbox(),s=jd(t,n);if(s===null)return null;const o=this.leftSE.point,h=this.rightSE.point,l=e.leftSE.point,d=e.rightSE.point,f=mh(t,l)&&this.comparePoint(l)===0,v=mh(n,o)&&e.comparePoint(o)===0,m=mh(t,d)&&this.comparePoint(d)===0,y=mh(n,h)&&e.comparePoint(h)===0;if(v&&f)return y&&!m?h:!y&&m?d:null;if(v)return m&&o.x.eq(d.x)&&o.y.eq(d.y)?null:o;if(f)return y&&h.x.eq(l.x)&&h.y.eq(l.y)?null:l;if(y&&m)return null;if(y)return h;if(m)return d;const w=wT(o,this.vector(),l,e.vector());return w===null||!mh(s,w)?null:es.snap(w)}split(e){const t=[],n=e.events!==void 0,s=new In(e,!0),o=new In(e,!1),h=this.rightSE;this.replaceRightSE(o),t.push(o),t.push(s);const l=new zu(s,h,this.rings.slice(),this.windings.slice());return In.comparePoints(l.leftSE.point,l.rightSE.point)>0&&l.swapEvents(),In.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),n&&(s.checkForConsuming(),o.checkForConsuming()),t}swapEvents(){const e=this.rightSE;this.rightSE=this.leftSE,this.leftSE=e,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let t=0,n=this.windings.length;t<n;t++)this.windings[t]*=-1}consume(e){let t=this,n=e;for(;t.consumedBy;)t=t.consumedBy;for(;n.consumedBy;)n=n.consumedBy;const s=zu.compare(t,n);if(s!==0){if(s>0){const o=t;t=n,n=o}if(t.prev===n){const o=t;t=n,n=o}for(let o=0,h=n.rings.length;o<h;o++){const l=n.rings[o],d=n.windings[o],f=t.rings.indexOf(l);f===-1?(t.rings.push(l),t.windings.push(d)):t.windings[f]+=d}n.rings=null,n.windings=null,n.consumedBy=t,n.leftSE.consumedBy=t.leftSE,n.rightSE.consumedBy=t.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{const e=this.prev.consumedBy||this.prev;this._beforeState=e.afterState()}return this._beforeState}afterState(){if(this._afterState!==void 0)return this._afterState;const e=this.beforeState();this._afterState={rings:e.rings.slice(0),windings:e.windings.slice(0),multiPolys:[]};const t=this._afterState.rings,n=this._afterState.windings,s=this._afterState.multiPolys;for(let l=0,d=this.rings.length;l<d;l++){const f=this.rings[l],v=this.windings[l],m=t.indexOf(f);m===-1?(t.push(f),n.push(v)):n[m]+=v}const o=[],h=[];for(let l=0,d=t.length;l<d;l++){if(n[l]===0)continue;const f=t[l],v=f.poly;if(h.indexOf(v)===-1)if(f.isExterior)o.push(v);else{h.indexOf(v)===-1&&h.push(v);const m=o.indexOf(f.poly);m!==-1&&o.splice(m,1)}}for(let l=0,d=o.length;l<d;l++){const f=o[l].multiPoly;s.indexOf(f)===-1&&s.push(f)}return this._afterState}isInResult(){if(this.consumedBy)return!1;if(this._isInResult!==void 0)return this._isInResult;const e=this.beforeState().multiPolys,t=this.afterState().multiPolys;switch(yh.type){case"union":{const n=e.length===0,s=t.length===0;this._isInResult=n!==s;break}case"intersection":{let n,s;e.length<t.length?(n=e.length,s=t.length):(n=t.length,s=e.length),this._isInResult=s===yh.numMultiPolys&&n<s;break}case"xor":{const n=Math.abs(e.length-t.length);this._isInResult=n%2===1;break}case"difference":{const n=s=>s.length===1&&s[0].isSubject;this._isInResult=n(e)!==n(t);break}}return this._isInResult}},Jv=class{constructor(i,e,t){p(this,"poly");p(this,"isExterior");p(this,"segments");p(this,"bbox");if(!Array.isArray(i)||i.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=e,this.isExterior=t,this.segments=[],typeof i[0][0]!="number"||typeof i[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");const n=es.snap({x:new Cn(i[0][0]),y:new Cn(i[0][1])});this.bbox={ll:{x:n.x,y:n.y},ur:{x:n.x,y:n.y}};let s=n;for(let o=1,h=i.length;o<h;o++){if(typeof i[o][0]!="number"||typeof i[o][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");const l=es.snap({x:new Cn(i[o][0]),y:new Cn(i[o][1])});l.x.eq(s.x)&&l.y.eq(s.y)||(this.segments.push(Jl.fromRing(s,l,this)),l.x.isLessThan(this.bbox.ll.x)&&(this.bbox.ll.x=l.x),l.y.isLessThan(this.bbox.ll.y)&&(this.bbox.ll.y=l.y),l.x.isGreaterThan(this.bbox.ur.x)&&(this.bbox.ur.x=l.x),l.y.isGreaterThan(this.bbox.ur.y)&&(this.bbox.ur.y=l.y),s=l)}(!n.x.eq(s.x)||!n.y.eq(s.y))&&this.segments.push(Jl.fromRing(s,n,this))}getSweepEvents(){const i=[];for(let e=0,t=this.segments.length;e<t;e++){const n=this.segments[e];i.push(n.leftSE),i.push(n.rightSE)}return i}},CT=class{constructor(i,e){p(this,"multiPoly");p(this,"exteriorRing");p(this,"interiorRings");p(this,"bbox");if(!Array.isArray(i))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new Jv(i[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 t=1,n=i.length;t<n;t++){const s=new Jv(i[t],this,!1);s.bbox.ll.x.isLessThan(this.bbox.ll.x)&&(this.bbox.ll.x=s.bbox.ll.x),s.bbox.ll.y.isLessThan(this.bbox.ll.y)&&(this.bbox.ll.y=s.bbox.ll.y),s.bbox.ur.x.isGreaterThan(this.bbox.ur.x)&&(this.bbox.ur.x=s.bbox.ur.x),s.bbox.ur.y.isGreaterThan(this.bbox.ur.y)&&(this.bbox.ur.y=s.bbox.ur.y),this.interiorRings.push(s)}this.multiPoly=e}getSweepEvents(){const i=this.exteriorRing.getSweepEvents();for(let e=0,t=this.interiorRings.length;e<t;e++){const n=this.interiorRings[e].getSweepEvents();for(let s=0,o=n.length;s<o;s++)i.push(n[s])}return i}},Kv=class{constructor(i,e){p(this,"isSubject");p(this,"polys");p(this,"bbox");if(!Array.isArray(i))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof i[0][0][0]=="number"&&(i=[i])}catch{}this.polys=[],this.bbox={ll:{x:new Cn(Number.POSITIVE_INFINITY),y:new Cn(Number.POSITIVE_INFINITY)},ur:{x:new Cn(Number.NEGATIVE_INFINITY),y:new Cn(Number.NEGATIVE_INFINITY)}};for(let t=0,n=i.length;t<n;t++){const s=new CT(i[t],this);s.bbox.ll.x.isLessThan(this.bbox.ll.x)&&(this.bbox.ll.x=s.bbox.ll.x),s.bbox.ll.y.isLessThan(this.bbox.ll.y)&&(this.bbox.ll.y=s.bbox.ll.y),s.bbox.ur.x.isGreaterThan(this.bbox.ur.x)&&(this.bbox.ur.x=s.bbox.ur.x),s.bbox.ur.y.isGreaterThan(this.bbox.ur.y)&&(this.bbox.ur.y=s.bbox.ur.y),this.polys.push(s)}this.isSubject=e}getSweepEvents(){const i=[];for(let e=0,t=this.polys.length;e<t;e++){const n=this.polys[e].getSweepEvents();for(let s=0,o=n.length;s<o;s++)i.push(n[s])}return i}},IT=(i,...e)=>yh.run("union",i,e),MT=(i,...e)=>yh.run("intersection",i,e),TT=(i,...e)=>yh.run("difference",i,e);es.set;function kT(i){const e=[];if(ar(i,s=>{e.push(s.coordinates)}),e.length<2)throw new Error("Must have at least two features");const t=i.features[0].properties||{},n=TT(e[0],...e.slice(1));return n.length===0?null:n.length===1?de(n[0],t):rd(n,t)}function Kl(i,e,t={}){const n=Ie(i),s=Ie(e);s[0]+=s[0]-n[0]>180?-360:n[0]-s[0]>180?360:0;const o=OT(n,s);return nh(o,"meters",t.units)}function OT(i,e,t){t=t===void 0?Le:Number(t);const n=t,s=i[1]*Math.PI/180,o=e[1]*Math.PI/180,h=o-s;let l=Math.abs(e[0]-i[0])*Math.PI/180;l>Math.PI&&(l-=2*Math.PI);const d=Math.log(Math.tan(o/2+Math.PI/4)/Math.tan(s/2+Math.PI/4)),f=Math.abs(d)>1e-11?h/d:Math.cos(s);return Math.sqrt(h*h+f*f*l*l)*n}function NT(i,e,t,n={}){const s=e<0;let o=nh(Math.abs(e),n.units,"meters");s&&(o=-Math.abs(o));const h=Ie(i),l=RT(h,o,t);return l[0]+=l[0]-h[0]>180?-360:h[0]-l[0]>180?360:0,Xt(l,n.properties)}function RT(i,e,t,n){n=n===void 0?Le:Number(n);const s=e/n,o=i[0]*Math.PI/180,h=Fe(i[1]),l=Fe(t),d=s*Math.cos(l);let f=h+d;Math.abs(f)>Math.PI/2&&(f=f>0?Math.PI-f:-Math.PI-f);const v=Math.log(Math.tan(f/2+Math.PI/4)/Math.tan(h/2+Math.PI/4)),m=Math.abs(v)>1e-11?d/v:Math.cos(h),y=s*Math.sin(l)/m;return[((o+y)*180/Math.PI+540)%360-180,f*180/Math.PI]}function _h(i,e={}){const t=[];if(ar(i,s=>{t.push(s.coordinates)}),t.length<2)throw new Error("Must specify at least 2 geometries");const n=MT(t[0],...t.slice(1));return n.length===0?null:n.length===1?de(n[0],e.properties):rd(n,e.properties)}function AT(i,e,t={}){const n=JSON.stringify(t.properties||{}),[s,o,h,l]=i,d=(o+l)/2,f=(s+h)/2,m=e*2/pi([s,d],[h,d],t)*(h-s),w=e*2/pi([f,o],[f,l],t)*(l-o),S=m/2,T=S*2,N=Math.sqrt(3)/2*w,j=h-s,C=l-o,k=3/4*T,M=N,D=(j-T)/(T-S/2),L=Math.floor(D),V=(L*k-S/2-j)/2-S/2+k/2,x=Math.floor((C-N)/N);let I=(C-x*N)/2;const R=x*N-C>N/2;R&&(I-=N/4);const G=[],F=[];for(let z=0;z<6;z++){const $=2*Math.PI/6*z;G.push(Math.cos($)),F.push(Math.sin($))}const U=[];for(let z=0;z<=L;z++)for(let $=0;$<=x;$++){const W=z%2===1;if($===0&&W||$===0&&R)continue;const X=z*k+s-V;let Y=$*M+o+I;if(W&&(Y-=N/2),t.triangles===!0)LT([X,Y],m/2,w/2,JSON.parse(n),G,F).forEach(function(et){t.mask?_h(ae([t.mask,et]))&&U.push(et):U.push(et)});else{const et=DT([X,Y],m/2,w/2,JSON.parse(n),G,F);t.mask?_h(ae([t.mask,et]))&&U.push(et):U.push(et)}}return ae(U)}function DT(i,e,t,n,s,o){const h=[];for(let l=0;l<6;l++){const d=i[0]+e*s[l],f=i[1]+t*o[l];h.push([d,f])}return h.push(h[0].slice()),de([h],n)}function LT(i,e,t,n,s,o){const h=[];for(let l=0;l<6;l++){const d=[];d.push(i),d.push([i[0]+e*s[l],i[1]+t*o[l]]),d.push([i[0]+e*s[(l+1)%6],i[1]+t*o[(l+1)%6]]),d.push(i),h.push(de([d],n))}return h}function FT(i,e,t={}){t.mask&&!t.units&&(t.units="kilometers");for(var n=[],s=i[0],o=i[1],h=i[2],l=i[3],d=e/pi([s,o],[h,o],t),f=d*(h-s),v=e/pi([s,o],[s,l],t),m=v*(l-o),y=h-s,w=l-o,S=Math.floor(y/f),T=Math.floor(w/m),N=(y-S*f)/2,j=(w-T*m)/2,C=s+N;C<=h;){for(var k=o+j;k<=l;){var M=Xt([C,k],t.properties);t.mask?J0(M,t.mask)&&n.push(M):n.push(M),k+=m}C+=f}return ae(n)}function GT(i,e,t,n={}){const s=[],o=i[0],h=i[1],l=i[2],d=i[3],f=l-o,v=nh(e,n.units,"degrees"),m=d-h,y=nh(t,n.units,"degrees"),w=Math.floor(Math.abs(f)/v),S=Math.floor(Math.abs(m)/y),T=(f-w*v)/2,N=(m-S*y)/2;let j=o+T;for(let C=0;C<w;C++){let k=h+N;for(let M=0;M<S;M++){const D=de([[[j,k],[j,k+y],[j+v,k+y],[j+v,k],[j,k]]],n.properties);n.mask?nM(n.mask,D)&&s.push(D):s.push(D),k+=y}j+=v}return ae(s)}function jT(i,e,t={}){return GT(i,e,e,t)}function BT(i,e,t={}){for(var n=[],s=e/pi([i[0],i[1]],[i[2],i[1]],t),o=s*(i[2]-i[0]),h=e/pi([i[0],i[1]],[i[0],i[3]],t),l=h*(i[3]-i[1]),d=0,f=i[0];f<=i[2];){for(var v=0,m=i[1];m<=i[3];){var y=null,w=null;d%2===0&&v%2===0?(y=de([[[f,m],[f,m+l],[f+o,m],[f,m]]],t.properties),w=de([[[f,m+l],[f+o,m+l],[f+o,m],[f,m+l]]],t.properties)):d%2===0&&v%2===1?(y=de([[[f,m],[f+o,m+l],[f+o,m],[f,m]]],t.properties),w=de([[[f,m],[f,m+l],[f+o,m+l],[f,m]]],t.properties)):v%2===0&&d%2===1?(y=de([[[f,m],[f,m+l],[f+o,m+l],[f,m]]],t.properties),w=de([[[f,m],[f+o,m+l],[f+o,m],[f,m]]],t.properties)):v%2===1&&d%2===1&&(y=de([[[f,m],[f,m+l],[f+o,m],[f,m]]],t.properties),w=de([[[f,m+l],[f+o,m+l],[f+o,m],[f,m+l]]],t.properties)),t.mask?(_h(ae([t.mask,y]))&&n.push(y),_h(ae([t.mask,w]))&&n.push(w)):(n.push(y),n.push(w)),m+=l,v++}d++,f+=o}return ae(n)}function zT(i,e,t){var n,s,o,h;if(t=t||{},typeof t!="object")throw new Error("options is invalid");if(!i)throw new Error("points is required");if(BC(i,"Point","input must contain Points"),!e)throw new Error("cellSize is required");var l=(n=t.gridType)!=null?n:"square",d=(s=t.property)!=null?s:"elevation",f=(o=t.weight)!=null?o:1,v=(h=t.bbox)!=null?h:He(i);if(f!==void 0&&typeof f!="number")throw new Error("weight must be a number");jC(v);var m;switch(l){case"point":case"points":m=FT(v,e,t);break;case"square":case"squares":m=jT(v,e,t);break;case"hex":case"hexes":m=AT(v,e,t);break;case"triangle":case"triangles":m=BT(v,e,t);break;default:throw new Error("invalid gridType")}var y=[];return Is(m,function(w){var S,T=0,N=0;Is(i,function(C){var k,M=l==="point"?w:kd(w),D=pi(M,C,t),L;if(d!==void 0&&(L=(k=C.properties)==null?void 0:k[d]),L===void 0&&(L=C.geometry.coordinates[2]),L===void 0)throw new Error("zValue is missing");D===0&&(T=L);var V=1/Math.pow(D,f);N+=V,T+=V*L});var j=hT(w);(S=j.properties)!=null||(j.properties={}),j.properties[d]=T/N,y.push(j)}),ae(y)}function Zv(i,e={}){return $C(i,(t,n)=>{const s=n.geometry.coordinates;return t+pi(s[0],s[1],e)},0)}function UT(i,e){const t=pi(i,e),n=sh(i,e);return xn(i,t/2,n)}function VT(i,e,t={}){var n,s;const o=(n=t.method)!=null?n:"geodesic",h=(s=t.units)!=null?s:"kilometers";if(!i)throw new Error("pt is required");if(Array.isArray(i)?i=Xt(i):i.type==="Point"?i=ni(i):P0(i,"Point","point"),!e)throw new Error("line is required");Array.isArray(e)?e=Ce(e):e.type==="LineString"?e=ni(e):P0(e,"LineString","line");let l=1/0;const d=i.geometry.coordinates;return I0(e,f=>{if(f){const v=f.geometry.coordinates[0],m=f.geometry.coordinates[1],y=qT(d,v,m,{method:o});y<l&&(l=y)}}),nh(l,"degrees",h)}function qT(i,e,t,n){if(n.method==="geodesic")return md(Ce([e,t]).geometry,i,{units:"degrees"}).properties.pointDistance;const s=[t[0]-e[0],t[1]-e[1]],o=[i[0]-e[0],i[1]-e[1]],h=Qv(o,s);if(h<=0)return Kl(i,e,{units:"degrees"});const l=Qv(s,s);if(l<=h)return Kl(i,t,{units:"degrees"});const d=h/l,f=[e[0]+d*s[0],e[1]+d*s[1]];return Kl(i,f,{units:"degrees"})}function Qv(i,e){return i[0]*e[0]+i[1]*e[1]}function $T(i,e={}){const t=[];if(ar(i,s=>{t.push(s.coordinates)}),t.length<2)throw new Error("Must have at least 2 geometries");const n=IT(t[0],...t.slice(1));return n.length===0?null:n.length===1?de(n[0],e.properties):rd(n,e.properties)}function WT(i,e){const t=i[0],n=i[i.length-1];(t[0]!==n[0]||t[1]!==n[1]||t[2]!==n[2])&&i.push(t);const s=Xt(e),o=de([i]);return Oe(s,o)}function HT(i,e){const t=Ce(i);return ud(t,e,{units:"meters"}).geometry.coordinates}function Bd(i){if((i[0][0]!==i[i.length-1][0]||i[0][1]!==i[i.length-1][1]||i[0][2]!==i[i.length-1][2])&&i.push(i[0]),i.length<=3)return 0;const e=de([i]);return WC(e)}function XT(i){(i[0][0]!==i[i.length-1][0]||i[0][1]!==i[i.length-1][1]||i[0][2]!==i[i.length-1][2])&&i.push(i[0]);const e=de([i]),n=Gv(e).geometry.coordinates;return[n[0],n[1],n[2]??i[0][2]??0]}function zd(...i){let[e,t,n,s]=i;const[o,h,l]=e;if(Array.isArray(t)){const[d,f,v]=t,m=Math.sqrt(d*d+f*f);let y=0;m>0&&(y=Math.atan2(d,f)*(180/Math.PI),y<0&&(y+=360));const w=xn(Xt([o,h]),m,y,{units:"meters"});return!w||!w.geometry||!w.geometry.coordinates?void 0:(n=n||[0,0,0],n[0]=w.geometry.coordinates[0],n[1]=w.geometry.coordinates[1],n[2]=l+(v||0),n)}else{const d=xn(Xt([o,h]),t,n,{units:"meters"});return!d||!d.geometry||!d.geometry.coordinates?void 0:(s=s||[0,0,0],s[0]=d.geometry.coordinates[0],s[1]=d.geometry.coordinates[1],s[2]=l,s)}}function Zl(i,e){return pi(Xt(i),Xt(e),{units:"meters"})}function wh(i,e){return sh(Xt(i),Xt(e))}function YT(i,e){return or(Ce(i),Ce(e))}function JT(i,e){const t=Xt(i),n=Xt(e),s=UT(t,n),o=(i[2]+e[2])/2;return[...s.geometry.coordinates,o]}function KT(i,e){const t=Xt(e),n=Ce(i);return md(n,t,{units:"meters"})}function ZT(i,e){const t=Xt(i),n=Ce(e);return VT(t,n,{units:"meters"})}function QT(i,e,t,n){const[s,o,h]=i,l=NT(Xt([s,o]),e,t,{units:"meters"});if(!(!l||!l.geometry||!l.geometry.coordinates))return n=n||[0,0,0],n[0]=l.geometry.coordinates[0],n[1]=l.geometry.coordinates[1],n[2]=h,n}function ty(i,e){return Kl(Xt(i),Xt(e),{units:"meters"})}function tk(i,e){return UC(Xt(i),Xt(e))}function ey(i,e){(i[0][0]!==i[i.length-1][0]||i[0][1]!==i[i.length-1][1]||i[0][2]!==i[i.length-1][2])&&i.push(i[0]),(e[0][0]!==e[e.length-1][0]||e[0][1]!==e[e.length-1][1]||e[0][2]!==e[e.length-1][2])&&e.push(e[0]);const t=_h(sd([[i],[e]]));if(t)return t.geometry.coordinates}function iy(i,e){(i[0][0]!==i[i.length-1][0]||i[0][1]!==i[i.length-1][1]||i[0][2]!==i[i.length-1][2])&&i.push(i[0]),(e[0][0]!==e[e.length-1][0]||e[0][1]!==e[e.length-1][1]||e[0][2]!==e[e.length-1][2])&&e.push(e[0]);const t=$T(sd([[i],[e]]));if(t)return t.geometry.coordinates}function ny(i,e=500,t="meters"){const n=$M(Ce(i),e,{units:t});if(n)return n.geometry.coordinates}function sy(i,e){(i[0][0]!==i[i.length-1][0]||i[0][1]!==i[i.length-1][1]||i[0][2]!==i[i.length-1][2])&&i.push(i[0]),(e[0][0]!==e[e.length-1][0]||e[0][1]!==e[e.length-1][1]||e[0][2]!==e[e.length-1][2])&&e.push(e[0]);const t=kT(sd([[i],[e]]));if(t)return t.geometry.coordinates}function ry(i,e,t=10,n="meters"){return oT(i,e,{steps:t,units:n}).geometry.coordinates}function Ud(i,e){(i[0][0]!==i[i.length-1][0]||i[0][1]!==i[i.length-1][1]||i[0][2]!==i[i.length-1][2])&&i.push(i[0]),(e[0][0]!==e[e.length-1][0]||e[0][1]!==e[e.length-1][1]||e[0][2]!==e[e.length-1][2])&&e.push(e[0]);const t=de([i]),n=de([e]);return GI(t,n)?"oneBig":J0(t,n)?"twoBig":!1}function Ql(i){const e=_s(Js(i,["0"])),t=_s(Js(i,["1"])),n=_s(Js(i,["2"])),s=Yn(Js(i,["0"])),o=Yn(Js(i,["1"])),h=Yn(Js(i,["2"]));return{minPos:[e,t,n],maxPos:[s,o,h],center:[(e+s)*.5,(t+o)*.5,(n+h)*.5]}}function ay(i){const{minPos:e,maxPos:t,center:n}=Ql(i);if(e.some(l=>!Number.isFinite(l)||t.some(d=>!Number.isFinite(d))||n.some(d=>!Number.isFinite(d)))){console.warn("geoCenterAndRadiusFromPositions error: minPos.some(e => !Number.isFinite(e) || maxPos.some(e => !Number.isFinite(e)) || center.some(e => !Number.isFinite(e))");return}const s=Zl(e,t);let o=s*.5;const h=Math.abs(e[2]-t[2]);return h!=0&&(o=Math.sqrt(s*s+h*h)*.5),{center:n,radius:o}}function oy(i,e){const t=sn(i),n=sn(e);return b.Vector.distance(t,n)}function is(i,e){const t=[],n=i.length;let s=0;for(let o=0;o<n-1;++o){if(e===void 0||e==="GEODESIC"){const h=Zl(i[o],i[o+1]),l=Math.abs(i[o][2]-i[o+1][2]);if(l===0)s+=h;else{const d=Math.sqrt(h*h+l*l);s+=d}}else if(e==="RHUMB"){const h=ty(i[o],i[o+1]),l=Math.abs(i[o][2]-i[o+1][2]);if(l===0)s+=h;else{const d=Math.sqrt(h*h+l*l);s+=d}}else if(e==="NONE"){const h=oy(i[o],i[o+1]);s+=h}else console.warn(`未知的arcType: ${e},导致距离无法计算!`);t.push(s)}return t}function Vd(i){const e="__getXyzFromPostion";let t=_i(i,e);return(!t||!b.Vector.equals(t[0],i))&&(t=[[...i],sn(i)],yn(i,e,t)),t[1]}class ek{constructor(e={}){p(this,"points");p(this,"duration");p(this,"sharpness");p(this,"centers");p(this,"controls");p(this,"stepLength");p(this,"length");p(this,"delay");p(this,"steps");this.points=e.points||[],this.duration=e.duration||1e4,this.sharpness=e.sharpness||.85,this.centers=[],this.controls=[],this.stepLength=e.stepLength||60,this.length=this.points.length,this.delay=0;for(let t=0;t<this.length;t++)this.points[t].z=this.points[t].z||0;for(let t=0;t<this.length-1;t++){const n=this.points[t],s=this.points[t+1];this.centers.push({x:(n.x+s.x)/2,y:(n.y+s.y)/2,z:(n.z+s.z)/2})}this.controls.push([this.points[0],this.points[0]]);for(let t=0;t<this.centers.length-1;t++){const n=this.points[t+1].x-(this.centers[t].x+this.centers[t+1].x)/2,s=this.points[t+1].y-(this.centers[t].y+this.centers[t+1].y)/2,o=this.points[t+1].z-(this.centers[t].z+this.centers[t+1].z)/2;this.controls.push([{x:(1-this.sharpness)*this.points[t+1].x+this.sharpness*(this.centers[t].x+n),y:(1-this.sharpness)*this.points[t+1].y+this.sharpness*(this.centers[t].y+s),z:(1-this.sharpness)*this.points[t+1].z+this.sharpness*(this.centers[t].z+o)},{x:(1-this.sharpness)*this.points[t+1].x+this.sharpness*(this.centers[t+1].x+n),y:(1-this.sharpness)*this.points[t+1].y+this.sharpness*(this.centers[t+1].y+s),z:(1-this.sharpness)*this.points[t+1].z+this.sharpness*(this.centers[t+1].z+o)}])}this.controls.push([this.points[this.length-1],this.points[this.length-1]]),this.steps=this.cacheSteps(this.stepLength)}cacheSteps(e){const t=[];let n=this.pos(0);t.push(0);for(let s=0;s<this.duration;s+=10){const o=this.pos(s);Math.sqrt((o.x-n.x)*(o.x-n.x)+(o.y-n.y)*(o.y-n.y)+(o.z-n.z)*(o.z-n.z))>e&&(t.push(s),n=o)}return t}vector(e){const t=this.pos(e+10),n=this.pos(e-10);return{angle:180*Math.atan2(t.y-n.y,t.x-n.x)/3.14,speed:Math.sqrt((n.x-t.x)*(n.x-t.x)+(n.y-t.y)*(n.y-t.y)+(n.z-t.z)*(n.z-t.z))}}pos(e){let t=e-this.delay;t<0&&(t=0),t>this.duration&&(t=this.duration-1);const n=t/this.duration;if(n>=1)return this.points[this.length-1];const s=Math.floor((this.points.length-1)*n),o=(this.length-1)*n-s;return ik(o,this.points[s],this.controls[s][1],this.controls[s+1][0],this.points[s+1])}}function ik(i,e,t,n,s){const o=nk(i);return{x:s.x*o[0]+n.x*o[1]+t.x*o[2]+e.x*o[3],y:s.y*o[0]+n.y*o[1]+t.y*o[2]+e.y*o[3],z:s.z*o[0]+n.z*o[1]+t.z*o[2]+e.z*o[3]}}function nk(i){const e=i*i;return[e*i,3*e*(1-i),3*i*(1-i)*(1-i),(1-i)*(1-i)*(1-i)]}function sk(i,e){e===void 0&&(e={});var t=e.resolution||1e3,n=e.sharpness||.85;const s=[],o=i.map(f=>{const[v,m,y]=sn(f);return{x:v,y:m,z:y}});for(var h=new ek({duration:t,points:o,sharpness:n}),l=function(f){var v=h.pos(f);const m=nd([v.x,v.y,v.z]);s.push(m)},d=0;d<h.duration;d+=10)l(d);return l(h.duration),s}function Pa(i,e,t){return sk(i,{resolution:e,sharpness:t})}function tu(i){return ms(i,(e,t)=>e[0]===t[0]&&e[1]===t[1],e=>[...e])}function hy(i,e){const t=new Array;for(let n of i)t.push(e(n));return t}function eu(i,e){return i===void 0&&e===void 0?!0:!i||!e?!1:i[0]===e[0]&&i[1]===e[1]&&i[2]===e[2]}function ly(i,e,t){var s;((s=e.attachedViewers.values().toArray()[0])==null?void 0:s.getEngineObject(e))?t.call(i):requestAnimationFrame(()=>ly(i,e,t))}function rk(i,e,t,n=!0){n&&t(),i.dispose(e.disposableOn(t))}function ak(i,e){const{type:t,id:n}=i;if(t){const s=St.create(t,n);if(s)return s.json=i,s;console.warn(`cannot create sceneObject from type(${t})`)}else console.warn(`cannot create sceneObject from type(${t})`)}function uy(i){const e=i.children&&tc(i.children,n=>{if(!(n instanceof ri))throw new Error("!(treeItem instanceof SceneTreeItem)");return!n.show})||!1,t=i.sceneTree.getSceneObjectShowFunc(i.sceneObject);return!e||t}class ri extends Do{constructor(t,n=!1,s,o,h=!0){super(t,n,s);p(this,"_dragDrop");p(this,"_showChangedNotAffectChildren",!1);p(this,"_showChangedNotAffectParent",!1);p(this,"_type",this.dv(it("Unknown")));p(this,"_isExport",this.dv(it(!0)));const l=()=>this.tree&&this.tree.itemsChanged.emit([this]);this.dispose(this.nameChanged.disposableOn(l)),this.name=`未命名条目(${this.id})`,this.extras=o,this._isExport.value=h;let d;const f=()=>{d&&(d(),d=void 0)};this.dispose(f),this.dispose(this.sceneObjectChanged.disposableOn(v=>{f(),v&&(d=mt([this,"name"],[v,"name"]))})),this.dispose(this.showChanged.disposableOn(v=>{if(t.setSceneObjectShowFunc(this.sceneObject,v),this.tree&&this.tree.forceRedraw(),this.children&&!this._showChangedNotAffectChildren)for(let m of this.children)m instanceof ri&&(m._showChangedNotAffectParent=!0,m.show=v,m._showChangedNotAffectParent=!1);this.parent&&this.parent instanceof ri&&!this._showChangedNotAffectParent&&(this.parent._showChangedNotAffectChildren=!0,this.parent.show=uy(this.parent),this.parent._showChangedNotAffectChildren=!1)})),this.dv(new xe(this.sceneObjectChanged,()=>{if(!this.sceneObject)return;const v=new st;if("show"in this.sceneObject&&"showChanged"in this.sceneObject&&this.sceneObject.showChanged instanceof H){const m=()=>{this.show=t.getSceneObjectShowFunc(this.sceneObject)};m(),v.dispose(this.sceneObject.showChanged.disposableOn(m))}else if("enabled"in this.sceneObject&&"enabledChanged"in this.sceneObject&&this.sceneObject.enabledChanged instanceof H){const m=()=>{this.show=t.getSceneObjectShowFunc(this.sceneObject)};m(),v.dispose(this.sceneObject.enabledChanged.disposableOn(m))}return v})),this.childrenChangedEvent.disposableOn(()=>{const v=uy(this);this._showChangedNotAffectChildren=!0,this.show=v,this._showChangedNotAffectChildren=!1});{const v=()=>{let m="Unknown";this.sceneObject?m=this.sceneObject.typeName:this.children&&(m="Folder"),this._type.value=m};this.dispose(this.sceneObjectChanged.disposableOn(v)),this.dispose(this.childrenResetedEvent.disposableOn(v)),v()}}get dragDrop(){return this._dragDrop||(this._dragDrop=this.dv(this.sceneTree.createTreeItemDragDropFunc(this))),this._dragDrop}get type(){return this._type.value}get typeChanged(){return this._type.changed}get isExport(){return this._isExport.value}get isExportChanged(){return this._isExport.changed}set isExport(t){this._isExport.value=t}get sceneTree(){return this.tree}get jsonStr(){return JSON.stringify(this.json,void 0," ")}set jsonStr(t){try{this.json=JSON.parse(t)}catch(n){console.error(`sceneTreeItem.jsonStr error ${n}`,n)}}get completeJson(){const t=this.children&&[...this.children].filter(n=>n.isExport).map(n=>n.completeJson);return{name:this.name,show:this.show?void 0:!1,collapsed:this.uiTreeObject.collapsed?!0:void 0,sceneObj:this.sceneObject&&this.sceneObject.completeJson,children:t,extras:this.extras}}get json(){const t=this.children&&[...this.children].filter(n=>n.isExport).map(n=>n.json);return{name:this.name,show:this.show?void 0:!1,collapsed:this.uiTreeObject.collapsed?!0:void 0,sceneObj:this.sceneObject&&this.sceneObject.json,children:t,extras:this.extras}}set json(t){if(t.name!==void 0&&(this.name=t.name),this.extras=t.extras,this._showChangedNotAffectChildren=!0,this._showChangedNotAffectParent=!0,this.show=t.show??!0,this._showChangedNotAffectChildren=!1,this._showChangedNotAffectParent=!1,this.uiTreeObject.collapsed=t.collapsed??!1,this.sceneObject=void 0,t.sceneObj&&(this.sceneObject=this.sceneTree.createSceneObjectFunc(t.sceneObj,this)),!!t.children){if(this.resetChildren(!0),!this.children)throw new Error("resetChildren(true) cannot get children!");for(let n of t.children){const s=new ri(this.tree,!0);s.json=n,this.children.push(s)}}}clone(){try{const t=new ri(this.sceneTree,!!this.children,void 0,this.extras,this.isExport);return t.json=this.json,t.name=this.sceneTree.getSceneTreeItemCloneNameFunc(this),t}catch(t){console.error(`SceneTreeItem.clone error: ${t}`,t)}}insertNewTreeItem(t,n){if(t==="FolderInnerOrAfter"||t==="FolderInnerOrBefore"||t==="FolderInner"){if(n&&n.tree!==this.tree)return console.warn("newTreeItem.tree !== this.tree"),!1;if(this.children&&!(t.includes("Or")&&this.sceneObject))return n&&this.children.push(n),!0;if(t==="FolderInner")return!1;if(t==="FolderInnerOrAfter")return super.insertNewTreeItem("After",n);if(t==="FolderInnerOrBefore")return super.insertNewTreeItem("Before",n);throw new Error("should not be here!")}else return super.insertNewTreeItem(t,n)}}(i=>{i.createDefaultProps=()=>({name:"未命名条目",nameEditing:!1,sceneObject:void 0,show:!0,extras:se(void 0)})})(ri||(ri={})),ys(ri.prototype,ri.createDefaultProps);function cy(i,e,t){let{offsetY:n}=e;if(!e.target||!("clientTop"in e.target))return"none";n+=2,n+=e.target.clientTop;let s="none";return i.children?n<=t*.3?s="before":n>=t*.7?!i.uiTreeObject.collapsed&&i.children.length>0?s="inner":s="after":s="inner":n<=t*.5?s="before":s="after",s}class dy extends _m{constructor(e){super(),this._treeItem=e;const{dragStartDataManager:t}=this._treeItem.sceneTree;let n="none";const s=this.disposeVar(Cp(()=>{this._treeItem.uiTreeObject.moveToPositionMode=n,console.log(`uiTreeObject.moveToPositionMode = lastDragMode(${n});`)},200));function o(h){n!==h&&(n=h,s.restart())}this.dispose(this._dragStartEvent.disposableOn(h=>{t.data={type:"UITreeA",value:this._treeItem}})),this.dispose(this._dragOverEvent.disposableOn(h=>{if(!h.dataTransfer)return;h.preventDefault();const l=t;if(l.data&&l.data.type==="UITreeA"&&l.data.value!==void 0){const d=l.data.value,f=this._treeItem,{tree:v}=f;if(v){const m=[...v.selectedItems];~m.indexOf(d)||m.push(d);const y=cy(f,h,v.itemDivHeight);if(y!=="none"&&er.canMoveToTreeItems(m,f,y)){h.dataTransfer.dropEffect="move",o(y);return}}}h.dataTransfer.dropEffect="none",o("none")})),this.dispose(this._dropEvent.disposableOn(h=>{const l=t;if(!(l.data&&l.data.type==="UITreeA"&&l.data.value!==void 0))return;const d=l.data.value,f=this._treeItem,{tree:v}=f;if(!v)return;const m=[...v.selectedItems];~m.indexOf(d)||m.push(d);const y=cy(f,h,v.itemDivHeight);y!=="none"&&er.canMoveToTreeItems(m,f,y)&&(er.moveToTreeItems(m,f,y),l.data=void 0,o("none"))})),this.dispose(this._dragLeaveEvent.disposableOn(()=>{n="none",s.restart()}))}}function ok(i){if(!(i instanceof ri))throw new Error("defaultCreateTreeItemDragDrop !(treeItem instanceof SceneTreeItem)");return new dy(i)}function hk(i){let e=!1;return i&&("show"in i?e=i.show??!0:"enabled"in i&&(e=i.enabled??!0)),e}function lk(i,e){i&&("show"in i?i.show=e:"enabled"in i&&(i.enabled=e))}const uk=["EnvironmentVariables","ScriptsLoader","SceneScript","ScriptLoader"];function ck(i){const e=[],{root:t={}}=i,n=[t];for(;n.length>0;){const s=n.pop();if(!s)throw new Error("!todo");if(s.children){for(let o of s.children)if(o.children&&n.unshift(o),o.sceneObj){const{type:h=void 0}=o.sceneObj;h||(console.warn("sceneObjJson has no type! treeItem.sceneObj: "),console.warn(o.sceneObj)),h&&uk.includes(h)&&e.push(o.sceneObj)}}}return e}async function dk(i,e){const t=ck(i);let n=0;const s=t.length;for(let o of t)if(++n,e){const h=n/s;e(h,n,s)}}class fy extends st{constructor(t,n){super();p(this,"treeItemContexMenuCallback");this._sceneTree=t,this._projectManager=n}get sceneTree(){return this._sceneTree}}class fk extends st{constructor(t){super();p(this,"_jsonLoadingEvent",this.disposeVar(new H));p(this,"_setJsonProcessing",this.disposeVar(wi(async(t,n)=>{this._jsonLoadingEvent.emit({type:"init"}),this._jsonLoadingEvent.emit({type:"loading"}),n&&await t.promise(this._sceneTree.preloadFunc(n)),this._setJson(n),this._jsonLoadingEvent.emit({type:"loaded"})})));this._sceneTree=t,this._setJsonProcessing.errorFunc=n=>{this._jsonLoadingEvent.emit({type:"error",error:n})}}get jsonLoadingEvent(){return this._jsonLoadingEvent}_setJson(t){try{this._sceneTree.setJson(t||{})}catch(n){console.error(`json数据装配时发生错误!error: ${n}`)}}get json(){return this._sceneTree.getJson()}set json(t){this._setJsonProcessing.restart(new tn("JSON重新赋值!"),t)}get jsonStr(){return JSON.stringify(this.json,void 0," ")}set jsonStr(t){this.json=JSON.parse(t)}}function gk(i){return i.name+"_clone"}function qd(i,e,t){if(i instanceof ri)return i.insertNewTreeItem(e,t);{const n={FolderInnerOrAfter:"InnerOrAfter",FolderInnerOrBefore:"InnerOrBefore",FolderInner:"Inner",InnerOrAfter:"InnerOrAfter",InnerOrBefore:"InnerOrBefore",Inner:"Inner",After:"After",Before:"Before"};return i.insertNewTreeItem(n[e],t)}}function pk(i){[i,...i.getDescendants()].forEach(e=>e.destroy())}const vi=class vi extends er{constructor(t,n,s,o){super(s);p(this,"_jsonLoading",this.disposeVar(new fk(this)));p(this,"createSceneObjectFunc",vi.defaultCreateSceneObjectFunc);p(this,"createTreeItemDragDropFunc",vi.defaultCreateTreeItemDragDropFunc);p(this,"preloadFunc",vi.defaultPreload);p(this,"getSceneObjectShowFunc",vi.defaultGetSceneObjectShow);p(this,"setSceneObjectShowFunc",vi.defaultSetSceneObjectShow);p(this,"getSceneTreeItemCloneNameFunc",vi.defaultGetSceneTreeItemCloneNameFunc);p(this,"debug",!1);p(this,"_contextMenu",this.disposeVar(new fy(this,this.projectManager)));p(this,"_showPropUiOnSelecting",this.disposeVar(it(!0)));this._name=t,this._dragStartDataManager=n,this._projectManager=o,this.dispose(this.selectedItems.changedEvent.disposableOn(()=>{var l,d;window.lssn=this.lastSelectedItem,window.lsso=(l=this.lastSelectedItem)==null?void 0:l.sceneObject,this.debug&&console.log(((d=this.lastSelectedItem)==null?void 0:d.sceneObject)??"select null")}));const{sceneObjectsManager:h}=this._projectManager;this.dispose(this.itemsDeleted.disposableOn(l=>{for(let d of l){const f=d,{sceneObject:v}=f;v&&h.deleteSceneObject(v)&&v.destroy()&&al(v,void 0);for(let m of f.getDescendants()){const{sceneObject:y}=m;y&&h.deleteSceneObject(y)&&y.destroy()&&al(y,void 0)}pk(d)}})),this.dispose(this.itemsAdded.disposableOn(l=>{for(let d of l){const f=d;f.sceneObject&&h.addSceneObject(f.sceneObject)&&al(f.sceneObject,f)}}))}get json(){return this._jsonLoading.json}set json(t){this._jsonLoading.json=t}get jsonStr(){return this._jsonLoading.jsonStr}set jsonStr(t){this._jsonLoading.jsonStr=t}get jsonLoadingEvent(){return this._jsonLoading.jsonLoadingEvent}get name(){return this._name}get projectManager(){return this._projectManager}get contextMenu(){return this._contextMenu}get showPropUiOnSelecting(){return this._showPropUiOnSelecting.value}set showPropUiOnSelecting(t){this._showPropUiOnSelecting.value=t}get showPropUiOnSelectingChanged(){return this._showPropUiOnSelecting.changed}get sceneUiTree(){return this.uiTree}getTreeItemFromSceneObjId(t){const n=this.getDescendants();let s;for(let o of n)if(o.sceneObject&&o.sceneObject.id===t){s=o;break}return s}getTreeItemsFromSceneObjType(t){const n=this.getDescendants(),s=[],o=Array.isArray(t)?t:[t];for(let h of n)h.sceneObject&&o.includes(h.sceneObject.typeName)&&s.push(h);return s}getTreeItemsFromSceneObjName(t){var o;const n=this.getDescendants(),s=[];for(let h of n)(o=h.sceneObject)!=null&&o.name.includes(t)&&s.push(h);return s}get dragStartDataManager(){return this._dragStartDataManager}get completeJson(){return{root:{children:[...this.children].filter(t=>t.isExport).map(t=>t.completeJson)}}}getJson(){return{root:{children:[...this.children].filter(t=>t.isExport).map(t=>t.json)}}}setJson(t){var s;t.root=t.root||{};const n=t.root.children??[];this.root.resetChildren(!0);for(let o of n){const h=new ri(this,!0);h.json=o,(s=this.root.children)==null||s.push(h)}}testAddNewTreeItem(t,n){const s=t||this.lastSelectedItem||this.root;return s?qd(s,n):!1}addNewTreeItem(t,n,s,o){const h=t||this.lastSelectedItem||this.root;if(h&&qd(h,n)){const l=new ri(this,s);if(l.sceneObject=o,!qd(h,n,l))throw new Error("currentTreeItem.insertNewTreeItem return false!");return l}}createSceneObjectTreeItem(t,n,s,o){const h=o??"FolderInnerOrAfter";if(!this.testAddNewTreeItem(s,h)){console.warn(`cannot addNewTreeItem! currentTreeItem(${s?s.id:"root"})`);return}const l=St.create(t,n);return l?this.addNewTreeItem(s,o??"FolderInnerOrAfter",!0,l):void 0}createGroupTreeItem(t,n,s,o){const h=o??"FolderInnerOrAfter";if(!this.testAddNewTreeItem(s,h)){console.warn(`cannot addNewTreeItem! currentTreeItem(${s?s.id:"root"})`);return}const l=this.addNewTreeItem(s,o??"FolderInnerOrAfter",!0);if(!l){console.warn("addNewTreeItem error!");return}return l.name=t??"未命名组节点",l}createSceneObjectTreeItemFromClass(t,n,s,o){const h=o??"FolderInnerOrAfter";if(!this.testAddNewTreeItem(s,h))return;const l=St.createFromClass(t,n);return l?this.addNewTreeItem(s,h,!0,l):void 0}createSceneObjectTreeItemFromJson(t,n,s){const o=s??"FolderInnerOrAfter";if(!this.testAddNewTreeItem(n,o))return;const h=St.createFromJson(t);return console.log(h),h?this.addNewTreeItem(n,s??"FolderInnerOrAfter",!0,h):void 0}destroySceneObjectTreeItem(t){if(t===this.root){console.warn("cannot destroy root! please use function destroyAllSceneObjectTreeItems!");return}t.detachFromParent()}destroyAllSceneObjectTreeItems(){if(!this.root.children)return;const t=[...this.root.children];for(let n of t)this.destroySceneObjectTreeItem(n)}};p(vi,"defaultCreateSceneObjectFunc",ak),p(vi,"defaultCreateTreeItemDragDropFunc",ok),p(vi,"defaultPreload",dk),p(vi,"defaultGetSceneObjectShow",hk),p(vi,"defaultSetSceneObjectShow",lk),p(vi,"defaultGetSceneTreeItemCloneNameFunc",gk);let Eh=vi;const $d={saturation:.35,brightness:1.4,gamma:.8,atmosphereScatteringIntensity:5,groundColor:[0,.09411764705882353,.3137254901960784,1]};class mk extends st{constructor(t){super();p(this,"_currentPosition",this.disposeVar(Wt(void 0)));p(this,"_currentRotation",this.disposeVar(Wt(void 0)));p(this,"_currentHeading",this.disposeVar(it(void 0)));p(this,"_isRotating",this.disposeVar(it(!1)));p(this,"_isGround",this.disposeVar(it(!1)));p(this,"_startPosition",[0,0,0]);p(this,"_startRotation",[0,0,0]);p(this,"_processing",this.disposeVar(wi(async(t,n,s,o)=>{const{currentPosition:h,currentRotation:l}=this;if(!h||o<=0||!l){this._currentPosition.value=n,this._currentRotation.value=s;return}const d=this._startPosition;d.splice(0,3,...h);const f=this._startRotation;f.splice(0,3,...l);let v=Date.now();const m=wh(d,n);this._currentHeading.value=m;const w=Zl(d,n)/o,S=[s[0]-f[0],s[1]-f[1],s[2]-f[2]],T=n[2]-d[2];await t.promise(new Promise(N=>{t.disposer.dispose(Hh(async()=>{let j=Date.now()-v;j=j<0?0:j,j=j>o?o:j;const C=j*w,k=zd(d,C,m);if(this.isGround&&k){const M=await this._esviewer.getTerrainHeight([k[0],k[1]]);this._currentPosition.value=[k[0],k[1],M??0]}else k&&(k[2]+=T*(j/o)),this._currentPosition.value=k;if(this.isRotating){const[M,D,L]=S,V=j/o;this._currentRotation.value=[f[0]+M*V,f[1]+D*V,f[2]+L*V]}j===o&&(this._currentPosition.value=n,this.isRotating&&(this._currentRotation.value=s),this.isRotating=!1,this.isGround=!1,N())}))}))})));this._esviewer=t}get currentPosition(){return this._currentPosition.value}get currentPositionChanged(){return this._currentPosition.changed}get currentRotation(){return this._currentRotation.value}get currentRotationChanged(){return this._currentRotation.changed}get currentHeading(){return this._currentHeading.value}get currentHeadingChanged(){return this._currentHeading.changed}get isRotating(){return this._isRotating.value}set isRotating(t){this._isRotating.value=t}get isRotatingChanged(){return this._isRotating.changed}get isGround(){return this._isGround.value}set isGround(t){this._isGround.value=t}get isGroundChanged(){return this._isGround.changed}get processing(){return this._processing}restart(t,n,s){this._processing.restart(void 0,t,n,s)}cancel(){this._processing.cancel()}}const vk=.06,gy=1.5,py=2,my=70,vy=60;function cr(i){return Xt(i)}function Mn(i,e,t){const n=cr(i),s=xn(n,t,e,{units:"meters"}),[o,h]=Si(s);return[o,h,i[2]]}function iu(i,e){return sh(cr(i),cr(e))}function nu(i,e,t,n,s=1e3){const o=Ce([Si(xn(cr(i),s,(e+180)%360,{units:"meters"})),i,Si(xn(cr(i),s,e,{units:"meters"}))]),h=Ce([Si(xn(cr(t),s,(n+180)%360,{units:"meters"})),t,Si(xn(cr(t),s,n,{units:"meters"}))]),l=or(o,h);if(l.features.length>0){const[d,f]=Si(l.features[0]);return[d,f,(i[2]+t[2])/2]}return t}function yy(i,e,t,n){const s=(t-90+360)%360,o=(t+90+360)%360;i.leftPoints.push(Mn(e,s-my,n*gy)),i.headPoints.push(Mn(e,s-vy,n*py)),i.headPoints.push(e),i.headPoints.push(Mn(e,o+vy,n*py)),i.rightPoints.push(Mn(e,o+my,n*gy))}function yk(i,e,t,n){const s=(e-90+360)%360,o=(e+90+360)%360,h=t*vk*Math.min(.3,1-n);return{leftPoint:Mn(i,s,h),rightPoint:Mn(i,o,h),verticalLen:h}}function _k(i,e){if(!i||i.length<2)return;const t=e==="swallowTailArrow",n=i.length,s=n-1,o=Math.max(...is(i,"NONE")),h={leftPoints:[],rightPoints:[],headPoints:[]};let l;for(let w=0;w<n;w++){const S=i[w],T=w==s?i[i.length-2]:i[w+1],N=w==s?iu(T,S):iu(S,T),{leftPoint:j,rightPoint:C,verticalLen:k}=yk(S,N,o,w/n);w===0?(h.leftPoints.push(j),h.rightPoints.push(C),t&&(h.tailPoint=Mn(S,N,k))):w===s?yy(h,S,N,k):l!==void 0?(h.leftPoints.push(nu(h.leftPoints[w-1],l,j,N,o)),h.rightPoints.push(nu(h.rightPoints[w-1],l,C,N,o))):(h.leftPoints.push(j),h.rightPoints.push(C)),l=N}const d=h.leftPoints,f=h.rightPoints,v=d.length>=2?Pa(d):d,m=f.length>=2?Pa(f):f,y=[...v,...h.headPoints,...m.reverse()];return h.tailPoint&&y.push(h.tailPoint),y.push(h.leftPoints[0]),y}function wk(i,e,t,n){const s=Ce([[i[0],i[1]],[e[0],e[1]]]),o=Ce([[t[0],t[1]],[n[0],n[1]]]);return or(s,o).features.length>0}function Ek(i,e,t,n){const s=(e-90+360)%360,o=(e+90+360)%360,h=t*Math.min(.3,1-n);return{leftPoint:Mn(i,s,h),rightPoint:Mn(i,o,h),verticalLen:h}}function Sk(i,e){if(!i||i.length<3)return;const t=e==="swallowTailArrow",n=i.length,s=n-1,o=i.slice(0,2),h=Ql(o),l=is(o,"NONE").pop()??0,d=Math.max(...is(i,"NONE")),f={leftPoints:[],rightPoints:[],headPoints:[]};let v;for(let N=1;N<n;N++){const j=N===1?h.center:i[N],C=N===s?i[n-2]:i[N+1],k=N===s?iu(C,j):iu(j,C);let{leftPoint:M,rightPoint:D,verticalLen:L}=Ek(j,k,l,N/n);if(N===1)f.leftPoints.push(o[0]),f.rightPoints.push(o[1]),t&&(f.tailPoint=Mn(j,k,l));else if(N===s)yy(f,j,k,L);else if(v!==void 0){if(N===2&&wk(f.leftPoints[0],M,f.rightPoints[0],D)){const x=f.leftPoints[0];f.leftPoints[0]=f.rightPoints[0],f.rightPoints[0]=x}const V=N-2;f.leftPoints.push(nu(f.leftPoints[V],v,M,k,d)),f.rightPoints.push(nu(f.rightPoints[V],v,D,k,d))}else f.leftPoints.push(M),f.rightPoints.push(D);v=k}let m=f.leftPoints,y=f.rightPoints;const w=m.length>=2?Pa(m):m,S=y.length>=2?Pa(y):y,T=[...w,...f.headPoints,...S.reverse()];return f.tailPoint&&T.push(f.tailPoint),T.push(m[0]),T}function Wd(i,e,t=!1){return t?Sk(i,e):_k(i,e)}function _y(i){let e=0;function t(n,s){s++,e=Math.max(s,e),n.forEach(o=>{Array.isArray(o)&&t(o,s)})}return t(i,0),e}const kn=class kn extends Ht{constructor(t){super(t);p(this,"editingBindMode","lineString");p(this,"_area",this.dv(it(0)));p(this,"_perimeter",this.dv(it(0)));this.d(Me(this.pointsChanged,()=>{this._updateArea(),this._updatePerimeter()},{immediate:!0}))}updateEditing(){var n;const t=[];this.editingBindMode=="doublePoints"?t.push(dt.DoublePoints):this.editingBindMode=="lineString"?t.push(dt.LineStringAppend,dt.LineStringInsert,dt.Translation):this.editingBindMode=="circular"?(t.push(dt.CircularAppend,dt.CircularInsert,dt.Translation),this.supportEditingModes().includes(dt.HeightModify)&&t.push(dt.HeightModify)):this.editingBindMode=="visibility"?t.push(dt.VisibilityAppend,dt.VisibilityModify):this.editingBindMode=="scatter"&&t.push(dt.ScatterAppend,dt.ScatterModify),(n=this.activeViewer)==null||n.startEditing(this,t,{callSource:"inner"})}get area(){return this._area.value}get areaChanged(){return this._area.changed}get perimeter(){return this._perimeter.value}get perimeterChanged(){return this._perimeter.changed}_updateArea(){this._area.value=this.getArea()??0}_updatePerimeter(){this._perimeter.value=this.getPerimeter()??0}getArea(){if(this.points&&this.points.length>=3)return Bd([...this.points])}getDistance(){if(this.points&&this.points.length>=2){const t=is(this.points,"GEODESIC");return t[t.length-1]}else return}getPerimeter(){if(this.points&&this.points.length>=3){const t=[...this.points,this.points[0]],n=is(t,"GEODESIC");return n[n.length-1]}else return}getIntersect(t){if(this.points&&this.points.length>=3&&t.length>=3){const n=ey(this.points,t);if(!n)return;const s=n[0][0][0];if(Array.isArray(s)){const o=[...n],h=[];return o.forEach(l=>{const d=l[0].map(f=>[...f,0]);h.push(d)}),h}else return[[...n][0].map(l=>[...l,0])]}else return}getUnion(t){if(this.points&&this.points.length>=3&&t.length>=3){const n=iy(this.points,t);if(!n)return;const s=n[0][0][0];if(Array.isArray(s)){const o=[...n],h=[];return o.forEach(l=>{const d=l[0].map(f=>[...f,0]);h.push(d)}),h}else return[[...n][0].map(l=>[...l,0])]}else return}getDifference(t){if(this.points&&this.points.length>=3&&t.length>=3){let n=[...t];const s=t[0],o=t[t.length-1];s[0]===o[0]&&s[1]===o[1]&&s[2]===o[2]||n.push(s);const h=sy([...this.points,this.points[0]],[...n]);if(!h)return{status:"undefined",positions:void 0};const l=[...h];if(_y(l)===3){const d=l.map(y=>y.map(w=>[...w,0]));if(d.length<=1)return{status:"notIncluded",positions:d};const f=d[0],v=d[1];return Ud([...f],[...v])==="oneBig"?{status:"included",positions:d}:{status:"notIncluded",positions:d}}else if(_y(l)===4){const f=[...l.map(m=>m.map(y=>y.map(w=>[...w,0])))],v=[];return f.forEach(m=>{v.push(m[0])}),{status:"notIncluded",positions:v}}else return{status:"undefined",positions:void 0}}else return{status:"undefined",positions:void 0}}getBuffer(t=500,n){if(this.points&&this.points.length>=2){const s=ny(this.points,t,n);return s?[s[0].map(o=>[...o,0])]:void 0}else return}geoPolygonOverlap(t){if(this.points&&this.points.length>=3&&t.length>=3){const n=Ud(this.points,t);return n==="oneBig"?!0:n==="twoBig"?!1:void 0}else return}getESProperties(){const t={...super.getESProperties()};return{...t,defaultMenu:"style",coordinate:[...t.coordinate,new nt([this,"editing"],"编辑",!1),new ue([this,"points"],"位置数组",kn.defaults.points,void 0,!0)],style:[...t.style,new yt("点样式"),new nt([this,"pointed"],"开启",!1),new q([this,"pointSize"],"点大小",1),new xt([this,"pointSizeType"],[["screen","screen"],["world","world"]],"点类型","screen"),new jt([this,"pointColor"],"点颜色",[1,1,1,1]),new jt([this,"pointOutlineColor"],"轮廓颜色",kn.defaults.pointStyle.outlineColor),new q([this,"pointOutlineWidth"],"轮廓宽度",kn.defaults.pointStyle.outlineWidth),new yt("线样式"),new nt([this,"stroked"],"开启线样式",!0),new nt([this,"strokeGround"],"贴地",!1),new q([this,"strokeWidth"],"线宽",1),new xt([this,"strokeWidthType"],[["screen","screen"],["world","world"]],"线类型","screen"),new jt([this,"strokeColor"],"线颜色",[1,1,1,1]),new yt("面样式"),new nt([this,"filled"],"开启",!1),new nt([this,"fillGround"],"贴地",!1),new jt([this,"fillColor"],"填充颜色",[1,1,1,1])],more:[...t.more,new yt("点样式集合"),new Tt([this,"pointMaterial"],"点材质"),new Mt([this,"pointMaterialParams"],"点材质参数",{}),new yt("线样式集合"),new Tt([this,"strokeMaterial"],"线材质"),new Mt([this,"strokeMaterialParams"],"线材质参数",{}),new yt("面样式集合"),new Tt([this,"fillMaterial"],"面材质"),new Mt([this,"fillMaterialParams"],"面材质参数",{})]}}get pointSize(){return this.pointStyle.size}set pointSize(t){this.pointStyle={...this.pointStyle,size:t}}get pointSizeChanged(){return this.pointStyleChanged}get pointSizeType(){return this.pointStyle.sizeType}set pointSizeType(t){this.pointStyle={...this.pointStyle,sizeType:t}}get pointSizeTypeChanged(){return this.pointStyleChanged}get pointColor(){return this.pointStyle.color}set pointColor(t){this.pointStyle={...this.pointStyle,color:[...t]}}get pointColorChanged(){return this.pointStyleChanged}get pointOutlineColor(){return this.pointStyle.outlineColor}set pointOutlineColor(t){this.pointStyle={...this.pointStyle,outlineColor:[...t]}}get pointOutlineColorChanged(){return this.pointStyleChanged}get pointOutlineWidth(){return this.pointStyle.outlineWidth}set pointOutlineWidth(t){this.pointStyle={...this.pointStyle,outlineWidth:t}}get pointOutlineWidthChanged(){return this.pointStyleChanged}get pointMaterial(){return this.pointStyle.material}set pointMaterial(t){this.pointStyle={...this.pointStyle,material:t}}get pointMaterialChanged(){return this.pointStyleChanged}get pointMaterialParams(){return this.pointStyle.materialParams}set pointMaterialParams(t){this.pointStyle={...this.pointStyle,materialParams:t}}get pointMaterialParamsChanged(){return this.pointStyleChanged}get strokeWidth(){return this.strokeStyle.width}set strokeWidth(t){this.strokeStyle={...this.strokeStyle,width:t}}get strokeWidthChanged(){return this.strokeStyleChanged}get strokeWidthType(){return this.strokeStyle.widthType}set strokeWidthType(t){this.strokeStyle={...this.strokeStyle,widthType:t}}get strokeWidthTypeChanged(){return this.strokeStyleChanged}get strokeColor(){return this.strokeStyle.color}set strokeColor(t){this.strokeStyle={...this.strokeStyle,color:[...t]}}get strokeColorChanged(){return this.strokeStyleChanged}get strokeMaterial(){return this.strokeStyle.material}set strokeMaterial(t){this.strokeStyle={...this.strokeStyle,material:t}}get strokeMaterialChanged(){return this.strokeStyleChanged}get strokeMaterialParams(){return this.strokeStyle.materialParams}set strokeMaterialParams(t){this.strokeStyle={...this.strokeStyle,materialParams:t}}get strokeMaterialParamsChanged(){return this.strokeStyleChanged}get strokeGround(){return this.strokeStyle.ground}set strokeGround(t){this.strokeStyle={...this.strokeStyle,ground:t}}get strokeGroundChanged(){return this.strokeStyleChanged}get fillColor(){return this.fillStyle.color}set fillColor(t){this.fillStyle={...this.fillStyle,color:[...t]}}get fillColorChanged(){return this.fillStyleChanged}get fillMaterial(){return this.fillStyle.material}set fillMaterial(t){this.fillStyle={...this.fillStyle,material:t}}get fillMaterialChanged(){return this.fillStyleChanged}get fillMaterialParams(){return this.fillStyle.materialParams}set fillMaterialParams(t){this.fillStyle={...this.fillStyle,materialParams:t}}get fillMaterialParamsChanged(){return this.fillStyleChanged}get fillGround(){return this.fillStyle.ground}set fillGround(t){this.fillStyle={...this.fillStyle,ground:t}}get fillGroundChanged(){return this.fillStyleChanged}};p(kn,"createDefaultProps",()=>({...Ht.createDefaultProps(),pointed:!1,pointStyle:At({size:10,sizeType:"screen",color:[1,1,1,1],material:"",materialParams:{},outlineColor:[1,0,0,1],outlineWidth:2}),stroked:!1,strokeStyle:At({width:1,widthType:"screen",color:[1,1,1,1],material:"",materialParams:{},ground:!1}),filled:!1,fillStyle:At({color:[1,1,1,1],material:"",materialParams:{},ground:!1}),points:vs([])})),p(kn,"type",kn.register("ESGeoVector",kn,{chsName:"地理矢量",tags:["ESObjects","base"],description:"地理矢量"})),p(kn,"supportEditingModes",[...Ht.supportEditingModes,dt.Translation]);let Rt=kn;const mr=class mr extends Ht{constructor(){super(...arguments);p(this,"_statusDis",this.dv(it(!0)));p(this,"_smoothMoveEvent",this.dv(new H));p(this,"_smoothMoveWithRotationEvent",this.dv(new H));p(this,"_smoothMoveOnGroundEvent",this.dv(new H));p(this,"_smoothMoveWithRotationOnGroundEvent",this.dv(new H));p(this,"_automaticLandingEvent",this.dv(new H));p(this,"_smoothMoveKeepPitchEvent",this.dv(new H));p(this,"_smoothMoveRelativelyEvent",this.dv(new H));p(this,"_smoothMoveRelativelyWithRotationEvent",this.dv(new H));p(this,"useCalcFlyToParamInESObjectWithLocation",!0)}updateEditing(){var n;const t=[];this.editingBindMode=="singlePoint"?(t.push(dt.SinglePoint),["ESLocationMeasurement"].includes(this.typeName)||t.push(dt.Rotation),["ESClippingPlane","ESLocationMeasurement","ESLocalRectangle","ESBoxClipping"].includes(this.typeName)||t.push(dt.Scale)):this.editingBindMode=="doublePoints"&&t.push(dt.DoublePoints),(n=this.activeViewer)==null||n.startEditing(this,t,{callSource:"inner"})}get statusDis(){return this._statusDis.value}get statusDisChanged(){return this._statusDis.changed}get smoothMoveEvent(){return this._smoothMoveEvent}smoothMove(t,n){this._smoothMoveEvent.emit(t,n)}get smoothMoveWithRotationEvent(){return this._smoothMoveWithRotationEvent}smoothMoveWithRotation(t,n,s){this._smoothMoveWithRotationEvent.emit(t,n,s)}get smoothMoveOnGroundEvent(){return this._smoothMoveOnGroundEvent}smoothMoveOnGround(t,n,s,o){this._smoothMoveOnGroundEvent.emit(t,n,s,o)}get smoothMoveWithRotationOnGroundEvent(){return this._smoothMoveWithRotationOnGroundEvent}smoothMoveWithRotationOnGround(t,n,s,o,h){this._smoothMoveWithRotationOnGroundEvent.emit(t,n,s,o,h)}get automaticLandingEvent(){return this._automaticLandingEvent}automaticLanding(){const t=this.collision;this.collision=!1,setTimeout(()=>{this._automaticLandingEvent.emit(t)},100)}get smoothMoveKeepPitchEvent(){return this._smoothMoveKeepPitchEvent}smoothMoveKeepPitch(t,n){this._smoothMoveKeepPitchEvent.emit(t,n)}get smoothMoveRelativelyEvent(){return this._smoothMoveRelativelyEvent}smoothMoveRelatively(t,n){this._smoothMoveRelativelyEvent.emit(t,n)}get smoothMoveRelativelyWithRotationEvent(){return this._smoothMoveRelativelyWithRotationEvent}smoothMoveRelativelyWithRotation(t,n,s){this._smoothMoveRelativelyWithRotationEvent.emit(t,n,s)}getESProperties(){const t={...super.getESProperties()},n=[...t.location,new nt([this,"editing"],"是否编辑"),new kt("自动落地",this.automaticLanding.bind(this),[]),new en([this,"position"],"位置数组",[0,0,0]),new ra([this,"rotation"],"姿态数组",[0,0,0]),new Te([this,"scale"],"缩放",[1,1,1]),new q([this,"minVisibleDistance"],"最小可见距离",0),new q([this,"maxVisibleDistance"],"最大可见距离",0)];return["ESHuman","ESGltfModel","ESFountainParticleSystem","ESHumanFountain"].includes(this.typeName)&&n.push(new Te([this,"positionOffset"],"位置偏移",[0,0,0])),{...t,defaultMenu:"basic",location:n,more:[...t.more,new kt("平滑移动",this.smoothMove.bind(this),[[0,0,0],0]),new kt("固定方向平滑移动",this.smoothMoveKeepPitch.bind(this),[[0,0,0],0]),new kt("平滑偏移",this.smoothMoveWithRotation.bind(this),[[0,0,0],[0,0,0],0]),new kt("贴地平滑移动",this.smoothMoveOnGround.bind(this),[0,0,0,""]),new kt("贴地平滑偏移",this.smoothMoveWithRotationOnGround.bind(this),[[0,0,0],0,0,0,""]),new kt("相对平滑移动",this.smoothMoveRelatively.bind(this),[[0,0,0],0]),new kt("相对平滑偏移",this.smoothMoveRelativelyWithRotation.bind(this),[[0,0,0],[0,0,0],0]),new nt([this,"enableVisibleDistance"],"是否应用距离显隐")]}}get pointSize(){return this.pointStyle.size}set pointSize(t){this.pointStyle={...this.pointStyle,size:t}}get pointSizeChanged(){return this.pointStyleChanged}get pointSizeType(){return this.pointStyle.sizeType}set pointSizeType(t){this.pointStyle={...this.pointStyle,sizeType:t}}get pointSizeTypeChanged(){return this.pointStyleChanged}get pointColor(){return this.pointStyle.color}set pointColor(t){this.pointStyle={...this.pointStyle,color:[...t]}}get pointColorChanged(){return this.pointStyleChanged}get pointMaterial(){return this.pointStyle.material}set pointMaterial(t){this.pointStyle={...this.pointStyle,material:t}}get pointMaterialChanged(){return this.pointStyleChanged}get pointMaterialParams(){return this.pointStyle.materialParams}set pointMaterialParams(t){this.pointStyle={...this.pointStyle,materialParams:t}}get pointMaterialParamsChanged(){return this.pointStyleChanged}};p(mr,"createDefaultProps",()=>({...Ht.createDefaultProps(),pointed:!1,pointStyle:At({size:1,sizeType:"screen",color:[1,1,1,1],material:"",materialParams:{},outlineColor:[1,0,0,1],outlineWidth:2}),position:vt([0,0,0]),rotation:vt([0,0,0]),positionOffset:vt([0,0,0]),scale:vt([1,1,1]),minVisibleDistance:it(0),maxVisibleDistance:it(0)})),p(mr,"type",mr.register("ESObjectWithLocation",mr,{chsName:"对象位置",tags:["ESObjects","base"],description:"对象位置"})),p(mr,"supportEditingModes",[...Ht.supportEditingModes,dt.SinglePoint,dt.Place,dt.Translation,dt.Rotation,dt.Scale,dt.DoublePoints,dt.DoublePointsAppend,dt.DoublePointsModify]);let bt=mr;const Na=class Na extends bt{getESProperties(){const e={...super.getESProperties()};return{...e,style:[...e.style,new yt("点样式集合"),new nt([this,"pointed"],"开启点样式",!1),new q([this,"pointSize"],"点大小",1),new xt([this,"pointSizeType"],[["screen","screen"],["world","world"]],"点类型","screen"),new jt([this,"pointColor"],"点颜色",[1,1,1,1]),new yt("线样式集合"),new nt([this,"stroked"],"开启线样式",!1),new nt([this,"strokeGround"],"是否贴地(线)",!1),new q([this,"strokeWidth"],"线宽",1),new xt([this,"strokeWidthType"],[["screen","screen"],["world","world"]],"线类型","screen"),new jt([this,"strokeColor"],"线颜色",[1,1,1,1]),new yt("面样式集合"),new nt([this,"filled"],"开启填充样式",!1),new nt([this,"fillGround"],"是否贴地",!1),new jt([this,"fillColor"],"填充颜色",[1,1,1,1])],more:[...e.more,new yt("点样式"),new Tt([this,"pointMaterial"],"点材质",""),new Mt([this,"pointMaterialParams"],"点材质参数",{}),new yt("线样式"),new Tt([this,"strokeMaterial"],"线材质",""),new Mt([this,"strokeMaterialParams"],"线材质参数",{}),new yt("填充样式"),new Tt([this,"fillMaterial"],"面材质",""),new Mt([this,"fillMaterialParams"],"面材质参数",{})]}}get strokeWidth(){return this.strokeStyle.width}set strokeWidth(e){this.strokeStyle={...this.strokeStyle,width:e}}get strokeWidthChanged(){return this.strokeStyleChanged}get strokeWidthType(){return this.strokeStyle.widthType}set strokeWidthType(e){this.strokeStyle={...this.strokeStyle,widthType:e}}get strokeWidthTypeChanged(){return this.strokeStyleChanged}get strokeColor(){return this.strokeStyle.color}set strokeColor(e){this.strokeStyle={...this.strokeStyle,color:[...e]}}get strokeColorChanged(){return this.strokeStyleChanged}get strokeMaterial(){return this.strokeStyle.material}set strokeMaterial(e){this.strokeStyle={...this.strokeStyle,material:e}}get strokeMaterialChanged(){return this.strokeStyleChanged}get strokeMaterialParams(){return this.strokeStyle.materialParams}set strokeMaterialParams(e){this.strokeStyle={...this.strokeStyle,materialParams:e}}get strokeMaterialParamsChanged(){return this.strokeStyleChanged}get strokeGround(){return this.strokeStyle.ground}set strokeGround(e){this.strokeStyle={...this.strokeStyle,ground:e}}get strokeGroundChanged(){return this.strokeStyleChanged}get fillColor(){return this.fillStyle.color}set fillColor(e){this.fillStyle={...this.fillStyle,color:[...e]}}get fillColorChanged(){return this.fillStyleChanged}get fillMaterial(){return this.fillStyle.material}set fillMaterial(e){this.fillStyle={...this.fillStyle,material:e}}get fillMaterialChanged(){return this.fillStyleChanged}get fillMaterialParams(){return this.fillStyle.materialParams}set fillMaterialParams(e){this.fillStyle={...this.fillStyle,materialParams:e}}get fillMaterialParamsChanged(){return this.fillStyleChanged}get fillGround(){return this.fillStyle.ground}set fillGround(e){this.fillStyle={...this.fillStyle,ground:e}}get fillGroundChanged(){return this.fillStyleChanged}};p(Na,"createDefaultProps",()=>({...bt.createDefaultProps(),pointed:!1,pointStyle:At({size:1,sizeType:"screen",color:[1,1,1,1],material:"",materialParams:{},outlineColor:[1,0,0,1],outlineWidth:1}),stroked:!1,strokeStyle:At({width:1,widthType:"screen",color:[1,1,1,1],material:"",materialParams:{},ground:!1}),filled:!1,fillStyle:At({color:[1,1,1,1],material:"",materialParams:{},ground:!1})})),p(Na,"type",Na.register("ESLocalVector",Na,{chsName:"本地矢量",tags:["ESObjects","base"],description:"本地矢量对象"}));let Ns=Na;const kh=class kh extends Ns{};p(kh,"type",kh.register("ESLocalVector2D",kh,{chsName:"本地矢量2D",tags:["ESObjects","base"],description:"本地矢量2D对象"}));let an=kh;const xk=[["固定朝向",0],["面向屏幕旋转",1],["绕自身Z轴旋转",2]],bk=[["单面不透明",0],["双面不透明",1],["单面遮罩",2],["双面遮罩",3],["单面透明",4],["双面透明",5],["单面未遮挡透明",6],["双面未遮挡透明",7]],Ra=class Ra extends bt{constructor(){super(...arguments);p(this,"_widgetEvent",this.dv(new H))}get widgetEvent(){return this._widgetEvent}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new nt([this,"screenRender"],"屏幕渲染",!0),new nt([this,"sizeByContent"],"尺寸自适应",!0),new ge([this,"size"],"尺寸大小",[100,100]),new ge([this,"anchor"],"偏移比例",[.5,1]),new ge([this,"offset"],"像素偏移",[0,0]),new xt([this,"renderMode"],bk,"渲染模式",0),new xt([this,"rotationType"],xk,"漫游旋转类型",1),new Tt([this,"actorTag"],"绑定对象"),new Tt([this,"socketName"],"插槽名称"),new Te([this,"positionOffset"],"位置偏移"),new Te([this,"rotationOffset"],"相对姿态")],more:[...t.more,new q([this,"zOrder"],"排序",0)]}}};p(Ra,"createDefaultProps",()=>({...bt.createDefaultProps(),screenRender:!0,size:vt([100,100]),anchor:vt([.5,1]),offset:vt([0,0]),sizeByContent:!0,renderMode:0,rotationType:1,zOrder:0,actorTag:"",socketName:"",positionOffset:vt([0,0,0]),rotationOffset:vt([0,0,0])})),p(Ra,"type",Ra.register("ESLabel",Ra,{chsName:"标签",tags:["ESObjects","base"],description:"标签对象"}));let xi=Ra;const _e=class _e extends St{constructor(t){super(t);p(this,"_testEvent",this.dv(new H))}get testEvent(){return this._testEvent}func(t,n=!0){t.includes("completeJson")&&console.log("ESTestObject.completeJson",this.completeJson),t.includes("json")&&console.log("ESTestObject.json",this.json),n&&console.log("ESTestObject func"),this._testEvent.emit(t,n)}func1(t,n){t.includes("completeJson")&&console.log("ESTestObject.completeJson",this.completeJson),t.includes("json")&&console.log("ESTestObject.json",this.json),n&&console.log("ESTestObject func"),this._testEvent.emit(t,n)}getPadding(){return this.padding}getESProperties(){return{defaultMenu:"basic",basic:[new Tt([this,"typeName"],"类型",void 0,!1,!0),new Tt([this,"id"],"id",void 0,!1,!0),new Tt([this,"name"],"名称"),new Tt([this,"ref"],"引用",void 0,!0),new Mt([this,"extras"],"扩展属性",{},void 0,!0),new Tc("JSON",()=>this._jsonStr,t=>t&&(this._jsonStr=t))],general:[new nt([this,"show"],"是否显示",_e.defaults.show),new jt([this,"color"],"颜色",_e.defaults.color),new xt([this,"paramType"],[["screen","screen"],["world","world"]],"参数类型",_e.defaults.paramType),new Lo([this,"text"],"内容",_e.defaults.text)],dataSource:[new Ei([this,"startTime"],"开始时间",_e.defaults.startTime),new Ai([this,"code"],"js代码",_e.defaults.code),new Mc([this,"times"],"时间组",_e.defaults.times),new Tt([this,"url"],"服务地址",_e.defaults.url),new kt("func",this.func.bind(this),[["completeJson","json"]]),new kt("func1",(t,n)=>this.func1(t,n),[["completeJson","json"],!0])],location:[new Te([this,"positionOffset"],"位置偏移",_e.defaults.positionOffset),new en([this,"position"],"位置数组",_e.defaults.position),new ra([this,"rotation"],"姿态数组",_e.defaults.rotation)],coordinate:[new q([this,"height"],"高度(m)",_e.defaults.height),new ue([this,"points"],"位置数组",_e.defaults.points)],style:[new ui([this,"padding"],"内边距",_e.defaults.padding),new ge([this,"offset"],"像素偏移",_e.defaults.offset),new yt("样式"),new rl([this,"dashPattern"],"虚线图案",255),new yt("样式2"),new jt([this,"color"],"颜色",_e.defaults.color),new Mt([this,"strokeStyle"],"线样式参数",_e.defaults.strokeStyle)],more:[]}}};p(_e,"createDefaultProps",()=>({...St.createDefaultProps(),show:!0,url:"http://localhost:8080/earthsdk3/earthsdk3.gltf",height:100,position:vt([116.39,39.9,100]),rotation:vt([0,-90,0]),points:vs([]),color:vt([1,0,0,1]),strokeStyle:At({width:1,widthType:"screen",color:[1,1,1,1],material:"",materialParams:{},ground:!1}),paramType:"screen",text:"默认",code:'console.log("hello world")',dashPattern:255,startTime:Date.now(),times:vt([]),offset:vt([10,0]),positionOffset:vt([0,2,0]),padding:vt([0,2,0,2])})),p(_e,"type",_e.register("ESTestObject",_e,{chsName:"测试对象",tags:["ESObjects","base"],description:'ESTestObject 是 earthsdk3 场景对象的规范示例(测试对象),用于演示对象的标准写法:规范的注册元数据、带 JSDoc 的响应式属性、带 JSDoc 的方法、以及业务事件的声明模式。对象json示例: { "id": "test_xxx", "type": "ESTestObject", "name": "测试对象", "show": true, "position": [116.39, 39.9, 100], "url": "http://localhost:8080/earthsdk3/earthsdk3.gltf" }'}));let Hd=_e;const On=class On extends Ht{constructor(t){super(t);p(this,"_refreshTilesetEvent",this.dv(new H));p(this,"_tilesetReadyEvent",this.dv(new H));p(this,"_supportEdit",this.dv(it(!0)));p(this,"_highlightFeatureEvent",this.dv(new H));p(this,"_highlightFeatureAndFlyToEvent",this.dv(new H));p(this,"_strokeFeatureEvent",this.disposeVar(new H));p(this,"_getFeatureTableEvent",this.dv(new H));p(this,"_featureTableResultEvent",this.dv(new H));p(this,"_getMaterialNameListEvent",this.disposeVar(new H));p(this,"_setFeatureStyleEvent",this.dv(new H));p(this,"_setFeatureColorEvent",this.dv(new H));p(this,"_setFeatureVisableEvent",this.dv(new H));p(this,"_resetFeatureStyleEvent",this.dv(new H));p(this,"setMaterialInfoEvent",this.ad(new H));p(this,"_setMaterialEvent",this.disposeVar(new H));p(this,"_clippingPlanesId",this.dv(it("")));p(this,"_clippingPlaneIds",this.dv(it([])));p(this,"_flattenedPlaneId",this.dv(it("")));p(this,"_flattenedPlaneEnabled",this.dv(it(!1)));p(this,"_clippingPlaneId",this.dv(it("")));p(this,"_excavateId",this.dv(vt([])))}updateEditing(){var t;(t=this.activeViewer)==null||t.startEditing(this,[dt.Translation,dt.Rotation],{callSource:"inner"})}get refreshTilesetEvent(){return this._refreshTilesetEvent}refreshTileset(){this._refreshTilesetEvent.emit()}get tilesetReady(){return this._tilesetReadyEvent}get supportEdit(){return this._supportEdit.value}set supportEdit(t){this._supportEdit.value=t}get supportEditChanged(){return this._supportEdit.changed}get highlightFeatureEvent(){return this._highlightFeatureEvent}highlightFeature(t,n){this._highlightFeatureEvent.emit(t,n)}get highlightFeatureAndFlyToEvent(){return this._highlightFeatureAndFlyToEvent}highlightFeatureAndFlyTo(t,n,s,o){this._highlightFeatureAndFlyToEvent.emit(t,n,s,o)}get strokeFeatureEvent(){return this._strokeFeatureEvent}strokeFeature(t,n=[1,0,0,1]){this._strokeFeatureEvent.emit(t,n)}get getFeatureTableEvent(){return this._getFeatureTableEvent}getFeatureTable(){return Promise.race([new Promise(t=>{const n=this.d(this._featureTableResultEvent.donce(t));this._getFeatureTableEvent.emit(),setTimeout(()=>{n(),t(void 0)},2e3)})])}get getMaterialNameListEvent(){return this._getMaterialNameListEvent}getMaterialNameList(){return new Promise(t=>{const n=new st;n.d(this.getMaterialNameListEvent.don(s=>{s!=="start"&&(n.destroy(),t(s))})),this.getMaterialNameListEvent.emit("start"),setTimeout(()=>{n.isDestroyed()||(n.destroy(),t(void 0))},2e3)})}get setFeatureStyleEvent(){return this._setFeatureStyleEvent}setFeatureStyle(t,n=!1){this._setFeatureStyleEvent.emit(t,n)}get setFeatureColorEvent(){return this._setFeatureColorEvent}setFeatureColor(t,n,s=!1){this._setFeatureColorEvent.emit(t,typeof n=="string"?JSON.parse(n):n,s)}get setFeatureVisableEvent(){return this._setFeatureVisableEvent}setFeatureVisable(t,n,s=!1){this._setFeatureVisableEvent.emit(t,typeof n=="string"?JSON.parse(n):n,s)}get resetFeatureStyleEvent(){return this._resetFeatureStyleEvent}resetFeatureStyle(t){this._resetFeatureStyleEvent.emit(t)}get setMaterialEvent(){return this._setMaterialEvent}setMaterial(t){return new Promise(n=>{const s=new st;s.ad(this.setMaterialInfoEvent.donce(o=>{s.destroy(),n(o)})),this._setMaterialEvent.emit(t)})}get clippingPlanesId(){return this._clippingPlanesId.value}set clippingPlanesId(t){this._clippingPlanesId.value=t}get clippingPlanesIdChanged(){return this._clippingPlanesId.changed}get clippingPlaneIds(){return this._clippingPlaneIds.value}set clippingPlaneIds(t){this._clippingPlaneIds.value=t}get clippingPlaneIdsChanged(){return this._clippingPlaneIds.changed}get flattenedPlaneId(){return this._flattenedPlaneId.value}set flattenedPlaneId(t){this._flattenedPlaneId.value=t}get flattenedPlaneIdChanged(){return this._flattenedPlaneId.changed}get flattenedPlaneEnabled(){return this._flattenedPlaneEnabled.value}set flattenedPlaneEnabled(t){this._flattenedPlaneEnabled.value=t}get flattenedPlaneEnabledChanged(){return this._flattenedPlaneEnabled.changed}get clippingPlaneId(){return this._clippingPlaneId.value}set clippingPlaneId(t){this._clippingPlaneId.value=t}get clippingPlaneIdChanged(){return this._clippingPlaneId.changed}get excavateId(){return this._excavateId.value}set excavateId(t){this._excavateId.value=t}get excavateIdChanged(){return this._excavateId.changed}setLight122(){this.czmEnvironmentMapManager={...$d}}getESProperties(){const t={...super.getESProperties()};return{...t,defaultMenu:"dataSource",basic:[...t.basic,new ke([this,"maximumScreenSpaceError"],1,[0,256],"精度",16),new xt([this,"materialMode"],[["常规","normal"],["科技感","technology"]],"材质模式","normal",!0),new xt([this,"colorBlendMode"],[["默认","HIGHLIGHT"],["替换","REPLACE"],["混合","MIX"]],"颜色模式","HIGHLIGHT"),new Mt([this,"materialOverrideMap"],"材质替换",On.defaults.materialOverrideMap)],dataSource:[...t.dataSource,new Mt([this,"url"],"服务地址",On.defaults.url,void 0,!0)],coordinate:[...t.coordinate,new nt([this,"editing"],"编辑",!1,!0),new Te([this,"offset"],"偏移",[0,0,0],!0),new ra([this,"rotation"],"旋转",[0,0,0])],more:[...t.more,new Mt([this,"materialParams"],"materialParams",On.defaults.materialParams),new kt("高亮要素",this.highlightFeature.bind(this),["id_value","rgba(255,0,0,1)"],"highlightFeature"),new kt("高亮并且定位到要素",this.highlightFeatureAndFlyTo.bind(this),["id_value",[1116.39,39.9,100,1e3],"rgba(255,0,0,1)",1],"highlightFeatureAndFlyTo"),new kt("要素着色控制",this.setFeatureColor.bind(this),["height",[{minValue:1e5,color:[1,0,0,1]},{maxValue:5e5,color:[1,1,0,1]}]],"setFeatureColor"),new kt("要素可见性控制",this.setFeatureVisable.bind(this),["height",[{minValue:1e5,visable:!0},{maxValue:5e5,visable:!1}]],"setFeatureVisable"),new kt("重置样式",()=>this.resetFeatureStyle(),[],"resetFeatureStyle"),new yt("ue"),new kt("刷新 tileset",()=>this.refreshTileset(),[],"refreshTileset"),new Tt([this,"actorTag"]),new nt([this,"highlight"],"是否高亮"),new jt([this,"highlightColor"]),new q([this,"highlightID"]),new yt("czm"),new ge([this,"czmImageBasedLightingFactor"],"反射强度"),new q([this,"czmAtmosphereScatteringIntensity"],"大气散射强度"),new Mt([this,"czmEnvironmentMapManager"],"动态环境贴图管理器"),new q([this,"czmMaximumMemoryUsage"],"最大内存"),new yt("常用"),new xt([this,"czmClassificationType"],[["NONE","NONE"],["TERRAIN","TERRAIN"],["CESIUM_3D_TILE","CESIUM_3D_TILE"],["BOTH","BOTH"]],"czmClassificationType","NONE",!0),new Mt([this,"czmStyleJson"],"czmStyle"),new nt([this,"czmBackFaceCulling"]),new nt([this,"czmSkipLevelOfDetail"]),new nt([this,"czmDebugWireframe"]),new q([this,"cacheBytes"],"最大缓存",536870912),new yt("调试信息"),new nt([this,"czmDebugShowBoundingVolume"]),new nt([this,"czmDebugShowContentBoundingVolume"]),new yt("裁剪"),new nt([this,"clippingPlaneEnabled"]),new nt([this,"unionClippingRegions"]),new jt([this,"clippingPlaneEdgeColor"]),new q([this,"clippingPlaneEdgeWidth"])]}}};p(On,"createDefaultProps",()=>({...Ht.createDefaultProps(),url:"",actorTag:"",materialMode:"normal",highlight:!1,maximumScreenSpaceError:16,highlightID:0,highlightColor:vt([1,0,0,1]),offset:Wt([0,0,0]),rotation:vt([0,0,0]),czmImageBasedLightingFactor:vt([1,1]),czmEnvironmentMapManager:se(void 0),czmLuminanceAtZenith:2,czmAtmosphereScatteringIntensity:2,czmMaximumMemoryUsage:512,czmClassificationType:"NONE",czmStyleJson:At({}),czmBackFaceCulling:!0,czmDebugShowBoundingVolume:!1,czmDebugShowContentBoundingVolume:!1,czmSkipLevelOfDetail:!1,cacheBytes:536870912,colorBlendMode:"HIGHLIGHT",clippingPlaneEnabled:!0,unionClippingRegions:!0,clippingPlaneEdgeColor:vt([1,1,1,1]),clippingPlaneEdgeWidth:2,materialParams:{baseColor:[0,.5,1]},allowPicking:!0,materialOverrideMap:se({}),featureIdLabel:0,splitDirection:"NONE",czmDebugWireframe:!1})),p(On,"type",On.register("ES3DTileset",On,{chsName:"3DTileset",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:`ES3DTileset 是 EarthSDK3 中用于管理和加载 3D Tiles 数据的核心可视化对象。
|
|
51
51
|
对象json示例:
|
|
52
52
|
{
|
|
53
53
|
"id": "3dtileset_xxx",
|
|
@@ -241,7 +241,7 @@ ${wy}
|
|
|
241
241
|
\`\`\`
|
|
242
242
|
${qi.defaultInnerHTML}
|
|
243
243
|
\`\`\`
|
|
244
|
-
`);let lu=qi;const yr=class yr extends bt{constructor(t){super(t);p(this,"_maxTime",this.dv(it(23)))}get maxTime(){return this._maxTime.value}get maxTimeChanged(){return this._maxTime.changed}getESProperties(){const t={...super.getESProperties()};return{...t,more:[...t.more,new Mt([this,"url"]),new q([this,"maxTime"],"maxTime",23,!0,!0),new q([this,"currentTime"]),new q([this,"minPropValue"]),new q([this,"maxPropValue"]),new ue([this,"colorStops"],"colorStops",yr.defaults.colorStops,void 0,!0)]}}};p(yr,"createDefaultProps",()=>({...bt.createDefaultProps(),url:"http://114.242.26.126:6003/ESDataMesh/water-assets2/",currentTime:0,minPropValue:0,maxPropValue:1,colorStops:
|
|
244
|
+
`);let lu=qi;const yr=class yr extends bt{constructor(t){super(t);p(this,"_maxTime",this.dv(it(23)))}get maxTime(){return this._maxTime.value}get maxTimeChanged(){return this._maxTime.changed}getESProperties(){const t={...super.getESProperties()};return{...t,more:[...t.more,new Mt([this,"url"]),new q([this,"maxTime"],"maxTime",23,!0,!0),new q([this,"currentTime"]),new q([this,"minPropValue"]),new q([this,"maxPropValue"]),new ue([this,"colorStops"],"colorStops",yr.defaults.colorStops,void 0,!0)]}}};p(yr,"createDefaultProps",()=>({...bt.createDefaultProps(),url:"http://114.242.26.126:6003/ESDataMesh/water-assets2/",currentTime:0,minPropValue:0,maxPropValue:1,colorStops:se([{ratio:0,rgba:[0,0,1,1]},{ratio:.2,rgba:[0,1,0,1]},{ratio:.8,rgba:[1,1,0,1]},{ratio:1,rgba:[1,0,0,1]}])})),p(yr,"type",yr.register("ESDataMesh",yr,{chsName:"数值面着色",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:`ESDataMesh 是用于对数值数据进行面着色展示的可视化对象。
|
|
245
245
|
对象json示例:
|
|
246
246
|
{
|
|
247
247
|
"id": "datamesh_xxx",
|
|
@@ -293,7 +293,7 @@ ${wy}
|
|
|
293
293
|
space: number
|
|
294
294
|
}
|
|
295
295
|
\`\`\`
|
|
296
|
-
`,_r=class _r extends Ht{constructor(e){super(e)}getESProperties(){const e={...super.getESProperties()};return{...e,more:[...e.more,new Mt([this,"url"],"路径",!0),new ue([this,"treeTypes"],"treeTypes",[],void 0,!0),new Mt([this,"xiaoBanWidget"],"xiaoBanWidget",_r.defaults.xiaoBanWidget,Tk,!0),new Tt([this,"youShiSZ"]),new Tt([this,"diLei"]),new Tt([this,"senLinLB"]),new Tt([this,"labelMaterial"]),new q([this,"heightOffset"])]}}};p(_r,"createDefaultProps",()=>({...Ht.createDefaultProps(),url:"",treeTypes:
|
|
296
|
+
`,_r=class _r extends Ht{constructor(e){super(e)}getESProperties(){const e={...super.getESProperties()};return{...e,more:[...e.more,new Mt([this,"url"],"路径",!0),new ue([this,"treeTypes"],"treeTypes",[],void 0,!0),new Mt([this,"xiaoBanWidget"],"xiaoBanWidget",_r.defaults.xiaoBanWidget,Tk,!0),new Tt([this,"youShiSZ"]),new Tt([this,"diLei"]),new Tt([this,"senLinLB"]),new Tt([this,"labelMaterial"]),new q([this,"heightOffset"])]}}};p(_r,"createDefaultProps",()=>({...Ht.createDefaultProps(),url:"",treeTypes:se([]),xiaoBanWidget:se({class:"WidgetBlueprint'/ESFoliage/ESDefaultXiaoBan.ESDefaultXiaoBan",pivot:[.5,1],space:1}),youShiSZ:"StringTable'/ESFoliage/You_Shi_SZ.You_Shi_SZ'",diLei:"StringTable'/ESFoliage/Di_Lei.Di_Lei'",senLinLB:"StringTable'/ESFoliage/Sen_Lin_LB.Sen_Lin_LB'",labelMaterial:"Material'/ESFoliage/ES3DWidgetMaterial.ES3DWidgetMaterial'",heightOffset:40})),p(_r,"type",_r.register("ESForestTileset",_r,{chsName:"森林切片图层",tags:["ESObjects","_ES_Impl_UE"],description:`ESForestTileset 是用于管理和渲染森林切片图层的对象。
|
|
297
297
|
对象json示例:
|
|
298
298
|
{
|
|
299
299
|
"id": "foresttileset_xxx",
|
|
@@ -402,7 +402,7 @@ ${rf}
|
|
|
402
402
|
"name": "矩形",
|
|
403
403
|
"points": [[116.39, 39.9, 0], [116.40, 39.91, 0]]
|
|
404
404
|
}
|
|
405
|
-
`})),p(Sr,"supportEditingModes",[...Rt.supportEditingModes,dt.DoublePoints,dt.DoublePointsAppend,dt.DoublePointsModify]);let uf=Sr;const cf={translationX:0,translationY:0,translationZ:0,rotationHeading:0,rotationPitch:0,rotationRoll:0,scaleX:1,scaleY:1,scaleZ:1},Gs=class Gs extends bt{constructor(t){super(t);p(this,"_nodeTransformations",this.dv(it(void 0)));p(this,"_czmModelReadyEvent",this.dv(new H));p(this,"_setNodePositionEvent",this.dv(new H));p(this,"_setNodeRotationEvent",this.dv(new H));p(this,"_setNodeScaleEvent",this.dv(new H));p(this,"_printDebugInfoEvent",this.dv(new H));p(this,"setMaterialInfoEvent",this.ad(new H));p(this,"_setMaterialEvent",this.disposeVar(new H))}get nodeTransformations(){return this._nodeTransformations.value}set nodeTransformations(t){this._nodeTransformations.value=t}get nodeTransformationsChanged(){return this._nodeTransformations.changed}get czmModelReadyEvent(){return this._czmModelReadyEvent}deleteNodeTransformation(t){if(!this.nodeTransformations||!this.nodeTransformations[t])return;const n={...this.nodeTransformations};delete n[t],this.nodeTransformations=n}get setNodePositionEvent(){return this._setNodePositionEvent}setNodePosition(t,n){this._setNodePositionEvent.emit(t,n),this._nodeTransformations.value||(this._nodeTransformations.value={});const s=this._nodeTransformations.value[t]??{...cf};if(n.some(o=>!Number.isFinite(o))){console.error(`setNodePosition error: ${t} ${n}`);return}this._nodeTransformations.value={...this.nodeTransformations,[t]:{...s,translationX:n[0],translationY:n[1],translationZ:n[2]}}}get setNodeRotationEvent(){return this._setNodeRotationEvent}setNodeRotation(t,n){this._setNodeRotationEvent.emit(t,n),this._nodeTransformations.value||(this._nodeTransformations.value={});const s=this._nodeTransformations.value[t]??{...cf};if(n.some(o=>!Number.isFinite(o))){console.error(`setNodeRotation error: ${t} ${n}`);return}this._nodeTransformations.value={...this.nodeTransformations,[t]:{...s,rotationHeading:n[0],rotationPitch:n[1],rotationRoll:n[2]}}}get setNodeScaleEvent(){return this._setNodeScaleEvent}setNodeScale(t,n){this._setNodeScaleEvent.emit(t,n),this._nodeTransformations.value||(this._nodeTransformations.value={});const s=this._nodeTransformations.value[t]??{...cf};if(n.some(o=>!Number.isFinite(o)||o<0)){console.error(`setNodeScale error: !Number.isFinite(e) || e < 0 ${t} ${n}`);return}this._nodeTransformations.value={...this.nodeTransformations,[t]:{...s,scaleX:n[0],scaleY:n[1],scaleZ:n[2]}}}getNodePosition(t){if(!this.nodeTransformations)return;const n=this.nodeTransformations[t];if(n)return[n.translationX,n.translationY,n.translationZ]}getNodeRotation(t){if(!this.nodeTransformations)return;const n=this.nodeTransformations[t];if(n)return[n.rotationHeading,n.rotationPitch,n.rotationRoll]}getNodeScale(t){if(!this.nodeTransformations)return;const n=this.nodeTransformations[t];if(n)return[n.scaleX,n.scaleY,n.scaleZ]}get printDebugInfoEvent(){return this._printDebugInfoEvent}printDebugInfo(){this._printDebugInfoEvent.emit()}get setMaterialEvent(){return this._setMaterialEvent}setMaterial(t){return new Promise(n=>{const s=new st;s.ad(this.setMaterialInfoEvent.donce(o=>{s.destroy(),n(o)})),this._setMaterialEvent.emit(t)})}setLight122(){this.czmEnvironmentMapManager={...$d}}getESProperties(){const t={...super.getESProperties()};return{...t,defaultMenu:"dataSource",dataSource:[...t.dataSource,new Mt([this,"url"],"模型路径",Gs.defaults.url,void 0,!0),new ue([this,"instances"],"实例化矩阵",Gs.defaults.instances,void 0,!0)],more:[...t.more,new q([this,"czmAnimationsIndex"],"动画索引",void 0,!0),new ge([this,"czmImageBasedLightingFactor"]),new q([this,"czmAtmosphereScatteringIntensity"]),new Mt([this,"czmEnvironmentMapManager"]),new kt("控制台输出模型信息",()=>this.printDebugInfo(),[],"printDebugInfo"),new q([this,"czmMaximumScale"],"最大缩放比例",void 0,!0),new q([this,"czmNativeScale"],"统一缩放值"),new q([this,"czmMinimumPixelSize"],"最小像素尺寸"),new jt([this,"czmColor"],"颜色")]}}};p(Gs,"createDefaultProps",()=>({...bt.createDefaultProps(),url:St.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/building.glb"),czmAnimationsIndex:void 0,czmMaximumScale:void 0,czmMinimumPixelSize:0,czmNativeScale:1,czmColor:vt([1,1,1,1]),allowPicking:!0,instances:Wt([]),czmImageBasedLightingFactor:vt([1,1]),czmAtmosphereScatteringIntensity:2,czmEnvironmentMapManager:
|
|
405
|
+
`})),p(Sr,"supportEditingModes",[...Rt.supportEditingModes,dt.DoublePoints,dt.DoublePointsAppend,dt.DoublePointsModify]);let uf=Sr;const cf={translationX:0,translationY:0,translationZ:0,rotationHeading:0,rotationPitch:0,rotationRoll:0,scaleX:1,scaleY:1,scaleZ:1},Gs=class Gs extends bt{constructor(t){super(t);p(this,"_nodeTransformations",this.dv(it(void 0)));p(this,"_czmModelReadyEvent",this.dv(new H));p(this,"_setNodePositionEvent",this.dv(new H));p(this,"_setNodeRotationEvent",this.dv(new H));p(this,"_setNodeScaleEvent",this.dv(new H));p(this,"_printDebugInfoEvent",this.dv(new H));p(this,"setMaterialInfoEvent",this.ad(new H));p(this,"_setMaterialEvent",this.disposeVar(new H))}get nodeTransformations(){return this._nodeTransformations.value}set nodeTransformations(t){this._nodeTransformations.value=t}get nodeTransformationsChanged(){return this._nodeTransformations.changed}get czmModelReadyEvent(){return this._czmModelReadyEvent}deleteNodeTransformation(t){if(!this.nodeTransformations||!this.nodeTransformations[t])return;const n={...this.nodeTransformations};delete n[t],this.nodeTransformations=n}get setNodePositionEvent(){return this._setNodePositionEvent}setNodePosition(t,n){this._setNodePositionEvent.emit(t,n),this._nodeTransformations.value||(this._nodeTransformations.value={});const s=this._nodeTransformations.value[t]??{...cf};if(n.some(o=>!Number.isFinite(o))){console.error(`setNodePosition error: ${t} ${n}`);return}this._nodeTransformations.value={...this.nodeTransformations,[t]:{...s,translationX:n[0],translationY:n[1],translationZ:n[2]}}}get setNodeRotationEvent(){return this._setNodeRotationEvent}setNodeRotation(t,n){this._setNodeRotationEvent.emit(t,n),this._nodeTransformations.value||(this._nodeTransformations.value={});const s=this._nodeTransformations.value[t]??{...cf};if(n.some(o=>!Number.isFinite(o))){console.error(`setNodeRotation error: ${t} ${n}`);return}this._nodeTransformations.value={...this.nodeTransformations,[t]:{...s,rotationHeading:n[0],rotationPitch:n[1],rotationRoll:n[2]}}}get setNodeScaleEvent(){return this._setNodeScaleEvent}setNodeScale(t,n){this._setNodeScaleEvent.emit(t,n),this._nodeTransformations.value||(this._nodeTransformations.value={});const s=this._nodeTransformations.value[t]??{...cf};if(n.some(o=>!Number.isFinite(o)||o<0)){console.error(`setNodeScale error: !Number.isFinite(e) || e < 0 ${t} ${n}`);return}this._nodeTransformations.value={...this.nodeTransformations,[t]:{...s,scaleX:n[0],scaleY:n[1],scaleZ:n[2]}}}getNodePosition(t){if(!this.nodeTransformations)return;const n=this.nodeTransformations[t];if(n)return[n.translationX,n.translationY,n.translationZ]}getNodeRotation(t){if(!this.nodeTransformations)return;const n=this.nodeTransformations[t];if(n)return[n.rotationHeading,n.rotationPitch,n.rotationRoll]}getNodeScale(t){if(!this.nodeTransformations)return;const n=this.nodeTransformations[t];if(n)return[n.scaleX,n.scaleY,n.scaleZ]}get printDebugInfoEvent(){return this._printDebugInfoEvent}printDebugInfo(){this._printDebugInfoEvent.emit()}get setMaterialEvent(){return this._setMaterialEvent}setMaterial(t){return new Promise(n=>{const s=new st;s.ad(this.setMaterialInfoEvent.donce(o=>{s.destroy(),n(o)})),this._setMaterialEvent.emit(t)})}setLight122(){this.czmEnvironmentMapManager={...$d}}getESProperties(){const t={...super.getESProperties()};return{...t,defaultMenu:"dataSource",dataSource:[...t.dataSource,new Mt([this,"url"],"模型路径",Gs.defaults.url,void 0,!0),new ue([this,"instances"],"实例化矩阵",Gs.defaults.instances,void 0,!0)],more:[...t.more,new q([this,"czmAnimationsIndex"],"动画索引",void 0,!0),new ge([this,"czmImageBasedLightingFactor"]),new q([this,"czmAtmosphereScatteringIntensity"]),new Mt([this,"czmEnvironmentMapManager"]),new kt("控制台输出模型信息",()=>this.printDebugInfo(),[],"printDebugInfo"),new q([this,"czmMaximumScale"],"最大缩放比例",void 0,!0),new q([this,"czmNativeScale"],"统一缩放值"),new q([this,"czmMinimumPixelSize"],"最小像素尺寸"),new jt([this,"czmColor"],"颜色")]}}};p(Gs,"createDefaultProps",()=>({...bt.createDefaultProps(),url:St.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/building.glb"),czmAnimationsIndex:void 0,czmMaximumScale:void 0,czmMinimumPixelSize:0,czmNativeScale:1,czmColor:vt([1,1,1,1]),allowPicking:!0,instances:Wt([]),czmImageBasedLightingFactor:vt([1,1]),czmAtmosphereScatteringIntensity:2,czmEnvironmentMapManager:se(void 0)})),p(Gs,"type",Gs.register("ESGltfModel",Gs,{chsName:"模型",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:`ESGltfModel 是用于加载和操作 glTF/GLB 模型的对象,支持模型节点变换、材质设置和动画播放。
|
|
406
406
|
对象json示例:
|
|
407
407
|
{
|
|
408
408
|
"id": "gltfmodel_xxx",
|
|
@@ -429,7 +429,7 @@ ${rf}
|
|
|
429
429
|
"position": [116.39, 39.9, 0],
|
|
430
430
|
"url": "inner://CameraBlue.png"
|
|
431
431
|
}
|
|
432
|
-
`}));let cu=xr;const Nn=class Nn extends Ht{constructor(e){super(e),this.ad(mt([this,"czmSplitDirection"],[this,"splitDirection"])),this.ad(mt([this,"czmAlpha"],[this,"opacity"]))}getESProperties(){const e={...super.getESProperties()};return{...e,defaultMenu:"dataSource",basic:[...e.basic,new q([this,"zIndex"],"层级序号",Nn.defaults.zIndex)],dataSource:[...e.dataSource,new Mt([this,"url"],"影像服务地址"),new ui([this,"rectangle"],"矩形范围",Nn.defaults.rectangle,!0),new ke([this,"maximumLevel"],1,[1,24],"最大级别",Nn.defaults.maximumLevel,!0),new Mt([this,"options"],"options",Nn.defaults.options,void 0,!0),new Tt([this,"targetID"],"targetID"),new ke([this,"opacity"],.01,[0,1],"opacity",1)],more:[...e.more,new yt("通用"),new q([this,"height"],"高度"),new Tt([this,"actorTag"]),new Tt([this,"componentTag"]),new q([this,"minimumLevel"]),new yt("图像"),new q([this,"czmAlpha"],"透明度"),new q([this,"czmBrightness"],"亮度"),new q([this,"czmContrast"],"对比度"),new q([this,"czmHue"],"色相"),new q([this,"czmSaturation"],"饱和度"),new q([this,"czmGamma"],"伽马值")]}}};p(Nn,"createDefaultProps",()=>({...Ht.createDefaultProps(),url:"",rectangle:
|
|
432
|
+
`}));let cu=xr;const Nn=class Nn extends Ht{constructor(e){super(e),this.ad(mt([this,"czmSplitDirection"],[this,"splitDirection"])),this.ad(mt([this,"czmAlpha"],[this,"opacity"]))}getESProperties(){const e={...super.getESProperties()};return{...e,defaultMenu:"dataSource",basic:[...e.basic,new q([this,"zIndex"],"层级序号",Nn.defaults.zIndex)],dataSource:[...e.dataSource,new Mt([this,"url"],"影像服务地址"),new ui([this,"rectangle"],"矩形范围",Nn.defaults.rectangle,!0),new ke([this,"maximumLevel"],1,[1,24],"最大级别",Nn.defaults.maximumLevel,!0),new Mt([this,"options"],"options",Nn.defaults.options,void 0,!0),new Tt([this,"targetID"],"targetID"),new ke([this,"opacity"],.01,[0,1],"opacity",1)],more:[...e.more,new yt("通用"),new q([this,"height"],"高度"),new Tt([this,"actorTag"]),new Tt([this,"componentTag"]),new q([this,"minimumLevel"]),new yt("图像"),new q([this,"czmAlpha"],"透明度"),new q([this,"czmBrightness"],"亮度"),new q([this,"czmContrast"],"对比度"),new q([this,"czmHue"],"色相"),new q([this,"czmSaturation"],"饱和度"),new q([this,"czmGamma"],"伽马值")]}}};p(Nn,"createDefaultProps",()=>({...Ht.createDefaultProps(),url:"",rectangle:se([-180,-90,180,90]),options:se(void 0),zIndex:0,actorTag:"",componentTag:"",maximumLevel:22,minimumLevel:0,targetID:"",czmSplitDirection:"NONE",czmAlpha:1,czmBrightness:1,czmContrast:1,czmHue:0,czmSaturation:1,czmGamma:1,opacity:1,splitDirection:"NONE"})),p(Nn,"type",Nn.register("ESImageryLayer",Nn,{chsName:"影像图层",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE","_ES_Impl_Ol"],description:`ESImageryLayer 是用于加载和显示影像图层的对象,支持透明度、亮度等视觉效果调节。
|
|
433
433
|
对象json示例:
|
|
434
434
|
{
|
|
435
435
|
"id": "imagerylayer_xxx",
|
|
@@ -560,7 +560,7 @@ export type ESJTimeIntervalCollectionJsonType = {
|
|
|
560
560
|
"name": "位置测量点",
|
|
561
561
|
"position": [116.39, 39.9, 0]
|
|
562
562
|
}
|
|
563
|
-
`}));let ff=Nh;const Ve=class Ve extends bt{constructor(t){super(t);p(this,"_player",this.dv(new Di));{const n=Ve.defaults;this.d(mt([this._player,"loop"],[this,"playingLoop"],s=>s??n.playingLoop,s=>s??n.playingLoop)),this.d(mt([this._player,"currentTime"],[this,"currentTime"],s=>s??n.currentTime,s=>s??n.currentTime)),this.d(mt([this._player,"duration"],[this,"duration"],s=>s??n.duration,s=>s??n.duration)),this.d(mt([this._player,"playing"],[this,"playing"],s=>s??n.playing,s=>s??n.playing)),this.d(mt([this._player,"speed"],[this,"playingSpeed"],s=>s??n.playingSpeed,s=>s??n.playingSpeed))}}get player(){return this._player}get ratio(){return this._player.ratio}set ratio(t){this._player.ratio=t}get ratioChanged(){return this._player.ratioChanged}getESProperties(){const t={...super.getESProperties()};return{...t,more:[...t.more,new yt("通用"),new kt("飞入",n=>this.flyTo(n),[1e3],"flyTo"),new Ai([this,"updateCallback"],"更新回调函数",void 0,void 0,!0),new q([this,"emissionRate"],"发射率",5,!0),new nt([this,"loop"],"是否循环",!0,!0),new q([this,"particleScale"],"等级",1,!0),new q([this,"startScale"],"初始等级",void 0,!0),new q([this,"endScale"],"结束等级",Ve.defaults.endScale,!0),new jt([this,"color"],"颜色",void 0,!0),new jt([this,"startColor"],"初始颜色",void 0,!0),new jt([this,"endColor"],"结束颜色",void 0,!0),new nt([this,"sizeInMeters"],"尺寸单位为米",void 0,!0),new q([this,"speed"],"速度",1,!0),new q([this,"minimumSpeed"],"最小速度",void 0,!0),new q([this,"maximumSpeed"],"最大速度",void 0,!0),new q([this,"lifetime"],"生命周期",Number.MAX_VALUE,!0),new q([this,"particleLife"],"粒子生命周期",Ve.defaults.particleLife,!0),new q([this,"minimumParticleLife"],"最小粒子生命周期",void 0,!0),new q([this,"maximumParticleLife"],"最大粒子生命周期",void 0,!0),new q([this,"mass"],"块数量",1,!0),new q([this,"minimumMass"],"最小块数量",void 0,!0),new q([this,"maximumMass"],"最大块数量",void 0,!0),new ge([this,"imageSize"],"图片尺寸",Ve.defaults.imageSize,!0),new ge([this,"minimumImageSize"],"最小图片尺寸",void 0,!0),new ge([this,"maximumImageSize"],"最大图片尺寸",void 0,!0),new Tt([this,"image"],"图片",Ve.defaults.image,!0),new Te([this,"translation"],"偏移",[0,0,0],!0),new ue([this,"bursts"],"bursts",[]),new Mt([this,"emitter"],"emitter",Ve.defaults.emitter),new yt("播放器"),new q([this,"ratio"],"播放比率",0,!0),new aa([this,"playing"],[this,"ratio"],[this,"playingLoop"],"播放器"),new nt([this,"playingLoop"],"是否循环",Ve.defaults.playingLoop,!0),new q([this,"currentTime"],"当前时间",Ve.defaults.currentTime,!0),new q([this,"duration"],"过渡时间",Ve.defaults.duration,!0),new nt([this,"playing"],"是否播放",Ve.defaults.playing,!0),new q([this,"playingSpeed"],"播放速度",Ve.defaults.playingSpeed,!0)]}}};p(Ve,"createDefaultProps",()=>({...bt.createDefaultProps(),emitter:
|
|
563
|
+
`}));let ff=Nh;const Ve=class Ve extends bt{constructor(t){super(t);p(this,"_player",this.dv(new Di));{const n=Ve.defaults;this.d(mt([this._player,"loop"],[this,"playingLoop"],s=>s??n.playingLoop,s=>s??n.playingLoop)),this.d(mt([this._player,"currentTime"],[this,"currentTime"],s=>s??n.currentTime,s=>s??n.currentTime)),this.d(mt([this._player,"duration"],[this,"duration"],s=>s??n.duration,s=>s??n.duration)),this.d(mt([this._player,"playing"],[this,"playing"],s=>s??n.playing,s=>s??n.playing)),this.d(mt([this._player,"speed"],[this,"playingSpeed"],s=>s??n.playingSpeed,s=>s??n.playingSpeed))}}get player(){return this._player}get ratio(){return this._player.ratio}set ratio(t){this._player.ratio=t}get ratioChanged(){return this._player.ratioChanged}getESProperties(){const t={...super.getESProperties()};return{...t,more:[...t.more,new yt("通用"),new kt("飞入",n=>this.flyTo(n),[1e3],"flyTo"),new Ai([this,"updateCallback"],"更新回调函数",void 0,void 0,!0),new q([this,"emissionRate"],"发射率",5,!0),new nt([this,"loop"],"是否循环",!0,!0),new q([this,"particleScale"],"等级",1,!0),new q([this,"startScale"],"初始等级",void 0,!0),new q([this,"endScale"],"结束等级",Ve.defaults.endScale,!0),new jt([this,"color"],"颜色",void 0,!0),new jt([this,"startColor"],"初始颜色",void 0,!0),new jt([this,"endColor"],"结束颜色",void 0,!0),new nt([this,"sizeInMeters"],"尺寸单位为米",void 0,!0),new q([this,"speed"],"速度",1,!0),new q([this,"minimumSpeed"],"最小速度",void 0,!0),new q([this,"maximumSpeed"],"最大速度",void 0,!0),new q([this,"lifetime"],"生命周期",Number.MAX_VALUE,!0),new q([this,"particleLife"],"粒子生命周期",Ve.defaults.particleLife,!0),new q([this,"minimumParticleLife"],"最小粒子生命周期",void 0,!0),new q([this,"maximumParticleLife"],"最大粒子生命周期",void 0,!0),new q([this,"mass"],"块数量",1,!0),new q([this,"minimumMass"],"最小块数量",void 0,!0),new q([this,"maximumMass"],"最大块数量",void 0,!0),new ge([this,"imageSize"],"图片尺寸",Ve.defaults.imageSize,!0),new ge([this,"minimumImageSize"],"最小图片尺寸",void 0,!0),new ge([this,"maximumImageSize"],"最大图片尺寸",void 0,!0),new Tt([this,"image"],"图片",Ve.defaults.image,!0),new Te([this,"translation"],"偏移",[0,0,0],!0),new ue([this,"bursts"],"bursts",[]),new Mt([this,"emitter"],"emitter",Ve.defaults.emitter),new yt("播放器"),new q([this,"ratio"],"播放比率",0,!0),new aa([this,"playing"],[this,"ratio"],[this,"playingLoop"],"播放器"),new nt([this,"playingLoop"],"是否循环",Ve.defaults.playingLoop,!0),new q([this,"currentTime"],"当前时间",Ve.defaults.currentTime,!0),new q([this,"duration"],"过渡时间",Ve.defaults.duration,!0),new nt([this,"playing"],"是否播放",Ve.defaults.playing,!0),new q([this,"playingSpeed"],"播放速度",Ve.defaults.playingSpeed,!0)]}}};p(Ve,"createDefaultProps",()=>({...bt.createDefaultProps(),emitter:se({type:"CircleEmitter",radius:.5}),bursts:Hu(void 0),translation:Wt(void 0),image:St.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/smoke.png"),imageSize:Wt([20,20]),minimumImageSize:Wt(void 0),maximumImageSize:Wt(void 0),updateCallback:void 0,emissionRate:void 0,loop:void 0,particleScale:void 0,startScale:void 0,endScale:4,color:Wt(void 0),startColor:Wt(void 0),endColor:Wt(void 0),sizeInMeters:void 0,speed:void 0,minimumSpeed:void 0,maximumSpeed:void 0,lifetime:void 0,particleLife:.5,minimumParticleLife:void 0,maximumParticleLife:void 0,mass:void 0,minimumMass:void 0,maximumMass:void 0,playingLoop:!0,currentTime:0,duration:6e3,playingSpeed:1,playing:!0})),p(Ve,"type",Ve.register("ESParticleSystemPrimitive",Ve,{chsName:"粒子",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:`ESParticleSystemPrimitive 是用于在场景中指定位置生成和播放粒子特效(基于 Primitive API)的对象。
|
|
564
564
|
对象json示例:
|
|
565
565
|
{
|
|
566
566
|
"id": "particlesystemprimitive_xxx",
|
|
@@ -569,7 +569,7 @@ export type ESJTimeIntervalCollectionJsonType = {
|
|
|
569
569
|
"position": [116.39, 39.9, 0],
|
|
570
570
|
"speed": 5
|
|
571
571
|
}
|
|
572
|
-
`}));let du=Ve;const dn=class dn extends xi{constructor(t){super(t);p(this,"initialStyle",this.ad(
|
|
572
|
+
`}));let du=Ve;const dn=class dn extends xi{constructor(t){super(t);p(this,"initialStyle",this.ad(se(void 0)));p(this,"_getInitialStyleEvent",this.disposeVar(new H))}get getInitialStyleEvent(){return this._getInitialStyleEvent}getInitialStyle(){return Promise.race([new Promise(t=>{const n=this.d(this.initialStyle.changed.disposableOnce(t));this.getInitialStyleEvent.emit(),setTimeout(()=>{n(),t(void 0)},2e3)})])}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new xt([this,"mode"],dn.modes,"模式",dn.defaults.mode),new Mt([this,"style"],"样式",dn.defaults.style),new nt([this,"autoAnchor"],"自动锚点对齐",dn.defaults.autoAnchor)]}}};p(dn,"createDefaultProps",()=>({...xi.createDefaultProps(),mode:"SquareH01",style:At({fontSize:16,imageSize:[60,60],textBackgroundColor:[1,1,1,0],textBackgroundSize:[120,30],textColor:[1,1,1,1],textOffset:[10,2],textBoxOffset:[40,0],textBoxAlign:"start",textBoxShow:!0,textBoxMode:"default"}),autoAnchor:!0})),p(dn,"type",dn.register("ESPoi2D",dn,{chsName:"ESPoi2D",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:`ESPoi2D 是用于在场景中创建各种样式点标记(POI)的可视化对象。
|
|
573
573
|
对象json示例:
|
|
574
574
|
{
|
|
575
575
|
"id": "poi2d_xxx",
|
|
@@ -605,7 +605,7 @@ export type ESJTimeIntervalCollectionJsonType = {
|
|
|
605
605
|
"targetID": "tileset_xxx",
|
|
606
606
|
"pointsSet": [[[116.39, 39.9, 0], [116.40, 39.9, 0], [116.40, 39.91, 0]]]
|
|
607
607
|
}
|
|
608
|
-
`}));let mf=Ua;const Sy=async(i,e,t)=>{const{viewer:n}=i;if(!n){console.error("AddTrees: ueViewer.viewer is undefined");return}const s=await n.callUeFunc({f:"AddTrees",p:{id:e,TreeParams:t}});return s.error&&console.error("AddTrees:",s.error),s},xy=async(i,e)=>{const{viewer:t}=i;if(!t){console.error("RemoveAllTrees: ueViewer.viewer is undefined");return}const n=await t.callUeFunc({f:"RemoveAllTrees",p:{id:e}});return n.error&&console.error("RemoveAllTrees:",n.error),n},by=async(i,e,t)=>{const{viewer:n}=i;if(!n){console.error("UpdateTreeParams: ueViewer.viewer is undefined");return}const s=await n.callUeFunc({f:"UpdateTreeParams",p:{id:e,TreeParams:t}});return s.error&&console.error("UpdateTreeParams:",s.error),s},Py=async(i,e,t,n)=>{const{viewer:s}=i;if(!s){console.error("CutDownTrees: ueViewer.viewer is undefined");return}const o=await s.callUeFunc({f:"CutDownTrees",p:{id:e,TreeIds:t,TimeLength:n}});return o.error&&console.error("CutDownTrees:",o.error),o},Cy=async(i,e,t,n,s)=>{const{viewer:o}=i;if(!o){console.error("GrowthSimulation: ueViewer.viewer is undefined");return}const h=await o.callUeFunc({f:"GrowthSimulation",p:{id:e,ToParams:t,SwitchTime:s,TimeLength:n}});return h.error&&console.error("GrowthSimulation:",h.error),h},Va=class Va extends Ht{constructor(t){super(t);p(this,"_addTreesEvent",this.dv(new H));p(this,"_removeAllTreesEvent",this.dv(new H));p(this,"_updateTreeParamsEvent",this.dv(new H));p(this,"_cutDownTreesEvent",this.dv(new H));p(this,"_growthSimulationEvent",this.dv(new H))}async addTreesCallFunc(t,n){return await Sy(t,this.id,n)}async updateTreeParamsCallFunc(t,n){return await by(t,this.id,n)}async cutDownTreesCallFunc(t,n,s){return await Py(t,this.id,n,s)}async removeAllTreesCallFunc(t){return await xy(t,this.id)}async growthSimulationCallFunc(t,n,s,o){return await Cy(t,this.id,n,s,o)}async getIdByComponentNameAndHitItem(t,n,s){return await t.getIdByComponentNameAndHitItem(this.id,n,s)}get addTreesEvent(){return this._addTreesEvent}addTrees(t){this._addTreesEvent.emit(t)}get removeAllTreesEvent(){return this._removeAllTreesEvent}removeAllTrees(){this._removeAllTreesEvent.emit()}get updateTreeParamsEvent(){return this._updateTreeParamsEvent}updateTreeParams(t){this._updateTreeParamsEvent.emit(t)}get cutDownTreesEvent(){return this._cutDownTreesEvent}cutDownTrees(t,n){this._cutDownTreesEvent.emit(t,n)}get growthSimulationEvent(){return this._growthSimulationEvent}growthSimulation(t,n,s){this._growthSimulationEvent.emit(t,n,s)}getESProperties(){const t={...super.getESProperties()};return{...t,more:[...t.more,new yt("通用"),new ue([this,"treeTypes"],"treeTypes",[],"{ name: string, meshPath: string }[]",!0),new q([this,"stumpId"],"树桩id"),new q([this,"intervalTime"],"动画间隔时间"),new q([this,"switchIntervalTime"],"切换间隔时间")]}}};p(Va,"createDefaultProps",()=>({...Ht.createDefaultProps(),treeTypes:
|
|
608
|
+
`}));let mf=Ua;const Sy=async(i,e,t)=>{const{viewer:n}=i;if(!n){console.error("AddTrees: ueViewer.viewer is undefined");return}const s=await n.callUeFunc({f:"AddTrees",p:{id:e,TreeParams:t}});return s.error&&console.error("AddTrees:",s.error),s},xy=async(i,e)=>{const{viewer:t}=i;if(!t){console.error("RemoveAllTrees: ueViewer.viewer is undefined");return}const n=await t.callUeFunc({f:"RemoveAllTrees",p:{id:e}});return n.error&&console.error("RemoveAllTrees:",n.error),n},by=async(i,e,t)=>{const{viewer:n}=i;if(!n){console.error("UpdateTreeParams: ueViewer.viewer is undefined");return}const s=await n.callUeFunc({f:"UpdateTreeParams",p:{id:e,TreeParams:t}});return s.error&&console.error("UpdateTreeParams:",s.error),s},Py=async(i,e,t,n)=>{const{viewer:s}=i;if(!s){console.error("CutDownTrees: ueViewer.viewer is undefined");return}const o=await s.callUeFunc({f:"CutDownTrees",p:{id:e,TreeIds:t,TimeLength:n}});return o.error&&console.error("CutDownTrees:",o.error),o},Cy=async(i,e,t,n,s)=>{const{viewer:o}=i;if(!o){console.error("GrowthSimulation: ueViewer.viewer is undefined");return}const h=await o.callUeFunc({f:"GrowthSimulation",p:{id:e,ToParams:t,SwitchTime:s,TimeLength:n}});return h.error&&console.error("GrowthSimulation:",h.error),h},Va=class Va extends Ht{constructor(t){super(t);p(this,"_addTreesEvent",this.dv(new H));p(this,"_removeAllTreesEvent",this.dv(new H));p(this,"_updateTreeParamsEvent",this.dv(new H));p(this,"_cutDownTreesEvent",this.dv(new H));p(this,"_growthSimulationEvent",this.dv(new H))}async addTreesCallFunc(t,n){return await Sy(t,this.id,n)}async updateTreeParamsCallFunc(t,n){return await by(t,this.id,n)}async cutDownTreesCallFunc(t,n,s){return await Py(t,this.id,n,s)}async removeAllTreesCallFunc(t){return await xy(t,this.id)}async growthSimulationCallFunc(t,n,s,o){return await Cy(t,this.id,n,s,o)}async getIdByComponentNameAndHitItem(t,n,s){return await t.getIdByComponentNameAndHitItem(this.id,n,s)}get addTreesEvent(){return this._addTreesEvent}addTrees(t){this._addTreesEvent.emit(t)}get removeAllTreesEvent(){return this._removeAllTreesEvent}removeAllTrees(){this._removeAllTreesEvent.emit()}get updateTreeParamsEvent(){return this._updateTreeParamsEvent}updateTreeParams(t){this._updateTreeParamsEvent.emit(t)}get cutDownTreesEvent(){return this._cutDownTreesEvent}cutDownTrees(t,n){this._cutDownTreesEvent.emit(t,n)}get growthSimulationEvent(){return this._growthSimulationEvent}growthSimulation(t,n,s){this._growthSimulationEvent.emit(t,n,s)}getESProperties(){const t={...super.getESProperties()};return{...t,more:[...t.more,new yt("通用"),new ue([this,"treeTypes"],"treeTypes",[],"{ name: string, meshPath: string }[]",!0),new q([this,"stumpId"],"树桩id"),new q([this,"intervalTime"],"动画间隔时间"),new q([this,"switchIntervalTime"],"切换间隔时间")]}}};p(Va,"createDefaultProps",()=>({...Ht.createDefaultProps(),treeTypes:se([]),stumpId:-1,intervalTime:.1,switchIntervalTime:.5})),p(Va,"type",Va.register("ESSeparateFoliage",Va,{chsName:"单体控制森林",tags:["ESObjects","_ES_Impl_UE"],description:`ESSeparateFoliage 是用于管理和控制森林中单体树木(添加、砍伐、生长模拟)的对象。
|
|
609
609
|
对象json示例:
|
|
610
610
|
{
|
|
611
611
|
"id": "separatefoliage_xxx",
|
|
@@ -655,7 +655,7 @@ export type ESJTimeIntervalCollectionJsonType = {
|
|
|
655
655
|
"Title": "示例",
|
|
656
656
|
"Content": "这是一个示例\\n帮助你理解info的数据形式\\nnum:1\\nkey:'value'\\n"
|
|
657
657
|
}
|
|
658
|
-
\`\`\``,$i=class $i extends xi{constructor(t){super(t);p(this,"_callFunctionEvent",this.disposeVar(new H));p(this,"_callFunctionResultEvent",this.dv(new H))}get __callFunctionResultEvent(){return this._callFunctionResultEvent}get callFunctionEvent(){return this._callFunctionEvent}callFunction(t,n){return new Promise(s=>{const o=new st,h=setTimeout(()=>{o.isDestroyed()||(o.destroy(),s(void 0))},1e4);o.d(this._callFunctionResultEvent.donce(l=>{o.isDestroyed()||(o.destroy(),s(l),clearTimeout(h))})),this._callFunctionEvent.emit(t,n)})}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new Te([this,"positionOffset"],"positionOffset",$i.defaults.positionOffset),new Te([this,"rotationOffset"],"rotationOffset",$i.defaults.rotationOffset),new Tt([this,"actorTag"],"actorTag",$i.defaults.actorTag),new Tt([this,"widgetClass"],"widgetClass",$i.defaults.widgetClass),new Tt([this,"socketName"],"socketName",$i.defaults.socketName),new Mt([this,"info"],"info",$i.defaults.info,Lk,!0)],more:[...t.more,new kt("回调函数",this.callFunction.bind(this),["",""],"callFunction")]}}};p($i,"createDefaultProps",()=>({...xi.createDefaultProps(),widgetClass:"",info:
|
|
658
|
+
\`\`\``,$i=class $i extends xi{constructor(t){super(t);p(this,"_callFunctionEvent",this.disposeVar(new H));p(this,"_callFunctionResultEvent",this.dv(new H))}get __callFunctionResultEvent(){return this._callFunctionResultEvent}get callFunctionEvent(){return this._callFunctionEvent}callFunction(t,n){return new Promise(s=>{const o=new st,h=setTimeout(()=>{o.isDestroyed()||(o.destroy(),s(void 0))},1e4);o.d(this._callFunctionResultEvent.donce(l=>{o.isDestroyed()||(o.destroy(),s(l),clearTimeout(h))})),this._callFunctionEvent.emit(t,n)})}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new Te([this,"positionOffset"],"positionOffset",$i.defaults.positionOffset),new Te([this,"rotationOffset"],"rotationOffset",$i.defaults.rotationOffset),new Tt([this,"actorTag"],"actorTag",$i.defaults.actorTag),new Tt([this,"widgetClass"],"widgetClass",$i.defaults.widgetClass),new Tt([this,"socketName"],"socketName",$i.defaults.socketName),new Mt([this,"info"],"info",$i.defaults.info,Lk,!0)],more:[...t.more,new kt("回调函数",this.callFunction.bind(this),["",""],"callFunction")]}}};p($i,"createDefaultProps",()=>({...xi.createDefaultProps(),widgetClass:"",info:se({Title:"标题示例",Content:"内容示例"})})),p($i,"type",$i.register("ESUEWidget",$i,{chsName:"部件",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:`ESUEWidget 是用于在场景中指定位置创建和管理 Unreal Engine 部件(UI 交互面板)的对象。
|
|
659
659
|
对象json示例:
|
|
660
660
|
{
|
|
661
661
|
"id": "uewidget_xxx",
|
|
@@ -799,7 +799,7 @@ export type ESJTimeIntervalCollectionJsonType = {
|
|
|
799
799
|
\`\`\`
|
|
800
800
|
${If}
|
|
801
801
|
\`\`\`
|
|
802
|
-
`,Oy=St.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/misc/2.geojson"),$t=class $t extends Ht{constructor(t){super(t);p(this,"_flyToFeatureEvent",this.dv(new H));p(this,"_flyToFeatureIndexEvent",this.dv(new H));p(this,"_setFeatureStyleEvent",this.disposeVar(new H));p(this,"_resetFeatureStyleEvent",this.disposeVar(new H));p(this,"_features",this.disposeVar(
|
|
802
|
+
`,Oy=St.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/misc/2.geojson"),$t=class $t extends Ht{constructor(t){super(t);p(this,"_flyToFeatureEvent",this.dv(new H));p(this,"_flyToFeatureIndexEvent",this.dv(new H));p(this,"_setFeatureStyleEvent",this.disposeVar(new H));p(this,"_resetFeatureStyleEvent",this.disposeVar(new H));p(this,"_features",this.disposeVar(se(void 0)));p(this,"pickedInfoType","FeatureCollection");p(this,"abortController");this._updateUrl(),this.ad(this.urlChanged.don(()=>{this._updateUrl()})),this.ad(this.editingChanged.don(()=>{console.warn("ESGeoJson暂不支持编辑!")}))}get flyToFeatureEvent(){return this._flyToFeatureEvent}flyToFeature(t,n,s){this._flyToFeatureEvent.emit(t,n,s)}get flyToFeatureIndexEvent(){return this._flyToFeatureIndexEvent}flyToFeatureIndex(t,n){this._flyToFeatureIndexEvent.emit(t,n)}get setFeatureStyleEvent(){return this._setFeatureStyleEvent}setFeatureStyle(t,n=!1){this._setFeatureStyleEvent.emit(t,n)}get resetFeatureStyleEvent(){return this._resetFeatureStyleEvent}resetFeatureStyle(){this._resetFeatureStyleEvent.emit()}get features(){return this._features.value}set features(t){this._features.value=t}get featuresChanged(){return this._features.changed}getFeatures(){if(this.features)return this.features;console.log("数据未加载完成,请稍后调用此方法getFeatures()")}getFeatureTable(){if(this.features){let t={};return bm(this.features).features.forEach(n=>{Object.assign(t,n.properties)}),Object.keys(t).forEach(n=>{t[n]=typeof t[n]}),t}else console.log("数据未加载完成,请稍后调用此方法getFeatureTable()")}_updateUrl(){var t;if(this.abortController&&this.abortController.abort(),!this.url){this.features=void 0;return}if(typeof this.url=="object")this.features=this.url;else if(Nc(this.url))this.features=JSON.parse(this.url);else{this.abortController=new AbortController;const n=this.abortController.signal;fetch(St.context.getStrFromEnv(this.url),{signal:n}).then(s=>s.json()).then(s=>{this.features=s}).catch(s=>{s.name!="AbortError"&&console.warn("ESGeoJson数据加载失败",s)})}this.pickedInfoType=((t=this.features)==null?void 0:t.type)??"FeatureCollection"}getESProperties(){const t={...super.getESProperties()};return{...t,defaultMenu:"style",dataSource:[...t.dataSource,new Mt([this,"url"],"服务地址",$t.defaults.url),new q([this,"minFeatureVisibleDistance"],"要素最小可视距离",$t.defaults.minFeatureVisibleDistance),new q([this,"maxFeatureVisibleDistance"],"要素最大可视距离",$t.defaults.maxFeatureVisibleDistance),new xt([this,"heightReference"],[["NONE","NONE"],["CLAMP_TO_GROUND","CLAMP_TO_GROUND"],["RELATIVE_TO_GROUND","RELATIVE_TO_GROUND"]],"高度参考"),new xt([this,"classificationType"],$t.classificationTypes,"贴地附着目标",$t.defaults.classificationType),new q([this,"zIndex"],"层级排序",$t.defaults.zIndex)],style:[...t.style,new yt("点样式集合"),new nt([this,"textShow"],"是否显示",$t.defaults.textShow),new ge([this,"textAnchor"],"锚点",$t.defaults.anchor),new Tt([this,"textProperty"],"标注显示属性",$t.defaults.textStyle.textProperty),new Tt([this,"textDefaultText"],"默认文本",$t.defaults.textStyle.defaultText),new jt([this,"textColor"],"文本颜色",$t.defaults.textStyle.color),new jt([this,"textBackgroundColor"],"文本背景颜色",$t.defaults.textStyle.backgroundColor),new Tt([this,"textFontStyle"],"字体样式",$t.defaults.textStyle.fontStyle),new Tt([this,"textFontWeight"],"字体粗细",$t.defaults.textStyle.fontWeight),new q([this,"textFontSize"],"字体大小",$t.defaults.textStyle.fontSize),new ge([this,"textOffset"],"像素偏移",$t.defaults.textStyle.offset),new yt("点图片样式集合"),new nt([this,"imageShow"],"是否显示",$t.defaults.imageShow),new ge([this,"imageAnchor"],"锚点",$t.defaults.imageStyle.anchor),new Mt([this,"imageUrl"],"图片地址",$t.defaults.imageStyle.url),new ge([this,"imageSize"],"图片大小",$t.defaults.imageStyle.size),new ge([this,"imageOffset"],"像素偏移",$t.defaults.imageStyle.offset),new yt("线样式集合"),new nt([this,"stroked"],"是否显示",$t.defaults.stroked),new nt([this,"strokeGround"],"贴地",$t.defaults.strokeStyle.ground),new q([this,"strokeWidth"],"线宽",$t.defaults.strokeStyle.width),new xt([this,"strokeWidthType"],$t.strokeStyleWidthTypes,"线宽类型"),new jt([this,"strokeColor"],"线颜色",$t.defaults.strokeStyle.color),new Tt([this,"strokeMaterial"],"线材质",$t.defaults.strokeStyle.material),new Mt([this,"strokeMaterialParams"],"线材质参数",$t.defaults.strokeStyle.materialParams),new yt("面样式集合"),new nt([this,"filled"],"是否显示",$t.defaults.filled),new nt([this,"fillGround"],"贴地",$t.defaults.fillStyle.ground),new jt([this,"fillColor"],"填充颜色",$t.defaults.fillStyle.color),new Tt([this,"fillMaterial"],"填充材质",$t.defaults.fillStyle.material),new Mt([this,"fillMaterialParams"],"填充材质参数",$t.defaults.fillStyle.materialParams)],more:[...t.more,new yt("标注文本样式"),new Tt([this,"textFontFamily"],"字体",$t.defaults.textStyle.fontFamily),new q([this,"zOrder"],"点排序优先级",$t.defaults.zOrder),new yt("通用"),new Ai([this,"loadFuncStr"],"loadFnStr",If,ky,!0)]}}get strokeWidth(){return this.strokeStyle.width}set strokeWidth(t){this.strokeStyle={...this.strokeStyle,width:t}}get strokeWidthChanged(){return this.strokeStyleChanged}get strokeWidthType(){return this.strokeStyle.widthType}set strokeWidthType(t){this.strokeStyle={...this.strokeStyle,widthType:t}}get strokeWidthTypeChanged(){return this.strokeStyleChanged}get strokeColor(){return this.strokeStyle.color}set strokeColor(t){this.strokeStyle={...this.strokeStyle,color:[...t]}}get strokeColorChanged(){return this.strokeStyleChanged}get strokeMaterial(){return this.strokeStyle.material}set strokeMaterial(t){this.strokeStyle={...this.strokeStyle,material:t}}get strokeMaterialChanged(){return this.strokeStyleChanged}get strokeMaterialParams(){return this.strokeStyle.materialParams}set strokeMaterialParams(t){this.strokeStyle={...this.strokeStyle,materialParams:t}}get strokeMaterialParamsChanged(){return this.strokeStyleChanged}get strokeGround(){return this.strokeStyle.ground}set strokeGround(t){this.strokeStyle={...this.strokeStyle,ground:t}}get strokeGroundChanged(){return this.strokeStyleChanged}get fillColor(){return this.fillStyle.color}set fillColor(t){this.fillStyle={...this.fillStyle,color:[...t]}}get fillColorChanged(){return this.fillStyleChanged}get fillMaterial(){return this.fillStyle.material}set fillMaterial(t){this.fillStyle={...this.fillStyle,material:t}}get fillMaterialChanged(){return this.fillStyleChanged}get fillMaterialParams(){return this.fillStyle.materialParams}set fillMaterialParams(t){this.fillStyle={...this.fillStyle,materialParams:t}}get fillMaterialParamsChanged(){return this.fillStyleChanged}get fillGround(){return this.fillStyle.ground}set fillGround(t){this.fillStyle={...this.fillStyle,ground:t}}get fillGroundChanged(){return this.fillStyleChanged}get textProperty(){return this.textStyle.textProperty}set textProperty(t){this.textStyle={...this.textStyle,textProperty:t}}get textPropertyChanged(){return this.textStyleChanged}get textDefaultText(){return this.textStyle.defaultText}set textDefaultText(t){this.textStyle={...this.textStyle,defaultText:t}}get textDefaultTextChanged(){return this.textStyleChanged}get textColor(){return this.textStyle.color}set textColor(t){this.textStyle={...this.textStyle,color:t}}get textColorChanged(){return this.textStyleChanged}get textBackgroundColor(){return this.textStyle.backgroundColor}set textBackgroundColor(t){this.textStyle={...this.textStyle,backgroundColor:t}}get textBackgroundColorChanged(){return this.textStyleChanged}get textFontFamily(){return this.textStyle.fontFamily}set textFontFamily(t){this.textStyle={...this.textStyle,fontFamily:t}}get textFontFamilyChanged(){return this.textStyleChanged}get textFontStyle(){return this.textStyle.fontStyle}set textFontStyle(t){this.textStyle={...this.textStyle,fontStyle:t}}get textFontStyleChanged(){return this.textStyleChanged}get textFontWeight(){return this.textStyle.fontWeight}set textFontWeight(t){this.textStyle={...this.textStyle,fontWeight:t}}get textFontWeightChanged(){return this.textStyleChanged}get textFontSize(){return this.textStyle.fontSize}set textFontSize(t){this.textStyle={...this.textStyle,fontSize:t}}get textFontSizeChanged(){return this.textStyleChanged}get textAnchor(){return this.textStyle.anchor}set textAnchor(t){this.textStyle={...this.textStyle,anchor:t}}get textAnchorChanged(){return this.textStyleChanged}get textOffset(){return this.textStyle.offset}set textOffset(t){this.textStyle={...this.textStyle,offset:t}}get textOffsetChanged(){return this.textStyleChanged}get imageUrl(){return this.imageStyle.url}set imageUrl(t){this.imageStyle={...this.imageStyle,url:t}}get imageUrlChanged(){return this.imageStyleChanged}get imageSize(){return this.imageStyle.size}set imageSize(t){this.imageStyle={...this.imageStyle,size:t}}get imageSizeChanged(){return this.imageStyleChanged}get imageAnchor(){return this.imageStyle.anchor}set imageAnchor(t){this.imageStyle={...this.imageStyle,anchor:t}}get imageAnchorChanged(){return this.imageStyleChanged}get imageOffset(){return this.imageStyle.offset}set imageOffset(t){this.imageStyle={...this.imageStyle,offset:t}}get imageOffsetChanged(){return this.imageStyleChanged}};p($t,"createDefaultProps",()=>({...Ht.createDefaultProps(),show:!0,allowPicking:!0,loadFuncStr:void 0,url:Oy,stroked:!0,strokeStyle:At({width:1,widthType:"world",color:[.79,.91,.06,1],material:"",materialParams:{},ground:!1}),filled:!0,fillStyle:At({color:[.79,.91,.06,.2],material:"",materialParams:{},ground:!1}),imageShow:!0,imageStyle:At({url:St.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/location.png"),size:[32,32],anchor:[.5,1],offset:[0,0]}),textShow:!0,textStyle:At({textProperty:"",defaultText:"默认标注",color:[1,1,1,1],backgroundColor:void 0,fontFamily:"Arial",fontSize:16,fontStyle:"normal",fontWeight:"normal",anchor:[0,1],offset:[16,-8]}),minFeatureVisibleDistance:0,maxFeatureVisibleDistance:0,heightReference:"NONE",classificationType:"TERRAIN",zIndex:0})),p($t,"type",$t.register("ESGeoJson",$t,{chsName:"ESGeoJson",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:`ESGeoJson 是用于加载和渲染 GeoJson 矢量数据并支持点、线、面样式配置的对象。
|
|
803
803
|
对象json示例:
|
|
804
804
|
{
|
|
805
805
|
"id": "geojson_xxx",
|
|
@@ -905,7 +905,7 @@ ${If}
|
|
|
905
905
|
"points": [[116.39, 39.9, 0], [116.40, 39.9, 0], [116.40, 39.91, 0]],
|
|
906
906
|
"interpolation": 0.5
|
|
907
907
|
}
|
|
908
|
-
`}));let Df=zs;const Us=class Us extends bt{constructor(e){super(e)}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new q([this,"downloadProgress"],"下载进度",Us.defaults.downloadProgress,!0,!0),new Mt([this,"importOptions"],"导入参数",Us.defaults.importOptions,void 0,!0)],dataSource:[...e.dataSource,new Mt([this,"url"],"路径")]}}};p(Us,"createDefaultProps",()=>({...bt.createDefaultProps(),url:"",importOptions:
|
|
908
|
+
`}));let Df=zs;const Us=class Us extends bt{constructor(e){super(e)}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new q([this,"downloadProgress"],"下载进度",Us.defaults.downloadProgress,!0,!0),new Mt([this,"importOptions"],"导入参数",Us.defaults.importOptions,void 0,!0)],dataSource:[...e.dataSource,new Mt([this,"url"],"路径")]}}};p(Us,"createDefaultProps",()=>({...bt.createDefaultProps(),url:"",importOptions:se({buildCollisions:"QueryAndPhysics",buildHierarchy:"Simplified",collisionType:"CTF_UseComplexAsSimple",bImportMetaData:!0}),downloadProgress:0})),p(Us,"type",Us.register("ESDatasmithRuntimeModel",Us,{chsName:"Datasmith Model",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:`ESDatasmithRuntimeModel 是用于加载和展示 Datasmith 模型的可视化对象。
|
|
909
909
|
对象json示例:
|
|
910
910
|
{
|
|
911
911
|
"id": "datasmithruntimemodel_xxx",
|
|
@@ -914,7 +914,7 @@ ${If}
|
|
|
914
914
|
"position": [116.39, 39.9, 0],
|
|
915
915
|
"url": "http://localhost:9004/datasmith/model.datasmith"
|
|
916
916
|
}
|
|
917
|
-
`}));let Lf=Us;const Ke=class Ke extends Ph{constructor(e){super(e),this.ad(Me([this.waterColorChanged,this.waterImageChanged,this.frequencyChanged,this.amplitudeChanged,this.flowDirectionChanged,this.waveVelocityChanged,this.specularIntensityChanged,this.murkinessChanged,this.flowSpeedChanged],()=>{this.waterType="custom"}))}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new xt([this,"waterType"],[["river","river"],["ocean","ocean"],["lake","lake"],["custom","custom"]],"水域类型",Ke.defaults.waterType),new q([this,"frequency"],"频率",Ke.defaults.frequency),new ke([this,"amplitude"],.01,[0,1],"振幅",Ke.defaults.amplitude),new ke([this,"flowDirection"],1,[0,360],"流向",Ke.defaults.flowDirection),new ke([this,"waveVelocity"],.01,[0,1],"波动频率",Ke.defaults.waveVelocity),new ke([this,"specularIntensity"],.01,[0,1],"镜面反射强度",Ke.defaults.specularIntensity),new ke([this,"murkiness"],.1,[0,10],"水体浑浊度",Ke.defaults.murkiness),new q([this,"flowSpeed"],"水流速度",Ke.defaults.flowSpeed),new jt([this,"waterColor"],"水的底色",Ke.defaults.waterColor),new Mt([this,"waterImage"],"水的图片",Ke.defaults.waterImage)]}}};p(Ke,"createDefaultProps",()=>({...Ph.createDefaultProps(),allowPicking:!0,waterImage:
|
|
917
|
+
`}));let Lf=Us;const Ke=class Ke extends Ph{constructor(e){super(e),this.ad(Me([this.waterColorChanged,this.waterImageChanged,this.frequencyChanged,this.amplitudeChanged,this.flowDirectionChanged,this.waveVelocityChanged,this.specularIntensityChanged,this.murkinessChanged,this.flowSpeedChanged],()=>{this.waterType="custom"}))}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new xt([this,"waterType"],[["river","river"],["ocean","ocean"],["lake","lake"],["custom","custom"]],"水域类型",Ke.defaults.waterType),new q([this,"frequency"],"频率",Ke.defaults.frequency),new ke([this,"amplitude"],.01,[0,1],"振幅",Ke.defaults.amplitude),new ke([this,"flowDirection"],1,[0,360],"流向",Ke.defaults.flowDirection),new ke([this,"waveVelocity"],.01,[0,1],"波动频率",Ke.defaults.waveVelocity),new ke([this,"specularIntensity"],.01,[0,1],"镜面反射强度",Ke.defaults.specularIntensity),new ke([this,"murkiness"],.1,[0,10],"水体浑浊度",Ke.defaults.murkiness),new q([this,"flowSpeed"],"水流速度",Ke.defaults.flowSpeed),new jt([this,"waterColor"],"水的底色",Ke.defaults.waterColor),new Mt([this,"waterImage"],"水的图片",Ke.defaults.waterImage)]}}};p(Ke,"createDefaultProps",()=>({...Ph.createDefaultProps(),allowPicking:!0,waterImage:se(void 0),waterColor:[.15,.16,0,1],frequency:1e3,waveVelocity:.5,amplitude:.1,specularIntensity:.8,waterType:"river",flowDirection:0,flowSpeed:0,murkiness:5,stroked:!1,filled:!0})),p(Ke,"type",Ke.register("ESDynamicWater",Ke,{chsName:"动态水面",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:`ESDynamicWater 是用于在场景中渲染动态水面效果的对象。
|
|
918
918
|
对象json示例:
|
|
919
919
|
{
|
|
920
920
|
"id": "dynamicwater_xxx",
|
|
@@ -923,7 +923,7 @@ ${If}
|
|
|
923
923
|
"points": [[116.39, 39.9, 0], [116.40, 39.9, 0], [116.40, 39.91, 0]],
|
|
924
924
|
"waterType": "river"
|
|
925
925
|
}
|
|
926
|
-
`}));let Ff=Ke;const Ze=class Ze extends Jt{constructor(e){super(e),this.ad(Me([this.waterColorChanged,this.waterImageChanged,this.frequencyChanged,this.amplitudeChanged,this.flowDirectionChanged,this.waveVelocityChanged,this.specularIntensityChanged,this.murkinessChanged,this.flowSpeedChanged],()=>{this.waterType="custom"}))}getESProperties(){const e={...super.getESProperties()};return{...e,defaultMenu:"basic",basic:[...e.basic,new xt([this,"waterType"],[["river","river"],["ocean","ocean"],["lake","lake"],["custom","custom"]],"水域类型",Ze.defaults.waterType),new q([this,"frequency"],"频率",Ze.defaults.frequency),new ke([this,"amplitude"],.01,[0,1],"振幅",Ze.defaults.amplitude),new ke([this,"flowDirection"],1,[0,360],"流向",Ze.defaults.flowDirection),new ke([this,"waveVelocity"],.01,[0,1],"波动频率",Ze.defaults.waveVelocity),new ke([this,"specularIntensity"],.01,[0,1],"镜面反射强度",Ze.defaults.specularIntensity),new ke([this,"murkiness"],.1,[0,10],"水体浑浊度",Ze.defaults.murkiness),new q([this,"flowSpeed"],"水流速度",Ze.defaults.flowSpeed),new jt([this,"waterColor"],"水的底色",Ze.defaults.waterColor),new Mt([this,"waterImage"],"水的图片",Ze.defaults.waterImage)]}}};p(Ze,"createDefaultProps",()=>({...Jt.createDefaultProps(),allowPicking:!0,waterImage:
|
|
926
|
+
`}));let Ff=Ke;const Ze=class Ze extends Jt{constructor(e){super(e),this.ad(Me([this.waterColorChanged,this.waterImageChanged,this.frequencyChanged,this.amplitudeChanged,this.flowDirectionChanged,this.waveVelocityChanged,this.specularIntensityChanged,this.murkinessChanged,this.flowSpeedChanged],()=>{this.waterType="custom"}))}getESProperties(){const e={...super.getESProperties()};return{...e,defaultMenu:"basic",basic:[...e.basic,new xt([this,"waterType"],[["river","river"],["ocean","ocean"],["lake","lake"],["custom","custom"]],"水域类型",Ze.defaults.waterType),new q([this,"frequency"],"频率",Ze.defaults.frequency),new ke([this,"amplitude"],.01,[0,1],"振幅",Ze.defaults.amplitude),new ke([this,"flowDirection"],1,[0,360],"流向",Ze.defaults.flowDirection),new ke([this,"waveVelocity"],.01,[0,1],"波动频率",Ze.defaults.waveVelocity),new ke([this,"specularIntensity"],.01,[0,1],"镜面反射强度",Ze.defaults.specularIntensity),new ke([this,"murkiness"],.1,[0,10],"水体浑浊度",Ze.defaults.murkiness),new q([this,"flowSpeed"],"水流速度",Ze.defaults.flowSpeed),new jt([this,"waterColor"],"水的底色",Ze.defaults.waterColor),new Mt([this,"waterImage"],"水的图片",Ze.defaults.waterImage)]}}};p(Ze,"createDefaultProps",()=>({...Jt.createDefaultProps(),allowPicking:!0,waterImage:se({}),waterColor:[.15,.16,0,1],frequency:1e3,waveVelocity:.5,amplitude:.1,specularIntensity:.8,waterType:"river",flowDirection:0,flowSpeed:0,murkiness:5})),p(Ze,"type",Ze.register("ESGeoWater",Ze,{chsName:"地理水面",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:`ESGeoWater 是用于表示和渲染地理动态水面的对象,支持设置水色、波动、流向等水面效果。
|
|
927
927
|
对象json示例:
|
|
928
928
|
{
|
|
929
929
|
"id": "water_xxx",
|
|
@@ -1013,7 +1013,7 @@ ${If}
|
|
|
1013
1013
|
"points": [[116.39, 39.9, 0], [116.40, 39.9, 0], [116.40, 39.91, 0]],
|
|
1014
1014
|
"mode": "in"
|
|
1015
1015
|
}
|
|
1016
|
-
`}));let $f=Ka;function Ny(i){return i.startsWith("/")&&!i.startsWith("//")}function yu(i){var e;return!i||/^https?:\/\//i.test(i)?i:Ny(i)&&typeof window<"u"&&((e=window.location)!=null&&e.origin)?`${window.location.origin}${i}`:i}function _u(i){var t;return(t=yu(i).match(/^(https?:\/\/[^/]+)/i))==null?void 0:t[1]}function Ry(i){var t;return(t=yu(i).match(/^(https?:\/\/[^:]+)/i))==null?void 0:t[1]}function dr(i){return i==="CesiumlabDesktop"?"/cim":""}function Ay(i){if(/\/cim\/ts\//.test(i))return"CesiumlabDesktop";if(/\/ts\/(?:info|tiles|featuretiles)\//.test(i))return"CIMRTS"}function Dy(i){const e=i.match(/(?:\/cim)?\/ts\/info\/([^?/]+)/);return e==null?void 0:e[1]}function Bk(i,e,t){const n=dr(e);return`${i}${n}/ts/info/${t}`}function Ly(i,e,t,n=Date.now()){const s=dr(e);return`${i}${s}/ts/tiles/${t}/tileset.json?t=${n}`}function Fy(i,e,t,n){const s=dr(e);return`${i}${s}/ts/featuretiles/${t}/${n}/tileset.json`}const wu={layerconfigfind:"/ts/layer/config/get",layerconfigsave:"/ts/layer/config/put",featureproperty:"/ts/editor/property",featureeditormuti:"/ts/editor/update",getts:"/ts/info"},Gy=async(i,e,t,n,s="CIMRTS")=>{try{const o=window.localStorage.getItem("Authorization"),h=dr(s);let l=i+`${h}${wu.layerconfigfind}?tileServiceName=${e}`;t&&(l+=`&earthdstoken=${encodeURIComponent(n)}`);const d={headers:{...!t&&o?{Authorization:o}:{}},mode:"cors"},v=await(await fetch(l,d)).text();return JSON.parse(v)}catch(o){console.error(o)}},jy=async(i,e,t,n,s,o="CIMRTS")=>{try{const h=window.localStorage.getItem("Authorization"),l=dr(o);let d=i+`${l}${wu.layerconfigsave}`;const f=s??{};t&&(d+=`?earthdstoken=${encodeURIComponent(n)}`);const v={method:"POST",headers:{"Content-Type":"application/json",...!t&&h?{Authorization:h}:{}},mode:"cors",body:JSON.stringify({tileServiceName:e,layerConfig:JSON.stringify(f)})},y=await(await fetch(d,v)).text();return JSON.parse(y)}catch(h){console.error(h)}},By=async(i,e,t)=>{try{const n=window.localStorage.getItem("Authorization");let s=i;e&&(s+=`?earthdstoken=${encodeURIComponent(t)}`);const o={headers:{...!e&&n?{Authorization:n}:{}},mode:"cors"},l=await(await fetch(s,o)).text(),d=JSON.parse(l);if(d.status=="ok")return d.data.port;console.error(d.status);return}catch(n){console.error(n)}},zy=async(i,e,t,n,s,o="CIMRTS")=>{try{const h={tileServiceName:e,featureId:t},l=window.localStorage.getItem("Authorization"),d=dr(o);let f=i+`${d}${wu.featureproperty}`;n&&(f+=`?earthdstoken=${encodeURIComponent(s)}`);const m=await(await fetch(f,{method:"post",headers:{"Content-Type":"application/json",...!n&&l?{Authorization:l}:{}},body:JSON.stringify(h),mode:"cors"})).text(),y=JSON.parse(m);if(y.status=="ok")return y.data;console.error(y.data.status);return}catch(h){console.error(h)}},Za=class Za extends bi{constructor(t){super(t);p(this,"_es3DTileset",this.dv(new bi));p(this,"_ids",this.dv(At([])));p(this,"_platform",this.dv(it("CIMRTS")));p(this,"_visJson",this.disposeVar(it({})));p(this,"_highlightInner3DtilesetEvent",this.dv(new H));p(this,"_removeHighlightInner3DtilesetEvent",this.dv(new H));p(this,"_tilesetServePort",this.dv(it("")));this.collision=!1;{const n=async()=>{if(typeof this.url!="string"){console.error("服务地址不合法, Init Error! 示例: http://localhost:9009/ts/info/ts01 或 /ts/info/ts01");return}this.url?(this.syncPlatformFromUrl(),this.refresh()):this._es3DTileset.url=""};this.d(this.urlChanged.don(()=>{n()})),this.d(this.platformChanged.don(()=>{n()}))}{this.d(this.components.disposableAdd(this._es3DTileset,!0));const n=this._es3DTileset;this.d(Q([n,"allowPicking"],[this,"allowPicking"])),this.d(Q([n,"collision"],[this,"collision"])),this.d(mt([n,"flyToParam"],[this,"flyToParam"])),this.d(Q([n,"actorTag"],[this,"actorTag"])),this.d(Q([n,"materialMode"],[this,"materialMode"])),this.d(Q([n,"highlight"],[this,"highlight"])),this.d(Q([n,"maximumScreenSpaceError"],[this,"maximumScreenSpaceError"])),this.d(Q([n,"highlightID"],[this,"highlightID"])),this.d(Q([n,"highlightColor"],[this,"highlightColor"])),this.d(mt([n,"offset"],[this,"offset"])),this.d(mt([n,"rotation"],[this,"rotation"])),this.d(Q([n,"czmImageBasedLightingFactor"],[this,"czmImageBasedLightingFactor"])),this.d(Q([n,"czmLuminanceAtZenith"],[this,"czmLuminanceAtZenith"])),this.d(Q([n,"czmMaximumMemoryUsage"],[this,"czmMaximumMemoryUsage"])),this.d(Q([n,"czmClassificationType"],[this,"czmClassificationType"])),this.d(Q([n,"czmStyleJson"],[this,"czmStyleJson"])),this.d(Q([n,"czmBackFaceCulling"],[this,"czmBackFaceCulling"])),this.d(Q([n,"czmDebugShowBoundingVolume"],[this,"czmDebugShowBoundingVolume"])),this.d(Q([n,"czmDebugShowContentBoundingVolume"],[this,"czmDebugShowContentBoundingVolume"])),this.d(Q([n,"czmSkipLevelOfDetail"],[this,"czmSkipLevelOfDetail"])),this.d(Q([n,"colorBlendMode"],[this,"colorBlendMode"])),this.d(Q([n,"cacheBytes"],[this,"cacheBytes"])),this.d(Q([n,"clippingPlaneEnabled"],[this,"clippingPlaneEnabled"])),this.d(Q([n,"unionClippingRegions"],[this,"unionClippingRegions"])),this.d(Q([n,"clippingPlaneEdgeColor"],[this,"clippingPlaneEdgeColor"])),this.d(Q([n,"clippingPlaneEdgeWidth"],[this,"clippingPlaneEdgeWidth"])),this.d(Q([n,"materialParams"],[this,"materialParams"])),this.d(mt([n,"supportEdit"],[this,"supportEdit"])),this.d(mt([n,"clippingPlanesId"],[this,"clippingPlanesId"])),this.d(mt([n,"clippingPlaneIds"],[this,"clippingPlaneIds"])),this.d(mt([n,"flattenedPlaneId"],[this,"flattenedPlaneId"])),this.d(mt([n,"flattenedPlaneEnabled"],[this,"flattenedPlaneEnabled"])),this.d(mt([n,"clippingPlaneId"],[this,"clippingPlaneId"])),this.d(mt([n,"excavateId"],[this,"excavateId"]))}{const n=this._es3DTileset;this.d(this.refreshTilesetEvent.don(()=>{n.refreshTileset()})),this.d(this.highlightFeatureEvent.don((...s)=>{n.highlightFeature(...s)})),this.d(this.highlightFeatureAndFlyToEvent.don((...s)=>{n.highlightFeatureAndFlyTo(...s)})),this.d(this.setFeatureColorEvent.don((...s)=>{n.setFeatureColor(...s)})),this.d(this.setFeatureVisableEvent.don((...s)=>{n.setFeatureVisable(...s)})),this.d(this.resetFeatureStyleEvent.don((...s)=>{n.resetFeatureStyle(...s)})),this.d(this.setFeatureStyleEvent.don((...s)=>{n.setFeatureStyle(...s)})),this.d(this.flyInEvent.don((...s)=>{n.flyIn(s[0])})),this.d(this.flyToEvent.don((...s)=>{n.flyTo(s[0])})),this.d(this.calcFlyToParamEvent.don((...s)=>{n.calcFlyToParam(...s)})),this.d(this.calcFlyInParamEvent.don((...s)=>{n.calcFlyInParam(...s)}))}{const n=this._es3DTileset;this.d(n.tilesetReady.don(s=>{this.tilesetReady.emit(s)})),this.d(n.pickedEvent.don(s=>{s.assign({sceneObject:this}),this.pickedEvent.emit(s)}))}{const n=()=>{this.es3DTileset.show=this.show};n(),this.d(this.showChanged.don(()=>{n()}))}}get es3DTileset(){return this._es3DTileset}get ids(){return this._ids.value}get idsChanged(){return this._ids.changed}set ids(t){this._ids.value=t}get platform(){return this._platform.value}get platformChanged(){return this._platform.changed}set platform(t){this._platform.value=t}get visJson(){return this._visJson.value}set visJson(t){this._visJson.value=t}get visJsonChanged(){return this._visJson.changed}setFeatureVisable(t,n){var s;if((s=this.layerConfig)!=null&&s.length){const o={};o[n[0].value]=n[0].visable,this.visJson={...this.visJson,...o}}else this.setFeatureVisableEvent.emit(t,typeof n=="string"?JSON.parse(n):n,!0)}async getFeatureProperty(t){return await zy(this.baseUrl,this.tileServiceName,t,this.useEarthDSToken,this.earthdstoken,this.platform)}async getLayerConfig(){const t=await Gy(this.baseUrl,this.tileServiceName,this.useEarthDSToken,this.earthdstoken,this.platform);return!t||!Array.isArray(t)?this.layerConfig=[]:this.layerConfig=t,this.layerConfig}async saveLayerConfig(){const t=this.layerConfig;return await jy(this.baseUrl,this.tileServiceName,this.useEarthDSToken,this.earthdstoken,t,this.platform)}get highlightInner3DtilesetEvent(){return this._highlightInner3DtilesetEvent}_highlightInner3Dtileset(t){this._highlightInner3DtilesetEvent.emit(t)}async highlightDSFeature(t){this._highlightInner3Dtileset(t)}get removeHighlightInner3DtilesetEvent(){return this._removeHighlightInner3DtilesetEvent}_removeHighlightInner3Dtileset(t){this._removeHighlightInner3DtilesetEvent.emit(t)}async removeHighlightDSFeature(t){this._removeHighlightInner3Dtileset(t)}async pickFeature(t,n){var l,d,f;const s=await t.pick(n),o=s.sceneObject;return!o||o.id!==this.id&&o.typeName!="ESRtsFeatureEditing"?void 0:o.typeName!="ESRtsFeatureEditing"?(this.ids=[...this.ids,(l=s==null?void 0:s.tilesetPickInfo)==null?void 0:l.id],{featureId:(d=s==null?void 0:s.tilesetPickInfo)==null?void 0:d.id,pickInnerFields:s==null?void 0:s.tilesetPickInfo}):{featureId:(f=s==null?void 0:s.sceneObject)==null?void 0:f.id,pickInnerFields:s==null?void 0:s.tilesetPickInfo}}get tilesetServePort(){return this._tilesetServePort.value}get tilesetServePortChanged(){return this._tilesetServePort.changed}set tilesetServePort(t){this._tilesetServePort.value=t}async getport(){const t=await By(yu(this.url),this.useEarthDSToken,this.earthdstoken);if(t)return this.tilesetServePort=t,t;throw new Error("服务地址port获取失败!")}async refresh(){if(!this.url||typeof this.url!="string")return;const t=+new Date,n=_u(this.url);n&&(this.syncPlatformFromUrl(),this._es3DTileset.offset=[0,0,0],this._es3DTileset.rotation=[0,0,0],this._es3DTileset.url=Ly(n,this.platform,this.tileServiceName,t),console.log("3dtileset url:",this._es3DTileset.url))}syncPlatformFromUrl(){if(typeof this.url!="string"||!this.url)return;const t=Ay(this.url);t&&t!==this.platform&&(this._platform.value=t)}get baseUrl(){if(this.url&&typeof this.url=="string"){const t=_u(this.url);if(!t)throw new Error("服务地址不合法,baseUrl is not found! 示例: http://localhost:9009/ts/info/ts01 或 /ts/info/ts01");return t}else throw new Error("服务地址不合法,baseUrl is not found! 示例: http://localhost:9009/ts/info/ts01 或 /ts/info/ts01")}get tileServiceName(){if(this.url&&typeof this.url=="string"){const t=Dy(this.url);if(!t)throw console.log(this.url),new Error("服务地址不合法,tileServiceName is not found! 示例: http://localhost:9009/ts/info/ms01 或 http://localhost:9109/cim/ts/info/ms01");return t}else throw new Error("服务地址不合法,tileServiceName is not found! 示例: http://localhost:9009/ts/info/ms01 或 http://localhost:9109/cim/ts/info/ms01")}get tileServiceIp(){if(this.url&&typeof this.url=="string"){const t=Ry(this.url);if(!t)throw new Error("服务地址不合法,ip is not found! 示例: http://localhost:9009/ts/info/ts01 或 /ts/info/ts01");return t}else throw new Error("服务地址不合法,ip is not found! 示例: http://localhost:9009/ts/info/ts01 或 /ts/info/ts01")}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new ue([this,"layerConfig"],"图层配置",[],void 0,!0)]}}};p(Za,"createDefaultProps",()=>({...bi.createDefaultProps(),layerConfig:re([]),isSameIP:!1,useEarthDSToken:!1,earthdstoken:""})),p(Za,"type",Za.register("ESRtsTileset",Za,{chsName:"CIMRTS实时3DTileset图层",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:`ESRtsTileset 是用于加载和管理实时3DTileset图层并提供要素高亮与拾取功能的对象。
|
|
1016
|
+
`}));let $f=Ka;function Ny(i){return i.startsWith("/")&&!i.startsWith("//")}function yu(i){var e;return!i||/^https?:\/\//i.test(i)?i:Ny(i)&&typeof window<"u"&&((e=window.location)!=null&&e.origin)?`${window.location.origin}${i}`:i}function _u(i){var t;return(t=yu(i).match(/^(https?:\/\/[^/]+)/i))==null?void 0:t[1]}function Ry(i){var t;return(t=yu(i).match(/^(https?:\/\/[^:]+)/i))==null?void 0:t[1]}function dr(i){return i==="CesiumlabDesktop"?"/cim":""}function Ay(i){if(/\/cim\/ts\//.test(i))return"CesiumlabDesktop";if(/\/ts\/(?:info|tiles|featuretiles)\//.test(i))return"CIMRTS"}function Dy(i){const e=i.match(/(?:\/cim)?\/ts\/info\/([^?/]+)/);return e==null?void 0:e[1]}function Bk(i,e,t){const n=dr(e);return`${i}${n}/ts/info/${t}`}function Ly(i,e,t,n=Date.now()){const s=dr(e);return`${i}${s}/ts/tiles/${t}/tileset.json?t=${n}`}function Fy(i,e,t,n){const s=dr(e);return`${i}${s}/ts/featuretiles/${t}/${n}/tileset.json`}const wu={layerconfigfind:"/ts/layer/config/get",layerconfigsave:"/ts/layer/config/put",featureproperty:"/ts/editor/property",featureeditormuti:"/ts/editor/update",getts:"/ts/info"},Gy=async(i,e,t,n,s="CIMRTS")=>{try{const o=window.localStorage.getItem("Authorization"),h=dr(s);let l=i+`${h}${wu.layerconfigfind}?tileServiceName=${e}`;t&&(l+=`&earthdstoken=${encodeURIComponent(n)}`);const d={headers:{...!t&&o?{Authorization:o}:{}},mode:"cors"},v=await(await fetch(l,d)).text();return JSON.parse(v)}catch(o){console.error(o)}},jy=async(i,e,t,n,s,o="CIMRTS")=>{try{const h=window.localStorage.getItem("Authorization"),l=dr(o);let d=i+`${l}${wu.layerconfigsave}`;const f=s??{};t&&(d+=`?earthdstoken=${encodeURIComponent(n)}`);const v={method:"POST",headers:{"Content-Type":"application/json",...!t&&h?{Authorization:h}:{}},mode:"cors",body:JSON.stringify({tileServiceName:e,layerConfig:JSON.stringify(f)})},y=await(await fetch(d,v)).text();return JSON.parse(y)}catch(h){console.error(h)}},By=async(i,e,t)=>{try{const n=window.localStorage.getItem("Authorization");let s=i;e&&(s+=`?earthdstoken=${encodeURIComponent(t)}`);const o={headers:{...!e&&n?{Authorization:n}:{}},mode:"cors"},l=await(await fetch(s,o)).text(),d=JSON.parse(l);if(d.status=="ok")return d.data.port;console.error(d.status);return}catch(n){console.error(n)}},zy=async(i,e,t,n,s,o="CIMRTS")=>{try{const h={tileServiceName:e,featureId:t},l=window.localStorage.getItem("Authorization"),d=dr(o);let f=i+`${d}${wu.featureproperty}`;n&&(f+=`?earthdstoken=${encodeURIComponent(s)}`);const m=await(await fetch(f,{method:"post",headers:{"Content-Type":"application/json",...!n&&l?{Authorization:l}:{}},body:JSON.stringify(h),mode:"cors"})).text(),y=JSON.parse(m);if(y.status=="ok")return y.data;console.error(y.data.status);return}catch(h){console.error(h)}},Za=class Za extends bi{constructor(t){super(t);p(this,"_es3DTileset",this.dv(new bi));p(this,"_ids",this.dv(At([])));p(this,"_platform",this.dv(it("CIMRTS")));p(this,"_visJson",this.disposeVar(it({})));p(this,"_highlightInner3DtilesetEvent",this.dv(new H));p(this,"_removeHighlightInner3DtilesetEvent",this.dv(new H));p(this,"_tilesetServePort",this.dv(it("")));this.collision=!1;{const n=async()=>{if(typeof this.url!="string"){console.error("服务地址不合法, Init Error! 示例: http://localhost:9009/ts/info/ts01 或 /ts/info/ts01");return}this.url?(this.syncPlatformFromUrl(),this.refresh()):this._es3DTileset.url=""};this.d(this.urlChanged.don(()=>{n()})),this.d(this.platformChanged.don(()=>{n()}))}{this.d(this.components.disposableAdd(this._es3DTileset,!0));const n=this._es3DTileset;this.d(Q([n,"allowPicking"],[this,"allowPicking"])),this.d(Q([n,"collision"],[this,"collision"])),this.d(mt([n,"flyToParam"],[this,"flyToParam"])),this.d(Q([n,"actorTag"],[this,"actorTag"])),this.d(Q([n,"materialMode"],[this,"materialMode"])),this.d(Q([n,"highlight"],[this,"highlight"])),this.d(Q([n,"maximumScreenSpaceError"],[this,"maximumScreenSpaceError"])),this.d(Q([n,"highlightID"],[this,"highlightID"])),this.d(Q([n,"highlightColor"],[this,"highlightColor"])),this.d(mt([n,"offset"],[this,"offset"])),this.d(mt([n,"rotation"],[this,"rotation"])),this.d(Q([n,"czmImageBasedLightingFactor"],[this,"czmImageBasedLightingFactor"])),this.d(Q([n,"czmLuminanceAtZenith"],[this,"czmLuminanceAtZenith"])),this.d(Q([n,"czmMaximumMemoryUsage"],[this,"czmMaximumMemoryUsage"])),this.d(Q([n,"czmClassificationType"],[this,"czmClassificationType"])),this.d(Q([n,"czmStyleJson"],[this,"czmStyleJson"])),this.d(Q([n,"czmBackFaceCulling"],[this,"czmBackFaceCulling"])),this.d(Q([n,"czmDebugShowBoundingVolume"],[this,"czmDebugShowBoundingVolume"])),this.d(Q([n,"czmDebugShowContentBoundingVolume"],[this,"czmDebugShowContentBoundingVolume"])),this.d(Q([n,"czmSkipLevelOfDetail"],[this,"czmSkipLevelOfDetail"])),this.d(Q([n,"colorBlendMode"],[this,"colorBlendMode"])),this.d(Q([n,"cacheBytes"],[this,"cacheBytes"])),this.d(Q([n,"clippingPlaneEnabled"],[this,"clippingPlaneEnabled"])),this.d(Q([n,"unionClippingRegions"],[this,"unionClippingRegions"])),this.d(Q([n,"clippingPlaneEdgeColor"],[this,"clippingPlaneEdgeColor"])),this.d(Q([n,"clippingPlaneEdgeWidth"],[this,"clippingPlaneEdgeWidth"])),this.d(Q([n,"materialParams"],[this,"materialParams"])),this.d(mt([n,"supportEdit"],[this,"supportEdit"])),this.d(mt([n,"clippingPlanesId"],[this,"clippingPlanesId"])),this.d(mt([n,"clippingPlaneIds"],[this,"clippingPlaneIds"])),this.d(mt([n,"flattenedPlaneId"],[this,"flattenedPlaneId"])),this.d(mt([n,"flattenedPlaneEnabled"],[this,"flattenedPlaneEnabled"])),this.d(mt([n,"clippingPlaneId"],[this,"clippingPlaneId"])),this.d(mt([n,"excavateId"],[this,"excavateId"]))}{const n=this._es3DTileset;this.d(this.refreshTilesetEvent.don(()=>{n.refreshTileset()})),this.d(this.highlightFeatureEvent.don((...s)=>{n.highlightFeature(...s)})),this.d(this.highlightFeatureAndFlyToEvent.don((...s)=>{n.highlightFeatureAndFlyTo(...s)})),this.d(this.setFeatureColorEvent.don((...s)=>{n.setFeatureColor(...s)})),this.d(this.setFeatureVisableEvent.don((...s)=>{n.setFeatureVisable(...s)})),this.d(this.resetFeatureStyleEvent.don((...s)=>{n.resetFeatureStyle(...s)})),this.d(this.setFeatureStyleEvent.don((...s)=>{n.setFeatureStyle(...s)})),this.d(this.flyInEvent.don((...s)=>{n.flyIn(s[0])})),this.d(this.flyToEvent.don((...s)=>{n.flyTo(s[0])})),this.d(this.calcFlyToParamEvent.don((...s)=>{n.calcFlyToParam(...s)})),this.d(this.calcFlyInParamEvent.don((...s)=>{n.calcFlyInParam(...s)}))}{const n=this._es3DTileset;this.d(n.tilesetReady.don(s=>{this.tilesetReady.emit(s)})),this.d(n.pickedEvent.don(s=>{s.assign({sceneObject:this}),this.pickedEvent.emit(s)}))}{const n=()=>{this.es3DTileset.show=this.show};n(),this.d(this.showChanged.don(()=>{n()}))}}get es3DTileset(){return this._es3DTileset}get ids(){return this._ids.value}get idsChanged(){return this._ids.changed}set ids(t){this._ids.value=t}get platform(){return this._platform.value}get platformChanged(){return this._platform.changed}set platform(t){this._platform.value=t}get visJson(){return this._visJson.value}set visJson(t){this._visJson.value=t}get visJsonChanged(){return this._visJson.changed}setFeatureVisable(t,n){var s;if((s=this.layerConfig)!=null&&s.length){const o={};o[n[0].value]=n[0].visable,this.visJson={...this.visJson,...o}}else this.setFeatureVisableEvent.emit(t,typeof n=="string"?JSON.parse(n):n,!0)}async getFeatureProperty(t){return await zy(this.baseUrl,this.tileServiceName,t,this.useEarthDSToken,this.earthdstoken,this.platform)}async getLayerConfig(){const t=await Gy(this.baseUrl,this.tileServiceName,this.useEarthDSToken,this.earthdstoken,this.platform);return!t||!Array.isArray(t)?this.layerConfig=[]:this.layerConfig=t,this.layerConfig}async saveLayerConfig(){const t=this.layerConfig;return await jy(this.baseUrl,this.tileServiceName,this.useEarthDSToken,this.earthdstoken,t,this.platform)}get highlightInner3DtilesetEvent(){return this._highlightInner3DtilesetEvent}_highlightInner3Dtileset(t){this._highlightInner3DtilesetEvent.emit(t)}async highlightDSFeature(t){this._highlightInner3Dtileset(t)}get removeHighlightInner3DtilesetEvent(){return this._removeHighlightInner3DtilesetEvent}_removeHighlightInner3Dtileset(t){this._removeHighlightInner3DtilesetEvent.emit(t)}async removeHighlightDSFeature(t){this._removeHighlightInner3Dtileset(t)}async pickFeature(t,n){var l,d,f;const s=await t.pick(n),o=s.sceneObject;return!o||o.id!==this.id&&o.typeName!="ESRtsFeatureEditing"?void 0:o.typeName!="ESRtsFeatureEditing"?(this.ids=[...this.ids,(l=s==null?void 0:s.tilesetPickInfo)==null?void 0:l.id],{featureId:(d=s==null?void 0:s.tilesetPickInfo)==null?void 0:d.id,pickInnerFields:s==null?void 0:s.tilesetPickInfo}):{featureId:(f=s==null?void 0:s.sceneObject)==null?void 0:f.id,pickInnerFields:s==null?void 0:s.tilesetPickInfo}}get tilesetServePort(){return this._tilesetServePort.value}get tilesetServePortChanged(){return this._tilesetServePort.changed}set tilesetServePort(t){this._tilesetServePort.value=t}async getport(){const t=await By(yu(this.url),this.useEarthDSToken,this.earthdstoken);if(t)return this.tilesetServePort=t,t;throw new Error("服务地址port获取失败!")}async refresh(){if(!this.url||typeof this.url!="string")return;const t=+new Date,n=_u(this.url);n&&(this.syncPlatformFromUrl(),this._es3DTileset.offset=[0,0,0],this._es3DTileset.rotation=[0,0,0],this._es3DTileset.url=Ly(n,this.platform,this.tileServiceName,t),console.log("3dtileset url:",this._es3DTileset.url))}syncPlatformFromUrl(){if(typeof this.url!="string"||!this.url)return;const t=Ay(this.url);t&&t!==this.platform&&(this._platform.value=t)}get baseUrl(){if(this.url&&typeof this.url=="string"){const t=_u(this.url);if(!t)throw new Error("服务地址不合法,baseUrl is not found! 示例: http://localhost:9009/ts/info/ts01 或 /ts/info/ts01");return t}else throw new Error("服务地址不合法,baseUrl is not found! 示例: http://localhost:9009/ts/info/ts01 或 /ts/info/ts01")}get tileServiceName(){if(this.url&&typeof this.url=="string"){const t=Dy(this.url);if(!t)throw console.log(this.url),new Error("服务地址不合法,tileServiceName is not found! 示例: http://localhost:9009/ts/info/ms01 或 http://localhost:9109/cim/ts/info/ms01");return t}else throw new Error("服务地址不合法,tileServiceName is not found! 示例: http://localhost:9009/ts/info/ms01 或 http://localhost:9109/cim/ts/info/ms01")}get tileServiceIp(){if(this.url&&typeof this.url=="string"){const t=Ry(this.url);if(!t)throw new Error("服务地址不合法,ip is not found! 示例: http://localhost:9009/ts/info/ts01 或 /ts/info/ts01");return t}else throw new Error("服务地址不合法,ip is not found! 示例: http://localhost:9009/ts/info/ts01 或 /ts/info/ts01")}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new ue([this,"layerConfig"],"图层配置",[],void 0,!0)]}}};p(Za,"createDefaultProps",()=>({...bi.createDefaultProps(),layerConfig:se([]),isSameIP:!1,useEarthDSToken:!1,earthdstoken:""})),p(Za,"type",Za.register("ESRtsTileset",Za,{chsName:"CIMRTS实时3DTileset图层",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:`ESRtsTileset 是用于加载和管理实时3DTileset图层并提供要素高亮与拾取功能的对象。
|
|
1017
1017
|
对象json示例:
|
|
1018
1018
|
{
|
|
1019
1019
|
"id": "rtstileset_xxx",
|
|
@@ -1021,7 +1021,7 @@ ${If}
|
|
|
1021
1021
|
"name": "CIMRTS实时3DTileset图层",
|
|
1022
1022
|
"url": "http://localhost:9009/ts/info/ts01"
|
|
1023
1023
|
}
|
|
1024
|
-
`}));let Wf=Za;function zk(i){return typeof i=="number"&&!isNaN(i)}const Qa=class Qa extends bi{get json(){return{...this._innerGetJson(),show:this.show,materials:this.materials,changeMaterial:this.changeMaterial,props:this.props,rotation:this.rotation,offset:this.offset}}set json(e){this._innerSetJson(e)}async init(e,t){this.featureId=t;const n=await e.getFeatureProperty(t);this.uiShowprops=n.props.map(l=>({featureClassName:l.name,fields:l.props?l.props.map(d=>({key:d.name,type:d.type,value:d.type!="double"?d.value:zk(d.value)?Number(d.value.toFixed(3)):""})):[]})),this.datasetName=n.datasetName,e.setFeatureVisable("id",[{value:this.featureId,visable:!1}]),this.d(()=>{e.setFeatureVisable("id",[{value:this.featureId,visable:!0}])});const s=typeof e.url=="string"?e.url:"",o=_u(s),h=e.tileServiceName;if(!o)throw new Error("ESRtsFeatureEditing: 无法解析服务地址");this.url=Fy(o,e.platform,h,this.featureId),this.allowPicking=!0,this.d(this.pickedEvent.don(l=>{l.assign({sceneObject:e}),e.pickedEvent.emit(l)})),this.d(()=>{this.editing=!1,e.removeHighlightDSFeature(this)})}constructor(e){super(e)}};p(Qa,"createDefaultProps",()=>({...bi.createDefaultProps(),datasetName:void 0,featureId:void 0,materials:At({}),changeMaterial:
|
|
1024
|
+
`}));let Wf=Za;function zk(i){return typeof i=="number"&&!isNaN(i)}const Qa=class Qa extends bi{get json(){return{...this._innerGetJson(),show:this.show,materials:this.materials,changeMaterial:this.changeMaterial,props:this.props,rotation:this.rotation,offset:this.offset}}set json(e){this._innerSetJson(e)}async init(e,t){this.featureId=t;const n=await e.getFeatureProperty(t);this.uiShowprops=n.props.map(l=>({featureClassName:l.name,fields:l.props?l.props.map(d=>({key:d.name,type:d.type,value:d.type!="double"?d.value:zk(d.value)?Number(d.value.toFixed(3)):""})):[]})),this.datasetName=n.datasetName,e.setFeatureVisable("id",[{value:this.featureId,visable:!1}]),this.d(()=>{e.setFeatureVisable("id",[{value:this.featureId,visable:!0}])});const s=typeof e.url=="string"?e.url:"",o=_u(s),h=e.tileServiceName;if(!o)throw new Error("ESRtsFeatureEditing: 无法解析服务地址");this.url=Fy(o,e.platform,h,this.featureId),this.allowPicking=!0,this.d(this.pickedEvent.don(l=>{l.assign({sceneObject:e}),e.pickedEvent.emit(l)})),this.d(()=>{this.editing=!1,e.removeHighlightDSFeature(this)})}constructor(e){super(e)}};p(Qa,"createDefaultProps",()=>({...bi.createDefaultProps(),datasetName:void 0,featureId:void 0,materials:At({}),changeMaterial:se(void 0),uiShowprops:At({}),props:At({})})),p(Qa,"type",Qa.register("ESRtsFeatureEditing",Qa,{chsName:"ESRtsFeatureEditing",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"ESRtsFeatureEditing"}));let Hf=Qa;const Uk=async(i,e,t)=>{try{const n=window.localStorage.getItem("Authorization");let s=i;e&&(s+=`?earthdstoken=${encodeURIComponent(t)}`);const o={headers:{...!e&&n?{Authorization:n}:{}},mode:"cors"},l=await(await fetch(s,o)).text(),d=JSON.parse(l);if(d.status=="ok")return d.data.port;console.error(d.status);return}catch(n){console.error(n)}};function Vk(i){return i==="CesiumlabDesktop"?"/osgb":""}function qk(i){if(/\/osgb\/ts\//.test(i))return"CesiumlabDesktop";if(/\/ts\/(?:info|tiles|featuretiles)\//.test(i))return"CIMRTS"}function Uy(i){const e=i.match(/(?:\/osgb)?\/ts\/info\/([^?/]+)/);return e==null?void 0:e[1]}function $k(i,e,t,n=Date.now()){const s=Vk(t);return`${i}:${e}${s}/tiles/tileset.json?t=${n}`}const to=class to extends bi{constructor(t){super(t);p(this,"_es3DTileset",this.dv(new bi));p(this,"_platform",this.dv(it("CIMRTS")));p(this,"_tilesetServePort",this.dv(it("")));this.collision=!1;{const n=async()=>{if(typeof this.url!="string"){console.error("服务地址不合法, Init Error! 示例: http://localhost:9009/ts/info/ms01");return}this.url?(this.syncPlatformFromUrl(),this.refresh()):this._es3DTileset.url=""};this.d(this.urlChanged.don(()=>{n()})),this.d(this.platformChanged.don(()=>{n()}))}{this.d(this.components.disposableAdd(this._es3DTileset,!0));const n=this._es3DTileset;this.d(Q([n,"allowPicking"],[this,"allowPicking"])),this.d(Q([n,"collision"],[this,"collision"])),this.d(mt([n,"flyToParam"],[this,"flyToParam"])),this.d(Q([n,"actorTag"],[this,"actorTag"])),this.d(Q([n,"materialMode"],[this,"materialMode"])),this.d(Q([n,"highlight"],[this,"highlight"])),this.d(Q([n,"maximumScreenSpaceError"],[this,"maximumScreenSpaceError"])),this.d(Q([n,"highlightID"],[this,"highlightID"])),this.d(Q([n,"highlightColor"],[this,"highlightColor"])),this.d(mt([n,"offset"],[this,"offset"])),this.d(mt([n,"rotation"],[this,"rotation"])),this.d(Q([n,"czmImageBasedLightingFactor"],[this,"czmImageBasedLightingFactor"])),this.d(Q([n,"czmLuminanceAtZenith"],[this,"czmLuminanceAtZenith"])),this.d(Q([n,"czmMaximumMemoryUsage"],[this,"czmMaximumMemoryUsage"])),this.d(Q([n,"czmClassificationType"],[this,"czmClassificationType"])),this.d(Q([n,"czmStyleJson"],[this,"czmStyleJson"])),this.d(Q([n,"czmBackFaceCulling"],[this,"czmBackFaceCulling"])),this.d(Q([n,"czmDebugShowBoundingVolume"],[this,"czmDebugShowBoundingVolume"])),this.d(Q([n,"czmDebugShowContentBoundingVolume"],[this,"czmDebugShowContentBoundingVolume"])),this.d(Q([n,"czmSkipLevelOfDetail"],[this,"czmSkipLevelOfDetail"])),this.d(Q([n,"colorBlendMode"],[this,"colorBlendMode"])),this.d(Q([n,"cacheBytes"],[this,"cacheBytes"])),this.d(Q([n,"clippingPlaneEnabled"],[this,"clippingPlaneEnabled"])),this.d(Q([n,"unionClippingRegions"],[this,"unionClippingRegions"])),this.d(Q([n,"clippingPlaneEdgeColor"],[this,"clippingPlaneEdgeColor"])),this.d(Q([n,"clippingPlaneEdgeWidth"],[this,"clippingPlaneEdgeWidth"])),this.d(Q([n,"materialParams"],[this,"materialParams"])),this.d(mt([n,"supportEdit"],[this,"supportEdit"])),this.d(mt([n,"clippingPlanesId"],[this,"clippingPlanesId"])),this.d(mt([n,"clippingPlaneIds"],[this,"clippingPlaneIds"])),this.d(mt([n,"flattenedPlaneId"],[this,"flattenedPlaneId"])),this.d(mt([n,"flattenedPlaneEnabled"],[this,"flattenedPlaneEnabled"])),this.d(mt([n,"clippingPlaneId"],[this,"clippingPlaneId"])),this.d(mt([n,"excavateId"],[this,"excavateId"]))}{const n=this._es3DTileset;this.d(this.refreshTilesetEvent.don(()=>{n.refreshTileset()})),this.d(this.highlightFeatureEvent.don((...s)=>{n.highlightFeature(...s)})),this.d(this.highlightFeatureAndFlyToEvent.don((...s)=>{n.highlightFeatureAndFlyTo(...s)})),this.d(this.setFeatureColorEvent.don((...s)=>{n.setFeatureColor(...s)})),this.d(this.setFeatureVisableEvent.don((...s)=>{n.setFeatureVisable(...s)})),this.d(this.resetFeatureStyleEvent.don((...s)=>{n.resetFeatureStyle(...s)})),this.d(this.setFeatureStyleEvent.don((...s)=>{n.setFeatureStyle(...s)})),this.d(this.flyInEvent.don((...s)=>{n.flyIn(s[0])})),this.d(this.flyToEvent.don((...s)=>{n.flyTo(s[0])})),this.d(this.calcFlyToParamEvent.don((...s)=>{n.calcFlyToParam(...s)})),this.d(this.calcFlyInParamEvent.don((...s)=>{n.calcFlyInParam(...s)}))}{const n=this._es3DTileset;this.d(n.tilesetReady.don(s=>{this.tilesetReady.emit(s)})),this.d(n.pickedEvent.don(s=>{s.assign({sceneObject:this}),this.pickedEvent.emit(s)}))}{const n=()=>{this.es3DTileset.show=this.show};n(),this.d(this.showChanged.don(()=>{n()}))}}get es3DTileset(){return this._es3DTileset}get platform(){return this._platform.value}get platformChanged(){return this._platform.changed}set platform(t){this._platform.value=t}get tilesetServePort(){return this._tilesetServePort.value}get tilesetServePortChanged(){return this._tilesetServePort.changed}set tilesetServePort(t){this._tilesetServePort.value=t}async getport(){const t=await Uk(this.url,this.useEarthDSToken,this.earthdstoken);if(t)return this.tilesetServePort=t,t;throw new Error("服务地址port获取失败!")}async refresh(){if(!this.url||typeof this.url!="string"||!Uy(this.url))return;const n=+new Date;this.syncPlatformFromUrl();const s=await this.getport(),o=this.tileServiceIp;this._es3DTileset.offset=[0,0,0],this._es3DTileset.rotation=[0,0,0],this._es3DTileset.url=$k(o,s,this.platform,n),console.log("3dtileset url:",this._es3DTileset.url)}syncPlatformFromUrl(){if(typeof this.url!="string"||!this.url)return;const t=qk(this.url);t&&t!==this.platform&&(this._platform.value=t)}get baseUrl(){var t;if(this.url&&typeof this.url=="string"){const n=(t=this.url.match(/^(https?:\/\/[^\/]+)/))==null?void 0:t[1];if(!n)throw new Error("服务地址不合法,baseUrl is not found! 示例: http://localhost:9009/ts/info/ms01");return n}else throw new Error("服务地址不合法,baseUrl is not found! 示例: http://localhost:9009/ts/info/ms01")}get tileServiceIp(){var t;if(this.url&&typeof this.url=="string"){const n=(t=this.url.match(/^(https?:\/\/[^:]+)/))==null?void 0:t[1];if(!n)throw new Error("服务地址不合法,ip is not found! 示例: http://localhost:9009/ts/info/ms01");return n}else throw new Error("服务地址不合法,ip is not found! 示例: http://localhost:9009/ts/info/ms01")}get tileServiceName(){if(this.url&&typeof this.url=="string"){const t=Uy(this.url);if(!t)throw console.log(this.url),new Error("服务地址不合法,tileServiceName is not found! 示例: http://localhost:9009/ts/info/ms01 或 http://localhost:9109/osgb/ts/info/ms01");return t}else throw new Error("服务地址不合法,tileServiceName is not found! 示例: http://localhost:9009/ts/info/ms01 或 http://localhost:9109/osgb/ts/info/ms01")}};p(to,"createDefaultProps",()=>({...bi.createDefaultProps(),isSameIP:!1,useEarthDSToken:!1,earthdstoken:""})),p(to,"type",to.register("ESMsTileset",to,{chsName:"Modelser实时3DTileset图层",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:`ESMsTileset 是用于加载和操作 Modelser 实时 3D Tiles 图层的对象。
|
|
1025
1025
|
对象json示例:
|
|
1026
1026
|
{
|
|
1027
1027
|
"id": "mstileset_xxx",
|
|
@@ -1042,7 +1042,7 @@ ${If}
|
|
|
1042
1042
|
hiddenDistance: number
|
|
1043
1043
|
}
|
|
1044
1044
|
\`\`\`
|
|
1045
|
-
`},Tr=class Tr extends Ht{constructor(e){super(e)}getESProperties(){const e={...super.getESProperties()};return{...e,more:[...e.more,new yt("通用"),new Mt([this,"url"],"路径"),new ue([this,"poiTypes"],Tr.defaults.poiTypes,Vy.sampleValue),new q([this,"heightOffset"])]}}};p(Tr,"createDefaultProps",()=>({...Ht.createDefaultProps(),url:"",poiTypes:
|
|
1045
|
+
`},Tr=class Tr extends Ht{constructor(e){super(e)}getESProperties(){const e={...super.getESProperties()};return{...e,more:[...e.more,new yt("通用"),new Mt([this,"url"],"路径"),new ue([this,"poiTypes"],Tr.defaults.poiTypes,Vy.sampleValue),new q([this,"heightOffset"])]}}};p(Tr,"createDefaultProps",()=>({...Ht.createDefaultProps(),url:"",poiTypes:se(Vy.defaultValue),heightOffset:40})),p(Tr,"type",Tr.register("ESPoiTileset",Tr,{chsName:"ESPoiTileset",tags:["ESObjects","_ES_Impl_UE"],description:`ESPoiTileset 是用于管理和渲染三维场景中 POI(兴趣点)瓦片集数据的可视化对象。
|
|
1046
1046
|
对象json示例:
|
|
1047
1047
|
{
|
|
1048
1048
|
"id": "poitileset_xxx",
|
|
@@ -1077,7 +1077,7 @@ ${If}
|
|
|
1077
1077
|
"points": [[116.39, 39.9, 0], [116.40, 39.9, 0], [116.40, 39.91, 0]],
|
|
1078
1078
|
"maxHeight": 200
|
|
1079
1079
|
}
|
|
1080
|
-
`})),p(kr,"supportEditingModes",[...Jt.supportEditingModes,dt.HeightModify]);let Kf=kr;const gn=class gn extends Ht{constructor(t){super(t);p(this,"_widgetEvent",this.dv(new H));p(this,"_data",this.dv(it(void 0)));{const n=()=>{this.url&&(typeof this.url=="object"?this.data=this.url:Nc(this.url)?this.data=JSON.parse(this.url):fetch(St.context.getStrFromEnv(this.url)).then(s=>s.json()).then(s=>{this.data=s}).catch(s=>{console.warn("ESEntityCluster数据加载失败",s)}))};n(),this.d(this.urlChanged.don(n))}}get widgetEvent(){return this._widgetEvent}get data(){return this._data.value}set data(t){this._data.value=t}get dataChanged(){return this._data.changed}getFeatures(){if(this._data)return this._data;console.log("数据未加载完成,请稍后重试")}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new Mt([this,"url"],"地址",gn.defaults.url),new q([this,"pixelRange"],"集合范围",gn.defaults.pixelRange),new q([this,"minimumClusterSize"],"最小数量",gn.defaults.minimumClusterSize),new xt([this,"heightReference"],[["NONE","NONE"],["CLAMP_TO_GROUND","CLAMP_TO_GROUND"],["CLAMP_TO_TERRAIN","CLAMP_TO_TERRAIN"]],"高度模式","NONE")],more:[...t.more,new Mt([this,"style"],"style",gn.defaults.style),new nt([this,"perspective"],"透视效果",gn.defaults.perspective)]}}};p(gn,"createDefaultProps",()=>({...Ht.createDefaultProps(),url:"",pixelRange:200,minimumClusterSize:2,style:
|
|
1080
|
+
`})),p(kr,"supportEditingModes",[...Jt.supportEditingModes,dt.HeightModify]);let Kf=kr;const gn=class gn extends Ht{constructor(t){super(t);p(this,"_widgetEvent",this.dv(new H));p(this,"_data",this.dv(it(void 0)));{const n=()=>{this.url&&(typeof this.url=="object"?this.data=this.url:Nc(this.url)?this.data=JSON.parse(this.url):fetch(St.context.getStrFromEnv(this.url)).then(s=>s.json()).then(s=>{this.data=s}).catch(s=>{console.warn("ESEntityCluster数据加载失败",s)}))};n(),this.d(this.urlChanged.don(n))}}get widgetEvent(){return this._widgetEvent}get data(){return this._data.value}set data(t){this._data.value=t}get dataChanged(){return this._data.changed}getFeatures(){if(this._data)return this._data;console.log("数据未加载完成,请稍后重试")}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new Mt([this,"url"],"地址",gn.defaults.url),new q([this,"pixelRange"],"集合范围",gn.defaults.pixelRange),new q([this,"minimumClusterSize"],"最小数量",gn.defaults.minimumClusterSize),new xt([this,"heightReference"],[["NONE","NONE"],["CLAMP_TO_GROUND","CLAMP_TO_GROUND"],["CLAMP_TO_TERRAIN","CLAMP_TO_TERRAIN"]],"高度模式","NONE")],more:[...t.more,new Mt([this,"style"],"style",gn.defaults.style),new nt([this,"perspective"],"透视效果",gn.defaults.perspective)]}}};p(gn,"createDefaultProps",()=>({...Ht.createDefaultProps(),url:"",pixelRange:200,minimumClusterSize:2,style:se({cluster:[{minValue:2,mode:"SquareV02",style:{}}],nonCluster:{mode:"SquareV03",style:{}}}),heightReference:"NONE",perspective:!1})),p(gn,"type",gn.register("ESEntityCluster",gn,{chsName:"Poi聚合",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:`ESEntityCluster 是用于聚合 POI 标注以提高渲染性能的对象。
|
|
1081
1081
|
对象json示例:
|
|
1082
1082
|
{
|
|
1083
1083
|
"id": "entitycluster_xxx",
|
|
@@ -1278,7 +1278,7 @@ ${Xy}
|
|
|
1278
1278
|
"points": [[116.39, 39.9, 0], [116.40, 39.9, 0], [116.40, 39.91, 0]],
|
|
1279
1279
|
"radius": 10000
|
|
1280
1280
|
}
|
|
1281
|
-
`}));let dg=ao;const os=class os extends Ht{constructor(e){super(e)}getESProperties(){const e=super.getESProperties();return{...e,basic:[...e.basic,new ue([this,"data"],"数据",[],void 0,!0),new Mt([this,"gradient"],"渐变",os.defaults.gradient,void 0,!0),new q([this,"radius"],"半径",os.defaults.radius,void 0,!0),new q([this,"blur"],"模糊",os.defaults.blur,!0),new nt([this,"is3D"],"is3D",!1,!0)]}}};p(os,"createDefaultProps",()=>({...Ht.createDefaultProps(),is3D:it(!1),data:vs([]),gradient:
|
|
1281
|
+
`}));let dg=ao;const os=class os extends Ht{constructor(e){super(e)}getESProperties(){const e=super.getESProperties();return{...e,basic:[...e.basic,new ue([this,"data"],"数据",[],void 0,!0),new Mt([this,"gradient"],"渐变",os.defaults.gradient,void 0,!0),new q([this,"radius"],"半径",os.defaults.radius,void 0,!0),new q([this,"blur"],"模糊",os.defaults.blur,!0),new nt([this,"is3D"],"is3D",!1,!0)]}}};p(os,"createDefaultProps",()=>({...Ht.createDefaultProps(),is3D:it(!1),data:vs([]),gradient:se({".5":"green",".7":"yellow",".95":"red"}),radius:it(10),blur:it(.85)})),p(os,"type",os.register("ESHeatMap",os,{chsName:"热力图",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:`ESHeatMap 是用于在场景中显示热力图的可视化对象。
|
|
1282
1282
|
对象json示例:
|
|
1283
1283
|
{
|
|
1284
1284
|
"id": "heatmap_xxx",
|
|
@@ -1297,14 +1297,14 @@ ${Xy}
|
|
|
1297
1297
|
"points": [[116.39, 39.9, 0], [116.40, 39.9, 0], [116.40, 39.91, 0]],
|
|
1298
1298
|
"pointed": true
|
|
1299
1299
|
}
|
|
1300
|
-
`})),p(Lr,"supportEditingModes",[...Rt.supportEditingModes,dt.ScatterAppend,dt.ScatterModify]);let Mh=Lr;const Qy=async(i,e=[],t)=>{const n=[];for(const s of e){const{coordinates:o}=s.geometry;for(const h of o){const l=await Promise.all(h.map(async d=>{let f=d[2]??0;if(t)if(t.type==="absolute")f=t.height??f;else if(t.type==="relative"){const v=await i.getTerrainHeight([d[0],d[1]])??0;f=(t.height??f)+v}else t.type==="terrain"&&(f=await i.getTerrainHeight([d[0],d[1]])??0);return[d[0],d[1],f]}));n.push({...s,points:l})}}return n},t_=async(i,e=[],t)=>await Promise.all(e.map(async n=>{var d,f,v,m,y,w,S,T,N;const s=((d=n.geometry)==null?void 0:d.x)??((v=(f=n.geometry)==null?void 0:f.coordinates)==null?void 0:v[0]),o=((m=n.geometry)==null?void 0:m.y)??((w=(y=n.geometry)==null?void 0:y.coordinates)==null?void 0:w[1]);let l=((S=n.geometry)==null?void 0:S.z)??((N=(T=n.geometry)==null?void 0:T.coordinates)==null?void 0:N[2])??0;if(t)if(t.type==="absolute")l=t.height??l;else if(t.type==="relative"){const j=await i.getTerrainHeight([s,o])??0;l=(t.height??l)+j}else t.type==="terrain"&&(l=await i.getTerrainHeight([s,o])??0);return{...n,points:[s,o,l]}})),e_=async(i,e=[],t)=>{const n=[];return await Promise.all(e.map(async s=>{const{coordinates:o}=s.geometry;await Promise.all(o.map(async h=>{const l=await Promise.all(h.map(async d=>{let f=d[2]??0;if(t)if(t.type==="absolute")f=t.height??f;else if(t.type==="relative"){const v=await i.getTerrainHeight([d[0],d[1]])??0;f=(t.height??f)+v}else t.type==="terrain"&&(f=await i.getTerrainHeight([d[0],d[1]])??0);return[d[0],d[1],f]}));n.push({...s,points:l})}))})),n};function tO(i){const e=Ce(i),t=Zv(e),n=ud(e,t/2);return[n.geometry.coordinates[0],n.geometry.coordinates[1],n.geometry.coordinates[2]||0]}function eO(i,e){const t=Ce(i),n=Zv(t),s=Math.floor(n/e),o=[];if(o.push(i[0]),s<1)return[i[0]];for(let h=1;h<s;h+=1){const l=ud(t,n*(h/s));o.push([l.geometry.coordinates[0],l.geometry.coordinates[1],l.geometry.coordinates[2]||0])}return o}function iO(i){const e=[...i];JSON.stringify(i[0])!==JSON.stringify(i[i.length-1])&&e.push(i[0]);const t=de([e]),n=Q0(t);return[n.geometry.coordinates[0],n.geometry.coordinates[1],n.geometry.coordinates[2]||0]}function i_(i,e,t){const n=i.dv(new Ia);for(const s in t)s!=="type"&&(n[s]=t[s]);n.position=e,i.d(i.components.disposableAdd(n))}function fg(i,e,t,n){let s=n.textTemplate||n.symbol.text||"";const o=/{{(.*?)}}/;for(;o.test(s);){const v=s.match(o);if(v){const m=v[1].trim(),y=t[`${m}`]||"-";s=s.replace(v[0],y)}}let h=n.symbol;const{minVisibleDistance:l,maxVisibleDistance:d}=n;l&&d&&(h={...h,minVisibleDistance:l,maxVisibleDistance:d});const f={...h,text:s};i_(i,e,f)}function Oa(i,e){const t={width:null,height:null,color:null,opacity:null,rotation:null};return e.forEach(n=>{n.type==="size"?n.axis==="width"?t.width=i[n.field]||null:n.axis==="height"&&(t.height=i[n.field]||null):n.type==="color"?t.color=i[n.field]||null:n.type==="opacity"?t.opacity=i[n.field]||null:n.type==="rotation"&&(t.rotation=i[n.field]||null)}),t}function gg(i,e,t){const s={...e.symbol};if(t&&t.length>0){const o=Oa(i,t);for(let h in o)s[h]!==void 0&&o[h]!==null&&(s[h]=o[h])}return s}function pg(i,e,t){var f,v;const n=e,{uniqueValueInfos:s,field:o,fieldDelimiter:h,defaultSymbol:l}=n;let d={...l};if(Array.isArray(o)){const y=o.map(w=>i[w]??"").join(h);d=((f=s.find(w=>w.value==y))==null?void 0:f.symbol)||l}else d=((v=s.find(m=>m.value==i[o]))==null?void 0:v.symbol)||l;if(t&&t.length>0){const m=Oa(i,t);for(let y in m)d[y]!==void 0&&m[y]!==null&&(d[y]=m[y])}return d}function mg(i,e,t){const n=e,{classBreakInfos:s,field:o,defaultSymbol:h}=n;let l=h;const d=i[o];if(d===void 0||typeof d!="number")l=h;else{const f=s.find(v=>d<=v.maxValue&&d>=v.minValue);f?l=f.symbol:l=h}if(t&&t.length>0){const f=Oa(i,t);for(let v in f)l[v]!==void 0&&f[v]!==null&&(l[v]=f[v])}return l}function nO(i,e){function t(f,v,m,y){const w=D=>D*Math.PI/180,S=D=>D*180/Math.PI,T=w(f),N=w(m),j=w(y-v),C=Math.sin(j)*Math.cos(N),k=Math.cos(T)*Math.sin(N)-Math.sin(T)*Math.cos(N)*Math.cos(j),M=Math.atan2(C,k);return(S(M)+360)%360}function n(f,v,m,y,w){const T=V=>V*Math.PI/180,N=V=>V*180/Math.PI,j=y/6371e3,C=T(w),k=T(f),M=T(v),D=Math.asin(Math.sin(k)*Math.cos(j)+Math.cos(k)*Math.sin(j)*Math.cos(C)),L=M+Math.atan2(Math.sin(C)*Math.sin(j)*Math.cos(k),Math.cos(j)-Math.sin(k)*Math.sin(D));return{lat:N(D),lng:N(L),alt:m}}function s(f){const v=[];f.length>1&&v.push(t(f[0].lat,f[0].lng,f[1].lat,f[1].lng));for(let m=1;m<f.length-1;m++){const y=t(f[m-1].lat,f[m-1].lng,f[m].lat,f[m].lng),w=t(f[m].lat,f[m].lng,f[m+1].lat,f[m+1].lng);let S=(y+w)/2;Math.abs(y-w)>180&&(S=(S+180)%360),v.push(S)}return f.length>1&&v.push(t(f[f.length-2].lat,f[f.length-2].lng,f[f.length-1].lat,f[f.length-1].lng)),f.length===1&&v.push(0),v}if(!i||i.length<2)throw new Error("至少需要两个点才能生成路径");if(e<=0)throw new Error("宽度必须大于0");const o=e/2,h=s(i),l=[],d=[];for(let f=0;f<i.length;f++){const v=(h[f]+90)%360,m=(h[f]+270)%360,y=i[f].alt!==void 0?i[f].alt:0;l.push(n(i[f].lat,i[f].lng,y,o,v)),d.push(n(i[f].lat,i[f].lng,y,o,m))}return l.concat(d.reverse())}function sO(i,e,t,n){function s(T){return T*(Math.PI/180)}const o=6378137,h=s(i),l=s(e),d=s(t),f=s(n),v=d-h,m=f-l,y=Math.sin(v/2)**2+Math.cos(h)*Math.cos(d)*Math.sin(m/2)**2,w=2*Math.atan2(Math.sqrt(y),Math.sqrt(1-y));return o*w}const n_=(i,e,t)=>Array.isArray(e)?e.map(o=>i[o]??"").join(t):i[e]??"";function s_(i,e){const n={...e.symbol};return{points:i.map(s=>s.points),symbol:n}}function r_(i,e){const t=e,{uniqueValueInfos:n,field:s,fieldDelimiter:o,defaultSymbol:h}=t,l=[],d=n.reduce((v,m)=>{const y=m.value.toString();return v[y]={points:[],value:m.value,symbol:m.symbol},v},{});for(let v=0;v<i.length;v++){const m=i[v],y=n_(m,s,o);if(y!==void 0&&y!==""){const w=d[y.toString()];w?w.points.push(m.points):l.push(m.points)}else l.push(m.points)}const f=[];for(let v in d){const{points:m,symbol:y}=d[v];m.length>0&&f.push({points:m,symbol:y})}return l.length>0&&f.push({points:l,symbol:h}),f}function a_(i,e){const t=e,{classBreakInfos:n,field:s,defaultSymbol:o}=t,h=[],l=n.map(f=>({...f,points:[]}));for(let f=0;f<i.length;f++){const v=i[f],m=v[s];if(m===void 0||typeof m!="number")h.push(v.points);else{const y=l.findIndex(w=>m<=w.maxValue&&m>=w.minValue);y!==-1?l[y].points.push(v.points):h.push(v.points)}}const d=[];return l.forEach(f=>{f.points.length>0&&d.push({points:f.points,symbol:f.symbol})}),h.length>0&&d.push({points:h,symbol:o}),d}function rO(i,e,t=[]){const s={...e.symbol},o=i.map(h=>{const l=Oa(h,t);return{position:h.points,rotation:l.rotation||s.rotation||[0,0,0],scale:s.scale||[1,1,1]}});return{url:s.url,locations:o}}function aO(i,e,t=[]){const n=e,{uniqueValueInfos:s,field:o,fieldDelimiter:h}=n,l=n.defaultSymbol,d=[],f=s.reduce((m,y)=>{const w=y.value.toString();return m[w]={locations:[],value:y.value,symbol:y.symbol},m},{});for(let m=0;m<i.length;m++){const y=i[m],w=n_(y,o,h);if(w){const S=f[w.toString()];if(S){const T=Oa(y,t);S.locations.push({position:y.points,rotation:T.rotation||l.rotation||[0,0,0],scale:l.scale||[1,1,1]})}else d.push({position:y.points,rotation:l.rotation||[0,0,0],scale:l.scale||[1,1,1]})}else d.push({position:y.points,rotation:l.rotation||[0,0,0],scale:l.scale||[1,1,1]})}const v=[];for(let m in f){const{locations:y,symbol:w}=f[m];y.length>0&&v.push({url:w.url,locations:y})}return d.length>0&&v.push({url:l.url,locations:d}),v}function oO(i,e,t=[]){const n=e,{classBreakInfos:s,field:o}=n,h=n.defaultSymbol,l=[],d=s.map(v=>({...v,locations:[]}));for(let v=0;v<i.length;v++){const m=i[v],y=m[o];if(y===void 0||typeof y!="number")l.push({position:m.points,rotation:h.rotation||[0,0,0],scale:h.scale||[1,1,1]});else{const w=d.findIndex(S=>y<=S.maxValue&&y>=S.minValue);if(w!==-1){const S=Oa(m,t);d[w].locations.push({position:m.points,rotation:S.rotation||h.rotation||[0,0,0],scale:d[w].symbol.scale||[1,1,1]})}else l.push({position:m.points,rotation:h.rotation||[0,0,0],scale:h.scale||[1,1,1]})}}const f=[];return d.forEach(v=>{v.locations.length>0&&f.push({url:v.symbol.url,locations:v.locations})}),l.length>0&&f.push({url:h.url,locations:l}),f}class hO extends st{constructor(t,n,s,o){super();p(this,"labelingInfo");this.sceneObject=t;const h=n;if(o&&_n(h,l=>{this.renderLabel(l,o)}),s)if(s.type==="simple"){const{visualVariables:l}=s;if(s.symbol.type==="simple-point"&&(!l||l.length==0)){console.log("PointLayer:大批量点渲染!");const d=s_(h,s);this._simplePointAllRender(d.points,d.symbol);return}if(s.symbol.type==="ESImageLabel"&&(!l||l.length==0)){console.log("PointLayer:大批量点渲染成图标!");const d=s_(h,s);this._imageAllRender(d.points,d.symbol);return}if(s.symbol.type==="ESGltfModel"){console.log("PointLayer:大批量点渲染成gltf!");const{url:d,locations:f}=rO(h,s,l);this._modelAllRender(d,f);return}for(let d=0;d<h.length;d++){const f=gg(h[d],s,l);this.render(h[d],f)}}else if(s.type==="unique-value"){const{visualVariables:l}=s;if(s.uniqueValueInfos.findIndex(m=>m.symbol.type!=="simple-point")===-1&&s.defaultSymbol.type==="simple-point"&&(!l||l.length==0)){console.log("PointLayer:大批量点渲染!"),r_(h,s).forEach(({points:y,symbol:w})=>{this._simplePointAllRender(y,w)});return}if(s.uniqueValueInfos.findIndex(m=>m.symbol.type!=="ESImageLabel")===-1&&s.defaultSymbol.type==="ESImageLabel"&&(!l||l.length==0)){console.log("PointLayer:大批量点渲染成图标!"),r_(h,s).forEach(({points:y,symbol:w})=>{this._imageAllRender(y,w)});return}if(s.uniqueValueInfos.findIndex(m=>m.symbol.type!=="ESGltfModel")===-1&&s.defaultSymbol.type==="ESGltfModel"){console.log("PointLayer:大批量点渲染成gltf!"),aO(h,s,l).forEach(({url:y,locations:w})=>{this._modelAllRender(y,w)});return}for(let m=0;m<h.length;m++){const y=pg(h[m],s,l);this.render(h[m],y)}}else if(s.type==="class-breaks"){const{visualVariables:l}=s;if(s.classBreakInfos.findIndex(m=>m.symbol.type!=="simple-point")===-1&&s.defaultSymbol.type==="simple-point"&&(!l||l.length==0)){console.log("PointLayer:大批量点渲染!"),a_(h,s).forEach(({points:y,symbol:w})=>{this._simplePointAllRender(y,w)});return}if(s.classBreakInfos.findIndex(m=>m.symbol.type!=="ESImageLabel")===-1&&s.defaultSymbol.type==="ESImageLabel"&&(!l||l.length==0)){console.log("PointLayer:大批量点渲染成图标!"),a_(h,s).forEach(({points:y,symbol:w})=>{this._imageAllRender(y,w)});return}if(s.classBreakInfos.findIndex(m=>m.symbol.type!=="ESGltfModel")===-1&&s.defaultSymbol.type==="ESGltfModel"){console.log("PointLayer:大批量点渲染成gltf!"),oO(h,s,l).forEach(({url:y,locations:w})=>{this._modelAllRender(y,w)});return}for(let m=0;m<h.length;m++){const y=mg(h[m],s,l);this.render(h[m],y)}}else if(s.type==="heatmap"){const{field:l,fieldValueMax:d,fieldValueMin:f}=s;console.time();const v=h.map(m=>{const{points:y}=m;if(l&&typeof l=="string"){let w=m[l];typeof w=="number"&&(typeof d=="number"&&w>d&&(w=d),typeof f=="number"&&w<f&&(w=f),y[2]=w)}return y});this.renderHeatmap(v,s)}else console.error("PointLayer: renderer type is not supported")}renderLabel(t,n){const{points:s}=t;fg(this.sceneObject,s,t,n)}renderHeatmap(t,n){const{is3D:s,radius:o,blur:h,gradient:l}=n,d=this.dv(new Eu);this.d(this.sceneObject.components.disposableAdd(d)),d.is3D=s,d.radius=o,d.blur=h,l&&(d.gradient={...l}),d.data=t}render(t,n){n.type==="simple-point"?this._simplePointRender(t,n):n.type==="ESImageLabel"?this._simpleImageRender(t,n):n.type==="ESGltfModel"?this._simpleModelRender(t,n):n.type==="ESTextLabel"?i_(this.sceneObject,t.points,n):n.type==="ESParticleSystemPrimitive"?this._simpleParticleRender(t,n):console.error(" PointLayer: symbol type is not supported")}_simplePointRender(t,n){const{points:s}=t,{size:o,color:h,outlineColor:l,outlineWidth:d}=n,f=this.dv(new Mh);this.d(this.sceneObject.components.disposableAdd(f)),f.pointed=!0,f.pointOutlineColor=l,f.pointOutlineWidth=d,f.pointSize=o,f.pointColor=h,f.allowPicking=(n==null?void 0:n.allowPicking)??!0,f.extras={selected:!1},f.points=[s]}_simplePointAllRender(t,n){const{size:s,color:o,outlineColor:h,outlineWidth:l}=n,d=this.dv(new Mh);this.d(this.sceneObject.components.disposableAdd(d)),d.pointed=!0,d.pointOutlineColor=h,d.pointOutlineWidth=l,d.pointSize=s,d.pointColor=o,d.allowPicking=(n==null?void 0:n.allowPicking)??!0,d.points=[...t]}_simpleImageRender(t,n){const{points:s}=t,{rotation:o,offset:h,size:l,url:d,screenRender:f,anchor:v,renderMode:m,rotationType:y}=n,w=this.dv(new cu),S=this.dv(new Ia);this.d(this.sceneObject.components.disposableAdd(w)),this.d(this.sceneObject.components.disposableAdd(S)),w.url=d,w.renderMode=m??0,o&&(w.rotation=o),h&&(w.offset=h),w.size=l||[32,32],v&&(w.anchor=v),y&&(w.rotationType=y),w.screenRender=f??!0,w.allowPicking=(n==null?void 0:n.allowPicking)??!0,w.extras={selected:!1},w.position=[...s],w.sizeByContent=!1,S.allowPicking=(n==null?void 0:n.allowPicking)??!0;const T=l?Math.max(...l)+10:Math.max(...w.size)+10;S.sizeByContent=!1,S.screenRender=!0,S.size=[T,T],S.borderRadius=[T,T,T,T],S.padding=[T/2,T/2,T/2,T/2],S.borderWidth=T/10,S.offset=[0,T/10+5],S.text="",S.backgroundColor=[0,0,0,0],S.borderColor=[0,0,0,0]}_imageAllRender(t,n){const s={type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"MultiPoint",coordinates:t}}]},o=this.dv(new bh);this.d(this.sceneObject.components.disposableAdd(o));const h=this.dv(new Ia);this.d(this.sceneObject.components.disposableAdd(h)),o.textDefaultText="";const{offset:l,size:d,url:f,anchor:v}=n;o.imageUrl=f,v&&(o.imageAnchor=v),l&&(o.imageOffset=l),o.imageSize=d||[32,32],o.url=s,o.allowPicking=(n==null?void 0:n.allowPicking)??!0,o.extras={selected:!1},h.allowPicking=!0;const m=d?Math.max(...d)+10:Math.max(...o.imageSize)+10;h.sizeByContent=!1,h.size=[m,m],h.borderRadius=[m,m,m,m],h.padding=[m/2,m/2,m/2,m/2],h.borderWidth=m/10,h.offset=[0,m/10+5],h.text="",h.backgroundColor=[0,0,0,0],h.borderColor=[0,0,0,0]}_simpleModelRender(t,n){const{points:s}=t,{rotation:o,scale:h,url:l}=n,d=this.dv(new Tn);this.d(this.sceneObject.components.disposableAdd(d)),d.url=l,o&&(d.rotation=o),h&&(d.scale=h),d.position=[...s]}_modelAllRender(t,n){const s=this.dv(new Tn);this.d(this.sceneObject.components.disposableAdd(s)),s.url=t,s.instances=n}_simpleParticleRender(t,n){const{points:s}=t,o=this.dv(new du);this.d(this.sceneObject.components.disposableAdd(o)),o.position=[...s],Object.keys(n).forEach(h=>{o[h]=n[h]})}}class lO extends st{constructor(e,t,n,s){super(),this.sceneObject=e;const o=t;if(s&&_n(o,h=>{this.renderLabel(h,s)}),n)if(n.type==="simple"){const{visualVariables:h}=n;_n(o,l=>{const d=gg(l,n,h);this.render(l,d)})}else if(n.type==="unique-value"){const{visualVariables:h}=n;_n(o,l=>{const d=pg(l,n,h);this.render(l,d)})}else if(n.type==="class-breaks"){const{visualVariables:h}=n;_n(o,l=>{const d=mg(l,n,h);this.render(l,d)})}else console.error("PolyLineLayer: renderer type is not supported")}render(e,t){console.log("PolyLineLayer: render",e,t),t.type==="simple-line"?this._simpleLineRender(e,t):t.type==="ESPolygonFence"?this._esPolygonFenceRender(e,t):t.type==="ESPipeFence"?this._esPipeFenceRender(e,t):t.type==="ESPath"?this._esPathRender(e,t):t.type==="ESlineInterpolationModel"?this._eslineInterpolationModelRender(e,t):t.type==="ESlineWall"?this._eslineWallRender(e,t):console.error("PolyLineLayer: symbol type is not supported")}_simpleLineRender(e,t){const{points:n}=e;if(n.length<2){console.warn("PolyLineLayer: points length is less than 3");return}const s=this.dv(new ze);this.d(this.sceneObject.components.disposableAdd(s)),s.points=[...n],s.stroked=!0,s.strokeColor=t.color,s.strokeWidth=t.width||1,s.allowPicking=(t==null?void 0:t.allowPicking)??!0,s.extras={selected:!1}}_esPolygonFenceRender(e,t){const{points:n}=e;if(n.length<3){console.warn("PolyLineLayer: points length is less than 3");return}const s=this.dv(new mu);this.d(this.sceneObject.components.disposableAdd(s)),s.points=[...n],s.height=t.height,s.materialMode=t.materialMode}_esPipeFenceRender(e,t){const{points:n}=e;if(n.length<2){console.warn("PolyLineLayer: points length is less than 3");return}const s=this.dv(new pu);this.d(this.sceneObject.components.disposableAdd(s)),s.points=[...n],s.height=t.height,s.width=t.width,s.materialMode=t.materialMode}_esPathRender(e,t){const{points:n}=e;if(n.length<2){console.warn("PolyLineLayer: points length is less than 3");return}const s=this.dv(new ka),o=this.dv(new Ta);if(this.d(this.sceneObject.components.disposableAdd(s)),this.d(this.sceneObject.components.disposableAdd(o)),s.points=[...n],s.speed=t.speed,s.strokeColor=t.color,s.materialMode=t.materialMode,s.strokeWidth=t.width||1,t!=null&&t.runModel){const l=t==null?void 0:t.runSpeed,d=t==null?void 0:t.modelSymbol;let f;switch(t==null?void 0:t.runModel){case"ESHuman":f=this.dv(new Pi);break;case"ESCar":f=this.dv(new ou);break;case"ESGltfModel":f=this.dv(new Tn)}if(this.d(this.sceneObject.components.disposableAdd(f)),d)for(let m in d)f[m]=d[m];const v=[0];for(var h=0;h<n.length-1;h+=1){const m=n[h],y=n[h+1],w=sO(m[1],m[0],y[1],y[0]);v.push(v[h]+Math.ceil(w/l)*1e3)}s.timeStamps=v,t!=null&&t.runSpeed&&(s.currentPositionChanged.don(m=>{s.currentPosition&&(f.position=s.currentPosition,s.currentRotation&&(f.rotation=s.currentRotation))}),o.startTime=0,o.stopTime=v[v.length-1],o.playing=!0,o.loop=(t==null?void 0:t.runLoop)??!0,o.currentTimeChanged.don(m=>{s.path.currentTime=m}))}}_eslineInterpolationModelRender(e,t){const{points:n}=e;if(n.length<2){console.warn("PolyLineLayer: points length is less than 3");return}const s=(t==null?void 0:t.interpolationDistance)??0;if(!s)return;const o=eO(n,s/1e3),h=this.dv(new Tn);this.d(this.sceneObject.components.disposableAdd(h)),h.url=t.url,h.instances=o.map(l=>({position:l,rotation:t.rotation,scale:t.scale}))}_eslineWallRender(e,t){const{points:n}=e;if(n.length<2){console.warn("PolyLineLayer: points length is less than 3");return}const s=t.height??0,o=t.width??0,h=t.extrudedHeight??0,l=n.map(v=>({lng:(v==null?void 0:v[0])??0,lat:(v==null?void 0:v[1])??0,alt:(v==null?void 0:v[2])??0})),d=nO(l,o).map(v=>[(v==null?void 0:v.lng)??0,(v==null?void 0:v.lat)??0,(v==null?void 0:v.alt)??0]),f=this.dv(new fr);this.d(this.sceneObject.components.disposableAdd(f)),f.height=s,f.extrudedHeight=h,f.filled=t.filled??!0,f.fillColor=t.fillColor,f.allowPicking=(t==null?void 0:t.allowPicking)??!0,f.extras={selected:!1},f.points=d}renderLabel(e,t){const{points:n}=e,s=tO(n);fg(this.sceneObject,s,e,t)}}function o_(i,e){try{JSON.stringify(i[i.length-1])!==JSON.stringify(i[0])&&i.push(i[0]);const t=ae(i.map(d=>Xt(d))),n=de([i]);return zT(t,e,{gridType:"point",units:"meters"}).features.map(d=>d.geometry.coordinates)[0][0].filter(d=>Oe(Xt(d),n))}catch(t){return console.error(t),[]}}class uO extends st{constructor(e,t,n,s){super(),this.sceneObject=e;const o=t;if(s&&_n(o,h=>{this.renderLabel(h,s)}),n)if(n.type==="simple"){const{visualVariables:h}=n;_n(o,l=>{const d=gg(l,n,h);this.render(l,d)})}else if(n.type==="unique-value"){const{visualVariables:h}=n;_n(o,l=>{const d=pg(l,n,h);this.render(l,d)})}else if(n.type==="class-breaks"){const{visualVariables:h}=n;_n(o,l=>{const d=mg(l,n,h);this.render(l,d)})}else console.error("PolyLineLayer: renderer type is not supported")}renderLabel(e,t){const{points:n}=e;console.log("PolygonLayer: renderLabel",n);const s=iO(n);fg(this.sceneObject,s,e,t)}render(e,t){t.type==="simple-fill"?this._simplePolygonRender(e,t):t.type==="ESGeoExtrudedPolygon"?this._esGeoExtrudedPolygonRender(e,t):t.type==="PolygonInterpolateESGltfModel"?this._polygonInterpolateESGltfModelRender(e,t):t.type==="PolygonInterpolateESImageLabel"?this._polygonInterpolateESImageLabelRender(e,t):console.error("PolyLineLayer: symbol type is not supported")}_simplePolygonRender(e,t){const{points:n}=e;if(n.length<3){console.warn("PolygonLayer: points length is less than 3");return}const{color:s,outline:o,filled:h,ground:l}=t,{width:d,color:f,stroked:v}=o,m=this.dv(new Jt);this.d(this.sceneObject.components.disposableAdd(m)),m.stroked=v??!1,m.strokeColor=f??[1,1,1,1],m.strokeWidth=d??1,m.filled=h??!0,m.fillGround=l??!1,m.fillColor=s??[1,1,1,1],m.allowPicking=(t==null?void 0:t.allowPicking)??!0,m.extras={selected:!1},m.points=[...n]}_esGeoExtrudedPolygonRender(e,t){const{points:n}=e;if(n.length<3){console.warn("PolygonLayer: points length is less than 3");return}const{height:s,extrudedHeight:o,color:h}=t,l=this.dv(new fr);this.d(this.sceneObject.components.disposableAdd(l)),l.height=s,l.extrudedHeight=o,l.filled=!0,l.fillColor=h,l.allowPicking=(t==null?void 0:t.allowPicking)??!0,l.extras={selected:!1},l.points=[...n]}_polygonInterpolateESGltfModelRender(e,t){const{points:n}=e;if(n.length<3){console.warn("PolygonLayer: points length is less than 3");return}const{height:s,interpolateDistance:o,url:h,rotation:l,scale:d}=t,f=o_(n,o??10),v=this.dv(new Tn);this.d(this.sceneObject.components.disposableAdd(v)),v.url=h,v.instances=f.map(m=>({position:[...m,s??0],rotation:l??[0,0,0],scale:d??[1,1,1]}))}_polygonInterpolateESImageLabelRender(e,t){const{points:n}=e;if(n.length<3){console.warn("PolygonLayer: points length is less than 3");return}const{height:s,interpolateDistance:o,offset:h,size:l,url:d,anchor:f}=t,m={type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"MultiPoint",coordinates:[...o_(n,o??10).map(w=>[...w,s??0])]}}]},y=this.dv(new bh);this.d(this.sceneObject.components.disposableAdd(y)),y.textDefaultText="",y.imageUrl=d,f&&(y.imageAnchor=f),h&&(y.imageOffset=h),l&&(y.imageSize=l),y.url=m}}class cO extends st{constructor(t,n){super();p(this,"_initEvent",this.dv(new H));const s=this,o=async()=>{try{const l=t.featureProps;if(!l)return;const{heightMode:d,features:f,layerType:v,url:m}=l;let y=[];if(!f&&m){let w=await fetch(m).then(S=>S.json());return w=(w==null?void 0:w.features)??w,v==="polylineVector"?y=await Qy(n,w,d):v==="polygonVector"?y=await e_(n,w,d):v==="pointVector"&&(y=await t_(n,w,d)),y}else v==="polylineVector"?y=await Qy(n,f,d):v==="polygonVector"?y=await e_(n,f,d):v==="pointVector"&&(y=await t_(n,f,d));return y}catch(l){console.error(l);return}},h=this.dv(we(this._initEvent,t.featurePropsChanged));s.dv(new xe(h,()=>{if(!t.featureProps)return;const l=t.featureProps;let d;return(async()=>{const{layerType:v,renderer:m,labelingInfo:y}=l,w=await o();!w||w.length===0||(v==="pointVector"?d=new hO(t,w,m,y):v==="polylineVector"?d=new lO(t,w,m,y):v==="polygonVector"&&(d=new uO(t,w,m,y)),console.log("polygonVectorLayer","createLayer",d))})().catch(console.error),{destroy:()=>{var v;(v=d==null?void 0:d.destroy)==null||v.call(d),d=void 0}}}));{const l=(d,f=1)=>{const v=ay(d);if(!v)return;const{center:m,radius:y}=v;n.flyTo({distance:y*4,heading:0,pitch:-90,flyDuration:f??1,hDelta:0,pDelta:0},m)};s.d(t.flyToEvent.don(async d=>{const{featureProps:f}=t;if(!f)return;const v=await o();if(!v)return;let m=[];f.layerType==="polylineVector"?m=v.map(y=>y.points).flat():f.layerType==="polygonVector"?m=v.map(y=>y.points).flat():f.layerType==="pointVector"&&(m=v.map(y=>y.points)),m.length!==0&&l(m,d)}))}}init(){this._initEvent.emit()}}const oo=class oo extends Ht{constructor(t){super(t);p(this,"featureLayerMap",new Map);const n=this;n.d(n.viewerAttached.don(s=>{if(console.log("ESFeatureLayer","viewerAttached",s.id),n.featureLayerMap.has(s.id))return;const o=new cO(n,s);o.init(),n.featureLayerMap.set(s.id,o)})),n.d(n.viewerDetached.don(s=>{var o;console.log("ESFeatureLayer","viewerDetached",s.id),n.featureLayerMap.has(s.id)&&((o=n.featureLayerMap.get(s.id))==null||o.destroy(),n.featureLayerMap.delete(s.id))})),n.d(()=>{for(const s of n.featureLayerMap.values())s.destroy();n.featureLayerMap.clear()}),n.d(Me(n.showChanged,()=>{for(const s of n.components.values())Reflect.has(s,"show")&&(s.show=n.show)},{immediate:!0}))}};p(oo,"createDefaultProps",()=>({...Ht.createDefaultProps(),featureProps:re(void 0)})),p(oo,"type",oo.register("ESFeatureLayer",oo,{chsName:"要素图层",tags:["ESObjects"],description:`ESFeatureLayer 是用于在场景中加载和显示要素图层的对象。
|
|
1300
|
+
`})),p(Lr,"supportEditingModes",[...Rt.supportEditingModes,dt.ScatterAppend,dt.ScatterModify]);let Mh=Lr;const Qy=async(i,e=[],t)=>{const n=[];for(const s of e){const{coordinates:o}=s.geometry;for(const h of o){const l=await Promise.all(h.map(async d=>{let f=d[2]??0;if(t)if(t.type==="absolute")f=t.height??f;else if(t.type==="relative"){const v=await i.getTerrainHeight([d[0],d[1]])??0;f=(t.height??f)+v}else t.type==="terrain"&&(f=await i.getTerrainHeight([d[0],d[1]])??0);return[d[0],d[1],f]}));n.push({...s,points:l})}}return n},t_=async(i,e=[],t)=>await Promise.all(e.map(async n=>{var d,f,v,m,y,w,S,T,N;const s=((d=n.geometry)==null?void 0:d.x)??((v=(f=n.geometry)==null?void 0:f.coordinates)==null?void 0:v[0]),o=((m=n.geometry)==null?void 0:m.y)??((w=(y=n.geometry)==null?void 0:y.coordinates)==null?void 0:w[1]);let l=((S=n.geometry)==null?void 0:S.z)??((N=(T=n.geometry)==null?void 0:T.coordinates)==null?void 0:N[2])??0;if(t)if(t.type==="absolute")l=t.height??l;else if(t.type==="relative"){const j=await i.getTerrainHeight([s,o])??0;l=(t.height??l)+j}else t.type==="terrain"&&(l=await i.getTerrainHeight([s,o])??0);return{...n,points:[s,o,l]}})),e_=async(i,e=[],t)=>{const n=[];return await Promise.all(e.map(async s=>{const{coordinates:o}=s.geometry;await Promise.all(o.map(async h=>{const l=await Promise.all(h.map(async d=>{let f=d[2]??0;if(t)if(t.type==="absolute")f=t.height??f;else if(t.type==="relative"){const v=await i.getTerrainHeight([d[0],d[1]])??0;f=(t.height??f)+v}else t.type==="terrain"&&(f=await i.getTerrainHeight([d[0],d[1]])??0);return[d[0],d[1],f]}));n.push({...s,points:l})}))})),n};function tO(i){const e=Ce(i),t=Zv(e),n=ud(e,t/2);return[n.geometry.coordinates[0],n.geometry.coordinates[1],n.geometry.coordinates[2]||0]}function eO(i,e){const t=Ce(i),n=Zv(t),s=Math.floor(n/e),o=[];if(o.push(i[0]),s<1)return[i[0]];for(let h=1;h<s;h+=1){const l=ud(t,n*(h/s));o.push([l.geometry.coordinates[0],l.geometry.coordinates[1],l.geometry.coordinates[2]||0])}return o}function iO(i){const e=[...i];JSON.stringify(i[0])!==JSON.stringify(i[i.length-1])&&e.push(i[0]);const t=de([e]),n=Q0(t);return[n.geometry.coordinates[0],n.geometry.coordinates[1],n.geometry.coordinates[2]||0]}function i_(i,e,t){const n=i.dv(new Ia);for(const s in t)s!=="type"&&(n[s]=t[s]);n.position=e,i.d(i.components.disposableAdd(n))}function fg(i,e,t,n){let s=n.textTemplate||n.symbol.text||"";const o=/{{(.*?)}}/;for(;o.test(s);){const v=s.match(o);if(v){const m=v[1].trim(),y=t[`${m}`]||"-";s=s.replace(v[0],y)}}let h=n.symbol;const{minVisibleDistance:l,maxVisibleDistance:d}=n;l&&d&&(h={...h,minVisibleDistance:l,maxVisibleDistance:d});const f={...h,text:s};i_(i,e,f)}function Oa(i,e){const t={width:null,height:null,color:null,opacity:null,rotation:null};return e.forEach(n=>{n.type==="size"?n.axis==="width"?t.width=i[n.field]||null:n.axis==="height"&&(t.height=i[n.field]||null):n.type==="color"?t.color=i[n.field]||null:n.type==="opacity"?t.opacity=i[n.field]||null:n.type==="rotation"&&(t.rotation=i[n.field]||null)}),t}function gg(i,e,t){const s={...e.symbol};if(t&&t.length>0){const o=Oa(i,t);for(let h in o)s[h]!==void 0&&o[h]!==null&&(s[h]=o[h])}return s}function pg(i,e,t){var f,v;const n=e,{uniqueValueInfos:s,field:o,fieldDelimiter:h,defaultSymbol:l}=n;let d={...l};if(Array.isArray(o)){const y=o.map(w=>i[w]??"").join(h);d=((f=s.find(w=>w.value==y))==null?void 0:f.symbol)||l}else d=((v=s.find(m=>m.value==i[o]))==null?void 0:v.symbol)||l;if(t&&t.length>0){const m=Oa(i,t);for(let y in m)d[y]!==void 0&&m[y]!==null&&(d[y]=m[y])}return d}function mg(i,e,t){const n=e,{classBreakInfos:s,field:o,defaultSymbol:h}=n;let l=h;const d=i[o];if(d===void 0||typeof d!="number")l=h;else{const f=s.find(v=>d<=v.maxValue&&d>=v.minValue);f?l=f.symbol:l=h}if(t&&t.length>0){const f=Oa(i,t);for(let v in f)l[v]!==void 0&&f[v]!==null&&(l[v]=f[v])}return l}function nO(i,e){function t(f,v,m,y){const w=D=>D*Math.PI/180,S=D=>D*180/Math.PI,T=w(f),N=w(m),j=w(y-v),C=Math.sin(j)*Math.cos(N),k=Math.cos(T)*Math.sin(N)-Math.sin(T)*Math.cos(N)*Math.cos(j),M=Math.atan2(C,k);return(S(M)+360)%360}function n(f,v,m,y,w){const T=V=>V*Math.PI/180,N=V=>V*180/Math.PI,j=y/6371e3,C=T(w),k=T(f),M=T(v),D=Math.asin(Math.sin(k)*Math.cos(j)+Math.cos(k)*Math.sin(j)*Math.cos(C)),L=M+Math.atan2(Math.sin(C)*Math.sin(j)*Math.cos(k),Math.cos(j)-Math.sin(k)*Math.sin(D));return{lat:N(D),lng:N(L),alt:m}}function s(f){const v=[];f.length>1&&v.push(t(f[0].lat,f[0].lng,f[1].lat,f[1].lng));for(let m=1;m<f.length-1;m++){const y=t(f[m-1].lat,f[m-1].lng,f[m].lat,f[m].lng),w=t(f[m].lat,f[m].lng,f[m+1].lat,f[m+1].lng);let S=(y+w)/2;Math.abs(y-w)>180&&(S=(S+180)%360),v.push(S)}return f.length>1&&v.push(t(f[f.length-2].lat,f[f.length-2].lng,f[f.length-1].lat,f[f.length-1].lng)),f.length===1&&v.push(0),v}if(!i||i.length<2)throw new Error("至少需要两个点才能生成路径");if(e<=0)throw new Error("宽度必须大于0");const o=e/2,h=s(i),l=[],d=[];for(let f=0;f<i.length;f++){const v=(h[f]+90)%360,m=(h[f]+270)%360,y=i[f].alt!==void 0?i[f].alt:0;l.push(n(i[f].lat,i[f].lng,y,o,v)),d.push(n(i[f].lat,i[f].lng,y,o,m))}return l.concat(d.reverse())}function sO(i,e,t,n){function s(T){return T*(Math.PI/180)}const o=6378137,h=s(i),l=s(e),d=s(t),f=s(n),v=d-h,m=f-l,y=Math.sin(v/2)**2+Math.cos(h)*Math.cos(d)*Math.sin(m/2)**2,w=2*Math.atan2(Math.sqrt(y),Math.sqrt(1-y));return o*w}const n_=(i,e,t)=>Array.isArray(e)?e.map(o=>i[o]??"").join(t):i[e]??"";function s_(i,e){const n={...e.symbol};return{points:i.map(s=>s.points),symbol:n}}function r_(i,e){const t=e,{uniqueValueInfos:n,field:s,fieldDelimiter:o,defaultSymbol:h}=t,l=[],d=n.reduce((v,m)=>{const y=m.value.toString();return v[y]={points:[],value:m.value,symbol:m.symbol},v},{});for(let v=0;v<i.length;v++){const m=i[v],y=n_(m,s,o);if(y!==void 0&&y!==""){const w=d[y.toString()];w?w.points.push(m.points):l.push(m.points)}else l.push(m.points)}const f=[];for(let v in d){const{points:m,symbol:y}=d[v];m.length>0&&f.push({points:m,symbol:y})}return l.length>0&&f.push({points:l,symbol:h}),f}function a_(i,e){const t=e,{classBreakInfos:n,field:s,defaultSymbol:o}=t,h=[],l=n.map(f=>({...f,points:[]}));for(let f=0;f<i.length;f++){const v=i[f],m=v[s];if(m===void 0||typeof m!="number")h.push(v.points);else{const y=l.findIndex(w=>m<=w.maxValue&&m>=w.minValue);y!==-1?l[y].points.push(v.points):h.push(v.points)}}const d=[];return l.forEach(f=>{f.points.length>0&&d.push({points:f.points,symbol:f.symbol})}),h.length>0&&d.push({points:h,symbol:o}),d}function rO(i,e,t=[]){const s={...e.symbol},o=i.map(h=>{const l=Oa(h,t);return{position:h.points,rotation:l.rotation||s.rotation||[0,0,0],scale:s.scale||[1,1,1]}});return{url:s.url,locations:o}}function aO(i,e,t=[]){const n=e,{uniqueValueInfos:s,field:o,fieldDelimiter:h}=n,l=n.defaultSymbol,d=[],f=s.reduce((m,y)=>{const w=y.value.toString();return m[w]={locations:[],value:y.value,symbol:y.symbol},m},{});for(let m=0;m<i.length;m++){const y=i[m],w=n_(y,o,h);if(w){const S=f[w.toString()];if(S){const T=Oa(y,t);S.locations.push({position:y.points,rotation:T.rotation||l.rotation||[0,0,0],scale:l.scale||[1,1,1]})}else d.push({position:y.points,rotation:l.rotation||[0,0,0],scale:l.scale||[1,1,1]})}else d.push({position:y.points,rotation:l.rotation||[0,0,0],scale:l.scale||[1,1,1]})}const v=[];for(let m in f){const{locations:y,symbol:w}=f[m];y.length>0&&v.push({url:w.url,locations:y})}return d.length>0&&v.push({url:l.url,locations:d}),v}function oO(i,e,t=[]){const n=e,{classBreakInfos:s,field:o}=n,h=n.defaultSymbol,l=[],d=s.map(v=>({...v,locations:[]}));for(let v=0;v<i.length;v++){const m=i[v],y=m[o];if(y===void 0||typeof y!="number")l.push({position:m.points,rotation:h.rotation||[0,0,0],scale:h.scale||[1,1,1]});else{const w=d.findIndex(S=>y<=S.maxValue&&y>=S.minValue);if(w!==-1){const S=Oa(m,t);d[w].locations.push({position:m.points,rotation:S.rotation||h.rotation||[0,0,0],scale:d[w].symbol.scale||[1,1,1]})}else l.push({position:m.points,rotation:h.rotation||[0,0,0],scale:h.scale||[1,1,1]})}}const f=[];return d.forEach(v=>{v.locations.length>0&&f.push({url:v.symbol.url,locations:v.locations})}),l.length>0&&f.push({url:h.url,locations:l}),f}class hO extends st{constructor(t,n,s,o){super();p(this,"labelingInfo");this.sceneObject=t;const h=n;if(o&&_n(h,l=>{this.renderLabel(l,o)}),s)if(s.type==="simple"){const{visualVariables:l}=s;if(s.symbol.type==="simple-point"&&(!l||l.length==0)){console.log("PointLayer:大批量点渲染!");const d=s_(h,s);this._simplePointAllRender(d.points,d.symbol);return}if(s.symbol.type==="ESImageLabel"&&(!l||l.length==0)){console.log("PointLayer:大批量点渲染成图标!");const d=s_(h,s);this._imageAllRender(d.points,d.symbol);return}if(s.symbol.type==="ESGltfModel"){console.log("PointLayer:大批量点渲染成gltf!");const{url:d,locations:f}=rO(h,s,l);this._modelAllRender(d,f);return}for(let d=0;d<h.length;d++){const f=gg(h[d],s,l);this.render(h[d],f)}}else if(s.type==="unique-value"){const{visualVariables:l}=s;if(s.uniqueValueInfos.findIndex(m=>m.symbol.type!=="simple-point")===-1&&s.defaultSymbol.type==="simple-point"&&(!l||l.length==0)){console.log("PointLayer:大批量点渲染!"),r_(h,s).forEach(({points:y,symbol:w})=>{this._simplePointAllRender(y,w)});return}if(s.uniqueValueInfos.findIndex(m=>m.symbol.type!=="ESImageLabel")===-1&&s.defaultSymbol.type==="ESImageLabel"&&(!l||l.length==0)){console.log("PointLayer:大批量点渲染成图标!"),r_(h,s).forEach(({points:y,symbol:w})=>{this._imageAllRender(y,w)});return}if(s.uniqueValueInfos.findIndex(m=>m.symbol.type!=="ESGltfModel")===-1&&s.defaultSymbol.type==="ESGltfModel"){console.log("PointLayer:大批量点渲染成gltf!"),aO(h,s,l).forEach(({url:y,locations:w})=>{this._modelAllRender(y,w)});return}for(let m=0;m<h.length;m++){const y=pg(h[m],s,l);this.render(h[m],y)}}else if(s.type==="class-breaks"){const{visualVariables:l}=s;if(s.classBreakInfos.findIndex(m=>m.symbol.type!=="simple-point")===-1&&s.defaultSymbol.type==="simple-point"&&(!l||l.length==0)){console.log("PointLayer:大批量点渲染!"),a_(h,s).forEach(({points:y,symbol:w})=>{this._simplePointAllRender(y,w)});return}if(s.classBreakInfos.findIndex(m=>m.symbol.type!=="ESImageLabel")===-1&&s.defaultSymbol.type==="ESImageLabel"&&(!l||l.length==0)){console.log("PointLayer:大批量点渲染成图标!"),a_(h,s).forEach(({points:y,symbol:w})=>{this._imageAllRender(y,w)});return}if(s.classBreakInfos.findIndex(m=>m.symbol.type!=="ESGltfModel")===-1&&s.defaultSymbol.type==="ESGltfModel"){console.log("PointLayer:大批量点渲染成gltf!"),oO(h,s,l).forEach(({url:y,locations:w})=>{this._modelAllRender(y,w)});return}for(let m=0;m<h.length;m++){const y=mg(h[m],s,l);this.render(h[m],y)}}else if(s.type==="heatmap"){const{field:l,fieldValueMax:d,fieldValueMin:f}=s;console.time();const v=h.map(m=>{const{points:y}=m;if(l&&typeof l=="string"){let w=m[l];typeof w=="number"&&(typeof d=="number"&&w>d&&(w=d),typeof f=="number"&&w<f&&(w=f),y[2]=w)}return y});this.renderHeatmap(v,s)}else console.error("PointLayer: renderer type is not supported")}renderLabel(t,n){const{points:s}=t;fg(this.sceneObject,s,t,n)}renderHeatmap(t,n){const{is3D:s,radius:o,blur:h,gradient:l}=n,d=this.dv(new Eu);this.d(this.sceneObject.components.disposableAdd(d)),d.is3D=s,d.radius=o,d.blur=h,l&&(d.gradient={...l}),d.data=t}render(t,n){n.type==="simple-point"?this._simplePointRender(t,n):n.type==="ESImageLabel"?this._simpleImageRender(t,n):n.type==="ESGltfModel"?this._simpleModelRender(t,n):n.type==="ESTextLabel"?i_(this.sceneObject,t.points,n):n.type==="ESParticleSystemPrimitive"?this._simpleParticleRender(t,n):console.error(" PointLayer: symbol type is not supported")}_simplePointRender(t,n){const{points:s}=t,{size:o,color:h,outlineColor:l,outlineWidth:d}=n,f=this.dv(new Mh);this.d(this.sceneObject.components.disposableAdd(f)),f.pointed=!0,f.pointOutlineColor=l,f.pointOutlineWidth=d,f.pointSize=o,f.pointColor=h,f.allowPicking=(n==null?void 0:n.allowPicking)??!0,f.extras={selected:!1},f.points=[s]}_simplePointAllRender(t,n){const{size:s,color:o,outlineColor:h,outlineWidth:l}=n,d=this.dv(new Mh);this.d(this.sceneObject.components.disposableAdd(d)),d.pointed=!0,d.pointOutlineColor=h,d.pointOutlineWidth=l,d.pointSize=s,d.pointColor=o,d.allowPicking=(n==null?void 0:n.allowPicking)??!0,d.points=[...t]}_simpleImageRender(t,n){const{points:s}=t,{rotation:o,offset:h,size:l,url:d,screenRender:f,anchor:v,renderMode:m,rotationType:y}=n,w=this.dv(new cu),S=this.dv(new Ia);this.d(this.sceneObject.components.disposableAdd(w)),this.d(this.sceneObject.components.disposableAdd(S)),w.url=d,w.renderMode=m??0,o&&(w.rotation=o),h&&(w.offset=h),w.size=l||[32,32],v&&(w.anchor=v),y&&(w.rotationType=y),w.screenRender=f??!0,w.allowPicking=(n==null?void 0:n.allowPicking)??!0,w.extras={selected:!1},w.position=[...s],w.sizeByContent=!1,S.allowPicking=(n==null?void 0:n.allowPicking)??!0;const T=l?Math.max(...l)+10:Math.max(...w.size)+10;S.sizeByContent=!1,S.screenRender=!0,S.size=[T,T],S.borderRadius=[T,T,T,T],S.padding=[T/2,T/2,T/2,T/2],S.borderWidth=T/10,S.offset=[0,T/10+5],S.text="",S.backgroundColor=[0,0,0,0],S.borderColor=[0,0,0,0]}_imageAllRender(t,n){const s={type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"MultiPoint",coordinates:t}}]},o=this.dv(new bh);this.d(this.sceneObject.components.disposableAdd(o));const h=this.dv(new Ia);this.d(this.sceneObject.components.disposableAdd(h)),o.textDefaultText="";const{offset:l,size:d,url:f,anchor:v}=n;o.imageUrl=f,v&&(o.imageAnchor=v),l&&(o.imageOffset=l),o.imageSize=d||[32,32],o.url=s,o.allowPicking=(n==null?void 0:n.allowPicking)??!0,o.extras={selected:!1},h.allowPicking=!0;const m=d?Math.max(...d)+10:Math.max(...o.imageSize)+10;h.sizeByContent=!1,h.size=[m,m],h.borderRadius=[m,m,m,m],h.padding=[m/2,m/2,m/2,m/2],h.borderWidth=m/10,h.offset=[0,m/10+5],h.text="",h.backgroundColor=[0,0,0,0],h.borderColor=[0,0,0,0]}_simpleModelRender(t,n){const{points:s}=t,{rotation:o,scale:h,url:l}=n,d=this.dv(new Tn);this.d(this.sceneObject.components.disposableAdd(d)),d.url=l,o&&(d.rotation=o),h&&(d.scale=h),d.position=[...s]}_modelAllRender(t,n){const s=this.dv(new Tn);this.d(this.sceneObject.components.disposableAdd(s)),s.url=t,s.instances=n}_simpleParticleRender(t,n){const{points:s}=t,o=this.dv(new du);this.d(this.sceneObject.components.disposableAdd(o)),o.position=[...s],Object.keys(n).forEach(h=>{o[h]=n[h]})}}class lO extends st{constructor(e,t,n,s){super(),this.sceneObject=e;const o=t;if(s&&_n(o,h=>{this.renderLabel(h,s)}),n)if(n.type==="simple"){const{visualVariables:h}=n;_n(o,l=>{const d=gg(l,n,h);this.render(l,d)})}else if(n.type==="unique-value"){const{visualVariables:h}=n;_n(o,l=>{const d=pg(l,n,h);this.render(l,d)})}else if(n.type==="class-breaks"){const{visualVariables:h}=n;_n(o,l=>{const d=mg(l,n,h);this.render(l,d)})}else console.error("PolyLineLayer: renderer type is not supported")}render(e,t){console.log("PolyLineLayer: render",e,t),t.type==="simple-line"?this._simpleLineRender(e,t):t.type==="ESPolygonFence"?this._esPolygonFenceRender(e,t):t.type==="ESPipeFence"?this._esPipeFenceRender(e,t):t.type==="ESPath"?this._esPathRender(e,t):t.type==="ESlineInterpolationModel"?this._eslineInterpolationModelRender(e,t):t.type==="ESlineWall"?this._eslineWallRender(e,t):console.error("PolyLineLayer: symbol type is not supported")}_simpleLineRender(e,t){const{points:n}=e;if(n.length<2){console.warn("PolyLineLayer: points length is less than 3");return}const s=this.dv(new ze);this.d(this.sceneObject.components.disposableAdd(s)),s.points=[...n],s.stroked=!0,s.strokeColor=t.color,s.strokeWidth=t.width||1,s.allowPicking=(t==null?void 0:t.allowPicking)??!0,s.extras={selected:!1}}_esPolygonFenceRender(e,t){const{points:n}=e;if(n.length<3){console.warn("PolyLineLayer: points length is less than 3");return}const s=this.dv(new mu);this.d(this.sceneObject.components.disposableAdd(s)),s.points=[...n],s.height=t.height,s.materialMode=t.materialMode}_esPipeFenceRender(e,t){const{points:n}=e;if(n.length<2){console.warn("PolyLineLayer: points length is less than 3");return}const s=this.dv(new pu);this.d(this.sceneObject.components.disposableAdd(s)),s.points=[...n],s.height=t.height,s.width=t.width,s.materialMode=t.materialMode}_esPathRender(e,t){const{points:n}=e;if(n.length<2){console.warn("PolyLineLayer: points length is less than 3");return}const s=this.dv(new ka),o=this.dv(new Ta);if(this.d(this.sceneObject.components.disposableAdd(s)),this.d(this.sceneObject.components.disposableAdd(o)),s.points=[...n],s.speed=t.speed,s.strokeColor=t.color,s.materialMode=t.materialMode,s.strokeWidth=t.width||1,t!=null&&t.runModel){const l=t==null?void 0:t.runSpeed,d=t==null?void 0:t.modelSymbol;let f;switch(t==null?void 0:t.runModel){case"ESHuman":f=this.dv(new Pi);break;case"ESCar":f=this.dv(new ou);break;case"ESGltfModel":f=this.dv(new Tn)}if(this.d(this.sceneObject.components.disposableAdd(f)),d)for(let m in d)f[m]=d[m];const v=[0];for(var h=0;h<n.length-1;h+=1){const m=n[h],y=n[h+1],w=sO(m[1],m[0],y[1],y[0]);v.push(v[h]+Math.ceil(w/l)*1e3)}s.timeStamps=v,t!=null&&t.runSpeed&&(s.currentPositionChanged.don(m=>{s.currentPosition&&(f.position=s.currentPosition,s.currentRotation&&(f.rotation=s.currentRotation))}),o.startTime=0,o.stopTime=v[v.length-1],o.playing=!0,o.loop=(t==null?void 0:t.runLoop)??!0,o.currentTimeChanged.don(m=>{s.path.currentTime=m}))}}_eslineInterpolationModelRender(e,t){const{points:n}=e;if(n.length<2){console.warn("PolyLineLayer: points length is less than 3");return}const s=(t==null?void 0:t.interpolationDistance)??0;if(!s)return;const o=eO(n,s/1e3),h=this.dv(new Tn);this.d(this.sceneObject.components.disposableAdd(h)),h.url=t.url,h.instances=o.map(l=>({position:l,rotation:t.rotation,scale:t.scale}))}_eslineWallRender(e,t){const{points:n}=e;if(n.length<2){console.warn("PolyLineLayer: points length is less than 3");return}const s=t.height??0,o=t.width??0,h=t.extrudedHeight??0,l=n.map(v=>({lng:(v==null?void 0:v[0])??0,lat:(v==null?void 0:v[1])??0,alt:(v==null?void 0:v[2])??0})),d=nO(l,o).map(v=>[(v==null?void 0:v.lng)??0,(v==null?void 0:v.lat)??0,(v==null?void 0:v.alt)??0]),f=this.dv(new fr);this.d(this.sceneObject.components.disposableAdd(f)),f.height=s,f.extrudedHeight=h,f.filled=t.filled??!0,f.fillColor=t.fillColor,f.allowPicking=(t==null?void 0:t.allowPicking)??!0,f.extras={selected:!1},f.points=d}renderLabel(e,t){const{points:n}=e,s=tO(n);fg(this.sceneObject,s,e,t)}}function o_(i,e){try{JSON.stringify(i[i.length-1])!==JSON.stringify(i[0])&&i.push(i[0]);const t=ae(i.map(d=>Xt(d))),n=de([i]);return zT(t,e,{gridType:"point",units:"meters"}).features.map(d=>d.geometry.coordinates)[0][0].filter(d=>Oe(Xt(d),n))}catch(t){return console.error(t),[]}}class uO extends st{constructor(e,t,n,s){super(),this.sceneObject=e;const o=t;if(s&&_n(o,h=>{this.renderLabel(h,s)}),n)if(n.type==="simple"){const{visualVariables:h}=n;_n(o,l=>{const d=gg(l,n,h);this.render(l,d)})}else if(n.type==="unique-value"){const{visualVariables:h}=n;_n(o,l=>{const d=pg(l,n,h);this.render(l,d)})}else if(n.type==="class-breaks"){const{visualVariables:h}=n;_n(o,l=>{const d=mg(l,n,h);this.render(l,d)})}else console.error("PolyLineLayer: renderer type is not supported")}renderLabel(e,t){const{points:n}=e;console.log("PolygonLayer: renderLabel",n);const s=iO(n);fg(this.sceneObject,s,e,t)}render(e,t){t.type==="simple-fill"?this._simplePolygonRender(e,t):t.type==="ESGeoExtrudedPolygon"?this._esGeoExtrudedPolygonRender(e,t):t.type==="PolygonInterpolateESGltfModel"?this._polygonInterpolateESGltfModelRender(e,t):t.type==="PolygonInterpolateESImageLabel"?this._polygonInterpolateESImageLabelRender(e,t):console.error("PolyLineLayer: symbol type is not supported")}_simplePolygonRender(e,t){const{points:n}=e;if(n.length<3){console.warn("PolygonLayer: points length is less than 3");return}const{color:s,outline:o,filled:h,ground:l}=t,{width:d,color:f,stroked:v}=o,m=this.dv(new Jt);this.d(this.sceneObject.components.disposableAdd(m)),m.stroked=v??!1,m.strokeColor=f??[1,1,1,1],m.strokeWidth=d??1,m.filled=h??!0,m.fillGround=l??!1,m.fillColor=s??[1,1,1,1],m.allowPicking=(t==null?void 0:t.allowPicking)??!0,m.extras={selected:!1},m.points=[...n]}_esGeoExtrudedPolygonRender(e,t){const{points:n}=e;if(n.length<3){console.warn("PolygonLayer: points length is less than 3");return}const{height:s,extrudedHeight:o,color:h}=t,l=this.dv(new fr);this.d(this.sceneObject.components.disposableAdd(l)),l.height=s,l.extrudedHeight=o,l.filled=!0,l.fillColor=h,l.allowPicking=(t==null?void 0:t.allowPicking)??!0,l.extras={selected:!1},l.points=[...n]}_polygonInterpolateESGltfModelRender(e,t){const{points:n}=e;if(n.length<3){console.warn("PolygonLayer: points length is less than 3");return}const{height:s,interpolateDistance:o,url:h,rotation:l,scale:d}=t,f=o_(n,o??10),v=this.dv(new Tn);this.d(this.sceneObject.components.disposableAdd(v)),v.url=h,v.instances=f.map(m=>({position:[...m,s??0],rotation:l??[0,0,0],scale:d??[1,1,1]}))}_polygonInterpolateESImageLabelRender(e,t){const{points:n}=e;if(n.length<3){console.warn("PolygonLayer: points length is less than 3");return}const{height:s,interpolateDistance:o,offset:h,size:l,url:d,anchor:f}=t,m={type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"MultiPoint",coordinates:[...o_(n,o??10).map(w=>[...w,s??0])]}}]},y=this.dv(new bh);this.d(this.sceneObject.components.disposableAdd(y)),y.textDefaultText="",y.imageUrl=d,f&&(y.imageAnchor=f),h&&(y.imageOffset=h),l&&(y.imageSize=l),y.url=m}}class cO extends st{constructor(t,n){super();p(this,"_initEvent",this.dv(new H));const s=this,o=async()=>{try{const l=t.featureProps;if(!l)return;const{heightMode:d,features:f,layerType:v,url:m}=l;let y=[];if(!f&&m){let w=await fetch(m).then(S=>S.json());return w=(w==null?void 0:w.features)??w,v==="polylineVector"?y=await Qy(n,w,d):v==="polygonVector"?y=await e_(n,w,d):v==="pointVector"&&(y=await t_(n,w,d)),y}else v==="polylineVector"?y=await Qy(n,f,d):v==="polygonVector"?y=await e_(n,f,d):v==="pointVector"&&(y=await t_(n,f,d));return y}catch(l){console.error(l);return}},h=this.dv(we(this._initEvent,t.featurePropsChanged));s.dv(new xe(h,()=>{if(!t.featureProps)return;const l=t.featureProps;let d;return(async()=>{const{layerType:v,renderer:m,labelingInfo:y}=l,w=await o();!w||w.length===0||(v==="pointVector"?d=new hO(t,w,m,y):v==="polylineVector"?d=new lO(t,w,m,y):v==="polygonVector"&&(d=new uO(t,w,m,y)),console.log("polygonVectorLayer","createLayer",d))})().catch(console.error),{destroy:()=>{var v;(v=d==null?void 0:d.destroy)==null||v.call(d),d=void 0}}}));{const l=(d,f=1)=>{const v=ay(d);if(!v)return;const{center:m,radius:y}=v;n.flyTo({distance:y*4,heading:0,pitch:-90,flyDuration:f??1,hDelta:0,pDelta:0},m)};s.d(t.flyToEvent.don(async d=>{const{featureProps:f}=t;if(!f)return;const v=await o();if(!v)return;let m=[];f.layerType==="polylineVector"?m=v.map(y=>y.points).flat():f.layerType==="polygonVector"?m=v.map(y=>y.points).flat():f.layerType==="pointVector"&&(m=v.map(y=>y.points)),m.length!==0&&l(m,d)}))}}init(){this._initEvent.emit()}}const oo=class oo extends Ht{constructor(t){super(t);p(this,"featureLayerMap",new Map);const n=this;n.d(n.viewerAttached.don(s=>{if(console.log("ESFeatureLayer","viewerAttached",s.id),n.featureLayerMap.has(s.id))return;const o=new cO(n,s);o.init(),n.featureLayerMap.set(s.id,o)})),n.d(n.viewerDetached.don(s=>{var o;console.log("ESFeatureLayer","viewerDetached",s.id),n.featureLayerMap.has(s.id)&&((o=n.featureLayerMap.get(s.id))==null||o.destroy(),n.featureLayerMap.delete(s.id))})),n.d(()=>{for(const s of n.featureLayerMap.values())s.destroy();n.featureLayerMap.clear()}),n.d(Me(n.showChanged,()=>{for(const s of n.components.values())Reflect.has(s,"show")&&(s.show=n.show)},{immediate:!0}))}};p(oo,"createDefaultProps",()=>({...Ht.createDefaultProps(),featureProps:se(void 0)})),p(oo,"type",oo.register("ESFeatureLayer",oo,{chsName:"要素图层",tags:["ESObjects"],description:`ESFeatureLayer 是用于在场景中加载和显示要素图层的对象。
|
|
1301
1301
|
对象json示例:
|
|
1302
1302
|
{
|
|
1303
1303
|
"id": "featurelayer_xxx",
|
|
1304
1304
|
"type": "ESFeatureLayer",
|
|
1305
1305
|
"name": "要素图层"
|
|
1306
1306
|
}
|
|
1307
|
-
`}));let vg=oo;const dO=[["256",256],["512",512],["1024",1024]],fO=[["LEFT","LEFT"],["NONE","NONE"],["RIGHT","RIGHT"]],yi=class yi extends Ht{constructor(t){super(t);p(this,"_pickFeaturesEvent",this.dv(new H));this.ad(mt([this,"czmSplitDirection"],[this,"splitDirection"])),this.ad(mt([this,"czmAlpha"],[this,"opacity"]))}get pickFeaturesEvent(){return this._pickFeaturesEvent}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new Tt([this,"accessToken"],"令牌",yi.defaults.accessToken),new ui([this,"rectangle"],"矩形范围",yi.defaults.rectangle),new Mt([this,"url"],"服务地址",yi.defaults.url),new Mt([this,"style"],"样式配置",yi.defaults.style),new q([this,"zIndex"],"层级序号",yi.defaults.zIndex),new xt([this,"tileSize"],dO,"瓦片大小",256),new ke([this,"maximumLevel"],1,[1,24],"最大层级",yi.defaults.maximumLevel),new ke([this,"minimumLevel"],1,[0,24],"最小层级",yi.defaults.minimumLevel),new xt([this,"scheme"],[["tms","tms"],["xyz","xyz"]],"影像切片规则",yi.defaults.scheme),new xt([this,"heightReference"],[["NONE","NONE"],["CLAMP_TO_GROUND","CLAMP_TO_GROUND"],["RELATIVE_TO_GROUND","RELATIVE_TO_GROUND"]],"高度参考"),new Tt([this,"targetID"],"targetID")],more:[...t.more,new yt("通用"),new xt([this,"splitDirection"],fO,"splitDirection","NONE"),new yt("czm"),new q([this,"czmAlpha"],"透明度"),new q([this,"czmBrightness"],"亮度"),new q([this,"czmContrast"],"对比度"),new q([this,"czmHue"],"色相"),new q([this,"czmSaturation"],"饱和度"),new q([this,"czmGamma"],"伽马值")]}}};p(yi,"createDefaultProps",()=>({...Ht.createDefaultProps(),rectangle:
|
|
1307
|
+
`}));let vg=oo;const dO=[["256",256],["512",512],["1024",1024]],fO=[["LEFT","LEFT"],["NONE","NONE"],["RIGHT","RIGHT"]],yi=class yi extends Ht{constructor(t){super(t);p(this,"_pickFeaturesEvent",this.dv(new H));this.ad(mt([this,"czmSplitDirection"],[this,"splitDirection"])),this.ad(mt([this,"czmAlpha"],[this,"opacity"]))}get pickFeaturesEvent(){return this._pickFeaturesEvent}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new Tt([this,"accessToken"],"令牌",yi.defaults.accessToken),new ui([this,"rectangle"],"矩形范围",yi.defaults.rectangle),new Mt([this,"url"],"服务地址",yi.defaults.url),new Mt([this,"style"],"样式配置",yi.defaults.style),new q([this,"zIndex"],"层级序号",yi.defaults.zIndex),new xt([this,"tileSize"],dO,"瓦片大小",256),new ke([this,"maximumLevel"],1,[1,24],"最大层级",yi.defaults.maximumLevel),new ke([this,"minimumLevel"],1,[0,24],"最小层级",yi.defaults.minimumLevel),new xt([this,"scheme"],[["tms","tms"],["xyz","xyz"]],"影像切片规则",yi.defaults.scheme),new xt([this,"heightReference"],[["NONE","NONE"],["CLAMP_TO_GROUND","CLAMP_TO_GROUND"],["RELATIVE_TO_GROUND","RELATIVE_TO_GROUND"]],"高度参考"),new Tt([this,"targetID"],"targetID")],more:[...t.more,new yt("通用"),new xt([this,"splitDirection"],fO,"splitDirection","NONE"),new yt("czm"),new q([this,"czmAlpha"],"透明度"),new q([this,"czmBrightness"],"亮度"),new q([this,"czmContrast"],"对比度"),new q([this,"czmHue"],"色相"),new q([this,"czmSaturation"],"饱和度"),new q([this,"czmGamma"],"伽马值")]}}};p(yi,"createDefaultProps",()=>({...Ht.createDefaultProps(),rectangle:se([-180,-90,180,90]),url:At(""),zIndex:0,accessToken:"",tileSize:256,maximumLevel:18,minimumLevel:0,style:Wt([]),scheme:it("xyz"),czmSplitDirection:"NONE",heightReference:"NONE",czmAlpha:1,opacity:1,splitDirection:"NONE",targetID:"",czmBrightness:1,czmContrast:1,czmHue:0,czmSaturation:1,czmGamma:1})),p(yi,"type",yi.register("ESMVTLayer",yi,{chsName:"矢量瓦片图层",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE","_ES_Impl_Ol"],description:`ESMVTLayer 是用于在场景中加载和显示矢量瓦片(MVT)图层的可视化对象。
|
|
1308
1308
|
对象json示例:
|
|
1309
1309
|
{
|
|
1310
1310
|
"id": "mvtlayer_xxx",
|
|
@@ -1843,7 +1843,7 @@ ${y_}
|
|
|
1843
1843
|
"currentDate": "2020-01-01",
|
|
1844
1844
|
"rectangle": [-180, -90, 180, 90]
|
|
1845
1845
|
}
|
|
1846
|
-
`}));let Rg=uo;const co=class co extends Ht{constructor(e){super(e)}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new Mt([this,"url"],"url",void 0),new q([this,"zIndex"],"层级",0),new q([this,"maxZoom"],"最大缩放级别",0),new q([this,"minZoom"],"最小缩放级别",0)]}}};p(co,"createDefaultProps",()=>({...Ht.createDefaultProps(),attributions:Wt(void 0),attributionsCollapsible:void 0,cacheSize:void 0,crossOrigin:void 0,interpolate:void 0,projection:
|
|
1846
|
+
`}));let Rg=uo;const co=class co extends Ht{constructor(e){super(e)}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new Mt([this,"url"],"url",void 0),new q([this,"zIndex"],"层级",0),new q([this,"maxZoom"],"最大缩放级别",0),new q([this,"minZoom"],"最小缩放级别",0)]}}};p(co,"createDefaultProps",()=>({...Ht.createDefaultProps(),attributions:Wt(void 0),attributionsCollapsible:void 0,cacheSize:void 0,crossOrigin:void 0,interpolate:void 0,projection:se(void 0),reprojectionErrorThreshold:void 0,maxZoom:void 0,minZoom:void 0,opaque:void 0,maxResolution:void 0,minResolution:void 0,tileSize:void 0,maxTilesDownload:void 0,tileLoadFunction:void 0,tileUrlFunction:void 0,url:void 0,urls:Wt(void 0),wrapX:void 0,transition:void 0,show:!0,zIndex:1,visible:!0,extent:Wt(void 0),zoomOffset:void 0,tilePixelRatio:void 0,gutter:void 0,zDirection:void 0,tileGrid:se(void 0),key:void 0})),p(co,"type",co.register("ESXYZLayer",co,{chsName:"OL简单xyz图层",tags:["ESObjects","_ES_Impl_Openlayers"],description:`ESXYZLayer 是用于在 OpenLayers 地图中加载和显示 XYZ 瓦片图层的对象。
|
|
1847
1847
|
对象json示例:
|
|
1848
1848
|
{
|
|
1849
1849
|
"type": "ESXYZLayer",
|
|
@@ -1853,4 +1853,4 @@ ${y_}
|
|
|
1853
1853
|
`}));let Ag=co;const ls=class ls extends st{constructor(){super();p(this,"_loading",!1);p(this,"_loadedEvent",this.disposeVar(new H));p(this,"_loaded",!1);p(this,"_loadedPromiseResolve");p(this,"_loadedPromise",new Promise(t=>{this._loadedPromiseResolve=t}));p(this,"_processing");this._processing=this.disposeVar(wi(async t=>{if(this._loading=!0,window.Hls)console.info("可能系统已经加载hlsjs,此处不再加载!");else{const n=St.context.getStrFromEnv(ls.path);await t.promise(sc(n))}this._loading=!1,this._loaded=!0,this._loadedEvent.emit(),this._loadedPromiseResolve()})),this._processing.start()}get loading(){return this._loading}get loadedEvent(){return this._loadedEvent}get loaded(){return this._loaded}get loadedPromise(){return this._loadedPromise}get processing(){return this._processing}static instance(){return ls._instance=ls._instance||new ls,ls._instance}};p(ls,"path","${xr-utils-script-dir}/xr-static/xr-utils/hlsjs/1.4.12/hls.min.js"),p(ls,"_instance");let Su=ls,kO=class extends st{constructor(t,n){super();p(this,"_element");this._complexImage=t,this._videoSrc=n;var s=document.createElement("video");s.src=this._videoSrc,s.style.position="absolute",s.style.top="0px",s.style.left="0px",s.style.zIndex="-100",s.style.visibility="hidden";{const o=()=>{s.crossOrigin=this._complexImage.crossOrigin};o(),this.dispose(this._complexImage.crossOriginChanged.disposableOn(o))}{const o=()=>{s.autoplay=this._complexImage.autoplay};o(),this.dispose(this._complexImage.autoplayChanged.disposableOn(o))}{const o=()=>{s.loop=this._complexImage.loop};o(),this.dispose(this._complexImage.loopChanged.disposableOn(o))}s.muted=!0,document.body.appendChild(s),this._element=s,this.dispose(()=>document.body.removeChild(s))}get element(){return this._element}};class OO extends st{constructor(t,n){super();p(this,"_videoDom");p(this,"_processing");this._complexImage=t,this._videoSrc=n,this._videoDom=this.disposeVar(new kO(this._complexImage,"")),this._processing=this.disposeVar(wi(async s=>{const{videoSrc:o}=this,h=Su.instance();await s.promise(h.loadedPromise);const l=window.Hls,d=new l,f=this.element;await Ks(s,()=>new Promise((v,m)=>{f.xbsjHLS=d,d.attachMedia(f),d.on(l.Events.MEDIA_ATTACHED,()=>{d.loadSource(o),d.on(l.Events.MANIFEST_PARSED,(y,w)=>{f.play(),v()})}),d.on(l.Events.ERROR,(y,w)=>{const{type:S,details:T,fatal:N}=w;N&&(d.destroy(),m(T))})}))})),this._processing.start()}get videoSrc(){return this._videoSrc}get videoDom(){return this._videoDom}get element(){return this.videoDom.element}get processing(){return this._processing}}class __ extends st{constructor(t,n){super();p(this,"_videoDom");p(this,"_update");this._complexImage=t,this._imageUri=n,this._videoDom=this.disposeVar(new OO(this._complexImage,this._imageUri)),this._update=this.disposeVar(sa(()=>this.update())),this._update.start()}get videoDom(){return this._videoDom}get videoElement(){return this._videoDom.element}update(){if(this.videoElement.readyState<2)return;const t=this._complexImage,{videoWidth:n,videoHeight:s}=this.videoElement;t.size=[n,s],t.pixelFormat="RGBA",t.copyTexture({source:this.videoElement})}}const us=class us extends st{constructor(){super();p(this,"_loading",!1);p(this,"_loadedEvent",this.disposeVar(new H));p(this,"_loaded",!1);p(this,"_loadedPromiseResolve");p(this,"_loadedPromise",new Promise(t=>{this._loadedPromiseResolve=t}));p(this,"_processing");this._processing=this.disposeVar(wi(async t=>{if(this._loading=!0,window.flvjs)console.info("可能系统已经加载flvjs,此处不再加载!");else{const n=St.context.getStrFromEnv(us.path);await t.promise(sc(n))}this._loading=!1,this._loaded=!0,this._loadedEvent.emit(),this._loadedPromiseResolve()})),this._processing.start()}get loading(){return this._loading}get loadedEvent(){return this._loadedEvent}get loaded(){return this._loaded}get loadedPromise(){return this._loadedPromise}get processing(){return this._processing}static instance(){return us._instance=us._instance||new us,us._instance}};p(us,"path","${xr-utils-script-dir}/xr-static/xr-utils/flvjs/1.6.2/flv.min.js"),p(us,"_instance");let xu=us;class NO extends st{constructor(t,n){super();p(this,"_element");this._complexImage=t,this._videoSrc=n;var s=document.createElement("video");s.src=this._videoSrc,s.style.position="absolute",s.style.top="0px",s.style.left="0px",s.style.zIndex="-100",s.style.visibility="hidden";{const o=()=>{s.crossOrigin=this._complexImage.crossOrigin};o(),this.dispose(this._complexImage.crossOriginChanged.disposableOn(o))}{const o=()=>{s.autoplay=this._complexImage.autoplay};o(),this.dispose(this._complexImage.autoplayChanged.disposableOn(o))}{const o=()=>{s.loop=this._complexImage.loop};o(),this.dispose(this._complexImage.loopChanged.disposableOn(o))}s.muted=!0,document.body.appendChild(s),this._element=s,this.dispose(()=>document.body.removeChild(s))}get element(){return this._element}}class RO extends st{constructor(t,n){super();p(this,"_videoDom");p(this,"_processing");this._complexImage=t,this._videoSrc=n,this._videoDom=this.disposeVar(new NO(this._complexImage,"")),this._processing=this.disposeVar(wi(async s=>{const{videoSrc:o}=this,h=xu.instance();await s.promise(h.loadedPromise);const l=window.flvjs,d=this.element;await Ks(s,()=>new Promise((f,v)=>{if(!l.isSupported()){v("flvjs不支持!");return}var m=l.createPlayer({type:"flv",url:o});m.attachMediaElement(d),m.load(),m.play(),d.xbsjFlvPlayer=m}))})),this._processing.start()}get videoSrc(){return this._videoSrc}get videoDom(){return this._videoDom}get element(){return this.videoDom.element}get processing(){return this._processing}}class w_ extends st{constructor(t,n){super();p(this,"_videoDom");p(this,"_update");this._complexImage=t,this._imageUri=n,this._videoDom=this.disposeVar(new RO(t,this._imageUri)),this._update=this.disposeVar(sa(()=>this.update())),this._update.start()}get videoDom(){return this._videoDom}get videoElement(){return this._videoDom.element}update(){if(this.videoElement.readyState<2)return;const t=this._complexImage,{videoWidth:n,videoHeight:s}=this.videoElement;t.size=[n,s],t.pixelFormat="RGBA",t.copyTexture({source:this.videoElement})}}function E_(i){const e=i.substring(i.lastIndexOf(".")+1);return Th.suffixTypes[e]}class Th extends st{constructor(){super();p(this,"_enabled",this.disposeVar(it(!1)));p(this,"_uri",this.disposeVar(it("")));p(this,"_type",this.disposeVar(it(void 0)));p(this,"_size",this.disposeVar(Wt(void 0)));p(this,"_pixelFormat",this.disposeVar(it("RGBA")));p(this,"_flipY",this.disposeVar(it(!0)));p(this,"_crossOriginReact",this.disposeVar(it("")));p(this,"_autoplayReact",this.disposeVar(it(!0)));p(this,"_loopReact",this.disposeVar(it(!0)));p(this,"_copyTextureEvent",this.disposeVar(new H));p(this,"_imageProcessingResettingEvent",this.disposeVar(we(this.enabledChanged,this.uriChanged,this.typeChanged)));p(this,"_imageProcessingResetting",this.disposeVar(new xe(this._imageProcessingResettingEvent,()=>{if(!this.enabled||!this.uri)return;let{type:t}=this;if(t||(t=E_(this.uri)),!!t){if(t==="img")return new tm(this,this.uri);if(t==="video")return new nm(this,this.uri);if(t==="gif")return new fm(this,this.uri);if(t==="hls")return new __(this,this.uri);if(t==="flv")return new w_(this,this.uri)}})));p(this,"_createNativeTextureEvent",this.disposeVar(we(this.enabledChanged,this.sizeChanged,this.pixelFormatChanged,this.flipYChanged)))}get enabled(){return this._enabled.value}set enabled(t){this._enabled.value=t}get enabledChanged(){return this._enabled.changed}get uri(){return this._uri.value}set uri(t){this._uri.value=t}get uriChanged(){return this._uri.changed}get type(){return this._type.value}set type(t){this._type.value=t}get typeChanged(){return this._type.changed}get size(){return this._size.value}set size(t){this._size.value=t}get sizeChanged(){return this._size.changed}get pixelFormat(){return this._pixelFormat.value}set pixelFormat(t){this._pixelFormat.value=t}get pixelFormatChanged(){return this._pixelFormat.changed}get flipY(){return this._flipY.value}set flipY(t){this._flipY.value=t}get flipYChanged(){return this._flipY.changed}get crossOrigin(){return this._crossOriginReact.value}set crossOrigin(t){this._crossOriginReact.value=t}get crossOriginChanged(){return this._crossOriginReact.changed}get autoplay(){return this._autoplayReact.value}set autoplay(t){this._autoplayReact.value=t}get autoplayChanged(){return this._autoplayReact.changed}get loop(){return this._loopReact.value}set loop(t){this._loopReact.value=t}get loopChanged(){return this._loopReact.changed}get copyTextureEvent(){return this._copyTextureEvent}copyTexture(t){this._createNativeTextureEvent.flush(),this._copyTextureEvent.emit(t)}get imageProcessingResetting(){return this._imageProcessingResetting}get createNativeTextureEvent(){return this._createNativeTextureEvent}copyFromCanvas(t){if(t.width<=0||t.height<=0){console.warn("canvas.width <= 0 || canvas.height <= 0");return}this.size=[t.width,t.height],this.pixelFormat="RGBA",this.copyTexture({source:t})}}p(Th,"types",im),p(Th,"czmPixelFormats",em),p(Th,"suffixTypes",{png:"img",jpg:"img",svg:"img",webp:"img",gif:"gif",mp4:"video",mov:"video",webm:"video",flv:"flv",m3u8:"hls"});const AO=[0,0,0,0];class DO{constructor(){p(this,"_value",[]);p(this,"_valueStr","[]");p(this,"_valueChanged");this.value=[{ratio:0,rgba:[0,0,1,1]},{ratio:.2,rgba:[0,1,0,1]},{ratio:.8,rgba:[1,1,0,1]},{ratio:1,rgba:[1,0,0,1]}]}get valueChanged(){return this._valueChanged||(this._valueChanged=new H),this._valueChanged}set value(e){if(e.length===0){console.error("value.length === 0");return}let t;if(this._value.length===e.length){const s=[...e].sort((o,h)=>o.ratio-h.ratio);if(t=JSON.stringify(s),this._valueStr===t)return}t=t||JSON.stringify([...e].sort((s,o)=>s.ratio-o.ratio));const n=this._value;if(this._value=JSON.parse(t),this._value.length===0)throw console.error("this._colorStops.length === 0"),new Error("this._colorStops.length === 0");this._valueChanged&&this._valueChanged.emit(this._value,n)}get value(){return JSON.parse(JSON.stringify(this._value))}get valueStr(){return this._valueStr}get minRatio(){return this._value[0].ratio}get maxRatio(){return this._value[this._value.length-1].ratio}_getRatioIndex(e){if(e<this._value[0].ratio||e>this._value[this._value.length-1].ratio)throw console.error("ratio <= this._colorStops[0].ratio || ratio >= this._colorStops[this._colorStops.length - 1].ratio"),new Error("ratio <= this._colorStops[0].ratio || ratio >= this._colorStops[this._colorStops.length - 1].ratio");let t=this._value.length;for(let n=0;n<t-1;++n)if(e>=this._value[n].ratio&&e<=this._value[n+1].ratio)return n;throw console.error("shoud not be here!"),new Error("shoud not be here!")}getRatioColor(e,t){e=Qh(e,this.minRatio,this.maxRatio);const n=this._getRatioIndex(e),s=this._value[n],o=this._value[n+1],h=(e-s.ratio)/(o.ratio-s.ratio);for(let l=0;l<4;++l)t[l]=s.rgba[l]*(1-h)+o.rgba[l]*h;if(t.some(Number.isNaN)){console.error("result NaN");return}return t}getColorsInUint8(e){if(e.length%4!==0)throw console.error("result.length % 4 !== 0"),new Error("result.length % 4 !== 0");const t=e.length/4,n=1/t;for(let s=0;s<t;++s){const o=AO;this.getRatioColor((s+.5)*n,o)||o.splice(0,4,0,0,0,0);for(let h=0;h<4;++h)e[s*4+h]=255*o[h]|0}return e}}class LO extends st{constructor(){super(...arguments);p(this,"registerEngines",{})}register(t,n,s){const o=this.registerEngines[t]||new Map;return o.has(n)&&console.warn(`register warn:${t}中${n}的实现类已经被注册,再次注册会覆盖。`),o.set(n,s),this.registerEngines[t]=o,n}getEngineObjConstructor(t,n){const s=this.registerEngines[n];if(!s)return;let o=t.constructor,h=t.typeName,l=s.get(h);if(l)return l;if(t.components.main)return;const d=h;for(;h!=="ESSceneObject"&&(o=o.getParentClass(),!!o);)if(h=o.type,l=s.get(h),l)return console.warn(`未找到${d}在${n}中对应的实现类! 使用父类${h}的实现类!`),l}createEngineObject(t,n){const s=this.getEngineObjConstructor(t,n.typeName);if(s){const o=new s(t,n);return o.createdEvent.emit(),o}else{const o=new pr(t,n);return o.createdEvent.emit(),o}}}class FO extends st{constructor(){super(...arguments);p(this,"registerEngines",{})}register(t,n,s){const o=this.registerEngines[t]||new Map;o.has(n)&&console.warn(`register warn:${t}中${n}的实现类已经被注册,再次注册会覆盖。`),o.set(n,s),this.registerEngines[t]=o}getEngineObjConstructor(t,n){const o=(this.registerEngines[n]||new Map).get(t);if(o)return o;console.warn(`未找到${t}在${n}中对应的实现类!`)}createEngineObject(t,n){const s=this.getEngineObjConstructor(t.typeName,n.typeName);if(s){const o=new s(t,n);return o.createdEvent.emit(),o}else{const o=new pr(t,n);return o.createdEvent.emit(),o}}}const Xi=class Xi extends st{constructor(t,n,s=!1){super();p(this,"_createdEvent",this.dv(new H));p(this,"_id",++Xi._accumId);this._sceneObject=t,this._viewer=n;{if(s)return;const o=(h,l)=>{for(let d of h)this._viewer.delete(d);for(let d of l)d.parentID=this.sceneObject.id,this._viewer.add(d)};o([],this._sceneObject.components.values()),this.d(this._sceneObject.components.toChange.don(o)),this.d(()=>o(this._sceneObject.components.values(),[]))}}get createdEvent(){return this._createdEvent}get sceneObject(){return this._sceneObject}get viewer(){return this._viewer}get id(){return this._id}};p(Xi,"context",new LO),p(Xi,"contextEditing",new FO),p(Xi,"register",Xi.context.register.bind(Xi.context)),p(Xi,"registerEditing",Xi.contextEditing.register.bind(Xi.contextEditing)),p(Xi,"_accumId",-1);let pr=Xi;function S_(i){return typeof i=="string"?document.getElementById(i):i}function Dg(i){if(!i)throw new Error("container is not defined");i.innerHTML="";const e=document.createElement("div");return e.style.cssText="width: 100%; height: 100%; margin: 0px; padding: 0px; border: none; overflow: hidden; position: relative; z-index: 0; background: rgba(0,0,0,0);",i.appendChild(e),e}class x_ extends st{constructor(t,n){super();p(this,"_listeningSceneObjects",new Map);this._sceneObjectsMananger=t,this._createSceneObjectListeningFunc=n;const s=this._listeningSceneObjects,o=(h,l)=>{if(h)for(let d of h){const f=s.get(d);f&&(f.destroy(),s.delete(d))}if(l)for(let d of l){if(s.get(d)){console.warn(`listeningSceneObjects已存在某对象:${d.name}`,d);debugger}const v=this.createSceneObjectListeningFunc(d);v&&s.set(d,v)}};o(void 0,this._sceneObjectsMananger.sceneObjects),this.dispose(this._sceneObjectsMananger.sceneObjectsToChange.disposableOn(o)),this.dispose(()=>{for(let h of this._listeningSceneObjects.values())h.destroy();this._listeningSceneObjects.clear()})}get listeningSceneObjects(){return this._listeningSceneObjects}get createSceneObjectListeningFunc(){return this._createSceneObjectListeningFunc}}class GO extends st{constructor(e){super(),this._esObjectsManager=e;{const t=this._esObjectsManager;class n extends st{constructor(o){super(),this._esPath=o,this.dv(new xe(t.activeViewerChanged,()=>{const h=t.activeViewer;if(!h)return;class l extends st{constructor(f){if(super(),this._esPath=f,!h)throw new Error("!viewer");const v=()=>{const m=t.activeViewer;m&&(this._esPath.path.currentTime=m.simulationTime)};v(),this.d(h.simulationTimeChanged.don(v))}}return new l(this._esPath)}))}}this.dv(new x_(t.sceneObjectsManager,s=>{if(s instanceof ka)return new n(s)}))}{const t=this._esObjectsManager;class n extends st{constructor(o){super();const h=()=>{const l=t.activeViewer;l&&(l.simulationTime=o.currentTime??0)};h(),this.d(o.currentTimeChanged.don(h))}}this.dv(new x_(t.sceneObjectsManager,s=>{if(s instanceof Ta)return new n(s)}))}}}class jO extends st{constructor(e){super(),e.forEach(t=>{this.d(t.path.currentPositionChanged.don(n=>{n&&t.sceneObjects.forEach(s=>{Reflect.has(s,"position")&&(s.position=[...n])})})),this.d(t.path.currentRotationChanged.don(n=>{n&&t.sceneObjects.forEach(s=>{Reflect.has(s,"rotation")&&(s.rotation=[...n])})}))})}}class BO extends st{constructor(t){super();p(this,"_player");p(this,"_channels",this.dv(vt([])));this._objectManager=t,this._player=this._objectManager.player,this.dv(new xe(this.channelsChanged,()=>{if(this.channels.length===0)return;const n=[];for(let s=0;s<this.channels.length;s++){const o=this.channels[s],h=St.getSceneObjById(o.pathId);if(!h||!(h instanceof ka))continue;const d=o.sceneObjectIds.map(f=>St.getSceneObjById(f)).filter(f=>f!==void 0);d.length!==0&&n.push({path:h,sceneObjects:d})}if(n.length!==0)return new jO(n)}))}get player(){return this._player}get channels(){return this._channels.value}get channelsChanged(){return this._channels.changed}set channels(t){this._channels.value=t}}function b_(i,e,t,n){if(t)n.currentActiveEditing=[i,e];else if(n.currentActiveEditing){const[s,o]=n.currentActiveEditing;s===i&&o===e&&(t||(n.currentActiveEditing=void 0))}}const zO=["editing","positionEditing","locationEditing","pointEditing","rotationEditing"];class UO extends st{constructor(e,t){super(),this._sceneObject=e;const n=this._sceneObject;for(let s of zO){const o=s+"Changed",h=n[o];if(h){{const l=n[s];b_(n,s,l,t)}this.dispose(h.disposableOn((l=>b_(n,s,l,t))))}}}get sceneObject(){return this._sceneObject}}class VO extends st{constructor(){super();p(this,"_currentActiveEditing",this.disposeVar(Wt(void 0)));p(this,"_currentActiveEditingLastChangedTime",0);this.dispose(this._currentActiveEditing.changed.disposableOn((t,n)=>{if(this._currentActiveEditingLastChangedTime=Date.now(),n){const[s,o]=n;s[o]===!0&&(s[o]=!1)}if(t){const[s,o]=t;s[o]=!0}})),St.context.sceneObjCreatedEvent.don(t=>{t.dv(new UO(t,this))})}get currentActiveEditing(){return this._currentActiveEditing.value}set currentActiveEditing(t){this._currentActiveEditing.value=t}get currentActiveEditingChanged(){return this._currentActiveEditing.changed}get currentActiveEditingLastChangedTime(){return this._currentActiveEditingLastChangedTime}}class qO extends st{constructor(){super();p(this,"_sceneObjects",new Set);p(this,"_sceneObjectsToChange",this.dv(new H));this.d(()=>{const t=ec(this._sceneObjects);t!==0&&console.warn(`场景对象管理器销毁时仍然管理着${t}个场景对象!`)})}get sceneObjects(){return this._sceneObjects}get sceneObjectsToChange(){return this._sceneObjectsToChange}addSceneObject(t){return this._sceneObjects.has(t)?(console.warn(`创建失败:对象${t.typeName+":"+t.id}已经存在于场景对象管理器中!}`),!1):(this._sceneObjectsToChange.emit([],[t]),this._sceneObjects.add(t),!0)}deleteSceneObject(t){return this._sceneObjects.has(t)?(this._sceneObjectsToChange.emit([t],[]),this._sceneObjects.delete(t),!0):(console.warn(`删除失败:对象${t.typeName+":"+t.id}不存在于场景对象管理器中!}`),!1)}createSceneObject(t,n){const s=St.context.createSceneObject(t,n);return s&&this.addSceneObject(s),s}createSceneObjectFromUrl(t,n){const s=St.context.createSceneObjectFromUrl(t,n);return s&&this.addSceneObject(s),s}createSceneObjectFromClass(t,n){const s=St.context.createSceneObjectFromClass(t,n);return s&&this.addSceneObject(s),s}createSceneObjectFromJson(t){const n=St.context.createSceneObjectFromJson(t);return n&&this.addSceneObject(n),n}}class $O extends st{constructor(t){super();p(this,"_enabled",this.dv(it(!1)));p(this,"_cursorPosition",it(void 0));p(this,"quickPickPosition",!0);let n=new st;const s=()=>{n&&(n.destroy(),n=void 0)};this.d(s);const o=()=>{if(s(),!t||!this._enabled.value)return;n=new st;const h=n.dv(it(void 0)),l=n.dv(we(h.changed));n.d(t.pointerMoveEvent.don(f=>{f.pointerEvent&&(h.value=$e(f.pointerEvent))}));const d=n.dv(wi(async f=>{if(h.value)if(this.quickPickPosition){const v=await f.promise(na(t.quickPickPosition(h.value)));this._cursorPosition.value=v}else{const v=await f.promise(na(t.pickPosition(h.value)));this._cursorPosition.value=v}}));n.d(l.don(()=>{d.restart()}))};o(),this.d(this._enabled.changed.don(o))}get enabled(){return this._enabled.value}set enabled(t){this._enabled.value=t}get enabledChanged(){return this._enabled.changed}get cursorPosition(){return this._cursorPosition.value}get cursorPositionChanged(){return this._cursorPosition.changed}}class WO extends st{constructor(t){super();p(this,"cursorPositionInfo");this.viewer=t,this.cursorPositionInfo=this.dv(new $O(this.viewer))}}class HO extends st{constructor(t){super();p(this,"viewer");const n=this.viewer=t;this.ad(new xe(n.rollerShutterChanged,()=>{const s=n.container;if(!s||!n.rollerShutter)return;const o=new st;this.viewer.splitPosition=.5;let h=this.getRollerShutterDIV();return s.appendChild(h),o.d(()=>{this.viewer.splitPosition=0,s.removeChild(h)}),o}))}getRollerShutterDIV(){let t=document.createElement("div");t.style.position="absolute",t.style.left="50%",t.style.top="0",t.style.backgroundColor="#d3d3d3",t.style.width="5px",t.style.height="100%",t.style.zIndex="9999";const n=s=>{if(!t.parentElement)return;s.preventDefault?s.preventDefault():s.returnValue=!1;const h=s.x/t.parentElement.offsetWidth;t.style.left=`${100*h}%`,this.viewer.splitPosition=h};return t.addEventListener("mouseenter",s=>{t.style.cursor="ew-resize"}),t.addEventListener("mouseleave",s=>{t.style.cursor="default"}),t.addEventListener("mousedown",s=>{t.style.cursor="ew-resize",document.addEventListener("mousemove",n)}),document.addEventListener("mouseup",s=>{t.style.cursor="default",document.removeEventListener("mousemove",n)}),t}}class XO extends st{constructor(t){super();p(this,"rollerShutterAnalysis");this.rollerShutterAnalysis=this.ad(new HO(t))}}function P_(i,e){return i.length===e.length&&i.every((t,n)=>t===e[n])}class YO extends st{constructor(e){super(),this._viewer=e,this.d(Q([this._viewer,"currentTime"],[this._viewer,"simulationTime"]))}}class JO extends st{constructor(e,t){super(),this._viewer=e,this._activeViewer=t;const n=on.createCommonProps(),s=[];Object.keys(n).forEach(d=>{const f=this._activeViewer[d+"Changed"];s.push(f)});const o=this.dv(we(...s)),h=()=>{this._viewer.status!=="Created"||this._activeViewer.status!=="Created"||Object.keys(n).forEach(d=>{this._viewer[d]=this._activeViewer[d]})};this.d(o.don(h));const l=this.dv(To());l.restart(void 0,async()=>{if(this._viewer.status!=="Created"||this._activeViewer.status!=="Created")return;const d=this._activeViewer.getCurrentCameraInfo(),f=this._viewer.getCurrentCameraInfo();if(!d)return;const{position:v,rotation:m}=d;f&&P_(v,f.position)&&P_(m,f.rotation)||this._viewer.flyIn(v,m,0)}),this.d(()=>l.cancel())}}const KO=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid" width="40" height="40" style="shape-rendering: auto; display: block; background: rgba(255, 255, 255, 0);" xmlns:xlink="http://www.w3.org/1999/xlink"><g><circle stroke-linecap="round" fill="none" stroke-dasharray="50.26548245743669 50.26548245743669" stroke="#ffffff" stroke-width="8" r="32" cy="50" cx="50">
|
|
1854
1854
|
<animateTransform values="0 50 50;360 50 50" keyTimes="0;1" dur="1s" repeatCount="indefinite" type="rotate" attributeName="transform"></animateTransform>
|
|
1855
1855
|
</circle><g></g></g></svg>
|
|
1856
|
-
`,ZO='<svg t="1747028305766" class="icon" viewBox="0 0 1032 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3881" width="40" height="40"><path d="M0.1536 547.700736c-0.205824-0.187392-0.205824-0.49152 0.008192-0.68608l80.672768-73.590784a0.63488 0.63488 0 0 1 0.7936-0.029696l263.043072 203.0336c0.667648 0.515072 1.738752 0.498688 2.393088-0.038912l609.191936-500.133888a0.605184 0.605184 0 0 1 0.768 0.022528l74.84928 67.229696a0.454656 0.454656 0 0 1-0.002048 0.685056l-685.234176 618.19904a1.14688 1.14688 0 0 1-1.518592-0.012288L0.1536 547.700736z" fill="#ffffff" p-id="3882"></path></svg>',QO='<svg t="1747028398107" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1146" width="40" height="40"><path d="M415.744006 1.033277A0.992256 0.992256 0 0 1 416.747526 0.000061h189.5045c0.569344 0 1.017856 0.45056 1.001472 1.033216l-21.227518 754.803667a1.062912 1.062912 0 0 1-1.05984 1.032192h-146.933752c-0.569344 0-1.04448-0.45056-1.059839-1.032192L415.744006 1.033277zM511.510528 1024c-52.595709 0-95.231994-39.866366-95.231994-89.043963 0-49.176573 42.636285-89.042939 95.231994-89.042938 52.594685 0 95.231994 39.866366 95.231994 89.042938 0 49.177597-42.637309 89.043963-95.231994 89.043963z" fill="#ffffff" p-id="1147"></path></svg>',zr=class zr extends st{constructor(e){super();const t=()=>{const n=this.dv(new lu);this.d(Q([n,"show"],[e,"useDefaultStatusDiv"]));{const s=()=>{n.show=(e.useDefaultStatusDiv??!0)&&e.status!=="Created"};s(),this.d(e.useDefaultStatusDivChanged.don(s)),this.d(e.statusChanged.don(s)),n.cssText="width:100%;height:100%;position:absolute;left:0px;top:0px;"}e.add(n),this.d(()=>e.delete(n)),n.instanceClass=class extends st{constructor(h,l,d){super();p(this,"_div",document.createElement("div"));if(this._subContainer=h,!d)return;this._subContainer.appendChild(this._div),this.d(()=>this._subContainer.removeChild(this._div));{const S=()=>{l.show?this._div.style.opacity="1":this._div.style.opacity="0"};S(),this.d(l.showChanged.don(S))}let f,v,m,y,w;this._div.style.pointerEvents="none",this._div.style.position="absolute",this._div.style.width="100%",this._div.style.height="100%",this._div.style.backgroundColor="rgba(0, 0, 0, 0.4)",this._div.style.zIndex="100",this._div.style.transition="opacity 2s",f=document.createElement("div"),this._div.appendChild(f),f.style.width="auto",f.style.position="absolute",f.style.left="50%",f.style.top="50%",f.style.transform="translate(-50%,-50%)",f.style.background="rgba(120, 120, 0, 0.7)",f.style.color="white",f.style.fontSize="10px",f.style.background="none",f.style.display="flex",f.style.justifyContent="center",f.style.alignItems="center",v=document.createElement("div"),f.appendChild(v),v.style.pointerEvents="none",v.style.display="block",v.style.width="40px",v.innerHTML=zr.defaultsSvg.loadingSvg,v.style.filter="drop-shadow(0px 0px 1px black)",m=document.createElement("div"),f.appendChild(m),m.style.pointerEvents="none",m.style.marginLeft="10px",m.style.display="flex",m.style.flexFlow="column",m.style.maxWidth="300px",y=document.createElement("div"),m.appendChild(y),y.style.fontSize="14px",y.style.fontWeight="800",y.style.marginBottom="5px",y.style.textShadow="0 0 2px black",w=document.createElement("div"),m.appendChild(w),w.style.fontWeight="400",w.style.textShadow="0 0 2px black";{const S=()=>{let N="Raw";d.status==="Raw"?N="初始状态":d.status==="Creating"?N="正在创建":d.status==="Created"?N="创建完成":d.status==="Error"?N="创建失败":d.status==="Reconnecting"&&(N="重新连接"),y.innerText=`${N}(${d.status})`,w.innerText=`${d.statusLog}`,(d.status==="Creating"||d.status==="Reconnecting")&&(v.innerHTML=zr.defaultsSvg.loadingSvg),d.status==="Created"&&(v.innerHTML=zr.defaultsSvg.successSvg),d.status==="Error"&&(v.innerHTML=zr.defaultsSvg.warnSvg)};S();const T=this.dv(we(d.statusLogChanged,d.statusChanged));this.d(T.don(S))}}update(){const h=255*Math.random()|0,l=255*Math.random()|0,d=255*Math.random()|0;this._div.style.background=`rgba(${h}, ${l}, ${d}, 0.8)`}}};this.d(e.containerChanged.don(()=>{t()}))}};p(zr,"defaultsSvg",{loadingSvg:KO,successSvg:ZO,warnSvg:QO});let Lg=zr;class tN extends st{constructor(e,t,n){super(),this._subContainer=e,this._overlayContainer=t,this._viewer=n;const s=this._subContainer,o=this._overlayContainer,h=this._viewer,l=()=>{const v=h.zIndex??"";s.style.zIndex=v,o.style.zIndex=v};l(),this.d(h.zIndexChanged.don(l));const d=()=>{s.style.display=h.show??!0?"block":"none"};d(),this.d(h.showChanged.don(d));const f=()=>{s.style.opacity=`${h.opacity??1}`};f(),this.d(h.opacityChanged.don(f))}}function bu(i){let e=_i(i,"_relativeContainer");return e||(e=document.createElement("div"),e.style.position="relative",e.style.width="100%",e.style.height="100%",e.style.padding="0",e.style.margin="0",i.appendChild(e),yn(i,"_relativeContainer",e)),e}class eN extends st{constructor(t,n){super();p(this,"_subContainer",document.createElement("div"));p(this,"_overlayContainer",document.createElement("div"));p(this,"_containerStyleController");this._container=t,this._viewer=n,this._containerStyleController=this.dv(new tN(this._subContainer,this._overlayContainer,this._viewer));const{subContainer:s,overlayContainer:o}=this;s.tabIndex=-1,s.style.outline="none",s.style.width="100%",s.style.height="100%",s.onpointerdown=()=>s.focus(),o.style.position="relative",o.setAttribute("earthsdk3","earthsdk3-overlayContainer"),s.setAttribute("earthsdk3","earthsdk3-subContainer"),bu(this._container).appendChild(s),this.d(()=>bu(this._container).removeChild(s)),bu(this._container).appendChild(o),this.d(()=>bu(this._container).removeChild(o))}get subContainer(){return this._subContainer}get overlayContainer(){return this._overlayContainer}get containerStyleController(){return this._containerStyleController}get container(){return this._container}}class iN extends st{constructor(){super(...arguments);p(this,"registerObjsMap",new Map)}register(t,n){return this.registerObjsMap.has(t)&&console.warn(`register warn:${t}已经被注册,再次注册会覆盖。`),this.registerObjsMap.set(t,n),t}getViewerConstructor(t){const n=this.registerObjsMap.get(t);if(!n){console.warn(`未找到${t}类!`);return}return n}createViewer(t){const n=t.type;console.log(t);const s=this.getViewerConstructor(n);if(!s)throw new Error(`没有找到类型为${n}的Viewer构造器!`);return new s(t)}}class C_ extends st{constructor(e,t,n=!1,s=!1){if(super(),this._viewer=e,!t)throw new Error("ViewerCustomInteraction: container is null");const o=this.dv(ce.create(t,"pointerdown")),h=this.dv(ce.create(t,"pointermove")),l=this.dv(ce.create(t,"pointerup")),d=this.dv(ce.create(t,"pointerout")),f=this.dv(ce.create(t,"pointerover")),v=this.dv(new mc),m=this.dv(new Mp),y=()=>{const M=this._viewer.hoverTime*1e3;m.delayTime=M};this.d(this._viewer.hoverTimeChanged.don(()=>{y()})),this.d(o.don(M=>v.pointerDown(M))),this.d(h.don(M=>v.pointerMove(M))),this.d(l.don(M=>v.pointerUp(M))),this.d(d.don(M=>v.pointerOut(M))),this.d(o.don(M=>m.pointerDown(M))),this.d(h.don(M=>m.pointerMove(M))),this.d(l.don(M=>m.pointerUp(M))),this.d(d.don(M=>m.pointerOut(M)));const{x:w,y:S}=t.getBoundingClientRect(),T=s?w:0,N=s?S:0;this.d(m.hoverEvent.don(M=>{const[D,L]=ta(M,n);this._viewer.hoverEvent.emit({screenPosition:[D+T,L+N],pointerEvent:M})})),this.d(v.clickEvent.don(M=>{const[D,L]=ta(M,n);this._viewer.clickEvent.emit({screenPosition:[D+T,L+N],pointerEvent:M})})),this.d(v.dbclickEvent.don(M=>{const[D,L]=ta(M,n);M.button===0&&this._viewer.dblclickEvent.emit({screenPosition:[D+T,L+N],pointerEvent:M})})),this.d(o.don(M=>{const[D,L]=ta(M,n);M.button===0&&this._viewer.pointerDownEvent.emit({screenPosition:[D+T,L+N],pointerEvent:M})})),this.d(l.don(M=>{const[D,L]=ta(M,n);M.button===0&&this._viewer.pointerUpEvent.emit({screenPosition:[D+T,L+N],pointerEvent:M})})),this.d(h.don(M=>{const[D,L]=$e(M,n);this._viewer.pointerMoveEvent.emit({screenPosition:[D+T,L+N],pointerEvent:M})})),this.d(f.don(M=>{const[D,L]=$e(M,n);this._viewer.pointerOverEvent.emit({screenPosition:[D+T,L+N],pointerEvent:M})})),this.d(d.don(M=>{const[D,L]=$e(M,n);this._viewer.pointerOutEvent.emit({screenPosition:[D+T,L+N],pointerEvent:M})}));const j=this.dv(ce.create(t,"keydown"));this.d(j.don(M=>this._viewer.keyDownEvent.emit(M)));const C=this.dv(ce.create(t,"keyup"));this.d(C.don(M=>this._viewer.keyUpEvent.emit(M)));const k=this.dv(ce.create(t,"wheel"));this.d(k.don(M=>this._viewer.wheelEvent.emit(M)))}}const cs=class cs extends st{constructor(t){super();p(this,"_forceRecreateEvent",this.dv(new H));p(this,"_container",this.dv(it(void 0)));p(this,"_containerSize",this.dv(it(void 0)));p(this,"_editingEvent",this.disposeVar(new H));p(this,"_esViewerExtensions",this.dv(new WO(this)));p(this,"_status",this.dv(it("Raw")));p(this,"_statusLog",this.dv(it("")));p(this,"_statusContainer",this.dv(new Lg(this)));p(this,"_useCustomInteraction",this.dv(it(!0)));p(this,"_resetInteractionEvent",this.dv(we(this.containerChanged,this._useCustomInteraction.changed,this._forceRecreateEvent)));p(this,"_interactionResetting",this.dv(new xe(this._resetInteractionEvent,()=>{if(!(!this.container||!this._useCustomInteraction.value))return new C_(this,this.container)})));p(this,"_viewerChanged",this.dv(new H));p(this,"_cameraChanged",this.dv(new H));p(this,"_containerResetEvent",this.dv(we(this.containerChanged,this._forceRecreateEvent)));p(this,"_containerResetting",this.dv(new xe(this._containerResetEvent,()=>{if(this.container)return new eN(this.container,this)})));p(this,"_sceneObjectsMap",new Map);p(this,"_id");p(this,"_typeName");p(this,"_updateFuncReact",this.dv(it(void 0)));p(this,"_toDestroyFuncReact",this.dv(it(void 0)));p(this,"_statusInfo",cs.defaults.statusInfo);p(this,"_navigationMode",this.dv(it("Map")));p(this,"_navigationEvent",this.disposeVar(new H));p(this,"_syncViewer",this.dv(it(void 0)));p(this,"_syncEventDon",this.dv(new xe(this.syncViewerChanged,()=>{const t=this.syncViewer;if(t)return new JO(this,t)})));p(this,"_timeSyncdon",this.dv(new xe(this.timeSyncChanged,()=>{if(this.timeSync)return new YO(this)})));p(this,"_hoverEvent",this.dv(new H));p(this,"_pointerOverEvent",this.dv(new H));p(this,"_pointerMoveEvent",this.dv(new H));p(this,"_pointerDownEvent",this.dv(new H));p(this,"_pointerUpEvent",this.dv(new H));p(this,"_pointerOutEvent",this.dv(new H));p(this,"_clickEvent",this.dv(new H));p(this,"_dblclickEvent",this.dv(new H));p(this,"_keyDownEvent",this.dv(new H));p(this,"_keyUpEvent",this.dv(new H));p(this,"_wheelEvent",this.dv(new H));p(this,"_actived",this.dv(it(!1)));this._id=t.id??Zr();const n=S_(t.container);if(n)this._container.value=Dg(n),this._typeName=t.type,this._initName();else throw new Error("container is not defined");{const s=()=>{n&&(this.show??!0?n.style.display="block":n.style.display="none")};s(),this.d(this.showChanged.don(s))}{const s=this._sceneObjectsMap,o=()=>{for(let[l,d]of s.entries())if(!d&&l){const f=pr.context.createEngineObject(l,this);f&&s.set(l,f)}},h=()=>{for(let[l,d]of s.entries())d&&!d.isDestroyed()&&d.destroy(),s.set(l,void 0)};this.d(h),this.d(this.viewerChanged.don(l=>{h(),l&&o()}))}{const s=()=>{if(this.execOnceFuncStr)try{Function(`"use strict";return (${this.execOnceFuncStr})`)()(this)}catch(o){console.warn(`execOnceFuncStr不能转成函数!或者函数执行时错误!id: ${this.id} ${this.typeName} error: ${o}`)}};s(),this.d(this.execOnceFuncStrChanged.don(s))}{const s=()=>{if(this.updateFuncStr)try{this.updateFunc=Function(`"use strict";return (${this.updateFuncStr})`)()}catch(h){console.warn(`updateFuncStr不能转成函数!或者函数执行时错误!id: ${this.id} ${this.typeName} error: ${h}`)}};s(),this.d(this.updateFuncStrChanged.don(s));let o;this.d(()=>o&&o.destroy()),this.d(this.updateFuncChanged.don(()=>{o&&o.cancel(),this.updateFunc&&(o=o||To(),o.restart(void 0,h=>{this.updateFunc&&this.updateFunc(this,h)}))}))}{const s=()=>{try{this.toDestroyFunc=this.toDestroyFuncStr&&Function(`"use strict";return (${this.toDestroyFuncStr})`)()||void 0}catch(o){console.warn(`toDestroyFuncStr不能转成函数!或者函数执行时错误!id: ${this.id} ${this.typeName} error: ${o}`),this.toDestroyFunc=void 0}};s(),this.d(this.toDestroyFuncStrChanged.don(s)),this.d(this.toDestroyEvent.don(()=>{this.toDestroyFunc&&this.toDestroyFunc(this)}))}this.ad(new XO(this))}forceRecreate(){this._forceRecreateEvent.emit()}get container(){return this._container.value}set container(t){this._container.value=t}set containerOrId(t){if(typeof t=="string"){const n=document.getElementById(t);n&&n instanceof HTMLDivElement?this._container.value=Dg(n):console.warn("containerOrId warn: !(container instanceof HTMLDivElement)")}else t instanceof HTMLDivElement?this._container.value=Dg(t):console.warn("containerOrId warn: setting container failed!")}get containerChanged(){return this._container.changed}get containerSize(){return this._containerSize.value}set containerSize(t){this._containerSize.value=t}get containerSizeChanged(){return this._containerSize.changed}get editingEvent(){return this._editingEvent}get esViewerExtensions(){return this._esViewerExtensions}get status(){return this._status.value}get statusChanged(){return this._status.changed}setStatus(t){this._status.value=t}get statusLog(){return this._statusLog.value}get statusLogChanged(){return this._statusLog.changed}setStatusLog(t){this._statusLog.value=t}get useCustomInteraction(){return this._useCustomInteraction.value}set useCustomInteraction(t){this._useCustomInteraction.value=t}get viewerChanged(){return this._viewerChanged}get cameraChanged(){return this._cameraChanged}get containerResetEvent(){return this._containerResetEvent}get subContainer(){var t;return(t=this._containerResetting.obj)==null?void 0:t.subContainer}get subContainerChanged(){return this._containerResetting.objChanged}get overlayContainer(){var t;return(t=this._containerResetting.obj)==null?void 0:t.overlayContainer}get overlayContainerChanged(){return this._containerResetting.objChanged}get sceneObjectsMap(){return this._sceneObjectsMap}get sceneObjects(){return this._sceneObjectsMap.keys()}getEngineObject(t){return this.sceneObjectsMap.get(t)}add(...t){for(let n of t)if(!this.has(n)){St.context.addSceneObject(n);const s=pr.context.createEngineObject(n,this);s&&this._sceneObjectsMap.set(n,s),n.viewerAttached.emit(this)}}delete(...t){for(let n of t)if(this.has(n)){const s=this._sceneObjectsMap.get(n);s&&s.destroy(),St.context.deleteSceneObject(n),this._sceneObjectsMap.delete(n),n.viewerDetached.emit(this)}}disposableAdd(...t){return this.add(...t),()=>this.delete(...t)}disAdd(...t){return this.disposableAdd(...t)}has(t){return this._sceneObjectsMap.has(t)}clearAllSceneObjects(){for(let t of this.sceneObjects)this.delete(t)}get id(){return this._id}set id(t){console.warn("ESViewer id is readonly")}get typeName(){return this._typeName}_initName(){this.name=`${this.typeName}_${(""+this.id).slice(-4)}`}get defaultProps(){return cs.createDefaultProps()}get completeJson(){return this._getJson(!1)}_getJson(t=!0){const n={id:this.id,type:this.typeName};for(let s of Object.keys(this.defaultProps))if(t){let o,h=this.defaultProps[s];h instanceof Ne?o=h.equals(this[s]):o=h===this[s],o||(n[s]=this[s])}else n[s]=this[s];return n}_setJson(t,n,s){if(!(t instanceof Object)||t.type&&t.type!==this.typeName){console.error(`value.type && value.type${t.type} !== this.typeName${this.typeName}`);return}t.id&&t.id!==this.id&&console.warn(`value.id === undefined || value.id${t.id} !== this.id(${this.id})`);const o=n||[];o.push("id","type");const h=Object.keys(this.defaultProps).filter(l=>!o.includes(l));for(let l of h)if(l in t)this[l]=t[l]===null?void 0:t[l];else if(!(s??!1)){let d=this.defaultProps[l];d instanceof Ne&&(d=d.value),this[l]=d}}get json(){return this._getJson()}set json(t){this._setJson(t,["devTags"])}get updateFunc(){return this._updateFuncReact.value}set updateFunc(t){this._updateFuncReact.value=t}get updateFuncChanged(){return this._updateFuncReact.changed}get toDestroyFunc(){return this._toDestroyFuncReact.value}set toDestroyFunc(t){this._toDestroyFuncReact.value=t}get toDestroyFuncChanged(){return this._toDestroyFuncReact.changed}get navigationMode(){return this._navigationMode.value}get navigationModeChanged(){return this._navigationMode.changed}getNavigationMode(){return this._navigationMode.value}get navigationEvent(){return this._navigationEvent}getEngineType(){return this._typeName}get syncViewer(){return this._syncViewer.value}set syncViewer(t){this._syncViewer.value=t}get syncViewerChanged(){return this._syncViewer.changed}syncOtherViewer(t){t&&t.syncViewer&&(t.syncViewer=void 0),t===this?this._syncViewer.value=void 0:this._syncViewer.value=t}setCurrentTime(t){try{this.currentTime=typeof t=="string"?Date.parse(t):t}catch(n){console.warn(`时间格式不正确! value: ${t} error: ${n}`)}}async getVersion(){return window.g_XE3CopyRights??{}}get hoverEvent(){return this._hoverEvent}get pointerOverEvent(){return this._pointerOverEvent}get pointerMoveEvent(){return this._pointerMoveEvent}get pointerDownEvent(){return this._pointerDownEvent}get pointerUpEvent(){return this._pointerUpEvent}get pointerOutEvent(){return this._pointerOutEvent}get clickEvent(){return this._clickEvent}get dblclickEvent(){return this._dblclickEvent}get keyDownEvent(){return this._keyDownEvent}get keyUpEvent(){return this._keyUpEvent}get wheelEvent(){return this._wheelEvent}get actived(){return this._actived.value}set actived(t){this._actived.value=t}get activedChanged(){return this._actived.changed}getESProperties(){return{defaultMenu:"general",basic:[],general:[],dataSource:[],location:[],coordinate:[],style:[],more:[]}}async getCurrentRectangle(){var t;try{const n=(t=this.container)==null?void 0:t.getBoundingClientRect();if(!n)return;const{width:s,height:o}=n,h=await this.quickPickPosition([0,0]),l=await this.quickPickPosition([s,o]);return!h||!l?void 0:[h[0],l[1],l[0],h[1]]}catch(n){console.error(n);return}}};p(cs,"context",new iN),p(cs,"register",cs.context.register.bind(cs.context)),p(cs,"defaults",{show:!0,debug:!1,statusInfo:{fps:0,position:[0,0,0],rotation:[0,0,0],length:0},terrainShader:{slope:{show:!1},aspect:{show:!1},elevationRamp:{show:!1,minHeight:-414,maxHeight:8777,color:[]},elevationContour:{show:!1,color:[1,0,0,1],spacing:150,width:2}},globeShow:!0,splitPosition:0,cameraMovableRegion:[0,0,0,0,0,0],depthTestAgainstTerrain:!0,terrainOpacity:1});let on=cs;(i=>{i.createBaseProps=()=>({name:"未命名场景对象",extras:At(void 0),devTags:Wt(void 0),debug:void 0,show:void 0,opacity:void 0,zIndex:void 0,useDefaultStatusDiv:!0,execOnceFuncStr:void 0,updateFuncStr:void 0,toDestroyFuncStr:void 0}),i.createCommonProps=()=>({globeShow:!0,ionAccessToken:"",lonLatFormat:"DECIMAL_DEGREE",fov:60,textAvoidance:!1,flyToBoundingSize:1024,hoverTime:2,currentTime:Date.now(),simulationTime:Date.now(),timeSync:!1,rain:0,snow:0,cloud:0,fog:0,depthOfField:0,atmosphere:!0,editingPointSize:void 0,editingPointColor:Wt(void 0),editingAuxiliaryPointColor:Wt(void 0),editingLineWidth:void 0,editingLineColor:Wt(void 0),editingAxisSize:void 0,editingAuxiliaryPointSize:void 0,editingHeightOffset:0,editingLineShow:!0,editingEventListening:!0,terrainShader:i.defaults.terrainShader,splitPosition:it(void 0),rollerShutter:!1,cameraMovableRegion:Wt(void 0),depthTestAgainstTerrain:!0,terrainOpacity:1,sceneGlobeBaseColor:vt([1,1,1,1]),sceneBackgroundColor:vt([0,0,0,0])}),i.createDefaultProps=()=>({...(0,i.createBaseProps)(),...(0,i.createCommonProps)()})})(on||(on={})),ys(on.prototype,on.createDefaultProps);function I_(i,e){const t=i._lastCameraInfo;if(t){const n=e.viewerChanged.don(s=>{if(!s||!t)return;const{position:o,rotation:h}=t;e.flyIn(o,h,0),i._lastCameraInfo=void 0,n()})}}const nN=i=>{const e=on.createCommonProps(),t={};try{Object.keys(e).forEach(n=>{t[n]=i[n]})}catch(n){console.warn(n)}return t},M_=(i,e)=>{const t=on.createCommonProps();try{Object.keys(t).forEach(n=>{i[n]=e[n]})}catch(n){console.warn(n)}};class sN extends st{constructor(t){super();p(this,"_viewersChanged",this.disposeVar(new H));p(this,"_viewers",new Set);p(this,"_viewersToChange",this.dv(new H));this._sceneObjectsManager=t,(async()=>{for(let n of this.viewers){const s=this._sceneObjectsManager.sceneObjects;for(const o of s)await this.addSceneObject(o,n)}this.d(()=>{const n=this._sceneObjectsManager.sceneObjects;for(const s of this.viewers)s.delete(...n),this.destroyViewer(s);this._viewers.clear()}),this.d(this._sceneObjectsManager.sceneObjectsToChange.don(async(n,s)=>{for(let o of this.viewers){n.forEach(h=>{this.deleteSceneObject(h,o)});for(let h of s)await this.addSceneObject(h,o)}if(s.length>0)for(let o of s)o.d(o.devTagsChanged.don(async()=>{for(let h of this.viewers){if(h.has(o)&&!Fo(h.devTags,o.devTags)){h.delete(o);continue}await this.addSceneObject(o,h)}})),o.ad(o.reloadEvent.don(async()=>{for(let h of this.viewers)h.has(o)&&(h.delete(o),await this.addSceneObject(o,h))}))})),this.d(this.viewersChanged.don(async(n,s)=>{const o=this._sceneObjectsManager.sceneObjects;n.forEach(h=>{for(let l of o)this.deleteSceneObject(l,h)});for(let h of s)for(let l of o)await this.addSceneObject(l,h);s.length>0&&s.forEach(h=>{h.d(h.devTagsChanged.don(async()=>{h.clearAllSceneObjects();const l=this._sceneObjectsManager.sceneObjects;for(let d of l)console.log("viewersChanged",h.devTags,d.devTags,Fo(h.devTags,d.devTags)),await this.addSceneObject(d,h)}))})}))})()}get viewersChanged(){return this._viewersChanged}get viewers(){return[...this._viewers]}getViewers(){return[...this._viewers]}get viewersToChange(){return this._viewersToChange}createViewer(t){const n=on.context.createViewer(t);return this._viewers.add(n),this._viewersChanged.emit([],[n]),n}destroyViewer(t){return t.isDestroyed()?!0:this._viewers.has(t)?(this._viewers.delete(t),this._viewersChanged.emit([t],[]),t.destroy(),t.isDestroyed()):!1}async addSceneObject(t,n){Fo(n.devTags,t.devTags)&&(n.has(t)?console.warn(`${n.typeName}中已存${t.typeName},检查逻辑是否有问题!`):n.add(t))}deleteSceneObject(t,n){Fo(n.devTags,t.devTags)&&(n.has(t)?n.delete(t):console.warn(`${n.typeName}中不存在${t.typeName},检查逻辑是否有问题!`))}}class Pu extends st{constructor(...t){super();p(this,"_drgm",this.dv(new ym));p(this,"_sobjm",this.dv(new qO));p(this,"_vrm",this.dv(new sN(this._sobjm)));p(this,"_sceneObjectEditingManager",this.disposeVar(new VO));p(this,"_activeViewer",this.dv(it(void 0)));p(this,"_syncOtherViewersToActived",this.dv(it(!1)));p(this,"_cmrvm",this.createSceneObjectFromClass(au));p(this,"_cmrvmdon",this.d(()=>this._cmrvm&&this.destroySceneObject(this._cmrvm)));p(this,"_asset",{type:"ESObjectsManager",version:"0.1.0",createdTime:"",modifiedTime:"",name:"未命名项目"});p(this,"_sceneTree",this.dv(new Eh("default",this.dragstartDataMananger,24,this)));p(this,"_sceneTreeMap",new Map);p(this,"_viewerCreatedEvent",this.dv(new H));p(this,"_lastCameraInfo");p(this,"_lastActiveViewerJson");p(this,"_syncEventDonFunc",this.d(Me([this.activeViewerChanged,this.syncOtherViewersToActivedChanged],()=>{const t=this.syncOtherViewersToActived;this.viewers.forEach(n=>{t?n.syncOtherViewer(this.activeViewer):n.syncOtherViewer(void 0)})})));p(this,"_player",this.createSceneObjectFromClass(Ta));p(this,"_playerdon",this.d(()=>this._player&&this.destroySceneObject(this._player)));p(this,"_esPlyarAndPathTime",this.dv(new GO(this)));p(this,"_pathAnimationManager",this.dv(new BO(this)))}getBrowserEnv(){return globalThis.ue&&globalThis.ue.es&&globalThis.ue.esinput?"ESWebView":"Browser"}static get envs(){return St.context.environmentVariables}getSceneObjectById(t){return St.getSceneObjectById(t)}getSceneObject(t){return St.getSceneObject(t)}get $refs(){return St.$refs}get dragstartDataMananger(){return this._drgm}get sceneObjectsManager(){return this._sobjm}get viewers(){return this._vrm.viewers}getViewers(){return this._vrm.getViewers()}get sceneObjectEditingManager(){return this._sceneObjectEditingManager}get activeViewer(){return this._activeViewer.value}set activeViewer(t){this._activeViewer.value=t,this.viewers.forEach(n=>n.actived=n===t)}get activeViewerChanged(){return this._activeViewer.changed}get syncOtherViewersToActived(){return this._syncOtherViewersToActived.value}set syncOtherViewersToActived(t){this._syncOtherViewersToActived.value=t}get syncOtherViewersToActivedChanged(){return this._syncOtherViewersToActived.changed}get cameraViewsManager(){return this._cmrvm}get completeJson(){var m;const t=this._asset.createdTime||new Date().toISOString(),n=new Date().toISOString(),s=this._asset.name||"未命名项目",h={type:"ESObjectsManager",version:this._asset.version||"0.1.0",createdTime:t,modifiedTime:n,name:s},l=this.sceneTree.completeJson,d=this._cmrvm.views,f=[...this.viewers].map(y=>y.completeJson),v=(m=this.activeViewer)==null?void 0:m.getCurrentCameraInfo();return{asset:h,viewers:f,sceneTree:l,viewCollection:d,lastView:v}}get json(){var m;const t=this._asset.createdTime||new Date().toISOString(),n=new Date().toISOString(),s=this._asset.name||"未命名项目",h={type:"ESObjectsManager",version:this._asset.version||"0.1.0",createdTime:t,modifiedTime:n,name:s},l=this.sceneTree.json,d=this._cmrvm.views,f=[...this.viewers].map(y=>y.json),v=(m=this.activeViewer)==null?void 0:m.getCurrentCameraInfo();return{asset:h,viewers:f,sceneTree:l,viewCollection:d,lastView:v}}set json(t){try{if(!t.asset)return;if(!t.asset.type||t.asset.type!=="ESObjectsManager"){console.warn("json装配失败! asset.type 不存在或者不是'ESObjectsManager'");return}if(this._asset.createdTime=t.asset&&t.asset.createdTime||new Date().toISOString(),this._asset.modifiedTime=t.asset&&t.asset.modifiedTime||"",this._asset.name=t.asset&&t.asset.name||"未命名项目",this._asset.version=t.asset&&t.asset.version||"0.1.0",t.sceneTree&&(this.sceneTree.json=t.sceneTree),t.viewCollection&&(this._cmrvm.views=t.viewCollection),!t.viewers||!Array.isArray(t.viewers)){console.warn("viewers is not an array or does not exist !");return}if(this.viewers.length===0||t.viewers.length===0){console.warn("viewers is empty !");return}this.viewers.forEach(n=>{const s=t.viewers.find(o=>o.id===n.id);s&&(n.json=s)})}catch(n){console.error(`ESObjectsManager解析json数据时发生错误! error: ${n}`)}}get sceneTree(){return this._sceneTree}get jsonLoadingEvent(){return this._sceneTree.jsonLoadingEvent}getSceneTrees(){return[...this._sceneTreeMap.values()]}getSceneTree(t="default"){if(t==="default")return this._sceneTree;if(!this._sceneTreeMap.has(t)){console.warn(`id为${t}的SceneTree不存在!`);return}return this._sceneTreeMap.get(t)}createSceneTree(t,n=24){if(this._sceneTreeMap.has(t)||t==="default")console.warn(`id为${t}的SceneTree已存在!`);else{const s=this.dv(new Eh(t,this.dragstartDataMananger,n,this));this._sceneTreeMap.set(t,s)}return this.getSceneTree(t)}get viewerCreatedEvent(){return this._viewerCreatedEvent}createViewer(t){const n=this._vrm.createViewer(t);this.activeViewer||(this.activeViewer=n);const s=this.d(n.viewerChanged.don(o=>{o&&(this._viewerCreatedEvent.emit(n),s())}));return n}destroyViewer(t){return this._activeViewer.value===t&&(this._activeViewer.value=void 0),this._vrm.destroyViewer(t)}switchViewer(t,n=!0,s=!0,o=!0){var f,v;this.activeViewer&&this.activeViewer.getNavigationMode()!=="Map"&&this.activeViewer.changeToMap(),!this._lastCameraInfo&&n&&(this._lastCameraInfo=(f=this.activeViewer)==null?void 0:f.getCurrentCameraInfo(),((v=this.activeViewer)==null?void 0:v.typeName)=="ESOlViewer"&&this._lastCameraInfo&&(this._lastCameraInfo.rotation[1]=-90)),!this._lastActiveViewerJson&&s&&(this._lastActiveViewerJson=this.activeViewer?nN(this.activeViewer):void 0),o&&this.activeViewer&&this.destroyViewer(this.activeViewer);const h=t.id,l=h?[...this.getViewers()].find(m=>m.id===h):[...this.getViewers()].find(m=>m.typeName===t.type&&!m.container);if(l)if(h&&l.typeName!==t.type)console.warn(`id为${h}的viewer的typeName和option.type${t.type}不相同!,虽然id一致但是typeName不同,所以会销毁并创建新的viewer`),this.destroyViewer(l);else return console.log("ESViewer exists, will be used"),n&&I_(this,l),s&&this._lastActiveViewerJson&&(M_(l,this._lastActiveViewerJson),this._lastActiveViewerJson=void 0),l.container===S_(t.container)?(l.containerOrId=t.container,l.forceRecreate()):l.containerOrId=t.container,this.activeViewer=l,l;console.log("No ESViewer exists, will be created");const d=this.createViewer(t);return console.log(t),console.log(this),n&&I_(this,d),s&&this._lastActiveViewerJson&&(M_(d,this._lastActiveViewerJson),this._lastActiveViewerJson=void 0),this.activeViewer=d,d}switchToCesiumViewer(...t){if(typeof t[0]=="object"&&!(t[0]instanceof HTMLDivElement)){const{container:n,viewSync:s,attributeSync:o,destroy:h,id:l}=t[0];return this.switchViewer({type:"ESCesiumViewer",container:n,id:l},s??!0,o??!0,h??!0)}else if(typeof t[0]=="string"||t[0]instanceof HTMLDivElement){const n={container:t[0],viewSync:t[1]??!0,attributeSync:t[2]??!0,destroy:t[3]??!0,id:t[4]},{container:s,viewSync:o,attributeSync:h,destroy:l,id:d}=n;return this.switchViewer({type:"ESCesiumViewer",container:s,id:d},o,h,l)}}switchToUEViewer(...t){let n,s={viewSync:!0,attributeSync:!0,destroy:!0};if(typeof t[0]=="object"&&!(t[0]instanceof HTMLDivElement)&&t[0].hasOwnProperty("uri")){const{container:d,uri:f,app:v,token:m,viewSync:y,attributeSync:w,destroy:S,id:T,silentTime:N}=t[0];n={type:"ESUeViewer",container:d,id:T,options:{uri:f,app:v,token:m,silentTime:N}},s={viewSync:y??!0,attributeSync:w??!0,destroy:S??!0}}else if(typeof t[0]=="object"&&!(t[0]instanceof HTMLDivElement)&&t[0].hasOwnProperty("ws")){const{container:d,ws:f,esmsg:v,viewSync:m,attributeSync:y,id:w,destroy:S,silentTime:T}=t[0];n={type:"ESUeViewer",container:d,id:w,options:{ws:f,esmsg:v,silentTime:T}},s={viewSync:m??!0,attributeSync:y??!0,destroy:S??!0}}else if(typeof t[0]=="object"&&!(t[0]instanceof HTMLDivElement)&&t[0].hasOwnProperty("project")){const{container:d,project:f,baseUrl:v,viewSync:m,attributeSync:y,id:w,destroy:S}=t[0];n={type:"ESUeViewer",container:d,id:w,options:{project:f,baseUrl:v}},s={viewSync:m??!0,attributeSync:y??!0,destroy:S??!0}}else(typeof t[0]=="string"||t[0]instanceof HTMLDivElement)&&(typeof t[1]=="string"&&t[1].startsWith("ws")?(n={type:"ESUeViewer",container:t[0],id:t[6],options:{ws:t[1],esmsg:t[2]??void 0,silentTime:t[7]??void 0}},s={viewSync:t[3]??!0,attributeSync:t[4]??!0,destroy:t[5]??!0}):typeof t[1]=="string"&&t[1].startsWith("http")?(n={type:"ESUeViewer",container:t[0],id:t[7],options:{uri:t[1],app:t[2],token:t[3]??void 0,silentTime:t[8]??void 0}},s={viewSync:t[4]??!0,attributeSync:t[5]??!0,destroy:t[6]??!0}):(n={type:"ESUeViewer",container:t[0],id:t[6],options:{project:t[1],baseUrl:t[2]??void 0}},s={viewSync:t[3]??!0,attributeSync:t[4]??!0,destroy:t[5]??!0}));if(!n)throw new Error("参数错误");const{viewSync:o,attributeSync:h,destroy:l}=s;return this.switchViewer(n,o,h,l)}createCesiumViewer(...t){let n;if(typeof t[0]=="object"&&!(t[0]instanceof HTMLDivElement)?n={...t[0],type:"ESCesiumViewer"}:(typeof t[0]=="string"||t[0]instanceof HTMLDivElement)&&(n={container:t[0],options:t[1]??void 0,id:t[2]??void 0,type:"ESCesiumViewer"}),!n)throw new Error("参数错误");return this.createViewer(n)}createOpenLayersViewer(...t){let n;if(typeof t[0]=="object"&&!(t[0]instanceof HTMLDivElement)?n={...t[0],type:"ESOlViewer"}:(typeof t[0]=="string"||t[0]instanceof HTMLDivElement)&&(n={container:t[0],options:t[1]??void 0,id:t[2]??void 0,type:"ESOlViewer"}),!n)throw new Error("参数错误");return this.createViewer(n)}createUeViewer(...t){let n;if(typeof t[0]=="object"&&!(t[0]instanceof HTMLDivElement)?n={...t[0],type:"ESUeViewer"}:(typeof t[0]=="string"||t[0]instanceof HTMLDivElement)&&(typeof t[1]=="string"&&t[1].startsWith("ws")?n={type:"ESUeViewer",container:t[0],id:t[3]??void 0,options:{ws:t[1],esmsg:t[2]??void 0,silentTime:t[4]??void 0}}:typeof t[1]=="string"&&t[1].startsWith("http")?n={type:"ESUeViewer",container:t[0],id:t[4]??void 0,options:{uri:t[1],app:t[2],token:t[3]??void 0,silentTime:t[5]??void 0}}:n={type:"ESUeViewer",container:t[0],id:t[3]??void 0,options:{project:t[1],baseUrl:t[2]??void 0}}),!n)throw new Error("参数错误");return this.createViewer(n)}createSceneObject(t,n){return this._sobjm.createSceneObject(t,n)}createSceneObjectFromUrl(t,n){return this._sobjm.createSceneObjectFromUrl(t,n)}createSceneObjectFromClass(t,n){return this._sobjm.createSceneObjectFromClass(t,n)}createSceneObjectFromJson(t){return this._sobjm.createSceneObjectFromJson(t)}destroySceneObject(t){const n=this._sobjm.deleteSceneObject(t);return t.destroy(),n}destroyAllSceneObjects(){const t=[...this._sobjm.sceneObjects];for(let n of t)n!=this._player&&n!=this._cmrvm&&this.destroySceneObject(n)}get player(){return this._player}get esPlyarAndPathTime(){return this._esPlyarAndPathTime}get pathAnimationManager(){return this._pathAnimationManager}}return p(Pu,"getSceneObjById",St.context.getSceneObjectById.bind(St.context)),p(Pu,"getEnv",St.context.getEnv.bind(St.context)),p(Pu,"setEnv",St.context.setEnv.bind(St.context)),b.BooleanProperty=nt,b.BorderedPosFloatDiv=Vp,b.BoxPicker=lc,b.CancelError=tn,b.CancelsManager=dc,b.CanvasImagePoi=Aw,b.CanvasPoi=vc,b.CanvasPointPoi=Dw,b.CanvasPrimitive=Tp,b.CanvasPrimitivesContext=Lw,b.ColorProperty=jt,b.ColorStops=DO,b.ComplexImage=Th,b.CursorFloatDiv=zw,b.CursorInfo=Uw,b.DashPatternProperty=rl,b.DateProperty=Ei,b.DatesProperty=Mc,b.Debouncing=uw,b.DebouncingDeprecated=ac,b.DebouncingWithStartValues=cw,b.Destroyable=st,b.DivBoxPicker=ow,b.DivPoi=Bp,b.DivPointerClick=Ow,b.DivideProperty=yt,b.DomElementEvent=ce,b.DoublyLinkedList=cp,b.DragStartDataManager=ym,b.ES3DTileset=bi,b.ESAlarm=Xd,b.ESApertureEffect=Yd,b.ESAreaMeasurement=Jd,b.ESAttackArrow=Sg,b.ESBlastParticleSystem=Kd,b.ESBoxClipping=Zd,b.ESCameraView=su,b.ESCameraViewCollection=au,b.ESCameraVisibleRange=Qd,b.ESCar=ou,b.ESCityBasePoint=eg,b.ESClassification=hu,b.ESClippingPlane=tf,b.ESCustomDiv=lu,b.ESCustomPrimitive=Mg,b.ESCylinder=gr,b.ESCzml=ng,b.ESDataMesh=ef,b.ESDatasmithRuntimeModel=Lf,b.ESDirectionMeasurement=Cf,b.ESDistanceMeasurement=nf,b.ESDynamicWater=Ff,b.ESEntityCluster=Zf,b.ESExcavate=Sh,b.ESFeatureLayer=vg,b.ESFireParticleSystem=uu,b.ESFireWall=lf,b.ESForestTileset=sf,b.ESFountainParticleSystem=vu,b.ESGaussianSplatting=lg,b.ESGeHistoryImagery=Rg,b.ESGeoBezierPath=bg,b.ESGeoBezierSpline=Qf,b.ESGeoDiv=af,b.ESGeoDivTextPoi=tg,b.ESGeoExtrudedPolygon=fr,b.ESGeoIcon=og,b.ESGeoJson=bh,b.ESGeoLineString=ze,b.ESGeoPoint=hg,b.ESGeoPoints=Mh,b.ESGeoPolygon=Jt,b.ESGeoPolygonWithFire=hf,b.ESGeoRectangle=uf,b.ESGeoSmoothPolygon=Pg,b.ESGeoVector=Rt,b.ESGeoWater=Gf,b.ESGltfModel=Tn,b.ESGltfModelEditing=wg,b.ESHeatMap=Eu,b.ESHeightLimitAnalysis=Kf,b.ESHeightMeasurement=Mf,b.ESHole=$f,b.ESHuman=Pi,b.ESHumanFountain=qf,b.ESHumanPoi=Vf,b.ESHumans=Eg,b.ESImageLabel=cu,b.ESImageryLayer=Ca,b.ESJArrowModeArray=Oc,b.ESJClassificationTypeArray=kc,b.ESJEditingMode=dt,b.ESJLonLatFormat=vm,b.ESJPickedResult=cE,b.ESKml=Ng,b.ESLabel=xi,b.ESLandSlide=ug,b.ESLevelRuntimeModel=jf,b.ESLocalCircle=Tf,b.ESLocalLineString=Cg,b.ESLocalLineStringZ=Ig,b.ESLocalPolygon=Ph,b.ESLocalPolygonZ=kf,b.ESLocalRectangle=Of,b.ESLocalSkyBox=df,b.ESLocalVector=Ns,b.ESLocalVector2D=an,b.ESLocationMeasurement=ff,b.ESMVTLayer=yg,b.ESMediaLayer=_g,b.ESMsTileset=Xf,b.ESNavigator=sg,b.ESObjectWithLocation=bt,b.ESObjectsManager=Pu,b.ESParticleSystemPrimitive=du,b.ESPath=ka,b.ESPathImpl=Rs,b.ESPipeFence=pu,b.ESPipeline=Bf,b.ESPipeserTileset=Nf,b.ESPit=Ma,b.ESPlayer=Ta,b.ESPoi2D=xh,b.ESPoi3D=gf,b.ESPoiTileset=Yf,b.ESPolygonFence=mu,b.ESPolygonFlattenedPlane=pf,b.ESPolygonWithHole=Af,b.ESPolygonsFlattenedPlane=mf,b.ESRectangle=Rf,b.ESRoad=Tg,b.ESRtsFeatureEditing=Hf,b.ESRtsTileset=Wf,b.ESScale=Jf,b.ESSceneObject=St,b.ESSceneObjectWithId=Im,b.ESSeparateFoliage=vf,b.ESSignalInterference=xg,b.ESSignalTransmission=kg,b.ESSkylineAnalysis=dg,b.ESSquadCombatArrow=of,b.ESStaticMesh=cg,b.ESSubmergingAnalysis=yf,b.ESSunshineAnalysis=_f,b.ESSurfaceAreaMeasurement=Df,b.ESTerrainLayer=wf,b.ESTerrainLayerEditing=Ih,b.ESTerrainLayerEditingBrushEarseFalloff=Zy,b.ESTerrainLayerEditingFlattenMode=Jy,b.ESTerrainLayerEditingFlattenPick=Ky,b.ESTestObject=Hd,b.ESTextLabel=Ia,b.ESUEWidget=Ef,b.ESUnrealActor=Sf,b.ESVideoFusion=xf,b.ESViewShed=bf,b.ESViewer=on,b.ESViewerStatusBar=rg,b.ESViewerStatusBarScale=ag,b.ESVisibilityAnalysis=zf,b.ESVisualObject=Ht,b.ESVolumeMeasurement=Uf,b.ESWidget=Pf,b.ESXYZLayer=Ag,b.EngineObject=pr,b.EnumProperty=xt,b.EvalStringProperty=Ai,b.Event=H,b.EventFromArrayUpdating=J1,b.EventListenerHandler=Wu,b.Fetching=iw,b.FloatDiv=wc,b.FlvJsLoading=xu,b.FlvProcessing=w_,b.GetSetProperty=Tc,b.Gif=dm,b.GifPlayer=cm,b.GifProcessing=fm,b.HasOwner=X1,b.HlsJsLoading=Su,b.HlsProcessing=__,b.IFrameBorderedPosFloatDiv=jw,b.ImageProcessing=tm,b.IntervalDeprecated=hc,b.JsonArrayProperty=ue,b.JsonProperty=Mt,b.ListenerPipe=$u,b.LocalFileServer=Zp,b.LocalRootDir=Kp,b.LongStringProperty=Lo,b.MethodProperty=kt,b.NextAnimateFrameEvent=Yh,b.NextAnimateFrameWeakEvent=dp,b.NextMicroTaskEvent=Zu,b.NextMicroTaskWeakEvent=j1,b.Number2Property=ge,b.Number3Property=Te,b.Number4Property=ui,b.NumberProperty=q,b.NumberSliderProperty=ke,b.ObjPool=Vh,b.ObjResetting=$w,b.ObjResettingWithEvent=xe,b.ObservableArray=Io,b.ObservableSet=sl,b.PickColorMananger=Gp,b.PickedInfo=uE,b.Player=Di,b.PlayerProperty=aa,b.PointerClick=mc,b.PointerClickDeprecated=xp,b.PointerHover=Mp,b.PointerHoverDeprecated=Nw,b.PosFloatDiv=xc,b.PositionProperty=en,b.Processing=Re,b.Property=Es,b.ReactVarProperty=ei,b.ReactiveVariable=Ne,b.RotationProperty=ra,b.SceneObjectFromId=Ac,b.SceneTree=Eh,b.SceneTreeContextMenu=fy,b.SceneTreeItem=ri,b.SceneTreeItemDragDrop=dy,b.SmartListenerHandler=Eo,b.SmartListenerPipe=T1,b.SmoothMoveController=mk,b.StringProperty=Tt,b.Throttling=Tw,b.ThrottlingWithStartValues=kw,b.TimingDeprecated=Ep,b.ToolTipDiv=Bw,b.Transition=Oo,b.TransitionDeprecated=rw,b.Tree=er,b.TreeItem=Do,b.TreeItemDragDrop=_m,b.UiTree=Hp,b.UiTreeObject=Wp,b.VideoProcessing=nm,b.ViewPlayerProperty=mm,b.ViewerCustomInteraction=C_,b.Watcher=Go,b.WatcherTools=Mm,b.WithUndefinedProperty=Ic,b.XrPlayer=il,b.Xyzw2Ns=Zh,b._getFeatureProperty=zy,b._getLayerConfig=Gy,b._getport=By,b._saveLayerConfig=jy,b.addTreesCallFunc=Sy,b.animateFrame=Hh,b.apis=wu,b.ary2Ns=ew,b.asyncFuncToCancelablePromise=pw,b.bind=mt,b.bindCustomEditing=Sm,b.bindu=F1,b.booleanPointInPolygon=WT,b.buildFeatureTilesetUrl=Fy,b.buildInfoUrl=Bk,b.buildTilesetUrl=Ly,b.calcArrowPoints=Wd,b.canMoveToTreeItem=Ao,b.canMoveToTreeItems=qp,b.cancelFuncToCancelablePromise=gw,b.cancelPromise=uc,b.cancelableFetch=gc,b.cancelableFetchDeprecated=wp,b.cancelableFetchWithProgress=vw,b.cartesianDistance=oy,b.clamp=Qh,b.clamp0_360=oa,b.clampN180_180=Em,b.complexImageTypes=im,b.createAnimateFrame=To,b.createAnimateFrameWithStartValues=sa,b.createBottomTriangleElement=Up,b.createCancelablePromise=na,b.createCloseDiv=zp,b.createEventsCallFunc=Me,b.createFetching=yw,b.createFetchingWithStartValues=_w,b.createGuid=Zr,b.createInterval=bw,b.createIntervalWithStartValues=Pw,b.createNextAnimateFrame=ww,b.createNextAnimateFrameEvent=we,b.createNextAnimateFrameEventCallFunc=z1,b.createNextAnimateFrameWeakEvent=U1,b.createNextAnimateFrameWithStartValues=Ew,b.createNextMicroTask=Sw,b.createNextMicroTaskEvent=G1,b.createNextMicroTaskWeakEvent=B1,b.createNextMicroTaskWithStartValues=xw,b.createNumbers=Kh,b.createProcessingFromAsyncFunc=wi,b.createProcessingFromAsyncFuncWithStartValues=mw,b.createProcessingFromPromiseCreateFunc=el,b.createProcessingFromPromiseCreateFuncWithStartValues=fc,b.createSleeping=Cw,b.createSleepingWithStartValues=Iw,b.createStartFuncFromAsyncFunc=Mo,b.createTimeout=Pp,b.createTimeoutWithStartValues=Cp,b.cutDownTreesCallFunc=Py,b.czmPixelFormats=em,b.data=Gk,b.dataMd=jk,b.debounce=Wh,b.defaultGetLocalFilePath=Ww,b.defaultInitSceneObjectOnCreatingFunc=fE,b.defaultLight122FromEnvironmentMapManager=$d,b.defaultLoadFuncDocStr=ky,b.defaultLoadFuncStr=If,b.defaultLocalFileServer=Qp,b.defaultStartUpdateFunc=Jh,b.defaultUpdateSceneObjectOnPickingFunc=dE,b.defineReactiveProp=oc,b.destroyObject=op,b.diffGeoJson=CE,b.downloadLink=W1,b.drawBubble=Qs,b.drawPoint=Rw,b.drawRoundRectPath=kp,b.drawText=Op,b.drawTextBlock=yc,b.engineObjectCreatedUpdate=ly,b.equalsN3=eu,b.every=tc,b.extendClassProps=ys,b.fetchArrayBuffer=Y1,b.fetchImage=mp,b.forEach=_n,b.forEachWithBreak=Qu,b.geoAlong=HT,b.geoArea=Bd,b.geoBuffer=ny,b.geoCenterOfMass=XT,b.geoDestination=zd,b.geoDifference=sy,b.geoDistance=Zl,b.geoHeading=wh,b.geoIntersect=ey,b.geoLineIntersect=YT,b.geoNearestPointOnLine=KT,b.geoPointToLineDistance=ZT,b.geoPolygonFromCircle=ry,b.geoPolygonOverlap=Ud,b.geoPolylineToBezierSpline=Pa,b.geoRhumbDestination=QT,b.geoRhumbDistance=ty,b.geoRhumbHeading=tk,b.geoUnion=iy,b.getColorHexStr=Ro,b.getCompleteReactParams=$h,b.getDefaultValue=vE,b.getDistancesFromPositions=is,b.getDomEventCurrentTargetPos=$e,b.getDrawRect=Zs,b.getElementBounds=PE,b.getEventFromPromise=lw,b.getEventPosInCurrentTarget=ta,b.getExtProp=_i,b.getFileArrayBuffer=Jp,b.getFileJson=Yp,b.getFileText=bc,b.getFloatDivPool=Sc,b.getGeoBoundingSphereFromPositions=ay,b.getIterator=xo,b.getMidpoint=JT,b.getMinMaxCorner=Ql,b.getMinMaxPosition=vp,b.getPromiseCancel=ea,b.getPromiseFromEvent=hw,b.getPromiseFromProcessing=pc,b.getReactFuncs=wo,b.getRtsServicePrefix=dr,b.getSceneObjectTreeItem=gE,b.getSubEntriesFromDir=Xp,b.getTypeFromImageUri=E_,b.getValueFromProps=fp,b.getXyzFromPostion=Vd,b.growthSimulationCallFunc=Cy,b.hasSameTags=wm,b.hasSameViewerTags=Fo,b.imageToCanvas=Np,b.inOrderRunning=yE,b.interval=Ju,b.isFeatureEqual=Pm,b.isGeometryEqual=Cm,b.isJSON=Nc,b.isPromiseCancelable=ia,b.isRelativeRtsInfoUrl=Ny,b.isXML=mE,b.lbhToWebMerc=DC,b.lbhToXyz=sn,b.length=ec,b.lerpAngle=ol,b.lerpRotation=Rc,b.loadGifFrames=lm,b.loadJs=sc,b.map=hy,b.max=Yn,b.min=_s,b.moveToTreeItem=nl,b.moveToTreeItems=$p,b.nextAnimateFrame=Qr,b.nextMicroTask=So,b.objsIterator=Js,b.oneTimeWarning=Jr,b.optionsStr=Nk,b.pairToPromise=cc,b.parsePlatformFromUrl=Ay,b.parseRtsHost=Ry,b.parseRtsOrigin=_u,b.parseTileServiceName=Dy,b.pluckProperty=ic,b.react=it,b.reactArray=vt,b.reactArrayCollection=N1,b.reactArrayCollectionWithUndefined=Hu,b.reactArrayWithUndefined=Wt,b.reactDeepArray=qh,b.reactDeepArrayWithUndefined=ms,b.reactJson=At,b.reactJsonCollection=R1,b.reactJsonCollectionWithUndefined=A1,b.reactJsonWithUndefined=re,b.reactPlainObject=k1,b.reactPlainObjectWithUndefined=O1,b.reactPosition2Ds=tu,b.reactPosition2DsSet=D1,b.reactPositions=vs,b.reactPositionsSet=Xu,b.reduce=Co,b.registerEventCtor=hp,b.registerEventUpdate=rk,b.removeAllTreesCallFunc=xy,b.requestAnimationFrameTimeStampTest=H1,b.resolveRtsInfoUrl=yu,b.rpToap=pE,b.saveOnBrowser=$1,b.setCanvasUniformColor=Rp,b.setExtProp=yn,b.setPromiseCancel=ws,b.setSceneObjectTreeItem=al,b.setValueFromProps=q1,b.sleep=ko,b.sleepDeprecated=nw,b.step=Ks,b.stepProcessing=Mw,b.throttle=nc,b.timeout=Ku,b.toGeoJson=bm,b.track=Q,b.uint32ToUint8s=Lp,b.uint8ToHexStr=No,b.uint8sToUint32=Fp,b.updateTreeParamsCallFunc=by,b.webMercToLbh=LC,b.xyz2N2=K1,b.xyz2N3=Z1,b.xyzToLbh=nd,b.xyzw2N4=Q1,Object.defineProperty(b,Symbol.toStringTag,{value:"Module"}),b})({});
|
|
1856
|
+
`,ZO='<svg t="1747028305766" class="icon" viewBox="0 0 1032 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3881" width="40" height="40"><path d="M0.1536 547.700736c-0.205824-0.187392-0.205824-0.49152 0.008192-0.68608l80.672768-73.590784a0.63488 0.63488 0 0 1 0.7936-0.029696l263.043072 203.0336c0.667648 0.515072 1.738752 0.498688 2.393088-0.038912l609.191936-500.133888a0.605184 0.605184 0 0 1 0.768 0.022528l74.84928 67.229696a0.454656 0.454656 0 0 1-0.002048 0.685056l-685.234176 618.19904a1.14688 1.14688 0 0 1-1.518592-0.012288L0.1536 547.700736z" fill="#ffffff" p-id="3882"></path></svg>',QO='<svg t="1747028398107" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1146" width="40" height="40"><path d="M415.744006 1.033277A0.992256 0.992256 0 0 1 416.747526 0.000061h189.5045c0.569344 0 1.017856 0.45056 1.001472 1.033216l-21.227518 754.803667a1.062912 1.062912 0 0 1-1.05984 1.032192h-146.933752c-0.569344 0-1.04448-0.45056-1.059839-1.032192L415.744006 1.033277zM511.510528 1024c-52.595709 0-95.231994-39.866366-95.231994-89.043963 0-49.176573 42.636285-89.042939 95.231994-89.042938 52.594685 0 95.231994 39.866366 95.231994 89.042938 0 49.177597-42.637309 89.043963-95.231994 89.043963z" fill="#ffffff" p-id="1147"></path></svg>',zr=class zr extends st{constructor(e){super();const t=()=>{const n=this.dv(new lu);this.d(Q([n,"show"],[e,"useDefaultStatusDiv"]));{const s=()=>{n.show=(e.useDefaultStatusDiv??!0)&&e.status!=="Created"};s(),this.d(e.useDefaultStatusDivChanged.don(s)),this.d(e.statusChanged.don(s)),n.cssText="width:100%;height:100%;position:absolute;left:0px;top:0px;"}e.add(n),this.d(()=>e.delete(n)),n.instanceClass=class extends st{constructor(h,l,d){super();p(this,"_div",document.createElement("div"));if(this._subContainer=h,!d)return;this._subContainer.appendChild(this._div),this.d(()=>this._subContainer.removeChild(this._div));{const S=()=>{l.show?this._div.style.opacity="1":this._div.style.opacity="0"};S(),this.d(l.showChanged.don(S))}let f,v,m,y,w;this._div.style.pointerEvents="none",this._div.style.position="absolute",this._div.style.width="100%",this._div.style.height="100%",this._div.style.backgroundColor="rgba(0, 0, 0, 0.4)",this._div.style.zIndex="100",this._div.style.transition="opacity 2s",f=document.createElement("div"),this._div.appendChild(f),f.style.width="auto",f.style.position="absolute",f.style.left="50%",f.style.top="50%",f.style.transform="translate(-50%,-50%)",f.style.background="rgba(120, 120, 0, 0.7)",f.style.color="white",f.style.fontSize="10px",f.style.background="none",f.style.display="flex",f.style.justifyContent="center",f.style.alignItems="center",v=document.createElement("div"),f.appendChild(v),v.style.pointerEvents="none",v.style.display="block",v.style.width="40px",v.innerHTML=zr.defaultsSvg.loadingSvg,v.style.filter="drop-shadow(0px 0px 1px black)",m=document.createElement("div"),f.appendChild(m),m.style.pointerEvents="none",m.style.marginLeft="10px",m.style.display="flex",m.style.flexFlow="column",m.style.maxWidth="300px",y=document.createElement("div"),m.appendChild(y),y.style.fontSize="14px",y.style.fontWeight="800",y.style.marginBottom="5px",y.style.textShadow="0 0 2px black",w=document.createElement("div"),m.appendChild(w),w.style.fontWeight="400",w.style.textShadow="0 0 2px black";{const S=()=>{let N="Raw";d.status==="Raw"?N="初始状态":d.status==="Creating"?N="正在创建":d.status==="Created"?N="创建完成":d.status==="Error"?N="创建失败":d.status==="Reconnecting"&&(N="重新连接"),y.innerText=`${N}(${d.status})`,w.innerText=`${d.statusLog}`,(d.status==="Creating"||d.status==="Reconnecting")&&(v.innerHTML=zr.defaultsSvg.loadingSvg),d.status==="Created"&&(v.innerHTML=zr.defaultsSvg.successSvg),d.status==="Error"&&(v.innerHTML=zr.defaultsSvg.warnSvg)};S();const T=this.dv(we(d.statusLogChanged,d.statusChanged));this.d(T.don(S))}}update(){const h=255*Math.random()|0,l=255*Math.random()|0,d=255*Math.random()|0;this._div.style.background=`rgba(${h}, ${l}, ${d}, 0.8)`}}};this.d(e.containerChanged.don(()=>{t()}))}};p(zr,"defaultsSvg",{loadingSvg:KO,successSvg:ZO,warnSvg:QO});let Lg=zr;class tN extends st{constructor(e,t,n){super(),this._subContainer=e,this._overlayContainer=t,this._viewer=n;const s=this._subContainer,o=this._overlayContainer,h=this._viewer,l=()=>{const v=h.zIndex??"";s.style.zIndex=v,o.style.zIndex=v};l(),this.d(h.zIndexChanged.don(l));const d=()=>{s.style.display=h.show??!0?"block":"none"};d(),this.d(h.showChanged.don(d));const f=()=>{s.style.opacity=`${h.opacity??1}`};f(),this.d(h.opacityChanged.don(f))}}function bu(i){let e=_i(i,"_relativeContainer");return e||(e=document.createElement("div"),e.style.position="relative",e.style.width="100%",e.style.height="100%",e.style.padding="0",e.style.margin="0",i.appendChild(e),yn(i,"_relativeContainer",e)),e}class eN extends st{constructor(t,n){super();p(this,"_subContainer",document.createElement("div"));p(this,"_overlayContainer",document.createElement("div"));p(this,"_containerStyleController");this._container=t,this._viewer=n,this._containerStyleController=this.dv(new tN(this._subContainer,this._overlayContainer,this._viewer));const{subContainer:s,overlayContainer:o}=this;s.tabIndex=-1,s.style.outline="none",s.style.width="100%",s.style.height="100%",s.onpointerdown=()=>s.focus(),o.style.position="relative",o.setAttribute("earthsdk3","earthsdk3-overlayContainer"),s.setAttribute("earthsdk3","earthsdk3-subContainer"),bu(this._container).appendChild(s),this.d(()=>bu(this._container).removeChild(s)),bu(this._container).appendChild(o),this.d(()=>bu(this._container).removeChild(o))}get subContainer(){return this._subContainer}get overlayContainer(){return this._overlayContainer}get containerStyleController(){return this._containerStyleController}get container(){return this._container}}class iN extends st{constructor(){super(...arguments);p(this,"registerObjsMap",new Map)}register(t,n){return this.registerObjsMap.has(t)&&console.warn(`register warn:${t}已经被注册,再次注册会覆盖。`),this.registerObjsMap.set(t,n),t}getViewerConstructor(t){const n=this.registerObjsMap.get(t);if(!n){console.warn(`未找到${t}类!`);return}return n}createViewer(t){const n=t.type;console.log(t);const s=this.getViewerConstructor(n);if(!s)throw new Error(`没有找到类型为${n}的Viewer构造器!`);return new s(t)}}class C_ extends st{constructor(e,t,n=!1,s=!1){if(super(),this._viewer=e,!t)throw new Error("ViewerCustomInteraction: container is null");const o=this.dv(ce.create(t,"pointerdown")),h=this.dv(ce.create(t,"pointermove")),l=this.dv(ce.create(t,"pointerup")),d=this.dv(ce.create(t,"pointerout")),f=this.dv(ce.create(t,"pointerover")),v=this.dv(new mc),m=this.dv(new Mp),y=()=>{const M=this._viewer.hoverTime*1e3;m.delayTime=M};this.d(this._viewer.hoverTimeChanged.don(()=>{y()})),this.d(o.don(M=>v.pointerDown(M))),this.d(h.don(M=>v.pointerMove(M))),this.d(l.don(M=>v.pointerUp(M))),this.d(d.don(M=>v.pointerOut(M))),this.d(o.don(M=>m.pointerDown(M))),this.d(h.don(M=>m.pointerMove(M))),this.d(l.don(M=>m.pointerUp(M))),this.d(d.don(M=>m.pointerOut(M)));const{x:w,y:S}=t.getBoundingClientRect(),T=s?w:0,N=s?S:0;this.d(m.hoverEvent.don(M=>{const[D,L]=ta(M,n);this._viewer.hoverEvent.emit({screenPosition:[D+T,L+N],pointerEvent:M})})),this.d(v.clickEvent.don(M=>{const[D,L]=ta(M,n);this._viewer.clickEvent.emit({screenPosition:[D+T,L+N],pointerEvent:M})})),this.d(v.dbclickEvent.don(M=>{const[D,L]=ta(M,n);M.button===0&&this._viewer.dblclickEvent.emit({screenPosition:[D+T,L+N],pointerEvent:M})})),this.d(o.don(M=>{const[D,L]=ta(M,n);M.button===0&&this._viewer.pointerDownEvent.emit({screenPosition:[D+T,L+N],pointerEvent:M})})),this.d(l.don(M=>{const[D,L]=ta(M,n);M.button===0&&this._viewer.pointerUpEvent.emit({screenPosition:[D+T,L+N],pointerEvent:M})})),this.d(h.don(M=>{const[D,L]=$e(M,n);this._viewer.pointerMoveEvent.emit({screenPosition:[D+T,L+N],pointerEvent:M})})),this.d(f.don(M=>{const[D,L]=$e(M,n);this._viewer.pointerOverEvent.emit({screenPosition:[D+T,L+N],pointerEvent:M})})),this.d(d.don(M=>{const[D,L]=$e(M,n);this._viewer.pointerOutEvent.emit({screenPosition:[D+T,L+N],pointerEvent:M})}));const j=this.dv(ce.create(t,"keydown"));this.d(j.don(M=>this._viewer.keyDownEvent.emit(M)));const C=this.dv(ce.create(t,"keyup"));this.d(C.don(M=>this._viewer.keyUpEvent.emit(M)));const k=this.dv(ce.create(t,"wheel"));this.d(k.don(M=>this._viewer.wheelEvent.emit(M)))}}const cs=class cs extends st{constructor(t){super();p(this,"_forceRecreateEvent",this.dv(new H));p(this,"_container",this.dv(it(void 0)));p(this,"_containerSize",this.dv(it(void 0)));p(this,"_editingEvent",this.disposeVar(new H));p(this,"_esViewerExtensions",this.dv(new WO(this)));p(this,"_status",this.dv(it("Raw")));p(this,"_statusLog",this.dv(it("")));p(this,"_statusContainer",this.dv(new Lg(this)));p(this,"_useCustomInteraction",this.dv(it(!0)));p(this,"_resetInteractionEvent",this.dv(we(this.containerChanged,this._useCustomInteraction.changed,this._forceRecreateEvent)));p(this,"_interactionResetting",this.dv(new xe(this._resetInteractionEvent,()=>{if(!(!this.container||!this._useCustomInteraction.value))return new C_(this,this.container)})));p(this,"_viewerChanged",this.dv(new H));p(this,"_cameraChanged",this.dv(new H));p(this,"_containerResetEvent",this.dv(we(this.containerChanged,this._forceRecreateEvent)));p(this,"_containerResetting",this.dv(new xe(this._containerResetEvent,()=>{if(this.container)return new eN(this.container,this)})));p(this,"_sceneObjectsMap",new Map);p(this,"_id");p(this,"_typeName");p(this,"_updateFuncReact",this.dv(it(void 0)));p(this,"_toDestroyFuncReact",this.dv(it(void 0)));p(this,"_statusInfo",cs.defaults.statusInfo);p(this,"_navigationMode",this.dv(it("Map")));p(this,"_navigationEvent",this.disposeVar(new H));p(this,"_syncViewer",this.dv(it(void 0)));p(this,"_syncEventDon",this.dv(new xe(this.syncViewerChanged,()=>{const t=this.syncViewer;if(t)return new JO(this,t)})));p(this,"_timeSyncdon",this.dv(new xe(this.timeSyncChanged,()=>{if(this.timeSync)return new YO(this)})));p(this,"_hoverEvent",this.dv(new H));p(this,"_pointerOverEvent",this.dv(new H));p(this,"_pointerMoveEvent",this.dv(new H));p(this,"_pointerDownEvent",this.dv(new H));p(this,"_pointerUpEvent",this.dv(new H));p(this,"_pointerOutEvent",this.dv(new H));p(this,"_clickEvent",this.dv(new H));p(this,"_dblclickEvent",this.dv(new H));p(this,"_keyDownEvent",this.dv(new H));p(this,"_keyUpEvent",this.dv(new H));p(this,"_wheelEvent",this.dv(new H));p(this,"_actived",this.dv(it(!1)));this._id=t.id??Zr();const n=S_(t.container);if(n)this._container.value=Dg(n),this._typeName=t.type,this._initName();else throw new Error("container is not defined");{const s=()=>{n&&(this.show??!0?n.style.display="block":n.style.display="none")};s(),this.d(this.showChanged.don(s))}{const s=this._sceneObjectsMap,o=()=>{for(let[l,d]of s.entries())if(!d&&l){const f=pr.context.createEngineObject(l,this);f&&s.set(l,f)}},h=()=>{for(let[l,d]of s.entries())d&&!d.isDestroyed()&&d.destroy(),s.set(l,void 0)};this.d(h),this.d(this.viewerChanged.don(l=>{h(),l&&o()}))}{const s=()=>{if(this.execOnceFuncStr)try{Function(`"use strict";return (${this.execOnceFuncStr})`)()(this)}catch(o){console.warn(`execOnceFuncStr不能转成函数!或者函数执行时错误!id: ${this.id} ${this.typeName} error: ${o}`)}};s(),this.d(this.execOnceFuncStrChanged.don(s))}{const s=()=>{if(this.updateFuncStr)try{this.updateFunc=Function(`"use strict";return (${this.updateFuncStr})`)()}catch(h){console.warn(`updateFuncStr不能转成函数!或者函数执行时错误!id: ${this.id} ${this.typeName} error: ${h}`)}};s(),this.d(this.updateFuncStrChanged.don(s));let o;this.d(()=>o&&o.destroy()),this.d(this.updateFuncChanged.don(()=>{o&&o.cancel(),this.updateFunc&&(o=o||To(),o.restart(void 0,h=>{this.updateFunc&&this.updateFunc(this,h)}))}))}{const s=()=>{try{this.toDestroyFunc=this.toDestroyFuncStr&&Function(`"use strict";return (${this.toDestroyFuncStr})`)()||void 0}catch(o){console.warn(`toDestroyFuncStr不能转成函数!或者函数执行时错误!id: ${this.id} ${this.typeName} error: ${o}`),this.toDestroyFunc=void 0}};s(),this.d(this.toDestroyFuncStrChanged.don(s)),this.d(this.toDestroyEvent.don(()=>{this.toDestroyFunc&&this.toDestroyFunc(this)}))}this.ad(new XO(this))}forceRecreate(){this._forceRecreateEvent.emit()}get container(){return this._container.value}set container(t){this._container.value=t}set containerOrId(t){if(typeof t=="string"){const n=document.getElementById(t);n&&n instanceof HTMLDivElement?this._container.value=Dg(n):console.warn("containerOrId warn: !(container instanceof HTMLDivElement)")}else t instanceof HTMLDivElement?this._container.value=Dg(t):console.warn("containerOrId warn: setting container failed!")}get containerChanged(){return this._container.changed}get containerSize(){return this._containerSize.value}set containerSize(t){this._containerSize.value=t}get containerSizeChanged(){return this._containerSize.changed}get editingEvent(){return this._editingEvent}get esViewerExtensions(){return this._esViewerExtensions}get status(){return this._status.value}get statusChanged(){return this._status.changed}setStatus(t){this._status.value=t}get statusLog(){return this._statusLog.value}get statusLogChanged(){return this._statusLog.changed}setStatusLog(t){this._statusLog.value=t}get useCustomInteraction(){return this._useCustomInteraction.value}set useCustomInteraction(t){this._useCustomInteraction.value=t}get viewerChanged(){return this._viewerChanged}get cameraChanged(){return this._cameraChanged}get containerResetEvent(){return this._containerResetEvent}get subContainer(){var t;return(t=this._containerResetting.obj)==null?void 0:t.subContainer}get subContainerChanged(){return this._containerResetting.objChanged}get overlayContainer(){var t;return(t=this._containerResetting.obj)==null?void 0:t.overlayContainer}get overlayContainerChanged(){return this._containerResetting.objChanged}get sceneObjectsMap(){return this._sceneObjectsMap}get sceneObjects(){return this._sceneObjectsMap.keys()}getEngineObject(t){return this.sceneObjectsMap.get(t)}add(...t){for(let n of t)if(!this.has(n)){St.context.addSceneObject(n);const s=pr.context.createEngineObject(n,this);s&&this._sceneObjectsMap.set(n,s),n.viewerAttached.emit(this)}}delete(...t){for(let n of t)if(this.has(n)){const s=this._sceneObjectsMap.get(n);s&&s.destroy(),St.context.deleteSceneObject(n),this._sceneObjectsMap.delete(n),n.viewerDetached.emit(this)}}disposableAdd(...t){return this.add(...t),()=>this.delete(...t)}disAdd(...t){return this.disposableAdd(...t)}has(t){return this._sceneObjectsMap.has(t)}clearAllSceneObjects(){for(let t of this.sceneObjects)this.delete(t)}get id(){return this._id}set id(t){console.warn("ESViewer id is readonly")}get typeName(){return this._typeName}_initName(){this.name=`${this.typeName}_${(""+this.id).slice(-4)}`}get defaultProps(){return cs.createDefaultProps()}get completeJson(){return this._getJson(!1)}_getJson(t=!0){const n={id:this.id,type:this.typeName};for(let s of Object.keys(this.defaultProps))if(t){let o,h=this.defaultProps[s];h instanceof Ne?o=h.equals(this[s]):o=h===this[s],o||(n[s]=this[s])}else n[s]=this[s];return n}_setJson(t,n,s){if(!(t instanceof Object)||t.type&&t.type!==this.typeName){console.error(`value.type && value.type${t.type} !== this.typeName${this.typeName}`);return}t.id&&t.id!==this.id&&console.warn(`value.id === undefined || value.id${t.id} !== this.id(${this.id})`);const o=n||[];o.push("id","type");const h=Object.keys(this.defaultProps).filter(l=>!o.includes(l));for(let l of h)if(l in t)this[l]=t[l]===null?void 0:t[l];else if(!(s??!1)){let d=this.defaultProps[l];d instanceof Ne&&(d=d.value),this[l]=d}}get json(){return this._getJson()}set json(t){this._setJson(t,["devTags"])}get updateFunc(){return this._updateFuncReact.value}set updateFunc(t){this._updateFuncReact.value=t}get updateFuncChanged(){return this._updateFuncReact.changed}get toDestroyFunc(){return this._toDestroyFuncReact.value}set toDestroyFunc(t){this._toDestroyFuncReact.value=t}get toDestroyFuncChanged(){return this._toDestroyFuncReact.changed}get navigationMode(){return this._navigationMode.value}get navigationModeChanged(){return this._navigationMode.changed}getNavigationMode(){return this._navigationMode.value}get navigationEvent(){return this._navigationEvent}getEngineType(){return this._typeName}get syncViewer(){return this._syncViewer.value}set syncViewer(t){this._syncViewer.value=t}get syncViewerChanged(){return this._syncViewer.changed}syncOtherViewer(t){t&&t.syncViewer&&(t.syncViewer=void 0),t===this?this._syncViewer.value=void 0:this._syncViewer.value=t}setCurrentTime(t){try{this.currentTime=typeof t=="string"?Date.parse(t):t}catch(n){console.warn(`时间格式不正确! value: ${t} error: ${n}`)}}async getVersion(){return window.g_XE3CopyRights??{}}get hoverEvent(){return this._hoverEvent}get pointerOverEvent(){return this._pointerOverEvent}get pointerMoveEvent(){return this._pointerMoveEvent}get pointerDownEvent(){return this._pointerDownEvent}get pointerUpEvent(){return this._pointerUpEvent}get pointerOutEvent(){return this._pointerOutEvent}get clickEvent(){return this._clickEvent}get dblclickEvent(){return this._dblclickEvent}get keyDownEvent(){return this._keyDownEvent}get keyUpEvent(){return this._keyUpEvent}get wheelEvent(){return this._wheelEvent}get actived(){return this._actived.value}set actived(t){this._actived.value=t}get activedChanged(){return this._actived.changed}getESProperties(){return{defaultMenu:"general",basic:[],general:[],dataSource:[],location:[],coordinate:[],style:[],more:[]}}async getCurrentRectangle(){var t;try{const n=(t=this.container)==null?void 0:t.getBoundingClientRect();if(!n)return;const{width:s,height:o}=n,h=await this.quickPickPosition([0,0]),l=await this.quickPickPosition([s,o]);return!h||!l?void 0:[h[0],l[1],l[0],h[1]]}catch(n){console.error(n);return}}};p(cs,"context",new iN),p(cs,"register",cs.context.register.bind(cs.context)),p(cs,"defaults",{show:!0,debug:!1,statusInfo:{fps:0,position:[0,0,0],rotation:[0,0,0],length:0},terrainShader:{slope:{show:!1},aspect:{show:!1},elevationRamp:{show:!1,minHeight:-414,maxHeight:8777,color:[]},elevationContour:{show:!1,color:[1,0,0,1],spacing:150,width:2}},globeShow:!0,splitPosition:0,cameraMovableRegion:[0,0,0,0,0,0],depthTestAgainstTerrain:!0,terrainOpacity:1});let on=cs;(i=>{i.createBaseProps=()=>({name:"未命名场景对象",extras:At(void 0),devTags:Wt(void 0),debug:void 0,show:void 0,opacity:void 0,zIndex:void 0,useDefaultStatusDiv:!0,execOnceFuncStr:void 0,updateFuncStr:void 0,toDestroyFuncStr:void 0}),i.createCommonProps=()=>({globeShow:!0,ionAccessToken:"",lonLatFormat:"DECIMAL_DEGREE",fov:60,textAvoidance:!1,flyToBoundingSize:1024,hoverTime:2,currentTime:Date.now(),simulationTime:Date.now(),timeSync:!1,rain:0,snow:0,cloud:0,fog:0,depthOfField:0,atmosphere:!0,editingPointSize:void 0,editingPointColor:Wt(void 0),editingAuxiliaryPointColor:Wt(void 0),editingLineWidth:void 0,editingLineColor:Wt(void 0),editingAxisSize:void 0,editingAuxiliaryPointSize:void 0,editingHeightOffset:0,editingLineShow:!0,editingEventListening:!0,terrainShader:i.defaults.terrainShader,splitPosition:it(void 0),rollerShutter:!1,cameraMovableRegion:Wt(void 0),depthTestAgainstTerrain:!0,terrainOpacity:1,sceneGlobeBaseColor:vt([1,1,1,1]),sceneBackgroundColor:vt([0,0,0,0])}),i.createDefaultProps=()=>({...(0,i.createBaseProps)(),...(0,i.createCommonProps)()})})(on||(on={})),ys(on.prototype,on.createDefaultProps);function I_(i,e){const t=i._lastCameraInfo;if(t){const n=e.viewerChanged.don(s=>{if(!s||!t)return;const{position:o,rotation:h}=t;e.flyIn(o,h,0),i._lastCameraInfo=void 0,n()})}}const nN=i=>{const e=on.createCommonProps(),t={};try{Object.keys(e).forEach(n=>{t[n]=i[n]})}catch(n){console.warn(n)}return t},M_=(i,e)=>{const t=on.createCommonProps();try{Object.keys(t).forEach(n=>{i[n]=e[n]})}catch(n){console.warn(n)}};class sN extends st{constructor(t){super();p(this,"_viewersChanged",this.disposeVar(new H));p(this,"_viewers",new Set);p(this,"_viewersToChange",this.dv(new H));this._sceneObjectsManager=t,(async()=>{for(let n of this.viewers){const s=this._sceneObjectsManager.sceneObjects;for(const o of s)await this.addSceneObject(o,n)}this.d(()=>{const n=this._sceneObjectsManager.sceneObjects;for(const s of this.viewers)s.delete(...n),this.destroyViewer(s);this._viewers.clear()}),this.d(this._sceneObjectsManager.sceneObjectsToChange.don(async(n,s)=>{for(let o of this.viewers){n.forEach(h=>{this.deleteSceneObject(h,o)});for(let h of s)await this.addSceneObject(h,o)}if(s.length>0)for(let o of s)o.d(o.devTagsChanged.don(async()=>{for(let h of this.viewers){if(h.has(o)&&!Fo(h.devTags,o.devTags)){h.delete(o);continue}await this.addSceneObject(o,h)}})),o.ad(o.reloadEvent.don(async()=>{for(let h of this.viewers)h.has(o)&&(h.delete(o),await this.addSceneObject(o,h))}))})),this.d(this.viewersChanged.don(async(n,s)=>{const o=this._sceneObjectsManager.sceneObjects;n.forEach(h=>{for(let l of o)this.deleteSceneObject(l,h)});for(let h of s)for(let l of o)await this.addSceneObject(l,h);s.length>0&&s.forEach(h=>{h.d(h.devTagsChanged.don(async()=>{h.clearAllSceneObjects();const l=this._sceneObjectsManager.sceneObjects;for(let d of l)console.log("viewersChanged",h.devTags,d.devTags,Fo(h.devTags,d.devTags)),await this.addSceneObject(d,h)}))})}))})()}get viewersChanged(){return this._viewersChanged}get viewers(){return[...this._viewers]}getViewers(){return[...this._viewers]}get viewersToChange(){return this._viewersToChange}createViewer(t){const n=on.context.createViewer(t);return this._viewers.add(n),this._viewersChanged.emit([],[n]),n}destroyViewer(t){return t.isDestroyed()?!0:this._viewers.has(t)?(this._viewers.delete(t),this._viewersChanged.emit([t],[]),t.destroy(),t.isDestroyed()):!1}async addSceneObject(t,n){Fo(n.devTags,t.devTags)&&(n.has(t)?console.warn(`${n.typeName}中已存${t.typeName},检查逻辑是否有问题!`):n.add(t))}deleteSceneObject(t,n){Fo(n.devTags,t.devTags)&&(n.has(t)?n.delete(t):console.warn(`${n.typeName}中不存在${t.typeName},检查逻辑是否有问题!`))}}class Pu extends st{constructor(...t){super();p(this,"_drgm",this.dv(new ym));p(this,"_sobjm",this.dv(new qO));p(this,"_vrm",this.dv(new sN(this._sobjm)));p(this,"_sceneObjectEditingManager",this.disposeVar(new VO));p(this,"_activeViewer",this.dv(it(void 0)));p(this,"_syncOtherViewersToActived",this.dv(it(!1)));p(this,"_cmrvm",this.createSceneObjectFromClass(au));p(this,"_cmrvmdon",this.d(()=>this._cmrvm&&this.destroySceneObject(this._cmrvm)));p(this,"_asset",{type:"ESObjectsManager",version:"0.1.0",createdTime:"",modifiedTime:"",name:"未命名项目"});p(this,"_sceneTree",this.dv(new Eh("default",this.dragstartDataMananger,24,this)));p(this,"_sceneTreeMap",new Map);p(this,"_viewerCreatedEvent",this.dv(new H));p(this,"_lastCameraInfo");p(this,"_lastActiveViewerJson");p(this,"_syncEventDonFunc",this.d(Me([this.activeViewerChanged,this.syncOtherViewersToActivedChanged],()=>{const t=this.syncOtherViewersToActived;this.viewers.forEach(n=>{t?n.syncOtherViewer(this.activeViewer):n.syncOtherViewer(void 0)})})));p(this,"_player",this.createSceneObjectFromClass(Ta));p(this,"_playerdon",this.d(()=>this._player&&this.destroySceneObject(this._player)));p(this,"_esPlyarAndPathTime",this.dv(new GO(this)));p(this,"_pathAnimationManager",this.dv(new BO(this)))}getBrowserEnv(){return globalThis.ue&&globalThis.ue.es&&globalThis.ue.esinput?"ESWebView":"Browser"}static get envs(){return St.context.environmentVariables}getSceneObjectById(t){return St.getSceneObjectById(t)}getSceneObject(t){return St.getSceneObject(t)}get $refs(){return St.$refs}get dragstartDataMananger(){return this._drgm}get sceneObjectsManager(){return this._sobjm}get viewers(){return this._vrm.viewers}getViewers(){return this._vrm.getViewers()}get sceneObjectEditingManager(){return this._sceneObjectEditingManager}get activeViewer(){return this._activeViewer.value}set activeViewer(t){this._activeViewer.value=t,this.viewers.forEach(n=>n.actived=n===t)}get activeViewerChanged(){return this._activeViewer.changed}get syncOtherViewersToActived(){return this._syncOtherViewersToActived.value}set syncOtherViewersToActived(t){this._syncOtherViewersToActived.value=t}get syncOtherViewersToActivedChanged(){return this._syncOtherViewersToActived.changed}get cameraViewsManager(){return this._cmrvm}get completeJson(){var m;const t=this._asset.createdTime||new Date().toISOString(),n=new Date().toISOString(),s=this._asset.name||"未命名项目",h={type:"ESObjectsManager",version:this._asset.version||"0.1.0",createdTime:t,modifiedTime:n,name:s},l=this.sceneTree.completeJson,d=this._cmrvm.views,f=[...this.viewers].map(y=>y.completeJson),v=(m=this.activeViewer)==null?void 0:m.getCurrentCameraInfo();return{asset:h,viewers:f,sceneTree:l,viewCollection:d,lastView:v}}get json(){var m;const t=this._asset.createdTime||new Date().toISOString(),n=new Date().toISOString(),s=this._asset.name||"未命名项目",h={type:"ESObjectsManager",version:this._asset.version||"0.1.0",createdTime:t,modifiedTime:n,name:s},l=this.sceneTree.json,d=this._cmrvm.views,f=[...this.viewers].map(y=>y.json),v=(m=this.activeViewer)==null?void 0:m.getCurrentCameraInfo();return{asset:h,viewers:f,sceneTree:l,viewCollection:d,lastView:v}}set json(t){try{if(!t.asset)return;if(!t.asset.type||t.asset.type!=="ESObjectsManager"){console.warn("json装配失败! asset.type 不存在或者不是'ESObjectsManager'");return}if(this._asset.createdTime=t.asset&&t.asset.createdTime||new Date().toISOString(),this._asset.modifiedTime=t.asset&&t.asset.modifiedTime||"",this._asset.name=t.asset&&t.asset.name||"未命名项目",this._asset.version=t.asset&&t.asset.version||"0.1.0",t.sceneTree&&(this.sceneTree.json=t.sceneTree),t.viewCollection&&(this._cmrvm.views=t.viewCollection),!t.viewers||!Array.isArray(t.viewers)){console.warn("viewers is not an array or does not exist !");return}if(this.viewers.length===0||t.viewers.length===0){console.warn("viewers is empty !");return}this.viewers.forEach(n=>{const s=t.viewers.find(o=>o.id===n.id);s&&(n.json=s)})}catch(n){console.error(`ESObjectsManager解析json数据时发生错误! error: ${n}`)}}get sceneTree(){return this._sceneTree}get jsonLoadingEvent(){return this._sceneTree.jsonLoadingEvent}getSceneTrees(){return[...this._sceneTreeMap.values()]}getSceneTree(t="default"){if(t==="default")return this._sceneTree;if(!this._sceneTreeMap.has(t)){console.warn(`id为${t}的SceneTree不存在!`);return}return this._sceneTreeMap.get(t)}createSceneTree(t,n=24){if(this._sceneTreeMap.has(t)||t==="default")console.warn(`id为${t}的SceneTree已存在!`);else{const s=this.dv(new Eh(t,this.dragstartDataMananger,n,this));this._sceneTreeMap.set(t,s)}return this.getSceneTree(t)}get viewerCreatedEvent(){return this._viewerCreatedEvent}createViewer(t){const n=this._vrm.createViewer(t);this.activeViewer||(this.activeViewer=n);const s=this.d(n.viewerChanged.don(o=>{o&&(this._viewerCreatedEvent.emit(n),s())}));return n}destroyViewer(t){return this._activeViewer.value===t&&(this._activeViewer.value=void 0),this._vrm.destroyViewer(t)}switchViewer(t,n=!0,s=!0,o=!0){var f,v;this.activeViewer&&this.activeViewer.getNavigationMode()!=="Map"&&this.activeViewer.changeToMap(),!this._lastCameraInfo&&n&&(this._lastCameraInfo=(f=this.activeViewer)==null?void 0:f.getCurrentCameraInfo(),((v=this.activeViewer)==null?void 0:v.typeName)=="ESOlViewer"&&this._lastCameraInfo&&(this._lastCameraInfo.rotation[1]=-90)),!this._lastActiveViewerJson&&s&&(this._lastActiveViewerJson=this.activeViewer?nN(this.activeViewer):void 0),o&&this.activeViewer&&this.destroyViewer(this.activeViewer);const h=t.id,l=h?[...this.getViewers()].find(m=>m.id===h):[...this.getViewers()].find(m=>m.typeName===t.type&&!m.container);if(l)if(h&&l.typeName!==t.type)console.warn(`id为${h}的viewer的typeName和option.type${t.type}不相同!,虽然id一致但是typeName不同,所以会销毁并创建新的viewer`),this.destroyViewer(l);else return console.log("ESViewer exists, will be used"),n&&I_(this,l),s&&this._lastActiveViewerJson&&(M_(l,this._lastActiveViewerJson),this._lastActiveViewerJson=void 0),l.container===S_(t.container)?(l.containerOrId=t.container,l.forceRecreate()):l.containerOrId=t.container,this.activeViewer=l,l;console.log("No ESViewer exists, will be created");const d=this.createViewer(t);return console.log(t),console.log(this),n&&I_(this,d),s&&this._lastActiveViewerJson&&(M_(d,this._lastActiveViewerJson),this._lastActiveViewerJson=void 0),this.activeViewer=d,d}switchToCesiumViewer(...t){if(typeof t[0]=="object"&&!(t[0]instanceof HTMLDivElement)){const{container:n,viewSync:s,attributeSync:o,destroy:h,id:l}=t[0];return this.switchViewer({type:"ESCesiumViewer",container:n,id:l},s??!0,o??!0,h??!0)}else if(typeof t[0]=="string"||t[0]instanceof HTMLDivElement){const n={container:t[0],viewSync:t[1]??!0,attributeSync:t[2]??!0,destroy:t[3]??!0,id:t[4]},{container:s,viewSync:o,attributeSync:h,destroy:l,id:d}=n;return this.switchViewer({type:"ESCesiumViewer",container:s,id:d},o,h,l)}}switchToOpenLayersViewer(...t){if(typeof t[0]=="object"&&!(t[0]instanceof HTMLDivElement)){const{container:n,viewSync:s,attributeSync:o,destroy:h,id:l}=t[0];return this.switchViewer({type:"ESOlViewer",container:n,id:l},s??!0,o??!0,h??!0)}else if(typeof t[0]=="string"||t[0]instanceof HTMLDivElement){const n={container:t[0],viewSync:t[1]??!0,attributeSync:t[2]??!0,destroy:t[3]??!0,id:t[4]},{container:s,viewSync:o,attributeSync:h,destroy:l,id:d}=n;return this.switchViewer({type:"ESOlViewer",container:s,id:d},o,h,l)}}switchToUEViewer(...t){let n,s={viewSync:!0,attributeSync:!0,destroy:!0};if(typeof t[0]=="object"&&!(t[0]instanceof HTMLDivElement)&&t[0].hasOwnProperty("uri")){const{container:d,uri:f,app:v,token:m,viewSync:y,attributeSync:w,destroy:S,id:T,silentTime:N}=t[0];n={type:"ESUeViewer",container:d,id:T,options:{uri:f,app:v,token:m,silentTime:N}},s={viewSync:y??!0,attributeSync:w??!0,destroy:S??!0}}else if(typeof t[0]=="object"&&!(t[0]instanceof HTMLDivElement)&&t[0].hasOwnProperty("ws")){const{container:d,ws:f,esmsg:v,viewSync:m,attributeSync:y,id:w,destroy:S,silentTime:T}=t[0];n={type:"ESUeViewer",container:d,id:w,options:{ws:f,esmsg:v,silentTime:T}},s={viewSync:m??!0,attributeSync:y??!0,destroy:S??!0}}else if(typeof t[0]=="object"&&!(t[0]instanceof HTMLDivElement)&&t[0].hasOwnProperty("project")){const{container:d,project:f,baseUrl:v,viewSync:m,attributeSync:y,id:w,destroy:S}=t[0];n={type:"ESUeViewer",container:d,id:w,options:{project:f,baseUrl:v}},s={viewSync:m??!0,attributeSync:y??!0,destroy:S??!0}}else(typeof t[0]=="string"||t[0]instanceof HTMLDivElement)&&(typeof t[1]=="string"&&t[1].startsWith("ws")?(n={type:"ESUeViewer",container:t[0],id:t[6],options:{ws:t[1],esmsg:t[2]??void 0,silentTime:t[7]??void 0}},s={viewSync:t[3]??!0,attributeSync:t[4]??!0,destroy:t[5]??!0}):typeof t[1]=="string"&&t[1].startsWith("http")?(n={type:"ESUeViewer",container:t[0],id:t[7],options:{uri:t[1],app:t[2],token:t[3]??void 0,silentTime:t[8]??void 0}},s={viewSync:t[4]??!0,attributeSync:t[5]??!0,destroy:t[6]??!0}):(n={type:"ESUeViewer",container:t[0],id:t[6],options:{project:t[1],baseUrl:t[2]??void 0}},s={viewSync:t[3]??!0,attributeSync:t[4]??!0,destroy:t[5]??!0}));if(!n)throw new Error("参数错误");const{viewSync:o,attributeSync:h,destroy:l}=s;return this.switchViewer(n,o,h,l)}createCesiumViewer(...t){let n;if(typeof t[0]=="object"&&!(t[0]instanceof HTMLDivElement)?n={...t[0],type:"ESCesiumViewer"}:(typeof t[0]=="string"||t[0]instanceof HTMLDivElement)&&(n={container:t[0],options:t[1]??void 0,id:t[2]??void 0,type:"ESCesiumViewer"}),!n)throw new Error("参数错误");return this.createViewer(n)}createOpenLayersViewer(...t){let n;if(typeof t[0]=="object"&&!(t[0]instanceof HTMLDivElement)?n={...t[0],type:"ESOlViewer"}:(typeof t[0]=="string"||t[0]instanceof HTMLDivElement)&&(n={container:t[0],options:t[1]??void 0,id:t[2]??void 0,type:"ESOlViewer"}),!n)throw new Error("参数错误");return this.createViewer(n)}createUeViewer(...t){let n;if(typeof t[0]=="object"&&!(t[0]instanceof HTMLDivElement)?n={...t[0],type:"ESUeViewer"}:(typeof t[0]=="string"||t[0]instanceof HTMLDivElement)&&(typeof t[1]=="string"&&t[1].startsWith("ws")?n={type:"ESUeViewer",container:t[0],id:t[3]??void 0,options:{ws:t[1],esmsg:t[2]??void 0,silentTime:t[4]??void 0}}:typeof t[1]=="string"&&t[1].startsWith("http")?n={type:"ESUeViewer",container:t[0],id:t[4]??void 0,options:{uri:t[1],app:t[2],token:t[3]??void 0,silentTime:t[5]??void 0}}:n={type:"ESUeViewer",container:t[0],id:t[3]??void 0,options:{project:t[1],baseUrl:t[2]??void 0}}),!n)throw new Error("参数错误");return this.createViewer(n)}createSceneObject(t,n){return this._sobjm.createSceneObject(t,n)}createSceneObjectFromUrl(t,n){return this._sobjm.createSceneObjectFromUrl(t,n)}createSceneObjectFromClass(t,n){return this._sobjm.createSceneObjectFromClass(t,n)}createSceneObjectFromJson(t){return this._sobjm.createSceneObjectFromJson(t)}destroySceneObject(t){const n=this._sobjm.deleteSceneObject(t);return t.destroy(),n}destroyAllSceneObjects(){const t=[...this._sobjm.sceneObjects];for(let n of t)n!=this._player&&n!=this._cmrvm&&this.destroySceneObject(n)}get player(){return this._player}get esPlyarAndPathTime(){return this._esPlyarAndPathTime}get pathAnimationManager(){return this._pathAnimationManager}}return p(Pu,"getSceneObjById",St.context.getSceneObjectById.bind(St.context)),p(Pu,"getEnv",St.context.getEnv.bind(St.context)),p(Pu,"setEnv",St.context.setEnv.bind(St.context)),b.BooleanProperty=nt,b.BorderedPosFloatDiv=Vp,b.BoxPicker=lc,b.CancelError=tn,b.CancelsManager=dc,b.CanvasImagePoi=Aw,b.CanvasPoi=vc,b.CanvasPointPoi=Dw,b.CanvasPrimitive=Tp,b.CanvasPrimitivesContext=Lw,b.ColorProperty=jt,b.ColorStops=DO,b.ComplexImage=Th,b.CursorFloatDiv=zw,b.CursorInfo=Uw,b.DashPatternProperty=rl,b.DateProperty=Ei,b.DatesProperty=Mc,b.Debouncing=uw,b.DebouncingDeprecated=ac,b.DebouncingWithStartValues=cw,b.Destroyable=st,b.DivBoxPicker=ow,b.DivPoi=Bp,b.DivPointerClick=Ow,b.DivideProperty=yt,b.DomElementEvent=ce,b.DoublyLinkedList=cp,b.DragStartDataManager=ym,b.ES3DTileset=bi,b.ESAlarm=Xd,b.ESApertureEffect=Yd,b.ESAreaMeasurement=Jd,b.ESAttackArrow=Sg,b.ESBlastParticleSystem=Kd,b.ESBoxClipping=Zd,b.ESCameraView=su,b.ESCameraViewCollection=au,b.ESCameraVisibleRange=Qd,b.ESCar=ou,b.ESCityBasePoint=eg,b.ESClassification=hu,b.ESClippingPlane=tf,b.ESCustomDiv=lu,b.ESCustomPrimitive=Mg,b.ESCylinder=gr,b.ESCzml=ng,b.ESDataMesh=ef,b.ESDatasmithRuntimeModel=Lf,b.ESDirectionMeasurement=Cf,b.ESDistanceMeasurement=nf,b.ESDynamicWater=Ff,b.ESEntityCluster=Zf,b.ESExcavate=Sh,b.ESFeatureLayer=vg,b.ESFireParticleSystem=uu,b.ESFireWall=lf,b.ESForestTileset=sf,b.ESFountainParticleSystem=vu,b.ESGaussianSplatting=lg,b.ESGeHistoryImagery=Rg,b.ESGeoBezierPath=bg,b.ESGeoBezierSpline=Qf,b.ESGeoDiv=af,b.ESGeoDivTextPoi=tg,b.ESGeoExtrudedPolygon=fr,b.ESGeoIcon=og,b.ESGeoJson=bh,b.ESGeoLineString=ze,b.ESGeoPoint=hg,b.ESGeoPoints=Mh,b.ESGeoPolygon=Jt,b.ESGeoPolygonWithFire=hf,b.ESGeoRectangle=uf,b.ESGeoSmoothPolygon=Pg,b.ESGeoVector=Rt,b.ESGeoWater=Gf,b.ESGltfModel=Tn,b.ESGltfModelEditing=wg,b.ESHeatMap=Eu,b.ESHeightLimitAnalysis=Kf,b.ESHeightMeasurement=Mf,b.ESHole=$f,b.ESHuman=Pi,b.ESHumanFountain=qf,b.ESHumanPoi=Vf,b.ESHumans=Eg,b.ESImageLabel=cu,b.ESImageryLayer=Ca,b.ESJArrowModeArray=Oc,b.ESJClassificationTypeArray=kc,b.ESJEditingMode=dt,b.ESJLonLatFormat=vm,b.ESJPickedResult=cE,b.ESKml=Ng,b.ESLabel=xi,b.ESLandSlide=ug,b.ESLevelRuntimeModel=jf,b.ESLocalCircle=Tf,b.ESLocalLineString=Cg,b.ESLocalLineStringZ=Ig,b.ESLocalPolygon=Ph,b.ESLocalPolygonZ=kf,b.ESLocalRectangle=Of,b.ESLocalSkyBox=df,b.ESLocalVector=Ns,b.ESLocalVector2D=an,b.ESLocationMeasurement=ff,b.ESMVTLayer=yg,b.ESMediaLayer=_g,b.ESMsTileset=Xf,b.ESNavigator=sg,b.ESObjectWithLocation=bt,b.ESObjectsManager=Pu,b.ESParticleSystemPrimitive=du,b.ESPath=ka,b.ESPathImpl=Rs,b.ESPipeFence=pu,b.ESPipeline=Bf,b.ESPipeserTileset=Nf,b.ESPit=Ma,b.ESPlayer=Ta,b.ESPoi2D=xh,b.ESPoi3D=gf,b.ESPoiTileset=Yf,b.ESPolygonFence=mu,b.ESPolygonFlattenedPlane=pf,b.ESPolygonWithHole=Af,b.ESPolygonsFlattenedPlane=mf,b.ESRectangle=Rf,b.ESRoad=Tg,b.ESRtsFeatureEditing=Hf,b.ESRtsTileset=Wf,b.ESScale=Jf,b.ESSceneObject=St,b.ESSceneObjectWithId=Im,b.ESSeparateFoliage=vf,b.ESSignalInterference=xg,b.ESSignalTransmission=kg,b.ESSkylineAnalysis=dg,b.ESSquadCombatArrow=of,b.ESStaticMesh=cg,b.ESSubmergingAnalysis=yf,b.ESSunshineAnalysis=_f,b.ESSurfaceAreaMeasurement=Df,b.ESTerrainLayer=wf,b.ESTerrainLayerEditing=Ih,b.ESTerrainLayerEditingBrushEarseFalloff=Zy,b.ESTerrainLayerEditingFlattenMode=Jy,b.ESTerrainLayerEditingFlattenPick=Ky,b.ESTestObject=Hd,b.ESTextLabel=Ia,b.ESUEWidget=Ef,b.ESUnrealActor=Sf,b.ESVideoFusion=xf,b.ESViewShed=bf,b.ESViewer=on,b.ESViewerStatusBar=rg,b.ESViewerStatusBarScale=ag,b.ESVisibilityAnalysis=zf,b.ESVisualObject=Ht,b.ESVolumeMeasurement=Uf,b.ESWidget=Pf,b.ESXYZLayer=Ag,b.EngineObject=pr,b.EnumProperty=xt,b.EvalStringProperty=Ai,b.Event=H,b.EventFromArrayUpdating=J1,b.EventListenerHandler=Wu,b.Fetching=iw,b.FloatDiv=wc,b.FlvJsLoading=xu,b.FlvProcessing=w_,b.GetSetProperty=Tc,b.Gif=dm,b.GifPlayer=cm,b.GifProcessing=fm,b.HasOwner=X1,b.HlsJsLoading=Su,b.HlsProcessing=__,b.IFrameBorderedPosFloatDiv=jw,b.ImageProcessing=tm,b.IntervalDeprecated=hc,b.JsonArrayProperty=ue,b.JsonProperty=Mt,b.ListenerPipe=$u,b.LocalFileServer=Zp,b.LocalRootDir=Kp,b.LongStringProperty=Lo,b.MethodProperty=kt,b.NextAnimateFrameEvent=Yh,b.NextAnimateFrameWeakEvent=dp,b.NextMicroTaskEvent=Zu,b.NextMicroTaskWeakEvent=j1,b.Number2Property=ge,b.Number3Property=Te,b.Number4Property=ui,b.NumberProperty=q,b.NumberSliderProperty=ke,b.ObjPool=Vh,b.ObjResetting=$w,b.ObjResettingWithEvent=xe,b.ObservableArray=Io,b.ObservableSet=sl,b.PickColorMananger=Gp,b.PickedInfo=uE,b.Player=Di,b.PlayerProperty=aa,b.PointerClick=mc,b.PointerClickDeprecated=xp,b.PointerHover=Mp,b.PointerHoverDeprecated=Nw,b.PosFloatDiv=xc,b.PositionProperty=en,b.Processing=Re,b.Property=Es,b.ReactVarProperty=ei,b.ReactiveVariable=Ne,b.RotationProperty=ra,b.SceneObjectFromId=Ac,b.SceneTree=Eh,b.SceneTreeContextMenu=fy,b.SceneTreeItem=ri,b.SceneTreeItemDragDrop=dy,b.SmartListenerHandler=Eo,b.SmartListenerPipe=T1,b.SmoothMoveController=mk,b.StringProperty=Tt,b.Throttling=Tw,b.ThrottlingWithStartValues=kw,b.TimingDeprecated=Ep,b.ToolTipDiv=Bw,b.Transition=Oo,b.TransitionDeprecated=rw,b.Tree=er,b.TreeItem=Do,b.TreeItemDragDrop=_m,b.UiTree=Hp,b.UiTreeObject=Wp,b.VideoProcessing=nm,b.ViewPlayerProperty=mm,b.ViewerCustomInteraction=C_,b.Watcher=Go,b.WatcherTools=Mm,b.WithUndefinedProperty=Ic,b.XrPlayer=il,b.Xyzw2Ns=Zh,b._getFeatureProperty=zy,b._getLayerConfig=Gy,b._getport=By,b._saveLayerConfig=jy,b.addTreesCallFunc=Sy,b.animateFrame=Hh,b.apis=wu,b.ary2Ns=ew,b.asyncFuncToCancelablePromise=pw,b.bind=mt,b.bindCustomEditing=Sm,b.bindu=F1,b.booleanPointInPolygon=WT,b.buildFeatureTilesetUrl=Fy,b.buildInfoUrl=Bk,b.buildTilesetUrl=Ly,b.calcArrowPoints=Wd,b.canMoveToTreeItem=Ao,b.canMoveToTreeItems=qp,b.cancelFuncToCancelablePromise=gw,b.cancelPromise=uc,b.cancelableFetch=gc,b.cancelableFetchDeprecated=wp,b.cancelableFetchWithProgress=vw,b.cartesianDistance=oy,b.clamp=Qh,b.clamp0_360=oa,b.clampN180_180=Em,b.complexImageTypes=im,b.createAnimateFrame=To,b.createAnimateFrameWithStartValues=sa,b.createBottomTriangleElement=Up,b.createCancelablePromise=na,b.createCloseDiv=zp,b.createEventsCallFunc=Me,b.createFetching=yw,b.createFetchingWithStartValues=_w,b.createGuid=Zr,b.createInterval=bw,b.createIntervalWithStartValues=Pw,b.createNextAnimateFrame=ww,b.createNextAnimateFrameEvent=we,b.createNextAnimateFrameEventCallFunc=z1,b.createNextAnimateFrameWeakEvent=U1,b.createNextAnimateFrameWithStartValues=Ew,b.createNextMicroTask=Sw,b.createNextMicroTaskEvent=G1,b.createNextMicroTaskWeakEvent=B1,b.createNextMicroTaskWithStartValues=xw,b.createNumbers=Kh,b.createProcessingFromAsyncFunc=wi,b.createProcessingFromAsyncFuncWithStartValues=mw,b.createProcessingFromPromiseCreateFunc=el,b.createProcessingFromPromiseCreateFuncWithStartValues=fc,b.createSleeping=Cw,b.createSleepingWithStartValues=Iw,b.createStartFuncFromAsyncFunc=Mo,b.createTimeout=Pp,b.createTimeoutWithStartValues=Cp,b.cutDownTreesCallFunc=Py,b.czmPixelFormats=em,b.data=Gk,b.dataMd=jk,b.debounce=Wh,b.defaultGetLocalFilePath=Ww,b.defaultInitSceneObjectOnCreatingFunc=fE,b.defaultLight122FromEnvironmentMapManager=$d,b.defaultLoadFuncDocStr=ky,b.defaultLoadFuncStr=If,b.defaultLocalFileServer=Qp,b.defaultStartUpdateFunc=Jh,b.defaultUpdateSceneObjectOnPickingFunc=dE,b.defineReactiveProp=oc,b.destroyObject=op,b.diffGeoJson=CE,b.downloadLink=W1,b.drawBubble=Qs,b.drawPoint=Rw,b.drawRoundRectPath=kp,b.drawText=Op,b.drawTextBlock=yc,b.engineObjectCreatedUpdate=ly,b.equalsN3=eu,b.every=tc,b.extendClassProps=ys,b.fetchArrayBuffer=Y1,b.fetchImage=mp,b.forEach=_n,b.forEachWithBreak=Qu,b.geoAlong=HT,b.geoArea=Bd,b.geoBuffer=ny,b.geoCenterOfMass=XT,b.geoDestination=zd,b.geoDifference=sy,b.geoDistance=Zl,b.geoHeading=wh,b.geoIntersect=ey,b.geoLineIntersect=YT,b.geoNearestPointOnLine=KT,b.geoPointToLineDistance=ZT,b.geoPolygonFromCircle=ry,b.geoPolygonOverlap=Ud,b.geoPolylineToBezierSpline=Pa,b.geoRhumbDestination=QT,b.geoRhumbDistance=ty,b.geoRhumbHeading=tk,b.geoUnion=iy,b.getColorHexStr=Ro,b.getCompleteReactParams=$h,b.getDefaultValue=vE,b.getDistancesFromPositions=is,b.getDomEventCurrentTargetPos=$e,b.getDrawRect=Zs,b.getElementBounds=PE,b.getEventFromPromise=lw,b.getEventPosInCurrentTarget=ta,b.getExtProp=_i,b.getFileArrayBuffer=Jp,b.getFileJson=Yp,b.getFileText=bc,b.getFloatDivPool=Sc,b.getGeoBoundingSphereFromPositions=ay,b.getIterator=xo,b.getMidpoint=JT,b.getMinMaxCorner=Ql,b.getMinMaxPosition=vp,b.getPromiseCancel=ea,b.getPromiseFromEvent=hw,b.getPromiseFromProcessing=pc,b.getReactFuncs=wo,b.getRtsServicePrefix=dr,b.getSceneObjectTreeItem=gE,b.getSubEntriesFromDir=Xp,b.getTypeFromImageUri=E_,b.getValueFromProps=fp,b.getXyzFromPostion=Vd,b.growthSimulationCallFunc=Cy,b.hasSameTags=wm,b.hasSameViewerTags=Fo,b.imageToCanvas=Np,b.inOrderRunning=yE,b.interval=Ju,b.isFeatureEqual=Pm,b.isGeometryEqual=Cm,b.isJSON=Nc,b.isPromiseCancelable=ia,b.isRelativeRtsInfoUrl=Ny,b.isXML=mE,b.lbhToWebMerc=DC,b.lbhToXyz=sn,b.length=ec,b.lerpAngle=ol,b.lerpRotation=Rc,b.loadGifFrames=lm,b.loadJs=sc,b.map=hy,b.max=Yn,b.min=_s,b.moveToTreeItem=nl,b.moveToTreeItems=$p,b.nextAnimateFrame=Qr,b.nextMicroTask=So,b.objsIterator=Js,b.oneTimeWarning=Jr,b.optionsStr=Nk,b.pairToPromise=cc,b.parsePlatformFromUrl=Ay,b.parseRtsHost=Ry,b.parseRtsOrigin=_u,b.parseTileServiceName=Dy,b.pluckProperty=ic,b.react=it,b.reactArray=vt,b.reactArrayCollection=N1,b.reactArrayCollectionWithUndefined=Hu,b.reactArrayWithUndefined=Wt,b.reactDeepArray=qh,b.reactDeepArrayWithUndefined=ms,b.reactJson=At,b.reactJsonCollection=R1,b.reactJsonCollectionWithUndefined=A1,b.reactJsonWithUndefined=se,b.reactPlainObject=k1,b.reactPlainObjectWithUndefined=O1,b.reactPosition2Ds=tu,b.reactPosition2DsSet=D1,b.reactPositions=vs,b.reactPositionsSet=Xu,b.reduce=Co,b.registerEventCtor=hp,b.registerEventUpdate=rk,b.removeAllTreesCallFunc=xy,b.requestAnimationFrameTimeStampTest=H1,b.resolveRtsInfoUrl=yu,b.rpToap=pE,b.saveOnBrowser=$1,b.setCanvasUniformColor=Rp,b.setExtProp=yn,b.setPromiseCancel=ws,b.setSceneObjectTreeItem=al,b.setValueFromProps=q1,b.sleep=ko,b.sleepDeprecated=nw,b.step=Ks,b.stepProcessing=Mw,b.throttle=nc,b.timeout=Ku,b.toGeoJson=bm,b.track=Q,b.uint32ToUint8s=Lp,b.uint8ToHexStr=No,b.uint8sToUint32=Fp,b.updateTreeParamsCallFunc=by,b.webMercToLbh=LC,b.xyz2N2=K1,b.xyz2N3=Z1,b.xyzToLbh=nd,b.xyzw2N4=Q1,Object.defineProperty(b,Symbol.toStringTag,{value:"Module"}),b})({});
|