beyond-simulator-web 0.5.0 → 0.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -5
- package/dist/public/app.js +18 -3
- package/dist/public/editor.js +34 -12
- package/dist/public/index.html +1 -1
- package/dist/public/play-renderer.js +108 -107
- package/dist/public/play.js +2 -2
- package/dist/public/styles.css +3 -2
- package/dist/server.js +21 -18
- package/dist/worker.js +12 -9
- package/package.json +1 -1
package/dist/worker.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import{parentPort as Ir}from"node:worker_threads";import{existsSync as bi,readFileSync as ku}from"node:fs";import{randomUUID as Xa}from"node:crypto";import{isAbsolute as Ar,win32 as _r}from"node:path";function Er(e,t=!1){let i=String(e??"").trim().replaceAll("\\","/");if(t&&(!i||i==="."))return"";if(!i||Ar(i)||_r.isAbsolute(i)||i.split("/").some(n=>!n||n==="."||n===".."||/[<>:"|?*\x00-\x1f]/.test(n)||/[. ]$/.test(n)||/^(con|prn|aux|nul|com[1-9]|lpt[1-9])(?:\.|$)/i.test(n)))throw new Error("\u811A\u672C\u76EE\u5F55/\u8DEF\u5F84\u5FC5\u987B\u662F\u6709\u6548\u7684\u76F8\u5BF9\u8DEF\u5F84\uFF0C\u4E0D\u80FD\u5305\u542B .. \u6216 Windows \u7279\u6B8A\u6587\u4EF6\u540D");return i}function ln(e){if(e==null)return null;if(e.version!==1)throw new Error("unsupported scriptSync version");let t=String(e.clientImportRoot||"").trim();if(!Ar(t)&&!_r.isAbsolute(t))throw new Error("\u5B9E\u673A\u5BFC\u5165\u6839\u76EE\u5F55\u5FC5\u987B\u662F\u7EDD\u5BF9\u8DEF\u5F84");return{version:1,workspaceDir:Er(e.workspaceDir,!0),clientImportRoot:t,clientSubdir:Er(e.clientSubdir,!0)}}import{basename as Bt,dirname as Eu,isAbsolute as Au,join as Ua,resolve as Ha}from"node:path";var ds=[[10003004,10003004],[10005001,10005142],[10006001,10006002],[10007002,10007002],[10008001,10008001],[10009001,10009011],[20001001,20001074],[20001076,20001121],[20001123,20001156],[20001158,20001302],[20001304,20001568],[20001570,20001999],[20002001,20002755],[20002757,20002999],[20003001,20003455],[30001001,30001016],[30002001,30002017],[30003001,30003011],[30004001,30004001],[30005001,30005020],[30006001,30006026],[30007001,30007013],[30008001,30008011]];function Tr(e){return!Number.isSafeInteger(e)||!ds.some(([t,i])=>e>=t&&e<=i)?null:e===10003004||e===10008001?128:256}var hs=[[100001,100006],[100101,100213],[101001,101018],[101020,101028],[101030,101046],[101048,101048],[101050,101054],[101056,101080],[102001,102052],[103001,103148],[104001,104010],[105001,105140],[105142,105219],[105221,105317],[106001,106047],[106049,106096],[107001,107007],[107010,107020],[107031,107092],[107094,107180],[107183,107201],[107203,107205],[107207,107228],[107231,107278],[107280,107402],[108001,108017],[108019,108020],[109001,109031],[109033,109034],[109036,109075],[110001,110053],[111001,111139],[112001,112042]];function We(e){return e==null||e===""?"StaticReference":typeof e=="string"?e:typeof e.Name=="string"?e.Name:"Unknown"}function Pr(e,t){return We(t)==="StaticReference"&&un(e,t)}function un(e,t){let i=We(t);return i==="Prefab"?Tr(e)!==null:i==="StaticReference"&&Number.isSafeInteger(e)&&e>100006&&hs.some(([n,r])=>e>=n&&e<=r)}var Ci="7.1.0",le=Object.freeze(["KEYBOARD","TOUCHSCREEN","CONTROLLER_CONSOLE","CONTROLLER_MOBILE"]),ie=Object.freeze({"pc-16-9":{id:"pc-16-9",device:"pc",platform:"KEYBOARD",width:1600,height:900,ratio:"16:9",luaDevice:"KeyboardAndMouse",label:"PC 1600\xD7900"},"pc-21-9":{id:"pc-21-9",device:"pc",platform:"KEYBOARD",width:2100,height:900,ratio:"21:9",luaDevice:"KeyboardAndMouse",label:"PC 2100\xD7900"},"mobile-16-9":{id:"mobile-16-9",device:"mobile",platform:"TOUCHSCREEN",width:1280,height:720,ratio:"16:9",luaDevice:"Mobile",label:"\u624B\u673A 1280\xD7720"},"mobile-19.5-9":{id:"mobile-19.5-9",device:"mobile",platform:"TOUCHSCREEN",width:1560,height:720,ratio:"19.5:9",luaDevice:"Mobile",label:"\u624B\u673A 1560\xD7720"},"mobile-4-3":{id:"mobile-4-3",device:"mobile",platform:"TOUCHSCREEN",width:1280,height:960,ratio:"4:3",luaDevice:"Mobile",label:"\u624B\u673A 1280\xD7960"}}),ki="pc-16-9",be=2,Et=Object.freeze({KEYBOARD:"pc-16-9",TOUCHSCREEN:"mobile-16-9",CONTROLLER_CONSOLE:"pc-16-9",CONTROLLER_MOBILE:"mobile-16-9"}),At=Object.freeze({"server-container":"\u5BA2\u6237\u7AEF\u63A7\u4EF6\u5BB9\u5668",container:"\u5BB9\u5668\u8282\u70B9",textbox:"\u6587\u672C\u6846",image:"\u56FE\u7247",button:"\u9884\u8BBE\u6309\u94AE",cursor:"\u5149\u6807\u68C0\u6D4B\u533A\u57DF",grid:"\u7F51\u683C\u89C6\u7A97",reference:"\u6A21\u677F\u5F15\u7528\u63A7\u4EF6",textwindow:"\u6587\u672C\u89C6\u7A97",keyhint:"\u6309\u952E\u63D0\u793A",animation:"\u754C\u9762\u52A8\u6548",fullscreen:"\u5168\u5C4F\u52A8\u6548"}),Ei=Object.freeze(["server-container","container","textbox","cursor","reference","grid","image","button","textwindow","keyhint","animation","fullscreen"]),Rr=Object.freeze({"server-container":null,container:[150,150],textbox:[100,40],image:[80,80],button:[150,50],cursor:[150,50],grid:[80,80],reference:[80,80],textwindow:[100,40],keyhint:[40,40],animation:[100,100],fullscreen:null}),ms=Object.freeze({100001:"rect",100002:"circle",100003:"triangle",100004:"fourstar",100005:"fivestar",100006:"ring"});function _t(e,t){return We(t)==="StaticReference"&&ms[e]||(un(e,t)?"sprite":"missing")}var Mr=50888,Jt=Object.freeze({font:4294967295,bg:16777215,outline:858993459,image:4294967295});function Tt(e,t="$",i=new Set){if(e===void 0)throw new Error(`undefined at ${t}`);if(typeof e=="number"&&!Number.isFinite(e))throw new Error(`non-finite number at ${t}`);if(typeof e=="bigint"||typeof e=="function"||typeof e=="symbol")throw new Error(`non-JSON value at ${t}`);if(!(e===null||typeof e!="object")){if(i.has(e))throw new Error(`circular value at ${t}`);if(i.add(e),Array.isArray(e))e.forEach((n,r)=>Tt(n,`${t}[${r}]`,i));else for(let[n,r]of Object.entries(e))Tt(r,`${t}.${n}`,i);i.delete(e)}}function V(e){return Tt(e),JSON.parse(JSON.stringify(e))}function Nr(e,t="$"){Tt(e,t)}function Fr(e){return ie[e]||ie[ki]}function Qt(e,t=0,i=0){return!e||typeof e!="object"?{x:t,y:i}:{x:Number(e.x??t),y:Number(e.y??i)}}function ps(e){return!e||typeof e!="object"?{x:1,y:1,z:1}:{x:Number(e.x??1),y:Number(e.y??1),z:Number(e.z??1)}}function gs(e){return!e||typeof e!="object"?{x:0,y:0,z:0}:{x:Number(e.x??0),y:Number(e.y??0),z:Number(e.z??0)}}function Ai({layout:e="center",size:t=[100,40],offset:i=[0,0]}={}){return e==="stretch"?{scale:{x:1,y:1,z:1},rotation:{x:0,y:0,z:0},anchorMin:{x:0,y:0},anchorMax:{x:1,y:1},offset:{x:0,y:0},size:{x:0,y:0},pivot:{x:.5,y:.5}}:{scale:{x:1,y:1,z:1},rotation:{x:0,y:0,z:0},anchorMin:{x:.5,y:.5},anchorMax:{x:.5,y:.5},offset:{x:Number(i[0]??0),y:Number(i[1]??0)},size:{x:Number(t[0]??0),y:Number(t[1]??0)},pivot:{x:.5,y:.5}}}function ze(e){let t=e||Ai();return{scale:ps(t.scale),rotation:gs(t.rotation),anchorMin:Qt(t.anchorMin??t.anchor_min,.5,.5),anchorMax:Qt(t.anchorMax??t.anchor_max,.5,.5),offset:Qt(t.offset,0,0),size:Qt(t.size,0,0),pivot:Qt(t.pivot,.5,.5)}}function fe(e,t=0){let i=Number(e);return Number.isFinite(i)?i:t}function Be(e,t){let i=e.width,n=e.height,r=e.left,o=e.bottom,a=t.anchorMin||{x:t.anchorMinX,y:t.anchorMinY},s=t.anchorMax||{x:t.anchorMaxX,y:t.anchorMaxY},u=t.offset||{x:t.anchoredPositionX,y:t.anchoredPositionY},l=t.size||{x:t.sizeDeltaX,y:t.sizeDeltaY},f=t.pivot||{x:t.pivotX,y:t.pivotY},d=fe(a?.x,.5)*i,m=fe(a?.y,.5)*n,p=fe(s?.x,.5)*i,g=fe(s?.y,.5)*n,y=fe(l?.x),C=fe(l?.y),x=fe(f?.x,.5),I=fe(f?.y,.5),z=p-d+y,F=g-m+C,X=r+d+fe(u?.x)-y*x,U=o+m+fe(u?.y)-C*I;return{left:X,bottom:U,width:z,height:F,right:X+z,top:U+F,centerX:X+z/2,centerY:U+F/2}}function Pt(){return{a:1,b:0,c:0,d:1,tx:0,ty:0}}function ys(e,t){return{a:e.a*t.a+e.c*t.b,b:e.b*t.a+e.d*t.b,c:e.a*t.c+e.c*t.d,d:e.b*t.c+e.d*t.d,tx:e.a*t.tx+e.c*t.ty+e.tx,ty:e.b*t.tx+e.d*t.ty+e.ty}}function _e(e,t,i){return{x:e.a*t+e.c*i+e.tx,y:e.b*t+e.d*i+e.ty}}function Rt(e){let t=e.a*e.d-e.b*e.c;return!Number.isFinite(t)||Math.abs(t)<1e-8?null:{a:e.d/t,b:-e.b/t,c:-e.c/t,d:e.a/t,tx:(e.c*e.ty-e.d*e.tx)/t,ty:(e.b*e.tx-e.a*e.ty)/t}}function cn(e,t){let i=t.rotation||{x:t.localRotationX,y:t.localRotationY,z:t.localRotationZ},n=t.scale||{x:t.localScaleX,y:t.localScaleY},r=t.pivot||{x:t.pivotX,y:t.pivotY},o=fe(i?.z)*Math.PI/180,a=Math.cos(o),s=Math.sin(o),u=fe(i?.x)*Math.PI/180,l=fe(i?.y)*Math.PI/180,f=Math.cos(u),d=Math.sin(u),m=Math.cos(l),p=Math.sin(l),g=H=>Math.abs(H)<1e-12?0:H,y=fe(n?.x,1),C=fe(n?.y,1),x=e.left+e.width*fe(r?.x,.5),I=e.bottom+e.height*fe(r?.y,.5),z=g(m*a+p*d*s)*y,F=g(f*s)*y,X=g(-m*s+p*d*a)*C,U=g(f*a)*C;return{a:z,b:F,c:X,d:U,tx:x-z*x-X*I,ty:I-F*x-U*I}}function Zt(e,t,i){return ys(e||Pt(),cn(t,i))}function Or(e,t){let i=_e(t,e.centerX,e.centerY),n=Math.abs(e.width*Math.hypot(t.a,t.b)),r=Math.abs(e.height*Math.hypot(t.c,t.d));return{left:i.x-n/2,bottom:i.y-r/2,width:n,height:r,centerX:i.x,centerY:i.y,rotationZ:Math.atan2(t.b,t.a)*180/Math.PI}}function ve(e){let t=typeof e=="string"?Fr(e):e;return{left:0,bottom:0,width:t.width,height:t.height,right:t.width,top:t.height,centerX:t.width/2,centerY:t.height/2}}function fn(e){return{posX:e.centerX,posY:e.centerY,width:e.width,height:e.height}}function ut(e,t,i){let n=ze(t),r=e.width,o=e.height,a=n.anchorMin.x*r,s=n.anchorMin.y*o,u=n.anchorMax.x*r,l=n.anchorMax.y*o,f=Number(i.width),d=Number(i.height),m=Number(i.posX),p=Number(i.posY),g=m-f/2,y=p-d/2;return n.size={x:f-(u-a),y:d-(l-s)},n.offset={x:g-e.left-a+n.size.x*n.pivot.x,y:y-e.bottom-s+n.size.y*n.pivot.y},n}function zr(e,t){let i=ze(e),r={"bottom-left":[[0,0],[0,0],[0,0]],bottom:[[.5,0],[.5,0],[.5,0]],"bottom-right":[[1,0],[1,0],[1,0]],left:[[0,.5],[0,.5],[0,.5]],center:[[.5,.5],[.5,.5],[.5,.5]],right:[[1,.5],[1,.5],[1,.5]],"top-left":[[0,1],[0,1],[0,1]],top:[[.5,1],[.5,1],[.5,1]],"top-right":[[1,1],[1,1],[1,1]],stretch:[[0,0],[1,1],[.5,.5]],"stretch-horizontal":[[0,.5],[1,.5],[.5,.5]],"stretch-vertical":[[.5,0],[.5,1],[.5,.5]]}[t];return r&&(i.anchorMin={x:r[0][0],y:r[0][1]},i.anchorMax={x:r[1][0],y:r[1][1]},i.pivot={x:r[2][0],y:r[2][1]}),i}function $r(e){let t=ze(e),i=(n,r)=>Math.abs(n-r)<1e-4;if(i(t.anchorMin.x,0)&&i(t.anchorMin.y,0)&&i(t.anchorMax.x,1)&&i(t.anchorMax.y,1))return"stretch";if(i(t.anchorMin.x,t.anchorMax.x)&&i(t.anchorMin.y,t.anchorMax.y)){let n=t.anchorMin.x,r=t.anchorMin.y,o=[[0,0,"bottom-left"],[.5,0,"bottom"],[1,0,"bottom-right"],[0,.5,"left"],[.5,.5,"center"],[1,.5,"right"],[0,1,"top-left"],[.5,1,"top"],[1,1,"top-right"]];for(let a of o)if(i(n,a[0])&&i(r,a[1]))return a[2]}return"custom"}function ct(e){return Fr(e).platform}function Gr(e){let t={};for(let i of le)t[i]=e(i);return t}var bs={scale:["x","y","z"],rotation:["x","y","z"],anchorMin:["x","y"],anchorMax:["x","y"],offset:["x","y"],size:["x","y"],pivot:["x","y"]};function Dr(e,t){for(let[i,n]of Object.entries(bs))for(let r of n)if(!Number.isFinite(e?.[i]?.[r]))throw new Error(`${t}.${i}.${r} must be a finite number`)}function Je(e,t="transformByPlatform"){if(!e||typeof e!="object"||Array.isArray(e))throw new Error(`${t}: \u9700\u8981\u5B8C\u6574\u7684\u56DB\u5E73\u53F0\u5E03\u5C40`);for(let i of Object.keys(e))if(!le.includes(i))throw new Error(`${t}: unknown platform ${i}`);for(let i of le)Dr(e[i],`${t}.${i}`)}function ft(e){if(Object.hasOwn(e,"transformByCanvas"))throw new Error(`${e.name||e.id||"\u63A7\u4EF6"}: \u4E0D\u518D\u652F\u6301 transformByCanvas\uFF1B\u8BF7\u4F7F\u7528\u56DB\u5E73\u53F0 transformByPlatform \u5E03\u5C40`);Je(e.transformByPlatform,`${e.name||e.id||"\u63A7\u4EF6"}.transformByPlatform`)}function dt(e,t){if(!le.includes(t))throw new Error(`unknown platform ${t}`);return Dr(e?.[t],`transformByPlatform.${t}`),ze(e[t])}var vs=Object.freeze([{key:"genericField501",label:"\u901A\u7528\u69FD field501",type:"number",defaultValue:0,wire:"GenericSlot.field501"},{key:"footerField505",label:"\u5C3E\u90E8\u69FD field505",type:"number",defaultValue:0,wire:"FooterSlot.field505"}]),Ss=Object.freeze({container:[],textbox:[{key:"textField501",label:"\u6587\u672C\u914D\u7F6E field501",type:"number",defaultValue:20,wire:"TextConfig.field501"},{key:"textField503",label:"\u6587\u672C\u914D\u7F6E field503",type:"number",defaultValue:12,wire:"TextConfig.field503"},{key:"textAlign",label:"\u6C34\u5E73\u5BF9\u9F50\u679A\u4E3E\u539F\u59CB\u503C",type:"enum",defaultValue:0,wire:"TextConfig.align",options:[{value:0,label:"0 \xB7 \u5DE6\u5BF9\u9F50"},{value:1,label:"1 \xB7 \u5C45\u4E2D"},{value:2,label:"2 \xB7 \u53F3\u5BF9\u9F50"}]}],textwindow:[{key:"textField501",label:"\u6587\u672C\u914D\u7F6E field501",type:"number",defaultValue:20,wire:"TextConfig.field501"},{key:"textField503",label:"\u6587\u672C\u914D\u7F6E field503",type:"number",defaultValue:12,wire:"TextConfig.field503"},{key:"textAlign",label:"\u6C34\u5E73\u5BF9\u9F50\u679A\u4E3E\u539F\u59CB\u503C",type:"enum",defaultValue:0,wire:"TextConfig.align",options:[{value:0,label:"0 \xB7 \u5DE6\u5BF9\u9F50"},{value:1,label:"1 \xB7 \u5C45\u4E2D"},{value:2,label:"2 \xB7 \u53F3\u5BF9\u9F50"}]},{key:"textField511",label:"\u6587\u672C\u89C6\u7A97 field511",type:"number",defaultValue:1,wire:"TextConfig.field511"},{key:"textViewField502",label:"\u89C6\u7A97\u6807\u8BB0 field502",type:"number",defaultValue:1,wire:"TextConfig.viewFlags.field502"},{key:"textViewField503",label:"\u89C6\u7A97\u6807\u8BB0 field503",type:"number",defaultValue:1,wire:"TextConfig.viewFlags.field503"}],cursor:[{key:"cursorField501",label:"\u5149\u6807\u68C0\u6D4B field501",type:"number",defaultValue:1,wire:"CursorConfig.field501"}],reference:[{key:"templateRefSlot",label:"\u6A21\u677F\u5F15\u7528\u69FD\u539F\u59CB\u503C",type:"string",defaultValue:"",wire:"Details.templateRefSlot"}],grid:[{key:"gridField501",label:"\u7F51\u683C\u6807\u8BB0 field501",type:"number",defaultValue:1,wire:"GridViewConfig.field501"},{key:"gridField507",label:"\u7F51\u683C\u6807\u8BB0 field507",type:"number",defaultValue:1,wire:"GridViewConfig.field507"},{key:"gridField508",label:"\u7F51\u683C\u6807\u8BB0 field508",type:"number",defaultValue:1,wire:"GridViewConfig.field508"},{key:"gridField509",label:"\u7F51\u683C\u6807\u8BB0 field509",type:"number",defaultValue:1,wire:"GridViewConfig.field509"},{key:"gridField511",label:"\u7F51\u683C\u6807\u8BB0 field511",type:"number",defaultValue:5,wire:"GridViewConfig.field511"},{key:"gridField512",label:"\u7F51\u683C\u6807\u8BB0 field512",type:"number",defaultValue:1,wire:"GridViewConfig.field512"}],keyhint:[{key:"keyHintField501",label:"\u6309\u952E\u63D0\u793A field501",type:"number",defaultValue:1,wire:"KeyHintConfig.field501"},{key:"keyHintField502",label:"\u952E\u9F20\u952E\u4F4D\u539F\u59CB\u503C",type:"number",defaultValue:1,wire:"KeyHintConfig.field502"}],image:[{key:"imageSlotType",label:"\u56FE\u7247\u7C7B\u578B\u539F\u59CB\u503C",type:"number",defaultValue:0,wire:"ImageSlotConfig.imageType"},{key:"imageField502",label:"\u56FE\u7247\u6807\u8BB0 field502",type:"number",defaultValue:1,wire:"ImageConfig.field502"},{key:"imageField504",label:"\u56FE\u7247\u6807\u8BB0 field504",type:"number",defaultValue:1,wire:"ImageConfig.field504"},{key:"imageField505",label:"\u56FE\u7247\u6807\u8BB0 field505",type:"number",defaultValue:1,wire:"ImageConfig.field505"},{key:"imageField507",label:"\u56FE\u7247\u6807\u8BB0 field507",type:"number",defaultValue:2,wire:"ImageConfig.field507"},{key:"imageFillType",label:"\u586B\u5145\u5F62\u72B6\u679A\u4E3E\u539F\u59CB\u503C",type:"enum",defaultValue:1,wire:"ImageConfig.fillType",options:[{value:1,label:"1 \xB7 \u6A2A\u5411"},{value:2,label:"2 \xB7 \u7EB5\u5411"},{value:3,label:"3 \xB7 90\u5EA6\u73AF\u7ED5"},{value:4,label:"4 \xB7 180\u5EA6\u73AF\u7ED5"},{value:5,label:"5 \xB7 360\u5EA6\u73AF\u7ED5"}]}],animation:[{key:"effectSlot",label:"\u754C\u9762\u52A8\u6548\u69FD\u539F\u59CB\u503C",type:"string",defaultValue:"",wire:"Details.effectSlot"}],fullscreen:[{key:"fullscreenEffectSlot",label:"\u5168\u5C4F\u52A8\u6548\u69FD\u539F\u59CB\u503C",type:"string",defaultValue:"",wire:"Details.fullscreenEffectSlot"}]});function Vr(e){return[...vs,...Ss[e]||[]]}function Yr(e,t){return Vr(e).find(i=>i.key===t)||null}function dn(e,t){if(!e)throw new Error("unknown raw GIA field");if(e.type==="string")return String(t??"");let i=Number(t);if(!Number.isFinite(i))throw new Error(`${e.wire} must be a finite number`);return Math.trunc(i)}function Br(e,t={}){let i={};for(let n of Vr(e)){let r=Object.hasOwn(t||{},n.key)?t[n.key]:n.defaultValue;i[n.key]=dn(n,r)}if(e==="reference")for(let n of["templateRefSlotBase64","templateRefOuterBase64"]){if(!Object.hasOwn(t||{},n))continue;let r=t[n];if(typeof r!="string"||!/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(r))throw new Error(`${n} must be base64`);r&&(i[n]=r)}return i}function Te(e){let t=Number(e);return Number.isSafeInteger(t)&&t>0&&t<=2147483647}function hn(e,t){if(e){t(e);for(let i of e.children||[])hn(i,t)}}function Mt(e,t=new Set,{skipServerContainer:i=!1}={}){return hn(e,n=>{i&&n.kind==="server-container"||Te(n.guid)&&t.add(Number(n.guid))}),t}function Qe(e,t=1073741850){let i=Number.isSafeInteger(t)&&t>0?t:1073741850;i<1073741850&&(i=1073741850);for(let n of e)Te(n)&&n>=i&&(i=Number(n)+1);for(;e.has(i);)i+=1;if(i>2147483647)throw new Error("GUID space exhausted");return i}function Xr(e,t=new Set,{skipServerContainer:i=!1}={}){let n=[];hn(e,r=>{if(i&&r.kind==="server-container")return;let o=Number(r.guid);if(Te(o)&&!t.has(o)){t.add(o),r.guid=o;return}n.push(r)});for(let r of n){let o=Qe(t);r.guid=o,t.add(o)}return t}function Ce(e){return Number.isSafeInteger(e)&&e>0&&e<=2147483647}function Xe(e,{warnings:t=[]}={}){if(e.meta?.assetType!=="client-control-template")return;if(e.meta.giaAssetIndexSchemaVersion>1)throw new Error(`\u4E0D\u652F\u6301\u5BA2\u6237\u7AEF\u8D44\u4EA7\u7F16\u53F7\u7248\u672C ${e.meta.giaAssetIndexSchemaVersion}`);let i=[],n=g=>{g.kind!=="server-container"&&i.push(g);for(let y of g.children||[])n(y)};n(e.root);let r=new Map,o=new Map;for(let g of i){if(!Ce(g.giaInfoIndex))continue;let y=r.get(g.giaInfoIndex)||[];y.push(g),r.set(g.giaInfoIndex,y);let C=o.get(g.kind)||new Set;C.add(g.giaInfoIndex),o.set(g.kind,C)}let a=(e.root.children||[]).filter(g=>g.kind!=="server-container"),s=new Set(a),u=a.some((g,y)=>Ce(g.giaInfoIndex)&&a.slice(0,y).some(C=>C.giaInfoIndex===g.giaInfoIndex)),l=!e.meta.giaAssetIndexSchemaVersion&&u&&i.every(g=>g.giaInfoIndexSource!=="authoring")&&[...o.values()].every(g=>g.size===1)&&[...r.values()].every(g=>g.every(y=>y.kind===g[0].kind)),f=new Set;if(l)for(let g of r.values()){let y=g.find(C=>s.has(C))||g[0];for(let C of g)C!==y&&f.add(C)}let d=new Map,m=Number.isSafeInteger(e.meta.giaNextAssetIndex)&&e.meta.giaNextAssetIndex>=2?e.meta.giaNextAssetIndex:2;for(let g of i){if(!Ce(g.giaInfoIndex)||(m=Math.max(m,g.giaInfoIndex+1),f.has(g)))continue;let y=d.get(g.giaInfoIndex);if(y&&(y.giaInfoIndexSource==="authoring"||g.giaInfoIndexSource==="authoring"))throw new Error(`\u65B0\u5EFA\u8D44\u4EA7\u7F16\u53F7 ${g.giaInfoIndex} \u91CD\u590D\uFF1A${y.name} / ${g.name}`);d.set(g.giaInfoIndex,g)}l&&(m=Math.max(m,13));let p=l?[...a,...i.filter(g=>!s.has(g))].filter(g=>f.has(g)||!Ce(g.giaInfoIndex)):i.filter(g=>!Ce(g.giaInfoIndex));if(p.length&&m+p.length-1>2147483647)throw new Error("\u5BA2\u6237\u7AEF\u8D44\u4EA7\u7F16\u53F7\u7A7A\u95F4\u5DF2\u8017\u5C3D");for(let g of p)g.giaInfoIndex=m++,g.giaInfoIndexSource="authoring";e.meta.giaNextAssetIndex=m,e.meta.giaAssetIndexSchemaVersion=1,f.size&&t.push(`\u65E7\u5BA2\u6237\u7AEF\u8D44\u4EA7\u7F16\u53F7\u81EA\u52A8\u8FC1\u79FB\uFF1A\u4FEE\u590D ${f.size} \u6761\u6309\u63A7\u4EF6\u7C7B\u578B\u590D\u7528\u7684\u7F16\u53F7\uFF1BGUID\u3001Lua \u5F15\u7528\u548C\u63A7\u4EF6\u5C5E\u6027\u4FDD\u6301\u4E0D\u53D8\u3002`)}var mn=1;function pn(e="n"){let t=`${e}${mn}`;return mn+=1,t}function _i(e=1){mn=e}function gn(e,{isRootContainer:t=!1}={}){if(e==="server-container"||e==="fullscreen"||e==="container"&&t)return Ai({layout:"stretch"});let i=Rr[e]||[80,80];return Ai({layout:"center",size:i})}function ws(e,t){return Gr(()=>gn(e,t))}function Is(e){Je(e);let t={};for(let i of le)t[i]=dt(e,i);return t}function q(e,t={}){if(!At[e])throw new Error(`unknown kind: ${e}`);Object.hasOwn(t,"transformByCanvas")&&ft(t);let i=t.isRootContainer===!0,n=t.id||pn(e==="server-container"?"sc":"n"),r=Object.hasOwn(t,"transformByPlatform")?Is(t.transformByPlatform):ws(e,{isRootContainer:i}),o={id:n,kind:e,name:t.name||At[e],guid:t.guid??0,giaRelatedGuids:Array.isArray(t.giaRelatedGuids)?t.giaRelatedGuids.filter(a=>Number.isSafeInteger(Number(a))&&Number(a)>0).map(Number):[],...Ce(Number(t.giaInfoIndex))?{giaInfoIndex:Number(t.giaInfoIndex),giaInfoIndexSource:t.giaInfoIndexSource==="authoring"?"authoring":"imported"}:{},active:t.active!==!1,visible:t.visible!==!1,canControllerFocus:t.canControllerFocus??t.giaRaw?.footerField505===1,syncAllDevices:t.syncAllDevices!==!1,giaRaw:Br(e,t.giaRaw),transformByPlatform:r,children:[],scriptMappingIds:Array.isArray(t.scriptMappingIds)?t.scriptMappingIds.filter(a=>Number.isSafeInteger(Number(a))&&Number(a)>0).map(Number):[]};if(e==="container"&&(o.isolateNavigation=t.isolateNavigation===!0,o.disableKeyEventPassthrough=t.disableKeyEventPassthrough===!0,o.disableCursorEventPassthrough=t.disableCursorEventPassthrough===!0,o.showCursor=t.showCursor===!0),(e==="textbox"||e==="textwindow")&&(o.fontSize=t.fontSize??20,o.adaptiveFontSize=t.adaptiveFontSize===!0,o.minimumFontSize=t.minimumFontSize??20,o.fontColor=t.fontColor??Jt.font,o.bgColor=t.bgColor??Jt.bg,o.enableOutline=t.enableOutline!==!1,o.outlineColor=t.outlineColor??Jt.outline,o.horizontalAlignment=t.horizontalAlignment||"Left",o.verticalAlignment=t.verticalAlignment||"Top",Number.isInteger(t.giaRaw?.textVerticalAlign)&&![0,1,2].includes(t.giaRaw.textVerticalAlign)&&(o.giaRaw.textVerticalAlign=t.giaRaw.textVerticalAlign),o.text=t.text??"",Object.hasOwn(t.giaRaw||{},"textAlign")||(o.giaRaw.textAlign={Left:0,Middle:1,Right:2}[o.horizontalAlignment]??o.giaRaw.textAlign),e==="textwindow"&&(o.interactable=t.interactable!==!1,o.showScrollBar=t.showScrollBar!==!1)),e==="image"&&(o.imageSource=t.imageSource||"StaticReference",o.imageType=["Basic","Stretch"].includes(t.imageType)?t.imageType:null,o.imageId=t.imageId??100001,o.imageColor=t.imageColor??Jt.image,o.enableMask=t.enableMask===!0,o.enableSoftEdge=t.enableSoftEdge===!0,o.softEdgeMode=t.softEdgeMode||"Percentage",o.softEdgeWidthX=t.softEdgeWidthX??8,o.softEdgeWidthY=t.softEdgeWidthY??8,o.horizontalSoftRange=t.horizontalSoftRange??85,o.verticalSoftRange=t.verticalSoftRange??85,o.enableFill=t.enableFill===!0,o.fillType=t.fillType||"Horizontal",o.fillHorizontalType=t.fillHorizontalType||"Left",o.fillVerticalType=t.fillVerticalType||"Bottom",o.fillRadial90Type=t.fillRadial90Type||"BottomLeft",o.fillRadialType=t.fillRadialType||"Bottom",o.fillAmount=t.fillAmount??1,o.reverseMaskArea=t.reverseMaskArea===!0||t.reverseMask===!0,Object.hasOwn(t.giaRaw||{},"imageFillType")||(o.giaRaw.imageFillType={Horizontal:1,Vertical:2,Radial90:3,Radial180:4,Radial360:5}[o.fillType]??o.giaRaw.imageFillType)),e==="button"&&(o.raycastTarget=t.raycastTarget!==!1,o.interactable=t.interactable!==!1,o.clickAudioId=t.clickAudioId??Mr,o.unavailableChildId=t.unavailableChildId??null,o.hoverChildId=t.hoverChildId??null,o.pressedChildId=t.pressedChildId??null,o.selectedChildId=t.selectedChildId??null),e==="cursor"&&(o.raycastTarget=t.raycastTarget??t.giaRaw?.cursorField501!==0),e==="reference"&&(o.referencedPrefabId=t.referencedPrefabId??t.giaRaw?.templateRefSlot??null,Object.hasOwn(t.giaRaw||{},"templateRefSlot")||(o.giaRaw.templateRefSlot=String(o.referencedPrefabId??""))),e==="grid"&&(o.itemPrefabId=t.itemPrefabId??null,o.raycastTarget=t.raycastTarget!==!1,o.interactable=t.interactable!==!1,o.showScrollBar=t.showScrollBar!==!1,o.scrollDirection=t.scrollDirection||"Vertical",o.layoutConstraint=t.layoutConstraint||"AutoWrap",o.layoutConstraintFixedCount=t.layoutConstraintFixedCount??null,o.cellSizeX=t.cellSizeX??50,o.cellSizeY=t.cellSizeY??50,o.spacingX=t.spacingX??8,o.spacingY=t.spacingY??8,o.padding1X=t.padding1X??20,o.padding1Y=t.padding1Y??20,o.padding2X=t.padding2X??20,o.padding2Y=t.padding2Y??20,o.previewCount=t.previewCount??t.giaRaw?.gridField511??5,Object.hasOwn(t.giaRaw||{},"gridField511")||(o.giaRaw.gridField511=Math.trunc(o.previewCount))),e==="keyhint"&&(o.keyboardKeyCode=t.keyboardKeyCode??t.giaRaw?.keyHintField502??null,o.controllerKeyCode=t.controllerKeyCode??t.giaRaw?.keyHintField501??null,Object.hasOwn(t.giaRaw||{},"keyHintField502")||(o.giaRaw.keyHintField502=Math.trunc(o.keyboardKeyCode??1)),Object.hasOwn(t.giaRaw||{},"keyHintField501")||(o.giaRaw.keyHintField501=Math.trunc(o.controllerKeyCode??1))),e==="animation"||e==="fullscreen"){let a=e==="animation"?t.giaRaw?.effectSlot:t.giaRaw?.fullscreenEffectSlot;o.animationId=t.animationId??a??null,o.playSoundEffect=t.playSoundEffect??null,e==="animation"&&(o.layer=t.layer??null);let s=e==="animation"?"effectSlot":"fullscreenEffectSlot";Object.hasOwn(t.giaRaw||{},s)||(o.giaRaw[s]=String(o.animationId??""))}if(t.children)for(let a of t.children)o.children.push(a);return o}function ht(){_i(1);let e=q("server-container",{id:"sc1",name:"\u5BA2\u6237\u7AEF\u63A7\u4EF6\u5BB9\u5668"}),t=q("container",{id:"n1",name:"\u5BB9\u5668\u8282\u70B9",isRootContainer:!0}),i=q("textbox",{id:"n2",name:"\u6587\u672C\u6846",text:"\u6587\u672C"}),n=q("cursor",{id:"n3",name:"\u5149\u6807\u68C0\u6D4B\u533A\u57DF"}),r=q("reference",{id:"n4",name:"\u6A21\u677F\u5F15\u7528\u63A7\u4EF6"}),o=q("grid",{id:"n5",name:"\u7F51\u683C\u89C6\u7A97"}),a=q("button",{id:"n6",name:"\u9884\u8BBE\u6309\u94AE"}),s=q("textwindow",{id:"n7",name:"\u6587\u672C\u89C6\u7A97"}),u=q("keyhint",{id:"n8",name:"\u6309\u952E\u63D0\u793A"}),l=q("image",{id:"n9",name:"\u56FE\u7247",imageId:100005}),f=q("animation",{id:"n10",name:"\u754C\u9762\u52A8\u6548"}),d=q("fullscreen",{id:"n11",name:"\u5168\u5C4F\u52A8\u6548"}),m=(p,g,y)=>{for(let C of Object.values(p.transformByPlatform))C.offset={x:g,y}};return m(i,-300,250),m(n,-300,140),m(r,-300,30),m(o,-300,-100),m(a,0,0),m(s,300,250),m(u,300,140),m(l,300,30),m(f,300,-100),t.children.push(i,n,r,o,a,s,u,l,f,d),e.children.push(t),_i(12),Xr(e),{version:1,layoutSchemaVersion:be,meta:{name:"\u672A\u547D\u540D\u754C\u9762\u63A7\u4EF6\u7EC4",assetType:"server-control-template",sourceFormat:"authoring",sourceFile:""},canvasId:"pc-16-9",selectedId:"n2",root:e}}function Nt(){_i(1);let e=q("server-container",{id:"sc1",name:"\u5BA2\u6237\u7AEF\u63A7\u4EF6\u6A21\u677F"}),t=q("container",{id:"n1",guid:1073742100,name:"Lua\u5B9E\u4F8B\u5316\u9762\u677F"}),i=q("textbox",{id:"n2",guid:1073742101,name:"\u6A21\u677F\u6807\u9898",text:"\u5BA2\u6237\u7AEF\u6A21\u677F\u5DF2\u5B9E\u4F8B\u5316",fontSize:28,horizontalAlignment:"Middle"}),n=q("image",{id:"n3",guid:1073742102,name:"\u6A21\u677F\u56FE\u6807",imageId:100005}),r=q("button",{id:"n4",guid:1073742103,name:"\u786E\u8BA4\u6309\u94AE"}),o=q("textbox",{id:"n5",guid:1073742104,name:"\u6309\u94AE\u6587\u5B57",text:"\u786E\u8BA4",horizontalAlignment:"Middle",verticalAlignment:"Top"}),a=(l,f,d)=>{for(let m of Object.values(l.transformByPlatform))m.offset={x:f,y:d}};((l,f,d)=>{for(let m of Object.values(l.transformByPlatform))m.size={x:f,y:d}})(t,520,320),a(i,0,110),a(n,0,0),a(r,0,-110),r.children.push(o),t.children.push(i,n,r),e.children.push(t),_i(6);let u={version:1,layoutSchemaVersion:be,meta:{name:"Lua\u5B9E\u4F8B\u5316\u9762\u677F",assetType:"client-control-template",sourceFormat:"authoring",sourceFile:"",gameVersion:Ci,giaOwnerUid:114514,giaFileId:1073741829,giaFileName:"\u5BA2\u6237\u7AEF\u63A7\u4EF6\u6A21\u677F\u5217\u8868.gia"},canvasId:"pc-16-9",selectedId:"n1",root:e};return Xe(u),u}function ee(e,t,i=null){t(e,i);for(let n of e.children||[])ee(n,t,e)}function de(e,t){let i=null;return ee(e,n=>{n.id===t&&(i=n)}),i}function yn(e,t="n"){let i=pn(t);for(;de(e,i);)i=pn(t);return i}function Ze(e,t){let i=null;return ee(e,(n,r)=>{n.id===t&&(i=r)}),i}function bn(e){let t=e.root||e;return t.kind==="container"?t:(t.children||[]).find(i=>i.kind==="container")||(t.children||[])[0]||t}function ei(e){if(e.meta?.assetType!=="client-control-template")return bn(e);let t=de(e.root,e.selectedId);if(!t||t.kind==="server-container")return e.root.children?.[0]||e.root;let i=Ze(e.root,t.id);for(;i&&i.kind!=="server-container";)t=i,i=Ze(e.root,t.id);return t}function vn(e){ft(e);let t={id:e.id,name:e.name,guid:e.guid,giaRelatedGuids:e.giaRelatedGuids,giaInfoIndex:e.giaInfoIndex,giaInfoIndexSource:e.giaInfoIndexSource,scriptMappingIds:e.scriptMappingIds,giaRaw:e.giaRaw,active:e.active,visible:e.visible,canControllerFocus:e.canControllerFocus,syncAllDevices:e.syncAllDevices,transformByPlatform:e.transformByPlatform};e.kind==="container"&&(t.isolateNavigation=e.isolateNavigation,t.disableKeyEventPassthrough=e.disableKeyEventPassthrough,t.disableCursorEventPassthrough=e.disableCursorEventPassthrough,t.showCursor=e.showCursor),(e.kind==="textbox"||e.kind==="textwindow")&&(t.fontSize=e.fontSize,t.adaptiveFontSize=e.adaptiveFontSize,t.minimumFontSize=e.minimumFontSize,t.fontColor=e.fontColor,t.bgColor=e.bgColor,t.enableOutline=e.enableOutline,t.outlineColor=e.outlineColor,t.horizontalAlignment=e.horizontalAlignment,t.verticalAlignment=e.verticalAlignment,t.text=e.text??"",e.kind==="textwindow"&&(t.interactable=e.interactable,t.showScrollBar=e.showScrollBar)),e.kind==="image"&&(t.imageSource=e.imageSource,t.imageType=e.imageType,t.imageId=e.imageId,t.imageColor=e.imageColor,t.enableMask=e.enableMask,t.enableSoftEdge=e.enableSoftEdge,t.softEdgeMode=e.softEdgeMode,t.softEdgeWidthX=e.softEdgeWidthX,t.softEdgeWidthY=e.softEdgeWidthY,t.horizontalSoftRange=e.horizontalSoftRange,t.verticalSoftRange=e.verticalSoftRange,t.enableFill=e.enableFill,t.fillType=e.fillType,t.fillHorizontalType=e.fillHorizontalType,t.fillVerticalType=e.fillVerticalType,t.fillRadial90Type=e.fillRadial90Type,t.fillRadialType=e.fillRadialType,t.fillAmount=e.fillAmount,t.reverseMaskArea=e.reverseMaskArea??e.reverseMask),e.kind==="button"&&(t.raycastTarget=e.raycastTarget,t.interactable=e.interactable,t.clickAudioId=e.clickAudioId,t.unavailableChildId=e.unavailableChildId??null,t.hoverChildId=e.hoverChildId??null,t.pressedChildId=e.pressedChildId??null,t.selectedChildId=e.selectedChildId??null),e.kind==="cursor"&&(t.raycastTarget=e.raycastTarget),e.kind==="reference"&&(t.referencedPrefabId=e.referencedPrefabId??null),e.kind==="grid"&&(t.itemPrefabId=e.itemPrefabId??null,t.raycastTarget=e.raycastTarget,t.interactable=e.interactable,t.showScrollBar=e.showScrollBar,t.scrollDirection=e.scrollDirection,t.layoutConstraint=e.layoutConstraint,t.layoutConstraintFixedCount=e.layoutConstraintFixedCount??null,t.cellSizeX=e.cellSizeX,t.cellSizeY=e.cellSizeY,t.spacingX=e.spacingX,t.spacingY=e.spacingY,t.padding1X=e.padding1X,t.padding1Y=e.padding1Y,t.padding2X=e.padding2X,t.padding2Y=e.padding2Y,t.previewCount=e.previewCount),e.kind==="keyhint"&&(t.keyboardKeyCode=e.keyboardKeyCode??null,t.controllerKeyCode=e.controllerKeyCode??null),(e.kind==="animation"||e.kind==="fullscreen")&&(t.animationId=e.animationId??null,t.playSoundEffect=e.playSoundEffect??null,e.kind==="animation"&&(t.layer=e.layer??null)),t.isRootContainer=e.kind==="container"&&xs(e.transformByPlatform);let i=q(e.kind,t);return i.children=(e.children||[]).map(n=>vn(n)),i}function xs(e){let t=e&&(e.KEYBOARD||Object.values(e)[0]);return t?Math.abs(t.anchorMin?.x??.5)<1e-4&&Math.abs(t.anchorMin?.y??.5)<1e-4&&Math.abs((t.anchorMax?.x??.5)-1)<1e-4&&Math.abs((t.anchorMax?.y??.5)-1)<1e-4:!1}function Ur(e,t,i={}){if(e.kind==="server-container"&&t!=="container")throw new Error("server container only accepts container nodes");let n=q(t,i);return e.children.push(n),n}function Hr(e,t){if(e.id===t)throw new Error("cannot remove root");let i=Ze(e,t);if(!i)return!1;let n=i.children.findIndex(r=>r.id===t);return n<0?!1:(i.children.splice(n,1),!0)}var jr=1e-4;function Cs(e,t){return Math.abs(e.anchorMax[t]-e.anchorMin[t])>jr&&Math.abs(e.size[t])<=jr}function ks(e,t,i){if(!(t.width>0)||!(t.height>0))throw new Error("source parent must have positive size");if(!(i.width>0)||!(i.height>0))throw new Error("target parent must have positive size");let n=Be(t,e),r=(n.centerX-t.left)/t.width,o=(n.centerY-t.bottom)/t.height,a=ut(i,e,{posX:i.left+r*i.width,posY:i.bottom+o*i.height,width:n.width,height:n.height});for(let s of["x","y"])Cs(e,s)&&(a.offset[s]=e.offset[s],a.size[s]=e.size[s]);return a}function Kr({transformByPlatform:e,source:t,canvasId:i,syncAllDevices:n,sourceParentBox:r=ve(i),targetParentBoxByPlatform:o={}}){Je(e);let a=ct(i),s={};for(let u of le)u===a?s[u]=ze(t):n!==!1?s[u]=ks(t,r,o[u]||ve(Et[u])):s[u]=dt(e,u);return Je(s),s}function et(e,t){return dt(e,ct(t))}import{createCanvas as Ds}from"@napi-rs/canvas";import{existsSync as Ts,openSync as Ps,closeSync as Rs,fstatSync as Ms,readFileSync as Ns}from"node:fs";import{extname as Fs,isAbsolute as Os}from"node:path";import{createHash as zs}from"node:crypto";import{workerData as Ri}from"node:worker_threads";import{GlobalFonts as Zr}from"@napi-rs/canvas";var Lr='"Microsoft YaHei UI","Microsoft YaHei","HarmonyOS Sans SC","Noto Sans CJK SC",sans-serif';var Sn=e=>`QxqyLocal_${e}`,qr=e=>e?`"${Sn(e)}",${Lr}`:Lr;import{existsSync as Es,mkdirSync as vc,readFileSync as As,renameSync as Sc,rmSync as wc,writeFileSync as Ic}from"node:fs";import{homedir as wn}from"node:os";import{dirname as kc,join as Ti,win32 as Pi}from"node:path";function Wr(e=process.platform,t=process.env){if(e!=="win32")return[];let i=t.SystemDrive||"C:",n=t.ProgramFiles||`${i}\\Program Files`,r="YuanShen_Data\\StreamingAssets\\MiHoYoSDKRes\\HttpServerResources\\font\\zh-cn.ttf";return[...new Set([Pi.join(n,"Genshin Impact","Genshin Impact Game",r),Pi.join(i+"\\","Mihoyo","Genshin Impact","Genshin Impact Game",r),Pi.join(n,"HoYoPlay","games","Genshin Impact game",r),Pi.join(n,"miHoYo Launcher","games","Genshin Impact Game",r)])]}function _s(){if(process.env.QXQY_FONT_CONFIG_PATH)return process.env.QXQY_FONT_CONFIG_PATH;let e=process.platform==="win32"?process.env.APPDATA||Ti(wn(),"AppData","Roaming"):process.platform==="darwin"?Ti(wn(),"Library","Application Support"):process.env.XDG_CONFIG_HOME||Ti(wn(),".config");return Ti(e,"beyond-simulator","font.json")}function Jr(e){if(!e||!["auto","custom","system"].includes(e.mode))throw new Error("\u8BF7\u9009\u62E9\u81EA\u52A8\u67E5\u627E\u3001\u6307\u5B9A\u6587\u4EF6\u6216\u7CFB\u7EDF\u5B57\u4F53");let t=e.scope===void 0?"all":e.scope;if(!["game","all"].includes(t))throw new Error("\u8BF7\u9009\u62E9\u5B57\u4F53\u5E94\u7528\u8303\u56F4");let i=typeof e.path=="string"?e.path.trim():"";if(i.length>4096)throw new Error("\u5B57\u4F53\u8DEF\u5F84\u8FC7\u957F");if((i.startsWith('"')&&i.endsWith('"')||i.startsWith("'")&&i.endsWith("'"))&&(i=i.slice(1,-1)),e.mode==="custom"&&!i)throw new Error("\u8BF7\u586B\u5199\u5B57\u4F53\u6587\u4EF6\u7684\u7EDD\u5BF9\u8DEF\u5F84");return{mode:e.mode,path:e.mode==="custom"?i:"",scope:t}}function Qr(e=_s()){if(!Es(e))return{mode:"auto",path:"",scope:"all"};try{return Jr(JSON.parse(As(e,"utf8")))}catch{throw new Error("\u672C\u673A\u5B57\u4F53\u8BBE\u7F6E\u65E0\u6CD5\u8BFB\u53D6\uFF0C\u8BF7\u5728\u300C\u5B57\u4F53\u8BBE\u7F6E\u300D\u4E2D\u91CD\u65B0\u4FDD\u5B58")}}function no(e){let t=Buffer.from(e),i=t.subarray(0,4).toString("hex");if(t.length<12||t.length>33554432||!["00010000","4f54544f"].includes(i))throw new Error("QXQY_FONT_PATH must contain a valid TTF or OTF font (at most 32 MiB)");let n=zs("sha256").update(t).digest("hex"),r=Sn(n);try{if(!Zr.has(r)&&!Zr.register(t,r))throw new Error("invalid font")}catch{throw new Error("QXQY_FONT_PATH font could not be registered")}return{id:n,data:t,type:i==="4f54544f"?"font/otf":"font/ttf"}}function In(e){if(!e)return null;if(!Os(e)||![".ttf",".otf"].includes(Fs(e).toLowerCase()))throw new Error("QXQY_FONT_PATH must be an absolute path to a TTF or OTF font");let t,i;try{t=Ps(e,"r");let n=Ms(t);if(!n.isFile()||n.size<12||n.size>33554432)throw new Error("invalid size");i=Ns(t)}catch{throw new Error("QXQY_FONT_PATH must point to a readable font file of at most 32 MiB")}finally{t!==void 0&&Rs(t)}return no(i)}var eo=!1,Mi=null,ti={path:"",source:"system",scope:"all"},Ni=null,to="";function $s(e){if(e.mode==="custom")return{font:In(e.path),path:e.path,source:"custom"};if(e.mode==="auto"){let t;for(let i of Wr())if(Ts(i))try{return{font:In(i),path:i,source:"auto"}}catch(n){t=n}if(t)throw t}return{font:null,path:"",source:"system"}}function Gs(){if(!eo){if(Ri&&Object.hasOwn(Ri,"localFont"))Mi=Ri.localFont?no(Ri.localFont):null;else{try{Ni=Qr()}catch(e){to=e.message}if(ti.scope=Ni?.scope||"all",process.env.QXQY_FONT_PATH)Mi=In(process.env.QXQY_FONT_PATH),ti={...ti,path:process.env.QXQY_FONT_PATH,source:"environment"};else if(Ni)try{let e=$s(Ni);Mi=e.font,ti={...ti,path:e.path,source:e.source}}catch(e){to=e.message}}eo=!0}return Mi}var ro=()=>qr(Gs()?.id);var xn=Ds(1,1).getContext("2d"),oo=new WeakMap,ao=(e,t)=>Math.max(1,Math.trunc(Number.isFinite(Number(e))?Number(e):t));function mt(e,t,i){let n=String(e.text??"").replace(/\r\n?/g,`
|
|
2
|
-
`),
|
|
3
|
-
`)){let U="";for(let H of X)U&&xn.measureText(U+H).width>g&&(y.push(U),U=""),U+=H;y.push(U)}let C=p*1.2,x=y.length*C,I=e.kind==="textbox"&&n?p*.25+4:0,z=n?x+I:0,F=z<=i+1e-6&&y.every(X=>xn.measureText(X).width<=g+1e-6);return{fontSize:p,lines:y,lineHeight:C,contentHeight:x,blockInset:I,requiredHeight:z,textWidth:g,fits:F}},d=Math.max(0,t-4),m=f(r,d);if(a&&!m.fits&&o<r){m=f(o,d);let p=o+1,g=r-1;for(;p<=g;){let y=Math.floor((p+g)/2),C=f(y,d);C.fits?(m=C,p=y+1):g=y-1}}return e.kind==="textwindow"&&e.showScrollBar!==!1&&m.contentHeight>i&&(m=f(m.fontSize,Math.max(0,d-12))),oo.set(e,{key:u,value:m}),m}function so(e,t){let i=[];function n(r){t[r.id]&&i.push(t[r.id]);let o=r.children||[];for(let a=o.length-1;a>=0;a-=1)n(o[a])}return n(e),i}function tt(e,t,i=ct(t)){let n=ve(t),r={};function o(a,s,u){let l=dt(a.transformByPlatform,i),f=Be(s,l),d=a.kind==="server-container"?u:Zt(u,f,l),m=Or(f,d);r[a.id]={...f,...fn(f),id:a.id,kind:a.kind,name:a.name,visible:a.visible!==!1,active:a.active!==!1,rotationX:l.rotation.x,rotationY:l.rotation.y,rotationZ:l.rotation.z,renderLeft:m.left,renderBottom:m.bottom,renderWidth:m.width,renderHeight:m.height,renderRotationZ:m.rotationZ,renderMatrix:d,primitive:a.kind==="image"?_t(a.imageId,a.imageSource):null,...a.kind==="textbox"||a.kind==="textwindow"?{text:a.text??"",fontSize:a.fontSize,adaptiveFontSize:a.adaptiveFontSize===!0,minimumFontSize:a.minimumFontSize,textLayout:mt(a,f.width,f.height),fontColor:a.fontColor,bgColor:a.bgColor,enableOutline:a.enableOutline!==!1,outlineColor:a.outlineColor,horizontalAlignment:a.horizontalAlignment,verticalAlignment:a.verticalAlignment}:{},...a.kind==="image"?{imageSource:a.imageSource,imageType:a.imageType??null,imageId:a.imageId,imageColor:a.imageColor,enableMask:a.enableMask===!0,enableSoftEdge:a.enableSoftEdge===!0,softEdgeMode:a.softEdgeMode,softEdgeWidthX:a.softEdgeWidthX,softEdgeWidthY:a.softEdgeWidthY,horizontalSoftRange:a.horizontalSoftRange,verticalSoftRange:a.verticalSoftRange,enableFill:a.enableFill===!0,fillType:a.fillType,fillHorizontalType:a.fillHorizontalType,fillVerticalType:a.fillVerticalType,fillRadial90Type:a.fillRadial90Type,fillRadialType:a.fillRadialType,fillAmount:a.fillAmount,reverseMaskArea:a.reverseMaskArea===!0}:{},...a.kind==="button"?{raycastTarget:a.raycastTarget!==!1,interactable:a.interactable!==!1,clickAudioId:a.clickAudioId,unavailableChildId:a.unavailableChildId??null,hoverChildId:a.hoverChildId??null,pressedChildId:a.pressedChildId??null,selectedChildId:a.selectedChildId??null}:{}};let p=a.kind==="server-container"?s:f;for(let g of a.children||[])o(g,p,d)}return o(e,n,Pt()),{canvas:n,boxes:r}}function Cn(e,t){let i=[];function n(r,o,a=null,s=[],u=0,l=1,f=e.id){i.push({id:r.id,guid:t?.get(r.id)??(r.guid||0),kind:r.kind,name:r.name,label:At[r.kind]||r.kind,depth:o,parentId:a,ancestorIds:s,siblingIndex:u,siblingCount:l,templateId:f,childCount:(r.children||[]).length,incomplete:!Ei.includes(r.kind)});let d=r.children||[];for(let m=0;m<d.length;m+=1)n(d[m],o+1,r.id,[...s,r.id],m,d.length,f)}return n(e,0),i}function T(e,t,i,n,r={}){return{key:e,label:t,type:i,value:n,...r}}function lo(e,t,i,n){if(!e)return null;let r=et(e.transformByPlatform,t),o=fn(i),a=[T("name","\u540D\u79F0","string",e.name),T("active","\u521D\u59CB\u6FC0\u6D3B","bool",e.active!==!1),T("visible","\u521D\u59CB\u53EF\u89C1\u6027","bool",e.visible!==!1),T("canControllerFocus","\u53EF\u88AB\u624B\u67C4\u6447\u6746\u5BFC\u822A\u9009\u4E2D","bool",e.canControllerFocus===!0),T("posX","\u4F4D\u7F6E X","number",o.posX,{computed:!0}),T("posY","\u4F4D\u7F6E Y","number",o.posY,{computed:!0}),T("width","\u5927\u5C0F W","number",o.width,{computed:!0}),T("height","\u5927\u5C0F H","number",o.height,{computed:!0}),T("rotationX","\u65CB\u8F6C X","number",r.rotation.x),T("rotationY","\u65CB\u8F6C Y","number",r.rotation.y),T("rotationZ","\u65CB\u8F6C Z","number",r.rotation.z),T("syncAllDevices","\u540C\u6B65\u4FE1\u606F\u81F3\u6240\u6709\u8BBE\u5907","bool",e.syncAllDevices!==!1),T("anchorType","\u951A\u70B9\u7C7B\u578B","enum",$r(r),{options:[{value:"center",label:"\u5C45\u4E2D"},{value:"top-left",label:"\u5DE6\u4E0A"},{value:"top",label:"\u4E0A\u65B9"},{value:"top-right",label:"\u53F3\u4E0A"},{value:"left",label:"\u5DE6\u4FA7"},{value:"right",label:"\u53F3\u4FA7"},{value:"bottom-left",label:"\u5DE6\u4E0B"},{value:"bottom",label:"\u4E0B\u65B9"},{value:"bottom-right",label:"\u53F3\u4E0B"},{value:"stretch",label:"\u53CC\u5411\u62C9\u4F38"},{value:"stretch-horizontal",label:"\u6C34\u5E73\u62C9\u4F38"},{value:"stretch-vertical",label:"\u5782\u76F4\u62C9\u4F38"},{value:"custom",label:"\u81EA\u5B9A\u4E49"}]}),T("anchorMinX","\u951A\u70B9 Min X","number",r.anchorMin.x),T("anchorMinY","\u951A\u70B9 Min Y","number",r.anchorMin.y),T("anchorMaxX","\u951A\u70B9 Max X","number",r.anchorMax.x),T("anchorMaxY","\u951A\u70B9 Max Y","number",r.anchorMax.y),T("pivotX","\u4E2D\u5FC3 X","number",r.pivot.x),T("pivotY","\u4E2D\u5FC3 Y","number",r.pivot.y)];if(e.kind==="container"&&a.push(T("isolateNavigation","\u9694\u79BB\u624B\u67C4\u5BFC\u822A","bool",e.isolateNavigation===!0),T("disableKeyEventPassthrough","\u5C4F\u853D\u6309\u952E\u4E8B\u4EF6\u7A7F\u900F","bool",e.disableKeyEventPassthrough===!0),T("disableCursorEventPassthrough","\u5C4F\u853D\u533A\u57DF\u5185\u70B9\u51FB\u4E8B\u4EF6\u7A7F\u900F","bool",e.disableCursorEventPassthrough===!0),T("showCursor","\u663E\u793A\u5E38\u9A7B\u5149\u6807","bool",e.showCursor===!0)),e.kind==="textbox"||e.kind==="textwindow"){let s=e.giaRaw?.textAlign,u=[0,1,2].includes(s)?e.horizontalAlignment||"Left":`__unrecognized:${s}`;a.push(T("fontSize","\u5B57\u53F7","number",e.fontSize),T("adaptiveFontSize","\u5B57\u53F7\u81EA\u9002\u5E94","bool",e.adaptiveFontSize===!0),T("minimumFontSize","\u6700\u5C0F\u5B57\u53F7","number",e.minimumFontSize),T("fontColor","\u6587\u672C\u8272","color",e.fontColor),T("bgColor","\u80CC\u666F\u8272","color",e.bgColor),T("enableOutline","\u542F\u7528\u63CF\u8FB9","bool",e.enableOutline!==!1),T("outlineColor","\u63CF\u8FB9\u8272","color",e.outlineColor),T("horizontalAlignment","\u6C34\u5E73\u5BF9\u9F50","enum",u,{...[0,1,2].includes(s)?{}:{unknownValue:s},options:[{value:"Left",label:"\u5DE6\u5BF9\u9F50"},{value:"Middle",label:"\u5C45\u4E2D"},{value:"Right",label:"\u53F3\u5BF9\u9F50"}]}),T("verticalAlignment","\u5782\u76F4\u5BF9\u9F50","enum",e.verticalAlignment||"Top",{options:[{value:"Top",label:"\u9876\u90E8"},{value:"Middle",label:"\u5C45\u4E2D"},{value:"Bottom",label:"\u5E95\u90E8"}]}),T("text","\u6587\u672C","text",e.text??""))}if(e.kind==="image"){let s=e.giaRaw?.imageFillType,u=[1,2,3,4,5].includes(s)?e.fillType:`__unrecognized:${s}`;a.push(T("imageSource","\u56FE\u7247\u6E90","enum",e.imageSource,{options:[{value:"StaticReference",label:"\u9759\u6001\u5F15\u7528"},{value:"Prefab",label:"\u5143\u4EF6"}]}),T("imageId","imageId","number",e.imageId??0),T("imageType","\u56FE\u7247\u7C7B\u578B","enum",e.imageType??null,{options:[{value:"Basic",label:"\u57FA\u7840"},{value:"Stretch",label:"\u62C9\u4F38"}]}),T("imageColor","\u586B\u5145\u8272","color",e.imageColor),T("enableMask","\u5F00\u542F\u906E\u7F69","bool",e.enableMask===!0),T("enableSoftEdge","\u8FB9\u7F18\u7FBD\u5316","bool",e.enableSoftEdge===!0,{gia:"W"}),T("softEdgeMode","\u7FBD\u5316\u6A21\u5F0F","enum",e.softEdgeMode,{options:[{value:"Percentage",label:"\u767E\u5206\u6BD4"},{value:"Pixel",label:"\u50CF\u7D20"}]}),T("softEdgeWidthX","\u7FBD\u5316\u5BBD\u5EA6 X","number",e.softEdgeWidthX),T("softEdgeWidthY","\u7FBD\u5316\u5BBD\u5EA6 Y","number",e.softEdgeWidthY),T("horizontalSoftRange","\u6C34\u5E73\u7FBD\u5316\u8303\u56F4","number",e.horizontalSoftRange),T("verticalSoftRange","\u5782\u76F4\u7FBD\u5316\u8303\u56F4","number",e.verticalSoftRange),T("enableFill","\u6309\u8FDB\u5EA6\u586B\u5145","bool",e.enableFill===!0,{gia:"W"}),T("fillType","\u5F62\u72B6","enum",u,{...[1,2,3,4,5].includes(s)?{}:{unknownValue:s},options:[{value:"Horizontal",label:"\u6A2A\u5411"},{value:"Vertical",label:"\u7EB5\u5411"},{value:"Radial90",label:"90\u5EA6\u73AF\u7ED5"},{value:"Radial180",label:"180\u5EA6\u73AF\u7ED5"},{value:"Radial360",label:"360\u5EA6\u73AF\u7ED5"}]}),T("fillHorizontalType","\u65B9\u5411","enum",e.fillHorizontalType,{options:[{value:"Left",label:"\u4ECE\u5DE6\u81F3\u53F3"},{value:"Right",label:"\u4ECE\u53F3\u81F3\u5DE6"}]}),T("fillVerticalType","\u65B9\u5411","enum",e.fillVerticalType,{options:[{value:"Bottom",label:"\u4ECE\u4E0B\u81F3\u4E0A"},{value:"Top",label:"\u4ECE\u4E0A\u81F3\u4E0B"}]}),T("fillRadial90Type","\u8D77\u70B9","enum",e.fillRadial90Type,{options:[{value:"BottomLeft",label:"\u5DE6\u4E0B"},{value:"TopLeft",label:"\u5DE6\u4E0A"},{value:"TopRight",label:"\u53F3\u4E0A"},{value:"BottomRight",label:"\u53F3\u4E0B"}]}),T("fillRadialType","\u8D77\u70B9","enum",e.fillRadialType,{options:[{value:"Bottom",label:"\u4E0B\u65B9"},{value:"Left",label:"\u5DE6\u4FA7"},{value:"Top",label:"\u4E0A\u65B9"},{value:"Right",label:"\u53F3\u4FA7"}]}),T("fillAmount","\u8FDB\u5EA6","percent",e.fillAmount),T("reverseMaskArea","\u906E\u7F69\u533A\u57DF\u53CD\u8F6C","bool",e.reverseMaskArea===!0,{gia:"W"}))}if(e.kind==="button"){let s=[{value:"",label:"\u672A\u8BBE\u7F6E"},...(e.children||[]).map(u=>({value:u.id,label:`${u.name} \xB7 ${u.id}`}))];a.push(T("raycastTarget","\u53EF\u88AB\u5149\u6807\u5C04\u7EBF\u68C0\u6D4B","bool",e.raycastTarget!==!1),T("interactable","\u6309\u94AE\u662F\u5426\u53EF\u7528","bool",e.interactable!==!1),T("unavailableChildId","\u4E0D\u53EF\u7528\u72B6\u6001\u8282\u70B9","node",e.unavailableChildId,{options:s,gia:"W"}),T("hoverChildId","\u60AC\u505C\u72B6\u6001\u8282\u70B9","node",e.hoverChildId,{options:s,gia:"W"}),T("pressedChildId","\u6309\u4E0B\u72B6\u6001\u8282\u70B9","node",e.pressedChildId,{options:s,gia:"W"}),T("selectedChildId","\u9009\u4E2D\u72B6\u6001\u8282\u70B9","node",e.selectedChildId,{options:s,gia:"W"}),T("clickAudioId","\u70B9\u51FB\u97F3\u6548","number",e.clickAudioId))}return e.kind==="reference"&&a.push(T("referencedPrefabId","\u5F15\u7528\u63A7\u4EF6\u6A21\u677F\u7D22\u5F15","string",e.referencedPrefabId??"")),(e.kind==="textwindow"||e.kind==="grid")&&a.push(T("interactable","\u5141\u8BB8\u6EDA\u52A8\u4EA4\u4E92","bool",e.interactable!==!1),T("showScrollBar","\u663E\u793A\u6EDA\u52A8\u6761","bool",e.showScrollBar!==!1)),e.kind==="grid"&&a.push(T("itemPrefabId","\u5217\u8868\u9879\u6A21\u677F\u7D22\u5F15","number",e.itemPrefabId??0),T("raycastTarget","\u53EF\u88AB\u5149\u6807\u5C04\u7EBF\u68C0\u6D4B","bool",e.raycastTarget!==!1),T("scrollDirection","\u6EDA\u52A8\u65B9\u5411","enum",e.scrollDirection,{options:[{value:"Vertical",label:"\u7EB5\u5411"},{value:"Horizontal",label:"\u6A2A\u5411"}]}),T("layoutConstraint","\u6392\u5217\u9650\u5236","enum",e.layoutConstraint,{options:[{value:"AutoWrap",label:"\u81EA\u52A8\u6362\u884C"},{value:"Fixed",label:"\u56FA\u5B9A\u884C\u5217\u6570"}]}),T("layoutConstraintFixedCount","\u6BCF\u884C\u6216\u6BCF\u5217\u6570\u91CF","number",e.layoutConstraintFixedCount??1),T("cellSizeX","\u5217\u8868\u9879\u5927\u5C0F W","number",e.cellSizeX,{evidence:"W"}),T("cellSizeY","\u5217\u8868\u9879\u5927\u5C0F H","number",e.cellSizeY,{evidence:"W"}),T("spacingX","\u5217\u8868\u9879\u95F4\u9694 X","number",e.spacingX,{evidence:"W"}),T("spacingY","\u5217\u8868\u9879\u95F4\u9694 Y","number",e.spacingY,{evidence:"W"}),T("padding1X","\u8FB9\u8DDD\u5411\u91CF 1 X","number",e.padding1X,{evidence:"W"}),T("padding1Y","\u8FB9\u8DDD\u5411\u91CF 1 Y","number",e.padding1Y,{evidence:"W"}),T("padding2X","\u8FB9\u8DDD\u5411\u91CF 2 X","number",e.padding2X,{evidence:"W"}),T("padding2Y","\u8FB9\u8DDD\u5411\u91CF 2 Y","number",e.padding2Y,{evidence:"W"}),T("previewCount","\u9884\u89C8\u6570\u91CF","number",e.previewCount)),e.kind==="keyhint"&&a.push(T("keyboardKeyCode","\u952E\u9F20\u6309\u952E","number",e.keyboardKeyCode??e.giaRaw?.keyHintField502??1,{gia:"W"}),T("controllerKeyCode","\u624B\u67C4\u6309\u952E","number",e.controllerKeyCode??e.giaRaw?.keyHintField501??1)),(e.kind==="animation"||e.kind==="fullscreen")&&a.push(T("animationId",e.kind==="animation"?"\u52A8\u6548\u7D22\u5F15":"\u5168\u5C4F\u52A8\u6548\u7D22\u5F15","string",e.animationId??"")),(!Ei.includes(e.kind)||e.kind==="textwindow"||e.kind==="grid")&&a.push(T("incomplete","\u5B8C\u6574\u5EA6","note",e.kind==="textwindow"||e.kind==="grid"?"\u8BD5\u73A9\u652F\u6301\u57FA\u7840\u6EDA\u52A8\uFF1B\u6EDA\u52A8\u4EA4\u4E92\u3001\u6EDA\u52A8\u6761\u53CA\u5217\u8868\u914D\u7F6E\u4EE5 JSON/Lua \u4E3A\u51C6\uFF0C\u76F8\u5173 GIA \u5F00\u5173\u6620\u5C04\u5C1A\u672A\u6838\u5B9E\u3002":"\u672C\u9636\u6BB5\u4EC5\u516C\u5171\u53D8\u6362\uFF0C\u4E1A\u52A1\u69FD\u4E0D\u5B8C\u6574")),{id:e.id,guid:n?.get(e.id)??(e.guid||0),kind:e.kind,label:At[e.kind]||e.kind,incomplete:!Ei.includes(e.kind),fields:a}}function uo(e,t,i){let n=(Array.isArray(e)?e:Object.values(e)).filter(r=>r.kind!=="server-container");for(let r=n.length-1;r>=0;r-=1){let o=n[r];if(!o.visible||!o.active)continue;let a=o.renderMatrix&&Rt(o.renderMatrix),s=a&&_e(a,t,i);if(s&&s.x>=o.left&&s.x<=o.right&&s.y>=o.bottom&&s.y<=o.top)return o.id}return null}import Vs from"protobufjs";function Ft(e,t=!1){let i=[],n=(r,o)=>{r.kind!=="server-container"&&i.push({node:r,parent:o});let a=t&&r.kind!=="server-container"?[...r.children||[]].reverse():r.children||[];for(let s of a)n(s,r)};return n(e.root,null),i}var Ys=String.raw`
|
|
1
|
+
import{parentPort as Fa}from"node:worker_threads";import{existsSync as Si,readFileSync as qc}from"node:fs";import{randomUUID as Zr}from"node:crypto";import{isAbsolute as Ga,win32 as Va}from"node:path";function Da(e,t=!1){let i=String(e??"").trim().replaceAll("\\","/");if(t&&(!i||i==="."))return"";if(!i||Ga(i)||Va.isAbsolute(i)||i.split("/").some(n=>!n||n==="."||n===".."||/[<>:"|?*\x00-\x1f]/.test(n)||/[. ]$/.test(n)||/^(con|prn|aux|nul|com[1-9]|lpt[1-9])(?:\.|$)/i.test(n)))throw new Error("\u811A\u672C\u76EE\u5F55/\u8DEF\u5F84\u5FC5\u987B\u662F\u6709\u6548\u7684\u76F8\u5BF9\u8DEF\u5F84\uFF0C\u4E0D\u80FD\u5305\u542B .. \u6216 Windows \u7279\u6B8A\u6587\u4EF6\u540D");return i}function mn(e){if(e==null)return null;if(e.version!==1)throw new Error("unsupported scriptSync version");let t=String(e.clientImportRoot||"").trim();if(!Ga(t)&&!Va.isAbsolute(t))throw new Error("\u5B9E\u673A\u5BFC\u5165\u6839\u76EE\u5F55\u5FC5\u987B\u662F\u7EDD\u5BF9\u8DEF\u5F84");return{version:1,workspaceDir:Da(e.workspaceDir,!0),clientImportRoot:t,clientSubdir:Da(e.clientSubdir,!0)}}import{basename as jt,dirname as Wc,isAbsolute as Jc,join as es,resolve as ts}from"node:path";var ks=[[10003004,10003004],[10005001,10005142],[10006001,10006002],[10007002,10007002],[10008001,10008001],[10009001,10009011],[20001001,20001074],[20001076,20001121],[20001123,20001156],[20001158,20001302],[20001304,20001568],[20001570,20001999],[20002001,20002755],[20002757,20002999],[20003001,20003455],[30001001,30001016],[30002001,30002017],[30003001,30003011],[30004001,30004001],[30005001,30005020],[30006001,30006026],[30007001,30007013],[30008001,30008011]];function Ba(e){return!Number.isSafeInteger(e)||!ks.some(([t,i])=>e>=t&&e<=i)?null:e===10003004||e===10008001?128:256}var As=[[100001,100006],[100101,100213],[101001,101018],[101020,101028],[101030,101046],[101048,101048],[101050,101054],[101056,101080],[102001,102052],[103001,103148],[104001,104010],[105001,105140],[105142,105219],[105221,105317],[106001,106047],[106049,106096],[107001,107007],[107010,107020],[107031,107092],[107094,107180],[107183,107201],[107203,107205],[107207,107228],[107231,107278],[107280,107402],[108001,108017],[108019,108020],[109001,109031],[109033,109034],[109036,109075],[110001,110053],[111001,111139],[112001,112042]];function Je(e){return e==null||e===""?"StaticReference":typeof e=="string"?e:typeof e.Name=="string"?e.Name:"Unknown"}function Ya(e,t){return Je(t)==="StaticReference"&&pn(e,t)}function pn(e,t){let i=Je(t);return i==="Prefab"?Ba(e)!==null:i==="StaticReference"&&Number.isSafeInteger(e)&&e>100006&&As.some(([n,a])=>e>=n&&e<=a)}var Ti="7.1.0",ce=Object.freeze(["KEYBOARD","TOUCHSCREEN","CONTROLLER_CONSOLE","CONTROLLER_MOBILE"]),ie=Object.freeze({"pc-16-9":{id:"pc-16-9",device:"pc",platform:"KEYBOARD",width:1600,height:900,ratio:"16:9",luaDevice:"KeyboardAndMouse",label:"PC 1600\xD7900"},"pc-21-9":{id:"pc-21-9",device:"pc",platform:"KEYBOARD",width:2100,height:900,ratio:"21:9",luaDevice:"KeyboardAndMouse",label:"PC 2100\xD7900"},"mobile-16-9":{id:"mobile-16-9",device:"mobile",platform:"TOUCHSCREEN",width:1280,height:720,ratio:"16:9",luaDevice:"Mobile",label:"\u624B\u673A 1280\xD7720"},"mobile-19.5-9":{id:"mobile-19.5-9",device:"mobile",platform:"TOUCHSCREEN",width:1560,height:720,ratio:"19.5:9",luaDevice:"Mobile",label:"\u624B\u673A 1560\xD7720"},"mobile-4-3":{id:"mobile-4-3",device:"mobile",platform:"TOUCHSCREEN",width:1280,height:960,ratio:"4:3",luaDevice:"Mobile",label:"\u624B\u673A 1280\xD7960"}}),Pi="pc-16-9",ge=2,Rt=Object.freeze({KEYBOARD:"pc-16-9",TOUCHSCREEN:"mobile-16-9",CONTROLLER_CONSOLE:"pc-16-9",CONTROLLER_MOBILE:"mobile-16-9"}),Mt=Object.freeze({"server-container":"\u5BA2\u6237\u7AEF\u63A7\u4EF6\u5BB9\u5668",container:"\u5BB9\u5668\u8282\u70B9",textbox:"\u6587\u672C\u6846",image:"\u56FE\u7247",button:"\u9884\u8BBE\u6309\u94AE",cursor:"\u5149\u6807\u68C0\u6D4B\u533A\u57DF",grid:"\u7F51\u683C\u89C6\u7A97",reference:"\u6A21\u677F\u5F15\u7528\u63A7\u4EF6",textwindow:"\u6587\u672C\u89C6\u7A97",keyhint:"\u6309\u952E\u63D0\u793A",animation:"\u754C\u9762\u52A8\u6548",fullscreen:"\u5168\u5C4F\u52A8\u6548"}),Ri=Object.freeze(["server-container","container","textbox","cursor","reference","grid","image","button","textwindow","keyhint","animation","fullscreen"]),Xa=Object.freeze({"server-container":null,container:[150,150],textbox:[100,40],image:[80,80],button:[150,50],cursor:[150,50],grid:[80,80],reference:[80,80],textwindow:[100,40],keyhint:[40,40],animation:[100,100],fullscreen:null}),_s=Object.freeze({100001:"rect",100002:"circle",100003:"triangle",100004:"fourstar",100005:"fivestar",100006:"ring"});function Nt(e,t){return Je(t)==="StaticReference"&&_s[e]||(pn(e,t)?"sprite":"missing")}var Ha=50888,Qt=Object.freeze({font:4294967295,bg:16777215,outline:858993459,image:4294967295});function Ft(e,t="$",i=new Set){if(e===void 0)throw new Error(`undefined at ${t}`);if(typeof e=="number"&&!Number.isFinite(e))throw new Error(`non-finite number at ${t}`);if(typeof e=="bigint"||typeof e=="function"||typeof e=="symbol")throw new Error(`non-JSON value at ${t}`);if(!(e===null||typeof e!="object")){if(i.has(e))throw new Error(`circular value at ${t}`);if(i.add(e),Array.isArray(e))e.forEach((n,a)=>Ft(n,`${t}[${a}]`,i));else for(let[n,a]of Object.entries(e))Ft(a,`${t}.${n}`,i);i.delete(e)}}function G(e){return Ft(e),JSON.parse(JSON.stringify(e))}function Ua(e,t="$"){Ft(e,t)}function ja(e){return ie[e]||ie[Pi]}function Zt(e,t=0,i=0){return!e||typeof e!="object"?{x:t,y:i}:{x:Number(e.x??t),y:Number(e.y??i)}}function Ts(e){return!e||typeof e!="object"?{x:1,y:1,z:1}:{x:Number(e.x??1),y:Number(e.y??1),z:Number(e.z??1)}}function Ps(e){return!e||typeof e!="object"?{x:0,y:0,z:0}:{x:Number(e.x??0),y:Number(e.y??0),z:Number(e.z??0)}}function Mi({layout:e="center",size:t=[100,40],offset:i=[0,0]}={}){return e==="stretch"?{scale:{x:1,y:1,z:1},rotation:{x:0,y:0,z:0},anchorMin:{x:0,y:0},anchorMax:{x:1,y:1},offset:{x:0,y:0},size:{x:0,y:0},pivot:{x:.5,y:.5}}:{scale:{x:1,y:1,z:1},rotation:{x:0,y:0,z:0},anchorMin:{x:.5,y:.5},anchorMax:{x:.5,y:.5},offset:{x:Number(i[0]??0),y:Number(i[1]??0)},size:{x:Number(t[0]??0),y:Number(t[1]??0)},pivot:{x:.5,y:.5}}}function Ve(e){let t=e||Mi();return{scale:Ts(t.scale),rotation:Ps(t.rotation),anchorMin:Zt(t.anchorMin??t.anchor_min,.5,.5),anchorMax:Zt(t.anchorMax??t.anchor_max,.5,.5),offset:Zt(t.offset,0,0),size:Zt(t.size,0,0),pivot:Zt(t.pivot,.5,.5)}}function ue(e,t=0){let i=Number(e);return Number.isFinite(i)?i:t}function He(e,t){let i=e.width,n=e.height,a=e.left,o=e.bottom,r=t.anchorMin||{x:t.anchorMinX,y:t.anchorMinY},s=t.anchorMax||{x:t.anchorMaxX,y:t.anchorMaxY},c=t.offset||{x:t.anchoredPositionX,y:t.anchoredPositionY},l=t.size||{x:t.sizeDeltaX,y:t.sizeDeltaY},f=t.pivot||{x:t.pivotX,y:t.pivotY},u=ue(r?.x,.5)*i,p=ue(r?.y,.5)*n,m=ue(s?.x,.5)*i,g=ue(s?.y,.5)*n,b=ue(l?.x),v=ue(l?.y),S=ue(f?.x,.5),x=ue(f?.y,.5),F=m-u+b,N=g-p+v,V=a+u+ue(c?.x)-b*S,Y=o+p+ue(c?.y)-v*x;return{left:V,bottom:Y,width:F,height:N,right:V+F,top:Y+N,centerX:V+F/2,centerY:Y+N/2}}function Ot(){return{a:1,b:0,c:0,d:1,tx:0,ty:0}}function Rs(e,t){return{a:e.a*t.a+e.c*t.b,b:e.b*t.a+e.d*t.b,c:e.a*t.c+e.c*t.d,d:e.b*t.c+e.d*t.d,tx:e.a*t.tx+e.c*t.ty+e.tx,ty:e.b*t.tx+e.d*t.ty+e.ty}}function Me(e,t,i){return{x:e.a*t+e.c*i+e.tx,y:e.b*t+e.d*i+e.ty}}function zt(e){let t=e.a*e.d-e.b*e.c;return!Number.isFinite(t)||Math.abs(t)<1e-8?null:{a:e.d/t,b:-e.b/t,c:-e.c/t,d:e.a/t,tx:(e.c*e.ty-e.d*e.tx)/t,ty:(e.b*e.tx-e.a*e.ty)/t}}function bn(e,t){let i=t.rotation||{x:t.localRotationX,y:t.localRotationY,z:t.localRotationZ},n=t.scale||{x:t.localScaleX,y:t.localScaleY},a=t.pivot||{x:t.pivotX,y:t.pivotY},o=ue(i?.z)*Math.PI/180,r=Math.cos(o),s=Math.sin(o),c=ue(i?.x)*Math.PI/180,l=ue(i?.y)*Math.PI/180,f=Math.cos(c),u=Math.sin(c),p=Math.cos(l),m=Math.sin(l),g=j=>Math.abs(j)<1e-12?0:j,b=ue(n?.x,1),v=ue(n?.y,1),S=e.left+e.width*ue(a?.x,.5),x=e.bottom+e.height*ue(a?.y,.5),F=g(p*r+m*u*s)*b,N=g(f*s)*b,V=g(-p*s+m*u*r)*v,Y=g(f*r)*v;return{a:F,b:N,c:V,d:Y,tx:S-F*S-V*x,ty:x-N*S-Y*x}}function ei(e,t,i){return Rs(e||Ot(),bn(t,i))}function La(e,t){let i=Me(t,e.centerX,e.centerY),n=Math.abs(e.width*Math.hypot(t.a,t.b)),a=Math.abs(e.height*Math.hypot(t.c,t.d));return{left:i.x-n/2,bottom:i.y-a/2,width:n,height:a,centerX:i.x,centerY:i.y,rotationZ:Math.atan2(t.b,t.a)*180/Math.PI}}function ye(e){let t=typeof e=="string"?ja(e):e;return{left:0,bottom:0,width:t.width,height:t.height,right:t.width,top:t.height,centerX:t.width/2,centerY:t.height/2}}function gn(e){return{posX:e.centerX,posY:e.centerY,width:e.width,height:e.height}}function ct(e,t,i){let n=Ve(t),a=e.width,o=e.height,r=n.anchorMin.x*a,s=n.anchorMin.y*o,c=n.anchorMax.x*a,l=n.anchorMax.y*o,f=Number(i.width),u=Number(i.height),p=Number(i.posX),m=Number(i.posY),g=p-f/2,b=m-u/2;return n.size={x:f-(c-r),y:u-(l-s)},n.offset={x:g-e.left-r+n.size.x*n.pivot.x,y:b-e.bottom-s+n.size.y*n.pivot.y},n}function Ka(e,t){let i=Ve(e),a={"bottom-left":[[0,0],[0,0],[0,0]],bottom:[[.5,0],[.5,0],[.5,0]],"bottom-right":[[1,0],[1,0],[1,0]],left:[[0,.5],[0,.5],[0,.5]],center:[[.5,.5],[.5,.5],[.5,.5]],right:[[1,.5],[1,.5],[1,.5]],"top-left":[[0,1],[0,1],[0,1]],top:[[.5,1],[.5,1],[.5,1]],"top-right":[[1,1],[1,1],[1,1]],stretch:[[0,0],[1,1],[.5,.5]],"stretch-horizontal":[[0,.5],[1,.5],[.5,.5]],"stretch-vertical":[[.5,0],[.5,1],[.5,.5]]}[t];return a&&(i.anchorMin={x:a[0][0],y:a[0][1]},i.anchorMax={x:a[1][0],y:a[1][1]},i.pivot={x:a[2][0],y:a[2][1]}),i}function qa(e){let t=Ve(e),i=(n,a)=>Math.abs(n-a)<1e-4;if(i(t.anchorMin.x,0)&&i(t.anchorMin.y,0)&&i(t.anchorMax.x,1)&&i(t.anchorMax.y,1))return"stretch";if(i(t.anchorMin.x,t.anchorMax.x)&&i(t.anchorMin.y,t.anchorMax.y)){let n=t.anchorMin.x,a=t.anchorMin.y,o=[[0,0,"bottom-left"],[.5,0,"bottom"],[1,0,"bottom-right"],[0,.5,"left"],[.5,.5,"center"],[1,.5,"right"],[0,1,"top-left"],[.5,1,"top"],[1,1,"top-right"]];for(let r of o)if(i(n,r[0])&&i(a,r[1]))return r[2]}return"custom"}function dt(e){return ja(e).platform}function Wa(e){let t={};for(let i of ce)t[i]=e(i);return t}var Ms={scale:["x","y","z"],rotation:["x","y","z"],anchorMin:["x","y"],anchorMax:["x","y"],offset:["x","y"],size:["x","y"],pivot:["x","y"]};function Ja(e,t){for(let[i,n]of Object.entries(Ms))for(let a of n)if(!Number.isFinite(e?.[i]?.[a]))throw new Error(`${t}.${i}.${a} must be a finite number`)}function Qe(e,t="transformByPlatform"){if(!e||typeof e!="object"||Array.isArray(e))throw new Error(`${t}: \u9700\u8981\u5B8C\u6574\u7684\u56DB\u5E73\u53F0\u5E03\u5C40`);for(let i of Object.keys(e))if(!ce.includes(i))throw new Error(`${t}: unknown platform ${i}`);for(let i of ce)Ja(e[i],`${t}.${i}`)}function ft(e){if(Object.hasOwn(e,"transformByCanvas"))throw new Error(`${e.name||e.id||"\u63A7\u4EF6"}: \u4E0D\u518D\u652F\u6301 transformByCanvas\uFF1B\u8BF7\u4F7F\u7528\u56DB\u5E73\u53F0 transformByPlatform \u5E03\u5C40`);Qe(e.transformByPlatform,`${e.name||e.id||"\u63A7\u4EF6"}.transformByPlatform`)}function ut(e,t){if(!ce.includes(t))throw new Error(`unknown platform ${t}`);return Ja(e?.[t],`transformByPlatform.${t}`),Ve(e[t])}var Ns=Object.freeze([{key:"genericField501",label:"\u901A\u7528\u69FD field501",type:"number",defaultValue:0,wire:"GenericSlot.field501"},{key:"footerField505",label:"\u5C3E\u90E8\u69FD field505",type:"number",defaultValue:0,wire:"FooterSlot.field505"}]),Fs=Object.freeze({container:[],textbox:[{key:"textField501",label:"\u6587\u672C\u914D\u7F6E field501",type:"number",defaultValue:20,wire:"TextConfig.field501"},{key:"textField503",label:"\u6587\u672C\u914D\u7F6E field503",type:"number",defaultValue:12,wire:"TextConfig.field503"},{key:"textAlign",label:"\u6C34\u5E73\u5BF9\u9F50\u679A\u4E3E\u539F\u59CB\u503C",type:"enum",defaultValue:0,wire:"TextConfig.align",options:[{value:0,label:"0 \xB7 \u5DE6\u5BF9\u9F50"},{value:1,label:"1 \xB7 \u5C45\u4E2D"},{value:2,label:"2 \xB7 \u53F3\u5BF9\u9F50"}]}],textwindow:[{key:"textField501",label:"\u6587\u672C\u914D\u7F6E field501",type:"number",defaultValue:20,wire:"TextConfig.field501"},{key:"textField503",label:"\u6587\u672C\u914D\u7F6E field503",type:"number",defaultValue:12,wire:"TextConfig.field503"},{key:"textAlign",label:"\u6C34\u5E73\u5BF9\u9F50\u679A\u4E3E\u539F\u59CB\u503C",type:"enum",defaultValue:0,wire:"TextConfig.align",options:[{value:0,label:"0 \xB7 \u5DE6\u5BF9\u9F50"},{value:1,label:"1 \xB7 \u5C45\u4E2D"},{value:2,label:"2 \xB7 \u53F3\u5BF9\u9F50"}]},{key:"textField511",label:"\u6587\u672C\u89C6\u7A97 field511",type:"number",defaultValue:1,wire:"TextConfig.field511"},{key:"textViewField502",label:"\u89C6\u7A97\u6807\u8BB0 field502",type:"number",defaultValue:1,wire:"TextConfig.viewFlags.field502"},{key:"textViewField503",label:"\u89C6\u7A97\u6807\u8BB0 field503",type:"number",defaultValue:1,wire:"TextConfig.viewFlags.field503"}],cursor:[{key:"cursorField501",label:"\u5149\u6807\u68C0\u6D4B field501",type:"number",defaultValue:1,wire:"CursorConfig.field501"}],reference:[{key:"templateRefSlot",label:"\u6A21\u677F\u5F15\u7528\u69FD\u539F\u59CB\u503C",type:"string",defaultValue:"",wire:"Details.templateRefSlot"}],grid:[{key:"gridField501",label:"\u7F51\u683C\u6807\u8BB0 field501",type:"number",defaultValue:1,wire:"GridViewConfig.field501"},{key:"gridField507",label:"\u7F51\u683C\u6807\u8BB0 field507",type:"number",defaultValue:1,wire:"GridViewConfig.field507"},{key:"gridField508",label:"\u7F51\u683C\u6807\u8BB0 field508",type:"number",defaultValue:1,wire:"GridViewConfig.field508"},{key:"gridField509",label:"\u7F51\u683C\u6807\u8BB0 field509",type:"number",defaultValue:1,wire:"GridViewConfig.field509"},{key:"gridField511",label:"\u7F51\u683C\u6807\u8BB0 field511",type:"number",defaultValue:5,wire:"GridViewConfig.field511"},{key:"gridField512",label:"\u7F51\u683C\u6807\u8BB0 field512",type:"number",defaultValue:1,wire:"GridViewConfig.field512"}],keyhint:[{key:"keyHintField501",label:"\u6309\u952E\u63D0\u793A field501",type:"number",defaultValue:1,wire:"KeyHintConfig.field501"},{key:"keyHintField502",label:"\u952E\u9F20\u952E\u4F4D\u539F\u59CB\u503C",type:"number",defaultValue:1,wire:"KeyHintConfig.field502"}],image:[{key:"imageSlotType",label:"\u56FE\u7247\u7C7B\u578B\u539F\u59CB\u503C",type:"number",defaultValue:0,wire:"ImageSlotConfig.imageType"},{key:"imageField502",label:"\u56FE\u7247\u6807\u8BB0 field502",type:"number",defaultValue:1,wire:"ImageConfig.field502"},{key:"imageField504",label:"\u56FE\u7247\u6807\u8BB0 field504",type:"number",defaultValue:1,wire:"ImageConfig.field504"},{key:"imageField505",label:"\u56FE\u7247\u6807\u8BB0 field505",type:"number",defaultValue:1,wire:"ImageConfig.field505"},{key:"imageField507",label:"\u56FE\u7247\u6807\u8BB0 field507",type:"number",defaultValue:2,wire:"ImageConfig.field507"},{key:"imageFillType",label:"\u586B\u5145\u5F62\u72B6\u679A\u4E3E\u539F\u59CB\u503C",type:"enum",defaultValue:1,wire:"ImageConfig.fillType",options:[{value:1,label:"1 \xB7 \u6A2A\u5411"},{value:2,label:"2 \xB7 \u7EB5\u5411"},{value:3,label:"3 \xB7 90\u5EA6\u73AF\u7ED5"},{value:4,label:"4 \xB7 180\u5EA6\u73AF\u7ED5"},{value:5,label:"5 \xB7 360\u5EA6\u73AF\u7ED5"}]}],animation:[{key:"effectSlot",label:"\u754C\u9762\u52A8\u6548\u69FD\u539F\u59CB\u503C",type:"string",defaultValue:"",wire:"Details.effectSlot"}],fullscreen:[{key:"fullscreenEffectSlot",label:"\u5168\u5C4F\u52A8\u6548\u69FD\u539F\u59CB\u503C",type:"string",defaultValue:"",wire:"Details.fullscreenEffectSlot"}]});function Qa(e){return[...Ns,...Fs[e]||[]]}function Za(e,t){return Qa(e).find(i=>i.key===t)||null}function yn(e,t){if(!e)throw new Error("unknown raw GIA field");if(e.type==="string")return String(t??"");let i=Number(t);if(!Number.isFinite(i))throw new Error(`${e.wire} must be a finite number`);return Math.trunc(i)}function eo(e,t={}){let i={};for(let n of Qa(e)){let a=Object.hasOwn(t||{},n.key)?t[n.key]:n.defaultValue;i[n.key]=yn(n,a)}if(e==="reference")for(let n of["templateRefSlotBase64","templateRefOuterBase64"]){if(!Object.hasOwn(t||{},n))continue;let a=t[n];if(typeof a!="string"||!/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(a))throw new Error(`${n} must be base64`);a&&(i[n]=a)}return i}function ke(e){let t=Number(e);return Number.isSafeInteger(t)&&t>=1073741824&&t<=1077936127}function Ue(e){let t=Number(e);return Number.isSafeInteger(t)&&t>0&&t<=2147483647}function vn(e,t){if(Ue(e)&&!ke(e))throw new Error(`${t||"\u8D44\u4EA7"}: \u7D22\u5F15 ${e} \u8D85\u51FA 1073741824\u20131077936127\uFF1B\u8BF7\u5148\u6821\u51C6\u7D22\u5F15\u5E76\u6838\u5BF9 Lua \u5F15\u7528\uFF0C\u5BFC\u51FA\u4E0D\u4F1A\u81EA\u52A8\u91CD\u7F16\u53F7\u3002`)}function wn(e,t){if(e){t(e);for(let i of e.children||[])wn(i,t)}}function $t(e,t=new Set,{skipServerContainer:i=!1}={}){return wn(e,n=>{i&&n.kind==="server-container"||ke(n.guid)&&t.add(Number(n.guid))}),t}function Ze(e,t=1073741850){let i=Number.isSafeInteger(t)&&t>0?t:1073741850;i<1073741850&&(i=1073741850);for(let n of e)ke(n)&&n>=i&&(i=Number(n)+1);for(;e.has(i);)i+=1;if(i>1077936127)throw new Error("GUID space exhausted");return i}function to(e,t=new Set,{skipServerContainer:i=!1}={}){let n=[];wn(e,a=>{if(i&&a.kind==="server-container")return;let o=Number(a.guid);if(ke(o)&&!t.has(o)){t.add(o),a.guid=o;return}n.push(a)});for(let a of n){let o=Ze(t);a.guid=o,t.add(o)}return t}function Ae(e){return Number.isSafeInteger(e)&&e>0&&e<=2147483647}function je(e,{warnings:t=[]}={}){if(e.meta?.assetType!=="client-control-template")return;if(e.meta.giaAssetIndexSchemaVersion>1)throw new Error(`\u4E0D\u652F\u6301\u5BA2\u6237\u7AEF\u8D44\u4EA7\u7F16\u53F7\u7248\u672C ${e.meta.giaAssetIndexSchemaVersion}`);let i=[],n=g=>{g.kind!=="server-container"&&i.push(g);for(let b of g.children||[])n(b)};n(e.root);let a=new Map,o=new Map;for(let g of i){if(!Ae(g.giaInfoIndex))continue;let b=a.get(g.giaInfoIndex)||[];b.push(g),a.set(g.giaInfoIndex,b);let v=o.get(g.kind)||new Set;v.add(g.giaInfoIndex),o.set(g.kind,v)}let r=(e.root.children||[]).filter(g=>g.kind!=="server-container"),s=new Set(r),c=r.some((g,b)=>Ae(g.giaInfoIndex)&&r.slice(0,b).some(v=>v.giaInfoIndex===g.giaInfoIndex)),l=!e.meta.giaAssetIndexSchemaVersion&&c&&i.every(g=>g.giaInfoIndexSource!=="authoring")&&[...o.values()].every(g=>g.size===1)&&[...a.values()].every(g=>g.every(b=>b.kind===g[0].kind)),f=new Set;if(l)for(let g of a.values()){let b=g.find(v=>s.has(v))||g[0];for(let v of g)v!==b&&f.add(v)}let u=new Map,p=Number.isSafeInteger(e.meta.giaNextAssetIndex)&&e.meta.giaNextAssetIndex>=2?e.meta.giaNextAssetIndex:2;for(let g of i){if(!Ae(g.giaInfoIndex)||(p=Math.max(p,g.giaInfoIndex+1),f.has(g)))continue;let b=u.get(g.giaInfoIndex);if(b&&(b.giaInfoIndexSource==="authoring"||g.giaInfoIndexSource==="authoring"))throw new Error(`\u65B0\u5EFA\u8D44\u4EA7\u7F16\u53F7 ${g.giaInfoIndex} \u91CD\u590D\uFF1A${b.name} / ${g.name}`);u.set(g.giaInfoIndex,g)}l&&(p=Math.max(p,13));let m=l?[...r,...i.filter(g=>!s.has(g))].filter(g=>f.has(g)||!Ae(g.giaInfoIndex)):i.filter(g=>!Ae(g.giaInfoIndex));if(m.length&&p+m.length-1>2147483647)throw new Error("\u5BA2\u6237\u7AEF\u8D44\u4EA7\u7F16\u53F7\u7A7A\u95F4\u5DF2\u8017\u5C3D");for(let g of m)g.giaInfoIndex=p++,g.giaInfoIndexSource="authoring";e.meta.giaNextAssetIndex=p,e.meta.giaAssetIndexSchemaVersion=1,f.size&&t.push(`\u65E7\u5BA2\u6237\u7AEF\u8D44\u4EA7\u7F16\u53F7\u81EA\u52A8\u8FC1\u79FB\uFF1A\u4FEE\u590D ${f.size} \u6761\u6309\u63A7\u4EF6\u7C7B\u578B\u590D\u7528\u7684\u7F16\u53F7\uFF1BGUID\u3001Lua \u5F15\u7528\u548C\u63A7\u4EF6\u5C5E\u6027\u4FDD\u6301\u4E0D\u53D8\u3002`)}var Sn=1;function xn(e="n"){let t=`${e}${Sn}`;return Sn+=1,t}function Ni(e=1){Sn=e}function In(e,{isRootContainer:t=!1}={}){if(e==="server-container"||e==="fullscreen"||e==="container"&&t)return Mi({layout:"stretch"});let i=Xa[e]||[80,80];return Mi({layout:"center",size:i})}function Os(e,t){return Wa(()=>In(e,t))}function zs(e){Qe(e);let t={};for(let i of ce)t[i]=ut(e,i);return t}function J(e,t={}){if(!Mt[e])throw new Error(`unknown kind: ${e}`);Object.hasOwn(t,"transformByCanvas")&&ft(t);let i=t.isRootContainer===!0,n=t.id||xn(e==="server-container"?"sc":"n"),a=Object.hasOwn(t,"transformByPlatform")?zs(t.transformByPlatform):Os(e,{isRootContainer:i}),o={id:n,kind:e,name:t.name||Mt[e],guid:t.guid??0,giaRelatedGuids:Array.isArray(t.giaRelatedGuids)?t.giaRelatedGuids.filter(r=>Number.isSafeInteger(Number(r))&&Number(r)>0).map(Number):[],...Ae(Number(t.giaInfoIndex))?{giaInfoIndex:Number(t.giaInfoIndex),giaInfoIndexSource:t.giaInfoIndexSource==="authoring"?"authoring":"imported"}:{},active:t.active!==!1,visible:t.visible!==!1,canControllerFocus:t.canControllerFocus??t.giaRaw?.footerField505===1,syncAllDevices:t.syncAllDevices!==!1,giaRaw:eo(e,t.giaRaw),transformByPlatform:a,children:[],scriptMappingIds:Array.isArray(t.scriptMappingIds)?t.scriptMappingIds.filter(r=>Number.isSafeInteger(Number(r))&&Number(r)>0).map(Number):[]};if(e==="container"&&(o.isolateNavigation=t.isolateNavigation===!0,o.disableKeyEventPassthrough=t.disableKeyEventPassthrough===!0,o.disableCursorEventPassthrough=t.disableCursorEventPassthrough===!0,o.showCursor=Object.hasOwn(t,"showCursor")?t.showCursor===!0:!0),(e==="textbox"||e==="textwindow")&&(o.fontSize=t.fontSize??20,o.adaptiveFontSize=t.adaptiveFontSize===!0,o.minimumFontSize=t.minimumFontSize??20,o.fontColor=t.fontColor??Qt.font,o.bgColor=t.bgColor??Qt.bg,o.enableOutline=t.enableOutline!==!1,o.outlineColor=t.outlineColor??Qt.outline,o.horizontalAlignment=t.horizontalAlignment||"Left",o.verticalAlignment=t.verticalAlignment||"Top",Number.isInteger(t.giaRaw?.textVerticalAlign)&&![0,1,2].includes(t.giaRaw.textVerticalAlign)&&(o.giaRaw.textVerticalAlign=t.giaRaw.textVerticalAlign),o.text=t.text??"",Object.hasOwn(t.giaRaw||{},"textAlign")||(o.giaRaw.textAlign={Left:0,Middle:1,Right:2}[o.horizontalAlignment]??o.giaRaw.textAlign),e==="textwindow"&&(o.interactable=t.interactable!==!1,o.showScrollBar=t.showScrollBar!==!1)),e==="image"&&(o.imageSource=t.imageSource||"StaticReference",o.imageType=["Basic","Stretch"].includes(t.imageType)?t.imageType:null,o.imageId=t.imageId??100001,o.imageColor=t.imageColor??Qt.image,o.enableMask=t.enableMask===!0,o.enableSoftEdge=t.enableSoftEdge===!0,o.softEdgeMode=t.softEdgeMode||"Percentage",o.softEdgeWidthX=t.softEdgeWidthX??8,o.softEdgeWidthY=t.softEdgeWidthY??8,o.horizontalSoftRange=t.horizontalSoftRange??85,o.verticalSoftRange=t.verticalSoftRange??85,o.enableFill=t.enableFill===!0,o.fillType=t.fillType||"Horizontal",o.fillHorizontalType=t.fillHorizontalType||"Left",o.fillVerticalType=t.fillVerticalType||"Bottom",o.fillRadial90Type=t.fillRadial90Type||"BottomLeft",o.fillRadialType=t.fillRadialType||"Bottom",o.fillAmount=t.fillAmount??1,o.reverseMaskArea=t.reverseMaskArea===!0||t.reverseMask===!0,Object.hasOwn(t.giaRaw||{},"imageFillType")||(o.giaRaw.imageFillType={Horizontal:1,Vertical:2,Radial90:3,Radial180:4,Radial360:5}[o.fillType]??o.giaRaw.imageFillType)),e==="button"&&(o.raycastTarget=t.raycastTarget!==!1,o.interactable=t.interactable!==!1,o.clickAudioId=t.clickAudioId??Ha,o.unavailableChildId=t.unavailableChildId??null,o.hoverChildId=t.hoverChildId??null,o.pressedChildId=t.pressedChildId??null,o.selectedChildId=t.selectedChildId??null),e==="cursor"&&(o.raycastTarget=t.raycastTarget??t.giaRaw?.cursorField501!==0),e==="reference"&&(o.referencedPrefabId=t.referencedPrefabId??t.giaRaw?.templateRefSlot??null,Object.hasOwn(t.giaRaw||{},"templateRefSlot")||(o.giaRaw.templateRefSlot=String(o.referencedPrefabId??""))),e==="grid"&&(o.itemPrefabId=t.itemPrefabId??null,o.raycastTarget=t.raycastTarget!==!1,o.interactable=t.interactable!==!1,o.showScrollBar=t.showScrollBar!==!1,o.scrollDirection=t.scrollDirection||"Vertical",o.layoutConstraint=t.layoutConstraint||"AutoWrap",o.layoutConstraintFixedCount=t.layoutConstraintFixedCount??null,o.cellSizeX=t.cellSizeX??50,o.cellSizeY=t.cellSizeY??50,o.spacingX=t.spacingX??8,o.spacingY=t.spacingY??8,o.padding1X=t.padding1X??20,o.padding1Y=t.padding1Y??20,o.padding2X=t.padding2X??20,o.padding2Y=t.padding2Y??20,o.previewCount=t.previewCount??t.giaRaw?.gridField511??5,Object.hasOwn(t.giaRaw||{},"gridField511")||(o.giaRaw.gridField511=Math.trunc(o.previewCount))),e==="keyhint"&&(o.keyboardKeyCode=t.keyboardKeyCode??t.giaRaw?.keyHintField502??null,o.controllerKeyCode=t.controllerKeyCode??t.giaRaw?.keyHintField501??null,Object.hasOwn(t.giaRaw||{},"keyHintField502")||(o.giaRaw.keyHintField502=Math.trunc(o.keyboardKeyCode??1)),Object.hasOwn(t.giaRaw||{},"keyHintField501")||(o.giaRaw.keyHintField501=Math.trunc(o.controllerKeyCode??1))),e==="animation"||e==="fullscreen"){let r=e==="animation"?t.giaRaw?.effectSlot:t.giaRaw?.fullscreenEffectSlot;o.animationId=t.animationId??r??null,o.playSoundEffect=t.playSoundEffect??null,e==="animation"&&(o.layer=t.layer??null);let s=e==="animation"?"effectSlot":"fullscreenEffectSlot";Object.hasOwn(t.giaRaw||{},s)||(o.giaRaw[s]=String(o.animationId??""))}if(t.children)for(let r of t.children)o.children.push(r);return o}function ht(){Ni(1);let e=J("server-container",{id:"sc1",name:"\u5BA2\u6237\u7AEF\u63A7\u4EF6\u5BB9\u5668"}),t=J("container",{id:"n1",name:"\u5BB9\u5668\u8282\u70B9",isRootContainer:!0}),i=J("textbox",{id:"n2",name:"\u6587\u672C\u6846",text:"\u6587\u672C"}),n=J("cursor",{id:"n3",name:"\u5149\u6807\u68C0\u6D4B\u533A\u57DF"}),a=J("reference",{id:"n4",name:"\u6A21\u677F\u5F15\u7528\u63A7\u4EF6"}),o=J("grid",{id:"n5",name:"\u7F51\u683C\u89C6\u7A97"}),r=J("button",{id:"n6",name:"\u9884\u8BBE\u6309\u94AE"}),s=J("textwindow",{id:"n7",name:"\u6587\u672C\u89C6\u7A97"}),c=J("keyhint",{id:"n8",name:"\u6309\u952E\u63D0\u793A"}),l=J("image",{id:"n9",name:"\u56FE\u7247",imageId:100005}),f=J("animation",{id:"n10",name:"\u754C\u9762\u52A8\u6548"}),u=J("fullscreen",{id:"n11",name:"\u5168\u5C4F\u52A8\u6548"}),p=(m,g,b)=>{for(let v of Object.values(m.transformByPlatform))v.offset={x:g,y:b}};return p(i,-300,250),p(n,-300,140),p(a,-300,30),p(o,-300,-100),p(r,0,0),p(s,300,250),p(c,300,140),p(l,300,30),p(f,300,-100),t.children.push(i,n,a,o,r,s,c,l,f,u),e.children.push(t),Ni(12),to(e),{version:1,layoutSchemaVersion:ge,meta:{name:"\u672A\u547D\u540D\u754C\u9762\u63A7\u4EF6\u7EC4",assetType:"server-control-template",sourceFormat:"authoring",sourceFile:""},canvasId:"pc-16-9",selectedId:"n2",root:e}}function Dt(){Ni(1);let e=J("server-container",{id:"sc1",name:"\u5BA2\u6237\u7AEF\u63A7\u4EF6\u6A21\u677F"}),t=J("container",{id:"n1",guid:1073742100,name:"Lua\u5B9E\u4F8B\u5316\u9762\u677F"}),i=J("textbox",{id:"n2",guid:1073742101,name:"\u6A21\u677F\u6807\u9898",text:"\u5BA2\u6237\u7AEF\u6A21\u677F\u5DF2\u5B9E\u4F8B\u5316",fontSize:28,horizontalAlignment:"Middle"}),n=J("image",{id:"n3",guid:1073742102,name:"\u6A21\u677F\u56FE\u6807",imageId:100005}),a=J("button",{id:"n4",guid:1073742103,name:"\u786E\u8BA4\u6309\u94AE"}),o=J("textbox",{id:"n5",guid:1073742104,name:"\u6309\u94AE\u6587\u5B57",text:"\u786E\u8BA4",horizontalAlignment:"Middle",verticalAlignment:"Top"}),r=(l,f,u)=>{for(let p of Object.values(l.transformByPlatform))p.offset={x:f,y:u}};((l,f,u)=>{for(let p of Object.values(l.transformByPlatform))p.size={x:f,y:u}})(t,520,320),r(i,0,110),r(n,0,0),r(a,0,-110),a.children.push(o),t.children.push(i,n,a),e.children.push(t),Ni(6);let c={version:1,layoutSchemaVersion:ge,meta:{name:"Lua\u5B9E\u4F8B\u5316\u9762\u677F",assetType:"client-control-template",sourceFormat:"authoring",sourceFile:"",gameVersion:Ti,giaOwnerUid:114514,giaFileId:1073741829,giaFileName:"\u5BA2\u6237\u7AEF\u63A7\u4EF6\u6A21\u677F\u5217\u8868.gia"},canvasId:"pc-16-9",selectedId:"n1",root:e};return je(c),c}function K(e,t,i=null){t(e,i);for(let n of e.children||[])K(n,t,e)}function he(e,t){let i=null;return K(e,n=>{n.id===t&&(i=n)}),i}function En(e,t="n"){let i=xn(t);for(;he(e,i);)i=xn(t);return i}function et(e,t){let i=null;return K(e,(n,a)=>{n.id===t&&(i=a)}),i}function Cn(e){let t=e.root||e;return t.kind==="container"?t:(t.children||[]).find(i=>i.kind==="container")||(t.children||[])[0]||t}function ti(e){if(e.meta?.assetType!=="client-control-template")return Cn(e);let t=he(e.root,e.selectedId);if(!t||t.kind==="server-container")return e.root.children?.[0]||e.root;let i=et(e.root,t.id);for(;i&&i.kind!=="server-container";)t=i,i=et(e.root,t.id);return t}function kn(e){ft(e);let t={id:e.id,name:e.name,guid:e.guid,giaRelatedGuids:e.giaRelatedGuids,giaInfoIndex:e.giaInfoIndex,giaInfoIndexSource:e.giaInfoIndexSource,scriptMappingIds:e.scriptMappingIds,giaRaw:e.giaRaw,active:e.active,visible:e.visible,canControllerFocus:e.canControllerFocus,syncAllDevices:e.syncAllDevices,transformByPlatform:e.transformByPlatform};e.kind==="container"&&(t.isolateNavigation=e.isolateNavigation,t.disableKeyEventPassthrough=e.disableKeyEventPassthrough,t.disableCursorEventPassthrough=e.disableCursorEventPassthrough,t.showCursor=e.showCursor),(e.kind==="textbox"||e.kind==="textwindow")&&(t.fontSize=e.fontSize,t.adaptiveFontSize=e.adaptiveFontSize,t.minimumFontSize=e.minimumFontSize,t.fontColor=e.fontColor,t.bgColor=e.bgColor,t.enableOutline=e.enableOutline,t.outlineColor=e.outlineColor,t.horizontalAlignment=e.horizontalAlignment,t.verticalAlignment=e.verticalAlignment,t.text=e.text??"",e.kind==="textwindow"&&(t.interactable=e.interactable,t.showScrollBar=e.showScrollBar)),e.kind==="image"&&(t.imageSource=e.imageSource,t.imageType=e.imageType,t.imageId=e.imageId,t.imageColor=e.imageColor,t.enableMask=e.enableMask,t.enableSoftEdge=e.enableSoftEdge,t.softEdgeMode=e.softEdgeMode,t.softEdgeWidthX=e.softEdgeWidthX,t.softEdgeWidthY=e.softEdgeWidthY,t.horizontalSoftRange=e.horizontalSoftRange,t.verticalSoftRange=e.verticalSoftRange,t.enableFill=e.enableFill,t.fillType=e.fillType,t.fillHorizontalType=e.fillHorizontalType,t.fillVerticalType=e.fillVerticalType,t.fillRadial90Type=e.fillRadial90Type,t.fillRadialType=e.fillRadialType,t.fillAmount=e.fillAmount,t.reverseMaskArea=e.reverseMaskArea??e.reverseMask),e.kind==="button"&&(t.raycastTarget=e.raycastTarget,t.interactable=e.interactable,t.clickAudioId=e.clickAudioId,t.unavailableChildId=e.unavailableChildId??null,t.hoverChildId=e.hoverChildId??null,t.pressedChildId=e.pressedChildId??null,t.selectedChildId=e.selectedChildId??null),e.kind==="cursor"&&(t.raycastTarget=e.raycastTarget),e.kind==="reference"&&(t.referencedPrefabId=e.referencedPrefabId??null),e.kind==="grid"&&(t.itemPrefabId=e.itemPrefabId??null,t.raycastTarget=e.raycastTarget,t.interactable=e.interactable,t.showScrollBar=e.showScrollBar,t.scrollDirection=e.scrollDirection,t.layoutConstraint=e.layoutConstraint,t.layoutConstraintFixedCount=e.layoutConstraintFixedCount??null,t.cellSizeX=e.cellSizeX,t.cellSizeY=e.cellSizeY,t.spacingX=e.spacingX,t.spacingY=e.spacingY,t.padding1X=e.padding1X,t.padding1Y=e.padding1Y,t.padding2X=e.padding2X,t.padding2Y=e.padding2Y,t.previewCount=e.previewCount),e.kind==="keyhint"&&(t.keyboardKeyCode=e.keyboardKeyCode??null,t.controllerKeyCode=e.controllerKeyCode??null),(e.kind==="animation"||e.kind==="fullscreen")&&(t.animationId=e.animationId??null,t.playSoundEffect=e.playSoundEffect??null,e.kind==="animation"&&(t.layer=e.layer??null)),t.isRootContainer=e.kind==="container"&&$s(e.transformByPlatform);let i=J(e.kind,t);return i.children=(e.children||[]).map(n=>kn(n)),i}function $s(e){let t=e&&(e.KEYBOARD||Object.values(e)[0]);return t?Math.abs(t.anchorMin?.x??.5)<1e-4&&Math.abs(t.anchorMin?.y??.5)<1e-4&&Math.abs((t.anchorMax?.x??.5)-1)<1e-4&&Math.abs((t.anchorMax?.y??.5)-1)<1e-4:!1}function io(e,t,i={}){if(e.kind==="server-container"&&t!=="container")throw new Error("server container only accepts container nodes");let n=J(t,i);return e.children.push(n),n}function no(e,t){if(e.id===t)throw new Error("cannot remove root");let i=et(e,t);if(!i)return!1;let n=i.children.findIndex(a=>a.id===t);return n<0?!1:(i.children.splice(n,1),!0)}var ao=1e-4;function Ds(e,t){return Math.abs(e.anchorMax[t]-e.anchorMin[t])>ao&&Math.abs(e.size[t])<=ao}function Gs(e,t,i){if(!(t.width>0)||!(t.height>0))throw new Error("source parent must have positive size");if(!(i.width>0)||!(i.height>0))throw new Error("target parent must have positive size");let n=He(t,e),a=(n.centerX-t.left)/t.width,o=(n.centerY-t.bottom)/t.height,r=ct(i,e,{posX:i.left+a*i.width,posY:i.bottom+o*i.height,width:n.width,height:n.height});for(let s of["x","y"])Ds(e,s)&&(r.offset[s]=e.offset[s],r.size[s]=e.size[s]);return r}function oo({transformByPlatform:e,source:t,canvasId:i,syncAllDevices:n,sourceParentBox:a=ye(i),targetParentBoxByPlatform:o={}}){Qe(e);let r=dt(i),s={};for(let c of ce)c===r?s[c]=Ve(t):n!==!1?s[c]=Gs(t,a,o[c]||ye(Rt[c])):s[c]=ut(e,c);return Qe(s),s}function tt(e,t){return ut(e,dt(t))}import{createCanvas as tl}from"@napi-rs/canvas";import{existsSync as Xs,openSync as Hs,closeSync as Us,fstatSync as js,readFileSync as Ls}from"node:fs";import{extname as Ks,isAbsolute as qs}from"node:path";import{createHash as Ws}from"node:crypto";import{workerData as zi}from"node:worker_threads";import{GlobalFonts as uo}from"@napi-rs/canvas";var ro='"Microsoft YaHei UI","Microsoft YaHei","HarmonyOS Sans SC","Noto Sans CJK SC",sans-serif';var An=e=>`QxqyLocal_${e}`,so=e=>e?`"${An(e)}",${ro}`:ro;import{existsSync as Vs,mkdirSync as X0,readFileSync as Bs,renameSync as H0,rmSync as U0,writeFileSync as j0}from"node:fs";import{homedir as _n}from"node:os";import{dirname as q0,join as Fi,win32 as Oi}from"node:path";function lo(e=process.platform,t=process.env){if(e!=="win32")return[];let i=t.SystemDrive||"C:",n=t.ProgramFiles||`${i}\\Program Files`,a="YuanShen_Data\\StreamingAssets\\MiHoYoSDKRes\\HttpServerResources\\font\\zh-cn.ttf";return[...new Set([Oi.join(n,"Genshin Impact","Genshin Impact Game",a),Oi.join(i+"\\","Mihoyo","Genshin Impact","Genshin Impact Game",a),Oi.join(n,"HoYoPlay","games","Genshin Impact game",a),Oi.join(n,"miHoYo Launcher","games","Genshin Impact Game",a)])]}function Ys(){if(process.env.QXQY_FONT_CONFIG_PATH)return process.env.QXQY_FONT_CONFIG_PATH;let e=process.platform==="win32"?process.env.APPDATA||Fi(_n(),"AppData","Roaming"):process.platform==="darwin"?Fi(_n(),"Library","Application Support"):process.env.XDG_CONFIG_HOME||Fi(_n(),".config");return Fi(e,"beyond-simulator","font.json")}function co(e){if(!e||!["auto","custom","system"].includes(e.mode))throw new Error("\u8BF7\u9009\u62E9\u81EA\u52A8\u67E5\u627E\u3001\u6307\u5B9A\u6587\u4EF6\u6216\u7CFB\u7EDF\u5B57\u4F53");let t=e.scope===void 0?"all":e.scope;if(!["game","all"].includes(t))throw new Error("\u8BF7\u9009\u62E9\u5B57\u4F53\u5E94\u7528\u8303\u56F4");let i=typeof e.path=="string"?e.path.trim():"";if(i.length>4096)throw new Error("\u5B57\u4F53\u8DEF\u5F84\u8FC7\u957F");if((i.startsWith('"')&&i.endsWith('"')||i.startsWith("'")&&i.endsWith("'"))&&(i=i.slice(1,-1)),e.mode==="custom"&&!i)throw new Error("\u8BF7\u586B\u5199\u5B57\u4F53\u6587\u4EF6\u7684\u7EDD\u5BF9\u8DEF\u5F84");return{mode:e.mode,path:e.mode==="custom"?i:"",scope:t}}function fo(e=Ys()){if(!Vs(e))return{mode:"auto",path:"",scope:"all"};try{return co(JSON.parse(Bs(e,"utf8")))}catch{throw new Error("\u672C\u673A\u5B57\u4F53\u8BBE\u7F6E\u65E0\u6CD5\u8BFB\u53D6\uFF0C\u8BF7\u5728\u300C\u5B57\u4F53\u8BBE\u7F6E\u300D\u4E2D\u91CD\u65B0\u4FDD\u5B58")}}function bo(e){let t=Buffer.from(e),i=t.subarray(0,4).toString("hex");if(t.length<12||t.length>33554432||!["00010000","4f54544f"].includes(i))throw new Error("QXQY_FONT_PATH must contain a valid TTF or OTF font (at most 32 MiB)");let n=Ws("sha256").update(t).digest("hex"),a=An(n);try{if(!uo.has(a)&&!uo.register(t,a))throw new Error("invalid font")}catch{throw new Error("QXQY_FONT_PATH font could not be registered")}return{id:n,data:t,type:i==="4f54544f"?"font/otf":"font/ttf"}}function Tn(e){if(!e)return null;if(!qs(e)||![".ttf",".otf"].includes(Ks(e).toLowerCase()))throw new Error("QXQY_FONT_PATH must be an absolute path to a TTF or OTF font");let t,i;try{t=Hs(e,"r");let n=js(t);if(!n.isFile()||n.size<12||n.size>33554432)throw new Error("invalid size");i=Ls(t)}catch{throw new Error("QXQY_FONT_PATH must point to a readable font file of at most 32 MiB")}finally{t!==void 0&&Us(t)}return bo(i)}var ho=!1,$i=null,ii={path:"",source:"system",scope:"all"},Di=null,mo="";function Js(e){if(e.mode==="custom")return{font:Tn(e.path),path:e.path,source:"custom"};if(e.mode==="auto"){let t;for(let i of lo())if(Xs(i))try{return{font:Tn(i),path:i,source:"auto"}}catch(n){t=n}if(t)throw t}return{font:null,path:"",source:"system"}}function Qs(){if(!ho){if(zi&&Object.hasOwn(zi,"localFont"))$i=zi.localFont?bo(zi.localFont):null;else{try{Di=fo()}catch(e){mo=e.message}if(ii.scope=Di?.scope||"all",process.env.QXQY_FONT_PATH)$i=Tn(process.env.QXQY_FONT_PATH),ii={...ii,path:process.env.QXQY_FONT_PATH,source:"environment"};else if(Di)try{let e=Js(Di);$i=e.font,ii={...ii,path:e.path,source:e.source}}catch(e){mo=e.message}}ho=!0}return $i}var go=()=>so(Qs()?.id);var Pn=Object.freeze({aqua:"00ffff",black:"000000",blue:"0000ff",brown:"a52a2a",cyan:"00ffff",darkblue:"0000a0",fuchsia:"ff00ff",green:"008000",grey:"808080",lightblue:"add8e6",lime:"00ff00",magenta:"ff00ff",maroon:"800000",navy:"000080",olive:"808000",orange:"ffa500",purple:"800080",red:"ff0000",silver:"c0c0c0",teal:"008080",white:"ffffff",yellow:"ffff00"});function Zs(e){let t=Object.hasOwn(Pn,e.toLowerCase())?Pn[e.toLowerCase()]:e.slice(1);return!Object.hasOwn(Pn,e.toLowerCase())&&!/^#[\da-f]{6}([\da-f]{2})?$/i.test(e)?null:(parseInt(t.slice(6)||"ff",16)<<24|parseInt(t.slice(0,6),16))>>>0}function el(e){let t=/^<\/(b|i|color|size)>$/i.exec(e);if(t)return{name:t[1].toLowerCase(),close:!0};let i=/^<(b|i)>$/i.exec(e);if(i)return{name:i[1].toLowerCase(),value:!0};let n=/^<(color|size)=(?:"([^"\s<>]+)"|'([^'\s<>]+)'|([^\s'"<>]+))>$/i.exec(e);if(!n)return null;let a=n[1].toLowerCase(),o=n[2]??n[3]??n[4];if(a==="color"){let s=Zs(o);return s===null?null:{name:a,value:s}}let r=Number(o);return/^\d+$/.test(o)&&Number.isSafeInteger(r)&&r>0?{name:a,value:r}:null}function yo(e){let t=String(e??"").replace(/\r\n?/g,`
|
|
2
|
+
`),i=[],n=[],a=0;for(let c of t.matchAll(/<[^<>\r\n]*>/g)){c.index>a&&i.push({text:t.slice(a,c.index)});let l={text:c[0],tag:el(c[0]),paired:!1};i.push(l),a=c.index+c[0].length,l.tag&&(l.tag.close?n.at(-1)?.tag.name===l.tag.name?n.pop().paired=l.paired=!0:n.length=0:n.push(l))}a<t.length&&i.push({text:t.slice(a)});let o=[],r=[{bold:!1,italic:!1,size:null,color:null}],s=!1;for(let c of i)if(c.paired)if(s=!0,c.tag.close)r.pop();else{let l={b:"bold",i:"italic",size:"size",color:"color"}[c.tag.name];r.push({...r.at(-1),[l]:c.tag.value})}else if(c.text){let l=r.at(-1),f=o.at(-1);f&&["bold","italic","size","color"].every(u=>f[u]===l[u])?f.text+=c.text:o.push({text:c.text,...l})}return{rich:s,text:o.map(c=>c.text).join(""),runs:o}}function vo(e,t){return`${e.italic?"italic ":""}${e.bold?"bold ":""}${e.fontSize}px ${t}`}var mt=tl(1,1).getContext("2d"),wo=new WeakMap,So=(e,t)=>Math.max(1,Math.trunc(Number.isFinite(Number(e))?Number(e):t));function il(e,t,i,n,a,o){let r=[],s=[],c=0,l=t,f=0,u=()=>{let v=s.length?s.reduce((V,Y)=>Math.max(V,Y.fontSize),0):l,S=v*1.2,x=s.length?s.reduce((V,Y)=>Math.max(V,Y.ascent),0):v*.8,F=s.length?s.reduce((V,Y)=>Math.max(V,Y.descent),0):v*.2,N=(S-x-F)/2+x;r.push({runs:s,width:c,top:f,height:S,baseline:N,fontSize:v}),f+=S,s=[],c=0};for(let v of e.runs){let S={fontSize:v.size??t,bold:v.bold,italic:v.italic,color:v.color};mt.font=vo(S,n);let x=mt.measureText("Mg"),F=x.fontBoundingBoxAscent??x.emHeightAscent??S.fontSize*.8,N=x.fontBoundingBoxDescent??x.emHeightDescent??S.fontSize*.2;l=S.fontSize;for(let V of v.text){if(V===`
|
|
3
|
+
`){u();continue}let Y=s.at(-1),j=Y&&["fontSize","bold","italic","color"].every(A=>Y[A]===S[A]),O=mt.measureText((j?Y.text:"")+V).width,w=c+O-(j?Y.width:0);s.length&&w>i&&(u(),Y=null,O=mt.measureText(V).width,w=O),Y&&j?(Y.text+=V,Y.width=O):s.push({text:V,...S,x:c,width:O,ascent:F,descent:N}),c=w}}u();let p=r.map(v=>v.runs.map(S=>S.text).join("")),m=r.reduce((v,S)=>Math.max(v,S.fontSize),0),g=a==="textbox"&&e.text?m*.25+4:0,b=e.text?f+g:0;return{fontSize:t,lines:p,lineHeight:t*1.2,contentHeight:f,blockInset:g,requiredHeight:b,textWidth:i,fits:b<=o+1e-6&&r.every(v=>v.width<=i+1e-6),richLines:r}}function pt(e,t,i){let n=String(e.text??"").replace(/\r\n?/g,`
|
|
4
|
+
`),a=So(e.fontSize,20),o=Math.min(a,So(e.minimumFontSize,10)),r=e.adaptiveFontSize===!0,s=go(),c=JSON.stringify([n,t,i,a,o,r,e.kind,e.showScrollBar,s]),l=wo.get(e);if(l?.key===c)return l.value;let f=yo(n),u=(v,S)=>{if(f.rich)return il(f,v,S,s,e.kind,i);mt.font=`${v}px ${s}`;let x=[];for(let O of n.split(`
|
|
5
|
+
`)){let w="";for(let A of O)w&&mt.measureText(w+A).width>S&&(x.push(w),w=""),w+=A;x.push(w)}let F=v*1.2,N=x.length*F,V=e.kind==="textbox"&&n?v*.25+4:0,Y=n?N+V:0,j=Y<=i+1e-6&&x.every(O=>mt.measureText(O).width<=S+1e-6);return{fontSize:v,lines:x,lineHeight:F,contentHeight:N,blockInset:V,requiredHeight:Y,textWidth:S,fits:j}},p=Math.max(0,t-4),m=u(a,p);if(r&&!m.fits&&o<a){m=u(o,p);let v=o+1,S=a-1;for(;v<=S;){let x=Math.floor((v+S)/2),F=u(x,p);F.fits?(m=F,v=x+1):S=x-1}}e.kind==="textwindow"&&e.showScrollBar!==!1&&m.contentHeight>i&&(m=u(m.fontSize,Math.max(0,p-12)));let g=m.lines.length,b=m.contentHeight;if(e.kind==="textbox"&&(g=0,b=0,m.lines.join(`
|
|
6
|
+
`)))for(let v=0;v<m.lines.length;v++){let S=m.richLines?.[v],x=S?S.top+S.height:(v+1)*m.lineHeight;if(x+m.blockInset>i+1e-6)break;g=v+1,b=x}return m={...m,visibleLineCount:g,visibleContentHeight:b},wo.set(e,{key:c,value:m}),m}var Gi=e=>Number.isFinite(Number(e))?Math.max(0,Number(e)):0;function ni(e,t){if(!e||e.kind!=="image"||e.enableMask!==!0||!t)return null;let i=Gi(e.sourceWidth??e.width),n=Gi(e.sourceHeight??e.height),a=e.enableSoftEdge===!0,o=e.softEdgeMode!=="Pixel",r=a?Gi(e.softEdgeWidthX):0,s=a?Gi(e.softEdgeWidthY):0;return{id:e.id,matrix:t,width:i,height:n,featherX:o?i*r/100:r,featherY:o?n*s/100:s}}function bt(e,t,i){let n=Me(e,t,i);return{a:e.a,b:e.b,c:e.c,d:e.d,tx:n.x,ty:n.y}}function xo(e,t){let i=[];function n(a){t[a.id]&&i.push(t[a.id]);let o=a.children||[];for(let r=o.length-1;r>=0;r-=1)n(o[r])}return n(e),i}function it(e,t,i=dt(t)){let n=ye(t),a={};function o(r,s,c,l=!0,f=[]){let u=ut(r.transformByPlatform,i),p=He(s,u),m=r.kind==="server-container"?c:ei(c,p,u),g=La(p,m),b=l&&r.visible!==!1,v=r.kind==="image"&&r.enableMask===!0?ni({...r,width:p.width,height:p.height},bt(m,p.centerX,p.centerY)):null,S=v?[...f,v]:f;a[r.id]={...p,...gn(p),id:r.id,kind:r.kind,name:r.name,visible:r.visible!==!1,visibleInHierarchy:b,active:r.active!==!1,rotationX:u.rotation.x,rotationY:u.rotation.y,rotationZ:u.rotation.z,renderLeft:g.left,renderBottom:g.bottom,renderWidth:g.width,renderHeight:g.height,renderRotationZ:g.rotationZ,renderMatrix:m,...S.length?{masks:S}:{},primitive:r.kind==="image"?Nt(r.imageId,r.imageSource):null,...["animation","fullscreen"].includes(r.kind)?{animationId:r.animationId??null,playSoundEffect:r.playSoundEffect!==!1,layer:r.layer||"AboveAllControls"}:{},...r.kind==="textbox"||r.kind==="textwindow"?{text:r.text??"",fontSize:r.fontSize,adaptiveFontSize:r.adaptiveFontSize===!0,minimumFontSize:r.minimumFontSize,textLayout:pt(r,p.width,p.height),fontColor:r.fontColor,bgColor:r.bgColor,enableOutline:r.enableOutline!==!1,outlineColor:r.outlineColor,horizontalAlignment:r.horizontalAlignment,verticalAlignment:r.verticalAlignment}:{},...r.kind==="image"?{imageSource:r.imageSource,imageType:r.imageType??null,imageId:r.imageId,imageColor:r.imageColor,enableMask:r.enableMask===!0,enableSoftEdge:r.enableSoftEdge===!0,softEdgeMode:r.softEdgeMode,softEdgeWidthX:r.softEdgeWidthX,softEdgeWidthY:r.softEdgeWidthY,horizontalSoftRange:r.horizontalSoftRange,verticalSoftRange:r.verticalSoftRange,enableFill:r.enableFill===!0,fillType:r.fillType,fillHorizontalType:r.fillHorizontalType,fillVerticalType:r.fillVerticalType,fillRadial90Type:r.fillRadial90Type,fillRadialType:r.fillRadialType,fillAmount:r.fillAmount,reverseMaskArea:r.reverseMaskArea===!0}:{},...r.kind==="button"?{raycastTarget:r.raycastTarget!==!1,interactable:r.interactable!==!1,clickAudioId:r.clickAudioId,unavailableChildId:r.unavailableChildId??null,hoverChildId:r.hoverChildId??null,pressedChildId:r.pressedChildId??null,selectedChildId:r.selectedChildId??null}:{}};let x=r.kind==="server-container"?s:p;for(let F of r.children||[])o(F,x,m,b,S)}return o(e,n,Ot()),{canvas:n,boxes:a}}function Rn(e,t){let i=[];function n(a,o,r=null,s=[],c=0,l=1,f=e.id){i.push({id:a.id,guid:t?.get(a.id)??(a.guid||0),kind:a.kind,name:a.name,label:Mt[a.kind]||a.kind,depth:o,parentId:r,ancestorIds:s,siblingIndex:c,siblingCount:l,templateId:f,childCount:(a.children||[]).length,incomplete:!Ri.includes(a.kind)});let u=a.children||[];for(let p=0;p<u.length;p+=1)n(u[p],o+1,a.id,[...s,a.id],p,u.length,f)}return n(e,0),i}function P(e,t,i,n,a={}){return{key:e,label:t,type:i,value:n,...a}}function Io(e,t,i,n){if(!e)return null;let a=tt(e.transformByPlatform,t),o=gn(i),r=[P("name","\u540D\u79F0","string",e.name),P("active","\u521D\u59CB\u6FC0\u6D3B","bool",e.active!==!1),P("visible","\u521D\u59CB\u53EF\u89C1\u6027","bool",e.visible!==!1),P("canControllerFocus","\u53EF\u88AB\u624B\u67C4\u6447\u6746\u5BFC\u822A\u9009\u4E2D","bool",e.canControllerFocus===!0),P("posX","\u4F4D\u7F6E X","number",o.posX,{computed:!0}),P("posY","\u4F4D\u7F6E Y","number",o.posY,{computed:!0}),P("width","\u5927\u5C0F W","number",o.width,{computed:!0}),P("height","\u5927\u5C0F H","number",o.height,{computed:!0}),P("rotationX","\u65CB\u8F6C X","number",a.rotation.x),P("rotationY","\u65CB\u8F6C Y","number",a.rotation.y),P("rotationZ","\u65CB\u8F6C Z","number",a.rotation.z),P("syncAllDevices","\u540C\u6B65\u4FE1\u606F\u81F3\u6240\u6709\u8BBE\u5907","bool",e.syncAllDevices!==!1),P("anchorType","\u951A\u70B9\u7C7B\u578B","enum",qa(a),{options:[{value:"center",label:"\u5C45\u4E2D"},{value:"top-left",label:"\u5DE6\u4E0A"},{value:"top",label:"\u4E0A\u65B9"},{value:"top-right",label:"\u53F3\u4E0A"},{value:"left",label:"\u5DE6\u4FA7"},{value:"right",label:"\u53F3\u4FA7"},{value:"bottom-left",label:"\u5DE6\u4E0B"},{value:"bottom",label:"\u4E0B\u65B9"},{value:"bottom-right",label:"\u53F3\u4E0B"},{value:"stretch",label:"\u53CC\u5411\u62C9\u4F38"},{value:"stretch-horizontal",label:"\u6C34\u5E73\u62C9\u4F38"},{value:"stretch-vertical",label:"\u5782\u76F4\u62C9\u4F38"},{value:"custom",label:"\u81EA\u5B9A\u4E49"}]}),P("anchorMinX","\u951A\u70B9 Min X","number",a.anchorMin.x),P("anchorMinY","\u951A\u70B9 Min Y","number",a.anchorMin.y),P("anchorMaxX","\u951A\u70B9 Max X","number",a.anchorMax.x),P("anchorMaxY","\u951A\u70B9 Max Y","number",a.anchorMax.y),P("pivotX","\u4E2D\u5FC3 X","number",a.pivot.x),P("pivotY","\u4E2D\u5FC3 Y","number",a.pivot.y)];if(e.kind==="container"&&r.push(P("isolateNavigation","\u9694\u79BB\u624B\u67C4\u5BFC\u822A","bool",e.isolateNavigation===!0),P("disableKeyEventPassthrough","\u5C4F\u853D\u6309\u952E\u4E8B\u4EF6\u7A7F\u900F","bool",e.disableKeyEventPassthrough===!0),P("disableCursorEventPassthrough","\u5C4F\u853D\u533A\u57DF\u5185\u70B9\u51FB\u4E8B\u4EF6\u7A7F\u900F","bool",e.disableCursorEventPassthrough===!0),P("showCursor","\u663E\u793A\u5E38\u9A7B\u5149\u6807","bool",e.showCursor===!0)),e.kind==="textbox"||e.kind==="textwindow"){let s=e.giaRaw?.textAlign,c=[0,1,2].includes(s)?e.horizontalAlignment||"Left":`__unrecognized:${s}`;r.push(P("fontSize","\u5B57\u53F7","number",e.fontSize),P("adaptiveFontSize","\u5B57\u53F7\u81EA\u9002\u5E94","bool",e.adaptiveFontSize===!0),P("minimumFontSize","\u6700\u5C0F\u5B57\u53F7","number",e.minimumFontSize),P("fontColor","\u6587\u672C\u8272","color",e.fontColor),P("bgColor","\u80CC\u666F\u8272","color",e.bgColor),P("enableOutline","\u542F\u7528\u63CF\u8FB9","bool",e.enableOutline!==!1),P("outlineColor","\u63CF\u8FB9\u8272","color",e.outlineColor),P("horizontalAlignment","\u6C34\u5E73\u5BF9\u9F50","enum",c,{...[0,1,2].includes(s)?{}:{unknownValue:s},options:[{value:"Left",label:"\u5DE6\u5BF9\u9F50"},{value:"Middle",label:"\u5C45\u4E2D"},{value:"Right",label:"\u53F3\u5BF9\u9F50"}]}),P("verticalAlignment","\u5782\u76F4\u5BF9\u9F50","enum",e.verticalAlignment||"Top",{options:[{value:"Top",label:"\u9876\u90E8"},{value:"Middle",label:"\u5C45\u4E2D"},{value:"Bottom",label:"\u5E95\u90E8"}]}),P("text","\u6587\u672C","text",e.text??""))}if(e.kind==="image"){let s=e.giaRaw?.imageFillType,c=[1,2,3,4,5].includes(s)?e.fillType:`__unrecognized:${s}`;r.push(P("imageSource","\u56FE\u7247\u6E90","enum",e.imageSource,{options:[{value:"StaticReference",label:"\u9759\u6001\u5F15\u7528"},{value:"Prefab",label:"\u5143\u4EF6"}]}),P("imageId","imageId","number",e.imageId??0),P("imageType","\u56FE\u7247\u7C7B\u578B","enum",e.imageType??null,{options:[{value:"Basic",label:"\u57FA\u7840"},{value:"Stretch",label:"\u62C9\u4F38"}]}),P("imageColor","\u586B\u5145\u8272","color",e.imageColor),P("enableMask","\u5F00\u542F\u906E\u7F69","bool",e.enableMask===!0),P("enableSoftEdge","\u8FB9\u7F18\u7FBD\u5316","bool",e.enableSoftEdge===!0,{gia:"W"}),P("softEdgeMode","\u7FBD\u5316\u6A21\u5F0F","enum",e.softEdgeMode,{options:[{value:"Percentage",label:"\u767E\u5206\u6BD4"},{value:"Pixel",label:"\u50CF\u7D20"}]}),P("softEdgeWidthX","\u7FBD\u5316\u5BBD\u5EA6 X","number",e.softEdgeWidthX),P("softEdgeWidthY","\u7FBD\u5316\u5BBD\u5EA6 Y","number",e.softEdgeWidthY),P("horizontalSoftRange","\u6C34\u5E73\u7FBD\u5316\u8303\u56F4","number",e.horizontalSoftRange),P("verticalSoftRange","\u5782\u76F4\u7FBD\u5316\u8303\u56F4","number",e.verticalSoftRange),P("enableFill","\u6309\u8FDB\u5EA6\u586B\u5145","bool",e.enableFill===!0,{gia:"W"}),P("fillType","\u5F62\u72B6","enum",c,{...[1,2,3,4,5].includes(s)?{}:{unknownValue:s},options:[{value:"Horizontal",label:"\u6A2A\u5411"},{value:"Vertical",label:"\u7EB5\u5411"},{value:"Radial90",label:"90\u5EA6\u73AF\u7ED5"},{value:"Radial180",label:"180\u5EA6\u73AF\u7ED5"},{value:"Radial360",label:"360\u5EA6\u73AF\u7ED5"}]}),P("fillHorizontalType","\u65B9\u5411","enum",e.fillHorizontalType,{options:[{value:"Left",label:"\u4ECE\u5DE6\u81F3\u53F3"},{value:"Right",label:"\u4ECE\u53F3\u81F3\u5DE6"}]}),P("fillVerticalType","\u65B9\u5411","enum",e.fillVerticalType,{options:[{value:"Bottom",label:"\u4ECE\u4E0B\u81F3\u4E0A"},{value:"Top",label:"\u4ECE\u4E0A\u81F3\u4E0B"}]}),P("fillRadial90Type","\u8D77\u70B9","enum",e.fillRadial90Type,{options:[{value:"BottomLeft",label:"\u5DE6\u4E0B"},{value:"TopLeft",label:"\u5DE6\u4E0A"},{value:"TopRight",label:"\u53F3\u4E0A"},{value:"BottomRight",label:"\u53F3\u4E0B"}]}),P("fillRadialType","\u8D77\u70B9","enum",e.fillRadialType,{options:[{value:"Bottom",label:"\u4E0B\u65B9"},{value:"Left",label:"\u5DE6\u4FA7"},{value:"Top",label:"\u4E0A\u65B9"},{value:"Right",label:"\u53F3\u4FA7"}]}),P("fillAmount","\u8FDB\u5EA6","percent",e.fillAmount),P("reverseMaskArea","\u906E\u7F69\u533A\u57DF\u53CD\u8F6C","bool",e.reverseMaskArea===!0,{gia:"W"}))}if(e.kind==="button"){let s=[{value:"",label:"\u672A\u8BBE\u7F6E"},...(e.children||[]).map(c=>({value:c.id,label:`${c.name} \xB7 ${c.id}`}))];r.push(P("raycastTarget","\u53EF\u88AB\u5149\u6807\u5C04\u7EBF\u68C0\u6D4B","bool",e.raycastTarget!==!1),P("interactable","\u6309\u94AE\u662F\u5426\u53EF\u7528","bool",e.interactable!==!1),P("unavailableChildId","\u4E0D\u53EF\u7528\u72B6\u6001\u8282\u70B9","node",e.unavailableChildId,{options:s,gia:"W"}),P("hoverChildId","\u60AC\u505C\u72B6\u6001\u8282\u70B9","node",e.hoverChildId,{options:s,gia:"W"}),P("pressedChildId","\u6309\u4E0B\u72B6\u6001\u8282\u70B9","node",e.pressedChildId,{options:s,gia:"W"}),P("selectedChildId","\u9009\u4E2D\u72B6\u6001\u8282\u70B9","node",e.selectedChildId,{options:s,gia:"W"}),P("clickAudioId","\u70B9\u51FB\u97F3\u6548","number",e.clickAudioId))}return e.kind==="reference"&&r.push(P("referencedPrefabId","\u5F15\u7528\u63A7\u4EF6\u6A21\u677F\u7D22\u5F15","string",e.referencedPrefabId??"")),(e.kind==="textwindow"||e.kind==="grid")&&r.push(P("interactable","\u5141\u8BB8\u6EDA\u52A8\u4EA4\u4E92","bool",e.interactable!==!1),P("showScrollBar","\u663E\u793A\u6EDA\u52A8\u6761","bool",e.showScrollBar!==!1)),e.kind==="grid"&&r.push(P("itemPrefabId","\u5217\u8868\u9879\u6A21\u677F\u7D22\u5F15","number",e.itemPrefabId??0),P("raycastTarget","\u53EF\u88AB\u5149\u6807\u5C04\u7EBF\u68C0\u6D4B","bool",e.raycastTarget!==!1),P("scrollDirection","\u6EDA\u52A8\u65B9\u5411","enum",e.scrollDirection,{options:[{value:"Vertical",label:"\u7EB5\u5411"},{value:"Horizontal",label:"\u6A2A\u5411"}]}),P("layoutConstraint","\u6392\u5217\u9650\u5236","enum",e.layoutConstraint,{options:[{value:"AutoWrap",label:"\u81EA\u52A8\u6362\u884C"},{value:"Fixed",label:"\u56FA\u5B9A\u884C\u5217\u6570"}]}),P("layoutConstraintFixedCount","\u6BCF\u884C\u6216\u6BCF\u5217\u6570\u91CF","number",e.layoutConstraintFixedCount??1),P("cellSizeX","\u5217\u8868\u9879\u5927\u5C0F W","number",e.cellSizeX,{evidence:"W"}),P("cellSizeY","\u5217\u8868\u9879\u5927\u5C0F H","number",e.cellSizeY,{evidence:"W"}),P("spacingX","\u5217\u8868\u9879\u95F4\u9694 X","number",e.spacingX,{evidence:"W"}),P("spacingY","\u5217\u8868\u9879\u95F4\u9694 Y","number",e.spacingY,{evidence:"W"}),P("padding1X","\u8FB9\u8DDD\u5411\u91CF 1 X","number",e.padding1X,{evidence:"W"}),P("padding1Y","\u8FB9\u8DDD\u5411\u91CF 1 Y","number",e.padding1Y,{evidence:"W"}),P("padding2X","\u8FB9\u8DDD\u5411\u91CF 2 X","number",e.padding2X,{evidence:"W"}),P("padding2Y","\u8FB9\u8DDD\u5411\u91CF 2 Y","number",e.padding2Y,{evidence:"W"}),P("previewCount","\u9884\u89C8\u6570\u91CF","number",e.previewCount)),e.kind==="keyhint"&&r.push(P("keyboardKeyCode","\u952E\u9F20\u6309\u952E","number",e.keyboardKeyCode??e.giaRaw?.keyHintField502??1,{gia:"W"}),P("controllerKeyCode","\u624B\u67C4\u6309\u952E","number",e.controllerKeyCode??e.giaRaw?.keyHintField501??1)),(e.kind==="animation"||e.kind==="fullscreen")&&(r.push(P("animationId",e.kind==="animation"?"\u52A8\u6548\u7D22\u5F15":"\u5168\u5C4F\u52A8\u6548\u7D22\u5F15","string",e.animationId??"")),r.push(P("playSoundEffect","\u64AD\u653E\u52A8\u6548\u97F3\u6548","bool",e.playSoundEffect!==!1)),e.kind==="animation"&&r.push(P("layer","\u52A8\u6548\u5C42\u7EA7","enum",e.layer||"AboveAllControls",{options:[{value:"AboveAllControls",label:"\u6240\u6709\u63A7\u4EF6\u4E4B\u4E0A"},{value:"BelowAllControls",label:"\u6240\u6709\u63A7\u4EF6\u4E4B\u4E0B"}]}))),(!Ri.includes(e.kind)||e.kind==="textwindow"||e.kind==="grid")&&r.push(P("incomplete","\u5B8C\u6574\u5EA6","note",e.kind==="textwindow"||e.kind==="grid"?"\u8BD5\u73A9\u652F\u6301\u57FA\u7840\u6EDA\u52A8\uFF1B\u6EDA\u52A8\u4EA4\u4E92\u3001\u6EDA\u52A8\u6761\u53CA\u5217\u8868\u914D\u7F6E\u4EE5 JSON/Lua \u4E3A\u51C6\uFF0C\u76F8\u5173 GIA \u5F00\u5173\u6620\u5C04\u5C1A\u672A\u6838\u5B9E\u3002":["animation","fullscreen"].includes(e.kind)?"\u652F\u6301\u6D4F\u89C8\u5668\u52A8\u6548\u64AD\u653E\uFF1B\u975E\u7A7A\u52A8\u6548 GIA \u914D\u7F6E\u5C1A\u672A\u6838\u5B9E\u3002":"\u672C\u9636\u6BB5\u4EC5\u516C\u5171\u53D8\u6362\uFF0C\u4E1A\u52A1\u69FD\u4E0D\u5B8C\u6574")),{id:e.id,guid:n?.get(e.id)??(e.guid||0),kind:e.kind,label:Mt[e.kind]||e.kind,incomplete:!Ri.includes(e.kind),fields:r}}function Eo(e,t,i){let n=(Array.isArray(e)?e:Object.values(e)).filter(a=>a.kind!=="server-container");for(let a=n.length-1;a>=0;a-=1){let o=n[a];if(!o.visible||o.visibleInHierarchy===!1||!o.active)continue;let r=o.renderMatrix&&zt(o.renderMatrix),s=r&&Me(r,t,i);if(s&&s.x>=o.left&&s.x<=o.right&&s.y>=o.bottom&&s.y<=o.top)return o.id}return null}import nl from"protobufjs";function Gt(e,t=!1){let i=[],n=(a,o)=>{a.kind!=="server-container"&&i.push({node:a,parent:o});let r=t&&a.kind!=="server-container"?[...a.children||[]].reverse():a.children||[];for(let s of r)n(s,a)};return n(e.root,null),i}var al=String.raw`
|
|
4
7
|
syntax = "proto3";
|
|
5
8
|
// Root.graph is singular in the game's canonical schema, but template-list
|
|
6
9
|
// assets legally emit field 1 more than once. Model it as repeated here so
|
|
@@ -101,10 +104,10 @@ message ImageConfig {
|
|
|
101
104
|
message SliceVector { float field501 = 501; float field502 = 502; }
|
|
102
105
|
}
|
|
103
106
|
message FooterSlot { int32 field505 = 505; }
|
|
104
|
-
`,{root:Bs}=Vs.parse(Ys,{keepCase:!1}),Pe=Bs.lookupType("Root"),it=20,kn=4,fo=806,ho=1657,ii={image:23,"server-container":24,container:25,grid:26,reference:27,button:28,animation:29,fullscreen:30,textbox:31,textwindow:32,cursor:33,keyhint:34},mo={KEYBOARD:0,TOUCHSCREEN:1,CONTROLLER_CONSOLE:2,CONTROLLER_MOBILE:3},Xs="server-control-template",Oi="client-control-template";function Fi(e,t){let i=Number(e);return Number.isFinite(i)?i:t}var Us=Object.fromEntries(Object.entries(mo).map(([e,t])=>[t,e])),po=Object.freeze({container:[["2/15","name",null],["4/86","field14","field14"],["1/12","transform","transform"],["63/83","empty73","genericSlot"],["68/91","empty78","containerNodeSlot"],["67/90","empty77","footerSlot"]],textbox:[["2/15","name",null],["4/86","field14","field14"],["1/12","transform","transform"],["63/83","empty73","genericSlot"],["64/84","empty74","textConfig"],["67/90","empty77","footerSlot"]],cursor:[["2/15","name",null],["4/86","field14","field14"],["1/12","transform","transform"],["63/83","empty73","genericSlot"],["65/85","empty75","cursorConfig"],["67/90","empty77","footerSlot"]],reference:[["2/15","name",null],["4/86","field14","field14"],["1/12","transform","transform"],["63/83","empty73","genericSlot"],["66/89","empty76","templateRefSlot"],["67/90","empty77","footerSlot"]],grid:[["2/15","name",null],["4/86","field14","field14"],["1/12","transform","transform"],["63/83","empty73","genericSlot"],["69/92","empty79","gridView"],["67/90","empty77","footerSlot"]],button:[["2/15","name",null],["4/86","field14","field14"],["1/12","transform","transform"],["63/83","empty73","genericSlot"],["70/93","empty80","buttonPreset"],["67/90","empty77","footerSlot"]],textwindow:[["2/15","name",null],["4/86","field14","field14"],["1/12","transform","transform"],["63/83","empty73","genericSlot"],["71/94","empty81","textConfig"],["67/90","empty77","footerSlot"]],keyhint:[["2/15","name",null],["4/86","field14","field14"],["1/12","transform","transform"],["63/83","empty73","genericSlot"],["72/95","empty82","keyHint"],["67/90","empty77","footerSlot"]],image:[["2/15","name",null],["4/86","field14","field14"],["1/12","transform","transform"],["63/83","empty73","genericSlot"],["73/96","empty83","imageSlot"],["74/97","empty84","image"],["67/90","empty77","footerSlot"]],animation:[["2/15","name",null],["4/86","field14","field14"],["1/12","transform","transform"],["63/83","empty73","genericSlot"],["75/98","empty85","effectSlot"],["67/90","empty77","footerSlot"]],fullscreen:[["2/15","name",null],["4/86","field14","field14"],["1/12","transform","transform"],["63/83","empty73","genericSlot"],["76/99","empty86","fullscreenEffectSlot"],["67/90","empty77","footerSlot"]]}),go=Object.freeze({"4/23":5,"4/86":5,"1/12":4,"62/82":64,"63/83":65,"64/84":66,"65/85":67,"66/89":68,"67/90":69,"68/91":70,"69/92":71,"70/93":72,"71/94":66,"72/95":74,"73/96":75,"74/97":76,"75/98":77,"76/99":78}),Hs=Object.freeze([["2/15","name",null],["4/23","field14","field14"],["1/12","transform","transform"],["62/82","empty72","rootChildRef"]]);function En(e){return{class:1,type:8,id:e}}function ni(e,t,i,n){return{...n,field501:t,field502:i,field503:1,nodeRef:En(e)}}function js(e){let t=[],i=e.meta?.assetType==="client-control-template";return ee(e.root,n=>{i&&n.kind==="server-container"||t.push(n)}),t}function ri(e,t=new Set){let i=new Map,n=[];for(let r of js(e)){let o=Number(r.guid);Te(o)&&!t.has(o)?(t.add(o),r.guid=o,i.set(r.id,o)):n.push(r)}for(let r of n){let o=Qe(t);t.add(o),r.guid=o,i.set(r.id,o)}return i}function Ks(e){return{scale:{x:e.scale.x,y:e.scale.y,z:e.scale.z},anchorMin:{x:e.anchorMin.x,y:e.anchorMin.y},anchorMax:{x:e.anchorMax.x,y:e.anchorMax.y},offset:{x:e.offset.x,y:e.offset.y},size:{x:e.size.x,y:e.size.y},pivot:{x:e.pivot.x,y:e.pivot.y},field508:Object.fromEntries(Object.entries(e.rotation).filter(([,t])=>t!==0))}}function Ls(e,t){let n={multiPlatform:{platforms:le.map(r=>({platformType:mo[r],transform:Ks(e.transformByPlatform[r])})),field502:ii[e.kind]||25,...e.syncAllDevices===!1?{}:{field504:1}},type:2};return{transform:{multiPlatform:{},type:2},field501:1,field502:12,details:ni(t,4,12,{transform:n})}}function qs(e,t,i){let n=i?{empty15:"",field501:5}:{field17:{},field501:7},r=i?n:{...n,...e.visible===!1?{field17:{initiallyHidden:!0}}:{},...e.active===!1?{initiallyInactive:!0}:{}};return[{name:{value:e.name},field501:2,field502:15},{field14:n,field501:4,field502:i?23:86,details:ni(t,5,i?23:86,{field14:r})},Ls(e,t)]}function Ws(e,t,i,n){let r=(l,f,d,m,p)=>({[d]:"",field501:l,field502:f,details:ni(t,l+2,f,{[m]:p})}),o=e.giaRaw||{},a=Array.isArray(e.scriptMappingIds)&&e.scriptMappingIds.length?{field501:o.genericField501||1,field502:e.scriptMappingIds.map(l=>({field1:{id:Number(l)}}))}:{field501:o.genericField501??0},s=r(63,83,"empty73","genericSlot",a),u=r(67,90,"empty77","footerSlot",{field505:[void 0,0,1].includes(o.footerField505)?e.canControllerFocus?1:0:o.footerField505});if(e.kind==="container")return[s,r(68,91,"empty78","containerNodeSlot",{...e.isolateNavigation?{isolateNavigation:!0}:{},...e.disableKeyEventPassthrough?{disableKeyEventPassthrough:!0}:{},...e.disableCursorEventPassthrough?{disableCursorEventPassthrough:!0}:{},...e.showCursor?{showCursor:!0}:{}}),u];if(e.kind==="textbox"||e.kind==="textwindow"){e.verticalAlignment==="Middle"&&n.push(`${e.name}: \u5782\u76F4\u5C45\u4E2D\u6309\u63A8\u5B9A\u503C\u5BFC\u51FA\uFF0C\u5C1A\u5F85\u5B9E\u673A\u786E\u8BA4\u3002`);let l={Left:0,Middle:1,Right:2}[e.horizontalAlignment]??0,f=Number.isFinite(o.textAlign)?Math.trunc(o.textAlign):l,d={field501:o.textField501??20,field503:o.textField503??12,color:e.fontColor>>>0,color2:e.bgColor>>>0,color3:e.outlineColor>>>0,text:{value:e.text||""},fontSize:Math.trunc(e.fontSize),minimumFontSize:Math.trunc(e.minimumFontSize),...e.adaptiveFontSize?{adaptive:1}:{},...e.enableOutline===!1?{outlineOff:1}:{},...f?{align:f}:{},verticalAlign:o.textVerticalAlign??{Top:0,Middle:1,Bottom:2}[e.verticalAlignment]??0};return e.kind==="textwindow"?((e.interactable===!1||e.showScrollBar===!1)&&n.push(`${e.name}: \u6587\u672C\u89C6\u7A97\u4EA4\u4E92/\u6EDA\u52A8\u6761\u5F00\u5173\u4EC5\u4FDD\u5B58\u5728 JSON\uFF0CGIA \u672A\u6620\u5C04\u8FD9\u4E9B\u6539\u52A8\u3002`),d.field511=o.textField511??1,d.viewFlags={field502:o.textViewField502??1,field503:o.textViewField503??1},[s,{empty81:"",field501:71,field502:94,details:ni(t,66,94,{textConfig:d})},u]):[s,r(64,84,"empty74","textConfig",d),u]}if(e.kind==="image"){let l=[0,1].includes(o.imageSlotType??0)?e.imageType==="Stretch"?1:0:o.imageSlotType;e.imageType==null&&e.imageSource==="StaticReference"&&e.imageId>100006&&n.push(`${e.name}: \u56FE\u7247\u7C7B\u578B\u968F\u7D20\u6750\u8FB9\u754C\u81EA\u52A8\u9009\u62E9\uFF0CGIA \u6309\u57FA\u7840\u5BFC\u51FA\uFF1B\u9700\u8981\u62C9\u4F38\u8BF7\u5148\u660E\u786E\u9009\u62E9\u6216\u5728 Lua \u8BBE\u7F6E imageType\u3002`),e.imageSource&&e.imageSource!=="StaticReference"&&n.push(`${e.name}: \u56FE\u7247\u6765\u6E90 ${e.imageSource} \u4EC5\u4FDD\u5B58\u5728 JSON\uFF0C\u5C1A\u672A\u6620\u5C04\u5230 GIA\uFF1B\u8BF7\u5728 Lua \u4E2D\u7528 SetImage(Enum.ImageSource.${e.imageSource}, ${e.imageId}) \u8BBE\u7F6E\u3002`);let f={Horizontal:1,Vertical:2,Radial90:3,Radial180:4,Radial360:5}[e.fillType],d=Number.isFinite(o.imageFillType)?Math.trunc(o.imageFillType):f||1;e.enableFill&&!d&&n.push(`${e.name}: \u586B\u5145\u5F62\u72B6\u539F\u59CB\u679A\u4E3E\u4E3A 0\uFF0C\u5DF2\u5173\u95ED\u5BFC\u51FA\u6587\u4EF6\u4E2D\u7684\u8FDB\u5EA6\u586B\u5145\u3002`),e.fillType==="Horizontal"&&e.fillHorizontalType!=="Left"&&n.push(`${e.name}: \u5F53\u524D\u6A2A\u5411\u586B\u5145\u65B9\u5411\u6682\u4E0D\u652F\u6301\u5199\u5165 GIA\u3002`),e.fillType==="Radial180"&&e.fillRadialType!=="Bottom"&&n.push(`${e.name}: \u5F53\u524D 180 \u5EA6\u586B\u5145\u8D77\u70B9\u6682\u4E0D\u652F\u6301\u5199\u5165 GIA\u3002`);let m={field502:o.imageField502??1,field504:o.imageField504??1,field505:o.imageField505??1,field507:o.imageField507??2,field508:Math.round(Math.max(0,Math.min(1,Number(e.fillAmount)||0))*100),border:{field501:Fi(e.softEdgeWidthX,8),field502:Fi(e.softEdgeWidthY,8)},field512:Fi(e.horizontalSoftRange,85),field513:Fi(e.verticalSoftRange,85),fillType:d,...e.enableMask?{enableMask:1}:{},...e.enableSoftEdge?{enableSoftEdge:1}:{},...e.softEdgeMode==="Pixel"?{softEdgePixel:1}:{},...e.enableFill&&d?{enableFill:1}:{},...e.reverseMaskArea?{reverseMask:1}:{}};return[s,r(73,96,"empty83","imageSlot",{field502:Number.isFinite(e.imageColor)?e.imageColor>>>0:4294967295,assetId:e.imageId>>>0,...l?{imageType:l}:{}}),r(74,97,"empty84","image",m),u]}if(e.kind==="button"){let l=(g,y)=>{let C=e[g];return C?(e.children||[]).some(x=>x.id===C)?i.get(C)||0:(n.push(`${e.name}: ${y}\u72B6\u6001\u8282\u70B9\u4E0D\u662F\u6309\u94AE\u7684\u76F4\u63A5\u5B50\u63A7\u4EF6\uFF0CGIA \u672A\u5199\u5165\u8BE5\u72B6\u6001\u3002`),0):0},f=l("unavailableChildId","\u4E0D\u53EF\u7528"),d=l("hoverChildId","\u60AC\u505C"),m=l("pressedChildId","\u6309\u4E0B"),p=l("selectedChildId","\u9009\u4E2D");return[s,r(70,93,"empty80","buttonPreset",{clickAudioId:Math.trunc(e.clickAudioId),...f?{disabledChild:f}:{},...d?{hoverChild:d}:{},...m?{pressedChild:m}:{},...p?{selectedChild:p}:{},...e.interactable?{interactable:1}:{},...e.raycastTarget?{raycastTarget:1}:{}}),u]}if(e.kind==="cursor")return[s,r(65,85,"empty75","cursorConfig",{field501:[void 0,0,1].includes(o.cursorField501)?e.raycastTarget!==!1?1:0:o.cursorField501}),u];if(e.kind==="reference"){let l=o.templateRefSlotBase64;(l||o.templateRefOuterBase64)&&n.push(`${e.name}: \u6A21\u677F\u5F15\u7528\u7684\u975E\u7A7A\u4E8C\u8FDB\u5236\u914D\u7F6E\u5C1A\u672A\u89E3\u6790\uFF0C\u5DF2\u539F\u6837\u4FDD\u7559\uFF1B\u4E0D\u4F1A\u81EA\u52A8\u5C55\u5F00\u88AB\u5F15\u7528\u6A21\u677F\u3002`);let f=r(66,89,"empty76","templateRefSlot",l?Buffer.from(l,"base64"):Buffer.from(o.templateRefSlot??"","utf8"));return f.empty76=Buffer.from(o.templateRefOuterBase64||"","base64"),[s,f,u]}return e.kind==="grid"?((e.itemPrefabId||e.interactable===!1||e.showScrollBar===!1||e.raycastTarget===!1||e.scrollDirection!=="Vertical"||e.layoutConstraint!=="AutoWrap")&&n.push(`${e.name}: \u7F51\u683C\u5217\u8868\u9879\u6A21\u677F\u3001\u4EA4\u4E92/\u6EDA\u52A8\u6761\u5F00\u5173\u3001\u6EDA\u52A8\u65B9\u5411\u53CA\u6392\u5217\u9650\u5236\u4EC5\u4FDD\u5B58\u5728 JSON\uFF0CGIA \u672A\u6620\u5C04\u8FD9\u4E9B\u6539\u52A8\u3002`),[s,r(69,92,"empty79","gridView",{field501:o.gridField501??1,cellSize:{field501:e.cellSizeX,field502:e.cellSizeY},gap:{field501:e.spacingX,field502:e.spacingY},padding1:{field501:e.padding1X,field502:e.padding1Y},padding2:{field501:e.padding2X,field502:e.padding2Y},field507:o.gridField507??1,field508:o.gridField508??1,field509:o.gridField509??1,field511:o.gridField511??5,field512:o.gridField512??1}),u]):e.kind==="keyhint"?[s,r(72,95,"empty82","keyHint",{field501:Number.isFinite(o.keyHintField501)?Math.trunc(o.keyHintField501):e.controllerKeyCode??1,field502:Number.isFinite(o.keyHintField502)?Math.trunc(o.keyHintField502):e.keyboardKeyCode??1}),u]:e.kind==="animation"?[s,r(75,98,"empty85","effectSlot",o.effectSlot??""),u]:e.kind==="fullscreen"?[s,r(76,99,"empty86","fullscreenEffectSlot",o.fullscreenEffectSlot??""),u]:(n.push(`${e.name}: ${e.kind} \u4E0D\u662F\u5DF2\u77E5 GIA \u63A7\u4EF6\u7C7B\u578B\uFF0C\u5DF2\u4EC5\u5199\u516C\u5171\u53D8\u6362\u3002`),[s,u])}function Js(e,t){if(t)return 1;if(!Ce(e.giaInfoIndex))throw new Error(`${e.name}: \u7F3A\u5C11\u5408\u6CD5\u7684\u5BA2\u6237\u7AEF\u8D44\u4EA7\u7F16\u53F7`);return e.giaInfoIndex}function Qs(e,t,i){let n=Array.isArray(e.giaRelatedGuids)?e.giaRelatedGuids.filter(r=>Number.isSafeInteger(r)&&r>0&&r<=2147483647):[];return n.length?n:(t.push(`${e.name}: \u65B0${i}\u5199\u5165\u663E\u5F0F\u7A7A Info.related\uFF0C\u907F\u514D\u8DE8\u6C99\u7BB1\u590D\u7528\u4F34\u751F\u8D44\u6E90 GUID \u4EA7\u751F\u65E0\u6CD5\u52A0\u8F7D\u7684\u7D22\u5F15\u3002`),[])}function An(e,t){let i=String(e.meta?.giaFilePath||"").trim();if(/^\d+-\d+-\d+-\\.+\.gia$/iu.test(i))return i;let n=(l,f)=>Number.isSafeInteger(Number(l))&&Number(l)>0?Number(l):f,r=n(e.meta?.giaOwnerUid,114514),o=n(e.meta?.giaTimestamp,Math.floor(Date.now()/1e3)),a=n(e.meta?.giaFileId,t?1073741829:1073741830),s=t?"\u5BA2\u6237\u7AEF\u63A7\u4EF6\u6A21\u677F\u5217\u8868.gia":"\u670D\u52A1\u7AEF\u63A7\u4EF6\u6A21\u677F-\u5BA2\u6237\u7AEF\u63A7\u4EF6\u5BB9\u5668.gia",u=String(e.meta?.giaFileName||s).replace(/[\\/:*?"<>|]/gu,"-").replace(/\.gia$/iu,"").trim()||s.replace(/\.gia$/iu,"");return`${r}-${o}-${a}-\\${u}.gia`}function zi(e,t,i,n,r,o=!1,a=!1,s=a,u=!1){let l=i.get(e.id),d=(u?[...e.children||[]].reverse():e.children||[]).map(g=>i.get(g.id)),m=o?n:d,p=qs(e,l,o);if(o){let g=e.children?.[0];g&&p.push({empty72:"",field501:62,field502:82,details:ni(l,64,82,{rootChildRef:{guid:i.get(g.id)}})})}else p.push(...Ws(e,l,i,r));return{id:En(l),relatedIds:m.map(g=>En(g)),name:e.name,which:o?21:a?70:15,ui:{content:{guid:l,info:[{guid:{value:l},field501:1,field502:5},...o||s?[{index:{value:Js(e,o)},field501:2,field502:6}]:[],...o||a?[{related:{value:Qs(e,r,o?"\u670D\u52A1\u7AEF\u63A7\u4EF6\u6A21\u677F":"\u5BA2\u6237\u7AEF\u63A7\u4EF6\u6A21\u677F")},field501:4,field502:4}]:[]],children:o?[]:d,parent:t&&t.kind!=="server-container"?i.get(t.id):0,data:p}}}}function Zs(e,t){let i=new Map;for(let n of e||[]){if(!n.controlId||!(t===Oi?n.controlAsset===Oi:n.controlAsset!==Oi))continue;let o=i.get(n.controlId)||[];o.push(n.guid),i.set(n.controlId,o)}return i}function yo(e,t,i,n){let r=Zs(t,i),o=new Map;ee(e.root,a=>{r.has(a.id)&&(o.set(a,a.scriptMappingIds),a.scriptMappingIds=r.get(a.id))});try{return n()}finally{for(let[a,s]of o)s===void 0?delete a.scriptMappingIds:a.scriptMappingIds=s}}function _n(e){let t=Number(e.meta?.giaModeFlag);return Number.isSafeInteger(t)&&t>=0?{modeFlag:t}:{}}function Tn(e){let t=e.meta?.gameVersion;return!t||t==="7.0.50"?Ci:t}function bo(e,t,i,n,r=[]){let o=Ft(e,!0),a=o.filter(({parent:f})=>f?.kind==="server-container");if(!a.length)throw new Error("\u5BA2\u6237\u7AEF\u63A7\u4EF6\u6A21\u677F\u5217\u8868\u81F3\u5C11\u9700\u8981\u4E00\u4E2A\u6A21\u677F");let s=new Set(a.map(({node:f})=>f.id)),u=o.filter(({node:f})=>!s.has(f.id)),l=o.map(({node:f})=>t.get(f.id));return yo(e,r,Oi,()=>({graph:a.map(({node:f,parent:d})=>zi(f,d,t,l,i,!1,!0,!0,!0)),accessories:u.map(({node:f,parent:d})=>zi(f,d,t,l,i,!1,!1,!0,!0)),filePath:n||An(e,!0),gameVersion:Tn(e),..._n(e)}))}function vo(e,t,i,n,r){let o=Ft(e),a=[o[0],...o.slice(1).reverse()],s=a.map(({node:u})=>t.get(u.id));return yo(e,i.scripts,Xs,()=>({graph:[zi(e.root,null,t,s,n,!0,!1,!1,!0),...i.units||[]],accessories:a.map(({node:u,parent:l})=>zi(u,l,t,s,n,!1,!1,!1,!0)),filePath:r||An(e,!1),gameVersion:Tn(e),..._n(e)}))}function So(e,t){let i=Pn(e),n=t(i);if(!n.valid)throw new Error(`GIA compatibility validation failed:
|
|
107
|
+
`,{root:ol}=nl.parse(al,{keepCase:!1}),Ne=ol.lookupType("Root"),nt=20,Mn=4,ko=806,Ao=1657,ai={image:23,"server-container":24,container:25,grid:26,reference:27,button:28,animation:29,fullscreen:30,textbox:31,textwindow:32,cursor:33,keyhint:34},_o={KEYBOARD:0,TOUCHSCREEN:1,CONTROLLER_CONSOLE:2,CONTROLLER_MOBILE:3},rl="server-control-template",Bi="client-control-template";function Vi(e,t){let i=Number(e);return Number.isFinite(i)?i:t}var sl=Object.fromEntries(Object.entries(_o).map(([e,t])=>[t,e])),To=Object.freeze({container:[["2/15","name",null],["4/86","field14","field14"],["1/12","transform","transform"],["63/83","empty73","genericSlot"],["68/91","empty78","containerNodeSlot"],["67/90","empty77","footerSlot"]],textbox:[["2/15","name",null],["4/86","field14","field14"],["1/12","transform","transform"],["63/83","empty73","genericSlot"],["64/84","empty74","textConfig"],["67/90","empty77","footerSlot"]],cursor:[["2/15","name",null],["4/86","field14","field14"],["1/12","transform","transform"],["63/83","empty73","genericSlot"],["65/85","empty75","cursorConfig"],["67/90","empty77","footerSlot"]],reference:[["2/15","name",null],["4/86","field14","field14"],["1/12","transform","transform"],["63/83","empty73","genericSlot"],["66/89","empty76","templateRefSlot"],["67/90","empty77","footerSlot"]],grid:[["2/15","name",null],["4/86","field14","field14"],["1/12","transform","transform"],["63/83","empty73","genericSlot"],["69/92","empty79","gridView"],["67/90","empty77","footerSlot"]],button:[["2/15","name",null],["4/86","field14","field14"],["1/12","transform","transform"],["63/83","empty73","genericSlot"],["70/93","empty80","buttonPreset"],["67/90","empty77","footerSlot"]],textwindow:[["2/15","name",null],["4/86","field14","field14"],["1/12","transform","transform"],["63/83","empty73","genericSlot"],["71/94","empty81","textConfig"],["67/90","empty77","footerSlot"]],keyhint:[["2/15","name",null],["4/86","field14","field14"],["1/12","transform","transform"],["63/83","empty73","genericSlot"],["72/95","empty82","keyHint"],["67/90","empty77","footerSlot"]],image:[["2/15","name",null],["4/86","field14","field14"],["1/12","transform","transform"],["63/83","empty73","genericSlot"],["73/96","empty83","imageSlot"],["74/97","empty84","image"],["67/90","empty77","footerSlot"]],animation:[["2/15","name",null],["4/86","field14","field14"],["1/12","transform","transform"],["63/83","empty73","genericSlot"],["75/98","empty85","effectSlot"],["67/90","empty77","footerSlot"]],fullscreen:[["2/15","name",null],["4/86","field14","field14"],["1/12","transform","transform"],["63/83","empty73","genericSlot"],["76/99","empty86","fullscreenEffectSlot"],["67/90","empty77","footerSlot"]]}),Po=Object.freeze({"4/23":5,"4/86":5,"1/12":4,"62/82":64,"63/83":65,"64/84":66,"65/85":67,"66/89":68,"67/90":69,"68/91":70,"69/92":71,"70/93":72,"71/94":66,"72/95":74,"73/96":75,"74/97":76,"75/98":77,"76/99":78}),ll=Object.freeze([["2/15","name",null],["4/23","field14","field14"],["1/12","transform","transform"],["62/82","empty72","rootChildRef"]]);function Nn(e){return{class:1,type:8,id:e}}function oi(e,t,i,n){return{...n,field501:t,field502:i,field503:1,nodeRef:Nn(e)}}function cl(e){let t=[],i=e.meta?.assetType==="client-control-template";return K(e.root,n=>{i&&n.kind==="server-container"||t.push(n)}),t}function ri(e,t=new Set,{preserveLegacy:i=!1}={}){let n=new Map,a=[],o=cl(e);if(!i)for(let r of o)vn(r.guid,r.name);for(let r of o){let s=Number(r.guid);(i?Ue(s):ke(s))&&!t.has(s)?(t.add(s),r.guid=s,n.set(r.id,s)):a.push(r)}for(let r of a){let s=Ze(t);t.add(s),r.guid=s,n.set(r.id,s)}return n}function dl(e){return{scale:{x:e.scale.x,y:e.scale.y,z:e.scale.z},anchorMin:{x:e.anchorMin.x,y:e.anchorMin.y},anchorMax:{x:e.anchorMax.x,y:e.anchorMax.y},offset:{x:e.offset.x,y:e.offset.y},size:{x:e.size.x,y:e.size.y},pivot:{x:e.pivot.x,y:e.pivot.y},field508:Object.fromEntries(Object.entries(e.rotation).filter(([,t])=>t!==0))}}function fl(e,t){let n={multiPlatform:{platforms:ce.map(a=>({platformType:_o[a],transform:dl(e.transformByPlatform[a])})),field502:ai[e.kind]||25,...e.syncAllDevices===!1?{}:{field504:1}},type:2};return{transform:{multiPlatform:{},type:2},field501:1,field502:12,details:oi(t,4,12,{transform:n})}}function ul(e,t,i){let n=i?{empty15:"",field501:5}:{field17:{},field501:7},a=i?n:{...n,...e.visible===!1?{field17:{initiallyHidden:!0}}:{},...e.active===!1?{initiallyInactive:!0}:{}};return[{name:{value:e.name},field501:2,field502:15},{field14:n,field501:4,field502:i?23:86,details:oi(t,5,i?23:86,{field14:a})},fl(e,t)]}function hl(e,t,i,n){let a=(l,f,u,p,m)=>({[u]:"",field501:l,field502:f,details:oi(t,l+2,f,{[p]:m})}),o=e.giaRaw||{},r=Array.isArray(e.scriptMappingIds)&&e.scriptMappingIds.length?{field501:o.genericField501||1,field502:e.scriptMappingIds.map(l=>({field1:{id:Number(l)}}))}:{field501:o.genericField501??0},s=a(63,83,"empty73","genericSlot",r),c=a(67,90,"empty77","footerSlot",{field505:[void 0,0,1].includes(o.footerField505)?e.canControllerFocus?1:0:o.footerField505});if(e.kind==="container")return[s,a(68,91,"empty78","containerNodeSlot",{...e.isolateNavigation?{isolateNavigation:!0}:{},...e.disableKeyEventPassthrough?{disableKeyEventPassthrough:!0}:{},...e.disableCursorEventPassthrough?{disableCursorEventPassthrough:!0}:{},...e.showCursor?{showCursor:!0}:{}}),c];if(e.kind==="textbox"||e.kind==="textwindow"){e.verticalAlignment==="Middle"&&n.push(`${e.name}: \u5782\u76F4\u5C45\u4E2D\u6309\u63A8\u5B9A\u503C\u5BFC\u51FA\uFF0C\u5C1A\u5F85\u5B9E\u673A\u786E\u8BA4\u3002`);let l={Left:0,Middle:1,Right:2}[e.horizontalAlignment]??0,f=Number.isFinite(o.textAlign)?Math.trunc(o.textAlign):l,u={field501:o.textField501??20,field503:o.textField503??12,color:e.fontColor>>>0,color2:e.bgColor>>>0,color3:e.outlineColor>>>0,text:{value:e.text||""},fontSize:Math.trunc(e.fontSize),minimumFontSize:Math.trunc(e.minimumFontSize),...e.adaptiveFontSize?{adaptive:1}:{},...e.enableOutline===!1?{outlineOff:1}:{},...f?{align:f}:{},verticalAlign:o.textVerticalAlign??{Top:0,Middle:1,Bottom:2}[e.verticalAlignment]??0};return e.kind==="textwindow"?((e.interactable===!1||e.showScrollBar===!1)&&n.push(`${e.name}: \u6587\u672C\u89C6\u7A97\u4EA4\u4E92/\u6EDA\u52A8\u6761\u5F00\u5173\u4EC5\u4FDD\u5B58\u5728 JSON\uFF0CGIA \u672A\u6620\u5C04\u8FD9\u4E9B\u6539\u52A8\u3002`),u.field511=o.textField511??1,u.viewFlags={field502:o.textViewField502??1,field503:o.textViewField503??1},[s,{empty81:"",field501:71,field502:94,details:oi(t,66,94,{textConfig:u})},c]):[s,a(64,84,"empty74","textConfig",u),c]}if(e.kind==="image"){let l=[0,1].includes(o.imageSlotType??0)?e.imageType==="Stretch"?1:0:o.imageSlotType;e.imageType==null&&e.imageSource==="StaticReference"&&e.imageId>100006&&n.push(`${e.name}: \u56FE\u7247\u7C7B\u578B\u968F\u7D20\u6750\u8FB9\u754C\u81EA\u52A8\u9009\u62E9\uFF0CGIA \u6309\u57FA\u7840\u5BFC\u51FA\uFF1B\u9700\u8981\u62C9\u4F38\u8BF7\u5148\u660E\u786E\u9009\u62E9\u6216\u5728 Lua \u8BBE\u7F6E imageType\u3002`),e.imageSource&&e.imageSource!=="StaticReference"&&n.push(`${e.name}: \u56FE\u7247\u6765\u6E90 ${e.imageSource} \u4EC5\u4FDD\u5B58\u5728 JSON\uFF0C\u5C1A\u672A\u6620\u5C04\u5230 GIA\uFF1B\u8BF7\u5728 Lua \u4E2D\u7528 SetImage(Enum.ImageSource.${e.imageSource}, ${e.imageId}) \u8BBE\u7F6E\u3002`);let f={Horizontal:1,Vertical:2,Radial90:3,Radial180:4,Radial360:5}[e.fillType],u=Number.isFinite(o.imageFillType)?Math.trunc(o.imageFillType):f||1;e.enableFill&&!u&&n.push(`${e.name}: \u586B\u5145\u5F62\u72B6\u539F\u59CB\u679A\u4E3E\u4E3A 0\uFF0C\u5DF2\u5173\u95ED\u5BFC\u51FA\u6587\u4EF6\u4E2D\u7684\u8FDB\u5EA6\u586B\u5145\u3002`),e.fillType==="Horizontal"&&e.fillHorizontalType!=="Left"&&n.push(`${e.name}: \u5F53\u524D\u6A2A\u5411\u586B\u5145\u65B9\u5411\u6682\u4E0D\u652F\u6301\u5199\u5165 GIA\u3002`),e.fillType==="Radial180"&&e.fillRadialType!=="Bottom"&&n.push(`${e.name}: \u5F53\u524D 180 \u5EA6\u586B\u5145\u8D77\u70B9\u6682\u4E0D\u652F\u6301\u5199\u5165 GIA\u3002`);let p={field502:o.imageField502??1,field504:o.imageField504??1,field505:o.imageField505??1,field507:o.imageField507??2,field508:Math.round(Math.max(0,Math.min(1,Number(e.fillAmount)||0))*100),border:{field501:Vi(e.softEdgeWidthX,8),field502:Vi(e.softEdgeWidthY,8)},field512:Vi(e.horizontalSoftRange,85),field513:Vi(e.verticalSoftRange,85),fillType:u,...e.enableMask?{enableMask:1}:{},...e.enableSoftEdge?{enableSoftEdge:1}:{},...e.softEdgeMode==="Pixel"?{softEdgePixel:1}:{},...e.enableFill&&u?{enableFill:1}:{},...e.reverseMaskArea?{reverseMask:1}:{}};return[s,a(73,96,"empty83","imageSlot",{field502:Number.isFinite(e.imageColor)?e.imageColor>>>0:4294967295,assetId:e.imageId>>>0,...l?{imageType:l}:{}}),a(74,97,"empty84","image",p),c]}if(e.kind==="button"){let l=(g,b)=>{let v=e[g];return v?(e.children||[]).some(S=>S.id===v)?i.get(v)||0:(n.push(`${e.name}: ${b}\u72B6\u6001\u8282\u70B9\u4E0D\u662F\u6309\u94AE\u7684\u76F4\u63A5\u5B50\u63A7\u4EF6\uFF0CGIA \u672A\u5199\u5165\u8BE5\u72B6\u6001\u3002`),0):0},f=l("unavailableChildId","\u4E0D\u53EF\u7528"),u=l("hoverChildId","\u60AC\u505C"),p=l("pressedChildId","\u6309\u4E0B"),m=l("selectedChildId","\u9009\u4E2D");return[s,a(70,93,"empty80","buttonPreset",{clickAudioId:Math.trunc(e.clickAudioId),...f?{disabledChild:f}:{},...u?{hoverChild:u}:{},...p?{pressedChild:p}:{},...m?{selectedChild:m}:{},...e.interactable?{interactable:1}:{},...e.raycastTarget?{raycastTarget:1}:{}}),c]}if(e.kind==="cursor")return[s,a(65,85,"empty75","cursorConfig",{field501:[void 0,0,1].includes(o.cursorField501)?e.raycastTarget!==!1?1:0:o.cursorField501}),c];if(e.kind==="reference"){let l=o.templateRefSlotBase64;(l||o.templateRefOuterBase64)&&n.push(`${e.name}: \u6A21\u677F\u5F15\u7528\u7684\u975E\u7A7A\u4E8C\u8FDB\u5236\u914D\u7F6E\u5C1A\u672A\u89E3\u6790\uFF0C\u5DF2\u539F\u6837\u4FDD\u7559\uFF1B\u4E0D\u4F1A\u81EA\u52A8\u5C55\u5F00\u88AB\u5F15\u7528\u6A21\u677F\u3002`);let f=a(66,89,"empty76","templateRefSlot",l?Buffer.from(l,"base64"):Buffer.from(o.templateRefSlot??"","utf8"));return f.empty76=Buffer.from(o.templateRefOuterBase64||"","base64"),[s,f,c]}return e.kind==="grid"?((e.itemPrefabId||e.interactable===!1||e.showScrollBar===!1||e.raycastTarget===!1||e.scrollDirection!=="Vertical"||e.layoutConstraint!=="AutoWrap")&&n.push(`${e.name}: \u7F51\u683C\u5217\u8868\u9879\u6A21\u677F\u3001\u4EA4\u4E92/\u6EDA\u52A8\u6761\u5F00\u5173\u3001\u6EDA\u52A8\u65B9\u5411\u53CA\u6392\u5217\u9650\u5236\u4EC5\u4FDD\u5B58\u5728 JSON\uFF0CGIA \u672A\u6620\u5C04\u8FD9\u4E9B\u6539\u52A8\u3002`),[s,a(69,92,"empty79","gridView",{field501:o.gridField501??1,cellSize:{field501:e.cellSizeX,field502:e.cellSizeY},gap:{field501:e.spacingX,field502:e.spacingY},padding1:{field501:e.padding1X,field502:e.padding1Y},padding2:{field501:e.padding2X,field502:e.padding2Y},field507:o.gridField507??1,field508:o.gridField508??1,field509:o.gridField509??1,field511:o.gridField511??5,field512:o.gridField512??1}),c]):e.kind==="keyhint"?[s,a(72,95,"empty82","keyHint",{field501:Number.isFinite(o.keyHintField501)?Math.trunc(o.keyHintField501):e.controllerKeyCode??1,field502:Number.isFinite(o.keyHintField502)?Math.trunc(o.keyHintField502):e.keyboardKeyCode??1}),c]:e.kind==="animation"?[s,a(75,98,"empty85","effectSlot",o.effectSlot??""),c]:e.kind==="fullscreen"?[s,a(76,99,"empty86","fullscreenEffectSlot",o.fullscreenEffectSlot??""),c]:(n.push(`${e.name}: ${e.kind} \u4E0D\u662F\u5DF2\u77E5 GIA \u63A7\u4EF6\u7C7B\u578B\uFF0C\u5DF2\u4EC5\u5199\u516C\u5171\u53D8\u6362\u3002`),[s,c])}function ml(e,t){if(t)return 1;if(!Ae(e.giaInfoIndex))throw new Error(`${e.name}: \u7F3A\u5C11\u5408\u6CD5\u7684\u5BA2\u6237\u7AEF\u8D44\u4EA7\u7F16\u53F7`);return e.giaInfoIndex}function pl(e,t,i){let n=Array.isArray(e.giaRelatedGuids)?e.giaRelatedGuids.filter(a=>Number.isSafeInteger(a)&&a>0&&a<=2147483647):[];return n.length?n:(t.push(`${e.name}: \u65B0${i}\u5199\u5165\u663E\u5F0F\u7A7A Info.related\uFF0C\u907F\u514D\u8DE8\u6C99\u7BB1\u590D\u7528\u4F34\u751F\u8D44\u6E90 GUID \u4EA7\u751F\u65E0\u6CD5\u52A0\u8F7D\u7684\u7D22\u5F15\u3002`),[])}function Fn(e,t){let i=String(e.meta?.giaFilePath||"").trim();if(/^\d+-\d+-\d+-\\.+\.gia$/iu.test(i))return i;let n=(l,f)=>Number.isSafeInteger(Number(l))&&Number(l)>0?Number(l):f,a=n(e.meta?.giaOwnerUid,114514),o=n(e.meta?.giaTimestamp,Math.floor(Date.now()/1e3)),r=n(e.meta?.giaFileId,t?1073741829:1073741830),s=t?"\u5BA2\u6237\u7AEF\u63A7\u4EF6\u6A21\u677F\u5217\u8868.gia":"\u670D\u52A1\u7AEF\u63A7\u4EF6\u6A21\u677F-\u5BA2\u6237\u7AEF\u63A7\u4EF6\u5BB9\u5668.gia",c=String(e.meta?.giaFileName||s).replace(/[\\/:*?"<>|]/gu,"-").replace(/\.gia$/iu,"").trim()||s.replace(/\.gia$/iu,"");return`${a}-${o}-${r}-\\${c}.gia`}function Yi(e,t,i,n,a,o=!1,r=!1,s=r,c=!1){let l=i.get(e.id),u=(c?[...e.children||[]].reverse():e.children||[]).map(g=>i.get(g.id)),p=o?n:u,m=ul(e,l,o);if(o){let g=e.children?.[0];g&&m.push({empty72:"",field501:62,field502:82,details:oi(l,64,82,{rootChildRef:{guid:i.get(g.id)}})})}else m.push(...hl(e,l,i,a));return{id:Nn(l),relatedIds:p.map(g=>Nn(g)),name:e.name,which:o?21:r?70:15,ui:{content:{guid:l,info:[{guid:{value:l},field501:1,field502:5},...o||s?[{index:{value:ml(e,o)},field501:2,field502:6}]:[],...o||r?[{related:{value:pl(e,a,o?"\u670D\u52A1\u7AEF\u63A7\u4EF6\u6A21\u677F":"\u5BA2\u6237\u7AEF\u63A7\u4EF6\u6A21\u677F")},field501:4,field502:4}]:[]],children:o?[]:u,parent:t&&t.kind!=="server-container"?i.get(t.id):0,data:m}}}}function bl(e,t){let i=new Map;for(let n of e||[]){if(!n.controlId||!(t===Bi?n.controlAsset===Bi:n.controlAsset!==Bi))continue;let o=i.get(n.controlId)||[];o.push(n.guid),i.set(n.controlId,o)}return i}function Ro(e,t,i,n){let a=bl(t,i),o=new Map;K(e.root,r=>{a.has(r.id)&&(o.set(r,r.scriptMappingIds),r.scriptMappingIds=a.get(r.id))});try{return n()}finally{for(let[r,s]of o)s===void 0?delete r.scriptMappingIds:r.scriptMappingIds=s}}function On(e){let t=Number(e.meta?.giaModeFlag);return Number.isSafeInteger(t)&&t>=0?{modeFlag:t}:{}}function zn(e){let t=e.meta?.gameVersion;return!t||t==="7.0.50"?Ti:t}function Mo(e,t,i,n,a=[]){let o=Gt(e,!0),r=o.filter(({parent:f})=>f?.kind==="server-container");if(!r.length)throw new Error("\u5BA2\u6237\u7AEF\u63A7\u4EF6\u6A21\u677F\u5217\u8868\u81F3\u5C11\u9700\u8981\u4E00\u4E2A\u6A21\u677F");let s=new Set(r.map(({node:f})=>f.id)),c=o.filter(({node:f})=>!s.has(f.id)),l=o.map(({node:f})=>t.get(f.id));return Ro(e,a,Bi,()=>({graph:r.map(({node:f,parent:u})=>Yi(f,u,t,l,i,!1,!0,!0,!0)),accessories:c.map(({node:f,parent:u})=>Yi(f,u,t,l,i,!1,!1,!0,!0)),filePath:n||Fn(e,!0),gameVersion:zn(e),...On(e)}))}function No(e,t,i,n,a){let o=Gt(e),r=[o[0],...o.slice(1).reverse()],s=r.map(({node:c})=>t.get(c.id));return Ro(e,i.scripts,rl,()=>({graph:[Yi(e.root,null,t,s,n,!0,!1,!1,!0),...i.units||[]],accessories:r.map(({node:c,parent:l})=>Yi(c,l,t,s,n,!1,!1,!1,!0)),filePath:a||Fn(e,!1),gameVersion:zn(e),...On(e)}))}function Fo(e,t){let i=Dn(e),n=t(i);if(!n.valid)throw new Error(`GIA compatibility validation failed:
|
|
105
108
|
${n.errors.join(`
|
|
106
|
-
`)}`);return i}function
|
|
107
|
-
${
|
|
108
|
-
`)}`);return{buffer:n,warnings:[...new Set(t.warnings)]}}function Mn(e){return Pe.toObject(Pe.decode(Gi(e)),{longs:Number,enums:Number,bytes:Buffer,defaults:!1,arrays:!0,objects:!0})}function Eo(e){try{let i=Mn(e).graph||[];return i.length>0&&i.every(n=>Number(n.which)===pt)}catch{return!1}}function Ao(e){let t=[...e.graph||[],...e.accessories||[]].filter(r=>Number(r.which)===pt),i=[],n=t.map((r,o)=>{let a=r.script?.mapping||{},s=Number(r.id?.id)||0;s<=0&&i.push(`\u7B2C ${o+1} \u6761\u811A\u672C\u6620\u5C04\u7F3A\u5C11 GraphUnit.id.id\uFF0C\u5DF2\u6309 0 \u5904\u7406\uFF08\u5BFC\u51FA\u65F6\u4F1A\u91CD\u65B0\u5206\u914D\uFF09\u3002`);let u=Number(a.id)||0;return u&&u!==s&&i.push(`\u7B2C ${o+1} \u6761\u811A\u672C\u6620\u5C04 id(${u}) \u4E0E\u5355\u5143 id(${s}) \u4E0D\u4E00\u81F4\uFF0C\u4EE5\u5355\u5143 id \u4E3A\u51C6\u3002`),{guid:s,path:String(a.filePath||""),source:String(a.source||"")}});for(let[r,o]of n.entries())o.path&&!/\.lua$/iu.test(o.path)&&i.push(`\u7B2C ${r+1} \u6761\u811A\u672C\u6620\u5C04 file_path \u7F3A\u5C11 .lua \u540E\u7F00\uFF08${o.path}\uFF09\uFF0C\u771F\u673A\u53EF\u80FD\u62D2\u7EDD\u5BFC\u5165\uFF1B\u6A21\u62DF\u5668\u5185\u6309\u5F52\u4E00\u5316\u8DEF\u5F84\u7167\u5E38 require\u3002`);return{scripts:n,warnings:i}}function _o(e){let t=Mn(e),i=Ao(t);if(!i.scripts.length)throw new Error("GIA \u5185\u6CA1\u6709\u811A\u672C\u6620\u5C04\u5355\u5143\uFF08which=69\uFF09");return{scripts:i.scripts,warnings:i.warnings,metadata:{assetType:"lua-script"}}}function tl(e){let t=[],i;try{i=Mn(e)}catch(r){return{valid:!1,errors:[r?.message||String(r)],scriptCount:0}}let n=i.graph||[];return n.length||t.push("Root.graph \u4E3A\u7A7A"),(i.accessories||[]).length&&t.push("script.gia \u4E0D\u5E94\u5305\u542B accessories"),n.forEach((r,o)=>{let a=`\u5355\u5143 ${o+1}`;Number(r.which)!==pt&&t.push(`${a}: which \u5E94\u4E3A 69\uFF0C\u5B9E\u9645 ${r.which}`),Number(r.id?.class)!==xo&&t.push(`${a}: id.class \u5E94\u4E3A 30\uFF0C\u5B9E\u9645 ${r.id?.class}`),Number(r.id?.type??0)!==0&&t.push(`${a}: id.type \u5E94\u7F3A\u7701`);let s=r.script?.mapping;if(!s){t.push(`${a}: \u7F3A\u5C11 field35 ScriptMappingWrapper`);return}Number(r.id?.id)<=0&&t.push(`${a}: GraphUnit.id.id \u975E\u6CD5`),Number(s.id)!==Number(r.id?.id)&&t.push(`${a}: mapping.id \u5E94\u7B49\u4E8E GraphUnit.id.id`),String(s.name||"")!==String(r.name||"")&&t.push(`${a}: mapping.name \u5E94\u7B49\u4E8E GraphUnit.name`),String(s.filePath||"").trim()?/\.lua$/iu.test(String(s.filePath))||t.push(`${a}: file_path \u5E94\u4EE5 .lua \u7ED3\u5C3E\uFF08\u5B98\u65B9 script.gia \u6837\u672C\u5747\u4E3A \u540D\u79F0.lua\uFF0C\u771F\u673A require \u65F6\u624D\u53BB\u6269\u5C55\u540D\uFF09`):t.push(`${a}: file_path \u4E3A\u7A7A`)}),{valid:t.length===0,errors:t,scriptCount:n.length}}function Gi(e){let t=Buffer.isBuffer(e)?e:Buffer.from(e);if(t.length<it+kn)throw new Error("GIA \u6587\u4EF6\u8FC7\u77ED");if(t.readUInt32BE(4)!==1||t.readUInt32BE(8)!==fo||t.readUInt32BE(12)!==3)throw new Error("\u4E0D\u662F\u53D7\u652F\u6301\u7684 GIA v1 \u6587\u4EF6");let i=t.readUInt32BE(16);if(i!==t.length-it-kn)throw new Error("GIA payload \u957F\u5EA6\u4E0D\u4E00\u81F4");if(t.readUInt32BE(it+i)!==ho)throw new Error("GIA \u5C3E\u6807\u8BB0\u65E0\u6548");return t.subarray(it,it+i)}function he(e,t){return e.ui?.content?.data?.find(i=>i.details?.[t])?.details?.[t]||null}function il(e){let t=e.ui?.content?.data?.find(o=>o.field501===66&&o.field502===89||Object.hasOwn(o.details||{},"templateRefSlot")),i=Buffer.from(t?.details?.templateRefSlot||[]),n=i.toString("utf8"),r=Buffer.from(n,"utf8").equals(i)&&!/[\u0000-\u001f\u007f-\u009f]/u.test(n);return{referencedPrefabId:r?n:"",raw:{templateRefSlot:r?n:"",...r?{}:{templateRefSlotBase64:i.toString("base64")},...t?.empty76?.length?{templateRefOuterBase64:Buffer.from(t.empty76).toString("base64")}:{}}}}function nl(e){let t=he(e,"transform")?.multiPlatform,i={};for(let r of t?.platforms||[]){let o=Us[r.platformType||0],a=r.transform||{};i[o]={scale:a.scale?{x:a.scale.x??0,y:a.scale.y??0,z:a.scale.z??0}:{x:1,y:1,z:1},rotation:{x:a.field508?.x??0,y:a.field508?.y??0,z:a.field508?.z??0},anchorMin:{x:a.anchorMin?.x??0,y:a.anchorMin?.y??0},anchorMax:{x:a.anchorMax?.x??0,y:a.anchorMax?.y??0},offset:{x:a.offset?.x??0,y:a.offset?.y??0},size:{x:a.size?.x??0,y:a.size?.y??0},pivot:a.pivot?{x:a.pivot.x??0,y:a.pivot.y??0}:{x:.5,y:.5}}}let n=i.KEYBOARD||i[Object.keys(i)[0]];if(!n)throw new Error(`GIA \u63A7\u4EF6 ${e.name||e.id?.id} \u7F3A\u5C11\u591A\u5E73\u53F0\u53D8\u6362`);for(let r of le)i[r]||(i[r]=structuredClone(n));return i}function $i(e){let t=e.ui?.content?.data||[];return t.some(i=>i.details?.textConfig)?t.some(i=>i.field501===71)?"textwindow":"textbox":t.some(i=>i.details?.cursorConfig)?"cursor":t.some(i=>Object.hasOwn(i.details||{},"templateRefSlot")||i.field501===66&&i.field502===89)?"reference":t.some(i=>i.details?.gridView)?"grid":t.some(i=>i.details?.buttonPreset)?"button":t.some(i=>i.details?.keyHint)?"keyhint":t.some(i=>i.details?.image||i.details?.imageSlot)?"image":t.some(i=>Object.hasOwn(i.details||{},"effectSlot"))?"animation":t.some(i=>Object.hasOwn(i.details||{},"fullscreenEffectSlot"))?"fullscreen":(t.some(i=>Object.hasOwn(i.details||{},"containerNodeSlot")),"container")}function co(e,{reverseSiblings:t=!1,idOffset:i=0}={}){if(!e.length)return{nodes:new Map,rootCandidates:[],warnings:[]};let n=new Map(e.map((l,f)=>[l.id?.id,`n${i+f+1}`])),r=new Map,o=new Map,a=[];for(let l of e){let f=$i(l),d=he(l,"textConfig"),m=he(l,"imageSlot"),p=he(l,"image"),g=he(l,"buttonPreset"),y=he(l,"gridView"),C=he(l,"genericSlot"),x=he(l,"footerSlot"),I=he(l,"cursorConfig"),z=he(l,"keyHint"),F=he(l,"containerNodeSlot"),X=f==="reference"?il(l):null,U=he(l,"effectSlot"),H=he(l,"fullscreenEffectSlot"),G=q(f,{id:n.get(l.id?.id),guid:l.id?.id||0,giaInfoIndex:(l.ui?.content?.info||[]).find(v=>v.field501===2&&v.field502===6)?.index?.value,giaRelatedGuids:(l.ui?.content?.info||[]).find(v=>v.field501===4&&v.field502===4)?.related?.value||[],name:l.name||f,visible:he(l,"field14")?.field17?.initiallyHidden!==!0,active:he(l,"field14")?.initiallyInactive!==!0,canControllerFocus:x?.field505===1,scriptMappingIds:(C?.field502||[]).map(v=>Number(v?.field1?.id)).filter(v=>Number.isSafeInteger(v)&&v>0),transformByPlatform:nl(l),syncAllDevices:he(l,"transform")?.multiPlatform?.field504===1,giaRaw:{genericField501:C?.field501??0,footerField505:x?.field505??0,...f==="textbox"||f==="textwindow"?{textField501:d?.field501??20,textField503:d?.field503??12,textAlign:d?.align??0,...[void 0,0,1,2].includes(d?.verticalAlign)?{}:{textVerticalAlign:d.verticalAlign},...f==="textwindow"?{textField511:d?.field511??1,textViewField502:d?.viewFlags?.field502??1,textViewField503:d?.viewFlags?.field503??1}:{}}:{},...f==="cursor"?{cursorField501:I?.field501??0}:{},...X?.raw||{},...f==="grid"?{gridField501:y?.field501??1,gridField507:y?.field507??1,gridField508:y?.field508??1,gridField509:y?.field509??1,gridField511:y?.field511??5,gridField512:y?.field512??1}:{},...f==="keyhint"?{keyHintField501:z?.field501??1,keyHintField502:z?.field502??1}:{},...f==="image"?{imageSlotType:m?.imageType??0,imageField502:p?.field502??1,imageField504:p?.field504??1,imageField505:p?.field505??1,imageField507:p?.field507??2,imageFillType:p?.fillType??1}:{},...f==="animation"?{effectSlot:U??""}:{},...f==="fullscreen"?{fullscreenEffectSlot:H??""}:{}},...f==="container"?{isolateNavigation:F?.isolateNavigation===!0,disableKeyEventPassthrough:F?.disableKeyEventPassthrough===!0,disableCursorEventPassthrough:F?.disableCursorEventPassthrough===!0,showCursor:F?.showCursor===!0}:{},...f==="cursor"?{raycastTarget:I?.field501===1}:{},...f==="textbox"||f==="textwindow"?{text:d?.text?.value??"",fontSize:d?.fontSize??20,minimumFontSize:d?.minimumFontSize??20,adaptiveFontSize:d?.adaptive===1,fontColor:d?.color??4294967295,bgColor:d?.color2??0,enableOutline:d?.outlineOff!==1,outlineColor:d?.color3??858993459,horizontalAlignment:d?.align===1?"Middle":d?.align===2?"Right":"Left",verticalAlignment:{0:"Top",1:"Middle",2:"Bottom"}[d?.verticalAlign??0]||"Top",...f==="textwindow"?{interactable:!0,showScrollBar:!0}:{}}:{},...f==="image"?{imageSource:"StaticReference",imageId:m?.assetId??0,imageType:m?.imageType===1?"Stretch":"Basic",imageColor:Number.isFinite(m?.field502)?m.field502>>>0:4294967295,enableMask:p?.enableMask===1,enableSoftEdge:p?.enableSoftEdge===1,enableFill:p?.enableFill===1,softEdgeMode:p?.softEdgePixel===1?"Pixel":"Percentage",softEdgeWidthX:p?.border?.field501??8,softEdgeWidthY:p?.border?.field502??8,horizontalSoftRange:p?.field512??85,verticalSoftRange:p?.field513??85,fillType:{1:"Horizontal",2:"Vertical",3:"Radial90",4:"Radial180",5:"Radial360"}[p?.fillType]||"Horizontal",fillAmount:Number.isFinite(p?.field508)?Math.max(0,Math.min(1,p.field508/100)):p?.enableFill===1?0:1,reverseMaskArea:p?.reverseMask===1}:{},...f==="button"?{interactable:g?.interactable===1,raycastTarget:g?.raycastTarget===1,clickAudioId:g?.clickAudioId??50888}:{},...f==="grid"?{cellSizeX:y?.cellSize?.field501??50,cellSizeY:y?.cellSize?.field502??50,spacingX:y?.gap?.field501??8,spacingY:y?.gap?.field502??8,padding1X:y?.padding1?.field501??20,padding1Y:y?.padding1?.field502??20,padding2X:y?.padding2?.field501??20,padding2Y:y?.padding2?.field502??20,previewCount:y?.field511??5}:{},...X?{referencedPrefabId:X.referencedPrefabId}:{},...f==="keyhint"?{keyboardKeyCode:z?.field502??null,controllerKeyCode:z?.field501??null}:{},...f==="animation"?{animationId:U??""}:{},...f==="fullscreen"?{animationId:H??""}:{}});r.set(l.id?.id,G),(X?.raw.templateRefSlotBase64||X?.raw.templateRefOuterBase64)&&a.push(`${G.name}: \u6A21\u677F\u5F15\u7528\u914D\u7F6E\u542B\u5C1A\u672A\u89E3\u6790\u7684\u4E8C\u8FDB\u5236\u5B57\u6BB5\uFF0C\u5DF2\u539F\u6837\u4FDD\u5B58\uFF1B\u5F15\u7528\u76EE\u6807\u672A\u63A8\u65AD\uFF0C\u9884\u89C8\u4E0D\u4F1A\u81EA\u52A8\u5C55\u5F00\u3002`),(f==="textbox"||f==="textwindow")&&![void 0,0,1,2].includes(d?.align)&&a.push(`${G.name}: \u6C34\u5E73\u5BF9\u9F50\u679A\u4E3E ${d.align} \u7684\u542B\u4E49\u672A\u77E5\uFF0C\u5DF2\u539F\u6837\u4FDD\u7559\u3002`),(f==="textbox"||f==="textwindow")&&![void 0,0,1,2].includes(d?.verticalAlign)&&a.push(`${G.name}: \u5782\u76F4\u5BF9\u9F50\u679A\u4E3E ${d.verticalAlign} \u7684\u542B\u4E49\u672A\u77E5\uFF0C\u5DF2\u539F\u6837\u4FDD\u7559\u3002`),f==="image"&&![void 0,0,1,2,3,4,5].includes(p?.fillType)&&a.push(`${G.name}: \u586B\u5145\u5F62\u72B6\u679A\u4E3E ${p.fillType} \u672A\u8BC6\u522B\uFF0C\u5DF2\u4FDD\u7559\u539F\u503C\u3002`),f==="button"&&o.set(G.id,{unavailableChildId:g?.disabledChild,hoverChildId:g?.hoverChild,pressedChildId:g?.pressedChild,selectedChildId:g?.selectedChild})}let s=[],u=new Set;for(let l of e){let f=r.get(l.id?.id),d=(l.ui?.content?.children||[]).map(m=>r.get(m)).filter(Boolean);if(d.length){f.children=t?d.slice().reverse():d;for(let m of d)u.add(m.id)}}for(let l of e){let f=r.get(l.id?.id),d=l.ui?.content?.parent||0,m=r.get(d);m?u.has(f.id)||(t?m.children.unshift(f):m.children.push(f)):s.push(f)}for(let[l,f]of o){let d=[...r.values()].find(m=>m.id===l);for(let[m,p]of Object.entries(f))d[m]=n.get(p)||null}return{nodes:r,rootCandidates:s,warnings:a}}function To(e){let t=Gi(e),i=Pe.toObject(Pe.decode(t),{longs:Number,enums:Number,bytes:Buffer,defaults:!1,arrays:!0,objects:!0}),n=[...i.graph||[],...i.accessories||[]],r=x=>!!x.ui?.content&&[15,21,70].includes(Number(x.which)),o=(i.graph||[]).filter(r);if(!o.some(x=>x.ui?.content))throw new Error("GIA \u4E0D\u542B\u53EF\u8BC6\u522B\u7684 UIControlGroup \u4E3B\u56FE");let a=o.find(x=>x.which===21)||null,s=o.filter(x=>Number(x.which)===70),u=(i.accessories||[]).filter(r),l=new Set((a?.relatedIds||[]).map(x=>x.id||0)),f=a?l.size?u.filter(x=>l.has(x.id?.id||0)):u:[],d=s.length?[...s,...u.filter(x=>!l.has(x.id?.id||0))]:a?[]:[...o,...u];if(!f.length&&!d.length)throw new Error("GIA \u4E0D\u542B\u5BA2\u6237\u7AEF\u63A7\u4EF6");let m=["GIA \u5BFC\u5165\u4E3A\u5DF2\u9A8C\u8BC1 UI \u5B57\u6BB5\u7684\u8BED\u4E49\u5BFC\u5165\uFF1B\u672A\u77E5 protobuf \u5B57\u6BB5\u4E0D\u4F1A\u8FDB\u5165 Authoring JSON\u3002"],p=n.filter(x=>!r(x)&&Number(x.which)!==pt);p.length&&m.push(`\u8DF3\u8FC7 ${p.length} \u4E2A\u975E UI / \u975E\u811A\u672C\u4F9D\u8D56\u5355\u5143\uFF1B\u8FD9\u4E9B\u8D44\u6E90\u4E0D\u4F1A\u8FDB\u5165\u5B58\u6863\u6216\u91CD\u65B0\u5BFC\u51FA\u3002`);let g=Ao(i);m.push(...g.warnings);let y=null,C=null;if(f.length){let x=co(f,{reverseSiblings:!0,idOffset:0});m.push(...x.warnings);let I=x.rootCandidates.find(F=>F.kind==="container")||x.rootCandidates[0];if(!I)throw new Error("GIA \u672A\u627E\u5230\u5BA2\u6237\u7AEF\u6839\u63A7\u4EF6");let z=q("server-container",{id:"sc1",guid:a?.id?.id||0,name:a?.name||"\u5BA2\u6237\u7AEF\u63A7\u4EF6\u5BB9\u5668",giaRelatedGuids:(a?.ui?.content?.info||[]).find(F=>F.field501===4&&F.field502===4)?.related?.value||[]});z.children=[I],x.rootCandidates.length>1&&m.push(`\u68C0\u6D4B\u5230 ${x.rootCandidates.length} \u4E2A\u65E0\u7236\u8282\u70B9\u63A7\u4EF6\uFF0C\u4EC5\u5BFC\u5165\u4EE5\u201C${I.name}\u201D\u4E3A\u6839\u7684\u6811\u3002`),y={version:1,layoutSchemaVersion:be,meta:{name:a?.name||"\u5BFC\u5165\u7684\u754C\u9762\u63A7\u4EF6\u7EC4",assetType:"server-control-template",sourceFormat:"gia",sourceFile:"",gameVersion:i.gameVersion||"",giaFilePath:i.filePath||"",...Number.isSafeInteger(Number(i.modeFlag))?{giaModeFlag:Number(i.modeFlag)}:{}},canvasId:"pc-16-9",selectedId:I.id,script:{controlId:I.id,path:"",source:""},root:z}}if(d.length){let x=co(d,{reverseSiblings:!1,idOffset:1e3});if(m.push(...x.warnings),!x.rootCandidates.length)throw new Error("GIA \u672A\u627E\u5230\u5BA2\u6237\u7AEF\u6A21\u677F");let I=q("server-container",{id:"sc1",guid:0,name:"\u5BA2\u6237\u7AEF\u63A7\u4EF6\u6A21\u677F"});I.children=x.rootCandidates,C={version:1,layoutSchemaVersion:be,meta:{name:x.rootCandidates.length===1?x.rootCandidates[0].name:"\u5BA2\u6237\u7AEF\u63A7\u4EF6\u6A21\u677F\u5217\u8868",assetType:"client-control-template",sourceFormat:"gia",sourceFile:"",gameVersion:i.gameVersion||"",giaFilePath:i.filePath||"",...Number.isSafeInteger(Number(i.modeFlag))?{giaModeFlag:Number(i.modeFlag)}:{}},canvasId:"pc-16-9",selectedId:x.rootCandidates[0].id,script:{controlId:x.rootCandidates[0].id,path:"",source:""},root:I},Xe(C,{warnings:m});for(let z of x.rootCandidates)ee(z,F=>F.children.reverse());y||(y=C)}return{project:y,clientProject:C&&y!==C?C:void 0,scripts:g.scripts,warnings:m,metadata:{gameVersion:i.gameVersion||"",filePath:i.filePath||"",...Number.isSafeInteger(Number(i.modeFlag))?{modeFlag:Number(i.modeFlag)}:{},combined:!!(a&&s.length)}}}function Nn(e){let t=Gi(e),i=Pe.toObject(Pe.decode(t),{longs:Number,enums:Number,defaults:!1,arrays:!0,objects:!0}),n=i.graph||[],r=i.accessories||[],o=[],a=(p,g)=>p!=null&&Object.prototype.hasOwnProperty.call(p,g),s=new Map,u=[];/^\d+-\d+-\d+-\\.+\.gia$/iu.test(i.filePath||"")||o.push(`Root.filePath \u4E0D\u662F UID-TIME-ID-\\\u6587\u4EF6\u540D.gia\uFF1A${i.filePath||"<missing>"}`);let l=n.filter(p=>p.which===70).map(p=>{let g=$i(p),y=p.ui?.content?.info||[],C=y.find(z=>z.field501===2&&z.field502===6)?.index?.value,x=y.find(z=>z.field501===4&&z.field502===4),I=x?.related?.value||[];return Ce(C)||o.push(`${p.name}: Info.index=${C??"<missing>"}\uFF0C\u5FC5\u987B\u662F\u6B63\u6574\u6570`),x||o.push(`${p.name}: \u9876\u5C42 UIControlTemplate \u7F3A\u5C11 Info.related \u8BB0\u5F55`),{id:p.id?.id||0,name:p.name||"",kind:g,actualIndex:C,relatedPresent:!!x,relatedGuids:I}}),f=new Map;for(let p of l){if(!Ce(p.actualIndex))continue;let g=f.get(p.actualIndex);g?o.push(`${p.name}: \u72EC\u7ACB\u6A21\u677F\u8D44\u4EA7\u7F16\u53F7 ${p.actualIndex} \u4E0E ${g.name} \u91CD\u590D`):f.set(p.actualIndex,p)}l.length||o.push("Root.graph \u4E0D\u542B UIControlTemplate(70)");let d=0,m=0;for(let p of[...n,...r]){if(!p.ui?.content)continue;let g=p.id?.id||0,y=p.ui.content,C=$i(p),x=n.includes(p)&&p.which===70,I=`${p.name||"<unnamed>"}(${g||"<missing-guid>"})`;!Number.isSafeInteger(g)||g<=0||g>2147483647?o.push(`${I}: GraphUnit GUID \u975E\u6CD5`):s.has(g)?o.push(`${I}: GUID \u4E0E ${s.get(g).name||"<unnamed>"} \u91CD\u590D`):s.set(g,p),(p.id?.class!==1||p.id?.type!==8)&&o.push(`${I}: GraphUnit.id \u5FC5\u987B\u4E3A class=1,type=8`),y.guid!==g&&o.push(`${I}: content.guid=${y.guid??"<missing>"} \u4E0E GraphUnit.id.id \u4E0D\u4E00\u81F4`),x&&p.which!==70&&o.push(`${I}: \u6A21\u677F\u6839 which \u5FC5\u987B\u4E3A UIControlTemplate(70)`),!x&&p.which!==15&&o.push(`${I}: \u9644\u4EF6\u63A7\u4EF6 which \u5FC5\u987B\u4E3A UIControl(15)`);let z=y.info||[],F=z.find(_=>_.field501===1&&_.field502===5),X=z.find(_=>_.field501===2&&_.field502===6);F?.guid?.value!==g&&o.push(`${I}: Info.self GUID \u7F3A\u5931\u6216\u4E0E\u81EA\u8EAB\u4E0D\u4E00\u81F4`),Ce(X?.index?.value)||o.push(`${I}: Info.index=${X?.index?.value??"<missing>"}\uFF0C\u5FC5\u987B\u662F\u6B63\u6574\u6570`);let U=z.find(_=>_.field501===4&&_.field502===4);x&&!U&&o.push(`${I}: \u9876\u5C42\u6A21\u677F\u7F3A\u5C11 Info.related \u8BB0\u5F55`),!x&&U&&o.push(`${I}: \u9644\u4EF6\u63A7\u4EF6\u4E0D\u5E94\u5199 Info.related`);let H=po[C],G=y.data||[],v=G.map(_=>`${_.field501}/${_.field502}`),A=H?.map(([_])=>_)||[];H?JSON.stringify(v)!==JSON.stringify(A)&&o.push(`${I}: Data \u69FD\u4F4D\u987A\u5E8F ${v.join(",")}\uFF0C\u5E94\u4E3A ${A.join(",")}`):o.push(`${I}: \u672A\u77E5\u5BA2\u6237\u7AEF\u63A7\u4EF6\u7C7B\u578B ${C}`);for(let _=0;_<Math.min(G.length,H?.length||0);_+=1){let D=G[_],[Y,ue,K]=H[_];if(a(D,ue)||o.push(`${I}: Data ${Y} \u7F3A\u5C11 ${ue} \u5206\u652F`),!K)continue;a(D.details,K)||o.push(`${I}: Details ${Y} \u7F3A\u5C11 ${K} \u5206\u652F`);let we=go[Y];(D.details?.field501!==we||D.details?.field502!==D.field502||D.details?.field503!==1)&&o.push(`${I}: Details ${Y} \u6807\u8BB0\u5E94\u4E3A ${we}/${D.field502}/1`);let Ee=D.details?.nodeRef;(Ee?.class!==1||Ee?.type!==8||Ee?.id!==g)&&o.push(`${I}: Details ${Y} node_ref \u672A\u6307\u5411\u81EA\u8EAB`)}let w=(p.ui.content.data||[]).find(_=>_.field501===4&&_.field502===86);w&&(a(w.field14,"field17")?d+=1:o.push(`${I}: \u7C7B\u578B Data \u7F3A\u5C11\u663E\u5F0F Field14.field17 \u7A7A\u4E32`),a(w.details?.field14,"field17")?d+=1:o.push(`${I}: \u7C7B\u578B Details \u7F3A\u5C11\u663E\u5F0F Field14.field17 \u7A7A\u4E32`));let k=(p.ui.content.data||[]).find(_=>_.details?.transform)?.details?.transform?.multiPlatform?.platforms||[];k.length!==4&&o.push(`${I}: \u591A\u5E73\u53F0\u53D8\u6362\u6570\u91CF=${k.length}\uFF0C\u5E94\u4E3A 4`);let $=k.map(_=>_.platformType||0);JSON.stringify($)!==JSON.stringify([0,1,2,3])&&o.push(`${I}: \u5E73\u53F0\u987A\u5E8F ${$.join(",")}\uFF0C\u5E94\u4E3A 0,1,2,3`);let E=(p.ui.content.data||[]).find(_=>_.details?.transform)?.details?.transform;E?.multiPlatform?.field502!==ii[C]&&o.push(`${I}: \u53D8\u6362 preset=${E?.multiPlatform?.field502??"<missing>"}\uFF0C${C} \u5E94\u4E3A ${ii[C]}`);for(let _ of k)a(_.transform,"field508")?m+=1:o.push(`${I}: RectTransform \u7F3A\u5C11\u663E\u5F0F field508 \u7A7A\u4E32`);u.push({id:g,name:p.name||"",kind:C,template:x,parent:y.parent||0,children:[...y.children||[]],relatedIds:(p.relatedIds||[]).map(_=>_.id||0),dataSignatures:v})}for(let p of u){let g=`${p.name||"<unnamed>"}(${p.id})`;if(JSON.stringify(p.relatedIds)!==JSON.stringify(p.children)&&o.push(`${g}: GraphUnit.relatedIds \u4E0E content.children \u4E0D\u4E00\u81F4`),p.template&&p.parent&&o.push(`${g}: \u9876\u5C42\u6A21\u677F\u4E0D\u5E94\u6709 parent`),!p.template){let y=s.get(p.parent);y?(y.ui?.content?.children||[]).includes(p.id)||o.push(`${g}: \u7236\u63A7\u4EF6 children \u672A\u53CD\u5411\u5305\u542B\u81EA\u8EAB`):o.push(`${g}: parent=${p.parent||"<missing>"} \u4E0D\u5B58\u5728`)}for(let y of p.children){let C=s.get(y);C?(C.ui?.content?.parent||0)!==p.id&&o.push(`${g}: child=${y} \u7684 parent \u672A\u6307\u56DE\u81EA\u8EAB`):o.push(`${g}: child=${y} \u4E0D\u5B58\u5728`)}}return{valid:o.length===0,errors:o,filePath:i.filePath||"",gameVersion:i.gameVersion||"",templateCount:l.length,accessoryCount:r.length,templates:l,units:u,explicitEmpty:{field17:d,rectField508:m}}}function Fn(e){let t=Gi(e),i=Pe.toObject(Pe.decode(t),{longs:Number,enums:Number,defaults:!1,arrays:!0,objects:!0}),n=(i.graph||[]).filter(E=>E.ui?.content&&Number(E.which)===21),r=(i.graph||[]).filter(E=>Number(E.which)===70),o=(i.graph||[]).filter(E=>Number(E.which)===pt),a=(i.accessories||[]).filter(E=>E.ui?.content),s=[],u=(E,_)=>E!=null&&Object.prototype.hasOwnProperty.call(E,_);/^\d+-\d+-\d+-\\.+\.gia$/iu.test(i.filePath||"")||s.push(`Root.filePath \u4E0D\u662F UID-TIME-ID-\\\u6587\u4EF6\u540D.gia\uFF1A${i.filePath||"<missing>"}`),n.length!==1&&s.push(`\u670D\u52A1\u7AEF\u63A7\u4EF6\u6A21\u677F UIControlGroup \u6570\u91CF=${n.length}\uFF0C\u5E94\u4E3A 1`);let l=(i.graph||[]).filter(E=>{let _=Number(E.which);return _===pt||_===70||_===21?!1:!E.ui?.content});l.length&&s.push(`Root.graph \u542B ${l.length} \u4E2A\u65E0\u6CD5\u8BC6\u522B\u7684\u975E\u63A7\u4EF6/\u975E\u811A\u672C\u5355\u5143`);let f=n[0];if(!f)return{valid:!1,errors:s,filePath:i.filePath||"",gameVersion:i.gameVersion||"",accessoryCount:a.length,controls:[],scriptCount:o.length,explicitEmpty:{field17:0,rectField508:0}};let d=[f,...r,...a],m=new Map;for(let E of d){let _=E.id?.id||0,D=`${E.name||"<unnamed>"}(${_||"<missing-guid>"})`;!Number.isSafeInteger(_)||_<=0||_>2147483647?s.push(`${D}: GraphUnit GUID \u975E\u6CD5`):m.has(_)?s.push(`${D}: GUID \u91CD\u590D`):m.set(_,E),(E.id?.class!==1||E.id?.type!==8)&&s.push(`${D}: GraphUnit.id \u5FC5\u987B\u4E3A class=1,type=8`),E.ui?.content?.guid!==_&&s.push(`${D}: content.guid \u4E0E GraphUnit.id.id \u4E0D\u4E00\u81F4`)}let p=f.id?.id||0,g=f.ui.content,y=`${f.name||"<unnamed>"}(${p})`;f.which!==21&&s.push(`${y}: which \u5FC5\u987B\u4E3A UIControlGroup(21)`);let C=g.info||[];C.find(E=>E.field501===1&&E.field502===5)?.guid?.value!==p&&s.push(`${y}: Info.self GUID \u7F3A\u5931\u6216\u4E0D\u4E00\u81F4`),C.find(E=>E.field501===2&&E.field502===6)?.index?.value!==1&&s.push(`${y}: Info.index \u5FC5\u987B\u4E3A 1`);let x=C.find(E=>E.field501===4&&E.field502===4);x||s.push(`${y}: \u7F3A\u5C11\u663E\u5F0F Info.related \u8BB0\u5F55`);let I=0,z=0,F=(E,_,D,Y=!1)=>{let ue=E.id?.id||0,K=`${E.name||"<unnamed>"}(${ue})`,we=E.ui.content.data||[],Ee=we.map(ne=>`${ne.field501}/${ne.field502}`),kt=D.map(([ne])=>ne);JSON.stringify(Ee)!==JSON.stringify(kt)&&s.push(`${K}: Data \u69FD\u4F4D\u987A\u5E8F ${Ee.join(",")}\uFF0C\u5E94\u4E3A ${kt.join(",")}`);for(let ne=0;ne<Math.min(we.length,D.length);ne+=1){let Fe=we[ne],[De,Ht,jt]=D[ne];if(u(Fe,Ht)||s.push(`${K}: Data ${De} \u7F3A\u5C11 ${Ht} \u5206\u652F`),!jt)continue;u(Fe.details,jt)||s.push(`${K}: Details ${De} \u7F3A\u5C11 ${jt} \u5206\u652F`);let Le=go[De];(Fe.details?.field501!==Le||Fe.details?.field502!==Fe.field502||Fe.details?.field503!==1)&&s.push(`${K}: Details ${De} \u6807\u8BB0\u5E94\u4E3A ${Le}/${Fe.field502}/1`);let Kt=Fe.details?.nodeRef;(Kt?.class!==1||Kt?.type!==8||Kt?.id!==ue)&&s.push(`${K}: Details ${De} node_ref \u672A\u6307\u5411\u81EA\u8EAB`)}let Ut=we.find(ne=>ne.field501===4&&ne.field502===(Y?23:86)),te=Y?"empty15":"field17";u(Ut?.field14,te)?Y||(I+=1):s.push(`${K}: \u7C7B\u578B Data \u7F3A\u5C11\u663E\u5F0F Field14.${te} \u7A7A\u4E32`),u(Ut?.details?.field14,te)?Y||(I+=1):s.push(`${K}: \u7C7B\u578B Details \u7F3A\u5C11\u663E\u5F0F Field14.${te} \u7A7A\u4E32`);let Ne=we.find(ne=>ne.details?.transform)?.details?.transform,st=Ne?.multiPlatform?.platforms||[];st.length!==4&&s.push(`${K}: \u591A\u5E73\u53F0\u53D8\u6362\u6570\u91CF=${st.length}\uFF0C\u5E94\u4E3A 4`);let wi=st.map(ne=>ne.platformType||0);JSON.stringify(wi)!==JSON.stringify([0,1,2,3])&&s.push(`${K}: \u5E73\u53F0\u987A\u5E8F ${wi.join(",")}\uFF0C\u5E94\u4E3A 0,1,2,3`);let Ii=Y?ii["server-container"]:ii[_];Ne?.multiPlatform?.field502!==Ii&&s.push(`${K}: \u53D8\u6362 preset=${Ne?.multiPlatform?.field502??"<missing>"}\uFF0C\u5E94\u4E3A ${Ii}`);for(let ne of st)u(ne.transform,"field508")?z+=1:s.push(`${K}: RectTransform \u7F3A\u5C11\u663E\u5F0F field508 \u7A7A\u4E32`);return Ee};F(f,"server-container",Hs,!0);let X=(f.relatedIds||[]).map(E=>E.id||0),U=new Set(X),H=a.filter(E=>U.has(E.id?.id||0)),G=H.map(E=>E.id?.id||0);JSON.stringify(X)!==JSON.stringify(G)&&s.push(`${y}: \u4E3B\u56FE relatedIds \u5FC5\u987B\u6309\u987A\u5E8F\u8986\u76D6\u672C\u7EC4 accessories`);let v=g.data?.find(E=>E.details?.rootChildRef)?.details?.rootChildRef?.guid||0,A=m.get(v);(!A||!H.includes(A))&&s.push(`${y}: 62/82 \u6839\u8282\u70B9\u5F15\u7528\u4E0D\u5B58\u5728`),G[0]!==v&&s.push(`${y}: \u6839\u5BB9\u5668\u8282\u70B9\u5FC5\u987B\u662F\u672C\u7EC4 accessories[0]`);let w=[];for(let E of H){let _=E.id?.id||0,D=E.ui.content,Y=`${E.name||"<unnamed>"}(${_})`,ue=$i(E);E.which!==15&&s.push(`${Y}: which \u5FC5\u987B\u4E3A UIControl(15)`);let K=D.info||[];(K.length!==1||K[0]?.field501!==1||K[0]?.field502!==5||K[0]?.guid?.value!==_)&&s.push(`${Y}: \u670D\u52A1\u7AEF\u5BB9\u5668\u5185\u63A7\u4EF6 Info \u5FC5\u987B\u53EA\u542B\u81EA\u8EAB GUID`);let we=po[ue];we||s.push(`${Y}: \u672A\u77E5\u5BA2\u6237\u7AEF\u63A7\u4EF6\u7C7B\u578B ${ue}`);let Ee=we?F(E,ue,we):[];w.push({id:_,name:E.name||"",kind:ue,parent:D.parent||0,children:[...D.children||[]],relatedIds:(E.relatedIds||[]).map(kt=>kt.id||0),dataSignatures:Ee})}let k=w.find(E=>E.id===v);k&&(k.kind!=="container"&&s.push(`${k.name}(${v}): \u6839\u63A7\u4EF6\u5FC5\u987B\u4E3A\u5BB9\u5668\u8282\u70B9`),k.parent&&s.push(`${k.name}(${v}): \u6839\u63A7\u4EF6\u4E0D\u5E94\u6709 parent`));let $=new Map(w.map(E=>[E.id,E]));for(let E of w){let _=`${E.name}(${E.id})`;if(JSON.stringify(E.relatedIds)!==JSON.stringify(E.children)&&s.push(`${_}: relatedIds \u5FC5\u987B\u4E0E\u76F4\u63A5 children \u4E00\u81F4`),E.id!==v){let D=$.get(E.parent);D?D.children.includes(E.id)||s.push(`${_}: \u7236\u63A7\u4EF6 children \u672A\u53CD\u5411\u5305\u542B\u81EA\u8EAB`):s.push(`${_}: parent=${E.parent||"<missing>"} \u4E0D\u5B58\u5728`)}for(let D of E.children){let Y=$.get(D);Y?Y.parent!==E.id&&s.push(`${_}: child=${D} \u7684 parent \u672A\u6307\u56DE\u81EA\u8EAB`):s.push(`${_}: child=${D} \u4E0D\u5B58\u5728`)}}if(r.length){let E=Nn(Pn({...i,graph:r,accessories:a.filter(_=>!U.has(_.id?.id||0))}));s.push(...E.errors.map(_=>`\u5BA2\u6237\u7AEF\u6A21\u677F: ${_}`))}return{valid:s.length===0,errors:s,filePath:i.filePath||"",gameVersion:i.gameVersion||"",graph:{id:p,name:f.name||"",relatedGuids:x?.related?.value||[],rootGuid:v},accessoryCount:a.length,controls:w,scriptCount:o.length,explicitEmpty:{field17:I,rectField508:z}}}function Po(e,t=[]){if(!e||e.layoutSchemaVersion===be)return e;if(e.layoutSchemaVersion!==void 0&&e.layoutSchemaVersion!==1)throw new Error(`\u4EC5\u652F\u6301 layoutSchemaVersion=2 \u6216\u53EF\u8FC1\u79FB\u7684\u65E7\u5E03\u5C40\uFF0C\u6536\u5230 ${e.layoutSchemaVersion}`);if(!e.root)return{...e,layoutSchemaVersion:be};let i=structuredClone(e),n=0;return ee(i.root,r=>{let o=r.transformByPlatform||{},a=r.transformByCanvas||{},s=r.name||r.id;for(let l of Object.keys(o))if(!le.includes(l))throw new Error(`${s}: unknown platform ${l}`);let u={};for(let l of le){let f=Et[l],d=ie[f].platform,m=Object.keys(ie).filter(C=>ie[C].platform===d&&a[C]),p=a[f]?f:m[0],g=l==="CONTROLLER_CONSOLE"?u.KEYBOARD:l==="CONTROLLER_MOBILE"?u.TOUCHSCREEN:null,y=o[l]??g??(p?a[p]:null);if(u[l]=y?ze(y):gn(r.kind),y||t.push(`${s}: ${l} \u65E0\u65E7\u5E03\u5C40\uFF0C\u5DF2\u4F7F\u7528\u63A7\u4EF6\u9ED8\u8BA4\u503C`),!o[l]&&!g&&p&&p!==f&&t.push(`${s}: \u7F3A\u5C11 ${f}\uFF0C\u5DF2\u91C7\u7528 ${p} \u7684\u951A\u70B9\u548C\u5C3A\u5BF8\u53C2\u6570`),!g)for(let C of m)JSON.stringify(u[l])!==JSON.stringify(ze(a[C]))&&t.push(`${s}: ${C} \u4E0E ${l} \u5E03\u5C40\u51B2\u7A81\uFF0C\u4FDD\u7559${o[l]?"\u5DF2\u6709\u5E73\u53F0":p}\u53C2\u6570`)}Je(u,`${s}.transformByPlatform`),r.transformByPlatform=u,delete r.transformByCanvas,n++}),i.layoutSchemaVersion=be,t.unshift(`\u5DF2\u81EA\u52A8\u8FC1\u79FB\u65E7\u5E03\u5C40\uFF1A${n} \u4E2A\u63A7\u4EF6\u8F6C\u6362\u4E3A\u56DB\u5E73\u53F0\u53C2\u6570\uFF1B\u518D\u6B21\u4FDD\u5B58\u5C06\u4F7F\u7528\u65B0\u7248\u683C\u5F0F`),i}function On(e){if(![1,2,3,4].includes(e))throw new Error(`\u4EC5\u652F\u6301 version=1\u20134 \u7684\u5B58\u6863\uFF0C\u6536\u5230 ${e}`)}function $n(e,t,i,n=e.canvasId){let r=Ze(e.root,t);return!r||r.kind==="server-container"?ve(n):i[r.id]||ve(n)}function nt(e,{warnings:t=[]}={}){if(!e)return ht();if(e=Po(e,t),(e.root||e.layoutSchemaVersion!==void 0)&&e.layoutSchemaVersion!==be)throw new Error(`\u4EC5\u652F\u6301 layoutSchemaVersion=${be} \u7684\u56DB\u5E73\u53F0\u5E03\u5C40\uFF0C\u4E0D\u652F\u6301\u65E7\u753B\u5E03\u5E03\u5C40\u6216\u5176\u4ED6\u7248\u672C`);let i=e.meta?.assetType==="client-control-template"?"client-control-template":"server-control-template",n=i==="client-control-template"?Nt():ht(),r={layoutSchemaVersion:be,version:Number.isSafeInteger(e.version)&&e.version>0?e.version:1,meta:{name:String(e.meta?.name||n.meta.name),assetType:i,sourceFormat:String(e.meta?.sourceFormat||n.meta.sourceFormat),sourceFile:String(e.meta?.sourceFile||""),...e.meta?.gameVersion?{gameVersion:String(e.meta.gameVersion)}:{},...e.meta?.giaFilePath?{giaFilePath:String(e.meta.giaFilePath)}:{},...Number.isSafeInteger(Number(e.meta?.giaOwnerUid))?{giaOwnerUid:Number(e.meta.giaOwnerUid)}:{},...Number.isSafeInteger(Number(e.meta?.giaTimestamp))?{giaTimestamp:Number(e.meta.giaTimestamp)}:{},...Number.isSafeInteger(Number(e.meta?.giaFileId))?{giaFileId:Number(e.meta.giaFileId)}:{},...e.meta?.giaFileName?{giaFileName:String(e.meta.giaFileName)}:{},...Number.isSafeInteger(e.meta?.giaNextAssetIndex)&&e.meta.giaNextAssetIndex>=2?{giaNextAssetIndex:e.meta.giaNextAssetIndex}:{},...Number.isSafeInteger(e.meta?.giaAssetIndexSchemaVersion)&&e.meta.giaAssetIndexSchemaVersion>0?{giaAssetIndexSchemaVersion:e.meta.giaAssetIndexSchemaVersion}:{},...Number.isSafeInteger(Number(e.meta?.giaModeFlag))&&Number(e.meta.giaModeFlag)>=0?{giaModeFlag:Number(e.meta.giaModeFlag)}:{}},canvasId:e.canvasId&&ie[e.canvasId]?e.canvasId:ki,selectedId:e.selectedId||n.selectedId,root:vn(e.root||n.root)};return Oo(r),Xe(r,{warnings:t}),r}function Oo(e){let t=new Set;ee(e.root,i=>{if(typeof i.id!="string"||!i.id)throw new Error("node id must be a non-empty string");if(t.has(i.id))throw new Error(`duplicate node id: ${i.id}`);t.add(i.id)}),t.has(e.selectedId)||(e.selectedId=bn(e.root).id)}function Ro(e){return Qe(Mt(e))}function rl(e,t){let i=!1;return ee(e,n=>{n.id===t&&(i=!0)}),i}function ol(e,t,i,n){let o=tt(e.root,e.canvasId).boxes[t.id],a=i.children.findIndex(d=>d.id===t.id);if(a<0)throw new Error("reparent: source node is not attached");if(i.children.splice(a,1),n.children.push(t),!o)return;let s=tt(e.root,e.canvasId),u=n.kind==="server-container"?ve(e.canvasId):s.boxes[n.id]||ve(e.canvasId),l=et(t.transformByPlatform,e.canvasId),f=ut(u,l,{posX:o.centerX,posY:o.centerY,width:o.width,height:o.height});Ot(e,t,f)}function al(e,t){return e.meta.assetType!=="client-control-template"?Cn(e.root,t):(e.root.children||[]).flatMap(i=>Cn(i,t))}function zo(e,t){let i=so(e.root,t);if(e.meta.assetType!=="client-control-template")return i;let n=ei(e),r=new Set;return n&&n.kind!=="server-container"&&ee(n,o=>r.add(o.id)),i.filter(o=>r.has(o.id))}function $o(e){let{canvas:t,boxes:i}=tt(e.root,e.canvasId),n=ri(e),r=de(e.root,e.selectedId),o=r?i[r.id]:null;return V({layoutSchemaVersion:be,version:e.version,meta:{...e.meta},canvasId:e.canvasId,canvas:{id:e.canvasId,width:t.width,height:t.height,platform:ie[e.canvasId].platform,label:ie[e.canvasId].label,presets:Object.values(ie).map(a=>({id:a.id,label:a.label,width:a.width,height:a.height,platform:a.platform}))},selectedId:e.selectedId,asset:{type:e.meta.assetType,label:e.meta.assetType==="client-control-template"?"\u5BA2\u6237\u7AEF\u63A7\u4EF6\u6A21\u677F":"\u670D\u52A1\u7AEF\u63A7\u4EF6\u6A21\u677F",templateCount:e.meta.assetType==="client-control-template"?e.root.children.length:1,currentTemplateId:e.meta.assetType==="client-control-template"&&ei(e)?.id||""},tree:al(e,n),boxes:zo(e,i),inspector:lo(r,e.canvasId,o||t,n),root:e.root})}function Ot(e,t,i){let n=tt(e.root,e.canvasId),r=$n(e,t.id,n.boxes),o={};if(t.syncAllDevices!==!1)for(let a of le){if(a===ct(e.canvasId))continue;let s=Et[a],u=tt(e.root,s,a);o[a]=$n(e,t.id,u.boxes,s)}t.transformByPlatform=Kr({transformByPlatform:t.transformByPlatform,source:i,canvasId:e.canvasId,syncAllDevices:t.syncAllDevices!==!1,sourceParentBox:r,targetParentBoxByPlatform:o})}var sl=new Set(["name","active","visible","canControllerFocus","isolateNavigation","disableKeyEventPassthrough","disableCursorEventPassthrough","showCursor","fontSize","adaptiveFontSize","minimumFontSize","fontColor","bgColor","enableOutline","outlineColor","horizontalAlignment","verticalAlignment","text","imageSource","imageType","imageId","imageColor","enableMask","enableSoftEdge","softEdgeMode","softEdgeWidthX","softEdgeWidthY","horizontalSoftRange","verticalSoftRange","enableFill","fillType","fillHorizontalType","fillVerticalType","fillRadial90Type","fillRadialType","fillAmount","reverseMaskArea","raycastTarget","interactable","clickAudioId","unavailableChildId","hoverChildId","pressedChildId","selectedChildId","showScrollBar","cellSizeX","cellSizeY","spacingX","spacingY","padding1X","padding1Y","padding2X","padding2Y","previewCount","scrollDirection","layoutConstraint","referencedPrefabId","animationId","keyboardKeyCode","controllerKeyCode","itemPrefabId","layoutConstraintFixedCount"]),ll=new Set(["posX","posY","width","height"]),ul=new Set(["anchorMinX","anchorMinY","anchorMaxX","anchorMaxY","pivotX","pivotY"]);function cl(e){if(typeof e=="number"&&Number.isFinite(e))return e>>>0;if(typeof e=="string"){let t=e.trim();if(t.startsWith("#")){let n=t.slice(1);if(n.length===6)return(4278190080|parseInt(n,16))>>>0;if(n.length===8)return parseInt(n,16)>>>0}let i=Number(t);if(Number.isFinite(i))return i>>>0}throw new Error("color must be an ARGB integer or #RRGGBB/#AARRGGBB string")}function Ue(e,t){let i=Number(e);if(!Number.isFinite(i))throw new Error(`${t} must be a finite number`);return i}function Mo(e){if(e===!0||e===1||e==="1"||e==="true")return!0;if(e===!1||e===0||e==="0"||e==="false")return!1;throw new Error("boolean field requires true or false")}var fl=new Set(["fontSize","minimumFontSize","imageId","clickAudioId","softEdgeWidthX","softEdgeWidthY","horizontalSoftRange","verticalSoftRange","fillAmount","cellSizeX","cellSizeY","spacingX","spacingY","padding1X","padding1Y","padding2X","padding2Y","previewCount","keyboardKeyCode","controllerKeyCode","itemPrefabId","layoutConstraintFixedCount"]),dl=new Set(["active","visible","canControllerFocus","isolateNavigation","disableKeyEventPassthrough","disableCursorEventPassthrough","showCursor","adaptiveFontSize","enableOutline","enableMask","enableSoftEdge","enableFill","reverseMaskArea","raycastTarget","interactable","showScrollBar"]),hl=new Set(["name","imageSource","horizontalAlignment","verticalAlignment","text","softEdgeMode","fillType","fillHorizontalType","fillVerticalType","fillRadial90Type","fillRadialType","scrollDirection","layoutConstraint","referencedPrefabId","animationId"]),No=new Set(["unavailableChildId","hoverChildId","pressedChildId","selectedChildId"]),Fo={imageSource:["StaticReference","Prefab"],imageType:["Basic","Stretch",null],scrollDirection:["Horizontal","Vertical"],layoutConstraint:["AutoWrap","Fixed"],softEdgeMode:["Percentage","Pixel"],fillType:["Horizontal","Vertical","Radial90","Radial180","Radial360"],fillHorizontalType:["Left","Right"],fillVerticalType:["Bottom","Top"],fillRadial90Type:["BottomLeft","TopLeft","TopRight","BottomRight"],fillRadialType:["Bottom","Left","Top","Right"]};function ml(e,t){if(!t||typeof t!="object")throw new Error("patch requires op");let i=t.op;if(i==="select")return t.id&&de(e.root,t.id)&&(e.selectedId=t.id),e;if(i==="pick"){let{boxes:n}=tt(e.root,e.canvasId),r=zo(e,n),o=uo(r,Number(t.x),Number(t.y));return o&&(e.selectedId=o),e}if(i==="setCanvas")return t.canvasId&&ie[t.canvasId]&&(e.canvasId=t.canvasId),e;if(i==="setScript")throw new Error("\u811A\u672C\u7531\u5B58\u6863\u7EDF\u4E00\u7BA1\u7406\uFF0C\u8BF7\u4F7F\u7528 addScript / updateScript / removeScript \u64CD\u4F5C");if(i==="newAsset"){let n=t.assetType==="client-control-template"?Nt():ht();return e.version=n.version,e.meta=n.meta,e.canvasId=n.canvasId,e.selectedId=n.selectedId,e.root=n.root,e}if(i==="addTemplate"){if(e.meta.assetType!=="client-control-template")throw new Error("\u53EA\u6709\u5BA2\u6237\u7AEF\u63A7\u4EF6\u6A21\u677F\u5DE5\u7A0B\u53EF\u4EE5\u65B0\u589E\u6A21\u677F");let n=q(t.kind,{id:yn(e.root),guid:Ro(e.root),name:t.name||`\u65B0${t.kind==="container"?"\u5BB9\u5668\u8282\u70B9":t.kind}\u6A21\u677F`});return e.root.children.push(n),e.selectedId=n.id,e}if(i==="add"){let n=de(e.root,t.parentId||e.selectedId);if(!n)throw new Error("add: parent not found");let r=Ur(n,t.kind,{id:yn(e.root),guid:Ro(e.root),name:t.name});return e.selectedId=r.id,e}if(i==="reparent"){if(e.meta.assetType!=="client-control-template")throw new Error("\u5C42\u7EA7\u8C03\u6574\u4EC5\u9002\u7528\u4E8E\u5BA2\u6237\u7AEF\u63A7\u4EF6\u6A21\u677F\u5DE5\u7A0B");let n=de(e.root,t.id||e.selectedId),r=n?Ze(e.root,n.id):null,o=de(e.root,t.parentId);if(!n||n.kind==="server-container"||!r)throw new Error("reparent: node not found");if(!o)throw new Error("reparent: parent not found");if(o.id===n.id||rl(n,o.id))throw new Error("\u63A7\u4EF6\u4E0D\u80FD\u79FB\u52A8\u5230\u81EA\u8EAB\u6216\u5176\u540E\u4EE3\u4E0B\u9762");if(o.kind==="server-container"&&r.kind==="server-container")return e;if(r.kind==="server-container"&&o.kind!=="server-container"&&e.root.children.length<=1)throw new Error("\u5BA2\u6237\u7AEF\u63A7\u4EF6\u6A21\u677F\u5217\u8868\u81F3\u5C11\u4FDD\u7559\u4E00\u4E2A\u9876\u5C42\u6A21\u677F");return ol(e,n,r,o),e.selectedId=n.id,e}if(i==="moveSibling"){let n=de(e.root,t.id||e.selectedId),r=n?Ze(e.root,n.id):null;if(!n||!r)throw new Error("moveSibling: node not found");let o=r.children.findIndex(u=>u.id===n.id),a=t.direction==="up"?-1:t.direction==="down"?1:0,s=o+a;return!a||s<0||s>=r.children.length||(r.children.splice(o,1),r.children.splice(s,0,n),e.selectedId=n.id),e}if(i==="remove"){let n=t.id||e.selectedId,r=Ze(e.root,n);if(r?.kind==="server-container"){if(e.meta.assetType!=="client-control-template")throw new Error("\u670D\u52A1\u7AEF\u63A7\u4EF6\u6A21\u677F\u7684\u5BA2\u6237\u7AEF\u6839\u8282\u70B9\u4E0D\u80FD\u5220\u9664");if((e.root.children||[]).length<=1)throw new Error("\u5BA2\u6237\u7AEF\u63A7\u4EF6\u6A21\u677F\u5217\u8868\u81F3\u5C11\u4FDD\u7559\u4E00\u4E2A\u6A21\u677F")}return Hr(e.root,n)&&(ee(e.root,o=>{if(o.kind==="button")for(let a of No)o[a]&&!de(e.root,o[a])&&(o[a]=null)}),e.selectedId=r?r.id:e.root.id),e}if(i==="set"){let n=de(e.root,t.id||e.selectedId);if(!n)throw new Error("set: node not found");let r=t.key;r==="reverseMask"&&(r="reverseMaskArea");let o=t.value;if(n.kind==="reference"&&["referencedPrefabId","giaRaw.templateRefSlot"].includes(r)&&(n.giaRaw.templateRefSlotBase64||n.giaRaw.templateRefOuterBase64))throw new Error("\u8BE5\u6A21\u677F\u5F15\u7528\u542B\u5C1A\u672A\u89E3\u6790\u7684\u539F\u59CB\u914D\u7F6E\uFF0C\u6682\u4E0D\u80FD\u6539\u5199\u76EE\u6807\u7D22\u5F15\uFF1B\u8BF7\u5728\u5B98\u65B9\u7F16\u8F91\u5668\u4FEE\u6539\u540E\u91CD\u65B0\u5BFC\u5165");if(r.startsWith("giaRaw.")){let l=r.slice(7);if(!l||l.includes("."))throw new Error("invalid raw GIA field path");let f=Yr(n.kind,l);if(!f)throw new Error(`unknown raw GIA field for ${n.kind}: ${l}`);if(n.giaRaw||={},n.giaRaw[l]=dn(f,o),l==="footerField505"&&[0,1].includes(n.giaRaw[l])&&(n.canControllerFocus=n.giaRaw[l]===1),n.kind==="cursor"&&l==="cursorField501"&&[0,1].includes(n.giaRaw[l])&&(n.raycastTarget=n.giaRaw[l]===1),(n.kind==="textbox"||n.kind==="textwindow")&&l==="textAlign"){let d={0:"Left",1:"Middle",2:"Right"}[n.giaRaw[l]];d&&(n.horizontalAlignment=d)}if(n.kind==="image"&&l==="imageFillType"){let d={1:"Horizontal",2:"Vertical",3:"Radial90",4:"Radial180",5:"Radial360"}[n.giaRaw[l]];d&&(n.fillType=d)}return n.kind==="keyhint"&&l==="keyHintField502"&&(n.keyboardKeyCode=n.giaRaw[l]),n.kind==="keyhint"&&l==="keyHintField501"&&(n.controllerKeyCode=n.giaRaw[l]),e}if(r==="syncAllDevices"){if(n.syncAllDevices=Mo(o),n.syncAllDevices){let l=et(n.transformByPlatform,e.canvasId);Ot(e,n,l)}return e}if(sl.has(r)){if(r.endsWith("Color")&&(o=cl(o)),fl.has(r)){if(o=Ue(o,r),o<0)throw new Error(`${r} must not be negative`);if((r==="imageId"||r==="clickAudioId"||r==="keyboardKeyCode"||r==="controllerKeyCode")&&(o=Math.trunc(o)),r==="fillAmount"&&o>1)throw new Error("fillAmount must be between 0 and 1")}if(dl.has(r)&&(o=Mo(o)),hl.has(r)&&(o=String(o??"")),r==="horizontalAlignment"&&!["Left","Middle","Right"].includes(o))throw new Error("invalid horizontalAlignment");if(r==="verticalAlignment"&&!["Top","Middle","Bottom"].includes(o))throw new Error("invalid verticalAlignment");if(Fo[r]&&!Fo[r].includes(o))throw new Error(`invalid ${r}`);if(No.has(r))if(o===""||o===void 0||o===null)o=null;else{o=String(o);let l=de(e.root,o);if(!l||l===n||l.kind==="server-container"||!(n.children||[]).some(f=>f.id===o))throw new Error(`${r} must reference a direct child of this button`)}if(n.kind==="image"&&(r==="imageSource"||r==="imageId")&&n[r]!==o&&(n.imageType=null,n.giaRaw.imageSlotType=0),n[r]=o,n.kind==="image"&&r==="imageType"&&(n.giaRaw.imageSlotType=o==="Stretch"?1:0),r==="canControllerFocus"&&(n.giaRaw.footerField505=o?1:0),n.kind==="cursor"&&r==="raycastTarget"&&(n.giaRaw.cursorField501=o?1:0),(n.kind==="textbox"||n.kind==="textwindow")&&r==="horizontalAlignment"&&(n.giaRaw.textAlign={Left:0,Middle:1,Right:2}[o]),(n.kind==="textbox"||n.kind==="textwindow")&&r==="verticalAlignment"&&delete n.giaRaw.textVerticalAlign,n.kind==="image"&&r==="fillType"){let l={Horizontal:1,Vertical:2,Radial90:3,Radial180:4,Radial360:5}[o];l&&(n.giaRaw.imageFillType=l)}return n.kind==="reference"&&r==="referencedPrefabId"&&(n.giaRaw.templateRefSlot=o),n.kind==="grid"&&r==="previewCount"&&(n.giaRaw.gridField511=Math.trunc(o)),n.kind==="keyhint"&&r==="keyboardKeyCode"&&(n.giaRaw.keyHintField502=Math.trunc(o)),n.kind==="keyhint"&&r==="controllerKeyCode"&&(n.giaRaw.keyHintField501=Math.trunc(o)),(n.kind==="animation"||n.kind==="fullscreen")&&r==="animationId"&&(n.giaRaw[n.kind==="animation"?"effectSlot":"fullscreenEffectSlot"]=o),e}let{boxes:a}=tt(e.root,e.canvasId),s=$n(e,n.id,a),u=et(n.transformByPlatform,e.canvasId);if(r==="anchorType"){let l=zn(a[n.id]),f=zr(u,o);return f=ut(s,f,l),Ot(e,n,f),e}if(["rotationX","rotationY","rotationZ"].includes(r)){let l={...u,rotation:{...u.rotation,[r.slice(-1).toLowerCase()]:Ue(o,r)}};return Ot(e,n,l),e}if(ul.has(r)){let l=zn(a[n.id]),f={...u,anchorMin:{...u.anchorMin},anchorMax:{...u.anchorMax},pivot:{...u.pivot}};return r==="anchorMinX"&&(f.anchorMin.x=Ue(o,r)),r==="anchorMinY"&&(f.anchorMin.y=Ue(o,r)),r==="anchorMaxX"&&(f.anchorMax.x=Ue(o,r)),r==="anchorMaxY"&&(f.anchorMax.y=Ue(o,r)),r==="pivotX"&&(f.pivot.x=Ue(o,r)),r==="pivotY"&&(f.pivot.y=Ue(o,r)),Ot(e,n,ut(s,f,l)),e}if(ll.has(r)){let l=zn(a[n.id]),f=Ue(o,r);if((r==="width"||r==="height")&&f<0)throw new Error(`${r} must not be negative`);return l[r]=f,Ot(e,n,ut(s,u,l)),e}throw new Error(`set: unknown key ${r}`)}if(i==="replace"){let n=nt(t.project);return e.version=n.version,e.meta=n.meta,e.canvasId=n.canvasId,e.selectedId=n.selectedId,e.root=n.root,e}throw new Error(`unknown op ${i}`)}function Gn(e,t){if(!t||typeof t!="object")throw new Error("patch requires op");if(t.expectedRevision!==void 0&&Number(t.expectedRevision)!==e.version)throw new Error(`revision conflict: expected ${t.expectedRevision}, current ${e.version}`);let i=e.version,n=JSON.parse(JSON.stringify(e));return ml(n,t),Oo(n),Xe(n),n.version=i+1,Object.keys(e).forEach(r=>{delete e[r]}),Object.assign(e,n),e}function zn(e){return e?{posX:e.centerX,posY:e.centerY,width:e.width,height:e.height}:{posX:0,posY:0,width:0,height:0}}import pl from"fengari";var{lua:c,lauxlib:J,lualib:Go,to_luastring:Di,to_jsstring:gl}=pl,yl=c.LUA_TNIL,bl=c.LUA_TBOOLEAN,vl=c.LUA_TNUMBER,Sl=c.LUA_TSTRING,Do=c.LUA_TTABLE,wl=c.LUA_TFUNCTION,Dn=c.LUA_TUSERDATA,Re=c.LUA_OK,Vo=new WeakMap,Vn=Symbol("luaTableEntries"),Yn={__scriptHostKey:!0};function P(e){return Di(String(e))}function gt(e,t){Vo.set(e,t)}function xe(e){return Vo.get(e)}var oi=class{constructor(t){this.value=t}};function ae(e,t,i){if(i instanceof oi){c.lua_pushnumber(e,i.value);return}if(i==null){c.lua_pushnil(e);return}let n=typeof i;if(n==="boolean"){c.lua_pushboolean(e,i);return}if(n==="number"){Number.isInteger(i)&&Math.abs(i)<=2147483647?c.lua_pushinteger(e,i):c.lua_pushnumber(e,i);return}if(n==="string"){c.lua_pushstring(e,P(i));return}if(n==="function"){Cl(e,t,i);return}if(i&&i[Vn]){let r=i[Vn];c.lua_createtable(e,Array.isArray(i)?i.length:0,r.length);for(let[o,a]of r)ae(e,t,o),ae(e,t,a),c.lua_settable(e,-3);return}if(Array.isArray(i)){c.lua_createtable(e,i.length,0);for(let r=0;r<i.length;r++)ae(e,t,i[r]),c.lua_rawseti(e,-2,r+1);return}if(i&&i.__kind==="EnumItem"){t.pushEnumItem(e,i);return}if(i&&i.__kind==="CursorEventData"){t.pushCursor(e,i);return}if(i&&i.__kind==="Script"){t.pushScript(e,i);return}if(i&&i.typeofName){t.pushControl(e,i);return}if(i&&i.__kind==="ServerSignal"){t.pushSignal(e,i);return}if(i&&(i.SetEase||i.Append)){t.pushTween(e,i);return}if(n==="object"){c.lua_createtable(e,0,Object.keys(i).length);for(let[r,o]of Object.entries(i))ae(e,t,o),c.lua_setfield(e,-2,P(r));return}c.lua_pushnil(e)}function Q(e,t){if(c.lua_isnil(e,t)||c.lua_type(e,t)===c.LUA_TNONE)return"";if(!c.lua_isstring(e,t)&&c.lua_type(e,t)!==c.LUA_TNUMBER)return`lua_type=${c.lua_type(e,t)}`;let i=c.lua_tostring(e,t);return i==null?"":gl(i)}function He(e,t){t=c.lua_absindex(e,t);let i=c.lua_type(e,t);if(i===Dn)return xe(c.lua_touserdata(e,t));if(i===Do){c.lua_pushlightuserdata(e,Yn),c.lua_rawget(e,t);let n=c.lua_type(e,-1)===Dn?c.lua_touserdata(e,-1):null;return c.lua_pop(e,1),n?xe(n):null}return null}function me(e,t,i){i=c.lua_absindex(e,i);let n=c.lua_type(e,i);if(n===yl)return null;if(n===bl)return!!c.lua_toboolean(e,i);if(n===vl)return c.lua_isinteger(e,i)?c.lua_tointeger(e,i):c.lua_tonumber(e,i);if(n===Sl)return Q(e,i);if(n===Dn){let r=c.lua_touserdata(e,i);return xe(r)??r}if(n===wl)return Il(e,t,i);if(n===Do){let r=He(e,i);if(r)return r;let o=[];for(c.lua_pushnil(e);c.lua_next(e,i)!==0;){let l=me(e,t,-2),f=me(e,t,-1);o.push([l,f]),c.lua_pop(e,1)}let a=new Map(o.filter(([l])=>Number.isInteger(l)&&l>=1)),s=0;for(;a.has(s+1);)s+=1;let u=s>0?[]:{};for(let[l,f]of o)Array.isArray(u)&&Number.isInteger(l)&&l>=1?u[l-1]=f:(typeof l=="string"||typeof l=="number")&&(u[l]=f);return Object.defineProperty(u,Vn,{value:o}),u}return null}function Il(e,t,i){t.luaFunctions||(t.luaFunctions=new Map);let n=typeof c.lua_topointer=="function"?c.lua_topointer(e,i):null;if(n!=null&&t.luaFunctions.has(n))return t.luaFunctions.get(n);c.lua_pushvalue(e,i);let r=J.luaL_ref(e,c.LUA_REGISTRYINDEX),o=xl(e,t,r);return n!=null&&t.luaFunctions.set(n,o),o}function xl(e,t,i){let n=(...r)=>{if(n.__luaRef==null)throw new Error("attempt to call a released Lua callback");let o=c.lua_gettop(e);c.lua_rawgeti(e,c.LUA_REGISTRYINDEX,n.__luaRef);for(let l of r)ae(e,t,l);if(c.lua_pcall(e,r.length,c.LUA_MULTRET,0)!==Re){let l=Q(e,-1);throw c.lua_settop(e,o),new Error(l)}let s=c.lua_gettop(e)-o,u=[];for(let l=1;l<=s;l++)u.push(me(e,t,o+l));if(c.lua_settop(e,o),u.length!==0)return u.length===1?u[0]:u};return n.__luaRef=i,n.__luaState=e,n}function Yo(e){e?.__luaRef!=null&&(e.__luaHolds=(e.__luaHolds||0)+1)}function Bo(e,t){if(!t||t.__luaRef==null||!t.__luaState)return;if(t.__luaHolds>1){t.__luaHolds-=1;return}let i=t.__luaState;if((!e?.luaStates||e.luaStates.has(i))&&J.luaL_unref(i,c.LUA_REGISTRYINDEX,t.__luaRef),t.__luaRef=null,t.__luaState=null,e?.luaFunctions)for(let[n,r]of e.luaFunctions)r===t&&e.luaFunctions.delete(n)}function Cl(e,t,i){c.lua_pushlightuserdata(e,i),c.lua_pushlightuserdata(e,t),c.lua_pushcclosure(e,function(r){let o=c.lua_touserdata(r,c.lua_upvalueindex(1)),a=c.lua_touserdata(r,c.lua_upvalueindex(2)),s=c.lua_gettop(r),u=[];for(let l=1;l<=s;l++)u.push(me(r,a,l));try{let l=o(...u);if(Array.isArray(l)&&l.__multi){for(let f of l)ae(r,a,f);return l.length}return l===void 0?0:(ae(r,a,l),1)}catch(l){return c.lua_pushstring(r,P(String(l&&l.message?l.message:l))),c.lua_error(r)}},2)}function Xo(e){!e||typeof c.lua_close!="function"||c.lua_close(e)}function Uo(e){if(J.luaL_loadstring(e,P(["local nativeGetMetatable = getmetatable","getmetatable = function(value)",' if type(value) == "string" then return nil end'," return nativeGetMetatable(value)","end"].join(`
|
|
109
|
-
`)))===Re&&c.lua_pcall(e,0,0,0),c.lua_settop(e,0),c.lua_pushnil(e),c.lua_setglobal(e,P("_VERSION")),c.lua_getglobal(e,P("string")),!c.lua_isnil(e,-1))for(let i of["dump","pack","unpack"])c.lua_pushnil(e),c.lua_setfield(e,-2,P(i));if(c.lua_pop(e,1),c.lua_pushnil(e),c.lua_setglobal(e,P("io")),c.lua_getglobal(e,P("os")),!c.lua_isnil(e,-1))for(let i of Object.keys({execute:1,getenv:1,remove:1,rename:1,tmpname:1,setlocale:1,exit:1}))c.lua_pushnil(e),c.lua_setfield(e,-2,P(i));c.lua_pop(e,1),c.lua_getglobal(e,P("debug")),c.lua_isnil(e,-1)?c.lua_pop(e,1):(c.lua_getfield(e,-1,P("traceback")),c.lua_newtable(e),c.lua_pushvalue(e,-2),c.lua_setfield(e,-2,P("traceback")),c.lua_setglobal(e,P("debug")),c.lua_pop(e,2)),c.lua_getglobal(e,P("math")),c.lua_isnil(e,-1)||(c.lua_pushcfunction(e,i=>{let n=c.lua_tonumber(i,1);return c.lua_pushboolean(i,Number.isNaN(n)),1}),c.lua_setfield(e,-2,P("isnan")),c.lua_pushcfunction(e,i=>{let n=c.lua_tonumber(i,1);return c.lua_pushboolean(i,n===1/0||n===-1/0),1}),c.lua_setfield(e,-2,P("isinf"))),c.lua_pop(e,1),c.lua_pushnil(e),c.lua_setglobal(e,P("package")),c.lua_pushnil(e),c.lua_setglobal(e,P("load")),c.lua_pushnil(e),c.lua_setglobal(e,P("loadfile")),c.lua_pushnil(e),c.lua_setglobal(e,P("dofile")),c.lua_pushnil(e),c.lua_setglobal(e,P("collectgarbage")),c.lua_pushnil(e),c.lua_setglobal(e,P("coroutine")),c.lua_pushnil(e),c.lua_setglobal(e,P("fengari"))}var ke=(e,t=0)=>Number.isFinite(Number(e))?Number(e):t,Ho=e=>e?.Name||e,Vi=e=>Math.max(0,Math.min(1,ke(e)));function ai(e){let t=e.parent?ai(e.parent):[e.runtime.canvasWidth,e.runtime.canvasHeight];return[Math.max(0,(e.anchorMaxX-e.anchorMinX)*t[0]+ke(e.sizeDeltaX)),Math.max(0,(e.anchorMaxY-e.anchorMinY)*t[1]+ke(e.sizeDeltaY))]}function si(e){let[t,i]=ai(e),n=Ho(e.scrollDirection)==="Horizontal",r=Math.max(1,ke(e.cellSizeX,50)),o=Math.max(1,ke(e.cellSizeY,50)),a=Math.max(0,ke(e.spacingX)),s=Math.max(0,ke(e.spacingY)),u=Math.max(0,ke(e.padding1X)),l=Math.max(0,ke(e.padding1Y)),f=Math.max(0,ke(e.padding2X)),d=Math.max(0,ke(e.padding2Y)),m=n?i-l-d:t-u-f,p=n?o:r,g=n?s:a,y=Ho(e.layoutConstraint)==="Fixed"?Math.max(1,Math.floor(ke(e.layoutConstraintFixedCount,1))):Math.max(1,Math.floor((m+g)/(p+g))),C=Math.ceil(e.itemCount/y),x=C?n?u+f+C*r+(C-1)*a:l+d+C*o+(C-1)*s:0,I=n?t:i,z=Math.max(0,x-I);return{width:t,height:i,horizontal:n,cellW:r,cellH:o,gapX:a,gapY:s,left:u,top:l,right:f,bottom:d,lanes:y,length:x,viewport:I,max:z,offset:Vi(e.scrollProgress)*z}}function zt(e){let t=si(e);for(let i=0;i<(e._gridItems?.length||0);i+=1){let n=e._gridItems[i];if(!n.alive||n.parent!==e)continue;let r=Math.floor(i/t.lanes),o=i%t.lanes,a=t.horizontal?r:o,s=t.horizontal?o:r,u=t.left+a*(t.cellW+t.gapX)+t.cellW/2-(t.horizontal?t.offset:0),l=-t.top-s*(t.cellH+t.gapY)-t.cellH/2+(t.horizontal?0:t.offset),f={anchorMinX:0,anchorMaxX:0,anchorMinY:1,anchorMaxY:1,pivotX:.5,pivotY:.5,sizeDeltaX:t.cellW,sizeDeltaY:t.cellH,anchoredPositionX:u,anchoredPositionY:l};Object.entries(f).some(([d,m])=>n[d]!==m)&&(Object.assign(n,f),n.markPlayDirty(!0))}return t}var jo={container:"ClientUIContainerControl",textbox:"ClientUITextBoxControl",textwindow:"ClientUITextWindowControl",image:"ClientUIImageControl",button:"ClientUIPresetButtonControl",cursor:"ClientUICursorEventAreaControl",grid:"ClientUIGridScrollerControl",keyhint:"ClientUIKeyHintControl",animation:"ClientUIAnimationControl",fullscreen:"ClientUIFullscreenAnimationControl",reference:"ClientUIReferenceControl"},kl=["alive","Id","prefabIndex","active","activeInHierarchy","visible"],Yi=new Set(["active","visible","parent","sizeDeltaX","sizeDeltaY","anchorMinX","anchorMinY","anchorMaxX","anchorMaxY","pivotX","pivotY"]),El=["name","parent","anchoredPositionX","anchoredPositionY","sizeDeltaX","sizeDeltaY","anchorMinX","anchorMinY","anchorMaxX","anchorMaxY","pivotX","pivotY","localScaleX","localScaleY","localScaleZ","localRotationX","localRotationY","localRotationZ","canControllerFocus"],Al={image:["imageSource","imageId"],grid:["itemCount","scrollDirection","layoutConstraint","layoutConstraintFixedCount"],reference:["referencedPrefabIndex"]},_l={container:["isolateNavigation","disableKeyEventPassthrough","disableCursorEventPassthrough","showCursor"],textbox:["text","fontSize","fontColor","bgColor","enableOutline","outlineColor","horizontalAlignment","verticalAlignment","adaptiveFontSize","minimumFontSize"],textwindow:["interactable","showScrollBar","text","fontSize","fontColor","bgColor","enableOutline","outlineColor","horizontalAlignment","verticalAlignment","adaptiveFontSize","minimumFontSize"],image:["imageColor","enableMask","enableSoftEdge","softEdgeMode","softEdgeWidthX","softEdgeWidthY","horizontalSoftRange","verticalSoftRange","reverseMaskArea","fillType","fillHorizontalType","fillVerticalType","fillRadial90Type","fillRadialType","fillAmount"],button:["interactable","clickAudioId","raycastTarget"],cursor:["raycastTarget"],grid:["itemPrefabIndex","raycastTarget","showScrollBar","interactable","scrollProgress"],keyhint:["keyboardKeyCode","controllerKeyCode"],animation:["animationId","playSoundEffect","layer"],fullscreen:["animationId","playSoundEffect"]},Tl=["GetChildren","GetChild","FindChild","SetActive","SetVisible","GetSiblingIndex","SetSiblingIndex","SetAsFirstSibling","SetAsLastSibling","GetAnchoredPosition","SetAnchoredPosition","GetSizeDelta","SetSizeDelta","GetAnchorMin","SetAnchorMin","GetAnchorMax","SetAnchorMax","GetPivot","SetPivot","GetLocalScale","SetLocalScale","GetLocalRotation","SetLocalRotation","GetScriptByPath","GetScript","GetScripts","AddKeyEventListener","RemoveKeyEventListener","RemoveKeyEventListeners","RemoveAllKeyEventListeners","AddNavigationEventListener","RemoveNavigationEventListener","RemoveNavigationEventListeners","RemoveAllNavigationEventListeners","SetControllerNavigation","GetControllerNavigation"],Ko=["AddCursorEventListener","RemoveCursorEventListener","RemoveCursorEventListeners","RemoveAllCursorEventListeners","SimulateCursorClick"],Pl={image:["SetImage","SetSoftEdgeWidth","SetFillUnused","SetFillHorizontal","SetFillVertical","SetFillRadial90","SetFillRadial180","SetFillRadial360"],button:Ko,cursor:Ko,animation:["PlayAnimation","StopAnimation"],grid:["RefreshItems","GetItemIndex","GetItemSize","GetItemSpacing","GetPadding","ScrollToItemAt","GetContentLength"]};function Xn(e,t){return e.kind==="image"&&t==="imageType"&&e.runtime.canSelectImageType(e.imageId,e.imageSource)?"rw":kl.includes(t)||(Al[e.kind]||[]).includes(t)?"ro":El.includes(t)||(_l[e.kind]||[]).includes(t)?"rw":null}var Rl=["localRotationX","localRotationY","localRotationZ"],$t=Math.PI/180;function Lo(e,t){return[e[3]*t[0]+e[0]*t[3]+e[1]*t[2]-e[2]*t[1],e[3]*t[1]-e[0]*t[2]+e[1]*t[3]+e[2]*t[0],e[3]*t[2]+e[0]*t[1]-e[1]*t[0]+e[2]*t[3],e[3]*t[3]-e[0]*t[0]-e[1]*t[1]-e[2]*t[2]]}function Bn(e){if(Object.is(e,-0))return e;let t=(e%360+360)%360,i=Math.round(t*1e6)/1e6;return i>=360?0:i}function qo(e,t,i){let n=I=>[Math.sin(I*$t/2),Math.cos(I*$t/2)],[r,o]=n(e),[a,s]=n(t),[u,l]=n(i),[f,d,m,p]=Lo(Lo([0,a,0,s],[r,0,0,o]),[0,0,u,l]),g=Math.max(-1,Math.min(1,-2*(d*m-p*f))),y,C,x;return Math.abs(g)>.999999?(y=Math.sign(g)*90,C=2*Math.atan2(d,p)/$t,x=0):(y=Math.asin(g)/$t,C=Math.atan2(2*(p*d+f*m),1-2*(f*f+d*d))/$t,x=Math.atan2(2*(p*m+f*d),1-2*(f*f+m*m))/$t),[Bn(y),Bn(C),Bn(x)]}function Wo(e,t){return Tl.includes(t)||(Pl[e.kind]||[]).includes(t)}var Ml={container:{isolateNavigation:!1,disableKeyEventPassthrough:!1,disableCursorEventPassthrough:!1,showCursor:!1},textbox:{text:"",fontSize:20,fontColor:4294967295,bgColor:0,enableOutline:!1,outlineColor:0,horizontalAlignment:null,verticalAlignment:null,adaptiveFontSize:!1,minimumFontSize:10},textwindow:{interactable:!0,showScrollBar:!0,text:"",fontSize:20,fontColor:4294967295,bgColor:0,enableOutline:!1,outlineColor:0,horizontalAlignment:null,verticalAlignment:null,adaptiveFontSize:!1,minimumFontSize:10},image:{imageSource:null,imageId:0,imageColor:4294967295,imageType:null,enableMask:!1,enableSoftEdge:!1,softEdgeMode:"Percentage",softEdgeWidthX:8,softEdgeWidthY:8,horizontalSoftRange:85,verticalSoftRange:85,enableFill:!1,fillType:"Unused",fillHorizontalType:"Left",fillVerticalType:"Bottom",fillRadial90Type:"BottomLeft",fillRadialType:"Bottom",reverseMaskArea:!1,fillAmount:1},button:{interactable:!0,clickAudioId:0,raycastTarget:!0,unavailableChildId:null,hoverChildId:null,pressedChildId:null,selectedChildId:null,pressed:!1},cursor:{raycastTarget:!0},grid:{itemCount:0,itemPrefabIndex:null,raycastTarget:!0,interactable:!0,showScrollBar:!0,scrollDirection:"Vertical",layoutConstraint:"AutoWrap",layoutConstraintFixedCount:null,scrollProgress:0,cellSizeX:50,cellSizeY:50,spacingX:8,spacingY:8,padding1X:20,padding1Y:20,padding2X:20,padding2Y:20,previewCount:5},keyhint:{keyboardKeyCode:null,controllerKeyCode:null},animation:{animationId:null,playSoundEffect:null,layer:null,raycastTarget:!1},fullscreen:{animationId:null,playSoundEffect:null,raycastTarget:!1},reference:{referencedPrefabIndex:null}},rt=class e{constructor(t,i){this.runtime=t,this.kind=i.kind||"container",this.typeofName=jo[this.kind]||jo.container,this.alive=!0,this.Id=i.Id??t.nextControlId(),this.authoringId=i.authoringId??null,this.prefabIndex=i.prefabIndex??0,this.name=i.name??"",this.active=i.active===!0,this.visible=i.visible!==!1,this._parent=null,this.children=[],this.scripts=[],this.cursorListeners=new Map,this.keyListeners=new Map,this.navListeners=new Map,this.navConfig=new Map,this.anchoredPositionX=i.anchoredPositionX??0,this.anchoredPositionY=i.anchoredPositionY??0,this.sizeDeltaX=i.sizeDeltaX??0,this.sizeDeltaY=i.sizeDeltaY??0,this.anchorMinX=i.anchorMinX??.5,this.anchorMinY=i.anchorMinY??.5,this.anchorMaxX=i.anchorMaxX??.5,this.anchorMaxY=i.anchorMaxY??.5,this.pivotX=i.pivotX??.5,this.pivotY=i.pivotY??.5,this.localScaleX=i.localScaleX??1,this.localScaleY=i.localScaleY??1,this.localScaleZ=i.localScaleZ??1,this.localRotationX=i.localRotationX??0,this.localRotationY=i.localRotationY??0,this.localRotationZ=i.localRotationZ??0,this.canControllerFocus=i.canControllerFocus??!1,this._playDirty=!0,this._playDeepDirty=!0,this._playChildDirty=!1,(this.kind==="grid"||this.kind==="textwindow")&&(this.runtime.scrollControls||=new Set,this.runtime.scrollControls.add(this));let n=Ml[this.kind]||{};for(let[r,o]of Object.entries(n))this[r]===void 0&&(this[r]=i[r]!==void 0?i[r]:o);if(this.kind==="grid"&&(this.scrollProgress=i.scrollProgress??0),i.children)for(let r of i.children){let o=r instanceof e?r:new e(t,r);this.addChild(o)}}get parent(){return this._parent}set parent(t){if(this._parent===t)return;if(t!==null&&!(t instanceof e))throw new Error("parent must be a Control or nil");if(t&&t.runtime!==this.runtime)throw new Error("parent must belong to the same runtime");if(t===this)throw new Error("cannot parent a control to itself or its descendant");for(let n=t;n;n=n._parent)if(n===this)throw new Error("cannot parent a control to itself or its descendant");let i=this._parent;if(i){let n=i.children.indexOf(this);n>=0&&i.children.splice(n,1),i.markPlayDirty(!0)}else{let n=this.runtime.roots.indexOf(this);n>=0&&this.runtime.roots.splice(n,1)}this._parent=t,this.markPlayDirty(!0),t&&!t.children.includes(this)?(t.children.push(this),t.markPlayDirty(!0)):!t&&this.alive&&!this.runtime.roots.includes(this)&&this.runtime.roots.push(this)}markPlayDirty(t=!1){this._playDirty=!0,t&&(this._playDeepDirty=!0);for(let i=this._parent;i&&!i._playChildDirty;i=i._parent)i._playChildDirty=!0}get activeInHierarchy(){return this.active?this._parent?this._parent.activeInHierarchy:!0:!1}get scrollProgress(){return this._scrollProgress??0}set scrollProgress(t){if(typeof t!="number"||!Number.isFinite(t))throw new Error("scrollProgress must be a finite number");this._scrollProgress=Vi(t),this.markPlayDirty()}addChild(t){return t.parent=this,t}GetChildren(){return this.children.slice()}GetChild(t){return this.children.find(i=>i.name===t)||null}FindChild(t){if(!t)return null;if(!t.includes("/"))return this.GetChild(t);let i=t.split("/").filter(Boolean),n=this;for(let r of i)if(n=n.GetChild(r),!n)return null;return n}SetActive(t){let i=!!t;if(this.active!==i){if(typeof this.runtime?.onControlActiveChanging=="function"){this.runtime.onControlActiveChanging(this,i);return}this.active=i,this.markPlayDirty(!0)}}SetVisible(t){this.visible=!!t,this.markPlayDirty(!0)}GetSiblingIndex(){if(!this._parent)return-1;let t=this._parent.children,i=t.indexOf(this);return i<0?-1:t.length-1-i}SetSiblingIndex(t){if(!this._parent)return!1;let i=this._parent.children,n=i.indexOf(this);if(n<0)return!1;let r=i.length-1;return!Number.isInteger(t)||t<0||t>r?!1:(i.splice(n,1),i.splice(r-t,0,this),this._parent.markPlayDirty(!0),this.markPlayDirty(),!0)}SetAsFirstSibling(){return this.SetSiblingIndex(0)}SetAsLastSibling(){return this._parent?this.SetSiblingIndex(this._parent.children.length-1):!1}GetAnchoredPosition(){return[this.anchoredPositionX,this.anchoredPositionY]}SetAnchoredPosition(t,i){this.anchoredPositionX=t,this.anchoredPositionY=i,this.markPlayDirty()}GetSizeDelta(){return[this.sizeDeltaX,this.sizeDeltaY]}SetSizeDelta(t,i){this.sizeDeltaX=t,this.sizeDeltaY=i,this.markPlayDirty(!0)}GetAnchorMin(){return[this.anchorMinX,this.anchorMinY]}SetAnchorMin(t,i){this.anchorMinX=t,this.anchorMinY=i,this.markPlayDirty(!0)}GetAnchorMax(){return[this.anchorMaxX,this.anchorMaxY]}SetAnchorMax(t,i){this.anchorMaxX=t,this.anchorMaxY=i,this.markPlayDirty(!0)}GetPivot(){return[this.pivotX,this.pivotY]}SetPivot(t,i){this.pivotX=t,this.pivotY=i,this.markPlayDirty(!0)}GetLocalScale(){return[this.localScaleX,this.localScaleY,this.localScaleZ]}SetLocalScale(t,i,n){this.localScaleX=t,this.localScaleY=i,this.localScaleZ=n,this.markPlayDirty()}GetLocalRotation(){return qo(this.localRotationX,this.localRotationY,this.localRotationZ)}luaFieldValue(t){if(t==="imageType")return this.imageType??"Stretch";let i=Rl.indexOf(t);return i<0?this[t]:qo(this.localRotationX,this.localRotationY,this.localRotationZ)[i]}SetLocalRotation(t,i,n){this.localRotationX=t,this.localRotationY=i,this.localRotationZ=n,this.markPlayDirty()}GetScriptByPath(t){return this.scripts.find(i=>i.path===t)||null}GetScript(t){return this.scripts.find(i=>i.scriptMappingId===t)||null}GetScripts(){return this.scripts.slice()}_addListener(t,i,n){let r=t.get(i)||[];r.push(n),t.set(i,r),this.runtime.retainLuaCallback?.(n)}_removeListener(t,i,n){let r=t.get(i);if(!r)return;let o=r.filter(a=>a!==n);t.set(i,o);for(let a=o.length;a<r.length;a++)this.runtime.unrefLuaCallback?.(n)}_removeListeners(t,i){let n=t.get(i)||[];for(let r of n)this.runtime.unrefLuaCallback?.(r);t.delete(i)}_removeAllListeners(t){for(let i of t.values())for(let n of i)this.runtime.unrefLuaCallback?.(n);t.clear()}AddCursorEventListener(t,i){this._addListener(this.cursorListeners,t,i)}RemoveCursorEventListener(t,i){this._removeListener(this.cursorListeners,t,i)}RemoveCursorEventListeners(t){this._removeListeners(this.cursorListeners,t)}RemoveAllCursorEventListeners(){this._removeAllListeners(this.cursorListeners)}SimulateCursorClick(){let t=this.runtime.makeCursorEventData({x:0,y:0,pressX:0,pressY:0});this.emitCursor("CursorDown",t),this.emitCursor("CursorUp",t),this.emitCursor("CursorClick",t)}emitCursor(t,i){if(!this.runtime.cursorEventsEnabled(this))return;let n=this.cursorListeners.get(t)||[];for(let r of n)r(i)}AddKeyEventListener(t,i){this._addListener(this.keyListeners,t,i)}RemoveKeyEventListener(t,i){this._removeListener(this.keyListeners,t,i)}RemoveKeyEventListeners(t){this._removeListeners(this.keyListeners,t)}RemoveAllKeyEventListeners(){this._removeAllListeners(this.keyListeners)}emitKey(t){let i=this.keyListeners.get(t)||[];for(let n of i)if(n()===!0)return!0;return!1}AddNavigationEventListener(t,i){this._addListener(this.navListeners,t,i)}RemoveNavigationEventListener(t,i){this._removeListener(this.navListeners,t,i)}RemoveNavigationEventListeners(t){this._removeListeners(this.navListeners,t)}RemoveAllNavigationEventListeners(){this._removeAllListeners(this.navListeners)}SetControllerNavigation(t,i,n){this.navConfig.set(t,{mode:i,target:n})}GetControllerNavigation(t){let i=this.navConfig.get(t),n=i?[i.mode,i.target]:[null,null];return n.__multi=!0,n}SetImage(t,i){let n=this.imageSource?.Name||this.imageSource,r=t?.Name||t;(i!==this.imageId||n!==r)&&(this.imageType=null),this.imageSource=t,this.imageId=i,this.markPlayDirty()}SetSoftEdgeWidth(t,i){this.softEdgeWidthX=t,this.softEdgeWidthY=i,this.markPlayDirty()}SetFillUnused(){this.fillType="Unused",this.markPlayDirty()}SetFillHorizontal(t,i){this.fillType="Horizontal",this.fillHorizontalType=t,this.fillAmount=i,this.markPlayDirty()}SetFillVertical(t,i){this.fillType="Vertical",this.fillVerticalType=t,this.fillAmount=i,this.markPlayDirty()}SetFillRadial90(t,i){this.fillType="Radial90",this.fillRadial90Type=t,this.fillAmount=i,this.markPlayDirty()}SetFillRadial180(t,i){this.fillType="Radial180",this.fillRadialType=t,this.fillAmount=i,this.markPlayDirty()}SetFillRadial360(t,i){this.fillType="Radial360",this.fillRadialType=t,this.fillAmount=i,this.markPlayDirty()}PlayAnimation(){}StopAnimation(){}RefreshItems(t,i){if(!Number.isInteger(t)||t<0||t>2e3)throw new Error("RefreshItems: simulator supports 0..2000 items");if(typeof i!="function")throw new Error("RefreshItems: callback must be a function");if(!this.alive||this._refreshingGrid)throw new Error("RefreshItems: destroyed control or recursive refresh");if(t&&!this.runtime.templates.has(Number(this.itemPrefabIndex)))throw new Error("RefreshItems: item template not found");if(t&&["OnInit","OnDestroy"].includes(this.runtime.lifecyclePhase))throw new Error("RefreshItems: items cannot be created during OnInit/OnDestroy");this._refreshingGrid=!0;try{this._gridItems||=[];let n=[];for(let r of this._gridItems)r.alive&&r.parent===this&&r.prefabIndex===Number(this.itemPrefabIndex)&&n.length<t?n.push(r):r.alive&&r.parent===this&&this.runtime.destroyControl(r);for(this._gridItems=n;n.length<t;){let r=this.runtime.instantiate(this.itemPrefabIndex,this,this.runtime.lifecyclePhase);if(!r)throw new Error("RefreshItems: could not instantiate item");n.push(r),r.SetActive(!0)}this.itemCount=t,zt(this),this.markPlayDirty(!0);for(let r=0;r<n.length&&this.alive;r+=1)i(n[r],r)}finally{this._refreshingGrid=!1}}GetItemIndex(t){return t?.alive&&t.parent===this?this._gridItems?.indexOf(t)??-1:-1}GetItemSize(){return[this.cellSizeX,this.cellSizeY]}GetItemSpacing(){return[this.spacingX,this.spacingY]}GetPadding(){return[this.padding1Y,this.padding2Y,this.padding1X,this.padding2X]}ScrollToItemAt(t,i){if(!Number.isInteger(t)||t<0||t>=this.itemCount)throw new Error("ScrollToItemAt: item index out of range");let n=si(this),r=n.horizontal?n.cellW:n.cellH,o=n.horizontal?n.gapX:n.gapY,a=(n.horizontal?n.left:n.top)+Math.floor(t/n.lanes)*(r+o),s=i?.Name||i;if(!["Top","Center","Bottom"].includes(s))throw new Error("ScrollToItemAt: invalid alignment");let u=a-(s==="Center"?(n.viewport-r)/2:s==="Bottom"?n.viewport-r:0);this.scrollProgress=n.max?Vi(u/n.max):0,zt(this),this.markPlayDirty(!0)}GetContentLength(){return si(this).length}};function $e(e,t){t(e);for(let i of e.children)$e(i,t)}function Un(e,t=[],i=""){t.push(`${i}${e.name||"(unnamed)"} [${e.typeofName}] Id=${e.Id}`);for(let n of e.children)Un(n,t,i+" ");return t}function Bi(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375}var Jo={Linear:e=>e,InSine:e=>1-Math.cos(e*Math.PI/2),OutSine:e=>Math.sin(e*Math.PI/2),InOutSine:e=>-(Math.cos(Math.PI*e)-1)/2,InQuad:e=>e*e,OutQuad:e=>1-(1-e)*(1-e),InOutQuad:e=>e<.5?2*e*e:1-(-2*e+2)**2/2,InCubic:e=>e*e*e,OutCubic:e=>1-(1-e)**3,InOutCubic:e=>e<.5?4*e*e*e:1-(-2*e+2)**3/2,InQuart:e=>e**4,OutQuart:e=>1-(1-e)**4,InOutQuart:e=>e<.5?8*e**4:1-(-2*e+2)**4/2,InQuint:e=>e**5,OutQuint:e=>1-(1-e)**5,InOutQuint:e=>e<.5?16*e**5:1-(-2*e+2)**5/2,InExpo:e=>e===0?0:2**(10*e-10),OutExpo:e=>e===1?1:1-2**(-10*e),InOutExpo:e=>e===0||e===1?e:e<.5?2**(20*e-10)/2:(2-2**(-20*e+10))/2,InCirc:e=>1-Math.sqrt(1-e**2),OutCirc:e=>Math.sqrt(1-(e-1)**2),InOutCirc:e=>e<.5?(1-Math.sqrt(1-(2*e)**2))/2:(Math.sqrt(1-(-2*e+2)**2)+1)/2,InBack:e=>(1.70158+1)*e*e*e-1.70158*e*e,OutBack:e=>1+2.70158*(e-1)**3+1.70158*(e-1)**2,InOutBack:e=>{let i=2.5949095;return e<.5?(2*e)**2*((i+1)*2*e-i)/2:((2*e-2)**2*((i+1)*(e*2-2)+i)+2)/2},InElastic:e=>e===0||e===1?e:-(2**(10*e-10))*Math.sin((e*10-10.75)*(2*Math.PI/3)),OutElastic:e=>e===0||e===1?e:2**(-10*e)*Math.sin((e*10-.75)*(2*Math.PI/3))+1,InOutElastic:e=>{if(e===0||e===1)return e;let t=2*Math.PI/4.5;return e<.5?-(2**(20*e-10)*Math.sin((20*e-11.125)*t))/2:2**(-20*e+10)*Math.sin((20*e-11.125)*t)/2+1},InBounce:e=>1-Bi(1-e),OutBounce:Bi,InOutBounce:e=>e<.5?(1-Bi(1-2*e))/2:(1+Bi(2*e-1))/2};function Qo(e,t){let i=Jo[e]||Jo.Linear;return t<=0?0:t>=1?1:i(t)}function Gt(e,t,i,n=255){let r=Xi(e),o=Xi(t),a=Xi(i);return((n==null?255:Xi(n))<<24|r<<16|o<<8|a)>>>0}function li(e){let t=e>>>0;return[t>>>16&255,t>>>8&255,t&255,t>>>24&255]}function Xi(e){let t=Number(e);return Number.isFinite(t)?Math.max(0,Math.min(255,Math.trunc(t))):0}function Zo(e,t,i){let n=li(e),r=li(t);return Gt(n[0]+(r[0]-n[0])*i,n[1]+(r[1]-n[1])*i,n[2]+(r[2]-n[2])*i,n[3]+(r[3]-n[3])*i)}var Nl=new Set(["fontColor","bgColor","outlineColor","imageColor"]),Fl=new Set(["fontSize","minimumFontSize"]),Hn=1e-9;function Ol(e,t){return typeof e?.luaFieldValue=="function"?e.luaFieldValue(t):e[t]}var ui=class{constructor(t,i,n,r){this.runtime=t,this.object=i,this.data={...n},this.duration=Math.max(0,Number(r)||0),this.easeName="Linear",this.relative=!1,this.playing=!1,this.paused=!1,this.elapsed=0,this.loops=1,this.loopIndex=0,this.from={},this.to={},this.initialFrom=null,this.initialTo=null,this.onComplete=null,this.onStepComplete=null,this.killed=!1,this.dead=!1,this.completed=!1}capture(){this.from={},this.to={};for(let[t,i]of Object.entries(this.data)){let n=Ol(this.object,t);this.from[t]=n,this.to[t]=this.relative?Number(n)+Number(i):i}}restoreInitial(){this.from={...this.initialFrom},this.to={...this.initialTo}}SetEase(t){return this.easeName=typeof t=="string"?t:t?.Name||"Linear",this}SetRelative(t){return this.relative=!!t,this}Play(){return this.dead?this:this.playing?(this.paused=!1,this):this._start(!1)}_begin(t){this.playing=!0,this.paused=!1,this.elapsed=0,this.loopIndex=0,this.killed=!1,this.completed=!1,t&&this.initialFrom?this.restoreInitial():(this.capture(),this.initialFrom={...this.from},this.initialTo={...this.to})}_start(t){return this._begin(t),this.runtime.tweens.add(this),this.runtime.animations.add(this),this}get loopCount(){return this.loops>0?this.loops:1}Pause(){this.paused=!0}Resume(){this.paused=!1}Restart(){return this.dead?this:this._start(!0)}Complete(){this.dead||this.completed||(this.initialFrom||this._begin(!1),this.apply(1),this.finish(!0))}Kill(t){t?this.Complete():this.finish(!1),this.dead=!0}SetOnComplete(t){return this.onComplete=t,this}SetOnStepComplete(t){return this.onStepComplete=t,this}SetLoops(t){return this.loops=t,this}apply(t){if(this.object?.alive===!1)return;let i=Qo(this.easeName,t),n=!1,r=!1;for(let o of Object.keys(this.to)){let a=this.from[o],s=this.to[o];if(Nl.has(o)&&typeof a=="number"&&typeof s=="number")this.object[o]=Zo(a,s,i);else if(typeof a=="number"&&typeof s=="number"){let u=a+(s-a)*i;this.object[o]=Fl.has(o)?Math.trunc(u):u}else this.object[o]=i>=1?s:a;n=!0,Yi.has(o)&&(r=!0)}n&&typeof this.object?.markPlayDirty=="function"&&this.object.markPlayDirty(r)}_advance(t,i){this.elapsed+=t;let n=this.duration<=0?1:Math.min(1,this.elapsed/this.duration);return this.apply(n),n<1?!1:i>=0&&this.loopIndex+1>=i?!0:(this.onStepComplete&&this.runtime.safeCall(this.onStepComplete),this.loopIndex++,this.elapsed=0,this.restoreInitial(),!1)}step(t){!this.playing||this.paused||this.killed||this._advance(t,this.loops<0?-1:this.loopCount)&&(this.onStepComplete&&this.runtime.safeCall(this.onStepComplete),this.finish(!0))}finish(t){this.playing=!1,this.killed=!0,t&&(this.completed=!0),this.runtime.tweens.delete(this),this.runtime.animations.delete(this),t&&this.onComplete&&this.runtime.safeCall(this.onComplete)}},Dt=class{constructor(t){this.runtime=t,this.steps=[],this.playing=!1,this.paused=!1,this.killed=!1,this.dead=!1,this.completed=!1,this.elapsed=0,this.loops=1,this.loopIndex=0,this.onComplete=null,this.onStepComplete=null,this._entries=null}Append(t){return this.steps.push({kind:"tween",tween:t,parallel:!1}),this}AppendInterval(t){return this.steps.push({kind:"interval",duration:t}),this}AppendCallback(t){return this.steps.push({kind:"callback",fn:t}),this}Join(t){return this.steps.push({kind:"tween",tween:t,parallel:!0}),this}Insert(t,i){return this.steps.push({kind:"insert",time:t,tween:i}),this}InsertCallback(t,i){return this.steps.push({kind:"insertCb",time:t,fn:i}),this}Play(){return this.dead?this:this.playing?(this.paused=!1,this):this._play()}_play(){return this.playing=!0,this.paused=!1,this.killed=!1,this.completed=!1,this.elapsed=0,this.loopIndex=0,this._schedule(),this.runtime.sequences.add(this),this.runtime.animations.add(this),this}_schedule(){let t=0,i=0,n=!1,r=[],o=a=>a.duration*a.loopCount;for(let a of this.steps)if(a.kind==="tween"&&a.parallel){let s=n?i:t;r.push({at:s,tween:a.tween}),t=Math.max(t,s+o(a.tween))}else a.kind==="tween"?(r.push({at:t,tween:a.tween}),i=t,n=!0,t+=o(a.tween)):a.kind==="interval"?(i=t,n=!0,t+=a.duration):a.kind==="callback"?r.push({at:t,fn:a.fn}):a.kind==="insert"?(r.push({at:a.time,tween:a.tween}),t=Math.max(t,a.time+o(a.tween))):a.kind==="insertCb"&&(r.push({at:a.time,fn:a.fn}),t=Math.max(t,a.time));this._entries=r.map((a,s)=>({...a,index:s,end:a.tween?a.at+o(a.tween):a.at})),this._end=t,this._resetEntries()}_resetEntries(){for(let t of this._entries)t.started=!1,t.done=!1}_startChild(t){t.started=!0,t.tween._begin(!!t.tween.initialFrom)}_finishChild(t){t.done=!0,t.tween.apply(1),t.tween.onStepComplete&&this.runtime.safeCall(t.tween.onStepComplete),t.tween.finish(!0)}_advanceTo(t,i){let n=this._entries,r=[];for(let a of n)!a.started&&a.at<=t+Hn&&r.push({at:a.at,rank:a.fn?1:2,entry:a}),a.tween&&!a.done&&a.end<=t+Hn&&r.push({at:a.end,rank:0,entry:a});r.sort((a,s)=>a.at-s.at||a.rank-s.rank||a.entry.index-s.entry.index);let o=new Set;for(let{rank:a,entry:s}of r)if(a===1){if(s.started=!0,this.runtime.safeCall(s.fn),!this.playing||this.killed||this._entries!==n)return!1}else s.started||(this._startChild(s),o.add(s)),a===0&&!s.done&&this._finishChild(s);for(let a of n)!a.tween||!a.started||a.done||(o.has(a)?a.tween._advance(t-a.at,a.tween.loopCount):a.tween._advance(i,a.tween.loopCount));return!0}step(t){!this.playing||this.paused||this.killed||(this.elapsed+=t,this._advanceTo(this.elapsed,t)&&(this.elapsed+Hn<this._end||(this.onStepComplete&&this.runtime.safeCall(this.onStepComplete),this.loopIndex++,this.loops<0||this.loopIndex<this.loops?(this.elapsed=0,this._resetEntries()):this.finish(!0))))}Pause(){this.paused=!0}Resume(){this.paused=!1}Restart(){this.dead||this._play()}Complete(){this.dead||this.completed||(this._entries||this._schedule(),this.playing=!0,this.killed=!1,this._advanceTo(1/0,0)&&(this.onStepComplete&&this.runtime.safeCall(this.onStepComplete),this.finish(!0)))}Kill(t){t?this.Complete():this.finish(!1),this.dead=!0}SetOnComplete(t){return this.onComplete=t,this}SetOnStepComplete(t){return this.onStepComplete=t,this}SetLoops(t){return this.loops=t,this}finish(t){this.playing=!1,this.killed=!0,t&&(this.completed=!0),this.runtime.sequences.delete(this),this.runtime.animations.delete(this),t&&this.onComplete&&this.runtime.safeCall(this.onComplete)}};var Ui={EaseType:["Linear","InSine","OutSine","InOutSine","InQuad","OutQuad","InOutQuad","InCubic","OutCubic","InOutCubic","InQuart","OutQuart","InOutQuart","InQuint","OutQuint","InOutQuint","InExpo","OutExpo","InOutExpo","InCirc","OutCirc","InOutCirc","InBack","OutBack","InOutBack","InElastic","OutElastic","InOutElastic","InBounce","OutBounce","InOutBounce"],CustomVariableEntityType:["Level","PlayerSelf","AvatarSelf"],Device:["KeyboardAndMouse","Mobile","Controller","MobileController"],StageMode:["Beyond","Classic"],LanguageType:["LanguageNone","LanguageEng","LanguageChs","LanguageCht","LanguageFra","LanguageDeu","LanguageSpa","LanguagePor","LanguageRus","LanguageJpn","LanguageKor","LanguageTha","LanguageVie","LanguageInd","LanguageTur","LanguageIta"],ParamType:["Entity","EntityList","Int","IntList","Bool","BoolList","Float","FloatList","String","StringList","Vector3","Vector3List","Guid","GuidList","ConfigId","PrefabId","ConfigIdList","PrefabIdList"],CursorEventType:["CursorDown","CursorUp","CursorEnter","CursorExit","CursorDrag","CursorBeginDrag","CursorEndDrag","CursorClick"],ScrollDirection:["Horizontal","Vertical"],ScrollLayoutConstraint:["AutoWrap","Fixed"],ScrollAlignType:["Bottom","Center","Top"],ControllerNavigationDir:["Up","Down","Left","Right"],ControllerNavigationEventType:["Confirm","Cancel","Focus","LostFocus","RightStickUp","RightStickDown","RightStickRight","RightStickLeft","LeftStickUp","LeftStickDown","LeftStickRight","LeftStickLeft"],ControllerNavigationMode:["None","NearestControl","Specified"],TextHorizontalAlignment:["Left","Middle","Right"],TextVerticalAlignment:["Top","Middle","Bottom"],ImageType:["Basic","Stretch"],ImageSource:["StaticReference","Item","Equipment","Skill","UnitStatus","Faction","Currency","Prefab"],ImageFillType:["Unused","Horizontal","Vertical","Radial90","Radial180","Radial360"],ImageFillHorizontalType:["Left","Right"],ImageFillVerticalType:["Bottom","Top"],ImageFillRadial90Type:["BottomLeft","TopLeft","TopRight","BottomRight"],ImageFillRadialType:["Bottom","Left","Top","Right"],ImageMaskSoftEdgeMode:["Percentage","Pixel"],UIAnimationLayer:["AboveAllControls","BelowAllControls"]},zl=[...Array.from({length:43},(e,t)=>`CraftspersonKey${t+1}`),"MoveForwardKey","MoveBackwardKey","MoveLeftKey","MoveRightKey","SwitchToWalkOrRunKey","SprintKey","JumpKey","DropKey","OpenShortcutWheelKey","InteractKey","NormalAttackKey","CharacterSkill1Key","CharacterSkill2Key","CharacterSkill3Key","CharacterSkill4Key","None"],$l=[...Array.from({length:14},(e,t)=>`CraftspersonKey${t+1}`),"SprintKey","JumpKey","InteractKey","NormalAttackKey","CharacterSkill1Key","CharacterSkill2Key","CharacterSkill3Key","CharacterSkill4Key","MenuConfirmKey","MenuBackKey","None"];function Gl(){let e=[];for(let t of["Down","Up"]){for(let i=1;i<=43;i++)e.push(`KeyboardCraftspersonKey${i}${t}`);for(let i of["MoveForwardKey","MoveBackwardKey","MoveLeftKey","MoveRightKey","SwitchToWalkOrRunKey","SprintKey","JumpKey","DropKey","OpenShortcutWheelKey","InteractKey","NormalAttackKey","CharacterSkill1Key","CharacterSkill2Key","CharacterSkill3Key","CharacterSkill4Key"])e.push(`Keyboard${i}${t}`);for(let i=1;i<=14;i++)e.push(`ControllerCraftspersonKey${i}${t}`);for(let i of["SprintKey","JumpKey","InteractKey","NormalAttackKey","CharacterSkill1Key","CharacterSkill2Key","CharacterSkill3Key","CharacterSkill4Key","MenuConfirmKey","MenuBackKey"])e.push(`Controller${i}${t}`)}return e}Ui.KeyboardKeyCode=zl;Ui.ControllerKeyCode=$l;Ui.KeyEventType=Gl();var ea=new Map;function yt(e,t){let i=`${e}\0${t}`,n=ea.get(i);return n||(n={__kind:"EnumItem",Name:t,FullName:`Enum.${e}.${t}`,EnumType:e},ea.set(i,n)),n}function jn(e,t){return t==null?t:t.__kind==="EnumItem"?yt(t.EnumType||e,t.Name):typeof t=="string"&&t?yt(e,t):t}function Kn(){let e={};for(let[t,i]of Object.entries(Ui)){let n={};for(let r of i)n[r]=yt(t,r);e[t]=n}return e}var Dl=new Set(["Id","prefabIndex","imageId","fontSize","minimumFontSize","clickAudioId","itemCount","itemPrefabIndex","animationId","referencedPrefabIndex"]),Vl=new Set(["imageColor","fontColor","bgColor","outlineColor"]),ta={horizontalAlignment:"TextHorizontalAlignment",verticalAlignment:"TextVerticalAlignment",imageSource:"ImageSource",imageType:"ImageType",fillType:"ImageFillType",fillHorizontalType:"ImageFillHorizontalType",fillVerticalType:"ImageFillVerticalType",fillRadial90Type:"ImageFillRadial90Type",fillRadialType:"ImageFillRadialType",softEdgeMode:"ImageMaskSoftEdgeMode",layer:"UIAnimationLayer",scrollDirection:"ScrollDirection",layoutConstraint:"ScrollLayoutConstraint"},bt=c.LUA_REGISTRYINDEX,ia=c.LUA_MULTRET,Yl=Object.freeze({InstantiateClientUIControl:2,DestroyClientUIControl:1,GetClientUIControl:1,FindClientUIRoot:1,GetClientUIRoots:0,GetUICanvasSize:0,GetCursorUIPos:0,GetDevice:0,SetControllerFocus:1,GetControllerFocus:0,GetControllerLeftStickAxis:0,GetControllerRightStickAxis:0,Tween:3,TweenSequence:0,ServerSignal:1,GetGlobalCustomVariableValue:2,PauseLevelTime:1,IsLevelTimePaused:0,PlayAudio2D:1,StopAudio:1,IsAudioAlive:1,GetLanguageType:0,GetStageMode:0,IsTestPlay:0,GetText:1,PrintClientUITree:0});function Se(e){return e==null?"":typeof e=="string"?e:e.Name||e.FullName||String(e)}var Hi=class{constructor(t={}){this.canvasWidth=t.canvasWidth??1600,this.canvasHeight=t.canvasHeight??900,this.device=t.device??"KeyboardAndMouse",this.language=t.language??"LanguageChs",this.stageMode=t.stageMode??"Classic",this.testPlay=t.testPlay!==!1,this.canSelectImageType=t.canSelectImageType||(()=>!1),this.clock={time:0,levelTime:0,paused:!1,frame:0},this.logs=[],this.mountErrors=[],this.tweens=new Set,this.sequences=new Set,this.animations=new Set,this.audios=new Map,this.nextAudioId=1,this.audioDuration=t.audioDuration||(()=>null),this.audioHistory=[],this.audioWarnings=new Set,this.audioRevision=0,this._nextControlId=1,this._playRemoved=[],this._nextScriptMappingId=1,this.lifecyclePhase="idle",this.controlsById=new Map,this.roots=[],this.templates=new Map,this.scriptFiles=new Map,this.requireAliases=new Map,this.requireCache=new Map,this.moduleBaseEnvironments=new Map,this.luaFunctions=new Map,this.mountedScripts=[],this.serverVars={Level:Object.create(null),PlayerSelf:Object.create(null),AvatarSelf:Object.create(null)},this.serverBridge=null,this.varHandlers=[],this.signalHandlers=[],this.cursor={x:0,y:0},this.focus=null,this.stick={left:[0,0],right:[0,0]},this.enumTree=Kn(),this.luaStates=new Set,this.L=null}nextControlId(){let t=this._nextControlId;return this._nextControlId+=1,t}resolveScriptMappingId(t){let i=Number(t);if(Number.isSafeInteger(i)&&i>0)return this._nextScriptMappingId=Math.max(this._nextScriptMappingId,i+1),i;let n=this._nextScriptMappingId;return this._nextScriptMappingId+=1,n}pushPackedColor(t,i){let n=i>>>0;(n|0)===n?c.lua_pushinteger(t,n):c.lua_pushnumber(t,n)}retainLuaCallback(t){Yo(t)}unrefLuaCallback(t){Bo(this,t)}log(t,...i){let n=i.map(r=>r==null?"nil":typeof r=="object"&&r!==null&&r.__kind==="EnumItem"?r.Name:String(r)).join(" ");this.logs.push({level:t,text:n,time:this.clock.time})}safeCall(t,...i){try{return t(...i)}catch(n){this.log("lua-error",n&&n.message?n.message:String(n))}}scriptCanRun(t){if(!t?.alive||!t.enabled)return!1;let i=t.object;return!i||i.alive&&i.activeInHierarchy}cursorEventsEnabled(t){for(let i=t;i;i=i.parent)if(i.kind==="container"&&i.showCursor===!0)return!0;return!1}registerTemplate(t,i){this.templates.set(Number(t),i)}registerScriptFile(t,i){let n=this.normalizeRequirePath(t);this.scriptFiles.set(n,i),n.startsWith("default_import_file/")||this.requireAliases.set(`default_import_file/${n}`,n)}normalizeRequirePath(t){let i=String(t).replace(/\\/g,"/");return i.endsWith(".lua")&&(i=i.slice(0,-4)),i=i.replace(/\./g,"/"),i}addRoot(t){let i=t instanceof rt?t:new rt(this,t);return this.roots.push(i),$e(i,n=>this.controlsById.set(n.Id,n)),this.mountSpecScripts(t,i),i}mountSpecScripts(t,i){if(t instanceof rt)return;let n=o=>(o.scripts?.length||0)>0||(o.children||[]).some(n);if(!t||!n(t))return;let r=this.lifecyclePhase;try{let o=(a,s)=>{for(let l of a.scripts||[])try{this.mountScript({path:l.path,source:l.source,control:s,scriptMappingId:l.scriptMappingId})}catch(f){let d=f&&f.message?f.message:String(f);this.mountErrors.push(d),this.log("lua-error",d)}let u=a.children||[];for(let l=0;l<u.length;l+=1)o(u[l],s?.children?.[l])};o(t,i)}finally{this.lifecyclePhase=r}}makeCursorEventData({x:t=0,y:i=0,pressX:n=t,pressY:r=i,deltaX:o=t-n,deltaY:a=i-r,dragging:s=!1,touchId:u=-1}={}){let l=this;return{__kind:"CursorEventData",typeofName:"CursorEventData",dragging:s,touchId:u,x:t,y:i,pressX:n,pressY:r,GetUIPos(){return[t,i]},GetPressUIPos(){return[n,r]},GetUIPosDelta(){return[o,a]}}}boot(){let t=this.newLuaThread();this.L=t}installGlobals(t){let i=this;c.lua_pushcfunction(t,n=>{let r=c.lua_gettop(n),o=[];for(let a=1;a<=r;a++)o.push(me(n,i,a));return i.log("info",...o),0}),c.lua_setglobal(t,P("print")),c.lua_pushcfunction(t,n=>{let r=c.lua_gettop(n),o=[];for(let a=1;a<=r;a++)o.push(me(n,i,a));return i.log("error",...o),0}),c.lua_setglobal(t,P("printerr")),c.lua_pushcfunction(t,n=>{if(c.lua_type(n,1)===c.LUA_TTABLE&&!He(n,1))return c.lua_pushstring(n,P("table")),1;let r=me(n,i,1);return c.lua_pushstring(n,P(i.typeofOf(r))),1}),c.lua_setglobal(t,P("typeof")),this.pushColorLib(t),this.pushEnumLib(t),this.pushGameLib(t),c.lua_pushcfunction(t,n=>i.luaRequire(n)),c.lua_setglobal(t,P("require"))}typeofOf(t){return t==null?"nil":t.__kind==="Script"?"Script":t.__kind==="EnumItem"?"EnumItem":t.__kind==="CursorEventData"?"CursorEventData":t.__kind==="ServerSignal"?"ServerSignal":t instanceof Dt?"TweenSequence":t instanceof ui?"Tween":t.typeofName?t.typeofName:typeof t=="number"?"number":typeof t=="string"?"string":typeof t=="boolean"?"boolean":typeof t}pushColorLib(t){c.lua_newtable(t),c.lua_pushcfunction(t,i=>(this.pushPackedColor(i,Gt(c.lua_tonumber(i,1),c.lua_tonumber(i,2),c.lua_tonumber(i,3),255)),1)),c.lua_setfield(t,-2,P("FromRGB")),c.lua_pushcfunction(t,i=>{let n=c.lua_isnoneornil(i,4)?255:c.lua_tonumber(i,4);return this.pushPackedColor(i,Gt(c.lua_tonumber(i,1),c.lua_tonumber(i,2),c.lua_tonumber(i,3),n)),1}),c.lua_setfield(t,-2,P("FromRGBA")),c.lua_pushcfunction(t,i=>{let n=c.lua_tonumber(i,1)>>>0;for(let r of li(n))c.lua_pushinteger(i,r);return 4}),c.lua_setfield(t,-2,P("ToRGBA")),c.lua_newtable(t),c.lua_pushcfunction(t,i=>{let n=c.lua_tonumber(i,2),r=c.lua_tonumber(i,3),o=c.lua_tonumber(i,4),a=c.lua_isnoneornil(i,5)?255:c.lua_tonumber(i,5);return this.pushPackedColor(i,Gt(n,r,o,a)),1}),c.lua_setfield(t,-2,P("__call")),c.lua_setmetatable(t,-2),c.lua_setglobal(t,P("Color"))}pushEnumLib(t){c.lua_newtable(t);for(let[i,n]of Object.entries(this.enumTree)){c.lua_newtable(t);for(let[r,o]of Object.entries(n))this.pushEnumItem(t,o),c.lua_setfield(t,-2,P(r));c.lua_setfield(t,-2,P(i))}c.lua_setglobal(t,P("Enum"))}pushEnumItem(t,i){let n=c.lua_newuserdata(t,0);gt(n,i),J.luaL_setmetatable(t,P("EnumItem"))}pushControl(t,i){let n=c.lua_newuserdata(t,0);gt(n,i),J.luaL_setmetatable(t,P("Control"))}pushScript(t,i){c.lua_newtable(t),c.lua_pushlightuserdata(t,Yn);let n=c.lua_newuserdata(t,0);gt(n,i),c.lua_rawset(t,-3),J.luaL_getmetatable(t,P("Script")),c.lua_setmetatable(t,-2)}pushTween(t,i){let n=c.lua_newuserdata(t,0);gt(n,i);let r=i instanceof Dt?"TweenSequence":"Tween";J.luaL_setmetatable(t,P(r))}pushSignal(t,i){let n=c.lua_newuserdata(t,0);gt(n,i),J.luaL_setmetatable(t,P("ServerSignal"))}pushCursor(t,i){let n=c.lua_newuserdata(t,0);gt(n,i),J.luaL_setmetatable(t,P("CursorEventData"))}pushGameLib(t){let i=this;c.lua_newtable(t);let n={InstantiateClientUIControl:r=>{let o=c.lua_tointeger(r,1),a=xe(c.lua_touserdata(r,2)),s=i.instantiate(o,a,i.lifecyclePhase);return s?(i.pushControl(r,s),1):(c.lua_pushnil(r),1)},DestroyClientUIControl:r=>{let o=xe(c.lua_touserdata(r,1));return o&&i.destroyControl(o),0},GetClientUIControl:r=>{let o=c.lua_tointeger(r,1),a=i.controlsById.get(o);return a?i.pushControl(r,a):c.lua_pushnil(r),1},FindClientUIRoot:r=>{let o=Q(r,1),a=i.roots.find(s=>s.name===o);return a?i.pushControl(r,a):c.lua_pushnil(r),1},GetClientUIRoots:r=>(c.lua_createtable(r,i.roots.length,0),i.roots.forEach((o,a)=>{i.pushControl(r,o),c.lua_rawseti(r,-2,a+1)}),1),GetUICanvasSize:r=>(c.lua_pushnumber(r,i.canvasWidth),c.lua_pushnumber(r,i.canvasHeight),2),GetCursorUIPos:r=>(c.lua_pushnumber(r,i.cursor.x),c.lua_pushnumber(r,i.cursor.y),2),GetDevice:r=>(i.pushEnumItem(r,yt("Device",i.device)),1),SetControllerFocus:r=>(i.focus=xe(c.lua_touserdata(r,1)),0),GetControllerFocus:r=>(i.focus?i.pushControl(r,i.focus):c.lua_pushnil(r),1),GetControllerLeftStickAxis:r=>(c.lua_pushnumber(r,i.stick.left[0]),c.lua_pushnumber(r,i.stick.left[1]),2),GetControllerRightStickAxis:r=>(c.lua_pushnumber(r,i.stick.right[0]),c.lua_pushnumber(r,i.stick.right[1]),2),Tween:r=>{let o=xe(c.lua_touserdata(r,1))||me(r,i,1),a=me(r,i,2)||{},s=c.lua_tonumber(r,3),u=new ui(i,o,a,s);return i.pushTween(r,u),1},TweenSequence:r=>(i.pushTween(r,new Dt(i)),1),ServerSignal:r=>{let o=Q(r,1);return i.pushSignal(r,i.makeServerSignal(o)),1},GetGlobalCustomVariableValue:r=>{let o=Se(me(r,i,1)),a=Q(r,2);return ae(r,i,i.getVar(o,a)),1},PauseLevelTime:r=>(i.clock.paused=!!c.lua_toboolean(r,1),0),IsLevelTimePaused:r=>(c.lua_pushboolean(r,i.clock.paused),1),PlayAudio2D:r=>{let o=i.playAudio(i.audioInteger(r));return c.lua_pushinteger(r,o),1},StopAudio:r=>(i.stopAudio(i.audioInteger(r)),0),IsAudioAlive:r=>{let o=i.audios.get(i.audioInteger(r));return c.lua_pushboolean(r,!!(o&&o.alive)),1},GetLanguageType:r=>(i.pushEnumItem(r,yt("LanguageType",i.language)),1),GetStageMode:r=>(i.pushEnumItem(r,yt("StageMode",i.stageMode)),1),IsTestPlay:r=>(c.lua_pushboolean(r,i.testPlay),1),GetText:r=>{let o=Q(r,1);return c.lua_pushstring(r,P(o)),1},PrintClientUITree:r=>{for(let o of i.roots)i.log("info",Un(o).join(`
|
|
110
|
-
`));return 0}};for(let[r,o]of Object.entries(n)){let a=Yl[r];if(a===void 0)throw new Error(`missing game arity for ${r}`);c.lua_pushcfunction(t,s=>{let u=c.lua_gettop(s);return u!==a?J.luaL_error(s,P(`bad argument count to '${r}' (${a} expected, got ${u})`)):o(s)}),c.lua_setfield(t,-2,P(r))}c.lua_setglobal(t,P("game"))}makeServerSignal(t){let i=[],n=this;return{__kind:"ServerSignal",name:t,AddParam(r,o){i.push({type:Se(r),value:o})},AddInt(r){i.push({type:"Int",value:r})},AddIntList(r){i.push({type:"IntList",value:r})},AddFloat(r){i.push({type:"Float",value:r})},AddFloatList(r){i.push({type:"FloatList",value:r})},AddString(r){i.push({type:"String",value:r})},AddStringList(r){i.push({type:"StringList",value:r})},AddVector3(r){i.push({type:"Vector3",value:r})},AddVector3List(r){i.push({type:"Vector3List",value:r})},AddBool(r){i.push({type:"Bool",value:r})},AddBoolList(r){i.push({type:"BoolList",value:r})},AddGuid(r){i.push({type:"Guid",value:r})},AddGuidList(r){i.push({type:"GuidList",value:r})},AddEntity(r){i.push({type:"Entity",value:r})},AddEntityList(r){i.push({type:"EntityList",value:r})},AddPrefabId(r){i.push({type:"PrefabId",value:r})},AddPrefabIdList(r){i.push({type:"PrefabIdList",value:r})},AddConfigId(r){i.push({type:"ConfigId",value:r})},AddConfigIdList(r){i.push({type:"ConfigIdList",value:r})},SendSignal(){let r=i.slice();n.serverBridge&&typeof n.serverBridge.receiveFromClient=="function"&&n.serverBridge.receiveFromClient(t,r)}}}audioInteger(t){let i=c.lua_tonumber(t,1);return c.lua_type(t,1)!==c.LUA_TNUMBER||!Number.isSafeInteger(i)?J.luaL_error(t,P("audio argument must be an integer")):i}playAudio(t){this.audioRevision++;let i=this.nextAudioId++,n=this.audioDuration(t),r=Number.isFinite(n)&&n>0,o={instanceId:i,audioId:t,startedAt:this.clock.time,duration:r?n:0,alive:r,stopped:!1};return this.audioHistory.push(o),this.audioHistory.length>128&&this.audioHistory.shift(),r?(this.audios.size>=128&&this.stopAudio(this.audios.keys().next().value),this.audios.set(i,o)):this.audioWarnings.has(t)||(this.audioWarnings.size>=128&&this.audioWarnings.delete(this.audioWarnings.values().next().value),this.audioWarnings.add(t),this.log("warn",`\u97F3\u6548 ${t} \u672A\u5217\u5165\u6A21\u62DF\u5668\u97F3\u9891\u767D\u540D\u5355`)),i}stopAudio(t){let i=this.audios.get(t)||this.audioHistory.find(n=>n.instanceId===t);i&&!i.stopped&&(i.alive=!1,i.stopped=!0,this.audioRevision++),this.audios.delete(t)}audioSnapshot(){return{sequence:this.nextAudioId-1,revision:this.audioRevision,active:[...this.audios.values()].map(t=>({...t})),recent:this.audioHistory.map(t=>({...t}))}}instantiate(t,i,n){if(n==="OnInit"||n==="OnDestroy")return null;let r=this.templates.get(Number(t));if(!r||!i)return null;let o=new rt(this,{...r,Id:this.nextControlId(),authoringId:null,prefabIndex:Number(t)});return i.addChild(o),o.SetAsLastSibling(),$e(o,a=>this.controlsById.set(a.Id,a)),this.mountSpecScripts(r,o),o}destroyControl(t){if(!(!t||!t.alive)){if(t._destroying)throw new Error(`\u5BA2\u6237\u7AEF\u63A7\u4EF6\u751F\u547D\u5468\u671F\u5904\u4E8E\u521B\u5EFA\u6216\u9500\u6BC1\u65F6\uFF0C\u65E0\u6CD5\u8C03\u7528DestroyClientUIControl, ID:${t.name}`);$e(t,i=>{i._destroying=!0}),this._destroyControlTree(t)}}_destroyControlTree(t){this.releaseControlListeners(t);for(let i of t.scripts.slice())this.unmountScript(i);for(let i of t.children.slice())this._destroyControlTree(i);if(t.alive=!1,this.scrollControls?.delete(t),this._playRemoved.push(t.Id),t.parent){let i=t.parent,n=i.children.indexOf(t);n>=0&&i.children.splice(n,1),t._parent=null,i.markPlayDirty(!0)}else{let i=this.roots.indexOf(t);i>=0&&this.roots.splice(i,1)}this.controlsById.delete(t.Id),this.focus===t&&(this.focus=null);for(let i of[...this.tweens])i.object===t&&i.Kill(!1)}releaseControlListeners(t){for(let i of t.cursorListeners.values())for(let n of i)this.unrefLuaCallback(n);for(let i of t.keyListeners.values())for(let n of i)this.unrefLuaCallback(n);for(let i of t.navListeners.values())for(let n of i)this.unrefLuaCallback(n);t.cursorListeners.clear(),t.keyListeners.clear(),t.navListeners.clear(),t.navConfig.clear()}onControlActiveChanging(t,i){let n=[];$e(t,r=>n.push({control:r,was:r.activeInHierarchy})),t.active=!!i,t.markPlayDirty(!0);for(let r of n){let o=r.control.activeInHierarchy;if(r.was!==o)for(let a of r.control.scripts.slice())o?this.enableScript(a):this.disableScript(a)}}bindScriptEnv(t){let i=t.env;return i?(this.pushScript(i,t),c.lua_setglobal(i,P("script")),i):null}disableScript(t){if(!t?.alive||!t.env||t.lifecyclePhase!=="running")return;let i=this.lifecyclePhase;this.lifecyclePhase="OnDisable",t.lifecyclePhase="OnDisable",this.bindScriptEnv(t),this.callGlobal(t.env,"OnDisable"),t.lifecyclePhase="disabled",this.lifecyclePhase=i}enableScript(t){if(!t?.alive||!t.env||t.lifecyclePhase!=="disabled")return;let i=this.lifecyclePhase;this.lifecyclePhase="OnEnable",t.lifecyclePhase="OnEnable",this.bindScriptEnv(t),this.callGlobal(t.env,"OnEnable"),t.lifecyclePhase="running",this.lifecyclePhase=i}unmountScript(t){if(!t||!t.alive)return;let i=t.env,n=this.lifecyclePhase;i&&(t.lifecyclePhase==="running"&&(this.lifecyclePhase="OnDisable",t.lifecyclePhase="OnDisable",this.bindScriptEnv(t),this.callGlobal(i,"OnDisable")),this.lifecyclePhase="OnDestroy",t.lifecyclePhase="OnDestroy",this.bindScriptEnv(t),this.callGlobal(i,"OnDestroy")),t.alive=!1,t.lifecyclePhase="destroyed",this.lifecyclePhase=n,this.mountedScripts=this.mountedScripts.filter(r=>r!==t),t.object&&(t.object.scripts=t.object.scripts.filter(r=>r!==t)),this.varHandlers=this.varHandlers.filter(r=>r.script!==t),this.signalHandlers=this.signalHandlers.filter(r=>r.script!==t),i&&i!==this.L&&this.closeTrackedLuaState(i),t.env=null}installMetatables(t){this.mtEnum(t),this.mtControl(t),this.mtScript(t),this.mtTween(t),this.mtSeq(t),this.mtSignal(t),this.mtCursor(t)}mtIndexNewindex(t,i,n,r,o,a){J.luaL_newmetatable(t,P(i)),c.lua_pushcfunction(t,s=>{let u=He(s,1)||xe(c.lua_touserdata(s,1)),l=Q(s,2);if(o[l]&&(!a||a(u,l)))return c.lua_pushcfunction(s,o[l]),1;let f;try{f=n(u,l)}catch(d){return J.luaL_error(s,P(String(d.message||d)))}return f===void 0?(c.lua_pushnil(s),1):(ae(s,this,f),1)}),c.lua_setfield(t,-2,P("__index")),c.lua_pushcfunction(t,s=>{try{let u=He(s,1)||xe(c.lua_touserdata(s,1)),l=Q(s,2),f=me(s,this,3);return r(u,l,f),0}catch(u){return c.lua_pushstring(s,P(String(u.message||u))),c.lua_error(s)}}),c.lua_setfield(t,-2,P("__newindex")),c.lua_pushcfunction(t,s=>{let u=He(s,1)||xe(c.lua_touserdata(s,1)),l=He(s,2)||xe(c.lua_touserdata(s,2));return c.lua_pushboolean(s,u===l),1}),c.lua_setfield(t,-2,P("__eq")),c.lua_pop(t,1)}method(t){let i=this;return n=>{let r=He(n,1)||xe(c.lua_touserdata(n,1)),o=c.lua_gettop(n),a=[];for(let s=2;s<=o;s++)a.push(me(n,i,s));try{let s=t(r,...a);if(s===r)return c.lua_pushvalue(n,1),1;if(s===void 0)return 0;if(Array.isArray(s)&&s.__multi){for(let u of s)ae(n,i,u);return s.length}if(Array.isArray(s)&&!(s.length&&typeof s[0]=="object"&&s[0]?.typeofName)){if(s.__controls)return c.lua_createtable(n,s.length,0),s.forEach((u,l)=>{i.pushControl(n,u),c.lua_rawseti(n,-2,l+1)}),1;if(s.__scripts)return c.lua_createtable(n,s.length,0),s.forEach((u,l)=>{i.pushScript(n,u),c.lua_rawseti(n,-2,l+1)}),1;if(typeof s[0]=="number"&&s.length<=4){for(let u of s)c.lua_pushnumber(n,u);return s.length}}return ae(n,i,s),1}catch(s){return c.lua_pushstring(n,P(String(s.message||s))),c.lua_error(n)}}}mtEnum(t){let i=new Set(["Name","FullName","EnumType"]);this.mtIndexNewindex(t,"EnumItem",(n,r)=>i.has(r)?n[r]:void 0,(n,r)=>{throw new Error(`cannot set ${r}, no such field`)},{})}mtCursor(t){let i=new Set(["dragging","touchId"]);this.mtIndexNewindex(t,"CursorEventData",(n,r)=>i.has(r)?n[r]:void 0,(n,r)=>{throw new Error(`cannot set ${r}, no such field`)},{GetUIPos:this.method(n=>n.GetUIPos()),GetPressUIPos:this.method(n=>n.GetPressUIPos()),GetUIPosDelta:this.method(n=>n.GetUIPosDelta())})}mtControl(t){let i=this.method((r,o)=>r.SetVisible(o)),n={GetChildren:this.method(r=>{let o=r.GetChildren();return o.__controls=!0,o}),GetChild:this.method((r,o)=>r.GetChild(o)),FindChild:this.method((r,o)=>r.FindChild(o)),SetActive:this.method((r,o)=>r.SetActive(o)),SetVisible:r=>c.lua_isboolean(r,2)?i(r):J.luaL_error(r,P("bad argument #2 to 'SetVisible' (boolean expected, got %s)"),J.luaL_typename(r,2)),GetSiblingIndex:this.method(r=>r.GetSiblingIndex()),SetSiblingIndex:this.method((r,o)=>r.SetSiblingIndex(o)),SetAsFirstSibling:this.method(r=>r.SetAsFirstSibling()),SetAsLastSibling:this.method(r=>r.SetAsLastSibling()),GetAnchoredPosition:this.method(r=>r.GetAnchoredPosition()),SetAnchoredPosition:this.method((r,o,a)=>r.SetAnchoredPosition(o,a)),GetSizeDelta:this.method(r=>r.GetSizeDelta()),SetSizeDelta:this.method((r,o,a)=>r.SetSizeDelta(o,a)),GetAnchorMin:this.method(r=>r.GetAnchorMin()),SetAnchorMin:this.method((r,o,a)=>r.SetAnchorMin(o,a)),GetAnchorMax:this.method(r=>r.GetAnchorMax()),SetAnchorMax:this.method((r,o,a)=>r.SetAnchorMax(o,a)),GetPivot:this.method(r=>r.GetPivot()),SetPivot:this.method((r,o,a)=>r.SetPivot(o,a)),GetLocalScale:this.method(r=>r.GetLocalScale()),SetLocalScale:this.method((r,o,a,s)=>r.SetLocalScale(o,a,s)),GetLocalRotation:this.method(r=>r.GetLocalRotation()),SetLocalRotation:this.method((r,o,a,s)=>r.SetLocalRotation(o,a,s)),GetScriptByPath:this.method((r,o)=>r.GetScriptByPath(o)),GetScript:this.method((r,o)=>r.GetScript(o)),GetScripts:this.method(r=>{let o=r.GetScripts();return o.__scripts=!0,o}),AddCursorEventListener:this.method((r,o,a)=>r.AddCursorEventListener(Se(o),a)),RemoveCursorEventListener:this.method((r,o,a)=>r.RemoveCursorEventListener(Se(o),a)),RemoveCursorEventListeners:this.method((r,o)=>r.RemoveCursorEventListeners(Se(o))),RemoveAllCursorEventListeners:this.method(r=>r.RemoveAllCursorEventListeners()),SimulateCursorClick:this.method(r=>r.SimulateCursorClick()),AddKeyEventListener:this.method((r,o,a)=>r.AddKeyEventListener(Se(o),a)),RemoveKeyEventListener:this.method((r,o,a)=>r.RemoveKeyEventListener(Se(o),a)),RemoveKeyEventListeners:this.method((r,o)=>r.RemoveKeyEventListeners(Se(o))),RemoveAllKeyEventListeners:this.method(r=>r.RemoveAllKeyEventListeners()),AddNavigationEventListener:this.method((r,o,a)=>r.AddNavigationEventListener(Se(o),a)),RemoveNavigationEventListener:this.method((r,o,a)=>r.RemoveNavigationEventListener(Se(o),a)),RemoveNavigationEventListeners:this.method((r,o)=>r.RemoveNavigationEventListeners(Se(o))),RemoveAllNavigationEventListeners:this.method(r=>r.RemoveAllNavigationEventListeners()),SetControllerNavigation:this.method((r,o,a,s)=>r.SetControllerNavigation(Se(o),a,s)),GetControllerNavigation:this.method((r,o)=>r.GetControllerNavigation(Se(o))),SetImage:this.method((r,o,a)=>r.SetImage(o,a)),SetSoftEdgeWidth:this.method((r,o,a)=>r.SetSoftEdgeWidth(o,a)),SetFillUnused:this.method(r=>r.SetFillUnused()),SetFillHorizontal:this.method((r,o,a)=>r.SetFillHorizontal(o,a)),SetFillVertical:this.method((r,o,a)=>r.SetFillVertical(o,a)),SetFillRadial90:this.method((r,o,a)=>r.SetFillRadial90(o,a)),SetFillRadial180:this.method((r,o,a)=>r.SetFillRadial180(o,a)),SetFillRadial360:this.method((r,o,a)=>r.SetFillRadial360(o,a)),PlayAnimation:this.method(r=>r.PlayAnimation()),StopAnimation:this.method(r=>r.StopAnimation()),RefreshItems:this.method((r,o,a)=>{this.retainLuaCallback(a);try{r.RefreshItems(o,a)}finally{this.unrefLuaCallback(a)}}),GetItemIndex:this.method((r,o)=>r.GetItemIndex(o)),GetItemSize:this.method(r=>r.GetItemSize()),GetItemSpacing:this.method(r=>r.GetItemSpacing()),GetPadding:this.method(r=>r.GetPadding()),ScrollToItemAt:this.method((r,o,a)=>r.ScrollToItemAt(o,a)),GetContentLength:this.method(r=>r.GetContentLength())};this.mtIndexNewindex(t,"Control",(r,o)=>{if(!Xn(r,o))return;if(!r.alive&&o!=="alive")throw new Error(`attempt to read '${o}' of a destroyed control`);let a=r.luaFieldValue(o),s=ta[o];return s?jn(s,a):typeof a=="number"&&!Dl.has(o)&&!Vl.has(o)?new oi(a):a},(r,o,a)=>{if(Xn(r,o)==="rw"){if((o==="fontSize"||o==="minimumFontSize")&&!Number.isInteger(a)){let l=a===null?"nil":typeof a;throw new Error(`bad argument #2 to '${o}' (integer expected, got ${l})`)}let u=ta[o];if(o==="imageType"&&(a?.EnumType!=="ImageType"||!["Basic","Stretch"].includes(a.Name)))throw new Error("imageType requires Enum.ImageType.Basic or Stretch");r[o]=u?jn(u,a):a,typeof r.markPlayDirty=="function"&&r.markPlayDirty(Yi.has(o));return}throw new Error(`cannot set ${o}, no such field`)},n,Wo)}mtScript(t){let i=this,n=new Set(["alive","scriptMappingId","object","path","enabled"]);this.mtIndexNewindex(t,"Script",(r,o)=>n.has(o)?r[o]:void 0,(r,o,a)=>{if(o==="enabled"){r.enabled=!!a;return}throw new Error(`cannot set ${o}, no such field`)},{GetParam:this.method((r,o)=>Object.prototype.hasOwnProperty.call(r.params,o)?r.params[o]:null),Invoke:r=>i.luaInvoke(r),EnableUpdate:this.method((r,o)=>{r.updateEnabled=!!o}),RegisterServerSignalHandler:this.method((r,o,a)=>{i.signalHandlers.push({script:r,name:o,fn:a})}),UnregisterServerSignalHandler:this.method((r,o)=>{i.signalHandlers=i.signalHandlers.filter(a=>!(a.script===r&&a.name===o))}),RegisterCustomVariableChangedHandler:this.method((r,o,a,s)=>{i.varHandlers.push({script:r,entityType:Se(o),name:a,fn:s})}),UnregisterCustomVariableChangedHandler:this.method((r,o,a)=>{let s=Se(o);i.varHandlers=i.varHandlers.filter(u=>!(u.script===r&&u.entityType===s&&u.name===a))})})}mtTween(t){this.mtIndexNewindex(t,"Tween",()=>{},()=>{},{SetEase:this.method((i,n)=>i.SetEase(n)),SetRelative:this.method((i,n)=>i.SetRelative(n)),Play:this.method(i=>i.Play()),Pause:this.method(i=>i.Pause()),Resume:this.method(i=>i.Resume()),Restart:this.method(i=>i.Restart()),Complete:this.method(i=>i.Complete()),Kill:this.method((i,n)=>i.Kill(n)),SetOnComplete:this.method((i,n)=>i.SetOnComplete(n)),SetOnStepComplete:this.method((i,n)=>i.SetOnStepComplete(n)),SetLoops:this.method((i,n)=>i.SetLoops(n))})}mtSeq(t){this.mtIndexNewindex(t,"TweenSequence",()=>{},()=>{},{Append:this.method((i,n)=>i.Append(n)),AppendInterval:this.method((i,n)=>i.AppendInterval(n)),AppendCallback:this.method((i,n)=>i.AppendCallback(n)),Join:this.method((i,n)=>i.Join(n)),Insert:this.method((i,n,r)=>i.Insert(n,r)),InsertCallback:this.method((i,n,r)=>i.InsertCallback(n,r)),Play:this.method(i=>i.Play()),Pause:this.method(i=>i.Pause()),Resume:this.method(i=>i.Resume()),Restart:this.method(i=>i.Restart()),Complete:this.method(i=>i.Complete()),Kill:this.method((i,n)=>i.Kill(n)),SetOnComplete:this.method((i,n)=>i.SetOnComplete(n)),SetOnStepComplete:this.method((i,n)=>i.SetOnStepComplete(n)),SetLoops:this.method((i,n)=>i.SetLoops(n))})}mtSignal(t){this.mtIndexNewindex(t,"ServerSignal",()=>{},()=>{},{AddParam:this.method((i,n,r)=>i.AddParam(n,r)),SendSignal:this.method(i=>i.SendSignal()),AddInt:this.method((i,n)=>i.AddInt(n)),AddIntList:this.method((i,n)=>i.AddIntList(n)),AddFloat:this.method((i,n)=>i.AddFloat(n)),AddFloatList:this.method((i,n)=>i.AddFloatList(n)),AddString:this.method((i,n)=>i.AddString(n)),AddStringList:this.method((i,n)=>i.AddStringList(n)),AddVector3:this.method((i,n)=>i.AddVector3(n)),AddVector3List:this.method((i,n)=>i.AddVector3List(n)),AddBool:this.method((i,n)=>i.AddBool(n)),AddBoolList:this.method((i,n)=>i.AddBoolList(n)),AddGuid:this.method((i,n)=>i.AddGuid(n)),AddGuidList:this.method((i,n)=>i.AddGuidList(n)),AddEntity:this.method((i,n)=>i.AddEntity(n)),AddEntityList:this.method((i,n)=>i.AddEntityList(n)),AddPrefabId:this.method((i,n)=>i.AddPrefabId(n)),AddPrefabIdList:this.method((i,n)=>i.AddPrefabIdList(n)),AddConfigId:this.method((i,n)=>i.AddConfigId(n)),AddConfigIdList:this.method((i,n)=>i.AddConfigIdList(n))})}luaRequire(t){let i=Q(t,1),n=this.normalizeRequirePath(i),r=this.requireAliases.get(n)||n;c.lua_rawgeti(t,bt,c.LUA_RIDX_MAINTHREAD);let o=c.lua_tothread(t,-1);c.lua_pop(t,1);let a=this.requireCache.get(o);a||(a=new Map,this.requireCache.set(o,a));let s=a.get(r);if(s?.loading)return c.lua_pushstring(t,P(`failed to load script '${n}': cyclic require`)),c.lua_error(t);if(s&&s.ref!=null)return c.lua_rawgeti(t,bt,s.ref),1;let u=this.scriptFiles.get(r);if(u==null)return c.lua_pushstring(t,P(`failed to load script '${n}'`)),c.lua_error(t);let l=c.lua_gettop(t);a.set(r,{loading:!0});try{this.loadModule(t,o,r,u),c.lua_pushvalue(t,-1);let f=J.luaL_ref(t,bt);return a.set(r,{ref:f}),1}catch(f){return a.delete(r),c.lua_settop(t,l),c.lua_pushstring(t,P(`failed to load script '${n}': ${f.message||f}`)),c.lua_error(t)}}newLuaThread(){let t=J.luaL_newstate();return Go.luaL_openlibs(t),Uo(t),this.installMetatables(t),this.installGlobals(t),this.luaStates.add(t),c.lua_pushglobaltable(t),this.copyLuaEnvironment(t,-1),c.lua_remove(t,-2),this.moduleBaseEnvironments.set(t,J.luaL_ref(t,bt)),t}copyLuaEnvironment(t,i){let n=c.lua_absindex(t,i);c.lua_newtable(t);let r=c.lua_absindex(t,-1);for(c.lua_pushnil(t);c.lua_next(t,n)!==0;)c.lua_pushvalue(t,-2),c.lua_pushvalue(t,-2),c.lua_rawset(t,r),c.lua_pop(t,1);c.lua_pushvalue(t,r),c.lua_setfield(t,r,P("_G"))}closeTrackedLuaState(t){if(!t||!this.luaStates.has(t))return;for(let n of this.requireCache.get(t)?.values()||[])n.ref!=null&&J.luaL_unref(t,bt,n.ref);this.requireCache.delete(t);let i=this.moduleBaseEnvironments.get(t);if(i!=null&&J.luaL_unref(t,bt,i),this.moduleBaseEnvironments.delete(t),this.luaStates.delete(t),this.luaFunctions)for(let[n,r]of this.luaFunctions)r.__luaState===t&&this.luaFunctions.delete(n);Xo(t)}loadModule(t,i,n,r){let o={__kind:"Script",alive:!0,scriptMappingId:this.resolveScriptMappingId(),object:null,path:n,enabled:!0,updateEnabled:!1,params:{},env:t,invoke(){}},a=String(r).replace(/^\uFEFF/,""),s=Di(a);if(J.luaL_loadbuffer(t,s,s.length,P(`@${n}`))!==Re)throw new Error(Q(t,-1));let l=c.lua_absindex(t,-1);if(c.lua_rawgeti(t,bt,this.moduleBaseEnvironments.get(i)),this.copyLuaEnvironment(t,-1),c.lua_remove(t,-2),this.pushScript(t,o),c.lua_setfield(t,-2,P("script")),c.lua_setupvalue(t,l,1),c.lua_pcall(t,0,1,0)!==Re)throw new Error(Q(t,-1))}mountScript({path:t,source:i,control:n,params:r={},scriptMappingId:o=void 0}){this.L||this.boot();let a=this.newLuaThread(),s={__kind:"Script",alive:!0,scriptMappingId:this.resolveScriptMappingId(o),object:n,path:this.normalizeRequirePath(t),enabled:!0,updateEnabled:!1,params:r,env:a,lifecyclePhase:"idle"};s.invoke=(l,f)=>this.invokeOn(a,l,f),n&&n.scripts.push(s),this.mountedScripts.push(s),this.pushScript(a,s),c.lua_setglobal(a,P("script"));let u=this.lifecyclePhase;try{this.lifecyclePhase="OnInit",s.lifecyclePhase="OnInit",this.runChunk(a,i,t);let l=this.callGlobal(a,"OnInit");l&&this.mountErrors.push(l),this.lifecyclePhase="OnEnable",s.lifecyclePhase="OnEnable";let f=this.callGlobal(a,"OnEnable");f&&this.mountErrors.push(f),this.lifecyclePhase="OnStart",s.lifecyclePhase="OnStart";let d=this.callGlobal(a,"OnStart");return d&&this.mountErrors.push(d),this.lifecyclePhase="running",s.lifecyclePhase="running",s}catch(l){throw s.alive=!1,s.lifecyclePhase="failed",this.mountedScripts=this.mountedScripts.filter(f=>f!==s),n&&(n.scripts=n.scripts.filter(f=>f!==s)),this.varHandlers=this.varHandlers.filter(f=>f.script!==s),this.signalHandlers=this.signalHandlers.filter(f=>f.script!==s),this.lifecyclePhase=u,a&&a!==this.L&&this.closeTrackedLuaState(a),s.env=null,l}}runChunk(t,i,n){let r=String(i).replace(/^\uFEFF/,""),o=Di(r),a=J.luaL_loadbuffer(t,o,o.length,P(`@${n}`));if(a!==Re){let u=Q(t,-1)||`luaL_loadbuffer status ${a}`;throw c.lua_pop(t,1),new Error(u)}let s=c.lua_pcall(t,0,0,0);if(s!==Re){let u=Q(t,-1)||`lua_pcall status ${s}`;throw c.lua_pop(t,1),new Error(u)}}callGlobal(t,i){if(c.lua_getglobal(t,P(i)),c.lua_isfunction(t,-1)){if(c.lua_pcall(t,0,0,0)!==Re){let r=Q(t,-1);c.lua_pop(t,1);let o=`${i}: ${r}`;return this.log("lua-error",o),o}}else c.lua_pop(t,1);return null}callGlobalDt(t,i,n){if(c.lua_getglobal(t,P(i)),c.lua_isfunction(t,-1)){if(c.lua_pushnumber(t,n),c.lua_pcall(t,1,0,0)!==Re){let o=Q(t,-1);c.lua_pop(t,1),this.log("lua-error",`${i}: ${o}`)}}else c.lua_pop(t,1)}luaInvoke(t){let i=He(t,1);if(!i||i.__kind!=="Script")return J.luaL_error(t,P("bad self to 'Invoke' (Script expected)"));let n=Q(t,2),r=i.env;if(!r||r.l_G!==t.l_G){let u=[];for(let d=3;d<=c.lua_gettop(t);d++)u.push(me(t,this,d));let l;try{l=i.invoke(n,u)}catch(d){return J.luaL_error(t,P(String(d.message||d)))}if(l===void 0)return 0;let f=Array.isArray(l)&&l.__multi?l:[l];for(let d of f)ae(t,this,d);return f.length}let o=2;if(c.lua_getglobal(t,P(n)),!c.lua_isfunction(t,-1))return 0;c.lua_replace(t,o),c.lua_remove(t,1);let a=c.lua_gettop(t)-1;return c.lua_pcall(t,a,ia,0)!==Re?c.lua_error(t):c.lua_gettop(t)}invokeOn(t,i,n){let r=c.lua_gettop(t);if(c.lua_getglobal(t,P(i)),!c.lua_isfunction(t,-1)){c.lua_settop(t,r);return}for(let u of n)ae(t,this,u);if(c.lua_pcall(t,n.length,ia,0)!==Re){let u=Q(t,-1);throw c.lua_settop(t,r),new Error(u)}let a=c.lua_gettop(t)-r;if(a<=0){c.lua_settop(t,r);return}if(a===1){let u=me(t,this,-1);return c.lua_settop(t,r),u}let s=[];for(let u=1;u<=a;u++)s.push(me(t,this,r+u));return c.lua_settop(t,r),s.__multi=!0,s}runScriptPhase(t,i){for(let n of this.mountedScripts){if(!this.scriptCanRun(n))continue;let r=n.env;r&&(this.pushScript(r,n),c.lua_setglobal(r,P("script")),!(t==="OnUpdate"&&!n.updateEnabled)&&this.callGlobalDt(r,t,i))}}step(t=1/30){if(typeof t!="number"||!Number.isFinite(t)||t<0)throw new TypeError("dt must be a finite non-negative number");this.clock.frame++,this.clock.time+=t;for(let[n,r]of this.audios)this.clock.time+1e-9>=r.startedAt+r.duration&&(r.alive=!1,this.audios.delete(n),this.audioRevision++);let i=!this.clock.paused;for(let n of[...this.animations])n.step(t);this.runScriptPhase("OnUpdate",t),i&&(this.clock.levelTime+=t,this.runScriptPhase("OnLevelUpdate",t))}injectKey(t){let i=n=>{if(!n.alive||!n.activeInHierarchy)return!1;if(n.keyListeners.has(t)&&n.emitKey(t))return!0;for(let r of[...n.children])if(i(r))return!0;return!1};for(let n of[...this.roots])i(n)}injectCursor(t,i,n){let r=n||this.makeCursorEventData({});Number.isFinite(r.x)&&Number.isFinite(r.y)&&(this.cursor.x=r.x,this.cursor.y=r.y),t.emitCursor(i,r)}getVar(t,i){if(this.serverBridge&&typeof this.serverBridge.getVar=="function")return this.serverBridge.getVar(t,i);let n=this.serverVars[t];return n?n[i]:void 0}notifyVarHandlers(t,i){for(let n of this.varHandlers)this.scriptCanRun(n.script)&&n.entityType===t&&n.name===i&&this.safeCall(n.fn,this.enumTree.CustomVariableEntityType[t],i)}setVar(t,i,n){if(this.serverBridge&&typeof this.serverBridge.setVar=="function"){this.serverBridge.setVar(t,i,n);return}let r=this.serverVars[t]||(this.serverVars[t]=Object.create(null));r[i]=n,this.notifyVarHandlers(t,i)}sendClientSignal(t,i){for(let n of this.signalHandlers)this.scriptCanRun(n.script)&&n.name===t&&this.safeCall(n.fn,t,i)}evalQueryScript(t,i){this.L||this.boot();let n=this.L;c.lua_createtable(n,0,5);let r=(o,a)=>{c.lua_pushcfunction(n,a),c.lua_setfield(n,-2,P(o))};return r("var",o=>(ae(o,this,i.var(Q(o,1),Q(o,2))),1)),r("logContains",o=>(c.lua_pushboolean(o,i.logContains(Q(o,1))),1)),r("control",o=>(ae(o,this,i.control(Q(o,1))),1)),r("logs",o=>(ae(o,this,i.logs()),1)),r("signals",o=>(ae(o,this,i.signals(Q(o,1))),1)),r("serverLogs",o=>(ae(o,this,i.serverLogs?i.serverLogs():[]),1)),r("serverLogContains",o=>{let a=i.serverLogContains;return c.lua_pushboolean(o,a?!!a(Q(o,1)):!1),1}),c.lua_setglobal(n,P("query")),this.runChunk(n,t,"autotest-assert"),!0}destroy(){for(let t of this.roots.slice())this.destroyControl(t);for(let t of this.mountedScripts.slice())this.unmountScript(t);this.lifecyclePhase="idle",this.mountedScripts=[],this.luaFunctions.clear();for(let t of[...this.luaStates])this.closeTrackedLuaState(t);this.L=null,this.audios.clear(),this.audioHistory.length=0,this.audioWarnings.clear()}};function ci(e){let t=new Hi(e);return t.boot(),t}var St=Object.freeze(Array.from({length:8},(e,t)=>`Player${t+1}`)),Wn=Object.freeze(Array.from({length:8},(e,t)=>`Avatar${t+1}`)),ca=Object.freeze(["Level","PlayerSelf","AvatarSelf"]);var Ln=Object.freeze([...ca,...St,...Wn]),fa=Object.freeze(["PlayerSelf","AllPlayers",...St]),Bl=Object.freeze(["Level","PlayerSelf",...St]),na=Object.freeze(["Int","Float","String","Bool","Vector3","Entity","Guid","PrefabId","ConfigId","IntList","FloatList","StringList","BoolList","Vector3List","EntityList","GuidList","PrefabIdList","ConfigIdList","Dict","Struct"]),Xl=-2147483648,Ul=2147483647,Hl=new Set(["set-custom-variable","get-custom-variable","custom-variable-changed","\u8BBE\u7F6E\u81EA\u5B9A\u4E49\u53D8\u91CF","\u83B7\u53D6\u81EA\u5B9A\u4E49\u53D8\u91CF","\u81EA\u5B9A\u4E49\u53D8\u91CF\u53D8\u5316\u65F6","send-signal","listen-signal","send-client-script-signal","\u53D1\u9001\u4FE1\u53F7","\u76D1\u542C\u4FE1\u53F7","\u53D1\u9001\u5BA2\u6237\u7AEF\u811A\u672C\u4FE1\u53F7","setVar","getVar","signal","var"]);function fi(e){return`Player${Number(e)}`}function ji(e){return`Avatar${Number(e)}`}function ra(e){let t=String(e||"").match(/^(?:Player|Avatar)([1-8])$/);return t?Number(t[1]):0}function vt(e){if(e==null||e==="")return 1;let t=Number(e);if(!Number.isInteger(t)||t<1||t>8)throw new Error("playerCount must be an integer 1-8");return t}function je(e,t=8){let i=vt(t);if(e==null||e==="")return 1;let n=Number(e);if(!Number.isInteger(n)||n<1||n>i)throw new Error(`playerIndex must be an integer 1-${i}`);return n}function oa(){let e={Level:Object.create(null),PlayerSelf:Object.create(null),AvatarSelf:Object.create(null)};for(let t of St)e[t]=Object.create(null);for(let t of Wn)e[t]=Object.create(null);return e}function da(e){let t=String(e||"");if(!Ln.includes(t))throw new Error(`unknown CustomVariableEntityType: ${e}`);return t}function jl(e,t){let i=da(e);if(!Bl.includes(i))throw new Error(`${t}.entityType must be Level, PlayerSelf, or Player1-8`);return i}function di(e){let t=String(e??"");if(!t)throw new Error("custom variable name is required");return t}function Ki(e){let t=String(e??"");if(!t)throw new Error("signal name is required");return t}function qn(e){let t=String(e||"PlayerSelf");if(!fa.includes(t))throw new Error(`unsupported client signal target: ${e}. use PlayerSelf, AllPlayers, or Player1-8`);return t}function hi(e){if(e==null)return"";if(typeof e=="boolean")return"Bool";if(typeof e=="string")return"String";if(typeof e=="number")return Number.isInteger(e)?"Int":"Float";if(Array.isArray(e)){if(e.length===0)return"IntList";let t=hi(e[0]);return t&&!t.endsWith("List")&&t!=="Dict"&&t!=="Struct"?`${t}List`:"IntList"}return e&&typeof e=="object"?"x"in e||"y"in e||"z"in e?"Vector3":"Dict":""}function Ie(e){return e===void 0?null:JSON.parse(JSON.stringify(e))}function aa(e){return Array.isArray(e)?e.map(t=>t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"value")&&"type"in t?t.value:t):[]}function sa(e){return Array.isArray(e)?e.map(t=>t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"value")&&"type"in t?{type:String(t.type||""),value:t.value}:{type:hi(t),value:t}):[]}function Kl(e){return String(e?.kind||e?.type||e?.name||e?.id||"")}function Li(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function ha(e,t){if(!Li(e)||!Object.prototype.hasOwnProperty.call(e,"fromSignalParam"))return null;if(Object.keys(e).some(n=>n!=="fromSignalParam"))throw new Error(`${t}.fromSignalParam cannot be combined with literal fields`);let i=Number(e.fromSignalParam);if(!Number.isSafeInteger(i)||i<0)throw new Error(`${t}.fromSignalParam must be a non-negative integer`);return{fromSignalParam:i}}function la(e,t){return ha(e,t)||Ie(e)}function Ll(e,t,i){if(!Li(e))throw new Error(`serverLogic.rules[${t}].actions[${i}] must be an object`);let n=String(e.kind||e.type||""),r=`serverLogic.rules[${t}].actions[${i}]`;if(n==="setCustomVariable"){let o=jl(e.entityType,r);if(!Object.prototype.hasOwnProperty.call(e,"value"))throw new Error(`${r}.value is required`);return{kind:n,entityType:o,name:di(e.name),value:la(e.value,`${r}.value`),...e.variableType?{variableType:String(e.variableType)}:{}}}if(n==="sendClientScriptSignal"){if(!Array.isArray(e.params))throw new Error(`${r}.params must be an array`);return{kind:n,target:qn(e.target),signalName:Ki(e.signalName),params:e.params.map((o,a)=>la(o,`${r}.params[${a}]`))}}throw new Error(`${r}.kind must be setCustomVariable or sendClientScriptSignal`)}function mi(e){if(e==null)return{version:1,rules:[]};if(!Li(e))throw new Error("serverLogic must be an object");let t=e.rules===void 0?[]:e.rules;if(!Array.isArray(t))throw new Error("serverLogic.rules must be an array");return{version:1,rules:t.map((i,n)=>{if(!Li(i))throw new Error(`serverLogic.rules[${n}] must be an object`);if(!Array.isArray(i.actions)||i.actions.length===0)throw new Error(`serverLogic.rules[${n}].actions must be a non-empty array`);return{id:String(i.id||`signal-${n+1}`),signalName:Ki(i.signalName),actions:i.actions.map((r,o)=>Ll(r,n,o))}})}}function ua(e,t,{typed:i=!1}={}){let n=ha(e,"server logic value");if(n){let r=i?t.params:t.values;if(n.fromSignalParam>=r.length)throw new Error(`signal ${t.name} has no parameter at index ${n.fromSignalParam}`);return Ie(r[n.fromSignalParam])}return Ie(e)}function ql(e){return e==="Level"?"Level":St.includes(e)?"PlayerSelf":Wn.includes(e)?"AvatarSelf":e}function ma(e={}){let t=oa(),i=oa(),n=[],r=[],o=[],a=[],s=Array.from({length:9},()=>null),u=1,l=0,f=Number(e.onlineLatencyMs||0);(!Number.isFinite(f)||f<0)&&(f=0);let d=mi(e.logic),m=vt(e.playerCount),p=je(e.viewPlayerIndex,m);function g(v,A){a.push({source:"server",level:String(v||"engine"),text:String(A),time:l})}function y(v){let A=s[v||p],w=Number(A?.clock?.time);Number.isFinite(w)&&(l=w)}function C(v,A,w,k){t[v][A]=w,i[v][A]={type:k||hi(w)||i[v][A]?.type||""}}function x(v,A,w){return typeof w!="number"||!Number.isInteger(w)?{ok:!0,value:w}:w>=Xl&&w<=Ul?{ok:!0,value:w}:(g("engine",`Int custom variable ${v}.${A} out of range ${w}; keeping previous legal value`),{ok:!1,value:t[v][A]})}function I(v,A){let w=da(v),k=A||p;return w==="PlayerSelf"?fi(k):w==="AvatarSelf"?ji(k):w}function z(v,A){let w=ql(v);if(v==="Level"){for(let E=1;E<=m;E+=1){let _=s[E];_&&typeof _.notifyVarHandlers=="function"&&_.notifyVarHandlers("Level",A)}return}let k=ra(v);if(!k)return;let $=s[k];$&&typeof $.notifyVarHandlers=="function"&&$.notifyVarHandlers(w,A)}function F(v,A){let w=qn(v);return w==="AllPlayers"?Array.from({length:m},(k,$)=>$+1):w==="PlayerSelf"?[A||p]:[ra(w)]}function X(v){for(let A of d.rules)if(A.signalName===v.name)for(let w of A.actions){if(w.kind==="setCustomVariable"){let k=ua(w.value,v);G.setVar(w.entityType,w.name,k,{type:w.variableType,playerIndex:v.playerIndex}),g("info",`logic ${A.id}: set ${w.entityType}.${w.name}`);continue}if(w.kind==="sendClientScriptSignal"){let k=w.params.map($=>ua($,v,{typed:!0}));G.sendToClient(w.signalName,k,{target:w.target,playerIndex:v.playerIndex}),g("info",`logic ${A.id}: sent ${w.signalName} to ${w.target}`)}}}function U(v,A){v&&(v.serverBridge={getVar:(w,k)=>G.getVar(w,k,{playerIndex:A}),setVar:(w,k,$)=>G.setVar(w,k,$,{playerIndex:A}),receiveFromClient:(w,k)=>G.receiveFromClient(w,k,{playerIndex:A})})}function H(v){v&&(v.serverBridge=null)}let G={ENTITY_TYPES:ca,ALL_ENTITY_TYPES:Ln,CLIENT_SIGNAL_TARGETS:fa,get clock(){return l},get playerCount(){return m},get viewPlayerIndex(){return p},setClock(v){l=Number(v)||0},setPlayerCount(v){return m=vt(v),p>m&&(p=m),m},setViewPlayerIndex(v){return p=je(v,m),p},log(v,A){g(v,A)},defineVar(v,A,w={},{playerIndex:k}={}){let $=I(v,k),E=di(A);if(Object.prototype.hasOwnProperty.call(t[$],E))throw new Error(`custom variable already exists: ${$}.${E}`);let _=w.type?String(w.type):hi(w.value??w.defaultValue);if(_&&!na.includes(_))throw new Error(`unsupported custom variable type: ${_}`);let D=w.value!==void 0?w.value:w.defaultValue!==void 0?w.defaultValue:null;return C($,E,D,_),G.getVar($,E)},getVar(v,A,{playerIndex:w}={}){let k=I(v,w),$=di(A);if(!Object.prototype.hasOwnProperty.call(t[k],$)){g("engine",`GetGlobalCustomVariableValue missing ${k}.${$}; returning nil (simulator policy)`);return}return t[k][$]},setVar(v,A,w,{notify:k=!0,type:$,playerIndex:E}={}){let _=I(v,E),D=di(A),Y=$||i[_][D]?.type||hi(w);if(Y&&!na.includes(Y)&&Y!=="")throw new Error(`unsupported custom variable type: ${Y}`);let ue=w;if(!((Y==="Int"||Y===""&&typeof w=="number"&&Number.isInteger(w))&&(ue=x(_,D,w).value,ue===void 0)))return C(_,D,ue,Y),k&&z(_,D),ue},listVars(v){let A=v?[I(v)]:["Level",...Array.from({length:m},(k,$)=>fi($+1)),...Array.from({length:m},(k,$)=>ji($+1))],w=[];for(let k of A)for(let $ of Object.keys(t[k]))w.push({entityType:k,name:$,type:i[k][$]?.type||"",value:Ie(t[k][$])});return w},receiveFromClient(v,A=[],{playerIndex:w}={}){let k=je(w||p,m);y(k);let $=Ki(v),E={id:u++,direction:"inbound",name:$,params:sa(A),values:aa(A),time:l,playerIndex:k,from:fi(k)};return n.push(E),X(E),E},sendToClient(v,A=[],{target:w="PlayerSelf",playerIndex:k}={}){let $=Ki(v),E=qn(w),D=F(E,k||p),Y={id:u++,direction:"outbound",name:$,params:sa(A),values:aa(A),time:l,target:E,players:D,deliverAt:l+f/1e3,delivered:!1};return r.push(Y),f===0?G.deliver(Y):o.push(Y),Y},getLogic(){return Ie(d)},setLogic(v){return d=mi(v),G.getLogic()},deliver(v){if(!v||v.delivered)return;v.delivered=!0;let A=Array.isArray(v.players)&&v.players.length?v.players:F(v.target);for(let w of A){let k=s[w];k&&typeof k.sendClientSignal=="function"&&k.sendClientSignal(v.name,v.values)}},flush(v){v!==void 0&&(l=Number(v)||0);let A=[];for(let w=o.length-1;w>=0;w-=1)o[w].deliverAt<=l&&A.push(o.splice(w,1)[0]);A.sort((w,k)=>w.id-k.id);for(let w of A)G.deliver(w);return A},inbound(){return n.slice()},outbound(){return r.slice()},loadConfig(v){if(v!=null){if(typeof v!="object")throw new Error("server config must be an object");if(v.graph&&!Array.isArray(v.nodes))throw new Error("unsupported server node graph: v1 only accepts custom variables and signals");for(let A of v.nodes||[]){let w=Kl(A);if(!Hl.has(w))throw new Error(`unsupported server node: ${w||JSON.stringify(A)}. v1 only supports custom variables and signals`)}if(v.onlineLatencyMs!==void 0){let A=Number(v.onlineLatencyMs);if(!Number.isFinite(A)||A<0)throw new Error("onlineLatencyMs must be a non-negative finite number");f=A}v.playerCount!==void 0&&G.setPlayerCount(v.playerCount),v.viewPlayerIndex!==void 0&&G.setViewPlayerIndex(v.viewPlayerIndex),(v.logic!==void 0||v.serverLogic!==void 0)&&G.setLogic(v.logic??v.serverLogic);for(let A of v.vars||[]){let w=I(A.entityType),k=di(A.name);Object.prototype.hasOwnProperty.call(t[w],k)?G.setVar(w,k,A.value??A.defaultValue,{notify:!1,type:A.type}):G.defineVar(w,k,A)}}},attachRuntime(v,{playerIndex:A=1}={}){let w=je(A,8);return s[w]&&s[w]!==v&&H(s[w]),s[w]=v||null,U(s[w],w),G},attachRuntimes(v){G.detachRuntime();let A=Array.isArray(v)?v:[];for(let w=0;w<A.length&&w<8;w+=1)s[w+1]=A[w]||null,U(s[w+1],w+1);return G},detachRuntime(){for(let v=1;v<=8;v+=1)H(s[v]),s[v]=null},snapshot(){let v=fi(p),A=ji(p),w={Level:{},PlayerSelf:{},AvatarSelf:{}};for(let k of Object.keys(t.Level))w.Level[k]={type:i.Level[k]?.type||"",value:Ie(t.Level[k])};for(let k of Object.keys(t[v]))w.PlayerSelf[k]={type:i[v][k]?.type||"",value:Ie(t[v][k])};for(let k of Object.keys(t[A]))w.AvatarSelf[k]={type:i[A][k]?.type||"",value:Ie(t[A][k])};for(let k=1;k<=m;k+=1){let $=fi(k),E=ji(k);w[$]={},w[E]={};for(let _ of Object.keys(t[$]))w[$][_]={type:i[$][_]?.type||"",value:Ie(t[$][_])};for(let _ of Object.keys(t[E]))w[E][_]={type:i[E][_]?.type||"",value:Ie(t[E][_])}}return{clock:l,onlineLatencyMs:f,playerCount:m,viewPlayerIndex:p,logic:G.getLogic(),vars:w,inbound:n.map(k=>({id:k.id,name:k.name,params:Ie(k.params),values:Ie(k.values),time:k.time,playerIndex:k.playerIndex,from:k.from})),outbound:r.map(k=>({id:k.id,name:k.name,params:Ie(k.params),values:Ie(k.values),time:k.time,target:k.target,players:Array.isArray(k.players)?k.players.slice():[],deliverAt:k.deliverAt,delivered:!!k.delivered})),logs:a.map(k=>({source:"server",level:k.level,text:k.text,time:k.time}))}},reset(){for(let v of Ln){for(let A of Object.keys(t[v]))delete t[v][A];for(let A of Object.keys(i[v]))delete i[v][A]}n.length=0,r.length=0,o.length=0,a.length=0,u=1,l=0},destroy(){G.detachRuntime(),G.reset()}};e.config&&G.loadConfig(e.config);for(let v of e.vars||[])G.defineVar(v.entityType,v.name,v);return G}var Wl={container:"container",textbox:"textbox",image:"image",button:"button",cursor:"cursor",grid:"grid",reference:"reference",textwindow:"textwindow",keyhint:"keyhint",animation:"animation",fullscreen:"fullscreen"};function Jn(e,t,i=null){let n=et(e.transformByPlatform,t),r={authoringId:e.id,kind:Wl[e.kind]||"container",name:e.name,prefabIndex:e.guid||0,active:e.active!==!1,visible:e.visible!==!1,canControllerFocus:e.canControllerFocus===!0,anchoredPositionX:n.offset.x,anchoredPositionY:n.offset.y,sizeDeltaX:n.size.x,sizeDeltaY:n.size.y,anchorMinX:n.anchorMin.x,anchorMinY:n.anchorMin.y,anchorMaxX:n.anchorMax.x,anchorMaxY:n.anchorMax.y,pivotX:n.pivot.x,pivotY:n.pivot.y,localScaleX:n.scale.x,localScaleY:n.scale.y,localScaleZ:n.scale.z,localRotationX:n.rotation.x,localRotationY:n.rotation.y,localRotationZ:n.rotation.z,children:(e.children||[]).map(a=>Jn(a,t,i))},o=i?.get(e.id);return o?.length&&(r.scripts=o.map(a=>{let s=Number(a.guid);return{path:a.path||a.id,source:a.source||"",...Number.isSafeInteger(s)&&s>0?{scriptMappingId:s}:{}}})),e.kind==="container"&&(r.isolateNavigation=e.isolateNavigation===!0,r.disableKeyEventPassthrough=e.disableKeyEventPassthrough===!0,r.disableCursorEventPassthrough=e.disableCursorEventPassthrough===!0,r.showCursor=e.showCursor===!0),(e.kind==="textbox"||e.kind==="textwindow")&&(r.text=e.text??"",r.fontSize=e.fontSize,r.adaptiveFontSize=e.adaptiveFontSize===!0,r.minimumFontSize=e.minimumFontSize,r.fontColor=e.fontColor,r.bgColor=e.bgColor,r.enableOutline=e.enableOutline!==!1,r.outlineColor=e.outlineColor,r.horizontalAlignment=e.horizontalAlignment||"Left",r.verticalAlignment=e.verticalAlignment||"Top",e.kind==="textwindow"&&(r.interactable=e.interactable!==!1,r.showScrollBar=e.showScrollBar!==!1)),e.kind==="image"&&(r.imageSource=e.imageSource,r.imageType=e.imageType??null,r.imageId=e.imageId??0,r.imageColor=e.imageColor,r.raycastTarget=e.raycastTarget===!0,r.enableMask=e.enableMask===!0,r.enableSoftEdge=e.enableSoftEdge===!0,r.softEdgeMode=e.softEdgeMode,r.softEdgeWidthX=e.softEdgeWidthX,r.softEdgeWidthY=e.softEdgeWidthY,r.horizontalSoftRange=e.horizontalSoftRange,r.verticalSoftRange=e.verticalSoftRange,r.enableFill=e.enableFill===!0,r.fillType=e.enableFill?e.fillType:"Unused",r.fillHorizontalType=e.fillHorizontalType,r.fillVerticalType=e.fillVerticalType,r.fillRadial90Type=e.fillRadial90Type,r.fillRadialType=e.fillRadialType,r.fillAmount=e.fillAmount,r.reverseMaskArea=e.reverseMaskArea===!0),e.kind==="button"&&(r.raycastTarget=e.raycastTarget!==!1,r.interactable=e.interactable!==!1,r.clickAudioId=e.clickAudioId,r.unavailableChildId=e.unavailableChildId??null,r.hoverChildId=e.hoverChildId??null,r.pressedChildId=e.pressedChildId??null,r.selectedChildId=e.selectedChildId??null),e.kind==="cursor"&&(r.raycastTarget=e.raycastTarget!==!1),e.kind==="reference"&&(r.referencedPrefabIndex=e.referencedPrefabId),e.kind==="grid"&&(r.itemPrefabIndex=e.itemPrefabId,r.raycastTarget=e.raycastTarget!==!1,r.interactable=e.interactable!==!1,r.showScrollBar=e.showScrollBar!==!1,r.scrollDirection=e.scrollDirection,r.layoutConstraint=e.layoutConstraint,r.layoutConstraintFixedCount=e.layoutConstraintFixedCount,r.cellSizeX=e.cellSizeX,r.cellSizeY=e.cellSizeY,r.spacingX=e.spacingX,r.spacingY=e.spacingY,r.padding1X=e.padding1X,r.padding1Y=e.padding1Y,r.padding2X=e.padding2X,r.padding2Y=e.padding2Y,r.previewCount=e.previewCount),e.kind==="keyhint"&&(r.keyboardKeyCode=e.keyboardKeyCode,r.controllerKeyCode=e.controllerKeyCode),(e.kind==="animation"||e.kind==="fullscreen")&&(r.raycastTarget=!1,r.animationId=e.animationId,r.playSoundEffect=e.playSoundEffect,e.kind==="animation"&&(r.layer=e.layer)),r}function Qn(e,t=[],i=""){let n=i&&ie[i]?i:e.canvasId,r=ie[n],o=ei(e),a=new Map;for(let u of t){if(!u.controlId)continue;let l=a.get(u.controlId)||[];l.push(u),a.set(u.controlId,l)}let s=e.meta?.assetType==="client-control-template"?(e.root.children||[]).map(u=>Jn(u,n,a)):[];return{canvasId:n,platform:r.platform,device:r.luaDevice,canvasWidth:r.width,canvasHeight:r.height,root:Jn(o,n,a),templates:s}}var qi="qxqy-autotest";var It=.03333333333333333,Jl=new Set(["pointer","key","click","pause","resume","serverSet","serverSend","view"]),Ql=new Set(["log","control","var","signal","tree","lua"]);function wt(e,t){let i=Number(e);if(!Number.isFinite(i))throw new Error(`${t} must be a finite number`);return i}function Zn(e){return JSON.parse(JSON.stringify(e??null))}function Wi(e,t){if(!e||typeof e!="object")throw new Error(`events[${t}] must be an object`);let i=String(e.kind||e.do||"");if(!Jl.has(i))throw new Error(`unsupported event kind: ${i||"(empty)"}`);let n=e.payload&&typeof e.payload=="object"?{...e.payload}:{};if(i==="pointer")!n.type&&e.type&&(n.type=e.type),n.x===void 0&&(n.x=e.x),n.y===void 0&&(n.y=e.y),n.x=wt(n.x,"pointer.x"),n.y=wt(n.y,"pointer.y"),n.type=String(n.type||"click"),n.type==="wheel"&&(n.deltaX=wt(n.deltaX??e.deltaX??0,"pointer.deltaX"),n.deltaY=wt(n.deltaY??e.deltaY??0,"pointer.deltaY"));else if(i==="key"){if(n.typeName=String(n.typeName||n.key||e.typeName||e.key||""),!n.typeName)throw new Error("key event requires typeName")}else if(i==="click"){if(n.name=String(n.name||e.name||""),!n.name)throw new Error("click event requires control name")}else if(i==="serverSet"){if(n.entityType=String(n.entityType||e.entityType||""),n.name=String(n.name||e.name||""),n.value===void 0&&(n.value=e.value),n.value===void 0&&(n.value=null),!n.entityType||!n.name)throw new Error("serverSet requires entityType and name")}else if(i==="serverSend"){if(n.name=String(n.name||e.name||""),n.params=Array.isArray(n.params)?n.params:Array.isArray(e.params)?e.params:[],n.target=String(n.target||e.target||"PlayerSelf"),!n.name)throw new Error("serverSend requires signal name")}else if(i==="view"&&(n.playerIndex=Number(n.playerIndex||n.viewPlayerIndex||e.playerIndex||e.viewPlayerIndex||0),!Number.isInteger(n.playerIndex)||n.playerIndex<1))throw new Error("view event requires playerIndex 1-8");return{t:wt(e.t??0,"event.t"),source:String(e.source||"user"),kind:i,payload:n}}function er(e,t){if(!e||typeof e!="object")throw new Error(`asserts[${t}] must be an object`);let i=String(e.kind||(e.check?"log":""));if(!Ql.has(i))throw new Error(`unsupported assert kind: ${i||"(empty)"}`);let n={kind:i};if(e.at!==void 0&&(n.at=wt(e.at,"assert.at")),i==="log"){if(n.contains=String(e.contains||e.check||e.text||""),n.source=e.source==="server"?"server":"client",e.level&&(n.level=String(e.level)),!n.contains)throw new Error("log assert requires contains")}else if(i==="control"){if(n.id=e.id?String(e.id):"",n.name=e.name?String(e.name):"",n.field=String(e.field||""),!n.field)throw new Error("control assert requires field");if(!n.id&&!n.name)throw new Error("control assert requires id or name");if(!Object.prototype.hasOwnProperty.call(e,"equals"))throw new Error("control assert requires equals");n.equals=Zn(e.equals)}else if(i==="var"){if(n.entityType=String(e.entityType||""),n.name=String(e.name||""),!n.entityType||!n.name)throw new Error("var assert requires entityType and name");if(!Object.prototype.hasOwnProperty.call(e,"equals"))throw new Error("var assert requires equals");n.equals=Zn(e.equals)}else if(i==="signal"){if(n.direction=e.direction==="outbound"?"outbound":"inbound",n.name=String(e.name||""),!n.name)throw new Error("signal assert requires name");e.values!==void 0&&(n.values=Zn(e.values))}else if(i==="tree"){if(n.name=String(e.name||""),n.exists=e.exists!==!1,!n.name)throw new Error("tree assert requires name")}else if(i==="lua"&&(n.source=String(e.source||""),!n.source.trim()))throw new Error("lua assert requires source");return n}function pa(e){let t=0,i=[],n=[];for(let r of e){if(!r||typeof r!="object")throw new Error("queue step must be an object");if(r.do!=="start"){if(r.do==="step"){t+=wt(r.dt??It,"step.dt");continue}if(r.do==="pointer"||r.do==="key"||r.do==="click"||r.do==="pause"||r.do==="resume"||r.do==="serverSet"||r.do==="serverSend"||r.do==="view"){i.push(Wi({...r,kind:r.do,t},i.length));continue}if(r.assert||r.check||r.kind){n.push(er({...r.assert||r,at:r.at??t},n.length));continue}throw new Error(`unsupported queue step: ${JSON.stringify(r)}`)}}return{events:i,asserts:n,dt:It}}function pi(e){if(Array.isArray(e)){let n=pa(e);return{format:qi,version:1,name:"",dt:n.dt,events:n.events,asserts:n.asserts}}if(!e||typeof e!="object")throw new Error("autotest case must be an object or step array");if(Array.isArray(e.queue)||Array.isArray(e.steps)){let n=pa(e.queue||e.steps);return{format:qi,version:1,name:String(e.name||""),dt:Number(e.dt)>0?Number(e.dt):n.dt,events:n.events,asserts:n.asserts}}let t=(e.events||[]).map((n,r)=>Wi(n,r)),i=(e.asserts||[]).map((n,r)=>er(n,r));return t.sort((n,r)=>n.t-r.t||0),{format:qi,version:1,name:String(e.name||""),dt:Number(e.dt)>0?Number(e.dt):It,playerCount:Number(e.playerCount)>0?Number(e.playerCount):1,events:t,asserts:i}}function ga(e,t={}){let i=(e||[]).map((n,r)=>Wi(n,r));return{format:qi,version:1,name:String(t.name||""),dt:Number(t.dt)>0?Number(t.dt):It,playerCount:Number(t.playerCount)>0?Number(t.playerCount):1,events:i,asserts:(t.asserts||[]).map((n,r)=>er(n,r))}}function ya(e,t,i){if(!e)return null;let n=Wi({...t,t:t.t??i??0},e.events.length);return e.events.push(n),n}var Ji=(e,t)=>Math.max(0,Math.min(t,Number.isFinite(e)?e:0));function ba(e,t,i){let n=mt(e,t,i),r=Math.max(0,n.contentHeight-i),o=Ji(e._scrollOffset||0,r);return e._scrollOffset=o,{...n,length:n.contentHeight,max:r,offset:o,viewport:i,horizontal:!1,width:t,height:i}}function Qi(e,t,i){if(!e?.showBar||e.max<=0||t<=0||i<=0)return null;let n=e.horizontal===!0,r=n?t:i,o=Math.max(0,r-4),a=Math.min(o,Math.max(18,o*r/(r+e.max))),s=o-a,u=s*e.offset/e.max,l=Math.min(8,n?i:t),f=n?{x:-t/2+2,y:i/2-l-2,width:o,height:l}:{x:t/2-l-2,y:-i/2+2,width:l,height:o},d=n?{...f,x:f.x+u,width:a}:{...f,y:f.y+u,height:a};return{track:f,thumb:d,travel:s}}var Zl=[[10001,"ura.1ht4.2ag9.1hh5.jbb.k02.jcw.2tv.2wn.2xk.2r3.d5s.94l.ebv.kcr.b40.77k.9gp.97w.1hb5.jag.btu.jc9.hp5.bmj.blq.blq.ff9.ffk.o74.1owl.rp.mg.l3.lf.lh.qy.1a3z.2xk.2xk.2xk.2xk.2xk.17dc.1f2b.2bc.2bc.2bc.2bc.2bc.ffo.ffo.126.1fk.4mo.4mo.15e.1h2.237.2ba.2kd.2bc.4mo.4mo.4mo.4mo.1mc.1n6.2cu.1ud.2b1.2ee.1tj.1tk"],[20001,"o6.fh.kb.cr.og.sm.6x.8c.87.o7.vz.kt.qo.lg.ob.9w.mg.1kz.zc.1ex.1d5.ps.uu.su.qs.ys.zp.10k.15a.xc.uk.mx.1ax.nt.tu.19m.uj.1ku.tt.100.ie.d3.fp.ie.ie.d3.fp.ie.8p.7k.fw.h0.qc.ot.uc.ot.rk.gb.1c2.ff.cl.9v.wg.1ir.1lr.1b8.1ri.1p0.104.10n.mw.j6.jb.f1.dv.84.a0.cp.bx.1ko.1au.1ia.rs.rt.rs.t7.x6.wi.zc.16f.1i6.2jh.28d.qh.k8.1gz.1ko.2iv.1xp.1l4.1gk.10j.yo.1jk.1jk.xv.104.15o.1xg.1xg.1xi.25i.p1.t1.yh.1ak.1i6.1y2.xt.32u.3g6.1bz.2mn.14l.14c.1e1.op.s8.p2.v5.2ix.1a0.ry.16m.17n.13c.134.ys.yu.xr.sl.sr.sd.yh.z5.gd.gl.hx.h2.g8.fj.iy.hz.jj.th.12n.16r.d3.j9.dg.lj.fl.a7.f9.iw.el.27f.1dh.1rh.2ph.yd.w5.x5.tr.pq.zf.16h.1a5.17t.wy.vn.y8.wl.yv.2ye.2qt.1ah.163.19t.uf.119.2vv.1bm.13h.14p.1so.c3.as.9z.19w.1l4.1nl.rj.we"],[30001,"jo.my.ss.dw.c1.b4.hl.hl.hl.cz.dw.dw.b4.dw.fr.kd.qv.px.px.74.6u.8h.60.8q.8b.eo.eo.eo.8k.a5.99.12v.13y.lg.m4.qr.dw.ex.g0.ef.cd.br.11n.17h.1b8.1c9.9p.ag.9z.l9.m8.m8.lw.m8.cz.99.b4.8c.63.7f.6h.99.re.pp.pi.cq.c9.cp.ck.c6.b0.bd.al.f6.gl.ed.fs.lc.k6.kh.i6.cx.j1.hk.gb.d7.h7.g2.em.kj.kn.k4.j5.rh.t0.qt.mj.i7.ih.i2.hd.3r.8d.6u.6z.by.de.dg.cr.1a5.1ab.16c.18g.n2.ly.no.nt.f9.de.lr.fe.f0.fj.el.fo.t1.g9.ly.h3.g6.de.2ak.2f3.wf.kg.qn.11p.rg.uj.u6.11c.22o.2cs.3dp.3dq.3d5.3d6.1zx.18v"],[40001,"19x.215.2zt.1ex.2pj.7hy.1ur.1gn.1g7.1b1.u9.1tw.108.1ew.rs.1qu.w9.lk.244.qi.b6.tk.jg.jg.jg.y4.c1.b4.iv.hi.r4.n7.gy.ev.qe.12z.18n.dw.1l6.ou.wz.1un.19t.18k.yy.1hs.sl.dw.1vl.100.14k.1q8.209.1jk.1xr.ua.1j2.pr.26h.1gs.s9.px.15v.pf.1jk.xc.1hb.111.172.ut.285.1oh.149.zj.22r.2l9.14a.ok.23y.1eh.xe.1j0.1rp.1cz.wf.1mh.22k.334.1z2.1xo.1br.4ji.5nq.5nf.2za.18r.h3.eo.ia.1kn.dc.ss.s0.1bl.1oc.is.km.177.1ec.1ao.h4.hp.dx.l9.iw.i3.12w.n1.yq.12w.1ju.yx.14s.18b.22t.u3.my.2rb.36w.13u.z8.20r.18g.19r.2x9.w4.q2.1d2.wo.13a.v6.17w.ur.288.1b6.14m.1fi.1xx.1ee.kj.121.j2.1d2.2ad.1ri.2lc.1vk.138.12r.xj.1h5.1c5.2qx.1gj.t2.lv.rf.18q.1kz.dw.2aq.ia.1i9.k5.199.f4.10y.18a.xf.rk.1g9.1q3.10h.sj.15o.e3.dz.sv.135.w9.yg.aw.2a2.19m.22w.1c8.272.13o.104.1sr.rs.1pb.d5.df.kp.jq.1a7.s8.1ao.ba.rb.in.pz.q8.140.ij.1e7.jl.yk.117.10i.1tn.1oj.1sv.sj.1e3.2so.1c7.1gv.178.107.10n.1dx.1qi.1wp.2bc.218.16r.105.xc.z6.11w.1mc.1y9.17p.1cs.2ij.18c.1ie.nn.16c.1ce.xb.1ei.3j0.ve.14x.1sx.285.1b8.1at.v4.rv.rs.10z.xq.11o.15k.xq.u1.i2.pu.i4.l3.9u.oh.mc.nm.pw.1i3.1h4.pj.111.l4.lb.qq.qf.u0.h4.nk.yf.6h.ij.ds.oy.re.m8.1gl.cz.16z.a1.1f8.1x6.vp.dz.gp.g6.fr.vl.fr.gg.qc.aj.99.go.ij.fz.11a.x5.mo.1u9.h0.m8.10m.1an.2bc.3uw.2gk.124.xb.1uk.1b6.2xj.1os.11a.vs.1i9.1lr.2gv.265.668.1xg.45j.404.2x1.1io.3om.4q2.4mo.1d4.2bp.1pr.166.2y6.2bv.361.2nc.2bc.3g0.7g4.334.2bc.2xo.3uw.6ic.4ig.3uw.23v.1la.2zr.1jt.1cq.27a.1n1.19x.1qg.1jn.1ca.26y.2d6.4v4.4mo.4mo.7ps.1jk.153.1fo.1dm.1s2.1w1.oe.1lb.319.2eg.58p.4mo.3dw.2y2.2xm.1u8.1ko.12n.1e0.2sd.1md.2cl.1q2.372.4mo.48s.b14.3fu.334.334.34i.4nf.4ji.5eg.3uw.2u8.1g1.110.37x.2jo.su.334.3aj.3uw.63f.2bc.2bc.8v4.1ts.ax5.5du.34d.3oc.34j.4si.174.rt.1rp.2b0.37d.1ta.2gh.28a.22z.1nc.1a5.1pa.4dd.3ha.2cs.5mv.4mq.5c2.3uw.1gf.4md.113.10x.21o.2hj.1b3.1cx.1ol.3ar.1fv.17t.1a7.2uj.2we.1jk"],[50001,"1o8.1k1.mo.1wu.2c9.22d.1kb.23n.1b8.1ic.24c.2wz.1mq.1mu.1jx.1z1.o3.190.vp.1h7.th.4mo.1rp.4mo.4mo.7ps.zz.143.21v.1nf.34s.1s3.r9.18t.s1.r9.21w.277.ls.25k.5v1.2bc.1kh.wt.14i.1eq.15o.668.sh.rl.3wi.3vc.43c.3yn.17c.f5.xu.jg.176.19v.1xy.23m.18x.30c.10l.13k.v8.vp.17t.qj.17m.1wr.1la.8t.s7.18d.1l2.152.mx.1c8.1l4.1f5.1xe.rz.2hz.1et.13t.xb.14r.15o.z0.1zo.ur.257.1gb.li.12d.15a.132.1m1.3vu.296.1mg.11m.z0.159.mp.hd.x4.1go.ns.xh.2a7.tt.2vb.1bx.1kh.u3.11i.1y1.24e.2hp.2mn.1w6.3zm.166.14g.1mo.2v9.2rg.2f9.1r0.139.m1.k3.ys.1dy.29k.1mm.22m.3zx.4dr.2h7.22o.tv.rm.1et.2wv.2ar.1t7.ku.12s.10b.1v9.1gu.12m.1b3.tv.1c8.tk.10s.ul.1tt.ka.oi.qb.13f.13f.13k.17h.1uh.ez.en.2x7.2ln.2h8.3h8.ig.n9.27o.18b.hl.nm.uk.11a.1ta.1k4.1eh.wv.1go.1gg.sc.18u.1dz.2aq.vt.2l7.25h.1l5.1kn.1vc.1b4.28i.17t.1d6.1k2.18z.jy.jw.dh.1mx.fr.vp.35w.34z.35w.34z.4so.vf.yx.1bg.1d3.2yc.1tg.8q3.99g.am.2du.rm.rg.xa.2cw.xc.1j6.1if.18z.13a.yz.142.1z5.262.1bj.1y8.ur.u5.16j.1pf.1bi.l8.1il.3vz.2dr.jo.ls.18s.16l.18c.141.219.1yz.1fc.24t.27e.481.1vp.25h.1yq.1zn.1uw.11u.1jp.1pz.39o.t6.1mj.1u5.11l.1vd.1dk.1zb.1ic.3ql.14p.1wq.25x.267.zn.zn.1pf.13z.1j7.r9.1hb.4yp.1lt.1cw.1z4.19z.1og.1j4.1cl.1eg.u8.16s.1en.zu.1hr.1js.19g.303.22j.2oa.180.1v7.2ud.2d7.21s.3g9.vh.v1.284.3lg.3lg.17q.1h3.4mo.1cm.1rv.22i.2mc.2j3.27o.333.1q8.237.2ll.23b.2sp.2ll.2ox.2cf.2f8.2hz.1uo.y4.s9.w6.2dg.2q9.up.1m1.1vz.2n8.192.1eb.z7.2em.2q3.1sd.1gj.348.3vf.2iu.29x.1dc.7oj.4pq.5vb.4mx.5me.5sf.5yf.7ps.yj.q0.10w.13p.18b.2wd.11q.2vx.dd.iv.12p.jh.u9.1uy.w0.3f0.3bj.126.qo.1gj.11k.pu.22h.1z6.rp.y4.y0.xl.1d0.11s.wa.1a6.127.10m.12r.1nh.1fy.yo.1js.162.n4.174.1aj.y4.o8.qz.rh.qa.18s.mr.j3.ii.sr.sx.1jk.17l.mj.zr.uy.wa.19t.2bt.xe.1od.hs.xr.5b.12c.1ab.we.gz.mz.4y.sf.11s.e0.1l7.ew.h6.jz.l0.e8.1cx.p6.17u.bw.1ah.10r.10e.o9.1bc.uv.lq.tl.zb.100.jy.b8.bj.336.10n.na.sq.14r.yr.nm.123.tf.l1.zp.1xc.1vk.31l.zl.2bj.2b9.2fv.17p.y0.so.1ln.29c.1eh.nh.xn.131.qc.186.ff.fc.xq.1bm.la.l8.14f.243.111.xi.qw.1qn.11v.1ur.1jx.1ks.s9.nz.269.1zj.2zd.1pv.18n.2vk.p3.1fh.13v.1lf.1lu.2db.1sr.1k3.26o.1dl.1f3.187.2lh.166.v9.xh.1e3.119.s2.mt.1iu.1k6.1o2.12s.u4.2br.1q3.qv.1e4.1zu.1v4.1vk.1t3.3p7.1ob.14d.1ns.1ef.1e4.12w.2kk.1ba.2jx.1e0.1s5.12w.17r.14s.wz.1qp.183.3fb.188.1gr.2ot.168.1u7.w8.28o.1zd.32z.230.w7.vq.x8.1qh.19f.14o.2r9.qg.1ey.1qr.1p6.3a3.1ov.13d.tz.wk.22v.1qa.2l9.yw.yf.nw.p6.1ly.1jk.1nh.x9.q0.17r.17h.ux.uw.12y.p7.g7.kt.14c.ze.1kh.1eo.18a.1d8.26j.15k.19f.1ym.1j5.1c6.11k.1sd.1jp.1ws.13s.1o5.214.sx.px.20x.14h.1ja.s6.1q8.w8.1ks.so.ub.121.202.1ej.1g1.1s8.2bc.4t1.bih.3uw.3pb.avp.6c7.bko.5eg.79c.6wh.3wd.4pn.55j.4a5.3gg.bko.5ei.52p.578.bcv.6gr.2bc.4j9.5y7.9d2.2bb.2bc.668.73z.5pg.50f.5m7.788.267.642.8h2.8h2.49s.64g.5e8.5e8.2bb.3ih.5ur.6bk.578.4ck.3sg.5fe.23i.e9w.2b8.5oj.6bw.2al.2rk.2rk.5pj.n6e.350.6v9.70t.639.3uw.3uw.2bg.639.2bb.2bd.6gj.2bh.660.578.3bk.65e.359.3o0.44i.4tn.1zq.5ee.4a5.3zu.rs.639.33q.5eg.1k1.15o.dw.3uw.b7p.7qd.898.4l4.5uu.5uu.b4g.2yh.2yh.3uw.51a.51a.5kk.66f.iq9.3n7.4nb.46a.1wb.20p.bih.8xa.7ps.70t.70t.4rv.5p1.6aq.ts.63z.668.5v2.5nu.563.55s.55s.5p3.2ga.32x.42x.5cr.4c2.71b.5zp.5c2.66t.4c8.2bc.2bc.2gn.3ea.2kp.fz6.8hz.3e8.4an.bko.j7e.jag.7sr.2bc.3zx.7qd.5ut.5jp.2wk.5q7.3uw.334.4i3.3uw.4bd.5eu.46h.4i2.6t4.446.5s7.5cg.4bk.5nd.7bf.4rt.23b.2bc.2bc.2bc.2bc.2ba.4mo.4dv.3wn.2bc.1we.4he.2bc.4gz.3wn.3km.4xy.4hi.4mr.2bc.247.3yj.2c6.2bc.3aj.446.4ub.3uw.51.e0.86.is.i1.hg.mn.m4.2c.7h.sg.e3.jb.7r.eq.nf.u0.60.4o.ke.47.47.47.47.b8.4x.dr.dy.rw.rw.59.8j.5z.a5.l3.c0.ik.f7.li.lr.7x.dv.du.dd.5e.91.1b.ce.cc.59.bh.e6.8m.9n.cl.lt.7ip.4mr.4si.4kf.vo.we.13e.17n.1iw.2pi.lp.r6.gw.7x.xz.qt.bq.ls.q1.eh.bx.cr.3c.j7.b8.fz.4k.8p.bg.5w.iy.j3.12o.rs.cz.dp.yz.jk.63.63.7ps.7ps.7ps.40g.3jp.4tw.89k.88a.7s0.83d.668.7ps.2fw.2ev.2fp.7ps.2jb.2dh.2ud.25i.24c.2bt.1pa.17r.1a7.7ps.7pt.5rg.4nl.3vv.7qo.31a.2p0.2k0.49a.3v4.3nl.1ug.1ug.1l6.7s1.7ps.2cp.2f8.2i7.7ps.28q.2be.275.1ma.1oz.1q7.16s.1iq.1e0.78m.7ps.2bc.2bc.2bc.bko.2wu.2wu.2wu.3b4.38f.3uw.3uw.3uw.3uw.7ps.7qa.32n.2gg.2wk.7rv.1v3.1qq.1rb.1zk.1my.1zp.1yn.1oh.1uh.7st.9q.9q.9q.9q.9q.kk.kk.kk.kk.kk.dw.dp.dw.rs.rs.rs.rs.s4.sd.54j.5n8.2n6.21r.1nu.1o5.14u.t6.3f7.2j0.32c.304.189.1gf.18w.18j.1st.1vq.116.kw.3uw.3uw.vr.zx.xc.tc.7d.7r.9d.9w.8s.9p.3b.3b"]].map(([e,t])=>[e,t.split(".").map(i=>parseInt(i,36)/1e3)]);function va(e){if(!Number.isSafeInteger(e))return null;for(let[t,i]of Zl)if(e>=t&&e<t+i.length)return i[e-t];return null}var Zi=e=>Number.isFinite(Number(e))?Math.max(0,Number(e)):0;function Sa(e,t){if(!e||e.kind!=="image"||e.enableMask!==!0||!t)return null;let i=Zi(e.sourceWidth??e.width),n=Zi(e.sourceHeight??e.height),r=e.enableSoftEdge===!0,o=e.softEdgeMode!=="Pixel",a=r?Zi(e.softEdgeWidthX):0,s=r?Zi(e.softEdgeWidthY):0;return{id:e.id,matrix:t,width:i,height:n,featherX:o?i*a/100:a,featherY:o?n*s/100:s}}function wa(e,t,i){let n=_e(e,t,i);return{a:e.a,b:e.b,c:e.c,d:e.d,tx:n.x,ty:n.y}}import{randomUUID as ka}from"node:crypto";function nn(e){for(let t of e.runtime.scrollControls||[]){let[i,n]=ai(t),r=t.kind==="grid"?zt(t):ba(t,i,n),o={offset:r.offset,max:r.max,horizontal:r.horizontal,showBar:t.showScrollBar!==!1,textWidth:r.textWidth??0,lines:r.lines||[],lineHeight:r.lineHeight||0,contentLength:r.length,...t.kind==="textwindow"?{fontSize:r.fontSize}:{}},a=JSON.stringify(o);t._scrollKey!==a&&(t._scrollKey=a,t._scroll=o,t.markPlayDirty())}}function Ea(e){return{...e._scroll?{scroll:e._scroll}:{},...e.parent?._gridItems?.includes(e)?{clipToParent:!0}:{}}}function tr(e,t){let i=e._scroll?.max||0;e.kind==="grid"?e.scrollProgress=i?Ji(t,i)/i:0:e._scrollOffset=Ji(t,i),e.markPlayDirty()}var eu=Object.freeze(Object.values(ie).map(e=>Object.freeze({id:e.id,label:e.label,platform:e.platform,width:e.width,height:e.height})));function rn(e){nn(e);let t=ve({width:e.runtime.canvasWidth,height:e.runtime.canvasHeight}),i=new Map;function n(r,o,a){let s=Be(o,r);s.activeInHierarchy=a&&r.active!==!1,i.set(r.Id,s);let u=s.activeInHierarchy;for(let l of r.children)n(l,s,u)}for(let r of e.runtime.roots)n(r,t,!0);return i}function Aa(e,t=rn(e)){let i=new Map;function n(r,o){let a=t.get(r.Id);if(!a)return;let s=Zt(o,a,r);i.set(r.Id,s);for(let u of r.children)n(u,s)}for(let r of e.runtime.roots)n(r,Pt());return i}function _a(e,t){let i=t.get(e.Id);return{id:e.Id,prefabId:e.prefabIndex,authoringId:e.authoringId,name:e.name,kind:e.kind,typeofName:e.typeofName,instantiated:!e.authoringId,active:!!e.active,visible:!!e.visible,activeInHierarchy:!!i?.activeInHierarchy,raycastTarget:e.raycastTarget!==!1,interactable:e.interactable!==!1,pressed:e.pressed===!0,...e._scroll?{scrollOffset:e._scroll.offset,scrollMax:e._scroll.max}:{},...e.kind==="grid"?{itemCount:e.itemCount,scrollProgress:e.scrollProgress}:{},anchoredPositionX:e.anchoredPositionX,anchoredPositionY:e.anchoredPositionY,sizeDeltaX:e.sizeDeltaX,sizeDeltaY:e.sizeDeltaY,localScaleX:e.localScaleX,localScaleY:e.localScaleY,localScaleZ:e.localScaleZ,localRotationZ:e.localRotationZ,text:e.kind==="textbox"||e.kind==="textwindow"?e.text??"":null,fontSize:e.kind==="textbox"||e.kind==="textwindow"?e.fontSize:null,adaptiveFontSize:e.kind==="textbox"||e.kind==="textwindow"?e.adaptiveFontSize===!0:null,minimumFontSize:e.kind==="textbox"||e.kind==="textwindow"?e.minimumFontSize:null,fontColor:e.kind==="textbox"||e.kind==="textwindow"?e.fontColor:null,bgColor:e.kind==="textbox"||e.kind==="textwindow"?e.bgColor:null,enableOutline:e.kind==="textbox"||e.kind==="textwindow"?e.enableOutline===!0:null,outlineColor:e.kind==="textbox"||e.kind==="textwindow"?e.outlineColor:null,imageId:e.kind==="image"?e.imageId??0:null,imageSource:e.kind==="image"?We(e.imageSource):null,imageType:e.kind==="image"?e.imageType==null?null:Me(e.imageType):null,primitive:e.kind==="image"?_t(e.imageId,e.imageSource):null,imageColor:e.kind==="image"?e.imageColor:null,enableMask:e.kind==="image"?e.enableMask===!0:null,enableSoftEdge:e.kind==="image"?e.enableSoftEdge===!0:null,softEdgeMode:e.kind==="image"?e.softEdgeMode:null,softEdgeWidthX:e.kind==="image"?e.softEdgeWidthX:null,softEdgeWidthY:e.kind==="image"?e.softEdgeWidthY:null,horizontalSoftRange:e.kind==="image"?e.horizontalSoftRange:null,verticalSoftRange:e.kind==="image"?e.verticalSoftRange:null,enableFill:e.kind==="image"?e.enableFill===!0:null,fillType:e.kind==="image"?e.fillType:null,fillHorizontalType:e.kind==="image"?e.fillHorizontalType:null,fillVerticalType:e.kind==="image"?e.fillVerticalType:null,fillRadial90Type:e.kind==="image"?e.fillRadial90Type:null,fillRadialType:e.kind==="image"?e.fillRadialType:null,reverseMaskArea:e.kind==="image"?e.reverseMaskArea===!0:null,fillAmount:e.kind==="image"?e.fillAmount:null,box:i?{left:i.left,bottom:i.bottom,width:i.width,height:i.height}:null,children:e.children.map(n=>_a(n,t))}}function tu(){return{pointerDownControl:null,pointerDownPosition:null,pointerLastPosition:null,pointerDragging:!1,pointerHoverControl:null,pointerScroll:null,hoveredControl:null,selectedControl:null,stateRestores:new Map,viewCache:null}}function iu(e,t,i,n){let r=ci({canvasWidth:e.canvasWidth,canvasHeight:e.canvasHeight,device:e.device,audioDuration:va,canSelectImageType:Pr,...n?{language:n}:{}});for(let o of[...e.templates||[],...t?.templates||[]])Number.isSafeInteger(o.prefabIndex)&&o.prefabIndex>0&&r.registerTemplate(o.prefabIndex,o);for(let o of i){let a=o.path||o.id,s=o.source||"";a&&s&&r.registerScriptFile(a,s)}return r}var nu=["pointerDownControl","pointerDownPosition","pointerLastPosition","pointerDragging","pointerHoverControl","pointerScroll","hoveredControl","selectedControl","stateRestores","viewCache"];function ru(e){Object.defineProperty(e,"runtime",{configurable:!0,enumerable:!0,get(){return e.runtimes[e.viewPlayerIndex-1]}});for(let t of nu)Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get(){return e.views[e.viewPlayerIndex-1][t]},set(i){e.views[e.viewPlayerIndex-1][t]=i}})}function Ta(e,{templatesProject:t=null,scripts:i=[],sceneScripts:n=null,templateScripts:r=null,serverConfig:o=null,canvasId:a="",playerCount:s=1,viewPlayerIndex:u=1,language:l=""}={}){let f=n||i,d=r||i,m=Qn(e,f,a),p=t?Qn(t,d,a):null,g=vt(s),y=je(u,g),C=ma({playerCount:g,viewPlayerIndex:y});o&&C.loadConfig({...o,playerCount:g,viewPlayerIndex:y});let x=[];for(let F=0;F<g;F+=1)x.push(iu(m,p,i,l));C.attachRuntimes(x);for(let F of x)F.addRoot(m.root);let I={audioSessionId:ka(),runtimes:x,views:x.map(()=>tu()),playerCount:g,viewPlayerIndex:y,server:C,compiled:m,mountError:x.find(F=>F.mountErrors[0])?.mountErrors[0]||null,debugPaused:!1,history:{events:[]},recording:!0};ru(I);let z=I.viewPlayerIndex;for(let F=1;F<=g;F+=1)I.viewPlayerIndex=F,pu(I);return I.viewPlayerIndex=z,I}function or(e,t){if(!e)throw new Error("play session has not started");let i=je(t,e.playerCount);return i===e.viewPlayerIndex||(ot(e,{kind:"view",payload:{playerIndex:i}}),e.viewPlayerIndex=i,e.viewCache=null,e.server&&e.server.setViewPlayerIndex(i)),i}function ot(e,t){!e?.recording||!e.history||ya(e.history,{...t,source:t.source||"user"},e.runtime.clock.time)}function ou(e){return e?.history?.events||[]}var ar=new Set(["image","textbox","textwindow","button","grid"]);function au(e,t){let i=_e(t,e.centerX,e.centerY);return{centerX:i.x,centerY:i.y,scaleX:Math.hypot(t.a,t.b),scaleY:Math.hypot(t.c,t.d),rotationZ:Math.atan2(t.b,t.a)*180/Math.PI,matrix:{a:t.a,b:t.b,c:t.c,d:t.d,tx:i.x,ty:i.y}}}function Me(e){return typeof e=="string"?e:e?.Name}function Pa(e){return{fillType:Me(e.fillType),fillHorizontalType:Me(e.fillHorizontalType),fillVerticalType:Me(e.fillVerticalType),fillAmount:e.fillAmount}}function su(e,t,i){let n=Math.abs(t.width*i.scaleX),r=Math.abs(t.height*i.scaleY),o={id:e.Id,kind:e.kind,name:e.name,left:i.centerX-n/2,bottom:i.centerY-r/2,width:n,height:r,sourceWidth:t.width,sourceHeight:t.height,rotationZ:i.rotationZ,matrix:i.matrix,pressed:e.pressed===!0,...Ea(e)};return e.kind==="image"&&(o.imageSource=We(e.imageSource),o.imageType=e.imageType==null?null:Me(e.imageType),o.primitive=_t(e.imageId,o.imageSource),o.imageColor=e.imageColor,o.imageId=e.imageId,Object.assign(o,Pa(e))),(e.kind==="textbox"||e.kind==="textwindow")&&(o.text=e.text??"",o.fontSize=e.fontSize,o.adaptiveFontSize=e.adaptiveFontSize===!0,o.minimumFontSize=e.minimumFontSize,o.textLayout=mt(e,t.width,t.height),o.fontColor=e.fontColor,o.bgColor=e.bgColor,o.enableOutline=e.enableOutline===!0,o.outlineColor=e.outlineColor,o.horizontalAlignment=Me(e.horizontalAlignment),o.verticalAlignment=Me(e.verticalAlignment)),o}function lu(e,t=rn(e)){let i=[],n=Aa(e,t);function r(o,a=[],s=[]){let u=t.get(o.Id);if(!u||o.visible===!1||!u.activeInHierarchy)return;let l=n.get(o.Id);if(!l)return;let f=au(u,l),d=o.kind==="image"&&o.enableMask===!0?Sa({...Ra(o,u),id:o.Id},wa(l,u.centerX,u.centerY)):null,m=d?[...s,d]:s,p=()=>i.push({...su(o,u,f),...a.length?{clipPolygons:a}:{},...m.length?{masks:m}:{}});ar.has(o.kind)&&o.kind!=="grid"&&p();let g=o.children||[];for(let y=g.length-1;y>=0;y-=1){let C=o._gridItems?.includes(g[y])?[...a,[[u.left,u.bottom],[u.right,u.bottom],[u.right,u.top],[u.left,u.top]].map(([x,I])=>_e(l,x,I))]:a;r(g[y],C,m)}o.kind==="grid"&&p()}for(let o of e.runtime.roots)r(o);return i}function Ra(e,t){let i={kind:e.kind,name:e.name,sourceWidth:t.width,sourceHeight:t.height,pressed:e.pressed===!0,...Ea(e)};return e.kind==="image"&&(i.imageSource=We(e.imageSource),i.imageType=e.imageType==null?null:Me(e.imageType),i.primitive=_t(e.imageId,i.imageSource),i.imageColor=e.imageColor,i.imageId=e.imageId,Object.assign(i,Pa(e),{enableMask:e.enableMask===!0,enableSoftEdge:e.enableSoftEdge===!0,softEdgeMode:Me(e.softEdgeMode)||"Percentage",softEdgeWidthX:e.softEdgeWidthX,softEdgeWidthY:e.softEdgeWidthY})),(e.kind==="textbox"||e.kind==="textwindow")&&(i.text=e.text??"",i.fontSize=e.fontSize,i.adaptiveFontSize=e.adaptiveFontSize===!0,i.minimumFontSize=e.minimumFontSize,i.textLayout=mt(e,t.width,t.height),i.fontColor=e.fontColor,i.bgColor=e.bgColor,i.enableOutline=e.enableOutline===!0,i.outlineColor=e.outlineColor,i.horizontalAlignment=Me(e.horizontalAlignment),i.verticalAlignment=Me(e.verticalAlignment)),i}function uu(e,t,i){let n=cn(e,t),r=_e(n,e.centerX,e.centerY);return{a:n.a,b:n.b,c:n.c,d:n.d,tx:r.x-(i?i.centerX:0),ty:r.y-(i?i.centerY:0)}}function Ma(e){let t=e.matrix;return[e.parent,e.z,e.group?1:0,t.a,t.b,t.c,t.d,t.tx,t.ty,e.kind,e.name,e.sourceWidth,e.sourceHeight,e.pressed,e.primitive,e.imageColor,e.imageId,e.imageSource,e.imageType,e.fillType,e.fillHorizontalType,e.fillVerticalType,e.fillAmount,e.enableMask,e.enableSoftEdge,e.softEdgeMode,e.softEdgeWidthX,e.softEdgeWidthY,e.text,e.fontSize,e.fontColor,e.bgColor,e.adaptiveFontSize,e.minimumFontSize,JSON.stringify(e.textLayout),e.enableOutline,e.outlineColor,e.horizontalAlignment,e.verticalAlignment,JSON.stringify(e.scroll),e.clipToParent].join(" ")}function Na(e,t,i,n,r,o){return{id:e.Id,parent:t,z:r,group:o>=16,matrix:uu(n,e,i),...Ra(e,n)}}function cu(e){let t=ve({width:e.runtime.canvasWidth,height:e.runtime.canvasHeight}),i=new Set,n=new Map,r=new Map;function o(u,l,f){let d=Be(l,u);if(d.activeInHierarchy=f&&u.active!==!1,r.set(u.Id,d),u.visible===!1||!d.activeInHierarchy)return!1;let m=u.children||[],p=ar.has(u.kind),g=0;for(let y=0;y<m.length;y+=1)o(m[y],d,d.activeInHierarchy)&&(p=!0,g+=1);return p?(i.add(u.Id),n.set(u.Id,g),!0):!1}function a(u,l,f,d){if(!i.has(u.Id))return;let m=r.get(u.Id);s.push(Na(u,l,f,m,d,n.get(u.Id)||0));let p=u.children||[];for(let g=0;g<p.length;g+=1)a(p[g],u.Id,m,g)}let s=[];for(let u=0;u<e.runtime.roots.length;u+=1)o(e.runtime.roots[u],t,!0),a(e.runtime.roots[u],null,null,u);return{nodes:s,childCounts:n}}function nr(e){let t=e._playChildDirty===!0||e._playDeepDirty===!0;if(e._playDirty=!1,e._playChildDirty=!1,e._playDeepDirty=!1,!t)return;let i=e.children;for(let n=0;n<i.length;n+=1)nr(i[n])}function fu(e,t){let i=ve({width:e.runtime.canvasWidth,height:e.runtime.canvasHeight}),n=[],r=[],o=t.count,a=e.runtime._playRemoved||[];for(let l=0;l<a.length;l+=1){let f=a[l];t.fingerprints.has(f)&&(r.push(f),t.fingerprints.delete(f),t.childCounts.delete(f),o-=1)}e.runtime._playRemoved=[];function s(l){t.fingerprints.has(l.Id)&&(r.push(l.Id),t.fingerprints.delete(l.Id),t.childCounts.delete(l.Id),o-=1);let f=l.children;for(let d=0;d<f.length;d+=1)s(f[d])}function u(l,f,d,m,p,g){let y=g||l._playDeepDirty===!0,C=y||l._playDirty===!0,x=y||l._playChildDirty===!0;if(!C&&!x)return;if(!(p&&l.active!==!1)||l.visible===!1){s(l);return}let z=Be(f,l),F=t.childCounts.get(l.Id)||0;if(x){F=0;let A=l.children;for(let w=0;w<A.length;w+=1)u(A[w],z,l.Id,w,!0,y),t.fingerprints.has(A[w].Id)&&(F+=1)}if(!(ar.has(l.kind)||F>0)){t.fingerprints.has(l.Id)&&(r.push(l.Id),t.fingerprints.delete(l.Id),t.childCounts.delete(l.Id),o-=1);return}let U=t.childCounts.get(l.Id);t.childCounts.set(l.Id,F);let H=F>=16!=(U||0)>=16;if(!C&&!H&&t.fingerprints.has(l.Id))return;let G=Na(l,d,f===i?null:f,z,m,F),v=Ma(G);t.fingerprints.get(G.id)!==v&&(t.fingerprints.has(G.id)||(o+=1),t.fingerprints.set(G.id,v),n.push(G))}for(let l=0;l<e.runtime.roots.length;l+=1)u(e.runtime.roots[l],i,null,l,!0,!1);return t.count=o,{changed:n,removed:r,count:o}}function du(e,t){let i=e.viewCache||(e.viewCache={rev:0,fingerprints:new Map,childCounts:new Map,count:0}),n=Number(t);if(!(Number.isFinite(n)&&n===i.rev&&i.fingerprints.size>0)){let{nodes:u,childCounts:l}=cu(e);i.rev+=1,i.fingerprints=new Map(u.map(f=>[f.id,Ma(f)])),i.childCounts=l,i.count=u.length;for(let f of e.runtime.roots)nr(f);return{format:"tree-v1",revision:i.rev,reset:!0,count:u.length,nodes:u}}let{changed:o,removed:a,count:s}=fu(e,i);i.rev+=1;for(let u of e.runtime.roots)nr(u);return{format:"tree-v1",revision:i.rev,reset:!1,count:s,changed:o,removed:a}}function sr(e,{inspect:t=!1,view:i=!1,paint:n=!1,sceneRev:r,compact:o=!1}={}){nn(e),e.audioSessionId||=ka();let a=e.runtime,s=e.compiled,[u,l]=[a.canvasWidth,a.canvasHeight];e.server&&e.server.setClock(a.clock.time);let f=o?a.logs.slice(-100):a.logs,d=ou(e),m=e.server?e.server.snapshot():{vars:{},inbound:[],outbound:[],logs:[]};o&&(m.inbound=m.inbound.slice(-100),m.outbound=m.outbound.slice(-100),m.logs=m.logs.slice(-100));let p={canvasId:s.canvasId,platform:s.platform,device:a.device,canvasWidth:u,canvasHeight:l,canvasPresets:eu,playerCount:e.playerCount||1,viewPlayerIndex:e.viewPlayerIndex||1,players:Array.from({length:e.playerCount||1},(g,y)=>({index:y+1,label:`\u73A9\u5BB6${y+1}`,entityType:`Player${y+1}`})),time:a.clock.time,frame:a.clock.frame,paused:!!e.debugPaused,levelTimePaused:!!a.clock.paused,audio:{sessionId:e.audioSessionId,playerIndex:e.viewPlayerIndex||1,...a.audioSnapshot()},mountError:e.mountError||a.mountErrors[0]||null,logs:f.map(g=>({source:"client",level:g.level,text:g.text,time:g.time})),tree:[],paint:[],scene:null,server:m,history:(o?d.slice(-100):d).map(g=>({t:g.t,source:g.source||"user",kind:g.kind,payload:g.payload||{}}))};if(t||n){let g=rn(e);t&&(p.tree=a.roots.map(y=>_a(y,g))),n&&(p.paint=lu(e,g))}return i&&(p.scene=du(e,r)),Tt(p),p}function on(e,t=1/30){let i=e.runtimes||(e.runtime?[e.runtime]:[]);for(let n of i)n.step(t);e.server&&(e.server.setClock(e.runtime.clock.time),e.server.flush())}function lr(e,t){ot(e,{kind:"key",payload:{typeName:String(t)}}),e.runtime.injectKey(t)}function hu(e,t){let i=null;for(let n of e.runtime.roots)$e(n,r=>{!i&&r.name===t&&(i=r)});return i}function ur(e,t){ot(e,{kind:"click",payload:{name:String(t)}});let i=hu(e,t);i&&cr(i)&&(i.kind==="button"||i.kind==="cursor")&&i.SimulateCursorClick()}function mu(e,t){return!e||!t?null:e.children.find(i=>i.authoringId===t||i.Id===t)||null}var Fa={unavailable:"unavailableChildId",hover:"hoverChildId",pressed:"pressedChildId",selected:"selectedChildId"};function Oa(e,t){let i=[];for(let[n,r]of Object.entries(Fa)){let o=t[r]?mu(t,t[r]):null;o&&i.push({state:n,child:o})}return i}function pu(e){for(let t of e.runtime.roots)$e(t,i=>{if(i.kind==="button"){for(let{child:n}of Oa(e,i))e.stateRestores.has(n.Id)||e.stateRestores.set(n.Id,{child:n,active:n.active,visible:n.visible}),n.active=!0,n.visible=!1,typeof n.markPlayDirty=="function"&&n.markPlayDirty(!0);gi(e,i)}})}function gi(e,t){if(!t||t.kind!=="button")return;let i=null;t.interactable===!1?i="unavailable":t.pressed===!0?i="pressed":e.hoveredControl===t?i="hover":e.selectedControl===t&&(i="selected");for(let n of Oa(e,t))n.child.active=!0,n.child.visible=n.state===i,typeof n.child.markPlayDirty=="function"&&n.child.markPlayDirty(!0)}function ir(e){if(!e)return null;let t=e.parent;return t?.kind==="button"&&Object.values(Fa).map(n=>t[n]).filter(Boolean).includes(e.authoringId)?t:e}function cr(e){return e.kind==="button"?e.raycastTarget!==!1&&e.interactable!==!1:e.kind==="cursor"||e.kind==="grid"?e.raycastTarget!==!1:e.kind==="textwindow"?e.interactable!==!1:e.raycastTarget===!0}function za(e){return e.kind==="container"||e.kind==="grid"||e.kind==="textwindow"||e.kind==="reference"||e.kind==="button"}function $a(e,t){let i=e.Id,n=t.get(i);if(n!==void 0)return n;let r=cr(e);if(!r&&za(e)){let o=e.children;for(let a=0;a<o.length;a+=1)if($a(o[a],t)){r=!0;break}}return t.set(i,r),r}function en(e,t,i){nn(e);let n=ve({width:e.runtime.canvasWidth,height:e.runtime.canvasHeight}),r=new Map;function o(s,u,l,f){if(!f||s.active===!1||s.visible===!1||!$a(s,r))return null;let d=Be(u,s),m=Zt(l,d,s),p=Rt(m);if(!p)return null;let g=_e(p,t,i);if(g.x<d.left||g.x>d.right||g.y<d.bottom||g.y>d.top)return null;if(tn(s)){let y=Qi(s._scroll,d.width,d.height)?.track,C=g.x-d.centerX,x=d.centerY-g.y;if(y&&C>=y.x&&C<=y.x+y.width&&x>=y.y&&x<=y.y+y.height)return s}if(za(s))for(let y=0;y<s.children.length;y+=1){let C=o(s.children[y],d,m,!0);if(C)return C}return cr(s)?s:null}let a=Pt();for(let s=e.runtime.roots.length-1;s>=0;s-=1){let u=o(e.runtime.roots[s],n,a,!0);if(u)return u}return null}function Vt(e,t,i,{dragging:n=!1,press:r=null,previous:o=null}={}){let a=r||{x:t,y:i},s=o||{x:t,y:i};return e.runtime.makeCursorEventData({x:t,y:i,pressX:a.x,pressY:a.y,deltaX:t-s.x,deltaY:i-s.y,dragging:n})}function rr(e,t,i){t.kind==="grid"||t.kind==="textwindow"||(t.pressed=i,typeof t.markPlayDirty=="function"&&t.markPlayDirty(),gi(e,t))}function tn(e){if(!e?.alive||!e.activeInHierarchy||e.interactable===!1||e.raycastTarget===!1)return!1;for(let t=e;t;t=t.parent)if(t.visible===!1)return!1;return e._scroll?.max>0}function Ia(e){for(let t=e;t;t=t.parent)if(tn(t))return t;return null}function xa(e,t,i,n){let r=rn(e),o=r.get(t.Id),a=Aa(e,r).get(t.Id),s=a&&Rt(a);if(!o||!s)return null;let u=_e(s,i,n);return{x:u.x-o.centerX,y:o.centerY-u.y,width:o.width,height:o.height}}function Ca(e,t,i){let n=e.pointerDownControl;if(n?.alive){let r=Vt(e,t,i,{dragging:e.pointerDragging,press:e.pointerDownPosition,previous:e.pointerLastPosition});e.runtime.injectCursor(n,"CursorUp",r),e.pointerDragging&&!e.pointerScroll&&e.runtime.injectCursor(n,"CursorEndDrag",r),rr(e,n,!1)}e.pointerDownControl=null,e.pointerScroll=null,e.pointerDownPosition=null,e.pointerDragging=!1,e.pointerLastPosition={x:t,y:i}}function yi(e,t,i,n,r={}){let o=Number(i),a=Number(n);if(!Number.isFinite(o)||!Number.isFinite(a))throw new Error("pointer coordinates must be finite");e.runtime.cursor.x=o,e.runtime.cursor.y=a;let s=Number(r.deltaX??0),u=Number(r.deltaY??0);if(t==="wheel"&&(!Number.isFinite(s)||!Number.isFinite(u)))throw new Error("wheel deltas must be finite");if(r.silent||ot(e,{kind:"pointer",payload:{type:t,x:o,y:a,...t==="wheel"?{deltaX:s,deltaY:u}:{}}}),t==="wheel"){let l=en(e,o,a),f=Ia(l);if(f){let d=f._scroll.horizontal&&s||u;tr(f,f._scroll.offset+d)}return l}if(t==="cancel")return Ca(e,o,a),null;if((t==="move"||t==="up")&&e.pointerScroll&&!tn(e.pointerScroll.control)&&Ca(e,o,a),t==="move"){let l=e.pointerLastPosition||{x:o,y:a},f=e.pointerHoverControl,d=ir(en(e,o,a)),m=Vt(e,o,a,{previous:l});f&&f!==d&&e.runtime.injectCursor(f,"CursorExit",m),d&&f!==d&&e.runtime.injectCursor(d,"CursorEnter",m),e.pointerHoverControl=d;let p=e.hoveredControl;e.hoveredControl=d?.kind==="button"?d:null,p&&p!==e.hoveredControl&&gi(e,p),e.hoveredControl&&gi(e,e.hoveredControl);let g=e.pointerDownControl,y=e.pointerScroll;if(y)if(!tn(y.control))e.pointerScroll=null;else{let C=xa(e,y.control,o,a);if(C){let x=y.control._scroll,I=x.horizontal?C.x-y.start.x:C.y-y.start.y,z=Qi(x,C.width,C.height)?.travel||0,F=y.bar?z?I*x.max/z:0:-I;tr(y.control,y.offset+F)}}if(g?.alive){let C=e.pointerDownPosition||l,x=Math.hypot(o-C.x,a-C.y)>5;!e.pointerDragging&&x&&(y||e.runtime.injectCursor(g,"CursorBeginDrag",Vt(e,o,a,{press:C,previous:l,dragging:!1})),e.pointerDragging=!0),e.pointerDragging&&!y&&e.runtime.injectCursor(g,"CursorDrag",Vt(e,o,a,{press:C,previous:l,dragging:!0}))}return e.pointerLastPosition={x:o,y:a},d}if(t==="down"){let l=ir(en(e,o,a));e.pointerDownControl=l,e.pointerDownPosition={x:o,y:a},e.pointerLastPosition={x:o,y:a},e.pointerDragging=!1,e.pointerScroll=null;let f=Ia(l);if(f){let d=xa(e,f,o,a),m=d&&Qi(f._scroll,d.width,d.height),p=y=>d.x>=y.x&&d.x<=y.x+y.width&&d.y>=y.y&&d.y<=y.y+y.height,g=m&&p(m.track);if(g&&!p(m.thumb)){let y=f._scroll.horizontal?d.x-m.track.x-m.thumb.width/2:d.y-m.track.y-m.thumb.height/2;tr(f,m.travel?y/m.travel*f._scroll.max:0),nn(e)}d&&(e.pointerScroll={control:f,start:d,offset:f._scroll.offset,bar:!!g})}return l&&(rr(e,l,!0),e.runtime.injectCursor(l,"CursorDown",Vt(e,o,a))),l}if(t==="up"){let l=e.pointerDownControl,f=ir(en(e,o,a));if(l?.alive){let d=Vt(e,o,a,{press:e.pointerDownPosition,previous:e.pointerLastPosition,dragging:e.pointerDragging});if(e.runtime.injectCursor(l,"CursorUp",d),e.pointerDragging)e.pointerScroll||e.runtime.injectCursor(l,"CursorEndDrag",d);else if(f===l&&!e.pointerScroll?.bar){e.runtime.injectCursor(l,"CursorClick",d);let m=e.selectedControl;e.selectedControl=l.kind==="button"?l:null,m&&m!==e.selectedControl&&gi(e,m)}rr(e,l,!1)}return e.pointerDownControl=null,e.pointerDownPosition=null,e.pointerLastPosition={x:o,y:a},e.pointerDragging=!1,e.pointerScroll=null,f}if(t==="click")return yi(e,"down",o,a,{silent:!0}),yi(e,"up",o,a,{silent:!0});throw new Error(`unknown pointer type ${t}`)}function fr(e,t,i,n){if(!e?.server)throw new Error("play session has no server");return ot(e,{kind:"serverSet",payload:{entityType:t,name:i,value:n,playerIndex:e.viewPlayerIndex}}),e.server.setVar(t,i,n,{playerIndex:e.viewPlayerIndex})}function Ga(e,t,i){if(!e?.server)throw new Error("play session has no server");let n=e.server.getVar(t,i,{playerIndex:e.viewPlayerIndex});return n===void 0?null:n}function dr(e,t,i=[],n="PlayerSelf"){if(!e?.server)throw new Error("play session has no server");return ot(e,{kind:"serverSend",payload:{name:t,params:i,target:n,playerIndex:e.viewPlayerIndex}}),e.server.sendToClient(t,i,{target:n,playerIndex:e.viewPlayerIndex})}function an(e){return{snapshot:t=>sr(e,t),step:t=>on(e,t),pointer:(t,i,n,r)=>yi(e,t,i,n,r),key:t=>lr(e,t),click:t=>ur(e,t),view:t=>or(e,t),pause:()=>{ot(e,{kind:"pause",payload:{}}),e.debugPaused=!0},resume:()=>{ot(e,{kind:"resume",payload:{}}),e.debugPaused=!1},serverSet:(t,i,n)=>fr(e,t,i,n),serverSend:(t,i,n)=>dr(e,t,i,n)}}function hr(e){e?.server&&e.server.destroy();let t=e?.runtimes||(e?.runtime?[e.runtime]:[]);for(let i of t)i.destroy()}function mr(e,t){return JSON.stringify(e)===JSON.stringify(t)}function Da(e,t){for(let i of e||[])t(i),i.children?.length&&Da(i.children,t)}function pr(e,{id:t,name:i}){let n=null;return Da(e,r=>{n||(t&&String(r.id)===String(t)||!t&&i&&r.name===i)&&(n=r)}),n}function gu(e,t){if(e){if(Object.prototype.hasOwnProperty.call(e,t))return e[t];if(e.box&&Object.prototype.hasOwnProperty.call(e.box,t))return e.box[t]}}function yu(e){return{var(t,i){return e.server?.vars?.[t]?.[i]?.value??null},logs(){return(e.logs||[]).map(t=>t.text)},logContains(t){return(e.logs||[]).some(i=>String(i.text||"").includes(String(t)))},serverLogs(){return(e.server?.logs||e.serverLogs||[]).map(t=>t.text)},serverLogContains(t){return(e.server?.logs||e.serverLogs||[]).some(i=>String(i.text||"").includes(String(t)))},control(t){let i=pr(e.tree,{name:String(t)});return i?{id:i.id,name:i.name,kind:i.kind,active:i.active,visible:i.visible,pressed:i.pressed,text:i.text,interactable:i.interactable}:null},signals(t){let i=t==="outbound"?"outbound":"inbound";return(e.server?.[i]||[]).map(n=>({name:n.name,values:n.values}))}}}function bu(e,t){if(e.kind==="log"){let i=e.source==="server"?t.server?.logs||t.serverLogs||[]:t.logs||[];return i.some(r=>e.level&&r.level!==e.level?!1:String(r.text||"").includes(e.contains))?{ok:!0,actual:e.contains}:{ok:!1,actual:i.map(r=>r.text).slice(-8),expected:e.contains}}if(e.kind==="control"){let i=pr(t.tree,e);if(!i)return{ok:!1,actual:null,expected:e.equals,message:`control not found: ${e.id||e.name}`};let n=gu(i,e.field);return mr(n,e.equals)?{ok:!0,actual:n}:{ok:!1,actual:n,expected:e.equals}}if(e.kind==="var"){let i=t.server?.vars?.[e.entityType],r=!i||!Object.prototype.hasOwnProperty.call(i,e.name)?null:i[e.name].value;return mr(r,e.equals)?{ok:!0,actual:r}:{ok:!1,actual:r,expected:e.equals}}if(e.kind==="signal"){let i=e.direction==="outbound"?t.server?.outbound||[]:t.server?.inbound||[],n=i.find(r=>r.name===e.name&&(e.values===void 0||mr(r.values,e.values)));return n?{ok:!0,actual:n.values}:{ok:!1,actual:i.map(r=>({name:r.name,values:r.values})),expected:{name:e.name,values:e.values??null}}}if(e.kind==="tree"){let i=!!pr(t.tree,{name:e.name});return i===e.exists?{ok:!0,actual:i}:{ok:!1,actual:i,expected:e.exists}}return{ok:!1,message:`unsupported assert kind ${e.kind}`}}function vu(e,t){let i=ci();try{return i.evalQueryScript(e,yu(t)),{ok:!0,actual:!0}}catch(n){return{ok:!1,message:n?.message||String(n)}}finally{i.destroy()}}function Va(e,t){return e.kind==="lua"?vu(e.source,t):bu(e,t)}function Su(e,t){let i=t>0?t:It;return Math.round((e+i)*1e9)/1e9}function wu(e,t){let i=t.payload||{};if(t.kind==="pointer")e.pointer(i.type,i.x,i.y,i);else if(t.kind==="key")e.key(i.typeName);else if(t.kind==="click")e.click(i.name);else if(t.kind==="pause")e.pause();else if(t.kind==="resume")e.resume();else if(t.kind==="serverSet")e.serverSet(i.entityType,i.name,i.value);else if(t.kind==="serverSend")e.serverSend(i.name,i.params,i.target);else if(t.kind==="view")e.view(i.playerIndex);else throw new Error(`unsupported event kind: ${t.kind}`)}function Iu(e,t){let i=Va(e,t);return{kind:e.kind,at:Number(e.at||0),ok:!!i.ok,actual:i.actual??null,expected:i.expected??null,message:i.message||""}}function Ya(e,t){let i=pi(t),n=i.events.slice().sort((x,I)=>x.t-I.t),r=i.asserts.slice(),o=i.dt||It,a=n.reduce((x,I)=>Math.max(x,I.t),0),s=r.reduce((x,I)=>Math.max(x,Number(I.at||0)),0),u=Math.max(a,s),l=0,f=[],d=0,m=r.some(x=>x.kind==="control"||x.kind==="tree"||x.kind==="lua"),p=e.snapshot({inspect:m}),g=()=>{for(;l<n.length&&n[l].t<=d+1e-9;)wu(e,n[l]),l+=1,p=e.snapshot({inspect:m})},y=()=>{for(let x of r)if(!x._done&&Number(x.at||0)<=d+1e-9){let I=Iu(x,p);if(f.push(I),x._done=!0,!I.ok)return{passed:!1,failedAt:d,frame:p.frame||0,results:f,snapshot:p}}return null};g();let C=y();if(C)return gr(i,C);for(;d+1e-9<u;){e.step(o),d=Su(d,o),p=e.snapshot({inspect:m}),g();let x=y();if(x)return gr(i,x)}return gr(i,{passed:f.every(x=>x.ok),failedAt:null,frame:p.frame||0,results:f,snapshot:p})}function gr(e,t){return V({format:e.format,name:e.name,passed:t.passed,failedAt:t.failedAt,frame:t.frame,results:t.results,snapshot:{time:t.snapshot?.time??0,frame:t.snapshot?.frame??0,logs:t.snapshot?.logs||[],serverLogs:t.snapshot?.serverLogs||t.snapshot?.server?.logs||[],server:t.snapshot?.server||{vars:{},inbound:[],outbound:[],logs:[]}}})}function yr(e){return Array.isArray(e)?e.slice():[]}import{createHash as xu}from"node:crypto";var Ba=e=>xu("sha256").update(JSON.stringify(e.map(({id:t,path:i,source:n})=>({id:t,path:i,source:n})))).digest("hex");var _u={Level:"\u5173\u5361",PlayerSelf:"\u5F53\u524D\u73A9\u5BB6",AvatarSelf:"\u5F53\u524D\u89D2\u8272",...Object.fromEntries(St.map((e,t)=>[e,`\u73A9\u5BB6${t+1}`])),...Object.fromEntries(Array.from({length:8},(e,t)=>[`Avatar${t+1}`,`\u89D2\u8272${t+1}`]))};function Tu(e,t=1){let i=e?.vars||{},n=[],r=Number(t)>0?Number(t):1,o=["Level","PlayerSelf","AvatarSelf"];if(r>1)for(let s=1;s<=r;s+=1)o.push(`Player${s}`,`Avatar${s}`);let a=new Set;for(let s of o){if(a.has(s)||!i[s])continue;a.add(s);let u=i[s]||{};for(let l of Object.keys(u))n.push(V({entityType:s,entityLabel:_u[s]||s,name:l,type:u[l]?.type||"",value:u[l]?.value??null}))}return n}var Ct="qxqy-simulator-save",Pu="qxqy-simulator-scripts",se="server-control-template",B="client-control-template",br={[se]:"\u670D\u52A1\u5668\u63A7\u4EF6\u6A21\u677F",[B]:"\u5BA2\u6237\u7AEF\u63A7\u4EF6\u6A21\u677F"};function xt(e){return e===B?"client":"server"}function Xt(e){if(!(typeof e=="number"||typeof e=="string"&&/^\d+$/.test(e.trim()))||!Te(e))throw new Error("\u63A7\u4EF6\u7D22\u5F15\u5FC5\u987B\u662F 1\u20132147483647 \u8303\u56F4\u5185\u7684\u6574\u6570");return Number(e)}function vr(e=[]){if(!Array.isArray(e))throw new Error("controlGuidChanges \u5FC5\u987B\u662F\u6570\u7EC4");let t=new Set;return e.map(i=>{if(!i||typeof i.id!="string"||!i.id||t.has(i.id)||![se,B].includes(i.controlAsset)||typeof i.controlId!="string"||!i.controlId||typeof i.controlName!="string")throw new Error("controlGuidChanges \u5305\u542B\u65E0\u6548\u6216\u91CD\u590D\u7684\u53D8\u66F4\u8BB0\u5F55");if(t.add(i.id),i.batchId!==void 0&&(typeof i.batchId!="string"||!i.batchId))throw new Error("controlGuidChanges \u5305\u542B\u65E0\u6548\u7684 batchId");if(i.scriptSignature!==void 0&&!/^[a-f0-9]{64}$/.test(i.scriptSignature))throw new Error("controlGuidChanges \u5305\u542B\u65E0\u6548\u7684 scriptSignature");return{id:i.id,controlAsset:i.controlAsset,controlId:i.controlId,controlName:i.controlName,oldGuid:Xt(i.oldGuid),newGuid:Xt(i.newGuid),...i.batchId?{batchId:i.batchId}:{},...i.scriptSignature?{scriptSignature:i.scriptSignature}:{}}})}function Ru(e){let t=[e?.guid,e?.id];for(let i of t){let n=Number(i);if(Number.isSafeInteger(n)&&n>0&&n<=2147483647)return n}return 0}function sn(e){let t=String(e?.controlAsset||""),i=Ru(e);return{id:String(i||e?.id||""),guid:i,path:String(e?.path||""),source:String(e?.source||""),controlId:String(e?.controlId||""),controlAsset:t===B||t==="client"?B:t===se||t==="server"?se:""}}function Mu(e){let t=[],i=(n,r="")=>{if(n&&(n.path||n.source)){let o=sn(n);t.push(r?{...o,controlAsset:r}:o)}};if(Array.isArray(e?.assets?.scripts)){for(let n of e.assets.scripts)n&&(n.path||n.source)&&t.push(sn(n));return t}if(i(e?.assets?.server?.script,se),i(e?.assets?.client?.script,B),e&&e.format!==Ct){i(e?.script);for(let n of e?.scripts||[])i(n)}return t}function Sr(e){return nt(e===B?Nt():ht())}var Nu="\u672A\u7ED1\u5B9A",Yt="\u672A\u547D\u540D\u5B58\u6863",Fu="\u672A\u547D\u540D\u754C\u9762";function Ou(e){let t=e;for(let i=0;i<8;i++){if(bi(Ua(t,"simulator","studio"))&&bi(Ua(t,"lua")))return t;let n=Eu(t);if(n===t)break;t=n}return e}function zu(e){return e?{name:Bt(e),path:e,bound:!0}:{name:Nu,path:"",bound:!1}}function $u(e,t=process.cwd()){if(Au(e)&&bi(e))return e;let i=t||process.cwd(),n=Ou(i),r=Ha(n,e);if(bi(r))return r;let o=Ha(i,e);if(bi(o))return o;throw new Error("script file not found: "+e)}function wr(e,t={}){e?.format===Ct&&On(e.version);let i=[],n=typeof t.workspacePath=="string"&&t.workspacePath?t.workspacePath:"",r=e?.format===Ct&&e.assets,o=vr(e?.controlGuidChanges),a=ln(e?.scriptSync),s=r?null:nt(e,{warnings:i}),u={server:r&&e.assets.server?nt(e.assets.server,{warnings:i}):Sr(se),client:r&&e.assets.client?nt(e.assets.client,{warnings:i}):Sr(B)};s&&(u[xt(s.meta.assetType)]=s);let l=r&&e.activeAssetType===B?B:s?.meta.assetType||se,f=r&&e.meta?.name?String(e.meta.name):"",d=()=>f||Yt;!e?.meta?.name&&u.server.meta.name==="\u672A\u547D\u540D\u754C\u9762\u63A7\u4EF6\u7EC4"&&(u.server.meta.name=Fu);let m=[],p=new Set;function g(){p.clear(),Mt(u.server.root,p),Mt(u.client.root,p,{skipServerContainer:!0});for(let h of m)Te(h.guid)&&p.add(Number(h.guid))}function y(h=0){g();let b=Te(h)&&!p.has(Number(h))?Number(h):Qe(p);return p.add(b),b}function C(h){let b=sn(h),S=y(b.guid);return{...b,guid:S,id:String(S)}}Le(Mu(e));let x=mi(e?.serverLogic),I=null,z="",F=1,X=1;function U(h){let b=String(h||"").trim();if(!b)return"";if(!ie[b])throw new Error(`unknown canvas preset: ${b} (available: ${Object.keys(ie).join(", ")})`);return b}let H=()=>u[xt(l)];function G(h){if(!h)return null;for(let[b,S]of[["server",u.server],["client",u.client]]){let R=de(S.root,h);if(R&&R.kind!=="server-container")return{key:b,node:R}}return null}function v(h){if(!h.controlId)return null;let b=h.controlAsset===B?"client":h.controlAsset===se?"server":null;if(b){let S=de(u[b].root,h.controlId);return S&&S.kind!=="server-container"?{key:b,node:S}:null}return G(h.controlId)}function A(){for(let h of m)h.controlId&&!v(h)&&(h.controlId="",h.controlAsset="")}function w(h){if(!Te(h))return null;for(let[b,S]of[[se,u.server],[B,u.client]]){let R="";if(ee(S.root,M=>{!R&&(M.scriptMappingIds||[]).includes(Number(h))&&(R=M.id)}),R)return{controlId:R,controlAsset:b}}return null}function k(h,b,S){let R=u[xt(h.controlAsset)],M=R&&de(R.root,h.controlId);M&&(M.scriptMappingIds=(M.scriptMappingIds||[]).map(N=>Number(N)===Number(b)?Number(S):N))}A();function $(){return m.map(h=>{let b=v(h),S=b?b.key==="client"?B:se:"";return V({id:h.id,guid:h.guid||0,path:h.path||"",source:h.source||"",controlId:h.controlId||"",controlAsset:h.controlAsset||S,controlName:b?.node.name||"",assetType:S,assetLabel:b?br[S]:"",mounted:!!b})})}function E(){let h=[],b=(S,R)=>{ee(S.root,M=>{M.kind!=="server-container"&&h.push(V({id:M.id,name:M.name,kind:M.kind,assetType:R,assetLabel:br[R]}))})};return b(u.server,se),b(u.client,B),h}function _(h){let b=[];return ee(h.root,S=>{S.kind!=="server-container"&&b.push(JSON.stringify({kind:S.kind,guid:S.guid,name:S.name,text:S.text??null,imageId:S.imageId??null,imageSource:S.imageSource??null,imageType:S.imageType??null,fontSize:S.fontSize??null,adaptiveFontSize:S.adaptiveFontSize??null,minimumFontSize:S.minimumFontSize??null,fontColor:S.fontColor??null,bgColor:S.bgColor??null,imageColor:S.imageColor??null,fillType:S.fillType??null,fillAmount:S.fillAmount??null,syncAllDevices:S.syncAllDevices!==!1,transformByPlatform:S.transformByPlatform||null}))}),b.join("/")}let D=_(Nt()),Y=_(ht());function ue(h){let b=_(h);return h.meta?.assetType===B?b===D:b===Y}function K(h,b){return String(h||"").replace(/[\\/:*?"<>|]/g,"-").trim()||b}function we(h){let b=K(d(),Yt),S=h.meta?.assetType===B?"\u5BA2\u6237\u7AEF\u63A7\u4EF6\u6A21\u677F":"\u670D\u52A1\u5668\u63A7\u4EF6\u6A21\u677F";return`${b} \xB7 ${S}`}function Ee(){if(!((u.server.root.children||[]).find(b=>b.kind==="container")||u.server.root.children?.[0]))throw new Error("\u6574\u5408\u5305\u9700\u8981\u670D\u52A1\u7AEF\u5BA2\u6237\u7AEF\u63A7\u4EF6\u5BB9\u5668\u4E0B\u81F3\u5C11\u6709\u4E00\u4E2A\u6839\u63A7\u4EF6");return Io(u.server,u.client,{scripts:m,fileName:`${K(d(),Yt)} \xB7 \u6574\u5408\u5305.gia`})}function kt(){let h=b=>({type:b.meta.assetType,name:b.meta.name,sourceFile:b.meta.sourceFile||""});return{format:Ct,name:d(),activeAssetType:l,assets:{server:h(u.server),client:h(u.client),scripts:$()}}}function Ut(){return V({format:Ct,version:4,meta:{name:d()},activeAssetType:l,serverLogic:x,controlGuidChanges:o,scriptSync:a,assets:{server:u.server,client:u.client,scripts:m.map(h=>V({id:h.id,guid:h.guid||0,path:h.path||"",source:h.source||"",controlId:h.controlId||"",controlAsset:h.controlAsset||""}))}})}function te(){let h=H(),b=$o(h);if(b.workspace=zu(n),b.save=kt(),b.scripts=$(),b.mountTargets=E(),b.serverLogic=x,b.migrationWarnings=[...i],b.controlGuidChanges=V(o),l===B){let S=Ft(h,!0);b.clientGuidAutofill={count:S.length,templateCount:S.filter(({parent:R})=>R?.kind==="server-container").length,selectedOffset:S.findIndex(({node:R})=>R.id===b.selectedId)}}return b.scriptSync=V(a),Nr(b),b}function Ne(h){let b=H();if(h.expectedRevision!==void 0&&Number(h.expectedRevision)!==b.version)throw new Error(`revision conflict: expected ${h.expectedRevision}, current ${b.version}`);return b}function st(h,b,S=""){let R=String(b||"");if(R){let M=S===B?B:S===se?se:"";if(!v({controlId:R,controlAsset:M}))throw new Error("\u6302\u8F7D\u76EE\u6807\u5FC5\u987B\u662F\u5B58\u6863\u5185\u7684\u5BA2\u6237\u7AEF\u63A7\u4EF6\u6216\u5BA2\u6237\u7AEF\u63A7\u4EF6\u6A21\u677F");h.controlAsset=M}else h.controlAsset="";h.controlId=R}function wi(h){let b=Ne(h);if(h.op==="addScript"){let S=C({path:String(h.path||""),source:String(h.source||""),controlId:"",controlAsset:""});h.controlId!==void 0&&h.controlId!==""&&st(S,h.controlId,h.controlAsset),m.push(S)}else if(h.op==="updateScript"){let S=m.find(R=>R.id===h.id);if(!S)throw new Error(`\u811A\u672C\u4E0D\u5B58\u5728: ${h.id}`);h.controlId!==void 0&&st(S,h.controlId,h.controlAsset),h.path!==void 0&&(S.path=String(h.path)),h.source!==void 0&&(S.source=String(h.source))}else if(h.op==="removeScript"){let S=m.length;if(m=m.filter(R=>R.id!==h.id),m.length===S)throw new Error(`\u811A\u672C\u4E0D\u5B58\u5728: ${h.id}`)}return b.version+=1,te()}function Ii(h){let b=Ne(h),S=de(b.root,h.id??b.selectedId);if(!S||S.kind==="server-container")throw new Error("\u4EC5\u5BA2\u6237\u7AEF\u63A7\u4EF6\u6216\u5BA2\u6237\u7AEF\u63A7\u4EF6\u6A21\u677F\u5141\u8BB8\u4FEE\u6539\u7D22\u5F15");let R=Xt(h.guid);if(Xt(S.guid),h.autoFillClientGuids!==void 0&&typeof h.autoFillClientGuids!="boolean")throw new Error("autoFillClientGuids \u5FC5\u987B\u662F\u5E03\u5C14\u503C");let M=h.autoFillClientGuids===!0;if(M&&l!==B)throw new Error("\u81EA\u52A8\u586B\u5145\u4EC5\u652F\u6301\u5BA2\u6237\u7AEF\u6A21\u677F\u5217\u8868\uFF1B\u670D\u52A1\u7AEF\u754C\u9762\u7684\u7D22\u5F15\u9700\u5355\u72EC\u586B\u5199");let N=M?Ft(b,!0).map(({node:O})=>O):[S],j=R-N.indexOf(S),W=N.map((O,oe)=>({node:O,oldGuid:Xt(O.guid),newGuid:Xt(j+oe)})),Ve=W.filter(({oldGuid:O,newGuid:oe})=>O!==oe);if(!Ve.length)return te();let re=new Map(W.map(({oldGuid:O,newGuid:oe})=>[O,oe]));if(re.size!==W.length)throw new Error("\u5BA2\u6237\u7AEF\u6A21\u677F\u5B58\u5728\u91CD\u590D\u65E7\u7D22\u5F15\uFF0C\u65E0\u6CD5\u81EA\u52A8\u586B\u5145\uFF1B\u8BF7\u5148\u6D88\u9664\u6B67\u4E49");let qe=new Set(N),pe=[];for(let O of Object.values(u))ee(O.root,oe=>{O===u.client&&oe.kind==="server-container"||pe.push({node:oe,project:O})});let lt=new Map([...pe.filter(O=>!qe.has(O.node)).map(({node:O})=>[Number(O.guid),O.name]),...m.map(O=>[Number(O.guid),O.path||"Lua \u811A\u672C"])]);for(let{newGuid:O}of Ve)if(lt.has(O))throw new Error(`\u63A7\u4EF6\u7D22\u5F15 ${O} \u5DF2\u88AB\u300C${lt.get(O)}\u300D\u5360\u7528\uFF1B\u8BF7\u5148\u586B\u5199\u5B83\u7684\u5B9E\u9645\u7D22\u5F15\u3002\u672C\u6B21\u672A\u4FEE\u6539\u4EFB\u4F55\u7D22\u5F15\u3002`);let Oe=[],Z=(O,oe,Ye)=>{let Ae=O?.[oe];(typeof Ae=="number"||typeof Ae=="string"&&/^\d+$/.test(Ae.trim()))&&re.has(Number(Ae))&&re.get(Number(Ae))!==Number(Ae)&&Oe.push({owner:O,key:oe,project:Ye.project,oldGuid:Number(Ae),newGuid:re.get(Number(Ae))})};for(let O of pe)Z(O.node,"referencedPrefabId",O),Z(O.node,"itemPrefabId",O),Z(O.node.giaRaw,"templateRefSlot",O);let ge=new Map;for(let{node:O}of pe)ge.set(Number(O.guid),(ge.get(Number(O.guid))||0)+1);for(let{oldGuid:O}of Oe)if(ge.get(O)!==1)throw new Error(`\u65E7\u7D22\u5F15 ${O} \u5728\u591A\u68F5\u8D44\u4EA7\u6811\u4E2D\u91CD\u590D\uFF0C\u65E0\u6CD5\u786E\u5B9A\u6A21\u677F\u5F15\u7528\u5F52\u5C5E\uFF1B\u8BF7\u5148\u6D88\u9664\u6B67\u4E49\u540E\u4FEE\u6539`);let Wt=M?Xa():"",ye=Ba(m);for(let{node:O,oldGuid:oe,newGuid:Ye}of Ve)O.guid=Ye,o.push({id:Xa(),controlAsset:l,controlId:O.id,controlName:O.name,oldGuid:oe,newGuid:Ye,scriptSignature:ye,...Wt?{batchId:Wt}:{}});let xi=new Set([b]);for(let{owner:O,key:oe,project:Ye,newGuid:Ae}of Oe)O[oe]=typeof O[oe]=="string"?String(Ae):Ae,xi.add(Ye);for(let O of xi)O.version+=1;return te()}function ne(h){let b=Ne(h);if(!Array.isArray(h.changeIds)||!h.changeIds.length||h.changeIds.some(R=>typeof R!="string"||!o.some(M=>M.id===R)))throw new Error("\u8BF7\u660E\u786E\u6307\u5B9A\u5DF2\u6838\u5BF9 Lua \u5F15\u7528\u7684\u6709\u6548\u7D22\u5F15\u53D8\u66F4\u8BB0\u5F55 changeIds");let S=new Set(h.changeIds);return o=o.filter(R=>!S.has(R.id)),b.version+=1,te()}function Fe(h){if(!h||typeof h!="object")throw new Error("patch requires op");if(h.op==="setScriptSync"){let b=Ne(h);return a=ln(h.config),b.version+=1,te()}if(h.op==="setControlGuid")return Ii(h);if(h.op==="acknowledgeControlGuidChanges")return ne(h);if(h.op==="setServerLogic"){let b=Ne(h);return x=mi(h.logic),b.version+=1,te()}if(h.op==="addScript"||h.op==="updateScript"||h.op==="removeScript")return wi(h);if(h.op==="selectAsset")return l=h.assetType===B?B:se,te();if(h.op==="renameSave"){let b=String(h.name||"").trim();if(!b)throw new Error("\u5B58\u6863\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A");return f=b,te()}if(h.op==="newAsset"){let b=Ne(h);l=h.assetType===B?B:se;let S=Sr(l);return S.version=b.version+1,u[xt(l)]=S,o=o.filter(R=>R.controlAsset!==l),A(),te()}return Gn(H(),h),A(),te()}function De(h){return m.filter(b=>{let S=v(b);return!!(S&&S.key==="client"==(h===B))})}function Ht(h="json",b=""){let S=jt(h,b);if(o.length&&!["save","archive"].includes(String(h).toLowerCase())){let R=o.map(M=>`\u63A7\u4EF6\u7D22\u5F15\u5F85\u6838\u5BF9 Lua \u5F15\u7528\uFF1A${br[M.controlAsset]} / ${M.controlName} (${M.controlId})\uFF1A${M.oldGuid} \u2192 ${M.newGuid}\u3002\u8BF7\u6309\u8BED\u4E49\u66F4\u65B0\u811A\u672C\u4E2D\u7684\u63A7\u4EF6\u7D22\u5F15\u5F15\u7528\uFF0C\u6838\u5BF9\u540E\u786E\u8BA4\u53D8\u66F4\u8BB0\u5F55 ${M.id}\uFF1B\u4E0D\u8981\u5168\u5C40\u66FF\u6362\u540C\u503C\u6570\u5B57\u3002`);S.warnings=[...new Set([...S.warnings||[],...R])]}return S}function jt(h="json",b=""){let S=String(h).toLowerCase();if(S==="save"||S==="archive"){let N=Buffer.from(JSON.stringify(Ut(),null,2),"utf8");return V({filename:`${d().replace(/[\\/:*?"<>|]/g,"-")} \xB7 \u8D44\u4EA7\u5305.json`,mimeType:"application/json",encoding:"base64",data:N.toString("base64"),warnings:[]})}if(S==="save-gia"||S==="archive-gia"){let N=[],j=[],W=(re,qe="")=>{let pe=Ht(re,qe);N.push(V({filename:pe.filename,mimeType:pe.mimeType,encoding:pe.encoding,data:pe.data,warnings:pe.warnings||[]})),j.push(...pe.warnings||[])},Ve=(re,qe)=>{let pe=u[xt(re)],lt=re===l,Oe=m.some(Z=>Z.controlAsset===re&&Z.controlId);if(!lt&&ue(pe)&&!Oe){j.push(qe);return}W("gia",re)};if(Ve(se,"\u670D\u52A1\u5668\u63A7\u4EF6\u6A21\u677F\u4ECD\u662F\u9ED8\u8BA4\u6A71\u7A97\uFF0C\u672A\u6539\u52A8\u4E14\u5F53\u524D\u672A\u663E\u793A\uFF0C\u5DF2\u4ECE\u8D44\u4EA7\u5305 GIA \u4E2D\u7701\u7565\u3002"),Ve(B,"\u5BA2\u6237\u7AEF\u63A7\u4EF6\u6A21\u677F\u4ECD\u662F\u9ED8\u8BA4\u300CLua\u5B9E\u4F8B\u5316\u9762\u677F\u300D\uFF0C\u672A\u6539\u52A8\u4E14\u5F53\u524D\u672A\u663E\u793A\uFF0C\u5DF2\u4ECE\u8D44\u4EA7\u5305 GIA \u4E2D\u7701\u7565\u3002"),m.some(re=>re.path||re.source)&&W("scripts-gia"),!N.length)throw new Error("\u8D44\u4EA7\u5305 GIA \u6CA1\u6709\u53EF\u5BFC\u51FA\u7684\u5DF2\u6539\u52A8\u9879\uFF1B\u8BF7\u5148\u7F16\u8F91\u5F53\u524D\u754C\u9762\uFF0C\u6216\u6539\u7528\u300C\u5F53\u524D\u754C\u9762 GIA\u300D\u3002");return V({format:"qxqy-gia-package",files:N,warnings:[...new Set(j)]})}if(S==="gia-combined"||S==="combined-gia"||S==="combined"){let N=Ee();return V({filename:`${K(d(),Yt)} \xB7 \u6574\u5408\u5305.gia`,mimeType:"application/octet-stream",encoding:"base64",data:N.buffer.toString("base64"),warnings:[...new Set(N.warnings||[])]})}if(S==="scripts"){let N=V({format:Pu,version:1,scripts:m.map(W=>V({id:W.id,guid:W.guid||0,path:W.path||"",source:W.source||"",controlId:W.controlId||"",controlAsset:W.controlAsset||""}))}),j=Buffer.from(JSON.stringify(N,null,2),"utf8");return V({filename:`${K(d(),Yt)} \xB7 \u811A\u672C.json`,mimeType:"application/json",encoding:"base64",data:j.toString("base64"),warnings:[]})}if(S==="scripts-gia"||S==="scriptsgia"){let N=ko(m);return V({filename:`${K(d(),Yt)} \xB7 \u811A\u672C.gia`,mimeType:"application/octet-stream",encoding:"base64",data:N.buffer.toString("base64"),warnings:N.warnings})}if(S==="lua"){let N=m.find(W=>W.id===b)||m.find(W=>W.path===b);if(!N)throw new Error("\u6CA1\u6709\u53EF\u5BFC\u51FA\u7684 Lua \u811A\u672C\uFF0C\u8BF7\u5148\u5728\u201CLua \u811A\u672C\u201D\u9875\u521B\u5EFA");let j=Bt(N.path||"")||`qxqy-script-${N.id}`;return V({filename:/\.lua$/i.test(j)?j:`${j}.lua`,mimeType:"text/x-lua",encoding:"base64",data:Buffer.from(N.source||"","utf8").toString("base64"),warnings:[]})}let R=b?u[xt(b)]:H(),M=we(R);if(S==="json"){let N=V({...R,scripts:De(R.meta.assetType),controlGuidChanges:o.filter(W=>W.controlAsset===R.meta.assetType)}),j=Buffer.from(JSON.stringify(N,null,2),"utf8");return V({filename:`${M}.json`,mimeType:"application/json",encoding:"base64",data:j.toString("base64"),warnings:[]})}if(S==="gia"){let N=wo(R,R.meta.assetType===B?{scripts:De(B)}:{}),j=R.meta.assetType===B?[]:De(se);return j.length&&N.warnings.unshift(`\u5F53\u524D\u670D\u52A1\u5668\u63A7\u4EF6 GIA \u4E0D\u5305\u542B ${j.length} \u4E2A Lua \u811A\u672C\u7684\u6E90\u7801\uFF1B\u8BF7\u4F7F\u7528\u300C\u8D44\u4EA7\u5305 GIA \u6574\u5408\u5305\u300D\uFF0C\u6216\u53E6\u884C\u5BFC\u5165\u811A\u672C\u5305\u5E76\u6838\u5BF9\u6302\u8F7D\u3002`),V({filename:`${M}.gia`,mimeType:"application/octet-stream",encoding:"base64",data:N.buffer.toString("base64"),warnings:N.warnings})}throw new Error(`unsupported export format: ${h}`)}function Le(h){for(let b of h){let S=sn(b);if(!S.path&&!S.source)continue;let R=S.controlId?null:w(S.guid),M=C(R?{...S,...R}:S);R&&M.guid!==S.guid&&k(R,S.guid,M.guid),M.controlId&&!v(M)&&(M.controlId="",M.controlAsset=""),m.push(M)}}function Kt(h,b,S=""){let R=String(h||"").toLowerCase();if(typeof b!="string"||!b)throw new Error("import data is required");let M=Buffer.from(b,"base64"),N,j=[],W={},Ve=[];if(R==="json"){try{N=JSON.parse(M.toString("utf8"))}catch{throw new Error("JSON \u6587\u4EF6\u65E0\u6548")}if(N?.project&&(N=N.project),N?.format===Ct&&N?.assets){On(N.version);let Z=wr(N);j.push(...Z.get().migrationWarnings);let ge=Z.archiveData();return u.server=ge.assets.server,u.client=ge.assets.client,i=[...j],l=N.activeAssetType===B?B:se,f=String(N.meta?.name||Bt(S).replace(/\.json$/i,"")||f),x=ge.serverLogic,m=ge.assets.scripts,o=ge.controlGuidChanges,a=ge.scriptSync,p.clear(),V({snapshot:te(),warnings:j,metadata:{format:Ct}})}}else{if(R==="lua")return m.push(C({path:Bt(S||"imported.lua"),source:M.toString("utf8"),controlId:""})),V({snapshot:te(),warnings:j,metadata:{assetType:"lua-script"}});if(R==="gia"){if(Eo(M)){let ye=_o(M);return Le(ye.scripts),V({snapshot:te(),warnings:ye.warnings,metadata:ye.metadata})}let Z=To(M);N=Z.project,j=Z.warnings,W=Z.metadata,Z.clientProject&&(u.client=nt(Z.clientProject),o=o.filter(ye=>ye.controlAsset!==B),j.push("\u6574\u5408\u5305\u5DF2\u62C6\u56DE\u300CUI\u63A7\u4EF6-\u670D\u52A1\u7AEF\u300D\u4E0E\u300CUI\u63A7\u4EF6-\u5BA2\u6237\u7AEF\u300D\uFF1B\u5BA2\u6237\u7AEF\u6A21\u677F\u8FB9\u754C\u5DF2\u4FDD\u7559\u3002"));let ge=new Map,Wt=(ye,xi)=>{ye&&ee(ye.root,O=>{for(let oe of O.scriptMappingIds||[]){let Ye=ge.get(Number(oe));if(Ye){j.push(`\u811A\u672C GUID ${oe} \u540C\u65F6\u6302\u8F7D\u5230\u591A\u4E2A\u63A7\u4EF6\uFF0C\u5DF2\u4FDD\u7559\u201C${Ye.controlAsset===se?"\u670D\u52A1\u7AEF":"\u5BA2\u6237\u7AEF"}\u201D\u76EE\u6807\u3002`);continue}ge.set(Number(oe),{controlId:O.id,controlAsset:xi})}})};Wt(Z.project,Z.project.meta.assetType),Wt(Z.clientProject,B),Ve=(Z.scripts||[]).map(ye=>ge.has(Number(ye.guid))?{...ye,...ge.get(Number(ye.guid))}:ye)}else throw new Error(`unsupported import format: ${h}`)}let re=nt(N,{warnings:j}),qe=vr(N?.controlGuidChanges);if(qe.some(Z=>Z.controlAsset!==re.meta.assetType))throw new Error("\u5355\u8D44\u4EA7 JSON \u7684\u7D22\u5F15\u53D8\u66F4\u8BB0\u5F55\u5FC5\u987B\u5C5E\u4E8E\u5F53\u524D\u5BFC\u5165\u8D44\u4EA7");let pe=vr([...o.filter(Z=>Z.controlAsset!==re.meta.assetType),...qe]);i=[...j];let lt=xt(re.meta.assetType);u[lt]=re,o=pe,l=re.meta.assetType;let Oe=u[lt];return S&&(Oe.meta.name=Bt(S).replace(/\.(json|gia)$/i,"")||Oe.meta.name,Oe.meta.sourceFile=Bt(S),Oe.meta.sourceFormat=R),Le(Ve),Le(N?.scripts||[]),N?.script&&(N.script.path||N.script.source)&&Le([N.script]),V({snapshot:te(),warnings:j,metadata:W})}function ja(h,b){return Gn(H(),{op:"pick",x:h,y:b}),te()}function Ka(h){let b=typeof h=="string"&&h?h:"";!b||b===n||(n=b)}function La(h){let b=h.source||"";if(!b.trim()&&h.path.trim())try{b=ku($u(h.path,n),"utf8")}catch(S){throw new Error(`\u811A\u672C ${h.path} \u8BFB\u53D6\u5931\u8D25: ${S?.message||S}`)}return b}function Lt(h={}){let b=U(h.canvasId);b&&(z=b),h.playerCount!==void 0&&h.playerCount!==null&&h.playerCount!==""&&(F=vt(h.playerCount),X>F&&(X=1)),h.viewPlayerIndex!==void 0&&h.viewPlayerIndex!==null&&h.viewPlayerIndex!==""&&(X=je(h.viewPlayerIndex,F)),I&&hr(I);let S=m.map(M=>{try{return{id:M.id,guid:M.guid||0,path:M.path||M.id,source:La(M),controlId:M.controlId||"",controlAsset:M.controlAsset||""}}catch(N){return{id:M.id,guid:M.guid||0,path:M.path||M.id,source:`error([==[ ${String(N.message).replace(/]=+]/g,"] =]")} ])`,controlId:M.controlId||"",controlAsset:M.controlAsset||""}}}),R=M=>S.filter(N=>{let j={controlId:N.controlId,controlAsset:N.controlAsset},W=N.controlId?v(j):null;return!!(W&&W.key===M)});return I=Ta(u.server,{templatesProject:u.client,scripts:S,sceneScripts:R("server"),templateScripts:R("client"),serverConfig:{logic:x},canvasId:z,playerCount:F,viewPlayerIndex:X,language:h.language||""}),ce(h)}function qa(h,b={}){let S=U(h);if(!S)throw new Error("playSetCanvas requires canvasId");return Lt({...b,canvasId:S})}function ce(h={}){if(!I)return V({running:!1,tree:[],logs:[],serverLogs:[],serverVars:[]});let b=sr(I,h);return b.running=!0,b.logs=yr(b.logs),b.serverLogs=yr(b.server?.logs||[]),b.serverVars=Tu(b.server,b.playerCount||1),b}function Wa(h,b={}){return I||Lt(),on(I,h),b.observe===!1?V({running:!0,time:I.runtime.clock.time,frame:I.runtime.clock.frame,paused:!!I.debugPaused,levelTimePaused:!!I.runtime.clock.paused,playerCount:I.playerCount||1,viewPlayerIndex:I.viewPlayerIndex||1}):ce(b)}function Ja(h=0){Lt();let b=Math.max(0,Number(h)||0);for(let S=0;S<b;S++)on(I,1/30);return ce()}function Qa(){return I&&hr(I),I=null,z="",F=1,X=1,V({running:!1,tree:[],logs:[],serverLogs:[],serverVars:[]})}function Za(h,b={}){let S=qt();return X=or(S,h),b.observe===!1?null:ce(b)}function es(h,b={}){if(!I)throw new Error("play session has not started");return lr(I,h),b.observe===!1?null:ce(b)}function ts(h,b={}){if(!I)throw new Error("play session has not started");return ur(I,h),b.observe===!1?null:ce(b)}function is(h,b,S,R={}){if(!I)throw new Error("play session has not started");return yi(I,h,b,S,R),R.observe===!1?null:ce(R)}function ns(h={}){return I&&an(I).pause(),h.observe===!1?null:ce(h)}function rs(h={}){return I&&an(I).resume(),h.observe===!1?null:ce(h)}function qt(){if(!I)throw new Error("play session has not started");return I}function os(h,b){let S=qt();if(!h&&!b){let R=ce();return V({vars:R.serverVars||[]})}return V({entityType:String(h||""),name:String(b||""),value:Ga(S,h,b)})}function as(h,b,S){let R=qt();return fr(R,h,b,S),ce()}function ss(h,b=[],S="PlayerSelf"){let R=qt();return dr(R,h,b,S),ce()}function ls(){let h=ce();return V({events:h.history||[],case:ga(h.history||[],{playerCount:h.playerCount||1})})}function us(h={}){let b=ce(),S=pi({name:h.name||"",dt:h.dt,playerCount:h.playerCount||b.playerCount||1,events:h.events||b.history||[],asserts:h.asserts||[]});return V(S)}function cs(h,b={}){let S=pi(h);Lt({...b,playerCount:b.playerCount||S.playerCount||1});let R=qt();R.recording=!1;try{return Ya(an(R),h)}finally{R.recording=!0}}function fs(){if(!I)return{running:!1,paused:!1,time:0,frame:0,playerCount:1,viewPlayerIndex:1};let h=I.runtime.clock;return{running:!0,paused:!!I.debugPaused,levelTimePaused:!!h.paused,time:h.time,frame:h.frame,playerCount:I.playerCount||1,viewPlayerIndex:I.viewPlayerIndex||1}}let kr={get:te,patch:Fe,setWorkspace:Ka,exportData:Ht,importData:Kt,pick:ja,playStart:Lt,playSetCanvas:qa,playSetView:Za,playGet:ce,playStatus:fs,playStep:Wa,playRun:Ja,playStop:Qa,playKey:es,playClick:ts,playPointer:is,playPause:ns,playResume:rs,playServerGet:os,playServerSet:as,playServerSend:ss,playHistory:ls,playSaveCase:us,playRunCase:cs,archiveData:Ut};return Object.defineProperty(kr,"_project",{enumerable:!1,get:H}),kr}var L=null,xr=!1,Ke=0,Ge=0,Cr="realtime",Gu=33,vi=1/30,Du=5;function Si(e={}){return{...e.inspect?{inspect:!0}:{},...e.view?{view:!0}:{},...e.paint?{paint:!0}:{},...e.compact?{compact:!0}:{},...e.sceneRev!==void 0&&e.sceneRev!==null?{sceneRev:e.sceneRev}:{}}}function Vu(e={}){let t=Si(e);for(let i of["canvasId","playerCount","viewPlayerIndex","language"])e[i]!==void 0&&e[i]!==null&&e[i]!==""&&(t[i]=e[i]);return t}function at(e={}){return e.light?{...L.playStatus()}:L.playGet(Si(e))}function Yu(){if(!L||xr||Cr!=="realtime")return;let e=L.playStatus();if(!e.running||e.paused){Ke=0,Ge=0;return}let t=Date.now();if(!Ke){Ke=t;return}xr=!0;try{Ge+=Math.min(.25,Math.max(0,(t-Ke)/1e3)),Ke=t;let i=0;for(;Ge>=vi&&i<Du;)L.playStep(vi,{observe:!1}),Ge-=vi,i+=1;Ge>vi&&(Ge=vi)}finally{xr=!1}}var Zd=setInterval(Yu,Gu);function Bu(e,t={}){if(e==="start"){let i=t.clockMode??"realtime";if(i!=="manual"&&i!=="realtime")throw new Error("clockMode must be manual or realtime");return L&&L.playStop(),L=wr(t.archive||t.project,{workspacePath:t.workspacePath||""}),Cr=i,Ke=0,Ge=0,L.playStart(Vu(t))}if(!L)throw new Error("play session has not started");if(e==="get")return t.light?at(t):L.playGet(Si(t));if(e==="step"){let i=L.playStep(t.dt,t.light?{observe:!1}:Si(t));return t.light?at(t):i}if(e==="pointer")return L.playPointer(t.type,t.x,t.y,{observe:!1,deltaX:t.deltaX,deltaY:t.deltaY}),at(t);if(e==="key")return L.playKey(t.key,{observe:!1}),at(t);if(e==="click")return L.playClick(t.name,{observe:!1}),at(t);if(e==="pause")return L.playPause({observe:!1}),Ke=0,Ge=0,at(t);if(e==="resume")return L.playResume({observe:!1}),Ke=0,Ge=0,at(t);if(e==="device")return L.playSetCanvas(t.canvasId,Si(t));if(e==="view")return L.playSetView(t.playerIndex??t.viewPlayerIndex,{observe:!1}),at(t);if(e==="serverGet")return L.playServerGet(t.entityType,t.name);if(e==="serverSet")return L.playServerSet(t.entityType,t.name,t.value);if(e==="serverSend")return L.playServerSend(t.name,t.params||[],t.target||"PlayerSelf");if(e==="history")return L.playHistory();if(e==="saveCase")return L.playSaveCase(t.case||t);if(e==="runCase")return L.playRunCase(t.case||t,{canvasId:t.canvasId,playerCount:t.playerCount,viewPlayerIndex:t.viewPlayerIndex});if(e==="stop"){let i=L.playStop();return L=null,Ke=0,Ge=0,i}throw new Error(`unknown play action: ${e}`)}Ir.on("message",e=>{let{id:t,action:i,args:n={}}=e||{};try{let r=Bu(i,n),o=typeof r?.running=="boolean"?{...r,clockMode:Cr}:r;Ir.postMessage({id:t,ok:!0,value:o,error:null})}catch(r){Ir.postMessage({id:t,ok:!1,value:null,error:r?.message||String(r)})}});
|
|
109
|
+
`)}`);return i}function $n(e,t={}){K(e.root,ft);let i=[];je(e,{warnings:i});let n=ri(G(e)),a=e.meta?.assetType==="client-control-template",o;if(a){let s=t.includeScriptMappings?Xi(t.scripts||[],new Set(n.values())):null;o=Mo(e,n,i,void 0,s?.scripts||t.scripts||[]),s&&o.accessories.push(...s.units)}else{let s=Xi(t.scripts||[],new Set(n.values()));i.push(...s.warnings),o=No(e,n,s,i)}return{buffer:Fo(o,a?Vn:Bn),warnings:[...new Set(i)]}}function Oo(e,t,i={}){K(e.root,ft),t&&K(t.root,ft);let n=["\u6574\u5408\u5305\u628A\u670D\u52A1\u7AEF UIControlGroup \u4E0E\u5BA2\u6237\u7AEF UIControlTemplate \u5E76\u6392\u5199\u5165\u540C\u4E00 GIA \u7684 Root.graph\uFF1B\u5BFC\u5165\u65F6\u62C6\u56DE\u4E24\u7C7B\u8D44\u4EA7\uFF0C\u6A21\u677F\u8FB9\u754C\u3001\u811A\u672C\u6620\u5C04\u4E0E\u63A7\u4EF6\u6302\u8F7D\u5173\u7CFB\u4F1A\u4FDD\u7559\u3002"];t&&je(t,{warnings:n});let a=t?.root?.children||[];a.length||n.push("\u5BA2\u6237\u7AEF\u63A7\u4EF6\u6A21\u677F\u4E3A\u7A7A\uFF0C\u6574\u5408\u5305\u53EA\u5305\u542B\u670D\u52A1\u7AEF\u63A7\u4EF6\u4E0E\u811A\u672C\u3002");let o=new Set,r=G(e),s=t?G(t):null,c=ri(r,o),l=Xi(i.scripts||[],o);n.push(...l.warnings.filter(v=>v!==$o));let f=String(i.fileName||`${r.meta?.name||"\u6574\u5408\u5305"} \xB7 \u6574\u5408\u5305.gia`),u=Fn({...r,meta:{...r.meta,giaFileName:f}},!1),p=No(r,c,l,n,u),m={graph:[],accessories:[]};if(a.length&&s){let v=ri({...s,meta:{...s.meta,assetType:"client-control-template"}},o);m=Mo(s,v,n,u,l.scripts)}let g={graph:[...p.graph,...m.graph],accessories:[...p.accessories,...m.accessories],filePath:u,gameVersion:zn({meta:{gameVersion:e.meta?.gameVersion||t?.meta?.gameVersion}}),...On(e)};return{buffer:Fo(g,Bn),warnings:[...new Set(n)]}}var gt=69,zo=30,$o="\u811A\u672C\u6302\u8F7D\u5173\u7CFB\u4E0D\u8FDB\u5165 GIA\uFF1A\u5B98\u65B9 script.gia \u53EA\u542B\u6620\u5C04\uFF08ID/\u540D\u79F0/\u8DEF\u5F84/\u6E90\u7801\uFF09\uFF0C\u5BFC\u5165\u540E\u9700\u91CD\u65B0\u6302\u8F7D\u3002";function gl(e){return(String(e.path||"").replace(/\\/g,"/").split("/").pop()||"").replace(/\.lua$/iu,"")||`\u811A\u672C${e.id||""}`}function Dn(e){let t=Ne.verify(e);if(t)throw new Error(`GIA encode validation failed: ${t}`);let i=Ne.encode(Ne.create(e)).finish(),n=Buffer.alloc(nt+i.length+Mn);return n.writeUInt32BE(n.length-4,0),n.writeUInt32BE(1,4),n.writeUInt32BE(ko,8),n.writeUInt32BE(3,12),n.writeUInt32BE(i.length,16),Buffer.from(i).copy(n,nt),n.writeUInt32BE(Ao,nt+i.length),n}function Xi(e,t=new Set){let i=(e||[]).filter(r=>r.path||r.source).map(r=>({...r})),n=[];for(let r of i)vn(r.guid,r.path||r.id);for(let r of i){let s=Number(r.guid);ke(s)&&!t.has(s)?(t.add(s),r.guid=s):n.push(r)}for(let r of n){let s=Ze(t);t.add(s),r.guid=s}let a=[];return(e||[]).some(r=>r.controlId)&&a.push($o),{units:i.map(r=>{let s=gl(r),c=String(r.path||"").replace(/\\/g,"/"),l=/\.lua$/iu.test(c)?c:`${c||s}.lua`,f={id:r.guid,name:s,filePath:l};return String(r.source||"")&&(f.source=String(r.source)),{id:{class:zo,id:r.guid},name:s,which:gt,script:{mapping:f}}}),warnings:a,scripts:i}}function Do(e){let t=Xi(e);if(!t.units.length)throw new Error("\u6CA1\u6709\u53EF\u5BFC\u51FA\u7684 Lua \u811A\u672C\uFF0C\u8BF7\u5148\u5728\u201CLua \u811A\u672C\u201D\u9875\u521B\u5EFA");let i={graph:t.units,filePath:`114514-${Math.floor(Date.now()/1e3)}-1073741832-\\script.gia`,gameVersion:"7.0.51"},n=Dn(i),a=yl(n);if(!a.valid)throw new Error(`GIA compatibility validation failed:
|
|
110
|
+
${a.errors.join(`
|
|
111
|
+
`)}`);return{buffer:n,warnings:[...new Set(t.warnings)]}}function Gn(e){return Ne.toObject(Ne.decode(Ui(e)),{longs:Number,enums:Number,bytes:Buffer,defaults:!1,arrays:!0,objects:!0})}function Go(e){try{let i=Gn(e).graph||[];return i.length>0&&i.every(n=>Number(n.which)===gt)}catch{return!1}}function Vo(e){let t=[...e.graph||[],...e.accessories||[]].filter(a=>Number(a.which)===gt),i=[],n=t.map((a,o)=>{let r=a.script?.mapping||{},s=Number(a.id?.id)||0;s<=0&&i.push(`\u7B2C ${o+1} \u6761\u811A\u672C\u6620\u5C04\u7F3A\u5C11 GraphUnit.id.id\uFF0C\u5DF2\u6309 0 \u5904\u7406\uFF08\u5BFC\u51FA\u65F6\u4F1A\u91CD\u65B0\u5206\u914D\uFF09\u3002`);let c=Number(r.id)||0;return c&&c!==s&&i.push(`\u7B2C ${o+1} \u6761\u811A\u672C\u6620\u5C04 id(${c}) \u4E0E\u5355\u5143 id(${s}) \u4E0D\u4E00\u81F4\uFF0C\u4EE5\u5355\u5143 id \u4E3A\u51C6\u3002`),{guid:s,path:String(r.filePath||""),source:String(r.source||"")}});for(let[a,o]of n.entries())o.path&&!/\.lua$/iu.test(o.path)&&i.push(`\u7B2C ${a+1} \u6761\u811A\u672C\u6620\u5C04 file_path \u7F3A\u5C11 .lua \u540E\u7F00\uFF08${o.path}\uFF09\uFF0C\u771F\u673A\u53EF\u80FD\u62D2\u7EDD\u5BFC\u5165\uFF1B\u6A21\u62DF\u5668\u5185\u6309\u5F52\u4E00\u5316\u8DEF\u5F84\u7167\u5E38 require\u3002`);return{scripts:n,warnings:i}}function Bo(e){let t=Gn(e),i=Vo(t);if(!i.scripts.length)throw new Error("GIA \u5185\u6CA1\u6709\u811A\u672C\u6620\u5C04\u5355\u5143\uFF08which=69\uFF09");return{scripts:i.scripts,warnings:i.warnings,metadata:{assetType:"lua-script"}}}function yl(e){let t=[],i;try{i=Gn(e)}catch(a){return{valid:!1,errors:[a?.message||String(a)],scriptCount:0}}let n=i.graph||[];return n.length||t.push("Root.graph \u4E3A\u7A7A"),(i.accessories||[]).length&&t.push("script.gia \u4E0D\u5E94\u5305\u542B accessories"),n.forEach((a,o)=>{let r=`\u5355\u5143 ${o+1}`;Number(a.which)!==gt&&t.push(`${r}: which \u5E94\u4E3A 69\uFF0C\u5B9E\u9645 ${a.which}`),Number(a.id?.class)!==zo&&t.push(`${r}: id.class \u5E94\u4E3A 30\uFF0C\u5B9E\u9645 ${a.id?.class}`),Number(a.id?.type??0)!==0&&t.push(`${r}: id.type \u5E94\u7F3A\u7701`);let s=a.script?.mapping;if(!s){t.push(`${r}: \u7F3A\u5C11 field35 ScriptMappingWrapper`);return}ke(a.id?.id)||t.push(`${r}: GraphUnit.id.id \u975E\u6CD5\uFF08\u5141\u8BB8 0x40000000\u20130x403FFFFF\uFF09`),Number(s.id)!==Number(a.id?.id)&&t.push(`${r}: mapping.id \u5E94\u7B49\u4E8E GraphUnit.id.id`),String(s.name||"")!==String(a.name||"")&&t.push(`${r}: mapping.name \u5E94\u7B49\u4E8E GraphUnit.name`),String(s.filePath||"").trim()?/\.lua$/iu.test(String(s.filePath))||t.push(`${r}: file_path \u5E94\u4EE5 .lua \u7ED3\u5C3E\uFF08\u5B98\u65B9 script.gia \u6837\u672C\u5747\u4E3A \u540D\u79F0.lua\uFF0C\u771F\u673A require \u65F6\u624D\u53BB\u6269\u5C55\u540D\uFF09`):t.push(`${r}: file_path \u4E3A\u7A7A`)}),{valid:t.length===0,errors:t,scriptCount:n.length}}function Ui(e){let t=Buffer.isBuffer(e)?e:Buffer.from(e);if(t.length<nt+Mn)throw new Error("GIA \u6587\u4EF6\u8FC7\u77ED");if(t.readUInt32BE(4)!==1||t.readUInt32BE(8)!==ko||t.readUInt32BE(12)!==3)throw new Error("\u4E0D\u662F\u53D7\u652F\u6301\u7684 GIA v1 \u6587\u4EF6");let i=t.readUInt32BE(16);if(i!==t.length-nt-Mn)throw new Error("GIA payload \u957F\u5EA6\u4E0D\u4E00\u81F4");if(t.readUInt32BE(nt+i)!==Ao)throw new Error("GIA \u5C3E\u6807\u8BB0\u65E0\u6548");return t.subarray(nt,nt+i)}function me(e,t){return e.ui?.content?.data?.find(i=>i.details?.[t])?.details?.[t]||null}function vl(e){let t=e.ui?.content?.data?.find(o=>o.field501===66&&o.field502===89||Object.hasOwn(o.details||{},"templateRefSlot")),i=Buffer.from(t?.details?.templateRefSlot||[]),n=i.toString("utf8"),a=Buffer.from(n,"utf8").equals(i)&&!/[\u0000-\u001f\u007f-\u009f]/u.test(n);return{referencedPrefabId:a?n:"",raw:{templateRefSlot:a?n:"",...a?{}:{templateRefSlotBase64:i.toString("base64")},...t?.empty76?.length?{templateRefOuterBase64:Buffer.from(t.empty76).toString("base64")}:{}}}}function wl(e){let t=me(e,"transform")?.multiPlatform,i={};for(let a of t?.platforms||[]){let o=sl[a.platformType||0],r=a.transform||{};i[o]={scale:r.scale?{x:r.scale.x??0,y:r.scale.y??0,z:r.scale.z??0}:{x:1,y:1,z:1},rotation:{x:r.field508?.x??0,y:r.field508?.y??0,z:r.field508?.z??0},anchorMin:{x:r.anchorMin?.x??0,y:r.anchorMin?.y??0},anchorMax:{x:r.anchorMax?.x??0,y:r.anchorMax?.y??0},offset:{x:r.offset?.x??0,y:r.offset?.y??0},size:{x:r.size?.x??0,y:r.size?.y??0},pivot:r.pivot?{x:r.pivot.x??0,y:r.pivot.y??0}:{x:.5,y:.5}}}let n=i.KEYBOARD||i[Object.keys(i)[0]];if(!n)throw new Error(`GIA \u63A7\u4EF6 ${e.name||e.id?.id} \u7F3A\u5C11\u591A\u5E73\u53F0\u53D8\u6362`);for(let a of ce)i[a]||(i[a]=structuredClone(n));return i}function Hi(e){let t=e.ui?.content?.data||[];return t.some(i=>i.details?.textConfig)?t.some(i=>i.field501===71)?"textwindow":"textbox":t.some(i=>i.details?.cursorConfig)?"cursor":t.some(i=>Object.hasOwn(i.details||{},"templateRefSlot")||i.field501===66&&i.field502===89)?"reference":t.some(i=>i.details?.gridView)?"grid":t.some(i=>i.details?.buttonPreset)?"button":t.some(i=>i.details?.keyHint)?"keyhint":t.some(i=>i.details?.image||i.details?.imageSlot)?"image":t.some(i=>Object.hasOwn(i.details||{},"effectSlot"))?"animation":t.some(i=>Object.hasOwn(i.details||{},"fullscreenEffectSlot"))?"fullscreen":(t.some(i=>Object.hasOwn(i.details||{},"containerNodeSlot")),"container")}function Co(e,{reverseSiblings:t=!1,idOffset:i=0}={}){if(!e.length)return{nodes:new Map,rootCandidates:[],warnings:[]};let n=new Map(e.map((l,f)=>[l.id?.id,`n${i+f+1}`])),a=new Map,o=new Map,r=[];for(let l of e){let f=Hi(l),u=me(l,"textConfig"),p=me(l,"imageSlot"),m=me(l,"image"),g=me(l,"buttonPreset"),b=me(l,"gridView"),v=me(l,"genericSlot"),S=me(l,"footerSlot"),x=me(l,"cursorConfig"),F=me(l,"keyHint"),N=me(l,"containerNodeSlot"),V=f==="reference"?vl(l):null,Y=me(l,"effectSlot"),j=me(l,"fullscreenEffectSlot"),O=J(f,{id:n.get(l.id?.id),guid:l.id?.id||0,giaInfoIndex:(l.ui?.content?.info||[]).find(w=>w.field501===2&&w.field502===6)?.index?.value,giaRelatedGuids:(l.ui?.content?.info||[]).find(w=>w.field501===4&&w.field502===4)?.related?.value||[],name:l.name||f,visible:me(l,"field14")?.field17?.initiallyHidden!==!0,active:me(l,"field14")?.initiallyInactive!==!0,canControllerFocus:S?.field505===1,scriptMappingIds:(v?.field502||[]).map(w=>Number(w?.field1?.id)).filter(w=>Number.isSafeInteger(w)&&w>0),transformByPlatform:wl(l),syncAllDevices:me(l,"transform")?.multiPlatform?.field504===1,giaRaw:{genericField501:v?.field501??0,footerField505:S?.field505??0,...f==="textbox"||f==="textwindow"?{textField501:u?.field501??20,textField503:u?.field503??12,textAlign:u?.align??0,...[void 0,0,1,2].includes(u?.verticalAlign)?{}:{textVerticalAlign:u.verticalAlign},...f==="textwindow"?{textField511:u?.field511??1,textViewField502:u?.viewFlags?.field502??1,textViewField503:u?.viewFlags?.field503??1}:{}}:{},...f==="cursor"?{cursorField501:x?.field501??0}:{},...V?.raw||{},...f==="grid"?{gridField501:b?.field501??1,gridField507:b?.field507??1,gridField508:b?.field508??1,gridField509:b?.field509??1,gridField511:b?.field511??5,gridField512:b?.field512??1}:{},...f==="keyhint"?{keyHintField501:F?.field501??1,keyHintField502:F?.field502??1}:{},...f==="image"?{imageSlotType:p?.imageType??0,imageField502:m?.field502??1,imageField504:m?.field504??1,imageField505:m?.field505??1,imageField507:m?.field507??2,imageFillType:m?.fillType??1}:{},...f==="animation"?{effectSlot:Y??""}:{},...f==="fullscreen"?{fullscreenEffectSlot:j??""}:{}},...f==="container"?{isolateNavigation:N?.isolateNavigation===!0,disableKeyEventPassthrough:N?.disableKeyEventPassthrough===!0,disableCursorEventPassthrough:N?.disableCursorEventPassthrough===!0,showCursor:N?.showCursor===!0}:{},...f==="cursor"?{raycastTarget:x?.field501===1}:{},...f==="textbox"||f==="textwindow"?{text:u?.text?.value??"",fontSize:u?.fontSize??20,minimumFontSize:u?.minimumFontSize??20,adaptiveFontSize:u?.adaptive===1,fontColor:u?.color??4294967295,bgColor:u?.color2??0,enableOutline:u?.outlineOff!==1,outlineColor:u?.color3??858993459,horizontalAlignment:u?.align===1?"Middle":u?.align===2?"Right":"Left",verticalAlignment:{0:"Top",1:"Middle",2:"Bottom"}[u?.verticalAlign??0]||"Top",...f==="textwindow"?{interactable:!0,showScrollBar:!0}:{}}:{},...f==="image"?{imageSource:"StaticReference",imageId:p?.assetId??0,imageType:p?.imageType===1?"Stretch":"Basic",imageColor:Number.isFinite(p?.field502)?p.field502>>>0:4294967295,enableMask:m?.enableMask===1,enableSoftEdge:m?.enableSoftEdge===1,enableFill:m?.enableFill===1,softEdgeMode:m?.softEdgePixel===1?"Pixel":"Percentage",softEdgeWidthX:m?.border?.field501??8,softEdgeWidthY:m?.border?.field502??8,horizontalSoftRange:m?.field512??85,verticalSoftRange:m?.field513??85,fillType:{1:"Horizontal",2:"Vertical",3:"Radial90",4:"Radial180",5:"Radial360"}[m?.fillType]||"Horizontal",fillAmount:Number.isFinite(m?.field508)?Math.max(0,Math.min(1,m.field508/100)):m?.enableFill===1?0:1,reverseMaskArea:m?.reverseMask===1}:{},...f==="button"?{interactable:g?.interactable===1,raycastTarget:g?.raycastTarget===1,clickAudioId:g?.clickAudioId??50888}:{},...f==="grid"?{cellSizeX:b?.cellSize?.field501??50,cellSizeY:b?.cellSize?.field502??50,spacingX:b?.gap?.field501??8,spacingY:b?.gap?.field502??8,padding1X:b?.padding1?.field501??20,padding1Y:b?.padding1?.field502??20,padding2X:b?.padding2?.field501??20,padding2Y:b?.padding2?.field502??20,previewCount:b?.field511??5}:{},...V?{referencedPrefabId:V.referencedPrefabId}:{},...f==="keyhint"?{keyboardKeyCode:F?.field502??null,controllerKeyCode:F?.field501??null}:{},...f==="animation"?{animationId:Y??""}:{},...f==="fullscreen"?{animationId:j??""}:{}});a.set(l.id?.id,O),(V?.raw.templateRefSlotBase64||V?.raw.templateRefOuterBase64)&&r.push(`${O.name}: \u6A21\u677F\u5F15\u7528\u914D\u7F6E\u542B\u5C1A\u672A\u89E3\u6790\u7684\u4E8C\u8FDB\u5236\u5B57\u6BB5\uFF0C\u5DF2\u539F\u6837\u4FDD\u5B58\uFF1B\u5F15\u7528\u76EE\u6807\u672A\u63A8\u65AD\uFF0C\u9884\u89C8\u4E0D\u4F1A\u81EA\u52A8\u5C55\u5F00\u3002`),(f==="textbox"||f==="textwindow")&&![void 0,0,1,2].includes(u?.align)&&r.push(`${O.name}: \u6C34\u5E73\u5BF9\u9F50\u679A\u4E3E ${u.align} \u7684\u542B\u4E49\u672A\u77E5\uFF0C\u5DF2\u539F\u6837\u4FDD\u7559\u3002`),(f==="textbox"||f==="textwindow")&&![void 0,0,1,2].includes(u?.verticalAlign)&&r.push(`${O.name}: \u5782\u76F4\u5BF9\u9F50\u679A\u4E3E ${u.verticalAlign} \u7684\u542B\u4E49\u672A\u77E5\uFF0C\u5DF2\u539F\u6837\u4FDD\u7559\u3002`),f==="image"&&![void 0,0,1,2,3,4,5].includes(m?.fillType)&&r.push(`${O.name}: \u586B\u5145\u5F62\u72B6\u679A\u4E3E ${m.fillType} \u672A\u8BC6\u522B\uFF0C\u5DF2\u4FDD\u7559\u539F\u503C\u3002`),f==="button"&&o.set(O.id,{unavailableChildId:g?.disabledChild,hoverChildId:g?.hoverChild,pressedChildId:g?.pressedChild,selectedChildId:g?.selectedChild})}let s=[],c=new Set;for(let l of e){let f=a.get(l.id?.id),u=(l.ui?.content?.children||[]).map(p=>a.get(p)).filter(Boolean);if(u.length){f.children=t?u.slice().reverse():u;for(let p of u)c.add(p.id)}}for(let l of e){let f=a.get(l.id?.id),u=l.ui?.content?.parent||0,p=a.get(u);p?c.has(f.id)||(t?p.children.unshift(f):p.children.push(f)):s.push(f)}for(let[l,f]of o){let u=[...a.values()].find(p=>p.id===l);for(let[p,m]of Object.entries(f))u[p]=n.get(m)||null}return{nodes:a,rootCandidates:s,warnings:r}}function Yo(e){let t=Ui(e),i=Ne.toObject(Ne.decode(t),{longs:Number,enums:Number,bytes:Buffer,defaults:!1,arrays:!0,objects:!0}),n=[...i.graph||[],...i.accessories||[]],a=S=>!!S.ui?.content&&[15,21,70].includes(Number(S.which)),o=(i.graph||[]).filter(a);if(!o.some(S=>S.ui?.content))throw new Error("GIA \u4E0D\u542B\u53EF\u8BC6\u522B\u7684 UIControlGroup \u4E3B\u56FE");let r=o.find(S=>S.which===21)||null,s=o.filter(S=>Number(S.which)===70),c=(i.accessories||[]).filter(a),l=new Set((r?.relatedIds||[]).map(S=>S.id||0)),f=r?l.size?c.filter(S=>l.has(S.id?.id||0)):c:[],u=s.length?[...s,...c.filter(S=>!l.has(S.id?.id||0))]:r?[]:[...o,...c];if(!f.length&&!u.length)throw new Error("GIA \u4E0D\u542B\u5BA2\u6237\u7AEF\u63A7\u4EF6");let p=["GIA \u5BFC\u5165\u4E3A\u5DF2\u9A8C\u8BC1 UI \u5B57\u6BB5\u7684\u8BED\u4E49\u5BFC\u5165\uFF1B\u672A\u77E5 protobuf \u5B57\u6BB5\u4E0D\u4F1A\u8FDB\u5165 Authoring JSON\u3002"],m=n.filter(S=>!a(S)&&Number(S.which)!==gt);m.length&&p.push(`\u8DF3\u8FC7 ${m.length} \u4E2A\u975E UI / \u975E\u811A\u672C\u4F9D\u8D56\u5355\u5143\uFF1B\u8FD9\u4E9B\u8D44\u6E90\u4E0D\u4F1A\u8FDB\u5165\u5B58\u6863\u6216\u91CD\u65B0\u5BFC\u51FA\u3002`);let g=Vo(i);p.push(...g.warnings);let b=null,v=null;if(f.length){let S=Co(f,{reverseSiblings:!0,idOffset:0});p.push(...S.warnings);let x=S.rootCandidates.find(N=>N.kind==="container")||S.rootCandidates[0];if(!x)throw new Error("GIA \u672A\u627E\u5230\u5BA2\u6237\u7AEF\u6839\u63A7\u4EF6");let F=J("server-container",{id:"sc1",guid:r?.id?.id||0,name:r?.name||"\u5BA2\u6237\u7AEF\u63A7\u4EF6\u5BB9\u5668",giaRelatedGuids:(r?.ui?.content?.info||[]).find(N=>N.field501===4&&N.field502===4)?.related?.value||[]});F.children=[x],S.rootCandidates.length>1&&p.push(`\u68C0\u6D4B\u5230 ${S.rootCandidates.length} \u4E2A\u65E0\u7236\u8282\u70B9\u63A7\u4EF6\uFF0C\u4EC5\u5BFC\u5165\u4EE5\u201C${x.name}\u201D\u4E3A\u6839\u7684\u6811\u3002`),b={version:1,layoutSchemaVersion:ge,meta:{name:r?.name||"\u5BFC\u5165\u7684\u754C\u9762\u63A7\u4EF6\u7EC4",assetType:"server-control-template",sourceFormat:"gia",sourceFile:"",gameVersion:i.gameVersion||"",giaFilePath:i.filePath||"",...Number.isSafeInteger(Number(i.modeFlag))?{giaModeFlag:Number(i.modeFlag)}:{}},canvasId:"pc-16-9",selectedId:x.id,script:{controlId:x.id,path:"",source:""},root:F}}if(u.length){let S=Co(u,{reverseSiblings:!1,idOffset:1e3});if(p.push(...S.warnings),!S.rootCandidates.length)throw new Error("GIA \u672A\u627E\u5230\u5BA2\u6237\u7AEF\u6A21\u677F");let x=J("server-container",{id:"sc1",guid:0,name:"\u5BA2\u6237\u7AEF\u63A7\u4EF6\u6A21\u677F"});x.children=S.rootCandidates,v={version:1,layoutSchemaVersion:ge,meta:{name:S.rootCandidates.length===1?S.rootCandidates[0].name:"\u5BA2\u6237\u7AEF\u63A7\u4EF6\u6A21\u677F\u5217\u8868",assetType:"client-control-template",sourceFormat:"gia",sourceFile:"",gameVersion:i.gameVersion||"",giaFilePath:i.filePath||"",...Number.isSafeInteger(Number(i.modeFlag))?{giaModeFlag:Number(i.modeFlag)}:{}},canvasId:"pc-16-9",selectedId:S.rootCandidates[0].id,script:{controlId:S.rootCandidates[0].id,path:"",source:""},root:x},je(v,{warnings:p});for(let F of S.rootCandidates)K(F,N=>N.children.reverse());b||(b=v)}return{project:b,clientProject:v&&b!==v?v:void 0,scripts:g.scripts,warnings:p,metadata:{gameVersion:i.gameVersion||"",filePath:i.filePath||"",...Number.isSafeInteger(Number(i.modeFlag))?{modeFlag:Number(i.modeFlag)}:{},combined:!!(r&&s.length)}}}function Vn(e){let t=Ui(e),i=Ne.toObject(Ne.decode(t),{longs:Number,enums:Number,defaults:!1,arrays:!0,objects:!0}),n=i.graph||[],a=i.accessories||[],o=[],r=(m,g)=>m!=null&&Object.prototype.hasOwnProperty.call(m,g),s=new Map,c=[];/^\d+-\d+-\d+-\\.+\.gia$/iu.test(i.filePath||"")||o.push(`Root.filePath \u4E0D\u662F UID-TIME-ID-\\\u6587\u4EF6\u540D.gia\uFF1A${i.filePath||"<missing>"}`);let l=n.filter(m=>m.which===70).map(m=>{let g=Hi(m),b=m.ui?.content?.info||[],v=b.find(F=>F.field501===2&&F.field502===6)?.index?.value,S=b.find(F=>F.field501===4&&F.field502===4),x=S?.related?.value||[];return Ae(v)||o.push(`${m.name}: Info.index=${v??"<missing>"}\uFF0C\u5FC5\u987B\u662F\u6B63\u6574\u6570`),S||o.push(`${m.name}: \u9876\u5C42 UIControlTemplate \u7F3A\u5C11 Info.related \u8BB0\u5F55`),{id:m.id?.id||0,name:m.name||"",kind:g,actualIndex:v,relatedPresent:!!S,relatedGuids:x}}),f=new Map;for(let m of l){if(!Ae(m.actualIndex))continue;let g=f.get(m.actualIndex);g?o.push(`${m.name}: \u72EC\u7ACB\u6A21\u677F\u8D44\u4EA7\u7F16\u53F7 ${m.actualIndex} \u4E0E ${g.name} \u91CD\u590D`):f.set(m.actualIndex,m)}l.length||o.push("Root.graph \u4E0D\u542B UIControlTemplate(70)");let u=0,p=0;for(let m of[...n,...a]){if(!m.ui?.content)continue;let g=m.id?.id||0,b=m.ui.content,v=Hi(m),S=n.includes(m)&&m.which===70,x=`${m.name||"<unnamed>"}(${g||"<missing-guid>"})`;ke(g)?s.has(g)?o.push(`${x}: GUID \u4E0E ${s.get(g).name||"<unnamed>"} \u91CD\u590D`):s.set(g,m):o.push(`${x}: GraphUnit GUID \u975E\u6CD5\uFF08\u5141\u8BB8 0x40000000\u20130x403FFFFF\uFF09`),(m.id?.class!==1||m.id?.type!==8)&&o.push(`${x}: GraphUnit.id \u5FC5\u987B\u4E3A class=1,type=8`),b.guid!==g&&o.push(`${x}: content.guid=${b.guid??"<missing>"} \u4E0E GraphUnit.id.id \u4E0D\u4E00\u81F4`),S&&m.which!==70&&o.push(`${x}: \u6A21\u677F\u6839 which \u5FC5\u987B\u4E3A UIControlTemplate(70)`),!S&&m.which!==15&&o.push(`${x}: \u9644\u4EF6\u63A7\u4EF6 which \u5FC5\u987B\u4E3A UIControl(15)`);let F=b.info||[],N=F.find(_=>_.field501===1&&_.field502===5),V=F.find(_=>_.field501===2&&_.field502===6);N?.guid?.value!==g&&o.push(`${x}: Info.self GUID \u7F3A\u5931\u6216\u4E0E\u81EA\u8EAB\u4E0D\u4E00\u81F4`),Ae(V?.index?.value)||o.push(`${x}: Info.index=${V?.index?.value??"<missing>"}\uFF0C\u5FC5\u987B\u662F\u6B63\u6574\u6570`);let Y=F.find(_=>_.field501===4&&_.field502===4);S&&!Y&&o.push(`${x}: \u9876\u5C42\u6A21\u677F\u7F3A\u5C11 Info.related \u8BB0\u5F55`),!S&&Y&&o.push(`${x}: \u9644\u4EF6\u63A7\u4EF6\u4E0D\u5E94\u5199 Info.related`);let j=To[v],O=b.data||[],w=O.map(_=>`${_.field501}/${_.field502}`),A=j?.map(([_])=>_)||[];j?JSON.stringify(w)!==JSON.stringify(A)&&o.push(`${x}: Data \u69FD\u4F4D\u987A\u5E8F ${w.join(",")}\uFF0C\u5E94\u4E3A ${A.join(",")}`):o.push(`${x}: \u672A\u77E5\u5BA2\u6237\u7AEF\u63A7\u4EF6\u7C7B\u578B ${v}`);for(let _=0;_<Math.min(O.length,j?.length||0);_+=1){let X=O[_],[U,de,L]=j[_];if(r(X,de)||o.push(`${x}: Data ${U} \u7F3A\u5C11 ${de} \u5206\u652F`),!L)continue;r(X.details,L)||o.push(`${x}: Details ${U} \u7F3A\u5C11 ${L} \u5206\u652F`);let we=Po[U];(X.details?.field501!==we||X.details?.field502!==X.field502||X.details?.field503!==1)&&o.push(`${x}: Details ${U} \u6807\u8BB0\u5E94\u4E3A ${we}/${X.field502}/1`);let Pe=X.details?.nodeRef;(Pe?.class!==1||Pe?.type!==8||Pe?.id!==g)&&o.push(`${x}: Details ${U} node_ref \u672A\u6307\u5411\u81EA\u8EAB`)}let I=(m.ui.content.data||[]).find(_=>_.field501===4&&_.field502===86);I&&(r(I.field14,"field17")?u+=1:o.push(`${x}: \u7C7B\u578B Data \u7F3A\u5C11\u663E\u5F0F Field14.field17 \u7A7A\u4E32`),r(I.details?.field14,"field17")?u+=1:o.push(`${x}: \u7C7B\u578B Details \u7F3A\u5C11\u663E\u5F0F Field14.field17 \u7A7A\u4E32`));let C=(m.ui.content.data||[]).find(_=>_.details?.transform)?.details?.transform?.multiPlatform?.platforms||[];C.length!==4&&o.push(`${x}: \u591A\u5E73\u53F0\u53D8\u6362\u6570\u91CF=${C.length}\uFF0C\u5E94\u4E3A 4`);let $=C.map(_=>_.platformType||0);JSON.stringify($)!==JSON.stringify([0,1,2,3])&&o.push(`${x}: \u5E73\u53F0\u987A\u5E8F ${$.join(",")}\uFF0C\u5E94\u4E3A 0,1,2,3`);let k=(m.ui.content.data||[]).find(_=>_.details?.transform)?.details?.transform;k?.multiPlatform?.field502!==ai[v]&&o.push(`${x}: \u53D8\u6362 preset=${k?.multiPlatform?.field502??"<missing>"}\uFF0C${v} \u5E94\u4E3A ${ai[v]}`);for(let _ of C)r(_.transform,"field508")?p+=1:o.push(`${x}: RectTransform \u7F3A\u5C11\u663E\u5F0F field508 \u7A7A\u4E32`);c.push({id:g,name:m.name||"",kind:v,template:S,parent:b.parent||0,children:[...b.children||[]],relatedIds:(m.relatedIds||[]).map(_=>_.id||0),dataSignatures:w})}for(let m of c){let g=`${m.name||"<unnamed>"}(${m.id})`;if(JSON.stringify(m.relatedIds)!==JSON.stringify(m.children)&&o.push(`${g}: GraphUnit.relatedIds \u4E0E content.children \u4E0D\u4E00\u81F4`),m.template&&m.parent&&o.push(`${g}: \u9876\u5C42\u6A21\u677F\u4E0D\u5E94\u6709 parent`),!m.template){let b=s.get(m.parent);b?(b.ui?.content?.children||[]).includes(m.id)||o.push(`${g}: \u7236\u63A7\u4EF6 children \u672A\u53CD\u5411\u5305\u542B\u81EA\u8EAB`):o.push(`${g}: parent=${m.parent||"<missing>"} \u4E0D\u5B58\u5728`)}for(let b of m.children){let v=s.get(b);v?(v.ui?.content?.parent||0)!==m.id&&o.push(`${g}: child=${b} \u7684 parent \u672A\u6307\u56DE\u81EA\u8EAB`):o.push(`${g}: child=${b} \u4E0D\u5B58\u5728`)}}return{valid:o.length===0,errors:o,filePath:i.filePath||"",gameVersion:i.gameVersion||"",templateCount:l.length,accessoryCount:a.length,templates:l,units:c,explicitEmpty:{field17:u,rectField508:p}}}function Bn(e){let t=Ui(e),i=Ne.toObject(Ne.decode(t),{longs:Number,enums:Number,defaults:!1,arrays:!0,objects:!0}),n=(i.graph||[]).filter(k=>k.ui?.content&&Number(k.which)===21),a=(i.graph||[]).filter(k=>Number(k.which)===70),o=(i.graph||[]).filter(k=>Number(k.which)===gt),r=(i.accessories||[]).filter(k=>k.ui?.content),s=[],c=(k,_)=>k!=null&&Object.prototype.hasOwnProperty.call(k,_);/^\d+-\d+-\d+-\\.+\.gia$/iu.test(i.filePath||"")||s.push(`Root.filePath \u4E0D\u662F UID-TIME-ID-\\\u6587\u4EF6\u540D.gia\uFF1A${i.filePath||"<missing>"}`),n.length!==1&&s.push(`\u670D\u52A1\u7AEF\u63A7\u4EF6\u6A21\u677F UIControlGroup \u6570\u91CF=${n.length}\uFF0C\u5E94\u4E3A 1`);let l=(i.graph||[]).filter(k=>{let _=Number(k.which);return _===gt||_===70||_===21?!1:!k.ui?.content});l.length&&s.push(`Root.graph \u542B ${l.length} \u4E2A\u65E0\u6CD5\u8BC6\u522B\u7684\u975E\u63A7\u4EF6/\u975E\u811A\u672C\u5355\u5143`);let f=n[0];if(!f)return{valid:!1,errors:s,filePath:i.filePath||"",gameVersion:i.gameVersion||"",accessoryCount:r.length,controls:[],scriptCount:o.length,explicitEmpty:{field17:0,rectField508:0}};let u=[f,...a,...r],p=new Map;for(let k of u){let _=k.id?.id||0,X=`${k.name||"<unnamed>"}(${_||"<missing-guid>"})`;ke(_)?p.has(_)?s.push(`${X}: GUID \u91CD\u590D`):p.set(_,k):s.push(`${X}: GraphUnit GUID \u975E\u6CD5\uFF08\u5141\u8BB8 0x40000000\u20130x403FFFFF\uFF09`),(k.id?.class!==1||k.id?.type!==8)&&s.push(`${X}: GraphUnit.id \u5FC5\u987B\u4E3A class=1,type=8`),k.ui?.content?.guid!==_&&s.push(`${X}: content.guid \u4E0E GraphUnit.id.id \u4E0D\u4E00\u81F4`)}let m=f.id?.id||0,g=f.ui.content,b=`${f.name||"<unnamed>"}(${m})`;f.which!==21&&s.push(`${b}: which \u5FC5\u987B\u4E3A UIControlGroup(21)`);let v=g.info||[];v.find(k=>k.field501===1&&k.field502===5)?.guid?.value!==m&&s.push(`${b}: Info.self GUID \u7F3A\u5931\u6216\u4E0D\u4E00\u81F4`),v.find(k=>k.field501===2&&k.field502===6)?.index?.value!==1&&s.push(`${b}: Info.index \u5FC5\u987B\u4E3A 1`);let S=v.find(k=>k.field501===4&&k.field502===4);S||s.push(`${b}: \u7F3A\u5C11\u663E\u5F0F Info.related \u8BB0\u5F55`);let x=0,F=0,N=(k,_,X,U=!1)=>{let de=k.id?.id||0,L=`${k.name||"<unnamed>"}(${de})`,we=k.ui.content.data||[],Pe=we.map(ae=>`${ae.field501}/${ae.field502}`),_t=X.map(([ae])=>ae);JSON.stringify(Pe)!==JSON.stringify(_t)&&s.push(`${L}: Data \u69FD\u4F4D\u987A\u5E8F ${Pe.join(",")}\uFF0C\u5E94\u4E3A ${_t.join(",")}`);for(let ae=0;ae<Math.min(we.length,X.length);ae+=1){let ze=we[ae],[$e,ki,Tt]=X[ae];if(c(ze,ki)||s.push(`${L}: Data ${$e} \u7F3A\u5C11 ${ki} \u5206\u652F`),!Tt)continue;c(ze.details,Tt)||s.push(`${L}: Details ${$e} \u7F3A\u5C11 ${Tt} \u5206\u652F`);let Ai=Po[$e];(ze.details?.field501!==Ai||ze.details?.field502!==ze.field502||ze.details?.field503!==1)&&s.push(`${L}: Details ${$e} \u6807\u8BB0\u5E94\u4E3A ${Ai}/${ze.field502}/1`);let Pt=ze.details?.nodeRef;(Pt?.class!==1||Pt?.type!==8||Pt?.id!==de)&&s.push(`${L}: Details ${$e} node_ref \u672A\u6307\u5411\u81EA\u8EAB`)}let Lt=we.find(ae=>ae.field501===4&&ae.field502===(U?23:86)),ne=U?"empty15":"field17";c(Lt?.field14,ne)?U||(x+=1):s.push(`${L}: \u7C7B\u578B Data \u7F3A\u5C11\u663E\u5F0F Field14.${ne} \u7A7A\u4E32`),c(Lt?.details?.field14,ne)?U||(x+=1):s.push(`${L}: \u7C7B\u578B Details \u7F3A\u5C11\u663E\u5F0F Field14.${ne} \u7A7A\u4E32`);let Oe=we.find(ae=>ae.details?.transform)?.details?.transform,lt=Oe?.multiPlatform?.platforms||[];lt.length!==4&&s.push(`${L}: \u591A\u5E73\u53F0\u53D8\u6362\u6570\u91CF=${lt.length}\uFF0C\u5E94\u4E3A 4`);let Ei=lt.map(ae=>ae.platformType||0);JSON.stringify(Ei)!==JSON.stringify([0,1,2,3])&&s.push(`${L}: \u5E73\u53F0\u987A\u5E8F ${Ei.join(",")}\uFF0C\u5E94\u4E3A 0,1,2,3`);let Ci=U?ai["server-container"]:ai[_];Oe?.multiPlatform?.field502!==Ci&&s.push(`${L}: \u53D8\u6362 preset=${Oe?.multiPlatform?.field502??"<missing>"}\uFF0C\u5E94\u4E3A ${Ci}`);for(let ae of lt)c(ae.transform,"field508")?F+=1:s.push(`${L}: RectTransform \u7F3A\u5C11\u663E\u5F0F field508 \u7A7A\u4E32`);return Pe};N(f,"server-container",ll,!0);let V=(f.relatedIds||[]).map(k=>k.id||0),Y=new Set(V),j=r.filter(k=>Y.has(k.id?.id||0)),O=j.map(k=>k.id?.id||0);JSON.stringify(V)!==JSON.stringify(O)&&s.push(`${b}: \u4E3B\u56FE relatedIds \u5FC5\u987B\u6309\u987A\u5E8F\u8986\u76D6\u672C\u7EC4 accessories`);let w=g.data?.find(k=>k.details?.rootChildRef)?.details?.rootChildRef?.guid||0,A=p.get(w);(!A||!j.includes(A))&&s.push(`${b}: 62/82 \u6839\u8282\u70B9\u5F15\u7528\u4E0D\u5B58\u5728`),O[0]!==w&&s.push(`${b}: \u6839\u5BB9\u5668\u8282\u70B9\u5FC5\u987B\u662F\u672C\u7EC4 accessories[0]`);let I=[];for(let k of j){let _=k.id?.id||0,X=k.ui.content,U=`${k.name||"<unnamed>"}(${_})`,de=Hi(k);k.which!==15&&s.push(`${U}: which \u5FC5\u987B\u4E3A UIControl(15)`);let L=X.info||[];(L.length!==1||L[0]?.field501!==1||L[0]?.field502!==5||L[0]?.guid?.value!==_)&&s.push(`${U}: \u670D\u52A1\u7AEF\u5BB9\u5668\u5185\u63A7\u4EF6 Info \u5FC5\u987B\u53EA\u542B\u81EA\u8EAB GUID`);let we=To[de];we||s.push(`${U}: \u672A\u77E5\u5BA2\u6237\u7AEF\u63A7\u4EF6\u7C7B\u578B ${de}`);let Pe=we?N(k,de,we):[];I.push({id:_,name:k.name||"",kind:de,parent:X.parent||0,children:[...X.children||[]],relatedIds:(k.relatedIds||[]).map(_t=>_t.id||0),dataSignatures:Pe})}let C=I.find(k=>k.id===w);C&&(C.kind!=="container"&&s.push(`${C.name}(${w}): \u6839\u63A7\u4EF6\u5FC5\u987B\u4E3A\u5BB9\u5668\u8282\u70B9`),C.parent&&s.push(`${C.name}(${w}): \u6839\u63A7\u4EF6\u4E0D\u5E94\u6709 parent`));let $=new Map(I.map(k=>[k.id,k]));for(let k of I){let _=`${k.name}(${k.id})`;if(JSON.stringify(k.relatedIds)!==JSON.stringify(k.children)&&s.push(`${_}: relatedIds \u5FC5\u987B\u4E0E\u76F4\u63A5 children \u4E00\u81F4`),k.id!==w){let X=$.get(k.parent);X?X.children.includes(k.id)||s.push(`${_}: \u7236\u63A7\u4EF6 children \u672A\u53CD\u5411\u5305\u542B\u81EA\u8EAB`):s.push(`${_}: parent=${k.parent||"<missing>"} \u4E0D\u5B58\u5728`)}for(let X of k.children){let U=$.get(X);U?U.parent!==k.id&&s.push(`${_}: child=${X} \u7684 parent \u672A\u6307\u56DE\u81EA\u8EAB`):s.push(`${_}: child=${X} \u4E0D\u5B58\u5728`)}}if(a.length){let k=Vn(Dn({...i,graph:a,accessories:r.filter(_=>!Y.has(_.id?.id||0))}));s.push(...k.errors.map(_=>`\u5BA2\u6237\u7AEF\u6A21\u677F: ${_}`))}return{valid:s.length===0,errors:s,filePath:i.filePath||"",gameVersion:i.gameVersion||"",graph:{id:m,name:f.name||"",relatedGuids:S?.related?.value||[],rootGuid:w},accessoryCount:r.length,controls:I,scriptCount:o.length,explicitEmpty:{field17:x,rectField508:F}}}function Xo(e,t=[]){if(!e||e.layoutSchemaVersion===ge)return e;if(e.layoutSchemaVersion!==void 0&&e.layoutSchemaVersion!==1)throw new Error(`\u4EC5\u652F\u6301 layoutSchemaVersion=2 \u6216\u53EF\u8FC1\u79FB\u7684\u65E7\u5E03\u5C40\uFF0C\u6536\u5230 ${e.layoutSchemaVersion}`);if(!e.root)return{...e,layoutSchemaVersion:ge};let i=structuredClone(e),n=0;return K(i.root,a=>{let o=a.transformByPlatform||{},r=a.transformByCanvas||{},s=a.name||a.id;for(let l of Object.keys(o))if(!ce.includes(l))throw new Error(`${s}: unknown platform ${l}`);let c={};for(let l of ce){let f=Rt[l],u=ie[f].platform,p=Object.keys(ie).filter(v=>ie[v].platform===u&&r[v]),m=r[f]?f:p[0],g=l==="CONTROLLER_CONSOLE"?c.KEYBOARD:l==="CONTROLLER_MOBILE"?c.TOUCHSCREEN:null,b=o[l]??g??(m?r[m]:null);if(c[l]=b?Ve(b):In(a.kind),b||t.push(`${s}: ${l} \u65E0\u65E7\u5E03\u5C40\uFF0C\u5DF2\u4F7F\u7528\u63A7\u4EF6\u9ED8\u8BA4\u503C`),!o[l]&&!g&&m&&m!==f&&t.push(`${s}: \u7F3A\u5C11 ${f}\uFF0C\u5DF2\u91C7\u7528 ${m} \u7684\u951A\u70B9\u548C\u5C3A\u5BF8\u53C2\u6570`),!g)for(let v of p)JSON.stringify(c[l])!==JSON.stringify(Ve(r[v]))&&t.push(`${s}: ${v} \u4E0E ${l} \u5E03\u5C40\u51B2\u7A81\uFF0C\u4FDD\u7559${o[l]?"\u5DF2\u6709\u5E73\u53F0":m}\u53C2\u6570`)}Qe(c,`${s}.transformByPlatform`),a.transformByPlatform=c,delete a.transformByCanvas,n++}),i.layoutSchemaVersion=ge,t.unshift(`\u5DF2\u81EA\u52A8\u8FC1\u79FB\u65E7\u5E03\u5C40\uFF1A${n} \u4E2A\u63A7\u4EF6\u8F6C\u6362\u4E3A\u56DB\u5E73\u53F0\u53C2\u6570\uFF1B\u518D\u6B21\u4FDD\u5B58\u5C06\u4F7F\u7528\u65B0\u7248\u683C\u5F0F`),i}function Yn(e){if(![1,2,3,4].includes(e))throw new Error(`\u4EC5\u652F\u6301 version=1\u20134 \u7684\u5B58\u6863\uFF0C\u6536\u5230 ${e}`)}function Hn(e,t,i,n=e.canvasId){let a=et(e.root,t);return!a||a.kind==="server-container"?ye(n):i[a.id]||ye(n)}function at(e,{warnings:t=[]}={}){if(!e)return ht();if(e=Xo(e,t),(e.root||e.layoutSchemaVersion!==void 0)&&e.layoutSchemaVersion!==ge)throw new Error(`\u4EC5\u652F\u6301 layoutSchemaVersion=${ge} \u7684\u56DB\u5E73\u53F0\u5E03\u5C40\uFF0C\u4E0D\u652F\u6301\u65E7\u753B\u5E03\u5E03\u5C40\u6216\u5176\u4ED6\u7248\u672C`);let i=e.meta?.assetType==="client-control-template"?"client-control-template":"server-control-template",n=i==="client-control-template"?Dt():ht(),a={layoutSchemaVersion:ge,version:Number.isSafeInteger(e.version)&&e.version>0?e.version:1,meta:{name:String(e.meta?.name||n.meta.name),assetType:i,sourceFormat:String(e.meta?.sourceFormat||n.meta.sourceFormat),sourceFile:String(e.meta?.sourceFile||""),...e.meta?.gameVersion?{gameVersion:String(e.meta.gameVersion)}:{},...e.meta?.giaFilePath?{giaFilePath:String(e.meta.giaFilePath)}:{},...Number.isSafeInteger(Number(e.meta?.giaOwnerUid))?{giaOwnerUid:Number(e.meta.giaOwnerUid)}:{},...Number.isSafeInteger(Number(e.meta?.giaTimestamp))?{giaTimestamp:Number(e.meta.giaTimestamp)}:{},...Number.isSafeInteger(Number(e.meta?.giaFileId))?{giaFileId:Number(e.meta.giaFileId)}:{},...e.meta?.giaFileName?{giaFileName:String(e.meta.giaFileName)}:{},...Number.isSafeInteger(e.meta?.giaNextAssetIndex)&&e.meta.giaNextAssetIndex>=2?{giaNextAssetIndex:e.meta.giaNextAssetIndex}:{},...Number.isSafeInteger(e.meta?.giaAssetIndexSchemaVersion)&&e.meta.giaAssetIndexSchemaVersion>0?{giaAssetIndexSchemaVersion:e.meta.giaAssetIndexSchemaVersion}:{},...Number.isSafeInteger(Number(e.meta?.giaModeFlag))&&Number(e.meta.giaModeFlag)>=0?{giaModeFlag:Number(e.meta.giaModeFlag)}:{}},canvasId:e.canvasId&&ie[e.canvasId]?e.canvasId:Pi,selectedId:e.selectedId||n.selectedId,root:kn(e.root||n.root)};return Ko(a),je(a,{warnings:t}),a}function Ko(e){let t=new Set;K(e.root,i=>{if(typeof i.id!="string"||!i.id)throw new Error("node id must be a non-empty string");if(t.has(i.id))throw new Error(`duplicate node id: ${i.id}`);t.add(i.id)}),t.has(e.selectedId)||(e.selectedId=Cn(e.root).id)}function Ho(e){return Ze($t(e))}function Sl(e,t){let i=!1;return K(e,n=>{n.id===t&&(i=!0)}),i}function xl(e,t,i,n){let o=it(e.root,e.canvasId).boxes[t.id],r=i.children.findIndex(u=>u.id===t.id);if(r<0)throw new Error("reparent: source node is not attached");if(i.children.splice(r,1),n.children.push(t),!o)return;let s=it(e.root,e.canvasId),c=n.kind==="server-container"?ye(e.canvasId):s.boxes[n.id]||ye(e.canvasId),l=tt(t.transformByPlatform,e.canvasId),f=ct(c,l,{posX:o.centerX,posY:o.centerY,width:o.width,height:o.height});Vt(e,t,f)}function Il(e,t){return e.meta.assetType!=="client-control-template"?Rn(e.root,t):(e.root.children||[]).flatMap(i=>Rn(i,t))}function qo(e,t){let i=xo(e.root,t);if(e.meta.assetType!=="client-control-template")return i;let n=ti(e),a=new Set;return n&&n.kind!=="server-container"&&K(n,o=>a.add(o.id)),i.filter(o=>a.has(o.id))}function Un(e){let{canvas:t,boxes:i}=it(e.root,e.canvasId),n=ri(e,new Set,{preserveLegacy:!0}),a=he(e.root,e.selectedId),o=a?i[a.id]:null;return G({layoutSchemaVersion:ge,version:e.version,meta:{...e.meta},canvasId:e.canvasId,canvas:{id:e.canvasId,width:t.width,height:t.height,platform:ie[e.canvasId].platform,label:ie[e.canvasId].label,presets:Object.values(ie).map(r=>({id:r.id,label:r.label,width:r.width,height:r.height,platform:r.platform}))},selectedId:e.selectedId,asset:{type:e.meta.assetType,label:e.meta.assetType==="client-control-template"?"\u5BA2\u6237\u7AEF\u63A7\u4EF6\u6A21\u677F":"\u670D\u52A1\u7AEF\u63A7\u4EF6\u6A21\u677F",templateCount:e.meta.assetType==="client-control-template"?e.root.children.length:1,currentTemplateId:e.meta.assetType==="client-control-template"&&ti(e)?.id||""},tree:Il(e,n),boxes:qo(e,i),inspector:Io(a,e.canvasId,o||t,n),root:e.root})}function Vt(e,t,i){let n=it(e.root,e.canvasId),a=Hn(e,t.id,n.boxes),o={};if(t.syncAllDevices!==!1)for(let r of ce){if(r===dt(e.canvasId))continue;let s=Rt[r],c=it(e.root,s,r);o[r]=Hn(e,t.id,c.boxes,s)}t.transformByPlatform=oo({transformByPlatform:t.transformByPlatform,source:i,canvasId:e.canvasId,syncAllDevices:t.syncAllDevices!==!1,sourceParentBox:a,targetParentBoxByPlatform:o})}var El=new Set(["name","active","visible","canControllerFocus","isolateNavigation","disableKeyEventPassthrough","disableCursorEventPassthrough","showCursor","fontSize","adaptiveFontSize","minimumFontSize","fontColor","bgColor","enableOutline","outlineColor","horizontalAlignment","verticalAlignment","text","imageSource","imageType","imageId","imageColor","enableMask","enableSoftEdge","softEdgeMode","softEdgeWidthX","softEdgeWidthY","horizontalSoftRange","verticalSoftRange","enableFill","fillType","fillHorizontalType","fillVerticalType","fillRadial90Type","fillRadialType","fillAmount","reverseMaskArea","raycastTarget","interactable","clickAudioId","unavailableChildId","hoverChildId","pressedChildId","selectedChildId","showScrollBar","cellSizeX","cellSizeY","spacingX","spacingY","padding1X","padding1Y","padding2X","padding2Y","previewCount","scrollDirection","layoutConstraint","referencedPrefabId","animationId","playSoundEffect","layer","keyboardKeyCode","controllerKeyCode","itemPrefabId","layoutConstraintFixedCount"]),Cl=new Set(["posX","posY","width","height"]),kl=new Set(["anchorMinX","anchorMinY","anchorMaxX","anchorMaxY","pivotX","pivotY"]);function Al(e){if(typeof e=="number"&&Number.isFinite(e))return e>>>0;if(typeof e=="string"){let t=e.trim();if(t.startsWith("#")){let n=t.slice(1);if(n.length===6)return(4278190080|parseInt(n,16))>>>0;if(n.length===8)return parseInt(n,16)>>>0}let i=Number(t);if(Number.isFinite(i))return i>>>0}throw new Error("color must be an ARGB integer or #RRGGBB/#AARRGGBB string")}function Le(e,t){let i=Number(e);if(!Number.isFinite(i))throw new Error(`${t} must be a finite number`);return i}function Uo(e){if(e===!0||e===1||e==="1"||e==="true")return!0;if(e===!1||e===0||e==="0"||e==="false")return!1;throw new Error("boolean field requires true or false")}var _l=new Set(["fontSize","minimumFontSize","imageId","clickAudioId","softEdgeWidthX","softEdgeWidthY","horizontalSoftRange","verticalSoftRange","fillAmount","cellSizeX","cellSizeY","spacingX","spacingY","padding1X","padding1Y","padding2X","padding2Y","previewCount","keyboardKeyCode","controllerKeyCode","itemPrefabId","layoutConstraintFixedCount"]),Tl=new Set(["active","visible","canControllerFocus","isolateNavigation","disableKeyEventPassthrough","disableCursorEventPassthrough","showCursor","adaptiveFontSize","enableOutline","enableMask","enableSoftEdge","enableFill","reverseMaskArea","raycastTarget","interactable","showScrollBar","playSoundEffect"]),Pl=new Set(["name","imageSource","horizontalAlignment","verticalAlignment","text","softEdgeMode","fillType","fillHorizontalType","fillVerticalType","fillRadial90Type","fillRadialType","scrollDirection","layoutConstraint","referencedPrefabId","animationId"]),jo=new Set(["unavailableChildId","hoverChildId","pressedChildId","selectedChildId"]),Lo={layer:["AboveAllControls","BelowAllControls"],imageSource:["StaticReference","Prefab"],imageType:["Basic","Stretch",null],scrollDirection:["Horizontal","Vertical"],layoutConstraint:["AutoWrap","Fixed"],softEdgeMode:["Percentage","Pixel"],fillType:["Horizontal","Vertical","Radial90","Radial180","Radial360"],fillHorizontalType:["Left","Right"],fillVerticalType:["Bottom","Top"],fillRadial90Type:["BottomLeft","TopLeft","TopRight","BottomRight"],fillRadialType:["Bottom","Left","Top","Right"]};function Rl(e,t){if(!t||typeof t!="object")throw new Error("patch requires op");let i=t.op;if(i==="select")return t.id&&he(e.root,t.id)&&(e.selectedId=t.id),e;if(i==="pick"){let{boxes:n}=it(e.root,e.canvasId),a=qo(e,n),o=Eo(a,Number(t.x),Number(t.y));return o&&(e.selectedId=o),e}if(i==="setCanvas")return t.canvasId&&ie[t.canvasId]&&(e.canvasId=t.canvasId),e;if(i==="setScript")throw new Error("\u811A\u672C\u7531\u5B58\u6863\u7EDF\u4E00\u7BA1\u7406\uFF0C\u8BF7\u4F7F\u7528 addScript / updateScript / removeScript \u64CD\u4F5C");if(i==="newAsset"){let n=t.assetType==="client-control-template"?Dt():ht();return e.version=n.version,e.meta=n.meta,e.canvasId=n.canvasId,e.selectedId=n.selectedId,e.root=n.root,e}if(i==="addTemplate"){if(e.meta.assetType!=="client-control-template")throw new Error("\u53EA\u6709\u5BA2\u6237\u7AEF\u63A7\u4EF6\u6A21\u677F\u5DE5\u7A0B\u53EF\u4EE5\u65B0\u589E\u6A21\u677F");let n=J(t.kind,{id:En(e.root),guid:Ho(e.root),name:t.name||`\u65B0${t.kind==="container"?"\u5BB9\u5668\u8282\u70B9":t.kind}\u6A21\u677F`});return e.root.children.push(n),e.selectedId=n.id,e}if(i==="add"){let n=he(e.root,t.parentId||e.selectedId);if(!n)throw new Error("add: parent not found");let a=io(n,t.kind,{id:En(e.root),guid:Ho(e.root),name:t.name});return e.selectedId=a.id,e}if(i==="reparent"){if(e.meta.assetType!=="client-control-template")throw new Error("\u5C42\u7EA7\u8C03\u6574\u4EC5\u9002\u7528\u4E8E\u5BA2\u6237\u7AEF\u63A7\u4EF6\u6A21\u677F\u5DE5\u7A0B");let n=he(e.root,t.id||e.selectedId),a=n?et(e.root,n.id):null,o=he(e.root,t.parentId);if(!n||n.kind==="server-container"||!a)throw new Error("reparent: node not found");if(!o)throw new Error("reparent: parent not found");if(o.id===n.id||Sl(n,o.id))throw new Error("\u63A7\u4EF6\u4E0D\u80FD\u79FB\u52A8\u5230\u81EA\u8EAB\u6216\u5176\u540E\u4EE3\u4E0B\u9762");if(o.kind==="server-container"&&a.kind==="server-container")return e;if(a.kind==="server-container"&&o.kind!=="server-container"&&e.root.children.length<=1)throw new Error("\u5BA2\u6237\u7AEF\u63A7\u4EF6\u6A21\u677F\u5217\u8868\u81F3\u5C11\u4FDD\u7559\u4E00\u4E2A\u9876\u5C42\u6A21\u677F");return xl(e,n,a,o),e.selectedId=n.id,e}if(i==="moveSibling"){let n=he(e.root,t.id||e.selectedId),a=n?et(e.root,n.id):null;if(!n||!a)throw new Error("moveSibling: node not found");let o=a.children.findIndex(c=>c.id===n.id),r=t.direction==="up"?-1:t.direction==="down"?1:0,s=o+r;return!r||s<0||s>=a.children.length||(a.children.splice(o,1),a.children.splice(s,0,n),e.selectedId=n.id),e}if(i==="remove"){let n=t.id||e.selectedId,a=et(e.root,n);if(a?.kind==="server-container"){if(e.meta.assetType!=="client-control-template")throw new Error("\u670D\u52A1\u7AEF\u63A7\u4EF6\u6A21\u677F\u7684\u5BA2\u6237\u7AEF\u6839\u8282\u70B9\u4E0D\u80FD\u5220\u9664");if((e.root.children||[]).length<=1)throw new Error("\u5BA2\u6237\u7AEF\u63A7\u4EF6\u6A21\u677F\u5217\u8868\u81F3\u5C11\u4FDD\u7559\u4E00\u4E2A\u6A21\u677F")}return no(e.root,n)&&(K(e.root,o=>{if(o.kind==="button")for(let r of jo)o[r]&&!he(e.root,o[r])&&(o[r]=null)}),e.selectedId=a?a.id:e.root.id),e}if(i==="set"){let n=he(e.root,t.id||e.selectedId);if(!n)throw new Error("set: node not found");let a=t.key;a==="reverseMask"&&(a="reverseMaskArea");let o=t.value;if(n.kind==="reference"&&["referencedPrefabId","giaRaw.templateRefSlot"].includes(a)&&(n.giaRaw.templateRefSlotBase64||n.giaRaw.templateRefOuterBase64))throw new Error("\u8BE5\u6A21\u677F\u5F15\u7528\u542B\u5C1A\u672A\u89E3\u6790\u7684\u539F\u59CB\u914D\u7F6E\uFF0C\u6682\u4E0D\u80FD\u6539\u5199\u76EE\u6807\u7D22\u5F15\uFF1B\u8BF7\u5728\u5B98\u65B9\u7F16\u8F91\u5668\u4FEE\u6539\u540E\u91CD\u65B0\u5BFC\u5165");if(a.startsWith("giaRaw.")){let l=a.slice(7);if(!l||l.includes("."))throw new Error("invalid raw GIA field path");let f=Za(n.kind,l);if(!f)throw new Error(`unknown raw GIA field for ${n.kind}: ${l}`);if(n.giaRaw||={},n.giaRaw[l]=yn(f,o),l==="footerField505"&&[0,1].includes(n.giaRaw[l])&&(n.canControllerFocus=n.giaRaw[l]===1),n.kind==="cursor"&&l==="cursorField501"&&[0,1].includes(n.giaRaw[l])&&(n.raycastTarget=n.giaRaw[l]===1),(n.kind==="textbox"||n.kind==="textwindow")&&l==="textAlign"){let u={0:"Left",1:"Middle",2:"Right"}[n.giaRaw[l]];u&&(n.horizontalAlignment=u)}if(n.kind==="image"&&l==="imageFillType"){let u={1:"Horizontal",2:"Vertical",3:"Radial90",4:"Radial180",5:"Radial360"}[n.giaRaw[l]];u&&(n.fillType=u)}return n.kind==="keyhint"&&l==="keyHintField502"&&(n.keyboardKeyCode=n.giaRaw[l]),n.kind==="keyhint"&&l==="keyHintField501"&&(n.controllerKeyCode=n.giaRaw[l]),e}if(a==="syncAllDevices"){if(n.syncAllDevices=Uo(o),n.syncAllDevices){let l=tt(n.transformByPlatform,e.canvasId);Vt(e,n,l)}return e}if(El.has(a)){if(a==="layer"&&n.kind!=="animation")throw new Error("layer is only available on UI animations");if(a==="playSoundEffect"&&!["animation","fullscreen"].includes(n.kind))throw new Error("playSoundEffect requires an animation control");if(a.endsWith("Color")&&(o=Al(o)),_l.has(a)){if(o=Le(o,a),o<0)throw new Error(`${a} must not be negative`);if((a==="imageId"||a==="clickAudioId"||a==="keyboardKeyCode"||a==="controllerKeyCode")&&(o=Math.trunc(o)),a==="fillAmount"&&o>1)throw new Error("fillAmount must be between 0 and 1")}if(Tl.has(a)&&(o=Uo(o)),Pl.has(a)&&(o=String(o??"")),a==="horizontalAlignment"&&!["Left","Middle","Right"].includes(o))throw new Error("invalid horizontalAlignment");if(a==="verticalAlignment"&&!["Top","Middle","Bottom"].includes(o))throw new Error("invalid verticalAlignment");if(Lo[a]&&!Lo[a].includes(o))throw new Error(`invalid ${a}`);if(jo.has(a))if(o===""||o===void 0||o===null)o=null;else{o=String(o);let l=he(e.root,o);if(!l||l===n||l.kind==="server-container"||!(n.children||[]).some(f=>f.id===o))throw new Error(`${a} must reference a direct child of this button`)}if(n.kind==="image"&&(a==="imageSource"||a==="imageId")&&n[a]!==o&&(n.imageType=null,n.giaRaw.imageSlotType=0),n[a]=o,n.kind==="image"&&a==="imageType"&&(n.giaRaw.imageSlotType=o==="Stretch"?1:0),a==="canControllerFocus"&&(n.giaRaw.footerField505=o?1:0),n.kind==="cursor"&&a==="raycastTarget"&&(n.giaRaw.cursorField501=o?1:0),(n.kind==="textbox"||n.kind==="textwindow")&&a==="horizontalAlignment"&&(n.giaRaw.textAlign={Left:0,Middle:1,Right:2}[o]),(n.kind==="textbox"||n.kind==="textwindow")&&a==="verticalAlignment"&&delete n.giaRaw.textVerticalAlign,n.kind==="image"&&a==="fillType"){let l={Horizontal:1,Vertical:2,Radial90:3,Radial180:4,Radial360:5}[o];l&&(n.giaRaw.imageFillType=l)}return n.kind==="reference"&&a==="referencedPrefabId"&&(n.giaRaw.templateRefSlot=o),n.kind==="grid"&&a==="previewCount"&&(n.giaRaw.gridField511=Math.trunc(o)),n.kind==="keyhint"&&a==="keyboardKeyCode"&&(n.giaRaw.keyHintField502=Math.trunc(o)),n.kind==="keyhint"&&a==="controllerKeyCode"&&(n.giaRaw.keyHintField501=Math.trunc(o)),(n.kind==="animation"||n.kind==="fullscreen")&&a==="animationId"&&(n.giaRaw[n.kind==="animation"?"effectSlot":"fullscreenEffectSlot"]=o),e}let{boxes:r}=it(e.root,e.canvasId),s=Hn(e,n.id,r),c=tt(n.transformByPlatform,e.canvasId);if(a==="anchorType"){let l=Xn(r[n.id]),f=Ka(c,o);return f=ct(s,f,l),Vt(e,n,f),e}if(["rotationX","rotationY","rotationZ"].includes(a)){let l={...c,rotation:{...c.rotation,[a.slice(-1).toLowerCase()]:Le(o,a)}};return Vt(e,n,l),e}if(kl.has(a)){let l=Xn(r[n.id]),f={...c,anchorMin:{...c.anchorMin},anchorMax:{...c.anchorMax},pivot:{...c.pivot}};return a==="anchorMinX"&&(f.anchorMin.x=Le(o,a)),a==="anchorMinY"&&(f.anchorMin.y=Le(o,a)),a==="anchorMaxX"&&(f.anchorMax.x=Le(o,a)),a==="anchorMaxY"&&(f.anchorMax.y=Le(o,a)),a==="pivotX"&&(f.pivot.x=Le(o,a)),a==="pivotY"&&(f.pivot.y=Le(o,a)),Vt(e,n,ct(s,f,l)),e}if(Cl.has(a)){let l=Xn(r[n.id]),f=Le(o,a);if((a==="width"||a==="height")&&f<0)throw new Error(`${a} must not be negative`);return l[a]=f,Vt(e,n,ct(s,c,l)),e}throw new Error(`set: unknown key ${a}`)}if(i==="replace"){let n=at(t.project);return e.version=n.version,e.meta=n.meta,e.canvasId=n.canvasId,e.selectedId=n.selectedId,e.root=n.root,e}throw new Error(`unknown op ${i}`)}function jn(e,t){if(!t||typeof t!="object")throw new Error("patch requires op");if(t.expectedRevision!==void 0&&Number(t.expectedRevision)!==e.version)throw new Error(`revision conflict: expected ${t.expectedRevision}, current ${e.version}`);let i=e.version,n=JSON.parse(JSON.stringify(e));return Rl(n,t),Ko(n),je(n),n.version=i+1,Object.keys(e).forEach(a=>{delete e[a]}),Object.assign(e,n),e}function Xn(e){return e?{posX:e.centerX,posY:e.centerY,width:e.width,height:e.height}:{posX:0,posY:0,width:0,height:0}}import Ml from"fengari";var{lua:d,lauxlib:Q,lualib:Wo,to_luastring:ji,to_jsstring:Nl}=Ml,Fl=d.LUA_TNIL,Ol=d.LUA_TBOOLEAN,zl=d.LUA_TNUMBER,$l=d.LUA_TSTRING,Jo=d.LUA_TTABLE,Dl=d.LUA_TFUNCTION,Ln=d.LUA_TUSERDATA,Fe=d.LUA_OK,Qo=new WeakMap,Kn=Symbol("luaTableEntries"),qn={__scriptHostKey:!0};function R(e){return ji(String(e))}function yt(e,t){Qo.set(e,t)}function Ce(e){return Qo.get(e)}var si=class{constructor(t){this.value=t}};function re(e,t,i){if(i instanceof si){d.lua_pushnumber(e,i.value);return}if(i==null){d.lua_pushnil(e);return}let n=typeof i;if(n==="boolean"){d.lua_pushboolean(e,i);return}if(n==="number"){Number.isInteger(i)&&Math.abs(i)<=2147483647?d.lua_pushinteger(e,i):d.lua_pushnumber(e,i);return}if(n==="string"){d.lua_pushstring(e,R(i));return}if(n==="function"){Bl(e,t,i);return}if(i&&i[Kn]){let a=i[Kn];d.lua_createtable(e,Array.isArray(i)?i.length:0,a.length);for(let[o,r]of a)re(e,t,o),re(e,t,r),d.lua_settable(e,-3);return}if(Array.isArray(i)){d.lua_createtable(e,i.length,0);for(let a=0;a<i.length;a++)re(e,t,i[a]),d.lua_rawseti(e,-2,a+1);return}if(i&&i.__kind==="EnumItem"){t.pushEnumItem(e,i);return}if(i&&i.__kind==="CursorEventData"){t.pushCursor(e,i);return}if(i&&i.__kind==="Script"){t.pushScript(e,i);return}if(i&&i.typeofName){t.pushControl(e,i);return}if(i&&i.__kind==="ServerSignal"){t.pushSignal(e,i);return}if(i&&(i.SetEase||i.Append)){t.pushTween(e,i);return}if(n==="object"){d.lua_createtable(e,0,Object.keys(i).length);for(let[a,o]of Object.entries(i))re(e,t,o),d.lua_setfield(e,-2,R(a));return}d.lua_pushnil(e)}function ee(e,t){if(d.lua_isnil(e,t)||d.lua_type(e,t)===d.LUA_TNONE)return"";if(!d.lua_isstring(e,t)&&d.lua_type(e,t)!==d.LUA_TNUMBER)return`lua_type=${d.lua_type(e,t)}`;let i=d.lua_tostring(e,t);return i==null?"":Nl(i)}function Ke(e,t){t=d.lua_absindex(e,t);let i=d.lua_type(e,t);if(i===Ln)return Ce(d.lua_touserdata(e,t));if(i===Jo){d.lua_pushlightuserdata(e,qn),d.lua_rawget(e,t);let n=d.lua_type(e,-1)===Ln?d.lua_touserdata(e,-1):null;return d.lua_pop(e,1),n?Ce(n):null}return null}function pe(e,t,i){i=d.lua_absindex(e,i);let n=d.lua_type(e,i);if(n===Fl)return null;if(n===Ol)return!!d.lua_toboolean(e,i);if(n===zl)return d.lua_isinteger(e,i)?d.lua_tointeger(e,i):d.lua_tonumber(e,i);if(n===$l)return ee(e,i);if(n===Ln){let a=d.lua_touserdata(e,i);return Ce(a)??a}if(n===Dl)return Gl(e,t,i);if(n===Jo){let a=Ke(e,i);if(a)return a;let o=[];for(d.lua_pushnil(e);d.lua_next(e,i)!==0;){let l=pe(e,t,-2),f=pe(e,t,-1);o.push([l,f]),d.lua_pop(e,1)}let r=new Map(o.filter(([l])=>Number.isInteger(l)&&l>=1)),s=0;for(;r.has(s+1);)s+=1;let c=s>0?[]:{};for(let[l,f]of o)Array.isArray(c)&&Number.isInteger(l)&&l>=1?c[l-1]=f:(typeof l=="string"||typeof l=="number")&&(c[l]=f);return Object.defineProperty(c,Kn,{value:o}),c}return null}function Gl(e,t,i){t.luaFunctions||(t.luaFunctions=new Map);let n=typeof d.lua_topointer=="function"?d.lua_topointer(e,i):null;if(n!=null&&t.luaFunctions.has(n))return t.luaFunctions.get(n);d.lua_pushvalue(e,i);let a=Q.luaL_ref(e,d.LUA_REGISTRYINDEX),o=Vl(e,t,a);return n!=null&&t.luaFunctions.set(n,o),o}function Vl(e,t,i){let n=(...a)=>{if(n.__luaRef==null)throw new Error("attempt to call a released Lua callback");let o=d.lua_gettop(e);d.lua_rawgeti(e,d.LUA_REGISTRYINDEX,n.__luaRef);for(let l of a)re(e,t,l);if(d.lua_pcall(e,a.length,d.LUA_MULTRET,0)!==Fe){let l=ee(e,-1);throw d.lua_settop(e,o),new Error(l)}let s=d.lua_gettop(e)-o,c=[];for(let l=1;l<=s;l++)c.push(pe(e,t,o+l));if(d.lua_settop(e,o),c.length!==0)return c.length===1?c[0]:c};return n.__luaRef=i,n.__luaState=e,n}function Zo(e){e?.__luaRef!=null&&(e.__luaHolds=(e.__luaHolds||0)+1)}function er(e,t){if(!t||t.__luaRef==null||!t.__luaState)return;if(t.__luaHolds>1){t.__luaHolds-=1;return}let i=t.__luaState;if((!e?.luaStates||e.luaStates.has(i))&&Q.luaL_unref(i,d.LUA_REGISTRYINDEX,t.__luaRef),t.__luaRef=null,t.__luaState=null,e?.luaFunctions)for(let[n,a]of e.luaFunctions)a===t&&e.luaFunctions.delete(n)}function Bl(e,t,i){d.lua_pushlightuserdata(e,i),d.lua_pushlightuserdata(e,t),d.lua_pushcclosure(e,function(a){let o=d.lua_touserdata(a,d.lua_upvalueindex(1)),r=d.lua_touserdata(a,d.lua_upvalueindex(2)),s=d.lua_gettop(a),c=[];for(let l=1;l<=s;l++)c.push(pe(a,r,l));try{let l=o(...c);if(Array.isArray(l)&&l.__multi){for(let f of l)re(a,r,f);return l.length}return l===void 0?0:(re(a,r,l),1)}catch(l){return d.lua_pushstring(a,R(String(l&&l.message?l.message:l))),d.lua_error(a)}},2)}function tr(e){!e||typeof d.lua_close!="function"||d.lua_close(e)}function ir(e){if(Q.luaL_loadstring(e,R(["local nativeGetMetatable = getmetatable","getmetatable = function(value)",' if type(value) == "string" then return nil end'," return nativeGetMetatable(value)","end"].join(`
|
|
112
|
+
`)))===Fe&&d.lua_pcall(e,0,0,0),d.lua_settop(e,0),d.lua_pushnil(e),d.lua_setglobal(e,R("_VERSION")),d.lua_getglobal(e,R("string")),!d.lua_isnil(e,-1))for(let i of["dump","pack","unpack"])d.lua_pushnil(e),d.lua_setfield(e,-2,R(i));if(d.lua_pop(e,1),d.lua_pushnil(e),d.lua_setglobal(e,R("io")),d.lua_getglobal(e,R("os")),!d.lua_isnil(e,-1))for(let i of Object.keys({execute:1,getenv:1,remove:1,rename:1,tmpname:1,setlocale:1,exit:1}))d.lua_pushnil(e),d.lua_setfield(e,-2,R(i));d.lua_pop(e,1),d.lua_getglobal(e,R("debug")),d.lua_isnil(e,-1)?d.lua_pop(e,1):(d.lua_getfield(e,-1,R("traceback")),d.lua_newtable(e),d.lua_pushvalue(e,-2),d.lua_setfield(e,-2,R("traceback")),d.lua_setglobal(e,R("debug")),d.lua_pop(e,2)),d.lua_getglobal(e,R("math")),d.lua_isnil(e,-1)||(d.lua_pushcfunction(e,i=>{let n=d.lua_tonumber(i,1);return d.lua_pushboolean(i,Number.isNaN(n)),1}),d.lua_setfield(e,-2,R("isnan")),d.lua_pushcfunction(e,i=>{let n=d.lua_tonumber(i,1);return d.lua_pushboolean(i,n===1/0||n===-1/0),1}),d.lua_setfield(e,-2,R("isinf"))),d.lua_pop(e,1),d.lua_pushnil(e),d.lua_setglobal(e,R("package")),d.lua_pushnil(e),d.lua_setglobal(e,R("load")),d.lua_pushnil(e),d.lua_setglobal(e,R("loadfile")),d.lua_pushnil(e),d.lua_setglobal(e,R("dofile")),d.lua_pushnil(e),d.lua_setglobal(e,R("collectgarbage")),d.lua_pushnil(e),d.lua_setglobal(e,R("coroutine")),d.lua_pushnil(e),d.lua_setglobal(e,R("fengari"))}var _e=(e,t=0)=>Number.isFinite(Number(e))?Number(e):t,nr=e=>e?.Name||e,Li=e=>Math.max(0,Math.min(1,_e(e)));function li(e){let t=e.parent?li(e.parent):[e.runtime.canvasWidth,e.runtime.canvasHeight];return[Math.max(0,(e.anchorMaxX-e.anchorMinX)*t[0]+_e(e.sizeDeltaX)),Math.max(0,(e.anchorMaxY-e.anchorMinY)*t[1]+_e(e.sizeDeltaY))]}function ci(e){let[t,i]=li(e),n=nr(e.scrollDirection)==="Horizontal",a=Math.max(1,_e(e.cellSizeX,50)),o=Math.max(1,_e(e.cellSizeY,50)),r=Math.max(0,_e(e.spacingX)),s=Math.max(0,_e(e.spacingY)),c=Math.max(0,_e(e.padding1X)),l=Math.max(0,_e(e.padding1Y)),f=Math.max(0,_e(e.padding2X)),u=Math.max(0,_e(e.padding2Y)),p=n?i-l-u:t-c-f,m=n?o:a,g=n?s:r,b=nr(e.layoutConstraint)==="Fixed"?Math.max(1,Math.floor(_e(e.layoutConstraintFixedCount,1))):Math.max(1,Math.floor((p+g)/(m+g))),v=Math.ceil(e.itemCount/b),S=v?n?c+f+v*a+(v-1)*r:l+u+v*o+(v-1)*s:0,x=n?t:i,F=Math.max(0,S-x);return{width:t,height:i,horizontal:n,cellW:a,cellH:o,gapX:r,gapY:s,left:c,top:l,right:f,bottom:u,lanes:b,length:S,viewport:x,max:F,offset:Li(e.scrollProgress)*F}}function Bt(e){let t=ci(e);for(let i=0;i<(e._gridItems?.length||0);i+=1){let n=e._gridItems[i];if(!n.alive||n.parent!==e)continue;let a=Math.floor(i/t.lanes),o=i%t.lanes,r=t.horizontal?a:o,s=t.horizontal?o:a,c=t.left+r*(t.cellW+t.gapX)+t.cellW/2-(t.horizontal?t.offset:0),l=-t.top-s*(t.cellH+t.gapY)-t.cellH/2+(t.horizontal?0:t.offset),f={anchorMinX:0,anchorMaxX:0,anchorMinY:1,anchorMaxY:1,pivotX:.5,pivotY:.5,sizeDeltaX:t.cellW,sizeDeltaY:t.cellH,anchoredPositionX:c,anchoredPositionY:l};Object.entries(f).some(([u,p])=>n[u]!==p)&&(Object.assign(n,f),n.markPlayDirty(!0))}return t}var ar={container:"ClientUIContainerControl",textbox:"ClientUITextBoxControl",textwindow:"ClientUITextWindowControl",image:"ClientUIImageControl",button:"ClientUIPresetButtonControl",cursor:"ClientUICursorEventAreaControl",grid:"ClientUIGridScrollerControl",keyhint:"ClientUIKeyHintControl",animation:"ClientUIAnimationControl",fullscreen:"ClientUIFullscreenAnimationControl",reference:"ClientUIReferenceControl"},Yl=["alive","id","Id","prefabIndex","active","activeInHierarchy","visible"],Ki=new Set(["active","visible","parent","sizeDeltaX","sizeDeltaY","anchorMinX","anchorMinY","anchorMaxX","anchorMaxY","pivotX","pivotY"]),Xl=["name","parent","anchoredPositionX","anchoredPositionY","sizeDeltaX","sizeDeltaY","anchorMinX","anchorMinY","anchorMaxX","anchorMaxY","pivotX","pivotY","localScaleX","localScaleY","localScaleZ","localRotationX","localRotationY","localRotationZ","canControllerFocus"],Hl={image:["imageSource","imageId"],grid:["itemCount","scrollDirection","layoutConstraint","layoutConstraintFixedCount"],reference:["referencedPrefabIndex"]},Ul={container:["isolateNavigation","disableKeyEventPassthrough","disableCursorEventPassthrough","showCursor"],textbox:["text","fontSize","fontColor","bgColor","enableOutline","outlineColor","horizontalAlignment","verticalAlignment","adaptiveFontSize","minimumFontSize"],textwindow:["interactable","showScrollBar","text","fontSize","fontColor","bgColor","enableOutline","outlineColor","horizontalAlignment","verticalAlignment","adaptiveFontSize","minimumFontSize"],image:["imageColor","enableMask","enableSoftEdge","softEdgeMode","softEdgeWidthX","softEdgeWidthY","horizontalSoftRange","verticalSoftRange","reverseMaskArea","fillType","fillHorizontalType","fillVerticalType","fillRadial90Type","fillRadialType","fillAmount"],button:["interactable","clickAudioId","raycastTarget"],cursor:["raycastTarget"],grid:["itemPrefabIndex","raycastTarget","showScrollBar","interactable","scrollProgress"],keyhint:["keyboardKeyCode","controllerKeyCode"],animation:["animationId","playSoundEffect","layer"],fullscreen:["animationId","playSoundEffect"]},jl=["GetChildren","GetChild","FindChild","SetActive","SetVisible","GetSiblingIndex","SetSiblingIndex","SetAsFirstSibling","SetAsLastSibling","GetAnchoredPosition","SetAnchoredPosition","GetSizeDelta","SetSizeDelta","GetAnchorMin","SetAnchorMin","GetAnchorMax","SetAnchorMax","GetPivot","SetPivot","GetLocalScale","SetLocalScale","GetLocalRotation","SetLocalRotation","GetScriptByPath","GetScript","GetScripts","AddKeyEventListener","RemoveKeyEventListener","RemoveKeyEventListeners","RemoveAllKeyEventListeners","AddNavigationEventListener","RemoveNavigationEventListener","RemoveNavigationEventListeners","RemoveAllNavigationEventListeners","SetControllerNavigation","GetControllerNavigation"],or=["AddCursorEventListener","RemoveCursorEventListener","RemoveCursorEventListeners","RemoveAllCursorEventListeners","SimulateCursorClick"],Ll={image:["SetImage","SetSoftEdgeWidth","SetFillUnused","SetFillHorizontal","SetFillVertical","SetFillRadial90","SetFillRadial180","SetFillRadial360"],button:or,cursor:or,animation:["PlayAnimation","StopAnimation"],grid:["RefreshItems","GetItemIndex","GetItemSize","GetItemSpacing","GetPadding","ScrollToItemAt","GetContentLength"]};function Jn(e,t){return e.kind==="image"&&t==="imageType"&&e.runtime.canSelectImageType(e.imageId,e.imageSource)?"rw":Yl.includes(t)||(Hl[e.kind]||[]).includes(t)?"ro":Xl.includes(t)||(Ul[e.kind]||[]).includes(t)?"rw":null}var Kl=["localRotationX","localRotationY","localRotationZ"],Yt=Math.PI/180;function rr(e,t){return[e[3]*t[0]+e[0]*t[3]+e[1]*t[2]-e[2]*t[1],e[3]*t[1]-e[0]*t[2]+e[1]*t[3]+e[2]*t[0],e[3]*t[2]+e[0]*t[1]-e[1]*t[0]+e[2]*t[3],e[3]*t[3]-e[0]*t[0]-e[1]*t[1]-e[2]*t[2]]}function Wn(e){if(Object.is(e,-0))return e;let t=(e%360+360)%360,i=Math.round(t*1e6)/1e6;return i>=360?0:i}function sr(e,t,i){let n=x=>[Math.sin(x*Yt/2),Math.cos(x*Yt/2)],[a,o]=n(e),[r,s]=n(t),[c,l]=n(i),[f,u,p,m]=rr(rr([0,r,0,s],[a,0,0,o]),[0,0,c,l]),g=Math.max(-1,Math.min(1,-2*(u*p-m*f))),b,v,S;return Math.abs(g)>.999999?(b=Math.sign(g)*90,v=2*Math.atan2(u,m)/Yt,S=0):(b=Math.asin(g)/Yt,v=Math.atan2(2*(m*u+f*p),1-2*(f*f+u*u))/Yt,S=Math.atan2(2*(m*p+f*u),1-2*(f*f+p*p))/Yt),[Wn(b),Wn(v),Wn(S)]}function lr(e,t){return jl.includes(t)||(Ll[e.kind]||[]).includes(t)}var ql={container:{isolateNavigation:!1,disableKeyEventPassthrough:!1,disableCursorEventPassthrough:!1,showCursor:!1},textbox:{text:"",fontSize:20,fontColor:4294967295,bgColor:0,enableOutline:!1,outlineColor:0,horizontalAlignment:null,verticalAlignment:null,adaptiveFontSize:!1,minimumFontSize:10},textwindow:{interactable:!0,showScrollBar:!0,text:"",fontSize:20,fontColor:4294967295,bgColor:0,enableOutline:!1,outlineColor:0,horizontalAlignment:null,verticalAlignment:null,adaptiveFontSize:!1,minimumFontSize:10},image:{imageSource:null,imageId:0,imageColor:4294967295,imageType:null,enableMask:!1,enableSoftEdge:!1,softEdgeMode:"Percentage",softEdgeWidthX:8,softEdgeWidthY:8,horizontalSoftRange:85,verticalSoftRange:85,enableFill:!1,fillType:"Unused",fillHorizontalType:"Left",fillVerticalType:"Bottom",fillRadial90Type:"BottomLeft",fillRadialType:"Bottom",reverseMaskArea:!1,fillAmount:1},button:{interactable:!0,clickAudioId:0,raycastTarget:!0,unavailableChildId:null,hoverChildId:null,pressedChildId:null,selectedChildId:null,pressed:!1},cursor:{raycastTarget:!0},grid:{itemCount:0,itemPrefabIndex:null,raycastTarget:!0,interactable:!0,showScrollBar:!0,scrollDirection:"Vertical",layoutConstraint:"AutoWrap",layoutConstraintFixedCount:null,scrollProgress:0,cellSizeX:50,cellSizeY:50,spacingX:8,spacingY:8,padding1X:20,padding1Y:20,padding2X:20,padding2Y:20,previewCount:5},keyhint:{keyboardKeyCode:null,controllerKeyCode:null},animation:{animationId:null,playSoundEffect:null,layer:null,raycastTarget:!1},fullscreen:{animationId:null,playSoundEffect:null,raycastTarget:!1},reference:{referencedPrefabIndex:null}},ot=class e{constructor(t,i){this.runtime=t,this.kind=i.kind||"container",this.typeofName=ar[this.kind]||ar.container,this.alive=!0,this.Id=i.Id??t.nextControlId(),this.authoringId=i.authoringId??null,this.prefabIndex=i.prefabIndex??0,this.name=i.name??"",this.active=i.active===!0,this.visible=i.visible!==!1,this._parent=null,this.children=[],this.scripts=[],this.cursorListeners=new Map,this.keyListeners=new Map,this.navListeners=new Map,this.navConfig=new Map,this.anchoredPositionX=i.anchoredPositionX??0,this.anchoredPositionY=i.anchoredPositionY??0,this.sizeDeltaX=i.sizeDeltaX??0,this.sizeDeltaY=i.sizeDeltaY??0,this.anchorMinX=i.anchorMinX??.5,this.anchorMinY=i.anchorMinY??.5,this.anchorMaxX=i.anchorMaxX??.5,this.anchorMaxY=i.anchorMaxY??.5,this.pivotX=i.pivotX??.5,this.pivotY=i.pivotY??.5,this.localScaleX=i.localScaleX??1,this.localScaleY=i.localScaleY??1,this.localScaleZ=i.localScaleZ??1,this.localRotationX=i.localRotationX??0,this.localRotationY=i.localRotationY??0,this.localRotationZ=i.localRotationZ??0,this.canControllerFocus=i.canControllerFocus??!1,this._playDirty=!0,this._playDeepDirty=!0,this._playChildDirty=!1,(this.kind==="grid"||this.kind==="textwindow")&&(this.runtime.scrollControls||=new Set,this.runtime.scrollControls.add(this));let n=ql[this.kind]||{};for(let[a,o]of Object.entries(n))this[a]===void 0&&(this[a]=i[a]!==void 0?i[a]:o);if((this.kind==="animation"||this.kind==="fullscreen")&&(this.runtime.uiAnimations||=new Set,this.runtime.uiAnimations.add(this),this.PlayAnimation()),this.kind==="grid"&&(this.scrollProgress=i.scrollProgress??0),i.children)for(let a of i.children){let o=a instanceof e?a:new e(t,a);this.addChild(o)}}get parent(){return this._parent}set parent(t){if(this._parent===t)return;if(t!==null&&!(t instanceof e))throw new Error("parent must be a Control or nil");if(t&&t.runtime!==this.runtime)throw new Error("parent must belong to the same runtime");if(t===this)throw new Error("cannot parent a control to itself or its descendant");for(let n=t;n;n=n._parent)if(n===this)throw new Error("cannot parent a control to itself or its descendant");let i=this._parent;if(i){let n=i.children.indexOf(this);n>=0&&i.children.splice(n,1),i.markPlayDirty(!0)}else{let n=this.runtime.roots.indexOf(this);n>=0&&this.runtime.roots.splice(n,1)}this._parent=t,this.markPlayDirty(!0),t&&!t.children.includes(this)?(t.children.push(this),t.markPlayDirty(!0)):!t&&this.alive&&!this.runtime.roots.includes(this)&&this.runtime.roots.push(this)}markPlayDirty(t=!1){this._playDirty=!0,t&&(this._playDeepDirty=!0);for(let i=this._parent;i&&!i._playChildDirty;i=i._parent)i._playChildDirty=!0}get activeInHierarchy(){return this.active?this._parent?this._parent.activeInHierarchy:!0:!1}get scrollProgress(){return this._scrollProgress??0}set scrollProgress(t){if(typeof t!="number"||!Number.isFinite(t))throw new Error("scrollProgress must be a finite number");this._scrollProgress=Li(t),this.markPlayDirty()}addChild(t){return t.parent=this,t}GetChildren(){return this.children.slice()}GetChild(t){return this.children.find(i=>i.name===t)||null}FindChild(t){if(!t)return null;if(!t.includes("/"))return this.GetChild(t);let i=t.split("/").filter(Boolean),n=this;for(let a of i)if(n=n.GetChild(a),!n)return null;return n}SetActive(t){let i=!!t;if(this.active!==i){if(typeof this.runtime?.onControlActiveChanging=="function"){this.runtime.onControlActiveChanging(this,i);return}this.active=i,this.markPlayDirty(!0)}}SetVisible(t){this.visible=!!t,this.markPlayDirty(!0)}GetSiblingIndex(){if(!this._parent)return-1;let t=this._parent.children,i=t.indexOf(this);return i<0?-1:t.length-1-i}SetSiblingIndex(t){if(!this._parent)return!1;let i=this._parent.children,n=i.indexOf(this);if(n<0)return!1;let a=i.length-1;return!Number.isInteger(t)||t<0||t>a?!1:(i.splice(n,1),i.splice(a-t,0,this),this._parent.markPlayDirty(!0),this.markPlayDirty(),!0)}SetAsFirstSibling(){return this.SetSiblingIndex(0)}SetAsLastSibling(){return this._parent?this.SetSiblingIndex(this._parent.children.length-1):!1}GetAnchoredPosition(){return[this.anchoredPositionX,this.anchoredPositionY]}SetAnchoredPosition(t,i){this.anchoredPositionX=t,this.anchoredPositionY=i,this.markPlayDirty()}GetSizeDelta(){return[this.sizeDeltaX,this.sizeDeltaY]}SetSizeDelta(t,i){this.sizeDeltaX=t,this.sizeDeltaY=i,this.markPlayDirty(!0)}GetAnchorMin(){return[this.anchorMinX,this.anchorMinY]}SetAnchorMin(t,i){this.anchorMinX=t,this.anchorMinY=i,this.markPlayDirty(!0)}GetAnchorMax(){return[this.anchorMaxX,this.anchorMaxY]}SetAnchorMax(t,i){this.anchorMaxX=t,this.anchorMaxY=i,this.markPlayDirty(!0)}GetPivot(){return[this.pivotX,this.pivotY]}SetPivot(t,i){this.pivotX=t,this.pivotY=i,this.markPlayDirty(!0)}GetLocalScale(){return[this.localScaleX,this.localScaleY,this.localScaleZ]}SetLocalScale(t,i,n){this.localScaleX=t,this.localScaleY=i,this.localScaleZ=n,this.markPlayDirty()}GetLocalRotation(){return sr(this.localRotationX,this.localRotationY,this.localRotationZ)}luaFieldValue(t){if(t==="id")return this.Id;if(t==="imageType")return this.imageType??"Stretch";let i=Kl.indexOf(t);return i<0?this[t]:sr(this.localRotationX,this.localRotationY,this.localRotationZ)[i]}SetLocalRotation(t,i,n){this.localRotationX=t,this.localRotationY=i,this.localRotationZ=n,this.markPlayDirty()}GetScriptByPath(t){return this.scripts.find(i=>i.path===t)||null}GetScript(t){return this.scripts.find(i=>i.scriptMappingId===t)||null}GetScripts(){return this.scripts.slice()}_addListener(t,i,n){let a=t.get(i)||[];a.push(n),t.set(i,a),this.runtime.retainLuaCallback?.(n)}_removeListener(t,i,n){let a=t.get(i);if(!a)return;let o=a.filter(r=>r!==n);t.set(i,o);for(let r=o.length;r<a.length;r++)this.runtime.unrefLuaCallback?.(n)}_removeListeners(t,i){let n=t.get(i)||[];for(let a of n)this.runtime.unrefLuaCallback?.(a);t.delete(i)}_removeAllListeners(t){for(let i of t.values())for(let n of i)this.runtime.unrefLuaCallback?.(n);t.clear()}AddCursorEventListener(t,i){this._addListener(this.cursorListeners,t,i)}RemoveCursorEventListener(t,i){this._removeListener(this.cursorListeners,t,i)}RemoveCursorEventListeners(t){this._removeListeners(this.cursorListeners,t)}RemoveAllCursorEventListeners(){this._removeAllListeners(this.cursorListeners)}SimulateCursorClick(){let t=this.runtime.makeCursorEventData({x:0,y:0,pressX:0,pressY:0});this.emitCursor("CursorDown",t),this.emitCursor("CursorUp",t),this.emitCursor("CursorClick",t)}emitCursor(t,i){if(!this.runtime.cursorEventsEnabled(this))return;let n=this.cursorListeners.get(t)||[];for(let a of n)a(i)}AddKeyEventListener(t,i){this._addListener(this.keyListeners,t,i)}RemoveKeyEventListener(t,i){this._removeListener(this.keyListeners,t,i)}RemoveKeyEventListeners(t){this._removeListeners(this.keyListeners,t)}RemoveAllKeyEventListeners(){this._removeAllListeners(this.keyListeners)}emitKey(t){let i=this.keyListeners.get(t)||[];for(let n of i)if(n()===!0)return!0;return!1}AddNavigationEventListener(t,i){this._addListener(this.navListeners,t,i)}RemoveNavigationEventListener(t,i){this._removeListener(this.navListeners,t,i)}RemoveNavigationEventListeners(t){this._removeListeners(this.navListeners,t)}RemoveAllNavigationEventListeners(){this._removeAllListeners(this.navListeners)}SetControllerNavigation(t,i,n){this.navConfig.set(t,{mode:i,target:n})}GetControllerNavigation(t){let i=this.navConfig.get(t),n=i?[i.mode,i.target]:[null,null];return n.__multi=!0,n}SetImage(t,i){let n=this.imageSource?.Name||this.imageSource,a=t?.Name||t;(i!==this.imageId||n!==a)&&(this.imageType=null),this.imageSource=t,this.imageId=i,this.markPlayDirty()}SetSoftEdgeWidth(t,i){this.softEdgeWidthX=t,this.softEdgeWidthY=i,this.markPlayDirty()}SetFillUnused(){this.fillType="Unused",this.markPlayDirty()}SetFillHorizontal(t,i){this.fillType="Horizontal",this.fillHorizontalType=t,this.fillAmount=i,this.markPlayDirty()}SetFillVertical(t,i){this.fillType="Vertical",this.fillVerticalType=t,this.fillAmount=i,this.markPlayDirty()}SetFillRadial90(t,i){this.fillType="Radial90",this.fillRadial90Type=t,this.fillAmount=i,this.markPlayDirty()}SetFillRadial180(t,i){this.fillType="Radial180",this.fillRadialType=t,this.fillAmount=i,this.markPlayDirty()}SetFillRadial360(t,i){this.fillType="Radial360",this.fillRadialType=t,this.fillAmount=i,this.markPlayDirty()}get animationId(){return this._animationId}set animationId(t){this._animationId!==t&&(this._animationId=t,this._uiAnimation&&this.PlayAnimation())}PlayAnimation(){this.alive&&(this._uiAnimation={generation:(this._uiAnimation?.generation||0)+1,startedAt:this.runtime.clock.time,playing:!0},this.markPlayDirty())}StopAnimation(){this._uiAnimation&&(this._uiAnimation.playing=!1),this.markPlayDirty()}RefreshItems(t,i){if(!Number.isInteger(t)||t<0||t>2e3)throw new Error("RefreshItems: simulator supports 0..2000 items");if(typeof i!="function")throw new Error("RefreshItems: callback must be a function");if(!this.alive||this._refreshingGrid)throw new Error("RefreshItems: destroyed control or recursive refresh");if(t&&!this.runtime.templates.has(Number(this.itemPrefabIndex)))throw new Error("RefreshItems: item template not found");if(t&&["OnInit","OnDestroy"].includes(this.runtime.lifecyclePhase))throw new Error("RefreshItems: items cannot be created during OnInit/OnDestroy");this._refreshingGrid=!0;try{this._gridItems||=[];let n=[];for(let a of this._gridItems)a.alive&&a.parent===this&&a.prefabIndex===Number(this.itemPrefabIndex)&&n.length<t?n.push(a):a.alive&&a.parent===this&&this.runtime.destroyControl(a);for(this._gridItems=n;n.length<t;){let a=this.runtime.instantiate(this.itemPrefabIndex,this,this.runtime.lifecyclePhase);if(!a)throw new Error("RefreshItems: could not instantiate item");n.push(a),a.SetActive(!0)}this.itemCount=t,Bt(this),this.markPlayDirty(!0);for(let a=0;a<n.length&&this.alive;a+=1)i(n[a],a)}finally{this._refreshingGrid=!1}}GetItemIndex(t){return t?.alive&&t.parent===this?this._gridItems?.indexOf(t)??-1:-1}GetItemSize(){return[this.cellSizeX,this.cellSizeY]}GetItemSpacing(){return[this.spacingX,this.spacingY]}GetPadding(){return[this.padding1Y,this.padding2Y,this.padding1X,this.padding2X]}ScrollToItemAt(t,i){if(!Number.isInteger(t)||t<0||t>=this.itemCount)throw new Error("ScrollToItemAt: item index out of range");let n=ci(this),a=n.horizontal?n.cellW:n.cellH,o=n.horizontal?n.gapX:n.gapY,r=(n.horizontal?n.left:n.top)+Math.floor(t/n.lanes)*(a+o),s=i?.Name||i;if(!["Top","Center","Bottom"].includes(s))throw new Error("ScrollToItemAt: invalid alignment");let c=r-(s==="Center"?(n.viewport-a)/2:s==="Bottom"?n.viewport-a:0);this.scrollProgress=n.max?Li(c/n.max):0,Bt(this),this.markPlayDirty(!0)}GetContentLength(){return ci(this).length}};function Be(e,t){t(e);for(let i of e.children)Be(i,t)}function Qn(e,t=[],i=""){t.push(`${i}${e.name||"(unnamed)"} [${e.typeofName}] Id=${e.Id}`);for(let n of e.children)Qn(n,t,i+" ");return t}function qi(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375}var cr={Linear:e=>e,InSine:e=>1-Math.cos(e*Math.PI/2),OutSine:e=>Math.sin(e*Math.PI/2),InOutSine:e=>-(Math.cos(Math.PI*e)-1)/2,InQuad:e=>e*e,OutQuad:e=>1-(1-e)*(1-e),InOutQuad:e=>e<.5?2*e*e:1-(-2*e+2)**2/2,InCubic:e=>e*e*e,OutCubic:e=>1-(1-e)**3,InOutCubic:e=>e<.5?4*e*e*e:1-(-2*e+2)**3/2,InQuart:e=>e**4,OutQuart:e=>1-(1-e)**4,InOutQuart:e=>e<.5?8*e**4:1-(-2*e+2)**4/2,InQuint:e=>e**5,OutQuint:e=>1-(1-e)**5,InOutQuint:e=>e<.5?16*e**5:1-(-2*e+2)**5/2,InExpo:e=>e===0?0:2**(10*e-10),OutExpo:e=>e===1?1:1-2**(-10*e),InOutExpo:e=>e===0||e===1?e:e<.5?2**(20*e-10)/2:(2-2**(-20*e+10))/2,InCirc:e=>1-Math.sqrt(1-e**2),OutCirc:e=>Math.sqrt(1-(e-1)**2),InOutCirc:e=>e<.5?(1-Math.sqrt(1-(2*e)**2))/2:(Math.sqrt(1-(-2*e+2)**2)+1)/2,InBack:e=>(1.70158+1)*e*e*e-1.70158*e*e,OutBack:e=>1+2.70158*(e-1)**3+1.70158*(e-1)**2,InOutBack:e=>{let i=2.5949095;return e<.5?(2*e)**2*((i+1)*2*e-i)/2:((2*e-2)**2*((i+1)*(e*2-2)+i)+2)/2},InElastic:e=>e===0||e===1?e:-(2**(10*e-10))*Math.sin((e*10-10.75)*(2*Math.PI/3)),OutElastic:e=>e===0||e===1?e:2**(-10*e)*Math.sin((e*10-.75)*(2*Math.PI/3))+1,InOutElastic:e=>{if(e===0||e===1)return e;let t=2*Math.PI/4.5;return e<.5?-(2**(20*e-10)*Math.sin((20*e-11.125)*t))/2:2**(-20*e+10)*Math.sin((20*e-11.125)*t)/2+1},InBounce:e=>1-qi(1-e),OutBounce:qi,InOutBounce:e=>e<.5?(1-qi(1-2*e))/2:(1+qi(2*e-1))/2};function dr(e,t){let i=cr[e]||cr.Linear;return t<=0?0:t>=1?1:i(t)}function Xt(e,t,i,n=255){let a=Wi(e),o=Wi(t),r=Wi(i);return((n==null?255:Wi(n))<<24|a<<16|o<<8|r)>>>0}function di(e){let t=e>>>0;return[t>>>16&255,t>>>8&255,t&255,t>>>24&255]}function Wi(e){let t=Number(e);return Number.isFinite(t)?Math.max(0,Math.min(255,Math.trunc(t))):0}function fr(e,t,i){let n=di(e),a=di(t);return Xt(n[0]+(a[0]-n[0])*i,n[1]+(a[1]-n[1])*i,n[2]+(a[2]-n[2])*i,n[3]+(a[3]-n[3])*i)}var Wl=new Set(["fontColor","bgColor","outlineColor","imageColor"]),Jl=new Set(["fontSize","minimumFontSize"]),Zn=1e-9;function Ql(e,t){return typeof e?.luaFieldValue=="function"?e.luaFieldValue(t):e[t]}var fi=class{constructor(t,i,n,a){this.runtime=t,this.object=i,this.data={...n},this.duration=Math.max(0,Number(a)||0),this.easeName="Linear",this.relative=!1,this.playing=!1,this.paused=!1,this.elapsed=0,this.loops=1,this.loopIndex=0,this.from={},this.to={},this.initialFrom=null,this.initialTo=null,this.onComplete=null,this.onStepComplete=null,this.killed=!1,this.dead=!1,this.completed=!1}capture(){this.from={},this.to={};for(let[t,i]of Object.entries(this.data)){let n=Ql(this.object,t);this.from[t]=n,this.to[t]=this.relative?Number(n)+Number(i):i}}restoreInitial(){this.from={...this.initialFrom},this.to={...this.initialTo}}SetEase(t){return this.easeName=typeof t=="string"?t:t?.Name||"Linear",this}SetRelative(t){return this.relative=!!t,this}Play(){return this.dead?this:this.playing?(this.paused=!1,this):this._start(!1)}_begin(t){this.playing=!0,this.paused=!1,this.elapsed=0,this.loopIndex=0,this.killed=!1,this.completed=!1,t&&this.initialFrom?this.restoreInitial():(this.capture(),this.initialFrom={...this.from},this.initialTo={...this.to})}_start(t){return this._begin(t),this.runtime.tweens.add(this),this.runtime.animations.add(this),this}get loopCount(){return this.loops>0?this.loops:1}Pause(){this.paused=!0}Resume(){this.paused=!1}Restart(){return this.dead?this:this._start(!0)}Complete(){this.dead||this.completed||(this.initialFrom||this._begin(!1),this.apply(1),this.finish(!0))}Kill(t){t?this.Complete():this.finish(!1),this.dead=!0}SetOnComplete(t){return this.onComplete=t,this}SetOnStepComplete(t){return this.onStepComplete=t,this}SetLoops(t){return this.loops=t,this}apply(t){if(this.object?.alive===!1)return;let i=dr(this.easeName,t),n=!1,a=!1;for(let o of Object.keys(this.to)){let r=this.from[o],s=this.to[o];if(Wl.has(o)&&typeof r=="number"&&typeof s=="number")this.object[o]=fr(r,s,i);else if(typeof r=="number"&&typeof s=="number"){let c=r+(s-r)*i;this.object[o]=Jl.has(o)?Math.trunc(c):c}else this.object[o]=i>=1?s:r;n=!0,Ki.has(o)&&(a=!0)}n&&typeof this.object?.markPlayDirty=="function"&&this.object.markPlayDirty(a)}_advance(t,i){this.elapsed+=t;let n=this.duration<=0?1:Math.min(1,this.elapsed/this.duration);return this.apply(n),n<1?!1:i>=0&&this.loopIndex+1>=i?!0:(this.onStepComplete&&this.runtime.safeCall(this.onStepComplete),this.loopIndex++,this.elapsed=0,this.restoreInitial(),!1)}step(t){!this.playing||this.paused||this.killed||this._advance(t,this.loops<0?-1:this.loopCount)&&(this.onStepComplete&&this.runtime.safeCall(this.onStepComplete),this.finish(!0))}finish(t){this.playing=!1,this.killed=!0,t&&(this.completed=!0),this.runtime.tweens.delete(this),this.runtime.animations.delete(this),t&&this.onComplete&&this.runtime.safeCall(this.onComplete)}},Ht=class{constructor(t){this.runtime=t,this.steps=[],this.playing=!1,this.paused=!1,this.killed=!1,this.dead=!1,this.completed=!1,this.elapsed=0,this.loops=1,this.loopIndex=0,this.onComplete=null,this.onStepComplete=null,this._entries=null}Append(t){return this.steps.push({kind:"tween",tween:t,parallel:!1}),this}AppendInterval(t){return this.steps.push({kind:"interval",duration:t}),this}AppendCallback(t){return this.steps.push({kind:"callback",fn:t}),this}Join(t){return this.steps.push({kind:"tween",tween:t,parallel:!0}),this}Insert(t,i){return this.steps.push({kind:"insert",time:t,tween:i}),this}InsertCallback(t,i){return this.steps.push({kind:"insertCb",time:t,fn:i}),this}Play(){return this.dead?this:this.playing?(this.paused=!1,this):this._play()}_play(){return this.playing=!0,this.paused=!1,this.killed=!1,this.completed=!1,this.elapsed=0,this.loopIndex=0,this._schedule(),this.runtime.sequences.add(this),this.runtime.animations.add(this),this}_schedule(){let t=0,i=0,n=!1,a=[],o=r=>r.duration*r.loopCount;for(let r of this.steps)if(r.kind==="tween"&&r.parallel){let s=n?i:t;a.push({at:s,tween:r.tween}),t=Math.max(t,s+o(r.tween))}else r.kind==="tween"?(a.push({at:t,tween:r.tween}),i=t,n=!0,t+=o(r.tween)):r.kind==="interval"?(i=t,n=!0,t+=r.duration):r.kind==="callback"?a.push({at:t,fn:r.fn}):r.kind==="insert"?(a.push({at:r.time,tween:r.tween}),t=Math.max(t,r.time+o(r.tween))):r.kind==="insertCb"&&(a.push({at:r.time,fn:r.fn}),t=Math.max(t,r.time));this._entries=a.map((r,s)=>({...r,index:s,end:r.tween?r.at+o(r.tween):r.at})),this._end=t,this._resetEntries()}_resetEntries(){for(let t of this._entries)t.started=!1,t.done=!1}_startChild(t){t.started=!0,t.tween._begin(!!t.tween.initialFrom)}_finishChild(t){t.done=!0,t.tween.apply(1),t.tween.onStepComplete&&this.runtime.safeCall(t.tween.onStepComplete),t.tween.finish(!0)}_advanceTo(t,i){let n=this._entries,a=[];for(let r of n)!r.started&&r.at<=t+Zn&&a.push({at:r.at,rank:r.fn?1:2,entry:r}),r.tween&&!r.done&&r.end<=t+Zn&&a.push({at:r.end,rank:0,entry:r});a.sort((r,s)=>r.at-s.at||r.rank-s.rank||r.entry.index-s.entry.index);let o=new Set;for(let{rank:r,entry:s}of a)if(r===1){if(s.started=!0,this.runtime.safeCall(s.fn),!this.playing||this.killed||this._entries!==n)return!1}else s.started||(this._startChild(s),o.add(s)),r===0&&!s.done&&this._finishChild(s);for(let r of n)!r.tween||!r.started||r.done||(o.has(r)?r.tween._advance(t-r.at,r.tween.loopCount):r.tween._advance(i,r.tween.loopCount));return!0}step(t){!this.playing||this.paused||this.killed||(this.elapsed+=t,this._advanceTo(this.elapsed,t)&&(this.elapsed+Zn<this._end||(this.onStepComplete&&this.runtime.safeCall(this.onStepComplete),this.loopIndex++,this.loops<0||this.loopIndex<this.loops?(this.elapsed=0,this._resetEntries()):this.finish(!0))))}Pause(){this.paused=!0}Resume(){this.paused=!1}Restart(){this.dead||this._play()}Complete(){this.dead||this.completed||(this._entries||this._schedule(),this.playing=!0,this.killed=!1,this._advanceTo(1/0,0)&&(this.onStepComplete&&this.runtime.safeCall(this.onStepComplete),this.finish(!0)))}Kill(t){t?this.Complete():this.finish(!1),this.dead=!0}SetOnComplete(t){return this.onComplete=t,this}SetOnStepComplete(t){return this.onStepComplete=t,this}SetLoops(t){return this.loops=t,this}finish(t){this.playing=!1,this.killed=!0,t&&(this.completed=!0),this.runtime.sequences.delete(this),this.runtime.animations.delete(this),t&&this.onComplete&&this.runtime.safeCall(this.onComplete)}};var Ji={EaseType:["Linear","InSine","OutSine","InOutSine","InQuad","OutQuad","InOutQuad","InCubic","OutCubic","InOutCubic","InQuart","OutQuart","InOutQuart","InQuint","OutQuint","InOutQuint","InExpo","OutExpo","InOutExpo","InCirc","OutCirc","InOutCirc","InBack","OutBack","InOutBack","InElastic","OutElastic","InOutElastic","InBounce","OutBounce","InOutBounce"],CustomVariableEntityType:["Level","PlayerSelf","AvatarSelf"],Device:["KeyboardAndMouse","Mobile","Controller","MobileController"],StageMode:["Beyond","Classic"],LanguageType:["LanguageNone","LanguageEng","LanguageChs","LanguageCht","LanguageFra","LanguageDeu","LanguageSpa","LanguagePor","LanguageRus","LanguageJpn","LanguageKor","LanguageTha","LanguageVie","LanguageInd","LanguageTur","LanguageIta"],ParamType:["Entity","EntityList","Int","IntList","Bool","BoolList","Float","FloatList","String","StringList","Vector3","Vector3List","Guid","GuidList","ConfigId","PrefabId","ConfigIdList","PrefabIdList"],CursorEventType:["CursorDown","CursorUp","CursorEnter","CursorExit","CursorDrag","CursorBeginDrag","CursorEndDrag","CursorClick"],ScrollDirection:["Horizontal","Vertical"],ScrollLayoutConstraint:["AutoWrap","Fixed"],ScrollAlignType:["Bottom","Center","Top"],ControllerNavigationDir:["Up","Down","Left","Right"],ControllerNavigationEventType:["Confirm","Cancel","Focus","LostFocus","RightStickUp","RightStickDown","RightStickRight","RightStickLeft","LeftStickUp","LeftStickDown","LeftStickRight","LeftStickLeft"],ControllerNavigationMode:["None","NearestControl","Specified"],TextHorizontalAlignment:["Left","Middle","Right"],TextVerticalAlignment:["Top","Middle","Bottom"],ImageType:["Basic","Stretch"],ImageSource:["StaticReference","Item","Equipment","Skill","UnitStatus","Faction","Currency","Prefab"],ImageFillType:["Unused","Horizontal","Vertical","Radial90","Radial180","Radial360"],ImageFillHorizontalType:["Left","Right"],ImageFillVerticalType:["Bottom","Top"],ImageFillRadial90Type:["BottomLeft","TopLeft","TopRight","BottomRight"],ImageFillRadialType:["Bottom","Left","Top","Right"],ImageMaskSoftEdgeMode:["Percentage","Pixel"],UIAnimationLayer:["AboveAllControls","BelowAllControls"]},Zl=[...Array.from({length:43},(e,t)=>`CraftspersonKey${t+1}`),"MoveForwardKey","MoveBackwardKey","MoveLeftKey","MoveRightKey","SwitchToWalkOrRunKey","SprintKey","JumpKey","DropKey","OpenShortcutWheelKey","InteractKey","NormalAttackKey","CharacterSkill1Key","CharacterSkill2Key","CharacterSkill3Key","CharacterSkill4Key","None"],ec=[...Array.from({length:14},(e,t)=>`CraftspersonKey${t+1}`),"SprintKey","JumpKey","InteractKey","NormalAttackKey","CharacterSkill1Key","CharacterSkill2Key","CharacterSkill3Key","CharacterSkill4Key","MenuConfirmKey","MenuBackKey","None"];function tc(){let e=[];for(let t of["Down","Up"]){for(let i=1;i<=43;i++)e.push(`KeyboardCraftspersonKey${i}${t}`);for(let i of["MoveForwardKey","MoveBackwardKey","MoveLeftKey","MoveRightKey","SwitchToWalkOrRunKey","SprintKey","JumpKey","DropKey","OpenShortcutWheelKey","InteractKey","NormalAttackKey","CharacterSkill1Key","CharacterSkill2Key","CharacterSkill3Key","CharacterSkill4Key"])e.push(`Keyboard${i}${t}`);for(let i=1;i<=14;i++)e.push(`ControllerCraftspersonKey${i}${t}`);for(let i of["SprintKey","JumpKey","InteractKey","NormalAttackKey","CharacterSkill1Key","CharacterSkill2Key","CharacterSkill3Key","CharacterSkill4Key","MenuConfirmKey","MenuBackKey"])e.push(`Controller${i}${t}`)}return e}Ji.KeyboardKeyCode=Zl;Ji.ControllerKeyCode=ec;Ji.KeyEventType=tc();var ur=new Map;function vt(e,t){let i=`${e}\0${t}`,n=ur.get(i);return n||(n={__kind:"EnumItem",Name:t,FullName:`Enum.${e}.${t}`,EnumType:e},ur.set(i,n)),n}function ea(e,t){return t==null?t:t.__kind==="EnumItem"?vt(t.EnumType||e,t.Name):typeof t=="string"&&t?vt(e,t):t}function ta(){let e={};for(let[t,i]of Object.entries(Ji)){let n={};for(let a of i)n[a]=vt(t,a);e[t]=n}return e}var ic=new Set(["id","Id","prefabIndex","imageId","fontSize","minimumFontSize","clickAudioId","itemCount","itemPrefabIndex","animationId","referencedPrefabIndex"]),nc=new Set(["imageColor","fontColor","bgColor","outlineColor"]),hr={horizontalAlignment:"TextHorizontalAlignment",verticalAlignment:"TextVerticalAlignment",imageSource:"ImageSource",imageType:"ImageType",fillType:"ImageFillType",fillHorizontalType:"ImageFillHorizontalType",fillVerticalType:"ImageFillVerticalType",fillRadial90Type:"ImageFillRadial90Type",fillRadialType:"ImageFillRadialType",softEdgeMode:"ImageMaskSoftEdgeMode",layer:"UIAnimationLayer",scrollDirection:"ScrollDirection",layoutConstraint:"ScrollLayoutConstraint"},wt=d.LUA_REGISTRYINDEX,mr=d.LUA_MULTRET,ac=Object.freeze({InstantiateClientUIControl:2,DestroyClientUIControl:1,GetClientUIControl:1,FindClientUIRoot:1,GetClientUIRoots:0,GetUICanvasSize:0,GetCursorUIPos:0,GetDevice:0,SetControllerFocus:1,GetControllerFocus:0,GetControllerLeftStickAxis:0,GetControllerRightStickAxis:0,Tween:3,TweenSequence:0,ServerSignal:1,GetGlobalCustomVariableValue:2,PauseLevelTime:1,IsLevelTimePaused:0,PlayAudio2D:1,StopAudio:1,IsAudioAlive:1,GetLanguageType:0,GetStageMode:0,IsTestPlay:0,GetText:1,PrintClientUITree:0});function ve(e){return e==null?"":typeof e=="string"?e:e.Name||e.FullName||String(e)}var Qi=class{constructor(t={}){this.canvasWidth=t.canvasWidth??1600,this.canvasHeight=t.canvasHeight??900,this.device=t.device??"KeyboardAndMouse",this.language=t.language??"LanguageChs",this.stageMode=t.stageMode??"Classic",this.testPlay=t.testPlay!==!1,this.canSelectImageType=t.canSelectImageType||(()=>!1),this.clock={time:0,levelTime:0,paused:!1,frame:0},this.logs=[],this.mountErrors=[],this.tweens=new Set,this.sequences=new Set,this.animations=new Set,this.audios=new Map,this.nextAudioId=1,this.audioDuration=t.audioDuration||(()=>null),this.audioHistory=[],this.audioWarnings=new Set,this.audioRevision=0,this._nextControlId=1,this._playRemoved=[],this._nextScriptMappingId=1,this.lifecyclePhase="idle",this.controlsById=new Map,this.roots=[],this.templates=new Map,this.scriptFiles=new Map,this.requireAliases=new Map,this.requireCache=new Map,this.moduleBaseEnvironments=new Map,this.luaFunctions=new Map,this.mountedScripts=[],this.serverVars={Level:Object.create(null),PlayerSelf:Object.create(null),AvatarSelf:Object.create(null)},this.serverBridge=null,this.varHandlers=[],this.signalHandlers=[],this.cursor={x:0,y:0},this.focus=null,this.stick={left:[0,0],right:[0,0]},this.enumTree=ta(),this.luaStates=new Set,this.L=null}nextControlId(){let t=this._nextControlId;return this._nextControlId+=1,t}resolveScriptMappingId(t){let i=Number(t);if(Number.isSafeInteger(i)&&i>0)return this._nextScriptMappingId=Math.max(this._nextScriptMappingId,i+1),i;let n=this._nextScriptMappingId;return this._nextScriptMappingId+=1,n}pushPackedColor(t,i){let n=i>>>0;(n|0)===n?d.lua_pushinteger(t,n):d.lua_pushnumber(t,n)}retainLuaCallback(t){Zo(t)}unrefLuaCallback(t){er(this,t)}log(t,...i){let n=i.map(a=>a==null?"nil":typeof a=="object"&&a!==null&&a.__kind==="EnumItem"?a.Name:String(a)).join(" ");this.logs.push({level:t,text:n,time:this.clock.time})}safeCall(t,...i){try{return t(...i)}catch(n){this.log("lua-error",n&&n.message?n.message:String(n))}}scriptCanRun(t){if(!t?.alive||!t.enabled)return!1;let i=t.object;return!i||i.alive&&i.activeInHierarchy}cursorEventsEnabled(t){for(let i=t;i;i=i.parent)if(i.kind==="container"&&i.showCursor===!0)return!0;return!1}registerTemplate(t,i){this.templates.set(Number(t),i)}registerScriptFile(t,i){let n=this.normalizeRequirePath(t);this.scriptFiles.set(n,i),n.startsWith("default_import_file/")||this.requireAliases.set(`default_import_file/${n}`,n)}normalizeRequirePath(t){let i=String(t).replace(/\\/g,"/");return i.endsWith(".lua")&&(i=i.slice(0,-4)),i=i.replace(/\./g,"/"),i}addRoot(t){let i=t instanceof ot?t:new ot(this,t);return this.roots.push(i),Be(i,n=>this.controlsById.set(n.Id,n)),this.mountSpecScripts(t,i),i}mountSpecScripts(t,i){if(t instanceof ot)return;let n=o=>(o.scripts?.length||0)>0||(o.children||[]).some(n);if(!t||!n(t))return;let a=this.lifecyclePhase;try{let o=(r,s)=>{for(let l of r.scripts||[])try{this.mountScript({path:l.path,source:l.source,control:s,scriptMappingId:l.scriptMappingId})}catch(f){let u=f&&f.message?f.message:String(f);this.mountErrors.push(u),this.log("lua-error",u)}let c=r.children||[];for(let l=0;l<c.length;l+=1)o(c[l],s?.children?.[l])};o(t,i)}finally{this.lifecyclePhase=a}}makeCursorEventData({x:t=0,y:i=0,pressX:n=t,pressY:a=i,deltaX:o=t-n,deltaY:r=i-a,dragging:s=!1,touchId:c=-1}={}){let l=this;return{__kind:"CursorEventData",typeofName:"CursorEventData",dragging:s,touchId:c,x:t,y:i,pressX:n,pressY:a,GetUIPos(){return[t,i]},GetPressUIPos(){return[n,a]},GetUIPosDelta(){return[o,r]}}}boot(){let t=this.newLuaThread();this.L=t}installGlobals(t){let i=this;d.lua_pushcfunction(t,n=>{let a=d.lua_gettop(n),o=[];for(let r=1;r<=a;r++)o.push(pe(n,i,r));return i.log("info",...o),0}),d.lua_setglobal(t,R("print")),d.lua_pushcfunction(t,n=>{let a=d.lua_gettop(n),o=[];for(let r=1;r<=a;r++)o.push(pe(n,i,r));return i.log("error",...o),0}),d.lua_setglobal(t,R("printerr")),d.lua_pushcfunction(t,n=>{if(d.lua_type(n,1)===d.LUA_TTABLE&&!Ke(n,1))return d.lua_pushstring(n,R("table")),1;let a=pe(n,i,1);return d.lua_pushstring(n,R(i.typeofOf(a))),1}),d.lua_setglobal(t,R("typeof")),this.pushColorLib(t),this.pushEnumLib(t),this.pushGameLib(t),d.lua_pushcfunction(t,n=>i.luaRequire(n)),d.lua_setglobal(t,R("require"))}typeofOf(t){return t==null?"nil":t.__kind==="Script"?"Script":t.__kind==="EnumItem"?"EnumItem":t.__kind==="CursorEventData"?"CursorEventData":t.__kind==="ServerSignal"?"ServerSignal":t instanceof Ht?"TweenSequence":t instanceof fi?"Tween":t.typeofName?t.typeofName:typeof t=="number"?"number":typeof t=="string"?"string":typeof t=="boolean"?"boolean":typeof t}pushColorLib(t){d.lua_newtable(t),d.lua_pushcfunction(t,i=>(this.pushPackedColor(i,Xt(d.lua_tonumber(i,1),d.lua_tonumber(i,2),d.lua_tonumber(i,3),255)),1)),d.lua_setfield(t,-2,R("FromRGB")),d.lua_pushcfunction(t,i=>{let n=d.lua_isnoneornil(i,4)?255:d.lua_tonumber(i,4);return this.pushPackedColor(i,Xt(d.lua_tonumber(i,1),d.lua_tonumber(i,2),d.lua_tonumber(i,3),n)),1}),d.lua_setfield(t,-2,R("FromRGBA")),d.lua_pushcfunction(t,i=>{let n=d.lua_tonumber(i,1)>>>0;for(let a of di(n))d.lua_pushinteger(i,a);return 4}),d.lua_setfield(t,-2,R("ToRGBA")),d.lua_newtable(t),d.lua_pushcfunction(t,i=>{let n=d.lua_tonumber(i,2),a=d.lua_tonumber(i,3),o=d.lua_tonumber(i,4),r=d.lua_isnoneornil(i,5)?255:d.lua_tonumber(i,5);return this.pushPackedColor(i,Xt(n,a,o,r)),1}),d.lua_setfield(t,-2,R("__call")),d.lua_setmetatable(t,-2),d.lua_setglobal(t,R("Color"))}pushEnumLib(t){d.lua_newtable(t);for(let[i,n]of Object.entries(this.enumTree)){d.lua_newtable(t);for(let[a,o]of Object.entries(n))this.pushEnumItem(t,o),d.lua_setfield(t,-2,R(a));d.lua_setfield(t,-2,R(i))}d.lua_setglobal(t,R("Enum"))}pushEnumItem(t,i){let n=d.lua_newuserdata(t,0);yt(n,i),Q.luaL_setmetatable(t,R("EnumItem"))}pushControl(t,i){let n=d.lua_newuserdata(t,0);yt(n,i),Q.luaL_setmetatable(t,R("Control"))}pushScript(t,i){d.lua_newtable(t),d.lua_pushlightuserdata(t,qn);let n=d.lua_newuserdata(t,0);yt(n,i),d.lua_rawset(t,-3),Q.luaL_getmetatable(t,R("Script")),d.lua_setmetatable(t,-2)}pushTween(t,i){let n=d.lua_newuserdata(t,0);yt(n,i);let a=i instanceof Ht?"TweenSequence":"Tween";Q.luaL_setmetatable(t,R(a))}pushSignal(t,i){let n=d.lua_newuserdata(t,0);yt(n,i),Q.luaL_setmetatable(t,R("ServerSignal"))}pushCursor(t,i){let n=d.lua_newuserdata(t,0);yt(n,i),Q.luaL_setmetatable(t,R("CursorEventData"))}pushGameLib(t){let i=this;d.lua_newtable(t);let n={InstantiateClientUIControl:a=>{let o=d.lua_tointeger(a,1),r=Ce(d.lua_touserdata(a,2)),s=i.instantiate(o,r,i.lifecyclePhase);return s?(i.pushControl(a,s),1):(d.lua_pushnil(a),1)},DestroyClientUIControl:a=>{let o=Ce(d.lua_touserdata(a,1));return o&&i.destroyControl(o),0},GetClientUIControl:a=>{let o=d.lua_tointeger(a,1),r=i.controlsById.get(o);return r?i.pushControl(a,r):d.lua_pushnil(a),1},FindClientUIRoot:a=>{let o=ee(a,1),r=i.roots.find(s=>s.name===o);return r?i.pushControl(a,r):d.lua_pushnil(a),1},GetClientUIRoots:a=>(d.lua_createtable(a,i.roots.length,0),i.roots.forEach((o,r)=>{i.pushControl(a,o),d.lua_rawseti(a,-2,r+1)}),1),GetUICanvasSize:a=>(d.lua_pushnumber(a,i.canvasWidth),d.lua_pushnumber(a,i.canvasHeight),2),GetCursorUIPos:a=>(d.lua_pushnumber(a,i.cursor.x),d.lua_pushnumber(a,i.cursor.y),2),GetDevice:a=>(i.pushEnumItem(a,vt("Device",i.device)),1),SetControllerFocus:a=>(i.focus=Ce(d.lua_touserdata(a,1)),0),GetControllerFocus:a=>(i.focus?i.pushControl(a,i.focus):d.lua_pushnil(a),1),GetControllerLeftStickAxis:a=>(d.lua_pushnumber(a,i.stick.left[0]),d.lua_pushnumber(a,i.stick.left[1]),2),GetControllerRightStickAxis:a=>(d.lua_pushnumber(a,i.stick.right[0]),d.lua_pushnumber(a,i.stick.right[1]),2),Tween:a=>{let o=Ce(d.lua_touserdata(a,1))||pe(a,i,1),r=pe(a,i,2)||{},s=d.lua_tonumber(a,3),c=new fi(i,o,r,s);return i.pushTween(a,c),1},TweenSequence:a=>(i.pushTween(a,new Ht(i)),1),ServerSignal:a=>{let o=ee(a,1);return i.pushSignal(a,i.makeServerSignal(o)),1},GetGlobalCustomVariableValue:a=>{let o=ve(pe(a,i,1)),r=ee(a,2);return re(a,i,i.getVar(o,r)),1},PauseLevelTime:a=>(i.clock.paused=!!d.lua_toboolean(a,1),0),IsLevelTimePaused:a=>(d.lua_pushboolean(a,i.clock.paused),1),PlayAudio2D:a=>{let o=i.playAudio(i.audioInteger(a));return d.lua_pushinteger(a,o),1},StopAudio:a=>(i.stopAudio(i.audioInteger(a)),0),IsAudioAlive:a=>{let o=i.audios.get(i.audioInteger(a));return d.lua_pushboolean(a,!!(o&&o.alive)),1},GetLanguageType:a=>(i.pushEnumItem(a,vt("LanguageType",i.language)),1),GetStageMode:a=>(i.pushEnumItem(a,vt("StageMode",i.stageMode)),1),IsTestPlay:a=>(d.lua_pushboolean(a,i.testPlay),1),GetText:a=>{let o=ee(a,1);return d.lua_pushstring(a,R(o)),1},PrintClientUITree:a=>{for(let o of i.roots)i.log("info",Qn(o).join(`
|
|
113
|
+
`));return 0}};for(let[a,o]of Object.entries(n)){let r=ac[a];if(r===void 0)throw new Error(`missing game arity for ${a}`);d.lua_pushcfunction(t,s=>{let c=d.lua_gettop(s);return c!==r?Q.luaL_error(s,R(`bad argument count to '${a}' (${r} expected, got ${c})`)):o(s)}),d.lua_setfield(t,-2,R(a))}d.lua_setglobal(t,R("game"))}makeServerSignal(t){let i=[],n=this;return{__kind:"ServerSignal",name:t,AddParam(a,o){i.push({type:ve(a),value:o})},AddInt(a){i.push({type:"Int",value:a})},AddIntList(a){i.push({type:"IntList",value:a})},AddFloat(a){i.push({type:"Float",value:a})},AddFloatList(a){i.push({type:"FloatList",value:a})},AddString(a){i.push({type:"String",value:a})},AddStringList(a){i.push({type:"StringList",value:a})},AddVector3(a){i.push({type:"Vector3",value:a})},AddVector3List(a){i.push({type:"Vector3List",value:a})},AddBool(a){i.push({type:"Bool",value:a})},AddBoolList(a){i.push({type:"BoolList",value:a})},AddGuid(a){i.push({type:"Guid",value:a})},AddGuidList(a){i.push({type:"GuidList",value:a})},AddEntity(a){i.push({type:"Entity",value:a})},AddEntityList(a){i.push({type:"EntityList",value:a})},AddPrefabId(a){i.push({type:"PrefabId",value:a})},AddPrefabIdList(a){i.push({type:"PrefabIdList",value:a})},AddConfigId(a){i.push({type:"ConfigId",value:a})},AddConfigIdList(a){i.push({type:"ConfigIdList",value:a})},SendSignal(){let a=i.slice();n.serverBridge&&typeof n.serverBridge.receiveFromClient=="function"&&n.serverBridge.receiveFromClient(t,a)}}}audioInteger(t){let i=d.lua_tonumber(t,1);return d.lua_type(t,1)!==d.LUA_TNUMBER||!Number.isSafeInteger(i)?Q.luaL_error(t,R("audio argument must be an integer")):i}playAudio(t){this.audioRevision++;let i=this.nextAudioId++,n=this.audioDuration(t),a=Number.isFinite(n)&&n>0,o={instanceId:i,audioId:t,startedAt:this.clock.time,duration:a?n:0,alive:a,stopped:!1};return this.audioHistory.push(o),this.audioHistory.length>128&&this.audioHistory.shift(),a?(this.audios.size>=128&&this.stopAudio(this.audios.keys().next().value),this.audios.set(i,o)):this.audioWarnings.has(t)||(this.audioWarnings.size>=128&&this.audioWarnings.delete(this.audioWarnings.values().next().value),this.audioWarnings.add(t),this.log("warn",`\u97F3\u6548 ${t} \u672A\u5217\u5165\u6A21\u62DF\u5668\u97F3\u9891\u767D\u540D\u5355`)),i}stopAudio(t){let i=this.audios.get(t)||this.audioHistory.find(n=>n.instanceId===t);i&&!i.stopped&&(i.alive=!1,i.stopped=!0,this.audioRevision++),this.audios.delete(t)}audioSnapshot(){return{sequence:this.nextAudioId-1,revision:this.audioRevision,active:[...this.audios.values()].map(t=>({...t})),recent:this.audioHistory.map(t=>({...t}))}}instantiate(t,i,n){if(n==="OnInit"||n==="OnDestroy")return null;let a=this.templates.get(Number(t));if(!a||!i)return null;let o=new ot(this,{...a,Id:this.nextControlId(),authoringId:null,prefabIndex:Number(t)});return i.addChild(o),o.SetAsLastSibling(),Be(o,r=>this.controlsById.set(r.Id,r)),this.mountSpecScripts(a,o),o}destroyControl(t){if(!(!t||!t.alive)){if(t._destroying)throw new Error(`\u5BA2\u6237\u7AEF\u63A7\u4EF6\u751F\u547D\u5468\u671F\u5904\u4E8E\u521B\u5EFA\u6216\u9500\u6BC1\u65F6\uFF0C\u65E0\u6CD5\u8C03\u7528DestroyClientUIControl, ID:${t.name}`);Be(t,i=>{i._destroying=!0}),this._destroyControlTree(t)}}_destroyControlTree(t){this.releaseControlListeners(t);for(let i of t.scripts.slice())this.unmountScript(i);for(let i of t.children.slice())this._destroyControlTree(i);if(t.alive=!1,this.scrollControls?.delete(t),this.uiAnimations?.delete(t),this._playRemoved.push(t.Id),t.parent){let i=t.parent,n=i.children.indexOf(t);n>=0&&i.children.splice(n,1),t._parent=null,i.markPlayDirty(!0)}else{let i=this.roots.indexOf(t);i>=0&&this.roots.splice(i,1)}this.controlsById.delete(t.Id),this.focus===t&&(this.focus=null);for(let i of[...this.tweens])i.object===t&&i.Kill(!1)}releaseControlListeners(t){for(let i of t.cursorListeners.values())for(let n of i)this.unrefLuaCallback(n);for(let i of t.keyListeners.values())for(let n of i)this.unrefLuaCallback(n);for(let i of t.navListeners.values())for(let n of i)this.unrefLuaCallback(n);t.cursorListeners.clear(),t.keyListeners.clear(),t.navListeners.clear(),t.navConfig.clear()}onControlActiveChanging(t,i){let n=[];Be(t,a=>n.push({control:a,was:a.activeInHierarchy})),t.active=!!i,t.markPlayDirty(!0);for(let a of n){let o=a.control.activeInHierarchy;if(a.was!==o)for(let r of a.control.scripts.slice())o?this.enableScript(r):this.disableScript(r)}}bindScriptEnv(t){let i=t.env;return i?(this.pushScript(i,t),d.lua_setglobal(i,R("script")),i):null}disableScript(t){if(!t?.alive||!t.env||t.lifecyclePhase!=="running")return;let i=this.lifecyclePhase;this.lifecyclePhase="OnDisable",t.lifecyclePhase="OnDisable",this.bindScriptEnv(t),this.callGlobal(t.env,"OnDisable"),t.lifecyclePhase="disabled",this.lifecyclePhase=i}enableScript(t){if(!t?.alive||!t.env||t.lifecyclePhase!=="disabled")return;let i=this.lifecyclePhase;this.lifecyclePhase="OnEnable",t.lifecyclePhase="OnEnable",this.bindScriptEnv(t),this.callGlobal(t.env,"OnEnable"),t.lifecyclePhase="running",this.lifecyclePhase=i}unmountScript(t){if(!t||!t.alive)return;let i=t.env,n=this.lifecyclePhase;i&&(t.lifecyclePhase==="running"&&(this.lifecyclePhase="OnDisable",t.lifecyclePhase="OnDisable",this.bindScriptEnv(t),this.callGlobal(i,"OnDisable")),this.lifecyclePhase="OnDestroy",t.lifecyclePhase="OnDestroy",this.bindScriptEnv(t),this.callGlobal(i,"OnDestroy")),t.alive=!1,t.lifecyclePhase="destroyed",this.lifecyclePhase=n,this.mountedScripts=this.mountedScripts.filter(a=>a!==t),t.object&&(t.object.scripts=t.object.scripts.filter(a=>a!==t)),this.varHandlers=this.varHandlers.filter(a=>a.script!==t),this.signalHandlers=this.signalHandlers.filter(a=>a.script!==t),i&&i!==this.L&&this.closeTrackedLuaState(i),t.env=null}installMetatables(t){this.mtEnum(t),this.mtControl(t),this.mtScript(t),this.mtTween(t),this.mtSeq(t),this.mtSignal(t),this.mtCursor(t)}mtIndexNewindex(t,i,n,a,o,r){Q.luaL_newmetatable(t,R(i)),d.lua_pushcfunction(t,s=>{let c=Ke(s,1)||Ce(d.lua_touserdata(s,1)),l=ee(s,2);if(o[l]&&(!r||r(c,l)))return d.lua_pushcfunction(s,o[l]),1;let f;try{f=n(c,l)}catch(u){return Q.luaL_error(s,R(String(u.message||u)))}return f===void 0?(d.lua_pushnil(s),1):(re(s,this,f),1)}),d.lua_setfield(t,-2,R("__index")),d.lua_pushcfunction(t,s=>{try{let c=Ke(s,1)||Ce(d.lua_touserdata(s,1)),l=ee(s,2),f=pe(s,this,3);return a(c,l,f),0}catch(c){return d.lua_pushstring(s,R(String(c.message||c))),d.lua_error(s)}}),d.lua_setfield(t,-2,R("__newindex")),d.lua_pushcfunction(t,s=>{let c=Ke(s,1)||Ce(d.lua_touserdata(s,1)),l=Ke(s,2)||Ce(d.lua_touserdata(s,2));return d.lua_pushboolean(s,c===l),1}),d.lua_setfield(t,-2,R("__eq")),d.lua_pop(t,1)}method(t){let i=this;return n=>{let a=Ke(n,1)||Ce(d.lua_touserdata(n,1)),o=d.lua_gettop(n),r=[];for(let s=2;s<=o;s++)r.push(pe(n,i,s));try{let s=t(a,...r);if(s===a)return d.lua_pushvalue(n,1),1;if(s===void 0)return 0;if(Array.isArray(s)&&s.__multi){for(let c of s)re(n,i,c);return s.length}if(Array.isArray(s)&&!(s.length&&typeof s[0]=="object"&&s[0]?.typeofName)){if(s.__controls)return d.lua_createtable(n,s.length,0),s.forEach((c,l)=>{i.pushControl(n,c),d.lua_rawseti(n,-2,l+1)}),1;if(s.__scripts)return d.lua_createtable(n,s.length,0),s.forEach((c,l)=>{i.pushScript(n,c),d.lua_rawseti(n,-2,l+1)}),1;if(typeof s[0]=="number"&&s.length<=4){for(let c of s)d.lua_pushnumber(n,c);return s.length}}return re(n,i,s),1}catch(s){return d.lua_pushstring(n,R(String(s.message||s))),d.lua_error(n)}}}mtEnum(t){let i=new Set(["Name","FullName","EnumType"]);this.mtIndexNewindex(t,"EnumItem",(n,a)=>i.has(a)?n[a]:void 0,(n,a)=>{throw new Error(`cannot set ${a}, no such field`)},{})}mtCursor(t){let i=new Set(["dragging","touchId"]);this.mtIndexNewindex(t,"CursorEventData",(n,a)=>i.has(a)?n[a]:void 0,(n,a)=>{throw new Error(`cannot set ${a}, no such field`)},{GetUIPos:this.method(n=>n.GetUIPos()),GetPressUIPos:this.method(n=>n.GetPressUIPos()),GetUIPosDelta:this.method(n=>n.GetUIPosDelta())})}mtControl(t){let i=this.method((a,o)=>a.SetVisible(o)),n={GetChildren:this.method(a=>{let o=a.GetChildren();return o.__controls=!0,o}),GetChild:this.method((a,o)=>a.GetChild(o)),FindChild:this.method((a,o)=>a.FindChild(o)),SetActive:this.method((a,o)=>a.SetActive(o)),SetVisible:a=>d.lua_isboolean(a,2)?i(a):Q.luaL_error(a,R("bad argument #2 to 'SetVisible' (boolean expected, got %s)"),Q.luaL_typename(a,2)),GetSiblingIndex:this.method(a=>a.GetSiblingIndex()),SetSiblingIndex:this.method((a,o)=>a.SetSiblingIndex(o)),SetAsFirstSibling:this.method(a=>a.SetAsFirstSibling()),SetAsLastSibling:this.method(a=>a.SetAsLastSibling()),GetAnchoredPosition:this.method(a=>a.GetAnchoredPosition()),SetAnchoredPosition:this.method((a,o,r)=>a.SetAnchoredPosition(o,r)),GetSizeDelta:this.method(a=>a.GetSizeDelta()),SetSizeDelta:this.method((a,o,r)=>a.SetSizeDelta(o,r)),GetAnchorMin:this.method(a=>a.GetAnchorMin()),SetAnchorMin:this.method((a,o,r)=>a.SetAnchorMin(o,r)),GetAnchorMax:this.method(a=>a.GetAnchorMax()),SetAnchorMax:this.method((a,o,r)=>a.SetAnchorMax(o,r)),GetPivot:this.method(a=>a.GetPivot()),SetPivot:this.method((a,o,r)=>a.SetPivot(o,r)),GetLocalScale:this.method(a=>a.GetLocalScale()),SetLocalScale:this.method((a,o,r,s)=>a.SetLocalScale(o,r,s)),GetLocalRotation:this.method(a=>a.GetLocalRotation()),SetLocalRotation:this.method((a,o,r,s)=>a.SetLocalRotation(o,r,s)),GetScriptByPath:this.method((a,o)=>a.GetScriptByPath(o)),GetScript:this.method((a,o)=>a.GetScript(o)),GetScripts:this.method(a=>{let o=a.GetScripts();return o.__scripts=!0,o}),AddCursorEventListener:this.method((a,o,r)=>a.AddCursorEventListener(ve(o),r)),RemoveCursorEventListener:this.method((a,o,r)=>a.RemoveCursorEventListener(ve(o),r)),RemoveCursorEventListeners:this.method((a,o)=>a.RemoveCursorEventListeners(ve(o))),RemoveAllCursorEventListeners:this.method(a=>a.RemoveAllCursorEventListeners()),SimulateCursorClick:this.method(a=>a.SimulateCursorClick()),AddKeyEventListener:this.method((a,o,r)=>a.AddKeyEventListener(ve(o),r)),RemoveKeyEventListener:this.method((a,o,r)=>a.RemoveKeyEventListener(ve(o),r)),RemoveKeyEventListeners:this.method((a,o)=>a.RemoveKeyEventListeners(ve(o))),RemoveAllKeyEventListeners:this.method(a=>a.RemoveAllKeyEventListeners()),AddNavigationEventListener:this.method((a,o,r)=>a.AddNavigationEventListener(ve(o),r)),RemoveNavigationEventListener:this.method((a,o,r)=>a.RemoveNavigationEventListener(ve(o),r)),RemoveNavigationEventListeners:this.method((a,o)=>a.RemoveNavigationEventListeners(ve(o))),RemoveAllNavigationEventListeners:this.method(a=>a.RemoveAllNavigationEventListeners()),SetControllerNavigation:this.method((a,o,r,s)=>a.SetControllerNavigation(ve(o),r,s)),GetControllerNavigation:this.method((a,o)=>a.GetControllerNavigation(ve(o))),SetImage:this.method((a,o,r)=>a.SetImage(o,r)),SetSoftEdgeWidth:this.method((a,o,r)=>a.SetSoftEdgeWidth(o,r)),SetFillUnused:this.method(a=>a.SetFillUnused()),SetFillHorizontal:this.method((a,o,r)=>a.SetFillHorizontal(o,r)),SetFillVertical:this.method((a,o,r)=>a.SetFillVertical(o,r)),SetFillRadial90:this.method((a,o,r)=>a.SetFillRadial90(o,r)),SetFillRadial180:this.method((a,o,r)=>a.SetFillRadial180(o,r)),SetFillRadial360:this.method((a,o,r)=>a.SetFillRadial360(o,r)),PlayAnimation:this.method(a=>a.PlayAnimation()),StopAnimation:this.method(a=>a.StopAnimation()),RefreshItems:this.method((a,o,r)=>{this.retainLuaCallback(r);try{a.RefreshItems(o,r)}finally{this.unrefLuaCallback(r)}}),GetItemIndex:this.method((a,o)=>a.GetItemIndex(o)),GetItemSize:this.method(a=>a.GetItemSize()),GetItemSpacing:this.method(a=>a.GetItemSpacing()),GetPadding:this.method(a=>a.GetPadding()),ScrollToItemAt:this.method((a,o,r)=>a.ScrollToItemAt(o,r)),GetContentLength:this.method(a=>a.GetContentLength())};this.mtIndexNewindex(t,"Control",(a,o)=>{if(!Jn(a,o))return;if(!a.alive&&o!=="alive")throw new Error(`attempt to read '${o}' of a destroyed control`);let r=a.luaFieldValue(o),s=hr[o];return s?ea(s,r):typeof r=="number"&&!ic.has(o)&&!nc.has(o)?new si(r):r},(a,o,r)=>{if(Jn(a,o)==="rw"){if((o==="fontSize"||o==="minimumFontSize")&&!Number.isInteger(r)){let l=r===null?"nil":typeof r;throw new Error(`bad argument #2 to '${o}' (integer expected, got ${l})`)}let c=hr[o];if(o==="animationId"&&!Number.isSafeInteger(r))throw new Error("animationId requires an integer");if(o==="playSoundEffect"&&typeof r!="boolean")throw new Error("playSoundEffect requires a boolean");if(o==="layer"&&(r?.EnumType!=="UIAnimationLayer"||!["AboveAllControls","BelowAllControls"].includes(r.Name)))throw new Error("layer requires Enum.UIAnimationLayer");if(o==="imageType"&&(r?.EnumType!=="ImageType"||!["Basic","Stretch"].includes(r.Name)))throw new Error("imageType requires Enum.ImageType.Basic or Stretch");a[o]=c?ea(c,r):r,typeof a.markPlayDirty=="function"&&a.markPlayDirty(Ki.has(o));return}throw new Error(`cannot set ${o}, no such field`)},n,lr)}mtScript(t){let i=this,n=new Set(["alive","scriptMappingId","object","path","enabled"]);this.mtIndexNewindex(t,"Script",(a,o)=>n.has(o)?a[o]:void 0,(a,o,r)=>{if(o==="enabled"){a.enabled=!!r;return}throw new Error(`cannot set ${o}, no such field`)},{GetParam:this.method((a,o)=>Object.prototype.hasOwnProperty.call(a.params,o)?a.params[o]:null),Invoke:a=>i.luaInvoke(a),EnableUpdate:this.method((a,o)=>{a.updateEnabled=!!o}),RegisterServerSignalHandler:this.method((a,o,r)=>{i.signalHandlers.push({script:a,name:o,fn:r})}),UnregisterServerSignalHandler:this.method((a,o)=>{i.signalHandlers=i.signalHandlers.filter(r=>!(r.script===a&&r.name===o))}),RegisterCustomVariableChangedHandler:this.method((a,o,r,s)=>{i.varHandlers.push({script:a,entityType:ve(o),name:r,fn:s})}),UnregisterCustomVariableChangedHandler:this.method((a,o,r)=>{let s=ve(o);i.varHandlers=i.varHandlers.filter(c=>!(c.script===a&&c.entityType===s&&c.name===r))})})}mtTween(t){this.mtIndexNewindex(t,"Tween",()=>{},()=>{},{SetEase:this.method((i,n)=>i.SetEase(n)),SetRelative:this.method((i,n)=>i.SetRelative(n)),Play:this.method(i=>i.Play()),Pause:this.method(i=>i.Pause()),Resume:this.method(i=>i.Resume()),Restart:this.method(i=>i.Restart()),Complete:this.method(i=>i.Complete()),Kill:this.method((i,n)=>i.Kill(n)),SetOnComplete:this.method((i,n)=>i.SetOnComplete(n)),SetOnStepComplete:this.method((i,n)=>i.SetOnStepComplete(n)),SetLoops:this.method((i,n)=>i.SetLoops(n))})}mtSeq(t){this.mtIndexNewindex(t,"TweenSequence",()=>{},()=>{},{Append:this.method((i,n)=>i.Append(n)),AppendInterval:this.method((i,n)=>i.AppendInterval(n)),AppendCallback:this.method((i,n)=>i.AppendCallback(n)),Join:this.method((i,n)=>i.Join(n)),Insert:this.method((i,n,a)=>i.Insert(n,a)),InsertCallback:this.method((i,n,a)=>i.InsertCallback(n,a)),Play:this.method(i=>i.Play()),Pause:this.method(i=>i.Pause()),Resume:this.method(i=>i.Resume()),Restart:this.method(i=>i.Restart()),Complete:this.method(i=>i.Complete()),Kill:this.method((i,n)=>i.Kill(n)),SetOnComplete:this.method((i,n)=>i.SetOnComplete(n)),SetOnStepComplete:this.method((i,n)=>i.SetOnStepComplete(n)),SetLoops:this.method((i,n)=>i.SetLoops(n))})}mtSignal(t){this.mtIndexNewindex(t,"ServerSignal",()=>{},()=>{},{AddParam:this.method((i,n,a)=>i.AddParam(n,a)),SendSignal:this.method(i=>i.SendSignal()),AddInt:this.method((i,n)=>i.AddInt(n)),AddIntList:this.method((i,n)=>i.AddIntList(n)),AddFloat:this.method((i,n)=>i.AddFloat(n)),AddFloatList:this.method((i,n)=>i.AddFloatList(n)),AddString:this.method((i,n)=>i.AddString(n)),AddStringList:this.method((i,n)=>i.AddStringList(n)),AddVector3:this.method((i,n)=>i.AddVector3(n)),AddVector3List:this.method((i,n)=>i.AddVector3List(n)),AddBool:this.method((i,n)=>i.AddBool(n)),AddBoolList:this.method((i,n)=>i.AddBoolList(n)),AddGuid:this.method((i,n)=>i.AddGuid(n)),AddGuidList:this.method((i,n)=>i.AddGuidList(n)),AddEntity:this.method((i,n)=>i.AddEntity(n)),AddEntityList:this.method((i,n)=>i.AddEntityList(n)),AddPrefabId:this.method((i,n)=>i.AddPrefabId(n)),AddPrefabIdList:this.method((i,n)=>i.AddPrefabIdList(n)),AddConfigId:this.method((i,n)=>i.AddConfigId(n)),AddConfigIdList:this.method((i,n)=>i.AddConfigIdList(n))})}luaRequire(t){let i=ee(t,1),n=this.normalizeRequirePath(i),a=this.requireAliases.get(n)||n;d.lua_rawgeti(t,wt,d.LUA_RIDX_MAINTHREAD);let o=d.lua_tothread(t,-1);d.lua_pop(t,1);let r=this.requireCache.get(o);r||(r=new Map,this.requireCache.set(o,r));let s=r.get(a);if(s?.loading)return d.lua_pushstring(t,R(`failed to load script '${n}': cyclic require`)),d.lua_error(t);if(s&&s.ref!=null)return d.lua_rawgeti(t,wt,s.ref),1;let c=this.scriptFiles.get(a);if(c==null)return d.lua_pushstring(t,R(`failed to load script '${n}'`)),d.lua_error(t);let l=d.lua_gettop(t);r.set(a,{loading:!0});try{this.loadModule(t,o,a,c),d.lua_pushvalue(t,-1);let f=Q.luaL_ref(t,wt);return r.set(a,{ref:f}),1}catch(f){return r.delete(a),d.lua_settop(t,l),d.lua_pushstring(t,R(`failed to load script '${n}': ${f.message||f}`)),d.lua_error(t)}}newLuaThread(){let t=Q.luaL_newstate();return Wo.luaL_openlibs(t),ir(t),this.installMetatables(t),this.installGlobals(t),this.luaStates.add(t),d.lua_pushglobaltable(t),this.copyLuaEnvironment(t,-1),d.lua_remove(t,-2),this.moduleBaseEnvironments.set(t,Q.luaL_ref(t,wt)),t}copyLuaEnvironment(t,i){let n=d.lua_absindex(t,i);d.lua_newtable(t);let a=d.lua_absindex(t,-1);for(d.lua_pushnil(t);d.lua_next(t,n)!==0;)d.lua_pushvalue(t,-2),d.lua_pushvalue(t,-2),d.lua_rawset(t,a),d.lua_pop(t,1);d.lua_pushvalue(t,a),d.lua_setfield(t,a,R("_G"))}closeTrackedLuaState(t){if(!t||!this.luaStates.has(t))return;for(let n of this.requireCache.get(t)?.values()||[])n.ref!=null&&Q.luaL_unref(t,wt,n.ref);this.requireCache.delete(t);let i=this.moduleBaseEnvironments.get(t);if(i!=null&&Q.luaL_unref(t,wt,i),this.moduleBaseEnvironments.delete(t),this.luaStates.delete(t),this.luaFunctions)for(let[n,a]of this.luaFunctions)a.__luaState===t&&this.luaFunctions.delete(n);tr(t)}loadModule(t,i,n,a){let o={__kind:"Script",alive:!0,scriptMappingId:this.resolveScriptMappingId(),object:null,path:n,enabled:!0,updateEnabled:!1,params:{},env:t,invoke(){}},r=String(a).replace(/^\uFEFF/,""),s=ji(r);if(Q.luaL_loadbuffer(t,s,s.length,R(`@${n}`))!==Fe)throw new Error(ee(t,-1));let l=d.lua_absindex(t,-1);if(d.lua_rawgeti(t,wt,this.moduleBaseEnvironments.get(i)),this.copyLuaEnvironment(t,-1),d.lua_remove(t,-2),this.pushScript(t,o),d.lua_setfield(t,-2,R("script")),d.lua_setupvalue(t,l,1),d.lua_pcall(t,0,1,0)!==Fe)throw new Error(ee(t,-1))}mountScript({path:t,source:i,control:n,params:a={},scriptMappingId:o=void 0}){this.L||this.boot();let r=this.newLuaThread(),s={__kind:"Script",alive:!0,scriptMappingId:this.resolveScriptMappingId(o),object:n,path:this.normalizeRequirePath(t),enabled:!0,updateEnabled:!1,params:a,env:r,lifecyclePhase:"idle"};s.invoke=(l,f)=>this.invokeOn(r,l,f),n&&n.scripts.push(s),this.mountedScripts.push(s),this.pushScript(r,s),d.lua_setglobal(r,R("script"));let c=this.lifecyclePhase;try{this.lifecyclePhase="OnInit",s.lifecyclePhase="OnInit",this.runChunk(r,i,t);let l=this.callGlobal(r,"OnInit");l&&this.mountErrors.push(l),this.lifecyclePhase="OnEnable",s.lifecyclePhase="OnEnable";let f=this.callGlobal(r,"OnEnable");f&&this.mountErrors.push(f),this.lifecyclePhase="OnStart",s.lifecyclePhase="OnStart";let u=this.callGlobal(r,"OnStart");return u&&this.mountErrors.push(u),this.lifecyclePhase="running",s.lifecyclePhase="running",s}catch(l){throw s.alive=!1,s.lifecyclePhase="failed",this.mountedScripts=this.mountedScripts.filter(f=>f!==s),n&&(n.scripts=n.scripts.filter(f=>f!==s)),this.varHandlers=this.varHandlers.filter(f=>f.script!==s),this.signalHandlers=this.signalHandlers.filter(f=>f.script!==s),this.lifecyclePhase=c,r&&r!==this.L&&this.closeTrackedLuaState(r),s.env=null,l}}runChunk(t,i,n){let a=String(i).replace(/^\uFEFF/,""),o=ji(a),r=Q.luaL_loadbuffer(t,o,o.length,R(`@${n}`));if(r!==Fe){let c=ee(t,-1)||`luaL_loadbuffer status ${r}`;throw d.lua_pop(t,1),new Error(c)}let s=d.lua_pcall(t,0,0,0);if(s!==Fe){let c=ee(t,-1)||`lua_pcall status ${s}`;throw d.lua_pop(t,1),new Error(c)}}callGlobal(t,i){if(d.lua_getglobal(t,R(i)),d.lua_isfunction(t,-1)){if(d.lua_pcall(t,0,0,0)!==Fe){let a=ee(t,-1);d.lua_pop(t,1);let o=`${i}: ${a}`;return this.log("lua-error",o),o}}else d.lua_pop(t,1);return null}callGlobalDt(t,i,n){if(d.lua_getglobal(t,R(i)),d.lua_isfunction(t,-1)){if(d.lua_pushnumber(t,n),d.lua_pcall(t,1,0,0)!==Fe){let o=ee(t,-1);d.lua_pop(t,1),this.log("lua-error",`${i}: ${o}`)}}else d.lua_pop(t,1)}luaInvoke(t){let i=Ke(t,1);if(!i||i.__kind!=="Script")return Q.luaL_error(t,R("bad self to 'Invoke' (Script expected)"));let n=ee(t,2),a=i.env;if(!a||a.l_G!==t.l_G){let c=[];for(let u=3;u<=d.lua_gettop(t);u++)c.push(pe(t,this,u));let l;try{l=i.invoke(n,c)}catch(u){return Q.luaL_error(t,R(String(u.message||u)))}if(l===void 0)return 0;let f=Array.isArray(l)&&l.__multi?l:[l];for(let u of f)re(t,this,u);return f.length}let o=2;if(d.lua_getglobal(t,R(n)),!d.lua_isfunction(t,-1))return 0;d.lua_replace(t,o),d.lua_remove(t,1);let r=d.lua_gettop(t)-1;return d.lua_pcall(t,r,mr,0)!==Fe?d.lua_error(t):d.lua_gettop(t)}invokeOn(t,i,n){let a=d.lua_gettop(t);if(d.lua_getglobal(t,R(i)),!d.lua_isfunction(t,-1)){d.lua_settop(t,a);return}for(let c of n)re(t,this,c);if(d.lua_pcall(t,n.length,mr,0)!==Fe){let c=ee(t,-1);throw d.lua_settop(t,a),new Error(c)}let r=d.lua_gettop(t)-a;if(r<=0){d.lua_settop(t,a);return}if(r===1){let c=pe(t,this,-1);return d.lua_settop(t,a),c}let s=[];for(let c=1;c<=r;c++)s.push(pe(t,this,a+c));return d.lua_settop(t,a),s.__multi=!0,s}runScriptPhase(t,i){for(let n of this.mountedScripts){if(!this.scriptCanRun(n))continue;let a=n.env;a&&(this.pushScript(a,n),d.lua_setglobal(a,R("script")),!(t==="OnUpdate"&&!n.updateEnabled)&&this.callGlobalDt(a,t,i))}}step(t=1/30){if(typeof t!="number"||!Number.isFinite(t)||t<0)throw new TypeError("dt must be a finite non-negative number");this.clock.frame++,this.clock.time+=t;for(let[n,a]of this.audios)this.clock.time+1e-9>=a.startedAt+a.duration&&(a.alive=!1,this.audios.delete(n),this.audioRevision++);let i=!this.clock.paused;for(let n of[...this.animations])n.step(t);this.runScriptPhase("OnUpdate",t),i&&(this.clock.levelTime+=t,this.runScriptPhase("OnLevelUpdate",t))}injectKey(t){let i=n=>{if(!n.alive||!n.activeInHierarchy)return!1;if(n.keyListeners.has(t)&&n.emitKey(t))return!0;for(let a of[...n.children])if(i(a))return!0;return!1};for(let n of[...this.roots])i(n)}injectCursor(t,i,n){let a=n||this.makeCursorEventData({});Number.isFinite(a.x)&&Number.isFinite(a.y)&&(this.cursor.x=a.x,this.cursor.y=a.y),t.emitCursor(i,a)}getVar(t,i){if(this.serverBridge&&typeof this.serverBridge.getVar=="function")return this.serverBridge.getVar(t,i);let n=this.serverVars[t];return n?n[i]:void 0}notifyVarHandlers(t,i){for(let n of this.varHandlers)this.scriptCanRun(n.script)&&n.entityType===t&&n.name===i&&this.safeCall(n.fn,this.enumTree.CustomVariableEntityType[t],i)}setVar(t,i,n){if(this.serverBridge&&typeof this.serverBridge.setVar=="function"){this.serverBridge.setVar(t,i,n);return}let a=this.serverVars[t]||(this.serverVars[t]=Object.create(null));a[i]=n,this.notifyVarHandlers(t,i)}sendClientSignal(t,i){for(let n of this.signalHandlers)this.scriptCanRun(n.script)&&n.name===t&&this.safeCall(n.fn,t,i)}evalQueryScript(t,i){this.L||this.boot();let n=this.L;d.lua_createtable(n,0,5);let a=(o,r)=>{d.lua_pushcfunction(n,r),d.lua_setfield(n,-2,R(o))};return a("var",o=>(re(o,this,i.var(ee(o,1),ee(o,2))),1)),a("logContains",o=>(d.lua_pushboolean(o,i.logContains(ee(o,1))),1)),a("control",o=>(re(o,this,i.control(ee(o,1))),1)),a("logs",o=>(re(o,this,i.logs()),1)),a("signals",o=>(re(o,this,i.signals(ee(o,1))),1)),a("serverLogs",o=>(re(o,this,i.serverLogs?i.serverLogs():[]),1)),a("serverLogContains",o=>{let r=i.serverLogContains;return d.lua_pushboolean(o,r?!!r(ee(o,1)):!1),1}),d.lua_setglobal(n,R("query")),this.runChunk(n,t,"autotest-assert"),!0}destroy(){for(let t of this.roots.slice())this.destroyControl(t);for(let t of this.mountedScripts.slice())this.unmountScript(t);this.lifecyclePhase="idle",this.mountedScripts=[],this.luaFunctions.clear();for(let t of[...this.luaStates])this.closeTrackedLuaState(t);this.L=null,this.audios.clear(),this.audioHistory.length=0,this.audioWarnings.clear()}};function ui(e){let t=new Qi(e);return t.boot(),t}var xt=Object.freeze(Array.from({length:8},(e,t)=>`Player${t+1}`)),aa=Object.freeze(Array.from({length:8},(e,t)=>`Avatar${t+1}`)),xr=Object.freeze(["Level","PlayerSelf","AvatarSelf"]);var ia=Object.freeze([...xr,...xt,...aa]),Ir=Object.freeze(["PlayerSelf","AllPlayers",...xt]),oc=Object.freeze(["Level","PlayerSelf",...xt]),pr=Object.freeze(["Int","Float","String","Bool","Vector3","Entity","Guid","PrefabId","ConfigId","IntList","FloatList","StringList","BoolList","Vector3List","EntityList","GuidList","PrefabIdList","ConfigIdList","Dict","Struct"]),rc=-2147483648,sc=2147483647,lc=new Set(["set-custom-variable","get-custom-variable","custom-variable-changed","\u8BBE\u7F6E\u81EA\u5B9A\u4E49\u53D8\u91CF","\u83B7\u53D6\u81EA\u5B9A\u4E49\u53D8\u91CF","\u81EA\u5B9A\u4E49\u53D8\u91CF\u53D8\u5316\u65F6","send-signal","listen-signal","send-client-script-signal","\u53D1\u9001\u4FE1\u53F7","\u76D1\u542C\u4FE1\u53F7","\u53D1\u9001\u5BA2\u6237\u7AEF\u811A\u672C\u4FE1\u53F7","setVar","getVar","signal","var"]);function hi(e){return`Player${Number(e)}`}function Zi(e){return`Avatar${Number(e)}`}function br(e){let t=String(e||"").match(/^(?:Player|Avatar)([1-8])$/);return t?Number(t[1]):0}function St(e){if(e==null||e==="")return 1;let t=Number(e);if(!Number.isInteger(t)||t<1||t>8)throw new Error("playerCount must be an integer 1-8");return t}function qe(e,t=8){let i=St(t);if(e==null||e==="")return 1;let n=Number(e);if(!Number.isInteger(n)||n<1||n>i)throw new Error(`playerIndex must be an integer 1-${i}`);return n}function gr(){let e={Level:Object.create(null),PlayerSelf:Object.create(null),AvatarSelf:Object.create(null)};for(let t of xt)e[t]=Object.create(null);for(let t of aa)e[t]=Object.create(null);return e}function Er(e){let t=String(e||"");if(!ia.includes(t))throw new Error(`unknown CustomVariableEntityType: ${e}`);return t}function cc(e,t){let i=Er(e);if(!oc.includes(i))throw new Error(`${t}.entityType must be Level, PlayerSelf, or Player1-8`);return i}function mi(e){let t=String(e??"");if(!t)throw new Error("custom variable name is required");return t}function en(e){let t=String(e??"");if(!t)throw new Error("signal name is required");return t}function na(e){let t=String(e||"PlayerSelf");if(!Ir.includes(t))throw new Error(`unsupported client signal target: ${e}. use PlayerSelf, AllPlayers, or Player1-8`);return t}function pi(e){if(e==null)return"";if(typeof e=="boolean")return"Bool";if(typeof e=="string")return"String";if(typeof e=="number")return Number.isInteger(e)?"Int":"Float";if(Array.isArray(e)){if(e.length===0)return"IntList";let t=pi(e[0]);return t&&!t.endsWith("List")&&t!=="Dict"&&t!=="Struct"?`${t}List`:"IntList"}return e&&typeof e=="object"?"x"in e||"y"in e||"z"in e?"Vector3":"Dict":""}function Ie(e){return e===void 0?null:JSON.parse(JSON.stringify(e))}function yr(e){return Array.isArray(e)?e.map(t=>t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"value")&&"type"in t?t.value:t):[]}function vr(e){return Array.isArray(e)?e.map(t=>t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"value")&&"type"in t?{type:String(t.type||""),value:t.value}:{type:pi(t),value:t}):[]}function dc(e){return String(e?.kind||e?.type||e?.name||e?.id||"")}function tn(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function Cr(e,t){if(!tn(e)||!Object.prototype.hasOwnProperty.call(e,"fromSignalParam"))return null;if(Object.keys(e).some(n=>n!=="fromSignalParam"))throw new Error(`${t}.fromSignalParam cannot be combined with literal fields`);let i=Number(e.fromSignalParam);if(!Number.isSafeInteger(i)||i<0)throw new Error(`${t}.fromSignalParam must be a non-negative integer`);return{fromSignalParam:i}}function wr(e,t){return Cr(e,t)||Ie(e)}function fc(e,t,i){if(!tn(e))throw new Error(`serverLogic.rules[${t}].actions[${i}] must be an object`);let n=String(e.kind||e.type||""),a=`serverLogic.rules[${t}].actions[${i}]`;if(n==="setCustomVariable"){let o=cc(e.entityType,a);if(!Object.prototype.hasOwnProperty.call(e,"value"))throw new Error(`${a}.value is required`);return{kind:n,entityType:o,name:mi(e.name),value:wr(e.value,`${a}.value`),...e.variableType?{variableType:String(e.variableType)}:{}}}if(n==="sendClientScriptSignal"){if(!Array.isArray(e.params))throw new Error(`${a}.params must be an array`);return{kind:n,target:na(e.target),signalName:en(e.signalName),params:e.params.map((o,r)=>wr(o,`${a}.params[${r}]`))}}throw new Error(`${a}.kind must be setCustomVariable or sendClientScriptSignal`)}function bi(e){if(e==null)return{version:1,rules:[]};if(!tn(e))throw new Error("serverLogic must be an object");let t=e.rules===void 0?[]:e.rules;if(!Array.isArray(t))throw new Error("serverLogic.rules must be an array");return{version:1,rules:t.map((i,n)=>{if(!tn(i))throw new Error(`serverLogic.rules[${n}] must be an object`);if(!Array.isArray(i.actions)||i.actions.length===0)throw new Error(`serverLogic.rules[${n}].actions must be a non-empty array`);return{id:String(i.id||`signal-${n+1}`),signalName:en(i.signalName),actions:i.actions.map((a,o)=>fc(a,n,o))}})}}function Sr(e,t,{typed:i=!1}={}){let n=Cr(e,"server logic value");if(n){let a=i?t.params:t.values;if(n.fromSignalParam>=a.length)throw new Error(`signal ${t.name} has no parameter at index ${n.fromSignalParam}`);return Ie(a[n.fromSignalParam])}return Ie(e)}function uc(e){return e==="Level"?"Level":xt.includes(e)?"PlayerSelf":aa.includes(e)?"AvatarSelf":e}function kr(e={}){let t=gr(),i=gr(),n=[],a=[],o=[],r=[],s=Array.from({length:9},()=>null),c=1,l=0,f=Number(e.onlineLatencyMs||0);(!Number.isFinite(f)||f<0)&&(f=0);let u=bi(e.logic),p=St(e.playerCount),m=qe(e.viewPlayerIndex,p);function g(w,A){r.push({source:"server",level:String(w||"engine"),text:String(A),time:l})}function b(w){let A=s[w||m],I=Number(A?.clock?.time);Number.isFinite(I)&&(l=I)}function v(w,A,I,C){t[w][A]=I,i[w][A]={type:C||pi(I)||i[w][A]?.type||""}}function S(w,A,I){return typeof I!="number"||!Number.isInteger(I)?{ok:!0,value:I}:I>=rc&&I<=sc?{ok:!0,value:I}:(g("engine",`Int custom variable ${w}.${A} out of range ${I}; keeping previous legal value`),{ok:!1,value:t[w][A]})}function x(w,A){let I=Er(w),C=A||m;return I==="PlayerSelf"?hi(C):I==="AvatarSelf"?Zi(C):I}function F(w,A){let I=uc(w);if(w==="Level"){for(let k=1;k<=p;k+=1){let _=s[k];_&&typeof _.notifyVarHandlers=="function"&&_.notifyVarHandlers("Level",A)}return}let C=br(w);if(!C)return;let $=s[C];$&&typeof $.notifyVarHandlers=="function"&&$.notifyVarHandlers(I,A)}function N(w,A){let I=na(w);return I==="AllPlayers"?Array.from({length:p},(C,$)=>$+1):I==="PlayerSelf"?[A||m]:[br(I)]}function V(w){for(let A of u.rules)if(A.signalName===w.name)for(let I of A.actions){if(I.kind==="setCustomVariable"){let C=Sr(I.value,w);O.setVar(I.entityType,I.name,C,{type:I.variableType,playerIndex:w.playerIndex}),g("info",`logic ${A.id}: set ${I.entityType}.${I.name}`);continue}if(I.kind==="sendClientScriptSignal"){let C=I.params.map($=>Sr($,w,{typed:!0}));O.sendToClient(I.signalName,C,{target:I.target,playerIndex:w.playerIndex}),g("info",`logic ${A.id}: sent ${I.signalName} to ${I.target}`)}}}function Y(w,A){w&&(w.serverBridge={getVar:(I,C)=>O.getVar(I,C,{playerIndex:A}),setVar:(I,C,$)=>O.setVar(I,C,$,{playerIndex:A}),receiveFromClient:(I,C)=>O.receiveFromClient(I,C,{playerIndex:A})})}function j(w){w&&(w.serverBridge=null)}let O={ENTITY_TYPES:xr,ALL_ENTITY_TYPES:ia,CLIENT_SIGNAL_TARGETS:Ir,get clock(){return l},get playerCount(){return p},get viewPlayerIndex(){return m},setClock(w){l=Number(w)||0},setPlayerCount(w){return p=St(w),m>p&&(m=p),p},setViewPlayerIndex(w){return m=qe(w,p),m},log(w,A){g(w,A)},defineVar(w,A,I={},{playerIndex:C}={}){let $=x(w,C),k=mi(A);if(Object.prototype.hasOwnProperty.call(t[$],k))throw new Error(`custom variable already exists: ${$}.${k}`);let _=I.type?String(I.type):pi(I.value??I.defaultValue);if(_&&!pr.includes(_))throw new Error(`unsupported custom variable type: ${_}`);let X=I.value!==void 0?I.value:I.defaultValue!==void 0?I.defaultValue:null;return v($,k,X,_),O.getVar($,k)},getVar(w,A,{playerIndex:I}={}){let C=x(w,I),$=mi(A);if(!Object.prototype.hasOwnProperty.call(t[C],$)){g("engine",`GetGlobalCustomVariableValue missing ${C}.${$}; returning nil (simulator policy)`);return}return t[C][$]},setVar(w,A,I,{notify:C=!0,type:$,playerIndex:k}={}){let _=x(w,k),X=mi(A),U=$||i[_][X]?.type||pi(I);if(U&&!pr.includes(U)&&U!=="")throw new Error(`unsupported custom variable type: ${U}`);let de=I;if(!((U==="Int"||U===""&&typeof I=="number"&&Number.isInteger(I))&&(de=S(_,X,I).value,de===void 0)))return v(_,X,de,U),C&&F(_,X),de},listVars(w){let A=w?[x(w)]:["Level",...Array.from({length:p},(C,$)=>hi($+1)),...Array.from({length:p},(C,$)=>Zi($+1))],I=[];for(let C of A)for(let $ of Object.keys(t[C]))I.push({entityType:C,name:$,type:i[C][$]?.type||"",value:Ie(t[C][$])});return I},receiveFromClient(w,A=[],{playerIndex:I}={}){let C=qe(I||m,p);b(C);let $=en(w),k={id:c++,direction:"inbound",name:$,params:vr(A),values:yr(A),time:l,playerIndex:C,from:hi(C)};return n.push(k),V(k),k},sendToClient(w,A=[],{target:I="PlayerSelf",playerIndex:C}={}){let $=en(w),k=na(I),X=N(k,C||m),U={id:c++,direction:"outbound",name:$,params:vr(A),values:yr(A),time:l,target:k,players:X,deliverAt:l+f/1e3,delivered:!1};return a.push(U),f===0?O.deliver(U):o.push(U),U},getLogic(){return Ie(u)},setLogic(w){return u=bi(w),O.getLogic()},deliver(w){if(!w||w.delivered)return;w.delivered=!0;let A=Array.isArray(w.players)&&w.players.length?w.players:N(w.target);for(let I of A){let C=s[I];C&&typeof C.sendClientSignal=="function"&&C.sendClientSignal(w.name,w.values)}},flush(w){w!==void 0&&(l=Number(w)||0);let A=[];for(let I=o.length-1;I>=0;I-=1)o[I].deliverAt<=l&&A.push(o.splice(I,1)[0]);A.sort((I,C)=>I.id-C.id);for(let I of A)O.deliver(I);return A},inbound(){return n.slice()},outbound(){return a.slice()},loadConfig(w){if(w!=null){if(typeof w!="object")throw new Error("server config must be an object");if(w.graph&&!Array.isArray(w.nodes))throw new Error("unsupported server node graph: v1 only accepts custom variables and signals");for(let A of w.nodes||[]){let I=dc(A);if(!lc.has(I))throw new Error(`unsupported server node: ${I||JSON.stringify(A)}. v1 only supports custom variables and signals`)}if(w.onlineLatencyMs!==void 0){let A=Number(w.onlineLatencyMs);if(!Number.isFinite(A)||A<0)throw new Error("onlineLatencyMs must be a non-negative finite number");f=A}w.playerCount!==void 0&&O.setPlayerCount(w.playerCount),w.viewPlayerIndex!==void 0&&O.setViewPlayerIndex(w.viewPlayerIndex),(w.logic!==void 0||w.serverLogic!==void 0)&&O.setLogic(w.logic??w.serverLogic);for(let A of w.vars||[]){let I=x(A.entityType),C=mi(A.name);Object.prototype.hasOwnProperty.call(t[I],C)?O.setVar(I,C,A.value??A.defaultValue,{notify:!1,type:A.type}):O.defineVar(I,C,A)}}},attachRuntime(w,{playerIndex:A=1}={}){let I=qe(A,8);return s[I]&&s[I]!==w&&j(s[I]),s[I]=w||null,Y(s[I],I),O},attachRuntimes(w){O.detachRuntime();let A=Array.isArray(w)?w:[];for(let I=0;I<A.length&&I<8;I+=1)s[I+1]=A[I]||null,Y(s[I+1],I+1);return O},detachRuntime(){for(let w=1;w<=8;w+=1)j(s[w]),s[w]=null},snapshot(){let w=hi(m),A=Zi(m),I={Level:{},PlayerSelf:{},AvatarSelf:{}};for(let C of Object.keys(t.Level))I.Level[C]={type:i.Level[C]?.type||"",value:Ie(t.Level[C])};for(let C of Object.keys(t[w]))I.PlayerSelf[C]={type:i[w][C]?.type||"",value:Ie(t[w][C])};for(let C of Object.keys(t[A]))I.AvatarSelf[C]={type:i[A][C]?.type||"",value:Ie(t[A][C])};for(let C=1;C<=p;C+=1){let $=hi(C),k=Zi(C);I[$]={},I[k]={};for(let _ of Object.keys(t[$]))I[$][_]={type:i[$][_]?.type||"",value:Ie(t[$][_])};for(let _ of Object.keys(t[k]))I[k][_]={type:i[k][_]?.type||"",value:Ie(t[k][_])}}return{clock:l,onlineLatencyMs:f,playerCount:p,viewPlayerIndex:m,logic:O.getLogic(),vars:I,inbound:n.map(C=>({id:C.id,name:C.name,params:Ie(C.params),values:Ie(C.values),time:C.time,playerIndex:C.playerIndex,from:C.from})),outbound:a.map(C=>({id:C.id,name:C.name,params:Ie(C.params),values:Ie(C.values),time:C.time,target:C.target,players:Array.isArray(C.players)?C.players.slice():[],deliverAt:C.deliverAt,delivered:!!C.delivered})),logs:r.map(C=>({source:"server",level:C.level,text:C.text,time:C.time}))}},reset(){for(let w of ia){for(let A of Object.keys(t[w]))delete t[w][A];for(let A of Object.keys(i[w]))delete i[w][A]}n.length=0,a.length=0,o.length=0,r.length=0,c=1,l=0},destroy(){O.detachRuntime(),O.reset()}};e.config&&O.loadConfig(e.config);for(let w of e.vars||[])O.defineVar(w.entityType,w.name,w);return O}var hc={container:"container",textbox:"textbox",image:"image",button:"button",cursor:"cursor",grid:"grid",reference:"reference",textwindow:"textwindow",keyhint:"keyhint",animation:"animation",fullscreen:"fullscreen"};function oa(e,t,i=null){let n=tt(e.transformByPlatform,t),a={authoringId:e.id,kind:hc[e.kind]||"container",name:e.name,prefabIndex:e.guid||0,active:e.active!==!1,visible:e.visible!==!1,canControllerFocus:e.canControllerFocus===!0,anchoredPositionX:n.offset.x,anchoredPositionY:n.offset.y,sizeDeltaX:n.size.x,sizeDeltaY:n.size.y,anchorMinX:n.anchorMin.x,anchorMinY:n.anchorMin.y,anchorMaxX:n.anchorMax.x,anchorMaxY:n.anchorMax.y,pivotX:n.pivot.x,pivotY:n.pivot.y,localScaleX:n.scale.x,localScaleY:n.scale.y,localScaleZ:n.scale.z,localRotationX:n.rotation.x,localRotationY:n.rotation.y,localRotationZ:n.rotation.z,children:(e.children||[]).map(r=>oa(r,t,i))},o=i?.get(e.id);if(o?.length&&(a.scripts=o.map(r=>{let s=Number(r.guid);return{path:r.path||r.id,source:r.source||"",...Number.isSafeInteger(s)&&s>0?{scriptMappingId:s}:{}}})),e.kind==="container"&&(a.isolateNavigation=e.isolateNavigation===!0,a.disableKeyEventPassthrough=e.disableKeyEventPassthrough===!0,a.disableCursorEventPassthrough=e.disableCursorEventPassthrough===!0,a.showCursor=e.showCursor===!0),(e.kind==="textbox"||e.kind==="textwindow")&&(a.text=e.text??"",a.fontSize=e.fontSize,a.adaptiveFontSize=e.adaptiveFontSize===!0,a.minimumFontSize=e.minimumFontSize,a.fontColor=e.fontColor,a.bgColor=e.bgColor,a.enableOutline=e.enableOutline!==!1,a.outlineColor=e.outlineColor,a.horizontalAlignment=e.horizontalAlignment||"Left",a.verticalAlignment=e.verticalAlignment||"Top",e.kind==="textwindow"&&(a.interactable=e.interactable!==!1,a.showScrollBar=e.showScrollBar!==!1)),e.kind==="image"&&(a.imageSource=e.imageSource,a.imageType=e.imageType??null,a.imageId=e.imageId??0,a.imageColor=e.imageColor,a.raycastTarget=e.raycastTarget===!0,a.enableMask=e.enableMask===!0,a.enableSoftEdge=e.enableSoftEdge===!0,a.softEdgeMode=e.softEdgeMode,a.softEdgeWidthX=e.softEdgeWidthX,a.softEdgeWidthY=e.softEdgeWidthY,a.horizontalSoftRange=e.horizontalSoftRange,a.verticalSoftRange=e.verticalSoftRange,a.enableFill=e.enableFill===!0,a.fillType=e.enableFill?e.fillType:"Unused",a.fillHorizontalType=e.fillHorizontalType,a.fillVerticalType=e.fillVerticalType,a.fillRadial90Type=e.fillRadial90Type,a.fillRadialType=e.fillRadialType,a.fillAmount=e.fillAmount,a.reverseMaskArea=e.reverseMaskArea===!0),e.kind==="button"&&(a.raycastTarget=e.raycastTarget!==!1,a.interactable=e.interactable!==!1,a.clickAudioId=e.clickAudioId,a.unavailableChildId=e.unavailableChildId??null,a.hoverChildId=e.hoverChildId??null,a.pressedChildId=e.pressedChildId??null,a.selectedChildId=e.selectedChildId??null),e.kind==="cursor"&&(a.raycastTarget=e.raycastTarget!==!1),e.kind==="reference"&&(a.referencedPrefabIndex=e.referencedPrefabId),e.kind==="grid"&&(a.itemPrefabIndex=e.itemPrefabId,a.raycastTarget=e.raycastTarget!==!1,a.interactable=e.interactable!==!1,a.showScrollBar=e.showScrollBar!==!1,a.scrollDirection=e.scrollDirection,a.layoutConstraint=e.layoutConstraint,a.layoutConstraintFixedCount=e.layoutConstraintFixedCount,a.cellSizeX=e.cellSizeX,a.cellSizeY=e.cellSizeY,a.spacingX=e.spacingX,a.spacingY=e.spacingY,a.padding1X=e.padding1X,a.padding1Y=e.padding1Y,a.padding2X=e.padding2X,a.padding2Y=e.padding2Y,a.previewCount=e.previewCount),e.kind==="keyhint"&&(a.keyboardKeyCode=e.keyboardKeyCode,a.controllerKeyCode=e.controllerKeyCode),e.kind==="animation"||e.kind==="fullscreen"){a.raycastTarget=!1;let r=Number(e.animationId);a.animationId=e.animationId!=null&&String(e.animationId).trim()!==""&&Number.isSafeInteger(r)?r:e.animationId,a.playSoundEffect=e.playSoundEffect,e.kind==="animation"&&(a.layer=e.layer)}return a}function ra(e,t=[],i=""){let n=i&&ie[i]?i:e.canvasId,a=ie[n],o=ti(e),r=new Map;for(let c of t){if(!c.controlId)continue;let l=r.get(c.controlId)||[];l.push(c),r.set(c.controlId,l)}let s=e.meta?.assetType==="client-control-template"?(e.root.children||[]).map(c=>oa(c,n,r)):[];return{canvasId:n,platform:a.platform,device:a.luaDevice,canvasWidth:a.width,canvasHeight:a.height,root:oa(o,n,r),templates:s}}var nn="qxqy-autotest";var Et=.03333333333333333,mc=new Set(["pointer","key","click","pause","resume","serverSet","serverSend","view"]),pc=new Set(["log","control","var","signal","tree","lua"]);function It(e,t){let i=Number(e);if(!Number.isFinite(i))throw new Error(`${t} must be a finite number`);return i}function sa(e){return JSON.parse(JSON.stringify(e??null))}function an(e,t){if(!e||typeof e!="object")throw new Error(`events[${t}] must be an object`);let i=String(e.kind||e.do||"");if(!mc.has(i))throw new Error(`unsupported event kind: ${i||"(empty)"}`);let n=e.payload&&typeof e.payload=="object"?{...e.payload}:{};if(i==="pointer")!n.type&&e.type&&(n.type=e.type),n.x===void 0&&(n.x=e.x),n.y===void 0&&(n.y=e.y),n.x=It(n.x,"pointer.x"),n.y=It(n.y,"pointer.y"),n.type=String(n.type||"click"),n.type==="wheel"&&(n.deltaX=It(n.deltaX??e.deltaX??0,"pointer.deltaX"),n.deltaY=It(n.deltaY??e.deltaY??0,"pointer.deltaY"));else if(i==="key"){if(n.typeName=String(n.typeName||n.key||e.typeName||e.key||""),!n.typeName)throw new Error("key event requires typeName")}else if(i==="click"){if(n.name=String(n.name||e.name||""),!n.name)throw new Error("click event requires control name")}else if(i==="serverSet"){if(n.entityType=String(n.entityType||e.entityType||""),n.name=String(n.name||e.name||""),n.value===void 0&&(n.value=e.value),n.value===void 0&&(n.value=null),!n.entityType||!n.name)throw new Error("serverSet requires entityType and name")}else if(i==="serverSend"){if(n.name=String(n.name||e.name||""),n.params=Array.isArray(n.params)?n.params:Array.isArray(e.params)?e.params:[],n.target=String(n.target||e.target||"PlayerSelf"),!n.name)throw new Error("serverSend requires signal name")}else if(i==="view"&&(n.playerIndex=Number(n.playerIndex||n.viewPlayerIndex||e.playerIndex||e.viewPlayerIndex||0),!Number.isInteger(n.playerIndex)||n.playerIndex<1))throw new Error("view event requires playerIndex 1-8");return{t:It(e.t??0,"event.t"),source:String(e.source||"user"),kind:i,payload:n}}function la(e,t){if(!e||typeof e!="object")throw new Error(`asserts[${t}] must be an object`);let i=String(e.kind||(e.check?"log":""));if(!pc.has(i))throw new Error(`unsupported assert kind: ${i||"(empty)"}`);let n={kind:i};if(e.at!==void 0&&(n.at=It(e.at,"assert.at")),i==="log"){if(n.contains=String(e.contains||e.check||e.text||""),n.source=e.source==="server"?"server":"client",e.level&&(n.level=String(e.level)),!n.contains)throw new Error("log assert requires contains")}else if(i==="control"){if(n.id=e.id?String(e.id):"",n.name=e.name?String(e.name):"",n.field=String(e.field||""),!n.field)throw new Error("control assert requires field");if(!n.id&&!n.name)throw new Error("control assert requires id or name");if(!Object.prototype.hasOwnProperty.call(e,"equals"))throw new Error("control assert requires equals");n.equals=sa(e.equals)}else if(i==="var"){if(n.entityType=String(e.entityType||""),n.name=String(e.name||""),!n.entityType||!n.name)throw new Error("var assert requires entityType and name");if(!Object.prototype.hasOwnProperty.call(e,"equals"))throw new Error("var assert requires equals");n.equals=sa(e.equals)}else if(i==="signal"){if(n.direction=e.direction==="outbound"?"outbound":"inbound",n.name=String(e.name||""),!n.name)throw new Error("signal assert requires name");e.values!==void 0&&(n.values=sa(e.values))}else if(i==="tree"){if(n.name=String(e.name||""),n.exists=e.exists!==!1,!n.name)throw new Error("tree assert requires name")}else if(i==="lua"&&(n.source=String(e.source||""),!n.source.trim()))throw new Error("lua assert requires source");return n}function Ar(e){let t=0,i=[],n=[];for(let a of e){if(!a||typeof a!="object")throw new Error("queue step must be an object");if(a.do!=="start"){if(a.do==="step"){t+=It(a.dt??Et,"step.dt");continue}if(a.do==="pointer"||a.do==="key"||a.do==="click"||a.do==="pause"||a.do==="resume"||a.do==="serverSet"||a.do==="serverSend"||a.do==="view"){i.push(an({...a,kind:a.do,t},i.length));continue}if(a.assert||a.check||a.kind){n.push(la({...a.assert||a,at:a.at??t},n.length));continue}throw new Error(`unsupported queue step: ${JSON.stringify(a)}`)}}return{events:i,asserts:n,dt:Et}}function gi(e){if(Array.isArray(e)){let n=Ar(e);return{format:nn,version:1,name:"",dt:n.dt,events:n.events,asserts:n.asserts}}if(!e||typeof e!="object")throw new Error("autotest case must be an object or step array");if(Array.isArray(e.queue)||Array.isArray(e.steps)){let n=Ar(e.queue||e.steps);return{format:nn,version:1,name:String(e.name||""),dt:Number(e.dt)>0?Number(e.dt):n.dt,events:n.events,asserts:n.asserts}}let t=(e.events||[]).map((n,a)=>an(n,a)),i=(e.asserts||[]).map((n,a)=>la(n,a));return t.sort((n,a)=>n.t-a.t||0),{format:nn,version:1,name:String(e.name||""),dt:Number(e.dt)>0?Number(e.dt):Et,playerCount:Number(e.playerCount)>0?Number(e.playerCount):1,events:t,asserts:i}}function _r(e,t={}){let i=(e||[]).map((n,a)=>an(n,a));return{format:nn,version:1,name:String(t.name||""),dt:Number(t.dt)>0?Number(t.dt):Et,playerCount:Number(t.playerCount)>0?Number(t.playerCount):1,events:i,asserts:(t.asserts||[]).map((n,a)=>la(n,a))}}function Tr(e,t,i){if(!e)return null;let n=an({...t,t:t.t??i??0},e.events.length);return e.events.push(n),n}var on=(e,t)=>Math.max(0,Math.min(t,Number.isFinite(e)?e:0));function Pr(e,t,i){let n=pt(e,t,i),a=Math.max(0,n.contentHeight-i),o=on(e._scrollOffset||0,a);return e._scrollOffset=o,{...n,length:n.contentHeight,max:a,offset:o,viewport:i,horizontal:!1,width:t,height:i}}function rn(e,t,i){if(!e?.showBar||e.max<=0||t<=0||i<=0)return null;let n=e.horizontal===!0,a=n?t:i,o=Math.max(0,a-4),r=Math.min(o,Math.max(18,o*a/(a+e.max))),s=o-r,c=s*e.offset/e.max,l=Math.min(8,n?i:t),f=n?{x:-t/2+2,y:i/2-l-2,width:o,height:l}:{x:t/2-l-2,y:-i/2+2,width:l,height:o},u=n?{...f,x:f.x+c,width:r}:{...f,y:f.y+c,height:r};return{track:f,thumb:u,travel:s}}var bc=[[10001,"ura.1ht4.2ag9.1hh5.jbb.k02.jcw.2tv.2wn.2xk.2r3.d5s.94l.ebv.kcr.b40.77k.9gp.97w.1hb5.jag.btu.jc9.hp5.bmj.blq.blq.ff9.ffk.o74.1owl.rp.mg.l3.lf.lh.qy.1a3z.2xk.2xk.2xk.2xk.2xk.17dc.1f2b.2bc.2bc.2bc.2bc.2bc.ffo.ffo.126.1fk.4mo.4mo.15e.1h2.237.2ba.2kd.2bc.4mo.4mo.4mo.4mo.1mc.1n6.2cu.1ud.2b1.2ee.1tj.1tk"],[20001,"o6.fh.kb.cr.og.sm.6x.8c.87.o7.vz.kt.qo.lg.ob.9w.mg.1kz.zc.1ex.1d5.ps.uu.su.qs.ys.zp.10k.15a.xc.uk.mx.1ax.nt.tu.19m.uj.1ku.tt.100.ie.d3.fp.ie.ie.d3.fp.ie.8p.7k.fw.h0.qc.ot.uc.ot.rk.gb.1c2.ff.cl.9v.wg.1ir.1lr.1b8.1ri.1p0.104.10n.mw.j6.jb.f1.dv.84.a0.cp.bx.1ko.1au.1ia.rs.rt.rs.t7.x6.wi.zc.16f.1i6.2jh.28d.qh.k8.1gz.1ko.2iv.1xp.1l4.1gk.10j.yo.1jk.1jk.xv.104.15o.1xg.1xg.1xi.25i.p1.t1.yh.1ak.1i6.1y2.xt.32u.3g6.1bz.2mn.14l.14c.1e1.op.s8.p2.v5.2ix.1a0.ry.16m.17n.13c.134.ys.yu.xr.sl.sr.sd.yh.z5.gd.gl.hx.h2.g8.fj.iy.hz.jj.th.12n.16r.d3.j9.dg.lj.fl.a7.f9.iw.el.27f.1dh.1rh.2ph.yd.w5.x5.tr.pq.zf.16h.1a5.17t.wy.vn.y8.wl.yv.2ye.2qt.1ah.163.19t.uf.119.2vv.1bm.13h.14p.1so.c3.as.9z.19w.1l4.1nl.rj.we"],[30001,"jo.my.ss.dw.c1.b4.hl.hl.hl.cz.dw.dw.b4.dw.fr.kd.qv.px.px.74.6u.8h.60.8q.8b.eo.eo.eo.8k.a5.99.12v.13y.lg.m4.qr.dw.ex.g0.ef.cd.br.11n.17h.1b8.1c9.9p.ag.9z.l9.m8.m8.lw.m8.cz.99.b4.8c.63.7f.6h.99.re.pp.pi.cq.c9.cp.ck.c6.b0.bd.al.f6.gl.ed.fs.lc.k6.kh.i6.cx.j1.hk.gb.d7.h7.g2.em.kj.kn.k4.j5.rh.t0.qt.mj.i7.ih.i2.hd.3r.8d.6u.6z.by.de.dg.cr.1a5.1ab.16c.18g.n2.ly.no.nt.f9.de.lr.fe.f0.fj.el.fo.t1.g9.ly.h3.g6.de.2ak.2f3.wf.kg.qn.11p.rg.uj.u6.11c.22o.2cs.3dp.3dq.3d5.3d6.1zx.18v"],[40001,"19x.215.2zt.1ex.2pj.7hy.1ur.1gn.1g7.1b1.u9.1tw.108.1ew.rs.1qu.w9.lk.244.qi.b6.tk.jg.jg.jg.y4.c1.b4.iv.hi.r4.n7.gy.ev.qe.12z.18n.dw.1l6.ou.wz.1un.19t.18k.yy.1hs.sl.dw.1vl.100.14k.1q8.209.1jk.1xr.ua.1j2.pr.26h.1gs.s9.px.15v.pf.1jk.xc.1hb.111.172.ut.285.1oh.149.zj.22r.2l9.14a.ok.23y.1eh.xe.1j0.1rp.1cz.wf.1mh.22k.334.1z2.1xo.1br.4ji.5nq.5nf.2za.18r.h3.eo.ia.1kn.dc.ss.s0.1bl.1oc.is.km.177.1ec.1ao.h4.hp.dx.l9.iw.i3.12w.n1.yq.12w.1ju.yx.14s.18b.22t.u3.my.2rb.36w.13u.z8.20r.18g.19r.2x9.w4.q2.1d2.wo.13a.v6.17w.ur.288.1b6.14m.1fi.1xx.1ee.kj.121.j2.1d2.2ad.1ri.2lc.1vk.138.12r.xj.1h5.1c5.2qx.1gj.t2.lv.rf.18q.1kz.dw.2aq.ia.1i9.k5.199.f4.10y.18a.xf.rk.1g9.1q3.10h.sj.15o.e3.dz.sv.135.w9.yg.aw.2a2.19m.22w.1c8.272.13o.104.1sr.rs.1pb.d5.df.kp.jq.1a7.s8.1ao.ba.rb.in.pz.q8.140.ij.1e7.jl.yk.117.10i.1tn.1oj.1sv.sj.1e3.2so.1c7.1gv.178.107.10n.1dx.1qi.1wp.2bc.218.16r.105.xc.z6.11w.1mc.1y9.17p.1cs.2ij.18c.1ie.nn.16c.1ce.xb.1ei.3j0.ve.14x.1sx.285.1b8.1at.v4.rv.rs.10z.xq.11o.15k.xq.u1.i2.pu.i4.l3.9u.oh.mc.nm.pw.1i3.1h4.pj.111.l4.lb.qq.qf.u0.h4.nk.yf.6h.ij.ds.oy.re.m8.1gl.cz.16z.a1.1f8.1x6.vp.dz.gp.g6.fr.vl.fr.gg.qc.aj.99.go.ij.fz.11a.x5.mo.1u9.h0.m8.10m.1an.2bc.3uw.2gk.124.xb.1uk.1b6.2xj.1os.11a.vs.1i9.1lr.2gv.265.668.1xg.45j.404.2x1.1io.3om.4q2.4mo.1d4.2bp.1pr.166.2y6.2bv.361.2nc.2bc.3g0.7g4.334.2bc.2xo.3uw.6ic.4ig.3uw.23v.1la.2zr.1jt.1cq.27a.1n1.19x.1qg.1jn.1ca.26y.2d6.4v4.4mo.4mo.7ps.1jk.153.1fo.1dm.1s2.1w1.oe.1lb.319.2eg.58p.4mo.3dw.2y2.2xm.1u8.1ko.12n.1e0.2sd.1md.2cl.1q2.372.4mo.48s.b14.3fu.334.334.34i.4nf.4ji.5eg.3uw.2u8.1g1.110.37x.2jo.su.334.3aj.3uw.63f.2bc.2bc.8v4.1ts.ax5.5du.34d.3oc.34j.4si.174.rt.1rp.2b0.37d.1ta.2gh.28a.22z.1nc.1a5.1pa.4dd.3ha.2cs.5mv.4mq.5c2.3uw.1gf.4md.113.10x.21o.2hj.1b3.1cx.1ol.3ar.1fv.17t.1a7.2uj.2we.1jk"],[50001,"1o8.1k1.mo.1wu.2c9.22d.1kb.23n.1b8.1ic.24c.2wz.1mq.1mu.1jx.1z1.o3.190.vp.1h7.th.4mo.1rp.4mo.4mo.7ps.zz.143.21v.1nf.34s.1s3.r9.18t.s1.r9.21w.277.ls.25k.5v1.2bc.1kh.wt.14i.1eq.15o.668.sh.rl.3wi.3vc.43c.3yn.17c.f5.xu.jg.176.19v.1xy.23m.18x.30c.10l.13k.v8.vp.17t.qj.17m.1wr.1la.8t.s7.18d.1l2.152.mx.1c8.1l4.1f5.1xe.rz.2hz.1et.13t.xb.14r.15o.z0.1zo.ur.257.1gb.li.12d.15a.132.1m1.3vu.296.1mg.11m.z0.159.mp.hd.x4.1go.ns.xh.2a7.tt.2vb.1bx.1kh.u3.11i.1y1.24e.2hp.2mn.1w6.3zm.166.14g.1mo.2v9.2rg.2f9.1r0.139.m1.k3.ys.1dy.29k.1mm.22m.3zx.4dr.2h7.22o.tv.rm.1et.2wv.2ar.1t7.ku.12s.10b.1v9.1gu.12m.1b3.tv.1c8.tk.10s.ul.1tt.ka.oi.qb.13f.13f.13k.17h.1uh.ez.en.2x7.2ln.2h8.3h8.ig.n9.27o.18b.hl.nm.uk.11a.1ta.1k4.1eh.wv.1go.1gg.sc.18u.1dz.2aq.vt.2l7.25h.1l5.1kn.1vc.1b4.28i.17t.1d6.1k2.18z.jy.jw.dh.1mx.fr.vp.35w.34z.35w.34z.4so.vf.yx.1bg.1d3.2yc.1tg.8q3.99g.am.2du.rm.rg.xa.2cw.xc.1j6.1if.18z.13a.yz.142.1z5.262.1bj.1y8.ur.u5.16j.1pf.1bi.l8.1il.3vz.2dr.jo.ls.18s.16l.18c.141.219.1yz.1fc.24t.27e.481.1vp.25h.1yq.1zn.1uw.11u.1jp.1pz.39o.t6.1mj.1u5.11l.1vd.1dk.1zb.1ic.3ql.14p.1wq.25x.267.zn.zn.1pf.13z.1j7.r9.1hb.4yp.1lt.1cw.1z4.19z.1og.1j4.1cl.1eg.u8.16s.1en.zu.1hr.1js.19g.303.22j.2oa.180.1v7.2ud.2d7.21s.3g9.vh.v1.284.3lg.3lg.17q.1h3.4mo.1cm.1rv.22i.2mc.2j3.27o.333.1q8.237.2ll.23b.2sp.2ll.2ox.2cf.2f8.2hz.1uo.y4.s9.w6.2dg.2q9.up.1m1.1vz.2n8.192.1eb.z7.2em.2q3.1sd.1gj.348.3vf.2iu.29x.1dc.7oj.4pq.5vb.4mx.5me.5sf.5yf.7ps.yj.q0.10w.13p.18b.2wd.11q.2vx.dd.iv.12p.jh.u9.1uy.w0.3f0.3bj.126.qo.1gj.11k.pu.22h.1z6.rp.y4.y0.xl.1d0.11s.wa.1a6.127.10m.12r.1nh.1fy.yo.1js.162.n4.174.1aj.y4.o8.qz.rh.qa.18s.mr.j3.ii.sr.sx.1jk.17l.mj.zr.uy.wa.19t.2bt.xe.1od.hs.xr.5b.12c.1ab.we.gz.mz.4y.sf.11s.e0.1l7.ew.h6.jz.l0.e8.1cx.p6.17u.bw.1ah.10r.10e.o9.1bc.uv.lq.tl.zb.100.jy.b8.bj.336.10n.na.sq.14r.yr.nm.123.tf.l1.zp.1xc.1vk.31l.zl.2bj.2b9.2fv.17p.y0.so.1ln.29c.1eh.nh.xn.131.qc.186.ff.fc.xq.1bm.la.l8.14f.243.111.xi.qw.1qn.11v.1ur.1jx.1ks.s9.nz.269.1zj.2zd.1pv.18n.2vk.p3.1fh.13v.1lf.1lu.2db.1sr.1k3.26o.1dl.1f3.187.2lh.166.v9.xh.1e3.119.s2.mt.1iu.1k6.1o2.12s.u4.2br.1q3.qv.1e4.1zu.1v4.1vk.1t3.3p7.1ob.14d.1ns.1ef.1e4.12w.2kk.1ba.2jx.1e0.1s5.12w.17r.14s.wz.1qp.183.3fb.188.1gr.2ot.168.1u7.w8.28o.1zd.32z.230.w7.vq.x8.1qh.19f.14o.2r9.qg.1ey.1qr.1p6.3a3.1ov.13d.tz.wk.22v.1qa.2l9.yw.yf.nw.p6.1ly.1jk.1nh.x9.q0.17r.17h.ux.uw.12y.p7.g7.kt.14c.ze.1kh.1eo.18a.1d8.26j.15k.19f.1ym.1j5.1c6.11k.1sd.1jp.1ws.13s.1o5.214.sx.px.20x.14h.1ja.s6.1q8.w8.1ks.so.ub.121.202.1ej.1g1.1s8.2bc.4t1.bih.3uw.3pb.avp.6c7.bko.5eg.79c.6wh.3wd.4pn.55j.4a5.3gg.bko.5ei.52p.578.bcv.6gr.2bc.4j9.5y7.9d2.2bb.2bc.668.73z.5pg.50f.5m7.788.267.642.8h2.8h2.49s.64g.5e8.5e8.2bb.3ih.5ur.6bk.578.4ck.3sg.5fe.23i.e9w.2b8.5oj.6bw.2al.2rk.2rk.5pj.n6e.350.6v9.70t.639.3uw.3uw.2bg.639.2bb.2bd.6gj.2bh.660.578.3bk.65e.359.3o0.44i.4tn.1zq.5ee.4a5.3zu.rs.639.33q.5eg.1k1.15o.dw.3uw.b7p.7qd.898.4l4.5uu.5uu.b4g.2yh.2yh.3uw.51a.51a.5kk.66f.iq9.3n7.4nb.46a.1wb.20p.bih.8xa.7ps.70t.70t.4rv.5p1.6aq.ts.63z.668.5v2.5nu.563.55s.55s.5p3.2ga.32x.42x.5cr.4c2.71b.5zp.5c2.66t.4c8.2bc.2bc.2gn.3ea.2kp.fz6.8hz.3e8.4an.bko.j7e.jag.7sr.2bc.3zx.7qd.5ut.5jp.2wk.5q7.3uw.334.4i3.3uw.4bd.5eu.46h.4i2.6t4.446.5s7.5cg.4bk.5nd.7bf.4rt.23b.2bc.2bc.2bc.2bc.2ba.4mo.4dv.3wn.2bc.1we.4he.2bc.4gz.3wn.3km.4xy.4hi.4mr.2bc.247.3yj.2c6.2bc.3aj.446.4ub.3uw.51.e0.86.is.i1.hg.mn.m4.2c.7h.sg.e3.jb.7r.eq.nf.u0.60.4o.ke.47.47.47.47.b8.4x.dr.dy.rw.rw.59.8j.5z.a5.l3.c0.ik.f7.li.lr.7x.dv.du.dd.5e.91.1b.ce.cc.59.bh.e6.8m.9n.cl.lt.7ip.4mr.4si.4kf.vo.we.13e.17n.1iw.2pi.lp.r6.gw.7x.xz.qt.bq.ls.q1.eh.bx.cr.3c.j7.b8.fz.4k.8p.bg.5w.iy.j3.12o.rs.cz.dp.yz.jk.63.63.7ps.7ps.7ps.40g.3jp.4tw.89k.88a.7s0.83d.668.7ps.2fw.2ev.2fp.7ps.2jb.2dh.2ud.25i.24c.2bt.1pa.17r.1a7.7ps.7pt.5rg.4nl.3vv.7qo.31a.2p0.2k0.49a.3v4.3nl.1ug.1ug.1l6.7s1.7ps.2cp.2f8.2i7.7ps.28q.2be.275.1ma.1oz.1q7.16s.1iq.1e0.78m.7ps.2bc.2bc.2bc.bko.2wu.2wu.2wu.3b4.38f.3uw.3uw.3uw.3uw.7ps.7qa.32n.2gg.2wk.7rv.1v3.1qq.1rb.1zk.1my.1zp.1yn.1oh.1uh.7st.9q.9q.9q.9q.9q.kk.kk.kk.kk.kk.dw.dp.dw.rs.rs.rs.rs.s4.sd.54j.5n8.2n6.21r.1nu.1o5.14u.t6.3f7.2j0.32c.304.189.1gf.18w.18j.1st.1vq.116.kw.3uw.3uw.vr.zx.xc.tc.7d.7r.9d.9w.8s.9p.3b.3b"]].map(([e,t])=>[e,t.split(".").map(i=>parseInt(i,36)/1e3)]);function Rr(e){if(!Number.isSafeInteger(e))return null;for(let[t,i]of bc)if(e>=t&&e<t+i.length)return i[e-t];return null}var ca={version:"ct-v1",catalogSha256:"fcdd2087b0ce558f90489db6c1368211d8b110e8cc755baf1efd731814a53fd4",assets:[{id:10001001,scope:"ui",width:182,height:182,loop:!0,duration:10,name:"\u96F7\u80FD\u91CF\u6EE1\u503C1",nameEn:"Electro Energy Max Value 1",video:"video/10001001.webm",icon:"icon/10001001.png",audio:[]},{id:10001002,scope:"ui",width:182,height:182,loop:!0,duration:10,name:"\u706B\u80FD\u91CF\u6EE1\u503C1",nameEn:"Pyro Energy Max Value 1",video:"video/10001002.webm",icon:"icon/10001002.png",audio:[]},{id:10001003,scope:"ui",width:174,height:182,loop:!0,duration:10,name:"\u8349\u80FD\u91CF\u6EE1\u503C1",nameEn:"Dendro Energy Max Value 1",video:"video/10001003.webm",icon:"icon/10001003.png",audio:[]},{id:10001004,scope:"ui",width:182,height:182,loop:!0,duration:10,name:"\u51B0\u80FD\u91CF\u6EE1\u503C1",nameEn:"Cryo Energy Max Value 1",video:"video/10001004.webm",icon:"icon/10001004.png",audio:[]},{id:10001005,scope:"ui",width:182,height:182,loop:!0,duration:10,name:"\u5CA9\u80FD\u91CF\u6EE1\u503C1",nameEn:"Geo Energy Max Value 1",video:"video/10001005.webm",icon:"icon/10001005.png",audio:[]},{id:10001006,scope:"ui",width:186,height:186,loop:!0,duration:10,name:"\u6C34\u80FD\u91CF\u6EE1\u503C1",nameEn:"Hydro Energy Max Value 1",video:"video/10001006.webm",icon:"icon/10001006.png",audio:[]},{id:10001007,scope:"ui",width:182,height:182,loop:!0,duration:10,name:"\u98CE\u80FD\u91CF\u6EE1\u503C1",nameEn:"Anemo Energy Max Value 1",video:"video/10001007.webm",icon:"icon/10001007.png",audio:[]},{id:10001008,scope:"ui",width:224,height:224,loop:!1,duration:1.3,name:"\u53EF\u7528\u63D0\u793A1",nameEn:"Available Hint 1",video:"video/10001008.webm",icon:"icon/10001008.png",audio:[]},{id:10001009,scope:"ui",width:224,height:224,loop:!1,duration:1.3,name:"\u53EF\u7528\u63D0\u793A2",nameEn:"Available Hint 2",video:"video/10001009.webm",icon:"icon/10001009.png",audio:[]},{id:10001010,scope:"ui",width:176,height:176,loop:!0,duration:10,name:"\u96F7\u80FD\u91CF\u6EE1\u503C2",nameEn:"Electro Energy Max Value 2",video:"video/10001010.webm",icon:"icon/10001010.png",audio:[]},{id:10001011,scope:"ui",width:182,height:182,loop:!0,duration:10,name:"\u706B\u80FD\u91CF\u6EE1\u503C2",nameEn:"Pyro Energy Max Value 2",video:"video/10001011.webm",icon:"icon/10001011.png",audio:[]},{id:10001012,scope:"ui",width:162,height:162,loop:!0,duration:10,name:"\u8349\u80FD\u91CF\u6EE1\u503C2",nameEn:"Dendro Energy Max Value 2",video:"video/10001012.webm",icon:"icon/10001012.png",audio:[]},{id:10001013,scope:"ui",width:176,height:184,loop:!0,duration:10,name:"\u51B0\u80FD\u91CF\u6EE1\u503C2",nameEn:"Cryo Energy Max Value 2",video:"video/10001013.webm",icon:"icon/10001013.png",audio:[]},{id:10001014,scope:"ui",width:170,height:170,loop:!0,duration:10,name:"\u5CA9\u80FD\u91CF\u6EE1\u503C2",nameEn:"Geo Energy Max Value 2",video:"video/10001014.webm",icon:"icon/10001014.png",audio:[]},{id:10001015,scope:"ui",width:186,height:186,loop:!0,duration:10,name:"\u6C34\u80FD\u91CF\u6EE1\u503C2",nameEn:"Hydro Energy Max Value 2",video:"video/10001015.webm",icon:"icon/10001015.png",audio:[]},{id:10001016,scope:"ui",width:180,height:180,loop:!0,duration:10,name:"\u98CE\u80FD\u91CF\u6EE1\u503C2",nameEn:"Anemo Energy Max Value 2",video:"video/10001016.webm",icon:"icon/10001016.png",audio:[]},{id:10001017,scope:"ui",width:300,height:280,loop:!0,duration:10,name:"\u80FD\u91CF\u6EE1\u503C1",nameEn:"Energy Max Value 1",video:"video/10001017.webm",icon:"icon/10001017.png",audio:["audio/10001017.mp3"]},{id:10001018,scope:"ui",width:220,height:226,loop:!0,duration:10,name:"\u80FD\u91CF\u6EE1\u503C2",nameEn:"Energy Max Value 2",video:"video/10001018.webm",icon:"icon/10001018.png",audio:[]},{id:10001019,scope:"ui",width:220,height:226,loop:!0,duration:10,name:"\u80FD\u91CF\u6EE1\u503C3",nameEn:"Energy Max Value 3",video:"video/10001019.webm",icon:"icon/10001019.png",audio:[]},{id:10001020,scope:"ui",width:210,height:216,loop:!0,duration:10,name:"\u80FD\u91CF\u6EE1\u503C4",nameEn:"Energy Max Value 4",video:"video/10001020.webm",icon:"icon/10001020.png",audio:[]},{id:10001021,scope:"ui",width:216,height:220,loop:!0,duration:10,name:"\u80FD\u91CF\u6EE1\u503C5",nameEn:"Energy Max Value 5",video:"video/10001021.webm",icon:"icon/10001021.png",audio:[]},{id:10001022,scope:"ui",width:216,height:220,loop:!0,duration:10,name:"\u80FD\u91CF\u6EE1\u503C6",nameEn:"Energy Max Value 6",video:"video/10001022.webm",icon:"icon/10001022.png",audio:[]},{id:10001023,scope:"ui",width:216,height:220,loop:!0,duration:10,name:"\u80FD\u91CF\u6EE1\u503C7",nameEn:"Energy Max Value 7",video:"video/10001023.webm",icon:"icon/10001023.png",audio:[]},{id:10001024,scope:"ui",width:134,height:134,loop:!0,duration:10,name:"\u96F7\u5143\u7D20\u5171\u9E23",nameEn:"Electro Elemental Resonance",video:"video/10001024.webm",icon:"icon/10001024.png",audio:[]},{id:10001025,scope:"ui",width:130,height:134,loop:!0,duration:10,name:"\u706B\u5143\u7D20\u5171\u9E23",nameEn:"Pyro Elemental Resonance",video:"video/10001025.webm",icon:"icon/10001025.png",audio:[]},{id:10001026,scope:"ui",width:130,height:130,loop:!0,duration:10,name:"\u8349\u5143\u7D20\u5171\u9E23",nameEn:"Dendro Elemental Resonance",video:"video/10001026.webm",icon:"icon/10001026.png",audio:[]},{id:10001027,scope:"ui",width:128,height:128,loop:!0,duration:10,name:"\u51B0\u5143\u7D20\u5171\u9E23",nameEn:"Cryo Elemental Resonance",video:"video/10001027.webm",icon:"icon/10001027.png",audio:[]},{id:10001028,scope:"ui",width:130,height:130,loop:!0,duration:10,name:"\u5CA9\u5143\u7D20\u5171\u9E23",nameEn:"Geo Elemental Resonance",video:"video/10001028.webm",icon:"icon/10001028.png",audio:[]},{id:10001029,scope:"ui",width:130,height:134,loop:!0,duration:10,name:"\u6C34\u5143\u7D20\u5171\u9E23",nameEn:"Hydro Elemental Resonance",video:"video/10001029.webm",icon:"icon/10001029.png",audio:[]},{id:10001030,scope:"ui",width:130,height:130,loop:!0,duration:10,name:"\u98CE\u5143\u7D20\u5171\u9E23",nameEn:"Anemo Elemental Resonance",video:"video/10001030.webm",icon:"icon/10001030.png",audio:[]},{id:10001031,scope:"ui",width:156,height:160,loop:!1,duration:1,name:"\u6C34\u70AE\u6548\u679C1",nameEn:"Hydro Cannon Effect 1",video:"video/10001031.webm",icon:"icon/10001031.png",audio:[]},{id:10001032,scope:"ui",width:216,height:216,loop:!1,duration:.933,name:"\u6C34\u70AE\u6548\u679C2",nameEn:"Hydro Cannon Effect 2",video:"video/10001032.webm",icon:"icon/10001032.png",audio:["audio/10001032.mp3"]},{id:10001033,scope:"ui",width:488,height:488,loop:!1,duration:1.2,name:"\u97F3\u7B26\u6548\u679C1",nameEn:"Note Effect 1",video:"video/10001033.webm",icon:"icon/10001033.png",audio:[]},{id:10001034,scope:"ui",width:536,height:536,loop:!1,duration:1.4,name:"\u97F3\u7B26\u6548\u679C2",nameEn:"Note Effect 2",video:"video/10001034.webm",icon:"icon/10001034.png",audio:[]},{id:10001035,scope:"ui",width:262,height:266,loop:!0,duration:10,name:"\u97F3\u7B26\u6548\u679C3",nameEn:"Note Effect 3",video:"video/10001035.webm",icon:"icon/10001035.png",audio:[]},{id:10001036,scope:"ui",width:536,height:536,loop:!1,duration:1.4,name:"\u97F3\u7B26\u6548\u679C4",nameEn:"Note Effect 4",video:"video/10001036.webm",icon:"icon/10001036.png",audio:[]},{id:10001037,scope:"ui",width:262,height:266,loop:!0,duration:10,name:"\u97F3\u7B26\u6548\u679C5",nameEn:"Note Effect 5",video:"video/10001037.webm",icon:"icon/10001037.png",audio:[]},{id:10001038,scope:"ui",width:190,height:190,loop:!0,duration:10,name:"\u6269\u6563\u6548\u679C1",nameEn:"Swirl Effect 1",video:"video/10001038.webm",icon:"icon/10001038.png",audio:[]},{id:10001039,scope:"ui",width:208,height:208,loop:!1,duration:.766,name:"\u70B9\u51FB\u6548\u679C1",nameEn:"Press Effect 1",video:"video/10001039.webm",icon:"icon/10001039.png",audio:[]},{id:10001040,scope:"ui",width:390,height:390,loop:!1,duration:1.2,name:"\u8F6C\u6362\u6548\u679C1",nameEn:"Conversion Effect 1",video:"video/10001040.webm",icon:"icon/10001040.png",audio:["audio/10001040.mp3"]},{id:10001041,scope:"ui",width:208,height:208,loop:!0,duration:10,name:"\u8F6C\u6362\u6548\u679C2",nameEn:"Conversion Effect 2",video:"video/10001041.webm",icon:"icon/10001041.png",audio:[]},{id:10001042,scope:"ui",width:208,height:208,loop:!0,duration:10,name:"\u8F6C\u6362\u6548\u679C3",nameEn:"Conversion Effect 3",video:"video/10001042.webm",icon:"icon/10001042.png",audio:[]},{id:10001043,scope:"ui",width:168,height:180,loop:!1,duration:1.233,name:"\u70B9\u51FB\u6548\u679C2",nameEn:"Press Effect 2",video:"video/10001043.webm",icon:"icon/10001043.png",audio:["audio/10001043.mp3","audio/10001043_02.mp3"]},{id:10001044,scope:"ui",width:190,height:198,loop:!1,duration:1.566,name:"\u70B9\u51FB\u6548\u679C3",nameEn:"Press Effect 3",video:"video/10001044.webm",icon:"icon/10001044.png",audio:[]},{id:10001045,scope:"ui",width:114,height:114,loop:!1,duration:.733,name:"\u70B9\u51FB\u6548\u679C4",nameEn:"Press Effect 4",video:"video/10001045.webm",icon:"icon/10001045.png",audio:[]},{id:10001046,scope:"ui",width:106,height:122,loop:!1,duration:.8,name:"\u70B9\u51FB\u6548\u679C5",nameEn:"Press Effect 5",video:"video/10001046.webm",icon:"icon/10001046.png",audio:[]},{id:10001047,scope:"ui",width:114,height:114,loop:!1,duration:.733,name:"\u70B9\u51FB\u6548\u679C6",nameEn:"Press Effect 6",video:"video/10001047.webm",icon:"icon/10001047.png",audio:[]},{id:10001048,scope:"ui",width:114,height:114,loop:!1,duration:.733,name:"\u70B9\u51FB\u6548\u679C7",nameEn:"Press Effect 7",video:"video/10001048.webm",icon:"icon/10001048.png",audio:[]},{id:10001049,scope:"ui",width:130,height:118,loop:!1,duration:1,name:"\u70B9\u51FB\u6548\u679C8",nameEn:"Press Effect 8",video:"video/10001049.webm",icon:"icon/10001049.png",audio:[]},{id:10001050,scope:"ui",width:114,height:114,loop:!1,duration:.733,name:"\u70B9\u51FB\u6548\u679C9",nameEn:"Press Effect 9",video:"video/10001050.webm",icon:"icon/10001050.png",audio:[]},{id:10001051,scope:"ui",width:408,height:408,loop:!0,duration:10,name:"\u9AD8\u4EAE\u6548\u679C1",nameEn:"Highlight Effect 1",video:"video/10001051.webm",icon:"icon/10001051.png",audio:[]},{id:10001052,scope:"ui",width:272,height:272,loop:!1,duration:.9,name:"\u95EA\u70C1\u6548\u679C1",nameEn:"Blink Effect 1",video:"video/10001052.webm",icon:"icon/10001052.png",audio:[]},{id:10001053,scope:"ui",width:176,height:194,loop:!0,duration:10,name:"\u9AD8\u4EAE\u6548\u679C2",nameEn:"Highlight Effect 2",video:"video/10001053.webm",icon:"icon/10001053.png",audio:[]},{id:10001054,scope:"ui",width:274,height:286,loop:!1,duration:1,name:"\u95EA\u70C1\u6548\u679C2",nameEn:"Blink Effect 2",video:"video/10001054.webm",icon:"icon/10001054.png",audio:[]},{id:10001055,scope:"ui",width:368,height:368,loop:!1,duration:1,name:"\u95EA\u70C1\u6548\u679C3",nameEn:"Blink Effect 3",video:"video/10001055.webm",icon:"icon/10001055.png",audio:[]},{id:10001056,scope:"ui",width:226,height:210,loop:!0,duration:10,name:"\u9AD8\u4EAE\u6548\u679C3",nameEn:"Highlight Effect 3",video:"video/10001056.webm",icon:"icon/10001056.png",audio:[]},{id:10001057,scope:"ui",width:304,height:304,loop:!1,duration:.966,name:"\u8F6C\u6362\u6548\u679C4",nameEn:"Conversion Effect 4",video:"video/10001057.webm",icon:"icon/10001057.png",audio:["audio/10001057.mp3"]},{id:10001058,scope:"ui",width:174,height:178,loop:!1,duration:1.6,name:"\u95EA\u70C1\u6548\u679C4",nameEn:"Blink Effect 4",video:"video/10001058.webm",icon:"icon/10001058.png",audio:[]},{id:10001059,scope:"ui",width:362,height:362,loop:!1,duration:1.766,name:"\u95EA\u70C1\u6548\u679C5",nameEn:"Blink Effect 5",video:"video/10001059.webm",icon:"icon/10001059.png",audio:["audio/10001059.mp3"]},{id:10001060,scope:"ui",width:190,height:192,loop:!0,duration:10,name:"\u95EA\u70C1\u6548\u679C6",nameEn:"Blink Effect 6",video:"video/10001060.webm",icon:"icon/10001060.png",audio:[]},{id:10001061,scope:"ui",width:890,height:456,loop:!1,duration:1,name:"\u95EA\u70C1\u6548\u679C7",nameEn:"Blink Effect 7",video:"video/10001061.webm",icon:"icon/10001061.png",audio:[]},{id:10001062,scope:"ui",width:890,height:646,loop:!1,duration:1,name:"\u95EA\u70C1\u6548\u679C8",nameEn:"Blink Effect 8",video:"video/10001062.webm",icon:"icon/10001062.png",audio:[]},{id:10001063,scope:"ui",width:290,height:290,loop:!0,duration:10,name:"\u9AD8\u4EAE\u6548\u679C4",nameEn:"Highlight Effect 4",video:"video/10001063.webm",icon:"icon/10001063.png",audio:[]},{id:10001064,scope:"ui",width:272,height:272,loop:!1,duration:.866,name:"\u6D88\u9664\u6548\u679C1",nameEn:"Clear Effect 1",video:"video/10001064.webm",icon:"icon/10001064.png",audio:[]},{id:10001065,scope:"ui",width:272,height:272,loop:!1,duration:.9,name:"\u6D88\u9664\u6548\u679C2",nameEn:"Clear Effect 2",video:"video/10001065.webm",icon:"icon/10001065.png",audio:[]},{id:10001066,scope:"ui",width:238,height:210,loop:!1,duration:1.066,name:"\u6D88\u9664\u6548\u679C3",nameEn:"Clear Effect 3",video:"video/10001066.webm",icon:"icon/10001066.png",audio:[]},{id:10001067,scope:"ui",width:154,height:154,loop:!0,duration:10,name:"\u95EA\u70C1\u6548\u679C9",nameEn:"Blink Effect 9",video:"video/10001067.webm",icon:"icon/10001067.png",audio:[]},{id:10001068,scope:"ui",width:484,height:484,loop:!1,duration:1,name:"\u95EA\u70C1\u6548\u679C10",nameEn:"Blink Effect 10",video:"video/10001068.webm",icon:"icon/10001068.png",audio:[]},{id:10001069,scope:"ui",width:326,height:326,loop:!0,duration:10,name:"\u9AD8\u4EAE\u6548\u679C5",nameEn:"Highlight Effect 5",video:"video/10001069.webm",icon:"icon/10001069.png",audio:[]},{id:10001070,scope:"ui",width:206,height:196,loop:!0,duration:10,name:"\u9AD8\u4EAE\u6548\u679C6",nameEn:"Highlight Effect 6",video:"video/10001070.webm",icon:"icon/10001070.png",audio:[]},{id:10001071,scope:"ui",width:2236,height:2236,loop:!0,duration:10,name:"\u6C1B\u56F4\u6548\u679C1",nameEn:"Ambience Effect 1",video:"video/10001071.webm",icon:"icon/10001071.png",audio:[]},{id:10001072,scope:"ui",width:406,height:406,loop:!0,duration:10,name:"\u6C1B\u56F4\u6548\u679C2",nameEn:"Ambience Effect 2",video:"video/10001072.webm",icon:"icon/10001072.png",audio:[]},{id:10001073,scope:"ui",width:376,height:336,loop:!1,duration:2.1,name:"\u95EA\u70C1\u6548\u679C11",nameEn:"Blink Effect 11",video:"video/10001073.webm",icon:"icon/10001073.png",audio:[]},{id:10001074,scope:"ui",width:258,height:228,loop:!1,duration:1.666,name:"\u95EA\u70C1\u6548\u679C12",nameEn:"Blink Effect 12",video:"video/10001074.webm",icon:"icon/10001074.png",audio:[]},{id:10001075,scope:"ui",width:322,height:322,loop:!0,duration:10,name:"\u9AD8\u4EAE\u6548\u679C7",nameEn:"Highlight Effect 7",video:"video/10001075.webm",icon:"icon/10001075.png",audio:[]},{id:10001076,scope:"ui",width:258,height:270,loop:!1,duration:1.2,name:"\u4E92\u52A8\u6548\u679C1",nameEn:"Interaction Effect 1",video:"video/10001076.webm",icon:"icon/10001076.png",audio:[]},{id:10001077,scope:"ui",width:126,height:118,loop:!1,duration:1.1,name:"\u88C5\u9970\u6548\u679C1",nameEn:"Decoration Effect 1",video:"video/10001077.webm",icon:"icon/10001077.png",audio:[]},{id:10001078,scope:"ui",width:220,height:248,loop:!1,duration:1.133,name:"\u88C5\u9970\u6548\u679C2",nameEn:"Decoration Effect 2",video:"video/10001078.webm",icon:"icon/10001078.png",audio:[]},{id:10001079,scope:"ui",width:234,height:232,loop:!1,duration:1.166,name:"\u88C5\u9970\u6548\u679C3",nameEn:"Decoration Effect 3",video:"video/10001079.webm",icon:"icon/10001079.png",audio:[]},{id:10001080,scope:"ui",width:582,height:550,loop:!0,duration:10,name:"\u88C5\u9970\u6548\u679C4",nameEn:"Decoration Effect 4",video:"video/10001080.webm",icon:"icon/10001080.png",audio:[]},{id:10001081,scope:"ui",width:388,height:400,loop:!0,duration:10,name:"\u88C5\u9970\u6548\u679C5",nameEn:"Decoration Effect 5",video:"video/10001081.webm",icon:"icon/10001081.png",audio:[]},{id:10001082,scope:"ui",width:386,height:386,loop:!0,duration:10,name:"\u88C5\u9970\u6548\u679C6",nameEn:"Decoration Effect 6",video:"video/10001082.webm",icon:"icon/10001082.png",audio:[]},{id:10001083,scope:"ui",width:196,height:196,loop:!1,duration:1.2,name:"\u88C5\u9970\u6548\u679C7",nameEn:"Decoration Effect 7",video:"video/10001083.webm",icon:"icon/10001083.png",audio:[]},{id:10001084,scope:"ui",width:496,height:462,loop:!1,duration:.7,name:"\u95EA\u70C1\u6548\u679C13",nameEn:"Blink Effect 13",video:"video/10001084.webm",icon:"icon/10001084.png",audio:[]},{id:10001085,scope:"ui",width:426,height:336,loop:!1,duration:.566,name:"\u95EA\u70C1\u6548\u679C14",nameEn:"Blink Effect 14",video:"video/10001085.webm",icon:"icon/10001085.png",audio:[]},{id:10001086,scope:"ui",width:266,height:190,loop:!1,duration:.866,name:"\u88C5\u9970\u6548\u679C8",nameEn:"Decoration Effect 8",video:"video/10001086.webm",icon:"icon/10001086.png",audio:[]},{id:10001087,scope:"ui",width:310,height:252,loop:!1,duration:1.166,name:"\u88C5\u9970\u6548\u679C9",nameEn:"Decoration Effect 9",video:"video/10001087.webm",icon:"icon/10001087.png",audio:[]},{id:10001088,scope:"ui",width:310,height:252,loop:!1,duration:1.166,name:"\u88C5\u9970\u6548\u679C10",nameEn:"Decoration Effect 10",video:"video/10001088.webm",icon:"icon/10001088.png",audio:[]},{id:10001089,scope:"ui",width:178,height:74,loop:!1,duration:1.966,name:"\u88C5\u9970\u6548\u679C11",nameEn:"Decoration Effect 11",video:"video/10001089.webm",icon:"icon/10001089.png",audio:[]},{id:10001090,scope:"ui",width:190,height:190,loop:!1,duration:1.166,name:"\u95EA\u70C1\u6548\u679C15",nameEn:"Blink Effect 15",video:"video/10001090.webm",icon:"icon/10001090.png",audio:[]},{id:10001091,scope:"ui",width:188,height:188,loop:!1,duration:1.6,name:"\u95EA\u70C1\u6548\u679C16",nameEn:"Blink Effect 16",video:"video/10001091.webm",icon:"icon/10001091.png",audio:[]},{id:10001092,scope:"ui",width:200,height:200,loop:!0,duration:10,name:"\u88C5\u9970\u6548\u679C12",nameEn:"Decoration Effect 12",video:"video/10001092.webm",icon:"icon/10001092.png",audio:[]},{id:10001093,scope:"ui",width:294,height:302,loop:!1,duration:1.033,name:"\u88C5\u9970\u6548\u679C13",nameEn:"Decoration Effect 13",video:"video/10001093.webm",icon:"icon/10001093.png",audio:[]},{id:10001094,scope:"ui",width:310,height:310,loop:!1,duration:.833,name:"\u88C5\u9970\u6548\u679C14",nameEn:"Decoration Effect 14",video:"video/10001094.webm",icon:"icon/10001094.png",audio:[]},{id:10001095,scope:"ui",width:252,height:300,loop:!1,duration:1.8,name:"\u88C5\u9970\u6548\u679C15",nameEn:"Decoration Effect 15",video:"video/10001095.webm",icon:"icon/10001095.png",audio:[]},{id:10001096,scope:"ui",width:252,height:252,loop:!1,duration:1.6,name:"\u88C5\u9970\u6548\u679C16",nameEn:"Decoration Effect 16",video:"video/10001096.webm",icon:"icon/10001096.png",audio:[]},{id:10001097,scope:"ui",width:252,height:252,loop:!1,duration:1.6,name:"\u88C5\u9970\u6548\u679C17",nameEn:"Decoration Effect 17",video:"video/10001097.webm",icon:"icon/10001097.png",audio:[]},{id:10001098,scope:"ui",width:252,height:252,loop:!1,duration:1.6,name:"\u88C5\u9970\u6548\u679C18",nameEn:"Decoration Effect 18",video:"video/10001098.webm",icon:"icon/10001098.png",audio:[]},{id:10001099,scope:"ui",width:252,height:252,loop:!1,duration:1.6,name:"\u88C5\u9970\u6548\u679C19",nameEn:"Decoration Effect 19",video:"video/10001099.webm",icon:"icon/10001099.png",audio:[]},{id:10001100,scope:"ui",width:252,height:252,loop:!1,duration:1.6,name:"\u88C5\u9970\u6548\u679C20",nameEn:"Decoration Effect 20",video:"video/10001100.webm",icon:"icon/10001100.png",audio:[]},{id:10001101,scope:"ui",width:252,height:252,loop:!1,duration:1.6,name:"\u88C5\u9970\u6548\u679C21",nameEn:"Decoration Effect 21",video:"video/10001101.webm",icon:"icon/10001101.png",audio:[]},{id:10001102,scope:"ui",width:260,height:260,loop:!1,duration:1.133,name:"\u9AD8\u4EAE\u6548\u679C8",nameEn:"Highlight Effect 8",video:"video/10001102.webm",icon:"icon/10001102.png",audio:[]},{id:10001103,scope:"ui",width:260,height:260,loop:!1,duration:1.166,name:"\u9AD8\u4EAE\u6548\u679C9",nameEn:"Highlight Effect 9",video:"video/10001103.webm",icon:"icon/10001103.png",audio:[]},{id:10001104,scope:"ui",width:322,height:344,loop:!1,duration:1.133,name:"\u9AD8\u4EAE\u6548\u679C10",nameEn:"Highlight Effect 10",video:"video/10001104.webm",icon:"icon/10001104.png",audio:[]},{id:10001105,scope:"ui",width:380,height:394,loop:!1,duration:1.133,name:"\u9AD8\u4EAE\u6548\u679C11",nameEn:"Highlight Effect 11",video:"video/10001105.webm",icon:"icon/10001105.png",audio:[]},{id:10001106,scope:"ui",width:176,height:140,loop:!0,duration:10,name:"\u6C1B\u56F4\u6548\u679C3",nameEn:"Ambience Effect 3",video:"video/10001106.webm",icon:"icon/10001106.png",audio:[]},{id:10001107,scope:"ui",width:136,height:136,loop:!1,duration:.8,name:"\u95EA\u70C1\u6548\u679C17",nameEn:"Blink Effect 17",video:"video/10001107.webm",icon:"icon/10001107.png",audio:["audio/10001107.mp3"]},{id:10001108,scope:"ui",width:206,height:212,loop:!1,duration:1.7,name:"\u95EA\u70C1\u6548\u679C18",nameEn:"Blink Effect 18",video:"video/10001108.webm",icon:"icon/10001108.png",audio:["audio/10001108.mp3"]},{id:10001109,scope:"ui",width:182,height:182,loop:!1,duration:1.666,name:"\u95EA\u70C1\u6548\u679C19",nameEn:"Blink Effect 19",video:"video/10001109.webm",icon:"icon/10001109.png",audio:[]},{id:10001110,scope:"ui",width:650,height:306,loop:!1,duration:1.533,name:"\u95EA\u70C1\u6548\u679C20",nameEn:"Blink Effect 20",video:"video/10001110.webm",icon:"icon/10001110.png",audio:["audio/10001110.mp3"]},{id:10001111,scope:"ui",width:742,height:494,loop:!1,duration:.9,name:"\u95EA\u70C1\u6548\u679C21",nameEn:"Blink Effect 21",video:"video/10001111.webm",icon:"icon/10001111.png",audio:["audio/10001111.mp3"]},{id:10001112,scope:"ui",width:872,height:462,loop:!1,duration:.9,name:"\u95EA\u70C1\u6548\u679C22",nameEn:"Blink Effect 22",video:"video/10001112.webm",icon:"icon/10001112.png",audio:["audio/10001112.mp3"]},{id:10001113,scope:"ui",width:182,height:182,loop:!1,duration:1.166,name:"\u95EA\u70C1\u6548\u679C23",nameEn:"Blink Effect 23",video:"video/10001113.webm",icon:"icon/10001113.png",audio:[]},{id:10001114,scope:"ui",width:116,height:228,loop:!0,duration:10,name:"\u8FDB\u5EA6\u7D2F\u79EF1",nameEn:"Progress Accumulation 1",video:"video/10001114.webm",icon:"icon/10001114.png",audio:[]},{id:10001115,scope:"ui",width:520,height:676,loop:!1,duration:1.133,name:"\u8FDB\u5EA6\u7D2F\u79EF2",nameEn:"Progress Accumulation 2",video:"video/10001115.webm",icon:"icon/10001115.png",audio:[]},{id:10001116,scope:"ui",width:88,height:88,loop:!0,duration:10,name:"\u8FDB\u5EA6\u7D2F\u79EF3",nameEn:"Progress Accumulation 3",video:"video/10001116.webm",icon:"icon/10001116.png",audio:[]},{id:10001117,scope:"ui",width:166,height:278,loop:!1,duration:1.466,name:"\u95EA\u70C1\u6548\u679C24",nameEn:"Blink Effect 24",video:"video/10001117.webm",icon:"icon/10001117.png",audio:[]},{id:10001118,scope:"ui",width:106,height:106,loop:!0,duration:10,name:"\u95EA\u70C1\u6548\u679C25",nameEn:"Blink Effect 25",video:"video/10001118.webm",icon:"icon/10001118.png",audio:[]},{id:10001119,scope:"ui",width:118,height:118,loop:!0,duration:10,name:"\u95EA\u70C1\u6548\u679C26",nameEn:"Blink Effect 26",video:"video/10001119.webm",icon:"icon/10001119.png",audio:[]},{id:10001120,scope:"ui",width:130,height:118,loop:!1,duration:1.566,name:"\u95EA\u70C1\u6548\u679C27",nameEn:"Blink Effect 27",video:"video/10001120.webm",icon:"icon/10001120.png",audio:["audio/10001120.mp3","audio/10001120_02.mp3","audio/10001120_03.mp3","audio/10001120_04.mp3","audio/10001120_05.mp3","audio/10001120_06.mp3","audio/10001120_07.mp3","audio/10001120_08.mp3","audio/10001120_09.mp3","audio/10001120_10.mp3","audio/10001120_11.mp3"]},{id:10001121,scope:"ui",width:376,height:400,loop:!1,duration:1.333,name:"\u95EA\u70C1\u6548\u679C28",nameEn:"Blink Effect 28",video:"video/10001121.webm",icon:"icon/10001121.png",audio:[]},{id:10001122,scope:"ui",width:986,height:706,loop:!1,duration:2.6,name:"\u95EA\u70C1\u6548\u679C29",nameEn:"Blink Effect 29",video:"video/10001122.webm",icon:"icon/10001122.png",audio:[]},{id:10001124,scope:"ui",width:2334,height:2714,loop:!1,duration:1.4,name:"\u7ED3\u7B97\u6548\u679C1",nameEn:"Settlement Effect 1",video:"video/10001124.webm",icon:"icon/10001124.png",audio:[]},{id:10001125,scope:"ui",width:2214,height:2270,loop:!1,duration:1.233,name:"\u7ED3\u7B97\u6548\u679C2",nameEn:"Settlement Effect 2",video:"video/10001125.webm",icon:"icon/10001125.png",audio:[]},{id:10001126,scope:"ui",width:2574,height:1178,loop:!1,duration:3.133,name:"\u7ED3\u7B97\u6548\u679C3",nameEn:"Settlement Effect 3",video:"video/10001126.webm",icon:"icon/10001126.png",audio:[]},{id:10001127,scope:"ui",width:1918,height:1138,loop:!1,duration:3.066,name:"\u7ED3\u7B97\u6548\u679C4",nameEn:"Settlement Effect 4",video:"video/10001127.webm",icon:"icon/10001127.png",audio:[]},{id:10001128,scope:"ui",width:548,height:212,loop:!1,duration:1.966,name:"\u95EA\u70C1\u6548\u679C30",nameEn:"Blink Effect 30",video:"video/10001128.webm",icon:"icon/10001128.png",audio:[]},{id:10001129,scope:"ui",width:638,height:520,loop:!1,duration:1.133,name:"\u95EA\u70C1\u6548\u679C31",nameEn:"Blink Effect 31",video:"video/10001129.webm",icon:"icon/10001129.png",audio:["audio/10001129.mp3"]},{id:10001130,scope:"ui",width:284,height:142,loop:!1,duration:1.2,name:"\u95EA\u70C1\u6548\u679C32",nameEn:"Blink Effect 32",video:"video/10001130.webm",icon:"icon/10001130.png",audio:[]},{id:10001131,scope:"ui",width:790,height:790,loop:!0,duration:10,name:"\u95EA\u70C1\u6548\u679C33",nameEn:"Blink Effect 33",video:"video/10001131.webm",icon:"icon/10001131.png",audio:["audio/10001131.mp3"]},{id:10001132,scope:"ui",width:1020,height:264,loop:!0,duration:10,name:"\u95EA\u70C1\u6548\u679C34",nameEn:"Blink Effect 34",video:"video/10001132.webm",icon:"icon/10001132.png",audio:[]},{id:10001133,scope:"ui",width:1348,height:358,loop:!1,duration:1.5,name:"\u7ED3\u7B97\u6548\u679C5",nameEn:"Settlement Effect 5",video:"video/10001133.webm",icon:"icon/10001133.png",audio:[]},{id:10001134,scope:"ui",width:1116,height:290,loop:!1,duration:2,name:"\u95EA\u70C1\u6548\u679C35",nameEn:"Blink Effect 35",video:"video/10001134.webm",icon:"icon/10001134.png",audio:["audio/10001134.mp3"]},{id:10001135,scope:"ui",width:1116,height:290,loop:!1,duration:2,name:"\u95EA\u70C1\u6548\u679C36",nameEn:"Blink Effect 36",video:"video/10001135.webm",icon:"icon/10001135.png",audio:["audio/10001135.mp3"]},{id:10001136,scope:"ui",width:1520,height:296,loop:!1,duration:1.466,name:"\u95EA\u70C1\u6548\u679C37",nameEn:"Blink Effect 37",video:"video/10001136.webm",icon:"icon/10001136.png",audio:[]},{id:10001137,scope:"ui",width:2266,height:706,loop:!1,duration:2.066,name:"\u95EA\u70C1\u6548\u679C38",nameEn:"Blink Effect 38",video:"video/10001137.webm",icon:"icon/10001137.png",audio:[]},{id:10001138,scope:"ui",width:912,height:192,loop:!1,duration:2.033,name:"\u95EA\u70C1\u6548\u679C39",nameEn:"Blink Effect 39",video:"video/10001138.webm",icon:"icon/10001138.png",audio:[]},{id:10001139,scope:"ui",width:912,height:192,loop:!1,duration:2.033,name:"\u95EA\u70C1\u6548\u679C40",nameEn:"Blink Effect 40",video:"video/10001139.webm",icon:"icon/10001139.png",audio:[]},{id:10001140,scope:"ui",width:912,height:174,loop:!1,duration:2.033,name:"\u95EA\u70C1\u6548\u679C41",nameEn:"Blink Effect 41",video:"video/10001140.webm",icon:"icon/10001140.png",audio:[]},{id:10001141,scope:"ui",width:912,height:102,loop:!1,duration:2.033,name:"\u95EA\u70C1\u6548\u679C42",nameEn:"Blink Effect 42",video:"video/10001141.webm",icon:"icon/10001141.png",audio:[]},{id:10001142,scope:"ui",width:1766,height:1542,loop:!1,duration:3.8,name:"\u95EA\u70C1\u6548\u679C43",nameEn:"Blink Effect 43",video:"video/10001142.webm",icon:"icon/10001142.png",audio:[]},{id:10001143,scope:"ui",width:1312,height:168,loop:!1,duration:1.066,name:"\u95EA\u70C1\u6548\u679C44",nameEn:"Blink Effect 44",video:"video/10001143.webm",icon:"icon/10001143.png",audio:["audio/10001143.mp3","audio/10001143_02.mp3"]},{id:10001144,scope:"ui",width:698,height:82,loop:!1,duration:2.233,name:"\u95EA\u70C1\u6548\u679C45",nameEn:"Blink Effect 45",video:"video/10001144.webm",icon:"icon/10001144.png",audio:[]},{id:10001145,scope:"ui",width:698,height:92,loop:!1,duration:2.266,name:"\u95EA\u70C1\u6548\u679C46",nameEn:"Blink Effect 46",video:"video/10001145.webm",icon:"icon/10001145.png",audio:[]},{id:10001146,scope:"ui",width:698,height:92,loop:!1,duration:2.266,name:"\u95EA\u70C1\u6548\u679C47",nameEn:"Blink Effect 47",video:"video/10001146.webm",icon:"icon/10001146.png",audio:[]},{id:10001147,scope:"ui",width:306,height:54,loop:!0,duration:10,name:"\u8FDB\u5EA6\u7D2F\u79EF4",nameEn:"Progress Accumulation 4",video:"video/10001147.webm",icon:"icon/10001147.png",audio:[]},{id:10001148,scope:"ui",width:934,height:194,loop:!1,duration:1.233,name:"\u8FDB\u5EA6\u7D2F\u79EF5",nameEn:"Progress Accumulation 5",video:"video/10001148.webm",icon:"icon/10001148.png",audio:[]},{id:10001149,scope:"ui",width:616,height:248,loop:!0,duration:10,name:"\u95EA\u70C1\u6548\u679C48",nameEn:"Blink Effect 48",video:"video/10001149.webm",icon:"icon/10001149.png",audio:[]},{id:10001150,scope:"ui",width:746,height:228,loop:!1,duration:1.366,name:"\u95EA\u70C1\u6548\u679C49",nameEn:"Blink Effect 49",video:"video/10001150.webm",icon:"icon/10001150.png",audio:[]},{id:10001151,scope:"ui",width:606,height:210,loop:!1,duration:1.233,name:"\u95EA\u70C1\u6548\u679C50",nameEn:"Blink Effect 50",video:"video/10001151.webm",icon:"icon/10001151.png",audio:[]},{id:10001152,scope:"ui",width:1674,height:346,loop:!0,duration:10,name:"\u8FDB\u5EA6\u7D2F\u79EF6",nameEn:"Progress Accumulation 6",video:"video/10001152.webm",icon:"icon/10001152.png",audio:[]},{id:10001153,scope:"ui",width:1110,height:400,loop:!1,duration:1.2,name:"\u95EA\u70C1\u6548\u679C51",nameEn:"Blink Effect 51",video:"video/10001153.webm",icon:"icon/10001153.png",audio:["audio/10001153.mp3","audio/10001153_02.mp3"]},{id:10001154,scope:"ui",width:1178,height:506,loop:!0,duration:10,name:"\u8FDB\u5EA6\u7D2F\u79EF7",nameEn:"Progress Accumulation 7",video:"video/10001154.webm",icon:"icon/10001154.png",audio:[]},{id:10001155,scope:"ui",width:1254,height:200,loop:!1,duration:1.2,name:"\u8FDB\u5EA6\u7D2F\u79EF8",nameEn:"Progress Accumulation 8",video:"video/10001155.webm",icon:"icon/10001155.png",audio:["audio/10001155.mp3"]},{id:10001156,scope:"ui",width:1180,height:202,loop:!1,duration:1.2,name:"\u8FDB\u5EA6\u7D2F\u79EF9",nameEn:"Progress Accumulation 9",video:"video/10001156.webm",icon:"icon/10001156.png",audio:["audio/10001156.mp3"]},{id:10001157,scope:"ui",width:654,height:118,loop:!0,duration:10,name:"\u8FDB\u5EA6\u7D2F\u79EF10",nameEn:"Progress Accumulation 10",video:"video/10001157.webm",icon:"icon/10001157.png",audio:[]},{id:10001158,scope:"ui",width:962,height:162,loop:!0,duration:10,name:"\u8FDB\u5EA6\u7D2F\u79EF11",nameEn:"Progress Accumulation 11",video:"video/10001158.webm",icon:"icon/10001158.png",audio:[]},{id:10001159,scope:"ui",width:1016,height:142,loop:!0,duration:10,name:"\u8FDB\u5EA6\u7D2F\u79EF12",nameEn:"Progress Accumulation 12",video:"video/10001159.webm",icon:"icon/10001159.png",audio:[]},{id:10001160,scope:"ui",width:790,height:210,loop:!1,duration:1,name:"\u8FDB\u5EA6\u7D2F\u79EF13",nameEn:"Progress Accumulation 13",video:"video/10001160.webm",icon:"icon/10001160.png",audio:[]},{id:10002001,scope:"screen",width:1280,height:720,loop:!0,duration:10,name:"\u89C6\u91CE\u6C1B\u56F41",nameEn:"View Ambience 1",video:"video/10002001.webm",icon:"icon/10002001.png",audio:["audio/10002001.mp3"]},{id:10002002,scope:"screen",width:1280,height:720,loop:!0,duration:10,name:"\u89C6\u91CE\u6C1B\u56F42",nameEn:"View Ambience 2",video:"video/10002002.webm",icon:"icon/10002002.png",audio:[]},{id:10002003,scope:"screen",width:1280,height:720,loop:!0,duration:10,name:"\u89C6\u91CE\u6C1B\u56F43",nameEn:"View Ambience 3",video:"video/10002003.webm",icon:"icon/10002003.png",audio:[]},{id:10002004,scope:"screen",width:1280,height:720,loop:!0,duration:10,name:"\u89C6\u91CE\u6C1B\u56F44",nameEn:"View Ambience 4",video:"video/10002004.webm",icon:"icon/10002004.png",audio:[]},{id:10002005,scope:"screen",width:1280,height:720,loop:!0,duration:10,name:"\u89C6\u91CE\u6C1B\u56F45",nameEn:"View Ambience 5",video:"video/10002005.webm",icon:"icon/10002005.png",audio:[]},{id:10002006,scope:"screen",width:1280,height:720,loop:!1,duration:1.9,name:"\u89C6\u91CE\u6C1B\u56F46",nameEn:"View Ambience 6",video:"video/10002006.webm",icon:"icon/10002006.png",audio:[]},{id:10002007,scope:"screen",width:1280,height:720,loop:!1,duration:2.4,name:"\u89C6\u91CE\u6C1B\u56F47",nameEn:"View Ambience 7",video:"video/10002007.webm",icon:"icon/10002007.png",audio:[]},{id:10002008,scope:"screen",width:1280,height:720,loop:!1,duration:3.433,name:"\u89C6\u91CE\u6C1B\u56F48",nameEn:"View Ambience 8",video:"video/10002008.webm",icon:"icon/10002008.png",audio:["audio/10002008.mp3"]},{id:10002009,scope:"screen",width:1280,height:720,loop:!0,duration:10,name:"\u89C6\u91CE\u6C1B\u56F49",nameEn:"View Ambience 9",video:"video/10002009.webm",icon:"icon/10002009.png",audio:["audio/10002009.mp3"]},{id:10002010,scope:"screen",width:1280,height:720,loop:!1,duration:2.5,name:"\u89C6\u91CE\u6C1B\u56F410",nameEn:"View Ambience 10",video:"video/10002010.webm",icon:"icon/10002010.png",audio:[]},{id:10002011,scope:"screen",width:1280,height:720,loop:!1,duration:1.8,name:"\u89C6\u91CE\u6C1B\u56F411",nameEn:"View Ambience 11",video:"video/10002011.webm",icon:"icon/10002011.png",audio:[]},{id:10002012,scope:"screen",width:1280,height:720,loop:!1,duration:2.933,name:"\u89C6\u91CE\u6C1B\u56F412",nameEn:"View Ambience 12",video:"video/10002012.webm",icon:"icon/10002012.png",audio:[]},{id:10002013,scope:"screen",width:1280,height:720,loop:!1,duration:3.9,name:"\u89C6\u91CE\u6C1B\u56F413",nameEn:"View Ambience 13",video:"video/10002013.webm",icon:"icon/10002013.png",audio:[]},{id:10002014,scope:"screen",width:1280,height:720,loop:!0,duration:10,name:"\u89C6\u91CE\u6C1B\u56F414",nameEn:"View Ambience 14",video:"video/10002014.webm",icon:"icon/10002014.png",audio:[]},{id:10002015,scope:"screen",width:1280,height:720,loop:!0,duration:10,name:"\u89C6\u91CE\u6C1B\u56F415",nameEn:"View Ambience 15",video:"video/10002015.webm",icon:"icon/10002015.png",audio:["audio/10002015.mp3"]},{id:10002016,scope:"screen",width:1280,height:720,loop:!1,duration:2.5,name:"\u89C6\u91CE\u6C1B\u56F416",nameEn:"View Ambience 16",video:"video/10002016.webm",icon:"icon/10002016.png",audio:[]},{id:10002017,scope:"screen",width:1280,height:720,loop:!1,duration:.733,name:"\u89C6\u91CE\u6C1B\u56F417",nameEn:"View Ambience 17",video:"video/10002017.webm",icon:"icon/10002017.png",audio:[]},{id:10002018,scope:"screen",width:1280,height:720,loop:!0,duration:10,name:"\u89C6\u91CE\u6C1B\u56F418",nameEn:"View Ambience 18",video:"video/10002018.webm",icon:"icon/10002018.png",audio:[]},{id:10002019,scope:"screen",width:1280,height:720,loop:!1,duration:2.2,name:"\u89C6\u91CE\u6C1B\u56F419",nameEn:"View Ambience 19",video:"video/10002019.webm",icon:"icon/10002019.png",audio:[]},{id:10002020,scope:"screen",width:1280,height:720,loop:!0,duration:10,name:"\u89C6\u91CE\u6C1B\u56F420",nameEn:"View Ambience 20",video:"video/10002020.webm",icon:"icon/10002020.png",audio:[]},{id:10002021,scope:"screen",width:1280,height:720,loop:!0,duration:10,name:"\u89C6\u91CE\u6C1B\u56F421",nameEn:"View Ambience 21",video:"video/10002021.webm",icon:"icon/10002021.png",audio:[]},{id:10002022,scope:"screen",width:1280,height:720,loop:!0,duration:10,name:"\u89C6\u91CE\u6C1B\u56F422",nameEn:"View Ambience 22",video:"video/10002022.webm",icon:"icon/10002022.png",audio:[]},{id:10002023,scope:"screen",width:1280,height:720,loop:!0,duration:10,name:"\u89C6\u91CE\u6C1B\u56F423",nameEn:"View Ambience 23",video:"video/10002023.webm",icon:"icon/10002023.png",audio:[]},{id:10002024,scope:"screen",width:1280,height:720,loop:!1,duration:3.4,name:"\u89C6\u91CE\u6C1B\u56F424",nameEn:"View Ambience 24",video:"video/10002024.webm",icon:"icon/10002024.png",audio:[]},{id:10002025,scope:"screen",width:1280,height:720,loop:!0,duration:10,name:"\u89C6\u91CE\u6C1B\u56F425",nameEn:"View Ambience 25",video:"video/10002025.webm",icon:"icon/10002025.png",audio:[]},{id:10002026,scope:"screen",width:1280,height:720,loop:!0,duration:10,name:"\u89C6\u91CE\u6C1B\u56F426",nameEn:"View Ambience 26",video:"video/10002026.webm",icon:"icon/10002026.png",audio:["audio/10002026.mp3"]},{id:10002027,scope:"screen",width:1280,height:720,loop:!0,duration:10,name:"\u89C6\u91CE\u6C1B\u56F427",nameEn:"View Ambience 27",video:"video/10002027.webm",icon:"icon/10002027.png",audio:[]},{id:10002028,scope:"screen",width:1280,height:720,loop:!0,duration:10,name:"\u89C6\u91CE\u6C1B\u56F428",nameEn:"View Ambience 28",video:"video/10002028.webm",icon:"icon/10002028.png",audio:[]},{id:10002029,scope:"screen",width:1280,height:720,loop:!0,duration:10,name:"\u89C6\u91CE\u6C1B\u56F429",nameEn:"View Ambience 29",video:"video/10002029.webm",icon:"icon/10002029.png",audio:[]},{id:10002030,scope:"screen",width:1280,height:720,loop:!1,duration:1.966,name:"\u89C6\u91CE\u6C1B\u56F430",nameEn:"View Ambience 30",video:"video/10002030.webm",icon:"icon/10002030.png",audio:[]},{id:10002031,scope:"screen",width:1280,height:720,loop:!1,duration:1.166,name:"\u89C6\u91CE\u6C1B\u56F431",nameEn:"View Ambience 31",video:"video/10002031.webm",icon:"icon/10002031.png",audio:["audio/10002031.mp3","audio/10002031_02.mp3","audio/10002031_03.mp3","audio/10002031_04.mp3"]},{id:10002032,scope:"screen",width:1280,height:720,loop:!0,duration:10,name:"\u89C6\u91CE\u6C1B\u56F432",nameEn:"View Ambience 32",video:"video/10002032.webm",icon:"icon/10002032.png",audio:["audio/10002032.mp3"]},{id:10002033,scope:"screen",width:1280,height:720,loop:!1,duration:2,name:"\u89C6\u91CE\u6C1B\u56F433",nameEn:"View Ambience 33",video:"video/10002033.webm",icon:"icon/10002033.png",audio:["audio/10002033.mp3","audio/10002033_02.mp3"]},{id:10002034,scope:"screen",width:1280,height:720,loop:!0,duration:10,name:"\u89C6\u91CE\u6C1B\u56F434",nameEn:"View Ambience 34",video:"video/10002034.webm",icon:"icon/10002034.png",audio:[]},{id:10002035,scope:"screen",width:1280,height:720,loop:!0,duration:10,name:"\u89C6\u91CE\u6C1B\u56F435",nameEn:"View Ambience 35",video:"video/10002035.webm",icon:"icon/10002035.png",audio:["audio/10002035.mp3"]},{id:10002036,scope:"screen",width:1280,height:720,loop:!0,duration:10,name:"\u7784\u51C6\u6548\u679C1",nameEn:"Aiming Effect 1",video:"video/10002036.webm",icon:"icon/10002036.png",audio:[]},{id:10002037,scope:"screen",width:1280,height:720,loop:!0,duration:10,name:"\u7784\u51C6\u6548\u679C2",nameEn:"Aiming Effect 2",video:"video/10002037.webm",icon:"icon/10002037.png",audio:["audio/10002037.mp3"]}],files:{"audio/10001017.mp3":{bytes:6524,sha256:"82470dfef398dab45fb3d50134da7b49573e7189f683d2bdf0849b478f267c79",duration:.850667},"audio/10001032.mp3":{bytes:27907,sha256:"53ca71dde10d2d7b6fbf7232d2461f48e564c2d847cbb29f9aac685114634dff",duration:1.258231},"audio/10001040.mp3":{bytes:24212,sha256:"faf6a45ba3d02a6d86ba43f8fe8bf7dbadd22997f0e16ed22b990b0eeaac05c2",duration:1.202104},"audio/10001043.mp3":{bytes:15068,sha256:"ffe52807864f795fd7f8e5e235fca49537437d70a34db83d66352063fe538a52",duration:.570563},"audio/10001043_02.mp3":{bytes:12812,sha256:"b8c194027b798e504f51ae73b67ae63e0d56904ebc95d458b0065d995fa2ed58",duration:.501813},"audio/10001057.mp3":{bytes:28220,sha256:"df501138ff9ae6a43fc8b434c09a401093a5598e9366136e7071e1c57baeb238",duration:1.613042},"audio/10001059.mp3":{bytes:29516,sha256:"2d80dbec2dde2348c3c9dcf95598a79bd851aa8329c5ed68e33d40a532ee491c",duration:1.4855},"audio/10001107.mp3":{bytes:27174,sha256:"eedee79d5e4cb0282bba21e5b12a24170a07354f3285d3f50cd47e24ead5149b",duration:1.383039},"audio/10001108.mp3":{bytes:27174,sha256:"eedee79d5e4cb0282bba21e5b12a24170a07354f3285d3f50cd47e24ead5149b",duration:1.383039},"audio/10001110.mp3":{bytes:12164,sha256:"de0f6db4c8942741fa82168431e31f8b54d68260bf412266ef707506ff6f10c3",duration:.448},"audio/10001111.mp3":{bytes:12164,sha256:"de0f6db4c8942741fa82168431e31f8b54d68260bf412266ef707506ff6f10c3",duration:.448},"audio/10001112.mp3":{bytes:12164,sha256:"de0f6db4c8942741fa82168431e31f8b54d68260bf412266ef707506ff6f10c3",duration:.448},"audio/10001120.mp3":{bytes:19556,sha256:"2f7a402979dc442b4214e46d79b2dd1b7925c96c0eaebbbf0555fe3f5bb3a529",duration:1.5},"audio/10001120_02.mp3":{bytes:19772,sha256:"f1c0f5e4b3f8a550d058f14a35340f4cbf56de86b4c409dd13b1125d682e09d6",duration:1.5},"audio/10001120_03.mp3":{bytes:18572,sha256:"630975e0a80512e788648adadc6b2d96c526a6125e13ffffde83e65cf000aa5e",duration:1.5},"audio/10001120_04.mp3":{bytes:21212,sha256:"00da41febe7cf8a8491117ef820c42aa79c65172769b4a12705666e9d7f2b636",duration:1.5},"audio/10001120_05.mp3":{bytes:19220,sha256:"5d85fe103ecc1868eefc679ff676996c329e61881640ac743409899d34fc5b6b",duration:1.5},"audio/10001120_06.mp3":{bytes:24596,sha256:"ce03626d5f0a7ccaf4a6cec7bce8ed915f61d6ec57b3cd532cbfc89da5bdcc3e",duration:1.5},"audio/10001120_07.mp3":{bytes:22316,sha256:"4dadba002982494e40772cccfedce6f6405fb4abc1e81f2206c4c2e0ac2645b5",duration:1.5},"audio/10001120_08.mp3":{bytes:21548,sha256:"309625fddc0d645da062ff788100a656bd83c4ce8cb75d523ed1949387e8252e",duration:1.5},"audio/10001120_09.mp3":{bytes:23060,sha256:"2eaf460f61ae85e8e2a4c324ebb9c4bc4f460fd2489a15943b92d2fa4422d3b6",duration:1.5},"audio/10001120_10.mp3":{bytes:18668,sha256:"6242a47c96c9ce87cb00a6f2288e8209b9ef5e3dc7ecb62bdadbf8672df95714",duration:1.5},"audio/10001120_11.mp3":{bytes:21188,sha256:"880383e307f7fe7210c05c37fc04a0ac8e3c909d500215f72c7228b9c2e660a6",duration:1.5},"audio/10001129.mp3":{bytes:45188,sha256:"07198b0853f2a859c6ccb85ec4ad1e56c6131302f5145f50d39fd98efe7e5387",duration:2.130667},"audio/10001131.mp3":{bytes:45188,sha256:"07198b0853f2a859c6ccb85ec4ad1e56c6131302f5145f50d39fd98efe7e5387",duration:2.130667},"audio/10001134.mp3":{bytes:45908,sha256:"ff64e15c3144791ad9073ee4537eb21ec7cf1d41dd205b0ef051a8263784793f",duration:2.518667},"audio/10001135.mp3":{bytes:49940,sha256:"edf39fa868e9e42da6fe38c8f726bf4162c950543efdfdefb1f85d3dfaa4d72b",duration:2.758667},"audio/10001143.mp3":{bytes:20156,sha256:"740c276f344b457077bc48f627304d15bbd879d06b3d6b6108673f07d2ec0dc5",duration:.841333},"audio/10001143_02.mp3":{bytes:36524,sha256:"b70b6326344739a781ef5ba96103b349d37052102a29cf2d5cddd2517cd13dff",duration:2.298604},"audio/10001153.mp3":{bytes:20372,sha256:"5c7d6a7ee0d3fff9352071a17979c9941ab1e5322e9b5a94692077f932c71ecf",duration:1.074208},"audio/10001153_02.mp3":{bytes:21140,sha256:"34e4852a0e1bcfd46c8820d9d61a1ef5288ba2795decc8829d1cf1c4b04d1b3a",duration:1.074208},"audio/10001155.mp3":{bytes:32132,sha256:"e1b38d6f72b3b7124da2c8a6417484053e1dd2833507d03cea32175d3d8e486c",duration:1.361167},"audio/10001156.mp3":{bytes:17468,sha256:"b945a4cc1ef374343806f677e1e2ab461c452a4eed6992151575791ccae7e9b2",duration:.808958},"audio/10002001.mp3":{bytes:126284,sha256:"9bedc3f73a10d1b4205d53c2c11b22ad1fc54375a430be0f64e2e5a7ed68b35d",duration:6.018875},"audio/10002008.mp3":{bytes:58316,sha256:"e24d9e46941a40c27b0adbc06927f245cb4826445142d3d4d1ca5d4e7a6889b7",duration:2.57125},"audio/10002009.mp3":{bytes:57932,sha256:"abea73a14c14dc143ed4b1244eba7257bf38119edb13923504c00ee11f51deb1",duration:2.5},"audio/10002015.mp3":{bytes:57932,sha256:"abea73a14c14dc143ed4b1244eba7257bf38119edb13923504c00ee11f51deb1",duration:2.5},"audio/10002026.mp3":{bytes:38137,sha256:"3ce1a1df88494fb7179a6df74a9f30f14e185e16060d84daff586c2992f06c1d",duration:1.994603},"audio/10002031.mp3":{bytes:6932,sha256:"81439fcff710fdd6ce4541ddf76edc30f119c44fbf7e6d39df2c6349ffe4a347",duration:.301333},"audio/10002031_02.mp3":{bytes:5420,sha256:"f9ad4c41d670a010fb7e8acc6227e0ea8dc73dc1504972190aa513fdc0257d05",duration:.296104},"audio/10002031_03.mp3":{bytes:8012,sha256:"40c44c0ea861bd86e1bbedda8bf48dbe5c4d0b3a22f493cc2d9dfab43544d9e5",duration:.296104},"audio/10002031_04.mp3":{bytes:5948,sha256:"69c8ab1fc17a47a696e1e65d2a87613ae98377712d09a4d18cfbdf6cb06defae",duration:.296104},"audio/10002032.mp3":{bytes:111082,sha256:"0f17b84ae322621d29af50d88c3ee8d66677926429ae818579eba240e5f07a52",duration:4.90771},"audio/10002033.mp3":{bytes:59847,sha256:"0476fabf3f0d6d000758a82e467a1ff0e363d0efa3e873b60eb2d4194372aa24",duration:2.949274},"audio/10002033_02.mp3":{bytes:60791,sha256:"9f6eac53ec1f8dd02be7a532ee51ddbfc2c1f34c935616194e2c92e8ea8794bd",duration:2.928254},"audio/10002035.mp3":{bytes:93092,sha256:"360a57a535ffe34d8fdd3ef652512dac3cb46c1155791ea5992b3fd5cfde3a0c",duration:4.26},"audio/10002037.mp3":{bytes:50252,sha256:"508a7cadf5dec9f94a41570aa5d0dae7b7ee2fef4bbf42e96b7a8b46da21e51d",duration:2.246667},"icon/10001001.png":{bytes:23905,sha256:"fe51bb11c58eef524f2f6683663a58f69c4272de1d027797ccf1b283b5fcc583"},"icon/10001002.png":{bytes:22166,sha256:"36936f7678f5c5cb0a3a014a76eb9c6bdd5a9f23e72dfbef6d9523523cf9be48"},"icon/10001003.png":{bytes:22959,sha256:"77e1ca70f67b68c3a2ff8951017a95c54af43a02d37f025c4b39e299a0389820"},"icon/10001004.png":{bytes:24182,sha256:"127a9be79e7a0460bbba6f4390b83cf0137a1f50995fd4ddfdf071d0ce9aec5c"},"icon/10001005.png":{bytes:24501,sha256:"78dfe771d99b5002ef7ba93d6b2705aabf28fc8ad362becccd986de62da8b9ee"},"icon/10001006.png":{bytes:23058,sha256:"0bd296f4d2ec3fb3a46f6cbaaeaa959de21e5e94927317cc1c00f3eb767a8ab4"},"icon/10001007.png":{bytes:24384,sha256:"0d858dd1574291ff8365a64381eb7c2244e2f3ee054b89c4291d295af23cb565"},"icon/10001008.png":{bytes:25339,sha256:"60fb9e6b7b0765eb6559360a501220628f73995f20cf32bf600556ed55baebed"},"icon/10001009.png":{bytes:25470,sha256:"6eedb42ef97b243de8b3c7ce7d4ff06ecda408e333c1b67bfb0c3252ba2b71fc"},"icon/10001010.png":{bytes:17067,sha256:"3067643b0330ec446e15ff4b50eadc5c9d75597fac5b7ead544cf9f74c27c8f3"},"icon/10001011.png":{bytes:20283,sha256:"693c10ff57c4f729c5bc4bbc64aa15a7ee9ed1666ad08af11a6bf976e3608ab6"},"icon/10001012.png":{bytes:17900,sha256:"eeb4aa0a6a2e7d52983207ae143660f4cb50c1b529f7c42817112f760ef07520"},"icon/10001013.png":{bytes:20986,sha256:"273f7d86fb8e209bbd2dc06ceb3679c7f8d5d78f57fc3690bfbf83dd48a5fb4c"},"icon/10001014.png":{bytes:19083,sha256:"966cdcbd74d3e990262f5fdf1cc58704f67ca4a2ea5cd36d0118c0be2f312e0c"},"icon/10001015.png":{bytes:19533,sha256:"da2debca11cfa90e1868b966aa19f426664b968d0523ed458bc23e6a26601272"},"icon/10001016.png":{bytes:20596,sha256:"9a584e1393532cc8649512c31319bfa901fc73d557e01c3cd3c77ec80b8a6225"},"icon/10001017.png":{bytes:15766,sha256:"b2588c21a03d6c7795398e2240e527bbdd4e3f718f806f3906930bd68a4c8b85"},"icon/10001018.png":{bytes:18168,sha256:"5e9938443c22663db8434fc568362ae4d3de48cb1b6c411e703aeac07e3b5c4c"},"icon/10001019.png":{bytes:21447,sha256:"7625187d1c358b23e8ff7c38a9a4c6a9952bb0d7f9d4b6cf1256f1a0493df72f"},"icon/10001020.png":{bytes:24125,sha256:"2c07a35ade6a3d73b08d24b76153eedb6de41f1298e840dd5faee04bbf8fbcb0"},"icon/10001021.png":{bytes:19226,sha256:"06046a9387fd8ead3fbe4002c9cafbaa4189852bd683ef3b627133324fc578e9"},"icon/10001022.png":{bytes:19063,sha256:"30406afc29728bd50b1cd1704307effdca73a86db5d3b97a7fd1b2ba936e383a"},"icon/10001023.png":{bytes:19749,sha256:"29ed71483317b6d1f7fdcc4556731ca19a3828158bd70710eaaac5f7512b7aa1"},"icon/10001024.png":{bytes:7178,sha256:"1459dc8c6bba8f391e63d40dc410b0a94ba1ea346a2cc19b8fcee940010a3bd6"},"icon/10001025.png":{bytes:5758,sha256:"7fd586d94c22c9a6c4ad0248974b21d4f29b2a7e2c8c04cecf607f860bd4dd74"},"icon/10001026.png":{bytes:6248,sha256:"1829dd3720c0df86849f78fc5fb532e8412a5302bae20cd4571376c9ae06f43d"},"icon/10001027.png":{bytes:5454,sha256:"fed706b5943134d4fdb776ec35f479bf792a0b4603e23b2030e7893a3159ecd8"},"icon/10001028.png":{bytes:5275,sha256:"f0f01e125afd58d2a7cc6f850e1a69edb8e47d31a424eed21431b0b4f0e34bdd"},"icon/10001029.png":{bytes:6492,sha256:"592c905f1b364684d1004bc17739d1dd563e6aad5a0da97174d6f4d91dde0afc"},"icon/10001030.png":{bytes:5994,sha256:"816c8995dc94a724233222b3a21633d55330bad2c9879509587cfc10a20e9f50"},"icon/10001031.png":{bytes:12053,sha256:"36d3220568ee902b5cdce711946423d79edf54d70b46f7e46d9d79316a60f470"},"icon/10001032.png":{bytes:6189,sha256:"4d2f2a6a4aa56f799fa6d9b2bf112dd14754f3480951962899ed8e19f0f3d5a4"},"icon/10001033.png":{bytes:19270,sha256:"74367881fc31f13f6c8c6aa87a5da0c779d8303cda03aab1b914d03e2e243697"},"icon/10001034.png":{bytes:23429,sha256:"fdf41e7834dacd674f9d14e4db0c3a4598ae18ad7bcb0ed2f819af69decc4564"},"icon/10001035.png":{bytes:10567,sha256:"71e42a76b7d82964f609885a8fd0f4b8082dfbbc450349dd1329fac1d0f3b8d7"},"icon/10001036.png":{bytes:20003,sha256:"3ffb2d2cae852795566819b3bc65e42d6f5cfea442807813e3f110d2ae5306ab"},"icon/10001037.png":{bytes:11651,sha256:"0f2f343b4030beb38a5d03ca500b16292ee3402853a685eea33907da3166d00d"},"icon/10001038.png":{bytes:3402,sha256:"4fe6ebe2f6160b91c3c51971e4d588fa75f17dc58680c5e7525547eadb8a9922"},"icon/10001039.png":{bytes:16348,sha256:"c91c4bb5fd6c4ca331d4e47015669bd8727d2c91a3d79e97dceabba5484eed51"},"icon/10001040.png":{bytes:15606,sha256:"02c74e003d186f3c5ca4ea280312e2629faade7a3b95dc9ea320f587d411c658"},"icon/10001041.png":{bytes:7378,sha256:"dcec72b04c3096893874d605112c6c8aca2182a5d7af4231e08e279155efc6f0"},"icon/10001042.png":{bytes:9216,sha256:"4d53cec5485b07cde76ef6a459d7f30b73cbb149c7d22d70f94c9d4f08caca95"},"icon/10001043.png":{bytes:7268,sha256:"d0c2a175a0de3b1ed673ff2298cd964e93681a79b8bae03cb3a9940bf2b295b7"},"icon/10001044.png":{bytes:17785,sha256:"b166e9094cfb03ecce6eeeef4715623325ec4b86eda3236e72d34c7f1e4c7aee"},"icon/10001045.png":{bytes:20257,sha256:"dba951310f94d16e23800d78e6f15fb09753de1106fce0b6b65c869ac836ae5e"},"icon/10001046.png":{bytes:18695,sha256:"ccabfef92ec484881baade8997962077e362dde9552a0eefa4c11a063156bc61"},"icon/10001047.png":{bytes:20724,sha256:"571f24becceb229b8388a458c72bf5367c9c9b1bd2f511be9b6175f34c3fa743"},"icon/10001048.png":{bytes:19845,sha256:"3bccfb7c346d124071a2746f75d9e519d90985f07a9122cbb373347646c50d1e"},"icon/10001049.png":{bytes:26620,sha256:"62eaca8f1fa7013d5a9039864571102c640f0ad38b7fc19c34e475caf719cda5"},"icon/10001050.png":{bytes:21554,sha256:"9757b6b14968327fbd2933e4bc1df5c88e8acaa6a1654f880d0aa60557d0f012"},"icon/10001051.png":{bytes:23608,sha256:"3649049db87f65e60857124089570f03d8a87ccd367eddf1cd3189dc49318222"},"icon/10001052.png":{bytes:10144,sha256:"2939136db3eeca57cf771b6e776b0d00ef93b53d00a436b1429c8035821cb49b"},"icon/10001053.png":{bytes:16400,sha256:"29c5e8192b476e74b655b9b717ffa08b0195d5e098951a07904128b2fdfd8cd3"},"icon/10001054.png":{bytes:26202,sha256:"f73fbc019e699b109591814aae3f6d8b111b1388e6bb129ccb35edf7b526dd6d"},"icon/10001055.png":{bytes:19948,sha256:"48de3fe25bdde874eac546529417ffcc4ad395640539895293de829bc9d28fcb"},"icon/10001056.png":{bytes:9550,sha256:"a681352376be706911851bb90563ed343968c35c58c7af3a77fff4b4c16ea3a2"},"icon/10001057.png":{bytes:4530,sha256:"f855883dd19a55155968b77c238f2b5fe0cd894569959ec0f776b3c7d9c0006d"},"icon/10001058.png":{bytes:19430,sha256:"d94b796fbddaf0d63531c0b5569b26ef3e5cb42a51b06faced91b6c9fe467c94"},"icon/10001059.png":{bytes:21181,sha256:"71fe484027e51e4b7af32da4a4d3c661bef1dc5e011710aa0c8512db46237072"},"icon/10001060.png":{bytes:19537,sha256:"cb3ee2648a2b1b656e731d8b2c0cb102bc2eed1c6125b166e1867ca0129b4117"},"icon/10001061.png":{bytes:19347,sha256:"2b7bff19a05b1868e680b8d96919aa1449a7a35fb16fad62ce12d9e546f1cc8c"},"icon/10001062.png":{bytes:24195,sha256:"381bb70063fa7dcc3eda51a116bd79c44f41f32fb2abe647c3957570ca3c5257"},"icon/10001063.png":{bytes:24414,sha256:"240ad25841dcf341fc202efeb82009b52f9e99a403129b251443248f8729200d"},"icon/10001064.png":{bytes:21752,sha256:"8f37873cb51acc05c3e38534b272fc0dffaf2455e85f123fb7d1273584e9a276"},"icon/10001065.png":{bytes:22353,sha256:"082328a9b48c365b77eb4b7c7fe3461647af52da0f6f8d3a9a6aed4715ef55c9"},"icon/10001066.png":{bytes:25040,sha256:"93e8e9a1154521759b8275da6dd7813520067bdbb958fa1ef40a3e2db5d33ebd"},"icon/10001067.png":{bytes:17900,sha256:"764844d417a505af87d84c5b45ed11d8d4f6751e0bb934296354baf2c5e9b7db"},"icon/10001068.png":{bytes:27775,sha256:"f1696ad983c71560c9954d23d24e32fa79d877b7f136b115526d74002dfa13ee"},"icon/10001069.png":{bytes:27560,sha256:"14a34457ecf46a8f4a587ec4c7349a56dfa50550382dade7b3496365165b6f3c"},"icon/10001070.png":{bytes:7342,sha256:"392327cac6f05cd50cf10517e065449b3e3d63a20f2e7028cb54597341fffa1a"},"icon/10001071.png":{bytes:8292,sha256:"e35b725fd8337d3caf63550d9b3483fcc4d2e033711538db5cf792c1990760f2"},"icon/10001072.png":{bytes:2941,sha256:"92b0722a12b3370aaa2ddc69da17d1df9ded02d96e1310d9f88d22531d1e52bf"},"icon/10001073.png":{bytes:26648,sha256:"8cb0bfeb6f957c3507f9c59987440e34f9b8af8435ded2e80451c47c5e40e3ed"},"icon/10001074.png":{bytes:15602,sha256:"ade023a5bbeabcb56c1f14936c05d43a55836d9e0d530ac27a582ce5fd099cbd"},"icon/10001075.png":{bytes:29167,sha256:"d104103a60927435254c590c3d13294426f05ea81193ba5581ac1c56dbad690d"},"icon/10001076.png":{bytes:21611,sha256:"d42eff9554cf6b8010729decfe48c67f82fbe044d7174ffcf6f66ce1e0aaa776"},"icon/10001077.png":{bytes:17232,sha256:"417922105baee5e55df1ca41dec0f6ea50e5597e25e972bda5e85921ba89defa"},"icon/10001078.png":{bytes:22903,sha256:"f595cae988c1aa72bb46aaed66fbd4eb2a80b0d428e6f69279e6cc5eb8f33d43"},"icon/10001079.png":{bytes:12314,sha256:"d786c8e75869e85cd1282fedbdd7184599d467323ec627ba84fc8ac4d5b32802"},"icon/10001080.png":{bytes:21705,sha256:"40070edd6457107645f67436623734dc991b9ca443ab90f69f70dbaaea7a39ad"},"icon/10001081.png":{bytes:20562,sha256:"d56e7c2c982f3b27cd11f81799f37e59bed9c0ee33c38cb388a761faa3ff4aa7"},"icon/10001082.png":{bytes:16044,sha256:"d1a2f46512f076d4c94d595d09bd79a621823a9beb605d7550ec7c0a18063fee"},"icon/10001083.png":{bytes:20479,sha256:"fdccdda6ccfed67eac85cfa376d6f8a40ee1219ddd3cad6900b277b609e192eb"},"icon/10001084.png":{bytes:10321,sha256:"8ed3211996fe8174c1eea74b1b5187b507fda63b2d4f9c92d1a198d2560b00b3"},"icon/10001085.png":{bytes:14763,sha256:"2f965520fc95c4616a4af85f5340788038a5b4530ee2e687153ce58559c03220"},"icon/10001086.png":{bytes:18341,sha256:"060c578e663efedf5cb8516fedc4f05837fcf63a55b977d19658324708910776"},"icon/10001087.png":{bytes:4213,sha256:"769837b1d6caa5bbd3e3aa99ea416c57538b18c7c24d918e284d9c1251bbc460"},"icon/10001088.png":{bytes:4172,sha256:"5d4ea01aaec16fe631fc2383d258bba90158083c6bfcd8c1183dc22bad62fc0e"},"icon/10001089.png":{bytes:3474,sha256:"90625242ffa6ef70ba55f48bc7ecdb056c359db8381831ff22f9885d3c3f22f3"},"icon/10001090.png":{bytes:7435,sha256:"513808a1c0e913a192a113b8503698612af55c7ba9f3f341d24f50995aa7e902"},"icon/10001091.png":{bytes:22367,sha256:"7daa0d126bd8a7389720014dcb8448da8bc21eb0b381a99062bfa81d0b4d090c"},"icon/10001092.png":{bytes:12227,sha256:"9d63290e2cfa3acf8d58df425be36a101579b867c66c306986d762d7d4f422fd"},"icon/10001093.png":{bytes:26518,sha256:"bc385ef5b565fd3a9e6f923d6172155fd25472be7705b2b62569b07b8dc08cf6"},"icon/10001094.png":{bytes:25052,sha256:"e4ae56756a19592c96fe52a7a4b538c943377c2a20d921d8fecaea6a8f0c7dea"},"icon/10001095.png":{bytes:23206,sha256:"c4f38e680893ecda45e5c7e3589a2b852a15f4345abe4ec23629e1836d4db70e"},"icon/10001096.png":{bytes:22122,sha256:"f686a5ea91407ebdc08f4291b5169bd552ed5c8d8333be59db9366770cf7ff2b"},"icon/10001097.png":{bytes:12560,sha256:"f73d09781a3c85f822b0c88fa72b740cd50a15c2b8f592fa87979353ab4469dd"},"icon/10001098.png":{bytes:15059,sha256:"7e8050b1404cc16aa86a71b41dbc9d21925a9b78ad9e5254cc4e9624deb31f6c"},"icon/10001099.png":{bytes:15584,sha256:"ac80e1a8be3932dd9961cf91cbb2b177c47600b2bebe29e415bbb6fea798164c"},"icon/10001100.png":{bytes:16326,sha256:"c09dc9a07b44cf2c71c61756237422b4a0c2d2067321cd43695ce6585cffcf56"},"icon/10001101.png":{bytes:10612,sha256:"7aedce9017c7ee89d59e134d9ddd054dd907a26db6c45e7fc20b7506c51b687a"},"icon/10001102.png":{bytes:23039,sha256:"493c35fb2876f09ab03cfe98eb72b4897c8ae425650572c20fb92e71434c98ca"},"icon/10001103.png":{bytes:19364,sha256:"530857b7b8e777d3f96fda60ccb9f23007ecac339c4f752ef3c85a297b3a7966"},"icon/10001104.png":{bytes:28069,sha256:"e9eb24af2a0ba2805b54c614f10221fcb7c1d73217b5d0dc6b7e00fea2e26c33"},"icon/10001105.png":{bytes:26082,sha256:"24952154a32e5955b8503c92d6ebbd85991930130c4308e2cafe9f7c5f577230"},"icon/10001106.png":{bytes:1651,sha256:"617f1f8e08229f2678330ba3c3b6167ba865b07f93691127e870b8d6adf6641b"},"icon/10001107.png":{bytes:22485,sha256:"938d08c4bf33909d7f0895c84a91713cfd1e6f937f33ff2da5eaf2b52eb5b06d"},"icon/10001108.png":{bytes:24430,sha256:"a601101f8b16bdd131b47c8f66433bcb973d1b695d992b09e634a728dff54535"},"icon/10001109.png":{bytes:15975,sha256:"210c74315ec41a5d3c19c29a76bdd3413765f8f17ded734dc0691e76d85b2191"},"icon/10001110.png":{bytes:2344,sha256:"e655f46b6fccd2edafc4eb323d8678eb28f3c3ff117e3ac9f69c60c1827ace46"},"icon/10001111.png":{bytes:3021,sha256:"85f3c7595d26004037c41ec5303b62384a0e78b1ae06bdb99386e027de99ff54"},"icon/10001112.png":{bytes:3407,sha256:"89107889930ee230b538fbbaf11e6d0d041ab412ddf5b9d834a35c30289184e6"},"icon/10001113.png":{bytes:20006,sha256:"043f3dc850dd766a97ca36a4a6b6a4f69f6bd1a39b503a94ae7f44d24a3f9f94"},"icon/10001114.png":{bytes:13510,sha256:"00746c36384a8db4907dd246d6eefa673f5d1779ebd7411e9ce240b605129211"},"icon/10001115.png":{bytes:25840,sha256:"81c3874b31b33ff76ff5696828fc7e041acbc4e5802a159e6d7cf39623b6e4d9"},"icon/10001116.png":{bytes:26845,sha256:"e08add35bb5d9dab63eb2113db0a3f02837033f89ef5bf03d6fb6bde4b143a7e"},"icon/10001117.png":{bytes:5260,sha256:"7d5929d69cf88c4fd3aad5d0924e5501c8d6466ae8deea9dd98587bcc683ace5"},"icon/10001118.png":{bytes:2319,sha256:"4a2e00b11368da3400d0fde87af9ae0004a491f9e5166cbe9ba3e412d8c42977"},"icon/10001119.png":{bytes:9639,sha256:"69c0e0c0244fe4f9a863a749dd0697021334cf6f8a940aae48047447d07abfb5"},"icon/10001120.png":{bytes:3934,sha256:"92b3b1c0bb994c6eda4527f6b6dd2af58c3fa895d04867856d0ff59ccfd19048"},"icon/10001121.png":{bytes:20543,sha256:"2ab3a15500ca6a11e4ca65bc371d95c0af1e0563cc2c0dc4f20c8c01ab092e38"},"icon/10001122.png":{bytes:12810,sha256:"b5836c452bfa9d9a1db7a362538da5568db5824118c696eb3a2c158ae70f0cf6"},"icon/10001124.png":{bytes:35989,sha256:"619ff5c41712328cb34e98705aa8df74574a1821770a4586b22909577a4bc58e"},"icon/10001125.png":{bytes:29137,sha256:"99a9ab0501de6dba85c2abc0e1e36adf7a86f10fb37875e2680f2f6d9ca3e83f"},"icon/10001126.png":{bytes:22453,sha256:"f43f07f4c18e71b27570d8523eb3a8e029420c31ffadcb3e3aa1bbaa80a9fe4d"},"icon/10001127.png":{bytes:19714,sha256:"07781839310d272bc7aa3dad17d09224462964e4a677466697030781c8fa71ce"},"icon/10001128.png":{bytes:13908,sha256:"e1181919aa1dcf4fce455f94c43548cdc4db1eccbd1056cd9cc2dd3eb8f61d64"},"icon/10001129.png":{bytes:17401,sha256:"350f315d554986c5a522f79ce80a4f33b658317e2dfd28e765f31f1f55d9fd8b"},"icon/10001130.png":{bytes:12296,sha256:"9a43c99b2df57772c96547b0de18a8d0760d6c324c2b9d3cc3db33467dd08503"},"icon/10001131.png":{bytes:5038,sha256:"75d352f831fb2cb7f33db7514a5e8c96e1dbaedcf370955cad7783baa0845efe"},"icon/10001132.png":{bytes:7256,sha256:"b0dba588447f82e38c20eb54684a9d1f84ea83fb011287908f81cac2d9c29756"},"icon/10001133.png":{bytes:6606,sha256:"96100d356bd18b99201bde0a3196a851804f391a99e915a189d1ece883c4e349"},"icon/10001134.png":{bytes:7075,sha256:"93352721db5da92231f0b53f01f72aacc33670a820e2fa6331f402c79ab3dff3"},"icon/10001135.png":{bytes:7300,sha256:"e978e0bfac39714827cd7dd770b54fda77e5e7bc82392ce8092e9ba616ceac3c"},"icon/10001136.png":{bytes:4617,sha256:"403a83d32973ff5007759b8910d8d38f29c42d0caaee60876a29951a263008c1"},"icon/10001137.png":{bytes:6923,sha256:"e64530fb2cc4cb2e95be5481ce47d78a99d095cb4739f6c58f0269bb6c06df60"},"icon/10001138.png":{bytes:3412,sha256:"0d8839c0f16110389f079dd0cdaf32130b0d4363994cd62e51f64775a89736c6"},"icon/10001139.png":{bytes:3432,sha256:"ed8360d109e366c6a330c2806137f37d458194adcb5d7a5d61da0c168061f316"},"icon/10001140.png":{bytes:2813,sha256:"b3d6c1d80544a5327c21f9e63e452ed129e729e4ba18653013386bfe9a26d6ea"},"icon/10001141.png":{bytes:1976,sha256:"7874744cf4f00e0a676a4d76eb469e72ecd5fed016ae4b25a164f78994dedc19"},"icon/10001142.png":{bytes:15037,sha256:"14d12854b4b17da8ba54f0808be9acca2cdea82f004b047343b288fc5c442d65"},"icon/10001143.png":{bytes:5652,sha256:"5f02f7cf842d9aef4b81b784e3dce9ed4e820745c97efde3b7af2fa94cc6f2c6"},"icon/10001144.png":{bytes:3080,sha256:"ed7b8552f4dff8310e269986336dba5cbe76ccb6e065156b825bf8e0b5c8fdfc"},"icon/10001145.png":{bytes:2987,sha256:"ffa4d3452e8d0c751aec973fffe797c2e872175cd5912d0393c72b3da8cad13c"},"icon/10001146.png":{bytes:5483,sha256:"4ed80b9c3fa0d88c6cef1289f18048b9b373742348e991e23b3ac042bd71ad26"},"icon/10001147.png":{bytes:1152,sha256:"05750a2593db8d6cb0e64755e447fa2236cc5edfdd633a8ab9be8d8b5fcd7d89"},"icon/10001148.png":{bytes:2662,sha256:"421eafe1622cd73809a8b09b7a74074628a8acc9df8c4411f7ee51fb96a6cc2d"},"icon/10001149.png":{bytes:5963,sha256:"a16c6f9abbd6d866df576878a10477bb1f9c055d4ad19a050e3305b394f80058"},"icon/10001150.png":{bytes:7106,sha256:"66161334208241a31f9f5bca369733c81c6070de9b1d9f4c922c6c5a15dcc684"},"icon/10001151.png":{bytes:10932,sha256:"260a9dc36d191df0700e243e8461362605ddd759a0bd7fb382a9175ead3d9c91"},"icon/10001152.png":{bytes:5867,sha256:"e1980362d5eed82c2806a9ea5fc1b0ccdac33629f7aee398f74c5f54389ed683"},"icon/10001153.png":{bytes:9870,sha256:"e1e279e3065898eca9503c8652b74a71b4151284a733ee9293026be4d249c05d"},"icon/10001154.png":{bytes:9156,sha256:"6c6bd25805bb81659537de7814550b6b4daaddaf894645eb630ff9520a246d04"},"icon/10001155.png":{bytes:5172,sha256:"057bb0e931efc9b955b43943dcbbe5df73cc34ffd1755df8986e0f8f691b4794"},"icon/10001156.png":{bytes:4527,sha256:"5b93b62d5f786efce3b63ad62da61c67f15a65441a47fcb2df3cf92807170758"},"icon/10001157.png":{bytes:1326,sha256:"054bbfcfbb69453dfeec70ac86a3fef70f4ea818110a9a8285bd294d65972d60"},"icon/10001158.png":{bytes:4270,sha256:"dc54dad40d681aaf0f6aac8b3dd4b419e05a079d5d05bd4561a7348b9edf7927"},"icon/10001159.png":{bytes:3192,sha256:"b3962f15d41f625b1435c7d7182f2b744fa9de0ff299503dd3683171de794d2a"},"icon/10001160.png":{bytes:5158,sha256:"9e52b24f602584cc198214039c10c2bd33609b3c448ddfd2acbd565beb8bfbac"},"icon/10002001.png":{bytes:20145,sha256:"f4d95a54594309ab6deed445289097af22295f51ff5b7139acad7bb06045bcb3"},"icon/10002002.png":{bytes:21810,sha256:"af166959cddb542b83349dcc045096dae6185cd52d48a013dad78fe7ba1053ce"},"icon/10002003.png":{bytes:21958,sha256:"8bd0e7b9603ab0136ce86d8f7ace42ae23640013f07464730efd774655bd1628"},"icon/10002004.png":{bytes:23769,sha256:"4c1e6d5b3eef62b104f392bcd6cbf3ae7d2abaee06b161a1a65c6e916734945f"},"icon/10002005.png":{bytes:23898,sha256:"b30336b8be741b5a6315bf6ffffde315446e1639d9438e649f282153eec3f13b"},"icon/10002006.png":{bytes:36362,sha256:"81973c5d0fc8a86e8cec23d9d3eeb68f23ea95c302e8fefccaec90a320891427"},"icon/10002007.png":{bytes:23004,sha256:"1b42dcbd00fb4f45d6818b05e8b56c2880b0b2fbe061d17562f0c2125e6dbef6"},"icon/10002008.png":{bytes:25821,sha256:"7a6a91b0b32ef193de8601d3779c8a96b30c8994f746ecdb14920f364f434401"},"icon/10002009.png":{bytes:29951,sha256:"d736d5118775d03725093e1dd6bc51236c7fa39ed00184487db2267bae5f9f4f"},"icon/10002010.png":{bytes:26085,sha256:"6b92c88569ffcdd8b2cd4836f281b36ef5085c468fbb14923d085317e3d25c81"},"icon/10002011.png":{bytes:25715,sha256:"827cbcdb97487fefbfb801847e4acbcf298d0c10037173d612b006f615ef5ef0"},"icon/10002012.png":{bytes:26384,sha256:"e7ae9e007cddcc3c1f3a0d8206052b107ed5726276105583f4bb9015a14c5fa3"},"icon/10002013.png":{bytes:27500,sha256:"5ff084b46a5b00e83aefdba355c33bd972cad0537c08fee7bc6ffb42bc0ebdc6"},"icon/10002014.png":{bytes:20236,sha256:"c98b3528d9506c343a680e3699c3481dc0e17a7c14966b447a963c8bc0639c81"},"icon/10002015.png":{bytes:30913,sha256:"1efb63f37ed6ebcb4e28488901b4866d37204840be668a677e53fd8735b55c53"},"icon/10002016.png":{bytes:26866,sha256:"a91a05fa0e2f633e32011fc416ecc7b79096bdc531480200bc64b71ff8c05b5a"},"icon/10002017.png":{bytes:27987,sha256:"e9adecf78cac8b30edfec13604726b9e04a3bc5cc9ab2459ca09957a4300130b"},"icon/10002018.png":{bytes:25698,sha256:"2c9ce8412106fef0b68132d1bb13358b0c2953ab968f248559f1b4bfb043cc80"},"icon/10002019.png":{bytes:20846,sha256:"891a3906fc6324235cdbf4c83c7e0d58c6a7a71c423b2bb0a38e04d0de717d4b"},"icon/10002020.png":{bytes:19304,sha256:"b06d5f3d0a91dd2b49174f680d829d73260a6d4cbec4fff48a6131d4a4e89695"},"icon/10002021.png":{bytes:21812,sha256:"01dad29e897e1660646fdaa826b72fadbe822ceb13bbad6cb57fd1f9519e3139"},"icon/10002022.png":{bytes:19095,sha256:"eb571c371e8c9f6447d1567652425c43d2e6cfa9ed5f3dbd6b29fd3ff26f741e"},"icon/10002023.png":{bytes:20241,sha256:"5769cad4d0fa0effb7498b15f97ee1f45e6655275df15164e04f79ef314324e3"},"icon/10002024.png":{bytes:14546,sha256:"b823c0e0b8e4b852519254794cf219b42e02021d667528c6387a545fc2a066ac"},"icon/10002025.png":{bytes:28393,sha256:"5374e4d458ac4d8ae45419c0040c1981f12395afb984b631c48b640b8be2aebb"},"icon/10002026.png":{bytes:5243,sha256:"f97e20c0f2ea8e3c2d3b3dfaa9d3b9449e3ed559364cc2e7ab1516d0cb88bd78"},"icon/10002027.png":{bytes:4486,sha256:"cdd1376115bf45ba21b47c6e574a5b28f7c83cb36159bb1f7c60d737f9ec8ecc"},"icon/10002028.png":{bytes:3253,sha256:"41e38057943bc5dfbb24d8279c9ce23b58c871615deb28d934b0bb954bb66df2"},"icon/10002029.png":{bytes:24855,sha256:"60c949a324f60ac215dd01ea0dd4471ccff9b912717fd3b03443dea31dd87940"},"icon/10002030.png":{bytes:4435,sha256:"0a3e76f32808add9274d8e65d279b33521b655036d24cf87de3f5fa11de6dfc9"},"icon/10002031.png":{bytes:27998,sha256:"8fa5a2187292213adab843c9fbc68e8f099371a3ed74c55195998f92810e8b4f"},"icon/10002032.png":{bytes:21697,sha256:"9ece6166203932aad1a59d851258dc92e17f67f11de52b642c3abedeef571a3a"},"icon/10002033.png":{bytes:35521,sha256:"99c220eec1407ade7a0a5ff8c22a8dc6e4149ac6d0f407c005f78f8338f9bab5"},"icon/10002034.png":{bytes:6754,sha256:"b5097a0501688fe67edf17c7a993ce12323a2b86b55226db7cad7d9c2ffa016b"},"icon/10002035.png":{bytes:9625,sha256:"172106dc0c33f12daad2eee2ab1278f94c1026d0d6db70320851f2908eb9eb46"},"icon/10002036.png":{bytes:2474,sha256:"43ca13e6572a60aacfba330ac86bf5211a6901914fbd1559fffbb89ca15ccd41"},"icon/10002037.png":{bytes:23717,sha256:"d232b256c550eb85f96d5eb28f19a661f2127f383f49bf4ba4348f935f32dbe9"},"video/10001001.webm":{bytes:147646,sha256:"a72065f7abcc9387fb3dccd473d509bec7b421aa6c34c89e344dd8ee294bc2d2",duration:10},"video/10001002.webm":{bytes:171594,sha256:"b6e89b1967387bf40278b73414d90f0a3b8c61b0e4bfa63e74f67fa049ad3482",duration:10},"video/10001003.webm":{bytes:151975,sha256:"c5fa8ecbc3e6992256ee128dc400d2c93bf91fe5f7813a4d289c4b6d477fda54",duration:10},"video/10001004.webm":{bytes:164765,sha256:"d85282288b6a845d35f7ec6bfe49fc0f5d4766fe61ae30b87a9df6ff2a4961fc",duration:10},"video/10001005.webm":{bytes:189607,sha256:"0f186507b14407573ebb42da49a5749809e28819854cd46b4bf82b858ff057fd",duration:10},"video/10001006.webm":{bytes:136733,sha256:"cd11113d02047c42e3c03be3f2835f34eb52d0fe595b8e380a69fa86d9a40957",duration:10},"video/10001007.webm":{bytes:174723,sha256:"c9e65dbd73985b4ee5e716b63f5a9bf5719be8b95ea9a3a61a3aae772adaa064",duration:10},"video/10001008.webm":{bytes:13947,sha256:"d494a403015acc7700b45021ce269771edc8766e62f2bd82a7d26c9f60c63bb5",duration:1.3},"video/10001009.webm":{bytes:15895,sha256:"04d442aa0a51199be173b17a069b8365ae3205b26db275fb73355356fa1f871a",duration:1.3},"video/10001010.webm":{bytes:83391,sha256:"9bb064beb2f4622cc761ba26e5793da93c576d9c26be517912bd0d25f82763a2",duration:10},"video/10001011.webm":{bytes:107849,sha256:"d884e886fd74baba25a896921907e37675329915a90081fbcdd30e84fe4df099",duration:10},"video/10001012.webm":{bytes:84881,sha256:"c3ed5ae0813a45908906170ed6513b64c20a51f72aa0783ee55112ddb8701f80",duration:10},"video/10001013.webm":{bytes:96819,sha256:"560da96c18685b4fe4acc7b32ab940f229bc7ed1c57b0dd4511be7c22e5b6162",duration:10},"video/10001014.webm":{bytes:140840,sha256:"6ae425c9aa6d7ce1a476f18caa12ef0b124fa8b98e446696a3bba29ef6ae9a32",duration:10},"video/10001015.webm":{bytes:106513,sha256:"78e68a0cd736cf5c7a433f79f603126d0036bec8a751c937c7b96106180865c9",duration:10},"video/10001016.webm":{bytes:126160,sha256:"206ff8c1ba2836b2e58a907458b3c5a9ded69556eb4e29685725f49a90a2b481",duration:10},"video/10001017.webm":{bytes:217547,sha256:"0b1402a3ab2b0b3fa2284c33dec5b818049399a3a7cf1c2bf6b891c604905577",duration:10},"video/10001018.webm":{bytes:78212,sha256:"b5681b42272c66d918e143a63b6b4f9c044cd6b3ef1a8d2050a26f583b6b7a2c",duration:10},"video/10001019.webm":{bytes:175270,sha256:"6f493f9db0be094ab927becf8be553d416eab7ccdbac76896cd02a33ea094af3",duration:10},"video/10001020.webm":{bytes:227796,sha256:"57eb38683cf84e8abbd6319da39e08e4233baee90bac54568034fca55f7a253b",duration:10},"video/10001021.webm":{bytes:216527,sha256:"e19c751b9c36ce5d68c18a161ada9216e23f7cf8598638de9c8b4c2911d6e390",duration:10},"video/10001022.webm":{bytes:188626,sha256:"6ca2e91020c1141ee626b5dca2c7c190978562a70af2a6982f387c1e9cd9e53d",duration:10},"video/10001023.webm":{bytes:199004,sha256:"0b42968e4ac8f1152244e3821ef33d15954bfd3efba5709568b778b7ef375d23",duration:10},"video/10001024.webm":{bytes:60772,sha256:"a1a4269849425bc985f07f4e2c9e7bfd2fa5094238926b9d4096b8155bee39ce",duration:10},"video/10001025.webm":{bytes:61785,sha256:"0d7e10b6b97b5cbb5098046277b0315b0db4b5542ad8da82758adb800eb970f0",duration:10},"video/10001026.webm":{bytes:59199,sha256:"d2404c66eb3f357ae6349541a53fa713c4d81793c9b5f273cb6d5b949ded6330",duration:10},"video/10001027.webm":{bytes:37421,sha256:"c97fd7cda4cf46636757fd2913f5cdbfc44db0c183d7190499c3f54c1b007bc5",duration:10},"video/10001028.webm":{bytes:57620,sha256:"0deb4f0b933adce6785a46c2319e63721774f185532875fb4434f78eb905863d",duration:10},"video/10001029.webm":{bytes:66083,sha256:"ae3ef6d5ed1c676ce11136f98404159bbd3e847b7967c7cd76e53060df090ddd",duration:10},"video/10001030.webm":{bytes:58745,sha256:"0c7965cbed1119b1ff13e1b3381129a28468a6464279751590063f11efd8028a",duration:10},"video/10001031.webm":{bytes:8557,sha256:"5847d08b09f9f39575fba5fabada6133757231545bf08656ae145136c8d21bd9",duration:1},"video/10001032.webm":{bytes:25221,sha256:"0a401d8d73d2a838d01daecdf047b04ae98cf76cac899ae7a21fda8b9cefc2da",duration:.933},"video/10001033.webm":{bytes:34602,sha256:"896f71d3387bcf4154cec5fe67593c1982374af65cfebd5b989108adc2e07ddd",duration:1.2},"video/10001034.webm":{bytes:125134,sha256:"3804a3b13d8974702162d97a703c63a7aa5bb2690e892a6215d3a61af788fa8a",duration:1.4},"video/10001035.webm":{bytes:67308,sha256:"22651c969c1e7ad47a6aa062a7791fed498069d407dce6471afb760b83eee66c",duration:10},"video/10001036.webm":{bytes:127270,sha256:"f0dabcf3554f6aeb9a3070796760df4f5a7047e435ba94e8c3948bdae24dcc45",duration:1.4},"video/10001037.webm":{bytes:168190,sha256:"3b0423327eac86c2376f2d0e1ad08142c335e80b3bf2a35b58410e43038a39e4",duration:10},"video/10001038.webm":{bytes:131917,sha256:"3153ff561dbb204cff54001334794aff6551dc29e55dbeb0fad35bdef372033a",duration:10},"video/10001039.webm":{bytes:11634,sha256:"2bbbdddc40b1790c6ff3f4a7be9c6ad0f8a5ef521d45e4c7ca9f0a84a70dcca3",duration:.766},"video/10001040.webm":{bytes:29034,sha256:"9187e82dace372eda0441947980d8a981238b519fe8b91b3cd8983a25bc38124",duration:1.2},"video/10001041.webm":{bytes:145234,sha256:"86c73a18f5f07c18427a4f6540e94ae0488a22ba061f931c5071f4524aeb8e33",duration:10},"video/10001042.webm":{bytes:173888,sha256:"f4011ff7a3474cf2ff9cc02eee560e46d3e1ad165848dafb989907199951ac01",duration:10},"video/10001043.webm":{bytes:42182,sha256:"9bd4b77d6cb8be53aa0cb3954a124c523f076cd4b3f3ef646d1a41a272c9a058",duration:1.233},"video/10001044.webm":{bytes:32089,sha256:"789fc8b1316530b118bedf21682606096aa1f4191c1946dcd1d3262713567a84",duration:1.566},"video/10001045.webm":{bytes:9892,sha256:"d9261d0738da8852b6473a93bff97ec9f5d7e8fe130d314b44f4d870f9e2ef85",duration:.733},"video/10001046.webm":{bytes:7771,sha256:"bc5fcfa1b15638d4f4b44cea1f27e02e5c7281e5d422dd70e8945e52524f236b",duration:.8},"video/10001047.webm":{bytes:11433,sha256:"8dfb6ace018b13706517ee2511753af3606a9d646ef98f7808a1bbdf0220e23f",duration:.733},"video/10001048.webm":{bytes:9648,sha256:"d92bced2753f1ab8cd2edbab06905ac82e4b1423235bd32e9259058070d19470",duration:.733},"video/10001049.webm":{bytes:24623,sha256:"54769931e5ce88f652c63c4b190aa017a7e70e5860b046df7a2813f00cb42b59",duration:1},"video/10001050.webm":{bytes:20713,sha256:"919a6070b7e1f042e5a74f091ba8c23924f467cc1ddfdc5816feb3d638cc3acb",duration:.733},"video/10001051.webm":{bytes:317681,sha256:"a1dda360215590f4b5fb7b8a82cbe44d240211270485eae950b5535b01686d08",duration:10},"video/10001052.webm":{bytes:15091,sha256:"ff7685c63cf73e1422f07b59bf5e006b6dad8d2d80b1a8ae0997d13ef58487df",duration:.9},"video/10001053.webm":{bytes:183319,sha256:"c8c07a2deb6b4899a6d1c1b8dda72fac6ed45a11d6646c40f5c2e354a84a8d13",duration:10},"video/10001054.webm":{bytes:17094,sha256:"ca07c647725212c323dad57886c5b56a5eda2ae27909bf5ddf0f3589e99b5b5b",duration:1},"video/10001055.webm":{bytes:53469,sha256:"a8c69dd8c3c9e4836f1c3c9a4c033bc7bfacc0fab9ac2981c48e4391589c41de",duration:1},"video/10001056.webm":{bytes:225400,sha256:"60fbad9fef225e7205c0eba98951387354a8470e9a50db3921494db3dba6ba0f",duration:10},"video/10001057.webm":{bytes:7082,sha256:"0aeb94988ec8862c3bec3f357f380b675da3b0881c48640b37fa3d1215353b9b",duration:.966},"video/10001058.webm":{bytes:90245,sha256:"4bbbc44479a590344eb38e965facc757347d87c63816e0ccf8939d98d8278ecb",duration:1.6},"video/10001059.webm":{bytes:87447,sha256:"fb1b2bf01c971fcf2a69833b2728d8553f058877386c6e17947e2bc28e50f904",duration:1.766},"video/10001060.webm":{bytes:1276390,sha256:"19f135d0143a973a7ea358a64f83aacb227ddd483f200c6fc88738b3a2e1c9b5",duration:10},"video/10001061.webm":{bytes:70336,sha256:"10d1a43ee81a6fb691448a1a3165612edd96943e7188612069a13f57788c3513",duration:1},"video/10001062.webm":{bytes:102563,sha256:"79a12a7baa9ab219c27845166f613f87829073e0214ff26ac1b3239a2f8a8222",duration:1},"video/10001063.webm":{bytes:565456,sha256:"6784dd43aa64a9005df034defe99ca23eedf9a124f0a0681bb9ea531152d5656",duration:10},"video/10001064.webm":{bytes:48740,sha256:"3585e3b7579301babf2a941529d05261f7a4e7993d394be668ce3e6b34269be2",duration:.866},"video/10001065.webm":{bytes:16738,sha256:"96de617b4263a73bdb61e98d4643e8ad6488bc0cc359ee4f8da5eb6b0333c466",duration:.9},"video/10001066.webm":{bytes:12376,sha256:"ca507ca6ab20dae1d3e9ff3cf8fb0fb70763983f4b3c82fe8f05b5b011160189",duration:1.066},"video/10001067.webm":{bytes:23685,sha256:"8702ce3719d477e8a79a5321b152a804a583578aa6335aae221e238e449c4508",duration:10},"video/10001068.webm":{bytes:55734,sha256:"708b564295d3c3e1929d4f5da5af6595e9ef236e692380a838e4230ff3813381",duration:1},"video/10001069.webm":{bytes:1128088,sha256:"56b38a26aaa7913066c3336ba98f7eb1037c17fe80fb110d45e123cc46c36acc",duration:10},"video/10001070.webm":{bytes:975681,sha256:"4c762f4cc796d0a167e47ba18c6c658b9173cc8fd951b9c7537043ac1d3cab4c",duration:10},"video/10001071.webm":{bytes:815992,sha256:"e2547ebac9f4d2dba4cc455fc73cf1de2afa209f4a54473a252f3578b5882361",duration:10},"video/10001072.webm":{bytes:616757,sha256:"551e36eea20409279ac7b058f0658460e88b60c7b62189209ab219ab5ab35969",duration:10},"video/10001073.webm":{bytes:37684,sha256:"913e5eb86f0de97099bc8f1c2860dcc0ccb23af3df7b9565e46d23dcd3d5b2e4",duration:2.1},"video/10001074.webm":{bytes:12604,sha256:"7a034a81cb6b8d09507a83c42b44fa6ce5dac567aaa4dad86900772e81573fac",duration:1.666},"video/10001075.webm":{bytes:107268,sha256:"a58331fcb3c6ca07f581b3ca490eedcd4e4d486ddcf944083038198495dc8c6b",duration:10},"video/10001076.webm":{bytes:32481,sha256:"6c49036a5c3d63f3f8a554e751fde071afa7a88c69c0eb5fa8aac3ead9936c85",duration:1.2},"video/10001077.webm":{bytes:34358,sha256:"8b1cd91b4547b5c773688dc7586d02ef3505b56a6c0e5e8cfe95ac2877074fd9",duration:1.1},"video/10001078.webm":{bytes:46506,sha256:"d2b1506af78535ae8c25d12ed47f613f58c96c237aabd3a69481926279abbad2",duration:1.133},"video/10001079.webm":{bytes:73888,sha256:"14eaab31df0169c82d784132e336f21e3dbcde36e8d863e813fdbbd0cc7fe736",duration:1.166},"video/10001080.webm":{bytes:227149,sha256:"f953d8cb2c360f1a7beff3f1eb0287d2ad5b4b5021cd8add406935e7bce0f499",duration:10},"video/10001081.webm":{bytes:206185,sha256:"bd954a94b76ecb754018c8d2f5600757907fcbf5b8d8fd8c16eba98d2c77bd45",duration:10},"video/10001082.webm":{bytes:414215,sha256:"a66f150faa15b300f9d87422b83566b253c50579b8b08a83e7d5fecdeb33117a",duration:10},"video/10001083.webm":{bytes:103790,sha256:"f7619598f5fd506003b6161a7d7a9f7d13eaf3ae26a51cf560899ee50ab74850",duration:1.2},"video/10001084.webm":{bytes:49760,sha256:"075a51589f5556f125c56e3448e2b8c7fcfeec7f7981228e46991fcadb58b603",duration:.7},"video/10001085.webm":{bytes:39486,sha256:"7782a3f27d41c5b833746b6892a2074821226da33b0dfefe1173c5a45890abbc",duration:.566},"video/10001086.webm":{bytes:24420,sha256:"1e7c975fd2c3027095353ae2b7651e3b9f0104554a072579127817aa5ccdea02",duration:.866},"video/10001087.webm":{bytes:58874,sha256:"5101e1da0097fc9785131be66f411e54f427ef18f21ade4b254728e94ac568b7",duration:1.166},"video/10001088.webm":{bytes:64189,sha256:"a3c150eeaca295e70a351b250bd3554b4633a77f6704e581b72a8bd93f0ea194",duration:1.166},"video/10001089.webm":{bytes:25443,sha256:"0e5a1151fea93701ebc923211c8f5c406e895104a4afb9ba71d521ad45b39b85",duration:1.966},"video/10001090.webm":{bytes:65254,sha256:"89ad6f296294c0abf4fb08e68ebf141d1c602a659c0ec563f7058ac6d2462fd4",duration:1.166},"video/10001091.webm":{bytes:81681,sha256:"3081d901c969bc1f4a4b10a447c3a712a8b4136965c34a76119e1b6dcd5e6cd3",duration:1.6},"video/10001092.webm":{bytes:548135,sha256:"5c013b847ea4b8338927ebd2597c2bb12b9c9a7231853c3d277eba10f9dd453f",duration:10},"video/10001093.webm":{bytes:63342,sha256:"bc87982e78383167ff4c649b6603a78cff1d6cf3cb51349e73626fcb2a5a7b49",duration:1.033},"video/10001094.webm":{bytes:20050,sha256:"53e91848830acea081a4d56ab8db383627a78ebb806ecb6766a2e11ed9573c58",duration:.833},"video/10001095.webm":{bytes:84670,sha256:"172553d18635861bfe28c6f06b5c8cea5e7640287cb75242fec31c12319772d4",duration:1.8},"video/10001096.webm":{bytes:28716,sha256:"31d3f4236eb9e2f2f6cc76003284b02496bc581ab1c8e19cd5929b5828c894ef",duration:1.6},"video/10001097.webm":{bytes:25147,sha256:"2129484b7dfcc5abe518553a0841a92a6582062356acda687b942b2cb221d26f",duration:1.6},"video/10001098.webm":{bytes:76333,sha256:"ac1d85c4f336abd854fd461db4e0951c83346dd2669c38b91e537ec758e9de65",duration:1.6},"video/10001099.webm":{bytes:76173,sha256:"2fba51975dae32febc9c1a270b1b5b769d299f143c4996198c7dfca26efd1014",duration:1.6},"video/10001100.webm":{bytes:80616,sha256:"ee23d3bf91e53bf9eb93d5a7c5879daa54aaa7e7194ba3944758131ebee68c5d",duration:1.6},"video/10001101.webm":{bytes:84160,sha256:"cb606310669a2a1d2f30b0903af51eae290a4276d2d934439999bfa10bdb5604",duration:1.6},"video/10001102.webm":{bytes:82257,sha256:"01cad0b39abfc2f041df3c1e786a11d3323cd25297fbebca2f196f8f556c8d82",duration:1.133},"video/10001103.webm":{bytes:91224,sha256:"106929efba101b9ae0f76b6b637cd4e16863bf9f72f779c2474d0d6cab4fc1fc",duration:1.166},"video/10001104.webm":{bytes:89745,sha256:"0862ade9ff0001d2cb5458e3cb6998a7ac42c2336840d73532f5492e522cbb34",duration:1.133},"video/10001105.webm":{bytes:93873,sha256:"0b03b634e18bb25087af672cee8e29df618540f3ac73761dae9a854a629dcfff",duration:1.133},"video/10001106.webm":{bytes:80898,sha256:"c25414e50001dd924e75c4b9aab2aa4fca72d1765bec268344e1541c9f9734ff",duration:10},"video/10001107.webm":{bytes:14411,sha256:"faa6ad2693c69433203864414e338b8d0f322096ff6b05b826787ec3a7bf7f57",duration:.8},"video/10001108.webm":{bytes:45841,sha256:"5e3c3dbbbd11985807452e9b02a69477d018b60dcf1598ed1deb21ec82bb4a50",duration:1.7},"video/10001109.webm":{bytes:53026,sha256:"2a0c537529b94d06bac852d498825b431a2830d944e8601e752b115b68d481ac",duration:1.666},"video/10001110.webm":{bytes:28873,sha256:"b1ec1a3d0d577270b1eb3fd1dcf2ddc36df9dcea52df0249b8440db3e0ec9b6f",duration:1.533},"video/10001111.webm":{bytes:15873,sha256:"74c62d1739cb80ecfbc66b755c7332a27a53b3ff3c6d72aa75d47804b211ad36",duration:.9},"video/10001112.webm":{bytes:17381,sha256:"e3c96e5b87f26c54347abcc591e241a78ae3ccccfc2eaa0bc447f1400410ed92",duration:.9},"video/10001113.webm":{bytes:28753,sha256:"1b16a8e140a6787675a0201e4ef4dea5633076d9494cdfb6f8c16c9b2507b8ea",duration:1.166},"video/10001114.webm":{bytes:111410,sha256:"13cd5f511962912110c6ac8d6ef7e39a823fcf48477762a18123080866b43138",duration:10},"video/10001115.webm":{bytes:43777,sha256:"0000583cb60ee7e8d562e13bbf5ddd7fc3fd8c9d93d2bcc7b96df9ab524f980e",duration:1.133},"video/10001116.webm":{bytes:87365,sha256:"d96dc3d3f552ca40e77ddd55b50da8c93a7bf34f53a6ecf01802751248f2189c",duration:10},"video/10001117.webm":{bytes:15087,sha256:"9e95f50d1385083834770fa0f09ffe79fa570e93def94b52a6a7a7e64f581a0b",duration:1.466},"video/10001118.webm":{bytes:74213,sha256:"4340b8ff11f8a3795d4d2fcd5c32d112ea4bb92153880f8b3eda34e15a82738d",duration:10},"video/10001119.webm":{bytes:26934,sha256:"244f12529343f2163be2b075dafc1907662ef53ab60c4ad081b8db9d81b4abc1",duration:10},"video/10001120.webm":{bytes:15909,sha256:"77c6308d62f016d2f6a0669f5c165efab2afff3d15611afb54965bc65e3ecca4",duration:1.566},"video/10001121.webm":{bytes:14072,sha256:"d5cc8215a5d4e8499f402cf5ad34e4ed958319a559c669aef9d5507be8f31d03",duration:1.333},"video/10001122.webm":{bytes:39768,sha256:"a0c0c537e22211affdafff6d4a42fee3b6fbe1d0fcdc17adbd5854b6395c9496",duration:2.6},"video/10001124.webm":{bytes:568780,sha256:"39b58e373aa854c91dfad8af90b3b84e9b04b7cde050388152622ac2c1f9c19b",duration:1.4},"video/10001125.webm":{bytes:179690,sha256:"42591454c30e14b1a65f5c7696516edf9e690002ca6fedf5a331e3fb39e13a83",duration:1.233},"video/10001126.webm":{bytes:243266,sha256:"faf35bae68aa35a358447c791c91808872921d4794f5c90e5763d692bd807a9f",duration:3.133},"video/10001127.webm":{bytes:208681,sha256:"42fecb16b110931f78c06d61d52374f5fa74fee60b1b37dcec4c608bf240adba",duration:3.066},"video/10001128.webm":{bytes:14331,sha256:"4a57b0082c4f32309eb212ebea0d1069efb87e4c3da4d65d556ca7d4cf397954",duration:1.966},"video/10001129.webm":{bytes:34019,sha256:"4bcab75c2f7ce6e2980b13fca3f8cb95bfb3bbb46396f52b0691a3b9499b2af9",duration:1.133},"video/10001130.webm":{bytes:10181,sha256:"f9e3bd1de752007281ab2d45fddc933b4709182a765e602879c3c9402dcebef2",duration:1.2},"video/10001131.webm":{bytes:168665,sha256:"275465192460a885a738b907be135e91be2546c9596cf0d0232ffea6d06065a5",duration:10},"video/10001132.webm":{bytes:97830,sha256:"4dbe1e8d33843f8360ad246082650ae7ebd0d66ce6b133e2f12f1d748719d13d",duration:10},"video/10001133.webm":{bytes:51508,sha256:"44b562df1ae76f3a1983447107aeeb00fb439afe3eb3e1d6a67a141467673aa1",duration:1.5},"video/10001134.webm":{bytes:36767,sha256:"adf67abc9bb2872b6aae897ecdaeb281384654e3066d03b07d6616a7393708a0",duration:2},"video/10001135.webm":{bytes:26042,sha256:"c2d6215296f9e200fc75c0d36f8523c4c5b24066a0e8eda2f01b6f5daa717bec",duration:2},"video/10001136.webm":{bytes:28762,sha256:"07d2d47eb8672b958f35fe6abe9ee2dae11db9a8846f1ac8d1e7206e466bf2db",duration:1.466},"video/10001137.webm":{bytes:151972,sha256:"f94c2f584f894e56def265d016e53ebf81473677633dfded66890fe6d3e2f175",duration:2.066},"video/10001138.webm":{bytes:68031,sha256:"43929724a51e2f99d9ebf5f7ffebc51ee90712b7520e213a9457bfcbb5f9a517",duration:2.033},"video/10001139.webm":{bytes:72750,sha256:"19d626334d981b16c00b4c5cc39ddab5bca75034f497f5345f18526e7fe25250",duration:2.033},"video/10001140.webm":{bytes:70456,sha256:"8cadee838df527fbe11b4e8fc5e3b7c784fad21f61c7c214ef7dffca72f0ef58",duration:2.033},"video/10001141.webm":{bytes:42664,sha256:"34f97de7d1dc183a5fb958305424f73ea6498254804c3ad669d44dc04bef939a",duration:2.033},"video/10001142.webm":{bytes:710423,sha256:"dd2aec022ab89b4e048b4e212216e5c0862b6c8be9899970d11b1d7a2267f9be",duration:3.8},"video/10001143.webm":{bytes:14487,sha256:"c393d0afa72faccf42aefb8cf946f08725dd76e28af2cb608049ae9416dc0887",duration:1.066},"video/10001144.webm":{bytes:13412,sha256:"47692e1e22510aef145080fcf1e42d6d4594cbc1ce3ca8dd89f247d7c59fd271",duration:2.233},"video/10001145.webm":{bytes:19632,sha256:"8fa9abcbc084f7952e2dd8b1ec325e676b78e2fd2be421aadbc83137463175f4",duration:2.266},"video/10001146.webm":{bytes:13723,sha256:"bda3925d9183b351f85c8152a9a2ca36ed994e6656fb210e08e2251df70c4ddd",duration:2.266},"video/10001147.webm":{bytes:23765,sha256:"566fafa5c585eb127bb81912324486a26c12db6bce8509763eb130ca1bf4be57",duration:10},"video/10001148.webm":{bytes:48537,sha256:"d7eb086bbe4e43d1733c4b7c4683248fc9686c0d2540b15b44030050415f18e7",duration:1.233},"video/10001149.webm":{bytes:56797,sha256:"a89363c03820728fe3041217caf3daa2c6b3b18c03a38478c9fbc38013df4874",duration:10},"video/10001150.webm":{bytes:71959,sha256:"33d5db768fc90f96ad2dd81fcaa2944ad721331fdba90ebbbc76abe9c9e622ad",duration:1.366},"video/10001151.webm":{bytes:70714,sha256:"f866a0e45980bbb029df58349d1401f259e79076e5a919584eebaea9b94d451b",duration:1.233},"video/10001152.webm":{bytes:1072305,sha256:"b9200f9b1dea6f7350dfaa0d1bc4eadcc4b4f0650fe190fe22ad25bc7e3a2b7e",duration:10},"video/10001153.webm":{bytes:37507,sha256:"add87a7074d611f312fe0c43a24ae18d774ff62a4cd24db69d2526fb7a2e1736",duration:1.2},"video/10001154.webm":{bytes:755336,sha256:"cae2ff5f2dc15d639a5ea411cab50a9bea03fad5f73116764945f6d012be74b6",duration:10},"video/10001155.webm":{bytes:28588,sha256:"ee157e4e1e8452bf7f1dbb32bb5509e9b8659edc5d1bb0bbba0b70af2e6c4328",duration:1.2},"video/10001156.webm":{bytes:21193,sha256:"2655315d0fa59d136b1a77e760a5b085aeaabfe70d1130ea17e937b037160afb",duration:1.2},"video/10001157.webm":{bytes:146426,sha256:"eb48647b768bf300429f157eb570b4c0d7c9d04bb3df53768e6875b91e51931d",duration:10},"video/10001158.webm":{bytes:231389,sha256:"8ea98583d1972f176e3354b6d7c116ac6b2689c1593b02ae4fea55774ca0bf8c",duration:10},"video/10001159.webm":{bytes:69087,sha256:"8b70a7eb8e83a9230bd3b7a658633c84037ed0667b0da87b78206f48ca2f487b",duration:10},"video/10001160.webm":{bytes:46691,sha256:"11698fa6b8a4f5ffd3f289e41266a7097f0e620bbb64359e97f1bcf7430731e4",duration:1},"video/10002001.webm":{bytes:543544,sha256:"6a3509a94437899e30846d0f701e0ae3ccfa82793f51d293ed507c8efaa67099",duration:10},"video/10002002.webm":{bytes:796059,sha256:"8cdab49708511f4d42d45fe0a319d2334e4e9aa42709e946c8d00a1ff77b07fd",duration:10},"video/10002003.webm":{bytes:715230,sha256:"6b5422c889243db499114370af5a260d624180fe17991445f7e3133eee619381",duration:10},"video/10002004.webm":{bytes:693595,sha256:"24aa66de5a0649c10652bb66b70a0407210e26e18a8d2d64b0610ca29fdfb02b",duration:10},"video/10002005.webm":{bytes:815174,sha256:"5ec0b1a66bf28c7bf0b2bc61a7bbbb374be18d4b1f338217ab3d84d88cd2838f",duration:10},"video/10002006.webm":{bytes:194930,sha256:"7ef8f4e4a5ea4430ea4910b06f0dc00c71d61ed9bd54e03b4a268a4d1f3e7525",duration:1.9},"video/10002007.webm":{bytes:93264,sha256:"cbdc07ca88626c73d074eae923aac8972ce8898fd331fecb40cbb22392d32e6a",duration:2.4},"video/10002008.webm":{bytes:669120,sha256:"9299206b7cdc7fc4f319864e425be91f90b4721bcd8555f56ead4dc45f776b27",duration:3.433},"video/10002009.webm":{bytes:434158,sha256:"3db3a361cf11e9ee543dff860ba8a7aef3831d920e1e95fb6773a13f15f7ff6a",duration:10},"video/10002010.webm":{bytes:161424,sha256:"3b6e41d32df6eca2645978e8ba0f13a4aef69aa8217d38e85e5b8db058016a9a",duration:2.5},"video/10002011.webm":{bytes:73568,sha256:"86966a56aef3a2a6a263526d1efa0092044b48ce26f7f076c5bdd259131a8121",duration:1.8},"video/10002012.webm":{bytes:187942,sha256:"2b3e1b9538ddaeb62adeae52b9ea0ab38801430c76bab0f6425da9e127e0d896",duration:2.933},"video/10002013.webm":{bytes:482076,sha256:"14b90e097eebe09d3337afb0867da590081f111b5593d601963dcccf39638a4e",duration:3.9},"video/10002014.webm":{bytes:1475640,sha256:"f81e417888b1a833e254cf069f33a5ff1820bfc1599ac0f86d67a3cea44cad78",duration:10},"video/10002015.webm":{bytes:2392745,sha256:"db572d1dd4f090a104cdeea17a84aaa94c5800820ec66168ccd2eb99cb05d867",duration:10},"video/10002016.webm":{bytes:178656,sha256:"aa5dfb8ef461f168b2b64790b90f5a0e847b2a02aa3964e35a1734b37f0b69dc",duration:2.5},"video/10002017.webm":{bytes:80715,sha256:"addc2369f55de0a067937f48f40f300d123c320efc9c03ff3be6ea922581b575",duration:.733},"video/10002018.webm":{bytes:790722,sha256:"1d8d5b69fe0a5949566c216eac072f739ee0be9d0ac7ad85a809db6fe4da14c5",duration:10},"video/10002019.webm":{bytes:115786,sha256:"1a4a39ff5bd9dd26bfda75176469acca6a2aace830961c3a5e5dc164bcc1ac64",duration:2.2},"video/10002020.webm":{bytes:581822,sha256:"2ce9a04ffb641ef53d0090a22dcb394f580475c41052c5dea83ceed1dffbcd69",duration:10},"video/10002021.webm":{bytes:568208,sha256:"b3aa5b1f712c379a80767d599059adcb482bb8cd2c0f07c404b6fd862c8d7e9b",duration:10},"video/10002022.webm":{bytes:610636,sha256:"8c2663f7c031328ef06dc59aa0c0a11f5e7708b3981b4399d8bfd609573e986f",duration:10},"video/10002023.webm":{bytes:612556,sha256:"79a90a1d7d5f6a2b9a1e81738e12566f14ce96f99fa81ca102aab157b4b2664f",duration:10},"video/10002024.webm":{bytes:1453404,sha256:"7e5412973270e8e58a539c9f83304b4cd07a0faa740a4752b982333e380a1d55",duration:3.4},"video/10002025.webm":{bytes:1544749,sha256:"63af745659c7063ba0d7fff63af97eaf8972c2a5a06cd6739ad518cd4187b153",duration:10},"video/10002026.webm":{bytes:280741,sha256:"cf701673766d966c3b522749ba169622c98261501be50bb3afee3c998898486e",duration:10},"video/10002027.webm":{bytes:327918,sha256:"d59447600017e11aa42fc342833fad186af9f9d1670aba32f922d77fca63d6c6",duration:10},"video/10002028.webm":{bytes:336612,sha256:"827a91d60bf0fa75a131853e0f1fda8855cf2cfdf9b06194d195833bda026986",duration:10},"video/10002029.webm":{bytes:700863,sha256:"1a8ad0969222629d8fd89bafb174df58082aaa50755e3843ca82ad953b18e0aa",duration:10},"video/10002030.webm":{bytes:34533,sha256:"f4080af95380d8f640133b255bbe2b25b03180a3cfcd99aed1f281265c6f18cb",duration:1.966},"video/10002031.webm":{bytes:187567,sha256:"8bbdc15b123c3ac7f3cba16b04ca18571996e6556f190edd4f13d6a50ecd8c0c",duration:1.166},"video/10002032.webm":{bytes:1776997,sha256:"e3b15a717b1db503bd3d838ed9b6fdb70def2fcb4b47f51db24eb86fc03e7923",duration:10},"video/10002033.webm":{bytes:297716,sha256:"425cd20f5a5038f720e0f3c4dd65ab58c6c5ad80aa346b6c9035eb0700e69d3e",duration:2},"video/10002034.webm":{bytes:2495666,sha256:"70f377770e704850e9a2eff20fa283cbae7939fd42b66b85110b9b6eb1aa2add",duration:10},"video/10002035.webm":{bytes:183443,sha256:"a631becd1c4585ec80d91b435a5c6cda28b6b2033f2eb62f929a7580ad2ffbad",duration:10},"video/10002036.webm":{bytes:89987,sha256:"5b523e749db42145e8f3947e86d6e8d9683300b737f7775477cd94f02c1c8004",duration:10},"video/10002037.webm":{bytes:823633,sha256:"a4e7ba6ce6a6a43c31597d6b6430e86c507ab45a89910eb5010f1d058901f539",duration:10}}};var N1=ca.version;var yc=Object.freeze(ca.assets.map(Object.freeze)),vc=new Map(yc.map(e=>[e.id,e]));function Mr(e,t="animation"){let i=vc.get(Number(e));return i?.scope===(t==="fullscreen"?"screen":"ui")?i:null}import{randomUUID as zr}from"node:crypto";function cn(e){for(let t of e.runtime.scrollControls||[]){let[i,n]=li(t),a=t.kind==="grid"?Bt(t):Pr(t,i,n),o={offset:a.offset,max:a.max,horizontal:a.horizontal,showBar:t.showScrollBar!==!1,textWidth:a.textWidth??0,lines:a.lines||[],lineHeight:a.lineHeight||0,contentLength:a.length,...t.kind==="textwindow"?{fontSize:a.fontSize}:{}},r=JSON.stringify(o);t._scrollKey!==r&&(t._scrollKey=r,t._scroll=o,t.markPlayDirty())}}function $r(e){return{...e._scroll?{scroll:e._scroll}:{},...e.parent?._gridItems?.includes(e)?{clipToParent:!0}:{}}}function da(e,t){let i=e._scroll?.max||0;e.kind==="grid"?e.scrollProgress=i?on(t,i)/i:0:e._scrollOffset=on(t,i),e.markPlayDirty()}var wc=Object.freeze(Object.values(ie).map(e=>Object.freeze({id:e.id,label:e.label,platform:e.platform,width:e.width,height:e.height})));function wi(e){cn(e);let t=ye({width:e.runtime.canvasWidth,height:e.runtime.canvasHeight}),i=new Map;function n(a,o,r){let s=He(o,a);s.activeInHierarchy=r&&a.active!==!1,i.set(a.Id,s);let c=s.activeInHierarchy;for(let l of a.children)n(l,s,c)}for(let a of e.runtime.roots)n(a,t,!0);return i}function pa(e,t=wi(e)){let i=new Map;function n(a,o){let r=t.get(a.Id);if(!r)return;let s=ei(o,r,a);i.set(a.Id,s);for(let c of a.children)n(c,s)}for(let a of e.runtime.roots)n(a,Ot());return i}function Dr(e,t){let i=t.get(e.Id);return{id:e.Id,prefabId:e.prefabIndex,authoringId:e.authoringId,name:e.name,kind:e.kind,typeofName:e.typeofName,instantiated:!e.authoringId,active:!!e.active,visible:!!e.visible,activeInHierarchy:!!i?.activeInHierarchy,raycastTarget:e.raycastTarget!==!1,interactable:e.interactable!==!1,pressed:e.pressed===!0,...e._scroll?{scrollOffset:e._scroll.offset,scrollMax:e._scroll.max}:{},...e.kind==="grid"?{itemCount:e.itemCount,scrollProgress:e.scrollProgress}:{},anchoredPositionX:e.anchoredPositionX,anchoredPositionY:e.anchoredPositionY,sizeDeltaX:e.sizeDeltaX,sizeDeltaY:e.sizeDeltaY,localScaleX:e.localScaleX,localScaleY:e.localScaleY,localScaleZ:e.localScaleZ,localRotationZ:e.localRotationZ,text:e.kind==="textbox"||e.kind==="textwindow"?e.text??"":null,fontSize:e.kind==="textbox"||e.kind==="textwindow"?e.fontSize:null,adaptiveFontSize:e.kind==="textbox"||e.kind==="textwindow"?e.adaptiveFontSize===!0:null,minimumFontSize:e.kind==="textbox"||e.kind==="textwindow"?e.minimumFontSize:null,fontColor:e.kind==="textbox"||e.kind==="textwindow"?e.fontColor:null,bgColor:e.kind==="textbox"||e.kind==="textwindow"?e.bgColor:null,enableOutline:e.kind==="textbox"||e.kind==="textwindow"?e.enableOutline===!0:null,outlineColor:e.kind==="textbox"||e.kind==="textwindow"?e.outlineColor:null,imageId:e.kind==="image"?e.imageId??0:null,imageSource:e.kind==="image"?Je(e.imageSource):null,imageType:e.kind==="image"?e.imageType==null?null:Te(e.imageType):null,primitive:e.kind==="image"?Nt(e.imageId,e.imageSource):null,imageColor:e.kind==="image"?e.imageColor:null,enableMask:e.kind==="image"?e.enableMask===!0:null,enableSoftEdge:e.kind==="image"?e.enableSoftEdge===!0:null,softEdgeMode:e.kind==="image"?e.softEdgeMode:null,softEdgeWidthX:e.kind==="image"?e.softEdgeWidthX:null,softEdgeWidthY:e.kind==="image"?e.softEdgeWidthY:null,horizontalSoftRange:e.kind==="image"?e.horizontalSoftRange:null,verticalSoftRange:e.kind==="image"?e.verticalSoftRange:null,enableFill:e.kind==="image"?e.enableFill===!0:null,fillType:e.kind==="image"?e.fillType:null,fillHorizontalType:e.kind==="image"?e.fillHorizontalType:null,fillVerticalType:e.kind==="image"?e.fillVerticalType:null,fillRadial90Type:e.kind==="image"?e.fillRadial90Type:null,fillRadialType:e.kind==="image"?e.fillRadialType:null,reverseMaskArea:e.kind==="image"?e.reverseMaskArea===!0:null,fillAmount:e.kind==="image"?e.fillAmount:null,box:i?{left:i.left,bottom:i.bottom,width:i.width,height:i.height}:null,children:e.children.map(n=>Dr(n,t))}}function Sc(){return{pointerDownControl:null,pointerDownPosition:null,pointerLastPosition:null,pointerDragging:!1,pointerHoverControl:null,pointerScroll:null,hoveredControl:null,selectedControl:null,stateRestores:new Map,viewCache:null}}function xc(e,t,i,n){let a=ui({canvasWidth:e.canvasWidth,canvasHeight:e.canvasHeight,device:e.device,audioDuration:Rr,canSelectImageType:Ya,...n?{language:n}:{}});for(let o of[...e.templates||[],...t?.templates||[]])Number.isSafeInteger(o.prefabIndex)&&o.prefabIndex>0&&a.registerTemplate(o.prefabIndex,o);for(let o of i){let r=o.path||o.id,s=o.source||"";r&&s&&a.registerScriptFile(r,s)}return a}var Ic=["pointerDownControl","pointerDownPosition","pointerLastPosition","pointerDragging","pointerHoverControl","pointerScroll","hoveredControl","selectedControl","stateRestores","viewCache"];function Ec(e){Object.defineProperty(e,"runtime",{configurable:!0,enumerable:!0,get(){return e.runtimes[e.viewPlayerIndex-1]}});for(let t of Ic)Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get(){return e.views[e.viewPlayerIndex-1][t]},set(i){e.views[e.viewPlayerIndex-1][t]=i}})}function Gr(e,{templatesProject:t=null,scripts:i=[],sceneScripts:n=null,templateScripts:a=null,serverConfig:o=null,canvasId:r="",playerCount:s=1,viewPlayerIndex:c=1,language:l=""}={}){let f=n||i,u=a||i,p=ra(e,f,r),m=t?ra(t,u,r):null,g=St(s),b=qe(c,g),v=kr({playerCount:g,viewPlayerIndex:b});o&&v.loadConfig({...o,playerCount:g,viewPlayerIndex:b});let S=[];for(let N=0;N<g;N+=1)S.push(xc(p,m,i,l));v.attachRuntimes(S);for(let N of S)N.addRoot(p.root);let x={audioSessionId:zr(),runtimes:S,views:S.map(()=>Sc()),playerCount:g,viewPlayerIndex:b,server:v,compiled:p,mountError:S.find(N=>N.mountErrors[0])?.mountErrors[0]||null,debugPaused:!1,history:{events:[]},recording:!0};Ec(x);let F=x.viewPlayerIndex;for(let N=1;N<=g;N+=1)x.viewPlayerIndex=N,zc(x);return x.viewPlayerIndex=F,x}function ba(e,t){if(!e)throw new Error("play session has not started");let i=qe(t,e.playerCount);return i===e.viewPlayerIndex||(rt(e,{kind:"view",payload:{playerIndex:i}}),e.viewPlayerIndex=i,e.viewCache=null,e.server&&e.server.setViewPlayerIndex(i)),i}function rt(e,t){!e?.recording||!e.history||Tr(e.history,{...t,source:t.source||"user"},e.runtime.clock.time)}function Cc(e){return e?.history?.events||[]}var ga=new Set(["image","textbox","textwindow","button","grid"]);function kc(e,t){let i=Me(t,e.centerX,e.centerY);return{centerX:i.x,centerY:i.y,scaleX:Math.hypot(t.a,t.b),scaleY:Math.hypot(t.c,t.d),rotationZ:Math.atan2(t.b,t.a)*180/Math.PI,matrix:{a:t.a,b:t.b,c:t.c,d:t.d,tx:i.x,ty:i.y}}}function Te(e){return typeof e=="string"?e:e?.Name}function Vr(e){return{fillType:Te(e.fillType),fillHorizontalType:Te(e.fillHorizontalType),fillVerticalType:Te(e.fillVerticalType),fillAmount:e.fillAmount}}function Ac(e,t,i){let n=Math.abs(t.width*i.scaleX),a=Math.abs(t.height*i.scaleY),o={id:e.Id,kind:e.kind,name:e.name,left:i.centerX-n/2,bottom:i.centerY-a/2,width:n,height:a,sourceWidth:t.width,sourceHeight:t.height,rotationZ:i.rotationZ,matrix:i.matrix,pressed:e.pressed===!0,...$r(e)};return e.kind==="image"&&(o.imageSource=Je(e.imageSource),o.imageType=e.imageType==null?null:Te(e.imageType),o.primitive=Nt(e.imageId,o.imageSource),o.imageColor=e.imageColor,o.imageId=e.imageId,Object.assign(o,Vr(e))),(e.kind==="textbox"||e.kind==="textwindow")&&(o.text=e.text??"",o.fontSize=e.fontSize,o.adaptiveFontSize=e.adaptiveFontSize===!0,o.minimumFontSize=e.minimumFontSize,o.textLayout=pt(e,t.width,t.height),o.fontColor=e.fontColor,o.bgColor=e.bgColor,o.enableOutline=e.enableOutline===!0,o.outlineColor=e.outlineColor,o.horizontalAlignment=Te(e.horizontalAlignment),o.verticalAlignment=Te(e.verticalAlignment)),o}function _c(e,t=wi(e)){let i=[],n=pa(e,t);function a(o,r=[],s=[]){let c=t.get(o.Id);if(!c||o.visible===!1||!c.activeInHierarchy)return;let l=n.get(o.Id);if(!l)return;let f=kc(c,l),u=o.kind==="image"&&o.enableMask===!0?ni({...Br(o,c),id:o.Id},bt(l,c.centerX,c.centerY)):null,p=u?[...s,u]:s,m=()=>i.push({...Ac(o,c,f),...r.length?{clipPolygons:r}:{},...p.length?{masks:p}:{}});ga.has(o.kind)&&o.kind!=="grid"&&m();let g=o.children||[];for(let b=g.length-1;b>=0;b-=1){let v=o._gridItems?.includes(g[b])?[...r,[[c.left,c.bottom],[c.right,c.bottom],[c.right,c.top],[c.left,c.top]].map(([S,x])=>Me(l,S,x))]:r;a(g[b],v,p)}o.kind==="grid"&&m()}for(let o of e.runtime.roots)a(o);return i}function Br(e,t){let i={kind:e.kind,name:e.name,sourceWidth:t.width,sourceHeight:t.height,pressed:e.pressed===!0,...$r(e)};return e.kind==="image"&&(i.imageSource=Je(e.imageSource),i.imageType=e.imageType==null?null:Te(e.imageType),i.primitive=Nt(e.imageId,i.imageSource),i.imageColor=e.imageColor,i.imageId=e.imageId,Object.assign(i,Vr(e),{enableMask:e.enableMask===!0,enableSoftEdge:e.enableSoftEdge===!0,softEdgeMode:Te(e.softEdgeMode)||"Percentage",softEdgeWidthX:e.softEdgeWidthX,softEdgeWidthY:e.softEdgeWidthY})),(e.kind==="textbox"||e.kind==="textwindow")&&(i.text=e.text??"",i.fontSize=e.fontSize,i.adaptiveFontSize=e.adaptiveFontSize===!0,i.minimumFontSize=e.minimumFontSize,i.textLayout=pt(e,t.width,t.height),i.fontColor=e.fontColor,i.bgColor=e.bgColor,i.enableOutline=e.enableOutline===!0,i.outlineColor=e.outlineColor,i.horizontalAlignment=Te(e.horizontalAlignment),i.verticalAlignment=Te(e.verticalAlignment)),i}function Tc(e,t,i){let n=bn(e,t),a=Me(n,e.centerX,e.centerY);return{a:n.a,b:n.b,c:n.c,d:n.d,tx:a.x-(i?i.centerX:0),ty:a.y-(i?i.centerY:0)}}function Yr(e){let t=e.matrix;return[e.parent,e.z,e.group?1:0,t.a,t.b,t.c,t.d,t.tx,t.ty,e.kind,e.name,e.sourceWidth,e.sourceHeight,e.pressed,e.primitive,e.imageColor,e.imageId,e.imageSource,e.imageType,e.fillType,e.fillHorizontalType,e.fillVerticalType,e.fillAmount,e.enableMask,e.enableSoftEdge,e.softEdgeMode,e.softEdgeWidthX,e.softEdgeWidthY,e.text,e.fontSize,e.fontColor,e.bgColor,e.adaptiveFontSize,e.minimumFontSize,JSON.stringify(e.textLayout),e.enableOutline,e.outlineColor,e.horizontalAlignment,e.verticalAlignment,JSON.stringify(e.scroll),e.clipToParent].join(" ")}function Xr(e,t,i,n,a,o){return{id:e.Id,parent:t,z:a,group:o>=16,matrix:Tc(n,e,i),...Br(e,n)}}function Pc(e){let t=ye({width:e.runtime.canvasWidth,height:e.runtime.canvasHeight}),i=new Set,n=new Map,a=new Map;function o(c,l,f){let u=He(l,c);if(u.activeInHierarchy=f&&c.active!==!1,a.set(c.Id,u),c.visible===!1||!u.activeInHierarchy)return!1;let p=c.children||[],m=ga.has(c.kind),g=0;for(let b=0;b<p.length;b+=1)o(p[b],u,u.activeInHierarchy)&&(m=!0,g+=1);return m?(i.add(c.Id),n.set(c.Id,g),!0):!1}function r(c,l,f,u){if(!i.has(c.Id))return;let p=a.get(c.Id);s.push(Xr(c,l,f,p,u,n.get(c.Id)||0));let m=c.children||[];for(let g=0;g<m.length;g+=1)r(m[g],c.Id,p,g)}let s=[];for(let c=0;c<e.runtime.roots.length;c+=1)o(e.runtime.roots[c],t,!0),r(e.runtime.roots[c],null,null,c);return{nodes:s,childCounts:n}}function ua(e){let t=e._playChildDirty===!0||e._playDeepDirty===!0;if(e._playDirty=!1,e._playChildDirty=!1,e._playDeepDirty=!1,!t)return;let i=e.children;for(let n=0;n<i.length;n+=1)ua(i[n])}function Rc(e,t){let i=ye({width:e.runtime.canvasWidth,height:e.runtime.canvasHeight}),n=[],a=[],o=t.count,r=e.runtime._playRemoved||[];for(let l=0;l<r.length;l+=1){let f=r[l];t.fingerprints.has(f)&&(a.push(f),t.fingerprints.delete(f),t.childCounts.delete(f),o-=1)}e.runtime._playRemoved=[];function s(l){t.fingerprints.has(l.Id)&&(a.push(l.Id),t.fingerprints.delete(l.Id),t.childCounts.delete(l.Id),o-=1);let f=l.children;for(let u=0;u<f.length;u+=1)s(f[u])}function c(l,f,u,p,m,g){let b=g||l._playDeepDirty===!0,v=b||l._playDirty===!0,S=b||l._playChildDirty===!0;if(!v&&!S)return;if(!(m&&l.active!==!1)||l.visible===!1){s(l);return}let F=He(f,l),N=t.childCounts.get(l.Id)||0;if(S){N=0;let A=l.children;for(let I=0;I<A.length;I+=1)c(A[I],F,l.Id,I,!0,b),t.fingerprints.has(A[I].Id)&&(N+=1)}if(!(ga.has(l.kind)||N>0)){t.fingerprints.has(l.Id)&&(a.push(l.Id),t.fingerprints.delete(l.Id),t.childCounts.delete(l.Id),o-=1);return}let Y=t.childCounts.get(l.Id);t.childCounts.set(l.Id,N);let j=N>=16!=(Y||0)>=16;if(!v&&!j&&t.fingerprints.has(l.Id))return;let O=Xr(l,u,f===i?null:f,F,p,N),w=Yr(O);t.fingerprints.get(O.id)!==w&&(t.fingerprints.has(O.id)||(o+=1),t.fingerprints.set(O.id,w),n.push(O))}for(let l=0;l<e.runtime.roots.length;l+=1)c(e.runtime.roots[l],i,null,l,!0,!1);return t.count=o,{changed:n,removed:a,count:o}}function Mc(e,t){let i=e.viewCache||(e.viewCache={rev:0,fingerprints:new Map,childCounts:new Map,count:0}),n=Number(t);if(!(Number.isFinite(n)&&n===i.rev&&i.fingerprints.size>0)){let{nodes:c,childCounts:l}=Pc(e);i.rev+=1,i.fingerprints=new Map(c.map(f=>[f.id,Yr(f)])),i.childCounts=l,i.count=c.length;for(let f of e.runtime.roots)ua(f);return{format:"tree-v1",revision:i.rev,reset:!0,count:c.length,nodes:c}}let{changed:o,removed:r,count:s}=Rc(e,i);i.rev+=1;for(let c of e.runtime.roots)ua(c);return{format:"tree-v1",revision:i.rev,reset:!1,count:s,changed:o,removed:r}}function ya(e,{inspect:t=!1,view:i=!1,paint:n=!1,sceneRev:a,compact:o=!1}={}){cn(e),e.audioSessionId||=zr();let r=e.runtime,s=e.compiled,[c,l]=[r.canvasWidth,r.canvasHeight];e.server&&e.server.setClock(r.clock.time);let f=o?r.logs.slice(-100):r.logs,u=Cc(e),p=e.server?e.server.snapshot():{vars:{},inbound:[],outbound:[],logs:[]};o&&(p.inbound=p.inbound.slice(-100),p.outbound=p.outbound.slice(-100),p.logs=p.logs.slice(-100));let m={canvasId:s.canvasId,platform:s.platform,device:r.device,canvasWidth:c,canvasHeight:l,canvasPresets:wc,playerCount:e.playerCount||1,viewPlayerIndex:e.viewPlayerIndex||1,players:Array.from({length:e.playerCount||1},(g,b)=>({index:b+1,label:`\u73A9\u5BB6${b+1}`,entityType:`Player${b+1}`})),time:r.clock.time,frame:r.clock.frame,paused:!!e.debugPaused,levelTimePaused:!!r.clock.paused,audio:{sessionId:e.audioSessionId,playerIndex:e.viewPlayerIndex||1,...r.audioSnapshot()},effects:Nc(e),mountError:e.mountError||r.mountErrors[0]||null,logs:f.map(g=>({source:"client",level:g.level,text:g.text,time:g.time})),tree:[],paint:[],scene:null,server:p,history:(o?u.slice(-100):u).map(g=>({t:g.t,source:g.source||"user",kind:g.kind,payload:g.payload||{}}))};if(t||n){let g=wi(e);t&&(m.tree=r.roots.map(b=>Dr(b,g))),n&&(m.paint=_c(e,g))}return i&&(m.scene=Mc(e,a)),Ft(m),m}function Nc(e){let t=r=>r._uiAnimation?.playing&&r.animationId!=null&&String(r.animationId).trim()!==""&&Number(r.animationId)!==0;if(![...e.runtime.uiAnimations||[]].some(t))return[];let i=wi(e),n=pa(e,i),a=[],o=(r,s=[])=>{let c=i.get(r.Id),l=n.get(r.Id);if(!c||!l||!c.activeInHierarchy||r.visible===!1)return;let f=r.kind==="image"&&r.enableMask===!0?ni({...r,id:r.Id,sourceWidth:c.width,sourceHeight:c.height},bt(l,c.centerX,c.centerY)):null,u=f?[...s,f]:s,p=r._uiAnimation;if(t(r)){let m=Mr(r.animationId,r.kind),g=m?.audio.length?m.audio[(r.Id+p.generation-1)%m.audio.length]:null;a.push({id:r.Id,kind:r.kind,animationId:r.animationId??null,generation:p.generation,startedAt:p.startedAt,playSoundEffect:r.playSoundEffect!==!1,audioPath:g,layer:r.kind==="fullscreen"?"BelowAllControls":Te(r.layer)||"AboveAllControls",matrix:bt(l,c.centerX,c.centerY),masks:u})}for(let m of[...r.children].reverse()){let g=r._gridItems?.includes(m)?{id:`viewport:${r.Id}`,matrix:bt(l,c.centerX,c.centerY),width:c.width,height:c.height,featherX:0,featherY:0}:null;o(m,g?[...u,g]:u)}};for(let r of e.runtime.roots)o(r);return a}function dn(e,t=1/30){let i=e.runtimes||(e.runtime?[e.runtime]:[]);for(let n of i)n.step(t);e.server&&(e.server.setClock(e.runtime.clock.time),e.server.flush())}function va(e,t){rt(e,{kind:"key",payload:{typeName:String(t)}}),e.runtime.injectKey(t)}function Fc(e,t){let i=null;for(let n of e.runtime.roots)Be(n,a=>{!i&&a.name===t&&(i=a)});return i}function wa(e,t){rt(e,{kind:"click",payload:{name:String(t)}});let i=Fc(e,t);i&&Sa(i)&&(i.kind==="button"||i.kind==="cursor")&&i.SimulateCursorClick()}function Oc(e,t){return!e||!t?null:e.children.find(i=>i.authoringId===t||i.Id===t)||null}var Hr={unavailable:"unavailableChildId",hover:"hoverChildId",pressed:"pressedChildId",selected:"selectedChildId"};function Ur(e,t){let i=[];for(let[n,a]of Object.entries(Hr)){let o=t[a]?Oc(t,t[a]):null;o&&i.push({state:n,child:o})}return i}function zc(e){for(let t of e.runtime.roots)Be(t,i=>{if(i.kind==="button"){for(let{child:n}of Ur(e,i))e.stateRestores.has(n.Id)||e.stateRestores.set(n.Id,{child:n,active:n.active,visible:n.visible}),n.active=!0,n.visible=!1,typeof n.markPlayDirty=="function"&&n.markPlayDirty(!0);yi(e,i)}})}function yi(e,t){if(!t||t.kind!=="button")return;let i=null;t.interactable===!1?i="unavailable":t.pressed===!0?i="pressed":e.hoveredControl===t?i="hover":e.selectedControl===t&&(i="selected");for(let n of Ur(e,t))n.child.active=!0,n.child.visible=n.state===i,typeof n.child.markPlayDirty=="function"&&n.child.markPlayDirty(!0)}function fa(e){if(!e)return null;let t=e.parent;return t?.kind==="button"&&Object.values(Hr).map(n=>t[n]).filter(Boolean).includes(e.authoringId)?t:e}function Sa(e){return e.kind==="button"?e.raycastTarget!==!1&&e.interactable!==!1:e.kind==="cursor"||e.kind==="grid"?e.raycastTarget!==!1:e.kind==="textwindow"?e.interactable!==!1:e.raycastTarget===!0}function ha(e){return e.kind==="container"||e.kind==="grid"||e.kind==="textwindow"||e.kind==="reference"||e.kind==="button"}function $c(e){return e.kind==="grid"||e.kind==="textwindow"}function jr(e,t){let i=e.Id,n=t.get(i);if(n!==void 0)return n;let a=Sa(e);if(!a&&ha(e)){let o=e.children;for(let r=0;r<o.length;r+=1)if(jr(o[r],t)){a=!0;break}}return t.set(i,a),a}function sn(e,t,i){cn(e);let n=ye({width:e.runtime.canvasWidth,height:e.runtime.canvasHeight}),a=new Map;function o(s,c,l,f){if(!f||s.active===!1||s.visible===!1||!jr(s,a))return null;let u=He(c,s),p=ei(l,u,s),m=zt(p);if(!m)return null;let g=Me(m,t,i),b=g.x>=u.left&&g.x<=u.right&&g.y>=u.bottom&&g.y<=u.top;if(!b&&(!ha(s)||$c(s)))return null;if(b&&ln(s)){let v=rn(s._scroll,u.width,u.height)?.track,S=g.x-u.centerX,x=u.centerY-g.y;if(v&&S>=v.x&&S<=v.x+v.width&&x>=v.y&&x<=v.y+v.height)return s}if(ha(s))for(let v=0;v<s.children.length;v+=1){let S=o(s.children[v],u,p,!0);if(S)return S}return b&&Sa(s)?s:null}let r=Ot();for(let s=e.runtime.roots.length-1;s>=0;s-=1){let c=o(e.runtime.roots[s],n,r,!0);if(c)return c}return null}function Ut(e,t,i,{dragging:n=!1,press:a=null,previous:o=null}={}){let r=a||{x:t,y:i},s=o||{x:t,y:i};return e.runtime.makeCursorEventData({x:t,y:i,pressX:r.x,pressY:r.y,deltaX:t-s.x,deltaY:i-s.y,dragging:n})}function ma(e,t,i){t.kind==="grid"||t.kind==="textwindow"||(t.pressed=i,typeof t.markPlayDirty=="function"&&t.markPlayDirty(),yi(e,t))}function ln(e){if(!e?.alive||!e.activeInHierarchy||e.interactable===!1||e.raycastTarget===!1)return!1;for(let t=e;t;t=t.parent)if(t.visible===!1)return!1;return e._scroll?.max>0}function Nr(e){for(let t=e;t;t=t.parent)if(ln(t))return t;return null}function Fr(e,t,i,n){let a=wi(e),o=a.get(t.Id),r=pa(e,a).get(t.Id),s=r&&zt(r);if(!o||!s)return null;let c=Me(s,i,n);return{x:c.x-o.centerX,y:o.centerY-c.y,width:o.width,height:o.height}}function Or(e,t,i){let n=e.pointerDownControl;if(n?.alive){let a=Ut(e,t,i,{dragging:e.pointerDragging,press:e.pointerDownPosition,previous:e.pointerLastPosition});e.runtime.injectCursor(n,"CursorUp",a),e.pointerDragging&&!e.pointerScroll&&e.runtime.injectCursor(n,"CursorEndDrag",a),ma(e,n,!1)}e.pointerDownControl=null,e.pointerScroll=null,e.pointerDownPosition=null,e.pointerDragging=!1,e.pointerLastPosition={x:t,y:i}}function vi(e,t,i,n,a={}){let o=Number(i),r=Number(n);if(!Number.isFinite(o)||!Number.isFinite(r))throw new Error("pointer coordinates must be finite");e.runtime.cursor.x=o,e.runtime.cursor.y=r;let s=Number(a.deltaX??0),c=Number(a.deltaY??0);if(t==="wheel"&&(!Number.isFinite(s)||!Number.isFinite(c)))throw new Error("wheel deltas must be finite");if(a.silent||rt(e,{kind:"pointer",payload:{type:t,x:o,y:r,...t==="wheel"?{deltaX:s,deltaY:c}:{}}}),t==="wheel"){let l=sn(e,o,r),f=Nr(l);if(f){let u=f._scroll.horizontal&&s||c;da(f,f._scroll.offset+u)}return l}if(t==="cancel")return Or(e,o,r),null;if((t==="move"||t==="up")&&e.pointerScroll&&!ln(e.pointerScroll.control)&&Or(e,o,r),t==="move"){let l=e.pointerLastPosition||{x:o,y:r},f=e.pointerHoverControl,u=fa(sn(e,o,r)),p=Ut(e,o,r,{previous:l});f&&f!==u&&e.runtime.injectCursor(f,"CursorExit",p),u&&f!==u&&e.runtime.injectCursor(u,"CursorEnter",p),e.pointerHoverControl=u;let m=e.hoveredControl;e.hoveredControl=u?.kind==="button"?u:null,m&&m!==e.hoveredControl&&yi(e,m),e.hoveredControl&&yi(e,e.hoveredControl);let g=e.pointerDownControl,b=e.pointerScroll;if(b)if(!ln(b.control))e.pointerScroll=null;else{let v=Fr(e,b.control,o,r);if(v){let S=b.control._scroll,x=S.horizontal?v.x-b.start.x:v.y-b.start.y,F=rn(S,v.width,v.height)?.travel||0,N=b.bar?F?x*S.max/F:0:-x;da(b.control,b.offset+N)}}if(g?.alive){let v=e.pointerDownPosition||l,S=Math.hypot(o-v.x,r-v.y)>5;!e.pointerDragging&&S&&(b||e.runtime.injectCursor(g,"CursorBeginDrag",Ut(e,o,r,{press:v,previous:l,dragging:!1})),e.pointerDragging=!0),e.pointerDragging&&!b&&e.runtime.injectCursor(g,"CursorDrag",Ut(e,o,r,{press:v,previous:l,dragging:!0}))}return e.pointerLastPosition={x:o,y:r},u}if(t==="down"){let l=fa(sn(e,o,r));e.pointerDownControl=l,e.pointerDownPosition={x:o,y:r},e.pointerLastPosition={x:o,y:r},e.pointerDragging=!1,e.pointerScroll=null;let f=Nr(l);if(f){let u=Fr(e,f,o,r),p=u&&rn(f._scroll,u.width,u.height),m=b=>u.x>=b.x&&u.x<=b.x+b.width&&u.y>=b.y&&u.y<=b.y+b.height,g=p&&m(p.track);if(g&&!m(p.thumb)){let b=f._scroll.horizontal?u.x-p.track.x-p.thumb.width/2:u.y-p.track.y-p.thumb.height/2;da(f,p.travel?b/p.travel*f._scroll.max:0),cn(e)}u&&(e.pointerScroll={control:f,start:u,offset:f._scroll.offset,bar:!!g})}return l&&(ma(e,l,!0),e.runtime.injectCursor(l,"CursorDown",Ut(e,o,r))),l}if(t==="up"){let l=e.pointerDownControl,f=fa(sn(e,o,r));if(l?.alive){let u=Ut(e,o,r,{press:e.pointerDownPosition,previous:e.pointerLastPosition,dragging:e.pointerDragging});if(e.runtime.injectCursor(l,"CursorUp",u),e.pointerDragging)e.pointerScroll||e.runtime.injectCursor(l,"CursorEndDrag",u);else if(f===l&&!e.pointerScroll?.bar){e.runtime.injectCursor(l,"CursorClick",u);let p=e.selectedControl;e.selectedControl=l.kind==="button"?l:null,p&&p!==e.selectedControl&&yi(e,p)}ma(e,l,!1)}return e.pointerDownControl=null,e.pointerDownPosition=null,e.pointerLastPosition={x:o,y:r},e.pointerDragging=!1,e.pointerScroll=null,f}if(t==="click")return vi(e,"down",o,r,{silent:!0}),vi(e,"up",o,r,{silent:!0});throw new Error(`unknown pointer type ${t}`)}function xa(e,t,i,n){if(!e?.server)throw new Error("play session has no server");return rt(e,{kind:"serverSet",payload:{entityType:t,name:i,value:n,playerIndex:e.viewPlayerIndex}}),e.server.setVar(t,i,n,{playerIndex:e.viewPlayerIndex})}function Lr(e,t,i){if(!e?.server)throw new Error("play session has no server");let n=e.server.getVar(t,i,{playerIndex:e.viewPlayerIndex});return n===void 0?null:n}function Ia(e,t,i=[],n="PlayerSelf"){if(!e?.server)throw new Error("play session has no server");return rt(e,{kind:"serverSend",payload:{name:t,params:i,target:n,playerIndex:e.viewPlayerIndex}}),e.server.sendToClient(t,i,{target:n,playerIndex:e.viewPlayerIndex})}function fn(e){return{snapshot:t=>ya(e,t),step:t=>dn(e,t),pointer:(t,i,n,a)=>vi(e,t,i,n,a),key:t=>va(e,t),click:t=>wa(e,t),view:t=>ba(e,t),pause:()=>{rt(e,{kind:"pause",payload:{}}),e.debugPaused=!0},resume:()=>{rt(e,{kind:"resume",payload:{}}),e.debugPaused=!1},serverSet:(t,i,n)=>xa(e,t,i,n),serverSend:(t,i,n)=>Ia(e,t,i,n)}}function Ea(e){e?.server&&e.server.destroy();let t=e?.runtimes||(e?.runtime?[e.runtime]:[]);for(let i of t)i.destroy()}function Ca(e,t){return JSON.stringify(e)===JSON.stringify(t)}function Kr(e,t){for(let i of e||[])t(i),i.children?.length&&Kr(i.children,t)}function ka(e,{id:t,name:i}){let n=null;return Kr(e,a=>{n||(t&&String(a.id)===String(t)||!t&&i&&a.name===i)&&(n=a)}),n}function Dc(e,t){if(e){if(Object.prototype.hasOwnProperty.call(e,t))return e[t];if(e.box&&Object.prototype.hasOwnProperty.call(e.box,t))return e.box[t]}}function Gc(e){return{var(t,i){return e.server?.vars?.[t]?.[i]?.value??null},logs(){return(e.logs||[]).map(t=>t.text)},logContains(t){return(e.logs||[]).some(i=>String(i.text||"").includes(String(t)))},serverLogs(){return(e.server?.logs||e.serverLogs||[]).map(t=>t.text)},serverLogContains(t){return(e.server?.logs||e.serverLogs||[]).some(i=>String(i.text||"").includes(String(t)))},control(t){let i=ka(e.tree,{name:String(t)});return i?{id:i.id,name:i.name,kind:i.kind,active:i.active,visible:i.visible,pressed:i.pressed,text:i.text,interactable:i.interactable}:null},signals(t){let i=t==="outbound"?"outbound":"inbound";return(e.server?.[i]||[]).map(n=>({name:n.name,values:n.values}))}}}function Vc(e,t){if(e.kind==="log"){let i=e.source==="server"?t.server?.logs||t.serverLogs||[]:t.logs||[];return i.some(a=>e.level&&a.level!==e.level?!1:String(a.text||"").includes(e.contains))?{ok:!0,actual:e.contains}:{ok:!1,actual:i.map(a=>a.text).slice(-8),expected:e.contains}}if(e.kind==="control"){let i=ka(t.tree,e);if(!i)return{ok:!1,actual:null,expected:e.equals,message:`control not found: ${e.id||e.name}`};let n=Dc(i,e.field);return Ca(n,e.equals)?{ok:!0,actual:n}:{ok:!1,actual:n,expected:e.equals}}if(e.kind==="var"){let i=t.server?.vars?.[e.entityType],a=!i||!Object.prototype.hasOwnProperty.call(i,e.name)?null:i[e.name].value;return Ca(a,e.equals)?{ok:!0,actual:a}:{ok:!1,actual:a,expected:e.equals}}if(e.kind==="signal"){let i=e.direction==="outbound"?t.server?.outbound||[]:t.server?.inbound||[],n=i.find(a=>a.name===e.name&&(e.values===void 0||Ca(a.values,e.values)));return n?{ok:!0,actual:n.values}:{ok:!1,actual:i.map(a=>({name:a.name,values:a.values})),expected:{name:e.name,values:e.values??null}}}if(e.kind==="tree"){let i=!!ka(t.tree,{name:e.name});return i===e.exists?{ok:!0,actual:i}:{ok:!1,actual:i,expected:e.exists}}return{ok:!1,message:`unsupported assert kind ${e.kind}`}}function Bc(e,t){let i=ui();try{return i.evalQueryScript(e,Gc(t)),{ok:!0,actual:!0}}catch(n){return{ok:!1,message:n?.message||String(n)}}finally{i.destroy()}}function qr(e,t){return e.kind==="lua"?Bc(e.source,t):Vc(e,t)}function Yc(e,t){let i=t>0?t:Et;return Math.round((e+i)*1e9)/1e9}function Xc(e,t){let i=t.payload||{};if(t.kind==="pointer")e.pointer(i.type,i.x,i.y,i);else if(t.kind==="key")e.key(i.typeName);else if(t.kind==="click")e.click(i.name);else if(t.kind==="pause")e.pause();else if(t.kind==="resume")e.resume();else if(t.kind==="serverSet")e.serverSet(i.entityType,i.name,i.value);else if(t.kind==="serverSend")e.serverSend(i.name,i.params,i.target);else if(t.kind==="view")e.view(i.playerIndex);else throw new Error(`unsupported event kind: ${t.kind}`)}function Hc(e,t){let i=qr(e,t);return{kind:e.kind,at:Number(e.at||0),ok:!!i.ok,actual:i.actual??null,expected:i.expected??null,message:i.message||""}}function Wr(e,t){let i=gi(t),n=i.events.slice().sort((S,x)=>S.t-x.t),a=i.asserts.slice(),o=i.dt||Et,r=n.reduce((S,x)=>Math.max(S,x.t),0),s=a.reduce((S,x)=>Math.max(S,Number(x.at||0)),0),c=Math.max(r,s),l=0,f=[],u=0,p=a.some(S=>S.kind==="control"||S.kind==="tree"||S.kind==="lua"),m=e.snapshot({inspect:p}),g=()=>{for(;l<n.length&&n[l].t<=u+1e-9;)Xc(e,n[l]),l+=1,m=e.snapshot({inspect:p})},b=()=>{for(let S of a)if(!S._done&&Number(S.at||0)<=u+1e-9){let x=Hc(S,m);if(f.push(x),S._done=!0,!x.ok)return{passed:!1,failedAt:u,frame:m.frame||0,results:f,snapshot:m}}return null};g();let v=b();if(v)return Aa(i,v);for(;u+1e-9<c;){e.step(o),u=Yc(u,o),m=e.snapshot({inspect:p}),g();let S=b();if(S)return Aa(i,S)}return Aa(i,{passed:f.every(S=>S.ok),failedAt:null,frame:m.frame||0,results:f,snapshot:m})}function Aa(e,t){return G({format:e.format,name:e.name,passed:t.passed,failedAt:t.failedAt,frame:t.frame,results:t.results,snapshot:{time:t.snapshot?.time??0,frame:t.snapshot?.frame??0,logs:t.snapshot?.logs||[],serverLogs:t.snapshot?.serverLogs||t.snapshot?.server?.logs||[],server:t.snapshot?.server||{vars:{},inbound:[],outbound:[],logs:[]}}})}function _a(e){return Array.isArray(e)?e.slice():[]}import{createHash as Uc}from"node:crypto";var Jr=e=>Uc("sha256").update(JSON.stringify(e.map(({id:t,path:i,source:n})=>({id:t,path:i,source:n})))).digest("hex");function Ta(e,t=[]){let i=[],n=new Map,a=new Map;for(let s of t)a.set(s.controlId,(a.get(s.controlId)||0)+1);function o(s){let c=(s.children||[]).map(o),l={controlCount:1+c.reduce((f,u)=>f+u.controlCount,0),scriptCount:(a.get(s.id)||0)+c.reduce((f,u)=>f+u.scriptCount,0)};return n.set(s.id,l),l}o(e.root);function r(s,c="",l=[]){i.push({id:s.id,name:s.name,kind:s.kind,guid:s.guid,parentId:c,ancestorIds:l,depth:l.length,...n.get(s.id)});for(let f of s.children||[])r(f,s.id,[...l,s.id])}for(let s of e.root.children||[])r(s);return i}function Qr(e,t,{controlIds:i,includeScripts:n=!0}={}){if(!Array.isArray(i)||!i.length||i.some(b=>typeof b!="string"||!b))throw new Error("\u8BF7\u9009\u62E9\u81F3\u5C11\u4E00\u4E2A\u5BA2\u6237\u7AEF\u63A7\u4EF6 controlIds");if(typeof n!="boolean")throw new Error("includeScripts must be a boolean");let a=Ta(e,t),o=new Map(a.map(b=>[b.id,b]));for(let b of i)if(!o.has(b))throw new Error(`\u672A\u77E5\u5BA2\u6237\u7AEF\u63A7\u4EF6\uFF1A${b}`);let r=new Set(i),s=a.filter(b=>r.has(b.id)&&!b.ancestorIds.some(v=>r.has(v))),c=G(e),l=new Map;K(c.root,b=>l.set(b.id,b)),c.root.children=s.map(b=>l.get(b.id)),c.selectedId=s[0].id;let f=new Set;K(c.root,b=>{b.kind!=="server-container"&&f.add(b.id)});let u=[];for(let b of s)b.parentId&&u.push(`${b.name}\uFF1A\u4EC5\u5728\u5BFC\u51FA\u526F\u672C\u4E2D\u63D0\u5347\u4E3A\u72EC\u7ACB\u6A21\u677F\uFF0C\u4FDD\u7559\u56DB\u5E73\u53F0\u5C40\u90E8\u53D8\u6362\uFF1B\u5916\u90E8\u7236\u7EA7\u7684\u7F29\u653E\u3001\u65CB\u8F6C\u3001\u906E\u7F69\u53CA\u663E\u9690\u4E0D\u5305\u542B\u5728\u5185\u3002`);let p=new Set([...f].map(b=>l.get(b).guid));K(c.root,b=>{for(let v of["referencedPrefabId","itemPrefabId"]){let S=b[v];S&&!p.has(Number(S))&&u.push(`${b.name}\uFF1A\u5F15\u7528 ${S} \u4E0D\u5728\u672C\u6B21\u5BFC\u51FA\u4E2D\uFF0C\u8BF7\u540C\u65F6\u5BFC\u5165\u5BF9\u5E94\u6A21\u677F\u3002`)}b.giaRaw?.templateRefSlotBase64&&u.push(`${b.name}\uFF1A\u4E8C\u8FDB\u5236\u6A21\u677F\u5F15\u7528\u539F\u6837\u4FDD\u7559\uFF0C\u65E0\u6CD5\u81EA\u52A8\u5224\u65AD\u5916\u90E8\u4F9D\u8D56\u3002`),!n&&b.scriptMappingIds?.length&&(b.scriptMappingIds=[])});let m=n?t.filter(b=>!b.controlId||f.has(b.controlId)):[];for(let b of m)!b.source&&b.path&&u.push(`${b.path}\uFF1A\u4EC5\u767B\u8BB0\u4E86\u8DEF\u5F84\uFF0C\u6CA1\u6709\u5185\u8054\u6E90\u7801\uFF1B\u8BF7\u6838\u5BF9\u6E38\u620F\u5185\u7684\u811A\u672C\u6587\u4EF6\u3002`);n&&m.some(b=>!b.controlId)&&u.push("\u5DF2\u5305\u542B\u672A\u6302\u8F7D\u7684 Lua \u6A21\u5757\uFF1BLua \u52A8\u6001\u5F15\u7528\u65E0\u6CD5\u81EA\u52A8\u5224\u65AD\uFF0C\u8BF7\u6838\u5BF9\u5916\u90E8\u6A21\u677F\u548C\u811A\u672C\u4F9D\u8D56\u3002"),!n&&t.some(b=>f.has(b.controlId))&&u.push("\u672C\u6B21\u672A\u5305\u542B\u6302\u8F7D\u811A\u672C\uFF0C\u5BFC\u5165\u540E\u9700\u53E6\u884C\u5BFC\u5165\u5E76\u6302\u8F7D\u3002");let g=new Set(m.map(b=>b.guid));return n&&K(c.root,b=>{for(let v of b.scriptMappingIds||[])g.has(v)||u.push(`${b.name}\uFF1A\u811A\u672C\u6620\u5C04 ${v} \u7684\u6E90\u7801\u672A\u767B\u8BB0\uFF0C\u8BF7\u53E6\u884C\u5BFC\u5165\u3002`)}),{project:c,scripts:m,warnings:[...new Set(u)],selection:{controlIds:s.map(b=>b.id),controlCount:f.size,templateCount:s.length,scriptCount:m.length,includeScripts:n}}}var Qc={Level:"\u5173\u5361",PlayerSelf:"\u5F53\u524D\u73A9\u5BB6",AvatarSelf:"\u5F53\u524D\u89D2\u8272",...Object.fromEntries(xt.map((e,t)=>[e,`\u73A9\u5BB6${t+1}`])),...Object.fromEntries(Array.from({length:8},(e,t)=>[`Avatar${t+1}`,`\u89D2\u8272${t+1}`]))};function Zc(e,t=1){let i=e?.vars||{},n=[],a=Number(t)>0?Number(t):1,o=["Level","PlayerSelf","AvatarSelf"];if(a>1)for(let s=1;s<=a;s+=1)o.push(`Player${s}`,`Avatar${s}`);let r=new Set;for(let s of o){if(r.has(s)||!i[s])continue;r.add(s);let c=i[s]||{};for(let l of Object.keys(c))n.push(G({entityType:s,entityLabel:Qc[s]||s,name:l,type:c[l]?.type||"",value:c[l]?.value??null}))}return n}var At="qxqy-simulator-save",e0="qxqy-simulator-scripts",se="server-control-template",H="client-control-template",Pa={[se]:"\u670D\u52A1\u5668\u63A7\u4EF6\u6A21\u677F",[H]:"\u5BA2\u6237\u7AEF\u63A7\u4EF6\u6A21\u677F"};function Ct(e){return e===H?"client":"server"}function is(e){if(!(typeof e=="number"||typeof e=="string"&&/^\d+$/.test(e.trim()))||!ke(e))throw new Error(`\u63A7\u4EF6\u7D22\u5F15\u5FC5\u987B\u662F ${1073741824}\u2013${1077936127}\uFF080x40000000\u20130x403FFFFF\uFF09\u8303\u56F4\u5185\u7684\u6574\u6570`);return Number(e)}function un(e){let t=typeof e=="number"||typeof e=="string"&&/^\d+$/.test(e.trim()),i=Number(e);if(!t||!Ue(i))throw new Error("\u63A7\u4EF6\u7D22\u5F15\u5FC5\u987B\u662F 1\u20132147483647 \u8303\u56F4\u5185\u7684\u6574\u6570");return i}function Ra(e=[]){if(!Array.isArray(e))throw new Error("controlGuidChanges \u5FC5\u987B\u662F\u6570\u7EC4");let t=new Set;return e.map(i=>{if(!i||typeof i.id!="string"||!i.id||t.has(i.id)||![se,H].includes(i.controlAsset)||typeof i.controlId!="string"||!i.controlId||typeof i.controlName!="string")throw new Error("controlGuidChanges \u5305\u542B\u65E0\u6548\u6216\u91CD\u590D\u7684\u53D8\u66F4\u8BB0\u5F55");if(t.add(i.id),i.batchId!==void 0&&(typeof i.batchId!="string"||!i.batchId))throw new Error("controlGuidChanges \u5305\u542B\u65E0\u6548\u7684 batchId");if(i.scriptSignature!==void 0&&!/^[a-f0-9]{64}$/.test(i.scriptSignature))throw new Error("controlGuidChanges \u5305\u542B\u65E0\u6548\u7684 scriptSignature");return{id:i.id,controlAsset:i.controlAsset,controlId:i.controlId,controlName:i.controlName,oldGuid:un(i.oldGuid),newGuid:un(i.newGuid),...i.batchId?{batchId:i.batchId}:{},...i.scriptSignature?{scriptSignature:i.scriptSignature}:{}}})}function t0(e){let t=[e?.guid,e?.id];for(let i of t){let n=Number(i);if(Ue(n))return n}return 0}function hn(e){let t=String(e?.controlAsset||""),i=t0(e);return{id:String(i||e?.id||""),guid:i,path:String(e?.path||""),source:String(e?.source||""),controlId:String(e?.controlId||""),controlAsset:t===H||t==="client"?H:t===se||t==="server"?se:""}}function i0(e){let t=[],i=(n,a="")=>{if(n&&(n.path||n.source)){let o=hn(n);t.push(a?{...o,controlAsset:a}:o)}};if(Array.isArray(e?.assets?.scripts)){for(let n of e.assets.scripts)n&&(n.path||n.source)&&t.push(hn(n));return t}if(i(e?.assets?.server?.script,se),i(e?.assets?.client?.script,H),e&&e.format!==At){i(e?.script);for(let n of e?.scripts||[])i(n)}return t}function Ma(e){return at(e===H?Dt():ht())}var n0="\u672A\u7ED1\u5B9A",kt="\u672A\u547D\u540D\u5B58\u6863",a0="\u672A\u547D\u540D\u754C\u9762";function o0(e){let t=e;for(let i=0;i<8;i++){if(Si(es(t,"simulator","studio"))&&Si(es(t,"lua")))return t;let n=Wc(t);if(n===t)break;t=n}return e}function r0(e){return e?{name:jt(e),path:e,bound:!0}:{name:n0,path:"",bound:!1}}function s0(e,t=process.cwd()){if(Jc(e)&&Si(e))return e;let i=t||process.cwd(),n=o0(i),a=ts(n,e);if(Si(a))return a;let o=ts(i,e);if(Si(o))return o;throw new Error("script file not found: "+e)}function Na(e,t={}){e?.format===At&&Yn(e.version);let i=[],n=typeof t.workspacePath=="string"&&t.workspacePath?t.workspacePath:"",a=e?.format===At&&e.assets,o=Ra(e?.controlGuidChanges),r=mn(e?.scriptSync),s=a?null:at(e,{warnings:i}),c={server:a&&e.assets.server?at(e.assets.server,{warnings:i}):Ma(se),client:a&&e.assets.client?at(e.assets.client,{warnings:i}):Ma(H)};s&&(c[Ct(s.meta.assetType)]=s);let l=a&&e.activeAssetType===H?H:s?.meta.assetType||se,f=a&&e.meta?.name?String(e.meta.name):"",u=()=>f||kt;!e?.meta?.name&&c.server.meta.name==="\u672A\u547D\u540D\u754C\u9762\u63A7\u4EF6\u7EC4"&&(c.server.meta.name=a0);let p=[],m=new Set;function g(){m.clear(),$t(c.server.root,m),$t(c.client.root,m,{skipServerContainer:!0});for(let h of p)Ue(h.guid)&&m.add(Number(h.guid))}function b(h=0){g();let y=Ue(h)&&!m.has(Number(h))?Number(h):Ze(m);return m.add(y),y}function v(h){let y=hn(h),E=b(y.guid);return{...y,guid:E,id:String(E)}}Kt(i0(e));let S=bi(e?.serverLogic),x=null,F="",N=1,V=1;function Y(h){let y=String(h||"").trim();if(!y)return"";if(!ie[y])throw new Error(`unknown canvas preset: ${y} (available: ${Object.keys(ie).join(", ")})`);return y}let j=()=>c[Ct(l)];function O(h){if(!h)return null;for(let[y,E]of[["server",c.server],["client",c.client]]){let T=he(E.root,h);if(T&&T.kind!=="server-container")return{key:y,node:T}}return null}function w(h){if(!h.controlId)return null;let y=h.controlAsset===H?"client":h.controlAsset===se?"server":null;if(y){let E=he(c[y].root,h.controlId);return E&&E.kind!=="server-container"?{key:y,node:E}:null}return O(h.controlId)}function A(){for(let h of p)h.controlId&&!w(h)&&(h.controlId="",h.controlAsset="")}function I(h){if(!Ue(h))return null;for(let[y,E]of[[se,c.server],[H,c.client]]){let T="";if(K(E.root,M=>{!T&&(M.scriptMappingIds||[]).includes(Number(h))&&(T=M.id)}),T)return{controlId:T,controlAsset:y}}return null}function C(h,y,E){let T=c[Ct(h.controlAsset)],M=T&&he(T.root,h.controlId);M&&(M.scriptMappingIds=(M.scriptMappingIds||[]).map(B=>Number(B)===Number(y)?Number(E):B))}A();function $(){return p.map(h=>{let y=w(h),E=y?y.key==="client"?H:se:"";return G({id:h.id,guid:h.guid||0,path:h.path||"",source:h.source||"",controlId:h.controlId||"",controlAsset:h.controlAsset||E,controlName:y?.node.name||"",assetType:E,assetLabel:y?Pa[E]:"",mounted:!!y})})}function k(){let h=[],y=(E,T)=>{K(E.root,M=>{M.kind!=="server-container"&&h.push(G({id:M.id,name:M.name,kind:M.kind,assetType:T,assetLabel:Pa[T]}))})};return y(c.server,se),y(c.client,H),h}function _(h){let y=[];return K(h.root,E=>{E.kind!=="server-container"&&y.push(JSON.stringify({kind:E.kind,guid:E.guid,name:E.name,text:E.text??null,imageId:E.imageId??null,imageSource:E.imageSource??null,imageType:E.imageType??null,fontSize:E.fontSize??null,adaptiveFontSize:E.adaptiveFontSize??null,minimumFontSize:E.minimumFontSize??null,fontColor:E.fontColor??null,bgColor:E.bgColor??null,imageColor:E.imageColor??null,fillType:E.fillType??null,fillAmount:E.fillAmount??null,syncAllDevices:E.syncAllDevices!==!1,transformByPlatform:E.transformByPlatform||null}))}),y.join("/")}let X=_(Dt()),U=_(ht());function de(h){let y=_(h);return h.meta?.assetType===H?y===X:y===U}function L(h,y){return String(h||"").replace(/[\\/:*?"<>|]/g,"-").trim()||y}function we(h){let y=L(u(),kt),E=h.meta?.assetType===H?"\u5BA2\u6237\u7AEF\u63A7\u4EF6\u6A21\u677F":"\u670D\u52A1\u5668\u63A7\u4EF6\u6A21\u677F";return`${y} \xB7 ${E}`}function Pe(){if(!((c.server.root.children||[]).find(y=>y.kind==="container")||c.server.root.children?.[0]))throw new Error("\u6574\u5408\u5305\u9700\u8981\u670D\u52A1\u7AEF\u5BA2\u6237\u7AEF\u63A7\u4EF6\u5BB9\u5668\u4E0B\u81F3\u5C11\u6709\u4E00\u4E2A\u6839\u63A7\u4EF6");return Oo(c.server,c.client,{scripts:p,fileName:`${L(u(),kt)} \xB7 \u6574\u5408\u5305.gia`})}function _t(){let h=y=>({type:y.meta.assetType,name:y.meta.name,sourceFile:y.meta.sourceFile||""});return{format:At,name:u(),activeAssetType:l,assets:{server:h(c.server),client:h(c.client),scripts:$()}}}function Lt(){return G({format:At,version:4,meta:{name:u()},activeAssetType:l,serverLogic:S,controlGuidChanges:o,scriptSync:r,assets:{server:c.server,client:c.client,scripts:p.map(h=>G({id:h.id,guid:h.guid||0,path:h.path||"",source:h.source||"",controlId:h.controlId||"",controlAsset:h.controlAsset||""}))}})}function ne(){let h=j(),y=Un(h);if(y.workspace=r0(n),y.save=_t(),y.scripts=$(),y.mountTargets=k(),y.serverLogic=S,y.migrationWarnings=[...i],y.controlGuidChanges=G(o),l===H){let E=Gt(h,!0);y.clientGuidAutofill={count:E.length,templateCount:E.filter(({parent:T})=>T?.kind==="server-container").length,selectedOffset:E.findIndex(({node:T})=>T.id===y.selectedId)}}return y.scriptSync=G(r),Ua(y),y}function Oe(h){let y=j();if(h.expectedRevision!==void 0&&Number(h.expectedRevision)!==y.version)throw new Error(`revision conflict: expected ${h.expectedRevision}, current ${y.version}`);return y}function lt(h,y,E=""){let T=String(y||"");if(T){let M=E===H?H:E===se?se:"";if(!w({controlId:T,controlAsset:M}))throw new Error("\u6302\u8F7D\u76EE\u6807\u5FC5\u987B\u662F\u5B58\u6863\u5185\u7684\u5BA2\u6237\u7AEF\u63A7\u4EF6\u6216\u5BA2\u6237\u7AEF\u63A7\u4EF6\u6A21\u677F");h.controlAsset=M}else h.controlAsset="";h.controlId=T}function Ei(h){let y=Oe(h);if(h.op==="addScript"){let E=v({path:String(h.path||""),source:String(h.source||""),controlId:"",controlAsset:""});h.controlId!==void 0&&h.controlId!==""&<(E,h.controlId,h.controlAsset),p.push(E)}else if(h.op==="updateScript"){let E=p.find(T=>T.id===h.id);if(!E)throw new Error(`\u811A\u672C\u4E0D\u5B58\u5728: ${h.id}`);h.controlId!==void 0&<(E,h.controlId,h.controlAsset),h.path!==void 0&&(E.path=String(h.path)),h.source!==void 0&&(E.source=String(h.source))}else if(h.op==="removeScript"){let E=p.length;if(p=p.filter(T=>T.id!==h.id),p.length===E)throw new Error(`\u811A\u672C\u4E0D\u5B58\u5728: ${h.id}`)}return y.version+=1,ne()}function Ci(h){let y=Oe(h),E=he(y.root,h.id??y.selectedId);if(!E||E.kind==="server-container")throw new Error("\u4EC5\u5BA2\u6237\u7AEF\u63A7\u4EF6\u6216\u5BA2\u6237\u7AEF\u63A7\u4EF6\u6A21\u677F\u5141\u8BB8\u4FEE\u6539\u7D22\u5F15");let T=is(h.guid);if(un(E.guid),h.autoFillClientGuids!==void 0&&typeof h.autoFillClientGuids!="boolean")throw new Error("autoFillClientGuids \u5FC5\u987B\u662F\u5E03\u5C14\u503C");let M=h.autoFillClientGuids===!0;if(M&&l!==H)throw new Error("\u81EA\u52A8\u586B\u5145\u4EC5\u652F\u6301\u5BA2\u6237\u7AEF\u6A21\u677F\u5217\u8868\uFF1B\u670D\u52A1\u7AEF\u754C\u9762\u7684\u7D22\u5F15\u9700\u5355\u72EC\u586B\u5199");let B=M?Gt(y,!0).map(({node:z})=>z):[E],D=T-B.indexOf(E),q=B.map((z,oe)=>({node:z,oldGuid:un(z.guid),newGuid:is(D+oe)})),Z=q.filter(({oldGuid:z,newGuid:oe})=>z!==oe);if(!Z.length)return ne();let Ee=new Map(q.map(({oldGuid:z,newGuid:oe})=>[z,oe]));if(Ee.size!==q.length)throw new Error("\u5BA2\u6237\u7AEF\u6A21\u677F\u5B58\u5728\u91CD\u590D\u65E7\u7D22\u5F15\uFF0C\u65E0\u6CD5\u81EA\u52A8\u586B\u5145\uFF1B\u8BF7\u5148\u6D88\u9664\u6B67\u4E49");let Se=new Set(B),De=[];for(let z of Object.values(c))K(z.root,oe=>{z===c.client&&oe.kind==="server-container"||De.push({node:oe,project:z})});let xe=new Map([...De.filter(z=>!Se.has(z.node)).map(({node:z})=>[Number(z.guid),z.name]),...p.map(z=>[Number(z.guid),z.path||"Lua \u811A\u672C"])]);for(let{newGuid:z}of Z)if(xe.has(z))throw new Error(`\u63A7\u4EF6\u7D22\u5F15 ${z} \u5DF2\u88AB\u300C${xe.get(z)}\u300D\u5360\u7528\uFF1B\u8BF7\u5148\u586B\u5199\u5B83\u7684\u5B9E\u9645\u7D22\u5F15\u3002\u672C\u6B21\u672A\u4FEE\u6539\u4EFB\u4F55\u7D22\u5F15\u3002`);let Ge=[],te=(z,oe,Xe)=>{let Re=z?.[oe];(typeof Re=="number"||typeof Re=="string"&&/^\d+$/.test(Re.trim()))&&Ee.has(Number(Re))&&Ee.get(Number(Re))!==Number(Re)&&Ge.push({owner:z,key:oe,project:Xe.project,oldGuid:Number(Re),newGuid:Ee.get(Number(Re))})};for(let z of De)te(z.node,"referencedPrefabId",z),te(z.node,"itemPrefabId",z),te(z.node.giaRaw,"templateRefSlot",z);let le=new Map;for(let{node:z}of De)le.set(Number(z.guid),(le.get(Number(z.guid))||0)+1);for(let{oldGuid:z}of Ge)if(le.get(z)!==1)throw new Error(`\u65E7\u7D22\u5F15 ${z} \u5728\u591A\u68F5\u8D44\u4EA7\u6811\u4E2D\u91CD\u590D\uFF0C\u65E0\u6CD5\u786E\u5B9A\u6A21\u677F\u5F15\u7528\u5F52\u5C5E\uFF1B\u8BF7\u5148\u6D88\u9664\u6B67\u4E49\u540E\u4FEE\u6539`);let Jt=M?Zr():"",be=Jr(p);for(let{node:z,oldGuid:oe,newGuid:Xe}of Z)z.guid=Xe,o.push({id:Zr(),controlAsset:l,controlId:z.id,controlName:z.name,oldGuid:oe,newGuid:Xe,scriptSignature:be,...Jt?{batchId:Jt}:{}});let _i=new Set([y]);for(let{owner:z,key:oe,project:Xe,newGuid:Re}of Ge)z[oe]=typeof z[oe]=="string"?String(Re):Re,_i.add(Xe);for(let z of _i)z.version+=1;return ne()}function ae(h){let y=Oe(h);if(!Array.isArray(h.changeIds)||!h.changeIds.length||h.changeIds.some(T=>typeof T!="string"||!o.some(M=>M.id===T)))throw new Error("\u8BF7\u660E\u786E\u6307\u5B9A\u5DF2\u6838\u5BF9 Lua \u5F15\u7528\u7684\u6709\u6548\u7D22\u5F15\u53D8\u66F4\u8BB0\u5F55 changeIds");let E=new Set(h.changeIds);return o=o.filter(T=>!E.has(T.id)),y.version+=1,ne()}function ze(h){if(!h||typeof h!="object")throw new Error("patch requires op");if(h.op==="setScriptSync"){let y=Oe(h);return r=mn(h.config),y.version+=1,ne()}if(h.op==="setControlGuid")return Ci(h);if(h.op==="acknowledgeControlGuidChanges")return ae(h);if(h.op==="setServerLogic"){let y=Oe(h);return S=bi(h.logic),y.version+=1,ne()}if(h.op==="addScript"||h.op==="updateScript"||h.op==="removeScript")return Ei(h);if(h.op==="selectAsset")return l=h.assetType===H?H:se,ne();if(h.op==="renameSave"){let y=String(h.name||"").trim();if(!y)throw new Error("\u5B58\u6863\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A");return f=y,ne()}if(h.op==="newAsset"){let y=Oe(h);l=h.assetType===H?H:se;let E=Ma(l);return E.version=y.version+1,c[Ct(l)]=E,o=o.filter(T=>T.controlAsset!==l),A(),ne()}return jn(j(),h),A(),ne()}function $e(h){return p.filter(y=>{let E=w(y);return!!(E&&E.key==="client"==(h===H))})}function ki(){return G({assetType:H,revision:c.client.version,rows:Ta(c.client,$e(H))})}function Tt(h={}){if(h.expectedRevision!==void 0&&h.expectedRevision!==c.client.version)throw new Error("revision conflict: reload export choices");let y=p.filter(T=>!T.controlId||w(T)?.key==="client"),E=Qr(c.client,y,h);if(h.canvasId){if(!ie[h.canvasId])throw new Error(`unknown canvas preset: ${h.canvasId}`);E.project.canvasId=h.canvasId}return E}function Ai(h={}){let y=Tt(h);return G({snapshot:Un(y.project),selection:y.selection,warnings:y.warnings})}function Pt(h="json",y="",E={}){let T=as(h,y,E);if(o.length&&!["save","archive"].includes(String(h).toLowerCase())){let M=o.map(B=>`\u63A7\u4EF6\u7D22\u5F15\u5F85\u6838\u5BF9 Lua \u5F15\u7528\uFF1A${Pa[B.controlAsset]} / ${B.controlName} (${B.controlId})\uFF1A${B.oldGuid} \u2192 ${B.newGuid}\u3002\u8BF7\u6309\u8BED\u4E49\u66F4\u65B0\u811A\u672C\u4E2D\u7684\u63A7\u4EF6\u7D22\u5F15\u5F15\u7528\uFF0C\u6838\u5BF9\u540E\u786E\u8BA4\u53D8\u66F4\u8BB0\u5F55 ${B.id}\uFF1B\u4E0D\u8981\u5168\u5C40\u66FF\u6362\u540C\u503C\u6570\u5B57\u3002`);T.warnings=[...new Set([...T.warnings||[],...M])]}return T}function as(h="json",y="",E={}){let T=String(h).toLowerCase();if(T==="gia-partial"){let D=Tt(E),q=$n(D.project,{scripts:D.scripts,includeScriptMappings:!0}),Z=D.selection.templateCount===1?D.project.root.children[0].name:"\u90E8\u5206\u7EC4\u5408";return G({filename:`${L(u(),kt)} \xB7 ${L(Z,"\u90E8\u5206\u7EC4\u5408")}.gia`,mimeType:"application/octet-stream",encoding:"base64",data:q.buffer.toString("base64"),selection:D.selection,warnings:[...new Set([...D.warnings,...q.warnings])]})}if(T==="save"||T==="archive"){let D=Buffer.from(JSON.stringify(Lt(),null,2),"utf8");return G({filename:`${u().replace(/[\\/:*?"<>|]/g,"-")} \xB7 \u8D44\u4EA7\u5305.json`,mimeType:"application/json",encoding:"base64",data:D.toString("base64"),warnings:[]})}if(T==="save-gia"||T==="archive-gia"){let D=[],q=[],Z=(Se,De="")=>{let xe=Pt(Se,De);D.push(G({filename:xe.filename,mimeType:xe.mimeType,encoding:xe.encoding,data:xe.data,warnings:xe.warnings||[]})),q.push(...xe.warnings||[])},Ee=(Se,De)=>{let xe=c[Ct(Se)],Ge=Se===l,te=p.some(le=>le.controlAsset===Se&&le.controlId);if(!Ge&&de(xe)&&!te){q.push(De);return}Z("gia",Se)};if(Ee(se,"\u670D\u52A1\u5668\u63A7\u4EF6\u6A21\u677F\u4ECD\u662F\u9ED8\u8BA4\u6A71\u7A97\uFF0C\u672A\u6539\u52A8\u4E14\u5F53\u524D\u672A\u663E\u793A\uFF0C\u5DF2\u4ECE\u8D44\u4EA7\u5305 GIA \u4E2D\u7701\u7565\u3002"),Ee(H,"\u5BA2\u6237\u7AEF\u63A7\u4EF6\u6A21\u677F\u4ECD\u662F\u9ED8\u8BA4\u300CLua\u5B9E\u4F8B\u5316\u9762\u677F\u300D\uFF0C\u672A\u6539\u52A8\u4E14\u5F53\u524D\u672A\u663E\u793A\uFF0C\u5DF2\u4ECE\u8D44\u4EA7\u5305 GIA \u4E2D\u7701\u7565\u3002"),p.some(Se=>Se.path||Se.source)&&Z("scripts-gia"),!D.length)throw new Error("\u8D44\u4EA7\u5305 GIA \u6CA1\u6709\u53EF\u5BFC\u51FA\u7684\u5DF2\u6539\u52A8\u9879\uFF1B\u8BF7\u5148\u7F16\u8F91\u5F53\u524D\u754C\u9762\uFF0C\u6216\u6539\u7528\u300C\u5F53\u524D\u754C\u9762 GIA\u300D\u3002");return G({format:"qxqy-gia-package",files:D,warnings:[...new Set(q)]})}if(T==="gia-combined"||T==="combined-gia"||T==="combined"){let D=Pe();return G({filename:`${L(u(),kt)} \xB7 \u6574\u5408\u5305.gia`,mimeType:"application/octet-stream",encoding:"base64",data:D.buffer.toString("base64"),warnings:[...new Set(D.warnings||[])]})}if(T==="scripts"){let D=G({format:e0,version:1,scripts:p.map(Z=>G({id:Z.id,guid:Z.guid||0,path:Z.path||"",source:Z.source||"",controlId:Z.controlId||"",controlAsset:Z.controlAsset||""}))}),q=Buffer.from(JSON.stringify(D,null,2),"utf8");return G({filename:`${L(u(),kt)} \xB7 \u811A\u672C.json`,mimeType:"application/json",encoding:"base64",data:q.toString("base64"),warnings:[]})}if(T==="scripts-gia"||T==="scriptsgia"){let D=Do(p);return G({filename:`${L(u(),kt)} \xB7 \u811A\u672C.gia`,mimeType:"application/octet-stream",encoding:"base64",data:D.buffer.toString("base64"),warnings:D.warnings})}if(T==="lua"){let D=p.find(Z=>Z.id===y)||p.find(Z=>Z.path===y);if(!D)throw new Error("\u6CA1\u6709\u53EF\u5BFC\u51FA\u7684 Lua \u811A\u672C\uFF0C\u8BF7\u5148\u5728\u201CLua \u811A\u672C\u201D\u9875\u521B\u5EFA");let q=jt(D.path||"")||`qxqy-script-${D.id}`;return G({filename:/\.lua$/i.test(q)?q:`${q}.lua`,mimeType:"text/x-lua",encoding:"base64",data:Buffer.from(D.source||"","utf8").toString("base64"),warnings:[]})}let M=y?c[Ct(y)]:j(),B=we(M);if(T==="json"){let D=G({...M,scripts:$e(M.meta.assetType),controlGuidChanges:o.filter(Z=>Z.controlAsset===M.meta.assetType)}),q=Buffer.from(JSON.stringify(D,null,2),"utf8");return G({filename:`${B}.json`,mimeType:"application/json",encoding:"base64",data:q.toString("base64"),warnings:[]})}if(T==="gia"){let D=$n(M,M.meta.assetType===H?{scripts:$e(H)}:{}),q=M.meta.assetType===H?[]:$e(se);return q.length&&D.warnings.unshift(`\u5F53\u524D\u670D\u52A1\u5668\u63A7\u4EF6 GIA \u4E0D\u5305\u542B ${q.length} \u4E2A Lua \u811A\u672C\u7684\u6E90\u7801\uFF1B\u8BF7\u4F7F\u7528\u300C\u8D44\u4EA7\u5305 GIA \u6574\u5408\u5305\u300D\uFF0C\u6216\u53E6\u884C\u5BFC\u5165\u811A\u672C\u5305\u5E76\u6838\u5BF9\u6302\u8F7D\u3002`),G({filename:`${B}.gia`,mimeType:"application/octet-stream",encoding:"base64",data:D.buffer.toString("base64"),warnings:D.warnings})}throw new Error(`unsupported export format: ${h}`)}function Kt(h){for(let y of h){let E=hn(y);if(!E.path&&!E.source)continue;let T=E.controlId?null:I(E.guid),M=v(T?{...E,...T}:E);T&&M.guid!==E.guid&&C(T,E.guid,M.guid),M.controlId&&!w(M)&&(M.controlId="",M.controlAsset=""),p.push(M)}}function os(h,y,E=""){let T=String(h||"").toLowerCase();if(typeof y!="string"||!y)throw new Error("import data is required");let M=Buffer.from(y,"base64"),B,D=[],q={},Z=[];if(T==="json"){try{B=JSON.parse(M.toString("utf8"))}catch{throw new Error("JSON \u6587\u4EF6\u65E0\u6548")}if(B?.project&&(B=B.project),B?.format===At&&B?.assets){Yn(B.version);let te=Na(B);D.push(...te.get().migrationWarnings);let le=te.archiveData();return c.server=le.assets.server,c.client=le.assets.client,i=[...D],l=B.activeAssetType===H?H:se,f=String(B.meta?.name||jt(E).replace(/\.json$/i,"")||f),S=le.serverLogic,p=le.assets.scripts,o=le.controlGuidChanges,r=le.scriptSync,m.clear(),G({snapshot:ne(),warnings:D,metadata:{format:At}})}}else{if(T==="lua")return p.push(v({path:jt(E||"imported.lua"),source:M.toString("utf8"),controlId:""})),G({snapshot:ne(),warnings:D,metadata:{assetType:"lua-script"}});if(T==="gia"){if(Go(M)){let be=Bo(M);return Kt(be.scripts),G({snapshot:ne(),warnings:be.warnings,metadata:be.metadata})}let te=Yo(M);B=te.project,D=te.warnings,q=te.metadata,te.clientProject&&(c.client=at(te.clientProject),o=o.filter(be=>be.controlAsset!==H),D.push("\u6574\u5408\u5305\u5DF2\u62C6\u56DE\u300CUI\u63A7\u4EF6-\u670D\u52A1\u7AEF\u300D\u4E0E\u300CUI\u63A7\u4EF6-\u5BA2\u6237\u7AEF\u300D\uFF1B\u5BA2\u6237\u7AEF\u6A21\u677F\u8FB9\u754C\u5DF2\u4FDD\u7559\u3002"));let le=new Map,Jt=(be,_i)=>{be&&K(be.root,z=>{for(let oe of z.scriptMappingIds||[]){let Xe=le.get(Number(oe));if(Xe){D.push(`\u811A\u672C GUID ${oe} \u540C\u65F6\u6302\u8F7D\u5230\u591A\u4E2A\u63A7\u4EF6\uFF0C\u5DF2\u4FDD\u7559\u201C${Xe.controlAsset===se?"\u670D\u52A1\u7AEF":"\u5BA2\u6237\u7AEF"}\u201D\u76EE\u6807\u3002`);continue}le.set(Number(oe),{controlId:z.id,controlAsset:_i})}})};Jt(te.project,te.project.meta.assetType),Jt(te.clientProject,H),Z=(te.scripts||[]).map(be=>le.has(Number(be.guid))?{...be,...le.get(Number(be.guid))}:be)}else throw new Error(`unsupported import format: ${h}`)}let Ee=at(B,{warnings:D}),Se=Ra(B?.controlGuidChanges);if(Se.some(te=>te.controlAsset!==Ee.meta.assetType))throw new Error("\u5355\u8D44\u4EA7 JSON \u7684\u7D22\u5F15\u53D8\u66F4\u8BB0\u5F55\u5FC5\u987B\u5C5E\u4E8E\u5F53\u524D\u5BFC\u5165\u8D44\u4EA7");let De=Ra([...o.filter(te=>te.controlAsset!==Ee.meta.assetType),...Se]);i=[...D];let xe=Ct(Ee.meta.assetType);c[xe]=Ee,o=De,l=Ee.meta.assetType;let Ge=c[xe];return E&&(Ge.meta.name=jt(E).replace(/\.(json|gia)$/i,"")||Ge.meta.name,Ge.meta.sourceFile=jt(E),Ge.meta.sourceFormat=T),Kt(Z),Kt(B?.scripts||[]),B?.script&&(B.script.path||B.script.source)&&Kt([B.script]),G({snapshot:ne(),warnings:D,metadata:q})}function rs(h,y){return jn(j(),{op:"pick",x:h,y}),ne()}function ss(h){let y=typeof h=="string"&&h?h:"";!y||y===n||(n=y)}function ls(h){let y=h.source||"";if(!y.trim()&&h.path.trim())try{y=qc(s0(h.path,n),"utf8")}catch(E){throw new Error(`\u811A\u672C ${h.path} \u8BFB\u53D6\u5931\u8D25: ${E?.message||E}`)}return y}function qt(h={}){let y=Y(h.canvasId);y&&(F=y),h.playerCount!==void 0&&h.playerCount!==null&&h.playerCount!==""&&(N=St(h.playerCount),V>N&&(V=1)),h.viewPlayerIndex!==void 0&&h.viewPlayerIndex!==null&&h.viewPlayerIndex!==""&&(V=qe(h.viewPlayerIndex,N)),x&&Ea(x);let E=p.map(M=>{try{return{id:M.id,guid:M.guid||0,path:M.path||M.id,source:ls(M),controlId:M.controlId||"",controlAsset:M.controlAsset||""}}catch(B){return{id:M.id,guid:M.guid||0,path:M.path||M.id,source:`error([==[ ${String(B.message).replace(/]=+]/g,"] =]")} ])`,controlId:M.controlId||"",controlAsset:M.controlAsset||""}}}),T=M=>E.filter(B=>{let D={controlId:B.controlId,controlAsset:B.controlAsset},q=B.controlId?w(D):null;return!!(q&&q.key===M)});return x=Gr(c.server,{templatesProject:c.client,scripts:E,sceneScripts:T("server"),templateScripts:T("client"),serverConfig:{logic:S},canvasId:F,playerCount:N,viewPlayerIndex:V,language:h.language||""}),fe(h)}function cs(h,y={}){let E=Y(h);if(!E)throw new Error("playSetCanvas requires canvasId");return qt({...y,canvasId:E})}function fe(h={}){if(!x)return G({running:!1,tree:[],logs:[],serverLogs:[],serverVars:[]});let y=ya(x,h);return y.running=!0,y.logs=_a(y.logs),y.serverLogs=_a(y.server?.logs||[]),y.serverVars=Zc(y.server,y.playerCount||1),y}function ds(h,y={}){return x||qt(),dn(x,h),y.observe===!1?G({running:!0,time:x.runtime.clock.time,frame:x.runtime.clock.frame,paused:!!x.debugPaused,levelTimePaused:!!x.runtime.clock.paused,playerCount:x.playerCount||1,viewPlayerIndex:x.viewPlayerIndex||1}):fe(y)}function fs(h=0){qt();let y=Math.max(0,Number(h)||0);for(let E=0;E<y;E++)dn(x,1/30);return fe()}function us(){return x&&Ea(x),x=null,F="",N=1,V=1,G({running:!1,tree:[],logs:[],serverLogs:[],serverVars:[]})}function hs(h,y={}){let E=Wt();return V=ba(E,h),y.observe===!1?null:fe(y)}function ms(h,y={}){if(!x)throw new Error("play session has not started");return va(x,h),y.observe===!1?null:fe(y)}function ps(h,y={}){if(!x)throw new Error("play session has not started");return wa(x,h),y.observe===!1?null:fe(y)}function bs(h,y,E,T={}){if(!x)throw new Error("play session has not started");return vi(x,h,y,E,T),T.observe===!1?null:fe(T)}function gs(h={}){return x&&fn(x).pause(),h.observe===!1?null:fe(h)}function ys(h={}){return x&&fn(x).resume(),h.observe===!1?null:fe(h)}function Wt(){if(!x)throw new Error("play session has not started");return x}function vs(h,y){let E=Wt();if(!h&&!y){let T=fe();return G({vars:T.serverVars||[]})}return G({entityType:String(h||""),name:String(y||""),value:Lr(E,h,y)})}function ws(h,y,E){let T=Wt();return xa(T,h,y,E),fe()}function Ss(h,y=[],E="PlayerSelf"){let T=Wt();return Ia(T,h,y,E),fe()}function xs(){let h=fe();return G({events:h.history||[],case:_r(h.history||[],{playerCount:h.playerCount||1})})}function Is(h={}){let y=fe(),E=gi({name:h.name||"",dt:h.dt,playerCount:h.playerCount||y.playerCount||1,events:h.events||y.history||[],asserts:h.asserts||[]});return G(E)}function Es(h,y={}){let E=gi(h);qt({...y,playerCount:y.playerCount||E.playerCount||1});let T=Wt();T.recording=!1;try{return Wr(fn(T),h)}finally{T.recording=!0}}function Cs(){if(!x)return{running:!1,paused:!1,time:0,frame:0,playerCount:1,viewPlayerIndex:1};let h=x.runtime.clock;return{running:!0,paused:!!x.debugPaused,levelTimePaused:!!h.paused,time:h.time,frame:h.frame,playerCount:x.playerCount||1,viewPlayerIndex:x.viewPlayerIndex||1}}let $a={get:ne,patch:ze,setWorkspace:ss,exportData:Pt,exportChoices:ki,exportPreview:Ai,importData:os,pick:rs,playStart:qt,playSetCanvas:cs,playSetView:hs,playGet:fe,playStatus:Cs,playStep:ds,playRun:fs,playStop:us,playKey:ms,playClick:ps,playPointer:bs,playPause:gs,playResume:ys,playServerGet:vs,playServerSet:ws,playServerSend:Ss,playHistory:xs,playSaveCase:Is,playRunCase:Es,archiveData:Lt};return Object.defineProperty($a,"_project",{enumerable:!1,get:j}),$a}var W=null,Oa=!1,We=0,Ye=0,za="realtime",ns=!1,l0=33,xi=1/30,c0=5;function Ii(e={}){return{...e.inspect?{inspect:!0}:{},...e.view?{view:!0}:{},...e.paint?{paint:!0}:{},...e.compact?{compact:!0}:{},...e.sceneRev!==void 0&&e.sceneRev!==null?{sceneRev:e.sceneRev}:{}}}function d0(e={}){let t=Ii(e);for(let i of["canvasId","playerCount","viewPlayerIndex","language"])e[i]!==void 0&&e[i]!==null&&e[i]!==""&&(t[i]=e[i]);return t}function st(e={}){return e.light?{...W.playStatus()}:W.playGet(Ii(e))}function f0(){if(!W||Oa||za!=="realtime")return;let e=W.playStatus();if(!e.running||e.paused){We=0,Ye=0;return}let t=Date.now();if(!We){We=t;return}Oa=!0;try{Ye+=Math.min(.25,Math.max(0,(t-We)/1e3)),We=t;let i=0;for(;Ye>=xi&&i<c0;)W.playStep(xi,{observe:!1}),Ye-=xi,i+=1;Ye>xi&&(Ye=xi)}finally{Oa=!1}}var Of=setInterval(f0,l0);function u0(e,t={}){if(e==="start"){let i=t.clockMode??"realtime";if(i!=="manual"&&i!=="realtime")throw new Error("clockMode must be manual or realtime");return W&&W.playStop(),W=Na(t.archive||t.project,{workspacePath:t.workspacePath||""}),za=i,ns=t.muteAudio===!0,We=0,Ye=0,W.playStart(d0(t))}if(!W)throw new Error("play session has not started");if(e==="get")return t.light?st(t):W.playGet(Ii(t));if(e==="step"){let i=W.playStep(t.dt,t.light?{observe:!1}:Ii(t));return t.light?st(t):i}if(e==="pointer")return W.playPointer(t.type,t.x,t.y,{observe:!1,deltaX:t.deltaX,deltaY:t.deltaY}),st(t);if(e==="key")return W.playKey(t.key,{observe:!1}),st(t);if(e==="click")return W.playClick(t.name,{observe:!1}),st(t);if(e==="pause")return W.playPause({observe:!1}),We=0,Ye=0,st(t);if(e==="resume")return W.playResume({observe:!1}),We=0,Ye=0,st(t);if(e==="device")return W.playSetCanvas(t.canvasId,Ii(t));if(e==="view")return W.playSetView(t.playerIndex??t.viewPlayerIndex,{observe:!1}),st(t);if(e==="serverGet")return W.playServerGet(t.entityType,t.name);if(e==="serverSet")return W.playServerSet(t.entityType,t.name,t.value);if(e==="serverSend")return W.playServerSend(t.name,t.params||[],t.target||"PlayerSelf");if(e==="history")return W.playHistory();if(e==="saveCase")return W.playSaveCase(t.case||t);if(e==="runCase")return W.playRunCase(t.case||t,{canvasId:t.canvasId,playerCount:t.playerCount,viewPlayerIndex:t.viewPlayerIndex});if(e==="stop"){let i=W.playStop();return W=null,We=0,Ye=0,i}throw new Error(`unknown play action: ${e}`)}Fa.on("message",e=>{let{id:t,action:i,args:n={}}=e||{};try{let a=u0(i,n),o=typeof a?.running=="boolean"?{...a,clockMode:za,audioMuted:ns}:a;Fa.postMessage({id:t,ok:!0,value:o,error:null})}catch(a){Fa.postMessage({id:t,ok:!1,value:null,error:a?.message||String(a)})}});
|