mapv-cloudrenderengine 2.9.1 → 2.9.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.
@@ -1 +1 @@
1
- import{Vector2 as e,Vector3 as t,Quaternion as i,Matrix4 as n,MathUtils as a,Euler as r,Matrix3 as o,Layers as s,FileLoader as l,Color as u,Group as c,MeshBasicMaterial as d,PlaneBufferGeometry as h,Mesh as f,SpriteMaterial as p,Sprite as m}from"three";import g from"earcut";import*as v from"@tweenjs/tween.js";import y from"axios";import b from"@mars3d/heatmap.js";function x(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=Array(t);i<t;i++)n[i]=e[i];return n}function S(e,t,i,n,a,r,o){try{var s=e[r](o),l=s.value}catch(e){return void i(e)}s.done?t(l):Promise.resolve(l).then(n,a)}function w(e){return function(){var t=this,i=arguments;return new Promise((function(n,a){var r=e.apply(t,i);function o(e){S(r,n,a,o,s,"next",e)}function s(e){S(r,n,a,o,s,"throw",e)}o(void 0)}))}}function N(e,t,i){return t=E(t),L(e,I()?Reflect.construct(t,i||[],E(e).constructor):t.apply(e,i))}function U(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function k(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,H(n.key),n)}}function C(e,t,i){return t&&k(e.prototype,t),i&&k(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e}function T(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!i){if(Array.isArray(e)||(i=V(e))||t){i&&(e=i);var n=0,a=function(){};return{s:a,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,o=!0,s=!1;return{s:function(){i=i.call(e)},n:function(){var e=i.next();return o=e.done,e},e:function(e){s=!0,r=e},f:function(){try{o||null==i.return||i.return()}finally{if(s)throw r}}}}function R(e,t,i){return(t=H(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function O(){return O="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,i){var n=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=E(e)););return e}(e,t);if(n){var a=Object.getOwnPropertyDescriptor(n,t);return a.get?a.get.call(arguments.length<3?e:i):a.value}},O.apply(null,arguments)}function E(e){return E=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},E(e)}function z(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&P(e,t)}function I(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(I=function(){return!!e})()}function A(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function _(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?A(Object(i),!0).forEach((function(t){R(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):A(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function M(e,t){if(null==e)return{};var i,n,a=function(e,t){if(null==e)return{};var i={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;i[n]=e[n]}return i}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(n=0;n<r.length;n++)i=r[n],t.includes(i)||{}.propertyIsEnumerable.call(e,i)&&(a[i]=e[i])}return a}function L(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function D(){D=function(){return t};var e,t={},i=Object.prototype,n=i.hasOwnProperty,a=Object.defineProperty||function(e,t,i){e[t]=i.value},r="function"==typeof Symbol?Symbol:{},o=r.iterator||"@@iterator",s=r.asyncIterator||"@@asyncIterator",l=r.toStringTag||"@@toStringTag";function u(e,t,i){return Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(e){u=function(e,t,i){return e[t]=i}}function c(e,t,i,n){var r=t&&t.prototype instanceof v?t:v,o=Object.create(r.prototype),s=new E(n||[]);return a(o,"_invoke",{value:C(e,i,s)}),o}function d(e,t,i){try{return{type:"normal",arg:e.call(t,i)}}catch(e){return{type:"throw",arg:e}}}t.wrap=c;var h="suspendedStart",f="suspendedYield",p="executing",m="completed",g={};function v(){}function y(){}function b(){}var x={};u(x,o,(function(){return this}));var S=Object.getPrototypeOf,w=S&&S(S(z([])));w&&w!==i&&n.call(w,o)&&(x=w);var N=b.prototype=v.prototype=Object.create(x);function U(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function k(e,t){function i(a,r,o,s){var l=d(e[a],e,r);if("throw"!==l.type){var u=l.arg,c=u.value;return c&&"object"==typeof c&&n.call(c,"__await")?t.resolve(c.__await).then((function(e){i("next",e,o,s)}),(function(e){i("throw",e,o,s)})):t.resolve(c).then((function(e){u.value=e,o(u)}),(function(e){return i("throw",e,o,s)}))}s(l.arg)}var r;a(this,"_invoke",{value:function(e,n){function a(){return new t((function(t,a){i(e,n,t,a)}))}return r=r?r.then(a,a):a()}})}function C(t,i,n){var a=h;return function(r,o){if(a===p)throw Error("Generator is already running");if(a===m){if("throw"===r)throw o;return{value:e,done:!0}}for(n.method=r,n.arg=o;;){var s=n.delegate;if(s){var l=T(s,n);if(l){if(l===g)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(a===h)throw a=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);a=p;var u=d(t,i,n);if("normal"===u.type){if(a=n.done?m:f,u.arg===g)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(a=m,n.method="throw",n.arg=u.arg)}}}function T(t,i){var n=i.method,a=t.iterator[n];if(a===e)return i.delegate=null,"throw"===n&&t.iterator.return&&(i.method="return",i.arg=e,T(t,i),"throw"===i.method)||"return"!==n&&(i.method="throw",i.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var r=d(a,t.iterator,i.arg);if("throw"===r.type)return i.method="throw",i.arg=r.arg,i.delegate=null,g;var o=r.arg;return o?o.done?(i[t.resultName]=o.value,i.next=t.nextLoc,"return"!==i.method&&(i.method="next",i.arg=e),i.delegate=null,g):o:(i.method="throw",i.arg=new TypeError("iterator result is not an object"),i.delegate=null,g)}function R(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function E(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(R,this),this.reset(!0)}function z(t){if(t||""===t){var i=t[o];if(i)return i.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var a=-1,r=function i(){for(;++a<t.length;)if(n.call(t,a))return i.value=t[a],i.done=!1,i;return i.value=e,i.done=!0,i};return r.next=r}}throw new TypeError(typeof t+" is not iterable")}return y.prototype=b,a(N,"constructor",{value:b,configurable:!0}),a(b,"constructor",{value:y,configurable:!0}),y.displayName=u(b,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===y||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,u(e,l,"GeneratorFunction")),e.prototype=Object.create(N),e},t.awrap=function(e){return{__await:e}},U(k.prototype),u(k.prototype,s,(function(){return this})),t.AsyncIterator=k,t.async=function(e,i,n,a,r){void 0===r&&(r=Promise);var o=new k(c(e,i,n,a),r);return t.isGeneratorFunction(i)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},U(N),u(N,l,"Generator"),u(N,o,(function(){return this})),u(N,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),i=[];for(var n in t)i.push(n);return i.reverse(),function e(){for(;i.length;){var n=i.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=z,E.prototype={constructor:E,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(O),!t)for(var i in this)"t"===i.charAt(0)&&n.call(this,i)&&!isNaN(+i.slice(1))&&(this[i]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var i=this;function a(n,a){return s.type="throw",s.arg=t,i.next=n,a&&(i.method="next",i.arg=e),!!a}for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r],s=o.completion;if("root"===o.tryLoc)return a("end");if(o.tryLoc<=this.prev){var l=n.call(o,"catchLoc"),u=n.call(o,"finallyLoc");if(l&&u){if(this.prev<o.catchLoc)return a(o.catchLoc,!0);if(this.prev<o.finallyLoc)return a(o.finallyLoc)}else if(l){if(this.prev<o.catchLoc)return a(o.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return a(o.finallyLoc)}}}},abrupt:function(e,t){for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i];if(a.tryLoc<=this.prev&&n.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var r=a;break}}r&&("break"===e||"continue"===e)&&r.tryLoc<=t&&t<=r.finallyLoc&&(r=null);var o=r?r.completion:{};return o.type=e,o.arg=t,r?(this.method="next",this.next=r.finallyLoc,g):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),g},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var i=this.tryEntries[t];if(i.finallyLoc===e)return this.complete(i.completion,i.afterLoc),O(i),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var i=this.tryEntries[t];if(i.tryLoc===e){var n=i.completion;if("throw"===n.type){var a=n.arg;O(i)}return a}}throw Error("illegal catch attempt")},delegateYield:function(t,i,n){return this.delegate={iterator:z(t),resultName:i,nextLoc:n},"next"===this.method&&(this.arg=e),g}},t}function P(e,t){return P=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},P(e,t)}function B(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var n,a,r,o,s=[],l=!0,u=!1;try{if(r=(i=i.call(e)).next,0===t){if(Object(i)!==i)return;l=!1}else for(;!(l=(n=r.call(i)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(e){u=!0,a=e}finally{try{if(!l&&null!=i.return&&(o=i.return(),Object(o)!==o))return}finally{if(u)throw a}}return s}}(e,t)||V(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function F(e,t,i,n){var a=O(E(e.prototype),t,i);return"function"==typeof a?function(e){return a.apply(i,e)}:a}function W(e){return function(e){if(Array.isArray(e))return x(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||V(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function H(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}function G(e){return G="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},G(e)}function V(e,t){if(e){if("string"==typeof e)return x(e,t);var i={}.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?x(e,t):void 0}}var J={CLEAR_SKIES:"clearSkies",PARTLY_CLOUDY:"partlyCloudy",CLOUDY:"cloudy",FOGGY:"foggy",OVERCAST:"overcast",RAIN:"rain",LIGHT_RAIN:"lightRain",THUNDER_STORM:"thunderstorm",SNOW:"snow",LIGHT_SNOW:"lightSnow",BLIZZARD:"blizzard",SAND_DUST_CALM:"sandDustCalm",SAND_DUST_STORM:"sandDustStorm"},q={VOLUMETRIC_CLOUDS:"Volumetric Clouds",STATIC_CLOUDS:"Static Clouds",DYNAMIC_CLOUDS:"2D Dynamic Clouds",NO_CLOUDS:"No Clouds",VOLUMETRIC_AURORA:"Volumetric Aurora"},Y={SKY_ATMOSPHERE:"Sky Atmosphere",SIMPLIFIED_COLOR:"Simplified Color"},K={SET_MOUSE_CURSOR_SHOW:"setMouseCursorShow",SET_CLICK_EVENT:"setClickEvent",SET_EDIT_STATUS:"setEditStatus",SWITCH_EDIT_MODE:"switchEditMode",SAVE_EDIT_RESULT:"saveEditResult",ZOOM_IN:"zoomIn",ZOOM_OUT:"zoomOut",EXIT:"exitClient",ENABLE_TERRAIN:"enableTerrain",ENABLE_POI:"enablePOIByTag",PRELOAD_LOCATION:"preLoadLocation",FOCUS_ACTOR_BY_ID:"focusActorByID",ENABLE_DATALAYER:"Scene_enableDataLayerByName",ENABLE_FPS:"Scene_setFPS",OBJECT_BOUNDINGBOX:"Interact_objectBoundingBox",ASSET_MODEL:"Gis_generateAssetModel",BUILD_GROWTHANIMATE:"Interact_buildGrowth",ENABLE_L2_BUILDING_SELECT:"Interact_enableBuildingL2Select"},X={NAVIGATION:"Camera_navigation",NAVIGATION_PAUSE:"Camera_navigationPause",NAVIGATION_STOP:"Camera_navigationStop",ORBIT_AROUND:"Camera_orbitAround",MOVE_TO:"Camera_moveTo",ZOOM_IN:"Camera_zoomIn",ZOOM_OUT:"Camera_zoomOut",PROJECT:"Camera_project",UNPROJECT:"Camera_unproject",UPDATE:"Camera_update",FOCUS_ON:"Camera_focusOn",Constrain_Shape:"Camera_constrainShape",MOVE:"Camera_move",ROTATE:"Camera_rotate",RESET_CAMERA_FOCUS:"Camera_resetCameraFocus"},Q={ENABLE_3DTILES_BY_NAME:"Scene_enableTilesByName",SWITCH_TERRAIN_MODE:"Scene_switchTerrainMode",HIDDEN_3DTILES_ITEM:"Scene_hiddenTilesItem",EVENT_LAYER_BUILDING:"Scene_eventLayerBuilding",UPDATA_SLOPE_ANALYSIS:"Scene_updateSlopeAnalysis",GET_ALTITUDE:"Scene_getAltitude",SET_PLANE_POI_MODE:"Scene_setPlanePoiMode"},Z={EXIT_CLIENT:"Application_exitClient",RESTART_LEVEL:"Application_restartLevel",OPEN_LEVEL:"Application_openLevel",RESTART_GAME:"Application_restartGame",CREATE_TRAFFIC_STREAM:"Application_createTrafficStream",CLOSE_TRAFFIC_STREAM:"Application_closeTrafficStream",FOLLOW_TRAFFIC_STREAM_ITEM:"Application_followTrafficStreamItem",ADD_EVENT_LISTENER:"Application_addEvent",REMOVE_EVENT_LISTENER:"Application_removeEvent",RESET_WORLD_CENTER:"Application_resetWorldCenter",CONSOLE_COMMAND:"Application_ConsoleCommand"},ee={ADD:"Gis_AddCommonGISLayer",REMOVE:"Gis_RemoveCommonGISLayer",DESTORY:"Gis_DestoryCommonGISLayer",DESTORY_ALL:"Gis_DestoryAllGenerationLayer",UPDATE:"Gis_UpdateCommonGISLayer",VISIBLE:"Gis_VisibleCommonGISLayer"},te={ENABLE_DRAW:"Gis_enableDraw",CLOSE_DRAW:"Gis_closeDraw",ENABLE_MEASURE:"Gis_enableMeasure",CLOSE_MEASURE:"Gis_closeMeasure",DESTORY_DRAW:"Gis_clearDraw",DESTORY_MEASURE:"Gis_clearMeasure"},ie={SOLID:"solid",DASHED:"dashed",ARROW:"arrow",GRADIENT:"gradient"},ne=R({CENTER:"Ground_Center",STAND:"Stand",SIDE:"Ground_Side"},"SIDE","Cylinder"),ae={LINEAR:"Linear",CURVE:"Curve",CONSTANT:"Constant"},re={QualityControlOwnership:0,Response:1,Command:2,FreezeFrame:3,UnfreezeFrame:4,VideoEncoderAvgQP:5,LatencyTest:6,InitialSettings:7,FileExtension:8,FileMimeType:9,FileContents:10,Mouse:21,Keyboard:22,InputControlOwnership:12,Protocol:255,AckV2:102,TextureMissingNack:103},oe={LockedMouse:0,HoveringMouse:1},se={controlScheme:oe.HoveringMouse,suppressBrowserKeys:!1,fakeMouseWithTouches:!1},le={IFrameRequest:0,RequestQualityControl:1,FpsRequest:2,AverageBitrateRequest:3,StartStreaming:4,StopStreaming:5,LatencyTest:6,RequestInitialSettings:7,UIInteraction:50,Command:51,KeyDown:60,KeyUp:61,KeyPress:62,MouseEnter:70,MouseLeave:71,MouseDown:72,MouseUp:73,MouseMove:74,MouseWheel:75,TouchStart:80,TouchEnd:81,TouchMove:82,GamepadButtonPressed:90,GamepadButtonReleased:91,GamepadAnalog:92,UIInteractionV2:100,BinaryAsset:101,AckV2:102,TextureMissingNack:103},ce={MainButton:0,AuxiliaryButton:1,SecondaryButton:2,FourthButton:3,FifthButton:4},de={PrimaryButton:1,SecondaryButton:2,AuxiliaryButton:4,FourthButton:8,FifthButton:16},he={BackSpace:8,Shift:16,Control:17,Alt:18,RightShift:253,RightControl:254,RightAlt:255},fe={FIRE_BIG:"P_Fire_Big",FIRE_SMALL:"P_Fire_Small",FIRE_FLAMETHROWER:"P_Flamethrower",SMOKE_SMALL_BLACK:"P_Smoke_A",SMOKE_BIG_BLACK:"P_Smoke_B",SMOKE_SMALL_YELLOW:"P_Smoke_C",SMOKE_BIG_YELLOW:"P_Smoke_D",SPARK_A:"P_Sparks_E",FOG_MASS:"P_Mass_Fog",NS_Spark:"NS_Spark",NS_Firefly:"NS_Firefly"},pe=Object.freeze({__proto__:null,ApplicationControl:Z,CameraControl:X,ControlSchemeType:oe,DrawAndMeasureControl:te,GisControl:ee,InteractMOD:K,LineDirectionOptions:ne,LineSplineTypeOptions:ae,LineTypeOptions:ie,MessageType:le,MouseButton:ce,MouseButtonsMask:de,ParticleKind:fe,SceneControl:Q,SkyColorMode:Y,SkyMode:q,SpecialKeyCodes:he,ToClientMessageType:re,UDS:J,WS_OPEN_STATE:1,inputOptions:se}),me=function(){return C((function e(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};U(this,e),this.cloudRender=t,this.weather=i.weather||J.PARTLY_CLOUDY,this.hour=i.hour||14,this.minute=i.minute||30,this.weatherType=J,this.init()}),[{key:"changeWeather",value:function(e){e&&(Object.values(J).indexOf(e)<0||(this.weather=e,this.cloudRender.emitUIInteraction({excuteName:"Scene_changeWeather",params:{WeatherType:e}})))}},{key:"changeTime",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;this.hour=e,this.minute=Math.floor(10*t/6);var i=(this.hour<10?"0"+this.hour:""+this.hour)+(this.minute<10?"0"+this.minute:""+this.minute);this.cloudRender.emitUIInteraction({excuteName:"Scene_changeTime",params:{Time:i}})}},{key:"setVolumeFog",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3,i=Math.max(Math.min(1e5,t),10);this.cloudRender.emitUIInteraction({excuteName:"Scene_setVolumenFog",params:{Enable:e,Distance:100*i}})}},{key:"setAtmosphericFog",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.0075,t=Math.max(Math.min(1,e),0);this.cloudRender.emitUIInteraction({excuteName:"Scene_setBaseFog",params:{BaseFogDensity:t}})}},{key:"setSkyMode",value:function(e){return!!e&&(!(Object.values(q).indexOf(e)<0)&&void this.cloudRender.emitUIInteraction({excuteName:"Scene_setSkyMode",params:{SkyMode:e}}))}},{key:"setSkyColorMode",value:function(e){return!!e&&(!(Object.values(Y).indexOf(e)<0)&&void this.cloudRender.emitUIInteraction({excuteName:"Scene_setSkyColorMode",params:{SkyColorMode:e}}))}},{key:"changeWeatherEffectParameters",value:function(e){this.cloudRender.emitUIInteraction({excuteName:"Scene_changeWeatherEffects",params:JSON.stringify(e)})}},{key:"init",value:function(){this.changeWeather(this.weather),this.changeTime(this.hour,this.minute)}}])}(),ge=["BMap","Sentinel2","NaturalEarth"],ve=function(){return C((function e(t){U(this,e),this.cloudRender=t,this.earthCloud={VisMode:"Auto"},this.earthRoadNetwork={VisMode:"Auto",Opacity:.2,Color:"rgb(255, 255, 255)",Brightness:6},this.earthTiles={TilesType:"BMap"}}),[{key:"_changeEnvironment",value:function(e,t,i){t?(this[i]=_(_({},this[i]),t),this.cloudRender&&this.cloudRender.emitUIInteraction({excuteName:"Scene_SeqEnvironment",params:{environment:e,properties:_({},this[i])}})):console.warn("".concat(e," params is required"))}},{key:"changeEarthCloud",value:function(e){this._changeEnvironment("EarthCloud",e,"earthCloud")}},{key:"changeEarthRoadNetwork",value:function(e){this._changeEnvironment("EarthRoadNetwork",e,"earthRoadNetwork")}},{key:"changeEarthTiles",value:function(e){e&&e.TilesType&&!ge.includes(e.TilesType)?console.warn("TilesType ".concat(e.TilesType," is not supported")):this._changeEnvironment("EarthTiles",e,"earthTiles")}}])}(),ye=function(e){e=void 0!==e?e:{},this.forceTURN=e.forceTURN;var t=this,i=new URLSearchParams(window.location.search);this.cfg=void 0!==e.peerConnectionOptions?e.peerConnectionOptions:{},this.cfg.sdpSemantics="unified-plan",this.cfg.offerExtmapAllowMixed=!1,i.has("ForceTURN")&&(this.forceTURN=i.has("ForceTURN")),this.forceTURN&&(console.log("Forcing TURN usage by setting ICE Transport Policy in peer connection config."),this.cfg.iceTransportPolicy="relay"),this.cfg.bundlePolicy="balanced",this.forceMaxBundle=i.has("ForceMaxBundle"),this.forceMaxBundle&&(this.cfg.bundlePolicy="max-bundle"),this.pcClient=null,this.dcClient=null,this.dcBulk=null,this.dcTexture=null,this.tnClient=null,this.enableBulkChannel=!0===e.enableBulkChannel,this.enableTextureChannel=!0===e.enableTextureChannel,this.sdpConstraints={offerToReceiveAudio:1,offerToReceiveVideo:1,voiceActivityDetection:!1},this.dataChannelOptions={ordered:!0,maxPacketLifeTime:3e3},this.bulkDataChannelOptions={ordered:!0},this.textureDataChannelOptions={ordered:!0},this.startVideoMuted=void 0!==e.startVideoMuted&&e.startVideoMuted,this.autoPlayAudio=void 0===e.autoPlayAudio||e.autoPlayAudio,this.useMic=i.has("useMic"),this.useMic||console.log("Microphone access is not enabled. Pass ?useMic in the url to enable it.");var n="localhost"===location.hostname||"127.0.0.1"===location.hostname,a="https:"===location.protocol;!this.useMic||n||a||(this.useMic=!1,console.error("Microphone access in the browser will not work if you are not on HTTPS or localhost. Disabling mic access."),console.error("For testing you can enable HTTP microphone access Chrome by visiting chrome://flags/ and enabling 'unsafely-treat-insecure-origin-as-secure'")),this.preferSFU=i.has("preferSFU"),console.log(this.preferSFU?"The browser will signal it would prefer an SFU connection. Remove ?preferSFU from the url to signal for P2P usage.":"The browser will signal for a P2P connection. Pass ?preferSFU in the url to signal for SFU usage."),this.latencyTestTimings={TestStartTimeMs:null,UEReceiptTimeMs:null,UEEncodeMs:null,UECaptureToSendMs:null,UETransmissionTimeMs:null,BrowserReceiptTimeMs:null,FrameDisplayDeltaTimeMs:null,Reset:function(){this.TestStartTimeMs=null,this.UEReceiptTimeMs=null,this.UEEncodeMs=null,this.UECaptureToSendMs=null,this.UETransmissionTimeMs=null,this.BrowserReceiptTimeMs=null,this.FrameDisplayDeltaTimeMs=null},SetUETimings:function(e){this.UEReceiptTimeMs=e.ReceiptTimeMs,this.UEEncodeMs=e.EncodeMs,this.UECaptureToSendMs=e.CaptureToSendMs,this.UETransmissionTimeMs=e.TransmissionTimeMs,this.BrowserReceiptTimeMs=Date.now(),this.OnAllLatencyTimingsReady(this)},SetFrameDisplayDeltaTime:function(e){null==this.FrameDisplayDeltaTimeMs&&(this.FrameDisplayDeltaTimeMs=Math.round(e),this.OnAllLatencyTimingsReady(this))},OnAllLatencyTimingsReady:function(e){}},this.createWebRtcVideo=function(){var e=document.createElement("video");if(e.id="streamingVideo",e.playsInline=!0,e.disablepictureinpicture=!0,e.muted=t.startVideoMuted,e.addEventListener("loadedmetadata",(function(e){t.onVideoInitialised&&t.onVideoInitialised()}),!0),"requestVideoFrameCallback"in HTMLVideoElement.prototype){var i=function(n,a){if(a.receiveTime&&a.expectedDisplayTime){var r=a.presentationTime-a.receiveTime;t.aggregatedStats||(t.aggregatedStats={}),t.aggregatedStats.receiveToCompositeMs=r}e.requestVideoFrameCallback(i)};e.requestVideoFrameCallback(i)}return e},this.video=this.createWebRtcVideo(),this.availableVideoStreams=new Map;var r=function(e){console.info("Signaling state change. |",e.srcElement.signalingState,"|")},o=function(e){console.info("Browser ICE connection |",e.srcElement.iceConnectionState,"|")},s=function(e){console.info("Browser ICE gathering |",e.srcElement.iceGatheringState,"|")},l=function(e){if(e.track&&console.log("Got track. | Kind="+e.track.kind+" | Id="+e.track.id+" | readyState="+e.track.readyState+" |"),"audio"!=e.track.kind){e.track.kind;var i,n=T(e.streams);try{for(n.s();!(i=n.n()).done;){var a=i.value;t.availableVideoStreams.has(a.id)||t.availableVideoStreams.set(a.id,a)}}catch(e){n.e(e)}finally{n.f()}t.video.srcObject=e.streams[0],e.track.onunmute=function(){t.video.srcObject=e.streams[0],t.onNewVideoTrack(e.streams)}}else u(e.streams[0])},u=function(e){if(t.video.srcObject!=e&&t.video.srcObject&&t.video.srcObject!==e){var i=document.createElement("Audio");if(i.srcObject=e,t.autoPlayAudio)i.play();else{var n=function(){i.play(),t.video.removeEventListener("click",n)};t.video.addEventListener("click",n)}console.log("Created new audio element to play seperate audio stream.")}},c=function(e){var i=e.channel;console.log("Data channel created for us by browser (label=".concat(i&&i.label,")")),!i||"cre-bulk"!==i.label&&"cre-texture"!==i.label?(t.dcClient=i,d(i,!1)):console.warn("[webRtcPlayer] extra DataChannel '".concat(i.label,"' ignored (PS1 single-channel constraint)"))},d=function(e,i){try{return e.binaryType="arraybuffer",e.onopen=function(n){console.log("Data channel connected (label=".concat(e.label,")")),i?t.onBulkChannelConnected&&t.onBulkChannelConnected():t.onDataChannelConnected&&t.onDataChannelConnected()},e.onclose=function(t){console.log("Data channel closed (label=".concat(e.label,")"),t)},e.onmessage=function(e){var n=e.data;"string"==typeof n&&(n=function(e){var t,i,n=new Array;t=e.length;for(var a=0;a<t;a++)(i=e.charCodeAt(a))>=65536&&i<=1114111?(n.push(i>>18&7|240),n.push(i>>12&63|128),n.push(i>>6&63|128),n.push(63&i|128)):i>=2048&&i<=65535?(n.push(i>>12&15|224),n.push(i>>6&63|128),n.push(63&i|128)):i>=128&&i<=2047?(n.push(i>>6&31|192),n.push(63&i|128)):n.push(255&i);return new Uint8Array(n).buffer}(n)),i&&t.onBulkChannelMessage?t.onBulkChannelMessage(n):t.onDataChannelMessage&&t.onDataChannelMessage(n)},e.onerror=function(t){console.error("Data channel error (label=".concat(e.label,")"),t)},e}catch(e){return console.warn("No data channel",e),null}},h=function(e){var i=e.candidate;i&&i.candidate&&(console.log("%c[Browser ICE candidate]","background: violet; color: black","| Type=",i.type,"| Protocol=",i.protocol,"| Address=",i.address,"| Port=",i.port,"|"),t.onWebRtcCandidate(i))},f=function(e){e.sdp=e.sdp.replace("useinbandfec=1","useinbandfec=1;stereo=1;sprop-maxcapturerate=48000")},p=function(e){e.onsignalingstatechange=r,e.oniceconnectionstatechange=o,e.onicegatheringstatechange=s,e.ontrack=l,e.onicecandidate=h,e.ondatachannel=c},m=function(){var e=w(D().mark((function e(i){var n,a,r,o,s,l,u,c,d,h,f,p;return D().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=i.getTransceivers().length>0,i.addTransceiver("video",{direction:"recvonly"}),t.useMic){e.next=6;break}i.addTransceiver("audio",{direction:"recvonly"}),e.next=11;break;case 6:return a=!!t.useMic&&{autoGainControl:!1,channelCount:1,echoCancellation:!1,latency:0,noiseSuppression:!1,sampleRate:48e3,volume:1},e.next=9,navigator.mediaDevices.getUserMedia({video:!1,audio:a});case 9:if(r=e.sent)if(n){o=T(i.getTransceivers());try{for(o.s();!(s=o.n()).done;)if((l=s.value)&&l.receiver&&l.receiver.track&&"audio"===l.receiver.track.kind){u=T(r.getTracks());try{for(u.s();!(c=u.n()).done;)(d=c.value).kind&&"audio"==d.kind&&(l.sender.replaceTrack(d),l.direction="sendrecv")}catch(e){u.e(e)}finally{u.f()}}}catch(e){o.e(e)}finally{o.f()}}else{h=T(r.getTracks());try{for(h.s();!(f=h.n()).done;)(p=f.value).kind&&"audio"==p.kind&&i.addTransceiver(p,{direction:"sendrecv"})}catch(e){h.e(e)}finally{h.f()}}else i.addTransceiver("audio",{direction:"recvonly"});case 11:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();this.setVideoEnabled=function(e){t.video.srcObject.getTracks().forEach((function(t){return t.enabled=e}))},this.startLatencyTest=function(e){t.video&&(t.latencyTestTimings.Reset(),t.latencyTestTimings.TestStartTimeMs=Date.now(),e(t.latencyTestTimings.TestStartTimeMs))},this.handleCandidateFromServer=function(e){var i=new RTCIceCandidate(e);console.log("%c[Unreal ICE candidate]","background: pink; color: black","| Type=",i.type,"| Protocol=",i.protocol,"| Address=",i.address,"| Port=",i.port,"|"),t.forceTURN&&i.candidate.indexOf("relay")<0?console.warn("Dropping candidate because it was not TURN relay.","| Type=",i.type,"| Protocol=",i.protocol,"| Address=",i.address,"| Port=",i.port,"|"):t.pcClient.addIceCandidate(i).catch((function(e){console.error("Failed to add ICE candidate",e)}))},this.createOffer=function(){t.pcClient&&(console.log("Closing existing PeerConnection"),t.pcClient.close(),t.pcClient=null),t.pcClient=new RTCPeerConnection(t.cfg),p(t.pcClient),m(t.pcClient).finally((function(){var e;t.dcClient=function(e,t,i){var n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],a=e.createDataChannel(t,i);return console.log("Created datachannel (".concat(t,")")),d(a,n),a}(t.pcClient,"cirrus",t.dataChannelOptions,!1),(t.enableBulkChannel||t.enableTextureChannel)&&console.info("[webRtcPlayer] cre-bulk/cre-texture physical channels disabled (PS1 single-channel); JS-side priority queues still active"),(e=t.pcClient).createOffer(t.sdpConstraints).then((function(i){f(i),e.setLocalDescription(i),t.onWebRtcOffer&&t.onWebRtcOffer(i)}),(function(){console.warn("Couldn't create offer")}))}))},this.receiveOffer=function(e){var i=new RTCSessionDescription(e);t.pcClient||(console.log("Creating a new PeerConnection in the browser.",t.cfg),t.pcClient=new RTCPeerConnection(t.cfg),p(t.pcClient),t.pcClient.setRemoteDescription(i).then((function(){m(t.pcClient).finally((function(){t.pcClient.createAnswer().then((function(e){return t.pcClient.setLocalDescription(e)})).then((function(){t.onWebRtcAnswer&&t.onWebRtcAnswer(t.pcClient.currentLocalDescription)})).then((function(){var e,i=T(t.pcClient.getReceivers());try{for(i.s();!(e=i.n()).done;)e.value.playoutDelayHint=0}catch(e){i.e(e)}finally{i.f()}})).catch((function(e){return console.error("createAnswer() failed:",e)}))}))})))},this.receiveAnswer=function(e){var i=new RTCSessionDescription(e);t.pcClient.setRemoteDescription(i);var n,a=T(t.pcClient.getReceivers());try{for(a.s();!(n=a.n()).done;)n.value.playoutDelayHint=0}catch(e){a.e(e)}finally{a.f()}},this.close=function(){t.pcClient&&(console.log("Closing existing peerClient"),t.pcClient.close(),t.pcClient=null),t.dcClient=null,t.dcBulk=null,t.dcTexture=null,t.aggregateStatsIntervalId&&clearInterval(t.aggregateStatsIntervalId)},this.send=function(e){if(t.dcClient&&"open"==t.dcClient.readyState)try{t.dcClient.send(e)}catch(e){console.error("dcClient.send error: ",e)}},this.sendBulk=function(e){var i=t.dcBulk&&"open"===t.dcBulk.readyState?t.dcBulk:t.dcClient;if(i&&"open"===i.readyState)try{i.send(e)}catch(e){console.error("bulk send error: ",e)}},this.getBulkChannel=function(){return t.dcBulk&&"open"===t.dcBulk.readyState?t.dcBulk:t.dcClient},this.getStats=function(e){t.pcClient&&e&&t.pcClient.getStats(null).then((function(t){e(t)}))},this.aggregateStats=function(e){var i=(t.aggregatedStats||(t.aggregatedStats={}),function(e){var i={};e.forEach((function(e){if("inbound-rtp"==e.type&&!e.isRemote&&("video"==e.mediaType||e.id.toLowerCase().includes("video"))&&(i.timestamp=e.timestamp,i.bytesReceived=e.bytesReceived,i.framesDecoded=e.framesDecoded,i.packetsLost=e.packetsLost,i.framesReceivedRtp=e.framesReceived,i.totalDecodeTime=e.totalDecodeTime,i.jitterBufferDelay=e.jitterBufferDelay,i.jitterBufferEmittedCount=e.jitterBufferEmittedCount,i.processingDelay=e.processingDelay,i.framesAssembledFromMultiplePackets=e.framesAssembledFromMultiplePackets,i.bytesReceivedStart=t.aggregatedStats&&t.aggregatedStats.bytesReceivedStart?t.aggregatedStats.bytesReceivedStart:e.bytesReceived,i.framesDecodedStart=t.aggregatedStats&&t.aggregatedStats.framesDecodedStart?t.aggregatedStats.framesDecodedStart:e.framesDecoded,i.timestampStart=t.aggregatedStats&&t.aggregatedStats.timestampStart?t.aggregatedStats.timestampStart:e.timestamp,t.aggregatedStats&&t.aggregatedStats.timestamp)){t.aggregatedStats.bytesReceived&&(i.bitrate=8*(i.bytesReceived-t.aggregatedStats.bytesReceived)/(i.timestamp-t.aggregatedStats.timestamp),i.bitrate=Math.floor(i.bitrate),i.lowBitrate=t.aggregatedStats.lowBitrate&&t.aggregatedStats.lowBitrate<i.bitrate?t.aggregatedStats.lowBitrate:i.bitrate,i.highBitrate=t.aggregatedStats.highBitrate&&t.aggregatedStats.highBitrate>i.bitrate?t.aggregatedStats.highBitrate:i.bitrate),t.aggregatedStats.bytesReceivedStart&&(i.avgBitrate=8*(i.bytesReceived-t.aggregatedStats.bytesReceivedStart)/(i.timestamp-t.aggregatedStats.timestampStart),i.avgBitrate=Math.floor(i.avgBitrate)),t.aggregatedStats.framesDecoded&&(i.framerate=(i.framesDecoded-t.aggregatedStats.framesDecoded)/((i.timestamp-t.aggregatedStats.timestamp)/1e3),i.framerate=Math.floor(i.framerate),i.lowFramerate=t.aggregatedStats.lowFramerate&&t.aggregatedStats.lowFramerate<i.framerate?t.aggregatedStats.lowFramerate:i.framerate,i.highFramerate=t.aggregatedStats.highFramerate&&t.aggregatedStats.highFramerate>i.framerate?t.aggregatedStats.highFramerate:i.framerate),t.aggregatedStats.framesDecodedStart&&(i.avgframerate=(i.framesDecoded-t.aggregatedStats.framesDecodedStart)/((i.timestamp-t.aggregatedStats.timestampStart)/1e3),i.avgframerate=Math.floor(i.avgframerate));var n=i.timestamp-t.aggregatedStats.timestamp;if(void 0!==i.framesReceivedRtp&&void 0!==t.aggregatedStats.framesReceivedRtp&&n>0){var a=i.framesReceivedRtp-t.aggregatedStats.framesReceivedRtp;a>0&&(i.frameInterArrivalMs=n/a)}if(void 0!==i.totalDecodeTime&&void 0!==t.aggregatedStats.totalDecodeTime){var r=i.framesDecoded-t.aggregatedStats.framesDecoded;r>0&&(i.decodeDurationMs=1e3*(i.totalDecodeTime-t.aggregatedStats.totalDecodeTime)/r)}if(void 0!==i.jitterBufferDelay&&void 0!==t.aggregatedStats.jitterBufferDelay){var o=(i.jitterBufferEmittedCount||0)-(t.aggregatedStats.jitterBufferEmittedCount||0);o>0&&(i.jitterBufferDelayMs=1e3*(i.jitterBufferDelay-t.aggregatedStats.jitterBufferDelay)/o)}if(void 0!==i.processingDelay&&void 0!==t.aggregatedStats.processingDelay){var s=void 0!==i.framesAssembledFromMultiplePackets&&void 0!==t.aggregatedStats.framesAssembledFromMultiplePackets?i.framesAssembledFromMultiplePackets-t.aggregatedStats.framesAssembledFromMultiplePackets:i.framesDecoded-t.aggregatedStats.framesDecoded;s>0&&(i.processingDelayMs=1e3*(i.processingDelay-t.aggregatedStats.processingDelay)/s)}}"track"!=e.type||"video_label"!=e.trackIdentifier&&"video"!=e.kind||(i.framesDropped=e.framesDropped,i.framesReceived=e.framesReceived,i.framesDroppedPercentage=e.framesReceived>0?e.framesDropped/e.framesReceived*100:0,i.frameHeight=e.frameHeight,i.frameWidth=e.frameWidth,i.frameHeightStart=t.aggregatedStats&&t.aggregatedStats.frameHeightStart?t.aggregatedStats.frameHeightStart:e.frameHeight,i.frameWidthStart=t.aggregatedStats&&t.aggregatedStats.frameWidthStart?t.aggregatedStats.frameWidthStart:e.frameWidth),"inbound-rtp"!=e.type||"video"!=e.mediaType&&"video"!=e.kind||(e.frameHeight&&!i.frameHeight&&(i.frameHeight=e.frameHeight),e.frameWidth&&!i.frameWidth&&(i.frameWidth=e.frameWidth),void 0!==e.framesDropped&&void 0===i.framesDropped&&(i.framesDropped=e.framesDropped),void 0!==e.framesReceived&&void 0===i.framesReceived&&(i.framesReceived=e.framesReceived,i.framesReceived>0&&void 0!==i.framesDropped&&(i.framesDroppedPercentage=i.framesDropped/i.framesReceived*100))),"candidate-pair"==e.type&&e.hasOwnProperty("currentRoundTripTime")&&0!=e.currentRoundTripTime&&(i.currentRoundTripTime=e.currentRoundTripTime)})),t.aggregatedStats.receiveToCompositeMs&&(i.receiveToCompositeMs=t.aggregatedStats.receiveToCompositeMs,t.latencyTestTimings.SetFrameDisplayDeltaTime(t.aggregatedStats.receiveToCompositeMs)),t.aggregatedStats=i,t.onAggregatedStats&&t.onAggregatedStats(i)});t.aggregateStatsIntervalId=setInterval((function(){t.getStats(i)}),e)}};!function(e,t){void 0===t&&(t={});var i=t.insertAt;if("undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],a=document.createElement("style");a.type="text/css","top"===i&&n.firstChild?n.insertBefore(a,n.firstChild):n.appendChild(a),a.styleSheet?a.styleSheet.cssText=e:a.appendChild(document.createTextNode(e))}}("/* 视频流送的视频组件样式 */\r\nvideo {\r\n position: absolute;\r\n width: 100%;\r\n height: 100%;\r\n}\r\n\r\n/* 视频流送的整体根组件属性 */\r\n#player {\r\n width: 100%;\r\n height: 100%;\r\n position: relative;\r\n background-color: #000;\r\n}\r\n\r\n/* 如果不是链接后直接加载(即connect_on_load: false)那么便会显示该画面,用于配置显示蒙版的样式 */\r\n#videoPlayOverlay {\r\n z-index: 30;\r\n position: absolute;\r\n font-size: 1.8em;\r\n width: 100%;\r\n height: 100%;\r\n color: white;\r\n background-color: rgba(100, 100, 100, .7);\r\n}\r\n\r\n/* State for element to be clickable */\r\n/* 待开始页面显示状态的样式 */\r\n.clickableState {\r\n align-items: center;\r\n justify-content: center;\r\n display: flex;\r\n cursor: pointer;\r\n}\r\n\r\n.textDisplayState {\r\n width: 100%;\r\n height: 100%;\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n}\r\n\r\n/* State to hide overlay, WebRTC communication is in progress and or is playing */\r\n/* 待开始页面隐藏 */\r\n.hiddenState {\r\n display: none;\r\n}\r\n\r\n/* 如果不是链接后直接加载(即connect_on_load: false)那么便会显示该按钮文字,用于配置显示样式 */\r\n#playButton {\r\n display: inline-block;\r\n height: auto;\r\n}");var be=function(){return C((function e(){U(this,e)}),[{key:"addEventListener",value:function(e,t){void 0===this._listeners&&(this._listeners={}),this._needsDispatchedToUE=!1;var i=this._listeners;void 0===i[e]&&(i[e]=[]),-1===i[e].indexOf(t)&&(i[e].push(t),this._needsDispatchedToUE=!0,this._dispatchAddListenerTypes||(this._dispatchAddListenerTypes=[]),this._dispatchAddListenerTypes.push(e))}},{key:"hasEventListener",value:function(e,t){if(void 0===this._listeners)return!1;var i=this._listeners;return void 0!==i[e]&&-1!==i[e].indexOf(t)}},{key:"removeEventListener",value:function(e,t){if(void 0!==this._listeners){this._needsDispatchedToUE=!1;var i=this._listeners[e];if(void 0!==i){var n=i.indexOf(t);-1!==n&&(i.splice(n,1),this._needsDispatchedToUE=!0,this._dispatchRemoveListenerTypes||(this._dispatchRemoveListenerTypes=[]),this._dispatchRemoveListenerTypes.push(e))}}}},{key:"dispatchEvent",value:function(e){if(void 0!==this._listeners){var t=this._listeners[e.type];if(void 0!==t){e.target=this;for(var i=t.slice(0),n=0,a=i.length;n<a;n++)e.index=n,i[n].call(this,e);e.target=null}}}},{key:"_silentlyRemoveEventListener",value:function(e,t,i){if(e&&i&&void 0!==e._listeners){var n=e._listeners[t];if(void 0!==n){var a=n.indexOf(i);-1!==a&&n.splice(a,1)}}}}])}(),xe=function(){function t(i){var n;return U(this,t),(n=N(this,t)).haveEvents="GamepadEvent"in window,n.haveWebkitEvents="WebKitGamepadEvent"in window,n.cloudRenderEngine=i,n.playerElement=document.getElementById("player"),n.promiseResponses=[],n.scene=n.cloudRenderEngine.scene,n.interactiveObjects=new Map,n.blacklist=new Set,n.mousedownTime=null,n.mouse=new e(0,0),n.selection=[],n.logMessages=!1,n.inputOptions=i.inputOptions,n.playerElement&&(n.playerElement.tabIndex<10&&(n.playerElement.tabIndex=1e3),n.playerElement.addEventListener("contextmenu",(function(e){e.preventDefault()}),!1)),n}return z(t,be),C(t,[{key:"updateObjectsWithEvent",value:function(){var e=new Map;this.scene&&this.scene.children.length&&this.scene.children.forEach((function(t,i){t._listeners&&e.set(t.uuid,t)})),this.interactiveObjects.clear(),this.interactiveObjects=e}},{key:"isKeyCodeBrowserKey",value:function(e){return e>=112&&e<=123||9===e}},{key:"getKeyCode",value:function(e){return e.keyCode===he.Shift&&"ShiftRight"===e.code?he.RightShift:e.keyCode===he.Control&&"ControlRight"===e.code?he.RightControl:e.keyCode===he.Alt&&"AltRight"===e.code?he.RightAlt:e.keyCode}},{key:"registerKeyboardEvents",value:function(){var e=this;document.onkeydown=function(t){e.print_inputs&&console.log("key down ".concat(t.keyCode,", repeat = ").concat(t.repeat)),e.cloudRenderEngine.sendInputData(new Uint8Array([le.KeyDown,e.getKeyCode(t),t.repeat]).buffer),t.keyCode===he.BackSpace&&document.onkeypress({charCode:he.BackSpace}),e.inputOptions.suppressBrowserKeys&&e.isKeyCodeBrowserKey(t.keyCode)&&t.preventDefault()},document.onkeyup=function(t){e.print_inputs&&console.log("key up ".concat(t.keyCode)),e.cloudRenderEngine.sendInputData(new Uint8Array([le.KeyUp,e.getKeyCode(t)]).buffer),e.inputOptions.suppressBrowserKeys&&e.isKeyCodeBrowserKey(t.keyCode)&&t.preventDefault()},document.onkeypress=function(t){e.print_inputs&&console.log("key press ".concat(t.charCode));var i=new DataView(new ArrayBuffer(3));i.setUint8(0,le.KeyPress),i.setUint16(1,t.charCode,!0),e.cloudRenderEngine.sendInputData(i.buffer)}}},{key:"resizePlayerStyleToFillWindow",value:function(e){var t=e.getElementsByTagName("VIDEO"),i=window.innerHeight/window.innerWidth,n=e.clientHeight/e.clientWidth,a=t.videoHeight/t.videoWidth;isNaN(a)?(this.styleWidth=window.innerWidth,this.styleHeight=window.innerHeight,this.styleTop=0,this.styleLeft=0,e.style="top: "+this.styleTop+"px; left: "+this.styleLeft+"px; width: "+this.styleWidth+"px; height: "+this.styleHeight+"px; cursor: "+this.styleCursor+"; "+this.styleAdditional):i<n?(this.styleWidth=Math.floor(window.innerHeight/a),this.styleHeight=window.innerHeight,this.styleTop=0,this.styleLeft=Math.floor(.5*(window.innerWidth-this.styleWidth)),e.style="top: "+this.styleTop+"px; left: "+this.styleLeft+"px; width: "+this.styleWidth+"px; height: "+this.styleHeight+"px; cursor: "+this.styleCursor+"; "+this.styleAdditional):(this.styleWidth=window.innerWidth,this.styleHeight=Math.floor(window.innerWidth*a),this.styleTop=Math.floor(.5*(window.innerHeight-this.styleHeight)),this.styleLeft=0,e.style="top: "+this.styleTop+"px; left: "+this.styleLeft+"px; width: "+this.styleWidth+"px; height: "+this.styleHeight+"px; cursor: "+this.styleCursor+"; "+this.styleAdditional)}},{key:"resizePlayerStyleToActualSize",value:function(e){var t=e.getElementsByTagName("VIDEO");if(t.length>0){this.styleWidth=t[0].videoWidth,this.styleHeight=t[0].videoHeight;var i=Math.floor(.5*(window.innerHeight-this.styleHeight)),n=Math.floor(.5*(window.innerWidth-this.styleWidth));this.styleTop=i>0?i:0,this.styleLeft=n>0?n:0,e.style="top: "+this.styleTop+"px; left: "+this.styleLeft+"px; width: "+this.styleWidth+"px; height: "+this.styleHeight+"px; cursor: "+this.styleCursor+"; "+this.styleAdditional}}},{key:"resizePlayerStyleToArbitrarySize",value:function(e){e.style="top: 0px; left: 0px; width: "+this.styleWidth+"px; height: "+this.styleHeight+"px; cursor: "+this.styleCursor+"; "+this.styleAdditional}},{key:"setupFreezeFrameOverlay",value:function(){this.cloudRenderEngine.freezeFrameOverlay=document.createElement("div"),this.cloudRenderEngine.freezeFrameOverlay.id="this.cloudRenderEngine.freezeFrameOverlay",this.cloudRenderEngine.freezeFrameOverlay.style.display="none",this.cloudRenderEngine.freezeFrameOverlay.style.pointerEvents="none",this.cloudRenderEngine.freezeFrameOverlay.style.position="absolute",this.cloudRenderEngine.freezeFrameOverlay.style.zIndex="20";var e=document.createElement("img");e.style.position="absolute",this.cloudRenderEngine.freezeFrameOverlay.appendChild(e)}},{key:"showFreezeFrameOverlay",value:function(){this.cloudRenderEngine.freezeFrame.valid&&(this.cloudRenderEngine.freezeFrameOverlay.classList.add("freezeframeBackground"),this.cloudRenderEngine.freezeFrameOverlay.style.display="block")}},{key:"invalidateFreezeFrameOverlay",value:function(){this.cloudRenderEngine.freezeFrameOverlay.style.display="none",this.cloudRenderEngine.freezeFrame.valid=!1,this.cloudRenderEngine.freezeFrameOverlay.classList.remove("freezeframeBackground"),this.cloudRenderEngine.webRtcPlayerObj&&this.cloudRenderEngine.webRtcPlayerObj.setVideoEnabled(!0)}},{key:"resizeFreezeFrameOverlay",value:function(){if(0!==this.cloudRenderEngine.freezeFrame.width&&0!==this.cloudRenderEngine.freezeFrame.height){var e=0,t=0,i=0,n=0,a=document.getElementById("enlarge-display-to-fill-window-tgl"),r=document.getElementById("player");if(null!==a&&a.checked){var o=window.innerWidth/window.innerHeight,s=this.cloudRenderEngine.freezeFrame.width/this.cloudRenderEngine.freezeFrame.height;o<s?(e=window.innerWidth,t=Math.floor(window.innerWidth/s),i=Math.floor(.5*(window.innerHeight-t)),n=0):(e=Math.floor(window.innerHeight*s),t=window.innerHeight,i=0,n=Math.floor(.5*(window.innerWidth-e)))}else{var l=r.offsetWidth/r.offsetHeight,u=this.cloudRenderEngine.freezeFrame.width/this.cloudRenderEngine.freezeFrame.height;l<u?(e=r.offsetWidth,t=Math.floor(r.offsetWidth/u),i=Math.floor(.5*(r.offsetHeight-t)),n=0):(e=Math.floor(r.offsetHeight*u),t=r.offsetHeight,i=0,n=Math.floor(.5*(r.offsetWidth-e)))}var c=document.getElementById("this.cloudRenderEngine.freezeFrameOverlay").childNodes[0];this.cloudRenderEngine.freezeFrameOverlay.style.width=r.offsetWidth+"px",this.cloudRenderEngine.freezeFrameOverlay.style.height=r.offsetHeight+"px",this.cloudRenderEngine.freezeFrameOverlay.style.left="0px",this.cloudRenderEngine.freezeFrameOverlay.style.top="0px",c.style.width=e+"px",c.style.height=t+"px",c.style.left=n+"px",c.style.top=i+"px"}}},{key:"resizePlayerStyle",value:function(e){var t=document.getElementById("player");if(t)if(this.cloudRenderEngine.updateVideoStreamSize(),t.classList.contains("fixed-size"))this.setupMouseAndFreezeFrame(t);else{var i=document.getElementById("enlarge-display-to-fill-window-tgl"),n=window.innerWidth<t.videoWidth||window.innerHeight<t.videoHeight;null!==i?i.checked||n?this.resizePlayerStyleToFillWindow(t):this.resizePlayerStyleToActualSize(t):this.resizePlayerStyleToArbitrarySize(t),this.setupMouseAndFreezeFrame(t)}}},{key:"setupMouseAndFreezeFrame",value:function(e){this.playerElementClientRect=e.getBoundingClientRect(),this.cloudRenderEngine.setupNormalizeAndQuantize(),this.resizeFreezeFrameOverlay()}},{key:"onOrientationChange",value:function(e){var t=this;clearTimeout(this._orientationChangeTimeout),this._orientationChangeTimeout=setTimeout((function(){t.resizePlayerStyle()}),500)}},{key:"setupHtmlEvents",value:function(){var e=this,t=this;if(window.addEventListener("resize",(function(t){e.resizePlayerStyle(t)}),!0),window.addEventListener("orientationchange",(function(t){e.onOrientationChange(t)})),this.haveEvents?(window.addEventListener("gamepadconnected",(function(t){e.gamepadConnectHandler(t)})),window.addEventListener("gamepaddisconnected",(function(t){e.gamepadDisconnectHandler(t)}))):this.haveWebkitEvents&&(window.addEventListener("webkitgamepadconnected",(function(t){e.gamepadConnectHandler(t)})),window.addEventListener("webkitgamepaddisconnected",(function(t){e.gamepadDisconnectHandler(t)}))),this.cloudRenderEngine.isShowTestUI){document.getElementById("overlayButton").addEventListener("click",(function(t){e.onExpandOverlay_Click(t)}));var i=document.getElementById("enlarge-display-to-fill-window-tgl");null!==i&&(i.onchange=function(e){t.resizePlayerStyle()}),this.cloudRenderEngine.qualityControlOwnershipCheckBox=document.getElementById("quality-control-ownership-tgl"),null!==this.cloudRenderEngine.qualityControlOwnershipCheckBox&&(this.cloudRenderEngine.qualityControlOwnershipCheckBox.onchange=function(e){t.cloudRenderEngine.requestQualityControl()});var n=document.getElementById("encoder-params-submit");null!==n&&(n.onclick=function(e){var i=document.getElementById("encoder-min-qp-text").value,n=document.getElementById("encoder-max-qp-text").value;t.cloudRenderEngine.emitCommand({ConsoleCommand:"PixelStreaming.Encoder.MinQP "+i}),t.cloudRenderEngine.emitCommand({ConsoleCommand:"PixelStreaming.Encoder.MaxQP "+n})});var a=document.getElementById("webrtc-params-submit");null!==a&&(a.onclick=function(e){var i=document.getElementById("webrtc-fps-text").value,n=1e3*document.getElementById("webrtc-min-bitrate-text").value,a=1e3*document.getElementById("webrtc-max-bitrate-text").value;t.cloudRenderEngine.emitCommand({ConsoleCommand:"PixelStreaming.WebRTC.Fps "+i}),t.cloudRenderEngine.emitCommand({ConsoleCommand:"PixelStreaming.WebRTC.MinBitrate "+n}),t.cloudRenderEngine.emitCommand({ConsoleCommand:"PixelStreaming.WebRTC.MaxBitrate "+a})});var r=document.getElementById("show-fps-button");null!==r&&(r.onclick=function(e){t.cloudRenderEngine.emitCommand({ConsoleCommand:"Stat FPS"})});var o=document.getElementById("match-viewport-res-tgl");null!==o&&(o.onchange=function(e){t.cloudRenderEngine.matchViewportResolution=o.checked});var s=document.getElementById("show-stats-tgl");null!==s&&(s.onchange=function(e){document.getElementById("statsContainer").style.display=e.target.checked?"block":"none"});var l=document.getElementById("test-latency-button");l&&(l.onclick=function(){e.sendStartLatencyTest()}),this.cloudRenderEngine.setupToggleWithUrlParams("prefer-sfu-tgl","preferSFU"),this.cloudRenderEngine.setupToggleWithUrlParams("use-mic-tgl","useMic"),this.cloudRenderEngine.setupToggleWithUrlParams("force-turn-tgl","ForceTURN");var u=document.getElementById("stream-select"),c=document.getElementById("track-select");u&&(u.onchange=function(e){var i=t.cloudRenderEngine.webRtcPlayerObj.availableVideoStreams.get(u.value);t.cloudRenderEngine.webRtcPlayerObj.video.srcObject=i,t.cloudRenderEngine.streamTrackSource=i,t.cloudRenderEngine.webRtcPlayerObj.video.play(),t.cloudRenderEngine.updateTrackList()},c&&(c.onchange=function(e){if(t.cloudRenderEngine.streamTrackSource||(t.cloudRenderEngine.streamTrackSource=t.cloudRenderEngine.webRtcPlayerObj.availableVideoStreams.get(u.value)),t.cloudRenderEngine.streamTrackSource){var i,n=T(t.cloudRenderEngine.streamTrackSource.getVideoTracks());try{for(n.s();!(i=n.n()).done;){var a=i.value;if(a.id===c.value){t.cloudRenderEngine.webRtcPlayerObj.video.srcObject=new MediaStream([a]),t.cloudRenderEngine.webRtcPlayerObj.video.play(),u.value="";break}}}catch(e){n.e(e)}finally{n.f()}}}))}}},{key:"onExpandOverlay_Click",value:function(){document.getElementById("overlay").classList.toggle("overlay-shown")}},{key:"gamepadConnectHandler",value:function(e){console.log("Gamepad connect handler")}},{key:"gamepadDisconnectHandler",value:function(e){console.log("Gamepad disconnect handler"),console.log("gamepad: "+e.gamepad.id+" disconnected"),delete this.cloudRenderEngine.controllers[e.gamepad.index]}},{key:"emitMouseMove",value:function(e,t,i,n){this.cloudRenderEngine.print_inputs&&console.log("emitMouseMove x: ".concat(e,", y:").concat(t,", dX: ").concat(i,", dY: ").concat(n));var a=this.cloudRenderEngine.normalizeAndQuantizeUnsigned(e,t),r=this.cloudRenderEngine.normalizeAndQuantizeSigned(i,n),o=new DataView(new ArrayBuffer(9));o.setUint8(0,le.MouseMove),o.setUint16(1,a.x,!0),o.setUint16(3,a.y,!0),o.setInt16(5,r.x,!0),o.setInt16(7,r.y,!0),this.cloudRenderEngine.sendInputData(o.buffer)}},{key:"emitMouseDown",value:function(e,t,i){this.print_inputs&&console.log("mouse button ".concat(e," down at (").concat(t,", ").concat(i,")"));var n=this.cloudRenderEngine.normalizeAndQuantizeUnsigned(t,i),a=new DataView(new ArrayBuffer(6));a.setUint8(0,le.MouseDown),a.setUint8(1,e),a.setUint16(2,n.x,!0),a.setUint16(4,n.y,!0),this.cloudRenderEngine.sendInputData(a.buffer)}},{key:"emitMouseUp",value:function(e,t,i){this.print_inputs&&console.log("mouse button ".concat(e," up at (").concat(t,", ").concat(i,")"));var n=this.cloudRenderEngine.normalizeAndQuantizeUnsigned(t,i),a=new DataView(new ArrayBuffer(6));a.setUint8(0,le.MouseUp),a.setUint8(1,e),a.setUint16(2,n.x,!0),a.setUint16(4,n.y,!0),this.cloudRenderEngine.sendInputData(a.buffer)}},{key:"emitMouseWheel",value:function(e,t,i){this.print_inputs&&console.log("mouse wheel with delta ".concat(e," at (").concat(t,", ").concat(i,")"));var n=this.cloudRenderEngine.normalizeAndQuantizeUnsigned(t,i),a=new DataView(new ArrayBuffer(7));a.setUint8(0,le.MouseWheel),a.setInt16(1,e,!0),a.setUint16(3,n.x,!0),a.setUint16(5,n.y,!0),this.cloudRenderEngine.sendInputData(a.buffer)}},{key:"releaseMouseButtons",value:function(e,t,i){e&de.PrimaryButton&&this.emitMouseUp(ce.MainButton,t,i),e&de.SecondaryButton&&this.emitMouseUp(ce.SecondaryButton,t,i),e&de.AuxiliaryButton&&this.emitMouseUp(ce.AuxiliaryButton,t,i),e&de.FourthButton&&this.emitMouseUp(ce.FourthButton,t,i),e&de.FifthButton&&this.emitMouseUp(ce.FifthButton,t,i)}},{key:"pressMouseButtons",value:function(e,t,i){e&de.PrimaryButton&&this.emitMouseDown(ce.MainButton,t,i),e&de.SecondaryButton&&this.emitMouseDown(ce.SecondaryButton,t,i),e&de.AuxiliaryButton&&this.emitMouseDown(ce.AuxiliaryButton,t,i),e&de.FourthButton&&this.emitMouseDown(ce.FourthButton,t,i),e&de.FifthButton&&this.emitMouseDown(ce.FifthButton,t,i)}},{key:"registerInputs",value:function(e){e&&(this.registerMouseEnterAndLeaveEvents(e),this.registerTouchEvents(e))}},{key:"registerMouseEnterAndLeaveEvents",value:function(e){var t=this;e.onmouseenter=function(i){t.print_inputs&&console.log("mouse enter");var n=new DataView(new ArrayBuffer(1));n.setUint8(0,le.MouseEnter),t.cloudRenderEngine.sendInputData(n.buffer),e.pressMouseButtons(i)},e.onmouseleave=function(i){t.print_inputs&&console.log("mouse leave");var n=new DataView(new ArrayBuffer(1));n.setUint8(0,le.MouseLeave),t.cloudRenderEngine.sendInputData(n.buffer),e.releaseMouseButtons(i)}}},{key:"registerLockedMouseEvents",value:function(e){var t=this,i=e.width/2,n=e.height/2;function a(){document.pointerLockElement===e||document.mozPointerLockElement===e?(console.log("Pointer locked"),document.addEventListener("mousemove",r,!1)):(console.log("The pointer lock status is now unlocked"),document.removeEventListener("mousemove",r,!1))}function r(e){i+=e.movementX,n+=e.movementY,i>t.styleWidth&&(i-=t.styleWidth),n>t.styleHeight&&(n-=t.styleHeight),i<0&&(i=t.styleWidth+i),n<0&&(n=t.styleHeight-n),t.emitMouseMove(i,n,e.movementX,e.movementY)}e.requestPointerLock=e.requestPointerLock||e.mozRequestPointerLock,document.exitPointerLock=document.exitPointerLock||document.mozExitPointerLock,e.onclick=function(){e.requestPointerLock()},document.addEventListener("pointerlockchange",a,!1),document.addEventListener("mozpointerlockchange",a,!1),e.onmousedown=function(e){t.emitMouseDown(e.button,i,n)},e.onmouseup=function(e){t.emitMouseUp(e.button,i,n)},e.onmousewheel=function(e){t.emitMouseWheel(e.wheelDelta,i,n)},e.pressMouseButtons=function(e){t.pressMouseButtons(e.buttons,i,n)},e.releaseMouseButtons=function(e){t.releaseMouseButtons(e.buttons,i,n)}}},{key:"registerHoveringMouseEvents",value:function(e){var t=this,i=/Mac/.test(navigator.platform)||/Macintosh/.test(navigator.userAgent);e.onpointermove=function(e){t.emitMouseMove(e.offsetX,e.offsetY,e.movementX,e.movementY),e.preventDefault()},e.onpointerdown=function(i){e.setPointerCapture(i.pointerId),t.emitMouseDown(i.button,i.offsetX,i.offsetY),i.preventDefault()},e.onpointerup=function(e){t.emitMouseUp(e.button,e.offsetX,e.offsetY),e.preventDefault()},e.oncontextmenu=function(e){i||t.emitMouseUp(e.button,e.offsetX,e.offsetY),e.preventDefault()},"onmousewheel"in e?e.onmousewheel=function(e){t.emitMouseWheel(e.wheelDelta,e.offsetX,e.offsetY),e.preventDefault()}:e.addEventListener("DOMMouseScroll",(function(e){t.emitMouseWheel(-120*e.detail,e.offsetX,e.offsetY),e.preventDefault()}),!1),e.pressMouseButtons=function(e){t.pressMouseButtons(e.buttons,e.offsetX,e.offsetY)},e.releaseMouseButtons=function(e){t.releaseMouseButtons(e.buttons,e.offsetX,e.offsetY)}}},{key:"registerTouchEvents",value:function(e){var t,i=this,n=[9,8,7,6,5,4,3,2,1,0],a={};function r(e){var t=n.pop();void 0===t&&console.log("exhausted touch indentifiers"),a[e.identifier]=t}function o(t,n){var r=new DataView(new ArrayBuffer(2+7*n.length));r.setUint8(0,t),r.setUint8(1,n.length);for(var o=2,s=0;s<n.length;s++){var l=n[s],u=l.clientX-e.offsetLeft,c=l.clientY-e.offsetTop;i.print_inputs&&console.log("F".concat(a[l.identifier],"=(").concat(u,", ").concat(c,")"));var d=i.cloudRenderEngine.normalizeAndQuantizeUnsigned(u,c);r.setUint16(o,d.x,!0),o+=2,r.setUint16(o,d.y,!0),o+=2,r.setUint8(o,a[l.identifier],!0),o+=1,r.setUint8(o,255*l.force,!0),o+=1,r.setUint8(o,d.inRange?1:0,!0),o+=1}i.cloudRenderEngine.sendInputData(r.buffer)}this.inputOptions.fakeMouseWithTouches?(e.ontouchstart=function(n){if(void 0===t){var a=n.changedTouches[0];t={id:a.identifier,x:a.clientX-i.playerElementClientRect.left,y:a.clientY-i.playerElementClientRect.top},e.onmouseenter(n),i.emitMouseDown(ce.MainButton,t.x,t.y)}n.preventDefault()},e.ontouchend=function(n){for(var a=0;a<n.changedTouches.length;a++){var r=n.changedTouches[a];if(r.identifier===t.id){var o=r.clientX-i.playerElementClientRect.left,s=r.clientY-i.playerElementClientRect.top;i.emitMouseUp(ce.MainButton,o,s),e.onmouseleave(n),t=void 0;break}}n.preventDefault()},e.ontouchmove=function(e){for(var n=0;n<e.touches.length;n++){var a=e.touches[n];if(a.identifier===t.id){var r=a.clientX-i.playerElementClientRect.left,o=a.clientY-i.playerElementClientRect.top;i.emitMouseMove(r,o,r-t.x,o-t.y),t.x=r,t.y=o;break}}e.preventDefault()}):(e.ontouchstart=function(e){for(var t=0;t<e.changedTouches.length;t++)r(e.changedTouches[t]);i.print_inputs&&console.log("touch start"),o(le.TouchStart,e.changedTouches),e.preventDefault()},e.ontouchend=function(e){i.print_inputs&&console.log("touch end"),o(le.TouchEnd,e.changedTouches);for(var t=0;t<e.changedTouches.length;t++)r=e.changedTouches[t],n.push(a[r.identifier]),delete a[r.identifier];var r;e.preventDefault()},e.ontouchmove=function(e){i.print_inputs&&console.log("touch move"),o(le.TouchMove,e.touches),e.preventDefault()})}},{key:"callRespone",value:function(e){var t=e.uuid,i=e.classType;this.interactiveObjects.has(t)?this.interactiveObjects.get(t).dispatchEvent(e):"cloudrenderengine"===i.toLowerCase()?this.cloudRenderEngine.dispatchEvent(e):"scene"===i.toLowerCase()?this.scene&&this.scene.dispatchEvent(e):"camera"===i.toLowerCase()&&this.cloudRenderEngine.camera&&this.cloudRenderEngine.camera.dispatchEvent(e)}}])}();function Se(e){for(var t=-559038737,i=1103547991,n=0;n<e.length;n++){var a=e[n];t=Math.imul(t^a,2654435761),i=Math.imul(i^a,1597334677)}return t=Math.imul(t^t>>>16,2246822507)^Math.imul(i^i>>>13,3266489909),((i=Math.imul(i^i>>>16,2246822507)^Math.imul(t^t>>>13,3266489909))>>>0).toString(16).padStart(8,"0")+(t>>>0).toString(16).padStart(8,"0")}function we(e){return Ne.apply(this,arguments)}function Ne(){return(Ne=w(D().mark((function e(t){var i;return D().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,crypto.subtle.digest("SHA-1",t);case 2:return i=e.sent,e.abrupt("return",Array.from(new Uint8Array(i),(function(e){return e.toString(16).padStart(2,"0")})).join(""));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ue(e){return ke.apply(this,arguments)}function ke(){return(ke=w(D().mark((function e(t){var i;return D().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!((i=t instanceof Uint8Array?t:new Uint8Array(t)).byteLength<65536)){e.next=3;break}return e.abrupt("return",Se(i));case 3:return e.abrupt("return",we(i));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ce(e){return Te.apply(this,arguments)}function Te(){return(Te=w(D().mark((function e(t){var i,n,a,r,o,s,l,u,c,d,h,f;return D().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(t instanceof Uint8Array)){e.next=2;break}return e.abrupt("return",{bytes:t,mime:"application/octet-stream",width:0,height:0});case 2:if(!(t instanceof HTMLCanvasElement)){e.next=25;break}return i=t.width,n=t.height,e.next=7,new Promise((function(e){return t.toBlob(e,"image/webp",.9)}));case 7:if(a=e.sent,r="image/webp",a){e.next=14;break}return e.next=12,new Promise((function(e){return t.toBlob(e,"image/png")}));case 12:a=e.sent,r="image/png";case 14:if(a){e.next=16;break}throw new Error("TextureBus: Canvas toBlob failed (canvas may be tainted by cross-origin image)");case 16:return e.t0=Uint8Array,e.next=19,a.arrayBuffer();case 19:return e.t1=e.sent,e.t2=new e.t0(e.t1),e.t3=r,e.t4=i,e.t5=n,e.abrupt("return",{bytes:e.t2,mime:e.t3,width:e.t4,height:e.t5});case 25:if("string"!=typeof t||!t.startsWith("data:")){e.next=35;break}for(o=t.indexOf(","),s=t.substring(0,o),l=s.match(/data:([^;]+)/),u=l?l[1]:"image/png",c=t.substring(o+1),d=atob(c),h=new Uint8Array(d.length),f=0;f<d.length;f++)h[f]=d.charCodeAt(f);return e.abrupt("return",{bytes:h,mime:u,width:0,height:0});case 35:throw new Error("TextureBus: unsupported input type");case 36:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Re=function(){return C((function e(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};U(this,e),this._app=t,this._maxBytes=i.maxBytes||67108864,this._cache=new Map,this._totalBytes=0}),[{key:"publishTexture",value:(t=w(D().mark((function e(t){var i,n,a,r,o,s,l,u,c,d,h,f,p,m,g;return D().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce(t);case 2:return i=e.sent,n=i.bytes,a=i.mime,r=i.width,o=i.height,e.next=9,Ue(n);case 9:if(s=e.sent,console.log("[TextureBus] publishTexture: ref=".concat(s," bytes=").concat(n.byteLength," mime=").concat(a)),!(l=this._cache.get(s))||!0!==l.uploaded){e.next=17;break}return l.lastUseTs=Date.now(),l.refCount=(l.refCount||0)+1,console.log("[TextureBus] publishTexture: cache hit ref=".concat(s,", skip upload")),e.abrupt("return",{ref:s});case 17:if(!l||"pending"!==l.uploaded){e.next=20;break}return console.log("[TextureBus] publishTexture: upload pending ref=".concat(s,", waiting...")),e.abrupt("return",new Promise((function(e,t){l._waiters=l._waiters||[],l._waiters.push({resolve:e,reject:t,ref:s})})));case 20:return console.log("[TextureBus] publishTexture: first upload ref=".concat(s," bytes=").concat(n.byteLength)),u={refCount:1,sizeBytes:n.byteLength,lastUseTs:Date.now(),mime:a,width:r,height:o,uploaded:"pending",bytes:n,base64:null,_waiters:[]},this._cache.set(s,u),this._totalBytes+=n.byteLength,e.prev=24,e.next=27,this._sendBinaryAsset(s,n,a,r,o);case 27:console.log("[TextureBus] publishTexture: _sendBinaryAsset done ref=".concat(s)),u.uploaded=!0,c=u._waiters||[],u._waiters=[],d=T(c);try{for(d.s();!(h=d.n()).done;)(f=h.value).resolve({ref:f.ref})}catch(e){d.e(e)}finally{d.f()}e.next=43;break;case 35:e.prev=35,e.t0=e.catch(24),u.uploaded=!1,p=u._waiters||[],u._waiters=[],m=T(p);try{for(m.s();!(g=m.n()).done;)g.value.reject(e.t0)}catch(e){m.e(e)}finally{m.f()}throw e.t0;case 43:return this._evictLRUIfNeeded(),e.abrupt("return",{ref:s});case 45:case"end":return e.stop()}}),e,this,[[24,35]])}))),function(e){return t.apply(this,arguments)})},{key:"resolveRef",value:function(e){if(!e)return null;var t=this._cache.get(e);return t&&!0===t.uploaded?(t.lastUseTs=Date.now(),{ref:e}):null}},{key:"getBase64Sync",value:function(e){if(!e)return null;var t=this._cache.get(e);if(!t||!t.bytes)return null;if(t.base64)return t.base64;for(var i="",n=t.bytes,a=0;a<n.byteLength;a+=32768){var r=n.subarray(a,Math.min(a+32768,n.byteLength));i+=String.fromCharCode.apply(null,r)}var o=btoa(i),s="data:".concat(t.mime||"image/png",";base64,").concat(o);return t.base64=s,s}},{key:"markMissing",value:function(e){var t=this._cache.get(e);t&&(t.uploaded=!1)}},{key:"resetUploadState",value:function(){var e,t=T(this._cache);try{for(t.s();!(e=t.n()).done;){var i=B(e.value,2)[1];!0===i.uploaded&&(i.uploaded=!1)}}catch(e){t.e(e)}finally{t.f()}}},{key:"releaseTexture",value:function(e){var t=this._cache.get(e);t&&(t.refCount=Math.max(0,(t.refCount||1)-1))}},{key:"_sendBinaryAsset",value:(e=w(D().mark((function e(t,i,n,a,r){var o,s,l,u,c,d,h,f,p,m,g,v,y,b,x=this;return D().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=new TextEncoder,s=o.encode(t),l=o.encode(n),u=1+s.length+1+l.length+2+2+i.byteLength,c=new Uint8Array(u),d=0,c[d++]=s.length,c.set(s,d),d+=s.length,c[d++]=l.length,c.set(l,d),d+=l.length,c[d++]=255&a,c[d++]=a>>8&255,c[d++]=255&r,c[d++]=r>>8&255,c.set(i,d),h=this._app._pickDescriptorChannel(c.byteLength,{preferTexture:!0}),f=h.channel,p=h.useTexture,m=h.useBulk,g=p?"texture":m?"bulk":"main",v=this._app.dataChannelHighWatermark,y=!0===this._app.enableAckV2,e.next=23,this._app._enqueueSend(g,(function(){return x._app._sendBinaryFramedV2(le.BinaryAsset,0,2,c,f,v,g)}));case 23:if(b=e.sent,p&&this._app._v3Metrics&&(this._app._v3Metrics.textureChannelBytes+=c.byteLength),this._app.printStats,y){e.next=28;break}return e.abrupt("return");case 28:return e.prev=28,e.next=31,this._app._awaitAckV2(b,{timeoutMs:this._app._defaultAckTimeoutMs,meta:{kind:"BinaryAsset",hash:t,bytes:i.byteLength}});case 31:e.next=37;break;case 33:throw e.prev=33,e.t0=e.catch(28),console.warn("[TextureBus] BinaryAsset AckV2 failed hash=".concat(t," reason=").concat(e.t0.reason||e.t0.message)),e.t0;case 37:case"end":return e.stop()}}),e,this,[[28,33]])}))),function(t,i,n,a,r){return e.apply(this,arguments)})},{key:"_evictLRUIfNeeded",value:function(){if(!(this._totalBytes<=this._maxBytes)){var e,t=T(W(this._cache.entries()).filter((function(e){return!0===B(e,2)[1].uploaded})).sort((function(e,t){var i=B(e,2)[1],n=B(t,2)[1];return i.lastUseTs-n.lastUseTs})));try{for(t.s();!(e=t.n()).done;){var i=B(e.value,2)[1];if(this._totalBytes<=.8*this._maxBytes)break;i.uploaded=!1,i.bytes=null,i.base64=null,this._totalBytes-=i.sizeBytes}}catch(e){t.e(e)}finally{t.f()}}}}]);var e,t}(),Oe=0,Ee=new t,ze=new i,Ie=new n,Ae=new t,_e=new t,Me=new t,Le=new i,De=new t(1,0,0),Pe=new t(0,1,0),Be=new t(0,0,1),Fe={type:"added"},We={type:"removed"},je=function(){function e(){var l;U(this,e),(l=N(this,e)).isObject3D=!0,Object.defineProperty(l,"id",{value:Oe++}),l.uuid=a.generateUUID(),l.name="",l.type="Object3D",l.parent=null,l.children=[],l.up=e.DEFAULT_UP.clone();var u=new t,c=new r,d=new i,h=new t(1,1,1);return c._onChange((function(){d.setFromEuler(c,!1)})),d._onChange((function(){c.setFromQuaternion(d,void 0,!1)})),Object.defineProperties(l,{position:{configurable:!0,enumerable:!0,value:u},rotation:{configurable:!0,enumerable:!0,value:c},quaternion:{configurable:!0,enumerable:!0,value:d},scale:{configurable:!0,enumerable:!0,value:h},modelViewMatrix:{value:new n},normalMatrix:{value:new o}}),l.matrix=new n,l.matrixWorld=new n,l.matrixAutoUpdate=e.DEFAULT_MATRIX_AUTO_UPDATE,l.matrixWorldNeedsUpdate=!1,l.matrixWorldAutoUpdate=e.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,l.layers=new s,l.visible=!0,l.castShadow=!1,l.receiveShadow=!1,l.frustumCulled=!0,l.renderOrder=0,l.animations=[],l.userData={},l}return z(e,be),C(e,[{key:"onBeforeRender",value:function(){}},{key:"onAfterRender",value:function(){}},{key:"applyMatrix4",value:function(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}},{key:"applyQuaternion",value:function(e){return this.quaternion.premultiply(e),this}},{key:"setRotationFromAxisAngle",value:function(e,t){this.quaternion.setFromAxisAngle(e,t)}},{key:"setRotationFromEuler",value:function(e){this.quaternion.setFromEuler(e,!0)}},{key:"setRotationFromMatrix",value:function(e){this.quaternion.setFromRotationMatrix(e)}},{key:"setRotationFromQuaternion",value:function(e){this.quaternion.copy(e)}},{key:"rotateOnAxis",value:function(e,t){return ze.setFromAxisAngle(e,t),this.quaternion.multiply(ze),this}},{key:"rotateOnWorldAxis",value:function(e,t){return ze.setFromAxisAngle(e,t),this.quaternion.premultiply(ze),this}},{key:"rotateX",value:function(e){return this.rotateOnAxis(De,e)}},{key:"rotateY",value:function(e){return this.rotateOnAxis(Pe,e)}},{key:"rotateZ",value:function(e){return this.rotateOnAxis(Be,e)}},{key:"translateOnAxis",value:function(e,t){return Ee.copy(e).applyQuaternion(this.quaternion),this.position.add(Ee.multiplyScalar(t)),this}},{key:"translateX",value:function(e){return this.translateOnAxis(De,e)}},{key:"translateY",value:function(e){return this.translateOnAxis(Pe,e)}},{key:"translateZ",value:function(e){return this.translateOnAxis(Be,e)}},{key:"localToWorld",value:function(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}},{key:"worldToLocal",value:function(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(Ie.copy(this.matrixWorld).invert())}},{key:"lookAt",value:function(e,t,i){e.isVector3?Ae.copy(e):Ae.set(e,t,i);var n=this.parent;this.updateWorldMatrix(!0,!1),_e.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Ie.lookAt(_e,Ae,this.up):Ie.lookAt(Ae,_e,this.up),this.quaternion.setFromRotationMatrix(Ie),n&&(Ie.extractRotation(n.matrixWorld),ze.setFromRotationMatrix(Ie),this.quaternion.premultiply(ze.invert()))}},{key:"add",value:function(e){if(arguments.length>1){for(var t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return e===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",e),this):(e&&e.isObject3D?(null!==e.parent&&e.parent.remove(e),e.parent=this,this.children.push(e),e.dispatchEvent(Fe)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e),this)}},{key:"remove",value:function(e){if(arguments.length>1){for(var t=0;t<arguments.length;t++)this.remove(arguments[t]);return this}var i=this.children.indexOf(e);return-1!==i&&(e.parent=null,this.children.splice(i,1),e.dispatchEvent(We)),this}},{key:"removeFromParent",value:function(){var e=this.parent;return null!==e&&e.remove(this),this}},{key:"clear",value:function(){for(var e=0;e<this.children.length;e++){var t=this.children[e];t.parent=null,t.dispatchEvent(We)}return this.children.length=0,this}},{key:"attach",value:function(e){return this.updateWorldMatrix(!0,!1),Ie.copy(this.matrixWorld).invert(),null!==e.parent&&(e.parent.updateWorldMatrix(!0,!1),Ie.multiply(e.parent.matrixWorld)),e.applyMatrix4(Ie),this.add(e),e.updateWorldMatrix(!1,!0),this}},{key:"getObjectById",value:function(e){return this.getObjectByProperty("id",e)}},{key:"getObjectByName",value:function(e){return this.getObjectByProperty("name",e)}},{key:"getObjectByProperty",value:function(e,t){if(this[e]===t)return this;for(var i=0,n=this.children.length;i<n;i++){var a=this.children[i].getObjectByProperty(e,t);if(void 0!==a)return a}}},{key:"getObjectsByProperty",value:function(e,t){var i=[];this[e]===t&&i.push(this);for(var n=0,a=this.children.length;n<a;n++){var r=this.children[n].getObjectsByProperty(e,t);r.length>0&&(i=i.concat(r))}return i}},{key:"getWorldPosition",value:function(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}},{key:"getWorldQuaternion",value:function(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(_e,e,Me),e}},{key:"getWorldScale",value:function(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(_e,Le,e),e}},{key:"getWorldDirection",value:function(e){this.updateWorldMatrix(!0,!1);var t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}},{key:"raycast",value:function(){}},{key:"traverse",value:function(e){e(this);for(var t=this.children,i=0,n=t.length;i<n;i++)t[i].traverse(e)}},{key:"traverseVisible",value:function(e){if(!1!==this.visible){e(this);for(var t=this.children,i=0,n=t.length;i<n;i++)t[i].traverseVisible(e)}}},{key:"traverseAncestors",value:function(e){var t=this.parent;null!==t&&(e(t),t.traverseAncestors(e))}},{key:"updateMatrix",value:function(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}},{key:"updateMatrixWorld",value:function(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,e=!0);for(var t=this.children,i=0,n=t.length;i<n;i++){var a=t[i];!0!==a.matrixWorldAutoUpdate&&!0!==e||a.updateMatrixWorld(e)}}},{key:"updateWorldMatrix",value:function(e,t){var i=this.parent;if(!0===e&&null!==i&&!0===i.matrixWorldAutoUpdate&&i.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),!0===t)for(var n=this.children,a=0,r=n.length;a<r;a++){var o=n[a];!0===o.matrixWorldAutoUpdate&&o.updateWorldMatrix(!1,!0)}}},{key:"toJSON",value:function(e){var t=void 0===e||"string"==typeof e,i={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},i.metadata={version:4.5,type:"Object",generator:"Object3D.toJSON"});var n={};function a(t,i){return void 0===t[i.uuid]&&(t[i.uuid]=i.toJSON(e)),i.uuid}if(n.uuid=this.uuid,n.type=this.type,""!==this.name&&(n.name=this.name),!0===this.castShadow&&(n.castShadow=!0),!0===this.receiveShadow&&(n.receiveShadow=!0),!1===this.visible&&(n.visible=!1),!1===this.frustumCulled&&(n.frustumCulled=!1),0!==this.renderOrder&&(n.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(n.userData=this.userData),n.layers=this.layers.mask,n.matrix=this.matrix.toArray(),n.up=this.up.toArray(),!1===this.matrixAutoUpdate&&(n.matrixAutoUpdate=!1),this.isInstancedMesh&&(n.type="InstancedMesh",n.count=this.count,n.instanceMatrix=this.instanceMatrix.toJSON(),null!==this.instanceColor&&(n.instanceColor=this.instanceColor.toJSON())),this.isScene)this.background&&(this.background.isColor?n.background=this.background.toJSON():this.background.isTexture&&(n.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&!0!==this.environment.isRenderTargetTexture&&(n.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){n.geometry=a(e.geometries,this.geometry);var r=this.geometry.parameters;if(void 0!==r&&void 0!==r.shapes){var o=r.shapes;if(Array.isArray(o))for(var s=0,l=o.length;s<l;s++){var u=o[s];a(e.shapes,u)}else a(e.shapes,o)}}if(this.isSkinnedMesh&&(n.bindMode=this.bindMode,n.bindMatrix=this.bindMatrix.toArray(),void 0!==this.skeleton&&(a(e.skeletons,this.skeleton),n.skeleton=this.skeleton.uuid)),void 0!==this.material)if(Array.isArray(this.material)){for(var c=[],d=0,h=this.material.length;d<h;d++)c.push(a(e.materials,this.material[d]));n.material=c}else n.material=a(e.materials,this.material);if(this.children.length>0){n.children=[];for(var f=0;f<this.children.length;f++)n.children.push(this.children[f].toJSON(e).object)}if(this.animations.length>0){n.animations=[];for(var p=0;p<this.animations.length;p++){var m=this.animations[p];n.animations.push(a(e.animations,m))}}if(t){var g=U(e.geometries),v=U(e.materials),y=U(e.textures),b=U(e.images),x=U(e.shapes),S=U(e.skeletons),w=U(e.animations),N=U(e.nodes);g.length>0&&(i.geometries=g),v.length>0&&(i.materials=v),y.length>0&&(i.textures=y),b.length>0&&(i.images=b),x.length>0&&(i.shapes=x),S.length>0&&(i.skeletons=S),w.length>0&&(i.animations=w),N.length>0&&(i.nodes=N)}return i.object=n,i;function U(e){var t=[];for(var i in e){var n=e[i];delete n.metadata,t.push(n)}return t}}},{key:"clone",value:function(e){return(new this.constructor).copy(this,e)}},{key:"copy",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.userData=JSON.parse(JSON.stringify(e.userData)),!0===t)for(var i=0;i<e.children.length;i++){var n=e.children[i];this.add(n.clone())}return this}}])}();je.DEFAULT_UP=new t(0,1,0),je.DEFAULT_MATRIX_AUTO_UPDATE=!0,je.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;var He=function(){function e(){var t;return U(this,e),(t=N(this,e)).isScene=!0,t.type="Scene",t.background=null,t.environment=null,t.fog=null,t.childrenSet=new Set,t.backgroundBlurriness=0,t.backgroundIntensity=1,t.overrideMaterial=null,t}return z(e,je),C(e,[{key:"copy",value:function(t,i){return F(e,"copy",this)([t,i]),null!==t.background&&(this.background=t.background.clone()),null!==t.environment&&(this.environment=t.environment.clone()),null!==t.fog&&(this.fog=t.fog.clone()),this.backgroundBlurriness=t.backgroundBlurriness,this.backgroundIntensity=t.backgroundIntensity,null!==t.overrideMaterial&&(this.overrideMaterial=t.overrideMaterial.clone()),this.matrixAutoUpdate=t.matrixAutoUpdate,this}},{key:"toJSON",value:function(t){var i=F(e,"toJSON",this)([t]);return null!==this.fog&&(i.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(i.backgroundBlurriness=this.backgroundBlurriness),1!==this.backgroundIntensity&&(i.backgroundIntensity=this.backgroundIntensity),i}},{key:"autoUpdate",get:function(){return console.warn("THREE.Scene: autoUpdate was renamed to matrixWorldAutoUpdate in r144."),this.matrixWorldAutoUpdate},set:function(e){console.warn("THREE.Scene: autoUpdate was renamed to matrixWorldAutoUpdate in r144."),this.matrixWorldAutoUpdate=e}}])}(),Ge=function(){function e(){var i;U(this,e),(i=N(this,e)).isCamera=!0,i.type="Camera",i.matrixWorldInverse=new n,i._level=0,i._levelChange=0,i.projectionMatrix=new n,i.projectionMatrixInverse=new n;var a=new t,r=-9999,o=-9999,s=-9999,l=-180,u=180,c=-89,d=0,h=-9999,f=-9999;return i.needsUpdate=!1,i.worldLocation=new t,i.sphereLocation=new t,i.constrainPolygon=[],Object.defineProperties(i,{minLocation:{configurable:!0,enumerable:!0,get:function(){return a},set:function(e){e&&(a.x=e.x,a.y=e.y,a.z=e.z,i.needsUpdate=!0)}},maxLocationX:{configurable:!0,enumerable:!0,get:function(){return r},set:function(e){e&&(r=e,i.needsUpdate=!0)}},maxLocationY:{configurable:!0,enumerable:!0,get:function(){return o},set:function(e){e&&(o=e,i.needsUpdate=!0)}},maxLocationZ:{configurable:!0,enumerable:!0,get:function(){return s},set:function(e){e&&(s=e,i.needsUpdate=!0)}},minYaw:{configurable:!0,enumerable:!0,get:function(){return l},set:function(e){void 0!==e&&(l=e,i.needsUpdate=!0)}},maxYaw:{configurable:!0,enumerable:!0,get:function(){return u},set:function(e){void 0!==e&&(u=e,i.needsUpdate=!0)}},minPitch:{configurable:!0,enumerable:!0,get:function(){return c},set:function(e){void 0!==e&&(c=e,i.needsUpdate=!0)}},maxPitch:{configurable:!0,enumerable:!0,get:function(){return d},set:function(e){void 0!==e&&(d=e,i.needsUpdate=!0)}},minSpringArm:{configurable:!0,enumerable:!0,get:function(){return h},set:function(e){void 0!==e&&(h=e,i.needsUpdate=!0)}},maxSpringArm:{configurable:!0,enumerable:!0,get:function(){return f},set:function(e){void 0!==e&&(f=e,i.needsUpdate=!0)}},name:{configurable:!1,enumerable:!0,value:name}}),i}return z(e,je),C(e,[{key:"level",get:function(){return this._level},set:function(e){var t=Math.floor(e);this._levelChange=this._level-t,this._level=t}},{key:"copy",value:function(t,i){return F(e,"copy",this)([t,i]),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this}},{key:"getWorldDirection",value:function(e){this.updateWorldMatrix(!0,!1);var t=this.matrixWorld.elements;return e.set(-t[8],-t[9],-t[10]).normalize()}},{key:"updateMatrixWorld",value:function(t){F(e,"updateMatrixWorld",this)([t]),this.matrixWorldInverse.copy(this.matrixWorld).invert()}},{key:"updateWorldMatrix",value:function(t,i){F(e,"updateWorldMatrix",this)([t,i]),this.matrixWorldInverse.copy(this.matrixWorld).invert()}},{key:"setConstrainPolygon",value:function(e){var t=this;e&&e.length>2&&(this.constrainPolygon=[],e.forEach((function(e,i){t.constrainPolygon.push({x:e[0],y:e[1]})})),this.constrainHeight=-1,this.needsUpdate=!0,this.constrainPolygonNeedsUpdate=!0)}},{key:"setConstrainShape",value:function(e,t){var i=this;t&&t.length>2&&(this.constrainPolygon=[],t.forEach((function(e,t){i.constrainPolygon.push({x:e[0],y:e[1],z:e[2]})})),this.constrainHeight=e,this.needsUpdate=!0,this.constrainShapeNeedsUpdate=!0)}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"toJSON",value:function(){return{shape:this.constrainPolygon&&this.constrainPolygon.length?this.constrainPolygon:null,ConstrainHeight:void 0===this.constrainHeight?-1:this.constrainHeight,MaxLocationX:this.maxLocationX,MaxLocationY:this.maxLocationY,MaxLocationZ:this.maxLocationZ,MinYaw:this.minYaw,MaxYaw:this.maxYaw,MinPitch:this.minPitch,MaxPitch:this.maxPitch,MinSpringArm:this.minSpringArm,MaxSpringArm:this.maxSpringArm,type:this.type,name:this.name,uuid:this.uuid}}}])}(),Ve=function(e){return e.flat(1/0)},Je=function(e){if(!Array.isArray(e))throw new Error("Input must be an array");return e.map((function(e){return parseInt(e,10)}))};function qe(e,t){var i=e[0],n=e[1],a=t[0],r=t[1];return Math.sqrt((i-a)*(i-a)+(n-r)*(n-r))}function Ye(e,t,i){var n=Math.abs(qe(e,t)),a=Math.abs(qe(e,i)),r=Math.abs(qe(t,i)),o=(n+a+r)/2;return 2*Math.sqrt(Math.abs(o*(o-n)*(o-a)*(o-r)))/n}function Ke(e,t,i,n,a){if(i<n){for(var r=0,o=0,s=e[i],l=e[n],u=i+1;u<n;u++){var c=Ye(s,l,e[u]);c>r&&(r=c,o=u)}r>=a&&(t.push(e[o]),Ke(e,t,i,o,a),Ke(e,t,o,n,a))}return t}function Xe(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;if(!(e&&e.length>2))return null;e.forEach((function(e,t){e.id=t}));var n=Ke(e,[],0,e.length-i,t);n.push(e[0]),n.push(e[e.length-1]);var a=n.sort((function(e,t){return e.id<t.id?-1:e.id>t.id?1:0}));return a.forEach((function(e){e.id=0})),a}var Qe=["properties"];function Ze(e,t){if(null==e)return!0;switch(t){case"number":return"number"==typeof e&&Number.isFinite(e);case"string":return"string"==typeof e;case"enum":return"string"==typeof e||"number"==typeof e||"boolean"==typeof e;default:return!1}}function $e(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=t.columnSchema,n=void 0===i?null:i,a=t.autoDetect,r=void 0===a||a,o=t.minFeatures,s=void 0===o?50:o,l=t.autoDetectRatio,u=void 0===l?.2:l,c=t.sampleSize,d=void 0===c?200:c;if(!Array.isArray(e)||e.length<s)return null;var h={};if(n&&"object"===G(n))for(var f=0,p=Object.entries(n);f<p.length;f++){var m=B(p[f],2),g=m[0],v=m[1];v&&("string"==typeof v?h[g]={type:v}:"object"===G(v)&&v.type&&(h[g]=_({},v)))}var y=r?function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=t.sampleSize,n=void 0===i?200:i,a=t.autoDetectRatio,r=void 0===a?.2:a,o={};if(!e.length)return o;var s,l=e.slice(0,Math.min(n,e.length)),u=Object.create(null),c=T(l);try{for(c.s();!(s=c.n()).done;){var d=s.value,h=d&&d.properties;if(h)for(var f=0,p=Object.keys(h);f<p.length;f++){var m=p[f],g=h[m];u[m]||(u[m]={values:new Set,numeric:!0,string:!0,complex:!1,present:0});var v=u[m];v.present++,null!=g&&("number"==typeof g?v.string=!1:"string"==typeof g?v.numeric=!1:"boolean"==typeof g?(v.numeric=!1,v.string=!1):v.complex=!0,v.values.size<512&&v.values.add(g))}}}catch(e){c.e(e)}finally{c.f()}for(var y=0,b=Object.keys(u);y<b.length;y++){var x=b[y],S=u[x];if(!S.complex)if(S.numeric)o[x]={type:"number"};else if(S.string){var w=S.values.size,N=w/Math.max(1,S.present);o[x]=w<=64||N<=r?{type:"enum"}:{type:"string"}}else o[x]={type:"enum"}}return o}(e,{sampleSize:d,autoDetectRatio:u}):{},b=_(_({},y),h),x=new Set(Object.keys(b)),S=Object.keys(b);if(!S.length)return null;for(var w=Object.create(null),N=Object.create(null),U=0,k=S;U<k.length;U++){var C=k[U];w[C]=new Array(e.length),"enum"===b[C].type&&(N[C]=new Map)}for(var R=new Array(e.length),O=0;O<e.length;O++){for(var E=e[O]||{},z=E&&E.properties||{},I={},A=!1,L=0,D=Object.keys(z);L<D.length;L++){var P=D[L];x.has(P)||(I[P]=z[P],A=!0)}var F,W=T(S);try{for(W.s();!(F=W.n()).done;){var j=F.value,H=z[j],V=b[j];if(Ze(H,V.type))if("enum"===V.type){if(null==H){w[j][O]=null;continue}var J=N[j],q=J.get(H);void 0===q&&(q=J.size,J.set(H,q)),w[j][O]=q}else w[j][O]=void 0===H?null:H;else w[j][O]=null,void 0!==H&&(I[j]=H,A=!0)}}catch(e){W.e(e)}finally{W.f()}E.properties;var Y=_({type:"Feature"},M(E,Qe));A&&(Y.properties=I),R[O]=Y}for(var K=Object.create(null),X=0,Q=S;X<Q.length;X++){var Z=Q[X],$=b[Z];if("enum"===$.type){var ee,te=new Array(N[Z].size),ie=T(N[Z]);try{for(ie.s();!(ee=ie.n()).done;){var ne=B(ee.value,2),ae=ne[0];te[ne[1]]=ae}}catch(e){ie.e(e)}finally{ie.f()}K[Z]={type:"enum",dict:te}}else K[Z]={type:$.type}}return{__cs:1,count:e.length,fields:K,columns:w,features:R}}function et(e){if(!e)return[];var t=null;return t=e.features?e.features:Array.isArray(e)?e:[e],JSON.parse(JSON.stringify(t))}function tt(e){var t=[],i=null,n=null;return et(e).forEach((function(e){var a,r;at(null==e||null===(a=e.geometry)||void 0===a?void 0:a.coordinates,2),i=g.flatten(null==e||null===(r=e.geometry)||void 0===r?void 0:r.coordinates),n=g(i.vertices,i.holes,i.dimensions);var o=function(e){for(var t=1/0,i=1/0,n=-1/0,a=-1/0,r=[],o=0;o<e.length/3;o++){var s=e[3*o],l=e[3*o+1];t>s&&(t=s),i>l&&(i=l),n<s&&(n=s),a<l&&(a=l)}for(var u=1/(n-t),c=1/(a-i),d=0;d<e.length/3;d++){var h=u*(e[3*d]-t),f=c*(e[3*d+1]-i);r.push({x:h,y:f})}return r}(i.vertices);t.push({vertices:i.vertices,triangles:n,uvs:o})})),t}function it(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=i.enableDP,a=void 0===n||n,r=i.dpThreshold,o=void 0===r?1e-5:r,s=i.dpMinPoints,l=void 0===s?100:s,u=i.enableColumnStore,c=void 0!==u&&u,d=i.columnSchema,h=i.autoDetect,f=void 0===h||h,p=i.minFeatures,m=et(e);if(m.forEach((function(e){var i,n=null==e||null===(i=e.geometry)||void 0===i?void 0:i.coordinates;if(at(n,1),a&&o>0&&Array.isArray(n)&&n.length>l){var r=n[0],s=n[n.length-1],u=r&&s&&r[0]===s[0]&&r[1]===s[1]&&r[2]===s[2];n=Xe(n,o,u?2:1),e.geometry.coordinates=n}e.geometry.coordinates=Ve(n),t&&(e.geometry.coordinates.push(e.geometry.coordinates[0]),e.geometry.coordinates.push(e.geometry.coordinates[1]),e.geometry.coordinates.push(e.geometry.coordinates[2]))})),c){var g=$e(m,_({columnSchema:d,autoDetect:f},void 0!==p?{minFeatures:p}:{}));if(g)return g}return m}function nt(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=t.enableColumnStore,n=void 0!==i&&i,a=t.columnSchema,r=t.autoDetect,o=void 0===r||r,s=t.minFeatures,l=et(e);if(l.forEach((function(e){var t,i=null==e||null===(t=e.geometry)||void 0===t?void 0:t.coordinates;!function(e){e.type||(e.type="Feature");var t=e.geometry.type,i={Point:0,MultiPoint:1,LineString:1,MultiLineString:2,Polygon:2,MultiPolygon:3};Object.keys(i).includes(t)&&at(e.geometry.coordinates,i[t])}(e),e.geometry.coordinates=Ve(i)})),n){var u=$e(l,_({columnSchema:a,autoDetect:o},void 0!==s?{minFeatures:s}:{}));if(u)return u}return l}var at=function(e,t){if(e)if(0===t)e[2]||(e[2]=0);else{var i,n=T(e);try{for(n.s();!(i=n.n()).done;){var a=i.value;at(a,t-1)}}catch(e){n.e(e)}finally{n.f()}}};var rt=new l;function ot(e,t){rt.load(e,(function(e){var i=new FileReader;i.readAsDataURL(e),i.onloadend=function(e){t(e.target.result)}}),null,(function(e){t(!1)}))}function st(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"image/png";return e.toDataURL(t)}function lt(e){return-1!==e.indexOf("data:")&&-1!==e.indexOf("base64")}function ut(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"https://mapdata.bj.bcebos.com",i=new Image;return i.crossOrigin="Anonymous",i.src=t+e,new Promise((function(e,t){i.addEventListener("load",(function(){e(i)})),i.onerror=function(e){t(e)}}))}function ct(e,t,i,n,a,r){e.beginPath(),e.moveTo(t+r,i),e.lineTo(t+n-r,i),e.quadraticCurveTo(t+n,i,t+n,i+r),e.lineTo(t+n,i+a-r),e.quadraticCurveTo(t+n,i+a,t+n-r,i+a),e.lineTo(t+r,i+a),e.quadraticCurveTo(t,i+a,t,i+a-r),e.lineTo(t,i+r),e.quadraticCurveTo(t,i,t+r,i),e.closePath()}function dt(e,t,i,n){var a,r=i.xScale,o=B(n,2),s=o[0],l=o[1],u=t.text,c=t.fontSize,d=t.fontFamily,h=t.color,f=t.textAlign,p=t.icon;if(u||"number"==typeof u||p)if(u&&p)console.warn("BasicLabel Warning:text和icon不要同时设置");else{if(a=u,e.font="".concat(c*r,"px ").concat(d),e.fillStyle=h,e.textAlign=f||"left",e.textBaseline="top",p){var m=p;-1!==p.indexOf("&amp;")&&(m=p.replace("&amp;","&")),-1!==p.indexOf("&amp")&&(m=p.replace("&amp","&")),a=new Function('return ("'+"".concat(m).replace("&#x","\\u").replace(";","")+'")')()}e.measureText(a).width,e.fillText(a,s,l)}}function ht(e,t){return ft.apply(this,arguments)}function ft(){return(ft=w(D().mark((function e(t,i){var n,r,o,s,l,u,c,d,h,f,p,m,g,v,y,b,x;return D().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.height,r=t.width,o=t.backgroundImage,s=t.borderRadius,l=t.borderColor,u=t.borderWidth,c=t.backgroundColor,d=r,h=n,f=document.createElement("canvas"),p=f.getContext("2d"),m=a.ceilPowerOfTwo(d),g={width:m,height:m*(h/d),factor:{xScale:m/d,yScale:m/d}},f.width=g.width,f.height=g.height,v=g.factor,y=v.xScale,b=v.yScale,!o){e.next=17;break}return e.next=13,ut(o,"");case 13:x=e.sent,p.drawImage(x,0,0,d*y,h*b),e.next=18;break;case 17:(l||c)&&(p.strokeStyle=l,p.fillStyle=c,p.lineWidth=u?u*y:1*y,ct(p,p.lineWidth*y,p.lineWidth*b,(d-2*p.lineWidth)*y,(h-2*p.lineWidth)*b,s?s*y:0),c&&p.fill(),l&&p.stroke());case 18:return i&&pt(p,g,i),e.abrupt("return",f);case 20:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function pt(e,t,i){return mt.apply(this,arguments)}function mt(){return mt=w(D().mark((function e(t,i,n){var a,r,o,s,l,u,c,d,h,f,p,m,g,v,y,b,x,S,w,N,U,k,C,T,R,O,E,z,I,A,_,M,L,P,F,W,j,H,G;return D().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a=i.paddingTop,r=i.paddingLeft,o=i.width,i.height,s=0,l=0,u=0,c=0,d=i.factor,h=d.xScale,f=d.yScale,g=[p=r?r*h:0,m=a?a*f:0],v=Object.keys(n),y=0;case 11:if(!(y<v.length)){e.next=41;break}if(b=n[v[y]],x=b.width,S=b.height,w=b.text,N=b.marginRight,U=b.marginBottom,k=b.backgroundImage,C=b.borderRadius,T=b.borderColor,R=b.borderWidth,O=b.backgroundColor,E=b.position,b.id,E&&(z=B(E,2),I=z[0],A=z[1],g[0]=p+I*h,g[1]=m+A*f,s=0,l=0,u=0,c=0),!x||!S){e.next=37;break}if(g[0]+x*h>o&&((u+=s)+S*f<=l?(g[0]=c,g[1]+=s):(g[0]=r?r*h:0,g[1]+=s,l=0,c=0)),!k){e.next=30;break}return e.prev=18,e.next=21,ut(k,"");case 21:_=e.sent,t.drawImage(_,g[0],g[1],x*h,S*f),e.next=28;break;case 25:e.prev=25,e.t0=e.catch(18),console.log(e.t0);case 28:e.next=31;break;case 30:O&&(t.strokeStyle=T,t.fillStyle=O,t.lineWidth=R?R*h:1*h,ct(b,g[0]+b.lineWidth*h,g[1]+b.lineWidth*h,(x-2*b.lineWidth)*h,(S-2*b.lineWidth)*f,C?C*h:0),O&&t.fill(),T&&t.stroke());case 31:w&&(M=B(E,2),L=M[0],P=M[1],F=[g[0]+L*h,g[1]+P*f],dt(t,b,i.factor,F)),g[0]+=(x+(N||0))*h,(s=(S+(U||0))*f)>l&&(l=s,c=g[0]),e.next=38;break;case 37:w&&(W=B(E,2),j=W[0],H=W[1],G=[g[0]+j*h,g[1]+H*f],dt(t,b,i.factor,G));case 38:y++,e.next=11;break;case 41:case"end":return e.stop()}}),e,null,[[18,25]])}))),mt.apply(this,arguments)}function gt(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e)return!1;var i=document.createElement("canvas"),n=i.getContext("2d"),a=t.scale||1,r=t.fontSize||18,o=t.fontface||"Arial",s=t.borderThickness||0,l=t.backgroundColor||{r:0,g:0,b:0,a:1},u=t.borderColor||{r:0,g:0,b:0,a:1},c=t.strokeStyle||{r:255,g:0,b:0,a:1},d=t.textColor||{r:255,g:0,b:0,a:1};n.font="Bold "+r*a+"px "+o;var h=n.measureText(e).width*a,f=h+2*s*a,p=r*a*1.4+2*s*a;i.width=t.width||f,i.height=t.height||p,n.font="Bold "+r*a+"px "+o;var m=l.r,g=l.g,v=l.b,y=l.a;if(n.fillStyle="rgba("+m+","+g+","+v+","+y+")",n.fillRect(0,0,i.width,i.height),t.drawRoundRect){var b=u.r,x=u.g,S=u.b,w=u.a;n.strokeStyle="rgba("+b+","+x+","+S+","+w+")",n.lineWidth=s*a,ct(n,s/2,s/2,h+s+10*a,r*a*1.4+s,6)}if(n.fill(),n.stroke(),t.drawStrokeStyle){var N=c.r,U=c.g,k=c.b,C=c.a;n.strokeStyle="rgba("+N+","+U+","+k+","+C+")",n.strokeText(e,(s+5)*a+.5*(i.width-f),.5*(i.height-p)+(r+s)*a)}var T=d.r,R=d.g,O=d.b,E=d.a;return n.fillStyle="rgba("+T+","+R+","+O+","+E+")",n.fillText(e,(s+5)*a+.5*(i.width-f),.5*(i.height-p)+(r+s)*a),i}rt.setResponseType("blob");var vt=function(){function e(){var n,o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};U(this,e),n=N(this,e,[o]);var s=o.name,l=new u(1,1,1);o.color&&(l.r=a.clamp(o.color.r,0,1),l.g=a.clamp(o.color.g,0,1),l.b=a.clamp(o.color.b,0,1));var c=new u(1,1,1);o.color2?(c.r=a.clamp(o.color2.r,0,1),c.g=a.clamp(o.color2.g,0,1),c.b=a.clamp(o.color2.b,0,1)):(c.r=l.r,c.g=l.g,c.b=l.b);var d=void 0===o.size?10:o.size,h=void 0===o.sizeAttenuation||o.sizeAttenuation,f=void 0===o.gardientDirection?1:o.gardientDirection,p=void 0===o.brightness?0:o.brightness,m=void 0===o.scroll?0:o.scroll,g=n.childIndex=-1,v=void 0===o.speed?.2:o.speed,y=void 0===o.roughness?1:o.roughness,b=void 0===o.metallic?0:o.metallic;n.map=o.map||null;var x=void 0===o.opacity?1:o.opacity,S=void 0===o.uvRotateSpeed?0:o.uvRotateSpeed,w=void 0===o.WPOScaleAnimateSpeed?0:o.WPOScaleAnimateSpeed,k=void 0===o.WPOMinAnimateScale?1:o.WPOMinAnimateScale,C=void 0===o.WPOMaxAnimateScale?2:o.WPOMaxAnimateScale,T=new u(1,1,1);o.brightnessColor&&(T.r=a.clamp(o.brightnessColor.r,0,1),T.g=a.clamp(o.brightnessColor.g,0,1),T.b=a.clamp(o.brightnessColor.b,0,1));var R=o.position||new t,O=new r;o.rotation&&(O.x=a.clamp(o.rotation.x,-180,180),O.y=a.clamp(o.rotation.y,-180,180),O.z=a.clamp(o.rotation.z,-180,180));var E=new i,z=new t(1,1,1);o.scale&&(z.x=o.scale.x,z.y=o.scale.y,z.z=o.scale.z);var I=new t(0,0,0);if(o.offset&&(I.x=o.offset.x,I.y=o.offset.y,I.z=o.offset.z),n.isInstance=o.isInstance||!1,n.transparent=o.transparent||x<1,n.depthTest=!("depthTest"in o)||o.depthTest,n.renderNum=void 0===o.renderNum?20:o.renderNum,n._visible=void 0===o.visible||o.visible,O._onChange((function(){E.setFromEuler(O,!1),this.matrixNeedsUpdate=!0})),E._onChange((function(){O.setFromQuaternion(E,void 0,!1),this.matrixNeedsUpdate=!0})),Object.defineProperties(n,{position:{configurable:!0,enumerable:!0,get:function(){return R},set:function(e){e&&(R.x=e.x,R.y=e.y,R.z=e.z,n.matrixNeedsUpdate=!0)}},childIndex:{configurable:!0,enumerable:!0,get:function(){return g},set:function(e){e!==g&&(g=e)}},rotation:{configurable:!0,enumerable:!0,get:function(){return O},set:function(e){e&&(O.x=a.clamp(e.x,-180,180),O.y=a.clamp(e.y,-180,180),O.z=a.clamp(e.z,-180,180),n.matrixNeedsUpdate=!0)}},quaternion:{writable:!0,configurable:!0,value:E,enumerable:!0},scale:{configurable:!0,enumerable:!0,get:function(){return z},set:function(e){e&&(z.x=e.x,z.y=e.y,z.z=e.z,n.matrixNeedsUpdate=!0)}},offset:{configurable:!0,enumerable:!0,get:function(){return I},set:function(e){e&&(I.x=e.x,I.y=e.y,I.z=e.z,n.matrixNeedsUpdate=!0)}},color:{configurable:!0,enumerable:!0,get:function(){return l},set:function(e){e&&(l.r=e.r,l.g=e.g,l.b=e.b,e.a&&(x=e.a),n.overtimeInstanceIndex=[],n.data=[],n.materialNeedsUpdate=!0)}},color2:{configurable:!0,enumerable:!0,get:function(){return c},set:function(e){e&&(c.r=e.r,c.g=e.g,c.b=e.b,e.a&&(x=e.a),n.overtimeInstanceIndex=[],n.data=[],n.materialNeedsUpdate=!0)}},gardientDirection:{configurable:!0,enumerable:!0,get:function(){return f},set:function(e){void 0!==e&&(f=e,n.overtimeInstanceIndex=[],n.data=[],n.materialNeedsUpdate=!0)}},scroll:{configurable:!0,enumerable:!0,get:function(){return m},set:function(e){void 0!==e&&(m=e,n.overtimeInstanceIndex=[],n.data=[],n.materialNeedsUpdate=!0)}},uvRotateSpeed:{configurable:!0,enumerable:!0,get:function(){return S},set:function(e){void 0!==e&&(S=e,n.overtimeInstanceIndex=[],n.data=[],n.materialNeedsUpdate=!0)}},WPOMaxAnimateScale:{configurable:!0,enumerable:!0,get:function(){return C},set:function(e){void 0!==e&&(C=e,n.overtimeInstanceIndex=[],n.data=[],n.materialNeedsUpdate=!0)}},WPOMinAnimateScale:{configurable:!0,enumerable:!0,get:function(){return k},set:function(e){void 0!==e&&(k=e,n.overtimeInstanceIndex=[],n.data=[],n.materialNeedsUpdate=!0)}},WPOScaleAnimateSpeed:{configurable:!0,enumerable:!0,get:function(){return w},set:function(e){void 0!==e&&(w=e,n.overtimeInstanceIndex=[],n.data=[],n.materialNeedsUpdate=!0)}},speed:{configurable:!0,enumerable:!0,get:function(){return v},set:function(e){void 0!==e&&(v=e,n.overtimeInstanceIndex=[],n.data=[],n.materialNeedsUpdate=!0)}},brightness:{configurable:!0,enumerable:!0,get:function(){return p},set:function(e){void 0!==e&&(p=e,n.overtimeInstanceIndex=[],n.data=[],n.materialNeedsUpdate=!0)}},roughness:{configurable:!0,enumerable:!0,get:function(){return y},set:function(e){y=e,n.overtimeInstanceIndex=[],n.data=[],n.materialNeedsUpdate=!0}},metallic:{configurable:!0,enumerable:!0,get:function(){return b},set:function(e){b=e,n.overtimeInstanceIndex=[],n.data=[],n.materialNeedsUpdate=!0}},opacity:{configurable:!0,enumerable:!0,get:function(){return x},set:function(e){n.transparent=e<1,x=e,n.overtimeInstanceIndex=[],n.data=[],n.materialNeedsUpdate=!0}},brightnessColor:{configurable:!0,enumerable:!0,get:function(){return T},set:function(e){e&&(T.copy(e),n.overtimeInstanceIndex=[],n.data=[],n.materialNeedsUpdate=!0)}},_layerName:{configurable:!1,enumerable:!1,value:"CommonGISLayer",writable:!0},_cloudControlType:{configurable:!1,enumerable:!1,value:"Gis",writable:!0},type:{configurable:!1,enumerable:!0,value:"Shape",writable:!0},name:{configurable:!1,enumerable:!0,value:s,writable:!0},size:{configurable:!0,enumerable:!0,get:function(){return d},set:function(e){void 0!==e&&(d=e,n.overtimeInstanceIndex=[],n.materialNeedsUpdate=!0)}},sizeAttenuation:{configurable:!0,enumerable:!0,get:function(){return h},set:function(e){void 0!==e&&(h=e,n.overtimeInstanceIndex=[],n.data=[],n.materialNeedsUpdate=!0)}}}),o.data){var A={};void 0!==o.enableColumnStore&&(A.enableColumnStore=o.enableColumnStore),void 0!==o.columnSchema&&(A.columnSchema=o.columnSchema),void 0!==o.columnStoreAutoDetect&&(A.autoDetect=o.columnStoreAutoDetect),void 0!==o.columnStoreMinFeatures&&(A.minFeatures=o.columnStoreMinFeatures),n.setData(o.data,A)}else n._columnStoreDefaults={},void 0!==o.enableColumnStore&&(n._columnStoreDefaults.enableColumnStore=o.enableColumnStore),void 0!==o.columnSchema&&(n._columnStoreDefaults.columnSchema=o.columnSchema),void 0!==o.columnStoreAutoDetect&&(n._columnStoreDefaults.autoDetect=o.columnStoreAutoDetect),void 0!==o.columnStoreMinFeatures&&(n._columnStoreDefaults.minFeatures=o.columnStoreMinFeatures);return n.matrixNeedsUpdate=!1,n.materialNeedsUpdate=!1,n.visibleNeedsUpdate=!1,n.animateNeedsUpdate=!1,n}return z(e,je),C(e,[{key:"visible",get:function(){return this._visible},set:function(e){void 0===this._visible&&(this._visible=!0),this.visibleNeedsUpdate=!0,this._visible=e&&!0}},{key:"map",get:function(){return this._map},set:function(e){var t=this;if(e){this._map=e;var i=function(e){var i,n;t.texture=e,t.overtimeInstanceIndex=[],t.data=[];var a=null===(i=t.parent)||void 0===i||null===(n=i.engine)||void 0===n?void 0:n.textureBus;a?a.publishTexture(e).then((function(e){var i=e.ref;t.textureRef=i,t.materialNeedsUpdate=!0})).catch((function(e){console.warn("[Shape] publishTexture failed, fallback to base64",e),t.materialNeedsUpdate=!0})):t.materialNeedsUpdate=!0};lt(e)?i(e):ot(e,(function(e){e&&i(e)}))}}},{key:"animate",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!e.to)return!1;var t=e.from,i=void 0===t?{}:t,n=e.to,a=void 0===n?{}:n,r=e.duration,o=void 0===r?3e3:r,s=e.easing,l=void 0===s?"Linear":s,u=e.loop,c=void 0!==u&&u,d=e.yoyo,h=void 0!==d&&d,f=e.stayEnd,p=void 0===f||f;i.position||delete i.position,i.rotation||delete i.rotation,i.scale||delete i.scale,a.position||delete a.position,a.rotation||delete a.rotation,a.scale||delete a.scale,a.animateOffset||delete a.animateOffset,this.animateNeedsUpdate=!0,this.animateJson={Status:"play",From:i,To:a,Duration:o,Easing:l,Loop:c,Yoyo:h,StayEnd:p};var m=new v.Tween({ratio:0}).to({ratio:1},e.duration||3e3).start();return c&&m.repeat(1/0),this.tween=null,this.tween=m,this.tween}},{key:"stopAnimate",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1e3;this.animateNeedsUpdate=!0,this.animateJson={Status:"stop",DelayTime:e},this.tween&&this.tween.stop(),this.tween=null}},{key:"setData",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e)return this.data=null,this._rawGeoJson=null,void(this._dataDirty=!1);this._columnStoreOptions=_(_({},this._columnStoreDefaults||{}),t||{});var i=et(e);if(i.length<1)return!1;var n=i[0].geometry.type.toLowerCase();if(this.isInstance&&["point","multipoint"].indexOf(n)<0)return!1;if(this._geometryType=n,this.isInstance){var a=nt(i),r=function(e,t){if(!e||e.length<1)return{data:t,datas:t,overtimeInstanceIndex:[]};for(var i=[],n=[],a=[],r=[],o=0;o<e.length;o++){for(var s,l=e[o],u=l.geometry,c=l.properties,d=void 0===c?{}:c,h=u.coordinates,f=d.rotation,p=void 0===f?{x:0,y:0,z:0}:f,m=d.scale,g=void 0===m?{x:1,y:1,z:1}:m,v=!1,y=function(){var e=t[b],n=e.geometry,a=e.properties,o=void 0===a?{}:a,s=n.coordinates,l=o.rotation,u=void 0===l?{x:0,y:0,z:0}:l,c=o.scale,d=void 0===c?{x:1,y:1,z:1}:c;return h.length===s.length&&h.every((function(e,t){return e===s[t]}))?p.x!==u.x||p.y!==u.y||p.z!==u.z||g.x!==d.x||g.y!==d.y||g.z!==d.z||i.indexOf(b)>-1?0:(i.push(b),v=!0,r.push(t[b]),1):0},b=0;b<t.length&&(0===(s=y())||1!==s);b++);v||n.push(o)}for(var x=0;x<t.length;x++)i.indexOf(x)<0&&(a.push(t[x]),r.push(t[x]));return{data:a,overtimeInstanceIndex:n,datas:r}}(this.datas,a),o=r.data,s=r.overtimeInstanceIndex,l=r.datas;return(o.length>0||s.length>0)&&(this.datas=l,this.data=o,this.overtimeInstanceIndex=s,this.materialNeedsUpdate=!0),void(this._dataDirty=!1)}this._rawGeoJson=e,this._dataDirty=!0,this.data=null}},{key:"_resolveJsonData",value:function(){var e;if(!this._dataDirty)return this.data;if(!this._rawGeoJson)return this.data;var t,i=null===(e=this.parent)||void 0===e?void 0:e.engine,n=this._columnStoreOptions||{},a=_({enableColumnStore:void 0!==n.enableColumnStore?n.enableColumnStore:!(null==i||!i.enablePropertyColumnar),columnSchema:n.columnSchema||(null==i?void 0:i.propertyColumnSchema)||void 0,autoDetect:!1!==n.autoDetect},void 0!==n.minFeatures?{minFeatures:n.minFeatures}:{});switch(this._geometryType){case"point":case"multipoint":t=nt(this._rawGeoJson,_(_({},a),this._getPointEncodeOptions()));break;case"linestring":case"multilinestring":t=it(this._rawGeoJson,!1,_(_({},a),this._getLineEncodeOptions()));break;case"polygon":case"multipolygon":t=tt(this._rawGeoJson);break;default:t=null}return this.data=t,this._dataDirty=!1,this.data}},{key:"_getLineEncodeOptions",value:function(){return{}}},{key:"_getPointEncodeOptions",value:function(){return{}}},{key:"toJSON",value:function(){var e,t,i,n,a=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return!this.visibleNeedsUpdate||!a||this.visible&&this.materialNeedsUpdate?{Color:{r:this.color.r,g:this.color.g,b:this.color.b,a:this.opacity},Brightness:this.brightness,Metallic:this.metallic,Roughness:this.roughness,Opacity:this.opacity,Transparent:this.transparent,DepthTest:this.depthTest,Scroll:this.scroll,Speed:this.speed,Texture:null!==(e=this.parent)&&void 0!==e&&null!==(t=e.engine)&&void 0!==t&&t.enableTextureBus&&this.textureRef?null:this.texture,TextureRef:null!==(i=this.parent)&&void 0!==i&&null!==(n=i.engine)&&void 0!==n&&n.enableTextureBus&&this.textureRef?this.textureRef:null,GardientDirection:this.gardientDirection,RotateSpeed:this.uvRotateSpeed,ScaleAnimateSpeed:this.WPOScaleAnimateSpeed,MinAnimateScale:this.WPOMinAnimateScale,MaxAnimateScale:this.WPOMaxAnimateScale,Color2:{r:this.color2.r,g:this.color2.g,b:this.color2.b,a:this.opacity},BrightnessColor:this.brightnessColor?{r:this.brightnessColor.r,g:this.brightnessColor.g,b:this.brightnessColor.b,a:1}:u,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,animateNeedsUpdate:!this.isInstance&&this.animateNeedsUpdate,visible:this.visible,type:this.type,name:this.name,uuid:this.uuid,jsondata:!a||this.isInstance?this._resolveJsonData():null,AnimateJson:this.animateNeedsUpdate?this.animateJson:null,Size:this.size,SizeAttenuation:this.sizeAttenuation,RenderNum:this.renderNum,ChildIndex:this.isInstance?-1:this.childIndex,IsInstance:this.isInstance,OvertimeInstanceIndex:this.overtimeInstanceIndex}:{matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},type:this.type,name:this.name,uuid:this.uuid,ChildIndex:this.childIndex}}},{key:"dispose",value:function(){var e,t;this.textureRef&&null!==(e=this.parent)&&void 0!==e&&null!==(t=e.engine)&&void 0!==t&&t.textureBus&&(this.parent.engine.textureBus.releaseTexture(this.textureRef),this.textureRef=null),this.traverse((function(e){e.geometry&&e.geometry.dispose(),e.material&&e.material.dispose(),e.texture=null})),this.data=null,this.datas=null,this.texture=null}},{key:"copy",value:function(t){var i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return this.color.copy(t.color),this.brightness=t.brightness,this.metallic=t.metallic,this.roughness=t.roughness,this.opacity=t.opacity,this.transparent=t.transparent,this.texture=t.texture,this.brightnessColor.copy(t.brightnessColor),this.offset.copy(t.offset),F(e,"copy",this)([t,i]),this}}])}();var yt=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};U(this,e),(t=N(this,e,[i])).type="Polygon";var n=i.fillStyle||"Empty",a=void 0===i.speedX?.25:i.speedX,r=void 0===i.speedY?.25:i.speedY,o=void 0===i.rotateAngle?0:i.rotateAngle,s=void 0===i.tile?.5:i.tile;return Object.defineProperties(t,{fillStyle:{configurable:!0,enumerable:!0,get:function(){return n},set:function(e){e&&(n=e,t.materialNeedsUpdate=!0)}},rotateAngle:{configurable:!0,enumerable:!0,get:function(){return o},set:function(e){e&&(o=e,t.materialNeedsUpdate=!0)}},tile:{configurable:!0,enumerable:!0,get:function(){return s},set:function(e){e&&(s=e,t.materialNeedsUpdate=!0)}},speedX:{configurable:!0,enumerable:!0,get:function(){return a},set:function(e){e&&(a=e,t.materialNeedsUpdate=!0)}},speedY:{configurable:!0,enumerable:!0,get:function(){return r},set:function(e){e&&(r=e,t.materialNeedsUpdate=!0)}}}),t}return z(e,vt),C(e,[{key:"setData",value:function(e){this.data=tt(e)}},{key:"toJSON",value:function(){var e,t,i,n,a=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return!a||!this.visibleNeedsUpdate||this.visible&&this.materialNeedsUpdate?{Color:{r:this.color.r,g:this.color.g,b:this.color.b,a:this.opacity},Brightness:this.brightness,Metallic:this.metallic,Roughness:this.roughness,Opacity:this.opacity,FillStyle:this.fillStyle,SpeedX:this.speedX,SpeedY:this.speedY,RotateAngle:this.rotateAngle,Tile:this.tile,Transparent:this.transparent,Texture:null!==(e=this.parent)&&void 0!==e&&null!==(t=e.engine)&&void 0!==t&&t.enableTextureBus&&this.textureRef?null:this.texture,TextureRef:null!==(i=this.parent)&&void 0!==i&&null!==(n=i.engine)&&void 0!==n&&n.enableTextureBus&&this.textureRef?this.textureRef:null,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},type:this.type,uuid:this.uuid,jsondata:a?null:this.data,matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,animateNeedsUpdate:this.animateNeedsUpdate,animateJson:this.animateNeedsUpdate?this.animateJson:null}:{matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},type:this.type,name:this.name,uuid:this.uuid}}}])}(),bt=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};U(this,e),(t=N(this,e,[i])).type="Line";var n=i.style||ie.SOLID,a=i.splineType||ae.LINEAR,r=i.direction||ne.CENTER,o=i.width||4,s=i.tilling||5,l=i.speed||1,u=void 0!==i.openStroke&&i.openStroke,c=i.strokeColor||null,d=i.strokeWidth||1;t.enableSimplify=void 0!==i.enableSimplify?i.enableSimplify:i.isDilution,t.simplifyTolerance=i.simplifyTolerance||i.interval||1e-5,t.visible=void 0===i.visible||i.visible,t.collision=void 0!==i.collision&&i.collision;var h={enable:!1,speedX:1,speedY:0,uvRotation:0,u:0,v:0};return i.lineUVOption&&(h.enable=void 0!==i.lineUVOption.enable&&i.lineUVOption.enable,h.speedX=void 0===i.lineUVOption.speedX?1:i.lineUVOption.speedX,h.speedY=void 0===i.lineUVOption.speedY?0:i.lineUVOption.speedY,h.uvRotation=void 0===i.lineUVOption.uvRotation?0:i.lineUVOption.uvRotation,h.u=void 0===i.lineUVOption.u?0:i.lineUVOption.u,h.v=void 0===i.lineUVOption.v?0:i.lineUVOption.v),t.renderType=void 0===i.renderType?0:i.renderType,t.section_Length=void 0===i.section_Length?100:i.section_Length,Object.defineProperties(t,{style:{configurable:!0,enumerable:!0,get:function(){return n},set:function(e){e&&(n=e,t.materialNeedsUpdate=!0)}},lineUVOption:{configurable:!0,enumerable:!0,get:function(){return h},set:function(e){e&&(h.enable=void 0!==e.enable&&e.enable,h.speedX=void 0===e.speedX?1:e.speedX,h.speedY=void 0===e.speedY?0:e.speedY,h.uvRotation=void 0===e.uvRotation?0:e.uvRotation,h.u=void 0===e.u?0:e.u,h.v=void 0===e.v?0:e.v,t.materialNeedsUpdate=!0)}},splineType:{configurable:!0,enumerable:!0,get:function(){return a},set:function(e){e&&(a=e,t.materialNeedsUpdate=!0)}},direction:{configurable:!0,enumerable:!0,get:function(){return r},set:function(e){e&&(r=e,t.materialNeedsUpdate=!0)}},width:{configurable:!0,enumerable:!0,get:function(){return o},set:function(e){e&&(o=e,t.materialNeedsUpdate=!0)}},tilling:{configurable:!0,enumerable:!0,get:function(){return s},set:function(e){e&&(s=e,t.materialNeedsUpdate=!0)}},speed:{configurable:!0,enumerable:!0,get:function(){return l},set:function(e){e&&(l=e,t.materialNeedsUpdate=!0)}},openStroke:{configurable:!0,enumerable:!0,get:function(){return u},set:function(e){e&&(u=e,t.materialNeedsUpdate=!0)}},strokeColor:{configurable:!0,enumerable:!0,get:function(){return c},set:function(e){e&&(c.r=e.r,c.g=e.g,c.b=e.b,c.a=e.a?e.a:1,t.materialNeedsUpdate=!0)}},strokeWidth:{configurable:!0,enumerable:!0,get:function(){return d},set:function(e){e&&(d=e,t.materialNeedsUpdate=!0)}}}),t}return z(e,vt),C(e,[{key:"_getLineEncodeOptions",value:function(){return{enableDP:!1!==this.enableSimplify,dpThreshold:this.simplifyTolerance}}},{key:"updataLineColor",value:function(e){var t=this._resolveJsonData()||this.data,i=Array.isArray(t)?t.length:null==t?void 0:t.count;Array.isArray(e)&&e.length===i&&(this.colordata=e,this.materialNeedsUpdate=!0)}},{key:"toJSON",value:function(){var e,t,i,n,a=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return!a||!this.visibleNeedsUpdate||this.visible&&this.materialNeedsUpdate?{Color:{r:this.color.r,g:this.color.g,b:this.color.b,a:this.opacity},Brightness:this.brightness,Metallic:this.metallic,Roughness:this.roughness,Opacity:this.opacity,Transparent:this.transparent,Collision:this.collision,Texture:null!==(e=this.parent)&&void 0!==e&&null!==(t=e.engine)&&void 0!==t&&t.enableTextureBus&&this.textureRef?null:this.texture,TextureRef:null!==(i=this.parent)&&void 0!==i&&null!==(n=i.engine)&&void 0!==n&&n.enableTextureBus&&this.textureRef?this.textureRef:null,BloomColor:this.bloomColor?{r:this.bloomColor.r,g:this.bloomColor.g,b:this.bloomColor.b,a:1}:null,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,type:this.type,uuid:this.uuid,jsondata:a?null:this._resolveJsonData(),Style:this.style,Spline_Type:this.splineType,MeshDirection:this.direction,RenderType:this.renderType,Section_Length:this.section_Length,Width:this.width,Tilling:this.tilling,Speed:this.speed,Open_Stroke:this.openStroke,Stroke_Color:this.strokeColor?{r:this.strokeColor.r,g:this.strokeColor.g,b:this.strokeColor.b,a:1}:null,Stroke_Width:this.strokeWidth,animateNeedsUpdate:this.animateNeedsUpdate,animateJson:this.animateNeedsUpdate?this.animateJson:null,LineUVOption:this.lineUVOption,colordata:this.colordata}:{matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},type:this.type,name:this.name,uuid:this.uuid}}},{key:"copy",value:function(t){var i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return this.style=t.style,this.splineType=t.splineType,this.direction=t.direction,this.width=t.width,this.tilling=t.tilling,this.speed=t.speed,this.openStroke=t.openStroke,this.strokeColor=t.strokeColor,this.strokeWidth=t.strokeWidth,F(e,"copy",this)([t,i]),this}}])}(),xt=function(){function e(){var i,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};U(this,e),i=N(this,e,[n]);var a=n.size||4;return i.type="Point",Object.defineProperties(i,{size:{configurable:!0,enumerable:!0,get:function(){return a},set:function(e){(a=Number(e))&&(i.scale=new t(a,a,a),i.matrixNeedsUpdate=!0)}}}),i}return z(e,vt),C(e,[{key:"setData",value:function(e){this.data=nt(e)}},{key:"toJSON",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return!e||!this.visibleNeedsUpdate||this.visible&&this.materialNeedsUpdate?{Color:{r:this.color.r,g:this.color.g,b:this.color.b,a:this.opacity},Brightness:this.brightness,Metallic:this.metallic,Roughness:this.roughness,Opacity:this.opacity,Transparent:this.transparent,Texture:this.texture,BloomColor:this.bloomColor?{r:this.bloomColor.r,g:this.bloomColor.g,b:this.bloomColor.b,a:1}:null,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},type:this.type,uuid:this.uuid,jsondata:e?null:this.data,matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,Size:this.size,animateNeedsUpdate:this.animateNeedsUpdate,animateJson:this.animateNeedsUpdate?this.animateJson:null}:{matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},type:this.type,name:this.name,uuid:this.uuid}}},{key:"copy",value:function(t){var i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return this.size=t.size,F(e,"copy",this)([t,i]),this}}])}(),St=function(){function e(t){var i;return U(this,e),(i=N(this,e,[t])).type="Cube",i}return z(e,vt),C(e)}(),wt=function(){return C((function e(t){U(this,e),this.cloudRender=t,this.explodeDistance=3}),[{key:"setRadius",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3;this.explodeDistance=e}},{key:"explodeAll",value:function(e){this.cloudRender.emitUIInteraction({excuteName:"Application_explodeControl",params:{Group:e,Action:"ExplodeAll",ExplodeDistance:100*this.explodeDistance}})}},{key:"resetAll",value:function(e){this.cloudRender.emitUIInteraction({excuteName:"Application_explodeControl",params:{Group:e,Action:"ResetAll"}})}},{key:"explodePercent",value:function(e,t){this.cloudRender.emitUIInteraction({excuteName:"Application_explodeControl",params:{Group:e,Percent:t,Action:"ExplodePercent",ExplodeDistance:100*this.explodeDistance}})}},{key:"explodePart",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0;this.cloudRender.emitUIInteraction({excuteName:"Application_explodeControl",params:{Group:e,ChildIds:t,PartList:i,Action:"ExplodePart",ExplodeDistance:100*this.explodeDistance}})}},{key:"resetPart",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0;this.cloudRender.emitUIInteraction({excuteName:"Application_explodeControl",params:{Group:e,ChildIds:t,PartList:i,Action:"ResetPart"}})}}])}(),Nt=function(){return C((function e(t){U(this,e),this.cloudRender=t}),[{key:"highlight",value:function(e){this.cloudRender.emitUIInteraction({excuteName:"Interact_L3ModelControl",params:{HighlightModels:e}})}},{key:"resetHighlight",value:function(e){this.highlight(e.map((function(e){return{Id:e,Reset:!0}})))}},{key:"setOpacity",value:function(e){this.cloudRender.emitUIInteraction({excuteName:"Interact_L3ModelControl",params:{OpacityModels:e}})}},{key:"resetOpacity",value:function(e){this.setOpacity(e.map((function(e){return{Id:e,Reset:!0}})))}},{key:"setOutLine",value:function(e,t){var i={OutLineModels:e};t&&(i.OutLineEffect=t),this.cloudRender.emitUIInteraction({excuteName:"Interact_L3ModelControl",params:i})}},{key:"resetOutLine",value:function(e){this.setOutLine(e.map((function(e){return{Id:e,Reset:!0}})))}},{key:"hide",value:function(e){this.cloudRender.emitUIInteraction({excuteName:"Interact_L3ModelControl",params:{HiddenModels:e.map((function(e){return{Id:e,Reset:!1}}))}})}},{key:"show",value:function(e){this.cloudRender.emitUIInteraction({excuteName:"Interact_L3ModelControl",params:{HiddenModels:e.map((function(e){return{Id:e,Reset:!0}}))}})}},{key:"reset",value:function(e){this.cloudRender.emitUIInteraction({excuteName:"Interact_L3ModelControl",params:{ResetModels:e.map((function(e){return{Id:e}}))}})}}])}(),Ut=function(){return C((function e(t){U(this,e),this.cloudRender=t}),[{key:"control",value:function(e){this.cloudRender.emitUIInteraction({excuteName:"Application_skeletonAnimControl",params:{SkeletonModelList:e}})}},{key:"play",value:function(e){this.control(e.map((function(e){return{Id:e,EnableAnim:!0}})))}},{key:"stop",value:function(e){this.control(e.map((function(e){return{Id:e,EnableAnim:!1}})))}}])}(),kt=function(){return C((function e(t){U(this,e),this.cloudRender=t}),[{key:"update",value:function(e){this.cloudRender.emitUIInteraction({excuteName:"Application_waterSimulation",params:{WaterPlane:e}})}}])}(),Ct=["Plane","Box"],Tt=["Gizmo","Direct"],Rt=["TRANSLATE","ROTATE"],Ot=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return U(this,e),(t=N(this,e)).type="ModelSlice",t._shape=Ct.includes(i.shape)?i.shape:"Plane",t._mode=Tt.includes(i.mode)?i.mode:"Gizmo",t._gizmoType=Rt.includes(i.gizmoType)?i.gizmoType:"TRANSLATE",t._origin=i.origin||null,t._size=i.size||null,t._rotation=i.rotation||{Pitch:0,Yaw:0,Roll:0},t.materialNeedsUpdate=!1,t.matrixNeedsUpdate=!1,t}return z(e,je),C(e,[{key:"shape",get:function(){return this._shape}},{key:"mode",get:function(){return this._mode},set:function(e){Tt.includes(e)?e!==this._mode&&(this._mode=e,this.materialNeedsUpdate=!0):console.warn("[ModelSlice] mode must be 'Gizmo' or 'Direct', got '".concat(e,"'"))}},{key:"gizmoType",get:function(){return this._gizmoType},set:function(e){Rt.includes(e)?e!==this._gizmoType&&(this._gizmoType=e,this.materialNeedsUpdate=!0):console.warn("[ModelSlice] gizmoType must be 'TRANSLATE' or 'ROTATE', got '".concat(e,"'"))}},{key:"origin",get:function(){return this._origin},set:function(e){this._origin=e,this.materialNeedsUpdate=!0}},{key:"size",get:function(){return this._size},set:function(e){this._size=e,this.materialNeedsUpdate=!0}},{key:"sliceRotation",get:function(){return this._rotation},set:function(e){this._rotation=e,this.materialNeedsUpdate=!0}},{key:"dispose",value:function(){return!1}},{key:"toJSON",value:function(){var e={Enable:!0,Shape:this._shape,Mode:this._mode};"Gizmo"===this._mode&&(e.GizmoConfig={GizmoType:this._gizmoType});var t="Box"===this._shape?"BoxConfig":"PlaneConfig";return this._origin&&this._size&&(e[t]={Origin:this._origin,Size:this._size,Rotation:this._rotation}),e}}])}(),Et=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};U(this,e),(t=N(this,e,[i])).type="MeasureArea";var n=void 0===i.textDisplay||i.textDisplay,a=i.textColor||new u(1,0,0),r=i.fontSize||18,o=i.textBorderColor||new u(1,0,0),s=i.textBorderWidth||1;return Object.defineProperties(t,{textDisplay:{configurable:!0,enumerable:!0,get:function(){return n},set:function(e){e&&(n=e)}},fontSize:{configurable:!0,enumerable:!0,get:function(){return r},set:function(e){e&&(r=e)}},textColor:{configurable:!0,enumerable:!0,get:function(){return a},set:function(e){e&&(a.r=e.r,a.g=e.g,a.b=e.b)}},textBorderWidth:{configurable:!0,enumerable:!0,get:function(){return s},set:function(e){e&&(s=e)}},textBorderColor:{configurable:!0,enumerable:!0,get:function(){return o},set:function(e){e&&(o.r=e.r,o.g=e.g,o.b=e.b)}}}),t}return z(e,vt),C(e,[{key:"updateParameters",value:function(e){for(var t in e)this[t]!==e[t]&&(this[t]=e[t])}},{key:"toJSON",value:function(){return(!(arguments.length>0&&void 0!==arguments[0])||arguments[0])&&this.visibleNeedsUpdate&&!this.materialNeedsUpdate?{matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,type:this.type,name:this.name,uuid:this.uuid}:{Color:{r:this.color.r,g:this.color.g,b:this.color.b,a:this.opacity},Brightness:this.brightness,Metallic:this.metallic,Roughness:this.roughness,Opacity:this.opacity,Transparent:this.transparent,Texture:this.texture,BloomColor:this.bloomColor?{r:this.bloomColor.r,g:this.bloomColor.g,b:this.bloomColor.b,a:1}:null,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},type:this.type,uuid:this.uuid,matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,FontSize:this.fontSize,TextDisplay:this.textDisplay,TextColor:{r:this.textColor.r,g:this.textColor.g,b:this.textColor.b,a:1},TextBorderColor:{r:this.textBorderColor.r,g:this.textBorderColor.g,b:this.textBorderColor.b,a:1},TextBorderWidth:this.textBorderWidth,animateNeedsUpdate:this.animateNeedsUpdate,animateJson:this.animateNeedsUpdate?this.animateJson:null}}},{key:"copy",value:function(t){var i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return this.fontSize=t.fontSize,this.textDisplay=t.textDisplay,this.textColor=t.textColor,this.textBorderColor=t.textBorderColor,this.textBorderWidth=t.textBorderWidth,F(e,"copy",this)([t,i]),this}}])}(),zt=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};U(this,e),(t=N(this,e,[i])).type="MeasureLine";var n=i.style||ie.SOLID,a=i.splineType||ae.LINEAR,r=i.direction||ne.CENTER,o=i.width||4,s=i.tilling||300,l=i.speed||1,c=void 0!==i.openStroke&&i.openStroke,d=i.strokeColor||null,h=i.strokeWidth||1,f=void 0===i.textDisplay||i.textDisplay,p=i.textColor||new u(1,0,0),m=i.fontSize||18,g=i.textBorderColor||new u(1,0,0),v=i.textBorderWidth||1;return Object.defineProperties(t,{style:{configurable:!0,enumerable:!0,get:function(){return n},set:function(e){e&&(n=e)}},splineType:{configurable:!0,enumerable:!0,get:function(){return a},set:function(e){e&&(a=e)}},direction:{configurable:!0,enumerable:!0,get:function(){return r},set:function(e){e&&(r=e)}},width:{configurable:!0,enumerable:!0,get:function(){return o},set:function(e){e&&(o=e)}},tilling:{configurable:!0,enumerable:!0,get:function(){return s},set:function(e){e&&(s=e)}},speed:{configurable:!0,enumerable:!0,get:function(){return l},set:function(e){e&&(l=e)}},openStroke:{configurable:!0,enumerable:!0,get:function(){return c},set:function(e){e&&(c=e)}},strokeColor:{configurable:!0,enumerable:!0,get:function(){return d},set:function(e){e&&(d.r=e.r,d.g=e.g,d.b=e.b,d.a=e.a?e.a:1)}},strokeWidth:{configurable:!0,enumerable:!0,get:function(){return h},set:function(e){e&&(h=e)}},textDisplay:{configurable:!0,enumerable:!0,get:function(){return f},set:function(e){e&&(f=e)}},fontSize:{configurable:!0,enumerable:!0,get:function(){return m},set:function(e){e&&(m=e)}},textColor:{configurable:!0,enumerable:!0,get:function(){return p},set:function(e){e&&(p.r=e.r,p.g=e.g,p.b=e.b)}},textBorderWidth:{configurable:!0,enumerable:!0,get:function(){return v},set:function(e){e&&(v=e)}},textBorderColor:{configurable:!0,enumerable:!0,get:function(){return g},set:function(e){e&&(g.r=e.r,g.g=e.g,g.b=e.b)}}}),t}return z(e,vt),C(e,[{key:"updateParameters",value:function(e){for(var t in e)this[t]!==e[t]&&(this[t]=e[t])}},{key:"toJSON",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return!e||!this.visibleNeedsUpdate||this.visible&&this.materialNeedsUpdate?{Color:{r:this.color.r,g:this.color.g,b:this.color.b,a:this.opacity},Brightness:this.brightness,Metallic:this.metallic,Roughness:this.roughness,Opacity:this.opacity,Transparent:this.transparent,Texture:this.texture,BloomColor:this.bloomColor?{r:this.bloomColor.r,g:this.bloomColor.g,b:this.bloomColor.b,a:1}:null,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,type:this.type,uuid:this.uuid,jsondata:e?null:this._resolveJsonData(),Style:this.style,Spline_Type:this.splineType,MeshDirection:this.direction,Width:this.width,Tilling:this.tilling,Speed:this.speed,Open_Stroke:this.openStroke,Stroke_Color:this.strokeColor?{r:this.strokeColor.r,g:this.strokeColor.g,b:this.strokeColor.b,a:1}:null,Stroke_Width:this.strokeWidth,FontSize:this.fontSize,TextColor:{r:this.textColor.r,g:this.textColor.g,b:this.textColor.b,a:1},TextDisplay:this.textDisplay,TextBorderColor:{r:this.textBorderColor.r,g:this.textBorderColor.g,b:this.textBorderColor.b,a:1},TextBorderWidth:this.textBorderWidth}:{matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},type:this.type,name:this.name,uuid:this.uuid}}},{key:"copy",value:function(t){var i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return this.style=t.style,this.splineType=t.splineType,this.direction=t.direction,this.width=t.width,this.tilling=t.tilling,this.speed=t.speed,this.openStroke=t.openStroke,this.strokeColor=t.strokeColor,this.strokeWidth=t.strokeWidth,this.fontSize=t.fontSize,this.textColor=t.textColor,this.textDisplay=t.textDisplay,this.textBorderColor=t.textBorderColor,this.textBorderWidth=t.textBorderWidth,F(e,"copy",this)([t,i]),this}}])}(),It=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};U(this,e),(t=N(this,e,[i])).type="SurfaceLine";var n=i.rayDistance||100,a=i.width||4,r=i.rayDetectionDistance||500,o=i.textColor||new u(1,0,0),s=i.fontSize||18,l=i.linePixel||1024;return Object.defineProperties(t,{width:{configurable:!0,enumerable:!0,get:function(){return a},set:function(e){e&&(a=e)}},rayDistance:{configurable:!0,enumerable:!0,get:function(){return n},set:function(e){e!==n&&(n=e)}},rayDetectionDistance:{configurable:!0,enumerable:!0,get:function(){return r},set:function(e){e!==r&&(r=e)}},linePixel:{configurable:!0,enumerable:!0,get:function(){return l},set:function(e){e!==l&&(l=e)}},fontSize:{configurable:!0,enumerable:!0,get:function(){return s},set:function(e){e&&(s=e)}},textColor:{configurable:!0,enumerable:!0,get:function(){return o},set:function(e){e&&(o.r=e.r,o.g=e.g,o.b=e.b)}}}),t}return z(e,vt),C(e,[{key:"updateParameters",value:function(e){for(var t in e)this[t]!==e[t]&&(this[t]=e[t])}},{key:"toJSON",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return!e||!this.visibleNeedsUpdate||this.visible&&this.materialNeedsUpdate?{Color:{r:this.color.r,g:this.color.g,b:this.color.b,a:this.opacity},Brightness:this.brightness,Metallic:this.metallic,Roughness:this.roughness,Opacity:this.opacity,Transparent:this.transparent,Texture:this.texture,BloomColor:this.bloomColor?{r:this.bloomColor.r,g:this.bloomColor.g,b:this.bloomColor.b,a:1}:null,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,type:this.type,uuid:this.uuid,jsondata:e?null:this._resolveJsonData(),Style:"solid",Spline_Type:"Curve",MeshDirection:"Ground_Center",Width:this.width,FontSize:this.fontSize,TextColor:{r:this.textColor.r,g:this.textColor.g,b:this.textColor.b,a:1},LinePixel:this.linePixel}:{matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},type:this.type,name:this.name,uuid:this.uuid}}},{key:"copy",value:function(t){var i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return this.style="solid",this.splineType="Curve",this.direction="Ground_Center",this.width=t.width,this.fontSize=t.fontSize,this.textColor=t.textColor,this.textDisplay=t.textDisplay,this.textBorderColor=t.textBorderColor,this.textBorderWidth=t.textBorderWidth,F(e,"copy",this)([t,i]),this}}])}(),At=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};U(this,e),(t=N(this,e,[i])).type="LocationPoint",t.EPSG=i.EPSG||"epsg:4326";var n=i.textColor||new u(1,0,0),a=i.fontSize||18,r=i.textBorderColor||new u(1,0,0),o=i.textBorderWidth||1;return Object.defineProperties(t,{fontSize:{configurable:!0,enumerable:!0,get:function(){return a},set:function(e){e&&(a=e)}},textColor:{configurable:!0,enumerable:!0,get:function(){return n},set:function(e){e&&(n.r=e.r,n.g=e.g,n.b=e.b)}},textBorderWidth:{configurable:!0,enumerable:!0,get:function(){return o},set:function(e){e&&(o=e)}},textBorderColor:{configurable:!0,enumerable:!0,get:function(){return r},set:function(e){e&&(r.r=e.r,r.g=e.g,r.b=e.b)}}}),t}return z(e,vt),C(e,[{key:"updateParameters",value:function(e){for(var t in e)this[t]!==e[t]&&(this[t]=e[t])}},{key:"toJSON",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return!e||!this.visibleNeedsUpdate||this.visible&&this.materialNeedsUpdate?{Color:{r:this.color.r,g:this.color.g,b:this.color.b,a:this.opacity},Brightness:this.brightness,Metallic:this.metallic,Roughness:this.roughness,Opacity:this.opacity,Transparent:this.transparent,Texture:this.texture,BloomColor:this.bloomColor?{r:this.bloomColor.r,g:this.bloomColor.g,b:this.bloomColor.b,a:1}:null,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},type:this.type,uuid:this.uuid,jsondata:e?null:this._resolveJsonData(),matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,FontSize:this.fontSize,TextColor:{r:this.textColor.r,g:this.textColor.g,b:this.textColor.b,a:1},EPSG:this.EPSG,TextBorderColor:{r:this.textBorderColor.r,g:this.textBorderColor.g,b:this.textBorderColor.b,a:1},TextBorderWidth:this.textBorderWidth,animateNeedsUpdate:this.animateNeedsUpdate,animateJson:this.animateNeedsUpdate?this.animateJson:null}:{matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},type:this.type,name:this.name,uuid:this.uuid}}},{key:"copy",value:function(t){var i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return this.fontSize=t.fontSize,this.textColor=t.textColor,this.textBorderColor=t.textBorderColor,this.EPSG=t.EPSG,this.textBorderWidth=t.textBorderWidth,F(e,"copy",this)([t,i]),this}}])}();function _t(e){return null==e?"":"string"==typeof e?e:JSON.stringify(e)}function Mt(e){return Lt.apply(this,arguments)}function Lt(){return(Lt=w(D().mark((function e(t){var i,n;return D().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=new CompressionStream("gzip"),n=new Blob([t]).stream().pipeThrough(i),e.t0=Uint8Array,e.next=5,new Response(n).arrayBuffer();case 5:return e.t1=e.sent,e.abrupt("return",new e.t0(e.t1));case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Dt=y.create();Dt.interceptors.request.use((function(e){var t=localStorage.getItem("authToken");return t&&(e.headers.Authorization="Bearer ".concat(t)),e}),(function(e){return Promise.reject(e)})),Dt.interceptors.response.use((function(e){return e}),(function(e){return e.response&&401===e.response.status&&localStorage.removeItem("authToken"),Promise.reject(e)}));var Pt=function(){return C((function e(){U(this,e)}),null,[{key:"username",get:function(){return this._username},set:function(e){this._username=e,this._SaveToken()}},{key:"password",get:function(){return this._password},set:function(e){this._password=e,this._SaveToken()}},{key:"_SaveToken",value:function(){localStorage.setItem("authToken",btoa("".concat(this._username,":").concat(this._password)))}}])}();R(Pt,"host",""),R(Pt,"tag",""),R(Pt,"_username","admin"),R(Pt,"_password","admin"),R(Pt,"_currentProject",void 0),Pt.GetProjectCommon=w(D().mark((function e(){var t;return D().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!Pt.host){e.next=5;break}return e.next=3,Dt.get("".concat(Pt.host,"/api/configs/projects/common"));case 3:return t=e.sent,e.abrupt("return",t);case 5:console.error("请先设置Host地址");case 6:case"end":return e.stop()}}),e)}))),Pt.getProjectCommon=Pt.GetProjectCommon,Pt.GetProjectByNodeId=function(){var e=w(D().mark((function e(t){var i;return D().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!Pt.host){e.next=5;break}return e.next=3,Dt.get("".concat(Pt.host,"/api/configs/projects/").concat(t));case 3:return i=e.sent,e.abrupt("return",i);case 5:console.error("请先设置Host地址");case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Pt.getProjectByNodeId=Pt.GetProjectByNodeId,Pt.GetAllCapacity=w(D().mark((function e(){var t;return D().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!Pt.host){e.next=5;break}return e.next=3,Dt.get("".concat(Pt.host,"/api/nodes/capacity"));case 3:return t=e.sent,e.abrupt("return",t.data.data[""===Pt.tag?"all":Pt.tag]);case 5:case"end":return e.stop()}}),e)}))),Pt.getAllCapacity=Pt.GetAllCapacity,Pt.GetAllCapacityInfo=w(D().mark((function e(){var t;return D().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!Pt.host){e.next=5;break}return e.next=3,Dt.get("".concat(Pt.host,"/api/nodes/capacity"));case 3:return t=e.sent,e.abrupt("return",t.data.data);case 5:case"end":return e.stop()}}),e)}))),Pt.getAllCapacityInfo=Pt.GetAllCapacityInfo,Pt.GetAllNodes=w(D().mark((function e(){var t;return D().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!Pt.host){e.next=5;break}return e.next=3,Dt.get("".concat(Pt.host,"/api/nodes/all"));case 3:return t=e.sent,e.abrupt("return",t);case 5:case"end":return e.stop()}}),e)}))),Pt.getAllNodes=Pt.GetAllNodes,Pt.GetAliveNodes=w(D().mark((function e(){var t;return D().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!Pt.host){e.next=5;break}return e.next=3,Dt.get("".concat(Pt.host,"/api/nodes/list"));case 3:return t=e.sent,e.abrupt("return",t);case 5:case"end":return e.stop()}}),e)}))),Pt.getAliveNodes=Pt.GetAliveNodes,Pt.CreateTask=function(){var e=w(D().mark((function e(t){var i,n;return D().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=Pt.tag||"",e.next=3,Dt.post("".concat(Pt.host,"/api/tasks/create"),{project:t,tag:"all"===i?"":i});case 3:return n=e.sent,Pt._currentProject=n.data,e.abrupt("return",n.data);case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Pt.createTask=Pt.CreateTask,Pt.KillTask=function(){var e=w(D().mark((function e(t){var i;return D().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!Pt.host){e.next=6;break}return e.next=3,Dt.post("".concat(Pt.host,"/api/tasks/kill/").concat(t));case 3:return i=e.sent,Pt._currentProject=null,e.abrupt("return",i);case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Pt.killTask=Pt.KillTask,Pt._SaveToken(),"undefined"==typeof ue&&(window.ue={});var Bt=window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.requestAnimationFrame,Ft=function(){function e(t){var i;U(this,e),(i=N(this,e)).type="CloudRenderEngine",i.controllers=(null==t?void 0:t.controllers)||{};var n=!0===(null==t?void 0:t.enableV2),a=!0===(null==t?void 0:t.enableSoftPriorityQueues)||!0===(null==t?void 0:t.enableDedicatedChannels),r=function(e,t){return!0===e||!1===e?e:t};i.enableV2Protocol=r(null==t?void 0:t.enableV2Protocol,n),i.enableTextureBus=r(null==t?void 0:t.enableTextureBus,n),i.enableAckV2=r(null==t?void 0:t.enableAckV2,n),i.enableV2Fallback=r(null==t?void 0:t.enableV2Fallback,n),i.enableBulkChannel=r(null==t?void 0:t.enableBulkChannel,a),i.enableTextureChannel=r(null==t?void 0:t.enableTextureChannel,a),i.enablePropertyColumnar=r(null==t?void 0:t.enablePropertyColumnar,n)&&i.enableV2Protocol,i.propertyColumnSchema=null!=t&&t.propertyColumnSchema&&"object"===G(t.propertyColumnSchema)?t.propertyColumnSchema:null,i.enableNackRetransmit=r(null==t?void 0:t.enableNackRetransmit,n)&&i.enableAckV2,i.maxNackRetries="number"==typeof(null==t?void 0:t.maxNackRetries)?t.maxNackRetries:2,i.bulkChannelThreshold="number"==typeof(null==t?void 0:t.bulkChannelThreshold)?t.bulkChannelThreshold:32768,i.dataChannelHighWatermark="number"==typeof(null==t?void 0:t.dataChannelHighWatermark)?t.dataChannelHighWatermark:4194304,i.bulkYieldEveryNChunks="number"==typeof(null==t?void 0:t.bulkYieldEveryNChunks)?Math.max(0,0|t.bulkYieldEveryNChunks):4,i._v2SeqId=0,i.textureBus=i.enableTextureBus?new Re(i,{maxBytes:null==t?void 0:t.textureBusMaxBytes}):null,i._v3Metrics={textureChannelBytes:0,fallbackCount:0,v2ErrorCount:0,ackOkCount:0,ackNackCount:0,ackTimeoutCount:0,nackRetransmitCount:0,nackRetransmitGiveUpCount:0},i._sentChunks=new Map,i._sentChunksMaxSize="number"==typeof(null==t?void 0:t.sentChunksMaxSize)?t.sentChunksMaxSize:1024,i._sentChunksTtlMs="number"==typeof(null==t?void 0:t.sentChunksTtlMs)?t.sentChunksTtlMs:3e4,i._sentChunksWriteCount=0,i._pendingAcks=new Map,i._defaultAckTimeoutMs="number"==typeof(null==t?void 0:t.defaultAckTimeoutMs)?t.defaultAckTimeoutMs:3e4,i.kbEvent=document.createEvent("KeyboardEvent"),i.initMethod=void 0!==i.kbEvent.initKeyboardEvent?"initKeyboardEvent":"initKeyEvent",i.webRtcPlayerObj=null,i.forceTURN=void 0!==t.forceTURN&&t.forceTURN,i.printStats=(null==t?void 0:t.printStats)||!1,i.printInputs=(null==t?void 0:t.printInputs)||!1,i.connectOnLoad=(null==t?void 0:t.connectOnLoad)||!0,i.isReconnection=(null==t?void 0:t.isReconnection)||!1,i.ws,i.wsURL=null==t?void 0:t.wsUrl,i.projectName=void 0===t.projectName?"default":t.projectName,i.renderMode=(null==t?void 0:t.renderMode)||"cloud",i.matchmakerIP=null==t?void 0:t.matchmakerIP,i.matchmakerPort=(null==t?void 0:t.matchmakerPort)||"90",i.scene=new He,i.scene.engine=i,i.qualityController=!1,i.qualityControlOwnershipCheckBox,i.matchViewportResolution=(null==t?void 0:t.matchViewportResolution)||!1,i.resolution=(null==t?void 0:t.resolution)||[0,0],i.resizeTimeout=null,i.onDataChannelConnected,i.webRtcConnectionStatsCallback=null,i.lastPacketsLost=0;var o=(null==t?void 0:t.inputOptions)||{},s=o.controlScheme,l=void 0===s?se.controlScheme:s,u=o.suppressBrowserKeys,c=void 0===u?se.suppressBrowserKeys:u,d=o.fakeMouseWithTouches,h=void 0===d?se.fakeMouseWithTouches:d;return i.inputOptions={controlScheme:l,suppressBrowserKeys:c,fakeMouseWithTouches:h},i.eventHandler=new xe(i),i.freezeFrameOverlay=null,i.shouldShowPlayOverlay=null==t?void 0:t.shouldShowPlayOverlay,i.freezeFrame={receiving:!1,size:0,jpeg:void 0,height:0,width:0,valid:!1},i.file={mimetype:"",extension:"",receiving:!1,size:0,data:[],valid:!1,timestampStart:void 0},i.afk=(null==t?void 0:t.afk)||{enabled:!1,warnTimeout:120,closeTimeout:10,active:!1,overlay:void 0,warnTimer:void 0,countdown:0,countdownTimer:void 0},i.editTextButton=void 0,i.hiddenInput=void 0,i.t0=Date.now(),i.dataTransferFrequence=20,i.streamTrackSource=null,i.videoEncoderQP="N/A",i.udsParams=(null==t?void 0:t.udsParams)||{},i.UDS,i.isSequencer=void 0!==(null==t?void 0:t.isSequencer)&&(null==t?void 0:t.isSequencer),i.styleWidth,i.styleHeight,i.styleTop,i.styleLeft,i.styleCursor=(null==t?void 0:t.styleCursor)||"default",i.styleAdditional,i._orientationChangeTimeout,i.playerElementClientRect=void 0,i.normalizeAndQuantizeUnsigned=void 0,i.normalizeAndQuantizeSigned=void 0,i.isShowTestUI=null==t?void 0:t.isShowTestUI,setTimeout((function(){i.interval(i.dataTransferFrequence)}),1e3),"inner"===i.renderMode&&i._preInitInnerMode(),i}return z(e,be),C(e,[{key:"explodeControl",get:function(){return this._explodeControl||(this._explodeControl=new wt(this)),this._explodeControl}},{key:"l3ModelControl",get:function(){return this._l3ModelControl||(this._l3ModelControl=new Nt(this)),this._l3ModelControl}},{key:"skeletonAnimControl",get:function(){return this._skeletonAnimControl||(this._skeletonAnimControl=new Ut(this)),this._skeletonAnimControl}},{key:"waterSimulation",get:function(){return this._waterSimulation||(this._waterSimulation=new kt(this)),this._waterSimulation}},{key:"interval",value:function(){var e=this;setInterval((function(){e.eventHandler.updateObjectsWithEvent(),e.eventListenerUpdate(e),e.eventListenerUpdate(e.camera),e.scene.traverse((function(t){e.eventListenerUpdate(t),t.visibleNeedsUpdate&&(e.emitUIInteraction({excuteName:ee.VISIBLE,params:t.toJSON()}),t.visibleNeedsUpdate=!1),t.visible&&(t.matrixNeedsUpdate||t.materialNeedsUpdate||t.animateNeedsUpdate)&&("TrafficLayer"===t.type?e.emitUIInteraction({excuteName:Z.CREATE_TRAFFIC_STREAM,params:t.toJSON(!1)}):"LayerBuilding"===t.type?e.emitUIInteraction({excuteName:Q.EVENT_LAYER_BUILDING,params:t.toJSON()}):"SlopeAnalysis"===t.type?e.emitUIInteraction({excuteName:Q.UPDATA_SLOPE_ANALYSIS,params:t.toJSON()}):"ModelSlice"===t.type?e.emitUIInteraction({excuteName:"Interact_ModelSlice",params:t.toJSON()}):e.emitUIInteraction({excuteName:ee.UPDATE,params:t.toJSON()}),t.matrixNeedsUpdate=!1,t.materialNeedsUpdate=!1,t.animateNeedsUpdate=!1),t.visible&&t.messageNeedsUpdate&&("TrafficLayer"===t.type?e.emitUIInteraction({excuteName:Z.CREATE_TRAFFIC_STREAM,params:t.toJSON(!1)}):e.emitUIInteraction({excuteName:ee.UPDATE,params:t.toJSON()}),t.messageNeedsUpdate=!1),t.followNeedsUpdate&&("TrafficLayer"===t.type?e.emitUIInteraction({excuteName:Z.FOLLOW_TRAFFIC_STREAM_ITEM,params:t.toJSON(!1)}):"AutonomousVehicle"===t.type&&e.emitUIInteraction({excuteName:ee.UPDATE,params:t.toJSON()}),t.followNeedsUpdate=!1)})),e.camera&&e.camera.needsUpdate&&(e.camera.constrainPolygonNeedsUpdate?(e.emitUIInteraction({excuteName:X.Constrain_Shape,params:e.camera.toJSON()}),e.camera.constrainPolygonNeedsUpdate=!1):e.emitUIInteraction({excuteName:X.UPDATE,params:e.camera.toJSON()}),e.camera.needsUpdate=!1)}),1e3/(arguments.length>0&&void 0!==arguments[0]?arguments[0]:5))}},{key:"eventListenerUpdate",value:function(e){e&&e._needsDispatchedToUE&&(e._dispatchAddListenerTypes&&e._dispatchAddListenerTypes.length>0&&(this.emitUIInteraction({excuteName:Z.ADD_EVENT_LISTENER,params:{type:e.type,name:e.name,uuid:e.uuid,EventType:e._dispatchAddListenerTypes}}),e._dispatchAddListenerTypes=[]),e._dispatchRemoveListenerTypes&&e._dispatchRemoveListenerTypes.length>0&&(this.emitUIInteraction({excuteName:Z.REMOVE_EVENT_LISTENER,params:{type:e.type,name:e.name,uuid:e.uuid,EventType:e._dispatchRemoveListenerTypes}}),e._dispatchRemoveListenerTypes=[]),e._needsDispatchedToUE=!1,e._dispatchName=null)}},{key:"log",value:function(e){console.log("".concat(Math.floor(Date.now()-this.t0),": ")+e)}},{key:"_preInitInnerMode",value:function(){var e=this;if(!this._preInitInnerModeStarted){this._preInitInnerModeStarted=!0;var t=this,i=setInterval((function(){var n;"undefined"!=typeof ue&&null!==(n=ue)&&void 0!==n&&n.interface&&(clearInterval(i),ue.interface._webUILoadedSet||(ue.interface._webUILoadedSet=!0,ue.interface.webUILoaded=function(){t._initWebUI()}),e.addEventListener("webUIisReady",(function(){})))}),200)}}},{key:"initCamera",value:function(){var e,t=this;this.camera&&(null===(e=this.camera)||void 0===e||e.removeFromParent(),this.camera=null);this.camera=new Ge,this.camera.type="Camera",this.camera.addEventListener("cameraChange",(function(e){var i,n,r,o,s,l,u=e.content.camera;t.camera.position.x=u.Location.longitude,t.camera.position.y=u.Location.latitude,t.camera.position.z=u.Location.altitude,t.camera.rotation.x=a.degToRad(u.Rotate.roll),t.camera.rotation.y=a.degToRad(u.Rotate.pitch),t.camera.rotation.z=a.degToRad(u.Rotate.yaw),t.camera.roll=u.Rotate.roll,t.camera.pitch=u.Rotate.pitch,t.camera.yaw=u.Rotate.yaw,t.camera.worldLocation.x=null==u||null===(i=u.Position)||void 0===i?void 0:i.x,t.camera.worldLocation.y=null==u||null===(n=u.Position)||void 0===n?void 0:n.y,t.camera.worldLocation.z=null==u||null===(r=u.Position)||void 0===r?void 0:r.z,t.camera.sphereLocation.x=null==u||null===(o=u.SphereLocation)||void 0===o?void 0:o.longitude,t.camera.sphereLocation.y=null==u||null===(s=u.SphereLocation)||void 0===s?void 0:s.latitude,t.camera.sphereLocation.z=null==u||null===(l=u.SphereLocation)||void 0===l?void 0:l.altitude,t.level=Math.ceil(Math.max(Math.log2(103300/t.camera.worldLocation.z),0)),t.dispatchEvent({type:"camera_changed",data:e})}))}},{key:"initObjectBBox",value:function(){if(this.objectBBox)return!1;this.objectBBox=new St({color:new u(1,1,0)}),this.scene.add(this.objectBBox),this.objectBBox.visible=!1,this.emitUIInteraction({excuteName:K.OBJECT_BOUNDINGBOX,params:this.objectBBox.toJSON()})}},{key:"_initWebUI",value:function(){if(!this._webUIInitialized){this._webUIInitialized=!0;var e=this;ue.interface.webUIMessage=function(t){e.eventHandler.callRespone(t)},console.log("页面及其所有资源已完全加载"),setTimeout((function(){e.UDS||(e.UDS=new me(e,e.udsParams)),e.camera||(console.log("initOthers start"),e.initOthers(),console.log("initOthers end -> ",e.camera)),e.dispatchEvent({type:"videoInitialised"})}),1e3),Wt((new Date).getTime())}}},{key:"scanGamepads",value:function(){for(var e=navigator.getGamepads?navigator.getGamepads():navigator.webkitGetGamepads?navigator.webkitGetGamepads():[],t=0;t<e.length;t++)e[t]&&e[t].index in this.controllers&&(this.controllers[e[t].index].currentState=e[t])}},{key:"updateStatus",value:function(){for(j in this.scanGamepads(),this.controllers){for(var e=this.controllers[j],t=e.currentState,i=e.prevState,n=0;n<t.buttons.length;n++){var a=t.buttons[n],r=i.buttons[n];a.pressed&&!r.pressed?6==n?this.emitControllerAxisMove(j,5,a.value):7==n?this.emitControllerAxisMove(j,6,a.value):this.emitControllerButtonPressed(j,n,0):!a.pressed&&r.pressed?6==n?this.emitControllerAxisMove(j,5,0):7==n?this.emitControllerAxisMove(j,6,0):this.emitControllerButtonReleased(j,n):a.pressed&&r.pressed&&(6==n?this.emitControllerAxisMove(j,5,a.value):7==n?this.emitControllerAxisMove(j,6,a.value):this.emitControllerButtonPressed(j,n,1))}for(var o=0;o<t.axes.length;o+=2){var s=parseFloat(t.axes[o].toFixed(4)),l=-parseFloat(t.axes[o+1].toFixed(4));0===o?(this.emitControllerAxisMove(j,1,s),this.emitControllerAxisMove(j,2,l)):2===o&&(this.emitControllerAxisMove(j,3,s),this.emitControllerAxisMove(j,4,l))}this.controllers[j].prevState=t}Bt(this.updateStatus)}},{key:"emitControllerButtonPressed",value:function(e,t,i){Data=new DataView(new ArrayBuffer(4)),Data.setUint8(0,le.GamepadButtonPressed),Data.setUint8(1,e),Data.setUint8(2,t),Data.setUint8(3,i)}},{key:"emitControllerButtonReleased",value:function(e,t){Data=new DataView(new ArrayBuffer(3)),Data.setUint8(0,le.GamepadButtonReleased),Data.setUint8(1,e),Data.setUint8(2,t)}},{key:"emitControllerAxisMove",value:function(e,t,i){Data=new DataView(new ArrayBuffer(11)),Data.setUint8(0,le.GamepadAnalog),Data.setUint8(1,e),Data.setUint8(2,t),Data.setFloat64(3,i,!0),this.sendInputData(Data.buffer)}},{key:"setupToggleWithUrlParams",value:function(e,t){var i=document.getElementById(e);i&&(i.checked=new URLSearchParams(window.location.search).has(t),i.addEventListener("change",(function(e){var i=new URLSearchParams(window.location.search);e.currentTarget.checked?i.set(t,"true"):i.delete(t),window.history.replaceState({},"",""!==i.toString()?"".concat(location.pathname,"?").concat(i):"".concat(location.pathname))})))}},{key:"updateStreamList",value:function(){for(var e=document.getElementById("stream-select"),t=e.options.length-1;t>=0;t--)e.remove(t);e.value=null;var i,n=T(this.webRtcPlayerObj.availableVideoStreams);try{for(n.s();!(i=n.n()).done;){var a=B(i.value,2),r=a[0],o=(a[1],document.createElement("option"));o.value=r,o.innerHTML=r,e.appendChild(o),null==e.value&&(e.value=r)}}catch(e){n.e(e)}finally{n.f()}this.updateTrackList()}},{key:"updateTrackList",value:function(){for(var e=document.getElementById("stream-select"),t=document.getElementById("track-select"),i=this.webRtcPlayerObj.availableVideoStreams.get(e.value),n=t.options.length-1;n>=0;n--)t.remove(n);t.value=null;var a,r=T(i.getVideoTracks());try{for(r.s();!(a=r.n()).done;){var o=a.value,s=document.createElement("option");s.value=o.id,s.innerHTML=o.label,t.appendChild(s),o.selected&&(t.value=o.id)}}catch(e){r.e(e)}finally{r.f()}}},{key:"sendStartLatencyTest",value:function(){var e=this;if(this.webRtcPlayerObj){this.webRtcPlayerObj.startLatencyTest((function(t){var i={StartTime:t};e.emitDescriptor(le.LatencyTest,i)}))}}},{key:"setOverlay",value:function(e,t,i){var n=document.getElementById("videoPlayOverlay");if(!n){var a=document.getElementById("player");(n=document.createElement("div")).id="videoPlayOverlay",a&&a.appendChild(n)}for(;n.lastChild;)n.removeChild(n.lastChild);t&&n.appendChild(t),i&&n.addEventListener("click",(function e(t){i(t),n.removeEventListener("click",e)}));for(var r=n.classList,o=r.length-1;o>=0;o--)r.remove(r[o]);n.classList.add(e)}},{key:"showConnectOverlay",value:function(){var e=this,t=document.createElement("div");t.id="playButton",t.innerHTML="点击开始",this.setOverlay("clickableState",t,(function(t){e.connect(),e.startAfkWarningTimer()}))}},{key:"showTextOverlay",value:function(e){var t=document.createElement("div");t.id="messageOverlay",t.innerHTML=e||"",this.setOverlay("textDisplayState",t)}},{key:"playVideoStream",value:function(){var e=this;e.webRtcPlayerObj&&this.webRtcPlayerObj.video?(e.webRtcPlayerObj.video.play().catch((function(t){console.error(t),console.log("Browser does not support autoplaying video without interaction - to resolve this we are going to show the play button overlay."),e.showPlayOverlay()})),e.requestInitialSettings(),e.requestQualityControl(),e.eventHandler.showFreezeFrameOverlay(),e.hideOverlay()):console.error("Could not player video stream because this.webRtcPlayerObj.video was not valid.")}},{key:"showPlayOverlay",value:function(){var e=this,t=document.createElement("img");t.id="playButton",t.src="/images/Play.png",t.alt="Start Streaming",this.setOverlay("clickableState",t,(function(t){e.playVideoStream()})),this.shouldShowPlayOverlay=!1}},{key:"updateAfkOverlayText",value:function(){this.afk.overlay.innerHTML="<center>No activity detected<br>Disconnecting in "+this.afk.countdown+" seconds<br>Click to continue<br></center>"}},{key:"showAfkOverlay",value:function(){var e=this;this.stopAfkWarningTimer(),this.afk.overlay=document.createElement("div"),this.afk.overlay.id="afkOverlay",this.setOverlay("clickableState",this.afk.overlay,(function(t){e.hideOverlay(),clearInterval(e.afk.countdownTimer),e.startAfkWarningTimer()})),this.afk.countdown=this.afk.closeTimeout,this.updateAfkOverlayText(),this.inputOptions.controlScheme==oe.LockedMouse&&document.exitPointerLock(),this.afk.countdownTimer=setInterval((function(){this.afk.countdown--,0==this.afk.countdown?(this.hideOverlay(),this.ws.close()):this.updateAfkOverlayText()}),1e3)}},{key:"hideOverlay",value:function(){this.setOverlay("hiddenState")}},{key:"startAfkWarningTimer",value:function(){this.afk.active=this.afk.enabled,this.resetAfkWarningTimer()}},{key:"stopAfkWarningTimer",value:function(){this.afk.active=!1}},{key:"resetAfkWarningTimer",value:function(){var e=this;this.afk.active&&(clearTimeout(this.afk.warnTimer),this.afk.warnTimer=setTimeout((function(){e.showAfkOverlay()}),1e3*e.afk.warnTimeout))}},{key:"createWebRtcOffer",value:function(){this.webRtcPlayerObj?(console.log("Creating offer"),this.showTextOverlay("云渲染服务连接中,请稍等"),this.webRtcPlayerObj.createOffer()):(console.log("WebRTC player not setup, cannot create offer"),this.showTextOverlay("云渲染服务连接失败,无法获取画面"))}},{key:"sendInputData",value:function(e){this.webRtcPlayerObj&&(this.resetAfkWarningTimer(),this.webRtcPlayerObj.send(e))}},{key:"setupWebRtcPlayer",value:function(e,t){var i=this;function n(e){this.freezeFrame.receiving||(this.freezeFrame.receiving=!0,this.freezeFrame.valid=!1,this.freezeFrame.size=0,this.freezeFrame.jpeg=void 0),this.freezeFrame.size=new DataView(e.slice(1,5).buffer).getInt32(0,!0);var t=e.slice(5);if(this.freezeFrame.jpeg){var n=new Uint8Array(this.freezeFrame.jpeg.length+t.length);n.set(this.freezeFrame.jpeg,0),n.set(t,this.freezeFrame.jpeg.length),this.freezeFrame.jpeg=n}else this.freezeFrame.jpeg=t,this.freezeFrame.receiving=!0,console.log("received first chunk of freeze frame: ".concat(this.freezeFrame.jpeg.length,"/").concat(this.freezeFrame.size));this.freezeFrame.jpeg.length===this.freezeFrame.size?(this.freezeFrame.receiving=!1,this.freezeFrame.valid=!0,console.log("received complete freeze frame ".concat(this.freezeFrame.size)),function(){var e=btoa(this.freezeFrame.jpeg.reduce((function(e,t){return e+String.fromCharCode(t)}),"")),t=document.getElementById("this.freezeFrameOverlay").childNodes[0];t.src="data:image/jpeg;base64,"+e,t.onload=function(){i.freezeFrame.height=t.naturalHeight,i.freezeFrame.width=t.naturalWidth,i.resizeFreezeFrameOverlay(),i.shouldShowPlayOverlay?(i.showPlayOverlay(),i.eventHandler.resizePlayerStyle()):i.eventHandler.showFreezeFrameOverlay()}}()):this.freezeFrame.jpeg.length>this.freezeFrame.size&&(console.error("received bigger freeze frame than advertised: ".concat(this.freezeFrame.jpeg.length,"/").concat(this.freezeFrame.size)),this.freezeFrame.jpeg=void 0,this.freezeFrame.receiving=!1)}return this.webRtcPlayerObj=new ye(_(_({},t),{},{forceTURN:this.forceTURN,enableBulkChannel:this.enableBulkChannel,enableTextureChannel:this.enableTextureChannel})),e.appendChild(this.webRtcPlayerObj.video),e.appendChild(this.freezeFrameOverlay),this.connectOnLoad&&(this.webRtcPlayerObj.video.muted=!0),this.webRtcPlayerObj.onWebRtcOffer=function(e){if(i.ws&&1===i.ws.readyState){var t=JSON.stringify(e);console.log("%c[Outbound SS message (offer)]","background: lightgreen; color: black",e),i.ws.send(t)}},this.webRtcPlayerObj.onWebRtcCandidate=function(e){i.ws&&1===i.ws.readyState&&i.ws.send(JSON.stringify({type:"iceCandidate",candidate:e}))},this.webRtcPlayerObj.onWebRtcAnswer=function(e){if(i.ws&&1===i.ws.readyState){var t=JSON.stringify(e);console.log("%c[Outbound SS message (answer)]","background: lightgreen; color: black",e),i.ws.send(t)}},this.webRtcPlayerObj.onVideoInitialised=function(){i.ws&&1===i.ws.readyState&&(i.shouldShowPlayOverlay?(i.showPlayOverlay(),i.eventHandler.resizePlayerStyle()):(i.eventHandler.resizePlayerStyle(),i.playVideoStream()),0!==i.resolution[0]&&0!==i.resolution[1]&&i.changeResolution(i.resolution[0],i.resolution[1]))},this.webRtcPlayerObj.onDataChannelConnected=function(){i.ws&&1===i.ws.readyState&&(i.showTextOverlay("云渲染服务连接成功,等待画面推送中"),i.requestQualityControl(),setTimeout((function(){i.UDS||(i.UDS=new me(i,i.udsParams)),i.camera||i.initOthers(),i.dispatchEvent({type:"videoInitialised"})}),1e3))},this.webRtcPlayerObj.onNewVideoTrack=function(e){var t,n;null!=i&&null!==(t=i.webRtcPlayerObj)&&void 0!==t&&t.onVideoInitialised&&(null==i||null===(n=i.webRtcPlayerObj)||void 0===n||n.onVideoInitialised());i.isShowTestUI&&i.updateStreamList()},this.webRtcPlayerObj.onDataChannelMessage=function(e){var t=new Uint8Array(e);if(t[0]===re.QualityControlOwnership){var a=0!==t[1];console.log("Received quality controller message, will control quality: "+a),i.qualityController=a,i.qualityControlOwnershipCheckBox&&(i.qualityControlOwnershipCheckBox.disabled=a,i.qualityControlOwnershipCheckBox.checked=a)}else if(t[0]===re.Response){var r=new TextDecoder("utf-16").decode(e.slice(1));i.eventHandler.callRespone(JSON.parse(r))}else if(t[0]===re.Command){var o=new TextDecoder("utf-16").decode(e.slice(1));console.log(o);var s=JSON.parse(o);"onScreenKeyboard"===s.command&&i.showOnScreenKeyboard(s)}else if(t[0]===re.FreezeFrame)n(t);else if(t[0]===re.UnfreezeFrame)i.eventHandler.invalidateFreezeFrameOverlay();else if(t[0]===re.VideoEncoderAvgQP)i.videoEncoderQP=new TextDecoder("utf-16").decode(e.slice(1));else if(t[0]==re.LatencyTest){var l=new TextDecoder("utf-16").decode(e.slice(1));console.log("Got latency timings from UE."),console.log(l);var u=JSON.parse(l);i.webRtcPlayerObj&&i.webRtcPlayerObj.latencyTestTimings.SetUETimings(u)}else if(t[0]==re.InitialSettings){if(!i.isShowTestUI)return;var c=new TextDecoder("utf-16").decode(e.slice(1)),d=JSON.parse(c);if(d.PixelStreaming){if(!1===d.PixelStreaming.AllowPixelStreamingCommands){if(document.getElementById("encoder-min-qp-text").disabled=!0,document.getElementById("encoder-max-qp-text").disabled=!0,document.getElementById("webrtc-fps-text").disabled=!0,document.getElementById("webrtc-min-bitrate-text").disabled=!0,document.getElementById("webrtc-max-bitrate-text").disabled=!0,document.getElementById("show-fps-button").disabled=!0,document.getElementById("encoder-params-submit").disabled=!0,document.getElementById("webrtc-params-submit").disabled=!0,!document.getElementById("warning-elem-webrtc")){var h=document.createElement("p");h.innerText="(Disabled by -AllowPixelStreamingCommands=false)",h.classList="subtitle-text",h.id="warning-elem-webrtc",document.getElementById("webRTCSettingsHeader").appendChild(h)}if(!document.getElementById("warning-elem-encoder")){var f=document.createElement("p");f.innerText="(Disabled by -AllowPixelStreamingCommands=false)",f.classList="subtitle-text",f.id="warning-elem-encoder",document.getElementById("encoderSettingsHeader").appendChild(f)}console.warn("-AllowPixelStreamingCommands=false, sending console commands from browser to UE is disabled, including toggling FPS and changing encoder settings from the browser.")}d.PixelStreaming.DisableLatencyTest&&(document.getElementById("test-latency-button").disabled=!0,document.getElementById("test-latency-button").title="Disabled by -PixelStreamingDisableLatencyTester=true",console.warn("-PixelStreamingDisableLatencyTester=true, requesting latency report from the the browser to UE is disabled."))}d.Encoder&&(document.getElementById("encoder-min-qp-text").value=d.Encoder.MinQP,document.getElementById("encoder-max-qp-text").value=d.Encoder.MaxQP),d.WebRTC&&(document.getElementById("webrtc-fps-text").value=d.WebRTC.FPS,document.getElementById("webrtc-min-bitrate-text").value=d.WebRTC.MinBitrate/1e3,document.getElementById("webrtc-max-bitrate-text").value=d.WebRTC.MaxBitrate/1e3)}else if(t[0]==re.FileExtension)!function(e){this.file.receiving||(this.file.mimetype="",this.file.extension="",this.file.receiving=!0,this.file.valid=!1,this.file.size=0,this.file.data=[],this.file.timestampStart=(new Date).getTime(),console.log("Received first chunk of this.file"));var t=new TextDecoder("utf-16").decode(e.slice(1));console.log(t),this.file.extension=t}(t);else if(t[0]==re.FileMimeType)!function(e){this.file.receiving||(this.file.mimetype="",this.file.extension="",this.file.receiving=!0,this.file.valid=!1,this.file.size=0,this.file.data=[],this.file.timestampStart=(new Date).getTime(),console.log("Received first chunk of this.file"));var t=new TextDecoder("utf-16").decode(e.slice(1));console.log(t),this.file.mimetype=t}(t);else if(t[0]==re.FileContents)!function(e){if(this.file.receiving){this.file.size=Math.ceil(new DataView(e.slice(1,5).buffer).getInt32(0,!0)/16379);var t=e.slice(5);if(this.file.data.push(t),console.log("Received this.file chunk: ".concat(this.file.data.length,"/").concat(this.file.size)),this.file.data.length===this.file.size){this.file.receiving=!1,this.file.valid=!0,console.log("Received complete this.file");var i=(new Date).getTime()-this.file.timestampStart,n=Math.round(16*this.file.size*1024/i);console.log("Average transfer bitrate: ".concat(n,"kb/s over ").concat(i/1e3," seconds"));var a=new Blob(this.file.data,{type:this.file.mimetype}),r=document.createElement("a");r.setAttribute("href",URL.createObjectURL(a)),r.setAttribute("download","transfer.".concat(this.file.extension));var o=$(r);o.appendTo("body"),o.remove()}else this.file.data.length>this.file.size&&(this.file.receiving=!1,console.error("Received bigger this.file than advertised: ".concat(this.file.data.length,"/").concat(this.file.size)))}}(t);else if(t[0]==re.Mouse){var p=new TextDecoder("utf-16").decode(e.slice(1));this.eventHandler.dispatchMouseEvent(p)}else if(t[0]==re.Keyboard){var m=new TextDecoder("utf-16").decode(e.slice(1));this.eventHandler.dispatchKeyboardEvent(m)}else if(t[0]==re.InputControlOwnership||t[0]==re.Protocol)new TextDecoder("utf-16").decode(e.slice(1));else if(t[0]===re.AckV2)i._handleAckV2&&i._handleAckV2(e);else if(t[0]===re.TextureMissingNack)try{var g=new TextDecoder("utf-16").decode(e.slice(1));if(!g)return;var v=JSON.parse(g),y=v&&"string"==typeof v.hash?v.hash:"";i.textureBus&&y&&i.textureBus.markMissing(y)}catch(e){console.warn("[CRE] TextureMissingNack parse failed:",e)}else console.error("unrecognized data received, packet ID ".concat(t[0]))},this.eventHandler.registerInputs(this.webRtcPlayerObj.video),"ontouchstart"in document.documentElement&&this.createOnScreenKeyboardHelpers(e),this.webRtcPlayerObj.video}},{key:"setupStats",value:function(){var e=this;this.webRtcPlayerObj.aggregateStats(1e3);var t=3e5,i=t;this.webRtcPlayerObj.onAggregatedStats=function(n){for(var a=new Intl.NumberFormat(window.navigator.language,{maximumFractionDigits:0}),r=new Intl.NumberFormat(window.navigator.language,{maximumFractionDigits:0,minimumIntegerDigits:2}),o=(n.timestamp-n.timestampStart)/1e3,s=[],l=[60,60],u=0;u<l.length;u++)s.push(o%l[u]),o/=l[u];s.push(o);for(var c=s[0],d=Math.floor(s[1]),h=Math.floor([s[2]]),f="B",p=n.hasOwnProperty("bytesReceived")?n.bytesReceived:0,m=["kB","MB","GB"],g=0;g<m.length&&!(p<1e5);g++)p/=1e3,f=m[g];n.receivedBytes=""+p+m;var v=document.getElementById("qualityStatus"),y=function(e){if(v)var t=e,i=1,n=setInterval((function(){v?(i-=.1,v.style="opacity: ".concat(Math.abs(2*(i-.5))),i<=.1&&(0==--t?clearInterval(n):i=1)):clearInterval(n)}),100/e)},b="",x="lime";e.videoEncoderQP>35?(x="red",y(2),b+='<div style="color: '.concat(x,'">Very blocky encoding quality</div>')):e.videoEncoderQP>26&&(x="orange",y(1),b+='<div style="color: '.concat(x,'">Blocky encoding quality</div>')),v&&(v.className="".concat(x,"Status")),b+="<div>Duration: ".concat(r.format(h),":").concat(r.format(d),":").concat(r.format(c),"</div>"),b+="<div>Video Resolution: ".concat(n.hasOwnProperty("frameWidth")&&n.frameWidth&&n.hasOwnProperty("frameHeight")&&n.frameHeight?n.frameWidth+"x"+n.frameHeight:"Chrome only","</div>"),b+="<div>Received (".concat(f,"): ").concat(a.format(p),"</div>"),b+="<div>Frames Decoded: ".concat(n.hasOwnProperty("framesDecoded")?a.format(n.framesDecoded):"Chrome only","</div>"),b+="<div>Packets Lost: ".concat(n.hasOwnProperty("packetsLost")?a.format(n.packetsLost):"Chrome only","</div>"),b+="<div>Framerate: ".concat(n.hasOwnProperty("framerate")?a.format(n.framerate):"Chrome only","</div>"),b+="<div>Frames dropped: ".concat(n.hasOwnProperty("framesDropped")?a.format(n.framesDropped):"Chrome only","</div>"),b+="<div>Net RTT (ms): ".concat(n.hasOwnProperty("currentRoundTripTime")?a.format(1e3*n.currentRoundTripTime):"Can't calculate","</div>"),b+="<div>Browser receive to composite (ms): ".concat(n.hasOwnProperty("receiveToCompositeMs")?a.format(n.receiveToCompositeMs):"Chrome only","</div>"),b+='<div style="color: '.concat(x,'">Bitrate (kbps): ').concat(n.hasOwnProperty("bitrate")?a.format(n.bitrate):"Chrome only","</div>"),b+='<div style="color: '.concat(x,'">Video Quantization Parameter: ').concat(e.videoEncoderQP,"</div>");var S=document.getElementById("stats");if(S&&(S.innerHTML=b),e.printStats&&n.timestampStart&&n.timestamp-n.timestampStart>i&&(e.ws&&1===e.ws.readyState&&(console.log("-> SS: stats\n".concat(JSON.stringify(n))),e.ws.send(JSON.stringify({type:"stats",data:n}))),i+=t),e.dispatchEvent({type:"aggregatedStats",data:n}),e.webRtcConnectionStatsCallback&&"function"==typeof e.webRtcConnectionStatsCallback)try{var w=n.hasOwnProperty("packetsLost")?n.packetsLost:0,N=n.hasOwnProperty("currentRoundTripTime")?1e3*n.currentRoundTripTime:0,U=n.hasOwnProperty("framerate")?n.framerate:0,k=0;void 0!==e.lastPacketsLost&&(k=Math.max(0,w-e.lastPacketsLost)),e.lastPacketsLost=w;var C=k>0||N>300||U<10&&k>0,T=C?"⚠️ 网络拥堵":"✅ 网络良好",R=k>30?"丢失 ".concat(k," 包/次"):"0 (稳定)",O={bitrate:n.hasOwnProperty("bitrate")?n.bitrate:null,avgBitrate:n.hasOwnProperty("avgBitrate")?n.avgBitrate:null,framerate:U,resolution:{width:n.hasOwnProperty("frameWidth")?n.frameWidth:null,height:n.hasOwnProperty("frameHeight")?n.frameHeight:null},roundTripTime:N,packetsLost:w,framesDroppedPercentage:n.hasOwnProperty("framesDroppedPercentage")?n.framesDroppedPercentage:null,quantizationParameter:e.videoEncoderQP,originData:n,diagnosis:{isCongested:C,status:T,instantPacketLoss:k,instantPacketLossText:R}};e.webRtcConnectionStatsCallback(O)}catch(e){console.error("Error calling webRtcConnectionStatsCallback:",e)}},this.webRtcPlayerObj.latencyTestTimings.OnAllLatencyTimingsReady=function(e){if(e.BrowserReceiptTimeMs){var t=e.BrowserReceiptTimeMs-e.TestStartTimeMs,i=e.UEEncodeMs,n=e.UECaptureToSendMs,a=e.UETransmissionTimeMs-e.UEReceiptTimeMs,r=t-a,o=null,s=null;e.FrameDisplayDeltaTimeMs&&e.BrowserReceiptTimeMs&&(o=e.FrameDisplayDeltaTimeMs+r+("string"==typeof n?0:n),s=e.FrameDisplayDeltaTimeMs+(t-r-a));var l="";l+="<div>Net latency RTT (ms): ".concat(r.toFixed(2),"</div>"),l+="<div>UE Encode (ms): ".concat("string"==typeof i?i:i.toFixed(2),"</div>"),l+="<div>UE Send to capture (ms): ".concat("string"==typeof n?n:n.toFixed(2),"</div>"),l+="<div>UE probe duration (ms): ".concat(a.toFixed(2),"</div>"),l+=e.FrameDisplayDeltaTimeMs&&e.BrowserReceiptTimeMs?"<div>Browser composite latency (ms): ".concat(e.FrameDisplayDeltaTimeMs.toFixed(2),"</div>"):"",l+=s?"<div>Total browser latency (ms): ".concat(s.toFixed(2),"</div>"):"",l+=o?"<div>Total latency (ms): ".concat(o.toFixed(2),"</div>"):"";var u=document.getElementById("LatencyStats");u&&(u.innerHTML=l)}}}},{key:"onWebRtcConnectionStats",value:function(e){"function"==typeof e?(this.webRtcConnectionStatsCallback=e,this.webRtcPlayerObj&&!this.webRtcPlayerObj.aggregateStatsIntervalId&&this.setupStats()):console.warn("onWebRtcConnectionStats: callback must be a function")}},{key:"onWebRtcOffer",value:function(e){this.webRtcPlayerObj.receiveOffer(e),this.isShowTestUI&&this.setupStats()}},{key:"onWebRtcAnswer",value:function(e){this.webRtcPlayerObj.receiveAnswer(e),this.isShowTestUI&&this.setupStats()}},{key:"onWebRtcIce",value:function(e){this.webRtcPlayerObj&&this.webRtcPlayerObj.handleCandidateFromServer(e)}},{key:"updateVideoStreamSize",value:function(){var e=this;this.matchViewportResolution&&(clearTimeout(this.resizeTimeout),this.resizeTimeout=setTimeout((function(){var t=document.getElementById("player");if(t){var i=t.clientWidth,n=t.clientHeight;if(i>3840||n>2160){var a=3840/i,r=2160/n,o=Math.min(a,r);i=Math.floor(i*o),n=Math.floor(n*o)}e.changeResolution(i,n),console.log("Debounced resize: Resolution updated to ".concat(i,"x").concat(n))}}),500))}},{key:"_waitForChannelDrain",value:function(e,t){return e?(0===e.bufferedAmountLowThreshold&&(e.bufferedAmountLowThreshold=262144),e.bufferedAmount<=t?Promise.resolve():new Promise((function(t){var i=!1,n=function(){i||(i=!0,e.removeEventListener("bufferedamountlow",n),t())};e.addEventListener("bufferedamountlow",n),setTimeout((function(){return n()}),2e3)}))):Promise.resolve()}},{key:"_pickDescriptorChannel",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=this.webRtcPlayerObj;if(!i)return{channel:null,useBulk:!1,useTexture:!1};var n=i.dcClient||null,a=!(!t.preferTexture||!this.enableTextureChannel);return{channel:n,useBulk:!a&&this.enableBulkChannel&&e>=this.bulkChannelThreshold,useTexture:a}}},{key:"_enqueueSend",value:function(e,t){this._sendQueues||(this._sendQueues={});var i=(this._sendQueues[e]||Promise.resolve()).then(t,t);return this._sendQueues[e]=i.catch((function(){})),i}},{key:"emitDescriptor",value:function(e,t){var i=this,n=_t(t),a=2*n.length;if(a>67108864)return console.error("数据量超出最大传输范围64MB!"),!1;var r=(new TextEncoder).encode(n),o=this.enableTextureBus&&this._hasTextureRef(t),s=this._hasColumnStoreJsonData(t);if(this.enableV2Protocol&&(r.byteLength>=16384||o||s))return this._emitDescriptorV2(e,r,{preferTexture:o,originalDescriptor:t});if(s&&!this.enableV2Protocol)return console.error("[CloudRenderApp] column-store jsondata requires enableV2Protocol=true; descriptor dropped",{messageType:e}),Promise.resolve(!1);var l=49152,u=this._pickDescriptorChannel(a),c=u.channel,d=u.useBulk,h=d?"bulk":"main",f=this.dataChannelHighWatermark;return this._enqueueSend(h,w(D().mark((function t(){var r,o,s,u;return D().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(a<l)){t.next=6;break}if(!c){t.next=4;break}return t.next=4,i._waitForChannelDrain(c,f);case 4:return i._sendStringBufferDataOn(c,e,n),t.abrupt("return",!0);case 6:r=Math.ceil(a/l),o=Math.floor(24576),s=0;case 9:if(!(s<r)){t.next=18;break}if(u=n.slice(s*o,(s+1)*o),!c){t.next=14;break}return t.next=14,i._waitForChannelDrain(c,f);case 14:i._sendStringBufferDataOn(c,e,u,r,s+1);case 15:s++,t.next=9;break;case 18:return i.printStats&&d&&console.log("[CRE] descriptor sent via bulk queue, bytes=".concat(a,", chunks=").concat(r)),t.abrupt("return",!0);case 20:case"end":return t.stop()}}),t)}))))}},{key:"_emitDescriptorV2",value:function(e,t){var i=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=n.preferTexture,r=void 0!==a&&a,o=n.originalDescriptor,s=void 0===o?null:o,l=this._pickDescriptorChannel(t.byteLength,{preferTexture:r}),u=l.channel,c=l.useBulk,d=l.useTexture,h=d?"texture":c?"bulk":"main",f=this.dataChannelHighWatermark,p=function(){var n=w(D().mark((function n(){var a,r,o;return D().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,Mt(t);case 2:return a=n.sent,n.next=5,i._sendBinaryFramedV2(le.UIInteractionV2,e,1,a,u,f,h);case 5:return d&&(i._v3Metrics.textureChannelBytes+=a.byteLength),i.printStats&&(r=(100*(1-a.byteLength/t.byteLength)).toFixed(1),o=d?"texture-queue":c?"bulk-queue":"main",console.log("[CRE] V2 descriptor: utf8=".concat(t.byteLength,"B gz=").concat(a.byteLength,"B ratio=-").concat(r,"% innerType=").concat(e," via=").concat(o))),n.abrupt("return",!0);case 8:case"end":return n.stop()}}),n)})));return function(){return n.apply(this,arguments)}}();return this.enableV2Fallback&&s?this._enqueueSend(h,(function(){return p().catch((function(t){return i._v3Metrics.v2ErrorCount++,console.warn("[CRE] V2 path failed, fallback to legacy type=50",t),i._emitLegacyFallback(e,s)}))})):this._enqueueSend(h,p)}},{key:"_sendBinaryFramedV2",value:(n=w(D().mark((function e(t,i,n,a,r,o){var s,l,u,c,d,h,f,p,m,g,v,y,b,x,S,w,N,U=arguments;return D().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(u=U.length>6&&void 0!==U[6]?U[6]:"main",c=16,d=null===(s=this.webRtcPlayerObj)||void 0===s?void 0:s.pcClient,h=(null==d||null===(l=d.sctp)||void 0===l?void 0:l.maxMessageSize)||262144,f=Math.min(h-32,245760)-c,p=this._v2SeqId=this._v2SeqId+1>>>0,m=Math.ceil(a.byteLength/f)||1,(g=r||this.webRtcPlayerObj&&this.webRtcPlayerObj.dcClient)&&"open"===g.readyState){e.next=10;break}throw new Error("[CRE] _sendBinaryFramedV2: no open channel");case 10:v=this.enableNackRetransmit?[]:null,y=0;case 12:if(!(y<m)){e.next=43;break}return b=y*f,x=a.subarray(b,b+f),S=new ArrayBuffer(c+x.byteLength),(w=new DataView(S)).setUint8(0,t),w.setUint8(1,i),w.setUint8(2,n),w.setUint8(3,0),w.setUint32(4,p,!0),w.setUint32(8,m,!0),w.setUint32(12,y,!0),new Uint8Array(S,c).set(x),v&&v.push(S),e.next=28,this._waitForChannelDrain(g,o);case 28:e.prev=28,g.send(S),e.next=36;break;case 32:throw e.prev=32,e.t0=e.catch(28),console.error("[CRE] _sendBinaryFramedV2 send error:",e.t0),e.t0;case 36:if(!((N=this.bulkYieldEveryNChunks)>0&&("bulk"===u||"texture"===u)&&y+1<m&&(y+1)%N==0)){e.next=40;break}return e.next=40,new Promise((function(e){return setTimeout(e,0)}));case 40:y++,e.next=12;break;case 43:return v&&this._cacheSentChunks(p,v,g),e.abrupt("return",p);case 45:case"end":return e.stop()}}),e,this,[[28,32]])}))),function(e,t,i,a,r,o){return n.apply(this,arguments)})},{key:"_cacheSentChunks",value:function(e,t,i){if(this._sentChunksWriteCount=this._sentChunksWriteCount+1>>>0,!(15&this._sentChunksWriteCount)){var n,a=Date.now(),r=T(this._sentChunks);try{for(r.s();!(n=r.n()).done;){var o=B(n.value,2),s=o[0];a-o[1].ts>this._sentChunksTtlMs&&this._sentChunks.delete(s)}}catch(e){r.e(e)}finally{r.f()}}if(this._sentChunks.size>=this._sentChunksMaxSize)for(var l=Math.max(1,Math.floor(this._sentChunksMaxSize/4)),u=this._sentChunks.keys(),c=0;c<l;c++){var d=u.next().value;if(void 0===d)break;this._sentChunks.delete(d)}this._sentChunks.set(e,{chunks:t,channel:i,ts:Date.now()})}},{key:"_retransmitChunks",value:(i=w(D().mark((function e(t,i){var n,a,r,o,s,l;return D().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((n=this._sentChunks.get(t))&&Array.isArray(n.chunks)&&0!==n.chunks.length){e.next=3;break}return e.abrupt("return",!1);case 3:if((a=n.channel)&&"open"===a.readyState){e.next=6;break}return e.abrupt("return",!1);case 6:r=this.dataChannelHighWatermark,o=T(i),e.prev=8,o.s();case 10:if((s=o.n()).done){e.next=26;break}if(!("number"!=typeof(l=s.value)||l<0||l>=n.chunks.length)){e.next=14;break}return e.abrupt("continue",24);case 14:return e.next=16,this._waitForChannelDrain(a,r);case 16:e.prev=16,a.send(n.chunks[l]),e.next=24;break;case 20:return e.prev=20,e.t0=e.catch(16),console.warn("[CRE] _retransmitChunks send failed:",e.t0),e.abrupt("return",!1);case 24:e.next=10;break;case 26:e.next=31;break;case 28:e.prev=28,e.t1=e.catch(8),o.e(e.t1);case 31:return e.prev=31,o.f(),e.finish(31);case 34:return n.ts=Date.now(),e.abrupt("return",!0);case 36:case"end":return e.stop()}}),e,this,[[8,28,31,34],[16,20]])}))),function(e,t){return i.apply(this,arguments)})},{key:"_awaitAckV2",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=i.timeoutMs,a=void 0===n?this._defaultAckTimeoutMs:n,r=i.meta,o=void 0===r?null:r,s=this._pendingAcks.get(e);return s&&(s.timer&&clearTimeout(s.timer),s.reject(new Error("[CRE] AckV2: superseded by new sender with same seqId")),this._pendingAcks.delete(e)),new Promise((function(i,n){var r={resolve:i,reject:n,timer:null,meta:o,ts:Date.now(),timeoutMs:a,retriesRemaining:t.enableNackRetransmit?t.maxNackRetries:0};a>0&&(r.timer=setTimeout((function(){if(t._pendingAcks.get(e)===r){t._pendingAcks.delete(e),t._sentChunks.delete(e),t._v3Metrics.ackTimeoutCount++;var i=new Error("[CRE] AckV2 timeout (seqId=".concat(e,", ").concat(a,"ms)"));i.seqId=e,i.meta=o,i.reason="ack-timeout",n(i)}}),a)),t._pendingAcks.set(e,r)}))}},{key:"_handleAckV2",value:function(e){var t=this,i=e instanceof ArrayBuffer?new Uint8Array(e):e instanceof Uint8Array?e:new Uint8Array(e.buffer,e.byteOffset,e.byteLength);if(i.byteLength<3)console.warn("[CRE] AckV2: frame too short",i.byteLength);else{var n,a;try{n=new TextDecoder("utf-16").decode(new Uint8Array(i.buffer,i.byteOffset+1,i.byteLength-1))}catch(e){return void console.warn("[CRE] AckV2: UTF-16 decode failed",e)}try{a=JSON.parse(n)}catch(e){return void console.warn("[CRE] AckV2: JSON parse failed",e,n)}var r=a&&"number"==typeof a.seqId?a.seqId>>>0:-1,o=a&&"number"==typeof a.status?a.status:2,s=Array.isArray(a&&a.missingIndices)?a.missingIndices:void 0,l=this._pendingAcks.get(r);if(l){if(1===o&&this.enableNackRetransmit&&l.retriesRemaining>0&&Array.isArray(s)&&s.length>0)return l.retriesRemaining--,this._v3Metrics.nackRetransmitCount++,l.timer&&clearTimeout(l.timer),l.ts=Date.now(),l.timeoutMs>0&&(l.timer=setTimeout((function(){if(t._pendingAcks.get(r)===l){t._pendingAcks.delete(r),t._sentChunks.delete(r),t._v3Metrics.ackTimeoutCount++;var e=new Error("[CRE] AckV2 timeout after retransmit (seqId=".concat(r,", ").concat(l.timeoutMs,"ms)"));e.seqId=r,e.meta=l.meta,e.reason="ack-timeout",l.reject(e)}}),l.timeoutMs)),this._retransmitChunks(r,s).then((function(e){if(!e&&t._pendingAcks.get(r)===l){t._pendingAcks.delete(r),t._sentChunks.delete(r),l.timer&&clearTimeout(l.timer),t._v3Metrics.nackRetransmitGiveUpCount++;var i=new Error("[CRE] NACK retransmit failed (seqId=".concat(r,"): cache evicted or channel closed"));i.seqId=r,i.meta=l.meta,i.reason="nack-retransmit-failed",l.reject(i)}})),void(this.printStats&&console.log("[CRE] AckV2 PARTIAL seqId=".concat(r," retransmit ").concat(s.length," chunks, retriesLeft=").concat(l.retriesRemaining)));this._pendingAcks.delete(r),this._sentChunks.delete(r),l.timer&&clearTimeout(l.timer);var u=l.ts?Date.now()-l.ts:-1;if(0===o)this._v3Metrics.ackOkCount++,this.printStats&&console.log("[CRE] AckV2 OK seqId=".concat(r," rtt=").concat(u,"ms meta="),l.meta),l.resolve({status:o,missingIndices:s});else{this._v3Metrics.ackNackCount++;var c=new Error("[CRE] AckV2 NACK (seqId=".concat(r,", status=").concat(o,")"));c.seqId=r,c.status=o,c.missingIndices=s,c.meta=l.meta,c.reason=1===o?"ack-partial":"ack-error",l.reject(c)}}}}},{key:"_emitLegacyFallback",value:function(e,t){var i=this;try{var n=_t(this._rewriteTextureRefToBase64(t)),a=2*n.length,r=49152,o=this.webRtcPlayerObj?this.webRtcPlayerObj.dcClient:null,s=this.dataChannelHighWatermark;if(this._v3Metrics.fallbackCount++,a<r)return o?this._waitForChannelDrain(o,s).then((function(){return i._sendStringBufferDataOn(o,e,n),!0})):(this._sendStringBufferDataOn(o,e,n),Promise.resolve(!0));var l=Math.ceil(a/r),u=Math.floor(24576);return w(D().mark((function t(){var a,r;return D().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:a=0;case 1:if(!(a<l)){t.next=10;break}if(r=n.slice(a*u,(a+1)*u),!o){t.next=6;break}return t.next=6,i._waitForChannelDrain(o,s);case 6:i._sendStringBufferDataOn(o,e,r,l,a+1);case 7:a++,t.next=1;break;case 10:return t.abrupt("return",!0);case 11:case"end":return t.stop()}}),t)})))()}catch(e){throw console.error("[CRE] legacy fallback failed:",e),e}}},{key:"_hasTextureRef",value:function(e){if(null==e||"object"!==G(e))return!1;if(Array.isArray(e)){for(var t=0;t<e.length;t++)if(this._hasTextureRef(e[t]))return!0;return!1}for(var i=0,n=Object.keys(e);i<n.length;i++){var a=n[i],r=e[a];if("string"==typeof r&&r&&/TextureRef$/.test(a))return!0;if(r&&"object"===G(r)&&this._hasTextureRef(r))return!0}return!1}},{key:"_hasColumnStoreJsonData",value:function(e){if(null==e||"object"!==G(e))return!1;if(Array.isArray(e)){for(var t=0;t<e.length;t++)if(this._hasColumnStoreJsonData(e[t]))return!0;return!1}var i=e.jsondata;if(i&&"object"===G(i)&&!Array.isArray(i)&&1===i.__cs)return!0;var n=e.params;return!(!n||"object"!==G(n)||!this._hasColumnStoreJsonData(n))}},{key:"_rewriteTextureRefToBase64",value:function(e){var t=this;if(null==e||"object"!==G(e))return e;if(Array.isArray(e))return e.map((function(e){return t._rewriteTextureRefToBase64(e)}));for(var i={},n=this.textureBus,a=0,r=Object.keys(e);a<r.length;a++){var o=r[a],s=e[o];if(/TextureRef$/.test(o)&&"string"==typeof s&&s){var l=o.slice(0,-3),u=n?n.getBase64Sync(s):null;if(u){i[o]=null,i[l]=u;continue}i[o]=s}else i[o]=this._rewriteTextureRefToBase64(s)}return i}},{key:"sendStringBufferData",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,a=this.webRtcPlayerObj?this.webRtcPlayerObj.dcClient:null;this._sendStringBufferDataOn(a,e,t,i,n)}},{key:"_sendStringBufferDataOn",value:function(e,t,i){var n={total:arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,index:arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,content:i},a=JSON.stringify(n),r=new DataView(new ArrayBuffer(3+2*a.length)),o=0;r.setUint8(o,t),o+=1,r.setUint16(o,a.length,!0),o+=2;for(var s=0;s<a.length;s++)r.setUint16(o,a.charCodeAt(s),!0),o+=2;this.resetAfkWarningTimer&&this.resetAfkWarningTimer();var l=r.buffer,u=e||this.webRtcPlayerObj&&this.webRtcPlayerObj.dcClient;if(u&&"open"===u.readyState)try{u.send(l)}catch(e){console.error("emitDescriptor send error:",e)}else this.sendInputData(l)}},{key:"emitUIInteraction",value:function(e){var t,i;(console.log(e),"cloud"===this.renderMode)?this.emitDescriptor(le.UIInteraction,e):"undefined"!=typeof ue&&null!==(t=ue)&&void 0!==t&&null!==(i=t.interface)&&void 0!==i&&i.broadcast?ue.interface.broadcast(JSON.stringify(e)):console.warn("ue.interface.broadcast is not available in this environment.")}},{key:"emitCommand",value:function(e){this.emitDescriptor(le.Command,e)}},{key:"requestInitialSettings",value:function(){this.sendInputData(new Uint8Array([le.RequestInitialSettings]).buffer)}},{key:"requestQualityControl",value:function(){this.qualityController||this.sendInputData(new Uint8Array([le.RequestQualityControl]).buffer)}},{key:"setupNormalizeAndQuantize",value:function(){var e=document.getElementById("player"),t=e.getElementsByTagName("video");if(e&&t.length>0){var i=e.clientHeight/e.clientWidth,n=t[0].videoHeight/t[0].videoWidth;if(i>n){this.printInputs&&console.log("Setup Normalize and Quantize for playerAspectRatio > videoAspectRatio");var a=i/n;this.normalizeAndQuantizeUnsigned=function(t,i){var n=t/e.clientWidth,r=a*(i/e.clientHeight-.5)+.5;return n<0||n>1||r<0||r>1?{inRange:!1,x:65535,y:65535}:{inRange:!0,x:65536*n,y:65536*r}},this.unquantizeAndDenormalizeUnsigned=function(t,i){var n=(i/65536-.5)/a+.5;return{x:t/65536*e.clientWidth,y:n*e.clientHeight}},this.normalizeAndQuantizeSigned=function(t,i){return{x:32767*(t/(.5*e.clientWidth)),y:32767*(a*i/(.5*e.clientHeight))}}}else{this.printInputs&&console.log("Setup Normalize and Quantize for playerAspectRatio <= videoAspectRatio");var r=n/i;this.normalizeAndQuantizeUnsigned=function(t,i){var n=r*(t/e.clientWidth-.5)+.5,a=i/e.clientHeight;return n<0||n>1||a<0||a>1?{inRange:!1,x:65535,y:65535}:{inRange:!0,x:65536*n,y:65536*a}},this.unquantizeAndDenormalizeUnsigned=function(t,i){var n=i/65536;return{x:((t/65536-.5)/r+.5)*e.clientWidth,y:n*e.clientHeight}},this.normalizeAndQuantizeSigned=function(t,i){return{x:32767*(r*t/(.5*e.clientWidth)),y:32767*(i/(.5*e.clientHeight))}}}}}},{key:"createOnScreenKeyboardHelpers",value:function(e){var t=this;null===document.getElementById("this.hiddenInput")&&(this.hiddenInput=document.createElement("input"),this.hiddenInput.id="this.hiddenInput",this.hiddenInput.maxLength=0,e.appendChild(this.hiddenInput)),null===document.getElementById("this.editTextButton")&&(this.editTextButton=document.createElement("button"),this.editTextButton.id="this.editTextButton",this.editTextButton.innerHTML="edit text",e.appendChild(this.editTextButton),this.editTextButton.classList.add("hiddenState"),this.editTextButton.addEventListener("click",(function(){t.hiddenInput.focus()})))}},{key:"showOnScreenKeyboard",value:function(e){if(e.showOnScreenKeyboard){this.editTextButton.classList.remove("hiddenState");var t=this.unquantizeAndDenormalizeUnsigned(e.x,e.y);this.editTextButton.style.top=t.y.toString()+"px",this.editTextButton.style.left=(t.x-40).toString()+"px"}else this.editTextButton.classList.add("hiddenState"),this.hiddenInput.blur()}},{key:"start",value:function(e,t){var i=document.getElementById("qualityStatus");i&&(i.className="grey-status");var n=document.getElementById("stats");n&&(n.innerHTML="Not connected"),!this.connectOnLoad||this.isReconnection?(this.showConnectOverlay(),this.eventHandler.invalidateFreezeFrameOverlay(),this.shouldShowPlayOverlay=!0,this.eventHandler.resizePlayerStyle()):(console.log("直接链接~~~~~~"),this.connect(e,t))}},{key:"buildingGrowthAnimate",value:function(e){var t=e.state,i=void 0===t?"play":t,n=e.group,a=void 0===n?1:n,r=e.duration,o=void 0===r?3e3:r,s=e.startHeight,l=void 0===s?0:s,u=e.endHeight,c=void 0===u?100:u,d=e.loop,h=void 0!==d&&d,f=e.easing,p=void 0===f?"Linear":f,m=e.sliceColor,g=void 0===m?{r:1,g:0,b:0}:m,v=e.sliceBrightness,y=void 0===v?30:v,b=e.colorHeight,x=void 0===b?100:b;this.emitUIInteraction({excuteName:K.BUILD_GROWTHANIMATE,params:JSON.stringify({State:i,Group:a,Duration:o,StartHeight:l,EndHeight:c,Loop:h,Easing:p,SliceColor:g,SliceBrightness:y,ColorHeight:x})})}},{key:"changeResolution",value:function(e,t){if(void 0===e||void 0===t||e<=0||t<=0)console.warn("[PixelStream] 传入的分辨率参数无效:",e,t);else{var i=4096,n=e,a=t,r=[];if(n>i)a=(n=i)/(e/t),r.push("宽度 ".concat(e," 超过安全限制 ").concat(i,",已按比例缩放"));var o=2*Math.floor(n/2),s=2*Math.floor(a/2);o===n&&s===a||n%2==0&&a%2==0||r.push("分辨率包含奇数,已修正为偶数"),a=s,(n=o)===e&&a===t||console.warn("[PixelStream] 分辨率自动修正提示:\n"+"原目标: ".concat(e," x ").concat(t,"\n")+"修正后: ".concat(n," x ").concat(a,"\n")+"原因: ".concat(r.join(", ")||"数值取整")),console.log("[PixelStream] Sending command: r.SetRes ".concat(n,"x").concat(a)),this.emitUIInteraction({excuteName:Z.CONSOLE_COMMAND,params:{Command:"r.SetRes "+n+"x"+a}})}}},{key:"changeRenderBitrate",value:function(e){if(null!=e){if(-1===e)return console.log("执行命令: 解除码率限制 (Set to -1)"),this.excuteEngineConsoleCommand("PixelStreaming.Encoder.MaxBitrate -1"),void this.excuteEngineConsoleCommand("PixelStreaming.Encoder.TargetBitrate -1");var t=Number(e);if(!isNaN(t)){var i=(t=Math.max(1e5,t)).toFixed(0);this.excuteEngineConsoleCommand("PixelStreaming.Encoder.MaxBitrate "+i),this.excuteEngineConsoleCommand("PixelStreaming.Encoder.TargetBitrate "+i)}}else console.warn("传入的参数为空")}},{key:"excuteEngineConsoleCommand",value:function(e){void 0!==e?this.emitUIInteraction({excuteName:Z.CONSOLE_COMMAND,params:{Command:e}}):console.warn("传入的参数为空")}},{key:"Swtich3DTilesMode",value:function(e){var t=e.mode,i=e.tilesName;this.emitUIInteraction({excuteName:Q.SWITCH_TERRAIN_MODE,params:{Mode:t,TilesName:i}})}},{key:"enable3DTilesByName",value:function(e){var t=e.enable,i=void 0===t||t,n=e.tilesName;this.emitUIInteraction({excuteName:Q.ENABLE_3DTILES_BY_NAME,params:{Enable:i,TilesName:n}})}},{key:"hidden3DTilesItem",value:function(e){var t=e.hiddenList,i=void 0===t?[]:t,n=e.tilesName;Array.isArray(i)||(i=[]),this.emitUIInteraction({excuteName:Q.HIDDEN_3DTILES_ITEM,params:{HiddenList:i,TilesName:n}})}},{key:"changeWeather",value:function(e){console.warn("方法被移除,请使用UDS设置天气"),e&&this.UDS.changeWeather(e)}},{key:"changeTime",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:8,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;console.warn("方法被移除,请使用UDS设置时间"),this.UDS.changeTime(e,t)}},{key:"setWorldCenterPoint",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;if(void 0===e||void 0===t)return console.warn("传入的参数为空"),!1;this.emitUIInteraction({excuteName:Z.RESET_WORLD_CENTER,params:{Center:{Latitude:a.clamp(t,-90,90),Longitude:a.clamp(e,-180,180),Altitude:a.clamp(i,-500,8848)}}})}},{key:"SetPlanePOIMode",value:function(e){var t=e.enable,i=void 0!==t&&t,n=e.cullingScale,a=void 0===n?2:n,r=e.aspectRatio,o=void 0===r?1.777778:r,s=e.cameraFov,l=void 0===s?90:s,u=e.maxTilesCullingDistance,c=void 0===u?1e3:u,d=e.maxPOICullingDistance,h=void 0===d?2e3:d,f=e.poiSimplifyDistance,p=void 0===f?1500:f,m=e.maxLoadedPoiTilesNum,g=void 0===m?5:m;this.emitUIInteraction({excuteName:Q.SET_PLANE_POI_MODE,params:{EnablePoi:i,CullingScale:a,AspectRatio:o,CameraFov:l,MaxTilesCullingDistance:c,MaxPOICullingDistance:h,PoiSimplifyDistance:p,MaxLoadedPoiTilesNum:g}})}},{key:"moveTo",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{roll:0,pitch:0,yaw:0},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{duration:1,preload:!1,endLineDetect:!1,detectLength:5e4,flyOverLongitude:!1,zoom:-1,number:0,isGlobalMove:!1,globalCityCenter:null,callback:null};if(!e)return!1;this._silentlyRemoveEventListener(this.camera,"moveTo",this._moveToCallback),this._moveToCallback=i.callback,this.emitUIInteraction({excuteName:X.MOVE_TO,params:{Longitude:null==e?void 0:e.x,Latitude:null==e?void 0:e.y,Altitude:null==e?void 0:e.z,rotation:{Roll:null==t?void 0:t.roll,Pitch:null==t?void 0:t.pitch,Yaw:null==t?void 0:t.yaw},Duration:null==i?void 0:i.duration,Preload:null==i?void 0:i.preload,EndLineDetect:null==i?void 0:i.endLineDetect,DetectLength:null==i?void 0:i.detectLength,FlyOverLongitude:null==i?void 0:i.flyOverLongitude,Zoom:null==i?void 0:i.zoom,Number:null==i?void 0:i.number,IsGlobalMove:null==i?void 0:i.isGlobalMove,GlobalCityCenter:null==i?void 0:i.globalCityCenter}}),console.log("moveTo options is ",i),console.log("moveTo this.camera is ",this.camera),null!=i&&i.callback&&this.camera.addEventListener("moveTo",i.callback)}},{key:"moveCamera",value:function(e){var t=e.multiplier,i=void 0===t?1:t,n=e.x,a=void 0===n?0:n,r=e.y,o=void 0===r?0:r;this.emitUIInteraction({excuteName:X.MOVE,params:{Multiplier:i,ActionValue:{x:a,y:o}}})}},{key:"rotateCamera",value:function(e){var t=e.multiplier,i=void 0===t?1:t,n=e.yaw,a=void 0===n?0:n,r=e.pitch,o=void 0===r?0:r;this.emitUIInteraction({excuteName:X.ROTATE,params:{Multiplier:i,ActionValue:{x:a,y:o}}})}},{key:"zoomIn",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;this.emitUIInteraction({excuteName:X.ZOOM_IN,params:{Multiplier:e}})}},{key:"zoomOut",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;this.emitUIInteraction({excuteName:X.ZOOM_OUT,params:{Multiplier:e}})}},{key:"focusOn",value:function(e){var t,i,n,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{duration:1,index:-1,preload:!1,rotation:{roll:0,pitch:0,yaw:0},flyOverLongitude:!1,callback:null};if(!e)return!1;this.emitUIInteraction({excuteName:X.FOCUS_ON,params:{uuid:null==e?void 0:e.uuid,type:null==e?void 0:e.type,rotation:{Roll:null==a||null===(t=a.rotation)||void 0===t?void 0:t.roll,Pitch:null==a||null===(i=a.rotation)||void 0===i?void 0:i.pitch,Yaw:null==a||null===(n=a.rotation)||void 0===n?void 0:n.yaw},Duration:null==a?void 0:a.duration,Preload:null==a?void 0:a.preload,Index:null==a?void 0:a.index,FlyOverLongitude:null==a?void 0:a.flyOverLongitude}}),null!=a&&a.callback&&this.camera.addEventListener("focusOn",a.callback)}},{key:"OrbitAroundFocusPoint",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.traget,i=void 0===t?[]:t,n=e.distance,a=void 0===n?10:n,r=e.time,o=void 0===r?10:r,s=e.loop,l=void 0===s||s,u=e.pitch,c=void 0===u?-25:u;i?"number"==typeof a&&"number"==typeof o&&"number"==typeof c?this.emitUIInteraction({excuteName:X.ORBIT_AROUND,params:JSON.stringify({Start:!0,Target:i,Distance:a,Time:o,Loop:l,Pitch:c})}):console.warn("OrbitAroundFocusPoint: distance, time and pitch should be numbers."):console.warn("OrbitAroundFocusPoint: traget is required.")}},{key:"stopOrbitAround",value:function(){this.emitUIInteraction({excuteName:X.ORBIT_AROUND,params:JSON.stringify({Start:!1})})}},{key:"navigateByKeypoints",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=i.lockAll,a=void 0===n||n,r=i.speed,o=void 0===r?36:r,s=i.time,l=void 0===s?0:s,u=i.ignoreLag,c=void 0!==u&&u,d=i.name,h=void 0===d?"":d,f=i.patrolType,p=void 0===f?"default":f,m=i.followRotation,g=void 0===m?{Roll:!1,Pitch:!1,Yaw:!1}:m,v=i.finishDestory,y=void 0===v||v,b=i.rayDetectionDistance,x=void 0===b?1e3:b,S=i.callback,w=void 0===S?null:S,N=i.startCallback,U=void 0===N?null:N,k=i.finishCallback,C=void 0===k?null:k;if(!e||e.length<2)return!1;this._silentlyRemoveEventListener(this.camera,"navigationStart",this._navigationStartCallback),this._silentlyRemoveEventListener(this.camera,"navigationFinish",this._navigationFinishCallback),this._navigationStartCallback=U,this._navigationFinishCallback=C||w,U&&this.camera.addEventListener("navigationStart",U);for(var T=[],R=0,O=e.length;R<O;R++){var E=e[R];T.push(E[0],E[1],E[2]||10,E[3]||0,E[4]||0,E[5]||0)}setTimeout((function(){t.emitUIInteraction({excuteName:X.NAVIGATION,params:JSON.stringify({jsondata:T,Speed:o,Name:h,Time:l,IgnoreLag:c,LockAll:a,PatrolType:p,FollowRotation:g,RayDetectionDistance:x,FinishDestory:y})})}),100),(C||w)&&(C?this.camera.addEventListener("navigationFinish",C):this.camera.addEventListener("navigationFinish",w))}},{key:"pauseNavigation",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).patrolType,t=void 0===e?"default":e;this.emitUIInteraction({excuteName:X.NAVIGATION_PAUSE,params:{State:0,PatrolType:t}})}},{key:"resumeNavigation",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).patrolType,t=void 0===e?"default":e;this.emitUIInteraction({excuteName:X.NAVIGATION_PAUSE,params:{State:1,PatrolType:t}})}},{key:"stopNavigation",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=t.patrolType,n=void 0===i?"default":i,a=t.delayTime;setTimeout((function(){e.emitUIInteraction({excuteName:X.NAVIGATION_STOP,params:{PatrolType:n}})}),void 0===a?100:a)}},{key:"enableDataLayerByName",value:function(e,t){this.emitUIInteraction({excuteName:K.ENABLE_DATALAYER,params:{Visible:t,DataLayerName:e}})}},{key:"project",value:function(e,t){if(!e)return!1;this.emitUIInteraction({excuteName:X.PROJECT,params:{Position:{x:e.x,y:e.y,z:e.z}}}),this.camera.addEventListener("project",t)}},{key:"unproject",value:function(e,t){if(!e)return!1;this.emitUIInteraction({excuteName:X.UNPROJECT,params:{Position:{x:e.x,y:e.y}}}),this.camera.addEventListener("unproject",t)}},{key:"getAltitudeFromCoordinate",value:function(e,t){var i=this;if(!e)return!1;var n={Coordinate:e.coordinate,DetectLength:e.detectLength||100};this.addEventListener("getAltitude",t),setTimeout((function(){i.emitUIInteraction({excuteName:Q.GET_ALTITUDE,params:n})}),100)}},{key:"exit",value:function(){console.warn("方法将被移除,请使用new LevelManage().exit()"),this.emitUIInteraction({excuteName:Z.EXIT_CLIENT})}},{key:"restartGame",value:function(){console.warn("方法将被移除,new LevelManage().restartGame()"),this.emitUIInteraction({excuteName:Z.RESTART_GAME}),this.dispatchEvent({type:"gameResarted"})}},{key:"addToScene",value:function(e){e&&(this.scene.add(e),this.textureBus&&e.texture&&!e.textureRef&&this.textureBus.publishTexture(e.texture).then((function(t){var i=t.ref;e.textureRef=i})).catch((function(){})),e.materialNeedsUpdate=!1,e.matrixNeedsUpdate=!1,e.animateNeedsUpdate=!1,"TrafficLayer"===e.type?this.emitUIInteraction({excuteName:Z.CREATE_TRAFFIC_STREAM,params:e.toJSON(!1)}):"LayerBuilding"===e.type?this.emitUIInteraction({excuteName:Q.EVENT_LAYER_BUILDING,params:e.toJSON(!1)}):"SlopeAnalysis"===e.type?this.emitUIInteraction({excuteName:Q.UPDATA_SLOPE_ANALYSIS,params:e.toJSON()}):"ModelSlice"===e.type?this.emitUIInteraction({excuteName:"Interact_ModelSlice",params:e.toJSON()}):this.emitUIInteraction({excuteName:ee.ADD,params:e.toJSON(!1)}))}},{key:"removeFromScene",value:function(e){this.destoryObject(e)}},{key:"removeAllFromScene",value:function(){this.emitUIInteraction({excuteName:ee.DESTORY_ALL}),this.scene.clear()}},{key:"destoryObject",value:function(e){e&&("TrafficLayer"===e.type?this.emitUIInteraction({excuteName:Z.CLOSE_TRAFFIC_STREAM,params:e.toJSON(!1)}):"LayerBuilding"===e.type?(e.buildingState="destory",this.emitUIInteraction({excuteName:Q.EVENT_LAYER_BUILDING,params:e.toJSON(!1)})):"ModelSlice"===e.type?this.emitUIInteraction({excuteName:"Interact_ModelSlice",params:{Enable:!1}}):this.emitUIInteraction({excuteName:ee.DESTORY,uuid:e.uuid}),e.dispose&&e.dispose(),this.scene.remove(e))}},{key:"enableEdit",value:function(e,t,i){var n=null,a={};if(this.drawAndMeasureGroup||(this.drawAndMeasureGroup=new c,this.scene.add(this.drawAndMeasureGroup)),"measure"===e)switch(this.editMode="measure",n=te.ENABLE_MEASURE,t.toLowerCase()){case"polygon":case"measurearea":if(this.drawAndMeasureGroup.measureArea)this.drawAndMeasureGroup.measureArea.updateParameters(i);else{var r=new Et(i);this.drawAndMeasureGroup.measureArea=r,this.drawAndMeasureGroup.add(r)}a=this.drawAndMeasureGroup.measureArea.toJSON();break;case"line":case"measureline":if(this.drawAndMeasureGroup.measureLine)this.drawAndMeasureGroup.measureLine.updateParameters(i);else{var o=new zt(i);this.drawAndMeasureGroup.measureLine=o,this.drawAndMeasureGroup.add(o)}a=this.drawAndMeasureGroup.measureLine.toJSON();break;case"surfaceline":if(this.drawAndMeasureGroup.surfaceline)this.drawAndMeasureGroup.surfaceline.updateParameters(i);else{var s=new It(i);this.drawAndMeasureGroup.surfaceline=s,this.drawAndMeasureGroup.add(s)}a=this.drawAndMeasureGroup.surfaceline.toJSON();break;default:if(this.drawAndMeasureGroup.locationPoint)this.drawAndMeasureGroup.locationPoint.updateParameters(i);else{var l=new At(i);this.drawAndMeasureGroup.locationPoint=l,this.drawAndMeasureGroup.add(l)}a=this.drawAndMeasureGroup.locationPoint.toJSON()}else switch(this.editMode="draw",n=te.ENABLE_DRAW,t){case"polygon":if(this.drawAndMeasureGroup.polygon)for(var u in i)this.drawAndMeasureGroup.polygon[u]!==i[u]&&(this.drawAndMeasureGroup.polygon[u]=i[u]);else{var d=new yt(i);this.drawAndMeasureGroup.polygon=d,this.drawAndMeasureGroup.add(d)}a=this.drawAndMeasureGroup.polygon.toJSON(0);break;case"line":if(this.drawAndMeasureGroup.line)for(var h in i)this.drawAndMeasureGroup.line[h]!==i[h]&&(this.drawAndMeasureGroup.line[h]=i[h]);else{var f=new bt(i);this.drawAndMeasureGroup.line=f,this.drawAndMeasureGroup.add(f)}a=this.drawAndMeasureGroup.line.toJSON(0);break;default:if(this.drawAndMeasureGroup.point)for(var p in i)this.drawAndMeasureGroup.point[p]!==i[p]&&(this.drawAndMeasureGroup.point[p]=i[p]);else{var m=new xt(i);this.drawAndMeasureGroup.point=m,this.drawAndMeasureGroup.add(m)}a=this.drawAndMeasureGroup.point.toJSON()}this.emitUIInteraction({ExcuteName:n,params:a})}},{key:"closeEdit",value:function(){if(this.editMode){var e=te.CLOSE_DRAW;"measure"===this.editMode&&(e=te.CLOSE_MEASURE),this.emitUIInteraction({ExcuteName:e})}}},{key:"setFPS",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.emitUIInteraction({ExcuteName:K.ENABLE_FPS,params:{state:e}})}},{key:"removeAllEditObjects",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"all",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["point","line","polygon","surfaceline"];if(this.drawAndMeasureGroup&&!(this.drawAndMeasureGroup.children.length<1)){var i=[];if(e)switch(e){case"draw":(!Array.isArray(t)||t.length<1)&&(t=["point","line","polygon"]),t.indexOf("polygon")>-1&&this.drawAndMeasureGroup.polygon&&(i.push(this.drawAndMeasureGroup.polygon.uuid),this.drawAndMeasureGroup.polygon.removeFromParent(),this.drawAndMeasureGroup.polygon=null),t.indexOf("line")>-1&&this.drawAndMeasureGroup.line&&(i.push(this.drawAndMeasureGroup.line.uuid),this.drawAndMeasureGroup.line.removeFromParent(),this.drawAndMeasureGroup.line=null),t.indexOf("point")>-1&&this.drawAndMeasureGroup.point&&(i.push(this.drawAndMeasureGroup.point.uuid),this.drawAndMeasureGroup.point.removeFromParent(),this.drawAndMeasureGroup.point=null),this.emitUIInteraction({ExcuteName:te.DESTORY_DRAW,params:{uuids:i,Classes:t}});break;case"measure":(!Array.isArray(t)||t.length<1)&&(t=["point","line","polygon","surfaceline"]);var n=t.indexOf("polygon");n>-1&&(t.splice(n,1),t.push("MeasureArea")),n>-1&&this.drawAndMeasureGroup.measureArea&&(i.push(this.drawAndMeasureGroup.measureArea.uuid),this.drawAndMeasureGroup.measureArea.removeFromParent(),this.drawAndMeasureGroup.measureArea=null),(n=t.indexOf("line"))>-1&&(t.splice(n,1),t.push("MeasureLine")),n>-1&&this.drawAndMeasureGroup.measureLine&&(i.push(this.drawAndMeasureGroup.measureLine.uuid),this.drawAndMeasureGroup.measureLine.removeFromParent(),this.drawAndMeasureGroup.measureLine=null),(n=t.indexOf("point"))>-1&&(t.splice(n,1),t.push("LocationPoint")),n>-1&&this.drawAndMeasureGroup.locationPoint&&(i.push(this.drawAndMeasureGroup.locationPoint.uuid),this.drawAndMeasureGroup.locationPoint.removeFromParent(),this.drawAndMeasureGroup.locationPoint=null),(n=t.indexOf("surfaceline"))>-1&&(t.splice(n,1),t.push("SurfaceLine")),n>-1&&this.drawAndMeasureGroup.surfaceline&&(i.push(this.drawAndMeasureGroup.surfaceline.uuid),this.drawAndMeasureGroup.surfaceline.removeFromParent(),this.drawAndMeasureGroup.surfaceline=null),this.emitUIInteraction({ExcuteName:te.DESTORY_MEASURE,params:{uuids:i,Classes:t}});break;case"all":this.emitUIInteraction({ExcuteName:te.DESTORY_DRAW,params:{uuids:i,Classes:["Point","Line","Polygon"]}}),this.emitUIInteraction({ExcuteName:te.DESTORY_MEASURE,params:{uuids:i,Classes:["MeasureArea","MeasureLine","LocationPoint","SurfaceLine"]}}),this.drawAndMeasureGroup.children=[],this.scene.remove(this.drawAndMeasureGroup),this.drawAndMeasureGroup=null}}}},{key:"connect",value:(t=w(D().mark((function t(){var i,n,a,r,o,s,l,u=arguments;return D().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i=u.length>0&&void 0!==u[0]?u[0]:function(){},n=u.length>1&&void 0!==u[1]?u[1]:function(){},r=function(e){console.log("connectToStreamer wsURL :>> ",e),window.WebSocket=window.WebSocket||window.MozWebSocket,window.WebSocket?(a.reclickToStart&&clearTimeout(a.reclickToStart),a.ws=new WebSocket(e),a.ws.onopen=function(t){a.connected||(a.dispatchEvent({type:"connected"}),a.connected=!0),console.log("".concat(e," WebSocket connection")),a.startPSHeartbeat(),console.log("Start the heartbeat detection of the signaling server.")},a.ws.onmessage=function(e){if("string"==typeof e.data){var t=JSON.parse(e.data);"config"===t.type?(console.log("%c[Inbound SS (config)]","background: lightblue; color: black",t),a.onConfig(t)):"playerCount"===t.type?console.log("%c[Inbound SS (playerCount)]","background: lightblue; color: black",t):"offer"===t.type?(console.log("%c[Inbound SS (offer)]","background: lightblue; color: black",t),a.onWebRtcOffer(t)):"answer"===t.type?(console.log("%c[Inbound SS (answer)]","background: lightblue; color: black",t),a.onWebRtcAnswer(t)):"iceCandidate"===t.type?a.onWebRtcIce(t.candidate):"warning"===t.type&&t.warning?console.warn(t.warning):"pong"===t.type?console.log("pong",t.time):console.error("Invalid SS message type",t.type)}},a.ws.onerror=function(e){console.log("WS error: ".concat(JSON.stringify(e))),a.stopPSHeartbeat(),a.dispatchEvent({type:"signalingServerError"})},a.ws.onclose=function(e){console.log("WS closed: ".concat(JSON.stringify(e.code)," - ").concat(e.reason)),a.stopPSHeartbeat(),a.textureBus&&a.textureBus.resetUploadState(),a.ws=void 0,a.isReconnection=!0,a.connected&&(a.connected=!1);var t=document.getElementById("player");a.webRtcPlayerObj&&(t.removeChild(a.webRtcPlayerObj.video),a.webRtcPlayerObj.close(),a.webRtcPlayerObj=void 0),a.showTextOverlay("云渲染服务未正常连接"),a.reclickToStart=setTimeout((function(){a.connect(i,n)}),1500)}):alert("Your browser doesn't support WebSocket")},(a=this).wsURL){t.next=35;break}if(!e.DispatchServer.host){t.next=13;break}return console.log("用新版调度服务启动 ".concat(e.DispatchServer.host,"/api/tasks/create")),t.next=9,e.DispatchServer.CreateTask(a.projectName);case 9:0===(o=t.sent).status?(a.forceTURN=o.data.useTurnServer,a.wsURL=o.data.playerToken?"ws://".concat(o.data.host,":").concat(o.data.port,"?token=").concat(encodeURIComponent(o.data.playerToken)):"ws://".concat(o.data.host,":").concat(o.data.port),a.currentTask=o,r(a.wsURL),i&&i("Successfully created task: "+o)):(console.error("Failed to create task:"+o.message),n&&n("Failed to create task: "+o.message)),t.next=33;break;case 13:if(!a.matchmakerIP){t.next=31;break}return s="http://".concat(a.matchmakerIP,":").concat(a.matchmakerPort,"/gpuserver?project=").concat(a.projectName),t.prev=15,t.next=18,y.get(s);case 18:if(!(l=t.sent).data||!l.data.error){t.next=22;break}return console.error(l.data.error),t.abrupt("return",!1);case 22:a.wsURL="ws://".concat(l.data.gpuServer,":").concat(l.data.port),r(a.wsURL),t.next=29;break;case 26:t.prev=26,t.t0=t.catch(15),console.error(t.t0);case 29:t.next=33;break;case 31:return console.error("Needs a matchmaker's IP"),t.abrupt("return",!1);case 33:t.next=36;break;case 35:r(a.wsURL);case 36:case"end":return t.stop()}}),t,this,[[15,26]])}))),function(){return t.apply(this,arguments)})},{key:"startPSHeartbeat",value:function(){var t=this;e.DispatchServer.host&&(this.heartbeatInterval=setInterval((function(){t.ws.readyState===WebSocket.OPEN&&(t.ws.send('{"type":"ping"}'),console.log("Heartbeat send: Ping"))}),2e3))}},{key:"stopPSHeartbeat",value:function(){this.heartbeatInterval&&clearInterval(this.heartbeatInterval)}},{key:"onConfig",value:function(e){var t=document.getElementById("player"),i=this.setupWebRtcPlayer(t,e);switch(this.eventHandler.resizePlayerStyle(),this.inputOptions.controlScheme){case oe.HoveringMouse:this.eventHandler.registerHoveringMouseEvents(i);break;case oe.LockedMouse:this.eventHandler.registerLockedMouseEvents(i);break;default:console.log("ERROR: Unknown control scheme ".concat(this.inputOptions.controlScheme)),this.eventHandler.registerLockedMouseEvents(i)}}},{key:"setupModelInfo",value:function(e,t,i,n){if(!e)return!1;if(!n){var a=new URL(e),r=a.protocol,o=a.host,s=a.search,l=a.pathname.split("/").filter(Boolean);0===l.length?l.push("getStaticResourceUrl"):l[l.length-1]="getStaticResourceUrl";var u="/"+l.join("/");n="".concat(r,"//").concat(o).concat(u).concat(s)}t||(t={all:1,common:1,project_id:"418690084255052706"}),this.emitUIInteraction({excuteName:K.ASSET_MODEL,params:{ModInfoUrl:e,StaticResourceURL:n,ModInfoBody:t,ModInfoHeader:i}})}},{key:"initOthers",value:function(){var e=this;this.initCamera(),document.addEventListener("keydown",(function(e){(116===e.keyCode||e.ctrlKey&&82===e.keyCode)&&(window._frash_=!0)})),this.isSequencer&&(this.sequencerEnvironment=new ve(this)),window.onbeforeunload=function(){e.levelReady||window._frash_||(e.levelReady=!0),window._frash_=!1}}},{key:"load",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){},i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};"cloud"==this.renderMode&&(this.eventHandler.setupHtmlEvents(),this.eventHandler.setupFreezeFrameOverlay(),this.eventHandler.registerKeyboardEvents(),window.addEventListener("resize",(function(){return e.updateVideoStreamSize()})),this.start(t,i),Wt((new Date).getTime()))}}]);var t,i,n}();function Wt(){Bt(Wt),v.update()}function jt(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if("string"!=typeof e)throw new Error("decodeBase64: 输入必须是字符串");var i=e.replace(/[\s=]/g,"");try{for(var n=atob(i),a=new Uint8Array(n.length),r=0;r<n.length;r++)a[r]=n.charCodeAt(r);return t?a:(new TextDecoder).decode(a)}catch(e){throw new Error("decodeBase64: 无效的 Base64 字符串")}}R(Ft,"DispatchServer",Pt);var Ht={encodeBase64:function(e){if("string"==typeof e){var t=(new TextEncoder).encode(e);return btoa(String.fromCharCode.apply(String,W(t)))}if(e instanceof Uint8Array)return btoa(String.fromCharCode.apply(String,W(e)));throw new Error("encodeBase64: 输入必须是字符串或 Uint8Array")},decodeBase64:jt,isValidBase64:function(e){if("string"!=typeof e)return!1;if(!/^[A-Za-z0-9+/]*={0,2}$/.test(e))return!1;try{return jt(e),!0}catch(e){return!1}}},Gt=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};U(this,e),(t=N(this,e,[i])).parameters=i,t.renderNum=void 0===i.renderNum?20:i.renderNum,t.visible=void 0===i.visible||i.visible;var n=i.width||1,a=i.circleScale||50,r=void 0!==i.startHide&&i.startHide,o=void 0!==i.endHide&&i.endHide,s=i.speed||.5,l=i.opacity||.02,u=i.brightness||100,c=i.angle||40;return t.type="ODLine",Object.defineProperties(t,{angle:{configurable:!0,enumerable:!0,get:function(){return c},set:function(e){c=e,t.materialNeedsUpdate=!0}},width:{configurable:!0,enumerable:!0,get:function(){return n},set:function(e){n=e,t.materialNeedsUpdate=!0}},circleScale:{configurable:!0,enumerable:!0,get:function(){return a},set:function(e){a=e,t.materialNeedsUpdate=!0}},startHide:{configurable:!0,enumerable:!0,get:function(){return r},set:function(e){r=e,t.materialNeedsUpdate=!0}},endHide:{configurable:!0,enumerable:!0,get:function(){return o},set:function(e){o=e,t.materialNeedsUpdate=!0}},speed:{configurable:!0,enumerable:!0,get:function(){return s},set:function(e){s=e,t.materialNeedsUpdate=!0}},opacity:{configurable:!0,enumerable:!0,get:function(){return l},set:function(e){l=e,t.materialNeedsUpdate=!0}},brightness:{configurable:!0,enumerable:!0,get:function(){return u},set:function(e){u=e,t.materialNeedsUpdate=!0}}}),t}return z(e,vt),C(e,[{key:"setData",value:function(e){this.data=it(e,!1,{enableDP:!1})}},{key:"toJSON",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return!e||!this.visibleNeedsUpdate||this.visible&&this.materialNeedsUpdate?{Color:{r:this.color.r,g:this.color.g,b:this.color.b,a:this.opacity},Brightness:this.brightness,Metallic:this.metallic,Angle:this.angle,Roughness:this.roughness,Opacity:this.opacity,Transparent:this.transparent,Texture:this.texture,BloomColor:this.bloomColor?{r:this.bloomColor.r,g:this.bloomColor.g,b:this.bloomColor.b,a:1}:null,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},type:this.type,uuid:this.uuid,jsondata:e?null:this.data,Width:this.width,CircleScale:this.circleScale,StartHide:this.startHide,EndHide:this.endHide,Speed:this.speed,matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,animateNeedsUpdate:this.animateNeedsUpdate,animateJson:this.animateNeedsUpdate?this.animateJson:null,RenderNum:this.renderNum}:{matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},type:this.type,name:this.name,uuid:this.uuid}}},{key:"copy",value:function(t){var i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return this.width=t.width,this.circleScale=t.circleScale,this.speed=t.speed,this.startHide=t.startHide,this.endHide=t.endHide,F(e,"copy",this)([t,i]),this}}])}();function Vt(e){switch(e){case 0:return"DoNotFcaeToCamera";case 1:default:return"FacetoCamera_XYZ";case 2:return"FacetoCamera_Y";case 3:return"FacetoCamera_Z"}}var Jt=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};U(this,e),(t=N(this,e,[i])).renderNum=void 0===i.renderNum?20:i.renderNum;var n=i.pivot||{x:.5,y:.5};t.visible=void 0===i.visible||i.visible,t.isGlobalPOI=void 0!==i.isGlobalPOI&&i.isGlobalPOI;var a=i.text||null,r=i.iconUrl||"",o=i.texture||"",s=i.width||32,l=i.height||32,u=i.iconPathName||"",c=void 0===i.hideText||i.hideText,d=void 0!==i.hideImage&&i.hideImage,h=i.renderScale||1;t.renderType=i.renderType||0,t.openCollision=void 0!==i.openCollision&&i.openCollision;var f=0===i.faceType?0:i.faceType||1,p=void 0!==i.switchScale&&i.switchScale,m=i.minScale||0,g=i.maxScale||0,v=i.fontSize||12;return t.fadeIn=void 0===i.fadeIn||i.fadeIn,t.type="IconPoint",Object.defineProperties(t,{pivot:{configurable:!0,enumerable:!0,get:function(){return n},set:function(e){n=e,t.materialNeedsUpdate=!0}},text:{configurable:!0,enumerable:!0,get:function(){return a},set:function(e){a=e,t.materialNeedsUpdate=!0}},iconUrl:{configurable:!0,enumerable:!0,get:function(){return r},set:function(e){r=e,t.materialNeedsUpdate=!0}},texture:{configurable:!0,enumerable:!0,get:function(){return o},set:function(e){o=e,t.materialNeedsUpdate=!0}},width:{configurable:!0,enumerable:!0,get:function(){return s},set:function(e){s=e,t.materialNeedsUpdate=!0}},height:{configurable:!0,enumerable:!0,get:function(){return l},set:function(e){l=e,t.materialNeedsUpdate=!0}},faceType:{configurable:!0,enumerable:!0,get:function(){return f},set:function(e){f=e,t.materialNeedsUpdate=!0}},switchScale:{configurable:!0,enumerable:!0,get:function(){return p},set:function(e){p=e,t.materialNeedsUpdate=!0}},minScale:{configurable:!0,enumerable:!0,get:function(){return m},set:function(e){m=e,t.materialNeedsUpdate=!0}},maxScale:{configurable:!0,enumerable:!0,get:function(){return g},set:function(e){g=e,t.materialNeedsUpdate=!0}},iconPathName:{configurable:!0,enumerable:!0,get:function(){return u},set:function(e){u=e,t.materialNeedsUpdate=!0}},hideText:{configurable:!0,enumerable:!0,get:function(){return c},set:function(e){c=e,t.materialNeedsUpdate=!0}},hideImage:{configurable:!0,enumerable:!0,get:function(){return d},set:function(e){d=e,t.materialNeedsUpdate=!0}},renderScale:{configurable:!0,enumerable:!0,get:function(){return h},set:function(e){h=e,t.materialNeedsUpdate=!0}},fontSize:{configurable:!0,enumerable:!0,get:function(){return v},set:function(e){v=e,t.materialNeedsUpdate=!0}}}),t}return z(e,vt),C(e,[{key:"toJSON",value:function(){var e,t,i,n,a=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return!a||!this.visibleNeedsUpdate||this.visible&&this.materialNeedsUpdate?{Pivot:this.pivot,Color:{r:this.color.r,g:this.color.g,b:this.color.b,a:this.opacity},Brightness:this.brightness,Metallic:this.metallic,Roughness:this.roughness,Opacity:this.opacity,Transparent:this.transparent,Texture:null!==(e=this.parent)&&void 0!==e&&null!==(t=e.engine)&&void 0!==t&&t.enableTextureBus&&this.textureRef?null:this.texture,TextureRef:null!==(i=this.parent)&&void 0!==i&&null!==(n=i.engine)&&void 0!==n&&n.enableTextureBus&&this.textureRef?this.textureRef:null,BloomColor:this.bloomColor?{r:this.bloomColor.r,g:this.bloomColor.g,b:this.bloomColor.b,a:1}:null,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},type:this.type,uuid:this.uuid,jsondata:a?null:this._resolveJsonData(),IconUrl:this.iconUrl,Width:this.width,Height:this.height,IconPathName:this.iconPathName,IsGlobalPOI:this.isGlobalPOI,HideText:this.hideText,HideImage:this.hideImage,RenderScale:this.renderScale,FontSize:this.fontSize,RenderType:this.renderType,FadeIn:this.fadeIn,OpenCollision:this.openCollision,FaceType:Vt(this.faceType),SwitchScale:this.switchScale,MaxScale:this.maxScale,MinScale:this.minScale,matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,animateNeedsUpdate:this.animateNeedsUpdate,animateJson:this.animateNeedsUpdate?this.animateJson:null,Size:this.size,SizeAttenuation:this.sizeAttenuation,RenderNum:this.renderNum}:{matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},FadeIn:this.fadeIn,type:this.type,name:this.name,uuid:this.uuid}}},{key:"copy",value:function(t){var i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return this.iconUrl=t.iconUrl,this.width=t.width,this.height=t.height,this.iconPathName=t.iconPathName,this.hideText=t.hideText,this.hideImage=t.hideImage,this.renderScale=t.renderScale,this.fontSize=t.fontSize,F(e,"copy",this)([t,i]),this}}])}(),qt=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};U(this,e),(t=N(this,e,[i])).renderNum=void 0===i.renderNum?20:i.renderNum,t.visible=void 0===i.visible||i.visible,t.isGlobalPOI=void 0!==i.isGlobalPOI&&i.isGlobalPOI;var n=i.backgroundColor||{r:0,g:0,b:0,a:0},a=i.backgroundImage||"",r=t.getMargin(i.margin)||{Top:0,Right:0,Bottom:0,Left:0},o=i.fontSize||24,s=i.fontWeight||"Regular",l=i.borderWidth||0,u=i.borderColor||{r:0,g:0,b:0,a:1},c=i.shadowColor||{r:0,g:0,b:0,a:1},d=i.shadowOffset||{x:0,y:0},h=i.pivot||{x:.5,y:.5};t.renderType=i.renderType||0,t.fadeIn=void 0===i.fadeIn||i.fadeIn,t.openCollision=void 0!==i.openCollision&&i.openCollision;var f=0===i.faceType?0:i.faceType||1,p=void 0!==i.switchScale&&i.switchScale,m=i.minDistance||0,g=i.maxDistance||0,v=void 0===i.minScale?1:i.minScale,y=void 0===i.maxScale?1:i.maxScale;return t.autoWrap=i.autoWrap||!1,t.type="TextPoint",Object.defineProperties(t,{backgroundImage:{configurable:!0,enumerable:!0,get:function(){return a},set:function(e){a=e,t.materialNeedsUpdate=!0}},backgroundColor:{configurable:!0,enumerable:!0,get:function(){return n},set:function(e){n=e,t.materialNeedsUpdate=!0}},margin:{configurable:!0,enumerable:!0,get:function(){return r},set:function(e){r=t.getMargin(e),t.materialNeedsUpdate=!0}},fontSize:{configurable:!0,enumerable:!0,get:function(){return o},set:function(e){o=e,t.materialNeedsUpdate=!0}},fontWeight:{configurable:!0,enumerable:!0,get:function(){return s},set:function(e){s=e,t.materialNeedsUpdate=!0}},borderWidth:{configurable:!0,enumerable:!0,get:function(){return l},set:function(e){l=e,t.materialNeedsUpdate=!0}},borderColor:{configurable:!0,enumerable:!0,get:function(){return u},set:function(e){u=e,t.materialNeedsUpdate=!0}},shadowColor:{configurable:!0,enumerable:!0,get:function(){return c},set:function(e){c=e,t.materialNeedsUpdate=!0}},shadowOffset:{configurable:!0,enumerable:!0,get:function(){return d},set:function(e){d=e,t.materialNeedsUpdate=!0}},pivot:{configurable:!0,enumerable:!0,get:function(){return h},set:function(e){h=e,t.materialNeedsUpdate=!0}},faceType:{configurable:!0,enumerable:!0,get:function(){return f},set:function(e){f=e,t.materialNeedsUpdate=!0}},switchScale:{configurable:!0,enumerable:!0,get:function(){return p},set:function(e){p=e,t.materialNeedsUpdate=!0}},minDistance:{configurable:!0,enumerable:!0,get:function(){return m},set:function(e){m=e,t.materialNeedsUpdate=!0}},maxDistance:{configurable:!0,enumerable:!0,get:function(){return g},set:function(e){g=e,t.materialNeedsUpdate=!0}},minScale:{configurable:!0,enumerable:!0,get:function(){return v},set:function(e){v=e,t.materialNeedsUpdate=!0}},maxScale:{configurable:!0,enumerable:!0,get:function(){return y},set:function(e){y=e,t.materialNeedsUpdate=!0}}}),t}return z(e,vt),C(e,[{key:"setData",value:function(e){this.data=nt(e)}},{key:"getMargin",value:function(e){var t;if(Array.isArray(e))return e.length<2?t={Top:e[0]||0,Right:e[0]||0,Bottom:e[0]||0,Left:e[0]||0}:e.length<3?t={Top:e[0]||0,Right:e[1]||0,Bottom:e[0]||0,Left:e[1]||0}:e.length<4?t={Top:e[0]||0,Right:e[1]||0,Bottom:e[2]||0,Left:e[1]||0}:e.length<5&&(t={Top:e[0]||0,Right:e[1]||0,Bottom:e[2]||0,Left:e[3]||0}),t}},{key:"toJSON",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return e&&this.visibleNeedsUpdate&&!this.materialNeedsUpdate?{matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,FadeIn:this.fadeIn,type:this.type,name:this.name,uuid:this.uuid}:{Pivot:this.pivot,Color:{r:this.color.r,g:this.color.g,b:this.color.b,a:this.opacity},BackgroundColor:{r:this.backgroundColor.r,g:this.backgroundColor.g,b:this.backgroundColor.b,a:this.backgroundColor.a},BackgroundImageURL:this.backgroundImage,IsGlobalPOI:this.isGlobalPOI,Margin:this.margin,AutoWrap:this.autoWrap,Brightness:this.brightness,Metallic:this.metallic,Roughness:this.roughness,Opacity:this.opacity,Transparent:this.transparent,Texture:this.texture,BloomColor:this.bloomColor?{r:this.bloomColor.r,g:this.bloomColor.g,b:this.bloomColor.b,a:1}:null,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},type:this.type,uuid:this.uuid,jsondata:e?null:this.data,FontWeight:this.fontWeight,FontSize:this.fontSize,BorderWidth:this.borderWidth,BorderColor:this.borderColor,ShadowColor:this.shadowColor,ShadowOffset:this.shadowOffset,RenderType:this.renderType,FadeIn:this.fadeIn,OpenCollision:this.openCollision,FaceType:Vt(this.faceType),SwitchScale:this.switchScale,MinDistance:this.minDistance,MaxDistance:this.maxDistance,MaxScale:this.maxScale,MinScale:this.minScale,matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,animateNeedsUpdate:this.animateNeedsUpdate,animateJson:this.animateNeedsUpdate?this.animateJson:null,RenderNum:this.renderNum}}},{key:"copy",value:function(t){var i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return this.fontWeight=t.fontWeight,this.fontSize=t.fontSize,this.borderWidth=t.borderWidth,this.borderColor=t.borderColor,this.shadowColor=t.shadowColor,this.shadowOffset=t.shadowOffset,F(e,"copy",this)([t,i]),this}}])}();function Yt(e,t){var i={};if(Object.assign(i,t),i.style){var n=i.style,a=n.width,r=n.height,o=n.borderRadius,s=n.borderWidth,l=n.paddingTop,u=n.paddingLeft;i.style.width=a*e,i.style.height=r*e,o&&(i.style.borderRadius=o*e),s&&(i.style.borderWidth=s*e),l&&(i.style.paddingTop=l*e),u&&(i.style.paddingLeft=u*e)}return i.content&&i.content.forEach((function(t){for(var i in t)"number"==typeof t[i]&&"id"!==i&&(t[i]=t[i]*e);var n=t.position;n&&(t.position=n.map((function(t){return t*e}))),t.textList&&t.textList.forEach((function(t){t.fontSize=t.fontSize*e,t.position=t.position.map((function(t){return t*e}))}))})),i}var Kt=function(){function e(t){var i;U(this,e),(i=N(this,e,[t])).renderNum=void 0===t.renderNum?20:t.renderNum,i.name=t.name||"",i.pivot=t.pivot||{x:.5,y:.5},i.offset=t.offset||{x:0,y:0,z:0},i.sizeAttenuation=t.sizeAttenuation||!1,i.constructionConfig=t.constructionConfig||{},i.labelType=t.labelType||"sprite",i.hideText=t.hideText||!1,i.faceType=0===t.faceType?0:t.faceType||1,i.switchScale=t.switchScale||!1,i.renderType=t.renderType||0;var n=t.renderScale||.3;i.minScale=t.minScale||1,i.maxScale=t.maxScale||1,i.type="IconPoint",i.visible=void 0===t.visible||t.visible,i.fadeIn=void 0===t.fadeIn||t.fadeIn;var a=t;return("mesh"===i.labelType||i.sizeAttenuation)&&(a=Yt(n,t)),i.style=a.style,i.drawCanvas=document.createElement("canvas"),i.animationCanvas=document.createElement("canvas"),i.mainView=null,i.sprite=null,i.texture=null,i.animateId=null,i.size=t.size||20,i.extraProps={args:t},a.style?(i.init(a).then((function(){i.materialNeedsUpdate=!0})),Object.defineProperties(i,{renderScale:{configurable:!0,enumerable:!0,get:function(){return n},set:function(e){n=e,i.materialNeedsUpdate=!0}}}),i):(console.warn("请正确设置BasicLabel的style"),L(i))}return z(e,vt),C(e,[{key:"init",value:(n=w(D().mark((function t(){var i,n,a,r=arguments;return D().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=r.length>0&&void 0!==r[0]?r[0]:{},(n=this.style).height,n.width,this.mainView=document.createElement("canvas"),t.next=5,e.initBackGround(this.style,this.mainView);case 5:if(a=t.sent,this.drawCanvas.width=this.animationCanvas.width=a.width,this.drawCanvas.height=this.animationCanvas.height=a.height,this.factor=a.factor,this.width=a.width,this.height=a.height,this.dispatchEvent({type:"loaded",label:this}),!i.content){t.next=15;break}return t.next=15,this.drawContent(i.content,!0);case 15:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"drawContent",value:function(){var t=w(D().mark((function t(i){var n,a,r,o,s,l,u,c=this,d=arguments;return D().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return d.length>1&&void 0!==d[1]&&d[1]||"mesh"!==this.labelType&&!this.sizeAttenuation||(i=Yt(this.renderScale,{content:i}).content),r=this.drawCanvas.getContext("2d"),o=this.drawCanvas,s=o.width,l=o.height,r.clearRect(0,0,s,l),r.drawImage(this.mainView,0,0,s,l),t.next=8,e.renderContent(this.style,i,this.drawCanvas,this.factor);case 8:this.texture=st(this.drawCanvas),(u=null===(n=this.parent)||void 0===n||null===(a=n.engine)||void 0===a?void 0:a.textureBus)?(this.textureRef&&(u.releaseTexture(this.textureRef),this.textureRef=null),u.publishTexture(this.texture).then((function(e){var t=e.ref;c.textureRef=t,c.dispatchEvent({type:"contentLoaded",label:c})})).catch((function(e){console.warn("[BasicLabel] publishTexture failed, fallback to base64",e),c.dispatchEvent({type:"contentLoaded",label:c})}))):this.dispatchEvent({type:"contentLoaded",label:this});case 11:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}()},{key:"updateContent",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=t;("mesh"===this.labelType||this.sizeAttenuation)&&(i=Yt(this.renderScale,t)),this.extraProps={args:t},i.style&&(this.style=i.style),this.init(i).then((function(){e.materialNeedsUpdate=!0}))}},{key:"getFinalFaceType",value:function(e){if(e)switch(e){case 0:return"DoNotFcaeToCamera";case 1:default:return"FacetoCamera_XYZ";case 2:return"FacetoCamera_Y";case 3:return"FacetoCamera_Z"}return"FacetoCamera_XYZ"}},{key:"toJSON",value:function(){var e,t,i,n,a=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return!a||!this.visibleNeedsUpdate||this.visible&&this.materialNeedsUpdate?{Pivot:this.pivot,Color:{r:this.color.r,g:this.color.g,b:this.color.b,a:this.opacity},Brightness:this.brightness,Metallic:this.metallic,Roughness:this.roughness,Opacity:this.opacity,Transparent:this.transparent,HideText:this.hideText,RenderType:this.renderType,FadeIn:this.fadeIn,OpenCollision:this.openCollision,FaceType:this.getFinalFaceType(this.faceType),SwitchScale:this.switchScale,MaxScale:this.maxScale,MinScale:this.minScale,Texture:null!==(e=this.parent)&&void 0!==e&&null!==(t=e.engine)&&void 0!==t&&t.enableTextureBus&&this.textureRef?null:this.texture,TextureRef:null!==(i=this.parent)&&void 0!==i&&null!==(n=i.engine)&&void 0!==n&&n.enableTextureBus&&this.textureRef?this.textureRef:null,BloomColor:this.bloomColor?{r:this.bloomColor.r,g:this.bloomColor.g,b:this.bloomColor.b,a:1}:null,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:1,y:1,z:1},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},type:this.type,uuid:this.uuid,jsondata:a?null:this._resolveJsonData(),Width:this.width,Height:this.height,RenderScale:this.renderScale,matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,animateNeedsUpdate:this.animateNeedsUpdate,animateJson:this.animateNeedsUpdate?this.animateJson:null,Size:this.size,SizeAttenuation:this.sizeAttenuation,RenderNum:this.renderNum}:{matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},FadeIn:this.fadeIn,type:this.type,name:this.name,uuid:this.uuid}}},{key:"dispose",value:function(){var e,t;this.textureRef&&null!==(e=this.parent)&&void 0!==e&&null!==(t=e.engine)&&void 0!==t&&t.textureBus&&(this.parent.engine.textureBus.releaseTexture(this.textureRef),this.textureRef=null),this.children=[],this.sprite=null,this.texture=null,this.drawCanvas=null,this.animationCanvas=null,this.mainView=null}}],[{key:"initBackGround",value:(i=w(D().mark((function t(i,n){var r,o,s,l,u,c,d,h,f,p,m,g,v,y,b,x,S,w,N,U,k,C;return D().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=i.height,o=i.width,s=i.backgroundImage,l=i.borderRadius,u=i.borderColor,c=i.borderWidth,d=i.backgroundColor,h=i.clip,f=o,p=r,m=n.getContext("2d"),g=a.ceilPowerOfTwo(f),v={width:g,height:g*(p/f),factor:{xScale:g/f,yScale:g/f}},n.width=v.width,n.height=v.height,y=v.factor,b=y.xScale,x=y.yScale,!s){t.next=16;break}return t.next=12,e.loadImg(s,"");case 12:S=t.sent,m.drawImage(S,0,0,f*b,p*x),t.next=17;break;case 16:(u||d)&&(m.strokeStyle=u,m.fillStyle=d,m.lineWidth=c?c*b:1*b,e.roundRect(m,m.lineWidth*b,m.lineWidth*x,(f-2*m.lineWidth)*b,(p-2*m.lineWidth)*x,l?l*b:0),d&&m.fill(),u&&m.stroke());case 17:return h&&(w=B(h,4),N=w[0],U=w[1],k=w[2],C=w[3],m.beginPath(),m.moveTo(C*f*b,N*p*x),m.lineTo((1-U)*f*b,N*p*x),m.lineTo((1-U)*f*b,(1-k)*p*x),m.lineTo(C*f*b,(1-k)*p*x),m.lineTo(C*f*b,N*p*x),m.closePath(),m.clip()),t.abrupt("return",v);case 19:case"end":return t.stop()}}),t)}))),function(e,t){return i.apply(this,arguments)})},{key:"renderContent",value:(t=w(D().mark((function t(i,n,a,r){var o,s,l,u,c,d,h,f,p,m,g,v,y,b,x,S,w,N,U,k,C,T,R,O,E,z,I,A,_,M,L,P,F,W,j,H,G,V,J,q,Y;return D().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:o=a.getContext("2d"),s=a.width,l=a.height,u=i.paddingTop,c=i.paddingLeft,d=0,h=0,f=0,p=0,m=r.xScale,g=r.yScale,b=[v=c?c*m:0,y=u?u*g:0],x=[],S=0;case 13:if(!(S<n.length)){t.next=46;break}if(w=n[S],N=w.width,U=w.height,k=w.textList,C=w.marginRight,T=w.marginBottom,R=w.backgroundImage,O=w.borderRadius,E=w.borderColor,z=w.borderWidth,I=w.backgroundColor,A=w.position,_=w.id,M=w.activeInfo,L=void 0===M?{}:M,A&&(P=B(A,2),F=P[0],W=P[1],b[0]=v+F*m,b[1]=y+W*g,d=0,h=0,f=0,p=0),!N||!U){t.next=42;break}if(b[0]+N*m>s&&((f+=d)+U*g<=h?(b[0]=p,b[1]+=d):(b[0]=c?c*m:0,b[1]+=d,h=0,p=0)),!R){t.next=32;break}return t.prev=20,t.next=23,e.loadImg(R,"");case 23:j=t.sent,o.drawImage(j,b[0],b[1],N*m,U*g),t.next=30;break;case 27:t.prev=27,t.t0=t.catch(20),console.warn(t.t0);case 30:t.next=33;break;case 32:I&&(o.strokeStyle=E,o.fillStyle=I,o.lineWidth=z?z*m:1*m,e.roundRect(o,b[0]+o.lineWidth*m,b[1]+o.lineWidth*m,(N-2*o.lineWidth)*m,(U-2*o.lineWidth)*g,O?O*m:0),I&&o.fill(),E&&o.stroke());case 33:k&&k.forEach((function(t){var i=B(t.position,2),n=i[0],a=i[1],s=[b[0]+n*m,b[1]+a*g];e.drawText(o,t,r,s)})),H=b[0]===(c?c*m:0)*m?-.16:-1.3,G=-(l-b[1]-25*g)*(2.05/(107*g))+.1,_&&(V=L.position,J=L.style,q=void 0===J?{width:5,height:.95}:J,(Y=e.addActiveArea(V||{x:H,y:G},q)).customId=_,x.push(Y)),b[0]+=(N+(C||0))*m,(d=(U+(T||0))*g)>h&&(h=d,p=b[0]),t.next=43;break;case 42:k&&k.forEach((function(t){var i=B(t.position,2),n=i[0],a=i[1],s=[b[0]+n*m,b[1]+a*g];e.drawText(o,t,r,s)}));case 43:S++,t.next=13;break;case 46:return t.abrupt("return",x);case 47:case"end":return t.stop()}}),t,null,[[20,27]])}))),function(e,i,n,a){return t.apply(this,arguments)})},{key:"getRectangle",value:function(e,t,i){var n=new d(_({map:i,transparent:!0,fog:!0,depthWrite:!1},arguments.length>3&&void 0!==arguments[3]?arguments[3]:{}));n.map&&(n.map.needsUpdate=!0),n.transparent=!0;var a=(.01*e).toFixed(2),r=(.01*t).toFixed(2),o=new h(Number(a),Number(r),1,1),s=new f(o,n);return s.setWidth=a,s.setHeight=r,s}},{key:"loadImg",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=new Image;return i.crossOrigin="Anonymous",i.src=t+e,new Promise((function(e,t){i.addEventListener("load",(function(){e(i)})),i.onerror=function(e){t(e)}}))}},{key:"getTextWidth",value:function(e,t){var i=t.fontSize,n=t.fontFamily,a=t.color,r=t.text,o=e.getContext("2d");return o.font="".concat(i,"px ").concat(n),o.fillStyle=a,o.textAlign="left",o.measureText(r).width}},{key:"drawText",value:function(e,t,i,n){var a,r=i.xScale,o=B(n,2),s=o[0],l=o[1],u=t.text,c=t.fontSize,d=t.fontFamily,h=t.color,f=t.textAlign,p=t.icon;if(u||"number"==typeof u||p)if(u&&p)console.warn("BasicLabel Warning:text和icon不要同时设置");else{if(a=u,e.font="".concat(c*r,"px ").concat(d),e.fillStyle=h,e.textAlign=f||"left",e.textBaseline="top",p){var m=p;-1!==p.indexOf("&amp;")&&(m=p.replace("&amp;","&")),-1!==p.indexOf("&amp")&&(m=p.replace("&amp","&")),a=new Function('return ("'+"".concat(m).replace("&#x","\\u").replace(";","")+'")')()}e.measureText(a).width,e.fillText(a,s,l)}}},{key:"addActiveArea",value:function(e,t){var i=t.width,n=t.height,a=e.x,r=e.y,o=new p({depthTest:!0,depthWrite:!1,transparent:!0,sizeAttenuation:!0,opacity:0}),s=new m(o);return s.scale.set(i,n,1),s.material.color=new u("#58d2d4"),s.center.set(a,r),s}},{key:"roundRect",value:function(e,t,i,n,a,r){e.beginPath(),e.moveTo(t+r,i),e.lineTo(t+n-r,i),e.quadraticCurveTo(t+n,i,t+n,i+r),e.lineTo(t+n,i+a-r),e.quadraticCurveTo(t+n,i+a,t+n-r,i+a),e.lineTo(t+r,i+a),e.quadraticCurveTo(t,i+a,t,i+a-r),e.lineTo(t,i+r),e.quadraticCurveTo(t,i,t+r,i),e.closePath()}}]);var t,i,n}(),Xt=function(){function e(t){var i;return U(this,e),(i=N(this,e,[t])).type="Cone",i}return z(e,vt),C(e)}(),Qt=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{color:{r:1,g:0,b:0,a:1},brightness:100};return U(this,e),(t=N(this,e,[i])).type="FlashCar",t}return z(e,vt),C(e)}(),Zt=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{color:{r:1,g:0,b:0,a:1},brightness:100};return U(this,e),(t=N(this,e,[i])).type="FlashCarCrash",t}return z(e,vt),C(e)}(),$t=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{color:{r:1,g:0,b:0,a:1},brightness:100};return U(this,e),(t=N(this,e,[i])).type="FlashPeople",t}return z(e,vt),C(e)}(),ei=function(){function e(t){var i;return U(this,e),(i=N(this,e,[t])).type="Cylinder",i}return z(e,vt),C(e)}(),ti=function(){function e(t){var i;return U(this,e),(i=N(this,e,[t])).type="Decal",i}return z(e,vt),C(e,[{key:"toJSON",value:function(){var e,t,i,n,a=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(this.animateJson){var r=this.animateJson,o=r.From,s=r.To;if(o&&o.scale){var l=o.scale,u=l.x,c=l.z;o.scale.x=c,o.scale.z=u}if(s&&s.scale){var d=s.scale,h=d.x,f=d.z;s.scale.x=f,s.scale.z=h}}return!this.visibleNeedsUpdate||!a||this.visible&&this.materialNeedsUpdate?{Color:{r:this.color.r,g:this.color.g,b:this.color.b,a:this.opacity},Brightness:this.brightness,Metallic:this.metallic,Roughness:this.roughness,Opacity:this.opacity,Transparent:this.transparent,Scroll:this.scroll,Speed:this.speed,Texture:null!==(e=this.parent)&&void 0!==e&&null!==(t=e.engine)&&void 0!==t&&t.enableTextureBus&&this.textureRef?null:this.texture,TextureRef:null!==(i=this.parent)&&void 0!==i&&null!==(n=i.engine)&&void 0!==n&&n.enableTextureBus&&this.textureRef?this.textureRef:null,GardientDirection:this.gardientDirection,Color2:{r:this.color2.r,g:this.color2.g,b:this.color2.b,a:this.opacity},BrightnessColor:this.brightnessColor?{r:this.brightnessColor.r,g:this.brightnessColor.g,b:this.brightnessColor.b,a:1}:this.Color,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.z,y:this.scale.y,z:this.scale.x},Rotation:{x:this.rotation.x,y:this.rotation.y+90,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,animateNeedsUpdate:this.animateNeedsUpdate,visible:this.visible,type:this.type,name:this.name,uuid:this.uuid,jsondata:a?null:this._resolveJsonData(),animateJson:this.animateNeedsUpdate?this.animateJson:null,Size:this.size,SizeAttenuation:this.sizeAttenuation}:{matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.z,y:this.scale.y,z:this.scale.x},Rotation:{x:this.rotation.x,y:this.rotation.y+90,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},type:this.type,name:this.name,uuid:this.uuid}}}])}(),ii=function(){function e(t){var i;return U(this,e),(i=N(this,e,[t])).type="Plane",i}return z(e,vt),C(e)}(),ni=function(){function e(t){var i;return U(this,e),(i=N(this,e,[t])).type="QuadPyramid",i}return z(e,vt),C(e)}(),ai=function(){function e(t){var i;return U(this,e),(i=N(this,e,[t])).type="Sphere",i}return z(e,vt),C(e)}(),ri=function(){function e(t){var i;return U(this,e),(i=N(this,e,[t])).type="TrafficCone",i}return z(e,vt),C(e)}(),oi=function(){function e(t){var i;return U(this,e),(i=N(this,e,[t])).type="Circle",i}return z(e,vt),C(e)}(),si=function(){function e(t){var i;return U(this,e),(i=N(this,e,[t])).type="Torus",i}return z(e,vt),C(e)}(),li=function(){function e(t){var i;return U(this,e),(i=N(this,e,[t])).type="Tube",i}return z(e,vt),C(e)}(),ui=function(){function e(t){var i;return U(this,e),(i=N(this,e,[t])).type="DiamondSign",i}return z(e,vt),C(e)}(),ci=function(){function i(e){var t;U(this,i),(t=N(this,i,[e])).type="Heatmap",t.kind=e.kind||"texture",t.visible=void 0===e.visible||e.visible,t.container=e.container,t.width=e.width||512,t.height=e.height||512,t.min=e.min,t.max=e.max,t.xName=e.xName,t.yName=e.yName,t.valueName=e.valueName,t.backgroundColor=e.backgroundColor,t.gradient=e.gradient,t.radius=e.radius||40,t.blur=e.blur||.85,t.opacity=e.opacity,t.minOpacity=e.minOpacity||0,t.maxOpacity=e.maxOpacity||1,t.heatmapInstance=null,t.size=e.size||null,t.center=e.center,t.minHeight=e.minHeight||0,t.maxHeight=e.maxHeight||500,t.duration=a.clamp(e.duration||1,0,100),t.data=e.data;var n,r=e.particle||{},o=r.bound||{x:100,y:100,z:0},s=r.scaleBoxXY||1,l=r.noiseStrength||0,u=r.grayPower||1,c=parseInt(r.countX,10)||400,d=parseInt(r.countY,10)||400;return t.particleMaxHeight=r.maxHeight||0,"noiseMap"in r&&(t.noiseMap=n=r.noiseMap,lt(n)||ot(n,(function(e){e&&(t.noiseMap=n=e)}))),"particle"===t.kind&&(t.gradient={0:"rgb(0, 0, 0)",1:"rgb(256, 256, 256)"}),t.init(),Object.defineProperties(t,{bound:{enumerable:!0,get:function(){return o},set:function(e){e&&"particle"===this.kind&&(o.x=e.x,o.y=e.y,o.z=e.z,this.matrixNeedsUpdate=!0)}},scaleBoxXY:{enumerable:!0,get:function(){return s},set:function(e){console.log(e,s,this.kind),e!==s&&"particle"===this.kind&&(s=e,this.matrixNeedsUpdate=!0)}},noiseStrength:{enumerable:!0,get:function(){return l},set:function(e){e!==l&&"particle"===this.kind&&(l=e,this.matrixNeedsUpdate=!0)}},grayPower:{configurable:!0,enumerable:!0,get:function(){return u},set:function(e){e!==u&&"particle"===this.kind&&(u=e,this.matrixNeedsUpdate=!0)}},countX:{configurable:!0,enumerable:!0,get:function(){return c},set:function(e){e!==c&&"particle"===this.kind&&(c=parseInt(e,10),this.matrixNeedsUpdate=!0)}},countY:{configurable:!0,enumerable:!0,get:function(){return d},set:function(e){e!==d&&"particle"===this.kind&&(d=parseInt(e,10),this.matrixNeedsUpdate=!0)}}}),t}return z(i,vt),C(i,[{key:"init",value:function(){if("particle"===this.kind&&this.data.length<2)console.error("数据量过少,无法绘制粒子热力图");else{var i=function(e,t,i,n){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},r=a.width,o=a.height,s=a.radius,l=void 0===s?40:s;if(!e||e.length<1)return!1;for(var u=1/0,c=-1/0,d={longitude:1/0,latitude:1/0},h={longitude:-1/0,latitude:-1/0},f=0,p=e.length;f<p;f++){var m=n?e[f][n]:e[f].value;u=Math.min(m,u),c=Math.max(m,c),t&&(e[f].x=e[f][t]),i&&(e[f].y=e[f][i]),n&&(e[f].value=e[f][n]),e[f].longitude&&e[f].latitude&&(d.longitude=Math.min(d.longitude,e[f].longitude),d.latitude=Math.min(d.latitude,e[f].latitude),h.longitude=Math.max(h.longitude,e[f].longitude),h.latitude=Math.max(h.latitude,e[f].latitude))}if(e[0].longitude&&e[0].latitude){if(!e[0].hasOwnProperty("x")&&!e[0].hasOwnProperty("y")){for(var g=h.longitude-d.longitude,v=h.latitude-d.latitude,y=1.2*l,b=.5,x=Math.min(y,r*(1-b)/2),S=Math.min(y,o*(1-b)/2),w=r-2*x,N=o-2*S,U=0,k=e.length;U<k;U++)e[U].x=Math.round(x+w*(e[U].longitude-d.longitude)/g),e[U].y=Math.round(S+N*(e[U].latitude-d.latitude)/v);var C=g*(x/w),T=v*(S/N);return{min:u,max:c,bbox:{min:{longitude:d.longitude-C,latitude:d.latitude-T},max:{longitude:h.longitude+C,latitude:h.latitude+T}},originalBbox:{min:_({},d),max:_({},h)}}}return{min:u,max:c,bbox:{min:d,max:h}}}return{min:u,max:c}}(this.data,this.xName,this.yName,this.valueName,{width:this.width,height:this.height,radius:this.radius});if(i&&(void 0===this.min&&(this.min=i.min),void 0===this.max&&(this.max=i.max),i.bbox)){if(!this.center){var n=.5*(i.bbox.min.longitude+i.bbox.max.longitude),a=.5*(i.bbox.min.latitude+i.bbox.max.latitude);this.center={x:n,y:a,z:10}}if(!this.size&&"particle"!==this.kind){var r=i.bbox.max.longitude-i.bbox.min.longitude,o=i.bbox.max.latitude-i.bbox.min.latitude;this.size={x:1e5*r,y:1e5*o}}this.bbox=i.bbox}var s=this.data,l=this.max,u=this.min;if(this.heatmapInstance)this.heatmapInstance.configure(this.getConfig()),this.heatmapInstance.setData({max:l,min:u,data:s}),this.heatmapInstance.repaint();else{this.container||(this.container=di(this.width,this.height));var c=function(e){if(!e)return!1;var t=e.container||di(e),i=b.create({container:t,backgroundColor:e.backgroundColor||"rgba(0,0,0,.95)",gradient:e.gradient||{0:"rgb(50, 50, 256)",.1:"rgb(50, 250, 56)",.5:"rgb(250, 250, 56)",1:"rgb(250, 50, 56)"},radius:e.radius||40,opacity:e.opacity,maxOpacity:e.maxOpacity||1,minOpacity:e.minOpacity||0});return i}(this.getConfig());c&&(this.heatmapInstance=c,this.heatmapInstance.setData({max:l,min:u,data:s}))}this.canvas||(this.canvas=this.container.children[0]),this.texture=st(this.canvas),this.materialNeedsUpdate=!0,this.center||(this.center=new t(0,0,10)),"particle"!==this.kind&&(this.size||(this.size=new e(this.width,this.height)),this.scale.set(this.size.x,this.size.y,200)),this.position.set(this.center.x,this.center.y,this.center.z)}}},{key:"setData",value:function(e){return!1}},{key:"getConfig",value:function(){return{container:this.container,backgroundColor:this.backgroundColor,gradient:this.gradient,radius:this.radius,opacity:this.opacity,maxOpacity:this.maxOpacity||1,minOpacity:this.minOpacity||0,blur:this.blur||0,width:this.width,height:this.height}}},{key:"repaint",value:function(e){e&&(this.duration=a.clamp(e,.1,100)),this.init()}},{key:"getGeojsonData",value:function(){if(this.container&&this.heatmapInstance){for(var e,t=(this.maxHeight-this.minHeight)/(this.max-this.min),i=this.heatmapInstance._renderer._palette,n=[],a=this.size.x/this.width,r=this.size.y/this.height,o=1/256,s=null===(e=this.heatmapInstance)||void 0===e?void 0:e.getData().data,l=0,u=s.length;l<u;l++){var c=parseInt(s[l].x,10),d=parseInt(s[l].y,10),h=Math.max(Math.min(s[l].value,this.max),this.min),f=(h-this.min)*t+this.minHeight,p=Math.floor((h-this.min)/(this.max-this.min)*252),m=s[l].radius,g={r:i[4*p]*o,g:i[4*p+1]*o,b:i[4*p+2]*o};if(!(f<1)){var v={type:"Feature",properties:{id:l,height:f,color:g,xSize:m,ySize:m},geometry:{type:"Point",coordinates:[a*(c-.5*this.width)/1e5,r*(d-.5*this.height)/1e5]}};n.push(v)}}return n}return!1}},{key:"toJSON",value:function(){var e,t;if((!(arguments.length>0&&void 0!==arguments[0])||arguments[0])&&this.visibleNeedsUpdate&&(!this.visible||!this.materialNeedsUpdate))return{matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},type:this.type,name:this.name,uuid:this.uuid};if("texture"===this.kind.toLowerCase())return{Color:{r:this.color.r,g:this.color.g,b:this.color.b,a:this.opacity},Brightness:this.brightness,Metallic:this.metallic,Roughness:this.roughness,Opacity:this.opacity,Transparent:this.transparent,Texture:this.texture,Duration:this.duration,BloomColor:this.bloomColor?{r:this.bloomColor.r,g:this.bloomColor.g,b:this.bloomColor.b,a:1}:null,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,type:this.type,Kind:this.kind,uuid:this.uuid,RawData:this.data,Min:(null===(e=this.bbox)||void 0===e?void 0:e.min)||null,Max:(null===(t=this.bbox)||void 0===t?void 0:t.max)||null,CanvasWidth:this.width,CanvasHeight:this.height};if("particle"===this.kind.toLowerCase())return{Color:{r:this.color.r,g:this.color.g,b:this.color.b,a:this.opacity},Brightness:this.brightness,Metallic:this.metallic,Roughness:this.roughness,Opacity:this.opacity,Transparent:this.transparent,Texture:this.texture,Duration:this.duration,BloomColor:this.bloomColor?{r:this.bloomColor.r,g:this.bloomColor.g,b:this.bloomColor.b,a:1}:null,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,type:this.type,Kind:this.kind,uuid:this.uuid,Bound:this.bound,ScaleBoxXY:this.scaleBoxXY,NoiseStrength:this.noiseStrength,NoiseMap:this.noiseMap,GrayPower:this.grayPower,MaxHeight:this.particleMaxHeight||this.maxHeight,countX:this.countX,countY:this.countY,Min:this.bbox.min,Max:this.bbox.max};var i=this.getGeojsonData();return{Color:{r:this.color.r,g:this.color.g,b:this.color.b,a:this.opacity},Brightness:this.brightness,Metallic:this.metallic,Roughness:this.roughness,Opacity:this.opacity,Transparent:this.transparent,BloomColor:this.bloomColor?{r:this.bloomColor.r,g:this.bloomColor.g,b:this.bloomColor.b,a:1}:null,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,type:this.type,Kind:this.kind,uuid:this.uuid,jsondata:i}}}])}();function di(e,t){var i=document.createElement("div");return i.style.width=e?e+"px":"512px",i.style.height=t?t+"px":"512px",i.style.top="0px",i.style.display="none",document.getElementsByTagName("body")[0].appendChild(i),i}var hi=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};U(this,e),(t=N(this,e,[i])).renderNum=void 0===i.renderNum?20:i.renderNum,t.type="Particle";var n=i.kind||fe.FIRE_SMALL,r=i.spawnRate||30,o=i.brightness||3,s=i.lifeTime||1,l=new u(1,0,1);i.brightnessColor&&(l.r=a.clamp(i.brightnessColor.r,0,1),l.g=a.clamp(i.brightnessColor.g,0,1),l.b=a.clamp(i.brightnessColor.b,0,1));var c=i.speed||5,d=i.height||200,h=i.width||.01,f=i.zVelocity||100;return t.thickness=i.thickness||.2,Object.defineProperties(t,{kind:{configurable:!0,enumerable:!0,get:function(){return n},set:function(e){n=e,t.materialNeedsUpdate=!0}},spawnRate:{configurable:!0,enumerable:!0,get:function(){return r},set:function(e){r=e,t.materialNeedsUpdate=!0}},brightness:{configurable:!0,enumerable:!0,get:function(){return o},set:function(e){o=e,t.materialNeedsUpdate=!0}},brightnessColor:{configurable:!0,enumerable:!0,get:function(){return l},set:function(e){e&&(l.r=e.r,l.g=e.g,l.b=e.b,l.a=1,t.materialNeedsUpdate=!0)}},speed:{configurable:!0,enumerable:!0,get:function(){return c},set:function(e){c=e,t.materialNeedsUpdate=!0}},height:{configurable:!0,enumerable:!0,get:function(){return d},set:function(e){d=e,t.materialNeedsUpdate=!0}},width:{configurable:!0,enumerable:!0,get:function(){return h},set:function(e){h=e,t.materialNeedsUpdate=!0}},zVelocity:{configurable:!0,enumerable:!0,get:function(){return f},set:function(e){f=e,t.materialNeedsUpdate=!0}},lifeTime:{configurable:!0,enumerable:!0,get:function(){return s},set:function(e){s=e,t.materialNeedsUpdate=!0}}}),t}return z(e,vt),C(e,[{key:"setData",value:function(e){this.data=nt(e)}},{key:"toJSON",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return!e||!this.visibleNeedsUpdate||this.visible&&this.materialNeedsUpdate?{Color:{r:this.color.r,g:this.color.g,b:this.color.b,a:this.opacity},Brightness:this.brightness,BrightnessColor:this.brightnessColor?{r:this.brightnessColor.r,g:this.brightnessColor.g,b:this.brightnessColor.b,a:1}:null,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},SpawnRate:this.spawnRate,Speed:this.speed,Height:this.height,ZVelocity:this.zVelocity,LifeTime:this.lifeTime,Width:this.width,Kind:this.kind,type:this.type,uuid:this.uuid,Thickness:this.thickness,jsondata:e?null:this.data,matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,RenderNum:this.renderNum}:{matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},type:this.type,name:this.name,uuid:this.uuid}}},{key:"copy",value:function(t){var i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return this.size=t.size,this.kind=t.kind,this.thickness=t.thickness,F(e,"copy",this)([t,i]),this}}])}(),fi=function(){function e(i){var n;return U(this,e),(n=N(this,e)).type="TrafficLayer",n.url=i.url,n.eventName=i.eventName||"geo_window_state",n.interval=i.interval||100,n._message=null,n.message=i.message,n.query=i.query,n.label=new je,n.label.visible=void 0!==i._labelVisible&&i._labelVisible,n.rayDetectionDistance=i.rayDetectionDistance||0,n.uiRenderDistance=i.uiRenderDistance||5e4,n.messageNeedsUpdate=!1,n.materialNeedsUpdate=!1,n.matrixNeedsUpdate=!1,n.followNeedsUpdate=!1,n.labelVisible=i.labelVisible,n.offset=new t,n.handShakePath=i.handShakePath||"socket.io",n.namespace=i.namespace||"/",n.carRenderDistance=i.carRenderDistance||3e5,n.labelGroup=i.labelGroup||"highSpeed",n.labelScale=void 0===i.labelScale?1:i.labelScale,n.labelRenderType=void 0===i.labelRenderType?0:i.labelRenderType,n.enableLabelCulling=i.enableLabelCulling||!1,n.isSubsection=i.isSubsection||!1,n.plateEncode=i.plateEncode||!1,n.plateEncoding=i.plateEncoding||"auto",n}return z(e,je),C(e,[{key:"visible",get:function(){return this._visible},set:function(e){void 0===this._visible&&(this._visible=!0),e!==this._visible&&(this.visibleNeedsUpdate=!0,this._visible=e&&!0)}},{key:"labelVisible",get:function(){return this.label.visible},set:function(e){e!==this.label.visible&&(this.materialNeedsUpdate=!0,this.label.visible=e&&!0)}},{key:"message",get:function(){return this._message},set:function(e){this.messageNeedsUpdate=!0,this._message=e}},{key:"setLabelVisible",value:function(e){e!==this.label.visible&&(this.materialNeedsUpdate=!0,this.label.visible=e)}},{key:"getLabelVisible",value:function(){return this.label.visible}},{key:"dispose",value:function(){return!1}},{key:"followTraffic",value:function(e){var t=e.zoomLength,i=void 0===t?-1:t,n=e.followPitch,a=void 0===n?999:n;this.isFollow=null==e?void 0:e.isFollow,this.followCarId=null==e?void 0:e.carId,this.followCarPlateNumber=null==e?void 0:e.plateNumber,this.followColor=(null==e?void 0:e.color)||{r:0,g:1,b:.8},this.followRotations=(null==e?void 0:e.followRotations)||{Roll:!1,Pitch:!1,Yaw:!1},this.zoomLength=i,this.followPitch=a,this.followNeedsUpdate=!0}},{key:"followGroups",value:function(e){this.isFollow=null==e?void 0:e.isFollow,this.followCarIdList=null==e?void 0:e.carIdList,this.followRotations=(null==e?void 0:e.followRotations)||{Roll:!1,Pitch:!1,Yaw:!1},this.followNeedsUpdate=!0}},{key:"initEventListener",value:function(){}},{key:"dispatchEvent",value:function(t){var i,n;if(this.plateEncode&&"mousedown"===t.type&&null!==(i=t.content)&&void 0!==i&&null!==(n=i.content)&&void 0!==n&&n.plate)try{var a=this._decodePlate(t.content.content.plate);t.content.content.plateEncoded=t.content.content.plate,t.content.content.plate=a}catch(e){console.error("TrafficLayer: Failed to decode plate",e)}return F(e,"dispatchEvent",this)([t])}},{key:"_decodePlate",value:function(e){try{if("auto"===this.plateEncoding)return jt(e);var t=jt(e,!0);return new TextDecoder(this.plateEncoding).decode(t)}catch(t){return console.warn("TrafficLayer: Plate decode failed, returning original value",t),e}}},{key:"toJSON",value:function(){return{Url:this.url,EventName:this.eventName,LabelVisible:this.labelVisible,LabelGroup:this.labelGroup,LabelScale:this.labelScale,LabelRenderType:this.labelRenderType,EnableWidgetCulling:this.enableLabelCulling,matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,messageNeedsUpdate:this.messageNeedsUpdate,visible:this.visible,type:this.type,uuid:this.uuid,Id:this.followCarId,CarIdList:this.followCarIdList,Namespace:this.namespace,HandShakePath:this.handShakePath,FollowColor:this.followColor||{r:0,g:1,b:.8},FollowRotation:this.followRotations||{Roll:!1,Pitch:!1,Yaw:!1},Plate:this.followCarPlateNumber,PlateEncode:this.plateEncode,PlateEncoding:this.plateEncoding,ZoomLength:this.zoomLength,FollowPitch:this.followPitch,IsFollow:this.isFollow,Content:this.content,Message:this.message,Query:this.query,RayDetectionDistance:this.rayDetectionDistance,UIRenderDistance:this.uiRenderDistance,CarRenderDistance:this.carRenderDistance,Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},IsSubsection:this.isSubsection}}}])}(),pi=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return U(this,e),(t=N(this,e,[i])).name=i.name||"",t.type="FastRoadCondition",t.colors=i.colors||{1:(new u).setStyle("#00ff00"),2:(new u).setStyle("#ffff00"),3:(new u).setStyle("#ff0000"),4:(new u).setStyle("#ff00ff")},t}return z(e,bt),C(e,[{key:"setData",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"condition",n=!0===this.enableSimplify;this.data=it(e,!1,{enableDP:n,dpThreshold:this.simplifyTolerance}),this.data.forEach((function(e){var n=e.properties[i],a=t.colors[n]||t.colors[1];e.properties.color={r:a.r,g:a.g,b:a.b,a:a.a||1}}))}}])}(),mi=function(){function e(){var n,a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};U(this,e),(n=N(this,e,[a])).initChild();var o=a.coneColor||new u(1,1,1),s=a.groundColor||new u(1,1,1),l=a.fenceColor||new u(1,1,1),c=a.brightness||0,d=a.roughness||1,h=a.metallic||0;n.coneMap=a.coneMap||null,n.groundMap=a.groundMap||null,n.fenceMap=a.fenceMap||null,n.fenceHeight=a.fenceHeight||1;var f=a.coneOpacity||o.a||1,p=a.groundOpacity||s.a||1,m=a.fenceOpacity||l.a||1,g=a.bloomColor||null,v=a.position||new t,y=a.rotation||new r,b=new i,x=a.scale||new t(1,1,1),S=a.coneScale||new t(1,1,1),w=a.offset||new t(0,0,0),k=!1;return y._onChange((function(){b.setFromEuler(y,!1),this.matrixNeedsUpdate=!0})),b._onChange((function(){y.setFromQuaternion(b,void 0,!1),this.matrixNeedsUpdate=!0})),Object.defineProperties(n,{position:{configurable:!0,enumerable:!0,get:function(){return v},set:function(e){e&&(v.x=e.x,v.y=e.y,v.z=e.z,n.matrixNeedsUpdate=!0)}},rotation:{configurable:!0,enumerable:!0,value:y},quaternion:{configurable:!0,enumerable:!0,value:b},scale:{configurable:!0,enumerable:!0,get:function(){return x},set:function(e){e&&(x.x=e.x,x.y=e.y,x.z=e.z,n.matrixNeedsUpdate=!0)}},coneScale:{configurable:!0,enumerable:!0,get:function(){return S},set:function(e){e&&(S.x=e.x,S.y=e.y,S.z=e.z,n.matrixNeedsUpdate=!0)}},offset:{configurable:!0,enumerable:!0,get:function(){return w},set:function(e){e&&(w.x=e.x,w.y=e.y,w.z=e.z,n.matrixNeedsUpdate=!0)}},coneColor:{configurable:!0,enumerable:!0,get:function(){return o},set:function(e){e&&(o.r=e.r,o.g=e.g,o.b=e.b,e.a&&(f=e.a),n.materialNeedsUpdate=!0)}},groundColor:{configurable:!0,enumerable:!0,get:function(){return s},set:function(e){e&&(s.r=e.r,s.g=e.g,s.b=e.b,e.a&&(p=e.a),n.materialNeedsUpdate=!0)}},fenceColor:{configurable:!0,enumerable:!0,get:function(){return l},set:function(e){e&&(l.r=e.r,l.g=e.g,l.b=e.b,e.a&&(m=e.a),n.materialNeedsUpdate=!0)}},coneOpacity:{configurable:!0,enumerable:!0,get:function(){return f},set:function(e){f=e,n.materialNeedsUpdate=!0}},groundOpacity:{configurable:!0,enumerable:!0,get:function(){return p},set:function(e){p=e,n.materialNeedsUpdate=!0}},fenceOpacity:{configurable:!0,enumerable:!0,get:function(){return m},set:function(e){m=e,n.materialNeedsUpdate=!0}},brightness:{configurable:!0,enumerable:!0,get:function(){return c},set:function(e){void 0!==e&&(c=e,n.materialNeedsUpdate=!0)}},roughness:{configurable:!0,enumerable:!0,get:function(){return d},set:function(e){d=e,n.materialNeedsUpdate=!0}},metallic:{configurable:!0,enumerable:!0,get:function(){return h},set:function(e){h=e,n.materialNeedsUpdate=!0}},bloomColor:{configurable:!0,enumerable:!0,get:function(){return g},set:function(e){e&&(g.copy(e),n.materialNeedsUpdate=!0)}},transparent:{configurable:!0,enumerable:!0,get:function(){return k},set:function(e){k=e&&1,n.materialNeedsUpdate=!0}},_visible:{configurable:!0,enumerable:!0,value:!0},_layerName:{configurable:!1,enumerable:!1,value:"CommonGISLayer"},_cloudControlType:{configurable:!1,enumerable:!1,value:"Gis"},type:{configurable:!0,enumerable:!0,value:"Construction"}}),n.matrixNeedsUpdate=!1,n.materialNeedsUpdate=!1,n.visibleNeedsUpdate=!1,n}return z(e,je),C(e,[{key:"visible",get:function(){return this._visible},set:function(e){void 0===this._visible&&(this._visible=!0),e!==this._visible&&(this.visibleNeedsUpdate=!0,this._visible=e&&!0)}},{key:"coneMap",get:function(){return this.cone.map},set:function(e){e&&(this.cone.map=e,this.materialNeedsUpdate=!0)}},{key:"groundMap",get:function(){return this.ground.map},set:function(e){e&&(this.ground.map=e,this.materialNeedsUpdate=!0)}},{key:"fenceMap",get:function(){return this.fence.map},set:function(e){e&&(this.fence.map=e,this.materialNeedsUpdate=!0)}},{key:"fenceHeight",get:function(){return this._fenceHeight},set:function(e){e&&(this._fenceHeight=e)}},{key:"initChild",value:function(){this.ground=new yt,this.add(this.ground),this.fence=new bt,this.add(this.fence),this.cone=new ri,this.add(this.cone)}},{key:"setData",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.data=it(e,t,{enableDP:!1})}},{key:"toJSON",value:function(){var e,t,i,n,a,r,o,s,l,u,c,d,h=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return!h||!this.visibleNeedsUpdate||this.visible&&this.materialNeedsUpdate?{Color:{r:1,g:1,b:1,a:1},ConeColor:{r:this.coneColor.r,g:this.coneColor.g,b:this.coneColor.b,a:this.coneOpacity},GroundColor:{r:this.groundColor.r,g:this.groundColor.g,b:this.groundColor.b,a:this.groundOpacity},FenceColor:{r:this.fenceColor.r,g:this.fenceColor.g,b:this.fenceColor.b,a:this.fenceOpacity},Brightness:this.brightness,Metallic:this.metallic,Roughness:this.roughness,Opacity:1,ConeOpacity:this.coneOpacity,GroundOpacity:this.groundOpacity,FenceOpacity:this.fenceOpacity,Transparent:this.transparent,GroundTexture:null!==(e=this.parent)&&void 0!==e&&null!==(t=e.engine)&&void 0!==t&&t.enableTextureBus&&this.ground.textureRef?null:this.ground.map,GroundTextureRef:null!==(i=this.parent)&&void 0!==i&&null!==(n=i.engine)&&void 0!==n&&n.enableTextureBus&&this.ground.textureRef?this.ground.textureRef:null,ConeTexture:null!==(a=this.parent)&&void 0!==a&&null!==(r=a.engine)&&void 0!==r&&r.enableTextureBus&&this.cone.textureRef?null:this.cone.map,ConeTextureRef:null!==(o=this.parent)&&void 0!==o&&null!==(s=o.engine)&&void 0!==s&&s.enableTextureBus&&this.cone.textureRef?this.cone.textureRef:null,FenceTexture:null!==(l=this.parent)&&void 0!==l&&null!==(u=l.engine)&&void 0!==u&&u.enableTextureBus&&this.fence.textureRef?null:this.fence.map,FenceTextureRef:null!==(c=this.parent)&&void 0!==c&&null!==(d=c.engine)&&void 0!==d&&d.enableTextureBus&&this.fence.textureRef?this.fence.textureRef:null,BloomColor:this.bloomColor?{r:this.bloomColor.r,g:this.bloomColor.g,b:this.bloomColor.b,a:1}:null,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},ConeScale:{x:this.coneScale.x,y:this.coneScale.y,z:this.coneScale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,type:this.type,uuid:this.uuid,groundUuid:this.ground.uuid,coneUuid:this.cone.uuid,fenceUuid:this.fence.uuid,jsondata:h?null:this.data,FenceWidth:this.fenceHeight}:{matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},type:this.type,name:this.name,uuid:this.uuid}}},{key:"dispose",value:function(){this.traverse((function(e){e.geometry&&e.geometry.dispose(),e.material&&e.material.dispose(),e.texture=null})),this.data=null,this.texture=null}}])}(),gi=function(){function e(t){var i;return U(this,e),(i=N(this,e,[t])).name=t.name||"",i.url=t.url,i._enableSlope=!1,i.token=t.token||null,i.type="i3DTileLayer",i.initialize(),i}return z(e,vt),C(e,[{key:"url",get:function(){return this._url},set:function(e){e!==this._url&&(this.visibleNeedsUpdate=!0,this._url=e)}},{key:"initialize",value:function(){if(!this.url)return!1}},{key:"slopeAnalysis",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this._enableSlope=e&&!0,this.slopeParams={},e&&Object.assign(this.slopeParams,t)}},{key:"toJSON",value:function(){return!(!(arguments.length>0&&void 0!==arguments[0])||arguments[0])||!this.visibleNeedsUpdate||this.visible&&this.materialNeedsUpdate?{Brightness:this.brightness,Metallic:this.metallic,Roughness:this.roughness,Opacity:this.opacity,Transparent:this.transparent,BloomColor:this.bloomColor?{r:this.bloomColor.r,g:this.bloomColor.g,b:this.bloomColor.b,a:1}:null,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},Token:this.token,matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,type:this.type,uuid:this.uuid,Url:this.url?this.url:null,EnableSlope:this._enableSlope,SlopeParams:this._enableSlope?this.slopeParams:null}:{matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},type:this.type,name:this.name,uuid:this.uuid}}},{key:"dispose",value:function(){this.traverse((function(e){e.geometry&&e.geometry.dispose(),e.material&&e.material.dispose(),e.texture=null})),this.url=null,this.texture=null}}])}(),vi=function(){function e(i){var n;U(this,e),(n=N(this,e,[i])).type="AssetLayer",n.url=i.url,n.header=i.header,n.body=i.body,n.messageNeedsUpdate=!1,n.childNeedsUpdate=!1;var a=i.deviceAutoUpdate||!1,r=Math.max(1,i.deviceAutoUpdateInterval||2),o=void 0===i.renderNum?15:i.renderNum,s=void 0===i.searchMode?"coord":i.searchMode,l=void 0===i.tileLevel?16:i.tileLevel,u=void 0!==i.rtEnable&&i.rtEnable,c=i.rtUrl,d=void 0===i.rtTilelLevel?17:i.rtTilelLevel;return n.maxUpdateHeight=void 0===i.maxUpdateHeight?1e3:i.maxUpdateHeight,n.materialNeedsUpdate=!1,n.matrixNeedsUpdate=!1,n.offset=new t,Object.defineProperties(n,{deviceAutoUpdate:{configurable:!0,enumerable:!0,get:function(){return a},set:function(e){e&&(a=e,n.messageNeedsUpdate=!0)}},deviceAutoUpdateInterval:{configurable:!0,enumerable:!0,get:function(){return r},set:function(e){e&&(r=Math.max(e,2),n.messageNeedsUpdate=!0)}},renderNum:{configurable:!0,enumerable:!0,get:function(){return o},set:function(e){e&&(o=e,n.messageNeedsUpdate=!0)}},searchMode:{configurable:!0,enumerable:!0,get:function(){return s},set:function(e){e&&(s=e,n.messageNeedsUpdate=!0)}},tileLevel:{configurable:!0,enumerable:!0,get:function(){return l},set:function(e){e&&(l=e,n.messageNeedsUpdate=!0)}},rtEnable:{configurable:!0,enumerable:!0,get:function(){return u},set:function(e){u=e,n.messageNeedsUpdate=!0}},rtUrl:{configurable:!0,enumerable:!0,get:function(){return c},set:function(e){e&&(c=e,n.messageNeedsUpdate=!0)}},rtTilelLevel:{configurable:!0,enumerable:!0,get:function(){return d},set:function(e){e&&(d=e,n.messageNeedsUpdate=!0)}}}),n}return z(e,je),C(e,[{key:"visible",get:function(){return this._visible},set:function(e){void 0===this._visible&&(this._visible=!0),e!==this._visible&&(this.visibleNeedsUpdate=!0,this._visible=e&&!0)}},{key:"body",get:function(){return this._body},set:function(e){this.messageNeedsUpdate=!0,this._body=e}},{key:"addChildren",value:function(e){var t=this;if(!e||e.length<1)return!1;this.childOperate="add",this.childrenContent=[],e.forEach((function(e,i){t.childrenContent.push({uuid:e.uuid,point_id:e.point_id,config:{material:{},transform:null}})})),this.childNeedsUpdate=!0,this.materialNeedsUpdate=!0}},{key:"removeChild",value:function(e){e&&(e instanceof Array?this.removeChildren(e):this.removeChildren([e]))}},{key:"removeChildren",value:function(e){var t=this;if(!e||e.length<1)return!1;this.childOperate="remove",this.childrenContent=[],e.forEach((function(e,i){t.childrenContent.push({uuid:e.uuid,point_id:e.point_id,config:{material:{},transform:null}})})),this.childNeedsUpdate=!0,this.materialNeedsUpdate=!0}},{key:"updateChild",value:function(e){if(!e)return!1;e instanceof Array?this.updateChildren(e):this.updateChildren([e])}},{key:"updateChildren",value:function(e){var t=this;if(!e||e.length<1)return!1;this.childrenContent=[],this.childOperate="update",this.childNeedsUpdate=!0,this.materialNeedsUpdate=!0,e.forEach((function(e,i){t.updateChildContent(e)}))}},{key:"updateChildContent",value:function(e){var t,i,n=this;if(!e.uuid)return!1;var r=null===(t=this.parent)||void 0===t||null===(i=t.engine)||void 0===i?void 0:i.textureBus;if(r){var o,s,l=this.childrenContent.find((function(t){return t.uuid===e.uuid}));null!=l&&null!==(o=l.config)&&void 0!==o&&null!==(s=o.material)&&void 0!==s&&s.TextureRef&&r.releaseTexture(l.config.material.TextureRef)}var u={uuid:e.uuid,point_id:e.point_id,config:{material:{},transform:null}},c=e.params;if(void 0!==c.opacity&&(c.color.a=c.opacity),c.color&&(u.config.material.Color={r:c.color.r,g:c.color.g,b:c.color.b,a:c.color.a||1}),c.brightnessColor&&(u.config.material.BrightnessColor={r:c.brightnessColor.r,g:c.brightnessColor.g,b:c.brightnessColor.b,a:1}),c.text){var d,h,f=st(gt(c.text,c.textStyle));u.config.material.Texture=f;var p=null===(d=this.parent)||void 0===d||null===(h=d.engine)||void 0===h?void 0:h.textureBus;p&&p.publishTexture(f).then((function(e){var t=e.ref;u.config.material.TextureRef=t,u.config.material.Texture=null})).catch((function(e){console.warn("[AssetLayer] publishTexture(text) failed, fallback to base64",e)}))}else if(c.map){var m=function(e){var t,i;u.config.material.Texture=e;var a=null===(t=n.parent)||void 0===t||null===(i=t.engine)||void 0===i?void 0:i.textureBus;a&&a.publishTexture(e).then((function(e){var t=e.ref;u.config.material.TextureRef=t,u.config.material.Texture=null})).catch((function(e){console.warn("[AssetLayer] publishTexture(map) failed, fallback to base64",e)}))};lt(c.map)?m(c.map):ot(c.map,(function(e){e&&m(e)}))}void 0!==c.metallic&&(u.config.material.Metallic=c.metallic),void 0!==c.roughness&&(u.config.material.Roughness=c.roughness),void 0!==c.brightness&&(u.config.material.Brightness=c.brightness),c.position&&(u.config.transform||(u.config.transform={}),u.config.transform.Location={x:c.position.x,y:c.position.y,z:c.position.z}),c.scale&&(u.config.transform||(u.config.transform={}),u.config.transform.Scale={x:c.scale.x,y:c.scale.y,z:c.scale.z}),c.rotation&&(u.config.transform||(u.config.transform={}),u.config.transform.Rotation={x:c.rotation.x,y:c.rotation.y,z:c.rotation.z}),void 0!==c.scroll&&(u.config.scroll=a.clamp(c.scroll,-1,1)),void 0!==c.speed&&(u.config.speed=c.speed),void 0!==c.animationIndex&&(u.config.animationIndex=c.animationIndex),void 0!==c.animationLoop&&(u.config.animationLoop=c.animationLoop),void 0!==c.animationSpeed&&(u.config.animationSpeed=c.animationSpeed),this.childrenContent.push(u)}},{key:"updateChildAnimation",value:function(e){if(!e)return!1;e instanceof Array?this.updateChildrenAnimation(e):this.updateChildrenAnimation([e])}},{key:"updateChildrenAnimation",value:function(e){var t=this;if(!e||e.length<1)return!1;this.childrenContent=[],e.forEach((function(e,i){t.updateChildContent(e)})),this.childOperate="animation",this.childNeedsUpdate=!0,this.materialNeedsUpdate=!0}},{key:"toJSON",value:function(){var e={DeviceUrl:this.url,DeviceBody:this.body,DeviceHeader:this.header,SearchMode:this.searchMode,TileLevel:this.tileLevel,RenderNum:this.renderNum,RTUrl:this.rtUrl,RTEnable:this.rtEnable,RTTileLevel:this.rtTilelLevel,Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,messageNeedsUpdate:this.messageNeedsUpdate,visible:this.visible,type:this.type,uuid:this.uuid,content:this.materialNeedsUpdate?this.childrenContent:null,childOperate:this.childOperate,AutoUpdate:this.deviceAutoUpdate,AutoUpdateInterval:this.deviceAutoUpdateInterval,MaxUpdateHeight:this.maxUpdateHeight};return this.childNeedsUpdate&&(this.childNeedsUpdate=!1,this.childOperate=null,this.materialNeedsUpdate=!0),e}}])}(),yi=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{color:{r:0,g:1,b:0,a:1},brightness:1,speed:.2};return U(this,e),(t=N(this,e,[i])).type="Radar",t}return z(e,vt),C(e)}(),bi=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{color:{r:1,g:0,b:0,a:1},brightness:1,speed:2};return U(this,e),(t=N(this,e,[i])).type="Ripple",t}return z(e,vt),C(e)}(),xi=function(){function e(t){var i;return U(this,e),(i=N(this,e,[t])).type="Soil",i}return z(e,vt),C(e)}(),Si=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{gardientDirection:-1,color:{r:0,g:.48,b:.0047,a:1},color2:{r:.43,g:1,b:.42,a:1}};return U(this,e),(t=N(this,e,[i])).type="Diamond",t}return z(e,vt),C(e)}(),wi=function(){function e(t){var i;U(this,e),(i=N(this,e,[t])).type="CommonCar";var n=void 0===t.carType?3:t.carType;return Object.defineProperties(i,{carType:{configurable:!0,enumerable:!0,get:function(){return n},set:function(e){void 0!==e&&(n=e,i.overtimeInstanceIndex=[],i.data=[],i.materialNeedsUpdate=!0)}}}),i}return z(e,vt),C(e,[{key:"toJSON",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return!this.visibleNeedsUpdate||!e||this.visible&&this.materialNeedsUpdate?{Color:{r:this.color.r,g:this.color.g,b:this.color.b,a:this.opacity},Brightness:this.brightness,Metallic:this.metallic,Roughness:this.roughness,Opacity:this.opacity,Transparent:this.transparent,Scroll:this.scroll,Speed:this.speed,Texture:this.texture,GardientDirection:this.gardientDirection,Color2:{r:this.color2.r,g:this.color2.g,b:this.color2.b,a:this.opacity},BrightnessColor:this.brightnessColor?{r:this.brightnessColor.r,g:this.brightnessColor.g,b:this.brightnessColor.b,a:1}:this.color,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,animateNeedsUpdate:!this.isInstance&&this.animateNeedsUpdate,visible:this.visible,type:this.type,CarType:this.carType,name:this.name,uuid:this.uuid,jsondata:!e||this.isInstance?this._resolveJsonData():null,animateJson:this.animateNeedsUpdate?this.animateJson:null,Size:this.size,SizeAttenuation:this.sizeAttenuation,ChildIndex:this.isInstance?-1:this.childIndex,IsInstance:this.isInstance,overtimeInstanceIndex:this.overtimeInstanceIndex}:{matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},type:this.type,name:this.name,uuid:this.uuid}}}])}(),Ni=function(){function e(t){var i;return U(this,e),(i=N(this,e,[t])).type="TriangleWarning",i}return z(e,vt),C(e)}(),Ui=function(){function e(t){var i;return U(this,e),(i=N(this,e,[t])).type="Bucket",i}return z(e,vt),C(e)}(),ki=function(){function e(t){var i;return U(this,e),(i=N(this,e,[t])).type="InundationAnalysis",i}return z(e,vt),C(e)}(),Ci=function(){function e(t){var i;U(this,e),(i=N(this,e,[t])).type="SkylineAnalysis";var n=t.distance||120,a=t.lineWidth||1;return Object.defineProperties(i,{distance:{configurable:!0,enumerable:!0,get:function(){return n},set:function(e){n=e,i.materialNeedsUpdate=!0}},lineWidth:{configurable:!0,enumerable:!0,get:function(){return a},set:function(e){a=e,i.materialNeedsUpdate=!0}}}),i}return z(e,vt),C(e,[{key:"toJSON",value:function(){return{Color:{r:this.color.r,g:this.color.g,b:this.color.b,a:this.opacity},Brightness:this.brightness,Opacity:this.opacity,Transparent:this.transparent,BloomColor:this.bloomColor?{r:this.bloomColor.r,g:this.bloomColor.g,b:this.bloomColor.b,a:1}:null,Position:{x:this.position.x,y:this.position.y,z:this.position.z},type:this.type,uuid:this.uuid,matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,Distance:this.distance,LineWidth:this.lineWidth}}}])}(),Ti=function(){function e(t){var i;U(this,e),(i=N(this,e,[t])).type="VisualFieldAnalysis";var n=t.fov||60,a=t.maxDistance||5,r=t.resYX||.5,o=t.resolution||1024;return Object.defineProperties(i,{fov:{configurable:!0,enumerable:!0,get:function(){return n},set:function(e){n=e,i.materialNeedsUpdate=!0}},maxDistance:{configurable:!0,enumerable:!0,get:function(){return a},set:function(e){a=e,i.materialNeedsUpdate=!0}},resYX:{configurable:!0,enumerable:!0,get:function(){return r},set:function(e){r=e,i.materialNeedsUpdate=!0}},resolution:{configurable:!0,enumerable:!0,get:function(){return o},set:function(e){o=e,i.materialNeedsUpdate=!0}}}),i}return z(e,vt),C(e,[{key:"toJSON",value:function(){return{Color:{r:this.color.r,g:this.color.g,b:this.color.b,a:this.opacity},Position:{x:this.position.x,y:this.position.y,z:this.position.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},type:this.type,uuid:this.uuid,matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,animateNeedsUpdate:this.animateNeedsUpdate,AnimateJson:this.animateNeedsUpdate?this.animateJson:null,visible:this.visible,FOV:this.fov,MaxDistance:this.maxDistance,ResYX:this.resYX,Resolution:this.resolution,Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z}}}}])}(),Ri=function(){function e(i){var n;U(this,e),(n=N(this,e,[i])).type="CarPark";var o,s=i.position||new t,l=i.rotation||new r,u=i.scale||new t(1,1,1),c=i.color||{r:1,g:1,b:1,a:1};return Object.defineProperties(n,{position:{enumerable:!0,get:function(){return s},set:function(e){e&&(s.x=e.x,s.y=e.y,s.z=e.z,n.matrixNeedsUpdate=!0)}},rotation:{configurable:!0,enumerable:!0,get:function(){return l},set:function(e){e&&(l.x=a.clamp(e.x,-180,180),l.y=a.clamp(e.y,-180,180),l.z=a.clamp(e.z,-180,180),n.matrixNeedsUpdate=!0)}},scale:{configurable:!0,enumerable:!0,get:function(){return u},set:function(e){e&&(u.x=e.x,u.y=e.y,u.z=e.z,n.matrixNeedsUpdate=!0)}},modelType:{configurable:!0,enumerable:!0,get:function(){return n._modelType},set:function(e){e&&(n._modelType=e)}},color:{configurable:!0,enumerable:!0,get:function(){return c},set:function(e){e&&(c.r=e.r,c.g=e.g,c.b=e.b,c.a=e.a||1,n.materialNeedsUpdate=!0)}},parkType:{configurable:!0,enumerable:!0,get:function(){return n._parkType},set:function(e){e&&("out"===e.toLowerCase?n._parkType="out":n._parkType="in")}}}),n.position=s,n.rotation=l,n.scale=u,n.modelType=(o=i.modelType,isNaN(o)||o<3||o>6&&o<12||o>16?3:o),n.speed=Number(i.speed)||36,n.endState=i.endState||!1,n.color=c,n.parkType=i.parkType||"in",n}return z(e,vt),C(e,[{key:"toJSON",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return!this.visibleNeedsUpdate||!e||this.visible&&this.materialNeedsUpdate?{Position:{x:this.position.x,y:this.position.y,z:this.position.z},Color:{r:this.color.r,g:this.color.g,b:this.color.b,a:this.color.a},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Speed:this.speed,ModelType:this.modelType,EndState:this.endState,Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,animateNeedsUpdate:this.animateNeedsUpdate,visible:this.visible,type:this.type,name:this.name,uuid:this.uuid,jsondata:e?null:this._resolveJsonData(),ParkType:this.parkType}:{matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},type:this.type,name:this.name,uuid:this.uuid}}}])}();var Oi=function(){function e(i){var n;U(this,e),(n=N(this,e,[i])).type="TrafficLight",n.url=i.url,n.header=i.header,n.message=i.message;var a=void 0===i.brightness?1:i.brightness;return n.lightAltitude=void 0===i.lightAltitude?1:i.lightAltitude,n.renderScale=void 0===i.renderScale?1:i.renderScale,n.rayDetection={enable:!1,distance:0,displacementHeight:0},i.rayDetection&&(n.rayDetection.enable=void 0!==i.rayDetection.enable&&i.rayDetection.enable,n.rayDetection.distance=void 0===i.rayDetection.distance?0:i.rayDetection.distance,n.rayDetection.displacementHeight=void 0===i.rayDetection.displacementHeight?0:i.rayDetection.displacementHeight),n.messageNeedsUpdate=!1,n.materialNeedsUpdate=!1,n.matrixNeedsUpdate=!1,n.offset=new t,Object.defineProperties(n,{brightness:{configurable:!0,enumerable:!0,get:function(){return a},set:function(e){a=e,n.materialNeedsUpdate=!0}}}),n}return z(e,je),C(e,[{key:"visible",get:function(){return this._visible},set:function(e){void 0===this._visible&&(this._visible=!0),e!==this._visible&&(this.visibleNeedsUpdate=!0,this._visible=e&&!0)}},{key:"message",get:function(){return this._body},set:function(e){this.messageNeedsUpdate=!0,this._body=e}},{key:"dispose",value:function(){return!1}},{key:"toJSON",value:function(){return{Url:this.url,Message:this.message,Header:this.header,RenderScale:this.renderScale,LightAltitude:this.lightAltitude,RayDetection:this.rayDetection,Brightness:this.brightness,Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,messageNeedsUpdate:this.messageNeedsUpdate,visible:this.visible,type:this.type,uuid:this.uuid}}}])}(),Ei=function(){function e(t){var i;U(this,e),(i=N(this,e,[t])).type="RoadName",i.fontSize=t.fontSize||14,i.rayDetectionDistance="rayDetectionDistance"in t?t.rayDetectionDistance:500,i.displacementHeight="displacementHeight"in t?t.displacementHeight:40*i.scale.z,i.data=t.data||[],i.filename=t.filename||null;var n=t.color||{r:1,g:1,b:1,a:1};i.openCollision=t.openCollision||!1,i.switchScale=t.switchScale||!1,i.minScale="minScale"in t?t.minScale:1,i.maxScale="maxScale"in t?t.maxScale:2,i.minDistance=t.minDistance||0,i.maxDistance=t.maxDistance||5e3;var a=t.switchPitchRotate||!1;return i.minPitch="minPitch"in t?t.minPitch:0,i.maxPitch="maxPitch"in t?t.maxPitch:90,i.collisionScale=t.collisionScale||2,i.brightness=t.brightness||1,Object.defineProperties(i,{color:{enumerable:!0,get:function(){return n},set:function(e){e!==n&&(n=e,this.materialNeedsUpdate=!0)}},switchPitchRotate:{enumerable:!0,get:function(){return a},set:function(e){e!==a&&(a=e,this.materialNeedsUpdate=!0)}}}),i}return z(e,vt),C(e,[{key:"toJSON",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return!this.visibleNeedsUpdate||!e||this.visible&&this.materialNeedsUpdate?{Color:{r:this.color.r,g:this.color.g,b:this.color.b,a:this.opacity},Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.z,y:this.scale.y,z:this.scale.x},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,type:this.type,name:this.name,uuid:this.uuid,jsondata:this.data,rayDetectionDistance:this.rayDetectionDistance,displacementHeight:this.displacementHeight,FileName:this.filename,FontSize:this.fontSize,OpenCollision:this.openCollision,SwitchScale:this.switchScale,MinScale:this.minScale,MaxScale:this.maxScale,MinDistance:this.minDistance,MaxDistance:this.maxDistance,SwitchPitchRotate:this.switchPitchRotate,MinPitch:this.minPitch,MaxPitch:this.maxPitch,CollisionScale:this.collisionScale,ShadowColor:this.shadowColor,ShadowOffset:this.shadowOffset,Brightness:this.brightness}:{matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.z,y:this.scale.y,z:this.scale.x},Rotation:{x:this.rotation.x,y:this.rotation.y+90,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},type:this.type,name:this.name,uuid:this.uuid}}}])}(),zi=function(){function e(i){var n;U(this,e),(n=N(this,e,[i])).type="AutonomousVehicle";var a=i.url,r=i.header,o=void 0===i.labelRenderScale?1:i.labelRenderScale,s=void 0===i.labelRenderType?1:i.labelRenderType,l=void 0===i.labelBrightness?1:i.labelBrightness,u=void 0===i.followMode?"Third":i.followMode;n.labelField=void 0===i.labelField?"vehicleId":i.labelField,n.speedField=void 0===i.speedField?"speed":i.speedField,n.followRotation=void 0===i.followRotation?{Roll:!1,Pitch:!1,Yaw:!0}:i.followRotation;var c=void 0===i.followZoom?0:i.followZoom,d=void 0!==i.switchScale&&i.switchScale,h=void 0===i.minViewPortHeight?30:i.minViewPortHeight,f=void 0===i.maxViewPortHeight?300:i.maxViewPortHeight,p=void 0===i.minScale?1:i.minScale,m=void 0===i.maxScale?2:i.maxScale,g=void 0===i.controlTypeList?[]:i.controlTypeList,v=void 0!==i.predictionEnable&&i.predictionEnable,y=void 0===i.predictionLineStyle?{}:i.predictionLineStyle;return n.rayDetection={enable:!1,distance:0},i.rayDetection&&(n.rayDetection.enable=void 0!==i.rayDetection.enable&&i.rayDetection.enable,n.rayDetection.distance=void 0===i.rayDetection.distance?0:i.rayDetection.distance),n.messageNeedsUpdate=!1,n.materialNeedsUpdate=!1,n.matrixNeedsUpdate=!1,n.followNeedsUpdate=!1,n.offset=new t,Object.defineProperties(n,{url:{configurable:!0,enumerable:!0,get:function(){return a},set:function(e){e&&(a=e,n.messageNeedsUpdate=!0)}},header:{configurable:!0,enumerable:!0,get:function(){return r},set:function(e){e&&(r=e,n.messageNeedsUpdate=!0)}},labelRenderScale:{configurable:!0,enumerable:!0,get:function(){return o},set:function(e){e&&(o=e,n.materialNeedsUpdate=!0)}},labelBrightness:{configurable:!0,enumerable:!0,get:function(){return l},set:function(e){e&&(l=e,n.materialNeedsUpdate=!0)}},predictionLineStyle:{configurable:!0,enumerable:!0,get:function(){return y},set:function(e){e&&(y=e,n.materialNeedsUpdate=!0)}},labelRenderType:{configurable:!0,enumerable:!0,get:function(){return s},set:function(e){e&&(s=e,n.materialNeedsUpdate=!0)}},predictionEnable:{configurable:!0,enumerable:!0,get:function(){return v},set:function(e){e&&(v=e,n.materialNeedsUpdate=!0)}},followMode:{configurable:!0,enumerable:!0,get:function(){return u},set:function(e){e&&(u=e,n.followNeedsUpdate=!0)}},followZoom:{configurable:!0,enumerable:!0,get:function(){return c},set:function(e){e&&(c=e,n.materialNeedsUpdate=!0)}},switchScale:{configurable:!0,enumerable:!0,get:function(){return d},set:function(e){e&&(d=e,n.materialNeedsUpdate=!0)}},minViewPortHeight:{configurable:!0,enumerable:!0,get:function(){return h},set:function(e){e&&(h=e,n.materialNeedsUpdate=!0)}},maxViewPortHeight:{configurable:!0,enumerable:!0,get:function(){return f},set:function(e){e&&(f=e,n.materialNeedsUpdate=!0)}},minScale:{configurable:!0,enumerable:!0,get:function(){return p},set:function(e){e&&(p=e,n.materialNeedsUpdate=!0)}},maxScale:{configurable:!0,enumerable:!0,get:function(){return m},set:function(e){e&&(m=e,n.materialNeedsUpdate=!0)}},controlTypeList:{configurable:!0,enumerable:!0,get:function(){return g},set:function(e){g=e||[]}}}),n}return z(e,je),C(e,[{key:"visible",get:function(){return this._visible},set:function(e){void 0===this._visible?this._visible=!0:(this._visible=e&&!0,this.visibleNeedsUpdate=!0)}},{key:"dispose",value:function(){return!1}},{key:"toJSON",value:function(){return(!(arguments.length>0&&void 0!==arguments[0])||arguments[0])&&this.visibleNeedsUpdate?{Url:this.url,Header:this.header,LabelRenderScale:this.labelRenderScale,LabelRenderType:this.labelRenderType,LabelField:this.labelField,SpeedField:this.speedField,RayDetection:this.rayDetection,ControlTypeList:this.controlTypeList,FollowMode:this.followMode,SwitchScale:this.switchScale,MinViewPortHeight:this.minViewPortHeight,MaxViewPortHeight:this.maxViewPortHeight,FollowRotation:this.followRotation,LabelBrightness:this.labelBrightness,MinScale:this.minScale,MaxScale:this.maxScale,FollowZoom:this.followZoom,PredictionLineStyle:this.predictionLineStyle,PredictionEnable:this.predictionEnable,Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,messageNeedsUpdate:this.messageNeedsUpdate,visible:this.visible,type:this.type,uuid:this.uuid}:{Url:this.url,Header:this.header,LabelRenderScale:this.labelRenderScale,LabelRenderType:this.labelRenderType,LabelField:this.labelField,SpeedField:this.speedField,RayDetection:this.rayDetection,FollowMode:this.followMode,SwitchScale:this.switchScale,MinViewPortHeight:this.minViewPortHeight,MaxViewPortHeight:this.maxViewPortHeight,ControlTypeList:this.controlTypeList,FollowRotation:this.followRotation,FollowZoom:this.followZoom,LabelBrightness:this.labelBrightness,PredictionLineStyle:this.predictionLineStyle,PredictionEnable:this.predictionEnable,MinScale:this.minScale,MaxScale:this.maxScale,Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,messageNeedsUpdate:this.messageNeedsUpdate,visible:this.visible,type:this.type,uuid:this.uuid}}}])}(),Ii=function(){function e(t){var i;return U(this,e),(i=N(this,e,[t])).type="QuadPyramidTop",i}return z(e,vt),C(e)}(),Ai=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};U(this,e),(t=N(this,e,[i])).visible=void 0===i.visible||i.visible,t.renderType=void 0===i.renderType?1:i.renderType;var n=i.url||"",a=i.size||{x:300,y:200},r=0===i.faceType?0:i.faceType||1,o=i.pivot||{x:.5,y:.5},s=void 0!==i.switchScale&&i.switchScale,l=i.minDistance||0,u=i.maxDistance||0,c=void 0===i.minScale?1:i.minScale,d=void 0===i.maxScale?1:i.maxScale;return t.type="WebViewPoint",Object.defineProperties(t,{url:{configurable:!0,enumerable:!0,get:function(){return n},set:function(e){n=e,t.materialNeedsUpdate=!0}},size:{configurable:!0,enumerable:!0,get:function(){return a},set:function(e){a=e,t.materialNeedsUpdate=!0}},pivot:{configurable:!0,enumerable:!0,get:function(){return o},set:function(e){o=e,t.materialNeedsUpdate=!0}},faceType:{configurable:!0,enumerable:!0,get:function(){return r},set:function(e){r=e,t.materialNeedsUpdate=!0}},switchScale:{configurable:!0,enumerable:!0,get:function(){return s},set:function(e){s=e,t.materialNeedsUpdate=!0}},minDistance:{configurable:!0,enumerable:!0,get:function(){return l},set:function(e){l=e,t.materialNeedsUpdate=!0}},maxDistance:{configurable:!0,enumerable:!0,get:function(){return u},set:function(e){u=e,t.materialNeedsUpdate=!0}},minScale:{configurable:!0,enumerable:!0,get:function(){return c},set:function(e){c=e,t.materialNeedsUpdate=!0}},maxScale:{configurable:!0,enumerable:!0,get:function(){return d},set:function(e){d=e,t.materialNeedsUpdate=!0}}}),t}return z(e,vt),C(e,[{key:"setData",value:function(e){this.data=nt(e)}},{key:"toJSON",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return e&&this.visibleNeedsUpdate&&!this.materialNeedsUpdate?{matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,FadeIn:this.fadeIn,type:this.type,name:this.name,uuid:this.uuid}:{Pivot:this.pivot,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},type:this.type,uuid:this.uuid,jsondata:e?null:this.data,FaceType:Vt(this.faceType),SwitchScale:this.switchScale,MinDistance:this.minDistance,MaxDistance:this.maxDistance,MaxScale:this.maxScale,MinScale:this.minScale,matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,URL:this.url,Size:this.size,Brightness:this.brightness,RenderType:this.renderType}}},{key:"copy",value:function(t){var i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return this.fontWeight=t.fontWeight,this.fontSize=t.fontSize,this.borderWidth=t.borderWidth,this.borderColor=t.borderColor,this.shadowColor=t.shadowColor,this.shadowOffset=t.shadowOffset,F(e,"copy",this)([t,i]),this}}])}(),_i=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};U(this,e),(t=N(this,e,[i])).type="LayerBuilding";var n=i.buildingName||"all",a=i.layeringHeight||500,r=i.layeringBaseHeight||300,o=i.floorPullDir||{x:5e3,y:0,z:0};return t.hiddenDefault=void 0===i.HiddenDefault||i.HiddenDefault,t.floorNum=0,t.eventName="",t.buildingState="create",t.isLayering={},t.isLayering[n]=!1,Object.defineProperties(t,{layeringHeight:{enumerable:!0,get:function(){return a},set:function(e){e!==a&&(a=e,this.materialNeedsUpdate=!0,this.buildingState="update")}},buildingName:{enumerable:!0,get:function(){return n},set:function(e){e&&e!==n&&(n=e,this.materialNeedsUpdate=!0,this.buildingState="update")}},layeringBaseHeight:{enumerable:!0,get:function(){return r},set:function(e){e!==r&&(r=e,this.materialNeedsUpdate=!0,this.buildingState="update")}},floorPullDir:{configurable:!0,enumerable:!0,get:function(){return o},set:function(e){e&&(o.x=e.x,o.y=e.y,o.z=e.z,t.materialNeedsUpdate=!0,t.buildingState="update")}}}),t}return z(e,vt),C(e,[{key:"layeringBuilding",value:function(){if(this.eventName="Layering",this.animateNeedsUpdate=!0,this.buildingState="update","all"===this.buildingName)for(var e in this.isLayering)this.isLayering[e]=!0;else this.isLayering[this.buildingName]=!0}},{key:"backBuildingToNormal",value:function(){if(this.eventName="BackToNormal",this.animateNeedsUpdate=!0,this.buildingState="update","all"===this.buildingName)for(var e in this.isLayering)this.isLayering[e]=!1;else this.isLayering[this.buildingName]=!1}},{key:"pullBuilding",value:function(e){if(void 0===this.isLayering[this.buildingName]){if(!this.isLayering.all)return void console.warn("该建筑物不在分解状态")}else if(!1===this.isLayering[this.buildingName])return void console.warn("该建筑物不在分解状态");e?(this.eventName="Pull",this.floorNum=e,this.animateNeedsUpdate=!0,this.buildingState="update"):console.warn("请输入有效楼层")}},{key:"pushBuilding",value:function(e){if(void 0===this.isLayering[this.buildingName]){if(!this.isLayering.all)return void console.warn("该建筑物不在分解状态")}else if(!this.isLayering[this.buildingName])return void console.warn("该建筑物不在分解状态");e?(this.eventName="Push",this.floorNum=e,this.animateNeedsUpdate=!0,this.buildingState="update"):console.warn("请输入有效楼层")}},{key:"hideBuildings",value:function(e){Array.isArray(e)?(this.eventName="Hide",this.floorNum=e,this.animateNeedsUpdate=!0,this.buildingState="update"):console.error("numbers必须为数组")}},{key:"showBuildings",value:function(e){Array.isArray(e)?(this.eventName="Show",this.floorNum=e,this.animateNeedsUpdate=!0,this.buildingState="update"):console.error("numbers必须为数组")}},{key:"hideAboveFloor",value:function(e){0!==e&&(this.eventName="HideAboveFloor",this.floorNum=e,this.animateNeedsUpdate=!0,this.buildingState="update")}},{key:"showAll",value:function(){this.eventName="ShowAll",this.animateNeedsUpdate=!0,this.buildingState="update"}},{key:"hideAll",value:function(){this.eventName="HideAll",this.animateNeedsUpdate=!0,this.buildingState="update"}},{key:"toJSON",value:function(){return{type:this.type,name:this.name,uuid:this.uuid,BuildingName:this.buildingName,LayeringHeight:this.layeringHeight,LayeringBaseHeight:this.layeringBaseHeight,FloorPullDir:this.floorPullDir,FloorNum:this.floorNum,EventName:this.eventName,materialNeedsUpdate:this.materialNeedsUpdate,animateNeedsUpdate:this.animateNeedsUpdate,BuildingState:this.buildingState,HiddenDefault:this.hiddenDefault}}}])}(),Mi=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};U(this,e),(t=N(this,e,[i])).type="MockCarStream",t.renderNum=void 0===i.renderNum?20:i.renderNum,t.enableTrigger=void 0!==i.enableTrigger&&i.enableTrigger,t.twoSide=i.twoSide||!1,t.twoSideWidth=i.twoSideWidth||200,t.reverseInterval=i.reverseInterval||1e3,t.reverseSpeed=i.reverseSpeed||1500;var n=i.runOnTheGround||!1,a=i.lanesNumber||1,r=i.forwardInterval||1e3,o=i.forwardSpeed||200,s=i.splineLoop||!1,l=i.randomBool||!1,u=i.randomForwardOffset||0,c=i.laneWidth||300,d=i.rotationOffset||0,h=i.scaleOffset||{x:1,y:1,z:1};return Object.defineProperties(t,{runOnTheGround:{enumerable:!0,get:function(){return n},set:function(e){n!==e&&(n=e,t.materialNeedsUpdate=!0)}},lanesNumber:{enumerable:!0,get:function(){return a},set:function(e){a!==e&&(a=e,t.materialNeedsUpdate=!0)}},forwardInterval:{enumerable:!0,get:function(){return r},set:function(e){r!==e&&(r=e,t.materialNeedsUpdate=!0)}},forwardSpeed:{enumerable:!0,get:function(){return o},set:function(e){o!==e&&(o=e,t.materialNeedsUpdate=!0)}},splineLoop:{enumerable:!0,get:function(){return s},set:function(e){s!==e&&(s=e,t.materialNeedsUpdate=!0)}},randomBool:{enumerable:!0,get:function(){return l},set:function(e){l!==e&&(l=e,t.materialNeedsUpdate=!0)}},randomForwardOffset:{enumerable:!0,get:function(){return u},set:function(e){u!==e&&(u=e,t.materialNeedsUpdate=!0)}},laneWidth:{enumerable:!0,get:function(){return c},set:function(e){c!==e&&(c=e,t.materialNeedsUpdate=!0)}},rotationOffset:{enumerable:!0,get:function(){return d},set:function(e){d!==e&&(d=e,t.materialNeedsUpdate=!0)}},scaleOffset:{enumerable:!0,get:function(){return h},set:function(e){h=e,t.materialNeedsUpdate=!0}}}),t}return z(e,vt),C(e,[{key:"toJSON",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return{Color:{r:this.color.r,g:this.color.g,b:this.color.b,a:this.opacity},Brightness:this.brightness,Opacity:this.opacity,Transparent:this.transparent,BloomColor:this.bloomColor?{r:this.bloomColor.r,g:this.bloomColor.g,b:this.bloomColor.b,a:1}:null,Position:{x:this.position.x,y:this.position.y,z:this.position.z},EnableTrigger:this.enableTrigger,TwoSide:this.twoSide,TwoSideWidth:this.twoSideWidth,ReverseInterval:this.reverseInterval,ReverseSpeed:this.reverseSpeed,type:this.type,uuid:this.uuid,matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},RunOnTheGround:this.runOnTheGround,LanesNumber:this.lanesNumber,ForwardInterval:this.forwardInterval,ForwardSpeed:this.forwardSpeed,SplineLoop:this.splineLoop,RandomBool:this.randomBool,RandomForwardOffset:this.randomForwardOffset,LaneWidth:this.laneWidth,RotationOffset:this.rotationOffset,ScaleOffset:this.scaleOffset,jsondata:e?null:this._resolveJsonData(),RenderNum:this.renderNum}}}])}(),Li=[{r:.685325,g:1,b:.298996},{r:.963023,g:1,b:.198688},{r:1,g:.710181,b:.235817},{r:1,g:.440705,b:.156314},{r:1,g:.310357,b:.150163},{r:1,g:.219426,b:.155697}],Di=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};U(this,e),(t=N(this,e,[i])).type="SlopeAnalysis";var n=i.range||null,a=Bi(i.minAngle,!0),r=Bi(i.maxAngle,!1),o=Pi(i.colorRange),s=i.useSlopeAnalysis||!1,l=i.tilePathFieldName||"";return Object.defineProperties(t,{tilePathFieldName:{configurable:!0,enumerable:!0,get:function(){return l},set:function(e){l=e,t.materialNeedsUpdate=!0}},range:{configurable:!0,enumerable:!0,get:function(){return n},set:function(e){n=e,t.materialNeedsUpdate=!0}},minAngle:{configurable:!0,enumerable:!0,get:function(){return a},set:function(e){a=Bi(e,!0),t.materialNeedsUpdate=!0}},maxAngle:{configurable:!0,enumerable:!0,get:function(){return r},set:function(e){r=Bi(e,!1),t.materialNeedsUpdate=!0}},colorRange:{configurable:!0,enumerable:!0,get:function(){return o},set:function(e){o=Pi(e),t.materialNeedsUpdate=!0}},useSlopeAnalysis:{configurable:!0,enumerable:!0,get:function(){return s},set:function(e){s=e,e&&(t.materialNeedsUpdate=!0)}}}),t}return z(e,vt),C(e,[{key:"toJSON",value:function(){return{Color:{r:this.color.r,g:this.color.g,b:this.color.b,a:this.opacity},Brightness:this.brightness,Opacity:this.opacity,Transparent:this.transparent,BloomColor:this.bloomColor?{r:this.bloomColor.r,g:this.bloomColor.g,b:this.bloomColor.b,a:1}:null,Position:{x:this.position.x,y:this.position.y,z:this.position.z},type:this.type,uuid:this.uuid,matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,jsonData:this.range,MinAngle:this.minAngle,MaxAngle:this.maxAngle,ColorRange:this.colorRange,UseSlopeAnalysis:Number(this.useSlopeAnalysis),TilePathFieldName:this.tilePathFieldName}}}])}();function Pi(e){if(e&&e instanceof Object){var t=0,i=0;for(var n in e)i=n,t++;if(0===i)return{25:Li[0],40:Li[1],55:Li[2],70:Li[3],80:Li[4],90:Li[5]};for(var a=t;a<6;a++)i<25?e[i=40]=Li[1]:i<40.00001?e[i=55]=Li[2]:i<55.00001?e[i=70]=Li[3]:i<70.00001?e[i=80]=Li[4]:i<80.00001?e[i=90]=Li[5]:i<90.00001?e[i=91]=Li[5]:e[i+=a]=Li[5];return e}return{25:Li[0],40:Li[1],55:Li[2],70:Li[3],80:Li[4],90:Li[5]}}function Bi(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return!(arguments.length>1&&void 0!==arguments[1])||arguments[1]?e<=0?0:e:e<=0?90:e}var Fi=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};U(this,e),(t=N(this,e,[i])).pointType="pointType"in i?i.pointType.toLowerCase():"iconpoint";var n=i.pointStyle||{};for(var a in n.renderType=0,n.openCollision=!1,t.pointJSON=Wi(t.pointType,n),t.clusterStyle=i.clusterStyle||{},t.clusterStyle){var r=t.clusterStyle[a];t.clusterStyle[a]=Wi(t.pointType,r)}var o=i.minPixelDistance||100;return t.type="ClusterPoint",Object.defineProperties(t,{minPixelDistance:{configurable:!0,enumerable:!0,get:function(){return o},set:function(e){var i=Number(e);i&&o!==i&&(o=i,t.materialNeedsUpdate=!0)}}}),t}return z(e,vt),C(e,[{key:"setData",value:function(e){this.data=nt(e)}},{key:"toJSON",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return!e||!this.visibleNeedsUpdate||this.visible&&this.materialNeedsUpdate?{Color:{r:this.color.r,g:this.color.g,b:this.color.b,a:this.opacity},Brightness:this.brightness,Metallic:this.metallic,Roughness:this.roughness,Opacity:this.opacity,Transparent:this.transparent,Texture:this.texture,BloomColor:this.bloomColor?{r:this.bloomColor.r,g:this.bloomColor.g,b:this.bloomColor.b,a:1}:null,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},type:this.type,uuid:this.uuid,jsondata:e?null:this.data,matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,animateNeedsUpdate:this.animateNeedsUpdate,animateJson:this.animateNeedsUpdate?this.animateJson:null,MinPixelDistance:this.minPixelDistance,PointJSON:this.pointJSON,PointType:this.pointType,ClusterStyle:this.clusterStyle}:{matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},type:this.type,name:this.name,uuid:this.uuid}}},{key:"copy",value:function(t){var i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return this.size=t.size,F(e,"copy",this)([t,i]),this}}])}();function Wi(e,t){var i;switch(e){case"basiclabel":i=new Kt(t).toJSON();case"iconpoint":i=new Jt(t).toJSON();case"textpoint":i=new qt(t).toJSON();default:i=new Jt(t).toJSON()}return t.clusterText&&(i.ClusterText=t.clusterText),i}var ji=function(){function e(t){var i;return U(this,e),(i=N(this,e,[t])).visible=void 0===t.visible||t.visible,i}return z(e,je),C(e,[{key:"visible",get:function(){return this._visible},set:function(e){void 0===this._visible&&(this._visible=!0),e!==this._visible&&(this.visibleNeedsUpdate=!0,this._visible=e&&!0)}}])}(),Hi=function(){function e(i){var n;U(this,e),(n=N(this,e,[i])).type="UserInfoLightLayer";var a=i.url,r=i.header,o=void 0===i.brightness?1:i.brightness,s=void 0===i.lightAltitude?1:i.lightAltitude,l=void 0===i.renderScale?1:i.renderScale,u=void 0===i.renderTilesNum?3:i.renderTilesNum,c=void 0===i.updateCheckInterval?2:i.updateCheckInterval,d=void 0===i.maxUpdateHeight?1e3:i.maxUpdateHeight,h=void 0===i.centerDetectDistance?3e3:i.centerDetectDistance;return n.guidingLine={enable:!0,color:{r:.171441,g:.223228,b:.376262}},i.guidingLine&&(n.guidingLine.enable=void 0===i.guidingLine.enable||i.guidingLine.enable,n.guidingLine.color=void 0===i.guidingLine.color?{r:.171441,g:.223228,b:.376262}:i.guidingLine.color),n.rayDetection={enable:!1,distance:0,displacementHeight:0},i.rayDetection&&(n.rayDetection.enable=void 0!==i.rayDetection.enable&&i.rayDetection.enable,n.rayDetection.distance=void 0===i.rayDetection.distance?0:i.rayDetection.distance,n.rayDetection.displacementHeight=void 0===i.rayDetection.displacementHeight?0:i.rayDetection.displacementHeight),n.messageNeedsUpdate=!1,n.materialNeedsUpdate=!1,n.matrixNeedsUpdate=!1,n.offset=new t,Object.defineProperties(n,{url:{configurable:!0,enumerable:!0,get:function(){return a},set:function(e){a=e,n.materialNeedsUpdate=!0}},header:{configurable:!0,enumerable:!0,get:function(){return r},set:function(e){r=e,n.materialNeedsUpdate=!0}},lightAltitude:{configurable:!0,enumerable:!0,get:function(){return s},set:function(e){s=e,n.materialNeedsUpdate=!0}},renderScale:{configurable:!0,enumerable:!0,get:function(){return l},set:function(e){l=e,n.materialNeedsUpdate=!0}},renderTilesNum:{configurable:!0,enumerable:!0,get:function(){return u},set:function(e){u=e,n.materialNeedsUpdate=!0}},updateCheckInterval:{configurable:!0,enumerable:!0,get:function(){return c},set:function(e){c=e,n.materialNeedsUpdate=!0}},centerDetectDistance:{configurable:!0,enumerable:!0,get:function(){return h},set:function(e){h=e,n.materialNeedsUpdate=!0}},brightness:{configurable:!0,enumerable:!0,get:function(){return o},set:function(e){o=e,n.materialNeedsUpdate=!0}},maxUpdateHeight:{configurable:!0,enumerable:!0,get:function(){return d},set:function(e){d=e,n.materialNeedsUpdate=!0}}}),n}return z(e,ji),C(e,[{key:"dispose",value:function(){return!1}},{key:"toJSON",value:function(){return{Url:this.url,Header:this.header,RenderScale:this.renderScale,LightAltitude:this.lightAltitude,CenterDetectDistance:this.centerDetectDistance,RayDetection:this.rayDetection,GuidingLine:this.guidingLine,Brightness:this.brightness,RenderTilesNum:this.renderTilesNum,UpdateCheckInterval:this.updateCheckInterval,MaxUpdateHeight:this.maxUpdateHeight,Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,messageNeedsUpdate:this.messageNeedsUpdate,visible:this.visible,type:this.type,uuid:this.uuid}}}])}(),Gi=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};U(this,e),(t=N(this,e,[i])).name=i.name||"",t.type="RoutePlan";var n=i.url;return t.messageNeedsUpdate=!1,Object.defineProperties(t,{url:{configurable:!0,enumerable:!0,get:function(){return n},set:function(e){e&&(n=e,t.messageNeedsUpdate=!0)}}}),t}return z(e,bt),C(e,[{key:"toJSON",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return!e||!this.visibleNeedsUpdate||this.visible&&this.materialNeedsUpdate?{Color:{r:this.color.r,g:this.color.g,b:this.color.b,a:this.opacity},URL:this.url,Brightness:this.brightness,Metallic:this.metallic,Roughness:this.roughness,Opacity:this.opacity,Transparent:this.transparent,Collision:this.collision,Texture:this.texture,BloomColor:this.bloomColor?{r:this.bloomColor.r,g:this.bloomColor.g,b:this.bloomColor.b,a:1}:null,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,messageNeedsUpdate:this.messageNeedsUpdate,visible:this.visible,type:this.type,uuid:this.uuid,jsondata:e?null:this._resolveJsonData(),Style:this.style,Spline_Type:this.splineType,MeshDirection:this.direction,RenderType:this.renderType,Section_Length:this.section_Length,Width:this.width,Tilling:this.tilling,Speed:this.speed,Open_Stroke:this.openStroke,Stroke_Color:this.strokeColor?{r:this.strokeColor.r,g:this.strokeColor.g,b:this.strokeColor.b,a:1}:null,Stroke_Width:this.strokeWidth,animateNeedsUpdate:this.animateNeedsUpdate,animateJson:this.animateNeedsUpdate?this.animateJson:null,LineUVOption:this.lineUVOption,colordata:this.colordata}:{matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},type:this.type,name:this.name,uuid:this.uuid}}},{key:"copy",value:function(t){var i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return this.style=t.style,this.splineType=t.splineType,this.direction=t.direction,this.width=t.width,this.tilling=t.tilling,this.speed=t.speed,this.openStroke=t.openStroke,this.strokeColor=t.strokeColor,this.strokeWidth=t.strokeWidth,F(e,"copy",this)([t,i]),this}}])}(),Vi=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return U(this,e),(t=N(this,e,[i])).visible=void 0===i.visible||i.visible,t.lightType=void 0===i.lightType?"PointLight":i.lightType,t.pointLightStyle=void 0===i.pointLightStyle?{intensity:8,color:{r:1,g:1,b:1}}:i.pointLightStyle,t.spotLightStyle=void 0===i.spotLightStyle?{intensity:8,color:{r:1,g:1,b:1},innerConeAngle:0,outerConeAngle:44}:i.spotLightStyle,t.rectLightStyle=void 0===i.rectLightStyle?{intensity:8,color:{r:1,g:1,b:1},barnDoorAngle:88,barnDoorlength:20}:i.rectLightStyle,t.type="Light",t}return z(e,vt),C(e,[{key:"setData",value:function(e){this.data=nt(e)}},{key:"toJSON",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return e&&this.visibleNeedsUpdate&&!this.materialNeedsUpdate?{matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,type:this.type,name:this.name,uuid:this.uuid}:{Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},type:this.type,uuid:this.uuid,jsondata:e?null:this.data,matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,LightType:this.lightType,PointLightStyle:this.pointLightStyle,SpotLightStyle:this.spotLightStyle,RectLightStyle:this.rectLightStyle,visible:this.visible}}},{key:"copy",value:function(t){var i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return this.fontWeight=t.fontWeight,this.fontSize=t.fontSize,this.borderWidth=t.borderWidth,this.borderColor=t.borderColor,this.shadowColor=t.shadowColor,this.shadowOffset=t.shadowOffset,F(e,"copy",this)([t,i]),this}}])}(),Ji=function(){function e(){var i,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};U(this,e),(i=N(this,e,[n])).name=n.name||"",i.type="LargeRoadCondition",i.defaultColors={1:{r:.015625,g:0,b:0,a:1},2:{r:.043403,g:.001204,b:.001635,a:1},3:{r:.078125,g:.058385,b:0,a:1},4:{r:207e-6,g:.109375,b:0,a:1}};var a=n.roadGeoJsonUrl||"",r=n.roadConditionUrl||"",o=n.layerGroupName||"",s=void 0===n.heightOffset?.7:n.heightOffset,l=void 0===n.camFOV?90:n.camFOV,u=void 0===n.aspectRatio?1:n.aspectRatio,c=n.colors||i.defaultColors,d=i.validateColors(c)?c:i.defaultColors,h=i.getValidBrightnessList(n.brightnessList);return i.messageNeedsUpdate=!1,i.materialNeedsUpdate=!1,i.matrixNeedsUpdate=!1,i.offset=new t,Object.defineProperties(i,{roadGeoJsonUrl:{enumerable:!0,get:function(){return a},set:function(e){e&&(a=e,this.materialNeedsUpdate=!0)}},roadConditionUrl:{enumerable:!0,get:function(){return r},set:function(e){e&&(r=e,this.materialNeedsUpdate=!0)}},layerGroupName:{enumerable:!0,get:function(){return o},set:function(e){e&&(o=e,this.materialNeedsUpdate=!0)}},heightOffset:{configurable:!0,enumerable:!0,get:function(){return s},set:function(e){void 0!==e&&(s=e,i.materialNeedsUpdate=!0)}},camFOV:{configurable:!0,enumerable:!0,get:function(){return l},set:function(e){void 0!==e&&(l=e,i.materialNeedsUpdate=!0)}},aspectRatio:{configurable:!0,enumerable:!0,get:function(){return u},set:function(e){void 0!==e&&(u=e,i.materialNeedsUpdate=!0)}},colors:{configurable:!0,enumerable:!0,get:function(){return d},set:function(e){void 0!==e&&(d=i.validateColors(e)?e:i.defaultColors,i.materialNeedsUpdate=!0)}},brightnessList:{configurable:!0,enumerable:!0,get:function(){return h},set:function(e){void 0!==e&&(h=i.getValidBrightnessList(e),i.materialNeedsUpdate=!0)}}}),i}return z(e,ji),C(e,[{key:"getValidBrightnessList",value:function(e){return Array.isArray(e)&&4===e.length&&this.allElementsGreaterThanZero(e)?e:[15,15,15,15]}},{key:"allElementsGreaterThanZero",value:function(e){return e.every((function(e){return"number"==typeof e&&e>=0}))}},{key:"validateColors",value:function(e){if("object"!==G(e)||null===e)return console.error("Invalid color format: Colors should be a non-null object."),!1;for(var t in this.defaultColors)if(this.defaultColors.hasOwnProperty(t)){if(!e.hasOwnProperty(t))return console.error("Missing color key: ".concat(t)),!1;var i=e[t];if(!this.isValidColorComponent(i))return console.error("Invalid color components at key: ".concat(t)),!1}return!0}},{key:"isValidColorComponent",value:function(e){if("object"!==G(e)||null===e)return!1;var t=e.r,i=e.g,n=e.b,a=e.a;return this.isNumberInRange(t)&&this.isNumberInRange(i)&&this.isNumberInRange(n)&&this.isNumberInRange(a)}},{key:"isNumberInRange",value:function(e){return"number"==typeof e&&e>=0&&e<=1}},{key:"dispose",value:function(){return!1}},{key:"toJSON",value:function(){return{RoadGeoJsonUrl:this.roadGeoJsonUrl,LayerGroupName:this.layerGroupName,RoadConditionUrl:this.roadConditionUrl,HeightOffset:this.heightOffset,CamFOV:this.camFOV,AspectRatio:this.aspectRatio,Colors:this.colors,BrightnessList:this.brightnessList,Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,messageNeedsUpdate:this.messageNeedsUpdate,visible:this.visible,type:this.type,uuid:this.uuid}}}])}(),qi={version:"2.9.1",name:"CloudRenderEngine",author:["liran23"]},Yi=function(){function e(i){var n;U(this,e),(n=N(this,e,[i])).type="IndoorMap",n.url=i.url,n.mpoi="",n.floor=999,n.floorList=[];var a=i.layeringHeight||500,r=i.layeringBaseHeight||300;return n.messageNeedsUpdate=!1,n.materialNeedsUpdate=!1,n.matrixNeedsUpdate=!1,n.animateNeedsUpdate=!1,n.offset=new t,Object.defineProperties(n,{layeringHeight:{enumerable:!0,get:function(){return a},set:function(e){e!==a&&(a=e,this.materialNeedsUpdate=!0)}},layeringBaseHeight:{enumerable:!0,get:function(){return r},set:function(e){e!==r&&(r=e,this.materialNeedsUpdate=!0)}}}),n}return z(e,je),C(e,[{key:"dispose",value:function(){return!1}},{key:"getIndoorDataByCenter",value:(n=w(D().mark((function e(t){var i,n,a=arguments;return D().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=a.length>1&&void 0!==a[1]?a[1]:500,n=this._getBoundingBox(t,i),e.next=4,this._requestDataList(n.minLng,n.minLat,n.maxLng,n.maxLat);case 4:return e.abrupt("return",e.sent);case 5:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"_requestDataList",value:(i=w(D().mark((function e(t,i,n,a){var r,o,s,l,u;return D().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s="http://".concat(this.url,"/indoor/query/?minX=").concat(t,"&minY=").concat(i,"&maxX=").concat(n,"&maxY=").concat(a),e.next=3,y.get(s);case 3:if(0===(null==(l=e.sent)||null===(r=l.data)||void 0===r?void 0:r.status)){e.next=7;break}return console.error((null==l||null===(u=l.data)||void 0===u?void 0:u.message)||"获取室内数据失败"),e.abrupt("return",[]);case 7:return e.abrupt("return",null===(o=l.data)||void 0===o?void 0:o.indoor);case 8:case"end":return e.stop()}}),e,this)}))),function(e,t,n,a){return i.apply(this,arguments)})},{key:"_getBoundingBox",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:500,i=t/111e3,n=t/(111320*Math.cos(e.lat*Math.PI/180));return{minLat:e.lat-i,maxLat:e.lat+i,minLng:e.lng-n,maxLng:e.lng+n}}},{key:"openIndoor",value:function(e){console.log("params --\x3e ",e);var t=e.mpoi,i=void 0===t?"":t,n=e.floor,a=void 0===n?0:n,r=e.floorList,o=void 0===r?[]:r,s=e.buildingCenter,l=void 0===s?{}:s;this.mpoi=i,this.floor=a,this.floorList=o,this.buildingCenter=l,this.materialNeedsUpdate=!0}},{key:"closeIndoor",value:function(){this.mpoi="close",this.floor="",this.materialNeedsUpdate=!0}},{key:"convertFloorString",value:function(e){if(e.startsWith("B"))return-parseInt(e.substring(1),10);if(e.startsWith("F"))return parseInt(e.substring(1),10);throw new Error("Invalid floor string")}},{key:"convertFloorStringToArray",value:function(e){return e.split("|").map((function(e){if(e.startsWith("B"))return-parseInt(e.substring(1),10);if(e.startsWith("F"))return parseInt(e.substring(1),10);throw new Error("Invalid floor string")}))}},{key:"hideBuildings",value:function(e){if(Array.isArray(e)){if((e=Je(e)).sort((function(e,t){return e-t})),e.length===this.floorList.length)this.floor=999;else{var t=this.floorList.filter((function(t){return!e.includes(t)}));this.floor=t[t.length-1]}this.eventName="Hide",this.floorNum=e,this.animateNeedsUpdate=!0}else console.error("hideBuildings numbers必须为数组")}},{key:"showBuildings",value:function(e){Array.isArray(e)?((e=Je(e)).sort((function(e,t){return e-t})),this.eventName="Show",this.floorNum=e,this.floor=e[e.length-1],this.animateNeedsUpdate=!0):console.error("showBuildings numbers必须为数组")}},{key:"toJSON",value:function(){return{Url:this.url,Mpoi:this.mpoi,Floor:this.floor,LayeringHeight:this.layeringHeight,LayeringBaseHeight:this.layeringBaseHeight,BuildingCenter:this.buildingCenter,FloorNum:this.floorNum,FloorList:this.floorList,EventName:this.eventName,Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,messageNeedsUpdate:this.messageNeedsUpdate,animateNeedsUpdate:this.animateNeedsUpdate,type:this.type,uuid:this.uuid}}}]);var i,n}(),Ki=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};U(this,e),t=N(this,e,[i]);var n=["Video","Picture"],a=void 0===i.cityList?[]:i.cityList,r=void 0===i.event?"":i.event,o=void 0===i.folderName?"RenderResult":i.folderName,s=void 0===i.renderMode?"Video":i.renderMode,l=void 0===i.sceneBrightness?7:i.sceneBrightness,u=void 0===i.operateData?[]:i.operateData,c=void 0===i.brightness?0:i.brightness,d=void 0===i.renderFrame?60:i.renderFrame;return Object.defineProperties(t,{renderMode:{configurable:!0,enumerable:!0,get:function(){return s},set:function(e){e&&(s=n.includes(e)?e:"Video")}},renderFrame:{configurable:!0,enumerable:!0,get:function(){return d},set:function(e){e&&(d=e)}},sceneBrightness:{configurable:!0,enumerable:!0,get:function(){return l},set:function(e){e&&(l=e)}},operateData:{configurable:!0,enumerable:!0,get:function(){return u},set:function(e){e&&(u=e)}},brightness:{configurable:!0,enumerable:!0,get:function(){return c},set:function(e){void 0!==e&&(c=e)}},cityList:{configurable:!0,enumerable:!0,get:function(){return a},set:function(e){e&&(a=e)}},event:{configurable:!0,enumerable:!0,get:function(){return r},set:function(e){e&&(r=e,t.materialNeedsUpdate=!0)}},folderName:{configurable:!0,enumerable:!0,get:function(){return o},set:function(e){e&&(o=e)}}}),t}return z(e,vt),C(e,[{key:"changeRenderMode",value:function(e){this.renderMode=e}},{key:"changeRenderFrame",value:function(e){this.renderFrame=e,this.event="ChangeRenderFrame"}},{key:"changeCityColor",value:function(e){this.cityList=e,this.event="ColorChange"}},{key:"changeHeatmapCoefficient",value:function(e,t){this.cityList=e,this.operateData=[t],this.event="CoefficientChange"}},{key:"changeSceneBrightness",value:function(e){this.sceneBrightness=e,this.event="changeSceneBrightness"}},{key:"changeBrightness",value:function(e){this.brightness=e,this.event="changeBrightness"}},{key:"renderResult",value:function(e,t){this.folderName=t,this.cityList=e,this.event="Render"}},{key:"visAll",value:function(){this.operateData=[],this.event="VisAll"}},{key:"previewAll",value:function(){this.operateData=[],this.event="Preview"}},{key:"previewSingleCity",value:function(e,t){this.cityList=e;var i=this.cityList.map((function(e){return e.CityName})),n=i.indexOf(t);-1!==n?n!==i.length-1?(this.operateData=[t,i[n+1]],this.event="Preview"):console.warn("非法参数,最后一个城市不能预览"):console.warn("没有该城市数据")}},{key:"focusCity",value:function(e){this.operateData=[e],this.event="Focus"}},{key:"toJSON",value:function(){return(!(arguments.length>0&&void 0!==arguments[0])||arguments[0])&&this.visibleNeedsUpdate&&!this.materialNeedsUpdate?{matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,type:this.type,name:this.name,uuid:this.uuid}:{Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Brightness:this.brightness,SceneBrightness:this.sceneBrightness,Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},OperateData:this.operateData,FolderName:this.folderName,RenderFrame:this.renderFrame,RenderMode:this.renderMode,CityList:this.cityList,Opacity:this.opacity,Event:this.event,type:this.type,uuid:this.uuid,matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible}}},{key:"copy",value:function(t){var i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return F(e,"copy",this)([t,i]),this}}])}(),Xi=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return U(this,e),(t=N(this,e,[i])).roadGeoJsonUrl=i.roadGeoJsonUrl,t.roadConditionUrl=i.roadConditionUrl,t.type="EarthRoadCondition",t}return z(e,Ki),C(e,[{key:"toJSON",value:function(){return(!(arguments.length>0&&void 0!==arguments[0])||arguments[0])&&this.visibleNeedsUpdate&&!this.materialNeedsUpdate?{matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,type:this.type,name:this.name,uuid:this.uuid}:{Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},RoadConditionUrl:this.roadConditionUrl,RenderFrame:this.renderFrame,RenderMode:this.renderMode,RoadGeoJsonUrl:this.roadGeoJsonUrl,FolderName:this.folderName,CityList:this.cityList,Event:this.event,type:this.type,uuid:this.uuid,matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible}}},{key:"copy",value:function(t){var i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return F(e,"copy",this)([t,i]),this}}])}(),Qi=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return U(this,e),(t=N(this,e,[i])).type="EarthCityRank",t}return z(e,Ki),C(e,[{key:"changeRenderFrame",value:function(e){this.renderFrame=e,this.event="ChangeRenderFrame"}},{key:"changeCityColor",value:function(e){this.cityList=e,this.event="ColorChange"}},{key:"renderResult",value:function(e,t){this.folderName=t,this.cityList=e,this.event="Render"}},{key:"visAll",value:function(){this.operateData=[],this.event="VisAll"}},{key:"previewAll",value:function(){this.operateData=[],this.event="Preview"}},{key:"previewSingleCity",value:function(e,t){this.cityList=e;var i=this.cityList.map((function(e){return e.CityName})),n=i.indexOf(t);-1!==n?n!==i.length-1?(this.operateData=[t,i[n+1]],this.event="Preview"):console.warn("非法参数,最后一个城市不能预览"):console.warn("没有该城市数据")}},{key:"focusCity",value:function(e){this.operateData=[e],this.event="Focus"}},{key:"toJSON",value:function(){return(!(arguments.length>0&&void 0!==arguments[0])||arguments[0])&&this.visibleNeedsUpdate&&!this.materialNeedsUpdate?{matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,type:this.type,name:this.name,uuid:this.uuid}:{Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},OperateData:this.operateData,FolderName:this.folderName,RenderFrame:this.renderFrame,RenderMode:this.renderMode,CityList:this.cityList,Opacity:this.opacity,Event:this.event,type:this.type,uuid:this.uuid,matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible}}},{key:"copy",value:function(t){var i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return F(e,"copy",this)([t,i]),this}}])}(),Zi=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return U(this,e),(t=N(this,e,[i])).type="EarthCityHeatMap",t}return z(e,Ki),C(e,[{key:"toJSON",value:function(){return(!(arguments.length>0&&void 0!==arguments[0])||arguments[0])&&this.visibleNeedsUpdate&&!this.materialNeedsUpdate?{matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,type:this.type,name:this.name,uuid:this.uuid}:{Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Brightness:this.brightness,SceneBrightness:this.sceneBrightness,Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},OperateData:this.operateData,FolderName:this.folderName,RenderFrame:this.renderFrame,RenderMode:this.renderMode,CityList:this.cityList,Opacity:this.opacity,Event:this.event,type:this.type,uuid:this.uuid,matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible}}},{key:"copy",value:function(t){var i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return F(e,"copy",this)([t,i]),this}}])}(),$i=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};U(this,e),t=N(this,e,[i]);var n=void 0===i.roadList?[]:i.roadList,a=void 0===i.cityCompareList?[]:i.cityCompareList;return t.roadURL=i.roadURL,Object.defineProperties(t,{roadList:{configurable:!0,enumerable:!0,get:function(){return n},set:function(e){e&&(n=e)}},cityCompareList:{configurable:!0,enumerable:!0,get:function(){return a},set:function(e){e&&(a=e)}}}),t.type="EarthPersonLine",t}return z(e,Ki),C(e,[{key:"changeRenderFrame",value:function(e){this.renderFrame=e,this.event="ChangeRenderFrame"}},{key:"changeColor",value:function(e){this.color=e,this.event="ColorChange"}},{key:"renderResult",value:function(e){this.folderName=e,this.event="Render"}},{key:"previewAll",value:function(){this.event="Preview"}},{key:"toJSON",value:function(){return(!(arguments.length>0&&void 0!==arguments[0])||arguments[0])&&this.visibleNeedsUpdate&&!this.materialNeedsUpdate?{matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,type:this.type,name:this.name,uuid:this.uuid}:{Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Color:{r:this.color.r,g:this.color.g,b:this.color.b,a:this.opacity},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},RoadList:this.roadList,RoadURL:this.roadURL,CityCompareList:this.cityCompareList,FolderName:this.folderName,Texture:this.texture,RenderFrame:this.renderFrame,RenderMode:this.renderMode,Event:this.event,type:this.type,uuid:this.uuid,matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible}}},{key:"copy",value:function(t){var i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return F(e,"copy",this)([t,i]),this}}])}(),en=function(){return C((function e(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};U(this,e),this.cloudRender=t,this.enable=void 0!==i.enable&&i.enable,this.workDistance=void 0===i.workDistance?50:i.workDistance,this.init()}),[{key:"changeEnable",value:function(e){this.enable=e,this.cloudRender.emitUIInteraction({excuteName:"Application_enableFadeMode",params:{Enable:this.enable}})}},{key:"changeWorkDistance",value:function(e){this.workDistance=e,this.cloudRender.emitUIInteraction({excuteName:"Application_enableFadeMode",params:{WorkDistance:this.workDistance}})}},{key:"init",value:function(){this.changeEnable(this.enable),this.changeWorkDistance(this.workDistance)}}])}(),tn=function(){return C((function e(t){U(this,e),this.cloudRender=t}),[{key:"switchLevel",value:function(e){""!==e&&void 0!==e||console.warn("LevelManage.switchLevel: levelName is required"),this.cloudRender.emitUIInteraction({excuteName:Z.OPEN_LEVEL,params:{LevelName:e}})}},{key:"restartLevel",value:function(){this.cloudRender.emitUIInteraction({excuteName:Z.RESTART_LEVEL}),this.cloudRender.dispatchEvent({type:"levelRecovered"})}},{key:"restartGame",value:function(){this.cloudRender.emitUIInteraction({excuteName:Z.RESTART_GAME}),this.cloudRender.dispatchEvent({type:"gameResarted"})}},{key:"exit",value:function(){this.cloudRender.emitUIInteraction({excuteName:Z.EXIT_CLIENT})}}])}(),nn=function(){function e(i){var n;if(U(this,e),e._instance)return L(n,e._instance);(n=N(this,e,[i])).type="RoadPile",n.url=i.url,n.header=i.header,n.body=i.body,n.messageNeedsUpdate=!1,n.childNeedsUpdate=!1;var a=Math.max(1,i.updateInterval||2),r=void 0===i.searchMode?"coord":i.searchMode,o=void 0===i.tileLevel?16:i.tileLevel,s=void 0===i.renderScale?1:i.renderScale;return n.maxUpdateHeight=void 0===i.maxUpdateHeight?1e3:i.maxUpdateHeight,n.materialNeedsUpdate=!1,n.matrixNeedsUpdate=!1,n.offset=new t,Object.defineProperties(n,{renderScale:{configurable:!0,enumerable:!0,get:function(){return s},set:function(e){e&&(s=Math.max(e,.1),n.messageNeedsUpdate=!0)}},updateInterval:{configurable:!0,enumerable:!0,get:function(){return a},set:function(e){e&&(a=Math.max(e,2),n.messageNeedsUpdate=!0)}},searchMode:{configurable:!0,enumerable:!0,get:function(){return r},set:function(e){e&&(r=e,n.messageNeedsUpdate=!0)}},tileLevel:{configurable:!0,enumerable:!0,get:function(){return o},set:function(e){e&&(o=e,n.messageNeedsUpdate=!0)}}}),e._instance=n,n}return z(e,je),C(e,[{key:"visible",get:function(){return this._visible},set:function(e){void 0===this._visible&&(this._visible=!0),e!==this._visible&&(this.visibleNeedsUpdate=!0,this._visible=e&&!0)}},{key:"body",get:function(){return this._body},set:function(e){this.messageNeedsUpdate=!0,this._body=e}},{key:"toJSON",value:function(){return{Url:this.url,Body:this.body,Header:this.header,SearchMode:this.searchMode,TileLevel:this.tileLevel,RenderScale:this.renderScale,matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,messageNeedsUpdate:this.messageNeedsUpdate,visible:this.visible,type:this.type,uuid:this.uuid,UpdateInterval:this.updateInterval}}}],[{key:"getInstance",value:function(t){return e._instance||(e._instance=new e(t)),e._instance}}])}();R(nn,"_instance",null);var an=function(){function e(t){var i;if(U(this,e),e._instance)return L(i,e._instance);(i=N(this,e,[t])).type="RoadDataManager",i.messageNeedsUpdate=!1,i.childNeedsUpdate=!1;var n=void 0===t.poiRenderScale?1:t.poiRenderScale,a=void 0===t.roadnameRenderScale?1:t.roadnameRenderScale,r=t.hiddenList||[];return i.materialNeedsUpdate=!1,i.matrixNeedsUpdate=!1,Object.defineProperties(i,{poiRenderScale:{configurable:!0,enumerable:!0,get:function(){return n},set:function(e){e&&(n=Math.max(e,.1),i.messageNeedsUpdate=!0)}},roadnameRenderScale:{configurable:!0,enumerable:!0,get:function(){return a},set:function(e){e&&(a=Math.max(e,.1),i.messageNeedsUpdate=!0)}},hiddenList:{configurable:!0,enumerable:!0,get:function(){return r},set:function(e){e&&(r=e,i.messageNeedsUpdate=!0)}}}),e._instance=i,i}return z(e,je),C(e,[{key:"visible",get:function(){return this._visible},set:function(e){void 0===this._visible&&(this._visible=!0),e!==this._visible&&(this.visibleNeedsUpdate=!0,this._visible=e&&!0)}},{key:"body",get:function(){return this._body},set:function(e){this.messageNeedsUpdate=!0,this._body=e}},{key:"toJSON",value:function(){return{PoiRenderScale:this.poiRenderScale,RoadnameRenderScale:this.roadnameRenderScale,matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,messageNeedsUpdate:this.messageNeedsUpdate,HiddenList:this.hiddenList,visible:this.visible,type:this.type,uuid:this.uuid}}}],[{key:"getInstance",value:function(t){return e._instance||(e._instance=new e(t)),e._instance}}])}();R(an,"_instance",null);var rn=function(){return C((function e(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};U(this,e),this.cloudRender=t,this.rayDetectionDistance=i.rayDetectionDistance||5e5,this.url=i.url||"",this.enableUI=void 0===i.enableUI||i.enableUI,i.onSelected&&this.cloudRender.addEventListener("L2Selected",i.onSelected),this.enable=i.enable,i.enable&&this.enablePickup()}),[{key:"enablePickup",value:function(){this.enable=!0,this.cloudRender.emitUIInteraction({excuteName:K.ENABLE_L2_BUILDING_SELECT,params:{Url:this.url,RayDetectionDistance:this.rayDetectionDistance,Enable:this.enable,EnableUI:this.enableUI}})}},{key:"disablePickup",value:function(){this.enable=!1,this.cloudRender.emitUIInteraction({excuteName:K.ENABLE_L2_BUILDING_SELECT,params:{Enable:this.enable}})}}])}(),on=function(){function e(){var i,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};U(this,e),(i=N(this,e,[n])).type="PersonlLine";var a=void 0===n.linePoints?[]:n.linePoints;if(a.length%3!=0)throw new Error("PersonLine: linePoints 的长度必须是 3 的倍数(每3个为一组[经度, 纬度, 高度])");var r=void 0===n.useSpeed||n.useSpeed,o=void 0===n.duration?5:n.duration,s=void 0===n.speed?10:n.speed,l=void 0===n.loopMode?0:n.loopMode,u=void 0===n.traceToGround||n.traceToGround,c=void 0===n.traceLength?20:n.traceLength,d=void 0!==n.startPaused&&Boolean(n.startPaused),h=d?0:1;return i.messageNeedsUpdate=!1,i.materialNeedsUpdate=!1,i.matrixNeedsUpdate=!1,i.animateNeedsUpdate=!1,i.offset=new t,Object.defineProperties(i,{linePoints:{configurable:!0,enumerable:!0,get:function(){return a}},useSpeed:{configurable:!0,enumerable:!0,get:function(){return r}},duration:{configurable:!0,enumerable:!0,get:function(){return o}},speed:{configurable:!0,enumerable:!0,get:function(){return s}},loopMode:{configurable:!0,enumerable:!0,get:function(){return l}},traceToGround:{configurable:!0,enumerable:!0,get:function(){return u}},traceLength:{configurable:!0,enumerable:!0,get:function(){return c}},startPaused:{configurable:!0,enumerable:!0,get:function(){return d}},state:{configurable:!0,enumerable:!0,get:function(){return h},set:function(e){void 0!==e&&e!==h&&(h=e,i.matrixNeedsUpdate=!0)}}}),"function"==typeof n.onNavigationStart&&i.addEventListener("navigationStart",n.onNavigationStart),"function"==typeof n.onNavigationFinish&&i.addEventListener("navigationFinish",n.onNavigationFinish),i}return z(e,je),C(e,[{key:"pause",value:function(){var e=this.state;this.state=0,0===e&&(this.matrixNeedsUpdate=!0)}},{key:"resume",value:function(){this.state=1}},{key:"visible",get:function(){return this._visible},set:function(e){void 0===this._visible&&(this._visible=!0),e!==this._visible&&(this.visibleNeedsUpdate=!0,this._visible=e&&!0)}},{key:"toJSON",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return{UseSpeed:this.useSpeed,Duration:this.duration,Speed:this.speed,LoopMode:this.loopMode,TraceToGround:this.traceToGround,TraceLength:this.traceLength,StartPaused:this.startPaused,state:this.state,matrixNeedsUpdate:!!e&&this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,animateNeedsUpdate:this.animateNeedsUpdate,visible:this.visible,type:this.type,uuid:this.uuid,LinePoints:this.linePoints}}},{key:"dispose",value:function(){}}])}();function sn(e){if(null!=e&&(!Array.isArray(e)||e.length%2!=0||e.length<6))throw new Error("WSTrafficLayer: area 必须是[经度, 纬度, ...]的一维数组,且至少包含 3 个点(长度为偶数且不少于 6)")}var ln=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};U(this,e),(t=N(this,e,[i])).type="WSTraffic",t.url=i.url,t.traceToGround=void 0===i.traceToGround||i.traceToGround,t.traceLength=void 0===i.traceLength?10:i.traceLength;var n=void 0===i.message?{}:i.message,a="";sn(i.area);var r=void 0===i.area?[]:i.area;return t.messageNeedsUpdate=!1,t.materialNeedsUpdate=!1,t.matrixNeedsUpdate=!1,t.animateNeedsUpdate=!1,Object.defineProperties(t,{message:{configurable:!0,enumerable:!0,get:function(){return n},set:function(e){e&&(n=e,t.messageNeedsUpdate=!0)}},area:{configurable:!0,enumerable:!0,get:function(){return r},set:function(e){void 0!==e&&(sn(e),r=e)}},connectState:{configurable:!0,enumerable:!0,get:function(){return a}},_setConnectState:{configurable:!1,enumerable:!1,value:function(e){a=e,t.matrixNeedsUpdate=!0}}}),t}return z(e,je),C(e,[{key:"visible",get:function(){return this._visible},set:function(e){void 0===this._visible&&(this._visible=!0),e!==this._visible&&(this.visibleNeedsUpdate=!0,this._visible=e&&!0)}},{key:"disconnect",value:function(){this._setConnectState("disconnect")}},{key:"reconnect",value:function(){this._setConnectState("reconnect")}},{key:"toJSON",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return{Url:this.url,Message:this.message,Area:this.area,ConnectState:this.connectState,TraceToGround:this.traceToGround,TraceLength:this.traceLength,matrixNeedsUpdate:!!e&&this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,animateNeedsUpdate:this.animateNeedsUpdate,messageNeedsUpdate:!!e&&this.messageNeedsUpdate,visible:this.visible,type:this.type,uuid:this.uuid}}},{key:"dispose",value:function(){this.message=null}}])}(),un=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};U(this,e),(t=N(this,e,[i])).type="TJInfoLight";var n=i.url,a=void 0===i.scale?.4:i.scale,r=void 0===i.crossId?"":i.crossId,o="";return t.messageNeedsUpdate=!1,t.materialNeedsUpdate=!1,t.matrixNeedsUpdate=!1,t.animateNeedsUpdate=!1,Object.defineProperties(t,{url:{configurable:!0,enumerable:!0,get:function(){return n}},scale:{configurable:!0,enumerable:!0,get:function(){return a}},crossId:{configurable:!0,enumerable:!0,get:function(){return r},set:function(e){void 0!==e&&(r=e,t.messageNeedsUpdate=!0)}},connectState:{configurable:!0,enumerable:!0,get:function(){return o},set:function(e){void 0!==e&&(o=e,t.matrixNeedsUpdate=!0)}}}),t}return z(e,je),C(e,[{key:"visible",get:function(){return this._visible},set:function(e){void 0===this._visible&&(this._visible=!0),e!==this._visible&&(this.visibleNeedsUpdate=!0,this._visible=e&&!0)}},{key:"showCross",value:function(e){this.crossId=e}},{key:"disconnect",value:function(){this.connectState="disconnect"}},{key:"reconnect",value:function(){this.connectState="reconnect"}},{key:"toJSON",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t={Url:this.url,crossId:this.crossId,ConnectState:this.connectState,Scale:this.scale,matrixNeedsUpdate:!!e&&this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,animateNeedsUpdate:this.animateNeedsUpdate,visible:this.visible,type:this.type,uuid:this.uuid};return e&&(t.messageNeedsUpdate=this.messageNeedsUpdate),t}},{key:"dispose",value:function(){}}])}();export{en as AdvancedFade,vi as AssetLayer,zi as AutonomousVehicleLayer,Kt as BasicLabel,Ui as Bucket,rn as BuildingPickup,Ri as CarPark,oi as Circle,Ft as CloudRenderEngine,Fi as ClusterPoint,pe as CommonConstant,Xt as Cone,mi as ConstructionLayer,St as Cube,ei as Cylinder,ti as Decal,Si as Diamond,ui as DiamondSign,wt as ExplodeControl,Qt as FlashCar,Zt as FlashCarCrash,$t as FlashPeople,ci as Heatmap,gi as I3DTileLayer,Jt as IconPoint,Yi as IndoorMap,Hi as InfoLightLayer,ki as Inundation,Nt as L3ModelControl,Ji as LargeRoadCondition,_i as LayerBuilding,tn as LevelManage,Vi as Light,bt as Line,Mi as MockCarStream,Ot as ModelSlice,Gt as ODLine,hi as Particle,on as PersonLine,ii as Plane,xt as Point,yt as Polygon,ni as QuadPyramid,Ii as QuadPyramidTop,yi as Radar,bi as Ripple,pi as RoadCondition,an as RoadDataManager,Ei as RoadName,nn as RoadPile,Gi as RoutePlan,Zi as SequencerEarthCityHeatmap,Qi as SequencerEarthCityRank,$i as SequencerEarthPersonLine,Xi as SequencerEarthRoadCondition,vt as Shape,Ut as SkeletonAnimControl,Ci as Skyline,Di as SlopeAnalysis,xi as Soil,ai as Sphere,un as TJInfoLightLayer,qt as TextPoint,Ht as TextUtils,si as Torus,ri as TrafficCone,fi as TrafficLayer,Oi as TrafficLightLayer,wi as TrafficShape,Ni as TriangleWarning,li as Tube,me as UltralDynamicSky,qi as VersionInfo,Ti as VisualField,ln as WSTrafficLayer,kt as WaterSimulation,Ai as WebViewPoint,st as convertCanvas2Base64,ht as drawCanvas,gt as drawTextToImage,ot as loadImageAsBase64};
1
+ import{Vector2 as e,Vector3 as t,Quaternion as i,Matrix4 as n,MathUtils as a,Euler as r,Matrix3 as o,Layers as s,FileLoader as l,Color as u,Group as c,MeshBasicMaterial as d,PlaneBufferGeometry as h,Mesh as f,SpriteMaterial as p,Sprite as m}from"three";import g from"earcut";import*as v from"@tweenjs/tween.js";import y from"axios";import b from"@mars3d/heatmap.js";function x(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=Array(t);i<t;i++)n[i]=e[i];return n}function S(e,t,i,n,a,r,o){try{var s=e[r](o),l=s.value}catch(e){return void i(e)}s.done?t(l):Promise.resolve(l).then(n,a)}function w(e){return function(){var t=this,i=arguments;return new Promise((function(n,a){var r=e.apply(t,i);function o(e){S(r,n,a,o,s,"next",e)}function s(e){S(r,n,a,o,s,"throw",e)}o(void 0)}))}}function N(e,t,i){return t=E(t),L(e,I()?Reflect.construct(t,i||[],E(e).constructor):t.apply(e,i))}function U(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function k(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,H(n.key),n)}}function C(e,t,i){return t&&k(e.prototype,t),i&&k(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e}function T(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!i){if(Array.isArray(e)||(i=V(e))||t){i&&(e=i);var n=0,a=function(){};return{s:a,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,o=!0,s=!1;return{s:function(){i=i.call(e)},n:function(){var e=i.next();return o=e.done,e},e:function(e){s=!0,r=e},f:function(){try{o||null==i.return||i.return()}finally{if(s)throw r}}}}function R(e,t,i){return(t=H(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function O(){return O="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,i){var n=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=E(e)););return e}(e,t);if(n){var a=Object.getOwnPropertyDescriptor(n,t);return a.get?a.get.call(arguments.length<3?e:i):a.value}},O.apply(null,arguments)}function E(e){return E=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},E(e)}function z(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&P(e,t)}function I(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(I=function(){return!!e})()}function A(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function _(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?A(Object(i),!0).forEach((function(t){R(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):A(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function M(e,t){if(null==e)return{};var i,n,a=function(e,t){if(null==e)return{};var i={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;i[n]=e[n]}return i}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(n=0;n<r.length;n++)i=r[n],t.includes(i)||{}.propertyIsEnumerable.call(e,i)&&(a[i]=e[i])}return a}function L(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function D(){D=function(){return t};var e,t={},i=Object.prototype,n=i.hasOwnProperty,a=Object.defineProperty||function(e,t,i){e[t]=i.value},r="function"==typeof Symbol?Symbol:{},o=r.iterator||"@@iterator",s=r.asyncIterator||"@@asyncIterator",l=r.toStringTag||"@@toStringTag";function u(e,t,i){return Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(e){u=function(e,t,i){return e[t]=i}}function c(e,t,i,n){var r=t&&t.prototype instanceof v?t:v,o=Object.create(r.prototype),s=new E(n||[]);return a(o,"_invoke",{value:C(e,i,s)}),o}function d(e,t,i){try{return{type:"normal",arg:e.call(t,i)}}catch(e){return{type:"throw",arg:e}}}t.wrap=c;var h="suspendedStart",f="suspendedYield",p="executing",m="completed",g={};function v(){}function y(){}function b(){}var x={};u(x,o,(function(){return this}));var S=Object.getPrototypeOf,w=S&&S(S(z([])));w&&w!==i&&n.call(w,o)&&(x=w);var N=b.prototype=v.prototype=Object.create(x);function U(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function k(e,t){function i(a,r,o,s){var l=d(e[a],e,r);if("throw"!==l.type){var u=l.arg,c=u.value;return c&&"object"==typeof c&&n.call(c,"__await")?t.resolve(c.__await).then((function(e){i("next",e,o,s)}),(function(e){i("throw",e,o,s)})):t.resolve(c).then((function(e){u.value=e,o(u)}),(function(e){return i("throw",e,o,s)}))}s(l.arg)}var r;a(this,"_invoke",{value:function(e,n){function a(){return new t((function(t,a){i(e,n,t,a)}))}return r=r?r.then(a,a):a()}})}function C(t,i,n){var a=h;return function(r,o){if(a===p)throw Error("Generator is already running");if(a===m){if("throw"===r)throw o;return{value:e,done:!0}}for(n.method=r,n.arg=o;;){var s=n.delegate;if(s){var l=T(s,n);if(l){if(l===g)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(a===h)throw a=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);a=p;var u=d(t,i,n);if("normal"===u.type){if(a=n.done?m:f,u.arg===g)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(a=m,n.method="throw",n.arg=u.arg)}}}function T(t,i){var n=i.method,a=t.iterator[n];if(a===e)return i.delegate=null,"throw"===n&&t.iterator.return&&(i.method="return",i.arg=e,T(t,i),"throw"===i.method)||"return"!==n&&(i.method="throw",i.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var r=d(a,t.iterator,i.arg);if("throw"===r.type)return i.method="throw",i.arg=r.arg,i.delegate=null,g;var o=r.arg;return o?o.done?(i[t.resultName]=o.value,i.next=t.nextLoc,"return"!==i.method&&(i.method="next",i.arg=e),i.delegate=null,g):o:(i.method="throw",i.arg=new TypeError("iterator result is not an object"),i.delegate=null,g)}function R(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function E(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(R,this),this.reset(!0)}function z(t){if(t||""===t){var i=t[o];if(i)return i.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var a=-1,r=function i(){for(;++a<t.length;)if(n.call(t,a))return i.value=t[a],i.done=!1,i;return i.value=e,i.done=!0,i};return r.next=r}}throw new TypeError(typeof t+" is not iterable")}return y.prototype=b,a(N,"constructor",{value:b,configurable:!0}),a(b,"constructor",{value:y,configurable:!0}),y.displayName=u(b,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===y||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,u(e,l,"GeneratorFunction")),e.prototype=Object.create(N),e},t.awrap=function(e){return{__await:e}},U(k.prototype),u(k.prototype,s,(function(){return this})),t.AsyncIterator=k,t.async=function(e,i,n,a,r){void 0===r&&(r=Promise);var o=new k(c(e,i,n,a),r);return t.isGeneratorFunction(i)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},U(N),u(N,l,"Generator"),u(N,o,(function(){return this})),u(N,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),i=[];for(var n in t)i.push(n);return i.reverse(),function e(){for(;i.length;){var n=i.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=z,E.prototype={constructor:E,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(O),!t)for(var i in this)"t"===i.charAt(0)&&n.call(this,i)&&!isNaN(+i.slice(1))&&(this[i]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var i=this;function a(n,a){return s.type="throw",s.arg=t,i.next=n,a&&(i.method="next",i.arg=e),!!a}for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r],s=o.completion;if("root"===o.tryLoc)return a("end");if(o.tryLoc<=this.prev){var l=n.call(o,"catchLoc"),u=n.call(o,"finallyLoc");if(l&&u){if(this.prev<o.catchLoc)return a(o.catchLoc,!0);if(this.prev<o.finallyLoc)return a(o.finallyLoc)}else if(l){if(this.prev<o.catchLoc)return a(o.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return a(o.finallyLoc)}}}},abrupt:function(e,t){for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i];if(a.tryLoc<=this.prev&&n.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var r=a;break}}r&&("break"===e||"continue"===e)&&r.tryLoc<=t&&t<=r.finallyLoc&&(r=null);var o=r?r.completion:{};return o.type=e,o.arg=t,r?(this.method="next",this.next=r.finallyLoc,g):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),g},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var i=this.tryEntries[t];if(i.finallyLoc===e)return this.complete(i.completion,i.afterLoc),O(i),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var i=this.tryEntries[t];if(i.tryLoc===e){var n=i.completion;if("throw"===n.type){var a=n.arg;O(i)}return a}}throw Error("illegal catch attempt")},delegateYield:function(t,i,n){return this.delegate={iterator:z(t),resultName:i,nextLoc:n},"next"===this.method&&(this.arg=e),g}},t}function P(e,t){return P=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},P(e,t)}function B(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var n,a,r,o,s=[],l=!0,u=!1;try{if(r=(i=i.call(e)).next,0===t){if(Object(i)!==i)return;l=!1}else for(;!(l=(n=r.call(i)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(e){u=!0,a=e}finally{try{if(!l&&null!=i.return&&(o=i.return(),Object(o)!==o))return}finally{if(u)throw a}}return s}}(e,t)||V(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function F(e,t,i,n){var a=O(E(e.prototype),t,i);return"function"==typeof a?function(e){return a.apply(i,e)}:a}function W(e){return function(e){if(Array.isArray(e))return x(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||V(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function H(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}function G(e){return G="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},G(e)}function V(e,t){if(e){if("string"==typeof e)return x(e,t);var i={}.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?x(e,t):void 0}}var J={CLEAR_SKIES:"clearSkies",PARTLY_CLOUDY:"partlyCloudy",CLOUDY:"cloudy",FOGGY:"foggy",OVERCAST:"overcast",RAIN:"rain",LIGHT_RAIN:"lightRain",THUNDER_STORM:"thunderstorm",SNOW:"snow",LIGHT_SNOW:"lightSnow",BLIZZARD:"blizzard",SAND_DUST_CALM:"sandDustCalm",SAND_DUST_STORM:"sandDustStorm"},q={VOLUMETRIC_CLOUDS:"Volumetric Clouds",STATIC_CLOUDS:"Static Clouds",DYNAMIC_CLOUDS:"2D Dynamic Clouds",NO_CLOUDS:"No Clouds",VOLUMETRIC_AURORA:"Volumetric Aurora"},Y={SKY_ATMOSPHERE:"Sky Atmosphere",SIMPLIFIED_COLOR:"Simplified Color"},K={SET_MOUSE_CURSOR_SHOW:"setMouseCursorShow",SET_CLICK_EVENT:"setClickEvent",SET_EDIT_STATUS:"setEditStatus",SWITCH_EDIT_MODE:"switchEditMode",SAVE_EDIT_RESULT:"saveEditResult",ZOOM_IN:"zoomIn",ZOOM_OUT:"zoomOut",EXIT:"exitClient",ENABLE_TERRAIN:"enableTerrain",ENABLE_POI:"enablePOIByTag",PRELOAD_LOCATION:"preLoadLocation",FOCUS_ACTOR_BY_ID:"focusActorByID",ENABLE_DATALAYER:"Scene_enableDataLayerByName",ENABLE_FPS:"Scene_setFPS",OBJECT_BOUNDINGBOX:"Interact_objectBoundingBox",ASSET_MODEL:"Gis_generateAssetModel",BUILD_GROWTHANIMATE:"Interact_buildGrowth",ENABLE_L2_BUILDING_SELECT:"Interact_enableBuildingL2Select"},X={NAVIGATION:"Camera_navigation",NAVIGATION_PAUSE:"Camera_navigationPause",NAVIGATION_STOP:"Camera_navigationStop",ORBIT_AROUND:"Camera_orbitAround",MOVE_TO:"Camera_moveTo",ZOOM_IN:"Camera_zoomIn",ZOOM_OUT:"Camera_zoomOut",PROJECT:"Camera_project",UNPROJECT:"Camera_unproject",UPDATE:"Camera_update",FOCUS_ON:"Camera_focusOn",Constrain_Shape:"Camera_constrainShape",MOVE:"Camera_move",ROTATE:"Camera_rotate",RESET_CAMERA_FOCUS:"Camera_resetCameraFocus"},Q={ENABLE_3DTILES_BY_NAME:"Scene_enableTilesByName",SWITCH_TERRAIN_MODE:"Scene_switchTerrainMode",HIDDEN_3DTILES_ITEM:"Scene_hiddenTilesItem",EVENT_LAYER_BUILDING:"Scene_eventLayerBuilding",UPDATA_SLOPE_ANALYSIS:"Scene_updateSlopeAnalysis",GET_ALTITUDE:"Scene_getAltitude",SET_PLANE_POI_MODE:"Scene_setPlanePoiMode"},Z={EXIT_CLIENT:"Application_exitClient",RESTART_LEVEL:"Application_restartLevel",OPEN_LEVEL:"Application_openLevel",RESTART_GAME:"Application_restartGame",CREATE_TRAFFIC_STREAM:"Application_createTrafficStream",CLOSE_TRAFFIC_STREAM:"Application_closeTrafficStream",FOLLOW_TRAFFIC_STREAM_ITEM:"Application_followTrafficStreamItem",ADD_EVENT_LISTENER:"Application_addEvent",REMOVE_EVENT_LISTENER:"Application_removeEvent",RESET_WORLD_CENTER:"Application_resetWorldCenter",CONSOLE_COMMAND:"Application_ConsoleCommand"},ee={ADD:"Gis_AddCommonGISLayer",REMOVE:"Gis_RemoveCommonGISLayer",DESTORY:"Gis_DestoryCommonGISLayer",DESTORY_ALL:"Gis_DestoryAllGenerationLayer",UPDATE:"Gis_UpdateCommonGISLayer",VISIBLE:"Gis_VisibleCommonGISLayer"},te={ENABLE_DRAW:"Gis_enableDraw",CLOSE_DRAW:"Gis_closeDraw",ENABLE_MEASURE:"Gis_enableMeasure",CLOSE_MEASURE:"Gis_closeMeasure",DESTORY_DRAW:"Gis_clearDraw",DESTORY_MEASURE:"Gis_clearMeasure"},ie={SOLID:"solid",DASHED:"dashed",ARROW:"arrow",GRADIENT:"gradient"},ne=R({CENTER:"Ground_Center",STAND:"Stand",SIDE:"Ground_Side"},"SIDE","Cylinder"),ae={LINEAR:"Linear",CURVE:"Curve",CONSTANT:"Constant"},re={QualityControlOwnership:0,Response:1,Command:2,FreezeFrame:3,UnfreezeFrame:4,VideoEncoderAvgQP:5,LatencyTest:6,InitialSettings:7,FileExtension:8,FileMimeType:9,FileContents:10,Mouse:21,Keyboard:22,InputControlOwnership:12,Protocol:255,AckV2:102,TextureMissingNack:103},oe={LockedMouse:0,HoveringMouse:1},se={controlScheme:oe.HoveringMouse,suppressBrowserKeys:!1,fakeMouseWithTouches:!1},le={IFrameRequest:0,RequestQualityControl:1,FpsRequest:2,AverageBitrateRequest:3,StartStreaming:4,StopStreaming:5,LatencyTest:6,RequestInitialSettings:7,UIInteraction:50,Command:51,KeyDown:60,KeyUp:61,KeyPress:62,MouseEnter:70,MouseLeave:71,MouseDown:72,MouseUp:73,MouseMove:74,MouseWheel:75,TouchStart:80,TouchEnd:81,TouchMove:82,GamepadButtonPressed:90,GamepadButtonReleased:91,GamepadAnalog:92,UIInteractionV2:100,BinaryAsset:101,AckV2:102,TextureMissingNack:103},ce={MainButton:0,AuxiliaryButton:1,SecondaryButton:2,FourthButton:3,FifthButton:4},de={PrimaryButton:1,SecondaryButton:2,AuxiliaryButton:4,FourthButton:8,FifthButton:16},he={BackSpace:8,Shift:16,Control:17,Alt:18,RightShift:253,RightControl:254,RightAlt:255},fe={FIRE_BIG:"P_Fire_Big",FIRE_SMALL:"P_Fire_Small",FIRE_FLAMETHROWER:"P_Flamethrower",SMOKE_SMALL_BLACK:"P_Smoke_A",SMOKE_BIG_BLACK:"P_Smoke_B",SMOKE_SMALL_YELLOW:"P_Smoke_C",SMOKE_BIG_YELLOW:"P_Smoke_D",SPARK_A:"P_Sparks_E",FOG_MASS:"P_Mass_Fog",NS_Spark:"NS_Spark",NS_Firefly:"NS_Firefly"},pe=Object.freeze({__proto__:null,ApplicationControl:Z,CameraControl:X,ControlSchemeType:oe,DrawAndMeasureControl:te,GisControl:ee,InteractMOD:K,LineDirectionOptions:ne,LineSplineTypeOptions:ae,LineTypeOptions:ie,MessageType:le,MouseButton:ce,MouseButtonsMask:de,ParticleKind:fe,SceneControl:Q,SkyColorMode:Y,SkyMode:q,SpecialKeyCodes:he,ToClientMessageType:re,UDS:J,WS_OPEN_STATE:1,inputOptions:se}),me=function(){return C((function e(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};U(this,e),this.cloudRender=t,this.weather=i.weather||J.PARTLY_CLOUDY,this.hour=i.hour||14,this.minute=i.minute||30,this.weatherType=J,this.init()}),[{key:"changeWeather",value:function(e){e&&(Object.values(J).indexOf(e)<0||(this.weather=e,this.cloudRender.emitUIInteraction({excuteName:"Scene_changeWeather",params:{WeatherType:e}})))}},{key:"changeTime",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;this.hour=e,this.minute=Math.floor(10*t/6);var i=(this.hour<10?"0"+this.hour:""+this.hour)+(this.minute<10?"0"+this.minute:""+this.minute);this.cloudRender.emitUIInteraction({excuteName:"Scene_changeTime",params:{Time:i}})}},{key:"setVolumeFog",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3,i=Math.max(Math.min(1e5,t),10);this.cloudRender.emitUIInteraction({excuteName:"Scene_setVolumenFog",params:{Enable:e,Distance:100*i}})}},{key:"setAtmosphericFog",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.0075,t=Math.max(Math.min(1,e),0);this.cloudRender.emitUIInteraction({excuteName:"Scene_setBaseFog",params:{BaseFogDensity:t}})}},{key:"setSkyMode",value:function(e){return!!e&&(!(Object.values(q).indexOf(e)<0)&&void this.cloudRender.emitUIInteraction({excuteName:"Scene_setSkyMode",params:{SkyMode:e}}))}},{key:"setSkyColorMode",value:function(e){return!!e&&(!(Object.values(Y).indexOf(e)<0)&&void this.cloudRender.emitUIInteraction({excuteName:"Scene_setSkyColorMode",params:{SkyColorMode:e}}))}},{key:"changeWeatherEffectParameters",value:function(e){this.cloudRender.emitUIInteraction({excuteName:"Scene_changeWeatherEffects",params:JSON.stringify(e)})}},{key:"init",value:function(){this.changeWeather(this.weather),this.changeTime(this.hour,this.minute)}}])}(),ge=["BMap","Sentinel2","NaturalEarth"],ve=function(){return C((function e(t){U(this,e),this.cloudRender=t,this.earthCloud={VisMode:"Auto"},this.earthRoadNetwork={VisMode:"Auto",Opacity:.2,Color:"rgb(255, 255, 255)",Brightness:6},this.earthTiles={TilesType:"BMap"}}),[{key:"_changeEnvironment",value:function(e,t,i){t?(this[i]=_(_({},this[i]),t),this.cloudRender&&this.cloudRender.emitUIInteraction({excuteName:"Scene_SeqEnvironment",params:{environment:e,properties:_({},this[i])}})):console.warn("".concat(e," params is required"))}},{key:"changeEarthCloud",value:function(e){this._changeEnvironment("EarthCloud",e,"earthCloud")}},{key:"changeEarthRoadNetwork",value:function(e){this._changeEnvironment("EarthRoadNetwork",e,"earthRoadNetwork")}},{key:"changeEarthTiles",value:function(e){e&&e.TilesType&&!ge.includes(e.TilesType)?console.warn("TilesType ".concat(e.TilesType," is not supported")):this._changeEnvironment("EarthTiles",e,"earthTiles")}}])}(),ye=function(e){e=void 0!==e?e:{},this.forceTURN=e.forceTURN;var t=this,i=new URLSearchParams(window.location.search);this.cfg=void 0!==e.peerConnectionOptions?e.peerConnectionOptions:{},this.cfg.sdpSemantics="unified-plan",this.cfg.offerExtmapAllowMixed=!1,i.has("ForceTURN")&&(this.forceTURN=i.has("ForceTURN")),this.forceTURN&&(console.log("Forcing TURN usage by setting ICE Transport Policy in peer connection config."),this.cfg.iceTransportPolicy="relay"),this.cfg.bundlePolicy="balanced",this.forceMaxBundle=i.has("ForceMaxBundle"),this.forceMaxBundle&&(this.cfg.bundlePolicy="max-bundle"),this.pcClient=null,this.dcClient=null,this.dcBulk=null,this.dcTexture=null,this.tnClient=null,this.enableBulkChannel=!0===e.enableBulkChannel,this.enableTextureChannel=!0===e.enableTextureChannel,this.sdpConstraints={offerToReceiveAudio:1,offerToReceiveVideo:1,voiceActivityDetection:!1},this.dataChannelOptions={ordered:!0,maxPacketLifeTime:3e3},this.bulkDataChannelOptions={ordered:!0},this.textureDataChannelOptions={ordered:!0},this.startVideoMuted=void 0!==e.startVideoMuted&&e.startVideoMuted,this.autoPlayAudio=void 0===e.autoPlayAudio||e.autoPlayAudio,this.useMic=i.has("useMic"),this.useMic||console.log("Microphone access is not enabled. Pass ?useMic in the url to enable it.");var n="localhost"===location.hostname||"127.0.0.1"===location.hostname,a="https:"===location.protocol;!this.useMic||n||a||(this.useMic=!1,console.error("Microphone access in the browser will not work if you are not on HTTPS or localhost. Disabling mic access."),console.error("For testing you can enable HTTP microphone access Chrome by visiting chrome://flags/ and enabling 'unsafely-treat-insecure-origin-as-secure'")),this.preferSFU=i.has("preferSFU"),console.log(this.preferSFU?"The browser will signal it would prefer an SFU connection. Remove ?preferSFU from the url to signal for P2P usage.":"The browser will signal for a P2P connection. Pass ?preferSFU in the url to signal for SFU usage."),this.latencyTestTimings={TestStartTimeMs:null,UEReceiptTimeMs:null,UEEncodeMs:null,UECaptureToSendMs:null,UETransmissionTimeMs:null,BrowserReceiptTimeMs:null,FrameDisplayDeltaTimeMs:null,Reset:function(){this.TestStartTimeMs=null,this.UEReceiptTimeMs=null,this.UEEncodeMs=null,this.UECaptureToSendMs=null,this.UETransmissionTimeMs=null,this.BrowserReceiptTimeMs=null,this.FrameDisplayDeltaTimeMs=null},SetUETimings:function(e){this.UEReceiptTimeMs=e.ReceiptTimeMs,this.UEEncodeMs=e.EncodeMs,this.UECaptureToSendMs=e.CaptureToSendMs,this.UETransmissionTimeMs=e.TransmissionTimeMs,this.BrowserReceiptTimeMs=Date.now(),this.OnAllLatencyTimingsReady(this)},SetFrameDisplayDeltaTime:function(e){null==this.FrameDisplayDeltaTimeMs&&(this.FrameDisplayDeltaTimeMs=Math.round(e),this.OnAllLatencyTimingsReady(this))},OnAllLatencyTimingsReady:function(e){}},this.createWebRtcVideo=function(){var e=document.createElement("video");if(e.id="streamingVideo",e.playsInline=!0,e.disablepictureinpicture=!0,e.muted=t.startVideoMuted,e.addEventListener("loadedmetadata",(function(e){t.onVideoInitialised&&t.onVideoInitialised()}),!0),"requestVideoFrameCallback"in HTMLVideoElement.prototype){var i=function(n,a){if(a.receiveTime&&a.expectedDisplayTime){var r=a.presentationTime-a.receiveTime;t.aggregatedStats||(t.aggregatedStats={}),t.aggregatedStats.receiveToCompositeMs=r}e.requestVideoFrameCallback(i)};e.requestVideoFrameCallback(i)}return e},this.video=this.createWebRtcVideo(),this.availableVideoStreams=new Map;var r=function(e){console.info("Signaling state change. |",e.srcElement.signalingState,"|")},o=function(e){console.info("Browser ICE connection |",e.srcElement.iceConnectionState,"|")},s=function(e){console.info("Browser ICE gathering |",e.srcElement.iceGatheringState,"|")},l=function(e){if(e.track&&console.log("Got track. | Kind="+e.track.kind+" | Id="+e.track.id+" | readyState="+e.track.readyState+" |"),"audio"!=e.track.kind){e.track.kind;var i,n=T(e.streams);try{for(n.s();!(i=n.n()).done;){var a=i.value;t.availableVideoStreams.has(a.id)||t.availableVideoStreams.set(a.id,a)}}catch(e){n.e(e)}finally{n.f()}t.video.srcObject=e.streams[0],e.track.onunmute=function(){t.video.srcObject=e.streams[0],t.onNewVideoTrack(e.streams)}}else u(e.streams[0])},u=function(e){if(t.video.srcObject!=e&&t.video.srcObject&&t.video.srcObject!==e){var i=document.createElement("Audio");if(i.srcObject=e,t.autoPlayAudio)i.play();else{var n=function(){i.play(),t.video.removeEventListener("click",n)};t.video.addEventListener("click",n)}console.log("Created new audio element to play seperate audio stream.")}},c=function(e){var i=e.channel;console.log("Data channel created for us by browser (label=".concat(i&&i.label,")")),!i||"cre-bulk"!==i.label&&"cre-texture"!==i.label?(t.dcClient=i,d(i,!1)):console.warn("[webRtcPlayer] extra DataChannel '".concat(i.label,"' ignored (PS1 single-channel constraint)"))},d=function(e,i){try{return e.binaryType="arraybuffer",e.onopen=function(n){console.log("Data channel connected (label=".concat(e.label,")")),i?t.onBulkChannelConnected&&t.onBulkChannelConnected():t.onDataChannelConnected&&t.onDataChannelConnected()},e.onclose=function(t){console.log("Data channel closed (label=".concat(e.label,")"),t)},e.onmessage=function(e){var n=e.data;"string"==typeof n&&(n=function(e){var t,i,n=new Array;t=e.length;for(var a=0;a<t;a++)(i=e.charCodeAt(a))>=65536&&i<=1114111?(n.push(i>>18&7|240),n.push(i>>12&63|128),n.push(i>>6&63|128),n.push(63&i|128)):i>=2048&&i<=65535?(n.push(i>>12&15|224),n.push(i>>6&63|128),n.push(63&i|128)):i>=128&&i<=2047?(n.push(i>>6&31|192),n.push(63&i|128)):n.push(255&i);return new Uint8Array(n).buffer}(n)),i&&t.onBulkChannelMessage?t.onBulkChannelMessage(n):t.onDataChannelMessage&&t.onDataChannelMessage(n)},e.onerror=function(t){console.error("Data channel error (label=".concat(e.label,")"),t)},e}catch(e){return console.warn("No data channel",e),null}},h=function(e){var i=e.candidate;i&&i.candidate&&(console.log("%c[Browser ICE candidate]","background: violet; color: black","| Type=",i.type,"| Protocol=",i.protocol,"| Address=",i.address,"| Port=",i.port,"|"),t.onWebRtcCandidate(i))},f=function(e){e.sdp=e.sdp.replace("useinbandfec=1","useinbandfec=1;stereo=1;sprop-maxcapturerate=48000")},p=function(e){e.onsignalingstatechange=r,e.oniceconnectionstatechange=o,e.onicegatheringstatechange=s,e.ontrack=l,e.onicecandidate=h,e.ondatachannel=c},m=function(){var e=w(D().mark((function e(i){var n,a,r,o,s,l,u,c,d,h,f,p;return D().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=i.getTransceivers().length>0,i.addTransceiver("video",{direction:"recvonly"}),t.useMic){e.next=6;break}i.addTransceiver("audio",{direction:"recvonly"}),e.next=11;break;case 6:return a=!!t.useMic&&{autoGainControl:!1,channelCount:1,echoCancellation:!1,latency:0,noiseSuppression:!1,sampleRate:48e3,volume:1},e.next=9,navigator.mediaDevices.getUserMedia({video:!1,audio:a});case 9:if(r=e.sent)if(n){o=T(i.getTransceivers());try{for(o.s();!(s=o.n()).done;)if((l=s.value)&&l.receiver&&l.receiver.track&&"audio"===l.receiver.track.kind){u=T(r.getTracks());try{for(u.s();!(c=u.n()).done;)(d=c.value).kind&&"audio"==d.kind&&(l.sender.replaceTrack(d),l.direction="sendrecv")}catch(e){u.e(e)}finally{u.f()}}}catch(e){o.e(e)}finally{o.f()}}else{h=T(r.getTracks());try{for(h.s();!(f=h.n()).done;)(p=f.value).kind&&"audio"==p.kind&&i.addTransceiver(p,{direction:"sendrecv"})}catch(e){h.e(e)}finally{h.f()}}else i.addTransceiver("audio",{direction:"recvonly"});case 11:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();this.setVideoEnabled=function(e){t.video.srcObject.getTracks().forEach((function(t){return t.enabled=e}))},this.startLatencyTest=function(e){t.video&&(t.latencyTestTimings.Reset(),t.latencyTestTimings.TestStartTimeMs=Date.now(),e(t.latencyTestTimings.TestStartTimeMs))},this.handleCandidateFromServer=function(e){var i=new RTCIceCandidate(e);console.log("%c[Unreal ICE candidate]","background: pink; color: black","| Type=",i.type,"| Protocol=",i.protocol,"| Address=",i.address,"| Port=",i.port,"|"),t.forceTURN&&i.candidate.indexOf("relay")<0?console.warn("Dropping candidate because it was not TURN relay.","| Type=",i.type,"| Protocol=",i.protocol,"| Address=",i.address,"| Port=",i.port,"|"):t.pcClient.addIceCandidate(i).catch((function(e){console.error("Failed to add ICE candidate",e)}))},this.createOffer=function(){t.pcClient&&(console.log("Closing existing PeerConnection"),t.pcClient.close(),t.pcClient=null),t.pcClient=new RTCPeerConnection(t.cfg),p(t.pcClient),m(t.pcClient).finally((function(){var e;t.dcClient=function(e,t,i){var n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],a=e.createDataChannel(t,i);return console.log("Created datachannel (".concat(t,")")),d(a,n),a}(t.pcClient,"cirrus",t.dataChannelOptions,!1),(t.enableBulkChannel||t.enableTextureChannel)&&console.info("[webRtcPlayer] cre-bulk/cre-texture physical channels disabled (PS1 single-channel); JS-side priority queues still active"),(e=t.pcClient).createOffer(t.sdpConstraints).then((function(i){f(i),e.setLocalDescription(i),t.onWebRtcOffer&&t.onWebRtcOffer(i)}),(function(){console.warn("Couldn't create offer")}))}))},this.receiveOffer=function(e){var i=new RTCSessionDescription(e);t.pcClient||(console.log("Creating a new PeerConnection in the browser.",t.cfg),t.pcClient=new RTCPeerConnection(t.cfg),p(t.pcClient),t.pcClient.setRemoteDescription(i).then((function(){m(t.pcClient).finally((function(){t.pcClient.createAnswer().then((function(e){return t.pcClient.setLocalDescription(e)})).then((function(){t.onWebRtcAnswer&&t.onWebRtcAnswer(t.pcClient.currentLocalDescription)})).then((function(){var e,i=T(t.pcClient.getReceivers());try{for(i.s();!(e=i.n()).done;)e.value.playoutDelayHint=0}catch(e){i.e(e)}finally{i.f()}})).catch((function(e){return console.error("createAnswer() failed:",e)}))}))})))},this.receiveAnswer=function(e){var i=new RTCSessionDescription(e);t.pcClient.setRemoteDescription(i);var n,a=T(t.pcClient.getReceivers());try{for(a.s();!(n=a.n()).done;)n.value.playoutDelayHint=0}catch(e){a.e(e)}finally{a.f()}},this.close=function(){t.pcClient&&(console.log("Closing existing peerClient"),t.pcClient.close(),t.pcClient=null),t.dcClient=null,t.dcBulk=null,t.dcTexture=null,t.aggregateStatsIntervalId&&clearInterval(t.aggregateStatsIntervalId)},this.send=function(e){if(t.dcClient&&"open"==t.dcClient.readyState)try{t.dcClient.send(e)}catch(e){console.error("dcClient.send error: ",e)}},this.sendBulk=function(e){var i=t.dcBulk&&"open"===t.dcBulk.readyState?t.dcBulk:t.dcClient;if(i&&"open"===i.readyState)try{i.send(e)}catch(e){console.error("bulk send error: ",e)}},this.getBulkChannel=function(){return t.dcBulk&&"open"===t.dcBulk.readyState?t.dcBulk:t.dcClient},this.getStats=function(e){t.pcClient&&e&&t.pcClient.getStats(null).then((function(t){e(t)}))},this.aggregateStats=function(e){var i=(t.aggregatedStats||(t.aggregatedStats={}),function(e){var i={};e.forEach((function(e){if("inbound-rtp"==e.type&&!e.isRemote&&("video"==e.mediaType||e.id.toLowerCase().includes("video"))&&(i.timestamp=e.timestamp,i.bytesReceived=e.bytesReceived,i.framesDecoded=e.framesDecoded,i.packetsLost=e.packetsLost,i.framesReceivedRtp=e.framesReceived,i.totalDecodeTime=e.totalDecodeTime,i.jitterBufferDelay=e.jitterBufferDelay,i.jitterBufferEmittedCount=e.jitterBufferEmittedCount,i.processingDelay=e.processingDelay,i.framesAssembledFromMultiplePackets=e.framesAssembledFromMultiplePackets,i.bytesReceivedStart=t.aggregatedStats&&t.aggregatedStats.bytesReceivedStart?t.aggregatedStats.bytesReceivedStart:e.bytesReceived,i.framesDecodedStart=t.aggregatedStats&&t.aggregatedStats.framesDecodedStart?t.aggregatedStats.framesDecodedStart:e.framesDecoded,i.timestampStart=t.aggregatedStats&&t.aggregatedStats.timestampStart?t.aggregatedStats.timestampStart:e.timestamp,t.aggregatedStats&&t.aggregatedStats.timestamp)){t.aggregatedStats.bytesReceived&&(i.bitrate=8*(i.bytesReceived-t.aggregatedStats.bytesReceived)/(i.timestamp-t.aggregatedStats.timestamp),i.bitrate=Math.floor(i.bitrate),i.lowBitrate=t.aggregatedStats.lowBitrate&&t.aggregatedStats.lowBitrate<i.bitrate?t.aggregatedStats.lowBitrate:i.bitrate,i.highBitrate=t.aggregatedStats.highBitrate&&t.aggregatedStats.highBitrate>i.bitrate?t.aggregatedStats.highBitrate:i.bitrate),t.aggregatedStats.bytesReceivedStart&&(i.avgBitrate=8*(i.bytesReceived-t.aggregatedStats.bytesReceivedStart)/(i.timestamp-t.aggregatedStats.timestampStart),i.avgBitrate=Math.floor(i.avgBitrate)),t.aggregatedStats.framesDecoded&&(i.framerate=(i.framesDecoded-t.aggregatedStats.framesDecoded)/((i.timestamp-t.aggregatedStats.timestamp)/1e3),i.framerate=Math.floor(i.framerate),i.lowFramerate=t.aggregatedStats.lowFramerate&&t.aggregatedStats.lowFramerate<i.framerate?t.aggregatedStats.lowFramerate:i.framerate,i.highFramerate=t.aggregatedStats.highFramerate&&t.aggregatedStats.highFramerate>i.framerate?t.aggregatedStats.highFramerate:i.framerate),t.aggregatedStats.framesDecodedStart&&(i.avgframerate=(i.framesDecoded-t.aggregatedStats.framesDecodedStart)/((i.timestamp-t.aggregatedStats.timestampStart)/1e3),i.avgframerate=Math.floor(i.avgframerate));var n=i.timestamp-t.aggregatedStats.timestamp;if(void 0!==i.framesReceivedRtp&&void 0!==t.aggregatedStats.framesReceivedRtp&&n>0){var a=i.framesReceivedRtp-t.aggregatedStats.framesReceivedRtp;a>0&&(i.frameInterArrivalMs=n/a)}if(void 0!==i.totalDecodeTime&&void 0!==t.aggregatedStats.totalDecodeTime){var r=i.framesDecoded-t.aggregatedStats.framesDecoded;r>0&&(i.decodeDurationMs=1e3*(i.totalDecodeTime-t.aggregatedStats.totalDecodeTime)/r)}if(void 0!==i.jitterBufferDelay&&void 0!==t.aggregatedStats.jitterBufferDelay){var o=(i.jitterBufferEmittedCount||0)-(t.aggregatedStats.jitterBufferEmittedCount||0);o>0&&(i.jitterBufferDelayMs=1e3*(i.jitterBufferDelay-t.aggregatedStats.jitterBufferDelay)/o)}if(void 0!==i.processingDelay&&void 0!==t.aggregatedStats.processingDelay){var s=void 0!==i.framesAssembledFromMultiplePackets&&void 0!==t.aggregatedStats.framesAssembledFromMultiplePackets?i.framesAssembledFromMultiplePackets-t.aggregatedStats.framesAssembledFromMultiplePackets:i.framesDecoded-t.aggregatedStats.framesDecoded;s>0&&(i.processingDelayMs=1e3*(i.processingDelay-t.aggregatedStats.processingDelay)/s)}}"track"!=e.type||"video_label"!=e.trackIdentifier&&"video"!=e.kind||(i.framesDropped=e.framesDropped,i.framesReceived=e.framesReceived,i.framesDroppedPercentage=e.framesReceived>0?e.framesDropped/e.framesReceived*100:0,i.frameHeight=e.frameHeight,i.frameWidth=e.frameWidth,i.frameHeightStart=t.aggregatedStats&&t.aggregatedStats.frameHeightStart?t.aggregatedStats.frameHeightStart:e.frameHeight,i.frameWidthStart=t.aggregatedStats&&t.aggregatedStats.frameWidthStart?t.aggregatedStats.frameWidthStart:e.frameWidth),"inbound-rtp"!=e.type||"video"!=e.mediaType&&"video"!=e.kind||(e.frameHeight&&!i.frameHeight&&(i.frameHeight=e.frameHeight),e.frameWidth&&!i.frameWidth&&(i.frameWidth=e.frameWidth),void 0!==e.framesDropped&&void 0===i.framesDropped&&(i.framesDropped=e.framesDropped),void 0!==e.framesReceived&&void 0===i.framesReceived&&(i.framesReceived=e.framesReceived,i.framesReceived>0&&void 0!==i.framesDropped&&(i.framesDroppedPercentage=i.framesDropped/i.framesReceived*100))),"candidate-pair"==e.type&&e.hasOwnProperty("currentRoundTripTime")&&0!=e.currentRoundTripTime&&(i.currentRoundTripTime=e.currentRoundTripTime)})),t.aggregatedStats.receiveToCompositeMs&&(i.receiveToCompositeMs=t.aggregatedStats.receiveToCompositeMs,t.latencyTestTimings.SetFrameDisplayDeltaTime(t.aggregatedStats.receiveToCompositeMs)),t.aggregatedStats=i,t.onAggregatedStats&&t.onAggregatedStats(i)});t.aggregateStatsIntervalId=setInterval((function(){t.getStats(i)}),e)}};!function(e,t){void 0===t&&(t={});var i=t.insertAt;if("undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],a=document.createElement("style");a.type="text/css","top"===i&&n.firstChild?n.insertBefore(a,n.firstChild):n.appendChild(a),a.styleSheet?a.styleSheet.cssText=e:a.appendChild(document.createTextNode(e))}}("/* 视频流送的视频组件样式 */\r\nvideo {\r\n position: absolute;\r\n width: 100%;\r\n height: 100%;\r\n}\r\n\r\n/* 视频流送的整体根组件属性 */\r\n#player {\r\n width: 100%;\r\n height: 100%;\r\n position: relative;\r\n background-color: #000;\r\n}\r\n\r\n/* 如果不是链接后直接加载(即connect_on_load: false)那么便会显示该画面,用于配置显示蒙版的样式 */\r\n#videoPlayOverlay {\r\n z-index: 30;\r\n position: absolute;\r\n font-size: 1.8em;\r\n width: 100%;\r\n height: 100%;\r\n color: white;\r\n background-color: rgba(100, 100, 100, .7);\r\n}\r\n\r\n/* State for element to be clickable */\r\n/* 待开始页面显示状态的样式 */\r\n.clickableState {\r\n align-items: center;\r\n justify-content: center;\r\n display: flex;\r\n cursor: pointer;\r\n}\r\n\r\n.textDisplayState {\r\n width: 100%;\r\n height: 100%;\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n}\r\n\r\n/* State to hide overlay, WebRTC communication is in progress and or is playing */\r\n/* 待开始页面隐藏 */\r\n.hiddenState {\r\n display: none;\r\n}\r\n\r\n/* 如果不是链接后直接加载(即connect_on_load: false)那么便会显示该按钮文字,用于配置显示样式 */\r\n#playButton {\r\n display: inline-block;\r\n height: auto;\r\n}");var be=function(){return C((function e(){U(this,e)}),[{key:"addEventListener",value:function(e,t){void 0===this._listeners&&(this._listeners={}),this._needsDispatchedToUE=!1;var i=this._listeners;void 0===i[e]&&(i[e]=[]),-1===i[e].indexOf(t)&&(i[e].push(t),this._needsDispatchedToUE=!0,this._dispatchAddListenerTypes||(this._dispatchAddListenerTypes=[]),this._dispatchAddListenerTypes.push(e))}},{key:"hasEventListener",value:function(e,t){if(void 0===this._listeners)return!1;var i=this._listeners;return void 0!==i[e]&&-1!==i[e].indexOf(t)}},{key:"removeEventListener",value:function(e,t){if(void 0!==this._listeners){this._needsDispatchedToUE=!1;var i=this._listeners[e];if(void 0!==i){var n=i.indexOf(t);-1!==n&&(i.splice(n,1),this._needsDispatchedToUE=!0,this._dispatchRemoveListenerTypes||(this._dispatchRemoveListenerTypes=[]),this._dispatchRemoveListenerTypes.push(e))}}}},{key:"dispatchEvent",value:function(e){if(void 0!==this._listeners){var t=this._listeners[e.type];if(void 0!==t){e.target=this;for(var i=t.slice(0),n=0,a=i.length;n<a;n++)e.index=n,i[n].call(this,e);e.target=null}}}},{key:"_silentlyRemoveEventListener",value:function(e,t,i){if(e&&i&&void 0!==e._listeners){var n=e._listeners[t];if(void 0!==n){var a=n.indexOf(i);-1!==a&&n.splice(a,1)}}}}])}(),xe=function(){function t(i){var n;return U(this,t),(n=N(this,t)).haveEvents="GamepadEvent"in window,n.haveWebkitEvents="WebKitGamepadEvent"in window,n.cloudRenderEngine=i,n.playerElement=document.getElementById("player"),n.promiseResponses=[],n.scene=n.cloudRenderEngine.scene,n.interactiveObjects=new Map,n.blacklist=new Set,n.mousedownTime=null,n.mouse=new e(0,0),n.selection=[],n.logMessages=!1,n.inputOptions=i.inputOptions,n.playerElement&&(n.playerElement.tabIndex<10&&(n.playerElement.tabIndex=1e3),n.playerElement.addEventListener("contextmenu",(function(e){e.preventDefault()}),!1)),n}return z(t,be),C(t,[{key:"updateObjectsWithEvent",value:function(){var e=new Map;this.scene&&this.scene.children.length&&this.scene.children.forEach((function(t,i){t._listeners&&e.set(t.uuid,t)})),this.interactiveObjects.clear(),this.interactiveObjects=e}},{key:"isKeyCodeBrowserKey",value:function(e){return e>=112&&e<=123||9===e}},{key:"getKeyCode",value:function(e){return e.keyCode===he.Shift&&"ShiftRight"===e.code?he.RightShift:e.keyCode===he.Control&&"ControlRight"===e.code?he.RightControl:e.keyCode===he.Alt&&"AltRight"===e.code?he.RightAlt:e.keyCode}},{key:"registerKeyboardEvents",value:function(){var e=this;document.onkeydown=function(t){e.print_inputs&&console.log("key down ".concat(t.keyCode,", repeat = ").concat(t.repeat)),e.cloudRenderEngine.sendInputData(new Uint8Array([le.KeyDown,e.getKeyCode(t),t.repeat]).buffer),t.keyCode===he.BackSpace&&document.onkeypress({charCode:he.BackSpace}),e.inputOptions.suppressBrowserKeys&&e.isKeyCodeBrowserKey(t.keyCode)&&t.preventDefault()},document.onkeyup=function(t){e.print_inputs&&console.log("key up ".concat(t.keyCode)),e.cloudRenderEngine.sendInputData(new Uint8Array([le.KeyUp,e.getKeyCode(t)]).buffer),e.inputOptions.suppressBrowserKeys&&e.isKeyCodeBrowserKey(t.keyCode)&&t.preventDefault()},document.onkeypress=function(t){e.print_inputs&&console.log("key press ".concat(t.charCode));var i=new DataView(new ArrayBuffer(3));i.setUint8(0,le.KeyPress),i.setUint16(1,t.charCode,!0),e.cloudRenderEngine.sendInputData(i.buffer)}}},{key:"resizePlayerStyleToFillWindow",value:function(e){var t=e.getElementsByTagName("VIDEO"),i=window.innerHeight/window.innerWidth,n=e.clientHeight/e.clientWidth,a=t.videoHeight/t.videoWidth;isNaN(a)?(this.styleWidth=window.innerWidth,this.styleHeight=window.innerHeight,this.styleTop=0,this.styleLeft=0,e.style="top: "+this.styleTop+"px; left: "+this.styleLeft+"px; width: "+this.styleWidth+"px; height: "+this.styleHeight+"px; cursor: "+this.styleCursor+"; "+this.styleAdditional):i<n?(this.styleWidth=Math.floor(window.innerHeight/a),this.styleHeight=window.innerHeight,this.styleTop=0,this.styleLeft=Math.floor(.5*(window.innerWidth-this.styleWidth)),e.style="top: "+this.styleTop+"px; left: "+this.styleLeft+"px; width: "+this.styleWidth+"px; height: "+this.styleHeight+"px; cursor: "+this.styleCursor+"; "+this.styleAdditional):(this.styleWidth=window.innerWidth,this.styleHeight=Math.floor(window.innerWidth*a),this.styleTop=Math.floor(.5*(window.innerHeight-this.styleHeight)),this.styleLeft=0,e.style="top: "+this.styleTop+"px; left: "+this.styleLeft+"px; width: "+this.styleWidth+"px; height: "+this.styleHeight+"px; cursor: "+this.styleCursor+"; "+this.styleAdditional)}},{key:"resizePlayerStyleToActualSize",value:function(e){var t=e.getElementsByTagName("VIDEO");if(t.length>0){this.styleWidth=t[0].videoWidth,this.styleHeight=t[0].videoHeight;var i=Math.floor(.5*(window.innerHeight-this.styleHeight)),n=Math.floor(.5*(window.innerWidth-this.styleWidth));this.styleTop=i>0?i:0,this.styleLeft=n>0?n:0,e.style="top: "+this.styleTop+"px; left: "+this.styleLeft+"px; width: "+this.styleWidth+"px; height: "+this.styleHeight+"px; cursor: "+this.styleCursor+"; "+this.styleAdditional}}},{key:"resizePlayerStyleToArbitrarySize",value:function(e){e.style="top: 0px; left: 0px; width: "+this.styleWidth+"px; height: "+this.styleHeight+"px; cursor: "+this.styleCursor+"; "+this.styleAdditional}},{key:"setupFreezeFrameOverlay",value:function(){this.cloudRenderEngine.freezeFrameOverlay=document.createElement("div"),this.cloudRenderEngine.freezeFrameOverlay.id="this.cloudRenderEngine.freezeFrameOverlay",this.cloudRenderEngine.freezeFrameOverlay.style.display="none",this.cloudRenderEngine.freezeFrameOverlay.style.pointerEvents="none",this.cloudRenderEngine.freezeFrameOverlay.style.position="absolute",this.cloudRenderEngine.freezeFrameOverlay.style.zIndex="20";var e=document.createElement("img");e.style.position="absolute",this.cloudRenderEngine.freezeFrameOverlay.appendChild(e)}},{key:"showFreezeFrameOverlay",value:function(){this.cloudRenderEngine.freezeFrame.valid&&(this.cloudRenderEngine.freezeFrameOverlay.classList.add("freezeframeBackground"),this.cloudRenderEngine.freezeFrameOverlay.style.display="block")}},{key:"invalidateFreezeFrameOverlay",value:function(){this.cloudRenderEngine.freezeFrameOverlay.style.display="none",this.cloudRenderEngine.freezeFrame.valid=!1,this.cloudRenderEngine.freezeFrameOverlay.classList.remove("freezeframeBackground"),this.cloudRenderEngine.webRtcPlayerObj&&this.cloudRenderEngine.webRtcPlayerObj.setVideoEnabled(!0)}},{key:"resizeFreezeFrameOverlay",value:function(){if(0!==this.cloudRenderEngine.freezeFrame.width&&0!==this.cloudRenderEngine.freezeFrame.height){var e=0,t=0,i=0,n=0,a=document.getElementById("enlarge-display-to-fill-window-tgl"),r=document.getElementById("player");if(null!==a&&a.checked){var o=window.innerWidth/window.innerHeight,s=this.cloudRenderEngine.freezeFrame.width/this.cloudRenderEngine.freezeFrame.height;o<s?(e=window.innerWidth,t=Math.floor(window.innerWidth/s),i=Math.floor(.5*(window.innerHeight-t)),n=0):(e=Math.floor(window.innerHeight*s),t=window.innerHeight,i=0,n=Math.floor(.5*(window.innerWidth-e)))}else{var l=r.offsetWidth/r.offsetHeight,u=this.cloudRenderEngine.freezeFrame.width/this.cloudRenderEngine.freezeFrame.height;l<u?(e=r.offsetWidth,t=Math.floor(r.offsetWidth/u),i=Math.floor(.5*(r.offsetHeight-t)),n=0):(e=Math.floor(r.offsetHeight*u),t=r.offsetHeight,i=0,n=Math.floor(.5*(r.offsetWidth-e)))}var c=document.getElementById("this.cloudRenderEngine.freezeFrameOverlay").childNodes[0];this.cloudRenderEngine.freezeFrameOverlay.style.width=r.offsetWidth+"px",this.cloudRenderEngine.freezeFrameOverlay.style.height=r.offsetHeight+"px",this.cloudRenderEngine.freezeFrameOverlay.style.left="0px",this.cloudRenderEngine.freezeFrameOverlay.style.top="0px",c.style.width=e+"px",c.style.height=t+"px",c.style.left=n+"px",c.style.top=i+"px"}}},{key:"resizePlayerStyle",value:function(e){var t=document.getElementById("player");if(t)if(this.cloudRenderEngine.updateVideoStreamSize(),t.classList.contains("fixed-size"))this.setupMouseAndFreezeFrame(t);else{var i=document.getElementById("enlarge-display-to-fill-window-tgl"),n=window.innerWidth<t.videoWidth||window.innerHeight<t.videoHeight;null!==i?i.checked||n?this.resizePlayerStyleToFillWindow(t):this.resizePlayerStyleToActualSize(t):this.resizePlayerStyleToArbitrarySize(t),this.setupMouseAndFreezeFrame(t)}}},{key:"setupMouseAndFreezeFrame",value:function(e){this.playerElementClientRect=e.getBoundingClientRect(),this.cloudRenderEngine.setupNormalizeAndQuantize(),this.resizeFreezeFrameOverlay()}},{key:"onOrientationChange",value:function(e){var t=this;clearTimeout(this._orientationChangeTimeout),this._orientationChangeTimeout=setTimeout((function(){t.resizePlayerStyle()}),500)}},{key:"setupHtmlEvents",value:function(){var e=this,t=this;if(window.addEventListener("resize",(function(t){e.resizePlayerStyle(t)}),!0),window.addEventListener("orientationchange",(function(t){e.onOrientationChange(t)})),this.haveEvents?(window.addEventListener("gamepadconnected",(function(t){e.gamepadConnectHandler(t)})),window.addEventListener("gamepaddisconnected",(function(t){e.gamepadDisconnectHandler(t)}))):this.haveWebkitEvents&&(window.addEventListener("webkitgamepadconnected",(function(t){e.gamepadConnectHandler(t)})),window.addEventListener("webkitgamepaddisconnected",(function(t){e.gamepadDisconnectHandler(t)}))),this.cloudRenderEngine.isShowTestUI){document.getElementById("overlayButton").addEventListener("click",(function(t){e.onExpandOverlay_Click(t)}));var i=document.getElementById("enlarge-display-to-fill-window-tgl");null!==i&&(i.onchange=function(e){t.resizePlayerStyle()}),this.cloudRenderEngine.qualityControlOwnershipCheckBox=document.getElementById("quality-control-ownership-tgl"),null!==this.cloudRenderEngine.qualityControlOwnershipCheckBox&&(this.cloudRenderEngine.qualityControlOwnershipCheckBox.onchange=function(e){t.cloudRenderEngine.requestQualityControl()});var n=document.getElementById("encoder-params-submit");null!==n&&(n.onclick=function(e){var i=document.getElementById("encoder-min-qp-text").value,n=document.getElementById("encoder-max-qp-text").value;t.cloudRenderEngine.emitCommand({ConsoleCommand:"PixelStreaming.Encoder.MinQP "+i}),t.cloudRenderEngine.emitCommand({ConsoleCommand:"PixelStreaming.Encoder.MaxQP "+n})});var a=document.getElementById("webrtc-params-submit");null!==a&&(a.onclick=function(e){var i=document.getElementById("webrtc-fps-text").value,n=1e3*document.getElementById("webrtc-min-bitrate-text").value,a=1e3*document.getElementById("webrtc-max-bitrate-text").value;t.cloudRenderEngine.emitCommand({ConsoleCommand:"PixelStreaming.WebRTC.Fps "+i}),t.cloudRenderEngine.emitCommand({ConsoleCommand:"PixelStreaming.WebRTC.MinBitrate "+n}),t.cloudRenderEngine.emitCommand({ConsoleCommand:"PixelStreaming.WebRTC.MaxBitrate "+a})});var r=document.getElementById("show-fps-button");null!==r&&(r.onclick=function(e){t.cloudRenderEngine.emitCommand({ConsoleCommand:"Stat FPS"})});var o=document.getElementById("match-viewport-res-tgl");null!==o&&(o.onchange=function(e){t.cloudRenderEngine.matchViewportResolution=o.checked});var s=document.getElementById("show-stats-tgl");null!==s&&(s.onchange=function(e){document.getElementById("statsContainer").style.display=e.target.checked?"block":"none"});var l=document.getElementById("test-latency-button");l&&(l.onclick=function(){e.sendStartLatencyTest()}),this.cloudRenderEngine.setupToggleWithUrlParams("prefer-sfu-tgl","preferSFU"),this.cloudRenderEngine.setupToggleWithUrlParams("use-mic-tgl","useMic"),this.cloudRenderEngine.setupToggleWithUrlParams("force-turn-tgl","ForceTURN");var u=document.getElementById("stream-select"),c=document.getElementById("track-select");u&&(u.onchange=function(e){var i=t.cloudRenderEngine.webRtcPlayerObj.availableVideoStreams.get(u.value);t.cloudRenderEngine.webRtcPlayerObj.video.srcObject=i,t.cloudRenderEngine.streamTrackSource=i,t.cloudRenderEngine.webRtcPlayerObj.video.play(),t.cloudRenderEngine.updateTrackList()},c&&(c.onchange=function(e){if(t.cloudRenderEngine.streamTrackSource||(t.cloudRenderEngine.streamTrackSource=t.cloudRenderEngine.webRtcPlayerObj.availableVideoStreams.get(u.value)),t.cloudRenderEngine.streamTrackSource){var i,n=T(t.cloudRenderEngine.streamTrackSource.getVideoTracks());try{for(n.s();!(i=n.n()).done;){var a=i.value;if(a.id===c.value){t.cloudRenderEngine.webRtcPlayerObj.video.srcObject=new MediaStream([a]),t.cloudRenderEngine.webRtcPlayerObj.video.play(),u.value="";break}}}catch(e){n.e(e)}finally{n.f()}}}))}}},{key:"onExpandOverlay_Click",value:function(){document.getElementById("overlay").classList.toggle("overlay-shown")}},{key:"gamepadConnectHandler",value:function(e){console.log("Gamepad connect handler")}},{key:"gamepadDisconnectHandler",value:function(e){console.log("Gamepad disconnect handler"),console.log("gamepad: "+e.gamepad.id+" disconnected"),delete this.cloudRenderEngine.controllers[e.gamepad.index]}},{key:"emitMouseMove",value:function(e,t,i,n){this.cloudRenderEngine.print_inputs&&console.log("emitMouseMove x: ".concat(e,", y:").concat(t,", dX: ").concat(i,", dY: ").concat(n));var a=this.cloudRenderEngine.normalizeAndQuantizeUnsigned(e,t),r=this.cloudRenderEngine.normalizeAndQuantizeSigned(i,n),o=new DataView(new ArrayBuffer(9));o.setUint8(0,le.MouseMove),o.setUint16(1,a.x,!0),o.setUint16(3,a.y,!0),o.setInt16(5,r.x,!0),o.setInt16(7,r.y,!0),this.cloudRenderEngine.sendInputData(o.buffer)}},{key:"emitMouseDown",value:function(e,t,i){this.print_inputs&&console.log("mouse button ".concat(e," down at (").concat(t,", ").concat(i,")"));var n=this.cloudRenderEngine.normalizeAndQuantizeUnsigned(t,i),a=new DataView(new ArrayBuffer(6));a.setUint8(0,le.MouseDown),a.setUint8(1,e),a.setUint16(2,n.x,!0),a.setUint16(4,n.y,!0),this.cloudRenderEngine.sendInputData(a.buffer)}},{key:"emitMouseUp",value:function(e,t,i){this.print_inputs&&console.log("mouse button ".concat(e," up at (").concat(t,", ").concat(i,")"));var n=this.cloudRenderEngine.normalizeAndQuantizeUnsigned(t,i),a=new DataView(new ArrayBuffer(6));a.setUint8(0,le.MouseUp),a.setUint8(1,e),a.setUint16(2,n.x,!0),a.setUint16(4,n.y,!0),this.cloudRenderEngine.sendInputData(a.buffer)}},{key:"emitMouseWheel",value:function(e,t,i){this.print_inputs&&console.log("mouse wheel with delta ".concat(e," at (").concat(t,", ").concat(i,")"));var n=this.cloudRenderEngine.normalizeAndQuantizeUnsigned(t,i),a=new DataView(new ArrayBuffer(7));a.setUint8(0,le.MouseWheel),a.setInt16(1,e,!0),a.setUint16(3,n.x,!0),a.setUint16(5,n.y,!0),this.cloudRenderEngine.sendInputData(a.buffer)}},{key:"releaseMouseButtons",value:function(e,t,i){e&de.PrimaryButton&&this.emitMouseUp(ce.MainButton,t,i),e&de.SecondaryButton&&this.emitMouseUp(ce.SecondaryButton,t,i),e&de.AuxiliaryButton&&this.emitMouseUp(ce.AuxiliaryButton,t,i),e&de.FourthButton&&this.emitMouseUp(ce.FourthButton,t,i),e&de.FifthButton&&this.emitMouseUp(ce.FifthButton,t,i)}},{key:"pressMouseButtons",value:function(e,t,i){e&de.PrimaryButton&&this.emitMouseDown(ce.MainButton,t,i),e&de.SecondaryButton&&this.emitMouseDown(ce.SecondaryButton,t,i),e&de.AuxiliaryButton&&this.emitMouseDown(ce.AuxiliaryButton,t,i),e&de.FourthButton&&this.emitMouseDown(ce.FourthButton,t,i),e&de.FifthButton&&this.emitMouseDown(ce.FifthButton,t,i)}},{key:"registerInputs",value:function(e){e&&(this.registerMouseEnterAndLeaveEvents(e),this.registerTouchEvents(e))}},{key:"registerMouseEnterAndLeaveEvents",value:function(e){var t=this;e.onmouseenter=function(i){t.print_inputs&&console.log("mouse enter");var n=new DataView(new ArrayBuffer(1));n.setUint8(0,le.MouseEnter),t.cloudRenderEngine.sendInputData(n.buffer),e.pressMouseButtons(i)},e.onmouseleave=function(i){t.print_inputs&&console.log("mouse leave");var n=new DataView(new ArrayBuffer(1));n.setUint8(0,le.MouseLeave),t.cloudRenderEngine.sendInputData(n.buffer),e.releaseMouseButtons(i)}}},{key:"registerLockedMouseEvents",value:function(e){var t=this,i=e.width/2,n=e.height/2;function a(){document.pointerLockElement===e||document.mozPointerLockElement===e?(console.log("Pointer locked"),document.addEventListener("mousemove",r,!1)):(console.log("The pointer lock status is now unlocked"),document.removeEventListener("mousemove",r,!1))}function r(e){i+=e.movementX,n+=e.movementY,i>t.styleWidth&&(i-=t.styleWidth),n>t.styleHeight&&(n-=t.styleHeight),i<0&&(i=t.styleWidth+i),n<0&&(n=t.styleHeight-n),t.emitMouseMove(i,n,e.movementX,e.movementY)}e.requestPointerLock=e.requestPointerLock||e.mozRequestPointerLock,document.exitPointerLock=document.exitPointerLock||document.mozExitPointerLock,e.onclick=function(){e.requestPointerLock()},document.addEventListener("pointerlockchange",a,!1),document.addEventListener("mozpointerlockchange",a,!1),e.onmousedown=function(e){t.emitMouseDown(e.button,i,n)},e.onmouseup=function(e){t.emitMouseUp(e.button,i,n)},e.onmousewheel=function(e){t.emitMouseWheel(e.wheelDelta,i,n)},e.pressMouseButtons=function(e){t.pressMouseButtons(e.buttons,i,n)},e.releaseMouseButtons=function(e){t.releaseMouseButtons(e.buttons,i,n)}}},{key:"registerHoveringMouseEvents",value:function(e){var t=this,i=/Mac/.test(navigator.platform)||/Macintosh/.test(navigator.userAgent);e.onpointermove=function(e){t.emitMouseMove(e.offsetX,e.offsetY,e.movementX,e.movementY),e.preventDefault()},e.onpointerdown=function(i){e.setPointerCapture(i.pointerId),t.emitMouseDown(i.button,i.offsetX,i.offsetY),i.preventDefault()},e.onpointerup=function(e){t.emitMouseUp(e.button,e.offsetX,e.offsetY),e.preventDefault()},e.oncontextmenu=function(e){i||t.emitMouseUp(e.button,e.offsetX,e.offsetY),e.preventDefault()},"onmousewheel"in e?e.onmousewheel=function(e){t.emitMouseWheel(e.wheelDelta,e.offsetX,e.offsetY),e.preventDefault()}:e.addEventListener("DOMMouseScroll",(function(e){t.emitMouseWheel(-120*e.detail,e.offsetX,e.offsetY),e.preventDefault()}),!1),e.pressMouseButtons=function(e){t.pressMouseButtons(e.buttons,e.offsetX,e.offsetY)},e.releaseMouseButtons=function(e){t.releaseMouseButtons(e.buttons,e.offsetX,e.offsetY)}}},{key:"registerTouchEvents",value:function(e){var t,i=this,n=[9,8,7,6,5,4,3,2,1,0],a={};function r(e){var t=n.pop();void 0===t&&console.log("exhausted touch indentifiers"),a[e.identifier]=t}function o(t,n){var r=new DataView(new ArrayBuffer(2+7*n.length));r.setUint8(0,t),r.setUint8(1,n.length);for(var o=2,s=0;s<n.length;s++){var l=n[s],u=l.clientX-e.offsetLeft,c=l.clientY-e.offsetTop;i.print_inputs&&console.log("F".concat(a[l.identifier],"=(").concat(u,", ").concat(c,")"));var d=i.cloudRenderEngine.normalizeAndQuantizeUnsigned(u,c);r.setUint16(o,d.x,!0),o+=2,r.setUint16(o,d.y,!0),o+=2,r.setUint8(o,a[l.identifier],!0),o+=1,r.setUint8(o,255*l.force,!0),o+=1,r.setUint8(o,d.inRange?1:0,!0),o+=1}i.cloudRenderEngine.sendInputData(r.buffer)}this.inputOptions.fakeMouseWithTouches?(e.ontouchstart=function(n){if(void 0===t){var a=n.changedTouches[0];t={id:a.identifier,x:a.clientX-i.playerElementClientRect.left,y:a.clientY-i.playerElementClientRect.top},e.onmouseenter(n),i.emitMouseDown(ce.MainButton,t.x,t.y)}n.preventDefault()},e.ontouchend=function(n){for(var a=0;a<n.changedTouches.length;a++){var r=n.changedTouches[a];if(r.identifier===t.id){var o=r.clientX-i.playerElementClientRect.left,s=r.clientY-i.playerElementClientRect.top;i.emitMouseUp(ce.MainButton,o,s),e.onmouseleave(n),t=void 0;break}}n.preventDefault()},e.ontouchmove=function(e){for(var n=0;n<e.touches.length;n++){var a=e.touches[n];if(a.identifier===t.id){var r=a.clientX-i.playerElementClientRect.left,o=a.clientY-i.playerElementClientRect.top;i.emitMouseMove(r,o,r-t.x,o-t.y),t.x=r,t.y=o;break}}e.preventDefault()}):(e.ontouchstart=function(e){for(var t=0;t<e.changedTouches.length;t++)r(e.changedTouches[t]);i.print_inputs&&console.log("touch start"),o(le.TouchStart,e.changedTouches),e.preventDefault()},e.ontouchend=function(e){i.print_inputs&&console.log("touch end"),o(le.TouchEnd,e.changedTouches);for(var t=0;t<e.changedTouches.length;t++)r=e.changedTouches[t],n.push(a[r.identifier]),delete a[r.identifier];var r;e.preventDefault()},e.ontouchmove=function(e){i.print_inputs&&console.log("touch move"),o(le.TouchMove,e.touches),e.preventDefault()})}},{key:"callRespone",value:function(e){var t=e.uuid,i=e.classType;this.interactiveObjects.has(t)?this.interactiveObjects.get(t).dispatchEvent(e):"cloudrenderengine"===i.toLowerCase()?this.cloudRenderEngine.dispatchEvent(e):"scene"===i.toLowerCase()?this.scene&&this.scene.dispatchEvent(e):"camera"===i.toLowerCase()&&this.cloudRenderEngine.camera&&this.cloudRenderEngine.camera.dispatchEvent(e)}}])}();function Se(e){for(var t=-559038737,i=1103547991,n=0;n<e.length;n++){var a=e[n];t=Math.imul(t^a,2654435761),i=Math.imul(i^a,1597334677)}return t=Math.imul(t^t>>>16,2246822507)^Math.imul(i^i>>>13,3266489909),((i=Math.imul(i^i>>>16,2246822507)^Math.imul(t^t>>>13,3266489909))>>>0).toString(16).padStart(8,"0")+(t>>>0).toString(16).padStart(8,"0")}function we(e){return Ne.apply(this,arguments)}function Ne(){return(Ne=w(D().mark((function e(t){var i;return D().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,crypto.subtle.digest("SHA-1",t);case 2:return i=e.sent,e.abrupt("return",Array.from(new Uint8Array(i),(function(e){return e.toString(16).padStart(2,"0")})).join(""));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ue(e){return ke.apply(this,arguments)}function ke(){return(ke=w(D().mark((function e(t){var i;return D().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!((i=t instanceof Uint8Array?t:new Uint8Array(t)).byteLength<65536)){e.next=3;break}return e.abrupt("return",Se(i));case 3:return e.abrupt("return",we(i));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ce(e){return Te.apply(this,arguments)}function Te(){return(Te=w(D().mark((function e(t){var i,n,a,r,o,s,l,u,c,d,h,f;return D().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(t instanceof Uint8Array)){e.next=2;break}return e.abrupt("return",{bytes:t,mime:"application/octet-stream",width:0,height:0});case 2:if(!(t instanceof HTMLCanvasElement)){e.next=25;break}return i=t.width,n=t.height,e.next=7,new Promise((function(e){return t.toBlob(e,"image/webp",.9)}));case 7:if(a=e.sent,r="image/webp",a){e.next=14;break}return e.next=12,new Promise((function(e){return t.toBlob(e,"image/png")}));case 12:a=e.sent,r="image/png";case 14:if(a){e.next=16;break}throw new Error("TextureBus: Canvas toBlob failed (canvas may be tainted by cross-origin image)");case 16:return e.t0=Uint8Array,e.next=19,a.arrayBuffer();case 19:return e.t1=e.sent,e.t2=new e.t0(e.t1),e.t3=r,e.t4=i,e.t5=n,e.abrupt("return",{bytes:e.t2,mime:e.t3,width:e.t4,height:e.t5});case 25:if("string"!=typeof t||!t.startsWith("data:")){e.next=35;break}for(o=t.indexOf(","),s=t.substring(0,o),l=s.match(/data:([^;]+)/),u=l?l[1]:"image/png",c=t.substring(o+1),d=atob(c),h=new Uint8Array(d.length),f=0;f<d.length;f++)h[f]=d.charCodeAt(f);return e.abrupt("return",{bytes:h,mime:u,width:0,height:0});case 35:throw new Error("TextureBus: unsupported input type");case 36:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Re=function(){return C((function e(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};U(this,e),this._app=t,this._maxBytes=i.maxBytes||67108864,this._cache=new Map,this._totalBytes=0}),[{key:"publishTexture",value:(t=w(D().mark((function e(t){var i,n,a,r,o,s,l,u,c,d,h,f,p,m,g;return D().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce(t);case 2:return i=e.sent,n=i.bytes,a=i.mime,r=i.width,o=i.height,e.next=9,Ue(n);case 9:if(s=e.sent,console.log("[TextureBus] publishTexture: ref=".concat(s," bytes=").concat(n.byteLength," mime=").concat(a)),!(l=this._cache.get(s))||!0!==l.uploaded){e.next=17;break}return l.lastUseTs=Date.now(),l.refCount=(l.refCount||0)+1,console.log("[TextureBus] publishTexture: cache hit ref=".concat(s,", skip upload")),e.abrupt("return",{ref:s});case 17:if(!l||"pending"!==l.uploaded){e.next=20;break}return console.log("[TextureBus] publishTexture: upload pending ref=".concat(s,", waiting...")),e.abrupt("return",new Promise((function(e,t){l._waiters=l._waiters||[],l._waiters.push({resolve:e,reject:t,ref:s})})));case 20:return console.log("[TextureBus] publishTexture: first upload ref=".concat(s," bytes=").concat(n.byteLength)),u={refCount:1,sizeBytes:n.byteLength,lastUseTs:Date.now(),mime:a,width:r,height:o,uploaded:"pending",bytes:n,base64:null,_waiters:[]},this._cache.set(s,u),this._totalBytes+=n.byteLength,e.prev=24,e.next=27,this._sendBinaryAsset(s,n,a,r,o);case 27:console.log("[TextureBus] publishTexture: _sendBinaryAsset done ref=".concat(s)),u.uploaded=!0,c=u._waiters||[],u._waiters=[],d=T(c);try{for(d.s();!(h=d.n()).done;)(f=h.value).resolve({ref:f.ref})}catch(e){d.e(e)}finally{d.f()}e.next=43;break;case 35:e.prev=35,e.t0=e.catch(24),u.uploaded=!1,p=u._waiters||[],u._waiters=[],m=T(p);try{for(m.s();!(g=m.n()).done;)g.value.reject(e.t0)}catch(e){m.e(e)}finally{m.f()}throw e.t0;case 43:return this._evictLRUIfNeeded(),e.abrupt("return",{ref:s});case 45:case"end":return e.stop()}}),e,this,[[24,35]])}))),function(e){return t.apply(this,arguments)})},{key:"resolveRef",value:function(e){if(!e)return null;var t=this._cache.get(e);return t&&!0===t.uploaded?(t.lastUseTs=Date.now(),{ref:e}):null}},{key:"getBase64Sync",value:function(e){if(!e)return null;var t=this._cache.get(e);if(!t||!t.bytes)return null;if(t.base64)return t.base64;for(var i="",n=t.bytes,a=0;a<n.byteLength;a+=32768){var r=n.subarray(a,Math.min(a+32768,n.byteLength));i+=String.fromCharCode.apply(null,r)}var o=btoa(i),s="data:".concat(t.mime||"image/png",";base64,").concat(o);return t.base64=s,s}},{key:"markMissing",value:function(e){var t=this._cache.get(e);t&&(t.uploaded=!1)}},{key:"resetUploadState",value:function(){var e,t=T(this._cache);try{for(t.s();!(e=t.n()).done;){var i=B(e.value,2)[1];!0===i.uploaded&&(i.uploaded=!1)}}catch(e){t.e(e)}finally{t.f()}}},{key:"releaseTexture",value:function(e){var t=this._cache.get(e);t&&(t.refCount=Math.max(0,(t.refCount||1)-1))}},{key:"_sendBinaryAsset",value:(e=w(D().mark((function e(t,i,n,a,r){var o,s,l,u,c,d,h,f,p,m,g,v,y,b,x=this;return D().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=new TextEncoder,s=o.encode(t),l=o.encode(n),u=1+s.length+1+l.length+2+2+i.byteLength,c=new Uint8Array(u),d=0,c[d++]=s.length,c.set(s,d),d+=s.length,c[d++]=l.length,c.set(l,d),d+=l.length,c[d++]=255&a,c[d++]=a>>8&255,c[d++]=255&r,c[d++]=r>>8&255,c.set(i,d),h=this._app._pickDescriptorChannel(c.byteLength,{preferTexture:!0}),f=h.channel,p=h.useTexture,m=h.useBulk,g=p?"texture":m?"bulk":"main",v=this._app.dataChannelHighWatermark,y=!0===this._app.enableAckV2,e.next=23,this._app._enqueueSend(g,(function(){return x._app._sendBinaryFramedV2(le.BinaryAsset,0,2,c,f,v,g)}));case 23:if(b=e.sent,p&&this._app._v3Metrics&&(this._app._v3Metrics.textureChannelBytes+=c.byteLength),this._app.printStats,y){e.next=28;break}return e.abrupt("return");case 28:return e.prev=28,e.next=31,this._app._awaitAckV2(b,{timeoutMs:this._app._defaultAckTimeoutMs,meta:{kind:"BinaryAsset",hash:t,bytes:i.byteLength}});case 31:e.next=37;break;case 33:throw e.prev=33,e.t0=e.catch(28),console.warn("[TextureBus] BinaryAsset AckV2 failed hash=".concat(t," reason=").concat(e.t0.reason||e.t0.message)),e.t0;case 37:case"end":return e.stop()}}),e,this,[[28,33]])}))),function(t,i,n,a,r){return e.apply(this,arguments)})},{key:"_evictLRUIfNeeded",value:function(){if(!(this._totalBytes<=this._maxBytes)){var e,t=T(W(this._cache.entries()).filter((function(e){return!0===B(e,2)[1].uploaded})).sort((function(e,t){var i=B(e,2)[1],n=B(t,2)[1];return i.lastUseTs-n.lastUseTs})));try{for(t.s();!(e=t.n()).done;){var i=B(e.value,2)[1];if(this._totalBytes<=.8*this._maxBytes)break;i.uploaded=!1,i.bytes=null,i.base64=null,this._totalBytes-=i.sizeBytes}}catch(e){t.e(e)}finally{t.f()}}}}]);var e,t}(),Oe=0,Ee=new t,ze=new i,Ie=new n,Ae=new t,_e=new t,Me=new t,Le=new i,De=new t(1,0,0),Pe=new t(0,1,0),Be=new t(0,0,1),Fe={type:"added"},We={type:"removed"},je=function(){function e(){var l;U(this,e),(l=N(this,e)).isObject3D=!0,Object.defineProperty(l,"id",{value:Oe++}),l.uuid=a.generateUUID(),l.name="",l.type="Object3D",l.parent=null,l.children=[],l.up=e.DEFAULT_UP.clone();var u=new t,c=new r,d=new i,h=new t(1,1,1);return c._onChange((function(){d.setFromEuler(c,!1)})),d._onChange((function(){c.setFromQuaternion(d,void 0,!1)})),Object.defineProperties(l,{position:{configurable:!0,enumerable:!0,value:u},rotation:{configurable:!0,enumerable:!0,value:c},quaternion:{configurable:!0,enumerable:!0,value:d},scale:{configurable:!0,enumerable:!0,value:h},modelViewMatrix:{value:new n},normalMatrix:{value:new o}}),l.matrix=new n,l.matrixWorld=new n,l.matrixAutoUpdate=e.DEFAULT_MATRIX_AUTO_UPDATE,l.matrixWorldNeedsUpdate=!1,l.matrixWorldAutoUpdate=e.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,l.layers=new s,l.visible=!0,l.castShadow=!1,l.receiveShadow=!1,l.frustumCulled=!0,l.renderOrder=0,l.animations=[],l.userData={},l}return z(e,be),C(e,[{key:"onBeforeRender",value:function(){}},{key:"onAfterRender",value:function(){}},{key:"applyMatrix4",value:function(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}},{key:"applyQuaternion",value:function(e){return this.quaternion.premultiply(e),this}},{key:"setRotationFromAxisAngle",value:function(e,t){this.quaternion.setFromAxisAngle(e,t)}},{key:"setRotationFromEuler",value:function(e){this.quaternion.setFromEuler(e,!0)}},{key:"setRotationFromMatrix",value:function(e){this.quaternion.setFromRotationMatrix(e)}},{key:"setRotationFromQuaternion",value:function(e){this.quaternion.copy(e)}},{key:"rotateOnAxis",value:function(e,t){return ze.setFromAxisAngle(e,t),this.quaternion.multiply(ze),this}},{key:"rotateOnWorldAxis",value:function(e,t){return ze.setFromAxisAngle(e,t),this.quaternion.premultiply(ze),this}},{key:"rotateX",value:function(e){return this.rotateOnAxis(De,e)}},{key:"rotateY",value:function(e){return this.rotateOnAxis(Pe,e)}},{key:"rotateZ",value:function(e){return this.rotateOnAxis(Be,e)}},{key:"translateOnAxis",value:function(e,t){return Ee.copy(e).applyQuaternion(this.quaternion),this.position.add(Ee.multiplyScalar(t)),this}},{key:"translateX",value:function(e){return this.translateOnAxis(De,e)}},{key:"translateY",value:function(e){return this.translateOnAxis(Pe,e)}},{key:"translateZ",value:function(e){return this.translateOnAxis(Be,e)}},{key:"localToWorld",value:function(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}},{key:"worldToLocal",value:function(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(Ie.copy(this.matrixWorld).invert())}},{key:"lookAt",value:function(e,t,i){e.isVector3?Ae.copy(e):Ae.set(e,t,i);var n=this.parent;this.updateWorldMatrix(!0,!1),_e.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Ie.lookAt(_e,Ae,this.up):Ie.lookAt(Ae,_e,this.up),this.quaternion.setFromRotationMatrix(Ie),n&&(Ie.extractRotation(n.matrixWorld),ze.setFromRotationMatrix(Ie),this.quaternion.premultiply(ze.invert()))}},{key:"add",value:function(e){if(arguments.length>1){for(var t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return e===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",e),this):(e&&e.isObject3D?(null!==e.parent&&e.parent.remove(e),e.parent=this,this.children.push(e),e.dispatchEvent(Fe)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e),this)}},{key:"remove",value:function(e){if(arguments.length>1){for(var t=0;t<arguments.length;t++)this.remove(arguments[t]);return this}var i=this.children.indexOf(e);return-1!==i&&(e.parent=null,this.children.splice(i,1),e.dispatchEvent(We)),this}},{key:"removeFromParent",value:function(){var e=this.parent;return null!==e&&e.remove(this),this}},{key:"clear",value:function(){for(var e=0;e<this.children.length;e++){var t=this.children[e];t.parent=null,t.dispatchEvent(We)}return this.children.length=0,this}},{key:"attach",value:function(e){return this.updateWorldMatrix(!0,!1),Ie.copy(this.matrixWorld).invert(),null!==e.parent&&(e.parent.updateWorldMatrix(!0,!1),Ie.multiply(e.parent.matrixWorld)),e.applyMatrix4(Ie),this.add(e),e.updateWorldMatrix(!1,!0),this}},{key:"getObjectById",value:function(e){return this.getObjectByProperty("id",e)}},{key:"getObjectByName",value:function(e){return this.getObjectByProperty("name",e)}},{key:"getObjectByProperty",value:function(e,t){if(this[e]===t)return this;for(var i=0,n=this.children.length;i<n;i++){var a=this.children[i].getObjectByProperty(e,t);if(void 0!==a)return a}}},{key:"getObjectsByProperty",value:function(e,t){var i=[];this[e]===t&&i.push(this);for(var n=0,a=this.children.length;n<a;n++){var r=this.children[n].getObjectsByProperty(e,t);r.length>0&&(i=i.concat(r))}return i}},{key:"getWorldPosition",value:function(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}},{key:"getWorldQuaternion",value:function(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(_e,e,Me),e}},{key:"getWorldScale",value:function(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(_e,Le,e),e}},{key:"getWorldDirection",value:function(e){this.updateWorldMatrix(!0,!1);var t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}},{key:"raycast",value:function(){}},{key:"traverse",value:function(e){e(this);for(var t=this.children,i=0,n=t.length;i<n;i++)t[i].traverse(e)}},{key:"traverseVisible",value:function(e){if(!1!==this.visible){e(this);for(var t=this.children,i=0,n=t.length;i<n;i++)t[i].traverseVisible(e)}}},{key:"traverseAncestors",value:function(e){var t=this.parent;null!==t&&(e(t),t.traverseAncestors(e))}},{key:"updateMatrix",value:function(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}},{key:"updateMatrixWorld",value:function(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,e=!0);for(var t=this.children,i=0,n=t.length;i<n;i++){var a=t[i];!0!==a.matrixWorldAutoUpdate&&!0!==e||a.updateMatrixWorld(e)}}},{key:"updateWorldMatrix",value:function(e,t){var i=this.parent;if(!0===e&&null!==i&&!0===i.matrixWorldAutoUpdate&&i.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),!0===t)for(var n=this.children,a=0,r=n.length;a<r;a++){var o=n[a];!0===o.matrixWorldAutoUpdate&&o.updateWorldMatrix(!1,!0)}}},{key:"toJSON",value:function(e){var t=void 0===e||"string"==typeof e,i={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},i.metadata={version:4.5,type:"Object",generator:"Object3D.toJSON"});var n={};function a(t,i){return void 0===t[i.uuid]&&(t[i.uuid]=i.toJSON(e)),i.uuid}if(n.uuid=this.uuid,n.type=this.type,""!==this.name&&(n.name=this.name),!0===this.castShadow&&(n.castShadow=!0),!0===this.receiveShadow&&(n.receiveShadow=!0),!1===this.visible&&(n.visible=!1),!1===this.frustumCulled&&(n.frustumCulled=!1),0!==this.renderOrder&&(n.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(n.userData=this.userData),n.layers=this.layers.mask,n.matrix=this.matrix.toArray(),n.up=this.up.toArray(),!1===this.matrixAutoUpdate&&(n.matrixAutoUpdate=!1),this.isInstancedMesh&&(n.type="InstancedMesh",n.count=this.count,n.instanceMatrix=this.instanceMatrix.toJSON(),null!==this.instanceColor&&(n.instanceColor=this.instanceColor.toJSON())),this.isScene)this.background&&(this.background.isColor?n.background=this.background.toJSON():this.background.isTexture&&(n.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&!0!==this.environment.isRenderTargetTexture&&(n.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){n.geometry=a(e.geometries,this.geometry);var r=this.geometry.parameters;if(void 0!==r&&void 0!==r.shapes){var o=r.shapes;if(Array.isArray(o))for(var s=0,l=o.length;s<l;s++){var u=o[s];a(e.shapes,u)}else a(e.shapes,o)}}if(this.isSkinnedMesh&&(n.bindMode=this.bindMode,n.bindMatrix=this.bindMatrix.toArray(),void 0!==this.skeleton&&(a(e.skeletons,this.skeleton),n.skeleton=this.skeleton.uuid)),void 0!==this.material)if(Array.isArray(this.material)){for(var c=[],d=0,h=this.material.length;d<h;d++)c.push(a(e.materials,this.material[d]));n.material=c}else n.material=a(e.materials,this.material);if(this.children.length>0){n.children=[];for(var f=0;f<this.children.length;f++)n.children.push(this.children[f].toJSON(e).object)}if(this.animations.length>0){n.animations=[];for(var p=0;p<this.animations.length;p++){var m=this.animations[p];n.animations.push(a(e.animations,m))}}if(t){var g=U(e.geometries),v=U(e.materials),y=U(e.textures),b=U(e.images),x=U(e.shapes),S=U(e.skeletons),w=U(e.animations),N=U(e.nodes);g.length>0&&(i.geometries=g),v.length>0&&(i.materials=v),y.length>0&&(i.textures=y),b.length>0&&(i.images=b),x.length>0&&(i.shapes=x),S.length>0&&(i.skeletons=S),w.length>0&&(i.animations=w),N.length>0&&(i.nodes=N)}return i.object=n,i;function U(e){var t=[];for(var i in e){var n=e[i];delete n.metadata,t.push(n)}return t}}},{key:"clone",value:function(e){return(new this.constructor).copy(this,e)}},{key:"copy",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.userData=JSON.parse(JSON.stringify(e.userData)),!0===t)for(var i=0;i<e.children.length;i++){var n=e.children[i];this.add(n.clone())}return this}}])}();je.DEFAULT_UP=new t(0,1,0),je.DEFAULT_MATRIX_AUTO_UPDATE=!0,je.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;var He=function(){function e(){var t;return U(this,e),(t=N(this,e)).isScene=!0,t.type="Scene",t.background=null,t.environment=null,t.fog=null,t.childrenSet=new Set,t.backgroundBlurriness=0,t.backgroundIntensity=1,t.overrideMaterial=null,t}return z(e,je),C(e,[{key:"copy",value:function(t,i){return F(e,"copy",this)([t,i]),null!==t.background&&(this.background=t.background.clone()),null!==t.environment&&(this.environment=t.environment.clone()),null!==t.fog&&(this.fog=t.fog.clone()),this.backgroundBlurriness=t.backgroundBlurriness,this.backgroundIntensity=t.backgroundIntensity,null!==t.overrideMaterial&&(this.overrideMaterial=t.overrideMaterial.clone()),this.matrixAutoUpdate=t.matrixAutoUpdate,this}},{key:"toJSON",value:function(t){var i=F(e,"toJSON",this)([t]);return null!==this.fog&&(i.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(i.backgroundBlurriness=this.backgroundBlurriness),1!==this.backgroundIntensity&&(i.backgroundIntensity=this.backgroundIntensity),i}},{key:"autoUpdate",get:function(){return console.warn("THREE.Scene: autoUpdate was renamed to matrixWorldAutoUpdate in r144."),this.matrixWorldAutoUpdate},set:function(e){console.warn("THREE.Scene: autoUpdate was renamed to matrixWorldAutoUpdate in r144."),this.matrixWorldAutoUpdate=e}}])}(),Ge=function(){function e(){var i;U(this,e),(i=N(this,e)).isCamera=!0,i.type="Camera",i.matrixWorldInverse=new n,i._level=0,i._levelChange=0,i.projectionMatrix=new n,i.projectionMatrixInverse=new n;var a=new t,r=-9999,o=-9999,s=-9999,l=-180,u=180,c=-89,d=0,h=-9999,f=-9999;return i.needsUpdate=!1,i.worldLocation=new t,i.sphereLocation=new t,i.constrainPolygon=[],Object.defineProperties(i,{minLocation:{configurable:!0,enumerable:!0,get:function(){return a},set:function(e){e&&(a.x=e.x,a.y=e.y,a.z=e.z,i.needsUpdate=!0)}},maxLocationX:{configurable:!0,enumerable:!0,get:function(){return r},set:function(e){e&&(r=e,i.needsUpdate=!0)}},maxLocationY:{configurable:!0,enumerable:!0,get:function(){return o},set:function(e){e&&(o=e,i.needsUpdate=!0)}},maxLocationZ:{configurable:!0,enumerable:!0,get:function(){return s},set:function(e){e&&(s=e,i.needsUpdate=!0)}},minYaw:{configurable:!0,enumerable:!0,get:function(){return l},set:function(e){void 0!==e&&(l=e,i.needsUpdate=!0)}},maxYaw:{configurable:!0,enumerable:!0,get:function(){return u},set:function(e){void 0!==e&&(u=e,i.needsUpdate=!0)}},minPitch:{configurable:!0,enumerable:!0,get:function(){return c},set:function(e){void 0!==e&&(c=e,i.needsUpdate=!0)}},maxPitch:{configurable:!0,enumerable:!0,get:function(){return d},set:function(e){void 0!==e&&(d=e,i.needsUpdate=!0)}},minSpringArm:{configurable:!0,enumerable:!0,get:function(){return h},set:function(e){void 0!==e&&(h=e,i.needsUpdate=!0)}},maxSpringArm:{configurable:!0,enumerable:!0,get:function(){return f},set:function(e){void 0!==e&&(f=e,i.needsUpdate=!0)}},name:{configurable:!1,enumerable:!0,value:name}}),i}return z(e,je),C(e,[{key:"level",get:function(){return this._level},set:function(e){var t=Math.floor(e);this._levelChange=this._level-t,this._level=t}},{key:"copy",value:function(t,i){return F(e,"copy",this)([t,i]),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this}},{key:"getWorldDirection",value:function(e){this.updateWorldMatrix(!0,!1);var t=this.matrixWorld.elements;return e.set(-t[8],-t[9],-t[10]).normalize()}},{key:"updateMatrixWorld",value:function(t){F(e,"updateMatrixWorld",this)([t]),this.matrixWorldInverse.copy(this.matrixWorld).invert()}},{key:"updateWorldMatrix",value:function(t,i){F(e,"updateWorldMatrix",this)([t,i]),this.matrixWorldInverse.copy(this.matrixWorld).invert()}},{key:"setConstrainPolygon",value:function(e){var t=this;e&&e.length>2&&(this.constrainPolygon=[],e.forEach((function(e,i){t.constrainPolygon.push({x:e[0],y:e[1]})})),this.constrainHeight=-1,this.needsUpdate=!0,this.constrainPolygonNeedsUpdate=!0)}},{key:"setConstrainShape",value:function(e,t){var i=this;t&&t.length>2&&(this.constrainPolygon=[],t.forEach((function(e,t){i.constrainPolygon.push({x:e[0],y:e[1],z:e[2]})})),this.constrainHeight=e,this.needsUpdate=!0,this.constrainShapeNeedsUpdate=!0)}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"toJSON",value:function(){return{shape:this.constrainPolygon&&this.constrainPolygon.length?this.constrainPolygon:null,ConstrainHeight:void 0===this.constrainHeight?-1:this.constrainHeight,MaxLocationX:this.maxLocationX,MaxLocationY:this.maxLocationY,MaxLocationZ:this.maxLocationZ,MinYaw:this.minYaw,MaxYaw:this.maxYaw,MinPitch:this.minPitch,MaxPitch:this.maxPitch,MinSpringArm:this.minSpringArm,MaxSpringArm:this.maxSpringArm,type:this.type,name:this.name,uuid:this.uuid}}}])}(),Ve=function(e){return e.flat(1/0)},Je=function(e){if(!Array.isArray(e))throw new Error("Input must be an array");return e.map((function(e){return parseInt(e,10)}))};function qe(e,t){var i=e[0],n=e[1],a=t[0],r=t[1];return Math.sqrt((i-a)*(i-a)+(n-r)*(n-r))}function Ye(e,t,i){var n=Math.abs(qe(e,t)),a=Math.abs(qe(e,i)),r=Math.abs(qe(t,i)),o=(n+a+r)/2;return 2*Math.sqrt(Math.abs(o*(o-n)*(o-a)*(o-r)))/n}function Ke(e,t,i,n,a){if(i<n){for(var r=0,o=0,s=e[i],l=e[n],u=i+1;u<n;u++){var c=Ye(s,l,e[u]);c>r&&(r=c,o=u)}r>=a&&(t.push(e[o]),Ke(e,t,i,o,a),Ke(e,t,o,n,a))}return t}function Xe(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;if(!(e&&e.length>2))return null;e.forEach((function(e,t){e.id=t}));var n=Ke(e,[],0,e.length-i,t);n.push(e[0]),n.push(e[e.length-1]);var a=n.sort((function(e,t){return e.id<t.id?-1:e.id>t.id?1:0}));return a.forEach((function(e){e.id=0})),a}var Qe=["properties"];function Ze(e,t){if(null==e)return!0;switch(t){case"number":return"number"==typeof e&&Number.isFinite(e);case"string":return"string"==typeof e;case"enum":return"string"==typeof e||"number"==typeof e||"boolean"==typeof e;default:return!1}}function $e(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=t.columnSchema,n=void 0===i?null:i,a=t.autoDetect,r=void 0===a||a,o=t.minFeatures,s=void 0===o?50:o,l=t.autoDetectRatio,u=void 0===l?.2:l,c=t.sampleSize,d=void 0===c?200:c;if(!Array.isArray(e)||e.length<s)return null;var h={};if(n&&"object"===G(n))for(var f=0,p=Object.entries(n);f<p.length;f++){var m=B(p[f],2),g=m[0],v=m[1];v&&("string"==typeof v?h[g]={type:v}:"object"===G(v)&&v.type&&(h[g]=_({},v)))}var y=r?function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=t.sampleSize,n=void 0===i?200:i,a=t.autoDetectRatio,r=void 0===a?.2:a,o={};if(!e.length)return o;var s,l=e.slice(0,Math.min(n,e.length)),u=Object.create(null),c=T(l);try{for(c.s();!(s=c.n()).done;){var d=s.value,h=d&&d.properties;if(h)for(var f=0,p=Object.keys(h);f<p.length;f++){var m=p[f],g=h[m];u[m]||(u[m]={values:new Set,numeric:!0,string:!0,complex:!1,present:0});var v=u[m];v.present++,null!=g&&("number"==typeof g?v.string=!1:"string"==typeof g?v.numeric=!1:"boolean"==typeof g?(v.numeric=!1,v.string=!1):v.complex=!0,v.values.size<512&&v.values.add(g))}}}catch(e){c.e(e)}finally{c.f()}for(var y=0,b=Object.keys(u);y<b.length;y++){var x=b[y],S=u[x];if(!S.complex)if(S.numeric)o[x]={type:"number"};else if(S.string){var w=S.values.size,N=w/Math.max(1,S.present);o[x]=w<=64||N<=r?{type:"enum"}:{type:"string"}}else o[x]={type:"enum"}}return o}(e,{sampleSize:d,autoDetectRatio:u}):{},b=_(_({},y),h),x=new Set(Object.keys(b)),S=Object.keys(b);if(!S.length)return null;for(var w=Object.create(null),N=Object.create(null),U=0,k=S;U<k.length;U++){var C=k[U];w[C]=new Array(e.length),"enum"===b[C].type&&(N[C]=new Map)}for(var R=new Array(e.length),O=0;O<e.length;O++){for(var E=e[O]||{},z=E&&E.properties||{},I={},A=!1,L=0,D=Object.keys(z);L<D.length;L++){var P=D[L];x.has(P)||(I[P]=z[P],A=!0)}var F,W=T(S);try{for(W.s();!(F=W.n()).done;){var j=F.value,H=z[j],V=b[j];if(Ze(H,V.type))if("enum"===V.type){if(null==H){w[j][O]=null;continue}var J=N[j],q=J.get(H);void 0===q&&(q=J.size,J.set(H,q)),w[j][O]=q}else w[j][O]=void 0===H?null:H;else w[j][O]=null,void 0!==H&&(I[j]=H,A=!0)}}catch(e){W.e(e)}finally{W.f()}E.properties;var Y=_({type:"Feature"},M(E,Qe));A&&(Y.properties=I),R[O]=Y}for(var K=Object.create(null),X=0,Q=S;X<Q.length;X++){var Z=Q[X],$=b[Z];if("enum"===$.type){var ee,te=new Array(N[Z].size),ie=T(N[Z]);try{for(ie.s();!(ee=ie.n()).done;){var ne=B(ee.value,2),ae=ne[0];te[ne[1]]=ae}}catch(e){ie.e(e)}finally{ie.f()}K[Z]={type:"enum",dict:te}}else K[Z]={type:$.type}}return{__cs:1,count:e.length,fields:K,columns:w,features:R}}function et(e){if(!e)return[];var t=null;return t=e.features?e.features:Array.isArray(e)?e:[e],JSON.parse(JSON.stringify(t))}function tt(e){var t=[],i=null,n=null;return et(e).forEach((function(e){var a,r;at(null==e||null===(a=e.geometry)||void 0===a?void 0:a.coordinates,2),i=g.flatten(null==e||null===(r=e.geometry)||void 0===r?void 0:r.coordinates),n=g(i.vertices,i.holes,i.dimensions);var o=function(e){for(var t=1/0,i=1/0,n=-1/0,a=-1/0,r=[],o=0;o<e.length/3;o++){var s=e[3*o],l=e[3*o+1];t>s&&(t=s),i>l&&(i=l),n<s&&(n=s),a<l&&(a=l)}for(var u=1/(n-t),c=1/(a-i),d=0;d<e.length/3;d++){var h=u*(e[3*d]-t),f=c*(e[3*d+1]-i);r.push({x:h,y:f})}return r}(i.vertices);t.push({vertices:i.vertices,triangles:n,uvs:o})})),t}function it(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=i.enableDP,a=void 0===n||n,r=i.dpThreshold,o=void 0===r?1e-5:r,s=i.dpMinPoints,l=void 0===s?100:s,u=i.enableColumnStore,c=void 0!==u&&u,d=i.columnSchema,h=i.autoDetect,f=void 0===h||h,p=i.minFeatures,m=et(e);if(m.forEach((function(e){var i,n=null==e||null===(i=e.geometry)||void 0===i?void 0:i.coordinates;if(at(n,1),a&&o>0&&Array.isArray(n)&&n.length>l){var r=n[0],s=n[n.length-1],u=r&&s&&r[0]===s[0]&&r[1]===s[1]&&r[2]===s[2];n=Xe(n,o,u?2:1),e.geometry.coordinates=n}e.geometry.coordinates=Ve(n),t&&(e.geometry.coordinates.push(e.geometry.coordinates[0]),e.geometry.coordinates.push(e.geometry.coordinates[1]),e.geometry.coordinates.push(e.geometry.coordinates[2]))})),c){var g=$e(m,_({columnSchema:d,autoDetect:f},void 0!==p?{minFeatures:p}:{}));if(g)return g}return m}function nt(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=t.enableColumnStore,n=void 0!==i&&i,a=t.columnSchema,r=t.autoDetect,o=void 0===r||r,s=t.minFeatures,l=et(e);if(l.forEach((function(e){var t,i=null==e||null===(t=e.geometry)||void 0===t?void 0:t.coordinates;!function(e){e.type||(e.type="Feature");var t=e.geometry.type,i={Point:0,MultiPoint:1,LineString:1,MultiLineString:2,Polygon:2,MultiPolygon:3};Object.keys(i).includes(t)&&at(e.geometry.coordinates,i[t])}(e),e.geometry.coordinates=Ve(i)})),n){var u=$e(l,_({columnSchema:a,autoDetect:o},void 0!==s?{minFeatures:s}:{}));if(u)return u}return l}var at=function(e,t){if(e)if(0===t)e[2]||(e[2]=0);else{var i,n=T(e);try{for(n.s();!(i=n.n()).done;){var a=i.value;at(a,t-1)}}catch(e){n.e(e)}finally{n.f()}}};var rt=new l;function ot(e,t){rt.load(e,(function(e){var i=new FileReader;i.readAsDataURL(e),i.onloadend=function(e){t(e.target.result)}}),null,(function(e){t(!1)}))}function st(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"image/png";return e.toDataURL(t)}function lt(e){return-1!==e.indexOf("data:")&&-1!==e.indexOf("base64")}function ut(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"https://mapdata.bj.bcebos.com",i=new Image;return i.crossOrigin="Anonymous",i.src=t+e,new Promise((function(e,t){i.addEventListener("load",(function(){e(i)})),i.onerror=function(e){t(e)}}))}function ct(e,t,i,n,a,r){e.beginPath(),e.moveTo(t+r,i),e.lineTo(t+n-r,i),e.quadraticCurveTo(t+n,i,t+n,i+r),e.lineTo(t+n,i+a-r),e.quadraticCurveTo(t+n,i+a,t+n-r,i+a),e.lineTo(t+r,i+a),e.quadraticCurveTo(t,i+a,t,i+a-r),e.lineTo(t,i+r),e.quadraticCurveTo(t,i,t+r,i),e.closePath()}function dt(e,t,i,n){var a,r=i.xScale,o=B(n,2),s=o[0],l=o[1],u=t.text,c=t.fontSize,d=t.fontFamily,h=t.color,f=t.textAlign,p=t.icon;if(u||"number"==typeof u||p)if(u&&p)console.warn("BasicLabel Warning:text和icon不要同时设置");else{if(a=u,e.font="".concat(c*r,"px ").concat(d),e.fillStyle=h,e.textAlign=f||"left",e.textBaseline="top",p){var m=p;-1!==p.indexOf("&amp;")&&(m=p.replace("&amp;","&")),-1!==p.indexOf("&amp")&&(m=p.replace("&amp","&")),a=new Function('return ("'+"".concat(m).replace("&#x","\\u").replace(";","")+'")')()}e.measureText(a).width,e.fillText(a,s,l)}}function ht(e,t){return ft.apply(this,arguments)}function ft(){return(ft=w(D().mark((function e(t,i){var n,r,o,s,l,u,c,d,h,f,p,m,g,v,y,b,x;return D().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.height,r=t.width,o=t.backgroundImage,s=t.borderRadius,l=t.borderColor,u=t.borderWidth,c=t.backgroundColor,d=r,h=n,f=document.createElement("canvas"),p=f.getContext("2d"),m=a.ceilPowerOfTwo(d),g={width:m,height:m*(h/d),factor:{xScale:m/d,yScale:m/d}},f.width=g.width,f.height=g.height,v=g.factor,y=v.xScale,b=v.yScale,!o){e.next=17;break}return e.next=13,ut(o,"");case 13:x=e.sent,p.drawImage(x,0,0,d*y,h*b),e.next=18;break;case 17:(l||c)&&(p.strokeStyle=l,p.fillStyle=c,p.lineWidth=u?u*y:1*y,ct(p,p.lineWidth*y,p.lineWidth*b,(d-2*p.lineWidth)*y,(h-2*p.lineWidth)*b,s?s*y:0),c&&p.fill(),l&&p.stroke());case 18:return i&&pt(p,g,i),e.abrupt("return",f);case 20:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function pt(e,t,i){return mt.apply(this,arguments)}function mt(){return mt=w(D().mark((function e(t,i,n){var a,r,o,s,l,u,c,d,h,f,p,m,g,v,y,b,x,S,w,N,U,k,C,T,R,O,E,z,I,A,_,M,L,P,F,W,j,H,G;return D().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a=i.paddingTop,r=i.paddingLeft,o=i.width,i.height,s=0,l=0,u=0,c=0,d=i.factor,h=d.xScale,f=d.yScale,g=[p=r?r*h:0,m=a?a*f:0],v=Object.keys(n),y=0;case 11:if(!(y<v.length)){e.next=41;break}if(b=n[v[y]],x=b.width,S=b.height,w=b.text,N=b.marginRight,U=b.marginBottom,k=b.backgroundImage,C=b.borderRadius,T=b.borderColor,R=b.borderWidth,O=b.backgroundColor,E=b.position,b.id,E&&(z=B(E,2),I=z[0],A=z[1],g[0]=p+I*h,g[1]=m+A*f,s=0,l=0,u=0,c=0),!x||!S){e.next=37;break}if(g[0]+x*h>o&&((u+=s)+S*f<=l?(g[0]=c,g[1]+=s):(g[0]=r?r*h:0,g[1]+=s,l=0,c=0)),!k){e.next=30;break}return e.prev=18,e.next=21,ut(k,"");case 21:_=e.sent,t.drawImage(_,g[0],g[1],x*h,S*f),e.next=28;break;case 25:e.prev=25,e.t0=e.catch(18),console.log(e.t0);case 28:e.next=31;break;case 30:O&&(t.strokeStyle=T,t.fillStyle=O,t.lineWidth=R?R*h:1*h,ct(b,g[0]+b.lineWidth*h,g[1]+b.lineWidth*h,(x-2*b.lineWidth)*h,(S-2*b.lineWidth)*f,C?C*h:0),O&&t.fill(),T&&t.stroke());case 31:w&&(M=B(E,2),L=M[0],P=M[1],F=[g[0]+L*h,g[1]+P*f],dt(t,b,i.factor,F)),g[0]+=(x+(N||0))*h,(s=(S+(U||0))*f)>l&&(l=s,c=g[0]),e.next=38;break;case 37:w&&(W=B(E,2),j=W[0],H=W[1],G=[g[0]+j*h,g[1]+H*f],dt(t,b,i.factor,G));case 38:y++,e.next=11;break;case 41:case"end":return e.stop()}}),e,null,[[18,25]])}))),mt.apply(this,arguments)}function gt(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e)return!1;var i=document.createElement("canvas"),n=i.getContext("2d"),a=t.scale||1,r=t.fontSize||18,o=t.fontface||"Arial",s=t.borderThickness||0,l=t.backgroundColor||{r:0,g:0,b:0,a:1},u=t.borderColor||{r:0,g:0,b:0,a:1},c=t.strokeStyle||{r:255,g:0,b:0,a:1},d=t.textColor||{r:255,g:0,b:0,a:1};n.font="Bold "+r*a+"px "+o;var h=n.measureText(e).width*a,f=h+2*s*a,p=r*a*1.4+2*s*a;i.width=t.width||f,i.height=t.height||p,n.font="Bold "+r*a+"px "+o;var m=l.r,g=l.g,v=l.b,y=l.a;if(n.fillStyle="rgba("+m+","+g+","+v+","+y+")",n.fillRect(0,0,i.width,i.height),t.drawRoundRect){var b=u.r,x=u.g,S=u.b,w=u.a;n.strokeStyle="rgba("+b+","+x+","+S+","+w+")",n.lineWidth=s*a,ct(n,s/2,s/2,h+s+10*a,r*a*1.4+s,6)}if(n.fill(),n.stroke(),t.drawStrokeStyle){var N=c.r,U=c.g,k=c.b,C=c.a;n.strokeStyle="rgba("+N+","+U+","+k+","+C+")",n.strokeText(e,(s+5)*a+.5*(i.width-f),.5*(i.height-p)+(r+s)*a)}var T=d.r,R=d.g,O=d.b,E=d.a;return n.fillStyle="rgba("+T+","+R+","+O+","+E+")",n.fillText(e,(s+5)*a+.5*(i.width-f),.5*(i.height-p)+(r+s)*a),i}rt.setResponseType("blob");var vt=function(){function e(){var n,o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};U(this,e),n=N(this,e,[o]);var s=o.name,l=new u(1,1,1);o.color&&(l.r=a.clamp(o.color.r,0,1),l.g=a.clamp(o.color.g,0,1),l.b=a.clamp(o.color.b,0,1));var c=new u(1,1,1);o.color2?(c.r=a.clamp(o.color2.r,0,1),c.g=a.clamp(o.color2.g,0,1),c.b=a.clamp(o.color2.b,0,1)):(c.r=l.r,c.g=l.g,c.b=l.b);var d=void 0===o.size?10:o.size,h=void 0===o.sizeAttenuation||o.sizeAttenuation,f=void 0===o.gardientDirection?1:o.gardientDirection,p=void 0===o.brightness?0:o.brightness,m=void 0===o.scroll?0:o.scroll,g=n.childIndex=-1,v=void 0===o.speed?.2:o.speed,y=void 0===o.roughness?1:o.roughness,b=void 0===o.metallic?0:o.metallic;n.map=o.map||null;var x=void 0===o.opacity?1:o.opacity,S=void 0===o.uvRotateSpeed?0:o.uvRotateSpeed,w=void 0===o.WPOScaleAnimateSpeed?0:o.WPOScaleAnimateSpeed,k=void 0===o.WPOMinAnimateScale?1:o.WPOMinAnimateScale,C=void 0===o.WPOMaxAnimateScale?2:o.WPOMaxAnimateScale,T=new u(1,1,1);o.brightnessColor&&(T.r=a.clamp(o.brightnessColor.r,0,1),T.g=a.clamp(o.brightnessColor.g,0,1),T.b=a.clamp(o.brightnessColor.b,0,1));var R=o.position||new t,O=new r;o.rotation&&(O.x=a.clamp(o.rotation.x,-180,180),O.y=a.clamp(o.rotation.y,-180,180),O.z=a.clamp(o.rotation.z,-180,180));var E=new i,z=new t(1,1,1);o.scale&&(z.x=o.scale.x,z.y=o.scale.y,z.z=o.scale.z);var I=new t(0,0,0);if(o.offset&&(I.x=o.offset.x,I.y=o.offset.y,I.z=o.offset.z),n.isInstance=o.isInstance||!1,n.transparent=o.transparent||x<1,n.depthTest=!("depthTest"in o)||o.depthTest,n.renderNum=void 0===o.renderNum?20:o.renderNum,n._visible=void 0===o.visible||o.visible,O._onChange((function(){E.setFromEuler(O,!1),this.matrixNeedsUpdate=!0})),E._onChange((function(){O.setFromQuaternion(E,void 0,!1),this.matrixNeedsUpdate=!0})),Object.defineProperties(n,{position:{configurable:!0,enumerable:!0,get:function(){return R},set:function(e){e&&(R.x=e.x,R.y=e.y,R.z=e.z,n.matrixNeedsUpdate=!0)}},childIndex:{configurable:!0,enumerable:!0,get:function(){return g},set:function(e){e!==g&&(g=e)}},rotation:{configurable:!0,enumerable:!0,get:function(){return O},set:function(e){e&&(O.x=a.clamp(e.x,-180,180),O.y=a.clamp(e.y,-180,180),O.z=a.clamp(e.z,-180,180),n.matrixNeedsUpdate=!0)}},quaternion:{writable:!0,configurable:!0,value:E,enumerable:!0},scale:{configurable:!0,enumerable:!0,get:function(){return z},set:function(e){e&&(z.x=e.x,z.y=e.y,z.z=e.z,n.matrixNeedsUpdate=!0)}},offset:{configurable:!0,enumerable:!0,get:function(){return I},set:function(e){e&&(I.x=e.x,I.y=e.y,I.z=e.z,n.matrixNeedsUpdate=!0)}},color:{configurable:!0,enumerable:!0,get:function(){return l},set:function(e){e&&(l.r=e.r,l.g=e.g,l.b=e.b,e.a&&(x=e.a),n.overtimeInstanceIndex=[],n.data=[],n.materialNeedsUpdate=!0)}},color2:{configurable:!0,enumerable:!0,get:function(){return c},set:function(e){e&&(c.r=e.r,c.g=e.g,c.b=e.b,e.a&&(x=e.a),n.overtimeInstanceIndex=[],n.data=[],n.materialNeedsUpdate=!0)}},gardientDirection:{configurable:!0,enumerable:!0,get:function(){return f},set:function(e){void 0!==e&&(f=e,n.overtimeInstanceIndex=[],n.data=[],n.materialNeedsUpdate=!0)}},scroll:{configurable:!0,enumerable:!0,get:function(){return m},set:function(e){void 0!==e&&(m=e,n.overtimeInstanceIndex=[],n.data=[],n.materialNeedsUpdate=!0)}},uvRotateSpeed:{configurable:!0,enumerable:!0,get:function(){return S},set:function(e){void 0!==e&&(S=e,n.overtimeInstanceIndex=[],n.data=[],n.materialNeedsUpdate=!0)}},WPOMaxAnimateScale:{configurable:!0,enumerable:!0,get:function(){return C},set:function(e){void 0!==e&&(C=e,n.overtimeInstanceIndex=[],n.data=[],n.materialNeedsUpdate=!0)}},WPOMinAnimateScale:{configurable:!0,enumerable:!0,get:function(){return k},set:function(e){void 0!==e&&(k=e,n.overtimeInstanceIndex=[],n.data=[],n.materialNeedsUpdate=!0)}},WPOScaleAnimateSpeed:{configurable:!0,enumerable:!0,get:function(){return w},set:function(e){void 0!==e&&(w=e,n.overtimeInstanceIndex=[],n.data=[],n.materialNeedsUpdate=!0)}},speed:{configurable:!0,enumerable:!0,get:function(){return v},set:function(e){void 0!==e&&(v=e,n.overtimeInstanceIndex=[],n.data=[],n.materialNeedsUpdate=!0)}},brightness:{configurable:!0,enumerable:!0,get:function(){return p},set:function(e){void 0!==e&&(p=e,n.overtimeInstanceIndex=[],n.data=[],n.materialNeedsUpdate=!0)}},roughness:{configurable:!0,enumerable:!0,get:function(){return y},set:function(e){y=e,n.overtimeInstanceIndex=[],n.data=[],n.materialNeedsUpdate=!0}},metallic:{configurable:!0,enumerable:!0,get:function(){return b},set:function(e){b=e,n.overtimeInstanceIndex=[],n.data=[],n.materialNeedsUpdate=!0}},opacity:{configurable:!0,enumerable:!0,get:function(){return x},set:function(e){n.transparent=e<1,x=e,n.overtimeInstanceIndex=[],n.data=[],n.materialNeedsUpdate=!0}},brightnessColor:{configurable:!0,enumerable:!0,get:function(){return T},set:function(e){e&&(T.copy(e),n.overtimeInstanceIndex=[],n.data=[],n.materialNeedsUpdate=!0)}},_layerName:{configurable:!1,enumerable:!1,value:"CommonGISLayer",writable:!0},_cloudControlType:{configurable:!1,enumerable:!1,value:"Gis",writable:!0},type:{configurable:!1,enumerable:!0,value:"Shape",writable:!0},name:{configurable:!1,enumerable:!0,value:s,writable:!0},size:{configurable:!0,enumerable:!0,get:function(){return d},set:function(e){void 0!==e&&(d=e,n.overtimeInstanceIndex=[],n.materialNeedsUpdate=!0)}},sizeAttenuation:{configurable:!0,enumerable:!0,get:function(){return h},set:function(e){void 0!==e&&(h=e,n.overtimeInstanceIndex=[],n.data=[],n.materialNeedsUpdate=!0)}}}),o.data){var A={};void 0!==o.enableColumnStore&&(A.enableColumnStore=o.enableColumnStore),void 0!==o.columnSchema&&(A.columnSchema=o.columnSchema),void 0!==o.columnStoreAutoDetect&&(A.autoDetect=o.columnStoreAutoDetect),void 0!==o.columnStoreMinFeatures&&(A.minFeatures=o.columnStoreMinFeatures),n.setData(o.data,A)}else n._columnStoreDefaults={},void 0!==o.enableColumnStore&&(n._columnStoreDefaults.enableColumnStore=o.enableColumnStore),void 0!==o.columnSchema&&(n._columnStoreDefaults.columnSchema=o.columnSchema),void 0!==o.columnStoreAutoDetect&&(n._columnStoreDefaults.autoDetect=o.columnStoreAutoDetect),void 0!==o.columnStoreMinFeatures&&(n._columnStoreDefaults.minFeatures=o.columnStoreMinFeatures);return n.matrixNeedsUpdate=!1,n.materialNeedsUpdate=!1,n.visibleNeedsUpdate=!1,n.animateNeedsUpdate=!1,n}return z(e,je),C(e,[{key:"visible",get:function(){return this._visible},set:function(e){void 0===this._visible&&(this._visible=!0),this.visibleNeedsUpdate=!0,this._visible=e&&!0}},{key:"map",get:function(){return this._map},set:function(e){var t=this;if(e){this._map=e;var i=function(e){var i,n;t.texture=e,t.overtimeInstanceIndex=[],t.data=[];var a=null===(i=t.parent)||void 0===i||null===(n=i.engine)||void 0===n?void 0:n.textureBus;a?a.publishTexture(e).then((function(e){var i=e.ref;t.textureRef=i,t.materialNeedsUpdate=!0})).catch((function(e){console.warn("[Shape] publishTexture failed, fallback to base64",e),t.materialNeedsUpdate=!0})):t.materialNeedsUpdate=!0};lt(e)?i(e):ot(e,(function(e){e&&i(e)}))}}},{key:"animate",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!e.to)return!1;var t=e.from,i=void 0===t?{}:t,n=e.to,a=void 0===n?{}:n,r=e.duration,o=void 0===r?3e3:r,s=e.easing,l=void 0===s?"Linear":s,u=e.loop,c=void 0!==u&&u,d=e.yoyo,h=void 0!==d&&d,f=e.stayEnd,p=void 0===f||f;i.position||delete i.position,i.rotation||delete i.rotation,i.scale||delete i.scale,a.position||delete a.position,a.rotation||delete a.rotation,a.scale||delete a.scale,a.animateOffset||delete a.animateOffset,this.animateNeedsUpdate=!0,this.animateJson={Status:"play",From:i,To:a,Duration:o,Easing:l,Loop:c,Yoyo:h,StayEnd:p};var m=new v.Tween({ratio:0}).to({ratio:1},e.duration||3e3).start();return c&&m.repeat(1/0),this.tween=null,this.tween=m,this.tween}},{key:"stopAnimate",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1e3;this.animateNeedsUpdate=!0,this.animateJson={Status:"stop",DelayTime:e},this.tween&&this.tween.stop(),this.tween=null}},{key:"setData",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e)return this.data=null,this._rawGeoJson=null,void(this._dataDirty=!1);this._columnStoreOptions=_(_({},this._columnStoreDefaults||{}),t||{});var i=et(e);if(i.length<1)return!1;var n=i[0].geometry.type.toLowerCase();if(this.isInstance&&["point","multipoint"].indexOf(n)<0)return!1;if(this._geometryType=n,this.isInstance){var a=nt(i),r=function(e,t){if(!e||e.length<1)return{data:t,datas:t,overtimeInstanceIndex:[]};for(var i=[],n=[],a=[],r=[],o=0;o<e.length;o++){for(var s,l=e[o],u=l.geometry,c=l.properties,d=void 0===c?{}:c,h=u.coordinates,f=d.rotation,p=void 0===f?{x:0,y:0,z:0}:f,m=d.scale,g=void 0===m?{x:1,y:1,z:1}:m,v=!1,y=function(){var e=t[b],n=e.geometry,a=e.properties,o=void 0===a?{}:a,s=n.coordinates,l=o.rotation,u=void 0===l?{x:0,y:0,z:0}:l,c=o.scale,d=void 0===c?{x:1,y:1,z:1}:c;return h.length===s.length&&h.every((function(e,t){return e===s[t]}))?p.x!==u.x||p.y!==u.y||p.z!==u.z||g.x!==d.x||g.y!==d.y||g.z!==d.z||i.indexOf(b)>-1?0:(i.push(b),v=!0,r.push(t[b]),1):0},b=0;b<t.length&&(0===(s=y())||1!==s);b++);v||n.push(o)}for(var x=0;x<t.length;x++)i.indexOf(x)<0&&(a.push(t[x]),r.push(t[x]));return{data:a,overtimeInstanceIndex:n,datas:r}}(this.datas,a),o=r.data,s=r.overtimeInstanceIndex,l=r.datas;return(o.length>0||s.length>0)&&(this.datas=l,this.data=o,this.overtimeInstanceIndex=s,this.materialNeedsUpdate=!0),void(this._dataDirty=!1)}this._rawGeoJson=e,this._dataDirty=!0,this.data=null}},{key:"_resolveJsonData",value:function(){var e;if(!this._dataDirty)return this.data;if(!this._rawGeoJson)return this.data;var t,i=null===(e=this.parent)||void 0===e?void 0:e.engine,n=this._columnStoreOptions||{},a=_({enableColumnStore:void 0!==n.enableColumnStore?n.enableColumnStore:!(null==i||!i.enablePropertyColumnar),columnSchema:n.columnSchema||(null==i?void 0:i.propertyColumnSchema)||void 0,autoDetect:!1!==n.autoDetect},void 0!==n.minFeatures?{minFeatures:n.minFeatures}:{});switch(this._geometryType){case"point":case"multipoint":t=nt(this._rawGeoJson,_(_({},a),this._getPointEncodeOptions()));break;case"linestring":case"multilinestring":t=it(this._rawGeoJson,!1,_(_({},a),this._getLineEncodeOptions()));break;case"polygon":case"multipolygon":t=tt(this._rawGeoJson);break;default:t=null}return this.data=t,this._dataDirty=!1,this.data}},{key:"_getLineEncodeOptions",value:function(){return{}}},{key:"_getPointEncodeOptions",value:function(){return{}}},{key:"toJSON",value:function(){var e,t,i,n,a=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return!this.visibleNeedsUpdate||!a||this.visible&&this.materialNeedsUpdate?{Color:{r:this.color.r,g:this.color.g,b:this.color.b,a:this.opacity},Brightness:this.brightness,Metallic:this.metallic,Roughness:this.roughness,Opacity:this.opacity,Transparent:this.transparent,DepthTest:this.depthTest,Scroll:this.scroll,Speed:this.speed,Texture:null!==(e=this.parent)&&void 0!==e&&null!==(t=e.engine)&&void 0!==t&&t.enableTextureBus&&this.textureRef?null:this.texture,TextureRef:null!==(i=this.parent)&&void 0!==i&&null!==(n=i.engine)&&void 0!==n&&n.enableTextureBus&&this.textureRef?this.textureRef:null,GardientDirection:this.gardientDirection,RotateSpeed:this.uvRotateSpeed,ScaleAnimateSpeed:this.WPOScaleAnimateSpeed,MinAnimateScale:this.WPOMinAnimateScale,MaxAnimateScale:this.WPOMaxAnimateScale,Color2:{r:this.color2.r,g:this.color2.g,b:this.color2.b,a:this.opacity},BrightnessColor:this.brightnessColor?{r:this.brightnessColor.r,g:this.brightnessColor.g,b:this.brightnessColor.b,a:1}:u,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,animateNeedsUpdate:!this.isInstance&&this.animateNeedsUpdate,visible:this.visible,type:this.type,name:this.name,uuid:this.uuid,jsondata:!a||this.isInstance?this._resolveJsonData():null,AnimateJson:this.animateNeedsUpdate?this.animateJson:null,Size:this.size,SizeAttenuation:this.sizeAttenuation,RenderNum:this.renderNum,ChildIndex:this.isInstance?-1:this.childIndex,IsInstance:this.isInstance,OvertimeInstanceIndex:this.overtimeInstanceIndex}:{matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},type:this.type,name:this.name,uuid:this.uuid,ChildIndex:this.childIndex}}},{key:"dispose",value:function(){var e,t;this.textureRef&&null!==(e=this.parent)&&void 0!==e&&null!==(t=e.engine)&&void 0!==t&&t.textureBus&&(this.parent.engine.textureBus.releaseTexture(this.textureRef),this.textureRef=null),this.traverse((function(e){e.geometry&&e.geometry.dispose(),e.material&&e.material.dispose(),e.texture=null})),this.data=null,this.datas=null,this.texture=null}},{key:"copy",value:function(t){var i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return this.color.copy(t.color),this.brightness=t.brightness,this.metallic=t.metallic,this.roughness=t.roughness,this.opacity=t.opacity,this.transparent=t.transparent,this.texture=t.texture,this.brightnessColor.copy(t.brightnessColor),this.offset.copy(t.offset),F(e,"copy",this)([t,i]),this}}])}();var yt=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};U(this,e),(t=N(this,e,[i])).type="Polygon";var n=i.fillStyle||"Empty",a=void 0===i.speedX?.25:i.speedX,r=void 0===i.speedY?.25:i.speedY,o=void 0===i.rotateAngle?0:i.rotateAngle,s=void 0===i.tile?.5:i.tile;return Object.defineProperties(t,{fillStyle:{configurable:!0,enumerable:!0,get:function(){return n},set:function(e){e&&(n=e,t.materialNeedsUpdate=!0)}},rotateAngle:{configurable:!0,enumerable:!0,get:function(){return o},set:function(e){e&&(o=e,t.materialNeedsUpdate=!0)}},tile:{configurable:!0,enumerable:!0,get:function(){return s},set:function(e){e&&(s=e,t.materialNeedsUpdate=!0)}},speedX:{configurable:!0,enumerable:!0,get:function(){return a},set:function(e){e&&(a=e,t.materialNeedsUpdate=!0)}},speedY:{configurable:!0,enumerable:!0,get:function(){return r},set:function(e){e&&(r=e,t.materialNeedsUpdate=!0)}}}),t}return z(e,vt),C(e,[{key:"setData",value:function(e){this.data=tt(e)}},{key:"toJSON",value:function(){var e,t,i,n,a=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return!a||!this.visibleNeedsUpdate||this.visible&&this.materialNeedsUpdate?{Color:{r:this.color.r,g:this.color.g,b:this.color.b,a:this.opacity},Brightness:this.brightness,Metallic:this.metallic,Roughness:this.roughness,Opacity:this.opacity,FillStyle:this.fillStyle,SpeedX:this.speedX,SpeedY:this.speedY,RotateAngle:this.rotateAngle,Tile:this.tile,Transparent:this.transparent,Texture:null!==(e=this.parent)&&void 0!==e&&null!==(t=e.engine)&&void 0!==t&&t.enableTextureBus&&this.textureRef?null:this.texture,TextureRef:null!==(i=this.parent)&&void 0!==i&&null!==(n=i.engine)&&void 0!==n&&n.enableTextureBus&&this.textureRef?this.textureRef:null,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},type:this.type,uuid:this.uuid,jsondata:a?null:this.data,matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,animateNeedsUpdate:this.animateNeedsUpdate,animateJson:this.animateNeedsUpdate?this.animateJson:null}:{matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},type:this.type,name:this.name,uuid:this.uuid}}}])}(),bt=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};U(this,e),(t=N(this,e,[i])).type="Line";var n=i.style||ie.SOLID,a=i.splineType||ae.LINEAR,r=i.direction||ne.CENTER,o=i.width||4,s=i.tilling||5,l=i.speed||1,u=void 0!==i.openStroke&&i.openStroke,c=i.strokeColor||null,d=i.strokeWidth||1;t.enableSimplify=void 0!==i.enableSimplify?i.enableSimplify:i.isDilution,t.simplifyTolerance=i.simplifyTolerance||i.interval||1e-5,t.visible=void 0===i.visible||i.visible,t.collision=void 0!==i.collision&&i.collision;var h={enable:!1,speedX:1,speedY:0,uvRotation:0,u:0,v:0};return i.lineUVOption&&(h.enable=void 0!==i.lineUVOption.enable&&i.lineUVOption.enable,h.speedX=void 0===i.lineUVOption.speedX?1:i.lineUVOption.speedX,h.speedY=void 0===i.lineUVOption.speedY?0:i.lineUVOption.speedY,h.uvRotation=void 0===i.lineUVOption.uvRotation?0:i.lineUVOption.uvRotation,h.u=void 0===i.lineUVOption.u?0:i.lineUVOption.u,h.v=void 0===i.lineUVOption.v?0:i.lineUVOption.v),t.renderType=void 0===i.renderType?0:i.renderType,t.section_Length=void 0===i.section_Length?100:i.section_Length,Object.defineProperties(t,{style:{configurable:!0,enumerable:!0,get:function(){return n},set:function(e){e&&(n=e,t.materialNeedsUpdate=!0)}},lineUVOption:{configurable:!0,enumerable:!0,get:function(){return h},set:function(e){e&&(h.enable=void 0!==e.enable&&e.enable,h.speedX=void 0===e.speedX?1:e.speedX,h.speedY=void 0===e.speedY?0:e.speedY,h.uvRotation=void 0===e.uvRotation?0:e.uvRotation,h.u=void 0===e.u?0:e.u,h.v=void 0===e.v?0:e.v,t.materialNeedsUpdate=!0)}},splineType:{configurable:!0,enumerable:!0,get:function(){return a},set:function(e){e&&(a=e,t.materialNeedsUpdate=!0)}},direction:{configurable:!0,enumerable:!0,get:function(){return r},set:function(e){e&&(r=e,t.materialNeedsUpdate=!0)}},width:{configurable:!0,enumerable:!0,get:function(){return o},set:function(e){e&&(o=e,t.materialNeedsUpdate=!0)}},tilling:{configurable:!0,enumerable:!0,get:function(){return s},set:function(e){e&&(s=e,t.materialNeedsUpdate=!0)}},speed:{configurable:!0,enumerable:!0,get:function(){return l},set:function(e){e&&(l=e,t.materialNeedsUpdate=!0)}},openStroke:{configurable:!0,enumerable:!0,get:function(){return u},set:function(e){e&&(u=e,t.materialNeedsUpdate=!0)}},strokeColor:{configurable:!0,enumerable:!0,get:function(){return c},set:function(e){e&&(c.r=e.r,c.g=e.g,c.b=e.b,c.a=e.a?e.a:1,t.materialNeedsUpdate=!0)}},strokeWidth:{configurable:!0,enumerable:!0,get:function(){return d},set:function(e){e&&(d=e,t.materialNeedsUpdate=!0)}}}),t}return z(e,vt),C(e,[{key:"_getLineEncodeOptions",value:function(){return{enableDP:!1!==this.enableSimplify,dpThreshold:this.simplifyTolerance}}},{key:"updataLineColor",value:function(e){var t=this._resolveJsonData()||this.data,i=Array.isArray(t)?t.length:null==t?void 0:t.count;Array.isArray(e)&&e.length===i&&(this.colordata=e,this.materialNeedsUpdate=!0)}},{key:"toJSON",value:function(){var e,t,i,n,a=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return!a||!this.visibleNeedsUpdate||this.visible&&this.materialNeedsUpdate?{Color:{r:this.color.r,g:this.color.g,b:this.color.b,a:this.opacity},Brightness:this.brightness,Metallic:this.metallic,Roughness:this.roughness,Opacity:this.opacity,Transparent:this.transparent,Collision:this.collision,Texture:null!==(e=this.parent)&&void 0!==e&&null!==(t=e.engine)&&void 0!==t&&t.enableTextureBus&&this.textureRef?null:this.texture,TextureRef:null!==(i=this.parent)&&void 0!==i&&null!==(n=i.engine)&&void 0!==n&&n.enableTextureBus&&this.textureRef?this.textureRef:null,BloomColor:this.bloomColor?{r:this.bloomColor.r,g:this.bloomColor.g,b:this.bloomColor.b,a:1}:null,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,type:this.type,uuid:this.uuid,jsondata:a?null:this._resolveJsonData(),Style:this.style,Spline_Type:this.splineType,MeshDirection:this.direction,RenderType:this.renderType,Section_Length:this.section_Length,Width:this.width,Tilling:this.tilling,Speed:this.speed,Open_Stroke:this.openStroke,Stroke_Color:this.strokeColor?{r:this.strokeColor.r,g:this.strokeColor.g,b:this.strokeColor.b,a:1}:null,Stroke_Width:this.strokeWidth,animateNeedsUpdate:this.animateNeedsUpdate,animateJson:this.animateNeedsUpdate?this.animateJson:null,LineUVOption:this.lineUVOption,colordata:this.colordata}:{matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},type:this.type,name:this.name,uuid:this.uuid}}},{key:"copy",value:function(t){var i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return this.style=t.style,this.splineType=t.splineType,this.direction=t.direction,this.width=t.width,this.tilling=t.tilling,this.speed=t.speed,this.openStroke=t.openStroke,this.strokeColor=t.strokeColor,this.strokeWidth=t.strokeWidth,F(e,"copy",this)([t,i]),this}}])}(),xt=function(){function e(){var i,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};U(this,e),i=N(this,e,[n]);var a=n.size||4;return i.type="Point",Object.defineProperties(i,{size:{configurable:!0,enumerable:!0,get:function(){return a},set:function(e){(a=Number(e))&&(i.scale=new t(a,a,a),i.matrixNeedsUpdate=!0)}}}),i}return z(e,vt),C(e,[{key:"setData",value:function(e){this.data=nt(e)}},{key:"toJSON",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return!e||!this.visibleNeedsUpdate||this.visible&&this.materialNeedsUpdate?{Color:{r:this.color.r,g:this.color.g,b:this.color.b,a:this.opacity},Brightness:this.brightness,Metallic:this.metallic,Roughness:this.roughness,Opacity:this.opacity,Transparent:this.transparent,Texture:this.texture,BloomColor:this.bloomColor?{r:this.bloomColor.r,g:this.bloomColor.g,b:this.bloomColor.b,a:1}:null,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},type:this.type,uuid:this.uuid,jsondata:e?null:this.data,matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,Size:this.size,animateNeedsUpdate:this.animateNeedsUpdate,animateJson:this.animateNeedsUpdate?this.animateJson:null}:{matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},type:this.type,name:this.name,uuid:this.uuid}}},{key:"copy",value:function(t){var i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return this.size=t.size,F(e,"copy",this)([t,i]),this}}])}(),St=function(){function e(t){var i;return U(this,e),(i=N(this,e,[t])).type="Cube",i}return z(e,vt),C(e)}(),wt=function(){return C((function e(t){U(this,e),this.cloudRender=t,this.explodeDistance=3}),[{key:"setRadius",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3;this.explodeDistance=e}},{key:"explodeAll",value:function(e){this.cloudRender.emitUIInteraction({excuteName:"Application_explodeControl",params:{Group:e,Action:"ExplodeAll",ExplodeDistance:100*this.explodeDistance}})}},{key:"resetAll",value:function(e){this.cloudRender.emitUIInteraction({excuteName:"Application_explodeControl",params:{Group:e,Action:"ResetAll"}})}},{key:"explodePercent",value:function(e,t){this.cloudRender.emitUIInteraction({excuteName:"Application_explodeControl",params:{Group:e,Percent:t,Action:"ExplodePercent",ExplodeDistance:100*this.explodeDistance}})}},{key:"explodePart",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0;this.cloudRender.emitUIInteraction({excuteName:"Application_explodeControl",params:{Group:e,ChildIds:t,PartList:i,Action:"ExplodePart",ExplodeDistance:100*this.explodeDistance}})}},{key:"resetPart",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0;this.cloudRender.emitUIInteraction({excuteName:"Application_explodeControl",params:{Group:e,ChildIds:t,PartList:i,Action:"ResetPart"}})}}])}(),Nt=function(){return C((function e(t){U(this,e),this.cloudRender=t}),[{key:"highlight",value:function(e){this.cloudRender.emitUIInteraction({excuteName:"Interact_L3ModelControl",params:{HighlightModels:e}})}},{key:"resetHighlight",value:function(e){this.highlight(e.map((function(e){return{Id:e,Reset:!0}})))}},{key:"setOpacity",value:function(e){this.cloudRender.emitUIInteraction({excuteName:"Interact_L3ModelControl",params:{OpacityModels:e}})}},{key:"resetOpacity",value:function(e){this.setOpacity(e.map((function(e){return{Id:e,Reset:!0}})))}},{key:"setOutLine",value:function(e,t){var i={OutLineModels:e};t&&(i.OutLineEffect=t),this.cloudRender.emitUIInteraction({excuteName:"Interact_L3ModelControl",params:i})}},{key:"resetOutLine",value:function(e){this.setOutLine(e.map((function(e){return{Id:e,Reset:!0}})))}},{key:"hide",value:function(e){this.cloudRender.emitUIInteraction({excuteName:"Interact_L3ModelControl",params:{HiddenModels:e.map((function(e){return{Id:e,Reset:!1}}))}})}},{key:"show",value:function(e){this.cloudRender.emitUIInteraction({excuteName:"Interact_L3ModelControl",params:{HiddenModels:e.map((function(e){return{Id:e,Reset:!0}}))}})}},{key:"reset",value:function(e){this.cloudRender.emitUIInteraction({excuteName:"Interact_L3ModelControl",params:{ResetModels:e.map((function(e){return{Id:e}}))}})}}])}(),Ut=function(){return C((function e(t){U(this,e),this.cloudRender=t}),[{key:"control",value:function(e){this.cloudRender.emitUIInteraction({excuteName:"Application_skeletonAnimControl",params:{SkeletonModelList:e}})}},{key:"play",value:function(e){this.control(e.map((function(e){return{Id:e,EnableAnim:!0}})))}},{key:"stop",value:function(e){this.control(e.map((function(e){return{Id:e,EnableAnim:!1}})))}}])}(),kt=function(){return C((function e(t){U(this,e),this.cloudRender=t}),[{key:"update",value:function(e){this.cloudRender.emitUIInteraction({excuteName:"Application_waterSimulation",params:{WaterPlane:e}})}}])}(),Ct=["Plane","Box"],Tt=["Gizmo","Direct"],Rt=["TRANSLATE","ROTATE"],Ot=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return U(this,e),(t=N(this,e)).type="ModelSlice",t._shape=Ct.includes(i.shape)?i.shape:"Plane",t._mode=Tt.includes(i.mode)?i.mode:"Gizmo",t._gizmoType=Rt.includes(i.gizmoType)?i.gizmoType:"TRANSLATE",t._origin=i.origin||null,t._size=i.size||null,t._rotation=i.rotation||{Pitch:0,Yaw:0,Roll:0},t.materialNeedsUpdate=!1,t.matrixNeedsUpdate=!1,t}return z(e,je),C(e,[{key:"shape",get:function(){return this._shape}},{key:"mode",get:function(){return this._mode},set:function(e){Tt.includes(e)?e!==this._mode&&(this._mode=e,this.materialNeedsUpdate=!0):console.warn("[ModelSlice] mode must be 'Gizmo' or 'Direct', got '".concat(e,"'"))}},{key:"gizmoType",get:function(){return this._gizmoType},set:function(e){Rt.includes(e)?e!==this._gizmoType&&(this._gizmoType=e,this.materialNeedsUpdate=!0):console.warn("[ModelSlice] gizmoType must be 'TRANSLATE' or 'ROTATE', got '".concat(e,"'"))}},{key:"origin",get:function(){return this._origin},set:function(e){this._origin=e,this.materialNeedsUpdate=!0}},{key:"size",get:function(){return this._size},set:function(e){this._size=e,this.materialNeedsUpdate=!0}},{key:"sliceRotation",get:function(){return this._rotation},set:function(e){this._rotation=e,this.materialNeedsUpdate=!0}},{key:"dispose",value:function(){return!1}},{key:"toJSON",value:function(){var e={Enable:!0,Shape:this._shape,Mode:this._mode};"Gizmo"===this._mode&&(e.GizmoConfig={GizmoType:this._gizmoType});var t="Box"===this._shape?"BoxConfig":"PlaneConfig";return this._origin&&this._size&&(e[t]={Origin:this._origin,Size:this._size,Rotation:this._rotation}),e}}])}(),Et=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};U(this,e),(t=N(this,e,[i])).type="MeasureArea";var n=void 0===i.textDisplay||i.textDisplay,a=i.textColor||new u(1,0,0),r=i.fontSize||18,o=i.textBorderColor||new u(1,0,0),s=i.textBorderWidth||1;return Object.defineProperties(t,{textDisplay:{configurable:!0,enumerable:!0,get:function(){return n},set:function(e){e&&(n=e)}},fontSize:{configurable:!0,enumerable:!0,get:function(){return r},set:function(e){e&&(r=e)}},textColor:{configurable:!0,enumerable:!0,get:function(){return a},set:function(e){e&&(a.r=e.r,a.g=e.g,a.b=e.b)}},textBorderWidth:{configurable:!0,enumerable:!0,get:function(){return s},set:function(e){e&&(s=e)}},textBorderColor:{configurable:!0,enumerable:!0,get:function(){return o},set:function(e){e&&(o.r=e.r,o.g=e.g,o.b=e.b)}}}),t}return z(e,vt),C(e,[{key:"updateParameters",value:function(e){for(var t in e)this[t]!==e[t]&&(this[t]=e[t])}},{key:"toJSON",value:function(){return(!(arguments.length>0&&void 0!==arguments[0])||arguments[0])&&this.visibleNeedsUpdate&&!this.materialNeedsUpdate?{matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,type:this.type,name:this.name,uuid:this.uuid}:{Color:{r:this.color.r,g:this.color.g,b:this.color.b,a:this.opacity},Brightness:this.brightness,Metallic:this.metallic,Roughness:this.roughness,Opacity:this.opacity,Transparent:this.transparent,Texture:this.texture,BloomColor:this.bloomColor?{r:this.bloomColor.r,g:this.bloomColor.g,b:this.bloomColor.b,a:1}:null,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},type:this.type,uuid:this.uuid,matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,FontSize:this.fontSize,TextDisplay:this.textDisplay,TextColor:{r:this.textColor.r,g:this.textColor.g,b:this.textColor.b,a:1},TextBorderColor:{r:this.textBorderColor.r,g:this.textBorderColor.g,b:this.textBorderColor.b,a:1},TextBorderWidth:this.textBorderWidth,animateNeedsUpdate:this.animateNeedsUpdate,animateJson:this.animateNeedsUpdate?this.animateJson:null}}},{key:"copy",value:function(t){var i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return this.fontSize=t.fontSize,this.textDisplay=t.textDisplay,this.textColor=t.textColor,this.textBorderColor=t.textBorderColor,this.textBorderWidth=t.textBorderWidth,F(e,"copy",this)([t,i]),this}}])}(),zt=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};U(this,e),(t=N(this,e,[i])).type="MeasureLine";var n=i.style||ie.SOLID,a=i.splineType||ae.LINEAR,r=i.direction||ne.CENTER,o=i.width||4,s=i.tilling||300,l=i.speed||1,c=void 0!==i.openStroke&&i.openStroke,d=i.strokeColor||null,h=i.strokeWidth||1,f=void 0===i.textDisplay||i.textDisplay,p=i.textColor||new u(1,0,0),m=i.fontSize||18,g=i.textBorderColor||new u(1,0,0),v=i.textBorderWidth||1;return Object.defineProperties(t,{style:{configurable:!0,enumerable:!0,get:function(){return n},set:function(e){e&&(n=e)}},splineType:{configurable:!0,enumerable:!0,get:function(){return a},set:function(e){e&&(a=e)}},direction:{configurable:!0,enumerable:!0,get:function(){return r},set:function(e){e&&(r=e)}},width:{configurable:!0,enumerable:!0,get:function(){return o},set:function(e){e&&(o=e)}},tilling:{configurable:!0,enumerable:!0,get:function(){return s},set:function(e){e&&(s=e)}},speed:{configurable:!0,enumerable:!0,get:function(){return l},set:function(e){e&&(l=e)}},openStroke:{configurable:!0,enumerable:!0,get:function(){return c},set:function(e){e&&(c=e)}},strokeColor:{configurable:!0,enumerable:!0,get:function(){return d},set:function(e){e&&(d.r=e.r,d.g=e.g,d.b=e.b,d.a=e.a?e.a:1)}},strokeWidth:{configurable:!0,enumerable:!0,get:function(){return h},set:function(e){e&&(h=e)}},textDisplay:{configurable:!0,enumerable:!0,get:function(){return f},set:function(e){e&&(f=e)}},fontSize:{configurable:!0,enumerable:!0,get:function(){return m},set:function(e){e&&(m=e)}},textColor:{configurable:!0,enumerable:!0,get:function(){return p},set:function(e){e&&(p.r=e.r,p.g=e.g,p.b=e.b)}},textBorderWidth:{configurable:!0,enumerable:!0,get:function(){return v},set:function(e){e&&(v=e)}},textBorderColor:{configurable:!0,enumerable:!0,get:function(){return g},set:function(e){e&&(g.r=e.r,g.g=e.g,g.b=e.b)}}}),t}return z(e,vt),C(e,[{key:"updateParameters",value:function(e){for(var t in e)this[t]!==e[t]&&(this[t]=e[t])}},{key:"toJSON",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return!e||!this.visibleNeedsUpdate||this.visible&&this.materialNeedsUpdate?{Color:{r:this.color.r,g:this.color.g,b:this.color.b,a:this.opacity},Brightness:this.brightness,Metallic:this.metallic,Roughness:this.roughness,Opacity:this.opacity,Transparent:this.transparent,Texture:this.texture,BloomColor:this.bloomColor?{r:this.bloomColor.r,g:this.bloomColor.g,b:this.bloomColor.b,a:1}:null,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,type:this.type,uuid:this.uuid,jsondata:e?null:this._resolveJsonData(),Style:this.style,Spline_Type:this.splineType,MeshDirection:this.direction,Width:this.width,Tilling:this.tilling,Speed:this.speed,Open_Stroke:this.openStroke,Stroke_Color:this.strokeColor?{r:this.strokeColor.r,g:this.strokeColor.g,b:this.strokeColor.b,a:1}:null,Stroke_Width:this.strokeWidth,FontSize:this.fontSize,TextColor:{r:this.textColor.r,g:this.textColor.g,b:this.textColor.b,a:1},TextDisplay:this.textDisplay,TextBorderColor:{r:this.textBorderColor.r,g:this.textBorderColor.g,b:this.textBorderColor.b,a:1},TextBorderWidth:this.textBorderWidth}:{matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},type:this.type,name:this.name,uuid:this.uuid}}},{key:"copy",value:function(t){var i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return this.style=t.style,this.splineType=t.splineType,this.direction=t.direction,this.width=t.width,this.tilling=t.tilling,this.speed=t.speed,this.openStroke=t.openStroke,this.strokeColor=t.strokeColor,this.strokeWidth=t.strokeWidth,this.fontSize=t.fontSize,this.textColor=t.textColor,this.textDisplay=t.textDisplay,this.textBorderColor=t.textBorderColor,this.textBorderWidth=t.textBorderWidth,F(e,"copy",this)([t,i]),this}}])}(),It=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};U(this,e),(t=N(this,e,[i])).type="SurfaceLine";var n=i.rayDistance||100,a=i.width||4,r=i.rayDetectionDistance||500,o=i.textColor||new u(1,0,0),s=i.fontSize||18,l=i.linePixel||1024;return Object.defineProperties(t,{width:{configurable:!0,enumerable:!0,get:function(){return a},set:function(e){e&&(a=e)}},rayDistance:{configurable:!0,enumerable:!0,get:function(){return n},set:function(e){e!==n&&(n=e)}},rayDetectionDistance:{configurable:!0,enumerable:!0,get:function(){return r},set:function(e){e!==r&&(r=e)}},linePixel:{configurable:!0,enumerable:!0,get:function(){return l},set:function(e){e!==l&&(l=e)}},fontSize:{configurable:!0,enumerable:!0,get:function(){return s},set:function(e){e&&(s=e)}},textColor:{configurable:!0,enumerable:!0,get:function(){return o},set:function(e){e&&(o.r=e.r,o.g=e.g,o.b=e.b)}}}),t}return z(e,vt),C(e,[{key:"updateParameters",value:function(e){for(var t in e)this[t]!==e[t]&&(this[t]=e[t])}},{key:"toJSON",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return!e||!this.visibleNeedsUpdate||this.visible&&this.materialNeedsUpdate?{Color:{r:this.color.r,g:this.color.g,b:this.color.b,a:this.opacity},Brightness:this.brightness,Metallic:this.metallic,Roughness:this.roughness,Opacity:this.opacity,Transparent:this.transparent,Texture:this.texture,BloomColor:this.bloomColor?{r:this.bloomColor.r,g:this.bloomColor.g,b:this.bloomColor.b,a:1}:null,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,type:this.type,uuid:this.uuid,jsondata:e?null:this._resolveJsonData(),Style:"solid",Spline_Type:"Curve",MeshDirection:"Ground_Center",Width:this.width,FontSize:this.fontSize,TextColor:{r:this.textColor.r,g:this.textColor.g,b:this.textColor.b,a:1},LinePixel:this.linePixel}:{matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},type:this.type,name:this.name,uuid:this.uuid}}},{key:"copy",value:function(t){var i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return this.style="solid",this.splineType="Curve",this.direction="Ground_Center",this.width=t.width,this.fontSize=t.fontSize,this.textColor=t.textColor,this.textDisplay=t.textDisplay,this.textBorderColor=t.textBorderColor,this.textBorderWidth=t.textBorderWidth,F(e,"copy",this)([t,i]),this}}])}(),At=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};U(this,e),(t=N(this,e,[i])).type="LocationPoint",t.EPSG=i.EPSG||"epsg:4326";var n=i.textColor||new u(1,0,0),a=i.fontSize||18,r=i.textBorderColor||new u(1,0,0),o=i.textBorderWidth||1;return Object.defineProperties(t,{fontSize:{configurable:!0,enumerable:!0,get:function(){return a},set:function(e){e&&(a=e)}},textColor:{configurable:!0,enumerable:!0,get:function(){return n},set:function(e){e&&(n.r=e.r,n.g=e.g,n.b=e.b)}},textBorderWidth:{configurable:!0,enumerable:!0,get:function(){return o},set:function(e){e&&(o=e)}},textBorderColor:{configurable:!0,enumerable:!0,get:function(){return r},set:function(e){e&&(r.r=e.r,r.g=e.g,r.b=e.b)}}}),t}return z(e,vt),C(e,[{key:"updateParameters",value:function(e){for(var t in e)this[t]!==e[t]&&(this[t]=e[t])}},{key:"toJSON",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return!e||!this.visibleNeedsUpdate||this.visible&&this.materialNeedsUpdate?{Color:{r:this.color.r,g:this.color.g,b:this.color.b,a:this.opacity},Brightness:this.brightness,Metallic:this.metallic,Roughness:this.roughness,Opacity:this.opacity,Transparent:this.transparent,Texture:this.texture,BloomColor:this.bloomColor?{r:this.bloomColor.r,g:this.bloomColor.g,b:this.bloomColor.b,a:1}:null,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},type:this.type,uuid:this.uuid,jsondata:e?null:this._resolveJsonData(),matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,FontSize:this.fontSize,TextColor:{r:this.textColor.r,g:this.textColor.g,b:this.textColor.b,a:1},EPSG:this.EPSG,TextBorderColor:{r:this.textBorderColor.r,g:this.textBorderColor.g,b:this.textBorderColor.b,a:1},TextBorderWidth:this.textBorderWidth,animateNeedsUpdate:this.animateNeedsUpdate,animateJson:this.animateNeedsUpdate?this.animateJson:null}:{matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},type:this.type,name:this.name,uuid:this.uuid}}},{key:"copy",value:function(t){var i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return this.fontSize=t.fontSize,this.textColor=t.textColor,this.textBorderColor=t.textBorderColor,this.EPSG=t.EPSG,this.textBorderWidth=t.textBorderWidth,F(e,"copy",this)([t,i]),this}}])}();function _t(e){return null==e?"":"string"==typeof e?e:JSON.stringify(e)}function Mt(e){return Lt.apply(this,arguments)}function Lt(){return(Lt=w(D().mark((function e(t){var i,n;return D().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=new CompressionStream("gzip"),n=new Blob([t]).stream().pipeThrough(i),e.t0=Uint8Array,e.next=5,new Response(n).arrayBuffer();case 5:return e.t1=e.sent,e.abrupt("return",new e.t0(e.t1));case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Dt=y.create();Dt.interceptors.request.use((function(e){var t=localStorage.getItem("authToken");return t&&(e.headers.Authorization="Bearer ".concat(t)),e}),(function(e){return Promise.reject(e)})),Dt.interceptors.response.use((function(e){return e}),(function(e){return e.response&&401===e.response.status&&localStorage.removeItem("authToken"),Promise.reject(e)}));var Pt=function(){return C((function e(){U(this,e)}),null,[{key:"username",get:function(){return this._username},set:function(e){this._username=e,this._SaveToken()}},{key:"password",get:function(){return this._password},set:function(e){this._password=e,this._SaveToken()}},{key:"_SaveToken",value:function(){localStorage.setItem("authToken",btoa("".concat(this._username,":").concat(this._password)))}}])}();R(Pt,"host",""),R(Pt,"tag",""),R(Pt,"_username","admin"),R(Pt,"_password","admin"),R(Pt,"_currentProject",void 0),Pt.GetProjectCommon=w(D().mark((function e(){var t;return D().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!Pt.host){e.next=5;break}return e.next=3,Dt.get("".concat(Pt.host,"/api/configs/projects/common"));case 3:return t=e.sent,e.abrupt("return",t);case 5:console.error("请先设置Host地址");case 6:case"end":return e.stop()}}),e)}))),Pt.getProjectCommon=Pt.GetProjectCommon,Pt.GetProjectByNodeId=function(){var e=w(D().mark((function e(t){var i;return D().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!Pt.host){e.next=5;break}return e.next=3,Dt.get("".concat(Pt.host,"/api/configs/projects/").concat(t));case 3:return i=e.sent,e.abrupt("return",i);case 5:console.error("请先设置Host地址");case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Pt.getProjectByNodeId=Pt.GetProjectByNodeId,Pt.GetAllCapacity=w(D().mark((function e(){var t;return D().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!Pt.host){e.next=5;break}return e.next=3,Dt.get("".concat(Pt.host,"/api/nodes/capacity"));case 3:return t=e.sent,e.abrupt("return",t.data.data[""===Pt.tag?"all":Pt.tag]);case 5:case"end":return e.stop()}}),e)}))),Pt.getAllCapacity=Pt.GetAllCapacity,Pt.GetAllCapacityInfo=w(D().mark((function e(){var t;return D().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!Pt.host){e.next=5;break}return e.next=3,Dt.get("".concat(Pt.host,"/api/nodes/capacity"));case 3:return t=e.sent,e.abrupt("return",t.data.data);case 5:case"end":return e.stop()}}),e)}))),Pt.getAllCapacityInfo=Pt.GetAllCapacityInfo,Pt.GetAllNodes=w(D().mark((function e(){var t;return D().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!Pt.host){e.next=5;break}return e.next=3,Dt.get("".concat(Pt.host,"/api/nodes/all"));case 3:return t=e.sent,e.abrupt("return",t);case 5:case"end":return e.stop()}}),e)}))),Pt.getAllNodes=Pt.GetAllNodes,Pt.GetAliveNodes=w(D().mark((function e(){var t;return D().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!Pt.host){e.next=5;break}return e.next=3,Dt.get("".concat(Pt.host,"/api/nodes/list"));case 3:return t=e.sent,e.abrupt("return",t);case 5:case"end":return e.stop()}}),e)}))),Pt.getAliveNodes=Pt.GetAliveNodes,Pt.CreateTask=function(){var e=w(D().mark((function e(t){var i,n;return D().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=Pt.tag||"",e.next=3,Dt.post("".concat(Pt.host,"/api/tasks/create"),{project:t,tag:"all"===i?"":i});case 3:return n=e.sent,Pt._currentProject=n.data,e.abrupt("return",n.data);case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Pt.createTask=Pt.CreateTask,Pt.KillTask=function(){var e=w(D().mark((function e(t){var i;return D().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!Pt.host){e.next=6;break}return e.next=3,Dt.post("".concat(Pt.host,"/api/tasks/kill/").concat(t));case 3:return i=e.sent,Pt._currentProject=null,e.abrupt("return",i);case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Pt.killTask=Pt.KillTask,Pt._SaveToken(),"undefined"==typeof ue&&(window.ue={});var Bt=window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.requestAnimationFrame,Ft=function(){function e(t){var i;U(this,e),(i=N(this,e)).type="CloudRenderEngine",i.controllers=(null==t?void 0:t.controllers)||{};var n=!0===(null==t?void 0:t.enableV2),a=!0===(null==t?void 0:t.enableSoftPriorityQueues)||!0===(null==t?void 0:t.enableDedicatedChannels),r=function(e,t){return!0===e||!1===e?e:t};i.enableV2Protocol=r(null==t?void 0:t.enableV2Protocol,n),i.enableTextureBus=r(null==t?void 0:t.enableTextureBus,n),i.enableAckV2=r(null==t?void 0:t.enableAckV2,n),i.enableV2Fallback=r(null==t?void 0:t.enableV2Fallback,n),i.enableBulkChannel=r(null==t?void 0:t.enableBulkChannel,a),i.enableTextureChannel=r(null==t?void 0:t.enableTextureChannel,a),i.enablePropertyColumnar=r(null==t?void 0:t.enablePropertyColumnar,n)&&i.enableV2Protocol,i.propertyColumnSchema=null!=t&&t.propertyColumnSchema&&"object"===G(t.propertyColumnSchema)?t.propertyColumnSchema:null,i.enableNackRetransmit=r(null==t?void 0:t.enableNackRetransmit,n)&&i.enableAckV2,i.maxNackRetries="number"==typeof(null==t?void 0:t.maxNackRetries)?t.maxNackRetries:2,i.bulkChannelThreshold="number"==typeof(null==t?void 0:t.bulkChannelThreshold)?t.bulkChannelThreshold:32768,i.dataChannelHighWatermark="number"==typeof(null==t?void 0:t.dataChannelHighWatermark)?t.dataChannelHighWatermark:4194304,i.bulkYieldEveryNChunks="number"==typeof(null==t?void 0:t.bulkYieldEveryNChunks)?Math.max(0,0|t.bulkYieldEveryNChunks):4,i._v2SeqId=0,i.textureBus=i.enableTextureBus?new Re(i,{maxBytes:null==t?void 0:t.textureBusMaxBytes}):null,i._v3Metrics={textureChannelBytes:0,fallbackCount:0,v2ErrorCount:0,ackOkCount:0,ackNackCount:0,ackTimeoutCount:0,nackRetransmitCount:0,nackRetransmitGiveUpCount:0},i._sentChunks=new Map,i._sentChunksMaxSize="number"==typeof(null==t?void 0:t.sentChunksMaxSize)?t.sentChunksMaxSize:1024,i._sentChunksTtlMs="number"==typeof(null==t?void 0:t.sentChunksTtlMs)?t.sentChunksTtlMs:3e4,i._sentChunksWriteCount=0,i._pendingAcks=new Map,i._defaultAckTimeoutMs="number"==typeof(null==t?void 0:t.defaultAckTimeoutMs)?t.defaultAckTimeoutMs:3e4,i.kbEvent=document.createEvent("KeyboardEvent"),i.initMethod=void 0!==i.kbEvent.initKeyboardEvent?"initKeyboardEvent":"initKeyEvent",i.webRtcPlayerObj=null,i.forceTURN=void 0!==t.forceTURN&&t.forceTURN,i.printStats=(null==t?void 0:t.printStats)||!1,i.printInputs=(null==t?void 0:t.printInputs)||!1,i.connectOnLoad=(null==t?void 0:t.connectOnLoad)||!0,i.isReconnection=(null==t?void 0:t.isReconnection)||!1,i.ws,i.wsURL=null==t?void 0:t.wsUrl,i.projectName=void 0===t.projectName?"default":t.projectName,i.renderMode=(null==t?void 0:t.renderMode)||"cloud",i.matchmakerIP=null==t?void 0:t.matchmakerIP,i.matchmakerPort=(null==t?void 0:t.matchmakerPort)||"90",i.scene=new He,i.scene.engine=i,i.qualityController=!1,i.qualityControlOwnershipCheckBox,i.matchViewportResolution=(null==t?void 0:t.matchViewportResolution)||!1,i.resolution=(null==t?void 0:t.resolution)||[0,0],i.resizeTimeout=null,i.onDataChannelConnected,i.webRtcConnectionStatsCallback=null,i.lastPacketsLost=0;var o=(null==t?void 0:t.inputOptions)||{},s=o.controlScheme,l=void 0===s?se.controlScheme:s,u=o.suppressBrowserKeys,c=void 0===u?se.suppressBrowserKeys:u,d=o.fakeMouseWithTouches,h=void 0===d?se.fakeMouseWithTouches:d;return i.inputOptions={controlScheme:l,suppressBrowserKeys:c,fakeMouseWithTouches:h},i.eventHandler=new xe(i),i.freezeFrameOverlay=null,i.shouldShowPlayOverlay=null==t?void 0:t.shouldShowPlayOverlay,i.freezeFrame={receiving:!1,size:0,jpeg:void 0,height:0,width:0,valid:!1},i.file={mimetype:"",extension:"",receiving:!1,size:0,data:[],valid:!1,timestampStart:void 0},i.afk=(null==t?void 0:t.afk)||{enabled:!1,warnTimeout:120,closeTimeout:10,active:!1,overlay:void 0,warnTimer:void 0,countdown:0,countdownTimer:void 0},i.editTextButton=void 0,i.hiddenInput=void 0,i.t0=Date.now(),i.dataTransferFrequence=20,i.streamTrackSource=null,i.videoEncoderQP="N/A",i.udsParams=(null==t?void 0:t.udsParams)||{},i.UDS,i.isSequencer=void 0!==(null==t?void 0:t.isSequencer)&&(null==t?void 0:t.isSequencer),i.styleWidth,i.styleHeight,i.styleTop,i.styleLeft,i.styleCursor=(null==t?void 0:t.styleCursor)||"default",i.styleAdditional,i._orientationChangeTimeout,i.playerElementClientRect=void 0,i.normalizeAndQuantizeUnsigned=void 0,i.normalizeAndQuantizeSigned=void 0,i.isShowTestUI=null==t?void 0:t.isShowTestUI,setTimeout((function(){i.interval(i.dataTransferFrequence)}),1e3),"inner"===i.renderMode&&i._preInitInnerMode(),i}return z(e,be),C(e,[{key:"explodeControl",get:function(){return this._explodeControl||(this._explodeControl=new wt(this)),this._explodeControl}},{key:"l3ModelControl",get:function(){return this._l3ModelControl||(this._l3ModelControl=new Nt(this)),this._l3ModelControl}},{key:"skeletonAnimControl",get:function(){return this._skeletonAnimControl||(this._skeletonAnimControl=new Ut(this)),this._skeletonAnimControl}},{key:"waterSimulation",get:function(){return this._waterSimulation||(this._waterSimulation=new kt(this)),this._waterSimulation}},{key:"interval",value:function(){var e=this;setInterval((function(){e.eventHandler.updateObjectsWithEvent(),e.eventListenerUpdate(e),e.eventListenerUpdate(e.camera),e.scene.traverse((function(t){e.eventListenerUpdate(t),t.visibleNeedsUpdate&&(e.emitUIInteraction({excuteName:ee.VISIBLE,params:t.toJSON()}),t.visibleNeedsUpdate=!1),t.visible&&(t.matrixNeedsUpdate||t.materialNeedsUpdate||t.animateNeedsUpdate)&&("TrafficLayer"===t.type?e.emitUIInteraction({excuteName:Z.CREATE_TRAFFIC_STREAM,params:t.toJSON(!1)}):"LayerBuilding"===t.type?e.emitUIInteraction({excuteName:Q.EVENT_LAYER_BUILDING,params:t.toJSON()}):"SlopeAnalysis"===t.type?e.emitUIInteraction({excuteName:Q.UPDATA_SLOPE_ANALYSIS,params:t.toJSON()}):"ModelSlice"===t.type?e.emitUIInteraction({excuteName:"Interact_ModelSlice",params:t.toJSON()}):e.emitUIInteraction({excuteName:ee.UPDATE,params:t.toJSON()}),t.matrixNeedsUpdate=!1,t.materialNeedsUpdate=!1,t.animateNeedsUpdate=!1),t.visible&&t.messageNeedsUpdate&&("TrafficLayer"===t.type?e.emitUIInteraction({excuteName:Z.CREATE_TRAFFIC_STREAM,params:t.toJSON(!1)}):e.emitUIInteraction({excuteName:ee.UPDATE,params:t.toJSON()}),t.messageNeedsUpdate=!1),t.followNeedsUpdate&&("TrafficLayer"===t.type?e.emitUIInteraction({excuteName:Z.FOLLOW_TRAFFIC_STREAM_ITEM,params:t.toJSON(!1)}):"AutonomousVehicle"===t.type&&e.emitUIInteraction({excuteName:ee.UPDATE,params:t.toJSON()}),t.followNeedsUpdate=!1)})),e.camera&&e.camera.needsUpdate&&(e.camera.constrainPolygonNeedsUpdate?(e.emitUIInteraction({excuteName:X.Constrain_Shape,params:e.camera.toJSON()}),e.camera.constrainPolygonNeedsUpdate=!1):e.emitUIInteraction({excuteName:X.UPDATE,params:e.camera.toJSON()}),e.camera.needsUpdate=!1)}),1e3/(arguments.length>0&&void 0!==arguments[0]?arguments[0]:5))}},{key:"eventListenerUpdate",value:function(e){e&&e._needsDispatchedToUE&&(e._dispatchAddListenerTypes&&e._dispatchAddListenerTypes.length>0&&(this.emitUIInteraction({excuteName:Z.ADD_EVENT_LISTENER,params:{type:e.type,name:e.name,uuid:e.uuid,EventType:e._dispatchAddListenerTypes}}),e._dispatchAddListenerTypes=[]),e._dispatchRemoveListenerTypes&&e._dispatchRemoveListenerTypes.length>0&&(this.emitUIInteraction({excuteName:Z.REMOVE_EVENT_LISTENER,params:{type:e.type,name:e.name,uuid:e.uuid,EventType:e._dispatchRemoveListenerTypes}}),e._dispatchRemoveListenerTypes=[]),e._needsDispatchedToUE=!1,e._dispatchName=null)}},{key:"log",value:function(e){console.log("".concat(Math.floor(Date.now()-this.t0),": ")+e)}},{key:"_preInitInnerMode",value:function(){var e=this;if(!this._preInitInnerModeStarted){this._preInitInnerModeStarted=!0;var t=this,i=setInterval((function(){var n;"undefined"!=typeof ue&&null!==(n=ue)&&void 0!==n&&n.interface&&(clearInterval(i),ue.interface._webUILoadedSet||(ue.interface._webUILoadedSet=!0,ue.interface.webUILoaded=function(){t._initWebUI()}),e.addEventListener("webUIisReady",(function(){})))}),200)}}},{key:"initCamera",value:function(){var e,t=this;this.camera&&(null===(e=this.camera)||void 0===e||e.removeFromParent(),this.camera=null);this.camera=new Ge,this.camera.type="Camera",this.camera.addEventListener("cameraChange",(function(e){var i,n,r,o,s,l,u=e.content.camera;t.camera.position.x=u.Location.longitude,t.camera.position.y=u.Location.latitude,t.camera.position.z=u.Location.altitude,t.camera.rotation.x=a.degToRad(u.Rotate.roll),t.camera.rotation.y=a.degToRad(u.Rotate.pitch),t.camera.rotation.z=a.degToRad(u.Rotate.yaw),t.camera.roll=u.Rotate.roll,t.camera.pitch=u.Rotate.pitch,t.camera.yaw=u.Rotate.yaw,t.camera.worldLocation.x=null==u||null===(i=u.Position)||void 0===i?void 0:i.x,t.camera.worldLocation.y=null==u||null===(n=u.Position)||void 0===n?void 0:n.y,t.camera.worldLocation.z=null==u||null===(r=u.Position)||void 0===r?void 0:r.z,t.camera.sphereLocation.x=null==u||null===(o=u.SphereLocation)||void 0===o?void 0:o.longitude,t.camera.sphereLocation.y=null==u||null===(s=u.SphereLocation)||void 0===s?void 0:s.latitude,t.camera.sphereLocation.z=null==u||null===(l=u.SphereLocation)||void 0===l?void 0:l.altitude,t.level=Math.ceil(Math.max(Math.log2(103300/t.camera.worldLocation.z),0)),t.dispatchEvent({type:"camera_changed",data:e})}))}},{key:"initObjectBBox",value:function(){if(this.objectBBox)return!1;this.objectBBox=new St({color:new u(1,1,0)}),this.scene.add(this.objectBBox),this.objectBBox.visible=!1,this.emitUIInteraction({excuteName:K.OBJECT_BOUNDINGBOX,params:this.objectBBox.toJSON()})}},{key:"_initWebUI",value:function(){if(!this._webUIInitialized){this._webUIInitialized=!0;var e=this;ue.interface.webUIMessage=function(t){e.eventHandler.callRespone(t)},console.log("页面及其所有资源已完全加载"),setTimeout((function(){e.UDS||(e.UDS=new me(e,e.udsParams)),e.camera||(console.log("initOthers start"),e.initOthers(),console.log("initOthers end -> ",e.camera)),e.dispatchEvent({type:"videoInitialised"})}),1e3),Wt((new Date).getTime())}}},{key:"scanGamepads",value:function(){for(var e=navigator.getGamepads?navigator.getGamepads():navigator.webkitGetGamepads?navigator.webkitGetGamepads():[],t=0;t<e.length;t++)e[t]&&e[t].index in this.controllers&&(this.controllers[e[t].index].currentState=e[t])}},{key:"updateStatus",value:function(){for(j in this.scanGamepads(),this.controllers){for(var e=this.controllers[j],t=e.currentState,i=e.prevState,n=0;n<t.buttons.length;n++){var a=t.buttons[n],r=i.buttons[n];a.pressed&&!r.pressed?6==n?this.emitControllerAxisMove(j,5,a.value):7==n?this.emitControllerAxisMove(j,6,a.value):this.emitControllerButtonPressed(j,n,0):!a.pressed&&r.pressed?6==n?this.emitControllerAxisMove(j,5,0):7==n?this.emitControllerAxisMove(j,6,0):this.emitControllerButtonReleased(j,n):a.pressed&&r.pressed&&(6==n?this.emitControllerAxisMove(j,5,a.value):7==n?this.emitControllerAxisMove(j,6,a.value):this.emitControllerButtonPressed(j,n,1))}for(var o=0;o<t.axes.length;o+=2){var s=parseFloat(t.axes[o].toFixed(4)),l=-parseFloat(t.axes[o+1].toFixed(4));0===o?(this.emitControllerAxisMove(j,1,s),this.emitControllerAxisMove(j,2,l)):2===o&&(this.emitControllerAxisMove(j,3,s),this.emitControllerAxisMove(j,4,l))}this.controllers[j].prevState=t}Bt(this.updateStatus)}},{key:"emitControllerButtonPressed",value:function(e,t,i){Data=new DataView(new ArrayBuffer(4)),Data.setUint8(0,le.GamepadButtonPressed),Data.setUint8(1,e),Data.setUint8(2,t),Data.setUint8(3,i)}},{key:"emitControllerButtonReleased",value:function(e,t){Data=new DataView(new ArrayBuffer(3)),Data.setUint8(0,le.GamepadButtonReleased),Data.setUint8(1,e),Data.setUint8(2,t)}},{key:"emitControllerAxisMove",value:function(e,t,i){Data=new DataView(new ArrayBuffer(11)),Data.setUint8(0,le.GamepadAnalog),Data.setUint8(1,e),Data.setUint8(2,t),Data.setFloat64(3,i,!0),this.sendInputData(Data.buffer)}},{key:"setupToggleWithUrlParams",value:function(e,t){var i=document.getElementById(e);i&&(i.checked=new URLSearchParams(window.location.search).has(t),i.addEventListener("change",(function(e){var i=new URLSearchParams(window.location.search);e.currentTarget.checked?i.set(t,"true"):i.delete(t),window.history.replaceState({},"",""!==i.toString()?"".concat(location.pathname,"?").concat(i):"".concat(location.pathname))})))}},{key:"updateStreamList",value:function(){for(var e=document.getElementById("stream-select"),t=e.options.length-1;t>=0;t--)e.remove(t);e.value=null;var i,n=T(this.webRtcPlayerObj.availableVideoStreams);try{for(n.s();!(i=n.n()).done;){var a=B(i.value,2),r=a[0],o=(a[1],document.createElement("option"));o.value=r,o.innerHTML=r,e.appendChild(o),null==e.value&&(e.value=r)}}catch(e){n.e(e)}finally{n.f()}this.updateTrackList()}},{key:"updateTrackList",value:function(){for(var e=document.getElementById("stream-select"),t=document.getElementById("track-select"),i=this.webRtcPlayerObj.availableVideoStreams.get(e.value),n=t.options.length-1;n>=0;n--)t.remove(n);t.value=null;var a,r=T(i.getVideoTracks());try{for(r.s();!(a=r.n()).done;){var o=a.value,s=document.createElement("option");s.value=o.id,s.innerHTML=o.label,t.appendChild(s),o.selected&&(t.value=o.id)}}catch(e){r.e(e)}finally{r.f()}}},{key:"sendStartLatencyTest",value:function(){var e=this;if(this.webRtcPlayerObj){this.webRtcPlayerObj.startLatencyTest((function(t){var i={StartTime:t};e.emitDescriptor(le.LatencyTest,i)}))}}},{key:"setOverlay",value:function(e,t,i){var n=document.getElementById("videoPlayOverlay");if(!n){var a=document.getElementById("player");(n=document.createElement("div")).id="videoPlayOverlay",a&&a.appendChild(n)}for(;n.lastChild;)n.removeChild(n.lastChild);t&&n.appendChild(t),i&&n.addEventListener("click",(function e(t){i(t),n.removeEventListener("click",e)}));for(var r=n.classList,o=r.length-1;o>=0;o--)r.remove(r[o]);n.classList.add(e)}},{key:"showConnectOverlay",value:function(){var e=this,t=document.createElement("div");t.id="playButton",t.innerHTML="点击开始",this.setOverlay("clickableState",t,(function(t){e.connect(),e.startAfkWarningTimer()}))}},{key:"showTextOverlay",value:function(e){var t=document.createElement("div");t.id="messageOverlay",t.innerHTML=e||"",this.setOverlay("textDisplayState",t)}},{key:"playVideoStream",value:function(){var e=this;e.webRtcPlayerObj&&this.webRtcPlayerObj.video?(e.webRtcPlayerObj.video.play().catch((function(t){console.error(t),console.log("Browser does not support autoplaying video without interaction - to resolve this we are going to show the play button overlay."),e.showPlayOverlay()})),e.requestInitialSettings(),e.requestQualityControl(),e.eventHandler.showFreezeFrameOverlay(),e.hideOverlay()):console.error("Could not player video stream because this.webRtcPlayerObj.video was not valid.")}},{key:"showPlayOverlay",value:function(){var e=this,t=document.createElement("img");t.id="playButton",t.src="/images/Play.png",t.alt="Start Streaming",this.setOverlay("clickableState",t,(function(t){e.playVideoStream()})),this.shouldShowPlayOverlay=!1}},{key:"updateAfkOverlayText",value:function(){this.afk.overlay.innerHTML="<center>No activity detected<br>Disconnecting in "+this.afk.countdown+" seconds<br>Click to continue<br></center>"}},{key:"showAfkOverlay",value:function(){var e=this;this.stopAfkWarningTimer(),this.afk.overlay=document.createElement("div"),this.afk.overlay.id="afkOverlay",this.setOverlay("clickableState",this.afk.overlay,(function(t){e.hideOverlay(),clearInterval(e.afk.countdownTimer),e.startAfkWarningTimer()})),this.afk.countdown=this.afk.closeTimeout,this.updateAfkOverlayText(),this.inputOptions.controlScheme==oe.LockedMouse&&document.exitPointerLock(),this.afk.countdownTimer=setInterval((function(){this.afk.countdown--,0==this.afk.countdown?(this.hideOverlay(),this.ws.close()):this.updateAfkOverlayText()}),1e3)}},{key:"hideOverlay",value:function(){this.setOverlay("hiddenState")}},{key:"startAfkWarningTimer",value:function(){this.afk.active=this.afk.enabled,this.resetAfkWarningTimer()}},{key:"stopAfkWarningTimer",value:function(){this.afk.active=!1}},{key:"resetAfkWarningTimer",value:function(){var e=this;this.afk.active&&(clearTimeout(this.afk.warnTimer),this.afk.warnTimer=setTimeout((function(){e.showAfkOverlay()}),1e3*e.afk.warnTimeout))}},{key:"createWebRtcOffer",value:function(){this.webRtcPlayerObj?(console.log("Creating offer"),this.showTextOverlay("云渲染服务连接中,请稍等"),this.webRtcPlayerObj.createOffer()):(console.log("WebRTC player not setup, cannot create offer"),this.showTextOverlay("云渲染服务连接失败,无法获取画面"))}},{key:"sendInputData",value:function(e){this.webRtcPlayerObj&&(this.resetAfkWarningTimer(),this.webRtcPlayerObj.send(e))}},{key:"setupWebRtcPlayer",value:function(e,t){var i=this;function n(e){this.freezeFrame.receiving||(this.freezeFrame.receiving=!0,this.freezeFrame.valid=!1,this.freezeFrame.size=0,this.freezeFrame.jpeg=void 0),this.freezeFrame.size=new DataView(e.slice(1,5).buffer).getInt32(0,!0);var t=e.slice(5);if(this.freezeFrame.jpeg){var n=new Uint8Array(this.freezeFrame.jpeg.length+t.length);n.set(this.freezeFrame.jpeg,0),n.set(t,this.freezeFrame.jpeg.length),this.freezeFrame.jpeg=n}else this.freezeFrame.jpeg=t,this.freezeFrame.receiving=!0,console.log("received first chunk of freeze frame: ".concat(this.freezeFrame.jpeg.length,"/").concat(this.freezeFrame.size));this.freezeFrame.jpeg.length===this.freezeFrame.size?(this.freezeFrame.receiving=!1,this.freezeFrame.valid=!0,console.log("received complete freeze frame ".concat(this.freezeFrame.size)),function(){var e=btoa(this.freezeFrame.jpeg.reduce((function(e,t){return e+String.fromCharCode(t)}),"")),t=document.getElementById("this.freezeFrameOverlay").childNodes[0];t.src="data:image/jpeg;base64,"+e,t.onload=function(){i.freezeFrame.height=t.naturalHeight,i.freezeFrame.width=t.naturalWidth,i.resizeFreezeFrameOverlay(),i.shouldShowPlayOverlay?(i.showPlayOverlay(),i.eventHandler.resizePlayerStyle()):i.eventHandler.showFreezeFrameOverlay()}}()):this.freezeFrame.jpeg.length>this.freezeFrame.size&&(console.error("received bigger freeze frame than advertised: ".concat(this.freezeFrame.jpeg.length,"/").concat(this.freezeFrame.size)),this.freezeFrame.jpeg=void 0,this.freezeFrame.receiving=!1)}return this.webRtcPlayerObj=new ye(_(_({},t),{},{forceTURN:this.forceTURN,enableBulkChannel:this.enableBulkChannel,enableTextureChannel:this.enableTextureChannel})),e.appendChild(this.webRtcPlayerObj.video),e.appendChild(this.freezeFrameOverlay),this.connectOnLoad&&(this.webRtcPlayerObj.video.muted=!0),this.webRtcPlayerObj.onWebRtcOffer=function(e){if(i.ws&&1===i.ws.readyState){var t=JSON.stringify(e);console.log("%c[Outbound SS message (offer)]","background: lightgreen; color: black",e),i.ws.send(t)}},this.webRtcPlayerObj.onWebRtcCandidate=function(e){i.ws&&1===i.ws.readyState&&i.ws.send(JSON.stringify({type:"iceCandidate",candidate:e}))},this.webRtcPlayerObj.onWebRtcAnswer=function(e){if(i.ws&&1===i.ws.readyState){var t=JSON.stringify(e);console.log("%c[Outbound SS message (answer)]","background: lightgreen; color: black",e),i.ws.send(t)}},this.webRtcPlayerObj.onVideoInitialised=function(){i.ws&&1===i.ws.readyState&&(i.shouldShowPlayOverlay?(i.showPlayOverlay(),i.eventHandler.resizePlayerStyle()):(i.eventHandler.resizePlayerStyle(),i.playVideoStream()),0!==i.resolution[0]&&0!==i.resolution[1]&&i.changeResolution(i.resolution[0],i.resolution[1]))},this.webRtcPlayerObj.onDataChannelConnected=function(){i.ws&&1===i.ws.readyState&&(i.showTextOverlay("云渲染服务连接成功,等待画面推送中"),i.requestQualityControl(),setTimeout((function(){i.UDS||(i.UDS=new me(i,i.udsParams)),i.camera||i.initOthers(),i.dispatchEvent({type:"videoInitialised"})}),1e3))},this.webRtcPlayerObj.onNewVideoTrack=function(e){var t,n;null!=i&&null!==(t=i.webRtcPlayerObj)&&void 0!==t&&t.onVideoInitialised&&(null==i||null===(n=i.webRtcPlayerObj)||void 0===n||n.onVideoInitialised());i.isShowTestUI&&i.updateStreamList()},this.webRtcPlayerObj.onDataChannelMessage=function(e){var t=new Uint8Array(e);if(t[0]===re.QualityControlOwnership){var a=0!==t[1];console.log("Received quality controller message, will control quality: "+a),i.qualityController=a,i.qualityControlOwnershipCheckBox&&(i.qualityControlOwnershipCheckBox.disabled=a,i.qualityControlOwnershipCheckBox.checked=a)}else if(t[0]===re.Response){var r=new TextDecoder("utf-16").decode(e.slice(1));i.eventHandler.callRespone(JSON.parse(r))}else if(t[0]===re.Command){var o=new TextDecoder("utf-16").decode(e.slice(1));console.log(o);var s=JSON.parse(o);"onScreenKeyboard"===s.command&&i.showOnScreenKeyboard(s)}else if(t[0]===re.FreezeFrame)n(t);else if(t[0]===re.UnfreezeFrame)i.eventHandler.invalidateFreezeFrameOverlay();else if(t[0]===re.VideoEncoderAvgQP)i.videoEncoderQP=new TextDecoder("utf-16").decode(e.slice(1));else if(t[0]==re.LatencyTest){var l=new TextDecoder("utf-16").decode(e.slice(1));console.log("Got latency timings from UE."),console.log(l);var u=JSON.parse(l);i.webRtcPlayerObj&&i.webRtcPlayerObj.latencyTestTimings.SetUETimings(u)}else if(t[0]==re.InitialSettings){if(!i.isShowTestUI)return;var c=new TextDecoder("utf-16").decode(e.slice(1)),d=JSON.parse(c);if(d.PixelStreaming){if(!1===d.PixelStreaming.AllowPixelStreamingCommands){if(document.getElementById("encoder-min-qp-text").disabled=!0,document.getElementById("encoder-max-qp-text").disabled=!0,document.getElementById("webrtc-fps-text").disabled=!0,document.getElementById("webrtc-min-bitrate-text").disabled=!0,document.getElementById("webrtc-max-bitrate-text").disabled=!0,document.getElementById("show-fps-button").disabled=!0,document.getElementById("encoder-params-submit").disabled=!0,document.getElementById("webrtc-params-submit").disabled=!0,!document.getElementById("warning-elem-webrtc")){var h=document.createElement("p");h.innerText="(Disabled by -AllowPixelStreamingCommands=false)",h.classList="subtitle-text",h.id="warning-elem-webrtc",document.getElementById("webRTCSettingsHeader").appendChild(h)}if(!document.getElementById("warning-elem-encoder")){var f=document.createElement("p");f.innerText="(Disabled by -AllowPixelStreamingCommands=false)",f.classList="subtitle-text",f.id="warning-elem-encoder",document.getElementById("encoderSettingsHeader").appendChild(f)}console.warn("-AllowPixelStreamingCommands=false, sending console commands from browser to UE is disabled, including toggling FPS and changing encoder settings from the browser.")}d.PixelStreaming.DisableLatencyTest&&(document.getElementById("test-latency-button").disabled=!0,document.getElementById("test-latency-button").title="Disabled by -PixelStreamingDisableLatencyTester=true",console.warn("-PixelStreamingDisableLatencyTester=true, requesting latency report from the the browser to UE is disabled."))}d.Encoder&&(document.getElementById("encoder-min-qp-text").value=d.Encoder.MinQP,document.getElementById("encoder-max-qp-text").value=d.Encoder.MaxQP),d.WebRTC&&(document.getElementById("webrtc-fps-text").value=d.WebRTC.FPS,document.getElementById("webrtc-min-bitrate-text").value=d.WebRTC.MinBitrate/1e3,document.getElementById("webrtc-max-bitrate-text").value=d.WebRTC.MaxBitrate/1e3)}else if(t[0]==re.FileExtension)!function(e){this.file.receiving||(this.file.mimetype="",this.file.extension="",this.file.receiving=!0,this.file.valid=!1,this.file.size=0,this.file.data=[],this.file.timestampStart=(new Date).getTime(),console.log("Received first chunk of this.file"));var t=new TextDecoder("utf-16").decode(e.slice(1));console.log(t),this.file.extension=t}(t);else if(t[0]==re.FileMimeType)!function(e){this.file.receiving||(this.file.mimetype="",this.file.extension="",this.file.receiving=!0,this.file.valid=!1,this.file.size=0,this.file.data=[],this.file.timestampStart=(new Date).getTime(),console.log("Received first chunk of this.file"));var t=new TextDecoder("utf-16").decode(e.slice(1));console.log(t),this.file.mimetype=t}(t);else if(t[0]==re.FileContents)!function(e){if(this.file.receiving){this.file.size=Math.ceil(new DataView(e.slice(1,5).buffer).getInt32(0,!0)/16379);var t=e.slice(5);if(this.file.data.push(t),console.log("Received this.file chunk: ".concat(this.file.data.length,"/").concat(this.file.size)),this.file.data.length===this.file.size){this.file.receiving=!1,this.file.valid=!0,console.log("Received complete this.file");var i=(new Date).getTime()-this.file.timestampStart,n=Math.round(16*this.file.size*1024/i);console.log("Average transfer bitrate: ".concat(n,"kb/s over ").concat(i/1e3," seconds"));var a=new Blob(this.file.data,{type:this.file.mimetype}),r=document.createElement("a");r.setAttribute("href",URL.createObjectURL(a)),r.setAttribute("download","transfer.".concat(this.file.extension));var o=$(r);o.appendTo("body"),o.remove()}else this.file.data.length>this.file.size&&(this.file.receiving=!1,console.error("Received bigger this.file than advertised: ".concat(this.file.data.length,"/").concat(this.file.size)))}}(t);else if(t[0]==re.Mouse){var p=new TextDecoder("utf-16").decode(e.slice(1));this.eventHandler.dispatchMouseEvent(p)}else if(t[0]==re.Keyboard){var m=new TextDecoder("utf-16").decode(e.slice(1));this.eventHandler.dispatchKeyboardEvent(m)}else if(t[0]==re.InputControlOwnership||t[0]==re.Protocol)new TextDecoder("utf-16").decode(e.slice(1));else if(t[0]===re.AckV2)i._handleAckV2&&i._handleAckV2(e);else if(t[0]===re.TextureMissingNack)try{var g=new TextDecoder("utf-16").decode(e.slice(1));if(!g)return;var v=JSON.parse(g),y=v&&"string"==typeof v.hash?v.hash:"";i.textureBus&&y&&i.textureBus.markMissing(y)}catch(e){console.warn("[CRE] TextureMissingNack parse failed:",e)}else console.error("unrecognized data received, packet ID ".concat(t[0]))},this.eventHandler.registerInputs(this.webRtcPlayerObj.video),"ontouchstart"in document.documentElement&&this.createOnScreenKeyboardHelpers(e),this.webRtcPlayerObj.video}},{key:"setupStats",value:function(){var e=this;this.webRtcPlayerObj.aggregateStats(1e3);var t=3e5,i=t;this.webRtcPlayerObj.onAggregatedStats=function(n){for(var a=new Intl.NumberFormat(window.navigator.language,{maximumFractionDigits:0}),r=new Intl.NumberFormat(window.navigator.language,{maximumFractionDigits:0,minimumIntegerDigits:2}),o=(n.timestamp-n.timestampStart)/1e3,s=[],l=[60,60],u=0;u<l.length;u++)s.push(o%l[u]),o/=l[u];s.push(o);for(var c=s[0],d=Math.floor(s[1]),h=Math.floor([s[2]]),f="B",p=n.hasOwnProperty("bytesReceived")?n.bytesReceived:0,m=["kB","MB","GB"],g=0;g<m.length&&!(p<1e5);g++)p/=1e3,f=m[g];n.receivedBytes=""+p+m;var v=document.getElementById("qualityStatus"),y=function(e){if(v)var t=e,i=1,n=setInterval((function(){v?(i-=.1,v.style="opacity: ".concat(Math.abs(2*(i-.5))),i<=.1&&(0==--t?clearInterval(n):i=1)):clearInterval(n)}),100/e)},b="",x="lime";e.videoEncoderQP>35?(x="red",y(2),b+='<div style="color: '.concat(x,'">Very blocky encoding quality</div>')):e.videoEncoderQP>26&&(x="orange",y(1),b+='<div style="color: '.concat(x,'">Blocky encoding quality</div>')),v&&(v.className="".concat(x,"Status")),b+="<div>Duration: ".concat(r.format(h),":").concat(r.format(d),":").concat(r.format(c),"</div>"),b+="<div>Video Resolution: ".concat(n.hasOwnProperty("frameWidth")&&n.frameWidth&&n.hasOwnProperty("frameHeight")&&n.frameHeight?n.frameWidth+"x"+n.frameHeight:"Chrome only","</div>"),b+="<div>Received (".concat(f,"): ").concat(a.format(p),"</div>"),b+="<div>Frames Decoded: ".concat(n.hasOwnProperty("framesDecoded")?a.format(n.framesDecoded):"Chrome only","</div>"),b+="<div>Packets Lost: ".concat(n.hasOwnProperty("packetsLost")?a.format(n.packetsLost):"Chrome only","</div>"),b+="<div>Framerate: ".concat(n.hasOwnProperty("framerate")?a.format(n.framerate):"Chrome only","</div>"),b+="<div>Frames dropped: ".concat(n.hasOwnProperty("framesDropped")?a.format(n.framesDropped):"Chrome only","</div>"),b+="<div>Net RTT (ms): ".concat(n.hasOwnProperty("currentRoundTripTime")?a.format(1e3*n.currentRoundTripTime):"Can't calculate","</div>"),b+="<div>Browser receive to composite (ms): ".concat(n.hasOwnProperty("receiveToCompositeMs")?a.format(n.receiveToCompositeMs):"Chrome only","</div>"),b+='<div style="color: '.concat(x,'">Bitrate (kbps): ').concat(n.hasOwnProperty("bitrate")?a.format(n.bitrate):"Chrome only","</div>"),b+='<div style="color: '.concat(x,'">Video Quantization Parameter: ').concat(e.videoEncoderQP,"</div>");var S=document.getElementById("stats");if(S&&(S.innerHTML=b),e.printStats&&n.timestampStart&&n.timestamp-n.timestampStart>i&&(e.ws&&1===e.ws.readyState&&(console.log("-> SS: stats\n".concat(JSON.stringify(n))),e.ws.send(JSON.stringify({type:"stats",data:n}))),i+=t),e.dispatchEvent({type:"aggregatedStats",data:n}),e.webRtcConnectionStatsCallback&&"function"==typeof e.webRtcConnectionStatsCallback)try{var w=n.hasOwnProperty("packetsLost")?n.packetsLost:0,N=n.hasOwnProperty("currentRoundTripTime")?1e3*n.currentRoundTripTime:0,U=n.hasOwnProperty("framerate")?n.framerate:0,k=0;void 0!==e.lastPacketsLost&&(k=Math.max(0,w-e.lastPacketsLost)),e.lastPacketsLost=w;var C=k>0||N>300||U<10&&k>0,T=C?"⚠️ 网络拥堵":"✅ 网络良好",R=k>30?"丢失 ".concat(k," 包/次"):"0 (稳定)",O={bitrate:n.hasOwnProperty("bitrate")?n.bitrate:null,avgBitrate:n.hasOwnProperty("avgBitrate")?n.avgBitrate:null,framerate:U,resolution:{width:n.hasOwnProperty("frameWidth")?n.frameWidth:null,height:n.hasOwnProperty("frameHeight")?n.frameHeight:null},roundTripTime:N,packetsLost:w,framesDroppedPercentage:n.hasOwnProperty("framesDroppedPercentage")?n.framesDroppedPercentage:null,quantizationParameter:e.videoEncoderQP,originData:n,diagnosis:{isCongested:C,status:T,instantPacketLoss:k,instantPacketLossText:R}};e.webRtcConnectionStatsCallback(O)}catch(e){console.error("Error calling webRtcConnectionStatsCallback:",e)}},this.webRtcPlayerObj.latencyTestTimings.OnAllLatencyTimingsReady=function(e){if(e.BrowserReceiptTimeMs){var t=e.BrowserReceiptTimeMs-e.TestStartTimeMs,i=e.UEEncodeMs,n=e.UECaptureToSendMs,a=e.UETransmissionTimeMs-e.UEReceiptTimeMs,r=t-a,o=null,s=null;e.FrameDisplayDeltaTimeMs&&e.BrowserReceiptTimeMs&&(o=e.FrameDisplayDeltaTimeMs+r+("string"==typeof n?0:n),s=e.FrameDisplayDeltaTimeMs+(t-r-a));var l="";l+="<div>Net latency RTT (ms): ".concat(r.toFixed(2),"</div>"),l+="<div>UE Encode (ms): ".concat("string"==typeof i?i:i.toFixed(2),"</div>"),l+="<div>UE Send to capture (ms): ".concat("string"==typeof n?n:n.toFixed(2),"</div>"),l+="<div>UE probe duration (ms): ".concat(a.toFixed(2),"</div>"),l+=e.FrameDisplayDeltaTimeMs&&e.BrowserReceiptTimeMs?"<div>Browser composite latency (ms): ".concat(e.FrameDisplayDeltaTimeMs.toFixed(2),"</div>"):"",l+=s?"<div>Total browser latency (ms): ".concat(s.toFixed(2),"</div>"):"",l+=o?"<div>Total latency (ms): ".concat(o.toFixed(2),"</div>"):"";var u=document.getElementById("LatencyStats");u&&(u.innerHTML=l)}}}},{key:"onWebRtcConnectionStats",value:function(e){"function"==typeof e?(this.webRtcConnectionStatsCallback=e,this.webRtcPlayerObj&&!this.webRtcPlayerObj.aggregateStatsIntervalId&&this.setupStats()):console.warn("onWebRtcConnectionStats: callback must be a function")}},{key:"onWebRtcOffer",value:function(e){this.webRtcPlayerObj.receiveOffer(e),this.isShowTestUI&&this.setupStats()}},{key:"onWebRtcAnswer",value:function(e){this.webRtcPlayerObj.receiveAnswer(e),this.isShowTestUI&&this.setupStats()}},{key:"onWebRtcIce",value:function(e){this.webRtcPlayerObj&&this.webRtcPlayerObj.handleCandidateFromServer(e)}},{key:"updateVideoStreamSize",value:function(){var e=this;this.matchViewportResolution&&(clearTimeout(this.resizeTimeout),this.resizeTimeout=setTimeout((function(){var t=document.getElementById("player");if(t){var i=t.clientWidth,n=t.clientHeight;if(i>3840||n>2160){var a=3840/i,r=2160/n,o=Math.min(a,r);i=Math.floor(i*o),n=Math.floor(n*o)}e.changeResolution(i,n),console.log("Debounced resize: Resolution updated to ".concat(i,"x").concat(n))}}),500))}},{key:"_waitForChannelDrain",value:function(e,t){return e?(0===e.bufferedAmountLowThreshold&&(e.bufferedAmountLowThreshold=262144),e.bufferedAmount<=t?Promise.resolve():new Promise((function(t){var i=!1,n=function(){i||(i=!0,e.removeEventListener("bufferedamountlow",n),t())};e.addEventListener("bufferedamountlow",n),setTimeout((function(){return n()}),2e3)}))):Promise.resolve()}},{key:"_pickDescriptorChannel",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=this.webRtcPlayerObj;if(!i)return{channel:null,useBulk:!1,useTexture:!1};var n=i.dcClient||null,a=!(!t.preferTexture||!this.enableTextureChannel);return{channel:n,useBulk:!a&&this.enableBulkChannel&&e>=this.bulkChannelThreshold,useTexture:a}}},{key:"_enqueueSend",value:function(e,t){this._sendQueues||(this._sendQueues={});var i=(this._sendQueues[e]||Promise.resolve()).then(t,t);return this._sendQueues[e]=i.catch((function(){})),i}},{key:"emitDescriptor",value:function(e,t){var i=this,n=_t(t),a=2*n.length;if(a>67108864)return console.error("数据量超出最大传输范围64MB!"),!1;var r=(new TextEncoder).encode(n),o=this.enableTextureBus&&this._hasTextureRef(t),s=this._hasColumnStoreJsonData(t);if(this.enableV2Protocol&&(r.byteLength>=16384||o||s))return this._emitDescriptorV2(e,r,{preferTexture:o,originalDescriptor:t});if(s&&!this.enableV2Protocol)return console.error("[CloudRenderApp] column-store jsondata requires enableV2Protocol=true; descriptor dropped",{messageType:e}),Promise.resolve(!1);var l=49152,u=this._pickDescriptorChannel(a),c=u.channel,d=u.useBulk,h=d?"bulk":"main",f=this.dataChannelHighWatermark;return this._enqueueSend(h,w(D().mark((function t(){var r,o,s,u;return D().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(a<l)){t.next=6;break}if(!c){t.next=4;break}return t.next=4,i._waitForChannelDrain(c,f);case 4:return i._sendStringBufferDataOn(c,e,n),t.abrupt("return",!0);case 6:r=Math.ceil(a/l),o=Math.floor(24576),s=0;case 9:if(!(s<r)){t.next=18;break}if(u=n.slice(s*o,(s+1)*o),!c){t.next=14;break}return t.next=14,i._waitForChannelDrain(c,f);case 14:i._sendStringBufferDataOn(c,e,u,r,s+1);case 15:s++,t.next=9;break;case 18:return i.printStats&&d&&console.log("[CRE] descriptor sent via bulk queue, bytes=".concat(a,", chunks=").concat(r)),t.abrupt("return",!0);case 20:case"end":return t.stop()}}),t)}))))}},{key:"_emitDescriptorV2",value:function(e,t){var i=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=n.preferTexture,r=void 0!==a&&a,o=n.originalDescriptor,s=void 0===o?null:o,l=this._pickDescriptorChannel(t.byteLength,{preferTexture:r}),u=l.channel,c=l.useBulk,d=l.useTexture,h=d?"texture":c?"bulk":"main",f=this.dataChannelHighWatermark,p=function(){var n=w(D().mark((function n(){var a,r,o;return D().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,Mt(t);case 2:return a=n.sent,n.next=5,i._sendBinaryFramedV2(le.UIInteractionV2,e,1,a,u,f,h);case 5:return d&&(i._v3Metrics.textureChannelBytes+=a.byteLength),i.printStats&&(r=(100*(1-a.byteLength/t.byteLength)).toFixed(1),o=d?"texture-queue":c?"bulk-queue":"main",console.log("[CRE] V2 descriptor: utf8=".concat(t.byteLength,"B gz=").concat(a.byteLength,"B ratio=-").concat(r,"% innerType=").concat(e," via=").concat(o))),n.abrupt("return",!0);case 8:case"end":return n.stop()}}),n)})));return function(){return n.apply(this,arguments)}}();return this.enableV2Fallback&&s?this._enqueueSend(h,(function(){return p().catch((function(t){return i._v3Metrics.v2ErrorCount++,console.warn("[CRE] V2 path failed, fallback to legacy type=50",t),i._emitLegacyFallback(e,s)}))})):this._enqueueSend(h,p)}},{key:"_sendBinaryFramedV2",value:(n=w(D().mark((function e(t,i,n,a,r,o){var s,l,u,c,d,h,f,p,m,g,v,y,b,x,S,w,N,U=arguments;return D().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(u=U.length>6&&void 0!==U[6]?U[6]:"main",c=16,d=null===(s=this.webRtcPlayerObj)||void 0===s?void 0:s.pcClient,h=(null==d||null===(l=d.sctp)||void 0===l?void 0:l.maxMessageSize)||262144,f=Math.min(h-32,245760)-c,p=this._v2SeqId=this._v2SeqId+1>>>0,m=Math.ceil(a.byteLength/f)||1,(g=r||this.webRtcPlayerObj&&this.webRtcPlayerObj.dcClient)&&"open"===g.readyState){e.next=10;break}throw new Error("[CRE] _sendBinaryFramedV2: no open channel");case 10:v=this.enableNackRetransmit?[]:null,y=0;case 12:if(!(y<m)){e.next=43;break}return b=y*f,x=a.subarray(b,b+f),S=new ArrayBuffer(c+x.byteLength),(w=new DataView(S)).setUint8(0,t),w.setUint8(1,i),w.setUint8(2,n),w.setUint8(3,0),w.setUint32(4,p,!0),w.setUint32(8,m,!0),w.setUint32(12,y,!0),new Uint8Array(S,c).set(x),v&&v.push(S),e.next=28,this._waitForChannelDrain(g,o);case 28:e.prev=28,g.send(S),e.next=36;break;case 32:throw e.prev=32,e.t0=e.catch(28),console.error("[CRE] _sendBinaryFramedV2 send error:",e.t0),e.t0;case 36:if(!((N=this.bulkYieldEveryNChunks)>0&&("bulk"===u||"texture"===u)&&y+1<m&&(y+1)%N==0)){e.next=40;break}return e.next=40,new Promise((function(e){return setTimeout(e,0)}));case 40:y++,e.next=12;break;case 43:return v&&this._cacheSentChunks(p,v,g),e.abrupt("return",p);case 45:case"end":return e.stop()}}),e,this,[[28,32]])}))),function(e,t,i,a,r,o){return n.apply(this,arguments)})},{key:"_cacheSentChunks",value:function(e,t,i){if(this._sentChunksWriteCount=this._sentChunksWriteCount+1>>>0,!(15&this._sentChunksWriteCount)){var n,a=Date.now(),r=T(this._sentChunks);try{for(r.s();!(n=r.n()).done;){var o=B(n.value,2),s=o[0];a-o[1].ts>this._sentChunksTtlMs&&this._sentChunks.delete(s)}}catch(e){r.e(e)}finally{r.f()}}if(this._sentChunks.size>=this._sentChunksMaxSize)for(var l=Math.max(1,Math.floor(this._sentChunksMaxSize/4)),u=this._sentChunks.keys(),c=0;c<l;c++){var d=u.next().value;if(void 0===d)break;this._sentChunks.delete(d)}this._sentChunks.set(e,{chunks:t,channel:i,ts:Date.now()})}},{key:"_retransmitChunks",value:(i=w(D().mark((function e(t,i){var n,a,r,o,s,l;return D().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((n=this._sentChunks.get(t))&&Array.isArray(n.chunks)&&0!==n.chunks.length){e.next=3;break}return e.abrupt("return",!1);case 3:if((a=n.channel)&&"open"===a.readyState){e.next=6;break}return e.abrupt("return",!1);case 6:r=this.dataChannelHighWatermark,o=T(i),e.prev=8,o.s();case 10:if((s=o.n()).done){e.next=26;break}if(!("number"!=typeof(l=s.value)||l<0||l>=n.chunks.length)){e.next=14;break}return e.abrupt("continue",24);case 14:return e.next=16,this._waitForChannelDrain(a,r);case 16:e.prev=16,a.send(n.chunks[l]),e.next=24;break;case 20:return e.prev=20,e.t0=e.catch(16),console.warn("[CRE] _retransmitChunks send failed:",e.t0),e.abrupt("return",!1);case 24:e.next=10;break;case 26:e.next=31;break;case 28:e.prev=28,e.t1=e.catch(8),o.e(e.t1);case 31:return e.prev=31,o.f(),e.finish(31);case 34:return n.ts=Date.now(),e.abrupt("return",!0);case 36:case"end":return e.stop()}}),e,this,[[8,28,31,34],[16,20]])}))),function(e,t){return i.apply(this,arguments)})},{key:"_awaitAckV2",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=i.timeoutMs,a=void 0===n?this._defaultAckTimeoutMs:n,r=i.meta,o=void 0===r?null:r,s=this._pendingAcks.get(e);return s&&(s.timer&&clearTimeout(s.timer),s.reject(new Error("[CRE] AckV2: superseded by new sender with same seqId")),this._pendingAcks.delete(e)),new Promise((function(i,n){var r={resolve:i,reject:n,timer:null,meta:o,ts:Date.now(),timeoutMs:a,retriesRemaining:t.enableNackRetransmit?t.maxNackRetries:0};a>0&&(r.timer=setTimeout((function(){if(t._pendingAcks.get(e)===r){t._pendingAcks.delete(e),t._sentChunks.delete(e),t._v3Metrics.ackTimeoutCount++;var i=new Error("[CRE] AckV2 timeout (seqId=".concat(e,", ").concat(a,"ms)"));i.seqId=e,i.meta=o,i.reason="ack-timeout",n(i)}}),a)),t._pendingAcks.set(e,r)}))}},{key:"_handleAckV2",value:function(e){var t=this,i=e instanceof ArrayBuffer?new Uint8Array(e):e instanceof Uint8Array?e:new Uint8Array(e.buffer,e.byteOffset,e.byteLength);if(i.byteLength<3)console.warn("[CRE] AckV2: frame too short",i.byteLength);else{var n,a;try{n=new TextDecoder("utf-16").decode(new Uint8Array(i.buffer,i.byteOffset+1,i.byteLength-1))}catch(e){return void console.warn("[CRE] AckV2: UTF-16 decode failed",e)}try{a=JSON.parse(n)}catch(e){return void console.warn("[CRE] AckV2: JSON parse failed",e,n)}var r=a&&"number"==typeof a.seqId?a.seqId>>>0:-1,o=a&&"number"==typeof a.status?a.status:2,s=Array.isArray(a&&a.missingIndices)?a.missingIndices:void 0,l=this._pendingAcks.get(r);if(l){if(1===o&&this.enableNackRetransmit&&l.retriesRemaining>0&&Array.isArray(s)&&s.length>0)return l.retriesRemaining--,this._v3Metrics.nackRetransmitCount++,l.timer&&clearTimeout(l.timer),l.ts=Date.now(),l.timeoutMs>0&&(l.timer=setTimeout((function(){if(t._pendingAcks.get(r)===l){t._pendingAcks.delete(r),t._sentChunks.delete(r),t._v3Metrics.ackTimeoutCount++;var e=new Error("[CRE] AckV2 timeout after retransmit (seqId=".concat(r,", ").concat(l.timeoutMs,"ms)"));e.seqId=r,e.meta=l.meta,e.reason="ack-timeout",l.reject(e)}}),l.timeoutMs)),this._retransmitChunks(r,s).then((function(e){if(!e&&t._pendingAcks.get(r)===l){t._pendingAcks.delete(r),t._sentChunks.delete(r),l.timer&&clearTimeout(l.timer),t._v3Metrics.nackRetransmitGiveUpCount++;var i=new Error("[CRE] NACK retransmit failed (seqId=".concat(r,"): cache evicted or channel closed"));i.seqId=r,i.meta=l.meta,i.reason="nack-retransmit-failed",l.reject(i)}})),void(this.printStats&&console.log("[CRE] AckV2 PARTIAL seqId=".concat(r," retransmit ").concat(s.length," chunks, retriesLeft=").concat(l.retriesRemaining)));this._pendingAcks.delete(r),this._sentChunks.delete(r),l.timer&&clearTimeout(l.timer);var u=l.ts?Date.now()-l.ts:-1;if(0===o)this._v3Metrics.ackOkCount++,this.printStats&&console.log("[CRE] AckV2 OK seqId=".concat(r," rtt=").concat(u,"ms meta="),l.meta),l.resolve({status:o,missingIndices:s});else{this._v3Metrics.ackNackCount++;var c=new Error("[CRE] AckV2 NACK (seqId=".concat(r,", status=").concat(o,")"));c.seqId=r,c.status=o,c.missingIndices=s,c.meta=l.meta,c.reason=1===o?"ack-partial":"ack-error",l.reject(c)}}}}},{key:"_emitLegacyFallback",value:function(e,t){var i=this;try{var n=_t(this._rewriteTextureRefToBase64(t)),a=2*n.length,r=49152,o=this.webRtcPlayerObj?this.webRtcPlayerObj.dcClient:null,s=this.dataChannelHighWatermark;if(this._v3Metrics.fallbackCount++,a<r)return o?this._waitForChannelDrain(o,s).then((function(){return i._sendStringBufferDataOn(o,e,n),!0})):(this._sendStringBufferDataOn(o,e,n),Promise.resolve(!0));var l=Math.ceil(a/r),u=Math.floor(24576);return w(D().mark((function t(){var a,r;return D().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:a=0;case 1:if(!(a<l)){t.next=10;break}if(r=n.slice(a*u,(a+1)*u),!o){t.next=6;break}return t.next=6,i._waitForChannelDrain(o,s);case 6:i._sendStringBufferDataOn(o,e,r,l,a+1);case 7:a++,t.next=1;break;case 10:return t.abrupt("return",!0);case 11:case"end":return t.stop()}}),t)})))()}catch(e){throw console.error("[CRE] legacy fallback failed:",e),e}}},{key:"_hasTextureRef",value:function(e){if(null==e||"object"!==G(e))return!1;if(Array.isArray(e)){for(var t=0;t<e.length;t++)if(this._hasTextureRef(e[t]))return!0;return!1}for(var i=0,n=Object.keys(e);i<n.length;i++){var a=n[i],r=e[a];if("string"==typeof r&&r&&/TextureRef$/.test(a))return!0;if(r&&"object"===G(r)&&this._hasTextureRef(r))return!0}return!1}},{key:"_hasColumnStoreJsonData",value:function(e){if(null==e||"object"!==G(e))return!1;if(Array.isArray(e)){for(var t=0;t<e.length;t++)if(this._hasColumnStoreJsonData(e[t]))return!0;return!1}var i=e.jsondata;if(i&&"object"===G(i)&&!Array.isArray(i)&&1===i.__cs)return!0;var n=e.params;return!(!n||"object"!==G(n)||!this._hasColumnStoreJsonData(n))}},{key:"_rewriteTextureRefToBase64",value:function(e){var t=this;if(null==e||"object"!==G(e))return e;if(Array.isArray(e))return e.map((function(e){return t._rewriteTextureRefToBase64(e)}));for(var i={},n=this.textureBus,a=0,r=Object.keys(e);a<r.length;a++){var o=r[a],s=e[o];if(/TextureRef$/.test(o)&&"string"==typeof s&&s){var l=o.slice(0,-3),u=n?n.getBase64Sync(s):null;if(u){i[o]=null,i[l]=u;continue}i[o]=s}else i[o]=this._rewriteTextureRefToBase64(s)}return i}},{key:"sendStringBufferData",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,a=this.webRtcPlayerObj?this.webRtcPlayerObj.dcClient:null;this._sendStringBufferDataOn(a,e,t,i,n)}},{key:"_sendStringBufferDataOn",value:function(e,t,i){var n={total:arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,index:arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,content:i},a=JSON.stringify(n),r=new DataView(new ArrayBuffer(3+2*a.length)),o=0;r.setUint8(o,t),o+=1,r.setUint16(o,a.length,!0),o+=2;for(var s=0;s<a.length;s++)r.setUint16(o,a.charCodeAt(s),!0),o+=2;this.resetAfkWarningTimer&&this.resetAfkWarningTimer();var l=r.buffer,u=e||this.webRtcPlayerObj&&this.webRtcPlayerObj.dcClient;if(u&&"open"===u.readyState)try{u.send(l)}catch(e){console.error("emitDescriptor send error:",e)}else this.sendInputData(l)}},{key:"emitUIInteraction",value:function(e){var t,i;(console.log(e),"cloud"===this.renderMode)?this.emitDescriptor(le.UIInteraction,e):"undefined"!=typeof ue&&null!==(t=ue)&&void 0!==t&&null!==(i=t.interface)&&void 0!==i&&i.broadcast?ue.interface.broadcast(JSON.stringify(e)):console.warn("ue.interface.broadcast is not available in this environment.")}},{key:"emitCommand",value:function(e){this.emitDescriptor(le.Command,e)}},{key:"requestInitialSettings",value:function(){this.sendInputData(new Uint8Array([le.RequestInitialSettings]).buffer)}},{key:"requestQualityControl",value:function(){this.qualityController||this.sendInputData(new Uint8Array([le.RequestQualityControl]).buffer)}},{key:"setupNormalizeAndQuantize",value:function(){var e=document.getElementById("player"),t=e.getElementsByTagName("video");if(e&&t.length>0){var i=e.clientHeight/e.clientWidth,n=t[0].videoHeight/t[0].videoWidth;if(i>n){this.printInputs&&console.log("Setup Normalize and Quantize for playerAspectRatio > videoAspectRatio");var a=i/n;this.normalizeAndQuantizeUnsigned=function(t,i){var n=t/e.clientWidth,r=a*(i/e.clientHeight-.5)+.5;return n<0||n>1||r<0||r>1?{inRange:!1,x:65535,y:65535}:{inRange:!0,x:65536*n,y:65536*r}},this.unquantizeAndDenormalizeUnsigned=function(t,i){var n=(i/65536-.5)/a+.5;return{x:t/65536*e.clientWidth,y:n*e.clientHeight}},this.normalizeAndQuantizeSigned=function(t,i){return{x:32767*(t/(.5*e.clientWidth)),y:32767*(a*i/(.5*e.clientHeight))}}}else{this.printInputs&&console.log("Setup Normalize and Quantize for playerAspectRatio <= videoAspectRatio");var r=n/i;this.normalizeAndQuantizeUnsigned=function(t,i){var n=r*(t/e.clientWidth-.5)+.5,a=i/e.clientHeight;return n<0||n>1||a<0||a>1?{inRange:!1,x:65535,y:65535}:{inRange:!0,x:65536*n,y:65536*a}},this.unquantizeAndDenormalizeUnsigned=function(t,i){var n=i/65536;return{x:((t/65536-.5)/r+.5)*e.clientWidth,y:n*e.clientHeight}},this.normalizeAndQuantizeSigned=function(t,i){return{x:32767*(r*t/(.5*e.clientWidth)),y:32767*(i/(.5*e.clientHeight))}}}}}},{key:"createOnScreenKeyboardHelpers",value:function(e){var t=this;null===document.getElementById("this.hiddenInput")&&(this.hiddenInput=document.createElement("input"),this.hiddenInput.id="this.hiddenInput",this.hiddenInput.maxLength=0,e.appendChild(this.hiddenInput)),null===document.getElementById("this.editTextButton")&&(this.editTextButton=document.createElement("button"),this.editTextButton.id="this.editTextButton",this.editTextButton.innerHTML="edit text",e.appendChild(this.editTextButton),this.editTextButton.classList.add("hiddenState"),this.editTextButton.addEventListener("click",(function(){t.hiddenInput.focus()})))}},{key:"showOnScreenKeyboard",value:function(e){if(e.showOnScreenKeyboard){this.editTextButton.classList.remove("hiddenState");var t=this.unquantizeAndDenormalizeUnsigned(e.x,e.y);this.editTextButton.style.top=t.y.toString()+"px",this.editTextButton.style.left=(t.x-40).toString()+"px"}else this.editTextButton.classList.add("hiddenState"),this.hiddenInput.blur()}},{key:"start",value:function(e,t){var i=document.getElementById("qualityStatus");i&&(i.className="grey-status");var n=document.getElementById("stats");n&&(n.innerHTML="Not connected"),!this.connectOnLoad||this.isReconnection?(this.showConnectOverlay(),this.eventHandler.invalidateFreezeFrameOverlay(),this.shouldShowPlayOverlay=!0,this.eventHandler.resizePlayerStyle()):(console.log("直接链接~~~~~~"),this.connect(e,t))}},{key:"buildingGrowthAnimate",value:function(e){var t=e.state,i=void 0===t?"play":t,n=e.group,a=void 0===n?1:n,r=e.duration,o=void 0===r?3e3:r,s=e.startHeight,l=void 0===s?0:s,u=e.endHeight,c=void 0===u?100:u,d=e.loop,h=void 0!==d&&d,f=e.easing,p=void 0===f?"Linear":f,m=e.sliceColor,g=void 0===m?{r:1,g:0,b:0}:m,v=e.sliceBrightness,y=void 0===v?30:v,b=e.colorHeight,x=void 0===b?100:b;this.emitUIInteraction({excuteName:K.BUILD_GROWTHANIMATE,params:JSON.stringify({State:i,Group:a,Duration:o,StartHeight:l,EndHeight:c,Loop:h,Easing:p,SliceColor:g,SliceBrightness:y,ColorHeight:x})})}},{key:"changeResolution",value:function(e,t){if(void 0===e||void 0===t||e<=0||t<=0)console.warn("[PixelStream] 传入的分辨率参数无效:",e,t);else{var i=4096,n=e,a=t,r=[];if(n>i)a=(n=i)/(e/t),r.push("宽度 ".concat(e," 超过安全限制 ").concat(i,",已按比例缩放"));var o=2*Math.floor(n/2),s=2*Math.floor(a/2);o===n&&s===a||n%2==0&&a%2==0||r.push("分辨率包含奇数,已修正为偶数"),a=s,(n=o)===e&&a===t||console.warn("[PixelStream] 分辨率自动修正提示:\n"+"原目标: ".concat(e," x ").concat(t,"\n")+"修正后: ".concat(n," x ").concat(a,"\n")+"原因: ".concat(r.join(", ")||"数值取整")),console.log("[PixelStream] Sending command: r.SetRes ".concat(n,"x").concat(a)),this.emitUIInteraction({excuteName:Z.CONSOLE_COMMAND,params:{Command:"r.SetRes "+n+"x"+a}})}}},{key:"changeRenderBitrate",value:function(e){if(null!=e){if(-1===e)return console.log("执行命令: 解除码率限制 (Set to -1)"),this.excuteEngineConsoleCommand("PixelStreaming.Encoder.MaxBitrate -1"),void this.excuteEngineConsoleCommand("PixelStreaming.Encoder.TargetBitrate -1");var t=Number(e);if(!isNaN(t)){var i=(t=Math.max(1e5,t)).toFixed(0);this.excuteEngineConsoleCommand("PixelStreaming.Encoder.MaxBitrate "+i),this.excuteEngineConsoleCommand("PixelStreaming.Encoder.TargetBitrate "+i)}}else console.warn("传入的参数为空")}},{key:"excuteEngineConsoleCommand",value:function(e){void 0!==e?this.emitUIInteraction({excuteName:Z.CONSOLE_COMMAND,params:{Command:e}}):console.warn("传入的参数为空")}},{key:"Swtich3DTilesMode",value:function(e){var t=e.mode,i=e.tilesName;this.emitUIInteraction({excuteName:Q.SWITCH_TERRAIN_MODE,params:{Mode:t,TilesName:i}})}},{key:"enable3DTilesByName",value:function(e){var t=e.enable,i=void 0===t||t,n=e.tilesName;this.emitUIInteraction({excuteName:Q.ENABLE_3DTILES_BY_NAME,params:{Enable:i,TilesName:n}})}},{key:"hidden3DTilesItem",value:function(e){var t=e.hiddenList,i=void 0===t?[]:t,n=e.tilesName;Array.isArray(i)||(i=[]),this.emitUIInteraction({excuteName:Q.HIDDEN_3DTILES_ITEM,params:{HiddenList:i,TilesName:n}})}},{key:"changeWeather",value:function(e){console.warn("方法被移除,请使用UDS设置天气"),e&&this.UDS.changeWeather(e)}},{key:"changeTime",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:8,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;console.warn("方法被移除,请使用UDS设置时间"),this.UDS.changeTime(e,t)}},{key:"setWorldCenterPoint",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;if(void 0===e||void 0===t)return console.warn("传入的参数为空"),!1;this.emitUIInteraction({excuteName:Z.RESET_WORLD_CENTER,params:{Center:{Latitude:a.clamp(t,-90,90),Longitude:a.clamp(e,-180,180),Altitude:a.clamp(i,-500,8848)}}})}},{key:"SetPlanePOIMode",value:function(e){var t=e.enable,i=void 0!==t&&t,n=e.cullingScale,a=void 0===n?2:n,r=e.aspectRatio,o=void 0===r?1.777778:r,s=e.cameraFov,l=void 0===s?90:s,u=e.maxTilesCullingDistance,c=void 0===u?1e3:u,d=e.maxPOICullingDistance,h=void 0===d?2e3:d,f=e.poiSimplifyDistance,p=void 0===f?1500:f,m=e.maxLoadedPoiTilesNum,g=void 0===m?5:m;this.emitUIInteraction({excuteName:Q.SET_PLANE_POI_MODE,params:{EnablePoi:i,CullingScale:a,AspectRatio:o,CameraFov:l,MaxTilesCullingDistance:c,MaxPOICullingDistance:h,PoiSimplifyDistance:p,MaxLoadedPoiTilesNum:g}})}},{key:"moveTo",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{roll:0,pitch:0,yaw:0},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{duration:1,preload:!1,endLineDetect:!1,detectLength:5e4,flyOverLongitude:!1,zoom:-1,number:0,isGlobalMove:!1,globalCityCenter:null,callback:null};if(!e)return!1;this._silentlyRemoveEventListener(this.camera,"moveTo",this._moveToCallback),this._moveToCallback=i.callback,this.emitUIInteraction({excuteName:X.MOVE_TO,params:{Longitude:null==e?void 0:e.x,Latitude:null==e?void 0:e.y,Altitude:null==e?void 0:e.z,rotation:{Roll:null==t?void 0:t.roll,Pitch:null==t?void 0:t.pitch,Yaw:null==t?void 0:t.yaw},Duration:null==i?void 0:i.duration,Preload:null==i?void 0:i.preload,EndLineDetect:null==i?void 0:i.endLineDetect,DetectLength:null==i?void 0:i.detectLength,FlyOverLongitude:null==i?void 0:i.flyOverLongitude,Zoom:null==i?void 0:i.zoom,Number:null==i?void 0:i.number,IsGlobalMove:null==i?void 0:i.isGlobalMove,GlobalCityCenter:null==i?void 0:i.globalCityCenter}}),console.log("moveTo options is ",i),console.log("moveTo this.camera is ",this.camera),null!=i&&i.callback&&this.camera.addEventListener("moveTo",i.callback)}},{key:"moveCamera",value:function(e){var t=e.multiplier,i=void 0===t?1:t,n=e.x,a=void 0===n?0:n,r=e.y,o=void 0===r?0:r;this.emitUIInteraction({excuteName:X.MOVE,params:{Multiplier:i,ActionValue:{x:a,y:o}}})}},{key:"rotateCamera",value:function(e){var t=e.multiplier,i=void 0===t?1:t,n=e.yaw,a=void 0===n?0:n,r=e.pitch,o=void 0===r?0:r;this.emitUIInteraction({excuteName:X.ROTATE,params:{Multiplier:i,ActionValue:{x:a,y:o}}})}},{key:"zoomIn",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;this.emitUIInteraction({excuteName:X.ZOOM_IN,params:{Multiplier:e}})}},{key:"zoomOut",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;this.emitUIInteraction({excuteName:X.ZOOM_OUT,params:{Multiplier:e}})}},{key:"focusOn",value:function(e){var t,i,n,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{duration:1,index:-1,preload:!1,rotation:{roll:0,pitch:0,yaw:0},flyOverLongitude:!1,callback:null};if(!e)return!1;this.emitUIInteraction({excuteName:X.FOCUS_ON,params:{uuid:null==e?void 0:e.uuid,type:null==e?void 0:e.type,rotation:{Roll:null==a||null===(t=a.rotation)||void 0===t?void 0:t.roll,Pitch:null==a||null===(i=a.rotation)||void 0===i?void 0:i.pitch,Yaw:null==a||null===(n=a.rotation)||void 0===n?void 0:n.yaw},Duration:null==a?void 0:a.duration,Preload:null==a?void 0:a.preload,Index:null==a?void 0:a.index,FlyOverLongitude:null==a?void 0:a.flyOverLongitude}}),null!=a&&a.callback&&this.camera.addEventListener("focusOn",a.callback)}},{key:"OrbitAroundFocusPoint",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.traget,i=void 0===t?[]:t,n=e.distance,a=void 0===n?10:n,r=e.time,o=void 0===r?10:r,s=e.loop,l=void 0===s||s,u=e.pitch,c=void 0===u?-25:u;i?"number"==typeof a&&"number"==typeof o&&"number"==typeof c?this.emitUIInteraction({excuteName:X.ORBIT_AROUND,params:JSON.stringify({Start:!0,Target:i,Distance:a,Time:o,Loop:l,Pitch:c})}):console.warn("OrbitAroundFocusPoint: distance, time and pitch should be numbers."):console.warn("OrbitAroundFocusPoint: traget is required.")}},{key:"stopOrbitAround",value:function(){this.emitUIInteraction({excuteName:X.ORBIT_AROUND,params:JSON.stringify({Start:!1})})}},{key:"navigateByKeypoints",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=i.lockAll,a=void 0===n||n,r=i.speed,o=void 0===r?36:r,s=i.time,l=void 0===s?0:s,u=i.ignoreLag,c=void 0!==u&&u,d=i.name,h=void 0===d?"":d,f=i.patrolType,p=void 0===f?"default":f,m=i.followRotation,g=void 0===m?{Roll:!1,Pitch:!1,Yaw:!1}:m,v=i.finishDestory,y=void 0===v||v,b=i.rayDetectionDistance,x=void 0===b?1e3:b,S=i.callback,w=void 0===S?null:S,N=i.startCallback,U=void 0===N?null:N,k=i.finishCallback,C=void 0===k?null:k;if(!e||e.length<2)return!1;this._silentlyRemoveEventListener(this.camera,"navigationStart",this._navigationStartCallback),this._silentlyRemoveEventListener(this.camera,"navigationFinish",this._navigationFinishCallback),this._navigationStartCallback=U,this._navigationFinishCallback=C||w,U&&this.camera.addEventListener("navigationStart",U);for(var T=[],R=0,O=e.length;R<O;R++){var E=e[R];T.push(E[0],E[1],E[2]||10,E[3]||0,E[4]||0,E[5]||0)}setTimeout((function(){t.emitUIInteraction({excuteName:X.NAVIGATION,params:JSON.stringify({jsondata:T,Speed:o,Name:h,Time:l,IgnoreLag:c,LockAll:a,PatrolType:p,FollowRotation:g,RayDetectionDistance:x,FinishDestory:y})})}),100),(C||w)&&(C?this.camera.addEventListener("navigationFinish",C):this.camera.addEventListener("navigationFinish",w))}},{key:"pauseNavigation",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).patrolType,t=void 0===e?"default":e;this.emitUIInteraction({excuteName:X.NAVIGATION_PAUSE,params:{State:0,PatrolType:t}})}},{key:"resumeNavigation",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).patrolType,t=void 0===e?"default":e;this.emitUIInteraction({excuteName:X.NAVIGATION_PAUSE,params:{State:1,PatrolType:t}})}},{key:"stopNavigation",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=t.patrolType,n=void 0===i?"default":i,a=t.delayTime;setTimeout((function(){e.emitUIInteraction({excuteName:X.NAVIGATION_STOP,params:{PatrolType:n}})}),void 0===a?100:a)}},{key:"enableDataLayerByName",value:function(e,t){this.emitUIInteraction({excuteName:K.ENABLE_DATALAYER,params:{Visible:t,DataLayerName:e}})}},{key:"project",value:function(e,t){if(!e)return!1;this.emitUIInteraction({excuteName:X.PROJECT,params:{Position:{x:e.x,y:e.y,z:e.z}}}),this.camera.addEventListener("project",t)}},{key:"unproject",value:function(e,t){if(!e)return!1;this.emitUIInteraction({excuteName:X.UNPROJECT,params:{Position:{x:e.x,y:e.y}}}),this.camera.addEventListener("unproject",t)}},{key:"getAltitudeFromCoordinate",value:function(e,t){var i=this;if(!e)return!1;var n={Coordinate:e.coordinate,DetectLength:e.detectLength||100};this.addEventListener("getAltitude",t),setTimeout((function(){i.emitUIInteraction({excuteName:Q.GET_ALTITUDE,params:n})}),100)}},{key:"exit",value:function(){console.warn("方法将被移除,请使用new LevelManage().exit()"),this.emitUIInteraction({excuteName:Z.EXIT_CLIENT})}},{key:"restartGame",value:function(){console.warn("方法将被移除,new LevelManage().restartGame()"),this.emitUIInteraction({excuteName:Z.RESTART_GAME}),this.dispatchEvent({type:"gameResarted"})}},{key:"addToScene",value:function(e){e&&(this.scene.add(e),this.textureBus&&e.texture&&!e.textureRef&&this.textureBus.publishTexture(e.texture).then((function(t){var i=t.ref;e.textureRef=i})).catch((function(){})),e.materialNeedsUpdate=!1,e.matrixNeedsUpdate=!1,e.animateNeedsUpdate=!1,"TrafficLayer"===e.type?this.emitUIInteraction({excuteName:Z.CREATE_TRAFFIC_STREAM,params:e.toJSON(!1)}):"LayerBuilding"===e.type?this.emitUIInteraction({excuteName:Q.EVENT_LAYER_BUILDING,params:e.toJSON(!1)}):"SlopeAnalysis"===e.type?this.emitUIInteraction({excuteName:Q.UPDATA_SLOPE_ANALYSIS,params:e.toJSON()}):"ModelSlice"===e.type?this.emitUIInteraction({excuteName:"Interact_ModelSlice",params:e.toJSON()}):this.emitUIInteraction({excuteName:ee.ADD,params:e.toJSON(!1)}))}},{key:"removeFromScene",value:function(e){this.destoryObject(e)}},{key:"removeAllFromScene",value:function(){this.emitUIInteraction({excuteName:ee.DESTORY_ALL}),this.scene.clear()}},{key:"destoryObject",value:function(e){e&&("TrafficLayer"===e.type?this.emitUIInteraction({excuteName:Z.CLOSE_TRAFFIC_STREAM,params:e.toJSON(!1)}):"LayerBuilding"===e.type?(e.buildingState="destory",this.emitUIInteraction({excuteName:Q.EVENT_LAYER_BUILDING,params:e.toJSON(!1)})):"ModelSlice"===e.type?this.emitUIInteraction({excuteName:"Interact_ModelSlice",params:{Enable:!1}}):this.emitUIInteraction({excuteName:ee.DESTORY,uuid:e.uuid}),e.dispose&&e.dispose(),this.scene.remove(e))}},{key:"enableEdit",value:function(e,t,i){var n=null,a={};if(this.drawAndMeasureGroup||(this.drawAndMeasureGroup=new c,this.scene.add(this.drawAndMeasureGroup)),"measure"===e)switch(this.editMode="measure",n=te.ENABLE_MEASURE,t.toLowerCase()){case"polygon":case"measurearea":if(this.drawAndMeasureGroup.measureArea)this.drawAndMeasureGroup.measureArea.updateParameters(i);else{var r=new Et(i);this.drawAndMeasureGroup.measureArea=r,this.drawAndMeasureGroup.add(r)}a=this.drawAndMeasureGroup.measureArea.toJSON();break;case"line":case"measureline":if(this.drawAndMeasureGroup.measureLine)this.drawAndMeasureGroup.measureLine.updateParameters(i);else{var o=new zt(i);this.drawAndMeasureGroup.measureLine=o,this.drawAndMeasureGroup.add(o)}a=this.drawAndMeasureGroup.measureLine.toJSON();break;case"surfaceline":if(this.drawAndMeasureGroup.surfaceline)this.drawAndMeasureGroup.surfaceline.updateParameters(i);else{var s=new It(i);this.drawAndMeasureGroup.surfaceline=s,this.drawAndMeasureGroup.add(s)}a=this.drawAndMeasureGroup.surfaceline.toJSON();break;default:if(this.drawAndMeasureGroup.locationPoint)this.drawAndMeasureGroup.locationPoint.updateParameters(i);else{var l=new At(i);this.drawAndMeasureGroup.locationPoint=l,this.drawAndMeasureGroup.add(l)}a=this.drawAndMeasureGroup.locationPoint.toJSON()}else switch(this.editMode="draw",n=te.ENABLE_DRAW,t){case"polygon":if(this.drawAndMeasureGroup.polygon)for(var u in i)this.drawAndMeasureGroup.polygon[u]!==i[u]&&(this.drawAndMeasureGroup.polygon[u]=i[u]);else{var d=new yt(i);this.drawAndMeasureGroup.polygon=d,this.drawAndMeasureGroup.add(d)}a=this.drawAndMeasureGroup.polygon.toJSON(0);break;case"line":if(this.drawAndMeasureGroup.line)for(var h in i)this.drawAndMeasureGroup.line[h]!==i[h]&&(this.drawAndMeasureGroup.line[h]=i[h]);else{var f=new bt(i);this.drawAndMeasureGroup.line=f,this.drawAndMeasureGroup.add(f)}a=this.drawAndMeasureGroup.line.toJSON(0);break;default:if(this.drawAndMeasureGroup.point)for(var p in i)this.drawAndMeasureGroup.point[p]!==i[p]&&(this.drawAndMeasureGroup.point[p]=i[p]);else{var m=new xt(i);this.drawAndMeasureGroup.point=m,this.drawAndMeasureGroup.add(m)}a=this.drawAndMeasureGroup.point.toJSON()}this.emitUIInteraction({ExcuteName:n,params:a})}},{key:"closeEdit",value:function(){if(this.editMode){var e=te.CLOSE_DRAW;"measure"===this.editMode&&(e=te.CLOSE_MEASURE),this.emitUIInteraction({ExcuteName:e})}}},{key:"setFPS",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.emitUIInteraction({ExcuteName:K.ENABLE_FPS,params:{state:e}})}},{key:"removeAllEditObjects",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"all",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["point","line","polygon","surfaceline"];if(this.drawAndMeasureGroup&&!(this.drawAndMeasureGroup.children.length<1)){var i=[];if(e)switch(e){case"draw":(!Array.isArray(t)||t.length<1)&&(t=["point","line","polygon"]),t.indexOf("polygon")>-1&&this.drawAndMeasureGroup.polygon&&(i.push(this.drawAndMeasureGroup.polygon.uuid),this.drawAndMeasureGroup.polygon.removeFromParent(),this.drawAndMeasureGroup.polygon=null),t.indexOf("line")>-1&&this.drawAndMeasureGroup.line&&(i.push(this.drawAndMeasureGroup.line.uuid),this.drawAndMeasureGroup.line.removeFromParent(),this.drawAndMeasureGroup.line=null),t.indexOf("point")>-1&&this.drawAndMeasureGroup.point&&(i.push(this.drawAndMeasureGroup.point.uuid),this.drawAndMeasureGroup.point.removeFromParent(),this.drawAndMeasureGroup.point=null),this.emitUIInteraction({ExcuteName:te.DESTORY_DRAW,params:{uuids:i,Classes:t}});break;case"measure":(!Array.isArray(t)||t.length<1)&&(t=["point","line","polygon","surfaceline"]);var n=t.indexOf("polygon");n>-1&&(t.splice(n,1),t.push("MeasureArea")),n>-1&&this.drawAndMeasureGroup.measureArea&&(i.push(this.drawAndMeasureGroup.measureArea.uuid),this.drawAndMeasureGroup.measureArea.removeFromParent(),this.drawAndMeasureGroup.measureArea=null),(n=t.indexOf("line"))>-1&&(t.splice(n,1),t.push("MeasureLine")),n>-1&&this.drawAndMeasureGroup.measureLine&&(i.push(this.drawAndMeasureGroup.measureLine.uuid),this.drawAndMeasureGroup.measureLine.removeFromParent(),this.drawAndMeasureGroup.measureLine=null),(n=t.indexOf("point"))>-1&&(t.splice(n,1),t.push("LocationPoint")),n>-1&&this.drawAndMeasureGroup.locationPoint&&(i.push(this.drawAndMeasureGroup.locationPoint.uuid),this.drawAndMeasureGroup.locationPoint.removeFromParent(),this.drawAndMeasureGroup.locationPoint=null),(n=t.indexOf("surfaceline"))>-1&&(t.splice(n,1),t.push("SurfaceLine")),n>-1&&this.drawAndMeasureGroup.surfaceline&&(i.push(this.drawAndMeasureGroup.surfaceline.uuid),this.drawAndMeasureGroup.surfaceline.removeFromParent(),this.drawAndMeasureGroup.surfaceline=null),this.emitUIInteraction({ExcuteName:te.DESTORY_MEASURE,params:{uuids:i,Classes:t}});break;case"all":this.emitUIInteraction({ExcuteName:te.DESTORY_DRAW,params:{uuids:i,Classes:["Point","Line","Polygon"]}}),this.emitUIInteraction({ExcuteName:te.DESTORY_MEASURE,params:{uuids:i,Classes:["MeasureArea","MeasureLine","LocationPoint","SurfaceLine"]}}),this.drawAndMeasureGroup.children=[],this.scene.remove(this.drawAndMeasureGroup),this.drawAndMeasureGroup=null}}}},{key:"connect",value:(t=w(D().mark((function t(){var i,n,a,r,o,s,l,u=arguments;return D().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i=u.length>0&&void 0!==u[0]?u[0]:function(){},n=u.length>1&&void 0!==u[1]?u[1]:function(){},r=function(e){console.log("connectToStreamer wsURL :>> ",e),window.WebSocket=window.WebSocket||window.MozWebSocket,window.WebSocket?(a.reclickToStart&&clearTimeout(a.reclickToStart),a.ws=new WebSocket(e),a.ws.onopen=function(t){a.connected||(a.dispatchEvent({type:"connected"}),a.connected=!0),console.log("".concat(e," WebSocket connection")),a.startPSHeartbeat(),console.log("Start the heartbeat detection of the signaling server.")},a.ws.onmessage=function(e){if("string"==typeof e.data){var t=JSON.parse(e.data);"config"===t.type?(console.log("%c[Inbound SS (config)]","background: lightblue; color: black",t),a.onConfig(t)):"playerCount"===t.type?console.log("%c[Inbound SS (playerCount)]","background: lightblue; color: black",t):"offer"===t.type?(console.log("%c[Inbound SS (offer)]","background: lightblue; color: black",t),a.onWebRtcOffer(t)):"answer"===t.type?(console.log("%c[Inbound SS (answer)]","background: lightblue; color: black",t),a.onWebRtcAnswer(t)):"iceCandidate"===t.type?a.onWebRtcIce(t.candidate):"warning"===t.type&&t.warning?console.warn(t.warning):"pong"===t.type?console.log("pong",t.time):console.error("Invalid SS message type",t.type)}},a.ws.onerror=function(e){console.log("WS error: ".concat(JSON.stringify(e))),a.stopPSHeartbeat(),a.dispatchEvent({type:"signalingServerError"})},a.ws.onclose=function(e){console.log("WS closed: ".concat(JSON.stringify(e.code)," - ").concat(e.reason)),a.stopPSHeartbeat(),a.textureBus&&a.textureBus.resetUploadState(),a.ws=void 0,a.isReconnection=!0,a.connected&&(a.connected=!1);var t=document.getElementById("player");a.webRtcPlayerObj&&(t.removeChild(a.webRtcPlayerObj.video),a.webRtcPlayerObj.close(),a.webRtcPlayerObj=void 0),a.showTextOverlay("云渲染服务未正常连接"),a.reclickToStart=setTimeout((function(){a.connect(i,n)}),1500)}):alert("Your browser doesn't support WebSocket")},(a=this).wsURL){t.next=35;break}if(!e.DispatchServer.host){t.next=13;break}return console.log("用新版调度服务启动 ".concat(e.DispatchServer.host,"/api/tasks/create")),t.next=9,e.DispatchServer.CreateTask(a.projectName);case 9:0===(o=t.sent).status?(a.forceTURN=o.data.useTurnServer,a.wsURL=o.data.playerToken?"ws://".concat(o.data.host,":").concat(o.data.port,"/?token=").concat(encodeURIComponent(o.data.playerToken)):"ws://".concat(o.data.host,":").concat(o.data.port),a.currentTask=o,r(a.wsURL),i&&i("Successfully created task: "+o)):(console.error("Failed to create task:"+o.message),n&&n("Failed to create task: "+o.message)),t.next=33;break;case 13:if(!a.matchmakerIP){t.next=31;break}return s="http://".concat(a.matchmakerIP,":").concat(a.matchmakerPort,"/gpuserver?project=").concat(a.projectName),t.prev=15,t.next=18,y.get(s);case 18:if(!(l=t.sent).data||!l.data.error){t.next=22;break}return console.error(l.data.error),t.abrupt("return",!1);case 22:a.wsURL="ws://".concat(l.data.gpuServer,":").concat(l.data.port),r(a.wsURL),t.next=29;break;case 26:t.prev=26,t.t0=t.catch(15),console.error(t.t0);case 29:t.next=33;break;case 31:return console.error("Needs a matchmaker's IP"),t.abrupt("return",!1);case 33:t.next=36;break;case 35:r(a.wsURL);case 36:case"end":return t.stop()}}),t,this,[[15,26]])}))),function(){return t.apply(this,arguments)})},{key:"startPSHeartbeat",value:function(){var t=this;e.DispatchServer.host&&(this.heartbeatInterval=setInterval((function(){t.ws.readyState===WebSocket.OPEN&&(t.ws.send('{"type":"ping"}'),console.log("Heartbeat send: Ping"))}),2e3))}},{key:"stopPSHeartbeat",value:function(){this.heartbeatInterval&&clearInterval(this.heartbeatInterval)}},{key:"onConfig",value:function(e){var t=document.getElementById("player"),i=this.setupWebRtcPlayer(t,e);switch(this.eventHandler.resizePlayerStyle(),this.inputOptions.controlScheme){case oe.HoveringMouse:this.eventHandler.registerHoveringMouseEvents(i);break;case oe.LockedMouse:this.eventHandler.registerLockedMouseEvents(i);break;default:console.log("ERROR: Unknown control scheme ".concat(this.inputOptions.controlScheme)),this.eventHandler.registerLockedMouseEvents(i)}}},{key:"setupModelInfo",value:function(e,t,i,n){if(!e)return!1;if(!n){var a=new URL(e),r=a.protocol,o=a.host,s=a.search,l=a.pathname.split("/").filter(Boolean);0===l.length?l.push("getStaticResourceUrl"):l[l.length-1]="getStaticResourceUrl";var u="/"+l.join("/");n="".concat(r,"//").concat(o).concat(u).concat(s)}t||(t={all:1,common:1,project_id:"418690084255052706"}),this.emitUIInteraction({excuteName:K.ASSET_MODEL,params:{ModInfoUrl:e,StaticResourceURL:n,ModInfoBody:t,ModInfoHeader:i}})}},{key:"initOthers",value:function(){var e=this;this.initCamera(),document.addEventListener("keydown",(function(e){(116===e.keyCode||e.ctrlKey&&82===e.keyCode)&&(window._frash_=!0)})),this.isSequencer&&(this.sequencerEnvironment=new ve(this)),window.onbeforeunload=function(){e.levelReady||window._frash_||(e.levelReady=!0),window._frash_=!1}}},{key:"load",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){},i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};"cloud"==this.renderMode&&(this.eventHandler.setupHtmlEvents(),this.eventHandler.setupFreezeFrameOverlay(),this.eventHandler.registerKeyboardEvents(),window.addEventListener("resize",(function(){return e.updateVideoStreamSize()})),this.start(t,i),Wt((new Date).getTime()))}}]);var t,i,n}();function Wt(){Bt(Wt),v.update()}function jt(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if("string"!=typeof e)throw new Error("decodeBase64: 输入必须是字符串");var i=e.replace(/[\s=]/g,"");try{for(var n=atob(i),a=new Uint8Array(n.length),r=0;r<n.length;r++)a[r]=n.charCodeAt(r);return t?a:(new TextDecoder).decode(a)}catch(e){throw new Error("decodeBase64: 无效的 Base64 字符串")}}R(Ft,"DispatchServer",Pt);var Ht={encodeBase64:function(e){if("string"==typeof e){var t=(new TextEncoder).encode(e);return btoa(String.fromCharCode.apply(String,W(t)))}if(e instanceof Uint8Array)return btoa(String.fromCharCode.apply(String,W(e)));throw new Error("encodeBase64: 输入必须是字符串或 Uint8Array")},decodeBase64:jt,isValidBase64:function(e){if("string"!=typeof e)return!1;if(!/^[A-Za-z0-9+/]*={0,2}$/.test(e))return!1;try{return jt(e),!0}catch(e){return!1}}},Gt=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};U(this,e),(t=N(this,e,[i])).parameters=i,t.renderNum=void 0===i.renderNum?20:i.renderNum,t.visible=void 0===i.visible||i.visible;var n=i.width||1,a=i.circleScale||50,r=void 0!==i.startHide&&i.startHide,o=void 0!==i.endHide&&i.endHide,s=i.speed||.5,l=i.opacity||.02,u=i.brightness||100,c=i.angle||40;return t.type="ODLine",Object.defineProperties(t,{angle:{configurable:!0,enumerable:!0,get:function(){return c},set:function(e){c=e,t.materialNeedsUpdate=!0}},width:{configurable:!0,enumerable:!0,get:function(){return n},set:function(e){n=e,t.materialNeedsUpdate=!0}},circleScale:{configurable:!0,enumerable:!0,get:function(){return a},set:function(e){a=e,t.materialNeedsUpdate=!0}},startHide:{configurable:!0,enumerable:!0,get:function(){return r},set:function(e){r=e,t.materialNeedsUpdate=!0}},endHide:{configurable:!0,enumerable:!0,get:function(){return o},set:function(e){o=e,t.materialNeedsUpdate=!0}},speed:{configurable:!0,enumerable:!0,get:function(){return s},set:function(e){s=e,t.materialNeedsUpdate=!0}},opacity:{configurable:!0,enumerable:!0,get:function(){return l},set:function(e){l=e,t.materialNeedsUpdate=!0}},brightness:{configurable:!0,enumerable:!0,get:function(){return u},set:function(e){u=e,t.materialNeedsUpdate=!0}}}),t}return z(e,vt),C(e,[{key:"setData",value:function(e){this.data=it(e,!1,{enableDP:!1})}},{key:"toJSON",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return!e||!this.visibleNeedsUpdate||this.visible&&this.materialNeedsUpdate?{Color:{r:this.color.r,g:this.color.g,b:this.color.b,a:this.opacity},Brightness:this.brightness,Metallic:this.metallic,Angle:this.angle,Roughness:this.roughness,Opacity:this.opacity,Transparent:this.transparent,Texture:this.texture,BloomColor:this.bloomColor?{r:this.bloomColor.r,g:this.bloomColor.g,b:this.bloomColor.b,a:1}:null,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},type:this.type,uuid:this.uuid,jsondata:e?null:this.data,Width:this.width,CircleScale:this.circleScale,StartHide:this.startHide,EndHide:this.endHide,Speed:this.speed,matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,animateNeedsUpdate:this.animateNeedsUpdate,animateJson:this.animateNeedsUpdate?this.animateJson:null,RenderNum:this.renderNum}:{matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},type:this.type,name:this.name,uuid:this.uuid}}},{key:"copy",value:function(t){var i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return this.width=t.width,this.circleScale=t.circleScale,this.speed=t.speed,this.startHide=t.startHide,this.endHide=t.endHide,F(e,"copy",this)([t,i]),this}}])}();function Vt(e){switch(e){case 0:return"DoNotFcaeToCamera";case 1:default:return"FacetoCamera_XYZ";case 2:return"FacetoCamera_Y";case 3:return"FacetoCamera_Z"}}var Jt=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};U(this,e),(t=N(this,e,[i])).renderNum=void 0===i.renderNum?20:i.renderNum;var n=i.pivot||{x:.5,y:.5};t.visible=void 0===i.visible||i.visible,t.isGlobalPOI=void 0!==i.isGlobalPOI&&i.isGlobalPOI;var a=i.text||null,r=i.iconUrl||"",o=i.texture||"",s=i.width||32,l=i.height||32,u=i.iconPathName||"",c=void 0===i.hideText||i.hideText,d=void 0!==i.hideImage&&i.hideImage,h=i.renderScale||1;t.renderType=i.renderType||0,t.openCollision=void 0!==i.openCollision&&i.openCollision;var f=0===i.faceType?0:i.faceType||1,p=void 0!==i.switchScale&&i.switchScale,m=i.minScale||0,g=i.maxScale||0,v=i.fontSize||12;return t.fadeIn=void 0===i.fadeIn||i.fadeIn,t.type="IconPoint",Object.defineProperties(t,{pivot:{configurable:!0,enumerable:!0,get:function(){return n},set:function(e){n=e,t.materialNeedsUpdate=!0}},text:{configurable:!0,enumerable:!0,get:function(){return a},set:function(e){a=e,t.materialNeedsUpdate=!0}},iconUrl:{configurable:!0,enumerable:!0,get:function(){return r},set:function(e){r=e,t.materialNeedsUpdate=!0}},texture:{configurable:!0,enumerable:!0,get:function(){return o},set:function(e){o=e,t.materialNeedsUpdate=!0}},width:{configurable:!0,enumerable:!0,get:function(){return s},set:function(e){s=e,t.materialNeedsUpdate=!0}},height:{configurable:!0,enumerable:!0,get:function(){return l},set:function(e){l=e,t.materialNeedsUpdate=!0}},faceType:{configurable:!0,enumerable:!0,get:function(){return f},set:function(e){f=e,t.materialNeedsUpdate=!0}},switchScale:{configurable:!0,enumerable:!0,get:function(){return p},set:function(e){p=e,t.materialNeedsUpdate=!0}},minScale:{configurable:!0,enumerable:!0,get:function(){return m},set:function(e){m=e,t.materialNeedsUpdate=!0}},maxScale:{configurable:!0,enumerable:!0,get:function(){return g},set:function(e){g=e,t.materialNeedsUpdate=!0}},iconPathName:{configurable:!0,enumerable:!0,get:function(){return u},set:function(e){u=e,t.materialNeedsUpdate=!0}},hideText:{configurable:!0,enumerable:!0,get:function(){return c},set:function(e){c=e,t.materialNeedsUpdate=!0}},hideImage:{configurable:!0,enumerable:!0,get:function(){return d},set:function(e){d=e,t.materialNeedsUpdate=!0}},renderScale:{configurable:!0,enumerable:!0,get:function(){return h},set:function(e){h=e,t.materialNeedsUpdate=!0}},fontSize:{configurable:!0,enumerable:!0,get:function(){return v},set:function(e){v=e,t.materialNeedsUpdate=!0}}}),t}return z(e,vt),C(e,[{key:"toJSON",value:function(){var e,t,i,n,a=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return!a||!this.visibleNeedsUpdate||this.visible&&this.materialNeedsUpdate?{Pivot:this.pivot,Color:{r:this.color.r,g:this.color.g,b:this.color.b,a:this.opacity},Brightness:this.brightness,Metallic:this.metallic,Roughness:this.roughness,Opacity:this.opacity,Transparent:this.transparent,Texture:null!==(e=this.parent)&&void 0!==e&&null!==(t=e.engine)&&void 0!==t&&t.enableTextureBus&&this.textureRef?null:this.texture,TextureRef:null!==(i=this.parent)&&void 0!==i&&null!==(n=i.engine)&&void 0!==n&&n.enableTextureBus&&this.textureRef?this.textureRef:null,BloomColor:this.bloomColor?{r:this.bloomColor.r,g:this.bloomColor.g,b:this.bloomColor.b,a:1}:null,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},type:this.type,uuid:this.uuid,jsondata:a?null:this._resolveJsonData(),IconUrl:this.iconUrl,Width:this.width,Height:this.height,IconPathName:this.iconPathName,IsGlobalPOI:this.isGlobalPOI,HideText:this.hideText,HideImage:this.hideImage,RenderScale:this.renderScale,FontSize:this.fontSize,RenderType:this.renderType,FadeIn:this.fadeIn,OpenCollision:this.openCollision,FaceType:Vt(this.faceType),SwitchScale:this.switchScale,MaxScale:this.maxScale,MinScale:this.minScale,matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,animateNeedsUpdate:this.animateNeedsUpdate,animateJson:this.animateNeedsUpdate?this.animateJson:null,Size:this.size,SizeAttenuation:this.sizeAttenuation,RenderNum:this.renderNum}:{matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},FadeIn:this.fadeIn,type:this.type,name:this.name,uuid:this.uuid}}},{key:"copy",value:function(t){var i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return this.iconUrl=t.iconUrl,this.width=t.width,this.height=t.height,this.iconPathName=t.iconPathName,this.hideText=t.hideText,this.hideImage=t.hideImage,this.renderScale=t.renderScale,this.fontSize=t.fontSize,F(e,"copy",this)([t,i]),this}}])}(),qt=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};U(this,e),(t=N(this,e,[i])).renderNum=void 0===i.renderNum?20:i.renderNum,t.visible=void 0===i.visible||i.visible,t.isGlobalPOI=void 0!==i.isGlobalPOI&&i.isGlobalPOI;var n=i.backgroundColor||{r:0,g:0,b:0,a:0},a=i.backgroundImage||"",r=t.getMargin(i.margin)||{Top:0,Right:0,Bottom:0,Left:0},o=i.fontSize||24,s=i.fontWeight||"Regular",l=i.borderWidth||0,u=i.borderColor||{r:0,g:0,b:0,a:1},c=i.shadowColor||{r:0,g:0,b:0,a:1},d=i.shadowOffset||{x:0,y:0},h=i.pivot||{x:.5,y:.5};t.renderType=i.renderType||0,t.fadeIn=void 0===i.fadeIn||i.fadeIn,t.openCollision=void 0!==i.openCollision&&i.openCollision;var f=0===i.faceType?0:i.faceType||1,p=void 0!==i.switchScale&&i.switchScale,m=i.minDistance||0,g=i.maxDistance||0,v=void 0===i.minScale?1:i.minScale,y=void 0===i.maxScale?1:i.maxScale;return t.autoWrap=i.autoWrap||!1,t.type="TextPoint",Object.defineProperties(t,{backgroundImage:{configurable:!0,enumerable:!0,get:function(){return a},set:function(e){a=e,t.materialNeedsUpdate=!0}},backgroundColor:{configurable:!0,enumerable:!0,get:function(){return n},set:function(e){n=e,t.materialNeedsUpdate=!0}},margin:{configurable:!0,enumerable:!0,get:function(){return r},set:function(e){r=t.getMargin(e),t.materialNeedsUpdate=!0}},fontSize:{configurable:!0,enumerable:!0,get:function(){return o},set:function(e){o=e,t.materialNeedsUpdate=!0}},fontWeight:{configurable:!0,enumerable:!0,get:function(){return s},set:function(e){s=e,t.materialNeedsUpdate=!0}},borderWidth:{configurable:!0,enumerable:!0,get:function(){return l},set:function(e){l=e,t.materialNeedsUpdate=!0}},borderColor:{configurable:!0,enumerable:!0,get:function(){return u},set:function(e){u=e,t.materialNeedsUpdate=!0}},shadowColor:{configurable:!0,enumerable:!0,get:function(){return c},set:function(e){c=e,t.materialNeedsUpdate=!0}},shadowOffset:{configurable:!0,enumerable:!0,get:function(){return d},set:function(e){d=e,t.materialNeedsUpdate=!0}},pivot:{configurable:!0,enumerable:!0,get:function(){return h},set:function(e){h=e,t.materialNeedsUpdate=!0}},faceType:{configurable:!0,enumerable:!0,get:function(){return f},set:function(e){f=e,t.materialNeedsUpdate=!0}},switchScale:{configurable:!0,enumerable:!0,get:function(){return p},set:function(e){p=e,t.materialNeedsUpdate=!0}},minDistance:{configurable:!0,enumerable:!0,get:function(){return m},set:function(e){m=e,t.materialNeedsUpdate=!0}},maxDistance:{configurable:!0,enumerable:!0,get:function(){return g},set:function(e){g=e,t.materialNeedsUpdate=!0}},minScale:{configurable:!0,enumerable:!0,get:function(){return v},set:function(e){v=e,t.materialNeedsUpdate=!0}},maxScale:{configurable:!0,enumerable:!0,get:function(){return y},set:function(e){y=e,t.materialNeedsUpdate=!0}}}),t}return z(e,vt),C(e,[{key:"setData",value:function(e){this.data=nt(e)}},{key:"getMargin",value:function(e){var t;if(Array.isArray(e))return e.length<2?t={Top:e[0]||0,Right:e[0]||0,Bottom:e[0]||0,Left:e[0]||0}:e.length<3?t={Top:e[0]||0,Right:e[1]||0,Bottom:e[0]||0,Left:e[1]||0}:e.length<4?t={Top:e[0]||0,Right:e[1]||0,Bottom:e[2]||0,Left:e[1]||0}:e.length<5&&(t={Top:e[0]||0,Right:e[1]||0,Bottom:e[2]||0,Left:e[3]||0}),t}},{key:"toJSON",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return e&&this.visibleNeedsUpdate&&!this.materialNeedsUpdate?{matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,FadeIn:this.fadeIn,type:this.type,name:this.name,uuid:this.uuid}:{Pivot:this.pivot,Color:{r:this.color.r,g:this.color.g,b:this.color.b,a:this.opacity},BackgroundColor:{r:this.backgroundColor.r,g:this.backgroundColor.g,b:this.backgroundColor.b,a:this.backgroundColor.a},BackgroundImageURL:this.backgroundImage,IsGlobalPOI:this.isGlobalPOI,Margin:this.margin,AutoWrap:this.autoWrap,Brightness:this.brightness,Metallic:this.metallic,Roughness:this.roughness,Opacity:this.opacity,Transparent:this.transparent,Texture:this.texture,BloomColor:this.bloomColor?{r:this.bloomColor.r,g:this.bloomColor.g,b:this.bloomColor.b,a:1}:null,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},type:this.type,uuid:this.uuid,jsondata:e?null:this.data,FontWeight:this.fontWeight,FontSize:this.fontSize,BorderWidth:this.borderWidth,BorderColor:this.borderColor,ShadowColor:this.shadowColor,ShadowOffset:this.shadowOffset,RenderType:this.renderType,FadeIn:this.fadeIn,OpenCollision:this.openCollision,FaceType:Vt(this.faceType),SwitchScale:this.switchScale,MinDistance:this.minDistance,MaxDistance:this.maxDistance,MaxScale:this.maxScale,MinScale:this.minScale,matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,animateNeedsUpdate:this.animateNeedsUpdate,animateJson:this.animateNeedsUpdate?this.animateJson:null,RenderNum:this.renderNum}}},{key:"copy",value:function(t){var i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return this.fontWeight=t.fontWeight,this.fontSize=t.fontSize,this.borderWidth=t.borderWidth,this.borderColor=t.borderColor,this.shadowColor=t.shadowColor,this.shadowOffset=t.shadowOffset,F(e,"copy",this)([t,i]),this}}])}();function Yt(e,t){var i={};if(Object.assign(i,t),i.style){var n=i.style,a=n.width,r=n.height,o=n.borderRadius,s=n.borderWidth,l=n.paddingTop,u=n.paddingLeft;i.style.width=a*e,i.style.height=r*e,o&&(i.style.borderRadius=o*e),s&&(i.style.borderWidth=s*e),l&&(i.style.paddingTop=l*e),u&&(i.style.paddingLeft=u*e)}return i.content&&i.content.forEach((function(t){for(var i in t)"number"==typeof t[i]&&"id"!==i&&(t[i]=t[i]*e);var n=t.position;n&&(t.position=n.map((function(t){return t*e}))),t.textList&&t.textList.forEach((function(t){t.fontSize=t.fontSize*e,t.position=t.position.map((function(t){return t*e}))}))})),i}var Kt=function(){function e(t){var i;U(this,e),(i=N(this,e,[t])).renderNum=void 0===t.renderNum?20:t.renderNum,i.name=t.name||"",i.pivot=t.pivot||{x:.5,y:.5},i.offset=t.offset||{x:0,y:0,z:0},i.sizeAttenuation=t.sizeAttenuation||!1,i.constructionConfig=t.constructionConfig||{},i.labelType=t.labelType||"sprite",i.hideText=t.hideText||!1,i.faceType=0===t.faceType?0:t.faceType||1,i.switchScale=t.switchScale||!1,i.renderType=t.renderType||0;var n=t.renderScale||.3;i.minScale=t.minScale||1,i.maxScale=t.maxScale||1,i.type="IconPoint",i.visible=void 0===t.visible||t.visible,i.fadeIn=void 0===t.fadeIn||t.fadeIn;var a=t;return("mesh"===i.labelType||i.sizeAttenuation)&&(a=Yt(n,t)),i.style=a.style,i.drawCanvas=document.createElement("canvas"),i.animationCanvas=document.createElement("canvas"),i.mainView=null,i.sprite=null,i.texture=null,i.animateId=null,i.size=t.size||20,i.extraProps={args:t},a.style?(i.init(a).then((function(){i.materialNeedsUpdate=!0})),Object.defineProperties(i,{renderScale:{configurable:!0,enumerable:!0,get:function(){return n},set:function(e){n=e,i.materialNeedsUpdate=!0}}}),i):(console.warn("请正确设置BasicLabel的style"),L(i))}return z(e,vt),C(e,[{key:"init",value:(n=w(D().mark((function t(){var i,n,a,r=arguments;return D().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=r.length>0&&void 0!==r[0]?r[0]:{},(n=this.style).height,n.width,this.mainView=document.createElement("canvas"),t.next=5,e.initBackGround(this.style,this.mainView);case 5:if(a=t.sent,this.drawCanvas.width=this.animationCanvas.width=a.width,this.drawCanvas.height=this.animationCanvas.height=a.height,this.factor=a.factor,this.width=a.width,this.height=a.height,this.dispatchEvent({type:"loaded",label:this}),!i.content){t.next=15;break}return t.next=15,this.drawContent(i.content,!0);case 15:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"drawContent",value:function(){var t=w(D().mark((function t(i){var n,a,r,o,s,l,u,c=this,d=arguments;return D().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return d.length>1&&void 0!==d[1]&&d[1]||"mesh"!==this.labelType&&!this.sizeAttenuation||(i=Yt(this.renderScale,{content:i}).content),r=this.drawCanvas.getContext("2d"),o=this.drawCanvas,s=o.width,l=o.height,r.clearRect(0,0,s,l),r.drawImage(this.mainView,0,0,s,l),t.next=8,e.renderContent(this.style,i,this.drawCanvas,this.factor);case 8:this.texture=st(this.drawCanvas),(u=null===(n=this.parent)||void 0===n||null===(a=n.engine)||void 0===a?void 0:a.textureBus)?(this.textureRef&&(u.releaseTexture(this.textureRef),this.textureRef=null),u.publishTexture(this.texture).then((function(e){var t=e.ref;c.textureRef=t,c.dispatchEvent({type:"contentLoaded",label:c})})).catch((function(e){console.warn("[BasicLabel] publishTexture failed, fallback to base64",e),c.dispatchEvent({type:"contentLoaded",label:c})}))):this.dispatchEvent({type:"contentLoaded",label:this});case 11:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}()},{key:"updateContent",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=t;("mesh"===this.labelType||this.sizeAttenuation)&&(i=Yt(this.renderScale,t)),this.extraProps={args:t},i.style&&(this.style=i.style),this.init(i).then((function(){e.materialNeedsUpdate=!0}))}},{key:"getFinalFaceType",value:function(e){if(e)switch(e){case 0:return"DoNotFcaeToCamera";case 1:default:return"FacetoCamera_XYZ";case 2:return"FacetoCamera_Y";case 3:return"FacetoCamera_Z"}return"FacetoCamera_XYZ"}},{key:"toJSON",value:function(){var e,t,i,n,a=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return!a||!this.visibleNeedsUpdate||this.visible&&this.materialNeedsUpdate?{Pivot:this.pivot,Color:{r:this.color.r,g:this.color.g,b:this.color.b,a:this.opacity},Brightness:this.brightness,Metallic:this.metallic,Roughness:this.roughness,Opacity:this.opacity,Transparent:this.transparent,HideText:this.hideText,RenderType:this.renderType,FadeIn:this.fadeIn,OpenCollision:this.openCollision,FaceType:this.getFinalFaceType(this.faceType),SwitchScale:this.switchScale,MaxScale:this.maxScale,MinScale:this.minScale,Texture:null!==(e=this.parent)&&void 0!==e&&null!==(t=e.engine)&&void 0!==t&&t.enableTextureBus&&this.textureRef?null:this.texture,TextureRef:null!==(i=this.parent)&&void 0!==i&&null!==(n=i.engine)&&void 0!==n&&n.enableTextureBus&&this.textureRef?this.textureRef:null,BloomColor:this.bloomColor?{r:this.bloomColor.r,g:this.bloomColor.g,b:this.bloomColor.b,a:1}:null,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:1,y:1,z:1},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},type:this.type,uuid:this.uuid,jsondata:a?null:this._resolveJsonData(),Width:this.width,Height:this.height,RenderScale:this.renderScale,matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,animateNeedsUpdate:this.animateNeedsUpdate,animateJson:this.animateNeedsUpdate?this.animateJson:null,Size:this.size,SizeAttenuation:this.sizeAttenuation,RenderNum:this.renderNum}:{matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},FadeIn:this.fadeIn,type:this.type,name:this.name,uuid:this.uuid}}},{key:"dispose",value:function(){var e,t;this.textureRef&&null!==(e=this.parent)&&void 0!==e&&null!==(t=e.engine)&&void 0!==t&&t.textureBus&&(this.parent.engine.textureBus.releaseTexture(this.textureRef),this.textureRef=null),this.children=[],this.sprite=null,this.texture=null,this.drawCanvas=null,this.animationCanvas=null,this.mainView=null}}],[{key:"initBackGround",value:(i=w(D().mark((function t(i,n){var r,o,s,l,u,c,d,h,f,p,m,g,v,y,b,x,S,w,N,U,k,C;return D().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=i.height,o=i.width,s=i.backgroundImage,l=i.borderRadius,u=i.borderColor,c=i.borderWidth,d=i.backgroundColor,h=i.clip,f=o,p=r,m=n.getContext("2d"),g=a.ceilPowerOfTwo(f),v={width:g,height:g*(p/f),factor:{xScale:g/f,yScale:g/f}},n.width=v.width,n.height=v.height,y=v.factor,b=y.xScale,x=y.yScale,!s){t.next=16;break}return t.next=12,e.loadImg(s,"");case 12:S=t.sent,m.drawImage(S,0,0,f*b,p*x),t.next=17;break;case 16:(u||d)&&(m.strokeStyle=u,m.fillStyle=d,m.lineWidth=c?c*b:1*b,e.roundRect(m,m.lineWidth*b,m.lineWidth*x,(f-2*m.lineWidth)*b,(p-2*m.lineWidth)*x,l?l*b:0),d&&m.fill(),u&&m.stroke());case 17:return h&&(w=B(h,4),N=w[0],U=w[1],k=w[2],C=w[3],m.beginPath(),m.moveTo(C*f*b,N*p*x),m.lineTo((1-U)*f*b,N*p*x),m.lineTo((1-U)*f*b,(1-k)*p*x),m.lineTo(C*f*b,(1-k)*p*x),m.lineTo(C*f*b,N*p*x),m.closePath(),m.clip()),t.abrupt("return",v);case 19:case"end":return t.stop()}}),t)}))),function(e,t){return i.apply(this,arguments)})},{key:"renderContent",value:(t=w(D().mark((function t(i,n,a,r){var o,s,l,u,c,d,h,f,p,m,g,v,y,b,x,S,w,N,U,k,C,T,R,O,E,z,I,A,_,M,L,P,F,W,j,H,G,V,J,q,Y;return D().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:o=a.getContext("2d"),s=a.width,l=a.height,u=i.paddingTop,c=i.paddingLeft,d=0,h=0,f=0,p=0,m=r.xScale,g=r.yScale,b=[v=c?c*m:0,y=u?u*g:0],x=[],S=0;case 13:if(!(S<n.length)){t.next=46;break}if(w=n[S],N=w.width,U=w.height,k=w.textList,C=w.marginRight,T=w.marginBottom,R=w.backgroundImage,O=w.borderRadius,E=w.borderColor,z=w.borderWidth,I=w.backgroundColor,A=w.position,_=w.id,M=w.activeInfo,L=void 0===M?{}:M,A&&(P=B(A,2),F=P[0],W=P[1],b[0]=v+F*m,b[1]=y+W*g,d=0,h=0,f=0,p=0),!N||!U){t.next=42;break}if(b[0]+N*m>s&&((f+=d)+U*g<=h?(b[0]=p,b[1]+=d):(b[0]=c?c*m:0,b[1]+=d,h=0,p=0)),!R){t.next=32;break}return t.prev=20,t.next=23,e.loadImg(R,"");case 23:j=t.sent,o.drawImage(j,b[0],b[1],N*m,U*g),t.next=30;break;case 27:t.prev=27,t.t0=t.catch(20),console.warn(t.t0);case 30:t.next=33;break;case 32:I&&(o.strokeStyle=E,o.fillStyle=I,o.lineWidth=z?z*m:1*m,e.roundRect(o,b[0]+o.lineWidth*m,b[1]+o.lineWidth*m,(N-2*o.lineWidth)*m,(U-2*o.lineWidth)*g,O?O*m:0),I&&o.fill(),E&&o.stroke());case 33:k&&k.forEach((function(t){var i=B(t.position,2),n=i[0],a=i[1],s=[b[0]+n*m,b[1]+a*g];e.drawText(o,t,r,s)})),H=b[0]===(c?c*m:0)*m?-.16:-1.3,G=-(l-b[1]-25*g)*(2.05/(107*g))+.1,_&&(V=L.position,J=L.style,q=void 0===J?{width:5,height:.95}:J,(Y=e.addActiveArea(V||{x:H,y:G},q)).customId=_,x.push(Y)),b[0]+=(N+(C||0))*m,(d=(U+(T||0))*g)>h&&(h=d,p=b[0]),t.next=43;break;case 42:k&&k.forEach((function(t){var i=B(t.position,2),n=i[0],a=i[1],s=[b[0]+n*m,b[1]+a*g];e.drawText(o,t,r,s)}));case 43:S++,t.next=13;break;case 46:return t.abrupt("return",x);case 47:case"end":return t.stop()}}),t,null,[[20,27]])}))),function(e,i,n,a){return t.apply(this,arguments)})},{key:"getRectangle",value:function(e,t,i){var n=new d(_({map:i,transparent:!0,fog:!0,depthWrite:!1},arguments.length>3&&void 0!==arguments[3]?arguments[3]:{}));n.map&&(n.map.needsUpdate=!0),n.transparent=!0;var a=(.01*e).toFixed(2),r=(.01*t).toFixed(2),o=new h(Number(a),Number(r),1,1),s=new f(o,n);return s.setWidth=a,s.setHeight=r,s}},{key:"loadImg",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=new Image;return i.crossOrigin="Anonymous",i.src=t+e,new Promise((function(e,t){i.addEventListener("load",(function(){e(i)})),i.onerror=function(e){t(e)}}))}},{key:"getTextWidth",value:function(e,t){var i=t.fontSize,n=t.fontFamily,a=t.color,r=t.text,o=e.getContext("2d");return o.font="".concat(i,"px ").concat(n),o.fillStyle=a,o.textAlign="left",o.measureText(r).width}},{key:"drawText",value:function(e,t,i,n){var a,r=i.xScale,o=B(n,2),s=o[0],l=o[1],u=t.text,c=t.fontSize,d=t.fontFamily,h=t.color,f=t.textAlign,p=t.icon;if(u||"number"==typeof u||p)if(u&&p)console.warn("BasicLabel Warning:text和icon不要同时设置");else{if(a=u,e.font="".concat(c*r,"px ").concat(d),e.fillStyle=h,e.textAlign=f||"left",e.textBaseline="top",p){var m=p;-1!==p.indexOf("&amp;")&&(m=p.replace("&amp;","&")),-1!==p.indexOf("&amp")&&(m=p.replace("&amp","&")),a=new Function('return ("'+"".concat(m).replace("&#x","\\u").replace(";","")+'")')()}e.measureText(a).width,e.fillText(a,s,l)}}},{key:"addActiveArea",value:function(e,t){var i=t.width,n=t.height,a=e.x,r=e.y,o=new p({depthTest:!0,depthWrite:!1,transparent:!0,sizeAttenuation:!0,opacity:0}),s=new m(o);return s.scale.set(i,n,1),s.material.color=new u("#58d2d4"),s.center.set(a,r),s}},{key:"roundRect",value:function(e,t,i,n,a,r){e.beginPath(),e.moveTo(t+r,i),e.lineTo(t+n-r,i),e.quadraticCurveTo(t+n,i,t+n,i+r),e.lineTo(t+n,i+a-r),e.quadraticCurveTo(t+n,i+a,t+n-r,i+a),e.lineTo(t+r,i+a),e.quadraticCurveTo(t,i+a,t,i+a-r),e.lineTo(t,i+r),e.quadraticCurveTo(t,i,t+r,i),e.closePath()}}]);var t,i,n}(),Xt=function(){function e(t){var i;return U(this,e),(i=N(this,e,[t])).type="Cone",i}return z(e,vt),C(e)}(),Qt=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{color:{r:1,g:0,b:0,a:1},brightness:100};return U(this,e),(t=N(this,e,[i])).type="FlashCar",t}return z(e,vt),C(e)}(),Zt=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{color:{r:1,g:0,b:0,a:1},brightness:100};return U(this,e),(t=N(this,e,[i])).type="FlashCarCrash",t}return z(e,vt),C(e)}(),$t=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{color:{r:1,g:0,b:0,a:1},brightness:100};return U(this,e),(t=N(this,e,[i])).type="FlashPeople",t}return z(e,vt),C(e)}(),ei=function(){function e(t){var i;return U(this,e),(i=N(this,e,[t])).type="Cylinder",i}return z(e,vt),C(e)}(),ti=function(){function e(t){var i;return U(this,e),(i=N(this,e,[t])).type="Decal",i}return z(e,vt),C(e,[{key:"toJSON",value:function(){var e,t,i,n,a=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(this.animateJson){var r=this.animateJson,o=r.From,s=r.To;if(o&&o.scale){var l=o.scale,u=l.x,c=l.z;o.scale.x=c,o.scale.z=u}if(s&&s.scale){var d=s.scale,h=d.x,f=d.z;s.scale.x=f,s.scale.z=h}}return!this.visibleNeedsUpdate||!a||this.visible&&this.materialNeedsUpdate?{Color:{r:this.color.r,g:this.color.g,b:this.color.b,a:this.opacity},Brightness:this.brightness,Metallic:this.metallic,Roughness:this.roughness,Opacity:this.opacity,Transparent:this.transparent,Scroll:this.scroll,Speed:this.speed,Texture:null!==(e=this.parent)&&void 0!==e&&null!==(t=e.engine)&&void 0!==t&&t.enableTextureBus&&this.textureRef?null:this.texture,TextureRef:null!==(i=this.parent)&&void 0!==i&&null!==(n=i.engine)&&void 0!==n&&n.enableTextureBus&&this.textureRef?this.textureRef:null,GardientDirection:this.gardientDirection,Color2:{r:this.color2.r,g:this.color2.g,b:this.color2.b,a:this.opacity},BrightnessColor:this.brightnessColor?{r:this.brightnessColor.r,g:this.brightnessColor.g,b:this.brightnessColor.b,a:1}:this.Color,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.z,y:this.scale.y,z:this.scale.x},Rotation:{x:this.rotation.x,y:this.rotation.y+90,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,animateNeedsUpdate:this.animateNeedsUpdate,visible:this.visible,type:this.type,name:this.name,uuid:this.uuid,jsondata:a?null:this._resolveJsonData(),animateJson:this.animateNeedsUpdate?this.animateJson:null,Size:this.size,SizeAttenuation:this.sizeAttenuation}:{matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.z,y:this.scale.y,z:this.scale.x},Rotation:{x:this.rotation.x,y:this.rotation.y+90,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},type:this.type,name:this.name,uuid:this.uuid}}}])}(),ii=function(){function e(t){var i;return U(this,e),(i=N(this,e,[t])).type="Plane",i}return z(e,vt),C(e)}(),ni=function(){function e(t){var i;return U(this,e),(i=N(this,e,[t])).type="QuadPyramid",i}return z(e,vt),C(e)}(),ai=function(){function e(t){var i;return U(this,e),(i=N(this,e,[t])).type="Sphere",i}return z(e,vt),C(e)}(),ri=function(){function e(t){var i;return U(this,e),(i=N(this,e,[t])).type="TrafficCone",i}return z(e,vt),C(e)}(),oi=function(){function e(t){var i;return U(this,e),(i=N(this,e,[t])).type="Circle",i}return z(e,vt),C(e)}(),si=function(){function e(t){var i;return U(this,e),(i=N(this,e,[t])).type="Torus",i}return z(e,vt),C(e)}(),li=function(){function e(t){var i;return U(this,e),(i=N(this,e,[t])).type="Tube",i}return z(e,vt),C(e)}(),ui=function(){function e(t){var i;return U(this,e),(i=N(this,e,[t])).type="DiamondSign",i}return z(e,vt),C(e)}(),ci=function(){function i(e){var t;U(this,i),(t=N(this,i,[e])).type="Heatmap",t.kind=e.kind||"texture",t.visible=void 0===e.visible||e.visible,t.container=e.container,t.width=e.width||512,t.height=e.height||512,t.min=e.min,t.max=e.max,t.xName=e.xName,t.yName=e.yName,t.valueName=e.valueName,t.backgroundColor=e.backgroundColor,t.gradient=e.gradient,t.radius=e.radius||40,t.blur=e.blur||.85,t.opacity=e.opacity,t.minOpacity=e.minOpacity||0,t.maxOpacity=e.maxOpacity||1,t.heatmapInstance=null,t.size=e.size||null,t.center=e.center,t.minHeight=e.minHeight||0,t.maxHeight=e.maxHeight||500,t.duration=a.clamp(e.duration||1,0,100),t.data=e.data;var n,r=e.particle||{},o=r.bound||{x:100,y:100,z:0},s=r.scaleBoxXY||1,l=r.noiseStrength||0,u=r.grayPower||1,c=parseInt(r.countX,10)||400,d=parseInt(r.countY,10)||400;return t.particleMaxHeight=r.maxHeight||0,"noiseMap"in r&&(t.noiseMap=n=r.noiseMap,lt(n)||ot(n,(function(e){e&&(t.noiseMap=n=e)}))),"particle"===t.kind&&(t.gradient={0:"rgb(0, 0, 0)",1:"rgb(256, 256, 256)"}),t.init(),Object.defineProperties(t,{bound:{enumerable:!0,get:function(){return o},set:function(e){e&&"particle"===this.kind&&(o.x=e.x,o.y=e.y,o.z=e.z,this.matrixNeedsUpdate=!0)}},scaleBoxXY:{enumerable:!0,get:function(){return s},set:function(e){console.log(e,s,this.kind),e!==s&&"particle"===this.kind&&(s=e,this.matrixNeedsUpdate=!0)}},noiseStrength:{enumerable:!0,get:function(){return l},set:function(e){e!==l&&"particle"===this.kind&&(l=e,this.matrixNeedsUpdate=!0)}},grayPower:{configurable:!0,enumerable:!0,get:function(){return u},set:function(e){e!==u&&"particle"===this.kind&&(u=e,this.matrixNeedsUpdate=!0)}},countX:{configurable:!0,enumerable:!0,get:function(){return c},set:function(e){e!==c&&"particle"===this.kind&&(c=parseInt(e,10),this.matrixNeedsUpdate=!0)}},countY:{configurable:!0,enumerable:!0,get:function(){return d},set:function(e){e!==d&&"particle"===this.kind&&(d=parseInt(e,10),this.matrixNeedsUpdate=!0)}}}),t}return z(i,vt),C(i,[{key:"init",value:function(){if("particle"===this.kind&&this.data.length<2)console.error("数据量过少,无法绘制粒子热力图");else{var i=function(e,t,i,n){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},r=a.width,o=a.height,s=a.radius,l=void 0===s?40:s;if(!e||e.length<1)return!1;for(var u=1/0,c=-1/0,d={longitude:1/0,latitude:1/0},h={longitude:-1/0,latitude:-1/0},f=0,p=e.length;f<p;f++){var m=n?e[f][n]:e[f].value;u=Math.min(m,u),c=Math.max(m,c),t&&(e[f].x=e[f][t]),i&&(e[f].y=e[f][i]),n&&(e[f].value=e[f][n]),e[f].longitude&&e[f].latitude&&(d.longitude=Math.min(d.longitude,e[f].longitude),d.latitude=Math.min(d.latitude,e[f].latitude),h.longitude=Math.max(h.longitude,e[f].longitude),h.latitude=Math.max(h.latitude,e[f].latitude))}if(e[0].longitude&&e[0].latitude){if(!e[0].hasOwnProperty("x")&&!e[0].hasOwnProperty("y")){for(var g=h.longitude-d.longitude,v=h.latitude-d.latitude,y=1.2*l,b=.5,x=Math.min(y,r*(1-b)/2),S=Math.min(y,o*(1-b)/2),w=r-2*x,N=o-2*S,U=0,k=e.length;U<k;U++)e[U].x=Math.round(x+w*(e[U].longitude-d.longitude)/g),e[U].y=Math.round(S+N*(e[U].latitude-d.latitude)/v);var C=g*(x/w),T=v*(S/N);return{min:u,max:c,bbox:{min:{longitude:d.longitude-C,latitude:d.latitude-T},max:{longitude:h.longitude+C,latitude:h.latitude+T}},originalBbox:{min:_({},d),max:_({},h)}}}return{min:u,max:c,bbox:{min:d,max:h}}}return{min:u,max:c}}(this.data,this.xName,this.yName,this.valueName,{width:this.width,height:this.height,radius:this.radius});if(i&&(void 0===this.min&&(this.min=i.min),void 0===this.max&&(this.max=i.max),i.bbox)){if(!this.center){var n=.5*(i.bbox.min.longitude+i.bbox.max.longitude),a=.5*(i.bbox.min.latitude+i.bbox.max.latitude);this.center={x:n,y:a,z:10}}if(!this.size&&"particle"!==this.kind){var r=i.bbox.max.longitude-i.bbox.min.longitude,o=i.bbox.max.latitude-i.bbox.min.latitude;this.size={x:1e5*r,y:1e5*o}}this.bbox=i.bbox}var s=this.data,l=this.max,u=this.min;if(this.heatmapInstance)this.heatmapInstance.configure(this.getConfig()),this.heatmapInstance.setData({max:l,min:u,data:s}),this.heatmapInstance.repaint();else{this.container||(this.container=di(this.width,this.height));var c=function(e){if(!e)return!1;var t=e.container||di(e),i=b.create({container:t,backgroundColor:e.backgroundColor||"rgba(0,0,0,.95)",gradient:e.gradient||{0:"rgb(50, 50, 256)",.1:"rgb(50, 250, 56)",.5:"rgb(250, 250, 56)",1:"rgb(250, 50, 56)"},radius:e.radius||40,opacity:e.opacity,maxOpacity:e.maxOpacity||1,minOpacity:e.minOpacity||0});return i}(this.getConfig());c&&(this.heatmapInstance=c,this.heatmapInstance.setData({max:l,min:u,data:s}))}this.canvas||(this.canvas=this.container.children[0]),this.texture=st(this.canvas),this.materialNeedsUpdate=!0,this.center||(this.center=new t(0,0,10)),"particle"!==this.kind&&(this.size||(this.size=new e(this.width,this.height)),this.scale.set(this.size.x,this.size.y,200)),this.position.set(this.center.x,this.center.y,this.center.z)}}},{key:"setData",value:function(e){return!1}},{key:"getConfig",value:function(){return{container:this.container,backgroundColor:this.backgroundColor,gradient:this.gradient,radius:this.radius,opacity:this.opacity,maxOpacity:this.maxOpacity||1,minOpacity:this.minOpacity||0,blur:this.blur||0,width:this.width,height:this.height}}},{key:"repaint",value:function(e){e&&(this.duration=a.clamp(e,.1,100)),this.init()}},{key:"getGeojsonData",value:function(){if(this.container&&this.heatmapInstance){for(var e,t=(this.maxHeight-this.minHeight)/(this.max-this.min),i=this.heatmapInstance._renderer._palette,n=[],a=this.size.x/this.width,r=this.size.y/this.height,o=1/256,s=null===(e=this.heatmapInstance)||void 0===e?void 0:e.getData().data,l=0,u=s.length;l<u;l++){var c=parseInt(s[l].x,10),d=parseInt(s[l].y,10),h=Math.max(Math.min(s[l].value,this.max),this.min),f=(h-this.min)*t+this.minHeight,p=Math.floor((h-this.min)/(this.max-this.min)*252),m=s[l].radius,g={r:i[4*p]*o,g:i[4*p+1]*o,b:i[4*p+2]*o};if(!(f<1)){var v={type:"Feature",properties:{id:l,height:f,color:g,xSize:m,ySize:m},geometry:{type:"Point",coordinates:[a*(c-.5*this.width)/1e5,r*(d-.5*this.height)/1e5]}};n.push(v)}}return n}return!1}},{key:"toJSON",value:function(){var e,t;if((!(arguments.length>0&&void 0!==arguments[0])||arguments[0])&&this.visibleNeedsUpdate&&(!this.visible||!this.materialNeedsUpdate))return{matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},type:this.type,name:this.name,uuid:this.uuid};if("texture"===this.kind.toLowerCase())return{Color:{r:this.color.r,g:this.color.g,b:this.color.b,a:this.opacity},Brightness:this.brightness,Metallic:this.metallic,Roughness:this.roughness,Opacity:this.opacity,Transparent:this.transparent,Texture:this.texture,Duration:this.duration,BloomColor:this.bloomColor?{r:this.bloomColor.r,g:this.bloomColor.g,b:this.bloomColor.b,a:1}:null,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,type:this.type,Kind:this.kind,uuid:this.uuid,RawData:this.data,Min:(null===(e=this.bbox)||void 0===e?void 0:e.min)||null,Max:(null===(t=this.bbox)||void 0===t?void 0:t.max)||null,CanvasWidth:this.width,CanvasHeight:this.height};if("particle"===this.kind.toLowerCase())return{Color:{r:this.color.r,g:this.color.g,b:this.color.b,a:this.opacity},Brightness:this.brightness,Metallic:this.metallic,Roughness:this.roughness,Opacity:this.opacity,Transparent:this.transparent,Texture:this.texture,Duration:this.duration,BloomColor:this.bloomColor?{r:this.bloomColor.r,g:this.bloomColor.g,b:this.bloomColor.b,a:1}:null,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,type:this.type,Kind:this.kind,uuid:this.uuid,Bound:this.bound,ScaleBoxXY:this.scaleBoxXY,NoiseStrength:this.noiseStrength,NoiseMap:this.noiseMap,GrayPower:this.grayPower,MaxHeight:this.particleMaxHeight||this.maxHeight,countX:this.countX,countY:this.countY,Min:this.bbox.min,Max:this.bbox.max};var i=this.getGeojsonData();return{Color:{r:this.color.r,g:this.color.g,b:this.color.b,a:this.opacity},Brightness:this.brightness,Metallic:this.metallic,Roughness:this.roughness,Opacity:this.opacity,Transparent:this.transparent,BloomColor:this.bloomColor?{r:this.bloomColor.r,g:this.bloomColor.g,b:this.bloomColor.b,a:1}:null,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,type:this.type,Kind:this.kind,uuid:this.uuid,jsondata:i}}}])}();function di(e,t){var i=document.createElement("div");return i.style.width=e?e+"px":"512px",i.style.height=t?t+"px":"512px",i.style.top="0px",i.style.display="none",document.getElementsByTagName("body")[0].appendChild(i),i}var hi=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};U(this,e),(t=N(this,e,[i])).renderNum=void 0===i.renderNum?20:i.renderNum,t.type="Particle";var n=i.kind||fe.FIRE_SMALL,r=i.spawnRate||30,o=i.brightness||3,s=i.lifeTime||1,l=new u(1,0,1);i.brightnessColor&&(l.r=a.clamp(i.brightnessColor.r,0,1),l.g=a.clamp(i.brightnessColor.g,0,1),l.b=a.clamp(i.brightnessColor.b,0,1));var c=i.speed||5,d=i.height||200,h=i.width||.01,f=i.zVelocity||100;return t.thickness=i.thickness||.2,Object.defineProperties(t,{kind:{configurable:!0,enumerable:!0,get:function(){return n},set:function(e){n=e,t.materialNeedsUpdate=!0}},spawnRate:{configurable:!0,enumerable:!0,get:function(){return r},set:function(e){r=e,t.materialNeedsUpdate=!0}},brightness:{configurable:!0,enumerable:!0,get:function(){return o},set:function(e){o=e,t.materialNeedsUpdate=!0}},brightnessColor:{configurable:!0,enumerable:!0,get:function(){return l},set:function(e){e&&(l.r=e.r,l.g=e.g,l.b=e.b,l.a=1,t.materialNeedsUpdate=!0)}},speed:{configurable:!0,enumerable:!0,get:function(){return c},set:function(e){c=e,t.materialNeedsUpdate=!0}},height:{configurable:!0,enumerable:!0,get:function(){return d},set:function(e){d=e,t.materialNeedsUpdate=!0}},width:{configurable:!0,enumerable:!0,get:function(){return h},set:function(e){h=e,t.materialNeedsUpdate=!0}},zVelocity:{configurable:!0,enumerable:!0,get:function(){return f},set:function(e){f=e,t.materialNeedsUpdate=!0}},lifeTime:{configurable:!0,enumerable:!0,get:function(){return s},set:function(e){s=e,t.materialNeedsUpdate=!0}}}),t}return z(e,vt),C(e,[{key:"setData",value:function(e){this.data=nt(e)}},{key:"toJSON",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return!e||!this.visibleNeedsUpdate||this.visible&&this.materialNeedsUpdate?{Color:{r:this.color.r,g:this.color.g,b:this.color.b,a:this.opacity},Brightness:this.brightness,BrightnessColor:this.brightnessColor?{r:this.brightnessColor.r,g:this.brightnessColor.g,b:this.brightnessColor.b,a:1}:null,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},SpawnRate:this.spawnRate,Speed:this.speed,Height:this.height,ZVelocity:this.zVelocity,LifeTime:this.lifeTime,Width:this.width,Kind:this.kind,type:this.type,uuid:this.uuid,Thickness:this.thickness,jsondata:e?null:this.data,matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,RenderNum:this.renderNum}:{matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},type:this.type,name:this.name,uuid:this.uuid}}},{key:"copy",value:function(t){var i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return this.size=t.size,this.kind=t.kind,this.thickness=t.thickness,F(e,"copy",this)([t,i]),this}}])}(),fi=function(){function e(i){var n;return U(this,e),(n=N(this,e)).type="TrafficLayer",n.url=i.url,n.eventName=i.eventName||"geo_window_state",n.interval=i.interval||100,n._message=null,n.message=i.message,n.query=i.query,n.label=new je,n.label.visible=void 0!==i._labelVisible&&i._labelVisible,n.rayDetectionDistance=i.rayDetectionDistance||0,n.uiRenderDistance=i.uiRenderDistance||5e4,n.messageNeedsUpdate=!1,n.materialNeedsUpdate=!1,n.matrixNeedsUpdate=!1,n.followNeedsUpdate=!1,n.labelVisible=i.labelVisible,n.offset=new t,n.handShakePath=i.handShakePath||"socket.io",n.namespace=i.namespace||"/",n.carRenderDistance=i.carRenderDistance||3e5,n.labelGroup=i.labelGroup||"highSpeed",n.labelScale=void 0===i.labelScale?1:i.labelScale,n.labelRenderType=void 0===i.labelRenderType?0:i.labelRenderType,n.enableLabelCulling=i.enableLabelCulling||!1,n.isSubsection=i.isSubsection||!1,n.plateEncode=i.plateEncode||!1,n.plateEncoding=i.plateEncoding||"auto",n}return z(e,je),C(e,[{key:"visible",get:function(){return this._visible},set:function(e){void 0===this._visible&&(this._visible=!0),e!==this._visible&&(this.visibleNeedsUpdate=!0,this._visible=e&&!0)}},{key:"labelVisible",get:function(){return this.label.visible},set:function(e){e!==this.label.visible&&(this.materialNeedsUpdate=!0,this.label.visible=e&&!0)}},{key:"message",get:function(){return this._message},set:function(e){this.messageNeedsUpdate=!0,this._message=e}},{key:"setLabelVisible",value:function(e){e!==this.label.visible&&(this.materialNeedsUpdate=!0,this.label.visible=e)}},{key:"getLabelVisible",value:function(){return this.label.visible}},{key:"dispose",value:function(){return!1}},{key:"followTraffic",value:function(e){var t=e.zoomLength,i=void 0===t?-1:t,n=e.followPitch,a=void 0===n?999:n;this.isFollow=null==e?void 0:e.isFollow,this.followCarId=null==e?void 0:e.carId,this.followCarPlateNumber=null==e?void 0:e.plateNumber,this.followColor=(null==e?void 0:e.color)||{r:0,g:1,b:.8},this.followRotations=(null==e?void 0:e.followRotations)||{Roll:!1,Pitch:!1,Yaw:!1},this.zoomLength=i,this.followPitch=a,this.followNeedsUpdate=!0}},{key:"followGroups",value:function(e){this.isFollow=null==e?void 0:e.isFollow,this.followCarIdList=null==e?void 0:e.carIdList,this.followRotations=(null==e?void 0:e.followRotations)||{Roll:!1,Pitch:!1,Yaw:!1},this.followNeedsUpdate=!0}},{key:"initEventListener",value:function(){}},{key:"dispatchEvent",value:function(t){var i,n;if(this.plateEncode&&"mousedown"===t.type&&null!==(i=t.content)&&void 0!==i&&null!==(n=i.content)&&void 0!==n&&n.plate)try{var a=this._decodePlate(t.content.content.plate);t.content.content.plateEncoded=t.content.content.plate,t.content.content.plate=a}catch(e){console.error("TrafficLayer: Failed to decode plate",e)}return F(e,"dispatchEvent",this)([t])}},{key:"_decodePlate",value:function(e){try{if("auto"===this.plateEncoding)return jt(e);var t=jt(e,!0);return new TextDecoder(this.plateEncoding).decode(t)}catch(t){return console.warn("TrafficLayer: Plate decode failed, returning original value",t),e}}},{key:"toJSON",value:function(){return{Url:this.url,EventName:this.eventName,LabelVisible:this.labelVisible,LabelGroup:this.labelGroup,LabelScale:this.labelScale,LabelRenderType:this.labelRenderType,EnableWidgetCulling:this.enableLabelCulling,matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,messageNeedsUpdate:this.messageNeedsUpdate,visible:this.visible,type:this.type,uuid:this.uuid,Id:this.followCarId,CarIdList:this.followCarIdList,Namespace:this.namespace,HandShakePath:this.handShakePath,FollowColor:this.followColor||{r:0,g:1,b:.8},FollowRotation:this.followRotations||{Roll:!1,Pitch:!1,Yaw:!1},Plate:this.followCarPlateNumber,PlateEncode:this.plateEncode,PlateEncoding:this.plateEncoding,ZoomLength:this.zoomLength,FollowPitch:this.followPitch,IsFollow:this.isFollow,Content:this.content,Message:this.message,Query:this.query,RayDetectionDistance:this.rayDetectionDistance,UIRenderDistance:this.uiRenderDistance,CarRenderDistance:this.carRenderDistance,Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},IsSubsection:this.isSubsection}}}])}(),pi=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return U(this,e),(t=N(this,e,[i])).name=i.name||"",t.type="FastRoadCondition",t.colors=i.colors||{1:(new u).setStyle("#00ff00"),2:(new u).setStyle("#ffff00"),3:(new u).setStyle("#ff0000"),4:(new u).setStyle("#ff00ff")},t}return z(e,bt),C(e,[{key:"setData",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"condition",n=!0===this.enableSimplify;this.data=it(e,!1,{enableDP:n,dpThreshold:this.simplifyTolerance}),this.data.forEach((function(e){var n=e.properties[i],a=t.colors[n]||t.colors[1];e.properties.color={r:a.r,g:a.g,b:a.b,a:a.a||1}}))}}])}(),mi=function(){function e(){var n,a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};U(this,e),(n=N(this,e,[a])).initChild();var o=a.coneColor||new u(1,1,1),s=a.groundColor||new u(1,1,1),l=a.fenceColor||new u(1,1,1),c=a.brightness||0,d=a.roughness||1,h=a.metallic||0;n.coneMap=a.coneMap||null,n.groundMap=a.groundMap||null,n.fenceMap=a.fenceMap||null,n.fenceHeight=a.fenceHeight||1;var f=a.coneOpacity||o.a||1,p=a.groundOpacity||s.a||1,m=a.fenceOpacity||l.a||1,g=a.bloomColor||null,v=a.position||new t,y=a.rotation||new r,b=new i,x=a.scale||new t(1,1,1),S=a.coneScale||new t(1,1,1),w=a.offset||new t(0,0,0),k=!1;return y._onChange((function(){b.setFromEuler(y,!1),this.matrixNeedsUpdate=!0})),b._onChange((function(){y.setFromQuaternion(b,void 0,!1),this.matrixNeedsUpdate=!0})),Object.defineProperties(n,{position:{configurable:!0,enumerable:!0,get:function(){return v},set:function(e){e&&(v.x=e.x,v.y=e.y,v.z=e.z,n.matrixNeedsUpdate=!0)}},rotation:{configurable:!0,enumerable:!0,value:y},quaternion:{configurable:!0,enumerable:!0,value:b},scale:{configurable:!0,enumerable:!0,get:function(){return x},set:function(e){e&&(x.x=e.x,x.y=e.y,x.z=e.z,n.matrixNeedsUpdate=!0)}},coneScale:{configurable:!0,enumerable:!0,get:function(){return S},set:function(e){e&&(S.x=e.x,S.y=e.y,S.z=e.z,n.matrixNeedsUpdate=!0)}},offset:{configurable:!0,enumerable:!0,get:function(){return w},set:function(e){e&&(w.x=e.x,w.y=e.y,w.z=e.z,n.matrixNeedsUpdate=!0)}},coneColor:{configurable:!0,enumerable:!0,get:function(){return o},set:function(e){e&&(o.r=e.r,o.g=e.g,o.b=e.b,e.a&&(f=e.a),n.materialNeedsUpdate=!0)}},groundColor:{configurable:!0,enumerable:!0,get:function(){return s},set:function(e){e&&(s.r=e.r,s.g=e.g,s.b=e.b,e.a&&(p=e.a),n.materialNeedsUpdate=!0)}},fenceColor:{configurable:!0,enumerable:!0,get:function(){return l},set:function(e){e&&(l.r=e.r,l.g=e.g,l.b=e.b,e.a&&(m=e.a),n.materialNeedsUpdate=!0)}},coneOpacity:{configurable:!0,enumerable:!0,get:function(){return f},set:function(e){f=e,n.materialNeedsUpdate=!0}},groundOpacity:{configurable:!0,enumerable:!0,get:function(){return p},set:function(e){p=e,n.materialNeedsUpdate=!0}},fenceOpacity:{configurable:!0,enumerable:!0,get:function(){return m},set:function(e){m=e,n.materialNeedsUpdate=!0}},brightness:{configurable:!0,enumerable:!0,get:function(){return c},set:function(e){void 0!==e&&(c=e,n.materialNeedsUpdate=!0)}},roughness:{configurable:!0,enumerable:!0,get:function(){return d},set:function(e){d=e,n.materialNeedsUpdate=!0}},metallic:{configurable:!0,enumerable:!0,get:function(){return h},set:function(e){h=e,n.materialNeedsUpdate=!0}},bloomColor:{configurable:!0,enumerable:!0,get:function(){return g},set:function(e){e&&(g.copy(e),n.materialNeedsUpdate=!0)}},transparent:{configurable:!0,enumerable:!0,get:function(){return k},set:function(e){k=e&&1,n.materialNeedsUpdate=!0}},_visible:{configurable:!0,enumerable:!0,value:!0},_layerName:{configurable:!1,enumerable:!1,value:"CommonGISLayer"},_cloudControlType:{configurable:!1,enumerable:!1,value:"Gis"},type:{configurable:!0,enumerable:!0,value:"Construction"}}),n.matrixNeedsUpdate=!1,n.materialNeedsUpdate=!1,n.visibleNeedsUpdate=!1,n}return z(e,je),C(e,[{key:"visible",get:function(){return this._visible},set:function(e){void 0===this._visible&&(this._visible=!0),e!==this._visible&&(this.visibleNeedsUpdate=!0,this._visible=e&&!0)}},{key:"coneMap",get:function(){return this.cone.map},set:function(e){e&&(this.cone.map=e,this.materialNeedsUpdate=!0)}},{key:"groundMap",get:function(){return this.ground.map},set:function(e){e&&(this.ground.map=e,this.materialNeedsUpdate=!0)}},{key:"fenceMap",get:function(){return this.fence.map},set:function(e){e&&(this.fence.map=e,this.materialNeedsUpdate=!0)}},{key:"fenceHeight",get:function(){return this._fenceHeight},set:function(e){e&&(this._fenceHeight=e)}},{key:"initChild",value:function(){this.ground=new yt,this.add(this.ground),this.fence=new bt,this.add(this.fence),this.cone=new ri,this.add(this.cone)}},{key:"setData",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.data=it(e,t,{enableDP:!1})}},{key:"toJSON",value:function(){var e,t,i,n,a,r,o,s,l,u,c,d,h=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return!h||!this.visibleNeedsUpdate||this.visible&&this.materialNeedsUpdate?{Color:{r:1,g:1,b:1,a:1},ConeColor:{r:this.coneColor.r,g:this.coneColor.g,b:this.coneColor.b,a:this.coneOpacity},GroundColor:{r:this.groundColor.r,g:this.groundColor.g,b:this.groundColor.b,a:this.groundOpacity},FenceColor:{r:this.fenceColor.r,g:this.fenceColor.g,b:this.fenceColor.b,a:this.fenceOpacity},Brightness:this.brightness,Metallic:this.metallic,Roughness:this.roughness,Opacity:1,ConeOpacity:this.coneOpacity,GroundOpacity:this.groundOpacity,FenceOpacity:this.fenceOpacity,Transparent:this.transparent,GroundTexture:null!==(e=this.parent)&&void 0!==e&&null!==(t=e.engine)&&void 0!==t&&t.enableTextureBus&&this.ground.textureRef?null:this.ground.map,GroundTextureRef:null!==(i=this.parent)&&void 0!==i&&null!==(n=i.engine)&&void 0!==n&&n.enableTextureBus&&this.ground.textureRef?this.ground.textureRef:null,ConeTexture:null!==(a=this.parent)&&void 0!==a&&null!==(r=a.engine)&&void 0!==r&&r.enableTextureBus&&this.cone.textureRef?null:this.cone.map,ConeTextureRef:null!==(o=this.parent)&&void 0!==o&&null!==(s=o.engine)&&void 0!==s&&s.enableTextureBus&&this.cone.textureRef?this.cone.textureRef:null,FenceTexture:null!==(l=this.parent)&&void 0!==l&&null!==(u=l.engine)&&void 0!==u&&u.enableTextureBus&&this.fence.textureRef?null:this.fence.map,FenceTextureRef:null!==(c=this.parent)&&void 0!==c&&null!==(d=c.engine)&&void 0!==d&&d.enableTextureBus&&this.fence.textureRef?this.fence.textureRef:null,BloomColor:this.bloomColor?{r:this.bloomColor.r,g:this.bloomColor.g,b:this.bloomColor.b,a:1}:null,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},ConeScale:{x:this.coneScale.x,y:this.coneScale.y,z:this.coneScale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,type:this.type,uuid:this.uuid,groundUuid:this.ground.uuid,coneUuid:this.cone.uuid,fenceUuid:this.fence.uuid,jsondata:h?null:this.data,FenceWidth:this.fenceHeight}:{matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},type:this.type,name:this.name,uuid:this.uuid}}},{key:"dispose",value:function(){this.traverse((function(e){e.geometry&&e.geometry.dispose(),e.material&&e.material.dispose(),e.texture=null})),this.data=null,this.texture=null}}])}(),gi=function(){function e(t){var i;return U(this,e),(i=N(this,e,[t])).name=t.name||"",i.url=t.url,i._enableSlope=!1,i.token=t.token||null,i.type="i3DTileLayer",i.initialize(),i}return z(e,vt),C(e,[{key:"url",get:function(){return this._url},set:function(e){e!==this._url&&(this.visibleNeedsUpdate=!0,this._url=e)}},{key:"initialize",value:function(){if(!this.url)return!1}},{key:"slopeAnalysis",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this._enableSlope=e&&!0,this.slopeParams={},e&&Object.assign(this.slopeParams,t)}},{key:"toJSON",value:function(){return!(!(arguments.length>0&&void 0!==arguments[0])||arguments[0])||!this.visibleNeedsUpdate||this.visible&&this.materialNeedsUpdate?{Brightness:this.brightness,Metallic:this.metallic,Roughness:this.roughness,Opacity:this.opacity,Transparent:this.transparent,BloomColor:this.bloomColor?{r:this.bloomColor.r,g:this.bloomColor.g,b:this.bloomColor.b,a:1}:null,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},Token:this.token,matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,type:this.type,uuid:this.uuid,Url:this.url?this.url:null,EnableSlope:this._enableSlope,SlopeParams:this._enableSlope?this.slopeParams:null}:{matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},type:this.type,name:this.name,uuid:this.uuid}}},{key:"dispose",value:function(){this.traverse((function(e){e.geometry&&e.geometry.dispose(),e.material&&e.material.dispose(),e.texture=null})),this.url=null,this.texture=null}}])}(),vi=function(){function e(i){var n;U(this,e),(n=N(this,e,[i])).type="AssetLayer",n.url=i.url,n.header=i.header,n.body=i.body,n.messageNeedsUpdate=!1,n.childNeedsUpdate=!1;var a=i.deviceAutoUpdate||!1,r=Math.max(1,i.deviceAutoUpdateInterval||2),o=void 0===i.renderNum?15:i.renderNum,s=void 0===i.searchMode?"coord":i.searchMode,l=void 0===i.tileLevel?16:i.tileLevel,u=void 0!==i.rtEnable&&i.rtEnable,c=i.rtUrl,d=void 0===i.rtTilelLevel?17:i.rtTilelLevel;return n.maxUpdateHeight=void 0===i.maxUpdateHeight?1e3:i.maxUpdateHeight,n.materialNeedsUpdate=!1,n.matrixNeedsUpdate=!1,n.offset=new t,Object.defineProperties(n,{deviceAutoUpdate:{configurable:!0,enumerable:!0,get:function(){return a},set:function(e){e&&(a=e,n.messageNeedsUpdate=!0)}},deviceAutoUpdateInterval:{configurable:!0,enumerable:!0,get:function(){return r},set:function(e){e&&(r=Math.max(e,2),n.messageNeedsUpdate=!0)}},renderNum:{configurable:!0,enumerable:!0,get:function(){return o},set:function(e){e&&(o=e,n.messageNeedsUpdate=!0)}},searchMode:{configurable:!0,enumerable:!0,get:function(){return s},set:function(e){e&&(s=e,n.messageNeedsUpdate=!0)}},tileLevel:{configurable:!0,enumerable:!0,get:function(){return l},set:function(e){e&&(l=e,n.messageNeedsUpdate=!0)}},rtEnable:{configurable:!0,enumerable:!0,get:function(){return u},set:function(e){u=e,n.messageNeedsUpdate=!0}},rtUrl:{configurable:!0,enumerable:!0,get:function(){return c},set:function(e){e&&(c=e,n.messageNeedsUpdate=!0)}},rtTilelLevel:{configurable:!0,enumerable:!0,get:function(){return d},set:function(e){e&&(d=e,n.messageNeedsUpdate=!0)}}}),n}return z(e,je),C(e,[{key:"visible",get:function(){return this._visible},set:function(e){void 0===this._visible&&(this._visible=!0),e!==this._visible&&(this.visibleNeedsUpdate=!0,this._visible=e&&!0)}},{key:"body",get:function(){return this._body},set:function(e){this.messageNeedsUpdate=!0,this._body=e}},{key:"addChildren",value:function(e){var t=this;if(!e||e.length<1)return!1;this.childOperate="add",this.childrenContent=[],e.forEach((function(e,i){t.childrenContent.push({uuid:e.uuid,point_id:e.point_id,config:{material:{},transform:null}})})),this.childNeedsUpdate=!0,this.materialNeedsUpdate=!0}},{key:"removeChild",value:function(e){e&&(e instanceof Array?this.removeChildren(e):this.removeChildren([e]))}},{key:"removeChildren",value:function(e){var t=this;if(!e||e.length<1)return!1;this.childOperate="remove",this.childrenContent=[],e.forEach((function(e,i){t.childrenContent.push({uuid:e.uuid,point_id:e.point_id,config:{material:{},transform:null}})})),this.childNeedsUpdate=!0,this.materialNeedsUpdate=!0}},{key:"updateChild",value:function(e){if(!e)return!1;e instanceof Array?this.updateChildren(e):this.updateChildren([e])}},{key:"updateChildren",value:function(e){var t=this;if(!e||e.length<1)return!1;this.childrenContent=[],this.childOperate="update",this.childNeedsUpdate=!0,this.materialNeedsUpdate=!0,e.forEach((function(e,i){t.updateChildContent(e)}))}},{key:"updateChildContent",value:function(e){var t,i,n=this;if(!e.uuid)return!1;var r=null===(t=this.parent)||void 0===t||null===(i=t.engine)||void 0===i?void 0:i.textureBus;if(r){var o,s,l=this.childrenContent.find((function(t){return t.uuid===e.uuid}));null!=l&&null!==(o=l.config)&&void 0!==o&&null!==(s=o.material)&&void 0!==s&&s.TextureRef&&r.releaseTexture(l.config.material.TextureRef)}var u={uuid:e.uuid,point_id:e.point_id,config:{material:{},transform:null}},c=e.params;if(void 0!==c.opacity&&(c.color.a=c.opacity),c.color&&(u.config.material.Color={r:c.color.r,g:c.color.g,b:c.color.b,a:c.color.a||1}),c.brightnessColor&&(u.config.material.BrightnessColor={r:c.brightnessColor.r,g:c.brightnessColor.g,b:c.brightnessColor.b,a:1}),c.text){var d,h,f=st(gt(c.text,c.textStyle));u.config.material.Texture=f;var p=null===(d=this.parent)||void 0===d||null===(h=d.engine)||void 0===h?void 0:h.textureBus;p&&p.publishTexture(f).then((function(e){var t=e.ref;u.config.material.TextureRef=t,u.config.material.Texture=null})).catch((function(e){console.warn("[AssetLayer] publishTexture(text) failed, fallback to base64",e)}))}else if(c.map){var m=function(e){var t,i;u.config.material.Texture=e;var a=null===(t=n.parent)||void 0===t||null===(i=t.engine)||void 0===i?void 0:i.textureBus;a&&a.publishTexture(e).then((function(e){var t=e.ref;u.config.material.TextureRef=t,u.config.material.Texture=null})).catch((function(e){console.warn("[AssetLayer] publishTexture(map) failed, fallback to base64",e)}))};lt(c.map)?m(c.map):ot(c.map,(function(e){e&&m(e)}))}void 0!==c.metallic&&(u.config.material.Metallic=c.metallic),void 0!==c.roughness&&(u.config.material.Roughness=c.roughness),void 0!==c.brightness&&(u.config.material.Brightness=c.brightness),c.position&&(u.config.transform||(u.config.transform={}),u.config.transform.Location={x:c.position.x,y:c.position.y,z:c.position.z}),c.scale&&(u.config.transform||(u.config.transform={}),u.config.transform.Scale={x:c.scale.x,y:c.scale.y,z:c.scale.z}),c.rotation&&(u.config.transform||(u.config.transform={}),u.config.transform.Rotation={x:c.rotation.x,y:c.rotation.y,z:c.rotation.z}),void 0!==c.scroll&&(u.config.scroll=a.clamp(c.scroll,-1,1)),void 0!==c.speed&&(u.config.speed=c.speed),void 0!==c.animationIndex&&(u.config.animationIndex=c.animationIndex),void 0!==c.animationLoop&&(u.config.animationLoop=c.animationLoop),void 0!==c.animationSpeed&&(u.config.animationSpeed=c.animationSpeed),this.childrenContent.push(u)}},{key:"updateChildAnimation",value:function(e){if(!e)return!1;e instanceof Array?this.updateChildrenAnimation(e):this.updateChildrenAnimation([e])}},{key:"updateChildrenAnimation",value:function(e){var t=this;if(!e||e.length<1)return!1;this.childrenContent=[],e.forEach((function(e,i){t.updateChildContent(e)})),this.childOperate="animation",this.childNeedsUpdate=!0,this.materialNeedsUpdate=!0}},{key:"toJSON",value:function(){var e={DeviceUrl:this.url,DeviceBody:this.body,DeviceHeader:this.header,SearchMode:this.searchMode,TileLevel:this.tileLevel,RenderNum:this.renderNum,RTUrl:this.rtUrl,RTEnable:this.rtEnable,RTTileLevel:this.rtTilelLevel,Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,messageNeedsUpdate:this.messageNeedsUpdate,visible:this.visible,type:this.type,uuid:this.uuid,content:this.materialNeedsUpdate?this.childrenContent:null,childOperate:this.childOperate,AutoUpdate:this.deviceAutoUpdate,AutoUpdateInterval:this.deviceAutoUpdateInterval,MaxUpdateHeight:this.maxUpdateHeight};return this.childNeedsUpdate&&(this.childNeedsUpdate=!1,this.childOperate=null,this.materialNeedsUpdate=!0),e}}])}(),yi=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{color:{r:0,g:1,b:0,a:1},brightness:1,speed:.2};return U(this,e),(t=N(this,e,[i])).type="Radar",t}return z(e,vt),C(e)}(),bi=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{color:{r:1,g:0,b:0,a:1},brightness:1,speed:2};return U(this,e),(t=N(this,e,[i])).type="Ripple",t}return z(e,vt),C(e)}(),xi=function(){function e(t){var i;return U(this,e),(i=N(this,e,[t])).type="Soil",i}return z(e,vt),C(e)}(),Si=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{gardientDirection:-1,color:{r:0,g:.48,b:.0047,a:1},color2:{r:.43,g:1,b:.42,a:1}};return U(this,e),(t=N(this,e,[i])).type="Diamond",t}return z(e,vt),C(e)}(),wi=function(){function e(t){var i;U(this,e),(i=N(this,e,[t])).type="CommonCar";var n=void 0===t.carType?3:t.carType;return Object.defineProperties(i,{carType:{configurable:!0,enumerable:!0,get:function(){return n},set:function(e){void 0!==e&&(n=e,i.overtimeInstanceIndex=[],i.data=[],i.materialNeedsUpdate=!0)}}}),i}return z(e,vt),C(e,[{key:"toJSON",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return!this.visibleNeedsUpdate||!e||this.visible&&this.materialNeedsUpdate?{Color:{r:this.color.r,g:this.color.g,b:this.color.b,a:this.opacity},Brightness:this.brightness,Metallic:this.metallic,Roughness:this.roughness,Opacity:this.opacity,Transparent:this.transparent,Scroll:this.scroll,Speed:this.speed,Texture:this.texture,GardientDirection:this.gardientDirection,Color2:{r:this.color2.r,g:this.color2.g,b:this.color2.b,a:this.opacity},BrightnessColor:this.brightnessColor?{r:this.brightnessColor.r,g:this.brightnessColor.g,b:this.brightnessColor.b,a:1}:this.color,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,animateNeedsUpdate:!this.isInstance&&this.animateNeedsUpdate,visible:this.visible,type:this.type,CarType:this.carType,name:this.name,uuid:this.uuid,jsondata:!e||this.isInstance?this._resolveJsonData():null,animateJson:this.animateNeedsUpdate?this.animateJson:null,Size:this.size,SizeAttenuation:this.sizeAttenuation,ChildIndex:this.isInstance?-1:this.childIndex,IsInstance:this.isInstance,overtimeInstanceIndex:this.overtimeInstanceIndex}:{matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},type:this.type,name:this.name,uuid:this.uuid}}}])}(),Ni=function(){function e(t){var i;return U(this,e),(i=N(this,e,[t])).type="TriangleWarning",i}return z(e,vt),C(e)}(),Ui=function(){function e(t){var i;return U(this,e),(i=N(this,e,[t])).type="Bucket",i}return z(e,vt),C(e)}(),ki=function(){function e(t){var i;return U(this,e),(i=N(this,e,[t])).type="InundationAnalysis",i}return z(e,vt),C(e)}(),Ci=function(){function e(t){var i;U(this,e),(i=N(this,e,[t])).type="SkylineAnalysis";var n=t.distance||120,a=t.lineWidth||1;return Object.defineProperties(i,{distance:{configurable:!0,enumerable:!0,get:function(){return n},set:function(e){n=e,i.materialNeedsUpdate=!0}},lineWidth:{configurable:!0,enumerable:!0,get:function(){return a},set:function(e){a=e,i.materialNeedsUpdate=!0}}}),i}return z(e,vt),C(e,[{key:"toJSON",value:function(){return{Color:{r:this.color.r,g:this.color.g,b:this.color.b,a:this.opacity},Brightness:this.brightness,Opacity:this.opacity,Transparent:this.transparent,BloomColor:this.bloomColor?{r:this.bloomColor.r,g:this.bloomColor.g,b:this.bloomColor.b,a:1}:null,Position:{x:this.position.x,y:this.position.y,z:this.position.z},type:this.type,uuid:this.uuid,matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,Distance:this.distance,LineWidth:this.lineWidth}}}])}(),Ti=function(){function e(t){var i;U(this,e),(i=N(this,e,[t])).type="VisualFieldAnalysis";var n=t.fov||60,a=t.maxDistance||5,r=t.resYX||.5,o=t.resolution||1024;return Object.defineProperties(i,{fov:{configurable:!0,enumerable:!0,get:function(){return n},set:function(e){n=e,i.materialNeedsUpdate=!0}},maxDistance:{configurable:!0,enumerable:!0,get:function(){return a},set:function(e){a=e,i.materialNeedsUpdate=!0}},resYX:{configurable:!0,enumerable:!0,get:function(){return r},set:function(e){r=e,i.materialNeedsUpdate=!0}},resolution:{configurable:!0,enumerable:!0,get:function(){return o},set:function(e){o=e,i.materialNeedsUpdate=!0}}}),i}return z(e,vt),C(e,[{key:"toJSON",value:function(){return{Color:{r:this.color.r,g:this.color.g,b:this.color.b,a:this.opacity},Position:{x:this.position.x,y:this.position.y,z:this.position.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},type:this.type,uuid:this.uuid,matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,animateNeedsUpdate:this.animateNeedsUpdate,AnimateJson:this.animateNeedsUpdate?this.animateJson:null,visible:this.visible,FOV:this.fov,MaxDistance:this.maxDistance,ResYX:this.resYX,Resolution:this.resolution,Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z}}}}])}(),Ri=function(){function e(i){var n;U(this,e),(n=N(this,e,[i])).type="CarPark";var o,s=i.position||new t,l=i.rotation||new r,u=i.scale||new t(1,1,1),c=i.color||{r:1,g:1,b:1,a:1};return Object.defineProperties(n,{position:{enumerable:!0,get:function(){return s},set:function(e){e&&(s.x=e.x,s.y=e.y,s.z=e.z,n.matrixNeedsUpdate=!0)}},rotation:{configurable:!0,enumerable:!0,get:function(){return l},set:function(e){e&&(l.x=a.clamp(e.x,-180,180),l.y=a.clamp(e.y,-180,180),l.z=a.clamp(e.z,-180,180),n.matrixNeedsUpdate=!0)}},scale:{configurable:!0,enumerable:!0,get:function(){return u},set:function(e){e&&(u.x=e.x,u.y=e.y,u.z=e.z,n.matrixNeedsUpdate=!0)}},modelType:{configurable:!0,enumerable:!0,get:function(){return n._modelType},set:function(e){e&&(n._modelType=e)}},color:{configurable:!0,enumerable:!0,get:function(){return c},set:function(e){e&&(c.r=e.r,c.g=e.g,c.b=e.b,c.a=e.a||1,n.materialNeedsUpdate=!0)}},parkType:{configurable:!0,enumerable:!0,get:function(){return n._parkType},set:function(e){e&&("out"===e.toLowerCase?n._parkType="out":n._parkType="in")}}}),n.position=s,n.rotation=l,n.scale=u,n.modelType=(o=i.modelType,isNaN(o)||o<3||o>6&&o<12||o>16?3:o),n.speed=Number(i.speed)||36,n.endState=i.endState||!1,n.color=c,n.parkType=i.parkType||"in",n}return z(e,vt),C(e,[{key:"toJSON",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return!this.visibleNeedsUpdate||!e||this.visible&&this.materialNeedsUpdate?{Position:{x:this.position.x,y:this.position.y,z:this.position.z},Color:{r:this.color.r,g:this.color.g,b:this.color.b,a:this.color.a},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Speed:this.speed,ModelType:this.modelType,EndState:this.endState,Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,animateNeedsUpdate:this.animateNeedsUpdate,visible:this.visible,type:this.type,name:this.name,uuid:this.uuid,jsondata:e?null:this._resolveJsonData(),ParkType:this.parkType}:{matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},type:this.type,name:this.name,uuid:this.uuid}}}])}();var Oi=function(){function e(i){var n;U(this,e),(n=N(this,e,[i])).type="TrafficLight",n.url=i.url,n.header=i.header,n.message=i.message;var a=void 0===i.brightness?1:i.brightness;return n.lightAltitude=void 0===i.lightAltitude?1:i.lightAltitude,n.renderScale=void 0===i.renderScale?1:i.renderScale,n.rayDetection={enable:!1,distance:0,displacementHeight:0},i.rayDetection&&(n.rayDetection.enable=void 0!==i.rayDetection.enable&&i.rayDetection.enable,n.rayDetection.distance=void 0===i.rayDetection.distance?0:i.rayDetection.distance,n.rayDetection.displacementHeight=void 0===i.rayDetection.displacementHeight?0:i.rayDetection.displacementHeight),n.messageNeedsUpdate=!1,n.materialNeedsUpdate=!1,n.matrixNeedsUpdate=!1,n.offset=new t,Object.defineProperties(n,{brightness:{configurable:!0,enumerable:!0,get:function(){return a},set:function(e){a=e,n.materialNeedsUpdate=!0}}}),n}return z(e,je),C(e,[{key:"visible",get:function(){return this._visible},set:function(e){void 0===this._visible&&(this._visible=!0),e!==this._visible&&(this.visibleNeedsUpdate=!0,this._visible=e&&!0)}},{key:"message",get:function(){return this._body},set:function(e){this.messageNeedsUpdate=!0,this._body=e}},{key:"dispose",value:function(){return!1}},{key:"toJSON",value:function(){return{Url:this.url,Message:this.message,Header:this.header,RenderScale:this.renderScale,LightAltitude:this.lightAltitude,RayDetection:this.rayDetection,Brightness:this.brightness,Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,messageNeedsUpdate:this.messageNeedsUpdate,visible:this.visible,type:this.type,uuid:this.uuid}}}])}(),Ei=function(){function e(t){var i;U(this,e),(i=N(this,e,[t])).type="RoadName",i.fontSize=t.fontSize||14,i.rayDetectionDistance="rayDetectionDistance"in t?t.rayDetectionDistance:500,i.displacementHeight="displacementHeight"in t?t.displacementHeight:40*i.scale.z,i.data=t.data||[],i.filename=t.filename||null;var n=t.color||{r:1,g:1,b:1,a:1};i.openCollision=t.openCollision||!1,i.switchScale=t.switchScale||!1,i.minScale="minScale"in t?t.minScale:1,i.maxScale="maxScale"in t?t.maxScale:2,i.minDistance=t.minDistance||0,i.maxDistance=t.maxDistance||5e3;var a=t.switchPitchRotate||!1;return i.minPitch="minPitch"in t?t.minPitch:0,i.maxPitch="maxPitch"in t?t.maxPitch:90,i.collisionScale=t.collisionScale||2,i.brightness=t.brightness||1,Object.defineProperties(i,{color:{enumerable:!0,get:function(){return n},set:function(e){e!==n&&(n=e,this.materialNeedsUpdate=!0)}},switchPitchRotate:{enumerable:!0,get:function(){return a},set:function(e){e!==a&&(a=e,this.materialNeedsUpdate=!0)}}}),i}return z(e,vt),C(e,[{key:"toJSON",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return!this.visibleNeedsUpdate||!e||this.visible&&this.materialNeedsUpdate?{Color:{r:this.color.r,g:this.color.g,b:this.color.b,a:this.opacity},Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.z,y:this.scale.y,z:this.scale.x},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,type:this.type,name:this.name,uuid:this.uuid,jsondata:this.data,rayDetectionDistance:this.rayDetectionDistance,displacementHeight:this.displacementHeight,FileName:this.filename,FontSize:this.fontSize,OpenCollision:this.openCollision,SwitchScale:this.switchScale,MinScale:this.minScale,MaxScale:this.maxScale,MinDistance:this.minDistance,MaxDistance:this.maxDistance,SwitchPitchRotate:this.switchPitchRotate,MinPitch:this.minPitch,MaxPitch:this.maxPitch,CollisionScale:this.collisionScale,ShadowColor:this.shadowColor,ShadowOffset:this.shadowOffset,Brightness:this.brightness}:{matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.z,y:this.scale.y,z:this.scale.x},Rotation:{x:this.rotation.x,y:this.rotation.y+90,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},type:this.type,name:this.name,uuid:this.uuid}}}])}(),zi=function(){function e(i){var n;U(this,e),(n=N(this,e,[i])).type="AutonomousVehicle";var a=i.url,r=i.header,o=void 0===i.labelRenderScale?1:i.labelRenderScale,s=void 0===i.labelRenderType?1:i.labelRenderType,l=void 0===i.labelBrightness?1:i.labelBrightness,u=void 0===i.followMode?"Third":i.followMode;n.labelField=void 0===i.labelField?"vehicleId":i.labelField,n.speedField=void 0===i.speedField?"speed":i.speedField,n.followRotation=void 0===i.followRotation?{Roll:!1,Pitch:!1,Yaw:!0}:i.followRotation;var c=void 0===i.followZoom?0:i.followZoom,d=void 0!==i.switchScale&&i.switchScale,h=void 0===i.minViewPortHeight?30:i.minViewPortHeight,f=void 0===i.maxViewPortHeight?300:i.maxViewPortHeight,p=void 0===i.minScale?1:i.minScale,m=void 0===i.maxScale?2:i.maxScale,g=void 0===i.controlTypeList?[]:i.controlTypeList,v=void 0!==i.predictionEnable&&i.predictionEnable,y=void 0===i.predictionLineStyle?{}:i.predictionLineStyle;return n.rayDetection={enable:!1,distance:0},i.rayDetection&&(n.rayDetection.enable=void 0!==i.rayDetection.enable&&i.rayDetection.enable,n.rayDetection.distance=void 0===i.rayDetection.distance?0:i.rayDetection.distance),n.messageNeedsUpdate=!1,n.materialNeedsUpdate=!1,n.matrixNeedsUpdate=!1,n.followNeedsUpdate=!1,n.offset=new t,Object.defineProperties(n,{url:{configurable:!0,enumerable:!0,get:function(){return a},set:function(e){e&&(a=e,n.messageNeedsUpdate=!0)}},header:{configurable:!0,enumerable:!0,get:function(){return r},set:function(e){e&&(r=e,n.messageNeedsUpdate=!0)}},labelRenderScale:{configurable:!0,enumerable:!0,get:function(){return o},set:function(e){e&&(o=e,n.materialNeedsUpdate=!0)}},labelBrightness:{configurable:!0,enumerable:!0,get:function(){return l},set:function(e){e&&(l=e,n.materialNeedsUpdate=!0)}},predictionLineStyle:{configurable:!0,enumerable:!0,get:function(){return y},set:function(e){e&&(y=e,n.materialNeedsUpdate=!0)}},labelRenderType:{configurable:!0,enumerable:!0,get:function(){return s},set:function(e){e&&(s=e,n.materialNeedsUpdate=!0)}},predictionEnable:{configurable:!0,enumerable:!0,get:function(){return v},set:function(e){e&&(v=e,n.materialNeedsUpdate=!0)}},followMode:{configurable:!0,enumerable:!0,get:function(){return u},set:function(e){e&&(u=e,n.followNeedsUpdate=!0)}},followZoom:{configurable:!0,enumerable:!0,get:function(){return c},set:function(e){e&&(c=e,n.materialNeedsUpdate=!0)}},switchScale:{configurable:!0,enumerable:!0,get:function(){return d},set:function(e){e&&(d=e,n.materialNeedsUpdate=!0)}},minViewPortHeight:{configurable:!0,enumerable:!0,get:function(){return h},set:function(e){e&&(h=e,n.materialNeedsUpdate=!0)}},maxViewPortHeight:{configurable:!0,enumerable:!0,get:function(){return f},set:function(e){e&&(f=e,n.materialNeedsUpdate=!0)}},minScale:{configurable:!0,enumerable:!0,get:function(){return p},set:function(e){e&&(p=e,n.materialNeedsUpdate=!0)}},maxScale:{configurable:!0,enumerable:!0,get:function(){return m},set:function(e){e&&(m=e,n.materialNeedsUpdate=!0)}},controlTypeList:{configurable:!0,enumerable:!0,get:function(){return g},set:function(e){g=e||[]}}}),n}return z(e,je),C(e,[{key:"visible",get:function(){return this._visible},set:function(e){void 0===this._visible?this._visible=!0:(this._visible=e&&!0,this.visibleNeedsUpdate=!0)}},{key:"dispose",value:function(){return!1}},{key:"toJSON",value:function(){return(!(arguments.length>0&&void 0!==arguments[0])||arguments[0])&&this.visibleNeedsUpdate?{Url:this.url,Header:this.header,LabelRenderScale:this.labelRenderScale,LabelRenderType:this.labelRenderType,LabelField:this.labelField,SpeedField:this.speedField,RayDetection:this.rayDetection,ControlTypeList:this.controlTypeList,FollowMode:this.followMode,SwitchScale:this.switchScale,MinViewPortHeight:this.minViewPortHeight,MaxViewPortHeight:this.maxViewPortHeight,FollowRotation:this.followRotation,LabelBrightness:this.labelBrightness,MinScale:this.minScale,MaxScale:this.maxScale,FollowZoom:this.followZoom,PredictionLineStyle:this.predictionLineStyle,PredictionEnable:this.predictionEnable,Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,messageNeedsUpdate:this.messageNeedsUpdate,visible:this.visible,type:this.type,uuid:this.uuid}:{Url:this.url,Header:this.header,LabelRenderScale:this.labelRenderScale,LabelRenderType:this.labelRenderType,LabelField:this.labelField,SpeedField:this.speedField,RayDetection:this.rayDetection,FollowMode:this.followMode,SwitchScale:this.switchScale,MinViewPortHeight:this.minViewPortHeight,MaxViewPortHeight:this.maxViewPortHeight,ControlTypeList:this.controlTypeList,FollowRotation:this.followRotation,FollowZoom:this.followZoom,LabelBrightness:this.labelBrightness,PredictionLineStyle:this.predictionLineStyle,PredictionEnable:this.predictionEnable,MinScale:this.minScale,MaxScale:this.maxScale,Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,messageNeedsUpdate:this.messageNeedsUpdate,visible:this.visible,type:this.type,uuid:this.uuid}}}])}(),Ii=function(){function e(t){var i;return U(this,e),(i=N(this,e,[t])).type="QuadPyramidTop",i}return z(e,vt),C(e)}(),Ai=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};U(this,e),(t=N(this,e,[i])).visible=void 0===i.visible||i.visible,t.renderType=void 0===i.renderType?1:i.renderType;var n=i.url||"",a=i.size||{x:300,y:200},r=0===i.faceType?0:i.faceType||1,o=i.pivot||{x:.5,y:.5},s=void 0!==i.switchScale&&i.switchScale,l=i.minDistance||0,u=i.maxDistance||0,c=void 0===i.minScale?1:i.minScale,d=void 0===i.maxScale?1:i.maxScale;return t.type="WebViewPoint",Object.defineProperties(t,{url:{configurable:!0,enumerable:!0,get:function(){return n},set:function(e){n=e,t.materialNeedsUpdate=!0}},size:{configurable:!0,enumerable:!0,get:function(){return a},set:function(e){a=e,t.materialNeedsUpdate=!0}},pivot:{configurable:!0,enumerable:!0,get:function(){return o},set:function(e){o=e,t.materialNeedsUpdate=!0}},faceType:{configurable:!0,enumerable:!0,get:function(){return r},set:function(e){r=e,t.materialNeedsUpdate=!0}},switchScale:{configurable:!0,enumerable:!0,get:function(){return s},set:function(e){s=e,t.materialNeedsUpdate=!0}},minDistance:{configurable:!0,enumerable:!0,get:function(){return l},set:function(e){l=e,t.materialNeedsUpdate=!0}},maxDistance:{configurable:!0,enumerable:!0,get:function(){return u},set:function(e){u=e,t.materialNeedsUpdate=!0}},minScale:{configurable:!0,enumerable:!0,get:function(){return c},set:function(e){c=e,t.materialNeedsUpdate=!0}},maxScale:{configurable:!0,enumerable:!0,get:function(){return d},set:function(e){d=e,t.materialNeedsUpdate=!0}}}),t}return z(e,vt),C(e,[{key:"setData",value:function(e){this.data=nt(e)}},{key:"toJSON",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return e&&this.visibleNeedsUpdate&&!this.materialNeedsUpdate?{matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,FadeIn:this.fadeIn,type:this.type,name:this.name,uuid:this.uuid}:{Pivot:this.pivot,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},type:this.type,uuid:this.uuid,jsondata:e?null:this.data,FaceType:Vt(this.faceType),SwitchScale:this.switchScale,MinDistance:this.minDistance,MaxDistance:this.maxDistance,MaxScale:this.maxScale,MinScale:this.minScale,matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,URL:this.url,Size:this.size,Brightness:this.brightness,RenderType:this.renderType}}},{key:"copy",value:function(t){var i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return this.fontWeight=t.fontWeight,this.fontSize=t.fontSize,this.borderWidth=t.borderWidth,this.borderColor=t.borderColor,this.shadowColor=t.shadowColor,this.shadowOffset=t.shadowOffset,F(e,"copy",this)([t,i]),this}}])}(),_i=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};U(this,e),(t=N(this,e,[i])).type="LayerBuilding";var n=i.buildingName||"all",a=i.layeringHeight||500,r=i.layeringBaseHeight||300,o=i.floorPullDir||{x:5e3,y:0,z:0};return t.hiddenDefault=void 0===i.HiddenDefault||i.HiddenDefault,t.floorNum=0,t.eventName="",t.buildingState="create",t.isLayering={},t.isLayering[n]=!1,Object.defineProperties(t,{layeringHeight:{enumerable:!0,get:function(){return a},set:function(e){e!==a&&(a=e,this.materialNeedsUpdate=!0,this.buildingState="update")}},buildingName:{enumerable:!0,get:function(){return n},set:function(e){e&&e!==n&&(n=e,this.materialNeedsUpdate=!0,this.buildingState="update")}},layeringBaseHeight:{enumerable:!0,get:function(){return r},set:function(e){e!==r&&(r=e,this.materialNeedsUpdate=!0,this.buildingState="update")}},floorPullDir:{configurable:!0,enumerable:!0,get:function(){return o},set:function(e){e&&(o.x=e.x,o.y=e.y,o.z=e.z,t.materialNeedsUpdate=!0,t.buildingState="update")}}}),t}return z(e,vt),C(e,[{key:"layeringBuilding",value:function(){if(this.eventName="Layering",this.animateNeedsUpdate=!0,this.buildingState="update","all"===this.buildingName)for(var e in this.isLayering)this.isLayering[e]=!0;else this.isLayering[this.buildingName]=!0}},{key:"backBuildingToNormal",value:function(){if(this.eventName="BackToNormal",this.animateNeedsUpdate=!0,this.buildingState="update","all"===this.buildingName)for(var e in this.isLayering)this.isLayering[e]=!1;else this.isLayering[this.buildingName]=!1}},{key:"pullBuilding",value:function(e){if(void 0===this.isLayering[this.buildingName]){if(!this.isLayering.all)return void console.warn("该建筑物不在分解状态")}else if(!1===this.isLayering[this.buildingName])return void console.warn("该建筑物不在分解状态");e?(this.eventName="Pull",this.floorNum=e,this.animateNeedsUpdate=!0,this.buildingState="update"):console.warn("请输入有效楼层")}},{key:"pushBuilding",value:function(e){if(void 0===this.isLayering[this.buildingName]){if(!this.isLayering.all)return void console.warn("该建筑物不在分解状态")}else if(!this.isLayering[this.buildingName])return void console.warn("该建筑物不在分解状态");e?(this.eventName="Push",this.floorNum=e,this.animateNeedsUpdate=!0,this.buildingState="update"):console.warn("请输入有效楼层")}},{key:"hideBuildings",value:function(e){Array.isArray(e)?(this.eventName="Hide",this.floorNum=e,this.animateNeedsUpdate=!0,this.buildingState="update"):console.error("numbers必须为数组")}},{key:"showBuildings",value:function(e){Array.isArray(e)?(this.eventName="Show",this.floorNum=e,this.animateNeedsUpdate=!0,this.buildingState="update"):console.error("numbers必须为数组")}},{key:"hideAboveFloor",value:function(e){0!==e&&(this.eventName="HideAboveFloor",this.floorNum=e,this.animateNeedsUpdate=!0,this.buildingState="update")}},{key:"showAll",value:function(){this.eventName="ShowAll",this.animateNeedsUpdate=!0,this.buildingState="update"}},{key:"hideAll",value:function(){this.eventName="HideAll",this.animateNeedsUpdate=!0,this.buildingState="update"}},{key:"toJSON",value:function(){return{type:this.type,name:this.name,uuid:this.uuid,BuildingName:this.buildingName,LayeringHeight:this.layeringHeight,LayeringBaseHeight:this.layeringBaseHeight,FloorPullDir:this.floorPullDir,FloorNum:this.floorNum,EventName:this.eventName,materialNeedsUpdate:this.materialNeedsUpdate,animateNeedsUpdate:this.animateNeedsUpdate,BuildingState:this.buildingState,HiddenDefault:this.hiddenDefault}}}])}(),Mi=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};U(this,e),(t=N(this,e,[i])).type="MockCarStream",t.renderNum=void 0===i.renderNum?20:i.renderNum,t.enableTrigger=void 0!==i.enableTrigger&&i.enableTrigger,t.twoSide=i.twoSide||!1,t.twoSideWidth=i.twoSideWidth||200,t.reverseInterval=i.reverseInterval||1e3,t.reverseSpeed=i.reverseSpeed||1500;var n=i.runOnTheGround||!1,a=i.lanesNumber||1,r=i.forwardInterval||1e3,o=i.forwardSpeed||200,s=i.splineLoop||!1,l=i.randomBool||!1,u=i.randomForwardOffset||0,c=i.laneWidth||300,d=i.rotationOffset||0,h=i.scaleOffset||{x:1,y:1,z:1};return Object.defineProperties(t,{runOnTheGround:{enumerable:!0,get:function(){return n},set:function(e){n!==e&&(n=e,t.materialNeedsUpdate=!0)}},lanesNumber:{enumerable:!0,get:function(){return a},set:function(e){a!==e&&(a=e,t.materialNeedsUpdate=!0)}},forwardInterval:{enumerable:!0,get:function(){return r},set:function(e){r!==e&&(r=e,t.materialNeedsUpdate=!0)}},forwardSpeed:{enumerable:!0,get:function(){return o},set:function(e){o!==e&&(o=e,t.materialNeedsUpdate=!0)}},splineLoop:{enumerable:!0,get:function(){return s},set:function(e){s!==e&&(s=e,t.materialNeedsUpdate=!0)}},randomBool:{enumerable:!0,get:function(){return l},set:function(e){l!==e&&(l=e,t.materialNeedsUpdate=!0)}},randomForwardOffset:{enumerable:!0,get:function(){return u},set:function(e){u!==e&&(u=e,t.materialNeedsUpdate=!0)}},laneWidth:{enumerable:!0,get:function(){return c},set:function(e){c!==e&&(c=e,t.materialNeedsUpdate=!0)}},rotationOffset:{enumerable:!0,get:function(){return d},set:function(e){d!==e&&(d=e,t.materialNeedsUpdate=!0)}},scaleOffset:{enumerable:!0,get:function(){return h},set:function(e){h=e,t.materialNeedsUpdate=!0}}}),t}return z(e,vt),C(e,[{key:"toJSON",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return{Color:{r:this.color.r,g:this.color.g,b:this.color.b,a:this.opacity},Brightness:this.brightness,Opacity:this.opacity,Transparent:this.transparent,BloomColor:this.bloomColor?{r:this.bloomColor.r,g:this.bloomColor.g,b:this.bloomColor.b,a:1}:null,Position:{x:this.position.x,y:this.position.y,z:this.position.z},EnableTrigger:this.enableTrigger,TwoSide:this.twoSide,TwoSideWidth:this.twoSideWidth,ReverseInterval:this.reverseInterval,ReverseSpeed:this.reverseSpeed,type:this.type,uuid:this.uuid,matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},RunOnTheGround:this.runOnTheGround,LanesNumber:this.lanesNumber,ForwardInterval:this.forwardInterval,ForwardSpeed:this.forwardSpeed,SplineLoop:this.splineLoop,RandomBool:this.randomBool,RandomForwardOffset:this.randomForwardOffset,LaneWidth:this.laneWidth,RotationOffset:this.rotationOffset,ScaleOffset:this.scaleOffset,jsondata:e?null:this._resolveJsonData(),RenderNum:this.renderNum}}}])}(),Li=[{r:.685325,g:1,b:.298996},{r:.963023,g:1,b:.198688},{r:1,g:.710181,b:.235817},{r:1,g:.440705,b:.156314},{r:1,g:.310357,b:.150163},{r:1,g:.219426,b:.155697}],Di=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};U(this,e),(t=N(this,e,[i])).type="SlopeAnalysis";var n=i.range||null,a=Bi(i.minAngle,!0),r=Bi(i.maxAngle,!1),o=Pi(i.colorRange),s=i.useSlopeAnalysis||!1,l=i.tilePathFieldName||"";return Object.defineProperties(t,{tilePathFieldName:{configurable:!0,enumerable:!0,get:function(){return l},set:function(e){l=e,t.materialNeedsUpdate=!0}},range:{configurable:!0,enumerable:!0,get:function(){return n},set:function(e){n=e,t.materialNeedsUpdate=!0}},minAngle:{configurable:!0,enumerable:!0,get:function(){return a},set:function(e){a=Bi(e,!0),t.materialNeedsUpdate=!0}},maxAngle:{configurable:!0,enumerable:!0,get:function(){return r},set:function(e){r=Bi(e,!1),t.materialNeedsUpdate=!0}},colorRange:{configurable:!0,enumerable:!0,get:function(){return o},set:function(e){o=Pi(e),t.materialNeedsUpdate=!0}},useSlopeAnalysis:{configurable:!0,enumerable:!0,get:function(){return s},set:function(e){s=e,e&&(t.materialNeedsUpdate=!0)}}}),t}return z(e,vt),C(e,[{key:"toJSON",value:function(){return{Color:{r:this.color.r,g:this.color.g,b:this.color.b,a:this.opacity},Brightness:this.brightness,Opacity:this.opacity,Transparent:this.transparent,BloomColor:this.bloomColor?{r:this.bloomColor.r,g:this.bloomColor.g,b:this.bloomColor.b,a:1}:null,Position:{x:this.position.x,y:this.position.y,z:this.position.z},type:this.type,uuid:this.uuid,matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,jsonData:this.range,MinAngle:this.minAngle,MaxAngle:this.maxAngle,ColorRange:this.colorRange,UseSlopeAnalysis:Number(this.useSlopeAnalysis),TilePathFieldName:this.tilePathFieldName}}}])}();function Pi(e){if(e&&e instanceof Object){var t=0,i=0;for(var n in e)i=n,t++;if(0===i)return{25:Li[0],40:Li[1],55:Li[2],70:Li[3],80:Li[4],90:Li[5]};for(var a=t;a<6;a++)i<25?e[i=40]=Li[1]:i<40.00001?e[i=55]=Li[2]:i<55.00001?e[i=70]=Li[3]:i<70.00001?e[i=80]=Li[4]:i<80.00001?e[i=90]=Li[5]:i<90.00001?e[i=91]=Li[5]:e[i+=a]=Li[5];return e}return{25:Li[0],40:Li[1],55:Li[2],70:Li[3],80:Li[4],90:Li[5]}}function Bi(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return!(arguments.length>1&&void 0!==arguments[1])||arguments[1]?e<=0?0:e:e<=0?90:e}var Fi=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};U(this,e),(t=N(this,e,[i])).pointType="pointType"in i?i.pointType.toLowerCase():"iconpoint";var n=i.pointStyle||{};for(var a in n.renderType=0,n.openCollision=!1,t.pointJSON=Wi(t.pointType,n),t.clusterStyle=i.clusterStyle||{},t.clusterStyle){var r=t.clusterStyle[a];t.clusterStyle[a]=Wi(t.pointType,r)}var o=i.minPixelDistance||100;return t.type="ClusterPoint",Object.defineProperties(t,{minPixelDistance:{configurable:!0,enumerable:!0,get:function(){return o},set:function(e){var i=Number(e);i&&o!==i&&(o=i,t.materialNeedsUpdate=!0)}}}),t}return z(e,vt),C(e,[{key:"setData",value:function(e){this.data=nt(e)}},{key:"toJSON",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return!e||!this.visibleNeedsUpdate||this.visible&&this.materialNeedsUpdate?{Color:{r:this.color.r,g:this.color.g,b:this.color.b,a:this.opacity},Brightness:this.brightness,Metallic:this.metallic,Roughness:this.roughness,Opacity:this.opacity,Transparent:this.transparent,Texture:this.texture,BloomColor:this.bloomColor?{r:this.bloomColor.r,g:this.bloomColor.g,b:this.bloomColor.b,a:1}:null,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},type:this.type,uuid:this.uuid,jsondata:e?null:this.data,matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,animateNeedsUpdate:this.animateNeedsUpdate,animateJson:this.animateNeedsUpdate?this.animateJson:null,MinPixelDistance:this.minPixelDistance,PointJSON:this.pointJSON,PointType:this.pointType,ClusterStyle:this.clusterStyle}:{matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},type:this.type,name:this.name,uuid:this.uuid}}},{key:"copy",value:function(t){var i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return this.size=t.size,F(e,"copy",this)([t,i]),this}}])}();function Wi(e,t){var i;switch(e){case"basiclabel":i=new Kt(t).toJSON();case"iconpoint":i=new Jt(t).toJSON();case"textpoint":i=new qt(t).toJSON();default:i=new Jt(t).toJSON()}return t.clusterText&&(i.ClusterText=t.clusterText),i}var ji=function(){function e(t){var i;return U(this,e),(i=N(this,e,[t])).visible=void 0===t.visible||t.visible,i}return z(e,je),C(e,[{key:"visible",get:function(){return this._visible},set:function(e){void 0===this._visible&&(this._visible=!0),e!==this._visible&&(this.visibleNeedsUpdate=!0,this._visible=e&&!0)}}])}(),Hi=function(){function e(i){var n;U(this,e),(n=N(this,e,[i])).type="UserInfoLightLayer";var a=i.url,r=i.header,o=void 0===i.brightness?1:i.brightness,s=void 0===i.lightAltitude?1:i.lightAltitude,l=void 0===i.renderScale?1:i.renderScale,u=void 0===i.renderTilesNum?3:i.renderTilesNum,c=void 0===i.updateCheckInterval?2:i.updateCheckInterval,d=void 0===i.maxUpdateHeight?1e3:i.maxUpdateHeight,h=void 0===i.centerDetectDistance?3e3:i.centerDetectDistance;return n.guidingLine={enable:!0,color:{r:.171441,g:.223228,b:.376262}},i.guidingLine&&(n.guidingLine.enable=void 0===i.guidingLine.enable||i.guidingLine.enable,n.guidingLine.color=void 0===i.guidingLine.color?{r:.171441,g:.223228,b:.376262}:i.guidingLine.color),n.rayDetection={enable:!1,distance:0,displacementHeight:0},i.rayDetection&&(n.rayDetection.enable=void 0!==i.rayDetection.enable&&i.rayDetection.enable,n.rayDetection.distance=void 0===i.rayDetection.distance?0:i.rayDetection.distance,n.rayDetection.displacementHeight=void 0===i.rayDetection.displacementHeight?0:i.rayDetection.displacementHeight),n.messageNeedsUpdate=!1,n.materialNeedsUpdate=!1,n.matrixNeedsUpdate=!1,n.offset=new t,Object.defineProperties(n,{url:{configurable:!0,enumerable:!0,get:function(){return a},set:function(e){a=e,n.materialNeedsUpdate=!0}},header:{configurable:!0,enumerable:!0,get:function(){return r},set:function(e){r=e,n.materialNeedsUpdate=!0}},lightAltitude:{configurable:!0,enumerable:!0,get:function(){return s},set:function(e){s=e,n.materialNeedsUpdate=!0}},renderScale:{configurable:!0,enumerable:!0,get:function(){return l},set:function(e){l=e,n.materialNeedsUpdate=!0}},renderTilesNum:{configurable:!0,enumerable:!0,get:function(){return u},set:function(e){u=e,n.materialNeedsUpdate=!0}},updateCheckInterval:{configurable:!0,enumerable:!0,get:function(){return c},set:function(e){c=e,n.materialNeedsUpdate=!0}},centerDetectDistance:{configurable:!0,enumerable:!0,get:function(){return h},set:function(e){h=e,n.materialNeedsUpdate=!0}},brightness:{configurable:!0,enumerable:!0,get:function(){return o},set:function(e){o=e,n.materialNeedsUpdate=!0}},maxUpdateHeight:{configurable:!0,enumerable:!0,get:function(){return d},set:function(e){d=e,n.materialNeedsUpdate=!0}}}),n}return z(e,ji),C(e,[{key:"dispose",value:function(){return!1}},{key:"toJSON",value:function(){return{Url:this.url,Header:this.header,RenderScale:this.renderScale,LightAltitude:this.lightAltitude,CenterDetectDistance:this.centerDetectDistance,RayDetection:this.rayDetection,GuidingLine:this.guidingLine,Brightness:this.brightness,RenderTilesNum:this.renderTilesNum,UpdateCheckInterval:this.updateCheckInterval,MaxUpdateHeight:this.maxUpdateHeight,Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,messageNeedsUpdate:this.messageNeedsUpdate,visible:this.visible,type:this.type,uuid:this.uuid}}}])}(),Gi=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};U(this,e),(t=N(this,e,[i])).name=i.name||"",t.type="RoutePlan";var n=i.url;return t.messageNeedsUpdate=!1,Object.defineProperties(t,{url:{configurable:!0,enumerable:!0,get:function(){return n},set:function(e){e&&(n=e,t.messageNeedsUpdate=!0)}}}),t}return z(e,bt),C(e,[{key:"toJSON",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return!e||!this.visibleNeedsUpdate||this.visible&&this.materialNeedsUpdate?{Color:{r:this.color.r,g:this.color.g,b:this.color.b,a:this.opacity},URL:this.url,Brightness:this.brightness,Metallic:this.metallic,Roughness:this.roughness,Opacity:this.opacity,Transparent:this.transparent,Collision:this.collision,Texture:this.texture,BloomColor:this.bloomColor?{r:this.bloomColor.r,g:this.bloomColor.g,b:this.bloomColor.b,a:1}:null,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,messageNeedsUpdate:this.messageNeedsUpdate,visible:this.visible,type:this.type,uuid:this.uuid,jsondata:e?null:this._resolveJsonData(),Style:this.style,Spline_Type:this.splineType,MeshDirection:this.direction,RenderType:this.renderType,Section_Length:this.section_Length,Width:this.width,Tilling:this.tilling,Speed:this.speed,Open_Stroke:this.openStroke,Stroke_Color:this.strokeColor?{r:this.strokeColor.r,g:this.strokeColor.g,b:this.strokeColor.b,a:1}:null,Stroke_Width:this.strokeWidth,animateNeedsUpdate:this.animateNeedsUpdate,animateJson:this.animateNeedsUpdate?this.animateJson:null,LineUVOption:this.lineUVOption,colordata:this.colordata}:{matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},type:this.type,name:this.name,uuid:this.uuid}}},{key:"copy",value:function(t){var i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return this.style=t.style,this.splineType=t.splineType,this.direction=t.direction,this.width=t.width,this.tilling=t.tilling,this.speed=t.speed,this.openStroke=t.openStroke,this.strokeColor=t.strokeColor,this.strokeWidth=t.strokeWidth,F(e,"copy",this)([t,i]),this}}])}(),Vi=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return U(this,e),(t=N(this,e,[i])).visible=void 0===i.visible||i.visible,t.lightType=void 0===i.lightType?"PointLight":i.lightType,t.pointLightStyle=void 0===i.pointLightStyle?{intensity:8,color:{r:1,g:1,b:1}}:i.pointLightStyle,t.spotLightStyle=void 0===i.spotLightStyle?{intensity:8,color:{r:1,g:1,b:1},innerConeAngle:0,outerConeAngle:44}:i.spotLightStyle,t.rectLightStyle=void 0===i.rectLightStyle?{intensity:8,color:{r:1,g:1,b:1},barnDoorAngle:88,barnDoorlength:20}:i.rectLightStyle,t.type="Light",t}return z(e,vt),C(e,[{key:"setData",value:function(e){this.data=nt(e)}},{key:"toJSON",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return e&&this.visibleNeedsUpdate&&!this.materialNeedsUpdate?{matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,type:this.type,name:this.name,uuid:this.uuid}:{Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},type:this.type,uuid:this.uuid,jsondata:e?null:this.data,matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,LightType:this.lightType,PointLightStyle:this.pointLightStyle,SpotLightStyle:this.spotLightStyle,RectLightStyle:this.rectLightStyle,visible:this.visible}}},{key:"copy",value:function(t){var i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return this.fontWeight=t.fontWeight,this.fontSize=t.fontSize,this.borderWidth=t.borderWidth,this.borderColor=t.borderColor,this.shadowColor=t.shadowColor,this.shadowOffset=t.shadowOffset,F(e,"copy",this)([t,i]),this}}])}(),Ji=function(){function e(){var i,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};U(this,e),(i=N(this,e,[n])).name=n.name||"",i.type="LargeRoadCondition",i.defaultColors={1:{r:.015625,g:0,b:0,a:1},2:{r:.043403,g:.001204,b:.001635,a:1},3:{r:.078125,g:.058385,b:0,a:1},4:{r:207e-6,g:.109375,b:0,a:1}};var a=n.roadGeoJsonUrl||"",r=n.roadConditionUrl||"",o=n.layerGroupName||"",s=void 0===n.heightOffset?.7:n.heightOffset,l=void 0===n.camFOV?90:n.camFOV,u=void 0===n.aspectRatio?1:n.aspectRatio,c=n.colors||i.defaultColors,d=i.validateColors(c)?c:i.defaultColors,h=i.getValidBrightnessList(n.brightnessList);return i.messageNeedsUpdate=!1,i.materialNeedsUpdate=!1,i.matrixNeedsUpdate=!1,i.offset=new t,Object.defineProperties(i,{roadGeoJsonUrl:{enumerable:!0,get:function(){return a},set:function(e){e&&(a=e,this.materialNeedsUpdate=!0)}},roadConditionUrl:{enumerable:!0,get:function(){return r},set:function(e){e&&(r=e,this.materialNeedsUpdate=!0)}},layerGroupName:{enumerable:!0,get:function(){return o},set:function(e){e&&(o=e,this.materialNeedsUpdate=!0)}},heightOffset:{configurable:!0,enumerable:!0,get:function(){return s},set:function(e){void 0!==e&&(s=e,i.materialNeedsUpdate=!0)}},camFOV:{configurable:!0,enumerable:!0,get:function(){return l},set:function(e){void 0!==e&&(l=e,i.materialNeedsUpdate=!0)}},aspectRatio:{configurable:!0,enumerable:!0,get:function(){return u},set:function(e){void 0!==e&&(u=e,i.materialNeedsUpdate=!0)}},colors:{configurable:!0,enumerable:!0,get:function(){return d},set:function(e){void 0!==e&&(d=i.validateColors(e)?e:i.defaultColors,i.materialNeedsUpdate=!0)}},brightnessList:{configurable:!0,enumerable:!0,get:function(){return h},set:function(e){void 0!==e&&(h=i.getValidBrightnessList(e),i.materialNeedsUpdate=!0)}}}),i}return z(e,ji),C(e,[{key:"getValidBrightnessList",value:function(e){return Array.isArray(e)&&4===e.length&&this.allElementsGreaterThanZero(e)?e:[15,15,15,15]}},{key:"allElementsGreaterThanZero",value:function(e){return e.every((function(e){return"number"==typeof e&&e>=0}))}},{key:"validateColors",value:function(e){if("object"!==G(e)||null===e)return console.error("Invalid color format: Colors should be a non-null object."),!1;for(var t in this.defaultColors)if(this.defaultColors.hasOwnProperty(t)){if(!e.hasOwnProperty(t))return console.error("Missing color key: ".concat(t)),!1;var i=e[t];if(!this.isValidColorComponent(i))return console.error("Invalid color components at key: ".concat(t)),!1}return!0}},{key:"isValidColorComponent",value:function(e){if("object"!==G(e)||null===e)return!1;var t=e.r,i=e.g,n=e.b,a=e.a;return this.isNumberInRange(t)&&this.isNumberInRange(i)&&this.isNumberInRange(n)&&this.isNumberInRange(a)}},{key:"isNumberInRange",value:function(e){return"number"==typeof e&&e>=0&&e<=1}},{key:"dispose",value:function(){return!1}},{key:"toJSON",value:function(){return{RoadGeoJsonUrl:this.roadGeoJsonUrl,LayerGroupName:this.layerGroupName,RoadConditionUrl:this.roadConditionUrl,HeightOffset:this.heightOffset,CamFOV:this.camFOV,AspectRatio:this.aspectRatio,Colors:this.colors,BrightnessList:this.brightnessList,Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,messageNeedsUpdate:this.messageNeedsUpdate,visible:this.visible,type:this.type,uuid:this.uuid}}}])}(),qi={version:"2.9.2",name:"CloudRenderEngine",author:["liran23"]},Yi=function(){function e(i){var n;U(this,e),(n=N(this,e,[i])).type="IndoorMap",n.url=i.url,n.mpoi="",n.floor=999,n.floorList=[];var a=i.layeringHeight||500,r=i.layeringBaseHeight||300;return n.messageNeedsUpdate=!1,n.materialNeedsUpdate=!1,n.matrixNeedsUpdate=!1,n.animateNeedsUpdate=!1,n.offset=new t,Object.defineProperties(n,{layeringHeight:{enumerable:!0,get:function(){return a},set:function(e){e!==a&&(a=e,this.materialNeedsUpdate=!0)}},layeringBaseHeight:{enumerable:!0,get:function(){return r},set:function(e){e!==r&&(r=e,this.materialNeedsUpdate=!0)}}}),n}return z(e,je),C(e,[{key:"dispose",value:function(){return!1}},{key:"getIndoorDataByCenter",value:(n=w(D().mark((function e(t){var i,n,a=arguments;return D().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=a.length>1&&void 0!==a[1]?a[1]:500,n=this._getBoundingBox(t,i),e.next=4,this._requestDataList(n.minLng,n.minLat,n.maxLng,n.maxLat);case 4:return e.abrupt("return",e.sent);case 5:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"_requestDataList",value:(i=w(D().mark((function e(t,i,n,a){var r,o,s,l,u;return D().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s="http://".concat(this.url,"/indoor/query/?minX=").concat(t,"&minY=").concat(i,"&maxX=").concat(n,"&maxY=").concat(a),e.next=3,y.get(s);case 3:if(0===(null==(l=e.sent)||null===(r=l.data)||void 0===r?void 0:r.status)){e.next=7;break}return console.error((null==l||null===(u=l.data)||void 0===u?void 0:u.message)||"获取室内数据失败"),e.abrupt("return",[]);case 7:return e.abrupt("return",null===(o=l.data)||void 0===o?void 0:o.indoor);case 8:case"end":return e.stop()}}),e,this)}))),function(e,t,n,a){return i.apply(this,arguments)})},{key:"_getBoundingBox",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:500,i=t/111e3,n=t/(111320*Math.cos(e.lat*Math.PI/180));return{minLat:e.lat-i,maxLat:e.lat+i,minLng:e.lng-n,maxLng:e.lng+n}}},{key:"openIndoor",value:function(e){console.log("params --\x3e ",e);var t=e.mpoi,i=void 0===t?"":t,n=e.floor,a=void 0===n?0:n,r=e.floorList,o=void 0===r?[]:r,s=e.buildingCenter,l=void 0===s?{}:s;this.mpoi=i,this.floor=a,this.floorList=o,this.buildingCenter=l,this.materialNeedsUpdate=!0}},{key:"closeIndoor",value:function(){this.mpoi="close",this.floor="",this.materialNeedsUpdate=!0}},{key:"convertFloorString",value:function(e){if(e.startsWith("B"))return-parseInt(e.substring(1),10);if(e.startsWith("F"))return parseInt(e.substring(1),10);throw new Error("Invalid floor string")}},{key:"convertFloorStringToArray",value:function(e){return e.split("|").map((function(e){if(e.startsWith("B"))return-parseInt(e.substring(1),10);if(e.startsWith("F"))return parseInt(e.substring(1),10);throw new Error("Invalid floor string")}))}},{key:"hideBuildings",value:function(e){if(Array.isArray(e)){if((e=Je(e)).sort((function(e,t){return e-t})),e.length===this.floorList.length)this.floor=999;else{var t=this.floorList.filter((function(t){return!e.includes(t)}));this.floor=t[t.length-1]}this.eventName="Hide",this.floorNum=e,this.animateNeedsUpdate=!0}else console.error("hideBuildings numbers必须为数组")}},{key:"showBuildings",value:function(e){Array.isArray(e)?((e=Je(e)).sort((function(e,t){return e-t})),this.eventName="Show",this.floorNum=e,this.floor=e[e.length-1],this.animateNeedsUpdate=!0):console.error("showBuildings numbers必须为数组")}},{key:"toJSON",value:function(){return{Url:this.url,Mpoi:this.mpoi,Floor:this.floor,LayeringHeight:this.layeringHeight,LayeringBaseHeight:this.layeringBaseHeight,BuildingCenter:this.buildingCenter,FloorNum:this.floorNum,FloorList:this.floorList,EventName:this.eventName,Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,messageNeedsUpdate:this.messageNeedsUpdate,animateNeedsUpdate:this.animateNeedsUpdate,type:this.type,uuid:this.uuid}}}]);var i,n}(),Ki=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};U(this,e),t=N(this,e,[i]);var n=["Video","Picture"],a=void 0===i.cityList?[]:i.cityList,r=void 0===i.event?"":i.event,o=void 0===i.folderName?"RenderResult":i.folderName,s=void 0===i.renderMode?"Video":i.renderMode,l=void 0===i.sceneBrightness?7:i.sceneBrightness,u=void 0===i.operateData?[]:i.operateData,c=void 0===i.brightness?0:i.brightness,d=void 0===i.renderFrame?60:i.renderFrame;return Object.defineProperties(t,{renderMode:{configurable:!0,enumerable:!0,get:function(){return s},set:function(e){e&&(s=n.includes(e)?e:"Video")}},renderFrame:{configurable:!0,enumerable:!0,get:function(){return d},set:function(e){e&&(d=e)}},sceneBrightness:{configurable:!0,enumerable:!0,get:function(){return l},set:function(e){e&&(l=e)}},operateData:{configurable:!0,enumerable:!0,get:function(){return u},set:function(e){e&&(u=e)}},brightness:{configurable:!0,enumerable:!0,get:function(){return c},set:function(e){void 0!==e&&(c=e)}},cityList:{configurable:!0,enumerable:!0,get:function(){return a},set:function(e){e&&(a=e)}},event:{configurable:!0,enumerable:!0,get:function(){return r},set:function(e){e&&(r=e,t.materialNeedsUpdate=!0)}},folderName:{configurable:!0,enumerable:!0,get:function(){return o},set:function(e){e&&(o=e)}}}),t}return z(e,vt),C(e,[{key:"changeRenderMode",value:function(e){this.renderMode=e}},{key:"changeRenderFrame",value:function(e){this.renderFrame=e,this.event="ChangeRenderFrame"}},{key:"changeCityColor",value:function(e){this.cityList=e,this.event="ColorChange"}},{key:"changeHeatmapCoefficient",value:function(e,t){this.cityList=e,this.operateData=[t],this.event="CoefficientChange"}},{key:"changeSceneBrightness",value:function(e){this.sceneBrightness=e,this.event="changeSceneBrightness"}},{key:"changeBrightness",value:function(e){this.brightness=e,this.event="changeBrightness"}},{key:"renderResult",value:function(e,t){this.folderName=t,this.cityList=e,this.event="Render"}},{key:"visAll",value:function(){this.operateData=[],this.event="VisAll"}},{key:"previewAll",value:function(){this.operateData=[],this.event="Preview"}},{key:"previewSingleCity",value:function(e,t){this.cityList=e;var i=this.cityList.map((function(e){return e.CityName})),n=i.indexOf(t);-1!==n?n!==i.length-1?(this.operateData=[t,i[n+1]],this.event="Preview"):console.warn("非法参数,最后一个城市不能预览"):console.warn("没有该城市数据")}},{key:"focusCity",value:function(e){this.operateData=[e],this.event="Focus"}},{key:"toJSON",value:function(){return(!(arguments.length>0&&void 0!==arguments[0])||arguments[0])&&this.visibleNeedsUpdate&&!this.materialNeedsUpdate?{matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,type:this.type,name:this.name,uuid:this.uuid}:{Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Brightness:this.brightness,SceneBrightness:this.sceneBrightness,Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},OperateData:this.operateData,FolderName:this.folderName,RenderFrame:this.renderFrame,RenderMode:this.renderMode,CityList:this.cityList,Opacity:this.opacity,Event:this.event,type:this.type,uuid:this.uuid,matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible}}},{key:"copy",value:function(t){var i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return F(e,"copy",this)([t,i]),this}}])}(),Xi=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return U(this,e),(t=N(this,e,[i])).roadGeoJsonUrl=i.roadGeoJsonUrl,t.roadConditionUrl=i.roadConditionUrl,t.type="EarthRoadCondition",t}return z(e,Ki),C(e,[{key:"toJSON",value:function(){return(!(arguments.length>0&&void 0!==arguments[0])||arguments[0])&&this.visibleNeedsUpdate&&!this.materialNeedsUpdate?{matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,type:this.type,name:this.name,uuid:this.uuid}:{Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},RoadConditionUrl:this.roadConditionUrl,RenderFrame:this.renderFrame,RenderMode:this.renderMode,RoadGeoJsonUrl:this.roadGeoJsonUrl,FolderName:this.folderName,CityList:this.cityList,Event:this.event,type:this.type,uuid:this.uuid,matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible}}},{key:"copy",value:function(t){var i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return F(e,"copy",this)([t,i]),this}}])}(),Qi=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return U(this,e),(t=N(this,e,[i])).type="EarthCityRank",t}return z(e,Ki),C(e,[{key:"changeRenderFrame",value:function(e){this.renderFrame=e,this.event="ChangeRenderFrame"}},{key:"changeCityColor",value:function(e){this.cityList=e,this.event="ColorChange"}},{key:"renderResult",value:function(e,t){this.folderName=t,this.cityList=e,this.event="Render"}},{key:"visAll",value:function(){this.operateData=[],this.event="VisAll"}},{key:"previewAll",value:function(){this.operateData=[],this.event="Preview"}},{key:"previewSingleCity",value:function(e,t){this.cityList=e;var i=this.cityList.map((function(e){return e.CityName})),n=i.indexOf(t);-1!==n?n!==i.length-1?(this.operateData=[t,i[n+1]],this.event="Preview"):console.warn("非法参数,最后一个城市不能预览"):console.warn("没有该城市数据")}},{key:"focusCity",value:function(e){this.operateData=[e],this.event="Focus"}},{key:"toJSON",value:function(){return(!(arguments.length>0&&void 0!==arguments[0])||arguments[0])&&this.visibleNeedsUpdate&&!this.materialNeedsUpdate?{matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,type:this.type,name:this.name,uuid:this.uuid}:{Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},OperateData:this.operateData,FolderName:this.folderName,RenderFrame:this.renderFrame,RenderMode:this.renderMode,CityList:this.cityList,Opacity:this.opacity,Event:this.event,type:this.type,uuid:this.uuid,matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible}}},{key:"copy",value:function(t){var i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return F(e,"copy",this)([t,i]),this}}])}(),Zi=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return U(this,e),(t=N(this,e,[i])).type="EarthCityHeatMap",t}return z(e,Ki),C(e,[{key:"toJSON",value:function(){return(!(arguments.length>0&&void 0!==arguments[0])||arguments[0])&&this.visibleNeedsUpdate&&!this.materialNeedsUpdate?{matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,type:this.type,name:this.name,uuid:this.uuid}:{Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Brightness:this.brightness,SceneBrightness:this.sceneBrightness,Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},OperateData:this.operateData,FolderName:this.folderName,RenderFrame:this.renderFrame,RenderMode:this.renderMode,CityList:this.cityList,Opacity:this.opacity,Event:this.event,type:this.type,uuid:this.uuid,matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible}}},{key:"copy",value:function(t){var i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return F(e,"copy",this)([t,i]),this}}])}(),$i=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};U(this,e),t=N(this,e,[i]);var n=void 0===i.roadList?[]:i.roadList,a=void 0===i.cityCompareList?[]:i.cityCompareList;return t.roadURL=i.roadURL,Object.defineProperties(t,{roadList:{configurable:!0,enumerable:!0,get:function(){return n},set:function(e){e&&(n=e)}},cityCompareList:{configurable:!0,enumerable:!0,get:function(){return a},set:function(e){e&&(a=e)}}}),t.type="EarthPersonLine",t}return z(e,Ki),C(e,[{key:"changeRenderFrame",value:function(e){this.renderFrame=e,this.event="ChangeRenderFrame"}},{key:"changeColor",value:function(e){this.color=e,this.event="ColorChange"}},{key:"renderResult",value:function(e){this.folderName=e,this.event="Render"}},{key:"previewAll",value:function(){this.event="Preview"}},{key:"toJSON",value:function(){return(!(arguments.length>0&&void 0!==arguments[0])||arguments[0])&&this.visibleNeedsUpdate&&!this.materialNeedsUpdate?{matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible,type:this.type,name:this.name,uuid:this.uuid}:{Position:{x:this.position.x,y:this.position.y,z:this.position.z},Scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z},Rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},Color:{r:this.color.r,g:this.color.g,b:this.color.b,a:this.opacity},Offset:{x:this.offset.x,y:this.offset.y,z:this.offset.z},RoadList:this.roadList,RoadURL:this.roadURL,CityCompareList:this.cityCompareList,FolderName:this.folderName,Texture:this.texture,RenderFrame:this.renderFrame,RenderMode:this.renderMode,Event:this.event,type:this.type,uuid:this.uuid,matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,visible:this.visible}}},{key:"copy",value:function(t){var i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return F(e,"copy",this)([t,i]),this}}])}(),en=function(){return C((function e(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};U(this,e),this.cloudRender=t,this.enable=void 0!==i.enable&&i.enable,this.workDistance=void 0===i.workDistance?50:i.workDistance,this.init()}),[{key:"changeEnable",value:function(e){this.enable=e,this.cloudRender.emitUIInteraction({excuteName:"Application_enableFadeMode",params:{Enable:this.enable}})}},{key:"changeWorkDistance",value:function(e){this.workDistance=e,this.cloudRender.emitUIInteraction({excuteName:"Application_enableFadeMode",params:{WorkDistance:this.workDistance}})}},{key:"init",value:function(){this.changeEnable(this.enable),this.changeWorkDistance(this.workDistance)}}])}(),tn=function(){return C((function e(t){U(this,e),this.cloudRender=t}),[{key:"switchLevel",value:function(e){""!==e&&void 0!==e||console.warn("LevelManage.switchLevel: levelName is required"),this.cloudRender.emitUIInteraction({excuteName:Z.OPEN_LEVEL,params:{LevelName:e}})}},{key:"restartLevel",value:function(){this.cloudRender.emitUIInteraction({excuteName:Z.RESTART_LEVEL}),this.cloudRender.dispatchEvent({type:"levelRecovered"})}},{key:"restartGame",value:function(){this.cloudRender.emitUIInteraction({excuteName:Z.RESTART_GAME}),this.cloudRender.dispatchEvent({type:"gameResarted"})}},{key:"exit",value:function(){this.cloudRender.emitUIInteraction({excuteName:Z.EXIT_CLIENT})}}])}(),nn=function(){function e(i){var n;if(U(this,e),e._instance)return L(n,e._instance);(n=N(this,e,[i])).type="RoadPile",n.url=i.url,n.header=i.header,n.body=i.body,n.messageNeedsUpdate=!1,n.childNeedsUpdate=!1;var a=Math.max(1,i.updateInterval||2),r=void 0===i.searchMode?"coord":i.searchMode,o=void 0===i.tileLevel?16:i.tileLevel,s=void 0===i.renderScale?1:i.renderScale;return n.maxUpdateHeight=void 0===i.maxUpdateHeight?1e3:i.maxUpdateHeight,n.materialNeedsUpdate=!1,n.matrixNeedsUpdate=!1,n.offset=new t,Object.defineProperties(n,{renderScale:{configurable:!0,enumerable:!0,get:function(){return s},set:function(e){e&&(s=Math.max(e,.1),n.messageNeedsUpdate=!0)}},updateInterval:{configurable:!0,enumerable:!0,get:function(){return a},set:function(e){e&&(a=Math.max(e,2),n.messageNeedsUpdate=!0)}},searchMode:{configurable:!0,enumerable:!0,get:function(){return r},set:function(e){e&&(r=e,n.messageNeedsUpdate=!0)}},tileLevel:{configurable:!0,enumerable:!0,get:function(){return o},set:function(e){e&&(o=e,n.messageNeedsUpdate=!0)}}}),e._instance=n,n}return z(e,je),C(e,[{key:"visible",get:function(){return this._visible},set:function(e){void 0===this._visible&&(this._visible=!0),e!==this._visible&&(this.visibleNeedsUpdate=!0,this._visible=e&&!0)}},{key:"body",get:function(){return this._body},set:function(e){this.messageNeedsUpdate=!0,this._body=e}},{key:"toJSON",value:function(){return{Url:this.url,Body:this.body,Header:this.header,SearchMode:this.searchMode,TileLevel:this.tileLevel,RenderScale:this.renderScale,matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,messageNeedsUpdate:this.messageNeedsUpdate,visible:this.visible,type:this.type,uuid:this.uuid,UpdateInterval:this.updateInterval}}}],[{key:"getInstance",value:function(t){return e._instance||(e._instance=new e(t)),e._instance}}])}();R(nn,"_instance",null);var an=function(){function e(t){var i;if(U(this,e),e._instance)return L(i,e._instance);(i=N(this,e,[t])).type="RoadDataManager",i.messageNeedsUpdate=!1,i.childNeedsUpdate=!1;var n=void 0===t.poiRenderScale?1:t.poiRenderScale,a=void 0===t.roadnameRenderScale?1:t.roadnameRenderScale,r=t.hiddenList||[];return i.materialNeedsUpdate=!1,i.matrixNeedsUpdate=!1,Object.defineProperties(i,{poiRenderScale:{configurable:!0,enumerable:!0,get:function(){return n},set:function(e){e&&(n=Math.max(e,.1),i.messageNeedsUpdate=!0)}},roadnameRenderScale:{configurable:!0,enumerable:!0,get:function(){return a},set:function(e){e&&(a=Math.max(e,.1),i.messageNeedsUpdate=!0)}},hiddenList:{configurable:!0,enumerable:!0,get:function(){return r},set:function(e){e&&(r=e,i.messageNeedsUpdate=!0)}}}),e._instance=i,i}return z(e,je),C(e,[{key:"visible",get:function(){return this._visible},set:function(e){void 0===this._visible&&(this._visible=!0),e!==this._visible&&(this.visibleNeedsUpdate=!0,this._visible=e&&!0)}},{key:"body",get:function(){return this._body},set:function(e){this.messageNeedsUpdate=!0,this._body=e}},{key:"toJSON",value:function(){return{PoiRenderScale:this.poiRenderScale,RoadnameRenderScale:this.roadnameRenderScale,matrixNeedsUpdate:this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,messageNeedsUpdate:this.messageNeedsUpdate,HiddenList:this.hiddenList,visible:this.visible,type:this.type,uuid:this.uuid}}}],[{key:"getInstance",value:function(t){return e._instance||(e._instance=new e(t)),e._instance}}])}();R(an,"_instance",null);var rn=function(){return C((function e(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};U(this,e),this.cloudRender=t,this.rayDetectionDistance=i.rayDetectionDistance||5e5,this.url=i.url||"",this.enableUI=void 0===i.enableUI||i.enableUI,i.onSelected&&this.cloudRender.addEventListener("L2Selected",i.onSelected),this.enable=i.enable,i.enable&&this.enablePickup()}),[{key:"enablePickup",value:function(){this.enable=!0,this.cloudRender.emitUIInteraction({excuteName:K.ENABLE_L2_BUILDING_SELECT,params:{Url:this.url,RayDetectionDistance:this.rayDetectionDistance,Enable:this.enable,EnableUI:this.enableUI}})}},{key:"disablePickup",value:function(){this.enable=!1,this.cloudRender.emitUIInteraction({excuteName:K.ENABLE_L2_BUILDING_SELECT,params:{Enable:this.enable}})}}])}(),on=function(){function e(){var i,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};U(this,e),(i=N(this,e,[n])).type="PersonlLine";var a=void 0===n.linePoints?[]:n.linePoints;if(a.length%3!=0)throw new Error("PersonLine: linePoints 的长度必须是 3 的倍数(每3个为一组[经度, 纬度, 高度])");var r=void 0===n.useSpeed||n.useSpeed,o=void 0===n.duration?5:n.duration,s=void 0===n.speed?10:n.speed,l=void 0===n.loopMode?0:n.loopMode,u=void 0===n.traceToGround||n.traceToGround,c=void 0===n.traceLength?20:n.traceLength,d=void 0!==n.startPaused&&Boolean(n.startPaused),h=d?0:1;return i.messageNeedsUpdate=!1,i.materialNeedsUpdate=!1,i.matrixNeedsUpdate=!1,i.animateNeedsUpdate=!1,i.offset=new t,Object.defineProperties(i,{linePoints:{configurable:!0,enumerable:!0,get:function(){return a}},useSpeed:{configurable:!0,enumerable:!0,get:function(){return r}},duration:{configurable:!0,enumerable:!0,get:function(){return o}},speed:{configurable:!0,enumerable:!0,get:function(){return s}},loopMode:{configurable:!0,enumerable:!0,get:function(){return l}},traceToGround:{configurable:!0,enumerable:!0,get:function(){return u}},traceLength:{configurable:!0,enumerable:!0,get:function(){return c}},startPaused:{configurable:!0,enumerable:!0,get:function(){return d}},state:{configurable:!0,enumerable:!0,get:function(){return h},set:function(e){void 0!==e&&e!==h&&(h=e,i.matrixNeedsUpdate=!0)}}}),"function"==typeof n.onNavigationStart&&i.addEventListener("navigationStart",n.onNavigationStart),"function"==typeof n.onNavigationFinish&&i.addEventListener("navigationFinish",n.onNavigationFinish),i}return z(e,je),C(e,[{key:"pause",value:function(){var e=this.state;this.state=0,0===e&&(this.matrixNeedsUpdate=!0)}},{key:"resume",value:function(){this.state=1}},{key:"visible",get:function(){return this._visible},set:function(e){void 0===this._visible&&(this._visible=!0),e!==this._visible&&(this.visibleNeedsUpdate=!0,this._visible=e&&!0)}},{key:"toJSON",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return{UseSpeed:this.useSpeed,Duration:this.duration,Speed:this.speed,LoopMode:this.loopMode,TraceToGround:this.traceToGround,TraceLength:this.traceLength,StartPaused:this.startPaused,state:this.state,matrixNeedsUpdate:!!e&&this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,animateNeedsUpdate:this.animateNeedsUpdate,visible:this.visible,type:this.type,uuid:this.uuid,LinePoints:this.linePoints}}},{key:"dispose",value:function(){}}])}();function sn(e){if(null!=e&&(!Array.isArray(e)||e.length%2!=0||e.length<6))throw new Error("WSTrafficLayer: area 必须是[经度, 纬度, ...]的一维数组,且至少包含 3 个点(长度为偶数且不少于 6)")}var ln=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};U(this,e),(t=N(this,e,[i])).type="WSTraffic",t.url=i.url,t.traceToGround=void 0===i.traceToGround||i.traceToGround,t.traceLength=void 0===i.traceLength?10:i.traceLength;var n=void 0===i.message?{}:i.message,a="";sn(i.area);var r=void 0===i.area?[]:i.area;return t.messageNeedsUpdate=!1,t.materialNeedsUpdate=!1,t.matrixNeedsUpdate=!1,t.animateNeedsUpdate=!1,Object.defineProperties(t,{message:{configurable:!0,enumerable:!0,get:function(){return n},set:function(e){e&&(n=e,t.messageNeedsUpdate=!0)}},area:{configurable:!0,enumerable:!0,get:function(){return r},set:function(e){void 0!==e&&(sn(e),r=e)}},connectState:{configurable:!0,enumerable:!0,get:function(){return a}},_setConnectState:{configurable:!1,enumerable:!1,value:function(e){a=e,t.matrixNeedsUpdate=!0}}}),t}return z(e,je),C(e,[{key:"visible",get:function(){return this._visible},set:function(e){void 0===this._visible&&(this._visible=!0),e!==this._visible&&(this.visibleNeedsUpdate=!0,this._visible=e&&!0)}},{key:"disconnect",value:function(){this._setConnectState("disconnect")}},{key:"reconnect",value:function(){this._setConnectState("reconnect")}},{key:"toJSON",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return{Url:this.url,Message:this.message,Area:this.area,ConnectState:this.connectState,TraceToGround:this.traceToGround,TraceLength:this.traceLength,matrixNeedsUpdate:!!e&&this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,animateNeedsUpdate:this.animateNeedsUpdate,messageNeedsUpdate:!!e&&this.messageNeedsUpdate,visible:this.visible,type:this.type,uuid:this.uuid}}},{key:"dispose",value:function(){this.message=null}}])}(),un=function(){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};U(this,e),(t=N(this,e,[i])).type="TJInfoLight";var n=i.url,a=void 0===i.scale?.4:i.scale,r=void 0===i.crossId?"":i.crossId,o="";return t.messageNeedsUpdate=!1,t.materialNeedsUpdate=!1,t.matrixNeedsUpdate=!1,t.animateNeedsUpdate=!1,Object.defineProperties(t,{url:{configurable:!0,enumerable:!0,get:function(){return n}},scale:{configurable:!0,enumerable:!0,get:function(){return a}},crossId:{configurable:!0,enumerable:!0,get:function(){return r},set:function(e){void 0!==e&&(r=e,t.messageNeedsUpdate=!0)}},connectState:{configurable:!0,enumerable:!0,get:function(){return o},set:function(e){void 0!==e&&(o=e,t.matrixNeedsUpdate=!0)}}}),t}return z(e,je),C(e,[{key:"visible",get:function(){return this._visible},set:function(e){void 0===this._visible&&(this._visible=!0),e!==this._visible&&(this.visibleNeedsUpdate=!0,this._visible=e&&!0)}},{key:"showCross",value:function(e){this.crossId=e}},{key:"disconnect",value:function(){this.connectState="disconnect"}},{key:"reconnect",value:function(){this.connectState="reconnect"}},{key:"toJSON",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t={Url:this.url,crossId:this.crossId,ConnectState:this.connectState,Scale:this.scale,matrixNeedsUpdate:!!e&&this.matrixNeedsUpdate,materialNeedsUpdate:this.materialNeedsUpdate,animateNeedsUpdate:this.animateNeedsUpdate,visible:this.visible,type:this.type,uuid:this.uuid};return e&&(t.messageNeedsUpdate=this.messageNeedsUpdate),t}},{key:"dispose",value:function(){}}])}();export{en as AdvancedFade,vi as AssetLayer,zi as AutonomousVehicleLayer,Kt as BasicLabel,Ui as Bucket,rn as BuildingPickup,Ri as CarPark,oi as Circle,Ft as CloudRenderEngine,Fi as ClusterPoint,pe as CommonConstant,Xt as Cone,mi as ConstructionLayer,St as Cube,ei as Cylinder,ti as Decal,Si as Diamond,ui as DiamondSign,wt as ExplodeControl,Qt as FlashCar,Zt as FlashCarCrash,$t as FlashPeople,ci as Heatmap,gi as I3DTileLayer,Jt as IconPoint,Yi as IndoorMap,Hi as InfoLightLayer,ki as Inundation,Nt as L3ModelControl,Ji as LargeRoadCondition,_i as LayerBuilding,tn as LevelManage,Vi as Light,bt as Line,Mi as MockCarStream,Ot as ModelSlice,Gt as ODLine,hi as Particle,on as PersonLine,ii as Plane,xt as Point,yt as Polygon,ni as QuadPyramid,Ii as QuadPyramidTop,yi as Radar,bi as Ripple,pi as RoadCondition,an as RoadDataManager,Ei as RoadName,nn as RoadPile,Gi as RoutePlan,Zi as SequencerEarthCityHeatmap,Qi as SequencerEarthCityRank,$i as SequencerEarthPersonLine,Xi as SequencerEarthRoadCondition,vt as Shape,Ut as SkeletonAnimControl,Ci as Skyline,Di as SlopeAnalysis,xi as Soil,ai as Sphere,un as TJInfoLightLayer,qt as TextPoint,Ht as TextUtils,si as Torus,ri as TrafficCone,fi as TrafficLayer,Oi as TrafficLightLayer,wi as TrafficShape,Ni as TriangleWarning,li as Tube,me as UltralDynamicSky,qi as VersionInfo,Ti as VisualField,ln as WSTrafficLayer,kt as WaterSimulation,Ai as WebViewPoint,st as convertCanvas2Base64,ht as drawCanvas,gt as drawTextToImage,ot as loadImageAsBase64};