@nnepoch/dtc-sdk 3.0.9 → 3.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/dtc-sdk-3.0.11.js +2 -0
- package/dist/cjs/index.cjs +2 -2
- package/dist/cjs/index.d.cts +131 -28
- package/dist/esm/index.d.ts +131 -28
- package/dist/esm/index.js +2 -2
- package/package.json +1 -1
- package/dist/browser/dtc-sdk-3.0.9.js +0 -2
package/dist/esm/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{EventEmitter as e,LogLevel as t,Logger as n}from"@epicgames-ps/lib-pixelstreamingcommon-ue5.6";import{z as r}from"zod";import i from"axios";import{Config as a,Flags as o,NumericParameters as s,OptionParameters as c,PixelStreaming as l}from"@epicgames-ps/lib-pixelstreamingfrontend-ue5.6";import{inflate as u}from"pako";var d=class extends Error{constructor(e,t,n){super(`Invalid payload for ${e}.${t}: ${n.map(e=>`${e.field}: ${e.reason}`).join(`; `)}`),this.moduleName=e,this.methodName=t,this.issues=n,this.name=`SDKValidationError`,this.code=`VALIDATION_ERROR`}toJSON(){return{name:this.name,code:this.code,message:this.message,module:this.moduleName,method:this.methodName,issues:this.issues}}};function f(e,t,n,r){let i=e.safeParse(t);if(i.success)return i.data;throw new d(n,r,i.error.issues.map(e=>({field:e.path.length>0?e.path.join(`.`):`<root>`,reason:e.message,code:e.code})))}function p(e){return e instanceof d?JSON.stringify(e.toJSON()):e instanceof Error?`${e.name}: ${e.message}`:String(e)}const ee={InitLogging(){},Debug(e){console.log(`[Debug] - ${e}`)},Info(e){console.log(`[Info] - ${e}`)},Warning(e){console.warn(`[Warning] - ${e}`)},Error(e){console.error(`[Error] - ${e}`)}},m={debug(){},info(){},warn(){},error(){}},te=[`silent`,`error`,`warn`,`info`,`debug`],h={silent:0,error:1,warn:2,info:3,debug:4};function ne(e){switch(e){case`silent`:return t.Disabled;case`error`:return t.Error;case`warn`:return t.Warning;case`info`:return t.Info;default:return t.Debug}}function re(e){n.InitLogging(ne(e),!1)}function g(e){return typeof e==`string`&&te.includes(e)}function _(e){if(e===void 0)return`info`;if(g(e))return e;let t=typeof e==`string`?e:JSON.stringify(e);throw Error(`Invalid logger level: ${t}. Expected one of: ${te.join(`, `)}.`)}function ie(e){if(e===void 0)return``;try{let t=JSON.stringify(e);return t?` ${t}`:``}catch{return` ${String(e)}`}}function ae(){let e=Error().stack;return e?e.replace(/^Error(?::\s*)?\n?/,``):`No Stack Available for this browser`}var oe=class{constructor(e,t,n,r,i,a){this.driver=e,this.prefix=t,this.level=n,this.moduleName=r,this.includeStack=i,this.reporter=a}formatMessage(e,t,n){let r=`${this.prefix} ${t}${ie(n)}`.trim();return this.shouldIncludeStack(e)?`${r}\nStack: ${ae()}`:r}shouldLog(e){return h[this.level]>=h[e]}shouldIncludeStack(e){return h[this.includeStack]>=h[e]}debug(e,t){this.shouldLog(`debug`)&&this.driver.Debug(this.formatMessage(`debug`,e,t))}info(e,t){this.shouldLog(`info`)&&this.driver.Info(this.formatMessage(`info`,e,t))}warn(e,t){this.reportWarnOrError(`warn`,e,t),this.shouldLog(`warn`)&&this.driver.Warning(this.formatMessage(`warn`,e,t))}error(e,t){this.reportWarnOrError(`error`,e,t),this.shouldLog(`error`)&&this.driver.Error(this.formatMessage(`error`,e,t))}reportWarnOrError(e,t,n){this.reporter?.recordLogSignal({level:e,moduleName:this.moduleName,message:t,meta:n})}},se=class{constructor(e,t=ee,n){this.level=_(e),this.driver=t,this.includeStack=n?.includeStack??`warn`,this.driver.InitLogging(ne(this.level),!1),this.reporter=n?.reporter??n?.qosMonitor}setReporter(e){this.reporter=e}child(e){return new oe(this.driver,`[DTCEngine:${e}]`,this.level,e,this.includeStack,this.reporter)}};const v={EngineIniting:`云渲染引擎初始化中...`,ServiceUrlInValid:`调度中心地址不正确,请检查中心地址!`,SerriceError:`调度中心连接失败,尝试重连中...`,SerriceUnAvaible:`没有服务资源,请检查服务是否启动!`,SerriceLoadingForWaiting:`服务资源启动中,请稍候!`,EngineWaiting:`云渲染服务坐席已满,当前排队人数:1人....`,EngineTockenChecking:`云引擎授权文件验证中...`,EngineTokenCheckFail:`云引擎授权许可无效,请联系管理员!`,EngineConnectioning:`云渲染引擎连接中...`,EngineConnectionSuccess:`云渲染引擎连接成功...`,EngineClose:`云渲染引擎连接断开,请检查服务状态!`,SourcePreparing:`资源准备中...`,TokenInValid:`许可未激活!`,TokenExpired:`许可授权已过期,实时渲染服务已停止!`,TokenWillExpired:`您的授权许可将于 YYYY-MM-DD 到期,请尽快续期!`};var ce=class{constructor(e){this.options=e,this.logger=e.logger??m}show(e,t,n=!0){if(console.log(`loading show`,e,t,n),this.options.emit({message:e,key:t,isFinish:!n}),!this.options.enabled)return;let r=this.getRoot();r&&(this.progressDiv||=this.createTipDiv(r,`engineProgressTips`),this.progressDiv.textContent=e,n||(this.clearAutoCloseTimer(),this.autoCloseTimer=setTimeout(()=>{this.removeProgressBar()},2e3)))}showTokenWillExpire(e,t=`TokenWillExpired`,n=!0){let r=this.formatTokenWillExpireMessage(e);if(this.options.emit({message:r,key:t,isFinish:!n}),!this.options.enabled)return;let i=this.getRoot();i&&(this.tokenWillExpireDiv||(this.tokenWillExpireDiv=this.createTipDiv(i,`TokenWillExpireTips`),this.tokenWillExpireDiv.style.top=`60px`),this.tokenWillExpireDiv.textContent=r)}dispose(){this.clearAutoCloseTimer(),this.removeProgressBar(),this.removeTokenWillExpireBar()}getRoot(){if(this.options.hostElement?.ownerDocument?.body)return this.options.hostElement.ownerDocument.body;if(typeof document<`u`&&document.body)return document.body;this.logger.debug(`skip loading progress ui render: document is unavailable`)}createTipDiv(e,t){let n=e.ownerDocument.createElement(`div`);return n.id=t,n.style.position=`fixed`,n.style.left=`50%`,n.style.top=`16px`,n.style.transform=`translateX(-50%)`,n.style.zIndex=`99999`,n.style.padding=`8px 14px`,n.style.borderRadius=`6px`,n.style.background=`rgba(0, 0, 0, 0.72)`,n.style.color=`#fff`,n.style.fontSize=`14px`,n.style.lineHeight=`1.4`,n.style.pointerEvents=`none`,n.style.maxWidth=`80vw`,n.style.textAlign=`center`,e.appendChild(n),n}removeProgressBar(){this.progressDiv&&=(this.progressDiv.remove(),void 0)}removeTokenWillExpireBar(){this.tokenWillExpireDiv&&=(this.tokenWillExpireDiv.remove(),void 0)}clearAutoCloseTimer(){this.autoCloseTimer&&=(clearTimeout(this.autoCloseTimer),void 0)}formatTokenWillExpireMessage(e){let t=e.trim();return t?t.includes(`到期`)?t:`您的授权许可将于 ${t}到期,请尽快续期!`:v.TokenWillExpired}};const le=`sdk3-agent-bridge/v1`;function ue(e){if(typeof WebSocket>`u`)throw Error(`WebSocket is not available in current runtime.`);return new WebSocket(e)}function de(e){return{ok:!0,data:e,ts:Date.now()}}function fe(e,t){return{ok:!1,error:{code:`PROTOCOL_ERROR`,message:e,details:t},ts:Date.now()}}function pe(e){if(typeof e==`string`)try{let t=JSON.parse(e);if(typeof t!=`object`||!t)return;let n=t;return n.protocolVersion!==`sdk3-agent-bridge/v1`||typeof n.type!=`string`||typeof n.callId!=`string`?void 0:n}catch{return}}var me=class{constructor(e,t,n={}){this.runtime=e,this.options=t,this.reconnectAttempt=0,this.running=!1,this.startedAt=0,this.beforeUnloadHandler=()=>{this.stop(`pagehide`)},this.socketFactory=n.socketFactory??ue}start(){this.socket||(this.running=!0,this.openSocket(),typeof window<`u`&&(window.addEventListener(`beforeunload`,this.beforeUnloadHandler),window.addEventListener(`pagehide`,this.beforeUnloadHandler)))}stop(e=`stop`){this.running=!1,this.clearReconnect(),typeof window<`u`&&(window.removeEventListener(`beforeunload`,this.beforeUnloadHandler),window.removeEventListener(`pagehide`,this.beforeUnloadHandler)),this.clearHeartbeat(),this.runtime.dispose?.();let t=this.socket;t&&(t.readyState===1&&this.sendUnregister(e),this.clearSocketHandlers(t),t.close(1e3,e),this.socket=void 0)}openSocket(){this.startedAt=Date.now();let e=this.socketFactory(this.options.serverUrl??`ws://127.0.0.1:8787/sdk3-bridge`);this.socket=e,e.onopen=()=>{this.reconnectAttempt=0,this.sendRegister(),this.startHeartbeat()},e.onmessage=e=>{this.handleMessage(e.data)},e.onclose=()=>{this.clearSocketHandlers(e),this.clearHeartbeat(),this.runtime.closeAllStreams?.(`Agent bridge WebSocket disconnected`),this.runtime.cancelAllPrograms?.(`Agent bridge WebSocket disconnected`),this.socket===e&&(this.socket=void 0),this.scheduleReconnect()},e.onerror=()=>{this.clearHeartbeat()}}scheduleReconnect(){if(!this.running||this.reconnectTimer!==void 0||this.options.reconnect===!1)return;let e=this.getReconnectDelay();this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=void 0,!(!this.running||this.socket)&&this.openSocket()},e),this.reconnectAttempt+=1}getReconnectDelay(){let e=typeof this.options.reconnect==`object`?this.options.reconnect:void 0,t=Math.max(0,e?.initialDelayMs??1e3),n=Math.max(t,e?.maxDelayMs??15e3),r=Math.max(0,e?.jitterMs??500);return Math.min(n,t*2**this.reconnectAttempt)+Math.floor(Math.random()*(r+1))}clearReconnect(){this.reconnectTimer!==void 0&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=void 0)}sendRegister(){let e={...this.runtime.getSnapshot(),heartbeatIntervalMs:this.getHeartbeatInterval(),capabilities:{catalog:!0,schema:!0,validateActions:!0,invoke:!0,stream:!0,businessPrograms:!0,businessProgramProtocolVersion:1}};this.send({type:`register`,protocolVersion:le,bridgeId:e.bridgeId,ts:Date.now(),payload:e})}sendUnregister(e){let t={...this.runtime.getSnapshot(),reason:e};this.send({type:`unregister`,protocolVersion:le,bridgeId:t.bridgeId,ts:Date.now(),payload:t})}sendHeartbeat(){let e={...this.runtime.getSnapshot(),heartbeatIntervalMs:this.getHeartbeatInterval(),uptimeMs:Math.max(0,Date.now()-this.startedAt)};this.send({type:`heartbeat`,protocolVersion:le,bridgeId:e.bridgeId,ts:Date.now(),payload:e})}getHeartbeatInterval(){return Math.max(1e3,this.options.heartbeatIntervalMs??5e3)}startHeartbeat(){this.clearHeartbeat(),this.heartbeatTimer=setInterval(()=>{this.sendHeartbeat()},this.getHeartbeatInterval())}clearHeartbeat(){this.heartbeatTimer!==void 0&&(clearInterval(this.heartbeatTimer),this.heartbeatTimer=void 0)}async handleMessage(e){let t=pe(e);if(t){if(t.type===`catalog`){let e=t.payload,n=e.kind===`modules`?de(this.runtime.listModules()):this.runtime.listMethods(e.moduleName??``);this.sendResult(t,`catalog`,n);return}if(t.type===`schema`){let e=t.payload;this.sendResult(t,`schema`,this.runtime.getMethodSchema(e.moduleName,e.methodName));return}if(t.type===`validate-actions`){this.sendResult(t,`validate-actions`,this.runtime.validateActions(t.payload));return}if(t.type===`invoke`){this.sendResult(t,`invoke`,await this.runtime.invoke(t.payload));return}if(t.type===`stream-start`){let e=t.payload,n=await this.runtime.startStream(e,e=>{this.sendStreamEvent(e)});this.sendResult(t,`stream-start`,n);return}if(t.type===`stream-close`){this.sendResult(t,`stream-close`,await this.runtime.closeStream(t.payload));return}if(t.type===`load-program`){this.sendResult(t,`load-program`,await this.runtime.loadProgram(t.payload));return}if(t.type===`start-program`){this.sendResult(t,`start-program`,await this.runtime.startProgram(t.payload,e=>{this.sendProgramEvent(e)}));return}if(t.type===`cancel-program`){this.sendResult(t,`cancel-program`,await this.runtime.cancelProgram(t.payload));return}this.sendResult(t,`catalog`,fe(`Unsupported message type "${t.type}".`))}}sendStreamEvent(e){this.send({type:`stream-event`,protocolVersion:le,bridgeId:this.runtime.getSnapshot().bridgeId,ts:Date.now(),payload:e})}sendProgramEvent(e){this.send({type:`program-event`,protocolVersion:le,bridgeId:this.runtime.getSnapshot().bridgeId,traceId:e.traceId,ts:Date.now(),payload:e})}sendResult(e,t,n){let r={requestType:t,result:n,traceId:e.traceId};this.send({type:`result`,protocolVersion:le,bridgeId:this.runtime.getSnapshot().bridgeId,callId:e.callId,traceId:e.traceId,ts:Date.now(),payload:r})}send(e){!this.socket||this.socket.readyState!==1||this.socket.send(JSON.stringify(e))}clearSocketHandlers(e){e.onopen=null,e.onmessage=null,e.onclose=null,e.onerror=null}};function he(e,t){return t&&e.then(e=>{t(e)}).catch(e=>{t(e)}),e}var y=class{constructor(e,t,n){this.bridge=e,this.moduleName=t,this.logger=n?.logger??m}request(e,t,n,r){return he(Promise.resolve().then(()=>{let n=r?f(r,t,this.moduleName,e):t;return r||this.logger.debug(`validation schema not configured`,{method:e}),this.logger.debug(`sending request`,{method:e}),this.bridge.sendRequest(this.moduleName,e,n)}).then(t=>(this.logger.info(`request success`,{method:e,code:t.code}),t)).catch(t=>{throw this.logger.warn(`request failed`,{method:e,error:p(t)}),t}),n)}requestStream(e,t,n,r){try{if(!this.bridge.sendStreamRequest)throw Error(`Current bridge does not support stream request`);let i=r?f(r,t,this.moduleName,e):t;return r||this.logger.debug(`validation schema not configured`,{method:e}),this.logger.debug(`sending stream request`,{method:e}),this.bridge.sendStreamRequest(this.moduleName,e,i,n)}catch(t){let r=t instanceof Error?t:Error(String(t));if(this.logger.warn(`stream request failed before send`,{method:e,error:p(r)}),n)try{n({type:`error`,requestId:``,error:r})}catch(t){this.logger.warn(`stream error callback failed`,{method:e,error:p(t)})}let i=Promise.reject(r);return Object.defineProperty(i,"requestId",{value:``,enumerable:!0}),i.cancel=()=>{},i}}},ge=class e{constructor(e=0,t=0){this.x=e,this.y=t}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}clone(){return new e(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e,t){return t==null?(this.x+=e.x,this.y+=e.y,this):this.addVectors(e,t)}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e,t){return t==null?(this.x-=e.x,this.y-=e.y,this):this.subVectors(e,t)}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}angle(){let e=Math.atan2(this.y,this.x);return e<0&&(e+=2*Math.PI),e}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,n=this.y-e.y;return t*t+n*n}equals(e){return e.x==this.x&&e.y==this.y}toString(){return JSON.stringify(this)}};function _e(e,t){let n=e*20037508.34/180,r=Math.log(Math.tan((90+t)*Math.PI/360))/(Math.PI/180);return r=r*20037508.34/180,{x:n,y:r}}function ve(e,t){let n=e/20037508.34*180,r=t/20037508.34*180;return r=180/Math.PI*(2*Math.atan(Math.exp(r*Math.PI/180))-Math.PI/2),{x:n,y:r}}const b={EPSGType:{EPSG84:`4326`,EPSGWeb:`3857`,EPSGWorld:`0000`}};var x=class e{constructor(e=0,t=0,n=0,r=b.EPSGType.EPSG84){typeof e!=`number`&&(e=this.parseFloatDeal(e)),typeof t!=`number`&&(t=this.parseFloatDeal(t)),typeof n!=`number`&&(n=this.parseFloatDeal(n)),e!=e&&(e=0),t!=t&&(t=0),n!=n&&(n=0),this.x=e,this.y=t,this.z=n,this.ePSGType=r}parseFloatDeal(e){try{return parseFloat(e)}catch(e){return console.log(e),0}}set(e,t,n){return typeof e!=`number`&&(e=0),typeof t!=`number`&&(t=0),typeof n!=`number`&&(n=0),e!=e&&(e=0),t!=t&&(t=0),n!=n&&(n=0),this.x=e,this.y=t,this.z=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}clone(){return new e(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e,t){return t==null?(this.x+=e.x,this.y+=e.y,this.z+=e.z,this):this.addVectors(e,t)}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e,t){return t==null?(this.x-=e.x,this.y-=e.y,this.z-=e.z,this):this.subVectors(e,t)}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e,t){return t==null?(this.x*=e.x,this.y*=e.y,this.z*=e.z,this):this.multiplyVectors(e,t)}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(t,n){let r=new e,i=new e;return r.set(t,t,t),i.set(n,n,n),this.clamp(r,i)}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,n){return this.subVectors(t,e).multiplyScalar(n).add(e)}cross(e,t){return t==null?this.crossVectors(this,e):this.crossVectors(e,t)}crossVectors(e,t){let n=e.x,r=e.y,i=e.z,a=t.x,o=t.y,s=t.z;return this.x=r*s-i*o,this.y=i*a-n*s,this.z=n*o-r*a,this}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,n=this.y-e.y,r=this.z-e.z;return t*t+n*n+r*r}equals(e){return e.x==this.x&&e.y==this.y&&e.z==this.z}toString(){return JSON.stringify(this)}changeEPSGType(e){if(this.ePSGType!=e){if(e==b.EPSGType.EPSG84){let e=ve(this.x,this.y);this.x=e.x,this.y=e.y}else if(e==b.EPSGType.EPSGWeb){let e=_e(this.x,this.y);this.x=e.x,this.y=e.y}else console.log(`暂不支持[${this.ePSGType}]转换为${e}`);return this.ePSGType=e,this}}};const S={Off:0,Auto:1,DLAA:2,UltraQuality:3,Quality:4,Balanced:5,Performance:6,UltraPerformance:7},C={Auto:`auto`,Low:`low`,High:`high`,Super:`super`,Blue:`blue`},ye=[{label:`自动`,type:C.Auto,value:12e6},{label:`标清`,type:C.Low,value:4e6},{label:`高清`,type:C.High,value:8e6},{label:`超清`,type:C.Super,value:12e6},{label:`蓝光`,type:C.Blue,value:24e6}],be={[C.Auto]:12e6,[C.Low]:4e6,[C.High]:8e6,[C.Super]:12e6,[C.Blue]:24e6};let xe=function(e){return e.VP8=`VP8`,e.VP9=`VP9`,e.AV1=`AV1`,e.H264=`H264`,e}({}),Se=function(e){return e.Model=`MODEL`,e.POI=`POI`,e}({});const Ce={Spring:0,Summer:1,Autumn:2,Winter:3};let we=function(e){return e[e.Linear=0]=`Linear`,e[e.EaseInQuad=1]=`EaseInQuad`,e[e.EaseOutQuad=2]=`EaseOutQuad`,e[e.EaseInOutQuad=3]=`EaseInOutQuad`,e[e.EaseOutInQuad=4]=`EaseOutInQuad`,e[e.EaseInCubic=5]=`EaseInCubic`,e[e.EaseOutCubic=6]=`EaseOutCubic`,e[e.EaseInOutCubic=7]=`EaseInOutCubic`,e[e.EaseOutInCubic=8]=`EaseOutInCubic`,e[e.EaseInQuart=9]=`EaseInQuart`,e[e.EaseOutQuart=10]=`EaseOutQuart`,e[e.EaseInOutQuart=11]=`EaseInOutQuart`,e[e.EaseOutInQuart=12]=`EaseOutInQuart`,e[e.EaseInQuint=13]=`EaseInQuint`,e[e.EaseOutQuint=14]=`EaseOutQuint`,e[e.EaseInOutQuint=15]=`EaseInOutQuint`,e[e.EaseOutInQuint=16]=`EaseOutInQuint`,e[e.EaseInSine=17]=`EaseInSine`,e[e.EaseOutSine=18]=`EaseOutSine`,e[e.EaseInOutSine=19]=`EaseInOutSine`,e[e.EaseOutInSine=20]=`EaseOutInSine`,e[e.EaseInExpo=21]=`EaseInExpo`,e[e.EaseOutExpo=22]=`EaseOutExpo`,e[e.EaseInOutExpo=23]=`EaseInOutExpo`,e[e.EaseOutInExpo=24]=`EaseOutInExpo`,e[e.EaseInCirc=25]=`EaseInCirc`,e[e.EaseOutCirc=26]=`EaseOutCirc`,e[e.EaseInOutCirc=27]=`EaseInOutCirc`,e[e.EaseOutInCirc=28]=`EaseOutInCirc`,e[e.EaseInElastic=29]=`EaseInElastic`,e[e.EaseOutElastic=30]=`EaseOutElastic`,e[e.EaseInOutElastic=31]=`EaseInOutElastic`,e[e.EaseOutInElastic=32]=`EaseOutInElastic`,e[e.EaseInBack=33]=`EaseInBack`,e[e.EaseOutBack=34]=`EaseOutBack`,e[e.EaseInOutBack=35]=`EaseInOutBack`,e[e.EaseOutInBack=36]=`EaseOutInBack`,e[e.EaseInBounce=37]=`EaseInBounce`,e[e.EaseOutBounce=38]=`EaseOutBounce`,e[e.EaseInOutBounce=39]=`EaseInOutBounce`,e[e.EaseOutInBounce=40]=`EaseOutInBounce`,e}({}),Te=function(e){return e[e.Loose=0]=`Loose`,e[e.Strict=1]=`Strict`,e}({}),Ee=function(e){return e.StopAtTheEnd=`StopAtTheEnd`,e.Loop=`Loop`,e.BackAndForward=`BackAndForward`,e}({});const w=r.string().min(1),T=w.optional(),E=r.number().finite(),D=E.optional(),O=r.instanceof(x),De=r.object({x:E,y:E,z:E,ePSGType:w}),Oe=r.union([r.instanceof(ge),r.object({x:E,y:E})]),k=r.union([O,De]),ke=O.optional(),Ae=k.optional(),je=r.union([r.literal(Ce.Spring).describe(`春季`),r.literal(Ce.Summer).describe(`夏季`),r.literal(Ce.Autumn).describe(`秋季`),r.literal(Ce.Winter).describe(`冬季`)]).describe(`场景季节`),Me=r.union([r.literal(S.Off).describe(`关闭 DLSS`),r.literal(S.Auto).describe(`自动质量档位`),r.literal(S.DLAA).describe(`DLAA 2倍效果`),r.literal(S.UltraQuality).describe(`超高质量`),r.literal(S.Quality).describe(`高质量`),r.literal(S.Balanced).describe(`平衡`),r.literal(S.Performance).describe(`性能`),r.literal(S.UltraPerformance).describe(`超高性能`)]).describe(`DLSS 质量档位`),Ne=r.union([r.literal(C.Auto).describe(`自动`),r.literal(C.Low).describe(`标清`),r.literal(C.High).describe(`高清`),r.literal(C.Super).describe(`超清`),r.literal(C.Blue).describe(`蓝光`)]).describe(`渲染码率档位`),Pe=r.union([r.literal(`VP8`).describe(`VP8`),r.literal(`VP9`).describe(`VP9`),r.literal(`AV1`).describe(`AV1`),r.literal(`H264`).describe(`H264`)]).describe(`视频解码器类别`),Fe=r.union([r.literal(`MODEL`).describe(`模型图层`),r.literal(`POI`).describe(`POI 图层`)]).describe(`图层类别`),Ie=r.union([w,r.array(w).min(1)]),A=r.undefined().optional(),Le=r.object({ids:r.array(w).min(1)}),Re=r.object({codes:r.array(w).min(1)}),j={show:Le,hide:Le,showByCode:Re,hideByCode:Re,showByGroup:Le,hideByGroup:Le,showAll:A,hideAll:A},ze=r.object({parentId:r.string().optional(),id:T}),Be=e=>e.refine(e=>!!(e.id||e.timelineId),{message:`id or timelineId is required`}),Ve={connect:A,disconnect:A,reconnect:A,KickOtherConnect:A,KeepConnect:A,GetEngineServiceStatus:A},M={lookAt:r.object({parentId:r.string().optional(),id:Ie,offSet:Ae,positionOffSetDistance:D,offSetX:D,distance:D,time:D,isRotate:r.boolean().optional(),isHighlight:r.boolean().optional(),showBack:r.boolean().optional()}),lookAtArray:r.object({parentId:T,ids:r.array(w).min(1),offSet:Ae,offSetX:D,distance:D,time:D,isRotate:r.boolean().optional(),isHighlight:r.boolean().optional()}),flyToTarget:r.object({point:Ae,target:Ae,fov:r.number().finite().min(10).max(150).optional(),time:D}),flyByPath:r.object({points:r.union([r.array(O),r.string()]).optional(),lookAts:r.union([r.array(O),r.string()]).optional(),nodes:r.string().optional(),time:D,smoothMode:r.union([r.literal(0),r.literal(1)]).optional()}),setFlySpeed:r.object({speed:E}),endFly:A,pauseFly:A,resumeFly:A,getCameraInfo:A,setCameraPositionAndRotation:r.object({point:O,rotation:O}),setCameraFov:r.object({fov:E}),startCameraObjFollow:r.object({parentId:r.string().optional(),id:w,offSet:k,smooth:E.optional().default(.85).refine(e=>e>=0&&e<=1,{message:`smooth must be in [0, 1]`,path:[`smooth`]})}),endCameraObjFollow:A,resetCameraFov:A,reset:A},He={getAllSceneName:A,switchSceneByName:r.object({sceneName:w}),getCurrentSceneName:A,listenMapCompass:r.object({enable:r.boolean()}),setFeatureToggle:r.object({key:w,enabled:r.boolean()}),getSceneMeta:A},Ue={setVisible:r.object({parentId:r.string().optional().default(``),id:Ie,visible:r.boolean().optional()}),setVisibleResolved:r.object({parentId:r.string().optional(),ids:r.array(w).min(1),visible:r.boolean()}),setVisibleByTags:r.object({tags:Ie,visible:r.boolean()}),setVisibleByAttibute:r.object({attributes:r.record(r.string(),r.any()),filterMode:r.nativeEnum(Te).optional().default(0),visible:r.boolean().optional().default(!0),otherVisible:r.boolean().optional().default(!1)}),add:r.object({parentId:r.string().optional().default(``),id:w,assetsPath:T,position:ke,angle:ke,scale:ke,description:r.string().optional()}),remove:r.object({parentId:r.string().optional().default(``),ids:r.array(w).min(1)}),getElementTree:r.object({parentId:r.string().optional().default(``),id:w}),getModelInfo:r.object({parentId:r.string().optional().default(``),id:w}),getModelBoundsInfo:r.object({parentId:r.string().optional().default(``),id:Ie}),getModelBoundsInfoResolved:r.object({parentId:r.string().optional(),ids:r.array(w).min(1)})},N=r.object({parentId:r.string().optional(),id:w}),We=r.object({parentId:r.string().optional(),ids:r.array(w).min(1)}),Ge=N.extend({rotate:O}),P={startMoveByNodes:N.extend({nodes:r.array(k).min(1),speed:E.optional().default(1),linear:E.optional().default(1),isLookAtTarget:r.boolean().optional().default(!1),needDirection:r.boolean().optional().default(!0)}),pauseMove:N,resumeMove:N,endMove:N,restoreMove:We,rotate:Ge,endRotate:N,continuedRotate:Ge,rotateByTarget:N.extend({parentTargetId:T,targetID:w,point:O,axisX:E.optional().default(0),axisY:E.optional().default(0),axisZ:E.optional().default(0),angle:E.optional().default(0),isPersistence:r.boolean().optional().default(!1)}),restoreRotate:We,setScale:N.extend({scale:O,duration:E.optional().default(.5)}),endScale:N,restoreScale:We},Ke={enable:r.object({enable:r.boolean()}),setHighLightModel:r.object({parentId:r.string().optional().default(``),ids:r.array(w).min(1),showBack:r.boolean()}),removeHighLightModel:r.object({parentId:r.string().optional(),ids:r.array(w).min(1)}),clear:r.object({})},qe=r.object({parentId:T,id:T}),Je=e=>e.refine(e=>!!(e.id||e.parentId),{message:`id or parentId is required`}),F={addLayer:Je(qe.extend({layerName:r.string().optional(),show:r.boolean().optional(),poiEnabled:r.boolean().optional(),type:Fe.optional(),description:r.string().optional()})),addLayerResolved:r.object({parentId:r.string().optional(),id:w,layerName:r.string().optional(),show:r.boolean().optional().default(!0),poiEnabled:r.boolean().optional().default(!0),description:r.string().optional().default(``),isSystem:r.boolean().optional().default(!1),poiOffsetY:r.number().optional().default(0)}),layerSelector:Je(qe),removeLayer:Je(qe),isLayerOrGroupExit:Je(qe),layerSelectorResolved:r.object({parentId:r.string().optional().default(``),id:w}),switchModelLayer:r.object({parentId:w,ids:r.array(w).min(1),toParentId:w}),showUIPop:r.object({parentId:r.string().optional(),id:w,visible:r.boolean().optional().default(!0),assetsPath:r.string().optional().default(``),offSet:k,scale:k}),addModel:r.object({parentId:w,id:w,assetsPath:T,position:k,name:r.string().optional().default(``),rotation:k,scale:k,description:r.string().optional(),isSystem:r.boolean().optional(),tags:r.array(r.string()).optional(),extraProps:r.any().optional()}),addPOI:r.object({parentId:r.string().optional(),id:w,assetsPath:w,position:k,targetParentId:r.string().optional(),targetId:r.string().optional(),rotation:k,scale:k,offSet:k,description:r.string().optional(),isSystem:r.boolean().optional(),text:r.string(),fontSize:r.number().optional(),tags:r.array(r.string()).optional(),extraProps:r.any().optional()}),removeModel:r.object({parentId:w,ids:r.array(w).min(1)}),getLayerChildElement:r.object({parentId:r.string().optional().default(``),id:w})},I={closeCameraFog:A,getWeatherTypes:A,resetWeather:A,resetWeatherAndTime:A,openCameraFog:r.object({fogIntensity:D,fogStartColor:r.string().optional(),fogEndColor:r.string().optional(),fogStartDistance:D,fogEndDistance:D,directionalIntensity:D,directionalFallOff:D,directionalColor:r.string().optional()}).refine(e=>e.fogIntensity===void 0||e.fogIntensity>=0&&e.fogIntensity<=1,{message:`fogIntensity must be between 0 and 1`,path:[`fogIntensity`]}),setSceneTime:r.object({hour:E,timeDuration:D}).refine(e=>e.hour>=0&&e.hour<24,{message:`hour must be in [0, 24)`,path:[`hour`]}),changeWeatherType:r.object({type:E,timeDuration:D}),setAnimateTimeOfDay:r.object({isAnimate:r.boolean(),dayLength:D,nightLength:D}),changeSeason:r.object({season:je,duration:D.describe(`切换过渡时长,单位秒`)}),resetSeason:r.object({}),setTimeSync:r.object({syncSystemTime:r.boolean()}),resetSceneTime:r.object({}),setDayAndNight:r.object({dayType:w})},L={add:r.object({groupName:w,poiInfos:r.array(r.record(r.unknown())).min(1)}),deleteById:r.object({groupName:w,id:w}),deleteByGroup:r.object({groupName:w}),update:r.object({groupName:w,poiInfos:r.array(r.record(r.unknown())).min(1)}),updatePopStates:r.object({groupName:w,popStates:r.array(r.record(r.unknown())).min(1)}),enableOverlap:r.object({enable:r.boolean()}),showDistance:r.object({distance:E})},Ye={add:r.object({id:w,groupName:w,assetPath:w,targetParentId:T,targetId:T,visible:r.boolean().optional()}),deleteById:r.object({groupName:w,ids:r.array(w).min(1)}),deleteByGroup:r.object({groupName:w}),getPOIInfo:r.object({groupName:w,id:w}),update:r.object({id:w,groupName:w,assetPath:T,targetParentId:T,targetId:T,visible:r.boolean().optional()}),setVisibleByGroup:r.object({groupName:w,visible:r.boolean()})},Xe=r.array(r.object({groupName:w,id:w,parentId:r.string().optional().default(``),position:ke})),Ze={addPop:Xe,removePop:Xe,removeAll:Xe,show:Xe,showAll:Xe,setPopDelayFrame:r.object({time:E}),setPopShowDistance:r.object({distance:E})},Qe={startLoopAnimation:r.object({parentId:T,id:w,stateName:w,loopStartTime:D,loopEndTime:D,speed:D}).refine(e=>e.loopStartTime===void 0||e.loopStartTime>=0&&(e.loopEndTime===void 0||e.loopEndTime>e.loopStartTime),{message:`loopStartTime must be >= 0 and loopEndTime must be greater than loopStartTime`,path:[`loopStartTime`]}),stopLoopAnimation:r.object({parentId:T,id:w}),playAnimator:r.object({parentId:T,id:w,stateName:w,speed:D,startTime:D,endTime:D,isStop:r.boolean().optional()}),setAnimatorSpeed:r.object({parentId:T,id:w,speed:E}),getAnimationLength:r.object({parentId:T,id:w,stateName:w}),stopAnimator:r.object({parentId:T,id:w})},$e={play:Be(ze.extend({initialTime:D,speed:D,keepLastFrame:r.boolean().optional()}).refine(e=>e.speed===void 0||e.speed<0||e.speed>=.1,{message:`speed must be negative or >= 0.1`,path:[`speed`]})),pause:Be(ze),resume:Be(ze),stop:Be(ze.extend({resetTime:D,isCameraToStart:r.boolean().optional()})),stopAll:r.object({}).optional(),setSpeed:Be(ze.extend({speed:E}).refine(e=>e.speed<0||e.speed>=.1,{message:`speed must be negative or >= 0.1`,path:[`speed`]}))},et={setSceneRenderBitrate:r.object({bitrate:Ne.optional()}),setSceneRenderBitrateResolved:r.object({bitrate:E}).refine(e=>e.bitrate>=1e6,{message:`bitrate must be >= 1000000`,path:[`bitrate`]}),setSceneFPS:r.object({fps:E}).refine(e=>e.fps>=1&&e.fps<=300,{message:`fps must be in [1, 300]`,path:[`fps`]}),setVideoDecode:r.object({decode:Pe}),setScreenResolution:r.object({width:E,height:E}).refine(e=>e.width>0&&e.height>0,{message:`width and height must be > 0`,path:[`width`]})},tt={setDlssEnable:r.object({enable:r.boolean(),quality:Me}),setDlss:r.object({enable:r.boolean(),quality:Me}),setDlssQuality:r.object({quality:Me})},nt=r.object({node:k,time:r.string()}),rt=r.object({parentId:r.string().optional().default(``),id:w}),R={add:r.object({parentId:r.string().optional().default(``),id:w,assetPath:r.string().optional().default(``),scale:k,showPath:r.boolean().optional().default(!0),passedColor:r.string().optional().default(`#ffffff`),lineColor:r.string().optional().default(`#00ff00`),lineWidth:E,duration:D,nodes:r.array(k).optional(),timeNodes:r.array(nt).optional(),lineLayer:T,afterRender:r.boolean().optional().default(!1),isAutoClear:r.boolean().optional().default(!0)}),update:r.object({parentId:r.string().optional().default(``),id:w,lineColor:r.string().optional(),lineWidth:D,passedColor:r.string().optional(),speed:D}).refine(e=>e.speed===void 0||e.speed>=0,{message:`speed must be >= 0`,path:[`speed`]}),setTimeNode:r.object({parentId:r.string().optional().default(``),id:w,timeStart:r.string().optional(),startNodeIndex:r.string().optional()}).refine(e=>e.timeStart!==void 0||e.startNodeIndex!==void 0,{message:`timeStart or startNodeIndex is required`,path:[`timeStart`]}).refine(e=>e.startNodeIndex===void 0||parseInt(e.startNodeIndex)>=0,{message:`startNodeIndex must be >= 0`,path:[`startNodeIndex`]}),node:rt,pause:rt,resume:rt,stop:rt,clear:r.object({}).optional()},it=r.object({position:k,value:E.min(0).max(999).optional().default(1)}),at={create:r.object({parentId:r.string().optional().default(``),id:r.string().optional(),textureSize:Oe.optional().default({x:256,y:256}),mapSize:Oe.optional().default({x:1e3,y:1e3}),influenceSize:r.number().int().positive().optional().default(13),points:r.union([r.array(it).min(1),r.array(k).min(1)]),opacity:r.number().min(0).max(1).optional().default(.7),heightScale:r.number().positive().optional().default(3.5),lerpScale:r.number().positive().optional().default(2.5),isAddAsset:r.boolean().optional().default(!1)}),remove:r.object({parentId:r.string().optional().default(``),id:r.string().optional()}),clear:A,setConfig:r.object({parentId:r.string().optional().default(``),id:r.string().optional(),opacity:r.number().min(0).max(1).optional().default(.7),heightScale:r.number().positive().optional().default(3.5),lerpScale:r.number().positive().optional().default(2.5),influenceSize:r.number().int().positive().optional().default(13)})},ot={updateWebView:r.object({parentId:r.string().optional().default(``),id:w,url:w})},st=r.object({parentId:r.string().optional().default(``),id:r.string()}),ct=e=>e.refine(e=>{let t=e;return t.nodes!==void 0||t.targetIds!==void 0||t.targetCodes!==void 0},{message:`nodes or targetIds or targetCodes is required`,path:[`nodes`,`targetIds`,`targetCodes`]}),lt=r.object({parentId:r.string().optional().default(``),id:r.string(),nodes:r.array(k).optional(),targetIds:r.array(w).optional(),targetCodes:r.array(w).optional(),speed:r.number().positive().optional().default(2),isCache:r.boolean().optional().default(!0),planColor:r.string().optional(),passColor:r.string().optional(),lineWidth:r.number().positive().optional().default(3),isAutoPlay:r.boolean().optional().default(!0),assetPath:r.string().optional(),isAutoClear:r.boolean().optional().default(!0),offSetZ:r.number().optional().default(.5),scale:O.default(new x(1,1,1))}),z={startNav:ct(lt),getMeshNavDistance:ct(lt.extend({isCache:r.boolean().optional().default(!1),isAutoPlay:r.boolean().optional().default(!1)})),pauseNav:st,resumeNav:st,stopNav:st,updateNav:r.object({parentId:r.string().optional().default(``),id:r.string(),speed:r.number().finite().optional().default(-1),planColor:r.string().optional(),passColor:r.string().optional()}),updateSpeed:r.object({parentId:r.string().optional().default(``),id:r.string(),speed:r.number().finite().optional().default(-1),planColor:r.string().optional(),passColor:r.string().optional()}),startNavByPath:r.object({parentId:r.string().optional().default(``),id:r.array(w).min(1),nodes:r.array(k).min(1),isCache:r.boolean().optional().default(!0),duration:r.number().positive().optional().default(10),planColor:r.string().optional(),passColor:r.string().optional()}),pauseNavPath:st,resumeNavPath:st,stopNavPath:st,updateNavPath:r.object({parentId:r.string().optional().default(``),id:r.array(w).min(1),duration:r.number().finite().optional().default(-1),planColor:r.string().optional(),passColor:r.string().optional()})},ut=r.array(w).min(1).describe(`查询的图层组编号集合`),dt={layerQueryByModel:r.object({parentId:r.string().optional(),id:r.string().optional(),queryRadius:r.number().positive().optional().default(50),queryMinHeight:r.number().optional().default(0),queryMaxHeight:r.number().optional().default(20),queryParentIds:ut}),layerQueryByPosition:r.object({queryPosition:k.optional(),queryRadius:r.number().positive().optional().default(50),queryMinHeight:r.number().optional().default(0),queryMaxHeight:r.number().optional().default(20),queryParentIds:ut}),layerQueryByModelBox:r.object({parentId:r.string().optional(),id:r.string().optional(),queryParentIds:ut})},ft={startTrain:r.object({parentId:r.string().optional(),id:w,trainCode:r.string().optional(),startStationName:r.string().optional(),endStationName:r.string().optional(),direction:r.string().optional(),action:r.string().optional(),stopTime:D,moveType:r.nativeEnum(Ee).optional()}),setTrainBehavior:r.object({parentId:r.string().optional(),id:w,moveType:r.nativeEnum(Ee).optional()}),setCameraFollowTrain:r.object({parentId:r.string().optional(),id:w,offSet:Ae}),setTrainVolume:r.object({parentId:r.string().optional(),id:w,volumeOn:r.boolean().optional().default(!0)}),cancelCameraFollowTrain:A},pt={},mt={Connect:Ve,Camera:M,Scene:He,Layer:F,Model:Ue,ModelTransform:P,HighlighterEffect:Ke,UIPOI:L,ModelPOI:Ye,Popup:Ze,Animation:Qe,TimeLine:$e,Screen:et,Dlss:tt,WeatherSystem:I,PathPatrol:R,pointIcon:j,HeatMap:at,WebView:ot,Navigation:z,SpatialQuery:dt,TrainSimulate:ft};var ht=class extends y{constructor(e,t){super(e,`Animation`,t)}startLoopAnimation(e,t){let n={...e,speed:e.speed??1};return this.request(`startLoopAnimation`,n,t,Qe.startLoopAnimation)}stopLoopAnimation(e,t){return this.request(`stopLoopAnimation`,e,t,Qe.stopLoopAnimation)}playAnimator(e,t){let n={...e,speed:e.speed??1,startTime:e.startTime??0,endTime:e.endTime??1,isStop:e.isStop??!1};return this.request(`playAnimator`,n,t,Qe.playAnimator)}setAnimatorSpeed(e,t){return this.request(`setAnimatorSpeed`,e,t,Qe.setAnimatorSpeed)}getAnimationLength(e,t){return this.request(`getAnimationLength`,e,t,Qe.getAnimationLength)}stopAnimator(e,t){return this.request(`stopAnimator`,e,t,Qe.stopAnimator)}},gt=class extends y{constructor(e,t){super(e,`CameraService`,t)}lookAt(e,t){let n={...e,time:e.time??1.5,distance:e.distance??20,isRotate:e.isRotate??!0,isHighlight:e.isHighlight??!0,offSet:e.offSet??new x(50,150,100)};if(n.offSet&&(n.offSet.ePSGType=`0000`),Array.isArray(n.id)){let e={parentId:n.parentId,ids:n.id,offSet:n.offSet,offSetX:n.offSetX,distance:n.distance,time:n.time,isRotate:n.isRotate,isHighlight:n.isHighlight};return this.request(`LookAtArray`,e,t,M.lookAtArray)}return this.request(`LookAt`,n,t,M.lookAt)}flyToTarget(e,t){let n={...e,time:e.time??2};return this.request(`FlyToTarget`,n,t,M.flyToTarget)}flyByPath(e,t){let n=Array.isArray(e.points)?JSON.stringify(e.points):e.points,r=Array.isArray(e.lookAts)?JSON.stringify(e.lookAts):e.lookAts,i={...e,points:n,lookAts:r,nodes:JSON.stringify(e.points),time:e.time??4,smoothMode:e.smoothMode??0};return this.request(`flyByPath`,i,t,M.flyByPath)}setFlySpeed(e,t){return this.request(`setFlySpeed`,e,t,M.setFlySpeed)}endFly(e){return this.request(`endFly`,void 0,e,A)}pauseFly(e){return this.request(`pauseFly`,void 0,e,A)}resumeFly(e){return this.request(`resumeFly`,void 0,e,A)}getCameraInfo(e){return this.request(`GetCameraInfo`,void 0,e,A)}setCameraPositionAndRotation(e,t){return e.rotation&&(e.rotation.ePSGType=`0000`),this.request(`setCameraPositionAndRotation`,e,t,M.setCameraPositionAndRotation)}setCameraFov(e,t){return this.request(`setCameraFov`,e,t,M.setCameraFov)}resetCameraFov(e){return this.request(`resetCameraFov`,void 0,e,A)}reset(e){return this.request(`reset`,void 0,e,A)}startCameraObjFollow(e,t){e.offSet&&(e.offSet.ePSGType=`0000`);let n={...e,offSet:e.offSet??new x(-30,0,10,`0000`)};return this.request(`StartCameraObjFollow`,n,t,M.startCameraObjFollow)}endCameraObjFollow(e){return this.request(`EndCameraObjFollow`,void 0,e,A)}},_t=class extends y{constructor(e,t,n){super(e,`Connect`,n),this.connectionLifecycle=t}connect(e){return he(Promise.resolve().then(()=>(this.logger.warn(`connect called as compatibility API; SDK auto-connects after DTCEngine init`),this.connectionLifecycle.connect().then(()=>({requestId:``,success:!0,code:`CONNECT_OK`,message:`Connect requested (compatibility path)`,ts:Date.now()})))),e)}disconnect(e){return he(Promise.resolve().then(()=>(this.logger.info(`disconnect requested`),Promise.resolve(this.connectionLifecycle.disconnect()).then(()=>({requestId:``,success:!0,code:`DISCONNECT_OK`,message:`Disconnected`,ts:Date.now()})))),e)}reconnect(e){return he(Promise.resolve().then(()=>(this.logger.info(`reconnect requested`),this.connectionLifecycle.reconnect().then(()=>({requestId:``,success:!0,code:`RECONNECT_OK`,message:`Reconnect requested`,ts:Date.now()})))),e)}KickOtherConnect(e){return this.request(`KickOtherConnect`,void 0,e,A)}KeepConnect(e){return this.request(`KeepConnect`,void 0,e,A)}GetEngineServiceStatus(e){return this.request(`GetEngineServiceStatus`,void 0,e,A)}},vt=class extends y{constructor(e,t){super(e,`DLSSService`,t)}setDlss(e={},t){let n={enable:e.enable??!1,quality:e.quality??S.Balanced};return this.request(`SetDlss`,n,t,tt.setDlss)}},yt=class extends y{constructor(e,t){super(e,`HeatMapService`,t)}create(e,t){let n={...e,opacity:e.opacity??.7,heightScale:e.heightScale??3.5,lerpScale:e.lerpScale??2.5,influenceSize:e.influenceSize??13,points:e.points.map(e=>`position`in e?e:{position:e,value:1})};return n.heightScale*=100,this.request(`CreateHeatMap`,n,t,at.create)}remove(e,t){return this.request(`RemoveHeatMap`,e,t,at.remove)}clear(e){return this.request(`ClearHeatMap`,void 0,e,at.clear)}setConfig(e,t){let n={...e,opacity:e.opacity??.7,heightScale:e.heightScale??3.5,lerpScale:e.lerpScale??2.5,influenceSize:e.influenceSize??13};return n.heightScale*=100,this.request(`SetHeatMapConfig`,n,t,at.setConfig)}},bt=class extends y{constructor(e,t){super(e,`HighLighterService`,t)}enable(e,t){return this.request(`HighlightEnable`,e,t,Ke.enable)}setHighLightModel(e,t){return this.request(`AddHighLighterModel`,e,t,Ke.setHighLightModel)}removeHighLightModel(e,t){return this.request(`RemoveHighLightModel`,e,t,Ke.removeHighLightModel)}clear(e){return this.request(`Clear`,{},e,Ke.clear)}},xt=class e{constructor(e=0,t=0,n=0,r=0,i=b.EPSGType.EPSG84){this.x=e,this.y=t,this.z=n,this.v=r,this.EPSGType=i}set(e,t,n,r){return this.x=e,this.y=t,this.z=n,this.v=r,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}clone(){return new e(this.x,this.y,this.z,this.v)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.v=e.v,this}add(e,t){return t==null?(this.x+=e.x,this.y+=e.y,this.z+=e.z,this.v+=e.v,this):this.addVectors(e,t)}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.v+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.v=e.v+t.v,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.v+=e.v*t,this}sub(e,t){return t==null?(this.x-=e.x,this.y-=e.y,this.z-=e.z,this.v-=e.v,this):this.subVectors(e,t)}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.v-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.v=e.v-t.v,this}multiply(e,t){return t==null?(this.x*=e.x,this.y*=e.y,this.z*=e.z,this.v*=e.v,this):this.multiplyVectors(e,t)}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.v*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this.v=e.v*t.v,this}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this.v/=e.v,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.v=Math.min(this.v,e.v),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.v=Math.max(this.v,e.v),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this.v=Math.max(e.v,Math.min(t.v,this.v)),this}clampScalar(t,n){let r=new e,i=new e;return r.set(t,t,t,t),i.set(n,n,n,n),this.clamp(r,i)}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.v=Math.floor(this.v),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.v=Math.ceil(this.v),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.v=Math.round(this.v),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.v=this.v<0?Math.ceil(this.v):Math.floor(this.v),this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.v*e.v}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.v*this.v}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.v*this.v)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.v)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.v+=(e.v-this.v)*t,this}lerpVectors(e,t,n){return this.subVectors(t,e).multiplyScalar(n).add(e)}cross(e,t){return t==null?this.crossVectors(this,e):this.crossVectors(e,t)}crossVectors(e,t){let n=e.x,r=e.y,i=e.z,a=t.x,o=t.y,s=t.z;return this.x=r*s-i*o,this.y=i*a-n*s,this.z=n*o-r*a,this}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,n=this.y-e.y,r=this.z-e.z,i=this.v-e.v;return t*t+n*n+r*r+i*i}equals(e){return e.x==this.x&&e.y==this.y&&e.z==this.z&&e.v==this.v}toString(){return JSON.stringify(this)}changeEPSGType(e){if(this.EPSGType!=e){if(e==b.EPSGType.EPSG84){let e=ve(this.x,this.y);this.x=e.x,this.y=e.y}else if(e==b.EPSGType.EPSGWeb){let e=_e(this.x,this.y);this.x=e.x,this.y=e.y}else console.log(`暂不支持[${this.EPSGType}]转换为${e}`);return this.EPSGType=e,this}}},St=class{constructor(){this.Vector2=ge,this.Vector3=x,this.Vector4=xt}},Ct=class extends y{constructor(e,t){super(e,`LayerService`,t)}addLayer(e,t){let n={...e,show:e.show??!0,poiEnabled:e.poiEnabled??!0,isSystem:e.isSystem??!1,poiOffsetY:e.poiOffsetY??0};return this.request(`AddLayer`,n,t,F.addLayerResolved)}removeLayer(e,t){let n={...e};return this.request(`RemoveLayer`,n,t,F.layerSelectorResolved)}isLayerOrGroupExit(e,t){let n={...e};return this.request(`IsLayerOrGroupExit`,n,t,F.layerSelectorResolved)}switchModelLayer(e,t){return this.request(`SwitchLayer`,e,t,F.switchModelLayer)}showUIPop(e,t){let n={...e,id:e.id.trim(),visible:e.visible??!0,assetsPath:e.assetsPath??`/Game/Resources/POIS/BluePrints/BP_Camera.uasset`,scale:e.scale??new x(1,1,1),offSet:e.offSet??new x(0,0,0)};return n.scale&&(n.scale.ePSGType=`0000`),n.offSet&&(n.offSet.ePSGType=`0000`),console.log(n),this.request(`ShowLayerUIPop`,n,t,F.showUIPop)}addModel(e,t){let n={...e,id:e.id.trim(),name:e.name?.trim()||``,scale:e.scale??new x(1,1,1),rotation:e.rotation??new x(0,0,0)};return n.extraProps&&=JSON.stringify(n.extraProps),n.scale&&(n.scale.ePSGType=`0000`),n.rotation&&(n.rotation.ePSGType=`0000`),this.request(`AddModel`,n,t,F.addModel)}addPOI(e,t){let n={...e,id:e.id.trim(),scale:e.scale??new x(1,1,1),rotation:e.rotation??new x(0,0,0),fontSize:e.fontSize??16,isSystem:e.isSystem??!1,text:e.text??``,targetParentId:e.targetParentId??``,targetId:e.targetId??``,offSet:e.offSet??new x(0,0,0)};return n.extraProps=n.extraProps?JSON.stringify(n.extraProps):`{}`,n.scale&&(n.scale.ePSGType=`0000`),n.rotation&&(n.rotation.ePSGType=`0000`),n.offSet&&(n.offSet.ePSGType=`0000`),this.request(`AddPOI`,n,t,F.addPOI)}removeModel(e,t){return this.request(`RemoveModelByIds`,e,t,F.removeModel)}getLayerChildElement(e,t){return this.request(`GetLayerChildElements`,e,t,F.getLayerChildElement)}},wt=class extends y{constructor(e,t){super(e,`ModelService`,t)}toIdArray(e){return Array.isArray(e)?e:[e]}setVisible(e,t){let n={parentId:e.parentId,ids:this.toIdArray(e.id),visible:e.visible??!0};return this.request(`SetVisible`,n,t,Ue.setVisibleResolved)}setVisibleByTags(e,t){let n={tags:this.toIdArray(e.tags),visible:e.visible??!0};return this.request(`SetVisibleByTags`,n,t,Ue.setVisibleByTags)}setVisibleByAttibute(e,t){let n={attributes:e.attributes,filterMode:e.filterMode??0,visible:e.visible??!0,otherVisible:e.otherVisible??!1};return this.request(`SetVisibleByAttribute`,n,t,Ue.setVisibleByAttibute)}getElementTree(e,t){return this.request(`GetElementTree`,e,t,Ue.getElementTree)}getModelInfo(e,t){return this.request(`GetModelInfo`,e,t,Ue.getModelInfo)}},Tt=class extends y{constructor(e,t){super(e,`ModelPOI`,t)}add(e,t){let n={...e,visible:e.visible??!0};return this.request(`add`,n,t,Ye.add)}deleteById(e,t){return this.request(`deleteById`,e,t,Ye.deleteById)}deleteByGroup(e,t){return this.request(`deleteByGroup`,e,t,Ye.deleteByGroup)}getPOIInfo(e,t){return this.request(`getPOIInfo`,e,t,Ye.getPOIInfo)}update(e,t){let n={...e,visible:e.visible??!0};return this.request(`update`,n,t,Ye.update)}setVisibleByGroup(e,t){return this.request(`setVisibleByGroup`,e,t,Ye.setVisibleByGroup)}},Et=class extends y{constructor(e,t){super(e,`ModelTransformService`,t)}startMoveByNodes(e,t){return this.request(`StartMoveByNodes`,e,t,P.startMoveByNodes)}pauseMove(e,t){return this.request(`PauseMove`,e,t,P.pauseMove)}resumeMove(e,t){return this.request(`ResumeMove`,e,t,P.resumeMove)}endMove(e,t){return this.request(`EndMove`,e,t,P.endMove)}restoreMove(e,t){return this.request(`RestoreMove`,e,t,P.restoreMove)}rotate(e,t){return e.rotate.ePSGType=b.EPSGType.EPSGWorld,this.request(`StartRotate`,e,t,P.rotate)}endRotate(e,t){return this.request(`EndRotate`,e,t,P.endRotate)}continuedRotate(e,t){return e.rotate.ePSGType=b.EPSGType.EPSGWorld,this.request(`ContinuedRotate`,e,t,P.continuedRotate)}rotateByTarget(e,t){return this.request(`RotateByTarget`,e,t,P.rotateByTarget)}restoreRotate(e,t){return this.request(`RestoreRotate`,e,t,P.restoreRotate)}setScale(e,t){e.scale.ePSGType=b.EPSGType.EPSGWorld;let n={...e,id:e.id.trim()};return n.scale&&(n.scale.ePSGType=`0000`),this.request(`SetScale`,n,t,P.setScale)}endScale(e,t){return this.request(`EndScale`,e,t,P.endScale)}restoreScale(e,t){return this.request(`RestoreScale`,e,t,P.restoreScale)}},Dt=class extends y{constructor(e,t){super(e,`NavigationService`,t)}startNav(e,t){let n={...e,scale:e.scale??new x(1,1,1)};return n.scale&&(n.scale.ePSGType=`0000`),this.request(`PlayMeshNavByNodes`,n,t,z.startNav)}getMeshNavDistance(e,t){return this.request(`PlayMeshNavByNodes`,e,t,z.getMeshNavDistance)}pauseNav(e,t){return this.request(`PauseMeshNav`,e,t,z.pauseNav)}resumeNav(e,t){return this.request(`ResumeMeshNav`,e,t,z.resumeNav)}stopNav(e,t){return this.request(`StopMeshNav`,e,t,z.resumeNav)}updateNav(e,t){return this.request(`UpdateMeshNavProperty`,e,t,z.updateNav)}updateSpeed(e,t){return this.request(`UpdateNavSpeed`,e,t,z.updateSpeed)}startNavByPath(e,t){return this.request(`StartNavByPath`,e,t,z.startNavByPath)}pauseNavPath(e,t){return this.request(`PauseNavPath`,e,t,z.pauseNavPath)}resumeNavPath(e,t){return this.request(`ResumeNavPath`,e,t,z.resumeNavPath)}stopNavPath(e,t){return this.request(`StopNavPath`,e,t,z.stopNavPath)}updateNavPath(e,t){return this.request(`UpdateNavPathProperty`,e,t,z.updateNavPath)}},Ot=class extends y{constructor(e,t){super(e,`PathPatrolService`,t)}add(e,t){return e.scale&&(e.scale.ePSGType=b.EPSGType.EPSGWorld),this.requestStream(`AddPath`,e,t,R.add)}update(e,t){return this.request(`UpdatePath`,e,t,R.update)}setTimeNode(e,t){return this.request(`CuriserTimeSet`,e,t,R.setTimeNode)}clear(e){return this.request(`ClearPath`,void 0,e,R.clear)}pause(e,t){return this.request(`Pause`,e,t,R.node)}resume(e,t){return this.request(`Resume`,e,t,R.node)}stop(e,t){return this.request(`Stop`,e,t,R.node)}};function kt(e){return Array.isArray(e)?{ids:e}:e}function At(e){return Array.isArray(e)?{codes:e}:e}var jt=class extends y{constructor(e,t){super(e,`PointIcon`,t)}show(e,t){return this.request(`Show`,kt(e),t,j.show)}hide(e,t){return this.request(`Hide`,kt(e),t,j.hide)}showByCode(e,t){return this.request(`ShowByCode`,At(e),t,j.showByCode)}hideByCode(e,t){return this.request(`HideByCode`,At(e),t,j.hideByCode)}showByGroup(e,t){return this.request(`ShowByGroup`,kt(e),t,j.showByGroup)}hideByGroup(e,t){return this.request(`HideByGroup`,kt(e),t,j.hideByGroup)}showAll(e){return this.request(`ShowAll`,void 0,e,j.showAll)}hideAll(e){return this.request(`HideAll`,void 0,e,j.hideAll)}},Mt=class{static getUUID(e=11){let t=16,n=`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz`.split(``),r=[],i;if(t||=n.length,e)for(i=0;i<e;i++)r[i]=n[0|Math.random()*t];else{let e;for(r[8]=r[13]=r[18]=r[23]=`-`,r[14]=`4`,i=0;i<36;i++)r[i]||(e=0|Math.random()*16,r[i]=n[i==19?e&3|8:e])}return`U`+r.join(``)}static warn(e,t=!1){console.log(`warn`,e,t);let n=document.createElement(`div`);return n.innerHTML=e,document.body.appendChild(n),n.setAttribute(`id`,`engineWarnTips`),n.style.cssText=`
|
|
1
|
+
import{EventEmitter as e,LogLevel as t,Logger as n}from"@epicgames-ps/lib-pixelstreamingcommon-ue5.6";import{z as r}from"zod";import i from"axios";import{Config as a,Flags as o,NumericParameters as s,OptionParameters as c,PixelStreaming as l}from"@epicgames-ps/lib-pixelstreamingfrontend-ue5.6";import{inflate as u}from"pako";var d=class extends Error{constructor(e,t,n){super(`Invalid payload for ${e}.${t}: ${n.map(e=>`${e.field}: ${e.reason}`).join(`; `)}`),this.moduleName=e,this.methodName=t,this.issues=n,this.name=`SDKValidationError`,this.code=`VALIDATION_ERROR`}toJSON(){return{name:this.name,code:this.code,message:this.message,module:this.moduleName,method:this.methodName,issues:this.issues}}};function f(e,t,n,r){let i=e.safeParse(t);if(i.success)return i.data;throw new d(n,r,i.error.issues.map(e=>({field:e.path.length>0?e.path.join(`.`):`<root>`,reason:e.message,code:e.code})))}function p(e){return e instanceof d?JSON.stringify(e.toJSON()):e instanceof Error?`${e.name}: ${e.message}`:String(e)}const ee={InitLogging(){},Debug(e){console.log(`[Debug] - ${e}`)},Info(e){console.log(`[Info] - ${e}`)},Warning(e){console.warn(`[Warning] - ${e}`)},Error(e){console.error(`[Error] - ${e}`)}},m={debug(){},info(){},warn(){},error(){}},te=[`silent`,`error`,`warn`,`info`,`debug`],h={silent:0,error:1,warn:2,info:3,debug:4};function ne(e){switch(e){case`silent`:return t.Disabled;case`error`:return t.Error;case`warn`:return t.Warning;case`info`:return t.Info;default:return t.Debug}}function re(e){n.InitLogging(ne(e),!1)}function g(e){return typeof e==`string`&&te.includes(e)}function _(e){if(e===void 0)return`info`;if(g(e))return e;let t=typeof e==`string`?e:JSON.stringify(e);throw Error(`Invalid logger level: ${t}. Expected one of: ${te.join(`, `)}.`)}function ie(e){if(e===void 0)return``;try{let t=JSON.stringify(e);return t?` ${t}`:``}catch{return` ${String(e)}`}}function ae(){let e=Error().stack;return e?e.replace(/^Error(?::\s*)?\n?/,``):`No Stack Available for this browser`}var oe=class{constructor(e,t,n,r,i,a){this.driver=e,this.prefix=t,this.level=n,this.moduleName=r,this.includeStack=i,this.reporter=a}formatMessage(e,t,n){let r=`${this.prefix} ${t}${ie(n)}`.trim();return this.shouldIncludeStack(e)?`${r}\nStack: ${ae()}`:r}shouldLog(e){return h[this.level]>=h[e]}shouldIncludeStack(e){return h[this.includeStack]>=h[e]}debug(e,t){this.shouldLog(`debug`)&&this.driver.Debug(this.formatMessage(`debug`,e,t))}info(e,t){this.shouldLog(`info`)&&this.driver.Info(this.formatMessage(`info`,e,t))}warn(e,t){this.reportWarnOrError(`warn`,e,t),this.shouldLog(`warn`)&&this.driver.Warning(this.formatMessage(`warn`,e,t))}error(e,t){this.reportWarnOrError(`error`,e,t),this.shouldLog(`error`)&&this.driver.Error(this.formatMessage(`error`,e,t))}reportWarnOrError(e,t,n){this.reporter?.recordLogSignal({level:e,moduleName:this.moduleName,message:t,meta:n})}},se=class{constructor(e,t=ee,n){this.level=_(e),this.driver=t,this.includeStack=n?.includeStack??`warn`,this.driver.InitLogging(ne(this.level),!1),this.reporter=n?.reporter??n?.qosMonitor}setReporter(e){this.reporter=e}child(e){return new oe(this.driver,`[DTCEngine:${e}]`,this.level,e,this.includeStack,this.reporter)}};const v={EngineIniting:`云渲染引擎初始化中...`,ServiceUrlInValid:`调度中心地址不正确,请检查中心地址!`,SerriceError:`调度中心连接失败,尝试重连中...`,SerriceUnAvaible:`没有服务资源,请检查服务是否启动!`,SerriceLoadingForWaiting:`服务资源启动中,请稍候!`,EngineWaiting:`云渲染服务坐席已满,当前排队人数:1人....`,EngineTockenChecking:`云引擎授权文件验证中...`,EngineTokenCheckFail:`云引擎授权许可无效,请联系管理员!`,EngineConnectioning:`云渲染引擎连接中...`,EngineConnectionSuccess:`云渲染引擎连接成功...`,EngineClose:`云渲染引擎连接断开,请检查服务状态!`,SourcePreparing:`资源准备中...`,TokenInValid:`许可未激活!`,TokenExpired:`许可授权已过期,实时渲染服务已停止!`,TokenWillExpired:`您的授权许可将于 YYYY-MM-DD 到期,请尽快续期!`};var ce=class{constructor(e){this.options=e,this.logger=e.logger??m}show(e,t,n=!0){if(console.log(`loading show`,e,t,n),this.options.emit({message:e,key:t,isFinish:!n}),!this.options.enabled)return;let r=this.getRoot();r&&(this.progressDiv||=this.createTipDiv(r,`engineProgressTips`),this.progressDiv.textContent=e,n||(this.clearAutoCloseTimer(),this.autoCloseTimer=setTimeout(()=>{this.removeProgressBar()},2e3)))}showTokenWillExpire(e,t=`TokenWillExpired`,n=!0){let r=this.formatTokenWillExpireMessage(e);if(this.options.emit({message:r,key:t,isFinish:!n}),!this.options.enabled)return;let i=this.getRoot();i&&(this.tokenWillExpireDiv||(this.tokenWillExpireDiv=this.createTipDiv(i,`TokenWillExpireTips`),this.tokenWillExpireDiv.style.top=`60px`),this.tokenWillExpireDiv.textContent=r)}dispose(){this.clearAutoCloseTimer(),this.removeProgressBar(),this.removeTokenWillExpireBar()}getRoot(){if(this.options.hostElement?.ownerDocument?.body)return this.options.hostElement.ownerDocument.body;if(typeof document<`u`&&document.body)return document.body;this.logger.debug(`skip loading progress ui render: document is unavailable`)}createTipDiv(e,t){let n=e.ownerDocument.createElement(`div`);return n.id=t,n.style.position=`fixed`,n.style.left=`50%`,n.style.top=`16px`,n.style.transform=`translateX(-50%)`,n.style.zIndex=`99999`,n.style.padding=`8px 14px`,n.style.borderRadius=`6px`,n.style.background=`rgba(0, 0, 0, 0.72)`,n.style.color=`#fff`,n.style.fontSize=`14px`,n.style.lineHeight=`1.4`,n.style.pointerEvents=`none`,n.style.maxWidth=`80vw`,n.style.textAlign=`center`,e.appendChild(n),n}removeProgressBar(){this.progressDiv&&=(this.progressDiv.remove(),void 0)}removeTokenWillExpireBar(){this.tokenWillExpireDiv&&=(this.tokenWillExpireDiv.remove(),void 0)}clearAutoCloseTimer(){this.autoCloseTimer&&=(clearTimeout(this.autoCloseTimer),void 0)}formatTokenWillExpireMessage(e){let t=e.trim();return t?t.includes(`到期`)?t:`您的授权许可将于 ${t}到期,请尽快续期!`:v.TokenWillExpired}};const le=`sdk3-agent-bridge/v1`;function ue(e){if(typeof WebSocket>`u`)throw Error(`WebSocket is not available in current runtime.`);return new WebSocket(e)}function de(e){return{ok:!0,data:e,ts:Date.now()}}function fe(e,t){return{ok:!1,error:{code:`PROTOCOL_ERROR`,message:e,details:t},ts:Date.now()}}function pe(e){if(typeof e==`string`)try{let t=JSON.parse(e);if(typeof t!=`object`||!t)return;let n=t;return n.protocolVersion!==`sdk3-agent-bridge/v1`||typeof n.type!=`string`||typeof n.callId!=`string`?void 0:n}catch{return}}var me=class{constructor(e,t,n={}){this.runtime=e,this.options=t,this.reconnectAttempt=0,this.running=!1,this.startedAt=0,this.beforeUnloadHandler=()=>{this.stop(`pagehide`)},this.socketFactory=n.socketFactory??ue}start(){this.socket||(this.running=!0,this.openSocket(),typeof window<`u`&&(window.addEventListener(`beforeunload`,this.beforeUnloadHandler),window.addEventListener(`pagehide`,this.beforeUnloadHandler)))}stop(e=`stop`){this.running=!1,this.clearReconnect(),typeof window<`u`&&(window.removeEventListener(`beforeunload`,this.beforeUnloadHandler),window.removeEventListener(`pagehide`,this.beforeUnloadHandler)),this.clearHeartbeat(),this.runtime.dispose?.();let t=this.socket;t&&(t.readyState===1&&this.sendUnregister(e),this.clearSocketHandlers(t),t.close(1e3,e),this.socket=void 0)}openSocket(){this.startedAt=Date.now();let e=this.socketFactory(this.options.serverUrl??`ws://127.0.0.1:8787/sdk3-bridge`);this.socket=e,e.onopen=()=>{this.reconnectAttempt=0,this.sendRegister(),this.startHeartbeat()},e.onmessage=e=>{this.handleMessage(e.data)},e.onclose=()=>{this.clearSocketHandlers(e),this.clearHeartbeat(),this.runtime.closeAllStreams?.(`Agent bridge WebSocket disconnected`),this.runtime.cancelAllPrograms?.(`Agent bridge WebSocket disconnected`),this.socket===e&&(this.socket=void 0),this.scheduleReconnect()},e.onerror=()=>{this.clearHeartbeat()}}scheduleReconnect(){if(!this.running||this.reconnectTimer!==void 0||this.options.reconnect===!1)return;let e=this.getReconnectDelay();this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=void 0,!(!this.running||this.socket)&&this.openSocket()},e),this.reconnectAttempt+=1}getReconnectDelay(){let e=typeof this.options.reconnect==`object`?this.options.reconnect:void 0,t=Math.max(0,e?.initialDelayMs??1e3),n=Math.max(t,e?.maxDelayMs??15e3),r=Math.max(0,e?.jitterMs??500);return Math.min(n,t*2**this.reconnectAttempt)+Math.floor(Math.random()*(r+1))}clearReconnect(){this.reconnectTimer!==void 0&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=void 0)}sendRegister(){let e={...this.runtime.getSnapshot(),heartbeatIntervalMs:this.getHeartbeatInterval(),capabilities:{catalog:!0,schema:!0,validateActions:!0,invoke:!0,stream:!0,businessPrograms:!0,businessProgramProtocolVersion:1}};this.send({type:`register`,protocolVersion:le,bridgeId:e.bridgeId,ts:Date.now(),payload:e})}sendUnregister(e){let t={...this.runtime.getSnapshot(),reason:e};this.send({type:`unregister`,protocolVersion:le,bridgeId:t.bridgeId,ts:Date.now(),payload:t})}sendHeartbeat(){let e={...this.runtime.getSnapshot(),heartbeatIntervalMs:this.getHeartbeatInterval(),uptimeMs:Math.max(0,Date.now()-this.startedAt)};this.send({type:`heartbeat`,protocolVersion:le,bridgeId:e.bridgeId,ts:Date.now(),payload:e})}getHeartbeatInterval(){return Math.max(1e3,this.options.heartbeatIntervalMs??5e3)}startHeartbeat(){this.clearHeartbeat(),this.heartbeatTimer=setInterval(()=>{this.sendHeartbeat()},this.getHeartbeatInterval())}clearHeartbeat(){this.heartbeatTimer!==void 0&&(clearInterval(this.heartbeatTimer),this.heartbeatTimer=void 0)}async handleMessage(e){let t=pe(e);if(t){if(t.type===`catalog`){let e=t.payload,n=e.kind===`modules`?de(this.runtime.listModules()):this.runtime.listMethods(e.moduleName??``);this.sendResult(t,`catalog`,n);return}if(t.type===`schema`){let e=t.payload;this.sendResult(t,`schema`,this.runtime.getMethodSchema(e.moduleName,e.methodName));return}if(t.type===`validate-actions`){this.sendResult(t,`validate-actions`,this.runtime.validateActions(t.payload));return}if(t.type===`invoke`){this.sendResult(t,`invoke`,await this.runtime.invoke(t.payload));return}if(t.type===`stream-start`){let e=t.payload,n=await this.runtime.startStream(e,e=>{this.sendStreamEvent(e)});this.sendResult(t,`stream-start`,n);return}if(t.type===`stream-close`){this.sendResult(t,`stream-close`,await this.runtime.closeStream(t.payload));return}if(t.type===`load-program`){this.sendResult(t,`load-program`,await this.runtime.loadProgram(t.payload));return}if(t.type===`start-program`){this.sendResult(t,`start-program`,await this.runtime.startProgram(t.payload,e=>{this.sendProgramEvent(e)}));return}if(t.type===`cancel-program`){this.sendResult(t,`cancel-program`,await this.runtime.cancelProgram(t.payload));return}this.sendResult(t,`catalog`,fe(`Unsupported message type "${t.type}".`))}}sendStreamEvent(e){this.send({type:`stream-event`,protocolVersion:le,bridgeId:this.runtime.getSnapshot().bridgeId,ts:Date.now(),payload:e})}sendProgramEvent(e){this.send({type:`program-event`,protocolVersion:le,bridgeId:this.runtime.getSnapshot().bridgeId,traceId:e.traceId,ts:Date.now(),payload:e})}sendResult(e,t,n){let r={requestType:t,result:n,traceId:e.traceId};this.send({type:`result`,protocolVersion:le,bridgeId:this.runtime.getSnapshot().bridgeId,callId:e.callId,traceId:e.traceId,ts:Date.now(),payload:r})}send(e){!this.socket||this.socket.readyState!==1||this.socket.send(JSON.stringify(e))}clearSocketHandlers(e){e.onopen=null,e.onmessage=null,e.onclose=null,e.onerror=null}};function he(e,t){return t&&e.then(e=>{t(e)}).catch(e=>{t(e)}),e}var y=class{constructor(e,t,n){this.bridge=e,this.moduleName=t,this.logger=n?.logger??m}request(e,t,n,r){return he(Promise.resolve().then(()=>{let n=r?f(r,t,this.moduleName,e):t;return r||this.logger.debug(`validation schema not configured`,{method:e}),this.logger.debug(`sending request`,{method:e}),this.bridge.sendRequest(this.moduleName,e,n)}).then(t=>(this.logger.info(`request success`,{method:e,code:t.code}),t)).catch(t=>{throw this.logger.warn(`request failed`,{method:e,error:p(t)}),t}),n)}requestStream(e,t,n,r){try{if(!this.bridge.sendStreamRequest)throw Error(`Current bridge does not support stream request`);let i=r?f(r,t,this.moduleName,e):t;return r||this.logger.debug(`validation schema not configured`,{method:e}),this.logger.debug(`sending stream request`,{method:e}),this.bridge.sendStreamRequest(this.moduleName,e,i,n)}catch(t){let r=t instanceof Error?t:Error(String(t));if(this.logger.warn(`stream request failed before send`,{method:e,error:p(r)}),n)try{n({type:`error`,requestId:``,error:r})}catch(t){this.logger.warn(`stream error callback failed`,{method:e,error:p(t)})}let i=Promise.reject(r);return Object.defineProperty(i,"requestId",{value:``,enumerable:!0}),i.cancel=()=>{},i}}},ge=class e{constructor(e=0,t=0){this.x=e,this.y=t}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}clone(){return new e(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e,t){return t==null?(this.x+=e.x,this.y+=e.y,this):this.addVectors(e,t)}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e,t){return t==null?(this.x-=e.x,this.y-=e.y,this):this.subVectors(e,t)}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}angle(){let e=Math.atan2(this.y,this.x);return e<0&&(e+=2*Math.PI),e}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,n=this.y-e.y;return t*t+n*n}equals(e){return e.x==this.x&&e.y==this.y}toString(){return JSON.stringify(this)}};function _e(e,t){let n=e*20037508.34/180,r=Math.log(Math.tan((90+t)*Math.PI/360))/(Math.PI/180);return r=r*20037508.34/180,{x:n,y:r}}function ve(e,t){let n=e/20037508.34*180,r=t/20037508.34*180;return r=180/Math.PI*(2*Math.atan(Math.exp(r*Math.PI/180))-Math.PI/2),{x:n,y:r}}const b={EPSGType:{EPSG84:`4326`,EPSGWeb:`3857`,EPSGWorld:`0000`}};var x=class e{constructor(e=0,t=0,n=0,r=b.EPSGType.EPSG84){typeof e!=`number`&&(e=this.parseFloatDeal(e)),typeof t!=`number`&&(t=this.parseFloatDeal(t)),typeof n!=`number`&&(n=this.parseFloatDeal(n)),e!=e&&(e=0),t!=t&&(t=0),n!=n&&(n=0),this.x=e,this.y=t,this.z=n,this.ePSGType=r}parseFloatDeal(e){try{return parseFloat(e)}catch(e){return console.log(e),0}}set(e,t,n){return typeof e!=`number`&&(e=0),typeof t!=`number`&&(t=0),typeof n!=`number`&&(n=0),e!=e&&(e=0),t!=t&&(t=0),n!=n&&(n=0),this.x=e,this.y=t,this.z=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}clone(){return new e(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e,t){return t==null?(this.x+=e.x,this.y+=e.y,this.z+=e.z,this):this.addVectors(e,t)}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e,t){return t==null?(this.x-=e.x,this.y-=e.y,this.z-=e.z,this):this.subVectors(e,t)}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e,t){return t==null?(this.x*=e.x,this.y*=e.y,this.z*=e.z,this):this.multiplyVectors(e,t)}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(t,n){let r=new e,i=new e;return r.set(t,t,t),i.set(n,n,n),this.clamp(r,i)}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,n){return this.subVectors(t,e).multiplyScalar(n).add(e)}cross(e,t){return t==null?this.crossVectors(this,e):this.crossVectors(e,t)}crossVectors(e,t){let n=e.x,r=e.y,i=e.z,a=t.x,o=t.y,s=t.z;return this.x=r*s-i*o,this.y=i*a-n*s,this.z=n*o-r*a,this}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,n=this.y-e.y,r=this.z-e.z;return t*t+n*n+r*r}equals(e){return e.x==this.x&&e.y==this.y&&e.z==this.z}toString(){return JSON.stringify(this)}changeEPSGType(e){if(this.ePSGType!=e){if(e==b.EPSGType.EPSG84){let e=ve(this.x,this.y);this.x=e.x,this.y=e.y}else if(e==b.EPSGType.EPSGWeb){let e=_e(this.x,this.y);this.x=e.x,this.y=e.y}else console.log(`暂不支持[${this.ePSGType}]转换为${e}`);return this.ePSGType=e,this}}};const S={Off:0,Auto:1,DLAA:2,UltraQuality:3,Quality:4,Balanced:5,Performance:6,UltraPerformance:7},C={Auto:`auto`,Low:`low`,High:`high`,Super:`super`,Blue:`blue`},ye=[{label:`自动`,type:C.Auto,value:12e6},{label:`标清`,type:C.Low,value:4e6},{label:`高清`,type:C.High,value:8e6},{label:`超清`,type:C.Super,value:12e6},{label:`蓝光`,type:C.Blue,value:24e6}],be={[C.Auto]:12e6,[C.Low]:4e6,[C.High]:8e6,[C.Super]:12e6,[C.Blue]:24e6};let xe=function(e){return e.VP8=`VP8`,e.VP9=`VP9`,e.AV1=`AV1`,e.H264=`H264`,e}({}),Se=function(e){return e.Model=`MODEL`,e.POI=`POI`,e}({});const Ce={Spring:0,Summer:1,Autumn:2,Winter:3};let we=function(e){return e[e.Linear=0]=`Linear`,e[e.EaseInQuad=1]=`EaseInQuad`,e[e.EaseOutQuad=2]=`EaseOutQuad`,e[e.EaseInOutQuad=3]=`EaseInOutQuad`,e[e.EaseOutInQuad=4]=`EaseOutInQuad`,e[e.EaseInCubic=5]=`EaseInCubic`,e[e.EaseOutCubic=6]=`EaseOutCubic`,e[e.EaseInOutCubic=7]=`EaseInOutCubic`,e[e.EaseOutInCubic=8]=`EaseOutInCubic`,e[e.EaseInQuart=9]=`EaseInQuart`,e[e.EaseOutQuart=10]=`EaseOutQuart`,e[e.EaseInOutQuart=11]=`EaseInOutQuart`,e[e.EaseOutInQuart=12]=`EaseOutInQuart`,e[e.EaseInQuint=13]=`EaseInQuint`,e[e.EaseOutQuint=14]=`EaseOutQuint`,e[e.EaseInOutQuint=15]=`EaseInOutQuint`,e[e.EaseOutInQuint=16]=`EaseOutInQuint`,e[e.EaseInSine=17]=`EaseInSine`,e[e.EaseOutSine=18]=`EaseOutSine`,e[e.EaseInOutSine=19]=`EaseInOutSine`,e[e.EaseOutInSine=20]=`EaseOutInSine`,e[e.EaseInExpo=21]=`EaseInExpo`,e[e.EaseOutExpo=22]=`EaseOutExpo`,e[e.EaseInOutExpo=23]=`EaseInOutExpo`,e[e.EaseOutInExpo=24]=`EaseOutInExpo`,e[e.EaseInCirc=25]=`EaseInCirc`,e[e.EaseOutCirc=26]=`EaseOutCirc`,e[e.EaseInOutCirc=27]=`EaseInOutCirc`,e[e.EaseOutInCirc=28]=`EaseOutInCirc`,e[e.EaseInElastic=29]=`EaseInElastic`,e[e.EaseOutElastic=30]=`EaseOutElastic`,e[e.EaseInOutElastic=31]=`EaseInOutElastic`,e[e.EaseOutInElastic=32]=`EaseOutInElastic`,e[e.EaseInBack=33]=`EaseInBack`,e[e.EaseOutBack=34]=`EaseOutBack`,e[e.EaseInOutBack=35]=`EaseInOutBack`,e[e.EaseOutInBack=36]=`EaseOutInBack`,e[e.EaseInBounce=37]=`EaseInBounce`,e[e.EaseOutBounce=38]=`EaseOutBounce`,e[e.EaseInOutBounce=39]=`EaseInOutBounce`,e[e.EaseOutInBounce=40]=`EaseOutInBounce`,e}({}),Te=function(e){return e[e.Loose=0]=`Loose`,e[e.Strict=1]=`Strict`,e}({}),Ee=function(e){return e.StopAtTheEnd=`StopAtTheEnd`,e.Loop=`Loop`,e.BackAndForward=`BackAndForward`,e}({});const w=r.string().min(1),T=w.optional(),E=r.number().finite(),D=E.optional(),O=r.instanceof(x),De=r.object({x:E,y:E,z:E,ePSGType:w}),Oe=r.union([r.instanceof(ge),r.object({x:E,y:E})]),k=r.union([O,De]),ke=O.optional(),Ae=k.optional(),je=r.union([r.literal(Ce.Spring).describe(`春季`),r.literal(Ce.Summer).describe(`夏季`),r.literal(Ce.Autumn).describe(`秋季`),r.literal(Ce.Winter).describe(`冬季`)]).describe(`场景季节`),Me=r.union([r.literal(S.Off).describe(`关闭 DLSS`),r.literal(S.Auto).describe(`自动质量档位`),r.literal(S.DLAA).describe(`DLAA 2倍效果`),r.literal(S.UltraQuality).describe(`超高质量`),r.literal(S.Quality).describe(`高质量`),r.literal(S.Balanced).describe(`平衡`),r.literal(S.Performance).describe(`性能`),r.literal(S.UltraPerformance).describe(`超高性能`)]).describe(`DLSS 质量档位`),Ne=r.union([r.literal(C.Auto).describe(`自动`),r.literal(C.Low).describe(`标清`),r.literal(C.High).describe(`高清`),r.literal(C.Super).describe(`超清`),r.literal(C.Blue).describe(`蓝光`)]).describe(`渲染码率档位`),Pe=r.union([r.literal(`VP8`).describe(`VP8`),r.literal(`VP9`).describe(`VP9`),r.literal(`AV1`).describe(`AV1`),r.literal(`H264`).describe(`H264`)]).describe(`视频解码器类别`),Fe=r.union([r.literal(`MODEL`).describe(`模型图层`),r.literal(`POI`).describe(`POI 图层`)]).describe(`图层类别`),Ie=r.union([w,r.array(w).min(1)]),A=r.undefined().optional(),Le=r.object({ids:r.array(w).min(1)}),Re=r.object({codes:r.array(w).min(1)}),j={show:Le,hide:Le,showByCode:Re,hideByCode:Re,showByGroup:Le,hideByGroup:Le,showAll:A,hideAll:A},ze=r.object({parentId:r.string().optional(),id:T}),Be=e=>e.refine(e=>!!(e.id||e.timelineId),{message:`id or timelineId is required`}),Ve={connect:A,disconnect:A,reconnect:A,KickOtherConnect:A,KeepConnect:A,GetEngineServiceStatus:A},M={lookAt:r.object({parentId:r.string().optional(),id:Ie,offSet:Ae,positionOffSetDistance:D,offSetX:D,distance:D,time:D,isRotate:r.boolean().optional(),isHighlight:r.boolean().optional(),showBack:r.boolean().optional()}),lookAtArray:r.object({parentId:T,ids:r.array(w).min(1),offSet:Ae,offSetX:D,distance:D,time:D,isRotate:r.boolean().optional(),isHighlight:r.boolean().optional()}),flyToTarget:r.object({point:Ae,target:Ae,fov:r.number().finite().min(10).max(150).optional(),time:D}),flyByPath:r.object({points:r.union([r.array(O),r.string()]).optional(),lookAts:r.union([r.array(O),r.string()]).optional(),nodes:r.string().optional(),time:D,smoothMode:r.union([r.literal(0),r.literal(1)]).optional()}),setFlySpeed:r.object({speed:E}),endFly:A,pauseFly:A,resumeFly:A,getCameraInfo:A,setCameraPositionAndRotation:r.object({point:O,rotation:O}),setCameraFov:r.object({fov:E}),startCameraObjFollow:r.object({parentId:r.string().optional(),id:w,offSet:k,smooth:E.optional().default(.85).refine(e=>e>=0&&e<=1,{message:`smooth must be in [0, 1]`,path:[`smooth`]})}),endCameraObjFollow:A,resetCameraFov:A,reset:A},He={getAllSceneName:A,switchSceneByName:r.object({sceneName:w}),getCurrentSceneName:A,listenMapCompass:r.object({enable:r.boolean()}),setFeatureToggle:r.object({key:w,enabled:r.boolean()}),getSceneMeta:A},Ue={setVisible:r.object({parentId:r.string().optional().default(``),id:Ie,visible:r.boolean().optional()}),setVisibleResolved:r.object({parentId:r.string().optional(),ids:r.array(w).min(1),visible:r.boolean()}),setVisibleByTags:r.object({tags:Ie,visible:r.boolean()}),setVisibleByAttibute:r.object({attributes:r.record(r.string(),r.any()),filterMode:r.nativeEnum(Te).optional().default(0),visible:r.boolean().optional().default(!0),otherVisible:r.boolean().optional().default(!1)}),add:r.object({parentId:r.string().optional().default(``),id:w,assetsPath:T,position:ke,angle:ke,scale:ke,description:r.string().optional()}),remove:r.object({parentId:r.string().optional().default(``),ids:r.array(w).min(1)}),getElementTree:r.object({parentId:r.string().optional().default(``),id:w}),getModelInfo:r.object({parentId:r.string().optional().default(``),id:w}),getModelBoundsInfo:r.object({parentId:r.string().optional().default(``),id:Ie}),getModelBoundsInfoResolved:r.object({parentId:r.string().optional(),ids:r.array(w).min(1)})},N=r.object({parentId:r.string().optional(),id:w}),We=r.object({parentId:r.string().optional(),ids:r.array(w).min(1)}),Ge=N.extend({rotate:O}),P={startMoveByNodes:N.extend({nodes:r.array(k).min(1),speed:E.optional().default(1),linear:E.optional().default(1),isLookAtTarget:r.boolean().optional().default(!1),needDirection:r.boolean().optional().default(!0)}),pauseMove:N,resumeMove:N,endMove:N,restoreMove:We,rotate:Ge,endRotate:N,continuedRotate:Ge,rotateByTarget:N.extend({parentTargetId:T,targetID:w,point:O,axisX:E.optional().default(0),axisY:E.optional().default(0),axisZ:E.optional().default(0),angle:E.optional().default(0),isPersistence:r.boolean().optional().default(!1)}),restoreRotate:We,setScale:N.extend({scale:O,duration:E.optional().default(.5)}),endScale:N,restoreScale:We},Ke={enable:r.object({enable:r.boolean()}),setHighLightModel:r.object({parentId:r.string().optional().default(``),ids:r.array(w).min(1),showBack:r.boolean()}),removeHighLightModel:r.object({parentId:r.string().optional(),ids:r.array(w).min(1)}),clear:r.object({})},qe=r.object({parentId:T,id:T}),Je=e=>e.refine(e=>!!(e.id||e.parentId),{message:`id or parentId is required`}),F={addLayer:Je(qe.extend({layerName:r.string().optional(),show:r.boolean().optional(),poiEnabled:r.boolean().optional(),type:Fe.optional(),description:r.string().optional()})),addLayerResolved:r.object({parentId:r.string().optional(),id:w,layerName:r.string().optional(),show:r.boolean().optional().default(!0),poiEnabled:r.boolean().optional().default(!0),description:r.string().optional().default(``),isSystem:r.boolean().optional().default(!1),poiOffsetY:r.number().optional().default(0)}),layerSelector:Je(qe),removeLayer:Je(qe),isLayerOrGroupExit:Je(qe),layerSelectorResolved:r.object({parentId:r.string().optional().default(``),id:w}),switchModelLayer:r.object({parentId:w,ids:r.array(w).min(1),toParentId:w}),showUIPop:r.object({parentId:r.string().optional(),id:w,visible:r.boolean().optional().default(!0),assetsPath:r.string().optional().default(``),offSet:k,scale:k}),addModel:r.object({parentId:w,id:w,assetsPath:T,position:k,name:r.string().optional().default(``),rotation:k,scale:k,description:r.string().optional(),isSystem:r.boolean().optional(),tags:r.array(r.string()).optional(),extraProps:r.any().optional()}),addPOI:r.object({parentId:r.string().optional(),id:w,assetsPath:w,position:Ae,targetParentId:r.string().optional(),targetId:r.string().optional(),rotation:k,scale:k,offSet:k,description:r.string().optional(),isSystem:r.boolean().optional(),name:r.string(),fontSize:r.number().optional(),tags:r.array(r.string()).optional(),extraProps:r.any().optional()}),removeModel:r.object({parentId:w,ids:r.array(w).min(1)}),getLayerChildElement:r.object({parentId:r.string().optional().default(``),id:w}),updatePOIName:r.object({parentId:r.string().optional(),id:w,name:r.string(),updateType:r.enum([`update`,`append`,`remove`]).optional().describe(`文本更新方式:update 更新、append 追加、remove 移除,默认 update`)}),resetPOIName:r.object({parentId:r.string().optional(),ids:r.array(w).min(1).describe(`POI 对象编号集合,至少一个`)})},I={closeCameraFog:A,getWeatherTypes:A,resetWeather:A,resetWeatherAndTime:A,openCameraFog:r.object({fogIntensity:D,fogStartColor:r.string().optional(),fogEndColor:r.string().optional(),fogStartDistance:D,fogEndDistance:D,directionalIntensity:D,directionalFallOff:D,directionalColor:r.string().optional()}).refine(e=>e.fogIntensity===void 0||e.fogIntensity>=0&&e.fogIntensity<=1,{message:`fogIntensity must be between 0 and 1`,path:[`fogIntensity`]}),setSceneTime:r.object({hour:E,timeDuration:D}).refine(e=>e.hour>=0&&e.hour<24,{message:`hour must be in [0, 24)`,path:[`hour`]}),changeWeatherType:r.object({weatherType:w,timeDuration:D}),setAnimateTimeOfDay:r.object({isAnimate:r.boolean(),dayLength:D,nightLength:D}),changeSeason:r.object({season:je,duration:D.describe(`切换过渡时长,单位秒`)}),resetSeason:r.object({}),setTimeSync:r.object({syncSystemTime:r.boolean()}),resetSceneTime:r.object({}),setDayAndNight:r.object({dayType:w}),setWeatherVolume:r.object({volumeOn:r.boolean().optional().default(!0).describe(`天气声音是否开启,true 开启,false 关闭,默认 true`)})},L={add:r.object({groupName:w,poiInfos:r.array(r.record(r.unknown())).min(1)}),deleteById:r.object({groupName:w,id:w}),deleteByGroup:r.object({groupName:w}),update:r.object({groupName:w,poiInfos:r.array(r.record(r.unknown())).min(1)}),updatePopStates:r.object({groupName:w,popStates:r.array(r.record(r.unknown())).min(1)}),enableOverlap:r.object({enable:r.boolean()}),showDistance:r.object({distance:E})},Ye={add:r.object({id:w,groupName:w,assetPath:w,targetParentId:T,targetId:T,visible:r.boolean().optional()}),deleteById:r.object({groupName:w,ids:r.array(w).min(1)}),deleteByGroup:r.object({groupName:w}),getPOIInfo:r.object({groupName:w,id:w}),update:r.object({id:w,groupName:w,assetPath:T,targetParentId:T,targetId:T,visible:r.boolean().optional()}),setVisibleByGroup:r.object({groupName:w,visible:r.boolean()})},Xe=r.array(r.object({groupName:w,id:w,parentId:r.string().optional().default(``),position:ke})),Ze={addPop:Xe,removePop:Xe,removeAll:Xe,show:Xe,showAll:Xe,setPopDelayFrame:r.object({time:E}),setPopShowDistance:r.object({distance:E})},Qe={startLoopAnimation:r.object({parentId:T,id:w,stateName:w,loopStartTime:D,loopEndTime:D,speed:D}).refine(e=>e.loopStartTime===void 0||e.loopStartTime>=0&&(e.loopEndTime===void 0||e.loopEndTime>e.loopStartTime),{message:`loopStartTime must be >= 0 and loopEndTime must be greater than loopStartTime`,path:[`loopStartTime`]}),stopLoopAnimation:r.object({parentId:T,id:w}),playAnimator:r.object({parentId:T,id:w,stateName:w,speed:D,startTime:D,endTime:D,isStop:r.boolean().optional()}),setAnimatorSpeed:r.object({parentId:T,id:w,speed:E}),getAnimationLength:r.object({parentId:T,id:w,stateName:w}),stopAnimator:r.object({parentId:T,id:w})},$e={play:Be(ze.extend({initialTime:D,speed:D,keepLastFrame:r.boolean().optional()}).refine(e=>e.speed===void 0||e.speed<0||e.speed>=.1,{message:`speed must be negative or >= 0.1`,path:[`speed`]})),pause:Be(ze),resume:Be(ze),stop:Be(ze.extend({resetTime:D,isCameraToStart:r.boolean().optional()})),stopAll:r.object({}).optional(),setSpeed:Be(ze.extend({speed:E}).refine(e=>e.speed<0||e.speed>=.1,{message:`speed must be negative or >= 0.1`,path:[`speed`]}))},et={setSceneRenderBitrate:r.object({bitrate:Ne.optional()}),setSceneRenderBitrateResolved:r.object({bitrate:E}).refine(e=>e.bitrate>=1e6,{message:`bitrate must be >= 1000000`,path:[`bitrate`]}),setSceneFPS:r.object({fps:E}).refine(e=>e.fps>=1&&e.fps<=300,{message:`fps must be in [1, 300]`,path:[`fps`]}),setVideoDecode:r.object({decode:Pe}),setScreenResolution:r.object({width:E,height:E}).refine(e=>e.width>0&&e.height>0,{message:`width and height must be > 0`,path:[`width`]})},tt={setDlssEnable:r.object({enable:r.boolean(),quality:Me}),setDlss:r.object({enable:r.boolean(),quality:Me}),setDlssQuality:r.object({quality:Me})},nt=r.object({node:k,time:r.string()}),rt=r.object({parentId:r.string().optional().default(``),id:w}),R={add:r.object({parentId:r.string().optional().default(``),id:w,assetPath:r.string().optional().default(``),scale:k,showPath:r.boolean().optional().default(!0),passedColor:r.string().optional().default(`#ffffff`),lineColor:r.string().optional().default(`#00ff00`),lineWidth:E,duration:D,nodes:r.array(k).optional(),timeNodes:r.array(nt).optional(),lineLayer:T,afterRender:r.boolean().optional().default(!1),isAutoClear:r.boolean().optional().default(!0)}),update:r.object({parentId:r.string().optional().default(``),id:w,lineColor:r.string().optional(),lineWidth:D,passedColor:r.string().optional(),speed:D}).refine(e=>e.speed===void 0||e.speed>=0,{message:`speed must be >= 0`,path:[`speed`]}),setTimeNode:r.object({parentId:r.string().optional().default(``),id:w,timeStart:r.string().optional(),startNodeIndex:r.string().optional()}).refine(e=>e.timeStart!==void 0||e.startNodeIndex!==void 0,{message:`timeStart or startNodeIndex is required`,path:[`timeStart`]}).refine(e=>e.startNodeIndex===void 0||parseInt(e.startNodeIndex)>=0,{message:`startNodeIndex must be >= 0`,path:[`startNodeIndex`]}),node:rt,pause:rt,resume:rt,stop:rt,clear:r.object({}).optional()},it=r.object({position:k,value:E.min(0).max(999).optional().default(1)}),at={create:r.object({parentId:r.string().optional().default(``),id:r.string().optional(),textureSize:Oe.optional().default({x:256,y:256}),mapSize:Oe.optional().default({x:1e3,y:1e3}),influenceSize:r.number().int().positive().optional().default(13),points:r.union([r.array(it).min(1),r.array(k).min(1)]),opacity:r.number().min(0).max(1).optional().default(.7),heightScale:r.number().positive().optional().default(3.5),lerpScale:r.number().positive().optional().default(2.5),isAddAsset:r.boolean().optional().default(!1)}),remove:r.object({parentId:r.string().optional().default(``),id:r.string().optional()}),clear:A,setConfig:r.object({parentId:r.string().optional().default(``),id:r.string().optional(),opacity:r.number().min(0).max(1).optional().default(.7),heightScale:r.number().positive().optional().default(3.5),lerpScale:r.number().positive().optional().default(2.5),influenceSize:r.number().int().positive().optional().default(13)})},ot={updateWebView:r.object({parentId:r.string().optional().default(``),id:w,url:w})},st=r.object({parentId:r.string().optional().default(``),id:r.string()}),ct=e=>e.refine(e=>{let t=e;return t.nodes!==void 0||t.targetIds!==void 0||t.targetCodes!==void 0},{message:`nodes or targetIds or targetCodes is required`,path:[`nodes`,`targetIds`,`targetCodes`]}),lt=r.object({parentId:r.string().optional().default(``),id:r.string(),nodes:r.array(k).optional(),targetIds:r.array(w).optional(),targetCodes:r.array(w).optional(),speed:r.number().positive().optional().default(2),isCache:r.boolean().optional().default(!0),planColor:r.string().optional(),passColor:r.string().optional(),lineWidth:r.number().positive().optional().default(3),isAutoPlay:r.boolean().optional().default(!0),assetPath:r.string().optional(),isAutoClear:r.boolean().optional().default(!0),offSetZ:r.number().optional().default(.5),scale:O.default(new x(1,1,1))}),z={startNav:ct(lt),getMeshNavDistance:ct(lt.extend({isCache:r.boolean().optional().default(!1),isAutoPlay:r.boolean().optional().default(!1)})),pauseNav:st,resumeNav:st,stopNav:st,updateNav:r.object({parentId:r.string().optional().default(``),id:r.string(),speed:r.number().finite().optional().default(-1),planColor:r.string().optional(),passColor:r.string().optional()}),updateSpeed:r.object({parentId:r.string().optional().default(``),id:r.string(),speed:r.number().finite().optional().default(-1),planColor:r.string().optional(),passColor:r.string().optional()}),startNavByPath:r.object({parentId:r.string().optional().default(``),id:r.array(w).min(1),nodes:r.array(k).min(1),isCache:r.boolean().optional().default(!0),duration:r.number().positive().optional().default(10),planColor:r.string().optional(),passColor:r.string().optional()}),pauseNavPath:st,resumeNavPath:st,stopNavPath:st,updateNavPath:r.object({parentId:r.string().optional().default(``),id:r.array(w).min(1),duration:r.number().finite().optional().default(-1),planColor:r.string().optional(),passColor:r.string().optional()})},ut=r.array(w).min(1).describe(`查询的图层组编号集合`),dt={layerQueryByModel:r.object({parentId:r.string().optional(),id:r.string().optional(),queryRadius:r.number().positive().optional().default(50),queryMinHeight:r.number().optional().default(0),queryMaxHeight:r.number().optional().default(20),queryParentIds:ut}),layerQueryByPosition:r.object({queryPosition:k.optional(),queryRadius:r.number().positive().optional().default(50),queryMinHeight:r.number().optional().default(0),queryMaxHeight:r.number().optional().default(20),queryParentIds:ut}),layerQueryByModelBox:r.object({parentId:r.string().optional(),id:r.string().optional(),queryParentIds:ut})},ft={startTrain:r.object({parentId:r.string().optional(),id:w,trainCode:r.string().optional(),startStationName:r.string().optional(),endStationName:r.string().optional(),direction:r.string().optional(),action:r.string().optional(),stopTime:D,moveType:r.nativeEnum(Ee).optional()}),setTrainBehavior:r.object({parentId:r.string().optional(),id:w,moveType:r.nativeEnum(Ee).optional()}),setCameraFollowTrain:r.object({parentId:r.string().optional(),id:w,offSet:Ae}),setTrainVolume:r.object({parentId:r.string().optional(),id:w,volumeOn:r.boolean().optional().default(!0)}),cancelCameraFollowTrain:A},pt={},mt={Connect:Ve,Camera:M,Scene:He,Layer:F,Model:Ue,ModelTransform:P,HighlighterEffect:Ke,UIPOI:L,ModelPOI:Ye,Popup:Ze,Animation:Qe,TimeLine:$e,Screen:et,Dlss:tt,WeatherSystem:I,PathPatrol:R,pointIcon:j,HeatMap:at,WebView:ot,Navigation:z,SpatialQuery:dt,TrainSimulate:ft};var ht=class extends y{constructor(e,t){super(e,`Animation`,t)}startLoopAnimation(e,t){let n={...e,speed:e.speed??1};return this.request(`startLoopAnimation`,n,t,Qe.startLoopAnimation)}stopLoopAnimation(e,t){return this.request(`stopLoopAnimation`,e,t,Qe.stopLoopAnimation)}playAnimator(e,t){let n={...e,speed:e.speed??1,startTime:e.startTime??0,endTime:e.endTime??1,isStop:e.isStop??!1};return this.request(`playAnimator`,n,t,Qe.playAnimator)}setAnimatorSpeed(e,t){return this.request(`setAnimatorSpeed`,e,t,Qe.setAnimatorSpeed)}getAnimationLength(e,t){return this.request(`getAnimationLength`,e,t,Qe.getAnimationLength)}stopAnimator(e,t){return this.request(`stopAnimator`,e,t,Qe.stopAnimator)}},gt=class extends y{constructor(e,t){super(e,`CameraService`,t)}lookAt(e,t){let n={...e,time:e.time??1.5,distance:e.distance??20,isRotate:e.isRotate??!0,isHighlight:e.isHighlight??!0,offSet:e.offSet??new x(50,150,100)};if(n.offSet&&(n.offSet.ePSGType=`0000`),Array.isArray(n.id)){let e={parentId:n.parentId,ids:n.id,offSet:n.offSet,offSetX:n.offSetX,distance:n.distance,time:n.time,isRotate:n.isRotate,isHighlight:n.isHighlight};return this.request(`LookAtArray`,e,t,M.lookAtArray)}return this.request(`LookAt`,n,t,M.lookAt)}flyToTarget(e,t){let n={...e,time:e.time??2};return this.request(`FlyToTarget`,n,t,M.flyToTarget)}flyByPath(e,t){let n=Array.isArray(e.points)?JSON.stringify(e.points):e.points,r=Array.isArray(e.lookAts)?JSON.stringify(e.lookAts):e.lookAts,i={...e,points:n,lookAts:r,nodes:JSON.stringify(e.points),time:e.time??4,smoothMode:e.smoothMode??0};return this.request(`flyByPath`,i,t,M.flyByPath)}setFlySpeed(e,t){return this.request(`setFlySpeed`,e,t,M.setFlySpeed)}endFly(e){return this.request(`endFly`,void 0,e,A)}pauseFly(e){return this.request(`pauseFly`,void 0,e,A)}resumeFly(e){return this.request(`resumeFly`,void 0,e,A)}getCameraInfo(e){return this.request(`GetCameraInfo`,void 0,e,A)}setCameraPositionAndRotation(e,t){return e.rotation&&(e.rotation.ePSGType=`0000`),this.request(`setCameraPositionAndRotation`,e,t,M.setCameraPositionAndRotation)}setCameraFov(e,t){return this.request(`setCameraFov`,e,t,M.setCameraFov)}resetCameraFov(e){return this.request(`resetCameraFov`,void 0,e,A)}reset(e){return this.request(`reset`,void 0,e,A)}startCameraObjFollow(e,t){e.offSet&&(e.offSet.ePSGType=`0000`);let n={...e,offSet:e.offSet??new x(-30,0,10,`0000`)};return this.request(`StartCameraObjFollow`,n,t,M.startCameraObjFollow)}endCameraObjFollow(e){return this.request(`EndCameraObjFollow`,void 0,e,A)}},_t=class extends y{constructor(e,t,n){super(e,`Connect`,n),this.connectionLifecycle=t}connect(e){return he(Promise.resolve().then(()=>(this.logger.warn(`connect called as compatibility API; SDK auto-connects after DTCEngine init`),this.connectionLifecycle.connect().then(()=>({requestId:``,success:!0,code:`CONNECT_OK`,message:`Connect requested (compatibility path)`,ts:Date.now()})))),e)}disconnect(e){return he(Promise.resolve().then(()=>(this.logger.info(`disconnect requested`),Promise.resolve(this.connectionLifecycle.disconnect()).then(()=>({requestId:``,success:!0,code:`DISCONNECT_OK`,message:`Disconnected`,ts:Date.now()})))),e)}reconnect(e){return he(Promise.resolve().then(()=>(this.logger.info(`reconnect requested`),this.connectionLifecycle.reconnect().then(()=>({requestId:``,success:!0,code:`RECONNECT_OK`,message:`Reconnect requested`,ts:Date.now()})))),e)}KickOtherConnect(e){return this.request(`KickOtherConnect`,void 0,e,A)}KeepConnect(e){return this.request(`KeepConnect`,void 0,e,A)}GetEngineServiceStatus(e){return this.request(`GetEngineServiceStatus`,void 0,e,A)}},vt=class extends y{constructor(e,t){super(e,`DLSSService`,t)}setDlss(e={},t){let n={enable:e.enable??!1,quality:e.quality??S.Balanced};return this.request(`SetDlss`,n,t,tt.setDlss)}},yt=class extends y{constructor(e,t){super(e,`HeatMapService`,t)}create(e,t){let n={...e,opacity:e.opacity??.7,heightScale:e.heightScale??3.5,lerpScale:e.lerpScale??2.5,influenceSize:e.influenceSize??13,points:e.points.map(e=>`position`in e?e:{position:e,value:1})};return n.heightScale*=100,this.request(`CreateHeatMap`,n,t,at.create)}remove(e,t){return this.request(`RemoveHeatMap`,e,t,at.remove)}clear(e){return this.request(`ClearHeatMap`,void 0,e,at.clear)}setConfig(e,t){let n={...e,opacity:e.opacity??.7,heightScale:e.heightScale??3.5,lerpScale:e.lerpScale??2.5,influenceSize:e.influenceSize??13};return n.heightScale*=100,this.request(`SetHeatMapConfig`,n,t,at.setConfig)}},bt=class extends y{constructor(e,t){super(e,`HighLighterService`,t)}enable(e,t){return this.request(`HighlightEnable`,e,t,Ke.enable)}setHighLightModel(e,t){return this.request(`AddHighLighterModel`,e,t,Ke.setHighLightModel)}removeHighLightModel(e,t){return this.request(`RemoveHighLightModel`,e,t,Ke.removeHighLightModel)}clear(e){return this.request(`Clear`,{},e,Ke.clear)}},xt=class e{constructor(e=0,t=0,n=0,r=0,i=b.EPSGType.EPSG84){this.x=e,this.y=t,this.z=n,this.v=r,this.EPSGType=i}set(e,t,n,r){return this.x=e,this.y=t,this.z=n,this.v=r,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}clone(){return new e(this.x,this.y,this.z,this.v)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.v=e.v,this}add(e,t){return t==null?(this.x+=e.x,this.y+=e.y,this.z+=e.z,this.v+=e.v,this):this.addVectors(e,t)}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.v+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.v=e.v+t.v,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.v+=e.v*t,this}sub(e,t){return t==null?(this.x-=e.x,this.y-=e.y,this.z-=e.z,this.v-=e.v,this):this.subVectors(e,t)}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.v-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.v=e.v-t.v,this}multiply(e,t){return t==null?(this.x*=e.x,this.y*=e.y,this.z*=e.z,this.v*=e.v,this):this.multiplyVectors(e,t)}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.v*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this.v=e.v*t.v,this}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this.v/=e.v,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.v=Math.min(this.v,e.v),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.v=Math.max(this.v,e.v),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this.v=Math.max(e.v,Math.min(t.v,this.v)),this}clampScalar(t,n){let r=new e,i=new e;return r.set(t,t,t,t),i.set(n,n,n,n),this.clamp(r,i)}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.v=Math.floor(this.v),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.v=Math.ceil(this.v),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.v=Math.round(this.v),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.v=this.v<0?Math.ceil(this.v):Math.floor(this.v),this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.v*e.v}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.v*this.v}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.v*this.v)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.v)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.v+=(e.v-this.v)*t,this}lerpVectors(e,t,n){return this.subVectors(t,e).multiplyScalar(n).add(e)}cross(e,t){return t==null?this.crossVectors(this,e):this.crossVectors(e,t)}crossVectors(e,t){let n=e.x,r=e.y,i=e.z,a=t.x,o=t.y,s=t.z;return this.x=r*s-i*o,this.y=i*a-n*s,this.z=n*o-r*a,this}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,n=this.y-e.y,r=this.z-e.z,i=this.v-e.v;return t*t+n*n+r*r+i*i}equals(e){return e.x==this.x&&e.y==this.y&&e.z==this.z&&e.v==this.v}toString(){return JSON.stringify(this)}changeEPSGType(e){if(this.EPSGType!=e){if(e==b.EPSGType.EPSG84){let e=ve(this.x,this.y);this.x=e.x,this.y=e.y}else if(e==b.EPSGType.EPSGWeb){let e=_e(this.x,this.y);this.x=e.x,this.y=e.y}else console.log(`暂不支持[${this.EPSGType}]转换为${e}`);return this.EPSGType=e,this}}},St=class{constructor(){this.Vector2=ge,this.Vector3=x,this.Vector4=xt}},Ct=class extends y{constructor(e,t){super(e,`LayerService`,t)}addLayer(e,t){let n={...e,show:e.show??!0,poiEnabled:e.poiEnabled??!0,isSystem:e.isSystem??!1,poiOffsetY:e.poiOffsetY??0};return this.request(`AddLayer`,n,t,F.addLayerResolved)}removeLayer(e,t){let n={...e};return this.request(`RemoveLayer`,n,t,F.layerSelectorResolved)}isLayerOrGroupExit(e,t){let n={...e};return this.request(`IsLayerOrGroupExit`,n,t,F.layerSelectorResolved)}switchModelLayer(e,t){return this.request(`SwitchLayer`,e,t,F.switchModelLayer)}showUIPop(e,t){let n={...e,id:e.id.trim(),visible:e.visible??!0,assetsPath:e.assetsPath??`/Game/Resources/POIS/BluePrints/BP_Camera.uasset`,scale:e.scale??new x(1,1,1),offSet:e.offSet??new x(0,0,0)};return n.scale&&(n.scale.ePSGType=`0000`),n.offSet&&(n.offSet.ePSGType=`0000`),console.log(n),this.request(`ShowLayerUIPop`,n,t,F.showUIPop)}addModel(e,t){let n={...e,id:e.id.trim(),name:e.name?.trim()||``,scale:e.scale??new x(1,1,1),rotation:e.rotation??new x(0,0,0)};return n.extraProps&&=JSON.stringify(n.extraProps),n.scale&&(n.scale.ePSGType=`0000`),n.rotation&&(n.rotation.ePSGType=`0000`),this.request(`AddModel`,n,t,F.addModel)}addPOI(e,t){let n={...e,id:e.id.trim(),scale:e.scale??new x(1,1,1),rotation:e.rotation??new x(0,0,0),fontSize:e.fontSize??16,isSystem:e.isSystem??!1,name:e.name??``,targetParentId:e.targetParentId??``,targetId:e.targetId??``,offSet:e.offSet??new x(0,0,0)};return n.extraProps=n.extraProps?JSON.stringify(n.extraProps):`{}`,n.scale&&(n.scale.ePSGType=`0000`),n.rotation&&(n.rotation.ePSGType=`0000`),n.offSet&&(n.offSet.ePSGType=`0000`),this.request(`AddPOI`,n,t,F.addPOI)}updatePOIName(e,t){let n={...e,id:e.id.trim(),updateType:e.updateType??`update`};return this.request(`UpdatePOIName`,n,t,F.updatePOIName)}resetPOIName(e,t){return this.request(`ResetPOIName`,e,t,F.resetPOIName)}removeModel(e,t){return this.request(`RemoveModelByIds`,e,t,F.removeModel)}getLayerChildElement(e,t){return this.request(`GetLayerChildElements`,e,t,F.getLayerChildElement)}},wt=class extends y{constructor(e,t){super(e,`ModelService`,t)}toIdArray(e){return Array.isArray(e)?e:[e]}setVisible(e,t){let n={parentId:e.parentId,ids:this.toIdArray(e.id),visible:e.visible??!0};return this.request(`SetVisible`,n,t,Ue.setVisibleResolved)}setVisibleByTags(e,t){let n={tags:this.toIdArray(e.tags),visible:e.visible??!0};return this.request(`SetVisibleByTags`,n,t,Ue.setVisibleByTags)}setVisibleByAttibute(e,t){let n={attributes:e.attributes,filterMode:e.filterMode??0,visible:e.visible??!0,otherVisible:e.otherVisible??!1};return this.request(`SetVisibleByAttribute`,n,t,Ue.setVisibleByAttibute)}getElementTree(e,t){return this.request(`GetElementTree`,e,t,Ue.getElementTree)}getModelInfo(e,t){return this.request(`GetModelInfo`,e,t,Ue.getModelInfo)}},Tt=class extends y{constructor(e,t){super(e,`ModelPOI`,t)}add(e,t){let n={...e,visible:e.visible??!0};return this.request(`add`,n,t,Ye.add)}deleteById(e,t){return this.request(`deleteById`,e,t,Ye.deleteById)}deleteByGroup(e,t){return this.request(`deleteByGroup`,e,t,Ye.deleteByGroup)}getPOIInfo(e,t){return this.request(`getPOIInfo`,e,t,Ye.getPOIInfo)}update(e,t){let n={...e,visible:e.visible??!0};return this.request(`update`,n,t,Ye.update)}setVisibleByGroup(e,t){return this.request(`setVisibleByGroup`,e,t,Ye.setVisibleByGroup)}},Et=class extends y{constructor(e,t){super(e,`ModelTransformService`,t)}startMoveByNodes(e,t){return this.request(`StartMoveByNodes`,e,t,P.startMoveByNodes)}pauseMove(e,t){return this.request(`PauseMove`,e,t,P.pauseMove)}resumeMove(e,t){return this.request(`ResumeMove`,e,t,P.resumeMove)}endMove(e,t){return this.request(`EndMove`,e,t,P.endMove)}restoreMove(e,t){return this.request(`RestoreMove`,e,t,P.restoreMove)}rotate(e,t){return e.rotate.ePSGType=b.EPSGType.EPSGWorld,this.request(`StartRotate`,e,t,P.rotate)}endRotate(e,t){return this.request(`EndRotate`,e,t,P.endRotate)}continuedRotate(e,t){return e.rotate.ePSGType=b.EPSGType.EPSGWorld,this.request(`ContinuedRotate`,e,t,P.continuedRotate)}rotateByTarget(e,t){return this.request(`RotateByTarget`,e,t,P.rotateByTarget)}restoreRotate(e,t){return this.request(`RestoreRotate`,e,t,P.restoreRotate)}setScale(e,t){e.scale.ePSGType=b.EPSGType.EPSGWorld;let n={...e,id:e.id.trim()};return n.scale&&(n.scale.ePSGType=`0000`),this.request(`SetScale`,n,t,P.setScale)}endScale(e,t){return this.request(`EndScale`,e,t,P.endScale)}restoreScale(e,t){return this.request(`RestoreScale`,e,t,P.restoreScale)}},Dt=class extends y{constructor(e,t){super(e,`NavigationService`,t)}startNav(e,t){let n={...e,scale:e.scale??new x(1,1,1)};return n.scale&&(n.scale.ePSGType=`0000`),this.request(`PlayMeshNavByNodes`,n,t,z.startNav)}getMeshNavDistance(e,t){return this.request(`PlayMeshNavByNodes`,e,t,z.getMeshNavDistance)}pauseNav(e,t){return this.request(`PauseMeshNav`,e,t,z.pauseNav)}resumeNav(e,t){return this.request(`ResumeMeshNav`,e,t,z.resumeNav)}stopNav(e,t){return this.request(`StopMeshNav`,e,t,z.resumeNav)}updateNav(e,t){return this.request(`UpdateMeshNavProperty`,e,t,z.updateNav)}updateSpeed(e,t){return this.request(`UpdateNavSpeed`,e,t,z.updateSpeed)}startNavByPath(e,t){return this.request(`StartNavByPath`,e,t,z.startNavByPath)}pauseNavPath(e,t){return this.request(`PauseNavPath`,e,t,z.pauseNavPath)}resumeNavPath(e,t){return this.request(`ResumeNavPath`,e,t,z.resumeNavPath)}stopNavPath(e,t){return this.request(`StopNavPath`,e,t,z.stopNavPath)}updateNavPath(e,t){return this.request(`UpdateNavPathProperty`,e,t,z.updateNavPath)}},Ot=class extends y{constructor(e,t){super(e,`PathPatrolService`,t)}add(e,t){return e.scale&&(e.scale.ePSGType=b.EPSGType.EPSGWorld),this.requestStream(`AddPath`,e,t,R.add)}update(e,t){return this.request(`UpdatePath`,e,t,R.update)}setTimeNode(e,t){return this.request(`CuriserTimeSet`,e,t,R.setTimeNode)}clear(e){return this.request(`ClearPath`,void 0,e,R.clear)}pause(e,t){return this.request(`Pause`,e,t,R.node)}resume(e,t){return this.request(`Resume`,e,t,R.node)}stop(e,t){return this.request(`Stop`,e,t,R.node)}};function kt(e){return Array.isArray(e)?{ids:e}:e}function At(e){return Array.isArray(e)?{codes:e}:e}var jt=class extends y{constructor(e,t){super(e,`PointIcon`,t)}show(e,t){return this.request(`Show`,kt(e),t,j.show)}hide(e,t){return this.request(`Hide`,kt(e),t,j.hide)}showByCode(e,t){return this.request(`ShowByCode`,At(e),t,j.showByCode)}hideByCode(e,t){return this.request(`HideByCode`,At(e),t,j.hideByCode)}showByGroup(e,t){return this.request(`ShowByGroup`,kt(e),t,j.showByGroup)}hideByGroup(e,t){return this.request(`HideByGroup`,kt(e),t,j.hideByGroup)}showAll(e){return this.request(`ShowAll`,void 0,e,j.showAll)}hideAll(e){return this.request(`HideAll`,void 0,e,j.hideAll)}},Mt=class{static getUUID(e=11){let t=16,n=`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz`.split(``),r=[],i;if(t||=n.length,e)for(i=0;i<e;i++)r[i]=n[0|Math.random()*t];else{let e;for(r[8]=r[13]=r[18]=r[23]=`-`,r[14]=`4`,i=0;i<36;i++)r[i]||(e=0|Math.random()*16,r[i]=n[i==19?e&3|8:e])}return`U`+r.join(``)}static warn(e,t=!1){console.log(`warn`,e,t);let n=document.createElement(`div`);return n.innerHTML=e,document.body.appendChild(n),n.setAttribute(`id`,`engineWarnTips`),n.style.cssText=`
|
|
2
2
|
pointer-events: none;
|
|
3
3
|
padding: 10px 40px;
|
|
4
4
|
letter-spacing: 1px;
|
|
@@ -34,7 +34,7 @@ import{EventEmitter as e,LogLevel as t,Logger as n}from"@epicgames-ps/lib-pixels
|
|
|
34
34
|
color: rgb(255, 255, 255);
|
|
35
35
|
box-shadow: 0 4px 12px rgba(0,0,0,0.15);
|
|
36
36
|
z-index:999;
|
|
37
|
-
`,n.style.left=`calc(50vw - ${n.offsetWidth/2}px)`,n.style.left=`calc( - ${n.offsetWidth/2}px+50vw)`,n.style.transition=`top 250ms ease-out`,n.style.top=`440px`,t||window.setTimeout(()=>{document.body.removeChild(n)},15e3),n}static removeLoadingTokenWillExpireDiv(){let e=document.getElementById(`TokenWillExpireTips`);e&&document.body.removeChild(e)}static stopEvents(e){e.preventDefault&&e.preventDefault(),e.stopPropagation&&e.stopPropagation()}static degToRad(e){return e*Math.PI/180}static WGS84ToMercator(e,t){let n=e*20037508.34/180,r=Math.log(Math.tan((90+t)*Math.PI/360))/(Math.PI/180);return r=r*20037508.34/180,{x:n,y:r}}static MercatorToWGS84(e,t){let n=e/20037508.34*180,r=t/20037508.34*180;return r=180/Math.PI*(2*Math.atan(Math.exp(r*Math.PI/180))-Math.PI/2),{x:n,y:r}}static isPC(){let e=navigator.userAgent,t=[`Android`,`iPhone`,`SymbianOS`,`Windows Phone`,`iPad`,`iPod`],n=!0;for(let r=0;r<t.length;r++)if(e.indexOf(t[r])>0){n=!1;break}return n}static getTotalPage(e,t=50){let n=0,r=e/t;return n=e/t>parseInt(r+``)?parseInt(r+``)+1:parseInt(r+``),n}static{this.isEmpty=e=>e===null||e===``||e===void 0||e.length===0}static getValueOrDefault(e,t,n){return e[t]==null?e[t]=n:e[t]}static dynamicAddCrossAccess(){let e=document.head||document.getElementsByTagName(`head`)[0];function t(){let e=document.getElementsByTagName(`meta`);for(let t=0;t<e.length;t++)if(e[t].getAttribute(`http-equiv`)===`Access-Control-Allow-Origin`&&e[t].getAttribute(`content`)===`*`)return!0;return!1}if(!t()){let t=document.createElement(`meta`);t.setAttribute(`http-equiv`,`Access-Control-Allow-Origin`),t.setAttribute(`content`,`*`),e.appendChild(t)}}static GetAxios(e,t,n){i.defaults.headers.common[`content-Type`]=`application/json;charset=UTF-8`,i.get(e,n).then(function(e){t&&t(e)}).catch(function(e){e.response||(e.request?console.log(e.request):console.error(`Error`,e.message))})}static IsValidHexColor(e){return e=e.replace(/^#/,``),e.length!==3&&e.length!==6?!1:/^[0-9A-Fa-f]{3}$|^[0-9A-Fa-f]{6}$/.test(e)}static calculatePercentage(e,t){return(e/t*100).toFixed(2)}static getCurrentTimeFormatted(){let e=new Date;return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,`0`)}-${String(e.getDate()).padStart(2,`0`)} ${String(e.getHours()).padStart(2,`0`)}:${String(e.getMinutes()).padStart(2,`0`)}:${String(e.getSeconds()).padStart(2,`0`)}`}static CalTimeDifferToHHMMSS(e){Math.floor(e/864e5);let t=e%864e5,n=Math.floor(t/36e5).toString().padStart(2,`0`),r=t%36e5,i=Math.floor(r/6e4).toString().padStart(2,`0`),a=r%6e4;return`${n}:${i}:${Math.round(a/1e3).toString().padStart(2,`0`)}`}static isNumeric(e){return!isNaN(parseFloat(e))&&!isNaN(e)}},Nt=class{constructor(e){this.pops={},this.def=`VEC_POP`,this.maxShowDistance=2e4,this.syncPopsHandler=e=>{this.SyncPops(e)},this.started=!1,this.dtcEngine=e,this.hostElement=e.getEngineConfig().dom,this.start()}start(){this.started||=(this.dtcEngine.on(`SyncPops`,this.syncPopsHandler),!0)}dispose(){this.started&&=(this.dtcEngine.off(`SyncPops`,this.syncPopsHandler),!1)}SyncPops(e){let t=JSON.parse(e.param??`[]`);Object.keys(this.pops).length!=0&&t.forEach(e=>{if(this.pops[e.groupName]&&this.pops[e.groupName][e.id]){let t=this.pops[e.groupName][e.id];t!=null&&(t.visible&&e.visible&&e.distance<this.maxShowDistance?t.showOnly(e.x,e.y,e.distance):t.disableOnly())}})}Set(e,t){e??=this.def,this.pops[e]||(this.pops[e]={}),t?.forEach(t=>{this.pops[e][t.id]||(this.pops[e][t.id]=t)})}RemovePop(e,t){e??=this.def,this.pops[e]&&(t==null?(Object.keys(this.pops[e]).map(t=>{if(this.pops[e]&&this.pops[e][t]){let n=this.pops[e][t];n&&n.dispose()}}),delete this.pops[e]):t.forEach(t=>{if(this.pops[e]&&this.pops[e][t]){let n=this.pops[e][t];n&&(n.dispose(),delete this.pops[e][t])}}))}RemoveAll(){Object.keys(this.pops).map(e=>{Object.keys(this.pops[e]).map(t=>{let n=this.pops[e][t];n&&n.dispose()}),delete this.pops[e]})}Switch(e,t,n){t??=this.def,this.pops[t]&&(n?n.forEach(n=>{let r=this.pops[t][n];r!=null&&(e?r.show():r.disable(),r.visible=e)}):Object.keys(this.pops[t]).forEach(n=>{let r=this.pops[t][n];r!=null&&(e?r.show():r.disable(),r.visible=e)}))}SwitchAll(e){Object.keys(this.pops).forEach(t=>{Object.keys(this.pops[t]).forEach(n=>{let r=this.pops[t][n];r!=null&&(e?r.show():r.disable())})})}SendNeedSyncPopsInfo(){let e=[];return Object.keys(this.pops).forEach(t=>{Object.keys(this.pops[t]).forEach(n=>{let r=this.pops[t][n];r.visible&&e.push({groupName:t,id:r.id,parentId:r.parentId,position:r.position})})}),e}},Pt=class{constructor(e,t,n,r,i,a,o=0,s=0){this.id=t,this.parentId=a,this.div=n,this.position=i,this.offSetX=o,this.offSetY=s,this.outDistance=!1,this.visible=r??!0,this.videoDom=e,this.div&&(this.div.style.left=`-9999px`,this.div.style.top=`-9999px`,this.videoDom.appendChild(this.div))}showOnly(e,t,n){let r=this.videoDom.getBoundingClientRect(),i=r.left,a=r.top,o=this.offSetY;this.div.style.left=e+this.offSetX+i+`px`,this.div.style.top=t+o+a+`px`,this.div.style.display=`block`,this.div.style.position=`absolute`}disableOnly(){this.div.style.left=`-9999px`,this.div.style.top=`-9999px`,this.div.style.display=`none`}show(e,t){this.visible=!0,this.showOnly(e,t)}disable(){this.visible=!1,this.disableOnly()}dispose(){this.videoDom.contains(this.div)&&this.videoDom.removeChild(this.div)}},Ft=class extends y{constructor(e,t,n){super(e,`WebPopService`,n),this.popupManager=t}addPop(e,t){let n=(e.popInfo??[]).map(e=>{let t=Mt.getValueOrDefault(e,`offSetX`,0),n=Mt.getValueOrDefault(e,`offSetY`,0);return new Pt(this.popupManager.hostElement,e.id,e.div,e.visible,e.position,e.parentId,t,n)});return this.popupManager.Set(e.groupName,n),this.request(`SynPopsInfo`,this.popupManager.SendNeedSyncPopsInfo(),t,Ze.addPop)}removePop(e={},t){return this.popupManager.RemovePop(e.groupName,e.ids),this.request(`SynPopsInfo`,this.popupManager.SendNeedSyncPopsInfo(),t,Ze.removePop)}removeAll(e){return this.popupManager.RemoveAll(),this.request(`SynPopsInfo`,this.popupManager.SendNeedSyncPopsInfo(),e,Ze.removeAll)}show(e,t){let n=Mt.getValueOrDefault(e,`show`,!0);return this.popupManager.Switch(n,e.groupName,e.ids),this.request(`SynPopsInfo`,this.popupManager.SendNeedSyncPopsInfo(),t,Ze.show)}showAll(e=!0,t){return this.popupManager.SwitchAll(e),this.request(`SynPopsInfo`,this.popupManager.SendNeedSyncPopsInfo(),t,Ze.showAll)}setPopDelayFrame(e,t){return this.request(`SetPopDelayFrame`,e,t,Ze.setPopDelayFrame)}setPopShowDistance(e){if(e==null||typeof e!=`number`){console.log(`请检查传入参数,参见接口说明`);return}this.popupManager.maxShowDistance=e}},It=class extends y{constructor(e,t){super(e,`WebScreenService`,t)}setSceneRenderBitrate(e={},t){let n=typeof e.bitrate==`number`?{bitrate:e.bitrate}:{bitrate:be[f(et.setSceneRenderBitrate,e,this.moduleName,`SetSceneRenderBitrate`).bitrate??C.High]};return this.request(`SetSceneRenderBitrate`,n,t,et.setSceneRenderBitrateResolved)}setSceneFPS(e={},t){let n={fps:e.fps??150};return this.request(`SetSceneRenderFPS`,n,t,et.setSceneFPS)}setScreenResolution(e={},t){let n={width:e.width??1920,height:e.height??1080};return this.request(`SetScreenResolution`,n,t,et.setScreenResolution)}},Lt=class extends y{constructor(e,t){super(e,`Scene`,t)}getAllSceneName(e){return this.request(`getAllSceneName`,void 0,e,He.getAllSceneName)}switchSceneByName(e,t){return this.request(`switchSceneByName`,e,t,He.switchSceneByName)}getCurrentSceneName(e){return this.request(`getCurrentSceneName`,void 0,e,He.getCurrentSceneName)}listenMapCompass(e,t){return this.request(`listenMapCompass`,e,t,He.listenMapCompass)}setFeatureToggle(e,t){return this.request(`setFeatureToggle`,e,t,He.setFeatureToggle)}getSceneMeta(e){return this.request(`getSceneMeta`,void 0,e,A)}},Rt=class extends y{constructor(e,t){super(e,`SpatialQueryService`,t)}layerQueryByModel(e,t){let n={...e,queryRadius:e.queryRadius||50,queryMinHeight:e.queryMinHeight||0,queryMaxHeight:e.queryMaxHeight||20,queryParentIds:e.queryParentIds||[]};return n.id===void 0?(Mt.warn(`操作失败:id不能为空`),Promise.reject(`id is empty`)):this.request(`LayerQueryByModel`,n,t,dt.layerQueryByModel)}layerQueryByPosition(e,t){let n={...e,queryRadius:e.queryRadius||20,queryMinHeight:e.queryMinHeight||0,queryMaxHeight:e.queryMaxHeight||20,queryParentIds:e.queryParentIds||[]};return n.queryPosition===void 0?(Mt.warn(`操作失败:queryPosition不能为空`),Promise.reject(`queryPosition is empty`)):this.request(`LayerQueryByPosition`,n,t,dt.layerQueryByPosition)}layerQueryByModelBox(e,t){let n={...e,queryParentIds:e.queryParentIds||[]};return n.id===void 0?(Mt.warn(`操作失败:id不能为空`),Promise.reject(`id is empty`)):n.queryParentIds.length?this.request(`LayerQueryByModelCollider`,n,t,dt.layerQueryByModelBox):(Mt.warn(`操作失败:queryParentIds不能为空`),Promise.reject(`queryParentIds is empty`))}},zt=class extends y{constructor(e,t){super(e,`TimeLineService`,t)}play(e,t){let n={...e,speed:e.speed??1,initialTime:e.initialTime??0,keepLastFrame:e.keepLastFrame??!1};return this.requestStream(`Play`,n,t,$e.play)}pause(e,t){return this.request(`Pause`,e,t,$e.pause)}resume(e,t){return this.request(`Resume`,e,t,$e.resume)}stop(e,t){let n={...e,resetTime:e.resetTime??-1,isCameraToStart:e.isCameraToStart??!1};return this.request(`Stop`,n,t,$e.stop)}stopAll(e){return this.request(`StopAll`,void 0,e,$e.stopAll??A)}setSpeed(e,t){return this.request(`SetSpeed`,e,t,$e.setSpeed)}},Bt=class extends y{constructor(e,t){super(e,`TrainService`,t),this.camera=new gt(e,t)}startTrain(e,t){let n={...e,direction:e.direction??`0`,action:e.action??`1`,stopTime:e.stopTime??180,moveType:e.moveType??`StopAtTheEnd`};return this.request(`SetTrainStart`,n,t,ft.startTrain)}setTrainBehavior(e,t){let n={...e,moveType:e.moveType??`StopAtTheEnd`};return this.request(`SetTrainFollowBehavior`,n,t,ft.setTrainBehavior)}setCameraFollowTrain(e,t){let n=e.offSet??new x(-100,0,30),r=new x(n.x,n.y,n.z,`0000`);return this.camera.startCameraObjFollow({parentId:e.parentId,id:e.id,offSet:r},t)}setTrainVolume(e,t){let n={...e,volumeOn:e.volumeOn??!0};return this.request(`SetTrainVolume`,n,t,ft.setTrainVolume)}cancelCameraFollowTrain(e){return this.camera.endCameraObjFollow(e)}},Vt=class extends y{constructor(e,t){super(e,`UIPOI`,t)}add(e,t){return this.request(`add`,e,t,L.add)}deleteById(e,t){return this.request(`deleteById`,e,t,L.deleteById)}deleteByGroup(e,t){return this.request(`deleteByGroup`,e,t,L.deleteByGroup)}update(e,t){return this.request(`update`,e,t,L.update)}updatePopStates(e,t){return this.request(`updatePopStates`,e,t,L.updatePopStates)}enableOverlap(e,t){let n={...e,enable:e.enable??!0};return this.request(`enableOverlap`,n,t,L.enableOverlap)}showDistance(e,t){return this.request(`showDistance`,e,t,L.showDistance)}},Ht=class extends y{constructor(e,t){super(e,`WebViewService`,t)}updateWebView(e,t){let n={...e};return this.request(`UpdateWebView`,n,t,ot.updateWebView)}},Ut=class extends y{constructor(e,t){super(e,`WeathersService`,t)}changeWeatherType(e,t){return this.request(`ChangeWeatherType`,e,t,I.changeWeatherType)}getWeatherTypes(e){return this.request(`GetWeatherTypes`,void 0,e,A)}resetWeather(e){return this.request(`ResetWeather`,void 0,e,A)}setSceneTime(e,t){let n={...e,timeDuration:e.timeDuration??5};return this.request(`SetCurrentSceneTime`,n,t,I.setSceneTime)}setTimeSync(e,t){let n={...e,syncSystemTime:e.syncSystemTime??!1};return this.request(`SetTimeSync`,n,t,I.setTimeSync)}resetSceneTime(e){return this.request(`ResetSceneTime`,{},e,I.resetSceneTime)}setAnimateTimeOfDay(e,t){let n={...e,isAnimate:e.isAnimate??!0,dayLength:e.dayLength??.5,nightLength:e.nightLength??.5};return this.request(`SetAnimateTimeOfDay`,n,t,I.setAnimateTimeOfDay)}resetWeatherAndTime(e){return this.request(`ResetWeatherAndTime`,void 0,e,A)}changeSeason(e,t){return this.request(`ChangeSeason`,e,t,I.changeSeason)}resetSeason(e){return this.request(`ResetSeason`,{},e,I.resetSeason)}setDayAndNight(e,t){return this.request(`setDayAndNight`,e,t,I.setDayAndNight)}openCameraFog(e,t){let n={...e,fogIntensity:e.fogIntensity??-1,fogStartDistance:e.fogStartDistance??-1,fogEndDistance:e.fogEndDistance??-1,directionalIntensity:e.directionalIntensity??-1,directionalFallOff:e.directionalFallOff??-1};return this.request(`openCameraFog`,n,t,I.openCameraFog)}closeCameraFog(e){return this.request(`closeCameraFog`,void 0,e,I.closeCameraFog??A)}};const Wt={Connect:e=>new _t(e.bridge,e.connectionLifecycle,{logger:e.createLogger(`Connect`)}),Type:()=>new St,Screen:e=>new It(e.bridge,{logger:e.createLogger(`Screen`)}),Dlss:e=>new vt(e.bridge,{logger:e.createLogger(`Dlss`)}),Camera:e=>new gt(e.bridge,{logger:e.createLogger(`Camera`)}),Scene:e=>new Lt(e.bridge,{logger:e.createLogger(`Scene`)}),Layer:e=>new Ct(e.bridge,{logger:e.createLogger(`Layer`)}),Model:e=>new wt(e.bridge,{logger:e.createLogger(`Model`)}),UIPOI:e=>new Vt(e.bridge,{logger:e.createLogger(`UIPOI`)}),ModelPOI:e=>new Tt(e.bridge,{logger:e.createLogger(`ModelPOI`)}),ModelTransform:e=>new Et(e.bridge,{logger:e.createLogger(`ModelTransform`)}),Navigation:e=>new Dt(e.bridge,{logger:e.createLogger(`Navigation`)}),PathPatrol:e=>new Ot(e.bridge,{logger:e.createLogger(`PathPatrol`)}),pointIcon:e=>new jt(e.bridge,{logger:e.createLogger(`pointIcon`)}),HeatMap:e=>new yt(e.bridge,{logger:e.createLogger(`HeatMap`)}),HighlighterEffect:e=>new bt(e.bridge,{logger:e.createLogger(`HighlighterEffect`)}),Popup:e=>new Ft(e.bridge,e.popupManager,{logger:e.createLogger(`Popup`)}),Animation:e=>new ht(e.bridge,{logger:e.createLogger(`Animation`)}),TimeLine:e=>new zt(e.bridge,{logger:e.createLogger(`TimeLine`)}),WeatherSystem:e=>new Ut(e.bridge,{logger:e.createLogger(`WeatherSystem`)}),WebView:e=>new Ht(e.bridge,{logger:e.createLogger(`WebView`)}),SpatialQuery:e=>new Rt(e.bridge,{logger:e.createLogger(`SpatialQuery`)}),TrainSimulate:e=>new Bt(e.bridge,{logger:e.createLogger(`TrainSimulate`)})},B=Object.freeze(Object.keys(Wt)),V=[`DTCEngine 已完成鉴权并建立 WebRTC 连接`],H=`Promise<ApiResponseEnvelope<unknown>>`,Gt={Connect:{title:`连接控制`,description:`连接控制 API。`,capabilities:[`连接建立`,`连接断开`,`连接重连`,`会话接管`,`会话保活`,`服务状态查询`],methods:{connect:{description:"发起连接(兼容接口,SDK 实际已在 `new DTCEngine` 后自动连接)。",payloadType:``,returnType:H,sideEffects:[`connection`],preconditions:V,examples:[{}],riskLevel:`low`,responseMode:`single`},disconnect:{description:`断开连接。`,payloadType:``,returnType:H,sideEffects:[`connection`],preconditions:V,examples:[{}],riskLevel:`low`,responseMode:`single`},reconnect:{description:`重新连接。`,payloadType:``,returnType:H,sideEffects:[`connection`],preconditions:V,examples:[{}],riskLevel:`low`,responseMode:`single`},KickOtherConnect:{description:`踢掉已存在会话并接管连接。`,payloadType:``,returnType:H,sideEffects:[`connection`],preconditions:V,examples:[{}],riskLevel:`low`,responseMode:`single`},KeepConnect:{description:`保持当前连接会话。`,payloadType:``,returnType:H,sideEffects:[`connection`],preconditions:V,examples:[{}],riskLevel:`low`,responseMode:`single`},GetEngineServiceStatus:{description:`获取引擎服务状态。`,payloadType:``,returnType:H,sideEffects:[`read`],preconditions:V,examples:[{}],riskLevel:`low`,responseMode:`single`}}},Type:{title:`数学类型`,description:`SDK 数学类型构造器。`,capabilities:[`二维向量类型`,`三维向量类型`,`四维向量类型`,`坐标参数构造`],methods:{}},Screen:{title:`画面质量控制`,description:`屏幕与渲染质量控制 API。`,capabilities:[`渲染码率调整`,`场景帧率调整`,`屏幕分辨率调整`],methods:{setSceneRenderBitrate:{description:`设置场景渲染码率档位。`,payloadType:`ScreenSetSceneRenderBitrateRequest | { bitrate: number }`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{bitrate:`high`}],riskLevel:`low`,responseMode:`single`},setSceneFPS:{description:`设置场景帧率。`,payloadType:`ScreenSetSceneFPSRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{fps:30}],riskLevel:`low`,responseMode:`single`},setScreenResolution:{description:`设置渲染分辨率。`,payloadType:`ScreenSetScreenResolutionRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{width:1280,height:720}],riskLevel:`low`,responseMode:`single`}}},Dlss:{title:`DLSS 画质控制`,description:`DLSS 画质控制 API。`,capabilities:[`DLSS 开关控制`,`DLSS 质量档位控制`],methods:{setDlss:{description:`同时设置 DLSS 开关和质量档位。`,payloadType:`DlssSetEnableRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{enable:!0,quality:`Balanced`}],riskLevel:`low`,responseMode:`single`}}},Camera:{title:`相机控制`,description:`相机相关操作 API。`,capabilities:[`模型视角定位`,`批量目标定位`,`自由飞行`,`路径飞行`,`飞行控制`,`相机信息查询`,`相机姿态设置`,`视场角控制`,`相机重置`,`相机跟随控制`],methods:{lookAt:{description:`定位到指定模型对象或对象集合。`,payloadType:`CameraLookAtRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{parentId:`test`,id:`Sphere`,time:2}],riskLevel:`low`,responseMode:`single`},flyToTarget:{description:`相机飞向指定坐标点,并在飞行过程中看向目标点。`,payloadType:`CameraFlyToTargetRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{point:{x:120.1704,y:30.2472,z:148.1303,ePSGType:`0000`},target:{x:120.1691,y:30.2471,z:65.7,ePSGType:`0000`},time:2}],riskLevel:`low`,responseMode:`single`},flyByPath:{description:`按多点路径执行相机飞行。`,payloadType:`CameraFlyByPathRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{points:[{x:0,y:0,z:100},{x:100,y:0,z:100}],lookAts:[{x:0,y:0,z:0},{x:100,y:0,z:0}],time:6,smoothMode:0}],riskLevel:`low`,responseMode:`single`},setFlySpeed:{description:`设置相机飞行速度。`,payloadType:`CameraSetFlySpeedRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{speed:2}],riskLevel:`low`,responseMode:`single`},endFly:{description:`终止当前飞行。`,payloadType:``,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{}],riskLevel:`low`,responseMode:`single`},pauseFly:{description:`暂停当前飞行。`,payloadType:``,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{}],riskLevel:`low`,responseMode:`single`},resumeFly:{description:`恢复当前飞行。`,payloadType:``,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{}],riskLevel:`low`,responseMode:`single`},getCameraInfo:{description:`获取当前相机信息。`,payloadType:``,returnType:H,sideEffects:[`read`],preconditions:V,examples:[{}],riskLevel:`low`,responseMode:`single`},setCameraPositionAndRotation:{description:`设置相机位置与旋转。`,payloadType:`CameraSetPositionAndRotationRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{point:{x:0,y:0,z:100,ePSGType:`0000`},rotation:{x:0,y:0,z:0,ePSGType:`0000`}}],riskLevel:`low`,responseMode:`single`},setCameraFov:{description:`设置相机 FOV。`,payloadType:`CameraSetFovRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{fov:75}],riskLevel:`low`,responseMode:`single`},resetCameraFov:{description:`重置相机 FOV。`,payloadType:``,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{}],riskLevel:`low`,responseMode:`single`},reset:{description:`重置相机到默认状态。`,payloadType:``,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{}],riskLevel:`low`,responseMode:`single`},startCameraObjFollow:{description:`相机跟随场景中运动的对象。`,payloadType:`CameraObjFollowRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{id:`myCar`,offSet:{x:0,y:3,z:5,ePSGType:`0000`},smooth:.85}],riskLevel:`low`,responseMode:`single`},endCameraObjFollow:{description:`停止相机跟随。`,payloadType:``,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{}],riskLevel:`low`,responseMode:`single`}}},Scene:{title:`场景管理`,description:`场景管理 API。`,capabilities:[`场景列表查询`,`场景切换`,`当前场景查询`,`地图罗盘监听`,`场景特性开关`,`场景元数据查询`],methods:{getAllSceneName:{description:`获取当前引擎服务支持的场景名称列表。`,payloadType:``,returnType:H,sideEffects:[`read`],preconditions:V,examples:[{}],riskLevel:`low`,responseMode:`single`},switchSceneByName:{description:`按场景名称切换场景。`,payloadType:`SceneSwitchRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{sceneName:`TestScene`}],riskLevel:`low`,responseMode:`single`},getCurrentSceneName:{description:`获取当前正在运行的场景名称。`,payloadType:``,returnType:H,sideEffects:[`read`],preconditions:V,examples:[{}],riskLevel:`low`,responseMode:`single`},listenMapCompass:{description:`监听地图指北针角度变化。`,payloadType:`SceneListenCompassRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{enable:!0}],riskLevel:`low`,responseMode:`single`},setFeatureToggle:{description:`设置场景特性开关。`,payloadType:`FeatureToggleRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{key:`minimap`,enabled:!0}],riskLevel:`low`,responseMode:`single`},getSceneMeta:{description:`获取当前场景扩展元信息。`,payloadType:``,returnType:H,sideEffects:[`read`],preconditions:V,examples:[{}],riskLevel:`low`,responseMode:`single`}}},Layer:{title:`图层管理`,description:`场景图层对象管理 API。`,capabilities:[`图层添加`,`图层删除`,`图层存在性查询`,`模型图层切换`,`图层气泡显隐`,`图层模型添加`,`图层模型删除`,`图层子对象查询`],methods:{addLayer:{description:`添加对象图层组。`,payloadType:`LayerAddRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{parentId:`CameraGroup`,id:`CameraLayerModel`,layerName:`摄像机图层`,show:!0,poiEnabled:!0,type:`MODEL`}],riskLevel:`low`,responseMode:`single`},removeLayer:{description:`删除对象图层组,并清空其下所有对象。`,payloadType:`LayerSelectorRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{parentId:`CameraGroup`,id:`CameraLayerModel`}],riskLevel:`low`,responseMode:`single`},isLayerOrGroupExit:{description:`判断图层或组对象是否存在。`,payloadType:`LayerSelectorRequest`,returnType:H,sideEffects:[`read`],preconditions:V,examples:[{id:`cameraGroup`}],riskLevel:`low`,responseMode:`single`},switchModelLayer:{description:`切换模型的图层组。`,payloadType:`LayerSwitchModelRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{parentId:`cameraLayer`,ids:[`camera01`,`camera02`],toParentId:`destLayer`}],riskLevel:`low`,responseMode:`single`},showUIPop:{description:`显示或隐藏指定图层下的 UI Pop。`,payloadType:`LayerShowUIPopRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{id:`CameraLayer`,visible:!0}],riskLevel:`low`,responseMode:`single`},addModel:{description:`在指定图层下添加模型资源。`,payloadType:`LayerModelAddRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{parentId:`cameraLayer`,id:`camera01`,assetsPath:`Sphere`}],riskLevel:`low`,responseMode:`single`},addPOI:{description:`在指定图层下添加模型资源。`,payloadType:`LayerPOIAddRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{parentId:`cameraLayer`,id:`camera01`,assetsPath:`Sphere`}],riskLevel:`low`,responseMode:`single`},removeModel:{description:`删除图层下指定模型资源。`,payloadType:`LayerModelRemoveRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{parentId:`cameraLayer`,ids:[`camera01`,`camera02`]}],riskLevel:`low`,responseMode:`single`},getLayerChildElement:{description:`获取图层下所有一级子对象。`,payloadType:`LayerChildElementRequest`,returnType:H,sideEffects:[`read`],preconditions:V,examples:[{id:`test`}],riskLevel:`low`,responseMode:`single`}}},Model:{title:`模型管理`,description:`模型对象管理 API。`,capabilities:[`模型显隐控制`,`模型添加`,`模型删除`,`模型树查询`,`模型信息查询`,`模型包围盒查询`],methods:{setVisible:{description:`设置模型对象显隐状态。`,payloadType:`ModelSetVisibleRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{parentId:`cameraGroup`,id:[`camera01`,`camera02`],visible:!1}],riskLevel:`low`,responseMode:`single`},setVisibleByTags:{description:`按标签批量设置模型对象显隐状态。`,payloadType:`ModelSetVisibleByTagsRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{tags:[`camera`,`sensor`],visible:!1}],riskLevel:`low`,responseMode:`single`},setVisibleByAttibute:{description:`按对象属性过滤设置模型对象显隐状态。`,payloadType:`ModelSetVisibleByAttributeRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{attributes:{floor:`B2`},filterMode:0,visible:!1}],riskLevel:`low`,responseMode:`single`},getElementTree:{description:`获取指定节点的一层子对象树。`,payloadType:`ModelSelectorRequest`,returnType:H,sideEffects:[`read`],preconditions:V,examples:[{parentId:`test`,id:`Root`}],riskLevel:`low`,responseMode:`single`},getModelInfo:{description:`获取指定模型对象信息。`,payloadType:`ModelSelectorRequest`,returnType:H,sideEffects:[`read`],preconditions:V,examples:[{parentId:`test`,id:`Sphere`}],riskLevel:`low`,responseMode:`single`}}},UIPOI:{title:`后端 UI 气泡`,description:`后端 UI 气泡(UIPOI)管理 API。`,capabilities:[`UI 气泡添加`,`UI 气泡删除`,`UI 气泡更新`,`弹窗状态更新`,`重叠控制`,`距离显示控制`],methods:{add:{description:`批量添加 UIPOI。`,payloadType:`UIPOIAddRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{groupName:`testGroup`,poiInfos:[{id:`camera01`,state:`normal`}]}],riskLevel:`low`,responseMode:`single`},deleteById:{description:`删除指定组下的单个 UIPOI。`,payloadType:`UIPOIDeleteByIdRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{groupName:`testGroup`,id:`camera01`}],riskLevel:`low`,responseMode:`single`},deleteByGroup:{description:`删除指定组下的全部 UIPOI。`,payloadType:`UIPOIDeleteByGroupRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{groupName:`myGroup`}],riskLevel:`low`,responseMode:`single`},update:{description:`更新指定组 UIPOI 配置。`,payloadType:`UIPOIUpdateRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{groupName:`testGroup`,poiInfos:[{id:`camera01`,state:`alert`}]}],riskLevel:`low`,responseMode:`single`},updatePopStates:{description:`批量更新 UIPOI 状态。`,payloadType:`UIPOIUpdateStateRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{groupName:`LCD80CunXianShiPingPop`,popStates:[{id:`1`,state:`normal`}]}],riskLevel:`low`,responseMode:`single`},enableOverlap:{description:`开启或关闭 UIPOI 碰撞避让。`,payloadType:`UIPOIEnableOverlapRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{enable:!1}],riskLevel:`low`,responseMode:`single`},showDistance:{description:`设置 UIPOI 可视距离。`,payloadType:`UIPOIShowDistanceRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{distance:800}],riskLevel:`low`,responseMode:`single`}}},ModelPOI:{title:`模型气泡`,description:`模型气泡(ModelPOI)管理 API。`,capabilities:[`模型气泡添加`,`模型气泡删除`,`模型气泡查询`,`模型气泡更新`,`分组显隐控制`],methods:{add:{description:`添加模型气泡。`,payloadType:`ModelPOIAddRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{id:`123`,groupName:`cameraGroup`,assetPath:`dotPop`,targetId:`Camera01`}],riskLevel:`low`,responseMode:`single`},deleteById:{description:`按编号批量删除模型气泡。`,payloadType:`ModelPOIDeleteByIdRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{groupName:`cameraGroup`,ids:[`Camera01`]}],riskLevel:`low`,responseMode:`single`},deleteByGroup:{description:`删除指定组下全部模型气泡。`,payloadType:`ModelPOIDeleteByGroupRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{groupName:`myGroup`}],riskLevel:`low`,responseMode:`single`},getPOIInfo:{description:`获取单个模型气泡信息。`,payloadType:`ModelPOIGetInfoRequest`,returnType:H,sideEffects:[`read`],preconditions:V,examples:[{groupName:`cameraGroup`,id:`Camera01`}],riskLevel:`low`,responseMode:`single`},update:{description:`更新模型气泡信息。`,payloadType:`ModelPOIUpdateRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{id:`123`,groupName:`cameraGroup`,assetPath:`dotPop`,visible:!1}],riskLevel:`low`,responseMode:`single`},setVisibleByGroup:{description:`设置指定组模型气泡显隐。`,payloadType:`ModelPOIVisibleByGroupRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{groupName:`myGroup`,visible:!0}],riskLevel:`low`,responseMode:`single`}}},ModelTransform:{title:`模型变换`,description:`模型对象变换 API,涵盖旋转、缩放、移动操作。`,capabilities:[`模型轨迹移动`,`暂停/继续/结束移动`,`恢复位置`,`模型旋转`,`绕目标旋转`,`恢复旋转`,`模型缩放`,`停止缩放`,`恢复缩放`],methods:{startMoveByNodes:{description:`设置模型对象的移动轨迹。`,payloadType:`ModelTransformStartMoveRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{parentId:`test`,id:`myRobot`,nodes:[{x:120.0001,y:30.0001,z:100.1},{x:122.0001,y:28.0001,z:110.1}],speed:3,linear:1,isLookAtTarget:!0}],riskLevel:`low`,responseMode:`single`},pauseMove:{description:`暂停模型对象的移动。`,payloadType:`ModelTransformNodeRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{parentId:`test`,id:`myRobot`}],riskLevel:`low`,responseMode:`single`},resumeMove:{description:`继续模型对象的移动。`,payloadType:`ModelTransformNodeRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{parentId:`test`,id:`Camera01`}],riskLevel:`low`,responseMode:`single`},endMove:{description:`结束轨迹移动。`,payloadType:`ModelTransformNodeRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{parentId:`test`,id:`Camera01`}],riskLevel:`low`,responseMode:`single`},restoreMove:{description:`重置对象到原来的位置。`,payloadType:`ModelTransformRestoreRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{ids:[`Camera01`,`Camera02`]}],riskLevel:`low`,responseMode:`single`},rotate:{description:`指定轴旋转模型角度到。`,payloadType:`ModelTransformRotateRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{parentId:`test`,id:`myBus`,rotate:{x:30,y:180,z:120}}],riskLevel:`low`,responseMode:`single`},endRotate:{description:`结束旋转。`,payloadType:`ModelTransformNodeRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{parentId:`test`,id:`myBus`}],riskLevel:`low`,responseMode:`single`},continuedRotate:{description:`持续不断的绕自身旋转。`,payloadType:`ModelTransformRotateRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{parentId:`test`,id:`Camera01`,rotate:{x:30,y:180,z:120}}],riskLevel:`low`,responseMode:`single`},rotateByTarget:{description:`围绕某个对象做旋转。`,payloadType:`ModelTransformRotateByTargetRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{parentId:`test`,id:`Camera01`,targetID:`target`,point:{x:1,y:2,z:3},axisX:1,axisY:0,axisZ:0,angle:10,isPersistence:!0}],riskLevel:`low`,responseMode:`single`},restoreRotate:{description:`重置恢复场景多个对象的旋转。`,payloadType:`ModelTransformRestoreRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{ids:[`Camera01`,`Camera02`]}],riskLevel:`low`,responseMode:`single`},setScale:{description:`设置模型对象的缩放。`,payloadType:`ModelTransformScaleRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{parentId:`test`,id:`Camera01`,scale:{x:.5,y:.5,z:.5},duration:3}],riskLevel:`low`,responseMode:`single`},endScale:{description:`停止模型对象的缩放。`,payloadType:`ModelTransformNodeRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{parentId:`test`,id:`Camera01`}],riskLevel:`low`,responseMode:`single`},restoreScale:{description:`重置模型的缩放,恢复到开始状态。`,payloadType:`ModelTransformRestoreRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{ids:[`Camera01`,`Camera02`]}],riskLevel:`low`,responseMode:`single`}}},Navigation:{title:`对象导航`,description:`场景对象导航 API,支持两种导航模式:`,capabilities:[`网格导航寻路`,`导航距离查询`,`网格导航暂停`,`网格导航继续`,`网格导航停止`,`网格导航属性修改`,`路径导航开始`,`路径导航暂停`,`路径导航继续`,`路径导航停止`,`路径导航属性修改`],methods:{startNav:{description:`网格导航寻路:模型对象根据路过的节点进行导航。`,payloadType:`NavigationMeshNavRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{parentId:`Players`,id:`Player1`,nodes:[{x:114.7985155712282,y:34.842421780635625,z:2},{x:114.79789723105696,y:34.84218433379876,z:1.5}],isCache:!1,planColor:`#00ff00`,passColor:`#e1e1e1`}],riskLevel:`low`,responseMode:`single`},getMeshNavDistance:{description:`网格导航距离查询:模型对象根据路过的节点进行导航,并返回导航距离信息。`,payloadType:`NavigationMeshNavRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{parentId:`Players`,id:[`Player1`,`MyRobut`],nodes:[{x:114.7985155712282,y:34.842421780635625,z:2},{x:114.79789723105696,y:34.84218433379876,z:1.5}],isCache:!1,planColor:`#00ff00`,passColor:`#e1e1e1`}],riskLevel:`low`,responseMode:`single`},pauseNav:{description:`暂停模型对象网格导航。`,payloadType:`NavigationNodeRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{parentId:`Players`,id:[`Player1`,`MyRobut`]}],riskLevel:`low`,responseMode:`single`},resumeNav:{description:`继续模型对象网格导航。`,payloadType:`NavigationNodeRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{parentId:`Players`,id:[`Player1`,`MyRobut`]}],riskLevel:`low`,responseMode:`single`},stopNav:{description:`停止模型对象网格导航。`,payloadType:`NavigationNodeRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{parentId:`Players`,id:[`Player1`,`MyRobut`]}],riskLevel:`low`,responseMode:`single`},updateNav:{description:`设置网格导航路径属性。`,payloadType:`NavigationUpdateMeshNavRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{parentId:`Players`,id:`Player1`,planColor:`#00ff00`,passColor:`#e1e1e1`,speed:4}],riskLevel:`low`,responseMode:`single`},updateSpeed:{description:`设置网格导航路径属性。`,payloadType:`NavigationUpdateSpeedRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{parentId:`Players`,id:`Player1`,speed:4}],riskLevel:`low`,responseMode:`single`},startNavByPath:{description:`路径导航开始:根据指定的轨迹节点进行直线导航行走。`,payloadType:`NavigationNavByPathRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{parentId:`Players`,id:[`Player1`,`MyRobut`],nodes:[{x:114.7985155712282,y:34.842421780635625,z:2},{x:114.79789723105696,y:34.84218433379876,z:1.5}],isCache:!1,duration:10}],riskLevel:`low`,responseMode:`single`},pauseNavPath:{description:`暂停模型对象路径导航。`,payloadType:`NavigationNodeRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{parentId:`Players`,id:[`Player1`,`MyRobut`]}],riskLevel:`low`,responseMode:`single`},resumeNavPath:{description:`继续模型对象路径导航。`,payloadType:`NavigationNodeRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{parentId:`Players`,id:[`Player1`,`MyRobut`]}],riskLevel:`low`,responseMode:`single`},stopNavPath:{description:`停止模型对象路径导航。`,payloadType:`NavigationNodeRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{parentId:`Players`,id:[`Player1`,`MyRobut`]}],riskLevel:`low`,responseMode:`single`},updateNavPath:{description:`设置路径导航属性。`,payloadType:`NavigationUpdateNavPathRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{parentId:`Players`,id:[`Player1`,`MyRobut`],planColor:`#00ff00`,passColor:`#e1e1e1`,duration:5}],riskLevel:`low`,responseMode:`single`}}},PathPatrol:{title:`路径巡逻`,description:`路径巡逻 API,支持巡逻路线添加、样式修改、时间节点设置与巡逻控制。`,capabilities:[`添加巡逻路线`,`修改巡逻样式`,`设置巡逻时间节点`,`清除巡逻路径`,`暂停巡逻`,`继续巡逻`,`停止巡逻`],methods:{add:{description:`添加巡逻路线。`,payloadType:`PathPatrolAddRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{parentId:`patrolLayer`,id:`patrolMan`,assetPath:`PatrolMan`,scale:{x:2,y:2,z:2},showPath:!0,passedColor:`#ff0013`,lineColor:`#0040ef`,lineWidth:2,nodes:[{x:114.79234244388735,y:34.8353249473732,z:67.76611328125},{x:114.78552975378634,y:34.84532722646887,z:67.76627349853516}],duration:10}],riskLevel:`low`,responseMode:`stream`},update:{description:`修改巡逻路径的样式。`,payloadType:`PathPatrolUpdateRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{parentId:`patrolLayer`,id:`patrolMan`,lineColor:`#ff00ff`,lineWidth:3.5}],riskLevel:`low`,responseMode:`single`},setTimeNode:{description:`设置巡逻开始的时间节点或是节点索引。`,payloadType:`PathPatrolSetTimeNodeRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{parentId:`patrolLayer`,id:`patrolMan`,timeStart:`2025-09-10 00:05:00`}],riskLevel:`low`,responseMode:`single`},clear:{description:`清除巡逻路径。`,payloadType:``,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{}],riskLevel:`low`,responseMode:`single`},pause:{description:`暂停巡逻。`,payloadType:`PathPatrolNodeRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{id:`patrolMan`}],riskLevel:`low`,responseMode:`single`},resume:{description:`继续巡逻。`,payloadType:`PathPatrolNodeRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{id:`patrolMan`}],riskLevel:`low`,responseMode:`single`},stop:{description:`停止巡逻。`,payloadType:`PathPatrolNodeRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{id:`patrolMan`}],riskLevel:`low`,responseMode:`single`}}},pointIcon:{title:`设备点位图标`,description:`设备点位图标显隐控制 API。`,capabilities:[`指定点位显隐`,`按编码点位显隐`,`分组点位显隐`,`全部点位显隐`],methods:{show:{description:`显示指定设备点位的图标。`,payloadType:`PointIconIdsInput`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{ids:[`point-001`,`point-002`]}],riskLevel:`low`,responseMode:`single`},hide:{description:`隐藏指定设备点位的图标。`,payloadType:`PointIconIdsInput`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{ids:[`point-001`,`point-002`]}],riskLevel:`low`,responseMode:`single`},showByCode:{description:`显示指定编码(code)的全部设备点位图标,编码精确匹配且不要求唯一。`,payloadType:`PointIconCodesInput`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{codes:[`CAM-001`,`CAM-002`]}],riskLevel:`low`,responseMode:`single`},hideByCode:{description:`隐藏指定编码(code)的全部设备点位图标,编码精确匹配且不要求唯一。`,payloadType:`PointIconCodesInput`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{codes:[`CAM-001`,`CAM-002`]}],riskLevel:`low`,responseMode:`single`},showByGroup:{description:`显示指定分组及其子分组内的设备点位图标。`,payloadType:`PointIconIdsInput`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{ids:[`group-f1`]}],riskLevel:`low`,responseMode:`single`},hideByGroup:{description:`隐藏指定分组及其子分组内的设备点位图标。`,payloadType:`PointIconIdsInput`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{ids:[`group-f1`]}],riskLevel:`low`,responseMode:`single`},showAll:{description:`显示全部设备点位图标。`,payloadType:``,returnType:H,sideEffects:[`write`],preconditions:V,riskLevel:`low`,responseMode:`single`},hideAll:{description:`隐藏全部设备点位图标。`,payloadType:``,returnType:H,sideEffects:[`write`],preconditions:V,riskLevel:`low`,responseMode:`single`}}},HeatMap:{title:`热力图`,description:`热力图 API,支持热力图创建(地理热力点数据)、移除、清空与参数设置。`,capabilities:[`创建热力图`,`移除热力图`,`清除热力图`,`修改热力图参数`],methods:{create:{description:`创建热力图。`,payloadType:`HeatMapCreateRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{id:`heatMap1`,influenceSize:50,points:[{position:{x:120.15,y:30.28,z:10,ePSGType:`4326`},value:.8}]}],riskLevel:`low`,responseMode:`single`},remove:{description:`移除热力图。`,payloadType:`HeatMapRemoveRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{id:`heatMap1`}],riskLevel:`low`,responseMode:`single`},clear:{description:`清空全部热力图,无需传参。`,payloadType:``,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{}],riskLevel:`low`,responseMode:`single`},setConfig:{description:`设置热力图参数(透明度/高度缩放/颜色过渡)。`,payloadType:`HeatMapConfigRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{id:`heatMap1`,opacity:.5,heightScale:3e3,lerpScale:3}],riskLevel:`low`,responseMode:`single`}}},HighlighterEffect:{title:`高亮效果`,description:`高亮效果 API,控制场景中模型对象的高亮。`,capabilities:[`打开高亮`,`关闭高亮`,`模型高亮`,`移除模型高亮`,`清除全部高亮`],methods:{enable:{description:`打开高亮效果。`,payloadType:`HighLighterEnableRequest`,returnType:H,sideEffects:[`write`],preconditions:V,riskLevel:`low`,responseMode:`single`},setHighLightModel:{description:`设置场景当中,指定模型对象 高亮效果`,payloadType:`HighLighterSetHighLightModelRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{parentId:`test`,ids:[`Sphere`,`Sphere1`],showBack:!0}],riskLevel:`low`,responseMode:`single`},removeHighLightModel:{description:`清除 指定模型对象的高亮效果`,payloadType:`HighLighterRemoveHighLightModelRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{parentId:`test`,ids:[`Sphere`,`Sphere1`]}],riskLevel:`low`,responseMode:`single`},clear:{description:`清除场景中模型的所有的高亮效果`,payloadType:``,returnType:H,sideEffects:[`write`],preconditions:V,riskLevel:`low`,responseMode:`single`}}},Popup:{title:`前端 Popup`,description:`前端 Popup 管理 API。`,capabilities:[`Popup 添加`,`Popup 删除`,`Popup 清除`,`Popup 显隐控制`,`Popup 全部显隐控制`,`Popup 延迟帧控制`,`Popup 显示距离控制`],methods:{addPop:{description:`创建前端弹出气泡。`,payloadType:`PopupAddRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{groupName:`CameraPopGroup`,popInfo:[{id:`Camera1`,visible:!0}]}],riskLevel:`low`,responseMode:`single`},removePop:{description:`删除前端气泡。`,payloadType:`PopupRemoveRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{groupName:`cameraLayer`,ids:[`camera01`]}],riskLevel:`low`,responseMode:`single`},removeAll:{description:`清除所有前端气泡。`,payloadType:``,returnType:H,sideEffects:[`write`],preconditions:V,examples:[void 0],riskLevel:`low`,responseMode:`single`},show:{description:`显示或隐藏气泡。`,payloadType:`PopupShowRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{groupName:`CameraPopGroup`,ids:[`Camera2`],show:!1}],riskLevel:`low`,responseMode:`single`},showAll:{description:`显示或隐藏所有组下的所有气泡。`,payloadType:``,returnType:H,sideEffects:[`write`],preconditions:V,examples:[!0],riskLevel:`low`,responseMode:`single`},setPopDelayFrame:{description:`设置前端气泡同步的延迟时间。`,payloadType:`PopupDelayRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{time:.3}],riskLevel:`low`,responseMode:`single`},setPopShowDistance:{description:`设置前端页面气泡最远的显示距离(仅本地生效,不发送请求)。`,payloadType:``,returnType:H,sideEffects:[`write`],preconditions:V,examples:[2e3],riskLevel:`low`,responseMode:`single`}}},Animation:{title:`模型动画`,description:`控制模型 Animator 和循环动画。`,capabilities:[`循环动画播放`,`循环动画停止`,`Animator 播放`,`Animator 停止`,`动画速度控制`,`动画长度查询`],methods:{startLoopAnimation:{description:`播放循环动画片段。`,payloadType:`AnimationStartLoopRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{parentId:`AnimatorTest`,id:`rotateObj`,stateName:`door_open`,loopStartTime:0,loopEndTime:3,speed:1}],riskLevel:`low`,responseMode:`single`},stopLoopAnimation:{description:`停止循环动画片段。`,payloadType:`AnimationStopLoopRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{parentId:`AnimatorTest`,id:`rotateObj`}],riskLevel:`low`,responseMode:`single`},playAnimator:{description:`播放 Animator 动画片段。`,payloadType:`AnimationPlayRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{parentId:`AnimatorTest`,id:`rotateObj`,stateName:`door_open`,speed:1,startTime:0,endTime:1,isStop:!1}],riskLevel:`low`,responseMode:`single`},setAnimatorSpeed:{description:`设置 Animator 动画播放速度。`,payloadType:`AnimationSetSpeedRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{parentId:`AnimatorTest`,id:`rotateObj`,speed:1.5}],riskLevel:`low`,responseMode:`single`},getAnimationLength:{description:`获取动画片段长度。`,payloadType:`AnimationGetLengthRequest`,returnType:H,sideEffects:[`read`],preconditions:V,examples:[{parentId:`AnimatorTest`,id:`rotateObj`,stateName:`door_open`}],riskLevel:`low`,responseMode:`single`},stopAnimator:{description:`停止指定对象的 Animator 播放。`,payloadType:`AnimationStopRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{parentId:`AnimatorTest`,id:`rotateObj`}],riskLevel:`low`,responseMode:`single`}}},TimeLine:{title:`时间线动画`,description:`TimeLine 动画控制 API。`,capabilities:[`时间线播放`,`时间线暂停`,`时间线恢复`,`时间线停止`,`全部时间线停止`,`播放速度控制`],methods:{play:{description:`播放指定 TimeLine 动画。`,payloadType:`TimelinePlayRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{id:`Path1`,speed:2}],riskLevel:`low`,responseMode:`stream`},pause:{description:`暂停指定 TimeLine 动画。`,payloadType:`TimelineNodeRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{id:`Path1`}],riskLevel:`low`,responseMode:`single`},resume:{description:`继续播放指定 TimeLine 动画。`,payloadType:`TimelineNodeRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{id:`Path1`}],riskLevel:`low`,responseMode:`single`},stop:{description:`停止指定 TimeLine 动画。`,payloadType:`TimelineStopRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{id:`Path1`,resetTime:-1,isCameraToStart:!1}],riskLevel:`low`,responseMode:`single`},stopAll:{description:`停止全部 TimeLine 动画。`,payloadType:``,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{}],riskLevel:`low`,responseMode:`single`},setSpeed:{description:`设置指定 TimeLine 的播放速度。`,payloadType:`TimelineSetSpeedRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{id:`Path1`,speed:1.2}],riskLevel:`low`,responseMode:`single`}}},WeatherSystem:{title:`天气时间环境`,description:`天气与时间环境控制 API。`,capabilities:[`天气类型查询`,`天气切换`,`天气重置`,`天气时间重置`,`场景时间设置`,`时间同步控制`,`昼夜动画控制`,`昼夜模式设置`,`季节切换`,`季节重置`,`雾效开启`,`雾效关闭`],methods:{changeWeatherType:{description:`切换天气类型。`,payloadType:`WeatherTypeRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{type:0,timeDuration:60}],riskLevel:`low`,responseMode:`single`},getWeatherTypes:{description:`得到所有天气类型`,payloadType:``,returnType:H,sideEffects:[`read`],preconditions:V,examples:[{}],riskLevel:`low`,responseMode:`single`},resetWeather:{description:`重置天气`,payloadType:``,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{}],riskLevel:`low`,responseMode:`single`},setSceneTime:{description:`设置场景时间(小时)。`,payloadType:`WeatherSetSceneTimeRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{hour:10.5,timeDuration:5}],riskLevel:`low`,responseMode:`single`},setTimeSync:{description:`设置是否同步系统时间。`,payloadType:`WeatherSetTimeSyncRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{syncSystemTime:!0}],riskLevel:`low`,responseMode:`single`},resetSceneTime:{description:`重置场景时间。`,payloadType:``,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{}],riskLevel:`low`,responseMode:`single`},setAnimateTimeOfDay:{description:`设置是否模拟白天,黑夜轮换动画。`,payloadType:`WeatherSetAnimateTimeOfDayRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{isAnimate:!0,dayLength:.5,nightLength:.5}],riskLevel:`low`,responseMode:`single`},resetWeatherAndTime:{description:`场景天气和时间重置`,payloadType:``,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{}],riskLevel:`low`,responseMode:`single`},changeSeason:{description:`切换场景季节状态。`,payloadType:`WeatherChangeSeasonRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{season:1,duration:5}],riskLevel:`low`,responseMode:`single`},resetSeason:{description:`重置场景季节状态。`,payloadType:``,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{}],riskLevel:`low`,responseMode:`single`},setDayAndNight:{description:`在白天与夜晚模式之间切换。`,payloadType:`WeatherSetDayAndNightRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{dayType:`night`}],riskLevel:`low`,responseMode:`single`},openCameraFog:{description:`开启并调整相机镜头雾效。`,payloadType:`WeatherOpenCameraFogRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{fogStartDistance:20,fogEndDistance:1500,fogIntensity:.5}],riskLevel:`low`,responseMode:`single`},closeCameraFog:{description:`关闭相机镜头雾效。`,payloadType:``,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{}],riskLevel:`low`,responseMode:`single`}}},WebView:{title:`网页视图`,description:`网页视图(WebView)管理 API。`,capabilities:[`网页视图更新`],methods:{updateWebView:{description:`更新网页视图参数。`,payloadType:`WebViewUpdateRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{parentId:`WebViews`,id:`tv1`,url:`http://www.163.com`}],riskLevel:`low`,responseMode:`single`}}},SpatialQuery:{title:`空间查询`,description:`场景缓冲空间查询 API,支持三种查询方式:`,capabilities:[`模型空间查询`,`坐标空间查询`,`模型包围盒空间查询`],methods:{layerQueryByModel:{description:`模型空间查询:根据场景模型当前的位置进行空间查询。`,payloadType:`SpatialQueryLayerByModelRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{parentId:``,id:`LayerSearchCore`,queryRadius:10,queryMinHeight:0,queryMaxHeight:50,queryParentIds:[`SM_B8_XueShenSuShe`,`daoZha`]}],riskLevel:`low`,responseMode:`single`},layerQueryByPosition:{description:`坐标空间查询:根据场景坐标位置进行空间查询。`,payloadType:`SpatialQueryLayerByPositionRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{queryPosition:{x:120.40284254780221,y:30.830451474524036,z:10,ePSGType:`4326`},queryRadius:20,queryMinHeight:0,queryMaxHeight:50,queryParentIds:[`SM_B8_XueShenSuShe`,`daoZha`]}],riskLevel:`low`,responseMode:`single`},layerQueryByModelBox:{description:`模型包围盒空间查询:根据场景模型的边界框进行空间查询。`,payloadType:`SpatialQueryLayerByModelBoxRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{parentId:``,id:`LayerSearchCore`,queryParentIds:[`JianKong_QiangJiTest`,`daoZha`]}],riskLevel:`low`,responseMode:`single`}}},TrainSimulate:{title:`列车模拟`,description:`列车模拟 API,支持启动列车、设置列车运动方式与音量、相机跟随/取消跟随列车。`,capabilities:[`列车启动`,`列车运动方式设置`,`列车音量设置`,`相机跟随列车`,`取消相机跟随列车`],methods:{startTrain:{description:`设置火车的动态并启动列车。`,payloadType:`TrainSimulateStartTrainRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{parentId:`RailTrains`,id:`DTrain1`,trainCode:`G501`,startStationName:`北京`,endStationName:`上海`,direction:`0`,action:`1`,stopTime:180,moveType:`StopAtTheEnd`}],riskLevel:`low`,responseMode:`single`},setTrainBehavior:{description:`设置火车的运动方式。`,payloadType:`TrainSimulateSetTrainBehaviorRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{parentId:`RailTrains`,id:`DTrain1`,moveType:`Loop`}],riskLevel:`low`,responseMode:`single`},setCameraFollowTrain:{description:`设置相机跟随火车。`,payloadType:`TrainSimulateSetCameraFollowTrainRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{parentId:`RailTrains`,id:`DTrain1`,offSet:{x:26,y:18,z:15,ePSGType:`0000`}}],riskLevel:`low`,responseMode:`single`},setTrainVolume:{description:`设置火车的音量大小。`,payloadType:`TrainSimulateSetTrainVolumeRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{parentId:`RailTrains`,id:`DTrain1`,volume:.5}],riskLevel:`low`,responseMode:`single`},cancelCameraFollowTrain:{description:`取消相机跟随火车,无需传参。`,payloadType:``,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{}],riskLevel:`low`,responseMode:`single`}}}},Kt=e=>e instanceof r.ZodEffects?Kt(e._def.schema):e,qt=e=>{let t=Kt(e);return t instanceof r.ZodOptional||t instanceof r.ZodDefault?{schema:Kt(t._def.innerType),required:!1,description:t.description??``}:{schema:t,required:!0,description:t.description??``}},Jt=e=>qt(e).schema instanceof r.ZodUndefined,Yt=e=>{if(!(e instanceof r.ZodUnion))return;let t=e._def.options;if(!t.every(e=>e instanceof r.ZodLiteral))return;let n=t.map(e=>({value:e._def.value,...e.description?{description:e.description}:{}}));return{enumValues:n.map(e=>e.value),enumOptions:n}},Xt=e=>{let t=Yt(e);if(t)return{type:`enum`,...t};let n=`unknown`;return e instanceof r.ZodString?n=`string`:e instanceof r.ZodNumber?n=`number`:e instanceof r.ZodBoolean?n=`boolean`:e instanceof r.ZodObject?n=`object`:e instanceof r.ZodArray&&(n=`array`),{type:n}},Zt=e=>{if(Jt(e))return[];let t=qt(e).schema;return t instanceof r.ZodObject?Object.entries(t.shape).map(([e,t])=>{let{schema:n,required:r,description:i}=qt(t);return{name:e,required:r,description:i,...Xt(n)}}):[]},Qt=[`write`],$t=[`DTCEngine 已完成鉴权并建立 WebRTC 连接`],en=(e,t,n)=>{let r=e[t],i=`${n.charAt(0).toLowerCase()}${n.slice(1)}`;return r?.[n]??r?.[i]},tn=e=>e.apiModuleKeys.reduce((t,n)=>{let r=e.jsDocMetadata[n];return t[n]={moduleName:n,title:r.title,description:r.description,capabilities:r.capabilities,methods:Object.entries(r.methods).map(([t,r])=>{let i=[...r.sideEffects??Qt],a=[...r.preconditions??$t],o=r.responseMode??`single`,s=en(e.schemaMap,n,t);if(!s)throw Error(`Missing validation schema for ${n}.${t}`);let c=Jt(s)?`none`:`object`,l=c===`none`?[]:[...r.examples??[]],u=Zt(s);return{moduleName:n,methodName:t,description:r.description,sideEffects:i,preconditions:a,responseMode:o,riskLevel:r.riskLevel,schema:{payloadKind:c,fields:u,examples:l,responseMode:o}}})},t},{});function nn(e){return{moduleName:e.moduleName,methodName:e.methodName,description:e.description,sideEffects:e.sideEffects,preconditions:e.preconditions,responseMode:e.responseMode}}const rn=tn({apiModuleKeys:B,schemaMap:mt,jsDocMetadata:Gt});function an(e){return e}function on(e){return B.indexOf(e)>=0}function sn(e){return e??`all`}function cn(e,t){let n=sn(t);return n===`all`||n[e]!==void 0}function ln(e,t,n){let r=sn(n);if(r===`all`)return!0;let i=r[e];return i===!0||Array.isArray(i)&&i.indexOf(t)>=0}function un(e){return B.filter(t=>cn(t,e)).map(t=>{let n=rn[t],r=dn(t,e).length;return{moduleName:n.moduleName,title:n.title,description:n.description,capabilities:n.capabilities,methodCount:r}})}function dn(e,t){return cn(e,t)?rn[e].methods.filter(n=>ln(e,n.methodName,t)).map(e=>nn(e)):[]}function fn(e,t,n){if(ln(e,t,n))return rn[e].methods.find(e=>e.methodName===t)?.schema}function pn(e,t,n){if(!ln(e,t,n))return;let r=mt[e],i=`${t.charAt(0).toLowerCase()}${t.slice(1)}`;return r?.[t]??r?.[i]}function mn(e){return`'use strict';
|
|
37
|
+
`,n.style.left=`calc(50vw - ${n.offsetWidth/2}px)`,n.style.left=`calc( - ${n.offsetWidth/2}px+50vw)`,n.style.transition=`top 250ms ease-out`,n.style.top=`440px`,t||window.setTimeout(()=>{document.body.removeChild(n)},15e3),n}static removeLoadingTokenWillExpireDiv(){let e=document.getElementById(`TokenWillExpireTips`);e&&document.body.removeChild(e)}static stopEvents(e){e.preventDefault&&e.preventDefault(),e.stopPropagation&&e.stopPropagation()}static degToRad(e){return e*Math.PI/180}static WGS84ToMercator(e,t){let n=e*20037508.34/180,r=Math.log(Math.tan((90+t)*Math.PI/360))/(Math.PI/180);return r=r*20037508.34/180,{x:n,y:r}}static MercatorToWGS84(e,t){let n=e/20037508.34*180,r=t/20037508.34*180;return r=180/Math.PI*(2*Math.atan(Math.exp(r*Math.PI/180))-Math.PI/2),{x:n,y:r}}static isPC(){let e=navigator.userAgent,t=[`Android`,`iPhone`,`SymbianOS`,`Windows Phone`,`iPad`,`iPod`],n=!0;for(let r=0;r<t.length;r++)if(e.indexOf(t[r])>0){n=!1;break}return n}static getTotalPage(e,t=50){let n=0,r=e/t;return n=e/t>parseInt(r+``)?parseInt(r+``)+1:parseInt(r+``),n}static{this.isEmpty=e=>e===null||e===``||e===void 0||e.length===0}static getValueOrDefault(e,t,n){return e[t]==null?e[t]=n:e[t]}static dynamicAddCrossAccess(){let e=document.head||document.getElementsByTagName(`head`)[0];function t(){let e=document.getElementsByTagName(`meta`);for(let t=0;t<e.length;t++)if(e[t].getAttribute(`http-equiv`)===`Access-Control-Allow-Origin`&&e[t].getAttribute(`content`)===`*`)return!0;return!1}if(!t()){let t=document.createElement(`meta`);t.setAttribute(`http-equiv`,`Access-Control-Allow-Origin`),t.setAttribute(`content`,`*`),e.appendChild(t)}}static GetAxios(e,t,n){i.defaults.headers.common[`content-Type`]=`application/json;charset=UTF-8`,i.get(e,n).then(function(e){t&&t(e)}).catch(function(e){e.response||(e.request?console.log(e.request):console.error(`Error`,e.message))})}static IsValidHexColor(e){return e=e.replace(/^#/,``),e.length!==3&&e.length!==6?!1:/^[0-9A-Fa-f]{3}$|^[0-9A-Fa-f]{6}$/.test(e)}static calculatePercentage(e,t){return(e/t*100).toFixed(2)}static getCurrentTimeFormatted(){let e=new Date;return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,`0`)}-${String(e.getDate()).padStart(2,`0`)} ${String(e.getHours()).padStart(2,`0`)}:${String(e.getMinutes()).padStart(2,`0`)}:${String(e.getSeconds()).padStart(2,`0`)}`}static CalTimeDifferToHHMMSS(e){Math.floor(e/864e5);let t=e%864e5,n=Math.floor(t/36e5).toString().padStart(2,`0`),r=t%36e5,i=Math.floor(r/6e4).toString().padStart(2,`0`),a=r%6e4;return`${n}:${i}:${Math.round(a/1e3).toString().padStart(2,`0`)}`}static isNumeric(e){return!isNaN(parseFloat(e))&&!isNaN(e)}},Nt=class{constructor(e){this.pops={},this.def=`VEC_POP`,this.maxShowDistance=2e4,this.syncPopsHandler=e=>{this.SyncPops(e)},this.started=!1,this.dtcEngine=e,this.hostElement=e.getEngineConfig().dom,this.start()}start(){this.started||=(this.dtcEngine.on(`SyncPops`,this.syncPopsHandler),!0)}dispose(){this.started&&=(this.dtcEngine.off(`SyncPops`,this.syncPopsHandler),!1)}SyncPops(e){let t=JSON.parse(e.param??`[]`);Object.keys(this.pops).length!=0&&t.forEach(e=>{if(this.pops[e.groupName]&&this.pops[e.groupName][e.id]){let t=this.pops[e.groupName][e.id];t!=null&&(t.visible&&e.visible&&e.distance<this.maxShowDistance?t.showOnly(e.x,e.y,e.distance):t.disableOnly())}})}Set(e,t){e??=this.def,this.pops[e]||(this.pops[e]={}),t?.forEach(t=>{this.pops[e][t.id]||(this.pops[e][t.id]=t)})}RemovePop(e,t){e??=this.def,this.pops[e]&&(t==null?(Object.keys(this.pops[e]).map(t=>{if(this.pops[e]&&this.pops[e][t]){let n=this.pops[e][t];n&&n.dispose()}}),delete this.pops[e]):t.forEach(t=>{if(this.pops[e]&&this.pops[e][t]){let n=this.pops[e][t];n&&(n.dispose(),delete this.pops[e][t])}}))}RemoveAll(){Object.keys(this.pops).map(e=>{Object.keys(this.pops[e]).map(t=>{let n=this.pops[e][t];n&&n.dispose()}),delete this.pops[e]})}Switch(e,t,n){t??=this.def,this.pops[t]&&(n?n.forEach(n=>{let r=this.pops[t][n];r!=null&&(e?r.show():r.disable(),r.visible=e)}):Object.keys(this.pops[t]).forEach(n=>{let r=this.pops[t][n];r!=null&&(e?r.show():r.disable(),r.visible=e)}))}SwitchAll(e){Object.keys(this.pops).forEach(t=>{Object.keys(this.pops[t]).forEach(n=>{let r=this.pops[t][n];r!=null&&(e?r.show():r.disable())})})}SendNeedSyncPopsInfo(){let e=[];return Object.keys(this.pops).forEach(t=>{Object.keys(this.pops[t]).forEach(n=>{let r=this.pops[t][n];r.visible&&e.push({groupName:t,id:r.id,parentId:r.parentId,position:r.position})})}),e}},Pt=class{constructor(e,t,n,r,i,a,o=0,s=0){this.id=t,this.parentId=a,this.div=n,[`mousedown`,`mouseup`,`mousemove`,`click`,`dblclick`,`contextmenu`,`wheel`,`touchstart`,`touchmove`,`touchend`,`touchcancel`].forEach(e=>{this.div?.addEventListener(e,t=>{t.stopPropagation(),(e===`contextmenu`||e===`wheel`)&&t.preventDefault()})}),this.position=i,this.offSetX=o,this.offSetY=s,this.outDistance=!1,this.visible=r??!0,this.videoDom=e,this.div&&(this.div.style.userSelect=`none`,this.div.style.touchAction=`none`,this.div.style.left=`-9999px`,this.div.style.top=`-9999px`,this.videoDom.appendChild(this.div))}showOnly(e,t,n){let r=this.videoDom.getBoundingClientRect(),i=r.left,a=r.top,o=this.offSetY;this.div.style.left=e+this.offSetX+i+`px`,this.div.style.top=t+o+a+`px`,this.div.style.display=`block`,this.div.style.position=`absolute`}disableOnly(){this.div.style.left=`-9999px`,this.div.style.top=`-9999px`,this.div.style.display=`none`}show(e,t){this.visible=!0,this.showOnly(e,t)}disable(){this.visible=!1,this.disableOnly()}dispose(){this.videoDom.contains(this.div)&&this.videoDom.removeChild(this.div)}},Ft=class extends y{constructor(e,t,n){super(e,`WebPopService`,n),this.popupManager=t}addPop(e,t){let n=(e.popInfo??[]).map(e=>{let t=Mt.getValueOrDefault(e,`offSetX`,0),n=Mt.getValueOrDefault(e,`offSetY`,0);return new Pt(this.popupManager.hostElement,e.id,e.div,e.visible,e.position,e.parentId,t,n)});return this.popupManager.Set(e.groupName,n),this.request(`SynPopsInfo`,this.popupManager.SendNeedSyncPopsInfo(),t,Ze.addPop)}removePop(e={},t){return this.popupManager.RemovePop(e.groupName,e.ids),this.request(`SynPopsInfo`,this.popupManager.SendNeedSyncPopsInfo(),t,Ze.removePop)}removeAll(e){return this.popupManager.RemoveAll(),this.request(`SynPopsInfo`,this.popupManager.SendNeedSyncPopsInfo(),e,Ze.removeAll)}show(e,t){let n=Mt.getValueOrDefault(e,`show`,!0);return this.popupManager.Switch(n,e.groupName,e.ids),this.request(`SynPopsInfo`,this.popupManager.SendNeedSyncPopsInfo(),t,Ze.show)}showAll(e=!0,t){return this.popupManager.SwitchAll(e),this.request(`SynPopsInfo`,this.popupManager.SendNeedSyncPopsInfo(),t,Ze.showAll)}setPopDelayFrame(e,t){return this.request(`SetPopDelayFrame`,e,t,Ze.setPopDelayFrame)}setPopShowDistance(e){if(e==null||typeof e!=`number`){console.log(`请检查传入参数,参见接口说明`);return}this.popupManager.maxShowDistance=e}},It=class extends y{constructor(e,t){super(e,`WebScreenService`,t)}setSceneRenderBitrate(e={},t){let n=typeof e.bitrate==`number`?{bitrate:e.bitrate}:{bitrate:be[f(et.setSceneRenderBitrate,e,this.moduleName,`SetSceneRenderBitrate`).bitrate??C.High]};return this.request(`SetSceneRenderBitrate`,n,t,et.setSceneRenderBitrateResolved)}setSceneFPS(e={},t){let n={fps:e.fps??150};return this.request(`SetSceneRenderFPS`,n,t,et.setSceneFPS)}setScreenResolution(e={},t){let n={width:e.width??1920,height:e.height??1080};return this.request(`SetScreenResolution`,n,t,et.setScreenResolution)}},Lt=class extends y{constructor(e,t){super(e,`Scene`,t)}getAllSceneName(e){return this.request(`getAllSceneName`,void 0,e,He.getAllSceneName)}switchSceneByName(e,t){return this.request(`switchSceneByName`,e,t,He.switchSceneByName)}getCurrentSceneName(e){return this.request(`getCurrentSceneName`,void 0,e,He.getCurrentSceneName)}listenMapCompass(e,t){return this.request(`listenMapCompass`,e,t,He.listenMapCompass)}setFeatureToggle(e,t){return this.request(`setFeatureToggle`,e,t,He.setFeatureToggle)}getSceneMeta(e){return this.request(`getSceneMeta`,void 0,e,A)}},Rt=class extends y{constructor(e,t){super(e,`SpatialQueryService`,t)}layerQueryByModel(e,t){let n={...e,queryRadius:e.queryRadius||50,queryMinHeight:e.queryMinHeight||0,queryMaxHeight:e.queryMaxHeight||20,queryParentIds:e.queryParentIds||[]};return n.id===void 0?(Mt.warn(`操作失败:id不能为空`),Promise.reject(`id is empty`)):this.request(`LayerQueryByModel`,n,t,dt.layerQueryByModel)}layerQueryByPosition(e,t){let n={...e,queryRadius:e.queryRadius||20,queryMinHeight:e.queryMinHeight||0,queryMaxHeight:e.queryMaxHeight||20,queryParentIds:e.queryParentIds||[]};return n.queryPosition===void 0?(Mt.warn(`操作失败:queryPosition不能为空`),Promise.reject(`queryPosition is empty`)):this.request(`LayerQueryByPosition`,n,t,dt.layerQueryByPosition)}layerQueryByModelBox(e,t){let n={...e,queryParentIds:e.queryParentIds||[]};return n.id===void 0?(Mt.warn(`操作失败:id不能为空`),Promise.reject(`id is empty`)):n.queryParentIds.length?this.request(`LayerQueryByModelCollider`,n,t,dt.layerQueryByModelBox):(Mt.warn(`操作失败:queryParentIds不能为空`),Promise.reject(`queryParentIds is empty`))}},zt=class extends y{constructor(e,t){super(e,`TimeLineService`,t)}play(e,t){let n={...e,speed:e.speed??1,initialTime:e.initialTime??0,keepLastFrame:e.keepLastFrame??!1};return this.requestStream(`Play`,n,t,$e.play)}pause(e,t){return this.request(`Pause`,e,t,$e.pause)}resume(e,t){return this.request(`Resume`,e,t,$e.resume)}stop(e,t){let n={...e,resetTime:e.resetTime??-1,isCameraToStart:e.isCameraToStart??!1};return this.request(`Stop`,n,t,$e.stop)}stopAll(e){return this.request(`StopAll`,void 0,e,$e.stopAll??A)}setSpeed(e,t){return this.request(`SetSpeed`,e,t,$e.setSpeed)}},Bt=class extends y{constructor(e,t){super(e,`TrainService`,t),this.camera=new gt(e,t)}startTrain(e,t){let n={...e,direction:e.direction??`0`,action:e.action??`1`,stopTime:e.stopTime??180,moveType:e.moveType??`StopAtTheEnd`};return this.request(`SetTrainStart`,n,t,ft.startTrain)}setTrainBehavior(e,t){let n={...e,moveType:e.moveType??`StopAtTheEnd`};return this.request(`SetTrainFollowBehavior`,n,t,ft.setTrainBehavior)}setCameraFollowTrain(e,t){let n=e.offSet??new x(-100,0,30),r=new x(n.x,n.y,n.z,`0000`);return this.camera.startCameraObjFollow({parentId:e.parentId,id:e.id,offSet:r},t)}setTrainVolume(e,t){let n={...e,volumeOn:e.volumeOn??!0};return this.request(`SetTrainVolume`,n,t,ft.setTrainVolume)}cancelCameraFollowTrain(e){return this.camera.endCameraObjFollow(e)}},Vt=class extends y{constructor(e,t){super(e,`UIPOI`,t)}add(e,t){return this.request(`add`,e,t,L.add)}deleteById(e,t){return this.request(`deleteById`,e,t,L.deleteById)}deleteByGroup(e,t){return this.request(`deleteByGroup`,e,t,L.deleteByGroup)}update(e,t){return this.request(`update`,e,t,L.update)}updatePopStates(e,t){return this.request(`updatePopStates`,e,t,L.updatePopStates)}enableOverlap(e,t){let n={...e,enable:e.enable??!0};return this.request(`enableOverlap`,n,t,L.enableOverlap)}showDistance(e,t){return this.request(`showDistance`,e,t,L.showDistance)}},Ht=class extends y{constructor(e,t){super(e,`WebViewService`,t)}updateWebView(e,t){let n={...e};return this.request(`UpdateWebView`,n,t,ot.updateWebView)}},Ut=class extends y{constructor(e,t){super(e,`WeathersService`,t)}changeWeatherType(e,t){let n={weatherType:e.weatherType,timeDuration:e.timeDuration||6};return this.request(`ChangeWeatherType`,n,t,I.changeWeatherType)}getWeatherTypes(e){return this.request(`GetWeatherPresets`,void 0,e,A)}resetWeather(e){return this.request(`ResetWeather`,void 0,e,A)}setSceneTime(e,t){let n={...e,timeDuration:e.timeDuration??5};return this.request(`SetCurrentSceneTime`,n,t,I.setSceneTime)}setTimeSync(e,t){let n={...e,syncSystemTime:e.syncSystemTime??!1};return this.request(`SetTimeSync`,n,t,I.setTimeSync)}resetSceneTime(e){return this.request(`ResetSceneTime`,{},e,I.resetSceneTime)}setAnimateTimeOfDay(e,t){let n={...e,isAnimate:e.isAnimate??!0,dayLength:e.dayLength??.5,nightLength:e.nightLength??.5};return this.request(`SetAnimateTimeOfDay`,n,t,I.setAnimateTimeOfDay)}resetWeatherAndTime(e){return this.request(`ResetWeatherAndTime`,void 0,e,A)}changeSeason(e,t){return this.request(`ChangeSeason`,e,t,I.changeSeason)}resetSeason(e){return this.request(`ResetSeason`,{},e,I.resetSeason)}setDayAndNight(e,t){return this.request(`setDayAndNight`,e,t,I.setDayAndNight)}setWeatherVolume(e,t){let n={...e,volumeOn:e.volumeOn??!0};return this.request(`SetWeatherVolume`,n,t,I.setWeatherVolume)}openCameraFog(e,t){let n={...e,fogIntensity:e.fogIntensity??-1,fogStartDistance:e.fogStartDistance??-1,fogEndDistance:e.fogEndDistance??-1,directionalIntensity:e.directionalIntensity??-1,directionalFallOff:e.directionalFallOff??-1};return this.request(`openCameraFog`,n,t,I.openCameraFog)}closeCameraFog(e){return this.request(`closeCameraFog`,void 0,e,I.closeCameraFog??A)}};const Wt={Connect:e=>new _t(e.bridge,e.connectionLifecycle,{logger:e.createLogger(`Connect`)}),Type:()=>new St,Screen:e=>new It(e.bridge,{logger:e.createLogger(`Screen`)}),Dlss:e=>new vt(e.bridge,{logger:e.createLogger(`Dlss`)}),Camera:e=>new gt(e.bridge,{logger:e.createLogger(`Camera`)}),Scene:e=>new Lt(e.bridge,{logger:e.createLogger(`Scene`)}),Layer:e=>new Ct(e.bridge,{logger:e.createLogger(`Layer`)}),Model:e=>new wt(e.bridge,{logger:e.createLogger(`Model`)}),UIPOI:e=>new Vt(e.bridge,{logger:e.createLogger(`UIPOI`)}),ModelPOI:e=>new Tt(e.bridge,{logger:e.createLogger(`ModelPOI`)}),ModelTransform:e=>new Et(e.bridge,{logger:e.createLogger(`ModelTransform`)}),Navigation:e=>new Dt(e.bridge,{logger:e.createLogger(`Navigation`)}),PathPatrol:e=>new Ot(e.bridge,{logger:e.createLogger(`PathPatrol`)}),pointIcon:e=>new jt(e.bridge,{logger:e.createLogger(`pointIcon`)}),HeatMap:e=>new yt(e.bridge,{logger:e.createLogger(`HeatMap`)}),HighlighterEffect:e=>new bt(e.bridge,{logger:e.createLogger(`HighlighterEffect`)}),Popup:e=>new Ft(e.bridge,e.popupManager,{logger:e.createLogger(`Popup`)}),Animation:e=>new ht(e.bridge,{logger:e.createLogger(`Animation`)}),TimeLine:e=>new zt(e.bridge,{logger:e.createLogger(`TimeLine`)}),WeatherSystem:e=>new Ut(e.bridge,{logger:e.createLogger(`WeatherSystem`)}),WebView:e=>new Ht(e.bridge,{logger:e.createLogger(`WebView`)}),SpatialQuery:e=>new Rt(e.bridge,{logger:e.createLogger(`SpatialQuery`)}),TrainSimulate:e=>new Bt(e.bridge,{logger:e.createLogger(`TrainSimulate`)})},B=Object.freeze(Object.keys(Wt)),V=[`DTCEngine 已完成鉴权并建立 WebRTC 连接`],H=`Promise<ApiResponseEnvelope<unknown>>`,Gt={Connect:{title:`连接控制`,description:`连接控制 API。`,capabilities:[`连接建立`,`连接断开`,`连接重连`,`会话接管`,`会话保活`,`服务状态查询`],methods:{connect:{description:"发起连接(兼容接口,SDK 实际已在 `new DTCEngine` 后自动连接)。",payloadType:``,returnType:H,sideEffects:[`connection`],preconditions:V,examples:[{}],riskLevel:`low`,responseMode:`single`},disconnect:{description:`断开连接。`,payloadType:``,returnType:H,sideEffects:[`connection`],preconditions:V,examples:[{}],riskLevel:`low`,responseMode:`single`},reconnect:{description:`重新连接。`,payloadType:``,returnType:H,sideEffects:[`connection`],preconditions:V,examples:[{}],riskLevel:`low`,responseMode:`single`},KickOtherConnect:{description:`踢掉已存在会话并接管连接。`,payloadType:``,returnType:H,sideEffects:[`connection`],preconditions:V,examples:[{}],riskLevel:`low`,responseMode:`single`},KeepConnect:{description:`保持当前连接会话。`,payloadType:``,returnType:H,sideEffects:[`connection`],preconditions:V,examples:[{}],riskLevel:`low`,responseMode:`single`},GetEngineServiceStatus:{description:`获取引擎服务状态。`,payloadType:``,returnType:H,sideEffects:[`read`],preconditions:V,examples:[{}],riskLevel:`low`,responseMode:`single`}}},Type:{title:`数学类型`,description:`SDK 数学类型构造器。`,capabilities:[`二维向量类型`,`三维向量类型`,`四维向量类型`,`坐标参数构造`],methods:{}},Screen:{title:`画面质量控制`,description:`屏幕与渲染质量控制 API。`,capabilities:[`渲染码率调整`,`场景帧率调整`,`屏幕分辨率调整`],methods:{setSceneRenderBitrate:{description:`设置场景渲染码率档位。`,payloadType:`ScreenSetSceneRenderBitrateRequest | { bitrate: number }`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{bitrate:`high`}],riskLevel:`low`,responseMode:`single`},setSceneFPS:{description:`设置场景帧率。`,payloadType:`ScreenSetSceneFPSRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{fps:30}],riskLevel:`low`,responseMode:`single`},setScreenResolution:{description:`设置渲染分辨率。`,payloadType:`ScreenSetScreenResolutionRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{width:1280,height:720}],riskLevel:`low`,responseMode:`single`}}},Dlss:{title:`DLSS 画质控制`,description:`DLSS 画质控制 API。`,capabilities:[`DLSS 开关控制`,`DLSS 质量档位控制`],methods:{setDlss:{description:`同时设置 DLSS 开关和质量档位。`,payloadType:`DlssSetEnableRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{enable:!0,quality:`Balanced`}],riskLevel:`low`,responseMode:`single`}}},Camera:{title:`相机控制`,description:`相机相关操作 API。`,capabilities:[`模型视角定位`,`批量目标定位`,`自由飞行`,`路径飞行`,`飞行控制`,`相机信息查询`,`相机姿态设置`,`视场角控制`,`相机重置`,`相机跟随控制`],methods:{lookAt:{description:`定位到指定模型对象或对象集合。`,payloadType:`CameraLookAtRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{parentId:`test`,id:`Sphere`,time:2}],riskLevel:`low`,responseMode:`single`},flyToTarget:{description:`相机飞向指定坐标点,并在飞行过程中看向目标点。`,payloadType:`CameraFlyToTargetRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{point:{x:120.1704,y:30.2472,z:148.1303,ePSGType:`0000`},target:{x:120.1691,y:30.2471,z:65.7,ePSGType:`0000`},time:2}],riskLevel:`low`,responseMode:`single`},flyByPath:{description:`按多点路径执行相机飞行。`,payloadType:`CameraFlyByPathRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{points:[{x:0,y:0,z:100},{x:100,y:0,z:100}],lookAts:[{x:0,y:0,z:0},{x:100,y:0,z:0}],time:6,smoothMode:0}],riskLevel:`low`,responseMode:`single`},setFlySpeed:{description:`设置相机飞行速度。`,payloadType:`CameraSetFlySpeedRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{speed:2}],riskLevel:`low`,responseMode:`single`},endFly:{description:`终止当前飞行。`,payloadType:``,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{}],riskLevel:`low`,responseMode:`single`},pauseFly:{description:`暂停当前飞行。`,payloadType:``,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{}],riskLevel:`low`,responseMode:`single`},resumeFly:{description:`恢复当前飞行。`,payloadType:``,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{}],riskLevel:`low`,responseMode:`single`},getCameraInfo:{description:`获取当前相机信息。`,payloadType:``,returnType:H,sideEffects:[`read`],preconditions:V,examples:[{}],riskLevel:`low`,responseMode:`single`},setCameraPositionAndRotation:{description:`设置相机位置与旋转。`,payloadType:`CameraSetPositionAndRotationRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{point:{x:0,y:0,z:100,ePSGType:`0000`},rotation:{x:0,y:0,z:0,ePSGType:`0000`}}],riskLevel:`low`,responseMode:`single`},setCameraFov:{description:`设置相机 FOV。`,payloadType:`CameraSetFovRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{fov:75}],riskLevel:`low`,responseMode:`single`},resetCameraFov:{description:`重置相机 FOV。`,payloadType:``,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{}],riskLevel:`low`,responseMode:`single`},reset:{description:`重置相机到默认状态。`,payloadType:``,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{}],riskLevel:`low`,responseMode:`single`},startCameraObjFollow:{description:`相机跟随场景中运动的对象。`,payloadType:`CameraObjFollowRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{id:`myCar`,offSet:{x:0,y:3,z:5,ePSGType:`0000`},smooth:.85}],riskLevel:`low`,responseMode:`single`},endCameraObjFollow:{description:`停止相机跟随。`,payloadType:``,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{}],riskLevel:`low`,responseMode:`single`}}},Scene:{title:`场景管理`,description:`场景管理 API。`,capabilities:[`场景列表查询`,`场景切换`,`当前场景查询`,`地图罗盘监听`,`场景特性开关`,`场景元数据查询`],methods:{getAllSceneName:{description:`获取当前引擎服务支持的场景名称列表。`,payloadType:``,returnType:H,sideEffects:[`read`],preconditions:V,examples:[{}],riskLevel:`low`,responseMode:`single`},switchSceneByName:{description:`按场景名称切换场景。`,payloadType:`SceneSwitchRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{sceneName:`TestScene`}],riskLevel:`low`,responseMode:`single`},getCurrentSceneName:{description:`获取当前正在运行的场景名称。`,payloadType:``,returnType:H,sideEffects:[`read`],preconditions:V,examples:[{}],riskLevel:`low`,responseMode:`single`},listenMapCompass:{description:`监听地图指北针角度变化。`,payloadType:`SceneListenCompassRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{enable:!0}],riskLevel:`low`,responseMode:`single`},setFeatureToggle:{description:`设置场景特性开关。`,payloadType:`FeatureToggleRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{key:`minimap`,enabled:!0}],riskLevel:`low`,responseMode:`single`},getSceneMeta:{description:`获取当前场景扩展元信息。`,payloadType:``,returnType:H,sideEffects:[`read`],preconditions:V,examples:[{}],riskLevel:`low`,responseMode:`single`}}},Layer:{title:`图层管理`,description:`场景图层对象管理 API。`,capabilities:[`图层添加`,`图层删除`,`图层存在性查询`,`模型图层切换`,`图层气泡显隐`,`图层模型添加`,`图层模型删除`,`图层子对象查询`,`POI名称更新`,`POI名称重置`],methods:{addLayer:{description:`添加对象图层组。`,payloadType:`LayerAddRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{parentId:`CameraGroup`,id:`CameraLayerModel`,layerName:`摄像机图层`,show:!0,poiEnabled:!0,type:`MODEL`}],riskLevel:`low`,responseMode:`single`},removeLayer:{description:`删除对象图层组,并清空其下所有对象。`,payloadType:`LayerSelectorRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{parentId:`CameraGroup`,id:`CameraLayerModel`}],riskLevel:`low`,responseMode:`single`},isLayerOrGroupExit:{description:`判断图层或组对象是否存在。`,payloadType:`LayerSelectorRequest`,returnType:H,sideEffects:[`read`],preconditions:V,examples:[{id:`cameraGroup`}],riskLevel:`low`,responseMode:`single`},switchModelLayer:{description:`切换模型的图层组。`,payloadType:`LayerSwitchModelRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{parentId:`cameraLayer`,ids:[`camera01`,`camera02`],toParentId:`destLayer`}],riskLevel:`low`,responseMode:`single`},showUIPop:{description:`显示或隐藏指定图层下的 UI Pop。`,payloadType:`LayerShowUIPopRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{id:`CameraLayer`,visible:!0}],riskLevel:`low`,responseMode:`single`},addModel:{description:`在指定图层下添加模型资源。`,payloadType:`LayerModelAddRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{parentId:`cameraLayer`,id:`camera01`,assetsPath:`Sphere`}],riskLevel:`low`,responseMode:`single`},addPOI:{description:`在指定图层下添加模型资源。`,payloadType:`LayerPOIAddRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{parentId:`cameraLayer`,id:`camera01`,assetsPath:`Sphere`}],riskLevel:`low`,responseMode:`single`},updatePOIName:{description:`更新 POI 气泡的显示文本。`,payloadType:`LayerUpdatePOINameRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{parentId:`CameraLayerModel`,id:`camera01`,name:`一体化球击摄像机`,updateType:`update`}],riskLevel:`low`,responseMode:`single`},resetPOIName:{description:`*`,payloadType:`LayerResetPOINameRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{parentId:`CameraLayerModel`,ids:[`camera01`,`camera02`]}],riskLevel:`low`,responseMode:`single`},removeModel:{description:`删除图层下指定模型资源。`,payloadType:`LayerModelRemoveRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{parentId:`cameraLayer`,ids:[`camera01`,`camera02`]}],riskLevel:`low`,responseMode:`single`},getLayerChildElement:{description:`获取图层下所有一级子对象。`,payloadType:`LayerChildElementRequest`,returnType:H,sideEffects:[`read`],preconditions:V,examples:[{id:`test`}],riskLevel:`low`,responseMode:`single`}}},Model:{title:`模型管理`,description:`模型对象管理 API。`,capabilities:[`模型显隐控制`,`模型添加`,`模型删除`,`模型树查询`,`模型信息查询`,`模型包围盒查询`],methods:{setVisible:{description:`设置模型对象显隐状态。`,payloadType:`ModelSetVisibleRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{parentId:`cameraGroup`,id:[`camera01`,`camera02`],visible:!1}],riskLevel:`low`,responseMode:`single`},setVisibleByTags:{description:`按标签批量设置模型对象显隐状态。`,payloadType:`ModelSetVisibleByTagsRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{tags:[`camera`,`sensor`],visible:!1}],riskLevel:`low`,responseMode:`single`},setVisibleByAttibute:{description:`按对象属性过滤设置模型对象显隐状态。`,payloadType:`ModelSetVisibleByAttributeRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{attributes:{floor:`B2`},filterMode:0,visible:!1}],riskLevel:`low`,responseMode:`single`},getElementTree:{description:`获取指定节点的一层子对象树。`,payloadType:`ModelSelectorRequest`,returnType:H,sideEffects:[`read`],preconditions:V,examples:[{parentId:`test`,id:`Root`}],riskLevel:`low`,responseMode:`single`},getModelInfo:{description:`获取指定模型对象信息。`,payloadType:`ModelSelectorRequest`,returnType:H,sideEffects:[`read`],preconditions:V,examples:[{parentId:`test`,id:`Sphere`}],riskLevel:`low`,responseMode:`single`}}},UIPOI:{title:`后端 UI 气泡`,description:`后端 UI 气泡(UIPOI)管理 API。`,capabilities:[`UI 气泡添加`,`UI 气泡删除`,`UI 气泡更新`,`弹窗状态更新`,`重叠控制`,`距离显示控制`],methods:{add:{description:`批量添加 UIPOI。`,payloadType:`UIPOIAddRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{groupName:`testGroup`,poiInfos:[{id:`camera01`,state:`normal`}]}],riskLevel:`low`,responseMode:`single`},deleteById:{description:`删除指定组下的单个 UIPOI。`,payloadType:`UIPOIDeleteByIdRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{groupName:`testGroup`,id:`camera01`}],riskLevel:`low`,responseMode:`single`},deleteByGroup:{description:`删除指定组下的全部 UIPOI。`,payloadType:`UIPOIDeleteByGroupRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{groupName:`myGroup`}],riskLevel:`low`,responseMode:`single`},update:{description:`更新指定组 UIPOI 配置。`,payloadType:`UIPOIUpdateRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{groupName:`testGroup`,poiInfos:[{id:`camera01`,state:`alert`}]}],riskLevel:`low`,responseMode:`single`},updatePopStates:{description:`批量更新 UIPOI 状态。`,payloadType:`UIPOIUpdateStateRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{groupName:`LCD80CunXianShiPingPop`,popStates:[{id:`1`,state:`normal`}]}],riskLevel:`low`,responseMode:`single`},enableOverlap:{description:`开启或关闭 UIPOI 碰撞避让。`,payloadType:`UIPOIEnableOverlapRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{enable:!1}],riskLevel:`low`,responseMode:`single`},showDistance:{description:`设置 UIPOI 可视距离。`,payloadType:`UIPOIShowDistanceRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{distance:800}],riskLevel:`low`,responseMode:`single`}}},ModelPOI:{title:`模型气泡`,description:`模型气泡(ModelPOI)管理 API。`,capabilities:[`模型气泡添加`,`模型气泡删除`,`模型气泡查询`,`模型气泡更新`,`分组显隐控制`],methods:{add:{description:`添加模型气泡。`,payloadType:`ModelPOIAddRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{id:`123`,groupName:`cameraGroup`,assetPath:`dotPop`,targetId:`Camera01`}],riskLevel:`low`,responseMode:`single`},deleteById:{description:`按编号批量删除模型气泡。`,payloadType:`ModelPOIDeleteByIdRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{groupName:`cameraGroup`,ids:[`Camera01`]}],riskLevel:`low`,responseMode:`single`},deleteByGroup:{description:`删除指定组下全部模型气泡。`,payloadType:`ModelPOIDeleteByGroupRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{groupName:`myGroup`}],riskLevel:`low`,responseMode:`single`},getPOIInfo:{description:`获取单个模型气泡信息。`,payloadType:`ModelPOIGetInfoRequest`,returnType:H,sideEffects:[`read`],preconditions:V,examples:[{groupName:`cameraGroup`,id:`Camera01`}],riskLevel:`low`,responseMode:`single`},update:{description:`更新模型气泡信息。`,payloadType:`ModelPOIUpdateRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{id:`123`,groupName:`cameraGroup`,assetPath:`dotPop`,visible:!1}],riskLevel:`low`,responseMode:`single`},setVisibleByGroup:{description:`设置指定组模型气泡显隐。`,payloadType:`ModelPOIVisibleByGroupRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{groupName:`myGroup`,visible:!0}],riskLevel:`low`,responseMode:`single`}}},ModelTransform:{title:`模型变换`,description:`模型对象变换 API,涵盖旋转、缩放、移动操作。`,capabilities:[`模型轨迹移动`,`暂停/继续/结束移动`,`恢复位置`,`模型旋转`,`绕目标旋转`,`恢复旋转`,`模型缩放`,`停止缩放`,`恢复缩放`],methods:{startMoveByNodes:{description:`设置模型对象的移动轨迹。`,payloadType:`ModelTransformStartMoveRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{parentId:`test`,id:`myRobot`,nodes:[{x:120.0001,y:30.0001,z:100.1},{x:122.0001,y:28.0001,z:110.1}],speed:3,linear:1,isLookAtTarget:!0}],riskLevel:`low`,responseMode:`single`},pauseMove:{description:`暂停模型对象的移动。`,payloadType:`ModelTransformNodeRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{parentId:`test`,id:`myRobot`}],riskLevel:`low`,responseMode:`single`},resumeMove:{description:`继续模型对象的移动。`,payloadType:`ModelTransformNodeRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{parentId:`test`,id:`Camera01`}],riskLevel:`low`,responseMode:`single`},endMove:{description:`结束轨迹移动。`,payloadType:`ModelTransformNodeRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{parentId:`test`,id:`Camera01`}],riskLevel:`low`,responseMode:`single`},restoreMove:{description:`重置对象到原来的位置。`,payloadType:`ModelTransformRestoreRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{ids:[`Camera01`,`Camera02`]}],riskLevel:`low`,responseMode:`single`},rotate:{description:`指定轴旋转模型角度到。`,payloadType:`ModelTransformRotateRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{parentId:`test`,id:`myBus`,rotate:{x:30,y:180,z:120}}],riskLevel:`low`,responseMode:`single`},endRotate:{description:`结束旋转。`,payloadType:`ModelTransformNodeRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{parentId:`test`,id:`myBus`}],riskLevel:`low`,responseMode:`single`},continuedRotate:{description:`持续不断的绕自身旋转。`,payloadType:`ModelTransformRotateRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{parentId:`test`,id:`Camera01`,rotate:{x:30,y:180,z:120}}],riskLevel:`low`,responseMode:`single`},rotateByTarget:{description:`围绕某个对象做旋转。`,payloadType:`ModelTransformRotateByTargetRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{parentId:`test`,id:`Camera01`,targetID:`target`,point:{x:1,y:2,z:3},axisX:1,axisY:0,axisZ:0,angle:10,isPersistence:!0}],riskLevel:`low`,responseMode:`single`},restoreRotate:{description:`重置恢复场景多个对象的旋转。`,payloadType:`ModelTransformRestoreRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{ids:[`Camera01`,`Camera02`]}],riskLevel:`low`,responseMode:`single`},setScale:{description:`设置模型对象的缩放。`,payloadType:`ModelTransformScaleRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{parentId:`test`,id:`Camera01`,scale:{x:.5,y:.5,z:.5},duration:3}],riskLevel:`low`,responseMode:`single`},endScale:{description:`停止模型对象的缩放。`,payloadType:`ModelTransformNodeRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{parentId:`test`,id:`Camera01`}],riskLevel:`low`,responseMode:`single`},restoreScale:{description:`重置模型的缩放,恢复到开始状态。`,payloadType:`ModelTransformRestoreRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{ids:[`Camera01`,`Camera02`]}],riskLevel:`low`,responseMode:`single`}}},Navigation:{title:`对象导航`,description:`场景对象导航 API,支持两种导航模式:`,capabilities:[`网格导航寻路`,`导航距离查询`,`网格导航暂停`,`网格导航继续`,`网格导航停止`,`网格导航属性修改`,`路径导航开始`,`路径导航暂停`,`路径导航继续`,`路径导航停止`,`路径导航属性修改`],methods:{startNav:{description:`网格导航寻路:模型对象根据路过的节点进行导航。`,payloadType:`NavigationMeshNavRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{parentId:`Players`,id:`Player1`,nodes:[{x:114.7985155712282,y:34.842421780635625,z:2},{x:114.79789723105696,y:34.84218433379876,z:1.5}],isCache:!1,planColor:`#00ff00`,passColor:`#e1e1e1`}],riskLevel:`low`,responseMode:`single`},getMeshNavDistance:{description:`网格导航距离查询:模型对象根据路过的节点进行导航,并返回导航距离信息。`,payloadType:`NavigationMeshNavRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{parentId:`Players`,id:[`Player1`,`MyRobut`],nodes:[{x:114.7985155712282,y:34.842421780635625,z:2},{x:114.79789723105696,y:34.84218433379876,z:1.5}],isCache:!1,planColor:`#00ff00`,passColor:`#e1e1e1`}],riskLevel:`low`,responseMode:`single`},pauseNav:{description:`暂停模型对象网格导航。`,payloadType:`NavigationNodeRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{parentId:`Players`,id:[`Player1`,`MyRobut`]}],riskLevel:`low`,responseMode:`single`},resumeNav:{description:`继续模型对象网格导航。`,payloadType:`NavigationNodeRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{parentId:`Players`,id:[`Player1`,`MyRobut`]}],riskLevel:`low`,responseMode:`single`},stopNav:{description:`停止模型对象网格导航。`,payloadType:`NavigationNodeRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{parentId:`Players`,id:[`Player1`,`MyRobut`]}],riskLevel:`low`,responseMode:`single`},updateNav:{description:`设置网格导航路径属性。`,payloadType:`NavigationUpdateMeshNavRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{parentId:`Players`,id:`Player1`,planColor:`#00ff00`,passColor:`#e1e1e1`,speed:4}],riskLevel:`low`,responseMode:`single`},updateSpeed:{description:`设置网格导航路径属性。`,payloadType:`NavigationUpdateSpeedRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{parentId:`Players`,id:`Player1`,speed:4}],riskLevel:`low`,responseMode:`single`},startNavByPath:{description:`路径导航开始:根据指定的轨迹节点进行直线导航行走。`,payloadType:`NavigationNavByPathRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{parentId:`Players`,id:[`Player1`,`MyRobut`],nodes:[{x:114.7985155712282,y:34.842421780635625,z:2},{x:114.79789723105696,y:34.84218433379876,z:1.5}],isCache:!1,duration:10}],riskLevel:`low`,responseMode:`single`},pauseNavPath:{description:`暂停模型对象路径导航。`,payloadType:`NavigationNodeRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{parentId:`Players`,id:[`Player1`,`MyRobut`]}],riskLevel:`low`,responseMode:`single`},resumeNavPath:{description:`继续模型对象路径导航。`,payloadType:`NavigationNodeRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{parentId:`Players`,id:[`Player1`,`MyRobut`]}],riskLevel:`low`,responseMode:`single`},stopNavPath:{description:`停止模型对象路径导航。`,payloadType:`NavigationNodeRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{parentId:`Players`,id:[`Player1`,`MyRobut`]}],riskLevel:`low`,responseMode:`single`},updateNavPath:{description:`设置路径导航属性。`,payloadType:`NavigationUpdateNavPathRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{parentId:`Players`,id:[`Player1`,`MyRobut`],planColor:`#00ff00`,passColor:`#e1e1e1`,duration:5}],riskLevel:`low`,responseMode:`single`}}},PathPatrol:{title:`路径巡逻`,description:`路径巡逻 API,支持巡逻路线添加、样式修改、时间节点设置与巡逻控制。`,capabilities:[`添加巡逻路线`,`修改巡逻样式`,`设置巡逻时间节点`,`清除巡逻路径`,`暂停巡逻`,`继续巡逻`,`停止巡逻`],methods:{add:{description:`添加巡逻路线。`,payloadType:`PathPatrolAddRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{parentId:`patrolLayer`,id:`patrolMan`,assetPath:`PatrolMan`,scale:{x:2,y:2,z:2},showPath:!0,passedColor:`#ff0013`,lineColor:`#0040ef`,lineWidth:2,nodes:[{x:114.79234244388735,y:34.8353249473732,z:67.76611328125},{x:114.78552975378634,y:34.84532722646887,z:67.76627349853516}],duration:10}],riskLevel:`low`,responseMode:`stream`},update:{description:`修改巡逻路径的样式。`,payloadType:`PathPatrolUpdateRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{parentId:`patrolLayer`,id:`patrolMan`,lineColor:`#ff00ff`,lineWidth:3.5}],riskLevel:`low`,responseMode:`single`},setTimeNode:{description:`设置巡逻开始的时间节点或是节点索引。`,payloadType:`PathPatrolSetTimeNodeRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{parentId:`patrolLayer`,id:`patrolMan`,timeStart:`2025-09-10 00:05:00`}],riskLevel:`low`,responseMode:`single`},clear:{description:`清除巡逻路径。`,payloadType:``,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{}],riskLevel:`low`,responseMode:`single`},pause:{description:`暂停巡逻。`,payloadType:`PathPatrolNodeRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{id:`patrolMan`}],riskLevel:`low`,responseMode:`single`},resume:{description:`继续巡逻。`,payloadType:`PathPatrolNodeRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{id:`patrolMan`}],riskLevel:`low`,responseMode:`single`},stop:{description:`停止巡逻。`,payloadType:`PathPatrolNodeRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{id:`patrolMan`}],riskLevel:`low`,responseMode:`single`}}},pointIcon:{title:`设备点位图标`,description:`设备点位图标显隐控制 API。`,capabilities:[`指定点位显隐`,`按编码点位显隐`,`分组点位显隐`,`全部点位显隐`],methods:{show:{description:`显示指定设备点位的图标。`,payloadType:`PointIconIdsInput`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{ids:[`point-001`,`point-002`]}],riskLevel:`low`,responseMode:`single`},hide:{description:`隐藏指定设备点位的图标。`,payloadType:`PointIconIdsInput`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{ids:[`point-001`,`point-002`]}],riskLevel:`low`,responseMode:`single`},showByCode:{description:`显示指定编码(code)的全部设备点位图标,编码精确匹配且不要求唯一。`,payloadType:`PointIconCodesInput`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{codes:[`CAM-001`,`CAM-002`]}],riskLevel:`low`,responseMode:`single`},hideByCode:{description:`隐藏指定编码(code)的全部设备点位图标,编码精确匹配且不要求唯一。`,payloadType:`PointIconCodesInput`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{codes:[`CAM-001`,`CAM-002`]}],riskLevel:`low`,responseMode:`single`},showByGroup:{description:`显示指定分组及其子分组内的设备点位图标。`,payloadType:`PointIconIdsInput`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{ids:[`group-f1`]}],riskLevel:`low`,responseMode:`single`},hideByGroup:{description:`隐藏指定分组及其子分组内的设备点位图标。`,payloadType:`PointIconIdsInput`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{ids:[`group-f1`]}],riskLevel:`low`,responseMode:`single`},showAll:{description:`显示全部设备点位图标。`,payloadType:``,returnType:H,sideEffects:[`write`],preconditions:V,riskLevel:`low`,responseMode:`single`},hideAll:{description:`隐藏全部设备点位图标。`,payloadType:``,returnType:H,sideEffects:[`write`],preconditions:V,riskLevel:`low`,responseMode:`single`}}},HeatMap:{title:`热力图`,description:`热力图 API,支持热力图创建(地理热力点数据)、移除、清空与参数设置。`,capabilities:[`创建热力图`,`移除热力图`,`清除热力图`,`修改热力图参数`],methods:{create:{description:`创建热力图。`,payloadType:`HeatMapCreateRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{id:`heatMap1`,influenceSize:50,points:[{position:{x:120.15,y:30.28,z:10,ePSGType:`4326`},value:.8}]}],riskLevel:`low`,responseMode:`single`},remove:{description:`移除热力图。`,payloadType:`HeatMapRemoveRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{id:`heatMap1`}],riskLevel:`low`,responseMode:`single`},clear:{description:`清空全部热力图,无需传参。`,payloadType:``,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{}],riskLevel:`low`,responseMode:`single`},setConfig:{description:`设置热力图参数(透明度/高度缩放/颜色过渡)。`,payloadType:`HeatMapConfigRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{id:`heatMap1`,opacity:.5,heightScale:3e3,lerpScale:3}],riskLevel:`low`,responseMode:`single`}}},HighlighterEffect:{title:`高亮效果`,description:`高亮效果 API,控制场景中模型对象的高亮。`,capabilities:[`打开高亮`,`关闭高亮`,`模型高亮`,`移除模型高亮`,`清除全部高亮`],methods:{enable:{description:`打开高亮效果。`,payloadType:`HighLighterEnableRequest`,returnType:H,sideEffects:[`write`],preconditions:V,riskLevel:`low`,responseMode:`single`},setHighLightModel:{description:`设置场景当中,指定模型对象 高亮效果`,payloadType:`HighLighterSetHighLightModelRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{parentId:`test`,ids:[`Sphere`,`Sphere1`],showBack:!0}],riskLevel:`low`,responseMode:`single`},removeHighLightModel:{description:`清除 指定模型对象的高亮效果`,payloadType:`HighLighterRemoveHighLightModelRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{parentId:`test`,ids:[`Sphere`,`Sphere1`]}],riskLevel:`low`,responseMode:`single`},clear:{description:`清除场景中模型的所有的高亮效果`,payloadType:``,returnType:H,sideEffects:[`write`],preconditions:V,riskLevel:`low`,responseMode:`single`}}},Popup:{title:`前端 Popup`,description:`前端 Popup 管理 API。`,capabilities:[`Popup 添加`,`Popup 删除`,`Popup 清除`,`Popup 显隐控制`,`Popup 全部显隐控制`,`Popup 延迟帧控制`,`Popup 显示距离控制`],methods:{addPop:{description:`创建前端弹出气泡。`,payloadType:`PopupAddRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{groupName:`CameraPopGroup`,popInfo:[{id:`Camera1`,visible:!0}]}],riskLevel:`low`,responseMode:`single`},removePop:{description:`删除前端气泡。`,payloadType:`PopupRemoveRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{groupName:`cameraLayer`,ids:[`camera01`]}],riskLevel:`low`,responseMode:`single`},removeAll:{description:`清除所有前端气泡。`,payloadType:``,returnType:H,sideEffects:[`write`],preconditions:V,examples:[void 0],riskLevel:`low`,responseMode:`single`},show:{description:`显示或隐藏气泡。`,payloadType:`PopupShowRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{groupName:`CameraPopGroup`,ids:[`Camera2`],show:!1}],riskLevel:`low`,responseMode:`single`},showAll:{description:`显示或隐藏所有组下的所有气泡。`,payloadType:``,returnType:H,sideEffects:[`write`],preconditions:V,examples:[!0],riskLevel:`low`,responseMode:`single`},setPopDelayFrame:{description:`设置前端气泡同步的延迟时间。`,payloadType:`PopupDelayRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{time:.3}],riskLevel:`low`,responseMode:`single`},setPopShowDistance:{description:`设置前端页面气泡最远的显示距离(仅本地生效,不发送请求)。`,payloadType:``,returnType:H,sideEffects:[`write`],preconditions:V,examples:[2e3],riskLevel:`low`,responseMode:`single`}}},Animation:{title:`模型动画`,description:`控制模型 Animator 和循环动画。`,capabilities:[`循环动画播放`,`循环动画停止`,`Animator 播放`,`Animator 停止`,`动画速度控制`,`动画长度查询`],methods:{startLoopAnimation:{description:`播放循环动画片段。`,payloadType:`AnimationStartLoopRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{parentId:`AnimatorTest`,id:`rotateObj`,stateName:`door_open`,loopStartTime:0,loopEndTime:3,speed:1}],riskLevel:`low`,responseMode:`single`},stopLoopAnimation:{description:`停止循环动画片段。`,payloadType:`AnimationStopLoopRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{parentId:`AnimatorTest`,id:`rotateObj`}],riskLevel:`low`,responseMode:`single`},playAnimator:{description:`播放 Animator 动画片段。`,payloadType:`AnimationPlayRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{parentId:`AnimatorTest`,id:`rotateObj`,stateName:`door_open`,speed:1,startTime:0,endTime:1,isStop:!1}],riskLevel:`low`,responseMode:`single`},setAnimatorSpeed:{description:`设置 Animator 动画播放速度。`,payloadType:`AnimationSetSpeedRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{parentId:`AnimatorTest`,id:`rotateObj`,speed:1.5}],riskLevel:`low`,responseMode:`single`},getAnimationLength:{description:`获取动画片段长度。`,payloadType:`AnimationGetLengthRequest`,returnType:H,sideEffects:[`read`],preconditions:V,examples:[{parentId:`AnimatorTest`,id:`rotateObj`,stateName:`door_open`}],riskLevel:`low`,responseMode:`single`},stopAnimator:{description:`停止指定对象的 Animator 播放。`,payloadType:`AnimationStopRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{parentId:`AnimatorTest`,id:`rotateObj`}],riskLevel:`low`,responseMode:`single`}}},TimeLine:{title:`时间线动画`,description:`TimeLine 动画控制 API。`,capabilities:[`时间线播放`,`时间线暂停`,`时间线恢复`,`时间线停止`,`全部时间线停止`,`播放速度控制`],methods:{play:{description:`播放指定 TimeLine 动画。`,payloadType:`TimelinePlayRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{id:`Path1`,speed:2}],riskLevel:`low`,responseMode:`stream`},pause:{description:`暂停指定 TimeLine 动画。`,payloadType:`TimelineNodeRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{id:`Path1`}],riskLevel:`low`,responseMode:`single`},resume:{description:`继续播放指定 TimeLine 动画。`,payloadType:`TimelineNodeRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{id:`Path1`}],riskLevel:`low`,responseMode:`single`},stop:{description:`停止指定 TimeLine 动画。`,payloadType:`TimelineStopRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{id:`Path1`,resetTime:-1,isCameraToStart:!1}],riskLevel:`low`,responseMode:`single`},stopAll:{description:`停止全部 TimeLine 动画。`,payloadType:``,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{}],riskLevel:`low`,responseMode:`single`},setSpeed:{description:`设置指定 TimeLine 的播放速度。`,payloadType:`TimelineSetSpeedRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{id:`Path1`,speed:1.2}],riskLevel:`low`,responseMode:`single`}}},WeatherSystem:{title:`天气时间环境`,description:`天气与时间环境控制 API。`,capabilities:[`天气类型查询`,`天气切换`,`天气重置`,`天气时间重置`,`场景时间设置`,`时间同步控制`,`昼夜动画控制`,`昼夜模式设置`,`季节切换`,`季节重置`,`雾效开启`,`雾效关闭`,`天气音量控制`],methods:{changeWeatherType:{description:`切换天气类型。`,payloadType:`WeatherTypeRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{type:0,timeDuration:60}],riskLevel:`low`,responseMode:`single`},getWeatherTypes:{description:`得到所有天气类型`,payloadType:``,returnType:H,sideEffects:[`read`],preconditions:V,examples:[{}],riskLevel:`low`,responseMode:`single`},resetWeather:{description:`重置天气`,payloadType:``,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{}],riskLevel:`low`,responseMode:`single`},setSceneTime:{description:`设置场景时间(小时)。`,payloadType:`WeatherSetSceneTimeRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{hour:10.5,timeDuration:5}],riskLevel:`low`,responseMode:`single`},setTimeSync:{description:`设置是否同步系统时间。`,payloadType:`WeatherSetTimeSyncRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{syncSystemTime:!0}],riskLevel:`low`,responseMode:`single`},resetSceneTime:{description:`重置场景时间。`,payloadType:``,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{}],riskLevel:`low`,responseMode:`single`},setAnimateTimeOfDay:{description:`设置是否模拟白天,黑夜轮换动画。`,payloadType:`WeatherSetAnimateTimeOfDayRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{isAnimate:!0,dayLength:.5,nightLength:.5}],riskLevel:`low`,responseMode:`single`},resetWeatherAndTime:{description:`场景天气和时间重置`,payloadType:``,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{}],riskLevel:`low`,responseMode:`single`},changeSeason:{description:`切换场景季节状态。`,payloadType:`WeatherChangeSeasonRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{season:1,duration:5}],riskLevel:`low`,responseMode:`single`},resetSeason:{description:`重置场景季节状态。`,payloadType:``,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{}],riskLevel:`low`,responseMode:`single`},setDayAndNight:{description:`在白天与夜晚模式之间切换。`,payloadType:`WeatherSetDayAndNightRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{dayType:`night`}],riskLevel:`low`,responseMode:`single`},setWeatherVolume:{description:`设置天气声音的开关。`,payloadType:`WeatherSetVolumeRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{volumeOn:!1}],riskLevel:`low`,responseMode:`single`},openCameraFog:{description:`开启并调整相机镜头雾效。`,payloadType:`WeatherOpenCameraFogRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{fogStartDistance:20,fogEndDistance:1500,fogIntensity:.5}],riskLevel:`low`,responseMode:`single`},closeCameraFog:{description:`关闭相机镜头雾效。`,payloadType:``,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{}],riskLevel:`low`,responseMode:`single`}}},WebView:{title:`网页视图`,description:`网页视图(WebView)管理 API。`,capabilities:[`网页视图更新`],methods:{updateWebView:{description:`更新网页视图参数。`,payloadType:`WebViewUpdateRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{parentId:`WebViews`,id:`tv1`,url:`http://www.163.com`}],riskLevel:`low`,responseMode:`single`}}},SpatialQuery:{title:`空间查询`,description:`场景缓冲空间查询 API,支持三种查询方式:`,capabilities:[`模型空间查询`,`坐标空间查询`,`模型包围盒空间查询`],methods:{layerQueryByModel:{description:`模型空间查询:根据场景模型当前的位置进行空间查询。`,payloadType:`SpatialQueryLayerByModelRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{parentId:``,id:`LayerSearchCore`,queryRadius:10,queryMinHeight:0,queryMaxHeight:50,queryParentIds:[`SM_B8_XueShenSuShe`,`daoZha`]}],riskLevel:`low`,responseMode:`single`},layerQueryByPosition:{description:`坐标空间查询:根据场景坐标位置进行空间查询。`,payloadType:`SpatialQueryLayerByPositionRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{queryPosition:{x:120.40284254780221,y:30.830451474524036,z:10,ePSGType:`4326`},queryRadius:20,queryMinHeight:0,queryMaxHeight:50,queryParentIds:[`SM_B8_XueShenSuShe`,`daoZha`]}],riskLevel:`low`,responseMode:`single`},layerQueryByModelBox:{description:`模型包围盒空间查询:根据场景模型的边界框进行空间查询。`,payloadType:`SpatialQueryLayerByModelBoxRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{parentId:``,id:`LayerSearchCore`,queryParentIds:[`JianKong_QiangJiTest`,`daoZha`]}],riskLevel:`low`,responseMode:`single`}}},TrainSimulate:{title:`列车模拟`,description:`列车模拟 API,支持启动列车、设置列车运动方式与音量、相机跟随/取消跟随列车。`,capabilities:[`列车启动`,`列车运动方式设置`,`列车音量设置`,`相机跟随列车`,`取消相机跟随列车`],methods:{startTrain:{description:`设置火车的动态并启动列车。`,payloadType:`TrainSimulateStartTrainRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{parentId:`RailTrains`,id:`DTrain1`,trainCode:`G501`,startStationName:`北京`,endStationName:`上海`,direction:`0`,action:`1`,stopTime:180,moveType:`StopAtTheEnd`}],riskLevel:`low`,responseMode:`single`},setTrainBehavior:{description:`设置火车的运动方式。`,payloadType:`TrainSimulateSetTrainBehaviorRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{parentId:`RailTrains`,id:`DTrain1`,moveType:`Loop`}],riskLevel:`low`,responseMode:`single`},setCameraFollowTrain:{description:`设置相机跟随火车。`,payloadType:`TrainSimulateSetCameraFollowTrainRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{parentId:`RailTrains`,id:`DTrain1`,offSet:{x:26,y:18,z:15,ePSGType:`0000`}}],riskLevel:`low`,responseMode:`single`},setTrainVolume:{description:`设置火车的声音的开关。`,payloadType:`TrainSimulateSetTrainVolumeRequest`,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{parentId:`RailTrains`,id:`DTrain1`,volumeOn:!1}],riskLevel:`low`,responseMode:`single`},cancelCameraFollowTrain:{description:`取消相机跟随火车,无需传参。`,payloadType:``,returnType:H,sideEffects:[`write`],preconditions:V,examples:[{}],riskLevel:`low`,responseMode:`single`}}}},Kt=e=>e instanceof r.ZodEffects?Kt(e._def.schema):e,qt=e=>{let t=Kt(e);return t instanceof r.ZodOptional||t instanceof r.ZodDefault?{schema:Kt(t._def.innerType),required:!1,description:t.description??``}:{schema:t,required:!0,description:t.description??``}},Jt=e=>qt(e).schema instanceof r.ZodUndefined,Yt=e=>{if(!(e instanceof r.ZodUnion))return;let t=e._def.options;if(!t.every(e=>e instanceof r.ZodLiteral))return;let n=t.map(e=>({value:e._def.value,...e.description?{description:e.description}:{}}));return{enumValues:n.map(e=>e.value),enumOptions:n}},Xt=e=>{let t=Yt(e);if(t)return{type:`enum`,...t};let n=`unknown`;return e instanceof r.ZodString?n=`string`:e instanceof r.ZodNumber?n=`number`:e instanceof r.ZodBoolean?n=`boolean`:e instanceof r.ZodObject?n=`object`:e instanceof r.ZodArray&&(n=`array`),{type:n}},Zt=e=>{if(Jt(e))return[];let t=qt(e).schema;return t instanceof r.ZodObject?Object.entries(t.shape).map(([e,t])=>{let{schema:n,required:r,description:i}=qt(t);return{name:e,required:r,description:i,...Xt(n)}}):[]},Qt=[`write`],$t=[`DTCEngine 已完成鉴权并建立 WebRTC 连接`],en=(e,t,n)=>{let r=e[t],i=`${n.charAt(0).toLowerCase()}${n.slice(1)}`;return r?.[n]??r?.[i]},tn=e=>e.apiModuleKeys.reduce((t,n)=>{let r=e.jsDocMetadata[n];return t[n]={moduleName:n,title:r.title,description:r.description,capabilities:r.capabilities,methods:Object.entries(r.methods).map(([t,r])=>{let i=[...r.sideEffects??Qt],a=[...r.preconditions??$t],o=r.responseMode??`single`,s=en(e.schemaMap,n,t);if(!s)throw Error(`Missing validation schema for ${n}.${t}`);let c=Jt(s)?`none`:`object`,l=c===`none`?[]:[...r.examples??[]],u=Zt(s);return{moduleName:n,methodName:t,description:r.description,sideEffects:i,preconditions:a,responseMode:o,riskLevel:r.riskLevel,schema:{payloadKind:c,fields:u,examples:l,responseMode:o}}})},t},{});function nn(e){return{moduleName:e.moduleName,methodName:e.methodName,description:e.description,sideEffects:e.sideEffects,preconditions:e.preconditions,responseMode:e.responseMode}}const rn=tn({apiModuleKeys:B,schemaMap:mt,jsDocMetadata:Gt});function an(e){return e}function on(e){return B.indexOf(e)>=0}function sn(e){return e??`all`}function cn(e,t){let n=sn(t);return n===`all`||n[e]!==void 0}function ln(e,t,n){let r=sn(n);if(r===`all`)return!0;let i=r[e];return i===!0||Array.isArray(i)&&i.indexOf(t)>=0}function un(e){return B.filter(t=>cn(t,e)).map(t=>{let n=rn[t],r=dn(t,e).length;return{moduleName:n.moduleName,title:n.title,description:n.description,capabilities:n.capabilities,methodCount:r}})}function dn(e,t){return cn(e,t)?rn[e].methods.filter(n=>ln(e,n.methodName,t)).map(e=>nn(e)):[]}function fn(e,t,n){if(ln(e,t,n))return rn[e].methods.find(e=>e.methodName===t)?.schema}function pn(e,t,n){if(!ln(e,t,n))return;let r=mt[e],i=`${t.charAt(0).toLowerCase()}${t.slice(1)}`;return r?.[t]??r?.[i]}function mn(e){return`'use strict';
|
|
38
38
|
let registeredProgram;
|
|
39
39
|
let cancelled = false;
|
|
40
40
|
let nextRequestId = 1;
|