@shijiu/jsview 2.3.0 → 2.3.728-alpha.0
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/dom/bin/jsview-dom-browser-engine-core.min.js +1 -1
- package/dom/bin/jsview-dom-browser-engine-modules.min.js +1 -1
- package/dom/bin/{jsview-dom-browser-forge.1436.54c9.wasm → jsview-dom-browser-forge.1798.9ed7.wasm} +0 -0
- package/dom/bin/jsview-dom-browser-forge.min.js +1 -1
- package/dom/bin/jsview-dom-browser-forge.worker.min.js +1 -1
- package/dom/bin/jsview-dom-browser.min.js +1 -1
- package/dom/bin/jsview-dom-native.min.js +1 -1
- package/dom/bin/jsview-engine-js-browser.min.js +1 -1
- package/dom/bin/jsview-engine-js-native.min.js +1 -1
- package/dom/bin/jsview-forge-define.min.js +1 -1
- package/dom/target_core_revision.mjs +2 -2
- package/loader/jsv-core-api/jsview-core-api-glue.js +12 -1
- package/loader/jsv-core-api/wasm/core-api.js +95 -1
- package/loader/jsv-core-api/wasm/wasm-extension.js +5 -0
- package/loader/jsview-loader.js +10 -3
- package/loader/jsview-main.mjs +1 -0
- package/loader/jsview.config.default.js +4 -0
- package/package.json +1 -1
- package/patches/node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js +6 -2
- package/tools/jsview-build-zip.mjs +7 -2
- package/tools/jsview-common.mjs +10 -1
- package/tools/jsview-post-build.mjs +88 -6
- package/tools/jsview-post-install.mjs +10 -4
- package/tools/jsview-run-tool.mjs +3 -6
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* eslint-disable */ class e{static SetOnEventListener(...t){return e.WasmBridge.SetOnEventListener(t)}static RunSyncTask(...t){return e.WasmBridge.RunSyncTask(t)}static RunLazyTaskList(...t){return e.WasmBridge.RunLazyTaskList(t)}static JsViewId=1;static WasmBridge}const t={print:(...e)=>{console.log(...e)},canvas:void 0,setStatus:e=>{},totalDependencies:0,monitorRunDependencies:e=>{}};let n=new class{constructor(){this.observer_map={},this._OnJsNotifyFunc=this.onJsNotify.bind(this),this._OnEmitEventFunc=this.onEmitEvent.bind(this),this.subscribe("watchdog",this._watchdog)}subscribe(e,t){this.observer_map.hasOwnProperty(e)||(this.observer_map[e]=[]),this.observer_map[e].push(t)}unsubscribe(e,t){if(this.observer_map.hasOwnProperty(e)){let n=this.observer_map[e];for(let e=0;e<n.length;e++)if(n[e]==t){n.splice(e,1);break}}}notify(e,t){this._OnJsNotifyFunc(e,t)}emitEvent(e,t){this._OnEmitEventFunc(e,t)}onEmitEvent(e,t){console.log("onEmitEvent() key: "+e+" message="+t),0!=this.observer_map.hasOwnProperty(e)?this._JsNotify(e,t):console.warn("Message from JsView.emitEvent key='"+e+"' is not subscribed.")}onJsNotify(e,t){0!=this.observer_map.hasOwnProperty(e)&&this._JsNotify(e,t)}_JsNotify(e,t){var n;let s=this.observer_map[e].length;for(let i=0;i<s;i++)n=this.observer_map[e][i](t);return n}_watchdog(){}};const s=2560;class i{constructor(){this.limitFps=0,this.fpsDisplay=!1,this.surfaceWidth=0,this.surfaceHeight=0}pack(){try{const e={};return e.limitFps=this.limitFps,e.fpsDisp=this.fpsDisplay,e.fpsConsole=!1,e.width=this.surfaceWidth,e.height=this.surfaceHeight,JSON.stringify(e)}catch(e){return console.error("Json error:",e),null}}}var o;function a(e,t,n,s,i,a,r,c){let l=e.getElementById("input-layer"),h=e.getElementById("ime_"+a);if(null!=r){let i=JSON.parse(r),c=i.inputType,p=i.text?decodeURIComponent(i.text):"",u=i.showImeIfNeeded?i.showImeIfNeeded:0,d=isNaN(i.selectionStart)?0:i.selectionStart,m=isNaN(i.selectionEnd)?0:i.selectionEnd,f=isNaN(i.scrollLeft)?0:i.scrollLeft,_=isNaN(i.scrollTop)?0:i.scrollTop,g=isNaN(i.fontSize)?20:i.fontSize,v=i.textAlign?i.textAlign:"left",y=i.coverColor?i.coverColor:"#FFFFFF",S=i.textColor?i.textColor:"#000000";u?(null==h&&(h=e.createElement("input"),h.id="ime_"+a,l.appendChild(h),h.style.position="absolute",h.style.backgroundColor=y,h.style.color=S,h.style.textAlign=v,h.style.fontSize=t.measurePosition(g)+"px",h.style.border="none",h.style.outline="none",h.jsvAttachInfo={keepAlive:!1},function(e,t,n,s){t.oninput=t=>{if(t.target.value.length>0&&t.target.selectionStart>0){const e=t.target.selectionStart-1,s=t.target.selectionStart;if(i=t.target.value.slice(e,s),!("0".charCodeAt()<=i.charCodeAt()&&i.charCodeAt()<="9".charCodeAt()||n!==o.NUMBER))return t.target.value=t.target.value.substr(0,e)+t.target.value.substr(s),void(t.target.selectionStart=e)}var i;const a=t.target.value,r=t.target.selectionStart,c=t.target.scrollLeft,l=t.target.scrollTop;s(e,a,r,r,c,l)}}(a,h,c,n),function(e,t,n,s){t.style.pointerEvents="auto",t.addEventListener("keydown",(e=>{38===(e=e||window.event).keyCode||40===e.keyCode?t.blur():27!==e.keyCode&&1e4!==e.keyCode||t.blur()})),t.addEventListener("selectionchange",(n=>{s(e,t.value,t.selectionStart,t.selectionEnd,t.scrollLeft,t.scrollTop)})),t.addEventListener("scroll",(n=>{s(e,t.value,t.selectionStart,t.selectionEnd,t.scrollLeft,t.scrollTop)}))}(a,h,h.jsvAttachInfo,n),function(e,t,n,s){t.onfocus=e=>{},t.onblur=n=>{s(e,!1,!1),setTimeout((()=>{t.remove()}),0)}}(a,h,h.jsvAttachInfo,s),s(a,!0,!1)),h.value=p,setTimeout((()=>{h.selectionStart=d,h.selectionEnd=m,h.scrollLeft=f+g/2,h.scrollTop=_}),0),h.focus()):null!=h&&(h.remove(),s(a,!1,!1))}if(null!=c){let e=JSON.parse(c);null!=h&&(h.style.left=t.measurePosition(e.x)+"px",h.style.top=t.measurePosition(e.y)+"px",h.style.width=t.measurePosition(e.width)+"px",h.style.height=t.measurePosition(e.height)+"px")}}!function(e){e[e.NONE=0]="NONE",e[e.TEXT=1]="TEXT",e[e.PASSWORD=2]="PASSWORD",e[e.TEXT_AREA=3]="TEXT_AREA",e[e.CONTENT_EDITABLE=4]="CONTENT_EDITABLE",e[e.SEARCH=5]="SEARCH",e[e.URL=6]="URL",e[e.EMAIL=7]="EMAIL",e[e.TELEPHONE=8]="TELEPHONE",e[e.NUMBER=9]="NUMBER"}(o||(o={}));class r{constructor(e,t){this._PointerDown=!1,this._EventFireFunc=t,this._VelocityTracker=new c,this._SetupEventListener(e)}_SetupEventListener(e){this._TouchPannel=window.originDocument.getElementById(e),this._TouchPannel.addEventListener("pointerdown",(e=>{this._PointerDown=!0;let t=this._MapXAndY(e.clientX,e.clientY);this._VelocityTracker.resetCheckPoints(),this._VelocityTracker.updateCheckPoint(t.mappedX,t.mappedY,0,0,e.timeStamp),this._EventFireFunc(0,t.mappedX,t.mappedY,0,0)})),this._TouchPannel.addEventListener("pointerup",(e=>{if(this._PointerDown){let t=this._MapXAndY(e.clientX,e.clientY);this._VelocityTracker.updateCheckPoint(t.mappedX,t.mappedY,0,0,e.timeStamp);let n=this._VelocityTracker.getVelocity(2e3);this._EventFireFunc(2,t.mappedX,t.mappedY,n.vX,n.vY),this._PointerDown=!1}})),this._TouchPannel.addEventListener("pointermove",(e=>{if(this._PointerDown){let t=this._MapXAndY(e.clientX,e.clientY);this._VelocityTracker.updateCheckPoint(t.mappedX,t.mappedY,0,0,e.timeStamp),this._EventFireFunc(1,t.mappedX,t.mappedY,0,0)}})),this._TouchPannel.addEventListener("pointerleave",(e=>{let t=this._MapXAndY(e.clientX,e.clientY);if(this._PointerDown){this._VelocityTracker.updateCheckPoint(t.mappedX,t.mappedY,0,0,e.timeStamp);let n=this._VelocityTracker.getVelocity(2e3);this._EventFireFunc(2,t.mappedX,t.mappedY,n.vX,n.vY),this._PointerDown=!1}}))}_MapXAndY(e,t){let n={mappedX:0,mappedY:0},i=this._TouchPannel.getBoundingClientRect(),o=i.width/s;return n.mappedX=Math.floor((e-i.x)/o),n.mappedY=Math.floor((t-i.y)/o),n}}class c{constructor(){this._CheckPointIndex=0,this._CheckPointers=new Array(5)}resetCheckPoints(){this._CheckPointers=new Array(5)}updateCheckPoint(e,t,n,s,i){let o={pointX:e,pointY:t,timeStamp:i};this._CheckPointers[this._CheckPointIndex]=o,this._CheckPointIndex=(this._CheckPointIndex+1)%5}getVelocity(e){let t={vX:0,vY:0},n=this._GetPointIndex(-1),s=this._CheckPointers[n];if(!s)return t;let i=s,o=0,a=this._CheckPointers[n].timeStamp;for(let e=2;e<6;e++){let t=this._CheckPointers[this._GetPointIndex(-e)];if(!t)break;if(!(a-t.timeStamp<100))break;s=t,o=t.timeStamp}return s.pointX!=i.pointX&&(t.vX=Math.floor((i.pointX-s.pointX)/(a-o)*1e3),t.vX>e&&(t.vX=e)),s.pointY!=i.pointY&&(t.vY=Math.floor((i.pointY-s.pointY)/(a-o)*1e3),t.vY>e&&(t.vY=e)),t}_GetPointIndex(e){return(this._CheckPointIndex+5+e)%5}}const l="forge-canvas";class h{constructor(e,t){this._TouchEventProxy=null,this._VirtualCanvasCreated=!1,this._CanvasElement=null,this._LinkedHandles=null,this._WasmCanvasApi=e,this._MessageDispatcher=null,this._DynamicConfigSet=new i,this._canvasToken=674500,this._jsviewId=t,this._OnImeSyncBackInfoWrap=this._OnImeSyncBackInfo.bind(this),this._OnImeSyncViewStatusWrap=this._OnImeSyncViewStatus.bind(this),this._OnImeSyncActionWrap=this._OnImeSyncAction.bind(this),this._CanvasElement=window.JsvCode?.Dom?.BrowserDocument?.getElementById(l)??document.getElementById(l);new ResizeObserver((e=>{for(let t of e){const{width:e,height:n}=t.contentRect;this._OnCanvasSizeChanged(e,n)}})).observe(this._CanvasElement),this._CanvasElement.width=s,this._OnCanvasSizeChanged(this._CanvasElement.clientWidth,this._CanvasElement.clientHeight)}linkToHandleType(e){this._LinkedHandles=e}startDraw(){this._WasmCanvasApi.CreateVirtualCanvas(this._canvasToken,this._jsviewId,this.triggerRenderEventReciever.bind(this),this.imeControlEvent.bind(this)),this._WasmCanvasApi.UpdateDynamicSet(this._canvasToken,this._DynamicConfigSet.pack()),this._VirtualCanvasCreated=!0}onForgeAppReady(){this._EnableTouchListener()}getCanvasToken(){return this._canvasToken}getForgeRT(){return this._WasmCanvasApi.GetForgeRTHandle(this._canvasToken)}enableFpsDisplay(e){this._DynamicConfigSet.fpsDisplay=e,this._WasmCanvasApi.UpdateDynamicSet(this._canvasToken,this._DynamicConfigSet.pack())}setMessageDispatcher(e){this._MessageDispatcher=e}triggerRenderEventReciever(){this._MessageDispatcher?.notify("JscRender","")}imeControlEvent(e,t,n){a(window.originDocument,this,this._OnImeSyncBackInfoWrap,this._OnImeSyncViewStatusWrap,this._OnImeSyncActionWrap,e,t,n)}measurePosition(e){return Math.round(e/this.getDesignedMapWidth()*this._CanvasElement.clientWidth)}getDesignedMapWidth(){return this._LinkedHandles?.renderBridge?.GetScreenInfo().designedWidth}_OnCanvasSizeChanged(e,t){let n=Math.floor(t/e*s);this._CanvasElement.height=n,this._DynamicConfigSet.surfaceWidth=this._CanvasElement.width,this._DynamicConfigSet.surfaceHeight=n,this._VirtualCanvasCreated&&this._WasmCanvasApi.UpdateDynamicSet(this._canvasToken,this._DynamicConfigSet.pack())}_OnImeSyncBackInfo(e,t,n,s,i,o){let a={type:"text",text:encodeURIComponent(t),selectStart:n,selectEnd:s,scrollLeft:i,scrollTop:o};this._MessageDispatcher?.notify("_JscIme_"+e,JSON.stringify(a))}_OnImeSyncViewStatus(e,t,n){let s={type:"vstatus",isVisible:t,softKeyShown:n};this._MessageDispatcher?.notify("_JscIme_"+e,JSON.stringify(s))}_OnImeSyncAction(e,t){let n={type:"action",action:t};this._MessageDispatcher?.notify("_JscIme_"+e,JSON.stringify(n))}_EnableTouchListener(){this._TouchEventProxy=new r(l,((e,t,n,s,i)=>{this._WasmCanvasApi.OnTouchEvent(this._canvasToken,e,t,n,s,i)}))}}let p=null;class u{constructor(){this.SubTypes=new Map}}class d{constructor(){this.Trackers=new Map}}let m=null;const f=window.AudioContext||window.webkitAudioContext;if(f){const e=new f;let t=0,n=0;class s{constructor(e,t,n){this._Context=e,this._BufferSource=t,this._Gain=n,this._BufferSource.connect(this._Gain),this._Gain.connect(this._Context.destination)}start(e,t,n){this._BufferSource.start(e,t,n)}setVolume(e){this._Gain.gain.setValueAtTime(e,this._Context.currentTime)}stop(e){this._BufferSource.stop(e)}}class i{constructor(){this._SoundBufferMap={},this._StreamMap={}}load(n,s,i,o){const a=new URL(n).href,r=t++;return this._requestBuffer(a,((t,n)=>{0===t?e.decodeAudioData(n,(e=>{this._SoundBufferMap[r]=e,o(r,0)})):o(-1,-1)})),r}unload(e){delete this._SoundBufferMap[e]}autoPause(){}autoResume(){}play(t,i,o,a,r,c){if(this._SoundBufferMap[t]){const o=n++,a=e.createBufferSource();a.buffer=this._SoundBufferMap[t],a.playbackRate.value=c,a.onended=e=>{this.stop(o)},r>0&&(a.loop=!0);const l=e.createGain();l.gain.setValueAtTime(i,e.currentTime);const h=new s(e,a,l);return this._StreamMap[o]=h,console.log("loop test",(r+1)*this._SoundBufferMap[t].duration),h.start(0,0,(r+1)*this._SoundBufferMap[t].duration),o}return-1}pause(e){}resume(e){}stop(e){this._StreamMap[e]&&(this._StreamMap[e].stop(),delete this._StreamMap[e])}release(){this._SoundBufferMap={},this._StreamMap={}}setVolume(e,t,n){this._StreamMap[e]&&this._StreamMap[e].setVolume(t)}setPriority(e,t){}setRate(e,t){}setLoop(e,t){}_requestBuffer(e,t){const n=new XMLHttpRequest;n.open("GET",e,!0),n.responseType="arraybuffer",n.onload=()=>{200===n.status?(console.log("http request succeed"),t(0,n.response)):(console.error(`download audio ${e} failed.`,n.status),t(-1,null))},n.send()}}m=i}else m=null;var _=m;e.JsViewId=1;const g=await async function(){window.global=window;const{default:n}=await import("./jsview-dom-browser-forge.min.js"),s=await n(t);s.jse$impl$WasmImpl.SetModule(s);const i=s.forge$dom$WasmPlatformDomBridge;return e.WasmBridge=i,s.WasmJscExports=s.forge$WasmJscExports,s}();let v=g.forge$WasmResProviderExports;v.initResInstance(1),g.WasmJscExports.InitJsc(1,window.JsvCoreApi.getJsContextId()),g.forge$front$ForgeCanvasApi.SetupGLContext("#forge-canvas");let y=null,S=new class{constructor(){this._Categories=new Map}listenerToAckEvent(e,t,n,s){let i=this._Categories.get(e);i||(i=new u,this._Categories.set(e,i));let o=i.SubTypes.get(t);o||(o=new d,i.SubTypes.set(t,o));let a=o.Trackers.get(n);a||(a=[],o.Trackers.set(n,a)),a.push(s),console.log(`listenerToAckEvent c:${e} t:${t} id:${n}`)}recycleAckListener(e){if(!e)return void console.error("Error: listener is null");let t=!1;for(const n of this._Categories.values())for(const s of n.SubTypes.values())for(const n of s.Trackers.values())for(let s=n.length-1;s>=0;s--)n[s]==e&&(t=!0,n.splice(s,1));t||console.error("Error: listener not found")}dispatcher(e,t,n,s){let i=this._Categories.get(e)?.SubTypes.get(t)?.Trackers.get(n);if(i)for(let e=0;e<i.length;e++)i[e](s)}};function w(e){!async function(e){await async function(){const e=[import("./DroidSansFallback.ttf").then((async e=>(await fetch(e.default)).arrayBuffer())),import("./NotoColorEmoji.ttf").then((async e=>(await fetch(e.default)).arrayBuffer())),import("./DroidNaskh-Regular.ttf").then((async e=>(await fetch(e.default)).arrayBuffer())),import("./DroidSans.ttf").then((async e=>(await fetch(e.default)).arrayBuffer()))];await Promise.all(e).then((e=>{const t=new Uint32Array(e.length),n=new Uint32Array(e.length);for(let s=0;s<e.length;++s){const i=e[s];if(i){const e=new Uint8Array(i),o=g.malloc(i.byteLength);g.HEAPU8.set(e,o),t[s]=o,n[s]=i.byteLength}}const s=g.malloc(4*t.length);g.HEAPU32.set(t,s>>2);const i=g.malloc(4*n.length);g.HEAPU32.set(n,i>>2),v.SetFonts(1,s,i,e.length)}))}(),window.JsvCoreApi.WasmExt.setLogSingleton(g.forge$Log,g.jse$Log),window.JsvCoreApi.WasmExt.setEventBridge(S),y=function(e,t){return p=new h(e,t),p}(g.forge$front$ForgeCanvasApi,1),window.JsvCoreApi.WasmExt.setForgeCanvasSingleton(y),y.startDraw();let t=y.getForgeRT();y.setMessageDispatcher(n);let s={frtNativeHandle:t,canvasNativeHandle:y.getCanvasToken()};y.linkToHandleType(s),e?.(s)}(e)}function E(){return n}g.forge$front$EventBridge.SetupEventBridge(1,S.dispatcher.bind(S)),window.JsvCode.BrowserPlatformDomBridge=e,window.JsvCode.MessageDispatcher=n,e.RegisterOriginDocument=function(e){console.log("RegisterOriginDocument in"),window.originDocument=e},window.SoundPool=_;export{E as getJMD,w as takeCanvas};
|
|
1
|
+
/* eslint-disable */ class e{static SetOnEventListener(...t){return e.WasmBridge.SetOnEventListener(t)}static RunSyncTask(...t){return e.WasmBridge.RunSyncTask(t)}static RunLazyTaskList(...t){return e.WasmBridge.RunLazyTaskList(t)}static JsViewId=1;static WasmBridge}const t={print:(...e)=>{console.log(...e)},canvas:void 0,setStatus:e=>{},totalDependencies:0,monitorRunDependencies:e=>{}};let n=new class{constructor(){this.observer_map={},this._OnJsNotifyFunc=this.onJsNotify.bind(this),this._OnEmitEventFunc=this.onEmitEvent.bind(this),this.subscribe("watchdog",this._watchdog)}subscribe(e,t){this.observer_map.hasOwnProperty(e)||(this.observer_map[e]=[]),this.observer_map[e].push(t)}unsubscribe(e,t){if(this.observer_map.hasOwnProperty(e)){let n=this.observer_map[e];for(let e=0;e<n.length;e++)if(n[e]==t){n.splice(e,1);break}}}notify(e,t){this._OnJsNotifyFunc(e,t)}emitEvent(e,t){this._OnEmitEventFunc(e,t)}onEmitEvent(e,t){console.log("onEmitEvent() key: "+e+" message="+t),0!=this.observer_map.hasOwnProperty(e)?this._JsNotify(e,t):console.warn("Message from JsView.emitEvent key='"+e+"' is not subscribed.")}onJsNotify(e,t){0!=this.observer_map.hasOwnProperty(e)&&this._JsNotify(e,t)}_JsNotify(e,t){var n;let s=this.observer_map[e].length;for(let i=0;i<s;i++)n=this.observer_map[e][i](t);return n}_watchdog(){}};const s=2560;class i{constructor(){this.limitFps=0,this.fpsDisplay=!1,this.surfaceWidth=0,this.surfaceHeight=0}pack(){try{const e={};return e.limitFps=this.limitFps,e.fpsDisp=this.fpsDisplay,e.fpsConsole=!1,e.width=this.surfaceWidth,e.height=this.surfaceHeight,JSON.stringify(e)}catch(e){return console.error("Json error:",e),null}}}var o;function a(e,t,n,s,i,a,r,c){let l=e.getElementById("input-layer"),h=e.getElementById("ime_"+a);if(null!=r){let i=JSON.parse(r),c=i.inputType,p=i.text?decodeURIComponent(i.text):"",u=i.showImeIfNeeded?i.showImeIfNeeded:0,d=isNaN(i.selectionStart)?0:i.selectionStart,m=isNaN(i.selectionEnd)?0:i.selectionEnd,_=isNaN(i.scrollLeft)?0:i.scrollLeft,f=isNaN(i.scrollTop)?0:i.scrollTop,v=isNaN(i.fontSize)?20:i.fontSize,g=i.textAlign?i.textAlign:"left",y=i.coverColor?i.coverColor:"#FFFFFF",E=i.textColor?i.textColor:"#000000";u?(null==h&&(h=e.createElement("input"),h.id="ime_"+a,l.appendChild(h),h.style.position="absolute",h.style.backgroundColor=y,h.style.color=E,h.style.textAlign=g,h.style.fontSize=t.measurePosition(v)+"px",h.style.border="none",h.style.outline="none",h.jsvAttachInfo={keepAlive:!1},function(e,t,n,s){t.oninput=t=>{if(t.target.value.length>0&&t.target.selectionStart>0){const e=t.target.selectionStart-1,s=t.target.selectionStart;if(i=t.target.value.slice(e,s),!("0".charCodeAt()<=i.charCodeAt()&&i.charCodeAt()<="9".charCodeAt()||n!==o.NUMBER))return t.target.value=t.target.value.substr(0,e)+t.target.value.substr(s),void(t.target.selectionStart=e)}var i;const a=t.target.value,r=t.target.selectionStart,c=t.target.scrollLeft,l=t.target.scrollTop;s(e,a,r,r,c,l)}}(a,h,c,n),function(e,t,n,s){t.style.pointerEvents="auto",t.addEventListener("keydown",e=>{38===(e=e||window.event).keyCode||40===e.keyCode?t.blur():27!==e.keyCode&&1e4!==e.keyCode||t.blur()}),t.addEventListener("selectionchange",n=>{s(e,t.value,t.selectionStart,t.selectionEnd,t.scrollLeft,t.scrollTop)}),t.addEventListener("scroll",n=>{s(e,t.value,t.selectionStart,t.selectionEnd,t.scrollLeft,t.scrollTop)})}(a,h,h.jsvAttachInfo,n),function(e,t,n,s){t.onfocus=e=>{},t.onblur=n=>{s(e,!1,!1),setTimeout(()=>{t.remove()},0)}}(a,h,h.jsvAttachInfo,s),s(a,!0,!1)),h.value=p,setTimeout(()=>{h.selectionStart=d,h.selectionEnd=m,h.scrollLeft=_+v/2,h.scrollTop=f},0),h.focus()):null!=h&&(h.remove(),s(a,!1,!1))}if(null!=c){let e=JSON.parse(c);null!=h&&(h.style.left=t.measurePosition(e.x)+"px",h.style.top=t.measurePosition(e.y)+"px",h.style.width=t.measurePosition(e.width)+"px",h.style.height=t.measurePosition(e.height)+"px")}}!function(e){e[e.NONE=0]="NONE",e[e.TEXT=1]="TEXT",e[e.PASSWORD=2]="PASSWORD",e[e.TEXT_AREA=3]="TEXT_AREA",e[e.CONTENT_EDITABLE=4]="CONTENT_EDITABLE",e[e.SEARCH=5]="SEARCH",e[e.URL=6]="URL",e[e.EMAIL=7]="EMAIL",e[e.TELEPHONE=8]="TELEPHONE",e[e.NUMBER=9]="NUMBER"}(o||(o={}));class r{constructor(e,t){this._PointerDown=!1,this._EventFireFunc=t,this._VelocityTracker=new c,this._SetupEventListener(e)}_SetupEventListener(e){this._TouchPannel=window.originDocument.getElementById(e),this._TouchPannel.addEventListener("pointerdown",e=>{this._PointerDown=!0;let t=this._MapXAndY(e.clientX,e.clientY);this._VelocityTracker.resetCheckPoints(),this._VelocityTracker.updateCheckPoint(t.mappedX,t.mappedY,0,0,e.timeStamp),this._EventFireFunc(0,t.mappedX,t.mappedY,0,0)}),this._TouchPannel.addEventListener("pointerup",e=>{if(this._PointerDown){let t=this._MapXAndY(e.clientX,e.clientY);this._VelocityTracker.updateCheckPoint(t.mappedX,t.mappedY,0,0,e.timeStamp);let n=this._VelocityTracker.getVelocity(2e3);this._EventFireFunc(2,t.mappedX,t.mappedY,n.vX,n.vY),this._PointerDown=!1}}),this._TouchPannel.addEventListener("pointermove",e=>{if(this._PointerDown){let t=this._MapXAndY(e.clientX,e.clientY);this._VelocityTracker.updateCheckPoint(t.mappedX,t.mappedY,0,0,e.timeStamp),this._EventFireFunc(1,t.mappedX,t.mappedY,0,0)}}),this._TouchPannel.addEventListener("pointerleave",e=>{let t=this._MapXAndY(e.clientX,e.clientY);if(this._PointerDown){this._VelocityTracker.updateCheckPoint(t.mappedX,t.mappedY,0,0,e.timeStamp);let n=this._VelocityTracker.getVelocity(2e3);this._EventFireFunc(2,t.mappedX,t.mappedY,n.vX,n.vY),this._PointerDown=!1}})}_MapXAndY(e,t){let n={mappedX:0,mappedY:0},i=this._TouchPannel.getBoundingClientRect(),o=i.width/s;return n.mappedX=Math.floor((e-i.x)/o),n.mappedY=Math.floor((t-i.y)/o),n}}class c{constructor(){this._CheckPointIndex=0,this._CheckPointers=new Array(5)}resetCheckPoints(){this._CheckPointers=new Array(5)}updateCheckPoint(e,t,n,s,i){let o={pointX:e,pointY:t,timeStamp:i};this._CheckPointers[this._CheckPointIndex]=o,this._CheckPointIndex=(this._CheckPointIndex+1)%5}getVelocity(e){let t={vX:0,vY:0},n=this._GetPointIndex(-1),s=this._CheckPointers[n];if(!s)return t;let i=s,o=0,a=this._CheckPointers[n].timeStamp;for(let e=2;e<6;e++){let t=this._CheckPointers[this._GetPointIndex(-e)];if(!t)break;if(!(a-t.timeStamp<100))break;s=t,o=t.timeStamp}return s.pointX!=i.pointX&&(t.vX=Math.floor((i.pointX-s.pointX)/(a-o)*1e3),t.vX>e&&(t.vX=e)),s.pointY!=i.pointY&&(t.vY=Math.floor((i.pointY-s.pointY)/(a-o)*1e3),t.vY>e&&(t.vY=e)),t}_GetPointIndex(e){return(this._CheckPointIndex+5+e)%5}}class l{constructor(e,t,n){this._SendHoverFunc=t,this._SendScrollFunc=n,this._SetupEventListener(e)}_SetupEventListener(e){this._CanvasPannel=window.originDocument.getElementById(e),this._CanvasPannel.addEventListener("mousemove",e=>{let t=this._MapXAndY(e.clientX,e.clientY);this._SendHoverFunc(t.mappedX,t.mappedY)}),this._CanvasPannel.addEventListener("mousewheel",e=>{let t=this._MapXAndY(e.clientX,e.clientY);this._SendScrollFunc(t.mappedX,t.mappedY,e.deltaX,e.deltaY),e.preventDefault()},{passive:!1})}_MapXAndY(e,t){let n={mappedX:0,mappedY:0},i=this._CanvasPannel.getBoundingClientRect(),o=i.width/s;return n.mappedX=Math.floor((e-i.x)/o),n.mappedY=Math.floor((t-i.y)/o),n}}const h="forge-canvas";class p{constructor(e,t){this._TouchEventProxy=null,this._MouseEventProxy=null,this._VirtualCanvasCreated=!1,this._CanvasElement=null,this._LinkedHandles=null,this._WasmCanvasApi=e,this._MessageDispatcher=null,this._DynamicConfigSet=new i,this._canvasToken=674500,this._jsviewId=t,this._OnImeSyncBackInfoWrap=this._OnImeSyncBackInfo.bind(this),this._OnImeSyncViewStatusWrap=this._OnImeSyncViewStatus.bind(this),this._OnImeSyncActionWrap=this._OnImeSyncAction.bind(this),this._CanvasElement=window.JsvCode?.Dom?.BrowserDocument?.getElementById(h)??document.getElementById(h);new ResizeObserver(e=>{for(let t of e){const{width:e,height:n}=t.contentRect;this._OnCanvasSizeChanged(e,n)}}).observe(this._CanvasElement),this._CanvasElement.width=s,this._OnCanvasSizeChanged(this._CanvasElement.clientWidth,this._CanvasElement.clientHeight)}linkToHandleType(e){this._LinkedHandles=e}startDraw(){this._WasmCanvasApi.CreateVirtualCanvas(this._canvasToken,this._jsviewId,this.triggerRenderEventReciever.bind(this),this.imeControlEvent.bind(this)),this._WasmCanvasApi.UpdateDynamicSet(this._canvasToken,this._DynamicConfigSet.pack()),this._VirtualCanvasCreated=!0}onForgeAppReady(){this._EnableTouchListener(),this._EnableMouseEvent()}getCanvasToken(){return this._canvasToken}getForgeRT(){return this._WasmCanvasApi.GetForgeRTHandle(this._canvasToken)}enableFpsDisplay(e){this._DynamicConfigSet.fpsDisplay=e,this._WasmCanvasApi.UpdateDynamicSet(this._canvasToken,this._DynamicConfigSet.pack())}setMessageDispatcher(e){this._MessageDispatcher=e}triggerRenderEventReciever(){this._MessageDispatcher?.notify("JscRender","")}imeControlEvent(e,t,n){a(window.originDocument,this,this._OnImeSyncBackInfoWrap,this._OnImeSyncViewStatusWrap,this._OnImeSyncActionWrap,e,t,n)}measurePosition(e){return Math.round(e/this.getDesignedMapWidth()*this._CanvasElement.clientWidth)}getDesignedMapWidth(){return this._LinkedHandles?.renderBridge?.GetScreenInfo().designedWidth}_OnCanvasSizeChanged(e,t){let n=Math.floor(t/e*s);this._CanvasElement.height=n,this._DynamicConfigSet.surfaceWidth=this._CanvasElement.width,this._DynamicConfigSet.surfaceHeight=n,this._VirtualCanvasCreated&&this._WasmCanvasApi.UpdateDynamicSet(this._canvasToken,this._DynamicConfigSet.pack())}_OnImeSyncBackInfo(e,t,n,s,i,o){let a={type:"text",text:encodeURIComponent(t),selectStart:n,selectEnd:s,scrollLeft:i,scrollTop:o};this._MessageDispatcher?.notify("_JscIme_"+e,JSON.stringify(a))}_OnImeSyncViewStatus(e,t,n){let s={type:"vstatus",isVisible:t,softKeyShown:n};this._MessageDispatcher?.notify("_JscIme_"+e,JSON.stringify(s))}_OnImeSyncAction(e,t){let n={type:"action",action:t};this._MessageDispatcher?.notify("_JscIme_"+e,JSON.stringify(n))}_EnableTouchListener(){this._TouchEventProxy=new r(h,(e,t,n,s,i)=>{this._WasmCanvasApi.OnTouchEvent(this._canvasToken,e,t,n,s,i)})}_EnableMouseEvent(){this._MouseEventProxy=new l(h,(e,t)=>{this._WasmCanvasApi.OnHoverEvent(this._canvasToken,e,t)},(e,t,n,s)=>{this._WasmCanvasApi.OnScrollEvent(this._canvasToken,e,t,n,s)})}}let u=null;class d{constructor(){this.SubTypes=new Map}}class m{constructor(){this.Trackers=new Map}}let _=null;const f=window.AudioContext||window.webkitAudioContext;if(f){const e=new f;let t=0,n=0;class s{constructor(e,t,n){this._Context=e,this._BufferSource=t,this._Gain=n,this._BufferSource.connect(this._Gain),this._Gain.connect(this._Context.destination)}start(e,t,n){this._BufferSource.start(e,t,n)}setVolume(e){this._Gain.gain.setValueAtTime(e,this._Context.currentTime)}stop(e){this._BufferSource.stop(e)}}class i{constructor(){this._SoundBufferMap={},this._StreamMap={}}load(n,s,i,o){const a=new URL(n).href,r=t++;return this._requestBuffer(a,(t,n)=>{0===t?e.decodeAudioData(n,e=>{this._SoundBufferMap[r]=e,o(r,0)}):o(-1,-1)}),r}unload(e){delete this._SoundBufferMap[e]}autoPause(){}autoResume(){}play(t,i,o,a,r,c){if(this._SoundBufferMap[t]){const o=n++,a=e.createBufferSource();a.buffer=this._SoundBufferMap[t],a.playbackRate.value=c,a.onended=e=>{this.stop(o)},r>0&&(a.loop=!0);const l=e.createGain();l.gain.setValueAtTime(i,e.currentTime);const h=new s(e,a,l);return this._StreamMap[o]=h,console.log("loop test",(r+1)*this._SoundBufferMap[t].duration),h.start(0,0,(r+1)*this._SoundBufferMap[t].duration),o}return-1}pause(e){}resume(e){}stop(e){this._StreamMap[e]&&(this._StreamMap[e].stop(),delete this._StreamMap[e])}release(){this._SoundBufferMap={},this._StreamMap={}}setVolume(e,t,n){this._StreamMap[e]&&this._StreamMap[e].setVolume(t)}setPriority(e,t){}setRate(e,t){}setLoop(e,t){}_requestBuffer(e,t){const n=new XMLHttpRequest;n.open("GET",e,!0),n.responseType="arraybuffer",n.onload=()=>{200===n.status?(console.log("http request succeed"),t(0,n.response)):(console.error(`download audio ${e} failed.`,n.status),t(-1,null))},n.send()}}_=i}else _=null;var v=_;e.JsViewId=1;const g=await async function(){window.global=window;const{default:n}=await import("./jsview-dom-browser-forge.min.js"),s=await n(t);s.jse$impl$WasmImpl.SetModule(s);const i=s.forge$dom$WasmPlatformDomBridge;return e.WasmBridge=i,s.WasmJscExports=s.forge$WasmJscExports,s}();let y=g.forge$WasmResProviderExports;y.initResInstance(1),g.WasmJscExports.InitJsc(1,window.JsvCoreApi.getJsContextId()),g.forge$front$ForgeCanvasApi.SetupGLContext("#forge-canvas");let E=null,S=new class{constructor(){this._Categories=new Map}listenerToAckEvent(e,t,n,s){let i=this._Categories.get(e);i||(i=new d,this._Categories.set(e,i));let o=i.SubTypes.get(t);o||(o=new m,i.SubTypes.set(t,o));let a=o.Trackers.get(n);a||(a=[],o.Trackers.set(n,a)),a.push(s),console.log(`listenerToAckEvent c:${e} t:${t} id:${n}`)}recycleAckListener(e){if(!e)return void console.error("Error: listener is null");let t=!1;for(const n of this._Categories.values())for(const s of n.SubTypes.values())for(const n of s.Trackers.values())for(let s=n.length-1;s>=0;s--)n[s]==e&&(t=!0,n.splice(s,1));t||console.error("Error: listener not found")}dispatcher(e,t,n,s){let i=this._Categories.get(e)?.SubTypes.get(t)?.Trackers.get(n);if(i)for(let e=0;e<i.length;e++)i[e](s)}};function w(e){!async function(e){await async function(){const e=[import("./DroidSansFallback.ttf").then(async e=>(await fetch(e.default)).arrayBuffer()),import("./NotoColorEmoji.ttf").then(async e=>(await fetch(e.default)).arrayBuffer()),import("./DroidNaskh-Regular.ttf").then(async e=>(await fetch(e.default)).arrayBuffer()),import("./DroidSans.ttf").then(async e=>(await fetch(e.default)).arrayBuffer())];await Promise.all(e).then(e=>{const t=new Uint32Array(e.length),n=new Uint32Array(e.length);for(let s=0;s<e.length;++s){const i=e[s];if(i){const e=new Uint8Array(i),o=g.malloc(i.byteLength);g.HEAPU8.set(e,o),t[s]=o,n[s]=i.byteLength}}const s=g.malloc(4*t.length);g.HEAPU32.set(t,s>>2);const i=g.malloc(4*n.length);g.HEAPU32.set(n,i>>2),y.SetFonts(1,s,i,e.length)})}(),window.JsvCoreApi.WasmExt.setLogSingleton(g.forge$Log,g.jse$Log),window.JsvCoreApi.WasmExt.setEventBridge(S),E=function(e,t){return u=new p(e,t),u}(g.forge$front$ForgeCanvasApi,1),window.JsvCoreApi.WasmExt.setForgeCanvasSingleton(E),E.startDraw();let t=E.getForgeRT();E.setMessageDispatcher(n);let s={frtNativeHandle:t,canvasNativeHandle:E.getCanvasToken()};E.linkToHandleType(s),e?.(s)}(e)}function C(){return n}g.forge$front$EventBridge.SetupEventBridge(1,S.dispatcher.bind(S)),window.JsvCode.BrowserPlatformDomBridge=e,window.JsvCode.MessageDispatcher=n,e.RegisterOriginDocument=function(e){console.log("RegisterOriginDocument in"),window.originDocument=e},window.SoundPool=v;export{C as getJMD,w as takeCanvas};
|
|
2
2
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* eslint-disable */ let e={sRenderBridge:null,sActivityManager:null,DesignMap:null};window.Forge=e;let t=function(e){},i=function(e){},n=function(e){},s=function(e){throw new Error(e)};class a{constructor(){this._EnqueueInfoList=[],this._EnqueueObjList=[],this._OnStartSyncCallback=[],this._AlterIdCandidateMap={}}RequestAlterId(e,t){this._AlterIdCandidateMap[e]=t}AddToQueue(e,t){this._EnqueueInfoList.push(t),this._EnqueueObjList.push(e)}HasUpdate(){return this._EnqueueInfoList.length>0}ReadSyncList(){if(this._OnStartSyncCallback.length>0){for(let e of this._OnStartSyncCallback)e();this._OnStartSyncCallback=[]}let e=this._EnqueueInfoList;return this.RenewSyncList(),e}AddStartSyncCallback(e){this._OnStartSyncCallback.push(e)}RenewSyncList(){if(this._EnqueueObjList)for(let e of this._EnqueueObjList)e.RenewSyncInfo(this,null);this._EnqueueInfoList=[],this._EnqueueObjList=[]}ProcAlterIds(e,t){for(let i=0;i<e.length;i++)if(this._AlterIdCandidateMap.hasOwnProperty(e[i])){let n=this._AlterIdCandidateMap[e[i]];n.OnAlterId(t[i]),n.RenewSyncInfo(this,null)}else console.error(`Error: ProcAlterIds not found proxyId=${e[i]}`);this._AlterIdCandidateMap={}}}class r{constructor(e,t=null,i=null){this._PrefSyncListRef=e,this.PrefSyncInfo=null,this._PrefTaskList=null,this._PrefEnqueued=!1,this._SuffSyncListRef=t,this.SuffSyncInfo=null,this._SuffTaskList=null,this._SuffEnqueued=!1,this.InitPackage(i),this.RenewSyncInfo(this._PrefSyncListRef,null),this.RenewSyncInfo(this._SuffSyncListRef,null)}AddStartSyncCallback(e){this._PrefSyncListRef.AddStartSyncCallback(e)}CallToNative(t,i,n=!1){let s={fn:t,a:i};return n?(this._SuffTaskList.push(s),this._SuffEnqueued||(this._SuffSyncListRef.AddToQueue(this,this.SuffSyncInfo),this._SuffEnqueued=!0)):(this._PrefTaskList.push(s),this._PrefEnqueued||(this._PrefSyncListRef.AddToQueue(this,this.PrefSyncInfo),this._PrefEnqueued=!0)),e.sRenderBridge.RequestSwap(),s}RequestAlterId(e,t=!1){t?this._SuffSyncListRef.RequestAlterId(e,this):this._PrefSyncListRef.RequestAlterId(e,this)}SuffCallToNative(e,t){return{fn:e,a:t}}AlterCallParams(e,t){e&&(e.a=t)}RenewSyncInfo(e,t){t||(t={}),this._PrefEnqueued=!1,this._SuffEnqueued=!1,e&&e==this._PrefSyncListRef&&(this._PrefTaskList=[],this.PrefSyncInfo={tl:this._PrefTaskList,...t}),e&&e==this._SuffSyncListRef&&(this._SuffTaskList=[],this.SuffSyncInfo={tl:this._SuffTaskList,...t})}InitPackage(e){}OnAlterId(e){}}let o=new a,l=new a;class h extends r{constructor(e){super(o,l,{id:e}),this._TextureRef=null,this._RenderTextureId=e}InitPackage(e){this._RenderTextureId=e.id}RenewSyncInfo(e,t){super.RenewSyncInfo(e,{tt:1,id:this._RenderTextureId})}NeedAlterId(e,t){this._TextureRef=e,super.RequestAlterId(this._RenderTextureId,t)}OnAlterId(e){this._RenderTextureId=e,this._TextureRef.TexId=e,this._TextureRef=null}}let c=new class extends r{constructor(){super(o,l)}RenewSyncInfo(e,t){super.RenewSyncInfo(e,{tt:0})}};let u=new class{constructor(){this._StoreArray=[1]}AddData(e){return this._StoreArray.push(e),this._StoreArray.length-1}TakeArray(){const e=this._StoreArray;return this._StoreArray=[1],e}PickArray(){return this._StoreArray}GetSize(){return this._StoreArray.length}ResetForNextSwap(){this._StoreArray=[1]}};let d=1;class _{constructor(e,t,i=!1){this._NativeSyncer=t,this.TexId=e,this._TextureReady=!1,this._TextureWidth=0,this._TextureHeight=0,this._InnerLoadCallback=null,this._CallbackMap={},this._DomDepends=i}GetTextureId(){return this.TexId}RequestSyncerAlterId(){this._NativeSyncer.NeedAlterId(this,this._DomDepends)}RegisterLoadImageCallback(e,t,i){if(null==t)return 0;if(this._TextureReady)return t({width:this._TextureWidth,height:this._TextureHeight},i),0;{this._RegisterInnerLoadCallback();const e=d++,n=this,s=(s,a,r)=>{t({width:s,height:a,extra:r?JSON.parse(r):null},i),delete n._CallbackMap[e]};this._CallbackMap[e]=s;const a=u.AddData(s);return this._NativeSyncer.CallToNative(1,[e,a],this._DomDepends),e}}UnregisterLoadImageCallback(e){e>0&&void 0!==this._CallbackMap[e]&&delete this._CallbackMap[e]}DispatchCommand(t,i){this._NativeSyncer.CallToNative(3,[t,i],this._DomDepends),e.sRenderBridge.RequestSwap()}_RegisterInnerLoadCallback(){if(null==this._InnerLoadCallback){const e=this;this._InnerLoadCallback=(t,i,n)=>{e._TextureReady=!0,e._TextureWidth=t,e._TextureHeight=i};const t=u.AddData(this._InnerLoadCallback);this._NativeSyncer.CallToNative(1,[d++,t],this._DomDepends)}}EnableBackgroundLoad(){this._TextureReady||(this._RegisterInnerLoadCallback(),this._NativeSyncer.CallToNative(4,null,this._DomDepends))}DisableBackgroundLoad(){this._NativeSyncer.CallToNative(5,null,this._DomDepends)}RequestToUnload(){this._NativeSyncer.CallToNative(6,null,this._DomDepends)}DisableAutoRecycle(){this._NativeSyncer.CallToNative(7,null,this._DomDepends)}}class S extends _{constructor(e,t,i=!1){super(e,t,i),this._GifTextureInfo=null}registerOnStart(e){this._EnableGifTextureInfo();let t=this._GifTextureInfo,i=++t.IdGen;if(t.StartMapCount++,t.StartMapCount>0&&0==t.GlobalStartCallbackId){t.GlobalStartCallbackId=i;const e=()=>{for(let e in t.OnStartMap)t.OnStartMap[e]?.()},n=u.AddData(e);this._NativeSyncer.CallToNative(10,[t.GlobalStartCallbackId,n],this._DomDepends)}return t.OnStartMap[i]=e,i}unregisterOnStart(e){if(!this._GifTextureInfo)return;let t=this._GifTextureInfo;t.OnStartMap.hasOwnProperty(e)&&t.StartMapCount--,0==t.StartMapCount&&0!=t.GlobalStartCallbackId&&(this._NativeSyncer.CallToNative(11,[t.GlobalStartCallbackId],this._DomDepends),t.GlobalStartCallbackId=0)}registerOnEnd(e){this._EnableGifTextureInfo();let t=this._GifTextureInfo,i=++t.IdGen;if(t.EndMapCount++,t.EndMapCount>0&&0==t.GlobalEndCallbackId){t.GlobalEndCallbackId=i;const e=()=>{for(let e in t.OnEndMap)t.OnEndMap[e]?.()},n=u.AddData(e);this._NativeSyncer.CallToNative(12,[t.GlobalEndCallbackId,n],this._DomDepends)}return t.OnEndMap[i]=e,i}unregisterOnEnd(e){if(!this._GifTextureInfo)return;let t=this._GifTextureInfo;t.OnEndMap.hasOwnProperty(e)&&t.EndMapCount--,0==t.EndMapCount&&0!=t.GlobalEndCallbackId&&(this._NativeSyncer.CallToNative(13,[t.GlobalEndCallbackId],this._DomDepends),t.GlobalEndCallbackId=0)}_EnableGifTextureInfo(){this._GifTextureInfo||(this._GifTextureInfo={IdGen:1,GlobalStartCallbackId:0,OnStartMap:{},StartMapCount:0,GlobalEndCallbackId:0,OnEndMap:{},EndMapCount:0})}}class p extends S{constructor(e,t){super(e,t,!0)}}let y=window.NativeGetIdGroupIntf();const v=10;class m{constructor(e){this._GroupType=e,this._TeamReadIndex=0,this._TeamFillIndex=0,this._Teams=new Array(v),this._ValidTeamsCount=0;for(let e=0;e<v;e++)this._Teams[e]={start:0,end:0,expired:!0}}genId(){this._Teams[this._TeamReadIndex].expired&&this._reserveNativeIds();let e=this._Teams[this._TeamReadIndex],t=e.start;return e.start++,e.start>e.end&&(e.expired=!0,this._TeamReadIndex=(this._TeamReadIndex+1)%v,this._ValidTeamsCount--),t}_reserveNativeIds(){let e=20*(v-this._ValidTeamsCount);if(e>0){let t=y.GetIdArray(this._GroupType,e);if(t){let e=JSON.parse(t);this._commitNativeIds(e[0],e[1])}}}_commitNativeIds(e,t){let i=t-e+1,n=Math.floor(i/20),s=e;for(let e=0;e<n;e++){let e=this._Teams[this._TeamFillIndex];e.start=s,e.end=s+20-1,e.expired=!1,this._TeamFillIndex=(this._TeamFillIndex+1)%v,s=e.end+1}this._ValidTeamsCount+=n,this._ValidTeamsCount>v&&console.error(`team over size to ${this._ValidTeamsCount}`)}}let C=new class{constructor(){this._ViewGroup=new m(0),this._TextureGroup=new m(1),this._AnimationGroup=new m(2),this._SensorGroup=new m(3)}genViewId(){return this._ViewGroup.genId()}genTextureId(){return this._TextureGroup.genId()}genAnimationId(){return this._AnimationGroup.genId()}genSensorId(){return this._SensorGroup.genId()}};var f,I,T;!function(e){e.RGBA_8888="RGBA_8888",e.RGBA_4444="RGBA_4444",e.RGBA_5551="RGBA_5551",e.RGB_565="RGB_565",e.RGB_ETC1="RGB_ETC1",e.RGBA_ETC1="RGBA_ETC1"}(f||(f={})),function(e){e.L=1,e.M=0,e.Q=3,e.H=2}(I||(I={})),function(e){e.AUTO=0,e.SYNC=1,e.ASYNC=2}(T||(T={}));class N{constructor(){this._NativeSyncer=c}GetId(){return 0}GetColorTexture(e){let t=C.genTextureId();this._NativeSyncer.CallToNative(1,[e,t]);let i=new _(t,new h(t));return i.RequestSyncerAlterId(),i}GetImage(e,t,i){return this.GetImage2(e,t,null,null,i)}GetImage2(e,t,i,s=f.RGBA_8888,a="",r=!1){if(!e||0==e.length)return n("GetImage2, url is not setted!"),null;let o=C.genTextureId(),l=0,c=0;i&&(l=i.width,c=i.height),s||(s=f.RGBA_8888),a||(a="");let u=null!=r&&r;this._NativeSyncer.CallToNative(2,[e,l,c,s,a,u,o]);let d=new _(o,new h(o));return d.RequestSyncerAlterId(),d}GetQRCodeTexture(e,t,i,n=T.AUTO,s=I.Q,a="#ffffff",r="#000000",o=-1){let l=C.genTextureId();return this._NativeSyncer.CallToNative(3,[e,t,i,s,a,r,o,n,l]),new _(l,new h(l))}GetDownloadTexture(e,t,i){if(!e)return n("GetDownloadTexture, url is null!"),null;let s=C.genTextureId();return this._NativeSyncer.CallToNative(4,[e,t,i,s]),new _(s,new h(s))}GetDomProxyTexture(e){let t=C.genTextureId();return this._NativeSyncer.CallToNative(5,[e,t],!0),new p(t,new h(t))}GetCanvasTexture(e,t){let i=C.genTextureId();return this._NativeSyncer.CallToNative(6,[e,t,i],!1),new _(i,new h(i))}GetPluginTexture(e,t){let i=C.genTextureId();return this._NativeSyncer.CallToNative(7,[e,t,i],!1),new _(i,new h(i))}GetCapturedTexture(){let e=C.genTextureId();return this._NativeSyncer.CallToNative(8,[e],!1),new _(e,new h(e))}}let g=new class{constructor(){this._count=1}get count(){return this._count}update(){this._count<Number.MAX_SAFE_INTEGER?++this._count:this._count=1}},A=new a,R=new a;let w=new class extends r{constructor(){super(A,R)}RenewSyncInfo(e){super.RenewSyncInfo(e,{tt:0})}};class E extends r{constructor(e){super(A,R,{id:e}),this._AnimId=e}InitPackage(e){this._AnimId=e.id}RenewSyncInfo(e){super.RenewSyncInfo(e,{tt:1,id:this._AnimId})}}let b=new a,D=new a;class x extends r{constructor(e){super(b,D,{id:e}),this._ViewId=e}InitPackage(e){this._ViewId=e.id}RenewSyncInfo(e){super.RenewSyncInfo(e,{tt:1,id:this._ViewId})}}let P=new class extends r{constructor(){super(b,D)}RenewSyncInfo(e){super.RenewSyncInfo(e,{tt:0})}},F=new a;class L extends r{constructor(e){super(null,F,{id:e}),this._SensorId=e}InitPackage(e){this._SensorId=e.id}RenewSyncInfo(e,t){super.RenewSyncInfo(e,{tt:1,id:this._SensorId})}}let k=new class extends r{constructor(){super(null,F)}RenewSyncInfo(e,t){super.RenewSyncInfo(e,{tt:0})}};var O=null,G=null;class V{constructor(){this._ScreenInfo={width:160,height:90,x:2/160,y:2/90,perspective:2/160,scaleRatio:1,designedWidth:1280},this.SwapCurrentTime=Date.now(),this.SwapCurrentCount=0,this._WillSwapCallbacks=new Map,this._DoWillSwapCallback=this._OnWillSwap.bind(this),this._NativeForgeRT={hdl:null},this._ApiLinkStatusReady=!0,this._SwapTimer=-1,this._OnRequesting=!1,this._OnRequestSeq=1,this._ApiLinkStatusReady=!1,this._InitNativeBridge(),this._EnableRequestSwap=!1,this._CommandParamsCache=[],this._NewSwapSeq=1,this._ForgeFrontRender.OnScreenHide&&window.JsView?.onVisibilityChange((e=>{'{"status":"hide"}'===e&&this._ForgeFrontRender.OnScreenHide()}))}_InitNativeBridge(){void 0!==global.NativeSendImpactSensorSyncData&&global.NativeSendImpactSensorSyncData.bind(this._NativeForgeRT),void 0!==global.NativeSetStepFpsSwitch&&(O=global.NativeSetStepFpsSwitch.bind(this._NativeForgeRT)),void 0!==global.NativeSetGlobalConfig&&(G=global.NativeSetGlobalConfig.bind(this._NativeForgeRT)),this._ForgeFrontRender=global.NativeGetRenderIntf(),this._ForgeFrontRender.RegisterSwapFunc((()=>{this.RequestSwap()})),this._DoRequestSwap=this._DoRequestSwap.bind(this),this._ForgeFrontRender.RegisterPreDomSyncFunc((()=>{this._ProcPreDomSync()})),this._ForgeFrontRender.RegisterOnScreenInfo(this._OnScreenInfoChange.bind(this))}SetStepFpsSwitch(e){this._ApiLinkStatusReady?O&&O(e):(console.warn("SetStepFpsSwitch(): API link status no ready!"),this._CommandParamsCache.push((()=>{this.SetStepFpsSwitch(e)})))}SetGlobalConfig(e){if(this._ApiLinkStatusReady){if(G){let t=JSON.stringify(e);console.log("SetGlobalConfig set with "+t),G(t),console.log("SetGlobalConfig set done")}}else console.warn("SetGlobalConfig(): API link status no ready!"),this._CommandParamsCache.push((()=>{this.SetGlobalConfig(e)}))}_PerformCachedCommand(){if(this._CommandParamsCache.length>0){for(let e=0;e<this._CommandParamsCache.length;e++)this._CommandParamsCache[e]();this._CommandParamsCache=[]}}RequestSwap(){this._OnRequesting?this._NewSwapSeq++:(this._OnRequesting=!0,this._NewSwapSeq++,this._OnRequestSeq++,this._PromiseRequestSwap(this._OnRequestSeq))}_PromiseRequestSwap(e){let t=this,i=this._NewSwapSeq;Promise.resolve().then((()=>{i==t._NewSwapSeq?t.InstantPerformSwap():e==this._OnRequestSeq&&t._PromiseRequestSwap(e)}))}NotifyNetTypeStatus(e,t){}EnableRequestSwap(e){this._EnableRequestSwap=e,this._ForgeFrontRender.EnableRequestSwap(e)}InstantPerformSwap(){this._OnRequesting&&(this._OnRequesting=!1,this._OnRequestSeq++,this._DoRequestSwap(!1))}_ProcSyncerList(e,t,i,n,s){let a=null,r=null,o=null,l=null,h=null;if(e.HasUpdate()&&(o=e.ReadSyncList()),t.HasUpdate()&&(r=t.ReadSyncList()),i.HasUpdate()&&(a=i.ReadSyncList()),n?.HasUpdate()&&(l=n.ReadSyncList()),null==a&&null==r&&null==o&&null==l||(h=this._ForgeFrontRender.SyncForgeJsCall(JSON.stringify({TexSync:o,AnimSync:r,ViewSync:a,SensorSync:l}),s)),h){let t;this._OnRequesting=!1,t=JSON.parse(h).TexSyncRet,t&&this._ProcTextureSyncRet(e,t)}}_ProcPreDomSync(){this._ProcSyncerList(o,A,b,null,u.PickArray())}_DoRequestSwap(e){if(!this._EnableRequestSwap)return void(this._OnRequesting=!1);g.update();let t=u.GetSize();if(this._ProcSyncerList(o,A,b,null,u.PickArray()),this._WillSwapCallbacks.size>0&&this._WillSwapCallbacks.forEach(this._DoWillSwapCallback),this._ProcSyncerList(l,R,D,F,u.PickArray()),t==u.GetSize())u.ResetForNextSwap();else{let e=u.GetSize();e>50&&console.warn("Warning: temp sync store kept with large size = "+e)}e=!!e,this._OnRequesting=!1,this.SwapCurrentTime=Date.now(),this.SwapCurrentCount++,this._ForgeFrontRender.DoRequestSwap(e)}GetScreenInfo(){return this._ScreenInfo}SetForgeRtHandler(e){this._NativeForgeRT.hdl=e,this._ApiLinkStatusReady=!0,this._ForgeFrontRender.SetForgeRtHandler(e),this._PerformCachedCommand()}InitScreenBuffer(e,t){isNaN(e)&&(e=1),isNaN(t)&&(t=1280);var i=t*e,n=i/16*9;this._ScreenInfo.width=Math.floor(i),this._ScreenInfo.height=Math.floor(n),this._ScreenInfo.x=2/this._ScreenInfo.width,this._ScreenInfo.y=2/this._ScreenInfo.height,this._ScreenInfo.perspective=this._ScreenInfo.x,this._ScreenInfo.scaleRatio=e,this._ScreenInfo.designedWidth=t}InitNativeScreenBuffer(){if(this._ApiLinkStatusReady){var e=JSON.stringify({displayScaleRatio:this._ScreenInfo.scaleRatio,designedMapWidth:this._ScreenInfo.designedWidth});this._ForgeFrontRender.InitScreenBuffer(e)}else console.info("InitNativeScreenBuffer(): API link status no ready!")}SyncBackStatus(e,t){this._ForgeFrontRender.SyncBackStatus(e,t)}TakeAndSyncBackStatus(){1==this._ForgeFrontRender.TakeAndSyncBackStatus()&&this.RequestSwap()}_OnScreenInfoChange(e,t,i,n,s){this._ScreenInfo.width=e,this._ScreenInfo.height=t,this._ScreenInfo.x=i,this._ScreenInfo.y=n,this._ScreenInfo.perspective=s}HasPendingRenderBreak(){return!!this._ApiLinkStatusReady&&this._ForgeFrontRender.HasPendingRenderBreak()}FinishRenderBreak(e){this._ApiLinkStatusReady?this._ForgeFrontRender.FinishRenderBreak(e):(console.warn("FinishRenderBreak(): API link status no ready, delay"),this._CommandParamsCache.push((()=>{this._ForgeFrontRender.FinishRenderBreak(e)})))}AddWillSwapListener(e,t){this._WillSwapCallbacks.set(e,t)}AddSwappedOnceObserver(e){this._ApiLinkStatusReady?this._ForgeFrontRender.AddSwappedOnceObserver(e):(console.warn("AddSwappedOnceObserver(): API link status no ready, delay"),this._CommandParamsCache.push((()=>{this._ForgeFrontRender.AddSwappedOnceObserver(e)})))}ActiveComponent(e){this._ApiLinkStatusReady?this._ForgeFrontRender.ActiveComponent(e):(console.warn("ActiveComponent(): API link status no ready, delay"),this._CommandParamsCache.push((()=>{this._ForgeFrontRender.ActiveComponent(e)})))}ShutdownComponents(e){this._ApiLinkStatusReady?this._ForgeFrontRender.ShutdownComponents(e):(console.warn("ShutdownComponents(): API link status no ready, delay"),this._CommandParamsCache.push((()=>{this._ForgeFrontRender.ShutdownComponents(e)})))}SetPlatformMsgDisp(e){this._PlatformMessageDispatch=e}GetPlatformMsgDisp(){return this._PlatformMessageDispatch}GetTextToolsApi(){return this._ForgeFrontRender.TextToolApi}_OnWillSwap(e){e()}_ProcTextureSyncRet(e,t){let i;i=t.idAlter,i&&e.ProcAlterIds(i.proxy,i.real)}}class M{constructor(){this._DisableKeyGuard=!1,this._LastEventTime=0,this._IsActivte=!1,this._BaseTime=0,this._BaseRemoteTime=0,this._SupportGetTimeFromApi=!1,this._IsSystemKeyDelaySuit=!1,this._ExpiredKeyCount=0,this._LastValidKeyTime=0,this._UseTimeFromApi=void 0!==window.jRuntimeBridge?.getSystemUptimeMillis,this._UseTimeFromApi&&(this._SupportGetTimeFromApi=!0,this._GetTimeFromApi())}SetTranslateDelay(e){M.sKeyTranslateDelay=e}CheckKey(e){if(!e.timeStamp||this._DisableKeyGuard)return!1;this._IsActivte=!0;const t=Date.now(),n=e.timeStamp;!this._SupportGetTimeFromApi&&n-this._LastEventTime>3e3&&(this._BaseTime=t,this._BaseRemoteTime=n,this._LastEventTime=n);let s=t-this._BaseTime;(s<0||s>5e3)&&(this._UseTimeFromApi?this._GetTimeFromApi():(this._BaseTime=t,this._BaseRemoteTime=n),s=0);return s+this._BaseRemoteTime-n>M.CONST_MAX_PASSING_GAP&&Math.abs(this._LastValidKeyTime-n)<M.CONST_MIN_VALID_KEY_GAP&&!e.repeat?(!this._IsSystemKeyDelaySuit&&this._SupportGetTimeFromApi&&(this._ExpiredKeyCount++,this._ExpiredKeyCount>50&&i("More than 50 keys are expired...")),!0):(this._IsSystemKeyDelaySuit||(this._IsSystemKeyDelaySuit=!0),this._LastValidKeyTime=n,!1)}toggleKeyGuard(){this._DisableKeyGuard=!this._DisableKeyGuard}IsActive(){return this._IsActivte}_GetTimeFromApi(){this._BaseTime=Date.now(),this._BaseRemoteTime=window.jRuntimeBridge.getSystemUptimeMillis()-M.sKeyTranslateDelay}}M.CONST_MAX_PASSING_GAP=20,M.CONST_MIN_VALID_KEY_GAP=180,M.sKeyTranslateDelay=5;let B,q=new M;class W{constructor(s,a,r){var o;if(this._MainActivity=null,this._DesignedMapWidth=1280,this._KeyLock=!1,this._CanvasHandler=0,o=4,console.log.bind(console),o>0&&console.error.bind(console),o>1&&(t=console.error.bind(console)),o>2&&(i=console.warn.bind(console)),o>3&&(n=console.log.bind(console)),o>4&&console.debug.bind(console),this._TextureManager=new N,this._RenderBridge=new V,e.sRenderBridge=this._RenderBridge,isNaN(r)&&(r=1280),this._DesignedMapWidth=r,this._KeyLock=!1,this._InitRenderer(s,a,r),this._EventHandlers={keyProc:null,keyUpProc:null,activityStateProc:null},this._RegisterKeyListener(this._EventHandlers),this._RegisterNativeActivityStateListener(this._EventHandlers),this._InstantSwapPromiseCallback=this._RenderBridge.InstantPerformSwap.bind(this._RenderBridge),null!=s){this._CanvasHandler=s.canvasNativeHandle;for(let e in this._EventHandlers)s[e]=this._EventHandlers[e]}e.sActivityManager=this,console.log("manager done")}GetTextureManager(){return this._TextureManager}DelayedActivateCanvas(e){if(0==this._CanvasHandler){this._CanvasHandler=e.canvasNativeHandle,this._EnableNativeBridge(e);for(let t in this._EventHandlers)e[t]=this._EventHandlers[t];this._RenderBridge.InitNativeScreenBuffer(),this._RenderBridge.RequestSwap()}else t("Error: already activated")}GetCanvasHandler(){return this._CanvasHandler}StartActivity(e){this._MainActivity=e}_InitRenderer(e,t,i){this._EnableNativeBridge(e),this._RenderBridge.InitScreenBuffer(t,i),this._RenderBridge.InitNativeScreenBuffer()}_EnableNativeBridge(e){null!=e&&(this._RenderBridge.SetForgeRtHandler(e.frtNativeHandle),e.renderBridge=this._RenderBridge,this._RenderBridge.EnableRequestSwap(!0))}_KeyProcDown(e){if(this._KeyLock)return!0;var t=!0;if(this._MainActivity){if(q.CheckKey(e))return console.log("keyEventGuard ignore keys"),!1;q.IsActive()&&this._RenderBridge.InstantPerformSwap(),t=!this._MainActivity.DispatchKeyDown(e),this._RenderBridge.TakeAndSyncBackStatus()}return t}_KeyProcUp(e){if(this._KeyLock)return!0;var t=!0;return this._MainActivity&&(t=!this._MainActivity.DispatchKeyUp(e),this._RenderBridge.TakeAndSyncBackStatus()),t}_RegisterKeyListener(e){e.keyProc=this._KeyProcDown.bind(this),e.keyUpProc=this._KeyProcUp.bind(this)}_RegisterNativeActivityStateListener(e){let t=this;var i=function(e){var i=e.State;switch(console.log("ActivityStateListenerChanged, state:"+i),i){case"onActivityResumed":t._RenderBridge.EnableRequestSwap(!0),t._RenderBridge.InstantPerformSwap();break;case"onActivityPaused":t._RenderBridge.EnableRequestSwap(!1)}}.bind(this);e.activityStateProc=i}}class K{constructor(){this._ActivityManager=null}Init(e){let t=1280,i=1;try{if(H){let e=H();"number"==typeof e.width&&(t=e.width),"number"==typeof e.displayScale&&(i=e.displayScale)}}catch(e){console.log("Note: DesignMap failed")}this._ActivityManager=new W(e,i,t),U?U(this._ActivityManager):console.error("FATAL: no found entry")}getActivityManager(){return this._ActivityManager}}let U=null,H=null;class J{constructor(e){this.PageName=e,this._FocusChild=null,this._LatestFocusChild=null,this.SubPages=[],this._ParentPage=null,this._KeyLock=!1}OnRenderFrame(){t("OnRenderFrame() MUST override")}OnKeyDown(e){return!1}OnKeyUp(e){return!1}DispatchKeyDown(e){if(this._KeyLock)return!0;let t=!1;return this._FocusChild&&(t=this._FocusChild.DispatchKeyDown(e)),t||(t=this.OnKeyDown(e)),t}OnCustomEvent(e){return!1}BubbleCustomEvent(e){this.OnCustomEvent(e)||this._ParentPage&&this._ParentPage.BubbleCustomEvent(e)}DispatchKeyUp(e){if(this._KeyLock)return!0;let t=!1;return this._FocusChild&&(t=this._FocusChild.DispatchKeyUp(e)),t||(t=this.OnKeyUp(e)),t}PrintLastFocusPage(){let e="------"+this.PageName+"\n",t=this._ParentPage;return t&&(e+=t.PrintLastFocusPage()),e}IsFocus(){return!this._ParentPage||this._ParentPage._FocusChild==this}_IsLeafInChain(){return this.IsFocus()&&!this._FocusChild}SetParent(e){null!=e?(this._ParentPage=e,e.SubPages.push(this)):s("ERROR: parent is null")}SetParentPage(e){this.SetParent(e)}OnRemoveFromTree(){if(this._ParentPage=null,this.SubPages&&this.SubPages.length>0){for(let e of this.SubPages)e.OnRemoveFromTree();this.SubPages=[]}}RemoveSubPage(e){e==this._FocusChild&&(this._FocusChild=null),e==this._LatestFocusChild&&(this._LatestFocusChild=null);for(let t=0;t<this.SubPages.length;t++)if(e==this.SubPages[t]){this.SubPages.splice(t,1);break}}ClearSubPages(){this.SubPages=[],this._FocusChild=null,this._LatestFocusChild=null}GetParentPage(){return this._ParentPage}Focus(e=!1){if(this.IsFocus()){if(!e)return void n("requestFocus(): Already focused name="+this.PageName);if(this._IsLeafInChain())return void n("requestFocus(): Already focused name="+this.PageName)}if(this._ParentPage){let t,i=[],n=this;for(;n._ParentPage&&!n.IsFocus();)i.push(n),n=n._ParentPage;t=e&&0==i.length?this._FocusChild:i[i.length-1]._ParentPage?._FocusChild;let a=[];for(;t;)a.push(t),t=t._FocusChild;for(let e=a.length-1;e>=0;e--)a[e]._BlurInternal();for(let e=i.length-1;e>=0;e--)i[e]._FocusInternal();if(e)this._LatestFocusChild=null;else{let e=i[0];for(;e._LatestFocusChild&&null==e._FocusChild;)e._LatestFocusChild._FocusInternal(),e=e._FocusChild,e||s("ERROR: focus chain is broken")}}}ReturnFocusToParent(){this._ParentPage&&(this.IsFocus()&&this._ParentPage.Focus(!0),this._ParentPage._FocusChild==this&&(this._ParentPage._FocusChild=null),this._ParentPage._LatestFocusChild==this&&(this._ParentPage._LatestFocusChild=null))}_FocusInternal(){this._ParentPage?(this._ParentPage._FocusChild=this,this._ParentPage._LatestFocusChild=this,this.OnFocus()):t("No dispatcher")}_BlurInternal(){this._ParentPage?this._ParentPage._FocusChild==this?(this._ParentPage._FocusChild=null,this.OnBlur()):i("Not focus yet, page name="+this.PageName):t("No dispacher")}GetFocusChild(){return this._FocusChild}OnFocus(){i("No overrided Page OnFocus event, page name="+this.PageName)}OnBlur(){i("No overrided Page OnBlur event, page name="+this.PageName)}KeyLock(){this._KeyLock=!0}UnKeyLock(){this._KeyLock=!1}}var j;!function(e){e.VIEW_COMMAND=0,e.TEXTURE_COMMAND=1,e.ANIM_COMMAND=2,e.SYNC_COMMAND=3,e.APIC_PLAY=0,e.APIC_STOP=1,e.GET_BOUNDING_RECT=0,e.FILTER_VIEW_WAVE=1,e.TRANSLATE_FRAME_ALT_SPEED=0,e.FREE_MOVE_RUN_CMDPACKS=1,e.EXE_DEFAULT=0,e.EXE_AFTER_RENDER=1}(j||(j={}));const z=(e,t)=>{let i=0,n=0,s=0;return isNaN(e)||(i|=1,n=e),isNaN(t)||(i|=2,s=t),{e:i,x:n,y:s}};var Y,X,Q;!function(e){e.ActEvent_ActFinish=1,e.ActEvent_Speed_X_Revert=2,e.ActEvent_Speed_Y_Revert=3,e.ActEvent_ActReject=4,e.ActEvent_ActDragStart=5,e.ActEvent_ActDragEnd=6,e.ActEvent_ActFlingStart=7,e.ActEvent_ActFlingProgress=8,e.ActEvent_ActFlingEnd=9,e.ActEvent_ActTouchDown=10,e.ActEvent_ActTouchRelease=11,e.ActEvent_ActFlingCancel=12,e.ActEvent_ActFlingDrop=13,e.ActEvent_MovementSync=14}(Y||(Y={})),function(e){e.GroupType_ActionAssoc=10,e.GroupType_Fling=11,e.GroupType_Invalid_Ext=65535}(X||(X={})),function(e){e.FLING_ON_PROGRESS_INTERVAL=200}(Q||(Q={}));const $=(e,t)=>{e.gtype=t.g,e.once=t.m?0:1;let i=t.s;i&&(e.name=i),e.brk=t.brk?1:0};const Z=51;function ee(e){return e?JSON.stringify(e.Package()):null}let te=new class{constructor(){this._NativeSyncer=w}CreateTranslate(e,t,i,n,s,a,r){s!=1/0&&null!=s||(console.warn("translate animation duration invalid="+s),s=0),this._NativeSyncer.CallToNative(1,[e,t,i,n,s,ee(a),r])}CreateRotate(e,t,i,n,s,a,r){s!=1/0&&null!=s||(console.warn("rotate animation duration invalid="+s),s=0),this._NativeSyncer.CallToNative(2,[e,t,i.x,i.y,i.z,n.x,n.y,n.z,s,ee(a),r])}CreateScale(e,t,i,n,s,a,r,o,l,h,c){l!=1/0&&null!=l||(console.warn("scale animation duration invalid="+l),l=0),this._NativeSyncer.CallToNative(3,[e,t,i,n,s,a,r,o,l,ee(h),c])}CreateTranslateFrame(e,t,i,n,s,a,r,o){this._NativeSyncer.CallToNative(5,[e,t,i,n,!!s,a,r,o])}CreateCssKeyframe(e,t,i,n,s,a){t!=1/0&&null!=t||(console.warn("css animation duration invalid="+t),t=0),this._NativeSyncer.CallToNative(6,[e,t,i,n,s,a])}CreateFreeMoveAnimation(e,t,i,n){this._NativeSyncer.CallToNative(7,[e,t?u.AddData(t):0,i,n?1:0])}CreateShaderAnimation(e,t,i){this._NativeSyncer.CallToNative(8,[e,t,i])}};class ie{constructor(){this.AnimNativeId=C.genAnimationId(),this._NativeSyncer=new E(this.AnimNativeId),this._ListenerObj=null,this._ListenerStatusCallback=null}SetAnimationListener(e){this._OnNewListener(e)}AddAnimationListener(e){this._ListenerObj&&e.AddInherit(this._ListenerObj),this._OnNewListener(e)}RemoveAnimationListener(){this._ListenerObj=null}Enable(e){this._NativeSyncer.CallToNative(2,[e])}EnableInfinite(){return this._NativeSyncer.CallToNative(3,null),this}SetRepeat(e){return this._NativeSyncer.CallToNative(5,[e]),this}EnableDelay(e){return this._NativeSyncer.CallToNative(4,[e]),this}SetStartPos(e){return e>=0&&e<=1?this._NativeSyncer.CallToNative(6,[e]):console.warn("Warning: SetStartPos() out of range"),this}_OnNewListener(e){let t=!0;if(this._ListenerObj&&(t=this._ListenerObj.ListenerEnabledFlags==e.ListenerEnabledFlags),this._ListenerObj=e,null!=this._ListenerObj&&(null==this._ListenerStatusCallback||!t)){let e=this;this._ListenerStatusCallback=t=>{e._ListenerObj?.InvokeFromNativeForge(t)};let t=u.AddData(this._ListenerStatusCallback);this._NativeSyncer.CallToNative(1,[t,this._ListenerObj.ListenerEnabledFlags])}}}var ne,se;!function(e){e.ReleaseAfterEndCallback=1,e.KeepTransform=2,e.AckFinalProgress=4,e.AckRepeat=8}(ne||(ne={})),function(e){e.AltSpeed=(e,t,i)=>{let n={S60:Math.floor(100*t/55)/100,T:i};e?.DispatchAnimCommand(j.TRANSLATE_FRAME_ALT_SPEED,JSON.stringify(n))},e.RunFreeMoveCmdPacks=(e,t)=>{e?.DispatchAnimCommand(j.FREE_MOVE_RUN_CMDPACKS,JSON.stringify(t))}}(se||(se={}));class ae{constructor(){this._MaskType="COMMON"}Type(){return this._MaskType}ToSyncJsonObj(e){return e||(e={}),e.typ=this._MaskType,e}}let re=new class{constructor(){this._InnerViews={},this._ViewToken=0}add(e){let t=e.view.ViewId;return this._InnerViews.hasOwnProperty(t)&&(this._InnerViews[t]=e),t}remove(e){this._InnerViews[e]&&delete this._InnerViews[e]}get(e){return this._InnerViews[e]}clear(){this._InnerViews={},this._ViewToken=0}};class oe{constructor(){this.SensorId=C.genViewId(),this._NativeSync=new L(this.SensorId),this.CreateSensor()}CreateSensor(){}CreateTypedSensor(e){k.CallToNative(1,[this.SensorId,e],!0)}Recycle(){this._NativeSync.CallToNative(1,null,!0)}}class le{constructor(e,t,i,n){this.Texture=e,this.MaskSetting=t,void 0===n&&(n=!0),this.HasAlpha=n}ToSyncJsonObj(e=void 0){return e||(e={}),e.texId=this.Texture?this.Texture.TexId:0,e.alpha=this.HasAlpha,this.MaskSetting?e.mask=this.MaskSetting.ToSyncJsonObj():e.mask=null,e}}var he;!function(e){var t,i,n;(t=e.ControlType||(e.ControlType={})).DoKeepInRender=1,t.RecycleKeptView=2,(i=e.SyncedType||(e.SyncedType={})).Synced=0,i.NotSynced=1,i.RequestKeepInRender=2,i.OnKeepingInRender=3,i.RecycleKeeping=4,(n=e.TextureCoordAnchor||(e.TextureCoordAnchor={})).LeftTop=1,n.CenterTop=2,n.RightTop=3,n.LeftMiddle=4,n.Center=5,n.RightMiddle=6,n.LeftBottom=7,n.CenterBottom=8,n.RightBottom=9}(he||(he={}));let ce=new class{constructor(){this._NativeSyncer=P}CreateNativeView(e,t,i){this._NativeSyncer.CallToNative(1,[e,t],i)}CreateJsRootView(e){this._NativeSyncer.CallToNative(2,[e])}CreateDomProxyView(e,t,i){this._NativeSyncer.CallToNative(3,[e,t,i?1:0],!0)}};class ue{constructor(e,t,i=!1){this.Visibility=void 0,this._NativeSyncer=new x(e),this.ViewId=e,this.TextureSetting=null,this._CallTextureSet=null,this._DomDepends=i,this._GetBCRCallback=null,this.CreateView(t)}CreateView(e=void 0){}ResetTexture(e=null){if(!this._CallTextureSet){this._CallTextureSet=this._NativeSyncer.CallToNative(1,null,this._DomDepends);let e=this;this._NativeSyncer.AddStartSyncCallback((()=>{this.TextureSetting?e._NativeSyncer.AlterCallParams(e._CallTextureSet,[e.TextureSetting.ToSyncJsonObj()]):e._NativeSyncer.AlterCallParams(e._CallTextureSet,[null]),e._CallTextureSet=null}))}this.TextureSetting=e}BindedPageBase(e){}SetVisibility(e){if("INHERIT"!==e&&void 0!==e||(e="VISIBLE"),this.Visibility!=e){this.Visibility=e;let t=0;switch(e){case"VISIBLE":t=1;break;case"GONE":t=2;break;case"HIDDEN":t=3;break;default:return void console.error("unknown visible type="+e)}this._NativeSyncer.CallToNative(2,[t],this._DomDepends)}}AddView(e,t){let i={x:0,y:0,width:0,height:0};t&&(i=this._FormatLayoutParams(t)),this._NativeSyncer.CallToNative(3,[e.ViewId,t?1:0,i.x,i.y,i.width,i.height],this._DomDepends)}ClearViews(){this._NativeSyncer.CallToNative(4,null,this._DomDepends)}ResetTextureCssTransform(e,t){e=e||"",t=t||"",this._NativeSyncer.CallToNative(5,[e,t],this._DomDepends)}SetTextureCoord(e,t,i,n,s=he.TextureCoordAnchor.Center){this._NativeSyncer.CallToNative(9,[e,t,i,n,s],this._DomDepends)}ResetLayoutParams(e){let t;null!=e?(t=this._FormatLayoutParams(e),this._NativeSyncer.CallToNative(6,[t.x,t.y,t.width,t.height],this._DomDepends)):s("ResetLayoutParams(): new params is null")}_FormatLayoutParams(e){return{x:isNaN(e.x)?0:e.x,y:isNaN(e.y)?0:e.y,width:isNaN(e.width)?0:e.width,height:isNaN(e.height)?0:e.height}}GetBoundingClientRect(){return new Promise(((e,t)=>{null!=this._GetBCRCallback&&(this._GetBCRCallback=null),this._GetBCRCallback=i=>{null!=this._GetBCRCallback&&(this._GetBCRCallback=null);const n=JSON.parse(i);0==n.status?e(n.data):t(n.error)};const i=u.AddData(this._GetBCRCallback);this._NativeSyncer.CallToNative(12,[i],this._DomDepends)}))}StartAnimation(e,t,i){let n=e?e.AnimNativeId:0;this._NativeSyncer.CallToNative(7,[n,isNaN(i)?0:i],this._DomDepends)}StopAnimation(){this._NativeSyncer.CallToNative(8,null,this._DomDepends)}DispatchAnimCommand(e,t){this._NativeSyncer.CallToNative(13,[e,t],this._DomDepends)}StartTextureAnimation(e){let t=e?e.AnimNativeId:0;this._NativeSyncer.CallToNative(10,[t],this._DomDepends)}StopTextureAnimation(){this._NativeSyncer.CallToNative(11,null,this._DomDepends)}DragEnables(e){this._NativeSyncer.CallToNative(14,[e],this._DomDepends)}SetTapListener(e=void 0){if(null!=e){const t=u.AddData(e);this._NativeSyncer.CallToNative(15,[t],this._DomDepends)}else this._NativeSyncer.CallToNative(15,[0],this._DomDepends)}EnableAutoSize(){this._NativeSyncer.CallToNative(16,[],this._DomDepends)}RegisterFlexAssigned(e=void 0){if(null!=e){const t=u.AddData(e);this._NativeSyncer.CallToNative(17,[t],this._DomDepends)}else this._NativeSyncer.CallToNative(17,[0],this._DomDepends)}EnableVisibleTestRect(){this._NativeSyncer.CallToNative(18,[],this._DomDepends)}Capture2Texture(e,t=void 0){if(!e)return void console.error("Error: Capture2Texture need target texture");let i=e.GetTextureId();if(!t)return void console.error("Error: Capture2Texture need callback");const n=u.AddData(t);this._NativeSyncer.CallToNative(19,[i,n],this._DomDepends)}}class de extends ue{constructor(e=null){!e||e instanceof le||s("ERROR:LayoutView need TextureSetting as parameter"),super(C.genViewId(),{DomDepends:!1}),this.Visibility="VISIBLE",e&&this.ResetTexture(e)}CreateView(e){ce.CreateNativeView(this.ViewId,0,e.DomDepends)}}function _e(e){let t=[];if(e instanceof Array)for(let i of e)i instanceof ue&&t.push(i.ViewId);return t}class Se extends oe{constructor(e,t,i,n){super(),this.InitSet(e,t,i,n)}CreateSensor(){this.CreateTypedSensor(3)}InitSet(e,t,i,n){let s=0;i&&(s=u.AddData((e=>{1==e?i.OnBeginContact?.():2==e&&i.OnEndContact?.()}))),this._NativeSync.CallToNative(20,[e.ViewId,t.ViewId,s,n?n.SensorId:0],!0)}}let pe={StartTrace:(e,t,i,n)=>new Se(e,t,i,n),Callback:class{constructor(e,t){this.OnBeginContact=e,this.OnEndContact=t}UpdateImpactCallback(e){this.OnBeginContact=e}UpdateLeaveCallback(e){this.OnEndContact=e}},AutoFroze:class extends oe{constructor(e,t){super(),this.InitSet(),this._UpdatePreImpactList(_e(e)),this._UpdateOnImpactList(_e(t)),this._FreshAutoRecycleRef()}CreateSensor(){this.CreateTypedSensor(2)}InitSet(){this._NativeSync.CallToNative(25,null,!0)}UpdatePreImpactList(e){this._UpdatePreImpactList(_e(e)),this._FreshAutoRecycleRef()}UpdateOnImpactList(e){this._UpdateOnImpactList(_e(e)),this._FreshAutoRecycleRef()}_UpdatePreImpactList(e){this._NativeSync.CallToNative(26,[...e],!0)}_UpdateOnImpactList(e){this._NativeSync.CallToNative(27,[...e],!0)}_FreshAutoRecycleRef(){this._NativeSync.CallToNative(28,null,!0)}}};var ye;!function(e){e[e.NONE=0]="NONE",e[e.TEXT=1]="TEXT",e[e.PASSWORD=2]="PASSWORD",e[e.TEXT_AREA=3]="TEXT_AREA",e[e.CONTENT_EDITABLE=4]="CONTENT_EDITABLE",e[e.SEARCH=5]="SEARCH",e[e.URL=6]="URL",e[e.EMAIL=7]="EMAIL",e[e.TELEPHONE=8]="TELEPHONE",e[e.NUMBER=9]="NUMBER"}(ye||(ye={}));var ve,me;!function(e){var t;(t=e.UniformType||(e.UniformType={}))[t.FLOAT=1]="FLOAT"}(ve||(ve={})),function(e){var t,i;(t=e.Type||(e.Type={}))[t.GRAY_DOWN=1]="GRAY_DOWN",t[t.WAVE=2]="WAVE",(i=e.Wave||(e.Wave={}))[i.CIRCLE_WAVE=1]="CIRCLE_WAVE",i[i.RECTANGLE_WAVE=2]="RECTANGLE_WAVE"}(me||(me={}));let Ce=0;class fe{constructor(){this.sourceList=[]}addSource(e,t,i,n,s){n=n??{type:me.Wave.CIRCLE_WAVE},s=s??{timeDecay:3,distanceDecay:10,speed:100,frequency:8,waveNum:2};const a=++Ce;let r=0,o=0,l=0;return n.type==me.Wave.RECTANGLE_WAVE&&(r=n.width,o=n.height,l=n.radius),this.sourceList.push(a,e,t,i,r,o,l,s.timeDecay,s.distanceDecay,s.speed,s.frequency,s.waveNum),a}getSourceList(){const e=this.sourceList;return this.sourceList=[],e}}class Ie extends ue{constructor(e,t){super(C.genViewId(),{DomElementId:e,UseMaskView:t},!0),this.Visibility="VISIBLE"}CreateView(e){ce.CreateDomProxyView(this.ViewId,e.DomElementId,e.UseMaskView)}RegisterOnProxyReady(e){e?.()}}function Te(e){return isNaN(e)?0:parseInt(e)}function Ne(e){return{fontFamily:e.fontFamily?e.fontFamily:be.sDefaultFont,fontSize:Te(e.fontSize),italic:"italic"===e.fontStyle,bold:"bold"===e.fontWeight,hasEmoji:1==e.JsvTextEmoji}}function ge(){return e.sRenderBridge.GetTextToolsApi()}function Ae(e,t){let i=Ne(t);return ge().GetTextWidth(e,JSON.stringify(i))}function Re(e,t){let i=Ne(t);const n=ge().GetOneLineTextDrawWidth(e,JSON.stringify(i)),s={totalWidth:n[0],sliceInfo:[]};for(let e=1;e<n.length;e+=3)s.sliceInfo.push({start:n[e],end:n[e+1],width:n[4]});return s}function we(e,t,i,n,s,a){let r;if(e>0)r=ge().GetCursorPosition(e,t,null,null,null,1);else{let o=Ne(n),l=function(e){let t=Te(e.height),i=Te(e.lineHeight),n="string"==typeof e.wordWrap?e.wordWrap:"none";return"nowrap"==e.whiteSpace&&(n="none"),{width:Te(e.width),height:t,textAlign:"string"==typeof e.textAlign?e.textAlign:"left",lineHeight:0==i?t:i,wordWrap:n,textOverflow:"string"==typeof e.textOverflow?e.textOverflow:"clip"}}(s);r=ge().GetCursorPosition(e,t,i,JSON.stringify(o),JSON.stringify(l),a?1:0)}return r}function Ee(e){ge().RemoveCursorTextCache(e)}var be;!function(e){e.sDefaultFont="黑体",e.sDefaultFontSize=30,e.sDefaultFontColor="#FFFFFF",e.sDefaultBackgroundColor="rgba(0, 0, 0, 0)",e.GetTextWidth=Ae,e.GetOneLineTextDrawWidth=Re,e.GetCursorPosition=we,e.RemoveCursorTextCache=Ee}(be||(be={}));let De=e;De.Run=function(e){return B=new K,B.Init(e),B},De.InitStarter=function(t,i){e.DesignMap=i,U=t,H=i},De.NewDomProxyView=function(e,t){return new Ie(e,t)},De.sFrameCount=g,De.NativeConstant=j,De.PageBase=J,De.ReactActivity=class extends J{constructor(e,t){super(e),this._TextureManager=t.GetTextureManager()}GetTextureManager(){return this._TextureManager}SetContentView(e,t){this._ContentView=e,this._ContentViewSize=t}},De.ViewTextureMask=class extends ae{constructor(e){super(),this._MaskType="TEXTURE",this.ImageTexture=e}ToSyncJsonObj(e){return e||(e={}),e.texId=this.ImageTexture.TexId,super.ToSyncJsonObj(e)}},De.ViewRoundCornerMask=class extends ae{constructor(e,t,i,n){super(),this._MaskType="CORNER",this._TopLeft=e,this._TopRight=isNaN(t)?e:t,this._BottomLeft=isNaN(i)?e:i,this._BottomRight=isNaN(n)?e:n}ToSyncJsonObj(e){return e||(e={}),e.tl=this._TopLeft,e.tr=this._TopRight,e.bl=this._BottomLeft,e.br=this._BottomRight,super.ToSyncJsonObj(e)}},De.sViewStore=re,De.ViewInfo=class{constructor(e,t){this.view=e,this.layout_params=t}},De.LayoutView=de,De.AutoStretchView=class extends de{constructor(e=null){super(e)}CreateView(e){ce.CreateNativeView(this.ViewId,12,e.DomDepends)}},De.EditControlView=class extends de{constructor(t=null){super(t),this._AppListeners=null,this._ImeSyncFunc=this._ImeEventListener.bind(this),this._MsgToken="_JscIme_"+this.ViewId,e.sRenderBridge.GetPlatformMsgDisp().subscribe(this._MsgToken,this._ImeSyncFunc)}CreateView(e){ce.CreateNativeView(this.ViewId,5,e.DomDepends)}releaseResource(){e.sRenderBridge.GetPlatformMsgDisp().unsubscribe(this._MsgToken,this._ImeSyncFunc)}setEditorStyle(e,t,i,n){this._NativeSyncer.CallToNative(5005,[e,t,i,n],this._DomDepends)}showIme(e,t,i,n,s){e!=ye.NONE?(void 0!==i&&null!=i||(i=t.length>0?t.length:0),i<0?i=0:i>t.length&&(i=t.length>0?t.length:0),this._NativeSyncer.CallToNative(5001,[e,encodeURIComponent(t),i,n,s],this._DomDepends)):console.log("showIme inputType error")}hideIme(){this._NativeSyncer.CallToNative(5002,null,this._DomDepends)}updateCursorOffset(e,t,i,n){this._NativeSyncer.CallToNative(5003,[e,t,i,n],this._DomDepends)}addImeEventListener(e){this._AppListeners=e}_OnStatusFromPlatform(e){this._NativeSyncer.CallToNative(5006,[e],this._DomDepends)}_ImeEventListener(e){if(e){var t=JSON.parse(e);if("text"==t.type){var i=t.text;let e=t.selectStart,n=t.scrollLeft,s=t.scrollTop;this._AppListeners?.OnTextChanged(decodeURIComponent(i),e,n,s)}else if("vstatus"==t.type){let e=t.isVisible?1:0;this._OnStatusFromPlatform(e),this._AppListeners?.OnStatusChanged(e)}else if("action"==t.type){var n=t.action;this._AppListeners?.OnEditAction(n)}}else console.log("EditControlView","_ImeEventListener input_data error")}},De.FilterView=class extends de{constructor(e=null,t){super(e),this._Type=t??me.Type.GRAY_DOWN,this._NativeSyncer.CallToNative(10002,[this._Type,[]],this._DomDepends)}CreateView(e){ce.CreateNativeView(this.ViewId,10,e.DomDepends)}FilterSwitch(e){this._NativeSyncer.CallToNative(10001,[e],this._DomDepends)}AddWaveSourceList(e){if(this._Type==me.Type.WAVE){const t={T:1,L:e.getSourceList()};this.DispatchCommand(j.FILTER_VIEW_WAVE,JSON.stringify(t))}else console.error("FilterView error: add wave source while filter view type is GRAY_DOWN.")}AddWaveSourceSingle(e,t,i,n={type:me.Wave.CIRCLE_WAVE},s={timeDecay:3,distanceDecay:10,speed:100,frequency:8,waveNum:2}){if(this._Type==me.Type.WAVE){const a=new fe,r=a.addSource(e,t,i,n,s);return this.AddWaveSourceList(a),r}return console.error("FilterView error: add wave source while filter view type is GRAY_DOWN."),-1}RemoveSource(e){if(this._Type==me.Type.WAVE){const t={T:2,L:e instanceof Array?e:[e]};this.DispatchCommand(j.FILTER_VIEW_WAVE,JSON.stringify(t))}else console.error("FilterView error: remove wave source while filter view type is GRAY_DOWN.")}DispatchCommand(e,t){t&&this._NativeSyncer.CallToNative(10003,[e,t],this._DomDepends)}},De.FragShaderView=class extends de{constructor(e=null){super(e)}CreateView(e){ce.CreateNativeView(this.ViewId,11,e.DomDepends)}SetShaderInfo(e,t,i,n){const s={shaderStr:e,uniformParams:t,textureParams:i};let a=0;null!=n&&(a=u.AddData(n)),this._NativeSyncer.CallToNative(7001,[JSON.stringify(s),a],this._DomDepends)}},De.NativeSharedView=class extends de{constructor(e){super(e),this._JsContextId=window.JsView?window.JsView.getJsContextId():0,this._TrackId=null,this.SetTrackId(this._JsContextId+"_"+this.ViewId)}CreateView(e){ce.CreateNativeView(this.ViewId,9,e.DomDepends)}GetTrackId(){return this._TrackId}SetTrackId(e){this._TrackId=e,this._NativeSyncer.CallToNative(10101,[this._TrackId],this._DomDepends)}SetOverSize(e){this._NativeSyncer.CallToNative(10102,[isNaN(e)?0:e],this._DomDepends)}},De.NinePatchView=class extends de{CreateView(e){ce.CreateNativeView(this.ViewId,4,e.DomDepends)}SetRepeat(e,t){this._NativeSyncer.CallToNative(4001,[e,t],this._DomDepends)}SetPadding(e,t){this._NativeSyncer.CallToNative(4002,[e,t],this._DomDepends)}SetImageDspSize(e,t){this._NativeSyncer.CallToNative(4003,[e,t],this._DomDepends)}SetDesignMapWidth(e){this._NativeSyncer.CallToNative(4004,[e],this._DomDepends)}EnableAlphaMix(e){this._NativeSyncer.CallToNative(4005,[e.TexId],this._DomDepends)}},De.PreloadView=class extends de{constructor(e=null){super(e)}CreateView(e){ce.CreateNativeView(this.ViewId,7,e.DomDepends)}},De.SprayView=class extends de{constructor(e=null){super(e),this.onStop=null}SetSprayInfo(e,t,i,n,s,a,r,o,l,h,c,u,d,_,S,p,y,v,m,C,f,I,T){this._NativeSyncer.CallToNative(6001,[e,t,i,n,s,a,r,o,l,h,c,u,d,_,!!S,!!p,!!y,v,m,C,f,I,T],this._DomDepends)}CreateView(e){ce.CreateNativeView(this.ViewId,6,e.DomDepends)}Start(){this._NativeSyncer.CallToNative(6002,[],this._DomDepends)}Stop(e=!1){this._NativeSyncer.CallToNative(6003,[e],this._DomDepends)}RegisterOnStop(e){this.onStop=e}_OnEvent(e){try{if("onStop"===JSON.parse(e).type)this.onStop?.()}catch(e){console.error("SprayView onEvent error",e)}}RegisterEventListener(){const e=u.AddData(this._OnEvent.bind(this));this._NativeSyncer.CallToNative(6004,[e])}},De.TextInputType=ye,De.FilterViewType=me,De.TextureSetting=le,De.ExternalTextureSetting=le,De.TextUtils=be,De.VisibleSensor=class extends oe{constructor(e,t=null){super(),this.InitSet(e,t)}CreateSensor(){this.CreateTypedSensor(1)}InitSet(e,t){let i=0;t&&(i=u.AddData(((e,i,n,s)=>{t(1==e,1==i,1==n,1==s)}))),this._NativeSync.CallToNative(11,[e.ViewId,i],!0)}ResetArea(e){"number"!=typeof e.horizon&&(console.log("horizon not set, default to 1.0"),e.horizon=1),"number"!=typeof e.vertical&&(console.log("vertical not set, default to 1.0"),e.vertical=1),this._NativeSync.CallToNative(12,[e.horizon,e.vertical],!0)}Enable(e){this._NativeSync.CallToNative(13,[!!e],!0)}ResetContainer(e){let t;t=e?e.ViewId:0,this._NativeSync.CallToNative(14,[t],!0)}},De.EnvBlockerSensor=class extends oe{constructor(e){super(),this.InitSet(e)}CreateSensor(){this.CreateTypedSensor(4)}InitSet(e){this._NativeSync.CallToNative(30,[e.ViewId],!0)}ResetTopGID(e){this._ResetSideGID(0,e)}ResetBottomGID(e){this._ResetSideGID(1,e)}ResetLeftGID(e){this._ResetSideGID(2,e)}ResetRightGID(e){this._ResetSideGID(3,e)}_ResetSideGID(e,t){this._NativeSync.CallToNative(31,[e,isNaN(t)?0:parseInt(t)],!0)}Enable(e){this._NativeSync.CallToNative(32,[e],!0)}},De.sImpactSensorManager=pe,De.TextureInstantLoad=T,De.QRCodeLevel=I,De.ColorSpace=f,De.TextureManager=N,De.FreeMoveExternType=X,De.AnimationListener=class{constructor(e,t,i){this.ListenerEnabledFlags=0,this.InvokeAnimationStart=e,this._OnAnimationStart=e,e&&(this.ListenerEnabledFlags|=1),this.InvokeAnimationEnd=t,this._OnAnimationEnd=t,t&&(this.ListenerEnabledFlags|=2),this.InvokeViewNoVisible=i,this._OnViewNoVisible=i,i&&(this.ListenerEnabledFlags|=4),this.InvokeAnimRepeat=null,this._OnAnimRepeat=null,this.InvokeAnimFinal=null,this._OnAnimFinal=null,this._AttachedGroup=null,this._InheritListener=[]}OnStart(e){return this.InvokeAnimationStart=this._OnAnimationStart=e,e?this.ListenerEnabledFlags|=1:this.ListenerEnabledFlags&=30,this}OnEnd(e){return this.InvokeAnimationEnd=this._OnAnimationEnd=e,e?this.ListenerEnabledFlags|=2:this.ListenerEnabledFlags&=29,this}OnRepeat(e){return this.InvokeAnimRepeat=this._OnAnimRepeat=e,e?this.ListenerEnabledFlags|=8:this.ListenerEnabledFlags&=23,this}OnFinalProgress(e){return this.InvokeAnimFinal=this._OnAnimFinal=e,e?this.ListenerEnabledFlags|=16:this.ListenerEnabledFlags&=15,this}AddInherit(e){if(e){if(0==this._InheritListener.length){var t=this;this.InvokeAnimationStart=function(){t._OnAnimationStart&&t._OnAnimationStart();for(var e=0;e<t._InheritListener.length;e++)t._InheritListener[e].InvokeAnimationStart?.()},this.InvokeAnimationEnd=function(e){t._OnAnimationEnd&&t._OnAnimationEnd(e);for(var i=0;i<t._InheritListener.length;i++)t._InheritListener[i].InvokeAnimationEnd?.(e)},this.InvokeViewNoVisible=function(){t._OnViewNoVisible&&t._OnViewNoVisible();for(var e=0;e<t._InheritListener.length;e++)t._InheritListener[e].InvokeViewNoVisible?.()},this.InvokeAnimFinal=function(e){t._OnAnimFinal&&t._OnAnimFinal(e);for(var i=0;i<t._InheritListener.length;i++)t._InheritListener[i].InvokeAnimFinal?.(e)},this.InvokeAnimRepeat=function(e){t._OnAnimRepeat&&t._OnAnimRepeat(e);for(var i=0;i<t._InheritListener.length;i++)t._InheritListener[i].InvokeAnimRepeat?.(e)},this.ListenerEnabledFlags=31}this._InheritListener.push(e)}}InvokeFromNativeForge(e){switch(e.type){case"end":this.InvokeAnimationEnd?.(1==e.normalEnd);break;case"novisible":this.InvokeViewNoVisible?.();break;case"final":this.InvokeAnimFinal?.(e.progress);break;case"repeat":this.InvokeAnimRepeat?.(e.timesCount)}}},De.AnimFireCommand=se,De.AnimationEnable=ne,De.TranslateAnimation=class extends ie{constructor(e,t,i,n,s,a){super(),te.CreateTranslate(e,t,i,n,s,a,this.AnimNativeId)}},De.RotateAnimation=class extends ie{constructor(e,t,i,n,s,a){super(),te.CreateRotate(e,t,i,n,s,a,this.AnimNativeId)}},De.ScaleAnimation=class extends ie{constructor(e,t,i,n,s,a,r,o,l=200,h=200){super(),te.CreateScale(e,t,i,n,s,a,l,h,r,o,this.AnimNativeId)}},De.TranslateFrameAnimation=class extends ie{constructor(e,t,i,n,s,a){super();let r=Math.floor(100*i/55)/100;te.CreateTranslateFrame(e,t,r,r,n,s,a,this.AnimNativeId)}},De.CssKeyframeAnimation=class extends ie{constructor(e,t,i,n,s){super(),te.CreateCssKeyframe(e,t,i,n,s,this.AnimNativeId)}},De.ShaderAnimation=class extends ie{constructor(e,t){super(),te.CreateShaderAnimation(e,t,this.AnimNativeId)}},De.FreeMoveAnimation=class extends ie{constructor(e,t,i){super(),this._EchoCallback=e,te.CreateFreeMoveAnimation(this.AnimNativeId,e,t,i)}},De.FreeMoveActEvtType=Y,De.FreeMoveCmdPackBuilder=class{static InitActCmdPack(e,t,i,n){return{t:1,cmds:n,tkn:isNaN(i)?0:i,spd:isNaN(e)?0:e,acc:isNaN(t)?0:t}}static InitStateCmdPack(e){return{t:2,cmd:e}}},De.FreeMoveConditionSet=class{static AppendSubCmd(e,t){const i="cmds";e.hasOwnProperty("cmdPacks")?console.error("Error: conflict with command pack list"):(e.hasOwnProperty(i)||(e[i]=[]),e[i]?.push(t))}static SetCmdList(e,t){t instanceof Array&&(e.hasOwnProperty("cmdPacks")?console.error("Error: conflict with command pack list"):e.cmds=t)}static SetCmdPackList(e,t){t instanceof Array&&(e.hasOwnProperty("cmds")?console.error("Error: conflict with sub-command list"):e.cmdPacks=t)}static InitCommonInfo(){return{g:0,m:!1,s:null,brk:!1}}static UpdateCommonInfo(e,t,i,n,s){e.g=t??0,e.m=i??!1,e.s=n??null,e.brk=s}static ReachPosition(e,t,i){let n=z(e,t),s={subt:1,react:1,e:n.e,xv:n.x,yv:n.y};return $(s,i),s}static AcrossPosition(e,t,i){let n=z(e,t),s={subt:1,react:2,e:n.e,xv:n.x,yv:n.y};return $(s,i),s}static BoxPosition(e,t,i,n,s){let a=0,r=0,o=0,l=0,h=0;isNaN(e)||(a=e,h|=1),isNaN(t)||(r=t,h|=2),isNaN(i)||(o=i,h|=4),isNaN(n)||(l=n,h|=8);let c={subt:1,react:7,de:h,lv:a,tv:r,rv:o,bv:l};return $(c,s),c}static StartMove(e,t){return this.OnMovement(t,1,1,e)}static OnMovement(e,t,i,n){let s={subt:1,react:9,xv:t,yv:i,e:n};return $(s,e),s}static OffsetPosition(e,t,i,n,s){let a=0,r=0,o=0,l=0,h=0;isNaN(e)||(a=e,h|=1),isNaN(t)||(r=t,h|=2),isNaN(i)||(o=i,h|=4),isNaN(n)||(l=n,h|=8);let c={subt:1,react:8,de:h,lv:a,tv:r,rv:o,bv:l};return $(c,s),c}static WallPosition(e,t,i,n){let s,a=z(t,i);switch(e){case"left":s=4;break;case"top":s=3;break;case"right":s=5;break;case"bottom":s=6;break;default:return console.error("WallPosition undefined direction",e),null}let r={subt:1,react:s,e:a.e,xv:a.x,yv:a.y};return $(r,n),r}static ReachSpeed(e,t,i){let n=z(e,t),s={subt:2,react:1,e:n.e,xv:n.x,yv:n.y};return $(s,i),s}static AcrossSpeed(e,t,i){let n=z(e,t),s={subt:2,react:2,e:n.e,xv:n.x,yv:n.y};return $(s,i),s}static TouchCount(e,t){let i={subt:5,react:2,tct:t};return $(i,e),i}static OnNexusEvent(e,t,i){let n={subt:3,nexus:e,etyp:t};return $(n,i),n}static OnDragStart(e,t){let i={subt:3,nexus:t,etyp:Y.ActEvent_ActDragStart};return $(i,e),i}static OnDragEnd(e,t){let i={subt:3,nexus:t,etyp:Y.ActEvent_ActDragEnd};return $(i,e),i}static OnTouchDown(e,t){let i={subt:3,nexus:t,etyp:Y.ActEvent_ActTouchDown};return $(i,e),i}static OnTouchRelease(e,t){let i={subt:3,nexus:t,etyp:Y.ActEvent_ActTouchRelease};return $(i,e),i}static OnFlingStart(e,t){let i={subt:3,nexus:t,etyp:Y.ActEvent_ActFlingStart};return $(i,e),i}static OnFlingProgress(e,t){let i={subt:3,nexus:t,etyp:Y.ActEvent_ActFlingProgress};return $(i,e),i}static OnFlingEnd(e,t){let i={subt:3,nexus:t,etyp:Y.ActEvent_ActFlingEnd};return $(i,e),i}static OnFlingCancel(e,t){let i={subt:3,nexus:t,etyp:Y.ActEvent_ActFlingCancel};return $(i,e),i}static OnFlingDrop(e,t){let i={subt:3,nexus:t,etyp:Y.ActEvent_ActFlingDrop};return $(i,e),i}static OnHitBlock(e,t){let i={subt:4,blkGid:e};return $(i,t),i}static OnNextTick(e,t){let i={subt:5,react:1,tgap:e};return t.m=!1,$(i,t),i}static MovementSyncNexus(e,t){let i={subt:3,nexus:t,etyp:Y.ActEvent_MovementSync};return $(i,e),i}},De.FreeMoveActionBuilder=class{static SetSpeed(e,t){let i=z(e,t);return{typ:2,set:{xv:i.x,yv:i.y,xye:i.e}}}static SetAccel(e,t){let i=z(e,t);return{typ:7,set:{xye:i.e,xv:i.x,yv:i.y}}}static AltSpeed(e,t,i){if(!i)return null;let n=z(e,t);return{typ:5,set:{xv:n.x,yv:n.y,xye:n.e,tim:Math.floor(i)}}}static StopMoving(){return{typ:3}}static StopMovingExact(){return{typ:9}}static BrakeToPos(e,t){let i=z(e,t);return{typ:4,set:{xv:Math.floor(i.x),yv:Math.floor(i.y),xye:i.e}}}static SetArrowSpeed(e,t,i,n){let s=z(e,t),a=z(i,n);return{typ:6,set:{xye:s.e,xv:Math.floor(s.x),yv:Math.floor(s.y),xye1:a.e,xv1:a.x,yv1:a.y}}}static TeleportTo(e,t,i){let n=z(e,t);return{typ:8,set:{xye:n.e,xv:Math.floor(n.x),yv:Math.floor(n.y),isAbs:!i}}}static AckMovementSync(e,t,i,n,s,a){return{typ:10,set:{hstart:e,hend:t,vstart:i,vend:n,xye:s,st:a}}}},De.FreeMoveStateBuilder=class{static FireEcho(e){return{typ:52,set:{tkn:e}}}static FireNexusEvent(e,t){return isNaN(t)||0==t?null:{typ:55,set:{etyp:isNaN(e)?0:e,nexus:t}}}static NewCondition(e){return{typ:Z,set:{sub:1,set:e}}}static DelActionAssocCondition(){return{typ:Z,set:{sub:5}}}static RemoveAllCondtions(){return{typ:Z,set:{sub:6}}}static RemoveByGroup(e){return{typ:Z,set:{sub:4,gt:e}}}static RemoveByName(e){return{typ:Z,set:{sub:7,sn:e}}}static ActiveCondition(e,t){return{typ:Z,set:{sub:2,gt:isNaN(e)||e<=0?X.GroupType_Invalid_Ext:e,sn:t}}}static DeactiveCondition(e,t){return{typ:Z,set:{sub:3,gt:isNaN(e)||e<=0?X.GroupType_Invalid_Ext:e,sn:t}}}static SetOffsetPos(e,t){let i=z(e,t);return{typ:53,set:{xv:Math.floor(i.x),yv:Math.floor(i.y),xye:i.e}}}static SetPos(e,t){let i=z(e,t);return{typ:54,set:{xv:Math.floor(i.x),yv:Math.floor(i.y),xye:i.e}}}static TouchLockSwitch(e,t,i=-1){return{typ:59,set:{il:e,dir:t,ut:i}}}static SetTouchAttractChild(e){return{typ:60,set:{cid:e?e.AnimNativeId:0}}}static SetHitWallOverflow(){return{typ:56}}static RevertWithHitBlock(){return{typ:57}}static StartMovementSync(e,t,i,n,s,a){return{typ:61,set:{hstart:t,hend:i,vstart:n,vend:s,xye:a,nexus:e}}}static StopMovementSync(){return{typ:62}}};
|
|
1
|
+
/* eslint-disable */ let e={sRenderBridge:null,sActivityManager:null,DesignMap:null};window.Forge=e;let t=function(e){},i=function(e){},n=function(e){},s=function(e){throw new Error(e)};class a{constructor(){this._EnqueueInfoList=[],this._EnqueueObjList=[],this._OnStartSyncCallback=[],this._AlterIdCandidateMap={}}RequestAlterId(e,t){this._AlterIdCandidateMap[e]=t}AddToQueue(e,t){this._EnqueueInfoList.push(t),this._EnqueueObjList.push(e)}HasUpdate(){return this._EnqueueInfoList.length>0}ReadSyncList(){if(this._OnStartSyncCallback.length>0){for(let e of this._OnStartSyncCallback)e();this._OnStartSyncCallback=[]}let e=this._EnqueueInfoList;return this.RenewSyncList(),e}AddStartSyncCallback(e){this._OnStartSyncCallback.push(e)}RenewSyncList(){if(this._EnqueueObjList)for(let e of this._EnqueueObjList)e.RenewSyncInfo(this,null);this._EnqueueInfoList=[],this._EnqueueObjList=[]}ProcAlterIds(e,t){for(let i=0;i<e.length;i++)if(this._AlterIdCandidateMap.hasOwnProperty(e[i])){let n=this._AlterIdCandidateMap[e[i]];n.OnAlterId(t[i]),n.RenewSyncInfo(this,null)}else console.error(`Error: ProcAlterIds not found proxyId=${e[i]}`);this._AlterIdCandidateMap={}}}class r{constructor(e,t=null,i=null){this._PrefSyncListRef=e,this.PrefSyncInfo=null,this._PrefTaskList=null,this._PrefEnqueued=!1,this._SuffSyncListRef=t,this.SuffSyncInfo=null,this._SuffTaskList=null,this._SuffEnqueued=!1,this.InitPackage(i),this.RenewSyncInfo(this._PrefSyncListRef,null),this.RenewSyncInfo(this._SuffSyncListRef,null)}AddStartSyncCallback(e){this._PrefSyncListRef.AddStartSyncCallback(e)}CallToNative(t,i,n=!1){let s={fn:t,a:i};return n?(this._SuffTaskList.push(s),this._SuffEnqueued||(this._SuffSyncListRef.AddToQueue(this,this.SuffSyncInfo),this._SuffEnqueued=!0)):(this._PrefTaskList.push(s),this._PrefEnqueued||(this._PrefSyncListRef.AddToQueue(this,this.PrefSyncInfo),this._PrefEnqueued=!0)),e.sRenderBridge.RequestSwap(),s}RequestAlterId(e,t=!1){t?this._SuffSyncListRef.RequestAlterId(e,this):this._PrefSyncListRef.RequestAlterId(e,this)}SuffCallToNative(e,t){return{fn:e,a:t}}AlterCallParams(e,t){e&&(e.a=t)}RenewSyncInfo(e,t){t||(t={}),this._PrefEnqueued=!1,this._SuffEnqueued=!1,e&&e==this._PrefSyncListRef&&(this._PrefTaskList=[],this.PrefSyncInfo={tl:this._PrefTaskList,...t}),e&&e==this._SuffSyncListRef&&(this._SuffTaskList=[],this.SuffSyncInfo={tl:this._SuffTaskList,...t})}InitPackage(e){}OnAlterId(e){}}let o=new a,l=new a;class h extends r{constructor(e){super(o,l,{id:e}),this._TextureRef=null,this._RenderTextureId=e}InitPackage(e){this._RenderTextureId=e.id}RenewSyncInfo(e,t){super.RenewSyncInfo(e,{tt:1,id:this._RenderTextureId})}NeedAlterId(e,t){this._TextureRef=e,super.RequestAlterId(this._RenderTextureId,t)}OnAlterId(e){this._RenderTextureId=e,this._TextureRef.TexId=e,this._TextureRef=null}}let c=new class extends r{constructor(){super(o,l)}RenewSyncInfo(e,t){super.RenewSyncInfo(e,{tt:0})}};let u=new class{constructor(){this._StoreArray=[1]}AddData(e){return this._StoreArray.push(e),this._StoreArray.length-1}TakeArray(){const e=this._StoreArray;return this._StoreArray=[1],e}PickArray(){return this._StoreArray}GetSize(){return this._StoreArray.length}ResetForNextSwap(){this._StoreArray=[1]}};let d=1;class _{constructor(e,t,i=!1){this._UpdateToken=0,this._NativeSyncer=t,this.TexId=e,this._TextureReady=!1,this._TextureWidth=0,this._TextureHeight=0,this._InnerLoadCallback=null,this._CallbackMap={},this._UpdateCallbackMap={},this._DomDepends=i}GetTextureId(){return this.TexId}RequestSyncerAlterId(){this._NativeSyncer.NeedAlterId(this,this._DomDepends)}RegisterLoadImageCallback(e,t,i){if(null==t)return 0;if(this._TextureReady)return t({width:this._TextureWidth,height:this._TextureHeight},i),0;{this._RegisterInnerLoadCallback();const e=d++,n=this,s=(s,a,r)=>{t({width:s,height:a,extra:r?JSON.parse(r):null},i),delete n._CallbackMap[e]};this._CallbackMap[e]=s;const a=u.AddData(s);return this._NativeSyncer.CallToNative(1,[e,a],this._DomDepends),e}}UnregisterLoadImageCallback(e){e>0&&void 0!==this._CallbackMap[e]&&delete this._CallbackMap[e]}RegisterUpdateImageCallback(e,t,i){if(null==t)return 0;const n=d++,s=this,a=(e,a,r,o)=>{s._TextureWidth=e,s._TextureHeight=a,t({width:e,height:a,token:r,extra:o?JSON.parse(o):null},i),delete s._UpdateCallbackMap[n]};this._UpdateCallbackMap[n]=a;const r=u.AddData(a);return this._NativeSyncer.CallToNative(9,[n,r],this._DomDepends),n}UnregisterUpdateImageCallback(e){e>0&&void 0!==this._UpdateCallbackMap[e]&&delete this._UpdateCallbackMap[e],this._NativeSyncer.CallToNative(10,[e],this._DomDepends)}DispatchCommand(t,i){this._NativeSyncer.CallToNative(3,[t,i],this._DomDepends),e.sRenderBridge.RequestSwap()}_RegisterInnerLoadCallback(){if(null==this._InnerLoadCallback){const e=this;this._InnerLoadCallback=(t,i,n)=>{e._TextureReady=!0,e._TextureWidth=t,e._TextureHeight=i};const t=u.AddData(this._InnerLoadCallback);this._NativeSyncer.CallToNative(1,[d++,t],this._DomDepends)}}EnableBackgroundLoad(){this._TextureReady||(this._RegisterInnerLoadCallback(),this._NativeSyncer.CallToNative(4,null,this._DomDepends))}DisableBackgroundLoad(){this._NativeSyncer.CallToNative(5,null,this._DomDepends)}RequestToUnload(){this._NativeSyncer.CallToNative(6,null,this._DomDepends)}DisableAutoRecycle(){this._NativeSyncer.CallToNative(7,null,this._DomDepends)}UpdateValue(e){return++this._UpdateToken,this._NativeSyncer.CallToNative(8,[this._UpdateToken,e],this._DomDepends),this._UpdateToken}}class S extends _{constructor(e,t,i=!1){super(e,t,i),this._GifTextureInfo=null}registerOnStart(e){this._EnableGifTextureInfo();let t=this._GifTextureInfo,i=++t.IdGen;if(t.StartMapCount++,t.StartMapCount>0&&0==t.GlobalStartCallbackId){t.GlobalStartCallbackId=i;const e=()=>{for(let e in t.OnStartMap)t.OnStartMap[e]?.()},n=u.AddData(e);this._NativeSyncer.CallToNative(100,[t.GlobalStartCallbackId,n],this._DomDepends)}return t.OnStartMap[i]=e,i}unregisterOnStart(e){if(!this._GifTextureInfo)return;let t=this._GifTextureInfo;t.OnStartMap.hasOwnProperty(e)&&(t.StartMapCount--,delete t.OnStartMap[e]),0==t.StartMapCount&&0!=t.GlobalStartCallbackId&&(this._NativeSyncer.CallToNative(101,[t.GlobalStartCallbackId],this._DomDepends),t.GlobalStartCallbackId=0)}registerOnEnd(e){this._EnableGifTextureInfo();let t=this._GifTextureInfo,i=++t.IdGen;if(t.EndMapCount++,t.EndMapCount>0&&0==t.GlobalEndCallbackId){t.GlobalEndCallbackId=i;const e=()=>{for(let e in t.OnEndMap)t.OnEndMap[e]?.()},n=u.AddData(e);this._NativeSyncer.CallToNative(102,[t.GlobalEndCallbackId,n],this._DomDepends)}return t.OnEndMap[i]=e,i}unregisterOnEnd(e){if(!this._GifTextureInfo)return;let t=this._GifTextureInfo;t.OnEndMap.hasOwnProperty(e)&&(t.EndMapCount--,delete t.OnEndMap[e]),0==t.EndMapCount&&0!=t.GlobalEndCallbackId&&(this._NativeSyncer.CallToNative(103,[t.GlobalEndCallbackId],this._DomDepends),t.GlobalEndCallbackId=0)}_EnableGifTextureInfo(){this._GifTextureInfo||(this._GifTextureInfo={IdGen:1,GlobalStartCallbackId:0,OnStartMap:{},StartMapCount:0,GlobalEndCallbackId:0,OnEndMap:{},EndMapCount:0})}}class p extends S{constructor(e,t){super(e,t,!0)}}class v extends _{constructor(e,t){super(e,t,!1)}doCommand(t,i,n){const s=null!=n?u.AddData(n):0;this._NativeSyncer.CallToNative(200,[t,i,s],this._DomDepends),e.sRenderBridge.RequestSwap()}}let y=window.NativeGetIdGroupIntf();const m=10;class C{constructor(e){this._GroupType=e,this._TeamReadIndex=0,this._TeamFillIndex=0,this._Teams=new Array(m),this._ValidTeamsCount=0;for(let e=0;e<m;e++)this._Teams[e]={start:0,end:0,expired:!0}}genId(){this._Teams[this._TeamReadIndex].expired&&this._reserveNativeIds();let e=this._Teams[this._TeamReadIndex],t=e.start;return e.start++,e.start>e.end&&(e.expired=!0,this._TeamReadIndex=(this._TeamReadIndex+1)%m,this._ValidTeamsCount--),t}_reserveNativeIds(){let e=20*(m-this._ValidTeamsCount);if(e>0){let t=y.GetIdArray(this._GroupType,e);if(t){let e=JSON.parse(t);this._commitNativeIds(e[0],e[1])}}}_commitNativeIds(e,t){let i=t-e+1,n=Math.floor(i/20),s=e;for(let e=0;e<n;e++){let e=this._Teams[this._TeamFillIndex];e.start=s,e.end=s+20-1,e.expired=!1,this._TeamFillIndex=(this._TeamFillIndex+1)%m,s=e.end+1}this._ValidTeamsCount+=n,this._ValidTeamsCount>m&&console.error(`team over size to ${this._ValidTeamsCount}`)}}let N=new class{constructor(){this._ViewGroup=new C(0),this._TextureGroup=new C(1),this._AnimationGroup=new C(2),this._SensorGroup=new C(3)}genViewId(){return this._ViewGroup.genId()}genTextureId(){return this._TextureGroup.genId()}genAnimationId(){return this._AnimationGroup.genId()}genSensorId(){return this._SensorGroup.genId()}};var f,T,g;!function(e){e.RGBA_8888="RGBA_8888",e.RGBA_4444="RGBA_4444",e.RGBA_5551="RGBA_5551",e.RGB_565="RGB_565",e.RGB_ETC1="RGB_ETC1",e.RGBA_ETC1="RGBA_ETC1"}(f||(f={})),function(e){e.L=1,e.M=0,e.Q=3,e.H=2}(T||(T={})),function(e){e.AUTO=0,e.SYNC=1,e.ASYNC=2}(g||(g={}));class I{constructor(){this._NativeSyncer=c}GetId(){return 0}GetColorTexture(e){let t=N.genTextureId();this._NativeSyncer.CallToNative(1,[e,t]);let i=new _(t,new h(t));return i.RequestSyncerAlterId(),i}GetImage(e,t,i){return this.GetImage2(e,t,null,null,i)}GetImage2(e,t,i,s=f.RGBA_8888,a="",r=!1){if(!e||0==e.length)return n("GetImage2, url is not setted!"),null;let o=N.genTextureId(),l=0,c=0;i&&(l=i.width,c=i.height),s||(s=f.RGBA_8888),a||(a="");let u=null!=r&&r;this._NativeSyncer.CallToNative(2,[e,l,c,s,a,u,o]);let d=new _(o,new h(o));return d.RequestSyncerAlterId(),d}GetQRCodeTexture(e,t,i,n=g.AUTO,s=T.Q,a="#ffffff",r="#000000",o=-1){let l=N.genTextureId();return this._NativeSyncer.CallToNative(3,[e,t,i,s,a,r,o,n,l]),new _(l,new h(l))}GetDownloadTexture(e,t=null,i=!1,s=!1){if(console.log("ccht GetDownloadTexture",e,t,i,s),!e)return n("GetDownloadTexture, url is null!"),null;let a=N.genTextureId();return this._NativeSyncer.CallToNative(4,[e,t,i,s,a]),new _(a,new h(a))}GetDomProxyTexture(e){let t=N.genTextureId();return this._NativeSyncer.CallToNative(5,[e,t],!0),new p(t,new h(t))}GetCanvasTexture(e,t){let i=N.genTextureId();return this._NativeSyncer.CallToNative(6,[e,t,i],!1),new _(i,new h(i))}GetPluginTexture(e,t,i=!1){let n=N.genTextureId();return this._NativeSyncer.CallToNative(7,[e,t,i?1:0,n],!1),new _(n,new h(n))}GetCapturedTexture(){let e=N.genTextureId();return this._NativeSyncer.CallToNative(8,[e],!1),new _(e,new h(e))}GetImageProcessTexture(e){let t=N.genTextureId();return this._NativeSyncer.CallToNative(9,[e,t],!1),new v(t,new h(t))}}let A=new class{constructor(){this._count=1}get count(){return this._count}update(){this._count<Number.MAX_SAFE_INTEGER?++this._count:this._count=1}},w=new a,R=new a;let D=new class extends r{constructor(){super(w,R)}RenewSyncInfo(e){super.RenewSyncInfo(e,{tt:0})}};class E extends r{constructor(e){super(w,R,{id:e}),this._AnimId=e}InitPackage(e){this._AnimId=e.id}RenewSyncInfo(e){super.RenewSyncInfo(e,{tt:1,id:this._AnimId})}}let b=new a,x=new a;class P extends r{constructor(e){super(b,x,{id:e}),this._ViewId=e}InitPackage(e){this._ViewId=e.id}RenewSyncInfo(e){super.RenewSyncInfo(e,{tt:1,id:this._ViewId})}}let O=new class extends r{constructor(){super(b,x)}RenewSyncInfo(e){super.RenewSyncInfo(e,{tt:0})}},F=new a;class k extends r{constructor(e){super(null,F,{id:e}),this._SensorId=e}InitPackage(e){this._SensorId=e.id}RenewSyncInfo(e,t){super.RenewSyncInfo(e,{tt:1,id:this._SensorId})}}let L=new class extends r{constructor(){super(null,F)}RenewSyncInfo(e,t){super.RenewSyncInfo(e,{tt:0})}};var G=null,M=null;class V{constructor(){this._StoreBufferIdGen=0,this._ScreenInfo={width:160,height:90,x:2/160,y:2/90,perspective:2/160,scaleRatio:1,designedWidth:1280},this.SwapCurrentTime=Date.now(),this.SwapCurrentCount=0,this._WillSwapCallbacks=new Map,this._DoWillSwapCallback=this._OnWillSwap.bind(this),this._SwappedOnceObservers=[],this._SwappedOnceObserverRunning=!1,this._NativeForgeRT={hdl:null},this._ApiLinkStatusReady=!0,this._SwapTimer=-1,this._OnRequesting=!1,this._OnRequestSeq=1,this._ApiLinkStatusReady=!1,this._InitNativeBridge(),this._EnableRequestSwap=!1,this._CommandParamsCache=[],this._NewSwapSeq=1,this._ForgeFrontRender.OnScreenHide&&window.JsView?.onVisibilityChange(e=>{"hide"===e.status&&this._ForgeFrontRender.OnScreenHide()})}_InitNativeBridge(){void 0!==window.NativeSendImpactSensorSyncData&&window.NativeSendImpactSensorSyncData.bind(this._NativeForgeRT),void 0!==window.NativeSetStepFpsSwitch&&(G=window.NativeSetStepFpsSwitch.bind(this._NativeForgeRT)),void 0!==window.NativeSetGlobalConfig&&(M=window.NativeSetGlobalConfig.bind(this._NativeForgeRT)),this._ForgeFrontRender=window.NativeGetRenderIntf(),this._ForgeFrontRender.RegisterSwapFunc(()=>{this.RequestSwap()}),this._DoRequestSwap=this._DoRequestSwap.bind(this),this._ForgeFrontRender.RegisterPreDomSyncFunc(()=>{this._ProcPreDomSync()}),this._ForgeFrontRender.RegisterOnScreenInfo(this._OnScreenInfoChange.bind(this))}SetStepFpsSwitch(e){this._ApiLinkStatusReady?G&&G(e):(console.warn("SetStepFpsSwitch(): API link status no ready!"),this._CommandParamsCache.push(()=>{this.SetStepFpsSwitch(e)}))}SetGlobalConfig(e){if(this._ApiLinkStatusReady){if(M){let t=JSON.stringify(e);console.log("SetGlobalConfig set with "+t),M(t),console.log("SetGlobalConfig set done")}}else console.warn("SetGlobalConfig(): API link status no ready!"),this._CommandParamsCache.push(()=>{this.SetGlobalConfig(e)})}_PerformCachedCommand(){if(this._CommandParamsCache.length>0){for(let e=0;e<this._CommandParamsCache.length;e++)this._CommandParamsCache[e]();this._CommandParamsCache=[]}}RequestSwap(){this._OnRequesting?this._NewSwapSeq++:(this._OnRequesting=!0,this._NewSwapSeq++,this._OnRequestSeq++,this._PromiseRequestSwap(this._OnRequestSeq))}_PromiseRequestSwap(e){let t=this,i=this._NewSwapSeq;Promise.resolve().then(()=>{i==t._NewSwapSeq?t.InstantPerformSwap():e==this._OnRequestSeq&&t._PromiseRequestSwap(e)})}NotifyNetTypeStatus(e,t){}EnableRequestSwap(e){this._EnableRequestSwap=e,this._ForgeFrontRender.EnableRequestSwap(e)}InstantPerformSwap(){this._OnRequesting&&(this._OnRequesting=!1,this._OnRequestSeq++,this._DoRequestSwap(!1))}_ProcSyncerList(e,t,i,n,s){let a=null,r=null,o=null,l=null,h=null;if(e.HasUpdate()&&(o=e.ReadSyncList()),t.HasUpdate()&&(r=t.ReadSyncList()),i.HasUpdate()&&(a=i.ReadSyncList()),n?.HasUpdate()&&(l=n.ReadSyncList()),null==a&&null==r&&null==o&&null==l||(h=this._ForgeFrontRender.SyncForgeJsCall(JSON.stringify({TexSync:o,AnimSync:r,ViewSync:a,SensorSync:l}),s)),h){let t;this._OnRequesting=!1,t=JSON.parse(h).TexSyncRet,t&&this._ProcTextureSyncRet(e,t)}}_ProcPreDomSync(){this._ProcPreDomSyncInner()}_ProcPreDomSyncInner(){this._ProcSyncerList(o,w,b,null,u.PickArray())}_DoRequestSwap(e){if(!this._EnableRequestSwap)return void(this._OnRequesting=!1);A.update();let t=u.GetSize();if(this._ProcPreDomSyncInner(),this._WillSwapCallbacks.size>0&&this._WillSwapCallbacks.forEach(this._DoWillSwapCallback),this._ProcPreDomSyncInner(),this._ProcSyncerList(l,R,x,F,u.PickArray()),t==u.GetSize())u.ResetForNextSwap();else{let e=u.GetSize();e>50&&console.warn("Warning: temp sync store kept with large size = "+e)}e=!!e,this._OnRequesting=!1,this.SwapCurrentTime=Date.now(),this.SwapCurrentCount++,this._ForgeFrontRender.DoRequestSwap(e)}GetScreenInfo(){return this._ScreenInfo}SetForgeRtHandler(e){this._NativeForgeRT.hdl=e,this._ApiLinkStatusReady=!0,this._ForgeFrontRender.SetForgeRtHandler(e),this._PerformCachedCommand()}InitScreenBuffer(e,t){isNaN(e)&&(e=1),isNaN(t)&&(t=1280);var i=t*e,n=i/16*9;this._ScreenInfo.width=Math.floor(i),this._ScreenInfo.height=Math.floor(n),this._ScreenInfo.x=2/this._ScreenInfo.width,this._ScreenInfo.y=2/this._ScreenInfo.height,this._ScreenInfo.perspective=this._ScreenInfo.x,this._ScreenInfo.scaleRatio=e,this._ScreenInfo.designedWidth=t}InitNativeScreenBuffer(){if(this._ApiLinkStatusReady){var e=JSON.stringify({displayScaleRatio:this._ScreenInfo.scaleRatio,designedMapWidth:this._ScreenInfo.designedWidth});this._ForgeFrontRender.InitScreenBuffer(e)}else console.info("InitNativeScreenBuffer(): API link status no ready!")}SyncBackStatus(e,t){this._ForgeFrontRender.SyncBackStatus(e,t)}TakeAndSyncBackStatus(){1==this._ForgeFrontRender.TakeAndSyncBackStatus()&&this.RequestSwap()}_OnScreenInfoChange(e,t,i,n,s){this._ScreenInfo.width=e,this._ScreenInfo.height=t,this._ScreenInfo.x=i,this._ScreenInfo.y=n,this._ScreenInfo.perspective=s}_ApiLinkCallOrCache(e,t,i){const n=null!=i?this._ForgeFrontRender[i]:this._ForgeFrontRender;this._ApiLinkStatusReady?n[e](...t):(console.warn(`${e}(): API link status not ready, delay`),this._CommandParamsCache.push(()=>{n[e](...t)}))}HasPendingRenderBreak(){return!!this._ApiLinkStatusReady&&this._ForgeFrontRender.HasPendingRenderBreak()}FinishRenderBreak(e){this._ApiLinkCallOrCache("FinishRenderBreak",[e])}AddWillSwapListener(e,t){this._WillSwapCallbacks.set(e,t)}AddSwappedOnceObserver(e){this._SwappedOnceObservers.push(e),this._SwappedOnceObserverRunning||(this._SwappedOnceObserverRunning=!0,this._ApiLinkCallOrCache("AddSwappedOnceObserver",[()=>{this._SwappedOnceObserverRunning=!1;const e=this._SwappedOnceObservers;this._SwappedOnceObservers=[];for(let t=0;t<e.length;t++)e[t]()}]))}RemoveSwappedOnceObserver(e){const t=this._SwappedOnceObservers.indexOf(e);t>=0&&this._SwappedOnceObservers.splice(t,1)}ActiveComponent(e){this._ApiLinkCallOrCache("ActiveComponent",[e])}ShutdownComponents(e){this._ApiLinkCallOrCache("ShutdownComponents",[e])}GenStoreBufferId(){return++this._StoreBufferIdGen}SetPlatformMsgDisp(e){this._PlatformMessageDispatch=e}GetPlatformMsgDisp(){return this._PlatformMessageDispatch}GetTextToolsApi(){return this._ForgeFrontRender.TextToolApi}GetBufferStoreApi(){return this._ForgeFrontRender.BufferStoreApi}_OnWillSwap(e){e()}_ProcTextureSyncRet(e,t){let i;i=t.idAlter,i&&e.ProcAlterIds(i.proxy,i.real)}}class B{constructor(){this._DisableKeyGuard=!1,this._LastEventTime=0,this._IsActivte=!1,this._BaseTime=0,this._BaseRemoteTime=0,this._SupportGetTimeFromApi=!1,this._IsSystemKeyDelaySuit=!1,this._ExpiredKeyCount=0,this._LastValidKeyTime=0,this._UseTimeFromApi=void 0!==window.jRuntimeBridge?.getSystemUptimeMillis,this._UseTimeFromApi&&(this._SupportGetTimeFromApi=!0,this._GetTimeFromApi())}SetTranslateDelay(e){B.sKeyTranslateDelay=e}CheckKey(e){if(!e.timeStamp||this._DisableKeyGuard)return!1;this._IsActivte=!0;const t=Date.now(),n=e.timeStamp;!this._SupportGetTimeFromApi&&n-this._LastEventTime>3e3&&(this._BaseTime=t,this._BaseRemoteTime=n,this._LastEventTime=n);let s=t-this._BaseTime;(s<0||s>5e3)&&(this._UseTimeFromApi?this._GetTimeFromApi():(this._BaseTime=t,this._BaseRemoteTime=n),s=0);return s+this._BaseRemoteTime-n>B.CONST_MAX_PASSING_GAP&&Math.abs(this._LastValidKeyTime-n)<B.CONST_MIN_VALID_KEY_GAP&&!e.repeat?(!this._IsSystemKeyDelaySuit&&this._SupportGetTimeFromApi&&(this._ExpiredKeyCount++,this._ExpiredKeyCount>50&&i("More than 50 keys are expired...")),!0):(this._IsSystemKeyDelaySuit||(this._IsSystemKeyDelaySuit=!0),this._LastValidKeyTime=n,!1)}toggleKeyGuard(){this._DisableKeyGuard=!this._DisableKeyGuard}IsActive(){return this._IsActivte}_GetTimeFromApi(){this._BaseTime=Date.now(),this._BaseRemoteTime=window.jRuntimeBridge.getSystemUptimeMillis()-B.sKeyTranslateDelay}}B.CONST_MAX_PASSING_GAP=20,B.CONST_MIN_VALID_KEY_GAP=180,B.sKeyTranslateDelay=5;let q,W=new B;class U{constructor(s,a,r){var o;if(this._MainActivity=null,this._DesignedMapWidth=1280,this._KeyLock=!1,this._CanvasHandler=0,o=4,console.log.bind(console),o>0&&console.error.bind(console),o>1&&(t=console.error.bind(console)),o>2&&(i=console.warn.bind(console)),o>3&&(n=console.log.bind(console)),o>4&&console.debug.bind(console),this._TextureManager=new I,this._RenderBridge=new V,e.sRenderBridge=this._RenderBridge,isNaN(r)&&(r=1280),this._DesignedMapWidth=r,this._KeyLock=!1,this._InitRenderer(s,a,r),this._EventHandlers={keyProc:null,keyUpProc:null,activityStateProc:null},this._RegisterKeyListener(this._EventHandlers),this._RegisterNativeActivityStateListener(this._EventHandlers),this._InstantSwapPromiseCallback=this._RenderBridge.InstantPerformSwap.bind(this._RenderBridge),null!=s){this._CanvasHandler=s.canvasNativeHandle;for(let e in this._EventHandlers)s[e]=this._EventHandlers[e]}e.sActivityManager=this,console.log("manager done")}GetTextureManager(){return this._TextureManager}DelayedActivateCanvas(e){if(0==this._CanvasHandler){this._CanvasHandler=e.canvasNativeHandle,this._EnableNativeBridge(e);for(let t in this._EventHandlers)e[t]=this._EventHandlers[t];this._RenderBridge.InitNativeScreenBuffer(),this._RenderBridge.RequestSwap()}else t("Error: already activated")}GetCanvasHandler(){return this._CanvasHandler}StartActivity(e){this._MainActivity=e}_InitRenderer(e,t,i){this._EnableNativeBridge(e),this._RenderBridge.InitScreenBuffer(t,i),this._RenderBridge.InitNativeScreenBuffer()}_EnableNativeBridge(e){null!=e&&(this._RenderBridge.SetForgeRtHandler(e.frtNativeHandle),e.renderBridge=this._RenderBridge,this._RenderBridge.EnableRequestSwap(!0))}_KeyProcDown(e){if(this._KeyLock)return!0;var t=!0;if(this._MainActivity){if(W.CheckKey(e))return console.log("keyEventGuard ignore keys"),!1;W.IsActive()&&this._RenderBridge.InstantPerformSwap(),t=!this._MainActivity.DispatchKeyDown(e),this._RenderBridge.TakeAndSyncBackStatus()}return t}_KeyProcUp(e){if(this._KeyLock)return!0;var t=!0;return this._MainActivity&&(t=!this._MainActivity.DispatchKeyUp(e),this._RenderBridge.TakeAndSyncBackStatus()),t}_RegisterKeyListener(e){e.keyProc=this._KeyProcDown.bind(this),e.keyUpProc=this._KeyProcUp.bind(this)}_RegisterNativeActivityStateListener(e){let t=this;var i=function(e){var i=e.State;switch(console.log("ActivityStateListenerChanged, state:"+i),i){case"onActivityResumed":t._RenderBridge.EnableRequestSwap(!0),t._RenderBridge.RequestSwap(),t._RenderBridge.InstantPerformSwap();break;case"onActivityStopped":t._RenderBridge.EnableRequestSwap(!1)}}.bind(this);e.activityStateProc=i}}class K{constructor(){this._ActivityManager=null}Init(e){let t=1280,i=1;try{if(J){let e=J();"number"==typeof e.width&&(t=e.width),"number"==typeof e.displayScale&&(i=e.displayScale)}}catch(e){console.log("Note: DesignMap failed")}this._ActivityManager=new U(e,i,t),H?H(this._ActivityManager):console.error("FATAL: no found entry")}getActivityManager(){return this._ActivityManager}}let H=null,J=null;let j=100;class z{constructor(e){this.PageName=e,this._FocusChild=null,this._LatestFocusChild=null,this.SubPages=[],this._ParentPage=null,this._KeyLock=!1}OnRenderFrame(){t("OnRenderFrame() MUST override")}OnKeyDown(e){return!1}OnKeyUp(e){return!1}DispatchKeyDown(e){if(this._KeyLock)return!0;let t=!1;return this._FocusChild&&(t=this._FocusChild.DispatchKeyDown(e)),t||(t=this.OnKeyDown(e)),t}OnCustomEvent(e){return!1}BubbleCustomEvent(e){this.OnCustomEvent(e)||this._ParentPage&&this._ParentPage.BubbleCustomEvent(e)}DispatchKeyUp(e){if(this._KeyLock)return!0;let t=!1;return this._FocusChild&&(t=this._FocusChild.DispatchKeyUp(e)),t||(t=this.OnKeyUp(e)),t}PrintLastFocusPage(){let e="------"+this.PageName+"\n",t=this._ParentPage;return t&&(e+=t.PrintLastFocusPage()),e}IsFocus(){return!this._ParentPage||this._ParentPage._FocusChild==this}_IsLeafInChain(){return this.IsFocus()&&!this._FocusChild}SetParent(e){null!=e?(this._ParentPage=e,e.SubPages.push(this)):s("ERROR: parent is null")}SetParentPage(e){this.SetParent(e)}OnRemoveFromTree(){if(this._ParentPage=null,this.SubPages&&this.SubPages.length>0){for(let e of this.SubPages)e.OnRemoveFromTree();this.SubPages=[]}}RemoveSubPage(e){e==this._FocusChild&&(this._FocusChild=null),e==this._LatestFocusChild&&(this._LatestFocusChild=null);for(let t=0;t<this.SubPages.length;t++)if(e==this.SubPages[t]){this.SubPages.splice(t,1);break}}ClearSubPages(){this.SubPages=[],this._FocusChild=null,this._LatestFocusChild=null}GetParentPage(){return this._ParentPage}Focus(e=!1){if(this.IsFocus()){if(!e)return void n("requestFocus(): Already focused name="+this.PageName);if(this._IsLeafInChain())return void n("requestFocus(): Already focused name="+this.PageName)}if(this._ParentPage){let t=[],i=this;for(;i._ParentPage&&!i.IsFocus();)t.push(i),i=i._ParentPage;let n,a=j++;n=e&&0==t.length?this._FocusChild:t[t.length-1]._ParentPage?._FocusChild;let r=[];for(;n;)r.push(n),n=n._FocusChild;for(let e=r.length-1;e>=0;e--)r[e]._BlurInternal(a);for(let e=t.length-1;e>=0;e--)t[e]._FocusInternal(a);if(e)this._LatestFocusChild=null;else{let e=t[0];for(;e._LatestFocusChild&&null==e._FocusChild;)e._LatestFocusChild._FocusInternal(a),e=e._FocusChild,e||s("ERROR: focus chain is broken")}}}ReturnFocusToParent(){this._ParentPage&&(this.IsFocus()&&this._ParentPage.Focus(!0),this._ParentPage._FocusChild==this&&(this._ParentPage._FocusChild=null),this._ParentPage._LatestFocusChild==this&&(this._ParentPage._LatestFocusChild=null))}_FocusInternal(e){this._ParentPage?(this._ParentPage._FocusChild=this,this._ParentPage._LatestFocusChild=this,this.OnFocus(e)):t("No dispatcher")}_BlurInternal(e){this._ParentPage?this._ParentPage._FocusChild==this?(this._ParentPage._FocusChild=null,this.OnBlur(e)):i("Not focus yet, page name="+this.PageName):t("No dispacher")}GetFocusChild(){return this._FocusChild}OnFocus(e){i("No overrided Page OnFocus event, page name="+this.PageName)}OnBlur(e){i("No overrided Page OnBlur event, page name="+this.PageName)}KeyLock(){this._KeyLock=!0}UnKeyLock(){this._KeyLock=!1}}class X{constructor(){this.Pacakge=this.Package.bind(this)}Package(){}_GetBasePackage(e){return{T:e,St:null}}}class Y extends X{constructor(){super()}Package(){return this._GetBasePackage(0)}}class Q extends X{constructor(){super()}Package(){return this._GetBasePackage(1)}}class $ extends X{constructor(){super()}Package(){return this._GetBasePackage(2)}}class Z extends X{constructor(){super()}Package(){return this._GetBasePackage(5)}}class ee extends X{constructor(e,t,i,n,s){super(),this._Inited=!1,this._X1=e,this._X2=i,this._Y1=t,this._Y2=n,this._Duration=s}Package(){var e=this._GetBasePackage(3);return e.St={X1:this._X1,X2:this._X2,Y1:this._Y1,Y2:this._Y2,Dur:this._Duration},e}}class te extends X{constructor(e,t,i){super(),this._InTime=e,this._OutTime=t,this._MaxSpeed=i}Package(){var e=this._GetBasePackage(7);return e.St={In:this._InTime,Out:this._OutTime,MS:this._MaxSpeed},e}}var ie,ne;!function(e){var t;(t=e.Circular||(e.Circular={})).In=new Y,t.Out=new Q,t.InOut=new $,t.Deceleration=new Z,e.str2Easing=function(t){if(!t||"string"!=typeof t)return null;if("ease-in"===t)return e.Circular.In;if("ease-out"===t)return e.Circular.Out;if("ease-in-out"===t)return e.Circular.InOut;if(-1!==t.indexOf("cubic-bezier")){const e=t.split("(")[1].split(")")[0].split(",");if(!(4!==e.length||isNaN(parseFloat(e[0]))||isNaN(parseFloat(e[1]))||isNaN(parseFloat(e[2]))||isNaN(parseFloat(e[3]))))return new ee(parseFloat(e[0]),parseFloat(e[1]),parseFloat(e[2]),parseFloat(e[3]),0)}else if(-1!==t.indexOf("jsv-ease")){const e=t.split("(")[1].split(")")[0].split(",");if(3===e.length&&!isNaN(parseFloat(e[0]))&&!isNaN(parseFloat(e[1]))&&!isNaN(parseFloat(e[2])))return new te(parseFloat(e[0]),parseFloat(e[1]),parseFloat(e[2]))}return null}}(ie||(ie={})),function(e){e.VIEW_COMMAND=0,e.TEXTURE_COMMAND=1,e.ANIM_COMMAND=2,e.SYNC_COMMAND=3,e.APIC_PLAY=0,e.APIC_STOP=1,e.APIC_VISIBLE_CHANG=2,e.APIC_SHOW_FRAME=3,e.GET_BOUNDING_RECT=0,e.FILTER_VIEW_WAVE=1,e.TRANSLATE_FRAME_ALT_SPEED=0,e.FREE_MOVE_RUN_CMDPACKS=1,e.FREE_MOVE_FIRE_GLOBAL_NEXUS=2,e.EXE_DEFAULT=0,e.EXE_AFTER_RENDER=1}(ne||(ne={}));const se=(e,t)=>{let i=0,n=0,s=0;return isNaN(e)||(i|=1,n=e),isNaN(t)||(i|=2,s=t),{e:i,x:n,y:s}};var ae,re,oe;!function(e){e.ActEvent_ActFinish=1,e.ActEvent_Speed_X_Revert=2,e.ActEvent_Speed_Y_Revert=3,e.ActEvent_ActReject=4,e.ActEvent_ActDragStart=5,e.ActEvent_ActDragEnd=6,e.ActEvent_ActFlingStart=7,e.ActEvent_ActFlingProgress=8,e.ActEvent_ActFlingEnd=9,e.ActEvent_ActTouchDown=10,e.ActEvent_ActTouchRelease=11,e.ActEvent_ActFlingCancel=12,e.ActEvent_ActFlingDrop=13,e.ActEvent_ActMouseWheelScrollProgress=14,e.ActEvent_MovementSync=15}(ae||(ae={})),function(e){e.GroupType_ActionAssoc=10,e.GroupType_Fling=11,e.GroupType_Invalid_Ext=65535}(re||(re={})),function(e){e.FLING_ON_PROGRESS_INTERVAL=200}(oe||(oe={}));const le=(e,t)=>{e.gtype=t.g,e.once=t.m?0:1;let i=t.s;i&&(e.name=i),e.brk=t.brk?1:0};const he=51;function ce(e){return e?JSON.stringify(e.Package()):null}let ue=new class{constructor(){this._NativeSyncer=D}CreateTranslate(e,t,i,n,s,a,r){s!=1/0&&null!=s||(console.warn("translate animation duration invalid="+s),s=0),this._NativeSyncer.CallToNative(1,[e,t,i,n,s,ce(a),r])}CreateRotate(e,t,i,n,s,a,r){s!=1/0&&null!=s||(console.warn("rotate animation duration invalid="+s),s=0),this._NativeSyncer.CallToNative(2,[e,t,i.x,i.y,i.z,n.x,n.y,n.z,s,ce(a),r])}CreateScale(e,t,i,n,s,a,r,o,l,h,c){l!=1/0&&null!=l||(console.warn("scale animation duration invalid="+l),l=0),this._NativeSyncer.CallToNative(3,[e,t,i,n,s,a,r,o,l,ce(h),c])}CreateTranslateFrame(e,t,i,n,s,a,r,o){this._NativeSyncer.CallToNative(5,[e,t,i,n,!!s,a,r,o])}CreateCssKeyframe(e,t,i,n,s,a){t!=1/0&&null!=t||(console.warn("css animation duration invalid="+t),t=0),this._NativeSyncer.CallToNative(6,[e,t,ce(i),n,s,a])}CreateFreeMoveAnimation(e,t,i,n){this._NativeSyncer.CallToNative(7,[e,t?u.AddData(t):0,i,n?1:0])}CreateShaderAnimation(e,t,i){this._NativeSyncer.CallToNative(8,[e,ce(t),i])}};class de{constructor(){this.AnimNativeId=N.genAnimationId(),this._NativeSyncer=new E(this.AnimNativeId),this._ListenerObj=null,this._ListenerStatusCallback=null}SetAnimationListener(e){this._OnNewListener(e)}AddAnimationListener(e){this._ListenerObj&&e.AddInherit(this._ListenerObj),this._OnNewListener(e)}RemoveAnimationListener(){this._ListenerObj=null}Enable(e){this._NativeSyncer.CallToNative(2,[e])}EnableInfinite(){return this._NativeSyncer.CallToNative(3,null),this}SetRepeat(e){return this._NativeSyncer.CallToNative(5,[e]),this}EnableDelay(e){return this._NativeSyncer.CallToNative(4,[e]),this}SetStartPos(e){return e>=0&&e<=1?this._NativeSyncer.CallToNative(6,[e]):console.warn("Warning: SetStartPos() out of range"),this}_OnNewListener(e){let t=!0;if(this._ListenerObj&&(t=this._ListenerObj.ListenerEnabledFlags==e.ListenerEnabledFlags),this._ListenerObj=e,null!=this._ListenerObj&&(null==this._ListenerStatusCallback||!t)){let e=this;this._ListenerStatusCallback=t=>{e._ListenerObj?.InvokeFromNativeForge(t)};let t=u.AddData(this._ListenerStatusCallback);this._NativeSyncer.CallToNative(1,[t,this._ListenerObj.ListenerEnabledFlags])}}}var _e,Se;!function(e){e.ReleaseAfterEndCallback=1,e.KeepTransform=2,e.AckFinalProgress=4,e.AckRepeat=8,e.Reverse=16}(_e||(_e={})),function(e){e.AltSpeed=(e,t,i)=>{let n={S60:Math.floor(100*t/55)/100,T:i};e?.DispatchAnimCommand(ne.TRANSLATE_FRAME_ALT_SPEED,JSON.stringify(n))},e.RunFreeMoveCmdPacks=(e,t)=>{e?.DispatchAnimCommand(ne.FREE_MOVE_RUN_CMDPACKS,JSON.stringify(t))},e.FireGlobalNexus=(e,t)=>{let i={nexus:e,etyp:t};window.JsvCode.ForgeHandles.RootView?.DispatchAnimCommand(ne.FREE_MOVE_FIRE_GLOBAL_NEXUS,JSON.stringify(i))}}(Se||(Se={}));class pe{constructor(){this._MaskType="COMMON"}Type(){return this._MaskType}ToSyncJsonObj(e){return e||(e={}),e.typ=this._MaskType,e}}let ve=new class{constructor(){this._InnerViews={},this._ViewToken=0}add(e){let t=e.view.ViewId;return this._InnerViews.hasOwnProperty(t)&&(this._InnerViews[t]=e),t}remove(e){this._InnerViews[e]&&delete this._InnerViews[e]}get(e){return this._InnerViews[e]}clear(){this._InnerViews={},this._ViewToken=0}};class ye{constructor(){this.SensorId=N.genViewId(),this._NativeSync=new k(this.SensorId),this.CreateSensor()}CreateSensor(){}CreateTypedSensor(e){L.CallToNative(1,[this.SensorId,e],!0)}Recycle(){this._NativeSync.CallToNative(1,null,!0)}}class me{constructor(e,t,i,n){this.Texture=e,this.MaskSetting=t,void 0===n&&(n=!0),this.HasAlpha=n}ToSyncJsonObj(e=void 0){return e||(e={}),e.texId=this.Texture?this.Texture.TexId:0,e.alpha=this.HasAlpha,this.MaskSetting?e.mask=this.MaskSetting.ToSyncJsonObj():e.mask=null,e}}var Ce;!function(e){var t,i,n;(t=e.ControlType||(e.ControlType={})).DoKeepInRender=1,t.RecycleKeptView=2,(i=e.SyncedType||(e.SyncedType={})).Synced=0,i.NotSynced=1,i.RequestKeepInRender=2,i.OnKeepingInRender=3,i.RecycleKeeping=4,(n=e.TextureCoordAnchor||(e.TextureCoordAnchor={})).LeftTop=1,n.CenterTop=2,n.RightTop=3,n.LeftMiddle=4,n.Center=5,n.RightMiddle=6,n.LeftBottom=7,n.CenterBottom=8,n.RightBottom=9}(Ce||(Ce={}));let Ne=new class{constructor(){this._NativeSyncer=O}CreateNativeView(e,t,i){this._NativeSyncer.CallToNative(1,[e,t],i)}CreateJsRootView(e){this._NativeSyncer.CallToNative(2,[e])}CreateDomProxyView(e,t,i){this._NativeSyncer.CallToNative(3,[e,t,i?1:0],!0)}};class fe{constructor(e,t,i=!1){this.Visibility=void 0,this._NativeSyncer=new P(e),this.ViewId=e,this.TextureSetting=null,this._CallTextureSet=null,this._DomDepends=i,this._GetBCRCallback=null,this.CreateView(t)}CreateView(e=void 0){}ResetTexture(e=null){if(!this._CallTextureSet){this._CallTextureSet=this._NativeSyncer.CallToNative(1,null,this._DomDepends);let e=this;this._NativeSyncer.AddStartSyncCallback(()=>{this.TextureSetting?e._NativeSyncer.AlterCallParams(e._CallTextureSet,[e.TextureSetting.ToSyncJsonObj()]):e._NativeSyncer.AlterCallParams(e._CallTextureSet,[null]),e._CallTextureSet=null})}this.TextureSetting=e}BindedPageBase(e){}SetVisibility(e){if("INHERIT"!==e&&void 0!==e||(e="VISIBLE"),this.Visibility!=e){this.Visibility=e;let t=0;switch(e){case"VISIBLE":t=1;break;case"GONE":t=2;break;case"HIDDEN":t=3;break;default:return void console.error("unknown visible type="+e)}this._NativeSyncer.CallToNative(2,[t],this._DomDepends)}}AddView(e,t){let i={x:0,y:0,width:0,height:0};t&&(i=this._FormatLayoutParams(t)),this._NativeSyncer.CallToNative(3,[e.ViewId,t?1:0,i.x,i.y,i.width,i.height],this._DomDepends)}ClearViews(){this._NativeSyncer.CallToNative(4,null,this._DomDepends)}ResetTextureCssTransform(e,t){e=e||"",t=t||"",this._NativeSyncer.CallToNative(5,[e,t],this._DomDepends)}SetTextureCoord(e,t,i,n,s=Ce.TextureCoordAnchor.Center){this._NativeSyncer.CallToNative(9,[e,t,i,n,s],this._DomDepends)}ResetLayoutParams(e){let t;null!=e?(t=this._FormatLayoutParams(e),this._NativeSyncer.CallToNative(6,[t.x,t.y,t.width,t.height],this._DomDepends)):s("ResetLayoutParams(): new params is null")}_FormatLayoutParams(e){return{x:isNaN(e.x)?0:e.x,y:isNaN(e.y)?0:e.y,width:isNaN(e.width)?0:e.width,height:isNaN(e.height)?0:e.height}}GetBoundingClientRect(){return new Promise((e,t)=>{null!=this._GetBCRCallback&&(this._GetBCRCallback=null),this._GetBCRCallback=i=>{null!=this._GetBCRCallback&&(this._GetBCRCallback=null);const n=JSON.parse(i);0==n.status?e(n.data):t(n.error)};const i=u.AddData(this._GetBCRCallback);this._NativeSyncer.CallToNative(12,[i],this._DomDepends)})}StartAnimation(e,t,i){let n=e?e.AnimNativeId:0;this._NativeSyncer.CallToNative(7,[n,isNaN(i)?0:i],this._DomDepends)}StopAnimation(){this._NativeSyncer.CallToNative(8,null,this._DomDepends)}DispatchAnimCommand(e,t){this._NativeSyncer.CallToNative(13,[e,t],this._DomDepends)}StartTextureAnimation(e){let t=e?e.AnimNativeId:0;this._NativeSyncer.CallToNative(10,[t],this._DomDepends)}StopTextureAnimation(){this._NativeSyncer.CallToNative(11,null,this._DomDepends)}DragEnables(e){this._NativeSyncer.CallToNative(14,[e],this._DomDepends)}HoverEnables(e){this._NativeSyncer.CallToNative(20,[e],this._DomDepends)}MouseEnables(e){this.HoverEnables(e)}SetMouseWheelRate(e){this._NativeSyncer.CallToNative(22,[e],this._DomDepends)}SetTapListener(e=void 0){if(null!=e){const t=u.AddData(e);this._NativeSyncer.CallToNative(15,[t],this._DomDepends)}else this._NativeSyncer.CallToNative(15,[0],this._DomDepends)}SetHoverListener(e=void 0){if(null!=e){const t=u.AddData(e);this._NativeSyncer.CallToNative(21,[t],this._DomDepends)}else this._NativeSyncer.CallToNative(21,[0],this._DomDepends)}EnableAutoSize(){this._NativeSyncer.CallToNative(16,[],this._DomDepends)}RegisterFlexAssigned(e=void 0){if(null!=e){const t=u.AddData(e);this._NativeSyncer.CallToNative(17,[t],this._DomDepends)}else this._NativeSyncer.CallToNative(17,[0],this._DomDepends)}EnableVisibleTestRect(){this._NativeSyncer.CallToNative(18,[],this._DomDepends)}MarkFlexSizeFromChild(e){this._NativeSyncer.CallToNative(23,[e],this._DomDepends)}MarkFlexChildrenFromChild0(){this._NativeSyncer.CallToNative(24,null,this._DomDepends)}Capture2Texture(e,t=void 0,i=void 0){if(!e)return void console.error("Error: Capture2Texture need target texture");let n=e.GetTextureId();if(!t)return void console.error("Error: Capture2Texture need callback");const s=u.AddData(t),a=i?JSON.stringify(i):"";this._NativeSyncer.CallToNative(19,[n,s,a],this._DomDepends)}}class Te extends fe{constructor(e=null){!e||e instanceof me||s("ERROR:LayoutView need TextureSetting as parameter"),super(N.genViewId(),{DomDepends:!1}),this.Visibility="VISIBLE",e&&this.ResetTexture(e)}CreateView(e){Ne.CreateNativeView(this.ViewId,0,e.DomDepends)}}function ge(e){let t=[];if(e instanceof Array)for(let i of e)i instanceof fe&&t.push(i.ViewId);return t}class Ie extends ye{constructor(e,t,i,n){super(),this.InitSet(e,t,i,n)}CreateSensor(){this.CreateTypedSensor(3)}InitSet(e,t,i,n){let s=0;i&&(s=u.AddData(e=>{1==e?i.OnBeginContact?.():2==e&&i.OnEndContact?.()})),this._NativeSync.CallToNative(20,[e.ViewId,t.ViewId,s,n?n.SensorId:0],!0)}}let Ae={StartTrace:(e,t,i,n)=>new Ie(e,t,i,n),Callback:class{constructor(e,t){this.OnBeginContact=e,this.OnEndContact=t}UpdateImpactCallback(e){this.OnBeginContact=e}UpdateLeaveCallback(e){this.OnEndContact=e}},AutoFroze:class extends ye{constructor(e,t){super(),this.InitSet(),this._UpdatePreImpactList(ge(e)),this._UpdateOnImpactList(ge(t)),this._FreshAutoRecycleRef()}CreateSensor(){this.CreateTypedSensor(2)}InitSet(){this._NativeSync.CallToNative(25,null,!0)}UpdatePreImpactList(e){this._UpdatePreImpactList(ge(e)),this._FreshAutoRecycleRef()}UpdateOnImpactList(e){this._UpdateOnImpactList(ge(e)),this._FreshAutoRecycleRef()}_UpdatePreImpactList(e){this._NativeSync.CallToNative(26,[...e],!0)}_UpdateOnImpactList(e){this._NativeSync.CallToNative(27,[...e],!0)}_FreshAutoRecycleRef(){this._NativeSync.CallToNative(28,null,!0)}}};var we;!function(e){e[e.NONE=0]="NONE",e[e.TEXT=1]="TEXT",e[e.PASSWORD=2]="PASSWORD",e[e.TEXT_AREA=3]="TEXT_AREA",e[e.CONTENT_EDITABLE=4]="CONTENT_EDITABLE",e[e.SEARCH=5]="SEARCH",e[e.URL=6]="URL",e[e.EMAIL=7]="EMAIL",e[e.TELEPHONE=8]="TELEPHONE",e[e.NUMBER=9]="NUMBER"}(we||(we={}));var Re,De;!function(e){var t;(t=e.UniformType||(e.UniformType={}))[t.FLOAT=1]="FLOAT"}(Re||(Re={})),function(e){var t,i;(t=e.Type||(e.Type={}))[t.GRAY_DOWN=1]="GRAY_DOWN",t[t.WAVE=2]="WAVE",(i=e.Wave||(e.Wave={}))[i.CIRCLE_WAVE=1]="CIRCLE_WAVE",i[i.RECTANGLE_WAVE=2]="RECTANGLE_WAVE"}(De||(De={}));let Ee=0;class be{constructor(){this.sourceList=[]}addSource(e,t,i,n,s){n=n??{type:De.Wave.CIRCLE_WAVE},s=s??{timeDecay:3,distanceDecay:10,speed:100,frequency:8,waveNum:2};const a=++Ee;let r=0,o=0,l=0;return n.type==De.Wave.RECTANGLE_WAVE&&(r=n.width,o=n.height,l=n.radius),this.sourceList.push(a,e,t,i,r,o,l,s.timeDecay,s.distanceDecay,s.speed,s.frequency,s.waveNum),a}getSourceList(){const e=this.sourceList;return this.sourceList=[],e}}class xe extends fe{constructor(e,t){super(N.genViewId(),{DomElementId:e,UseMaskView:t},!0),this.Visibility="VISIBLE"}CreateView(e){Ne.CreateDomProxyView(this.ViewId,e.DomElementId,e.UseMaskView)}RegisterOnProxyReady(e){e?.()}}function Pe(e){return isNaN(e)?0:parseInt(e)}function Oe(e){return{fontFamily:e.fontFamily?e.fontFamily:Be.sDefaultFont,fontSize:Pe(e.fontSize),italic:"italic"===e.fontStyle,bold:"bold"===e.fontWeight,hasEmoji:1==e.JsvTextEmoji}}function Fe(){return e.sRenderBridge.GetTextToolsApi()}function ke(e,t){let i=Oe(t);return Fe().GetTextWidth(e,JSON.stringify(i))}function Le(e,t){let i=Oe(t);const n=Fe().GetOneLineTextDrawWidth(e,JSON.stringify(i)),s={totalWidth:n[0],sliceInfo:[]};for(let e=1;e<n.length;e+=3)s.sliceInfo.push({start:n[e],end:n[e+1],width:n[4]});return s}function Ge(e,t,i){const n={...Oe(t),maxWidth:i};return Fe().BreakLines(e,JSON.stringify(n))}function Me(e,t,i,n,s,a){let r;if(e>0)r=Fe().GetCursorPosition(e,t,null,null,null,1);else{let o=Oe(n),l=function(e){let t=Pe(e.height),i=Pe(e.lineHeight),n="string"==typeof e.wordWrap?e.wordWrap:"none";return"nowrap"==e.whiteSpace&&(n="none"),{width:Pe(e.width),height:t,textAlign:"string"==typeof e.textAlign?e.textAlign:"left",lineHeight:0==i?t:i,wordWrap:n,textOverflow:"string"==typeof e.textOverflow?e.textOverflow:"clip"}}(s);r=Fe().GetCursorPosition(e,t,i,JSON.stringify(o),JSON.stringify(l),a?1:0)}return r}function Ve(e){Fe().RemoveCursorTextCache(e)}var Be;!function(e){e.sDefaultFont="黑体",e.sDefaultFontSize=30,e.sDefaultFontColor="#FFFFFF",e.sDefaultBackgroundColor="rgba(0, 0, 0, 0)",e.GetTextWidth=ke,e.GetOneLineTextDrawWidth=Le,e.GetCursorPosition=Me,e.RemoveCursorTextCache=Ve,e.BreakLines=Ge}(Be||(Be={}));let qe=e;qe.Run=function(e){return q=new K,q.Init(e),q},qe.InitStarter=function(t,i){e.DesignMap=i,H=t,J=i},qe.NewDomProxyView=function(e,t){return new xe(e,t)},qe.sFrameCount=A,qe.NativeConstant=ne,qe.PageBase=z,qe.ReactActivity=class extends z{constructor(e,t){super(e),this._TextureManager=t.GetTextureManager()}GetTextureManager(){return this._TextureManager}SetContentView(e,t){this._ContentView=e,this._ContentViewSize=t}},qe.ViewTextureMask=class extends pe{constructor(e){super(),this._MaskType="TEXTURE",this.ImageTexture=e}ToSyncJsonObj(e){return e||(e={}),e.texId=this.ImageTexture.TexId,super.ToSyncJsonObj(e)}},qe.ViewRoundCornerMask=class extends pe{constructor(e,t,i,n){super(),this._MaskType="CORNER",this._TopLeft=e,this._TopRight=isNaN(t)?e:t,this._BottomLeft=isNaN(i)?e:i,this._BottomRight=isNaN(n)?e:n}ToSyncJsonObj(e){return e||(e={}),e.tl=this._TopLeft,e.tr=this._TopRight,e.bl=this._BottomLeft,e.br=this._BottomRight,super.ToSyncJsonObj(e)}},qe.sViewStore=ve,qe.ViewInfo=class{constructor(e,t){this.view=e,this.layout_params=t}},qe.LayoutView=Te,qe.AutoStretchView=class extends Te{constructor(e=null){super(e)}CreateView(e){Ne.CreateNativeView(this.ViewId,12,e.DomDepends)}},qe.EditControlView=class extends Te{constructor(t=null){super(t),this._AppListeners=null,this._ImeSyncFunc=this._ImeEventListener.bind(this),this._MsgToken="_JscIme_"+this.ViewId,e.sRenderBridge.GetPlatformMsgDisp().subscribe(this._MsgToken,this._ImeSyncFunc)}CreateView(e){Ne.CreateNativeView(this.ViewId,5,e.DomDepends)}releaseResource(){e.sRenderBridge.GetPlatformMsgDisp().unsubscribe(this._MsgToken,this._ImeSyncFunc)}setEditorStyle(e,t,i,n){this._NativeSyncer.CallToNative(5005,[e,t,i,n],this._DomDepends)}showIme(e,t,i,n,s){e!=we.NONE?(void 0!==i&&null!=i||(i=t.length>0?t.length:0),i<0?i=0:i>t.length&&(i=t.length>0?t.length:0),this._NativeSyncer.CallToNative(5001,[e,encodeURIComponent(t),i,n,s],this._DomDepends)):console.log("showIme inputType error")}hideIme(){this._NativeSyncer.CallToNative(5002,null,this._DomDepends)}updateCursorOffset(e,t,i,n){this._NativeSyncer.CallToNative(5003,[e,t,i,n],this._DomDepends)}addImeEventListener(e){this._AppListeners=e}_OnStatusFromPlatform(e){this._NativeSyncer.CallToNative(5006,[e],this._DomDepends)}_ImeEventListener(e){if(e){var t=JSON.parse(e);if("text"==t.type){var i=t.text;let e=t.selectStart,n=t.scrollLeft,s=t.scrollTop;this._AppListeners?.OnTextChanged(decodeURIComponent(i),e,n,s)}else if("vstatus"==t.type){let e=t.isVisible?1:0;this._OnStatusFromPlatform(e),this._AppListeners?.OnStatusChanged(e)}else if("action"==t.type){var n=t.action;this._AppListeners?.OnEditAction(n)}}else console.log("EditControlView","_ImeEventListener input_data error")}},qe.FilterView=class extends Te{constructor(e=null,t){super(e),this._Type=t??De.Type.GRAY_DOWN,this._NativeSyncer.CallToNative(10002,[this._Type,[]],this._DomDepends)}CreateView(e){Ne.CreateNativeView(this.ViewId,10,e.DomDepends)}FilterSwitch(e){this._NativeSyncer.CallToNative(10001,[e],this._DomDepends)}AddWaveSourceList(e){if(this._Type==De.Type.WAVE){const t={T:1,L:e.getSourceList()};this.DispatchCommand(ne.FILTER_VIEW_WAVE,JSON.stringify(t))}else console.error("FilterView error: add wave source while filter view type is GRAY_DOWN.")}AddWaveSourceSingle(e,t,i,n={type:De.Wave.CIRCLE_WAVE},s={timeDecay:3,distanceDecay:10,speed:100,frequency:8,waveNum:2}){if(this._Type==De.Type.WAVE){const a=new be,r=a.addSource(e,t,i,n,s);return this.AddWaveSourceList(a),r}return console.error("FilterView error: add wave source while filter view type is GRAY_DOWN."),-1}RemoveSource(e){if(this._Type==De.Type.WAVE){const t={T:2,L:e instanceof Array?e:[e]};this.DispatchCommand(ne.FILTER_VIEW_WAVE,JSON.stringify(t))}else console.error("FilterView error: remove wave source while filter view type is GRAY_DOWN.")}DispatchCommand(e,t){t&&this._NativeSyncer.CallToNative(10003,[e,t],this._DomDepends)}},qe.FragShaderView=class extends Te{constructor(e=null){super(e)}CreateView(e){Ne.CreateNativeView(this.ViewId,11,e.DomDepends)}SetShaderInfo(e,t,i,n){const s={shaderStr:e,uniformParams:t,textureParams:i};let a=0;null!=n&&(a=u.AddData(n)),this._NativeSyncer.CallToNative(7001,[JSON.stringify(s),a],this._DomDepends)}},qe.NativeSharedView=class extends Te{constructor(e){super(e),this._JsContextId=window.JsvCoreApi.getJsContextId(),this._TrackId=null,this.SetTrackId(this._JsContextId+"_"+this.ViewId)}CreateView(e){Ne.CreateNativeView(this.ViewId,9,e.DomDepends)}GetTrackId(){return this._TrackId}SetTrackId(e){this._TrackId=e,this._NativeSyncer.CallToNative(10101,[this._TrackId],this._DomDepends)}SetOverSize(e){this._NativeSyncer.CallToNative(10102,[isNaN(e)?0:e],this._DomDepends)}},qe.NinePatchView=class extends Te{CreateView(e){Ne.CreateNativeView(this.ViewId,4,e.DomDepends)}SetRepeat(e,t){this._NativeSyncer.CallToNative(4001,[e,t],this._DomDepends)}SetPadding(e,t){this._NativeSyncer.CallToNative(4002,[e,t],this._DomDepends)}SetImageDspSize(e,t){this._NativeSyncer.CallToNative(4003,[e,t],this._DomDepends)}SetDesignMapWidth(e){this._NativeSyncer.CallToNative(4004,[e],this._DomDepends)}EnableAlphaMix(e){this._NativeSyncer.CallToNative(4005,[e.TexId],this._DomDepends)}},qe.PreloadView=class extends Te{constructor(e=null){super(e)}CreateView(e){Ne.CreateNativeView(this.ViewId,7,e.DomDepends)}},qe.SprayView=class extends Te{constructor(e=null){super(e),this.onStop=null}SetSprayInfo(e,t,i,n,s,a,r,o,l,h,c,u,d,_,S,p,v,y,m,C,N,f,T){this._NativeSyncer.CallToNative(6001,[e,t,i,n,s,a,r,o,l,h,c,u,d,_,!!S,!!p,!!v,y,m,C,N,f,T],this._DomDepends)}CreateView(e){Ne.CreateNativeView(this.ViewId,6,e.DomDepends)}Start(){this._NativeSyncer.CallToNative(6002,[],this._DomDepends)}Stop(e=!1){this._NativeSyncer.CallToNative(6003,[e],this._DomDepends)}RegisterOnStop(e){this.onStop=e}_OnEvent(e){try{if("onStop"===JSON.parse(e).type)this.onStop?.()}catch(e){console.error("SprayView onEvent error",e)}}RegisterEventListener(){const e=u.AddData(this._OnEvent.bind(this));this._NativeSyncer.CallToNative(6004,[e])}},qe.TextInputType=we,qe.FilterViewType=De,qe.TextureSetting=me,qe.ExternalTextureSetting=me,qe.TextUtils=Be,qe.MetroWidgetBoxView=class extends Te{CreateView(e){Ne.CreateNativeView(this.ViewId,13,e.DomDepends)}SetEnable(e){this._NativeSyncer.CallToNative(10201,[e],this._DomDepends)}},qe.MetroWidgetItemRootView=class extends Te{CreateView(e){Ne.CreateNativeView(this.ViewId,14,e.DomDepends)}SetIsFocus(e){this._NativeSyncer.CallToNative(10301,[e],this._DomDepends)}},qe.VisibleSensor=class extends ye{constructor(e,t=null){super(),this.InitSet(e,t)}CreateSensor(){this.CreateTypedSensor(1)}InitSet(e,t){let i=0;t&&(i=u.AddData((e,i,n,s)=>{t(1==e,1==i,1==n,1==s)})),this._NativeSync.CallToNative(11,[e.ViewId,i],!0)}ResetArea(e){"number"!=typeof e.horizon&&(console.log("horizon not set, default to 1.0"),e.horizon=1),"number"!=typeof e.vertical&&(console.log("vertical not set, default to 1.0"),e.vertical=1),this._NativeSync.CallToNative(12,[e.horizon,e.vertical],!0)}Enable(e){this._NativeSync.CallToNative(13,[!!e],!0)}ResetContainer(e){let t;t=e?e.ViewId:0,this._NativeSync.CallToNative(14,[t],!0)}},qe.EnvBlockerSensor=class extends ye{constructor(e){super(),this.InitSet(e)}CreateSensor(){this.CreateTypedSensor(4)}InitSet(e){this._NativeSync.CallToNative(30,[e.ViewId],!0)}ResetTopGID(e){this._ResetSideGID(0,e)}ResetBottomGID(e){this._ResetSideGID(1,e)}ResetLeftGID(e){this._ResetSideGID(2,e)}ResetRightGID(e){this._ResetSideGID(3,e)}_ResetSideGID(e,t){this._NativeSync.CallToNative(31,[e,isNaN(t)?0:parseInt(t)],!0)}Enable(e){this._NativeSync.CallToNative(32,[e],!0)}},qe.sImpactSensorManager=Ae,qe.TextureInstantLoad=g,qe.QRCodeLevel=T,qe.ColorSpace=f,qe.TextureManager=I,qe.FreeMoveExternType=re,qe.AnimationListener=class{constructor(e,t,i){this.ListenerEnabledFlags=0,this.InvokeAnimationStart=e,this._OnAnimationStart=e,e&&(this.ListenerEnabledFlags|=1),this.InvokeAnimationEnd=t,this._OnAnimationEnd=t,t&&(this.ListenerEnabledFlags|=2),this.InvokeViewNoVisible=i,this._OnViewNoVisible=i,i&&(this.ListenerEnabledFlags|=4),this.InvokeAnimRepeat=null,this._OnAnimRepeat=null,this.InvokeAnimFinal=null,this._OnAnimFinal=null,this._AttachedGroup=null,this._InheritListener=[]}OnStart(e){return this.InvokeAnimationStart=this._OnAnimationStart=e,e?this.ListenerEnabledFlags|=1:this.ListenerEnabledFlags&=30,this}OnEnd(e){return this.InvokeAnimationEnd=this._OnAnimationEnd=e,e?this.ListenerEnabledFlags|=2:this.ListenerEnabledFlags&=29,this}OnRepeat(e){return this.InvokeAnimRepeat=this._OnAnimRepeat=e,e?this.ListenerEnabledFlags|=8:this.ListenerEnabledFlags&=23,this}OnFinalProgress(e){return this.InvokeAnimFinal=this._OnAnimFinal=e,e?this.ListenerEnabledFlags|=16:this.ListenerEnabledFlags&=15,this}AddInherit(e){if(e){if(0==this._InheritListener.length){var t=this;this.InvokeAnimationStart=function(){t._OnAnimationStart&&t._OnAnimationStart();for(var e=0;e<t._InheritListener.length;e++)t._InheritListener[e].InvokeAnimationStart?.()},this.InvokeAnimationEnd=function(e){t._OnAnimationEnd&&t._OnAnimationEnd(e);for(var i=0;i<t._InheritListener.length;i++)t._InheritListener[i].InvokeAnimationEnd?.(e)},this.InvokeViewNoVisible=function(){t._OnViewNoVisible&&t._OnViewNoVisible();for(var e=0;e<t._InheritListener.length;e++)t._InheritListener[e].InvokeViewNoVisible?.()},this.InvokeAnimFinal=function(e){t._OnAnimFinal&&t._OnAnimFinal(e);for(var i=0;i<t._InheritListener.length;i++)t._InheritListener[i].InvokeAnimFinal?.(e)},this.InvokeAnimRepeat=function(e){t._OnAnimRepeat&&t._OnAnimRepeat(e);for(var i=0;i<t._InheritListener.length;i++)t._InheritListener[i].InvokeAnimRepeat?.(e)},this.ListenerEnabledFlags=31}this._InheritListener.push(e)}}InvokeFromNativeForge(e){switch(e.type){case"end":this.InvokeAnimationEnd?.(1==e.normalEnd);break;case"novisible":this.InvokeViewNoVisible?.();break;case"final":this.InvokeAnimFinal?.(e.progress);break;case"repeat":this.InvokeAnimRepeat?.(e.timesCount)}}},qe.AnimFireCommand=Se,qe.AnimationEnable=_e,qe.TranslateAnimation=class extends de{constructor(e,t,i,n,s,a){super(),ue.CreateTranslate(e,t,i,n,s,a,this.AnimNativeId)}},qe.RotateAnimation=class extends de{constructor(e,t,i,n,s,a){super(),ue.CreateRotate(e,t,i,n,s,a,this.AnimNativeId)}},qe.ScaleAnimation=class extends de{constructor(e,t,i,n,s,a,r,o,l=200,h=200){super(),ue.CreateScale(e,t,i,n,s,a,l,h,r,o,this.AnimNativeId)}},qe.TranslateFrameAnimation=class extends de{constructor(e,t,i,n,s,a){super();let r=Math.floor(100*i/55)/100;ue.CreateTranslateFrame(e,t,r,r,n,s,a,this.AnimNativeId)}},qe.CssKeyframeAnimation=class extends de{constructor(e,t,i,n,s){super(),ue.CreateCssKeyframe(e,t,i,n,s,this.AnimNativeId)}},qe.ShaderAnimation=class extends de{constructor(e,t){super(),ue.CreateShaderAnimation(e,t,this.AnimNativeId)}},qe.FreeMoveAnimation=class extends de{constructor(e,t,i){super(),this._EchoCallback=e,ue.CreateFreeMoveAnimation(this.AnimNativeId,e,t,i)}},qe.FreeMoveActEvtType=ae,qe.BezierEasing=ee,qe.StepsEasing=class extends X{constructor(e,t){super(),this._Steps=e,this._Type=t}Package(){var e=this._GetBasePackage(6);return e.St={S:this._Steps,T:this._Type},e}},qe.Easing=ie,qe.FreeMoveCmdPackBuilder=class{static InitActCmdPack(e,t,i,n){return{t:1,cmds:n,tkn:isNaN(i)?0:i,spd:isNaN(e)?0:e,acc:isNaN(t)?0:t}}static InitStateCmdPack(e){return{t:2,cmd:e}}},qe.FreeMoveConditionSet=class{static AppendSubCmd(e,t){const i="cmds";e.hasOwnProperty("cmdPacks")?console.error("Error: conflict with command pack list"):(e.hasOwnProperty(i)||(e[i]=[]),e[i]?.push(t))}static SetCmdList(e,t){t instanceof Array&&(e.hasOwnProperty("cmdPacks")?console.error("Error: conflict with command pack list"):e.cmds=t)}static SetCmdPackList(e,t){t instanceof Array&&(e.hasOwnProperty("cmds")?console.error("Error: conflict with sub-command list"):e.cmdPacks=t)}static InitCommonInfo(){return{g:0,m:!1,s:null,brk:!1}}static UpdateCommonInfo(e,t,i,n,s){e.g=t??0,e.m=i??!1,e.s=n??null,e.brk=s}static ReachPosition(e,t,i){let n=se(e,t),s={subt:1,react:1,e:n.e,xv:n.x,yv:n.y};return le(s,i),s}static BoxPosition(e,t,i,n,s){let a=0,r=0,o=0,l=0,h=0;isNaN(e)||(a=e,h|=1),isNaN(t)||(r=t,h|=2),isNaN(i)||(o=i,h|=4),isNaN(n)||(l=n,h|=8);let c={subt:1,react:7,de:h,lv:a,tv:r,rv:o,bv:l};return le(c,s),c}static StartMove(e,t){return this.OnMovement(t,1,1,e)}static OnMovement(e,t,i,n){let s={subt:1,react:9,xv:t,yv:i,e:n};return le(s,e),s}static OffsetPosition(e,t,i,n,s){let a=0,r=0,o=0,l=0,h=0;isNaN(e)||(a=e,h|=1),isNaN(t)||(r=t,h|=2),isNaN(i)||(o=i,h|=4),isNaN(n)||(l=n,h|=8);let c={subt:1,react:8,de:h,lv:a,tv:r,rv:o,bv:l};return le(c,s),c}static ReachSpeed(e,t,i){let n=se(e,t),s={subt:2,react:1,e:n.e,xv:n.x,yv:n.y};return le(s,i),s}static AcrossSpeed(e,t,i){let n=se(e,t),s={subt:2,react:2,e:n.e,xv:n.x,yv:n.y};return le(s,i),s}static SpeedAllBoundary(e,t,i,n,s){let a=0,r=0,o=0,l=0,h=0;isNaN(e)||(a=e,h|=1),isNaN(i)||(o=i,h|=2),isNaN(t)||(r=t,h|=4),isNaN(n)||(l=n,h|=8);let c={subt:2,react:3,de:h,lv:a,rv:r,tv:o,bv:l};return le(c,s),c}static TouchCount(e,t){let i={subt:5,react:2,tct:t};return le(i,e),i}static OnNexusEvent(e,t,i){let n={subt:3,nexus:e,etyp:t};return le(n,i),n}static OnDragStart(e,t){let i={subt:3,nexus:t,etyp:ae.ActEvent_ActDragStart};return le(i,e),i}static OnDragEnd(e,t){let i={subt:3,nexus:t,etyp:ae.ActEvent_ActDragEnd};return le(i,e),i}static OnTouchDown(e,t){let i={subt:3,nexus:t,etyp:ae.ActEvent_ActTouchDown};return le(i,e),i}static OnTouchRelease(e,t){let i={subt:3,nexus:t,etyp:ae.ActEvent_ActTouchRelease};return le(i,e),i}static OnFlingStart(e,t){let i={subt:3,nexus:t,etyp:ae.ActEvent_ActFlingStart};return le(i,e),i}static OnFlingProgress(e,t){let i={subt:3,nexus:t,etyp:ae.ActEvent_ActFlingProgress};return le(i,e),i}static OnMouseWheelScrollProgress(e,t){let i={subt:3,nexus:t,etyp:ae.ActEvent_ActMouseWheelScrollProgress};return le(i,e),i}static OnFlingEnd(e,t){let i={subt:3,nexus:t,etyp:ae.ActEvent_ActFlingEnd};return le(i,e),i}static OnFlingCancel(e,t){let i={subt:3,nexus:t,etyp:ae.ActEvent_ActFlingCancel};return le(i,e),i}static OnFlingDrop(e,t){let i={subt:3,nexus:t,etyp:ae.ActEvent_ActFlingDrop};return le(i,e),i}static OnHitBlock(e,t){let i={subt:4,blkGid:e};return le(i,t),i}static OnNextTick(e,t){let i={subt:5,react:1,tgap:e};return t.m=!1,le(i,t),i}static MovementSyncNexus(e,t){let i={subt:3,nexus:t,etyp:ae.ActEvent_MovementSync};return le(i,e),i}},qe.FreeMoveActionBuilder=class{static SetSpeed(e,t){let i=se(e,t);return{typ:2,set:{xv:i.x,yv:i.y,xye:i.e}}}static ScaleSpeed(e,t){let i=se(e,t);return{typ:13,set:{xv:i.x,yv:i.y,xye:i.e}}}static SetAccel(e,t){let i=se(e,t);return{typ:7,set:{xye:i.e,xv:i.x,yv:i.y}}}static AltSpeed(e,t,i){if(!i)return null;let n=se(e,t);return{typ:5,set:{xv:n.x,yv:n.y,xye:n.e,tim:Math.floor(i)}}}static StopMoving(){return{typ:3}}static alignSpeed(){return{typ:12}}static BrakeToPos(e,t){let i=se(e,t);return{typ:4,set:{xv:Math.floor(i.x),yv:Math.floor(i.y),xye:i.e}}}static SetArrowSpeed(e,t,i,n){let s=se(e,t),a=se(i,n);return{typ:6,set:{xye:s.e,xv:Math.floor(s.x),yv:Math.floor(s.y),xye1:a.e,xv1:a.x,yv1:a.y}}}static TeleportTo(e,t,i){let n=se(e,t);return{typ:8,set:{xye:n.e,xv:Math.floor(n.x),yv:Math.floor(n.y),isAbs:!i}}}static AckMovementSync(e,t,i,n,s,a){return{typ:10,set:{hstart:e,hend:t,vstart:i,vend:n,xye:s,st:a}}}},qe.FreeMoveStateBuilder=class{static FireEcho(e){return{typ:52,set:{tkn:e}}}static FireNexusEvent(e,t){return isNaN(t)||0==t?null:{typ:55,set:{etyp:isNaN(e)?0:e,nexus:t}}}static NewCondition(e){return{typ:he,set:{sub:1,set:e}}}static DelActionAssocCondition(){return{typ:he,set:{sub:5}}}static RemoveAllCondtions(){return{typ:he,set:{sub:6}}}static RemoveByGroup(e){return{typ:he,set:{sub:4,gt:e}}}static RemoveByName(e){return{typ:he,set:{sub:7,sn:e}}}static ActiveCondition(e,t){return{typ:he,set:{sub:2,gt:isNaN(e)||e<=0?re.GroupType_Invalid_Ext:e,sn:t}}}static DeactiveCondition(e,t){return{typ:he,set:{sub:3,gt:isNaN(e)||e<=0?re.GroupType_Invalid_Ext:e,sn:t}}}static SetOffsetPos(e,t){let i=se(e,t);return{typ:53,set:{xv:Math.floor(i.x),yv:Math.floor(i.y),xye:i.e}}}static SetAbsPos(e,t){let i=se(e,t);return{typ:54,set:{xv:Math.floor(i.x),yv:Math.floor(i.y),xye:i.e}}}static AlignPosition(){return{typ:63}}static UpdateBaseOffset(e,t){let i=se(e,t);return{typ:64,set:{xv:Math.floor(i.x),yv:Math.floor(i.y),xye:i.e}}}static TouchLockSwitch(e,t,i=-1){return{typ:59,set:{il:e,dir:t,ut:i}}}static SetTouchAttractChild(e){return{typ:60,set:{cid:e?e.AnimNativeId:0}}}static SetHitWallOverflow(){return{typ:56}}static RevertWithHitBlock(){return{typ:57}}static StartMovementSync(e,t,i,n,s,a){return{typ:61,set:{hstart:t,hend:i,vstart:n,vend:s,xye:a,nexus:e}}}static StopMovementSync(){return{typ:62}}};
|
|
2
2
|
|