earthsdk3 3.11.1 → 3.11.2-beta.2
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 +60 -60
- package/dist/earthsdk3.js +1376 -1310
- package/dist/earthsdk3.umd.cjs +55 -55
- package/dist/types/ESObjectManager/index.d.ts +1 -1
- package/dist/types/ESObjects/base/ESSceneObject/ESObjectsContext.d.ts +2 -1
- package/dist/types/ESObjects/base/ESSceneObject/index.d.ts +2 -2
- package/dist/types/ESObjects/general/ESTerrainLayerEditing/EditingESGeoPolygon.d.ts +21 -5
- package/dist/types/ESObjects/general/ESTerrainLayerEditing/index.d.ts +56 -0
- package/package.json +1 -1
package/dist/earthsdk3.umd.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
(function(d,Re){typeof exports=="object"&&typeof module<"u"?Re(exports,require("js-binary-schema-parser"),require("topojson-client"),require("proj4"),require("@turf/turf")):typeof define=="function"&&define.amd?define(["exports","js-binary-schema-parser","topojson-client","proj4","@turf/turf"],Re):(d=typeof globalThis<"u"?globalThis:d||self,Re(d.EarthSDK3={},d.jsBinarySchemaParser,d.topojson,d.proj4,d.turf))})(this,(function(d,Re,ts,Sl,W){"use strict";var cm=Object.defineProperty;var dm=(d,Re,ts)=>Re in d?cm(d,Re,{enumerable:!0,configurable:!0,writable:!0,value:ts}):d[Re]=ts;var a=(d,Re,ts)=>dm(d,typeof Re!="symbol"?Re+"":Re,ts);function Cl(n){const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const e in n)if(e!=="default"){const t=Object.getOwnPropertyDescriptor(n,e);Object.defineProperty(s,e,t.get?t:{enumerable:!0,get:()=>n[e]})}}return s.default=n,Object.freeze(s)}const
|
|
1
|
+
(function(d,Re){typeof exports=="object"&&typeof module<"u"?Re(exports,require("js-binary-schema-parser"),require("topojson-client"),require("proj4"),require("@turf/turf")):typeof define=="function"&&define.amd?define(["exports","js-binary-schema-parser","topojson-client","proj4","@turf/turf"],Re):(d=typeof globalThis<"u"?globalThis:d||self,Re(d.EarthSDK3={},d.jsBinarySchemaParser,d.topojson,d.proj4,d.turf))})(this,(function(d,Re,ts,Sl,W){"use strict";var cm=Object.defineProperty;var dm=(d,Re,ts)=>Re in d?cm(d,Re,{enumerable:!0,configurable:!0,writable:!0,value:ts}):d[Re]=ts;var a=(d,Re,ts)=>dm(d,typeof Re!="symbol"?Re+"":Re,ts);function Cl(n){const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const e in n)if(e!=="default"){const t=Object.getOwnPropertyDescriptor(n,e);Object.defineProperty(s,e,t.get?t:{enumerable:!0,get:()=>n[e]})}}return s.default=n,Object.freeze(s)}const Pd=Cl(ts),K=Cl(W);function Td(){var t;const n=((t=globalThis==null?void 0:globalThis.navigator)==null?void 0:t.userAgent)??"unknown";let s="Unknown";/Windows/.test(n)?s="Windows":/Macintosh/.test(n)?s="MacOS":/Linux/.test(n)?s="Linux":/Android/.test(n)?s="Android":/iOS|iPhone|iPad|iPod/.test(n)&&(s="iOS");let e="Unknown";return/x64|x86_64|Win64|WOW64/.test(n)?e="x64":/x86|i686|Win32/.test(n)?e="x86":/arm64|aarch64/.test(n)?e="arm64":/arm/.test(n)&&(e="arm"),{os:s.toLocaleLowerCase(),arch:e.toLocaleLowerCase()}}const Id=Date.now();function Pl(n){var l;const{os:s,arch:e}=Td(),t={version:n.version,commitdate:n.date,commitId:n.commitId,runningTime:(Date.now()-Id)/1e3/60|0,date:new Date().toLocaleString(),href:((l=globalThis==null?void 0:globalThis.location)==null?void 0:l.href)??"unknown",os:s,arch:e},r={method:"GET",headers:new Headers,redirect:"follow"},o=globalThis.encodeURIComponent(JSON.stringify(t));fetch(`https://account.bjxbsj.cn/api/product/record?product=EarthSDKJS&content=${o}`,r).then(h=>h.text()).then(h=>console.log(h)).catch(h=>console.log("error",h))}d.copyright=void 0;try{const n="earthsdk3",s="3.11.2-beta.2",e="2026-08-05T09:24:28.000Z",t="北京西部世界科技有限公司",i="地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn",r="d23f7cc8f1e69a013ac0315961b1cac9ca796d8d",l=((Date.now()-1785921868e3)/36e5).toFixed(1),h=`%c🌏 ${n}%c ${s}.${r.slice(0,8)}.${e} (距今${l}个小时)
|
|
2
2
|
%c${i?i+`
|
|
3
3
|
`:""}当前网站正在使用${n},此软件版权归${t}所有
|
|
4
|
-
`;d.copyright=Object.freeze({get owner(){return"北京西部世界科技有限公司"},get ownerlink(){},get gituri(){return GITURI_&&GITURI_.replace("${commitId}","
|
|
4
|
+
`;d.copyright=Object.freeze({get owner(){return"北京西部世界科技有限公司"},get ownerlink(){},get gituri(){return GITURI_&&GITURI_.replace("${commitId}","d23f7cc8f1e69a013ac0315961b1cac9ca796d8d")},get info(){return h},get date(){return"2026-08-05T09:24:28.000Z"},get author(){return"suplyang"},get version(){return"3.11.2-beta.2"},get name(){return"earthsdk3"},get commitId(){return"d23f7cc8f1e69a013ac0315961b1cac9ca796d8d"},print(){console.info(this.info,`
|
|
5
5
|
font-size: 18px;
|
|
6
6
|
font-weight: 1000;
|
|
7
7
|
line-height: 1;
|
|
@@ -18,9 +18,9 @@
|
|
|
18
18
|
color: rgb(0, 120, 215);
|
|
19
19
|
padding-bottom: 2px;
|
|
20
20
|
padding-left: 35px;
|
|
21
|
-
`)}}),globalThis.g_XE3CopyRights=globalThis.g_XE3CopyRights||{},globalThis.g_XE3CopyRights[n]=d.copyright,globalThis.g_XE3SendProductUsageInfo=globalThis.g_XE3SendProductUsageInfo||!0,globalThis.g_XE3SendProductUsageInfo&&(setTimeout(()=>Pl(d.copyright),1e3*60),setInterval(()=>Pl(d.copyright),1440*60*1e3)),globalThis.g_earthsdk_copyright_print=globalThis.g_earthsdk_copyright_print??!0,globalThis.g_earthsdk_copyright_print&&d.copyright.print()}catch{console.warn("版本信息有误!")}const Tl=new Set;function is(n,s=n){Tl.has(s)||(Tl.add(s),console.warn(n))}function tn(n){const s=Rn(n),e=()=>s[0][s[1]],t=r=>{try{s[0][s[1]]=r}catch(o){is(`setValue error, obj(${s[0].constructor.name}) prop(${s[1]}) error(${o})`)}},i=s[0][s[2]];return[e,t,i]}function Id(){return!0}function xd(){throw new Error("throwOnDestroyed")}function Il(n){for(var s in n)typeof n[s]=="function"&&(n[s]=xd);n.isDestroyed=Id}const xr=class xr{constructor(){a(this,"_memId",++xr._lastMemId);a(this,"_disposers")}get __v_skip(){return!0}get memId(){return this._memId}get disposers(){return this._disposers||(this._disposers=[]),this._disposers}dispose(s){return this.disposers.push(s),s}d(s){return this.dispose(s)}disposeVar(s){return this.disposers.push(()=>s.destroy()),s}dv(s){return this.disposeVar(s)}tryDisposeVar(s){return this.disposers.push(()=>s.tryDestroy()),s}tdv(s){return this.tryDisposeVar(s)}autoDispose(s){return typeof s=="function"?this.dispose(s):this.disposeVar(s)}ad(s){return typeof s=="function"?this.dispose(s):this.disposeVar(s)}isDestroyed(){return!1}destroyImp(){}destroy(){if(this._toDestroyEvent&&this._toDestroyEvent.emit(),this.destroyImp(),this._disposers)try{const s=this._disposers,e=s.length;for(let t=e-1;t>=0;--t)s[t]();s.length=0,this._disposers=void 0}catch(s){console.error(`destroy get error! ${s}`)}return Il(this)}tryDestory(){if(!this.isDestroyed())return this.destroy()}};a(xr,"_lastMemId",-1);let b=xr,Fr;function xl(n){Fr=n}Object.defineProperties(b.prototype,{toDestroyEvent:{get(){if(this._toDestroyEvent===void 0){if(!Fr)throw new Error("Destroyable EventCtor not registered yet!");this._toDestroyEvent=this.disposeVar(new Fr)}return this._toDestroyEvent}}});class An{constructor(s,e,t=!1){a(this,"_freeElements");a(this,"_usedElementsCount");a(this,"_usedElements");a(this,"_nextCreateID");a(this,"_scratchObjs");this._createDefaultFunc=s,this._destroyFunc=e,this._freeElements=[],this._usedElementsCount=0,this._nextCreateID=1,this._scratchObjs=[],t&&(this._usedElements=[])}get usedElementsCount(){return this._usedElementsCount}get freeElementsCount(){return this._freeElements.length}_getCreateID(){return this._nextCreateID++}_create(){let s;return this._freeElements.length>0?s=this._freeElements.pop():s=this._createDefaultFunc&&this._createDefaultFunc()||{},s._cid=this._getCreateID(),s}create(){return this._create()}multiCreate(s){this._scratchObjs.length=0;for(let e=0;e<s;++e)this._scratchObjs.push(this._create());return this._scratchObjs}_destroy(s){this._destroyFunc&&this._destroyFunc(s),s._cid=void 0}destroy(...s){const e=s.length;for(let t=0;t<e;++t)this._destroy(s[t])}}function Od(){return{item:void 0,previous:void 0,next:void 0}}function Dd(n){n.item=void 0,n.previous=void 0,n.next=void 0}const Ol=new An(Od,Dd,!0);function kr(n,s,e){const t=Ol.create();return t.item=n,t.previous=s,t.next=e,t}function Dl(n){if(!n)throw new Error("node is undefined!");Ol.destroy(n)}function Mr(n,s){s.previous&&s.next?(s.previous.next=s.next,s.next.previous=s.previous):s.previous?(s.previous.next=void 0,n.tail=s.previous):s.next?(s.next.previous=void 0,n.head=s.next):(n.head=void 0,n.tail=void 0),s.next=void 0,s.previous=void 0}class Fl{constructor(s){a(this,"head");a(this,"tail");a(this,"_length");const{needLength:e}=s||{needLength:!0};this.head=void 0,this.tail=void 0,e&&(this._length=0)}_incrementLength(){typeof this._length=="number"&&++this._length}_decrementLength(){typeof this._length=="number"&&--this._length}_setLength(s){typeof this._length=="number"&&(this._length=s)}get length(){return this._length}get empty(){return!this.head}*[Symbol.iterator](){let s=this.head;for(;s;)yield s,s=s.next}remove(s){if(!s)throw new Error("node is undefined!");Mr(this,s),this._decrementLength(),Dl(s)}getNode(s){let e=this.head;for(;e!==null;){if(!e)throw new Error("current is undefined!");if(e.item===s)return e;e=e.next}}moveAfter(s,e){if(s!==e){Mr(this,e);var t=s.next;s.next=e,this.tail===s?this.tail=e:t&&(t.previous=e),e.next=t,e.previous=s}}moveBefore(s,e){if(s!==e){Mr(this,e);var t=s.previous;s.previous=e,this.head===s?this.head=e:t&&(t.next=e),e.previous=t,e.next=s}}insertBefore(s,e){const t=kr(e,s.previous,s);return s.previous&&(s.previous.next=t),s.previous=t,this.head===s&&(this.head=t),this._incrementLength(),t}insertAfter(s,e){const t=kr(e,s,s.next);return s.next&&(s.next.previous=t),s.next=t,this.tail===s&&(this.tail=t),this._incrementLength(),t}_setFirstNode(s){if(this.head||this.tail)throw new Error("_setFirstNode error!");const e=kr(s,void 0,void 0);if(this.head=e,this.tail=e,this._incrementLength(),this._length!==1)throw new Error("_setFirstNode error! this._length !== 1");return e}push(s){return this.tail?this.insertAfter(this.tail,s):this._setFirstNode(s)}pop(){if(!this.tail)throw new Error("DoublyLinkedList is empty!");const s=this.tail.item;return this.remove(this.tail),s}shift(){if(!this.head)throw new Error("DoublyLinkedList is empty!");const s=this.head.item;return this.remove(this.head),s}unshift(s){return this.head?this.insertBefore(this.head,s):this._setFirstNode(s)}removeAll(){let s=this.head;for(;s;){const e=s.next;Dl(s),s=e}this.head=void 0,this.tail=void 0,this._setLength(0)}}function Fd(){return{func:void 0,scope:void 0,_hasRemoved:!1,_once:!1}}function kd(n){n.func=void 0,n.scope=void 0,n._hasRemoved=!1,n._once=!1}const vi=new An(Fd,kd,!0);class Ar{constructor(){a(this,"__dll");a(this,"__currentListenerStack")}get _dll(){return this.__dll=this.__dll??new Fl({needLength:!0}),this.__dll}_pushCurrentListener(s){this.__currentListenerStack?Array.isArray(this.__currentListenerStack)?this.__currentListenerStack.push(s):this.__currentListenerStack=[this.__currentListenerStack,s]:this.__currentListenerStack=s}_popCurrentListener(){if(this.__currentListenerStack)Array.isArray(this.__currentListenerStack)?this.__currentListenerStack.pop():this.__currentListenerStack=void 0;else throw new Error("cannot pop!")}_hasCurrentListener(s){return this.__currentListenerStack?Array.isArray(this.__currentListenerStack)?this.__currentListenerStack.indexOf(s)!==-1:this.__currentListenerStack===s:!1}do(...s){if(this.__dll&&!this._dll.empty){let e=this._dll.head;for(;e;){const t=e.item;t._hasRemoved||(this._pushCurrentListener(t),t.func.call(t.scope,...s),this._popCurrentListener());const i=e.next;t._once&&!t._hasRemoved&&(this.remove(e),e=void 0),e&&this._clearHasRemoved(e),e=i}}}get empty(){if(!this.__dll||this._dll.empty)return!0;let s=!0,e=this._dll.head;for(;e;){if(!e.item._hasRemoved){s=!1;break}e=e.next}return s}isHandlerValid(s){return!s.item._hasRemoved}nextHandler(s){if(!s.item._hasRemoved)throw new Error("handler has removed!");let e=s.next;for(;e&&e.item._hasRemoved;)e=e.next;return e}prevHandler(s){if(!s.item._hasRemoved)throw new Error("handler has removed!");let e=s.previous;for(;e&&e.item._hasRemoved;)e=e.previous;return e}moveAfter(s,e){if(s.item._hasRemoved||e.item._hasRemoved)throw new Error("handler or nextHandler has removed!");return this._dll.moveAfter(s,e)}moveBefore(s,e){if(s.item._hasRemoved||e.item._hasRemoved)throw new Error("handler or prevHandler has removed!");return this._dll.moveBefore(s,e)}insertBefore(s,e,t,i=!1){if(s.item._hasRemoved)throw new Error("handler has removed!");const r=vi.create();return r.func=e,r.scope=t,r._once=i,this._dll.insertBefore(s,r)}insertAfter(s,e,t,i=!1){if(s.item._hasRemoved)throw new Error("handler has removed!");const r=vi.create();return r.func=e,r.scope=t,r._once=i,this._dll.insertAfter(s,r)}_clearHasRemoved(s){s.item._hasRemoved&&!this._hasCurrentListener(s.item)&&(vi.destroy(s.item),this._dll.remove(s))}remove(s){if(!s.item||s.item._hasRemoved)throw new Error("handler has removed!");this._hasCurrentListener(s.item)?s.item._hasRemoved=!0:(vi.destroy(s.item),this._dll.remove(s))}removeAll(){if(this.__dll&&!this._dll.empty){let s=this._dll.head;for(;s;){const e=s.next;s.item._hasRemoved||this.remove(s),s=e}}}destroy(){if(!this.__dll)return;let s=this._dll.head;for(;s;){const e=s.next,t=s;this._hasCurrentListener(t.item)||(console.warn("Event has remove item that on current stack!"),console.warn(`${t.item.func.toString()}`)),vi.destroy(t.item),this._dll.remove(t),s=e}this.__dll=void 0,this.__currentListenerStack=void 0}push(s,e,t=!1){const i=vi.create();return i.func=s,i.scope=e,i._once=t,this._dll.push(i)}pop(){const s=this.tail;if(!s)throw new Error("pop error!");this.remove(s)}shift(){const s=this.head;if(!s)throw new Error("shift error!");this.remove(s)}unshift(s,e,t=!1){const i=vi.create();return i.func=s,i.scope=e,i._once=t,this._dll.unshift(i)}get tail(){let s=this._dll.tail;for(;s&&s.item._hasRemoved;)s=s.previous;return s}get head(){let s=this._dll.head;for(;s&&s.item._hasRemoved;)s=s.previous;return s}}class sn{constructor(){a(this,"_listenerHandler");a(this,"_cid")}_reset(s,e){this._listenerHandler=s,this._cid=e}clone(s){return s=s??new sn,s._reset(this._listenerHandler,this._cid),s}get valid(){if(typeof this._listenerHandler<"u"&&typeof this._cid=="number"){const s=this._listenerHandler._cid;if(typeof s<"u"&&this._cid===s)return!0}return!1}}class jr extends sn{}class v extends b{constructor(){super(...arguments);a(this,"__pipe");a(this,"beforeCallback");a(this,"afterCallback")}get _pipe(){return this.__pipe=this.__pipe??new Ar,this.__pipe}get empty(){return!this.__pipe||this._pipe.empty}emit(...e){!this.isDestroyed()&&this.beforeCallback&&this.beforeCallback(...e),!this.isDestroyed()&&this._pipe.do(...e),!this.isDestroyed()&&this.afterCallback&&this.afterCallback(...e)}on(e,t,i=!1,r){const o=i?this._pipe.unshift(e,t,!1):this._pipe.push(e,t,!1);return r=r??new jr,r._reset(o,o._cid),r}disposableOn(e,t,i=!1,r){const o=this.on(e,t,i,r);return()=>{o.valid&&this.off(o)}}don(e,t,i=!1,r){return this.disposableOn(e,t,i,r)}disposableWeakOn(e,t,i=!1,r){const o=new b,l=()=>{!o.isDestroyed()&&o.destroy()};return o.dispose(this.disposableOn(e,t,i,r)),o.dispose(this.toDestroyEvent.disposableOn(l)),l}dwon(e,t,i=!1,r){return this.disposableWeakOn(e,t,i,r)}once(e,t,i=!1,r){const o=i?this._pipe.unshift(e,t,!0):this._pipe.push(e,t,!0);return r=r??new jr,r._reset(o,o._cid),r}disposableOnce(e,t,i=!1,r){const o=this.once(e,t,i,r);return()=>o.valid&&this.off(o)}donce(e,t,i=!1,r){const o=this.once(e,t,i,r);return()=>o.valid&&this.off(o)}off(e){if(!e.valid)throw new Error("handler is not valid!");this._pipe.remove(e._listenerHandler),e._reset()}reset(){this._pipe.removeAll()}destroyImp(){this.empty||(is("The event is destroying with listeners!"),this._pipe.removeAll())}}xl(v);function ss(n,s){return s=s??new sn,s._reset(n,n._cid),s}class Md{constructor(){a(this,"__pipe")}get _pipe(){return this.__pipe=this.__pipe??new Ar,this.__pipe}get empty(){return!this.__pipe||this._pipe.empty}do(...s){return this._pipe.do(...s)}isHandlerValid(s){return s.valid?this._pipe.isHandlerValid(s._listenerHandler):!1}moveAfter(s,e){if(!s.valid||!e.valid)throw new Error("handler or nextHander is not valid!");return this._pipe.moveAfter(s._listenerHandler,e._listenerHandler)}moveBefore(s,e){if(!s.valid||!e.valid)throw new Error("handler or nextHander is not valid!");return this._pipe.moveAfter(s._listenerHandler,e._listenerHandler)}insertBefore(s,e,t,i=!1,r){if(!s.valid)throw new Error("handler is not valid!");const o=this._pipe.insertBefore(s._listenerHandler,e,t,i);return ss(o,r)}insertAfter(s,e,t,i=!1,r){if(!s.valid)throw new Error("handler is not valid!");const o=this._pipe.insertAfter(s._listenerHandler,e,t,i);return ss(o,r)}remove(s){if(!s.valid)throw new Error("handler is not valid!");return this._pipe.remove(s._listenerHandler)}removeAll(){return this._pipe.removeAll()}push(s,e,t=!1,i){const r=this._pipe.push(s,e,t);return ss(r,i)}pop(){return this._pipe.pop()}shift(){return this._pipe.shift()}unshift(s,e,t=!1,i){const r=this._pipe.unshift(s,e,t);return ss(r,i)}getTail(s){const e=this._pipe.tail;if(e)return ss(e,s)}getHead(s){const e=this._pipe.head;if(e)return ss(e,s)}}class ge extends b{constructor(e,t,i){super();a(this,"_changed");a(this,"_value");a(this,"_oldValue");a(this,"toChangeFunc");this._equalsFunc=t,this._assignFunc=i,this._value=this._assignFunc&&this._assignFunc(e,void 0)||e}get assignFunc(){return this._assignFunc}get equalsFunc(){return this._equalsFunc}equals(e){return this._equalsFunc?this._equalsFunc(this._value,e):this._value===e}set value(e){if(this._equalsFunc?!this._equalsFunc(this._value,e):this._value!==e){if(this.toChangeFunc&&!this.toChangeFunc(e,this._value))return;this._assignFunc?(this._oldValue=this._assignFunc(this._value,this._oldValue),this._value=this._assignFunc(e,this._value)):(this._oldValue=this._value,this._value=e),this._changed&&this._changed.emit(e,this._oldValue)}}get value(){return this._value}get changed(){return this._changed||(this._changed=this.disposeVar(new v)),this._changed}forceChange(){this._changed&&this._changed.emit(this._value,this._value)}}function w(n,s,e){return new ge(n,s,e)}function F(n){return new ge(n,(s,e)=>s.length!==e.length?!1:s.every((t,i)=>t===e[i]),(s,e)=>{const t=e||new Array(s.length);return t.length=s.length,s.forEach((i,r)=>t[r]=i),t})}function q(n){return w(n,(s,e)=>s===void 0||e===void 0?s===void 0&&e===void 0:s.length!==e.length?!1:s.every((t,i)=>t===e[i]),(s,e)=>{if(!s)return;const t=e||new Array(s.length);return t.length=s.length,s.forEach((i,r)=>t[r]=i),t})}function jn(n,s,e){return w(n,(t,i)=>t.length!==i.length?!1:t.every((r,o)=>s&&s(r,i[o])||r===i[o]),(t,i)=>{const r=i||new Array(t.length);return r.length=t.length,t.forEach((o,l)=>{r[l]=e?e(o):o}),r})}function Xt(n,s,e){return w(n,(t,i)=>t===void 0||i===void 0?t===void 0&&i===void 0:t.length!==i.length?!1:t.every((r,o)=>s&&s(r,i[o])||r===i[o]),(t,i)=>{if(!t)return;const r=i||new Array(t.length);return r.length=t.length,t.forEach((o,l)=>{r[l]=e?e(o):o}),r})}function B(n){return new ge(n,(s,e)=>s===e||s!==void 0&&e!==void 0&&JSON.stringify(s)===JSON.stringify(e),(s,e)=>{if(s!==void 0)return JSON.parse(JSON.stringify(s))})}function te(n){return new ge(n,(s,e)=>s===e||s!==void 0&&e!==void 0&&JSON.stringify(s)===JSON.stringify(e),(s,e)=>{if(s!==void 0)return JSON.parse(JSON.stringify(s))})}function Ad(n){return new ge(n,(s,e)=>{if(s===e)return!0;if(s===void 0||e===void 0)return!1;const t=Object.keys(s),i=Object.keys(e);return t.length!==i.length?!1:t.every((r,o)=>r===i[o]&&s[r]===e[r])},(s,e)=>s&&{...s})}function jd(n){return new ge(n,(s,e)=>{if(s===e)return!0;if(s===void 0||e===void 0)return!1;const t=Object.keys(s),i=Object.keys(e);return t.length!==i.length?!1:t.every((r,o)=>r===i[o]&&s[r]===e[r])},(s,e)=>s&&{...s})}function Rd(n){return jn(n,(s,e)=>s.every((t,i)=>t===e[i]),s=>[...s])}function Rr(n){return Xt(n,(s,e)=>s.every((t,i)=>t===e[i]),s=>[...s])}function Nd(n){return jn(n,(s,e)=>JSON.stringify(s)===JSON.stringify(e),s=>JSON.parse(JSON.stringify(s)))}function Ld(n){return Xt(n,(s,e)=>JSON.stringify(s)===JSON.stringify(e),s=>JSON.parse(JSON.stringify(s)))}function Yt(n){return Rr(n)}function Nr(n){return Xt(n,(s,e)=>s.length===e.length&&s.every((t,i)=>t.every((r,o)=>r===e[i][o])),s=>s.map(e=>[...e]))}function Vd(n){return Xt(n,(s,e)=>s.length===e.length&&s.every((t,i)=>t.every((r,o)=>r===e[i][o])),s=>s.map(e=>[...e]))}function Rn(n){const s=n instanceof ge?[n,"value","changed"]:[...n];return s[2]=s[2]||s[1]+"Changed",s}function Lr(n,s,e,t=!1){s[2]=s[2]||s[1]+"Changed";const i=()=>{const r=s[0][s[1]];e?n[0][n[1]]=e(r):n[0][n[1]]=r};return i(),t?s[0][s[2]].disposableWeakOn(i):s[0][s[2]].disposableOn(i)}function zd(n,s,e,t,i=!1){const r=Lr(n,s,e,i),o=Lr(s,n,t,i);return()=>(r(),o())}function _(n,s,e,t=!1){const i=n instanceof ge?[n,"value","changed"]:n,r=s instanceof ge?[s,"value","changed"]:s;return Lr(i,r,e,t)}function D(n,s,e,t,i=!1){const r=Rn(n),o=Rn(s);return zd(r,o,e,t,i)}function Ud(n,s,e,t=!1){const[i]=tn(s);return D(n,s,r=>r??e,r=>{if(!(r===e&&i()===void 0))return r},t)}function ns(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(n){var s=Math.random()*16|0,e=n==="x"?s:s&3|8;return e.toString(16)})}function Nn(n,s){if(!globalThis||!globalThis.setTimeout||!globalThis.clearTimeout)throw new Error("目前只适合在浏览器中使用!");let e=0;function t(){e>0&&(globalThis.clearTimeout(e),e=0)}function i(...r){t(),e=globalThis.setTimeout(n,s,...r)}return[i,t]}function Vr(n,s,...e){const t=setInterval(n,s,...e);return()=>clearInterval(t)}function zr(n,s,...e){const t=setTimeout(n,s,...e);return()=>clearTimeout(t)}function Ln(n,...s){let e;const t=()=>{const i=performance.now();n(i,...s),e=requestAnimationFrame(t)};return t(),()=>typeof e<"u"&&(cancelAnimationFrame(e),e=void 0)}function rs(n,...s){let e;return e=requestAnimationFrame(()=>{const i=performance.now();n(i,...s)}),()=>typeof e<"u"&&(cancelAnimationFrame(e),e=void 0)}function nn(n,...s){let e=!1,t;return new Promise((i,r)=>{t=r,i()}).then(()=>{!e&&n(...s)}).catch(i=>{console.error(i)}),()=>(e=!0)&&t&&(t("nextMicroTask cancelled!"),t=void 0)}class Vn extends v{constructor(e,t,...i){super();a(this,"_cancellFunc");this._nextFunc=e,this.dispose(()=>{this._cancellFunc&&(this._cancellFunc(),this._cancellFunc=void 0)}),i.forEach(r=>this.dispose(r[t?"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 Ur extends Vn{constructor(...s){super(nn,!1,...s)}}function Bd(...n){return new Ur(...n)}class Wd extends Vn{constructor(...s){super(nn,!0,...s)}}function Hd(...n){return new Ur(...n)}class zn extends Vn{constructor(...s){super(rs,!1,...s)}}function oe(...n){return new zn(...n)}function $d(n,s){return new zn(...n).don(s())}class kl extends Vn{constructor(...s){super(rs,!0,...s)}}function Gd(...n){return new kl(...n)}function de(n,s,e={time:"don",immediate:!1}){const t=new zn(...Array.isArray(n)?n:[n]),i=t[e.time??"don"](s);return(e.immediate??!1)&&s(),()=>{i(),t.destroy()}}function rn(n){let s;if(typeof n.next=="function")s=n;else if(typeof n[Symbol.iterator]=="function")s=n[Symbol.iterator]();else throw new Error("iteratorOrIterable error!");return s}function Br(n,s){let e=!1;const t=rn(n);let i=-1;for(;;){const{done:r,value:o}=t.next();if(r)break;if(s(o,++i)){e=!0;break}}return e}function Wr(n,s){return!Br(n,(t,i)=>!s(t,i))}function on(n,s,e,t){const i=n;if(!i[s]){const r=t(),o=Object.fromEntries(Object.entries(r).filter(([l,h])=>{const c=Object.getPrototypeOf(e),u=l in c;if(u){const p=h instanceof ge?h.value:h;n[l]=p}return!u}).map(([l,h])=>h instanceof ge?[l,h]:[l,Array.isArray(h)?q(h):w(h)]));i[s]=o}return i[s]}function Kt(n,s){var t;const e=Symbol(`${(t=n==null?void 0:n.constructor)==null?void 0:t.name}-createDefaultProps`);n.constructor.__xbsj_dpSymbol=e,n.constructor.__xbsj_createDefaultProps=s;for(let[i,r]of Object.entries(s()))if(!Reflect.has(n,i)){const o=function(l){var u,p;if(l[e])return;const h=[];let c=Object.getPrototypeOf(l);for(;c;)h.push(c),c=Object.getPrototypeOf(c);h.reverse();for(let g of h){const m=(u=g.constructor)==null?void 0:u.__xbsj_dpSymbol;if(!m)continue;const y=(p=g.constructor)==null?void 0:p.__xbsj_createDefaultProps;y&&on(l,m,g,y)}};Object.defineProperties(n,{[i]:{get(){return o(this),on(this,e,n,s)[i].value},set(l){o(this);const h=on(this,e,n,s)[i];if(!h){console.error("!propObj");debugger}h.value=l}},[`${i}Changed`]:{get(){return o(this),on(this,e,n,s)[i].changed}},[`${i}React`]:{get(){return o(this),on(this,e,n,s)[i]}}})}}const an=new WeakMap;function vt(n,s,e){an.has(n)||an.set(n,{});const t=an.get(n);t[s]=e}function Ne(n,s){return an.has(n)?an.get(n)[s]:void 0}function _t(n,s){const e=rn(n);let t=0;for(;;){const{done:i,value:r}=e.next();if(i)break;s(r,t++)}}function ln(n,s,e){const t=rn(n);let i=e,r=0;for(;;){const{done:o,value:l}=t.next();if(o)break;i=s(i,l,r++)}return i}const Jd=n=>++n;function Hr(n){return ln(n,Jd,0)}function Nt(n){return ln(n,(s,e)=>s>e?s:e,Number.NEGATIVE_INFINITY)}function Zt(n){return ln(n,(s,e)=>s<e?s:e,Number.POSITIVE_INFINITY)}function Ml(n,s){let e=n;for(let t of s)e=e[t];return e}function qd(n,s,e){if(s.length===0)throw new Error("props的数量必须大于0");const t=s.length-1,i=s[t];let r=n;for(let o=0;o<t;++o){const l=s[o];typeof r[l]>"u"&&(r[l]={}),r=r[l]}r[i]=e}function*_i(n,s){const e=rn(n);for(;;){const{done:t,value:i}=e.next();if(t)break;yield Ml(i,s)}}class hn extends b{constructor(){super();a(this,"_innerObj");a(this,"_toChangeEvent");a(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 v),this._toChangeEvent}get changedEvent(){return this._changedEvent||(this._changedEvent=new v),this._changedEvent}_resetArray(e){this._toChangeEvent&&this._toChangeEvent.emit([{start:0,deleteCount:this._innerObj.length,items:e}],this);const{length:t}=e;this._innerObj.length=t;for(let i=0;i<t;++i)this._innerObj[i]=e[i];this._changedEvent&&this._changedEvent.emit(this)}splice(e,t,...i){const{length:r}=this._innerObj;e=e>this._innerObj.length?this._innerObj.length:e,e>r?e=r:e<0&&(e+=r,e<0&&(e=0));const o=this._innerObj.length-e;if(t>o?t=o:t<0&&(t=0),arguments.length===1){this._toChangeEvent&&this._toChangeEvent.emit([{start:e,deleteCount:this._innerObj.length-e,items:[]}],this);const l=this._innerObj.splice(e);return this._changedEvent&&this._changedEvent.emit(this),l}else if(arguments.length===2){this._toChangeEvent&&this._toChangeEvent.emit([{start:e,deleteCount:t,items:[]}],this);const l=this._innerObj.splice(e,t);return this._changedEvent&&this._changedEvent.emit(this),l}else{this._toChangeEvent&&this._toChangeEvent.emit([{start:e,deleteCount:t,items:i}],this);const l=this._innerObj.splice(e,t,...i);return this._changedEvent&&this._changedEvent.emit(this),l}}pop(){if(this._innerObj.length===0)return;if(this._toChangeEvent){const t=this._innerObj.length-1,i=1,r=[];this._toChangeEvent.emit([{start:t,deleteCount:i,items:r}],this)}const e=this._innerObj.pop();return this._changedEvent&&this._changedEvent.emit(this),e}push(...e){if(this._toChangeEvent){const i=this._innerObj.length;this._toChangeEvent.emit([{start:i,deleteCount:0,items:e}],this)}const t=this._innerObj.push(...e);return this._changedEvent&&this._changedEvent.emit(this),t}get length(){return this._innerObj.length}set length(e){if(e<0)throw new Error("value < 0");const{length:t}=this._innerObj;if(t!==e){if(this._toChangeEvent){let i,r,o;t>e?(i=e,r=t-e,o=[]):(i=t,r=0,o=new Array(e-t)),this._toChangeEvent.emit([{start:i,deleteCount:r,items:o}],this)}this._innerObj.length=e,this._changedEvent&&this._changedEvent.emit(this)}}get(e){return this._innerObj[e]}set(e,t){const{length:i}=this._innerObj;if(e<0||e>=i)throw new Error("index < 0 || index >= length");this._toChangeEvent&&this._toChangeEvent.emit([{start:e,deleteCount:1,items:[t]}],this),this._innerObj[e]=t,this._changedEvent&&this._changedEvent.emit(this)}indexOf(e){return this._innerObj.indexOf(e)}[Symbol.iterator](){return this._innerObj[Symbol.iterator]()}}function $r(n,s,...e){let t=n;for(let i of e){if(!t[i])if(s)t[i]={};else return;t=t[i]}return t}function Xd(n,s,e){typeof e>"u"&&(s.endsWith(".gltf")?e="model/gltf+json":s.endsWith(".bin")?e="application/octet-stream":s.endsWith(".glb")?e="model/gltf-binary":s.endsWith(".jpg")||s.endsWith(".jpeg")?e="image/jpeg":s.endsWith(".png")?e="image/png":s.endsWith(".glsl")?e="text/plain":s.endsWith(".json")?e="application/json":s.endsWith(".b3dm")||s.endsWith(".i3dm")||s.endsWith("pnts")||s.endsWith("cmpt")?e="application/octet-stream":console.warn(`save ${s}: MimeType无法确定!`));const t=new Blob([n],{type:e||""});let i=URL.createObjectURL(t);var r=document.createElement("a"),o=new MouseEvent("click");r.download=s,r.href=i,r.dispatchEvent(o),URL.revokeObjectURL(i)}function Yd(n,s){const e=document.createElement("a"),t=new MouseEvent("click");e.download=s||"下载",e.href=n,e.dispatchEvent(t)}function Kd(){return new Promise((n,s)=>{const e=performance.now();requestAnimationFrame(t=>n(t>e))})}const Un=n=>{let s,e;return e=t=>{t=performance.now(),s=requestAnimationFrame(e),n(t)},s=requestAnimationFrame(e),()=>{cancelAnimationFrame(s)}};function Gr(n,s,e=Un){let t=Number.NEGATIVE_INFINITY,i;function r(h){h-t>s&&i&&(n(...i),i=void 0,t=h)}const o=e&&e(r)||void 0;function l(...h){i=h}return[l,o]}const Al=[];function jl(n,s,e){if(Al.includes(n)){console.warn(`_loadJs ${n} has loaded before!`),s&&s();return}var t=document.getElementsByTagName("head")[0],i=document.createElement("script");i.setAttribute("type","text/javascript"),i.setAttribute("src",n),i.onload=i.onreadystatechange=function(){this.readyState&&this.readyState!=="complete"||(Al.push(n),s&&s(),i.onload=i.onreadystatechange=null)},i.onerror=(r,o,l,h,c)=>{e(c)},t.appendChild(i)}function Jr(n,s=!0){if(s){const e=globalThis.L;globalThis.L&&(globalThis.L=void 0);const t=globalThis.define;return globalThis.define&&(globalThis.define=void 0),new Promise((i,r)=>{jl(n,i,r)}).then(()=>(globalThis.define=t,globalThis.L=e,Promise.resolve()))}else return new Promise((e,t)=>{jl(n,e,t)})}async function Rl(n,s=""){return new Promise((e,t)=>{var i=new Image;i.crossOrigin=s,i.src=n,i.onload=()=>e(i),i.onerror=r=>t(r)})}class Zd extends b{constructor(s){super(),this._owner=s}get owner(){return this._owner}}function Nl(n,s){if(n.length%3!==0)throw new Error("positions.length % 3 !== 0");const e=n.length/3;function*t(o){for(let l=0;l<e;++l)yield n[l*3+o]}const i=(s==null?void 0:s.min)??[NaN,NaN,NaN],r=(s==null?void 0:s.max)??[NaN,NaN,NaN];return i[0]=Zt(t(0))??NaN,i[1]=Zt(t(1))??NaN,i[2]=Zt(t(2))??NaN,r[0]=Nt(t(0))??NaN,r[1]=Nt(t(1))??NaN,r[2]=Nt(t(2))??NaN,{min:i,max:r}}async function Qd(n,s=fetch){const e=await s(n);return e.ok?await e.arrayBuffer():void 0}class eu extends b{constructor(e){super();a(this,"_map",new Map);a(this,"_array",[]);a(this,"_createEvent",this.dv(new v));a(this,"_updateEvent",this.dv(new v));a(this,"_destroyEvent",this.dv(new v));this._idFunc=e,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(e,t={toDel:!0,toAdd:!0,toUpdate:!0}){const{toDel:i=!0,toAdd:r=!0,toUpdate:o=!0}=t;for(let h of this._array)h.updated=!1;const l=e.length;for(let h=0;h<l;++h){const c=e[h],u=this._idFunc(c,h);if(this._map.has(u)){if(o){const p=this._map.get(u);if(!p)throw new Error("!edwi");p.updated=!0,p.item=c,this._updateEvent.emit(u,c)}}else if(r){const p={item:c,id:u,updated:!0};this._array.push(p),this._map.set(u,p),this._createEvent.emit(u,c)}}if(i){const h=this._array.filter(c=>!c.updated);this._array=this._array.filter(c=>c.updated);for(let c of h)this._map.delete(c.id);for(let c of h)this._destroyEvent.emit(c.id,c.item)}}}function Bn(n,...s){if(n>16)throw new Error("length > 16");const e=new Array(n);for(let t=0;t<n;++t)e[t]=s[t]??0;return e}class Wn{constructor(s,e){this._xyzw=s,this._length=e}set 0(s){this._xyzw.x=s}set 1(s){this._xyzw.y=s}set 2(s){this._xyzw.z=s}set 3(s){this._xyzw.w=s}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 tu(n){return new Wn(n,2)}function iu(n){return new Wn(n,3)}function su(n){return new Wn(n,4)}class nu{constructor(s,e,t,i){this._array=s,this._length=e,this._start=t,this._stride=i}get length(){return this._length}set 0(s){this._array[this._start+0*this._stride]=s}set 1(s){this._array[this._start+1*this._stride]=s}set 2(s){this._array[this._start+2*this._stride]=s}set 3(s){this._array[this._start+3*this._stride]=s}set 4(s){this._array[this._start+4*this._stride]=s}set 5(s){this._array[this._start+5*this._stride]=s}set 6(s){this._array[this._start+6*this._stride]=s}set 7(s){this._array[this._start+7*this._stride]=s}set 8(s){this._array[this._start+8*this._stride]=s}set 9(s){this._array[this._start+9*this._stride]=s}set 10(s){this._array[this._start+10*this._stride]=s}set 11(s){this._array[this._start+11*this._stride]=s}set 12(s){this._array[this._start+12*this._stride]=s}set 13(s){this._array[this._start+13*this._stride]=s}set 14(s){this._array[this._start+14*this._stride]=s}set 15(s){this._array[this._start+15*this._stride]=s}set 16(s){this._array[this._start+16*this._stride]=s}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 ru(n,s,e=0,t=1){return new nu(n,s,e,t)}d.Vector=void 0,(n=>{function s(P,...O){if(P=P||Bn(O.length),O.length>P.length)throw new Error("args.length > target.length");return P instanceof Float64Array?P.set(O):mt(O,P),P}n.set=s;function e(P,O){const Z=P.length;for(let ce=0;ce<Z;++ce)if(!O(P[ce],ce))return!1;return!0}n.every=e;function t(P,O,Z){const ce=P.length;let je=Z;for(let Rt=0;Rt<ce;++Rt)je=O(je,P[Rt],Rt);return je}n.reduce=t;function*i(P){for(let O=0;O<P.length;++O)yield P[O]}n.itr=i;const r=(P,O)=>P+=O*O;function o(P){return t(P,r,0)}n.magnitudeSquared=o;function l(P){const O=o(P);return Math.sqrt(O)}n.magnitude=l;function h(P,O=1e-5){const Z=o(P);return Math.abs(Z-1)<O}n.isNormalized=h;let c;const u=(P,O,Z)=>P+O*c[Z];function p(P,O){return Q(P,O),c=O,t(P,u,0)}n.dot=p;let g;const m=(P,O,Z)=>P+=(O-g[Z])*(O-g[Z]);function y(P,O){return Q(P,O),g=O,t(P,m,0)}n.distanceSquared=y;function S(P,O){return Math.sqrt(y(P,O))}n.distance=S;let C;const T=(P,O)=>P===C[O];function V(P,O){return Q(P,O),C=O,e(P,T)}n.equals=V;let z,x;const $=(P,O)=>Math.abs(P-z[O])<x;function Y(P,O,Z=0){return Q(P,O),z=O,x=Z,e(P,$)}n.equalsEpsilon=Y;function Q(P,O){if(P.length!==O.length)throw new Error("left.length !== right.length")}function Ae(P,O,Z){const ce=P.length;Z=Z||Bn(ce),Q(P,Z);for(let je=0;je<ce;++je)Z[je]=O(P[je],je);return Z}n.op1=Ae;function qe(P,O,Z,ce){Q(P,O),ce&&Q(P,ce);const je=P.length;ce=ce||Bn(je);for(let Rt=0;Rt<je;++Rt)ce[Rt]=Z(P[Rt],O[Rt]);return ce}n.op2=qe;const jt=P=>P;function mt(P,O){return Ae(P,jt,O)}n.clone=mt;let fi=0;const mi=(P,O)=>P*fi;function El(P,O,Z){return fi=O,Ae(P,mi,Z)}n.multiplyByScalar=El;function qf(P,O,Z=0){const ce=o(P);if(ce<=Z)return;const je=Math.sqrt(ce);return El(P,1/je,O)}n.normalize=qf;function Xf(P,O){return El(P,-1,O)}n.negate=Xf;const Yf=P=>Math.abs(P);function Kf(P,O){return Ae(P,Yf,O)}n.abs=Kf;const Zf=P=>P-Math.floor(P);function Qf(P,O){return Ae(P,Zf,O)}n.fract=Qf;const em=(P,O)=>P-O;function tm(P,O,Z){return qe(P,O,em,Z)}n.subtract=tm;const im=(P,O)=>P+O;function sm(P,O,Z){return qe(P,O,im,Z)}n.add=sm;const nm=(P,O)=>P*O;function rm(P,O,Z){return qe(P,O,nm,Z)}n.multiply=rm;const om=(P,O)=>P/O;function am(P,O,Z){return qe(P,O,om,Z)}n.divide=am;let bl;const lm=(P,O)=>P*(1-bl)+O*bl;function hm(P,O,Z,ce){return bl=Z,qe(P,O,lm,ce)}n.lerp=hm})(d.Vector||(d.Vector={}));function Hn(n,s=0,e=1){return n<s?s:n>e?e:n}class $n extends b{constructor(e,t,i,r,o,l,h,c){super();a(this,"__status");a(this,"_statusChangedEvent");a(this,"_forceCancelFunc");a(this,"_startEvent");a(this,"_progressEvent");a(this,"_completeEvent");a(this,"_cancelEvent");a(this,"_cancelledEvent");a(this,"_errorEvent");a(this,"_finishedEvent");a(this,"_processingID",-1);this._startProcessingFunc=e,this.startFunc=t,this.progressFunc=i,this.completeFunc=r,this.cancelFunc=o,this.cancelledFunc=l,this.errorFunc=h,this.finishedFunc=c,this._status="Initial",this.dispose(()=>{var u;return(u=this._statusChangedEvent)==null?void 0:u.destroy()}),this.dispose(()=>{var u;return(u=this._startEvent)==null?void 0:u.destroy()}),this.dispose(()=>{var u;return(u=this._progressEvent)==null?void 0:u.destroy()}),this.dispose(()=>{var u;return(u=this._completeEvent)==null?void 0:u.destroy()}),this.dispose(()=>{var u;return(u=this._cancelEvent)==null?void 0:u.destroy()}),this.dispose(()=>{var u;return(u=this._cancelledEvent)==null?void 0:u.destroy()}),this.dispose(()=>{var u;return(u=this._errorEvent)==null?void 0:u.destroy()}),this.dispose(()=>{var u;return(u=this._finishedEvent)==null?void 0:u.destroy()}),this.dispose(()=>this.reset())}get startEvent(){return this._startEvent=this._startEvent||new v,this._startEvent}get progressEvent(){return this._progressEvent=this._progressEvent||new v,this._progressEvent}get completeEvent(){return this._completeEvent=this._completeEvent||new v,this._completeEvent}get cancelEvent(){return this._cancelEvent=this._cancelEvent||new v,this._cancelEvent}get cancelledEvent(){return this._cancelledEvent=this._cancelledEvent||new v,this._cancelledEvent}get errorEvent(){return this._errorEvent=this._errorEvent||new v,this._errorEvent}get finishedEvent(){return this._finishedEvent=this._finishedEvent||new v,this._finishedEvent}_completeFunc(e,t){this.processingID===e&&this._status==="Running"&&(this._status="Completed",this.completeFunc&&this.completeFunc(t),this._completeEvent&&this._completeEvent.emit(t),this.finishedFunc&&this.finishedFunc({status:"Completed",value:t}),this._finishedEvent&&this._finishedEvent.emit({status:"Completed",value:t}))}_cancelFunc(e){this._status==="Running"&&(this._status="Cancelling",this.cancelFunc&&this.cancelFunc(e),this._cancelEvent&&this._cancelEvent.emit(e))}_cancelledFunc(e){this._status==="Cancelling"&&(this._status="Cancelled",this.cancelledFunc&&this.cancelledFunc(e),this._cancelledEvent&&this._cancelledEvent.emit(e),this.finishedFunc&&this.finishedFunc({status:"Cancelled",cancelError:e}),this._finishedEvent&&this._finishedEvent.emit({status:"Cancelled",cancelError:e}))}_errorFunc(e,t){this.processingID===e&&this._status==="Running"&&(this._status="Error",this.errorFunc&&this.errorFunc(t),this._errorEvent&&this._errorEvent.emit(t),this.finishedFunc&&this.finishedFunc({status:"Error",error:t}),this._finishedEvent&&this._finishedEvent.emit({status:"Error",error:t}))}_progressFunc(e,t){this.processingID===e&&this._status==="Running"&&(this.progressFunc&&this.progressFunc(t),this._progressEvent&&this._progressEvent.emit(t))}_startFunc(...e){if(this._status==="Initial"){this._status="Running";const t=++this._processingID,i={completeFunc:this._completeFunc.bind(this,t),errorFunc:this._errorFunc.bind(this,t),progressFunc:this._progressFunc.bind(this,t),cancelFunc:this._cancel.bind(this,t),processingID:t},r=this._startProcessingFunc(i,...e);return this._forceCancelFunc=r,this.startFunc&&this.startFunc(...e),this._startEvent&&this._startEvent.emit(...e),t}else return console.warn("this._status !== 'Initial' but start again!"),-1}set _status(e){if(this.__status!==e){const t=this.__status;this.__status=e,this._statusChangedEvent&&this._statusChangedEvent.emit(e,t)}}get _status(){return this.__status}get processingID(){return this._processingID}get statusChangedEvent(){return this._statusChangedEvent||(this._statusChangedEvent=new v),this._statusChangedEvent}reset(e){this._status==="Running"&&this.cancel(e),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(e,t=this.processingID){return this._cancel(t,e)}_cancel(e,t){if(this.processingID===e)if(this._status==="Running"){if(!this._forceCancelFunc)throw new Error("this._forceCancelFunc is undefined!");this._cancelFunc(t);const i=this._forceCancelFunc(t);if(this._forceCancelFunc=void 0,i&&i instanceof Promise)return i.then(()=>{this._cancelledFunc(t)});this._cancelledFunc(t)}else console.warn("this._status !== 'Running' but cancel")}start(...e){try{return this._startFunc(...e)}catch(t){console.error(`processing start error: ${t}`)}}restart(e,...t){try{return this.isRunning&&this.cancel(e),this.isFinished&&this.reset(e),this.isInitial?this._startFunc(...t):(console.warn("restart failed!"),-1)}catch(i){console.error(`processing restart error: ${i}`)}}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 qr=class extends Error{};function Ll(n,s){typeof n=="function"?n(s):n.cancelFunc=s}class Xr extends $n{constructor(e=300){super(({progressFunc:t,completeFunc:i,errorFunc:r})=>{const[o,l]=Nn(()=>{if(!this._lastDebounceValue)throw new Error("!this._lastDebounceValue");t([this._lastDebounceValue,this._debouncTimes]),this._debouncTimes=0},this._delayTime);return this._d=o,()=>{l()}});a(this,"_lastDebounceValue");a(this,"_debouncTimes",0);a(this,"_d");this._delayTime=e}get delayTime(){return this._delayTime}debounce(...e){this.isRunning?(++this._debouncTimes,this._lastDebounceValue=e,this._d&&this._d()):console.warn("Debouncing is not running!")}}function Vl(n,s,...e){const t=new AbortController;let i=t.signal,[r,o]=e;if(o!=null&&o.signal)throw console.error("init?.signal"),new Error("init?.signal");o=o||{},o.signal=i;let l=!1;Ll(n,()=>{l=!0,t.abort()});let h=fetch(r,o);return s&&(h=h.then(c=>{if(!c.ok)return c;if(!c.body)throw Error("ReadableStream not yet supported in this browser.");const u=c.headers.get("content-length"),p=u?parseInt(u,10):0;let g=0;return new Response(new ReadableStream({start(m){if(!c.body)throw new Error("!response.body");const y=c.body.getReader();S();function S(){y.read().then(({done:C,value:T})=>{if(C){m.close();return}if(!T)throw new Error("!value");if(!s)throw new Error("!progressFunc");g+=T.byteLength,s(g,p),m.enqueue(T),S()}).catch(C=>{m.error(C)})}}}),{status:c.status,statusText:c.statusText,headers:c.headers})}).catch(c=>{throw l?(c instanceof Error&&c.code!==20&&console.error("error.code !== 20"),console.log("fetching cancelled!"),new qr("fetching cancelled!")):(c instanceof Error&&c.code===20&&console.error("error.code === 20"),c)})),h}function zl(...n){if(n.length>=1)if(typeof n[0]=="function"||typeof n[0]>"u"){const s={};let e=Vl(s,...n);const{cancelFunc:t}=s;if(!t)throw new Error("!cancelResult.cancelFunc");return[t,e]}else return Vl(...n);throw new Error("cancelableFetch args error!")}class ou extends $n{constructor(e,...t){super(({progressFunc:i,completeFunc:r,errorFunc:o},...l)=>{const h={};let c={loaded:0,total:0};const u=(m,y)=>{c.loaded=m,c.total=y,i(c)},p=this._fetchArgs||l;if(p.length===0)throw new Error("fetchArgs.length === 0");if(zl(h,u,...p).then(e).then(r).catch(m=>{m instanceof qr||o(m)}),!h.cancelFunc)throw new Error("!cancelResult.cancelFunc");return h.cancelFunc});a(this,"_fetchArgs");t.length>0&&(this._fetchArgs=t)}get fetchArgs(){return this._fetchArgs}}function Yr(n,s,e,t){const i="_"+s,r="_"+s+"Changed",o=s+"Changed";Object.defineProperties(n.prototype,{[s]:{get(){return typeof this[i]>"u"&&typeof e<"u"&&(this[i]=e),this[i]},set(l){if(typeof this[i]>"u"&&typeof e<"u"&&(this[i]=e),t?!t(this[i],l):this[i]!==l){const h=this[i];this[i]=l,this[r]&&this[r].emit(l,h)}}},[o]:{get(){return typeof this[r]>"u"&&(this[r]=new v,typeof this.dispose<"u"&&this.dispose(()=>this[r].destroy())),this[r]}}})}class Kr extends $n{constructor(e,t=!0){super(({progressFunc:i,completeFunc:r,errorFunc:o})=>(this._intervalFunc=i,this._intervalID&&console.error("this._intervalID should be undefined!"),this.leading&&i(),this._intervalID=setInterval(i,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}));a(this,"_intervalID");a(this,"_intervalFunc");this.intervalTime=e,this.leading=t,this.dispose(this.intervalTimeChanged.disposableOn(()=>{this._intervalID&&this._intervalFunc&&(clearInterval(this._intervalID),this._intervalID=setInterval(this._intervalFunc,this.intervalTime))}))}}Yr(Kr,"leading",!0),Yr(Kr,"intervalTime",500);function au(n,s){let e,t;const i=new Promise((o,l)=>{t=l,e=globalThis.setTimeout(()=>{e=void 0,o()},n)}),r=o=>{e&&(clearTimeout(e),e=void 0),t&&t(o??new qr("sleep cancel error!"))};if(typeof s=="boolean"&&s)return[r,i];if(s)return Ll(s,r),i}class lu{constructor(s=0,e=0,t=0,i,r){a(this,"_processData");a(this,"_lastUpdateTimeStamp",0);this.startTime=s,this.duration=e,this.delay=t,this.proccessFunc=i,this.completeFunc=r,this._processData={ratio:0,timeStamp:0,timeStampFromStart:0,timeStampFromLastUpdate:0}}update(s){const e=(s-this.startTime)/this.duration;e>=0&&(this._processData.ratio=e,this._processData.timeStamp=s,this._processData.timeStampFromStart=s-this.startTime,this._processData.timeStampFromLastUpdate=s-this._lastUpdateTimeStamp,this._lastUpdateTimeStamp=s,this.proccessFunc&&this.proccessFunc(this._processData),e>=1&&this.completeFunc&&this.completeFunc())}start(){this.startTime=performance.now()+this.delay,this._lastUpdateTimeStamp=this.startTime}}class Ul extends $n{constructor(e=1e3,t=0,i=Un){let r;function o(){r&&r()}super(({progressFunc:h,completeFunc:c,errorFunc:u})=>{const p=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=h,this._base.completeFunc=()=>{p&&p(),c()},this._base.start(),r=p,o});a(this,"_base");a(this,"duration");a(this,"delay");a(this,"startUpdateFunc");this._base=new lu,this.duration=e,this.delay=t,this.startUpdateFunc=i}get startTime(){return this._base.startTime}}class hu extends b{constructor(e){super();a(this,"_target",0);a(this,"_current",0);a(this,"_start",0);a(this,"_timing",new Ul(Number.POSITIVE_INFINITY));a(this,"_currentChanged");this._duration=e,this._timing.progressFunc=({ratio:t})=>{t=t<0?0:t>1?1:t;const i=this._start*(1-t)+this._target*t;this._current=i,this._currentChanged&&this._currentChanged.emit(this._target,this._current)},this.dispose(()=>{this._timing.isRunning&&this._timing.cancel(),this._timing.destroy()})}reset(e,t=e){this._timing.isRunning&&this._timing.cancel(),this._target=e,this._current=t,this._start=e}set target(e){if(this._target!==e){this._target=e,this._timing.isRunning&&this._timing.cancel(),this._timing.reset(),this._start=this._current;const t=Math.abs(this._target-this._start);this._timing.duration=t*this._duration,this._timing.start()}}get target(){return this._target}get current(){return this._current}get currentChanged(){return this._currentChanged||(this._currentChanged=new v),this._currentChanged}}function Bl(n,s){s=s||[];const e=n.parentNode;return e?Bl(e,s.concat(e)):s}function cu(n){const s=n.composedPath&&n.composedPath()||n.path,e=n.target;if(s!=null)return s.indexOf(globalThis)<0?s.concat(globalThis):s;if(e===globalThis)return[globalThis];if(e===null)throw new Error("target === null");return[e].concat(Bl(e),globalThis)}function we(n,s=!1){const{offsetX:e,offsetY:t}=n;let i=e,r=t;{const o=cu(n);for(let l=0;l<o.length;++l){const h=o[l];if(h!==n.currentTarget&&h instanceof HTMLElement)i+=h.clientLeft,r+=h.clientTop,i+=h.offsetLeft,r+=h.offsetTop;else break}}return s?[i*globalThis.devicePixelRatio,r*globalThis.devicePixelRatio]:[i,r]}function os(n,s=!1){const e=n.target,t=n.currentTarget||n.__xbsj_lastCurrentTarget__;if(!e||!t)return[n.clientX,n.clientY];const i=e.getBoundingClientRect(),r=t.getBoundingClientRect(),o=i.left+n.offsetX,l=i.top+n.offsetY,h=o-r.left,c=l-r.top;return s?[h*globalThis.devicePixelRatio,c*globalThis.devicePixelRatio]:[h,c]}class Wl extends b{constructor(e){super();a(this,"_clickEvent",new v);a(this,"_dbclickEvent",new v);a(this,"_downEvent",new v);a(this,"_upEvent",new v);a(this,"_moveEvent",new v);a(this,"_debouncing",new Xr(300));this.dispose(()=>{this._clickEvent.destroy(),this._dbclickEvent.destroy(),this._downEvent.destroy(),this._upEvent.destroy(),this._moveEvent.destroy(),this._debouncing.destroy()});let t=!1,i=[0,0],r=!1;this._debouncing.progressFunc=([[u,p,g],m])=>{m===1?this._clickEvent.emit(u,p,g):m>=2?this._dbclickEvent.emit(u,p,g):console.error("point click should not be here!")},this._debouncing.start(),this.dispose(()=>{this._debouncing.isRunning&&this._debouncing.cancel(),this._debouncing.destroy()});const o=u=>{t=!0;const[p,g]=we(u);i[0]=p,i[1]=g,this._downEvent.emit(p,g,u)},l=u=>{const[p,g]=we(u);t&&!r&&this._debouncing.debounce(p,g,u),t=!1,r=!1,this._upEvent.emit(p,g,u)},h=u=>{const[p,g]=we(u);if(t&&!r){const[m,y]=i;(Math.abs(p-m)>3||Math.abs(g-y)>3)&&(r=!0)}this._moveEvent.emit(p,g,u)},c=()=>{t=!1,r=!1};e.addEventListener("pointerdown",o),e.addEventListener("pointerup",l),e.addEventListener("pointermove",h),e.addEventListener("pointerout",c),this.dispose(()=>{e.removeEventListener("pointerdown",o),e.removeEventListener("pointerup",l),e.removeEventListener("pointermove",h),e.removeEventListener("pointerout",c)})}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 Zr extends b{constructor(){super();a(this,"_pickRectEvent",this.disposeVar(new v));a(this,"_updateRectEvent",this.disposeVar(new v));a(this,"_pointerActionEvent",this.disposeVar(new v));a(this,"_active",this.disposeVar(w(!1)));a(this,"_pickRect",{left0:0,top0:0,left1:0,top1:0});let e=0,t=0,i=0,r=0;this.dispose(this._pointerActionEvent.disposableOn(({type:o,left:l,top:h})=>{o==="PointerDown"?(this._active.value=!0,e=l,t=h,i=l,r=h,this._setPickRect({left0:e,top0:t,left1:i,top1:r}),this._updateRectEvent.emit(this._pickRect)):o==="PointerMove"?this._active.value&&(i=l,r=h,this._setPickRect({left0:e,top0:t,left1:i,top1:r}),this._updateRectEvent.emit(this._pickRect)):o==="PointerUp"&&this._active.value&&(this._active.value=!1,i=l,r=h,this._setPickRect({left0:e,top0:t,left1:i,top1:r}),this._updateRectEvent.emit(this._pickRect),this._pickRectEvent.emit(this._pickRect))}))}_setPickRect({left0:e,left1:t,top0:i,top1:r}){this._pickRect.left0=e,this._pickRect.left1=t,this._pickRect.top0=i,this._pickRect.top1=r}pointerDown(e,t){this._pointerActionEvent.emit({type:"PointerDown",left:e,top:t})}pointerMove(e,t){this._pointerActionEvent.emit({type:"PointerMove",left:e,top:t})}pointerUp(e,t){this._pointerActionEvent.emit({type:"PointerUp",left:e,top:t})}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(e,t){t=t||{left:0,top:0,width:0,height:0,forward:!0};const{left0:i,top0:r,left1:o,top1:l}=e;return t.width=Math.abs(i-o),t.height=Math.abs(r-l),t.left=Math.min(i,o),t.top=Math.min(r,l),t.forward=o>i,t}static contains(e,t,i){const{left:r,top:o,width:l,height:h}=i;return e>r&&e<=r+l&&t>=o&&t<=o+h}}class du extends Zr{constructor(s){super();const e=this.disposeVar(new Wl(s));this.dispose(e.downEvent.disposableOn((o,l,h)=>h.altKey&&this.pointerDown(o,l))),this.dispose(e.moveEvent.disposableOn((o,l)=>this.pointerMove(o,l))),this.dispose(e.upEvent.disposableOn((o,l)=>this.pointerUp(o,l)));const t=document.createElement("div");t.style.backgroundColor="rgba(0, 0, 0, 0)",t.style.border="2px dashed red",t.style.position="absolute",t.style.boxSizing="border-box",t.style.pointerEvents="none",t.style.height="0px",t.style.width="0px",t.style.left="0px",t.style.top="0px",t.style.display="none",s.appendChild(t),this.dispose(()=>s.removeChild(t)),this.dispose(this.activeEvent.disposableOn(o=>{t.style.display=o?"block":"none"}));const i=()=>{this.reset()};s.addEventListener("contextmenu",i),this.dispose(()=>s.removeEventListener("contextmenu",i));const r={left:0,top:0,width:0,height:0,forward:!1};this.dispose(this.updateRectEvent.disposableOn(o=>{if(Zr.getLeftTopAndSize(o,r)){const{left:l,top:h,width:c,height:u}=r;t.style.height=`${u|0}px`,t.style.width=`${c|0}px`,t.style.left=`${l|0}px`,t.style.top=`${h|0}px`}}))}}class st extends Error{}function Qt(n,s){Ne(n,"_promise_cancel")&&console.warn("setPromiseCancel warn: promise has cancelFunc!"),vt(n,"_promise_cancel",s)}function as(n){return Ne(n,"_promise_cancel")}function ls(n){return!!as(n)}function Qr(n,s){const e=as(n);return e?(e(s),!0):!1}function eo(n){const[s,e]=n;return Qt(e,s),e}function hs(n){let s;const e=new Promise((t,i)=>{s=i,n.then(t).catch(i)});return Qt(e,s),e}function uu(n){let s,e;var t=new Promise((i,r)=>{e=n.disposableOn((...o)=>{e&&e(),i(o)}),s=o=>{e&&e(),r(o)}});return[s,t]}function pu(n){const s=new v,e=new v;return n.then(t=>{s.isDestroyed()||s.emit(t)}).catch(t=>{e.isDestroyed()||e.emit(t)}),[s,e]}class to extends b{constructor(){super();a(this,"_cancelled",!1);a(this,"_cancelError");a(this,"_promiseSet",new Set);a(this,"_disposer")}get disposer(){return this._disposer=this._disposer||new b,this._disposer}destroyImp(){this.finally()}cancel(e){var t;if(!this._cancelled){this._cancelled=!0,(t=this._disposer)==null||t.destroy(),this._cancelError=e;for(let i of this._promiseSet)Qr(i);this._promiseSet.clear()}}get cancelFuncsNum(){return ln(this._promiseSet,e=>e+1,0)}finally(){this._disposer&&!this._disposer.isDestroyed()&&this._disposer.destroy(),this._promiseSet.clear()}check(){if(this._cancelled)throw this._cancelError??new st("cancel from CancelManager!")}promise(e){return this._promiseSet.add(e),e.finally(()=>(this._promiseSet.delete(e),this.check()))}promiseAny(e){const t=[],i=e.map(r=>(this._promiseSet.add(r),ls(r)&&t.push(as(r)),r.finally(()=>this._promiseSet.delete(r))));return Promise.any(i).finally(()=>(t.forEach((r=>r(new st("cancel from promiseAny!")))),t.length=0))}promiseAll(e){const t=[],i=e.map(r=>(this._promiseSet.add(r),ls(r)&&t.push(as(r)),r.finally(()=>this._promiseSet.delete(r))));return Promise.all(i).finally(()=>(t.forEach((r=>r(new st("cancel from promiseAll!")))),t.length=0))}promiseRace(e){const t=[],i=e.map(r=>(this._promiseSet.add(r),ls(r)&&t.push(as(r)),r.finally(()=>this._promiseSet.delete(r))));return Promise.race(i).finally(()=>(t.forEach((r=>r(new st("cancel from promiseRace!")))),t.length=0))}}class fe extends b{constructor(e){super();a(this,"_status","Initial");a(this,"_completeEvent");a(this,"_errorEvent");a(this,"_completeFunc");a(this,"_errorFunc");a(this,"_cancelFunc");a(this,"_runningId",-1);this._startFunc=e,this.dispose(()=>this.isRunning&&this.cancel())}get errorEvent(){return this._errorEvent||(this._errorEvent=new v),this._errorEvent}get completeEvent(){return this._completeEvent||(this._completeEvent=new v),this._completeEvent}get errorFunc(){return this._errorFunc}get completeFunc(){return this._completeFunc}set errorFunc(e){this._errorFunc!==e&&(this._errorFunc=e)}set completeFunc(e){this._completeFunc!==e&&(this._completeFunc=e)}start(...e){if(this._status!=="Initial")return;const t=++this._runningId;this._status="Running",this._cancelFunc=this._startFunc({completeFunc:i=>{var r;t===this._runningId&&this._status==="Running"&&(this._status="Completed",this._completeFunc&&this._completeFunc(i),(r=this._completeEvent)==null||r.emit(i))},errorFunc:i=>{var r;t===this._runningId&&this._status==="Running"&&(this._status="Error",this._errorFunc&&this._errorFunc(i),(r=this._errorEvent)==null||r.emit(i))},runningingID:t},...e)}cancel(e=new st("")){var t;if(this._status==="Running"){if(!this._cancelFunc)throw new Error("!this._cancelFunc");this._status="Error",this._errorFunc&&this._errorFunc(e),(t=this._errorEvent)==null||t.emit(e),this._cancelFunc(e),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(e=new st(""),...t){this.isRunning&&this.cancel(e),this.reset(),this.start(...t)}restartIfNotRunning(...e){this.isRunning||(this.reset(),this.start(...e))}}function cn(n){return(s,...e)=>{const t=new to,{completeFunc:i,errorFunc:r}=s,o=n(t,...e).then(i).catch(r).finally(()=>t.destroy());return Qt(o,t.cancel.bind(t)),l=>Qr(o,l)}}class gu extends fe{constructor(){super(({errorFunc:e},t,i)=>{try{const[r,o]=Nn(t,i);return this._doFunc=r,o}catch(r){return e(r),()=>{}}});a(this,"_doFunc")}do(...e){this._doFunc&&this._doFunc(...e)}}class fu extends fe{constructor(e,t){super(({errorFunc:i})=>{try{const[r,o]=Nn(e,t);return this._doFunc=r,o}catch(r){return i(r),()=>{}}});a(this,"_doFunc")}do(...e){this._doFunc&&this._doFunc(...e)}}function mu(n){return new fe(cn((s,...e)=>s.promise(n(...e))))}function vu(n,...s){return new fe(cn(e=>e.promise(n(...s))))}function Gn(n){return mu((...s)=>{const e=n(...s);return ls(e)?e:hs(e)})}function io(n,...s){return vu(()=>{const e=n(...s);return ls(e)?e:hs(e)})}function _u(n){let s;const e=new Promise((t,i)=>{s=()=>{n(),i()}});return Qt(e,s),e}function yu(n,...s){const e=new to,t=n(e,...s).finally(()=>e.destroy());return Qt(t,e.cancel.bind(e)),t}function Le(n){return new fe(cn(n))}function wu(n,...s){return new fe(cn(e=>n(e,...s)))}function Hl(n,...s){const e=new AbortController;let t=e.signal,[i,r]=s;if(r!=null&&r.signal)throw console.error("init?.signal"),new Error("init?.signal");r=r||{},r.signal&&console.warn("revocableFetch error: init.signal would be override!"),r.signal=t;let o=!1;const l=()=>{o=!0,e.abort()};let h=fetch(i,r);return n&&(h=h.then(c=>{if(!c.ok)return c;if(!c.body)throw Error("ReadableStream not yet supported in this browser.");const u=c.headers.get("content-length");u||console.warn("response.headers.get('content-length') is undefined... cannot get contentLength!");const p=u?parseInt(u,10):0;let g=0;return new Response(new ReadableStream({start(m){if(!c.body)throw new Error("!response.body");const y=c.body.getReader();S();function S(){y.read().then(({done:C,value:T})=>{if(C){m.close();return}if(!T)throw new Error("!value");if(!n)throw new Error("!progressFunc");g+=T.byteLength,n(g,p),m.enqueue(T),S()}).catch(C=>{m.error(C)})}}}),{status:c.status,statusText:c.statusText,headers:c.headers})}).catch(c=>{throw o?(c instanceof Error&&c.code!==20&&console.error("error.code !== 20"),console.log("fetching cancelled!"),new st(`fetching cancelled! error: ${c}`)):(c instanceof Error&&c.code===20&&console.error("error.code === 20"),c)})),Qt(h,l),h}function Eu(n,...s){return Hl(n,...s)}function so(...n){return Hl(void 0,...n)}function bu(){return Gn(so)}function Su(...n){return io(so,...n)}function no(n,...s){let e=-1;var t=new Promise((i,r)=>{n.isRunning&&n.cancel(),n.reset();const o=new b;o.dispose(n.completeEvent.disposableOn(l=>{if(i(l),o.isDestroyed()){debugger;console.error(`disposer is destroyed! ${o}`);return}o.destroy()})),o.dispose(n.errorEvent.disposableOn(l=>{if(r(l),o.isDestroyed()){debugger;console.error(`disposer is destroyed! ${o}`);return}o.destroy()})),n.start(...s),e=n.runningId});return[i=>e===n.runningId&&n.isRunning&&n.cancel(i),t]}function yt(n,s,...e){try{return s(...e)}catch(t){n(t)}}function Cu(){return new fe(({completeFunc:n,errorFunc:s},e)=>rs(()=>yt(s,()=>{e&&e(),n()})))}function Pu(n){return new fe(({completeFunc:s,errorFunc:e})=>rs(()=>yt(e,()=>{n&&n(),s()})))}function Tu(){return new fe(({completeFunc:n,errorFunc:s},e)=>nn(()=>{yt(s,()=>{e&&e(),n()})}))}function Iu(n){return new fe(({completeFunc:s,errorFunc:e})=>nn(()=>{yt(e,()=>{n&&n(),s()})}))}function $l(){return new fe(({completeFunc:n,errorFunc:s},e,t)=>zr(()=>{yt(s,()=>{e&&e(),n()})},t??1e3))}function Gl(n,s){return new fe(({completeFunc:e,errorFunc:t})=>zr(()=>{yt(t,()=>{n&&n(),e()})},s??1e3))}function xu(){return new fe(({errorFunc:n},s,e=1e3)=>Vr(()=>yt(n,s),e))}function Ou(n,s=1e3){return new fe(({errorFunc:e})=>Vr(()=>yt(e,n),s))}function dn(){return new fe(({errorFunc:n},s)=>Ln(e=>yt(n,s,e)))}function cs(n){return new fe(({errorFunc:s})=>Ln(e=>yt(s,n,e)))}function un(n,...s){let e,t;const i=new Promise((o,l)=>{t=l,e=globalThis.setTimeout(()=>{e=void 0,o(s)},n)});return Qt(i,o=>{e&&(clearTimeout(e),e=void 0),t&&t(o??new st("sleep cancel error!"))}),i}function Du(){return Gn(un)}function Fu(n,...s){return io(un,n,...s)}function yi(n,s,...e){return n.promise(eo(no(Le(async(t,...i)=>(n.disposer.dispose(()=>{t.isDestroyed()||t.cancel()}),await s(t,...i))),...e)))}function ku(n,s,...e){return n.promise(eo(no(s,...e)))}class Mu extends fe{constructor(){super(({errorFunc:e},t,i)=>{try{const[r,o]=Gr(t,i);return this._doFunc=r,o}catch(r){return e(r),()=>{}}});a(this,"_doFunc")}do(...e){this._doFunc&&this._doFunc(...e)}}class Au extends fe{constructor(e,t){super(({errorFunc:i})=>{try{const[r,o]=Gr(e,t);return this._doFunc=r,o}catch(r){return i(r),()=>{}}});a(this,"_doFunc")}do(...e){this._doFunc&&this._doFunc(...e)}}class Jn extends b{constructor(e=1e3,t=Un){super();a(this,"_speed");a(this,"_speedChangedEvent");a(this,"_duration");a(this,"_durationChangedEvent");a(this,"_loop");a(this,"startUpdateFunc");a(this,"_updateBindThis");a(this,"_cancelStartUpdateFunc");a(this,"_startTimeStamp");a(this,"_playingChangedEvent");a(this,"_startPlayingEvent");a(this,"_stopPlayingEvent");a(this,"_loopChangedEvent");a(this,"_currentTime",this.disposeVar(w(0)));this._speed=1,this._duration=e,this._loop=!1,this.startUpdateFunc=t,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 v,this._startPlayingEvent}get stopPlayingEvent(){return this._stopPlayingEvent=this._stopPlayingEvent||new v,this._stopPlayingEvent}get currentTimeChangedEvent(){return this._currentTime.changed}get loopChangedEvent(){return this._loopChangedEvent=this._loopChangedEvent||new v,this._loopChangedEvent}set loop(e){this._loop!==e&&(this._loop=e,this._loopChangedEvent&&this._loopChangedEvent.emit(this._loop))}get loop(){return this._loop}_update(e){if(Number.isNaN(this._startTimeStamp))console.warn("Number.isNaN(this._startTimeStamp)");else{const t=(e-this._startTimeStamp)*this._speed;this._setCurrentTimeInner(t)}}get currentTime(){return this._currentTime.value}set currentTime(e){this._setCurrentTimeInner(e),this._resetStartTime()}_setCurrentTimeInner(e){this._currentTime.value!==e&&(this._duration<=0?this._currentTime.value=0:e<0?this.loop?this._currentTime.value=this._duration+e%this._duration:(this._currentTime.value=0,this.playing&&this._stopPlaying()):e>this._duration?this.loop?this._currentTime.value=e%this._duration:(this._currentTime.value=this._duration,this.playing&&this._stopPlaying()):this._currentTime.value=e)}get durationChangedEvent(){return this._durationChangedEvent||(this._durationChangedEvent=new v),this._durationChangedEvent}get duration(){return this._duration}set duration(e){var t;if(e<0)console.warn("duration sholud greater than 0!");else if(this._duration!==e){const i=this._duration;this._duration=e,this._currentTime.value>this._duration&&(this._currentTime.value=this._duration),(t=this._durationChangedEvent)==null||t.emit(this._duration,i)}}get speedChangedEvent(){return this._speedChangedEvent||(this._speedChangedEvent=new v),this._speedChangedEvent}get speed(){return this._speed}set speed(e){var t;if(this._speed!==e&&e!==0){const i=this._speed;this._speed=e,this._resetStartTime(),(t=this._speedChangedEvent)==null||t.emit(this._speed,i)}}_resetStartTime(){this._startTimeStamp=performance.now()-this._currentTime.value/this._speed}_startPlaying(){var e,t;this._resetStartTime(),this._cancelStartUpdateFunc=this.startUpdateFunc(this._updateBindThis),(e=this._startPlayingEvent)==null||e.emit(this._currentTime.value),(t=this._playingChangedEvent)==null||t.emit(!0)}_stopPlaying(){var e,t;if(!this._cancelStartUpdateFunc)throw new Error("this._cancelStartUpdateFunc is undefined!");this._cancelStartUpdateFunc(),this._cancelStartUpdateFunc=void 0,(e=this._stopPlayingEvent)==null||e.emit(this._currentTime.value),(t=this._playingChangedEvent)==null||t.emit(!1)}get playingChangedEvent(){return this._playingChangedEvent||(this._playingChangedEvent=new v),this._playingChangedEvent}get playing(){return!!this._cancelStartUpdateFunc}set playing(e){!!this._cancelStartUpdateFunc!==e&&(e?this._startPlaying():this._stopPlaying())}}class pn extends b{constructor(e){super();a(this,"_stop",this.disposeVar(w(0)));a(this,"_current",this.disposeVar(w(0)));a(this,"_start",this.disposeVar(w(0)));a(this,"_player",this.disposeVar(new Jn(200)));this.dispose(this._player.currentTimeChangedEvent.disposableOn(t=>{let i=t/this._player.duration;i=i>1?1:i<0?0:i;const r=this._start.value,o=this._stop.value;this._current.value=r+(o-r)*i})),this.duration=e}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(e){this._player.duration=e}set target(e){this._start.value=this._current.value,this._stop.value=e,this._player.currentTime=0,this._player.playing=!0}reset(e){this._start.value=e,this._current.value=e,this._stop.value=e,this._player.playing=!1}}let Jl=-1;class se extends v{constructor(s,e,t,i){super(),this._domElement=s,this._type=e,this.callback=i;const r=o=>(o.__xbsj_listenerNo__=++Jl,o.__xbsj_listenerTime__=Date.now(),o.__xbsj_lastCurrentTarget__=o.currentTarget,this.emit(o),this.callback&&this.callback(o));this._domElement.addEventListener(this._type,r,t),this.dispose(()=>this._domElement.removeEventListener(this._type,r,t))}static getLastLisenNo(){return Jl}static getCurrentTarget(s){return s.__xbsj_lastCurrentTarget__}static getListenerNo(s){return s.__xbsj_listenerNo__}static getListenerTime(s){return s.__xbsj_listenerTime__}static on(s,e){const t=se.getLastLisenNo();return s.disposableOn(i=>{const r=se.getListenerNo(i);(r===void 0||r>t)&&e(i)})}get element(){return this._domElement}static create(s,e,t){return new se(s,e,t)}}class ro extends b{constructor(){super();a(this,"_clickEvent",this.disposeVar(new v));a(this,"_dbclickEvent",this.disposeVar(new v));a(this,"_pointerdownEvent",this.disposeVar(new v));a(this,"_pointerupEvent",this.disposeVar(new v));a(this,"_pointermoveEvent",this.disposeVar(new v));a(this,"_pointeroutEvent",this.disposeVar(new v));a(this,"dbClickDelayTime",300);a(this,"nativeClickDelayTime",500);a(this,"clickMovementTolerantPixelSize",3);a(this,"debugging",!1);a(this,"_enabled",this.disposeVar(w(!0)));const e=this.disposeVar(Le(async i=>{do{const r=await yi(i,h=>new Promise((c,u)=>{h.disposer.dispose(u),h.disposer.dispose(se.on(this._pointerdownEvent,c))})),o=we(r);if(this.debugging&&console.log(`鼠标按下 ${o.toString()}`),!await yi(i,h=>new Promise((c,u)=>{h.disposer.dispose(u);const p=setTimeout(()=>c(!0),this.nativeClickDelayTime);h.disposer.dispose(()=>clearTimeout(p)),h.disposer.dispose(se.on(this._pointermoveEvent,g=>{const[m,y]=we(g),[S,C]=o;(Math.abs(m-S)>3||Math.abs(y-C)>3)&&c(!1)})),h.disposer.dispose(se.on(this._pointeroutEvent,()=>c(!1))),h.disposer.dispose(se.on(this._pointerupEvent,()=>c(!0)))}))){this.debugging&&console.log("取消1");continue}const l=await yi(i,h=>new Promise((c,u)=>{h.disposer.dispose(u);const p=setTimeout(()=>c("timeout"),this.dbClickDelayTime);h.disposer.dispose(()=>clearTimeout(p)),h.disposer.dispose(se.on(this._pointermoveEvent,g=>{const[m,y]=we(g),[S,C]=o;(Math.abs(m-S)>3||Math.abs(y-C)>3)&&c("moved")})),h.disposer.dispose(se.on(this._pointerdownEvent,c)),h.disposer.dispose(se.on(this._pointeroutEvent,()=>c("pointouted"))),h.disposer.dispose(se.on(this._pointerupEvent,()=>c("pointuped")))}));if(typeof l=="string"){this.debugging&&console.log(`触发单击事件!取消双击监听!error: ${l}`),this._clickEvent.emit(r);continue}if(!await yi(i,h=>new Promise((c,u)=>{h.disposer.dispose(u);const p=setTimeout(()=>c(!1),this.nativeClickDelayTime);h.disposer.dispose(()=>clearTimeout(p)),h.disposer.dispose(se.on(this._pointermoveEvent,g=>{const[m,y]=we(g),[S,C]=o;(Math.abs(m-S)>3||Math.abs(y-C)>3)&&c(!1)})),h.disposer.dispose(se.on(this._pointeroutEvent,()=>c(!1))),h.disposer.dispose(se.on(this._pointerupEvent,()=>c(!0)))}))){this.debugging&&console.log("取消2");continue}this.debugging&&console.log("触发双击事件!"),this._dbclickEvent.emit(l)}while(!0)})),t=i=>{i?e.restart():e.isRunning&&e.cancel()};t(this.enabled),this.dispose(this.enabledChanged.disposableOn(t))}get clickEvent(){return this._clickEvent}get dbclickEvent(){return this._dbclickEvent}pointerDown(e){this._pointerdownEvent.emit(e)}pointerUp(e){this._pointerupEvent.emit(e)}pointerMove(e){this._pointermoveEvent.emit(e)}pointerOut(e){this._pointeroutEvent.emit(e)}get enabled(){return this._enabled.value}set enabled(e){this._enabled.value=e}get enabledChanged(){return this._enabled.changed}}class ju extends b{constructor(e,t){super();a(this,"_pointerClick",this.disposeVar(new ro));this._div=e;const{div:i,pointerClick:r}=this,o=u=>r.pointerDown(u),l=u=>r.pointerMove(u),h=u=>r.pointerOut(u),c=u=>r.pointerUp(u);i.addEventListener("pointerdown",o,t),i.addEventListener("pointermove",l,t),i.addEventListener("pointerout",h,t),i.addEventListener("pointerup",c,t),this.dispose(()=>{i.removeEventListener("pointerdown",o,t),i.removeEventListener("pointermove",l,t),i.removeEventListener("pointerout",h,t),i.removeEventListener("pointerup",c,t)})}get div(){return this._div}get pointerClick(){return this._pointerClick}get clickEvent(){return this.pointerClick.clickEvent}get dbclickEvent(){return this.pointerClick.dbclickEvent}}class ql extends b{constructor(){super();a(this,"_hoverEvent",this.disposeVar(new v));a(this,"_hoverOutEvent",this.disposeVar(new v));a(this,"_pointerdownEvent",this.disposeVar(new v));a(this,"_pointerupEvent",this.disposeVar(new v));a(this,"_pointermoveEvent",this.disposeVar(new v));a(this,"_pointeroutEvent",this.disposeVar(new v));a(this,"delayTime",800);const e=this.disposeVar($l()),t=c=>{this._hoverOutEvent.emit()},i=c=>{this._hoverOutEvent.emit()};let r;const o=()=>{if(!r){console.warn("!lastPointerEvent");return}this._hoverEvent.emit(r)},l=c=>{r=c,e.restart(void 0,o,this.delayTime),this._hoverOutEvent.emit()},h=c=>{e.cancel(),this._hoverOutEvent.emit()};this.dispose(this._pointerdownEvent.disposableOn(t)),this.dispose(this._pointerupEvent.disposableOn(i)),this.dispose(this._pointermoveEvent.disposableOn(l)),this.dispose(this._pointeroutEvent.disposableOn(h))}get hoverEvent(){return this._hoverEvent}get hoverOutEvent(){return this._hoverOutEvent}pointerDown(e){this._pointerdownEvent.emit(e)}pointerUp(e){this._pointerupEvent.emit(e)}pointerMove(e){this._pointermoveEvent.emit(e)}pointerOut(e){this._pointeroutEvent.emit(e)}}class Ru extends b{constructor(e,t=1500){super();a(this,"_hoverEvent",new v);a(this,"_hoverOutEvent",new v);const i=new Xr(t);this.dispose(()=>i.destroy());let r=0,o=0,l;i.progressFunc=()=>this._hoverEvent.emit(r,o,l);const h=g=>{!i.isRunning&&i.restart(),l=g,[r,o]=we(g),i.debounce(),this._hoverOutEvent.emit()},c=g=>{!i.isRunning&&i.restart(),l=g,[r,o]=we(l),i.debounce(),this._hoverOutEvent.emit()},u=g=>{!i.isRunning&&i.restart(),l=g,[r,o]=we(l),i.debounce(),this._hoverOutEvent.emit()},p=g=>{i.isRunning&&i.cancel(),this._hoverOutEvent.emit()};e.addEventListener("pointerdown",h),e.addEventListener("pointerup",c),e.addEventListener("pointermove",u),e.addEventListener("pointerout",p),this.dispose(()=>{e.removeEventListener("pointerdown",h),e.removeEventListener("pointerup",c),e.removeEventListener("pointermove",u),e.removeEventListener("pointerout",p)})}get hoverEvent(){return this._hoverEvent}get hoverOutEvent(){return this._hoverOutEvent}}class Xl extends b{constructor(e,t={}){super();a(this,"_needRedrawEvent");a(this,"_needPickRedrawEvent");a(this,"_id",ns());a(this,"_clickEvent");a(this,"_clickOutEvent");a(this,"_dbclickEvent");a(this,"_dbclickOutEvent");a(this,"_actived",!1);a(this,"_activedChanged");a(this,"_hovered",!1);a(this,"_hoveredChanged");a(this,"_selected",!1);a(this,"_selectedChanged");a(this,"_opacity",1);a(this,"_opacityChanged");a(this,"_show",!0);a(this,"_showChanged");this._canvasPrimitivesContext=e;const{needRedraw:i=!0,needPickRedraw:r=!0}=t;i&&(this._needRedrawEvent=new v),r&&(this._needPickRedrawEvent=new v),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(e){this._id=e}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 v,this._clickEvent}hasClickOutEvent(){return!!this._clickOutEvent}get clickOutEvent(){return this._clickOutEvent=this._clickOutEvent||new v,this._clickOutEvent}hasDbclickEvent(){return!!this._dbclickEvent}get dbclickEvent(){return this._dbclickEvent=this._dbclickEvent||new v,this._dbclickEvent}hasDbclickOutEvent(){return!!this._dbclickOutEvent}get dbclickOutEvent(){return this._dbclickOutEvent=this._dbclickOutEvent||new v,this._dbclickOutEvent}set actived(e){this._actived!==e&&(this._actived=e,this._activedChanged&&this._activedChanged.emit(e,this))}get actived(){return this._actived}get activedChanged(){return this._activedChanged=this._activedChanged||new v,this._activedChanged}set hovered(e){this._hovered!==e&&(this._hovered=e,this._hoveredChanged&&this._hoveredChanged.emit(e,this))}get hovered(){return this._hovered}get hoveredChanged(){return this._hoveredChanged=this._hoveredChanged||new v,this._hoveredChanged}set selected(e){this._selected!==e&&(this._selected=e,this._selectedChanged&&this._selectedChanged.emit(e,this))}get selected(){return this._selected}get selectedChanged(){return this._selectedChanged=this._selectedChanged||new v,this._selectedChanged}set opacity(e){this._opacity!==e&&(this._opacity=e,this._opacityChanged&&this._opacityChanged.emit(e,this))}get opacity(){return this._opacity}get opacityChanged(){return this._opacityChanged=this._opacityChanged||new v,this._opacityChanged}set show(e){this._show!==e&&(this._show=e,this._showChanged&&this._showChanged.emit(e,this))}get show(){return this._show}get showChanged(){return this._showChanged=this._showChanged||new v,this._showChanged}}class oo extends Xl{constructor(e,t=[0,0],i=0){super(e);a(this,"_winPosAndDepthChanged");this._winPos=t,this._depth=i,this.dispose(this.winPosAndDepthChanged.disposableOn(()=>{this.needRedraw(),this.needPickRedraw()}))}set winPos(e){(this._winPos[0]!==e[0]||this._winPos[1]!==e[1])&&(this._winPos[0]=e[0],this._winPos[1]=e[1],this._winPosAndDepthChanged&&this._winPosAndDepthChanged.emit(this._winPos,this._depth))}get winPos(){return this._winPos}set depth(e){this._depth!==e&&(this._depth=e,this._winPosAndDepthChanged&&this._winPosAndDepthChanged.emit(this._winPos,this._depth))}get depth(){return this._depth}get winPosAndDepthChanged(){return this._winPosAndDepthChanged||(this._winPosAndDepthChanged=new v),this._winPosAndDepthChanged}}function wi(n,s,e,t){const[i,r]=n,[o,l,h,c]=t,u=s[0]*e[0],p=s[1]*e[1],g=i-(u*o+h),m=r-(p*l+c);return{left:g,top:m,right:g+u,bottom:m+p}}function Ei(n,s,e,t,i){n.beginPath(),n.moveTo(s,e),n.lineTo(s-t*.5,e-t*.5),n.arc(s,e-t,t*.7071067811865475,Math.PI*.75,Math.PI*.25),n.lineTo(s,e),n.fillStyle=i,n.fill()}function Nu(n,s,e,t,i,r){if(n.beginPath(),n.moveTo(s+t,e),n.arc(s,e,t,0,2*Math.PI),r){const o=n.createRadialGradient(s,e,0,s,e,t);o.addColorStop(0,i),o.addColorStop(1,i.replace(/[\d\.]+\)$/,"0)")),n.fillStyle=o}else n.fillStyle=i;n.fill()}function Yl(n,s,e,t,i,r){n.beginPath(),n.moveTo(s+r,e),n.lineTo(s+t-r,e),n.arcTo(s+t,e,s+t,e+r,r),n.lineTo(s+t,e+i-r),n.arcTo(s+t,e+i,s+t-r,e+i,r),n.lineTo(s+r,e+i),n.arcTo(s,e+i,s,e+i-r,r),n.lineTo(s,e+r),n.arcTo(s,e,s+r,e,r)}function Kl(n,s,e,t,i,r){n.font=i;const o=n.measureText(t),l=o.actualBoundingBoxLeft+o.actualBoundingBoxRight,h=Number.isFinite(o.fontBoundingBoxAscent)?o.fontBoundingBoxAscent:o.actualBoundingBoxAscent,c=Number.isFinite(o.fontBoundingBoxDescent)?o.fontBoundingBoxDescent:o.actualBoundingBoxDescent;let u=h+c;n.fillStyle=r,n.fillText(t,s-l*.5,e+u*.5-c)}function Zl(n){const{width:s,height:e}=n,t=s instanceof SVGAnimatedLength?s.baseVal.SVG_LENGTHTYPE_PX:s,i=e instanceof SVGAnimatedLength?e.baseVal.SVG_LENGTHTYPE_PX:e,r=document.createElement("canvas");r.width=t,r.height=i;const o=r.getContext("2d");if(!o)throw new Error("!cavnasCtx");return o.drawImage(n,0,0,t,i),r}function Ql(n,s){const{width:e,height:t}=n,i=n.getContext("2d");if(!i)throw new Error("!cavnasCtx");const[r,o,l]=s.map(p=>p*255|0),h=i.getImageData(0,0,e,t),c=h.data;for(var u=0;u<c.length;u+=4)c[u]=r,c[u+1]=o,c[u+2]=l;i.putImageData(h,0,0)}function ao(n,s,e,t=[.5,1,0,0],i,r="12px Arial",o=2,l="#FFF",h="#000A"){n.font=r;const c=n.measureText(i),u=c.actualBoundingBoxLeft+c.actualBoundingBoxRight,p=c.fontBoundingBoxAscent+c.fontBoundingBoxDescent,g=s,m=e,y=u+o*2,S=p+o*2,{left:C,top:T,bottom:V}=wi([g,m],[y,S],[1,1],t);n.fillStyle=h,Yl(n,C,T,y,S,o),n.fill(),n.fillStyle=l,n.fillText(i,C+o,V-o-c.fontBoundingBoxDescent)}function gn(n){return("00"+n.toString(16).toUpperCase()).substr(-2)}function fn(n){const[s,e,t,i]=n.map(r=>r*255|0);return`#${gn(s)}${gn(e)}${gn(t)}${gn(i)}`}function lo(n,s){const[e,t,i]=s,r=`${e}-${t}-${i}`;let o=Ne(n,r);return o||(o=Zl(n),Ql(o,s),vt(n,r,o)),o}class Lu extends oo{constructor(e,t,i=[32,32],r=[.5,1,0,0],o="#F00F"){super(e);a(this,"_tooltip","");a(this,"_title","");a(this,"__scale",[1,1]);a(this,"_tooltipAlpha",0);a(this,"_bgColor",[.3,.3,.3,.8]);a(this,"_bgColorHexStr",fn(this._bgColor));a(this,"_fgColor",[1,1,1,1]);a(this,"_fgColorHexStr",fn(this._fgColor));this._image=t,this._size=i,this._originRatioAndOffset=r,this._defaultColorStr=o;const l=new pn(100),h=new pn(100);this.dispose(()=>{l.destroy(),h.destroy()});const c=()=>{if(this._clickEvent&&!this._clickEvent.empty){const u=(1+.08*h.current)*(1+.08*l.current);this._scale=[u,u],this._tooltipAlpha=l.current}};this.dispose(this.activedChanged.disposableOn(u=>{h.target=u?1:0,this.needRedraw()})),this.dispose(this.hoveredChanged.disposableOn(u=>{l.target=u?1:0,this.needRedraw()})),this.dispose(this.selectedChanged.disposableOn(()=>{this.needRedraw()})),this.dispose(h.currentChanged.disposableOn(c)),this.dispose(l.currentChanged.disposableOn(c))}set size(e){const[t,i]=e,[r,o]=this._size;(r!==t||o!==i)&&(this._size[0]=t,this._size[1]=i,this.needRedraw(),this.needPickRedraw())}get size(){return this._size}set _scale(e){const[t,i]=e,[r,o]=this.__scale;(r!==t||o!==i)&&(this.__scale[0]=t,this.__scale[1]=i,this.needRedraw(),this.needPickRedraw())}get _scale(){return this.__scale}set fgColor(e){if(!this._fgColor.every((t,i)=>e[i]===t)){const[t,i,r,o]=e;this._fgColor.splice(0,4,t,i,r,o),this._fgColorHexStr=fn(this._fgColor),this.needRedraw()}}get fgColor(){return this._fgColor}set bgColor(e){if(!this._bgColor.every((t,i)=>e[i]===t)){const[t,i,r,o]=e;this._bgColor.splice(0,4,t,i,r,o),this._bgColorHexStr=fn(this._bgColor),this.needRedraw()}}get bgColor(){return this._bgColor}set originRatioAndOffset(e){const[t,i,r,o]=this._originRatioAndOffset,[l,h,c,u]=e;(t!==l||i!==h||r!==c||o!==u)&&(this._originRatioAndOffset.splice(0,4,l,h,c,u),this.needRedraw(),this.needPickRedraw())}get originRatioAndOffset(){return this._originRatioAndOffset}set image(e){this._image!==e&&(this._image=e,this.needRedraw())}get image(){return this._image}set defaultColorStr(e){this._defaultColorStr!==e&&(this._defaultColorStr=e,this.needRedraw())}get defaultColorStr(){return this._defaultColorStr}set tooltip(e){this._tooltip!==e&&(this._tooltip=e,this.needRedraw())}get tooltip(){return this._tooltip}set title(e){this._title!==e&&(this._title=e,this.needRedraw())}get title(){return this._title}draw(e){if(!this._show)return;const[t,i]=this._winPos,r=this._size[0]*this.__scale[0],o=this._size[1]*this.__scale[1],{left:l,top:h}=wi([t,i],this._size,this.__scale,this._originRatioAndOffset),c=e.globalAlpha;if(e.globalAlpha=this.opacity,this._image){if(this.selected){const u=lo(this._image,[1,0,0]),{left:p,top:g}=wi([t,i+3],[r+6,o+6],[1,1],this._originRatioAndOffset);e.drawImage(u,p,g,r+6,o+6)}if(this.actived){const[u,p,g,m]=this._fgColor,y=lo(this._image,[u,p,g]),{left:S,top:C}=wi([t,i+4],[r+8,o+8],[1,1],this._originRatioAndOffset);e.drawImage(y,S,C,r+8,o+8)}if(this.hovered){const[u,p,g,m]=this._bgColor,y=lo(this._image,[u,p,g]),{left:S,top:C}=wi([t,i+2],[r+4,o+4],[1,1],this._originRatioAndOffset);e.drawImage(y,S,C,r+4,o+4)}e.drawImage(this._image,l,h,r,o)}else e.fillStyle=this._fgColorHexStr,e.fillRect(l,h,r,o);if(this._title!==""&&ao(e,t+20,i-16,[0,.5,0,0],this._title,"14px Arial",4,this._fgColorHexStr,this._bgColorHexStr),e.globalAlpha=c,this._hovered&&this._tooltip!==""){const u=e.globalAlpha;e.globalAlpha=this._tooltipAlpha,ao(e,t,i-42,[.5,1,0,0],this._tooltip,"12px Arial",4,this._fgColorHexStr,this._bgColorHexStr),e.globalAlpha=u}}drawForPick(e,t){if(!this._show)return;const[i,r]=this._winPos,o=t("default"),l=this._size[0]*this.__scale[0],h=this._size[1]*this.__scale[1],{left:c,top:u}=wi([i,r],this._size,this.__scale,this._originRatioAndOffset);e.fillStyle=o,e.fillRect(c,u,l,h)}}class Vu extends oo{constructor(e){super(e);a(this,"_width",16);a(this,"_text","");a(this,"_fillStyle","#0F0");a(this,"_scale",1);a(this,"_scaleChanged");this.dispose(this.scaleChanged.disposableOn(o=>{this.needRedraw(),this.needPickRedraw()}));const t=this.disposeVar(new pn(100)),i=this.disposeVar(new pn(100)),r=()=>{this._clickEvent&&!this._clickEvent.empty&&(this.scale=(1+.1*i.current)*(1+.2*t.current))};this.dispose(i.currentChanged.disposableOn(r)),this.dispose(t.currentChanged.disposableOn(r)),this.dispose(this.activedChanged.disposableOn(o=>{i.target=o?1:0,this.needRedraw()})),this.dispose(this.hoveredChanged.disposableOn(o=>{t.target=o?1:0,this.needRedraw()})),this.dispose(this.selectedChanged.disposableOn(o=>{this.needRedraw()}))}set scale(e){this._scale!==e&&(this._scale=e,this._scaleChanged&&this._scaleChanged.emit(e,this))}get scale(){return this._scale}get scaleChanged(){return this._scaleChanged||(this._scaleChanged=new v),this._scaleChanged}set width(e){this._width!==e&&(this._width=e,this.needRedraw(),this.needPickRedraw())}get width(){return this._width}set text(e){this._text!==e&&(this._text=e,this.needRedraw())}get text(){return this._text}set fillStyle(e){this._fillStyle!==e&&(this._fillStyle=e,this.needRedraw())}get fillStyle(){return this._fillStyle}draw(e){if(!this._show)return;const[t,i]=this._winPos,r=e.globalAlpha;e.globalAlpha=this.opacity;const o=this._width*this._scale;this.selected&&Ei(e,t,i+3,o+3,"#F00"),this.actived&&this._clickEvent&&!this._clickEvent.empty&&Ei(e,t,i+5,o+5,"#FFF"),this.hovered?Ei(e,t,i+3,o+3,"#000A"):Ei(e,t,i+1,o+1,"#000A"),Ei(e,t,i,o,this._fillStyle);const l=this._scale>1.2?"bold 14px Arial":"bold 10px Arial";Kl(e,t,i-o,this._text,l,"#000"),e.globalAlpha=r}drawForPick(e,t){if(!this._show)return;const[i,r]=this._winPos,o=this._width*this._scale,l=t("default");Ei(e,i,r,o,l)}}const eh=new ArrayBuffer(4),th=new Uint32Array(eh),bi=new Uint8Array(eh);function ih(n){if(n>=16777215)throw new Error("uint32 > 0xFFFFFF");return th[0]=n,[bi[0],bi[1],bi[2]]}function sh(n,s,e){return bi[0]=n,bi[1]=s,bi[2]=e,bi[3]=0,th[0]}class nh extends b{constructor(){super(...arguments);a(this,"_pickColors",new Array(16777215));a(this,"_pickColorIndex",0)}reset(){for(let e=0;e<this._pickColorIndex;++e){const t=this._pickColors[e];if(!t)throw console.error("this._pickColors[i] should not be undefined!"),new Error("this._pickColors[i] should not be undefined!");t.poi=null,t.tag=""}this._pickColorIndex=0}createPickColor(e,t){const i=this._pickColorIndex;++this._pickColorIndex;const r=this._pickColors[i];r?(r.poi=e,r.tag=t):this._pickColors[i]={poi:e,tag:t};const[o,l,h]=ih(i);return[o,l,h]}getPickInfoFromColor(e,t,i){const r=sh(e,t,i);if(r>=this._pickColorIndex){console.error("index >= this._pickColorIndex");return}const o=this._pickColors[r];if(!o){console.error("!this._pickColors[index]");return}return o}destroyImp(){this.reset()}}const rh=(n,s)=>s.depth-n.depth;class zu extends b{constructor(){super();a(this,"_pois",[]);a(this,"_canvasElement");a(this,"_ctx");a(this,"_offscreenCanvasElement");a(this,"_offscreenCanvasElement2");a(this,"_offscreenCtx");a(this,"_offscreenCtx2");a(this,"_size",[0,0]);a(this,"_needRedraw",!1);a(this,"_needPickRedraw",!1);a(this,"_pickColorManager",new nh);const e=document.createElement("canvas");e.style.width="100%",e.style.height="100%",this._canvasElement=e;const t=e.getContext("2d");if(t===null)throw new Error("cannot get context 2d!");this._ctx=t,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(cs(()=>{const[r,o]=this._size,{clientWidth:l,clientHeight:h}=this._canvasElement;(r!==l||o!==h)&&(this._size[0]=l,this._size[1]=h,this._canvasElement.width=l,this._canvasElement.height=h,this._offscreenCanvasElement.width=l,this._offscreenCanvasElement.height=h,this._offscreenCanvasElement2.width=l,this._offscreenCanvasElement2.height=h,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(e){if(typeof Ne(e,"listenHandler")<"u"){console.error("可能有poi重复加载poiManager中!");return}if(this._pois.indexOf(e)!==-1){console.error("同一个poi加了多次!");return}this._pois.push(e),this._dirty();const t=e._needRedrawEvent;if(t){const r=t.on(()=>{this._needRedraw=!0});vt(e,"needRedrawEventHandler",r)}const i=e._needPickRedrawEvent;if(i){const r=i.on(()=>{this._needPickRedraw=!0});vt(e,"needPickRedrawEventHandler",r)}}removePoi(e){const t=this._pois.indexOf(e);if(t===-1){console.error("删除一个不存在的poi!");return}this._pois.splice(t,1),this._dirty();const i=e._needRedrawEvent;if(i){const o=Ne(e,"needRedrawEventHandler");o?i.off(o):console.error("poi没有listenHandler!")}const r=e._needPickRedrawEvent;if(r){const o=Ne(e,"needPickRedrawEventHandler");o?r.off(o):console.error("poi没有listenHandler!")}}_draw(){this._pois.sort(rh);const[e,t]=this._size;this._ctx.clearRect(0,0,e,t),this._pois.forEach(i=>i.draw(this._ctx))}pick(e,t,i,r){return this._needPickRedraw&&(this._needPickRedraw=!1,this._pickDraw()),this._getPickInfo(e,t,i,r)}_pickDraw(){this._pickColorManager.reset(),this._pois.sort(rh);const[e,t]=this._size;this._offscreenCtx.clearRect(0,0,e,t),this._pois.forEach(i=>{const r=o=>{const[l,h,c]=this._pickColorManager.createPickColor(i,o);return`rgb(${l}, ${h}, ${c})`};i.drawForPick(this._offscreenCtx,r)})}_getPickInfo(e,t,i,r){const o=this._offscreenCtx.getImageData(e,t,i,r),l=[],h=o.data.length/4;for(let c=0;c<h;++c){const u=o.data[c*4+0],p=o.data[c*4+1],g=o.data[c*4+2];if(o.data[c*4+3]===255){const y=this._pickColorManager.getPickInfoFromColor(u,p,g);if(y&&y.poi&&!l.includes(y)){let S=!0;{const[C,T]=this._size;this._offscreenCtx2.clearRect(0,0,C,T);const V=Q=>"rgb(255, 255, 255)";y.poi.drawForPick(this._offscreenCtx2,V);const z=this._offscreenCtx2.getImageData(e,t,i,r),x=z.data[c*4+0],$=z.data[c*4+1],Y=z.data[c*4+2];z.data[c*4+3],x===255&&$===255&&Y===255||(S=!1)}S&&l.push(y)}}}return l}}class ho extends b{constructor(){super(...arguments);a(this,"_closeEvent");a(this,"_show",!0);a(this,"_showChanged");a(this,"_opacity",1);a(this,"_opacityChanged");a(this,"_winPos",[0,0]);a(this,"_winPosChanged")}set winPos(e){const[t,i]=e,[r,o]=this._winPos;(t!==r||i!==o)&&(this._winPos[0]=t,this._winPos[1]=i,this._winPosChanged&&this._winPosChanged.emit(this._winPos))}get winPos(){return this._winPos}get winPosChanged(){return this._winPosChanged=this._winPosChanged||new v,this._winPosChanged}set opacity(e){this._opacity!==e&&(this._opacity=e,this._opacityChanged&&this._opacityChanged.emit(this._opacity))}get opacity(){return this._opacity}get opacityChanged(){return this._opacityChanged=this._opacityChanged||new v,this._opacityChanged}set show(e){this._show!==e&&(this._show=e,this._showChanged&&this._showChanged.emit(this._show))}get show(){return this._show}get showChanged(){return this._showChanged=this._showChanged||new v,this._showChanged}get closeEvent(){return this._closeEvent||(this._closeEvent=new v),this._closeEvent}}const co=new WeakMap;function uo(n){if(!co.has(n)){const s=new An(()=>new n,e=>e.reset());co.set(n,s)}return co.get(n)}class po extends ho{constructor(){super();a(this,"_div");a(this,"_contentDiv");a(this,"_originOffsetX",0);a(this,"_originOffsetY",0);a(this,"_originRatioX",.5);a(this,"_originRatioY",1);a(this,"_divChanged",new v);const e=document.createElement("div");e.style.cssText="width: 0px; height: 0px; position: absolute; opacity: 1.0; visibility: visible;";const t=document.createElement("div");t.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 i=document.createElement("div");this._contentDiv=i,t.appendChild(i),e.appendChild(t),this._div=e,this.dispose(this._divChanged.disposableOn(()=>{t.style.left=`${-this._originOffsetX}px`,t.style.top=`${-this._originOffsetY}px`,t.style.transform=`translateX(-${100*this._originRatioX}%) translateY(-${100*this._originRatioY}%)`})),this.dispose(this.winPosChanged.disposableOn(([r,o])=>{this._div.style.left=`${r}px`,this._div.style.top=`${o}px`})),this.dispose(this.opacityChanged.disposableOn(r=>{this._div.style.opacity=`${r}`})),this.dispose(this.showChanged.disposableOn(r=>{this._div.style.visibility=r?"visible":"hidden"}))}get contentDiv(){return this._contentDiv}reset(){}get originOffsetX(){return this._originOffsetX}set originOffsetX(e){this._originOffsetX!==e&&(this._originOffsetX=e,this._divChanged.emit())}get originOffsetY(){return this._originOffsetY}set originOffsetY(e){this._originOffsetY!==e&&(this._originOffsetY=e,this._divChanged.emit())}get originRatioX(){return this._originRatioX}set originRatioX(e){this._originRatioX!==e&&(this._originRatioX=e,this._divChanged.emit())}get originRatioY(){return this._originRatioY}set originRatioY(e){this._originRatioY!==e&&(this._originRatioY=e,this._divChanged.emit())}get element(){return this._div}}class oh extends b{constructor(e,t){super();a(this,"_floatDiv");a(this,"_show",!1);a(this,"_showChanged");this._customDivClass=e,this._divContainer=t,this.dispose(()=>{this.show=!1})}_updateDivPoi(){if(this._show){const{floatDiv:t}=this;t.element.parentElement||this._divContainer.appendChild(t.element)}else{const{_floatDiv:t}=this;t&&t.element.parentElement&&this._divContainer.removeChild(t.element)}}set show(e){this._show!==e&&(this._show=e,this._updateDivPoi(),this._showChanged&&this._showChanged.emit(e))}get show(){return this._show}get floatDiv(){if(!this._floatDiv){const e=uo(this._customDivClass).create();this.dispose(()=>{uo(this._customDivClass).destroy(e)}),this._floatDiv=e}return this._floatDiv}get showChanged(){return this._showChanged||(this._showChanged=new v),this._showChanged}}const Uu=["top","bottom","left","right"];function Bu(n){return Object.entries(n).map(([s,e])=>Uu.includes(s)?`${s}: ${e}px; `:"").join("")}function ah(n,s,e){const t=document.createElement("div");t.style.cssText=`position: absolute; ${Bu(e)} background-color: ${n}; border-radius: ${s}px;`;const i='<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 t.innerHTML=i,t}function lh(n,s,e="rgba(0,0,0,0.7)"){const t=document.createElement("div");t.style.cssText=`margin: 0 auto; width: ${n}px; height: ${s}px; position: relative; pointer-events: none;`;const i=document.createElement("div");return i.style.cssText=`position: absolute; left: 0px; top: 0px; width: 0; height: 0; border-left: ${n*.5}px solid transparent; border-right: ${n*.5}px solid transparent; border-top: ${s}px solid ${e};`,t.appendChild(i),[t,i]}class hh extends po{constructor(){super();a(this,"_borderDiv");a(this,"_closeDiv");a(this,"_innerContentDiv");a(this,"_colorStr","rgba(0, 0, 0, 0.7)");a(this,"_divColorChanged",new v);a(this,"_borderRadius",10);const e=document.createElement("div");e.style.cssText=`position: relative; background-color: ${this._colorStr}; border-radius: ${this._borderRadius}px; padding: 5px; pointer-events: all;`,this._borderDiv=e;const t=ah(this._colorStr,10,{top:3,right:3}),[i,r]=lh(2*this._borderRadius,2*this._borderRadius,this._colorStr),o=document.createElement("div");this._innerContentDiv=o,e.appendChild(o),e.appendChild(t),this.contentDiv.appendChild(e),this.contentDiv.appendChild(i),t.style.opacity="0.1",t.onmouseenter=()=>{t.style.opacity="1.0"},t.onmouseleave=()=>{t.style.opacity="0.1"},t.onclick=()=>{this._closeEvent&&this._closeEvent.emit()},this._closeDiv=t,this.dispose(this._divColorChanged.disposableOn(()=>{r.style.borderTopColor=this._colorStr,e.style.backgroundColor=this._colorStr,i.style.width=`${this._borderRadius*2}px`,i.style.height=`${this._borderRadius*2}px`,r.style.borderLeft=`${this._borderRadius}px`,r.style.borderRight=`${this._borderRadius}px`,r.style.borderTop=`${this._borderRadius*2}px`}));const l=h=>{h.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(e){this._colorStr!==e&&(this._colorStr=e,this._divColorChanged.emit())}get borderRadius(){return this._borderRadius}set borderRadius(e){this._borderRadius!==e&&(this._borderRadius=e,this._divColorChanged.emit())}}class Wu extends hh{constructor(){super();a(this,"_iframe");a(this,"_iframeMessageEvent");const e=document.createElement("iframe");e.style.cssText="width: 100%; height: 100%; border-width: 0px; border-radius: 5px; display: block;",e.src="http://www.weather.com.cn/live/index.shtml",this._iframe=e,this.innerContentDiv.appendChild(e);const t=i=>{i.source===this._iframe.contentWindow&&(this._iframeMessageEvent?this._iframeMessageEvent.emit(i):console.warn(`iframe消息接收到未处理!data: ${i.data}`))};globalThis.addEventListener("message",t),this.dispose(()=>{globalThis.removeEventListener("message",t)})}reset(){super.reset(),this.src=""}set src(e){this._iframe.src!==e&&(this._iframe.src=e)}get src(){return this._iframe.src}get iframe(){return this._iframe}get iframeMessageEvent(){return this._iframeMessageEvent=this._iframeMessageEvent||new v,this._iframeMessageEvent}}class Hu extends ho{constructor(){super();a(this,"_div");a(this,"_contentContainer");a(this,"_text","");const e=document.createElement("div");this._div=e,e.style.cssText="width: 0px; height: 0px; position: absolute; opacity: 1.0; visibility: visible; transition: opacity 0.5s;";const t=document.createElement("div");t.style.cssText="position: absolute; left: 0px; bottom: 0px; transform: translateX(-50%); margin: 0; padding: 0; pointer-events: none;";const i=document.createElement("div");i.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;",i.innerText=this._text,this._div.appendChild(t),t.appendChild(i),this._contentContainer=i,this._div=e,this.dispose(this.winPosChanged.disposableOn(([r,o])=>{this._div.style.left=`${r}px`,this._div.style.top=`${o-50}px`})),this.dispose(this.opacityChanged.disposableOn(r=>{this._div.style.opacity=`${r}`})),this.dispose(this.showChanged.disposableOn(r=>{this._div.style.visibility=r?"visible":"hidden"}))}get element(){return this._div}reset(){this.opacity=1,this.show=!0}set text(e){this._text!==e&&(this._text=e,this._contentContainer.innerText=e)}get text(){return this._text}}class $u extends po{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 Gu extends b{constructor(e,t){super();a(this,"_cursorDiv");a(this,"_pointerOut",this.disposeVar(w(!1)));a(this,"_show",this.disposeVar(w(!0)));this._cursorDiv=new oh(t,e),this.dispose(()=>this._cursorDiv.destroy());const i=o=>{const[l,h]=we(o);this._cursorDiv.floatDiv.winPos=[l,h]};e.addEventListener("pointermove",i),this.dispose(()=>e.removeEventListener("pointermove",i));const r=()=>{this._cursorDiv.show=this.show&&this._pointerOut.value};r(),this.dispose(this.showChanged.disposableOn(r)),this.dispose(this._pointerOut.changed.disposableOn(r))}set show(e){this._show.value=e}get show(){return this._show.value}get showChanged(){return this._show.changed}reset(){this._pointerOut.value=!1}get cursorDiv(){return this._cursorDiv}set text(e){this._cursorDiv.floatDiv.contentDiv.innerText=e}get text(){return this._cursorDiv.floatDiv.contentDiv.innerText}}function mn(n,s,e){if(!(n.tree===s.tree&&n!==s&&!n.isAncestorOf(s))||n.tree!==s.tree||!n.parent)return!1;if(!n.parent.children)throw console.error("当前节点的父节点没有子节点?这是不可能的!"),new Error("当前节点的父节点没有子节点?这是不可能的!");return!(s===n||n.isAncestorOf(s)||e!=="inner"&&!s.parent||e==="inner"&&!s.children)}function qn(n,s,e){if(!n.tree||!s.tree||n.tree!==s.tree)return;if(!n.parent){console.warn("当前节点没有父节点,那么该节点无法被移动!");return}if(!n.parent.children)throw console.error("当前节点的父节点没有子节点?这是不可能的!"),new Error("当前节点的父节点没有子节点?这是不可能的!");if(s===n){console.warn("自身不能拖放到自身!");return}if(n.isAncestorOf(s)){console.warn("当前节点不能拖放到它自身的后代节点之上!");return}if(e!=="inner"&&!s.parent){console.warn("目标节点没有父节点,无法拖放!");return}if(e==="inner"&&!s.children){console.warn("无法移动到目标节点的子节点中,因为目标节点不是组节点!");return}n.tree._startTransaction();const t=n.parent.children.indexOf(n);if(n.parent.children.splice(t,1),e!=="inner"){const{parent:i}=s;if(!i||!i.children)throw new Error("!parent");const r=i.children.indexOf(s);e==="before"?i.children.splice(r,0,n):e==="after"&&i.children.splice(r+1,0,n)}else s.children.push(n);n.tree._stopTransaction()}function ch(n,s,e){return Wr(n,t=>mn(t,s,e))}function dh(n,s,e){for(let t of n)mn(t,s,e)?qn(t,s,e):console.warn(`treeItem(id: ${t.id}) cannot move...`)}const Ju={checked:1,unchecked:2,indeterminate:3},qu=["checked","unchecked","indeterminate"];class uh extends b{constructor(e){super();a(this,"_collapsed",this.disposeVar(w(!1)));a(this,"_checkedStatus",this.disposeVar(w("unchecked")));a(this,"_selected",this.disposeVar(w(!1)));a(this,"_moveToPositionMode",this.disposeVar(w("none")));a(this,"_updateCheckedStatusFromChildrenEvent",this.disposeVar(new v));this._treeItem=e;const t=()=>this._treeItem.tree&&this._treeItem.tree.itemsChanged.emit([this._treeItem]);this.dispose(this._collapsed.changed.disposableOn(t)),this.dispose(this._checkedStatus.changed.disposableOn(t)),this.dispose(this._selected.changed.disposableOn(t)),this.dispose(this._moveToPositionMode.changed.disposableOn(t)),this.dispose(this._checkedStatus.changed.disposableOn(()=>this._treeItem.parent&&this._treeItem.parent.uiTreeObject.updateCheckedStatusFromChildren())),this.dispose(this._treeItem.childrenChangedEvent.disposableOn(()=>{this.updateCheckedStatusFromChildren()}));const i=this.disposeVar(oe(this._updateCheckedStatusFromChildrenEvent));this.dispose(i.disposableOn(()=>{if(!this._treeItem.children)return;let r=0;Br(this._treeItem.children,o=>(r|=Ju[o.uiTreeObject.checkedStatus],r===3)),r>0&&(this._checkedStatus.value=qu[r-1])})),this.dispose(this._treeItem.childrenResetedEvent.disposableOn(r=>{!r&&this.checkedStatus==="indeterminate"&&(this._checkedStatus.value="unchecked")}));{const r=(o,l,h=!0)=>{if(l)o.selectedItems.push(this._treeItem);else{const c=o.selectedItems.indexOf(this._treeItem);c===-1?h&&console.error("selectedItems index -1"):o.selectedItems.splice(c,1)}};this.dispose(this._selected.changed.disposableOn(o=>{const{tree:l}=this._treeItem;l&&r(l,o)})),this.dispose(()=>this.selected=!1)}}get treeItem(){return this._treeItem}get collapsed(){return this._collapsed.value}set collapsed(e){this._collapsed.value=e}get collapsedChanged(){return this._collapsed.changed}get checkedStatus(){return this._checkedStatus.value}check(e){const t=e?"checked":"unchecked";if(this._checkedStatus.value!==t&&(this._checkedStatus.value=t,this._treeItem.children))for(let i of this._treeItem.children)i.uiTreeObject.check(e)}updateCheckedStatusFromChildren(){this._updateCheckedStatusFromChildrenEvent.emit()}get checkedStatusChanged(){return this._checkedStatus.changed}get selected(){return this._selected.value}set selected(e){this._selected.value=e}get selectedChanged(){return this._selected.changed}get moveToPositionMode(){return this._moveToPositionMode.value}set moveToPositionMode(e){this._moveToPositionMode.value=e}get moveToPositionModeChanged(){return this._moveToPositionMode.changed}}const lt=class lt extends b{constructor(e,t=!1,i){super();a(this,"_children");a(this,"_childrenResetedEvent");a(this,"_childrenToChangeEvent");a(this,"_childrenChangedEvent");a(this,"_parent",this.disposeVar(w(void 0)));a(this,"_level",this.disposeVar(w(0)));a(this,"_id");a(this,"_uiTreeObject",this.disposeVar(new uh(this)));this._tree=e,this._hasChildren=t,this._id=i??ns(),this._id!=="_ROOT"&<.wm.has(this._id)&&console.warn(`创建了id(${this._id})相同的树节点,会导致之前的树节点无法索引!`),lt.wm.set(this._id,this),this.dispose(()=>{if(this._id!=="_ROOT"&&!lt.wm.has(this._id)){console.warn(`树节点(${this._id})不在wm树上!`);return}lt.wm.delete(this._id)}),this.dispose(this._parent.changed.disposableOn(()=>{this._updateLevel()})),this.dispose(this._level.changed.disposableOn(()=>{if(this.children)for(let r of this.children)r._updateLevel()})),lt.allTreeItems.set(this._id,this),this.dispose(()=>{lt.allTreeItems.delete(this._id)})}static getFromId(e){return lt.wm.get(e)}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 e=this.disposeVar(new hn);this._children=e,this.dispose(e.toChangeEvent.disposableOn((r,o)=>{for(let l of r){const{start:h,deleteCount:c,items:u}=l;for(let p=h;p<h+c;++p)o.get(p)._parent.value=void 0;for(let p of u){if(p.parent)throw console.error("请检查新增的treeItem是否正在使用!"),new Error("item.parent should not exist!");p._parent.value=this}}}));const t=new Set,i=new Set;this.dispose(e.toChangeEvent.disposableOn((r,o)=>{var l;if(this.tree){t.clear(),i.clear();for(let h of r){const{start:c,deleteCount:u,items:p}=h;for(let g=c;g<c+u;++g)t.add(o.get(g));for(let g of p)i.add(g)}for(let h of t)i.has(h)&&(t.delete(h),i.delete(h));(l=this.tree)==null||l.itemChildrenToChange.emit(this,r,t,i)}})),this.dispose(e.changedEvent.disposableOn(()=>{var r;(r=this.tree)==null||r.itemChildrenChanged.emit(this)})),this.dispose(e.toChangeEvent.disposableOn((...r)=>this._childrenToChangeEvent&&this._childrenToChangeEvent.emit(...r))),this.dispose(e.changedEvent.disposableOn((...r)=>this._childrenChangedEvent&&this._childrenChangedEvent.emit(...r)))}return this._children}else return}get childrenResetedEvent(){return this._childrenResetedEvent||(this._childrenResetedEvent=new v),this._childrenResetedEvent}get childrenToChangeEvent(){return this._childrenToChangeEvent||(this._childrenToChangeEvent=new v),this._childrenToChangeEvent}get childrenChangedEvent(){return this._childrenChangedEvent||(this._childrenChangedEvent=new v),this._childrenChangedEvent}resetChildren(e=!1){this._children&&(this._children.length=0),this._hasChildren=e,this._childrenResetedEvent&&this._childrenResetedEvent.emit(e)}*getDescendants(e){const t=this,i=[],r=[];for(t.children&&t.children.length>0&&(!e||e(t))&&(i.push(0),r.push(t.children));i.length>0;){const o=i[i.length-1],l=r[r.length-1],h=l.get(o);yield h,o<l.length-1?++i[i.length-1]:(r.pop(),i.pop()),h.children&&h.children.length>0&&(!e||e(h))&&(i.push(0),r.push(h.children))}}*getAncestors(e){let t=this.parent;for(;t&&(yield t,!(e&&!e(t)));)t=t.parent}isDescendantOf(e){for(let t of this.getAncestors())if(t===e)return!0;return!1}isAncestorOf(e){return e.isDescendantOf(this)}get level(){return this._level.value}get levelChanged(){return this._level.changed}get tree(){return this._tree}canMoveTo(e,t){return mn(this,e,t)}moveTo(e,t){qn(this,e,t)}detachFromParent(){if(!this.parent||!this.parent.children)return;const e=this.parent.children.indexOf(this);this.parent.children.splice(e,1)}insertNewTreeItem(e,t){if(t&&t.tree!==this.tree)return console.warn("newTreeItem.tree !== this.tree"),!1;if(this.children&&e.startsWith("Inner"))return t&&this.children.push(t),!0;if(e==="Inner")return!1;const i=this.parent;if(!i||!i.children)return!1;const r=i.children.indexOf(this);return e.endsWith("Before")?t&&i.children.splice(r,0,t):e.endsWith("After")&&t&&i.children.splice(r+1,0,t),!0}};a(lt,"wm",new Map),a(lt,"allTreeItems",new Map);let vn=lt;class ph extends b{constructor(e){super();a(this,"_redrawEvent",this.disposeVar(new v));a(this,"_containerScrollTop",this.disposeVar(w(0)));a(this,"_containerClientHeight",this.disposeVar(w(-1)));a(this,"_container",this.disposeVar(w(void 0)));a(this,"_redrawInfo",{topFreeSpaceHeight:0,topUnvisibleItemNum:0,middleTreeItems:[],bottomFreeSpaceHeight:0,bottomUnvisibleItemNum:0});this._tree=e;const t=this._containerClientHeight,i=this._containerScrollTop,r=this._tree._forceRedrawEvent,o=this.disposeVar(oe(this._tree.itemDivHeightChanged,this._tree.itemChildrenChanged,this._tree.itemsChanged,t.changed,i.changed,r)),{redrawInfo:l}=this,h=u=>{const p=u.uiTreeObject;return!!u.children&&(!p||!p.collapsed)};this.dispose(o.disposableOn(()=>{if(l.topFreeSpaceHeight=0,l.topUnvisibleItemNum=0,l.middleTreeItems.length=0,l.bottomFreeSpaceHeight=0,l.bottomUnvisibleItemNum=0,this._containerClientHeight.value>=0){const u=Hr(this._tree.getDescendants(h)),p=this._tree.itemDivHeight,g=p*u,m=Nt([Zt([Nt([g-t.value,0]),i.value]),0]),y=m/p|0,S=Math.ceil((m-y*p+t.value)/p)|0;y>0&&(l.topUnvisibleItemNum=y,l.topFreeSpaceHeight=y*this._tree.itemDivHeight);const C=y+S;let T=0;for(let z of this._tree.getDescendants(h)){if(T>=C)break;T>=y&&l.middleTreeItems.push(z),++T}const V=u-y-S;V>0&&(l.bottomUnvisibleItemNum=V,l.bottomFreeSpaceHeight=V*this._tree.itemDivHeight)}else for(let u of this._tree.getDescendants(h))l.middleTreeItems.push(u);this._redrawEvent.emit(l)}));let c;this.dispose(()=>c&&(c.destroy(),c=void 0)),this.dispose(this.containerChanged.disposableOn(u=>{c&&(c.destroy(),c=void 0),u&&(c=dn(),c.start(()=>{const{scrollTop:p,clientHeight:g}=u;typeof p>"u"||typeof g>"u"?is("createUiTreeWithContainer error: conainter has no scrollTop or clientHeight property!"):(this.containerScrollTop=p,this.containerClientHeight=g)}))}))}get container(){return this._container.value}set container(e){this._container.value=e}get containerChanged(){return this._container.changed}get redrawInfo(){return this._redrawInfo}getTreeItemPos(e){const t=o=>{const l=o.uiTreeObject;return!!o.children&&(!l||!l.collapsed)};let i=0,r=!1;for(let o of this._tree.getDescendants(t)){if(o===e){r=!0;break}++i}if(r)return[i,i*this._tree.itemDivHeight]}collapseAll(){console.log("collapseAll");for(let e of this.tree.root.getDescendants()){const t=e.uiTreeObject;t.collapsed=!0}}expandAll(){console.log("expandAll");for(let e of this.tree.root.getDescendants()){const t=e.uiTreeObject;t.collapsed=!1}}get tree(){return this._tree}get redrawEvent(){return this._redrawEvent}set containerScrollTop(e){this._containerScrollTop.value=e}get containerScrollTop(){return this._containerScrollTop.value}get containerScrollTopChanged(){return this._containerScrollTop.changed}set containerClientHeight(e){this._containerClientHeight.value=e}get containerClientHeight(){return this._containerClientHeight.value}get containerClientHeightChanged(){return this._containerClientHeight.changed}*getAllItems(e){for(let t of this._tree.getDescendants())(!e||e(t))&&(yield t)}getAllSelectedItems(){return this.getAllItems(e=>e.uiTreeObject.selected)}getAllCheckedItems(){return this.getAllItems(e=>e.uiTreeObject.checkedStatus==="checked")}getAllCheckedLeafItems(){return this.getAllItems(e=>!e.children&&e.uiTreeObject.checkedStatus==="checked")}selectAllItems(e){for(let t of this.getAllItems())(!e||!e.includes(t))&&(t.uiTreeObject.selected=!0)}clearAllSelectedItems(e){for(let t of this.getAllSelectedItems())(!e||!e.includes(t))&&(t.uiTreeObject.selected=!1)}checkAllItems(e){for(let t of this.getAllItems())(!e||!e.includes(t))&&t.uiTreeObject.check(!0)}clearAllCheckedItems(e){for(let t of this.getAllCheckedItems())(!e||!e.includes(t))&&t.uiTreeObject.check(!1)}}const si=class si extends b{constructor(e){super();a(this,"_root",this.disposeVar(new vn(this,!0,"_ROOT")));a(this,"_itemChildrenChanged",this.disposeVar(new v));a(this,"_itemChildrenToChange",this.disposeVar(new v));a(this,"_itemsAdded",this.disposeVar(new v));a(this,"_itemsDeleted",this.disposeVar(new v));a(this,"_itemsChanged",this.disposeVar(new v));a(this,"_transactionStack",0);a(this,"_addedItems",new Set);a(this,"_deletedItems",new Set);a(this,"_selectedItems",this.disposeVar(new hn));a(this,"_itemDivHeight",this.disposeVar(w(si.defaultItemDivHeight)));a(this,"_forceRedrawEvent",this.disposeVar(new v));a(this,"_uiTree",this.disposeVar(new ph(this)));this._root._tree.value=this,this.dispose(this._itemChildrenToChange.disposableOn((t,i)=>{if(!t.children){console.error("!item.children");return}for(let r of i){const{start:o,deleteCount:l,items:h}=r;for(let c=o;c<o+l;++c){const u=t.children.get(c);this._deletedItems.has(u)?console.error(`this._deletedItems.has(currentItem(${u.id}))`):this._deletedItems.add(u)}for(let c of h)this._deletedItems.has(c)?this._deletedItems.delete(c):this._addedItems.add(c)}this._execTransaction()})),e!==void 0&&(this.itemDivHeight=e)}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(e){this._itemDivHeight.value=e}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(e){return this._root.getDescendants(e)}getTreeItemFromId(e){let t;for(let i of this.getDescendants())if(i.id===e){t=i;break}return t}_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}};a(si,"defaultItemDivHeight",24),a(si,"canMoveToTreeItem",mn),a(si,"moveToTreeItem",qn),a(si,"canMoveToTreeItems",ch),a(si,"moveToTreeItems",dh);let Si=si;class le extends b{constructor(e,t,i=!0,r){super();a(this,"_obj",this.disposeVar(w(void 0)));this._resetEvent=e,this._createFunc=t;const o=this._resetEvent,l=this._createFunc,h=()=>{this._obj.value&&(this._obj.value.destroy(),this._obj.value=void 0)};this.dispose(h);const c=(...u)=>{h(),this._obj.value=l(...u)};i&&(r?this._obj.value=l(...r):this._obj.value=l()),this.dispose(o.disposableOn(c))}get obj(){return this._obj.value}get objChanged(){return this._obj.changed}}class Xu extends b{constructor(e,t=!0,i){super();a(this,"_event",this.disposeVar(new v));a(this,"_objResettingWithEvent");this._createFunc=e,this._execOnInit=t,this._initParams=i,this._objResettingWithEvent=this.disposeVar(new le(this._event,this._createFunc,this._execOnInit,this._initParams))}get obj(){return this._objResettingWithEvent.obj}get objChanged(){return this._objResettingWithEvent.objChanged}reset(...e){this._event.emit(...e)}}const Or=class Or extends b{constructor(){super();a(this,"_set",new Set);a(this,"_toChangeEvent",this.dv(new v));a(this,"_changedEvent",this.dv(new v));a(this,"main");this.dispose(()=>{this._set.size!==0&&(Or.warnOnDestroying&&console.warn("this._set.size > 0"),this.clear())})}get toChange(){return this._toChangeEvent}get changed(){return this._changedEvent}add(...e){if(e.length==2&&typeof e[1]=="boolean")e[1]&&(this.main=e[0]);else for(let t of e)this._toChangeEvent.emit([],[t]),this._set.add(t),this._changedEvent.emit([],[t])}delete(...e){for(let t of e)this.main&&this.main==t&&(this.main=void 0),this._toChangeEvent.emit([t],[]),this._set.delete(t),this._changedEvent.emit([t],[])}disposableAdd(...e){return e.length==2&&typeof e[1]=="boolean"?(e[1]&&(this.main=e[0]),this.add(e[0]),()=>this.delete(e[0])):(this.add(...e),()=>this.delete(...e))}get size(){return this._set.size}clear(){const e=[...this._set];this._toChangeEvent.emit([],e),this._set.clear(),this._changedEvent.emit([],e),this.main=void 0}values(){return this._set.values()}};a(Or,"warnOnDestroying",!0);let Xn=Or;async function gh(n){const s=[],e=[],t=n.entries();for await(const[i,r]of t){const o=r;o.kind==="file"?s.push(i):o.kind==="directory"&&e.push(i)}return{files:s,dirs:e}}async function go(n){return await(await n.getFile()).text()}async function fh(n){const s=await go(n);try{return JSON.parse(s)}catch{return}}async function mh(n){return await(await n.getFile()).arrayBuffer()}class vh extends b{constructor(s){super(),this._rootDirHandle=s}get rootDirHandle(){return this._rootDirHandle}async getSubFilesAndDirs(){return await gh(this._rootDirHandle)}async getDir(s){let e=this._rootDirHandle;for(const t of s)if(e=await(e==null?void 0:e.getDirectoryHandle(t)),!e){console.log(`getDirectoryHandle ${t} failed`);return}return e}async getFile(s,e){const t=await this.getDir(s);if(t)try{return await t.getFileHandle(e)}catch(i){console.error(`未能获取当前文件 ${s.join("/")}/${e} error: ${i}`,i);return}}}class _h extends b{constructor(e){super();a(this,"_startRootDirId",0);a(this,"_dirMap",new Map);this._prefix=e}get prefix(){return this._prefix}async getRootDirId(e){let t;try{console.log("window.showDirectoryPicker begin"),t=await globalThis.showDirectoryPicker({id:e,mode:"read"}),console.log("window.showDirectoryPicker end",t)}catch(i){console.error(`LocalFileServer getRootDirId failed: ${i}`,i);return}if(t){const i=++this._startRootDirId,r=`${this._prefix}${i}`;return this._dirMap.set(r,new vh(t)),r}}getRootDir(e){return this._dirMap.get(e)}async getFile(e){const t=e.split("/");if(t.length<2){console.warn(`LocalFileServer getFile failed: ${e}`);return}const i=t[0],r=this._dirMap.get(i);if(!r){console.warn(`LocalFileServer getFile failed: ${e}`);return}const o=t.slice(1,t.length-1),l=t[t.length-1],h=await r.getFile(o,l);if(!h){console.warn(`LocalFileServer getFile failed: ${e}`);return}return h}async getText(e){const t=await this.getFile(e);if(t)return await go(t)}async getArrayBuffer(e){const t=await this.getFile(e);if(t)return await mh(t)}async getJson(e){const t=await this.getFile(e);if(t)return await fh(t)}async getLocalFilePath(e,t,i){const r=await this.getRootDirId(t);if(!r){console.warn("getRootDirId error!");return}const o=this.getRootDir(r);if(!o){console.warn("getRootDir error!");return}const l=await o.getSubFilesAndDirs();if(!l.files){console.warn("getSubFilesAndDirs error! 找不到符合要求的文件!");return}const h=e?l.files.filter(c=>e.some(u=>c.endsWith(u))):l.files;if(h.length===0){console.warn("找不到符合要求的文件!");return}return`https://${r}/${h[0]}`}}const yh=new _h("xe2_local");async function Yu(n,s,e){return await yh.getLocalFilePath(n,s,e)}class wh extends b{constructor(e,t){super();a(this,"_processing");this._complexImage=e,this._imageUri=t,this._processing=this.disposeVar(Le(async i=>{const r=this._complexImage,o=await i.promise(Rl(this._imageUri,this._complexImage.crossOrigin));o&&o instanceof HTMLImageElement&&(r.size=[o.naturalWidth,o.naturalHeight],r.pixelFormat="RGBA",r.copyTexture({source:o}))})),this._processing.start()}get processing(){return this._processing}}const Eh=["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"],bh=["img","gif","video","flv","hls"];let Ku=class extends b{constructor(e,t){super();a(this,"_element");this._complexImage=e,this._videoSrc=t;var i=document.createElement("video");i.src=this._videoSrc,i.style.position="absolute",i.style.top="0px",i.style.left="0px",i.style.zIndex="-100",i.style.visibility="hidden",i.style.width="0px",i.style.height="0px";{const r=()=>{i.crossOrigin=this._complexImage.crossOrigin};r(),this.dispose(this._complexImage.crossOriginChanged.disposableOn(r))}{const r=()=>{i.autoplay=this._complexImage.autoplay};r(),this.dispose(this._complexImage.autoplayChanged.disposableOn(r))}{const r=()=>{i.loop=this._complexImage.loop};r(),this.dispose(this._complexImage.loopChanged.disposableOn(r))}i.muted=!0,document.body.appendChild(i),this._element=i,this.dispose(()=>document.body.removeChild(i))}get element(){return this._element}};class Sh extends b{constructor(e,t){super();a(this,"_videoDom");a(this,"_update");this._complexImage=e,this._imageUri=t,this._videoDom=this.disposeVar(new Ku(this._complexImage,this._imageUri)),this._update=this.disposeVar(cs(()=>this.update())),this._update.start()}get videoDom(){return this._videoDom}get videoElement(){return this._videoDom.element}update(){if(this.videoElement.readyState<2)return;const e=this._complexImage,{videoWidth:t,videoHeight:i}=this.videoElement;e.size=[t,i],e.pixelFormat="RGBA",e.copyTexture({source:this.videoElement})}}function Zu(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var fo={},Lt={},Ch;function Qu(){if(Ch)return Lt;Ch=1,Object.defineProperty(Lt,"__esModule",{value:!0}),Lt.loop=Lt.conditional=Lt.parse=void 0;var n=function t(i,r){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},l=arguments.length>3&&arguments[3]!==void 0?arguments[3]:o;if(Array.isArray(r))r.forEach(function(c){return t(i,c,o,l)});else if(typeof r=="function")r(i,o,l,t);else{var h=Object.keys(r)[0];Array.isArray(r[h])?(l[h]={},t(i,r[h],o,l[h])):l[h]=r[h](i,o,l,t)}return o};Lt.parse=n;var s=function(i,r){return function(o,l,h,c){r(o,l,h)&&c(o,i,l,h)}};Lt.conditional=s;var e=function(i,r){return function(o,l,h,c){for(var u=[],p=o.pos;r(o,l,h);){var g={};if(c(o,i,l,g),o.pos===p)break;p=o.pos,u.push(g)}return u}};return Lt.loop=e,Lt}var he={},Ph;function Th(){if(Ph)return he;Ph=1,Object.defineProperty(he,"__esModule",{value:!0}),he.readBits=he.readArray=he.readUnsigned=he.readString=he.peekBytes=he.readBytes=he.peekByte=he.readByte=he.buildStream=void 0;var n=function(p){return{data:p,pos:0}};he.buildStream=n;var s=function(){return function(p){return p.data[p.pos++]}};he.readByte=s;var e=function(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return function(g){return g.data[g.pos+p]}};he.peekByte=e;var t=function(p){return function(g){return g.data.subarray(g.pos,g.pos+=p)}};he.readBytes=t;var i=function(p){return function(g){return g.data.subarray(g.pos,g.pos+p)}};he.peekBytes=i;var r=function(p){return function(g){return Array.from(t(p)(g)).map(function(m){return String.fromCharCode(m)}).join("")}};he.readString=r;var o=function(p){return function(g){var m=t(2)(g);return p?(m[1]<<8)+m[0]:(m[0]<<8)+m[1]}};he.readUnsigned=o;var l=function(p,g){return function(m,y,S){for(var C=typeof g=="function"?g(m,y,S):g,T=t(p),V=new Array(C),z=0;z<C;z++)V[z]=T(m);return V}};he.readArray=l;var h=function(p,g,m){for(var y=0,S=0;S<m;S++)y+=p[g+S]&&Math.pow(2,m-S-1);return y},c=function(p){return function(g){for(var m=s()(g),y=new Array(8),S=0;S<8;S++)y[7-S]=!!(m&1<<S);return Object.keys(p).reduce(function(C,T){var V=p[T];return V.length?C[T]=h(y,V.index,V.length):C[T]=y[V.index],C},{})}};return he.readBits=c,he}var Ih;function ep(){return Ih||(Ih=1,(function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var s=Qu(),e=Th(),t={blocks:function(g){for(var m=0,y=[],S=g.data.length,C=0,T=(0,e.readByte)()(g);T!==m&&T;T=(0,e.readByte)()(g)){if(g.pos+T>=S){var V=S-g.pos;y.push((0,e.readBytes)(V)(g)),C+=V;break}y.push((0,e.readBytes)(T)(g)),C+=T}for(var z=new Uint8Array(C),x=0,$=0;$<y.length;$++)z.set(y[$],x),x+=y[$].length;return z}},i=(0,s.conditional)({gce:[{codes:(0,e.readBytes)(2)},{byteSize:(0,e.readByte)()},{extras:(0,e.readBits)({future:{index:0,length:3},disposal:{index:3,length:3},userInput:{index:6},transparentColorGiven:{index:7}})},{delay:(0,e.readUnsigned)(!0)},{transparentColorIndex:(0,e.readByte)()},{terminator:(0,e.readByte)()}]},function(p){var g=(0,e.peekBytes)(2)(p);return g[0]===33&&g[1]===249}),r=(0,s.conditional)({image:[{code:(0,e.readByte)()},{descriptor:[{left:(0,e.readUnsigned)(!0)},{top:(0,e.readUnsigned)(!0)},{width:(0,e.readUnsigned)(!0)},{height:(0,e.readUnsigned)(!0)},{lct:(0,e.readBits)({exists:{index:0},interlaced:{index:1},sort:{index:2},future:{index:3,length:2},size:{index:5,length:3}})}]},(0,s.conditional)({lct:(0,e.readArray)(3,function(p,g,m){return Math.pow(2,m.descriptor.lct.size+1)})},function(p,g,m){return m.descriptor.lct.exists}),{data:[{minCodeSize:(0,e.readByte)()},t]}]},function(p){return(0,e.peekByte)()(p)===44}),o=(0,s.conditional)({text:[{codes:(0,e.readBytes)(2)},{blockSize:(0,e.readByte)()},{preData:function(g,m,y){return(0,e.readBytes)(y.text.blockSize)(g)}},t]},function(p){var g=(0,e.peekBytes)(2)(p);return g[0]===33&&g[1]===1}),l=(0,s.conditional)({application:[{codes:(0,e.readBytes)(2)},{blockSize:(0,e.readByte)()},{id:function(g,m,y){return(0,e.readString)(y.blockSize)(g)}},t]},function(p){var g=(0,e.peekBytes)(2)(p);return g[0]===33&&g[1]===255}),h=(0,s.conditional)({comment:[{codes:(0,e.readBytes)(2)},t]},function(p){var g=(0,e.peekBytes)(2)(p);return g[0]===33&&g[1]===254}),c=[{header:[{signature:(0,e.readString)(3)},{version:(0,e.readString)(3)}]},{lsd:[{width:(0,e.readUnsigned)(!0)},{height:(0,e.readUnsigned)(!0)},{gct:(0,e.readBits)({exists:{index:0},resolution:{index:1,length:3},sort:{index:4},size:{index:5,length:3}})},{backgroundColorIndex:(0,e.readByte)()},{pixelAspectRatio:(0,e.readByte)()}]},(0,s.conditional)({gct:(0,e.readArray)(3,function(p,g){return Math.pow(2,g.lsd.gct.size+1)})},function(p,g){return g.lsd.gct.exists}),{frames:(0,s.loop)([i,l,h,r,o],function(p){var g=(0,e.peekByte)()(p);return g===33||g===44})}],u=c;n.default=u})(fo)),fo}var tp=ep();const ip=Zu(tp);var sp=Th();const np=(n,s)=>{const e=new Array(n.length),t=n.length/s,i=function(u,p){const g=n.slice(p*s,(p+1)*s);e.splice.apply(e,[u*s,s].concat(g))},r=[0,4,2,1],o=[8,8,4,2];for(var l=0,h=0;h<4;h++)for(var c=r[h];c<t;c+=o[h])i(c,l),l++;return e},rp=(n,s,e)=>{const r=e;var o,l,h,c,u,p,g,$,m,y,x,S,Y,Q,qe,Ae;const C=new Array(e),T=new Array(4096),V=new Array(4096),z=new Array(4097);for(S=n,l=1<<S,u=l+1,o=l+2,g=-1,c=S+1,h=(1<<c)-1,m=0;m<l;m++)T[m]=0,V[m]=m;var x,$,Y,Q,Ae,qe;for(x=$=Y=Q=Ae=qe=0,y=0;y<r;){if(Q===0){if($<c){x+=s[qe]<<$,$+=8,qe++;continue}if(m=x&h,x>>=c,$-=c,m>o||m==u)break;if(m==l){c=S+1,h=(1<<c)-1,o=l+2,g=-1;continue}if(g==-1){z[Q++]=V[m],g=m,Y=m;continue}for(p=m,m==o&&(z[Q++]=Y,m=g);m>l;)z[Q++]=V[m],m=T[m];Y=V[m]&255,z[Q++]=Y,o<4096&&(T[o]=g,V[o]=Y,o++,(o&h)===0&&o<4096&&(c++,h+=o)),g=p}Q--,C[Ae++]=z[Q],y++}for(y=Ae;y<r;y++)C[y]=0;return C},op=n=>{const s=new Uint8Array(n);return Re.parse(sp.buildStream(s),ip)},ap=n=>{const s=n.pixels.length,e=new Uint8ClampedArray(s*4);for(var t=0;t<s;t++){const i=t*4,r=n.pixels[t],o=n.colorTable[r]||[0,0,0];e[i]=o[0],e[i+1]=o[1],e[i+2]=o[2],e[i+3]=r!==n.transparentIndex?255:0}return e},lp=(n,s,e)=>{if(!n.image){console.warn("gif frame does not have associated image.");return}const{image:t}=n,i=t.descriptor.width*t.descriptor.height;var r=rp(t.data.minCodeSize,t.data.blocks,i);t.descriptor.lct.interlaced&&(r=np(r,t.descriptor.width));const o={pixels:r,dims:{top:n.image.descriptor.top,left:n.image.descriptor.left,width:n.image.descriptor.width,height:n.image.descriptor.height}};return t.descriptor.lct&&t.descriptor.lct.exists?o.colorTable=t.lct:o.colorTable=s,n.gce&&(o.delay=(n.gce.delay||10)*10,o.disposalType=n.gce.extras.disposal,n.gce.extras.transparentColorGiven&&(o.transparentIndex=n.gce.transparentColorIndex)),o.patch=ap(o),o},hp=(n,s)=>n.frames.filter(e=>e.image).map(e=>lp(e,n.gct));async function xh(n){const e=await(await fetch(n)).arrayBuffer(),t=op(e),i=hp(t);return{gif:t,gifFrames:i,arrayBuffer:e}}function Oh(n,s,e){return n<s?s:n>e?e:n}class Dh extends Jn{constructor(e,t=!0,i){super();a(this,"_gifFrames",this.disposeVar(w(void 0)));a(this,"_gifDurations",[]);a(this,"_gifDuration",this.disposeVar(w(0)));a(this,"_gifSize",this.disposeVar(w([0,0],(e,t)=>e.every((i,r)=>i===t[r]),e=>[...e])));a(this,"_autoPlayOnLoad",this.disposeVar(w(!0)));a(this,"_gifCanvas");this._container=e,this.loop=!0;const r=document.createElement("canvas");this._gifCanvas=r,r.style.width="100%",r.style.height="100%";const o=r.getContext("2d");this._container&&this._container.appendChild(r),this.dispose(()=>this._container&&this._container.removeChild(r));let l;this.dispose(this._gifFrames.changed.disposableOn(c=>{if(!c||c.length===0){r.width=0,r.height=0;return}const{width:u,height:p}=c[0].dims;this._gifSize.value=[u,p];const g=c.length;let m=0;this._gifDurations.length=0;for(let y=0;y<g;++y)m+=c[y].delay,this._gifDurations.push(m);this._gifDuration.value=this._gifDurations[this._gifDurations.length-1],r.width=u,r.height=p,l=o.createImageData(u,p),this.currentTimeChangedEvent.emit(this.currentTime,this.currentTime),this._autoPlayOnLoad.value&&(this.currentTime=0,this.playing=!0)}));let h=-1;this.dispose(this.currentTimeChangedEvent.disposableOn(c=>{const u=Oh(c/this.duration,0,1),p=this.gifDuration*u,g=this._gifFrames.value;if(g&&g.length>0){const m=this._getFrame(p);if(m===h)return;h=m;const y=g[m];if(y.disposalType!==0&&y.disposalType!==1&&y.disposalType!==2&&is(`gif parsed get disposalType ${y.disposalType}... frame: ${m} size: ${JSON.stringify(y.dims)}`,`gif parsed get disposalType ${y.disposalType}...`),l&&(m===0||y.disposalType===2)&&l.data.fill(0),l){const[S,C]=this._gifSize.value,{width:T,height:V,left:z,top:x}=y.dims;if(V>C)throw new Error("height > canvasHeight");for(let $=0;$<V;++$)for(let Y=0;Y<T;++Y){const Q=$*T+Y,Ae=x+$,qe=z+Y,jt=Ae*S+qe,mt=l.data,fi=y.patch,mi=fi[Q*4+3]/255;mt[jt*4+0]=mt[jt*4+0]*(1-mi)+fi[Q*4+0]*mi|0,mt[jt*4+1]=mt[jt*4+1]*(1-mi)+fi[Q*4+1]*mi|0,mt[jt*4+2]=mt[jt*4+2]*(1-mi)+fi[Q*4+2]*mi|0,mt[jt*4+3]=Oh(mt[jt*4+3]+fi[Q*4+3],0,255)|0}o.putImageData(l,0,0)}}else is("gif资源未加载!无法播放!")})),this.dispose(this._gifDuration.changed.disposableOn(()=>{this.duration=this.gifDuration})),this._autoPlayOnLoad.value=t,this._gifFrames.value=i}get gifCanvas(){return this._gifCanvas}set gifFrames(e){this._gifFrames.value=e}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(e){this._autoPlayOnLoad.value=e}get autoPlayOnLoadChanged(){return this._autoPlayOnLoad.changed}_getFrame(e){const t=this._gifDurations.length;for(let i=0;i<t;++i)if(e<=this._gifDurations[i])return i;throw new Error("should not be here")}}class Fh extends b{constructor(e){super();a(this,"_player");a(this,"_url",this.disposeVar(w("")));a(this,"_loadGifFramesProcessing",this.disposeVar(Gn(e=>hs(xh(e)))));this._player=this.disposeVar(new Dh(e)),this._player.autoPlayOnLoad=!0,this._loadGifFramesProcessing.completeFunc=({gifFrames:t})=>this._player.gifFrames=t,this.dispose(this._url.changed.disposableOn(t=>{this._player.gifFrames=void 0,this._loadGifFramesProcessing.restart(new st(`reload gif(${t})`),t)}))}get player(){return this._player}set url(e){this._url.value=e}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 kh extends b{constructor(e,t){super();a(this,"_gif",this.disposeVar(new Fh));a(this,"_update");this._complexImage=e,this._imageUri=t,this._gif.url=this._imageUri,this._update=this.disposeVar(cs(()=>this.update())),this._update.start()}get gif(){return this._gif}update(){const{player:e}=this._gif;if(!e.gifFrames)return;const t=this._complexImage,{width:i,height:r}=e.gifCanvas;t.size=[i,r],t.pixelFormat="RGBA",t.copyTexture({source:e.gifCanvas});{const o=()=>{e.autoPlayOnLoad=this._complexImage.autoplay};o(),this.dispose(this._complexImage.autoplayChanged.disposableOn(o))}{const o=()=>{e.loop=this._complexImage.loop};o(),this.dispose(this._complexImage.loopChanged.disposableOn(o))}}}function Mh(n,s){const[e,t,i]=tn(n),r=w(void 0),o=()=>{const l=e()??s;r.value=l&&M.context.getStrFromEnv(l)};return o(),i&&r.d(i.don(o)),r.d(M.context.environmentVariablesChanged.don(o)),r}function Ah(n){const s=/\${(.*?)\}/g;if(!s.test(n))return n;const e=n.replace(s,(t,i)=>{const r=M.context.getEnv(i);return r===void 0?(console.warn(`环境变量(${i})不存在,无法进行转换`),"{env-error}"):r});return Ah(e)}class cp extends b{constructor(e){super();a(this,"_sceneObjRefs",new Map);a(this,"_refs",{});a(this,"_refsChanged",this.dv(new v));const t=(i,r,o)=>{if(o){const l=this.getLastSceneObject(o),h=this._sceneObjRefs.get(o);if(!h)console.warn(`this._sceneObjRefs中不存在ref(${o}), 可能系统存在逻辑问题`);else{const u=h.indexOf(i);u===-1?console.warn(`this._sceneObjRefs中不存在当前对象(id: ${i.id} type: ${i.typeName})!可能系统存在逻辑问题`):(h.splice(u,1),h.length===0&&this._sceneObjRefs.delete(o))}const c=this.getLastSceneObject(o);this._refs[o]=c,this._refsChanged.emit(c,l)}if(r){const l=this.getLastSceneObject(r),h=this._sceneObjRefs.get(r);h?(h.push(i),h.length>0&&console.warn(`同时存在多个ref${r}相同的场景对象!
|
|
21
|
+
`)}}),globalThis.g_XE3CopyRights=globalThis.g_XE3CopyRights||{},globalThis.g_XE3CopyRights[n]=d.copyright,globalThis.g_XE3SendProductUsageInfo=globalThis.g_XE3SendProductUsageInfo||!0,globalThis.g_XE3SendProductUsageInfo&&(setTimeout(()=>Pl(d.copyright),1e3*60),setInterval(()=>Pl(d.copyright),1440*60*1e3)),globalThis.g_earthsdk_copyright_print=globalThis.g_earthsdk_copyright_print??!0,globalThis.g_earthsdk_copyright_print&&d.copyright.print()}catch{console.warn("版本信息有误!")}const Tl=new Set;function is(n,s=n){Tl.has(s)||(Tl.add(s),console.warn(n))}function tn(n){const s=Rn(n),e=()=>s[0][s[1]],t=r=>{try{s[0][s[1]]=r}catch(o){is(`setValue error, obj(${s[0].constructor.name}) prop(${s[1]}) error(${o})`)}},i=s[0][s[2]];return[e,t,i]}function xd(){return!0}function Od(){throw new Error("throwOnDestroyed")}function Il(n){for(var s in n)typeof n[s]=="function"&&(n[s]=Od);n.isDestroyed=xd}const xr=class xr{constructor(){a(this,"_memId",++xr._lastMemId);a(this,"_disposers")}get __v_skip(){return!0}get memId(){return this._memId}get disposers(){return this._disposers||(this._disposers=[]),this._disposers}dispose(s){return this.disposers.push(s),s}d(s){return this.dispose(s)}disposeVar(s){return this.disposers.push(()=>s.destroy()),s}dv(s){return this.disposeVar(s)}tryDisposeVar(s){return this.disposers.push(()=>s.tryDestroy()),s}tdv(s){return this.tryDisposeVar(s)}autoDispose(s){return typeof s=="function"?this.dispose(s):this.disposeVar(s)}ad(s){return typeof s=="function"?this.dispose(s):this.disposeVar(s)}isDestroyed(){return!1}destroyImp(){}destroy(){if(this._toDestroyEvent&&this._toDestroyEvent.emit(),this.destroyImp(),this._disposers)try{const s=this._disposers,e=s.length;for(let t=e-1;t>=0;--t)s[t]();s.length=0,this._disposers=void 0}catch(s){console.error(`destroy get error! ${s}`)}return Il(this)}tryDestory(){if(!this.isDestroyed())return this.destroy()}};a(xr,"_lastMemId",-1);let b=xr,Fr;function xl(n){Fr=n}Object.defineProperties(b.prototype,{toDestroyEvent:{get(){if(this._toDestroyEvent===void 0){if(!Fr)throw new Error("Destroyable EventCtor not registered yet!");this._toDestroyEvent=this.disposeVar(new Fr)}return this._toDestroyEvent}}});class An{constructor(s,e,t=!1){a(this,"_freeElements");a(this,"_usedElementsCount");a(this,"_usedElements");a(this,"_nextCreateID");a(this,"_scratchObjs");this._createDefaultFunc=s,this._destroyFunc=e,this._freeElements=[],this._usedElementsCount=0,this._nextCreateID=1,this._scratchObjs=[],t&&(this._usedElements=[])}get usedElementsCount(){return this._usedElementsCount}get freeElementsCount(){return this._freeElements.length}_getCreateID(){return this._nextCreateID++}_create(){let s;return this._freeElements.length>0?s=this._freeElements.pop():s=this._createDefaultFunc&&this._createDefaultFunc()||{},s._cid=this._getCreateID(),s}create(){return this._create()}multiCreate(s){this._scratchObjs.length=0;for(let e=0;e<s;++e)this._scratchObjs.push(this._create());return this._scratchObjs}_destroy(s){this._destroyFunc&&this._destroyFunc(s),s._cid=void 0}destroy(...s){const e=s.length;for(let t=0;t<e;++t)this._destroy(s[t])}}function Dd(){return{item:void 0,previous:void 0,next:void 0}}function Fd(n){n.item=void 0,n.previous=void 0,n.next=void 0}const Ol=new An(Dd,Fd,!0);function kr(n,s,e){const t=Ol.create();return t.item=n,t.previous=s,t.next=e,t}function Dl(n){if(!n)throw new Error("node is undefined!");Ol.destroy(n)}function Mr(n,s){s.previous&&s.next?(s.previous.next=s.next,s.next.previous=s.previous):s.previous?(s.previous.next=void 0,n.tail=s.previous):s.next?(s.next.previous=void 0,n.head=s.next):(n.head=void 0,n.tail=void 0),s.next=void 0,s.previous=void 0}class Fl{constructor(s){a(this,"head");a(this,"tail");a(this,"_length");const{needLength:e}=s||{needLength:!0};this.head=void 0,this.tail=void 0,e&&(this._length=0)}_incrementLength(){typeof this._length=="number"&&++this._length}_decrementLength(){typeof this._length=="number"&&--this._length}_setLength(s){typeof this._length=="number"&&(this._length=s)}get length(){return this._length}get empty(){return!this.head}*[Symbol.iterator](){let s=this.head;for(;s;)yield s,s=s.next}remove(s){if(!s)throw new Error("node is undefined!");Mr(this,s),this._decrementLength(),Dl(s)}getNode(s){let e=this.head;for(;e!==null;){if(!e)throw new Error("current is undefined!");if(e.item===s)return e;e=e.next}}moveAfter(s,e){if(s!==e){Mr(this,e);var t=s.next;s.next=e,this.tail===s?this.tail=e:t&&(t.previous=e),e.next=t,e.previous=s}}moveBefore(s,e){if(s!==e){Mr(this,e);var t=s.previous;s.previous=e,this.head===s?this.head=e:t&&(t.next=e),e.previous=t,e.next=s}}insertBefore(s,e){const t=kr(e,s.previous,s);return s.previous&&(s.previous.next=t),s.previous=t,this.head===s&&(this.head=t),this._incrementLength(),t}insertAfter(s,e){const t=kr(e,s,s.next);return s.next&&(s.next.previous=t),s.next=t,this.tail===s&&(this.tail=t),this._incrementLength(),t}_setFirstNode(s){if(this.head||this.tail)throw new Error("_setFirstNode error!");const e=kr(s,void 0,void 0);if(this.head=e,this.tail=e,this._incrementLength(),this._length!==1)throw new Error("_setFirstNode error! this._length !== 1");return e}push(s){return this.tail?this.insertAfter(this.tail,s):this._setFirstNode(s)}pop(){if(!this.tail)throw new Error("DoublyLinkedList is empty!");const s=this.tail.item;return this.remove(this.tail),s}shift(){if(!this.head)throw new Error("DoublyLinkedList is empty!");const s=this.head.item;return this.remove(this.head),s}unshift(s){return this.head?this.insertBefore(this.head,s):this._setFirstNode(s)}removeAll(){let s=this.head;for(;s;){const e=s.next;Dl(s),s=e}this.head=void 0,this.tail=void 0,this._setLength(0)}}function kd(){return{func:void 0,scope:void 0,_hasRemoved:!1,_once:!1}}function Md(n){n.func=void 0,n.scope=void 0,n._hasRemoved=!1,n._once=!1}const vi=new An(kd,Md,!0);class Ar{constructor(){a(this,"__dll");a(this,"__currentListenerStack")}get _dll(){return this.__dll=this.__dll??new Fl({needLength:!0}),this.__dll}_pushCurrentListener(s){this.__currentListenerStack?Array.isArray(this.__currentListenerStack)?this.__currentListenerStack.push(s):this.__currentListenerStack=[this.__currentListenerStack,s]:this.__currentListenerStack=s}_popCurrentListener(){if(this.__currentListenerStack)Array.isArray(this.__currentListenerStack)?this.__currentListenerStack.pop():this.__currentListenerStack=void 0;else throw new Error("cannot pop!")}_hasCurrentListener(s){return this.__currentListenerStack?Array.isArray(this.__currentListenerStack)?this.__currentListenerStack.indexOf(s)!==-1:this.__currentListenerStack===s:!1}do(...s){if(this.__dll&&!this._dll.empty){let e=this._dll.head;for(;e;){const t=e.item;t._hasRemoved||(this._pushCurrentListener(t),t.func.call(t.scope,...s),this._popCurrentListener());const i=e.next;t._once&&!t._hasRemoved&&(this.remove(e),e=void 0),e&&this._clearHasRemoved(e),e=i}}}get empty(){if(!this.__dll||this._dll.empty)return!0;let s=!0,e=this._dll.head;for(;e;){if(!e.item._hasRemoved){s=!1;break}e=e.next}return s}isHandlerValid(s){return!s.item._hasRemoved}nextHandler(s){if(!s.item._hasRemoved)throw new Error("handler has removed!");let e=s.next;for(;e&&e.item._hasRemoved;)e=e.next;return e}prevHandler(s){if(!s.item._hasRemoved)throw new Error("handler has removed!");let e=s.previous;for(;e&&e.item._hasRemoved;)e=e.previous;return e}moveAfter(s,e){if(s.item._hasRemoved||e.item._hasRemoved)throw new Error("handler or nextHandler has removed!");return this._dll.moveAfter(s,e)}moveBefore(s,e){if(s.item._hasRemoved||e.item._hasRemoved)throw new Error("handler or prevHandler has removed!");return this._dll.moveBefore(s,e)}insertBefore(s,e,t,i=!1){if(s.item._hasRemoved)throw new Error("handler has removed!");const r=vi.create();return r.func=e,r.scope=t,r._once=i,this._dll.insertBefore(s,r)}insertAfter(s,e,t,i=!1){if(s.item._hasRemoved)throw new Error("handler has removed!");const r=vi.create();return r.func=e,r.scope=t,r._once=i,this._dll.insertAfter(s,r)}_clearHasRemoved(s){s.item._hasRemoved&&!this._hasCurrentListener(s.item)&&(vi.destroy(s.item),this._dll.remove(s))}remove(s){if(!s.item||s.item._hasRemoved)throw new Error("handler has removed!");this._hasCurrentListener(s.item)?s.item._hasRemoved=!0:(vi.destroy(s.item),this._dll.remove(s))}removeAll(){if(this.__dll&&!this._dll.empty){let s=this._dll.head;for(;s;){const e=s.next;s.item._hasRemoved||this.remove(s),s=e}}}destroy(){if(!this.__dll)return;let s=this._dll.head;for(;s;){const e=s.next,t=s;this._hasCurrentListener(t.item)||(console.warn("Event has remove item that on current stack!"),console.warn(`${t.item.func.toString()}`)),vi.destroy(t.item),this._dll.remove(t),s=e}this.__dll=void 0,this.__currentListenerStack=void 0}push(s,e,t=!1){const i=vi.create();return i.func=s,i.scope=e,i._once=t,this._dll.push(i)}pop(){const s=this.tail;if(!s)throw new Error("pop error!");this.remove(s)}shift(){const s=this.head;if(!s)throw new Error("shift error!");this.remove(s)}unshift(s,e,t=!1){const i=vi.create();return i.func=s,i.scope=e,i._once=t,this._dll.unshift(i)}get tail(){let s=this._dll.tail;for(;s&&s.item._hasRemoved;)s=s.previous;return s}get head(){let s=this._dll.head;for(;s&&s.item._hasRemoved;)s=s.previous;return s}}class sn{constructor(){a(this,"_listenerHandler");a(this,"_cid")}_reset(s,e){this._listenerHandler=s,this._cid=e}clone(s){return s=s??new sn,s._reset(this._listenerHandler,this._cid),s}get valid(){if(typeof this._listenerHandler<"u"&&typeof this._cid=="number"){const s=this._listenerHandler._cid;if(typeof s<"u"&&this._cid===s)return!0}return!1}}class jr extends sn{}class v extends b{constructor(){super(...arguments);a(this,"__pipe");a(this,"beforeCallback");a(this,"afterCallback")}get _pipe(){return this.__pipe=this.__pipe??new Ar,this.__pipe}get empty(){return!this.__pipe||this._pipe.empty}emit(...e){!this.isDestroyed()&&this.beforeCallback&&this.beforeCallback(...e),!this.isDestroyed()&&this._pipe.do(...e),!this.isDestroyed()&&this.afterCallback&&this.afterCallback(...e)}on(e,t,i=!1,r){const o=i?this._pipe.unshift(e,t,!1):this._pipe.push(e,t,!1);return r=r??new jr,r._reset(o,o._cid),r}disposableOn(e,t,i=!1,r){const o=this.on(e,t,i,r);return()=>{o.valid&&this.off(o)}}don(e,t,i=!1,r){return this.disposableOn(e,t,i,r)}disposableWeakOn(e,t,i=!1,r){const o=new b,l=()=>{!o.isDestroyed()&&o.destroy()};return o.dispose(this.disposableOn(e,t,i,r)),o.dispose(this.toDestroyEvent.disposableOn(l)),l}dwon(e,t,i=!1,r){return this.disposableWeakOn(e,t,i,r)}once(e,t,i=!1,r){const o=i?this._pipe.unshift(e,t,!0):this._pipe.push(e,t,!0);return r=r??new jr,r._reset(o,o._cid),r}disposableOnce(e,t,i=!1,r){const o=this.once(e,t,i,r);return()=>o.valid&&this.off(o)}donce(e,t,i=!1,r){const o=this.once(e,t,i,r);return()=>o.valid&&this.off(o)}off(e){if(!e.valid)throw new Error("handler is not valid!");this._pipe.remove(e._listenerHandler),e._reset()}reset(){this._pipe.removeAll()}destroyImp(){this.empty||(is("The event is destroying with listeners!"),this._pipe.removeAll())}}xl(v);function ss(n,s){return s=s??new sn,s._reset(n,n._cid),s}class Ad{constructor(){a(this,"__pipe")}get _pipe(){return this.__pipe=this.__pipe??new Ar,this.__pipe}get empty(){return!this.__pipe||this._pipe.empty}do(...s){return this._pipe.do(...s)}isHandlerValid(s){return s.valid?this._pipe.isHandlerValid(s._listenerHandler):!1}moveAfter(s,e){if(!s.valid||!e.valid)throw new Error("handler or nextHander is not valid!");return this._pipe.moveAfter(s._listenerHandler,e._listenerHandler)}moveBefore(s,e){if(!s.valid||!e.valid)throw new Error("handler or nextHander is not valid!");return this._pipe.moveAfter(s._listenerHandler,e._listenerHandler)}insertBefore(s,e,t,i=!1,r){if(!s.valid)throw new Error("handler is not valid!");const o=this._pipe.insertBefore(s._listenerHandler,e,t,i);return ss(o,r)}insertAfter(s,e,t,i=!1,r){if(!s.valid)throw new Error("handler is not valid!");const o=this._pipe.insertAfter(s._listenerHandler,e,t,i);return ss(o,r)}remove(s){if(!s.valid)throw new Error("handler is not valid!");return this._pipe.remove(s._listenerHandler)}removeAll(){return this._pipe.removeAll()}push(s,e,t=!1,i){const r=this._pipe.push(s,e,t);return ss(r,i)}pop(){return this._pipe.pop()}shift(){return this._pipe.shift()}unshift(s,e,t=!1,i){const r=this._pipe.unshift(s,e,t);return ss(r,i)}getTail(s){const e=this._pipe.tail;if(e)return ss(e,s)}getHead(s){const e=this._pipe.head;if(e)return ss(e,s)}}class ge extends b{constructor(e,t,i){super();a(this,"_changed");a(this,"_value");a(this,"_oldValue");a(this,"toChangeFunc");this._equalsFunc=t,this._assignFunc=i,this._value=this._assignFunc&&this._assignFunc(e,void 0)||e}get assignFunc(){return this._assignFunc}get equalsFunc(){return this._equalsFunc}equals(e){return this._equalsFunc?this._equalsFunc(this._value,e):this._value===e}set value(e){if(this._equalsFunc?!this._equalsFunc(this._value,e):this._value!==e){if(this.toChangeFunc&&!this.toChangeFunc(e,this._value))return;this._assignFunc?(this._oldValue=this._assignFunc(this._value,this._oldValue),this._value=this._assignFunc(e,this._value)):(this._oldValue=this._value,this._value=e),this._changed&&this._changed.emit(e,this._oldValue)}}get value(){return this._value}get changed(){return this._changed||(this._changed=this.disposeVar(new v)),this._changed}forceChange(){this._changed&&this._changed.emit(this._value,this._value)}}function w(n,s,e){return new ge(n,s,e)}function F(n){return new ge(n,(s,e)=>s.length!==e.length?!1:s.every((t,i)=>t===e[i]),(s,e)=>{const t=e||new Array(s.length);return t.length=s.length,s.forEach((i,r)=>t[r]=i),t})}function q(n){return w(n,(s,e)=>s===void 0||e===void 0?s===void 0&&e===void 0:s.length!==e.length?!1:s.every((t,i)=>t===e[i]),(s,e)=>{if(!s)return;const t=e||new Array(s.length);return t.length=s.length,s.forEach((i,r)=>t[r]=i),t})}function jn(n,s,e){return w(n,(t,i)=>t.length!==i.length?!1:t.every((r,o)=>s&&s(r,i[o])||r===i[o]),(t,i)=>{const r=i||new Array(t.length);return r.length=t.length,t.forEach((o,l)=>{r[l]=e?e(o):o}),r})}function Yt(n,s,e){return w(n,(t,i)=>t===void 0||i===void 0?t===void 0&&i===void 0:t.length!==i.length?!1:t.every((r,o)=>s&&s(r,i[o])||r===i[o]),(t,i)=>{if(!t)return;const r=i||new Array(t.length);return r.length=t.length,t.forEach((o,l)=>{r[l]=e?e(o):o}),r})}function B(n){return new ge(n,(s,e)=>s===e||s!==void 0&&e!==void 0&&JSON.stringify(s)===JSON.stringify(e),(s,e)=>{if(s!==void 0)return JSON.parse(JSON.stringify(s))})}function te(n){return new ge(n,(s,e)=>s===e||s!==void 0&&e!==void 0&&JSON.stringify(s)===JSON.stringify(e),(s,e)=>{if(s!==void 0)return JSON.parse(JSON.stringify(s))})}function jd(n){return new ge(n,(s,e)=>{if(s===e)return!0;if(s===void 0||e===void 0)return!1;const t=Object.keys(s),i=Object.keys(e);return t.length!==i.length?!1:t.every((r,o)=>r===i[o]&&s[r]===e[r])},(s,e)=>s&&{...s})}function Rd(n){return new ge(n,(s,e)=>{if(s===e)return!0;if(s===void 0||e===void 0)return!1;const t=Object.keys(s),i=Object.keys(e);return t.length!==i.length?!1:t.every((r,o)=>r===i[o]&&s[r]===e[r])},(s,e)=>s&&{...s})}function Nd(n){return jn(n,(s,e)=>s.every((t,i)=>t===e[i]),s=>[...s])}function Rr(n){return Yt(n,(s,e)=>s.every((t,i)=>t===e[i]),s=>[...s])}function Ld(n){return jn(n,(s,e)=>JSON.stringify(s)===JSON.stringify(e),s=>JSON.parse(JSON.stringify(s)))}function Vd(n){return Yt(n,(s,e)=>JSON.stringify(s)===JSON.stringify(e),s=>JSON.parse(JSON.stringify(s)))}function Nt(n){return Rr(n)}function Nr(n){return Yt(n,(s,e)=>s.length===e.length&&s.every((t,i)=>t.every((r,o)=>r===e[i][o])),s=>s.map(e=>[...e]))}function zd(n){return Yt(n,(s,e)=>s.length===e.length&&s.every((t,i)=>t.every((r,o)=>r===e[i][o])),s=>s.map(e=>[...e]))}function Rn(n){const s=n instanceof ge?[n,"value","changed"]:[...n];return s[2]=s[2]||s[1]+"Changed",s}function Lr(n,s,e,t=!1){s[2]=s[2]||s[1]+"Changed";const i=()=>{const r=s[0][s[1]];e?n[0][n[1]]=e(r):n[0][n[1]]=r};return i(),t?s[0][s[2]].disposableWeakOn(i):s[0][s[2]].disposableOn(i)}function Ud(n,s,e,t,i=!1){const r=Lr(n,s,e,i),o=Lr(s,n,t,i);return()=>(r(),o())}function _(n,s,e,t=!1){const i=n instanceof ge?[n,"value","changed"]:n,r=s instanceof ge?[s,"value","changed"]:s;return Lr(i,r,e,t)}function D(n,s,e,t,i=!1){const r=Rn(n),o=Rn(s);return Ud(r,o,e,t,i)}function Bd(n,s,e,t=!1){const[i]=tn(s);return D(n,s,r=>r??e,r=>{if(!(r===e&&i()===void 0))return r},t)}function ns(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(n){var s=Math.random()*16|0,e=n==="x"?s:s&3|8;return e.toString(16)})}function Nn(n,s){if(!globalThis||!globalThis.setTimeout||!globalThis.clearTimeout)throw new Error("目前只适合在浏览器中使用!");let e=0;function t(){e>0&&(globalThis.clearTimeout(e),e=0)}function i(...r){t(),e=globalThis.setTimeout(n,s,...r)}return[i,t]}function Vr(n,s,...e){const t=setInterval(n,s,...e);return()=>clearInterval(t)}function zr(n,s,...e){const t=setTimeout(n,s,...e);return()=>clearTimeout(t)}function Ln(n,...s){let e;const t=()=>{const i=performance.now();n(i,...s),e=requestAnimationFrame(t)};return t(),()=>typeof e<"u"&&(cancelAnimationFrame(e),e=void 0)}function rs(n,...s){let e;return e=requestAnimationFrame(()=>{const i=performance.now();n(i,...s)}),()=>typeof e<"u"&&(cancelAnimationFrame(e),e=void 0)}function nn(n,...s){let e=!1,t;return new Promise((i,r)=>{t=r,i()}).then(()=>{!e&&n(...s)}).catch(i=>{console.error(i)}),()=>(e=!0)&&t&&(t("nextMicroTask cancelled!"),t=void 0)}class Vn extends v{constructor(e,t,...i){super();a(this,"_cancellFunc");this._nextFunc=e,this.dispose(()=>{this._cancellFunc&&(this._cancellFunc(),this._cancellFunc=void 0)}),i.forEach(r=>this.dispose(r[t?"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 Ur extends Vn{constructor(...s){super(nn,!1,...s)}}function Wd(...n){return new Ur(...n)}class Hd extends Vn{constructor(...s){super(nn,!0,...s)}}function $d(...n){return new Ur(...n)}class zn extends Vn{constructor(...s){super(rs,!1,...s)}}function oe(...n){return new zn(...n)}function Gd(n,s){return new zn(...n).don(s())}class kl extends Vn{constructor(...s){super(rs,!0,...s)}}function Jd(...n){return new kl(...n)}function de(n,s,e={time:"don",immediate:!1}){const t=new zn(...Array.isArray(n)?n:[n]),i=t[e.time??"don"](s);return(e.immediate??!1)&&s(),()=>{i(),t.destroy()}}function rn(n){let s;if(typeof n.next=="function")s=n;else if(typeof n[Symbol.iterator]=="function")s=n[Symbol.iterator]();else throw new Error("iteratorOrIterable error!");return s}function Br(n,s){let e=!1;const t=rn(n);let i=-1;for(;;){const{done:r,value:o}=t.next();if(r)break;if(s(o,++i)){e=!0;break}}return e}function Wr(n,s){return!Br(n,(t,i)=>!s(t,i))}function on(n,s,e,t){const i=n;if(!i[s]){const r=t(),o=Object.fromEntries(Object.entries(r).filter(([l,h])=>{const c=Object.getPrototypeOf(e),u=l in c;if(u){const p=h instanceof ge?h.value:h;n[l]=p}return!u}).map(([l,h])=>h instanceof ge?[l,h]:[l,Array.isArray(h)?q(h):w(h)]));i[s]=o}return i[s]}function Kt(n,s){var t;const e=Symbol(`${(t=n==null?void 0:n.constructor)==null?void 0:t.name}-createDefaultProps`);n.constructor.__xbsj_dpSymbol=e,n.constructor.__xbsj_createDefaultProps=s;for(let[i,r]of Object.entries(s()))if(!Reflect.has(n,i)){const o=function(l){var u,p;if(l[e])return;const h=[];let c=Object.getPrototypeOf(l);for(;c;)h.push(c),c=Object.getPrototypeOf(c);h.reverse();for(let g of h){const m=(u=g.constructor)==null?void 0:u.__xbsj_dpSymbol;if(!m)continue;const y=(p=g.constructor)==null?void 0:p.__xbsj_createDefaultProps;y&&on(l,m,g,y)}};Object.defineProperties(n,{[i]:{get(){return o(this),on(this,e,n,s)[i].value},set(l){o(this);const h=on(this,e,n,s)[i];if(!h){console.error("!propObj");debugger}h.value=l}},[`${i}Changed`]:{get(){return o(this),on(this,e,n,s)[i].changed}},[`${i}React`]:{get(){return o(this),on(this,e,n,s)[i]}}})}}const an=new WeakMap;function vt(n,s,e){an.has(n)||an.set(n,{});const t=an.get(n);t[s]=e}function Ne(n,s){return an.has(n)?an.get(n)[s]:void 0}function _t(n,s){const e=rn(n);let t=0;for(;;){const{done:i,value:r}=e.next();if(i)break;s(r,t++)}}function ln(n,s,e){const t=rn(n);let i=e,r=0;for(;;){const{done:o,value:l}=t.next();if(o)break;i=s(i,l,r++)}return i}const qd=n=>++n;function Hr(n){return ln(n,qd,0)}function Lt(n){return ln(n,(s,e)=>s>e?s:e,Number.NEGATIVE_INFINITY)}function Zt(n){return ln(n,(s,e)=>s<e?s:e,Number.POSITIVE_INFINITY)}function Ml(n,s){let e=n;for(let t of s)e=e[t];return e}function Xd(n,s,e){if(s.length===0)throw new Error("props的数量必须大于0");const t=s.length-1,i=s[t];let r=n;for(let o=0;o<t;++o){const l=s[o];typeof r[l]>"u"&&(r[l]={}),r=r[l]}r[i]=e}function*_i(n,s){const e=rn(n);for(;;){const{done:t,value:i}=e.next();if(t)break;yield Ml(i,s)}}class hn extends b{constructor(){super();a(this,"_innerObj");a(this,"_toChangeEvent");a(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 v),this._toChangeEvent}get changedEvent(){return this._changedEvent||(this._changedEvent=new v),this._changedEvent}_resetArray(e){this._toChangeEvent&&this._toChangeEvent.emit([{start:0,deleteCount:this._innerObj.length,items:e}],this);const{length:t}=e;this._innerObj.length=t;for(let i=0;i<t;++i)this._innerObj[i]=e[i];this._changedEvent&&this._changedEvent.emit(this)}splice(e,t,...i){const{length:r}=this._innerObj;e=e>this._innerObj.length?this._innerObj.length:e,e>r?e=r:e<0&&(e+=r,e<0&&(e=0));const o=this._innerObj.length-e;if(t>o?t=o:t<0&&(t=0),arguments.length===1){this._toChangeEvent&&this._toChangeEvent.emit([{start:e,deleteCount:this._innerObj.length-e,items:[]}],this);const l=this._innerObj.splice(e);return this._changedEvent&&this._changedEvent.emit(this),l}else if(arguments.length===2){this._toChangeEvent&&this._toChangeEvent.emit([{start:e,deleteCount:t,items:[]}],this);const l=this._innerObj.splice(e,t);return this._changedEvent&&this._changedEvent.emit(this),l}else{this._toChangeEvent&&this._toChangeEvent.emit([{start:e,deleteCount:t,items:i}],this);const l=this._innerObj.splice(e,t,...i);return this._changedEvent&&this._changedEvent.emit(this),l}}pop(){if(this._innerObj.length===0)return;if(this._toChangeEvent){const t=this._innerObj.length-1,i=1,r=[];this._toChangeEvent.emit([{start:t,deleteCount:i,items:r}],this)}const e=this._innerObj.pop();return this._changedEvent&&this._changedEvent.emit(this),e}push(...e){if(this._toChangeEvent){const i=this._innerObj.length;this._toChangeEvent.emit([{start:i,deleteCount:0,items:e}],this)}const t=this._innerObj.push(...e);return this._changedEvent&&this._changedEvent.emit(this),t}get length(){return this._innerObj.length}set length(e){if(e<0)throw new Error("value < 0");const{length:t}=this._innerObj;if(t!==e){if(this._toChangeEvent){let i,r,o;t>e?(i=e,r=t-e,o=[]):(i=t,r=0,o=new Array(e-t)),this._toChangeEvent.emit([{start:i,deleteCount:r,items:o}],this)}this._innerObj.length=e,this._changedEvent&&this._changedEvent.emit(this)}}get(e){return this._innerObj[e]}set(e,t){const{length:i}=this._innerObj;if(e<0||e>=i)throw new Error("index < 0 || index >= length");this._toChangeEvent&&this._toChangeEvent.emit([{start:e,deleteCount:1,items:[t]}],this),this._innerObj[e]=t,this._changedEvent&&this._changedEvent.emit(this)}indexOf(e){return this._innerObj.indexOf(e)}[Symbol.iterator](){return this._innerObj[Symbol.iterator]()}}function $r(n,s,...e){let t=n;for(let i of e){if(!t[i])if(s)t[i]={};else return;t=t[i]}return t}function Yd(n,s,e){typeof e>"u"&&(s.endsWith(".gltf")?e="model/gltf+json":s.endsWith(".bin")?e="application/octet-stream":s.endsWith(".glb")?e="model/gltf-binary":s.endsWith(".jpg")||s.endsWith(".jpeg")?e="image/jpeg":s.endsWith(".png")?e="image/png":s.endsWith(".glsl")?e="text/plain":s.endsWith(".json")?e="application/json":s.endsWith(".b3dm")||s.endsWith(".i3dm")||s.endsWith("pnts")||s.endsWith("cmpt")?e="application/octet-stream":console.warn(`save ${s}: MimeType无法确定!`));const t=new Blob([n],{type:e||""});let i=URL.createObjectURL(t);var r=document.createElement("a"),o=new MouseEvent("click");r.download=s,r.href=i,r.dispatchEvent(o),URL.revokeObjectURL(i)}function Kd(n,s){const e=document.createElement("a"),t=new MouseEvent("click");e.download=s||"下载",e.href=n,e.dispatchEvent(t)}function Zd(){return new Promise((n,s)=>{const e=performance.now();requestAnimationFrame(t=>n(t>e))})}const Un=n=>{let s,e;return e=t=>{t=performance.now(),s=requestAnimationFrame(e),n(t)},s=requestAnimationFrame(e),()=>{cancelAnimationFrame(s)}};function Gr(n,s,e=Un){let t=Number.NEGATIVE_INFINITY,i;function r(h){h-t>s&&i&&(n(...i),i=void 0,t=h)}const o=e&&e(r)||void 0;function l(...h){i=h}return[l,o]}const Al=[];function jl(n,s,e){if(Al.includes(n)){console.warn(`_loadJs ${n} has loaded before!`),s&&s();return}var t=document.getElementsByTagName("head")[0],i=document.createElement("script");i.setAttribute("type","text/javascript"),i.setAttribute("src",n),i.onload=i.onreadystatechange=function(){this.readyState&&this.readyState!=="complete"||(Al.push(n),s&&s(),i.onload=i.onreadystatechange=null)},i.onerror=(r,o,l,h,c)=>{e(c)},t.appendChild(i)}function Jr(n,s=!0){if(s){const e=globalThis.L;globalThis.L&&(globalThis.L=void 0);const t=globalThis.define;return globalThis.define&&(globalThis.define=void 0),new Promise((i,r)=>{jl(n,i,r)}).then(()=>(globalThis.define=t,globalThis.L=e,Promise.resolve()))}else return new Promise((e,t)=>{jl(n,e,t)})}async function Rl(n,s=""){return new Promise((e,t)=>{var i=new Image;i.crossOrigin=s,i.src=n,i.onload=()=>e(i),i.onerror=r=>t(r)})}class Qd extends b{constructor(s){super(),this._owner=s}get owner(){return this._owner}}function Nl(n,s){if(n.length%3!==0)throw new Error("positions.length % 3 !== 0");const e=n.length/3;function*t(o){for(let l=0;l<e;++l)yield n[l*3+o]}const i=(s==null?void 0:s.min)??[NaN,NaN,NaN],r=(s==null?void 0:s.max)??[NaN,NaN,NaN];return i[0]=Zt(t(0))??NaN,i[1]=Zt(t(1))??NaN,i[2]=Zt(t(2))??NaN,r[0]=Lt(t(0))??NaN,r[1]=Lt(t(1))??NaN,r[2]=Lt(t(2))??NaN,{min:i,max:r}}async function eu(n,s=fetch){const e=await s(n);return e.ok?await e.arrayBuffer():void 0}class tu extends b{constructor(e){super();a(this,"_map",new Map);a(this,"_array",[]);a(this,"_createEvent",this.dv(new v));a(this,"_updateEvent",this.dv(new v));a(this,"_destroyEvent",this.dv(new v));this._idFunc=e,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(e,t={toDel:!0,toAdd:!0,toUpdate:!0}){const{toDel:i=!0,toAdd:r=!0,toUpdate:o=!0}=t;for(let h of this._array)h.updated=!1;const l=e.length;for(let h=0;h<l;++h){const c=e[h],u=this._idFunc(c,h);if(this._map.has(u)){if(o){const p=this._map.get(u);if(!p)throw new Error("!edwi");p.updated=!0,p.item=c,this._updateEvent.emit(u,c)}}else if(r){const p={item:c,id:u,updated:!0};this._array.push(p),this._map.set(u,p),this._createEvent.emit(u,c)}}if(i){const h=this._array.filter(c=>!c.updated);this._array=this._array.filter(c=>c.updated);for(let c of h)this._map.delete(c.id);for(let c of h)this._destroyEvent.emit(c.id,c.item)}}}function Bn(n,...s){if(n>16)throw new Error("length > 16");const e=new Array(n);for(let t=0;t<n;++t)e[t]=s[t]??0;return e}class Wn{constructor(s,e){this._xyzw=s,this._length=e}set 0(s){this._xyzw.x=s}set 1(s){this._xyzw.y=s}set 2(s){this._xyzw.z=s}set 3(s){this._xyzw.w=s}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 iu(n){return new Wn(n,2)}function su(n){return new Wn(n,3)}function nu(n){return new Wn(n,4)}class ru{constructor(s,e,t,i){this._array=s,this._length=e,this._start=t,this._stride=i}get length(){return this._length}set 0(s){this._array[this._start+0*this._stride]=s}set 1(s){this._array[this._start+1*this._stride]=s}set 2(s){this._array[this._start+2*this._stride]=s}set 3(s){this._array[this._start+3*this._stride]=s}set 4(s){this._array[this._start+4*this._stride]=s}set 5(s){this._array[this._start+5*this._stride]=s}set 6(s){this._array[this._start+6*this._stride]=s}set 7(s){this._array[this._start+7*this._stride]=s}set 8(s){this._array[this._start+8*this._stride]=s}set 9(s){this._array[this._start+9*this._stride]=s}set 10(s){this._array[this._start+10*this._stride]=s}set 11(s){this._array[this._start+11*this._stride]=s}set 12(s){this._array[this._start+12*this._stride]=s}set 13(s){this._array[this._start+13*this._stride]=s}set 14(s){this._array[this._start+14*this._stride]=s}set 15(s){this._array[this._start+15*this._stride]=s}set 16(s){this._array[this._start+16*this._stride]=s}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 ou(n,s,e=0,t=1){return new ru(n,s,e,t)}d.Vector=void 0,(n=>{function s(P,...O){if(P=P||Bn(O.length),O.length>P.length)throw new Error("args.length > target.length");return P instanceof Float64Array?P.set(O):mt(O,P),P}n.set=s;function e(P,O){const Z=P.length;for(let ce=0;ce<Z;++ce)if(!O(P[ce],ce))return!1;return!0}n.every=e;function t(P,O,Z){const ce=P.length;let je=Z;for(let Rt=0;Rt<ce;++Rt)je=O(je,P[Rt],Rt);return je}n.reduce=t;function*i(P){for(let O=0;O<P.length;++O)yield P[O]}n.itr=i;const r=(P,O)=>P+=O*O;function o(P){return t(P,r,0)}n.magnitudeSquared=o;function l(P){const O=o(P);return Math.sqrt(O)}n.magnitude=l;function h(P,O=1e-5){const Z=o(P);return Math.abs(Z-1)<O}n.isNormalized=h;let c;const u=(P,O,Z)=>P+O*c[Z];function p(P,O){return Q(P,O),c=O,t(P,u,0)}n.dot=p;let g;const m=(P,O,Z)=>P+=(O-g[Z])*(O-g[Z]);function y(P,O){return Q(P,O),g=O,t(P,m,0)}n.distanceSquared=y;function S(P,O){return Math.sqrt(y(P,O))}n.distance=S;let C;const T=(P,O)=>P===C[O];function V(P,O){return Q(P,O),C=O,e(P,T)}n.equals=V;let z,x;const $=(P,O)=>Math.abs(P-z[O])<x;function Y(P,O,Z=0){return Q(P,O),z=O,x=Z,e(P,$)}n.equalsEpsilon=Y;function Q(P,O){if(P.length!==O.length)throw new Error("left.length !== right.length")}function Ae(P,O,Z){const ce=P.length;Z=Z||Bn(ce),Q(P,Z);for(let je=0;je<ce;++je)Z[je]=O(P[je],je);return Z}n.op1=Ae;function qe(P,O,Z,ce){Q(P,O),ce&&Q(P,ce);const je=P.length;ce=ce||Bn(je);for(let Rt=0;Rt<je;++Rt)ce[Rt]=Z(P[Rt],O[Rt]);return ce}n.op2=qe;const jt=P=>P;function mt(P,O){return Ae(P,jt,O)}n.clone=mt;let fi=0;const mi=(P,O)=>P*fi;function El(P,O,Z){return fi=O,Ae(P,mi,Z)}n.multiplyByScalar=El;function qf(P,O,Z=0){const ce=o(P);if(ce<=Z)return;const je=Math.sqrt(ce);return El(P,1/je,O)}n.normalize=qf;function Xf(P,O){return El(P,-1,O)}n.negate=Xf;const Yf=P=>Math.abs(P);function Kf(P,O){return Ae(P,Yf,O)}n.abs=Kf;const Zf=P=>P-Math.floor(P);function Qf(P,O){return Ae(P,Zf,O)}n.fract=Qf;const em=(P,O)=>P-O;function tm(P,O,Z){return qe(P,O,em,Z)}n.subtract=tm;const im=(P,O)=>P+O;function sm(P,O,Z){return qe(P,O,im,Z)}n.add=sm;const nm=(P,O)=>P*O;function rm(P,O,Z){return qe(P,O,nm,Z)}n.multiply=rm;const om=(P,O)=>P/O;function am(P,O,Z){return qe(P,O,om,Z)}n.divide=am;let bl;const lm=(P,O)=>P*(1-bl)+O*bl;function hm(P,O,Z,ce){return bl=Z,qe(P,O,lm,ce)}n.lerp=hm})(d.Vector||(d.Vector={}));function Hn(n,s=0,e=1){return n<s?s:n>e?e:n}class $n extends b{constructor(e,t,i,r,o,l,h,c){super();a(this,"__status");a(this,"_statusChangedEvent");a(this,"_forceCancelFunc");a(this,"_startEvent");a(this,"_progressEvent");a(this,"_completeEvent");a(this,"_cancelEvent");a(this,"_cancelledEvent");a(this,"_errorEvent");a(this,"_finishedEvent");a(this,"_processingID",-1);this._startProcessingFunc=e,this.startFunc=t,this.progressFunc=i,this.completeFunc=r,this.cancelFunc=o,this.cancelledFunc=l,this.errorFunc=h,this.finishedFunc=c,this._status="Initial",this.dispose(()=>{var u;return(u=this._statusChangedEvent)==null?void 0:u.destroy()}),this.dispose(()=>{var u;return(u=this._startEvent)==null?void 0:u.destroy()}),this.dispose(()=>{var u;return(u=this._progressEvent)==null?void 0:u.destroy()}),this.dispose(()=>{var u;return(u=this._completeEvent)==null?void 0:u.destroy()}),this.dispose(()=>{var u;return(u=this._cancelEvent)==null?void 0:u.destroy()}),this.dispose(()=>{var u;return(u=this._cancelledEvent)==null?void 0:u.destroy()}),this.dispose(()=>{var u;return(u=this._errorEvent)==null?void 0:u.destroy()}),this.dispose(()=>{var u;return(u=this._finishedEvent)==null?void 0:u.destroy()}),this.dispose(()=>this.reset())}get startEvent(){return this._startEvent=this._startEvent||new v,this._startEvent}get progressEvent(){return this._progressEvent=this._progressEvent||new v,this._progressEvent}get completeEvent(){return this._completeEvent=this._completeEvent||new v,this._completeEvent}get cancelEvent(){return this._cancelEvent=this._cancelEvent||new v,this._cancelEvent}get cancelledEvent(){return this._cancelledEvent=this._cancelledEvent||new v,this._cancelledEvent}get errorEvent(){return this._errorEvent=this._errorEvent||new v,this._errorEvent}get finishedEvent(){return this._finishedEvent=this._finishedEvent||new v,this._finishedEvent}_completeFunc(e,t){this.processingID===e&&this._status==="Running"&&(this._status="Completed",this.completeFunc&&this.completeFunc(t),this._completeEvent&&this._completeEvent.emit(t),this.finishedFunc&&this.finishedFunc({status:"Completed",value:t}),this._finishedEvent&&this._finishedEvent.emit({status:"Completed",value:t}))}_cancelFunc(e){this._status==="Running"&&(this._status="Cancelling",this.cancelFunc&&this.cancelFunc(e),this._cancelEvent&&this._cancelEvent.emit(e))}_cancelledFunc(e){this._status==="Cancelling"&&(this._status="Cancelled",this.cancelledFunc&&this.cancelledFunc(e),this._cancelledEvent&&this._cancelledEvent.emit(e),this.finishedFunc&&this.finishedFunc({status:"Cancelled",cancelError:e}),this._finishedEvent&&this._finishedEvent.emit({status:"Cancelled",cancelError:e}))}_errorFunc(e,t){this.processingID===e&&this._status==="Running"&&(this._status="Error",this.errorFunc&&this.errorFunc(t),this._errorEvent&&this._errorEvent.emit(t),this.finishedFunc&&this.finishedFunc({status:"Error",error:t}),this._finishedEvent&&this._finishedEvent.emit({status:"Error",error:t}))}_progressFunc(e,t){this.processingID===e&&this._status==="Running"&&(this.progressFunc&&this.progressFunc(t),this._progressEvent&&this._progressEvent.emit(t))}_startFunc(...e){if(this._status==="Initial"){this._status="Running";const t=++this._processingID,i={completeFunc:this._completeFunc.bind(this,t),errorFunc:this._errorFunc.bind(this,t),progressFunc:this._progressFunc.bind(this,t),cancelFunc:this._cancel.bind(this,t),processingID:t},r=this._startProcessingFunc(i,...e);return this._forceCancelFunc=r,this.startFunc&&this.startFunc(...e),this._startEvent&&this._startEvent.emit(...e),t}else return console.warn("this._status !== 'Initial' but start again!"),-1}set _status(e){if(this.__status!==e){const t=this.__status;this.__status=e,this._statusChangedEvent&&this._statusChangedEvent.emit(e,t)}}get _status(){return this.__status}get processingID(){return this._processingID}get statusChangedEvent(){return this._statusChangedEvent||(this._statusChangedEvent=new v),this._statusChangedEvent}reset(e){this._status==="Running"&&this.cancel(e),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(e,t=this.processingID){return this._cancel(t,e)}_cancel(e,t){if(this.processingID===e)if(this._status==="Running"){if(!this._forceCancelFunc)throw new Error("this._forceCancelFunc is undefined!");this._cancelFunc(t);const i=this._forceCancelFunc(t);if(this._forceCancelFunc=void 0,i&&i instanceof Promise)return i.then(()=>{this._cancelledFunc(t)});this._cancelledFunc(t)}else console.warn("this._status !== 'Running' but cancel")}start(...e){try{return this._startFunc(...e)}catch(t){console.error(`processing start error: ${t}`)}}restart(e,...t){try{return this.isRunning&&this.cancel(e),this.isFinished&&this.reset(e),this.isInitial?this._startFunc(...t):(console.warn("restart failed!"),-1)}catch(i){console.error(`processing restart error: ${i}`)}}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 qr=class extends Error{};function Ll(n,s){typeof n=="function"?n(s):n.cancelFunc=s}class Xr extends $n{constructor(e=300){super(({progressFunc:t,completeFunc:i,errorFunc:r})=>{const[o,l]=Nn(()=>{if(!this._lastDebounceValue)throw new Error("!this._lastDebounceValue");t([this._lastDebounceValue,this._debouncTimes]),this._debouncTimes=0},this._delayTime);return this._d=o,()=>{l()}});a(this,"_lastDebounceValue");a(this,"_debouncTimes",0);a(this,"_d");this._delayTime=e}get delayTime(){return this._delayTime}debounce(...e){this.isRunning?(++this._debouncTimes,this._lastDebounceValue=e,this._d&&this._d()):console.warn("Debouncing is not running!")}}function Vl(n,s,...e){const t=new AbortController;let i=t.signal,[r,o]=e;if(o!=null&&o.signal)throw console.error("init?.signal"),new Error("init?.signal");o=o||{},o.signal=i;let l=!1;Ll(n,()=>{l=!0,t.abort()});let h=fetch(r,o);return s&&(h=h.then(c=>{if(!c.ok)return c;if(!c.body)throw Error("ReadableStream not yet supported in this browser.");const u=c.headers.get("content-length"),p=u?parseInt(u,10):0;let g=0;return new Response(new ReadableStream({start(m){if(!c.body)throw new Error("!response.body");const y=c.body.getReader();S();function S(){y.read().then(({done:C,value:T})=>{if(C){m.close();return}if(!T)throw new Error("!value");if(!s)throw new Error("!progressFunc");g+=T.byteLength,s(g,p),m.enqueue(T),S()}).catch(C=>{m.error(C)})}}}),{status:c.status,statusText:c.statusText,headers:c.headers})}).catch(c=>{throw l?(c instanceof Error&&c.code!==20&&console.error("error.code !== 20"),console.log("fetching cancelled!"),new qr("fetching cancelled!")):(c instanceof Error&&c.code===20&&console.error("error.code === 20"),c)})),h}function zl(...n){if(n.length>=1)if(typeof n[0]=="function"||typeof n[0]>"u"){const s={};let e=Vl(s,...n);const{cancelFunc:t}=s;if(!t)throw new Error("!cancelResult.cancelFunc");return[t,e]}else return Vl(...n);throw new Error("cancelableFetch args error!")}class au extends $n{constructor(e,...t){super(({progressFunc:i,completeFunc:r,errorFunc:o},...l)=>{const h={};let c={loaded:0,total:0};const u=(m,y)=>{c.loaded=m,c.total=y,i(c)},p=this._fetchArgs||l;if(p.length===0)throw new Error("fetchArgs.length === 0");if(zl(h,u,...p).then(e).then(r).catch(m=>{m instanceof qr||o(m)}),!h.cancelFunc)throw new Error("!cancelResult.cancelFunc");return h.cancelFunc});a(this,"_fetchArgs");t.length>0&&(this._fetchArgs=t)}get fetchArgs(){return this._fetchArgs}}function Yr(n,s,e,t){const i="_"+s,r="_"+s+"Changed",o=s+"Changed";Object.defineProperties(n.prototype,{[s]:{get(){return typeof this[i]>"u"&&typeof e<"u"&&(this[i]=e),this[i]},set(l){if(typeof this[i]>"u"&&typeof e<"u"&&(this[i]=e),t?!t(this[i],l):this[i]!==l){const h=this[i];this[i]=l,this[r]&&this[r].emit(l,h)}}},[o]:{get(){return typeof this[r]>"u"&&(this[r]=new v,typeof this.dispose<"u"&&this.dispose(()=>this[r].destroy())),this[r]}}})}class Kr extends $n{constructor(e,t=!0){super(({progressFunc:i,completeFunc:r,errorFunc:o})=>(this._intervalFunc=i,this._intervalID&&console.error("this._intervalID should be undefined!"),this.leading&&i(),this._intervalID=setInterval(i,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}));a(this,"_intervalID");a(this,"_intervalFunc");this.intervalTime=e,this.leading=t,this.dispose(this.intervalTimeChanged.disposableOn(()=>{this._intervalID&&this._intervalFunc&&(clearInterval(this._intervalID),this._intervalID=setInterval(this._intervalFunc,this.intervalTime))}))}}Yr(Kr,"leading",!0),Yr(Kr,"intervalTime",500);function lu(n,s){let e,t;const i=new Promise((o,l)=>{t=l,e=globalThis.setTimeout(()=>{e=void 0,o()},n)}),r=o=>{e&&(clearTimeout(e),e=void 0),t&&t(o??new qr("sleep cancel error!"))};if(typeof s=="boolean"&&s)return[r,i];if(s)return Ll(s,r),i}class hu{constructor(s=0,e=0,t=0,i,r){a(this,"_processData");a(this,"_lastUpdateTimeStamp",0);this.startTime=s,this.duration=e,this.delay=t,this.proccessFunc=i,this.completeFunc=r,this._processData={ratio:0,timeStamp:0,timeStampFromStart:0,timeStampFromLastUpdate:0}}update(s){const e=(s-this.startTime)/this.duration;e>=0&&(this._processData.ratio=e,this._processData.timeStamp=s,this._processData.timeStampFromStart=s-this.startTime,this._processData.timeStampFromLastUpdate=s-this._lastUpdateTimeStamp,this._lastUpdateTimeStamp=s,this.proccessFunc&&this.proccessFunc(this._processData),e>=1&&this.completeFunc&&this.completeFunc())}start(){this.startTime=performance.now()+this.delay,this._lastUpdateTimeStamp=this.startTime}}class Ul extends $n{constructor(e=1e3,t=0,i=Un){let r;function o(){r&&r()}super(({progressFunc:h,completeFunc:c,errorFunc:u})=>{const p=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=h,this._base.completeFunc=()=>{p&&p(),c()},this._base.start(),r=p,o});a(this,"_base");a(this,"duration");a(this,"delay");a(this,"startUpdateFunc");this._base=new hu,this.duration=e,this.delay=t,this.startUpdateFunc=i}get startTime(){return this._base.startTime}}class cu extends b{constructor(e){super();a(this,"_target",0);a(this,"_current",0);a(this,"_start",0);a(this,"_timing",new Ul(Number.POSITIVE_INFINITY));a(this,"_currentChanged");this._duration=e,this._timing.progressFunc=({ratio:t})=>{t=t<0?0:t>1?1:t;const i=this._start*(1-t)+this._target*t;this._current=i,this._currentChanged&&this._currentChanged.emit(this._target,this._current)},this.dispose(()=>{this._timing.isRunning&&this._timing.cancel(),this._timing.destroy()})}reset(e,t=e){this._timing.isRunning&&this._timing.cancel(),this._target=e,this._current=t,this._start=e}set target(e){if(this._target!==e){this._target=e,this._timing.isRunning&&this._timing.cancel(),this._timing.reset(),this._start=this._current;const t=Math.abs(this._target-this._start);this._timing.duration=t*this._duration,this._timing.start()}}get target(){return this._target}get current(){return this._current}get currentChanged(){return this._currentChanged||(this._currentChanged=new v),this._currentChanged}}function Bl(n,s){s=s||[];const e=n.parentNode;return e?Bl(e,s.concat(e)):s}function du(n){const s=n.composedPath&&n.composedPath()||n.path,e=n.target;if(s!=null)return s.indexOf(globalThis)<0?s.concat(globalThis):s;if(e===globalThis)return[globalThis];if(e===null)throw new Error("target === null");return[e].concat(Bl(e),globalThis)}function we(n,s=!1){const{offsetX:e,offsetY:t}=n;let i=e,r=t;{const o=du(n);for(let l=0;l<o.length;++l){const h=o[l];if(h!==n.currentTarget&&h instanceof HTMLElement)i+=h.clientLeft,r+=h.clientTop,i+=h.offsetLeft,r+=h.offsetTop;else break}}return s?[i*globalThis.devicePixelRatio,r*globalThis.devicePixelRatio]:[i,r]}function os(n,s=!1){const e=n.target,t=n.currentTarget||n.__xbsj_lastCurrentTarget__;if(!e||!t)return[n.clientX,n.clientY];const i=e.getBoundingClientRect(),r=t.getBoundingClientRect(),o=i.left+n.offsetX,l=i.top+n.offsetY,h=o-r.left,c=l-r.top;return s?[h*globalThis.devicePixelRatio,c*globalThis.devicePixelRatio]:[h,c]}class Wl extends b{constructor(e){super();a(this,"_clickEvent",new v);a(this,"_dbclickEvent",new v);a(this,"_downEvent",new v);a(this,"_upEvent",new v);a(this,"_moveEvent",new v);a(this,"_debouncing",new Xr(300));this.dispose(()=>{this._clickEvent.destroy(),this._dbclickEvent.destroy(),this._downEvent.destroy(),this._upEvent.destroy(),this._moveEvent.destroy(),this._debouncing.destroy()});let t=!1,i=[0,0],r=!1;this._debouncing.progressFunc=([[u,p,g],m])=>{m===1?this._clickEvent.emit(u,p,g):m>=2?this._dbclickEvent.emit(u,p,g):console.error("point click should not be here!")},this._debouncing.start(),this.dispose(()=>{this._debouncing.isRunning&&this._debouncing.cancel(),this._debouncing.destroy()});const o=u=>{t=!0;const[p,g]=we(u);i[0]=p,i[1]=g,this._downEvent.emit(p,g,u)},l=u=>{const[p,g]=we(u);t&&!r&&this._debouncing.debounce(p,g,u),t=!1,r=!1,this._upEvent.emit(p,g,u)},h=u=>{const[p,g]=we(u);if(t&&!r){const[m,y]=i;(Math.abs(p-m)>3||Math.abs(g-y)>3)&&(r=!0)}this._moveEvent.emit(p,g,u)},c=()=>{t=!1,r=!1};e.addEventListener("pointerdown",o),e.addEventListener("pointerup",l),e.addEventListener("pointermove",h),e.addEventListener("pointerout",c),this.dispose(()=>{e.removeEventListener("pointerdown",o),e.removeEventListener("pointerup",l),e.removeEventListener("pointermove",h),e.removeEventListener("pointerout",c)})}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 Zr extends b{constructor(){super();a(this,"_pickRectEvent",this.disposeVar(new v));a(this,"_updateRectEvent",this.disposeVar(new v));a(this,"_pointerActionEvent",this.disposeVar(new v));a(this,"_active",this.disposeVar(w(!1)));a(this,"_pickRect",{left0:0,top0:0,left1:0,top1:0});let e=0,t=0,i=0,r=0;this.dispose(this._pointerActionEvent.disposableOn(({type:o,left:l,top:h})=>{o==="PointerDown"?(this._active.value=!0,e=l,t=h,i=l,r=h,this._setPickRect({left0:e,top0:t,left1:i,top1:r}),this._updateRectEvent.emit(this._pickRect)):o==="PointerMove"?this._active.value&&(i=l,r=h,this._setPickRect({left0:e,top0:t,left1:i,top1:r}),this._updateRectEvent.emit(this._pickRect)):o==="PointerUp"&&this._active.value&&(this._active.value=!1,i=l,r=h,this._setPickRect({left0:e,top0:t,left1:i,top1:r}),this._updateRectEvent.emit(this._pickRect),this._pickRectEvent.emit(this._pickRect))}))}_setPickRect({left0:e,left1:t,top0:i,top1:r}){this._pickRect.left0=e,this._pickRect.left1=t,this._pickRect.top0=i,this._pickRect.top1=r}pointerDown(e,t){this._pointerActionEvent.emit({type:"PointerDown",left:e,top:t})}pointerMove(e,t){this._pointerActionEvent.emit({type:"PointerMove",left:e,top:t})}pointerUp(e,t){this._pointerActionEvent.emit({type:"PointerUp",left:e,top:t})}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(e,t){t=t||{left:0,top:0,width:0,height:0,forward:!0};const{left0:i,top0:r,left1:o,top1:l}=e;return t.width=Math.abs(i-o),t.height=Math.abs(r-l),t.left=Math.min(i,o),t.top=Math.min(r,l),t.forward=o>i,t}static contains(e,t,i){const{left:r,top:o,width:l,height:h}=i;return e>r&&e<=r+l&&t>=o&&t<=o+h}}class uu extends Zr{constructor(s){super();const e=this.disposeVar(new Wl(s));this.dispose(e.downEvent.disposableOn((o,l,h)=>h.altKey&&this.pointerDown(o,l))),this.dispose(e.moveEvent.disposableOn((o,l)=>this.pointerMove(o,l))),this.dispose(e.upEvent.disposableOn((o,l)=>this.pointerUp(o,l)));const t=document.createElement("div");t.style.backgroundColor="rgba(0, 0, 0, 0)",t.style.border="2px dashed red",t.style.position="absolute",t.style.boxSizing="border-box",t.style.pointerEvents="none",t.style.height="0px",t.style.width="0px",t.style.left="0px",t.style.top="0px",t.style.display="none",s.appendChild(t),this.dispose(()=>s.removeChild(t)),this.dispose(this.activeEvent.disposableOn(o=>{t.style.display=o?"block":"none"}));const i=()=>{this.reset()};s.addEventListener("contextmenu",i),this.dispose(()=>s.removeEventListener("contextmenu",i));const r={left:0,top:0,width:0,height:0,forward:!1};this.dispose(this.updateRectEvent.disposableOn(o=>{if(Zr.getLeftTopAndSize(o,r)){const{left:l,top:h,width:c,height:u}=r;t.style.height=`${u|0}px`,t.style.width=`${c|0}px`,t.style.left=`${l|0}px`,t.style.top=`${h|0}px`}}))}}class st extends Error{}function Qt(n,s){Ne(n,"_promise_cancel")&&console.warn("setPromiseCancel warn: promise has cancelFunc!"),vt(n,"_promise_cancel",s)}function as(n){return Ne(n,"_promise_cancel")}function ls(n){return!!as(n)}function Qr(n,s){const e=as(n);return e?(e(s),!0):!1}function eo(n){const[s,e]=n;return Qt(e,s),e}function hs(n){let s;const e=new Promise((t,i)=>{s=i,n.then(t).catch(i)});return Qt(e,s),e}function pu(n){let s,e;var t=new Promise((i,r)=>{e=n.disposableOn((...o)=>{e&&e(),i(o)}),s=o=>{e&&e(),r(o)}});return[s,t]}function gu(n){const s=new v,e=new v;return n.then(t=>{s.isDestroyed()||s.emit(t)}).catch(t=>{e.isDestroyed()||e.emit(t)}),[s,e]}class to extends b{constructor(){super();a(this,"_cancelled",!1);a(this,"_cancelError");a(this,"_promiseSet",new Set);a(this,"_disposer")}get disposer(){return this._disposer=this._disposer||new b,this._disposer}destroyImp(){this.finally()}cancel(e){var t;if(!this._cancelled){this._cancelled=!0,(t=this._disposer)==null||t.destroy(),this._cancelError=e;for(let i of this._promiseSet)Qr(i);this._promiseSet.clear()}}get cancelFuncsNum(){return ln(this._promiseSet,e=>e+1,0)}finally(){this._disposer&&!this._disposer.isDestroyed()&&this._disposer.destroy(),this._promiseSet.clear()}check(){if(this._cancelled)throw this._cancelError??new st("cancel from CancelManager!")}promise(e){return this._promiseSet.add(e),e.finally(()=>(this._promiseSet.delete(e),this.check()))}promiseAny(e){const t=[],i=e.map(r=>(this._promiseSet.add(r),ls(r)&&t.push(as(r)),r.finally(()=>this._promiseSet.delete(r))));return Promise.any(i).finally(()=>(t.forEach((r=>r(new st("cancel from promiseAny!")))),t.length=0))}promiseAll(e){const t=[],i=e.map(r=>(this._promiseSet.add(r),ls(r)&&t.push(as(r)),r.finally(()=>this._promiseSet.delete(r))));return Promise.all(i).finally(()=>(t.forEach((r=>r(new st("cancel from promiseAll!")))),t.length=0))}promiseRace(e){const t=[],i=e.map(r=>(this._promiseSet.add(r),ls(r)&&t.push(as(r)),r.finally(()=>this._promiseSet.delete(r))));return Promise.race(i).finally(()=>(t.forEach((r=>r(new st("cancel from promiseRace!")))),t.length=0))}}class fe extends b{constructor(e){super();a(this,"_status","Initial");a(this,"_completeEvent");a(this,"_errorEvent");a(this,"_completeFunc");a(this,"_errorFunc");a(this,"_cancelFunc");a(this,"_runningId",-1);this._startFunc=e,this.dispose(()=>this.isRunning&&this.cancel())}get errorEvent(){return this._errorEvent||(this._errorEvent=new v),this._errorEvent}get completeEvent(){return this._completeEvent||(this._completeEvent=new v),this._completeEvent}get errorFunc(){return this._errorFunc}get completeFunc(){return this._completeFunc}set errorFunc(e){this._errorFunc!==e&&(this._errorFunc=e)}set completeFunc(e){this._completeFunc!==e&&(this._completeFunc=e)}start(...e){if(this._status!=="Initial")return;const t=++this._runningId;this._status="Running",this._cancelFunc=this._startFunc({completeFunc:i=>{var r;t===this._runningId&&this._status==="Running"&&(this._status="Completed",this._completeFunc&&this._completeFunc(i),(r=this._completeEvent)==null||r.emit(i))},errorFunc:i=>{var r;t===this._runningId&&this._status==="Running"&&(this._status="Error",this._errorFunc&&this._errorFunc(i),(r=this._errorEvent)==null||r.emit(i))},runningingID:t},...e)}cancel(e=new st("")){var t;if(this._status==="Running"){if(!this._cancelFunc)throw new Error("!this._cancelFunc");this._status="Error",this._errorFunc&&this._errorFunc(e),(t=this._errorEvent)==null||t.emit(e),this._cancelFunc(e),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(e=new st(""),...t){this.isRunning&&this.cancel(e),this.reset(),this.start(...t)}restartIfNotRunning(...e){this.isRunning||(this.reset(),this.start(...e))}}function cn(n){return(s,...e)=>{const t=new to,{completeFunc:i,errorFunc:r}=s,o=n(t,...e).then(i).catch(r).finally(()=>t.destroy());return Qt(o,t.cancel.bind(t)),l=>Qr(o,l)}}class fu extends fe{constructor(){super(({errorFunc:e},t,i)=>{try{const[r,o]=Nn(t,i);return this._doFunc=r,o}catch(r){return e(r),()=>{}}});a(this,"_doFunc")}do(...e){this._doFunc&&this._doFunc(...e)}}class mu extends fe{constructor(e,t){super(({errorFunc:i})=>{try{const[r,o]=Nn(e,t);return this._doFunc=r,o}catch(r){return i(r),()=>{}}});a(this,"_doFunc")}do(...e){this._doFunc&&this._doFunc(...e)}}function vu(n){return new fe(cn((s,...e)=>s.promise(n(...e))))}function _u(n,...s){return new fe(cn(e=>e.promise(n(...s))))}function Gn(n){return vu((...s)=>{const e=n(...s);return ls(e)?e:hs(e)})}function io(n,...s){return _u(()=>{const e=n(...s);return ls(e)?e:hs(e)})}function yu(n){let s;const e=new Promise((t,i)=>{s=()=>{n(),i()}});return Qt(e,s),e}function wu(n,...s){const e=new to,t=n(e,...s).finally(()=>e.destroy());return Qt(t,e.cancel.bind(e)),t}function Le(n){return new fe(cn(n))}function Eu(n,...s){return new fe(cn(e=>n(e,...s)))}function Hl(n,...s){const e=new AbortController;let t=e.signal,[i,r]=s;if(r!=null&&r.signal)throw console.error("init?.signal"),new Error("init?.signal");r=r||{},r.signal&&console.warn("revocableFetch error: init.signal would be override!"),r.signal=t;let o=!1;const l=()=>{o=!0,e.abort()};let h=fetch(i,r);return n&&(h=h.then(c=>{if(!c.ok)return c;if(!c.body)throw Error("ReadableStream not yet supported in this browser.");const u=c.headers.get("content-length");u||console.warn("response.headers.get('content-length') is undefined... cannot get contentLength!");const p=u?parseInt(u,10):0;let g=0;return new Response(new ReadableStream({start(m){if(!c.body)throw new Error("!response.body");const y=c.body.getReader();S();function S(){y.read().then(({done:C,value:T})=>{if(C){m.close();return}if(!T)throw new Error("!value");if(!n)throw new Error("!progressFunc");g+=T.byteLength,n(g,p),m.enqueue(T),S()}).catch(C=>{m.error(C)})}}}),{status:c.status,statusText:c.statusText,headers:c.headers})}).catch(c=>{throw o?(c instanceof Error&&c.code!==20&&console.error("error.code !== 20"),console.log("fetching cancelled!"),new st(`fetching cancelled! error: ${c}`)):(c instanceof Error&&c.code===20&&console.error("error.code === 20"),c)})),Qt(h,l),h}function bu(n,...s){return Hl(n,...s)}function so(...n){return Hl(void 0,...n)}function Su(){return Gn(so)}function Cu(...n){return io(so,...n)}function no(n,...s){let e=-1;var t=new Promise((i,r)=>{n.isRunning&&n.cancel(),n.reset();const o=new b;o.dispose(n.completeEvent.disposableOn(l=>{if(i(l),o.isDestroyed()){debugger;console.error(`disposer is destroyed! ${o}`);return}o.destroy()})),o.dispose(n.errorEvent.disposableOn(l=>{if(r(l),o.isDestroyed()){debugger;console.error(`disposer is destroyed! ${o}`);return}o.destroy()})),n.start(...s),e=n.runningId});return[i=>e===n.runningId&&n.isRunning&&n.cancel(i),t]}function yt(n,s,...e){try{return s(...e)}catch(t){n(t)}}function Pu(){return new fe(({completeFunc:n,errorFunc:s},e)=>rs(()=>yt(s,()=>{e&&e(),n()})))}function Tu(n){return new fe(({completeFunc:s,errorFunc:e})=>rs(()=>yt(e,()=>{n&&n(),s()})))}function Iu(){return new fe(({completeFunc:n,errorFunc:s},e)=>nn(()=>{yt(s,()=>{e&&e(),n()})}))}function xu(n){return new fe(({completeFunc:s,errorFunc:e})=>nn(()=>{yt(e,()=>{n&&n(),s()})}))}function $l(){return new fe(({completeFunc:n,errorFunc:s},e,t)=>zr(()=>{yt(s,()=>{e&&e(),n()})},t??1e3))}function Gl(n,s){return new fe(({completeFunc:e,errorFunc:t})=>zr(()=>{yt(t,()=>{n&&n(),e()})},s??1e3))}function Ou(){return new fe(({errorFunc:n},s,e=1e3)=>Vr(()=>yt(n,s),e))}function Du(n,s=1e3){return new fe(({errorFunc:e})=>Vr(()=>yt(e,n),s))}function dn(){return new fe(({errorFunc:n},s)=>Ln(e=>yt(n,s,e)))}function cs(n){return new fe(({errorFunc:s})=>Ln(e=>yt(s,n,e)))}function un(n,...s){let e,t;const i=new Promise((o,l)=>{t=l,e=globalThis.setTimeout(()=>{e=void 0,o(s)},n)});return Qt(i,o=>{e&&(clearTimeout(e),e=void 0),t&&t(o??new st("sleep cancel error!"))}),i}function Fu(){return Gn(un)}function ku(n,...s){return io(un,n,...s)}function yi(n,s,...e){return n.promise(eo(no(Le(async(t,...i)=>(n.disposer.dispose(()=>{t.isDestroyed()||t.cancel()}),await s(t,...i))),...e)))}function Mu(n,s,...e){return n.promise(eo(no(s,...e)))}class Au extends fe{constructor(){super(({errorFunc:e},t,i)=>{try{const[r,o]=Gr(t,i);return this._doFunc=r,o}catch(r){return e(r),()=>{}}});a(this,"_doFunc")}do(...e){this._doFunc&&this._doFunc(...e)}}class ju extends fe{constructor(e,t){super(({errorFunc:i})=>{try{const[r,o]=Gr(e,t);return this._doFunc=r,o}catch(r){return i(r),()=>{}}});a(this,"_doFunc")}do(...e){this._doFunc&&this._doFunc(...e)}}class Jn extends b{constructor(e=1e3,t=Un){super();a(this,"_speed");a(this,"_speedChangedEvent");a(this,"_duration");a(this,"_durationChangedEvent");a(this,"_loop");a(this,"startUpdateFunc");a(this,"_updateBindThis");a(this,"_cancelStartUpdateFunc");a(this,"_startTimeStamp");a(this,"_playingChangedEvent");a(this,"_startPlayingEvent");a(this,"_stopPlayingEvent");a(this,"_loopChangedEvent");a(this,"_currentTime",this.disposeVar(w(0)));this._speed=1,this._duration=e,this._loop=!1,this.startUpdateFunc=t,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 v,this._startPlayingEvent}get stopPlayingEvent(){return this._stopPlayingEvent=this._stopPlayingEvent||new v,this._stopPlayingEvent}get currentTimeChangedEvent(){return this._currentTime.changed}get loopChangedEvent(){return this._loopChangedEvent=this._loopChangedEvent||new v,this._loopChangedEvent}set loop(e){this._loop!==e&&(this._loop=e,this._loopChangedEvent&&this._loopChangedEvent.emit(this._loop))}get loop(){return this._loop}_update(e){if(Number.isNaN(this._startTimeStamp))console.warn("Number.isNaN(this._startTimeStamp)");else{const t=(e-this._startTimeStamp)*this._speed;this._setCurrentTimeInner(t)}}get currentTime(){return this._currentTime.value}set currentTime(e){this._setCurrentTimeInner(e),this._resetStartTime()}_setCurrentTimeInner(e){this._currentTime.value!==e&&(this._duration<=0?this._currentTime.value=0:e<0?this.loop?this._currentTime.value=this._duration+e%this._duration:(this._currentTime.value=0,this.playing&&this._stopPlaying()):e>this._duration?this.loop?this._currentTime.value=e%this._duration:(this._currentTime.value=this._duration,this.playing&&this._stopPlaying()):this._currentTime.value=e)}get durationChangedEvent(){return this._durationChangedEvent||(this._durationChangedEvent=new v),this._durationChangedEvent}get duration(){return this._duration}set duration(e){var t;if(e<0)console.warn("duration sholud greater than 0!");else if(this._duration!==e){const i=this._duration;this._duration=e,this._currentTime.value>this._duration&&(this._currentTime.value=this._duration),(t=this._durationChangedEvent)==null||t.emit(this._duration,i)}}get speedChangedEvent(){return this._speedChangedEvent||(this._speedChangedEvent=new v),this._speedChangedEvent}get speed(){return this._speed}set speed(e){var t;if(this._speed!==e&&e!==0){const i=this._speed;this._speed=e,this._resetStartTime(),(t=this._speedChangedEvent)==null||t.emit(this._speed,i)}}_resetStartTime(){this._startTimeStamp=performance.now()-this._currentTime.value/this._speed}_startPlaying(){var e,t;this._resetStartTime(),this._cancelStartUpdateFunc=this.startUpdateFunc(this._updateBindThis),(e=this._startPlayingEvent)==null||e.emit(this._currentTime.value),(t=this._playingChangedEvent)==null||t.emit(!0)}_stopPlaying(){var e,t;if(!this._cancelStartUpdateFunc)throw new Error("this._cancelStartUpdateFunc is undefined!");this._cancelStartUpdateFunc(),this._cancelStartUpdateFunc=void 0,(e=this._stopPlayingEvent)==null||e.emit(this._currentTime.value),(t=this._playingChangedEvent)==null||t.emit(!1)}get playingChangedEvent(){return this._playingChangedEvent||(this._playingChangedEvent=new v),this._playingChangedEvent}get playing(){return!!this._cancelStartUpdateFunc}set playing(e){!!this._cancelStartUpdateFunc!==e&&(e?this._startPlaying():this._stopPlaying())}}class pn extends b{constructor(e){super();a(this,"_stop",this.disposeVar(w(0)));a(this,"_current",this.disposeVar(w(0)));a(this,"_start",this.disposeVar(w(0)));a(this,"_player",this.disposeVar(new Jn(200)));this.dispose(this._player.currentTimeChangedEvent.disposableOn(t=>{let i=t/this._player.duration;i=i>1?1:i<0?0:i;const r=this._start.value,o=this._stop.value;this._current.value=r+(o-r)*i})),this.duration=e}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(e){this._player.duration=e}set target(e){this._start.value=this._current.value,this._stop.value=e,this._player.currentTime=0,this._player.playing=!0}reset(e){this._start.value=e,this._current.value=e,this._stop.value=e,this._player.playing=!1}}let Jl=-1;class se extends v{constructor(s,e,t,i){super(),this._domElement=s,this._type=e,this.callback=i;const r=o=>(o.__xbsj_listenerNo__=++Jl,o.__xbsj_listenerTime__=Date.now(),o.__xbsj_lastCurrentTarget__=o.currentTarget,this.emit(o),this.callback&&this.callback(o));this._domElement.addEventListener(this._type,r,t),this.dispose(()=>this._domElement.removeEventListener(this._type,r,t))}static getLastLisenNo(){return Jl}static getCurrentTarget(s){return s.__xbsj_lastCurrentTarget__}static getListenerNo(s){return s.__xbsj_listenerNo__}static getListenerTime(s){return s.__xbsj_listenerTime__}static on(s,e){const t=se.getLastLisenNo();return s.disposableOn(i=>{const r=se.getListenerNo(i);(r===void 0||r>t)&&e(i)})}get element(){return this._domElement}static create(s,e,t){return new se(s,e,t)}}class ro extends b{constructor(){super();a(this,"_clickEvent",this.disposeVar(new v));a(this,"_dbclickEvent",this.disposeVar(new v));a(this,"_pointerdownEvent",this.disposeVar(new v));a(this,"_pointerupEvent",this.disposeVar(new v));a(this,"_pointermoveEvent",this.disposeVar(new v));a(this,"_pointeroutEvent",this.disposeVar(new v));a(this,"dbClickDelayTime",300);a(this,"nativeClickDelayTime",500);a(this,"clickMovementTolerantPixelSize",3);a(this,"debugging",!1);a(this,"_enabled",this.disposeVar(w(!0)));const e=this.disposeVar(Le(async i=>{do{const r=await yi(i,h=>new Promise((c,u)=>{h.disposer.dispose(u),h.disposer.dispose(se.on(this._pointerdownEvent,c))})),o=we(r);if(this.debugging&&console.log(`鼠标按下 ${o.toString()}`),!await yi(i,h=>new Promise((c,u)=>{h.disposer.dispose(u);const p=setTimeout(()=>c(!0),this.nativeClickDelayTime);h.disposer.dispose(()=>clearTimeout(p)),h.disposer.dispose(se.on(this._pointermoveEvent,g=>{const[m,y]=we(g),[S,C]=o;(Math.abs(m-S)>3||Math.abs(y-C)>3)&&c(!1)})),h.disposer.dispose(se.on(this._pointeroutEvent,()=>c(!1))),h.disposer.dispose(se.on(this._pointerupEvent,()=>c(!0)))}))){this.debugging&&console.log("取消1");continue}const l=await yi(i,h=>new Promise((c,u)=>{h.disposer.dispose(u);const p=setTimeout(()=>c("timeout"),this.dbClickDelayTime);h.disposer.dispose(()=>clearTimeout(p)),h.disposer.dispose(se.on(this._pointermoveEvent,g=>{const[m,y]=we(g),[S,C]=o;(Math.abs(m-S)>3||Math.abs(y-C)>3)&&c("moved")})),h.disposer.dispose(se.on(this._pointerdownEvent,c)),h.disposer.dispose(se.on(this._pointeroutEvent,()=>c("pointouted"))),h.disposer.dispose(se.on(this._pointerupEvent,()=>c("pointuped")))}));if(typeof l=="string"){this.debugging&&console.log(`触发单击事件!取消双击监听!error: ${l}`),this._clickEvent.emit(r);continue}if(!await yi(i,h=>new Promise((c,u)=>{h.disposer.dispose(u);const p=setTimeout(()=>c(!1),this.nativeClickDelayTime);h.disposer.dispose(()=>clearTimeout(p)),h.disposer.dispose(se.on(this._pointermoveEvent,g=>{const[m,y]=we(g),[S,C]=o;(Math.abs(m-S)>3||Math.abs(y-C)>3)&&c(!1)})),h.disposer.dispose(se.on(this._pointeroutEvent,()=>c(!1))),h.disposer.dispose(se.on(this._pointerupEvent,()=>c(!0)))}))){this.debugging&&console.log("取消2");continue}this.debugging&&console.log("触发双击事件!"),this._dbclickEvent.emit(l)}while(!0)})),t=i=>{i?e.restart():e.isRunning&&e.cancel()};t(this.enabled),this.dispose(this.enabledChanged.disposableOn(t))}get clickEvent(){return this._clickEvent}get dbclickEvent(){return this._dbclickEvent}pointerDown(e){this._pointerdownEvent.emit(e)}pointerUp(e){this._pointerupEvent.emit(e)}pointerMove(e){this._pointermoveEvent.emit(e)}pointerOut(e){this._pointeroutEvent.emit(e)}get enabled(){return this._enabled.value}set enabled(e){this._enabled.value=e}get enabledChanged(){return this._enabled.changed}}class Ru extends b{constructor(e,t){super();a(this,"_pointerClick",this.disposeVar(new ro));this._div=e;const{div:i,pointerClick:r}=this,o=u=>r.pointerDown(u),l=u=>r.pointerMove(u),h=u=>r.pointerOut(u),c=u=>r.pointerUp(u);i.addEventListener("pointerdown",o,t),i.addEventListener("pointermove",l,t),i.addEventListener("pointerout",h,t),i.addEventListener("pointerup",c,t),this.dispose(()=>{i.removeEventListener("pointerdown",o,t),i.removeEventListener("pointermove",l,t),i.removeEventListener("pointerout",h,t),i.removeEventListener("pointerup",c,t)})}get div(){return this._div}get pointerClick(){return this._pointerClick}get clickEvent(){return this.pointerClick.clickEvent}get dbclickEvent(){return this.pointerClick.dbclickEvent}}class ql extends b{constructor(){super();a(this,"_hoverEvent",this.disposeVar(new v));a(this,"_hoverOutEvent",this.disposeVar(new v));a(this,"_pointerdownEvent",this.disposeVar(new v));a(this,"_pointerupEvent",this.disposeVar(new v));a(this,"_pointermoveEvent",this.disposeVar(new v));a(this,"_pointeroutEvent",this.disposeVar(new v));a(this,"delayTime",800);const e=this.disposeVar($l()),t=c=>{this._hoverOutEvent.emit()},i=c=>{this._hoverOutEvent.emit()};let r;const o=()=>{if(!r){console.warn("!lastPointerEvent");return}this._hoverEvent.emit(r)},l=c=>{r=c,e.restart(void 0,o,this.delayTime),this._hoverOutEvent.emit()},h=c=>{e.cancel(),this._hoverOutEvent.emit()};this.dispose(this._pointerdownEvent.disposableOn(t)),this.dispose(this._pointerupEvent.disposableOn(i)),this.dispose(this._pointermoveEvent.disposableOn(l)),this.dispose(this._pointeroutEvent.disposableOn(h))}get hoverEvent(){return this._hoverEvent}get hoverOutEvent(){return this._hoverOutEvent}pointerDown(e){this._pointerdownEvent.emit(e)}pointerUp(e){this._pointerupEvent.emit(e)}pointerMove(e){this._pointermoveEvent.emit(e)}pointerOut(e){this._pointeroutEvent.emit(e)}}class Nu extends b{constructor(e,t=1500){super();a(this,"_hoverEvent",new v);a(this,"_hoverOutEvent",new v);const i=new Xr(t);this.dispose(()=>i.destroy());let r=0,o=0,l;i.progressFunc=()=>this._hoverEvent.emit(r,o,l);const h=g=>{!i.isRunning&&i.restart(),l=g,[r,o]=we(g),i.debounce(),this._hoverOutEvent.emit()},c=g=>{!i.isRunning&&i.restart(),l=g,[r,o]=we(l),i.debounce(),this._hoverOutEvent.emit()},u=g=>{!i.isRunning&&i.restart(),l=g,[r,o]=we(l),i.debounce(),this._hoverOutEvent.emit()},p=g=>{i.isRunning&&i.cancel(),this._hoverOutEvent.emit()};e.addEventListener("pointerdown",h),e.addEventListener("pointerup",c),e.addEventListener("pointermove",u),e.addEventListener("pointerout",p),this.dispose(()=>{e.removeEventListener("pointerdown",h),e.removeEventListener("pointerup",c),e.removeEventListener("pointermove",u),e.removeEventListener("pointerout",p)})}get hoverEvent(){return this._hoverEvent}get hoverOutEvent(){return this._hoverOutEvent}}class Xl extends b{constructor(e,t={}){super();a(this,"_needRedrawEvent");a(this,"_needPickRedrawEvent");a(this,"_id",ns());a(this,"_clickEvent");a(this,"_clickOutEvent");a(this,"_dbclickEvent");a(this,"_dbclickOutEvent");a(this,"_actived",!1);a(this,"_activedChanged");a(this,"_hovered",!1);a(this,"_hoveredChanged");a(this,"_selected",!1);a(this,"_selectedChanged");a(this,"_opacity",1);a(this,"_opacityChanged");a(this,"_show",!0);a(this,"_showChanged");this._canvasPrimitivesContext=e;const{needRedraw:i=!0,needPickRedraw:r=!0}=t;i&&(this._needRedrawEvent=new v),r&&(this._needPickRedrawEvent=new v),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(e){this._id=e}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 v,this._clickEvent}hasClickOutEvent(){return!!this._clickOutEvent}get clickOutEvent(){return this._clickOutEvent=this._clickOutEvent||new v,this._clickOutEvent}hasDbclickEvent(){return!!this._dbclickEvent}get dbclickEvent(){return this._dbclickEvent=this._dbclickEvent||new v,this._dbclickEvent}hasDbclickOutEvent(){return!!this._dbclickOutEvent}get dbclickOutEvent(){return this._dbclickOutEvent=this._dbclickOutEvent||new v,this._dbclickOutEvent}set actived(e){this._actived!==e&&(this._actived=e,this._activedChanged&&this._activedChanged.emit(e,this))}get actived(){return this._actived}get activedChanged(){return this._activedChanged=this._activedChanged||new v,this._activedChanged}set hovered(e){this._hovered!==e&&(this._hovered=e,this._hoveredChanged&&this._hoveredChanged.emit(e,this))}get hovered(){return this._hovered}get hoveredChanged(){return this._hoveredChanged=this._hoveredChanged||new v,this._hoveredChanged}set selected(e){this._selected!==e&&(this._selected=e,this._selectedChanged&&this._selectedChanged.emit(e,this))}get selected(){return this._selected}get selectedChanged(){return this._selectedChanged=this._selectedChanged||new v,this._selectedChanged}set opacity(e){this._opacity!==e&&(this._opacity=e,this._opacityChanged&&this._opacityChanged.emit(e,this))}get opacity(){return this._opacity}get opacityChanged(){return this._opacityChanged=this._opacityChanged||new v,this._opacityChanged}set show(e){this._show!==e&&(this._show=e,this._showChanged&&this._showChanged.emit(e,this))}get show(){return this._show}get showChanged(){return this._showChanged=this._showChanged||new v,this._showChanged}}class oo extends Xl{constructor(e,t=[0,0],i=0){super(e);a(this,"_winPosAndDepthChanged");this._winPos=t,this._depth=i,this.dispose(this.winPosAndDepthChanged.disposableOn(()=>{this.needRedraw(),this.needPickRedraw()}))}set winPos(e){(this._winPos[0]!==e[0]||this._winPos[1]!==e[1])&&(this._winPos[0]=e[0],this._winPos[1]=e[1],this._winPosAndDepthChanged&&this._winPosAndDepthChanged.emit(this._winPos,this._depth))}get winPos(){return this._winPos}set depth(e){this._depth!==e&&(this._depth=e,this._winPosAndDepthChanged&&this._winPosAndDepthChanged.emit(this._winPos,this._depth))}get depth(){return this._depth}get winPosAndDepthChanged(){return this._winPosAndDepthChanged||(this._winPosAndDepthChanged=new v),this._winPosAndDepthChanged}}function wi(n,s,e,t){const[i,r]=n,[o,l,h,c]=t,u=s[0]*e[0],p=s[1]*e[1],g=i-(u*o+h),m=r-(p*l+c);return{left:g,top:m,right:g+u,bottom:m+p}}function Ei(n,s,e,t,i){n.beginPath(),n.moveTo(s,e),n.lineTo(s-t*.5,e-t*.5),n.arc(s,e-t,t*.7071067811865475,Math.PI*.75,Math.PI*.25),n.lineTo(s,e),n.fillStyle=i,n.fill()}function Lu(n,s,e,t,i,r){if(n.beginPath(),n.moveTo(s+t,e),n.arc(s,e,t,0,2*Math.PI),r){const o=n.createRadialGradient(s,e,0,s,e,t);o.addColorStop(0,i),o.addColorStop(1,i.replace(/[\d\.]+\)$/,"0)")),n.fillStyle=o}else n.fillStyle=i;n.fill()}function Yl(n,s,e,t,i,r){n.beginPath(),n.moveTo(s+r,e),n.lineTo(s+t-r,e),n.arcTo(s+t,e,s+t,e+r,r),n.lineTo(s+t,e+i-r),n.arcTo(s+t,e+i,s+t-r,e+i,r),n.lineTo(s+r,e+i),n.arcTo(s,e+i,s,e+i-r,r),n.lineTo(s,e+r),n.arcTo(s,e,s+r,e,r)}function Kl(n,s,e,t,i,r){n.font=i;const o=n.measureText(t),l=o.actualBoundingBoxLeft+o.actualBoundingBoxRight,h=Number.isFinite(o.fontBoundingBoxAscent)?o.fontBoundingBoxAscent:o.actualBoundingBoxAscent,c=Number.isFinite(o.fontBoundingBoxDescent)?o.fontBoundingBoxDescent:o.actualBoundingBoxDescent;let u=h+c;n.fillStyle=r,n.fillText(t,s-l*.5,e+u*.5-c)}function Zl(n){const{width:s,height:e}=n,t=s instanceof SVGAnimatedLength?s.baseVal.SVG_LENGTHTYPE_PX:s,i=e instanceof SVGAnimatedLength?e.baseVal.SVG_LENGTHTYPE_PX:e,r=document.createElement("canvas");r.width=t,r.height=i;const o=r.getContext("2d");if(!o)throw new Error("!cavnasCtx");return o.drawImage(n,0,0,t,i),r}function Ql(n,s){const{width:e,height:t}=n,i=n.getContext("2d");if(!i)throw new Error("!cavnasCtx");const[r,o,l]=s.map(p=>p*255|0),h=i.getImageData(0,0,e,t),c=h.data;for(var u=0;u<c.length;u+=4)c[u]=r,c[u+1]=o,c[u+2]=l;i.putImageData(h,0,0)}function ao(n,s,e,t=[.5,1,0,0],i,r="12px Arial",o=2,l="#FFF",h="#000A"){n.font=r;const c=n.measureText(i),u=c.actualBoundingBoxLeft+c.actualBoundingBoxRight,p=c.fontBoundingBoxAscent+c.fontBoundingBoxDescent,g=s,m=e,y=u+o*2,S=p+o*2,{left:C,top:T,bottom:V}=wi([g,m],[y,S],[1,1],t);n.fillStyle=h,Yl(n,C,T,y,S,o),n.fill(),n.fillStyle=l,n.fillText(i,C+o,V-o-c.fontBoundingBoxDescent)}function gn(n){return("00"+n.toString(16).toUpperCase()).substr(-2)}function fn(n){const[s,e,t,i]=n.map(r=>r*255|0);return`#${gn(s)}${gn(e)}${gn(t)}${gn(i)}`}function lo(n,s){const[e,t,i]=s,r=`${e}-${t}-${i}`;let o=Ne(n,r);return o||(o=Zl(n),Ql(o,s),vt(n,r,o)),o}class Vu extends oo{constructor(e,t,i=[32,32],r=[.5,1,0,0],o="#F00F"){super(e);a(this,"_tooltip","");a(this,"_title","");a(this,"__scale",[1,1]);a(this,"_tooltipAlpha",0);a(this,"_bgColor",[.3,.3,.3,.8]);a(this,"_bgColorHexStr",fn(this._bgColor));a(this,"_fgColor",[1,1,1,1]);a(this,"_fgColorHexStr",fn(this._fgColor));this._image=t,this._size=i,this._originRatioAndOffset=r,this._defaultColorStr=o;const l=new pn(100),h=new pn(100);this.dispose(()=>{l.destroy(),h.destroy()});const c=()=>{if(this._clickEvent&&!this._clickEvent.empty){const u=(1+.08*h.current)*(1+.08*l.current);this._scale=[u,u],this._tooltipAlpha=l.current}};this.dispose(this.activedChanged.disposableOn(u=>{h.target=u?1:0,this.needRedraw()})),this.dispose(this.hoveredChanged.disposableOn(u=>{l.target=u?1:0,this.needRedraw()})),this.dispose(this.selectedChanged.disposableOn(()=>{this.needRedraw()})),this.dispose(h.currentChanged.disposableOn(c)),this.dispose(l.currentChanged.disposableOn(c))}set size(e){const[t,i]=e,[r,o]=this._size;(r!==t||o!==i)&&(this._size[0]=t,this._size[1]=i,this.needRedraw(),this.needPickRedraw())}get size(){return this._size}set _scale(e){const[t,i]=e,[r,o]=this.__scale;(r!==t||o!==i)&&(this.__scale[0]=t,this.__scale[1]=i,this.needRedraw(),this.needPickRedraw())}get _scale(){return this.__scale}set fgColor(e){if(!this._fgColor.every((t,i)=>e[i]===t)){const[t,i,r,o]=e;this._fgColor.splice(0,4,t,i,r,o),this._fgColorHexStr=fn(this._fgColor),this.needRedraw()}}get fgColor(){return this._fgColor}set bgColor(e){if(!this._bgColor.every((t,i)=>e[i]===t)){const[t,i,r,o]=e;this._bgColor.splice(0,4,t,i,r,o),this._bgColorHexStr=fn(this._bgColor),this.needRedraw()}}get bgColor(){return this._bgColor}set originRatioAndOffset(e){const[t,i,r,o]=this._originRatioAndOffset,[l,h,c,u]=e;(t!==l||i!==h||r!==c||o!==u)&&(this._originRatioAndOffset.splice(0,4,l,h,c,u),this.needRedraw(),this.needPickRedraw())}get originRatioAndOffset(){return this._originRatioAndOffset}set image(e){this._image!==e&&(this._image=e,this.needRedraw())}get image(){return this._image}set defaultColorStr(e){this._defaultColorStr!==e&&(this._defaultColorStr=e,this.needRedraw())}get defaultColorStr(){return this._defaultColorStr}set tooltip(e){this._tooltip!==e&&(this._tooltip=e,this.needRedraw())}get tooltip(){return this._tooltip}set title(e){this._title!==e&&(this._title=e,this.needRedraw())}get title(){return this._title}draw(e){if(!this._show)return;const[t,i]=this._winPos,r=this._size[0]*this.__scale[0],o=this._size[1]*this.__scale[1],{left:l,top:h}=wi([t,i],this._size,this.__scale,this._originRatioAndOffset),c=e.globalAlpha;if(e.globalAlpha=this.opacity,this._image){if(this.selected){const u=lo(this._image,[1,0,0]),{left:p,top:g}=wi([t,i+3],[r+6,o+6],[1,1],this._originRatioAndOffset);e.drawImage(u,p,g,r+6,o+6)}if(this.actived){const[u,p,g,m]=this._fgColor,y=lo(this._image,[u,p,g]),{left:S,top:C}=wi([t,i+4],[r+8,o+8],[1,1],this._originRatioAndOffset);e.drawImage(y,S,C,r+8,o+8)}if(this.hovered){const[u,p,g,m]=this._bgColor,y=lo(this._image,[u,p,g]),{left:S,top:C}=wi([t,i+2],[r+4,o+4],[1,1],this._originRatioAndOffset);e.drawImage(y,S,C,r+4,o+4)}e.drawImage(this._image,l,h,r,o)}else e.fillStyle=this._fgColorHexStr,e.fillRect(l,h,r,o);if(this._title!==""&&ao(e,t+20,i-16,[0,.5,0,0],this._title,"14px Arial",4,this._fgColorHexStr,this._bgColorHexStr),e.globalAlpha=c,this._hovered&&this._tooltip!==""){const u=e.globalAlpha;e.globalAlpha=this._tooltipAlpha,ao(e,t,i-42,[.5,1,0,0],this._tooltip,"12px Arial",4,this._fgColorHexStr,this._bgColorHexStr),e.globalAlpha=u}}drawForPick(e,t){if(!this._show)return;const[i,r]=this._winPos,o=t("default"),l=this._size[0]*this.__scale[0],h=this._size[1]*this.__scale[1],{left:c,top:u}=wi([i,r],this._size,this.__scale,this._originRatioAndOffset);e.fillStyle=o,e.fillRect(c,u,l,h)}}class zu extends oo{constructor(e){super(e);a(this,"_width",16);a(this,"_text","");a(this,"_fillStyle","#0F0");a(this,"_scale",1);a(this,"_scaleChanged");this.dispose(this.scaleChanged.disposableOn(o=>{this.needRedraw(),this.needPickRedraw()}));const t=this.disposeVar(new pn(100)),i=this.disposeVar(new pn(100)),r=()=>{this._clickEvent&&!this._clickEvent.empty&&(this.scale=(1+.1*i.current)*(1+.2*t.current))};this.dispose(i.currentChanged.disposableOn(r)),this.dispose(t.currentChanged.disposableOn(r)),this.dispose(this.activedChanged.disposableOn(o=>{i.target=o?1:0,this.needRedraw()})),this.dispose(this.hoveredChanged.disposableOn(o=>{t.target=o?1:0,this.needRedraw()})),this.dispose(this.selectedChanged.disposableOn(o=>{this.needRedraw()}))}set scale(e){this._scale!==e&&(this._scale=e,this._scaleChanged&&this._scaleChanged.emit(e,this))}get scale(){return this._scale}get scaleChanged(){return this._scaleChanged||(this._scaleChanged=new v),this._scaleChanged}set width(e){this._width!==e&&(this._width=e,this.needRedraw(),this.needPickRedraw())}get width(){return this._width}set text(e){this._text!==e&&(this._text=e,this.needRedraw())}get text(){return this._text}set fillStyle(e){this._fillStyle!==e&&(this._fillStyle=e,this.needRedraw())}get fillStyle(){return this._fillStyle}draw(e){if(!this._show)return;const[t,i]=this._winPos,r=e.globalAlpha;e.globalAlpha=this.opacity;const o=this._width*this._scale;this.selected&&Ei(e,t,i+3,o+3,"#F00"),this.actived&&this._clickEvent&&!this._clickEvent.empty&&Ei(e,t,i+5,o+5,"#FFF"),this.hovered?Ei(e,t,i+3,o+3,"#000A"):Ei(e,t,i+1,o+1,"#000A"),Ei(e,t,i,o,this._fillStyle);const l=this._scale>1.2?"bold 14px Arial":"bold 10px Arial";Kl(e,t,i-o,this._text,l,"#000"),e.globalAlpha=r}drawForPick(e,t){if(!this._show)return;const[i,r]=this._winPos,o=this._width*this._scale,l=t("default");Ei(e,i,r,o,l)}}const eh=new ArrayBuffer(4),th=new Uint32Array(eh),bi=new Uint8Array(eh);function ih(n){if(n>=16777215)throw new Error("uint32 > 0xFFFFFF");return th[0]=n,[bi[0],bi[1],bi[2]]}function sh(n,s,e){return bi[0]=n,bi[1]=s,bi[2]=e,bi[3]=0,th[0]}class nh extends b{constructor(){super(...arguments);a(this,"_pickColors",new Array(16777215));a(this,"_pickColorIndex",0)}reset(){for(let e=0;e<this._pickColorIndex;++e){const t=this._pickColors[e];if(!t)throw console.error("this._pickColors[i] should not be undefined!"),new Error("this._pickColors[i] should not be undefined!");t.poi=null,t.tag=""}this._pickColorIndex=0}createPickColor(e,t){const i=this._pickColorIndex;++this._pickColorIndex;const r=this._pickColors[i];r?(r.poi=e,r.tag=t):this._pickColors[i]={poi:e,tag:t};const[o,l,h]=ih(i);return[o,l,h]}getPickInfoFromColor(e,t,i){const r=sh(e,t,i);if(r>=this._pickColorIndex){console.error("index >= this._pickColorIndex");return}const o=this._pickColors[r];if(!o){console.error("!this._pickColors[index]");return}return o}destroyImp(){this.reset()}}const rh=(n,s)=>s.depth-n.depth;class Uu extends b{constructor(){super();a(this,"_pois",[]);a(this,"_canvasElement");a(this,"_ctx");a(this,"_offscreenCanvasElement");a(this,"_offscreenCanvasElement2");a(this,"_offscreenCtx");a(this,"_offscreenCtx2");a(this,"_size",[0,0]);a(this,"_needRedraw",!1);a(this,"_needPickRedraw",!1);a(this,"_pickColorManager",new nh);const e=document.createElement("canvas");e.style.width="100%",e.style.height="100%",this._canvasElement=e;const t=e.getContext("2d");if(t===null)throw new Error("cannot get context 2d!");this._ctx=t,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(cs(()=>{const[r,o]=this._size,{clientWidth:l,clientHeight:h}=this._canvasElement;(r!==l||o!==h)&&(this._size[0]=l,this._size[1]=h,this._canvasElement.width=l,this._canvasElement.height=h,this._offscreenCanvasElement.width=l,this._offscreenCanvasElement.height=h,this._offscreenCanvasElement2.width=l,this._offscreenCanvasElement2.height=h,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(e){if(typeof Ne(e,"listenHandler")<"u"){console.error("可能有poi重复加载poiManager中!");return}if(this._pois.indexOf(e)!==-1){console.error("同一个poi加了多次!");return}this._pois.push(e),this._dirty();const t=e._needRedrawEvent;if(t){const r=t.on(()=>{this._needRedraw=!0});vt(e,"needRedrawEventHandler",r)}const i=e._needPickRedrawEvent;if(i){const r=i.on(()=>{this._needPickRedraw=!0});vt(e,"needPickRedrawEventHandler",r)}}removePoi(e){const t=this._pois.indexOf(e);if(t===-1){console.error("删除一个不存在的poi!");return}this._pois.splice(t,1),this._dirty();const i=e._needRedrawEvent;if(i){const o=Ne(e,"needRedrawEventHandler");o?i.off(o):console.error("poi没有listenHandler!")}const r=e._needPickRedrawEvent;if(r){const o=Ne(e,"needPickRedrawEventHandler");o?r.off(o):console.error("poi没有listenHandler!")}}_draw(){this._pois.sort(rh);const[e,t]=this._size;this._ctx.clearRect(0,0,e,t),this._pois.forEach(i=>i.draw(this._ctx))}pick(e,t,i,r){return this._needPickRedraw&&(this._needPickRedraw=!1,this._pickDraw()),this._getPickInfo(e,t,i,r)}_pickDraw(){this._pickColorManager.reset(),this._pois.sort(rh);const[e,t]=this._size;this._offscreenCtx.clearRect(0,0,e,t),this._pois.forEach(i=>{const r=o=>{const[l,h,c]=this._pickColorManager.createPickColor(i,o);return`rgb(${l}, ${h}, ${c})`};i.drawForPick(this._offscreenCtx,r)})}_getPickInfo(e,t,i,r){const o=this._offscreenCtx.getImageData(e,t,i,r),l=[],h=o.data.length/4;for(let c=0;c<h;++c){const u=o.data[c*4+0],p=o.data[c*4+1],g=o.data[c*4+2];if(o.data[c*4+3]===255){const y=this._pickColorManager.getPickInfoFromColor(u,p,g);if(y&&y.poi&&!l.includes(y)){let S=!0;{const[C,T]=this._size;this._offscreenCtx2.clearRect(0,0,C,T);const V=Q=>"rgb(255, 255, 255)";y.poi.drawForPick(this._offscreenCtx2,V);const z=this._offscreenCtx2.getImageData(e,t,i,r),x=z.data[c*4+0],$=z.data[c*4+1],Y=z.data[c*4+2];z.data[c*4+3],x===255&&$===255&&Y===255||(S=!1)}S&&l.push(y)}}}return l}}class ho extends b{constructor(){super(...arguments);a(this,"_closeEvent");a(this,"_show",!0);a(this,"_showChanged");a(this,"_opacity",1);a(this,"_opacityChanged");a(this,"_winPos",[0,0]);a(this,"_winPosChanged")}set winPos(e){const[t,i]=e,[r,o]=this._winPos;(t!==r||i!==o)&&(this._winPos[0]=t,this._winPos[1]=i,this._winPosChanged&&this._winPosChanged.emit(this._winPos))}get winPos(){return this._winPos}get winPosChanged(){return this._winPosChanged=this._winPosChanged||new v,this._winPosChanged}set opacity(e){this._opacity!==e&&(this._opacity=e,this._opacityChanged&&this._opacityChanged.emit(this._opacity))}get opacity(){return this._opacity}get opacityChanged(){return this._opacityChanged=this._opacityChanged||new v,this._opacityChanged}set show(e){this._show!==e&&(this._show=e,this._showChanged&&this._showChanged.emit(this._show))}get show(){return this._show}get showChanged(){return this._showChanged=this._showChanged||new v,this._showChanged}get closeEvent(){return this._closeEvent||(this._closeEvent=new v),this._closeEvent}}const co=new WeakMap;function uo(n){if(!co.has(n)){const s=new An(()=>new n,e=>e.reset());co.set(n,s)}return co.get(n)}class po extends ho{constructor(){super();a(this,"_div");a(this,"_contentDiv");a(this,"_originOffsetX",0);a(this,"_originOffsetY",0);a(this,"_originRatioX",.5);a(this,"_originRatioY",1);a(this,"_divChanged",new v);const e=document.createElement("div");e.style.cssText="width: 0px; height: 0px; position: absolute; opacity: 1.0; visibility: visible;";const t=document.createElement("div");t.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 i=document.createElement("div");this._contentDiv=i,t.appendChild(i),e.appendChild(t),this._div=e,this.dispose(this._divChanged.disposableOn(()=>{t.style.left=`${-this._originOffsetX}px`,t.style.top=`${-this._originOffsetY}px`,t.style.transform=`translateX(-${100*this._originRatioX}%) translateY(-${100*this._originRatioY}%)`})),this.dispose(this.winPosChanged.disposableOn(([r,o])=>{this._div.style.left=`${r}px`,this._div.style.top=`${o}px`})),this.dispose(this.opacityChanged.disposableOn(r=>{this._div.style.opacity=`${r}`})),this.dispose(this.showChanged.disposableOn(r=>{this._div.style.visibility=r?"visible":"hidden"}))}get contentDiv(){return this._contentDiv}reset(){}get originOffsetX(){return this._originOffsetX}set originOffsetX(e){this._originOffsetX!==e&&(this._originOffsetX=e,this._divChanged.emit())}get originOffsetY(){return this._originOffsetY}set originOffsetY(e){this._originOffsetY!==e&&(this._originOffsetY=e,this._divChanged.emit())}get originRatioX(){return this._originRatioX}set originRatioX(e){this._originRatioX!==e&&(this._originRatioX=e,this._divChanged.emit())}get originRatioY(){return this._originRatioY}set originRatioY(e){this._originRatioY!==e&&(this._originRatioY=e,this._divChanged.emit())}get element(){return this._div}}class oh extends b{constructor(e,t){super();a(this,"_floatDiv");a(this,"_show",!1);a(this,"_showChanged");this._customDivClass=e,this._divContainer=t,this.dispose(()=>{this.show=!1})}_updateDivPoi(){if(this._show){const{floatDiv:t}=this;t.element.parentElement||this._divContainer.appendChild(t.element)}else{const{_floatDiv:t}=this;t&&t.element.parentElement&&this._divContainer.removeChild(t.element)}}set show(e){this._show!==e&&(this._show=e,this._updateDivPoi(),this._showChanged&&this._showChanged.emit(e))}get show(){return this._show}get floatDiv(){if(!this._floatDiv){const e=uo(this._customDivClass).create();this.dispose(()=>{uo(this._customDivClass).destroy(e)}),this._floatDiv=e}return this._floatDiv}get showChanged(){return this._showChanged||(this._showChanged=new v),this._showChanged}}const Bu=["top","bottom","left","right"];function Wu(n){return Object.entries(n).map(([s,e])=>Bu.includes(s)?`${s}: ${e}px; `:"").join("")}function ah(n,s,e){const t=document.createElement("div");t.style.cssText=`position: absolute; ${Wu(e)} background-color: ${n}; border-radius: ${s}px;`;const i='<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 t.innerHTML=i,t}function lh(n,s,e="rgba(0,0,0,0.7)"){const t=document.createElement("div");t.style.cssText=`margin: 0 auto; width: ${n}px; height: ${s}px; position: relative; pointer-events: none;`;const i=document.createElement("div");return i.style.cssText=`position: absolute; left: 0px; top: 0px; width: 0; height: 0; border-left: ${n*.5}px solid transparent; border-right: ${n*.5}px solid transparent; border-top: ${s}px solid ${e};`,t.appendChild(i),[t,i]}class hh extends po{constructor(){super();a(this,"_borderDiv");a(this,"_closeDiv");a(this,"_innerContentDiv");a(this,"_colorStr","rgba(0, 0, 0, 0.7)");a(this,"_divColorChanged",new v);a(this,"_borderRadius",10);const e=document.createElement("div");e.style.cssText=`position: relative; background-color: ${this._colorStr}; border-radius: ${this._borderRadius}px; padding: 5px; pointer-events: all;`,this._borderDiv=e;const t=ah(this._colorStr,10,{top:3,right:3}),[i,r]=lh(2*this._borderRadius,2*this._borderRadius,this._colorStr),o=document.createElement("div");this._innerContentDiv=o,e.appendChild(o),e.appendChild(t),this.contentDiv.appendChild(e),this.contentDiv.appendChild(i),t.style.opacity="0.1",t.onmouseenter=()=>{t.style.opacity="1.0"},t.onmouseleave=()=>{t.style.opacity="0.1"},t.onclick=()=>{this._closeEvent&&this._closeEvent.emit()},this._closeDiv=t,this.dispose(this._divColorChanged.disposableOn(()=>{r.style.borderTopColor=this._colorStr,e.style.backgroundColor=this._colorStr,i.style.width=`${this._borderRadius*2}px`,i.style.height=`${this._borderRadius*2}px`,r.style.borderLeft=`${this._borderRadius}px`,r.style.borderRight=`${this._borderRadius}px`,r.style.borderTop=`${this._borderRadius*2}px`}));const l=h=>{h.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(e){this._colorStr!==e&&(this._colorStr=e,this._divColorChanged.emit())}get borderRadius(){return this._borderRadius}set borderRadius(e){this._borderRadius!==e&&(this._borderRadius=e,this._divColorChanged.emit())}}class Hu extends hh{constructor(){super();a(this,"_iframe");a(this,"_iframeMessageEvent");const e=document.createElement("iframe");e.style.cssText="width: 100%; height: 100%; border-width: 0px; border-radius: 5px; display: block;",e.src="http://www.weather.com.cn/live/index.shtml",this._iframe=e,this.innerContentDiv.appendChild(e);const t=i=>{i.source===this._iframe.contentWindow&&(this._iframeMessageEvent?this._iframeMessageEvent.emit(i):console.warn(`iframe消息接收到未处理!data: ${i.data}`))};globalThis.addEventListener("message",t),this.dispose(()=>{globalThis.removeEventListener("message",t)})}reset(){super.reset(),this.src=""}set src(e){this._iframe.src!==e&&(this._iframe.src=e)}get src(){return this._iframe.src}get iframe(){return this._iframe}get iframeMessageEvent(){return this._iframeMessageEvent=this._iframeMessageEvent||new v,this._iframeMessageEvent}}class $u extends ho{constructor(){super();a(this,"_div");a(this,"_contentContainer");a(this,"_text","");const e=document.createElement("div");this._div=e,e.style.cssText="width: 0px; height: 0px; position: absolute; opacity: 1.0; visibility: visible; transition: opacity 0.5s;";const t=document.createElement("div");t.style.cssText="position: absolute; left: 0px; bottom: 0px; transform: translateX(-50%); margin: 0; padding: 0; pointer-events: none;";const i=document.createElement("div");i.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;",i.innerText=this._text,this._div.appendChild(t),t.appendChild(i),this._contentContainer=i,this._div=e,this.dispose(this.winPosChanged.disposableOn(([r,o])=>{this._div.style.left=`${r}px`,this._div.style.top=`${o-50}px`})),this.dispose(this.opacityChanged.disposableOn(r=>{this._div.style.opacity=`${r}`})),this.dispose(this.showChanged.disposableOn(r=>{this._div.style.visibility=r?"visible":"hidden"}))}get element(){return this._div}reset(){this.opacity=1,this.show=!0}set text(e){this._text!==e&&(this._text=e,this._contentContainer.innerText=e)}get text(){return this._text}}class Gu extends po{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 Ju extends b{constructor(e,t){super();a(this,"_cursorDiv");a(this,"_pointerOut",this.disposeVar(w(!1)));a(this,"_show",this.disposeVar(w(!0)));this._cursorDiv=new oh(t,e),this.dispose(()=>this._cursorDiv.destroy());const i=o=>{const[l,h]=we(o);this._cursorDiv.floatDiv.winPos=[l,h]};e.addEventListener("pointermove",i),this.dispose(()=>e.removeEventListener("pointermove",i));const r=()=>{this._cursorDiv.show=this.show&&this._pointerOut.value};r(),this.dispose(this.showChanged.disposableOn(r)),this.dispose(this._pointerOut.changed.disposableOn(r))}set show(e){this._show.value=e}get show(){return this._show.value}get showChanged(){return this._show.changed}reset(){this._pointerOut.value=!1}get cursorDiv(){return this._cursorDiv}set text(e){this._cursorDiv.floatDiv.contentDiv.innerText=e}get text(){return this._cursorDiv.floatDiv.contentDiv.innerText}}function mn(n,s,e){if(!(n.tree===s.tree&&n!==s&&!n.isAncestorOf(s))||n.tree!==s.tree||!n.parent)return!1;if(!n.parent.children)throw console.error("当前节点的父节点没有子节点?这是不可能的!"),new Error("当前节点的父节点没有子节点?这是不可能的!");return!(s===n||n.isAncestorOf(s)||e!=="inner"&&!s.parent||e==="inner"&&!s.children)}function qn(n,s,e){if(!n.tree||!s.tree||n.tree!==s.tree)return;if(!n.parent){console.warn("当前节点没有父节点,那么该节点无法被移动!");return}if(!n.parent.children)throw console.error("当前节点的父节点没有子节点?这是不可能的!"),new Error("当前节点的父节点没有子节点?这是不可能的!");if(s===n){console.warn("自身不能拖放到自身!");return}if(n.isAncestorOf(s)){console.warn("当前节点不能拖放到它自身的后代节点之上!");return}if(e!=="inner"&&!s.parent){console.warn("目标节点没有父节点,无法拖放!");return}if(e==="inner"&&!s.children){console.warn("无法移动到目标节点的子节点中,因为目标节点不是组节点!");return}n.tree._startTransaction();const t=n.parent.children.indexOf(n);if(n.parent.children.splice(t,1),e!=="inner"){const{parent:i}=s;if(!i||!i.children)throw new Error("!parent");const r=i.children.indexOf(s);e==="before"?i.children.splice(r,0,n):e==="after"&&i.children.splice(r+1,0,n)}else s.children.push(n);n.tree._stopTransaction()}function ch(n,s,e){return Wr(n,t=>mn(t,s,e))}function dh(n,s,e){for(let t of n)mn(t,s,e)?qn(t,s,e):console.warn(`treeItem(id: ${t.id}) cannot move...`)}const qu={checked:1,unchecked:2,indeterminate:3},Xu=["checked","unchecked","indeterminate"];class uh extends b{constructor(e){super();a(this,"_collapsed",this.disposeVar(w(!1)));a(this,"_checkedStatus",this.disposeVar(w("unchecked")));a(this,"_selected",this.disposeVar(w(!1)));a(this,"_moveToPositionMode",this.disposeVar(w("none")));a(this,"_updateCheckedStatusFromChildrenEvent",this.disposeVar(new v));this._treeItem=e;const t=()=>this._treeItem.tree&&this._treeItem.tree.itemsChanged.emit([this._treeItem]);this.dispose(this._collapsed.changed.disposableOn(t)),this.dispose(this._checkedStatus.changed.disposableOn(t)),this.dispose(this._selected.changed.disposableOn(t)),this.dispose(this._moveToPositionMode.changed.disposableOn(t)),this.dispose(this._checkedStatus.changed.disposableOn(()=>this._treeItem.parent&&this._treeItem.parent.uiTreeObject.updateCheckedStatusFromChildren())),this.dispose(this._treeItem.childrenChangedEvent.disposableOn(()=>{this.updateCheckedStatusFromChildren()}));const i=this.disposeVar(oe(this._updateCheckedStatusFromChildrenEvent));this.dispose(i.disposableOn(()=>{if(!this._treeItem.children)return;let r=0;Br(this._treeItem.children,o=>(r|=qu[o.uiTreeObject.checkedStatus],r===3)),r>0&&(this._checkedStatus.value=Xu[r-1])})),this.dispose(this._treeItem.childrenResetedEvent.disposableOn(r=>{!r&&this.checkedStatus==="indeterminate"&&(this._checkedStatus.value="unchecked")}));{const r=(o,l,h=!0)=>{if(l)o.selectedItems.push(this._treeItem);else{const c=o.selectedItems.indexOf(this._treeItem);c===-1?h&&console.error("selectedItems index -1"):o.selectedItems.splice(c,1)}};this.dispose(this._selected.changed.disposableOn(o=>{const{tree:l}=this._treeItem;l&&r(l,o)})),this.dispose(()=>this.selected=!1)}}get treeItem(){return this._treeItem}get collapsed(){return this._collapsed.value}set collapsed(e){this._collapsed.value=e}get collapsedChanged(){return this._collapsed.changed}get checkedStatus(){return this._checkedStatus.value}check(e){const t=e?"checked":"unchecked";if(this._checkedStatus.value!==t&&(this._checkedStatus.value=t,this._treeItem.children))for(let i of this._treeItem.children)i.uiTreeObject.check(e)}updateCheckedStatusFromChildren(){this._updateCheckedStatusFromChildrenEvent.emit()}get checkedStatusChanged(){return this._checkedStatus.changed}get selected(){return this._selected.value}set selected(e){this._selected.value=e}get selectedChanged(){return this._selected.changed}get moveToPositionMode(){return this._moveToPositionMode.value}set moveToPositionMode(e){this._moveToPositionMode.value=e}get moveToPositionModeChanged(){return this._moveToPositionMode.changed}}const lt=class lt extends b{constructor(e,t=!1,i){super();a(this,"_children");a(this,"_childrenResetedEvent");a(this,"_childrenToChangeEvent");a(this,"_childrenChangedEvent");a(this,"_parent",this.disposeVar(w(void 0)));a(this,"_level",this.disposeVar(w(0)));a(this,"_id");a(this,"_uiTreeObject",this.disposeVar(new uh(this)));this._tree=e,this._hasChildren=t,this._id=i??ns(),this._id!=="_ROOT"&<.wm.has(this._id)&&console.warn(`创建了id(${this._id})相同的树节点,会导致之前的树节点无法索引!`),lt.wm.set(this._id,this),this.dispose(()=>{if(this._id!=="_ROOT"&&!lt.wm.has(this._id)){console.warn(`树节点(${this._id})不在wm树上!`);return}lt.wm.delete(this._id)}),this.dispose(this._parent.changed.disposableOn(()=>{this._updateLevel()})),this.dispose(this._level.changed.disposableOn(()=>{if(this.children)for(let r of this.children)r._updateLevel()})),lt.allTreeItems.set(this._id,this),this.dispose(()=>{lt.allTreeItems.delete(this._id)})}static getFromId(e){return lt.wm.get(e)}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 e=this.disposeVar(new hn);this._children=e,this.dispose(e.toChangeEvent.disposableOn((r,o)=>{for(let l of r){const{start:h,deleteCount:c,items:u}=l;for(let p=h;p<h+c;++p)o.get(p)._parent.value=void 0;for(let p of u){if(p.parent)throw console.error("请检查新增的treeItem是否正在使用!"),new Error("item.parent should not exist!");p._parent.value=this}}}));const t=new Set,i=new Set;this.dispose(e.toChangeEvent.disposableOn((r,o)=>{var l;if(this.tree){t.clear(),i.clear();for(let h of r){const{start:c,deleteCount:u,items:p}=h;for(let g=c;g<c+u;++g)t.add(o.get(g));for(let g of p)i.add(g)}for(let h of t)i.has(h)&&(t.delete(h),i.delete(h));(l=this.tree)==null||l.itemChildrenToChange.emit(this,r,t,i)}})),this.dispose(e.changedEvent.disposableOn(()=>{var r;(r=this.tree)==null||r.itemChildrenChanged.emit(this)})),this.dispose(e.toChangeEvent.disposableOn((...r)=>this._childrenToChangeEvent&&this._childrenToChangeEvent.emit(...r))),this.dispose(e.changedEvent.disposableOn((...r)=>this._childrenChangedEvent&&this._childrenChangedEvent.emit(...r)))}return this._children}else return}get childrenResetedEvent(){return this._childrenResetedEvent||(this._childrenResetedEvent=new v),this._childrenResetedEvent}get childrenToChangeEvent(){return this._childrenToChangeEvent||(this._childrenToChangeEvent=new v),this._childrenToChangeEvent}get childrenChangedEvent(){return this._childrenChangedEvent||(this._childrenChangedEvent=new v),this._childrenChangedEvent}resetChildren(e=!1){this._children&&(this._children.length=0),this._hasChildren=e,this._childrenResetedEvent&&this._childrenResetedEvent.emit(e)}*getDescendants(e){const t=this,i=[],r=[];for(t.children&&t.children.length>0&&(!e||e(t))&&(i.push(0),r.push(t.children));i.length>0;){const o=i[i.length-1],l=r[r.length-1],h=l.get(o);yield h,o<l.length-1?++i[i.length-1]:(r.pop(),i.pop()),h.children&&h.children.length>0&&(!e||e(h))&&(i.push(0),r.push(h.children))}}*getAncestors(e){let t=this.parent;for(;t&&(yield t,!(e&&!e(t)));)t=t.parent}isDescendantOf(e){for(let t of this.getAncestors())if(t===e)return!0;return!1}isAncestorOf(e){return e.isDescendantOf(this)}get level(){return this._level.value}get levelChanged(){return this._level.changed}get tree(){return this._tree}canMoveTo(e,t){return mn(this,e,t)}moveTo(e,t){qn(this,e,t)}detachFromParent(){if(!this.parent||!this.parent.children)return;const e=this.parent.children.indexOf(this);this.parent.children.splice(e,1)}insertNewTreeItem(e,t){if(t&&t.tree!==this.tree)return console.warn("newTreeItem.tree !== this.tree"),!1;if(this.children&&e.startsWith("Inner"))return t&&this.children.push(t),!0;if(e==="Inner")return!1;const i=this.parent;if(!i||!i.children)return!1;const r=i.children.indexOf(this);return e.endsWith("Before")?t&&i.children.splice(r,0,t):e.endsWith("After")&&t&&i.children.splice(r+1,0,t),!0}};a(lt,"wm",new Map),a(lt,"allTreeItems",new Map);let vn=lt;class ph extends b{constructor(e){super();a(this,"_redrawEvent",this.disposeVar(new v));a(this,"_containerScrollTop",this.disposeVar(w(0)));a(this,"_containerClientHeight",this.disposeVar(w(-1)));a(this,"_container",this.disposeVar(w(void 0)));a(this,"_redrawInfo",{topFreeSpaceHeight:0,topUnvisibleItemNum:0,middleTreeItems:[],bottomFreeSpaceHeight:0,bottomUnvisibleItemNum:0});this._tree=e;const t=this._containerClientHeight,i=this._containerScrollTop,r=this._tree._forceRedrawEvent,o=this.disposeVar(oe(this._tree.itemDivHeightChanged,this._tree.itemChildrenChanged,this._tree.itemsChanged,t.changed,i.changed,r)),{redrawInfo:l}=this,h=u=>{const p=u.uiTreeObject;return!!u.children&&(!p||!p.collapsed)};this.dispose(o.disposableOn(()=>{if(l.topFreeSpaceHeight=0,l.topUnvisibleItemNum=0,l.middleTreeItems.length=0,l.bottomFreeSpaceHeight=0,l.bottomUnvisibleItemNum=0,this._containerClientHeight.value>=0){const u=Hr(this._tree.getDescendants(h)),p=this._tree.itemDivHeight,g=p*u,m=Lt([Zt([Lt([g-t.value,0]),i.value]),0]),y=m/p|0,S=Math.ceil((m-y*p+t.value)/p)|0;y>0&&(l.topUnvisibleItemNum=y,l.topFreeSpaceHeight=y*this._tree.itemDivHeight);const C=y+S;let T=0;for(let z of this._tree.getDescendants(h)){if(T>=C)break;T>=y&&l.middleTreeItems.push(z),++T}const V=u-y-S;V>0&&(l.bottomUnvisibleItemNum=V,l.bottomFreeSpaceHeight=V*this._tree.itemDivHeight)}else for(let u of this._tree.getDescendants(h))l.middleTreeItems.push(u);this._redrawEvent.emit(l)}));let c;this.dispose(()=>c&&(c.destroy(),c=void 0)),this.dispose(this.containerChanged.disposableOn(u=>{c&&(c.destroy(),c=void 0),u&&(c=dn(),c.start(()=>{const{scrollTop:p,clientHeight:g}=u;typeof p>"u"||typeof g>"u"?is("createUiTreeWithContainer error: conainter has no scrollTop or clientHeight property!"):(this.containerScrollTop=p,this.containerClientHeight=g)}))}))}get container(){return this._container.value}set container(e){this._container.value=e}get containerChanged(){return this._container.changed}get redrawInfo(){return this._redrawInfo}getTreeItemPos(e){const t=o=>{const l=o.uiTreeObject;return!!o.children&&(!l||!l.collapsed)};let i=0,r=!1;for(let o of this._tree.getDescendants(t)){if(o===e){r=!0;break}++i}if(r)return[i,i*this._tree.itemDivHeight]}collapseAll(){console.log("collapseAll");for(let e of this.tree.root.getDescendants()){const t=e.uiTreeObject;t.collapsed=!0}}expandAll(){console.log("expandAll");for(let e of this.tree.root.getDescendants()){const t=e.uiTreeObject;t.collapsed=!1}}get tree(){return this._tree}get redrawEvent(){return this._redrawEvent}set containerScrollTop(e){this._containerScrollTop.value=e}get containerScrollTop(){return this._containerScrollTop.value}get containerScrollTopChanged(){return this._containerScrollTop.changed}set containerClientHeight(e){this._containerClientHeight.value=e}get containerClientHeight(){return this._containerClientHeight.value}get containerClientHeightChanged(){return this._containerClientHeight.changed}*getAllItems(e){for(let t of this._tree.getDescendants())(!e||e(t))&&(yield t)}getAllSelectedItems(){return this.getAllItems(e=>e.uiTreeObject.selected)}getAllCheckedItems(){return this.getAllItems(e=>e.uiTreeObject.checkedStatus==="checked")}getAllCheckedLeafItems(){return this.getAllItems(e=>!e.children&&e.uiTreeObject.checkedStatus==="checked")}selectAllItems(e){for(let t of this.getAllItems())(!e||!e.includes(t))&&(t.uiTreeObject.selected=!0)}clearAllSelectedItems(e){for(let t of this.getAllSelectedItems())(!e||!e.includes(t))&&(t.uiTreeObject.selected=!1)}checkAllItems(e){for(let t of this.getAllItems())(!e||!e.includes(t))&&t.uiTreeObject.check(!0)}clearAllCheckedItems(e){for(let t of this.getAllCheckedItems())(!e||!e.includes(t))&&t.uiTreeObject.check(!1)}}const si=class si extends b{constructor(e){super();a(this,"_root",this.disposeVar(new vn(this,!0,"_ROOT")));a(this,"_itemChildrenChanged",this.disposeVar(new v));a(this,"_itemChildrenToChange",this.disposeVar(new v));a(this,"_itemsAdded",this.disposeVar(new v));a(this,"_itemsDeleted",this.disposeVar(new v));a(this,"_itemsChanged",this.disposeVar(new v));a(this,"_transactionStack",0);a(this,"_addedItems",new Set);a(this,"_deletedItems",new Set);a(this,"_selectedItems",this.disposeVar(new hn));a(this,"_itemDivHeight",this.disposeVar(w(si.defaultItemDivHeight)));a(this,"_forceRedrawEvent",this.disposeVar(new v));a(this,"_uiTree",this.disposeVar(new ph(this)));this._root._tree.value=this,this.dispose(this._itemChildrenToChange.disposableOn((t,i)=>{if(!t.children){console.error("!item.children");return}for(let r of i){const{start:o,deleteCount:l,items:h}=r;for(let c=o;c<o+l;++c){const u=t.children.get(c);this._deletedItems.has(u)?console.error(`this._deletedItems.has(currentItem(${u.id}))`):this._deletedItems.add(u)}for(let c of h)this._deletedItems.has(c)?this._deletedItems.delete(c):this._addedItems.add(c)}this._execTransaction()})),e!==void 0&&(this.itemDivHeight=e)}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(e){this._itemDivHeight.value=e}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(e){return this._root.getDescendants(e)}getTreeItemFromId(e){let t;for(let i of this.getDescendants())if(i.id===e){t=i;break}return t}_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}};a(si,"defaultItemDivHeight",24),a(si,"canMoveToTreeItem",mn),a(si,"moveToTreeItem",qn),a(si,"canMoveToTreeItems",ch),a(si,"moveToTreeItems",dh);let Si=si;class le extends b{constructor(e,t,i=!0,r){super();a(this,"_obj",this.disposeVar(w(void 0)));this._resetEvent=e,this._createFunc=t;const o=this._resetEvent,l=this._createFunc,h=()=>{this._obj.value&&(this._obj.value.destroy(),this._obj.value=void 0)};this.dispose(h);const c=(...u)=>{h(),this._obj.value=l(...u)};i&&(r?this._obj.value=l(...r):this._obj.value=l()),this.dispose(o.disposableOn(c))}get obj(){return this._obj.value}get objChanged(){return this._obj.changed}}class Yu extends b{constructor(e,t=!0,i){super();a(this,"_event",this.disposeVar(new v));a(this,"_objResettingWithEvent");this._createFunc=e,this._execOnInit=t,this._initParams=i,this._objResettingWithEvent=this.disposeVar(new le(this._event,this._createFunc,this._execOnInit,this._initParams))}get obj(){return this._objResettingWithEvent.obj}get objChanged(){return this._objResettingWithEvent.objChanged}reset(...e){this._event.emit(...e)}}const Or=class Or extends b{constructor(){super();a(this,"_set",new Set);a(this,"_toChangeEvent",this.dv(new v));a(this,"_changedEvent",this.dv(new v));a(this,"main");this.dispose(()=>{this._set.size!==0&&(Or.warnOnDestroying&&console.warn("this._set.size > 0"),this.clear())})}get toChange(){return this._toChangeEvent}get changed(){return this._changedEvent}add(...e){if(e.length==2&&typeof e[1]=="boolean")e[1]&&(this.main=e[0]);else for(let t of e)this._toChangeEvent.emit([],[t]),this._set.add(t),this._changedEvent.emit([],[t])}delete(...e){for(let t of e)this.main&&this.main==t&&(this.main=void 0),this._toChangeEvent.emit([t],[]),this._set.delete(t),this._changedEvent.emit([t],[])}disposableAdd(...e){return e.length==2&&typeof e[1]=="boolean"?(e[1]&&(this.main=e[0]),this.add(e[0]),()=>this.delete(e[0])):(this.add(...e),()=>this.delete(...e))}get size(){return this._set.size}clear(){const e=[...this._set];this._toChangeEvent.emit([],e),this._set.clear(),this._changedEvent.emit([],e),this.main=void 0}values(){return this._set.values()}};a(Or,"warnOnDestroying",!0);let Xn=Or;async function gh(n){const s=[],e=[],t=n.entries();for await(const[i,r]of t){const o=r;o.kind==="file"?s.push(i):o.kind==="directory"&&e.push(i)}return{files:s,dirs:e}}async function go(n){return await(await n.getFile()).text()}async function fh(n){const s=await go(n);try{return JSON.parse(s)}catch{return}}async function mh(n){return await(await n.getFile()).arrayBuffer()}class vh extends b{constructor(s){super(),this._rootDirHandle=s}get rootDirHandle(){return this._rootDirHandle}async getSubFilesAndDirs(){return await gh(this._rootDirHandle)}async getDir(s){let e=this._rootDirHandle;for(const t of s)if(e=await(e==null?void 0:e.getDirectoryHandle(t)),!e){console.log(`getDirectoryHandle ${t} failed`);return}return e}async getFile(s,e){const t=await this.getDir(s);if(t)try{return await t.getFileHandle(e)}catch(i){console.error(`未能获取当前文件 ${s.join("/")}/${e} error: ${i}`,i);return}}}class _h extends b{constructor(e){super();a(this,"_startRootDirId",0);a(this,"_dirMap",new Map);this._prefix=e}get prefix(){return this._prefix}async getRootDirId(e){let t;try{console.log("window.showDirectoryPicker begin"),t=await globalThis.showDirectoryPicker({id:e,mode:"read"}),console.log("window.showDirectoryPicker end",t)}catch(i){console.error(`LocalFileServer getRootDirId failed: ${i}`,i);return}if(t){const i=++this._startRootDirId,r=`${this._prefix}${i}`;return this._dirMap.set(r,new vh(t)),r}}getRootDir(e){return this._dirMap.get(e)}async getFile(e){const t=e.split("/");if(t.length<2){console.warn(`LocalFileServer getFile failed: ${e}`);return}const i=t[0],r=this._dirMap.get(i);if(!r){console.warn(`LocalFileServer getFile failed: ${e}`);return}const o=t.slice(1,t.length-1),l=t[t.length-1],h=await r.getFile(o,l);if(!h){console.warn(`LocalFileServer getFile failed: ${e}`);return}return h}async getText(e){const t=await this.getFile(e);if(t)return await go(t)}async getArrayBuffer(e){const t=await this.getFile(e);if(t)return await mh(t)}async getJson(e){const t=await this.getFile(e);if(t)return await fh(t)}async getLocalFilePath(e,t,i){const r=await this.getRootDirId(t);if(!r){console.warn("getRootDirId error!");return}const o=this.getRootDir(r);if(!o){console.warn("getRootDir error!");return}const l=await o.getSubFilesAndDirs();if(!l.files){console.warn("getSubFilesAndDirs error! 找不到符合要求的文件!");return}const h=e?l.files.filter(c=>e.some(u=>c.endsWith(u))):l.files;if(h.length===0){console.warn("找不到符合要求的文件!");return}return`https://${r}/${h[0]}`}}const yh=new _h("xe2_local");async function Ku(n,s,e){return await yh.getLocalFilePath(n,s,e)}class wh extends b{constructor(e,t){super();a(this,"_processing");this._complexImage=e,this._imageUri=t,this._processing=this.disposeVar(Le(async i=>{const r=this._complexImage,o=await i.promise(Rl(this._imageUri,this._complexImage.crossOrigin));o&&o instanceof HTMLImageElement&&(r.size=[o.naturalWidth,o.naturalHeight],r.pixelFormat="RGBA",r.copyTexture({source:o}))})),this._processing.start()}get processing(){return this._processing}}const Eh=["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"],bh=["img","gif","video","flv","hls"];let Zu=class extends b{constructor(e,t){super();a(this,"_element");this._complexImage=e,this._videoSrc=t;var i=document.createElement("video");i.src=this._videoSrc,i.style.position="absolute",i.style.top="0px",i.style.left="0px",i.style.zIndex="-100",i.style.visibility="hidden",i.style.width="0px",i.style.height="0px";{const r=()=>{i.crossOrigin=this._complexImage.crossOrigin};r(),this.dispose(this._complexImage.crossOriginChanged.disposableOn(r))}{const r=()=>{i.autoplay=this._complexImage.autoplay};r(),this.dispose(this._complexImage.autoplayChanged.disposableOn(r))}{const r=()=>{i.loop=this._complexImage.loop};r(),this.dispose(this._complexImage.loopChanged.disposableOn(r))}i.muted=!0,document.body.appendChild(i),this._element=i,this.dispose(()=>document.body.removeChild(i))}get element(){return this._element}};class Sh extends b{constructor(e,t){super();a(this,"_videoDom");a(this,"_update");this._complexImage=e,this._imageUri=t,this._videoDom=this.disposeVar(new Zu(this._complexImage,this._imageUri)),this._update=this.disposeVar(cs(()=>this.update())),this._update.start()}get videoDom(){return this._videoDom}get videoElement(){return this._videoDom.element}update(){if(this.videoElement.readyState<2)return;const e=this._complexImage,{videoWidth:t,videoHeight:i}=this.videoElement;e.size=[t,i],e.pixelFormat="RGBA",e.copyTexture({source:this.videoElement})}}function Qu(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var fo={},Vt={},Ch;function ep(){if(Ch)return Vt;Ch=1,Object.defineProperty(Vt,"__esModule",{value:!0}),Vt.loop=Vt.conditional=Vt.parse=void 0;var n=function t(i,r){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},l=arguments.length>3&&arguments[3]!==void 0?arguments[3]:o;if(Array.isArray(r))r.forEach(function(c){return t(i,c,o,l)});else if(typeof r=="function")r(i,o,l,t);else{var h=Object.keys(r)[0];Array.isArray(r[h])?(l[h]={},t(i,r[h],o,l[h])):l[h]=r[h](i,o,l,t)}return o};Vt.parse=n;var s=function(i,r){return function(o,l,h,c){r(o,l,h)&&c(o,i,l,h)}};Vt.conditional=s;var e=function(i,r){return function(o,l,h,c){for(var u=[],p=o.pos;r(o,l,h);){var g={};if(c(o,i,l,g),o.pos===p)break;p=o.pos,u.push(g)}return u}};return Vt.loop=e,Vt}var he={},Ph;function Th(){if(Ph)return he;Ph=1,Object.defineProperty(he,"__esModule",{value:!0}),he.readBits=he.readArray=he.readUnsigned=he.readString=he.peekBytes=he.readBytes=he.peekByte=he.readByte=he.buildStream=void 0;var n=function(p){return{data:p,pos:0}};he.buildStream=n;var s=function(){return function(p){return p.data[p.pos++]}};he.readByte=s;var e=function(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return function(g){return g.data[g.pos+p]}};he.peekByte=e;var t=function(p){return function(g){return g.data.subarray(g.pos,g.pos+=p)}};he.readBytes=t;var i=function(p){return function(g){return g.data.subarray(g.pos,g.pos+p)}};he.peekBytes=i;var r=function(p){return function(g){return Array.from(t(p)(g)).map(function(m){return String.fromCharCode(m)}).join("")}};he.readString=r;var o=function(p){return function(g){var m=t(2)(g);return p?(m[1]<<8)+m[0]:(m[0]<<8)+m[1]}};he.readUnsigned=o;var l=function(p,g){return function(m,y,S){for(var C=typeof g=="function"?g(m,y,S):g,T=t(p),V=new Array(C),z=0;z<C;z++)V[z]=T(m);return V}};he.readArray=l;var h=function(p,g,m){for(var y=0,S=0;S<m;S++)y+=p[g+S]&&Math.pow(2,m-S-1);return y},c=function(p){return function(g){for(var m=s()(g),y=new Array(8),S=0;S<8;S++)y[7-S]=!!(m&1<<S);return Object.keys(p).reduce(function(C,T){var V=p[T];return V.length?C[T]=h(y,V.index,V.length):C[T]=y[V.index],C},{})}};return he.readBits=c,he}var Ih;function tp(){return Ih||(Ih=1,(function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var s=ep(),e=Th(),t={blocks:function(g){for(var m=0,y=[],S=g.data.length,C=0,T=(0,e.readByte)()(g);T!==m&&T;T=(0,e.readByte)()(g)){if(g.pos+T>=S){var V=S-g.pos;y.push((0,e.readBytes)(V)(g)),C+=V;break}y.push((0,e.readBytes)(T)(g)),C+=T}for(var z=new Uint8Array(C),x=0,$=0;$<y.length;$++)z.set(y[$],x),x+=y[$].length;return z}},i=(0,s.conditional)({gce:[{codes:(0,e.readBytes)(2)},{byteSize:(0,e.readByte)()},{extras:(0,e.readBits)({future:{index:0,length:3},disposal:{index:3,length:3},userInput:{index:6},transparentColorGiven:{index:7}})},{delay:(0,e.readUnsigned)(!0)},{transparentColorIndex:(0,e.readByte)()},{terminator:(0,e.readByte)()}]},function(p){var g=(0,e.peekBytes)(2)(p);return g[0]===33&&g[1]===249}),r=(0,s.conditional)({image:[{code:(0,e.readByte)()},{descriptor:[{left:(0,e.readUnsigned)(!0)},{top:(0,e.readUnsigned)(!0)},{width:(0,e.readUnsigned)(!0)},{height:(0,e.readUnsigned)(!0)},{lct:(0,e.readBits)({exists:{index:0},interlaced:{index:1},sort:{index:2},future:{index:3,length:2},size:{index:5,length:3}})}]},(0,s.conditional)({lct:(0,e.readArray)(3,function(p,g,m){return Math.pow(2,m.descriptor.lct.size+1)})},function(p,g,m){return m.descriptor.lct.exists}),{data:[{minCodeSize:(0,e.readByte)()},t]}]},function(p){return(0,e.peekByte)()(p)===44}),o=(0,s.conditional)({text:[{codes:(0,e.readBytes)(2)},{blockSize:(0,e.readByte)()},{preData:function(g,m,y){return(0,e.readBytes)(y.text.blockSize)(g)}},t]},function(p){var g=(0,e.peekBytes)(2)(p);return g[0]===33&&g[1]===1}),l=(0,s.conditional)({application:[{codes:(0,e.readBytes)(2)},{blockSize:(0,e.readByte)()},{id:function(g,m,y){return(0,e.readString)(y.blockSize)(g)}},t]},function(p){var g=(0,e.peekBytes)(2)(p);return g[0]===33&&g[1]===255}),h=(0,s.conditional)({comment:[{codes:(0,e.readBytes)(2)},t]},function(p){var g=(0,e.peekBytes)(2)(p);return g[0]===33&&g[1]===254}),c=[{header:[{signature:(0,e.readString)(3)},{version:(0,e.readString)(3)}]},{lsd:[{width:(0,e.readUnsigned)(!0)},{height:(0,e.readUnsigned)(!0)},{gct:(0,e.readBits)({exists:{index:0},resolution:{index:1,length:3},sort:{index:4},size:{index:5,length:3}})},{backgroundColorIndex:(0,e.readByte)()},{pixelAspectRatio:(0,e.readByte)()}]},(0,s.conditional)({gct:(0,e.readArray)(3,function(p,g){return Math.pow(2,g.lsd.gct.size+1)})},function(p,g){return g.lsd.gct.exists}),{frames:(0,s.loop)([i,l,h,r,o],function(p){var g=(0,e.peekByte)()(p);return g===33||g===44})}],u=c;n.default=u})(fo)),fo}var ip=tp();const sp=Qu(ip);var np=Th();const rp=(n,s)=>{const e=new Array(n.length),t=n.length/s,i=function(u,p){const g=n.slice(p*s,(p+1)*s);e.splice.apply(e,[u*s,s].concat(g))},r=[0,4,2,1],o=[8,8,4,2];for(var l=0,h=0;h<4;h++)for(var c=r[h];c<t;c+=o[h])i(c,l),l++;return e},op=(n,s,e)=>{const r=e;var o,l,h,c,u,p,g,$,m,y,x,S,Y,Q,qe,Ae;const C=new Array(e),T=new Array(4096),V=new Array(4096),z=new Array(4097);for(S=n,l=1<<S,u=l+1,o=l+2,g=-1,c=S+1,h=(1<<c)-1,m=0;m<l;m++)T[m]=0,V[m]=m;var x,$,Y,Q,Ae,qe;for(x=$=Y=Q=Ae=qe=0,y=0;y<r;){if(Q===0){if($<c){x+=s[qe]<<$,$+=8,qe++;continue}if(m=x&h,x>>=c,$-=c,m>o||m==u)break;if(m==l){c=S+1,h=(1<<c)-1,o=l+2,g=-1;continue}if(g==-1){z[Q++]=V[m],g=m,Y=m;continue}for(p=m,m==o&&(z[Q++]=Y,m=g);m>l;)z[Q++]=V[m],m=T[m];Y=V[m]&255,z[Q++]=Y,o<4096&&(T[o]=g,V[o]=Y,o++,(o&h)===0&&o<4096&&(c++,h+=o)),g=p}Q--,C[Ae++]=z[Q],y++}for(y=Ae;y<r;y++)C[y]=0;return C},ap=n=>{const s=new Uint8Array(n);return Re.parse(np.buildStream(s),sp)},lp=n=>{const s=n.pixels.length,e=new Uint8ClampedArray(s*4);for(var t=0;t<s;t++){const i=t*4,r=n.pixels[t],o=n.colorTable[r]||[0,0,0];e[i]=o[0],e[i+1]=o[1],e[i+2]=o[2],e[i+3]=r!==n.transparentIndex?255:0}return e},hp=(n,s,e)=>{if(!n.image){console.warn("gif frame does not have associated image.");return}const{image:t}=n,i=t.descriptor.width*t.descriptor.height;var r=op(t.data.minCodeSize,t.data.blocks,i);t.descriptor.lct.interlaced&&(r=rp(r,t.descriptor.width));const o={pixels:r,dims:{top:n.image.descriptor.top,left:n.image.descriptor.left,width:n.image.descriptor.width,height:n.image.descriptor.height}};return t.descriptor.lct&&t.descriptor.lct.exists?o.colorTable=t.lct:o.colorTable=s,n.gce&&(o.delay=(n.gce.delay||10)*10,o.disposalType=n.gce.extras.disposal,n.gce.extras.transparentColorGiven&&(o.transparentIndex=n.gce.transparentColorIndex)),o.patch=lp(o),o},cp=(n,s)=>n.frames.filter(e=>e.image).map(e=>hp(e,n.gct));async function xh(n){const e=await(await fetch(n)).arrayBuffer(),t=ap(e),i=cp(t);return{gif:t,gifFrames:i,arrayBuffer:e}}function Oh(n,s,e){return n<s?s:n>e?e:n}class Dh extends Jn{constructor(e,t=!0,i){super();a(this,"_gifFrames",this.disposeVar(w(void 0)));a(this,"_gifDurations",[]);a(this,"_gifDuration",this.disposeVar(w(0)));a(this,"_gifSize",this.disposeVar(w([0,0],(e,t)=>e.every((i,r)=>i===t[r]),e=>[...e])));a(this,"_autoPlayOnLoad",this.disposeVar(w(!0)));a(this,"_gifCanvas");this._container=e,this.loop=!0;const r=document.createElement("canvas");this._gifCanvas=r,r.style.width="100%",r.style.height="100%";const o=r.getContext("2d");this._container&&this._container.appendChild(r),this.dispose(()=>this._container&&this._container.removeChild(r));let l;this.dispose(this._gifFrames.changed.disposableOn(c=>{if(!c||c.length===0){r.width=0,r.height=0;return}const{width:u,height:p}=c[0].dims;this._gifSize.value=[u,p];const g=c.length;let m=0;this._gifDurations.length=0;for(let y=0;y<g;++y)m+=c[y].delay,this._gifDurations.push(m);this._gifDuration.value=this._gifDurations[this._gifDurations.length-1],r.width=u,r.height=p,l=o.createImageData(u,p),this.currentTimeChangedEvent.emit(this.currentTime,this.currentTime),this._autoPlayOnLoad.value&&(this.currentTime=0,this.playing=!0)}));let h=-1;this.dispose(this.currentTimeChangedEvent.disposableOn(c=>{const u=Oh(c/this.duration,0,1),p=this.gifDuration*u,g=this._gifFrames.value;if(g&&g.length>0){const m=this._getFrame(p);if(m===h)return;h=m;const y=g[m];if(y.disposalType!==0&&y.disposalType!==1&&y.disposalType!==2&&is(`gif parsed get disposalType ${y.disposalType}... frame: ${m} size: ${JSON.stringify(y.dims)}`,`gif parsed get disposalType ${y.disposalType}...`),l&&(m===0||y.disposalType===2)&&l.data.fill(0),l){const[S,C]=this._gifSize.value,{width:T,height:V,left:z,top:x}=y.dims;if(V>C)throw new Error("height > canvasHeight");for(let $=0;$<V;++$)for(let Y=0;Y<T;++Y){const Q=$*T+Y,Ae=x+$,qe=z+Y,jt=Ae*S+qe,mt=l.data,fi=y.patch,mi=fi[Q*4+3]/255;mt[jt*4+0]=mt[jt*4+0]*(1-mi)+fi[Q*4+0]*mi|0,mt[jt*4+1]=mt[jt*4+1]*(1-mi)+fi[Q*4+1]*mi|0,mt[jt*4+2]=mt[jt*4+2]*(1-mi)+fi[Q*4+2]*mi|0,mt[jt*4+3]=Oh(mt[jt*4+3]+fi[Q*4+3],0,255)|0}o.putImageData(l,0,0)}}else is("gif资源未加载!无法播放!")})),this.dispose(this._gifDuration.changed.disposableOn(()=>{this.duration=this.gifDuration})),this._autoPlayOnLoad.value=t,this._gifFrames.value=i}get gifCanvas(){return this._gifCanvas}set gifFrames(e){this._gifFrames.value=e}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(e){this._autoPlayOnLoad.value=e}get autoPlayOnLoadChanged(){return this._autoPlayOnLoad.changed}_getFrame(e){const t=this._gifDurations.length;for(let i=0;i<t;++i)if(e<=this._gifDurations[i])return i;throw new Error("should not be here")}}class Fh extends b{constructor(e){super();a(this,"_player");a(this,"_url",this.disposeVar(w("")));a(this,"_loadGifFramesProcessing",this.disposeVar(Gn(e=>hs(xh(e)))));this._player=this.disposeVar(new Dh(e)),this._player.autoPlayOnLoad=!0,this._loadGifFramesProcessing.completeFunc=({gifFrames:t})=>this._player.gifFrames=t,this.dispose(this._url.changed.disposableOn(t=>{this._player.gifFrames=void 0,this._loadGifFramesProcessing.restart(new st(`reload gif(${t})`),t)}))}get player(){return this._player}set url(e){this._url.value=e}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 kh extends b{constructor(e,t){super();a(this,"_gif",this.disposeVar(new Fh));a(this,"_update");this._complexImage=e,this._imageUri=t,this._gif.url=this._imageUri,this._update=this.disposeVar(cs(()=>this.update())),this._update.start()}get gif(){return this._gif}update(){const{player:e}=this._gif;if(!e.gifFrames)return;const t=this._complexImage,{width:i,height:r}=e.gifCanvas;t.size=[i,r],t.pixelFormat="RGBA",t.copyTexture({source:e.gifCanvas});{const o=()=>{e.autoPlayOnLoad=this._complexImage.autoplay};o(),this.dispose(this._complexImage.autoplayChanged.disposableOn(o))}{const o=()=>{e.loop=this._complexImage.loop};o(),this.dispose(this._complexImage.loopChanged.disposableOn(o))}}}function Mh(n,s){const[e,t,i]=tn(n),r=w(void 0),o=()=>{const l=e()??s;r.value=l&&M.context.getStrFromEnv(l)};return o(),i&&r.d(i.don(o)),r.d(M.context.environmentVariablesChanged.don(o)),r}function Ah(n){const s=/\${(.*?)\}/g;if(!s.test(n))return n;const e=n.replace(s,(t,i)=>{const r=M.context.getEnv(i);return r===void 0?(console.warn(`环境变量(${i})不存在,无法进行转换`),"{env-error}"):r});return Ah(e)}class dp extends b{constructor(e){super();a(this,"_sceneObjRefs",new Map);a(this,"_refs",{});a(this,"_refsChanged",this.dv(new v));const t=(i,r,o)=>{if(o){const l=this.getLastSceneObject(o),h=this._sceneObjRefs.get(o);if(!h)console.warn(`this._sceneObjRefs中不存在ref(${o}), 可能系统存在逻辑问题`);else{const u=h.indexOf(i);u===-1?console.warn(`this._sceneObjRefs中不存在当前对象(id: ${i.id} type: ${i.typeName})!可能系统存在逻辑问题`):(h.splice(u,1),h.length===0&&this._sceneObjRefs.delete(o))}const c=this.getLastSceneObject(o);this._refs[o]=c,this._refsChanged.emit(c,l)}if(r){const l=this.getLastSceneObject(r),h=this._sceneObjRefs.get(r);h?(h.push(i),h.length>0&&console.warn(`同时存在多个ref${r}相同的场景对象!
|
|
22
22
|
${h.map(u=>`${u.id} ${u.typeName}
|
|
23
|
-
`).join(" ")}`)):this._sceneObjRefs.set(r,[i]);const c=this.getLastSceneObject(r);this._refs[r]=c,this._refsChanged.emit(c,l)}};this.d(e.sceneObjCreatedEvent.don(i=>{const r=(o,l)=>t(i,o,l);i.ref&&r(i.ref,void 0),i.refChanged.don(r)})),this.d(e.sceneObjToDestroyEvent.don(i=>{i.ref&&t(i,void 0,i.ref)}))}get sceneObjRefs(){return this._sceneObjRefs}get refs(){return this._refs}get refsChanged(){return this._refsChanged}getLastSceneObject(e){const t=this.getSceneObjects(e);if(t)return t[t.length-1]}getSceneObjects(e){const t=this._sceneObjRefs.get(e);if(!(!t||t.length===0))return t}}class dp extends b{constructor(){super();a(this,"_esObjConstructors",new Map);a(this,"_sceneObjs",new Map);a(this,"_sceneObjCreatedEvent",new v);a(this,"_sceneObjToDestroyEvent",new v);a(this,"_refsManager",this.dv(new cp(this)));a(this,"_environmentVariables",globalThis.ESSDK_ENV||{});a(this,"_environmentVariablesChanged",this.dv(new v))}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(e,t,i){return this._esObjConstructors.has(e)&&console.warn(`register warn: ${e} has registered ! will be override!`),this._esObjConstructors.set(e,t),i&&vt(t,"__sceneObjExtraInfo",i),e}_addSceneObject(e){this._sceneObjs.set(e.id,e),this._sceneObjCreatedEvent.emit(e),e.d(()=>this._deleteSceneObject(e))}addSceneObject(e){this._addSceneObject(e)}_deleteSceneObject(e){this._sceneObjToDestroyEvent.emit(e),this._sceneObjs.delete(e.id)}deleteSceneObject(e){this._deleteSceneObject(e)}createSceneObjectFromClass(e,t){if(!t||this._sceneObjs.has(t)){const r=ns();t&&console.warn(`已存在相同id的对象!id自动变更!${t} -> ${r} 请注意:id变更可能导致引用失效!`),t=r}if(!t)throw new Error("id不能为空!");const i=new e(t);return i.id!==t&&(console.warn(`sceneObj.id(${i.id}) !== id(${t}) sceneObjectType: ${i.typeName}`),console.warn("出现这种问题有可能是自定义的场景对象,没有在构造函数中传递id参数!示例如下:"),console.warn("class XXX extends XXX { constructor(id) { super(id); } }")),this._addSceneObject(i),i}createSceneObject(e,t){if(typeof e=="string"){const i=this._getSceneObjConstructor(e);if(!i){console.warn(`Cannot find SceneObjectType: ${e}`);return}return this.createSceneObjectFromClass(i,t)}else return this.createSceneObjectFromClass(e,t)}createSceneObjectFromUrl(e,t){let i;const r=e.toLowerCase();if(r.includes(".gltf")||r.includes(".glb")?i="ESGltfModel":r.includes("tileset.json")?i="ES3DTileset":r.includes("layer.json")||r.includes("ion://1")?i="ESTerrainLayer":r.includes(".jpg")||r.includes(".png")||r.includes(".jpeg")||r.includes(".webp")||r.includes("image/jpg")||r.includes("image/png")||r.includes("image/jpeg")||r.includes("image/webp")?i="ESImageLabel":(r.includes("/tilemapresource.xml")||r.includes("ion://")||r.includes("wms")||r.includes("wmts")||r.includes("{x}")||r.includes("{y}")||r.includes("{z}"))&&(i="ESImageryLayer"),!!i)return this.createSceneObjectFromJson({type:i,id:t,url:e})}createSceneObjectFromJson(e){const t=this.createSceneObject(e.type,e.id);return t&&(t.json=e),t}destroySceneObject(e){return this._deleteSceneObject(e),e.destroy(),e.isDestroyed()}getSceneObjectById(e){return this._sceneObjs.get(e)}getSceneObject(e){if(!e&&e!="")return Array.from(this._sceneObjs.values());if(typeof e=="function"){const t=[];for(const i of this._sceneObjs.values())i instanceof e&&t.push(i);return t}if(e.startsWith("ES")){const t=[];for(const i of this._sceneObjs.values())i.typeName===e&&t.push(i);return t}return this._sceneObjs.get(e)}_getSceneObjConstructor(e){const t=this._esObjConstructors.get(e);if(t)return t}getProps(e){const t=this._getSceneObjConstructor(e);if(!t){console.warn(`cannot get constructor from type: ${e}`);return}return Ne(t,"__sceneObjExtraInfo")}setProps(e,t){const i=this._getSceneObjConstructor(e);if(!i){console.warn(`cannot get constructor from type: ${e}`);return}let r=Ne(i,"__sceneObjExtraInfo");r||(r={},vt(i,"__sceneObjExtraInfo",r)),Object.assign(r,t)}getProp(e,t){const i=this.getProps(e);return i&&i[t]}setProp(e,t,i){this.setProps(e,{[t]:i})}get environmentVariables(){return this._environmentVariables}set environmentVariables(e){for(let[t,i]of Object.entries(e))this.setEnv(t,i)}get environmentVariablesChanged(){return this._environmentVariablesChanged}setEnv(e,t){if(this._environmentVariables[e]!==t){const i=this._environmentVariables[e];this._environmentVariables[e]=t,this._environmentVariablesChanged.emit(e,t,i)}globalThis.ESSDK_ENV={...this._environmentVariables}}getEnv(e){return this._environmentVariables[e]}getStrFromEnv(e){return Ah(e)}createEnvStrReact(e,t){return Mh(e,t)}createEvnStrReact(e,t){return Mh(e,t)}}const H=class H extends b{constructor(e){super();a(this,"_components",this.dv(new Xn));a(this,"_viewerAttached",this.dv(new v));a(this,"_viewerDetached",this.dv(new v));a(this,"_attachedViewers",(()=>{const e=new Set;return this.d(this._viewerAttached.don(t=>{t.actived&&(this.activeViewer=t),t.ad(t.activedChanged.don(i=>{i&&e.has(t)&&(this.activeViewer=t)})),e.add(t)})),this.d(this._viewerDetached.don(t=>{e.delete(t),this.activeViewer==t&&(this.activeViewer=void 0)})),e})());a(this,"_activeViewer",this.dv(w(void 0)));a(this,"_reloadEvent",this.dv(new v));a(this,"_readyEvent",this.dv(new v));a(this,"_createdEvent",this.dv(new v));a(this,"_flushEvent",this.dv(new v));a(this,"_id");a(this,"_updateFuncReact",this.dv(w(void 0)));a(this,"_toDestroyFuncReact",this.dv(w(void 0)));a(this,"_parentID");e!==void 0&&(typeof e!="string"?console.warn(`对象id必须是字符串类型,当前id的类型是${typeof e},值为${e}`):e.trim()===""?console.warn("场景对象创建时的id不能是空字符串!"):e.trim()!==e&&console.warn(`id前后有空字符串!id: ${e}`)),this._id=e??ns(),this._initName();{const t=()=>{if(this.execOnceFuncStr)try{Function(`"use strict";return (${this.execOnceFuncStr})`)()(this)}catch(i){console.warn(`execOnceFuncStr不能转成函数!或者函数执行时错误!id: ${this.id} ${this.typeName} error: ${i}`)}};t(),this.d(this.execOnceFuncStrChanged.don(t))}{const t=()=>{if(this.updateFuncStr)try{this.updateFunc=Function(`"use strict";return (${this.updateFuncStr})`)()}catch(r){console.warn(`updateFuncStr不能转成函数!或者函数执行时错误!id: ${this.id} ${this.typeName} error: ${r}`)}};t(),this.d(this.updateFuncStrChanged.don(t));let i;this.d(()=>i&&i.destroy()),this.d(this.updateFuncChanged.don(()=>{i&&i.cancel(),this.updateFunc&&(i=i||dn(),i.restart(void 0,r=>{this.updateFunc&&this.updateFunc(this,r)}))}))}{const t=()=>{try{this.toDestroyFunc=this.toDestroyFuncStr&&Function(`"use strict";return (${this.toDestroyFuncStr})`)()||void 0}catch(i){console.warn(`toDestroyFuncStr不能转成函数!或者函数执行时错误!id: ${this.id} ${this.typeName} error: ${i}`),this.toDestroyFunc=void 0}};t(),this.d(this.toDestroyFuncStrChanged.don(t)),this.d(this.toDestroyEvent.don(()=>{this.toDestroyFunc&&this.toDestroyFunc(this)}))}}static getParentClass(){return Object.getPrototypeOf(this)}static register(e,t,i){Kt(t.prototype,t.createDefaultProps);const r=t.createDefaultProps();t.defaults&&(t.defaults={});for(const o of Object.keys(r))t.defaults[o]=r[o]instanceof ge?r[o].value:r[o];return this.innerRegister(e,t,i),e}static get envs(){return H.context.environmentVariables}static get $refs(){return H.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(e){this._activeViewer.value=e}get activeViewerChanged(){return this._activeViewer.changed}removefromViewer(e){this.attachedViewers.has(e)&&e.delete(this)}get reloadEvent(){return this._reloadEvent}reload(){this._reloadEvent.emit()}get readyEvent(){return this._readyEvent}addToViewer(e){this.attachedViewers.has(e)||e.add(this)}registerAttachedObject(e){const t=new Map;this.d(()=>{t.size>0&&console.warn("viewerPropSceneObjects.size > 0")}),this.d(this._viewerAttached.don(i=>{const r=e(i);r&&t.set(i,r)})),this.d(this._viewerDetached.don(i=>{if(!t.has(i))return;const r=t.get(i);r&&(r.destroy(),t.delete(i))}))}createAttachedObject(e){const t=new Map,i=(()=>{for(let[h,c]of t.entries())c.destroy();t.clear()}),r=h=>{const c=e(h);c&&t.set(h,c)};for(let h of this.attachedViewers)r(h);const o=this._viewerAttached.don(r),l=this._viewerDetached.don(h=>{if(!t.has(h))return;const c=t.get(h);c&&(c.destroy(),t.delete(h))});return()=>{l(),o(),i()}}registerAttachedObjectForContainer(e){this.registerAttachedObject(t=>new up(t,e))}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(e=!0){const t={id:this.id,type:this.typeName};for(let i of Object.keys(this.defaultProps))if(e){let r,o=this.defaultProps[i];o instanceof ge?r=o.equals(this[i]):r=o===this[i],r||(t[i]=this[i])}else t[i]=this[i];return t}_innerSetJson(e,t,i){if(!(e instanceof Object)||e.type&&e.type!==this.typeName){console.error(`value.type && value.type${e.type} !== this.typeName${this.typeName}`);return}e.id&&e.id!==this.id&&console.warn(`value.id === undefined || value.id${e.id} !== this.id(${this.id})`);const r=t||[];r.push("id","type");const o=Object.keys(this.defaultProps).filter(l=>!r.includes(l));for(let l of o)if(l in e)this[l]=e[l]===null?void 0:e[l];else if(!(i??!1)){let h=this.defaultProps[l];h instanceof ge&&(h=h.value),this[l]=h}}get completeJson(){return this._innerGetJson(!1)}get json(){return this._innerGetJson()}set json(e){this._innerSetJson(e)}get _jsonStr(){return JSON.stringify(this.json,null,4)}set _jsonStr(e){this._innerSetJson(JSON.parse(e))}get updateFunc(){return this._updateFuncReact.value}set updateFunc(e){this._updateFuncReact.value=e}get updateFuncChanged(){return this._updateFuncReact.changed}get toDestroyFunc(){return this._toDestroyFuncReact.value}set toDestroyFunc(e){this._toDestroyFuncReact.value=e}get toDestroyFuncChanged(){return this._toDestroyFuncReact.changed}get parentID(){return this._parentID??this.id}set parentID(e){this._parentID=e}getESProperties(){return{defaultMenu:"general",basic:[],general:[new N([this,"typeName"],"类型",void 0,!1,!0),new N([this,"id"],"id",void 0,!1,!0),new N([this,"name"],"名称"),new _o("JSON",()=>this._jsonStr,e=>e&&(this._jsonStr=e))],dataSource:[],location:[],coordinate:[],style:[],more:[new N([this,"ref"],"ref",void 0,!0),new R([this,"extras"],"extras",{},void 0,!0)]}}};a(H,"context",new dp),a(H,"innerRegister",H.context.register.bind(H.context)),a(H,"defaults",{}),a(H,"createDefaultProps",()=>({name:"未命名场景对象",ref:void 0,extras:B(void 0),devTags:q(void 0),execOnceFuncStr:void 0,updateFuncStr:void 0,toDestroyFuncStr:void 0})),a(H,"type",H.register("ESSceneObject",H,{chsName:"场景类",tags:["ESObjects","base"],description:""})),a(H,"create",H.context.createSceneObject.bind(H.context)),a(H,"createFromUrl",H.context.createSceneObjectFromUrl.bind(H.context)),a(H,"createFromClass",H.context.createSceneObjectFromClass.bind(H.context)),a(H,"createFromJson",H.context.createSceneObjectFromJson.bind(H.context)),a(H,"destroySceneObject",H.context.destroySceneObject.bind(H.context)),a(H,"getSceneObjById",H.context.getSceneObjectById.bind(H.context)),a(H,"getSceneObj",H.context.getSceneObject.bind(H.context)),a(H,"getEnv",H.context.getEnv.bind(H.context)),a(H,"setEnv",H.context.setEnv.bind(H.context)),a(H,"getStrFromEnv",H.context.getStrFromEnv.bind(H.context)),a(H,"getSceneObjectById",H.context.getSceneObjectById.bind(H.context)),a(H,"getSceneObject",H.context.getSceneObject.bind(H.context));let M=H;class up extends b{constructor(s,e){super(),this.dv(new le(s.subContainerChanged,()=>{if(s.subContainer)return e(s,s.subContainer)}))}}const Dr=class Dr extends b{constructor(e,t,i){super();a(this,"_id",++Dr._accumId);this._name=e,this._description=t,this._callFunction=i}get id(){return this._id}get name(){return this._name}get description(){return this._description}get callFunction(){return this._callFunction}};a(Dr,"_accumId",-1);let ei=Dr;class mo extends ei{constructor(s,e,t,i,r,o){super(s,e,o??(()=>{})),this._withUndefined=t,this._readonly=i,this._defaultValue=r}get withUndefined(){return this._withUndefined}get readonly(){return this._readonly}get defaultValue(){return this._defaultValue instanceof Function?this._defaultValue():this._defaultValue}}class Te extends mo{constructor(e,t,i,r,o,l,h){var u;const c=e instanceof ge?"未获取到属性名":e[1].toString();super(t??c,l??c,r??!1,o??!1,i,h);a(this,"_propName");a(this,"_typeName");this._reactVar=e,this._propName=c;try{this._typeName=e instanceof ge?"未获取到对象类型":(u=e[0])==null?void 0:u.typeName}catch{this._typeName="未获取到对象类型"}}get reactVar(){return this._reactVar}get propName(){return this._propName}get typeName(){return this._typeName}}class E extends Te{get type(){return"BooleanProperty"}}class N extends Te{get type(){return"StringProperty"}}class f extends Te{get type(){return"NumberProperty"}}class ne extends Te{get type(){return"Number2Property"}}class ue extends Te{get type(){return"Number3Property"}}class Fe extends Te{get type(){return"Number4Property"}}class G extends Fe{get type(){return"ColorProperty"}}class Yn extends f{get type(){return"DashPatternProperty"}}class Ve extends Te{get type(){return"DateProperty"}}class vo extends Te{get type(){return"DatesProperty"}}class k extends ei{constructor(e,t,i){super(e??"",i??"");a(this,"_placement");this._placement=t}get type(){return"DivideProperty"}get placement(){return this._placement}}class A extends Te{constructor(s,e,t,i,r,o,l){super(s,t,i,r,o,l),this._enums=e}get type(){return"EnumProperty"}get enums(){return this._enums}}class Xe extends Te{constructor(s,e,t,i,r,o,l){super(s,e,t,r,o,l),this._sampleValue=i}get sampleValue(){return this._sampleValue}get type(){return"EvalStringProperty"}}class _n extends Te{constructor(s,e,t,i,r,o,l){super(s,e,t,r,o,l),this._sampleValue=i}get sampleValue(){return this._sampleValue}get type(){return"LongStringProperty"}}class L extends ei{constructor(e,t,i,r){const o=e??"Unnamed Function";super(o,r??o);a(this,"_paramsLength");this._func=t,this._defaultParams=i,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(...e){this._func(...e)}get type(){return"MethodProperty"}}class pe extends Te{constructor(s,e,t,i,r,o,l,h){super(s,i,r,o,l,h),this._step=e,this._minMax=t}get type(){return"NumberSliderProperty"}get minMax(){return this._minMax}get step(){return this._step}}class nt extends ue{get type(){return"PositionProperty"}}class ds extends ue{get type(){return"RotationProperty"}}function pp(n,s){const[e,t,i]=tn(n),[r,o,l]=tn(s),h=w((e()??0)/(r()??3e3)),c=()=>{const u=h.value,p=r()??3e3,g=e()??0;if(!Number.isFinite(p)||!Number.isFinite(g)){console.warn(`duration || currentTime error: duration: ${p} currentTime: ${g}`);return}Math.abs(u*p-g)<.001||(p<=0?h.value=0:h.value=g/p)};return h.dispose(i.disposableOn(c)),h.dispose(l.disposableOn(c)),h.dispose(h.changed.disposableOn(()=>{const u=h.value,p=r()??3e3,g=e()??0;if(!Number.isFinite(p)||!Number.isFinite(g)){console.warn(`duration || currentTime error: duration: ${p} currentTime: ${g}`);return}Math.abs(u*p-g)<.001||t(u*p)})),h}class us extends ei{constructor(e,t,i,r,o,l){super(r??"播放器",l??"播放器");a(this,"_defaults",{playing:!1,ratio:0,loop:!1});this._playingReact=e,this._ratioReact=t,this._loopReact=i,o&&(this._defaults.playing=o.playing??this._defaults.playing,this._defaults.ratio=o.ratio??this._defaults.ratio,this._defaults.loop=o.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}}a(us,"createPlayingRatio",pp);class jh extends ei{constructor(e,t,i,r,o,l){const h=r??"视角播放器";super(h,l??h);a(this,"_defaults",{playing:!1,loop:!1});this._playingReact=e,this._stopFn=t,this._loopReact=i,o&&(this._defaults.playing=o.playing??this._defaults.playing,this._defaults.loop=o.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 ie extends Te{constructor(s,e,t,i,r,o,l){super(s,e,t,r,o,l),this._sampleValue=i}get sampleValue(){return this._sampleValue}get type(){return"JsonArrayProperty"}}class R extends Te{constructor(s,e,t,i,r,o,l){super(s,e,t,r,o,l),this._sampleValue=i}get sampleValue(){return this._sampleValue}get type(){return"JsonProperty"}}class _o extends mo{constructor(s,e,t,i,r,o){super(s,o??s,i??!1,r??!1),this._getFunc=e,this._setFunc=t}get getFunc(){return this._getFunc}get setFunc(){return this._setFunc}get type(){return"GetSetProperty"}}var I=(n=>(n.Place="place",n.BrushErase="brushErase",n.Translation="translation",n.Rotation="rotation",n.Scale="scale",n.DoublePointsAppend="doublePointsAppend",n.DoublePointsModify="doublePointsModify",n.CircularAppend="circularAppend",n.CircularInsert="circularInsert",n.LineStringAppend="lineStringAppend",n.LineStringInsert="lineStringInsert",n.ScatterAppend="scatterAppend",n.ScatterModify="scatterModify",n.VisibilityAppend="visibilityAppend",n.VisibilityModify="visibilityModify",n.HeightModify="heightModify",n.SinglePoint="singlePoint",n.DoublePoints="doublePoints",n))(I||{});const yo=[["地形","TERRAIN"],["3D Tiles","CESIUM_3D_TILE"],["地形和3D Tiles","BOTH"]],wo=[["直箭头","straightArrow"],["燕尾箭头","swallowTailArrow"]];var Rh=(n=>(n.DECIMAL_DEGREE="DECIMAL_DEGREE",n.DEGREES_DECIMAL_MINUTES="DEGREES_DECIMAL_MINUTES",n.SEXAGESIMAL_DEGREE="SEXAGESIMAL_DEGREE",n))(Rh||{});class gp{constructor(s){this.childPickedInfo=s}}class fp{constructor(s,e,t,i,r,o){this.pickResult=s,this.sceneObject=e,this.tilesetPickInfo=t,this.geojsonPickInfo=i,this.attachedInfo=r,this.screenPosition=o}assign(s){s!=null&&s.pickedResult&&(this.pickResult=s.pickedResult),s!=null&&s.sceneObject&&(this.sceneObject=s.sceneObject),s!=null&&s.tilesetPickInfo&&(this.tilesetPickInfo=s.tilesetPickInfo),s!=null&&s.geojsonPickInfo&&(this.geojsonPickInfo=s.geojsonPickInfo),s!=null&&s.attachedInfo&&(this.attachedInfo=s.attachedInfo),s!=null&&s.screenPosition&&(this.screenPosition=s.screenPosition)}}const ae=class ae extends M{constructor(e){super(e);a(this,"_editing",this.dv(w(!1)));a(this,"editingID");a(this,"editingBindMode","singlePoint");a(this,"_deprecated",[]);a(this,"_flyInEvent",this.dv(new v));a(this,"_flyToEvent",this.dv(new v));a(this,"_flyOverEvent",this.disposeVar(new v));a(this,"_pickedEvent",this.dv(new v));a(this,"_calcFlyToParamEvent",this.dv(new v));a(this,"_calcFlyInParamEvent",this.dv(new v));a(this,"useCalcFlyToParamInESObjectWithLocation",!1);Uh(this,this.updateEditing)}supportEditingModes(){return this.constructor.supportEditingModes}get editing(){return this._editing.value}set editing(e){this._editing.value=e}get editingChanged(){return this._editing.changed}updateEditing(){}_deprecatedWarning(){const e=this._deprecated;for(let t=0;t<e.length;t++){const i=e[t];typeof i=="string"?Reflect.has(this,i+"Changed")&&this.d(this[i+"Changed"].don(()=>{console.warn(`注意:${this.typeName} 的 ${i} 属性下版本将会被移除!`)})):Object.keys(i).forEach(r=>{Reflect.has(this,r+"Changed")&&this.d(this[r+"Changed"].don(l=>{const h=i[r];typeof h=="string"?console.warn(`注意:${this.typeName} 的 ${r} 属性下版本将会被移除!`):Object.keys(h).forEach((c=>{l===c&&console.warn(`注意:${this.typeName} 的 ${r} 属性值 ${c} 下版本将会被移除,推荐使用属性值 ${h[c]}`)}))}))})}}get flyInEvent(){return this._flyInEvent}flyIn(e=1){this._flyInEvent.emit(e,ae._lastFlyInId)}get flyToEvent(){return this._flyToEvent}flyTo(e=1){this._flyToEvent.emit(e,ae._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(e){return await e.getBoundSphere(this.id)}getESProperties(){const e={...super.getESProperties()};return{...e,general:[...e.general,new E([this,"show"],"是否显示",ae.defaults.show),new E([this,"collision"],"开启碰撞",ae.defaults.collision),new E([this,"allowPicking"],"允许拾取",ae.defaults.allowPicking),new L("保存观察视角",()=>this.calcFlyToParam(),[]),new L("清空飞向参数",()=>this.emptyFlyToParam(),[]),new L("保存飞入参数",()=>this.calcFlyInParam(),[]),new L("清空飞入参数",()=>this.emptyFlyInParam(),[])],more:[...e.more,new k("飞行定位"),new L("飞向",t=>this.flyTo(t),[1],"flyTo"),new R([this,"flyToParam"],"飞行参数",void 0,void 0,!0),new f([this,"flyToDistance"],"flyToDistance",void 0,!0),new f([this,"flyToHeading"],"flyToHeading",void 0,!0),new f([this,"flyToPitch"],"flyToPitch",void 0,!0),new f([this,"flyToFlyDuration"],"flyToFlyDuration",void 0,!0),new f([this,"flyToHDelta"],"flyToHDelta",void 0,!0),new f([this,"flyToPDelta"],"flyToPDelta",void 0,!0),new k("飞入参数"),new L("飞入",t=>this.flyIn(t),[1],"flyIn"),new R([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(e){this.flyToParam=e!==void 0?{...this.flyToParam??ae.defaultFlyToParam,distance:e}:void 0}set flyToHeading(e){this.flyToParam=e!==void 0?{...this.flyToParam??ae.defaultFlyToParam,heading:e}:void 0}set flyToPitch(e){this.flyToParam=e!==void 0?{...this.flyToParam??ae.defaultFlyToParam,pitch:e}:void 0}set flyToFlyDuration(e){this.flyToParam=e!==void 0?{...this.flyToParam??ae.defaultFlyToParam,flyDuration:e}:void 0}set flyToHDelta(e){this.flyToParam=e!==void 0?{...this.flyToParam??ae.defaultFlyToParam,hDelta:e}:void 0}set flyToPDelta(e){this.flyToParam=e!==void 0?{...this.flyToParam??ae.defaultFlyToParam,pDelta:e}:void 0}};a(ae,"createDefaultProps",()=>({...M.createDefaultProps(),show:!0,collision:!0,allowPicking:!1,flyToParam:te(void 0),flyInParam:te(void 0)})),a(ae,"type",ae.register("ESVisualObject",ae,{chsName:"可视化对象",tags:["ESObjects","base"],description:"可视化对象"})),a(ae,"supportEditingModes",[]),a(ae,"defaultFlyToParam",{distance:0,heading:0,pitch:0,flyDuration:1,hDelta:0,pDelta:0}),a(ae,"defaultFlyInParam",{position:[0,0,0],rotation:[0,0,0],flyDuration:1}),a(ae,"_lastFlyInId",0),a(ae,"_lastFlyToId",0);let X=ae;class Nh extends b{constructor(){super();a(this,"_data",this.dv(w(void 0)))}set data(e){this._data.value=e}get data(){return this._data.value}get dataChanged(){return this._data.changed}}class Lh extends b{constructor(){super(...arguments);a(this,"_dragStartEvent",this.dv(new v));a(this,"_dragOverEvent",this.dv(new v));a(this,"_dragLeaveEvent",this.dv(new v));a(this,"_dropEvent",this.dv(new v))}dragStart(e){this._dragStartEvent.emit(e)}dragOver(e){this._dragOverEvent.emit(e)}dragLeave(e){this._dragLeaveEvent.emit(e)}drop(e){this._dropEvent.emit(e)}}function mp(n,s){s&&(Reflect.has(s,"editing")?s.editing=!0:Reflect.has(s,"positionEditing")&&(s.positionEditing=!0))}function vp(n){["Czm3DTiles","View","ESCameraView","OlView","GeoCameraController"].includes(n.typeName)||(Reflect.has(n,"editing")?n.editing=!0:Reflect.has(n,"positionEditing")&&(n.positionEditing=!0)),typeof n.execOnCreating=="function"&&n.execOnCreating()}function Kn(n,s){Ne(n,"__treeItem")&&console.error("setSceneObjectTreeItem error!"),vt(n,"__treeItem",s)}function _p(n){return Ne(n,"__treeItem")}function yp(n){if(!(n.startsWith("./")||n.startsWith("../")||n.startsWith("/")))return n;const s=document.createElement("a");s.href=n;const e=s.href;return s.remove(),e}function Eo(n){if(typeof n!="string")return!1;try{const s=JSON.parse(n);return typeof s=="object"&&s!==null}catch{return!1}}function wp(n){try{return new DOMParser().parseFromString(n,"application/xml").getElementsByTagName("parsererror").length===0}catch{return!1}}function Ep(n){return n instanceof Function?n():n}function Vh(n,s){for(let e of n)if(s.includes(e))return!0;return!1}function yn(n,s){const e=n,t=s;return e===void 0||e.length===0||t===void 0||t.length===0?!0:Vh(e,t)}function bp(n){const s=setTimeout(()=>{n(),clearTimeout(s)})}function ps(n){let s=n%360;return s=s<0?360+s:s,s}function zh(n){return ps(n+180)-180}function Zn(n,s,e){let t=ps(n),i=ps(s);Math.abs(t-i)>180&&(t<i?t+=360:i+=360);const r=t*(1-e)+i*e;return zh(r)}function bo(n,s,e,t){return t=t||[0,0,0],t[0]=Zn(n[0],s[0],e),t[1]=Zn(n[1],s[1],e),t[2]=Zn(n[2],s[2],e),t}function Uh(n,s,e="editing"){const t=new b;n.ad(t);const i=s.bind(n);return t.ad(new le(n.activeViewerChanged,()=>{const r=new b;let o=n.activeViewer;return o?(r.ad(n[`${e}Changed`].don(()=>{var l;n[`${e}`]?i():(l=(n.components.main??n).editingID)!=null&&l.includes("inner")&&n.activeViewer&&n.activeViewer.stopEditing()})),r.ad(o.editingEvent.don(l=>{if(l.objectIDs.includes(n.id)&&l.type==="end"){const h=n.components.main??n;h.editingID&&(l.editingID.includes(h.editingID)?(h.editingID=void 0,n[e]=!1):n[e]=!h.editingID.includes("outer"))}}))):r.ad(n[`${e}Changed`].don(()=>{n[`${e}`]=!1})),r})),n[`${e}`]&&i(),t}function Bh(n){var e;const s=Array.isArray(n)?"feature":((e=n.type)==null?void 0:e.toLowerCase())??"";switch(s){case"geometrycollection":return Sp(n);case"topology":const t=n.objects,i=[];for(const r in t){const o=Cd.feature(n,t[r]);i.push(...o.features)}return{type:"FeatureCollection",features:i};case"feature":return{type:"FeatureCollection",features:Array.isArray(n)?n:[n]};case"featurecollection":return n;default:return console.warn(`GeoJson数据转换可能有误,数据类型${s}`),{type:"FeatureCollection",features:Array.isArray(n.features)?n.features:[]}}}function Sp(n,s){const e=[],t=n.geometries||[];function i(r,o={}){!r||!r.type||(r.type==="GeometryCollection"&&Array.isArray(r.geometries)?r.geometries.forEach(l=>i(l,o)):e.push({type:"Feature",geometry:r,properties:{...r.properties||{},...o}}))}return t.forEach(r=>i(r,{})),{type:"FeatureCollection",features:e}}function Cp(n){const s=n.cloneNode(!0);s.style.position="fixed",s.style.visibility="hidden",s.style.pointerEvents="none",s.style.top="0",s.style.left="0",s.style.display="inline-block",document.body.appendChild(s);const e=s.getBoundingClientRect();return document.body.removeChild(s),{x:e.x,y:e.y,width:e.width,height:e.height}}function Pp(n,s,e=!1){var p,g,m,y,S,C;const t=[],i=[],r=[],o=[],l=[],h=new Set,c=new Map;if(s!=null&&s.features)for(const T of s.features){const V=((p=T.id)==null?void 0:p.toString())||((m=(g=T.properties)==null?void 0:g.id)==null?void 0:m.toString());V&&(h.add(V),c.set(V,T))}if(n!=null&&n.features)for(const T of n.features){const V=((y=T.id)==null?void 0:y.toString())||((C=(S=T.properties)==null?void 0:S.id)==null?void 0:C.toString());if(V)if(h.has(V)){if(e){const z=c.get(V);z&&Wh(z,T)?o.push(V):l.push(V)}t.push(V)}else i.push(V)}for(const T of h)t.includes(T)||r.push(T);const u={unchangedIds:t,newIds:i,removedIds:r};return e&&(u.contentUnchangedIds=o,u.contentUpdatedIds=l),u}function Wh(n,s){return Hh(n.geometry,s.geometry)?JSON.stringify(n.properties)===JSON.stringify(s.properties):!1}function Hh(n,s){if(n===s)return!0;if(!n||!s||n.type!==s.type)return!1;const e=n.coordinates,t=s.coordinates;if(n.type==="Point")return Tp(e,t);if(n.type==="LineString"||n.type==="MultiPoint")return Qn(e,t);if(n.type==="Polygon"){if(e.length!==t.length)return!1;for(let i=0;i<e.length;i++)if(!Qn(e[i],t[i]))return!1;return!0}if(n.type==="MultiLineString"){if(e.length!==t.length)return!1;for(let i=0;i<e.length;i++)if(!Qn(e[i],t[i]))return!1;return!0}if(n.type==="MultiPolygon"){if(e.length!==t.length)return!1;for(let i=0;i<e.length;i++){const r=e[i],o=t[i];if(r.length!==o.length)return!1;for(let l=0;l<r.length;l++)if(!Qn(r[l],o[l]))return!1}return!0}return JSON.stringify(n)===JSON.stringify(s)}function Tp(n,s){if(!n||!s)return n===s;if(n.length!==s.length)return!1;for(let e=0;e<n.length;e++)if(Math.abs(n[e]-s[e])>1e-10)return!1;return!0}function Qn(n,s){if(n===s)return!0;if(!n||!s||n.length!==s.length)return!1;for(let e=0;e<n.length;e++){const t=n[e],i=s[e];if(t.length!==i.length)return!1;for(let r=0;r<t.length;r++)if(Math.abs(t[r]-i[r])>1e-10)return!1}return!0}class So extends b{constructor(e){super();a(this,"_sceneObject",this.dv(w(void 0)));this._id=e,this.d(()=>{this._sceneObject.value=void 0});const t=M.getSceneObjById(this._id);t&&(this._sceneObject.value=t),this.d(M.context.sceneObjCreatedEvent.don(i=>{i.id===this._id&&(this._sceneObject.value=i)})),this.d(M.context.sceneObjToDestroyEvent.don(i=>{i.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 Ip extends b{constructor(e,t){super();a(this,"_sofi");this._id=e,this._sofi=this.dv(new So(this._id));{const i=()=>{t.sceneObject=this._sofi.sceneObject};i(),this.d(this._sofi.sceneObjectChanged.don(i))}}}class $h extends b{constructor(){super();a(this,"_id",this.dv(w(void 0)));a(this,"_sceneObject",this.dv(w(void 0)));a(this,"_resetting",this.dv(new le(this.idChanged,()=>{const{id:e}=this;if(e===void 0||e===""){this.sceneObject=void 0;return}return new Ip(e,this)})))}get id(){return this._id.value}get idChanged(){return this._id.changed}set id(e){this._id.value=e}get sceneObject(){return this._sceneObject.value}get sceneObjectChanged(){return this._sceneObject.changed}set sceneObject(e){this._sceneObject.value=e}get resetting(){return this._resetting}}class xp extends b{constructor(e,t,i,r){super();a(this,"_sceneObjectId",this.dv(new $h));this._id=e,this._startTimeStamp=t,this._duration=i,this._parent=r,this._sceneObjectId.id=this._id;const o=()=>{if(!this.player)return;const{currentTime:l=0}=this._parent,h=l-this._startTimeStamp;this.player.currentTime=Hn(h,0,this._duration)*(this.player.speed??1)};o(),this.d(this._parent.currentTimeChanged.don(o)),this.d(this.playerChanged.don(o))}get player(){return this._sceneObjectId.sceneObject instanceof Ye?this._sceneObjectId.sceneObject:void 0}get playerChanged(){return this._sceneObjectId.sceneObjectChanged}}const Op=`
|
|
23
|
+
`).join(" ")}`)):this._sceneObjRefs.set(r,[i]);const c=this.getLastSceneObject(r);this._refs[r]=c,this._refsChanged.emit(c,l)}};this.d(e.sceneObjCreatedEvent.don(i=>{const r=(o,l)=>t(i,o,l);i.ref&&r(i.ref,void 0),i.refChanged.don(r)})),this.d(e.sceneObjToDestroyEvent.don(i=>{i.ref&&t(i,void 0,i.ref)}))}get sceneObjRefs(){return this._sceneObjRefs}get refs(){return this._refs}get refsChanged(){return this._refsChanged}getLastSceneObject(e){const t=this.getSceneObjects(e);if(t)return t[t.length-1]}getSceneObjects(e){const t=this._sceneObjRefs.get(e);if(!(!t||t.length===0))return t}}class up extends b{constructor(){super();a(this,"_esObjConstructors",new Map);a(this,"_sceneObjs",new Map);a(this,"_sceneObjCreatedEvent",new v);a(this,"_sceneObjToDestroyEvent",new v);a(this,"_refsManager",this.dv(new dp(this)));a(this,"_environmentVariables",globalThis.ESSDK_ENV||{});a(this,"_environmentVariablesChanged",this.dv(new v))}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(e,t,i){return this._esObjConstructors.has(e)&&console.warn(`register warn: ${e} has registered ! will be override!`),this._esObjConstructors.set(e,t),i&&vt(t,"__sceneObjExtraInfo",i),e}_addSceneObject(e){this._sceneObjs.set(e.id,e),this._sceneObjCreatedEvent.emit(e),e.d(()=>this._deleteSceneObject(e))}addSceneObject(e){this._addSceneObject(e)}_deleteSceneObject(e){this._sceneObjToDestroyEvent.emit(e),this._sceneObjs.delete(e.id)}deleteSceneObject(e){this._deleteSceneObject(e)}createSceneObjectFromClass(e,t){if(!t||this._sceneObjs.has(t)){const r=ns();t&&console.warn(`已存在相同id的对象!id自动变更!${t} -> ${r} 请注意:id变更可能导致引用失效!`),t=r}if(!t)throw new Error("id不能为空!");const i=new e(t);return i.id!==t&&(console.warn(`sceneObj.id(${i.id}) !== id(${t}) sceneObjectType: ${i.typeName}`),console.warn("出现这种问题有可能是自定义的场景对象,没有在构造函数中传递id参数!示例如下:"),console.warn("class XXX extends XXX { constructor(id) { super(id); } }")),this._addSceneObject(i),i}createSceneObject(e,t){if(typeof e=="string"){const i=this._getSceneObjConstructor(e);if(!i){console.warn(`Cannot find SceneObjectType: ${e}`);return}return this.createSceneObjectFromClass(i,t)}else return this.createSceneObjectFromClass(e,t)}createSceneObjectFromUrl(e,t){let i;const r=e.toLowerCase();if(r.includes(".gltf")||r.includes(".glb")?i="ESGltfModel":r.includes("tileset.json")?i="ES3DTileset":r.includes("layer.json")||r.includes("ion://1")?i="ESTerrainLayer":r.includes(".jpg")||r.includes(".png")||r.includes(".jpeg")||r.includes(".webp")||r.includes("image/jpg")||r.includes("image/png")||r.includes("image/jpeg")||r.includes("image/webp")?i="ESImageLabel":(r.includes("/tilemapresource.xml")||r.includes("ion://")||r.includes("wms")||r.includes("wmts")||r.includes("{x}")||r.includes("{y}")||r.includes("{z}"))&&(i="ESImageryLayer"),!!i)return this.createSceneObjectFromJson({type:i,id:t,url:e})}createSceneObjectFromJson(e){const t=this.createSceneObject(e.type,e.id);return t&&(t.json=e),t}destroySceneObject(e){return this._deleteSceneObject(e),e.destroy(),e.isDestroyed()}getSceneObjectById(e){return this._sceneObjs.get(e)}getSceneObject(e,t=!1){if(!e&&e!="")return Array.from(this._sceneObjs.values());if(typeof e=="function"){const i=[],r=e.type;for(const o of this._sceneObjs.values())o instanceof e&&(t&&r&&o.typeName!==r||i.push(o));return i}if(e.startsWith("ES")){const i=[];for(const r of this._sceneObjs.values())r.typeName===e&&i.push(r);return i}return this._sceneObjs.get(e)}_getSceneObjConstructor(e){const t=this._esObjConstructors.get(e);if(t)return t}getProps(e){const t=this._getSceneObjConstructor(e);if(!t){console.warn(`cannot get constructor from type: ${e}`);return}return Ne(t,"__sceneObjExtraInfo")}setProps(e,t){const i=this._getSceneObjConstructor(e);if(!i){console.warn(`cannot get constructor from type: ${e}`);return}let r=Ne(i,"__sceneObjExtraInfo");r||(r={},vt(i,"__sceneObjExtraInfo",r)),Object.assign(r,t)}getProp(e,t){const i=this.getProps(e);return i&&i[t]}setProp(e,t,i){this.setProps(e,{[t]:i})}get environmentVariables(){return this._environmentVariables}set environmentVariables(e){for(let[t,i]of Object.entries(e))this.setEnv(t,i)}get environmentVariablesChanged(){return this._environmentVariablesChanged}setEnv(e,t){if(this._environmentVariables[e]!==t){const i=this._environmentVariables[e];this._environmentVariables[e]=t,this._environmentVariablesChanged.emit(e,t,i)}globalThis.ESSDK_ENV={...this._environmentVariables}}getEnv(e){return this._environmentVariables[e]}getStrFromEnv(e){return Ah(e)}createEnvStrReact(e,t){return Mh(e,t)}createEvnStrReact(e,t){return Mh(e,t)}}const H=class H extends b{constructor(e){super();a(this,"_components",this.dv(new Xn));a(this,"_viewerAttached",this.dv(new v));a(this,"_viewerDetached",this.dv(new v));a(this,"_attachedViewers",(()=>{const e=new Set;return this.d(this._viewerAttached.don(t=>{t.actived&&(this.activeViewer=t),t.ad(t.activedChanged.don(i=>{i&&e.has(t)&&(this.activeViewer=t)})),e.add(t)})),this.d(this._viewerDetached.don(t=>{e.delete(t),this.activeViewer==t&&(this.activeViewer=void 0)})),e})());a(this,"_activeViewer",this.dv(w(void 0)));a(this,"_reloadEvent",this.dv(new v));a(this,"_readyEvent",this.dv(new v));a(this,"_createdEvent",this.dv(new v));a(this,"_flushEvent",this.dv(new v));a(this,"_id");a(this,"_updateFuncReact",this.dv(w(void 0)));a(this,"_toDestroyFuncReact",this.dv(w(void 0)));a(this,"_parentID");e!==void 0&&(typeof e!="string"?console.warn(`对象id必须是字符串类型,当前id的类型是${typeof e},值为${e}`):e.trim()===""?console.warn("场景对象创建时的id不能是空字符串!"):e.trim()!==e&&console.warn(`id前后有空字符串!id: ${e}`)),this._id=e??ns(),this._initName();{const t=()=>{if(this.execOnceFuncStr)try{Function(`"use strict";return (${this.execOnceFuncStr})`)()(this)}catch(i){console.warn(`execOnceFuncStr不能转成函数!或者函数执行时错误!id: ${this.id} ${this.typeName} error: ${i}`)}};t(),this.d(this.execOnceFuncStrChanged.don(t))}{const t=()=>{if(this.updateFuncStr)try{this.updateFunc=Function(`"use strict";return (${this.updateFuncStr})`)()}catch(r){console.warn(`updateFuncStr不能转成函数!或者函数执行时错误!id: ${this.id} ${this.typeName} error: ${r}`)}};t(),this.d(this.updateFuncStrChanged.don(t));let i;this.d(()=>i&&i.destroy()),this.d(this.updateFuncChanged.don(()=>{i&&i.cancel(),this.updateFunc&&(i=i||dn(),i.restart(void 0,r=>{this.updateFunc&&this.updateFunc(this,r)}))}))}{const t=()=>{try{this.toDestroyFunc=this.toDestroyFuncStr&&Function(`"use strict";return (${this.toDestroyFuncStr})`)()||void 0}catch(i){console.warn(`toDestroyFuncStr不能转成函数!或者函数执行时错误!id: ${this.id} ${this.typeName} error: ${i}`),this.toDestroyFunc=void 0}};t(),this.d(this.toDestroyFuncStrChanged.don(t)),this.d(this.toDestroyEvent.don(()=>{this.toDestroyFunc&&this.toDestroyFunc(this)}))}}static getParentClass(){return Object.getPrototypeOf(this)}static register(e,t,i){Kt(t.prototype,t.createDefaultProps);const r=t.createDefaultProps();t.defaults&&(t.defaults={});for(const o of Object.keys(r))t.defaults[o]=r[o]instanceof ge?r[o].value:r[o];return this.innerRegister(e,t,i),e}static get envs(){return H.context.environmentVariables}static get $refs(){return H.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(e){this._activeViewer.value=e}get activeViewerChanged(){return this._activeViewer.changed}removefromViewer(e){this.attachedViewers.has(e)&&e.delete(this)}get reloadEvent(){return this._reloadEvent}reload(){this._reloadEvent.emit()}get readyEvent(){return this._readyEvent}addToViewer(e){this.attachedViewers.has(e)||e.add(this)}registerAttachedObject(e){const t=new Map;this.d(()=>{t.size>0&&console.warn("viewerPropSceneObjects.size > 0")}),this.d(this._viewerAttached.don(i=>{const r=e(i);r&&t.set(i,r)})),this.d(this._viewerDetached.don(i=>{if(!t.has(i))return;const r=t.get(i);r&&(r.destroy(),t.delete(i))}))}createAttachedObject(e){const t=new Map,i=(()=>{for(let[h,c]of t.entries())c.destroy();t.clear()}),r=h=>{const c=e(h);c&&t.set(h,c)};for(let h of this.attachedViewers)r(h);const o=this._viewerAttached.don(r),l=this._viewerDetached.don(h=>{if(!t.has(h))return;const c=t.get(h);c&&(c.destroy(),t.delete(h))});return()=>{l(),o(),i()}}registerAttachedObjectForContainer(e){this.registerAttachedObject(t=>new pp(t,e))}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(e=!0){const t={id:this.id,type:this.typeName};for(let i of Object.keys(this.defaultProps))if(e){let r,o=this.defaultProps[i];o instanceof ge?r=o.equals(this[i]):r=o===this[i],r||(t[i]=this[i])}else t[i]=this[i];return t}_innerSetJson(e,t,i){if(!(e instanceof Object)||e.type&&e.type!==this.typeName){console.error(`value.type && value.type${e.type} !== this.typeName${this.typeName}`);return}e.id&&e.id!==this.id&&console.warn(`value.id === undefined || value.id${e.id} !== this.id(${this.id})`);const r=t||[];r.push("id","type");const o=Object.keys(this.defaultProps).filter(l=>!r.includes(l));for(let l of o)if(l in e)this[l]=e[l]===null?void 0:e[l];else if(!(i??!1)){let h=this.defaultProps[l];h instanceof ge&&(h=h.value),this[l]=h}}get completeJson(){return this._innerGetJson(!1)}get json(){return this._innerGetJson()}set json(e){this._innerSetJson(e)}get _jsonStr(){return JSON.stringify(this.json,null,4)}set _jsonStr(e){this._innerSetJson(JSON.parse(e))}get updateFunc(){return this._updateFuncReact.value}set updateFunc(e){this._updateFuncReact.value=e}get updateFuncChanged(){return this._updateFuncReact.changed}get toDestroyFunc(){return this._toDestroyFuncReact.value}set toDestroyFunc(e){this._toDestroyFuncReact.value=e}get toDestroyFuncChanged(){return this._toDestroyFuncReact.changed}get parentID(){return this._parentID??this.id}set parentID(e){this._parentID=e}getESProperties(){return{defaultMenu:"general",basic:[],general:[new N([this,"typeName"],"类型",void 0,!1,!0),new N([this,"id"],"id",void 0,!1,!0),new N([this,"name"],"名称"),new _o("JSON",()=>this._jsonStr,e=>e&&(this._jsonStr=e))],dataSource:[],location:[],coordinate:[],style:[],more:[new N([this,"ref"],"ref",void 0,!0),new R([this,"extras"],"extras",{},void 0,!0)]}}};a(H,"context",new up),a(H,"innerRegister",H.context.register.bind(H.context)),a(H,"defaults",{}),a(H,"createDefaultProps",()=>({name:"未命名场景对象",ref:void 0,extras:B(void 0),devTags:q(void 0),execOnceFuncStr:void 0,updateFuncStr:void 0,toDestroyFuncStr:void 0})),a(H,"type",H.register("ESSceneObject",H,{chsName:"场景类",tags:["ESObjects","base"],description:""})),a(H,"create",H.context.createSceneObject.bind(H.context)),a(H,"createFromUrl",H.context.createSceneObjectFromUrl.bind(H.context)),a(H,"createFromClass",H.context.createSceneObjectFromClass.bind(H.context)),a(H,"createFromJson",H.context.createSceneObjectFromJson.bind(H.context)),a(H,"destroySceneObject",H.context.destroySceneObject.bind(H.context)),a(H,"getSceneObjById",H.context.getSceneObjectById.bind(H.context)),a(H,"getSceneObj",H.context.getSceneObject.bind(H.context)),a(H,"getEnv",H.context.getEnv.bind(H.context)),a(H,"setEnv",H.context.setEnv.bind(H.context)),a(H,"getStrFromEnv",H.context.getStrFromEnv.bind(H.context)),a(H,"getSceneObjectById",H.context.getSceneObjectById.bind(H.context)),a(H,"getSceneObject",H.context.getSceneObject.bind(H.context));let M=H;class pp extends b{constructor(s,e){super(),this.dv(new le(s.subContainerChanged,()=>{if(s.subContainer)return e(s,s.subContainer)}))}}const Dr=class Dr extends b{constructor(e,t,i){super();a(this,"_id",++Dr._accumId);this._name=e,this._description=t,this._callFunction=i}get id(){return this._id}get name(){return this._name}get description(){return this._description}get callFunction(){return this._callFunction}};a(Dr,"_accumId",-1);let ei=Dr;class mo extends ei{constructor(s,e,t,i,r,o){super(s,e,o??(()=>{})),this._withUndefined=t,this._readonly=i,this._defaultValue=r}get withUndefined(){return this._withUndefined}get readonly(){return this._readonly}get defaultValue(){return this._defaultValue instanceof Function?this._defaultValue():this._defaultValue}}class Te extends mo{constructor(e,t,i,r,o,l,h){var u;const c=e instanceof ge?"未获取到属性名":e[1].toString();super(t??c,l??c,r??!1,o??!1,i,h);a(this,"_propName");a(this,"_typeName");this._reactVar=e,this._propName=c;try{this._typeName=e instanceof ge?"未获取到对象类型":(u=e[0])==null?void 0:u.typeName}catch{this._typeName="未获取到对象类型"}}get reactVar(){return this._reactVar}get propName(){return this._propName}get typeName(){return this._typeName}}class E extends Te{get type(){return"BooleanProperty"}}class N extends Te{get type(){return"StringProperty"}}class f extends Te{get type(){return"NumberProperty"}}class ne extends Te{get type(){return"Number2Property"}}class ue extends Te{get type(){return"Number3Property"}}class Fe extends Te{get type(){return"Number4Property"}}class G extends Fe{get type(){return"ColorProperty"}}class Yn extends f{get type(){return"DashPatternProperty"}}class Ve extends Te{get type(){return"DateProperty"}}class vo extends Te{get type(){return"DatesProperty"}}class k extends ei{constructor(e,t,i){super(e??"",i??"");a(this,"_placement");this._placement=t}get type(){return"DivideProperty"}get placement(){return this._placement}}class A extends Te{constructor(s,e,t,i,r,o,l){super(s,t,i,r,o,l),this._enums=e}get type(){return"EnumProperty"}get enums(){return this._enums}}class Xe extends Te{constructor(s,e,t,i,r,o,l){super(s,e,t,r,o,l),this._sampleValue=i}get sampleValue(){return this._sampleValue}get type(){return"EvalStringProperty"}}class _n extends Te{constructor(s,e,t,i,r,o,l){super(s,e,t,r,o,l),this._sampleValue=i}get sampleValue(){return this._sampleValue}get type(){return"LongStringProperty"}}class L extends ei{constructor(e,t,i,r){const o=e??"Unnamed Function";super(o,r??o);a(this,"_paramsLength");this._func=t,this._defaultParams=i,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(...e){this._func(...e)}get type(){return"MethodProperty"}}class pe extends Te{constructor(s,e,t,i,r,o,l,h){super(s,i,r,o,l,h),this._step=e,this._minMax=t}get type(){return"NumberSliderProperty"}get minMax(){return this._minMax}get step(){return this._step}}class nt extends ue{get type(){return"PositionProperty"}}class ds extends ue{get type(){return"RotationProperty"}}function gp(n,s){const[e,t,i]=tn(n),[r,o,l]=tn(s),h=w((e()??0)/(r()??3e3)),c=()=>{const u=h.value,p=r()??3e3,g=e()??0;if(!Number.isFinite(p)||!Number.isFinite(g)){console.warn(`duration || currentTime error: duration: ${p} currentTime: ${g}`);return}Math.abs(u*p-g)<.001||(p<=0?h.value=0:h.value=g/p)};return h.dispose(i.disposableOn(c)),h.dispose(l.disposableOn(c)),h.dispose(h.changed.disposableOn(()=>{const u=h.value,p=r()??3e3,g=e()??0;if(!Number.isFinite(p)||!Number.isFinite(g)){console.warn(`duration || currentTime error: duration: ${p} currentTime: ${g}`);return}Math.abs(u*p-g)<.001||t(u*p)})),h}class us extends ei{constructor(e,t,i,r,o,l){super(r??"播放器",l??"播放器");a(this,"_defaults",{playing:!1,ratio:0,loop:!1});this._playingReact=e,this._ratioReact=t,this._loopReact=i,o&&(this._defaults.playing=o.playing??this._defaults.playing,this._defaults.ratio=o.ratio??this._defaults.ratio,this._defaults.loop=o.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}}a(us,"createPlayingRatio",gp);class jh extends ei{constructor(e,t,i,r,o,l){const h=r??"视角播放器";super(h,l??h);a(this,"_defaults",{playing:!1,loop:!1});this._playingReact=e,this._stopFn=t,this._loopReact=i,o&&(this._defaults.playing=o.playing??this._defaults.playing,this._defaults.loop=o.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 ie extends Te{constructor(s,e,t,i,r,o,l){super(s,e,t,r,o,l),this._sampleValue=i}get sampleValue(){return this._sampleValue}get type(){return"JsonArrayProperty"}}class R extends Te{constructor(s,e,t,i,r,o,l){super(s,e,t,r,o,l),this._sampleValue=i}get sampleValue(){return this._sampleValue}get type(){return"JsonProperty"}}class _o extends mo{constructor(s,e,t,i,r,o){super(s,o??s,i??!1,r??!1),this._getFunc=e,this._setFunc=t}get getFunc(){return this._getFunc}get setFunc(){return this._setFunc}get type(){return"GetSetProperty"}}var I=(n=>(n.Place="place",n.BrushErase="brushErase",n.Translation="translation",n.Rotation="rotation",n.Scale="scale",n.DoublePointsAppend="doublePointsAppend",n.DoublePointsModify="doublePointsModify",n.CircularAppend="circularAppend",n.CircularInsert="circularInsert",n.LineStringAppend="lineStringAppend",n.LineStringInsert="lineStringInsert",n.ScatterAppend="scatterAppend",n.ScatterModify="scatterModify",n.VisibilityAppend="visibilityAppend",n.VisibilityModify="visibilityModify",n.HeightModify="heightModify",n.SinglePoint="singlePoint",n.DoublePoints="doublePoints",n))(I||{});const yo=[["地形","TERRAIN"],["3D Tiles","CESIUM_3D_TILE"],["地形和3D Tiles","BOTH"]],wo=[["直箭头","straightArrow"],["燕尾箭头","swallowTailArrow"]];var Rh=(n=>(n.DECIMAL_DEGREE="DECIMAL_DEGREE",n.DEGREES_DECIMAL_MINUTES="DEGREES_DECIMAL_MINUTES",n.SEXAGESIMAL_DEGREE="SEXAGESIMAL_DEGREE",n))(Rh||{});class fp{constructor(s){this.childPickedInfo=s}}class mp{constructor(s,e,t,i,r,o){this.pickResult=s,this.sceneObject=e,this.tilesetPickInfo=t,this.geojsonPickInfo=i,this.attachedInfo=r,this.screenPosition=o}assign(s){s!=null&&s.pickedResult&&(this.pickResult=s.pickedResult),s!=null&&s.sceneObject&&(this.sceneObject=s.sceneObject),s!=null&&s.tilesetPickInfo&&(this.tilesetPickInfo=s.tilesetPickInfo),s!=null&&s.geojsonPickInfo&&(this.geojsonPickInfo=s.geojsonPickInfo),s!=null&&s.attachedInfo&&(this.attachedInfo=s.attachedInfo),s!=null&&s.screenPosition&&(this.screenPosition=s.screenPosition)}}const ae=class ae extends M{constructor(e){super(e);a(this,"_editing",this.dv(w(!1)));a(this,"editingID");a(this,"editingBindMode","singlePoint");a(this,"_deprecated",[]);a(this,"_flyInEvent",this.dv(new v));a(this,"_flyToEvent",this.dv(new v));a(this,"_flyOverEvent",this.disposeVar(new v));a(this,"_pickedEvent",this.dv(new v));a(this,"_calcFlyToParamEvent",this.dv(new v));a(this,"_calcFlyInParamEvent",this.dv(new v));a(this,"useCalcFlyToParamInESObjectWithLocation",!1);Uh(this,this.updateEditing)}supportEditingModes(){return this.constructor.supportEditingModes}get editing(){return this._editing.value}set editing(e){this._editing.value=e}get editingChanged(){return this._editing.changed}updateEditing(){}_deprecatedWarning(){const e=this._deprecated;for(let t=0;t<e.length;t++){const i=e[t];typeof i=="string"?Reflect.has(this,i+"Changed")&&this.d(this[i+"Changed"].don(()=>{console.warn(`注意:${this.typeName} 的 ${i} 属性下版本将会被移除!`)})):Object.keys(i).forEach(r=>{Reflect.has(this,r+"Changed")&&this.d(this[r+"Changed"].don(l=>{const h=i[r];typeof h=="string"?console.warn(`注意:${this.typeName} 的 ${r} 属性下版本将会被移除!`):Object.keys(h).forEach((c=>{l===c&&console.warn(`注意:${this.typeName} 的 ${r} 属性值 ${c} 下版本将会被移除,推荐使用属性值 ${h[c]}`)}))}))})}}get flyInEvent(){return this._flyInEvent}flyIn(e=1){this._flyInEvent.emit(e,ae._lastFlyInId)}get flyToEvent(){return this._flyToEvent}flyTo(e=1){this._flyToEvent.emit(e,ae._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(e){return await e.getBoundSphere(this.id)}getESProperties(){const e={...super.getESProperties()};return{...e,general:[...e.general,new E([this,"show"],"是否显示",ae.defaults.show),new E([this,"collision"],"开启碰撞",ae.defaults.collision),new E([this,"allowPicking"],"允许拾取",ae.defaults.allowPicking),new L("保存观察视角",()=>this.calcFlyToParam(),[]),new L("清空飞向参数",()=>this.emptyFlyToParam(),[]),new L("保存飞入参数",()=>this.calcFlyInParam(),[]),new L("清空飞入参数",()=>this.emptyFlyInParam(),[])],more:[...e.more,new k("飞行定位"),new L("飞向",t=>this.flyTo(t),[1],"flyTo"),new R([this,"flyToParam"],"飞行参数",void 0,void 0,!0),new f([this,"flyToDistance"],"flyToDistance",void 0,!0),new f([this,"flyToHeading"],"flyToHeading",void 0,!0),new f([this,"flyToPitch"],"flyToPitch",void 0,!0),new f([this,"flyToFlyDuration"],"flyToFlyDuration",void 0,!0),new f([this,"flyToHDelta"],"flyToHDelta",void 0,!0),new f([this,"flyToPDelta"],"flyToPDelta",void 0,!0),new k("飞入参数"),new L("飞入",t=>this.flyIn(t),[1],"flyIn"),new R([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(e){this.flyToParam=e!==void 0?{...this.flyToParam??ae.defaultFlyToParam,distance:e}:void 0}set flyToHeading(e){this.flyToParam=e!==void 0?{...this.flyToParam??ae.defaultFlyToParam,heading:e}:void 0}set flyToPitch(e){this.flyToParam=e!==void 0?{...this.flyToParam??ae.defaultFlyToParam,pitch:e}:void 0}set flyToFlyDuration(e){this.flyToParam=e!==void 0?{...this.flyToParam??ae.defaultFlyToParam,flyDuration:e}:void 0}set flyToHDelta(e){this.flyToParam=e!==void 0?{...this.flyToParam??ae.defaultFlyToParam,hDelta:e}:void 0}set flyToPDelta(e){this.flyToParam=e!==void 0?{...this.flyToParam??ae.defaultFlyToParam,pDelta:e}:void 0}};a(ae,"createDefaultProps",()=>({...M.createDefaultProps(),show:!0,collision:!0,allowPicking:!1,flyToParam:te(void 0),flyInParam:te(void 0)})),a(ae,"type",ae.register("ESVisualObject",ae,{chsName:"可视化对象",tags:["ESObjects","base"],description:"可视化对象"})),a(ae,"supportEditingModes",[]),a(ae,"defaultFlyToParam",{distance:0,heading:0,pitch:0,flyDuration:1,hDelta:0,pDelta:0}),a(ae,"defaultFlyInParam",{position:[0,0,0],rotation:[0,0,0],flyDuration:1}),a(ae,"_lastFlyInId",0),a(ae,"_lastFlyToId",0);let X=ae;class Nh extends b{constructor(){super();a(this,"_data",this.dv(w(void 0)))}set data(e){this._data.value=e}get data(){return this._data.value}get dataChanged(){return this._data.changed}}class Lh extends b{constructor(){super(...arguments);a(this,"_dragStartEvent",this.dv(new v));a(this,"_dragOverEvent",this.dv(new v));a(this,"_dragLeaveEvent",this.dv(new v));a(this,"_dropEvent",this.dv(new v))}dragStart(e){this._dragStartEvent.emit(e)}dragOver(e){this._dragOverEvent.emit(e)}dragLeave(e){this._dragLeaveEvent.emit(e)}drop(e){this._dropEvent.emit(e)}}function vp(n,s){s&&(Reflect.has(s,"editing")?s.editing=!0:Reflect.has(s,"positionEditing")&&(s.positionEditing=!0))}function _p(n){["Czm3DTiles","View","ESCameraView","OlView","GeoCameraController"].includes(n.typeName)||(Reflect.has(n,"editing")?n.editing=!0:Reflect.has(n,"positionEditing")&&(n.positionEditing=!0)),typeof n.execOnCreating=="function"&&n.execOnCreating()}function Kn(n,s){Ne(n,"__treeItem")&&console.error("setSceneObjectTreeItem error!"),vt(n,"__treeItem",s)}function yp(n){return Ne(n,"__treeItem")}function wp(n){if(!(n.startsWith("./")||n.startsWith("../")||n.startsWith("/")))return n;const s=document.createElement("a");s.href=n;const e=s.href;return s.remove(),e}function Eo(n){if(typeof n!="string")return!1;try{const s=JSON.parse(n);return typeof s=="object"&&s!==null}catch{return!1}}function Ep(n){try{return new DOMParser().parseFromString(n,"application/xml").getElementsByTagName("parsererror").length===0}catch{return!1}}function bp(n){return n instanceof Function?n():n}function Vh(n,s){for(let e of n)if(s.includes(e))return!0;return!1}function yn(n,s){const e=n,t=s;return e===void 0||e.length===0||t===void 0||t.length===0?!0:Vh(e,t)}function Sp(n){const s=setTimeout(()=>{n(),clearTimeout(s)})}function ps(n){let s=n%360;return s=s<0?360+s:s,s}function zh(n){return ps(n+180)-180}function Zn(n,s,e){let t=ps(n),i=ps(s);Math.abs(t-i)>180&&(t<i?t+=360:i+=360);const r=t*(1-e)+i*e;return zh(r)}function bo(n,s,e,t){return t=t||[0,0,0],t[0]=Zn(n[0],s[0],e),t[1]=Zn(n[1],s[1],e),t[2]=Zn(n[2],s[2],e),t}function Uh(n,s,e="editing"){const t=new b;n.ad(t);const i=s.bind(n);return t.ad(new le(n.activeViewerChanged,()=>{const r=new b;let o=n.activeViewer;return o?(r.ad(n[`${e}Changed`].don(()=>{var l;n[`${e}`]?i():(l=(n.components.main??n).editingID)!=null&&l.includes("inner")&&n.activeViewer&&n.activeViewer.stopEditing()})),r.ad(o.editingEvent.don(l=>{if(l.objectIDs.includes(n.id)&&l.type==="end"){const h=n.components.main??n;h.editingID&&(l.editingID.includes(h.editingID)?(h.editingID=void 0,n[e]=!1):n[e]=!h.editingID.includes("outer"))}}))):r.ad(n[`${e}Changed`].don(()=>{n[`${e}`]=!1})),r})),n[`${e}`]&&i(),t}function Bh(n){var e;const s=Array.isArray(n)?"feature":((e=n.type)==null?void 0:e.toLowerCase())??"";switch(s){case"geometrycollection":return Cp(n);case"topology":const t=n.objects,i=[];for(const r in t){const o=Pd.feature(n,t[r]);i.push(...o.features)}return{type:"FeatureCollection",features:i};case"feature":return{type:"FeatureCollection",features:Array.isArray(n)?n:[n]};case"featurecollection":return n;default:return console.warn(`GeoJson数据转换可能有误,数据类型${s}`),{type:"FeatureCollection",features:Array.isArray(n.features)?n.features:[]}}}function Cp(n,s){const e=[],t=n.geometries||[];function i(r,o={}){!r||!r.type||(r.type==="GeometryCollection"&&Array.isArray(r.geometries)?r.geometries.forEach(l=>i(l,o)):e.push({type:"Feature",geometry:r,properties:{...r.properties||{},...o}}))}return t.forEach(r=>i(r,{})),{type:"FeatureCollection",features:e}}function Pp(n){const s=n.cloneNode(!0);s.style.position="fixed",s.style.visibility="hidden",s.style.pointerEvents="none",s.style.top="0",s.style.left="0",s.style.display="inline-block",document.body.appendChild(s);const e=s.getBoundingClientRect();return document.body.removeChild(s),{x:e.x,y:e.y,width:e.width,height:e.height}}function Tp(n,s,e=!1){var p,g,m,y,S,C;const t=[],i=[],r=[],o=[],l=[],h=new Set,c=new Map;if(s!=null&&s.features)for(const T of s.features){const V=((p=T.id)==null?void 0:p.toString())||((m=(g=T.properties)==null?void 0:g.id)==null?void 0:m.toString());V&&(h.add(V),c.set(V,T))}if(n!=null&&n.features)for(const T of n.features){const V=((y=T.id)==null?void 0:y.toString())||((C=(S=T.properties)==null?void 0:S.id)==null?void 0:C.toString());if(V)if(h.has(V)){if(e){const z=c.get(V);z&&Wh(z,T)?o.push(V):l.push(V)}t.push(V)}else i.push(V)}for(const T of h)t.includes(T)||r.push(T);const u={unchangedIds:t,newIds:i,removedIds:r};return e&&(u.contentUnchangedIds=o,u.contentUpdatedIds=l),u}function Wh(n,s){return Hh(n.geometry,s.geometry)?JSON.stringify(n.properties)===JSON.stringify(s.properties):!1}function Hh(n,s){if(n===s)return!0;if(!n||!s||n.type!==s.type)return!1;const e=n.coordinates,t=s.coordinates;if(n.type==="Point")return Ip(e,t);if(n.type==="LineString"||n.type==="MultiPoint")return Qn(e,t);if(n.type==="Polygon"){if(e.length!==t.length)return!1;for(let i=0;i<e.length;i++)if(!Qn(e[i],t[i]))return!1;return!0}if(n.type==="MultiLineString"){if(e.length!==t.length)return!1;for(let i=0;i<e.length;i++)if(!Qn(e[i],t[i]))return!1;return!0}if(n.type==="MultiPolygon"){if(e.length!==t.length)return!1;for(let i=0;i<e.length;i++){const r=e[i],o=t[i];if(r.length!==o.length)return!1;for(let l=0;l<r.length;l++)if(!Qn(r[l],o[l]))return!1}return!0}return JSON.stringify(n)===JSON.stringify(s)}function Ip(n,s){if(!n||!s)return n===s;if(n.length!==s.length)return!1;for(let e=0;e<n.length;e++)if(Math.abs(n[e]-s[e])>1e-10)return!1;return!0}function Qn(n,s){if(n===s)return!0;if(!n||!s||n.length!==s.length)return!1;for(let e=0;e<n.length;e++){const t=n[e],i=s[e];if(t.length!==i.length)return!1;for(let r=0;r<t.length;r++)if(Math.abs(t[r]-i[r])>1e-10)return!1}return!0}class So extends b{constructor(e){super();a(this,"_sceneObject",this.dv(w(void 0)));this._id=e,this.d(()=>{this._sceneObject.value=void 0});const t=M.getSceneObjById(this._id);t&&(this._sceneObject.value=t),this.d(M.context.sceneObjCreatedEvent.don(i=>{i.id===this._id&&(this._sceneObject.value=i)})),this.d(M.context.sceneObjToDestroyEvent.don(i=>{i.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 xp extends b{constructor(e,t){super();a(this,"_sofi");this._id=e,this._sofi=this.dv(new So(this._id));{const i=()=>{t.sceneObject=this._sofi.sceneObject};i(),this.d(this._sofi.sceneObjectChanged.don(i))}}}class $h extends b{constructor(){super();a(this,"_id",this.dv(w(void 0)));a(this,"_sceneObject",this.dv(w(void 0)));a(this,"_resetting",this.dv(new le(this.idChanged,()=>{const{id:e}=this;if(e===void 0||e===""){this.sceneObject=void 0;return}return new xp(e,this)})))}get id(){return this._id.value}get idChanged(){return this._id.changed}set id(e){this._id.value=e}get sceneObject(){return this._sceneObject.value}get sceneObjectChanged(){return this._sceneObject.changed}set sceneObject(e){this._sceneObject.value=e}get resetting(){return this._resetting}}class Op extends b{constructor(e,t,i,r){super();a(this,"_sceneObjectId",this.dv(new $h));this._id=e,this._startTimeStamp=t,this._duration=i,this._parent=r,this._sceneObjectId.id=this._id;const o=()=>{if(!this.player)return;const{currentTime:l=0}=this._parent,h=l-this._startTimeStamp;this.player.currentTime=Hn(h,0,this._duration)*(this.player.speed??1)};o(),this.d(this._parent.currentTimeChanged.don(o)),this.d(this.playerChanged.don(o))}get player(){return this._sceneObjectId.sceneObject instanceof Ye?this._sceneObjectId.sceneObject:void 0}get playerChanged(){return this._sceneObjectId.sceneObjectChanged}}const Dp=`
|
|
24
24
|
用来配置子播放器,它是一个数组形式,数组的每个元素仍然是一个数组,形式是[子播放器的ID, 起始时间, 持续时间]。
|
|
25
25
|
注意时间的单位是毫秒。
|
|
26
26
|
示例如下:
|
|
@@ -38,7 +38,7 @@ ${h.map(u=>`${u.id} ${u.typeName}
|
|
|
38
38
|
]
|
|
39
39
|
]
|
|
40
40
|
\`\`\`
|
|
41
|
-
`,_e=class _e extends b{constructor(){super();a(this,"_ratio",this.dv(w(0)));a(this,"_subPlayers",this.dv(new hn));const e=this.dv(new Jn);{const o=()=>{e.loop=this.loop??_e.defaults.loop};o(),this.d(this.loopChanged.don(o))}{const o=()=>{(this.loop??_e.defaults.loop)!==e.loop&&(this.loop=e.loop)};o(),this.d(e.loopChangedEvent.don(o))}{const o=()=>{e.currentTime=this.currentTime??_e.defaults.currentTime};o(),this.d(this.currentTimeChanged.don(o))}{const o=()=>{(this.currentTime??_e.defaults.currentTime)!==e.currentTime&&(this.currentTime=e.currentTime)};o(),this.d(e.currentTimeChangedEvent.don(o))}{const o=()=>{e.duration=this.duration??_e.defaults.duration};o(),this.d(this.durationChanged.don(o))}{const o=()=>{(this.duration??_e.defaults.duration)!==e.duration&&(this.duration=e.duration)};o(),this.d(e.durationChangedEvent.don(o))}{const o=()=>{e.speed=this.speed??_e.defaults.speed};o(),this.d(this.speedChanged.don(o))}{const o=()=>{(this.speed??_e.defaults.speed)!==e.speed&&(this.speed=e.speed)};o(),this.d(e.speedChangedEvent.don(o))}{const o=()=>{e.playing=this.playing??_e.defaults.playing};o(),this.d(this.playingChanged.don(o))}{const o=()=>{(this.playing??_e.defaults.playing)!==e.playing&&(this.playing=e.playing)};o(),this.d(e.playingChangedEvent.don(o))}const t=()=>{const o=this.duration??_e.defaults.duration;o>0&&(this._ratio.value=(this.currentTime??_e.defaults.currentTime)/o)};t();const i=this.dv(oe(this.currentTimeChanged,this.durationChanged));this.d(i.don(t)),this.d(()=>{const{length:o}=this._subPlayers;for(let l=0;l<o;++l)this._subPlayers.get(l).destroy();this._subPlayers.length=0});const r=()=>{for(let l of this._subPlayers)l.destroy();if(this._subPlayers.length=0,!this.channels)return;const o=this.channels.map(l=>{const[h,c,u]=l;return new xp(h,c,u,this)});this._subPlayers.splice(0,0,...o)};r(),this.d(this.channelsChanged.don(r))}get ratio(){return this._ratio.value}set ratio(e){Math.abs(this._ratio.value-e)<.001||(this.currentTime=(this.duration??_e.defaults.duration)*e)}get ratioChanged(){return this._ratio.changed}};a(_e,"defaults",{loop:!1,currentTime:0,duration:3e3,speed:1,playing:!1,channels:!0,ratio:0}),a(_e,"channelsReadMe",Op);let Ye=_e;(n=>{n.createDefaultProps=()=>({loop:!1,currentTime:0,duration:3e3,speed:1,playing:!1,channels:Xt(void 0,(s,e)=>s==null?void 0:s.every((t,i)=>t===e[i]),s=>[...s])})})(Ye||(Ye={})),Kt(Ye.prototype,Ye.createDefaultProps);class Dp extends b{constructor(s,e,t,i){super(),this.disposeVar(new le(s.sceneObjectChanged,()=>{let r;i.debug&&console.log("正在获取Event事件...");const o=s.sceneObject;if(o&&e){const l=e.split(".");if(l.length===0)i.debug&&console.warn("propNames.length === 0");else{let h=$r(o,!1,...l);(!h||!(h instanceof v))&&(l[l.length-1]=l[l.length-1]+"Changed",i.debug&&console.warn(`event未能获取,那么将属性名的最后一项加上Changed(${l[l.length-1]})再试试!`),h=$r(o,!1,...l),i.debug&&h&&console.warn("event仍然获取不到!")),h?h instanceof v?(r=h,i.debug&&console.log(`Event获取成功 propChangedName: ${e}`,r)):i.debug&&console.warn(`the prop is not event from ${o.id}-${o.name}-${o.ref}-${e}`):i.debug&&console.warn(`cannot get changed from ${o.id}-${o.name}-${o.ref}-${e}`)}}if(r){const l=new b;return l.d(r.dwon(()=>t.emit())),l}else{i.debug&&console.log(`未获取到Event!propChangedName: ${e}`);return}}))}}const Gh=Object.freeze(Object.defineProperty({__proto__:null,WatcherObjects:class extends b{constructor(e,t,i){super();a(this,"_doEvalEvent",this.dv(new v));const r=this._doEvalEvent,o=this.disposeVar(oe(r)),l=e.map(([h,c])=>{const u=new So(h),p=c&&new Dp(u,c,r,t)||void 0;return[u,p]});this.d(()=>{l.forEach(([h,c])=>{c==null||c.destroy(),h.destroy()}),l.length=0}),this.d(r.don(()=>{const{evalMode:h="NextAnimateFrame",evalOnlyWhenObjsAllExist:c=!0}=t;if(h==="Immediate"){const u=l.map(([p])=>p.sceneObject);(!c||u.every(p=>p!==void 0))&&i(u)}})),this.d(o.don(()=>{const{evalMode:h="NextAnimateFrame",evalOnlyWhenObjsAllExist:c=!0}=t;if(h==="NextAnimateFrame"){const u=l.map(([p])=>p.sceneObject);(!c||u.every(p=>p!==void 0))&&i(u)}}))}forceExecute(){this._doEvalEvent.emit()}}},Symbol.toStringTag,{value:"Module"})),{WatcherObjects:Fp}=Gh;class wn extends b{constructor(){super();a(this,"_evalFunc");a(this,"_forceExecute",new v);const e=this.dv(w(void 0)),t=()=>{try{e.value=this.evalFuncStr&&Function('"use strict";return ('+this.evalFuncStr+")")(),this.debug&&console.log("evalFunc成功构建",e.value)}catch(o){console.error(`evalFunc get error! ${o}`),e.value=void 0}};t(),this.dispose(this.evalFuncStrChanged.disposableOn(t));const i=o=>{this.enabled&&(this.debug&&console.log("执行evalFunc..."),this._evalFunc&&this._evalFunc(o),e.value&&e.value(o))},r=this.disposeVar(new le(this.objIdAndPropChangedNamesChanged,()=>{if(this.objIdAndPropChangedNames.length>0)return this.debug&&console.log("监视对象发生变化,重新创建WatcherObjects"),new Fp(this.objIdAndPropChangedNames,this,i)}));this.dispose(this._forceExecute.disposableOn(()=>{var o;(o=r.obj)==null||o.forceExecute()}))}get evalFunc(){return this._evalFunc}set evalFunc(e){this._evalFunc=e}forceExecute(){this._forceExecute.emit()}}(n=>{n.createDefaultProps=()=>({enabled:!1,objIdAndPropChangedNames:jn([],(s,e)=>s[0]===e[0]&&s[1]===e[1],s=>[s[0],s[1]]),evalFuncStr:"",evalMode:"NextAnimateFrame",evalOnlyWhenObjsAllExist:!0,debug:!1,name:"未命名场景对象",ref:void 0,extras:B(void 0),devTags:q(void 0),execOnceFuncStr:void 0,updateFuncStr:void 0,toDestroyFuncStr:void 0})})(wn||(wn={})),Kt(wn.prototype,wn.createDefaultProps);const Jh=Sl("+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees","+proj=geocent +datum=WGS84");function rt(n){return Jh.forward(n)}function Co(n){return Jh.inverse(n)}const qh=Sl("+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 kp(n){const s=qh.forward([n[0],n[1]]);return[s[0],s[1],n[2]]}function Mp(n){const s=qh.inverse([n[0],n[1]]);return[s[0],s[1],n[2]]}function Ap(n,s){const e=n[0],t=n[n.length-1];(e[0]!==t[0]||e[1]!==t[1]||e[2]!==t[2])&&n.push(e);const i=K.point(s),r=K.polygon([n]);return K.booleanPointInPolygon(i,r)}function jp(n,s){const e=W.lineString(n);return W.along(e,s,{units:"meters"}).geometry.coordinates}function Po(n){if((n[0][0]!==n[n.length-1][0]||n[0][1]!==n[n.length-1][1]||n[0][2]!==n[n.length-1][2])&&n.push(n[0]),n.length<=3)return 0;const s=W.polygon([n]);return W.area(s)}function Rp(n){(n[0][0]!==n[n.length-1][0]||n[0][1]!==n[n.length-1][1]||n[0][2]!==n[n.length-1][2])&&n.push(n[0]);const s=W.polygon([n]),t=W.centerOfMass(s).geometry.coordinates;return[t[0],t[1],t[2]??n[0][2]??0]}function To(...n){let[s,e,t,i]=n;const[r,o,l]=s;if(Array.isArray(e)){const[h,c,u]=e,p=Math.sqrt(h*h+c*c);let g=0;p>0&&(g=Math.atan2(h,c)*(180/Math.PI),g<0&&(g+=360));const m=W.destination(W.point([r,o]),p,g,{units:"meters"});return!m||!m.geometry||!m.geometry.coordinates?void 0:(t=t||[0,0,0],t[0]=m.geometry.coordinates[0],t[1]=m.geometry.coordinates[1],t[2]=l+(u||0),t)}else{const h=W.destination(W.point([r,o]),e,t,{units:"meters"});return!h||!h.geometry||!h.geometry.coordinates?void 0:(i=i||[0,0,0],i[0]=h.geometry.coordinates[0],i[1]=h.geometry.coordinates[1],i[2]=l,i)}}function er(n,s){return W.distance(W.point(n),W.point(s),{units:"meters"})}function En(n,s){return W.bearing(W.point(n),W.point(s))}function Np(n,s){return W.lineIntersect(W.lineString(n),W.lineString(s))}function Lp(n,s){const e=W.point(n),t=W.point(s),i=W.midpoint(e,t),r=(n[2]+s[2])/2;return[...i.geometry.coordinates,r]}function Vp(n,s){const e=W.point(s),t=W.lineString(n);return W.nearestPointOnLine(t,e,{units:"meters"})}function zp(n,s){const e=W.point(n),t=W.lineString(s);return W.pointToLineDistance(e,t,{units:"meters"})}function Up(n,s,e,t){const[i,r,o]=n,l=W.rhumbDestination(W.point([i,r]),s,e,{units:"meters"});if(!(!l||!l.geometry||!l.geometry.coordinates))return t=t||[0,0,0],t[0]=l.geometry.coordinates[0],t[1]=l.geometry.coordinates[1],t[2]=o,t}function Xh(n,s){return W.rhumbDistance(W.point(n),W.point(s),{units:"meters"})}function Bp(n,s){return W.rhumbBearing(W.point(n),W.point(s))}function Yh(n,s){(n[0][0]!==n[n.length-1][0]||n[0][1]!==n[n.length-1][1]||n[0][2]!==n[n.length-1][2])&&n.push(n[0]),(s[0][0]!==s[s.length-1][0]||s[0][1]!==s[s.length-1][1]||s[0][2]!==s[s.length-1][2])&&s.push(s[0]);const e=W.intersect(W.polygons([[n],[s]]));if(e)return e.geometry.coordinates}function Kh(n,s){(n[0][0]!==n[n.length-1][0]||n[0][1]!==n[n.length-1][1]||n[0][2]!==n[n.length-1][2])&&n.push(n[0]),(s[0][0]!==s[s.length-1][0]||s[0][1]!==s[s.length-1][1]||s[0][2]!==s[s.length-1][2])&&s.push(s[0]);const e=W.union(W.polygons([[n],[s]]));if(e)return e.geometry.coordinates}function Zh(n,s=500,e="meters"){const t=W.buffer(W.lineString(n),s,{units:e});if(t)return t.geometry.coordinates}function Qh(n,s){(n[0][0]!==n[n.length-1][0]||n[0][1]!==n[n.length-1][1]||n[0][2]!==n[n.length-1][2])&&n.push(n[0]),(s[0][0]!==s[s.length-1][0]||s[0][1]!==s[s.length-1][1]||s[0][2]!==s[s.length-1][2])&&s.push(s[0]);const e=W.difference(W.polygons([[n],[s]]));if(e)return e.geometry.coordinates}function ec(n,s,e=10,t="meters"){const i={steps:e,units:t};return W.circle(n,s,i).geometry.coordinates}function Io(n,s){(n[0][0]!==n[n.length-1][0]||n[0][1]!==n[n.length-1][1]||n[0][2]!==n[n.length-1][2])&&n.push(n[0]),(s[0][0]!==s[s.length-1][0]||s[0][1]!==s[s.length-1][1]||s[0][2]!==s[s.length-1][2])&&s.push(s[0]);const e=W.polygon([n]),t=W.polygon([s]);return W.booleanContains(e,t)?"oneBig":W.booleanWithin(e,t)?"twoBig":!1}function tr(n){const s=Zt(_i(n,["0"])),e=Zt(_i(n,["1"])),t=Zt(_i(n,["2"])),i=Nt(_i(n,["0"])),r=Nt(_i(n,["1"])),o=Nt(_i(n,["2"]));return{minPos:[s,e,t],maxPos:[i,r,o],center:[(s+i)*.5,(e+r)*.5,(t+o)*.5]}}function tc(n){const{minPos:s,maxPos:e,center:t}=tr(n);if(s.some(l=>!Number.isFinite(l)||e.some(h=>!Number.isFinite(h))||t.some(h=>!Number.isFinite(h)))){console.warn("geoCenterAndRadiusFromPositions error: minPos.some(e => !Number.isFinite(e) || maxPos.some(e => !Number.isFinite(e)) || center.some(e => !Number.isFinite(e))");return}const i=er(s,e);let r=i*.5;const o=Math.abs(s[2]-e[2]);return o!=0&&(r=Math.sqrt(i*i+o*o)*.5),{center:t,radius:r}}function ic(n,s){const e=rt(n),t=rt(s);return d.Vector.distance(e,t)}function Vt(n,s){const e=[],t=n.length;let i=0;for(let r=0;r<t-1;++r){if(s===void 0||s==="GEODESIC"){const o=er(n[r],n[r+1]),l=Math.abs(n[r][2]-n[r+1][2]);if(l===0)i+=o;else{const h=Math.sqrt(o*o+l*l);i+=h}}else if(s==="RHUMB"){const o=Xh(n[r],n[r+1]),l=Math.abs(n[r][2]-n[r+1][2]);if(l===0)i+=o;else{const h=Math.sqrt(o*o+l*l);i+=h}}else if(s==="NONE"){const o=ic(n[r],n[r+1]);i+=o}else console.warn(`未知的arcType: ${s},导致距离无法计算!`);e.push(i)}return e}function xo(n){const s="__getXyzFromPostion";let e=Ne(n,s);return(!e||!d.Vector.equals(e[0],n))&&(e=[[...n],rt(n)],vt(n,s,e)),e[1]}class Wp{constructor(s={}){a(this,"points");a(this,"duration");a(this,"sharpness");a(this,"centers");a(this,"controls");a(this,"stepLength");a(this,"length");a(this,"delay");a(this,"steps");this.points=s.points||[],this.duration=s.duration||1e4,this.sharpness=s.sharpness||.85,this.centers=[],this.controls=[],this.stepLength=s.stepLength||60,this.length=this.points.length,this.delay=0;for(let e=0;e<this.length;e++)this.points[e].z=this.points[e].z||0;for(let e=0;e<this.length-1;e++){const t=this.points[e],i=this.points[e+1];this.centers.push({x:(t.x+i.x)/2,y:(t.y+i.y)/2,z:(t.z+i.z)/2})}this.controls.push([this.points[0],this.points[0]]);for(let e=0;e<this.centers.length-1;e++){const t=this.points[e+1].x-(this.centers[e].x+this.centers[e+1].x)/2,i=this.points[e+1].y-(this.centers[e].y+this.centers[e+1].y)/2,r=this.points[e+1].z-(this.centers[e].z+this.centers[e+1].z)/2;this.controls.push([{x:(1-this.sharpness)*this.points[e+1].x+this.sharpness*(this.centers[e].x+t),y:(1-this.sharpness)*this.points[e+1].y+this.sharpness*(this.centers[e].y+i),z:(1-this.sharpness)*this.points[e+1].z+this.sharpness*(this.centers[e].z+r)},{x:(1-this.sharpness)*this.points[e+1].x+this.sharpness*(this.centers[e+1].x+t),y:(1-this.sharpness)*this.points[e+1].y+this.sharpness*(this.centers[e+1].y+i),z:(1-this.sharpness)*this.points[e+1].z+this.sharpness*(this.centers[e+1].z+r)}])}this.controls.push([this.points[this.length-1],this.points[this.length-1]]),this.steps=this.cacheSteps(this.stepLength)}cacheSteps(s){const e=[];let t=this.pos(0);e.push(0);for(let i=0;i<this.duration;i+=10){const r=this.pos(i);Math.sqrt((r.x-t.x)*(r.x-t.x)+(r.y-t.y)*(r.y-t.y)+(r.z-t.z)*(r.z-t.z))>s&&(e.push(i),t=r)}return e}vector(s){const e=this.pos(s+10),t=this.pos(s-10);return{angle:180*Math.atan2(e.y-t.y,e.x-t.x)/3.14,speed:Math.sqrt((t.x-e.x)*(t.x-e.x)+(t.y-e.y)*(t.y-e.y)+(t.z-e.z)*(t.z-e.z))}}pos(s){let e=s-this.delay;e<0&&(e=0),e>this.duration&&(e=this.duration-1);const t=e/this.duration;if(t>=1)return this.points[this.length-1];const i=Math.floor((this.points.length-1)*t),r=(this.length-1)*t-i;return Hp(r,this.points[i],this.controls[i][1],this.controls[i+1][0],this.points[i+1])}}function Hp(n,s,e,t,i){const r=$p(n);return{x:i.x*r[0]+t.x*r[1]+e.x*r[2]+s.x*r[3],y:i.y*r[0]+t.y*r[1]+e.y*r[2]+s.y*r[3],z:i.z*r[0]+t.z*r[1]+e.z*r[2]+s.z*r[3]}}function $p(n){const s=n*n;return[s*n,3*s*(1-n),3*n*(1-n)*(1-n),(1-n)*(1-n)*(1-n)]}function Gp(n,s){s===void 0&&(s={});var e=s.resolution||1e3,t=s.sharpness||.85;const i=[],r=n.map(c=>{const[u,p,g]=rt(c);return{x:u,y:p,z:g}});for(var o=new Wp({duration:e,points:r,sharpness:t}),l=function(c){var u=o.pos(c);const p=Co([u.x,u.y,u.z]);i.push(p)},h=0;h<o.duration;h+=10)l(h);return l(o.duration),i}function gs(n,s,e){return Gp(n,{resolution:s,sharpness:e})}function ir(n){return Xt(n,(s,e)=>s[0]===e[0]&&s[1]===e[1],s=>[...s])}function sc(n,s){const e=new Array;for(let t of n)e.push(s(t));return e}function sr(n,s){return n===void 0&&s===void 0?!0:!n||!s?!1:n[0]===s[0]&&n[1]===s[1]&&n[2]===s[2]}function nc(n,s,e){var i;((i=s.attachedViewers.values().toArray()[0])==null?void 0:i.getEngineObject(s))?e.call(n):requestAnimationFrame(()=>nc(n,s,e))}function Jp(n,s,e,t=!0){t&&e(),n.dispose(s.disposableOn(e))}function qp(n,s){const{type:e,id:t}=n;if(e){const i=M.create(e,t);if(i)return i.json=n,i;console.warn(`cannot create sceneObject from type(${e})`)}else console.warn(`cannot create sceneObject from type(${e})`)}function rc(n){const s=n.children&&Wr(n.children,t=>{if(!(t instanceof Ie))throw new Error("!(treeItem instanceof SceneTreeItem)");return!t.show})||!1,e=n.sceneTree.getSceneObjectShowFunc(n.sceneObject);return!s||e}class Ie extends vn{constructor(e,t=!1,i,r,o=!0){super(e,t,i);a(this,"_dragDrop");a(this,"_showChangedNotAffectChildren",!1);a(this,"_showChangedNotAffectParent",!1);a(this,"_type",this.dv(w("Unknown")));a(this,"_isExport",this.dv(w(!0)));const l=()=>this.tree&&this.tree.itemsChanged.emit([this]);this.dispose(this.nameChanged.disposableOn(l)),this.name=`未命名条目(${this.id})`,this.extras=r,this._isExport.value=o;let h;const c=()=>{h&&(h(),h=void 0)};this.dispose(c),this.dispose(this.sceneObjectChanged.disposableOn(u=>{c(),u&&(h=D([this,"name"],[u,"name"]))})),this.dispose(this.showChanged.disposableOn(u=>{if(e.setSceneObjectShowFunc(this.sceneObject,u),this.tree&&this.tree.forceRedraw(),this.children&&!this._showChangedNotAffectChildren)for(let p of this.children)p instanceof Ie&&(p._showChangedNotAffectParent=!0,p.show=u,p._showChangedNotAffectParent=!1);this.parent&&this.parent instanceof Ie&&!this._showChangedNotAffectParent&&(this.parent._showChangedNotAffectChildren=!0,this.parent.show=rc(this.parent),this.parent._showChangedNotAffectChildren=!1)})),this.dv(new le(this.sceneObjectChanged,()=>{if(!this.sceneObject)return;const u=new b;if("show"in this.sceneObject&&"showChanged"in this.sceneObject&&this.sceneObject.showChanged instanceof v){const p=()=>{this.show=e.getSceneObjectShowFunc(this.sceneObject)};p(),u.dispose(this.sceneObject.showChanged.disposableOn(p))}else if("enabled"in this.sceneObject&&"enabledChanged"in this.sceneObject&&this.sceneObject.enabledChanged instanceof v){const p=()=>{this.show=e.getSceneObjectShowFunc(this.sceneObject)};p(),u.dispose(this.sceneObject.enabledChanged.disposableOn(p))}return u})),this.childrenChangedEvent.disposableOn(()=>{const u=rc(this);this._showChangedNotAffectChildren=!0,this.show=u,this._showChangedNotAffectChildren=!1});{const u=()=>{let p="Unknown";this.sceneObject?p=this.sceneObject.typeName:this.children&&(p="Folder"),this._type.value=p};this.dispose(this.sceneObjectChanged.disposableOn(u)),this.dispose(this.childrenResetedEvent.disposableOn(u)),u()}}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(e){this._isExport.value=e}get sceneTree(){return this.tree}get jsonStr(){return JSON.stringify(this.json,void 0," ")}set jsonStr(e){try{this.json=JSON.parse(e)}catch(t){console.error(`sceneTreeItem.jsonStr error ${t}`,t)}}get completeJson(){const e=this.children&&[...this.children].filter(t=>t.isExport).map(t=>t.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:e,extras:this.extras}}get json(){const e=this.children&&[...this.children].filter(t=>t.isExport).map(t=>t.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:e,extras:this.extras}}set json(e){if(e.name!==void 0&&(this.name=e.name),this.extras=e.extras,this._showChangedNotAffectChildren=!0,this._showChangedNotAffectParent=!0,this.show=e.show??!0,this._showChangedNotAffectChildren=!1,this._showChangedNotAffectParent=!1,this.uiTreeObject.collapsed=e.collapsed??!1,this.sceneObject=void 0,e.sceneObj&&(this.sceneObject=this.sceneTree.createSceneObjectFunc(e.sceneObj,this)),!!e.children){if(this.resetChildren(!0),!this.children)throw new Error("resetChildren(true) cannot get children!");for(let t of e.children){const i=new Ie(this.tree,!0);i.json=t,this.children.push(i)}}}clone(){try{const e=new Ie(this.sceneTree,!!this.children,void 0,this.extras,this.isExport);return e.json=this.json,e.name=this.sceneTree.getSceneTreeItemCloneNameFunc(this),e}catch(e){console.error(`SceneTreeItem.clone error: ${e}`,e)}}insertNewTreeItem(e,t){if(e==="FolderInnerOrAfter"||e==="FolderInnerOrBefore"||e==="FolderInner"){if(t&&t.tree!==this.tree)return console.warn("newTreeItem.tree !== this.tree"),!1;if(this.children&&!(e.includes("Or")&&this.sceneObject))return t&&this.children.push(t),!0;if(e==="FolderInner")return!1;if(e==="FolderInnerOrAfter")return super.insertNewTreeItem("After",t);if(e==="FolderInnerOrBefore")return super.insertNewTreeItem("Before",t);throw new Error("should not be here!")}else return super.insertNewTreeItem(e,t)}}(n=>{n.createDefaultProps=()=>({name:"未命名条目",nameEditing:!1,sceneObject:void 0,show:!0,extras:te(void 0)})})(Ie||(Ie={})),Kt(Ie.prototype,Ie.createDefaultProps);function oc(n,s,e){let{offsetY:t}=s;if(!s.target||!("clientTop"in s.target))return"none";t+=2,t+=s.target.clientTop;let i="none";return n.children?t<=e*.3?i="before":t>=e*.7?!n.uiTreeObject.collapsed&&n.children.length>0?i="inner":i="after":i="inner":t<=e*.5?i="before":i="after",i}class ac extends Lh{constructor(s){super(),this._treeItem=s;const{dragStartDataManager:e}=this._treeItem.sceneTree;let t="none";const i=this.disposeVar(Gl(()=>{this._treeItem.uiTreeObject.moveToPositionMode=t,console.log(`uiTreeObject.moveToPositionMode = lastDragMode(${t});`)},200));function r(o){t!==o&&(t=o,i.restart())}this.dispose(this._dragStartEvent.disposableOn(o=>{e.data={type:"UITreeA",value:this._treeItem}})),this.dispose(this._dragOverEvent.disposableOn(o=>{if(!o.dataTransfer)return;o.preventDefault();const l=e;if(l.data&&l.data.type==="UITreeA"&&l.data.value!==void 0){const h=l.data.value,c=this._treeItem,{tree:u}=c;if(u){const p=[...u.selectedItems];~p.indexOf(h)||p.push(h);const g=oc(c,o,u.itemDivHeight);if(g!=="none"&&Si.canMoveToTreeItems(p,c,g)){o.dataTransfer.dropEffect="move",r(g);return}}}o.dataTransfer.dropEffect="none",r("none")})),this.dispose(this._dropEvent.disposableOn(o=>{const l=e;if(!(l.data&&l.data.type==="UITreeA"&&l.data.value!==void 0))return;const h=l.data.value,c=this._treeItem,{tree:u}=c;if(!u)return;const p=[...u.selectedItems];~p.indexOf(h)||p.push(h);const g=oc(c,o,u.itemDivHeight);g!=="none"&&Si.canMoveToTreeItems(p,c,g)&&(Si.moveToTreeItems(p,c,g),l.data=void 0,r("none"))})),this.dispose(this._dragLeaveEvent.disposableOn(()=>{t="none",i.restart()}))}}function Xp(n){if(!(n instanceof Ie))throw new Error("defaultCreateTreeItemDragDrop !(treeItem instanceof SceneTreeItem)");return new ac(n)}function Yp(n){let s=!1;return n&&("show"in n?s=n.show??!0:"enabled"in n&&(s=n.enabled??!0)),s}function Kp(n,s){n&&("show"in n?n.show=s:"enabled"in n&&(n.enabled=s))}const Zp=["EnvironmentVariables","ScriptsLoader","SceneScript","ScriptLoader"];function Qp(n){const s=[],{root:e={}}=n,t=[e];for(;t.length>0;){const i=t.pop();if(!i)throw new Error("!todo");if(i.children){for(let r of i.children)if(r.children&&t.unshift(r),r.sceneObj){const{type:o=void 0}=r.sceneObj;o||(console.warn("sceneObjJson has no type! treeItem.sceneObj: "),console.warn(r.sceneObj)),o&&Zp.includes(o)&&s.push(r.sceneObj)}}}return s}async function eg(n,s){const e=Qp(n);let t=0;const i=e.length;for(let r of e)if(++t,s){const o=t/i;s(o,t,i)}}class lc extends b{constructor(e,t){super();a(this,"treeItemContexMenuCallback");this._sceneTree=e,this._projectManager=t}get sceneTree(){return this._sceneTree}}class tg extends b{constructor(e){super();a(this,"_jsonLoadingEvent",this.disposeVar(new v));a(this,"_setJsonProcessing",this.disposeVar(Le(async(e,t)=>{this._jsonLoadingEvent.emit({type:"init"}),this._jsonLoadingEvent.emit({type:"loading"}),t&&await e.promise(this._sceneTree.preloadFunc(t)),this._setJson(t),this._jsonLoadingEvent.emit({type:"loaded"})})));this._sceneTree=e,this._setJsonProcessing.errorFunc=t=>{this._jsonLoadingEvent.emit({type:"error",error:t})}}get jsonLoadingEvent(){return this._jsonLoadingEvent}_setJson(e){try{this._sceneTree.setJson(e||{})}catch(t){console.error(`json数据装配时发生错误!error: ${t}`)}}get json(){return this._sceneTree.getJson()}set json(e){this._setJsonProcessing.restart(new st("JSON重新赋值!"),e)}get jsonStr(){return JSON.stringify(this.json,void 0," ")}set jsonStr(e){this.json=JSON.parse(e)}}function ig(n){return n.name+"_clone"}function Oo(n,s,e){if(n instanceof Ie)return n.insertNewTreeItem(s,e);{const t={FolderInnerOrAfter:"InnerOrAfter",FolderInnerOrBefore:"InnerOrBefore",FolderInner:"Inner",InnerOrAfter:"InnerOrAfter",InnerOrBefore:"InnerOrBefore",Inner:"Inner",After:"After",Before:"Before"};return n.insertNewTreeItem(t[s],e)}}function sg(n){[n,...n.getDescendants()].forEach(s=>s.destroy())}const ke=class ke extends Si{constructor(e,t,i,r){super(i);a(this,"_jsonLoading",this.disposeVar(new tg(this)));a(this,"createSceneObjectFunc",ke.defaultCreateSceneObjectFunc);a(this,"createTreeItemDragDropFunc",ke.defaultCreateTreeItemDragDropFunc);a(this,"preloadFunc",ke.defaultPreload);a(this,"getSceneObjectShowFunc",ke.defaultGetSceneObjectShow);a(this,"setSceneObjectShowFunc",ke.defaultSetSceneObjectShow);a(this,"getSceneTreeItemCloneNameFunc",ke.defaultGetSceneTreeItemCloneNameFunc);a(this,"debug",!1);a(this,"_contextMenu",this.disposeVar(new lc(this,this.projectManager)));a(this,"_showPropUiOnSelecting",this.disposeVar(w(!0)));this._name=e,this._dragStartDataManager=t,this._projectManager=r,this.dispose(this.selectedItems.changedEvent.disposableOn(()=>{var l,h;globalThis.lssn=this.lastSelectedItem,globalThis.lsso=(l=this.lastSelectedItem)==null?void 0:l.sceneObject,this.debug&&console.log(((h=this.lastSelectedItem)==null?void 0:h.sceneObject)??"select null")}));const{sceneObjectsManager:o}=this._projectManager;this.dispose(this.itemsDeleted.disposableOn(l=>{for(let h of l){const c=h,{sceneObject:u}=c;u&&o.deleteSceneObject(u)&&u.destroy()&&Kn(u,void 0);for(let p of c.getDescendants()){const{sceneObject:g}=p;g&&o.deleteSceneObject(g)&&g.destroy()&&Kn(g,void 0)}sg(h)}})),this.dispose(this.itemsAdded.disposableOn(l=>{for(let h of l){const c=h;c.sceneObject&&o.addSceneObject(c.sceneObject)&&Kn(c.sceneObject,c)}}))}get json(){return this._jsonLoading.json}set json(e){this._jsonLoading.json=e}get jsonStr(){return this._jsonLoading.jsonStr}set jsonStr(e){this._jsonLoading.jsonStr=e}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(e){this._showPropUiOnSelecting.value=e}get showPropUiOnSelectingChanged(){return this._showPropUiOnSelecting.changed}get sceneUiTree(){return this.uiTree}getTreeItemFromSceneObjId(e){const t=this.getDescendants();let i;for(let r of t)if(r.sceneObject&&r.sceneObject.id===e){i=r;break}return i}getTreeItemsFromSceneObjType(e){const t=this.getDescendants(),i=[],r=Array.isArray(e)?e:[e];for(let o of t)o.sceneObject&&r.includes(o.sceneObject.typeName)&&i.push(o);return i}getTreeItemsFromSceneObjName(e){var r;const t=this.getDescendants(),i=[];for(let o of t)(r=o.sceneObject)!=null&&r.name.includes(e)&&i.push(o);return i}get dragStartDataManager(){return this._dragStartDataManager}get completeJson(){return{root:{children:[...this.children].filter(e=>e.isExport).map(e=>e.completeJson)}}}getJson(){return{root:{children:[...this.children].filter(e=>e.isExport).map(e=>e.json)}}}setJson(e){var i;e.root=e.root||{};const t=e.root.children??[];this.root.resetChildren(!0);for(let r of t){const o=new Ie(this,!0);o.json=r,(i=this.root.children)==null||i.push(o)}}testAddNewTreeItem(e,t){const i=e||this.lastSelectedItem||this.root;return i?Oo(i,t):!1}addNewTreeItem(e,t,i,r){const o=e||this.lastSelectedItem||this.root;if(o&&Oo(o,t)){const l=new Ie(this,i);if(l.sceneObject=r,!Oo(o,t,l))throw new Error("currentTreeItem.insertNewTreeItem return false!");return l}}createSceneObjectTreeItem(e,t,i,r){const o=r??"FolderInnerOrAfter";if(!this.testAddNewTreeItem(i,o)){console.warn(`cannot addNewTreeItem! currentTreeItem(${i?i.id:"root"})`);return}const l=M.create(e,t);return l?this.addNewTreeItem(i,r??"FolderInnerOrAfter",!0,l):void 0}createGroupTreeItem(e,t,i,r){const o=r??"FolderInnerOrAfter";if(!this.testAddNewTreeItem(i,o)){console.warn(`cannot addNewTreeItem! currentTreeItem(${i?i.id:"root"})`);return}const l=this.addNewTreeItem(i,r??"FolderInnerOrAfter",!0);if(!l){console.warn("addNewTreeItem error!");return}return l.name=e??"未命名组节点",l}createSceneObjectTreeItemFromClass(e,t,i,r){const o=r??"FolderInnerOrAfter";if(!this.testAddNewTreeItem(i,o))return;const l=M.createFromClass(e,t);return l?this.addNewTreeItem(i,o,!0,l):void 0}createSceneObjectTreeItemFromJson(e,t,i){const r=i??"FolderInnerOrAfter";if(!this.testAddNewTreeItem(t,r))return;const o=M.createFromJson(e);return console.log(o),o?this.addNewTreeItem(t,i??"FolderInnerOrAfter",!0,o):void 0}destroySceneObjectTreeItem(e){if(e===this.root){console.warn("cannot destroy root! please use function destroyAllSceneObjectTreeItems!");return}e.detachFromParent()}destroyAllSceneObjectTreeItems(){if(!this.root.children)return;const e=[...this.root.children];for(let t of e)this.destroySceneObjectTreeItem(t)}};a(ke,"defaultCreateSceneObjectFunc",qp),a(ke,"defaultCreateTreeItemDragDropFunc",Xp),a(ke,"defaultPreload",eg),a(ke,"defaultGetSceneObjectShow",Yp),a(ke,"defaultSetSceneObjectShow",Kp),a(ke,"defaultGetSceneTreeItemCloneNameFunc",ig);let bn=ke;const Do={saturation:.35,brightness:1.4,gamma:.8,atmosphereScatteringIntensity:5,groundColor:[0,.09411764705882353,.3137254901960784,1]};class ng extends b{constructor(e){super();a(this,"_currentPosition",this.disposeVar(q(void 0)));a(this,"_currentRotation",this.disposeVar(q(void 0)));a(this,"_currentHeading",this.disposeVar(w(void 0)));a(this,"_isRotating",this.disposeVar(w(!1)));a(this,"_isGround",this.disposeVar(w(!1)));a(this,"_startPosition",[0,0,0]);a(this,"_startRotation",[0,0,0]);a(this,"_processing",this.disposeVar(Le(async(e,t,i,r)=>{const{currentPosition:o,currentRotation:l}=this;if(!o||r<=0||!l){this._currentPosition.value=t,this._currentRotation.value=i;return}const h=this._startPosition;h.splice(0,3,...o);const c=this._startRotation;c.splice(0,3,...l);let u=Date.now();const p=En(h,t);this._currentHeading.value=p;const m=er(h,t)/r,y=[i[0]-c[0],i[1]-c[1],i[2]-c[2]],S=t[2]-h[2];await e.promise(new Promise(C=>{e.disposer.dispose(Ln(async()=>{let T=Date.now()-u;T=T<0?0:T,T=T>r?r:T;const V=T*m,z=To(h,V,p);if(this.isGround&&z){const x=await this._esviewer.getTerrainHeight([z[0],z[1]]);this._currentPosition.value=[z[0],z[1],x??0]}else z&&(z[2]+=S*(T/r)),this._currentPosition.value=z;if(this.isRotating){const[x,$,Y]=y,Q=T/r;this._currentRotation.value=[c[0]+x*Q,c[1]+$*Q,c[2]+Y*Q]}T===r&&(this._currentPosition.value=t,this.isRotating&&(this._currentRotation.value=i),this.isRotating=!1,this.isGround=!1,C())}))}))})));this._esviewer=e}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(e){this._isRotating.value=e}get isRotatingChanged(){return this._isRotating.changed}get isGround(){return this._isGround.value}set isGround(e){this._isGround.value=e}get isGroundChanged(){return this._isGround.changed}get processing(){return this._processing}restart(e,t,i){this._processing.restart(void 0,e,t,i)}cancel(){this._processing.cancel()}}const rg=.06,hc=1.5,cc=2,dc=70,uc=60;function Ci(n){return K.point(n)}function wt(n,s,e){const t=Ci(n),i=K.destination(t,e,s,{units:"meters"}),[r,o]=K.getCoords(i);return[r,o,n[2]]}function nr(n,s){return K.bearing(Ci(n),Ci(s))}function rr(n,s,e,t,i=1e3){const r=K.lineString([K.getCoords(K.destination(Ci(n),i,(s+180)%360,{units:"meters"})),n,K.getCoords(K.destination(Ci(n),i,s,{units:"meters"}))]),o=K.lineString([K.getCoords(K.destination(Ci(e),i,(t+180)%360,{units:"meters"})),e,K.getCoords(K.destination(Ci(e),i,t,{units:"meters"}))]),l=K.lineIntersect(r,o);if(l.features.length>0){const[h,c]=K.getCoords(l.features[0]);return[h,c,(n[2]+e[2])/2]}return e}function pc(n,s,e,t){const i=(e-90+360)%360,r=(e+90+360)%360;n.leftPoints.push(wt(s,i-dc,t*hc)),n.headPoints.push(wt(s,i-uc,t*cc)),n.headPoints.push(s),n.headPoints.push(wt(s,r+uc,t*cc)),n.rightPoints.push(wt(s,r+dc,t*hc))}function og(n,s,e,t){const i=(s-90+360)%360,r=(s+90+360)%360,o=e*rg*Math.min(.3,1-t);return{leftPoint:wt(n,i,o),rightPoint:wt(n,r,o),verticalLen:o}}function ag(n,s){if(!n||n.length<2)return;const e=s==="swallowTailArrow",t=n.length,i=t-1,r=Math.max(...Vt(n,"NONE")),o={leftPoints:[],rightPoints:[],headPoints:[]};let l;for(let m=0;m<t;m++){const y=n[m],S=m==i?n[n.length-2]:n[m+1],C=m==i?nr(S,y):nr(y,S),{leftPoint:T,rightPoint:V,verticalLen:z}=og(y,C,r,m/t);m===0?(o.leftPoints.push(T),o.rightPoints.push(V),e&&(o.tailPoint=wt(y,C,z))):m===i?pc(o,y,C,z):l!==void 0?(o.leftPoints.push(rr(o.leftPoints[m-1],l,T,C,r)),o.rightPoints.push(rr(o.rightPoints[m-1],l,V,C,r))):(o.leftPoints.push(T),o.rightPoints.push(V)),l=C}const h=o.leftPoints,c=o.rightPoints,u=h.length>=2?gs(h):h,p=c.length>=2?gs(c):c,g=[...u,...o.headPoints,...p.reverse()];return o.tailPoint&&g.push(o.tailPoint),g.push(o.leftPoints[0]),g}function lg(n,s,e,t){const i=K.lineString([[n[0],n[1]],[s[0],s[1]]]),r=K.lineString([[e[0],e[1]],[t[0],t[1]]]);return K.lineIntersect(i,r).features.length>0}function hg(n,s,e,t){const i=(s-90+360)%360,r=(s+90+360)%360,o=e*Math.min(.3,1-t);return{leftPoint:wt(n,i,o),rightPoint:wt(n,r,o),verticalLen:o}}function cg(n,s){if(!n||n.length<3)return;const e=s==="swallowTailArrow",t=n.length,i=t-1,r=n.slice(0,2),o=tr(r),l=Vt(r,"NONE").pop()??0,h=Math.max(...Vt(n,"NONE")),c={leftPoints:[],rightPoints:[],headPoints:[]};let u;for(let C=1;C<t;C++){const T=C===1?o.center:n[C],V=C===i?n[t-2]:n[C+1],z=C===i?nr(V,T):nr(T,V);let{leftPoint:x,rightPoint:$,verticalLen:Y}=hg(T,z,l,C/t);if(C===1)c.leftPoints.push(r[0]),c.rightPoints.push(r[1]),e&&(c.tailPoint=wt(T,z,l));else if(C===i)pc(c,T,z,Y);else if(u!==void 0){if(C===2&&lg(c.leftPoints[0],x,c.rightPoints[0],$)){const Ae=c.leftPoints[0];c.leftPoints[0]=c.rightPoints[0],c.rightPoints[0]=Ae}const Q=C-2;c.leftPoints.push(rr(c.leftPoints[Q],u,x,z,h)),c.rightPoints.push(rr(c.rightPoints[Q],u,$,z,h))}else c.leftPoints.push(x),c.rightPoints.push($);u=z}let p=c.leftPoints,g=c.rightPoints;const m=p.length>=2?gs(p):p,y=g.length>=2?gs(g):g,S=[...m,...c.headPoints,...y.reverse()];return c.tailPoint&&S.push(c.tailPoint),S.push(p[0]),S}function Fo(n,s,e=!1){return e?cg(n,s):ag(n,s)}function gc(n){let s=0;function e(t,i){i++,s=Math.max(i,s),t.forEach(r=>{Array.isArray(r)&&e(r,i)})}return e(n,0),s}const bt=class bt extends X{constructor(e){super(e);a(this,"editingBindMode","lineString");a(this,"_area",this.dv(w(0)));a(this,"_perimeter",this.dv(w(0)));this.d(de(this.pointsChanged,()=>{this._updateArea(),this._updatePerimeter()},{immediate:!0}))}updateEditing(){var t;const e=[];this.editingBindMode=="doublePoints"?e.push(I.DoublePoints):this.editingBindMode=="lineString"?e.push(I.LineStringAppend,I.LineStringInsert,I.Translation):this.editingBindMode=="circular"?(e.push(I.CircularAppend,I.CircularInsert,I.Translation),this.supportEditingModes().includes(I.HeightModify)&&e.push(I.HeightModify)):this.editingBindMode=="visibility"?e.push(I.VisibilityAppend,I.VisibilityModify):this.editingBindMode=="scatter"&&e.push(I.ScatterAppend,I.ScatterModify),(t=this.activeViewer)==null||t.startEditing(this,e,{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 Po([...this.points])}getDistance(){if(this.points&&this.points.length>=2){const e=Vt(this.points,"GEODESIC");return e[e.length-1]}else return}getPerimeter(){if(this.points&&this.points.length>=3){const e=[...this.points,this.points[0]],t=Vt(e,"GEODESIC");return t[t.length-1]}else return}getIntersect(e){if(this.points&&this.points.length>=3&&e.length>=3){const t=Yh(this.points,e);if(!t)return;const i=t[0][0][0];if(Array.isArray(i)){const r=[...t],o=[];return r.forEach(l=>{const h=l[0].map(c=>[...c,0]);o.push(h)}),o}else return[[...t][0].map(l=>[...l,0])]}else return}getUnion(e){if(this.points&&this.points.length>=3&&e.length>=3){const t=Kh(this.points,e);if(!t)return;const i=t[0][0][0];if(Array.isArray(i)){const r=[...t],o=[];return r.forEach(l=>{const h=l[0].map(c=>[...c,0]);o.push(h)}),o}else return[[...t][0].map(l=>[...l,0])]}else return}getDifference(e){if(this.points&&this.points.length>=3&&e.length>=3){let t=[...e];const i=e[0],r=e[e.length-1];i[0]===r[0]&&i[1]===r[1]&&i[2]===r[2]||t.push(i);const o=Qh([...this.points,this.points[0]],[...t]);if(!o)return{status:"undefined",positions:void 0};const l=[...o];if(gc(l)===3){const h=l.map(g=>g.map(m=>[...m,0]));if(h.length<=1)return{status:"notIncluded",positions:h};const c=h[0],u=h[1];return Io([...c],[...u])==="oneBig"?{status:"included",positions:h}:{status:"notIncluded",positions:h}}else if(gc(l)===4){const c=[...l.map(p=>p.map(g=>g.map(m=>[...m,0])))],u=[];return c.forEach(p=>{u.push(p[0])}),{status:"notIncluded",positions:u}}else return{status:"undefined",positions:void 0}}else return{status:"undefined",positions:void 0}}getBuffer(e=500,t){if(this.points&&this.points.length>=2){const i=Zh(this.points,e,t);return i?[i[0].map(r=>[...r,0])]:void 0}else return}geoPolygonOverlap(e){if(this.points&&this.points.length>=3&&e.length>=3){const t=Io(this.points,e);return t==="oneBig"?!0:t==="twoBig"?!1:void 0}else return}getESProperties(){const e={...super.getESProperties()};return{...e,defaultMenu:"style",coordinate:[...e.coordinate,new E([this,"editing"],"编辑",!1),new ie([this,"points"],"位置数组",bt.defaults.points,void 0,!0)],style:[...e.style,new k("点样式"),new E([this,"pointed"],"开启",!1),new f([this,"pointSize"],"点大小",1),new A([this,"pointSizeType"],[["screen","screen"],["world","world"]],"点类型","screen"),new G([this,"pointColor"],"点颜色",[1,1,1,1]),new G([this,"pointOutlineColor"],"轮廓颜色",bt.defaults.pointStyle.outlineColor),new f([this,"pointOutlineWidth"],"轮廓宽度",bt.defaults.pointStyle.outlineWidth),new k("线样式"),new E([this,"stroked"],"开启线样式",!0),new E([this,"strokeGround"],"贴地",!1),new f([this,"strokeWidth"],"线宽",1),new A([this,"strokeWidthType"],[["screen","screen"],["world","world"]],"线类型","screen"),new G([this,"strokeColor"],"线颜色",[1,1,1,1]),new k("面样式"),new E([this,"filled"],"开启",!1),new E([this,"fillGround"],"贴地",!1),new G([this,"fillColor"],"填充颜色",[1,1,1,1])],more:[...e.more,new k("点样式集合"),new N([this,"pointMaterial"],"点材质"),new R([this,"pointMaterialParams"],"点材质参数",{}),new k("线样式集合"),new N([this,"strokeMaterial"],"线材质"),new R([this,"strokeMaterialParams"],"线材质参数",{}),new k("面样式集合"),new N([this,"fillMaterial"],"面材质"),new R([this,"fillMaterialParams"],"面材质参数",{})]}}get pointSize(){return this.pointStyle.size}set pointSize(e){this.pointStyle={...this.pointStyle,size:e}}get pointSizeChanged(){return this.pointStyleChanged}get pointSizeType(){return this.pointStyle.sizeType}set pointSizeType(e){this.pointStyle={...this.pointStyle,sizeType:e}}get pointSizeTypeChanged(){return this.pointStyleChanged}get pointColor(){return this.pointStyle.color}set pointColor(e){this.pointStyle={...this.pointStyle,color:[...e]}}get pointColorChanged(){return this.pointStyleChanged}get pointOutlineColor(){return this.pointStyle.outlineColor}set pointOutlineColor(e){this.pointStyle={...this.pointStyle,outlineColor:[...e]}}get pointOutlineColorChanged(){return this.pointStyleChanged}get pointOutlineWidth(){return this.pointStyle.outlineWidth}set pointOutlineWidth(e){this.pointStyle={...this.pointStyle,outlineWidth:e}}get pointOutlineWidthChanged(){return this.pointStyleChanged}get pointMaterial(){return this.pointStyle.material}set pointMaterial(e){this.pointStyle={...this.pointStyle,material:e}}get pointMaterialChanged(){return this.pointStyleChanged}get pointMaterialParams(){return this.pointStyle.materialParams}set pointMaterialParams(e){this.pointStyle={...this.pointStyle,materialParams:e}}get pointMaterialParamsChanged(){return this.pointStyleChanged}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}};a(bt,"createDefaultProps",()=>({...X.createDefaultProps(),pointed:!1,pointStyle:B({size:10,sizeType:"screen",color:[1,1,1,1],material:"",materialParams:{},outlineColor:[1,0,0,1],outlineWidth:2}),stroked:!1,strokeStyle:B({width:1,widthType:"screen",color:[1,1,1,1],material:"",materialParams:{},ground:!1}),filled:!1,fillStyle:B({color:[1,1,1,1],material:"",materialParams:{},ground:!1}),points:Yt([])})),a(bt,"type",bt.register("ESGeoVector",bt,{chsName:"地理矢量",tags:["ESObjects","base"],description:"地理矢量"})),a(bt,"supportEditingModes",[...X.supportEditingModes,I.Translation]);let U=bt;const Oi=class Oi extends X{constructor(){super(...arguments);a(this,"_statusDis",this.dv(w(!0)));a(this,"_smoothMoveEvent",this.dv(new v));a(this,"_smoothMoveWithRotationEvent",this.dv(new v));a(this,"_smoothMoveOnGroundEvent",this.dv(new v));a(this,"_smoothMoveWithRotationOnGroundEvent",this.dv(new v));a(this,"_automaticLandingEvent",this.dv(new v));a(this,"_smoothMoveKeepPitchEvent",this.dv(new v));a(this,"_smoothMoveRelativelyEvent",this.dv(new v));a(this,"_smoothMoveRelativelyWithRotationEvent",this.dv(new v));a(this,"useCalcFlyToParamInESObjectWithLocation",!0)}updateEditing(){var t;const e=[];this.editingBindMode=="singlePoint"?(e.push(I.SinglePoint),["ESLocationMeasurement"].includes(this.typeName)||e.push(I.Rotation),["ESClippingPlane","ESLocationMeasurement","ESLocalRectangle","ESBoxClipping"].includes(this.typeName)||e.push(I.Scale)):this.editingBindMode=="doublePoints"&&e.push(I.DoublePoints),(t=this.activeViewer)==null||t.startEditing(this,e,{callSource:"inner"})}get statusDis(){return this._statusDis.value}get statusDisChanged(){return this._statusDis.changed}get smoothMoveEvent(){return this._smoothMoveEvent}smoothMove(e,t){this._smoothMoveEvent.emit(e,t)}get smoothMoveWithRotationEvent(){return this._smoothMoveWithRotationEvent}smoothMoveWithRotation(e,t,i){this._smoothMoveWithRotationEvent.emit(e,t,i)}get smoothMoveOnGroundEvent(){return this._smoothMoveOnGroundEvent}smoothMoveOnGround(e,t,i,r){this._smoothMoveOnGroundEvent.emit(e,t,i,r)}get smoothMoveWithRotationOnGroundEvent(){return this._smoothMoveWithRotationOnGroundEvent}smoothMoveWithRotationOnGround(e,t,i,r,o){this._smoothMoveWithRotationOnGroundEvent.emit(e,t,i,r,o)}get automaticLandingEvent(){return this._automaticLandingEvent}automaticLanding(){const e=this.collision;this.collision=!1,setTimeout(()=>{this._automaticLandingEvent.emit(e)},100)}get smoothMoveKeepPitchEvent(){return this._smoothMoveKeepPitchEvent}smoothMoveKeepPitch(e,t){this._smoothMoveKeepPitchEvent.emit(e,t)}get smoothMoveRelativelyEvent(){return this._smoothMoveRelativelyEvent}smoothMoveRelatively(e,t){this._smoothMoveRelativelyEvent.emit(e,t)}get smoothMoveRelativelyWithRotationEvent(){return this._smoothMoveRelativelyWithRotationEvent}smoothMoveRelativelyWithRotation(e,t,i){this._smoothMoveRelativelyWithRotationEvent.emit(e,t,i)}getESProperties(){const e={...super.getESProperties()},t=[...e.location,new E([this,"editing"],"是否编辑"),new L("自动落地",this.automaticLanding.bind(this),[]),new nt([this,"position"],"位置数组",[0,0,0]),new ds([this,"rotation"],"姿态数组",[0,0,0]),new ue([this,"scale"],"缩放",[1,1,1]),new f([this,"minVisibleDistance"],"最小可见距离",0),new f([this,"maxVisibleDistance"],"最大可见距离",0)];return["ESHuman","ESGltfModel","ESFountainParticleSystem","ESHumanFountain"].includes(this.typeName)&&t.push(new ue([this,"positionOffset"],"位置偏移",[0,0,0])),{...e,defaultMenu:"basic",location:t,more:[...e.more,new L("平滑移动",this.smoothMove.bind(this),[[0,0,0],0]),new L("固定方向平滑移动",this.smoothMoveKeepPitch.bind(this),[[0,0,0],0]),new L("平滑偏移",this.smoothMoveWithRotation.bind(this),[[0,0,0],[0,0,0],0]),new L("贴地平滑移动",this.smoothMoveOnGround.bind(this),[0,0,0,""]),new L("贴地平滑偏移",this.smoothMoveWithRotationOnGround.bind(this),[[0,0,0],0,0,0,""]),new L("相对平滑移动",this.smoothMoveRelatively.bind(this),[[0,0,0],0]),new L("相对平滑偏移",this.smoothMoveRelativelyWithRotation.bind(this),[[0,0,0],[0,0,0],0]),new E([this,"enableVisibleDistance"],"是否应用距离显隐")]}}get pointSize(){return this.pointStyle.size}set pointSize(e){this.pointStyle={...this.pointStyle,size:e}}get pointSizeChanged(){return this.pointStyleChanged}get pointSizeType(){return this.pointStyle.sizeType}set pointSizeType(e){this.pointStyle={...this.pointStyle,sizeType:e}}get pointSizeTypeChanged(){return this.pointStyleChanged}get pointColor(){return this.pointStyle.color}set pointColor(e){this.pointStyle={...this.pointStyle,color:[...e]}}get pointColorChanged(){return this.pointStyleChanged}get pointMaterial(){return this.pointStyle.material}set pointMaterial(e){this.pointStyle={...this.pointStyle,material:e}}get pointMaterialChanged(){return this.pointStyleChanged}get pointMaterialParams(){return this.pointStyle.materialParams}set pointMaterialParams(e){this.pointStyle={...this.pointStyle,materialParams:e}}get pointMaterialParamsChanged(){return this.pointStyleChanged}};a(Oi,"createDefaultProps",()=>({...X.createDefaultProps(),pointed:!1,pointStyle:B({size:1,sizeType:"screen",color:[1,1,1,1],material:"",materialParams:{},outlineColor:[1,0,0,1],outlineWidth:2}),position:F([0,0,0]),rotation:F([0,0,0]),positionOffset:F([0,0,0]),scale:F([1,1,1]),minVisibleDistance:w(0),maxVisibleDistance:w(0)})),a(Oi,"type",Oi.register("ESObjectWithLocation",Oi,{chsName:"对象位置",tags:["ESObjects","base"],description:"对象位置"})),a(Oi,"supportEditingModes",[...X.supportEditingModes,I.SinglePoint,I.Place,I.Translation,I.Rotation,I.Scale,I.DoublePoints,I.DoublePointsAppend,I.DoublePointsModify]);let j=Oi;const Es=class Es extends j{getESProperties(){const s={...super.getESProperties()};return{...s,style:[...s.style,new k("点样式集合"),new E([this,"pointed"],"开启点样式",!1),new f([this,"pointSize"],"点大小",1),new A([this,"pointSizeType"],[["screen","screen"],["world","world"]],"点类型","screen"),new G([this,"pointColor"],"点颜色",[1,1,1,1]),new k("线样式集合"),new E([this,"stroked"],"开启线样式",!1),new E([this,"strokeGround"],"是否贴地(线)",!1),new f([this,"strokeWidth"],"线宽",1),new A([this,"strokeWidthType"],[["screen","screen"],["world","world"]],"线类型","screen"),new G([this,"strokeColor"],"线颜色",[1,1,1,1]),new k("面样式集合"),new E([this,"filled"],"开启填充样式",!1),new E([this,"fillGround"],"是否贴地",!1),new G([this,"fillColor"],"填充颜色",[1,1,1,1])],more:[...s.more,new k("点样式"),new N([this,"pointMaterial"],"点材质",""),new R([this,"pointMaterialParams"],"点材质参数",{}),new k("线样式"),new N([this,"strokeMaterial"],"线材质",""),new R([this,"strokeMaterialParams"],"线材质参数",{}),new k("填充样式"),new N([this,"fillMaterial"],"面材质",""),new R([this,"fillMaterialParams"],"面材质参数",{})]}}get strokeWidth(){return this.strokeStyle.width}set strokeWidth(s){this.strokeStyle={...this.strokeStyle,width:s}}get strokeWidthChanged(){return this.strokeStyleChanged}get strokeWidthType(){return this.strokeStyle.widthType}set strokeWidthType(s){this.strokeStyle={...this.strokeStyle,widthType:s}}get strokeWidthTypeChanged(){return this.strokeStyleChanged}get strokeColor(){return this.strokeStyle.color}set strokeColor(s){this.strokeStyle={...this.strokeStyle,color:[...s]}}get strokeColorChanged(){return this.strokeStyleChanged}get strokeMaterial(){return this.strokeStyle.material}set strokeMaterial(s){this.strokeStyle={...this.strokeStyle,material:s}}get strokeMaterialChanged(){return this.strokeStyleChanged}get strokeMaterialParams(){return this.strokeStyle.materialParams}set strokeMaterialParams(s){this.strokeStyle={...this.strokeStyle,materialParams:s}}get strokeMaterialParamsChanged(){return this.strokeStyleChanged}get strokeGround(){return this.strokeStyle.ground}set strokeGround(s){this.strokeStyle={...this.strokeStyle,ground:s}}get strokeGroundChanged(){return this.strokeStyleChanged}get fillColor(){return this.fillStyle.color}set fillColor(s){this.fillStyle={...this.fillStyle,color:[...s]}}get fillColorChanged(){return this.fillStyleChanged}get fillMaterial(){return this.fillStyle.material}set fillMaterial(s){this.fillStyle={...this.fillStyle,material:s}}get fillMaterialChanged(){return this.fillStyleChanged}get fillMaterialParams(){return this.fillStyle.materialParams}set fillMaterialParams(s){this.fillStyle={...this.fillStyle,materialParams:s}}get fillMaterialParamsChanged(){return this.fillStyleChanged}get fillGround(){return this.fillStyle.ground}set fillGround(s){this.fillStyle={...this.fillStyle,ground:s}}get fillGroundChanged(){return this.fillStyleChanged}};a(Es,"createDefaultProps",()=>({...j.createDefaultProps(),pointed:!1,pointStyle:B({size:1,sizeType:"screen",color:[1,1,1,1],material:"",materialParams:{},outlineColor:[1,0,0,1],outlineWidth:1}),stroked:!1,strokeStyle:B({width:1,widthType:"screen",color:[1,1,1,1],material:"",materialParams:{},ground:!1}),filled:!1,fillStyle:B({color:[1,1,1,1],material:"",materialParams:{},ground:!1})})),a(Es,"type",Es.register("ESLocalVector",Es,{chsName:"本地矢量",tags:["ESObjects","base"],description:"本地矢量对象"}));let ti=Es;const Fn=class Fn extends ti{};a(Fn,"type",Fn.register("ESLocalVector2D",Fn,{chsName:"本地矢量2D",tags:["ESObjects","base"],description:"本地矢量2D对象"}));let ot=Fn;const dg=[["固定朝向",0],["面向屏幕旋转",1],["绕自身Z轴旋转",2]],ug=[["单面不透明",0],["双面不透明",1],["单面遮罩",2],["双面遮罩",3],["单面透明",4],["双面透明",5],["单面未遮挡透明",6],["双面未遮挡透明",7]],bs=class bs extends j{constructor(){super(...arguments);a(this,"_widgetEvent",this.dv(new v))}get widgetEvent(){return this._widgetEvent}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new E([this,"screenRender"],"屏幕渲染",!0),new E([this,"sizeByContent"],"尺寸自适应",!0),new ne([this,"size"],"尺寸大小",[100,100]),new ne([this,"anchor"],"偏移比例",[.5,1]),new ne([this,"offset"],"像素偏移",[0,0]),new A([this,"renderMode"],ug,"渲染模式",0),new A([this,"rotationType"],dg,"漫游旋转类型",1),new N([this,"actorTag"],"绑定对象"),new N([this,"socketName"],"插槽名称"),new ue([this,"positionOffset"],"位置偏移"),new ue([this,"rotationOffset"],"相对姿态")],more:[...e.more,new f([this,"zOrder"],"排序",0)]}}};a(bs,"createDefaultProps",()=>({...j.createDefaultProps(),screenRender:!0,size:F([100,100]),anchor:F([.5,1]),offset:F([0,0]),sizeByContent:!0,renderMode:0,rotationType:1,zOrder:0,actorTag:"",socketName:"",positionOffset:F([0,0,0]),rotationOffset:F([0,0,0])})),a(bs,"type",bs.register("ESLabel",bs,{chsName:"标签",tags:["ESObjects","base"],description:"标签对象"}));let ze=bs;const re=class re extends M{constructor(e){super(e);a(this,"_testEvent",this.dv(new v))}get testEvent(){return this._testEvent}func(e,t=!0){e.includes("completeJson")&&console.log("ESTestObject.completeJson",this.completeJson),e.includes("json")&&console.log("ESTestObject.json",this.json),t&&console.log("ESTestObject func"),this._testEvent.emit(e,t)}func1(e,t){e.includes("completeJson")&&console.log("ESTestObject.completeJson",this.completeJson),e.includes("json")&&console.log("ESTestObject.json",this.json),t&&console.log("ESTestObject func"),this._testEvent.emit(e,t)}getPadding(){return this.padding}getESProperties(){return{defaultMenu:"basic",basic:[new N([this,"typeName"],"类型",void 0,!1,!0),new N([this,"id"],"id",void 0,!1,!0),new N([this,"name"],"名称"),new N([this,"ref"],"引用",void 0,!0),new R([this,"extras"],"扩展属性",{},void 0,!0),new _o("JSON",()=>this._jsonStr,e=>e&&(this._jsonStr=e))],general:[new E([this,"show"],"是否显示",re.defaults.show),new G([this,"color"],"颜色",re.defaults.color),new A([this,"paramType"],[["screen","screen"],["world","world"]],"参数类型",re.defaults.paramType),new _n([this,"text"],"内容",re.defaults.text)],dataSource:[new Ve([this,"startTime"],"开始时间",re.defaults.startTime),new Xe([this,"code"],"js代码",re.defaults.code),new vo([this,"times"],"时间组",re.defaults.times),new N([this,"url"],"服务地址",re.defaults.url),new L("func",this.func.bind(this),[["completeJson","json"]]),new L("func1",(e,t)=>this.func1(e,t),[["completeJson","json"],!0])],location:[new ue([this,"positionOffset"],"位置偏移",re.defaults.positionOffset),new nt([this,"position"],"位置数组",re.defaults.position),new ds([this,"rotation"],"姿态数组",re.defaults.rotation)],coordinate:[new f([this,"height"],"高度(m)",re.defaults.height),new ie([this,"points"],"位置数组",re.defaults.points)],style:[new Fe([this,"padding"],"内边距",re.defaults.padding),new ne([this,"offset"],"像素偏移",re.defaults.offset),new k("样式"),new Yn([this,"dashPattern"],"虚线图案",255),new k("样式2"),new G([this,"color"],"颜色",re.defaults.color),new R([this,"strokeStyle"],"线样式参数",re.defaults.strokeStyle)],more:[]}}};a(re,"createDefaultProps",()=>({...M.createDefaultProps(),show:!0,url:"http://localhost:8080/earthsdk3/earthsdk3.gltf",height:100,position:F([116.39,39.9,100]),rotation:F([0,-90,0]),points:Yt([]),color:F([1,0,0,1]),strokeStyle:B({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:F([]),offset:F([10,0]),positionOffset:F([0,2,0]),padding:F([0,2,0,2])})),a(re,"type",re.register("ESTestObject",re,{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 ko=re;const St=class St extends X{constructor(e){super(e);a(this,"_refreshTilesetEvent",this.dv(new v));a(this,"_tilesetReadyEvent",this.dv(new v));a(this,"_supportEdit",this.dv(w(!0)));a(this,"_highlightFeatureEvent",this.dv(new v));a(this,"_highlightFeatureAndFlyToEvent",this.dv(new v));a(this,"_strokeFeatureEvent",this.disposeVar(new v));a(this,"_getFeatureTableEvent",this.dv(new v));a(this,"_featureTableResultEvent",this.dv(new v));a(this,"_getMaterialNameListEvent",this.disposeVar(new v));a(this,"_setFeatureStyleEvent",this.dv(new v));a(this,"_setFeatureColorEvent",this.dv(new v));a(this,"_setFeatureVisableEvent",this.dv(new v));a(this,"_resetFeatureStyleEvent",this.dv(new v));a(this,"setMaterialInfoEvent",this.ad(new v));a(this,"_setMaterialEvent",this.disposeVar(new v));a(this,"_clippingPlanesId",this.dv(w("")));a(this,"_clippingPlaneIds",this.dv(w([])));a(this,"_flattenedPlaneId",this.dv(w("")));a(this,"_flattenedPlaneEnabled",this.dv(w(!1)));a(this,"_clippingPlaneId",this.dv(w("")));a(this,"_excavateId",this.dv(F([])))}updateEditing(){var e;(e=this.activeViewer)==null||e.startEditing(this,[I.Translation,I.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(e){this._supportEdit.value=e}get supportEditChanged(){return this._supportEdit.changed}get highlightFeatureEvent(){return this._highlightFeatureEvent}highlightFeature(e,t){this._highlightFeatureEvent.emit(e,t)}get highlightFeatureAndFlyToEvent(){return this._highlightFeatureAndFlyToEvent}highlightFeatureAndFlyTo(e,t,i,r){this._highlightFeatureAndFlyToEvent.emit(e,t,i,r)}get strokeFeatureEvent(){return this._strokeFeatureEvent}strokeFeature(e,t=[1,0,0,1]){this._strokeFeatureEvent.emit(e,t)}get getFeatureTableEvent(){return this._getFeatureTableEvent}getFeatureTable(){return Promise.race([new Promise(e=>{const t=this.d(this._featureTableResultEvent.donce(e));this._getFeatureTableEvent.emit(),setTimeout(()=>{t(),e(void 0)},2e3)})])}get getMaterialNameListEvent(){return this._getMaterialNameListEvent}getMaterialNameList(){return new Promise(e=>{const t=new b;t.d(this.getMaterialNameListEvent.don(i=>{i!=="start"&&(t.destroy(),e(i))})),this.getMaterialNameListEvent.emit("start"),setTimeout(()=>{t.isDestroyed()||(t.destroy(),e(void 0))},2e3)})}get setFeatureStyleEvent(){return this._setFeatureStyleEvent}setFeatureStyle(e,t=!1){this._setFeatureStyleEvent.emit(e,t)}get setFeatureColorEvent(){return this._setFeatureColorEvent}setFeatureColor(e,t,i=!1){this._setFeatureColorEvent.emit(e,typeof t=="string"?JSON.parse(t):t,i)}get setFeatureVisableEvent(){return this._setFeatureVisableEvent}setFeatureVisable(e,t,i=!1){this._setFeatureVisableEvent.emit(e,typeof t=="string"?JSON.parse(t):t,i)}get resetFeatureStyleEvent(){return this._resetFeatureStyleEvent}resetFeatureStyle(e){this._resetFeatureStyleEvent.emit(e)}get setMaterialEvent(){return this._setMaterialEvent}setMaterial(e){return new Promise(t=>{const i=new b;i.ad(this.setMaterialInfoEvent.donce(r=>{i.destroy(),t(r)})),this._setMaterialEvent.emit(e)})}get clippingPlanesId(){return this._clippingPlanesId.value}set clippingPlanesId(e){this._clippingPlanesId.value=e}get clippingPlanesIdChanged(){return this._clippingPlanesId.changed}get clippingPlaneIds(){return this._clippingPlaneIds.value}set clippingPlaneIds(e){this._clippingPlaneIds.value=e}get clippingPlaneIdsChanged(){return this._clippingPlaneIds.changed}get flattenedPlaneId(){return this._flattenedPlaneId.value}set flattenedPlaneId(e){this._flattenedPlaneId.value=e}get flattenedPlaneIdChanged(){return this._flattenedPlaneId.changed}get flattenedPlaneEnabled(){return this._flattenedPlaneEnabled.value}set flattenedPlaneEnabled(e){this._flattenedPlaneEnabled.value=e}get flattenedPlaneEnabledChanged(){return this._flattenedPlaneEnabled.changed}get clippingPlaneId(){return this._clippingPlaneId.value}set clippingPlaneId(e){this._clippingPlaneId.value=e}get clippingPlaneIdChanged(){return this._clippingPlaneId.changed}get excavateId(){return this._excavateId.value}set excavateId(e){this._excavateId.value=e}get excavateIdChanged(){return this._excavateId.changed}setLight122(){this.czmEnvironmentMapManager={...Do}}getESProperties(){const e={...super.getESProperties()};return{...e,defaultMenu:"dataSource",basic:[...e.basic,new pe([this,"maximumScreenSpaceError"],1,[0,256],"精度",16),new A([this,"materialMode"],[["常规","normal"],["科技感","technology"]],"材质模式","normal",!0),new A([this,"colorBlendMode"],[["默认","HIGHLIGHT"],["替换","REPLACE"],["混合","MIX"]],"颜色模式","HIGHLIGHT"),new R([this,"materialOverrideMap"],"材质替换",St.defaults.materialOverrideMap)],dataSource:[...e.dataSource,new R([this,"url"],"服务地址",St.defaults.url,void 0,!0)],coordinate:[...e.coordinate,new E([this,"editing"],"编辑",!1,!0),new ue([this,"offset"],"偏移",[0,0,0],!0),new ds([this,"rotation"],"旋转",[0,0,0])],more:[...e.more,new R([this,"materialParams"],"materialParams",St.defaults.materialParams),new L("高亮要素",this.highlightFeature.bind(this),["id_value","rgba(255,0,0,1)"],"highlightFeature"),new L("高亮并且定位到要素",this.highlightFeatureAndFlyTo.bind(this),["id_value",[1116.39,39.9,100,1e3],"rgba(255,0,0,1)",1],"highlightFeatureAndFlyTo"),new L("要素着色控制",this.setFeatureColor.bind(this),["height",[{minValue:1e5,color:[1,0,0,1]},{maxValue:5e5,color:[1,1,0,1]}]],"setFeatureColor"),new L("要素可见性控制",this.setFeatureVisable.bind(this),["height",[{minValue:1e5,visable:!0},{maxValue:5e5,visable:!1}]],"setFeatureVisable"),new L("重置样式",()=>this.resetFeatureStyle(),[],"resetFeatureStyle"),new k("ue"),new L("刷新 tileset",()=>this.refreshTileset(),[],"refreshTileset"),new N([this,"actorTag"]),new E([this,"highlight"],"是否高亮"),new G([this,"highlightColor"]),new f([this,"highlightID"]),new k("czm"),new ne([this,"czmImageBasedLightingFactor"],"反射强度"),new f([this,"czmAtmosphereScatteringIntensity"],"大气散射强度"),new R([this,"czmEnvironmentMapManager"],"动态环境贴图管理器"),new f([this,"czmMaximumMemoryUsage"],"最大内存"),new k("常用"),new A([this,"czmClassificationType"],[["NONE","NONE"],["TERRAIN","TERRAIN"],["CESIUM_3D_TILE","CESIUM_3D_TILE"],["BOTH","BOTH"]],"czmClassificationType","NONE",!0),new R([this,"czmStyleJson"],"czmStyle"),new E([this,"czmBackFaceCulling"]),new E([this,"czmSkipLevelOfDetail"]),new E([this,"czmDebugWireframe"]),new f([this,"cacheBytes"],"最大缓存",512*1024*1024),new k("调试信息"),new E([this,"czmDebugShowBoundingVolume"]),new E([this,"czmDebugShowContentBoundingVolume"]),new k("裁剪"),new E([this,"clippingPlaneEnabled"]),new E([this,"unionClippingRegions"]),new G([this,"clippingPlaneEdgeColor"]),new f([this,"clippingPlaneEdgeWidth"])]}}};a(St,"createDefaultProps",()=>({...X.createDefaultProps(),url:"",actorTag:"",materialMode:"normal",highlight:!1,maximumScreenSpaceError:16,highlightID:0,highlightColor:F([1,0,0,1]),offset:q([0,0,0]),rotation:F([0,0,0]),czmImageBasedLightingFactor:F([1,1]),czmEnvironmentMapManager:te(void 0),czmLuminanceAtZenith:2,czmAtmosphereScatteringIntensity:2,czmMaximumMemoryUsage:512,czmClassificationType:"NONE",czmStyleJson:B({}),czmBackFaceCulling:!0,czmDebugShowBoundingVolume:!1,czmDebugShowContentBoundingVolume:!1,czmSkipLevelOfDetail:!1,cacheBytes:512*1024*1024,colorBlendMode:"HIGHLIGHT",clippingPlaneEnabled:!0,unionClippingRegions:!0,clippingPlaneEdgeColor:F([1,1,1,1]),clippingPlaneEdgeWidth:2,materialParams:{baseColor:[0,.5,1]},allowPicking:!0,materialOverrideMap:te({}),featureIdLabel:0,splitDirection:"NONE",czmDebugWireframe:!1})),a(St,"type",St.register("ES3DTileset",St,{chsName:"3DTileset",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:`ES3DTileset 是 EarthSDK3 中用于管理和加载 3D Tiles 数据的核心可视化对象。
|
|
41
|
+
`,_e=class _e extends b{constructor(){super();a(this,"_ratio",this.dv(w(0)));a(this,"_subPlayers",this.dv(new hn));const e=this.dv(new Jn);{const o=()=>{e.loop=this.loop??_e.defaults.loop};o(),this.d(this.loopChanged.don(o))}{const o=()=>{(this.loop??_e.defaults.loop)!==e.loop&&(this.loop=e.loop)};o(),this.d(e.loopChangedEvent.don(o))}{const o=()=>{e.currentTime=this.currentTime??_e.defaults.currentTime};o(),this.d(this.currentTimeChanged.don(o))}{const o=()=>{(this.currentTime??_e.defaults.currentTime)!==e.currentTime&&(this.currentTime=e.currentTime)};o(),this.d(e.currentTimeChangedEvent.don(o))}{const o=()=>{e.duration=this.duration??_e.defaults.duration};o(),this.d(this.durationChanged.don(o))}{const o=()=>{(this.duration??_e.defaults.duration)!==e.duration&&(this.duration=e.duration)};o(),this.d(e.durationChangedEvent.don(o))}{const o=()=>{e.speed=this.speed??_e.defaults.speed};o(),this.d(this.speedChanged.don(o))}{const o=()=>{(this.speed??_e.defaults.speed)!==e.speed&&(this.speed=e.speed)};o(),this.d(e.speedChangedEvent.don(o))}{const o=()=>{e.playing=this.playing??_e.defaults.playing};o(),this.d(this.playingChanged.don(o))}{const o=()=>{(this.playing??_e.defaults.playing)!==e.playing&&(this.playing=e.playing)};o(),this.d(e.playingChangedEvent.don(o))}const t=()=>{const o=this.duration??_e.defaults.duration;o>0&&(this._ratio.value=(this.currentTime??_e.defaults.currentTime)/o)};t();const i=this.dv(oe(this.currentTimeChanged,this.durationChanged));this.d(i.don(t)),this.d(()=>{const{length:o}=this._subPlayers;for(let l=0;l<o;++l)this._subPlayers.get(l).destroy();this._subPlayers.length=0});const r=()=>{for(let l of this._subPlayers)l.destroy();if(this._subPlayers.length=0,!this.channels)return;const o=this.channels.map(l=>{const[h,c,u]=l;return new Op(h,c,u,this)});this._subPlayers.splice(0,0,...o)};r(),this.d(this.channelsChanged.don(r))}get ratio(){return this._ratio.value}set ratio(e){Math.abs(this._ratio.value-e)<.001||(this.currentTime=(this.duration??_e.defaults.duration)*e)}get ratioChanged(){return this._ratio.changed}};a(_e,"defaults",{loop:!1,currentTime:0,duration:3e3,speed:1,playing:!1,channels:!0,ratio:0}),a(_e,"channelsReadMe",Dp);let Ye=_e;(n=>{n.createDefaultProps=()=>({loop:!1,currentTime:0,duration:3e3,speed:1,playing:!1,channels:Yt(void 0,(s,e)=>s==null?void 0:s.every((t,i)=>t===e[i]),s=>[...s])})})(Ye||(Ye={})),Kt(Ye.prototype,Ye.createDefaultProps);class Fp extends b{constructor(s,e,t,i){super(),this.disposeVar(new le(s.sceneObjectChanged,()=>{let r;i.debug&&console.log("正在获取Event事件...");const o=s.sceneObject;if(o&&e){const l=e.split(".");if(l.length===0)i.debug&&console.warn("propNames.length === 0");else{let h=$r(o,!1,...l);(!h||!(h instanceof v))&&(l[l.length-1]=l[l.length-1]+"Changed",i.debug&&console.warn(`event未能获取,那么将属性名的最后一项加上Changed(${l[l.length-1]})再试试!`),h=$r(o,!1,...l),i.debug&&h&&console.warn("event仍然获取不到!")),h?h instanceof v?(r=h,i.debug&&console.log(`Event获取成功 propChangedName: ${e}`,r)):i.debug&&console.warn(`the prop is not event from ${o.id}-${o.name}-${o.ref}-${e}`):i.debug&&console.warn(`cannot get changed from ${o.id}-${o.name}-${o.ref}-${e}`)}}if(r){const l=new b;return l.d(r.dwon(()=>t.emit())),l}else{i.debug&&console.log(`未获取到Event!propChangedName: ${e}`);return}}))}}const Gh=Object.freeze(Object.defineProperty({__proto__:null,WatcherObjects:class extends b{constructor(e,t,i){super();a(this,"_doEvalEvent",this.dv(new v));const r=this._doEvalEvent,o=this.disposeVar(oe(r)),l=e.map(([h,c])=>{const u=new So(h),p=c&&new Fp(u,c,r,t)||void 0;return[u,p]});this.d(()=>{l.forEach(([h,c])=>{c==null||c.destroy(),h.destroy()}),l.length=0}),this.d(r.don(()=>{const{evalMode:h="NextAnimateFrame",evalOnlyWhenObjsAllExist:c=!0}=t;if(h==="Immediate"){const u=l.map(([p])=>p.sceneObject);(!c||u.every(p=>p!==void 0))&&i(u)}})),this.d(o.don(()=>{const{evalMode:h="NextAnimateFrame",evalOnlyWhenObjsAllExist:c=!0}=t;if(h==="NextAnimateFrame"){const u=l.map(([p])=>p.sceneObject);(!c||u.every(p=>p!==void 0))&&i(u)}}))}forceExecute(){this._doEvalEvent.emit()}}},Symbol.toStringTag,{value:"Module"})),{WatcherObjects:kp}=Gh;class wn extends b{constructor(){super();a(this,"_evalFunc");a(this,"_forceExecute",new v);const e=this.dv(w(void 0)),t=()=>{try{e.value=this.evalFuncStr&&Function('"use strict";return ('+this.evalFuncStr+")")(),this.debug&&console.log("evalFunc成功构建",e.value)}catch(o){console.error(`evalFunc get error! ${o}`),e.value=void 0}};t(),this.dispose(this.evalFuncStrChanged.disposableOn(t));const i=o=>{this.enabled&&(this.debug&&console.log("执行evalFunc..."),this._evalFunc&&this._evalFunc(o),e.value&&e.value(o))},r=this.disposeVar(new le(this.objIdAndPropChangedNamesChanged,()=>{if(this.objIdAndPropChangedNames.length>0)return this.debug&&console.log("监视对象发生变化,重新创建WatcherObjects"),new kp(this.objIdAndPropChangedNames,this,i)}));this.dispose(this._forceExecute.disposableOn(()=>{var o;(o=r.obj)==null||o.forceExecute()}))}get evalFunc(){return this._evalFunc}set evalFunc(e){this._evalFunc=e}forceExecute(){this._forceExecute.emit()}}(n=>{n.createDefaultProps=()=>({enabled:!1,objIdAndPropChangedNames:jn([],(s,e)=>s[0]===e[0]&&s[1]===e[1],s=>[s[0],s[1]]),evalFuncStr:"",evalMode:"NextAnimateFrame",evalOnlyWhenObjsAllExist:!0,debug:!1,name:"未命名场景对象",ref:void 0,extras:B(void 0),devTags:q(void 0),execOnceFuncStr:void 0,updateFuncStr:void 0,toDestroyFuncStr:void 0})})(wn||(wn={})),Kt(wn.prototype,wn.createDefaultProps);const Jh=Sl("+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees","+proj=geocent +datum=WGS84");function rt(n){return Jh.forward(n)}function Co(n){return Jh.inverse(n)}const qh=Sl("+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 Mp(n){const s=qh.forward([n[0],n[1]]);return[s[0],s[1],n[2]]}function Ap(n){const s=qh.inverse([n[0],n[1]]);return[s[0],s[1],n[2]]}function jp(n,s){const e=n[0],t=n[n.length-1];(e[0]!==t[0]||e[1]!==t[1]||e[2]!==t[2])&&n.push(e);const i=K.point(s),r=K.polygon([n]);return K.booleanPointInPolygon(i,r)}function Rp(n,s){const e=W.lineString(n);return W.along(e,s,{units:"meters"}).geometry.coordinates}function Po(n){if((n[0][0]!==n[n.length-1][0]||n[0][1]!==n[n.length-1][1]||n[0][2]!==n[n.length-1][2])&&n.push(n[0]),n.length<=3)return 0;const s=W.polygon([n]);return W.area(s)}function Np(n){(n[0][0]!==n[n.length-1][0]||n[0][1]!==n[n.length-1][1]||n[0][2]!==n[n.length-1][2])&&n.push(n[0]);const s=W.polygon([n]),t=W.centerOfMass(s).geometry.coordinates;return[t[0],t[1],t[2]??n[0][2]??0]}function To(...n){let[s,e,t,i]=n;const[r,o,l]=s;if(Array.isArray(e)){const[h,c,u]=e,p=Math.sqrt(h*h+c*c);let g=0;p>0&&(g=Math.atan2(h,c)*(180/Math.PI),g<0&&(g+=360));const m=W.destination(W.point([r,o]),p,g,{units:"meters"});return!m||!m.geometry||!m.geometry.coordinates?void 0:(t=t||[0,0,0],t[0]=m.geometry.coordinates[0],t[1]=m.geometry.coordinates[1],t[2]=l+(u||0),t)}else{const h=W.destination(W.point([r,o]),e,t,{units:"meters"});return!h||!h.geometry||!h.geometry.coordinates?void 0:(i=i||[0,0,0],i[0]=h.geometry.coordinates[0],i[1]=h.geometry.coordinates[1],i[2]=l,i)}}function er(n,s){return W.distance(W.point(n),W.point(s),{units:"meters"})}function En(n,s){return W.bearing(W.point(n),W.point(s))}function Lp(n,s){return W.lineIntersect(W.lineString(n),W.lineString(s))}function Vp(n,s){const e=W.point(n),t=W.point(s),i=W.midpoint(e,t),r=(n[2]+s[2])/2;return[...i.geometry.coordinates,r]}function zp(n,s){const e=W.point(s),t=W.lineString(n);return W.nearestPointOnLine(t,e,{units:"meters"})}function Up(n,s){const e=W.point(n),t=W.lineString(s);return W.pointToLineDistance(e,t,{units:"meters"})}function Bp(n,s,e,t){const[i,r,o]=n,l=W.rhumbDestination(W.point([i,r]),s,e,{units:"meters"});if(!(!l||!l.geometry||!l.geometry.coordinates))return t=t||[0,0,0],t[0]=l.geometry.coordinates[0],t[1]=l.geometry.coordinates[1],t[2]=o,t}function Xh(n,s){return W.rhumbDistance(W.point(n),W.point(s),{units:"meters"})}function Wp(n,s){return W.rhumbBearing(W.point(n),W.point(s))}function Yh(n,s){(n[0][0]!==n[n.length-1][0]||n[0][1]!==n[n.length-1][1]||n[0][2]!==n[n.length-1][2])&&n.push(n[0]),(s[0][0]!==s[s.length-1][0]||s[0][1]!==s[s.length-1][1]||s[0][2]!==s[s.length-1][2])&&s.push(s[0]);const e=W.intersect(W.polygons([[n],[s]]));if(e)return e.geometry.coordinates}function Kh(n,s){(n[0][0]!==n[n.length-1][0]||n[0][1]!==n[n.length-1][1]||n[0][2]!==n[n.length-1][2])&&n.push(n[0]),(s[0][0]!==s[s.length-1][0]||s[0][1]!==s[s.length-1][1]||s[0][2]!==s[s.length-1][2])&&s.push(s[0]);const e=W.union(W.polygons([[n],[s]]));if(e)return e.geometry.coordinates}function Zh(n,s=500,e="meters"){const t=W.buffer(W.lineString(n),s,{units:e});if(t)return t.geometry.coordinates}function Qh(n,s){(n[0][0]!==n[n.length-1][0]||n[0][1]!==n[n.length-1][1]||n[0][2]!==n[n.length-1][2])&&n.push(n[0]),(s[0][0]!==s[s.length-1][0]||s[0][1]!==s[s.length-1][1]||s[0][2]!==s[s.length-1][2])&&s.push(s[0]);const e=W.difference(W.polygons([[n],[s]]));if(e)return e.geometry.coordinates}function ec(n,s,e=10,t="meters"){const i={steps:e,units:t};return W.circle(n,s,i).geometry.coordinates}function Io(n,s){(n[0][0]!==n[n.length-1][0]||n[0][1]!==n[n.length-1][1]||n[0][2]!==n[n.length-1][2])&&n.push(n[0]),(s[0][0]!==s[s.length-1][0]||s[0][1]!==s[s.length-1][1]||s[0][2]!==s[s.length-1][2])&&s.push(s[0]);const e=W.polygon([n]),t=W.polygon([s]);return W.booleanContains(e,t)?"oneBig":W.booleanWithin(e,t)?"twoBig":!1}function tr(n){const s=Zt(_i(n,["0"])),e=Zt(_i(n,["1"])),t=Zt(_i(n,["2"])),i=Lt(_i(n,["0"])),r=Lt(_i(n,["1"])),o=Lt(_i(n,["2"]));return{minPos:[s,e,t],maxPos:[i,r,o],center:[(s+i)*.5,(e+r)*.5,(t+o)*.5]}}function tc(n){const{minPos:s,maxPos:e,center:t}=tr(n);if(s.some(l=>!Number.isFinite(l)||e.some(h=>!Number.isFinite(h))||t.some(h=>!Number.isFinite(h)))){console.warn("geoCenterAndRadiusFromPositions error: minPos.some(e => !Number.isFinite(e) || maxPos.some(e => !Number.isFinite(e)) || center.some(e => !Number.isFinite(e))");return}const i=er(s,e);let r=i*.5;const o=Math.abs(s[2]-e[2]);return o!=0&&(r=Math.sqrt(i*i+o*o)*.5),{center:t,radius:r}}function ic(n,s){const e=rt(n),t=rt(s);return d.Vector.distance(e,t)}function zt(n,s){const e=[],t=n.length;let i=0;for(let r=0;r<t-1;++r){if(s===void 0||s==="GEODESIC"){const o=er(n[r],n[r+1]),l=Math.abs(n[r][2]-n[r+1][2]);if(l===0)i+=o;else{const h=Math.sqrt(o*o+l*l);i+=h}}else if(s==="RHUMB"){const o=Xh(n[r],n[r+1]),l=Math.abs(n[r][2]-n[r+1][2]);if(l===0)i+=o;else{const h=Math.sqrt(o*o+l*l);i+=h}}else if(s==="NONE"){const o=ic(n[r],n[r+1]);i+=o}else console.warn(`未知的arcType: ${s},导致距离无法计算!`);e.push(i)}return e}function xo(n){const s="__getXyzFromPostion";let e=Ne(n,s);return(!e||!d.Vector.equals(e[0],n))&&(e=[[...n],rt(n)],vt(n,s,e)),e[1]}class Hp{constructor(s={}){a(this,"points");a(this,"duration");a(this,"sharpness");a(this,"centers");a(this,"controls");a(this,"stepLength");a(this,"length");a(this,"delay");a(this,"steps");this.points=s.points||[],this.duration=s.duration||1e4,this.sharpness=s.sharpness||.85,this.centers=[],this.controls=[],this.stepLength=s.stepLength||60,this.length=this.points.length,this.delay=0;for(let e=0;e<this.length;e++)this.points[e].z=this.points[e].z||0;for(let e=0;e<this.length-1;e++){const t=this.points[e],i=this.points[e+1];this.centers.push({x:(t.x+i.x)/2,y:(t.y+i.y)/2,z:(t.z+i.z)/2})}this.controls.push([this.points[0],this.points[0]]);for(let e=0;e<this.centers.length-1;e++){const t=this.points[e+1].x-(this.centers[e].x+this.centers[e+1].x)/2,i=this.points[e+1].y-(this.centers[e].y+this.centers[e+1].y)/2,r=this.points[e+1].z-(this.centers[e].z+this.centers[e+1].z)/2;this.controls.push([{x:(1-this.sharpness)*this.points[e+1].x+this.sharpness*(this.centers[e].x+t),y:(1-this.sharpness)*this.points[e+1].y+this.sharpness*(this.centers[e].y+i),z:(1-this.sharpness)*this.points[e+1].z+this.sharpness*(this.centers[e].z+r)},{x:(1-this.sharpness)*this.points[e+1].x+this.sharpness*(this.centers[e+1].x+t),y:(1-this.sharpness)*this.points[e+1].y+this.sharpness*(this.centers[e+1].y+i),z:(1-this.sharpness)*this.points[e+1].z+this.sharpness*(this.centers[e+1].z+r)}])}this.controls.push([this.points[this.length-1],this.points[this.length-1]]),this.steps=this.cacheSteps(this.stepLength)}cacheSteps(s){const e=[];let t=this.pos(0);e.push(0);for(let i=0;i<this.duration;i+=10){const r=this.pos(i);Math.sqrt((r.x-t.x)*(r.x-t.x)+(r.y-t.y)*(r.y-t.y)+(r.z-t.z)*(r.z-t.z))>s&&(e.push(i),t=r)}return e}vector(s){const e=this.pos(s+10),t=this.pos(s-10);return{angle:180*Math.atan2(e.y-t.y,e.x-t.x)/3.14,speed:Math.sqrt((t.x-e.x)*(t.x-e.x)+(t.y-e.y)*(t.y-e.y)+(t.z-e.z)*(t.z-e.z))}}pos(s){let e=s-this.delay;e<0&&(e=0),e>this.duration&&(e=this.duration-1);const t=e/this.duration;if(t>=1)return this.points[this.length-1];const i=Math.floor((this.points.length-1)*t),r=(this.length-1)*t-i;return $p(r,this.points[i],this.controls[i][1],this.controls[i+1][0],this.points[i+1])}}function $p(n,s,e,t,i){const r=Gp(n);return{x:i.x*r[0]+t.x*r[1]+e.x*r[2]+s.x*r[3],y:i.y*r[0]+t.y*r[1]+e.y*r[2]+s.y*r[3],z:i.z*r[0]+t.z*r[1]+e.z*r[2]+s.z*r[3]}}function Gp(n){const s=n*n;return[s*n,3*s*(1-n),3*n*(1-n)*(1-n),(1-n)*(1-n)*(1-n)]}function Jp(n,s){s===void 0&&(s={});var e=s.resolution||1e3,t=s.sharpness||.85;const i=[],r=n.map(c=>{const[u,p,g]=rt(c);return{x:u,y:p,z:g}});for(var o=new Hp({duration:e,points:r,sharpness:t}),l=function(c){var u=o.pos(c);const p=Co([u.x,u.y,u.z]);i.push(p)},h=0;h<o.duration;h+=10)l(h);return l(o.duration),i}function gs(n,s,e){return Jp(n,{resolution:s,sharpness:e})}function ir(n){return Yt(n,(s,e)=>s[0]===e[0]&&s[1]===e[1],s=>[...s])}function sc(n,s){const e=new Array;for(let t of n)e.push(s(t));return e}function sr(n,s){return n===void 0&&s===void 0?!0:!n||!s?!1:n[0]===s[0]&&n[1]===s[1]&&n[2]===s[2]}function nc(n,s,e){var i;((i=s.attachedViewers.values().toArray()[0])==null?void 0:i.getEngineObject(s))?e.call(n):requestAnimationFrame(()=>nc(n,s,e))}function qp(n,s,e,t=!0){t&&e(),n.dispose(s.disposableOn(e))}function Xp(n,s){const{type:e,id:t}=n;if(e){const i=M.create(e,t);if(i)return i.json=n,i;console.warn(`cannot create sceneObject from type(${e})`)}else console.warn(`cannot create sceneObject from type(${e})`)}function rc(n){const s=n.children&&Wr(n.children,t=>{if(!(t instanceof Ie))throw new Error("!(treeItem instanceof SceneTreeItem)");return!t.show})||!1,e=n.sceneTree.getSceneObjectShowFunc(n.sceneObject);return!s||e}class Ie extends vn{constructor(e,t=!1,i,r,o=!0){super(e,t,i);a(this,"_dragDrop");a(this,"_showChangedNotAffectChildren",!1);a(this,"_showChangedNotAffectParent",!1);a(this,"_type",this.dv(w("Unknown")));a(this,"_isExport",this.dv(w(!0)));const l=()=>this.tree&&this.tree.itemsChanged.emit([this]);this.dispose(this.nameChanged.disposableOn(l)),this.name=`未命名条目(${this.id})`,this.extras=r,this._isExport.value=o;let h;const c=()=>{h&&(h(),h=void 0)};this.dispose(c),this.dispose(this.sceneObjectChanged.disposableOn(u=>{c(),u&&(h=D([this,"name"],[u,"name"]))})),this.dispose(this.showChanged.disposableOn(u=>{if(e.setSceneObjectShowFunc(this.sceneObject,u),this.tree&&this.tree.forceRedraw(),this.children&&!this._showChangedNotAffectChildren)for(let p of this.children)p instanceof Ie&&(p._showChangedNotAffectParent=!0,p.show=u,p._showChangedNotAffectParent=!1);this.parent&&this.parent instanceof Ie&&!this._showChangedNotAffectParent&&(this.parent._showChangedNotAffectChildren=!0,this.parent.show=rc(this.parent),this.parent._showChangedNotAffectChildren=!1)})),this.dv(new le(this.sceneObjectChanged,()=>{if(!this.sceneObject)return;const u=new b;if("show"in this.sceneObject&&"showChanged"in this.sceneObject&&this.sceneObject.showChanged instanceof v){const p=()=>{this.show=e.getSceneObjectShowFunc(this.sceneObject)};p(),u.dispose(this.sceneObject.showChanged.disposableOn(p))}else if("enabled"in this.sceneObject&&"enabledChanged"in this.sceneObject&&this.sceneObject.enabledChanged instanceof v){const p=()=>{this.show=e.getSceneObjectShowFunc(this.sceneObject)};p(),u.dispose(this.sceneObject.enabledChanged.disposableOn(p))}return u})),this.childrenChangedEvent.disposableOn(()=>{const u=rc(this);this._showChangedNotAffectChildren=!0,this.show=u,this._showChangedNotAffectChildren=!1});{const u=()=>{let p="Unknown";this.sceneObject?p=this.sceneObject.typeName:this.children&&(p="Folder"),this._type.value=p};this.dispose(this.sceneObjectChanged.disposableOn(u)),this.dispose(this.childrenResetedEvent.disposableOn(u)),u()}}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(e){this._isExport.value=e}get sceneTree(){return this.tree}get jsonStr(){return JSON.stringify(this.json,void 0," ")}set jsonStr(e){try{this.json=JSON.parse(e)}catch(t){console.error(`sceneTreeItem.jsonStr error ${t}`,t)}}get completeJson(){const e=this.children&&[...this.children].filter(t=>t.isExport).map(t=>t.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:e,extras:this.extras}}get json(){const e=this.children&&[...this.children].filter(t=>t.isExport).map(t=>t.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:e,extras:this.extras}}set json(e){if(e.name!==void 0&&(this.name=e.name),this.extras=e.extras,this._showChangedNotAffectChildren=!0,this._showChangedNotAffectParent=!0,this.show=e.show??!0,this._showChangedNotAffectChildren=!1,this._showChangedNotAffectParent=!1,this.uiTreeObject.collapsed=e.collapsed??!1,this.sceneObject=void 0,e.sceneObj&&(this.sceneObject=this.sceneTree.createSceneObjectFunc(e.sceneObj,this)),!!e.children){if(this.resetChildren(!0),!this.children)throw new Error("resetChildren(true) cannot get children!");for(let t of e.children){const i=new Ie(this.tree,!0);i.json=t,this.children.push(i)}}}clone(){try{const e=new Ie(this.sceneTree,!!this.children,void 0,this.extras,this.isExport);return e.json=this.json,e.name=this.sceneTree.getSceneTreeItemCloneNameFunc(this),e}catch(e){console.error(`SceneTreeItem.clone error: ${e}`,e)}}insertNewTreeItem(e,t){if(e==="FolderInnerOrAfter"||e==="FolderInnerOrBefore"||e==="FolderInner"){if(t&&t.tree!==this.tree)return console.warn("newTreeItem.tree !== this.tree"),!1;if(this.children&&!(e.includes("Or")&&this.sceneObject))return t&&this.children.push(t),!0;if(e==="FolderInner")return!1;if(e==="FolderInnerOrAfter")return super.insertNewTreeItem("After",t);if(e==="FolderInnerOrBefore")return super.insertNewTreeItem("Before",t);throw new Error("should not be here!")}else return super.insertNewTreeItem(e,t)}}(n=>{n.createDefaultProps=()=>({name:"未命名条目",nameEditing:!1,sceneObject:void 0,show:!0,extras:te(void 0)})})(Ie||(Ie={})),Kt(Ie.prototype,Ie.createDefaultProps);function oc(n,s,e){let{offsetY:t}=s;if(!s.target||!("clientTop"in s.target))return"none";t+=2,t+=s.target.clientTop;let i="none";return n.children?t<=e*.3?i="before":t>=e*.7?!n.uiTreeObject.collapsed&&n.children.length>0?i="inner":i="after":i="inner":t<=e*.5?i="before":i="after",i}class ac extends Lh{constructor(s){super(),this._treeItem=s;const{dragStartDataManager:e}=this._treeItem.sceneTree;let t="none";const i=this.disposeVar(Gl(()=>{this._treeItem.uiTreeObject.moveToPositionMode=t,console.log(`uiTreeObject.moveToPositionMode = lastDragMode(${t});`)},200));function r(o){t!==o&&(t=o,i.restart())}this.dispose(this._dragStartEvent.disposableOn(o=>{e.data={type:"UITreeA",value:this._treeItem}})),this.dispose(this._dragOverEvent.disposableOn(o=>{if(!o.dataTransfer)return;o.preventDefault();const l=e;if(l.data&&l.data.type==="UITreeA"&&l.data.value!==void 0){const h=l.data.value,c=this._treeItem,{tree:u}=c;if(u){const p=[...u.selectedItems];~p.indexOf(h)||p.push(h);const g=oc(c,o,u.itemDivHeight);if(g!=="none"&&Si.canMoveToTreeItems(p,c,g)){o.dataTransfer.dropEffect="move",r(g);return}}}o.dataTransfer.dropEffect="none",r("none")})),this.dispose(this._dropEvent.disposableOn(o=>{const l=e;if(!(l.data&&l.data.type==="UITreeA"&&l.data.value!==void 0))return;const h=l.data.value,c=this._treeItem,{tree:u}=c;if(!u)return;const p=[...u.selectedItems];~p.indexOf(h)||p.push(h);const g=oc(c,o,u.itemDivHeight);g!=="none"&&Si.canMoveToTreeItems(p,c,g)&&(Si.moveToTreeItems(p,c,g),l.data=void 0,r("none"))})),this.dispose(this._dragLeaveEvent.disposableOn(()=>{t="none",i.restart()}))}}function Yp(n){if(!(n instanceof Ie))throw new Error("defaultCreateTreeItemDragDrop !(treeItem instanceof SceneTreeItem)");return new ac(n)}function Kp(n){let s=!1;return n&&("show"in n?s=n.show??!0:"enabled"in n&&(s=n.enabled??!0)),s}function Zp(n,s){n&&("show"in n?n.show=s:"enabled"in n&&(n.enabled=s))}const Qp=["EnvironmentVariables","ScriptsLoader","SceneScript","ScriptLoader"];function eg(n){const s=[],{root:e={}}=n,t=[e];for(;t.length>0;){const i=t.pop();if(!i)throw new Error("!todo");if(i.children){for(let r of i.children)if(r.children&&t.unshift(r),r.sceneObj){const{type:o=void 0}=r.sceneObj;o||(console.warn("sceneObjJson has no type! treeItem.sceneObj: "),console.warn(r.sceneObj)),o&&Qp.includes(o)&&s.push(r.sceneObj)}}}return s}async function tg(n,s){const e=eg(n);let t=0;const i=e.length;for(let r of e)if(++t,s){const o=t/i;s(o,t,i)}}class lc extends b{constructor(e,t){super();a(this,"treeItemContexMenuCallback");this._sceneTree=e,this._projectManager=t}get sceneTree(){return this._sceneTree}}class ig extends b{constructor(e){super();a(this,"_jsonLoadingEvent",this.disposeVar(new v));a(this,"_setJsonProcessing",this.disposeVar(Le(async(e,t)=>{this._jsonLoadingEvent.emit({type:"init"}),this._jsonLoadingEvent.emit({type:"loading"}),t&&await e.promise(this._sceneTree.preloadFunc(t)),this._setJson(t),this._jsonLoadingEvent.emit({type:"loaded"})})));this._sceneTree=e,this._setJsonProcessing.errorFunc=t=>{this._jsonLoadingEvent.emit({type:"error",error:t})}}get jsonLoadingEvent(){return this._jsonLoadingEvent}_setJson(e){try{this._sceneTree.setJson(e||{})}catch(t){console.error(`json数据装配时发生错误!error: ${t}`)}}get json(){return this._sceneTree.getJson()}set json(e){this._setJsonProcessing.restart(new st("JSON重新赋值!"),e)}get jsonStr(){return JSON.stringify(this.json,void 0," ")}set jsonStr(e){this.json=JSON.parse(e)}}function sg(n){return n.name+"_clone"}function Oo(n,s,e){if(n instanceof Ie)return n.insertNewTreeItem(s,e);{const t={FolderInnerOrAfter:"InnerOrAfter",FolderInnerOrBefore:"InnerOrBefore",FolderInner:"Inner",InnerOrAfter:"InnerOrAfter",InnerOrBefore:"InnerOrBefore",Inner:"Inner",After:"After",Before:"Before"};return n.insertNewTreeItem(t[s],e)}}function ng(n){[n,...n.getDescendants()].forEach(s=>s.destroy())}const ke=class ke extends Si{constructor(e,t,i,r){super(i);a(this,"_jsonLoading",this.disposeVar(new ig(this)));a(this,"createSceneObjectFunc",ke.defaultCreateSceneObjectFunc);a(this,"createTreeItemDragDropFunc",ke.defaultCreateTreeItemDragDropFunc);a(this,"preloadFunc",ke.defaultPreload);a(this,"getSceneObjectShowFunc",ke.defaultGetSceneObjectShow);a(this,"setSceneObjectShowFunc",ke.defaultSetSceneObjectShow);a(this,"getSceneTreeItemCloneNameFunc",ke.defaultGetSceneTreeItemCloneNameFunc);a(this,"debug",!1);a(this,"_contextMenu",this.disposeVar(new lc(this,this.projectManager)));a(this,"_showPropUiOnSelecting",this.disposeVar(w(!0)));this._name=e,this._dragStartDataManager=t,this._projectManager=r,this.dispose(this.selectedItems.changedEvent.disposableOn(()=>{var l,h;globalThis.lssn=this.lastSelectedItem,globalThis.lsso=(l=this.lastSelectedItem)==null?void 0:l.sceneObject,this.debug&&console.log(((h=this.lastSelectedItem)==null?void 0:h.sceneObject)??"select null")}));const{sceneObjectsManager:o}=this._projectManager;this.dispose(this.itemsDeleted.disposableOn(l=>{for(let h of l){const c=h,{sceneObject:u}=c;u&&o.deleteSceneObject(u)&&u.destroy()&&Kn(u,void 0);for(let p of c.getDescendants()){const{sceneObject:g}=p;g&&o.deleteSceneObject(g)&&g.destroy()&&Kn(g,void 0)}ng(h)}})),this.dispose(this.itemsAdded.disposableOn(l=>{for(let h of l){const c=h;c.sceneObject&&o.addSceneObject(c.sceneObject)&&Kn(c.sceneObject,c)}}))}get json(){return this._jsonLoading.json}set json(e){this._jsonLoading.json=e}get jsonStr(){return this._jsonLoading.jsonStr}set jsonStr(e){this._jsonLoading.jsonStr=e}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(e){this._showPropUiOnSelecting.value=e}get showPropUiOnSelectingChanged(){return this._showPropUiOnSelecting.changed}get sceneUiTree(){return this.uiTree}getTreeItemFromSceneObjId(e){const t=this.getDescendants();let i;for(let r of t)if(r.sceneObject&&r.sceneObject.id===e){i=r;break}return i}getTreeItemsFromSceneObjType(e){const t=this.getDescendants(),i=[],r=Array.isArray(e)?e:[e];for(let o of t)o.sceneObject&&r.includes(o.sceneObject.typeName)&&i.push(o);return i}getTreeItemsFromSceneObjName(e){var r;const t=this.getDescendants(),i=[];for(let o of t)(r=o.sceneObject)!=null&&r.name.includes(e)&&i.push(o);return i}get dragStartDataManager(){return this._dragStartDataManager}get completeJson(){return{root:{children:[...this.children].filter(e=>e.isExport).map(e=>e.completeJson)}}}getJson(){return{root:{children:[...this.children].filter(e=>e.isExport).map(e=>e.json)}}}setJson(e){var i;e.root=e.root||{};const t=e.root.children??[];this.root.resetChildren(!0);for(let r of t){const o=new Ie(this,!0);o.json=r,(i=this.root.children)==null||i.push(o)}}testAddNewTreeItem(e,t){const i=e||this.lastSelectedItem||this.root;return i?Oo(i,t):!1}addNewTreeItem(e,t,i,r){const o=e||this.lastSelectedItem||this.root;if(o&&Oo(o,t)){const l=new Ie(this,i);if(l.sceneObject=r,!Oo(o,t,l))throw new Error("currentTreeItem.insertNewTreeItem return false!");return l}}createSceneObjectTreeItem(e,t,i,r){const o=r??"FolderInnerOrAfter";if(!this.testAddNewTreeItem(i,o)){console.warn(`cannot addNewTreeItem! currentTreeItem(${i?i.id:"root"})`);return}const l=M.create(e,t);return l?this.addNewTreeItem(i,r??"FolderInnerOrAfter",!0,l):void 0}createGroupTreeItem(e,t,i,r){const o=r??"FolderInnerOrAfter";if(!this.testAddNewTreeItem(i,o)){console.warn(`cannot addNewTreeItem! currentTreeItem(${i?i.id:"root"})`);return}const l=this.addNewTreeItem(i,r??"FolderInnerOrAfter",!0);if(!l){console.warn("addNewTreeItem error!");return}return l.name=e??"未命名组节点",l}createSceneObjectTreeItemFromClass(e,t,i,r){const o=r??"FolderInnerOrAfter";if(!this.testAddNewTreeItem(i,o))return;const l=M.createFromClass(e,t);return l?this.addNewTreeItem(i,o,!0,l):void 0}createSceneObjectTreeItemFromJson(e,t,i){const r=i??"FolderInnerOrAfter";if(!this.testAddNewTreeItem(t,r))return;const o=M.createFromJson(e);return console.log(o),o?this.addNewTreeItem(t,i??"FolderInnerOrAfter",!0,o):void 0}destroySceneObjectTreeItem(e){if(e===this.root){console.warn("cannot destroy root! please use function destroyAllSceneObjectTreeItems!");return}e.detachFromParent()}destroyAllSceneObjectTreeItems(){if(!this.root.children)return;const e=[...this.root.children];for(let t of e)this.destroySceneObjectTreeItem(t)}};a(ke,"defaultCreateSceneObjectFunc",Xp),a(ke,"defaultCreateTreeItemDragDropFunc",Yp),a(ke,"defaultPreload",tg),a(ke,"defaultGetSceneObjectShow",Kp),a(ke,"defaultSetSceneObjectShow",Zp),a(ke,"defaultGetSceneTreeItemCloneNameFunc",sg);let bn=ke;const Do={saturation:.35,brightness:1.4,gamma:.8,atmosphereScatteringIntensity:5,groundColor:[0,.09411764705882353,.3137254901960784,1]};class rg extends b{constructor(e){super();a(this,"_currentPosition",this.disposeVar(q(void 0)));a(this,"_currentRotation",this.disposeVar(q(void 0)));a(this,"_currentHeading",this.disposeVar(w(void 0)));a(this,"_isRotating",this.disposeVar(w(!1)));a(this,"_isGround",this.disposeVar(w(!1)));a(this,"_startPosition",[0,0,0]);a(this,"_startRotation",[0,0,0]);a(this,"_processing",this.disposeVar(Le(async(e,t,i,r)=>{const{currentPosition:o,currentRotation:l}=this;if(!o||r<=0||!l){this._currentPosition.value=t,this._currentRotation.value=i;return}const h=this._startPosition;h.splice(0,3,...o);const c=this._startRotation;c.splice(0,3,...l);let u=Date.now();const p=En(h,t);this._currentHeading.value=p;const m=er(h,t)/r,y=[i[0]-c[0],i[1]-c[1],i[2]-c[2]],S=t[2]-h[2];await e.promise(new Promise(C=>{e.disposer.dispose(Ln(async()=>{let T=Date.now()-u;T=T<0?0:T,T=T>r?r:T;const V=T*m,z=To(h,V,p);if(this.isGround&&z){const x=await this._esviewer.getTerrainHeight([z[0],z[1]]);this._currentPosition.value=[z[0],z[1],x??0]}else z&&(z[2]+=S*(T/r)),this._currentPosition.value=z;if(this.isRotating){const[x,$,Y]=y,Q=T/r;this._currentRotation.value=[c[0]+x*Q,c[1]+$*Q,c[2]+Y*Q]}T===r&&(this._currentPosition.value=t,this.isRotating&&(this._currentRotation.value=i),this.isRotating=!1,this.isGround=!1,C())}))}))})));this._esviewer=e}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(e){this._isRotating.value=e}get isRotatingChanged(){return this._isRotating.changed}get isGround(){return this._isGround.value}set isGround(e){this._isGround.value=e}get isGroundChanged(){return this._isGround.changed}get processing(){return this._processing}restart(e,t,i){this._processing.restart(void 0,e,t,i)}cancel(){this._processing.cancel()}}const og=.06,hc=1.5,cc=2,dc=70,uc=60;function Ci(n){return K.point(n)}function wt(n,s,e){const t=Ci(n),i=K.destination(t,e,s,{units:"meters"}),[r,o]=K.getCoords(i);return[r,o,n[2]]}function nr(n,s){return K.bearing(Ci(n),Ci(s))}function rr(n,s,e,t,i=1e3){const r=K.lineString([K.getCoords(K.destination(Ci(n),i,(s+180)%360,{units:"meters"})),n,K.getCoords(K.destination(Ci(n),i,s,{units:"meters"}))]),o=K.lineString([K.getCoords(K.destination(Ci(e),i,(t+180)%360,{units:"meters"})),e,K.getCoords(K.destination(Ci(e),i,t,{units:"meters"}))]),l=K.lineIntersect(r,o);if(l.features.length>0){const[h,c]=K.getCoords(l.features[0]);return[h,c,(n[2]+e[2])/2]}return e}function pc(n,s,e,t){const i=(e-90+360)%360,r=(e+90+360)%360;n.leftPoints.push(wt(s,i-dc,t*hc)),n.headPoints.push(wt(s,i-uc,t*cc)),n.headPoints.push(s),n.headPoints.push(wt(s,r+uc,t*cc)),n.rightPoints.push(wt(s,r+dc,t*hc))}function ag(n,s,e,t){const i=(s-90+360)%360,r=(s+90+360)%360,o=e*og*Math.min(.3,1-t);return{leftPoint:wt(n,i,o),rightPoint:wt(n,r,o),verticalLen:o}}function lg(n,s){if(!n||n.length<2)return;const e=s==="swallowTailArrow",t=n.length,i=t-1,r=Math.max(...zt(n,"NONE")),o={leftPoints:[],rightPoints:[],headPoints:[]};let l;for(let m=0;m<t;m++){const y=n[m],S=m==i?n[n.length-2]:n[m+1],C=m==i?nr(S,y):nr(y,S),{leftPoint:T,rightPoint:V,verticalLen:z}=ag(y,C,r,m/t);m===0?(o.leftPoints.push(T),o.rightPoints.push(V),e&&(o.tailPoint=wt(y,C,z))):m===i?pc(o,y,C,z):l!==void 0?(o.leftPoints.push(rr(o.leftPoints[m-1],l,T,C,r)),o.rightPoints.push(rr(o.rightPoints[m-1],l,V,C,r))):(o.leftPoints.push(T),o.rightPoints.push(V)),l=C}const h=o.leftPoints,c=o.rightPoints,u=h.length>=2?gs(h):h,p=c.length>=2?gs(c):c,g=[...u,...o.headPoints,...p.reverse()];return o.tailPoint&&g.push(o.tailPoint),g.push(o.leftPoints[0]),g}function hg(n,s,e,t){const i=K.lineString([[n[0],n[1]],[s[0],s[1]]]),r=K.lineString([[e[0],e[1]],[t[0],t[1]]]);return K.lineIntersect(i,r).features.length>0}function cg(n,s,e,t){const i=(s-90+360)%360,r=(s+90+360)%360,o=e*Math.min(.3,1-t);return{leftPoint:wt(n,i,o),rightPoint:wt(n,r,o),verticalLen:o}}function dg(n,s){if(!n||n.length<3)return;const e=s==="swallowTailArrow",t=n.length,i=t-1,r=n.slice(0,2),o=tr(r),l=zt(r,"NONE").pop()??0,h=Math.max(...zt(n,"NONE")),c={leftPoints:[],rightPoints:[],headPoints:[]};let u;for(let C=1;C<t;C++){const T=C===1?o.center:n[C],V=C===i?n[t-2]:n[C+1],z=C===i?nr(V,T):nr(T,V);let{leftPoint:x,rightPoint:$,verticalLen:Y}=cg(T,z,l,C/t);if(C===1)c.leftPoints.push(r[0]),c.rightPoints.push(r[1]),e&&(c.tailPoint=wt(T,z,l));else if(C===i)pc(c,T,z,Y);else if(u!==void 0){if(C===2&&hg(c.leftPoints[0],x,c.rightPoints[0],$)){const Ae=c.leftPoints[0];c.leftPoints[0]=c.rightPoints[0],c.rightPoints[0]=Ae}const Q=C-2;c.leftPoints.push(rr(c.leftPoints[Q],u,x,z,h)),c.rightPoints.push(rr(c.rightPoints[Q],u,$,z,h))}else c.leftPoints.push(x),c.rightPoints.push($);u=z}let p=c.leftPoints,g=c.rightPoints;const m=p.length>=2?gs(p):p,y=g.length>=2?gs(g):g,S=[...m,...c.headPoints,...y.reverse()];return c.tailPoint&&S.push(c.tailPoint),S.push(p[0]),S}function Fo(n,s,e=!1){return e?dg(n,s):lg(n,s)}function gc(n){let s=0;function e(t,i){i++,s=Math.max(i,s),t.forEach(r=>{Array.isArray(r)&&e(r,i)})}return e(n,0),s}const bt=class bt extends X{constructor(e){super(e);a(this,"editingBindMode","lineString");a(this,"_area",this.dv(w(0)));a(this,"_perimeter",this.dv(w(0)));this.d(de(this.pointsChanged,()=>{this._updateArea(),this._updatePerimeter()},{immediate:!0}))}updateEditing(){var t;const e=[];this.editingBindMode=="doublePoints"?e.push(I.DoublePoints):this.editingBindMode=="lineString"?e.push(I.LineStringAppend,I.LineStringInsert,I.Translation):this.editingBindMode=="circular"?(e.push(I.CircularAppend,I.CircularInsert,I.Translation),this.supportEditingModes().includes(I.HeightModify)&&e.push(I.HeightModify)):this.editingBindMode=="visibility"?e.push(I.VisibilityAppend,I.VisibilityModify):this.editingBindMode=="scatter"&&e.push(I.ScatterAppend,I.ScatterModify),(t=this.activeViewer)==null||t.startEditing(this,e,{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 Po([...this.points])}getDistance(){if(this.points&&this.points.length>=2){const e=zt(this.points,"GEODESIC");return e[e.length-1]}else return}getPerimeter(){if(this.points&&this.points.length>=3){const e=[...this.points,this.points[0]],t=zt(e,"GEODESIC");return t[t.length-1]}else return}getIntersect(e){if(this.points&&this.points.length>=3&&e.length>=3){const t=Yh(this.points,e);if(!t)return;const i=t[0][0][0];if(Array.isArray(i)){const r=[...t],o=[];return r.forEach(l=>{const h=l[0].map(c=>[...c,0]);o.push(h)}),o}else return[[...t][0].map(l=>[...l,0])]}else return}getUnion(e){if(this.points&&this.points.length>=3&&e.length>=3){const t=Kh(this.points,e);if(!t)return;const i=t[0][0][0];if(Array.isArray(i)){const r=[...t],o=[];return r.forEach(l=>{const h=l[0].map(c=>[...c,0]);o.push(h)}),o}else return[[...t][0].map(l=>[...l,0])]}else return}getDifference(e){if(this.points&&this.points.length>=3&&e.length>=3){let t=[...e];const i=e[0],r=e[e.length-1];i[0]===r[0]&&i[1]===r[1]&&i[2]===r[2]||t.push(i);const o=Qh([...this.points,this.points[0]],[...t]);if(!o)return{status:"undefined",positions:void 0};const l=[...o];if(gc(l)===3){const h=l.map(g=>g.map(m=>[...m,0]));if(h.length<=1)return{status:"notIncluded",positions:h};const c=h[0],u=h[1];return Io([...c],[...u])==="oneBig"?{status:"included",positions:h}:{status:"notIncluded",positions:h}}else if(gc(l)===4){const c=[...l.map(p=>p.map(g=>g.map(m=>[...m,0])))],u=[];return c.forEach(p=>{u.push(p[0])}),{status:"notIncluded",positions:u}}else return{status:"undefined",positions:void 0}}else return{status:"undefined",positions:void 0}}getBuffer(e=500,t){if(this.points&&this.points.length>=2){const i=Zh(this.points,e,t);return i?[i[0].map(r=>[...r,0])]:void 0}else return}geoPolygonOverlap(e){if(this.points&&this.points.length>=3&&e.length>=3){const t=Io(this.points,e);return t==="oneBig"?!0:t==="twoBig"?!1:void 0}else return}getESProperties(){const e={...super.getESProperties()};return{...e,defaultMenu:"style",coordinate:[...e.coordinate,new E([this,"editing"],"编辑",!1),new ie([this,"points"],"位置数组",bt.defaults.points,void 0,!0)],style:[...e.style,new k("点样式"),new E([this,"pointed"],"开启",!1),new f([this,"pointSize"],"点大小",1),new A([this,"pointSizeType"],[["screen","screen"],["world","world"]],"点类型","screen"),new G([this,"pointColor"],"点颜色",[1,1,1,1]),new G([this,"pointOutlineColor"],"轮廓颜色",bt.defaults.pointStyle.outlineColor),new f([this,"pointOutlineWidth"],"轮廓宽度",bt.defaults.pointStyle.outlineWidth),new k("线样式"),new E([this,"stroked"],"开启线样式",!0),new E([this,"strokeGround"],"贴地",!1),new f([this,"strokeWidth"],"线宽",1),new A([this,"strokeWidthType"],[["screen","screen"],["world","world"]],"线类型","screen"),new G([this,"strokeColor"],"线颜色",[1,1,1,1]),new k("面样式"),new E([this,"filled"],"开启",!1),new E([this,"fillGround"],"贴地",!1),new G([this,"fillColor"],"填充颜色",[1,1,1,1])],more:[...e.more,new k("点样式集合"),new N([this,"pointMaterial"],"点材质"),new R([this,"pointMaterialParams"],"点材质参数",{}),new k("线样式集合"),new N([this,"strokeMaterial"],"线材质"),new R([this,"strokeMaterialParams"],"线材质参数",{}),new k("面样式集合"),new N([this,"fillMaterial"],"面材质"),new R([this,"fillMaterialParams"],"面材质参数",{})]}}get pointSize(){return this.pointStyle.size}set pointSize(e){this.pointStyle={...this.pointStyle,size:e}}get pointSizeChanged(){return this.pointStyleChanged}get pointSizeType(){return this.pointStyle.sizeType}set pointSizeType(e){this.pointStyle={...this.pointStyle,sizeType:e}}get pointSizeTypeChanged(){return this.pointStyleChanged}get pointColor(){return this.pointStyle.color}set pointColor(e){this.pointStyle={...this.pointStyle,color:[...e]}}get pointColorChanged(){return this.pointStyleChanged}get pointOutlineColor(){return this.pointStyle.outlineColor}set pointOutlineColor(e){this.pointStyle={...this.pointStyle,outlineColor:[...e]}}get pointOutlineColorChanged(){return this.pointStyleChanged}get pointOutlineWidth(){return this.pointStyle.outlineWidth}set pointOutlineWidth(e){this.pointStyle={...this.pointStyle,outlineWidth:e}}get pointOutlineWidthChanged(){return this.pointStyleChanged}get pointMaterial(){return this.pointStyle.material}set pointMaterial(e){this.pointStyle={...this.pointStyle,material:e}}get pointMaterialChanged(){return this.pointStyleChanged}get pointMaterialParams(){return this.pointStyle.materialParams}set pointMaterialParams(e){this.pointStyle={...this.pointStyle,materialParams:e}}get pointMaterialParamsChanged(){return this.pointStyleChanged}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}};a(bt,"createDefaultProps",()=>({...X.createDefaultProps(),pointed:!1,pointStyle:B({size:10,sizeType:"screen",color:[1,1,1,1],material:"",materialParams:{},outlineColor:[1,0,0,1],outlineWidth:2}),stroked:!1,strokeStyle:B({width:1,widthType:"screen",color:[1,1,1,1],material:"",materialParams:{},ground:!1}),filled:!1,fillStyle:B({color:[1,1,1,1],material:"",materialParams:{},ground:!1}),points:Nt([])})),a(bt,"type",bt.register("ESGeoVector",bt,{chsName:"地理矢量",tags:["ESObjects","base"],description:"地理矢量"})),a(bt,"supportEditingModes",[...X.supportEditingModes,I.Translation]);let U=bt;const Oi=class Oi extends X{constructor(){super(...arguments);a(this,"_statusDis",this.dv(w(!0)));a(this,"_smoothMoveEvent",this.dv(new v));a(this,"_smoothMoveWithRotationEvent",this.dv(new v));a(this,"_smoothMoveOnGroundEvent",this.dv(new v));a(this,"_smoothMoveWithRotationOnGroundEvent",this.dv(new v));a(this,"_automaticLandingEvent",this.dv(new v));a(this,"_smoothMoveKeepPitchEvent",this.dv(new v));a(this,"_smoothMoveRelativelyEvent",this.dv(new v));a(this,"_smoothMoveRelativelyWithRotationEvent",this.dv(new v));a(this,"useCalcFlyToParamInESObjectWithLocation",!0)}updateEditing(){var t;const e=[];this.editingBindMode=="singlePoint"?(e.push(I.SinglePoint),["ESLocationMeasurement"].includes(this.typeName)||e.push(I.Rotation),["ESClippingPlane","ESLocationMeasurement","ESLocalRectangle","ESBoxClipping"].includes(this.typeName)||e.push(I.Scale)):this.editingBindMode=="doublePoints"&&e.push(I.DoublePoints),(t=this.activeViewer)==null||t.startEditing(this,e,{callSource:"inner"})}get statusDis(){return this._statusDis.value}get statusDisChanged(){return this._statusDis.changed}get smoothMoveEvent(){return this._smoothMoveEvent}smoothMove(e,t){this._smoothMoveEvent.emit(e,t)}get smoothMoveWithRotationEvent(){return this._smoothMoveWithRotationEvent}smoothMoveWithRotation(e,t,i){this._smoothMoveWithRotationEvent.emit(e,t,i)}get smoothMoveOnGroundEvent(){return this._smoothMoveOnGroundEvent}smoothMoveOnGround(e,t,i,r){this._smoothMoveOnGroundEvent.emit(e,t,i,r)}get smoothMoveWithRotationOnGroundEvent(){return this._smoothMoveWithRotationOnGroundEvent}smoothMoveWithRotationOnGround(e,t,i,r,o){this._smoothMoveWithRotationOnGroundEvent.emit(e,t,i,r,o)}get automaticLandingEvent(){return this._automaticLandingEvent}automaticLanding(){const e=this.collision;this.collision=!1,setTimeout(()=>{this._automaticLandingEvent.emit(e)},100)}get smoothMoveKeepPitchEvent(){return this._smoothMoveKeepPitchEvent}smoothMoveKeepPitch(e,t){this._smoothMoveKeepPitchEvent.emit(e,t)}get smoothMoveRelativelyEvent(){return this._smoothMoveRelativelyEvent}smoothMoveRelatively(e,t){this._smoothMoveRelativelyEvent.emit(e,t)}get smoothMoveRelativelyWithRotationEvent(){return this._smoothMoveRelativelyWithRotationEvent}smoothMoveRelativelyWithRotation(e,t,i){this._smoothMoveRelativelyWithRotationEvent.emit(e,t,i)}getESProperties(){const e={...super.getESProperties()},t=[...e.location,new E([this,"editing"],"是否编辑"),new L("自动落地",this.automaticLanding.bind(this),[]),new nt([this,"position"],"位置数组",[0,0,0]),new ds([this,"rotation"],"姿态数组",[0,0,0]),new ue([this,"scale"],"缩放",[1,1,1]),new f([this,"minVisibleDistance"],"最小可见距离",0),new f([this,"maxVisibleDistance"],"最大可见距离",0)];return["ESHuman","ESGltfModel","ESFountainParticleSystem","ESHumanFountain"].includes(this.typeName)&&t.push(new ue([this,"positionOffset"],"位置偏移",[0,0,0])),{...e,defaultMenu:"basic",location:t,more:[...e.more,new L("平滑移动",this.smoothMove.bind(this),[[0,0,0],0]),new L("固定方向平滑移动",this.smoothMoveKeepPitch.bind(this),[[0,0,0],0]),new L("平滑偏移",this.smoothMoveWithRotation.bind(this),[[0,0,0],[0,0,0],0]),new L("贴地平滑移动",this.smoothMoveOnGround.bind(this),[0,0,0,""]),new L("贴地平滑偏移",this.smoothMoveWithRotationOnGround.bind(this),[[0,0,0],0,0,0,""]),new L("相对平滑移动",this.smoothMoveRelatively.bind(this),[[0,0,0],0]),new L("相对平滑偏移",this.smoothMoveRelativelyWithRotation.bind(this),[[0,0,0],[0,0,0],0]),new E([this,"enableVisibleDistance"],"是否应用距离显隐")]}}get pointSize(){return this.pointStyle.size}set pointSize(e){this.pointStyle={...this.pointStyle,size:e}}get pointSizeChanged(){return this.pointStyleChanged}get pointSizeType(){return this.pointStyle.sizeType}set pointSizeType(e){this.pointStyle={...this.pointStyle,sizeType:e}}get pointSizeTypeChanged(){return this.pointStyleChanged}get pointColor(){return this.pointStyle.color}set pointColor(e){this.pointStyle={...this.pointStyle,color:[...e]}}get pointColorChanged(){return this.pointStyleChanged}get pointMaterial(){return this.pointStyle.material}set pointMaterial(e){this.pointStyle={...this.pointStyle,material:e}}get pointMaterialChanged(){return this.pointStyleChanged}get pointMaterialParams(){return this.pointStyle.materialParams}set pointMaterialParams(e){this.pointStyle={...this.pointStyle,materialParams:e}}get pointMaterialParamsChanged(){return this.pointStyleChanged}};a(Oi,"createDefaultProps",()=>({...X.createDefaultProps(),pointed:!1,pointStyle:B({size:1,sizeType:"screen",color:[1,1,1,1],material:"",materialParams:{},outlineColor:[1,0,0,1],outlineWidth:2}),position:F([0,0,0]),rotation:F([0,0,0]),positionOffset:F([0,0,0]),scale:F([1,1,1]),minVisibleDistance:w(0),maxVisibleDistance:w(0)})),a(Oi,"type",Oi.register("ESObjectWithLocation",Oi,{chsName:"对象位置",tags:["ESObjects","base"],description:"对象位置"})),a(Oi,"supportEditingModes",[...X.supportEditingModes,I.SinglePoint,I.Place,I.Translation,I.Rotation,I.Scale,I.DoublePoints,I.DoublePointsAppend,I.DoublePointsModify]);let j=Oi;const Es=class Es extends j{getESProperties(){const s={...super.getESProperties()};return{...s,style:[...s.style,new k("点样式集合"),new E([this,"pointed"],"开启点样式",!1),new f([this,"pointSize"],"点大小",1),new A([this,"pointSizeType"],[["screen","screen"],["world","world"]],"点类型","screen"),new G([this,"pointColor"],"点颜色",[1,1,1,1]),new k("线样式集合"),new E([this,"stroked"],"开启线样式",!1),new E([this,"strokeGround"],"是否贴地(线)",!1),new f([this,"strokeWidth"],"线宽",1),new A([this,"strokeWidthType"],[["screen","screen"],["world","world"]],"线类型","screen"),new G([this,"strokeColor"],"线颜色",[1,1,1,1]),new k("面样式集合"),new E([this,"filled"],"开启填充样式",!1),new E([this,"fillGround"],"是否贴地",!1),new G([this,"fillColor"],"填充颜色",[1,1,1,1])],more:[...s.more,new k("点样式"),new N([this,"pointMaterial"],"点材质",""),new R([this,"pointMaterialParams"],"点材质参数",{}),new k("线样式"),new N([this,"strokeMaterial"],"线材质",""),new R([this,"strokeMaterialParams"],"线材质参数",{}),new k("填充样式"),new N([this,"fillMaterial"],"面材质",""),new R([this,"fillMaterialParams"],"面材质参数",{})]}}get strokeWidth(){return this.strokeStyle.width}set strokeWidth(s){this.strokeStyle={...this.strokeStyle,width:s}}get strokeWidthChanged(){return this.strokeStyleChanged}get strokeWidthType(){return this.strokeStyle.widthType}set strokeWidthType(s){this.strokeStyle={...this.strokeStyle,widthType:s}}get strokeWidthTypeChanged(){return this.strokeStyleChanged}get strokeColor(){return this.strokeStyle.color}set strokeColor(s){this.strokeStyle={...this.strokeStyle,color:[...s]}}get strokeColorChanged(){return this.strokeStyleChanged}get strokeMaterial(){return this.strokeStyle.material}set strokeMaterial(s){this.strokeStyle={...this.strokeStyle,material:s}}get strokeMaterialChanged(){return this.strokeStyleChanged}get strokeMaterialParams(){return this.strokeStyle.materialParams}set strokeMaterialParams(s){this.strokeStyle={...this.strokeStyle,materialParams:s}}get strokeMaterialParamsChanged(){return this.strokeStyleChanged}get strokeGround(){return this.strokeStyle.ground}set strokeGround(s){this.strokeStyle={...this.strokeStyle,ground:s}}get strokeGroundChanged(){return this.strokeStyleChanged}get fillColor(){return this.fillStyle.color}set fillColor(s){this.fillStyle={...this.fillStyle,color:[...s]}}get fillColorChanged(){return this.fillStyleChanged}get fillMaterial(){return this.fillStyle.material}set fillMaterial(s){this.fillStyle={...this.fillStyle,material:s}}get fillMaterialChanged(){return this.fillStyleChanged}get fillMaterialParams(){return this.fillStyle.materialParams}set fillMaterialParams(s){this.fillStyle={...this.fillStyle,materialParams:s}}get fillMaterialParamsChanged(){return this.fillStyleChanged}get fillGround(){return this.fillStyle.ground}set fillGround(s){this.fillStyle={...this.fillStyle,ground:s}}get fillGroundChanged(){return this.fillStyleChanged}};a(Es,"createDefaultProps",()=>({...j.createDefaultProps(),pointed:!1,pointStyle:B({size:1,sizeType:"screen",color:[1,1,1,1],material:"",materialParams:{},outlineColor:[1,0,0,1],outlineWidth:1}),stroked:!1,strokeStyle:B({width:1,widthType:"screen",color:[1,1,1,1],material:"",materialParams:{},ground:!1}),filled:!1,fillStyle:B({color:[1,1,1,1],material:"",materialParams:{},ground:!1})})),a(Es,"type",Es.register("ESLocalVector",Es,{chsName:"本地矢量",tags:["ESObjects","base"],description:"本地矢量对象"}));let ti=Es;const Fn=class Fn extends ti{};a(Fn,"type",Fn.register("ESLocalVector2D",Fn,{chsName:"本地矢量2D",tags:["ESObjects","base"],description:"本地矢量2D对象"}));let ot=Fn;const ug=[["固定朝向",0],["面向屏幕旋转",1],["绕自身Z轴旋转",2]],pg=[["单面不透明",0],["双面不透明",1],["单面遮罩",2],["双面遮罩",3],["单面透明",4],["双面透明",5],["单面未遮挡透明",6],["双面未遮挡透明",7]],bs=class bs extends j{constructor(){super(...arguments);a(this,"_widgetEvent",this.dv(new v))}get widgetEvent(){return this._widgetEvent}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new E([this,"screenRender"],"屏幕渲染",!0),new E([this,"sizeByContent"],"尺寸自适应",!0),new ne([this,"size"],"尺寸大小",[100,100]),new ne([this,"anchor"],"偏移比例",[.5,1]),new ne([this,"offset"],"像素偏移",[0,0]),new A([this,"renderMode"],pg,"渲染模式",0),new A([this,"rotationType"],ug,"漫游旋转类型",1),new N([this,"actorTag"],"绑定对象"),new N([this,"socketName"],"插槽名称"),new ue([this,"positionOffset"],"位置偏移"),new ue([this,"rotationOffset"],"相对姿态")],more:[...e.more,new f([this,"zOrder"],"排序",0)]}}};a(bs,"createDefaultProps",()=>({...j.createDefaultProps(),screenRender:!0,size:F([100,100]),anchor:F([.5,1]),offset:F([0,0]),sizeByContent:!0,renderMode:0,rotationType:1,zOrder:0,actorTag:"",socketName:"",positionOffset:F([0,0,0]),rotationOffset:F([0,0,0])})),a(bs,"type",bs.register("ESLabel",bs,{chsName:"标签",tags:["ESObjects","base"],description:"标签对象"}));let ze=bs;const re=class re extends M{constructor(e){super(e);a(this,"_testEvent",this.dv(new v))}get testEvent(){return this._testEvent}func(e,t=!0){e.includes("completeJson")&&console.log("ESTestObject.completeJson",this.completeJson),e.includes("json")&&console.log("ESTestObject.json",this.json),t&&console.log("ESTestObject func"),this._testEvent.emit(e,t)}func1(e,t){e.includes("completeJson")&&console.log("ESTestObject.completeJson",this.completeJson),e.includes("json")&&console.log("ESTestObject.json",this.json),t&&console.log("ESTestObject func"),this._testEvent.emit(e,t)}getPadding(){return this.padding}getESProperties(){return{defaultMenu:"basic",basic:[new N([this,"typeName"],"类型",void 0,!1,!0),new N([this,"id"],"id",void 0,!1,!0),new N([this,"name"],"名称"),new N([this,"ref"],"引用",void 0,!0),new R([this,"extras"],"扩展属性",{},void 0,!0),new _o("JSON",()=>this._jsonStr,e=>e&&(this._jsonStr=e))],general:[new E([this,"show"],"是否显示",re.defaults.show),new G([this,"color"],"颜色",re.defaults.color),new A([this,"paramType"],[["screen","screen"],["world","world"]],"参数类型",re.defaults.paramType),new _n([this,"text"],"内容",re.defaults.text)],dataSource:[new Ve([this,"startTime"],"开始时间",re.defaults.startTime),new Xe([this,"code"],"js代码",re.defaults.code),new vo([this,"times"],"时间组",re.defaults.times),new N([this,"url"],"服务地址",re.defaults.url),new L("func",this.func.bind(this),[["completeJson","json"]]),new L("func1",(e,t)=>this.func1(e,t),[["completeJson","json"],!0])],location:[new ue([this,"positionOffset"],"位置偏移",re.defaults.positionOffset),new nt([this,"position"],"位置数组",re.defaults.position),new ds([this,"rotation"],"姿态数组",re.defaults.rotation)],coordinate:[new f([this,"height"],"高度(m)",re.defaults.height),new ie([this,"points"],"位置数组",re.defaults.points)],style:[new Fe([this,"padding"],"内边距",re.defaults.padding),new ne([this,"offset"],"像素偏移",re.defaults.offset),new k("样式"),new Yn([this,"dashPattern"],"虚线图案",255),new k("样式2"),new G([this,"color"],"颜色",re.defaults.color),new R([this,"strokeStyle"],"线样式参数",re.defaults.strokeStyle)],more:[]}}};a(re,"createDefaultProps",()=>({...M.createDefaultProps(),show:!0,url:"http://localhost:8080/earthsdk3/earthsdk3.gltf",height:100,position:F([116.39,39.9,100]),rotation:F([0,-90,0]),points:Nt([]),color:F([1,0,0,1]),strokeStyle:B({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:F([]),offset:F([10,0]),positionOffset:F([0,2,0]),padding:F([0,2,0,2])})),a(re,"type",re.register("ESTestObject",re,{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 ko=re;const St=class St extends X{constructor(e){super(e);a(this,"_refreshTilesetEvent",this.dv(new v));a(this,"_tilesetReadyEvent",this.dv(new v));a(this,"_supportEdit",this.dv(w(!0)));a(this,"_highlightFeatureEvent",this.dv(new v));a(this,"_highlightFeatureAndFlyToEvent",this.dv(new v));a(this,"_strokeFeatureEvent",this.disposeVar(new v));a(this,"_getFeatureTableEvent",this.dv(new v));a(this,"_featureTableResultEvent",this.dv(new v));a(this,"_getMaterialNameListEvent",this.disposeVar(new v));a(this,"_setFeatureStyleEvent",this.dv(new v));a(this,"_setFeatureColorEvent",this.dv(new v));a(this,"_setFeatureVisableEvent",this.dv(new v));a(this,"_resetFeatureStyleEvent",this.dv(new v));a(this,"setMaterialInfoEvent",this.ad(new v));a(this,"_setMaterialEvent",this.disposeVar(new v));a(this,"_clippingPlanesId",this.dv(w("")));a(this,"_clippingPlaneIds",this.dv(w([])));a(this,"_flattenedPlaneId",this.dv(w("")));a(this,"_flattenedPlaneEnabled",this.dv(w(!1)));a(this,"_clippingPlaneId",this.dv(w("")));a(this,"_excavateId",this.dv(F([])))}updateEditing(){var e;(e=this.activeViewer)==null||e.startEditing(this,[I.Translation,I.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(e){this._supportEdit.value=e}get supportEditChanged(){return this._supportEdit.changed}get highlightFeatureEvent(){return this._highlightFeatureEvent}highlightFeature(e,t){this._highlightFeatureEvent.emit(e,t)}get highlightFeatureAndFlyToEvent(){return this._highlightFeatureAndFlyToEvent}highlightFeatureAndFlyTo(e,t,i,r){this._highlightFeatureAndFlyToEvent.emit(e,t,i,r)}get strokeFeatureEvent(){return this._strokeFeatureEvent}strokeFeature(e,t=[1,0,0,1]){this._strokeFeatureEvent.emit(e,t)}get getFeatureTableEvent(){return this._getFeatureTableEvent}getFeatureTable(){return Promise.race([new Promise(e=>{const t=this.d(this._featureTableResultEvent.donce(e));this._getFeatureTableEvent.emit(),setTimeout(()=>{t(),e(void 0)},2e3)})])}get getMaterialNameListEvent(){return this._getMaterialNameListEvent}getMaterialNameList(){return new Promise(e=>{const t=new b;t.d(this.getMaterialNameListEvent.don(i=>{i!=="start"&&(t.destroy(),e(i))})),this.getMaterialNameListEvent.emit("start"),setTimeout(()=>{t.isDestroyed()||(t.destroy(),e(void 0))},2e3)})}get setFeatureStyleEvent(){return this._setFeatureStyleEvent}setFeatureStyle(e,t=!1){this._setFeatureStyleEvent.emit(e,t)}get setFeatureColorEvent(){return this._setFeatureColorEvent}setFeatureColor(e,t,i=!1){this._setFeatureColorEvent.emit(e,typeof t=="string"?JSON.parse(t):t,i)}get setFeatureVisableEvent(){return this._setFeatureVisableEvent}setFeatureVisable(e,t,i=!1){this._setFeatureVisableEvent.emit(e,typeof t=="string"?JSON.parse(t):t,i)}get resetFeatureStyleEvent(){return this._resetFeatureStyleEvent}resetFeatureStyle(e){this._resetFeatureStyleEvent.emit(e)}get setMaterialEvent(){return this._setMaterialEvent}setMaterial(e){return new Promise(t=>{const i=new b;i.ad(this.setMaterialInfoEvent.donce(r=>{i.destroy(),t(r)})),this._setMaterialEvent.emit(e)})}get clippingPlanesId(){return this._clippingPlanesId.value}set clippingPlanesId(e){this._clippingPlanesId.value=e}get clippingPlanesIdChanged(){return this._clippingPlanesId.changed}get clippingPlaneIds(){return this._clippingPlaneIds.value}set clippingPlaneIds(e){this._clippingPlaneIds.value=e}get clippingPlaneIdsChanged(){return this._clippingPlaneIds.changed}get flattenedPlaneId(){return this._flattenedPlaneId.value}set flattenedPlaneId(e){this._flattenedPlaneId.value=e}get flattenedPlaneIdChanged(){return this._flattenedPlaneId.changed}get flattenedPlaneEnabled(){return this._flattenedPlaneEnabled.value}set flattenedPlaneEnabled(e){this._flattenedPlaneEnabled.value=e}get flattenedPlaneEnabledChanged(){return this._flattenedPlaneEnabled.changed}get clippingPlaneId(){return this._clippingPlaneId.value}set clippingPlaneId(e){this._clippingPlaneId.value=e}get clippingPlaneIdChanged(){return this._clippingPlaneId.changed}get excavateId(){return this._excavateId.value}set excavateId(e){this._excavateId.value=e}get excavateIdChanged(){return this._excavateId.changed}setLight122(){this.czmEnvironmentMapManager={...Do}}getESProperties(){const e={...super.getESProperties()};return{...e,defaultMenu:"dataSource",basic:[...e.basic,new pe([this,"maximumScreenSpaceError"],1,[0,256],"精度",16),new A([this,"materialMode"],[["常规","normal"],["科技感","technology"]],"材质模式","normal",!0),new A([this,"colorBlendMode"],[["默认","HIGHLIGHT"],["替换","REPLACE"],["混合","MIX"]],"颜色模式","HIGHLIGHT"),new R([this,"materialOverrideMap"],"材质替换",St.defaults.materialOverrideMap)],dataSource:[...e.dataSource,new R([this,"url"],"服务地址",St.defaults.url,void 0,!0)],coordinate:[...e.coordinate,new E([this,"editing"],"编辑",!1,!0),new ue([this,"offset"],"偏移",[0,0,0],!0),new ds([this,"rotation"],"旋转",[0,0,0])],more:[...e.more,new R([this,"materialParams"],"materialParams",St.defaults.materialParams),new L("高亮要素",this.highlightFeature.bind(this),["id_value","rgba(255,0,0,1)"],"highlightFeature"),new L("高亮并且定位到要素",this.highlightFeatureAndFlyTo.bind(this),["id_value",[1116.39,39.9,100,1e3],"rgba(255,0,0,1)",1],"highlightFeatureAndFlyTo"),new L("要素着色控制",this.setFeatureColor.bind(this),["height",[{minValue:1e5,color:[1,0,0,1]},{maxValue:5e5,color:[1,1,0,1]}]],"setFeatureColor"),new L("要素可见性控制",this.setFeatureVisable.bind(this),["height",[{minValue:1e5,visable:!0},{maxValue:5e5,visable:!1}]],"setFeatureVisable"),new L("重置样式",()=>this.resetFeatureStyle(),[],"resetFeatureStyle"),new k("ue"),new L("刷新 tileset",()=>this.refreshTileset(),[],"refreshTileset"),new N([this,"actorTag"]),new E([this,"highlight"],"是否高亮"),new G([this,"highlightColor"]),new f([this,"highlightID"]),new k("czm"),new ne([this,"czmImageBasedLightingFactor"],"反射强度"),new f([this,"czmAtmosphereScatteringIntensity"],"大气散射强度"),new R([this,"czmEnvironmentMapManager"],"动态环境贴图管理器"),new f([this,"czmMaximumMemoryUsage"],"最大内存"),new k("常用"),new A([this,"czmClassificationType"],[["NONE","NONE"],["TERRAIN","TERRAIN"],["CESIUM_3D_TILE","CESIUM_3D_TILE"],["BOTH","BOTH"]],"czmClassificationType","NONE",!0),new R([this,"czmStyleJson"],"czmStyle"),new E([this,"czmBackFaceCulling"]),new E([this,"czmSkipLevelOfDetail"]),new E([this,"czmDebugWireframe"]),new f([this,"cacheBytes"],"最大缓存",512*1024*1024),new k("调试信息"),new E([this,"czmDebugShowBoundingVolume"]),new E([this,"czmDebugShowContentBoundingVolume"]),new k("裁剪"),new E([this,"clippingPlaneEnabled"]),new E([this,"unionClippingRegions"]),new G([this,"clippingPlaneEdgeColor"]),new f([this,"clippingPlaneEdgeWidth"])]}}};a(St,"createDefaultProps",()=>({...X.createDefaultProps(),url:"",actorTag:"",materialMode:"normal",highlight:!1,maximumScreenSpaceError:16,highlightID:0,highlightColor:F([1,0,0,1]),offset:q([0,0,0]),rotation:F([0,0,0]),czmImageBasedLightingFactor:F([1,1]),czmEnvironmentMapManager:te(void 0),czmLuminanceAtZenith:2,czmAtmosphereScatteringIntensity:2,czmMaximumMemoryUsage:512,czmClassificationType:"NONE",czmStyleJson:B({}),czmBackFaceCulling:!0,czmDebugShowBoundingVolume:!1,czmDebugShowContentBoundingVolume:!1,czmSkipLevelOfDetail:!1,cacheBytes:512*1024*1024,colorBlendMode:"HIGHLIGHT",clippingPlaneEnabled:!0,unionClippingRegions:!0,clippingPlaneEdgeColor:F([1,1,1,1]),clippingPlaneEdgeWidth:2,materialParams:{baseColor:[0,.5,1]},allowPicking:!0,materialOverrideMap:te({}),featureIdLabel:0,splitDirection:"NONE",czmDebugWireframe:!1})),a(St,"type",St.register("ES3DTileset",St,{chsName:"3DTileset",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:`ES3DTileset 是 EarthSDK3 中用于管理和加载 3D Tiles 数据的核心可视化对象。
|
|
42
42
|
对象json示例:
|
|
43
43
|
{
|
|
44
44
|
"id": "3dtileset_xxx",
|
|
@@ -55,7 +55,7 @@ ${h.map(u=>`${u.id} ${u.typeName}
|
|
|
55
55
|
"position": [116.39, 39.9, 0],
|
|
56
56
|
"radius": 10
|
|
57
57
|
}
|
|
58
|
-
`}));let Mo=Ss;const
|
|
58
|
+
`}));let Mo=Ss;const gg=[["扫描","scan"],["扩散","diffuse"]],ni=class ni extends j{constructor(s){super(s)}getESProperties(){const s={...super.getESProperties()};return{...s,basic:[...s.basic,new f([this,"radius"],"半径",1),new A([this,"mode"],gg,"模式",ni.defaults.mode),new G([this,"color"],"颜色",ni.defaults.color)]}}};a(ni,"createDefaultProps",()=>({...j.createDefaultProps(),radius:1,mode:"scan",color:[0,.7,1,1],collision:!1})),a(ni,"type",ni.register("ESApertureEffect",ni,{chsName:"光圈特效",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:`ESApertureEffect 是用于在场景中指定位置显示光圈特效(扫描或扩散)的对象。
|
|
59
59
|
对象json示例:
|
|
60
60
|
{
|
|
61
61
|
"id": "apertureeffect_xxx",
|
|
@@ -64,7 +64,7 @@ ${h.map(u=>`${u.id} ${u.typeName}
|
|
|
64
64
|
"position": [116.39, 39.9, 0],
|
|
65
65
|
"radius": 1
|
|
66
66
|
}
|
|
67
|
-
`}));let Ao=ni;const
|
|
67
|
+
`}));let Ao=ni;const fg=Object.entries({inner:"inner",outer:"outer",both:"both"}),xe=class xe extends U{constructor(e){super(e);a(this,"editingBindMode","circular")}get bufferShow(){var e;return(e=this.buffer)==null?void 0:e.show}set bufferShow(e){this.buffer={...this.buffer,show:e}}get bufferShowChanged(){return this.bufferChanged}get bufferColor(){var e;return(e=this.buffer)==null?void 0:e.color}set bufferColor(e){this.buffer={...this.buffer,color:e}}get bufferColorChanged(){return this.bufferChanged}get bufferGradient(){var e;return(e=this.buffer)==null?void 0:e.gradient}set bufferGradient(e){this.buffer={...this.buffer,gradient:e}}get bufferGradientChanged(){return this.bufferChanged}get bufferDistance(){var e;return(e=this.buffer)==null?void 0:e.distance}set bufferDistance(e){this.buffer={...this.buffer,distance:e}}get bufferDistanceChanged(){return this.bufferChanged}get bufferMode(){var e;return(e=this.buffer)==null?void 0:e.mode}set bufferMode(e){this.buffer={...this.buffer,mode:e}}get bufferModeChanged(){return this.bufferChanged}get bufferLight(){var e;return(e=this.buffer)==null?void 0:e.light}set bufferLight(e){this.buffer={...this.buffer,light:e}}get bufferLightChanged(){return this.bufferChanged}getESProperties(){const e={...super.getESProperties()};return{...e,style:[...e.style,new A([this,"classificationType"],yo,"贴地附着目标",xe.defaults.classificationType),new E([this,"instancing"],"实例化渲染",xe.defaults.instancing),new E([this,"bufferShow"],"缓冲区显隐",xe.defaults.buffer.show),new G([this,"bufferColor"],"缓冲区颜色",xe.defaults.buffer.color),new E([this,"bufferLight"],"缓冲区光照",xe.defaults.buffer.light),new f([this,"bufferDistance"],"缓冲区距离",xe.defaults.buffer.distance),new A([this,"bufferMode"],fg,"缓冲区模式",xe.defaults.buffer.mode),new E([this,"bufferGradient"],"缓冲区渐变",xe.defaults.buffer.gradient)],coordinate:[...e.coordinate,new f([this,"area"],"面积",0,!1,!0),new f([this,"perimeter"],"周长",0,!1,!0)]}}};a(xe,"createDefaultProps",()=>({...U.createDefaultProps(),buffer:B({show:!1,color:[0,0,0,.8],gradient:!0,distance:100,mode:"outer",light:!1}),classificationType:"TERRAIN",instancing:!1,fillStyle:B({color:[1,1,1,.5],material:"",materialParams:{},ground:!1}),strokeStyle:B({width:1,widthType:"screen",color:[1,1,1,1],material:"",materialParams:{},ground:!1}),filled:!0,stroked:!1,collision:!1})),a(xe,"type",xe.register("ESGeoPolygon",xe,{chsName:"地理多边形",tags:["ESObjects"],description:`ESGeoPolygon 是用于表示和操作地理多边形的对象,支持填充、描边和缓冲区等样式设置。
|
|
68
68
|
对象json示例:
|
|
69
69
|
{
|
|
70
70
|
"id": "polygon_xxx",
|
|
@@ -72,7 +72,7 @@ ${h.map(u=>`${u.id} ${u.typeName}
|
|
|
72
72
|
"name": "地理多边形",
|
|
73
73
|
"points": [[116.39, 39.9, 0], [116.40, 39.9, 0], [116.40, 39.91, 0]]
|
|
74
74
|
}
|
|
75
|
-
`})),a(xe,"supportEditingModes",[...U.supportEditingModes,I.CircularAppend,I.CircularInsert]);let ee=xe;const
|
|
75
|
+
`})),a(xe,"supportEditingModes",[...U.supportEditingModes,I.CircularAppend,I.CircularInsert]);let ee=xe;const Ut=class Ut extends ee{get fillMaterial(){return this.fillStyle.material}set fillMaterial(s){this.fillStyle={...this.fillStyle,material:s}}get fillMaterialParams(){return this.fillStyle?this.fillStyle.materialParams:Ut.defaults.fillStyle.materialParams}set fillMaterialParams(s){this.fillStyle={...this.fillStyle??Ut.defaults.fillStyle,materialParams:s??Ut.defaults.fillStyle.materialParams}}constructor(s){super(s)}};a(Ut,"createDefaultProps",()=>({...ee.createDefaultProps(),stroked:!0,filled:!0,units:F(["SquareMeter_SquareKilometer","MU_Hectare","PerimeterMeter_PerimeterKilometer"]),fillStyle:B({color:[1,1,1,1],material:"Material'/EarthSDKForUE/M_ES_Material.M_ES_Material'",materialParams:{Opacity:.4},ground:!0}),strokeStyle:B({width:2,widthType:"screen",color:[1,1,1,1],material:"",materialParams:{},ground:!1})})),a(Ut,"type",Ut.register("ESAreaMeasurement",Ut,{chsName:"面积测量",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE","_ES_Impl_Ol"],description:`ESAreaMeasurement 是用于在场景中通过多边形区域进行面积测量的对象。
|
|
76
76
|
对象json示例:
|
|
77
77
|
{
|
|
78
78
|
"id": "areameasurement_xxx",
|
|
@@ -80,7 +80,7 @@ ${h.map(u=>`${u.id} ${u.typeName}
|
|
|
80
80
|
"name": "面积测量",
|
|
81
81
|
"points": [[116.39, 39.9, 0], [116.40, 39.9, 0], [116.40, 39.91, 0]]
|
|
82
82
|
}
|
|
83
|
-
`}));let jo=
|
|
83
|
+
`}));let jo=Ut;const Cs=class Cs extends j{constructor(s){super(s)}getESProperties(){const s={...super.getESProperties()};return{...s,defaultMenu:"general",more:[...s.more,new k("czm"),new N([this,"image"],"图片"),new ue([this,"translation"],"偏移")]}}};a(Cs,"createDefaultProps",()=>({...j.createDefaultProps(),image:M.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/smoke.png"),translation:F([0,0,0])})),a(Cs,"type",Cs.register("ESBlastParticleSystem",Cs,{chsName:"粒子爆炸",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:`ESBlastParticleSystem 是用于在场景中指定位置创建粒子爆炸效果的对象。
|
|
84
84
|
对象json示例:
|
|
85
85
|
{
|
|
86
86
|
"id": "blastparticlesystem_xxx",
|
|
@@ -151,7 +151,7 @@ ${h.map(u=>`${u.id} ${u.typeName}
|
|
|
151
151
|
"position": [116.39, 39.9, 0],
|
|
152
152
|
"width": 200
|
|
153
153
|
}
|
|
154
|
-
`}));let Vo=Is;class
|
|
154
|
+
`}));let Vo=Is;class mg extends b{constructor(s,e,t){super();const i=document.createElement("div");i.setAttribute("xe2-div",`ESCustomDiv(${e.id})(viewer: ${t.id}) container`);{const h=()=>{const u=` ${e.cssText}
|
|
155
155
|
${e.cssAllInitial?"all: initial;":""}
|
|
156
156
|
${e.show?"":"display: none"}
|
|
157
157
|
`;i.style.cssText=u};h();const c=this.dv(oe(e.cssAllInitialChanged,e.cssTextChanged,e.showChanged));this.d(c.don(h))}s.appendChild(i),this.d(()=>s.removeChild(i));const r=this.dv(oe(e.instanceClassChanged,e.containerChanged,e.shadowDomChanged)),o=this.dv(new le(r,()=>{const{instanceClass:h,container:c}=e;if(!h||c)return;let u=i;if(i.firstElementChild&&i.removeChild(i.firstElementChild),e.shadowDom){const p=i.appendChild(document.createElement("div"));p.setAttribute("xe2-div",`ESCustomDiv(${e.id})(viewer: ${t.id}) container shadowDiv`),u=p.attachShadow({mode:"open"}).appendChild(document.createElement("div")),u.setAttribute("xe2-div",`ESCustomDiv(${e.id})(viewer: ${t.id}) container shadowDiv div`)}return new h(u,e,t)})),{_updateEvent:l}=e;this.d(l.don(h=>{if(o.obj)try{h(o.obj,e,t)}catch(c){console.error(`ESCustomDiv update error! ${c}`)}}))}}const fc=`class MyDiv {
|
|
@@ -192,11 +192,11 @@ ${h.map(u=>`${u.id} ${u.typeName}
|
|
|
192
192
|
destroy() {
|
|
193
193
|
this._container.removeChild(this._div);
|
|
194
194
|
}
|
|
195
|
-
}`,
|
|
195
|
+
}`,vg=`示例代码:
|
|
196
196
|
\`\`\`
|
|
197
197
|
${fc}
|
|
198
198
|
\`\`\`
|
|
199
|
-
`,Ze=class Ze extends M{constructor(e){super(e);a(this,"_updateEvent",this.dv(new v));a(this,"_instanceClassReact",this.dv(w(void 0)));a(this,"_innerHtmlMounted",this.dv(new v));a(this,"_container",this.dv(w(void 0)));this.registerAttachedObjectForContainer((i,r)=>new
|
|
199
|
+
`,Ze=class Ze extends M{constructor(e){super(e);a(this,"_updateEvent",this.dv(new v));a(this,"_instanceClassReact",this.dv(w(void 0)));a(this,"_innerHtmlMounted",this.dv(new v));a(this,"_container",this.dv(w(void 0)));this.registerAttachedObjectForContainer((i,r)=>new mg(r,this,i));{const i=()=>{try{this.instanceClass=this.instanceClassStr&&Function(`"use strict";return (${this.instanceClassStr})`)()}catch{this.instanceClass=void 0}};i(),this.d(this.instanceClassStrChanged.don(i))}{const i=()=>{if(this.innerHTML===void 0){this.instanceClassStr=void 0;return}const r=`class MyDiv {
|
|
200
200
|
// subContainer是外部视口的div容器,可以在这里创建自己需要的DOM元素
|
|
201
201
|
// customDiv指向当前的CustomDiv场景对象
|
|
202
202
|
// viewer指定当前的视口
|
|
@@ -217,7 +217,7 @@ ${fc}
|
|
|
217
217
|
}`;this.instanceClassStr=r};i(),this.d(this.innerHTMLChanged.don(i))}const t=document.createElement("div");t.setAttribute("xe2-div",`ESCustomDiv(${this.id}) container`);{const i=()=>{const o=` ${this.cssText};
|
|
218
218
|
${this.cssAllInitial?"all: initial;":""}
|
|
219
219
|
${this.show?"":"display: none;"}
|
|
220
|
-
`;t.style.cssText=o};i();const r=this.dv(oe(this.cssAllInitialChanged,this.cssTextChanged,this.showChanged));this.d(r.don(i))}{const i=()=>{if(this.containerId===void 0||this.containerId==="")this.container=void 0;else{const r=document.getElementById(this.containerId);r instanceof HTMLElement?this.container=r:(this.container=void 0,console.warn(`Div from containerId(${this.containerId}) is not HTMLDivElement!`))}};i(),this.d(this.containerIdChanged.don(i))}{class i extends b{constructor(o){super(),o.appendChild(t),this.d(()=>o.removeChild(t))}}this.dv(new le(this.containerChanged,()=>{if(this.container)return new i(this.container)}))}{const i=this.dv(oe(this.containerChanged,this.instanceClassChanged,this.shadowDomChanged));this.dv(new le(i,()=>{if(!this.container||!this.instanceClass)return;let r=t;if(t.firstElementChild&&t.removeChild(t.firstElementChild),this.shadowDom){const o=t.appendChild(document.createElement("div"));o.setAttribute("xe2-div","ESCustomDiv container shadowDiv"),r=o.attachShadow({mode:"open"}).appendChild(document.createElement("div")),r.setAttribute("xe2-div","ESCustomDiv container shadowDiv div")}return new this.instanceClass(r,this,void 0)}))}}update(e){this._updateEvent.emit(e)}get instanceClass(){return this._instanceClassReact.value}set instanceClass(e){this._instanceClassReact.value=e}get instanceClassChanged(){return this._instanceClassReact.changed}get innerHtmlMounted(){return this._innerHtmlMounted}get container(){return this._container.value}get containerChanged(){return this._container.changed}set container(e){this._container.value=e}getESProperties(){const e={...super.getESProperties()},t=i=>{i||alert("evalFuncStr为空,无法执行!");try{const r=i&&Function(`"use strict";return (${i})`)();this.update(r)}catch(r){alert(`updateDivFunc error: ${r}`)}};return{...e,more:[...e.more,new k("ESCustomDiv"),new E([this,"show"],"显示"),new Xe([this,"instanceClassStr"],"实例类",fc,
|
|
220
|
+
`;t.style.cssText=o};i();const r=this.dv(oe(this.cssAllInitialChanged,this.cssTextChanged,this.showChanged));this.d(r.don(i))}{const i=()=>{if(this.containerId===void 0||this.containerId==="")this.container=void 0;else{const r=document.getElementById(this.containerId);r instanceof HTMLElement?this.container=r:(this.container=void 0,console.warn(`Div from containerId(${this.containerId}) is not HTMLDivElement!`))}};i(),this.d(this.containerIdChanged.don(i))}{class i extends b{constructor(o){super(),o.appendChild(t),this.d(()=>o.removeChild(t))}}this.dv(new le(this.containerChanged,()=>{if(this.container)return new i(this.container)}))}{const i=this.dv(oe(this.containerChanged,this.instanceClassChanged,this.shadowDomChanged));this.dv(new le(i,()=>{if(!this.container||!this.instanceClass)return;let r=t;if(t.firstElementChild&&t.removeChild(t.firstElementChild),this.shadowDom){const o=t.appendChild(document.createElement("div"));o.setAttribute("xe2-div","ESCustomDiv container shadowDiv"),r=o.attachShadow({mode:"open"}).appendChild(document.createElement("div")),r.setAttribute("xe2-div","ESCustomDiv container shadowDiv div")}return new this.instanceClass(r,this,void 0)}))}}update(e){this._updateEvent.emit(e)}get instanceClass(){return this._instanceClassReact.value}set instanceClass(e){this._instanceClassReact.value=e}get instanceClassChanged(){return this._instanceClassReact.changed}get innerHtmlMounted(){return this._innerHtmlMounted}get container(){return this._container.value}get containerChanged(){return this._container.changed}set container(e){this._container.value=e}getESProperties(){const e={...super.getESProperties()},t=i=>{i||alert("evalFuncStr为空,无法执行!");try{const r=i&&Function(`"use strict";return (${i})`)();this.update(r)}catch(r){alert(`updateDivFunc error: ${r}`)}};return{...e,more:[...e.more,new k("ESCustomDiv"),new E([this,"show"],"显示"),new Xe([this,"instanceClassStr"],"实例类",fc,vg,!0),new Xe([this,"innerHTML"],"innerHTML",Ze.defaultInnerHTML,Ze.innerHTMLReadMe,!0),new L("强制更新",t,["(divClass, dom, viewer) => divClass.update && divClass.update()"],"update"),new E([this,"allowPicking"],"允许拾取",!0),new N([this,"containerId"],"容器ID",Ze.defaults.containerId,!0),new E([this,"shadowDom"],"shadowDom"),new E([this,"cssAllInitial"],"cssAllInitial"),new N([this,"cssText"],"cssText")]}}};a(Ze,"createDefaultProps",()=>({...M.createDefaultProps(),show:!0,instanceClassStr:void 0,innerHTML:void 0,allowPicking:void 0,containerId:"",shadowDom:!1,cssAllInitial:!1,cssText:""})),a(Ze,"type",Ze.register("ESCustomDiv",Ze,{chsName:"ESCustomDiv",tags:["ESObjects"],description:`ESCustomDiv 是用于在场景中创建和管理自定义 HTML div 元素的对象。
|
|
221
221
|
对象json示例:
|
|
222
222
|
{
|
|
223
223
|
"id": "customdiv_xxx",
|
|
@@ -274,7 +274,7 @@ ${fc}
|
|
|
274
274
|
"name": "粒子烟火",
|
|
275
275
|
"position": [116.39, 39.9, 0]
|
|
276
276
|
}
|
|
277
|
-
`}));let ur=Os;const
|
|
277
|
+
`}));let ur=Os;const _g=`
|
|
278
278
|
## 参数类型为 ESTreeType
|
|
279
279
|
\`\`\`js
|
|
280
280
|
type ESJVector2D = [number, number]
|
|
@@ -284,7 +284,7 @@ ${fc}
|
|
|
284
284
|
space: number
|
|
285
285
|
}
|
|
286
286
|
\`\`\`
|
|
287
|
-
`,ki=class ki extends X{constructor(s){super(s)}getESProperties(){const s={...super.getESProperties()};return{...s,more:[...s.more,new R([this,"url"],"路径",!0),new ie([this,"treeTypes"],"treeTypes",[],void 0,!0),new R([this,"xiaoBanWidget"],"xiaoBanWidget",ki.defaults.xiaoBanWidget,
|
|
287
|
+
`,ki=class ki extends X{constructor(s){super(s)}getESProperties(){const s={...super.getESProperties()};return{...s,more:[...s.more,new R([this,"url"],"路径",!0),new ie([this,"treeTypes"],"treeTypes",[],void 0,!0),new R([this,"xiaoBanWidget"],"xiaoBanWidget",ki.defaults.xiaoBanWidget,_g,!0),new N([this,"youShiSZ"]),new N([this,"diLei"]),new N([this,"senLinLB"]),new N([this,"labelMaterial"]),new f([this,"heightOffset"])]}}};a(ki,"createDefaultProps",()=>({...X.createDefaultProps(),url:"",treeTypes:te([]),xiaoBanWidget:te({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})),a(ki,"type",ki.register("ESForestTileset",ki,{chsName:"森林切片图层",tags:["ESObjects","_ES_Impl_UE"],description:`ESForestTileset 是用于管理和渲染森林切片图层的对象。
|
|
288
288
|
对象json示例:
|
|
289
289
|
{
|
|
290
290
|
"id": "foresttileset_xxx",
|
|
@@ -323,12 +323,12 @@ ${fc}
|
|
|
323
323
|
destroy() {
|
|
324
324
|
this._container.removeChild(this._div);
|
|
325
325
|
}
|
|
326
|
-
}`,
|
|
326
|
+
}`,yg=`示例代码:
|
|
327
327
|
\`\`\`
|
|
328
328
|
${mc}
|
|
329
329
|
\`\`\`
|
|
330
330
|
`,Wo=`<div style="width: 300px; height: 50px; background: rgba(120, 120, 0, 0.7); color: white; font-size: 30px; line-height: 50px; border: 1px solid white;">Hello world!</div>
|
|
331
|
-
`,
|
|
331
|
+
`,wg=`示例代码:
|
|
332
332
|
\`\`\`
|
|
333
333
|
${Wo}
|
|
334
334
|
\`\`\`
|
|
@@ -348,7 +348,7 @@ ${Wo}
|
|
|
348
348
|
destroy() {
|
|
349
349
|
this._container.removeChild(this._div);
|
|
350
350
|
}
|
|
351
|
-
}`;this.instanceClassStr=r};i(),this.d(this.innerHTMLChanged.don(i))}}get widgetEvent(){return this._widgetEvent}get echartsFun(){return this._echartsFunReact.value}set echartsFun(e){this._echartsFunReact.value=e}get echartsFunChanged(){return this._echartsFunReact.changed}get instanceClass(){return this._instanceClassReact.value}set instanceClass(e){this._instanceClassReact.value=e}get instanceClassChanged(){return this._instanceClassReact.changed}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new f([this,"opacity"],"透明度",ct.defaults.opacity,!0),new f([this,"zOrder"],"zOrder",ct.defaults.zOrder,!0),new ne([this,"anchor"],"偏移比例",ct.defaults.anchor,!0),new Xe([this,"innerHTML"],"innerHTML",ct.defaults.innerHTML,
|
|
351
|
+
}`;this.instanceClassStr=r};i(),this.d(this.innerHTMLChanged.don(i))}}get widgetEvent(){return this._widgetEvent}get echartsFun(){return this._echartsFunReact.value}set echartsFun(e){this._echartsFunReact.value=e}get echartsFunChanged(){return this._echartsFunReact.changed}get instanceClass(){return this._instanceClassReact.value}set instanceClass(e){this._instanceClassReact.value=e}get instanceClassChanged(){return this._instanceClassReact.changed}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new f([this,"opacity"],"透明度",ct.defaults.opacity,!0),new f([this,"zOrder"],"zOrder",ct.defaults.zOrder,!0),new ne([this,"anchor"],"偏移比例",ct.defaults.anchor,!0),new Xe([this,"innerHTML"],"innerHTML",ct.defaults.innerHTML,wg,!0),new Xe([this,"instanceClassStr"],"实例类",ct.defaults.instanceClassStr,yg,!0),new E([this,"renderInUE"],"是否在UE中渲染",!0,!1)]}}};a(ct,"createDefaultProps",()=>({...j.createDefaultProps(),opacity:1,anchor:F([.5,1]),instanceClassStr:mc,innerHTML:Wo,zOrder:0,renderInUE:!1})),a(ct,"type",ct.register("ESGeoDiv",ct,{chsName:"ESGeoDiv",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:`ESGeoDiv 是用于在地理指定位置显示自定义 HTML 小部件的对象。
|
|
352
352
|
对象json示例:
|
|
353
353
|
{
|
|
354
354
|
"id": "geodiv_xxx",
|
|
@@ -385,7 +385,7 @@ ${Wo}
|
|
|
385
385
|
"points": [[116.39, 39.9, 0], [116.40, 39.9, 0], [116.40, 39.91, 0]],
|
|
386
386
|
"fireHeight": 10
|
|
387
387
|
}
|
|
388
|
-
`})),a(We,"supportEditingModes",[...U.supportEditingModes,I.CircularAppend,I.CircularInsert,I.Translation,I.HeightModify]);let Jo=We;const ji=class ji extends U{constructor(e){super(e);a(this,"editingBindMode","doublePoints")}toPolygon(){if(this.points&&this.points.length>=2){const e=[...this.points][0],t=[...this.points][1];return[e,[e[0],t[1],e[2]],t,[t[0],e[1],t[2]]]}else return}_updateArea(){if(this.points&&this.points.length>=2){const e=[...this.points],t=e[0],i=e[1],r=[t,[t[0],i[1],t[2]],i,[i[0],t[1],i[2]]];this._area.value=Po(r)}else this._area.value=0}_updatePerimeter(){if(this.points&&this.points.length>=2){const e=[...this.points],t=e[0],i=e[1],r=[t,[t[0],i[1],t[2]],i,[i[0],t[1],i[2]]],o=[...r,r[0]],l=
|
|
388
|
+
`})),a(We,"supportEditingModes",[...U.supportEditingModes,I.CircularAppend,I.CircularInsert,I.Translation,I.HeightModify]);let Jo=We;const ji=class ji extends U{constructor(e){super(e);a(this,"editingBindMode","doublePoints")}toPolygon(){if(this.points&&this.points.length>=2){const e=[...this.points][0],t=[...this.points][1];return[e,[e[0],t[1],e[2]],t,[t[0],e[1],t[2]]]}else return}_updateArea(){if(this.points&&this.points.length>=2){const e=[...this.points],t=e[0],i=e[1],r=[t,[t[0],i[1],t[2]],i,[i[0],t[1],i[2]]];this._area.value=Po(r)}else this._area.value=0}_updatePerimeter(){if(this.points&&this.points.length>=2){const e=[...this.points],t=e[0],i=e[1],r=[t,[t[0],i[1],t[2]],i,[i[0],t[1],i[2]]],o=[...r,r[0]],l=zt(o,"GEODESIC"),h=l[l.length-1];this._perimeter.value=h}else this._perimeter.value=0}getESProperties(){const e=super.getESProperties();return{...e,coordinate:[...e.coordinate,new f([this,"area"],"面积",0,!1,!0),new f([this,"perimeter"],"周长",0,!1,!0)]}}};a(ji,"createDefaultProps",()=>({...U.createDefaultProps(),collision:!1,stroked:!0,filled:!0,fillStyle:B({color:[1,1,1,.5],material:"",materialParams:{},ground:!1})})),a(ji,"type",ji.register("ESGeoRectangle",ji,{chsName:"矩形",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:`ESGeoRectangle 是用于表示和操作地理矩形的对象,通过两个对角点定义矩形并计算面积和周长。
|
|
389
389
|
对象json示例:
|
|
390
390
|
{
|
|
391
391
|
"id": "rectangle_xxx",
|
|
@@ -428,7 +428,7 @@ ${Wo}
|
|
|
428
428
|
"name": "影像图层",
|
|
429
429
|
"url": "https://server.arcgisonline.com/arcgis/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}"
|
|
430
430
|
}
|
|
431
|
-
`}));let fs=Ct;const
|
|
431
|
+
`}));let fs=Ct;const Eg=`
|
|
432
432
|
# 声明文件
|
|
433
433
|
### options 类型
|
|
434
434
|
\`\`\`javascript
|
|
@@ -604,7 +604,7 @@ export type ESJTimeIntervalCollectionJsonType = {
|
|
|
604
604
|
"name": "单体控制森林",
|
|
605
605
|
"treeTypes": [{"name": "杨树", "meshPath": "/Game/Foliage/Poplar"}]
|
|
606
606
|
}
|
|
607
|
-
`}));let ta=ks;function fr(n,s,e){const t="buffer"in n,i=t?n.buffer:n;t&&(s+=n.byteOffset);const r=new Array(e),o=new DataView(i);for(let l=0;l<e;++l){const h=o.getUint8(s+l);r[l]=String.fromCharCode(h)}return r.join("")}function mr(n,s){const e="buffer"in n,t=e?n.buffer:n;return e&&(s+=n.byteOffset),new DataView(t).getUint32(s,!0)}function bc(n,s,e){const t="buffer"in n,i=t?n.buffer:n;if(t&&(s+=n.byteOffset),s+e>i.byteLength){console.error("byteOffset + length > buffer.byteLength");return}return new Uint8Array(i,s,e)}function
|
|
607
|
+
`}));let ta=ks;function fr(n,s,e){const t="buffer"in n,i=t?n.buffer:n;t&&(s+=n.byteOffset);const r=new Array(e),o=new DataView(i);for(let l=0;l<e;++l){const h=o.getUint8(s+l);r[l]=String.fromCharCode(h)}return r.join("")}function mr(n,s){const e="buffer"in n,t=e?n.buffer:n;return e&&(s+=n.byteOffset),new DataView(t).getUint32(s,!0)}function bc(n,s,e){const t="buffer"in n,i=t?n.buffer:n;if(t&&(s+=n.byteOffset),s+e>i.byteLength){console.error("byteOffset + length > buffer.byteLength");return}return new Uint8Array(i,s,e)}function bg(n,s,e){const t="buffer"in n,i=t?n.buffer:n;if(t&&(s+=n.byteOffset),s+e*2>i.byteLength){console.error("byteOffset + length * 4 > buffer.byteLength");return}return new Uint16Array(i,s,e)}function Sg(n,s,e){const t="buffer"in n,i=t?n.buffer:n;if(t&&(s+=n.byteOffset),s+e*4>i.byteLength){console.error("byteOffset + length * 4 > buffer.byteLength");return}return new Uint32Array(i,s,e)}function Cg(n,s,e){const t="buffer"in n,i=t?n.buffer:n;if(t&&(s+=n.byteOffset),s+e*4>i.byteLength){console.error("byteOffset + length * 4 > buffer.byteLength");return}return new Float32Array(i,s,e)}function Sc(n){if(fr(n,0,4)!=="glTF"){console.error("Not a glTF file");return}const e=mr(n,4);if(e!==2){console.error("Unsupported glTF version");return}const t=mr(n,8);if(t!==n.byteLength){console.error("Invalid glTF length");return}const i=mr(n,12);if(i+12+4>t){console.error("Invalid glTF chunk length");return}if(fr(n,16,4)!=="JSON"){console.error("Invalid glTF chunk type");return}const o=fr(n,20,i),l={version:e,length:t,gltfJson:o};if(20+i<n.byteLength){const h=mr(n,20+i);if(fr(n,20+i+4,4)!=="BIN\0"){console.error("Invalid glTF chunk type");return}const u=bc(n,20+i+8,h);l.gltfBinary=u}return l}globalThis.parseGlb=Sc;function Cc(n){const s=Sc(n);if(s===void 0||!s.gltfBinary)return;const e=JSON.parse(s.gltfJson);return e.nodes.map(t=>{var i=e.meshes[t.mesh],r=i.primitives[0].attributes.POSITION,o=i.primitives[0].indices,l=e.accessors[r],h=e.bufferViews[l.bufferView];if(!s.gltfBinary)throw new Error("!glbParseResult.gltfBinary");const c=Cg(s.gltfBinary,h.byteOffset??0,h.byteLength/4);var u=e.accessors[o],p=e.bufferViews[u.bufferView];if(!s.gltfBinary)throw new Error("!glbParseResult.gltfBinary");let g;return u.componentType===5121?g=bc(s.gltfBinary,p.byteOffset??0,p.byteLength/1):u.componentType===5123?g=bg(s.gltfBinary,p.byteOffset??0,p.byteLength/2):u.componentType===5125&&(g=Sg(s.gltfBinary,p.byteOffset??0,p.byteLength/4)),{name:t.name,posBuffer:c,indicesBuffer:g}})}globalThis.parseWaterGlb=Cc;const Ee=class Ee extends j{constructor(e){super(e);a(this,"_submergingData");a(this,"_allMoments",[]);{const t=()=>{this.url!=""&&fetch(this.url).then(i=>{i.status==200&&i.ok&&i.arrayBuffer().then(r=>{this._submergingData=Cc(r);const o=this._submergingData.map(l=>Date.parse(l.name)).sort();this._allMoments=o,this.currentTime==0&&(this.currentTime=o[0]),this.readyEvent.emit(void 0)})}).catch(i=>{console.log(i)})};t(),this.d(this.urlChanged.don(()=>{t()}))}this.ad(de([this.waterColorChanged,this.frequencyChanged,this.amplitudeChanged,this.waveVelocityChanged,this.specularIntensityChanged,this.murkinessChanged,this.flowSpeedChanged],()=>{this.waterType="custom"}))}get getSubmergingData(){return this._submergingData}getAllMoments(){return this._allMoments}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new N([this,"url"],"Url地址",Ee.defaults.url),new pe([this,"amplitude"],.01,[0,1],"振幅",Ee.defaults.amplitude),new f([this,"frequency"],"频率",Ee.defaults.frequency),new f([this,"currentTime"],"当前时间",Ee.defaults.currentTime),new R([this,"materialParams"],"材质参数",Ee.defaults.materialParams),new A([this,"waterType"],[["river","river"],["ocean","ocean"],["lake","lake"],["custom","custom"]],"水域类型","river"),new G([this,"waterColor"],"水的底色",Ee.defaults.waterColor),new pe([this,"waveVelocity"],.01,[0,1],"波动频率",Ee.defaults.waveVelocity),new f([this,"flowSpeed"],"水流速度",Ee.defaults.flowSpeed),new pe([this,"specularIntensity"],.01,[0,1],"镜面反射强度",Ee.defaults.specularIntensity),new pe([this,"murkiness"],.01,[0,10],"水体浑浊度",Ee.defaults.murkiness)]}}};a(Ee,"createDefaultProps",()=>({...j.createDefaultProps(),allowPicking:!0,url:"",currentTime:0,materialParams:B({}),waterColor:[.15,.16,0,1],frequency:1e3,waveVelocity:.5,amplitude:.1,specularIntensity:.8,waterType:"river",flowSpeed:0,murkiness:5})),a(Ee,"type",Ee.register("ESSubmergingAnalysis",Ee,{chsName:"淹没分析",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:`ESSubmergingAnalysis 是用于在指定位置加载水体数据进行淹没分析的对象。
|
|
608
608
|
对象json示例:
|
|
609
609
|
{
|
|
610
610
|
"id": "submerginganalysis_xxx",
|
|
@@ -622,7 +622,7 @@ export type ESJTimeIntervalCollectionJsonType = {
|
|
|
622
622
|
"points": [[116.39, 39.9, 0], [116.40, 39.9, 0], [116.40, 39.91, 0]],
|
|
623
623
|
"height": 30
|
|
624
624
|
}
|
|
625
|
-
`})),a(Ni,"supportEditingModes",[...ee.supportEditingModes,I.HeightModify]);let sa=Ni;const
|
|
625
|
+
`})),a(Ni,"supportEditingModes",[...ee.supportEditingModes,I.HeightModify]);let sa=Ni;const Bt=class Bt extends X{constructor(e){super(e);a(this,"_activateEvent",this.disposeVar(new v));a(this,"activate",!1)}get activateEvent(){return this._activateEvent}getESProperties(){const e={...super.getESProperties()};return{...e,defaultMenu:"dataSource",basic:[...e.basic,new f([this,"zIndex"],"层级序号",Bt.defaults.zIndex)],dataSource:[...e.dataSource,new R([this,"url"],"地形服务地址",Bt.defaults.url),new Fe([this,"rectangle"],"矩形范围",Bt.defaults.rectangle)],more:[...e.more,new f([this,"czmMinzoom"],"czmMinzoom",void 0,!0),new f([this,"czmMaxzoom"],"czmMaxzoom",void 0,!0)]}}};a(Bt,"createDefaultProps",()=>({...X.createDefaultProps(),url:"http://inner.earthsdk.com/layer.json",rectangle:F([-180,-90,180,90]),zIndex:0,czmMaxzoom:void 0,czmMinzoom:void 0})),a(Bt,"type",Bt.register("ESTerrainLayer",Bt,{chsName:"地形图层",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:`ESTerrainLayer 是用于在场景中加载和管理地形图层的数据源对象。
|
|
626
626
|
对象json示例:
|
|
627
627
|
{
|
|
628
628
|
"id": "terrainlayer_xxx",
|
|
@@ -630,7 +630,7 @@ export type ESJTimeIntervalCollectionJsonType = {
|
|
|
630
630
|
"name": "地形图层",
|
|
631
631
|
"url": "http://inner.earthsdk.com/layer.json"
|
|
632
632
|
}
|
|
633
|
-
`}));let na=
|
|
633
|
+
`}));let na=Bt;const pt=class pt extends ze{constructor(s){super(s)}getESProperties(){const s={...super.getESProperties()};return{...s,basic:[...s.basic,new G([this,"color"],"文本颜色",[1,1,1,1]),new f([this,"fontSize"],"文字大小",14),new _n([this,"text"],"内容",pt.defaults.text,void 0,!0),new G([this,"backgroundColor"],"背景颜色",pt.defaults.backgroundColor),new Fe([this,"padding"],"内边距",pt.defaults.padding),new G([this,"borderColor"],"边界颜色"),new Fe([this,"borderRadius"],"边界圆角"),new f([this,"borderWidth"],"边界宽度"),new f([this,"rotate"],"旋转角度",pt.defaults.rotate)],more:[...s.more,new k("czm"),new E([this,"textEditingInteraction"],"文本编辑交互"),new E([this,"textEditing"],"文本编辑"),new f([this,"width"],"宽度",pt.defaults.width,!0),new f([this,"opacity"],"透明度"),new A([this,"textAlign"],[["center","center"],["left","left"],["right","right"]],"文字位置","left"),new A([this,"borderStyle"],[["none","none"],["hidden","hidden"],["dotted","dotted"],["dashed","dashed"],["solid","solid"],["double","double"],["groove","groove"],["ridge","ridge"],["inset","inset"],["outset","outset"]],"边框类型")]}}};a(pt,"createDefaultProps",()=>({...ze.createDefaultProps(),text:"请输入文字",width:80,textEditing:!1,textEditingInteraction:!1,opacity:1,fontSize:14,textAlign:"left",color:F([1,1,1,1]),backgroundColor:F([0,0,0,.8]),padding:F([5,5,5,5]),borderRadius:F([6,6,6,6]),borderWidth:0,borderColor:F([1,1,1,1]),borderStyle:"solid",rotate:0})),a(pt,"type",pt.register("ESTextLabel",pt,{chsName:"文本标签",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:`ESTextLabel 是用于在场景中指定位置显示自定义样式的文本标签对象。
|
|
634
634
|
对象json示例:
|
|
635
635
|
{
|
|
636
636
|
"id": "textlabel_xxx",
|
|
@@ -639,14 +639,14 @@ export type ESJTimeIntervalCollectionJsonType = {
|
|
|
639
639
|
"position": [116.39, 39.9, 0],
|
|
640
640
|
"text": "请输入文字"
|
|
641
641
|
}
|
|
642
|
-
`}));let ms=pt;const
|
|
642
|
+
`}));let ms=pt;const Pg=`
|
|
643
643
|
#### 默认值如下
|
|
644
644
|
\`\`\`js
|
|
645
645
|
{
|
|
646
646
|
"Title": "示例",
|
|
647
647
|
"Content": "这是一个示例\\n帮助你理解info的数据形式\\nnum:1\\nkey:'value'\\n"
|
|
648
648
|
}
|
|
649
|
-
\`\`\``,Qe=class Qe extends ze{constructor(e){super(e);a(this,"_callFunctionEvent",this.disposeVar(new v));a(this,"_callFunctionResultEvent",this.dv(new v))}get __callFunctionResultEvent(){return this._callFunctionResultEvent}get callFunctionEvent(){return this._callFunctionEvent}callFunction(e,t){return new Promise(i=>{const r=new b,o=setTimeout(()=>{r.isDestroyed()||(r.destroy(),i(void 0))},1e4);r.d(this._callFunctionResultEvent.donce(l=>{r.isDestroyed()||(r.destroy(),i(l),clearTimeout(o))})),this._callFunctionEvent.emit(e,t)})}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new ue([this,"positionOffset"],"positionOffset",Qe.defaults.positionOffset),new ue([this,"rotationOffset"],"rotationOffset",Qe.defaults.rotationOffset),new N([this,"actorTag"],"actorTag",Qe.defaults.actorTag),new N([this,"widgetClass"],"widgetClass",Qe.defaults.widgetClass),new N([this,"socketName"],"socketName",Qe.defaults.socketName),new R([this,"info"],"info",Qe.defaults.info,
|
|
649
|
+
\`\`\``,Qe=class Qe extends ze{constructor(e){super(e);a(this,"_callFunctionEvent",this.disposeVar(new v));a(this,"_callFunctionResultEvent",this.dv(new v))}get __callFunctionResultEvent(){return this._callFunctionResultEvent}get callFunctionEvent(){return this._callFunctionEvent}callFunction(e,t){return new Promise(i=>{const r=new b,o=setTimeout(()=>{r.isDestroyed()||(r.destroy(),i(void 0))},1e4);r.d(this._callFunctionResultEvent.donce(l=>{r.isDestroyed()||(r.destroy(),i(l),clearTimeout(o))})),this._callFunctionEvent.emit(e,t)})}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new ue([this,"positionOffset"],"positionOffset",Qe.defaults.positionOffset),new ue([this,"rotationOffset"],"rotationOffset",Qe.defaults.rotationOffset),new N([this,"actorTag"],"actorTag",Qe.defaults.actorTag),new N([this,"widgetClass"],"widgetClass",Qe.defaults.widgetClass),new N([this,"socketName"],"socketName",Qe.defaults.socketName),new R([this,"info"],"info",Qe.defaults.info,Pg,!0)],more:[...e.more,new L("回调函数",this.callFunction.bind(this),["",""],"callFunction")]}}};a(Qe,"createDefaultProps",()=>({...ze.createDefaultProps(),widgetClass:"",info:te({Title:"标题示例",Content:"内容示例"})})),a(Qe,"type",Qe.register("ESUEWidget",Qe,{chsName:"部件",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:`ESUEWidget 是用于在场景中指定位置创建和管理 Unreal Engine 部件(UI 交互面板)的对象。
|
|
650
650
|
对象json示例:
|
|
651
651
|
{
|
|
652
652
|
"id": "uewidget_xxx",
|
|
@@ -682,7 +682,7 @@ export type ESJTimeIntervalCollectionJsonType = {
|
|
|
682
682
|
"position": [116.39, 39.9, 0],
|
|
683
683
|
"fov": 90
|
|
684
684
|
}
|
|
685
|
-
`}));let la=et;const
|
|
685
|
+
`}));let la=et;const Tg=`
|
|
686
686
|
#### 默认值如下
|
|
687
687
|
\`\`\`js
|
|
688
688
|
{
|
|
@@ -690,7 +690,7 @@ export type ESJTimeIntervalCollectionJsonType = {
|
|
|
690
690
|
"Key":"Value",
|
|
691
691
|
"内容": "这是一个示例\\n帮助你理解info的数据形式\\nnum:1\\nkey:'value'\\n"
|
|
692
692
|
}
|
|
693
|
-
\`\`\``,li=class li extends ze{constructor(s){super(s)}getESProperties(){const s={...super.getESProperties()};return{...s,basic:[...s.basic,new R([this,"info"],"信息",li.defaults.info,
|
|
693
|
+
\`\`\``,li=class li extends ze{constructor(s){super(s)}getESProperties(){const s={...super.getESProperties()};return{...s,basic:[...s.basic,new R([this,"info"],"信息",li.defaults.info,Tg,!0)],more:[...s.more,new k("ue"),new nt([this,"positionOffset"],"坐标偏移"),new nt([this,"rotationOffset"],"旋转偏移"),new N([this,"actorTag"]),new N([this,"widgetClass"]),new N([this,"socketName"]),new k("czm"),new f([this,"opacity"],"透明度",li.defaults.opacity,!0)]}}};a(li,"createDefaultProps",()=>({...ze.createDefaultProps(),info:B({title:"标题示例",内容:"内容示例"}),widgetClass:"WidgetBlueprint'/EarthSDKForUE/Widget/WBP_ES_DefaultInfo.WBP_ES_DefaultInfo'",actorTag:"",socketName:"",positionOffset:F([0,0,0]),rotationOffset:F([0,0,0]),opacity:1})),a(li,"type",li.register("ESWidget",li,{chsName:"部件",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:`ESWidget 是用于在场景中指定位置显示可交互 UI 部件(信息面板)的对象。
|
|
694
694
|
对象json示例:
|
|
695
695
|
{
|
|
696
696
|
"id": "widget_xxx",
|
|
@@ -707,7 +707,7 @@ export type ESJTimeIntervalCollectionJsonType = {
|
|
|
707
707
|
"name": "方位角测量",
|
|
708
708
|
"points": [[116.39, 39.9, 0], [116.40, 39.9, 0]]
|
|
709
709
|
}
|
|
710
|
-
`})),a(Li,"supportEditingModes",[...U.supportEditingModes,I.Rotation,I.Scale,I.DoublePoints,I.DoublePointsAppend,I.DoublePointsModify]);let ca=Li;const
|
|
710
|
+
`})),a(Li,"supportEditingModes",[...U.supportEditingModes,I.Rotation,I.Scale,I.DoublePoints,I.DoublePointsAppend,I.DoublePointsModify]);let ca=Li;const Ig={type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"Point",coordinates:[116.2,39.56]},properties:{title:"swimming","marker-symbol":"swimming","marker-color":"#8F1312"}},{type:"Feature",geometry:{type:"Point",coordinates:[115.2,38.56]},properties:{title:"8","marker-symbol":"8","marker-color":"#46117E"}},{type:"Feature",geometry:{type:"Point",coordinates:[114.2,37.56]},properties:{title:"6","marker-symbol":"6","marker-color":"#713291"}}]},xg=`properties是一个包含三个属性的对象,title表示标题,marker-symbol表示点位的文字内容,marker-color表示点位颜色,properties可以删除,然后使用场景对象属性设置。
|
|
711
711
|
\`\`\`
|
|
712
712
|
{
|
|
713
713
|
"type": "FeatureCollection",
|
|
@@ -824,7 +824,7 @@ ${da}
|
|
|
824
824
|
"position": [116.39, 39.9, 0],
|
|
825
825
|
"points": [[0, 0], [10, 0], [10, 10]]
|
|
826
826
|
}
|
|
827
|
-
`}));let Tn=As;const js=class js extends ti{constructor(s){super(s)}getESProperties(){const s={...super.getESProperties()};return{...s,coordinate:[...s.coordinate,new ie([this,"points"],"本地位置数组",[])]}}};a(js,"createDefaultProps",()=>({...ti.createDefaultProps(),points:
|
|
827
|
+
`}));let Tn=As;const js=class js extends ti{constructor(s){super(s)}getESProperties(){const s={...super.getESProperties()};return{...s,coordinate:[...s.coordinate,new ie([this,"points"],"本地位置数组",[])]}}};a(js,"createDefaultProps",()=>({...ti.createDefaultProps(),points:Nt(void 0),filled:!0})),a(js,"type",js.register("ESLocalPolygonZ",js,{chsName:"局部坐标多边形",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:`ESLocalPolygonZ 是用于在局部坐标系中创建和管理具有高度信息的三维多边形对象的可视化对象。
|
|
828
828
|
对象json示例:
|
|
829
829
|
{
|
|
830
830
|
"id": "localpolygonz_xxx",
|
|
@@ -842,7 +842,7 @@ ${da}
|
|
|
842
842
|
"position": [116.39, 39.9, 0],
|
|
843
843
|
"width": 500000
|
|
844
844
|
}
|
|
845
|
-
`}));let fa=Rs;const Tt=class Tt extends U{constructor(e){super(e);a(this,"editingBindMode","lineString");a(this,"_distance",this.dv(w(0)));a(this,"_deprecated",[{materialMode:{blue:"multipleArrows",purple:"singleArrow"}},"show"]);a(this,"_deprecatedWarningFunc",(()=>{this._deprecatedWarning()})());const t=()=>{if(this.points&&this.points.length>=2){const i=
|
|
845
|
+
`}));let fa=Rs;const Tt=class Tt extends U{constructor(e){super(e);a(this,"editingBindMode","lineString");a(this,"_distance",this.dv(w(0)));a(this,"_deprecated",[{materialMode:{blue:"multipleArrows",purple:"singleArrow"}},"show"]);a(this,"_deprecatedWarningFunc",(()=>{this._deprecatedWarning()})());const t=()=>{if(this.points&&this.points.length>=2){const i=zt(this.points,"GEODESIC"),r=i[i.length-1];this._distance.value=r}else this._distance.value=0};t(),this.d(this.pointsChanged.don(t))}get distance(){return this._distance.value}get distanceChanged(){return this._distance.changed}getESProperties(){const e={...super.getESProperties()};return{...e,defaultMenu:"basic",basic:[...e.basic,new f([this,"height"],"高度",10),new f([this,"width"],"宽度",10),new A([this,"materialMode"],Tt.materialModes,"模式",Tt.defaults.materialMode)],coordinate:[...e.coordinate,new f([this,"distance"],"距离",0,!1,!0)]}}};a(Tt,"createDefaultProps",()=>({...U.createDefaultProps(),height:10,width:10,materialMode:"singleArrow",filled:!0,stroked:!0,fillStyle:B({color:[1,0,.73,1],material:"",materialParams:{},ground:!1})})),a(Tt,"type",Tt.register("ESPipeFence",Tt,{chsName:"管道电子围栏",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:`ESPipeFence 是用于在三维场景中创建和管理管道状电子围栏的地理矢量对象。
|
|
846
846
|
对象json示例:
|
|
847
847
|
{
|
|
848
848
|
"id": "pipefence_xxx",
|
|
@@ -851,7 +851,7 @@ ${da}
|
|
|
851
851
|
"points": [[116.39, 39.9, 0], [116.40, 39.9, 0], [116.40, 39.91, 0]],
|
|
852
852
|
"height": 10
|
|
853
853
|
}
|
|
854
|
-
`})),a(Tt,"materialModes",[["单箭头","singleArrow"],["多箭头","multipleArrows"],["纯色","color"]]),a(Tt,"supportEditingModes",[...U.supportEditingModes,I.LineStringAppend,I.LineStringInsert]);let vr=Tt;const
|
|
854
|
+
`})),a(Tt,"materialModes",[["单箭头","singleArrow"],["多箭头","multipleArrows"],["纯色","color"]]),a(Tt,"supportEditingModes",[...U.supportEditingModes,I.LineStringAppend,I.LineStringInsert]);let vr=Tt;const Wt=class Wt extends Ue{constructor(e){super(e);a(this,"_setLayerVisibleEvent",this.dv(new v));a(this,"_setLayerColorEvent",this.dv(new v))}get setLayerVisibleEvent(){return this._setLayerVisibleEvent}setLayerVisible(e,t){this._setLayerVisibleEvent.emit(e,t)}get setLayerColorEvent(){return this._setLayerColorEvent}setLayerColor(e,t){this._setLayerColorEvent.emit(e,t)}getESProperties(){const e={...super.getESProperties()};return{...e,more:[...e.more,new k("ESPipeserTileset"),new L("设置图层可见性",this.setLayerVisible.bind(this),["",""],"setLayerVisible"),new L("设置图层颜色",this.setLayerColor.bind(this),["",""],"setLayerColor"),new A([this,"colorMode"],Wt.colorModes,"colorMode",Wt.defaults.colorMode,!0)]}}};a(Wt,"createDefaultProps",()=>({...Ue.createDefaultProps(),colorMode:"default"})),a(Wt,"type",Wt.register("ESPipeserTileset",Wt,{chsName:"PipeSer图层",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:`ESPipeserTileset 是专门用于管理和渲染 PipeSer 管线系统三维数据的 3D 瓦片集图层对象。
|
|
855
855
|
对象json示例:
|
|
856
856
|
{
|
|
857
857
|
"id": "pipesertileset_xxx",
|
|
@@ -860,7 +860,7 @@ ${da}
|
|
|
860
860
|
"url": "http://localhost:9004/tile/model/service/ortwkTiV/tileset.json",
|
|
861
861
|
"colorMode": "default"
|
|
862
862
|
}
|
|
863
|
-
`})),a(
|
|
863
|
+
`})),a(Wt,"colorModes",[["default","default"],["color","color"],["blend","blend"]]);let ma=Wt;const Ht=class Ht extends U{constructor(e){super(e);a(this,"editingBindMode","circular")}getESProperties(){const e={...super.getESProperties()};return{...e,defaultMenu:"basic",coordinate:[...e.coordinate,new f([this,"area"],"面积",0,!1,!0),new f([this,"perimeter"],"周长",0,!1,!0)],basic:[...e.basic,new f([this,"height"],"高度",10),new A([this,"materialMode"],Ht.materialModes,"模式","danger")]}}};a(Ht,"createDefaultProps",()=>({...U.createDefaultProps(),height:10,materialMode:"danger",filled:!0,collision:!1})),a(Ht,"type",Ht.register("ESPolygonFence",Ht,{chsName:"多边形电子围栏",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:`ESPolygonFence 是用于在三维场景中创建和管理多边形形状电子围栏的地理矢量对象。
|
|
864
864
|
对象json示例:
|
|
865
865
|
{
|
|
866
866
|
"id": "polygonfence_xxx",
|
|
@@ -870,7 +870,7 @@ ${da}
|
|
|
870
870
|
"height": 10,
|
|
871
871
|
"materialMode":"danger"
|
|
872
872
|
}
|
|
873
|
-
`})),a(
|
|
873
|
+
`})),a(Ht,"materialModes",[["模式一","danger"],["模式二","checkerboard"],["模式三","warning"],["模式四","cord"],["模式五","scanline"],["模式六","honeycomb"],["模式七","gradientColor"]]),a(Ht,"supportEditingModes",[...U.supportEditingModes,I.CircularAppend,I.CircularInsert,I.HeightModify]);let _r=Ht;const hi=class hi extends U{constructor(e){super(e);a(this,"_deprecated",["ground"]);a(this,"_deprecatedWarningFunc",(()=>{this._deprecatedWarning()})());a(this,"editingBindMode","doublePoints")}getESProperties(){const e={...super.getESProperties()};return{...e,more:[...e.more,new k("通用"),new E([this,"ground"],"是否贴地"),new E([this,"outlineTranslucent"],"轮廓线半透明"),new f([this,"height"],"高度"),new f([this,"extrudedHeight"],"拉伸高度"),new Fe([this,"rectangle"],"范围",hi.defaults.rectangle,!0),new f([this,"stRotation"],"纹理旋转角度"),new f([this,"rotation"],"旋转角度"),new E([this,"pointEditing"],"是否单点编辑")]}}};a(hi,"createDefaultProps",()=>({...U.createDefaultProps(),ground:!1,outlineTranslucent:!0,height:0,extrudedHeight:0,rectangle:q(void 0),rotation:0,stRotation:0,pointEditing:!1,filled:!0})),a(hi,"type",hi.register("ESRectangle",hi,{chsName:"矩形",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:`ESRectangle 是用于在三维场景中创建和管理矩形几何对象的地理矢量对象。
|
|
874
874
|
对象json示例:
|
|
875
875
|
{
|
|
876
876
|
"id": "rectangle_xxx",
|
|
@@ -1004,7 +1004,7 @@ ${da}
|
|
|
1004
1004
|
"points": [[116.39, 39.9, 0], [116.40, 39.9, 0], [116.40, 39.91, 0]],
|
|
1005
1005
|
"mode": "in"
|
|
1006
1006
|
}
|
|
1007
|
-
`}));let Oa=zs;function Ic(n){return n.startsWith("/")&&!n.startsWith("//")}function wr(n){var s;return!n||/^https?:\/\//i.test(n)?n:Ic(n)&&typeof globalThis<"u"&&((s=globalThis.location)!=null&&s.origin)?`${globalThis.location.origin}${n}`:n}function Er(n){var e;return(e=wr(n).match(/^(https?:\/\/[^/]+)/i))==null?void 0:e[1]}function xc(n){var e;return(e=wr(n).match(/^(https?:\/\/[^:]+)/i))==null?void 0:e[1]}function Pi(n){return n==="CesiumlabDesktop"?"/cim":""}function Oc(n){if(/\/cim\/ts\//.test(n))return"CesiumlabDesktop";if(/\/ts\/(?:info|tiles|featuretiles)\//.test(n))return"CIMRTS"}function Dc(n){const s=n.match(/(?:\/cim)?\/ts\/info\/([^?/]+)/);return s==null?void 0:s[1]}function xg(n,s,e){const t=Pi(s);return`${n}${t}/ts/info/${e}`}function Fc(n,s,e,t=Date.now()){const i=Pi(s);return`${n}${i}/ts/tiles/${e}/tileset.json?t=${t}`}function kc(n,s,e,t){const i=Pi(s);return`${n}${i}/ts/featuretiles/${e}/${t}/tileset.json`}const br={layerconfigfind:"/ts/layer/config/get",layerconfigsave:"/ts/layer/config/put",featureproperty:"/ts/editor/property",featureeditormuti:"/ts/editor/update",getts:"/ts/info"},Mc=async(n,s,e,t,i="CIMRTS")=>{try{const r=globalThis.localStorage.getItem("Authorization"),o=Pi(i);let l=n+`${o}${br.layerconfigfind}?tileServiceName=${s}`;e&&(l+=`&earthdstoken=${encodeURIComponent(t)}`);const h={headers:{...!e&&r?{Authorization:r}:{}},mode:"cors"},u=await(await fetch(l,h)).text();return JSON.parse(u)}catch(r){console.error(r)}},Ac=async(n,s,e,t,i,r="CIMRTS")=>{try{const o=globalThis.localStorage.getItem("Authorization"),l=Pi(r);let h=n+`${l}${br.layerconfigsave}`;const c=i??{};e&&(h+=`?earthdstoken=${encodeURIComponent(t)}`);const u={method:"POST",headers:{"Content-Type":"application/json",...!e&&o?{Authorization:o}:{}},mode:"cors",body:JSON.stringify({tileServiceName:s,layerConfig:JSON.stringify(c)})},g=await(await fetch(h,u)).text();return JSON.parse(g)}catch(o){console.error(o)}},jc=async(n,s,e)=>{try{const t=globalThis.localStorage.getItem("Authorization");let i=n;s&&(i+=`?earthdstoken=${encodeURIComponent(e)}`);const r={headers:{...!s&&t?{Authorization:t}:{}},mode:"cors"},l=await(await fetch(i,r)).text(),h=JSON.parse(l);if(h.status=="ok")return h.data.port;console.error(h.status);return}catch(t){console.error(t)}},Rc=async(n,s,e,t,i,r="CIMRTS")=>{try{const o={tileServiceName:s,featureId:e},l=globalThis.localStorage.getItem("Authorization"),h=Pi(r);let c=n+`${h}${br.featureproperty}`;t&&(c+=`?earthdstoken=${encodeURIComponent(i)}`);const p=await(await fetch(c,{method:"post",headers:{"Content-Type":"application/json",...!t&&l?{Authorization:l}:{}},body:JSON.stringify(o),mode:"cors"})).text(),g=JSON.parse(p);if(g.status=="ok")return g.data;console.error(g.data.status);return}catch(o){console.error(o)}},Us=class Us extends Ue{constructor(e){super(e);a(this,"_es3DTileset",this.dv(new Ue));a(this,"_ids",this.dv(B([])));a(this,"_platform",this.dv(w("CIMRTS")));a(this,"_visJson",this.disposeVar(w({})));a(this,"_highlightInner3DtilesetEvent",this.dv(new v));a(this,"_removeHighlightInner3DtilesetEvent",this.dv(new v));a(this,"_tilesetServePort",this.dv(w("")));this.collision=!1;{const t=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(()=>{t()})),this.d(this.platformChanged.don(()=>{t()}))}{this.d(this.components.disposableAdd(this._es3DTileset,!0));const t=this._es3DTileset;this.d(_([t,"allowPicking"],[this,"allowPicking"])),this.d(_([t,"collision"],[this,"collision"])),this.d(D([t,"flyToParam"],[this,"flyToParam"])),this.d(_([t,"actorTag"],[this,"actorTag"])),this.d(_([t,"materialMode"],[this,"materialMode"])),this.d(_([t,"highlight"],[this,"highlight"])),this.d(_([t,"maximumScreenSpaceError"],[this,"maximumScreenSpaceError"])),this.d(_([t,"highlightID"],[this,"highlightID"])),this.d(_([t,"highlightColor"],[this,"highlightColor"])),this.d(D([t,"offset"],[this,"offset"])),this.d(D([t,"rotation"],[this,"rotation"])),this.d(_([t,"czmImageBasedLightingFactor"],[this,"czmImageBasedLightingFactor"])),this.d(_([t,"czmLuminanceAtZenith"],[this,"czmLuminanceAtZenith"])),this.d(_([t,"czmMaximumMemoryUsage"],[this,"czmMaximumMemoryUsage"])),this.d(_([t,"czmClassificationType"],[this,"czmClassificationType"])),this.d(_([t,"czmStyleJson"],[this,"czmStyleJson"])),this.d(_([t,"czmBackFaceCulling"],[this,"czmBackFaceCulling"])),this.d(_([t,"czmDebugShowBoundingVolume"],[this,"czmDebugShowBoundingVolume"])),this.d(_([t,"czmDebugShowContentBoundingVolume"],[this,"czmDebugShowContentBoundingVolume"])),this.d(_([t,"czmSkipLevelOfDetail"],[this,"czmSkipLevelOfDetail"])),this.d(_([t,"colorBlendMode"],[this,"colorBlendMode"])),this.d(_([t,"cacheBytes"],[this,"cacheBytes"])),this.d(_([t,"clippingPlaneEnabled"],[this,"clippingPlaneEnabled"])),this.d(_([t,"unionClippingRegions"],[this,"unionClippingRegions"])),this.d(_([t,"clippingPlaneEdgeColor"],[this,"clippingPlaneEdgeColor"])),this.d(_([t,"clippingPlaneEdgeWidth"],[this,"clippingPlaneEdgeWidth"])),this.d(_([t,"materialParams"],[this,"materialParams"])),this.d(D([t,"supportEdit"],[this,"supportEdit"])),this.d(D([t,"clippingPlanesId"],[this,"clippingPlanesId"])),this.d(D([t,"clippingPlaneIds"],[this,"clippingPlaneIds"])),this.d(D([t,"flattenedPlaneId"],[this,"flattenedPlaneId"])),this.d(D([t,"flattenedPlaneEnabled"],[this,"flattenedPlaneEnabled"])),this.d(D([t,"clippingPlaneId"],[this,"clippingPlaneId"])),this.d(D([t,"excavateId"],[this,"excavateId"]))}{const t=this._es3DTileset;this.d(this.refreshTilesetEvent.don(()=>{t.refreshTileset()})),this.d(this.highlightFeatureEvent.don((...i)=>{t.highlightFeature(...i)})),this.d(this.highlightFeatureAndFlyToEvent.don((...i)=>{t.highlightFeatureAndFlyTo(...i)})),this.d(this.setFeatureColorEvent.don((...i)=>{t.setFeatureColor(...i)})),this.d(this.setFeatureVisableEvent.don((...i)=>{t.setFeatureVisable(...i)})),this.d(this.resetFeatureStyleEvent.don((...i)=>{t.resetFeatureStyle(...i)})),this.d(this.setFeatureStyleEvent.don((...i)=>{t.setFeatureStyle(...i)})),this.d(this.flyInEvent.don((...i)=>{t.flyIn(i[0])})),this.d(this.flyToEvent.don((...i)=>{t.flyTo(i[0])})),this.d(this.calcFlyToParamEvent.don((...i)=>{t.calcFlyToParam(...i)})),this.d(this.calcFlyInParamEvent.don((...i)=>{t.calcFlyInParam(...i)}))}{const t=this._es3DTileset;this.d(t.tilesetReady.don(i=>{this.tilesetReady.emit(i)})),this.d(t.pickedEvent.don(i=>{i.assign({sceneObject:this}),this.pickedEvent.emit(i)}))}{const t=()=>{this.es3DTileset.show=this.show};t(),this.d(this.showChanged.don(()=>{t()}))}}get es3DTileset(){return this._es3DTileset}get ids(){return this._ids.value}get idsChanged(){return this._ids.changed}set ids(e){this._ids.value=e}get platform(){return this._platform.value}get platformChanged(){return this._platform.changed}set platform(e){this._platform.value=e}get visJson(){return this._visJson.value}set visJson(e){this._visJson.value=e}get visJsonChanged(){return this._visJson.changed}setFeatureVisable(e,t){var i;if((i=this.layerConfig)!=null&&i.length){const r={};r[t[0].value]=t[0].visable,this.visJson={...this.visJson,...r}}else this.setFeatureVisableEvent.emit(e,typeof t=="string"?JSON.parse(t):t,!0)}async getFeatureProperty(e){return await Rc(this.baseUrl,this.tileServiceName,e,this.useEarthDSToken,this.earthdstoken,this.platform)}async getLayerConfig(){const e=await Mc(this.baseUrl,this.tileServiceName,this.useEarthDSToken,this.earthdstoken,this.platform);return!e||!Array.isArray(e)?this.layerConfig=[]:this.layerConfig=e,this.layerConfig}async saveLayerConfig(){const e=this.layerConfig;return await Ac(this.baseUrl,this.tileServiceName,this.useEarthDSToken,this.earthdstoken,e,this.platform)}get highlightInner3DtilesetEvent(){return this._highlightInner3DtilesetEvent}_highlightInner3Dtileset(e){this._highlightInner3DtilesetEvent.emit(e)}async highlightDSFeature(e){this._highlightInner3Dtileset(e)}get removeHighlightInner3DtilesetEvent(){return this._removeHighlightInner3DtilesetEvent}_removeHighlightInner3Dtileset(e){this._removeHighlightInner3DtilesetEvent.emit(e)}async removeHighlightDSFeature(e){this._removeHighlightInner3Dtileset(e)}async pickFeature(e,t){var l,h,c;const i=await e.pick(t),r=i.sceneObject;return!r||r.id!==this.id&&r.typeName!="ESRtsFeatureEditing"?void 0:r.typeName!="ESRtsFeatureEditing"?(this.ids=[...this.ids,(l=i==null?void 0:i.tilesetPickInfo)==null?void 0:l.id],{featureId:(h=i==null?void 0:i.tilesetPickInfo)==null?void 0:h.id,pickInnerFields:i==null?void 0:i.tilesetPickInfo}):{featureId:(c=i==null?void 0:i.sceneObject)==null?void 0:c.id,pickInnerFields:i==null?void 0:i.tilesetPickInfo}}get tilesetServePort(){return this._tilesetServePort.value}get tilesetServePortChanged(){return this._tilesetServePort.changed}set tilesetServePort(e){this._tilesetServePort.value=e}async getport(){const e=await jc(wr(this.url),this.useEarthDSToken,this.earthdstoken);if(e)return this.tilesetServePort=e,e;throw new Error("服务地址port获取失败!")}async refresh(){if(!this.url||typeof this.url!="string")return;const e=+new Date,t=Er(this.url);t&&(this.syncPlatformFromUrl(),this._es3DTileset.offset=[0,0,0],this._es3DTileset.rotation=[0,0,0],this._es3DTileset.url=Fc(t,this.platform,this.tileServiceName,e),console.log("3dtileset url:",this._es3DTileset.url))}syncPlatformFromUrl(){if(typeof this.url!="string"||!this.url)return;const e=Oc(this.url);e&&e!==this.platform&&(this._platform.value=e)}get baseUrl(){if(this.url&&typeof this.url=="string"){const e=Er(this.url);if(!e)throw new Error("服务地址不合法,baseUrl is not found! 示例: http://localhost:9009/ts/info/ts01 或 /ts/info/ts01");return e}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 e=Dc(this.url);if(!e)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 e}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 e=xc(this.url);if(!e)throw new Error("服务地址不合法,ip is not found! 示例: http://localhost:9009/ts/info/ts01 或 /ts/info/ts01");return e}else throw new Error("服务地址不合法,ip is not found! 示例: http://localhost:9009/ts/info/ts01 或 /ts/info/ts01")}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new ie([this,"layerConfig"],"图层配置",[],void 0,!0)]}}};a(Us,"createDefaultProps",()=>({...Ue.createDefaultProps(),layerConfig:te([]),isSameIP:!1,useEarthDSToken:!1,earthdstoken:""})),a(Us,"type",Us.register("ESRtsTileset",Us,{chsName:"CIMRTS实时3DTileset图层",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:`ESRtsTileset 是用于加载和管理实时3DTileset图层并提供要素高亮与拾取功能的对象。
|
|
1007
|
+
`}));let Oa=zs;function Ic(n){return n.startsWith("/")&&!n.startsWith("//")}function wr(n){var s;return!n||/^https?:\/\//i.test(n)?n:Ic(n)&&typeof globalThis<"u"&&((s=globalThis.location)!=null&&s.origin)?`${globalThis.location.origin}${n}`:n}function Er(n){var e;return(e=wr(n).match(/^(https?:\/\/[^/]+)/i))==null?void 0:e[1]}function xc(n){var e;return(e=wr(n).match(/^(https?:\/\/[^:]+)/i))==null?void 0:e[1]}function Pi(n){return n==="CesiumlabDesktop"?"/cim":""}function Oc(n){if(/\/cim\/ts\//.test(n))return"CesiumlabDesktop";if(/\/ts\/(?:info|tiles|featuretiles)\//.test(n))return"CIMRTS"}function Dc(n){const s=n.match(/(?:\/cim)?\/ts\/info\/([^?/]+)/);return s==null?void 0:s[1]}function Og(n,s,e){const t=Pi(s);return`${n}${t}/ts/info/${e}`}function Fc(n,s,e,t=Date.now()){const i=Pi(s);return`${n}${i}/ts/tiles/${e}/tileset.json?t=${t}`}function kc(n,s,e,t){const i=Pi(s);return`${n}${i}/ts/featuretiles/${e}/${t}/tileset.json`}const br={layerconfigfind:"/ts/layer/config/get",layerconfigsave:"/ts/layer/config/put",featureproperty:"/ts/editor/property",featureeditormuti:"/ts/editor/update",getts:"/ts/info"},Mc=async(n,s,e,t,i="CIMRTS")=>{try{const r=globalThis.localStorage.getItem("Authorization"),o=Pi(i);let l=n+`${o}${br.layerconfigfind}?tileServiceName=${s}`;e&&(l+=`&earthdstoken=${encodeURIComponent(t)}`);const h={headers:{...!e&&r?{Authorization:r}:{}},mode:"cors"},u=await(await fetch(l,h)).text();return JSON.parse(u)}catch(r){console.error(r)}},Ac=async(n,s,e,t,i,r="CIMRTS")=>{try{const o=globalThis.localStorage.getItem("Authorization"),l=Pi(r);let h=n+`${l}${br.layerconfigsave}`;const c=i??{};e&&(h+=`?earthdstoken=${encodeURIComponent(t)}`);const u={method:"POST",headers:{"Content-Type":"application/json",...!e&&o?{Authorization:o}:{}},mode:"cors",body:JSON.stringify({tileServiceName:s,layerConfig:JSON.stringify(c)})},g=await(await fetch(h,u)).text();return JSON.parse(g)}catch(o){console.error(o)}},jc=async(n,s,e)=>{try{const t=globalThis.localStorage.getItem("Authorization");let i=n;s&&(i+=`?earthdstoken=${encodeURIComponent(e)}`);const r={headers:{...!s&&t?{Authorization:t}:{}},mode:"cors"},l=await(await fetch(i,r)).text(),h=JSON.parse(l);if(h.status=="ok")return h.data.port;console.error(h.status);return}catch(t){console.error(t)}},Rc=async(n,s,e,t,i,r="CIMRTS")=>{try{const o={tileServiceName:s,featureId:e},l=globalThis.localStorage.getItem("Authorization"),h=Pi(r);let c=n+`${h}${br.featureproperty}`;t&&(c+=`?earthdstoken=${encodeURIComponent(i)}`);const p=await(await fetch(c,{method:"post",headers:{"Content-Type":"application/json",...!t&&l?{Authorization:l}:{}},body:JSON.stringify(o),mode:"cors"})).text(),g=JSON.parse(p);if(g.status=="ok")return g.data;console.error(g.data.status);return}catch(o){console.error(o)}},Us=class Us extends Ue{constructor(e){super(e);a(this,"_es3DTileset",this.dv(new Ue));a(this,"_ids",this.dv(B([])));a(this,"_platform",this.dv(w("CIMRTS")));a(this,"_visJson",this.disposeVar(w({})));a(this,"_highlightInner3DtilesetEvent",this.dv(new v));a(this,"_removeHighlightInner3DtilesetEvent",this.dv(new v));a(this,"_tilesetServePort",this.dv(w("")));this.collision=!1;{const t=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(()=>{t()})),this.d(this.platformChanged.don(()=>{t()}))}{this.d(this.components.disposableAdd(this._es3DTileset,!0));const t=this._es3DTileset;this.d(_([t,"allowPicking"],[this,"allowPicking"])),this.d(_([t,"collision"],[this,"collision"])),this.d(D([t,"flyToParam"],[this,"flyToParam"])),this.d(_([t,"actorTag"],[this,"actorTag"])),this.d(_([t,"materialMode"],[this,"materialMode"])),this.d(_([t,"highlight"],[this,"highlight"])),this.d(_([t,"maximumScreenSpaceError"],[this,"maximumScreenSpaceError"])),this.d(_([t,"highlightID"],[this,"highlightID"])),this.d(_([t,"highlightColor"],[this,"highlightColor"])),this.d(D([t,"offset"],[this,"offset"])),this.d(D([t,"rotation"],[this,"rotation"])),this.d(_([t,"czmImageBasedLightingFactor"],[this,"czmImageBasedLightingFactor"])),this.d(_([t,"czmLuminanceAtZenith"],[this,"czmLuminanceAtZenith"])),this.d(_([t,"czmMaximumMemoryUsage"],[this,"czmMaximumMemoryUsage"])),this.d(_([t,"czmClassificationType"],[this,"czmClassificationType"])),this.d(_([t,"czmStyleJson"],[this,"czmStyleJson"])),this.d(_([t,"czmBackFaceCulling"],[this,"czmBackFaceCulling"])),this.d(_([t,"czmDebugShowBoundingVolume"],[this,"czmDebugShowBoundingVolume"])),this.d(_([t,"czmDebugShowContentBoundingVolume"],[this,"czmDebugShowContentBoundingVolume"])),this.d(_([t,"czmSkipLevelOfDetail"],[this,"czmSkipLevelOfDetail"])),this.d(_([t,"colorBlendMode"],[this,"colorBlendMode"])),this.d(_([t,"cacheBytes"],[this,"cacheBytes"])),this.d(_([t,"clippingPlaneEnabled"],[this,"clippingPlaneEnabled"])),this.d(_([t,"unionClippingRegions"],[this,"unionClippingRegions"])),this.d(_([t,"clippingPlaneEdgeColor"],[this,"clippingPlaneEdgeColor"])),this.d(_([t,"clippingPlaneEdgeWidth"],[this,"clippingPlaneEdgeWidth"])),this.d(_([t,"materialParams"],[this,"materialParams"])),this.d(D([t,"supportEdit"],[this,"supportEdit"])),this.d(D([t,"clippingPlanesId"],[this,"clippingPlanesId"])),this.d(D([t,"clippingPlaneIds"],[this,"clippingPlaneIds"])),this.d(D([t,"flattenedPlaneId"],[this,"flattenedPlaneId"])),this.d(D([t,"flattenedPlaneEnabled"],[this,"flattenedPlaneEnabled"])),this.d(D([t,"clippingPlaneId"],[this,"clippingPlaneId"])),this.d(D([t,"excavateId"],[this,"excavateId"]))}{const t=this._es3DTileset;this.d(this.refreshTilesetEvent.don(()=>{t.refreshTileset()})),this.d(this.highlightFeatureEvent.don((...i)=>{t.highlightFeature(...i)})),this.d(this.highlightFeatureAndFlyToEvent.don((...i)=>{t.highlightFeatureAndFlyTo(...i)})),this.d(this.setFeatureColorEvent.don((...i)=>{t.setFeatureColor(...i)})),this.d(this.setFeatureVisableEvent.don((...i)=>{t.setFeatureVisable(...i)})),this.d(this.resetFeatureStyleEvent.don((...i)=>{t.resetFeatureStyle(...i)})),this.d(this.setFeatureStyleEvent.don((...i)=>{t.setFeatureStyle(...i)})),this.d(this.flyInEvent.don((...i)=>{t.flyIn(i[0])})),this.d(this.flyToEvent.don((...i)=>{t.flyTo(i[0])})),this.d(this.calcFlyToParamEvent.don((...i)=>{t.calcFlyToParam(...i)})),this.d(this.calcFlyInParamEvent.don((...i)=>{t.calcFlyInParam(...i)}))}{const t=this._es3DTileset;this.d(t.tilesetReady.don(i=>{this.tilesetReady.emit(i)})),this.d(t.pickedEvent.don(i=>{i.assign({sceneObject:this}),this.pickedEvent.emit(i)}))}{const t=()=>{this.es3DTileset.show=this.show};t(),this.d(this.showChanged.don(()=>{t()}))}}get es3DTileset(){return this._es3DTileset}get ids(){return this._ids.value}get idsChanged(){return this._ids.changed}set ids(e){this._ids.value=e}get platform(){return this._platform.value}get platformChanged(){return this._platform.changed}set platform(e){this._platform.value=e}get visJson(){return this._visJson.value}set visJson(e){this._visJson.value=e}get visJsonChanged(){return this._visJson.changed}setFeatureVisable(e,t){var i;if((i=this.layerConfig)!=null&&i.length){const r={};r[t[0].value]=t[0].visable,this.visJson={...this.visJson,...r}}else this.setFeatureVisableEvent.emit(e,typeof t=="string"?JSON.parse(t):t,!0)}async getFeatureProperty(e){return await Rc(this.baseUrl,this.tileServiceName,e,this.useEarthDSToken,this.earthdstoken,this.platform)}async getLayerConfig(){const e=await Mc(this.baseUrl,this.tileServiceName,this.useEarthDSToken,this.earthdstoken,this.platform);return!e||!Array.isArray(e)?this.layerConfig=[]:this.layerConfig=e,this.layerConfig}async saveLayerConfig(){const e=this.layerConfig;return await Ac(this.baseUrl,this.tileServiceName,this.useEarthDSToken,this.earthdstoken,e,this.platform)}get highlightInner3DtilesetEvent(){return this._highlightInner3DtilesetEvent}_highlightInner3Dtileset(e){this._highlightInner3DtilesetEvent.emit(e)}async highlightDSFeature(e){this._highlightInner3Dtileset(e)}get removeHighlightInner3DtilesetEvent(){return this._removeHighlightInner3DtilesetEvent}_removeHighlightInner3Dtileset(e){this._removeHighlightInner3DtilesetEvent.emit(e)}async removeHighlightDSFeature(e){this._removeHighlightInner3Dtileset(e)}async pickFeature(e,t){var l,h,c;const i=await e.pick(t),r=i.sceneObject;return!r||r.id!==this.id&&r.typeName!="ESRtsFeatureEditing"?void 0:r.typeName!="ESRtsFeatureEditing"?(this.ids=[...this.ids,(l=i==null?void 0:i.tilesetPickInfo)==null?void 0:l.id],{featureId:(h=i==null?void 0:i.tilesetPickInfo)==null?void 0:h.id,pickInnerFields:i==null?void 0:i.tilesetPickInfo}):{featureId:(c=i==null?void 0:i.sceneObject)==null?void 0:c.id,pickInnerFields:i==null?void 0:i.tilesetPickInfo}}get tilesetServePort(){return this._tilesetServePort.value}get tilesetServePortChanged(){return this._tilesetServePort.changed}set tilesetServePort(e){this._tilesetServePort.value=e}async getport(){const e=await jc(wr(this.url),this.useEarthDSToken,this.earthdstoken);if(e)return this.tilesetServePort=e,e;throw new Error("服务地址port获取失败!")}async refresh(){if(!this.url||typeof this.url!="string")return;const e=+new Date,t=Er(this.url);t&&(this.syncPlatformFromUrl(),this._es3DTileset.offset=[0,0,0],this._es3DTileset.rotation=[0,0,0],this._es3DTileset.url=Fc(t,this.platform,this.tileServiceName,e),console.log("3dtileset url:",this._es3DTileset.url))}syncPlatformFromUrl(){if(typeof this.url!="string"||!this.url)return;const e=Oc(this.url);e&&e!==this.platform&&(this._platform.value=e)}get baseUrl(){if(this.url&&typeof this.url=="string"){const e=Er(this.url);if(!e)throw new Error("服务地址不合法,baseUrl is not found! 示例: http://localhost:9009/ts/info/ts01 或 /ts/info/ts01");return e}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 e=Dc(this.url);if(!e)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 e}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 e=xc(this.url);if(!e)throw new Error("服务地址不合法,ip is not found! 示例: http://localhost:9009/ts/info/ts01 或 /ts/info/ts01");return e}else throw new Error("服务地址不合法,ip is not found! 示例: http://localhost:9009/ts/info/ts01 或 /ts/info/ts01")}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new ie([this,"layerConfig"],"图层配置",[],void 0,!0)]}}};a(Us,"createDefaultProps",()=>({...Ue.createDefaultProps(),layerConfig:te([]),isSameIP:!1,useEarthDSToken:!1,earthdstoken:""})),a(Us,"type",Us.register("ESRtsTileset",Us,{chsName:"CIMRTS实时3DTileset图层",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:`ESRtsTileset 是用于加载和管理实时3DTileset图层并提供要素高亮与拾取功能的对象。
|
|
1008
1008
|
对象json示例:
|
|
1009
1009
|
{
|
|
1010
1010
|
"id": "rtstileset_xxx",
|
|
@@ -1012,7 +1012,7 @@ ${da}
|
|
|
1012
1012
|
"name": "CIMRTS实时3DTileset图层",
|
|
1013
1013
|
"url": "http://localhost:9009/ts/info/ts01"
|
|
1014
1014
|
}
|
|
1015
|
-
`}));let Da=Us;function
|
|
1015
|
+
`}));let Da=Us;function Dg(n){return typeof n=="number"&&!isNaN(n)}const Bs=class Bs extends Ue{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(s){this._innerSetJson(s)}async init(s,e){this.featureId=e;const t=await s.getFeatureProperty(e);this.uiShowprops=t.props.map(l=>({featureClassName:l.name,fields:l.props?l.props.map(h=>({key:h.name,type:h.type,value:h.type!="double"?h.value:Dg(h.value)?Number(h.value.toFixed(3)):""})):[]})),this.datasetName=t.datasetName,s.setFeatureVisable("id",[{value:this.featureId,visable:!1}]),this.d(()=>{s.setFeatureVisable("id",[{value:this.featureId,visable:!0}])});const i=typeof s.url=="string"?s.url:"",r=Er(i),o=s.tileServiceName;if(!r)throw new Error("ESRtsFeatureEditing: 无法解析服务地址");this.url=kc(r,s.platform,o,this.featureId),this.allowPicking=!0,this.d(this.pickedEvent.don(l=>{l.assign({sceneObject:s}),s.pickedEvent.emit(l)})),this.d(()=>{this.editing=!1,s.removeHighlightDSFeature(this)})}constructor(s){super(s)}};a(Bs,"createDefaultProps",()=>({...Ue.createDefaultProps(),datasetName:void 0,featureId:void 0,materials:B({}),changeMaterial:te(void 0),uiShowprops:B({}),props:B({})})),a(Bs,"type",Bs.register("ESRtsFeatureEditing",Bs,{chsName:"ESRtsFeatureEditing",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"ESRtsFeatureEditing"}));let Fa=Bs;const Fg=async(n,s,e)=>{try{const t=globalThis.localStorage.getItem("Authorization");let i=n;s&&(i+=`?earthdstoken=${encodeURIComponent(e)}`);const r={headers:{...!s&&t?{Authorization:t}:{}},mode:"cors"},l=await(await fetch(i,r)).text(),h=JSON.parse(l);if(h.status=="ok")return h.data.port;console.error(h.status);return}catch(t){console.error(t)}};function kg(n){return n==="CesiumlabDesktop"?"/osgb":""}function Mg(n){if(/\/osgb\/ts\//.test(n))return"CesiumlabDesktop";if(/\/ts\/(?:info|tiles|featuretiles)\//.test(n))return"CIMRTS"}function Nc(n){const s=n.match(/(?:\/osgb)?\/ts\/info\/([^?/]+)/);return s==null?void 0:s[1]}function Ag(n,s,e,t=Date.now()){const i=kg(e);return`${n}:${s}${i}/tiles/tileset.json?t=${t}`}const Ws=class Ws extends Ue{constructor(e){super(e);a(this,"_es3DTileset",this.dv(new Ue));a(this,"_platform",this.dv(w("CIMRTS")));a(this,"_tilesetServePort",this.dv(w("")));this.collision=!1;{const t=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(()=>{t()})),this.d(this.platformChanged.don(()=>{t()}))}{this.d(this.components.disposableAdd(this._es3DTileset,!0));const t=this._es3DTileset;this.d(_([t,"allowPicking"],[this,"allowPicking"])),this.d(_([t,"collision"],[this,"collision"])),this.d(D([t,"flyToParam"],[this,"flyToParam"])),this.d(_([t,"actorTag"],[this,"actorTag"])),this.d(_([t,"materialMode"],[this,"materialMode"])),this.d(_([t,"highlight"],[this,"highlight"])),this.d(_([t,"maximumScreenSpaceError"],[this,"maximumScreenSpaceError"])),this.d(_([t,"highlightID"],[this,"highlightID"])),this.d(_([t,"highlightColor"],[this,"highlightColor"])),this.d(D([t,"offset"],[this,"offset"])),this.d(D([t,"rotation"],[this,"rotation"])),this.d(_([t,"czmImageBasedLightingFactor"],[this,"czmImageBasedLightingFactor"])),this.d(_([t,"czmLuminanceAtZenith"],[this,"czmLuminanceAtZenith"])),this.d(_([t,"czmMaximumMemoryUsage"],[this,"czmMaximumMemoryUsage"])),this.d(_([t,"czmClassificationType"],[this,"czmClassificationType"])),this.d(_([t,"czmStyleJson"],[this,"czmStyleJson"])),this.d(_([t,"czmBackFaceCulling"],[this,"czmBackFaceCulling"])),this.d(_([t,"czmDebugShowBoundingVolume"],[this,"czmDebugShowBoundingVolume"])),this.d(_([t,"czmDebugShowContentBoundingVolume"],[this,"czmDebugShowContentBoundingVolume"])),this.d(_([t,"czmSkipLevelOfDetail"],[this,"czmSkipLevelOfDetail"])),this.d(_([t,"colorBlendMode"],[this,"colorBlendMode"])),this.d(_([t,"cacheBytes"],[this,"cacheBytes"])),this.d(_([t,"clippingPlaneEnabled"],[this,"clippingPlaneEnabled"])),this.d(_([t,"unionClippingRegions"],[this,"unionClippingRegions"])),this.d(_([t,"clippingPlaneEdgeColor"],[this,"clippingPlaneEdgeColor"])),this.d(_([t,"clippingPlaneEdgeWidth"],[this,"clippingPlaneEdgeWidth"])),this.d(_([t,"materialParams"],[this,"materialParams"])),this.d(D([t,"supportEdit"],[this,"supportEdit"])),this.d(D([t,"clippingPlanesId"],[this,"clippingPlanesId"])),this.d(D([t,"clippingPlaneIds"],[this,"clippingPlaneIds"])),this.d(D([t,"flattenedPlaneId"],[this,"flattenedPlaneId"])),this.d(D([t,"flattenedPlaneEnabled"],[this,"flattenedPlaneEnabled"])),this.d(D([t,"clippingPlaneId"],[this,"clippingPlaneId"])),this.d(D([t,"excavateId"],[this,"excavateId"]))}{const t=this._es3DTileset;this.d(this.refreshTilesetEvent.don(()=>{t.refreshTileset()})),this.d(this.highlightFeatureEvent.don((...i)=>{t.highlightFeature(...i)})),this.d(this.highlightFeatureAndFlyToEvent.don((...i)=>{t.highlightFeatureAndFlyTo(...i)})),this.d(this.setFeatureColorEvent.don((...i)=>{t.setFeatureColor(...i)})),this.d(this.setFeatureVisableEvent.don((...i)=>{t.setFeatureVisable(...i)})),this.d(this.resetFeatureStyleEvent.don((...i)=>{t.resetFeatureStyle(...i)})),this.d(this.setFeatureStyleEvent.don((...i)=>{t.setFeatureStyle(...i)})),this.d(this.flyInEvent.don((...i)=>{t.flyIn(i[0])})),this.d(this.flyToEvent.don((...i)=>{t.flyTo(i[0])})),this.d(this.calcFlyToParamEvent.don((...i)=>{t.calcFlyToParam(...i)})),this.d(this.calcFlyInParamEvent.don((...i)=>{t.calcFlyInParam(...i)}))}{const t=this._es3DTileset;this.d(t.tilesetReady.don(i=>{this.tilesetReady.emit(i)})),this.d(t.pickedEvent.don(i=>{i.assign({sceneObject:this}),this.pickedEvent.emit(i)}))}{const t=()=>{this.es3DTileset.show=this.show};t(),this.d(this.showChanged.don(()=>{t()}))}}get es3DTileset(){return this._es3DTileset}get platform(){return this._platform.value}get platformChanged(){return this._platform.changed}set platform(e){this._platform.value=e}get tilesetServePort(){return this._tilesetServePort.value}get tilesetServePortChanged(){return this._tilesetServePort.changed}set tilesetServePort(e){this._tilesetServePort.value=e}async getport(){const e=await Fg(this.url,this.useEarthDSToken,this.earthdstoken);if(e)return this.tilesetServePort=e,e;throw new Error("服务地址port获取失败!")}async refresh(){if(!this.url||typeof this.url!="string"||!Nc(this.url))return;const t=+new Date;this.syncPlatformFromUrl();const i=await this.getport(),r=this.tileServiceIp;this._es3DTileset.offset=[0,0,0],this._es3DTileset.rotation=[0,0,0],this._es3DTileset.url=Ag(r,i,this.platform,t),console.log("3dtileset url:",this._es3DTileset.url)}syncPlatformFromUrl(){if(typeof this.url!="string"||!this.url)return;const e=Mg(this.url);e&&e!==this.platform&&(this._platform.value=e)}get baseUrl(){var e;if(this.url&&typeof this.url=="string"){const t=(e=this.url.match(/^(https?:\/\/[^\/]+)/))==null?void 0:e[1];if(!t)throw new Error("服务地址不合法,baseUrl is not found! 示例: http://localhost:9009/ts/info/ms01");return t}else throw new Error("服务地址不合法,baseUrl is not found! 示例: http://localhost:9009/ts/info/ms01")}get tileServiceIp(){var e;if(this.url&&typeof this.url=="string"){const t=(e=this.url.match(/^(https?:\/\/[^:]+)/))==null?void 0:e[1];if(!t)throw new Error("服务地址不合法,ip is not found! 示例: http://localhost:9009/ts/info/ms01");return t}else throw new Error("服务地址不合法,ip is not found! 示例: http://localhost:9009/ts/info/ms01")}get tileServiceName(){if(this.url&&typeof this.url=="string"){const e=Nc(this.url);if(!e)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 e}else throw new Error("服务地址不合法,tileServiceName is not found! 示例: http://localhost:9009/ts/info/ms01 或 http://localhost:9109/osgb/ts/info/ms01")}};a(Ws,"createDefaultProps",()=>({...Ue.createDefaultProps(),isSameIP:!1,useEarthDSToken:!1,earthdstoken:""})),a(Ws,"type",Ws.register("ESMsTileset",Ws,{chsName:"Modelser实时3DTileset图层",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:`ESMsTileset 是用于加载和操作 Modelser 实时 3D Tiles 图层的对象。
|
|
1016
1016
|
对象json示例:
|
|
1017
1017
|
{
|
|
1018
1018
|
"id": "mstileset_xxx",
|
|
@@ -1085,7 +1085,7 @@ ${da}
|
|
|
1085
1085
|
"playing": true,
|
|
1086
1086
|
"speed": 1
|
|
1087
1087
|
}
|
|
1088
|
-
`}));let _s=$s;function Vc(n,s=!1){const e=n.map(i=>[i[0],[...i[1]],i[2]?[...i[2]]:void 0]),t=e.length;if(t===0)return e;if(t===1)return(!e[0][2]===void 0||s)&&(e[0][2]=void 0),e;for(let i=1;i<t;++i){if(e[i][2]!==void 0&&!s)continue;const r=e[i-1][1],o=e[i][1],l=rt(r),h=rt(o),c=d.Vector.distance(l,h);if(c===0){e[i][2]=e[i-1][2];continue}const u=En(r,o),p=o[2]-r[2],g=Math.asin(p/c)*180/Math.PI,m=Number.isFinite(u)?u:0,y=Number.isFinite(g)?g:0;e[i][2]=[m,y,0]}return(e[0][2]===void 0||s)&&(e[0][2]=t>1?e[1][2]:void 0),e}function zc(n,s=!1){const e=n.map(i=>[i[0],[...i[1]],i[2]?[...i[2]]:void 0]),t=e.length;if(t===0)return e;if(t===1)return(!e[0][2]===void 0||s)&&(e[0][2]=void 0),e;for(let i=t-2;i>=0;--i){if(e[i][2]!==void 0&&!s)continue;const r=e[i][1],o=e[i+1][1],l=rt(r),h=rt(o),c=d.Vector.distance(l,h);if(c===0){e[i][2]=e[i+1][2];continue}const u=En(r,o),p=o[2]-r[2],g=Math.asin(p/c)*180/Math.PI,m=Number.isFinite(u)?u:0,y=Number.isFinite(g)?g:0;e[i][2]=[m,y,0]}return(e[t-1][2]===void 0||s)&&(e[t-1][2]=t>1?e[t-2][2]:[0,0,0]),e}function
|
|
1088
|
+
`}));let _s=$s;function Vc(n,s=!1){const e=n.map(i=>[i[0],[...i[1]],i[2]?[...i[2]]:void 0]),t=e.length;if(t===0)return e;if(t===1)return(!e[0][2]===void 0||s)&&(e[0][2]=void 0),e;for(let i=1;i<t;++i){if(e[i][2]!==void 0&&!s)continue;const r=e[i-1][1],o=e[i][1],l=rt(r),h=rt(o),c=d.Vector.distance(l,h);if(c===0){e[i][2]=e[i-1][2];continue}const u=En(r,o),p=o[2]-r[2],g=Math.asin(p/c)*180/Math.PI,m=Number.isFinite(u)?u:0,y=Number.isFinite(g)?g:0;e[i][2]=[m,y,0]}return(e[0][2]===void 0||s)&&(e[0][2]=t>1?e[1][2]:void 0),e}function zc(n,s=!1){const e=n.map(i=>[i[0],[...i[1]],i[2]?[...i[2]]:void 0]),t=e.length;if(t===0)return e;if(t===1)return(!e[0][2]===void 0||s)&&(e[0][2]=void 0),e;for(let i=t-2;i>=0;--i){if(e[i][2]!==void 0&&!s)continue;const r=e[i][1],o=e[i+1][1],l=rt(r),h=rt(o),c=d.Vector.distance(l,h);if(c===0){e[i][2]=e[i+1][2];continue}const u=En(r,o),p=o[2]-r[2],g=Math.asin(p/c)*180/Math.PI,m=Number.isFinite(u)?u:0,y=Number.isFinite(g)?g:0;e[i][2]=[m,y,0]}return(e[t-1][2]===void 0||s)&&(e[t-1][2]=t>1?e[t-2][2]:[0,0,0]),e}function jg(n,s=!1){const e=Vc(n,s),t=zc(n,s);if(e.length!==t.length)throw new Error("p.length !== n.length");const i=e.length;for(let r=0;r<i;r++){const o=e[r][2],l=t[r][2];o===void 0&&l===void 0?e[r][2]=void 0:o===void 0?e[r][2]=l:l===void 0?e[r][2]=o:e[r][2]=bo(o,l,.5)}return e}function Rg(n,s,e){let i;if(!n.timePosRots)return;const r=[],o=n.timePosRots.length;if(!(o<=2)){r.push(n.timePosRots[0]);for(let l=1;l<o-1;++l){const h=n.timePosRots[l-1][0],c=n.timePosRots[l][0],u=n.timePosRots[l+1][0],p=n.accumDistances[l-1],g=n.accumDistances[l],m=n.accumDistances[l+1],y=g-p;if(y!==0){const C=y-(i??(s.length==1?s[0]:s[l-1]||s[s.length-1])*.5);let T=(C<0?0:C)/y;Number.isNaN(T)&&(T=0);const V=(1-T)*h+T*c,z=n.getCurrent(V);z&&r.push([V,z.position,z.rotation])}e&&r.push(n.timePosRots[l]);const S=m-g;if(S!==0){let C=(s.length==1?s[0]:s[l-1]||s[s.length-1])*.5;const T=(s.length==1?s[0]:s[l]||s[s.length-1])*.5||0;C+T>S?(C=S*(C/(C+T)),i=S-C):i=void 0;let V=(C<0?0:C)/S;Number.isNaN(V)&&(V=0);const z=(1-V)*c+V*u,x=n.getCurrent(z);x&&r.push([z,x.position,x.rotation])}}r.push(n.timePosRots[o-1]),n.timePosRots=r}}function Uc(n,s){if(s<0)return[void 0,0];if(s>n.length-1)return[void 0,n.length-1];const e=[...n].slice(0,s+1).reverse().findIndex(i=>!!(i!=null&&i[2]));if(e===-1)return[void 0,0];const t=s-e;return[n[t][2],t]}function Bc(n,s){if(s<0)return[void 0,0];if(s>=n.length)return[void 0,n.length-1];const e=n.slice(s).findIndex(([,,i])=>i!==void 0),t=e===-1?n.length-1:s+e;return[n[t][2],t]}function Ng(n,s,e="Lerp"){let t,i,r,o;if(n.length!==0){if(s<=n[0][0])t=n[0][1],i=n[0][2],r=0,o=0;else if(s>=n[n.length-1][0]){const[h,c,u]=n[n.length-1];t=c,i=u,r=n.length-2,o=1}else{const h=n.findIndex(([c])=>s<=c);if(h===-1)throw new Error("nextIndex === -1");r=h-1;{const[c,u]=n[r],[p,g]=n[h],m=(s-c)/(p-c),y=xo(u),S=xo(g),C=d.Vector.lerp(y,S,m);t=Co(C),o=m}{let[c,u]=Uc(n,r),[p,g]=Bc(n,h);if(e==="Lerp")if(c&&p){if(u<0||g>=n.length)throw new Error("Invalid rotation index");const m=(s-n[u][0])/(n[g][0]-n[u][0]);i=bo(c,p,m)}else c?i=c:p?i=p:i=void 0;else e==="Prev"?c&&(i=c):e==="Next"&&p&&(i=p)}}return{position:t,rotation:i,index:r,ratio:o}}}function Lg(n){try{const s=JSON.parse(n);if(Array.isArray(s)&&s.length>0){const e=typeof s[0][0]=="number",t=Array.isArray(s[0][1])&&s[0][1].length===3;return e&&t?s:void 0}throw new Error("解析有问题")}catch{const e=n.split(/\n|\r\n/),t=[],i=e.length;for(let r=0;r<i;++r){const o=e[r],l=o.split(/[^0-9e\.\+\-]+/).filter(h=>h!=="").map(h=>+h);l.length<4?console.warn(`第${r+1}行数据无法解析成路径的数据, 原内容为: ${o}`):l.length<7?t.push([l[0],[l[1],l[2],l[3]],void 0]):t.push([l[0],[l[1],l[2],l[3]],[l[4],l[5],l[6]]])}return t}}function Vg(n,s,e){const{timePosRots:t}=n;if(!t)throw new Error("!timePosRots");if(t.length===0)throw new Error("timePosRots.length === 0");s=Math.max(s,t[0][0]),e=Math.min(e,t[t.length-1][0]);const i=n.getCurrent(s),r=n.getCurrent(e);if(!i||!r)return;const o=[];i.ratio<1&&o.push([s,i.position,i.rotation]);for(let l=i.index+1;l<=r.index;++l)o.push(t[l]);return r.ratio>0&&o.push([e,r.position,r.rotation]),o}const zg=`
|
|
1089
1089
|
timePosRots是一个内部包含三个元素的数组,第一个表示时间戳,单位毫秒,第二个表示经纬度,第三个表示姿态(偏航、俯仰、翻转)。示例代码如下:
|
|
1090
1090
|
\`\`\`
|
|
1091
1091
|
[
|
|
@@ -1130,7 +1130,7 @@ timePosRots是一个内部包含三个元素的数组,第一个表示时间戳
|
|
|
1130
1130
|
]
|
|
1131
1131
|
]
|
|
1132
1132
|
\`\`\`
|
|
1133
|
-
`,Oe=class Oe extends b{constructor(e,t){super();a(this,"_scratchCurrentInfo",{position:[0,0,0],rotation:[0,0,0],index:0});a(this,"_currentInfo",this.disposeVar(w(void 0,(e,t)=>!1)));a(this,"_player");a(this,"_flyToEvent",this.disposeVar(new v));a(this,"_accumDistancesChanged",this.disposeVar(new v));a(this,"_accumDistancesChangedInit",this.dispose(this.timePosRotsChanged.disposableOn(()=>(this._accumDistancesDirty=!0,this._accumDistancesChanged.emit()))));a(this,"_accumDistancesDirty",!1);a(this,"_accumDistances",[]);a(this,"_getCurrentFunc",this.disposeVar(w(void 0)));this._player=this.disposeVar(new Ye);const i=()=>{const r=this.getCurrent(this.currentTime??0);if(r===void 0)this._currentInfo.value=void 0;else{const{index:o,position:l,rotation:h,ratio:c}=r;this._scratchCurrentInfo.index=o,this._scratchCurrentInfo.position=l,this._scratchCurrentInfo.rotation=h,this._scratchCurrentInfo.ratio=c,this._currentInfo.value=this._scratchCurrentInfo}};i(),this.currentTimeChanged.disposableOn(i),this.timePosRotsChanged.disposableOn(i),this.rotLerpModeChanged.disposableOn(i),this.dispose(D([this._player,"loop"],[this,"loop"]));{const r=()=>{if(this.startTime===void 0||this.currentTime===void 0)return;const o=this.currentTime-this.startTime;(this._player.currentTime===void 0||Math.abs(o-this._player.currentTime)>.01)&&(this._player.currentTime=o)};r(),this.dispose(this.currentTimeChanged.disposableOn(r))}{const r=()=>{if(this.startTime===void 0||this._player.currentTime===void 0)return;const o=this._player.currentTime+this.startTime;(this.currentTime===void 0||Math.abs(o-this.currentTime)>.01)&&(this.currentTime=o)};r(),this.dispose(this._player.currentTimeChanged.disposableOn(r))}this.dispose(D([this._player,"duration"],[this,"duration"])),this.dispose(D([this._player,"playing"],[this,"playing"])),this.dispose(D([this._player,"speed"],[this,"speed"]));{const r=()=>{(this.autoComputeTimeFromTimePosRots??!0)&&this.computeTimeFromTimePosRots()};r();const o=this.disposeVar(oe(this.autoComputeTimeFromTimePosRotsChanged,this.timePosRotsChanged));this.dispose(o.disposableOn(r))}{const r=()=>{const o=this.timePosRots;if(!o)return;let l=0;const h=o.length;for(let c=0;c<h;++c){const u=o[c][0];if(u<0)console.warn("地理路径的时间戳不能小于0!");else if(u<l){console.warn(`地理路径的时间戳需要满足从小到大的数据,元素越靠后,时间越靠后!当前不满足条件的元素是index: ${c} time: ${u}`);break}}};r(),this.dispose(this.timePosRotsChanged.disposableOn(r))}{const r=this.disposeVar(Le(async o=>{if(!this.dataUri)return;await o.promise(un(1e3));const l=await o.promise(fetch(this.dataUri)),h=await o.promise(l.text());this.timePosRots=Oe.parseData(h)}));this.dispose(this.dataUriChanged.disposableOn(()=>{r.restart()})),this.dispose(this.dataTextChanged.disposableOn(()=>{this.dataText&&(this.timePosRots=Oe.parseData(this.dataText))}))}}get currentInfo(){return this._currentInfo.value}get currentInfoChanged(){return this._currentInfo.changed}get currentIndex(){return this._currentInfo.value&&this._currentInfo.value.index}get currentIndexChanged(){return this._currentInfo.changed}get currentPosition(){return this._currentInfo.value&&this._currentInfo.value.position}get currentPositionChanged(){return this._currentInfo.changed}get currentRotation(){return this._currentInfo.value&&this._currentInfo.value.rotation}get currentRotationChanged(){return this._currentInfo.changed}get player(){return this._player}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get accumDistancesChanged(){return this._accumDistancesChanged}get accumDistances(){if(!this._accumDistancesDirty)return this._accumDistances;if(!this.timePosRots||this.timePosRots.length<2)this._accumDistances=[];else{const e=this.timePosRots.length;let t=0;const i=[];let r=rt(this.timePosRots[0][1]);i.push(t);for(let o=1;o<e;++o){const l=rt(this.timePosRots[o][1]),h=d.Vector.distance(l,r);r=l,t+=h,i.push(t)}this._accumDistances=i}return this._accumDistances}get totalDistanceChanged(){return this._accumDistancesChanged}get totalDistance(){return this.accumDistances.length>0?this.accumDistances[this.accumDistances.length-1]:0}getCurrent(e){return this.getCurrentFunc?this.getCurrentFunc(e,this):this.timePosRots&&
|
|
1133
|
+
`,Oe=class Oe extends b{constructor(e,t){super();a(this,"_scratchCurrentInfo",{position:[0,0,0],rotation:[0,0,0],index:0});a(this,"_currentInfo",this.disposeVar(w(void 0,(e,t)=>!1)));a(this,"_player");a(this,"_flyToEvent",this.disposeVar(new v));a(this,"_accumDistancesChanged",this.disposeVar(new v));a(this,"_accumDistancesChangedInit",this.dispose(this.timePosRotsChanged.disposableOn(()=>(this._accumDistancesDirty=!0,this._accumDistancesChanged.emit()))));a(this,"_accumDistancesDirty",!1);a(this,"_accumDistances",[]);a(this,"_getCurrentFunc",this.disposeVar(w(void 0)));this._player=this.disposeVar(new Ye);const i=()=>{const r=this.getCurrent(this.currentTime??0);if(r===void 0)this._currentInfo.value=void 0;else{const{index:o,position:l,rotation:h,ratio:c}=r;this._scratchCurrentInfo.index=o,this._scratchCurrentInfo.position=l,this._scratchCurrentInfo.rotation=h,this._scratchCurrentInfo.ratio=c,this._currentInfo.value=this._scratchCurrentInfo}};i(),this.currentTimeChanged.disposableOn(i),this.timePosRotsChanged.disposableOn(i),this.rotLerpModeChanged.disposableOn(i),this.dispose(D([this._player,"loop"],[this,"loop"]));{const r=()=>{if(this.startTime===void 0||this.currentTime===void 0)return;const o=this.currentTime-this.startTime;(this._player.currentTime===void 0||Math.abs(o-this._player.currentTime)>.01)&&(this._player.currentTime=o)};r(),this.dispose(this.currentTimeChanged.disposableOn(r))}{const r=()=>{if(this.startTime===void 0||this._player.currentTime===void 0)return;const o=this._player.currentTime+this.startTime;(this.currentTime===void 0||Math.abs(o-this.currentTime)>.01)&&(this.currentTime=o)};r(),this.dispose(this._player.currentTimeChanged.disposableOn(r))}this.dispose(D([this._player,"duration"],[this,"duration"])),this.dispose(D([this._player,"playing"],[this,"playing"])),this.dispose(D([this._player,"speed"],[this,"speed"]));{const r=()=>{(this.autoComputeTimeFromTimePosRots??!0)&&this.computeTimeFromTimePosRots()};r();const o=this.disposeVar(oe(this.autoComputeTimeFromTimePosRotsChanged,this.timePosRotsChanged));this.dispose(o.disposableOn(r))}{const r=()=>{const o=this.timePosRots;if(!o)return;let l=0;const h=o.length;for(let c=0;c<h;++c){const u=o[c][0];if(u<0)console.warn("地理路径的时间戳不能小于0!");else if(u<l){console.warn(`地理路径的时间戳需要满足从小到大的数据,元素越靠后,时间越靠后!当前不满足条件的元素是index: ${c} time: ${u}`);break}}};r(),this.dispose(this.timePosRotsChanged.disposableOn(r))}{const r=this.disposeVar(Le(async o=>{if(!this.dataUri)return;await o.promise(un(1e3));const l=await o.promise(fetch(this.dataUri)),h=await o.promise(l.text());this.timePosRots=Oe.parseData(h)}));this.dispose(this.dataUriChanged.disposableOn(()=>{r.restart()})),this.dispose(this.dataTextChanged.disposableOn(()=>{this.dataText&&(this.timePosRots=Oe.parseData(this.dataText))}))}}get currentInfo(){return this._currentInfo.value}get currentInfoChanged(){return this._currentInfo.changed}get currentIndex(){return this._currentInfo.value&&this._currentInfo.value.index}get currentIndexChanged(){return this._currentInfo.changed}get currentPosition(){return this._currentInfo.value&&this._currentInfo.value.position}get currentPositionChanged(){return this._currentInfo.changed}get currentRotation(){return this._currentInfo.value&&this._currentInfo.value.rotation}get currentRotationChanged(){return this._currentInfo.changed}get player(){return this._player}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get accumDistancesChanged(){return this._accumDistancesChanged}get accumDistances(){if(!this._accumDistancesDirty)return this._accumDistances;if(!this.timePosRots||this.timePosRots.length<2)this._accumDistances=[];else{const e=this.timePosRots.length;let t=0;const i=[];let r=rt(this.timePosRots[0][1]);i.push(t);for(let o=1;o<e;++o){const l=rt(this.timePosRots[o][1]),h=d.Vector.distance(l,r);r=l,t+=h,i.push(t)}this._accumDistances=i}return this._accumDistances}get totalDistanceChanged(){return this._accumDistancesChanged}get totalDistance(){return this.accumDistances.length>0?this.accumDistances[this.accumDistances.length-1]:0}getCurrent(e){return this.getCurrentFunc?this.getCurrentFunc(e,this):this.timePosRots&&Ng(this.timePosRots,e,this.rotLerpMode)}subPath(e,t){return this.timePosRots&&Vg(this,e,t)}computeRotIfUndefinedUsingPrevLine(e=!1){if(!this.timePosRots){console.warn("timePosRots不存在,无法计算!");return}this.timePosRots=Oe.computeRotIfUndefinedUsingPrevLine(this.timePosRots,e)}computeRotIfUndefinedUsingNextLine(e=!1){if(!this.timePosRots){console.warn("timePosRots不存在,无法计算!");return}this.timePosRots=Oe.computeRotIfUndefinedUsingNextLine(this.timePosRots,e)}computeRotIfUndefinedUsingLerp(e=!1){if(!this.timePosRots){console.warn("timePosRots不存在,无法计算!");return}this.timePosRots=Oe.computeRotIfUndefinedUsingLerp(this.timePosRots,e)}computeRotIfUndefined(e=!1){this.computeRotIfUndefinedUsingPrevLine(e)}addAroundPoints(e,t){Rg(this,e,t)}get getCurrentFunc(){return this._getCurrentFunc.value}set getCurrentFunc(e){this._getCurrentFunc.value=e}get getCurrentFuncChanged(){return this._getCurrentFunc.changed}computeTimeFromTimePosRots(){const e=this.timePosRots;if(!e||e.length<=1){this.startTime=void 0,this.stopTime=void 0,this.duration=void 0;return}this.startTime=e[0][0],this.stopTime=e[e.length-1][0],this.duration=this.stopTime-this.startTime}get ratio(){return this.player.ratio}set ratio(e){this.player.ratio=e}get ratioChanged(){return this.player.ratioChanged}};a(Oe,"computeRotIfUndefinedUsingPrevLine",Vc),a(Oe,"computeRotIfUndefinedUsingNextLine",zc),a(Oe,"computeRotIfUndefinedUsingLerp",jg),a(Oe,"getLeftRotation",Uc),a(Oe,"getRightRotation",Bc),a(Oe,"parseData",Lg),a(Oe,"defaults",{timePosRots:[],startTime:0,stopTime:3e3,loop:!1,duration:3e3,playing:!1,dataText:""}),a(Oe,"timePosRotsMd",zg);let ii=Oe;(n=>{n.createDefaultProps=()=>({show:!1,currentPoiShow:!0,timePosRots:Yt(void 0,(s,e)=>s[0]===e[0]&&s[1].every((t,i)=>t===e[1][i])&&s[2]===e[2]===void 0||s[2]!==void 0&&e[2]!==void 0&&s[2].every((t,i)=>e[2][i]),s=>[s[0],[...s[1]],s[2]&&[...s[2]]||void 0]),autoComputeTimeFromTimePosRots:!0,leadTime:0,trailTime:0,startTime:void 0,stopTime:void 0,loop:!1,currentTime:0,duration:void 0,speed:1,playing:!1,polylineShow:!0,width:1,ground:!1,color:F([1,1,1,1]),hasDash:!1,gapColor:F([0,0,0,0]),dashLength:16,dashPattern:255,depthTest:!1,arcType:"GEODESIC",allowPicking:!1,dataUri:"",dataText:void 0,rotLerpMode:"Lerp",debug:!1})})(ii||(ii={})),Kt(ii.prototype,ii.createDefaultProps);const Hi=class Hi extends ve{constructor(e){super(e);a(this,"_path");a(this,"_currentPositionChanged",this.dv(new v));a(this,"_currentRotationChanged",this.dv(new v));a(this,"_currentChanged",this.dv(new v));a(this,"_deprecated",[]);a(this,"_deprecatedWarningFunc",(()=>{this._deprecatedWarning()})());this._path=this.dv(new ii),this.d(this._path.currentInfoChanged.don(()=>this._currentPositionChanged.emit(this._path.currentPosition))),this.d(this._path.currentInfoChanged.don(()=>this._currentRotationChanged.emit(this.currentRotation))),this.d(this._path.currentInfoChanged.don(()=>this._currentChanged.emit(this.current))),this._path.show=!0,this._path.polylineShow=!1,this._path.currentPoiShow=!1;{const t=()=>{if(!this.timeStamps||!this.points){this._path.timePosRots=void 0;return}const r=this.timeStamps.length,o=this.points.length,l=Math.min(r,o),h=[];for(let c=0;c<l;++c)h.push([this.timeStamps[c],this.points[c]]);this._path.timePosRots=h,this.rotationRadius.some(c=>c>0)?(this._path.addAroundPoints(this.rotationRadius,!0),this._path.computeRotIfUndefinedUsingLerp(!0),this._path.rotLerpMode="Lerp"):(this._path.computeRotIfUndefinedUsingPrevLine(!0),this._path.rotLerpMode="Next")},i=this.dv(oe(this.timeStampsChanged,this.pointsChanged,this.rotationRadiusChanged));t(),this.d(i.don(t))}}get path(){return this._path}get currentPosition(){return this._path.currentPosition}get currentPositionChanged(){return this._currentPositionChanged}get currentRotation(){const e=this._path.currentRotation;if(e)return[ps(e[0]-90),e[1],e[2]]}get currentRotationChanged(){return this._currentRotationChanged}get current(){return{position:this.currentPosition,rotation:this.currentRotation}}get currentChanged(){return this._currentChanged}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new vo([this,"timeStamps"],"时间序列",[],!0,void 0,void 0,()=>{if(!(!this.points||this.points.length<2))return zt(this.points,"GEODESIC")}),new f([this,"speed"],"线条流速",1),new A([this,"materialMode"],[["单箭头","singleArrow"],["多箭头","multipleArrows"],["纯色","pureColor"]],"模式","singleArrow"),new ie([this,"rotationRadius"],"拐弯半径",Hi.defaults.rotationRadius)],more:[...e.more,new ue([this,"currentPosition"],"当前位置",void 0,!0,!0)]}}};a(Hi,"createDefaultProps",()=>({...ve.createDefaultProps(),timeStamps:q(void 0),speed:1,materialMode:"singleArrow",stroked:!0,strokeStyle:B({width:10,widthType:"world",color:[1,0,.73,1],material:"",materialParams:{arrowColor:[1,1,1,1]},ground:!1}),rotationRadius:[5]})),a(Hi,"type",Hi.register("ESPath",Hi,{chsName:"ESPath",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:`ESPath 是用于表示和播放沿路径运动的地理线对象,支持时间序列与流速控制。
|
|
1134
1134
|
对象json示例:
|
|
1135
1135
|
{
|
|
1136
1136
|
"id": "path_xxx",
|
|
@@ -1181,12 +1181,12 @@ timePosRots是一个内部包含三个元素的数组,第一个表示时间戳
|
|
|
1181
1181
|
}
|
|
1182
1182
|
}
|
|
1183
1183
|
}
|
|
1184
|
-
`,
|
|
1184
|
+
`,Ug=`data 路径都可以使用下面回调函数
|
|
1185
1185
|
\`\`\`
|
|
1186
1186
|
${Wc}
|
|
1187
1187
|
\`\`\`
|
|
1188
1188
|
|
|
1189
|
-
`,za=Date.now(),Dt=class Dt extends M{constructor(e){super(e);a(this,"_flyToEvent",this.disposeVar(new v));a(this,"_resetClockEvent",this.disposeVar(new v));this.ad(D([this,"uri"],[this,"url"]))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get resetClockEvent(){return this._resetClockEvent}resetClock(){this._resetClockEvent.emit()}getESProperties(){const e={...super.getESProperties()};return{...e,defaultMenu:"basic",basic:[...e.basic,new R([this,"url"],"路径",M.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/misc/simple.czml"),void 0,!0),new E([this,"clockEnabled"],"启用",!1),new f([this,"multiplier"],"倍速",Dt.defaults.multiplier),new E([this,"autoResetClock"],"自动设置时钟",!0),new Ve([this,"startTime"],"开始时间",Dt.defaults.startTime,!0),new Ve([this,"stopTime"],"结束时间",Dt.defaults.stopTime,!0),new Ve([this,"currentTime"],"当前时间",Dt.defaults.currentTime,!0),new A([this,"clockStep"],[["TICK_DEPENDENT","TICK_DEPENDENT"],["SYSTEM_CLOCK_MULTIPLIER","SYSTEM_CLOCK_MULTIPLIER"],["SYSTEM_CLOCK","SYSTEM_CLOCK"]],"clockStep","SYSTEM_CLOCK_MULTIPLIER"),new A([this,"clockRange"],[["UNBOUNDED","UNBOUNDED"],["CLAMPED","CLAMPED"],["LOOP_STOP","LOOP_STOP"]],"clockRange","UNBOUNDED"),new E([this,"shouldAnimate"],"是否启用动画",!1)],general:[...e.general,new E([this,"show"],"是否显示",!0),new E([this,"collision"],"开启碰撞",!1),new E([this,"allowPicking"],"允许拾取",!1)],more:[...e.more,new L("飞入",t=>this.flyTo(t),[1e3],"flyTo"),new L("重置时钟",()=>this.resetClock(),[],"resetClock"),new Xe([this,"loadFuncStr"],"loadFnStr",Wc,
|
|
1189
|
+
`,za=Date.now(),Dt=class Dt extends M{constructor(e){super(e);a(this,"_flyToEvent",this.disposeVar(new v));a(this,"_resetClockEvent",this.disposeVar(new v));this.ad(D([this,"uri"],[this,"url"]))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get resetClockEvent(){return this._resetClockEvent}resetClock(){this._resetClockEvent.emit()}getESProperties(){const e={...super.getESProperties()};return{...e,defaultMenu:"basic",basic:[...e.basic,new R([this,"url"],"路径",M.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/misc/simple.czml"),void 0,!0),new E([this,"clockEnabled"],"启用",!1),new f([this,"multiplier"],"倍速",Dt.defaults.multiplier),new E([this,"autoResetClock"],"自动设置时钟",!0),new Ve([this,"startTime"],"开始时间",Dt.defaults.startTime,!0),new Ve([this,"stopTime"],"结束时间",Dt.defaults.stopTime,!0),new Ve([this,"currentTime"],"当前时间",Dt.defaults.currentTime,!0),new A([this,"clockStep"],[["TICK_DEPENDENT","TICK_DEPENDENT"],["SYSTEM_CLOCK_MULTIPLIER","SYSTEM_CLOCK_MULTIPLIER"],["SYSTEM_CLOCK","SYSTEM_CLOCK"]],"clockStep","SYSTEM_CLOCK_MULTIPLIER"),new A([this,"clockRange"],[["UNBOUNDED","UNBOUNDED"],["CLAMPED","CLAMPED"],["LOOP_STOP","LOOP_STOP"]],"clockRange","UNBOUNDED"),new E([this,"shouldAnimate"],"是否启用动画",!1)],general:[...e.general,new E([this,"show"],"是否显示",!0),new E([this,"collision"],"开启碰撞",!1),new E([this,"allowPicking"],"允许拾取",!1)],more:[...e.more,new L("飞入",t=>this.flyTo(t),[1e3],"flyTo"),new L("重置时钟",()=>this.resetClock(),[],"resetClock"),new Xe([this,"loadFuncStr"],"loadFnStr",Wc,Ug,!0)]}}};a(Dt,"createDefaultProps",()=>({show:!0,uri:void 0,url:void 0,allowPicking:!1,autoResetClock:!0,clockEnabled:!1,startTime:za,stopTime:za+1440*60*1e3,currentTime:za,multiplier:1,clockStep:"SYSTEM_CLOCK_MULTIPLIER",clockRange:"UNBOUNDED",shouldAnimate:!1,loadFuncStr:void 0,...M.createDefaultProps()})),a(Dt,"type",Dt.register("ESCzml",Dt,{chsName:"ESCzml",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:`ESCzml 是用于加载和操作 CZML 数据(描述时空动态数据)的对象。
|
|
1190
1190
|
对象json示例:
|
|
1191
1191
|
{
|
|
1192
1192
|
"id": "czml_xxx",
|
|
@@ -1243,7 +1243,7 @@ ${Wc}
|
|
|
1243
1243
|
"position": [116.39, 39.9, 0],
|
|
1244
1244
|
"url": "http://localhost:9004/gaussian/model.splat"
|
|
1245
1245
|
}
|
|
1246
|
-
`}));let Ja=qs;class
|
|
1246
|
+
`}));let Ja=qs;class $c extends b{constructor(s,e,t="areaLifting"){super(),e&&(t==="polygonFit"?this.createEditor(s,e,{pointsProp:"polygonFitPoints",onCompleted:i=>s.polygonFitCompletedEvent.emit(i)}):this.createEditor(s,e,{pointsProp:"areaLiftingPoints"}))}createEditor(s,e,t){const i=this.ad(new ee);i.stroked=!0,this.ad(s.components.disposableAdd(i,!1)),this.ad(D([i,"points"],[s,t.pointsProp])),t.onCompleted&&this.ad(e.editingEvent.don(r=>{if(r.type!=="end"||!r.objectIDs.includes(s.id)||!i.editing)return;const o=i.points;o&&o.length>=3&&t.onCompleted(o)})),i.editing=!0}}var Gc=(n=>(n[n.None=0]="None",n[n.Up=1]="Up",n[n.Down=2]="Down",n))(Gc||{}),Jc=(n=>(n[n.CLICK=0]="CLICK",n[n.MOVE=1]="MOVE",n))(Jc||{}),qc=(n=>(n[n.Smooth=0]="Smooth",n[n.Linear=1]="Linear",n[n.Spherical=2]="Spherical",n[n.Tip=3]="Tip",n[n.Hard=4]="Hard",n))(qc||{});const me=class me extends j{constructor(e){super(e);a(this,"_startEvent",this.disposeVar(new v));a(this,"_configs",this.disposeVar(q(void 0)));a(this,"_heights",this.disposeVar(w({})));a(this,"_heightsEvent",this.ad(new v));a(this,"_areaLiftingUpdateEvent",this.disposeVar(new v));a(this,"_requestPolygonGridEvent",this.disposeVar(new v));a(this,"_applyHeightsEvent",this.disposeVar(new v));a(this,"_polygonFitCompletedEvent",this.disposeVar(new v));const t=this.ad(oe(this.modeChanged,this.startEvent,this.polygonFitEditingChanged));this.ad(new le(t,()=>{var i;if(this.areaLiftingPoints=void 0,this.polygonFitEditing)return new $c(this,this.activeViewer,"polygonFit");if(!this.polygonFitMode){if(this.mode=="areaLifting")return new $c(this,this.activeViewer,"areaLifting");(i=this.activeViewer)==null||i.startEditing(this,I.BrushErase)}}))}updateEditing(){var e;sr(this.position,[0,0,0])||(this.position=[0,0,0]),(e=this.activeViewer)==null||e.startEditing(this,I.Place,{callSource:"inner"})}get startEvent(){return this._startEvent}start(){this._startEvent.emit()}get configs(){return this._configs.value}set configs(e){this._configs.value=e}get configsChanged(){return this._configs.changed}getConfig(...e){var t,i;if(typeof e[0]=="number")return(t=this.configs)==null?void 0:t.find(r=>r.x===e[0]&&r.y===e[1]);if(typeof e[0]=="string")return(i=this.configs)==null?void 0:i.find(r=>r.url===e[0])}get heights(){return this._heights.value}set heights(e){this._heights.value=e}get heightsChanged(){return this._heights.changed}get heightsEvent(){return this._heightsEvent}getHeights(){return new Promise((e,t)=>{const i=new b;i.ad(this._heightsEvent.don(o=>{o!=="start"&&(!i.isDestroyed()&&i.destroy(),e(o))})),this._heightsEvent.emit("start");const r=setTimeout(()=>{i.isDestroyed()||(i.destroy(),e(void 0))},2e3);i.ad(()=>clearTimeout(r))})}get areaLiftingUpdateEvent(){return this._areaLiftingUpdateEvent}areaLiftingUpdate(){this._areaLiftingUpdateEvent.emit()}get requestPolygonGridEvent(){return this._requestPolygonGridEvent}get applyHeightsEvent(){return this._applyHeightsEvent}get polygonFitCompletedEvent(){return this._polygonFitCompletedEvent}getPolygonGrid(e){const t=e??this.polygonFitPoints;return!t||t.length<3?Promise.resolve([]):new Promise(i=>{const r=setTimeout(()=>{console.warn("[ESTerrainLayerEditing] getPolygonGrid 超时未返回(引擎层可能未实现 requestPolygonGridEvent)"),i([])},1e4);this.ad(()=>clearTimeout(r)),this._requestPolygonGridEvent.emit({points:t,callback:o=>{clearTimeout(r),i(o)}})})}applyHeights(e){this._applyHeightsEvent.emit({items:e})}getESProperties(){const e={...super.getESProperties()};return{...e,coordinate:[...e.coordinate,new L("开始编辑",()=>{this.start()},[],"start"),new A([this,"mode"],me.modes,"编辑模式",me.defaults.mode)],basic:[...e.basic,new R([this,"url"],"URL"),new R([this,"tileInfo"],"瓦片信息配置"),new f([this,"maxHeight"],"最大高度"),new f([this,"minHeight"],"最小高度"),new f([this,"offset"],"偏移"),new E([this,"autoLoadHeights"],"自动加载高度"),new k("刷写设置"),new f([this,"brushEraseRadius"],"编辑半径"),new ne([this,"brushEraseRadiusRange"],"编辑半径范围",void 0,!0,!0),new A([this,"brushEraseMode"],Object.entries(["CTRL","SHIFT","NONE"]),"刷写模式"),new A([this,"brushErasePickReference"],me.brushErasePickReferences,"选择参考"),new nt([this,"brushErasePosition"],"刷写位置"),new nt([this,"brushEraseStartPosition"],"刷写起始位置"),new A([this,"brushEraseFalloff"],me.brushEarseFalloffs,"刷写衰减函数"),new A([this,"brushEraseRayDirection"],[["Up","Up"],["Down","Down"]],"刷写射线方向"),new k("平整设置"),new A([this,"flattenMode"],me.flattenModes,"平整模式",0),new A([this,"flattenPick"],me.flattenPicks,"平整选择",0),new f([this,"flattenOffset"],"平整偏移",-.01),new k("区域升降设置"),new ie([this,"areaLiftingPoints"],"区域升降位置",[]),new f([this,"areaLiftingOffset"],"区域升降偏移",1),new L("区域升降更新",()=>{this.areaLiftingUpdate()},[],"areaLiftingUpdate"),new k("围栏设置"),new ie([this,"fencePoints"],"围栏位置",[])]}}};a(me,"createDefaultProps",()=>({...j.createDefaultProps(),allowPicking:!0,url:"",maxHeight:0,minHeight:0,offset:.01,tileInfo:B({tileCountX:65,tileCountY:65,tileMaximumLevel:15,tilesPerAxis:5,format:"heights"}),mode:w("sculpt"),autoLoadHeights:!1,brushEraseRadius:100,brushEraseRadiusRange:F([0,100]),brushErasePosition:F([0,0,0]),brushEraseStartPosition:F([0,0,0]),brushEraseMode:w("NONE"),brushErasePickReference:w("NONE"),brushEraseRayDirection:w("Down"),brushEraseFalloff:w(4),flattenMode:w(0),flattenPick:w(1),flattenOffset:-.01,areaLiftingPoints:Nt(void 0),areaLiftingOffset:1,polygonFitEditing:w(!1),polygonFitMode:w(!1),polygonFitPoints:Nt([]),fencePoints:Nt(void 0),fenceMode:w("in")})),a(me,"modes",[["雕刻","sculpt"],["抹除","erase"],["平滑","smooth"],["平整","flatten"],["区域升降","areaLifting"]]),a(me,"brushErasePickReferences",[["无限制","NONE"],["地形图层","ESTerrainLayerEditing"],["3DTiles","ES3DTileset"]]),a(me,"flattenModes",[["None",0],["Up",1],["Down",2]]),a(me,"flattenPicks",[["CLICK",0],["MOVE",1]]),a(me,"brushEarseFalloffs",[["平滑",0],["线性",1],["硬边",4],["球形",2],["尖顶",3]]),a(me,"invalidValue",-1e4),a(me,"type",me.register("ESTerrainLayerEditing",me,{chsName:"地形图层编辑",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"ESTerrainLayerEditing 是用于对地形图层进行雕刻、抹除、平滑、平整及区域升降等编辑操作的对象。"})),a(me,"supportEditingModes",[...j.supportEditingModes,I.Place,I.BrushErase]);let xn=me;const Je=class Je extends U{constructor(e){super(e);a(this,"editingBindMode","doublePoints");a(this,"_startEvent",this.disposeVar(new v));a(this,"_replayEvent",this.disposeVar(new v));this.ad(this.startEvent.don(()=>{var t;(t=this.activeViewer)==null||t.startEditing(this,I.BrushErase)}))}get startEvent(){return this._startEvent}start(){this._startEvent.emit()}get replayEvent(){return this._replayEvent}replay(){this._replayEvent.emit()}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new L("开始编辑",()=>this.start(),[]),new L("重播",()=>this.replay(),[]),new E([this,"showImage"],"显示影像",Je.defaults.showImage),new f([this,"flowSpeed"],"流动速度",Je.defaults.flowSpeed),new f([this,"gravity"],"重力加速度",Je.defaults.gravity),new f([this,"strength"],"泥石流强度",Je.defaults.strength),new f([this,"resistance"],"泥石流阻力(越大越快平息)",Je.defaults.resistance),new f([this,"terrainOffset"],"地形高度偏移",Je.defaults.terrainOffset),new ie([this,"slidePoints"],"滑坡点数组",U.defaults.slidePoints,void 0),new k("刷写设置"),new f([this,"brushEraseRadius"],"编辑半径"),new ne([this,"brushEraseRadiusRange"],"编辑半径范围",void 0,!0,!0),new A([this,"brushEraseMode"],Object.entries(["CTRL","SHIFT","NONE"]),"刷写模式"),new A([this,"brushErasePickReference"],xn.brushErasePickReferences,"选择参考"),new nt([this,"brushErasePosition"],"刷写位置"),new nt([this,"brushEraseStartPosition"],"刷写起始位置"),new A([this,"brushEraseFalloff"],xn.brushEarseFalloffs,"刷写衰减函数"),new A([this,"brushEraseRayDirection"],[["Up","Up"],["Down","Down"]],"刷写射线方向")]}}};a(Je,"createDefaultProps",()=>({...U.createDefaultProps(),brushEraseRadius:100,brushEraseRadiusRange:F([0,1e3]),brushErasePosition:F([0,0,0]),brushEraseStartPosition:F([0,0,0]),brushEraseMode:w("NONE"),brushErasePickReference:w("NONE"),brushEraseRayDirection:w("Down"),terrainOffset:5,flowSpeed:1,gravity:9.8,slidePoints:F([]),strength:1,showImage:!0,resistance:.98,stroked:!0,strokeStyle:B({width:1,widthType:"screen",color:[1,1,1,1],material:"",materialParams:{},ground:!0})})),a(Je,"type",Je.register("ESLandSlide",Je,{chsName:"滑坡泥石流分析",tags:["ESObjects","_ES_Impl_Cesium"],description:`ESLandSlide 是用于在场景中通过双点绘制区域进行滑坡泥石流分析的对象。
|
|
1247
1247
|
对象json示例:
|
|
1248
1248
|
{
|
|
1249
1249
|
"id": "landslide_xxx",
|
|
@@ -1269,7 +1269,7 @@ ${Wc}
|
|
|
1269
1269
|
"points": [[116.39, 39.9, 0], [116.40, 39.9, 0], [116.40, 39.91, 0]],
|
|
1270
1270
|
"radius": 10000
|
|
1271
1271
|
}
|
|
1272
|
-
`}));let Ya=Xs;const
|
|
1272
|
+
`}));let Ya=Xs;const $t=class $t extends X{constructor(s){super(s)}getESProperties(){const s=super.getESProperties();return{...s,basic:[...s.basic,new ie([this,"data"],"数据",[],void 0,!0),new R([this,"gradient"],"渐变",$t.defaults.gradient,void 0,!0),new f([this,"radius"],"半径",$t.defaults.radius,void 0,!0),new f([this,"blur"],"模糊",$t.defaults.blur,!0),new E([this,"is3D"],"is3D",!1,!0)]}}};a($t,"createDefaultProps",()=>({...X.createDefaultProps(),is3D:w(!1),data:Nt([]),gradient:te({".5":"green",".7":"yellow",".95":"red"}),radius:w(10),blur:w(.85)})),a($t,"type",$t.register("ESHeatMap",$t,{chsName:"热力图",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:`ESHeatMap 是用于在场景中显示热力图的可视化对象。
|
|
1273
1273
|
对象json示例:
|
|
1274
1274
|
{
|
|
1275
1275
|
"id": "heatmap_xxx",
|
|
@@ -1279,7 +1279,7 @@ ${Wc}
|
|
|
1279
1279
|
"blur": 0.85,
|
|
1280
1280
|
"data":[[116.39, 39.9, 0], [116.40, 39.9, 0], [116.40, 39.91, 0]]
|
|
1281
1281
|
}
|
|
1282
|
-
`}));let Sr
|
|
1282
|
+
`}));let Sr=$t;const Xi=class Xi extends U{constructor(e){super(e);a(this,"editingBindMode","scatter")}};a(Xi,"createDefaultProps",()=>({...U.createDefaultProps(),pointed:!0})),a(Xi,"type",Xi.register("ESGeoPoints",Xi,{chsName:"地理点集合",tags:["ESObjects","_ES_Impl_Cesium"],description:`ESGeoPoints 是用于在地图中可视化地理点集合的对象。
|
|
1283
1283
|
对象json示例:
|
|
1284
1284
|
{
|
|
1285
1285
|
"id": "geopoints_xxx",
|
|
@@ -1288,7 +1288,7 @@ ${Wc}
|
|
|
1288
1288
|
"points": [[116.39, 39.9, 0], [116.40, 39.9, 0], [116.40, 39.91, 0]],
|
|
1289
1289
|
"pointed": true
|
|
1290
1290
|
}
|
|
1291
|
-
`})),a(Xi,"supportEditingModes",[...U.supportEditingModes,I.ScatterAppend,I.ScatterModify]);let On=Xi;const qc=async(n,s=[],e)=>{const t=[];for(const i of s){const{coordinates:r}=i.geometry;for(const o of r){const l=await Promise.all(o.map(async h=>{let c=h[2]??0;if(e)if(e.type==="absolute")c=e.height??c;else if(e.type==="relative"){const u=await n.getTerrainHeight([h[0],h[1]])??0;c=(e.height??c)+u}else e.type==="terrain"&&(c=await n.getTerrainHeight([h[0],h[1]])??0);return[h[0],h[1],c]}));t.push({...i,points:l})}}return t},Xc=async(n,s=[],e)=>await Promise.all(s.map(async t=>{var h,c,u,p,g,m,y,S,C;const i=((h=t.geometry)==null?void 0:h.x)??((u=(c=t.geometry)==null?void 0:c.coordinates)==null?void 0:u[0]),r=((p=t.geometry)==null?void 0:p.y)??((m=(g=t.geometry)==null?void 0:g.coordinates)==null?void 0:m[1]);let l=((y=t.geometry)==null?void 0:y.z)??((C=(S=t.geometry)==null?void 0:S.coordinates)==null?void 0:C[2])??0;if(e)if(e.type==="absolute")l=e.height??l;else if(e.type==="relative"){const T=await n.getTerrainHeight([i,r])??0;l=(e.height??l)+T}else e.type==="terrain"&&(l=await n.getTerrainHeight([i,r])??0);return{...t,points:[i,r,l]}})),Yc=async(n,s=[],e)=>{const t=[];return await Promise.all(s.map(async i=>{const{coordinates:r}=i.geometry;await Promise.all(r.map(async o=>{const l=await Promise.all(o.map(async h=>{let c=h[2]??0;if(e)if(e.type==="absolute")c=e.height??c;else if(e.type==="relative"){const u=await n.getTerrainHeight([h[0],h[1]])??0;c=(e.height??c)+u}else e.type==="terrain"&&(c=await n.getTerrainHeight([h[0],h[1]])??0);return[h[0],h[1],c]}));t.push({...i,points:l})}))})),t};function Bg(n){const s=K.lineString(n),e=K.length(s),t=K.along(s,e/2);return[t.geometry.coordinates[0],t.geometry.coordinates[1],t.geometry.coordinates[2]||0]}function Wg(n,s){const e=K.lineString(n),t=K.length(e),i=Math.floor(t/s),r=[];if(r.push(n[0]),i<1)return[n[0]];for(let o=1;o<i;o+=1){const l=K.along(e,t*(o/i));r.push([l.geometry.coordinates[0],l.geometry.coordinates[1],l.geometry.coordinates[2]||0])}return r}function Hg(n){const s=[...n];JSON.stringify(n[0])!==JSON.stringify(n[n.length-1])&&s.push(n[0]);const e=K.polygon([s]),t=K.center(e);return[t.geometry.coordinates[0],t.geometry.coordinates[1],t.geometry.coordinates[2]||0]}function Kc(n,s,e){const t=n.dv(new ms);for(const i in e)i!=="type"&&(t[i]=e[i]);t.position=s,n.d(n.components.disposableAdd(t))}function Ka(n,s,e,t){let i=t.textTemplate||t.symbol.text||"";const r=/{{(.*?)}}/;for(;r.test(i);){const u=i.match(r);if(u){const p=u[1].trim(),g=e[`${p}`]||"-";i=i.replace(u[0],g)}}let o=t.symbol;const{minVisibleDistance:l,maxVisibleDistance:h}=t;l&&h&&(o={...o,minVisibleDistance:l,maxVisibleDistance:h});const c={...o,text:i};Kc(n,s,c)}function ws(n,s){const e={width:null,height:null,color:null,opacity:null,rotation:null};return s.forEach(t=>{t.type==="size"?t.axis==="width"?e.width=n[t.field]||null:t.axis==="height"&&(e.height=n[t.field]||null):t.type==="color"?e.color=n[t.field]||null:t.type==="opacity"?e.opacity=n[t.field]||null:t.type==="rotation"&&(e.rotation=n[t.field]||null)}),e}function Za(n,s,e){const i={...s.symbol};if(e&&e.length>0){const r=ws(n,e);for(let o in r)i[o]!==void 0&&r[o]!==null&&(i[o]=r[o])}return i}function Qa(n,s,e){var c,u;const t=s,{uniqueValueInfos:i,field:r,fieldDelimiter:o,defaultSymbol:l}=t;let h={...l};if(Array.isArray(r)){const g=r.map(m=>n[m]??"").join(o);h=((c=i.find(m=>m.value==g))==null?void 0:c.symbol)||l}else h=((u=i.find(p=>p.value==n[r]))==null?void 0:u.symbol)||l;if(e&&e.length>0){const p=ws(n,e);for(let g in p)h[g]!==void 0&&p[g]!==null&&(h[g]=p[g])}return h}function el(n,s,e){const t=s,{classBreakInfos:i,field:r,defaultSymbol:o}=t;let l=o;const h=n[r];if(h===void 0||typeof h!="number")l=o;else{const c=i.find(u=>h<=u.maxValue&&h>=u.minValue);c?l=c.symbol:l=o}if(e&&e.length>0){const c=ws(n,e);for(let u in c)l[u]!==void 0&&c[u]!==null&&(l[u]=c[u])}return l}function $g(n,s){function e(c,u,p,g){const m=$=>$*Math.PI/180,y=$=>$*180/Math.PI,S=m(c),C=m(p),T=m(g-u),V=Math.sin(T)*Math.cos(C),z=Math.cos(S)*Math.sin(C)-Math.sin(S)*Math.cos(C)*Math.cos(T),x=Math.atan2(V,z);return(y(x)+360)%360}function t(c,u,p,g,m){const S=Q=>Q*Math.PI/180,C=Q=>Q*180/Math.PI,T=g/6371e3,V=S(m),z=S(c),x=S(u),$=Math.asin(Math.sin(z)*Math.cos(T)+Math.cos(z)*Math.sin(T)*Math.cos(V)),Y=x+Math.atan2(Math.sin(V)*Math.sin(T)*Math.cos(z),Math.cos(T)-Math.sin(z)*Math.sin($));return{lat:C($),lng:C(Y),alt:p}}function i(c){const u=[];c.length>1&&u.push(e(c[0].lat,c[0].lng,c[1].lat,c[1].lng));for(let p=1;p<c.length-1;p++){const g=e(c[p-1].lat,c[p-1].lng,c[p].lat,c[p].lng),m=e(c[p].lat,c[p].lng,c[p+1].lat,c[p+1].lng);let y=(g+m)/2;Math.abs(g-m)>180&&(y=(y+180)%360),u.push(y)}return c.length>1&&u.push(e(c[c.length-2].lat,c[c.length-2].lng,c[c.length-1].lat,c[c.length-1].lng)),c.length===1&&u.push(0),u}if(!n||n.length<2)throw new Error("至少需要两个点才能生成路径");if(s<=0)throw new Error("宽度必须大于0");const r=s/2,o=i(n),l=[],h=[];for(let c=0;c<n.length;c++){const u=(o[c]+90)%360,p=(o[c]+270)%360,g=n[c].alt!==void 0?n[c].alt:0;l.push(t(n[c].lat,n[c].lng,g,r,u)),h.push(t(n[c].lat,n[c].lng,g,r,p))}return l.concat(h.reverse())}function Gg(n,s,e,t){function i(S){return S*(Math.PI/180)}const r=6378137,o=i(n),l=i(s),h=i(e),c=i(t),u=h-o,p=c-l,g=Math.sin(u/2)**2+Math.cos(o)*Math.cos(h)*Math.sin(p/2)**2,m=2*Math.atan2(Math.sqrt(g),Math.sqrt(1-g));return r*m}const Zc=(n,s,e)=>Array.isArray(s)?s.map(r=>n[r]??"").join(e):n[s]??"";function Qc(n,s){const t={...s.symbol};return{points:n.map(i=>i.points),symbol:t}}function ed(n,s){const e=s,{uniqueValueInfos:t,field:i,fieldDelimiter:r,defaultSymbol:o}=e,l=[],h=t.reduce((u,p)=>{const g=p.value.toString();return u[g]={points:[],value:p.value,symbol:p.symbol},u},{});for(let u=0;u<n.length;u++){const p=n[u],g=Zc(p,i,r);if(g!==void 0&&g!==""){const m=h[g.toString()];m?m.points.push(p.points):l.push(p.points)}else l.push(p.points)}const c=[];for(let u in h){const{points:p,symbol:g}=h[u];p.length>0&&c.push({points:p,symbol:g})}return l.length>0&&c.push({points:l,symbol:o}),c}function td(n,s){const e=s,{classBreakInfos:t,field:i,defaultSymbol:r}=e,o=[],l=t.map(c=>({...c,points:[]}));for(let c=0;c<n.length;c++){const u=n[c],p=u[i];if(p===void 0||typeof p!="number")o.push(u.points);else{const g=l.findIndex(m=>p<=m.maxValue&&p>=m.minValue);g!==-1?l[g].points.push(u.points):o.push(u.points)}}const h=[];return l.forEach(c=>{c.points.length>0&&h.push({points:c.points,symbol:c.symbol})}),o.length>0&&h.push({points:o,symbol:r}),h}function Jg(n,s,e=[]){const i={...s.symbol},r=n.map(o=>{const l=ws(o,e);return{position:o.points,rotation:l.rotation||i.rotation||[0,0,0],scale:i.scale||[1,1,1]}});return{url:i.url,locations:r}}function qg(n,s,e=[]){const t=s,{uniqueValueInfos:i,field:r,fieldDelimiter:o}=t,l=t.defaultSymbol,h=[],c=i.reduce((p,g)=>{const m=g.value.toString();return p[m]={locations:[],value:g.value,symbol:g.symbol},p},{});for(let p=0;p<n.length;p++){const g=n[p],m=Zc(g,r,o);if(m){const y=c[m.toString()];if(y){const S=ws(g,e);y.locations.push({position:g.points,rotation:S.rotation||l.rotation||[0,0,0],scale:l.scale||[1,1,1]})}else h.push({position:g.points,rotation:l.rotation||[0,0,0],scale:l.scale||[1,1,1]})}else h.push({position:g.points,rotation:l.rotation||[0,0,0],scale:l.scale||[1,1,1]})}const u=[];for(let p in c){const{locations:g,symbol:m}=c[p];g.length>0&&u.push({url:m.url,locations:g})}return h.length>0&&u.push({url:l.url,locations:h}),u}function Xg(n,s,e=[]){const t=s,{classBreakInfos:i,field:r}=t,o=t.defaultSymbol,l=[],h=i.map(u=>({...u,locations:[]}));for(let u=0;u<n.length;u++){const p=n[u],g=p[r];if(g===void 0||typeof g!="number")l.push({position:p.points,rotation:o.rotation||[0,0,0],scale:o.scale||[1,1,1]});else{const m=h.findIndex(y=>g<=y.maxValue&&g>=y.minValue);if(m!==-1){const y=ws(p,e);h[m].locations.push({position:p.points,rotation:y.rotation||o.rotation||[0,0,0],scale:h[m].symbol.scale||[1,1,1]})}else l.push({position:p.points,rotation:o.rotation||[0,0,0],scale:o.scale||[1,1,1]})}}const c=[];return h.forEach(u=>{u.locations.length>0&&c.push({url:u.symbol.url,locations:u.locations})}),l.length>0&&c.push({url:o.url,locations:l}),c}class Yg extends b{constructor(e,t,i,r){super();a(this,"labelingInfo");this.sceneObject=e;const o=t;if(r&&_t(o,l=>{this.renderLabel(l,r)}),i)if(i.type==="simple"){const{visualVariables:l}=i;if(i.symbol.type==="simple-point"&&(!l||l.length==0)){console.log("PointLayer:大批量点渲染!");const h=Qc(o,i);this._simplePointAllRender(h.points,h.symbol);return}if(i.symbol.type==="ESImageLabel"&&(!l||l.length==0)){console.log("PointLayer:大批量点渲染成图标!");const h=Qc(o,i);this._imageAllRender(h.points,h.symbol);return}if(i.symbol.type==="ESGltfModel"){console.log("PointLayer:大批量点渲染成gltf!");const{url:h,locations:c}=Jg(o,i,l);this._modelAllRender(h,c);return}for(let h=0;h<o.length;h++){const c=Za(o[h],i,l);this.render(o[h],c)}}else if(i.type==="unique-value"){const{visualVariables:l}=i;if(i.uniqueValueInfos.findIndex(p=>p.symbol.type!=="simple-point")===-1&&i.defaultSymbol.type==="simple-point"&&(!l||l.length==0)){console.log("PointLayer:大批量点渲染!"),ed(o,i).forEach(({points:g,symbol:m})=>{this._simplePointAllRender(g,m)});return}if(i.uniqueValueInfos.findIndex(p=>p.symbol.type!=="ESImageLabel")===-1&&i.defaultSymbol.type==="ESImageLabel"&&(!l||l.length==0)){console.log("PointLayer:大批量点渲染成图标!"),ed(o,i).forEach(({points:g,symbol:m})=>{this._imageAllRender(g,m)});return}if(i.uniqueValueInfos.findIndex(p=>p.symbol.type!=="ESGltfModel")===-1&&i.defaultSymbol.type==="ESGltfModel"){console.log("PointLayer:大批量点渲染成gltf!"),qg(o,i,l).forEach(({url:g,locations:m})=>{this._modelAllRender(g,m)});return}for(let p=0;p<o.length;p++){const g=Qa(o[p],i,l);this.render(o[p],g)}}else if(i.type==="class-breaks"){const{visualVariables:l}=i;if(i.classBreakInfos.findIndex(p=>p.symbol.type!=="simple-point")===-1&&i.defaultSymbol.type==="simple-point"&&(!l||l.length==0)){console.log("PointLayer:大批量点渲染!"),td(o,i).forEach(({points:g,symbol:m})=>{this._simplePointAllRender(g,m)});return}if(i.classBreakInfos.findIndex(p=>p.symbol.type!=="ESImageLabel")===-1&&i.defaultSymbol.type==="ESImageLabel"&&(!l||l.length==0)){console.log("PointLayer:大批量点渲染成图标!"),td(o,i).forEach(({points:g,symbol:m})=>{this._imageAllRender(g,m)});return}if(i.classBreakInfos.findIndex(p=>p.symbol.type!=="ESGltfModel")===-1&&i.defaultSymbol.type==="ESGltfModel"){console.log("PointLayer:大批量点渲染成gltf!"),Xg(o,i,l).forEach(({url:g,locations:m})=>{this._modelAllRender(g,m)});return}for(let p=0;p<o.length;p++){const g=el(o[p],i,l);this.render(o[p],g)}}else if(i.type==="heatmap"){const{field:l,fieldValueMax:h,fieldValueMin:c}=i;console.time();const u=o.map(p=>{const{points:g}=p;if(l&&typeof l=="string"){let m=p[l];typeof m=="number"&&(typeof h=="number"&&m>h&&(m=h),typeof c=="number"&&m<c&&(m=c),g[2]=m)}return g});this.renderHeatmap(u,i)}else console.error("PointLayer: renderer type is not supported")}renderLabel(e,t){const{points:i}=e;Ka(this.sceneObject,i,e,t)}renderHeatmap(e,t){const{is3D:i,radius:r,blur:o,gradient:l}=t,h=this.dv(new Sr);this.d(this.sceneObject.components.disposableAdd(h)),h.is3D=i,h.radius=r,h.blur=o,l&&(h.gradient={...l}),h.data=e}render(e,t){t.type==="simple-point"?this._simplePointRender(e,t):t.type==="ESImageLabel"?this._simpleImageRender(e,t):t.type==="ESGltfModel"?this._simpleModelRender(e,t):t.type==="ESTextLabel"?Kc(this.sceneObject,e.points,t):t.type==="ESParticleSystemPrimitive"?this._simpleParticleRender(e,t):console.error(" PointLayer: symbol type is not supported")}_simplePointRender(e,t){const{points:i}=e,{size:r,color:o,outlineColor:l,outlineWidth:h}=t,c=this.dv(new On);this.d(this.sceneObject.components.disposableAdd(c)),c.pointed=!0,c.pointOutlineColor=l,c.pointOutlineWidth=h,c.pointSize=r,c.pointColor=o,c.allowPicking=(t==null?void 0:t.allowPicking)??!0,c.extras={selected:!1},c.points=[i]}_simplePointAllRender(e,t){const{size:i,color:r,outlineColor:o,outlineWidth:l}=t,h=this.dv(new On);this.d(this.sceneObject.components.disposableAdd(h)),h.pointed=!0,h.pointOutlineColor=o,h.pointOutlineWidth=l,h.pointSize=i,h.pointColor=r,h.allowPicking=(t==null?void 0:t.allowPicking)??!0,h.points=[...e]}_simpleImageRender(e,t){const{points:i}=e,{rotation:r,offset:o,size:l,url:h,screenRender:c,anchor:u,renderMode:p,rotationType:g}=t,m=this.dv(new pr),y=this.dv(new ms);this.d(this.sceneObject.components.disposableAdd(m)),this.d(this.sceneObject.components.disposableAdd(y)),m.url=h,m.renderMode=p??0,r&&(m.rotation=r),o&&(m.offset=o),m.size=l||[32,32],u&&(m.anchor=u),g&&(m.rotationType=g),m.screenRender=c??!0,m.allowPicking=(t==null?void 0:t.allowPicking)??!0,m.extras={selected:!1},m.position=[...i],m.sizeByContent=!1,y.allowPicking=(t==null?void 0:t.allowPicking)??!0;const S=l?Math.max(...l)+10:Math.max(...m.size)+10;y.sizeByContent=!1,y.screenRender=!0,y.size=[S,S],y.borderRadius=[S,S,S,S],y.padding=[S/2,S/2,S/2,S/2],y.borderWidth=S/10,y.offset=[0,S/10+5],y.text="",y.backgroundColor=[0,0,0,0],y.borderColor=[0,0,0,0]}_imageAllRender(e,t){const i={type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"MultiPoint",coordinates:e}}]},r=this.dv(new Pn);this.d(this.sceneObject.components.disposableAdd(r));const o=this.dv(new ms);this.d(this.sceneObject.components.disposableAdd(o)),r.textDefaultText="";const{offset:l,size:h,url:c,anchor:u}=t;r.imageUrl=c,u&&(r.imageAnchor=u),l&&(r.imageOffset=l),r.imageSize=h||[32,32],r.url=i,r.allowPicking=(t==null?void 0:t.allowPicking)??!0,r.extras={selected:!1},o.allowPicking=!0;const p=h?Math.max(...h)+10:Math.max(...r.imageSize)+10;o.sizeByContent=!1,o.size=[p,p],o.borderRadius=[p,p,p,p],o.padding=[p/2,p/2,p/2,p/2],o.borderWidth=p/10,o.offset=[0,p/10+5],o.text="",o.backgroundColor=[0,0,0,0],o.borderColor=[0,0,0,0]}_simpleModelRender(e,t){const{points:i}=e,{rotation:r,scale:o,url:l}=t,h=this.dv(new Et);this.d(this.sceneObject.components.disposableAdd(h)),h.url=l,r&&(h.rotation=r),o&&(h.scale=o),h.position=[...i]}_modelAllRender(e,t){const i=this.dv(new Et);this.d(this.sceneObject.components.disposableAdd(i)),i.url=e,i.instances=t}_simpleParticleRender(e,t){const{points:i}=e,r=this.dv(new gr);this.d(this.sceneObject.components.disposableAdd(r)),r.position=[...i],Object.keys(t).forEach(o=>{r[o]=t[o]})}}class Kg extends b{constructor(s,e,t,i){super(),this.sceneObject=s;const r=e;if(i&&_t(r,o=>{this.renderLabel(o,i)}),t)if(t.type==="simple"){const{visualVariables:o}=t;_t(r,l=>{const h=Za(l,t,o);this.render(l,h)})}else if(t.type==="unique-value"){const{visualVariables:o}=t;_t(r,l=>{const h=Qa(l,t,o);this.render(l,h)})}else if(t.type==="class-breaks"){const{visualVariables:o}=t;_t(r,l=>{const h=el(l,t,o);this.render(l,h)})}else console.error("PolyLineLayer: renderer type is not supported")}render(s,e){console.log("PolyLineLayer: render",s,e),e.type==="simple-line"?this._simpleLineRender(s,e):e.type==="ESPolygonFence"?this._esPolygonFenceRender(s,e):e.type==="ESPipeFence"?this._esPipeFenceRender(s,e):e.type==="ESPath"?this._esPathRender(s,e):e.type==="ESlineInterpolationModel"?this._eslineInterpolationModelRender(s,e):e.type==="ESlineWall"?this._eslineWallRender(s,e):console.error("PolyLineLayer: symbol type is not supported")}_simpleLineRender(s,e){const{points:t}=s;if(t.length<2){console.warn("PolyLineLayer: points length is less than 3");return}const i=this.dv(new ve);this.d(this.sceneObject.components.disposableAdd(i)),i.points=[...t],i.stroked=!0,i.strokeColor=e.color,i.strokeWidth=e.width||1,i.allowPicking=(e==null?void 0:e.allowPicking)??!0,i.extras={selected:!1}}_esPolygonFenceRender(s,e){const{points:t}=s;if(t.length<3){console.warn("PolyLineLayer: points length is less than 3");return}const i=this.dv(new _r);this.d(this.sceneObject.components.disposableAdd(i)),i.points=[...t],i.height=e.height,i.materialMode=e.materialMode}_esPipeFenceRender(s,e){const{points:t}=s;if(t.length<2){console.warn("PolyLineLayer: points length is less than 3");return}const i=this.dv(new vr);this.d(this.sceneObject.components.disposableAdd(i)),i.points=[...t],i.height=e.height,i.width=e.width,i.materialMode=e.materialMode}_esPathRender(s,e){const{points:t}=s;if(t.length<2){console.warn("PolyLineLayer: points length is less than 3");return}const i=this.dv(new ys),r=this.dv(new _s);if(this.d(this.sceneObject.components.disposableAdd(i)),this.d(this.sceneObject.components.disposableAdd(r)),i.points=[...t],i.speed=e.speed,i.strokeColor=e.color,i.materialMode=e.materialMode,i.strokeWidth=e.width||1,e!=null&&e.runModel){const l=e==null?void 0:e.runSpeed,h=e==null?void 0:e.modelSymbol;let c;switch(e==null?void 0:e.runModel){case"ESHuman":c=this.dv(new Be);break;case"ESCar":c=this.dv(new hr);break;case"ESGltfModel":c=this.dv(new Et)}if(this.d(this.sceneObject.components.disposableAdd(c)),h)for(let p in h)c[p]=h[p];const u=[0];for(var o=0;o<t.length-1;o+=1){const p=t[o],g=t[o+1],m=Gg(p[1],p[0],g[1],g[0]);u.push(u[o]+Math.ceil(m/l)*1e3)}i.timeStamps=u,e!=null&&e.runSpeed&&(i.currentPositionChanged.don(p=>{i.currentPosition&&(c.position=i.currentPosition,i.currentRotation&&(c.rotation=i.currentRotation))}),r.startTime=0,r.stopTime=u[u.length-1],r.playing=!0,r.loop=(e==null?void 0:e.runLoop)??!0,r.currentTimeChanged.don(p=>{i.path.currentTime=p}))}}_eslineInterpolationModelRender(s,e){const{points:t}=s;if(t.length<2){console.warn("PolyLineLayer: points length is less than 3");return}const i=(e==null?void 0:e.interpolationDistance)??0;if(!i)return;const r=Wg(t,i/1e3),o=this.dv(new Et);this.d(this.sceneObject.components.disposableAdd(o)),o.url=e.url,o.instances=r.map(l=>({position:l,rotation:e.rotation,scale:e.scale}))}_eslineWallRender(s,e){const{points:t}=s;if(t.length<2){console.warn("PolyLineLayer: points length is less than 3");return}const i=e.height??0,r=e.width??0,o=e.extrudedHeight??0,l=t.map(u=>({lng:(u==null?void 0:u[0])??0,lat:(u==null?void 0:u[1])??0,alt:(u==null?void 0:u[2])??0})),h=$g(l,r).map(u=>[(u==null?void 0:u.lng)??0,(u==null?void 0:u.lat)??0,(u==null?void 0:u.alt)??0]),c=this.dv(new Ti);this.d(this.sceneObject.components.disposableAdd(c)),c.height=i,c.extrudedHeight=o,c.filled=e.filled??!0,c.fillColor=e.fillColor,c.allowPicking=(e==null?void 0:e.allowPicking)??!0,c.extras={selected:!1},c.points=h}renderLabel(s,e){const{points:t}=s,i=Bg(t);Ka(this.sceneObject,i,s,e)}}function id(n,s){try{JSON.stringify(n[n.length-1])!==JSON.stringify(n[0])&&n.push(n[0]);const e=K.featureCollection(n.map(h=>K.point(h))),t=K.polygon([n]),i={gridType:"point",units:"meters"};return K.interpolate(e,s,i).features.map(h=>h.geometry.coordinates)[0][0].filter(h=>K.booleanPointInPolygon(K.point(h),t))}catch(e){return console.error(e),[]}}class Zg extends b{constructor(s,e,t,i){super(),this.sceneObject=s;const r=e;if(i&&_t(r,o=>{this.renderLabel(o,i)}),t)if(t.type==="simple"){const{visualVariables:o}=t;_t(r,l=>{const h=Za(l,t,o);this.render(l,h)})}else if(t.type==="unique-value"){const{visualVariables:o}=t;_t(r,l=>{const h=Qa(l,t,o);this.render(l,h)})}else if(t.type==="class-breaks"){const{visualVariables:o}=t;_t(r,l=>{const h=el(l,t,o);this.render(l,h)})}else console.error("PolyLineLayer: renderer type is not supported")}renderLabel(s,e){const{points:t}=s;console.log("PolygonLayer: renderLabel",t);const i=Hg(t);Ka(this.sceneObject,i,s,e)}render(s,e){e.type==="simple-fill"?this._simplePolygonRender(s,e):e.type==="ESGeoExtrudedPolygon"?this._esGeoExtrudedPolygonRender(s,e):e.type==="PolygonInterpolateESGltfModel"?this._polygonInterpolateESGltfModelRender(s,e):e.type==="PolygonInterpolateESImageLabel"?this._polygonInterpolateESImageLabelRender(s,e):console.error("PolyLineLayer: symbol type is not supported")}_simplePolygonRender(s,e){const{points:t}=s;if(t.length<3){console.warn("PolygonLayer: points length is less than 3");return}const{color:i,outline:r,filled:o,ground:l}=e,{width:h,color:c,stroked:u}=r,p=this.dv(new ee);this.d(this.sceneObject.components.disposableAdd(p)),p.stroked=u??!1,p.strokeColor=c??[1,1,1,1],p.strokeWidth=h??1,p.filled=o??!0,p.fillGround=l??!1,p.fillColor=i??[1,1,1,1],p.allowPicking=(e==null?void 0:e.allowPicking)??!0,p.extras={selected:!1},p.points=[...t]}_esGeoExtrudedPolygonRender(s,e){const{points:t}=s;if(t.length<3){console.warn("PolygonLayer: points length is less than 3");return}const{height:i,extrudedHeight:r,color:o}=e,l=this.dv(new Ti);this.d(this.sceneObject.components.disposableAdd(l)),l.height=i,l.extrudedHeight=r,l.filled=!0,l.fillColor=o,l.allowPicking=(e==null?void 0:e.allowPicking)??!0,l.extras={selected:!1},l.points=[...t]}_polygonInterpolateESGltfModelRender(s,e){const{points:t}=s;if(t.length<3){console.warn("PolygonLayer: points length is less than 3");return}const{height:i,interpolateDistance:r,url:o,rotation:l,scale:h}=e,c=id(t,r??10),u=this.dv(new Et);this.d(this.sceneObject.components.disposableAdd(u)),u.url=o,u.instances=c.map(p=>({position:[...p,i??0],rotation:l??[0,0,0],scale:h??[1,1,1]}))}_polygonInterpolateESImageLabelRender(s,e){const{points:t}=s;if(t.length<3){console.warn("PolygonLayer: points length is less than 3");return}const{height:i,interpolateDistance:r,offset:o,size:l,url:h,anchor:c}=e,p={type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"MultiPoint",coordinates:[...id(t,r??10).map(m=>[...m,i??0])]}}]},g=this.dv(new Pn);this.d(this.sceneObject.components.disposableAdd(g)),g.textDefaultText="",g.imageUrl=h,c&&(g.imageAnchor=c),o&&(g.imageOffset=o),l&&(g.imageSize=l),g.url=p}}class Qg extends b{constructor(e,t){super();a(this,"_initEvent",this.dv(new v));const i=this,r=async()=>{try{const l=e.featureProps;if(!l)return;const{heightMode:h,features:c,layerType:u,url:p}=l;let g=[];if(!c&&p){let m=await fetch(p).then(y=>y.json());return m=(m==null?void 0:m.features)??m,u==="polylineVector"?g=await qc(t,m,h):u==="polygonVector"?g=await Yc(t,m,h):u==="pointVector"&&(g=await Xc(t,m,h)),g}else u==="polylineVector"?g=await qc(t,c,h):u==="polygonVector"?g=await Yc(t,c,h):u==="pointVector"&&(g=await Xc(t,c,h));return g}catch(l){console.error(l);return}},o=this.dv(oe(this._initEvent,e.featurePropsChanged));i.dv(new le(o,()=>{if(!e.featureProps)return;const l=e.featureProps;let h;return(async()=>{const{layerType:u,renderer:p,labelingInfo:g}=l,m=await r();!m||m.length===0||(u==="pointVector"?h=new Yg(e,m,p,g):u==="polylineVector"?h=new Kg(e,m,p,g):u==="polygonVector"&&(h=new Zg(e,m,p,g)),console.log("polygonVectorLayer","createLayer",h))})().catch(console.error),{destroy:()=>{var u;(u=h==null?void 0:h.destroy)==null||u.call(h),h=void 0}}}));{const l=(h,c=1)=>{const u=tc(h);if(!u)return;const{center:p,radius:g}=u;t.flyTo({distance:g*4,heading:0,pitch:-90,flyDuration:c??1,hDelta:0,pDelta:0},p)};i.d(e.flyToEvent.don(async h=>{const{featureProps:c}=e;if(!c)return;const u=await r();if(!u)return;let p=[];c.layerType==="polylineVector"?p=u.map(g=>g.points).flat():c.layerType==="polygonVector"?p=u.map(g=>g.points).flat():c.layerType==="pointVector"&&(p=u.map(g=>g.points)),p.length!==0&&l(p,h)}))}}init(){this._initEvent.emit()}}const Ys=class Ys extends X{constructor(e){super(e);a(this,"featureLayerMap",new Map);const t=this;t.d(t.viewerAttached.don(i=>{if(console.log("ESFeatureLayer","viewerAttached",i.id),t.featureLayerMap.has(i.id))return;const r=new Qg(t,i);r.init(),t.featureLayerMap.set(i.id,r)})),t.d(t.viewerDetached.don(i=>{var r;console.log("ESFeatureLayer","viewerDetached",i.id),t.featureLayerMap.has(i.id)&&((r=t.featureLayerMap.get(i.id))==null||r.destroy(),t.featureLayerMap.delete(i.id))})),t.d(()=>{for(const i of t.featureLayerMap.values())i.destroy();t.featureLayerMap.clear()}),t.d(de(t.showChanged,()=>{for(const i of t.components.values())Reflect.has(i,"show")&&(i.show=t.show)},{immediate:!0}))}};a(Ys,"createDefaultProps",()=>({...X.createDefaultProps(),featureProps:te(void 0)})),a(Ys,"type",Ys.register("ESFeatureLayer",Ys,{chsName:"要素图层",tags:["ESObjects"],description:`ESFeatureLayer 是用于在场景中加载和显示要素图层的对象。
|
|
1291
|
+
`})),a(Xi,"supportEditingModes",[...U.supportEditingModes,I.ScatterAppend,I.ScatterModify]);let On=Xi;const Xc=async(n,s=[],e)=>{const t=[];for(const i of s){const{coordinates:r}=i.geometry;for(const o of r){const l=await Promise.all(o.map(async h=>{let c=h[2]??0;if(e)if(e.type==="absolute")c=e.height??c;else if(e.type==="relative"){const u=await n.getTerrainHeight([h[0],h[1]])??0;c=(e.height??c)+u}else e.type==="terrain"&&(c=await n.getTerrainHeight([h[0],h[1]])??0);return[h[0],h[1],c]}));t.push({...i,points:l})}}return t},Yc=async(n,s=[],e)=>await Promise.all(s.map(async t=>{var h,c,u,p,g,m,y,S,C;const i=((h=t.geometry)==null?void 0:h.x)??((u=(c=t.geometry)==null?void 0:c.coordinates)==null?void 0:u[0]),r=((p=t.geometry)==null?void 0:p.y)??((m=(g=t.geometry)==null?void 0:g.coordinates)==null?void 0:m[1]);let l=((y=t.geometry)==null?void 0:y.z)??((C=(S=t.geometry)==null?void 0:S.coordinates)==null?void 0:C[2])??0;if(e)if(e.type==="absolute")l=e.height??l;else if(e.type==="relative"){const T=await n.getTerrainHeight([i,r])??0;l=(e.height??l)+T}else e.type==="terrain"&&(l=await n.getTerrainHeight([i,r])??0);return{...t,points:[i,r,l]}})),Kc=async(n,s=[],e)=>{const t=[];return await Promise.all(s.map(async i=>{const{coordinates:r}=i.geometry;await Promise.all(r.map(async o=>{const l=await Promise.all(o.map(async h=>{let c=h[2]??0;if(e)if(e.type==="absolute")c=e.height??c;else if(e.type==="relative"){const u=await n.getTerrainHeight([h[0],h[1]])??0;c=(e.height??c)+u}else e.type==="terrain"&&(c=await n.getTerrainHeight([h[0],h[1]])??0);return[h[0],h[1],c]}));t.push({...i,points:l})}))})),t};function Bg(n){const s=K.lineString(n),e=K.length(s),t=K.along(s,e/2);return[t.geometry.coordinates[0],t.geometry.coordinates[1],t.geometry.coordinates[2]||0]}function Wg(n,s){const e=K.lineString(n),t=K.length(e),i=Math.floor(t/s),r=[];if(r.push(n[0]),i<1)return[n[0]];for(let o=1;o<i;o+=1){const l=K.along(e,t*(o/i));r.push([l.geometry.coordinates[0],l.geometry.coordinates[1],l.geometry.coordinates[2]||0])}return r}function Hg(n){const s=[...n];JSON.stringify(n[0])!==JSON.stringify(n[n.length-1])&&s.push(n[0]);const e=K.polygon([s]),t=K.center(e);return[t.geometry.coordinates[0],t.geometry.coordinates[1],t.geometry.coordinates[2]||0]}function Zc(n,s,e){const t=n.dv(new ms);for(const i in e)i!=="type"&&(t[i]=e[i]);t.position=s,n.d(n.components.disposableAdd(t))}function Ka(n,s,e,t){let i=t.textTemplate||t.symbol.text||"";const r=/{{(.*?)}}/;for(;r.test(i);){const u=i.match(r);if(u){const p=u[1].trim(),g=e[`${p}`]||"-";i=i.replace(u[0],g)}}let o=t.symbol;const{minVisibleDistance:l,maxVisibleDistance:h}=t;l&&h&&(o={...o,minVisibleDistance:l,maxVisibleDistance:h});const c={...o,text:i};Zc(n,s,c)}function ws(n,s){const e={width:null,height:null,color:null,opacity:null,rotation:null};return s.forEach(t=>{t.type==="size"?t.axis==="width"?e.width=n[t.field]||null:t.axis==="height"&&(e.height=n[t.field]||null):t.type==="color"?e.color=n[t.field]||null:t.type==="opacity"?e.opacity=n[t.field]||null:t.type==="rotation"&&(e.rotation=n[t.field]||null)}),e}function Za(n,s,e){const i={...s.symbol};if(e&&e.length>0){const r=ws(n,e);for(let o in r)i[o]!==void 0&&r[o]!==null&&(i[o]=r[o])}return i}function Qa(n,s,e){var c,u;const t=s,{uniqueValueInfos:i,field:r,fieldDelimiter:o,defaultSymbol:l}=t;let h={...l};if(Array.isArray(r)){const g=r.map(m=>n[m]??"").join(o);h=((c=i.find(m=>m.value==g))==null?void 0:c.symbol)||l}else h=((u=i.find(p=>p.value==n[r]))==null?void 0:u.symbol)||l;if(e&&e.length>0){const p=ws(n,e);for(let g in p)h[g]!==void 0&&p[g]!==null&&(h[g]=p[g])}return h}function el(n,s,e){const t=s,{classBreakInfos:i,field:r,defaultSymbol:o}=t;let l=o;const h=n[r];if(h===void 0||typeof h!="number")l=o;else{const c=i.find(u=>h<=u.maxValue&&h>=u.minValue);c?l=c.symbol:l=o}if(e&&e.length>0){const c=ws(n,e);for(let u in c)l[u]!==void 0&&c[u]!==null&&(l[u]=c[u])}return l}function $g(n,s){function e(c,u,p,g){const m=$=>$*Math.PI/180,y=$=>$*180/Math.PI,S=m(c),C=m(p),T=m(g-u),V=Math.sin(T)*Math.cos(C),z=Math.cos(S)*Math.sin(C)-Math.sin(S)*Math.cos(C)*Math.cos(T),x=Math.atan2(V,z);return(y(x)+360)%360}function t(c,u,p,g,m){const S=Q=>Q*Math.PI/180,C=Q=>Q*180/Math.PI,T=g/6371e3,V=S(m),z=S(c),x=S(u),$=Math.asin(Math.sin(z)*Math.cos(T)+Math.cos(z)*Math.sin(T)*Math.cos(V)),Y=x+Math.atan2(Math.sin(V)*Math.sin(T)*Math.cos(z),Math.cos(T)-Math.sin(z)*Math.sin($));return{lat:C($),lng:C(Y),alt:p}}function i(c){const u=[];c.length>1&&u.push(e(c[0].lat,c[0].lng,c[1].lat,c[1].lng));for(let p=1;p<c.length-1;p++){const g=e(c[p-1].lat,c[p-1].lng,c[p].lat,c[p].lng),m=e(c[p].lat,c[p].lng,c[p+1].lat,c[p+1].lng);let y=(g+m)/2;Math.abs(g-m)>180&&(y=(y+180)%360),u.push(y)}return c.length>1&&u.push(e(c[c.length-2].lat,c[c.length-2].lng,c[c.length-1].lat,c[c.length-1].lng)),c.length===1&&u.push(0),u}if(!n||n.length<2)throw new Error("至少需要两个点才能生成路径");if(s<=0)throw new Error("宽度必须大于0");const r=s/2,o=i(n),l=[],h=[];for(let c=0;c<n.length;c++){const u=(o[c]+90)%360,p=(o[c]+270)%360,g=n[c].alt!==void 0?n[c].alt:0;l.push(t(n[c].lat,n[c].lng,g,r,u)),h.push(t(n[c].lat,n[c].lng,g,r,p))}return l.concat(h.reverse())}function Gg(n,s,e,t){function i(S){return S*(Math.PI/180)}const r=6378137,o=i(n),l=i(s),h=i(e),c=i(t),u=h-o,p=c-l,g=Math.sin(u/2)**2+Math.cos(o)*Math.cos(h)*Math.sin(p/2)**2,m=2*Math.atan2(Math.sqrt(g),Math.sqrt(1-g));return r*m}const Qc=(n,s,e)=>Array.isArray(s)?s.map(r=>n[r]??"").join(e):n[s]??"";function ed(n,s){const t={...s.symbol};return{points:n.map(i=>i.points),symbol:t}}function td(n,s){const e=s,{uniqueValueInfos:t,field:i,fieldDelimiter:r,defaultSymbol:o}=e,l=[],h=t.reduce((u,p)=>{const g=p.value.toString();return u[g]={points:[],value:p.value,symbol:p.symbol},u},{});for(let u=0;u<n.length;u++){const p=n[u],g=Qc(p,i,r);if(g!==void 0&&g!==""){const m=h[g.toString()];m?m.points.push(p.points):l.push(p.points)}else l.push(p.points)}const c=[];for(let u in h){const{points:p,symbol:g}=h[u];p.length>0&&c.push({points:p,symbol:g})}return l.length>0&&c.push({points:l,symbol:o}),c}function id(n,s){const e=s,{classBreakInfos:t,field:i,defaultSymbol:r}=e,o=[],l=t.map(c=>({...c,points:[]}));for(let c=0;c<n.length;c++){const u=n[c],p=u[i];if(p===void 0||typeof p!="number")o.push(u.points);else{const g=l.findIndex(m=>p<=m.maxValue&&p>=m.minValue);g!==-1?l[g].points.push(u.points):o.push(u.points)}}const h=[];return l.forEach(c=>{c.points.length>0&&h.push({points:c.points,symbol:c.symbol})}),o.length>0&&h.push({points:o,symbol:r}),h}function Jg(n,s,e=[]){const i={...s.symbol},r=n.map(o=>{const l=ws(o,e);return{position:o.points,rotation:l.rotation||i.rotation||[0,0,0],scale:i.scale||[1,1,1]}});return{url:i.url,locations:r}}function qg(n,s,e=[]){const t=s,{uniqueValueInfos:i,field:r,fieldDelimiter:o}=t,l=t.defaultSymbol,h=[],c=i.reduce((p,g)=>{const m=g.value.toString();return p[m]={locations:[],value:g.value,symbol:g.symbol},p},{});for(let p=0;p<n.length;p++){const g=n[p],m=Qc(g,r,o);if(m){const y=c[m.toString()];if(y){const S=ws(g,e);y.locations.push({position:g.points,rotation:S.rotation||l.rotation||[0,0,0],scale:l.scale||[1,1,1]})}else h.push({position:g.points,rotation:l.rotation||[0,0,0],scale:l.scale||[1,1,1]})}else h.push({position:g.points,rotation:l.rotation||[0,0,0],scale:l.scale||[1,1,1]})}const u=[];for(let p in c){const{locations:g,symbol:m}=c[p];g.length>0&&u.push({url:m.url,locations:g})}return h.length>0&&u.push({url:l.url,locations:h}),u}function Xg(n,s,e=[]){const t=s,{classBreakInfos:i,field:r}=t,o=t.defaultSymbol,l=[],h=i.map(u=>({...u,locations:[]}));for(let u=0;u<n.length;u++){const p=n[u],g=p[r];if(g===void 0||typeof g!="number")l.push({position:p.points,rotation:o.rotation||[0,0,0],scale:o.scale||[1,1,1]});else{const m=h.findIndex(y=>g<=y.maxValue&&g>=y.minValue);if(m!==-1){const y=ws(p,e);h[m].locations.push({position:p.points,rotation:y.rotation||o.rotation||[0,0,0],scale:h[m].symbol.scale||[1,1,1]})}else l.push({position:p.points,rotation:o.rotation||[0,0,0],scale:o.scale||[1,1,1]})}}const c=[];return h.forEach(u=>{u.locations.length>0&&c.push({url:u.symbol.url,locations:u.locations})}),l.length>0&&c.push({url:o.url,locations:l}),c}class Yg extends b{constructor(e,t,i,r){super();a(this,"labelingInfo");this.sceneObject=e;const o=t;if(r&&_t(o,l=>{this.renderLabel(l,r)}),i)if(i.type==="simple"){const{visualVariables:l}=i;if(i.symbol.type==="simple-point"&&(!l||l.length==0)){console.log("PointLayer:大批量点渲染!");const h=ed(o,i);this._simplePointAllRender(h.points,h.symbol);return}if(i.symbol.type==="ESImageLabel"&&(!l||l.length==0)){console.log("PointLayer:大批量点渲染成图标!");const h=ed(o,i);this._imageAllRender(h.points,h.symbol);return}if(i.symbol.type==="ESGltfModel"){console.log("PointLayer:大批量点渲染成gltf!");const{url:h,locations:c}=Jg(o,i,l);this._modelAllRender(h,c);return}for(let h=0;h<o.length;h++){const c=Za(o[h],i,l);this.render(o[h],c)}}else if(i.type==="unique-value"){const{visualVariables:l}=i;if(i.uniqueValueInfos.findIndex(p=>p.symbol.type!=="simple-point")===-1&&i.defaultSymbol.type==="simple-point"&&(!l||l.length==0)){console.log("PointLayer:大批量点渲染!"),td(o,i).forEach(({points:g,symbol:m})=>{this._simplePointAllRender(g,m)});return}if(i.uniqueValueInfos.findIndex(p=>p.symbol.type!=="ESImageLabel")===-1&&i.defaultSymbol.type==="ESImageLabel"&&(!l||l.length==0)){console.log("PointLayer:大批量点渲染成图标!"),td(o,i).forEach(({points:g,symbol:m})=>{this._imageAllRender(g,m)});return}if(i.uniqueValueInfos.findIndex(p=>p.symbol.type!=="ESGltfModel")===-1&&i.defaultSymbol.type==="ESGltfModel"){console.log("PointLayer:大批量点渲染成gltf!"),qg(o,i,l).forEach(({url:g,locations:m})=>{this._modelAllRender(g,m)});return}for(let p=0;p<o.length;p++){const g=Qa(o[p],i,l);this.render(o[p],g)}}else if(i.type==="class-breaks"){const{visualVariables:l}=i;if(i.classBreakInfos.findIndex(p=>p.symbol.type!=="simple-point")===-1&&i.defaultSymbol.type==="simple-point"&&(!l||l.length==0)){console.log("PointLayer:大批量点渲染!"),id(o,i).forEach(({points:g,symbol:m})=>{this._simplePointAllRender(g,m)});return}if(i.classBreakInfos.findIndex(p=>p.symbol.type!=="ESImageLabel")===-1&&i.defaultSymbol.type==="ESImageLabel"&&(!l||l.length==0)){console.log("PointLayer:大批量点渲染成图标!"),id(o,i).forEach(({points:g,symbol:m})=>{this._imageAllRender(g,m)});return}if(i.classBreakInfos.findIndex(p=>p.symbol.type!=="ESGltfModel")===-1&&i.defaultSymbol.type==="ESGltfModel"){console.log("PointLayer:大批量点渲染成gltf!"),Xg(o,i,l).forEach(({url:g,locations:m})=>{this._modelAllRender(g,m)});return}for(let p=0;p<o.length;p++){const g=el(o[p],i,l);this.render(o[p],g)}}else if(i.type==="heatmap"){const{field:l,fieldValueMax:h,fieldValueMin:c}=i;console.time();const u=o.map(p=>{const{points:g}=p;if(l&&typeof l=="string"){let m=p[l];typeof m=="number"&&(typeof h=="number"&&m>h&&(m=h),typeof c=="number"&&m<c&&(m=c),g[2]=m)}return g});this.renderHeatmap(u,i)}else console.error("PointLayer: renderer type is not supported")}renderLabel(e,t){const{points:i}=e;Ka(this.sceneObject,i,e,t)}renderHeatmap(e,t){const{is3D:i,radius:r,blur:o,gradient:l}=t,h=this.dv(new Sr);this.d(this.sceneObject.components.disposableAdd(h)),h.is3D=i,h.radius=r,h.blur=o,l&&(h.gradient={...l}),h.data=e}render(e,t){t.type==="simple-point"?this._simplePointRender(e,t):t.type==="ESImageLabel"?this._simpleImageRender(e,t):t.type==="ESGltfModel"?this._simpleModelRender(e,t):t.type==="ESTextLabel"?Zc(this.sceneObject,e.points,t):t.type==="ESParticleSystemPrimitive"?this._simpleParticleRender(e,t):console.error(" PointLayer: symbol type is not supported")}_simplePointRender(e,t){const{points:i}=e,{size:r,color:o,outlineColor:l,outlineWidth:h}=t,c=this.dv(new On);this.d(this.sceneObject.components.disposableAdd(c)),c.pointed=!0,c.pointOutlineColor=l,c.pointOutlineWidth=h,c.pointSize=r,c.pointColor=o,c.allowPicking=(t==null?void 0:t.allowPicking)??!0,c.extras={selected:!1},c.points=[i]}_simplePointAllRender(e,t){const{size:i,color:r,outlineColor:o,outlineWidth:l}=t,h=this.dv(new On);this.d(this.sceneObject.components.disposableAdd(h)),h.pointed=!0,h.pointOutlineColor=o,h.pointOutlineWidth=l,h.pointSize=i,h.pointColor=r,h.allowPicking=(t==null?void 0:t.allowPicking)??!0,h.points=[...e]}_simpleImageRender(e,t){const{points:i}=e,{rotation:r,offset:o,size:l,url:h,screenRender:c,anchor:u,renderMode:p,rotationType:g}=t,m=this.dv(new pr),y=this.dv(new ms);this.d(this.sceneObject.components.disposableAdd(m)),this.d(this.sceneObject.components.disposableAdd(y)),m.url=h,m.renderMode=p??0,r&&(m.rotation=r),o&&(m.offset=o),m.size=l||[32,32],u&&(m.anchor=u),g&&(m.rotationType=g),m.screenRender=c??!0,m.allowPicking=(t==null?void 0:t.allowPicking)??!0,m.extras={selected:!1},m.position=[...i],m.sizeByContent=!1,y.allowPicking=(t==null?void 0:t.allowPicking)??!0;const S=l?Math.max(...l)+10:Math.max(...m.size)+10;y.sizeByContent=!1,y.screenRender=!0,y.size=[S,S],y.borderRadius=[S,S,S,S],y.padding=[S/2,S/2,S/2,S/2],y.borderWidth=S/10,y.offset=[0,S/10+5],y.text="",y.backgroundColor=[0,0,0,0],y.borderColor=[0,0,0,0]}_imageAllRender(e,t){const i={type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"MultiPoint",coordinates:e}}]},r=this.dv(new Pn);this.d(this.sceneObject.components.disposableAdd(r));const o=this.dv(new ms);this.d(this.sceneObject.components.disposableAdd(o)),r.textDefaultText="";const{offset:l,size:h,url:c,anchor:u}=t;r.imageUrl=c,u&&(r.imageAnchor=u),l&&(r.imageOffset=l),r.imageSize=h||[32,32],r.url=i,r.allowPicking=(t==null?void 0:t.allowPicking)??!0,r.extras={selected:!1},o.allowPicking=!0;const p=h?Math.max(...h)+10:Math.max(...r.imageSize)+10;o.sizeByContent=!1,o.size=[p,p],o.borderRadius=[p,p,p,p],o.padding=[p/2,p/2,p/2,p/2],o.borderWidth=p/10,o.offset=[0,p/10+5],o.text="",o.backgroundColor=[0,0,0,0],o.borderColor=[0,0,0,0]}_simpleModelRender(e,t){const{points:i}=e,{rotation:r,scale:o,url:l}=t,h=this.dv(new Et);this.d(this.sceneObject.components.disposableAdd(h)),h.url=l,r&&(h.rotation=r),o&&(h.scale=o),h.position=[...i]}_modelAllRender(e,t){const i=this.dv(new Et);this.d(this.sceneObject.components.disposableAdd(i)),i.url=e,i.instances=t}_simpleParticleRender(e,t){const{points:i}=e,r=this.dv(new gr);this.d(this.sceneObject.components.disposableAdd(r)),r.position=[...i],Object.keys(t).forEach(o=>{r[o]=t[o]})}}class Kg extends b{constructor(s,e,t,i){super(),this.sceneObject=s;const r=e;if(i&&_t(r,o=>{this.renderLabel(o,i)}),t)if(t.type==="simple"){const{visualVariables:o}=t;_t(r,l=>{const h=Za(l,t,o);this.render(l,h)})}else if(t.type==="unique-value"){const{visualVariables:o}=t;_t(r,l=>{const h=Qa(l,t,o);this.render(l,h)})}else if(t.type==="class-breaks"){const{visualVariables:o}=t;_t(r,l=>{const h=el(l,t,o);this.render(l,h)})}else console.error("PolyLineLayer: renderer type is not supported")}render(s,e){console.log("PolyLineLayer: render",s,e),e.type==="simple-line"?this._simpleLineRender(s,e):e.type==="ESPolygonFence"?this._esPolygonFenceRender(s,e):e.type==="ESPipeFence"?this._esPipeFenceRender(s,e):e.type==="ESPath"?this._esPathRender(s,e):e.type==="ESlineInterpolationModel"?this._eslineInterpolationModelRender(s,e):e.type==="ESlineWall"?this._eslineWallRender(s,e):console.error("PolyLineLayer: symbol type is not supported")}_simpleLineRender(s,e){const{points:t}=s;if(t.length<2){console.warn("PolyLineLayer: points length is less than 3");return}const i=this.dv(new ve);this.d(this.sceneObject.components.disposableAdd(i)),i.points=[...t],i.stroked=!0,i.strokeColor=e.color,i.strokeWidth=e.width||1,i.allowPicking=(e==null?void 0:e.allowPicking)??!0,i.extras={selected:!1}}_esPolygonFenceRender(s,e){const{points:t}=s;if(t.length<3){console.warn("PolyLineLayer: points length is less than 3");return}const i=this.dv(new _r);this.d(this.sceneObject.components.disposableAdd(i)),i.points=[...t],i.height=e.height,i.materialMode=e.materialMode}_esPipeFenceRender(s,e){const{points:t}=s;if(t.length<2){console.warn("PolyLineLayer: points length is less than 3");return}const i=this.dv(new vr);this.d(this.sceneObject.components.disposableAdd(i)),i.points=[...t],i.height=e.height,i.width=e.width,i.materialMode=e.materialMode}_esPathRender(s,e){const{points:t}=s;if(t.length<2){console.warn("PolyLineLayer: points length is less than 3");return}const i=this.dv(new ys),r=this.dv(new _s);if(this.d(this.sceneObject.components.disposableAdd(i)),this.d(this.sceneObject.components.disposableAdd(r)),i.points=[...t],i.speed=e.speed,i.strokeColor=e.color,i.materialMode=e.materialMode,i.strokeWidth=e.width||1,e!=null&&e.runModel){const l=e==null?void 0:e.runSpeed,h=e==null?void 0:e.modelSymbol;let c;switch(e==null?void 0:e.runModel){case"ESHuman":c=this.dv(new Be);break;case"ESCar":c=this.dv(new hr);break;case"ESGltfModel":c=this.dv(new Et)}if(this.d(this.sceneObject.components.disposableAdd(c)),h)for(let p in h)c[p]=h[p];const u=[0];for(var o=0;o<t.length-1;o+=1){const p=t[o],g=t[o+1],m=Gg(p[1],p[0],g[1],g[0]);u.push(u[o]+Math.ceil(m/l)*1e3)}i.timeStamps=u,e!=null&&e.runSpeed&&(i.currentPositionChanged.don(p=>{i.currentPosition&&(c.position=i.currentPosition,i.currentRotation&&(c.rotation=i.currentRotation))}),r.startTime=0,r.stopTime=u[u.length-1],r.playing=!0,r.loop=(e==null?void 0:e.runLoop)??!0,r.currentTimeChanged.don(p=>{i.path.currentTime=p}))}}_eslineInterpolationModelRender(s,e){const{points:t}=s;if(t.length<2){console.warn("PolyLineLayer: points length is less than 3");return}const i=(e==null?void 0:e.interpolationDistance)??0;if(!i)return;const r=Wg(t,i/1e3),o=this.dv(new Et);this.d(this.sceneObject.components.disposableAdd(o)),o.url=e.url,o.instances=r.map(l=>({position:l,rotation:e.rotation,scale:e.scale}))}_eslineWallRender(s,e){const{points:t}=s;if(t.length<2){console.warn("PolyLineLayer: points length is less than 3");return}const i=e.height??0,r=e.width??0,o=e.extrudedHeight??0,l=t.map(u=>({lng:(u==null?void 0:u[0])??0,lat:(u==null?void 0:u[1])??0,alt:(u==null?void 0:u[2])??0})),h=$g(l,r).map(u=>[(u==null?void 0:u.lng)??0,(u==null?void 0:u.lat)??0,(u==null?void 0:u.alt)??0]),c=this.dv(new Ti);this.d(this.sceneObject.components.disposableAdd(c)),c.height=i,c.extrudedHeight=o,c.filled=e.filled??!0,c.fillColor=e.fillColor,c.allowPicking=(e==null?void 0:e.allowPicking)??!0,c.extras={selected:!1},c.points=h}renderLabel(s,e){const{points:t}=s,i=Bg(t);Ka(this.sceneObject,i,s,e)}}function sd(n,s){try{JSON.stringify(n[n.length-1])!==JSON.stringify(n[0])&&n.push(n[0]);const e=K.featureCollection(n.map(h=>K.point(h))),t=K.polygon([n]),i={gridType:"point",units:"meters"};return K.interpolate(e,s,i).features.map(h=>h.geometry.coordinates)[0][0].filter(h=>K.booleanPointInPolygon(K.point(h),t))}catch(e){return console.error(e),[]}}class Zg extends b{constructor(s,e,t,i){super(),this.sceneObject=s;const r=e;if(i&&_t(r,o=>{this.renderLabel(o,i)}),t)if(t.type==="simple"){const{visualVariables:o}=t;_t(r,l=>{const h=Za(l,t,o);this.render(l,h)})}else if(t.type==="unique-value"){const{visualVariables:o}=t;_t(r,l=>{const h=Qa(l,t,o);this.render(l,h)})}else if(t.type==="class-breaks"){const{visualVariables:o}=t;_t(r,l=>{const h=el(l,t,o);this.render(l,h)})}else console.error("PolyLineLayer: renderer type is not supported")}renderLabel(s,e){const{points:t}=s;console.log("PolygonLayer: renderLabel",t);const i=Hg(t);Ka(this.sceneObject,i,s,e)}render(s,e){e.type==="simple-fill"?this._simplePolygonRender(s,e):e.type==="ESGeoExtrudedPolygon"?this._esGeoExtrudedPolygonRender(s,e):e.type==="PolygonInterpolateESGltfModel"?this._polygonInterpolateESGltfModelRender(s,e):e.type==="PolygonInterpolateESImageLabel"?this._polygonInterpolateESImageLabelRender(s,e):console.error("PolyLineLayer: symbol type is not supported")}_simplePolygonRender(s,e){const{points:t}=s;if(t.length<3){console.warn("PolygonLayer: points length is less than 3");return}const{color:i,outline:r,filled:o,ground:l}=e,{width:h,color:c,stroked:u}=r,p=this.dv(new ee);this.d(this.sceneObject.components.disposableAdd(p)),p.stroked=u??!1,p.strokeColor=c??[1,1,1,1],p.strokeWidth=h??1,p.filled=o??!0,p.fillGround=l??!1,p.fillColor=i??[1,1,1,1],p.allowPicking=(e==null?void 0:e.allowPicking)??!0,p.extras={selected:!1},p.points=[...t]}_esGeoExtrudedPolygonRender(s,e){const{points:t}=s;if(t.length<3){console.warn("PolygonLayer: points length is less than 3");return}const{height:i,extrudedHeight:r,color:o}=e,l=this.dv(new Ti);this.d(this.sceneObject.components.disposableAdd(l)),l.height=i,l.extrudedHeight=r,l.filled=!0,l.fillColor=o,l.allowPicking=(e==null?void 0:e.allowPicking)??!0,l.extras={selected:!1},l.points=[...t]}_polygonInterpolateESGltfModelRender(s,e){const{points:t}=s;if(t.length<3){console.warn("PolygonLayer: points length is less than 3");return}const{height:i,interpolateDistance:r,url:o,rotation:l,scale:h}=e,c=sd(t,r??10),u=this.dv(new Et);this.d(this.sceneObject.components.disposableAdd(u)),u.url=o,u.instances=c.map(p=>({position:[...p,i??0],rotation:l??[0,0,0],scale:h??[1,1,1]}))}_polygonInterpolateESImageLabelRender(s,e){const{points:t}=s;if(t.length<3){console.warn("PolygonLayer: points length is less than 3");return}const{height:i,interpolateDistance:r,offset:o,size:l,url:h,anchor:c}=e,p={type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"MultiPoint",coordinates:[...sd(t,r??10).map(m=>[...m,i??0])]}}]},g=this.dv(new Pn);this.d(this.sceneObject.components.disposableAdd(g)),g.textDefaultText="",g.imageUrl=h,c&&(g.imageAnchor=c),o&&(g.imageOffset=o),l&&(g.imageSize=l),g.url=p}}class Qg extends b{constructor(e,t){super();a(this,"_initEvent",this.dv(new v));const i=this,r=async()=>{try{const l=e.featureProps;if(!l)return;const{heightMode:h,features:c,layerType:u,url:p}=l;let g=[];if(!c&&p){let m=await fetch(p).then(y=>y.json());return m=(m==null?void 0:m.features)??m,u==="polylineVector"?g=await Xc(t,m,h):u==="polygonVector"?g=await Kc(t,m,h):u==="pointVector"&&(g=await Yc(t,m,h)),g}else u==="polylineVector"?g=await Xc(t,c,h):u==="polygonVector"?g=await Kc(t,c,h):u==="pointVector"&&(g=await Yc(t,c,h));return g}catch(l){console.error(l);return}},o=this.dv(oe(this._initEvent,e.featurePropsChanged));i.dv(new le(o,()=>{if(!e.featureProps)return;const l=e.featureProps;let h;return(async()=>{const{layerType:u,renderer:p,labelingInfo:g}=l,m=await r();!m||m.length===0||(u==="pointVector"?h=new Yg(e,m,p,g):u==="polylineVector"?h=new Kg(e,m,p,g):u==="polygonVector"&&(h=new Zg(e,m,p,g)),console.log("polygonVectorLayer","createLayer",h))})().catch(console.error),{destroy:()=>{var u;(u=h==null?void 0:h.destroy)==null||u.call(h),h=void 0}}}));{const l=(h,c=1)=>{const u=tc(h);if(!u)return;const{center:p,radius:g}=u;t.flyTo({distance:g*4,heading:0,pitch:-90,flyDuration:c??1,hDelta:0,pDelta:0},p)};i.d(e.flyToEvent.don(async h=>{const{featureProps:c}=e;if(!c)return;const u=await r();if(!u)return;let p=[];c.layerType==="polylineVector"?p=u.map(g=>g.points).flat():c.layerType==="polygonVector"?p=u.map(g=>g.points).flat():c.layerType==="pointVector"&&(p=u.map(g=>g.points)),p.length!==0&&l(p,h)}))}}init(){this._initEvent.emit()}}const Ys=class Ys extends X{constructor(e){super(e);a(this,"featureLayerMap",new Map);const t=this;t.d(t.viewerAttached.don(i=>{if(console.log("ESFeatureLayer","viewerAttached",i.id),t.featureLayerMap.has(i.id))return;const r=new Qg(t,i);r.init(),t.featureLayerMap.set(i.id,r)})),t.d(t.viewerDetached.don(i=>{var r;console.log("ESFeatureLayer","viewerDetached",i.id),t.featureLayerMap.has(i.id)&&((r=t.featureLayerMap.get(i.id))==null||r.destroy(),t.featureLayerMap.delete(i.id))})),t.d(()=>{for(const i of t.featureLayerMap.values())i.destroy();t.featureLayerMap.clear()}),t.d(de(t.showChanged,()=>{for(const i of t.components.values())Reflect.has(i,"show")&&(i.show=t.show)},{immediate:!0}))}};a(Ys,"createDefaultProps",()=>({...X.createDefaultProps(),featureProps:te(void 0)})),a(Ys,"type",Ys.register("ESFeatureLayer",Ys,{chsName:"要素图层",tags:["ESObjects"],description:`ESFeatureLayer 是用于在场景中加载和显示要素图层的对象。
|
|
1292
1292
|
对象json示例:
|
|
1293
1293
|
{
|
|
1294
1294
|
"id": "featurelayer_xxx",
|
|
@@ -1369,14 +1369,14 @@ ${Wc}
|
|
|
1369
1369
|
"position": [116.39, 39.9, 0],
|
|
1370
1370
|
"points": [[0, 0], [100, 0], [100, 100]]
|
|
1371
1371
|
}
|
|
1372
|
-
`}));let cl=Ks;const Zs=class Zs extends ti{constructor(s){super(s)}getESProperties(){const s={...super.getESProperties()};return{...s,more:[...s.more,new k("通用"),new ie([this,"points"],"本地位置数组",[]),new k("czm"),new E([this,"loop"],"首尾相连",!0),new E([this,"hasDash"],"是否为虚线",!0),new G([this,"gapColor"],"间隔颜色",[0,0,0,0]),new f([this,"dashLength"],"虚线长度",16),new Yn([this,"dashPattern"],"虚线图案",255),new E([this,"hasArrow"],"是否带箭头",!0),new E([this,"depthTest"],"是否开启深度检测",!1)]}}};a(Zs,"createDefaultProps",()=>({...ti.createDefaultProps(),points:
|
|
1372
|
+
`}));let cl=Ks;const Zs=class Zs extends ti{constructor(s){super(s)}getESProperties(){const s={...super.getESProperties()};return{...s,more:[...s.more,new k("通用"),new ie([this,"points"],"本地位置数组",[]),new k("czm"),new E([this,"loop"],"首尾相连",!0),new E([this,"hasDash"],"是否为虚线",!0),new G([this,"gapColor"],"间隔颜色",[0,0,0,0]),new f([this,"dashLength"],"虚线长度",16),new Yn([this,"dashPattern"],"虚线图案",255),new E([this,"hasArrow"],"是否带箭头",!0),new E([this,"depthTest"],"是否开启深度检测",!1)]}}};a(Zs,"createDefaultProps",()=>({...ti.createDefaultProps(),points:Nt(void 0),loop:!0,width:void 0,color:q(void 0),hasDash:!0,gapColor:F([0,0,0,0]),dashLength:16,dashPattern:255,hasArrow:!0,depthTest:!1,stroked:!0})),a(Zs,"type",Zs.register("ESLocalLineStringZ",Zs,{chsName:"局部坐标折线",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:`ESLocalLineStringZ 是用于在局部坐标系中创建和显示带有高度信息的三维折线的可视化对象。
|
|
1373
1373
|
对象json示例:
|
|
1374
1374
|
{
|
|
1375
1375
|
"type": "ESLocalLineStringZ",
|
|
1376
1376
|
"position": [116.39, 39.9, 0],
|
|
1377
1377
|
"points": [[0, 0, 0], [100, 0, 10], [100, 100, 20]]
|
|
1378
1378
|
}
|
|
1379
|
-
`}));let dl=Zs;const
|
|
1379
|
+
`}));let dl=Zs;const nd=`in vec3 position;
|
|
1380
1380
|
in vec3 normal;
|
|
1381
1381
|
in vec2 st;
|
|
1382
1382
|
out vec3 v_normalEC;
|
|
@@ -1387,7 +1387,7 @@ void main()
|
|
|
1387
1387
|
v_st = st;
|
|
1388
1388
|
gl_Position = czm_modelViewProjection * vec4(position, 1.0);
|
|
1389
1389
|
}
|
|
1390
|
-
`,
|
|
1390
|
+
`,rd=`in vec2 v_st;
|
|
1391
1391
|
uniform sampler2D u_image;
|
|
1392
1392
|
uniform vec4 u_color;
|
|
1393
1393
|
void main()
|
|
@@ -1395,7 +1395,7 @@ void main()
|
|
|
1395
1395
|
vec4 imageColor = texture(u_image, v_st);
|
|
1396
1396
|
out_FragColor = imageColor * u_color;
|
|
1397
1397
|
}
|
|
1398
|
-
`,
|
|
1398
|
+
`,od={type:"LocalAxisedBoundingBox",data:{min:[0,-1,0],max:[1,0,0]}},ad={depthTest:{enabled:!0},cull:{enabled:!0,face:1029},depthMask:!1,blending:{enabled:!0,equationRgb:32774,equationAlpha:32774,functionSourceRgb:770,functionSourceAlpha:1,functionDestinationRgb:771,functionDestinationAlpha:771}},ld={u_image:{type:"image",uri:""},u_color:[1,1,0,1]},hd={position:{typedArray:new Float32Array([0,0,0,0,-1,0,1,-1,0,0,0,0,1,-1,0,1,0,0]),componentsPerAttribute:3},normal:{typedArray:new Float32Array([0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1]),componentsPerAttribute:3},textureCoordinates:{typedArray:new Float32Array([0,1,0,0,1,0,0,1,1,0,1,1]),componentsPerAttribute:2}},cd=new Uint16Array([0,1,2,3,4,5]),dd={Float32Array,Float64Array,Int8Array,Int16Array,Int32Array,Uint8Array,Uint16Array,Uint32Array};function ud(n){const s={};for(let e of Object.keys(n)){const{typedArray:t,componentsPerAttribute:i,usage:r,normalize:o}=n[e];s[e]={typedArray:{type:t.constructor.name,array:[...t.values()]},componentsPerAttribute:i,usage:r,normalize:o}}return s}function sf(n){const s={};for(let e of Object.keys(n)){const{typedArray:{type:t,array:i},componentsPerAttribute:r,usage:o,normalize:l}=n[e],h=dd[t];if(!h)throw new Error(`不支持的 TypedArray 类型: ${t}`);s[e]={typedArray:new h(i),componentsPerAttribute:r,usage:o,normalize:l}}return s}function pd(n){return{type:n.constructor.name,array:[...n.values()]}}function nf(n){const{type:s,array:e}=n,t=dd[s];if(!t)throw new Error(`不支持的 TypedArray 类型: ${s}`);return new t(e)}const rf=[["POINTS","POINTS"],["LINES","LINES"],["LINE_LOOP","LINE_LOOP"],["LINE_STRIP","LINE_STRIP"],["TRIANGLES","TRIANGLES"],["TRIANGLE_STRIP","TRIANGLE_STRIP"],["TRIANGLE_FAN","TRIANGLE_FAN"]],of=[["ENVIRONMENT","ENVIRONMENT"],["COMPUTE","COMPUTE"],["GLOBE","GLOBE"],["TERRAIN_CLASSIFICATION","TERRAIN_CLASSIFICATION"],["CESIUM_3D_TILE","CESIUM_3D_TILE"],["CESIUM_3D_TILE_CLASSIFICATION","CESIUM_3D_TILE_CLASSIFICATION"],["CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW","CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW"],["OPAQUE","OPAQUE"],["TRANSLUCENT","TRANSLUCENT"],["OVERLAY","OVERLAY"],["NUMBER_OF_PASSES","NUMBER_OF_PASSES"]],af=`### 默认使用的渲染状态
|
|
1399
1399
|
\`\`\`
|
|
1400
1400
|
{
|
|
1401
1401
|
depthTest: {
|
|
@@ -1741,27 +1741,27 @@ export type IndexJsonType = {
|
|
|
1741
1741
|
array: number[];
|
|
1742
1742
|
}
|
|
1743
1743
|
\`\`\`
|
|
1744
|
-
`,De=class De extends j{constructor(e){super(e);a(this,"_attributes",this.disposeVar(w(void 0)));a(this,"_indexTypedArray",this.disposeVar(w(void 0)))}get attributesJson(){return this.attributes&&
|
|
1744
|
+
`,De=class De extends j{constructor(e){super(e);a(this,"_attributes",this.disposeVar(w(void 0)));a(this,"_indexTypedArray",this.disposeVar(w(void 0)))}get attributesJson(){return this.attributes&&ud(this.attributes)}set attributesJson(e){const t=JSON.stringify(this.attributesJson),i=JSON.stringify(e);t!==i&&(this.attributes=e&&sf(e))}get attributesJsonChanged(){return this.attributesChanged}get indexTypedArrayJson(){return this.indexTypedArray&&pd(this.indexTypedArray)}set indexTypedArrayJson(e){const t=JSON.stringify(this.indexTypedArrayJson),i=JSON.stringify(e);t!==i&&(this.indexTypedArray=e&&nf(e))}get indexTypedArrayJsonChanged(){return this.indexTypedArrayChanged}get attributes(){return this._attributes.value}set attributes(e){this._attributes.value=e}get attributesChanged(){return this._attributes.changed}get indexTypedArray(){return this._indexTypedArray.value}set indexTypedArray(e){this._indexTypedArray.value=e}get indexTypedArrayChanged(){return this._indexTypedArray.changed}setUniformMap(e){if(Object.entries(e).some(([i,r])=>r===null))return;const t={...this.uniformMap??{},...e};this.uniformMap=t}setLocalBoundingSphere(e,t=[0,0,0]){if(!Number.isFinite(e)||e<=0){console.warn(`!Number.isFinite(radius) || radius <= 0 radius: ${e}`);return}this.boundingVolume={type:"LocalBoundingSphere",data:{center:t,radius:e}}}setLocalAxisedBoundingBox(e,t){if(e.some(i=>!Number.isFinite(i))||t.some(i=>!Number.isFinite(i))){console.warn(`setLocalAxisedBoundingBox error, min: ${e.toString()}, max: ${t.toString()}`);return}this.boundingVolume={type:"LocalAxisedBoundingBox",data:{min:e,max:t}}}computeLocalAxisedBoundingBoxFromAttribute(e="a_position"){if(!this.attributes||!this.attributes[e]){console.warn(`attributes[${e}]不存在!无法获取!`);return}const t=this.attributes[e];if(!("typedArray"in t)||!(t.typedArray instanceof Float32Array)){console.warn(`!('typedArray' in posAttribute) || !(posAttribute.typedArray instanceof Float32Array) attributeName: ${e}`);return}if(!("componentsPerAttribute"in t)||t.componentsPerAttribute!==3){console.warn(`!('componentsPerAttribute' in posAttribute) || posAttribute.componentsPerAttribute !== 3 attributeName: ${e}`);return}const{min:i,max:r}=De.getMinMaxPosition(t.typedArray);if(!i.some(o=>!Number.isFinite(o)||r.some(l=>!Number.isFinite(l))))return{min:i,max:r}}getESProperties(){const e={...super.getESProperties()};return{...e,more:[...e.more,new k("通用"),new Fe([this,"viewDistanceRange"],"可视范围控制",void 0,!0),new E([this,"viewDistanceDebug"],"可视距离调试"),new k("屏幕像素"),new f([this,"maximumScale"],"最大缩放值",3,!0),new f([this,"minimumScale"],"最小缩放值",1,!0),new f([this,"pixelSize"],"屏幕像素",5,!0),new E([this,"showSceneScale"],"显示缩放值",!1,!0),new k("图元属性"),new R([this,"modelMatrix"],"模型矩阵",void 0,void 0,!0),new E([this,"cull"],"是否拣选",void 0,!0),new R([this,"boundingVolume"],"包围体",od,lf,!0),new A([this,"pass"],of,"渲染顺序","TRANSLUCENT",!0),new A([this,"primitiveType"],rf,"图元类型","TRIANGLES",!0),new R([this,"renderState"],"渲染状态",ad,af,!0),new Xe([this,"vertexShaderSource"],"顶点着色器",nd,hf,!0),new Xe([this,"fragmentShaderSource"],"片元着色器",rd,cf,!0),new R([this,"uniformMap"],"一致性变量(uniform)",ld,df,!0),new R([this,"attributesJson"],"顶点属性(attributes)",ud(hd),uf,!0),new R([this,"indexTypedArrayJson"],"索引(index)",pd(cd),pf,!0),new f([this,"count"],"count",0,!0),new f([this,"offset"],"offset",0,!0),new f([this,"instanceCount"],"instanceCount",0,!0),new L("自动计算包围盒",t=>{const i=this.computeLocalAxisedBoundingBoxFromAttribute(t);if(!i)return;const{min:r,max:o}=i;this.setLocalAxisedBoundingBox(r,o)},["position"],"setLocalAxisedBoundingBox"),new k("本地变换"),new nt([this,"localPosition"],"本地偏移",void 0,!0),new ds([this,"localRotation"],"本地姿态",void 0,!0),new ue([this,"localScale"],"本地缩放",[1,1,1],!0),new R([this,"localModelMatrix"],"本地模型矩阵",void 0,void 0,!0),new k("调试"),new E([this,"debugShowBoundingVolume"],"debugShowBoundingVolume",!1,!0),new f([this,"debugOverlappingFrustums"],"debugOverlappingFrustums",0,!0),new k("Czm特有"),new E([this,"occlude"],"occlude",!0,!0),new E([this,"castShadows"],"castShadows",!1,!0),new E([this,"receiveShadows"],"receiveShadows",!1,!0),new E([this,"executeInClosestFrustum"],"executeInClosestFrustum",!1,!0),new E([this,"pickOnly"],"pickOnly",!1,!0),new E([this,"depthForTranslucentClassification"],"depthForTranslucentClassification",!1,!0)]}}};a(De,"createDefaultProps",()=>({...j.createDefaultProps(),maximumScale:void 0,minimumScale:void 0,pixelSize:void 0,showSceneScale:void 0,modelMatrix:q(void 0),cull:w(void 0),boundingVolume:B(void 0),renderState:B(void 0),primitiveType:void 0,pass:void 0,vertexShaderSource:void 0,fragmentShaderSource:void 0,uniformMap:B(void 0),localPosition:q(void 0),localRotation:q(void 0),localScale:q(void 0),localModelMatrix:q(void 0),occlude:void 0,count:void 0,offset:void 0,instanceCount:void 0,castShadows:void 0,receiveShadows:void 0,executeInClosestFrustum:void 0,debugShowBoundingVolume:void 0,debugOverlappingFrustums:void 0,pickOnly:void 0,depthForTranslucentClassification:void 0,viewDistanceRange:q(void 0),viewDistanceDebug:!1})),a(De,"type",De.register("ESCustomPrimitive",De,{chsName:"ES自定义图元",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:`ESCustomPrimitive 是用于在场景中创建自定义渲染图元的对象,支持自定义着色器(顶点/片元)、顶点属性、包围盒和渲染状态。
|
|
1745
1745
|
对象json示例:
|
|
1746
1746
|
{
|
|
1747
1747
|
"type": "ESCustomPrimitive",
|
|
1748
1748
|
"position": [116.39, 39.9, 0],
|
|
1749
1749
|
"primitiveType": "TRIANGLES"
|
|
1750
1750
|
}
|
|
1751
|
-
`})),a(De,"defaultRenderState",
|
|
1751
|
+
`})),a(De,"defaultRenderState",ad),a(De,"defaultVertexShaderSource",nd),a(De,"defaultFragmentShaderSource",rd),a(De,"defaultUniformMap",ld),a(De,"defaultBoundingVolume",od),a(De,"defaultAttribute",hd),a(De,"defaultIndexTypedArray",cd),a(De,"getMinMaxPosition",Nl);let ul=De;const Qi=class Qi extends U{constructor(e){super(e);a(this,"editingBindMode","lineString")}getESProperties(){const e={...super.getESProperties()};return{...e,more:[...e.more,new k("通用"),new f([this,"width"],"线宽"),new A([this,"arcType"],[["直线","NONE"],["地理直线","GEODESIC"],["地理恒向线","RHUMB"]],"弧线类型","GEODESIC"),new N([this,"imageUrl"],"道路图片"),new ne([this,"repeat"],"重复次数")]}}};a(Qi,"createDefaultProps",()=>({...U.createDefaultProps(),width:50,arcType:"GEODESIC",imageUrl:"${earthsdk3-assets-script-dir}/assets/img/roads/4.jpg",repeat:[100,1],stroked:!0})),a(Qi,"type",Qi.register("ESRoad",Qi,{chsName:"贴地道路",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:`ESRoad 是用于在场景中创建贴地道路线对象的可视化对象,支持自定义纹理。
|
|
1752
1752
|
对象json示例:
|
|
1753
1753
|
{
|
|
1754
1754
|
"type": "ESRoad",
|
|
1755
1755
|
"points": [[116.39, 39.9, 0], [116.40, 39.91, 0]],
|
|
1756
1756
|
"width": 50
|
|
1757
1757
|
}
|
|
1758
|
-
`})),a(Qi,"supportEditingModes",[...U.supportEditingModes,I.LineStringAppend,I.LineStringInsert]);let pl=Qi;const
|
|
1758
|
+
`})),a(Qi,"supportEditingModes",[...U.supportEditingModes,I.LineStringAppend,I.LineStringInsert]);let pl=Qi;const Gt=class Gt extends U{constructor(e){super(e);a(this,"editingBindMode","lineString");a(this,"_player");this._player=this.disposeVar(new Ye);{const t=Gt.defaults;this.dispose(D([this._player,"loop"],[this,"loop"],i=>i??t.loop,i=>i??t.loop)),this.dispose(D([this._player,"currentTime"],[this,"currentTime"],i=>i??t.currentTime,i=>i??t.currentTime)),this.dispose(D([this._player,"duration"],[this,"duration"],i=>i??t.duration,i=>i??t.duration)),this.dispose(D([this._player,"playing"],[this,"playing"],i=>i??t.playing,i=>i??t.playing)),this.dispose(D([this._player,"speed"],[this,"speed"],i=>i??t.speed,i=>i??t.speed))}this.stroked=!0,this.strokeColor=[0,1,0,.3]}get player(){return this._player}get ratio(){return this._player.ratio}set ratio(e){this._player.ratio=e}get ratioChanged(){return this._player.ratioChanged}getESProperties(){const e={...super.getESProperties()};return{...e,more:[...e.more,new k("通用"),new f([this,"startTime"],"起始时间"),new f([this,"transmissionTime"],"传输时间"),new f([this,"heightRatio"],"高度比率"),new A([this,"arcType"],[["直线","NONE"],["地理直线","GEODESIC"],["地理恒向线","RHUMB"]],"弧线类型","GEODESIC"),new E([this,"brightening"],"变亮"),new E([this,"depthTest"],"深度监测"),new N([this,"imageUrl"],"图片路径",Gt.defaults.imageUrl,!0),new f([this,"repeat"],"图像重复次数"),new A([this,"bidirectional"],[["正向",0],["反向",1],["双向",2],["无",3]],"运动方向",0),new k("播放器"),new us([this,"playing"],[this,"ratio"],[this,"loop"],"播放器"),new E([this,"loop"],"是否循环"),new f([this.player,"currentTime"],"当前时间"),new f([this,"duration"],"过渡时间"),new E([this,"playing"],"是否播放"),new f([this,"speed"],"播放速度")]}}};a(Gt,"createDefaultProps",()=>({...U.createDefaultProps(),imageUrl:"${earthsdk3-assets-script-dir}/assets/img/signal.png",repeat:5,bidirectional:0,startTime:0,transmissionTime:3e3,arcType:"GEODESIC",brightening:!1,depthTest:!0,heightRatio:1,loop:!0,currentTime:0,duration:3e3,speed:1,playing:!0})),a(Gt,"type",Gt.register("ESSignalTransmission",Gt,{chsName:"信号传输器",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:`ESSignalTransmission 是用于在场景中显示信号传输动画的线状对象,支持双向传输、多种弧线类型。
|
|
1759
1759
|
对象json示例:
|
|
1760
1760
|
{
|
|
1761
1761
|
"type": "ESSignalTransmission",
|
|
1762
1762
|
"points": [[116.39, 39.9, 0], [116.40, 39.91, 0]]
|
|
1763
1763
|
}
|
|
1764
|
-
`})),a(
|
|
1764
|
+
`})),a(Gt,"supportEditingModes",[...U.supportEditingModes,I.LineStringAppend,I.LineStringInsert]);let gl=Gt;const gd=`async (dataSource, viewer) => {
|
|
1765
1765
|
viewer.clock.shouldAnimate = false;
|
|
1766
1766
|
const rider = dataSource.entities.getById("tour");
|
|
1767
1767
|
await viewer.flyTo(rider)
|
|
@@ -1775,7 +1775,7 @@ export type IndexJsonType = {
|
|
|
1775
1775
|
|
|
1776
1776
|
该路径可以使用下面回调函数
|
|
1777
1777
|
\`\`\`
|
|
1778
|
-
${
|
|
1778
|
+
${gd}
|
|
1779
1779
|
\`\`\`
|
|
1780
1780
|
|
|
1781
1781
|
\${earthsdk3-assets-script-dir}/assets/misc/facilities/facilities.kml
|
|
@@ -1821,7 +1821,7 @@ ${pd}
|
|
|
1821
1821
|
}
|
|
1822
1822
|
|
|
1823
1823
|
\`\`\`
|
|
1824
|
-
`,fl=Date.now(),Pe=class Pe extends M{constructor(e){super(e);a(this,"_flyToEvent",this.disposeVar(new v));a(this,"_resetClockEvent",this.disposeVar(new v))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get resetClockEvent(){return this._resetClockEvent}resetClock(){this._resetClockEvent.emit()}getESProperties(){const e={...super.getESProperties()};return{...e,defaultMenu:"basic",basic:[...e.basic,new _n([this,"data"],"数据",void 0,void 0,!0),new R([this,"uri"],"路径",Pe.defaults.uri,void 0,!0),new E([this,"autoResetClock"],"自动设置时钟",Pe.defaults.autoResetClock),new E([this,"clockEnabled"],"启用",Pe.defaults.clockEnabled),new E([this,"shouldAnimate"],"是否启用动画",Pe.defaults.shouldAnimate),new Ve([this,"startTime"],"开始时间",Pe.defaults.startTime,!0),new Ve([this,"stopTime"],"结束时间",Pe.defaults.stopTime),new Ve([this,"currentTime"],"当前时间",Pe.defaults.currentTime,!0),new f([this,"multiplier"],"倍速",Pe.defaults.multiplier),new A([this,"clockStep"],[["TICK_DEPENDENT","TICK_DEPENDENT"],["SYSTEM_CLOCK_MULTIPLIER","SYSTEM_CLOCK_MULTIPLIER"],["SYSTEM_CLOCK","SYSTEM_CLOCK"]],"clockStep",Pe.defaults.clockStep),new A([this,"clockRange"],[["UNBOUNDED","UNBOUNDED"],["CLAMPED","CLAMPED"],["LOOP_STOP","LOOP_STOP"]],"clockRange",Pe.defaults.clockRange)],general:[...e.general,new E([this,"show"],"是否显示",!0),new E([this,"collision"],"开启碰撞",!1),new E([this,"allowPicking"],"允许拾取",!1)],more:[...e.more,new k("通用"),new L("飞入",t=>this.flyTo(t),[1e3],"flyTo"),new Xe([this,"loadFuncStr"],"loadFnStr",
|
|
1824
|
+
`,fl=Date.now(),Pe=class Pe extends M{constructor(e){super(e);a(this,"_flyToEvent",this.disposeVar(new v));a(this,"_resetClockEvent",this.disposeVar(new v))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get resetClockEvent(){return this._resetClockEvent}resetClock(){this._resetClockEvent.emit()}getESProperties(){const e={...super.getESProperties()};return{...e,defaultMenu:"basic",basic:[...e.basic,new _n([this,"data"],"数据",void 0,void 0,!0),new R([this,"uri"],"路径",Pe.defaults.uri,void 0,!0),new E([this,"autoResetClock"],"自动设置时钟",Pe.defaults.autoResetClock),new E([this,"clockEnabled"],"启用",Pe.defaults.clockEnabled),new E([this,"shouldAnimate"],"是否启用动画",Pe.defaults.shouldAnimate),new Ve([this,"startTime"],"开始时间",Pe.defaults.startTime,!0),new Ve([this,"stopTime"],"结束时间",Pe.defaults.stopTime),new Ve([this,"currentTime"],"当前时间",Pe.defaults.currentTime,!0),new f([this,"multiplier"],"倍速",Pe.defaults.multiplier),new A([this,"clockStep"],[["TICK_DEPENDENT","TICK_DEPENDENT"],["SYSTEM_CLOCK_MULTIPLIER","SYSTEM_CLOCK_MULTIPLIER"],["SYSTEM_CLOCK","SYSTEM_CLOCK"]],"clockStep",Pe.defaults.clockStep),new A([this,"clockRange"],[["UNBOUNDED","UNBOUNDED"],["CLAMPED","CLAMPED"],["LOOP_STOP","LOOP_STOP"]],"clockRange",Pe.defaults.clockRange)],general:[...e.general,new E([this,"show"],"是否显示",!0),new E([this,"collision"],"开启碰撞",!1),new E([this,"allowPicking"],"允许拾取",!1)],more:[...e.more,new k("通用"),new L("飞入",t=>this.flyTo(t),[1e3],"flyTo"),new Xe([this,"loadFuncStr"],"loadFnStr",gd,gf,!0),new L("重设时钟",()=>this.resetClock(),[],"resetClock")]}}};a(Pe,"createDefaultProps",()=>({...M.createDefaultProps(),show:!0,uri:void 0,allowPicking:!1,loadFuncStr:void 0,data:void 0,autoResetClock:!0,clockEnabled:!1,startTime:fl,stopTime:fl+1440*60*1e3,currentTime:fl,multiplier:1,clockStep:"SYSTEM_CLOCK_MULTIPLIER",clockRange:"UNBOUNDED",shouldAnimate:!1,clampToGround:!1})),a(Pe,"type",Pe.register("ESKml",Pe,{chsName:"ESKml",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:`ESKml 是用于在场景中加载和显示 KML/KMZ 数据的对象,支持路径、地标和时空数据。
|
|
1825
1825
|
对象json示例:
|
|
1826
1826
|
{
|
|
1827
1827
|
"type": "ESKml",
|
|
@@ -1841,7 +1841,7 @@ ${pd}
|
|
|
1841
1841
|
"url": "http://t0.tianditu.com/DataServer?T=vec_w&x={x}&y={y}&l={z}",
|
|
1842
1842
|
"maxZoom": 18
|
|
1843
1843
|
}
|
|
1844
|
-
`}));let _l=en;const Gt=class Gt extends b{constructor(){super();a(this,"_loading",!1);a(this,"_loadedEvent",this.disposeVar(new v));a(this,"_loaded",!1);a(this,"_loadedPromiseResolve");a(this,"_loadedPromise",new Promise(e=>{this._loadedPromiseResolve=e}));a(this,"_processing");this._processing=this.disposeVar(Le(async e=>{if(this._loading=!0,globalThis.Hls)console.info("可能系统已经加载hlsjs,此处不再加载!");else{const t=M.context.getStrFromEnv(Gt.path);await e.promise(Jr(t))}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 Gt._instance=Gt._instance||new Gt,Gt._instance}};a(Gt,"path","${xr-utils-script-dir}/xr-static/xr-utils/hlsjs/1.4.12/hls.min.js"),a(Gt,"_instance");let Cr=Gt,yf=class extends b{constructor(e,t){super();a(this,"_element");this._complexImage=e,this._videoSrc=t;var i=document.createElement("video");i.src=this._videoSrc,i.style.position="absolute",i.style.top="0px",i.style.left="0px",i.style.zIndex="-100",i.style.visibility="hidden";{const r=()=>{i.crossOrigin=this._complexImage.crossOrigin};r(),this.dispose(this._complexImage.crossOriginChanged.disposableOn(r))}{const r=()=>{i.autoplay=this._complexImage.autoplay};r(),this.dispose(this._complexImage.autoplayChanged.disposableOn(r))}{const r=()=>{i.loop=this._complexImage.loop};r(),this.dispose(this._complexImage.loopChanged.disposableOn(r))}i.muted=!0,document.body.appendChild(i),this._element=i,this.dispose(()=>document.body.removeChild(i))}get element(){return this._element}};class wf extends b{constructor(e,t){super();a(this,"_videoDom");a(this,"_processing");this._complexImage=e,this._videoSrc=t,this._videoDom=this.disposeVar(new yf(this._complexImage,"")),this._processing=this.disposeVar(Le(async i=>{const{videoSrc:r}=this,o=Cr.instance();await i.promise(o.loadedPromise);const l=globalThis.Hls,h=new l,c=this.element;await yi(i,()=>new Promise((u,p)=>{c.xbsjHLS=h,h.attachMedia(c),h.on(l.Events.MEDIA_ATTACHED,()=>{h.loadSource(r),h.on(l.Events.MANIFEST_PARSED,(g,m)=>{c.play(),u()})}),h.on(l.Events.ERROR,(g,m)=>{const{type:y,details:S,fatal:C}=m;C&&(h.destroy(),p(S))})}))})),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 gd extends b{constructor(e,t){super();a(this,"_videoDom");a(this,"_update");this._complexImage=e,this._imageUri=t,this._videoDom=this.disposeVar(new wf(this._complexImage,this._imageUri)),this._update=this.disposeVar(cs(()=>this.update())),this._update.start()}get videoDom(){return this._videoDom}get videoElement(){return this._videoDom.element}update(){if(this.videoElement.readyState<2)return;const e=this._complexImage,{videoWidth:t,videoHeight:i}=this.videoElement;e.size=[t,i],e.pixelFormat="RGBA",e.copyTexture({source:this.videoElement})}}const Jt=class Jt extends b{constructor(){super();a(this,"_loading",!1);a(this,"_loadedEvent",this.disposeVar(new v));a(this,"_loaded",!1);a(this,"_loadedPromiseResolve");a(this,"_loadedPromise",new Promise(e=>{this._loadedPromiseResolve=e}));a(this,"_processing");this._processing=this.disposeVar(Le(async e=>{if(this._loading=!0,globalThis.flvjs)console.info("可能系统已经加载flvjs,此处不再加载!");else{const t=M.context.getStrFromEnv(Jt.path);await e.promise(Jr(t))}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 Jt._instance=Jt._instance||new Jt,Jt._instance}};a(Jt,"path","${xr-utils-script-dir}/xr-static/xr-utils/flvjs/1.6.2/flv.min.js"),a(Jt,"_instance");let Pr=Jt;class Ef extends b{constructor(e,t){super();a(this,"_element");this._complexImage=e,this._videoSrc=t;var i=document.createElement("video");i.src=this._videoSrc,i.style.position="absolute",i.style.top="0px",i.style.left="0px",i.style.zIndex="-100",i.style.visibility="hidden";{const r=()=>{i.crossOrigin=this._complexImage.crossOrigin};r(),this.dispose(this._complexImage.crossOriginChanged.disposableOn(r))}{const r=()=>{i.autoplay=this._complexImage.autoplay};r(),this.dispose(this._complexImage.autoplayChanged.disposableOn(r))}{const r=()=>{i.loop=this._complexImage.loop};r(),this.dispose(this._complexImage.loopChanged.disposableOn(r))}i.muted=!0,document.body.appendChild(i),this._element=i,this.dispose(()=>document.body.removeChild(i))}get element(){return this._element}}class bf extends b{constructor(e,t){super();a(this,"_videoDom");a(this,"_processing");this._complexImage=e,this._videoSrc=t,this._videoDom=this.disposeVar(new Ef(this._complexImage,"")),this._processing=this.disposeVar(Le(async i=>{const{videoSrc:r}=this,o=Pr.instance();await i.promise(o.loadedPromise);const l=globalThis.flvjs,h=this.element;await yi(i,()=>new Promise((c,u)=>{if(!l.isSupported()){u("flvjs不支持!");return}var p=l.createPlayer({type:"flv",url:r});p.attachMediaElement(h),p.load(),p.play(),h.xbsjFlvPlayer=p}))})),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 fd extends b{constructor(e,t){super();a(this,"_videoDom");a(this,"_update");this._complexImage=e,this._imageUri=t,this._videoDom=this.disposeVar(new bf(e,this._imageUri)),this._update=this.disposeVar(cs(()=>this.update())),this._update.start()}get videoDom(){return this._videoDom}get videoElement(){return this._videoDom.element}update(){if(this.videoElement.readyState<2)return;const e=this._complexImage,{videoWidth:t,videoHeight:i}=this.videoElement;e.size=[t,i],e.pixelFormat="RGBA",e.copyTexture({source:this.videoElement})}}function md(n){const s=n.substring(n.lastIndexOf(".")+1);return Dn.suffixTypes[s]}class Dn extends b{constructor(){super();a(this,"_enabled",this.disposeVar(w(!1)));a(this,"_uri",this.disposeVar(w("")));a(this,"_type",this.disposeVar(w(void 0)));a(this,"_size",this.disposeVar(q(void 0)));a(this,"_pixelFormat",this.disposeVar(w("RGBA")));a(this,"_flipY",this.disposeVar(w(!0)));a(this,"_crossOriginReact",this.disposeVar(w("")));a(this,"_autoplayReact",this.disposeVar(w(!0)));a(this,"_loopReact",this.disposeVar(w(!0)));a(this,"_copyTextureEvent",this.disposeVar(new v));a(this,"_imageProcessingResettingEvent",this.disposeVar(oe(this.enabledChanged,this.uriChanged,this.typeChanged)));a(this,"_imageProcessingResetting",this.disposeVar(new le(this._imageProcessingResettingEvent,()=>{if(!this.enabled||!this.uri)return;let{type:e}=this;if(e||(e=md(this.uri)),!!e){if(e==="img")return new wh(this,this.uri);if(e==="video")return new Sh(this,this.uri);if(e==="gif")return new kh(this,this.uri);if(e==="hls")return new gd(this,this.uri);if(e==="flv")return new fd(this,this.uri)}})));a(this,"_createNativeTextureEvent",this.disposeVar(oe(this.enabledChanged,this.sizeChanged,this.pixelFormatChanged,this.flipYChanged)))}get enabled(){return this._enabled.value}set enabled(e){this._enabled.value=e}get enabledChanged(){return this._enabled.changed}get uri(){return this._uri.value}set uri(e){this._uri.value=e}get uriChanged(){return this._uri.changed}get type(){return this._type.value}set type(e){this._type.value=e}get typeChanged(){return this._type.changed}get size(){return this._size.value}set size(e){this._size.value=e}get sizeChanged(){return this._size.changed}get pixelFormat(){return this._pixelFormat.value}set pixelFormat(e){this._pixelFormat.value=e}get pixelFormatChanged(){return this._pixelFormat.changed}get flipY(){return this._flipY.value}set flipY(e){this._flipY.value=e}get flipYChanged(){return this._flipY.changed}get crossOrigin(){return this._crossOriginReact.value}set crossOrigin(e){this._crossOriginReact.value=e}get crossOriginChanged(){return this._crossOriginReact.changed}get autoplay(){return this._autoplayReact.value}set autoplay(e){this._autoplayReact.value=e}get autoplayChanged(){return this._autoplayReact.changed}get loop(){return this._loopReact.value}set loop(e){this._loopReact.value=e}get loopChanged(){return this._loopReact.changed}get copyTextureEvent(){return this._copyTextureEvent}copyTexture(e){this._createNativeTextureEvent.flush(),this._copyTextureEvent.emit(e)}get imageProcessingResetting(){return this._imageProcessingResetting}get createNativeTextureEvent(){return this._createNativeTextureEvent}copyFromCanvas(e){if(e.width<=0||e.height<=0){console.warn("canvas.width <= 0 || canvas.height <= 0");return}this.size=[e.width,e.height],this.pixelFormat="RGBA",this.copyTexture({source:e})}}a(Dn,"types",bh),a(Dn,"czmPixelFormats",Eh),a(Dn,"suffixTypes",{png:"img",jpg:"img",svg:"img",webp:"img",gif:"gif",mp4:"video",mov:"video",webm:"video",flv:"flv",m3u8:"hls"});const Sf=[0,0,0,0];class Cf{constructor(){a(this,"_value",[]);a(this,"_valueStr","[]");a(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 v),this._valueChanged}set value(s){if(s.length===0){console.error("value.length === 0");return}let e;if(this._value.length===s.length){const i=[...s].sort((r,o)=>r.ratio-o.ratio);if(e=JSON.stringify(i),this._valueStr===e)return}e=e||JSON.stringify([...s].sort((i,r)=>i.ratio-r.ratio));const t=this._value;if(this._value=JSON.parse(e),this._value.length===0)throw console.error("this._colorStops.length === 0"),new Error("this._colorStops.length === 0");this._valueChanged&&this._valueChanged.emit(this._value,t)}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(s){if(s<this._value[0].ratio||s>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 e=this._value.length;for(let t=0;t<e-1;++t)if(s>=this._value[t].ratio&&s<=this._value[t+1].ratio)return t;throw console.error("shoud not be here!"),new Error("shoud not be here!")}getRatioColor(s,e){s=Hn(s,this.minRatio,this.maxRatio);const t=this._getRatioIndex(s),i=this._value[t],r=this._value[t+1],o=(s-i.ratio)/(r.ratio-i.ratio);for(let l=0;l<4;++l)e[l]=i.rgba[l]*(1-o)+r.rgba[l]*o;if(e.some(Number.isNaN)){console.error("result NaN");return}return e}getColorsInUint8(s){if(s.length%4!==0)throw console.error("result.length % 4 !== 0"),new Error("result.length % 4 !== 0");const e=s.length/4,t=1/e;for(let i=0;i<e;++i){const r=Sf;this.getRatioColor((i+.5)*t,r)||r.splice(0,4,0,0,0,0);for(let o=0;o<4;++o)s[i*4+o]=255*r[o]|0}return s}}class Pf extends b{constructor(){super(...arguments);a(this,"registerEngines",{})}register(e,t,i){const r=this.registerEngines[e]||new Map;return r.has(t)&&console.warn(`register warn:${e}中${t}的实现类已经被注册,再次注册会覆盖。`),r.set(t,i),this.registerEngines[e]=r,t}getEngineObjConstructor(e,t){const i=this.registerEngines[t];if(!i)return;let r=e.constructor,o=e.typeName,l=i.get(o);if(l)return l;if(e.components.main)return;const h=o;for(;o!=="ESSceneObject"&&(r=r.getParentClass(),!!r);)if(o=r.type,l=i.get(o),l)return console.warn(`未找到${h}在${t}中对应的实现类! 使用父类${o}的实现类!`),l}createEngineObject(e,t){const i=this.getEngineObjConstructor(e,t.typeName);if(i){const r=new i(e,t);return r.createdEvent.emit(),r}else{const r=new xi(e,t);return r.createdEvent.emit(),r}}}class Tf extends b{constructor(){super(...arguments);a(this,"registerEngines",{})}register(e,t,i){const r=this.registerEngines[e]||new Map;r.has(t)&&console.warn(`register warn:${e}中${t}的实现类已经被注册,再次注册会覆盖。`),r.set(t,i),this.registerEngines[e]=r}getEngineObjConstructor(e,t){const r=(this.registerEngines[t]||new Map).get(e);if(r)return r;console.warn(`未找到${e}在${t}中对应的实现类!`)}createEngineObject(e,t){const i=this.getEngineObjConstructor(e.typeName,t.typeName);if(i){const r=new i(e,t);return r.createdEvent.emit(),r}else{const r=new xi(e,t);return r.createdEvent.emit(),r}}}const it=class it extends b{constructor(e,t,i=!1){super();a(this,"_createdEvent",this.dv(new v));a(this,"_id",++it._accumId);this._sceneObject=e,this._viewer=t;{if(i)return;const r=(o,l)=>{for(let h of o)this._viewer.delete(h);for(let h of l)h.parentID=this.sceneObject.id,this._viewer.add(h)};r([],this._sceneObject.components.values()),this.d(this._sceneObject.components.toChange.don(r)),this.d(()=>r(this._sceneObject.components.values(),[]))}}get createdEvent(){return this._createdEvent}get sceneObject(){return this._sceneObject}get viewer(){return this._viewer}get id(){return this._id}};a(it,"context",new Pf),a(it,"contextEditing",new Tf),a(it,"register",it.context.register.bind(it.context)),a(it,"registerEditing",it.contextEditing.register.bind(it.contextEditing)),a(it,"_accumId",-1);let xi=it;function vd(n){return typeof n=="string"?document.getElementById(n):n}function yl(n){if(!n)throw new Error("container is not defined");n.innerHTML="";const s=document.createElement("div");return s.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);",n.appendChild(s),s}class _d extends b{constructor(e,t){super();a(this,"_listeningSceneObjects",new Map);this._sceneObjectsMananger=e,this._createSceneObjectListeningFunc=t;const i=this._listeningSceneObjects,r=(o,l)=>{if(o)for(let h of o){const c=i.get(h);c&&(c.destroy(),i.delete(h))}if(l)for(let h of l){if(i.get(h)){console.warn(`listeningSceneObjects已存在某对象:${h.name}`,h);debugger}const u=this.createSceneObjectListeningFunc(h);u&&i.set(h,u)}};r(void 0,this._sceneObjectsMananger.sceneObjects),this.dispose(this._sceneObjectsMananger.sceneObjectsToChange.disposableOn(r)),this.dispose(()=>{for(let o of this._listeningSceneObjects.values())o.destroy();this._listeningSceneObjects.clear()})}get listeningSceneObjects(){return this._listeningSceneObjects}get createSceneObjectListeningFunc(){return this._createSceneObjectListeningFunc}}class If extends b{constructor(s){super(),this._esObjectsManager=s;{const e=this._esObjectsManager;class t extends b{constructor(r){super(),this._esPath=r,this.dv(new le(e.activeViewerChanged,()=>{const o=e.activeViewer;if(!o)return;class l extends b{constructor(c){if(super(),this._esPath=c,!o)throw new Error("!viewer");const u=()=>{const p=e.activeViewer;p&&(this._esPath.path.currentTime=p.simulationTime)};u(),this.d(o.simulationTimeChanged.don(u))}}return new l(this._esPath)}))}}this.dv(new _d(e.sceneObjectsManager,i=>{if(i instanceof ys)return new t(i)}))}{const e=this._esObjectsManager;class t extends b{constructor(r){super();const o=()=>{const l=e.activeViewer;l&&(l.simulationTime=r.currentTime??0)};o(),this.d(r.currentTimeChanged.don(o))}}this.dv(new _d(e.sceneObjectsManager,i=>{if(i instanceof _s)return new t(i)}))}}}class xf extends b{constructor(s){super(),s.forEach(e=>{this.d(e.path.currentPositionChanged.don(t=>{t&&e.sceneObjects.forEach(i=>{Reflect.has(i,"position")&&(i.position=[...t])})})),this.d(e.path.currentRotationChanged.don(t=>{t&&e.sceneObjects.forEach(i=>{Reflect.has(i,"rotation")&&(i.rotation=[...t])})}))})}}class Of extends b{constructor(e){super();a(this,"_player");a(this,"_channels",this.dv(F([])));this._objectManager=e,this._player=this._objectManager.player,this.dv(new le(this.channelsChanged,()=>{if(this.channels.length===0)return;const t=[];for(let i=0;i<this.channels.length;i++){const r=this.channels[i],o=M.getSceneObjById(r.pathId);if(!o||!(o instanceof ys))continue;const h=r.sceneObjectIds.map(c=>M.getSceneObjById(c)).filter(c=>c!==void 0);h.length!==0&&t.push({path:o,sceneObjects:h})}if(t.length!==0)return new xf(t)}))}get player(){return this._player}get channels(){return this._channels.value}get channelsChanged(){return this._channels.changed}set channels(e){this._channels.value=e}}function yd(n,s,e,t){if(e)t.currentActiveEditing=[n,s];else if(t.currentActiveEditing){const[i,r]=t.currentActiveEditing;i===n&&r===s&&(e||(t.currentActiveEditing=void 0))}}const Df=["editing","positionEditing","locationEditing","pointEditing","rotationEditing"];class Ff extends b{constructor(s,e){super(),this._sceneObject=s;const t=this._sceneObject;for(let i of Df){const r=i+"Changed",o=t[r];if(o){{const l=t[i];yd(t,i,l,e)}this.dispose(o.disposableOn((l=>yd(t,i,l,e))))}}}get sceneObject(){return this._sceneObject}}class kf extends b{constructor(){super();a(this,"_currentActiveEditing",this.disposeVar(q(void 0)));a(this,"_currentActiveEditingLastChangedTime",0);this.dispose(this._currentActiveEditing.changed.disposableOn((e,t)=>{if(this._currentActiveEditingLastChangedTime=Date.now(),t){const[i,r]=t;i[r]===!0&&(i[r]=!1)}if(e){const[i,r]=e;i[r]=!0}})),M.context.sceneObjCreatedEvent.don(e=>{e.dv(new Ff(e,this))})}get currentActiveEditing(){return this._currentActiveEditing.value}set currentActiveEditing(e){this._currentActiveEditing.value=e}get currentActiveEditingChanged(){return this._currentActiveEditing.changed}get currentActiveEditingLastChangedTime(){return this._currentActiveEditingLastChangedTime}}class Mf extends b{constructor(){super();a(this,"_sceneObjects",new Set);a(this,"_sceneObjectsToChange",this.dv(new v));this.d(()=>{const e=Hr(this._sceneObjects);e!==0&&console.warn(`场景对象管理器销毁时仍然管理着${e}个场景对象!`)})}get sceneObjects(){return this._sceneObjects}get sceneObjectsToChange(){return this._sceneObjectsToChange}addSceneObject(e){return this._sceneObjects.has(e)?(console.warn(`创建失败:对象${e.typeName+":"+e.id}已经存在于场景对象管理器中!}`),!1):(this._sceneObjectsToChange.emit([],[e]),this._sceneObjects.add(e),!0)}deleteSceneObject(e){return this._sceneObjects.has(e)?(this._sceneObjectsToChange.emit([e],[]),this._sceneObjects.delete(e),!0):(console.warn(`删除失败:对象${e.typeName+":"+e.id}不存在于场景对象管理器中!}`),!1)}createSceneObject(e,t){const i=M.context.createSceneObject(e,t);return i&&this.addSceneObject(i),i}createSceneObjectFromUrl(e,t){const i=M.context.createSceneObjectFromUrl(e,t);return i&&this.addSceneObject(i),i}createSceneObjectFromClass(e,t){const i=M.context.createSceneObjectFromClass(e,t);return i&&this.addSceneObject(i),i}createSceneObjectFromJson(e){const t=M.context.createSceneObjectFromJson(e);return t&&this.addSceneObject(t),t}}class Af extends b{constructor(e){super();a(this,"_enabled",this.dv(w(!1)));a(this,"_cursorPosition",w(void 0));a(this,"quickPickPosition",!0);let t=new b;const i=()=>{t&&(t.destroy(),t=void 0)};this.d(i);const r=()=>{if(i(),!e||!this._enabled.value)return;t=new b;const o=t.dv(w(void 0)),l=t.dv(oe(o.changed));t.d(e.pointerMoveEvent.don(c=>{c.pointerEvent&&(o.value=we(c.pointerEvent))}));const h=t.dv(Le(async c=>{if(o.value)if(this.quickPickPosition){const u=await c.promise(hs(e.quickPickPosition(o.value)));this._cursorPosition.value=u}else{const u=await c.promise(hs(e.pickPosition(o.value)));this._cursorPosition.value=u}}));t.d(l.don(()=>{h.restart()}))};r(),this.d(this._enabled.changed.don(r))}get enabled(){return this._enabled.value}set enabled(e){this._enabled.value=e}get enabledChanged(){return this._enabled.changed}get cursorPosition(){return this._cursorPosition.value}get cursorPositionChanged(){return this._cursorPosition.changed}}class jf extends b{constructor(e){super();a(this,"cursorPositionInfo");this.viewer=e,this.cursorPositionInfo=this.dv(new Af(this.viewer))}}class Rf extends b{constructor(e){super();a(this,"viewer");const t=this.viewer=e;this.ad(new le(t.rollerShutterChanged,()=>{const i=t.container;if(!i||!t.rollerShutter)return;const r=new b;this.viewer.splitPosition=.5;let o=this.getRollerShutterDIV();return i.appendChild(o),r.d(()=>{this.viewer.splitPosition=0,i.removeChild(o)}),r}))}getRollerShutterDIV(){let e=document.createElement("div");e.style.position="absolute",e.style.left="50%",e.style.top="0",e.style.backgroundColor="#d3d3d3",e.style.width="5px",e.style.height="100%",e.style.zIndex="9999";const t=i=>{if(!e.parentElement)return;i.preventDefault?i.preventDefault():i.returnValue=!1;const o=i.x/e.parentElement.offsetWidth;e.style.left=`${100*o}%`,this.viewer.splitPosition=o};return e.addEventListener("mouseenter",i=>{e.style.cursor="ew-resize"}),e.addEventListener("mouseleave",i=>{e.style.cursor="default"}),e.addEventListener("mousedown",i=>{e.style.cursor="ew-resize",document.addEventListener("mousemove",t)}),document.addEventListener("mouseup",i=>{e.style.cursor="default",document.removeEventListener("mousemove",t)}),e}}class Nf extends b{constructor(e){super();a(this,"rollerShutterAnalysis");this.rollerShutterAnalysis=this.ad(new Rf(e))}}function wd(n,s){return n.length===s.length&&n.every((e,t)=>e===s[t])}class Lf extends b{constructor(s){super(),this._viewer=s,this.d(_([this._viewer,"currentTime"],[this._viewer,"simulationTime"]))}}class Vf extends b{constructor(s,e){super(),this._viewer=s,this._activeViewer=e;const t=at.createCommonProps(),i=[];Object.keys(t).forEach(h=>{const c=this._activeViewer[h+"Changed"];i.push(c)});const r=this.dv(oe(...i)),o=()=>{this._viewer.status!=="Created"||this._activeViewer.status!=="Created"||Object.keys(t).forEach(h=>{this._viewer[h]=this._activeViewer[h]})};this.d(r.don(o));const l=this.dv(dn());l.restart(void 0,async()=>{if(this._viewer.status!=="Created"||this._activeViewer.status!=="Created")return;const h=this._activeViewer.getCurrentCameraInfo(),c=this._viewer.getCurrentCameraInfo();if(!h)return;const{position:u,rotation:p}=h;c&&wd(u,c.position)&&wd(p,c.rotation)||this._viewer.flyIn(u,p,0)}),this.d(()=>l.cancel())}}const zf=`<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">
|
|
1844
|
+
`}));let _l=en;const Jt=class Jt extends b{constructor(){super();a(this,"_loading",!1);a(this,"_loadedEvent",this.disposeVar(new v));a(this,"_loaded",!1);a(this,"_loadedPromiseResolve");a(this,"_loadedPromise",new Promise(e=>{this._loadedPromiseResolve=e}));a(this,"_processing");this._processing=this.disposeVar(Le(async e=>{if(this._loading=!0,globalThis.Hls)console.info("可能系统已经加载hlsjs,此处不再加载!");else{const t=M.context.getStrFromEnv(Jt.path);await e.promise(Jr(t))}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 Jt._instance=Jt._instance||new Jt,Jt._instance}};a(Jt,"path","${xr-utils-script-dir}/xr-static/xr-utils/hlsjs/1.4.12/hls.min.js"),a(Jt,"_instance");let Cr=Jt,yf=class extends b{constructor(e,t){super();a(this,"_element");this._complexImage=e,this._videoSrc=t;var i=document.createElement("video");i.src=this._videoSrc,i.style.position="absolute",i.style.top="0px",i.style.left="0px",i.style.zIndex="-100",i.style.visibility="hidden";{const r=()=>{i.crossOrigin=this._complexImage.crossOrigin};r(),this.dispose(this._complexImage.crossOriginChanged.disposableOn(r))}{const r=()=>{i.autoplay=this._complexImage.autoplay};r(),this.dispose(this._complexImage.autoplayChanged.disposableOn(r))}{const r=()=>{i.loop=this._complexImage.loop};r(),this.dispose(this._complexImage.loopChanged.disposableOn(r))}i.muted=!0,document.body.appendChild(i),this._element=i,this.dispose(()=>document.body.removeChild(i))}get element(){return this._element}};class wf extends b{constructor(e,t){super();a(this,"_videoDom");a(this,"_processing");this._complexImage=e,this._videoSrc=t,this._videoDom=this.disposeVar(new yf(this._complexImage,"")),this._processing=this.disposeVar(Le(async i=>{const{videoSrc:r}=this,o=Cr.instance();await i.promise(o.loadedPromise);const l=globalThis.Hls,h=new l,c=this.element;await yi(i,()=>new Promise((u,p)=>{c.xbsjHLS=h,h.attachMedia(c),h.on(l.Events.MEDIA_ATTACHED,()=>{h.loadSource(r),h.on(l.Events.MANIFEST_PARSED,(g,m)=>{c.play(),u()})}),h.on(l.Events.ERROR,(g,m)=>{const{type:y,details:S,fatal:C}=m;C&&(h.destroy(),p(S))})}))})),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 fd extends b{constructor(e,t){super();a(this,"_videoDom");a(this,"_update");this._complexImage=e,this._imageUri=t,this._videoDom=this.disposeVar(new wf(this._complexImage,this._imageUri)),this._update=this.disposeVar(cs(()=>this.update())),this._update.start()}get videoDom(){return this._videoDom}get videoElement(){return this._videoDom.element}update(){if(this.videoElement.readyState<2)return;const e=this._complexImage,{videoWidth:t,videoHeight:i}=this.videoElement;e.size=[t,i],e.pixelFormat="RGBA",e.copyTexture({source:this.videoElement})}}const qt=class qt extends b{constructor(){super();a(this,"_loading",!1);a(this,"_loadedEvent",this.disposeVar(new v));a(this,"_loaded",!1);a(this,"_loadedPromiseResolve");a(this,"_loadedPromise",new Promise(e=>{this._loadedPromiseResolve=e}));a(this,"_processing");this._processing=this.disposeVar(Le(async e=>{if(this._loading=!0,globalThis.flvjs)console.info("可能系统已经加载flvjs,此处不再加载!");else{const t=M.context.getStrFromEnv(qt.path);await e.promise(Jr(t))}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 qt._instance=qt._instance||new qt,qt._instance}};a(qt,"path","${xr-utils-script-dir}/xr-static/xr-utils/flvjs/1.6.2/flv.min.js"),a(qt,"_instance");let Pr=qt;class Ef extends b{constructor(e,t){super();a(this,"_element");this._complexImage=e,this._videoSrc=t;var i=document.createElement("video");i.src=this._videoSrc,i.style.position="absolute",i.style.top="0px",i.style.left="0px",i.style.zIndex="-100",i.style.visibility="hidden";{const r=()=>{i.crossOrigin=this._complexImage.crossOrigin};r(),this.dispose(this._complexImage.crossOriginChanged.disposableOn(r))}{const r=()=>{i.autoplay=this._complexImage.autoplay};r(),this.dispose(this._complexImage.autoplayChanged.disposableOn(r))}{const r=()=>{i.loop=this._complexImage.loop};r(),this.dispose(this._complexImage.loopChanged.disposableOn(r))}i.muted=!0,document.body.appendChild(i),this._element=i,this.dispose(()=>document.body.removeChild(i))}get element(){return this._element}}class bf extends b{constructor(e,t){super();a(this,"_videoDom");a(this,"_processing");this._complexImage=e,this._videoSrc=t,this._videoDom=this.disposeVar(new Ef(this._complexImage,"")),this._processing=this.disposeVar(Le(async i=>{const{videoSrc:r}=this,o=Pr.instance();await i.promise(o.loadedPromise);const l=globalThis.flvjs,h=this.element;await yi(i,()=>new Promise((c,u)=>{if(!l.isSupported()){u("flvjs不支持!");return}var p=l.createPlayer({type:"flv",url:r});p.attachMediaElement(h),p.load(),p.play(),h.xbsjFlvPlayer=p}))})),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 md extends b{constructor(e,t){super();a(this,"_videoDom");a(this,"_update");this._complexImage=e,this._imageUri=t,this._videoDom=this.disposeVar(new bf(e,this._imageUri)),this._update=this.disposeVar(cs(()=>this.update())),this._update.start()}get videoDom(){return this._videoDom}get videoElement(){return this._videoDom.element}update(){if(this.videoElement.readyState<2)return;const e=this._complexImage,{videoWidth:t,videoHeight:i}=this.videoElement;e.size=[t,i],e.pixelFormat="RGBA",e.copyTexture({source:this.videoElement})}}function vd(n){const s=n.substring(n.lastIndexOf(".")+1);return Dn.suffixTypes[s]}class Dn extends b{constructor(){super();a(this,"_enabled",this.disposeVar(w(!1)));a(this,"_uri",this.disposeVar(w("")));a(this,"_type",this.disposeVar(w(void 0)));a(this,"_size",this.disposeVar(q(void 0)));a(this,"_pixelFormat",this.disposeVar(w("RGBA")));a(this,"_flipY",this.disposeVar(w(!0)));a(this,"_crossOriginReact",this.disposeVar(w("")));a(this,"_autoplayReact",this.disposeVar(w(!0)));a(this,"_loopReact",this.disposeVar(w(!0)));a(this,"_copyTextureEvent",this.disposeVar(new v));a(this,"_imageProcessingResettingEvent",this.disposeVar(oe(this.enabledChanged,this.uriChanged,this.typeChanged)));a(this,"_imageProcessingResetting",this.disposeVar(new le(this._imageProcessingResettingEvent,()=>{if(!this.enabled||!this.uri)return;let{type:e}=this;if(e||(e=vd(this.uri)),!!e){if(e==="img")return new wh(this,this.uri);if(e==="video")return new Sh(this,this.uri);if(e==="gif")return new kh(this,this.uri);if(e==="hls")return new fd(this,this.uri);if(e==="flv")return new md(this,this.uri)}})));a(this,"_createNativeTextureEvent",this.disposeVar(oe(this.enabledChanged,this.sizeChanged,this.pixelFormatChanged,this.flipYChanged)))}get enabled(){return this._enabled.value}set enabled(e){this._enabled.value=e}get enabledChanged(){return this._enabled.changed}get uri(){return this._uri.value}set uri(e){this._uri.value=e}get uriChanged(){return this._uri.changed}get type(){return this._type.value}set type(e){this._type.value=e}get typeChanged(){return this._type.changed}get size(){return this._size.value}set size(e){this._size.value=e}get sizeChanged(){return this._size.changed}get pixelFormat(){return this._pixelFormat.value}set pixelFormat(e){this._pixelFormat.value=e}get pixelFormatChanged(){return this._pixelFormat.changed}get flipY(){return this._flipY.value}set flipY(e){this._flipY.value=e}get flipYChanged(){return this._flipY.changed}get crossOrigin(){return this._crossOriginReact.value}set crossOrigin(e){this._crossOriginReact.value=e}get crossOriginChanged(){return this._crossOriginReact.changed}get autoplay(){return this._autoplayReact.value}set autoplay(e){this._autoplayReact.value=e}get autoplayChanged(){return this._autoplayReact.changed}get loop(){return this._loopReact.value}set loop(e){this._loopReact.value=e}get loopChanged(){return this._loopReact.changed}get copyTextureEvent(){return this._copyTextureEvent}copyTexture(e){this._createNativeTextureEvent.flush(),this._copyTextureEvent.emit(e)}get imageProcessingResetting(){return this._imageProcessingResetting}get createNativeTextureEvent(){return this._createNativeTextureEvent}copyFromCanvas(e){if(e.width<=0||e.height<=0){console.warn("canvas.width <= 0 || canvas.height <= 0");return}this.size=[e.width,e.height],this.pixelFormat="RGBA",this.copyTexture({source:e})}}a(Dn,"types",bh),a(Dn,"czmPixelFormats",Eh),a(Dn,"suffixTypes",{png:"img",jpg:"img",svg:"img",webp:"img",gif:"gif",mp4:"video",mov:"video",webm:"video",flv:"flv",m3u8:"hls"});const Sf=[0,0,0,0];class Cf{constructor(){a(this,"_value",[]);a(this,"_valueStr","[]");a(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 v),this._valueChanged}set value(s){if(s.length===0){console.error("value.length === 0");return}let e;if(this._value.length===s.length){const i=[...s].sort((r,o)=>r.ratio-o.ratio);if(e=JSON.stringify(i),this._valueStr===e)return}e=e||JSON.stringify([...s].sort((i,r)=>i.ratio-r.ratio));const t=this._value;if(this._value=JSON.parse(e),this._value.length===0)throw console.error("this._colorStops.length === 0"),new Error("this._colorStops.length === 0");this._valueChanged&&this._valueChanged.emit(this._value,t)}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(s){if(s<this._value[0].ratio||s>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 e=this._value.length;for(let t=0;t<e-1;++t)if(s>=this._value[t].ratio&&s<=this._value[t+1].ratio)return t;throw console.error("shoud not be here!"),new Error("shoud not be here!")}getRatioColor(s,e){s=Hn(s,this.minRatio,this.maxRatio);const t=this._getRatioIndex(s),i=this._value[t],r=this._value[t+1],o=(s-i.ratio)/(r.ratio-i.ratio);for(let l=0;l<4;++l)e[l]=i.rgba[l]*(1-o)+r.rgba[l]*o;if(e.some(Number.isNaN)){console.error("result NaN");return}return e}getColorsInUint8(s){if(s.length%4!==0)throw console.error("result.length % 4 !== 0"),new Error("result.length % 4 !== 0");const e=s.length/4,t=1/e;for(let i=0;i<e;++i){const r=Sf;this.getRatioColor((i+.5)*t,r)||r.splice(0,4,0,0,0,0);for(let o=0;o<4;++o)s[i*4+o]=255*r[o]|0}return s}}class Pf extends b{constructor(){super(...arguments);a(this,"registerEngines",{})}register(e,t,i){const r=this.registerEngines[e]||new Map;return r.has(t)&&console.warn(`register warn:${e}中${t}的实现类已经被注册,再次注册会覆盖。`),r.set(t,i),this.registerEngines[e]=r,t}getEngineObjConstructor(e,t){const i=this.registerEngines[t];if(!i)return;let r=e.constructor,o=e.typeName,l=i.get(o);if(l)return l;if(e.components.main)return;const h=o;for(;o!=="ESSceneObject"&&(r=r.getParentClass(),!!r);)if(o=r.type,l=i.get(o),l)return console.warn(`未找到${h}在${t}中对应的实现类! 使用父类${o}的实现类!`),l}createEngineObject(e,t){const i=this.getEngineObjConstructor(e,t.typeName);if(i){const r=new i(e,t);return r.createdEvent.emit(),r}else{const r=new xi(e,t);return r.createdEvent.emit(),r}}}class Tf extends b{constructor(){super(...arguments);a(this,"registerEngines",{})}register(e,t,i){const r=this.registerEngines[e]||new Map;r.has(t)&&console.warn(`register warn:${e}中${t}的实现类已经被注册,再次注册会覆盖。`),r.set(t,i),this.registerEngines[e]=r}getEngineObjConstructor(e,t){const r=(this.registerEngines[t]||new Map).get(e);if(r)return r;console.warn(`未找到${e}在${t}中对应的实现类!`)}createEngineObject(e,t){const i=this.getEngineObjConstructor(e.typeName,t.typeName);if(i){const r=new i(e,t);return r.createdEvent.emit(),r}else{const r=new xi(e,t);return r.createdEvent.emit(),r}}}const it=class it extends b{constructor(e,t,i=!1){super();a(this,"_createdEvent",this.dv(new v));a(this,"_id",++it._accumId);this._sceneObject=e,this._viewer=t;{if(i)return;const r=(o,l)=>{for(let h of o)this._viewer.delete(h);for(let h of l)h.parentID=this.sceneObject.id,this._viewer.add(h)};r([],this._sceneObject.components.values()),this.d(this._sceneObject.components.toChange.don(r)),this.d(()=>r(this._sceneObject.components.values(),[]))}}get createdEvent(){return this._createdEvent}get sceneObject(){return this._sceneObject}get viewer(){return this._viewer}get id(){return this._id}};a(it,"context",new Pf),a(it,"contextEditing",new Tf),a(it,"register",it.context.register.bind(it.context)),a(it,"registerEditing",it.contextEditing.register.bind(it.contextEditing)),a(it,"_accumId",-1);let xi=it;function _d(n){return typeof n=="string"?document.getElementById(n):n}function yl(n){if(!n)throw new Error("container is not defined");n.innerHTML="";const s=document.createElement("div");return s.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);",n.appendChild(s),s}class yd extends b{constructor(e,t){super();a(this,"_listeningSceneObjects",new Map);this._sceneObjectsMananger=e,this._createSceneObjectListeningFunc=t;const i=this._listeningSceneObjects,r=(o,l)=>{if(o)for(let h of o){const c=i.get(h);c&&(c.destroy(),i.delete(h))}if(l)for(let h of l){if(i.get(h)){console.warn(`listeningSceneObjects已存在某对象:${h.name}`,h);debugger}const u=this.createSceneObjectListeningFunc(h);u&&i.set(h,u)}};r(void 0,this._sceneObjectsMananger.sceneObjects),this.dispose(this._sceneObjectsMananger.sceneObjectsToChange.disposableOn(r)),this.dispose(()=>{for(let o of this._listeningSceneObjects.values())o.destroy();this._listeningSceneObjects.clear()})}get listeningSceneObjects(){return this._listeningSceneObjects}get createSceneObjectListeningFunc(){return this._createSceneObjectListeningFunc}}class If extends b{constructor(s){super(),this._esObjectsManager=s;{const e=this._esObjectsManager;class t extends b{constructor(r){super(),this._esPath=r,this.dv(new le(e.activeViewerChanged,()=>{const o=e.activeViewer;if(!o)return;class l extends b{constructor(c){if(super(),this._esPath=c,!o)throw new Error("!viewer");const u=()=>{const p=e.activeViewer;p&&(this._esPath.path.currentTime=p.simulationTime)};u(),this.d(o.simulationTimeChanged.don(u))}}return new l(this._esPath)}))}}this.dv(new yd(e.sceneObjectsManager,i=>{if(i instanceof ys)return new t(i)}))}{const e=this._esObjectsManager;class t extends b{constructor(r){super();const o=()=>{const l=e.activeViewer;l&&(l.simulationTime=r.currentTime??0)};o(),this.d(r.currentTimeChanged.don(o))}}this.dv(new yd(e.sceneObjectsManager,i=>{if(i instanceof _s)return new t(i)}))}}}class xf extends b{constructor(s){super(),s.forEach(e=>{this.d(e.path.currentPositionChanged.don(t=>{t&&e.sceneObjects.forEach(i=>{Reflect.has(i,"position")&&(i.position=[...t])})})),this.d(e.path.currentRotationChanged.don(t=>{t&&e.sceneObjects.forEach(i=>{Reflect.has(i,"rotation")&&(i.rotation=[...t])})}))})}}class Of extends b{constructor(e){super();a(this,"_player");a(this,"_channels",this.dv(F([])));this._objectManager=e,this._player=this._objectManager.player,this.dv(new le(this.channelsChanged,()=>{if(this.channels.length===0)return;const t=[];for(let i=0;i<this.channels.length;i++){const r=this.channels[i],o=M.getSceneObjById(r.pathId);if(!o||!(o instanceof ys))continue;const h=r.sceneObjectIds.map(c=>M.getSceneObjById(c)).filter(c=>c!==void 0);h.length!==0&&t.push({path:o,sceneObjects:h})}if(t.length!==0)return new xf(t)}))}get player(){return this._player}get channels(){return this._channels.value}get channelsChanged(){return this._channels.changed}set channels(e){this._channels.value=e}}function wd(n,s,e,t){if(e)t.currentActiveEditing=[n,s];else if(t.currentActiveEditing){const[i,r]=t.currentActiveEditing;i===n&&r===s&&(e||(t.currentActiveEditing=void 0))}}const Df=["editing","positionEditing","locationEditing","pointEditing","rotationEditing"];class Ff extends b{constructor(s,e){super(),this._sceneObject=s;const t=this._sceneObject;for(let i of Df){const r=i+"Changed",o=t[r];if(o){{const l=t[i];wd(t,i,l,e)}this.dispose(o.disposableOn((l=>wd(t,i,l,e))))}}}get sceneObject(){return this._sceneObject}}class kf extends b{constructor(){super();a(this,"_currentActiveEditing",this.disposeVar(q(void 0)));a(this,"_currentActiveEditingLastChangedTime",0);this.dispose(this._currentActiveEditing.changed.disposableOn((e,t)=>{if(this._currentActiveEditingLastChangedTime=Date.now(),t){const[i,r]=t;i[r]===!0&&(i[r]=!1)}if(e){const[i,r]=e;i[r]=!0}})),M.context.sceneObjCreatedEvent.don(e=>{e.dv(new Ff(e,this))})}get currentActiveEditing(){return this._currentActiveEditing.value}set currentActiveEditing(e){this._currentActiveEditing.value=e}get currentActiveEditingChanged(){return this._currentActiveEditing.changed}get currentActiveEditingLastChangedTime(){return this._currentActiveEditingLastChangedTime}}class Mf extends b{constructor(){super();a(this,"_sceneObjects",new Set);a(this,"_sceneObjectsToChange",this.dv(new v));this.d(()=>{const e=Hr(this._sceneObjects);e!==0&&console.warn(`场景对象管理器销毁时仍然管理着${e}个场景对象!`)})}get sceneObjects(){return this._sceneObjects}get sceneObjectsToChange(){return this._sceneObjectsToChange}addSceneObject(e){return this._sceneObjects.has(e)?(console.warn(`创建失败:对象${e.typeName+":"+e.id}已经存在于场景对象管理器中!}`),!1):(this._sceneObjectsToChange.emit([],[e]),this._sceneObjects.add(e),!0)}deleteSceneObject(e){return this._sceneObjects.has(e)?(this._sceneObjectsToChange.emit([e],[]),this._sceneObjects.delete(e),!0):(console.warn(`删除失败:对象${e.typeName+":"+e.id}不存在于场景对象管理器中!}`),!1)}createSceneObject(e,t){const i=M.context.createSceneObject(e,t);return i&&this.addSceneObject(i),i}createSceneObjectFromUrl(e,t){const i=M.context.createSceneObjectFromUrl(e,t);return i&&this.addSceneObject(i),i}createSceneObjectFromClass(e,t){const i=M.context.createSceneObjectFromClass(e,t);return i&&this.addSceneObject(i),i}createSceneObjectFromJson(e){const t=M.context.createSceneObjectFromJson(e);return t&&this.addSceneObject(t),t}}class Af extends b{constructor(e){super();a(this,"_enabled",this.dv(w(!1)));a(this,"_cursorPosition",w(void 0));a(this,"quickPickPosition",!0);let t=new b;const i=()=>{t&&(t.destroy(),t=void 0)};this.d(i);const r=()=>{if(i(),!e||!this._enabled.value)return;t=new b;const o=t.dv(w(void 0)),l=t.dv(oe(o.changed));t.d(e.pointerMoveEvent.don(c=>{c.pointerEvent&&(o.value=we(c.pointerEvent))}));const h=t.dv(Le(async c=>{if(o.value)if(this.quickPickPosition){const u=await c.promise(hs(e.quickPickPosition(o.value)));this._cursorPosition.value=u}else{const u=await c.promise(hs(e.pickPosition(o.value)));this._cursorPosition.value=u}}));t.d(l.don(()=>{h.restart()}))};r(),this.d(this._enabled.changed.don(r))}get enabled(){return this._enabled.value}set enabled(e){this._enabled.value=e}get enabledChanged(){return this._enabled.changed}get cursorPosition(){return this._cursorPosition.value}get cursorPositionChanged(){return this._cursorPosition.changed}}class jf extends b{constructor(e){super();a(this,"cursorPositionInfo");this.viewer=e,this.cursorPositionInfo=this.dv(new Af(this.viewer))}}class Rf extends b{constructor(e){super();a(this,"viewer");const t=this.viewer=e;this.ad(new le(t.rollerShutterChanged,()=>{const i=t.container;if(!i||!t.rollerShutter)return;const r=new b;this.viewer.splitPosition=.5;let o=this.getRollerShutterDIV();return i.appendChild(o),r.d(()=>{this.viewer.splitPosition=0,i.removeChild(o)}),r}))}getRollerShutterDIV(){let e=document.createElement("div");e.style.position="absolute",e.style.left="50%",e.style.top="0",e.style.backgroundColor="#d3d3d3",e.style.width="5px",e.style.height="100%",e.style.zIndex="9999";const t=i=>{if(!e.parentElement)return;i.preventDefault?i.preventDefault():i.returnValue=!1;const o=i.x/e.parentElement.offsetWidth;e.style.left=`${100*o}%`,this.viewer.splitPosition=o};return e.addEventListener("mouseenter",i=>{e.style.cursor="ew-resize"}),e.addEventListener("mouseleave",i=>{e.style.cursor="default"}),e.addEventListener("mousedown",i=>{e.style.cursor="ew-resize",document.addEventListener("mousemove",t)}),document.addEventListener("mouseup",i=>{e.style.cursor="default",document.removeEventListener("mousemove",t)}),e}}class Nf extends b{constructor(e){super();a(this,"rollerShutterAnalysis");this.rollerShutterAnalysis=this.ad(new Rf(e))}}function Ed(n,s){return n.length===s.length&&n.every((e,t)=>e===s[t])}class Lf extends b{constructor(s){super(),this._viewer=s,this.d(_([this._viewer,"currentTime"],[this._viewer,"simulationTime"]))}}class Vf extends b{constructor(s,e){super(),this._viewer=s,this._activeViewer=e;const t=at.createCommonProps(),i=[];Object.keys(t).forEach(h=>{const c=this._activeViewer[h+"Changed"];i.push(c)});const r=this.dv(oe(...i)),o=()=>{this._viewer.status!=="Created"||this._activeViewer.status!=="Created"||Object.keys(t).forEach(h=>{this._viewer[h]=this._activeViewer[h]})};this.d(r.don(o));const l=this.dv(dn());l.restart(void 0,async()=>{if(this._viewer.status!=="Created"||this._activeViewer.status!=="Created")return;const h=this._activeViewer.getCurrentCameraInfo(),c=this._viewer.getCurrentCameraInfo();if(!h)return;const{position:u,rotation:p}=h;c&&Ed(u,c.position)&&Ed(p,c.rotation)||this._viewer.flyIn(u,p,0)}),this.d(()=>l.cancel())}}const zf=`<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">
|
|
1845
1845
|
<animateTransform values="0 50 50;360 50 50" keyTimes="0;1" dur="1s" repeatCount="indefinite" type="rotate" attributeName="transform"></animateTransform>
|
|
1846
1846
|
</circle><g></g></g></svg>
|
|
1847
|
-
`,Uf='<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>',Bf='<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>',es=class es extends b{constructor(s){super();const e=()=>{const t=this.dv(new dr);this.d(_([t,"show"],[s,"useDefaultStatusDiv"]));{const i=()=>{t.show=(s.useDefaultStatusDiv??!0)&&s.status!=="Created"};i(),this.d(s.useDefaultStatusDivChanged.don(i)),this.d(s.statusChanged.don(i)),t.cssText="width:100%;height:100%;position:absolute;left:0px;top:0px;"}s.add(t),this.d(()=>s.delete(t)),t.instanceClass=class extends b{constructor(o,l,h){super();a(this,"_div",document.createElement("div"));if(this._subContainer=o,!h)return;this._subContainer.appendChild(this._div),this.d(()=>this._subContainer.removeChild(this._div));{const y=()=>{l.show?this._div.style.opacity="1":this._div.style.opacity="0"};y(),this.d(l.showChanged.don(y))}let c,u,p,g,m;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",c=document.createElement("div"),this._div.appendChild(c),c.style.width="auto",c.style.position="absolute",c.style.left="50%",c.style.top="50%",c.style.transform="translate(-50%,-50%)",c.style.background="rgba(120, 120, 0, 0.7)",c.style.color="white",c.style.fontSize="10px",c.style.background="none",c.style.display="flex",c.style.justifyContent="center",c.style.alignItems="center",u=document.createElement("div"),c.appendChild(u),u.style.pointerEvents="none",u.style.display="block",u.style.width="40px",u.innerHTML=es.defaultsSvg.loadingSvg,u.style.filter="drop-shadow(0px 0px 1px black)",p=document.createElement("div"),c.appendChild(p),p.style.pointerEvents="none",p.style.marginLeft="10px",p.style.display="flex",p.style.flexFlow="column",p.style.maxWidth="300px",g=document.createElement("div"),p.appendChild(g),g.style.fontSize="14px",g.style.fontWeight="800",g.style.marginBottom="5px",g.style.textShadow="0 0 2px black",m=document.createElement("div"),p.appendChild(m),m.style.fontWeight="400",m.style.textShadow="0 0 2px black";{const y=()=>{let C="Raw";h.status==="Raw"?C="初始状态":h.status==="Creating"?C="正在创建":h.status==="Created"?C="创建完成":h.status==="Error"?C="创建失败":h.status==="Reconnecting"&&(C="重新连接"),g.innerText=`${C}(${h.status})`,m.innerText=`${h.statusLog}`,(h.status==="Creating"||h.status==="Reconnecting")&&(u.innerHTML=es.defaultsSvg.loadingSvg),h.status==="Created"&&(u.innerHTML=es.defaultsSvg.successSvg),h.status==="Error"&&(u.innerHTML=es.defaultsSvg.warnSvg)};y();const S=this.dv(oe(h.statusLogChanged,h.statusChanged));this.d(S.don(y))}}update(){const o=255*Math.random()|0,l=255*Math.random()|0,h=255*Math.random()|0;this._div.style.background=`rgba(${o}, ${l}, ${h}, 0.8)`}}};this.d(s.containerChanged.don(()=>{e()}))}};a(es,"defaultsSvg",{loadingSvg:zf,successSvg:Uf,warnSvg:Bf});let wl=es;class Wf extends b{constructor(s,e,t){super(),this._subContainer=s,this._overlayContainer=e,this._viewer=t;const i=this._subContainer,r=this._overlayContainer,o=this._viewer,l=()=>{const u=o.zIndex??"";i.style.zIndex=u,r.style.zIndex=u};l(),this.d(o.zIndexChanged.don(l));const h=()=>{i.style.display=o.show??!0?"block":"none"};h(),this.d(o.showChanged.don(h));const c=()=>{i.style.opacity=`${o.opacity??1}`};c(),this.d(o.opacityChanged.don(c))}}function Tr(n){let s=Ne(n,"_relativeContainer");return s||(s=document.createElement("div"),s.style.position="relative",s.style.width="100%",s.style.height="100%",s.style.padding="0",s.style.margin="0",n.appendChild(s),vt(n,"_relativeContainer",s)),s}class Hf extends b{constructor(e,t){super();a(this,"_subContainer",document.createElement("div"));a(this,"_overlayContainer",document.createElement("div"));a(this,"_containerStyleController");this._container=e,this._viewer=t,this._containerStyleController=this.dv(new Wf(this._subContainer,this._overlayContainer,this._viewer));const{subContainer:i,overlayContainer:r}=this;i.tabIndex=-1,i.style.outline="none",i.style.width="100%",i.style.height="100%",i.onpointerdown=()=>i.focus(),r.style.position="relative",r.setAttribute("earthsdk3","earthsdk3-overlayContainer"),i.setAttribute("earthsdk3","earthsdk3-subContainer"),Tr(this._container).appendChild(i),this.d(()=>Tr(this._container).removeChild(i)),Tr(this._container).appendChild(r),this.d(()=>Tr(this._container).removeChild(r))}get subContainer(){return this._subContainer}get overlayContainer(){return this._overlayContainer}get containerStyleController(){return this._containerStyleController}get container(){return this._container}}class $f extends b{constructor(){super(...arguments);a(this,"registerObjsMap",new Map)}register(e,t){return this.registerObjsMap.has(e)&&console.warn(`register warn:${e}已经被注册,再次注册会覆盖。`),this.registerObjsMap.set(e,t),e}getViewerConstructor(e){const t=this.registerObjsMap.get(e);if(!t){console.warn(`未找到${e}类!`);return}return t}createViewer(e){const t=e.type;console.log(e);const i=this.getViewerConstructor(t);if(!i)throw new Error(`没有找到类型为${t}的Viewer构造器!`);return new i(e)}}class Ed extends b{constructor(s,e,t=!1,i=!1){if(super(),this._viewer=s,!e)throw new Error("ViewerCustomInteraction: container is null");const r=this.dv(se.create(e,"pointerdown")),o=this.dv(se.create(e,"pointermove")),l=this.dv(se.create(e,"pointerup")),h=this.dv(se.create(e,"pointerout")),c=this.dv(se.create(e,"pointerover")),u=this.dv(new ro),p=this.dv(new ql),g=()=>{const x=this._viewer.hoverTime*1e3;p.delayTime=x};this.d(this._viewer.hoverTimeChanged.don(()=>{g()})),this.d(r.don(x=>u.pointerDown(x))),this.d(o.don(x=>u.pointerMove(x))),this.d(l.don(x=>u.pointerUp(x))),this.d(h.don(x=>u.pointerOut(x))),this.d(r.don(x=>p.pointerDown(x))),this.d(o.don(x=>p.pointerMove(x))),this.d(l.don(x=>p.pointerUp(x))),this.d(h.don(x=>p.pointerOut(x)));const{x:m,y}=e.getBoundingClientRect(),S=i?m:0,C=i?y:0;this.d(p.hoverEvent.don(x=>{const[$,Y]=os(x,t);this._viewer.hoverEvent.emit({screenPosition:[$+S,Y+C],pointerEvent:x})})),this.d(u.clickEvent.don(x=>{const[$,Y]=os(x,t);this._viewer.clickEvent.emit({screenPosition:[$+S,Y+C],pointerEvent:x})})),this.d(u.dbclickEvent.don(x=>{const[$,Y]=os(x,t);x.button===0&&this._viewer.dblclickEvent.emit({screenPosition:[$+S,Y+C],pointerEvent:x})})),this.d(r.don(x=>{const[$,Y]=os(x,t);x.button===0&&this._viewer.pointerDownEvent.emit({screenPosition:[$+S,Y+C],pointerEvent:x})})),this.d(l.don(x=>{const[$,Y]=os(x,t);x.button===0&&this._viewer.pointerUpEvent.emit({screenPosition:[$+S,Y+C],pointerEvent:x})})),this.d(o.don(x=>{const[$,Y]=we(x,t);this._viewer.pointerMoveEvent.emit({screenPosition:[$+S,Y+C],pointerEvent:x})})),this.d(c.don(x=>{const[$,Y]=we(x,t);this._viewer.pointerOverEvent.emit({screenPosition:[$+S,Y+C],pointerEvent:x})})),this.d(h.don(x=>{const[$,Y]=we(x,t);this._viewer.pointerOutEvent.emit({screenPosition:[$+S,Y+C],pointerEvent:x})}));const T=this.dv(se.create(e,"keydown"));this.d(T.don(x=>this._viewer.keyDownEvent.emit(x)));const V=this.dv(se.create(e,"keyup"));this.d(V.don(x=>this._viewer.keyUpEvent.emit(x)));const z=this.dv(se.create(e,"wheel"));this.d(z.don(x=>this._viewer.wheelEvent.emit(x)))}}const qt=class qt extends b{constructor(e){super();a(this,"_forceRecreateEvent",this.dv(new v));a(this,"_container",this.dv(w(void 0)));a(this,"_containerSize",this.dv(w(void 0)));a(this,"_editingEvent",this.disposeVar(new v));a(this,"_esViewerExtensions",this.dv(new jf(this)));a(this,"_status",this.dv(w("Raw")));a(this,"_statusLog",this.dv(w("")));a(this,"_statusContainer",this.dv(new wl(this)));a(this,"_useCustomInteraction",this.dv(w(!0)));a(this,"_resetInteractionEvent",this.dv(oe(this.containerChanged,this._useCustomInteraction.changed,this._forceRecreateEvent)));a(this,"_interactionResetting",this.dv(new le(this._resetInteractionEvent,()=>{if(!(!this.container||!this._useCustomInteraction.value))return new Ed(this,this.container)})));a(this,"_viewerChanged",this.dv(new v));a(this,"_cameraChanged",this.dv(new v));a(this,"_containerResetEvent",this.dv(oe(this.containerChanged,this._forceRecreateEvent)));a(this,"_containerResetting",this.dv(new le(this._containerResetEvent,()=>{if(this.container)return new Hf(this.container,this)})));a(this,"_sceneObjectsMap",new Map);a(this,"_id");a(this,"_typeName");a(this,"_updateFuncReact",this.dv(w(void 0)));a(this,"_toDestroyFuncReact",this.dv(w(void 0)));a(this,"_statusInfo",qt.defaults.statusInfo);a(this,"_navigationMode",this.dv(w("Map")));a(this,"_navigationEvent",this.disposeVar(new v));a(this,"_syncViewer",this.dv(w(void 0)));a(this,"_syncEventDon",this.dv(new le(this.syncViewerChanged,()=>{const e=this.syncViewer;if(e)return new Vf(this,e)})));a(this,"_timeSyncdon",this.dv(new le(this.timeSyncChanged,()=>{if(this.timeSync)return new Lf(this)})));a(this,"_hoverEvent",this.dv(new v));a(this,"_pointerOverEvent",this.dv(new v));a(this,"_pointerMoveEvent",this.dv(new v));a(this,"_pointerDownEvent",this.dv(new v));a(this,"_pointerUpEvent",this.dv(new v));a(this,"_pointerOutEvent",this.dv(new v));a(this,"_clickEvent",this.dv(new v));a(this,"_dblclickEvent",this.dv(new v));a(this,"_keyDownEvent",this.dv(new v));a(this,"_keyUpEvent",this.dv(new v));a(this,"_wheelEvent",this.dv(new v));a(this,"_actived",this.dv(w(!1)));this._id=e.id??ns();const t=vd(e.container);if(t)this._container.value=yl(t),this._typeName=e.type,this._initName();else throw new Error("container is not defined");{const i=()=>{t&&(this.show??!0?t.style.display="block":t.style.display="none")};i(),this.d(this.showChanged.don(i))}{const i=this._sceneObjectsMap,r=()=>{for(let[l,h]of i.entries())if(!h&&l){const c=xi.context.createEngineObject(l,this);c&&i.set(l,c)}},o=()=>{for(let[l,h]of i.entries())h&&!h.isDestroyed()&&h.destroy(),i.set(l,void 0)};this.d(o),this.d(this.viewerChanged.don(l=>{o(),l&&r()}))}{const i=()=>{if(this.execOnceFuncStr)try{Function(`"use strict";return (${this.execOnceFuncStr})`)()(this)}catch(r){console.warn(`execOnceFuncStr不能转成函数!或者函数执行时错误!id: ${this.id} ${this.typeName} error: ${r}`)}};i(),this.d(this.execOnceFuncStrChanged.don(i))}{const i=()=>{if(this.updateFuncStr)try{this.updateFunc=Function(`"use strict";return (${this.updateFuncStr})`)()}catch(o){console.warn(`updateFuncStr不能转成函数!或者函数执行时错误!id: ${this.id} ${this.typeName} error: ${o}`)}};i(),this.d(this.updateFuncStrChanged.don(i));let r;this.d(()=>r&&r.destroy()),this.d(this.updateFuncChanged.don(()=>{r&&r.cancel(),this.updateFunc&&(r=r||dn(),r.restart(void 0,o=>{this.updateFunc&&this.updateFunc(this,o)}))}))}{const i=()=>{try{this.toDestroyFunc=this.toDestroyFuncStr&&Function(`"use strict";return (${this.toDestroyFuncStr})`)()||void 0}catch(r){console.warn(`toDestroyFuncStr不能转成函数!或者函数执行时错误!id: ${this.id} ${this.typeName} error: ${r}`),this.toDestroyFunc=void 0}};i(),this.d(this.toDestroyFuncStrChanged.don(i)),this.d(this.toDestroyEvent.don(()=>{this.toDestroyFunc&&this.toDestroyFunc(this)}))}this.ad(new Nf(this))}forceRecreate(){this._forceRecreateEvent.emit()}get container(){return this._container.value}set container(e){this._container.value=e}set containerOrId(e){if(typeof e=="string"){const t=document.getElementById(e);t&&t instanceof HTMLDivElement?this._container.value=yl(t):console.warn("containerOrId warn: !(container instanceof HTMLDivElement)")}else e instanceof HTMLDivElement?this._container.value=yl(e):console.warn("containerOrId warn: setting container failed!")}get containerChanged(){return this._container.changed}get containerSize(){return this._containerSize.value}set containerSize(e){this._containerSize.value=e}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(e){this._status.value=e}get statusLog(){return this._statusLog.value}get statusLogChanged(){return this._statusLog.changed}setStatusLog(e){this._statusLog.value=e}get useCustomInteraction(){return this._useCustomInteraction.value}set useCustomInteraction(e){this._useCustomInteraction.value=e}get viewerChanged(){return this._viewerChanged}get cameraChanged(){return this._cameraChanged}get containerResetEvent(){return this._containerResetEvent}get subContainer(){var e;return(e=this._containerResetting.obj)==null?void 0:e.subContainer}get subContainerChanged(){return this._containerResetting.objChanged}get overlayContainer(){var e;return(e=this._containerResetting.obj)==null?void 0:e.overlayContainer}get overlayContainerChanged(){return this._containerResetting.objChanged}get sceneObjectsMap(){return this._sceneObjectsMap}get sceneObjects(){return this._sceneObjectsMap.keys()}getEngineObject(e){return this.sceneObjectsMap.get(e)}add(...e){for(let t of e)if(!this.has(t)){M.context.addSceneObject(t);const i=xi.context.createEngineObject(t,this);i&&this._sceneObjectsMap.set(t,i),t.viewerAttached.emit(this)}}delete(...e){for(let t of e)if(this.has(t)){const i=this._sceneObjectsMap.get(t);i&&i.destroy(),M.context.deleteSceneObject(t),this._sceneObjectsMap.delete(t),t.viewerDetached.emit(this)}}disposableAdd(...e){return this.add(...e),()=>this.delete(...e)}disAdd(...e){return this.disposableAdd(...e)}has(e){return this._sceneObjectsMap.has(e)}clearAllSceneObjects(){for(let e of this.sceneObjects)this.delete(e)}get id(){return this._id}set id(e){console.warn("ESViewer id is readonly")}get typeName(){return this._typeName}_initName(){this.name=`${this.typeName}_${(""+this.id).slice(-4)}`}get defaultProps(){return qt.createDefaultProps()}get completeJson(){return this._getJson(!1)}_getJson(e=!0){const t={id:this.id,type:this.typeName};for(let i of Object.keys(this.defaultProps))if(e){let r,o=this.defaultProps[i];o instanceof ge?r=o.equals(this[i]):r=o===this[i],r||(t[i]=this[i])}else t[i]=this[i];return t}_setJson(e,t,i){if(!(e instanceof Object)||e.type&&e.type!==this.typeName){console.error(`value.type && value.type${e.type} !== this.typeName${this.typeName}`);return}e.id&&e.id!==this.id&&console.warn(`value.id === undefined || value.id${e.id} !== this.id(${this.id})`);const r=t||[];r.push("id","type");const o=Object.keys(this.defaultProps).filter(l=>!r.includes(l));for(let l of o)if(l in e)this[l]=e[l]===null?void 0:e[l];else if(!(i??!1)){let h=this.defaultProps[l];h instanceof ge&&(h=h.value),this[l]=h}}get json(){return this._getJson()}set json(e){this._setJson(e,["devTags"])}get updateFunc(){return this._updateFuncReact.value}set updateFunc(e){this._updateFuncReact.value=e}get updateFuncChanged(){return this._updateFuncReact.changed}get toDestroyFunc(){return this._toDestroyFuncReact.value}set toDestroyFunc(e){this._toDestroyFuncReact.value=e}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(e){this._syncViewer.value=e}get syncViewerChanged(){return this._syncViewer.changed}syncOtherViewer(e){e&&e.syncViewer&&(e.syncViewer=void 0),e===this?this._syncViewer.value=void 0:this._syncViewer.value=e}setCurrentTime(e){try{this.currentTime=typeof e=="string"?Date.parse(e):e}catch(t){console.warn(`时间格式不正确! value: ${e} error: ${t}`)}}async getVersion(){return globalThis.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(e){this._actived.value=e}get activedChanged(){return this._actived.changed}getESProperties(){return{defaultMenu:"general",basic:[],general:[],dataSource:[],location:[],coordinate:[],style:[],more:[]}}async getCurrentRectangle(){var e;try{const t=(e=this.container)==null?void 0:e.getBoundingClientRect();if(!t)return;const{width:i,height:r}=t,o=await this.quickPickPosition([0,0]),l=await this.quickPickPosition([i,r]);return!o||!l?void 0:[o[0],l[1],l[0],o[1]]}catch(t){console.error(t);return}}};a(qt,"context",new $f),a(qt,"register",qt.context.register.bind(qt.context)),a(qt,"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 at=qt;(n=>{n.createBaseProps=()=>({name:"未命名场景对象",extras:B(void 0),devTags:q(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}),n.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:q(void 0),editingAuxiliaryPointColor:q(void 0),editingLineWidth:void 0,editingLineColor:q(void 0),editingAxisSize:void 0,editingAuxiliaryPointSize:void 0,editingHeightOffset:0,editingLineShow:!0,editingEventListening:!0,terrainShader:n.defaults.terrainShader,splitPosition:w(void 0),rollerShutter:!1,cameraMovableRegion:q(void 0),depthTestAgainstTerrain:!0,terrainOpacity:1,sceneGlobeBaseColor:F([1,1,1,1]),sceneBackgroundColor:F([0,0,0,0])}),n.createDefaultProps=()=>({...(0,n.createBaseProps)(),...(0,n.createCommonProps)()})})(at||(at={})),Kt(at.prototype,at.createDefaultProps);function bd(n,s){const e=n._lastCameraInfo;if(e){const t=s.viewerChanged.don(i=>{if(!i||!e)return;const{position:r,rotation:o}=e;s.flyIn(r,o,0),n._lastCameraInfo=void 0,t()})}}const Gf=n=>{const s=at.createCommonProps(),e={};try{Object.keys(s).forEach(t=>{e[t]=n[t]})}catch(t){console.warn(t)}return e},Sd=(n,s)=>{const e=at.createCommonProps();try{Object.keys(e).forEach(t=>{n[t]=s[t]})}catch(t){console.warn(t)}};class Jf extends b{constructor(e){super();a(this,"_viewersChanged",this.disposeVar(new v));a(this,"_viewers",new Set);a(this,"_viewersToChange",this.dv(new v));this._sceneObjectsManager=e,(async()=>{for(let t of this.viewers){const i=this._sceneObjectsManager.sceneObjects;for(const r of i)await this.addSceneObject(r,t)}this.d(()=>{const t=this._sceneObjectsManager.sceneObjects;for(const i of this.viewers)i.delete(...t),this.destroyViewer(i);this._viewers.clear()}),this.d(this._sceneObjectsManager.sceneObjectsToChange.don(async(t,i)=>{for(let r of this.viewers){t.forEach(o=>{this.deleteSceneObject(o,r)});for(let o of i)await this.addSceneObject(o,r)}if(i.length>0)for(let r of i)r.d(r.devTagsChanged.don(async()=>{for(let o of this.viewers){if(o.has(r)&&!yn(o.devTags,r.devTags)){o.delete(r);continue}await this.addSceneObject(r,o)}})),r.ad(r.reloadEvent.don(async()=>{for(let o of this.viewers)o.has(r)&&(o.delete(r),await this.addSceneObject(r,o))}))})),this.d(this.viewersChanged.don(async(t,i)=>{const r=this._sceneObjectsManager.sceneObjects;t.forEach(o=>{for(let l of r)this.deleteSceneObject(l,o)});for(let o of i)for(let l of r)await this.addSceneObject(l,o);i.length>0&&i.forEach(o=>{o.d(o.devTagsChanged.don(async()=>{o.clearAllSceneObjects();const l=this._sceneObjectsManager.sceneObjects;for(let h of l)console.log("viewersChanged",o.devTags,h.devTags,yn(o.devTags,h.devTags)),await this.addSceneObject(h,o)}))})}))})()}get viewersChanged(){return this._viewersChanged}get viewers(){return[...this._viewers]}getViewers(){return[...this._viewers]}get viewersToChange(){return this._viewersToChange}createViewer(e){const t=at.context.createViewer(e);return this._viewers.add(t),this._viewersChanged.emit([],[t]),t}destroyViewer(e){return e.isDestroyed()?!0:this._viewers.has(e)?(this._viewers.delete(e),this._viewersChanged.emit([e],[]),e.destroy(),e.isDestroyed()):!1}async addSceneObject(e,t){yn(t.devTags,e.devTags)&&(t.has(e)?console.warn(`${t.typeName}中已存${e.typeName},检查逻辑是否有问题!`):t.add(e))}deleteSceneObject(e,t){yn(t.devTags,e.devTags)&&(t.has(e)?t.delete(e):console.warn(`${t.typeName}中不存在${e.typeName},检查逻辑是否有问题!`))}}class Ir extends b{constructor(...e){super();a(this,"_drgm",this.dv(new Nh));a(this,"_sobjm",this.dv(new Mf));a(this,"_vrm",this.dv(new Jf(this._sobjm)));a(this,"_sceneObjectEditingManager",this.disposeVar(new kf));a(this,"_activeViewer",this.dv(w(void 0)));a(this,"_syncOtherViewersToActived",this.dv(w(!1)));a(this,"_cmrvm",this.createSceneObjectFromClass(lr));a(this,"_cmrvmdon",this.d(()=>this._cmrvm&&this.destroySceneObject(this._cmrvm)));a(this,"_asset",{type:"ESObjectsManager",version:"0.1.0",createdTime:"",modifiedTime:"",name:"未命名项目"});a(this,"_sceneTree",this.dv(new bn("default",this.dragstartDataMananger,24,this)));a(this,"_sceneTreeMap",new Map);a(this,"_viewerCreatedEvent",this.dv(new v));a(this,"_lastCameraInfo");a(this,"_lastActiveViewerJson");a(this,"_syncEventDonFunc",this.d(de([this.activeViewerChanged,this.syncOtherViewersToActivedChanged],()=>{const e=this.syncOtherViewersToActived;this.viewers.forEach(t=>{e?t.syncOtherViewer(this.activeViewer):t.syncOtherViewer(void 0)})})));a(this,"_player",this.createSceneObjectFromClass(_s));a(this,"_playerdon",this.d(()=>this._player&&this.destroySceneObject(this._player)));a(this,"_esPlyarAndPathTime",this.dv(new If(this)));a(this,"_pathAnimationManager",this.dv(new Of(this)))}getBrowserEnv(){return globalThis.ue&&globalThis.ue.es&&globalThis.ue.esinput?"ESWebView":"Browser"}static get envs(){return M.context.environmentVariables}getSceneObjectById(e){return M.getSceneObjectById(e)}getSceneObject(e){return M.getSceneObject(e)}get $refs(){return M.$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(e){this._activeViewer.value=e,this.viewers.forEach(t=>t.actived=t===e)}get activeViewerChanged(){return this._activeViewer.changed}get syncOtherViewersToActived(){return this._syncOtherViewersToActived.value}set syncOtherViewersToActived(e){this._syncOtherViewersToActived.value=e}get syncOtherViewersToActivedChanged(){return this._syncOtherViewersToActived.changed}get cameraViewsManager(){return this._cmrvm}get completeJson(){var p;const e=this._asset.createdTime||new Date().toISOString(),t=new Date().toISOString(),i=this._asset.name||"未命名项目",o={type:"ESObjectsManager",version:this._asset.version||"0.1.0",createdTime:e,modifiedTime:t,name:i},l=this.sceneTree.completeJson,h=this._cmrvm.views,c=[...this.viewers].map(g=>g.completeJson),u=(p=this.activeViewer)==null?void 0:p.getCurrentCameraInfo();return{asset:o,viewers:c,sceneTree:l,viewCollection:h,lastView:u}}get json(){var p;const e=this._asset.createdTime||new Date().toISOString(),t=new Date().toISOString(),i=this._asset.name||"未命名项目",o={type:"ESObjectsManager",version:this._asset.version||"0.1.0",createdTime:e,modifiedTime:t,name:i},l=this.sceneTree.json,h=this._cmrvm.views,c=[...this.viewers].map(g=>g.json),u=(p=this.activeViewer)==null?void 0:p.getCurrentCameraInfo();return{asset:o,viewers:c,sceneTree:l,viewCollection:h,lastView:u}}set json(e){try{if(!e.asset)return;if(!e.asset.type||e.asset.type!=="ESObjectsManager"){console.warn("json装配失败! asset.type 不存在或者不是'ESObjectsManager'");return}if(this._asset.createdTime=e.asset&&e.asset.createdTime||new Date().toISOString(),this._asset.modifiedTime=e.asset&&e.asset.modifiedTime||"",this._asset.name=e.asset&&e.asset.name||"未命名项目",this._asset.version=e.asset&&e.asset.version||"0.1.0",e.sceneTree&&(this.sceneTree.json=e.sceneTree),e.viewCollection&&(this._cmrvm.views=e.viewCollection),!e.viewers||!Array.isArray(e.viewers)){console.warn("viewers is not an array or does not exist !");return}if(this.viewers.length===0||e.viewers.length===0){console.warn("viewers is empty !");return}this.viewers.forEach(t=>{const i=e.viewers.find(r=>r.id===t.id);i&&(t.json=i)})}catch(t){console.error(`ESObjectsManager解析json数据时发生错误! error: ${t}`)}}get sceneTree(){return this._sceneTree}get jsonLoadingEvent(){return this._sceneTree.jsonLoadingEvent}getSceneTrees(){return[...this._sceneTreeMap.values()]}getSceneTree(e="default"){if(e==="default")return this._sceneTree;if(!this._sceneTreeMap.has(e)){console.warn(`id为${e}的SceneTree不存在!`);return}return this._sceneTreeMap.get(e)}createSceneTree(e,t=24){if(this._sceneTreeMap.has(e)||e==="default")console.warn(`id为${e}的SceneTree已存在!`);else{const i=this.dv(new bn(e,this.dragstartDataMananger,t,this));this._sceneTreeMap.set(e,i)}return this.getSceneTree(e)}get viewerCreatedEvent(){return this._viewerCreatedEvent}createViewer(e){const t=this._vrm.createViewer(e);this.activeViewer||(this.activeViewer=t);const i=this.d(t.viewerChanged.don(r=>{r&&(this._viewerCreatedEvent.emit(t),i())}));return t}destroyViewer(e){return this._activeViewer.value===e&&(this._activeViewer.value=void 0),this._vrm.destroyViewer(e)}switchViewer(e,t=!0,i=!0,r=!0){var c,u;this.activeViewer&&this.activeViewer.getNavigationMode()!=="Map"&&this.activeViewer.changeToMap(),!this._lastCameraInfo&&t&&(this._lastCameraInfo=(c=this.activeViewer)==null?void 0:c.getCurrentCameraInfo(),((u=this.activeViewer)==null?void 0:u.typeName)=="ESOlViewer"&&this._lastCameraInfo&&(this._lastCameraInfo.rotation[1]=-90)),!this._lastActiveViewerJson&&i&&(this._lastActiveViewerJson=this.activeViewer?Gf(this.activeViewer):void 0),r&&this.activeViewer&&this.destroyViewer(this.activeViewer);const o=e.id,l=o?[...this.getViewers()].find(p=>p.id===o):[...this.getViewers()].find(p=>p.typeName===e.type&&!p.container);if(l)if(o&&l.typeName!==e.type)console.warn(`id为${o}的viewer的typeName和option.type${e.type}不相同!,虽然id一致但是typeName不同,所以会销毁并创建新的viewer`),this.destroyViewer(l);else return console.log("ESViewer exists, will be used"),t&&bd(this,l),i&&this._lastActiveViewerJson&&(Sd(l,this._lastActiveViewerJson),this._lastActiveViewerJson=void 0),l.container===vd(e.container)?(l.containerOrId=e.container,l.forceRecreate()):l.containerOrId=e.container,this.activeViewer=l,l;console.log("No ESViewer exists, will be created");const h=this.createViewer(e);return console.log(e),console.log(this),t&&bd(this,h),i&&this._lastActiveViewerJson&&(Sd(h,this._lastActiveViewerJson),this._lastActiveViewerJson=void 0),this.activeViewer=h,h}switchToCesiumViewer(...e){if(typeof e[0]=="object"&&!(e[0]instanceof HTMLDivElement)){const{container:t,viewSync:i,attributeSync:r,destroy:o,id:l}=e[0];return this.switchViewer({type:"ESCesiumViewer",container:t,id:l},i??!0,r??!0,o??!0)}else if(typeof e[0]=="string"||e[0]instanceof HTMLDivElement){const t={container:e[0],viewSync:e[1]??!0,attributeSync:e[2]??!0,destroy:e[3]??!0,id:e[4]},{container:i,viewSync:r,attributeSync:o,destroy:l,id:h}=t;return this.switchViewer({type:"ESCesiumViewer",container:i,id:h},r,o,l)}}switchToOpenLayersViewer(...e){if(typeof e[0]=="object"&&!(e[0]instanceof HTMLDivElement)){const{container:t,viewSync:i,attributeSync:r,destroy:o,id:l}=e[0];return this.switchViewer({type:"ESOlViewer",container:t,id:l},i??!0,r??!0,o??!0)}else if(typeof e[0]=="string"||e[0]instanceof HTMLDivElement){const t={container:e[0],viewSync:e[1]??!0,attributeSync:e[2]??!0,destroy:e[3]??!0,id:e[4]},{container:i,viewSync:r,attributeSync:o,destroy:l,id:h}=t;return this.switchViewer({type:"ESOlViewer",container:i,id:h},r,o,l)}}switchToUEViewer(...e){let t,i={viewSync:!0,attributeSync:!0,destroy:!0};if(typeof e[0]=="object"&&!(e[0]instanceof HTMLDivElement)&&e[0].hasOwnProperty("uri")){const{container:h,uri:c,app:u,token:p,viewSync:g,attributeSync:m,destroy:y,id:S,silentTime:C}=e[0];t={type:"ESUeViewer",container:h,id:S,options:{uri:c,app:u,token:p,silentTime:C}},i={viewSync:g??!0,attributeSync:m??!0,destroy:y??!0}}else if(typeof e[0]=="object"&&!(e[0]instanceof HTMLDivElement)&&e[0].hasOwnProperty("ws")){const{container:h,ws:c,esmsg:u,viewSync:p,attributeSync:g,id:m,destroy:y,silentTime:S}=e[0];t={type:"ESUeViewer",container:h,id:m,options:{ws:c,esmsg:u,silentTime:S}},i={viewSync:p??!0,attributeSync:g??!0,destroy:y??!0}}else if(typeof e[0]=="object"&&!(e[0]instanceof HTMLDivElement)&&e[0].hasOwnProperty("project")){const{container:h,project:c,baseUrl:u,viewSync:p,attributeSync:g,id:m,destroy:y}=e[0];t={type:"ESUeViewer",container:h,id:m,options:{project:c,baseUrl:u}},i={viewSync:p??!0,attributeSync:g??!0,destroy:y??!0}}else(typeof e[0]=="string"||e[0]instanceof HTMLDivElement)&&(typeof e[1]=="string"&&e[1].startsWith("ws")?(t={type:"ESUeViewer",container:e[0],id:e[6],options:{ws:e[1],esmsg:e[2]??void 0,silentTime:e[7]??void 0}},i={viewSync:e[3]??!0,attributeSync:e[4]??!0,destroy:e[5]??!0}):typeof e[1]=="string"&&e[1].startsWith("http")?(t={type:"ESUeViewer",container:e[0],id:e[7],options:{uri:e[1],app:e[2],token:e[3]??void 0,silentTime:e[8]??void 0}},i={viewSync:e[4]??!0,attributeSync:e[5]??!0,destroy:e[6]??!0}):(t={type:"ESUeViewer",container:e[0],id:e[6],options:{project:e[1],baseUrl:e[2]??void 0}},i={viewSync:e[3]??!0,attributeSync:e[4]??!0,destroy:e[5]??!0}));if(!t)throw new Error("参数错误");const{viewSync:r,attributeSync:o,destroy:l}=i;return this.switchViewer(t,r,o,l)}createCesiumViewer(...e){let t;if(typeof e[0]=="object"&&!(e[0]instanceof HTMLDivElement)?t={...e[0],type:"ESCesiumViewer"}:(typeof e[0]=="string"||e[0]instanceof HTMLDivElement)&&(t={container:e[0],options:e[1]??void 0,id:e[2]??void 0,type:"ESCesiumViewer"}),!t)throw new Error("参数错误");return this.createViewer(t)}createOpenLayersViewer(...e){let t;if(typeof e[0]=="object"&&!(e[0]instanceof HTMLDivElement)?t={...e[0],type:"ESOlViewer"}:(typeof e[0]=="string"||e[0]instanceof HTMLDivElement)&&(t={container:e[0],options:e[1]??void 0,id:e[2]??void 0,type:"ESOlViewer"}),!t)throw new Error("参数错误");return this.createViewer(t)}createUeViewer(...e){let t;if(typeof e[0]=="object"&&!(e[0]instanceof HTMLDivElement)?t={...e[0],type:"ESUeViewer"}:(typeof e[0]=="string"||e[0]instanceof HTMLDivElement)&&(typeof e[1]=="string"&&e[1].startsWith("ws")?t={type:"ESUeViewer",container:e[0],id:e[3]??void 0,options:{ws:e[1],esmsg:e[2]??void 0,silentTime:e[4]??void 0}}:typeof e[1]=="string"&&e[1].startsWith("http")?t={type:"ESUeViewer",container:e[0],id:e[4]??void 0,options:{uri:e[1],app:e[2],token:e[3]??void 0,silentTime:e[5]??void 0}}:t={type:"ESUeViewer",container:e[0],id:e[3]??void 0,options:{project:e[1],baseUrl:e[2]??void 0}}),!t)throw new Error("参数错误");return this.createViewer(t)}createSceneObject(e,t){return this._sobjm.createSceneObject(e,t)}createSceneObjectFromUrl(e,t){return this._sobjm.createSceneObjectFromUrl(e,t)}createSceneObjectFromClass(e,t){return this._sobjm.createSceneObjectFromClass(e,t)}createSceneObjectFromJson(e){return this._sobjm.createSceneObjectFromJson(e)}destroySceneObject(e){const t=this._sobjm.deleteSceneObject(e);return e.destroy(),t}destroyAllSceneObjects(){const e=[...this._sobjm.sceneObjects];for(let t of e)t!=this._player&&t!=this._cmrvm&&this.destroySceneObject(t)}get player(){return this._player}get esPlyarAndPathTime(){return this._esPlyarAndPathTime}get pathAnimationManager(){return this._pathAnimationManager}}a(Ir,"getSceneObjById",M.context.getSceneObjectById.bind(M.context)),a(Ir,"getEnv",M.context.getEnv.bind(M.context)),a(Ir,"setEnv",M.context.setEnv.bind(M.context)),d.BooleanProperty=E,d.BorderedPosFloatDiv=hh,d.BoxPicker=Zr,d.CancelError=st,d.CancelsManager=to,d.CanvasImagePoi=Lu,d.CanvasPoi=oo,d.CanvasPointPoi=Vu,d.CanvasPrimitive=Xl,d.CanvasPrimitivesContext=zu,d.ColorProperty=G,d.ColorStops=Cf,d.ComplexImage=Dn,d.CursorFloatDiv=$u,d.CursorInfo=Gu,d.DashPatternProperty=Yn,d.DateProperty=Ve,d.DatesProperty=vo,d.Debouncing=gu,d.DebouncingDeprecated=Xr,d.DebouncingWithStartValues=fu,d.Destroyable=b,d.DivBoxPicker=du,d.DivPoi=oh,d.DivPointerClick=ju,d.DivideProperty=k,d.DomElementEvent=se,d.DoublyLinkedList=Fl,d.DragStartDataManager=Nh,d.ES3DTileset=Ue,d.ESAlarm=Mo,d.ESApertureEffect=Ao,d.ESAreaMeasurement=jo,d.ESAttackArrow=ol,d.ESBlastParticleSystem=Ro,d.ESBoxClipping=No,d.ESCameraView=or,d.ESCameraViewCollection=lr,d.ESCameraVisibleRange=Lo,d.ESCar=hr,d.ESCityBasePoint=Va,d.ESClassification=cr,d.ESClippingPlane=Vo,d.ESCustomDiv=dr,d.ESCustomPrimitive=ul,d.ESCylinder=Ii,d.ESCzml=Ua,d.ESDataMesh=zo,d.ESDatasmithRuntimeModel=wa,d.ESDirectionMeasurement=ca,d.ESDistanceMeasurement=Uo,d.ESDynamicWater=Ea,d.ESEntityCluster=Ra,d.ESExcavate=Sn,d.ESFeatureLayer=tl,d.ESFireParticleSystem=ur,d.ESFireWall=Jo,d.ESForestTileset=Bo,d.ESFountainParticleSystem=yr,d.ESGaussianSplatting=Ja,d.ESGeHistoryImagery=vl,d.ESGeoBezierPath=ll,d.ESGeoBezierSpline=Na,d.ESGeoDiv=Ho,d.ESGeoDivTextPoi=La,d.ESGeoExtrudedPolygon=Ti,d.ESGeoIcon=$a,d.ESGeoJson=Pn,d.ESGeoLineString=ve,d.ESGeoPoint=Ga,d.ESGeoPoints=On,d.ESGeoPolygon=ee,d.ESGeoPolygonWithFire=Go,d.ESGeoRectangle=qo,d.ESGeoSmoothPolygon=hl,d.ESGeoVector=U,d.ESGeoWater=ba,d.ESGltfModel=Et,d.ESGltfModelEditing=nl,d.ESHeatMap=Sr,d.ESHeightLimitAnalysis=ja,d.ESHeightMeasurement=ua,d.ESHole=Oa,d.ESHuman=Be,d.ESHumanFountain=xa,d.ESHumanPoi=Ia,d.ESHumans=rl,d.ESImageLabel=pr,d.ESImageryLayer=fs,d.ESJArrowModeArray=wo,d.ESJClassificationTypeArray=yo,d.ESJEditingMode=I,d.ESJLonLatFormat=Rh,d.ESJPickedResult=fp,d.ESKml=ml,d.ESLabel=ze,d.ESLandSlide=qa,d.ESLevelRuntimeModel=Sa,d.ESLocalCircle=pa,d.ESLocalLineString=cl,d.ESLocalLineStringZ=dl,d.ESLocalPolygon=Tn,d.ESLocalPolygonZ=ga,d.ESLocalRectangle=fa,d.ESLocalSkyBox=Yo,d.ESLocalVector=ti,d.ESLocalVector2D=ot,d.ESLocationMeasurement=Ko,d.ESMVTLayer=il,d.ESMediaLayer=sl,d.ESMsTileset=ka,d.ESNavigator=Ba,d.ESObjectWithLocation=j,d.ESObjectsManager=Ir,d.ESParticleSystemPrimitive=gr,d.ESPath=ys,d.ESPathImpl=ii,d.ESPipeFence=vr,d.ESPipeline=Ca,d.ESPipeserTileset=ma,d.ESPit=vs,d.ESPlayer=_s,d.ESPoi2D=Cn,d.ESPoi3D=Zo,d.ESPoiTileset=Ma,d.ESPolygonFence=_r,d.ESPolygonFlattenedPlane=Qo,d.ESPolygonWithHole=_a,d.ESPolygonsFlattenedPlane=ea,d.ESRectangle=va,d.ESRoad=pl,d.ESRtsFeatureEditing=Fa,d.ESRtsTileset=Da,d.ESScale=Aa,d.ESSceneObject=M,d.ESSceneObjectWithId=$h,d.ESSeparateFoliage=ta,d.ESSignalInterference=al,d.ESSignalTransmission=gl,d.ESSkylineAnalysis=Ya,d.ESSquadCombatArrow=$o,d.ESStaticMesh=Xa,d.ESSubmergingAnalysis=ia,d.ESSunshineAnalysis=sa,d.ESSurfaceAreaMeasurement=ya,d.ESTerrainLayer=na,d.ESTerrainLayerEditing=xn,d.ESTerrainLayerEditingBrushEarseFalloff=Jc,d.ESTerrainLayerEditingFlattenMode=$c,d.ESTerrainLayerEditingFlattenPick=Gc,d.ESTestObject=ko,d.ESTextLabel=ms,d.ESUEWidget=ra,d.ESUnrealActor=oa,d.ESVideoFusion=aa,d.ESViewShed=la,d.ESViewer=at,d.ESViewerStatusBar=Wa,d.ESViewerStatusBarScale=Ha,d.ESVisibilityAnalysis=Pa,d.ESVisualObject=X,d.ESVolumeMeasurement=Ta,d.ESWidget=ha,d.ESXYZLayer=_l,d.EngineObject=xi,d.EnumProperty=A,d.EvalStringProperty=Xe,d.Event=v,d.EventFromArrayUpdating=eu,d.EventListenerHandler=jr,d.Fetching=ou,d.FloatDiv=ho,d.FlvJsLoading=Pr,d.FlvProcessing=fd,d.GetSetProperty=_o,d.Gif=Fh,d.GifPlayer=Dh,d.GifProcessing=kh,d.HasOwner=Zd,d.HlsJsLoading=Cr,d.HlsProcessing=gd,d.IFrameBorderedPosFloatDiv=Wu,d.ImageProcessing=wh,d.IntervalDeprecated=Kr,d.JsonArrayProperty=ie,d.JsonProperty=R,d.ListenerPipe=Ar,d.LocalFileServer=_h,d.LocalRootDir=vh,d.LongStringProperty=_n,d.MethodProperty=L,d.NextAnimateFrameEvent=zn,d.NextAnimateFrameWeakEvent=kl,d.NextMicroTaskEvent=Ur,d.NextMicroTaskWeakEvent=Wd,d.Number2Property=ne,d.Number3Property=ue,d.Number4Property=Fe,d.NumberProperty=f,d.NumberSliderProperty=pe,d.ObjPool=An,d.ObjResetting=Xu,d.ObjResettingWithEvent=le,d.ObservableArray=hn,d.ObservableSet=Xn,d.PickColorMananger=nh,d.PickedInfo=gp,d.Player=Ye,d.PlayerProperty=us,d.PointerClick=ro,d.PointerClickDeprecated=Wl,d.PointerHover=ql,d.PointerHoverDeprecated=Ru,d.PosFloatDiv=po,d.PositionProperty=nt,d.Processing=fe,d.Property=ei,d.ReactVarProperty=Te,d.ReactiveVariable=ge,d.RotationProperty=ds,d.SceneObjectFromId=So,d.SceneTree=bn,d.SceneTreeContextMenu=lc,d.SceneTreeItem=Ie,d.SceneTreeItemDragDrop=ac,d.SmartListenerHandler=sn,d.SmartListenerPipe=Md,d.SmoothMoveController=ng,d.StringProperty=N,d.Throttling=Mu,d.ThrottlingWithStartValues=Au,d.TimingDeprecated=Ul,d.ToolTipDiv=Hu,d.Transition=pn,d.TransitionDeprecated=hu,d.Tree=Si,d.TreeItem=vn,d.TreeItemDragDrop=Lh,d.UiTree=ph,d.UiTreeObject=uh,d.VideoProcessing=Sh,d.ViewPlayerProperty=jh,d.ViewerCustomInteraction=Ed,d.Watcher=wn,d.WatcherTools=Gh,d.WithUndefinedProperty=mo,d.XrPlayer=Jn,d.Xyzw2Ns=Wn,d._getFeatureProperty=Rc,d._getLayerConfig=Mc,d._getport=jc,d._saveLayerConfig=Ac,d.addTreesCallFunc=vc,d.animateFrame=Ln,d.apis=br,d.ary2Ns=ru,d.asyncFuncToCancelablePromise=yu,d.bind=D,d.bindCustomEditing=Uh,d.bindu=Ud,d.booleanPointInPolygon=Ap,d.buildFeatureTilesetUrl=kc,d.buildInfoUrl=xg,d.buildTilesetUrl=Fc,d.calcArrowPoints=Fo,d.canMoveToTreeItem=mn,d.canMoveToTreeItems=ch,d.cancelFuncToCancelablePromise=_u,d.cancelPromise=Qr,d.cancelableFetch=so,d.cancelableFetchDeprecated=zl,d.cancelableFetchWithProgress=Eu,d.cartesianDistance=ic,d.clamp=Hn,d.clamp0_360=ps,d.clampN180_180=zh,d.complexImageTypes=bh,d.createAnimateFrame=dn,d.createAnimateFrameWithStartValues=cs,d.createBottomTriangleElement=lh,d.createCancelablePromise=hs,d.createCloseDiv=ah,d.createEventsCallFunc=de,d.createFetching=bu,d.createFetchingWithStartValues=Su,d.createGuid=ns,d.createInterval=xu,d.createIntervalWithStartValues=Ou,d.createNextAnimateFrame=Cu,d.createNextAnimateFrameEvent=oe,d.createNextAnimateFrameEventCallFunc=$d,d.createNextAnimateFrameWeakEvent=Gd,d.createNextAnimateFrameWithStartValues=Pu,d.createNextMicroTask=Tu,d.createNextMicroTaskEvent=Bd,d.createNextMicroTaskWeakEvent=Hd,d.createNextMicroTaskWithStartValues=Iu,d.createNumbers=Bn,d.createProcessingFromAsyncFunc=Le,d.createProcessingFromAsyncFuncWithStartValues=wu,d.createProcessingFromPromiseCreateFunc=Gn,d.createProcessingFromPromiseCreateFuncWithStartValues=io,d.createSleeping=Du,d.createSleepingWithStartValues=Fu,d.createStartFuncFromAsyncFunc=cn,d.createTimeout=$l,d.createTimeoutWithStartValues=Gl,d.cutDownTreesCallFunc=wc,d.czmPixelFormats=Eh,d.data=Tg,d.dataMd=Ig,d.debounce=Nn,d.defaultGetLocalFilePath=Yu,d.defaultInitSceneObjectOnCreatingFunc=vp,d.defaultLight122FromEnvironmentMapManager=Do,d.defaultLoadFuncDocStr=Pc,d.defaultLoadFuncStr=da,d.defaultLocalFileServer=yh,d.defaultStartUpdateFunc=Un,d.defaultUpdateSceneObjectOnPickingFunc=mp,d.defineReactiveProp=Yr,d.destroyObject=Il,d.diffGeoJson=Pp,d.downloadLink=Yd,d.drawBubble=Ei,d.drawPoint=Nu,d.drawRoundRectPath=Yl,d.drawText=Kl,d.drawTextBlock=ao,d.engineObjectCreatedUpdate=nc,d.equalsN3=sr,d.every=Wr,d.extendClassProps=Kt,d.fetchArrayBuffer=Qd,d.fetchImage=Rl,d.forEach=_t,d.forEachWithBreak=Br,d.geoAlong=jp,d.geoArea=Po,d.geoBuffer=Zh,d.geoCenterOfMass=Rp,d.geoDestination=To,d.geoDifference=Qh,d.geoDistance=er,d.geoHeading=En,d.geoIntersect=Yh,d.geoLineIntersect=Np,d.geoNearestPointOnLine=Vp,d.geoPointToLineDistance=zp,d.geoPolygonFromCircle=ec,d.geoPolygonOverlap=Io,d.geoPolylineToBezierSpline=gs,d.geoRhumbDestination=Up,d.geoRhumbDistance=Xh,d.geoRhumbHeading=Bp,d.geoUnion=Kh,d.getColorHexStr=fn,d.getCompleteReactParams=Rn,d.getDefaultValue=Ep,d.getDistancesFromPositions=Vt,d.getDomEventCurrentTargetPos=we,d.getDrawRect=wi,d.getElementBounds=Cp,d.getEventFromPromise=pu,d.getEventPosInCurrentTarget=os,d.getExtProp=Ne,d.getFileArrayBuffer=mh,d.getFileJson=fh,d.getFileText=go,d.getFloatDivPool=uo,d.getGeoBoundingSphereFromPositions=tc,d.getIterator=rn,d.getMidpoint=Lp,d.getMinMaxCorner=tr,d.getMinMaxPosition=Nl,d.getPromiseCancel=as,d.getPromiseFromEvent=uu,d.getPromiseFromProcessing=no,d.getReactFuncs=tn,d.getRtsServicePrefix=Pi,d.getSceneObjectTreeItem=_p,d.getSubEntriesFromDir=gh,d.getTypeFromImageUri=md,d.getValueFromProps=Ml,d.getXyzFromPostion=xo,d.growthSimulationCallFunc=Ec,d.hasSameTags=Vh,d.hasSameViewerTags=yn,d.imageToCanvas=Zl,d.inOrderRunning=bp,d.interval=Vr,d.isFeatureEqual=Wh,d.isGeometryEqual=Hh,d.isJSON=Eo,d.isPromiseCancelable=ls,d.isRelativeRtsInfoUrl=Ic,d.isXML=wp,d.lbhToWebMerc=kp,d.lbhToXyz=rt,d.length=Hr,d.lerpAngle=Zn,d.lerpRotation=bo,d.loadGifFrames=xh,d.loadJs=Jr,d.map=sc,d.max=Nt,d.min=Zt,d.moveToTreeItem=qn,d.moveToTreeItems=dh,d.nextAnimateFrame=rs,d.nextMicroTask=nn,d.objsIterator=_i,d.oneTimeWarning=is,d.optionsStr=wg,d.pairToPromise=eo,d.parsePlatformFromUrl=Oc,d.parseRtsHost=xc,d.parseRtsOrigin=Er,d.parseTileServiceName=Dc,d.pluckProperty=$r,d.react=w,d.reactArray=F,d.reactArrayCollection=Rd,d.reactArrayCollectionWithUndefined=Rr,d.reactArrayWithUndefined=q,d.reactDeepArray=jn,d.reactDeepArrayWithUndefined=Xt,d.reactJson=B,d.reactJsonCollection=Nd,d.reactJsonCollectionWithUndefined=Ld,d.reactJsonWithUndefined=te,d.reactPlainObject=Ad,d.reactPlainObjectWithUndefined=jd,d.reactPosition2Ds=ir,d.reactPosition2DsSet=Vd,d.reactPositions=Yt,d.reactPositionsSet=Nr,d.reduce=ln,d.registerEventCtor=xl,d.registerEventUpdate=Jp,d.removeAllTreesCallFunc=_c,d.requestAnimationFrameTimeStampTest=Kd,d.resolveRtsInfoUrl=wr,d.rpToap=yp,d.saveOnBrowser=Xd,d.setCanvasUniformColor=Ql,d.setExtProp=vt,d.setPromiseCancel=Qt,d.setSceneObjectTreeItem=Kn,d.setValueFromProps=qd,d.sleep=un,d.sleepDeprecated=au,d.step=yi,d.stepProcessing=ku,d.throttle=Gr,d.timeout=zr,d.toGeoJson=Bh,d.track=_,d.uint32ToUint8s=ih,d.uint8ToHexStr=gn,d.uint8sToUint32=sh,d.updateTreeParamsCallFunc=yc,d.webMercToLbh=Mp,d.xyz2N2=tu,d.xyz2N3=iu,d.xyzToLbh=Co,d.xyzw2N4=su,Object.defineProperty(d,Symbol.toStringTag,{value:"Module"})}));
|
|
1847
|
+
`,Uf='<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>',Bf='<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>',es=class es extends b{constructor(s){super();const e=()=>{const t=this.dv(new dr);this.d(_([t,"show"],[s,"useDefaultStatusDiv"]));{const i=()=>{t.show=(s.useDefaultStatusDiv??!0)&&s.status!=="Created"};i(),this.d(s.useDefaultStatusDivChanged.don(i)),this.d(s.statusChanged.don(i)),t.cssText="width:100%;height:100%;position:absolute;left:0px;top:0px;"}s.add(t),this.d(()=>s.delete(t)),t.instanceClass=class extends b{constructor(o,l,h){super();a(this,"_div",document.createElement("div"));if(this._subContainer=o,!h)return;this._subContainer.appendChild(this._div),this.d(()=>this._subContainer.removeChild(this._div));{const y=()=>{l.show?this._div.style.opacity="1":this._div.style.opacity="0"};y(),this.d(l.showChanged.don(y))}let c,u,p,g,m;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",c=document.createElement("div"),this._div.appendChild(c),c.style.width="auto",c.style.position="absolute",c.style.left="50%",c.style.top="50%",c.style.transform="translate(-50%,-50%)",c.style.background="rgba(120, 120, 0, 0.7)",c.style.color="white",c.style.fontSize="10px",c.style.background="none",c.style.display="flex",c.style.justifyContent="center",c.style.alignItems="center",u=document.createElement("div"),c.appendChild(u),u.style.pointerEvents="none",u.style.display="block",u.style.width="40px",u.innerHTML=es.defaultsSvg.loadingSvg,u.style.filter="drop-shadow(0px 0px 1px black)",p=document.createElement("div"),c.appendChild(p),p.style.pointerEvents="none",p.style.marginLeft="10px",p.style.display="flex",p.style.flexFlow="column",p.style.maxWidth="300px",g=document.createElement("div"),p.appendChild(g),g.style.fontSize="14px",g.style.fontWeight="800",g.style.marginBottom="5px",g.style.textShadow="0 0 2px black",m=document.createElement("div"),p.appendChild(m),m.style.fontWeight="400",m.style.textShadow="0 0 2px black";{const y=()=>{let C="Raw";h.status==="Raw"?C="初始状态":h.status==="Creating"?C="正在创建":h.status==="Created"?C="创建完成":h.status==="Error"?C="创建失败":h.status==="Reconnecting"&&(C="重新连接"),g.innerText=`${C}(${h.status})`,m.innerText=`${h.statusLog}`,(h.status==="Creating"||h.status==="Reconnecting")&&(u.innerHTML=es.defaultsSvg.loadingSvg),h.status==="Created"&&(u.innerHTML=es.defaultsSvg.successSvg),h.status==="Error"&&(u.innerHTML=es.defaultsSvg.warnSvg)};y();const S=this.dv(oe(h.statusLogChanged,h.statusChanged));this.d(S.don(y))}}update(){const o=255*Math.random()|0,l=255*Math.random()|0,h=255*Math.random()|0;this._div.style.background=`rgba(${o}, ${l}, ${h}, 0.8)`}}};this.d(s.containerChanged.don(()=>{e()}))}};a(es,"defaultsSvg",{loadingSvg:zf,successSvg:Uf,warnSvg:Bf});let wl=es;class Wf extends b{constructor(s,e,t){super(),this._subContainer=s,this._overlayContainer=e,this._viewer=t;const i=this._subContainer,r=this._overlayContainer,o=this._viewer,l=()=>{const u=o.zIndex??"";i.style.zIndex=u,r.style.zIndex=u};l(),this.d(o.zIndexChanged.don(l));const h=()=>{i.style.display=o.show??!0?"block":"none"};h(),this.d(o.showChanged.don(h));const c=()=>{i.style.opacity=`${o.opacity??1}`};c(),this.d(o.opacityChanged.don(c))}}function Tr(n){let s=Ne(n,"_relativeContainer");return s||(s=document.createElement("div"),s.style.position="relative",s.style.width="100%",s.style.height="100%",s.style.padding="0",s.style.margin="0",n.appendChild(s),vt(n,"_relativeContainer",s)),s}class Hf extends b{constructor(e,t){super();a(this,"_subContainer",document.createElement("div"));a(this,"_overlayContainer",document.createElement("div"));a(this,"_containerStyleController");this._container=e,this._viewer=t,this._containerStyleController=this.dv(new Wf(this._subContainer,this._overlayContainer,this._viewer));const{subContainer:i,overlayContainer:r}=this;i.tabIndex=-1,i.style.outline="none",i.style.width="100%",i.style.height="100%",i.onpointerdown=()=>i.focus(),r.style.position="relative",r.setAttribute("earthsdk3","earthsdk3-overlayContainer"),i.setAttribute("earthsdk3","earthsdk3-subContainer"),Tr(this._container).appendChild(i),this.d(()=>Tr(this._container).removeChild(i)),Tr(this._container).appendChild(r),this.d(()=>Tr(this._container).removeChild(r))}get subContainer(){return this._subContainer}get overlayContainer(){return this._overlayContainer}get containerStyleController(){return this._containerStyleController}get container(){return this._container}}class $f extends b{constructor(){super(...arguments);a(this,"registerObjsMap",new Map)}register(e,t){return this.registerObjsMap.has(e)&&console.warn(`register warn:${e}已经被注册,再次注册会覆盖。`),this.registerObjsMap.set(e,t),e}getViewerConstructor(e){const t=this.registerObjsMap.get(e);if(!t){console.warn(`未找到${e}类!`);return}return t}createViewer(e){const t=e.type;console.log(e);const i=this.getViewerConstructor(t);if(!i)throw new Error(`没有找到类型为${t}的Viewer构造器!`);return new i(e)}}class bd extends b{constructor(s,e,t=!1,i=!1){if(super(),this._viewer=s,!e)throw new Error("ViewerCustomInteraction: container is null");const r=this.dv(se.create(e,"pointerdown")),o=this.dv(se.create(e,"pointermove")),l=this.dv(se.create(e,"pointerup")),h=this.dv(se.create(e,"pointerout")),c=this.dv(se.create(e,"pointerover")),u=this.dv(new ro),p=this.dv(new ql),g=()=>{const x=this._viewer.hoverTime*1e3;p.delayTime=x};this.d(this._viewer.hoverTimeChanged.don(()=>{g()})),this.d(r.don(x=>u.pointerDown(x))),this.d(o.don(x=>u.pointerMove(x))),this.d(l.don(x=>u.pointerUp(x))),this.d(h.don(x=>u.pointerOut(x))),this.d(r.don(x=>p.pointerDown(x))),this.d(o.don(x=>p.pointerMove(x))),this.d(l.don(x=>p.pointerUp(x))),this.d(h.don(x=>p.pointerOut(x)));const{x:m,y}=e.getBoundingClientRect(),S=i?m:0,C=i?y:0;this.d(p.hoverEvent.don(x=>{const[$,Y]=os(x,t);this._viewer.hoverEvent.emit({screenPosition:[$+S,Y+C],pointerEvent:x})})),this.d(u.clickEvent.don(x=>{const[$,Y]=os(x,t);this._viewer.clickEvent.emit({screenPosition:[$+S,Y+C],pointerEvent:x})})),this.d(u.dbclickEvent.don(x=>{const[$,Y]=os(x,t);x.button===0&&this._viewer.dblclickEvent.emit({screenPosition:[$+S,Y+C],pointerEvent:x})})),this.d(r.don(x=>{const[$,Y]=os(x,t);x.button===0&&this._viewer.pointerDownEvent.emit({screenPosition:[$+S,Y+C],pointerEvent:x})})),this.d(l.don(x=>{const[$,Y]=os(x,t);x.button===0&&this._viewer.pointerUpEvent.emit({screenPosition:[$+S,Y+C],pointerEvent:x})})),this.d(o.don(x=>{const[$,Y]=we(x,t);this._viewer.pointerMoveEvent.emit({screenPosition:[$+S,Y+C],pointerEvent:x})})),this.d(c.don(x=>{const[$,Y]=we(x,t);this._viewer.pointerOverEvent.emit({screenPosition:[$+S,Y+C],pointerEvent:x})})),this.d(h.don(x=>{const[$,Y]=we(x,t);this._viewer.pointerOutEvent.emit({screenPosition:[$+S,Y+C],pointerEvent:x})}));const T=this.dv(se.create(e,"keydown"));this.d(T.don(x=>this._viewer.keyDownEvent.emit(x)));const V=this.dv(se.create(e,"keyup"));this.d(V.don(x=>this._viewer.keyUpEvent.emit(x)));const z=this.dv(se.create(e,"wheel"));this.d(z.don(x=>this._viewer.wheelEvent.emit(x)))}}const Xt=class Xt extends b{constructor(e){super();a(this,"_forceRecreateEvent",this.dv(new v));a(this,"_container",this.dv(w(void 0)));a(this,"_containerSize",this.dv(w(void 0)));a(this,"_editingEvent",this.disposeVar(new v));a(this,"_esViewerExtensions",this.dv(new jf(this)));a(this,"_status",this.dv(w("Raw")));a(this,"_statusLog",this.dv(w("")));a(this,"_statusContainer",this.dv(new wl(this)));a(this,"_useCustomInteraction",this.dv(w(!0)));a(this,"_resetInteractionEvent",this.dv(oe(this.containerChanged,this._useCustomInteraction.changed,this._forceRecreateEvent)));a(this,"_interactionResetting",this.dv(new le(this._resetInteractionEvent,()=>{if(!(!this.container||!this._useCustomInteraction.value))return new bd(this,this.container)})));a(this,"_viewerChanged",this.dv(new v));a(this,"_cameraChanged",this.dv(new v));a(this,"_containerResetEvent",this.dv(oe(this.containerChanged,this._forceRecreateEvent)));a(this,"_containerResetting",this.dv(new le(this._containerResetEvent,()=>{if(this.container)return new Hf(this.container,this)})));a(this,"_sceneObjectsMap",new Map);a(this,"_id");a(this,"_typeName");a(this,"_updateFuncReact",this.dv(w(void 0)));a(this,"_toDestroyFuncReact",this.dv(w(void 0)));a(this,"_statusInfo",Xt.defaults.statusInfo);a(this,"_navigationMode",this.dv(w("Map")));a(this,"_navigationEvent",this.disposeVar(new v));a(this,"_syncViewer",this.dv(w(void 0)));a(this,"_syncEventDon",this.dv(new le(this.syncViewerChanged,()=>{const e=this.syncViewer;if(e)return new Vf(this,e)})));a(this,"_timeSyncdon",this.dv(new le(this.timeSyncChanged,()=>{if(this.timeSync)return new Lf(this)})));a(this,"_hoverEvent",this.dv(new v));a(this,"_pointerOverEvent",this.dv(new v));a(this,"_pointerMoveEvent",this.dv(new v));a(this,"_pointerDownEvent",this.dv(new v));a(this,"_pointerUpEvent",this.dv(new v));a(this,"_pointerOutEvent",this.dv(new v));a(this,"_clickEvent",this.dv(new v));a(this,"_dblclickEvent",this.dv(new v));a(this,"_keyDownEvent",this.dv(new v));a(this,"_keyUpEvent",this.dv(new v));a(this,"_wheelEvent",this.dv(new v));a(this,"_actived",this.dv(w(!1)));this._id=e.id??ns();const t=_d(e.container);if(t)this._container.value=yl(t),this._typeName=e.type,this._initName();else throw new Error("container is not defined");{const i=()=>{t&&(this.show??!0?t.style.display="block":t.style.display="none")};i(),this.d(this.showChanged.don(i))}{const i=this._sceneObjectsMap,r=()=>{for(let[l,h]of i.entries())if(!h&&l){const c=xi.context.createEngineObject(l,this);c&&i.set(l,c)}},o=()=>{for(let[l,h]of i.entries())h&&!h.isDestroyed()&&h.destroy(),i.set(l,void 0)};this.d(o),this.d(this.viewerChanged.don(l=>{o(),l&&r()}))}{const i=()=>{if(this.execOnceFuncStr)try{Function(`"use strict";return (${this.execOnceFuncStr})`)()(this)}catch(r){console.warn(`execOnceFuncStr不能转成函数!或者函数执行时错误!id: ${this.id} ${this.typeName} error: ${r}`)}};i(),this.d(this.execOnceFuncStrChanged.don(i))}{const i=()=>{if(this.updateFuncStr)try{this.updateFunc=Function(`"use strict";return (${this.updateFuncStr})`)()}catch(o){console.warn(`updateFuncStr不能转成函数!或者函数执行时错误!id: ${this.id} ${this.typeName} error: ${o}`)}};i(),this.d(this.updateFuncStrChanged.don(i));let r;this.d(()=>r&&r.destroy()),this.d(this.updateFuncChanged.don(()=>{r&&r.cancel(),this.updateFunc&&(r=r||dn(),r.restart(void 0,o=>{this.updateFunc&&this.updateFunc(this,o)}))}))}{const i=()=>{try{this.toDestroyFunc=this.toDestroyFuncStr&&Function(`"use strict";return (${this.toDestroyFuncStr})`)()||void 0}catch(r){console.warn(`toDestroyFuncStr不能转成函数!或者函数执行时错误!id: ${this.id} ${this.typeName} error: ${r}`),this.toDestroyFunc=void 0}};i(),this.d(this.toDestroyFuncStrChanged.don(i)),this.d(this.toDestroyEvent.don(()=>{this.toDestroyFunc&&this.toDestroyFunc(this)}))}this.ad(new Nf(this))}forceRecreate(){this._forceRecreateEvent.emit()}get container(){return this._container.value}set container(e){this._container.value=e}set containerOrId(e){if(typeof e=="string"){const t=document.getElementById(e);t&&t instanceof HTMLDivElement?this._container.value=yl(t):console.warn("containerOrId warn: !(container instanceof HTMLDivElement)")}else e instanceof HTMLDivElement?this._container.value=yl(e):console.warn("containerOrId warn: setting container failed!")}get containerChanged(){return this._container.changed}get containerSize(){return this._containerSize.value}set containerSize(e){this._containerSize.value=e}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(e){this._status.value=e}get statusLog(){return this._statusLog.value}get statusLogChanged(){return this._statusLog.changed}setStatusLog(e){this._statusLog.value=e}get useCustomInteraction(){return this._useCustomInteraction.value}set useCustomInteraction(e){this._useCustomInteraction.value=e}get viewerChanged(){return this._viewerChanged}get cameraChanged(){return this._cameraChanged}get containerResetEvent(){return this._containerResetEvent}get subContainer(){var e;return(e=this._containerResetting.obj)==null?void 0:e.subContainer}get subContainerChanged(){return this._containerResetting.objChanged}get overlayContainer(){var e;return(e=this._containerResetting.obj)==null?void 0:e.overlayContainer}get overlayContainerChanged(){return this._containerResetting.objChanged}get sceneObjectsMap(){return this._sceneObjectsMap}get sceneObjects(){return this._sceneObjectsMap.keys()}getEngineObject(e){return this.sceneObjectsMap.get(e)}add(...e){for(let t of e)if(!this.has(t)){M.context.addSceneObject(t);const i=xi.context.createEngineObject(t,this);i&&this._sceneObjectsMap.set(t,i),t.viewerAttached.emit(this)}}delete(...e){for(let t of e)if(this.has(t)){const i=this._sceneObjectsMap.get(t);i&&i.destroy(),M.context.deleteSceneObject(t),this._sceneObjectsMap.delete(t),t.viewerDetached.emit(this)}}disposableAdd(...e){return this.add(...e),()=>this.delete(...e)}disAdd(...e){return this.disposableAdd(...e)}has(e){return this._sceneObjectsMap.has(e)}clearAllSceneObjects(){for(let e of this.sceneObjects)this.delete(e)}get id(){return this._id}set id(e){console.warn("ESViewer id is readonly")}get typeName(){return this._typeName}_initName(){this.name=`${this.typeName}_${(""+this.id).slice(-4)}`}get defaultProps(){return Xt.createDefaultProps()}get completeJson(){return this._getJson(!1)}_getJson(e=!0){const t={id:this.id,type:this.typeName};for(let i of Object.keys(this.defaultProps))if(e){let r,o=this.defaultProps[i];o instanceof ge?r=o.equals(this[i]):r=o===this[i],r||(t[i]=this[i])}else t[i]=this[i];return t}_setJson(e,t,i){if(!(e instanceof Object)||e.type&&e.type!==this.typeName){console.error(`value.type && value.type${e.type} !== this.typeName${this.typeName}`);return}e.id&&e.id!==this.id&&console.warn(`value.id === undefined || value.id${e.id} !== this.id(${this.id})`);const r=t||[];r.push("id","type");const o=Object.keys(this.defaultProps).filter(l=>!r.includes(l));for(let l of o)if(l in e)this[l]=e[l]===null?void 0:e[l];else if(!(i??!1)){let h=this.defaultProps[l];h instanceof ge&&(h=h.value),this[l]=h}}get json(){return this._getJson()}set json(e){this._setJson(e,["devTags"])}get updateFunc(){return this._updateFuncReact.value}set updateFunc(e){this._updateFuncReact.value=e}get updateFuncChanged(){return this._updateFuncReact.changed}get toDestroyFunc(){return this._toDestroyFuncReact.value}set toDestroyFunc(e){this._toDestroyFuncReact.value=e}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(e){this._syncViewer.value=e}get syncViewerChanged(){return this._syncViewer.changed}syncOtherViewer(e){e&&e.syncViewer&&(e.syncViewer=void 0),e===this?this._syncViewer.value=void 0:this._syncViewer.value=e}setCurrentTime(e){try{this.currentTime=typeof e=="string"?Date.parse(e):e}catch(t){console.warn(`时间格式不正确! value: ${e} error: ${t}`)}}async getVersion(){return globalThis.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(e){this._actived.value=e}get activedChanged(){return this._actived.changed}getESProperties(){return{defaultMenu:"general",basic:[],general:[],dataSource:[],location:[],coordinate:[],style:[],more:[]}}async getCurrentRectangle(){var e;try{const t=(e=this.container)==null?void 0:e.getBoundingClientRect();if(!t)return;const{width:i,height:r}=t,o=await this.quickPickPosition([0,0]),l=await this.quickPickPosition([i,r]);return!o||!l?void 0:[o[0],l[1],l[0],o[1]]}catch(t){console.error(t);return}}};a(Xt,"context",new $f),a(Xt,"register",Xt.context.register.bind(Xt.context)),a(Xt,"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 at=Xt;(n=>{n.createBaseProps=()=>({name:"未命名场景对象",extras:B(void 0),devTags:q(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}),n.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:q(void 0),editingAuxiliaryPointColor:q(void 0),editingLineWidth:void 0,editingLineColor:q(void 0),editingAxisSize:void 0,editingAuxiliaryPointSize:void 0,editingHeightOffset:0,editingLineShow:!0,editingEventListening:!0,terrainShader:n.defaults.terrainShader,splitPosition:w(void 0),rollerShutter:!1,cameraMovableRegion:q(void 0),depthTestAgainstTerrain:!0,terrainOpacity:1,sceneGlobeBaseColor:F([1,1,1,1]),sceneBackgroundColor:F([0,0,0,0])}),n.createDefaultProps=()=>({...(0,n.createBaseProps)(),...(0,n.createCommonProps)()})})(at||(at={})),Kt(at.prototype,at.createDefaultProps);function Sd(n,s){const e=n._lastCameraInfo;if(e){const t=s.viewerChanged.don(i=>{if(!i||!e)return;const{position:r,rotation:o}=e;s.flyIn(r,o,0),n._lastCameraInfo=void 0,t()})}}const Gf=n=>{const s=at.createCommonProps(),e={};try{Object.keys(s).forEach(t=>{e[t]=n[t]})}catch(t){console.warn(t)}return e},Cd=(n,s)=>{const e=at.createCommonProps();try{Object.keys(e).forEach(t=>{n[t]=s[t]})}catch(t){console.warn(t)}};class Jf extends b{constructor(e){super();a(this,"_viewersChanged",this.disposeVar(new v));a(this,"_viewers",new Set);a(this,"_viewersToChange",this.dv(new v));this._sceneObjectsManager=e,(async()=>{for(let t of this.viewers){const i=this._sceneObjectsManager.sceneObjects;for(const r of i)await this.addSceneObject(r,t)}this.d(()=>{const t=this._sceneObjectsManager.sceneObjects;for(const i of this.viewers)i.delete(...t),this.destroyViewer(i);this._viewers.clear()}),this.d(this._sceneObjectsManager.sceneObjectsToChange.don(async(t,i)=>{for(let r of this.viewers){t.forEach(o=>{this.deleteSceneObject(o,r)});for(let o of i)await this.addSceneObject(o,r)}if(i.length>0)for(let r of i)r.d(r.devTagsChanged.don(async()=>{for(let o of this.viewers){if(o.has(r)&&!yn(o.devTags,r.devTags)){o.delete(r);continue}await this.addSceneObject(r,o)}})),r.ad(r.reloadEvent.don(async()=>{for(let o of this.viewers)o.has(r)&&(o.delete(r),await this.addSceneObject(r,o))}))})),this.d(this.viewersChanged.don(async(t,i)=>{const r=this._sceneObjectsManager.sceneObjects;t.forEach(o=>{for(let l of r)this.deleteSceneObject(l,o)});for(let o of i)for(let l of r)await this.addSceneObject(l,o);i.length>0&&i.forEach(o=>{o.d(o.devTagsChanged.don(async()=>{o.clearAllSceneObjects();const l=this._sceneObjectsManager.sceneObjects;for(let h of l)console.log("viewersChanged",o.devTags,h.devTags,yn(o.devTags,h.devTags)),await this.addSceneObject(h,o)}))})}))})()}get viewersChanged(){return this._viewersChanged}get viewers(){return[...this._viewers]}getViewers(){return[...this._viewers]}get viewersToChange(){return this._viewersToChange}createViewer(e){const t=at.context.createViewer(e);return this._viewers.add(t),this._viewersChanged.emit([],[t]),t}destroyViewer(e){return e.isDestroyed()?!0:this._viewers.has(e)?(this._viewers.delete(e),this._viewersChanged.emit([e],[]),e.destroy(),e.isDestroyed()):!1}async addSceneObject(e,t){yn(t.devTags,e.devTags)&&(t.has(e)?console.warn(`${t.typeName}中已存${e.typeName},检查逻辑是否有问题!`):t.add(e))}deleteSceneObject(e,t){yn(t.devTags,e.devTags)&&(t.has(e)?t.delete(e):console.warn(`${t.typeName}中不存在${e.typeName},检查逻辑是否有问题!`))}}class Ir extends b{constructor(...e){super();a(this,"_drgm",this.dv(new Nh));a(this,"_sobjm",this.dv(new Mf));a(this,"_vrm",this.dv(new Jf(this._sobjm)));a(this,"_sceneObjectEditingManager",this.disposeVar(new kf));a(this,"_activeViewer",this.dv(w(void 0)));a(this,"_syncOtherViewersToActived",this.dv(w(!1)));a(this,"_cmrvm",this.createSceneObjectFromClass(lr));a(this,"_cmrvmdon",this.d(()=>this._cmrvm&&this.destroySceneObject(this._cmrvm)));a(this,"_asset",{type:"ESObjectsManager",version:"0.1.0",createdTime:"",modifiedTime:"",name:"未命名项目"});a(this,"_sceneTree",this.dv(new bn("default",this.dragstartDataMananger,24,this)));a(this,"_sceneTreeMap",new Map);a(this,"_viewerCreatedEvent",this.dv(new v));a(this,"_lastCameraInfo");a(this,"_lastActiveViewerJson");a(this,"_syncEventDonFunc",this.d(de([this.activeViewerChanged,this.syncOtherViewersToActivedChanged],()=>{const e=this.syncOtherViewersToActived;this.viewers.forEach(t=>{e?t.syncOtherViewer(this.activeViewer):t.syncOtherViewer(void 0)})})));a(this,"_player",this.createSceneObjectFromClass(_s));a(this,"_playerdon",this.d(()=>this._player&&this.destroySceneObject(this._player)));a(this,"_esPlyarAndPathTime",this.dv(new If(this)));a(this,"_pathAnimationManager",this.dv(new Of(this)))}getBrowserEnv(){return globalThis.ue&&globalThis.ue.es&&globalThis.ue.esinput?"ESWebView":"Browser"}static get envs(){return M.context.environmentVariables}getSceneObjectById(e){return M.getSceneObjectById(e)}getSceneObject(e,t=!1){return M.getSceneObject(e,t)}get $refs(){return M.$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(e){this._activeViewer.value=e,this.viewers.forEach(t=>t.actived=t===e)}get activeViewerChanged(){return this._activeViewer.changed}get syncOtherViewersToActived(){return this._syncOtherViewersToActived.value}set syncOtherViewersToActived(e){this._syncOtherViewersToActived.value=e}get syncOtherViewersToActivedChanged(){return this._syncOtherViewersToActived.changed}get cameraViewsManager(){return this._cmrvm}get completeJson(){var p;const e=this._asset.createdTime||new Date().toISOString(),t=new Date().toISOString(),i=this._asset.name||"未命名项目",o={type:"ESObjectsManager",version:this._asset.version||"0.1.0",createdTime:e,modifiedTime:t,name:i},l=this.sceneTree.completeJson,h=this._cmrvm.views,c=[...this.viewers].map(g=>g.completeJson),u=(p=this.activeViewer)==null?void 0:p.getCurrentCameraInfo();return{asset:o,viewers:c,sceneTree:l,viewCollection:h,lastView:u}}get json(){var p;const e=this._asset.createdTime||new Date().toISOString(),t=new Date().toISOString(),i=this._asset.name||"未命名项目",o={type:"ESObjectsManager",version:this._asset.version||"0.1.0",createdTime:e,modifiedTime:t,name:i},l=this.sceneTree.json,h=this._cmrvm.views,c=[...this.viewers].map(g=>g.json),u=(p=this.activeViewer)==null?void 0:p.getCurrentCameraInfo();return{asset:o,viewers:c,sceneTree:l,viewCollection:h,lastView:u}}set json(e){try{if(!e.asset)return;if(!e.asset.type||e.asset.type!=="ESObjectsManager"){console.warn("json装配失败! asset.type 不存在或者不是'ESObjectsManager'");return}if(this._asset.createdTime=e.asset&&e.asset.createdTime||new Date().toISOString(),this._asset.modifiedTime=e.asset&&e.asset.modifiedTime||"",this._asset.name=e.asset&&e.asset.name||"未命名项目",this._asset.version=e.asset&&e.asset.version||"0.1.0",e.sceneTree&&(this.sceneTree.json=e.sceneTree),e.viewCollection&&(this._cmrvm.views=e.viewCollection),!e.viewers||!Array.isArray(e.viewers)){console.warn("viewers is not an array or does not exist !");return}if(this.viewers.length===0||e.viewers.length===0){console.warn("viewers is empty !");return}this.viewers.forEach(t=>{const i=e.viewers.find(r=>r.id===t.id);i&&(t.json=i)})}catch(t){console.error(`ESObjectsManager解析json数据时发生错误! error: ${t}`)}}get sceneTree(){return this._sceneTree}get jsonLoadingEvent(){return this._sceneTree.jsonLoadingEvent}getSceneTrees(){return[...this._sceneTreeMap.values()]}getSceneTree(e="default"){if(e==="default")return this._sceneTree;if(!this._sceneTreeMap.has(e)){console.warn(`id为${e}的SceneTree不存在!`);return}return this._sceneTreeMap.get(e)}createSceneTree(e,t=24){if(this._sceneTreeMap.has(e)||e==="default")console.warn(`id为${e}的SceneTree已存在!`);else{const i=this.dv(new bn(e,this.dragstartDataMananger,t,this));this._sceneTreeMap.set(e,i)}return this.getSceneTree(e)}get viewerCreatedEvent(){return this._viewerCreatedEvent}createViewer(e){const t=this._vrm.createViewer(e);this.activeViewer||(this.activeViewer=t);const i=this.d(t.viewerChanged.don(r=>{r&&(this._viewerCreatedEvent.emit(t),i())}));return t}destroyViewer(e){return this._activeViewer.value===e&&(this._activeViewer.value=void 0),this._vrm.destroyViewer(e)}switchViewer(e,t=!0,i=!0,r=!0){var c,u;this.activeViewer&&this.activeViewer.getNavigationMode()!=="Map"&&this.activeViewer.changeToMap(),!this._lastCameraInfo&&t&&(this._lastCameraInfo=(c=this.activeViewer)==null?void 0:c.getCurrentCameraInfo(),((u=this.activeViewer)==null?void 0:u.typeName)=="ESOlViewer"&&this._lastCameraInfo&&(this._lastCameraInfo.rotation[1]=-90)),!this._lastActiveViewerJson&&i&&(this._lastActiveViewerJson=this.activeViewer?Gf(this.activeViewer):void 0),r&&this.activeViewer&&this.destroyViewer(this.activeViewer);const o=e.id,l=o?[...this.getViewers()].find(p=>p.id===o):[...this.getViewers()].find(p=>p.typeName===e.type&&!p.container);if(l)if(o&&l.typeName!==e.type)console.warn(`id为${o}的viewer的typeName和option.type${e.type}不相同!,虽然id一致但是typeName不同,所以会销毁并创建新的viewer`),this.destroyViewer(l);else return console.log("ESViewer exists, will be used"),t&&Sd(this,l),i&&this._lastActiveViewerJson&&(Cd(l,this._lastActiveViewerJson),this._lastActiveViewerJson=void 0),l.container===_d(e.container)?(l.containerOrId=e.container,l.forceRecreate()):l.containerOrId=e.container,this.activeViewer=l,l;console.log("No ESViewer exists, will be created");const h=this.createViewer(e);return console.log(e),console.log(this),t&&Sd(this,h),i&&this._lastActiveViewerJson&&(Cd(h,this._lastActiveViewerJson),this._lastActiveViewerJson=void 0),this.activeViewer=h,h}switchToCesiumViewer(...e){if(typeof e[0]=="object"&&!(e[0]instanceof HTMLDivElement)){const{container:t,viewSync:i,attributeSync:r,destroy:o,id:l}=e[0];return this.switchViewer({type:"ESCesiumViewer",container:t,id:l},i??!0,r??!0,o??!0)}else if(typeof e[0]=="string"||e[0]instanceof HTMLDivElement){const t={container:e[0],viewSync:e[1]??!0,attributeSync:e[2]??!0,destroy:e[3]??!0,id:e[4]},{container:i,viewSync:r,attributeSync:o,destroy:l,id:h}=t;return this.switchViewer({type:"ESCesiumViewer",container:i,id:h},r,o,l)}}switchToOpenLayersViewer(...e){if(typeof e[0]=="object"&&!(e[0]instanceof HTMLDivElement)){const{container:t,viewSync:i,attributeSync:r,destroy:o,id:l}=e[0];return this.switchViewer({type:"ESOlViewer",container:t,id:l},i??!0,r??!0,o??!0)}else if(typeof e[0]=="string"||e[0]instanceof HTMLDivElement){const t={container:e[0],viewSync:e[1]??!0,attributeSync:e[2]??!0,destroy:e[3]??!0,id:e[4]},{container:i,viewSync:r,attributeSync:o,destroy:l,id:h}=t;return this.switchViewer({type:"ESOlViewer",container:i,id:h},r,o,l)}}switchToUEViewer(...e){let t,i={viewSync:!0,attributeSync:!0,destroy:!0};if(typeof e[0]=="object"&&!(e[0]instanceof HTMLDivElement)&&e[0].hasOwnProperty("uri")){const{container:h,uri:c,app:u,token:p,viewSync:g,attributeSync:m,destroy:y,id:S,silentTime:C}=e[0];t={type:"ESUeViewer",container:h,id:S,options:{uri:c,app:u,token:p,silentTime:C}},i={viewSync:g??!0,attributeSync:m??!0,destroy:y??!0}}else if(typeof e[0]=="object"&&!(e[0]instanceof HTMLDivElement)&&e[0].hasOwnProperty("ws")){const{container:h,ws:c,esmsg:u,viewSync:p,attributeSync:g,id:m,destroy:y,silentTime:S}=e[0];t={type:"ESUeViewer",container:h,id:m,options:{ws:c,esmsg:u,silentTime:S}},i={viewSync:p??!0,attributeSync:g??!0,destroy:y??!0}}else if(typeof e[0]=="object"&&!(e[0]instanceof HTMLDivElement)&&e[0].hasOwnProperty("project")){const{container:h,project:c,baseUrl:u,viewSync:p,attributeSync:g,id:m,destroy:y}=e[0];t={type:"ESUeViewer",container:h,id:m,options:{project:c,baseUrl:u}},i={viewSync:p??!0,attributeSync:g??!0,destroy:y??!0}}else(typeof e[0]=="string"||e[0]instanceof HTMLDivElement)&&(typeof e[1]=="string"&&e[1].startsWith("ws")?(t={type:"ESUeViewer",container:e[0],id:e[6],options:{ws:e[1],esmsg:e[2]??void 0,silentTime:e[7]??void 0}},i={viewSync:e[3]??!0,attributeSync:e[4]??!0,destroy:e[5]??!0}):typeof e[1]=="string"&&e[1].startsWith("http")?(t={type:"ESUeViewer",container:e[0],id:e[7],options:{uri:e[1],app:e[2],token:e[3]??void 0,silentTime:e[8]??void 0}},i={viewSync:e[4]??!0,attributeSync:e[5]??!0,destroy:e[6]??!0}):(t={type:"ESUeViewer",container:e[0],id:e[6],options:{project:e[1],baseUrl:e[2]??void 0}},i={viewSync:e[3]??!0,attributeSync:e[4]??!0,destroy:e[5]??!0}));if(!t)throw new Error("参数错误");const{viewSync:r,attributeSync:o,destroy:l}=i;return this.switchViewer(t,r,o,l)}createCesiumViewer(...e){let t;if(typeof e[0]=="object"&&!(e[0]instanceof HTMLDivElement)?t={...e[0],type:"ESCesiumViewer"}:(typeof e[0]=="string"||e[0]instanceof HTMLDivElement)&&(t={container:e[0],options:e[1]??void 0,id:e[2]??void 0,type:"ESCesiumViewer"}),!t)throw new Error("参数错误");return this.createViewer(t)}createOpenLayersViewer(...e){let t;if(typeof e[0]=="object"&&!(e[0]instanceof HTMLDivElement)?t={...e[0],type:"ESOlViewer"}:(typeof e[0]=="string"||e[0]instanceof HTMLDivElement)&&(t={container:e[0],options:e[1]??void 0,id:e[2]??void 0,type:"ESOlViewer"}),!t)throw new Error("参数错误");return this.createViewer(t)}createUeViewer(...e){let t;if(typeof e[0]=="object"&&!(e[0]instanceof HTMLDivElement)?t={...e[0],type:"ESUeViewer"}:(typeof e[0]=="string"||e[0]instanceof HTMLDivElement)&&(typeof e[1]=="string"&&e[1].startsWith("ws")?t={type:"ESUeViewer",container:e[0],id:e[3]??void 0,options:{ws:e[1],esmsg:e[2]??void 0,silentTime:e[4]??void 0}}:typeof e[1]=="string"&&e[1].startsWith("http")?t={type:"ESUeViewer",container:e[0],id:e[4]??void 0,options:{uri:e[1],app:e[2],token:e[3]??void 0,silentTime:e[5]??void 0}}:t={type:"ESUeViewer",container:e[0],id:e[3]??void 0,options:{project:e[1],baseUrl:e[2]??void 0}}),!t)throw new Error("参数错误");return this.createViewer(t)}createSceneObject(e,t){return this._sobjm.createSceneObject(e,t)}createSceneObjectFromUrl(e,t){return this._sobjm.createSceneObjectFromUrl(e,t)}createSceneObjectFromClass(e,t){return this._sobjm.createSceneObjectFromClass(e,t)}createSceneObjectFromJson(e){return this._sobjm.createSceneObjectFromJson(e)}destroySceneObject(e){const t=this._sobjm.deleteSceneObject(e);return e.destroy(),t}destroyAllSceneObjects(){const e=[...this._sobjm.sceneObjects];for(let t of e)t!=this._player&&t!=this._cmrvm&&this.destroySceneObject(t)}get player(){return this._player}get esPlyarAndPathTime(){return this._esPlyarAndPathTime}get pathAnimationManager(){return this._pathAnimationManager}}a(Ir,"getSceneObjById",M.context.getSceneObjectById.bind(M.context)),a(Ir,"getEnv",M.context.getEnv.bind(M.context)),a(Ir,"setEnv",M.context.setEnv.bind(M.context)),d.BooleanProperty=E,d.BorderedPosFloatDiv=hh,d.BoxPicker=Zr,d.CancelError=st,d.CancelsManager=to,d.CanvasImagePoi=Vu,d.CanvasPoi=oo,d.CanvasPointPoi=zu,d.CanvasPrimitive=Xl,d.CanvasPrimitivesContext=Uu,d.ColorProperty=G,d.ColorStops=Cf,d.ComplexImage=Dn,d.CursorFloatDiv=Gu,d.CursorInfo=Ju,d.DashPatternProperty=Yn,d.DateProperty=Ve,d.DatesProperty=vo,d.Debouncing=fu,d.DebouncingDeprecated=Xr,d.DebouncingWithStartValues=mu,d.Destroyable=b,d.DivBoxPicker=uu,d.DivPoi=oh,d.DivPointerClick=Ru,d.DivideProperty=k,d.DomElementEvent=se,d.DoublyLinkedList=Fl,d.DragStartDataManager=Nh,d.ES3DTileset=Ue,d.ESAlarm=Mo,d.ESApertureEffect=Ao,d.ESAreaMeasurement=jo,d.ESAttackArrow=ol,d.ESBlastParticleSystem=Ro,d.ESBoxClipping=No,d.ESCameraView=or,d.ESCameraViewCollection=lr,d.ESCameraVisibleRange=Lo,d.ESCar=hr,d.ESCityBasePoint=Va,d.ESClassification=cr,d.ESClippingPlane=Vo,d.ESCustomDiv=dr,d.ESCustomPrimitive=ul,d.ESCylinder=Ii,d.ESCzml=Ua,d.ESDataMesh=zo,d.ESDatasmithRuntimeModel=wa,d.ESDirectionMeasurement=ca,d.ESDistanceMeasurement=Uo,d.ESDynamicWater=Ea,d.ESEntityCluster=Ra,d.ESExcavate=Sn,d.ESFeatureLayer=tl,d.ESFireParticleSystem=ur,d.ESFireWall=Jo,d.ESForestTileset=Bo,d.ESFountainParticleSystem=yr,d.ESGaussianSplatting=Ja,d.ESGeHistoryImagery=vl,d.ESGeoBezierPath=ll,d.ESGeoBezierSpline=Na,d.ESGeoDiv=Ho,d.ESGeoDivTextPoi=La,d.ESGeoExtrudedPolygon=Ti,d.ESGeoIcon=$a,d.ESGeoJson=Pn,d.ESGeoLineString=ve,d.ESGeoPoint=Ga,d.ESGeoPoints=On,d.ESGeoPolygon=ee,d.ESGeoPolygonWithFire=Go,d.ESGeoRectangle=qo,d.ESGeoSmoothPolygon=hl,d.ESGeoVector=U,d.ESGeoWater=ba,d.ESGltfModel=Et,d.ESGltfModelEditing=nl,d.ESHeatMap=Sr,d.ESHeightLimitAnalysis=ja,d.ESHeightMeasurement=ua,d.ESHole=Oa,d.ESHuman=Be,d.ESHumanFountain=xa,d.ESHumanPoi=Ia,d.ESHumans=rl,d.ESImageLabel=pr,d.ESImageryLayer=fs,d.ESJArrowModeArray=wo,d.ESJClassificationTypeArray=yo,d.ESJEditingMode=I,d.ESJLonLatFormat=Rh,d.ESJPickedResult=mp,d.ESKml=ml,d.ESLabel=ze,d.ESLandSlide=qa,d.ESLevelRuntimeModel=Sa,d.ESLocalCircle=pa,d.ESLocalLineString=cl,d.ESLocalLineStringZ=dl,d.ESLocalPolygon=Tn,d.ESLocalPolygonZ=ga,d.ESLocalRectangle=fa,d.ESLocalSkyBox=Yo,d.ESLocalVector=ti,d.ESLocalVector2D=ot,d.ESLocationMeasurement=Ko,d.ESMVTLayer=il,d.ESMediaLayer=sl,d.ESMsTileset=ka,d.ESNavigator=Ba,d.ESObjectWithLocation=j,d.ESObjectsManager=Ir,d.ESParticleSystemPrimitive=gr,d.ESPath=ys,d.ESPathImpl=ii,d.ESPipeFence=vr,d.ESPipeline=Ca,d.ESPipeserTileset=ma,d.ESPit=vs,d.ESPlayer=_s,d.ESPoi2D=Cn,d.ESPoi3D=Zo,d.ESPoiTileset=Ma,d.ESPolygonFence=_r,d.ESPolygonFlattenedPlane=Qo,d.ESPolygonWithHole=_a,d.ESPolygonsFlattenedPlane=ea,d.ESRectangle=va,d.ESRoad=pl,d.ESRtsFeatureEditing=Fa,d.ESRtsTileset=Da,d.ESScale=Aa,d.ESSceneObject=M,d.ESSceneObjectWithId=$h,d.ESSeparateFoliage=ta,d.ESSignalInterference=al,d.ESSignalTransmission=gl,d.ESSkylineAnalysis=Ya,d.ESSquadCombatArrow=$o,d.ESStaticMesh=Xa,d.ESSubmergingAnalysis=ia,d.ESSunshineAnalysis=sa,d.ESSurfaceAreaMeasurement=ya,d.ESTerrainLayer=na,d.ESTerrainLayerEditing=xn,d.ESTerrainLayerEditingBrushEarseFalloff=qc,d.ESTerrainLayerEditingFlattenMode=Gc,d.ESTerrainLayerEditingFlattenPick=Jc,d.ESTestObject=ko,d.ESTextLabel=ms,d.ESUEWidget=ra,d.ESUnrealActor=oa,d.ESVideoFusion=aa,d.ESViewShed=la,d.ESViewer=at,d.ESViewerStatusBar=Wa,d.ESViewerStatusBarScale=Ha,d.ESVisibilityAnalysis=Pa,d.ESVisualObject=X,d.ESVolumeMeasurement=Ta,d.ESWidget=ha,d.ESXYZLayer=_l,d.EngineObject=xi,d.EnumProperty=A,d.EvalStringProperty=Xe,d.Event=v,d.EventFromArrayUpdating=tu,d.EventListenerHandler=jr,d.Fetching=au,d.FloatDiv=ho,d.FlvJsLoading=Pr,d.FlvProcessing=md,d.GetSetProperty=_o,d.Gif=Fh,d.GifPlayer=Dh,d.GifProcessing=kh,d.HasOwner=Qd,d.HlsJsLoading=Cr,d.HlsProcessing=fd,d.IFrameBorderedPosFloatDiv=Hu,d.ImageProcessing=wh,d.IntervalDeprecated=Kr,d.JsonArrayProperty=ie,d.JsonProperty=R,d.ListenerPipe=Ar,d.LocalFileServer=_h,d.LocalRootDir=vh,d.LongStringProperty=_n,d.MethodProperty=L,d.NextAnimateFrameEvent=zn,d.NextAnimateFrameWeakEvent=kl,d.NextMicroTaskEvent=Ur,d.NextMicroTaskWeakEvent=Hd,d.Number2Property=ne,d.Number3Property=ue,d.Number4Property=Fe,d.NumberProperty=f,d.NumberSliderProperty=pe,d.ObjPool=An,d.ObjResetting=Yu,d.ObjResettingWithEvent=le,d.ObservableArray=hn,d.ObservableSet=Xn,d.PickColorMananger=nh,d.PickedInfo=fp,d.Player=Ye,d.PlayerProperty=us,d.PointerClick=ro,d.PointerClickDeprecated=Wl,d.PointerHover=ql,d.PointerHoverDeprecated=Nu,d.PosFloatDiv=po,d.PositionProperty=nt,d.Processing=fe,d.Property=ei,d.ReactVarProperty=Te,d.ReactiveVariable=ge,d.RotationProperty=ds,d.SceneObjectFromId=So,d.SceneTree=bn,d.SceneTreeContextMenu=lc,d.SceneTreeItem=Ie,d.SceneTreeItemDragDrop=ac,d.SmartListenerHandler=sn,d.SmartListenerPipe=Ad,d.SmoothMoveController=rg,d.StringProperty=N,d.Throttling=Au,d.ThrottlingWithStartValues=ju,d.TimingDeprecated=Ul,d.ToolTipDiv=$u,d.Transition=pn,d.TransitionDeprecated=cu,d.Tree=Si,d.TreeItem=vn,d.TreeItemDragDrop=Lh,d.UiTree=ph,d.UiTreeObject=uh,d.VideoProcessing=Sh,d.ViewPlayerProperty=jh,d.ViewerCustomInteraction=bd,d.Watcher=wn,d.WatcherTools=Gh,d.WithUndefinedProperty=mo,d.XrPlayer=Jn,d.Xyzw2Ns=Wn,d._getFeatureProperty=Rc,d._getLayerConfig=Mc,d._getport=jc,d._saveLayerConfig=Ac,d.addTreesCallFunc=vc,d.animateFrame=Ln,d.apis=br,d.ary2Ns=ou,d.asyncFuncToCancelablePromise=wu,d.bind=D,d.bindCustomEditing=Uh,d.bindu=Bd,d.booleanPointInPolygon=jp,d.buildFeatureTilesetUrl=kc,d.buildInfoUrl=Og,d.buildTilesetUrl=Fc,d.calcArrowPoints=Fo,d.canMoveToTreeItem=mn,d.canMoveToTreeItems=ch,d.cancelFuncToCancelablePromise=yu,d.cancelPromise=Qr,d.cancelableFetch=so,d.cancelableFetchDeprecated=zl,d.cancelableFetchWithProgress=bu,d.cartesianDistance=ic,d.clamp=Hn,d.clamp0_360=ps,d.clampN180_180=zh,d.complexImageTypes=bh,d.createAnimateFrame=dn,d.createAnimateFrameWithStartValues=cs,d.createBottomTriangleElement=lh,d.createCancelablePromise=hs,d.createCloseDiv=ah,d.createEventsCallFunc=de,d.createFetching=Su,d.createFetchingWithStartValues=Cu,d.createGuid=ns,d.createInterval=Ou,d.createIntervalWithStartValues=Du,d.createNextAnimateFrame=Pu,d.createNextAnimateFrameEvent=oe,d.createNextAnimateFrameEventCallFunc=Gd,d.createNextAnimateFrameWeakEvent=Jd,d.createNextAnimateFrameWithStartValues=Tu,d.createNextMicroTask=Iu,d.createNextMicroTaskEvent=Wd,d.createNextMicroTaskWeakEvent=$d,d.createNextMicroTaskWithStartValues=xu,d.createNumbers=Bn,d.createProcessingFromAsyncFunc=Le,d.createProcessingFromAsyncFuncWithStartValues=Eu,d.createProcessingFromPromiseCreateFunc=Gn,d.createProcessingFromPromiseCreateFuncWithStartValues=io,d.createSleeping=Fu,d.createSleepingWithStartValues=ku,d.createStartFuncFromAsyncFunc=cn,d.createTimeout=$l,d.createTimeoutWithStartValues=Gl,d.cutDownTreesCallFunc=wc,d.czmPixelFormats=Eh,d.data=Ig,d.dataMd=xg,d.debounce=Nn,d.defaultGetLocalFilePath=Ku,d.defaultInitSceneObjectOnCreatingFunc=_p,d.defaultLight122FromEnvironmentMapManager=Do,d.defaultLoadFuncDocStr=Pc,d.defaultLoadFuncStr=da,d.defaultLocalFileServer=yh,d.defaultStartUpdateFunc=Un,d.defaultUpdateSceneObjectOnPickingFunc=vp,d.defineReactiveProp=Yr,d.destroyObject=Il,d.diffGeoJson=Tp,d.downloadLink=Kd,d.drawBubble=Ei,d.drawPoint=Lu,d.drawRoundRectPath=Yl,d.drawText=Kl,d.drawTextBlock=ao,d.engineObjectCreatedUpdate=nc,d.equalsN3=sr,d.every=Wr,d.extendClassProps=Kt,d.fetchArrayBuffer=eu,d.fetchImage=Rl,d.forEach=_t,d.forEachWithBreak=Br,d.geoAlong=Rp,d.geoArea=Po,d.geoBuffer=Zh,d.geoCenterOfMass=Np,d.geoDestination=To,d.geoDifference=Qh,d.geoDistance=er,d.geoHeading=En,d.geoIntersect=Yh,d.geoLineIntersect=Lp,d.geoNearestPointOnLine=zp,d.geoPointToLineDistance=Up,d.geoPolygonFromCircle=ec,d.geoPolygonOverlap=Io,d.geoPolylineToBezierSpline=gs,d.geoRhumbDestination=Bp,d.geoRhumbDistance=Xh,d.geoRhumbHeading=Wp,d.geoUnion=Kh,d.getColorHexStr=fn,d.getCompleteReactParams=Rn,d.getDefaultValue=bp,d.getDistancesFromPositions=zt,d.getDomEventCurrentTargetPos=we,d.getDrawRect=wi,d.getElementBounds=Pp,d.getEventFromPromise=gu,d.getEventPosInCurrentTarget=os,d.getExtProp=Ne,d.getFileArrayBuffer=mh,d.getFileJson=fh,d.getFileText=go,d.getFloatDivPool=uo,d.getGeoBoundingSphereFromPositions=tc,d.getIterator=rn,d.getMidpoint=Vp,d.getMinMaxCorner=tr,d.getMinMaxPosition=Nl,d.getPromiseCancel=as,d.getPromiseFromEvent=pu,d.getPromiseFromProcessing=no,d.getReactFuncs=tn,d.getRtsServicePrefix=Pi,d.getSceneObjectTreeItem=yp,d.getSubEntriesFromDir=gh,d.getTypeFromImageUri=vd,d.getValueFromProps=Ml,d.getXyzFromPostion=xo,d.growthSimulationCallFunc=Ec,d.hasSameTags=Vh,d.hasSameViewerTags=yn,d.imageToCanvas=Zl,d.inOrderRunning=Sp,d.interval=Vr,d.isFeatureEqual=Wh,d.isGeometryEqual=Hh,d.isJSON=Eo,d.isPromiseCancelable=ls,d.isRelativeRtsInfoUrl=Ic,d.isXML=Ep,d.lbhToWebMerc=Mp,d.lbhToXyz=rt,d.length=Hr,d.lerpAngle=Zn,d.lerpRotation=bo,d.loadGifFrames=xh,d.loadJs=Jr,d.map=sc,d.max=Lt,d.min=Zt,d.moveToTreeItem=qn,d.moveToTreeItems=dh,d.nextAnimateFrame=rs,d.nextMicroTask=nn,d.objsIterator=_i,d.oneTimeWarning=is,d.optionsStr=Eg,d.pairToPromise=eo,d.parsePlatformFromUrl=Oc,d.parseRtsHost=xc,d.parseRtsOrigin=Er,d.parseTileServiceName=Dc,d.pluckProperty=$r,d.react=w,d.reactArray=F,d.reactArrayCollection=Nd,d.reactArrayCollectionWithUndefined=Rr,d.reactArrayWithUndefined=q,d.reactDeepArray=jn,d.reactDeepArrayWithUndefined=Yt,d.reactJson=B,d.reactJsonCollection=Ld,d.reactJsonCollectionWithUndefined=Vd,d.reactJsonWithUndefined=te,d.reactPlainObject=jd,d.reactPlainObjectWithUndefined=Rd,d.reactPosition2Ds=ir,d.reactPosition2DsSet=zd,d.reactPositions=Nt,d.reactPositionsSet=Nr,d.reduce=ln,d.registerEventCtor=xl,d.registerEventUpdate=qp,d.removeAllTreesCallFunc=_c,d.requestAnimationFrameTimeStampTest=Zd,d.resolveRtsInfoUrl=wr,d.rpToap=wp,d.saveOnBrowser=Yd,d.setCanvasUniformColor=Ql,d.setExtProp=vt,d.setPromiseCancel=Qt,d.setSceneObjectTreeItem=Kn,d.setValueFromProps=Xd,d.sleep=un,d.sleepDeprecated=lu,d.step=yi,d.stepProcessing=Mu,d.throttle=Gr,d.timeout=zr,d.toGeoJson=Bh,d.track=_,d.uint32ToUint8s=ih,d.uint8ToHexStr=gn,d.uint8sToUint32=sh,d.updateTreeParamsCallFunc=yc,d.webMercToLbh=Ap,d.xyz2N2=iu,d.xyz2N3=su,d.xyzToLbh=Co,d.xyzw2N4=nu,Object.defineProperty(d,Symbol.toStringTag,{value:"Module"})}));
|