dsh-plugin-beyond-simulator 2.1.1 → 2.2.1
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 +69 -130
- package/dsh-plugin/cordis.patch.yml +1 -1
- package/dsh-plugin/dist/client.js +10 -6
- package/dsh-plugin/dist/index.js +52 -16
- package/dsh-plugin/dist/play-renderer.js +72 -71
- package/dsh-plugin/dist/worker.js +47 -11
- package/dsh-plugin/lib/play.html +56 -40
- package/dsh-plugin/presets/wonderland-lua-builder/README.md +9 -1
- package/dsh-plugin/presets/wonderland-lua-builder/agent.cordis.yml +1 -1
- package/dsh-plugin/presets/wonderland-lua-builder/evals/agent-behavior.md +4 -4
- package/dsh-plugin/presets/wonderland-lua-builder/skills/qxqy-game-studio/references/07-device-validation.md +4 -4
- package/dsh-plugin/skill.md +9 -2
- package/package.json +2 -2
|
@@ -1,12 +1,16 @@
|
|
|
1
|
-
(()=>{function vt(t){let n=t.createElement;return function({snap:o,request:e,patch:h,prepare:y,refresh:N}){let P={version:1,workspaceDir:"",clientImportRoot:"",clientSubdir:""},[$,v]=t.useState(o.scriptSync||P),[I,A]=t.useState(o.storage?.path||"qxqy-simulator.save.json"),[L,E]=t.useState([]),[B,q]=t.useState(null),[C,_]=t.useState([]),[S,H]=t.useState(null),[g,j]=t.useState(""),[M,R]=t.useState(""),[F,K]=t.useState(!1),ae=t.useId();t.useEffect(()=>{v(o.scriptSync||P),q(null)},[JSON.stringify(o.scriptSync),o.storage?.path]),t.useEffect(()=>{q(null)},[o.version,o.asset?.type]),t.useEffect(()=>{o.storage?.path&&A(o.storage.path)},[o.storage?.path]);let le=async u=>{K(!0),R(""),j("");try{await u()}catch(te){R(te.message||String(te))}finally{K(!1)}},V=(u,te={})=>e("script-sync",{action:u,args:te});async function ee(){q(null),H(null);let u=await y();await e("save",{path:I,expectedRevision:u.version}),await N();let te=await V("preview");q(te),_(te.rows.filter(re=>!re.error&&re.status!=="\u672A\u53D8\u5316").map(re=>re.id))}let ce=JSON.stringify($)!==JSON.stringify(o.scriptSync||P),Q=(u,te,re,Ee)=>n("label",{className:"qxsim-field",key:u},n("span",null,te),n("input",{type:"text",value:$[u],placeholder:re,"aria-label":te,"aria-describedby":`${ae}-${u}`,disabled:F,onChange:ve=>{v({...$,[u]:ve.target.value}),q(null),j("")}}),n("small",{id:`${ae}-${u}`},Ee)),he=$.clientImportRoot.replaceAll("\\","/").match(/BeyondLocal\/([^/]+)\/Beyond_Local_Save_Level\/([^/]+)/),me=u=>u.trim().replaceAll("\\","/").replace(/^\.$/,""),be=me($.workspaceDir)?`${me($.workspaceDir)}/`:"",oe=o.scripts?.find(u=>u.path.replaceAll("\\","/").startsWith(be)&&u.path.toLowerCase().endsWith(".lua"))?.path.replaceAll("\\","/")||`${be}main.lua`,Te=[$.clientImportRoot.trim().replaceAll("\\","/").replace(/\/+$/,"")||"\u3010\u5343\u661F\u6C99\u7BB1\u811A\u672C\u6587\u4EF6\u5939\u3011",me($.clientSubdir),oe.slice(be.length)].filter(Boolean).join("/"),Me={\u65B0\u589E:"\u65B0\u589E\u6587\u4EF6",\u8986\u76D6:"\u66F4\u65B0\u5DF2\u6709\u6587\u4EF6",\u672A\u53D8\u5316:"\u5185\u5BB9\u76F8\u540C\uFF0C\u65E0\u9700\u66F4\u65B0",\u9519\u8BEF:"\u65E0\u6CD5\u590D\u5236"},ze={\u5B58\u6863\u6E90\u7801:"\u5B58\u6863\u91CC\u7F16\u8F91\u7684\u4EE3\u7801",\u5DE5\u4F5C\u533A\u6587\u4EF6:"\u9879\u76EE\u4E2D\u7684 .lua \u6587\u4EF6"},de=(u,te,re=!1)=>n("button",{type:"button",className:"qxsim-action",disabled:F||re,onClick:()=>void le(te)},u);return n("details",{className:"qxsim-section",style:{flexShrink:0,maxHeight:"55%",overflow:"auto",margin:"5px 10px"}},n("summary",null,`\u5B9E\u673A\u811A\u672C\u540C\u6B65 \xB7 ${o.scriptSync?"\u5DF2\u8BBE\u7F6E\u6587\u4EF6\u5939":"\u5148\u8BBE\u7F6E\u6587\u4EF6\u5939"}`),n("div",{className:"qxsim-section-body"},n("p",null,"\u628A\u5F53\u524D\u5B58\u6863\u91CC\u7684 Lua \u811A\u672C\u590D\u5236\u5230\u5343\u661F\u6C99\u7BB1\uFF0C\u7528\u4E8E\u6E38\u620F\u5185\u6D4B\u8BD5\u3002\u64CD\u4F5C\u987A\u5E8F\uFF1A\u586B\u5199\u811A\u672C\u4F4D\u7F6E \u2192 \u4FDD\u5B58\u8BBE\u7F6E \u2192 \u4FDD\u5B58\u5B58\u6863\u5E76\u67E5\u770B\u66F4\u65B0 \u2192 \u786E\u8BA4\u590D\u5236\u3002"),Q("workspaceDir","\u9879\u76EE\u811A\u672C\u6587\u4EF6\u5939","\u4F8B\u5982 workspace/my-game\uFF1B\u4E5F\u53EF\u4EE5\u7559\u7A7A","\u586B\u5199\u5728\u5DE5\u4F5C\u533A\u91CC\u7684\u4F4D\u7F6E\uFF0C\u4F8B\u5982 workspace/my-game\uFF1B\u7559\u7A7A\u8868\u793A\u4F7F\u7528\u5DE5\u4F5C\u533A\u672C\u8EAB\u3002"),Q("clientImportRoot","\u5343\u661F\u6C99\u7BB1\u811A\u672C\u6587\u4EF6\u5939","\u7C98\u8D34\u4EE5 default_import_file \u7ED3\u5C3E\u7684\u5B8C\u6574\u8DEF\u5F84","\u5173\u5361\u5B58\u653E\u5916\u90E8 Lua \u811A\u672C\u7684\u6587\u4EF6\u5939\uFF0C\u53EF\u70B9\u51FB\u300C\u53D1\u73B0\u672C\u673A\u76EE\u5F55\u300D\u67E5\u627E\u3002\u8BF7\u586B\u5199\u8FD0\u884C\u6A21\u62DF\u5668\u90A3\u53F0\u7535\u8111\u4E0A\u7684\u5B8C\u6574\u8DEF\u5F84\u3002"),Q("clientSubdir","\u6E38\u620F\u91CC\u7684\u9879\u76EE\u5B50\u6587\u4EF6\u5939","\u4F8B\u5982 workspace/my-game\uFF1B\u4E5F\u53EF\u4EE5\u7559\u7A7A",n(t.Fragment,null,"\u4E00\u822C\u548C\u201C\u9879\u76EE\u811A\u672C\u6587\u4EF6\u5939\u201D\u586B\u4E00\u6837\u7684\u5185\u5BB9\uFF0C\u4FDD\u7559\u539F\u6765\u7684\u6587\u4EF6\u4F4D\u7F6E\u3002\u7559\u7A7A\u5219\u76F4\u63A5\u653E\u8FDB\u5343\u661F\u6C99\u7BB1\u811A\u672C\u6587\u4EF6\u5939\u3002",n("span",{"aria-label":"\u590D\u5236\u8DEF\u5F84\u793A\u4F8B",style:{display:"block",overflowWrap:"anywhere"}},"\u590D\u5236\u793A\u4F8B\uFF1A",n("code",null,oe)," \u2192 ",n("code",null,Te)))),he?n("p",null,`\u6E38\u620F\u8D26\u53F7 UID\uFF1A${he[1]} \xB7 \u5173\u5361\u76EE\u5F55\u7F16\u53F7\uFF1A${he[2]}`):null,n("div",{style:{display:"flex",gap:6,flexWrap:"wrap"}},de("\u53D1\u73B0\u672C\u673A\u76EE\u5F55",async()=>{let u=await V("discover");E(u.candidates),u.candidates.length?j(`\u627E\u5230 ${u.candidates.length} \u4E2A\u6E38\u620F\u811A\u672C\u6587\u4EF6\u5939\uFF0C\u8BF7\u9009\u62E9\u8981\u66F4\u65B0\u7684\u8D26\u53F7\u548C\u5173\u5361\u3002`):R("\u6CA1\u6709\u627E\u5230\u6E38\u620F\u811A\u672C\u6587\u4EF6\u5939\u3002\u53EF\u4EE5\u624B\u52A8\u7C98\u8D34 default_import_file \u6587\u4EF6\u5939\u7684\u5B8C\u6574\u8DEF\u5F84\uFF1B\u5982\u679C\u8FD8\u6CA1\u5BFC\u5165\u811A\u672C\uFF0C\u8BF7\u5148\u5728\u5343\u661F\u6C99\u7BB1\u5B8C\u6210\u5BFC\u5165\u3002")}),de("\u4FDD\u5B58\u8BBE\u7F6E",async()=>{await y();let u=await h({op:"setScriptSync",config:$});await e("save",{path:I,expectedRevision:u.version}),await N(),q(null),H(null),j("\u811A\u672C\u4F4D\u7F6E\u5DF2\u4FDD\u5B58\u3002\u4E0B\u4E00\u6B65\u70B9\u51FB\u300C\u4FDD\u5B58\u5B58\u6863\u5E76\u67E5\u770B\u66F4\u65B0\u300D\u3002")},!$.clientImportRoot.trim()||!I.trim()),de("\u6E05\u9664\u8BBE\u7F6E",async()=>{await y();let u=await h({op:"setScriptSync",config:null});await e("save",{path:I,expectedRevision:u.version}),await N(),q(null),H(null),j("\u5DF2\u6E05\u9664\u811A\u672C\u4F4D\u7F6E\u8BBE\u7F6E\u3002\u6E38\u620F\u91CC\u7684\u811A\u672C\u6587\u4EF6\u4ECD\u7136\u4FDD\u7559\u3002")},!o.scriptSync||!I.trim())),L.length?n("label",{className:"qxsim-field"},"\u9009\u62E9\u8981\u66F4\u65B0\u7684\u8D26\u53F7\u548C\u5173\u5361",n("select",{value:"",disabled:F,onChange:u=>{v({...$,clientImportRoot:u.target.value}),q(null),j("")}},n("option",{value:""},"\u8BF7\u9009\u62E9\u6E38\u620F\u8D26\u53F7\u548C\u5173\u5361\u6587\u4EF6\u5939\u2026"),L.map(u=>n("option",{key:u.path,value:u.path},`\u8D26\u53F7 ${u.uid} / \u5173\u5361\u76EE\u5F55 ${u.editorId} \xB7 ${u.path}`)))):null,n("label",{className:"qxsim-field",style:{marginTop:8}},n("span",null,"\u6A21\u62DF\u5668\u5B58\u6863\u6587\u4EF6"),n("input",{type:"text",value:I,placeholder:"\u4F8B\u5982 my-game.save.json","aria-label":"\u6A21\u62DF\u5668\u5B58\u6863\u6587\u4EF6","aria-describedby":`${ae}-archive`,disabled:F,onChange:u=>{A(u.target.value),q(null),j("")}}),n("small",{id:`${ae}-archive`},"\u586B\u5199\u5DE5\u4F5C\u533A\u91CC\u7684\u5B58\u6863\u6587\u4EF6\u540D\u6216\u8DEF\u5F84\u3002\u4FDD\u5B58\u8BBE\u7F6E\u65F6\u4F1A\u4E00\u8D77\u4FDD\u5B58\u9879\u76EE\uFF0C\u4E0B\u6B21\u6253\u5F00\u5B58\u6863\u5373\u53EF\u590D\u7528\u3002")),de("\u4FDD\u5B58\u5B58\u6863\u5E76\u67E5\u770B\u66F4\u65B0",ee,!o.scriptSync||ce||!I.trim()),o.scriptSync?ce?n("p",null,"\u811A\u672C\u4F4D\u7F6E\u5DF2\u6539\u52A8\uFF0C\u8BF7\u5148\u70B9\u51FB\u300C\u4FDD\u5B58\u8BBE\u7F6E\u300D\u3002"):I.trim()?null:n("p",null,"\u8BF7\u5148\u586B\u5199\u6A21\u62DF\u5668\u5B58\u6863\u6587\u4EF6\u540D\u3002"):n("p",null,"\u8BF7\u5148\u586B\u5199\u5343\u661F\u6C99\u7BB1\u811A\u672C\u6587\u4EF6\u5939\uFF0C\u5E76\u70B9\u51FB\u300C\u4FDD\u5B58\u8BBE\u7F6E\u300D\u3002"),F?n("p",{role:"status"},"\u6B63\u5728\u5904\u7406\uFF0C\u8BF7\u7A0D\u5019\u2026"):g?n("p",{role:"status"},g):null,M?n("p",{role:"alert",style:{color:"var(--danger)"}},M):null,B?n("section",{"aria-label":"\u811A\u672C\u540C\u6B65\u786E\u8BA4"},n("p",{style:{overflowWrap:"anywhere"}},`\u672C\u6B21\u66F4\u65B0\u5230\uFF1A${B.root}`),B.rows.length?B.rows.every(u=>u.status==="\u672A\u53D8\u5316")?n("p",{role:"status"},"\u6240\u6709\u811A\u672C\u90FD\u4E0E\u6E38\u620F\u6587\u4EF6\u5939\u91CC\u7684\u5185\u5BB9\u76F8\u540C\uFF0C\u65E0\u9700\u590D\u5236\u3002"):null:n("p",null,"\u8FD9\u4E2A\u5B58\u6863\u8FD8\u6CA1\u6709 Lua \u811A\u672C\u3002\u8BF7\u5148\u5728\u4E0B\u65B9\u6DFB\u52A0\u811A\u672C\uFF0C\u518D\u67E5\u770B\u66F4\u65B0\u3002"),B.pendingGuidChanges?n("p",{role:"alert"},"\u6709\u63A7\u4EF6\u7D22\u5F15\u5C1A\u672A\u540C\u6B65\u5230 Lua\u3002\u8BF7\u5148\u5728\u4E0A\u65B9\u300C\u5168\u91CF\u66FF\u6362\u811A\u672C\u7D22\u5F15\u300D\uFF0C\u6216\u300C\u590D\u5236\u63D0\u793A\u8BCD\u7ED9 AI\u300D\uFF1B\u5904\u7406\u5B8C\u6210\u540E\u518D\u67E5\u770B\u6E38\u620F\u811A\u672C\u66F4\u65B0\u3002"):null,B.rows.map(u=>n("div",{key:u.id,style:{borderTop:"1px solid var(--line)",padding:6}},n("label",{style:{overflowWrap:"anywhere"}},n("input",{type:"checkbox",disabled:F||!!u.error||u.status==="\u672A\u53D8\u5316",checked:C.includes(u.id),onChange:te=>_(te.target.checked?[...C,u.id]:C.filter(re=>re!==u.id))}),` ${u.path} \xB7 ${Me[u.status]||u.status}`),n("div",null,`\u590D\u5236\u7684\u4EE3\u7801\u6765\u81EA\uFF1A${ze[u.sourceKind]||u.sourceKind}`),n("div",{style:{overflowWrap:"anywhere"}},u.error?`\u65E0\u6CD5\u590D\u5236\uFF1A${u.error}`:`\u590D\u5236\u5230\uFF1A${u.target}`),u.sourceMismatch?n("div",{className:"qxsim-note"},"\u8FD9\u4E2A\u811A\u672C\u5728\u5B58\u6863\u91CC\u548C\u9879\u76EE\u6587\u4EF6\u91CC\u7684\u4EE3\u7801\u4E0D\u540C\u3002\u672C\u6B21\u4F1A\u590D\u5236\u5B58\u6863\u91CC\u7684\u4EE3\u7801\uFF1B\u5982\u679C\u8981\u4F7F\u7528\u9879\u76EE\u6587\u4EF6\uFF0C\u8BF7\u70B9\u51FB\u300C\u6539\u7528\u9879\u76EE\u6587\u4EF6\u91CC\u7684\u4EE3\u7801\u300D\uFF0C\u7136\u540E\u91CD\u65B0\u67E5\u770B\u66F4\u65B0\u3002",n("details",null,n("summary",null,"\u67E5\u770B\u9879\u76EE\u6587\u4EF6\u91CC\u7684\u4EE3\u7801"),n("pre",{style:{maxHeight:200,overflow:"auto"}},u.diskSource)),de("\u6539\u7528\u9879\u76EE\u6587\u4EF6\u91CC\u7684\u4EE3\u7801",async()=>{await y(),await h({op:"updateScript",id:u.id,source:u.diskSource}),q(null)})):null,!u.error&&u.status!=="\u672A\u53D8\u5316"?n("details",null,n("summary",null,"\u5BF9\u6BD4\u66F4\u65B0\u524D\u540E\u7684\u4EE3\u7801"),n("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:8}},n("div",{style:{minWidth:0}},"\u6E38\u620F\u91CC\u73B0\u5728\u7684\u4EE3\u7801",n("pre",{style:{maxHeight:240,overflow:"auto"}},u.status==="\u65B0\u589E"?"\uFF08\u6E38\u620F\u91CC\u8FD8\u6CA1\u6709\u8FD9\u4E2A\u6587\u4EF6\uFF09":u.beforeSource)),n("div",{style:{minWidth:0}},"\u672C\u6B21\u8981\u590D\u5236\u7684\u4EE3\u7801",n("pre",{style:{maxHeight:240,overflow:"auto"}},u.source)))):null)),B.rows.some(u=>u.status==="\u65B0\u589E")?n("p",null,"\u65B0\u589E\u811A\u672C\u590D\u5236\u540E\uFF0C\u8FD8\u9700\u8981\u5728\u5343\u661F\u6C99\u7BB1\u91CC\u5173\u8054\u5BF9\u5E94\u7684\u811A\u672C\u6587\u4EF6\uFF1B\u9700\u8981\u76F4\u63A5\u8FD0\u884C\u7684\u811A\u672C\u8FD8\u8981\u6302\u5230\u63A7\u4EF6\u4E0A\u3002"):null,C.length?n("p",null,`\u5DF2\u9009 ${C.length} \u4E2A\u811A\u672C\uFF0C\u5176\u4E2D ${B.rows.filter(u=>C.includes(u.id)&&u.status==="\u8986\u76D6").length} \u4E2A\u4F1A\u66FF\u6362\u6E38\u620F\u91CC\u7684\u65E7\u6587\u4EF6\u3002\u66FF\u6362\u524D\u4F1A\u81EA\u52A8\u5907\u4EFD\u65E7\u6587\u4EF6\uFF0C\u6E38\u620F\u91CC\u7684\u5176\u4ED6\u6587\u4EF6\u4F1A\u4FDD\u7559\u3002`):null,n("div",{style:{display:"flex",gap:6}},de("\u6682\u4E0D\u590D\u5236",async()=>q(null)),de(`\u786E\u8BA4\u590D\u5236 ${C.length} \u4E2A\u811A\u672C`,async()=>{let u=B;q(null),await y(),H(await e("script-sync-apply",{planId:u.id,scriptIds:C,confirmed:!0}))},!C.length||!!B.pendingGuidChanges))):null,S?n("div",{role:"status"},n("strong",null,S.completed?"\u811A\u672C\u5DF2\u590D\u5236\u5230\u5343\u661F\u6C99\u7BB1":"\u6709\u4E9B\u811A\u672C\u672A\u590D\u5236\u6210\u529F"),n("p",null,S.completed?"\u4E0B\u4E00\u6B65\uFF1A\u56DE\u5230\u5343\u661F\u6C99\u7BB1\uFF0C\u4FDD\u5B58\u5173\u5361\u5E76\u91CD\u65B0\u8BD5\u73A9\uFF0C\u8BA9\u6E38\u620F\u52A0\u8F7D\u66F4\u65B0\u540E\u7684\u811A\u672C\u3002":"\u8BF7\u6309\u4E0B\u65B9\u63D0\u793A\u5904\u7406\u5931\u8D25\u7684\u6587\u4EF6\uFF0C\u518D\u91CD\u65B0\u67E5\u770B\u66F4\u65B0\u5E76\u590D\u5236\u3002"),n("p",{style:{overflowWrap:"anywhere"}},`\u590D\u5236\u65F6\u95F4\uFF1A${new Date(S.at).toLocaleString()} \xB7 \u65E7\u6587\u4EF6\u5907\u4EFD\u4FDD\u5B58\u5728\uFF1A${S.backupRoot}`),n("ul",{style:{overflowWrap:"anywhere"}},S.results.map(u=>n("li",{key:u.id},`${u.target}\uFF1A${u.status==="\u6210\u529F"?"\u5DF2\u590D\u5236":"\u672A\u590D\u5236"}${u.error?` \xB7 ${u.error}`:""}`)))):null))}}function yt(t){let n=t.createElement;return function({snap:o,prepare:e,patch:h,copy:y,onScripts:N,onError:P,reloadArchive:$}){let[v,I]=t.useState(!1),[A,L]=t.useState(null),[E,B]=t.useState(null),[q,C]=t.useState(""),[_,S]=t.useState(!1),H=t.useRef(null),g=o.controlGuidChanges||[],j=g.at(-1)?.id||"";t.useEffect(()=>{L(null),C("")},[o.version,o.save?.name]),t.useEffect(()=>{S(!1)},[j,o.save?.name]),t.useLayoutEffect(()=>{q&&H.current&&(H.current.scrollTop=0)},[q]);let M=F=>async()=>{I(!0);try{await F()}catch(K){P(K?.message||String(K))}finally{I(!1)}},R=M(async()=>{C(await y()),L(null),H.current&&(H.current.scrollTop=0)});return!g.length&&!E?null:_?n("div",{style:{flexShrink:0,padding:"2px 10px"}},n("button",{className:"qxsim-action",onClick:()=>S(!1)},`Lua \u7D22\u5F15\u5F85\u540C\u6B65\uFF08${g.length} \u9879\uFF09\xB7 \u5C55\u5F00`)):n("section",{ref:H,className:"qxsim-note","aria-label":"Lua \u7D22\u5F15\u540C\u6B65",style:{flexShrink:0,maxHeight:270,overflow:"auto",overflowWrap:"anywhere"}},n("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:8}},n("strong",null,g.length?`\u4E0B\u4E00\u6B65\uFF1A\u540C\u6B65 Lua \u7D22\u5F15\u5F15\u7528\uFF08${g.length} \u9879\uFF09`:"\u811A\u672C\u5168\u91CF\u66FF\u6362\u5DF2\u5B8C\u6210"),n("button",{className:"qxsim-action","aria-label":"\u5173\u95ED\u7D22\u5F15\u540C\u6B65\u63D0\u793A",title:"\u6536\u8D77\u63D0\u793A\uFF0C\u4FDD\u7559\u5F85\u540C\u6B65\u8BB0\u5F55",disabled:v,onClick:()=>{g.length?S(!0):B(null)}},"\u5173\u95ED")),q?n("details",{open:!0},n("summary",null,"\u540C\u6B65\u4EFB\u52A1\uFF08\u7C98\u8D34\u7ED9\u5F53\u524D\u9879\u76EE\u7684 AI\uFF09"),n("textarea",{"aria-label":"AI \u7D22\u5F15\u540C\u6B65\u4EFB\u52A1",readOnly:!0,value:q,rows:5,style:{width:"100%",boxSizing:"border-box"}}),n("button",{className:"qxsim-action",disabled:v,onClick:M($)},"AI \u5DF2\u5904\u7406\uFF0C\u91CD\u65B0\u8F7D\u5165\u5B58\u6863")):null,n("div",null,g.length?"\u63A7\u4EF6\u7D22\u5F15\u5DF2\u4FEE\u6539\uFF0C\u8BF7\u9009\u62E9\u4E00\u79CD\u65B9\u5F0F\u540C\u6B65\u811A\u672C\u3002":"\u8BF7\u68C0\u67E5\u66FF\u6362\u7ED3\u679C\u5E76\u4FDD\u5B58\u5B58\u6863\uFF0C\u518D\u5230\u300CLua \u811A\u672C \u2192 \u5B9E\u673A\u811A\u672C\u540C\u6B65\u300D\u66F4\u65B0\u6E38\u620F\u91CC\u7684\u6587\u4EF6\u5E76\u91CD\u65B0\u8BD5\u73A9\u3002"),g.length?n(t.Fragment,null,n("div",{role:"group","aria-label":"\u7D22\u5F15\u540C\u6B65\u65B9\u5F0F",style:{display:"flex",gap:12,flexWrap:"wrap",marginTop:5}},n("div",{style:{flex:"1 1 280px"}},n("button",{className:"qxsim-action",disabled:v,onClick:M(async()=>{await e();let K=(await h({op:"previewControlGuidSync"})).controlGuidSyncPreview;if(B(null),C(""),!K.canApply){L(K);return}let ae=await h({op:"syncControlGuidReferences",planId:K.id});B(ae.controlGuidSyncResult),L(null)})},"\u5168\u91CF\u66FF\u6362\u811A\u672C\u7D22\u5F15"),n("div",null,n("strong",null,"\u53EF\u80FD\u9519\u8BEF\u5730\u66FF\u6362\u975E\u7D22\u5F15\u5185\u5BB9\u3002"),"\u6309\u5B8C\u6574\u5341\u8FDB\u5236\u6570\u5B57\u66FF\u6362\u6240\u6709\u5DF2\u767B\u8BB0\u811A\u672C\uFF0C\u5305\u62EC\u914D\u7F6E\u8868\u3001\u5B57\u7B26\u4E32\u548C\u6CE8\u91CA\uFF1B\u540C\u65F6\u66F4\u65B0\u5185\u5BB9\u4E00\u81F4\u7684\u5DE5\u4F5C\u533A\u6E90\u6587\u4EF6\uFF0C\u66FF\u6362\u524D\u81EA\u52A8\u5907\u4EFD\u3002")),n("div",{style:{flex:"1 1 280px"}},n("button",{className:"qxsim-action",disabled:v,onClick:R},"\u590D\u5236\u63D0\u793A\u8BCD\u7ED9 AI"),n("div",null,"\u5148\u4FDD\u5B58\u6700\u65B0\u5B58\u6863\uFF0C\u518D\u590D\u5236\u5305\u542B\u6620\u5C04\u8BFB\u53D6\u65B9\u5F0F\u548C\u811A\u672C\u4F4D\u7F6E\u7684\u63D0\u793A\u8BCD\uFF0C\u7531 AI \u5224\u65AD\u54EA\u4E9B\u5F15\u7528\u9700\u8981\u66F4\u65B0\u3002"))),n("details",null,n("summary",null,`\u67E5\u770B\u7D22\u5F15\u53D8\u66F4\uFF08${g.length} \u9879\uFF09`),n("ul",null,g.slice(0,20).map(F=>n("li",{key:F.id},`${F.controlName}\uFF1A${F.oldGuid} \u2192 ${F.newGuid}`))),g.length>20?n("div",null,"\u8FD9\u91CC\u663E\u793A\u524D 20 \u9879\uFF1B\u5B8C\u6574\u6620\u5C04\u968F\u5B58\u6863\u4FDD\u5B58\uFF0C\u590D\u5236\u7684\u4EFB\u52A1\u4F1A\u5F15\u5BFC AI \u8BFB\u53D6\u5168\u90E8\u3002"):null)):null,A?n("div",{"aria-label":"Lua \u7D22\u5F15\u540C\u6B65\u95EE\u9898"},n("p",null,"\u6E90\u7801\u6587\u4EF6\u6216\u7D22\u5F15\u6620\u5C04\u5B58\u5728\u51B2\u7A81\uFF0C\u672C\u6B21\u6CA1\u6709\u4FEE\u6539\u811A\u672C\u3002\u53EF\u590D\u5236\u63D0\u793A\u8BCD\u7ED9 AI \u5904\u7406\u3002"),A.issues.map((F,K)=>n("div",{key:K},F)),A.rows.filter(F=>F.issues.length).map(F=>n("details",{key:F.id,open:!0},n("summary",null,F.path||"\u5185\u8054\u811A\u672C"),F.issues.slice(0,12).map((K,ae)=>n("div",{key:`i${ae}`},`${K.line?`\u7B2C ${K.line} \u884C\uFF1A`:""}${K.reason}`)),F.issues.length>12?n("div",null,"\u5176\u4F59\u95EE\u9898\u8BF7\u7531 AI \u6838\u5BF9\u3002"):null))):null,E&&!g.length?n(t.Fragment,null,n("div",null,`\u5DF2\u66FF\u6362 ${E.scripts} \u4E2A\u811A\u672C\u7684 ${E.replacements} \u5904\u6587\u672C\uFF0C\u66F4\u65B0 ${E.projectFiles} \u4E2A\u9879\u76EE\u6587\u4EF6\u3002\u5907\u4EFD\uFF1A${E.backupRoot}`),n("button",{className:"qxsim-action",onClick:N},"\u524D\u5F80 Lua \u811A\u672C")):null)}}function _e(t){try{t?.close()}catch{}}function ka(){if(window.location.protocol==="dsh-app:")return null;let t;try{return t=window.open("about:blank","_blank"),!t||t.closed?null:(t.document.write('<!doctype html><meta charset="utf-8"><title>\u6B63\u5728\u51C6\u5907\u8BD5\u73A9\u2026</title><p>\u6B63\u5728\u4FDD\u5B58\u9879\u76EE\u5E76\u51C6\u5907\u8BD5\u73A9\u2026</p>'),t)}catch{return _e(t),null}}function qt(t){let n=t.createElement,f=new Map;function o({entry:e,api:h,onClosed:y}){let N=t.useRef(null),P=t.useRef(null),[$,v]=t.useState(!1),[I,A]=t.useState(""),[L,E]=t.useState(!1);t.useLayoutEffect(()=>{let q={closing:!1,stopped:!1,pending:null,controller:null,requests:new Set};P.current=q;let C=N.current,_=C.querySelector("iframe"),S=!0,H=()=>{if(q.stopped)return Promise.resolve();if(q.closing=!0,!q.controller)return q.stopped=!0,Promise.resolve();if(!q.pending){let M=(async()=>{q.controller?.quiesce(),await Promise.allSettled([...q.requests]),await h(e.sessionId,"play",{action:"stop",args:{}}),q.stopped=!0})().finally(()=>{q.pending=null,f.get(e.sessionId)===M&&f.delete(e.sessionId)});q.pending=M,f.set(e.sessionId,M)}return q.pending};q.close=async()=>{if(!(q.pending||q.stopped)){v(!0),A("");try{await H(),S&&y()}catch(M){S&&(A(`\u505C\u6B62\u8BD5\u73A9\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5\uFF1A${M?.message||M}`),v(!1))}}};let g=M=>{M.source!==_.contentWindow||M.data?.type!=="qxqy-play-close"||M.data.sessionId!==e.sessionId||q.close()},j=M=>{M.preventDefault(),q.close()};return window.addEventListener("message",g),C.addEventListener("cancel",j),C.showModal(),()=>{S=!1,window.removeEventListener("message",g),C.removeEventListener("cancel",j),C.close(),H().catch(M=>console.error("Embedded play cleanup failed",M)),e.returnFocus?.isConnected&&e.returnFocus.focus()}},[e,h,y]);function B(q){let C=P.current;if(!C.closing)try{let _=q.currentTarget,S=_.contentWindow?.qxqyEmbeddedPlay;if(!S)throw new Error("\u8BD5\u73A9\u9875\u672A\u80FD\u52A0\u8F7D\uFF0C\u8BF7\u8FD4\u56DE\u7F16\u8F91\u540E\u91CD\u8BD5\u3002");C.controller=S,E(!0),_.focus(),S.focus();let H=(g,j={})=>{if(C.closing)return Promise.reject(new Error("\u8BD5\u73A9\u6B63\u5728\u5173\u95ED"));let M=h(e.sessionId,"play",{action:g,args:j});return C.requests.add(M),M.then(()=>C.requests.delete(M),()=>C.requests.delete(M)),M};S.start(H).catch(g=>{C.closing||A(g?.message||String(g))})}catch(_){A(_?.message||String(_))}}return n("dialog",{ref:N,className:"qxsim-play-overlay","aria-label":"\u5185\u5D4C\u8BD5\u73A9","aria-modal":!0},n("header",{className:"qxsim-play-header"},n("span",{role:"status"},$?"\u6B63\u5728\u505C\u6B62\u8BD5\u73A9\u2026":L?"\u5185\u5D4C\u8BD5\u73A9":"\u6B63\u5728\u8F7D\u5165\u8BD5\u73A9\u2026"),n("button",{className:"qxsim-action",type:"button",disabled:$,onClick:()=>void P.current?.close?.()},"\u5173\u95ED\u8BD5\u73A9")),I?n("div",{className:"qxsim-play-error",role:"alert"},I):null,n("iframe",{title:"\u5343\u661F\u6C99\u7BB1\u8BD5\u73A9",src:e.url,onLoad:B,tabIndex:0}))}return function({sessionId:h,api:y,playUrl:N,onError:P}){let $=t.useRef(null),[v,I]=t.useState(!1),[A,L]=t.useState(null),E=t.useCallback(()=>L(null),[]);t.useEffect(()=>{let q={active:!0,pending:!1,popup:null};return $.current=q,I(!1),L(null),()=>{q.active=!1,_e(q.popup)}},[h]);async function B(q){let C=$.current;if(!C?.active||C.pending||A)return;C.pending=!0;let _=document.activeElement;I(!0);try{let S=ka();if(C.popup=S,await f.get(h),!C.active||(await q(),!C.active))return;let H=new URL(N(h),window.location.href);if(S){try{if(S.closed)throw new Error("Play window closed");S.location.replace(H.href)}catch{_e(S),S=null}C.popup=null}S||(H.searchParams.set("embedded","1"),L({sessionId:h,url:H.href,returnFocus:_}))}catch(S){_e(C.popup),C.popup=null,C.active&&P(S?.message||String(S))}finally{C.pending=!1,C.active&&I(!1)}}return{open:B,opening:v,overlay:A?.sessionId===h?n(o,{key:h,entry:A,api:y,onClosed:E}):null}}}var wt="prefab-v1",Na=[[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 St(t){return!Number.isSafeInteger(t)||!Na.some(([n,f])=>t>=n&&t<=f)?null:t===10003004||t===10008001?128:256}var Ca="sprite-v1",$a="/qxqy-assets/",Ia=[[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 Se(t){return t==null||t===""?"StaticReference":typeof t=="string"?t:typeof t.Name=="string"?t.Name:"Unknown"}function ue(t,n){return`${Se(n)}:${t}`}function Ie(t,n){let f=Se(n);return f==="Prefab"?St(t)!==null:f==="StaticReference"&&Number.isSafeInteger(t)&&t>100006&&Ia.some(([o,e])=>t>=o&&t<=e)}function it(t,n=0,f){let o=Se(f);if(!["StaticReference","Prefab"].includes(o))throw new Error(`Unsupported image source: ${o}`);return`${$a}${o==="Prefab"?wt:Ca}/${t}.png${n?`?refresh=${n}`:""}`}function kt(t,n=0,f){return it(t,n,f).replace(".png",".json")}var nt="qxqy-image-refresh",ge=new Map,Le=new Map,Ae=new Map,rt=new Set,Aa=16777216,Nt=!1;function $t(t,n){Ae.set(t,n),ge.delete(t),Le.delete(t);for(let f of rt)f(t)}var Ct=t=>/^\d+$/.test(t)?ue(Number(t)):t;function Ue(){if(!(Nt||typeof window>"u")){Nt=!0;try{for(let[t,n]of Object.entries(JSON.parse(localStorage.getItem(nt)||"{}")))Ae.set(Ct(t),n)}catch{}window.addEventListener("storage",t=>{if(t.key===nt)try{for(let[n,f]of Object.entries(JSON.parse(t.newValue||"{}"))){let o=Ct(n);Ae.get(o)!==f&&$t(o,f)}}catch{}})}}function st(t){return Ue(),rt.add(t),()=>rt.delete(t)}function It(t,n){Ue(),$t(ue(t,n),Date.now());try{localStorage.setItem(nt,JSON.stringify(Object.fromEntries(Ae)))}catch{}}function ot(t,n){if(Ue(),Se(n)!=="StaticReference"||!Ie(t,n))return Promise.resolve(null);let f=ue(t,n),o=Le.get(f);if(o)return o;let e=fetch(kt(t,Ae.get(f),n),{signal:AbortSignal.timeout(3e4)}).then(async h=>{if(!h.ok)throw new Error(`\u56FE\u7247 ${t} \u5143\u6570\u636E\u52A0\u8F7D\u5931\u8D25\uFF1AHTTP ${h.status}`);return h.json()}).catch(h=>{throw Le.get(f)===e&&Le.delete(f),h});return Le.set(f,e),e}async function At(t,n){let[f,o]=await Promise.all([Ea(t,n),ot(t,n).then(e=>({meta:e,error:""}),e=>({meta:void 0,error:e.message}))]);return{image:f,...o}}function Ea(t,n){if(Ue(),!Ie(t,n))return Promise.reject(new Error("Image source/ID is not in the preview allowlist"));let f=ue(t,n),o=ge.get(f);if(o&&(!o.failed||Date.now()<o.retryAt))return ge.delete(f),ge.set(f,o),o.promise;let e={pixels:0,failed:!1};return e.promise=new Promise((h,y)=>{let N=new Image,P=setTimeout(()=>{N.src="",$(new Error("\u56FE\u7247\u52A0\u8F7D\u8D85\u65F6"))},45e3);function $(v){if(clearTimeout(P),N.onload=N.onerror=null,v){e.failed=!0,e.retryAt=Date.now()+6e4,y(v);return}e.pixels=N.width*N.height;let I=[...ge.values()].reduce((A,L)=>A+L.pixels,0);for(let[A,L]of ge){if(I<=Aa&&ge.size<=128)break;A!==f&&(!L.pixels&&!L.failed||(ge.delete(A),I-=L.pixels))}h(N)}N.onload=()=>$(),N.onerror=()=>$(new Error(`\u56FE\u7247 ${t} \u52A0\u8F7D\u5931\u8D25\uFF0C\u53EF\u5728\u5C5E\u6027\u9762\u677F\u5237\u65B0\u7D20\u6750`)),N.src=it(t,Ae.get(f),n)}),ge.set(f,e),e.promise}function Et(t,n,f){let o=Number(n??4294967295)>>>0;if((o&16777215)===16777215)return t;let e=f(t.width,t.height),h=e.getContext("2d");h.drawImage(t,0,0);let y=h.getImageData(0,0,e.width,e.height),N=o>>>16&255,P=o>>>8&255,$=o&255;for(let v=0;v<y.data.length;v+=4)y.data[v]=Math.round(y.data[v]*N/255),y.data[v+1]=Math.round(y.data[v+1]*P/255),y.data[v+2]=Math.round(y.data[v+2]*$/255);return h.putImageData(y,0,0),e}function lt(t){return!!t?.border&&Object.values(t.border).some(n=>Number.isFinite(n)&&n>0)}function He(t,n){let f=typeof n=="object"?n?.Name:n;return lt(t)&&f!=="Basic"?"Stretch":"Basic"}function Pa(t,n,f,o){n=Number.isFinite(n)?Math.max(0,n):0,f=Number.isFinite(f)?Math.max(0,f):0;let e=Math.min(1,t/(n+f||1));n*=e,f*=e;let h=Math.min(1,o/(n+f||1));return{source:[0,n,t-f,t],target:[0,n*h,o-f*h,o]}}var Pt=new WeakMap;function Lt(t,n,f,o,e){let h=Math.max(0,f),y=Math.max(0,o),N=Math.min(1,4096/Math.max(1,h),4096/Math.max(1,y)),P=Math.max(1,Math.round(h*N)),$=Math.max(1,Math.round(y*N)),v=e(P,$),I=v.getContext("2d");if(!h||!y)return v;let A=Pt.get(t);if(!A){let _=e(t.width,t.height),S=_.getContext("2d");S.drawImage(t,0,0),A=S.getImageData(0,0,t.width,t.height),Pt.set(t,A)}let L=I.createImageData(P,$),E=A.data,B=(_,S,H,g,j,M)=>{let{source:R,target:F}=Pa(S,H,g,j);return Array.from({length:M},(K,ae)=>{let le=(ae+.5)*j/M,V=le<F[1]?0:le<F[2]?1:2,ee=F[V+1]>F[V]?(le-F[V])/(F[V+1]-F[V]):0,ce=Math.max(0,Math.min(_-1,(R[V]+ee*(R[V+1]-R[V]))*_/S-.5)),Q=Math.floor(ce);return[Q,Math.min(_-1,Q+1),ce-Q]})},q=B(t.width,n.width,n.border.left,n.border.right,h,P),C=B(t.height,n.height,n.border.top,n.border.bottom,y,$);for(let _=0;_<$;_++)for(let S=0;S<P;S++){let[H,g,j]=q[S],[M,R,F]=C[_],K=(M*t.width+H)*4,ae=(M*t.width+g)*4,le=(R*t.width+H)*4,V=(R*t.width+g)*4,ee=E[K+3]*(1-j)*(1-F),ce=E[ae+3]*j*(1-F),Q=E[le+3]*(1-j)*F,he=E[V+3]*j*F,me=ee+ce+Q+he,be=(_*P+S)*4;L.data[be+3]=Math.round(me);for(let oe=0;oe<3;oe++)L.data[be+oe]=me?Math.round((E[K+oe]*ee+E[ae+oe]*ce+E[le+oe]*Q+E[V+oe]*he)/me):0}return I.putImageData(L,0,0),v}function Tt(t,n,f){if(t.fillType!=="Horizontal"&&t.fillType!=="Vertical")return null;let o=Number(t.fillAmount??1),e=Number.isFinite(o)?Math.max(0,Math.min(1,o)):1;if(t.fillType==="Horizontal"){let y=n*e;return{x:t.fillHorizontalType==="Right"?n/2-y:-n/2,y:-f/2,width:y,height:f}}let h=f*e;return{x:-n/2,y:t.fillVerticalType==="Top"?-f/2:f/2-h,width:n,height:h}}function Mt(t,n){let f=document.createElement("canvas");return f.width=t,f.height=n,f}function zt(t){let n=t.createElement;return function({item:o}){let e=ue(o.imageId,o.imageSource),h=t.useRef(null),[y,N]=t.useState({image:null,meta:null,error:""}),[P,$]=t.useState(0);return t.useEffect(()=>st(v=>{v===e&&$(I=>I+1)}),[e]),t.useEffect(()=>{let v=!0;return N({image:null,error:""}),At(o.imageId,o.imageSource).then(({image:I,meta:A,error:L})=>{v&&N({image:I,meta:A,error:L})},I=>{v&&N({image:null,error:I.message})}),()=>{v=!1}},[e,P]),t.useEffect(()=>{let v=h.current;if(!y.image||!v)return;let I=He(y.meta,o.imageType)==="Stretch"?Lt(y.image,y.meta,o.width,o.height,Mt):y.image,A=Et(I,o.imageColor,Mt);v.width=A.width,v.height=A.height;let L=v.getContext("2d"),E=o.enableFill?Tt(o,v.width,v.height):null;E&&(L.beginPath(),L.rect(E.x+v.width/2,E.y+v.height/2,E.width,E.height),L.clip()),L.globalAlpha=(Number(o.imageColor??4294967295)>>>24&255)/255,L.drawImage(A,0,0)},[y.image,y.meta,o.imageType,o.width,o.height,o.imageColor,o.enableFill,o.fillType,o.fillHorizontalType,o.fillVerticalType,o.fillAmount]),y.image?n("canvas",{ref:h,title:y.error,"data-image-id":o.imageId,"data-image-source":Se(o.imageSource),"data-image-type":He(y.meta,o.imageType),"aria-label":`\u56FE\u7247 ${o.imageId}`,style:{display:"block",position:"absolute",inset:0,width:"100%",height:"100%"}}):n("span",{className:"qxsim-box-label",title:y.error,role:y.error?"status":void 0},y.error?`\u56FE\u7247 ${o.imageId} \u52A0\u8F7D\u5931\u8D25`:`\u52A0\u8F7D\u56FE\u7247 ${o.imageId}\u2026`)}}function Ft(t){let n=t.createElement;return function({imageId:o,imageSource:e,value:h,commit:y}){let N=ue(o,e),[P,$]=t.useState({key:"",meta:void 0,error:""}),[v,I]=t.useState(0);t.useEffect(()=>st(E=>{E===N&&I(B=>B+1)}),[N]),t.useEffect(()=>{let E=!0;return $({key:N,meta:void 0,error:""}),ot(o,e).then(B=>{E&&$({key:N,meta:B,error:""})},B=>{E&&$({key:N,meta:void 0,error:B.message})}),()=>{E=!1}},[N,v]);let A=P.key===N&&P.meta!==void 0,L=A&<(P.meta);return n("label",{className:"qxsim-field"},n("span",{className:"qxsim-field-label"},"\u56FE\u7247\u7C7B\u578B"),n("select",{"aria-label":"\u56FE\u7247\u7C7B\u578B",disabled:!L,value:A?He(P.meta,h):"",onChange:E=>y("imageType",E.target.value)},A?n("option",{value:"Basic"},"\u57FA\u7840"):n("option",{value:""},P.error?"\u5143\u6570\u636E\u52A0\u8F7D\u5931\u8D25":"\u8BFB\u53D6\u7D20\u6750\u8FB9\u754C\u2026"),L?n("option",{value:"Stretch"},"\u62C9\u4F38"):null),P.error?n("small",{role:"status"},P.error):null)}}var La=t=>`#${(Number(t)&16777215).toString(16).padStart(6,"0").toUpperCase()}`,Ot=t=>String(Math.round(t/255*100));function Dt(t){let n=t.createElement;return function({field:o,commit:e}){let h=La(o.value),y=Number(o.value)>>>24,N=Ot(y),[P,$]=t.useState(h),[v,I]=t.useState(N),A=t.useRef(!1),[L,E]=t.useState(""),[B,q]=t.useState("");t.useEffect(()=>{$(h),E("")},[h]),t.useEffect(()=>{A.current||(I(N),q(""))},[N]);function C(g){let j=g.trim().replace(/^#/,"");if(!/^[0-9a-f]{6}$/i.test(j)){E("\u8BF7\u8F93\u5165\u516D\u4F4D\u989C\u8272\uFF0C\u4F8B\u5982 #FF8800");return}let M=`#${j.toUpperCase()}`;$(M),E(""),e(o.key,R=>(Number(R)&4278190080|parseInt(j,16))>>>0)}function _(g){let j=Number(g);if(!String(g).trim()||!Number.isInteger(j)||j<0||j>100){q("\u900F\u660E\u5EA6\u8BF7\u8F93\u5165 0\u2013100 \u7684\u6574\u6570");return}let M=Math.round(j/100*255);A.current=!1,I(Ot(M)),q(""),e(o.key,R=>(M<<24|Number(R)&16777215)>>>0)}let S="Alpha\uFF1A0% \u5B8C\u5168\u900F\u660E\uFF0C100% \u5B8C\u5168\u4E0D\u900F\u660E",H=v.trim()&&Number.isFinite(Number(v))?Math.max(0,Math.min(100,Number(v))):Number(N);return n("div",{className:"qxsim-color-editor",role:"group","aria-label":`${o.label}\u4E0E\u900F\u660E\u5EA6`},n("div",{className:"qxsim-field"},n("span",{className:"qxsim-field-label"},o.label),n("span",{className:"qxsim-color-row"},n("span",{className:"qxsim-color-swatch",title:"\u6253\u5F00\u53D6\u8272\u5668"},n("input",{type:"color",value:/^#[0-9a-f]{6}$/i.test(P)?P:h,disabled:!!o.readonly,"aria-label":`${o.label}\u53D6\u8272\u5668`,onInput:g=>C(g.target.value)})),n("input",{type:"text",value:P,spellCheck:!1,disabled:!!o.readonly,placeholder:"#RRGGBB","aria-label":`${o.label} RGB`,"aria-invalid":!!L,onChange:g=>{$(g.target.value),E("")},onBlur:()=>C(P),onKeyDown:g=>{g.key==="Enter"&&g.currentTarget.blur(),g.key==="Escape"&&($(h),E(""))}})),L?n("small",{className:"qxsim-color-error",role:"alert"},L):null),n("div",{className:"qxsim-field"},n("span",{className:"qxsim-field-label",title:S},"\u900F\u660E\u5EA6"),n("span",{className:"qxsim-alpha-row"},n("input",{type:"range",min:0,max:100,step:1,value:H,disabled:!!o.readonly,title:S,"aria-label":`${o.label}\u900F\u660E\u5EA6\u6ED1\u5757`,onInput:g=>_(g.target.value)}),n("span",{className:"qxsim-alpha-value"},n("input",{type:"number",min:0,max:100,step:1,inputMode:"numeric",value:v,disabled:!!o.readonly,title:S,"aria-label":`${o.label}\u900F\u660E\u5EA6`,"aria-invalid":!!B,onChange:g=>{A.current=!0,I(g.target.value),q("")},onBlur:()=>{A.current&&_(v)},onKeyDown:g=>{g.key==="Enter"&&g.currentTarget.blur(),g.key==="Escape"&&(A.current=!1,I(N),q(""))}}),n("span",{"aria-hidden":!0},"%"))),B?n("small",{className:"qxsim-color-error",role:"alert"},B):null))}}function jt(t,n,f){let o=t.renderMatrix;if(!o)return{};let e=o.a*t.centerX+o.c*t.centerY+o.tx,h=o.b*t.centerX+o.d*t.centerY+o.ty;return{left:`${(e-t.width/2)/n*100}%`,bottom:`${(h-t.height/2)/f*100}%`,width:`${t.width/n*100}%`,height:`${t.height/f*100}%`,transform:`matrix(${o.a},${-o.b},${-o.c},${o.d},0,0)`}}function Bt(t,{api:n,playUrl:f,saveToWorkspace:o=!1}){let e=t.createElement,h=vt(t),y=yt(t),N=qt(t),P=zt(t),$=Ft(t),v=Dt(t),I="qxqy-simulator-style",A=`
|
|
1
|
+
(()=>{var Ve={"\u5F53\u524D\u540E\u53F0\u5C1A\u672A\u52A0\u8F7D\u5B57\u4F53\u8BBE\u7F6E\u529F\u80FD\uFF0C\u8BF7\u91CD\u542F Web \u6216 Harness \u5BBF\u4E3B\u540E\u91CD\u8BD5\u3002":"The running backend does not support font settings yet. Restart the Web or Harness host, then retry.","\u5F53\u524D\u540E\u53F0\u5C1A\u672A\u52A0\u8F7D\u68C0\u67E5\u66F4\u65B0\u529F\u80FD\uFF0C\u8BF7\u91CD\u542F Web \u6216 Harness \u5BBF\u4E3B\u540E\u91CD\u8BD5\u3002":"The running backend does not support update checks yet. Restart the Web or Harness host, then retry.","\u8BF7\u8F93\u5165\u516D\u4F4D\u989C\u8272\uFF0C\u4F8B\u5982 #FF8800":"Enter a six-digit color, e.g. #FF8800","\u900F\u660E\u5EA6\u8BF7\u8F93\u5165 0\u2013100 \u7684\u6574\u6570":"Enter an integer from 0 to 100 for opacity","Alpha\uFF1A0% \u5B8C\u5168\u900F\u660E\uFF0C100% \u5B8C\u5168\u4E0D\u900F\u660E":"Alpha: 0% is transparent; 100% is opaque","{0}\u4E0E\u900F\u660E\u5EA6":"{0} and opacity",\u6253\u5F00\u53D6\u8272\u5668:"Open color picker","{0}\u53D6\u8272\u5668":"{0} color picker",\u900F\u660E\u5EA6:"Opacity","{0}\u900F\u660E\u5EA6\u6ED1\u5757":"{0} opacity slider","{0}\u900F\u660E\u5EA6":"{0} opacity","Lua \u7D22\u5F15\u5F85\u540C\u6B65\uFF08{0} \u9879\uFF09\xB7 \u5C55\u5F00":"Lua index references need updating ({0}) \xB7 Expand","Lua \u7D22\u5F15\u540C\u6B65":"Update Lua Index References","\u4E0B\u4E00\u6B65\uFF1A\u540C\u6B65 Lua \u7D22\u5F15\u5F15\u7528\uFF08{0} \u9879\uFF09":"Next: Update Lua index references ({0})",\u811A\u672C\u5168\u91CF\u66FF\u6362\u5DF2\u5B8C\u6210:"Script index replacement completed",\u5173\u95ED\u7D22\u5F15\u540C\u6B65\u63D0\u793A:"Close index update notice","\u6536\u8D77\u63D0\u793A\uFF0C\u4FDD\u7559\u5F85\u540C\u6B65\u8BB0\u5F55":"Collapse notice and keep pending changes",\u5173\u95ED:"Close","\u540C\u6B65\u4EFB\u52A1\uFF08\u7C98\u8D34\u7ED9\u5F53\u524D\u9879\u76EE\u7684 AI\uFF09":"Update task (paste into this project's AI chat)","AI \u7D22\u5F15\u540C\u6B65\u4EFB\u52A1":"AI task: Update index references","AI \u5DF2\u5904\u7406\uFF0C\u91CD\u65B0\u8F7D\u5165\u5B58\u6863":"AI finished \u2014 reload the save","\u63A7\u4EF6\u7D22\u5F15\u5DF2\u4FEE\u6539\uFF0C\u8BF7\u9009\u62E9\u4E00\u79CD\u65B9\u5F0F\u540C\u6B65\u811A\u672C\u3002":"Control indices changed. Choose how to update script references.","\u8BF7\u68C0\u67E5\u66FF\u6362\u7ED3\u679C\u5E76\u4FDD\u5B58\u5B58\u6863\uFF0C\u518D\u5230\u300CLua \u811A\u672C \u2192 \u5B9E\u673A\u811A\u672C\u540C\u6B65\u300D\u66F4\u65B0\u6E38\u620F\u91CC\u7684\u6587\u4EF6\u5E76\u91CD\u65B0\u8BD5\u73A9\u3002":"Review the replacements and save. Then use Lua Scripts \u2192 Sync Scripts to Game and test again in the game.",\u7D22\u5F15\u540C\u6B65\u65B9\u5F0F:"Update method",\u5168\u91CF\u66FF\u6362\u811A\u672C\u7D22\u5F15:"Replace All Script Indices","\u53EF\u80FD\u9519\u8BEF\u5730\u66FF\u6362\u975E\u7D22\u5F15\u5185\u5BB9\u3002":"This may replace numbers unrelated to control indices.","\u6309\u5B8C\u6574\u5341\u8FDB\u5236\u6570\u5B57\u66FF\u6362\u6240\u6709\u5DF2\u767B\u8BB0\u811A\u672C\uFF0C\u5305\u62EC\u914D\u7F6E\u8868\u3001\u5B57\u7B26\u4E32\u548C\u6CE8\u91CA\uFF1B\u540C\u65F6\u66F4\u65B0\u5185\u5BB9\u4E00\u81F4\u7684\u5DE5\u4F5C\u533A\u6E90\u6587\u4EF6\uFF0C\u66FF\u6362\u524D\u81EA\u52A8\u5907\u4EFD\u3002":"Replace whole decimal numbers in all registered scripts, including tables, strings, and comments. Matching workspace source files are updated too, with backups.","\u590D\u5236\u63D0\u793A\u8BCD\u7ED9 AI":"Copy Task for AI","\u5148\u4FDD\u5B58\u6700\u65B0\u5B58\u6863\uFF0C\u518D\u590D\u5236\u5305\u542B\u6620\u5C04\u8BFB\u53D6\u65B9\u5F0F\u548C\u811A\u672C\u4F4D\u7F6E\u7684\u63D0\u793A\u8BCD\uFF0C\u7531 AI \u5224\u65AD\u54EA\u4E9B\u5F15\u7528\u9700\u8981\u66F4\u65B0\u3002":"Save first, then copy the index mapping instructions and script locations so the AI can identify references to update.","\u67E5\u770B\u7D22\u5F15\u53D8\u66F4\uFF08{0} \u9879\uFF09":"View index changes ({0})","\u8FD9\u91CC\u663E\u793A\u524D 20 \u9879\uFF1B\u5B8C\u6574\u6620\u5C04\u968F\u5B58\u6863\u4FDD\u5B58\uFF0C\u590D\u5236\u7684\u4EFB\u52A1\u4F1A\u5F15\u5BFC AI \u8BFB\u53D6\u5168\u90E8\u3002":"Showing the first 20 changes. The save includes the complete mapping; the copied task tells the AI how to read it.","Lua \u7D22\u5F15\u540C\u6B65\u95EE\u9898":"Lua index update issues","\u6E90\u7801\u6587\u4EF6\u6216\u7D22\u5F15\u6620\u5C04\u5B58\u5728\u51B2\u7A81\uFF0C\u672C\u6B21\u6CA1\u6709\u4FEE\u6539\u811A\u672C\u3002\u53EF\u590D\u5236\u63D0\u793A\u8BCD\u7ED9 AI \u5904\u7406\u3002":"Source files or index mappings conflict. No scripts were changed. You can copy a task for the AI.",\u5185\u8054\u811A\u672C:"Inline script","\u7B2C {0} \u884C\uFF1A":"Line {0}:","\u5176\u4F59\u95EE\u9898\u8BF7\u7531 AI \u6838\u5BF9\u3002":"Ask the AI to review the remaining issues.","\u5DF2\u66FF\u6362 {0} \u4E2A\u811A\u672C\u7684 {1} \u5904\u6587\u672C\uFF0C\u66F4\u65B0 {2} \u4E2A\u9879\u76EE\u6587\u4EF6\u3002\u5907\u4EFD\uFF1A{3}":"Replaced {1} occurrences in {0} scripts and updated {2} project files. Backups: {3}","\u524D\u5F80 Lua \u811A\u672C":"Open Lua Scripts",\u65E0\u6CD5\u8BFB\u53D6\u5B57\u4F53\u8BBE\u7F6E:"Unable to read font settings","\u627E\u5230\u5B57\u4F53\uFF1A{0}\u3002":"Font found: {0}.","\u9ED8\u8BA4\u4F4D\u7F6E\u672A\u627E\u5230\u5B57\u4F53\uFF0C\u5C06\u4F7F\u7528\u7CFB\u7EDF\u5B57\u4F53\u3002":"No font found in the default locations. The system font will be used.","\u5DF2\u4FDD\u5B58\u3002{0}\u91CD\u542F Web\u3001MCP \u6216 Harness \u5BBF\u4E3B\u540E\uFF0C\u5237\u65B0\u7F16\u8F91\u5668\u53CA\u8BD5\u73A9\u9875\u751F\u6548\u3002":"Saved. {0}Restart the Web, MCP, or Harness host, then refresh the editor and playtest pages to apply.",\u5B57\u4F53\u8BBE\u7F6E:"Font Settings","\u81EA\u5B9A\u4E49\u5B57\u4F53\u53EF\u7528\u4E8E\u6E38\u620F\u5185\u6587\u672C\u6216\u6574\u4F53 UI\u3002\u8BBE\u7F6E\u4EC5\u4FDD\u5B58\u5728\u672C\u673A\uFF0C\u91CD\u542F\u5BBF\u4E3B\u540E\u751F\u6548\u3002":"Apply the custom font to in-game text or the entire UI. Settings stay on this machine and apply after restarting the host.",\u5E94\u7528\u8303\u56F4:"Apply to",\u4EC5\u6E38\u620F\u5185\u6587\u672C:"In-game text only","\u6574\u4F53 UI":"Entire UI","\u4EC5\u6E38\u620F\u5185\u6587\u672C\uFF1A\u7528\u4E8E\u753B\u5E03\u3001\u8BD5\u73A9\u548C\u622A\u56FE\uFF1B\u6574\u4F53 UI\uFF1A\u540C\u65F6\u66FF\u6362\u5DE5\u5177\u680F\u3001\u9762\u677F\u3001\u4EE3\u7801\u548C\u65E5\u5FD7\u5B57\u4F53\u3002":"In-game text only: canvas, playtests, and screenshots. Entire UI: also changes fonts in toolbars, panels, code, and logs.",\u8BF7\u9009\u62E9\u5B57\u4F53\u5E94\u7528\u8303\u56F4:"Choose where to apply the font","\u5F53\u524D\u5B57\u4F53\uFF1A{0}":"Active font: {0}",\u7CFB\u7EDF\u5B57\u4F53:"System font","\u5B57\u4F53\u6587\u4EF6\u7531\u73AF\u5883\u53D8\u91CF QXQY_FONT_PATH \u6307\u5B9A\uFF0C\u4ECD\u53EF\u8C03\u6574\u5E94\u7528\u8303\u56F4\u3002":"QXQY_FONT_PATH selects the font file. You can still change where it applies.",\u5B57\u4F53\u6765\u6E90:"Font source",\u81EA\u52A8\u5C1D\u8BD5\u539F\u795E\u7684\u9ED8\u8BA4\u5B89\u88C5\u4F4D\u7F6E:"Look in Genshin Impact's default installation locations",\u6307\u5B9A\u672C\u673A\u5B57\u4F53\u6587\u4EF6:"Use a local font file",\u4F7F\u7528\u7CFB\u7EDF\u5B57\u4F53:"Use the system font",\u5B57\u4F53\u6587\u4EF6\u8DEF\u5F84:"Font file path","\u586B\u5199 TTF / OTF \u7684\u7EDD\u5BF9\u8DEF\u5F84\uFF0C\u6700\u5927 32 MiB\uFF1B\u53EF\u4EE5\u76F4\u63A5\u7C98\u8D34\u5E26\u5F15\u53F7\u7684 Windows \u8DEF\u5F84\u3002":"Enter an absolute TTF / OTF path (up to 32 MiB). Quoted Windows paths are accepted.","\u6309\u987A\u5E8F\u5C1D\u8BD5\u4EE5\u4E0B\u4F4D\u7F6E\uFF1B\u90FD\u672A\u627E\u5230\u65F6\u4F7F\u7528\u7CFB\u7EDF\u5B57\u4F53\u3002\u5B89\u88C5\u5728\u5176\u4ED6\u76D8\u7B26\u65F6\u8BF7\u9009\u62E9\u201C\u6307\u5B9A\u672C\u673A\u5B57\u4F53\u6587\u4EF6\u201D\u3002":"These locations are checked in order. If none contains a font, the system font is used. For another drive, select \u201CUse a local font file\u201D.","\u5F53\u524D\u7CFB\u7EDF\u4E0D\u81EA\u52A8\u67E5\u627E\uFF0C\u8BF7\u6307\u5B9A\u5B57\u4F53\u6587\u4EF6\u3002":"Automatic font discovery is unavailable on this system. Specify a font file.","\u6709\u5DF2\u4FDD\u5B58\u7684\u5B57\u4F53\u8BBE\u7F6E\uFF0C\u91CD\u542F\u5BBF\u4E3B\u5E76\u5237\u65B0\u9875\u9762\u540E\u751F\u6548\u3002":"Font settings have been saved. Restart the host and refresh the pages to apply them.","\u6B63\u5728\u8BFB\u53D6\u8BBE\u7F6E\u2026":"Loading settings\u2026","\u4FDD\u5B58\u4E2D\u2026":"Saving...",\u4FDD\u5B58\u8BBE\u7F6E:"Save Settings","\u56FE\u7247 {0} \u52A0\u8F7D\u5931\u8D25":"Failed to load image {0}","\u52A0\u8F7D\u56FE\u7247 {0}\u2026":"Loading image {0}\u2026","\u56FE\u7247 {0}":"Image {0}",\u56FE\u7247\u7C7B\u578B:"Image Type",\u5143\u6570\u636E\u52A0\u8F7D\u5931\u8D25:"Failed to load image metadata","\u8BFB\u53D6\u7D20\u6750\u8FB9\u754C\u2026":"Loading asset borders\u2026",\u57FA\u7840:"Basic",\u62C9\u4F38:"Stretch",\u5BA2\u6237\u7AEF\u63A7\u4EF6\u5BB9\u5668:"Client Control Container",\u5BB9\u5668\u8282\u70B9:"Container Control",\u6587\u672C\u6846:"Text Box",\u5149\u6807\u68C0\u6D4B\u533A\u57DF:"CursorEventArea",\u6A21\u677F\u5F15\u7528\u63A7\u4EF6:"Reference Control",\u7F51\u683C\u89C6\u7A97:"Grid Scroller",\u56FE\u7247:"Image",\u9884\u8BBE\u6309\u94AE:"Preset Button",\u6587\u672C\u89C6\u7A97:"Text Window",\u6309\u952E\u63D0\u793A:"Key Hint",\u754C\u9762\u52A8\u6548:"UI Animation",\u5168\u5C4F\u52A8\u6548:"Fullscreen UI Animation",\u5149\u6807\u68C0\u6D4B:"CursorEventArea",\u6A21\u677F\u5F15\u7528:"Reference Control","\u5BFC\u51FA\u5185\u5BB9\u89E3\u7801\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5\u6216\u5237\u65B0\u9875\u9762":"Unable to decode the export. Retry or refresh the page.","PC KEYBOARD \u753B\u5E03\uFF1A1600\xD7900 / 2100\xD7900":"PC KEYBOARD canvas: 1600\xD7900 / 2100\xD7900",\u624B\u673A:"Mobile","\u624B\u673A TOUCHSCREEN \u753B\u5E03\uFF1A1280\xD7720 / 1560\xD7720 / 1280\xD7960":"Mobile TOUCHSCREEN canvas: 1280\xD7720 / 1560\xD7720 / 1280\xD7960",\u5C1A\u65E0\u53EF\u7F16\u8F91\u503C:"No editable value available","\u672A\u8BC6\u522B\u9009\u9879 {0}\uFF08\u4FDD\u7559\u539F\u503C\uFF09":"Unknown option {0} (original value preserved)",\u7A7A:"None","\u65B0\u5EFA\u5E76\u7ED1\u5B9A{0}\u56FE\u7247":"Create and assign a {0} image",\u7FBD\u5316\u5BBD\u5EA6:"Soft Edge Width",\u7FBD\u5316\u8303\u56F4:"Soft Edge Range",\u56FE\u7247\u8BBE\u7F6E:"Image Settings",\u906E\u7F69\u8BBE\u7F6E:"Mask Settings",\u6587\u672C\u6846\u8BBE\u7F6E:"Text Box Settings",\u6309\u94AE\u8BBE\u7F6E:"Button Settings","{0}\u8BBE\u7F6E":"{0} Settings",\u8282\u70B9\u4FE1\u606F:"Node Information",\u53D8\u6362:"Transform",\u4F4D\u7F6E:"Location",\u5927\u5C0F:"Size",\u4E2D\u5FC3:"Pivot",\u521B\u5EFA\u8BBE\u7F6E:"Create Settings",\u624B\u67C4\u5BFC\u822A:"Controller Navigation",\u5B9E\u73B0\u72B6\u6001:"Support Status","\u5B58\u6863\u5185 Lua \u811A\u672C\uFF08{0}\uFF09":"Lua Scripts in This Save ({0})","\uFF0B \u65B0\u5EFA\u811A\u672C":"\uFF0B New Script","(\u672A\u547D\u540D\u811A\u672C)":"(Unnamed script)","\u6302\u8F7D\uFF1A{0} \xB7 {1}":"Attached to: {0} \xB7 {1}","\u672A\u6302\u8F7D\uFF08\u4EC5\u53EF\u88AB require\uFF09":"Not attached (available through require only)","\u4E0B\u8F7D\u8BE5\u811A\u672C .lua":"Download this script as .lua",\u5220\u9664\u8BE5\u811A\u672C:"Delete this script","\u8FD8\u6CA1\u6709\u811A\u672C\uFF0C\u70B9\u51FB\u201C\u65B0\u5EFA\u811A\u672C\u201D\u5F00\u59CB":"No scripts yet. Click \u201CNew Script\u201D to begin.","\u5C5E\u4E8E\u5B58\u6863\u201C{0}\u201D \xB7 Lua \u811A\u672C\u662F\u5B58\u6863\u5185\u72EC\u7ACB\u8D44\u4EA7":"Save: \u201C{0}\u201D \xB7 Lua scripts are separate assets within the save",\u672A\u547D\u540D\u5B58\u6863:"Untitled Save","\u811A\u672C {0}":"Script {0}","\u811A\u672C\u8DEF\u5F84\uFF08\u5DE5\u4F5C\u533A\u76F8\u5BF9\u8DEF\u5F84\uFF09":"Script path (relative to the workspace)","\u6302\u8F7D\u76EE\u6807\uFF08\u5BA2\u6237\u7AEF\u63A7\u4EF6 / \u5BA2\u6237\u7AEF\u63A7\u4EF6\u6A21\u677F\uFF09":"Attach to (client control / client control template)","\u672A\u6302\u8F7D\uFF08\u4E0D\u751F\u6548\uFF0C\u4EC5\u53EF\u88AB require\uFF09":"Not attached (does not run automatically; require only)","\u670D\u52A1\u5668\u63A7\u4EF6\u6A21\u677F \xB7 \u5BA2\u6237\u7AEF\u63A7\u4EF6\u5BB9\u5668\u5185":"Server Control Template \xB7 Inside the Client Control Container",\u5BA2\u6237\u7AEF\u63A7\u4EF6\u6A21\u677F:"Client Control Template","Lua \u6E90\u7801":"Lua Source","-- \u5728\u8FD9\u91CC\u8F93\u5165\u5BA2\u6237\u7AEF Lua\uFF1B\u811A\u672C\u53EA\u6709\u6302\u8F7D\u5230\u5BA2\u6237\u7AEF\u63A7\u4EF6\u540E\u624D\u4F1A\u5728\u8BD5\u73A9\u65F6\u751F\u6548":"-- Enter client-side Lua here; attach the script to a client control to run it in playtests",\u6709\u672A\u4FDD\u5B58\u7684\u4FEE\u6539:"Unsaved changes","\u5DF2\u6302\u8F7D\uFF1A{0}":"Attached to: {0}","\u5F53\u524D\u672A\u6302\u8F7D\uFF0C\u8BD5\u73A9\u65F6\u4E0D\u4F1A\u81EA\u52A8\u8FD0\u884C":"Not attached; it will not run automatically in playtests","\u21E9 \u811A\u672C\u5305 JSON":"\u21E9 Script Bundle JSON","\u21E9 \u811A\u672C\u5305 GIA":"\u21E9 Script Bundle GIA",\u4FDD\u5B58\u811A\u672C:"Save Script",\u8BF7\u65B0\u5EFA\u6216\u9009\u62E9\u4E00\u4E2A\u811A\u672C:"Create or select a script","PlayerSelf \u5F53\u524D\u73A9\u5BB6":"PlayerSelf \u2014 Current Player","AllPlayers \u5168\u90E8\u73A9\u5BB6":"AllPlayers \u2014 All Players","Level \u5173\u5361":"Level \u2014 Stage","Player1 \u73A9\u5BB61":"Player1 \u2014 Player 1","Player2 \u73A9\u5BB62":"Player2 \u2014 Player 2","Player3 \u73A9\u5BB63":"Player3 \u2014 Player 3","Player4 \u73A9\u5BB64":"Player4 \u2014 Player 4","Player5 \u73A9\u5BB65":"Player5 \u2014 Player 5","Player6 \u73A9\u5BB66":"Player6 \u2014 Player 6","Player7 \u73A9\u5BB67":"Player7 \u2014 Player 7","Player8 \u73A9\u5BB68":"Player8 \u2014 Player 8","\u89C4\u5219 {0} \u9700\u8981\u76D1\u542C\u4FE1\u53F7\u540D":"Rule {0} needs a signal name to listen for","\u89C4\u5219 {0} \u81F3\u5C11\u9700\u8981\u4E00\u4E2A\u52A8\u4F5C":"Rule {0} needs at least one action","\u89C4\u5219 {0} \u52A8\u4F5C {1} \u9700\u8981\u5BA2\u6237\u7AEF\u4FE1\u53F7\u540D":"Rule {0}, action {1} needs a client signal name","\u89C4\u5219 {0} \u52A8\u4F5C {1} \u9700\u8981\u53D8\u91CF\u540D":"Rule {0}, action {1} needs a variable name","{0}\u6765\u6E90":"{0} source","\u5B57\u9762\u91CF\uFF08JSON\uFF09":"Literal (JSON)",\u5F15\u7528\u76D1\u542C\u4FE1\u53F7\u53C2\u6570:"Use a received signal argument","{0}\u53C2\u6570\u5E8F\u53F7":"{0} argument index","{0}\u5B57\u9762\u91CF":"{0} literal","\u5BA2\u6237\u7AEF\u4FE1\u53F7\u53C2\u6570\uFF08\u6309\u6DFB\u52A0\u987A\u5E8F\uFF09":"Client signal arguments (in order)","\u53C2\u6570 {0}":"Argument {0}",\u5220\u9664\u53C2\u6570:"Remove argument","\u6682\u65E0\u53C2\u6570\uFF0C\u53EF\u53D1\u9001\u7A7A\u53C2\u6570\u5217\u8868":"No arguments; an empty argument list can be sent","\uFF0B \u6DFB\u52A0\u53C2\u6570":"\uFF0B Add Argument",\u670D\u52A1\u7AEF\u903B\u8F91:"Server Logic","\u5C5E\u4E8E\u5B58\u6863\u201C{0}\u201D \xB7 \u76D1\u542C\u5BA2\u6237\u7AEF\u4FE1\u53F7\u540E\u8BBE\u7F6E Level / \u73A9\u5BB6\u53D8\u91CF\uFF0C\u6216\u5411\u6307\u5B9A\u73A9\u5BB6\u53D1\u9001\u5BA2\u6237\u7AEF\u811A\u672C\u4FE1\u53F7":"Save: \u201C{0}\u201D \xB7 Listen for client signals to set Level / player variables or send client script signals to selected players",\u4FDD\u5B58\u670D\u52A1\u7AEF\u903B\u8F91:"Save Server Logic","\u8FD9\u662F\u6A21\u62DF\u5668\u5B58\u6863\u683C\u5F0F\uFF0C\u4E0D\u662F\u5B98\u65B9\u8282\u70B9\u56FE\u3002PlayerSelf \u8868\u793A\u53D1\u4FE1\u53F7\u7684\u90A3\u4F4D\u73A9\u5BB6\uFF1BPlayer1\u20138 \u662F\u56FA\u5B9A\u5EA7\u4F4D\uFF1BAllPlayers \u5411\u672C\u5C40\u5168\u90E8\u8BD5\u73A9\u73A9\u5BB6\u5E7F\u64AD\u3002":"This uses the simulator's save format. PlayerSelf is the player who sent the signal; Player1\u20138 are fixed slots; AllPlayers broadcasts to every player in this playtest.","\u89C4\u5219 {0}":"Rule {0}",\u76D1\u542C\u4FE1\u53F7\u540D:"Signal to listen for","\u89C4\u5219 {0} \u76D1\u542C\u4FE1\u53F7\u540D":"Rule {0}: signal to listen for",\u5220\u9664\u89C4\u5219:"Remove rule","\u52A8\u4F5C {0}":"Action {0}","\u89C4\u5219 {0} \u52A8\u4F5C {1} \u7C7B\u578B":"Rule {0}, action {1}: type",\u8BBE\u7F6E\u81EA\u5B9A\u4E49\u53D8\u91CF:"Set Custom Variable",\u53D1\u9001\u5BA2\u6237\u7AEF\u811A\u672C\u4FE1\u53F7:"Send Client Script Signal","\u53D1\u7ED9\u5F53\u524D\u73A9\u5BB6\u3001\u6307\u5B9A\u73A9\u5BB6\u6216\u5168\u90E8\u73A9\u5BB6":"Send to the current player, a selected player, or all players","\u5199\u5165 Level / \u5F53\u524D\u73A9\u5BB6 / \u73A9\u5BB61-8":"Write to Level / current player / Player1\u20138",\u5220\u9664\u52A8\u4F5C:"Remove action",\u53D1\u9001\u76EE\u6807:"Send to",\u5BA2\u6237\u7AEF\u4FE1\u53F7\u540D:"Client signal name",\u5B9E\u4F53:"Entity",\u53D8\u91CF\u540D:"Variable name",\u53D8\u91CF\u503C:"Variable value","\uFF0B \u8BBE\u7F6E\u81EA\u5B9A\u4E49\u53D8\u91CF":"\uFF0B Set Custom Variable","\uFF0B \u53D1\u9001\u5BA2\u6237\u7AEF\u811A\u672C\u4FE1\u53F7":"\uFF0B Send Client Script Signal","\u8FD8\u6CA1\u6709\u76D1\u542C\u89C4\u5219\u3002\u8BD5\u73A9\u65F6\u5BA2\u6237\u7AEF SendSignal \u4E0D\u4F1A\u81EA\u52A8\u6539\u53D8\u91CF\u6216\u56DE\u4F20\u4FE1\u53F7\u3002":"No signal rules yet. In a playtest, client SendSignal calls do not automatically change variables or send signals back.","\uFF0B \u6DFB\u52A0\u76D1\u542C\u89C4\u5219":"\uFF0B Add Signal Rule","\u4FDD\u5B58\u540E\u4F1A\u5199\u5165\u5F53\u524D\u5B58\u6863\uFF0C\u4E0B\u6B21\u8BD5\u73A9\u751F\u6548":"Saved to the current save; applies on the next playtest","\u8BF7\u8F93\u5165 1\u20132147483647 \u4E4B\u95F4\u7684\u6574\u6570\u7D22\u5F15\u3002":"Enter an integer index from 1 to 2147483647.",\u5BA2\u6237\u7AEF\u63A7\u4EF6\u7D22\u5F15:"Client Control Index",\u4FDD\u5B58\u4E2D:"Saving",\u4FEE\u6539:"Edit",\u81EA\u52A8\u4FEE\u6539\u5176\u4ED6\u5BA2\u6237\u7AEF\u7D22\u5F15\u503C:"Automatically fill other client control indices",\u81EA\u52A8\u586B\u5145\u7D22\u5F15\u9884\u89C8:"Index Autofill Preview","\u4EE5\u5F53\u524D\u63A7\u4EF6\u4E3A\u57FA\u51C6\uFF0C\u6309 GIA \u5BFC\u5165\u987A\u5E8F\u586B\u5145 {0} \u4E2A\u63A7\u4EF6\uFF08{1} \u4E2A\u6A21\u677F\u53CA\u5176\u5B50\u63A7\u4EF6\uFF09\u3002":"Using this control as the anchor, assign indices in GIA import order to {0} controls ({1} templates and their children).","\u7D22\u5F15\u8303\u56F4\uFF1A{0}\u2013{1}":"Index range: {0}\u2013{1}","\u7D22\u5F15\u8303\u56F4\u8D85\u51FA\u6709\u6548\u8303\u56F4\uFF0C\u8BF7\u68C0\u67E5\u8F93\u5165\u3002":"Index range exceeds the valid bounds. Check your input.","\u9002\u7528\u4E8E\u6574\u6279\u5BFC\u5165\u540E\u672A\u589E\u5220\u3001\u91CD\u6392\u7684\u6A21\u677F\u3002\u670D\u52A1\u7AEF\u754C\u9762\u548C\u811A\u672C\u7D22\u5F15\u9700\u5355\u72EC\u586B\u5199\u3002":"For templates imported together without structural changes or reordering. Server UI and script indices must be entered separately.","\u586B\u5199 GIA \u5BFC\u5165\u540E\u5B9E\u9645\u663E\u793A\u7684\u7D22\u5F15\uFF1B\u4FEE\u6539\u540E\u4ECE\u9875\u9762\u4E0A\u65B9\u7EE7\u7EED\u540C\u6B65 Lua\u3002":"Enter the actual index shown after importing the GIA. Then update Lua references using the notice above.",\u6302\u8F7D\u5230\u8BE5\u63A7\u4EF6\u7684\u811A\u672C:"Scripts Attached to This Control","\u89E3\u9664\u6302\u8F7D\uFF08\u4FDD\u7559\u811A\u672C\uFF09":"Detach (keep script)","\u8BE5\u63A7\u4EF6\u5C1A\u672A\u6302\u8F7D\u811A\u672C\u3002\u811A\u672C\u6302\u8F7D\u5230\u5BA2\u6237\u7AEF\u63A7\u4EF6\u540E\u624D\u4F1A\u5728\u8BD5\u73A9\u65F6\u751F\u6548\u3002":"No script is attached to this control. Attach a script to a client control to run it in playtests.",\u6302\u8F7D\u5DF2\u6709\u811A\u672C:"Attach an Existing Script",\u9009\u62E9\u811A\u672C\u6302\u8F7D\u5230\u8BE5\u63A7\u4EF6:"Choose a script to attach to this control","\u9009\u62E9\u811A\u672C\u2026":"Select a script\u2026","\uFF08\u5F53\u524D\u6302\u8F7D\u4E8E {0} \xB7 {1}\uFF0C\u5C06\u79FB\u52A8\u5230\u6B64\u63A7\u4EF6\uFF09":"(currently on {0} \xB7 {1}; will move to this control)","\uFF08\u672A\u6302\u8F7D\uFF09":"(not attached)","\u5B58\u6863\u5185\u8FD8\u6CA1\u6709\u5176\u4ED6\u811A\u672C\uFF0C\u53EF\u70B9\u51FB\u4E0B\u65B9\u6309\u94AE\u65B0\u5EFA\u3002":"No other scripts in this save. Create one using the button below.","\uFF0B \u65B0\u5EFA\u811A\u672C\u5E76\u6302\u8F7D\u5230\u6B64\u63A7\u4EF6":"\uFF0B Create and Attach a Script","\u7F3A\u5C11\u56FE\u7247 {0}":"Missing image {0}",\u672C\u5730\u5B57\u4F53\u52A0\u8F7D\u5931\u8D25:"Failed to load the local font","\u5F53\u524D\u8D44\u4EA7\u5DF2\u5207\u6362\uFF0C\u8BF7\u91CD\u65B0\u9009\u62E9\u63A7\u4EF6\u540E\u4FEE\u6539\u7D22\u5F15":"The active asset changed. Select the control again before changing its index.","\u63A7\u4EF6\u7D22\u5F15\u5DF2\u4FEE\u6539\u3002\u8BF7\u9009\u62E9\u4E0A\u65B9\u300C\u5168\u91CF\u66FF\u6362\u811A\u672C\u7D22\u5F15\u300D\u6216\u300C\u590D\u5236\u63D0\u793A\u8BCD\u7ED9 AI\u300D\u3002":"Control indices changed. Choose \u201CReplace All Script Indices\u201D or \u201CCopy Task for AI\u201D above.","\u8BF7\u5148\u4FDD\u5B58\u5B8C\u6574\u5B58\u6863\uFF0C\u518D\u590D\u5236\u63D0\u793A\u8BCD\uFF1BAI \u9700\u8981\u8BFB\u53D6\u8FD9\u6B21\u5B9E\u9645\u4FEE\u6539\u7684\u5B58\u6863\u3002":"Save the complete project before copying the task. The AI needs the save containing these changes.","\u8BF7\u5B8C\u6210\u6A21\u62DF\u5668\u63A7\u4EF6\u7D22\u5F15\u4E0E Lua \u5F15\u7528\u540C\u6B65\u3002":"Update the simulator's control indices and Lua references.","\u5DE5\u4F5C\u533A\uFF1A{0}":"Workspace: {0}",\u8BF7\u5148\u6838\u5BF9\u5DE5\u4F5C\u533A:"Verify the workspace first","\u6700\u65B0\u5B8C\u6574\u5B58\u6863\uFF1A{0}\uFF08\u7F16\u8F91\u5668\u5DF2\u4FDD\u5B58\uFF09":"Latest complete save: {0} (saved by the editor)","Lua \u6587\u4EF6\uFF1A{0}":"Lua files: {0}","\u5185\u8054\u811A\u672C {0}":"Inline script {0}",\u6682\u65E0:"None","\u5148\u4ECE\u4E0A\u8FF0\u6587\u4EF6\u91CD\u65B0\u52A0\u8F7D\u6700\u65B0\u5B58\u6863\uFF0C\u4E0D\u8981\u4F7F\u7528\u53E6\u4E00\u4E2A MCP/Web \u8FDB\u7A0B\u91CC\u7684\u65E7\u5DE5\u7A0B\u3002":"Reload the latest save from the file above. Do not use an older project from another MCP/Web process.","\u83B7\u53D6\u65B0\u65E7\u6620\u5C04\uFF1A\u8BFB\u53D6\u8BE5 JSON \u9876\u5C42\u7684 controlGuidChanges \u6570\u7EC4\uFF0C\u5F53\u524D\u5171 {0} \u6761\uFF0C\u5FC5\u987B\u8BFB\u53D6\u5168\u90E8\u8BB0\u5F55\u3002oldGuid \u662F\u65E7\u7D22\u5F15\uFF0CnewGuid \u662F\u65B0\u7D22\u5F15\uFF1BcontrolAsset + controlId \u6807\u8BC6\u63A7\u4EF6\uFF0CcontrolName \u662F\u540D\u79F0\uFF0Cid \u662F\u8BB0\u5F55\u7F16\u53F7\uFF0CbatchId \u662F\u6279\u6B21\u3002":"Read all {0} entries in the save's top-level controlGuidChanges array. oldGuid/newGuid are the old/new indices. controlAsset + controlId identifies the control; controlName is its name; id identifies the change; batchId identifies the batch.","\u83B7\u53D6\u811A\u672C\uFF1A\u8BFB\u53D6 assets.scripts \u6570\u7EC4\uFF1B\u6BCF\u9879\u7684 source \u662F\u5B58\u6863\u5185\u6E90\u7801\uFF0Cpath \u662F\u811A\u672C\u6587\u4EF6\u8DEF\u5F84\uFF08\u76F8\u5BF9\u8DEF\u5F84\u4EE5\u5DE5\u4F5C\u533A\u4E3A\u57FA\u51C6\uFF09\u3002":"Read scripts from assets.scripts. Each source contains the saved code; path identifies its file, relative to the workspace where applicable.","\u6309\u63A7\u4EF6\u8EAB\u4EFD\u548C\u53D8\u66F4\u987A\u5E8F\u6838\u5BF9\u5168\u90E8 Lua \u811A\u672C\u7684\u7D22\u5F15\u5E38\u91CF\u3001\u914D\u7F6E\u8868\u4E0E\u8C03\u7528\uFF0C\u4FEE\u6539\u5B58\u6863\u4E2D\u7684 source \u53CA\u76F8\u5173 Lua \u6E90\u6587\u4EF6\u548C\u751F\u6210\u5668\u6620\u5C04\uFF0C\u907F\u514D\u91CD\u5EFA\u540E\u8986\u76D6\u3002\u4E0D\u8981\u5168\u5C40\u66FF\u6362\u540C\u503C\u6570\u5B57\uFF0C\u4E5F\u4E0D\u8981\u6539\u8FD0\u884C\u65F6\u5B9E\u4F8B ID \u6216\u56FE\u7247\u8D44\u6E90 ID\u3002":"Review index constants, tables, and calls in all Lua scripts by control identity and change order. Update saved source, related Lua files, and generator mappings. Do not globally replace equal numbers or alter runtime instance IDs or image resource IDs.","\u540C\u4E00 batchId \u662F\u540C\u65F6\u6620\u5C04\uFF0C\u987B\u6309\u539F\u503C\u4E00\u6B21\u6027\u5E94\u7528\uFF0C\u4E0D\u80FD\u9010\u6761\u66FF\u6362\u5BFC\u81F4\u7D22\u5F15\u4E32\u6539\u3002":"Changes sharing batchId form one simultaneous mapping. Apply them to original values together to avoid cascading replacements.","\u68C0\u67E5\u65E7\u7D22\u5F15\u5F15\u7528\u5E76\u91CD\u65B0\u8BD5\u73A9\uFF1B\u4EC5\u5728\u5F15\u7528\u5168\u90E8\u540C\u6B65\u6216\u660E\u786E\u6CA1\u6709\u5F15\u7528\u540E\uFF0C\u7528 acknowledgeControlGuidChanges \u7684 changeIds \u6E05\u9664\u5DF2\u6838\u5BF9\u8BB0\u5F55\uFF0C\u4FDD\u5B58\u5B8C\u6574\u5B58\u6863\u3002\u672A\u5224\u65AD\u7684\u8BB0\u5F55\u7EE7\u7EED\u4FDD\u7559\u3002":"Check old references and playtest again. Only after updating every reference or confirming none exist, acknowledge reviewed changeIds with acknowledgeControlGuidChanges and save. Keep unreviewed changes.","\u5B8C\u6210\u540E\u544A\u77E5\u7528\u6237\u91CD\u65B0\u8F7D\u5165\u8FD9\u4E2A\u5B58\u6863\uFF0C\u518D\u901A\u8FC7\u300CLua \u811A\u672C \u2192 \u5B9E\u673A\u811A\u672C\u540C\u6B65\u300D\u66F4\u65B0\u6E38\u620F\u6587\u4EF6\uFF1B\u4E0D\u8981\u91CD\u65B0\u5BFC\u5165 GIA\uFF0C\u4E5F\u4E0D\u8981\u64C5\u81EA\u590D\u5236\u5230\u6E38\u620F\u76EE\u5F55\u3002":"Tell the user to reload this save and use Lua Scripts \u2192 Sync Scripts to Game. Do not reimport GIA or copy files into the game directory without authorization.","\u5B58\u6863\u5DF2\u4FDD\u5B58\uFF0C\u63D0\u793A\u8BCD\u5DF2\u590D\u5236\uFF0C\u5305\u542B\u5B8C\u6574\u6620\u5C04\u7684\u8BFB\u53D6\u65B9\u5F0F\u3002\u7C98\u8D34\u7ED9 AI\uFF1B\u5904\u7406\u540E\u91CD\u65B0\u8F7D\u5165\u5B58\u6863\u3002":"Save written and task copied, including instructions for reading the full mapping. Paste it into the AI chat, then reload the save when finished.","\u5B58\u6863\u5DF2\u4FDD\u5B58\u3002\u526A\u8D34\u677F\u4E0D\u53EF\u7528\uFF0C\u53EF\u4ECE\u4E0B\u65B9\u6587\u672C\u6846\u624B\u52A8\u590D\u5236\u63D0\u793A\u8BCD\u3002":"Save written. Clipboard access is unavailable; copy the task from the text box below.","\u56FE\u7247 {0} \u5DF2\u91CD\u65B0\u4E0B\u8F7D\uFF1B\u540C\u6E90\u8BD5\u73A9\u9875\u4F1A\u540C\u6B65\u5237\u65B0\u3002":"Image {0} downloaded again. Playtest pages on this origin will refresh it too.","{0}\u56FE\u7247":"{0} Image","{0}\u5DF2\u521B\u5EFA\u5E76\u7ED1\u5B9A\uFF1B\u53EF\u5728\u63A7\u4EF6\u6811\u4E2D\u7EE7\u7EED\u7F16\u8F91\u56FE\u7247\u3002":"Created and assigned {0}. Edit the image in the control tree.","Lua \u811A\u672C\u5DF2\u4FDD\u5B58\u5230\u5F53\u524D\u5B58\u6863":"Lua script saved to the current save",\u670D\u52A1\u7AEF\u903B\u8F91\u5DF2\u4FDD\u5B58\u5230\u5F53\u524D\u5B58\u6863:"Server logic saved to the current save",\u5DF2\u65B0\u5EFA\u811A\u672C\u5E76\u6302\u8F7D\u5230\u8BE5\u63A7\u4EF6:"Script created and attached to this control","\u5DF2\u65B0\u5EFA\u811A\u672C\uFF0C\u53EF\u7F16\u8F91\u8DEF\u5F84\u3001\u6E90\u7801\u548C\u6302\u8F7D\u76EE\u6807":"Script created. Edit its path, source, and attachment target.",\u811A\u672C\u5DF2\u5220\u9664:"Script deleted","\u5DF2\u89E3\u9664\u6302\u8F7D\uFF0C\u811A\u672C\u4ECD\u4FDD\u7559\u5728\u5B58\u6863\u4E2D":"Script detached and kept in the save",\u5DF2\u6302\u8F7D\u5230\u5F53\u524D\u63A7\u4EF6:"Attached to the current control","\u5DF2\u5207\u6362\u5230\u5B58\u6863\u5185\u7684{0}":"Switched to {0} in this save","{0}\u6A21\u677F":"{0} Template","\u5DF2\u65B0\u589E{0}\u6A21\u677F":"Created a {0} template","\u5DF2\u6DFB\u52A0{0}\u5B50\u63A7\u4EF6":"Added a {0} child control","\u5DF2\u5BFC\u51FA {0} \u4E2A GIA \u6587\u4EF6\uFF08{1}\uFF09\uFF1B\u82E5\u6D4F\u89C8\u5668\u62E6\u622A\u591A\u6587\u4EF6\u4E0B\u8F7D\uFF0C\u8BF7\u5141\u8BB8\u540E\u91CD\u8BD5\u3002":"Exported {0} GIA files ({1}). If downloads are blocked, allow multiple downloads and retry.","\u5DF2\u5BFC\u51FA {0}\uFF1B\u8BF7\u67E5\u770B\u4E0A\u65B9\u5BFC\u51FA\u8BF4\u660E\u3002":"Exported {0}. Review the export notes above.","\u5DF2\u5BFC\u51FA {0}":"Exported {0}","\u5DF2\u4ECE\u5DE5\u4F5C\u533A\u62C9\u53D6 {0}":"Loaded {0} from the workspace","\u4EC5\u652F\u6301 .json\u3001.gia \u6216 .lua \u6587\u4EF6":"Only .json, .gia, and .lua files are supported","\u5DF2\u5BFC\u5165 {0}":"Imported {0}","\u5DF2\u4FDD\u5B58\u5230 {0}":"Saved to {0}","\u6B63\u5728\u8F7D\u5165\u5343\u661F\u6C99\u7BB1\u2026":"Loading Miliastra Sandbox\u2026","\u5DF2\u5207\u6362\u5230{0}":"Switched to {0}",\u4FDD\u5B58\u5230\u5DE5\u4F5C\u533A:"Save to Workspace",\u5B58\u6863\u76F8\u5BF9\u8DEF\u5F84:"Save path (relative to workspace)",\u53D6\u6D88:"Cancel",\u4FDD\u5B58:"Save",\u5DE5\u4F5C\u533A\u672A\u7ED1\u5B9A:"No workspace bound",\u5C1A\u672A\u5BFC\u5165\u6587\u4EF6:"No file imported","\u5B58\u6863\uFF1A{0}":"Save: {0}","\u5DE5\u4F5C\u533A\uFF1A{0} \xB7 \u5F53\u524D\u8D44\u4EA7\uFF1A{1}":"Workspace: {0} \xB7 Active asset: {1}",\u672A\u7ED1\u5B9A:"Unbound",UI\u63A7\u4EF6:"UI Controls",\u76EE\u6807\u8BBE\u5907:"Target device",\u5C4F\u5E55\u6BD4\u4F8B:"Aspect ratio",\u753B\u5E03\u7F29\u653E:"Canvas zoom",\u9002\u5E94:"Fit","\u670D\u52A1\u7AEF\u903B\u8F91\uFF1A\u76D1\u542C\u4FE1\u53F7 / \u81EA\u5B9A\u4E49\u53D8\u91CF / \u73A9\u5BB61-8 \u56DE\u4F20":"Server logic: signals / custom variables / Player1\u20138 responses","Lua \u811A\u672C\u8D44\u4EA7\u7F16\u8F91":"Lua script asset editor",\u4FDD\u5B58\u5B8C\u6574\u5B58\u6863\u5230\u5DE5\u4F5C\u533A:"Save the complete project to the workspace",\u4FDD\u5B58\u5B58\u6863:"Save Project",\u4ECE\u5DE5\u4F5C\u533A\u62C9\u53D6\u5B58\u6863:"Load a save from the workspace","\u2913 \u5DE5\u4F5C\u533A\u5B58\u6863":"\u2913 Workspace Saves","\u672A\u53D1\u73B0 qxqy-simulator-save":"No qxqy-simulator-save found",\u5148\u7ED1\u5B9A\u4F1A\u8BDD\u5DE5\u4F5C\u533A:"Bind a session workspace first","\u5BFC\u5165\u5B58\u6863\u3001\u5355\u9879 UI \u8D44\u4EA7\u6216 Lua":"Import a save, individual UI asset, or Lua script","\u21E7 \u5BFC\u5165":"\u21E7 Import",\u5BFC\u51FA\u683C\u5F0F:"Export format","\u21E9 \u5BFC\u51FA":"\u21E9 Export","\u8D44\u4EA7\u5305 JSON\uFF08\u4E09\u7C7B\u5408\u4E00\uFF09":"Complete Save JSON (all three asset types)","\u8D44\u4EA7\u5305 GIA\uFF08\u5DF2\u6539\u52A8\u9879\uFF09":"Asset Bundle GIA (modified assets)","\u8D44\u4EA7\u5305 GIA \u6574\u5408\u5305\uFF08\u63A7\u4EF6+\u811A\u672C\uFF09":"Combined GIA (controls + scripts)","\u5F53\u524D\u754C\u9762\uFF08\u5DE6\u680F\u6B63\u5728\u770B\u7684\u90A3\u68F5\u6811\uFF09":"Current UI (the tree shown on the left)","\u5F53\u524D\u754C\u9762 Authoring JSON":"Current UI Authoring JSON","\u5F53\u524D\u754C\u9762 GIA":"Current UI GIA",\u670D\u52A1\u5668\u63A7\u4EF6\u6A21\u677F:"Server Control Template","\u5BA2\u6237\u7AEF\u63A7\u4EF6\u6A21\u677F\uFF08\u4EC5\u5F53\u5DE6\u680F\u5207\u5230\u300CUI\u63A7\u4EF6-\u5BA2\u6237\u7AEF\u300D\u65F6\u624D\u662F\u9875\u9762\u5185\u5BB9\uFF09":"Client Control Templates (shown in the Client UI tab)","Lua \u811A\u672C":"Lua Scripts","\u811A\u672C\u5305 JSON\uFF08\u5168\u90E8\u811A\u672C\uFF09":"Script Bundle JSON (all scripts)","\u811A\u672C\u5305 GIA\uFF08\u5168\u90E8\u811A\u672C\uFF09":"Script Bundle GIA (all scripts)","\u6253\u5F00\u8BD5\u73A9\uFF1B\u65B0\u7A97\u53E3\u4E0D\u53EF\u7528\u65F6\u5728\u5E94\u7528\u5185\u8BD5\u73A9":"Open a playtest; use an embedded view if new windows are unavailable","\u6B63\u5728\u51C6\u5907\u2026":"Preparing\u2026","\u25B7 \u8BD5\u73A9 \u2197":"\u25B7 Playtest \u2197",\u91CD\u65B0\u8F7D\u5165:"Reload",\u7F16\u8F91\u9875\u9762:"Editor page","UI \u7F16\u8F91":"UI Editor","\u4E00\u4E2A\u5B58\u6863 \xB7 \u670D\u52A1\u5668\u63A7\u4EF6\u6A21\u677F + \u5BA2\u6237\u7AEF\u63A7\u4EF6\u6A21\u677F + Lua \u811A\u672C + \u670D\u52A1\u7AEF\u903B\u8F91":"One save \xB7 Server Control Templates + Client Control Templates + Lua Scripts + Server Logic","\u4E0A\u6B21\u5BFC\u51FA\u8BF4\u660E\uFF08{0} \u9879\uFF0C\u8BF7\u6838\u5BF9\u5BFC\u5165\u540E\u7684\u6548\u679C\uFF09":"Export notes ({0}; verify the result after import)",\u5173\u95ED\u5BFC\u51FA\u8BF4\u660E:"Close export notes",\u7F16\u8F91\u8D44\u6E90\u7C7B\u578B:"Asset type","\u7F16\u8F91\u5B58\u6863\u5185\u7684\u670D\u52A1\u7AEF UI \u63A7\u4EF6":"Edit the save's server UI controls","UI\u63A7\u4EF6-\u670D\u52A1\u7AEF":"Server UI",\u7F16\u8F91\u5B58\u6863\u5185\u7684\u5BA2\u6237\u7AEF\u63A7\u4EF6\u6A21\u677F:"Edit the save's client control templates","UI\u63A7\u4EF6-\u5BA2\u6237\u7AEF":"Client UI",\u6A21\u677F\u4E0E\u5B50\u63A7\u4EF6:"Templates and Children",\u63A7\u4EF6\u6811:"Control Tree","{0} \u4E2A\u6A21\u677F \xB7 {1} \u4E2A\u63A7\u4EF6":"{0} templates \xB7 {1} controls","{0} \u4E2A\u8282\u70B9":"{0} nodes",\u641C\u7D22\u6A21\u677F\u6216\u63A7\u4EF6:"Search templates or controls",\u641C\u7D22\u63A7\u4EF6:"Search controls",\u6A21\u677F:"Template",\u6682\u4E0D\u652F\u6301:"Not supported yet","\u5728\u753B\u5E03\u4E0A\u663E\u793A\uFF08\u4E0D\u5F71\u54CD\u63A7\u4EF6\u521D\u59CB\u53EF\u89C1\u6027\uFF09":"Show on canvas (does not change initial visibility)","\u5728\u753B\u5E03\u4E0A\u9690\u85CF\uFF08\u4E0D\u5F71\u54CD\u63A7\u4EF6\u521D\u59CB\u53EF\u89C1\u6027\uFF09":"Hide on canvas (does not change initial visibility)","{0}\u753B\u5E03\u53EF\u89C1\u6027":"Canvas visibility: {0}",\u6CA1\u6709\u5339\u914D\u7684\u63A7\u4EF6:"No matching controls",\u5C42\u7EA7\u4E0E\u6A21\u677F\u8FB9\u754C:"Hierarchy and Templates",\u7236\u7EA7\u63A7\u4EF6:"Parent control",\u5DF2\u63D0\u5347\u4E3A\u53EF\u5B9E\u4F8B\u5316\u9876\u5C42\u6A21\u677F:"Promoted to an instantiable top-level template",\u5DF2\u8C03\u6574\u63A7\u4EF6\u7236\u7EA7:"Control parent changed","\u9876\u5C42\u6A21\u677F\uFF08\u53EF\u5B9E\u4F8B\u5316\uFF09":"Top-level template (instantiable)",\u5728\u540C\u7EA7\u4E2D\u4E0A\u79FB:"Move up among siblings",\u5728\u540C\u7EA7\u4E2D\u4E0B\u79FB:"Move down among siblings","\u8BE5\u8282\u70B9\u4F1A\u5199\u5165\u72EC\u7ACB UIControlTemplate\uFF0C\u53EF\u76F4\u63A5\u4F5C\u4E3A prefabId\u3002":"This node exports as a separate UIControlTemplate and can be used directly as prefabId.","\u5F53\u524D\u4E3A\u7B2C {0} \u5C42\u5B50\u63A7\u4EF6\uFF0C\u4E0D\u4F1A\u5355\u72EC\u6210\u4E3A prefabId\u3002":"This is a depth-{0} child control, not a standalone template for prefabId instantiation.",\u65B0\u589E\u72EC\u7ACB\u53EF\u5B9E\u4F8B\u5316\u6A21\u677F:"Create a separate instantiable template","\u6DFB\u52A0\u5230{0}":"Add to {0}",\u5F53\u524D\u63A7\u4EF6:"Current control",\u65B0\u589E\u9876\u5C42\u6A21\u677F:"Create a top-level template",\u9876\u5C42:"Top Level",\u5B50\u63A7\u4EF6:"Child",\u65B0\u589E:"New",\u6DFB\u52A0:"Add","Lua \u6A21\u677F\u9884\u89C8":"Lua Template Preview",\u754C\u9762\u63A7\u4EF6\u7EC4:"UI Control Group","{0} \xB7 {1}\xD7{2} \xB7 \u5DE6\u4E0B\u539F\u70B9":"{0} \xB7 {1}\xD7{2} \xB7 Bottom-left origin","\u25CF {0}\u7F16\u8F91":"\u25CF Editing {0}",\u63A7\u4EF6:"Control","\u5F53\u524D\uFF1A{0}":"Selected: {0}","GIA \u5BFC\u51FA\u540E\u53EF\u5728 Lua \u4E2D\u6309 prefabId \u5B9E\u4F8B\u5316":"After exporting GIA, instantiate in Lua using prefabId","\u5B57\u6BB5\u5728\u5931\u7126\u6216 Enter \u65F6\u63D0\u4EA4":"Commit fields on blur or Enter","\u4F5C\u8005 B\u7AD9\u4E3B\u9875":"Author's Bilibili profile",\u4F5C\u8005B\u7AD9:"Bilibili",\u53EF\u5B9E\u4F8B\u5316:"Instantiable","\u6A21\u677F\u7D22\u5F15 ":"Template index ","\u63A7\u4EF6 GUID ":"Control GUID ",\u8282\u70B9:"Node",\u57FA\u7840\u5C5E\u6027:"Properties",\u811A\u672C:"Script","\u6B63\u5728\u5237\u65B0\u7D20\u6750\u2026":"Refreshing asset\u2026","\u21BB \u91CD\u65B0\u4E0B\u8F7D\u6B64\u7D20\u6750":"\u21BB Download This Asset Again","\u767D\u540D\u5355\u56FE\u7247\u6309\u9700\u7F13\u5B58\uFF1B\u5237\u65B0\u4F1A\u91CD\u65B0\u8BBF\u95EE\u7D20\u6750\u6E90\u3002":"Supported images are cached on demand. Refreshing downloads them from the asset source.","\u232B \u5220\u9664\u5F53\u524D\u6A21\u677F":"\u232B Delete Template","\u232B \u5220\u9664\u5F53\u524D\u63A7\u4EF6":"\u232B Delete Control",\u8BF7\u9009\u62E9\u4E00\u4E2A\u63A7\u4EF6:"Select a control",'<!doctype html><meta charset="utf-8"><title>\u6B63\u5728\u51C6\u5907\u8BD5\u73A9\u2026</title><p>\u6B63\u5728\u4FDD\u5B58\u9879\u76EE\u5E76\u51C6\u5907\u8BD5\u73A9\u2026</p>':'<!doctype html><meta charset="utf-8"><title>Preparing playtest\u2026</title><p>Saving the project and preparing the playtest\u2026</p>',"\u505C\u6B62\u8BD5\u73A9\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5\uFF1A{0}":"Could not stop the playtest. Retry: {0}","\u8BD5\u73A9\u9875\u672A\u80FD\u52A0\u8F7D\uFF0C\u8BF7\u8FD4\u56DE\u7F16\u8F91\u540E\u91CD\u8BD5\u3002":"The playtest page could not load. Return to the editor and retry.",\u8BD5\u73A9\u6B63\u5728\u5173\u95ED:"Closing playtest",\u5185\u5D4C\u8BD5\u73A9:"Embedded Playtest","\u6B63\u5728\u505C\u6B62\u8BD5\u73A9\u2026":"Stopping playtest\u2026","\u6B63\u5728\u8F7D\u5165\u8BD5\u73A9\u2026":"Loading playtest\u2026",\u5173\u95ED\u8BD5\u73A9:"Close Playtest",\u5343\u661F\u6C99\u7BB1\u8BD5\u73A9:"Miliastra Sandbox Playtest",\u672A\u53D8\u5316:"Unchanged","\u3010\u5343\u661F\u6C99\u7BB1\u811A\u672C\u6587\u4EF6\u5939\u3011":"[Miliastra Sandbox Script Folder]",\u65B0\u589E\u6587\u4EF6:"New file",\u66F4\u65B0\u5DF2\u6709\u6587\u4EF6:"Update existing file","\u5185\u5BB9\u76F8\u540C\uFF0C\u65E0\u9700\u66F4\u65B0":"Identical; no update needed",\u65E0\u6CD5\u590D\u5236:"Cannot copy",\u5B58\u6863\u91CC\u7F16\u8F91\u7684\u4EE3\u7801:"Code edited in the save","\u9879\u76EE\u4E2D\u7684 .lua \u6587\u4EF6":"Project .lua file","\u5B9E\u673A\u811A\u672C\u540C\u6B65 \xB7 {0}":"Sync Scripts to Game \xB7 {0}",\u5DF2\u8BBE\u7F6E\u6587\u4EF6\u5939:"Folders configured",\u5148\u8BBE\u7F6E\u6587\u4EF6\u5939:"Configure folders first","\u628A\u5F53\u524D\u5B58\u6863\u91CC\u7684 Lua \u811A\u672C\u590D\u5236\u5230\u5343\u661F\u6C99\u7BB1\uFF0C\u7528\u4E8E\u6E38\u620F\u5185\u6D4B\u8BD5\u3002\u64CD\u4F5C\u987A\u5E8F\uFF1A\u586B\u5199\u811A\u672C\u4F4D\u7F6E \u2192 \u4FDD\u5B58\u8BBE\u7F6E \u2192 \u4FDD\u5B58\u5B58\u6863\u5E76\u67E5\u770B\u66F4\u65B0 \u2192 \u786E\u8BA4\u590D\u5236\u3002":"Copy this save's Lua scripts into Miliastra Sandbox for in-game testing. Set folders \u2192 Save Settings \u2192 Save and Preview Changes \u2192 Confirm Copy.",\u9879\u76EE\u811A\u672C\u6587\u4EF6\u5939:"Project script folder","\u4F8B\u5982 workspace/my-game\uFF1B\u4E5F\u53EF\u4EE5\u7559\u7A7A":"e.g. workspace/my-game; may be left blank","\u586B\u5199\u5728\u5DE5\u4F5C\u533A\u91CC\u7684\u4F4D\u7F6E\uFF0C\u4F8B\u5982 workspace/my-game\uFF1B\u7559\u7A7A\u8868\u793A\u4F7F\u7528\u5DE5\u4F5C\u533A\u672C\u8EAB\u3002":"Enter a workspace-relative folder, e.g. workspace/my-game. Leave blank to use the workspace root.",\u5343\u661F\u6C99\u7BB1\u811A\u672C\u6587\u4EF6\u5939:"Miliastra Sandbox script folder","\u7C98\u8D34\u4EE5 default_import_file \u7ED3\u5C3E\u7684\u5B8C\u6574\u8DEF\u5F84":"Paste the full path ending in default_import_file","\u5173\u5361\u5B58\u653E\u5916\u90E8 Lua \u811A\u672C\u7684\u6587\u4EF6\u5939\uFF0C\u53EF\u70B9\u51FB\u300C\u53D1\u73B0\u672C\u673A\u76EE\u5F55\u300D\u67E5\u627E\u3002\u8BF7\u586B\u5199\u8FD0\u884C\u6A21\u62DF\u5668\u90A3\u53F0\u7535\u8111\u4E0A\u7684\u5B8C\u6574\u8DEF\u5F84\u3002":"The stage's folder for external Lua scripts. Use \u201CFind Local Folders\u201D to locate it. Enter the full path on the simulator host machine.",\u6E38\u620F\u91CC\u7684\u9879\u76EE\u5B50\u6587\u4EF6\u5939:"Project subfolder in the game","\u4E00\u822C\u548C\u201C\u9879\u76EE\u811A\u672C\u6587\u4EF6\u5939\u201D\u586B\u4E00\u6837\u7684\u5185\u5BB9\uFF0C\u4FDD\u7559\u539F\u6765\u7684\u6587\u4EF6\u4F4D\u7F6E\u3002\u7559\u7A7A\u5219\u76F4\u63A5\u653E\u8FDB\u5343\u661F\u6C99\u7BB1\u811A\u672C\u6587\u4EF6\u5939\u3002":"Usually matches the project script folder to preserve file locations. Leave blank to place files directly in the Miliastra Sandbox script folder.",\u590D\u5236\u8DEF\u5F84\u793A\u4F8B:"Copy Path Example","\u590D\u5236\u793A\u4F8B\uFF1A":"Example destination:","\u6E38\u620F\u8D26\u53F7 UID\uFF1A{0} \xB7 \u5173\u5361\u76EE\u5F55\u7F16\u53F7\uFF1A{1}":"Game account UID: {0} \xB7 Stage folder ID: {1}",\u53D1\u73B0\u672C\u673A\u76EE\u5F55:"Find Local Folders","\u6CA1\u6709\u627E\u5230\u6E38\u620F\u811A\u672C\u6587\u4EF6\u5939\u3002\u53EF\u4EE5\u624B\u52A8\u7C98\u8D34 default_import_file \u6587\u4EF6\u5939\u7684\u5B8C\u6574\u8DEF\u5F84\uFF1B\u5982\u679C\u8FD8\u6CA1\u5BFC\u5165\u811A\u672C\uFF0C\u8BF7\u5148\u5728\u5343\u661F\u6C99\u7BB1\u5B8C\u6210\u5BFC\u5165\u3002":"No game script folder found. Paste the full default_import_file path manually. If you have not imported scripts yet, do so in Miliastra Sandbox first.","\u627E\u5230 {0} \u4E2A\u6E38\u620F\u811A\u672C\u6587\u4EF6\u5939\uFF0C\u8BF7\u9009\u62E9\u8981\u66F4\u65B0\u7684\u8D26\u53F7\u548C\u5173\u5361\u3002":"Found {0} game script folders. Select the account and stage to update.","\u811A\u672C\u4F4D\u7F6E\u5DF2\u4FDD\u5B58\u3002\u4E0B\u4E00\u6B65\u70B9\u51FB\u300C\u4FDD\u5B58\u5B58\u6863\u5E76\u67E5\u770B\u66F4\u65B0\u300D\u3002":"Script folders saved. Next, click \u201CSave and Preview Changes\u201D.",\u6E05\u9664\u8BBE\u7F6E:"Clear Settings","\u5DF2\u6E05\u9664\u811A\u672C\u4F4D\u7F6E\u8BBE\u7F6E\u3002\u6E38\u620F\u91CC\u7684\u811A\u672C\u6587\u4EF6\u4ECD\u7136\u4FDD\u7559\u3002":"Script folder settings cleared. Existing files in the game are kept.",\u9009\u62E9\u8981\u66F4\u65B0\u7684\u8D26\u53F7\u548C\u5173\u5361:"Select the Account and Stage","\u8BF7\u9009\u62E9\u6E38\u620F\u8D26\u53F7\u548C\u5173\u5361\u6587\u4EF6\u5939\u2026":"Select a game account and stage folder\u2026","\u8D26\u53F7 {0} / \u5173\u5361\u76EE\u5F55 {1} \xB7 {2}":"Account {0} / Stage folder {1} \xB7 {2}",\u6A21\u62DF\u5668\u5B58\u6863\u6587\u4EF6:"Simulator save file","\u4F8B\u5982 my-game.save.json":"e.g. my-game.save.json","\u586B\u5199\u5DE5\u4F5C\u533A\u91CC\u7684\u5B58\u6863\u6587\u4EF6\u540D\u6216\u8DEF\u5F84\u3002\u4FDD\u5B58\u8BBE\u7F6E\u65F6\u4F1A\u4E00\u8D77\u4FDD\u5B58\u9879\u76EE\uFF0C\u4E0B\u6B21\u6253\u5F00\u5B58\u6863\u5373\u53EF\u590D\u7528\u3002":"Enter a save filename or path within the workspace. Saving these settings also saves the project so they are available next time.",\u4FDD\u5B58\u5B58\u6863\u5E76\u67E5\u770B\u66F4\u65B0:"Save and Preview Changes","\u8BF7\u5148\u586B\u5199\u5343\u661F\u6C99\u7BB1\u811A\u672C\u6587\u4EF6\u5939\uFF0C\u5E76\u70B9\u51FB\u300C\u4FDD\u5B58\u8BBE\u7F6E\u300D\u3002":"Enter the Miliastra Sandbox script folder and click \u201CSave Settings\u201D first.","\u811A\u672C\u4F4D\u7F6E\u5DF2\u6539\u52A8\uFF0C\u8BF7\u5148\u70B9\u51FB\u300C\u4FDD\u5B58\u8BBE\u7F6E\u300D\u3002":"Script folders changed. Click \u201CSave Settings\u201D first.","\u8BF7\u5148\u586B\u5199\u6A21\u62DF\u5668\u5B58\u6863\u6587\u4EF6\u540D\u3002":"Enter a simulator save filename first.","\u6B63\u5728\u5904\u7406\uFF0C\u8BF7\u7A0D\u5019\u2026":"Working, please wait\u2026",\u811A\u672C\u540C\u6B65\u786E\u8BA4:"Confirm Script Copy","\u672C\u6B21\u66F4\u65B0\u5230\uFF1A{0}":"Destination: {0}","\u8FD9\u4E2A\u5B58\u6863\u8FD8\u6CA1\u6709 Lua \u811A\u672C\u3002\u8BF7\u5148\u5728\u4E0B\u65B9\u6DFB\u52A0\u811A\u672C\uFF0C\u518D\u67E5\u770B\u66F4\u65B0\u3002":"This save has no Lua scripts. Add a script below, then preview the changes.","\u6240\u6709\u811A\u672C\u90FD\u4E0E\u6E38\u620F\u6587\u4EF6\u5939\u91CC\u7684\u5185\u5BB9\u76F8\u540C\uFF0C\u65E0\u9700\u590D\u5236\u3002":"All scripts match the game folder. Nothing to copy.","\u6709\u63A7\u4EF6\u7D22\u5F15\u5C1A\u672A\u540C\u6B65\u5230 Lua\u3002\u8BF7\u5148\u5728\u4E0A\u65B9\u300C\u5168\u91CF\u66FF\u6362\u811A\u672C\u7D22\u5F15\u300D\uFF0C\u6216\u300C\u590D\u5236\u63D0\u793A\u8BCD\u7ED9 AI\u300D\uFF1B\u5904\u7406\u5B8C\u6210\u540E\u518D\u67E5\u770B\u6E38\u620F\u811A\u672C\u66F4\u65B0\u3002":"Some control index changes are not reflected in Lua. Use \u201CReplace All Script Indices\u201D or \u201CCopy Task for AI\u201D above before previewing game script changes.","\u590D\u5236\u7684\u4EE3\u7801\u6765\u81EA\uFF1A{0}":"Code source: {0}","\u65E0\u6CD5\u590D\u5236\uFF1A{0}":"Cannot copy: {0}","\u590D\u5236\u5230\uFF1A{0}":"Copy to: {0}","\u8FD9\u4E2A\u811A\u672C\u5728\u5B58\u6863\u91CC\u548C\u9879\u76EE\u6587\u4EF6\u91CC\u7684\u4EE3\u7801\u4E0D\u540C\u3002\u672C\u6B21\u4F1A\u590D\u5236\u5B58\u6863\u91CC\u7684\u4EE3\u7801\uFF1B\u5982\u679C\u8981\u4F7F\u7528\u9879\u76EE\u6587\u4EF6\uFF0C\u8BF7\u70B9\u51FB\u300C\u6539\u7528\u9879\u76EE\u6587\u4EF6\u91CC\u7684\u4EE3\u7801\u300D\uFF0C\u7136\u540E\u91CD\u65B0\u67E5\u770B\u66F4\u65B0\u3002":"The saved script differs from its project file. This copy uses the saved code. To use the project file instead, choose \u201CUse Project File Code\u201D, then preview changes again.",\u67E5\u770B\u9879\u76EE\u6587\u4EF6\u91CC\u7684\u4EE3\u7801:"View Project File Code",\u6539\u7528\u9879\u76EE\u6587\u4EF6\u91CC\u7684\u4EE3\u7801:"Use Project File Code",\u5BF9\u6BD4\u66F4\u65B0\u524D\u540E\u7684\u4EE3\u7801:"Compare Changes",\u6E38\u620F\u91CC\u73B0\u5728\u7684\u4EE3\u7801:"Current Code in the Game","\uFF08\u6E38\u620F\u91CC\u8FD8\u6CA1\u6709\u8FD9\u4E2A\u6587\u4EF6\uFF09":"(This file does not exist in the game yet)",\u672C\u6B21\u8981\u590D\u5236\u7684\u4EE3\u7801:"Code to Copy","\u65B0\u589E\u811A\u672C\u590D\u5236\u540E\uFF0C\u8FD8\u9700\u8981\u5728\u5343\u661F\u6C99\u7BB1\u91CC\u5173\u8054\u5BF9\u5E94\u7684\u811A\u672C\u6587\u4EF6\uFF1B\u9700\u8981\u76F4\u63A5\u8FD0\u884C\u7684\u811A\u672C\u8FD8\u8981\u6302\u5230\u63A7\u4EF6\u4E0A\u3002":"After copying new scripts, link their files in Miliastra Sandbox. Scripts that should run directly must also be attached to controls.","\u5DF2\u9009 {0} \u4E2A\u811A\u672C\uFF0C\u5176\u4E2D {1} \u4E2A\u4F1A\u66FF\u6362\u6E38\u620F\u91CC\u7684\u65E7\u6587\u4EF6\u3002\u66FF\u6362\u524D\u4F1A\u81EA\u52A8\u5907\u4EFD\u65E7\u6587\u4EF6\uFF0C\u6E38\u620F\u91CC\u7684\u5176\u4ED6\u6587\u4EF6\u4F1A\u4FDD\u7559\u3002":"Selected {0} scripts; {1} will replace existing game files. Replaced files are backed up. Other files are kept.",\u8986\u76D6:"Replace",\u6682\u4E0D\u590D\u5236:"Cancel","\u786E\u8BA4\u590D\u5236 {0} \u4E2A\u811A\u672C":"Confirm Copy of {0} Scripts",\u811A\u672C\u5DF2\u590D\u5236\u5230\u5343\u661F\u6C99\u7BB1:"Scripts Copied to Miliastra Sandbox",\u6709\u4E9B\u811A\u672C\u672A\u590D\u5236\u6210\u529F:"Some Scripts Could Not Be Copied","\u4E0B\u4E00\u6B65\uFF1A\u56DE\u5230\u5343\u661F\u6C99\u7BB1\uFF0C\u4FDD\u5B58\u5173\u5361\u5E76\u91CD\u65B0\u8BD5\u73A9\uFF0C\u8BA9\u6E38\u620F\u52A0\u8F7D\u66F4\u65B0\u540E\u7684\u811A\u672C\u3002":"Next: Return to Miliastra Sandbox, save the stage, and start a new playtest to load the updated scripts.","\u8BF7\u6309\u4E0B\u65B9\u63D0\u793A\u5904\u7406\u5931\u8D25\u7684\u6587\u4EF6\uFF0C\u518D\u91CD\u65B0\u67E5\u770B\u66F4\u65B0\u5E76\u590D\u5236\u3002":"Resolve the failed files using the notes below, then preview and copy again.","\u590D\u5236\u65F6\u95F4\uFF1A{0} \xB7 \u65E7\u6587\u4EF6\u5907\u4EFD\u4FDD\u5B58\u5728\uFF1A{1}":"Copied at: {0} \xB7 Backups: {1}",\u6210\u529F:"Success",\u5DF2\u590D\u5236:"Copied",\u672A\u590D\u5236:"Not copied",\u5207\u6362\u5230\u4EAE\u8272\u4E3B\u9898:"Switch to light theme",\u5207\u6362\u5230\u6697\u8272\u4E3B\u9898:"Switch to dark theme",\u5F53\u524D\u5B58\u6863:"Current save","\u5F53\u524D\u8D44\u4EA7\u6CA1\u6709\u63A7\u4EF6\u3002":"This asset has no controls.","\u6253\u5F00\u5B58\u6863\u540E\u663E\u793A\u63A7\u4EF6\u7ED3\u6784\u3002":"Open a save to view its control structure.",\u672A\u9009\u62E9:"None selected",\u7C7B\u578B:"Type",\u6811\u6DF1\u5EA6:"Tree depth",\u7236\u8282\u70B9:"Parent node","\u8BD5\u73A9\u542F\u52A8\u540E\u663E\u793A Lua \u65E5\u5FD7\u3002":"Lua logs appear after starting a playtest.",\u5B58\u6863\u52A0\u8F7D\u5931\u8D25:"Failed to Load Save",\u7B49\u5F85\u5DE5\u4F5C\u533A\u5B58\u6863:"Waiting for a Workspace Save","\u6B63\u5728\u76D1\u542C {0}\u3002":"Watching {0}.","{0}Codex \u4FDD\u5B58 qxqy-simulator-save JSON \u540E\u4F1A\u81EA\u52A8\u51FA\u73B0\u5728\u8FD9\u91CC\u3002":"{0}Saves appear here automatically when Codex writes a qxqy-simulator-save JSON file.",\u8BD5\u73A9\u5C1A\u672A\u542F\u52A8:"Playtest Not Started","\u9009\u62E9\u8BBE\u5907\u5E76\u70B9\u51FB\u201C\u542F\u52A8\u201D\uFF0C\u5373\u53EF\u8FD0\u884C Lua \u548C\u4EA4\u4E92\u903B\u8F91\u3002":"Select a device and click \u201CStart\u201D to run Lua scripts and interactions.",\u7B49\u5F85\u5B58\u6863:"Waiting for a Save",\u5C1A\u672A\u6253\u5F00\u5B58\u6863:"No save open"," \xB7 \u5DF2\u6682\u505C":" \xB7 Paused","\u7B49\u5F85\u542F\u52A8 Runtime":"Waiting to start Runtime","\u7F16\u8F91\u5668\u9759\u6001\u9884\u89C8 \xB7 \u78C1\u76D8\u81EA\u52A8\u5237\u65B0":"Static editor preview \xB7 Refreshes from disk automatically","\u7F16\u8F91\u5668\u753B\u9762\u52A0\u8F7D\u5931\u8D25\u3002":"Failed to load the editor preview.","\u670D\u52A1\u7248\u672C\u672A\u77E5\uFF0C\u8BF7\u66F4\u65B0 Web":"Unknown server version. Update the Web package.",\u5B9E\u65F6\u76D1\u542C\u4E2D:"Live",\u8FDE\u63A5\u4E2D\u65AD:"Disconnected",\u5F00\u542F\u58F0\u97F3:"Enable Sound",\u58F0\u97F3\u5DF2\u5173\u95ED:"Sound Off",\u58F0\u97F3\u5DF2\u5F00\u542F:"Sound On",\u70B9\u51FB\u6216\u5728\u753B\u5E03\u5185\u64CD\u4F5C\u4EE5\u89E3\u9501\u97F3\u6548:"Click or interact with the canvas to enable audio",\u5207\u6362\u9759\u97F3:"Toggle mute","\u952E\u4F4D\u54CD\u5E94\uFF1A\u5F00":"Key Input: On","\u952E\u4F4D\u54CD\u5E94\uFF1A\u5173":"Key Input: Off",\u5DF2\u6253\u5F00\u5B58\u6863:"Save opened",\u5DF2\u91CD\u65B0\u8BFB\u53D6\u78C1\u76D8\u5B58\u6863:"Save reloaded from disk","\u65E5\u5FD7\u5DF2\u5728\u5F53\u524D\u89C6\u56FE\u6E05\u7A7A\u3002":"Logs cleared in this view.",\u6B63\u5728\u91CD\u8FDE:"Reconnecting","\u68C0\u6D4B\u5230\u5B58\u6863\u53D8\u5316\uFF0C\u9884\u89C8\u5DF2\u66F4\u65B0":"Save changed; preview updated",\u9884\u89C8\u5B58\u6863\u5DF2\u6253\u5F00:"Preview save opened","\u624B\u673A 1280\xD7720":"Mobile 1280\xD7720","\u624B\u673A 1560\xD7720":"Mobile 1560\xD7720","\u624B\u673A 1280\xD7960":"Mobile 1280\xD7960",\u540D\u79F0:"Name",\u521D\u59CB\u6FC0\u6D3B:"Initially Active",\u521D\u59CB\u53EF\u89C1\u6027:"Initially Visible",\u53EF\u88AB\u624B\u67C4\u6447\u6746\u5BFC\u822A\u9009\u4E2D:"Selectable by Controller Navigation","\u4F4D\u7F6E X":"Location X","\u4F4D\u7F6E Y":"Location Y","\u5927\u5C0F W":"Width","\u5927\u5C0F H":"Height","\u65CB\u8F6C X":"Rotation X","\u65CB\u8F6C Y":"Rotation Y","\u65CB\u8F6C Z":"Rotation Z",\u540C\u6B65\u4FE1\u606F\u81F3\u6240\u6709\u8BBE\u5907:"Sync Layout Across Devices",\u951A\u70B9\u7C7B\u578B:"Anchor Preset",\u5C45\u4E2D:"Center",\u5DE6\u4E0A:"Top Left",\u4E0A\u65B9:"Top",\u53F3\u4E0A:"Top Right",\u5DE6\u4FA7:"Left",\u53F3\u4FA7:"Right",\u5DE6\u4E0B:"Bottom Left",\u4E0B\u65B9:"Bottom",\u53F3\u4E0B:"Bottom Right",\u53CC\u5411\u62C9\u4F38:"Stretch Both Axes",\u6C34\u5E73\u62C9\u4F38:"Stretch Horizontally",\u5782\u76F4\u62C9\u4F38:"Stretch Vertically",\u81EA\u5B9A\u4E49:"Custom","\u951A\u70B9 Min X":"Anchor Min X","\u951A\u70B9 Min Y":"Anchor Min Y","\u951A\u70B9 Max X":"Anchor Max X","\u951A\u70B9 Max Y":"Anchor Max Y","\u4E2D\u5FC3 X":"Pivot X","\u4E2D\u5FC3 Y":"Pivot Y",\u9694\u79BB\u624B\u67C4\u5BFC\u822A:"Isolate Controller Navigation",\u5C4F\u853D\u6309\u952E\u4E8B\u4EF6\u7A7F\u900F:"Block Key Event Passthrough",\u5C4F\u853D\u533A\u57DF\u5185\u70B9\u51FB\u4E8B\u4EF6\u7A7F\u900F:"Block Click Event Passthrough in Area",\u663E\u793A\u5E38\u9A7B\u5149\u6807:"Show Persistent Cursor",\u5B57\u53F7:"Font Size",\u5B57\u53F7\u81EA\u9002\u5E94:"Auto Font Size",\u6700\u5C0F\u5B57\u53F7:"Minimum Font Size",\u6587\u672C\u8272:"Text Color",\u80CC\u666F\u8272:"Background Color",\u542F\u7528\u63CF\u8FB9:"Enable Outline",\u63CF\u8FB9\u8272:"Outline Color",\u6C34\u5E73\u5BF9\u9F50:"Horizontal Alignment",\u5DE6\u5BF9\u9F50:"Left",\u53F3\u5BF9\u9F50:"Right",\u5782\u76F4\u5BF9\u9F50:"Vertical Alignment",\u9876\u90E8:"Top",\u5E95\u90E8:"Bottom",\u6587\u672C:"Text",\u56FE\u7247\u6E90:"Image Source",\u9759\u6001\u5F15\u7528:"Static Reference",\u5143\u4EF6:"Prefab",\u586B\u5145\u8272:"Fill Color",\u5F00\u542F\u906E\u7F69:"Enable Mask",\u8FB9\u7F18\u7FBD\u5316:"Soft Edge",\u7FBD\u5316\u6A21\u5F0F:"Soft Edge Mode",\u767E\u5206\u6BD4:"Percentage",\u50CF\u7D20:"Pixels","\u7FBD\u5316\u5BBD\u5EA6 X":"Soft Edge Width X","\u7FBD\u5316\u5BBD\u5EA6 Y":"Soft Edge Width Y",\u6C34\u5E73\u7FBD\u5316\u8303\u56F4:"Horizontal Soft Edge Range",\u5782\u76F4\u7FBD\u5316\u8303\u56F4:"Vertical Soft Edge Range",\u6309\u8FDB\u5EA6\u586B\u5145:"Fill by Progress",\u5F62\u72B6:"Shape",\u6A2A\u5411:"Horizontal",\u7EB5\u5411:"Vertical","90\u5EA6\u73AF\u7ED5":"Radial90","180\u5EA6\u73AF\u7ED5":"Radial180","360\u5EA6\u73AF\u7ED5":"Radial360",\u65B9\u5411:"Direction",\u4ECE\u5DE6\u81F3\u53F3:"From Left to Right",\u4ECE\u53F3\u81F3\u5DE6:"From Right to Left",\u4ECE\u4E0B\u81F3\u4E0A:"From Bottom to Top",\u4ECE\u4E0A\u81F3\u4E0B:"From Top to Bottom",\u8D77\u70B9:"Origin",\u8FDB\u5EA6:"Progress",\u906E\u7F69\u533A\u57DF\u53CD\u8F6C:"Invert Mask Area",\u672A\u8BBE\u7F6E:"Not set",\u53EF\u88AB\u5149\u6807\u5C04\u7EBF\u68C0\u6D4B:"Raycast Target",\u6309\u94AE\u662F\u5426\u53EF\u7528:"Interactable",\u4E0D\u53EF\u7528\u72B6\u6001\u8282\u70B9:"Unavailable Status Nodes",\u60AC\u505C\u72B6\u6001\u8282\u70B9:"Hover Status Nodes",\u6309\u4E0B\u72B6\u6001\u8282\u70B9:"Pressed Status Nodes",\u9009\u4E2D\u72B6\u6001\u8282\u70B9:"Selected Status Nodes",\u70B9\u51FB\u97F3\u6548:"Click Sound",\u5F15\u7528\u63A7\u4EF6\u6A21\u677F\u7D22\u5F15:"Referenced Control Template Index",\u5141\u8BB8\u6EDA\u52A8\u4EA4\u4E92:"Enable Scrolling",\u663E\u793A\u6EDA\u52A8\u6761:"Show Scrollbar",\u5217\u8868\u9879\u6A21\u677F\u7D22\u5F15:"Item Template Index",\u6EDA\u52A8\u65B9\u5411:"Scroll Direction",\u6392\u5217\u9650\u5236:"Layout Constraint",\u81EA\u52A8\u6362\u884C:"Automatic Wrapping",\u56FA\u5B9A\u884C\u5217\u6570:"Fixed Row / Column Count",\u6BCF\u884C\u6216\u6BCF\u5217\u6570\u91CF:"Items per Row / Column","\u5217\u8868\u9879\u5927\u5C0F W":"Item Width","\u5217\u8868\u9879\u5927\u5C0F H":"Item Height","\u5217\u8868\u9879\u95F4\u9694 X":"Item Spacing X","\u5217\u8868\u9879\u95F4\u9694 Y":"Item Spacing Y","\u8FB9\u8DDD\u5411\u91CF 1 X":"Padding 1 X","\u8FB9\u8DDD\u5411\u91CF 1 Y":"Padding 1 Y","\u8FB9\u8DDD\u5411\u91CF 2 X":"Padding 2 X","\u8FB9\u8DDD\u5411\u91CF 2 Y":"Padding 2 Y",\u9884\u89C8\u6570\u91CF:"Preview Count",\u952E\u9F20\u6309\u952E:"Keyboard / Mouse Key",\u624B\u67C4\u6309\u952E:"Controller Button",\u52A8\u6548\u7D22\u5F15:"Animation Index",\u5168\u5C4F\u52A8\u6548\u7D22\u5F15:"Fullscreen Animation Index",\u5B8C\u6574\u5EA6:"Support Status","\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":"Basic scrolling is supported in playtests. Configure interaction, scrollbars, and lists through JSON/Lua; the related GIA flags are not yet verified.","\u672C\u9636\u6BB5\u4EC5\u516C\u5171\u53D8\u6362\uFF0C\u4E1A\u52A1\u69FD\u4E0D\u5B8C\u6574":"Only common transforms are supported at this stage; control-specific fields are incomplete.",\u5173\u5361:"Stage",\u5F53\u524D\u73A9\u5BB6:"Current Player",\u5F53\u524D\u89D2\u8272:"Current Character","\u73A9\u5BB6{0}":"Player {0}","\u89D2\u8272{0}":"Character {0}","\u63A7\u4EF6\u7D22\u5F15\u5FC5\u987B\u662F 1\u20132147483647 \u8303\u56F4\u5185\u7684\u6574\u6570":"Control indices must be integers from 1 to 2147483647","controlGuidChanges \u5FC5\u987B\u662F\u6570\u7EC4":"controlGuidChanges must be an array","controlGuidChanges \u5305\u542B\u65E0\u6548\u6216\u91CD\u590D\u7684\u53D8\u66F4\u8BB0\u5F55":"controlGuidChanges contains invalid or duplicate changes","controlGuidChanges \u5305\u542B\u65E0\u6548\u7684 batchId":"controlGuidChanges contains an invalid batchId","controlGuidChanges \u5305\u542B\u65E0\u6548\u7684 scriptSignature":"controlGuidChanges contains an invalid scriptSignature",\u672A\u547D\u540D\u754C\u9762:"Untitled UI",\u672A\u547D\u540D\u754C\u9762\u63A7\u4EF6\u7EC4:"Untitled UI Control Group",\u6574\u5408\u5305\u9700\u8981\u670D\u52A1\u7AEF\u5BA2\u6237\u7AEF\u63A7\u4EF6\u5BB9\u5668\u4E0B\u81F3\u5C11\u6709\u4E00\u4E2A\u6839\u63A7\u4EF6:"A combined bundle requires at least one root control inside the server-side Client Control Container","{0} \xB7 \u6574\u5408\u5305.gia":"{0} \xB7 Combined.gia",\u6302\u8F7D\u76EE\u6807\u5FC5\u987B\u662F\u5B58\u6863\u5185\u7684\u5BA2\u6237\u7AEF\u63A7\u4EF6\u6216\u5BA2\u6237\u7AEF\u63A7\u4EF6\u6A21\u677F:"Attachment targets must be client controls or client control templates in the save","\u811A\u672C\u4E0D\u5B58\u5728: {0}":"Script not found: {0}",\u4EC5\u5BA2\u6237\u7AEF\u63A7\u4EF6\u6216\u5BA2\u6237\u7AEF\u63A7\u4EF6\u6A21\u677F\u5141\u8BB8\u4FEE\u6539\u7D22\u5F15:"Only client controls and client control templates support index changes","autoFillClientGuids \u5FC5\u987B\u662F\u5E03\u5C14\u503C":"autoFillClientGuids must be a boolean","\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":"Autofill is only available for client templates. Enter server UI indices separately.","\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":"Client templates contain duplicate old indices. Resolve the ambiguity before using autofill.","\u63A7\u4EF6\u7D22\u5F15 {0} \u5DF2\u88AB\u300C{1}\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":"Control index {0} is already used by \u201C{1}\u201D. Enter its actual index first. No indices were changed.","\u65E7\u7D22\u5F15 {0} \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":"Old index {0} appears in multiple asset trees, so the template reference is ambiguous. Resolve it before making changes.","\u8BF7\u660E\u786E\u6307\u5B9A\u5DF2\u6838\u5BF9 Lua \u5F15\u7528\u7684\u6709\u6548\u7D22\u5F15\u53D8\u66F4\u8BB0\u5F55 changeIds":"Specify valid changeIds whose Lua references have been reviewed",\u5B58\u6863\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A:"The save name cannot be empty","\u63A7\u4EF6\u7D22\u5F15\u5F85\u6838\u5BF9 Lua \u5F15\u7528\uFF1A{0} / {1} ({2})\uFF1A{3} \u2192 {4}\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 {5}\uFF1B\u4E0D\u8981\u5168\u5C40\u66FF\u6362\u540C\u503C\u6570\u5B57\u3002":"Review Lua references for control index change: {0} / {1} ({2}): {3} \u2192 {4}. Update references by meaning, then acknowledge change {5}. Do not globally replace equal numbers.","{0} \xB7 \u8D44\u4EA7\u5305.json":"{0} \xB7 Assets.json","\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":"The unchanged, hidden default server UI was omitted from the asset bundle GIA.","\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":"The unchanged, hidden default client control template was omitted from the asset bundle GIA.","\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":"There are no modified assets to export. Edit the UI first, or use \u201CCurrent UI GIA\u201D.","{0} \xB7 \u811A\u672C.json":"{0} \xB7 Scripts.json","{0} \xB7 \u811A\u672C.gia":"{0} \xB7 Scripts.gia","\u6CA1\u6709\u53EF\u5BFC\u51FA\u7684 Lua \u811A\u672C\uFF0C\u8BF7\u5148\u5728\u201CLua \u811A\u672C\u201D\u9875\u521B\u5EFA":"No Lua scripts to export. Create one on the Lua Scripts page first.","\u5F53\u524D\u670D\u52A1\u5668\u63A7\u4EF6 GIA \u4E0D\u5305\u542B {0} \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":"This server UI GIA does not contain source for {0} Lua scripts. Use \u201CCombined GIA\u201D or import the script bundle separately and check attachments.","JSON \u6587\u4EF6\u65E0\u6548":"Invalid JSON file","\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":"Combined bundle split back into Server UI and Client UI. Client template boundaries were preserved.","\u811A\u672C GUID {0} \u540C\u65F6\u6302\u8F7D\u5230\u591A\u4E2A\u63A7\u4EF6\uFF0C\u5DF2\u4FDD\u7559\u201C{1}\u201D\u76EE\u6807\u3002":"Script GUID {0} was attached to multiple controls. The \u201C{1}\u201D target was kept.",\u670D\u52A1\u7AEF:"Server",\u5BA2\u6237\u7AEF:"Client","\u5355\u8D44\u4EA7 JSON \u7684\u7D22\u5F15\u53D8\u66F4\u8BB0\u5F55\u5FC5\u987B\u5C5E\u4E8E\u5F53\u524D\u5BFC\u5165\u8D44\u4EA7":"Index change records in a single-asset JSON must belong to the imported asset","\u811A\u672C {0} \u8BFB\u53D6\u5931\u8D25: {1}":"Failed to read script {0}: {1}","\u5343\u661F\u6C99\u7BB1 \xB7 \u72EC\u7ACB\u8BD5\u73A9":"Miliastra Sandbox \xB7 Standalone Playtest",\u6A21\u62DF\u5668:"Simulator",\u5207\u6362\u8BBE\u5907\u753B\u5E03:"Switch Device Canvas","\u5207\u6362\u8BBE\u5907\u753B\u5E03\uFF1A\u4EE5\u65B0\u753B\u5E03\u91CD\u5EFA\u8FD0\u884C\u65F6\uFF0CGetUICanvasSize \u4E0E\u9884\u8BBE\u50CF\u7D20\u4E00\u81F4":"Rebuild the runtime for the selected canvas. GetUICanvasSize matches the preset's pixel dimensions.",\u8BD5\u73A9\u4EBA\u6570:"Player count","\u8BD5\u73A9\u4EBA\u6570\uFF1A\u6700\u591A 8 \u4EBA\uFF0C\u6BCF\u4EBA\u4E00\u4EFD\u72EC\u7ACB\u5BA2\u6237\u7AEF":"Up to 8 players, each with a separate client instance",\u5F53\u524D\u73A9\u5BB6\u89C6\u89D2:"Current player view","\u5207\u6362\u5F53\u524D\u73A9\u5BB6\u89C6\u89D2\uFF1A\u8F93\u5165\u3001\u753B\u9762\u548C PlayerSelf \u90FD\u8DDF\u968F\u8BE5\u73A9\u5BB6":"Change the active player for input, rendering, and PlayerSelf",\u8BBE\u5907:"Device","\u51C6\u5907\u4E2D\u2026":"Preparing...",\u8BD5\u73A9\u9875\u9762:"Playtest page",\u8BD5\u73A9:"Playtest",\u65E5\u5FD7:"Logs","\u8F6C\u53D1\u5B98\u65B9\u952E\u4F4D\u7684\u6309\u4E0B/\u62AC\u8D77\u4E8B\u4EF6\uFF08\u542B\u9F20\u6807\u5DE6\u53F3\u952E\uFF09\uFF1B\u5173\u95ED\u4E0D\u5F71\u54CD\u753B\u5E03\u70B9\u51FB":"Forward supported key/button down and up events, including mouse buttons. Turning this off does not disable canvas clicks.",\u70B9\u51FB\u89E3\u9501\u6D4F\u89C8\u5668\u97F3\u6548:"Click to enable browser audio","\u2161 \u6682\u505C\u8FD0\u884C":"\u2161 Pause",\u6682\u505C\u540E\u53EF\u5355\u5E27\u8C03\u8BD5:"Pause to step through individual frames","\u25B7 \u5355\u5E27\u8C03\u8BD5":"\u25B7 Step One Frame","\u25A0 \u7ED3\u675F\u8BD5\u73A9":"\u25A0 Stop Playtest","\u21BB \u91CD\u65B0\u5F00\u59CB":"\u21BB Restart",\u5207\u6362\u4EAE\u6697\u4E3B\u9898:"Toggle light / dark theme",\u8FD4\u56DE\u7F16\u8F91:"Back to Editor","\u6B63\u5728\u51C6\u5907\u8BD5\u73A9\u2026":"Preparing playtest\u2026",\u8FD0\u884C\u65F6\u573A\u666F\u6811:"Runtime Scene Tree","0 \u8282\u70B9":"0 nodes",\u670D\u52A1\u7AEF\u53D8\u91CF:"Server Variables","0 \u9879":"0 items",\u5BA2\u6237\u7AEF\u811A\u672C\u65E5\u5FD7:"Client Script Logs","\u6700\u8FD1 100 \u6761":"Latest 100 entries",\u670D\u52A1\u7AEF\u65E5\u5FD7:"Server Logs","\u53D8\u91CF / \u4FE1\u53F7":"Variables / signals",\u81EA\u52A8\u6D4B\u7528\u4F8B:"Automated Test Case","\u5148\u8BD5\u73A9\uFF0C\u518D\u4FDD\u5B58\u56DE\u653E":"Play first, then save a replay",'\u65AD\u8A00 JSON \u6570\u7EC4\uFF0C\u4F8B\u5982 [{"kind":"log","contains":"clicked"}]':'JSON assertion array, e.g. [{"kind":"log","contains":"clicked"}]',\u4FDD\u5B58\u7528\u4F8B:"Save Test Case",\u56DE\u653E\u7528\u4F8B:"Replay Test Case","\u25CF \u6B63\u5728\u542F\u52A8":"\u25CF Starting","\u9875\u9762\uFF1A\u8BD5\u73A9":"View: Playtest","\u9875\u9762\uFF1A\u65E5\u5FD7":"View: Logs",\u8BD5\u73A9\u8BF7\u6C42\u5931\u8D25:"Playtest request failed"," \u9879":" items","\u6682\u65E0\u81EA\u5B9A\u4E49\u53D8\u91CF\u3002\u811A\u672C Get/Set \u6216 serverSet \u4E4B\u540E\u4F1A\u51FA\u73B0\u5728\u8FD9\u91CC\u3002":"No custom variables yet. They appear after script Get/Set calls or serverSet.","\u5B8C\u6574\u8FD0\u884C\u6811\u8BF7\u7528 Agent \u7684 inspect \u5FEB\u7167\u3002\u821E\u53F0\u6309\u5DE6\u6811\u4E0A\u65B9\u76D6\u4F4F\u4E0B\u65B9\u7ED8\u5236\u3002":"Use an Agent inspect snapshot for the full runtime tree. Items higher in the left tree draw over those below."," \u4E2A\u53EF\u89C1\u56FE\u5143":" visible primitives","\u25B6 \u7EE7\u7EED\u8FD0\u884C":"\u25B6 Resume"," \u4EBA":" players",\u73A9\u5BB6:"Player"," \xB7 \u73A9\u5BB6":" \xB7 Player "," \xB7 \u70B9\u51FB\u8F93\u5165":" \xB7 Click to focus","\u26A0 \u811A\u672C\u6302\u8F7D\u5931\u8D25":"\u26A0 Script attachment failed","\u2161 \u5DF2\u6682\u505C":"\u2161 Paused","\u25CF \u8BD5\u73A9\u8FD0\u884C\u4E2D":"\u25CF Playtest running","\u5DF2\u8BB0\u5F55 ":"Recorded "," \u6B65":" steps","\u26A0 \u8BD5\u73A9\u9519\u8BEF":"\u26A0 Playtest error","\u25A0 \u8BD5\u73A9\u5DF2\u7ED3\u675F\uFF0C\u53EF\u91CD\u65B0\u5F00\u59CB\u6216\u8FD4\u56DE\u7F16\u8F91":"\u25A0 Playtest stopped. Restart or return to the editor.","\u65AD\u8A00\u5FC5\u987B\u662F JSON \u6570\u7EC4":"Assertions must be a JSON array","\u5DF2\u4FDD\u5B58 ":"Saved "," \u6B65 / ":" steps / "," \u6761\u65AD\u8A00":" assertions",\u56DE\u653E\u901A\u8FC7:"Replay passed","\u56DE\u653E\u5931\u8D25 @":"Replay failed @","\u7F3A\u5C11\u4F1A\u8BDD ID":"Missing session ID","\u5343\u661F\u6A21\u62DF\u5668 \xB7 Live Preview":"Miliastra Simulator \xB7 Live Preview","\u5343\u661F\u6A21\u62DF\u5668 \xB7 \u7F16\u8F91\u5DE5\u4F5C\u53F0":"Miliastra Simulator \xB7 Editor","Web Preview \xB7 \u5B9E\u65F6\u9884\u89C8":"Web Preview \xB7 Live Preview",\u5DE5\u4F5C\u533A\u5B58\u6863:"Workspace Saves",\u91CD\u65B0\u8BFB\u53D6\u5B58\u6863:"Reload save from disk","\u7F16\u8F91\u5DE5\u4F5C\u53F0 \u2197":"Open Editor \u2197",\u6B63\u5728\u8FDE\u63A5:"Connecting",\u9884\u89C8\u6A21\u5F0F:"Preview mode",\u7F16\u8F91\u5668:"Editor",\u8D44\u4EA7:"Asset","\u670D\u52A1\u7AEF UI":"Server UI",\u5BA2\u6237\u7AEF\u6A21\u677F:"Client Templates","\u25B6 \u542F\u52A8":"\u25B6 Start","\u2161 \u6682\u505C":"\u2161 Pause","\u25B7 \u7EE7\u7EED":"\u25B7 Resume","+ 1 \u5E27":"+ 1 Frame","\u25A0 \u505C\u6B62":"\u25A0 Stop",\u6A21\u62DF\u5668\u9884\u89C8\u753B\u5E03:"Simulator preview canvas","Codex \u4FDD\u5B58 qxqy-simulator-save JSON \u540E\u4F1A\u81EA\u52A8\u51FA\u73B0\u5728\u8FD9\u91CC\u3002":"Saves appear here automatically when Codex writes a qxqy-simulator-save JSON file.","\u6B63\u5728\u66F4\u65B0\u753B\u9762\u2026":"Updating preview\u2026",\u7F16\u8F91\u5668\u9759\u6001\u9884\u89C8:"Static Editor Preview",\u9884\u89C8\u4FE1\u606F:"Preview Details",\u5F53\u524D\u8282\u70B9:"Selected Node",\u753B\u5E03:"Canvas",\u6E05\u7A7A:"Clear",\u9884\u89C8\u8FDE\u63A5:"Preview Connection","\u6B63\u5728\u8FDE\u63A5\u670D\u52A1\u2026":"Connecting to the service\u2026","\u5F53\u524D\u5B58\u6863\u4FDD\u5B58\u540E\u81EA\u52A8\u5237\u65B0\uFF1B\u9996\u6B21\u5B58\u6863\u4F1A\u81EA\u52A8\u53D1\u73B0\u3002\u5207\u6362\u5176\u4ED6\u5B58\u6863\u8BF7\u4F7F\u7528\u9876\u90E8\u5217\u8868\u6216 MCP \u9884\u89C8\u5DE5\u5177\u3002":"Refreshes automatically when the current save changes, and discovers the first save. Switch saves using the list above or the MCP preview tool.","\u68C0\u67E5\u66F4\u65B0\u5931\u8D25\uFF0C\u8BF7\u68C0\u67E5\u7F51\u7EDC\u8FDE\u63A5\u540E\u91CD\u8BD5\u3002":"Update check failed. Check your network connection and retry.",\u53D1\u73B0\u65B0\u7248\u672C:"A new version is available",\u5F53\u524D\u5DF2\u662F\u6700\u65B0\u7248\u672C:"You are up to date",\u5F53\u524D\u7248\u672C\u6BD4\u516C\u5F00\u7248\u672C\u66F4\u65B0:"Your version is newer than the public release",\u6682\u672A\u627E\u5230\u6B64\u5B89\u88C5\u5305\u7684\u6B63\u5F0F\u7248\u672C:"No stable release found for this package",\u754C\u9762\u8BED\u8A00:"Interface language","\u81EA\u52A8\uFF08\u7CFB\u7EDF\u8BED\u8A00\uFF09":"Auto (system language)","\u6B63\u5728\u68C0\u67E5\u66F4\u65B0\u2026":"Checking for updates\u2026",\u68C0\u67E5\u66F4\u65B0:"Check for Updates",\u8054\u7CFB\u4F5C\u8005:"Contact Author",QQ\u7FA4\u53F71007538100:"QQ Group: 1007538100","\u4F5C\u8005\u90AE\u7BB1 ":"Email: ","\u5F00\u6E90\u4ED3\u5E93 ":"Source repository: ","\u5F53\u524D\u7248\u672C\uFF1A{0}":"Current version: {0}","\u516C\u5F00\u7248\u672C\uFF1A{0}":"Public version: {0}","\u66F4\u65B0\u540E\u8BF7\u91CD\u542F\u5BBF\u4E3B\u5E76\u5237\u65B0\u7F16\u8F91\u5668\u4E0E\u8BD5\u73A9\u9875\u3002":"After updating, restart the host and refresh the editor and playtest pages.",\u67E5\u770B\u66F4\u65B0\u8BF4\u660E:"View Release Notes",\u4E0B\u8F7D\u66F4\u65B0\u5305:"Download Update",\u91CD\u8BD5:"Retry","\u8BF7\u9009\u62E9\u81EA\u52A8\u67E5\u627E\u3001\u6307\u5B9A\u6587\u4EF6\u6216\u7CFB\u7EDF\u5B57\u4F53":"Choose automatic discovery, a local file, or the system font",\u5B57\u4F53\u8DEF\u5F84\u8FC7\u957F:"The font path is too long",\u8BF7\u586B\u5199\u5B57\u4F53\u6587\u4EF6\u7684\u7EDD\u5BF9\u8DEF\u5F84:"Enter an absolute font file path","\u672C\u673A\u5B57\u4F53\u8BBE\u7F6E\u65E0\u6CD5\u8BFB\u53D6\uFF0C\u8BF7\u5728\u300C\u5B57\u4F53\u8BBE\u7F6E\u300D\u4E2D\u91CD\u65B0\u4FDD\u5B58":"Unable to read local font settings. Save them again in Font Settings.","\u65E0\u6CD5\u4FDD\u5B58\u672C\u673A\u5B57\u4F53\u8BBE\u7F6E\uFF0C\u8BF7\u68C0\u67E5\u914D\u7F6E\u76EE\u5F55\u7684\u5199\u5165\u6743\u9650":"Unable to save local font settings. Check write permissions for the configuration directory.","\u5F53\u524D\u5B57\u4F53\u7531 QXQY_FONT_PATH \u56FA\u5B9A\uFF0C\u8BF7\u79FB\u9664\u8BE5\u73AF\u5883\u53D8\u91CF\u5E76\u91CD\u542F\u540E\u518D\u4F7F\u7528\u524D\u7AEF\u8BBE\u7F6E":"QXQY_FONT_PATH overrides font settings. Remove it and restart before editing settings here.",\u5B57\u4F53\u8BBE\u7F6E\u4EC5\u9650\u672C\u673A\u76F4\u63A5\u8BBF\u95EE:"Font settings require a direct connection from this machine",\u5B57\u4F53\u8BBE\u7F6E\u8FC7\u5927:"Font settings exceed the size limit",\u5343\u661F\u6C99\u7BB1:"Miliastra Sandbox",\u5343\u661F\u5947\u57DF:"Miliastra Wonderland",\u670D\u52A1\u7AEF\u63A7\u4EF6\u6A21\u677F:"Server Control Template",\u670D\u52A1\u7AEF\u63A7\u4EF6:"Server Controls",\u5BA2\u6237\u7AEF\u63A7\u4EF6:"Client Controls","1 \u4EBA":"1 player","{0} \u4EBA":"{0} players"};var St="qxqy-ui-language",Ke="qxqy-ui-language-change",Ie=new Set,Zt=a=>["auto","zh","en"].includes(a);function qt(){try{let a=globalThis.localStorage?.getItem(St);return Zt(a)?a:"auto"}catch{return"auto"}}var ze=qt(),ea=null;function wn(a="auto",n="zh-CN",l=""){return a==="zh"||a==="en"?a:/^(?:zh|cmn|yue|wuu|hak|nan|gan|hsn)(?:[-_]|$)/i.test(l||n)?"zh":"en"}var ta=()=>ze,Qe=()=>ea||{language:typeof window>"u"?"zh-CN":globalThis.navigator?.language||globalThis.navigator?.languages?.[0]||Intl.DateTimeFormat().resolvedOptions().locale||"en",source:"browser"},aa=()=>wn(ze,Qe().language);async function na(a,n=globalThis.fetch){try{let l=await n(a,{method:"POST",mode:"same-origin",credentials:"same-origin",cache:"no-store",headers:{"content-type":"application/json"},body:"{}",signal:AbortSignal.timeout(4e3)});if(l.ok){let s=await l.json(),c=s.ok?s.value:null;if(typeof c?.language=="string"&&c.language.length<=80){let t=Intl.getCanonicalLocales(c.language.replaceAll("_","-"))[0];if(t){ea={language:t,source:c.source||"host"};for(let u of Ie)u()}}}}catch{}return Qe()}function $e(a){if(!(a?.type==="storage"&&a.key!==St&&a.key!==null)){ze=a?.type===Ke?a.detail:qt();for(let n of Ie)n()}}function ia(a){if(Zt(a)){ze=a;try{globalThis.localStorage?.setItem(St,a)}catch{}if(typeof window<"u")window.dispatchEvent(new CustomEvent(Ke,{detail:a}));else for(let n of Ie)n()}}function Ct(a){return!Ie.size&&typeof window<"u"&&(ze=qt(),window.addEventListener("storage",$e),window.addEventListener(Ke,$e),window.addEventListener("languagechange",$e)),Ie.add(a),()=>{Ie.delete(a),!Ie.size&&typeof window<"u"&&(window.removeEventListener("storage",$e),window.removeEventListener(Ke,$e),window.removeEventListener("languagechange",$e))}}function Ze(a){return()=>{let[,n]=a.useReducer(l=>l+1,0);return a.useEffect(()=>{let l=Ct(n);return n(),l},[]),aa()}}var Je=(a,n)=>a.replace(/\{(\d+)\}/g,(l,s)=>s<n.length?String(n[s]??""):l),Sn=Object.entries(Ve).filter(([a])=>/\{\d+\}/.test(a)).map(([a,n])=>{let l=[],s=a.split(/(\{\d+\})/).map(c=>{let t=c.match(/^\{(\d+)\}$/);return t?(l.push(Number(t[1])),"([\\s\\S]*?)"):c.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}).join("");return{expression:new RegExp(`^${s}$`),value:n,slots:l}});function qn(a,n,...l){if(Array.isArray(n)&&Object.hasOwn(n,"raw")&&(n=n.reduce((s,c,t)=>s+(t?`{${t-1}}`:"")+c,"")),typeof n!="string")return n;if(a!=="en")return Je(n,l);if(Object.hasOwn(Ve,n))return Je(Ve[n],l);if(!l.length&&/[\p{Script=Han}]/u.test(n))for(let s of Sn){let c=s.expression.exec(n);if(!c)continue;let t=[];return s.slots.forEach((u,m)=>{t[u]=c[m+1]}),Je(s.value,t)}return Je(n,l)}var e=(a,...n)=>qn(aa(),a,...n);function oa(a){let n=a.createElement;return function({snap:s,request:c,patch:t,prepare:u,refresh:m}){let g={version:1,workspaceDir:"",clientImportRoot:"",clientSubdir:""},[h,x]=a.useState(s.scriptSync||g),[b,N]=a.useState(s.storage?.path||"qxqy-simulator.save.json"),[E,P]=a.useState([]),[F,C]=a.useState(null),[I,R]=a.useState([]),[M,B]=a.useState(null),[A,$]=a.useState(""),[L,Z]=a.useState(""),[U,J]=a.useState(!1),X=a.useId();a.useEffect(()=>{x(s.scriptSync||g),C(null)},[JSON.stringify(s.scriptSync),s.storage?.path]),a.useEffect(()=>{C(null)},[s.version,s.asset?.type]),a.useEffect(()=>{s.storage?.path&&N(s.storage.path)},[s.storage?.path]);let de=async v=>{J(!0),Z(""),$("");try{await v()}catch(ne){Z(ne.message||String(ne))}finally{J(!1)}},ie=(v,ne={})=>c("script-sync",{action:v,args:ne});async function le(){C(null),B(null);let v=await u();await c("save",{path:b,expectedRevision:v.version}),await m();let ne=await ie("preview");C(ne),R(ne.rows.filter(se=>!se.error&&se.status!=="\u672A\u53D8\u5316").map(se=>se.id))}let pe=JSON.stringify(h)!==JSON.stringify(s.scriptSync||g),ce=(v,ne,se,Ge)=>n("label",{className:"qxsim-field",key:v},n("span",null,ne),n("input",{type:"text",value:h[v],placeholder:se,"aria-label":ne,"aria-describedby":`${X}-${v}`,disabled:U,onChange:De=>{x({...h,[v]:De.target.value}),C(null),$("")}}),n("small",{id:`${X}-${v}`},Ge)),fe=h.clientImportRoot.replaceAll("\\","/").match(/BeyondLocal\/([^/]+)\/Beyond_Local_Save_Level\/([^/]+)/),ge=v=>v.trim().replaceAll("\\","/").replace(/^\.$/,""),ae=ge(h.workspaceDir)?`${ge(h.workspaceDir)}/`:"",K=s.scripts?.find(v=>v.path.replaceAll("\\","/").startsWith(ae)&&v.path.toLowerCase().endsWith(".lua"))?.path.replaceAll("\\","/")||`${ae}main.lua`,it=[h.clientImportRoot.trim().replaceAll("\\","/").replace(/\/+$/,"")||e("\u3010\u5343\u661F\u6C99\u7BB1\u811A\u672C\u6587\u4EF6\u5939\u3011"),ge(h.clientSubdir),K.slice(ae.length)].filter(Boolean).join("/"),he={\u65B0\u589E:e("\u65B0\u589E\u6587\u4EF6"),\u8986\u76D6:e("\u66F4\u65B0\u5DF2\u6709\u6587\u4EF6"),\u672A\u53D8\u5316:e("\u5185\u5BB9\u76F8\u540C\uFF0C\u65E0\u9700\u66F4\u65B0"),\u9519\u8BEF:e("\u65E0\u6CD5\u590D\u5236")},ot={\u5B58\u6863\u6E90\u7801:e("\u5B58\u6863\u91CC\u7F16\u8F91\u7684\u4EE3\u7801"),\u5DE5\u4F5C\u533A\u6587\u4EF6:e("\u9879\u76EE\u4E2D\u7684 .lua \u6587\u4EF6")},xe=(v,ne,se=!1)=>n("button",{type:"button",className:"qxsim-action",disabled:U||se,onClick:()=>void de(ne)},v);return n("details",{className:"qxsim-section",style:{flexShrink:0,maxHeight:"55%",overflow:"auto",margin:"5px 10px"}},n("summary",null,e`实机脚本同步 · ${s.scriptSync?e("\u5DF2\u8BBE\u7F6E\u6587\u4EF6\u5939"):e("\u5148\u8BBE\u7F6E\u6587\u4EF6\u5939")}`),n("div",{className:"qxsim-section-body"},n("p",null,e("\u628A\u5F53\u524D\u5B58\u6863\u91CC\u7684 Lua \u811A\u672C\u590D\u5236\u5230\u5343\u661F\u6C99\u7BB1\uFF0C\u7528\u4E8E\u6E38\u620F\u5185\u6D4B\u8BD5\u3002\u64CD\u4F5C\u987A\u5E8F\uFF1A\u586B\u5199\u811A\u672C\u4F4D\u7F6E \u2192 \u4FDD\u5B58\u8BBE\u7F6E \u2192 \u4FDD\u5B58\u5B58\u6863\u5E76\u67E5\u770B\u66F4\u65B0 \u2192 \u786E\u8BA4\u590D\u5236\u3002")),ce("workspaceDir",e("\u9879\u76EE\u811A\u672C\u6587\u4EF6\u5939"),e("\u4F8B\u5982 workspace/my-game\uFF1B\u4E5F\u53EF\u4EE5\u7559\u7A7A"),e("\u586B\u5199\u5728\u5DE5\u4F5C\u533A\u91CC\u7684\u4F4D\u7F6E\uFF0C\u4F8B\u5982 workspace/my-game\uFF1B\u7559\u7A7A\u8868\u793A\u4F7F\u7528\u5DE5\u4F5C\u533A\u672C\u8EAB\u3002")),ce("clientImportRoot",e("\u5343\u661F\u6C99\u7BB1\u811A\u672C\u6587\u4EF6\u5939"),e("\u7C98\u8D34\u4EE5 default_import_file \u7ED3\u5C3E\u7684\u5B8C\u6574\u8DEF\u5F84"),e("\u5173\u5361\u5B58\u653E\u5916\u90E8 Lua \u811A\u672C\u7684\u6587\u4EF6\u5939\uFF0C\u53EF\u70B9\u51FB\u300C\u53D1\u73B0\u672C\u673A\u76EE\u5F55\u300D\u67E5\u627E\u3002\u8BF7\u586B\u5199\u8FD0\u884C\u6A21\u62DF\u5668\u90A3\u53F0\u7535\u8111\u4E0A\u7684\u5B8C\u6574\u8DEF\u5F84\u3002")),ce("clientSubdir",e("\u6E38\u620F\u91CC\u7684\u9879\u76EE\u5B50\u6587\u4EF6\u5939"),e("\u4F8B\u5982 workspace/my-game\uFF1B\u4E5F\u53EF\u4EE5\u7559\u7A7A"),n(a.Fragment,null,e("\u4E00\u822C\u548C\u201C\u9879\u76EE\u811A\u672C\u6587\u4EF6\u5939\u201D\u586B\u4E00\u6837\u7684\u5185\u5BB9\uFF0C\u4FDD\u7559\u539F\u6765\u7684\u6587\u4EF6\u4F4D\u7F6E\u3002\u7559\u7A7A\u5219\u76F4\u63A5\u653E\u8FDB\u5343\u661F\u6C99\u7BB1\u811A\u672C\u6587\u4EF6\u5939\u3002"),n("span",{"aria-label":e("\u590D\u5236\u8DEF\u5F84\u793A\u4F8B"),style:{display:"block",overflowWrap:"anywhere"}},e("\u590D\u5236\u793A\u4F8B\uFF1A"),n("code",null,K)," \u2192 ",n("code",null,it)))),fe?n("p",null,e`游戏账号 UID:${fe[1]} · 关卡目录编号:${fe[2]}`):null,n("div",{style:{display:"flex",gap:6,flexWrap:"wrap"}},xe(e("\u53D1\u73B0\u672C\u673A\u76EE\u5F55"),async()=>{let v=await ie("discover");P(v.candidates),v.candidates.length?$(e`找到 ${v.candidates.length} 个游戏脚本文件夹,请选择要更新的账号和关卡。`):Z(e("\u6CA1\u6709\u627E\u5230\u6E38\u620F\u811A\u672C\u6587\u4EF6\u5939\u3002\u53EF\u4EE5\u624B\u52A8\u7C98\u8D34 default_import_file \u6587\u4EF6\u5939\u7684\u5B8C\u6574\u8DEF\u5F84\uFF1B\u5982\u679C\u8FD8\u6CA1\u5BFC\u5165\u811A\u672C\uFF0C\u8BF7\u5148\u5728\u5343\u661F\u6C99\u7BB1\u5B8C\u6210\u5BFC\u5165\u3002"))}),xe(e("\u4FDD\u5B58\u8BBE\u7F6E"),async()=>{await u();let v=await t({op:"setScriptSync",config:h});await c("save",{path:b,expectedRevision:v.version}),await m(),C(null),B(null),$(e("\u811A\u672C\u4F4D\u7F6E\u5DF2\u4FDD\u5B58\u3002\u4E0B\u4E00\u6B65\u70B9\u51FB\u300C\u4FDD\u5B58\u5B58\u6863\u5E76\u67E5\u770B\u66F4\u65B0\u300D\u3002"))},!h.clientImportRoot.trim()||!b.trim()),xe(e("\u6E05\u9664\u8BBE\u7F6E"),async()=>{await u();let v=await t({op:"setScriptSync",config:null});await c("save",{path:b,expectedRevision:v.version}),await m(),C(null),B(null),$(e("\u5DF2\u6E05\u9664\u811A\u672C\u4F4D\u7F6E\u8BBE\u7F6E\u3002\u6E38\u620F\u91CC\u7684\u811A\u672C\u6587\u4EF6\u4ECD\u7136\u4FDD\u7559\u3002"))},!s.scriptSync||!b.trim())),E.length?n("label",{className:"qxsim-field"},e("\u9009\u62E9\u8981\u66F4\u65B0\u7684\u8D26\u53F7\u548C\u5173\u5361"),n("select",{value:"",disabled:U,onChange:v=>{x({...h,clientImportRoot:v.target.value}),C(null),$("")}},n("option",{value:""},e("\u8BF7\u9009\u62E9\u6E38\u620F\u8D26\u53F7\u548C\u5173\u5361\u6587\u4EF6\u5939\u2026")),E.map(v=>n("option",{key:v.path,value:v.path},e`账号 ${v.uid} / 关卡目录 ${v.editorId} · ${v.path}`)))):null,n("label",{className:"qxsim-field",style:{marginTop:8}},n("span",null,e("\u6A21\u62DF\u5668\u5B58\u6863\u6587\u4EF6")),n("input",{type:"text",value:b,placeholder:e("\u4F8B\u5982 my-game.save.json"),"aria-label":e("\u6A21\u62DF\u5668\u5B58\u6863\u6587\u4EF6"),"aria-describedby":`${X}-archive`,disabled:U,onChange:v=>{N(v.target.value),C(null),$("")}}),n("small",{id:`${X}-archive`},e("\u586B\u5199\u5DE5\u4F5C\u533A\u91CC\u7684\u5B58\u6863\u6587\u4EF6\u540D\u6216\u8DEF\u5F84\u3002\u4FDD\u5B58\u8BBE\u7F6E\u65F6\u4F1A\u4E00\u8D77\u4FDD\u5B58\u9879\u76EE\uFF0C\u4E0B\u6B21\u6253\u5F00\u5B58\u6863\u5373\u53EF\u590D\u7528\u3002"))),xe(e("\u4FDD\u5B58\u5B58\u6863\u5E76\u67E5\u770B\u66F4\u65B0"),le,!s.scriptSync||pe||!b.trim()),s.scriptSync?pe?n("p",null,e("\u811A\u672C\u4F4D\u7F6E\u5DF2\u6539\u52A8\uFF0C\u8BF7\u5148\u70B9\u51FB\u300C\u4FDD\u5B58\u8BBE\u7F6E\u300D\u3002")):b.trim()?null:n("p",null,e("\u8BF7\u5148\u586B\u5199\u6A21\u62DF\u5668\u5B58\u6863\u6587\u4EF6\u540D\u3002")):n("p",null,e("\u8BF7\u5148\u586B\u5199\u5343\u661F\u6C99\u7BB1\u811A\u672C\u6587\u4EF6\u5939\uFF0C\u5E76\u70B9\u51FB\u300C\u4FDD\u5B58\u8BBE\u7F6E\u300D\u3002")),U?n("p",{role:"status"},e("\u6B63\u5728\u5904\u7406\uFF0C\u8BF7\u7A0D\u5019\u2026")):A?n("p",{role:"status"},A):null,L?n("p",{role:"alert",style:{color:"var(--danger)"}},e(L)):null,F?n("section",{"aria-label":e("\u811A\u672C\u540C\u6B65\u786E\u8BA4")},n("p",{style:{overflowWrap:"anywhere"}},e`本次更新到:${F.root}`),F.rows.length?F.rows.every(v=>v.status==="\u672A\u53D8\u5316")?n("p",{role:"status"},e("\u6240\u6709\u811A\u672C\u90FD\u4E0E\u6E38\u620F\u6587\u4EF6\u5939\u91CC\u7684\u5185\u5BB9\u76F8\u540C\uFF0C\u65E0\u9700\u590D\u5236\u3002")):null:n("p",null,e("\u8FD9\u4E2A\u5B58\u6863\u8FD8\u6CA1\u6709 Lua \u811A\u672C\u3002\u8BF7\u5148\u5728\u4E0B\u65B9\u6DFB\u52A0\u811A\u672C\uFF0C\u518D\u67E5\u770B\u66F4\u65B0\u3002")),F.pendingGuidChanges?n("p",{role:"alert"},e("\u6709\u63A7\u4EF6\u7D22\u5F15\u5C1A\u672A\u540C\u6B65\u5230 Lua\u3002\u8BF7\u5148\u5728\u4E0A\u65B9\u300C\u5168\u91CF\u66FF\u6362\u811A\u672C\u7D22\u5F15\u300D\uFF0C\u6216\u300C\u590D\u5236\u63D0\u793A\u8BCD\u7ED9 AI\u300D\uFF1B\u5904\u7406\u5B8C\u6210\u540E\u518D\u67E5\u770B\u6E38\u620F\u811A\u672C\u66F4\u65B0\u3002")):null,F.rows.map(v=>n("div",{key:v.id,style:{borderTop:"1px solid var(--line)",padding:6}},n("label",{style:{overflowWrap:"anywhere"}},n("input",{type:"checkbox",disabled:U||!!v.error||v.status==="\u672A\u53D8\u5316",checked:I.includes(v.id),onChange:ne=>R(ne.target.checked?[...I,v.id]:I.filter(se=>se!==v.id))}),` ${v.path} \xB7 ${he[v.status]||v.status}`),n("div",null,e`复制的代码来自:${ot[v.sourceKind]||v.sourceKind}`),n("div",{style:{overflowWrap:"anywhere"}},v.error?e`无法复制:${v.error}`:e`复制到:${v.target}`),v.sourceMismatch?n("div",{className:"qxsim-note"},e("\u8FD9\u4E2A\u811A\u672C\u5728\u5B58\u6863\u91CC\u548C\u9879\u76EE\u6587\u4EF6\u91CC\u7684\u4EE3\u7801\u4E0D\u540C\u3002\u672C\u6B21\u4F1A\u590D\u5236\u5B58\u6863\u91CC\u7684\u4EE3\u7801\uFF1B\u5982\u679C\u8981\u4F7F\u7528\u9879\u76EE\u6587\u4EF6\uFF0C\u8BF7\u70B9\u51FB\u300C\u6539\u7528\u9879\u76EE\u6587\u4EF6\u91CC\u7684\u4EE3\u7801\u300D\uFF0C\u7136\u540E\u91CD\u65B0\u67E5\u770B\u66F4\u65B0\u3002"),n("details",null,n("summary",null,e("\u67E5\u770B\u9879\u76EE\u6587\u4EF6\u91CC\u7684\u4EE3\u7801")),n("pre",{style:{maxHeight:200,overflow:"auto"}},v.diskSource)),xe(e("\u6539\u7528\u9879\u76EE\u6587\u4EF6\u91CC\u7684\u4EE3\u7801"),async()=>{await u(),await t({op:"updateScript",id:v.id,source:v.diskSource}),C(null)})):null,!v.error&&v.status!=="\u672A\u53D8\u5316"?n("details",null,n("summary",null,e("\u5BF9\u6BD4\u66F4\u65B0\u524D\u540E\u7684\u4EE3\u7801")),n("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:8}},n("div",{style:{minWidth:0}},e("\u6E38\u620F\u91CC\u73B0\u5728\u7684\u4EE3\u7801"),n("pre",{style:{maxHeight:240,overflow:"auto"}},v.status==="\u65B0\u589E"?e("\uFF08\u6E38\u620F\u91CC\u8FD8\u6CA1\u6709\u8FD9\u4E2A\u6587\u4EF6\uFF09"):v.beforeSource)),n("div",{style:{minWidth:0}},e("\u672C\u6B21\u8981\u590D\u5236\u7684\u4EE3\u7801"),n("pre",{style:{maxHeight:240,overflow:"auto"}},v.source)))):null)),F.rows.some(v=>v.status==="\u65B0\u589E")?n("p",null,e("\u65B0\u589E\u811A\u672C\u590D\u5236\u540E\uFF0C\u8FD8\u9700\u8981\u5728\u5343\u661F\u6C99\u7BB1\u91CC\u5173\u8054\u5BF9\u5E94\u7684\u811A\u672C\u6587\u4EF6\uFF1B\u9700\u8981\u76F4\u63A5\u8FD0\u884C\u7684\u811A\u672C\u8FD8\u8981\u6302\u5230\u63A7\u4EF6\u4E0A\u3002")):null,I.length?n("p",null,e`已选 ${I.length} 个脚本,其中 ${F.rows.filter(v=>I.includes(v.id)&&v.status==="\u8986\u76D6").length} 个会替换游戏里的旧文件。替换前会自动备份旧文件,游戏里的其他文件会保留。`):null,n("div",{style:{display:"flex",gap:6}},xe(e("\u6682\u4E0D\u590D\u5236"),async()=>C(null)),xe(e`确认复制 ${I.length} 个脚本`,async()=>{let v=F;C(null),await u(),B(await c("script-sync-apply",{planId:v.id,scriptIds:I,confirmed:!0}))},!I.length||!!F.pendingGuidChanges))):null,M?n("div",{role:"status"},n("strong",null,M.completed?e("\u811A\u672C\u5DF2\u590D\u5236\u5230\u5343\u661F\u6C99\u7BB1"):e("\u6709\u4E9B\u811A\u672C\u672A\u590D\u5236\u6210\u529F")),n("p",null,M.completed?e("\u4E0B\u4E00\u6B65\uFF1A\u56DE\u5230\u5343\u661F\u6C99\u7BB1\uFF0C\u4FDD\u5B58\u5173\u5361\u5E76\u91CD\u65B0\u8BD5\u73A9\uFF0C\u8BA9\u6E38\u620F\u52A0\u8F7D\u66F4\u65B0\u540E\u7684\u811A\u672C\u3002"):e("\u8BF7\u6309\u4E0B\u65B9\u63D0\u793A\u5904\u7406\u5931\u8D25\u7684\u6587\u4EF6\uFF0C\u518D\u91CD\u65B0\u67E5\u770B\u66F4\u65B0\u5E76\u590D\u5236\u3002")),n("p",{style:{overflowWrap:"anywhere"}},e`复制时间:${new Date(M.at).toLocaleString()} · 旧文件备份保存在:${M.backupRoot}`),n("ul",{style:{overflowWrap:"anywhere"}},M.results.map(v=>n("li",{key:v.id},`${v.target}\uFF1A${v.status==="\u6210\u529F"?e("\u5DF2\u590D\u5236"):e("\u672A\u590D\u5236")}${v.error?` \xB7 ${v.error}`:""}`)))):null))}}function ra(a){let n=a.createElement;return function({snap:s,prepare:c,patch:t,copy:u,onScripts:m,onError:g,reloadArchive:h}){let[x,b]=a.useState(!1),[N,E]=a.useState(null),[P,F]=a.useState(null),[C,I]=a.useState(""),[R,M]=a.useState(!1),B=a.useRef(null),A=s.controlGuidChanges||[],$=A.at(-1)?.id||"";a.useEffect(()=>{E(null),I("")},[s.version,s.save?.name]),a.useEffect(()=>{M(!1)},[$,s.save?.name]),a.useLayoutEffect(()=>{C&&B.current&&(B.current.scrollTop=0)},[C]);let L=U=>async()=>{b(!0);try{await U()}catch(J){g(J?.message||String(J))}finally{b(!1)}},Z=L(async()=>{I(await u()),E(null),B.current&&(B.current.scrollTop=0)});return!A.length&&!P?null:R?n("div",{style:{flexShrink:0,padding:"2px 10px"}},n("button",{className:"qxsim-action",onClick:()=>M(!1)},e`Lua 索引待同步(${A.length} 项)· 展开`)):n("section",{ref:B,className:"qxsim-note","aria-label":e("Lua \u7D22\u5F15\u540C\u6B65"),style:{flexShrink:0,maxHeight:270,overflow:"auto",overflowWrap:"anywhere"}},n("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:8}},n("strong",null,A.length?e`下一步:同步 Lua 索引引用(${A.length} 项)`:e("\u811A\u672C\u5168\u91CF\u66FF\u6362\u5DF2\u5B8C\u6210")),n("button",{className:"qxsim-action","aria-label":e("\u5173\u95ED\u7D22\u5F15\u540C\u6B65\u63D0\u793A"),title:e("\u6536\u8D77\u63D0\u793A\uFF0C\u4FDD\u7559\u5F85\u540C\u6B65\u8BB0\u5F55"),disabled:x,onClick:()=>{A.length?M(!0):F(null)}},e("\u5173\u95ED"))),C?n("details",{open:!0},n("summary",null,e("\u540C\u6B65\u4EFB\u52A1\uFF08\u7C98\u8D34\u7ED9\u5F53\u524D\u9879\u76EE\u7684 AI\uFF09")),n("textarea",{"aria-label":e("AI \u7D22\u5F15\u540C\u6B65\u4EFB\u52A1"),readOnly:!0,value:C,rows:5,style:{width:"100%",boxSizing:"border-box"}}),n("button",{className:"qxsim-action",disabled:x,onClick:L(h)},e("AI \u5DF2\u5904\u7406\uFF0C\u91CD\u65B0\u8F7D\u5165\u5B58\u6863"))):null,n("div",null,A.length?e("\u63A7\u4EF6\u7D22\u5F15\u5DF2\u4FEE\u6539\uFF0C\u8BF7\u9009\u62E9\u4E00\u79CD\u65B9\u5F0F\u540C\u6B65\u811A\u672C\u3002"):e("\u8BF7\u68C0\u67E5\u66FF\u6362\u7ED3\u679C\u5E76\u4FDD\u5B58\u5B58\u6863\uFF0C\u518D\u5230\u300CLua \u811A\u672C \u2192 \u5B9E\u673A\u811A\u672C\u540C\u6B65\u300D\u66F4\u65B0\u6E38\u620F\u91CC\u7684\u6587\u4EF6\u5E76\u91CD\u65B0\u8BD5\u73A9\u3002")),A.length?n(a.Fragment,null,n("div",{role:"group","aria-label":e("\u7D22\u5F15\u540C\u6B65\u65B9\u5F0F"),style:{display:"flex",gap:12,flexWrap:"wrap",marginTop:5}},n("div",{style:{flex:"1 1 280px"}},n("button",{className:"qxsim-action",disabled:x,onClick:L(async()=>{await c();let J=(await t({op:"previewControlGuidSync"})).controlGuidSyncPreview;if(F(null),I(""),!J.canApply){E(J);return}let X=await t({op:"syncControlGuidReferences",planId:J.id});F(X.controlGuidSyncResult),E(null)})},e("\u5168\u91CF\u66FF\u6362\u811A\u672C\u7D22\u5F15")),n("div",null,n("strong",null,e("\u53EF\u80FD\u9519\u8BEF\u5730\u66FF\u6362\u975E\u7D22\u5F15\u5185\u5BB9\u3002")),e("\u6309\u5B8C\u6574\u5341\u8FDB\u5236\u6570\u5B57\u66FF\u6362\u6240\u6709\u5DF2\u767B\u8BB0\u811A\u672C\uFF0C\u5305\u62EC\u914D\u7F6E\u8868\u3001\u5B57\u7B26\u4E32\u548C\u6CE8\u91CA\uFF1B\u540C\u65F6\u66F4\u65B0\u5185\u5BB9\u4E00\u81F4\u7684\u5DE5\u4F5C\u533A\u6E90\u6587\u4EF6\uFF0C\u66FF\u6362\u524D\u81EA\u52A8\u5907\u4EFD\u3002"))),n("div",{style:{flex:"1 1 280px"}},n("button",{className:"qxsim-action",disabled:x,onClick:Z},e("\u590D\u5236\u63D0\u793A\u8BCD\u7ED9 AI")),n("div",null,e("\u5148\u4FDD\u5B58\u6700\u65B0\u5B58\u6863\uFF0C\u518D\u590D\u5236\u5305\u542B\u6620\u5C04\u8BFB\u53D6\u65B9\u5F0F\u548C\u811A\u672C\u4F4D\u7F6E\u7684\u63D0\u793A\u8BCD\uFF0C\u7531 AI \u5224\u65AD\u54EA\u4E9B\u5F15\u7528\u9700\u8981\u66F4\u65B0\u3002")))),n("details",null,n("summary",null,e`查看索引变更(${A.length} 项)`),n("ul",null,A.slice(0,20).map(U=>n("li",{key:U.id},`${U.controlName}\uFF1A${U.oldGuid} \u2192 ${U.newGuid}`))),A.length>20?n("div",null,e("\u8FD9\u91CC\u663E\u793A\u524D 20 \u9879\uFF1B\u5B8C\u6574\u6620\u5C04\u968F\u5B58\u6863\u4FDD\u5B58\uFF0C\u590D\u5236\u7684\u4EFB\u52A1\u4F1A\u5F15\u5BFC AI \u8BFB\u53D6\u5168\u90E8\u3002")):null)):null,N?n("div",{"aria-label":e("Lua \u7D22\u5F15\u540C\u6B65\u95EE\u9898")},n("p",null,e("\u6E90\u7801\u6587\u4EF6\u6216\u7D22\u5F15\u6620\u5C04\u5B58\u5728\u51B2\u7A81\uFF0C\u672C\u6B21\u6CA1\u6709\u4FEE\u6539\u811A\u672C\u3002\u53EF\u590D\u5236\u63D0\u793A\u8BCD\u7ED9 AI \u5904\u7406\u3002")),N.issues.map((U,J)=>n("div",{key:J},U)),N.rows.filter(U=>U.issues.length).map(U=>n("details",{key:U.id,open:!0},n("summary",null,U.path||e("\u5185\u8054\u811A\u672C")),U.issues.slice(0,12).map((J,X)=>n("div",{key:`i${X}`},`${J.line?e`第 ${J.line} 行:`:""}${J.reason}`)),U.issues.length>12?n("div",null,e("\u5176\u4F59\u95EE\u9898\u8BF7\u7531 AI \u6838\u5BF9\u3002")):null))):null,P&&!A.length?n(a.Fragment,null,n("div",null,e`已替换 ${P.scripts} 个脚本的 ${P.replacements} 处文本,更新 ${P.projectFiles} 个项目文件。备份:${P.backupRoot}`),n("button",{className:"qxsim-action",onClick:m},e("\u524D\u5F80 Lua \u811A\u672C"))):null)}}function et(a){try{a?.close()}catch{}}function Cn(){if(window.location.protocol==="dsh-app:")return null;let a;try{return a=window.open("about:blank","_blank"),!a||a.closed?null:(a.document.write(e('<!doctype html><meta charset="utf-8"><title>\u6B63\u5728\u51C6\u5907\u8BD5\u73A9\u2026</title><p>\u6B63\u5728\u4FDD\u5B58\u9879\u76EE\u5E76\u51C6\u5907\u8BD5\u73A9\u2026</p>')),a)}catch{return et(a),null}}function sa(a){let n=a.createElement,l=new Map;function s({entry:c,api:t,onClosed:u}){let m=a.useRef(null),g=a.useRef(null),[h,x]=a.useState(!1),[b,N]=a.useState(""),[E,P]=a.useState(!1);a.useLayoutEffect(()=>{let C={closing:!1,stopped:!1,pending:null,controller:null,requests:new Set};g.current=C;let I=m.current,R=I.querySelector("iframe"),M=!0,B=()=>{if(C.stopped)return Promise.resolve();if(C.closing=!0,!C.controller)return C.stopped=!0,Promise.resolve();if(!C.pending){let L=(async()=>{C.controller?.quiesce(),await Promise.allSettled([...C.requests]),await t(c.sessionId,"play",{action:"stop",args:{}}),C.stopped=!0})().finally(()=>{C.pending=null,l.get(c.sessionId)===L&&l.delete(c.sessionId)});C.pending=L,l.set(c.sessionId,L)}return C.pending};C.close=async()=>{if(!(C.pending||C.stopped)){x(!0),N("");try{await B(),M&&u()}catch(L){M&&(N(e`停止试玩失败,请重试:${L?.message||L}`),x(!1))}}};let A=L=>{L.source!==R.contentWindow||L.data?.type!=="qxqy-play-close"||L.data.sessionId!==c.sessionId||C.close()},$=L=>{L.preventDefault(),C.close()};return window.addEventListener("message",A),I.addEventListener("cancel",$),I.showModal(),()=>{M=!1,window.removeEventListener("message",A),I.removeEventListener("cancel",$),I.close(),B().catch(L=>console.error("Embedded play cleanup failed",L)),c.returnFocus?.isConnected&&c.returnFocus.focus()}},[c,t,u]);function F(C){let I=g.current;if(!I.closing)try{let R=C.currentTarget,M=R.contentWindow?.qxqyEmbeddedPlay;if(!M)throw new Error(e("\u8BD5\u73A9\u9875\u672A\u80FD\u52A0\u8F7D\uFF0C\u8BF7\u8FD4\u56DE\u7F16\u8F91\u540E\u91CD\u8BD5\u3002"));I.controller=M,P(!0),R.focus(),M.focus();let B=(A,$={})=>{if(I.closing)return Promise.reject(new Error(e("\u8BD5\u73A9\u6B63\u5728\u5173\u95ED")));let L=t(c.sessionId,"play",{action:A,args:$});return I.requests.add(L),L.then(()=>I.requests.delete(L),()=>I.requests.delete(L)),L};M.start(B).catch(A=>{I.closing||N(A?.message||String(A))})}catch(R){N(R?.message||String(R))}}return n("dialog",{ref:m,className:"qxsim-play-overlay","aria-label":e("\u5185\u5D4C\u8BD5\u73A9"),"aria-modal":!0},n("header",{className:"qxsim-play-header"},n("span",{role:"status"},h?e("\u6B63\u5728\u505C\u6B62\u8BD5\u73A9\u2026"):E?e("\u5185\u5D4C\u8BD5\u73A9"):e("\u6B63\u5728\u8F7D\u5165\u8BD5\u73A9\u2026")),n("button",{className:"qxsim-action",type:"button",disabled:h,onClick:()=>void g.current?.close?.()},e("\u5173\u95ED\u8BD5\u73A9"))),b?n("div",{className:"qxsim-play-error",role:"alert"},e(b)):null,n("iframe",{title:e("\u5343\u661F\u6C99\u7BB1\u8BD5\u73A9"),src:c.url,onLoad:F,tabIndex:0}))}return function({sessionId:t,api:u,playUrl:m,onError:g}){let h=a.useRef(null),[x,b]=a.useState(!1),[N,E]=a.useState(null),P=a.useCallback(()=>E(null),[]);a.useEffect(()=>{let C={active:!0,pending:!1,popup:null};return h.current=C,b(!1),E(null),()=>{C.active=!1,et(C.popup)}},[t]);async function F(C){let I=h.current;if(!I?.active||I.pending||N)return;I.pending=!0;let R=document.activeElement;b(!0);try{let M=Cn();if(I.popup=M,await l.get(t),!I.active||(await C(),!I.active))return;let B=new URL(m(t),window.location.href);if(M){try{if(M.closed)throw new Error("Play window closed");M.location.replace(B.href)}catch{et(M),M=null}I.popup=null}M||(B.searchParams.set("embedded","1"),E({sessionId:t,url:B.href,returnFocus:R}))}catch(M){et(I.popup),I.popup=null,I.active&&g(M?.message||String(M))}finally{I.pending=!1,I.active&&b(!1)}}return{open:F,opening:x,overlay:N?.sessionId===t?n(s,{key:t,entry:N,api:u,onClosed:P}):null}}}var la="prefab-v1",kn=[[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 ca(a){return!Number.isSafeInteger(a)||!kn.some(([n,l])=>a>=n&&a<=l)?null:a===10003004||a===10008001?128:256}var Nn="sprite-v1",In="/qxqy-assets/",An=[[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 ke(a){return a==null||a===""?"StaticReference":typeof a=="string"?a:typeof a.Name=="string"?a.Name:"Unknown"}function me(a,n){return`${ke(n)}:${a}`}function Ae(a,n){let l=ke(n);return l==="Prefab"?ca(a)!==null:l==="StaticReference"&&Number.isSafeInteger(a)&&a>100006&&An.some(([s,c])=>a>=s&&a<=c)}function kt(a,n=0,l){let s=ke(l);if(!["StaticReference","Prefab"].includes(s))throw new Error(`Unsupported image source: ${s}`);return`${In}${s==="Prefab"?la:Nn}/${a}.png${n?`?refresh=${n}`:""}`}function da(a,n=0,l){return kt(a,n,l).replace(".png",".json")}var Nt="qxqy-image-refresh",we=new Map,Ue=new Map,Te=new Map,It=new Set,Pn=16777216,pa=!1;function ma(a,n){Te.set(a,n),we.delete(a),Ue.delete(a);for(let l of It)l(a)}var ua=a=>/^\d+$/.test(a)?me(Number(a)):a;function tt(){if(!(pa||typeof window>"u")){pa=!0;try{for(let[a,n]of Object.entries(JSON.parse(localStorage.getItem(Nt)||"{}")))Te.set(ua(a),n)}catch{}window.addEventListener("storage",a=>{if(a.key===Nt)try{for(let[n,l]of Object.entries(JSON.parse(a.newValue||"{}"))){let s=ua(n);Te.get(s)!==l&&ma(s,l)}}catch{}})}}function At(a){return tt(),It.add(a),()=>It.delete(a)}function fa(a,n){tt(),ma(me(a,n),Date.now());try{localStorage.setItem(Nt,JSON.stringify(Object.fromEntries(Te)))}catch{}}function Pt(a,n){if(tt(),ke(n)!=="StaticReference"||!Ae(a,n))return Promise.resolve(null);let l=me(a,n),s=Ue.get(l);if(s)return s;let c=fetch(da(a,Te.get(l),n),{signal:AbortSignal.timeout(3e4)}).then(async t=>{if(!t.ok)throw new Error(`\u56FE\u7247 ${a} \u5143\u6570\u636E\u52A0\u8F7D\u5931\u8D25\uFF1AHTTP ${t.status}`);return t.json()}).catch(t=>{throw Ue.get(l)===c&&Ue.delete(l),t});return Ue.set(l,c),c}async function ga(a,n){let[l,s]=await Promise.all([En(a,n),Pt(a,n).then(c=>({meta:c,error:""}),c=>({meta:void 0,error:c.message}))]);return{image:l,...s}}function En(a,n){if(tt(),!Ae(a,n))return Promise.reject(new Error("Image source/ID is not in the preview allowlist"));let l=me(a,n),s=we.get(l);if(s&&(!s.failed||Date.now()<s.retryAt))return we.delete(l),we.set(l,s),s.promise;let c={pixels:0,failed:!1};return c.promise=new Promise((t,u)=>{let m=new Image,g=setTimeout(()=>{m.src="",h(new Error("\u56FE\u7247\u52A0\u8F7D\u8D85\u65F6"))},45e3);function h(x){if(clearTimeout(g),m.onload=m.onerror=null,x){c.failed=!0,c.retryAt=Date.now()+6e4,u(x);return}c.pixels=m.width*m.height;let b=[...we.values()].reduce((N,E)=>N+E.pixels,0);for(let[N,E]of we){if(b<=Pn&&we.size<=128)break;N!==l&&(!E.pixels&&!E.failed||(we.delete(N),b-=E.pixels))}t(m)}m.onload=()=>h(),m.onerror=()=>h(new Error(`\u56FE\u7247 ${a} \u52A0\u8F7D\u5931\u8D25\uFF0C\u53EF\u5728\u5C5E\u6027\u9762\u677F\u5237\u65B0\u7D20\u6750`)),m.src=kt(a,Te.get(l),n)}),we.set(l,c),c.promise}function ha(a,n,l){let s=Number(n??4294967295)>>>0;if((s&16777215)===16777215)return a;let c=l(a.width,a.height),t=c.getContext("2d");t.drawImage(a,0,0);let u=t.getImageData(0,0,c.width,c.height),m=s>>>16&255,g=s>>>8&255,h=s&255;for(let x=0;x<u.data.length;x+=4)u.data[x]=Math.round(u.data[x]*m/255),u.data[x+1]=Math.round(u.data[x+1]*g/255),u.data[x+2]=Math.round(u.data[x+2]*h/255);return t.putImageData(u,0,0),c}function Et(a){return!!a?.border&&Object.values(a.border).some(n=>Number.isFinite(n)&&n>0)}function at(a,n){let l=typeof n=="object"?n?.Name:n;return Et(a)&&l!=="Basic"?"Stretch":"Basic"}function Ln(a,n,l,s){n=Number.isFinite(n)?Math.max(0,n):0,l=Number.isFinite(l)?Math.max(0,l):0;let c=Math.min(1,a/(n+l||1));n*=c,l*=c;let t=Math.min(1,s/(n+l||1));return{source:[0,n,a-l,a],target:[0,n*t,s-l*t,s]}}var xa=new WeakMap;function ba(a,n,l,s,c){let t=Math.max(0,l),u=Math.max(0,s),m=Math.min(1,4096/Math.max(1,t),4096/Math.max(1,u)),g=Math.max(1,Math.round(t*m)),h=Math.max(1,Math.round(u*m)),x=c(g,h),b=x.getContext("2d");if(!t||!u)return x;let N=xa.get(a);if(!N){let R=c(a.width,a.height),M=R.getContext("2d");M.drawImage(a,0,0),N=M.getImageData(0,0,a.width,a.height),xa.set(a,N)}let E=b.createImageData(g,h),P=N.data,F=(R,M,B,A,$,L)=>{let{source:Z,target:U}=Ln(M,B,A,$);return Array.from({length:L},(J,X)=>{let de=(X+.5)*$/L,ie=de<U[1]?0:de<U[2]?1:2,le=U[ie+1]>U[ie]?(de-U[ie])/(U[ie+1]-U[ie]):0,pe=Math.max(0,Math.min(R-1,(Z[ie]+le*(Z[ie+1]-Z[ie]))*R/M-.5)),ce=Math.floor(pe);return[ce,Math.min(R-1,ce+1),pe-ce]})},C=F(a.width,n.width,n.border.left,n.border.right,t,g),I=F(a.height,n.height,n.border.top,n.border.bottom,u,h);for(let R=0;R<h;R++)for(let M=0;M<g;M++){let[B,A,$]=C[M],[L,Z,U]=I[R],J=(L*a.width+B)*4,X=(L*a.width+A)*4,de=(Z*a.width+B)*4,ie=(Z*a.width+A)*4,le=P[J+3]*(1-$)*(1-U),pe=P[X+3]*$*(1-U),ce=P[de+3]*(1-$)*U,fe=P[ie+3]*$*U,ge=le+pe+ce+fe,ae=(R*g+M)*4;E.data[ae+3]=Math.round(ge);for(let K=0;K<3;K++)E.data[ae+K]=ge?Math.round((P[J+K]*le+P[X+K]*pe+P[de+K]*ce+P[ie+K]*fe)/ge):0}return b.putImageData(E,0,0),x}function va(a,n,l){if(a.fillType!=="Horizontal"&&a.fillType!=="Vertical")return null;let s=Number(a.fillAmount??1),c=Number.isFinite(s)?Math.max(0,Math.min(1,s)):1;if(a.fillType==="Horizontal"){let u=n*c;return{x:a.fillHorizontalType==="Right"?n/2-u:-n/2,y:-l/2,width:u,height:l}}let t=l*c;return{x:-n/2,y:a.fillVerticalType==="Top"?-l/2:l/2-t,width:n,height:t}}function ya(a,n){let l=document.createElement("canvas");return l.width=a,l.height=n,l}function wa(a){let n=a.createElement;return function({item:s}){let c=me(s.imageId,s.imageSource),t=a.useRef(null),[u,m]=a.useState({image:null,meta:null,error:""}),[g,h]=a.useState(0);return a.useEffect(()=>At(x=>{x===c&&h(b=>b+1)}),[c]),a.useEffect(()=>{let x=!0;return m({image:null,error:""}),ga(s.imageId,s.imageSource).then(({image:b,meta:N,error:E})=>{x&&m({image:b,meta:N,error:E})},b=>{x&&m({image:null,error:b.message})}),()=>{x=!1}},[c,g]),a.useEffect(()=>{let x=t.current;if(!u.image||!x)return;let b=at(u.meta,s.imageType)==="Stretch"?ba(u.image,u.meta,s.width,s.height,ya):u.image,N=ha(b,s.imageColor,ya);x.width=N.width,x.height=N.height;let E=x.getContext("2d"),P=s.enableFill?va(s,x.width,x.height):null;P&&(E.beginPath(),E.rect(P.x+x.width/2,P.y+x.height/2,P.width,P.height),E.clip()),E.globalAlpha=(Number(s.imageColor??4294967295)>>>24&255)/255,E.drawImage(N,0,0)},[u.image,u.meta,s.imageType,s.width,s.height,s.imageColor,s.enableFill,s.fillType,s.fillHorizontalType,s.fillVerticalType,s.fillAmount]),u.image?n("canvas",{ref:t,title:u.error,"data-image-id":s.imageId,"data-image-source":ke(s.imageSource),"data-image-type":at(u.meta,s.imageType),"aria-label":e`图片 ${s.imageId}`,style:{display:"block",position:"absolute",inset:0,width:"100%",height:"100%"}}):n("span",{className:"qxsim-box-label",title:u.error,role:u.error?"status":void 0},u.error?e`图片 ${s.imageId} 加载失败`:e`加载图片 ${s.imageId}…`)}}function Sa(a){let n=a.createElement;return function({imageId:s,imageSource:c,value:t,commit:u}){let m=me(s,c),[g,h]=a.useState({key:"",meta:void 0,error:""}),[x,b]=a.useState(0);a.useEffect(()=>At(P=>{P===m&&b(F=>F+1)}),[m]),a.useEffect(()=>{let P=!0;return h({key:m,meta:void 0,error:""}),Pt(s,c).then(F=>{P&&h({key:m,meta:F,error:""})},F=>{P&&h({key:m,meta:void 0,error:F.message})}),()=>{P=!1}},[m,x]);let N=g.key===m&&g.meta!==void 0,E=N&&Et(g.meta);return n("label",{className:"qxsim-field"},n("span",{className:"qxsim-field-label"},e("\u56FE\u7247\u7C7B\u578B")),n("select",{"aria-label":e("\u56FE\u7247\u7C7B\u578B"),disabled:!E,value:N?at(g.meta,t):"",onChange:P=>u("imageType",P.target.value)},N?n("option",{value:"Basic"},e("\u57FA\u7840")):n("option",{value:""},g.error?e("\u5143\u6570\u636E\u52A0\u8F7D\u5931\u8D25"):e("\u8BFB\u53D6\u7D20\u6750\u8FB9\u754C\u2026")),E?n("option",{value:"Stretch"},e("\u62C9\u4F38")):null),g.error?n("small",{role:"status"},g.error):null)}}var Mn=a=>`#${(Number(a)&16777215).toString(16).padStart(6,"0").toUpperCase()}`,qa=a=>String(Math.round(a/255*100));function Ca(a){let n=a.createElement;return function({field:s,commit:c}){let t=Mn(s.value),u=Number(s.value)>>>24,m=qa(u),[g,h]=a.useState(t),[x,b]=a.useState(m),N=a.useRef(!1),[E,P]=a.useState(""),[F,C]=a.useState("");a.useEffect(()=>{h(t),P("")},[t]),a.useEffect(()=>{N.current||(b(m),C(""))},[m]);function I(A){let $=A.trim().replace(/^#/,"");if(!/^[0-9a-f]{6}$/i.test($)){P(e("\u8BF7\u8F93\u5165\u516D\u4F4D\u989C\u8272\uFF0C\u4F8B\u5982 #FF8800"));return}let L=`#${$.toUpperCase()}`;h(L),P(""),c(s.key,Z=>(Number(Z)&4278190080|parseInt($,16))>>>0)}function R(A){let $=Number(A);if(!String(A).trim()||!Number.isInteger($)||$<0||$>100){C(e("\u900F\u660E\u5EA6\u8BF7\u8F93\u5165 0\u2013100 \u7684\u6574\u6570"));return}let L=Math.round($/100*255);N.current=!1,b(qa(L)),C(""),c(s.key,Z=>(L<<24|Number(Z)&16777215)>>>0)}let M=e("Alpha\uFF1A0% \u5B8C\u5168\u900F\u660E\uFF0C100% \u5B8C\u5168\u4E0D\u900F\u660E"),B=x.trim()&&Number.isFinite(Number(x))?Math.max(0,Math.min(100,Number(x))):Number(m);return n("div",{className:"qxsim-color-editor",role:"group","aria-label":e`${e(s.label)}与透明度`},n("div",{className:"qxsim-field"},n("span",{className:"qxsim-field-label"},e(s.label)),n("span",{className:"qxsim-color-row"},n("span",{className:"qxsim-color-swatch",title:e("\u6253\u5F00\u53D6\u8272\u5668")},n("input",{type:"color",value:/^#[0-9a-f]{6}$/i.test(g)?g:t,disabled:!!s.readonly,"aria-label":e`${e(s.label)}取色器`,onInput:A=>I(A.target.value)})),n("input",{type:"text",value:g,spellCheck:!1,disabled:!!s.readonly,placeholder:"#RRGGBB","aria-label":`${e(s.label)} RGB`,"aria-invalid":!!E,onChange:A=>{h(A.target.value),P("")},onBlur:()=>I(g),onKeyDown:A=>{A.key==="Enter"&&A.currentTarget.blur(),A.key==="Escape"&&(h(t),P(""))}})),E?n("small",{className:"qxsim-color-error",role:"alert"},E):null),n("div",{className:"qxsim-field"},n("span",{className:"qxsim-field-label",title:M},e("\u900F\u660E\u5EA6")),n("span",{className:"qxsim-alpha-row"},n("input",{type:"range",min:0,max:100,step:1,value:B,disabled:!!s.readonly,title:M,"aria-label":e`${e(s.label)}透明度滑块`,onInput:A=>R(A.target.value)}),n("span",{className:"qxsim-alpha-value"},n("input",{type:"number",min:0,max:100,step:1,inputMode:"numeric",value:x,disabled:!!s.readonly,title:M,"aria-label":e`${e(s.label)}透明度`,"aria-invalid":!!F,onChange:A=>{N.current=!0,b(A.target.value),C("")},onBlur:()=>{N.current&&R(x)},onKeyDown:A=>{A.key==="Enter"&&A.currentTarget.blur(),A.key==="Escape"&&(N.current=!1,b(m),C(""))}}),n("span",{"aria-hidden":!0},"%"))),F?n("small",{className:"qxsim-color-error",role:"alert"},F):null))}}function ka(a,n,l){let s=a.renderMatrix;if(!s)return{};let c=s.a*a.centerX+s.c*a.centerY+s.tx,t=s.b*a.centerX+s.d*a.centerY+s.ty;return{left:`${(c-a.width/2)/n*100}%`,bottom:`${(t-a.height/2)/l*100}%`,width:`${a.width/n*100}%`,height:`${a.height/l*100}%`,transform:`matrix(${s.a},${-s.b},${-s.c},${s.d},0,0)`}}var Pe='"Microsoft YaHei UI","Microsoft YaHei","HarmonyOS Sans SC","Noto Sans CJK SC",sans-serif',Lt="/qxqy-font";var Mt=a=>`QxqyLocal_${a}`,Na=a=>a?`"${Mt(a)}",${Pe}`:Pe;var vi=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 Ia(a,n){return`${a.italic?"italic ":""}${a.bold?"bold ":""}${a.fontSize}px ${n}`}function Aa(a){let n=Number(a)>>>0;return`rgba(${n>>>16&255},${n>>>8&255},${n&255},${(n>>>24)/255})`}function $n(a,n,l,s,c=Pe){let t=n.textLayout;if(!t?.richLines||l<=0||s<=0)return;let u=n.horizontalAlignment==="Right"?1:n.horizontalAlignment==="Middle"?.5:0,m=n.verticalAlignment==="Bottom"?1:n.verticalAlignment==="Middle"?.5:0,g=n.kind==="textwindow"?n.scroll:null,h=t.visibleLineCount??t.richLines.length,x=t.visibleContentHeight??t.contentHeight,b=n.kind==="textwindow"&&t.contentHeight>s?-(g?.offset||0):m*(s-x);a.save(),a.beginPath(),a.rect(0,0,l,s),a.clip(),a.textAlign="left",a.textBaseline="alphabetic",a.lineJoin="round",a.strokeStyle=Aa(n.outlineColor??4278190080);for(let N=0;N<h;N++){let E=t.richLines[N],P=b+E.top;if(P+E.height<0||P>s)continue;let F=2+u*(t.textWidth-E.width);for(let C of E.runs)a.font=Ia(C,c||Pe),a.fillStyle=Aa(C.color??n.fontColor??4294967295),n.enableOutline&&(a.lineWidth=Math.max(2,C.fontSize*.12),a.strokeText(C.text,F+C.x,P+E.baseline)),a.fillText(C.text,F+C.x,P+E.baseline)}a.restore()}function Pa(a,n,l,s,c,t=1){let u=Math.min(Math.max(1,t),4096/Math.max(1,l,s)),m=Math.max(1,Math.ceil(l*u)),g=Math.max(1,Math.ceil(s*u));a.width!==m&&(a.width=m),a.height!==g&&(a.height=g);let h=a.getContext("2d");h.setTransform(1,0,0,1,0,0),h.clearRect(0,0,m,g),h.save(),h.scale(m/(l>0?l:1),g/(s>0?s:1)),$n(h,n,l,s,c),h.restore()}function Ea(a){return function({item:l,zoom:s,fontFamily:c}){let t=a.useRef(null),u=!!l.textLayout?.richLines;return a.useLayoutEffect(()=>{u&&t.current&&Pa(t.current,l,l.width,l.height,c,Math.min(2,window.devicePixelRatio||1)*s)},[l,s,c,u]),u?a.createElement("canvas",{ref:t,className:"qxsim-rich-text",role:"img","aria-label":l.textLayout.lines.join(`
|
|
2
|
+
`),style:{position:"absolute",left:0,top:0,width:"100%",height:"100%"}}):a.createElement("span",{style:On(l,s,c)},Tn(l))}}function Tn(a){let n=a.textLayout;return n?n.lines.slice(0,n.visibleLineCount??n.lines.length).join(`
|
|
3
|
+
`):a.text??""}function On(a,n,l){let s=a.textLayout;return{flex:"0 0 auto",width:`${(s?.textWidth??Math.max(0,a.width-4))*n}px`,margin:`0 ${2*n}px`,whiteSpace:"pre",fontFamily:l||Pe,fontSize:`${(s?.fontSize??a.fontSize??20)*n}px`,lineHeight:`${(s?.lineHeight??(a.fontSize??20)*1.2)*n}px`,textAlign:a.horizontalAlignment==="Right"?"right":a.horizontalAlignment==="Middle"?"center":"left"}}var Fn=Object.freeze(["KEYBOARD","TOUCHSCREEN","CONTROLLER_CONSOLE","CONTROLLER_MOBILE"]),zn=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"}});var Ai=Object.freeze({KEYBOARD:"pc-16-9",TOUCHSCREEN:"mobile-16-9",CONTROLLER_CONSOLE:"pc-16-9",CONTROLLER_MOBILE:"mobile-16-9"}),Pi=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"]),Li=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}),Mi=Object.freeze({100001:"rect",100002:"circle",100003:"triangle",100004:"fourstar",100005:"fivestar",100006:"ring"});var $i=Object.freeze({font:4294967295,bg:16777215,outline:858993459,image:4294967295});function $t(a){let n=a.a*a.d-a.b*a.c;return!Number.isFinite(n)||Math.abs(n)<1e-8?null:{a:a.d/n,b:-a.b/n,c:-a.c/n,d:a.a/n,tx:(a.c*a.ty-a.d*a.tx)/n,ty:(a.b*a.tx-a.a*a.ty)/n}}function Un(a,n,l){let s=(c,t)=>c<=0?0:!(t>0)||c>=t?1:c/t;return Math.min(s(a+l.width/2,l.featherX),s(l.width/2-a,l.featherX),s(n+l.height/2,l.featherY),s(l.height/2-n,l.featherY))}function La(a){let n={children:[]},l=[n],s=[];for(let c of a||[]){if(!c||c.id==null)continue;let t=c.masks||[],u=t.map(g=>JSON.stringify([g.id,g.matrix,g.width,g.height,g.featherX,g.featherY])),m=0;for(;m<s.length&&m<u.length&&s[m]===u[m];)m++;l.length=m+1;for(let g=m;g<t.length;g++){let h={mask:t[g],children:[]};l.at(-1).children.push(h),l.push(h)}l.at(-1).children.push({item:c}),s=u}return n.children}function Ma(a,n){let l=Math.max(1,a.width),s=Math.max(1,a.height),c=a.getContext("2d"),t=c.createImageData(l,s),u=t.data;for(let m=0;m<s;m+=1){let g=n.height/2-(m+.5)*n.height/s;for(let h=0;h<l;h+=1){let x=-n.width/2+(h+.5)*n.width/l,b=Math.round(255*Un(x,g,n)),N=(m*l+h)*4;u[N]=255,u[N+1]=255,u[N+2]=255,u[N+3]=b}}return c.putImageData(t,0,0),a}function $a(a){let n=a.createElement;function l({mask:s,canvasWidth:c,canvasHeight:t,children:u}){let{width:m,height:g,featherX:h,featherY:x,matrix:b}=s,N=a.useMemo(()=>{if(!(m>0&&g>0)||!(h>0||x>0))return"";let R=document.createElement("canvas"),M=Math.min(2,2048/Math.max(m,g));return R.width=Math.max(1,Math.ceil(m*M)),R.height=Math.max(1,Math.ceil(g*M)),Ma(R,s),R.toDataURL("image/png")},[m,g,h,x]);if(!(m>0&&g>0)||!$t(b))return null;let E=b.tx-b.a*m/2+b.c*g/2,P=t-b.ty+b.b*m/2-b.d*g/2,F=`matrix(${b.a} ${-b.b} ${-b.c} ${b.d} ${E} ${P})`,C=N?`<image width="${m}" height="${g}" preserveAspectRatio="none" href="${N}" transform="${F}"/>`:`<rect width="${m}" height="${g}" fill="white" transform="${F}"/>`,I=`<svg xmlns="http://www.w3.org/2000/svg" width="${c}" height="${t}" viewBox="0 0 ${c} ${t}">${C}</svg>`;return n("div",{className:"qxsim-mask-group","data-mask-id":s.id,style:{position:"absolute",inset:0,pointerEvents:"none",maskImage:`url("data:image/svg+xml,${encodeURIComponent(I)}")`,maskMode:"alpha",maskSize:"100% 100%",maskRepeat:"no-repeat"}},u)}return function({boxes:c,canvasWidth:t,canvasHeight:u,renderControl:m}){let g=h=>h.map(x=>x.item?m(x.item):n(l,{key:`mask:${x.mask.id}`,mask:x.mask,canvasWidth:t,canvasHeight:u},g(x.children)));return g(La(c))}}function nt(a){let n=Number(a);return Number.isSafeInteger(n)&&n>=1073741824&&n<=1077936127}var Tt;function Ta(){return Tt||=Dn().catch(a=>{throw Tt=null,a}),Tt}async function Dn(){let a={cache:"no-store",credentials:"same-origin",mode:"same-origin",signal:AbortSignal.timeout(1e4)},n=await fetch(`${Lt}/manifest`,a);if(!n.ok)throw new Error("\u65E0\u6CD5\u8BFB\u53D6\u672C\u5730\u5B57\u4F53\u914D\u7F6E\uFF0C\u8BF7\u68C0\u67E5\u5BBF\u4E3B\u914D\u7F6E\u53CA\u672C\u673A\u8FDE\u63A5");let{id:l,scope:s="all"}=await n.json();if(l===null)return null;if(typeof l!="string"||!/^[a-f0-9]{64}$/.test(l))throw new Error("\u672C\u5730\u5B57\u4F53\u6807\u8BC6\u65E0\u6548");let c=await fetch(`${Lt}/file/${l}`,a);if(!c.ok)throw new Error("\u672C\u5730\u5B57\u4F53\u52A0\u8F7D\u5931\u8D25\uFF0C\u8BF7\u91CD\u542F\u5BBF\u4E3B\u5E76\u5237\u65B0\u9875\u9762");let t=await c.arrayBuffer();if(!t.byteLength||t.byteLength>33554432)throw new Error("\u672C\u5730\u5B57\u4F53\u5927\u5C0F\u65E0\u6548");let u=new FontFace(Mt(l),t);await u.load(),document.fonts.add(u);let m=Na(l),g="qxqy-local-font-style",h=document.getElementById(g);return s==="game"?h?.remove():(h||(h=document.createElement("style"),h.id=g,document.head.appendChild(h)),h.textContent=`[data-qxqy-font-ui], [data-qxqy-font-ui] * { font-family: ${m} !important; }`),m}var Rn="/qxqy-font/settings";async function Oa(a){let n=await fetch(Rn,{credentials:"same-origin",mode:"same-origin",cache:"no-store",signal:AbortSignal.timeout(1e4),...a?{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(a)}:{}});if(n.status===404)throw new Error("\u5F53\u524D\u540E\u53F0\u5C1A\u672A\u52A0\u8F7D\u5B57\u4F53\u8BBE\u7F6E\u529F\u80FD\uFF0C\u8BF7\u91CD\u542F Web \u6216 Harness \u5BBF\u4E3B\u540E\u91CD\u8BD5\u3002");if(!n.ok)throw new Error(await n.text()||e("\u65E0\u6CD5\u8BFB\u53D6\u5B57\u4F53\u8BBE\u7F6E"));return n.json()}function Fa(a){let n=a.createElement;return function({onClose:s}){let[c,t]=a.useState(null),[u,m]=a.useState("auto"),[g,h]=a.useState(""),[x,b]=a.useState("all"),[N,E]=a.useState(!1),[P,F]=a.useState(""),[C,I]=a.useState(""),[R,M]=a.useState(0);a.useEffect(()=>{let $=!0;return F(""),Oa().then(L=>{$&&(t(L),m(L.mode),b(L.scope||"all"),h(L.environmentPath||L.path||L.active.path||L.defaultPaths[0]||""))},L=>{$&&F(L.message)}),()=>{$=!1}},[R]);async function B($){$.preventDefault(),E(!0),F(""),I("");try{let L=await Oa(A?{scope:x}:{mode:u,path:g,scope:x});t(L);let Z=!A&&u==="auto"?L.nextFont.path?e`找到字体:${L.nextFont.path}。`:e("\u9ED8\u8BA4\u4F4D\u7F6E\u672A\u627E\u5230\u5B57\u4F53\uFF0C\u5C06\u4F7F\u7528\u7CFB\u7EDF\u5B57\u4F53\u3002"):"";I(e`已保存。${Z}重启 Web、MCP 或 Harness 宿主后,刷新编辑器及试玩页生效。`)}catch(L){F(L.message)}finally{E(!1)}}let A=!!c?.environmentPath;return n("div",{className:"qxsim-save-overlay",onKeyDown:$=>{$.key==="Escape"&&($.stopPropagation(),N||s())}},n("form",{className:"qxsim-save-dialog qxsim-font-dialog",role:"dialog","aria-modal":!0,"aria-label":e("\u5B57\u4F53\u8BBE\u7F6E"),onSubmit:B,style:{width:"min(680px, 94%)",maxHeight:"90%",overflow:"auto"}},n("h2",null,e("\u5B57\u4F53\u8BBE\u7F6E")),n("p",null,e("\u81EA\u5B9A\u4E49\u5B57\u4F53\u53EF\u7528\u4E8E\u6E38\u620F\u5185\u6587\u672C\u6216\u6574\u4F53 UI\u3002\u8BBE\u7F6E\u4EC5\u4FDD\u5B58\u5728\u672C\u673A\uFF0C\u91CD\u542F\u5BBF\u4E3B\u540E\u751F\u6548\u3002")),c?n(a.Fragment,null,n("p",{style:{overflowWrap:"anywhere"}},e`当前字体:${c.active.path||e("\u7CFB\u7EDF\u5B57\u4F53")}`),A?n("p",{role:"status"},e("\u5B57\u4F53\u6587\u4EF6\u7531\u73AF\u5883\u53D8\u91CF QXQY_FONT_PATH \u6307\u5B9A\uFF0C\u4ECD\u53EF\u8C03\u6574\u5E94\u7528\u8303\u56F4\u3002")):null,c.error?n("p",{role:"alert"},e(c.error)):null,n("label",{className:"qxsim-field"},e("\u5B57\u4F53\u6765\u6E90"),n("select",{autoFocus:!0,"aria-label":e("\u5B57\u4F53\u6765\u6E90"),value:u,disabled:N||A,onChange:$=>{m($.target.value),I("")}},n("option",{value:"auto"},e("\u81EA\u52A8\u5C1D\u8BD5\u539F\u795E\u7684\u9ED8\u8BA4\u5B89\u88C5\u4F4D\u7F6E")),n("option",{value:"custom"},e("\u6307\u5B9A\u672C\u673A\u5B57\u4F53\u6587\u4EF6")),n("option",{value:"system"},e("\u4F7F\u7528\u7CFB\u7EDF\u5B57\u4F53")))),u==="custom"||A?n("label",{className:"qxsim-field"},e("\u5B57\u4F53\u6587\u4EF6\u8DEF\u5F84"),n("input",{type:"text","aria-label":e("\u5B57\u4F53\u6587\u4EF6\u8DEF\u5F84"),value:g,required:u==="custom",disabled:N||A,spellCheck:!1,placeholder:c.defaultPaths[0]||"/path/to/font.ttf",onChange:$=>{h($.target.value),I("")}}),n("small",null,e("\u586B\u5199 TTF / OTF \u7684\u7EDD\u5BF9\u8DEF\u5F84\uFF0C\u6700\u5927 32 MiB\uFF1B\u53EF\u4EE5\u76F4\u63A5\u7C98\u8D34\u5E26\u5F15\u53F7\u7684 Windows \u8DEF\u5F84\u3002"))):null,u==="auto"&&!A?n("div",null,n("p",null,e("\u6309\u987A\u5E8F\u5C1D\u8BD5\u4EE5\u4E0B\u4F4D\u7F6E\uFF1B\u90FD\u672A\u627E\u5230\u65F6\u4F7F\u7528\u7CFB\u7EDF\u5B57\u4F53\u3002\u5B89\u88C5\u5728\u5176\u4ED6\u76D8\u7B26\u65F6\u8BF7\u9009\u62E9\u201C\u6307\u5B9A\u672C\u673A\u5B57\u4F53\u6587\u4EF6\u201D\u3002")),c.defaultPaths.length?n("ul",{style:{paddingLeft:20,overflowWrap:"anywhere"}},c.defaultPaths.map($=>n("li",{key:$},$))):n("p",null,e("\u5F53\u524D\u7CFB\u7EDF\u4E0D\u81EA\u52A8\u67E5\u627E\uFF0C\u8BF7\u6307\u5B9A\u5B57\u4F53\u6587\u4EF6\u3002"))):null,n("label",{className:"qxsim-field"},e("\u5E94\u7528\u8303\u56F4"),n("select",{"aria-label":e("\u5E94\u7528\u8303\u56F4"),value:x,disabled:N,onChange:$=>{b($.target.value),I("")}},n("option",{value:"game"},e("\u4EC5\u6E38\u620F\u5185\u6587\u672C")),n("option",{value:"all"},e("\u6574\u4F53 UI"))),n("small",null,e("\u4EC5\u6E38\u620F\u5185\u6587\u672C\uFF1A\u7528\u4E8E\u753B\u5E03\u3001\u8BD5\u73A9\u548C\u622A\u56FE\uFF1B\u6574\u4F53 UI\uFF1A\u540C\u65F6\u66FF\u6362\u5DE5\u5177\u680F\u3001\u9762\u677F\u3001\u4EE3\u7801\u548C\u65E5\u5FD7\u5B57\u4F53\u3002"))),c.restartRequired&&!C?n("p",{role:"status"},e("\u6709\u5DF2\u4FDD\u5B58\u7684\u5B57\u4F53\u8BBE\u7F6E\uFF0C\u91CD\u542F\u5BBF\u4E3B\u5E76\u5237\u65B0\u9875\u9762\u540E\u751F\u6548\u3002")):null):P?null:n("p",null,e("\u6B63\u5728\u8BFB\u53D6\u8BBE\u7F6E\u2026")),P?n("p",{role:"alert"},e(P)):null,P&&!c?n("button",{type:"button",className:"qxsim-action",onClick:()=>M($=>$+1)},e("\u91CD\u8BD5")):null,C?n("p",{role:"status",style:{overflowWrap:"anywhere"}},C):null,n("footer",null,n("button",{type:"button",className:"qxsim-action",disabled:N,onClick:s},e("\u5173\u95ED")),n("button",{type:"submit",className:"qxsim-action primary",disabled:N||!c},N?e("\u4FDD\u5B58\u4E2D\u2026"):e("\u4FDD\u5B58\u8BBE\u7F6E")))))}}var Ot="https://github.com/1475505/miliastra-beyond-simulator";function za(a){let n=a.createElement,l=Ze(a);function s({title:c,children:t,onClose:u}){let m=a.useRef(null);return a.useEffect(()=>{let g=document.activeElement;return m.current.showModal(),()=>{m.current?.close(),g?.focus?.()}},[]),n("dialog",{ref:m,className:"qxsim-modal","aria-label":c,onCancel:g=>{g.preventDefault(),u()}},n("h2",null,c),t,n("footer",null,n("button",{className:"qxsim-action",onClick:u},e("\u5173\u95ED"))))}return function({request:t,version:u}){l();let[m,g]=a.useState(""),[h,x]=a.useState(!1),[b,N]=a.useState(null),[E,P]=a.useState("");async function F(){g("updates"),x(!0),P(""),N(null);try{N(await t("updates"))}catch(I){P(/^unknown (?:editor )?action\b/i.test(I?.message||"")?"\u5F53\u524D\u540E\u53F0\u5C1A\u672A\u52A0\u8F7D\u68C0\u67E5\u66F4\u65B0\u529F\u80FD\uFF0C\u8BF7\u91CD\u542F Web \u6216 Harness \u5BBF\u4E3B\u540E\u91CD\u8BD5\u3002":"\u68C0\u67E5\u66F4\u65B0\u5931\u8D25\uFF0C\u8BF7\u68C0\u67E5\u7F51\u7EDC\u8FDE\u63A5\u540E\u91CD\u8BD5\u3002")}finally{x(!1)}}let C={available:e("\u53D1\u73B0\u65B0\u7248\u672C"),current:e("\u5F53\u524D\u5DF2\u662F\u6700\u65B0\u7248\u672C"),ahead:e("\u5F53\u524D\u7248\u672C\u6BD4\u516C\u5F00\u7248\u672C\u66F4\u65B0"),unavailable:e("\u6682\u672A\u627E\u5230\u6B64\u5B89\u88C5\u5305\u7684\u6B63\u5F0F\u7248\u672C")};return n(a.Fragment,null,n("footer",{className:"qxsim-footer"},u?n("span",{className:"qxsim-muted"},`v${u}`):null,n("span",{className:"spacer"}),n("button",{onClick:F,disabled:h},h?e("\u6B63\u5728\u68C0\u67E5\u66F4\u65B0\u2026"):e("\u68C0\u67E5\u66F4\u65B0")),n("a",{href:"https://space.bilibili.com/23358791",target:"_blank",rel:"noreferrer"},e("\u4F5C\u8005B\u7AD9")),n("button",{onClick:()=>g("contact")},e("\u8054\u7CFB\u4F5C\u8005"))),m==="contact"?n(s,{title:e("\u8054\u7CFB\u4F5C\u8005"),onClose:()=>g("")},n("div",null,n("p",null,e("QQ\u7FA4\u53F71007538100")),n("p",null,e("\u4F5C\u8005\u90AE\u7BB1 "),n("a",{href:"mailto:725230880@qq.com"},"725230880@qq.com")),n("p",null,e("\u5F00\u6E90\u4ED3\u5E93 "),n("a",{href:Ot,target:"_blank",rel:"noreferrer"},Ot)))):null,m==="updates"?n(s,{title:e("\u68C0\u67E5\u66F4\u65B0"),onClose:()=>g("")},n("div",{role:"status"},h?n("p",null,e("\u6B63\u5728\u68C0\u67E5\u66F4\u65B0\u2026")):null,E?n("p",{role:"alert"},e(E)):null,!h&&!E&&b?n(a.Fragment,null,n("p",null,e(C[b.status])),n("p",null,e`当前版本:${b.currentVersion}`),b.latestVersion?n("p",null,e`公开版本:${b.latestVersion}`):null,n("p",null,e("\u66F4\u65B0\u540E\u8BF7\u91CD\u542F\u5BBF\u4E3B\u5E76\u5237\u65B0\u7F16\u8F91\u5668\u4E0E\u8BD5\u73A9\u9875\u3002")),n("a",{href:b.url,target:"_blank",rel:"noreferrer"},e("\u67E5\u770B\u66F4\u65B0\u8BF4\u660E")),b.status==="available"&&b.downloadUrl?n("p",null,n("a",{href:b.downloadUrl,target:"_blank",rel:"noreferrer"},e("\u4E0B\u8F7D\u66F4\u65B0\u5305"))):null):null,E?n(a.Fragment,null,n("button",{className:"qxsim-action",onClick:F,disabled:h},e("\u91CD\u8BD5")),n("p",null,n("a",{href:Ot+"/releases",target:"_blank",rel:"noreferrer"},e("\u67E5\u770B\u66F4\u65B0\u8BF4\u660E")))):null)):null)}}function Ua(a,{api:n,playUrl:l,saveToWorkspace:s=!1,version:c=""}){let t=a.createElement,u=oa(a),m=ra(a),g=sa(a),h=wa(a),x=Ea(a),b=$a(a),N=Sa(a),E=Ca(a),P=Fa(a),F=za(a),C=Ze(a),I="qxqy-simulator-style",R=`
|
|
2
4
|
.qxsim-save-overlay{position:absolute;inset:0;z-index:30;display:grid;place-items:center;background:#0006}.qxsim-save-dialog{width:min(440px,90%);padding:24px;border:1px solid var(--line);border-radius:12px;background:var(--panel);box-shadow:0 12px 48px #0005}.qxsim-save-dialog h2{margin:0 0 16px;font-size:17px}.qxsim-save-dialog input{width:100%;margin:8px 0 16px;padding:10px;border:1px solid var(--line);border-radius:6px;background:var(--input)}.qxsim-save-dialog footer{display:flex;justify-content:flex-end;gap:8px}.qxsim-save-dialog [role=alert]{color:var(--danger);margin-bottom:12px;overflow-wrap:anywhere}
|
|
3
5
|
.qxsim-play-overlay{position:fixed;inset:0;width:100%;height:100%;max-width:none;max-height:none;margin:0;padding:0;border:0;background:var(--bg);color:var(--text)}.qxsim-play-overlay[open]{display:flex;flex-direction:column}.qxsim-play-overlay::backdrop{background:#0008}.qxsim-play-header{display:flex;align-items:center;justify-content:space-between;flex-shrink:0;gap:12px;padding:4px 12px;border-bottom:1px solid var(--line);background:var(--panel)}.qxsim-play-overlay iframe{display:block;flex:1;width:100%;min-height:0;border:0;background:var(--bg)}.qxsim-play-error{padding:8px 12px;color:var(--danger);overflow-wrap:anywhere}html[data-windows-titlebar] .qxsim-play-overlay{top:40px;height:calc(100% - 40px)}
|
|
6
|
+
.qxsim-footer{display:flex;align-items:center;gap:12px;flex-shrink:0;min-height:32px;padding:4px 10px;border-top:1px solid var(--line);background:var(--panel);font-size:11px}.qxsim-footer .spacer{flex:1}.qxsim-footer button{border:0;background:transparent;color:var(--muted);font:inherit;cursor:pointer}.qxsim-footer a,.qxsim-modal a{color:var(--blue);text-decoration:none}.qxsim-footer button:hover,.qxsim-footer a:hover{color:var(--blue);text-decoration:underline}.qxsim-modal{width:min(620px,94vw);max-height:90vh;overflow:auto;border:1px solid var(--line);border-radius:10px;padding:24px;background:var(--panel);color:var(--text);font:inherit;box-shadow:0 16px 60px #0006}.qxsim-modal::backdrop{background:#0008}.qxsim-modal h2{margin:0 0 16px;font-size:17px}.qxsim-modal p{overflow-wrap:anywhere;line-height:1.6}.qxsim-modal footer{display:flex;justify-content:flex-end;margin-top:20px}
|
|
4
7
|
.qxsim{--blue:#477cf0;--danger:#e75a6a;position:relative;display:flex;flex:1 1 0;align-self:stretch;flex-direction:column;width:100%;height:100%;min-width:0;min-height:0;max-height:none;container-type:inline-size;color:var(--text);background:var(--bg);font:13px/1.4 Inter,"Microsoft YaHei UI","Microsoft YaHei",sans-serif;overflow:hidden;color-scheme:inherit}
|
|
5
8
|
.qxsim[data-theme=dark]{--bg:#20242e;--panel:#181d27;--panel2:#202632;--input:#151b25;--line:#363e4d;--lineSoft:#2b3240;--text:#edf1f7;--muted:#929baa;--hover:#252c37;--workspace:#383d47;--toolbarA:#242a35;--toolbarB:#1e232d;--status:#242a33;--button:#1d2430;--shadow:#0004}
|
|
6
9
|
.qxsim[data-theme=light]{--bg:#f5f6f8;--panel:#fff;--panel2:#f4f6f8;--input:#fff;--line:#d6dbe3;--lineSoft:#e7e9ed;--text:#20242a;--muted:#69717d;--hover:#eef1f5;--workspace:#d9dde3;--toolbarA:#fff;--toolbarB:#f3f5f8;--status:#f7f8fa;--button:#f7f8fa;--shadow:#18203318}
|
|
7
10
|
.qxsim *{box-sizing:border-box}.qxsim button,.qxsim input,.qxsim textarea,.qxsim select{font:inherit;color:inherit}.qxsim button{cursor:pointer}.qxsim button:disabled{opacity:.42;cursor:default}
|
|
8
11
|
.qxsim-toolbar{height:50px;flex:0 0 50px;display:grid;grid-template-columns:minmax(190px,1fr) auto minmax(280px,1fr);align-items:center;padding:0 10px;border-bottom:1px solid var(--line);background:linear-gradient(180deg,var(--toolbarA),var(--toolbarB));box-shadow:0 1px 8px var(--shadow);z-index:3}.qxsim-brand,.qxsim-toolbar-center,.qxsim-actions{display:flex;align-items:center}.qxsim-brand{gap:8px;min-width:0}.qxsim-appicon{width:26px;height:26px;display:grid;place-items:center;border:1px solid var(--line);border-radius:5px;font-size:11px;background:var(--input)}.qxsim-brand-text{min-width:0}.qxsim-brand-text strong,.qxsim-brand-text span{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.qxsim-brand-text strong{font-size:13px}.qxsim-brand-text span{color:var(--muted);font-size:10px}.qxsim-toolbar-center{gap:6px}.qxsim-actions{justify-content:flex-end;gap:6px}.qxsim-io{display:flex;align-items:center;gap:4px;padding-right:6px;margin-right:2px;border-right:1px solid var(--line)}
|
|
9
|
-
.qxsim-editor-nav{height:40px;flex:0 0 40px;display:flex;align-items:stretch;padding:0 10px;border-bottom:1px solid var(--line);background:var(--panel)}.qxsim-editor-nav button{min-width:116px;padding:0 18px;border:0;border-bottom:2px solid transparent;background:transparent;color:var(--muted);font-weight:650}.qxsim-editor-nav button.active{border-bottom-color:var(--blue);color:var(--text);background:color-mix(in srgb,var(--blue) 8%,transparent)}.qxsim-editor-nav .save-summary{
|
|
12
|
+
.qxsim-editor-nav{height:40px;flex:0 0 40px;display:flex;align-items:stretch;padding:0 10px;border-bottom:1px solid var(--line);background:var(--panel);overflow-x:auto}.qxsim-editor-nav button{flex:0 0 auto;min-width:116px;padding:0 18px;border:0;border-bottom:2px solid transparent;background:transparent;color:var(--muted);font-weight:650;white-space:nowrap}.qxsim-editor-nav button.active{border-bottom-color:var(--blue);color:var(--text);background:color-mix(in srgb,var(--blue) 8%,transparent)}.qxsim-editor-nav .save-summary{min-width:0;align-self:center;margin-left:auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--muted);font-size:10px}
|
|
13
|
+
.qxsim-editor-settings{display:flex;align-items:center;flex:0 0 auto;gap:6px;margin-left:auto;padding-left:10px}.qxsim-editor-settings button{min-width:0;height:32px;padding:0 10px}.qxsim-editor-settings .qxsim-language{width:210px;min-width:0;max-width:24cqi;text-overflow:ellipsis}.qxsim-language option{background:var(--panel);color:var(--text)}
|
|
10
14
|
.qxsim-control,.qxsim-iconbtn,.qxsim-action{height:32px;border:1px solid var(--line);background:var(--input);border-radius:6px}.qxsim-control{min-width:156px;padding:0 28px 0 9px}.qxsim-control.zoom{min-width:78px}.qxsim-iconbtn{width:32px}.qxsim-action{display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:0 11px;white-space:nowrap}.qxsim-action.primary{color:#fff;border-color:#3265d8;background:linear-gradient(#5388fa,#376ad8)}.qxsim-action.danger{color:var(--danger)}.qxsim-action:hover,.qxsim-iconbtn:hover{border-color:var(--blue);background:var(--hover)}
|
|
11
15
|
.qxsim-main{position:relative;display:grid;grid-template-columns:clamp(220px,17cqi,280px) minmax(360px,1fr) clamp(310px,22cqi,356px);flex:1;min-height:0}.qxsim-tree,.qxsim-inspector{min-height:0;background:var(--panel)}.qxsim-tree{display:flex;flex-direction:column;border-right:1px solid var(--line)}.qxsim-inspector{display:flex;flex-direction:column;border-left:1px solid var(--line)}.qxsim-pane-head{height:44px;flex:0 0 44px;display:flex;align-items:center;justify-content:space-between;gap:8px;padding:6px 10px;border-bottom:1px solid var(--lineSoft)}.qxsim-pane-title{font-weight:650;font-size:13px}.qxsim-muted{color:var(--muted);font-size:10px}.qxsim-asset-switch{display:grid;grid-template-columns:1fr 1fr;gap:3px;margin:8px 8px 0;padding:3px;border:1px solid var(--line);border-radius:18px;background:var(--input)}.qxsim-asset-switch button{height:29px;min-width:0;border:0;border-radius:15px;background:transparent;color:var(--muted);font-weight:600;white-space:nowrap}.qxsim-asset-switch button.active{color:#fff;background:linear-gradient(#4f86ff,#3c6ed8);box-shadow:0 2px 7px #1d4b9f55}.qxsim-template-tag{padding:1px 5px;border:1px solid currentColor;border-radius:8px;color:#9cc2ff;font-size:9px}.qxsim-template-id{color:var(--muted);font:9px ui-monospace,Consolas,monospace}.qxsim-palette-head{display:flex;align-items:center;justify-content:space-between;gap:4px;margin:0 0 4px;color:var(--muted);font-size:10px}.qxsim-palette-head>span:first-child{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.qxsim-add-mode{display:flex;flex:0 0 auto;gap:2px;padding:1px;border:1px solid var(--line);border-radius:10px;background:var(--input)}.qxsim-add-mode button{height:18px;padding:0 6px;border:0;border-radius:8px;background:transparent;color:var(--muted);font-size:9px}.qxsim-add-mode button.active{color:var(--text);background:var(--hover)}
|
|
12
16
|
.qxsim-search{height:32px;margin:8px;display:flex;align-items:center;gap:7px;padding:0 9px;border:1px solid var(--line);border-radius:16px;background:var(--input);color:var(--muted)}.qxsim-search input{min-width:0;flex:1;border:0;outline:0;background:transparent}.qxsim-search button{border:0;background:transparent;color:var(--muted)}.qxsim-tree-scroll{flex:1;min-height:0;overflow:auto;padding:3px 6px 8px}.qxsim-row{position:relative;height:32px;display:flex;align-items:center;gap:6px;padding-right:7px;border:1px solid transparent;border-radius:4px;cursor:pointer;white-space:nowrap;overflow:hidden}.qxsim-row.template-root{height:38px;margin-top:5px;border-top-color:var(--lineSoft);background:color-mix(in srgb,var(--blue) 5%,transparent)}.qxsim-row.template-root:first-child{margin-top:0}.qxsim-row:not(.template-root):before{content:"";position:absolute;left:13px;top:-6px;bottom:16px;border-left:1px solid var(--lineSoft);pointer-events:none}.qxsim-row:hover{background:var(--hover)}.qxsim-row.active{background:linear-gradient(90deg,#3569cf,#315a9f);border-color:#4d7ee4;color:#fff}.qxsim-chevron{width:9px;color:var(--muted);font-size:9px}.qxsim-kind{width:19px;height:19px;display:inline-grid;place-items:center;flex:0 0 19px;border:1px solid currentColor;border-radius:3px;font-size:9px}.qxsim-row-label{min-width:0;overflow:hidden;text-overflow:ellipsis}.qxsim-row-end{margin-left:auto;display:flex;align-items:center;gap:4px;flex:0 0 auto}.qxsim-row.canvas-hidden .qxsim-row-label{opacity:.45}.qxsim-eye{width:20px;height:20px;display:grid;place-items:center;border:0;border-radius:4px;background:transparent;color:var(--muted);font-size:12px;line-height:1}.qxsim-eye:hover{background:var(--hover);color:var(--text)}.qxsim-row.active .qxsim-eye{color:#d7e6ff}.qxsim-row.active .qxsim-eye:hover{background:#ffffff24;color:#fff}.qxsim-eye.off{opacity:.55}.qxsim-incomplete{color:#e4a743;font-size:9px}.qxsim-tree-foot{flex:0 0 auto;padding:5px;border-top:1px solid var(--lineSoft)}.qxsim-hierarchy{margin-bottom:5px;padding:5px;border:1px solid var(--line);border-radius:6px;background:color-mix(in srgb,var(--input) 78%,transparent)}.qxsim-hierarchy-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:3px;font-size:10px}.qxsim-hierarchy-head strong{font-weight:650}.qxsim-hierarchy-head span{max-width:120px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--muted)}.qxsim-parent-row{display:grid;grid-template-columns:minmax(0,1fr) 24px 24px;gap:3px}.qxsim-parent-row select,.qxsim-parent-row button{height:24px;min-width:0;border:1px solid var(--line);border-radius:4px;background:var(--button)}.qxsim-parent-row select{padding:0 5px}.qxsim-hierarchy-note{margin-top:3px;color:var(--muted);font-size:9px;line-height:1.3}.qxsim-add{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:3px}.qxsim-add button{height:22px;padding:0 4px;border:1px solid var(--line);border-radius:4px;background:var(--button);color:var(--muted);font-size:11px;line-height:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.qxsim-add button:hover{color:var(--text);border-color:var(--blue)}
|
|
@@ -24,7 +28,7 @@
|
|
|
24
28
|
@container(max-width:1180px){.qxsim-toolbar{grid-template-columns:minmax(130px,1fr) auto auto;column-gap:8px}.qxsim-action{padding:0 8px}.qxsim-main{grid-template-columns:200px minmax(300px,1fr) 292px}.qxsim-control{min-width:132px}.qxsim-control.ratio{width:128px}.qxsim-io .qxsim-control{width:96px}.qxsim-device-switch button{padding:0 7px}.qxsim-workspace{padding-left:12px;padding-right:12px}.qxsim-brand-text span{display:none}.qxsim-asset-switch button{font-size:11px}}
|
|
25
29
|
@container(max-width:1000px){.qxsim-toolbar{height:90px;flex-basis:90px;grid-template-columns:minmax(0,1fr) auto;grid-template-rows:42px 42px}.qxsim-toolbar-center{justify-self:end}.qxsim-actions{grid-column:1 / -1}.qxsim-editor-nav .save-summary{display:none}.qxsim-inspector{top:130px}}
|
|
26
30
|
@container(max-width:820px){.qxsim-main{grid-template-columns:180px minmax(280px,1fr)}.qxsim-inspector{position:absolute;right:0;top:0;bottom:0;width:285px;z-index:5;box-shadow:-10px 0 24px var(--shadow)}.qxsim-script-page{grid-template-columns:190px minmax(320px,1fr)}.qxsim-script-editor{padding:12px}.qxsim-script-fields{grid-template-columns:1fr}}
|
|
27
|
-
`,L={"server-container":["\u25A3","\u5BA2\u6237\u7AEF\u63A7\u4EF6\u5BB9\u5668"],container:["\u25A1","\u5BB9\u5668\u8282\u70B9"],textbox:["T","\u6587\u672C\u6846"],cursor:["\u2301","\u5149\u6807\u68C0\u6D4B\u533A\u57DF"],reference:["\u2197","\u6A21\u677F\u5F15\u7528\u63A7\u4EF6"],grid:["\u25A6","\u7F51\u683C\u89C6\u7A97"],image:["\u25A7","\u56FE\u7247"],button:["Btn","\u9884\u8BBE\u6309\u94AE"],textwindow:["T\u2195","\u6587\u672C\u89C6\u7A97"],keyhint:["1","\u6309\u952E\u63D0\u793A"],animation:["\u2726","\u754C\u9762\u52A8\u6548"],fullscreen:["\u2725","\u5168\u5C4F\u52A8\u6548"]},E=[["container","\u5BB9\u5668\u8282\u70B9"],["textbox","\u6587\u672C\u6846"],["cursor","\u5149\u6807\u68C0\u6D4B"],["reference","\u6A21\u677F\u5F15\u7528"],["grid","\u7F51\u683C\u89C6\u7A97"],["button","\u9884\u8BBE\u6309\u94AE"],["textwindow","\u6587\u672C\u89C6\u7A97"],["keyhint","\u6309\u952E\u63D0\u793A"],["image","\u56FE\u7247"],["animation","\u754C\u9762\u52A8\u6548"],["fullscreen","\u5168\u5C4F\u52A8\u6548"]],B={container:["isolateNavigation","disableKeyEventPassthrough","disableCursorEventPassthrough","showCursor"],textbox:["fontSize","adaptiveFontSize","minimumFontSize","fontColor","bgColor","enableOutline","outlineColor","horizontalAlignment","verticalAlignment","text"],cursor:[],reference:["referencedPrefabId"],grid:["itemPrefabId","raycastTarget","interactable","showScrollBar","scrollDirection","layoutConstraint","layoutConstraintFixedCount","cellSizeX","cellSizeY","spacingX","spacingY","padding1X","padding1Y","padding2X","padding2Y","previewCount"],image:["imageSource","imageId","imageColor","enableMask","enableSoftEdge","softEdgeMode","softEdgeWidthX","softEdgeWidthY","horizontalSoftRange","verticalSoftRange","enableFill","fillType","fillHorizontalType","fillVerticalType","fillRadial90Type","fillRadialType","fillAmount","reverseMaskArea"],button:["raycastTarget","interactable","unavailableChildId","hoverChildId","pressedChildId","selectedChildId","clickAudioId"],textwindow:["interactable","showScrollBar","fontSize","adaptiveFontSize","minimumFontSize","fontColor","bgColor","enableOutline","outlineColor","horizontalAlignment","verticalAlignment","text"],keyhint:["keyboardKeyCode","controllerKeyCode"],animation:["animationId"],fullscreen:["animationId"]};function q(){if(document.getElementById(I))return;let a=document.createElement("style");a.id=I,a.textContent=A,document.head.appendChild(a)}function C(){let a=document.documentElement,l=document.body,r=[a.dataset.theme,a.className,a.getAttribute("style"),l?.dataset?.theme,l?.className,l?.getAttribute("style"),getComputedStyle(a).colorScheme].filter(Boolean).join(" ").toLowerCase();return r.includes("dark")?"dark":r.includes("light")?"light":window.matchMedia?.("(prefers-color-scheme: dark)").matches?"dark":"light"}function _(){let[a,l]=t.useState(C);return t.useEffect(()=>{let r=()=>l(C()),s=new MutationObserver(r);s.observe(document.documentElement,{attributes:!0,attributeFilter:["class","style","data-theme"]}),document.body&&s.observe(document.body,{attributes:!0,attributeFilter:["class","style","data-theme"]});let d=window.matchMedia?.("(prefers-color-scheme: dark)");return d?.addEventListener?.("change",r),()=>{s.disconnect(),d?.removeEventListener?.("change",r)}},[]),a}function S(a,l){let r=Number(a??l)>>>0;return`rgba(${r>>>16&255},${r>>>8&255},${r&255},${(r>>>24&255)/255})`}function H(a,l){return a==="sprite"?{background:"transparent"}:a==="circle"?{borderRadius:"50%",background:l}:a==="ring"?{borderRadius:"50%",border:`7px solid ${l}`,background:"transparent"}:a==="triangle"?{background:l,clipPath:"polygon(50% 0,100% 100%,0 100%)"}:a==="fourstar"?{background:l,clipPath:"polygon(50% 0,62% 38%,100% 50%,62% 62%,50% 100%,38% 62%,0 50%,38% 38%)"}:a==="fivestar"?{background:l,clipPath:"polygon(50% 0,61% 35%,98% 35%,68% 57%,79% 91%,50% 70%,21% 91%,32% 57%,2% 35%,39% 35%)"}:a==="missing"?{background:"#4822285c",border:"1px dashed #ff7481"}:{background:l}}let g=n;function j(a){let l;try{l=atob(a.data)}catch{throw new Error("\u5BFC\u51FA\u5185\u5BB9\u89E3\u7801\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5\u6216\u5237\u65B0\u9875\u9762")}let r=new Uint8Array(l.length);for(let p=0;p<l.length;p+=1)r[p]=l.charCodeAt(p);let s=URL.createObjectURL(new Blob([r],{type:a.mimeType||"application/octet-stream"})),d=document.createElement("a");d.href=s,d.download=a.filename||"qxqy-export",d.rel="noopener",d.style.display="none",document.body.appendChild(d),d.click(),d.remove(),setTimeout(()=>URL.revokeObjectURL(s),1e3)}async function M(a){let l=new Uint8Array(await a.arrayBuffer()),r="",s=32768;for(let d=0;d<l.length;d+=s)r+=String.fromCharCode(...l.subarray(d,d+s));return btoa(r)}let R=a=>typeof a=="object"?a.value:a,F=a=>typeof a=="object"?a.label:a,K=[{key:"KEYBOARD",label:"PC",title:"PC KEYBOARD \u753B\u5E03\uFF1A1600\xD7900 / 2100\xD7900"},{key:"TOUCHSCREEN",label:"\u624B\u673A",title:"\u624B\u673A TOUCHSCREEN \u753B\u5E03\uFF1A1280\xD7720 / 1560\xD7720 / 1280\xD7960"}];function ae(a){return String(a.id||"").split("-").slice(1).join(":")}function le(a,l){let r=(d,p)=>p?r(p,d%p):d,s=r(Math.round(a),Math.round(l))||1;return`${Math.round(a)/s}:${Math.round(l)/s}`}function V({field:a,commit:l,axis:r}){let s=a.value==null?"":String(a.value),[d,p]=t.useState(s);if(t.useEffect(()=>p(a.value==null?"":String(a.value)),[a.value,a.type]),a.type==="note")return e("div",{className:"qxsim-note"},a.value||a.label);if(a.readonly&&(a.evidence==="N"||a.evidence==="U"))return e("div",{className:"qxsim-field"},e("span",{className:"qxsim-field-label"},a.label),e("div",{className:"qxsim-unsupported"},a.value==null?"\u5C1A\u65E0\u53EF\u7F16\u8F91\u503C":String(a.value)));if(a.type==="bool")return e("div",{className:"qxsim-switch-row"},e("span",null,a.label),e("label",{className:"qxsim-switch"},e("input",{type:"checkbox",checked:!!a.value,disabled:!!a.readonly,onChange:m=>l(a.key,m.target.checked)}),e("span",{className:"qxsim-switch-track"})));if(a.type==="enum"){let m=[...a.options||[]],z=String(a.value??"");return m.some(W=>String(R(W))===z)||m.unshift({value:a.value??"",label:`\u672A\u8BC6\u522B\u9009\u9879 ${a.unknownValue??(z||"\u7A7A")}\uFF08\u4FDD\u7559\u539F\u503C\uFF09`}),e("label",{className:"qxsim-field"},e("span",{className:"qxsim-field-label"},a.label),e("select",{value:z,disabled:!!a.readonly,onChange:W=>l(a.key,W.target.value)},m.map(W=>e("option",{key:String(R(W)),value:R(W)},F(W)))))}if(a.type==="percent"){let m=Math.round(Number(a.value||0)*100);return e("label",{className:"qxsim-field"},e("span",{className:"qxsim-field-label"},a.label),e("span",{className:"qxsim-percent"},e("input",{type:"range",min:0,max:100,value:m,onInput:z=>l(a.key,Number(z.target.value)/100)}),e("output",null,`${m}%`)))}if(a.type==="color")return e(v,{field:a,commit:l});let w={value:d,disabled:!!a.readonly,readOnly:!!a.readonly,onChange:m=>p(m.target.value),onBlur:()=>{a.readonly||l(a.key,d)},onKeyDown:m=>{m.key==="Enter"&&a.type!=="text"&&m.currentTarget.blur(),m.key==="Escape"&&p(a.value==null?"":String(a.value))}};return e("label",{className:"qxsim-field"},e("span",{className:"qxsim-field-label"},r?e("b",{className:`qxsim-axis ${r.toLowerCase()}`},r):null,a.label),a.type==="text"?e("textarea",{...w,rows:4}):e("input",{...w,type:a.type==="number"?"number":"text",step:a.type==="number"?"any":void 0}))}function ee({title:a,open:l=!0,children:r}){return e("details",{className:"qxsim-section",open:l},e("summary",null,a),e("div",{className:"qxsim-section-body"},r))}function ce(a){let l={};for(let r of a||[])l[r.key]=r;return l}function Q({label:a,x:l,y:r,xAxis:s="X",yAxis:d="Y",commit:p}){return e("div",{className:"qxsim-pair"},e("div",{className:"qxsim-pair-name"},a),e(V,{field:l,axis:s,commit:p}),e(V,{field:r,axis:d,commit:p}))}function he({field:a,commit:l,createStateChild:r}){return e("div",{className:"qxsim-state-field"},e("div",{className:"qxsim-state-label"},a.label),e("div",{className:"qxsim-state-ref"},e("button",{title:`\u65B0\u5EFA\u5E76\u7ED1\u5B9A${a.label}\u56FE\u7247`,onClick:()=>r(a.key,a.label)},"+"),e("select",{value:String(a.value??""),"aria-label":a.label,onChange:s=>l(a.key,s.target.value)},(a.options||[]).map(s=>e("option",{key:String(R(s)),value:R(s)},F(s))))))}function me({inspector:a,commit:l,createStateChild:r}){let s=ce(a.fields),d=z=>z?.type==="node"?e(he,{key:z.key,field:z,commit:l,createStateChild:r}):z?e(V,{key:z.key,field:z,commit:l}):null,p=(B[a.kind]||[]).map(z=>s[z]).filter(Boolean).map(d),w=null;if(a.kind==="image"){let z=s.fillType?.value==="Horizontal"?s.fillHorizontalType:s.fillType?.value==="Vertical"?s.fillVerticalType:s.fillType?.value==="Radial90"?s.fillRadial90Type:s.fillRadialType,W=[d(s.enableMask),d(s.enableSoftEdge),s.enableSoftEdge?.value?e("div",{className:"qxsim-subfields",key:"soft-fields"},d(s.softEdgeMode),e(Q,{label:"\u7FBD\u5316\u5BBD\u5EA6",x:s.softEdgeWidthX,y:s.softEdgeWidthY,commit:l}),e(Q,{label:"\u7FBD\u5316\u8303\u56F4",x:s.horizontalSoftRange,y:s.verticalSoftRange,commit:l})):null,d(s.enableFill),s.enableFill?.value?e("div",{className:"qxsim-subfields",key:"fill-fields"},d(s.fillType),d(z),d(s.fillAmount)):null,d(s.reverseMaskArea)];w=e(t.Fragment,null,e(ee,{title:"\u56FE\u7247\u8BBE\u7F6E"},d(s.imageSource),d(s.imageId),e($,{imageId:s.imageId?.value,imageSource:s.imageSource?.value,value:s.imageType?.value,commit:l}),d(s.imageColor)),e(ee,{title:"\u906E\u7F69\u8BBE\u7F6E"},W))}let m=a.kind==="textbox"?"\u6587\u672C\u6846\u8BBE\u7F6E":a.kind==="button"?"\u6309\u94AE\u8BBE\u7F6E":`${a.label}\u8BBE\u7F6E`;return e(t.Fragment,null,e(ee,{title:"\u8282\u70B9\u4FE1\u606F",open:!1},e(V,{field:s.name,commit:l})),e(ee,{title:"\u53D8\u6362"},s.posX?e(Q,{label:"\u4F4D\u7F6E",x:s.posX,y:s.posY,commit:l}):null,s.width?e(Q,{label:"\u5927\u5C0F",x:s.width,y:s.height,xAxis:"W",yAxis:"H",commit:l}):null,...["rotationX","rotationY","rotationZ"].map(z=>s[z]?e(V,{key:z,field:s[z],commit:l}):null),s.syncAllDevices?e(V,{field:s.syncAllDevices,commit:l}):null,s.anchorType?e(V,{field:s.anchorType,commit:l}):null,s.anchorMinX?e(Q,{label:"Min",x:s.anchorMinX,y:s.anchorMinY,commit:l}):null,s.anchorMaxX?e(Q,{label:"Max",x:s.anchorMaxX,y:s.anchorMaxY,commit:l}):null,s.pivotX?e(Q,{label:"\u4E2D\u5FC3",x:s.pivotX,y:s.pivotY,commit:l}):null),e(ee,{title:"\u521B\u5EFA\u8BBE\u7F6E"},s.active?e(V,{field:s.active,commit:l}):null,s.visible?e(V,{field:s.visible,commit:l}):null),w||(p.length?e(ee,{title:m},p):null),s.canControllerFocus?e(ee,{title:"\u624B\u67C4\u5BFC\u822A",open:!1},e(V,{field:s.canControllerFocus,commit:l})):null,s.incomplete?e(ee,{title:"\u5B9E\u73B0\u72B6\u6001"},e(V,{field:s.incomplete,commit:l})):null)}function be({snap:a,selectedScriptId:l,selectScript:r,draft:s,updateDraft:d,saveScript:p,addScript:w,removeScript:m,exportLua:z,exportScripts:W,exportScriptsGia:Y,notice:ie}){let O=a.scripts||[],D=O.find(T=>T.id===l)||null,G=a.mountTargets||[],U=G.filter(T=>T.assetType==="server-control-template"),b=G.filter(T=>T.assetType==="client-control-template"),ne=T=>{let pe=G.find(ye=>ye.id===T);return pe?`${pe.assetLabel} \xB7 ${pe.name}`:""};return e("div",{className:"qxsim-script-page"},e("aside",{className:"qxsim-script-assets"},e("h3",null,`\u5B58\u6863\u5185 Lua \u811A\u672C\uFF08${O.length}\uFF09`),e("button",{className:"qxsim-action",style:{width:"100%",marginBottom:8},onClick:w},"\uFF0B \u65B0\u5EFA\u811A\u672C"),O.length?O.map(T=>e("div",{key:T.id,className:"qxsim-script-list-row"},e("button",{className:`qxsim-script-asset${T.id===l?" active":""}`,onClick:()=>r(T.id)},e("strong",null,T.path||"(\u672A\u547D\u540D\u811A\u672C)"),e("small",null,T.mounted?`\u6302\u8F7D\uFF1A${T.assetLabel} \xB7 ${T.controlName}`:"\u672A\u6302\u8F7D\uFF08\u4EC5\u53EF\u88AB require\uFF09")),e("button",{className:"qxsim-iconbtn",title:"\u4E0B\u8F7D\u8BE5\u811A\u672C .lua",onClick:()=>z(T.id)},"\u21E9"),e("button",{className:"qxsim-iconbtn",title:"\u5220\u9664\u8BE5\u811A\u672C",onClick:()=>m(T.id)},"\u2715"))):e("div",{className:"qxsim-empty"},"\u8FD8\u6CA1\u6709\u811A\u672C\uFF0C\u70B9\u51FB\u201C\u65B0\u5EFA\u811A\u672C\u201D\u5F00\u59CB")),e("main",{className:"qxsim-script-editor"},D&&s?e(t.Fragment,null,e("div",{className:"qxsim-script-title"},e("div",null,e("h2",null,s.path||"(\u672A\u547D\u540D\u811A\u672C)"),e("span",null,`\u5C5E\u4E8E\u5B58\u6863\u201C${a.save?.name||"\u672A\u547D\u540D\u5B58\u6863"}\u201D \xB7 Lua \u811A\u672C\u662F\u5B58\u6863\u5185\u72EC\u7ACB\u8D44\u4EA7`)),e("span",null,`\u811A\u672C ${D.id}`)),e("div",{className:"qxsim-script-fields"},e("label",null,"\u811A\u672C\u8DEF\u5F84\uFF08\u5DE5\u4F5C\u533A\u76F8\u5BF9\u8DEF\u5F84\uFF09",e("input",{type:"text",value:s.path,placeholder:"lua/example.lua",onChange:T=>d({path:T.target.value})})),e("label",null,"\u6302\u8F7D\u76EE\u6807\uFF08\u5BA2\u6237\u7AEF\u63A7\u4EF6 / \u5BA2\u6237\u7AEF\u63A7\u4EF6\u6A21\u677F\uFF09",e("select",{value:s.controlId?`${s.controlAsset||"server-control-template"}|${s.controlId}`:"",onChange:T=>{let[pe,ye]=T.target.value.split("|");d(ye?{controlId:ye,controlAsset:pe}:{controlId:"",controlAsset:""})}},e("option",{value:""},"\u672A\u6302\u8F7D\uFF08\u4E0D\u751F\u6548\uFF0C\u4EC5\u53EF\u88AB require\uFF09"),e("optgroup",{label:"\u670D\u52A1\u5668\u63A7\u4EF6\u6A21\u677F \xB7 \u5BA2\u6237\u7AEF\u63A7\u4EF6\u5BB9\u5668\u5185"},U.map(T=>e("option",{key:T.id,value:`${T.assetType}|${T.id}`},`${T.name} \xB7 ${T.id}`))),b.length?e("optgroup",{label:"\u5BA2\u6237\u7AEF\u63A7\u4EF6\u6A21\u677F"},b.map(T=>e("option",{key:T.id,value:`${T.assetType}|${T.id}`},`${T.name} \xB7 ${T.id}`))):null))),e("label",null,"Lua \u6E90\u7801",e("textarea",{value:s.source,spellCheck:!1,placeholder:"-- \u5728\u8FD9\u91CC\u8F93\u5165\u5BA2\u6237\u7AEF Lua\uFF1B\u811A\u672C\u53EA\u6709\u6302\u8F7D\u5230\u5BA2\u6237\u7AEF\u63A7\u4EF6\u540E\u624D\u4F1A\u5728\u8BD5\u73A9\u65F6\u751F\u6548",onChange:T=>d({source:T.target.value})})),e("div",{className:"qxsim-script-footer"},e("span",null,s.dirty?"\u6709\u672A\u4FDD\u5B58\u7684\u4FEE\u6539":ie||(D.mounted?`\u5DF2\u6302\u8F7D\uFF1A${ne(D.controlId)}`:"\u5F53\u524D\u672A\u6302\u8F7D\uFF0C\u8BD5\u73A9\u65F6\u4E0D\u4F1A\u81EA\u52A8\u8FD0\u884C")),e("span",{className:"spacer"}),e("button",{className:"qxsim-action",onClick:W},"\u21E9 \u811A\u672C\u5305 JSON"),e("button",{className:"qxsim-action",onClick:Y},"\u21E9 \u811A\u672C\u5305 GIA"),e("button",{className:"qxsim-action primary",disabled:!s.dirty,onClick:p},"\u4FDD\u5B58\u811A\u672C"))):e("div",{className:"qxsim-empty"},"\u8BF7\u65B0\u5EFA\u6216\u9009\u62E9\u4E00\u4E2A\u811A\u672C")))}function oe(a){if(a===void 0)return"null";try{return JSON.stringify(a)}catch{return String(a)}}function Te(a){let l=String(a??"").trim();if(!l)return null;try{return JSON.parse(l)}catch{return l}}function Me(a){return!!(a&&typeof a=="object"&&!Array.isArray(a)&&Object.prototype.hasOwnProperty.call(a,"fromSignalParam"))}function ze(a){return{version:1,dirty:!1,rules:(Array.isArray(a?.rules)?a.rules:[]).map((r,s)=>({id:String(r.id||`signal-${s+1}`),signalName:String(r.signalName||""),actions:Array.isArray(r.actions)&&r.actions.length?r.actions.map(d=>Ut(d)):[ve("setCustomVariable")]}))}}let de=["PlayerSelf","AllPlayers","Player1","Player2","Player3","Player4","Player5","Player6","Player7","Player8"],u=["PlayerSelf","Level","Player1","Player2","Player3","Player4","Player5","Player6","Player7","Player8"],te={PlayerSelf:"PlayerSelf \u5F53\u524D\u73A9\u5BB6",AllPlayers:"AllPlayers \u5168\u90E8\u73A9\u5BB6",Level:"Level \u5173\u5361",Player1:"Player1 \u73A9\u5BB61",Player2:"Player2 \u73A9\u5BB62",Player3:"Player3 \u73A9\u5BB63",Player4:"Player4 \u73A9\u5BB64",Player5:"Player5 \u73A9\u5BB65",Player6:"Player6 \u73A9\u5BB66",Player7:"Player7 \u73A9\u5BB67",Player8:"Player8 \u73A9\u5BB68"};function re(a){return u.includes(a)&&a!=="AllPlayers"?a:a==="Level"?"Level":"PlayerSelf"}function Ee(a){return de.includes(a)?a:"PlayerSelf"}function ve(a){return a==="sendClientScriptSignal"?{kind:"sendClientScriptSignal",target:"PlayerSelf",signalName:"",params:[]}:{kind:"setCustomVariable",entityType:"PlayerSelf",name:"",value:0}}function Gt(a){return{version:1,rules:(a?.rules||[]).map(l=>({id:String(l.id||""),signalName:String(l.signalName||"").trim(),actions:(l.actions||[]).map(r=>r?.kind==="sendClientScriptSignal"?{kind:"sendClientScriptSignal",target:Ee(r.target),signalName:String(r.signalName||"").trim(),params:Array.isArray(r.params)?r.params:[]}:{kind:"setCustomVariable",entityType:re(r?.entityType),name:String(r?.name||"").trim(),value:r&&Object.prototype.hasOwnProperty.call(r,"value")?r.value:0})}))}}function _t(a){let l=[];for(let[r,s]of(a?.rules||[]).entries()){String(s.signalName||"").trim()||l.push(`\u89C4\u5219 ${r+1} \u9700\u8981\u76D1\u542C\u4FE1\u53F7\u540D`);let d=s.actions||[];d.length||l.push(`\u89C4\u5219 ${r+1} \u81F3\u5C11\u9700\u8981\u4E00\u4E2A\u52A8\u4F5C`);for(let[p,w]of d.entries())w?.kind==="sendClientScriptSignal"?String(w.signalName||"").trim()||l.push(`\u89C4\u5219 ${r+1} \u52A8\u4F5C ${p+1} \u9700\u8981\u5BA2\u6237\u7AEF\u4FE1\u53F7\u540D`):String(w?.name||"").trim()||l.push(`\u89C4\u5219 ${r+1} \u52A8\u4F5C ${p+1} \u9700\u8981\u53D8\u91CF\u540D`)}return l}function Ut(a){if(a?.kind==="sendClientScriptSignal")return{kind:"sendClientScriptSignal",target:Ee(a.target),signalName:String(a.signalName||""),params:Array.isArray(a.params)?a.params.map(r=>{try{return JSON.parse(JSON.stringify(r))}catch{return r}}):[]};let l=0;if(a&&Object.prototype.hasOwnProperty.call(a,"value"))try{l=JSON.parse(JSON.stringify(a.value))}catch{l=a.value}return{kind:"setCustomVariable",entityType:re(a?.entityType),name:String(a?.name||""),value:l}}function ct({label:a,value:l,onChange:r}){let s=Me(l),[d,p]=t.useState(()=>s?"":oe(l));return t.useEffect(()=>{Me(l)||p(oe(l))},[l]),e("label",{className:"qxsim-field"},e("span",{className:"qxsim-field-label"},a),e("select",{value:s?"param":"literal","aria-label":`${a}\u6765\u6E90`,onChange:w=>{w.target.value==="param"?r({fromSignalParam:Number(l?.fromSignalParam)||0}):r(Te(d||"0"))}},e("option",{value:"literal"},"\u5B57\u9762\u91CF\uFF08JSON\uFF09"),e("option",{value:"param"},"\u5F15\u7528\u76D1\u542C\u4FE1\u53F7\u53C2\u6570")),s?e("input",{type:"number",min:0,step:1,value:Number(l.fromSignalParam)||0,"aria-label":`${a}\u53C2\u6570\u5E8F\u53F7`,onChange:w=>r({fromSignalParam:Math.max(0,Math.trunc(Number(w.target.value)||0))})}):e("textarea",{className:"qxsim-logic-json",value:d,spellCheck:!1,"aria-label":`${a}\u5B57\u9762\u91CF`,onBlur:()=>r(Te(d)),onChange:w=>p(w.target.value)}))}function Ht({params:a,onChange:l}){let r=Array.isArray(a)?a:[];return e("div",{className:"qxsim-field wide"},e("span",{className:"qxsim-field-label"},"\u5BA2\u6237\u7AEF\u4FE1\u53F7\u53C2\u6570\uFF08\u6309\u6DFB\u52A0\u987A\u5E8F\uFF09"),r.length?r.map((s,d)=>e("div",{key:d,style:{display:"flex",gap:6,alignItems:"flex-start",marginBottom:6}},e("div",{style:{flex:1,minWidth:0}},e(ct,{label:`\u53C2\u6570 ${d}`,value:s,onChange:p=>l(r.map((w,m)=>m===d?p:w))})),e("button",{className:"qxsim-iconbtn",title:"\u5220\u9664\u53C2\u6570",onClick:()=>l(r.filter((p,w)=>w!==d))},"\u2715"))):e("div",{className:"qxsim-muted"},"\u6682\u65E0\u53C2\u6570\uFF0C\u53EF\u53D1\u9001\u7A7A\u53C2\u6570\u5217\u8868"),e("button",{className:"qxsim-action",style:{marginTop:4},onClick:()=>l(r.concat([0]))},"\uFF0B \u6DFB\u52A0\u53C2\u6570"))}function Wt({snap:a,draft:l,setDraft:r,saveLogic:s,notice:d,error:p}){let w=l?.rules||[];function m(O){r({version:1,rules:O,dirty:!0})}function z(){m(w.concat([{id:`signal-${Date.now().toString(36)}`,signalName:"",actions:[ve("setCustomVariable")]}]))}function W(O,D){m(w.map((G,U)=>U===O?{...G,...D}:G))}function Y(O,D,G){let U=w[O];U&&W(O,{actions:U.actions.map((b,ne)=>ne===D?{...b,...G}:b)})}function ie(O,D,G){Y(O,D,ve(G))}return e("div",{className:"qxsim-server-logic"},e("div",{className:"qxsim-logic-wrap"},e("div",{className:"qxsim-logic-title"},e("div",null,e("h2",null,"\u670D\u52A1\u7AEF\u903B\u8F91"),e("p",null,`\u5C5E\u4E8E\u5B58\u6863\u201C${a.save?.name||"\u672A\u547D\u540D\u5B58\u6863"}\u201D \xB7 \u76D1\u542C\u5BA2\u6237\u7AEF\u4FE1\u53F7\u540E\u8BBE\u7F6E Level / \u73A9\u5BB6\u53D8\u91CF\uFF0C\u6216\u5411\u6307\u5B9A\u73A9\u5BB6\u53D1\u9001\u5BA2\u6237\u7AEF\u811A\u672C\u4FE1\u53F7`)),e("button",{className:"qxsim-action primary",disabled:!l?.dirty,onClick:s},"\u4FDD\u5B58\u670D\u52A1\u7AEF\u903B\u8F91")),e("div",{className:"qxsim-note"},"\u8FD9\u662F\u6A21\u62DF\u5668\u5B58\u6863\u683C\u5F0F\uFF0C\u4E0D\u662F\u5B98\u65B9\u8282\u70B9\u56FE\u3002PlayerSelf \u8868\u793A\u53D1\u4FE1\u53F7\u7684\u90A3\u4F4D\u73A9\u5BB6\uFF1BPlayer1\u20138 \u662F\u56FA\u5B9A\u5EA7\u4F4D\uFF1BAllPlayers \u5411\u672C\u5C40\u5168\u90E8\u8BD5\u73A9\u73A9\u5BB6\u5E7F\u64AD\u3002"),p?e("div",{className:"qxsim-logic-error"},p):null,w.length?w.map((O,D)=>e("section",{key:O.id||D,className:"qxsim-logic-rule"},e("div",{className:"qxsim-logic-rule-head"},e("strong",null,`\u89C4\u5219 ${D+1}`),e("label",{className:"qxsim-field"},e("span",{className:"qxsim-field-label"},"\u76D1\u542C\u4FE1\u53F7\u540D"),e("input",{type:"text",value:O.signalName,placeholder:"EarnGold","aria-label":`\u89C4\u5219 ${D+1} \u76D1\u542C\u4FE1\u53F7\u540D`,onChange:G=>W(D,{signalName:G.target.value})})),e("button",{className:"qxsim-iconbtn",title:"\u5220\u9664\u89C4\u5219",onClick:()=>m(w.filter((G,U)=>U!==D))},"\u2715")),e("div",{className:"qxsim-logic-actions"},(O.actions||[]).map((G,U)=>e("div",{key:U,className:"qxsim-logic-action"},e("div",{className:"qxsim-logic-action-head"},e("strong",null,`\u52A8\u4F5C ${U+1}`),e("select",{value:G.kind,"aria-label":`\u89C4\u5219 ${D+1} \u52A8\u4F5C ${U+1} \u7C7B\u578B`,onChange:b=>ie(D,U,b.target.value)},e("option",{value:"setCustomVariable"},"\u8BBE\u7F6E\u81EA\u5B9A\u4E49\u53D8\u91CF"),e("option",{value:"sendClientScriptSignal"},"\u53D1\u9001\u5BA2\u6237\u7AEF\u811A\u672C\u4FE1\u53F7")),e("span",null,G.kind==="sendClientScriptSignal"?"\u53D1\u7ED9\u5F53\u524D\u73A9\u5BB6\u3001\u6307\u5B9A\u73A9\u5BB6\u6216\u5168\u90E8\u73A9\u5BB6":"\u5199\u5165 Level / \u5F53\u524D\u73A9\u5BB6 / \u73A9\u5BB61-8"),e("button",{className:"qxsim-iconbtn",title:"\u5220\u9664\u52A8\u4F5C",disabled:(O.actions||[]).length<=1,onClick:()=>W(D,{actions:O.actions.filter((b,ne)=>ne!==U)})},"\u2715")),G.kind==="sendClientScriptSignal"?e("div",{className:"qxsim-logic-fields"},e("label",{className:"qxsim-field"},e("span",{className:"qxsim-field-label"},"\u53D1\u9001\u76EE\u6807"),e("select",{value:Ee(G.target),onChange:b=>Y(D,U,{target:b.target.value})},de.map(b=>e("option",{key:b,value:b},te[b])))),e("label",{className:"qxsim-field"},e("span",{className:"qxsim-field-label"},"\u5BA2\u6237\u7AEF\u4FE1\u53F7\u540D"),e("input",{type:"text",value:G.signalName,placeholder:"GoldChanged",onChange:b=>Y(D,U,{signalName:b.target.value})})),e(Ht,{params:G.params,onChange:b=>Y(D,U,{params:b})})):e("div",{className:"qxsim-logic-fields"},e("label",{className:"qxsim-field"},e("span",{className:"qxsim-field-label"},"\u5B9E\u4F53"),e("select",{value:re(G.entityType),onChange:b=>Y(D,U,{entityType:b.target.value})},u.map(b=>e("option",{key:b,value:b},te[b])))),e("label",{className:"qxsim-field"},e("span",{className:"qxsim-field-label"},"\u53D8\u91CF\u540D"),e("input",{type:"text",value:G.name,placeholder:"Gold",onChange:b=>Y(D,U,{name:b.target.value})})),e("div",{className:"wide"},e(ct,{label:"\u53D8\u91CF\u503C",value:G.value,onChange:b=>Y(D,U,{value:b})}))))),e("div",{className:"qxsim-logic-actions-foot"},e("button",{className:"qxsim-action",onClick:()=>W(D,{actions:(O.actions||[]).concat([ve("setCustomVariable")])})},"\uFF0B \u8BBE\u7F6E\u81EA\u5B9A\u4E49\u53D8\u91CF"),e("button",{className:"qxsim-action",onClick:()=>W(D,{actions:(O.actions||[]).concat([ve("sendClientScriptSignal")])})},"\uFF0B \u53D1\u9001\u5BA2\u6237\u7AEF\u811A\u672C\u4FE1\u53F7"))))):e("div",{className:"qxsim-logic-empty"},"\u8FD8\u6CA1\u6709\u76D1\u542C\u89C4\u5219\u3002\u8BD5\u73A9\u65F6\u5BA2\u6237\u7AEF SendSignal \u4E0D\u4F1A\u81EA\u52A8\u6539\u53D8\u91CF\u6216\u56DE\u4F20\u4FE1\u53F7\u3002"),e("div",{className:"qxsim-logic-actions-foot"},e("button",{className:"qxsim-action",onClick:z},"\uFF0B \u6DFB\u52A0\u76D1\u542C\u89C4\u5219")),e("div",{className:"qxsim-script-footer",style:{marginTop:16}},e("span",null,l?.dirty?"\u6709\u672A\u4FDD\u5B58\u7684\u4FEE\u6539":d||"\u4FDD\u5B58\u540E\u4F1A\u5199\u5165\u5F53\u524D\u5B58\u6863\uFF0C\u4E0B\u6B21\u8BD5\u73A9\u751F\u6548"),e("span",{className:"spacer"}))))}function Vt({inspector:a,autofill:l,onSave:r}){let[s,d]=t.useState(String(a.guid??"")),[p,w]=t.useState(!1),[m,z]=t.useState(!1),[W,Y]=t.useState("");t.useEffect(()=>{d(String(a.guid??"")),w(!1),Y("")},[a.id,a.guid]);let ie=l?.count>1&&l.selectedOffset>=0,O=/^[0-9]+$/.test(s.trim())?Number(s)-(l?.selectedOffset||0):NaN,D=O+(l?.count||0)-1,G=Number.isSafeInteger(O)&&O>=1&&D<=2147483647;async function U(b){b.preventDefault();let ne=s.trim();if(!/^[0-9]+$/.test(ne)||Number(ne)<1||Number(ne)>2147483647){Y("\u8BF7\u8F93\u5165 1\u20132147483647 \u4E4B\u95F4\u7684\u6574\u6570\u7D22\u5F15\u3002");return}z(!0),Y("");try{await r(a.id,Number(ne),p&&ie)}catch(T){Y(T?.message||String(T))}finally{z(!1)}}return e("form",{onSubmit:U,style:{marginTop:8}},e("label",{className:"qxsim-field"},e("span",{className:"qxsim-field-label"},"\u5BA2\u6237\u7AEF\u63A7\u4EF6\u7D22\u5F15"),e("div",{style:{display:"flex",gap:6}},e("input",{type:"text",inputMode:"numeric","aria-label":"\u5BA2\u6237\u7AEF\u63A7\u4EF6\u7D22\u5F15",value:s,disabled:m,onChange:b=>{d(b.target.value),Y("")},onKeyDown:b=>{b.key==="Escape"&&(d(String(a.guid)),Y(""))}}),e("button",{type:"submit",className:"qxsim-action",disabled:m||!p&&s.trim()===String(a.guid)||p&&!G},m?"\u4FDD\u5B58\u4E2D":"\u4FEE\u6539"))),ie?e("label",{style:{display:"flex",gap:6,alignItems:"center",margin:"6px 0"}},e("input",{type:"checkbox",checked:p,disabled:m,onChange:b=>w(b.target.checked)}),"\u81EA\u52A8\u4FEE\u6539\u5176\u4ED6\u5BA2\u6237\u7AEF\u7D22\u5F15\u503C"):null,p&&ie?e("div",{className:"qxsim-note","aria-label":"\u81EA\u52A8\u586B\u5145\u7D22\u5F15\u9884\u89C8"},`\u4EE5\u5F53\u524D\u63A7\u4EF6\u4E3A\u57FA\u51C6\uFF0C\u6309 GIA \u5BFC\u5165\u987A\u5E8F\u586B\u5145 ${l.count} \u4E2A\u63A7\u4EF6\uFF08${l.templateCount} \u4E2A\u6A21\u677F\u53CA\u5176\u5B50\u63A7\u4EF6\uFF09\u3002`,e("div",null,G?`\u7D22\u5F15\u8303\u56F4\uFF1A${O}\u2013${D}`:"\u7D22\u5F15\u8303\u56F4\u8D85\u51FA\u6709\u6548\u8303\u56F4\uFF0C\u8BF7\u68C0\u67E5\u8F93\u5165\u3002"),e("div",null,"\u9002\u7528\u4E8E\u6574\u6279\u5BFC\u5165\u540E\u672A\u589E\u5220\u3001\u91CD\u6392\u7684\u6A21\u677F\u3002\u670D\u52A1\u7AEF\u754C\u9762\u548C\u811A\u672C\u7D22\u5F15\u9700\u5355\u72EC\u586B\u5199\u3002")):null,W?e("div",{role:"alert",className:"qxsim-note"},W):null,e("div",{className:"qxsim-muted",style:{lineHeight:1.5}},"\u586B\u5199 GIA \u5BFC\u5165\u540E\u5B9E\u9645\u663E\u793A\u7684\u7D22\u5F15\uFF1B\u4FEE\u6539\u540E\u4ECE\u9875\u9762\u4E0A\u65B9\u7EE7\u7EED\u540C\u6B65 Lua\u3002"))}function Yt({snap:a,addScriptMounted:l,mountScriptTo:r,unmountScript:s,openScript:d}){let p=(a.scripts||[]).filter(m=>m.controlId===a.selectedId),w=(a.scripts||[]).filter(m=>m.controlId!==a.selectedId);return e(t.Fragment,null,e(ee,{title:"\u6302\u8F7D\u5230\u8BE5\u63A7\u4EF6\u7684\u811A\u672C"},p.length?p.map(m=>e("div",{key:m.id,className:"qxsim-script-list-row"},e("button",{className:"qxsim-script-asset",onClick:()=>d(m.id)},e("strong",null,m.path||"(\u672A\u547D\u540D\u811A\u672C)"),e("small",null,`\u811A\u672C ${m.id}`)),e("button",{className:"qxsim-iconbtn",title:"\u89E3\u9664\u6302\u8F7D\uFF08\u4FDD\u7559\u811A\u672C\uFF09",onClick:()=>s(m.id)},"\u292B"))):e("div",{className:"qxsim-note"},"\u8BE5\u63A7\u4EF6\u5C1A\u672A\u6302\u8F7D\u811A\u672C\u3002\u811A\u672C\u6302\u8F7D\u5230\u5BA2\u6237\u7AEF\u63A7\u4EF6\u540E\u624D\u4F1A\u5728\u8BD5\u73A9\u65F6\u751F\u6548\u3002")),e(ee,{title:"\u6302\u8F7D\u5DF2\u6709\u811A\u672C",open:!1},w.length?e("label",{className:"qxsim-field"},e("span",{className:"qxsim-field-label"},"\u9009\u62E9\u811A\u672C\u6302\u8F7D\u5230\u8BE5\u63A7\u4EF6"),e("select",{value:"","aria-label":"\u9009\u62E9\u811A\u672C\u6302\u8F7D\u5230\u8BE5\u63A7\u4EF6",onChange:m=>{let z=m.target.value;m.target.value="",z&&r(z)}},e("option",{value:""},"\u9009\u62E9\u811A\u672C\u2026"),w.map(m=>e("option",{key:m.id,value:m.id},`${m.path||"(\u672A\u547D\u540D\u811A\u672C)"} \xB7 ${m.id}${m.mounted?`\uFF08\u5F53\u524D\u6302\u8F7D\u4E8E ${m.assetLabel} \xB7 ${m.controlName}\uFF0C\u5C06\u79FB\u52A8\u5230\u6B64\u63A7\u4EF6\uFF09`:"\uFF08\u672A\u6302\u8F7D\uFF09"}`)))):e("div",{className:"qxsim-note"},"\u5B58\u6863\u5185\u8FD8\u6CA1\u6709\u5176\u4ED6\u811A\u672C\uFF0C\u53EF\u70B9\u51FB\u4E0B\u65B9\u6309\u94AE\u65B0\u5EFA\u3002"),e("div",{className:"qxsim-script-actions",style:{marginTop:8}},e("button",{onClick:()=>l(a.selectedId)},"\uFF0B \u65B0\u5EFA\u811A\u672C\u5E76\u6302\u8F7D\u5230\u6B64\u63A7\u4EF6"))))}function Xt(a,l){let r=null,s=null;function d(p,w){p.id===l&&(r=p,s=w);for(let m of p.children||[])d(m,p)}if(d(a,null),r?.kind==="container")return r.id;if(r?.kind==="server-container")return r.children?.find(p=>p.kind==="container")?.id||r.id;for(;s&&s.kind!=="container";){let w=function(m){for(let z of m.children||[])z===s&&(p=m),w(z)},p=null;w(a),s=p}return s?.id||a.children?.find(p=>p.kind==="container")?.id}function Rt(a,l){let r=null;function s(d){d.id===l&&(r=d);for(let p of d.children||[])s(p)}return s(a),r&&r.kind!=="server-container"?r.id:Xt(a,l)}function Jt(a,l,r,s){let d=a,p=a.kind,w=p==="textbox"||p==="textwindow",m=d.renderLeft??d.left,z=d.renderBottom??d.bottom,W=d.renderWidth??d.width,Y=d.renderHeight??d.height,ie=d.renderRotationZ??a.rotationZ??0,O={left:`${m/r*100}%`,bottom:`${z/s*100}%`,width:`${W/r*100}%`,height:`${Y/s*100}%`,"--rotation":`${-Number(ie)}deg`,fontSize:Math.max(8,Math.min(40,Number(a.fontSize||12))),color:w?S(a.fontColor,4294967295):"#fff"};Object.assign(O,jt(d,r,s)),p==="image"?Object.assign(O,H(a.primitive,S(a.imageColor,4294967295))):w?(O.background=S(a.bgColor,16777215),O.justifyContent=a.horizontalAlignment==="Right"?"flex-end":a.horizontalAlignment==="Middle"?"center":"flex-start",O.alignItems=a.verticalAlignment==="Bottom"?"flex-end":a.verticalAlignment==="Middle"?"center":"flex-start",O.textShadow=a.enableOutline===!1?"none":`0 0 2px ${S(a.outlineColor,4278190080)}`):p==="container"&&(O.background="transparent");let D=a.id===l.selectedId,G=p==="image"&&a.primitive==="sprite"?e(P,{key:ue(a.imageId,a.imageSource),item:a}):w?a.text||"":p==="image"&&a.primitive==="missing"?e("span",{className:"qxsim-box-label"},`\u7F3A\u5C11\u56FE\u7247 ${a.imageId||""}`):p!=="container"&&p!=="image"?e("span",{className:"qxsim-box-label"},a.name||L[p]?.[1]||p):null;return e("div",{key:a.id,className:`qxsim-box ${p}${D?" selected":""}${a.instantiated?" dynamic":""}${a.pressed?" pressed":""}`,style:O},G,D&&p!=="container"?["tl","tr","bl","br"].map(U=>e("i",{key:U,className:`qxsim-handle ${U}`})):null)}function Kt({sessionId:a}){let l=_(),[r,s]=t.useState(null),d=t.useRef(null),p=t.useRef(Promise.resolve()),[w,m]=t.useState(""),z=N({sessionId:a,api:g,playUrl:f,onError:m}),[W,Y]=t.useState(null),[ie,O]=t.useState(!1),[D,G]=t.useState(!1),[U,b]=t.useState(""),ne=t.useRef(null),[T,pe]=t.useState([]),[ye,dt]=t.useState([]),[xe,Zt]=t.useState("ui"),[We,Ve]=t.useState("base"),[Ye,Qt]=t.useState("fit"),[Xe,ea]=t.useState({}),[Fe,Re]=t.useState(""),[ke,Je]=t.useState("template"),[Ke,Oe]=t.useState(""),[Ze,Pe]=t.useState(null),[pt,Qe]=t.useState({version:1,rules:[],dirty:!1}),ut=t.useRef(null),[De,ta]=t.useState({width:0,height:0});t.useEffect(()=>{let i=ut.current;if(!i||typeof ResizeObserver>"u")return;let c=new ResizeObserver(x=>{let k=x[0]?.contentRect;k&&k.width>0&&ta({width:k.width,height:k.height})});return c.observe(i),()=>c.disconnect()},[r?.canvas?.id]);function Ne(i,{keepLogicDraft:c=!0}={}){return d.current=i,s(i),i?.scripts&&Oe(x=>i.scripts.some(k=>k.id===x)?x:i.scripts[0]?.id||""),Qe(x=>c&&x?.dirty?x:ze(i?.serverLogic)),i}let je=t.useCallback(async()=>{try{m(""),Ne(await g(a,"get"),{keepLogicDraft:!1})}catch(i){m(i?.message||String(i))}},[a]),Be=t.useCallback(async()=>{try{let i=await g(a,"archives");dt(i?.archives||[])}catch{dt([])}},[a]);t.useEffect(()=>{je(),Be()},[je,Be]);function J(i,c=""){let x=async()=>{let k=d.current;if(!k)throw new Error("editor is not ready");try{if(c&&k.asset?.type!==c)throw new Error("\u5F53\u524D\u8D44\u4EA7\u5DF2\u5207\u6362\uFF0C\u8BF7\u91CD\u65B0\u9009\u62E9\u63A7\u4EF6\u540E\u4FEE\u6539\u7D22\u5F15");let se=await g(a,"patch",{op:{...typeof i=="function"?i(k):i,expectedRevision:k.version}});return m(""),Ne(se)}catch(se){throw m(se?.message||String(se)),/revision conflict/.test(String(se?.message||se))&&await je(),se}};return p.current=p.current.then(x,x),p.current}async function aa(i,c,x,k=!1){await fe(),await J({op:"setControlGuid",id:i,guid:c,autoFillClientGuids:k},x),b("\u63A7\u4EF6\u7D22\u5F15\u5DF2\u4FEE\u6539\u3002\u8BF7\u9009\u62E9\u4E0A\u65B9\u300C\u5168\u91CF\u66FF\u6362\u811A\u672C\u7D22\u5F15\u300D\u6216\u300C\u590D\u5236\u63D0\u793A\u8BCD\u7ED9 AI\u300D\u3002")}async function ia(){await fe(),await qe(),await p.current;let i=d.current;if(!i.storage?.path)throw o&&Y(`${i.save?.name||"project"}.save.json`),new Error("\u8BF7\u5148\u4FDD\u5B58\u5B8C\u6574\u5B58\u6863\uFF0C\u518D\u590D\u5236\u63D0\u793A\u8BCD\uFF1BAI \u9700\u8981\u8BFB\u53D6\u8FD9\u6B21\u5B9E\u9645\u4FEE\u6539\u7684\u5B58\u6863\u3002");await g(a,"save",{path:i.storage.path,expectedRevision:i.version});let c=i.controlGuidChanges||[],x=["\u8BF7\u5B8C\u6210\u6A21\u62DF\u5668\u63A7\u4EF6\u7D22\u5F15\u4E0E Lua \u5F15\u7528\u540C\u6B65\u3002",`\u5DE5\u4F5C\u533A\uFF1A${i.workspace?.path||"\u8BF7\u5148\u6838\u5BF9\u5DE5\u4F5C\u533A"}`,`\u6700\u65B0\u5B8C\u6574\u5B58\u6863\uFF1A${i.storage.path}\uFF08\u7F16\u8F91\u5668\u5DF2\u4FDD\u5B58\uFF09`,`Lua \u6587\u4EF6\uFF1A${(i.scripts||[]).map(k=>k.path||`\u5185\u8054\u811A\u672C ${k.id}`).join("\u3001")||"\u6682\u65E0"}`,"\u5148\u4ECE\u4E0A\u8FF0\u6587\u4EF6\u91CD\u65B0\u52A0\u8F7D\u6700\u65B0\u5B58\u6863\uFF0C\u4E0D\u8981\u4F7F\u7528\u53E6\u4E00\u4E2A MCP/Web \u8FDB\u7A0B\u91CC\u7684\u65E7\u5DE5\u7A0B\u3002",`\u83B7\u53D6\u65B0\u65E7\u6620\u5C04\uFF1A\u8BFB\u53D6\u8BE5 JSON \u9876\u5C42\u7684 controlGuidChanges \u6570\u7EC4\uFF0C\u5F53\u524D\u5171 ${c.length} \u6761\uFF0C\u5FC5\u987B\u8BFB\u53D6\u5168\u90E8\u8BB0\u5F55\u3002oldGuid \u662F\u65E7\u7D22\u5F15\uFF0CnewGuid \u662F\u65B0\u7D22\u5F15\uFF1BcontrolAsset + controlId \u6807\u8BC6\u63A7\u4EF6\uFF0CcontrolName \u662F\u540D\u79F0\uFF0Cid \u662F\u8BB0\u5F55\u7F16\u53F7\uFF0CbatchId \u662F\u6279\u6B21\u3002`,"\u83B7\u53D6\u811A\u672C\uFF1A\u8BFB\u53D6 assets.scripts \u6570\u7EC4\uFF1B\u6BCF\u9879\u7684 source \u662F\u5B58\u6863\u5185\u6E90\u7801\uFF0Cpath \u662F\u811A\u672C\u6587\u4EF6\u8DEF\u5F84\uFF08\u76F8\u5BF9\u8DEF\u5F84\u4EE5\u5DE5\u4F5C\u533A\u4E3A\u57FA\u51C6\uFF09\u3002","\u6309\u63A7\u4EF6\u8EAB\u4EFD\u548C\u53D8\u66F4\u987A\u5E8F\u6838\u5BF9\u5168\u90E8 Lua \u811A\u672C\u7684\u7D22\u5F15\u5E38\u91CF\u3001\u914D\u7F6E\u8868\u4E0E\u8C03\u7528\uFF0C\u4FEE\u6539\u5B58\u6863\u4E2D\u7684 source \u53CA\u76F8\u5173 Lua \u6E90\u6587\u4EF6\u548C\u751F\u6210\u5668\u6620\u5C04\uFF0C\u907F\u514D\u91CD\u5EFA\u540E\u8986\u76D6\u3002\u4E0D\u8981\u5168\u5C40\u66FF\u6362\u540C\u503C\u6570\u5B57\uFF0C\u4E5F\u4E0D\u8981\u6539\u8FD0\u884C\u65F6\u5B9E\u4F8B ID \u6216\u56FE\u7247\u8D44\u6E90 ID\u3002","\u540C\u4E00 batchId \u662F\u540C\u65F6\u6620\u5C04\uFF0C\u987B\u6309\u539F\u503C\u4E00\u6B21\u6027\u5E94\u7528\uFF0C\u4E0D\u80FD\u9010\u6761\u66FF\u6362\u5BFC\u81F4\u7D22\u5F15\u4E32\u6539\u3002","\u68C0\u67E5\u65E7\u7D22\u5F15\u5F15\u7528\u5E76\u91CD\u65B0\u8BD5\u73A9\uFF1B\u4EC5\u5728\u5F15\u7528\u5168\u90E8\u540C\u6B65\u6216\u660E\u786E\u6CA1\u6709\u5F15\u7528\u540E\uFF0C\u7528 acknowledgeControlGuidChanges \u7684 changeIds \u6E05\u9664\u5DF2\u6838\u5BF9\u8BB0\u5F55\uFF0C\u4FDD\u5B58\u5B8C\u6574\u5B58\u6863\u3002\u672A\u5224\u65AD\u7684\u8BB0\u5F55\u7EE7\u7EED\u4FDD\u7559\u3002","\u5B8C\u6210\u540E\u544A\u77E5\u7528\u6237\u91CD\u65B0\u8F7D\u5165\u8FD9\u4E2A\u5B58\u6863\uFF0C\u518D\u901A\u8FC7\u300CLua \u811A\u672C \u2192 \u5B9E\u673A\u811A\u672C\u540C\u6B65\u300D\u66F4\u65B0\u6E38\u620F\u6587\u4EF6\uFF1B\u4E0D\u8981\u91CD\u65B0\u5BFC\u5165 GIA\uFF0C\u4E5F\u4E0D\u8981\u64C5\u81EA\u590D\u5236\u5230\u6E38\u620F\u76EE\u5F55\u3002"].join(`
|
|
28
|
-
`);try{await navigator.clipboard.writeText(
|
|
29
|
-
`)),
|
|
30
|
-
${r.meta?.sourceFile||"\u5C1A\u672A\u5BFC\u5165\u6587\u4EF6"}`},e("span",{className:"qxsim-appicon"},"UI"),e("span",{className:"qxsim-brand-text"},e("strong",null,`\u5B58\u6863\uFF1A${r.save?.name||r.meta?.name||"\u672A\u547D\u540D\u5B58\u6863"}`),e("span",null,`\u5DE5\u4F5C\u533A\uFF1A${r.workspace?.bound?r.workspace.name:"\u672A\u7ED1\u5B9A"} \xB7 \u5F53\u524D\u8D44\u4EA7\uFF1A${r.asset?.label||"UI\u63A7\u4EF6"}`))),e("div",{className:"qxsim-toolbar-center"},xe==="ui"?e(t.Fragment,null,e("div",{className:"qxsim-device-switch",role:"group","aria-label":"\u76EE\u6807\u8BBE\u5907"},K.map(i=>e("button",{key:i.key,className:r.canvas.platform===i.key?"active":"",title:i.title,onClick:()=>va(i.key)},i.label))),e("select",{className:"qxsim-control ratio","aria-label":"\u5C4F\u5E55\u6BD4\u4F8B",value:r.canvasId,onChange:i=>void J({op:"setCanvas",canvasId:i.target.value}).catch(()=>{})},ba.map(i=>e("option",{key:i.id,value:i.id},`${ae(i)} \xB7 ${i.width}\xD7${i.height}`))),e("select",{className:"qxsim-control zoom","aria-label":"\u753B\u5E03\u7F29\u653E",value:Ye,onChange:i=>Qt(i.target.value)},[["fit","\u9002\u5E94"],["0.25","25%"],["0.5","50%"],["0.75","75%"],["1","100%"]].map(([i,c])=>e("option",{key:i,value:i},c)))):e("span",{className:"qxsim-muted"},xe==="logic"?"\u670D\u52A1\u7AEF\u903B\u8F91\uFF1A\u76D1\u542C\u4FE1\u53F7 / \u81EA\u5B9A\u4E49\u53D8\u91CF / \u73A9\u5BB61-8 \u56DE\u4F20":"Lua \u811A\u672C\u8D44\u4EA7\u7F16\u8F91")),e("div",{className:"qxsim-actions"},o?e("button",{className:"qxsim-action",title:"\u4FDD\u5B58\u5B8C\u6574\u5B58\u6863\u5230\u5DE5\u4F5C\u533A",onClick:()=>{m(""),Y(d.current?.storage?.path||"qxqy-simulator.save.json")}},"\u4FDD\u5B58\u5B58\u6863"):null,e("div",{className:"qxsim-io"},e("input",{ref:ne,hidden:!0,type:"file",accept:".json,.gia,.lua,application/json,application/octet-stream,text/plain",onChange:i=>void ma(i.target.files?.[0])}),e("select",{className:"qxsim-control zoom","aria-label":"\u4ECE\u5DE5\u4F5C\u533A\u62C9\u53D6\u5B58\u6863",defaultValue:"",onFocus:()=>void Be(),onChange:i=>{let c=i.target.value;i.target.value="",c&>(c)}},e("option",{value:"",disabled:!0},r.workspace?.bound?"\u2913 \u5DE5\u4F5C\u533A\u5B58\u6863":"\u5DE5\u4F5C\u533A\u672A\u7ED1\u5B9A"),...ye.length?ye.map(i=>e("option",{key:i.path,value:i.path},`${i.name} \xB7 ${i.path}`)):[e("option",{value:"",disabled:!0},r.workspace?.bound?"\u672A\u53D1\u73B0 qxqy-simulator-save":"\u5148\u7ED1\u5B9A\u4F1A\u8BDD\u5DE5\u4F5C\u533A")]),e("button",{className:"qxsim-action",title:"\u5BFC\u5165\u5B58\u6863\u3001\u5355\u9879 UI \u8D44\u4EA7\u6216 Lua",onClick:()=>ne.current?.click()},"\u21E7 \u5BFC\u5165"),e("select",{className:"qxsim-control zoom","aria-label":"\u5BFC\u51FA\u683C\u5F0F",defaultValue:"",onChange:i=>{let[c,x=""]=i.target.value.split("|");i.target.value="",c&&Ge(c,x)}},e("option",{value:"",disabled:!0},"\u21E9 \u5BFC\u51FA"),e("option",{value:"save"},"\u8D44\u4EA7\u5305 JSON\uFF08\u4E09\u7C7B\u5408\u4E00\uFF09"),e("option",{value:"save-gia"},"\u8D44\u4EA7\u5305 GIA\uFF08\u5DF2\u6539\u52A8\u9879\uFF09"),e("option",{value:"gia-combined"},"\u8D44\u4EA7\u5305 GIA \u6574\u5408\u5305\uFF08\u63A7\u4EF6+\u811A\u672C\uFF09"),e("optgroup",{label:"\u5F53\u524D\u754C\u9762\uFF08\u5DE6\u680F\u6B63\u5728\u770B\u7684\u90A3\u68F5\u6811\uFF09"},e("option",{value:"json"},"\u5F53\u524D\u754C\u9762 Authoring JSON"),e("option",{value:"gia"},"\u5F53\u524D\u754C\u9762 GIA")),e("optgroup",{label:"\u670D\u52A1\u5668\u63A7\u4EF6\u6A21\u677F"},e("option",{value:"json|server-control-template"},"Authoring JSON"),e("option",{value:"gia|server-control-template"},"GIA")),e("optgroup",{label:"\u5BA2\u6237\u7AEF\u63A7\u4EF6\u6A21\u677F\uFF08\u4EC5\u5F53\u5DE6\u680F\u5207\u5230\u300CUI\u63A7\u4EF6-\u5BA2\u6237\u7AEF\u300D\u65F6\u624D\u662F\u9875\u9762\u5185\u5BB9\uFF09"},e("option",{value:"json|client-control-template"},"Authoring JSON"),e("option",{value:"gia|client-control-template"},"GIA")),e("optgroup",{label:"Lua \u811A\u672C"},e("option",{value:"scripts"},"\u811A\u672C\u5305 JSON\uFF08\u5168\u90E8\u811A\u672C\uFF09"),e("option",{value:"scripts-gia"},"\u811A\u672C\u5305 GIA\uFF08\u5168\u90E8\u811A\u672C\uFF09")))),e("button",{className:"qxsim-action primary",title:"\u6253\u5F00\u8BD5\u73A9\uFF1B\u65B0\u7A97\u53E3\u4E0D\u53EF\u7528\u65F6\u5728\u5E94\u7528\u5185\u8BD5\u73A9",disabled:z.opening,onClick:xa},z.opening?"\u6B63\u5728\u51C6\u5907\u2026":"\u25B7 \u8BD5\u73A9 \u2197"),e("button",{className:"qxsim-iconbtn",title:"\u91CD\u65B0\u8F7D\u5165",onClick:je},"\u21BB"))),e("nav",{className:"qxsim-editor-nav","aria-label":"\u7F16\u8F91\u9875\u9762"},e("button",{className:xe==="ui"?"active":"",onClick:()=>Ce("ui")},"UI \u7F16\u8F91"),e("button",{className:xe==="script"?"active":"",onClick:()=>Ce("script")},"Lua \u811A\u672C"),e("button",{className:xe==="logic"?"active":"",onClick:()=>Ce("logic")},"\u670D\u52A1\u7AEF\u903B\u8F91"),e("span",{className:"save-summary"},"\u4E00\u4E2A\u5B58\u6863 \xB7 \u670D\u52A1\u5668\u63A7\u4EF6\u6A21\u677F + \u5BA2\u6237\u7AEF\u63A7\u4EF6\u6A21\u677F + Lua \u811A\u672C + \u670D\u52A1\u7AEF\u903B\u8F91")),xe==="script"?e(h,{snap:r,patch:J,request:(i,c)=>g(a,i,c),refresh:async()=>Ne(await g(a,"get")),prepare:async()=>(await p.current,await fe(),await qe(),d.current)}):null,e(y,{snap:r,patch:J,prepare:fe,copy:ia,onScripts:()=>Ce("script"),onError:m,reloadArchive:()=>gt(d.current.storage?.path)}),T.length?e("details",{className:"qxsim-export-warnings",open:!0,role:"status",style:{flexShrink:0,maxHeight:180,overflow:"auto",padding:"8px 16px",borderBottom:"1px solid currentColor"}},e("summary",{style:{cursor:"pointer"}},`\u4E0A\u6B21\u5BFC\u51FA\u8BF4\u660E\uFF08${T.length} \u9879\uFF0C\u8BF7\u6838\u5BF9\u5BFC\u5165\u540E\u7684\u6548\u679C\uFF09`),e("button",{className:"qxsim-action",onClick:()=>pe([])},"\u5173\u95ED\u5BFC\u51FA\u8BF4\u660E"),e("ul",null,T.map((i,c)=>e("li",{key:c},i)))):null,xe==="ui"?e("div",{className:"qxsim-main"},e("aside",{className:"qxsim-tree"},e("div",{className:"qxsim-asset-switch","aria-label":"\u7F16\u8F91\u8D44\u6E90\u7C7B\u578B"},e("button",{className:Z?"":"active",title:"\u7F16\u8F91\u5B58\u6863\u5185\u7684\u670D\u52A1\u7AEF UI \u63A7\u4EF6",onClick:()=>void ft("server-control-template")},"UI\u63A7\u4EF6-\u670D\u52A1\u7AEF"),e("button",{className:Z?"active":"",title:"\u7F16\u8F91\u5B58\u6863\u5185\u7684\u5BA2\u6237\u7AEF\u63A7\u4EF6\u6A21\u677F",onClick:()=>void ft("client-control-template")},"UI\u63A7\u4EF6-\u5BA2\u6237\u7AEF")),e("div",{className:"qxsim-pane-head"},e("div",{className:"qxsim-pane-title"},Z?"\u6A21\u677F\u4E0E\u5B50\u63A7\u4EF6":"\u63A7\u4EF6\u6811"),e("span",{className:"qxsim-muted"},Z?`${r.asset.templateCount} \u4E2A\u6A21\u677F \xB7 ${r.tree.length} \u4E2A\u63A7\u4EF6`:`${r.tree.length} \u4E2A\u8282\u70B9`)),e("label",{className:"qxsim-search"},"\u2315",e("input",{value:Fe,placeholder:Z?"\u641C\u7D22\u6A21\u677F\u6216\u63A7\u4EF6":"\u641C\u7D22\u63A7\u4EF6",onChange:i=>Re(i.target.value)}),Fe?e("button",{onClick:()=>Re("")},"\xD7"):e("span",null,"\u2301")),e("div",{className:"qxsim-tree-scroll"},bt.length?bt.map(i=>{let c=L[i.kind]||["\u25C7",i.label],x=at.has(i.id),k=!!Xe[i.id];return e("div",{key:i.id,className:`qxsim-row${Z&&i.depth===0?" template-root":""}${i.id===r.selectedId?" active":""}${x?" canvas-hidden":""}`,style:{paddingLeft:8+i.depth*18,"--depth":i.depth},title:`${c[1]} \xB7 ${i.name} \xB7 GUID ${i.guid??i.id}`,onClick:()=>void J({op:"select",id:i.id}).catch(()=>{})},e("span",{className:"qxsim-chevron"},i.childCount?"\u25BC":""),e("span",{className:"qxsim-kind"},c[0]),e("span",{className:"qxsim-row-label"},i.name),e("span",{className:"qxsim-row-end"},Z&&i.depth===0?e(t.Fragment,null,e("span",{className:"qxsim-template-tag"},"\u6A21\u677F"),e("span",{className:"qxsim-template-id"},`#${i.guid??i.id}`)):i.incomplete?e("span",{className:"qxsim-incomplete"},"\u6682\u4E0D\u652F\u6301"):null,e("button",{className:`qxsim-eye${k?" off":""}`,type:"button",title:k?"\u5728\u753B\u5E03\u4E0A\u663E\u793A\uFF08\u4E0D\u5F71\u54CD\u63A7\u4EF6\u521D\u59CB\u53EF\u89C1\u6027\uFF09":"\u5728\u753B\u5E03\u4E0A\u9690\u85CF\uFF08\u4E0D\u5F71\u54CD\u63A7\u4EF6\u521D\u59CB\u53EF\u89C1\u6027\uFF09","aria-label":`${i.name}\u753B\u5E03\u53EF\u89C1\u6027`,"aria-pressed":!k,onClick:se=>qa(se,i.id)},k?"\u25CC":"\u25C9")))}):e("div",{className:"qxsim-empty"},"\u6CA1\u6709\u5339\u914D\u7684\u63A7\u4EF6")),e("div",{className:"qxsim-tree-foot"},Z&&X?e("div",{className:"qxsim-hierarchy"},e("div",{className:"qxsim-hierarchy-head"},e("strong",null,"\u5C42\u7EA7\u4E0E\u6A21\u677F\u8FB9\u754C"),e("span",null,X.name)),e("div",{className:"qxsim-parent-row"},e("select",{"aria-label":"\u7236\u7EA7\u63A7\u4EF6",value:Sa,onChange:i=>void J({op:"reparent",id:X.id,parentId:i.target.value}).then(()=>b(i.target.value===r.root.id?"\u5DF2\u63D0\u5347\u4E3A\u53EF\u5B9E\u4F8B\u5316\u9876\u5C42\u6A21\u677F":"\u5DF2\u8C03\u6574\u63A7\u4EF6\u7236\u7EA7")).catch(()=>{})},e("option",{value:r.root.id},"\u9876\u5C42\u6A21\u677F\uFF08\u53EF\u5B9E\u4F8B\u5316\uFF09"),wa.map(i=>e("option",{key:i.id,value:i.id},`${"\u3000".repeat(i.depth)}${i.name}`))),e("button",{title:"\u5728\u540C\u7EA7\u4E2D\u4E0A\u79FB",disabled:X.siblingIndex<=0,onClick:()=>void J({op:"moveSibling",id:X.id,direction:"up"}).catch(()=>{})},"\u2191"),e("button",{title:"\u5728\u540C\u7EA7\u4E2D\u4E0B\u79FB",disabled:X.siblingIndex>=X.siblingCount-1,onClick:()=>void J({op:"moveSibling",id:X.id,direction:"down"}).catch(()=>{})},"\u2193")),e("div",{className:"qxsim-hierarchy-note"},X.depth===0?"\u8BE5\u8282\u70B9\u4F1A\u5199\u5165\u72EC\u7ACB UIControlTemplate\uFF0C\u53EF\u76F4\u63A5\u4F5C\u4E3A prefabId\u3002":`\u5F53\u524D\u4E3A\u7B2C ${X.depth} \u5C42\u5B50\u63A7\u4EF6\uFF0C\u4E0D\u4F1A\u5355\u72EC\u6210\u4E3A prefabId\u3002`)):null,e("div",{className:"qxsim-palette-head"},e("span",{title:Z&&ke==="template"?"\u65B0\u589E\u72EC\u7ACB\u53EF\u5B9E\u4F8B\u5316\u6A21\u677F":`\u6DFB\u52A0\u5230${X?X.name:"\u5F53\u524D\u63A7\u4EF6"}`},Z&&ke==="template"?"\u65B0\u589E\u9876\u5C42\u6A21\u677F":`\u6DFB\u52A0\u5230${X?`\u201C${X.name}\u201D`:"\u5F53\u524D\u63A7\u4EF6"}`),Z?e("span",{className:"qxsim-add-mode"},e("button",{className:ke==="template"?"active":"",onClick:()=>Je("template")},"\u9876\u5C42"),e("button",{className:ke==="child"?"active":"",onClick:()=>Je("child")},"\u5B50\u63A7\u4EF6")):null),e("div",{className:"qxsim-add"},E.filter(([i])=>Z||i!=="container").map(([i,c])=>e("button",{key:i,title:`${Z&&ke==="template"?"\u65B0\u589E":"\u6DFB\u52A0"}${c}`,onClick:()=>ua(i,c)},`\uFF0B ${c}`))))),e("main",{className:"qxsim-center"},e("div",{className:"qxsim-workspace",ref:ut},e("div",{className:"qxsim-stage-shell",style:{width:`${Math.max(40,Math.round(we*ha))}px`}},e("div",{className:"qxsim-stage-label"},e("b",null,Z?"Lua \u6A21\u677F\u9884\u89C8":"\u754C\u9762\u63A7\u4EF6\u7EC4"),e("span",{className:"qxsim-platform-tag"},r.canvas.platform),e("span",null,`${ht} \xB7 ${we}\xD7${$e} \xB7 \u5DE6\u4E0B\u539F\u70B9`)),e("div",{className:"qxsim-stage",style:{width:"100%",aspectRatio:`${we} / ${$e}`},onClick:i=>{let c=i.currentTarget.getBoundingClientRect();J({op:"pick",x:(i.clientX-c.left)*we/c.width,y:(c.bottom-i.clientY)*$e/c.height}).catch(()=>{})}},ya.map(i=>Jt(i,r,we,$e))))),w?e("div",{className:"qxsim-status error"},"\u26A0 ",w):e("div",{className:"qxsim-status"},e("span",null,`\u25CF ${r.asset?.label||"\u63A7\u4EF6"}\u7F16\u8F91`),e("span",null,U||(X?`\u5F53\u524D\uFF1A${X.name}`:"")),e("span",{className:"spacer"}),e("span",null,Z?"GIA \u5BFC\u51FA\u540E\u53EF\u5728 Lua \u4E2D\u6309 prefabId \u5B9E\u4F8B\u5316":"\u5B57\u6BB5\u5728\u5931\u7126\u6216 Enter \u65F6\u63D0\u4EA4"),e("a",{className:"qxsim-community",href:"https://space.bilibili.com/23358791",target:"_blank",rel:"noreferrer",title:"\u4F5C\u8005 B\u7AD9\u4E3B\u9875"},"\u4F5C\u8005B\u7AD9"),e("a",{className:"qxsim-community",href:"https://qm.qq.com/q/DpuMvxAfhm",target:"_blank",rel:"noreferrer",title:"\u52A0\u5165 QQ \u7FA4 1007538100"},"QQ\u7FA4 1007538100"))),e("aside",{className:"qxsim-inspector"},r.inspector?e(t.Fragment,null,e("div",{className:"qxsim-inspector-head"},e("div",{className:"qxsim-inspector-line"},e("span",{className:"qxsim-kind"},(L[r.inspector.kind]||["\u25C7"])[0]),e("strong",null,r.inspector.label),Z&&X?.depth===0?e("span",{className:"qxsim-template-tag"},"\u53EF\u5B9E\u4F8B\u5316"):null),e("div",{className:"qxsim-node-id"},Z&&X?.depth===0?"\u6A21\u677F\u7D22\u5F15 ":"\u63A7\u4EF6 GUID ",e("code",null,r.inspector.guid??r.inspector.id)," \xB7 ",X?.name||"\u8282\u70B9"),r.inspector.kind!=="server-container"?e(Vt,{key:`${r.asset.type}:${r.inspector.id}`,inspector:r.inspector,autofill:r.clientGuidAutofill,onSave:(i,c,x)=>aa(i,c,r.asset.type,x)}):null),e("div",{className:"qxsim-tabs",style:tt?void 0:{gridTemplateColumns:"1fr"}},e("button",{className:We==="base"?"active":"",onClick:()=>Ve("base")},"\u57FA\u7840\u5C5E\u6027"),tt?e("button",{className:We==="script"?"active":"",onClick:()=>Ve("script")},"\u811A\u672C"):null),e("div",{className:"qxsim-inspector-scroll"},tt&&We==="script"?e(Yt,{snap:r,addScriptMounted:i=>void xt({controlId:i,controlAsset:r.asset?.type}).then(()=>Ce("script")),mountScriptTo:pa,unmountScript:da,openScript:i=>{Oe(i),Ce("script")}}):e(t.Fragment,null,e(me,{key:`${r.asset.type}:${r.inspector.id}`,inspector:r.inspector,commit:na,createStateChild:sa}),r.boxes?.some(i=>i.id===r.selectedId&&Ie(i.imageId,i.imageSource))?e("div",{className:"qxsim-section-body"},e("button",{className:"qxsim-action",disabled:D,onClick:ra},D?"\u6B63\u5728\u5237\u65B0\u7D20\u6750\u2026":"\u21BB \u91CD\u65B0\u4E0B\u8F7D\u6B64\u7D20\u6750"),e("p",{className:"qxsim-muted"},"\u767D\u540D\u5355\u56FE\u7247\u6309\u9700\u7F13\u5B58\uFF1B\u5237\u65B0\u4F1A\u91CD\u65B0\u8BBF\u95EE\u7D20\u6750\u6E90\u3002")):null)),e("div",{className:"qxsim-tree-foot"},e("button",{className:"qxsim-action danger",style:{width:"100%"},onClick:()=>void J({op:"remove"}).catch(()=>{})},Z&&X?.depth===0?"\u232B \u5220\u9664\u5F53\u524D\u6A21\u677F":"\u232B \u5220\u9664\u5F53\u524D\u63A7\u4EF6"))):e("div",{className:"qxsim-empty"},"\u8BF7\u9009\u62E9\u4E00\u4E2A\u63A7\u4EF6"))):xe==="script"?e(be,{snap:r,selectedScriptId:Ke,selectScript:i=>{mt(),Oe(i)},draft:Ze,updateDraft:oa,saveScript:()=>void fe().then(()=>b("Lua \u811A\u672C\u5DF2\u4FDD\u5B58\u5230\u5F53\u524D\u5B58\u6863")).catch(()=>{}),addScript:()=>void xt(),removeScript:ca,exportLua:i=>void Ge("lua",i),exportScripts:()=>void Ge("scripts"),exportScriptsGia:()=>void Ge("scripts-gia"),notice:U}):e(Wt,{snap:r,draft:pt,setDraft:Qe,saveLogic:()=>void qe().catch(()=>{}),notice:U,error:w}))}return{SimulatorView:Kt,ensureStyle:q,removeStyle:()=>document.getElementById(I)?.remove()}}window.__ModuleLoader__.load({id:"dsh-plugin-beyond-simulator",factory:t=>{let n={},f=t("react"),o=Bt(f,{async api(e,h,y){let N=await fetch("/qxqy-simulator/api/"+h,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({sessionId:e,...y||{}}),...h==="play"?{signal:AbortSignal.timeout(15e3)}:{}}),P=await N.json();if(!N.ok||!P.ok)throw new Error(P.error||"Request failed");return P.value},playUrl:e=>"/qxqy-simulator/play#"+encodeURIComponent(e)});return n.inject=["slots"],n.apply=e=>{o.ensureStyle(),e.effect(()=>o.removeStyle,"qxqy-simulator: style cleanup"),e.slots.inject("conversation.view",()=>e.slots.register({name:"conversation.view",id:"qxqy-simulator",order:20,label:()=>"\u6A21\u62DF\u5668"},o.SimulatorView))},n}});})();
|
|
31
|
+
`,M={"server-container":["\u25A3","\u5BA2\u6237\u7AEF\u63A7\u4EF6\u5BB9\u5668"],container:["\u25A1","\u5BB9\u5668\u8282\u70B9"],textbox:["T","\u6587\u672C\u6846"],cursor:["\u2301","\u5149\u6807\u68C0\u6D4B\u533A\u57DF"],reference:["\u2197","\u6A21\u677F\u5F15\u7528\u63A7\u4EF6"],grid:["\u25A6","\u7F51\u683C\u89C6\u7A97"],image:["\u25A7","\u56FE\u7247"],button:["Btn","\u9884\u8BBE\u6309\u94AE"],textwindow:["T\u2195","\u6587\u672C\u89C6\u7A97"],keyhint:["1","\u6309\u952E\u63D0\u793A"],animation:["\u2726","\u754C\u9762\u52A8\u6548"],fullscreen:["\u2725","\u5168\u5C4F\u52A8\u6548"]},B=[["container","\u5BB9\u5668\u8282\u70B9"],["textbox","\u6587\u672C\u6846"],["cursor","\u5149\u6807\u68C0\u6D4B"],["reference","\u6A21\u677F\u5F15\u7528"],["grid","\u7F51\u683C\u89C6\u7A97"],["button","\u9884\u8BBE\u6309\u94AE"],["textwindow","\u6587\u672C\u89C6\u7A97"],["keyhint","\u6309\u952E\u63D0\u793A"],["image","\u56FE\u7247"],["animation","\u754C\u9762\u52A8\u6548"],["fullscreen","\u5168\u5C4F\u52A8\u6548"]],A={container:["isolateNavigation","disableKeyEventPassthrough","disableCursorEventPassthrough","showCursor"],textbox:["fontSize","adaptiveFontSize","minimumFontSize","fontColor","bgColor","enableOutline","outlineColor","horizontalAlignment","verticalAlignment","text"],cursor:[],reference:["referencedPrefabId"],grid:["itemPrefabId","raycastTarget","interactable","showScrollBar","scrollDirection","layoutConstraint","layoutConstraintFixedCount","cellSizeX","cellSizeY","spacingX","spacingY","padding1X","padding1Y","padding2X","padding2Y","previewCount"],image:["imageSource","imageId","imageColor","enableMask","enableSoftEdge","softEdgeMode","softEdgeWidthX","softEdgeWidthY","horizontalSoftRange","verticalSoftRange","enableFill","fillType","fillHorizontalType","fillVerticalType","fillRadial90Type","fillRadialType","fillAmount","reverseMaskArea"],button:["raycastTarget","interactable","unavailableChildId","hoverChildId","pressedChildId","selectedChildId","clickAudioId"],textwindow:["interactable","showScrollBar","fontSize","adaptiveFontSize","minimumFontSize","fontColor","bgColor","enableOutline","outlineColor","horizontalAlignment","verticalAlignment","text"],keyhint:["keyboardKeyCode","controllerKeyCode"],animation:["animationId"],fullscreen:["animationId"]};function $(){if(document.getElementById(I))return;let o=document.createElement("style");o.id=I,o.textContent=R,document.head.appendChild(o)}function L(){let o=document.documentElement,d=document.body,f=[o.dataset.theme,o.className,o.getAttribute("style"),d?.dataset?.theme,d?.className,d?.getAttribute("style"),getComputedStyle(o).colorScheme].filter(Boolean).join(" ").toLowerCase();return f.includes("dark")?"dark":f.includes("light")?"light":window.matchMedia?.("(prefers-color-scheme: dark)").matches?"dark":"light"}function Z(){let[o,d]=a.useState(L);return a.useEffect(()=>{let f=()=>d(L()),r=new MutationObserver(f);r.observe(document.documentElement,{attributes:!0,attributeFilter:["class","style","data-theme"]}),document.body&&r.observe(document.body,{attributes:!0,attributeFilter:["class","style","data-theme"]});let S=window.matchMedia?.("(prefers-color-scheme: dark)");return S?.addEventListener?.("change",f),()=>{r.disconnect(),S?.removeEventListener?.("change",f)}},[]),o}function U(o,d){let f=Number(o??d)>>>0;return`rgba(${f>>>16&255},${f>>>8&255},${f&255},${(f>>>24&255)/255})`}function J(o,d){return o==="sprite"?{background:"transparent"}:o==="circle"?{borderRadius:"50%",background:d}:o==="ring"?{borderRadius:"50%",border:`7px solid ${d}`,background:"transparent"}:o==="triangle"?{background:d,clipPath:"polygon(50% 0,100% 100%,0 100%)"}:o==="fourstar"?{background:d,clipPath:"polygon(50% 0,62% 38%,100% 50%,62% 62%,50% 100%,38% 62%,0 50%,38% 38%)"}:o==="fivestar"?{background:d,clipPath:"polygon(50% 0,61% 35%,98% 35%,68% 57%,79% 91%,50% 70%,21% 91%,32% 57%,2% 35%,39% 35%)"}:o==="missing"?{background:"#4822285c",border:"1px dashed #ff7481"}:{background:d}}let X=n;function de(o){let d;try{d=atob(o.data)}catch{throw new Error(e("\u5BFC\u51FA\u5185\u5BB9\u89E3\u7801\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5\u6216\u5237\u65B0\u9875\u9762"))}let f=new Uint8Array(d.length);for(let w=0;w<d.length;w+=1)f[w]=d.charCodeAt(w);let r=URL.createObjectURL(new Blob([f],{type:o.mimeType||"application/octet-stream"})),S=document.createElement("a");S.href=r,S.download=o.filename||"qxqy-export",S.rel="noopener",S.style.display="none",document.body.appendChild(S),S.click(),S.remove(),setTimeout(()=>URL.revokeObjectURL(r),1e3)}async function ie(o){let d=new Uint8Array(await o.arrayBuffer()),f="",r=32768;for(let S=0;S<d.length;S+=r)f+=String.fromCharCode(...d.subarray(S,S+r));return btoa(f)}let le=o=>typeof o=="object"?o.value:o,pe=o=>e(typeof o=="object"?o.label:o),ce=[{key:"KEYBOARD",label:"PC",title:"PC KEYBOARD \u753B\u5E03\uFF1A1600\xD7900 / 2100\xD7900"},{key:"TOUCHSCREEN",label:"\u624B\u673A",title:"\u624B\u673A TOUCHSCREEN \u753B\u5E03\uFF1A1280\xD7720 / 1560\xD7720 / 1280\xD7960"}];function fe(o){return String(o.id||"").split("-").slice(1).join(":")}function ge(o,d){let f=(S,w)=>w?f(w,S%w):S,r=f(Math.round(o),Math.round(d))||1;return`${Math.round(o)/r}:${Math.round(d)/r}`}function ae({field:o,commit:d,axis:f}){let r=o.value==null?"":String(o.value),[S,w]=a.useState(r);if(a.useEffect(()=>w(o.value==null?"":String(o.value)),[o.value,o.type]),o.type==="note")return t("div",{className:"qxsim-note"},e(o.value||o.label));if(o.readonly&&(o.evidence==="N"||o.evidence==="U"))return t("div",{className:"qxsim-field"},t("span",{className:"qxsim-field-label"},e(o.label)),t("div",{className:"qxsim-unsupported"},o.value==null?e("\u5C1A\u65E0\u53EF\u7F16\u8F91\u503C"):String(o.value)));if(o.type==="bool")return t("div",{className:"qxsim-switch-row"},t("span",null,e(o.label)),t("label",{className:"qxsim-switch"},t("input",{type:"checkbox",checked:!!o.value,disabled:!!o.readonly,onChange:y=>d(o.key,y.target.checked)}),t("span",{className:"qxsim-switch-track"})));if(o.type==="enum"){let y=[...o.options||[]],k=String(o.value??"");return y.some(W=>String(le(W))===k)||y.unshift({value:o.value??"",label:e`未识别选项 ${o.unknownValue??(k||e("\u7A7A"))}(保留原值)`}),t("label",{className:"qxsim-field"},t("span",{className:"qxsim-field-label"},e(o.label)),t("select",{value:k,disabled:!!o.readonly,onChange:W=>d(o.key,W.target.value)},y.map(W=>t("option",{key:String(le(W)),value:le(W)},pe(W)))))}if(o.type==="percent"){let y=Math.round(Number(o.value||0)*100);return t("label",{className:"qxsim-field"},t("span",{className:"qxsim-field-label"},e(o.label)),t("span",{className:"qxsim-percent"},t("input",{type:"range",min:0,max:100,value:y,onInput:k=>d(o.key,Number(k.target.value)/100)}),t("output",null,`${y}%`)))}if(o.type==="color")return t(E,{field:o,commit:d});let T={value:S,disabled:!!o.readonly,readOnly:!!o.readonly,onChange:y=>w(y.target.value),onBlur:()=>{o.readonly||d(o.key,S)},onKeyDown:y=>{y.key==="Enter"&&o.type!=="text"&&y.currentTarget.blur(),y.key==="Escape"&&w(o.value==null?"":String(o.value))}};return t("label",{className:"qxsim-field"},t("span",{className:"qxsim-field-label"},f?t("b",{className:`qxsim-axis ${f.toLowerCase()}`},f):null,e(o.label)),o.type==="text"?t("textarea",{...T,rows:4}):t("input",{...T,type:o.type==="number"?"number":"text",step:o.type==="number"?"any":void 0}))}function K({title:o,open:d=!0,children:f}){return t("details",{className:"qxsim-section",open:d},t("summary",null,o),t("div",{className:"qxsim-section-body"},f))}function it(o){let d={};for(let f of o||[])d[f.key]=f;return d}function he({label:o,x:d,y:f,xAxis:r="X",yAxis:S="Y",commit:w}){return t("div",{className:"qxsim-pair"},t("div",{className:"qxsim-pair-name"},o),t(ae,{field:d,axis:r,commit:w}),t(ae,{field:f,axis:S,commit:w}))}function ot({field:o,commit:d,createStateChild:f}){return t("div",{className:"qxsim-state-field"},t("div",{className:"qxsim-state-label"},e(o.label)),t("div",{className:"qxsim-state-ref"},t("button",{title:e`新建并绑定${e(o.label)}图片`,onClick:()=>f(o.key,e(o.label))},"+"),t("select",{value:String(o.value??""),"aria-label":e(o.label),onChange:r=>d(o.key,r.target.value)},(o.options||[]).map(r=>t("option",{key:String(le(r)),value:le(r)},pe(r))))))}function xe({inspector:o,commit:d,createStateChild:f}){let r=it(o.fields),S=k=>k?.type==="node"?t(ot,{key:k.key,field:k,commit:d,createStateChild:f}):k?t(ae,{key:k.key,field:k,commit:d}):null,w=(A[o.kind]||[]).map(k=>r[k]).filter(Boolean).map(S),T=null;if(o.kind==="image"){let k=r.fillType?.value==="Horizontal"?r.fillHorizontalType:r.fillType?.value==="Vertical"?r.fillVerticalType:r.fillType?.value==="Radial90"?r.fillRadial90Type:r.fillRadialType,W=[S(r.enableMask),S(r.enableSoftEdge),r.enableSoftEdge?.value?t("div",{className:"qxsim-subfields",key:"soft-fields"},S(r.softEdgeMode),t(he,{label:e("\u7FBD\u5316\u5BBD\u5EA6"),x:r.softEdgeWidthX,y:r.softEdgeWidthY,commit:d}),t(he,{label:e("\u7FBD\u5316\u8303\u56F4"),x:r.horizontalSoftRange,y:r.verticalSoftRange,commit:d})):null,S(r.enableFill),r.enableFill?.value?t("div",{className:"qxsim-subfields",key:"fill-fields"},S(r.fillType),S(k),S(r.fillAmount)):null,S(r.reverseMaskArea)];T=t(a.Fragment,null,t(K,{title:e("\u56FE\u7247\u8BBE\u7F6E")},S(r.imageSource),S(r.imageId),t(N,{imageId:r.imageId?.value,imageSource:r.imageSource?.value,value:r.imageType?.value,commit:d}),S(r.imageColor)),t(K,{title:e("\u906E\u7F69\u8BBE\u7F6E")},W))}let y=o.kind==="textbox"?e("\u6587\u672C\u6846\u8BBE\u7F6E"):o.kind==="button"?e("\u6309\u94AE\u8BBE\u7F6E"):e`${e(o.label)}设置`;return t(a.Fragment,null,t(K,{title:e("\u8282\u70B9\u4FE1\u606F"),open:!1},t(ae,{field:r.name,commit:d})),t(K,{title:e("\u53D8\u6362")},r.posX?t(he,{label:e("\u4F4D\u7F6E"),x:r.posX,y:r.posY,commit:d}):null,r.width?t(he,{label:e("\u5927\u5C0F"),x:r.width,y:r.height,xAxis:"W",yAxis:"H",commit:d}):null,...["rotationX","rotationY","rotationZ"].map(k=>r[k]?t(ae,{key:k,field:r[k],commit:d}):null),r.syncAllDevices?t(ae,{field:r.syncAllDevices,commit:d}):null,r.anchorType?t(ae,{field:r.anchorType,commit:d}):null,r.anchorMinX?t(he,{label:"Min",x:r.anchorMinX,y:r.anchorMinY,commit:d}):null,r.anchorMaxX?t(he,{label:"Max",x:r.anchorMaxX,y:r.anchorMaxY,commit:d}):null,r.pivotX?t(he,{label:e("\u4E2D\u5FC3"),x:r.pivotX,y:r.pivotY,commit:d}):null),t(K,{title:e("\u521B\u5EFA\u8BBE\u7F6E")},r.active?t(ae,{field:r.active,commit:d}):null,r.visible?t(ae,{field:r.visible,commit:d}):null),T||(w.length?t(K,{title:y},w):null),r.canControllerFocus?t(K,{title:e("\u624B\u67C4\u5BFC\u822A"),open:!1},t(ae,{field:r.canControllerFocus,commit:d})):null,r.incomplete?t(K,{title:e("\u5B9E\u73B0\u72B6\u6001")},t(ae,{field:r.incomplete,commit:d})):null)}function v({snap:o,selectedScriptId:d,selectScript:f,draft:r,updateDraft:S,saveScript:w,addScript:T,removeScript:y,exportLua:k,exportScripts:W,exportScriptsGia:ee,notice:ue}){let Y=o.scripts||[],j=Y.find(G=>G.id===d)||null,_=o.mountTargets||[],D=_.filter(G=>G.assetType==="server-control-template"),z=_.filter(G=>G.assetType==="client-control-template"),oe=G=>{let Se=_.find(qe=>qe.id===G);return Se?`${Se.assetLabel} \xB7 ${Se.name}`:""};return t("div",{className:"qxsim-script-page"},t("aside",{className:"qxsim-script-assets"},t("h3",null,e`存档内 Lua 脚本(${Y.length})`),t("button",{className:"qxsim-action",style:{width:"100%",marginBottom:8},onClick:T},e("\uFF0B \u65B0\u5EFA\u811A\u672C")),Y.length?Y.map(G=>t("div",{key:G.id,className:"qxsim-script-list-row"},t("button",{className:`qxsim-script-asset${G.id===d?" active":""}`,onClick:()=>f(G.id)},t("strong",null,G.path||e("(\u672A\u547D\u540D\u811A\u672C)")),t("small",null,G.mounted?e`挂载:${G.assetLabel} · ${G.controlName}`:e("\u672A\u6302\u8F7D\uFF08\u4EC5\u53EF\u88AB require\uFF09"))),t("button",{className:"qxsim-iconbtn",title:e("\u4E0B\u8F7D\u8BE5\u811A\u672C .lua"),onClick:()=>k(G.id)},"\u21E9"),t("button",{className:"qxsim-iconbtn",title:e("\u5220\u9664\u8BE5\u811A\u672C"),onClick:()=>y(G.id)},"\u2715"))):t("div",{className:"qxsim-empty"},e("\u8FD8\u6CA1\u6709\u811A\u672C\uFF0C\u70B9\u51FB\u201C\u65B0\u5EFA\u811A\u672C\u201D\u5F00\u59CB"))),t("main",{className:"qxsim-script-editor"},j&&r?t(a.Fragment,null,t("div",{className:"qxsim-script-title"},t("div",null,t("h2",null,r.path||e("(\u672A\u547D\u540D\u811A\u672C)")),t("span",null,e`属于存档“${o.save?.name||e("\u672A\u547D\u540D\u5B58\u6863")}” · Lua 脚本是存档内独立资产`)),t("span",null,e`脚本 ${j.id}`)),t("div",{className:"qxsim-script-fields"},t("label",null,e("\u811A\u672C\u8DEF\u5F84\uFF08\u5DE5\u4F5C\u533A\u76F8\u5BF9\u8DEF\u5F84\uFF09"),t("input",{type:"text",value:r.path,placeholder:"lua/example.lua",onChange:G=>S({path:G.target.value})})),t("label",null,e("\u6302\u8F7D\u76EE\u6807\uFF08\u5BA2\u6237\u7AEF\u63A7\u4EF6 / \u5BA2\u6237\u7AEF\u63A7\u4EF6\u6A21\u677F\uFF09"),t("select",{value:r.controlId?`${r.controlAsset||"server-control-template"}|${r.controlId}`:"",onChange:G=>{let[Se,qe]=G.target.value.split("|");S(qe?{controlId:qe,controlAsset:Se}:{controlId:"",controlAsset:""})}},t("option",{value:""},e("\u672A\u6302\u8F7D\uFF08\u4E0D\u751F\u6548\uFF0C\u4EC5\u53EF\u88AB require\uFF09")),t("optgroup",{label:e("\u670D\u52A1\u5668\u63A7\u4EF6\u6A21\u677F \xB7 \u5BA2\u6237\u7AEF\u63A7\u4EF6\u5BB9\u5668\u5185")},D.map(G=>t("option",{key:G.id,value:`${G.assetType}|${G.id}`},`${G.name} \xB7 ${G.id}`))),z.length?t("optgroup",{label:e("\u5BA2\u6237\u7AEF\u63A7\u4EF6\u6A21\u677F")},z.map(G=>t("option",{key:G.id,value:`${G.assetType}|${G.id}`},`${G.name} \xB7 ${G.id}`))):null))),t("label",null,e("Lua \u6E90\u7801"),t("textarea",{value:r.source,spellCheck:!1,placeholder:e("-- \u5728\u8FD9\u91CC\u8F93\u5165\u5BA2\u6237\u7AEF Lua\uFF1B\u811A\u672C\u53EA\u6709\u6302\u8F7D\u5230\u5BA2\u6237\u7AEF\u63A7\u4EF6\u540E\u624D\u4F1A\u5728\u8BD5\u73A9\u65F6\u751F\u6548"),onChange:G=>S({source:G.target.value})})),t("div",{className:"qxsim-script-footer"},t("span",null,r.dirty?e("\u6709\u672A\u4FDD\u5B58\u7684\u4FEE\u6539"):ue||(j.mounted?e`已挂载:${oe(j.controlId)}`:e("\u5F53\u524D\u672A\u6302\u8F7D\uFF0C\u8BD5\u73A9\u65F6\u4E0D\u4F1A\u81EA\u52A8\u8FD0\u884C"))),t("span",{className:"spacer"}),t("button",{className:"qxsim-action",onClick:W},e("\u21E9 \u811A\u672C\u5305 JSON")),t("button",{className:"qxsim-action",onClick:ee},e("\u21E9 \u811A\u672C\u5305 GIA")),t("button",{className:"qxsim-action primary",disabled:!r.dirty,onClick:w},e("\u4FDD\u5B58\u811A\u672C")))):t("div",{className:"qxsim-empty"},e("\u8BF7\u65B0\u5EFA\u6216\u9009\u62E9\u4E00\u4E2A\u811A\u672C"))))}function ne(o){if(o===void 0)return"null";try{return JSON.stringify(o)}catch{return String(o)}}function se(o){let d=String(o??"").trim();if(!d)return null;try{return JSON.parse(d)}catch{return d}}function Ge(o){return!!(o&&typeof o=="object"&&!Array.isArray(o)&&Object.prototype.hasOwnProperty.call(o,"fromSignalParam"))}function De(o){return{version:1,dirty:!1,rules:(Array.isArray(o?.rules)?o.rules:[]).map((f,r)=>({id:String(f.id||`signal-${r+1}`),signalName:String(f.signalName||""),actions:Array.isArray(f.actions)&&f.actions.length?f.actions.map(S=>ja(S)):[Oe("setCustomVariable")]}))}}let Ft=["PlayerSelf","AllPlayers","Player1","Player2","Player3","Player4","Player5","Player6","Player7","Player8"],zt=["PlayerSelf","Level","Player1","Player2","Player3","Player4","Player5","Player6","Player7","Player8"],Ut={PlayerSelf:"PlayerSelf \u5F53\u524D\u73A9\u5BB6",AllPlayers:"AllPlayers \u5168\u90E8\u73A9\u5BB6",Level:"Level \u5173\u5361",Player1:"Player1 \u73A9\u5BB61",Player2:"Player2 \u73A9\u5BB62",Player3:"Player3 \u73A9\u5BB63",Player4:"Player4 \u73A9\u5BB64",Player5:"Player5 \u73A9\u5BB65",Player6:"Player6 \u73A9\u5BB66",Player7:"Player7 \u73A9\u5BB67",Player8:"Player8 \u73A9\u5BB68"};function rt(o){return zt.includes(o)&&o!=="AllPlayers"?o:o==="Level"?"Level":"PlayerSelf"}function st(o){return Ft.includes(o)?o:"PlayerSelf"}function Oe(o){return o==="sendClientScriptSignal"?{kind:"sendClientScriptSignal",target:"PlayerSelf",signalName:"",params:[]}:{kind:"setCustomVariable",entityType:"PlayerSelf",name:"",value:0}}function Da(o){return{version:1,rules:(o?.rules||[]).map(d=>({id:String(d.id||""),signalName:String(d.signalName||"").trim(),actions:(d.actions||[]).map(f=>f?.kind==="sendClientScriptSignal"?{kind:"sendClientScriptSignal",target:st(f.target),signalName:String(f.signalName||"").trim(),params:Array.isArray(f.params)?f.params:[]}:{kind:"setCustomVariable",entityType:rt(f?.entityType),name:String(f?.name||"").trim(),value:f&&Object.prototype.hasOwnProperty.call(f,"value")?f.value:0})}))}}function Ra(o){let d=[];for(let[f,r]of(o?.rules||[]).entries()){String(r.signalName||"").trim()||d.push(e`规则 ${f+1} 需要监听信号名`);let S=r.actions||[];S.length||d.push(e`规则 ${f+1} 至少需要一个动作`);for(let[w,T]of S.entries())T?.kind==="sendClientScriptSignal"?String(T.signalName||"").trim()||d.push(e`规则 ${f+1} 动作 ${w+1} 需要客户端信号名`):String(T?.name||"").trim()||d.push(e`规则 ${f+1} 动作 ${w+1} 需要变量名`)}return d}function ja(o){if(o?.kind==="sendClientScriptSignal")return{kind:"sendClientScriptSignal",target:st(o.target),signalName:String(o.signalName||""),params:Array.isArray(o.params)?o.params.map(f=>{try{return JSON.parse(JSON.stringify(f))}catch{return f}}):[]};let d=0;if(o&&Object.prototype.hasOwnProperty.call(o,"value"))try{d=JSON.parse(JSON.stringify(o.value))}catch{d=o.value}return{kind:"setCustomVariable",entityType:rt(o?.entityType),name:String(o?.name||""),value:d}}function Gt({label:o,value:d,onChange:f}){let r=Ge(d),[S,w]=a.useState(()=>r?"":ne(d));return a.useEffect(()=>{Ge(d)||w(ne(d))},[d]),t("label",{className:"qxsim-field"},t("span",{className:"qxsim-field-label"},o),t("select",{value:r?"param":"literal","aria-label":e`${e(o)}来源`,onChange:T=>{T.target.value==="param"?f({fromSignalParam:Number(d?.fromSignalParam)||0}):f(se(S||"0"))}},t("option",{value:"literal"},e("\u5B57\u9762\u91CF\uFF08JSON\uFF09")),t("option",{value:"param"},e("\u5F15\u7528\u76D1\u542C\u4FE1\u53F7\u53C2\u6570"))),r?t("input",{type:"number",min:0,step:1,value:Number(d.fromSignalParam)||0,"aria-label":e`${e(o)}参数序号`,onChange:T=>f({fromSignalParam:Math.max(0,Math.trunc(Number(T.target.value)||0))})}):t("textarea",{className:"qxsim-logic-json",value:S,spellCheck:!1,"aria-label":e`${e(o)}字面量`,onBlur:()=>f(se(S)),onChange:T=>w(T.target.value)}))}function _a({params:o,onChange:d}){let f=Array.isArray(o)?o:[];return t("div",{className:"qxsim-field wide"},t("span",{className:"qxsim-field-label"},e("\u5BA2\u6237\u7AEF\u4FE1\u53F7\u53C2\u6570\uFF08\u6309\u6DFB\u52A0\u987A\u5E8F\uFF09")),f.length?f.map((r,S)=>t("div",{key:S,style:{display:"flex",gap:6,alignItems:"flex-start",marginBottom:6}},t("div",{style:{flex:1,minWidth:0}},t(Gt,{label:e`参数 ${S}`,value:r,onChange:w=>d(f.map((T,y)=>y===S?w:T))})),t("button",{className:"qxsim-iconbtn",title:e("\u5220\u9664\u53C2\u6570"),onClick:()=>d(f.filter((w,T)=>T!==S))},"\u2715"))):t("div",{className:"qxsim-muted"},e("\u6682\u65E0\u53C2\u6570\uFF0C\u53EF\u53D1\u9001\u7A7A\u53C2\u6570\u5217\u8868")),t("button",{className:"qxsim-action",style:{marginTop:4},onClick:()=>d(f.concat([0]))},e("\uFF0B \u6DFB\u52A0\u53C2\u6570")))}function Ba({snap:o,draft:d,setDraft:f,saveLogic:r,notice:S,error:w}){let T=d?.rules||[];function y(Y){f({version:1,rules:Y,dirty:!0})}function k(){y(T.concat([{id:`signal-${Date.now().toString(36)}`,signalName:"",actions:[Oe("setCustomVariable")]}]))}function W(Y,j){y(T.map((_,D)=>D===Y?{..._,...j}:_))}function ee(Y,j,_){let D=T[Y];D&&W(Y,{actions:D.actions.map((z,oe)=>oe===j?{...z,..._}:z)})}function ue(Y,j,_){ee(Y,j,Oe(_))}return t("div",{className:"qxsim-server-logic"},t("div",{className:"qxsim-logic-wrap"},t("div",{className:"qxsim-logic-title"},t("div",null,t("h2",null,e("\u670D\u52A1\u7AEF\u903B\u8F91")),t("p",null,e`属于存档“${o.save?.name||e("\u672A\u547D\u540D\u5B58\u6863")}” · 监听客户端信号后设置 Level / 玩家变量,或向指定玩家发送客户端脚本信号`)),t("button",{className:"qxsim-action primary",disabled:!d?.dirty,onClick:r},e("\u4FDD\u5B58\u670D\u52A1\u7AEF\u903B\u8F91"))),t("div",{className:"qxsim-note"},e("\u8FD9\u662F\u6A21\u62DF\u5668\u5B58\u6863\u683C\u5F0F\uFF0C\u4E0D\u662F\u5B98\u65B9\u8282\u70B9\u56FE\u3002PlayerSelf \u8868\u793A\u53D1\u4FE1\u53F7\u7684\u90A3\u4F4D\u73A9\u5BB6\uFF1BPlayer1\u20138 \u662F\u56FA\u5B9A\u5EA7\u4F4D\uFF1BAllPlayers \u5411\u672C\u5C40\u5168\u90E8\u8BD5\u73A9\u73A9\u5BB6\u5E7F\u64AD\u3002")),w?t("div",{className:"qxsim-logic-error"},e(w)):null,T.length?T.map((Y,j)=>t("section",{key:Y.id||j,className:"qxsim-logic-rule"},t("div",{className:"qxsim-logic-rule-head"},t("strong",null,e`规则 ${j+1}`),t("label",{className:"qxsim-field"},t("span",{className:"qxsim-field-label"},e("\u76D1\u542C\u4FE1\u53F7\u540D")),t("input",{type:"text",value:Y.signalName,placeholder:"EarnGold","aria-label":e`规则 ${j+1} 监听信号名`,onChange:_=>W(j,{signalName:_.target.value})})),t("button",{className:"qxsim-iconbtn",title:e("\u5220\u9664\u89C4\u5219"),onClick:()=>y(T.filter((_,D)=>D!==j))},"\u2715")),t("div",{className:"qxsim-logic-actions"},(Y.actions||[]).map((_,D)=>t("div",{key:D,className:"qxsim-logic-action"},t("div",{className:"qxsim-logic-action-head"},t("strong",null,e`动作 ${D+1}`),t("select",{value:_.kind,"aria-label":e`规则 ${j+1} 动作 ${D+1} 类型`,onChange:z=>ue(j,D,z.target.value)},t("option",{value:"setCustomVariable"},e("\u8BBE\u7F6E\u81EA\u5B9A\u4E49\u53D8\u91CF")),t("option",{value:"sendClientScriptSignal"},e("\u53D1\u9001\u5BA2\u6237\u7AEF\u811A\u672C\u4FE1\u53F7"))),t("span",null,_.kind==="sendClientScriptSignal"?e("\u53D1\u7ED9\u5F53\u524D\u73A9\u5BB6\u3001\u6307\u5B9A\u73A9\u5BB6\u6216\u5168\u90E8\u73A9\u5BB6"):e("\u5199\u5165 Level / \u5F53\u524D\u73A9\u5BB6 / \u73A9\u5BB61-8")),t("button",{className:"qxsim-iconbtn",title:e("\u5220\u9664\u52A8\u4F5C"),disabled:(Y.actions||[]).length<=1,onClick:()=>W(j,{actions:Y.actions.filter((z,oe)=>oe!==D)})},"\u2715")),_.kind==="sendClientScriptSignal"?t("div",{className:"qxsim-logic-fields"},t("label",{className:"qxsim-field"},t("span",{className:"qxsim-field-label"},e("\u53D1\u9001\u76EE\u6807")),t("select",{value:st(_.target),onChange:z=>ee(j,D,{target:z.target.value})},Ft.map(z=>t("option",{key:z,value:z},Ut[z])))),t("label",{className:"qxsim-field"},t("span",{className:"qxsim-field-label"},e("\u5BA2\u6237\u7AEF\u4FE1\u53F7\u540D")),t("input",{type:"text",value:_.signalName,placeholder:"GoldChanged",onChange:z=>ee(j,D,{signalName:z.target.value})})),t(_a,{params:_.params,onChange:z=>ee(j,D,{params:z})})):t("div",{className:"qxsim-logic-fields"},t("label",{className:"qxsim-field"},t("span",{className:"qxsim-field-label"},e("\u5B9E\u4F53")),t("select",{value:rt(_.entityType),onChange:z=>ee(j,D,{entityType:z.target.value})},zt.map(z=>t("option",{key:z,value:z},e(Ut[z]))))),t("label",{className:"qxsim-field"},t("span",{className:"qxsim-field-label"},e("\u53D8\u91CF\u540D")),t("input",{type:"text",value:_.name,placeholder:"Gold",onChange:z=>ee(j,D,{name:z.target.value})})),t("div",{className:"wide"},t(Gt,{label:e("\u53D8\u91CF\u503C"),value:_.value,onChange:z=>ee(j,D,{value:z})}))))),t("div",{className:"qxsim-logic-actions-foot"},t("button",{className:"qxsim-action",onClick:()=>W(j,{actions:(Y.actions||[]).concat([Oe("setCustomVariable")])})},e("\uFF0B \u8BBE\u7F6E\u81EA\u5B9A\u4E49\u53D8\u91CF")),t("button",{className:"qxsim-action",onClick:()=>W(j,{actions:(Y.actions||[]).concat([Oe("sendClientScriptSignal")])})},e("\uFF0B \u53D1\u9001\u5BA2\u6237\u7AEF\u811A\u672C\u4FE1\u53F7")))))):t("div",{className:"qxsim-logic-empty"},e("\u8FD8\u6CA1\u6709\u76D1\u542C\u89C4\u5219\u3002\u8BD5\u73A9\u65F6\u5BA2\u6237\u7AEF SendSignal \u4E0D\u4F1A\u81EA\u52A8\u6539\u53D8\u91CF\u6216\u56DE\u4F20\u4FE1\u53F7\u3002")),t("div",{className:"qxsim-logic-actions-foot"},t("button",{className:"qxsim-action",onClick:k},e("\uFF0B \u6DFB\u52A0\u76D1\u542C\u89C4\u5219"))),t("div",{className:"qxsim-script-footer",style:{marginTop:16}},t("span",null,d?.dirty?e("\u6709\u672A\u4FDD\u5B58\u7684\u4FEE\u6539"):S||e("\u4FDD\u5B58\u540E\u4F1A\u5199\u5165\u5F53\u524D\u5B58\u6863\uFF0C\u4E0B\u6B21\u8BD5\u73A9\u751F\u6548")),t("span",{className:"spacer"}))))}function Ya({inspector:o,autofill:d,onSave:f}){let[r,S]=a.useState(String(o.guid??"")),[w,T]=a.useState(!1),[y,k]=a.useState(!1),[W,ee]=a.useState("");a.useEffect(()=>{S(String(o.guid??"")),T(!1),ee("")},[o.id,o.guid]);let ue=d?.count>1&&d.selectedOffset>=0,Y=/^[0-9]+$/.test(r.trim())?Number(r)-(d?.selectedOffset||0):NaN,j=Y+(d?.count||0)-1,_=nt(Y)&&nt(j);async function D(z){z.preventDefault();let oe=r.trim();if(!/^[0-9]+$/.test(oe)||!nt(oe)){ee(e`索引范围:${1073741824}–${1077936127}`);return}k(!0),ee("");try{await f(o.id,Number(oe),w&&ue)}catch(G){ee(G?.message||String(G))}finally{k(!1)}}return t("form",{onSubmit:D,style:{marginTop:8}},t("label",{className:"qxsim-field"},t("span",{className:"qxsim-field-label"},e("\u5BA2\u6237\u7AEF\u63A7\u4EF6\u7D22\u5F15")),t("div",{style:{display:"flex",gap:6}},t("input",{type:"text",inputMode:"numeric","aria-label":e("\u5BA2\u6237\u7AEF\u63A7\u4EF6\u7D22\u5F15"),value:r,disabled:y,onChange:z=>{S(z.target.value),ee("")},onKeyDown:z=>{z.key==="Escape"&&(S(String(o.guid)),ee(""))}}),t("button",{type:"submit",className:"qxsim-action",disabled:y||!w&&r.trim()===String(o.guid)||w&&!_},y?e("\u4FDD\u5B58\u4E2D"):e("\u4FEE\u6539")))),ue?t("label",{style:{display:"flex",gap:6,alignItems:"center",margin:"6px 0"}},t("input",{type:"checkbox",checked:w,disabled:y,onChange:z=>T(z.target.checked)}),e("\u81EA\u52A8\u4FEE\u6539\u5176\u4ED6\u5BA2\u6237\u7AEF\u7D22\u5F15\u503C")):null,w&&ue?t("div",{className:"qxsim-note","aria-label":e("\u81EA\u52A8\u586B\u5145\u7D22\u5F15\u9884\u89C8")},e`以当前控件为基准,按 GIA 导入顺序填充 ${d.count} 个控件(${d.templateCount} 个模板及其子控件)。`,t("div",null,_?e`索引范围:${Y}–${j}`:e("\u7D22\u5F15\u8303\u56F4\u8D85\u51FA\u6709\u6548\u8303\u56F4\uFF0C\u8BF7\u68C0\u67E5\u8F93\u5165\u3002")),t("div",null,e("\u9002\u7528\u4E8E\u6574\u6279\u5BFC\u5165\u540E\u672A\u589E\u5220\u3001\u91CD\u6392\u7684\u6A21\u677F\u3002\u670D\u52A1\u7AEF\u754C\u9762\u548C\u811A\u672C\u7D22\u5F15\u9700\u5355\u72EC\u586B\u5199\u3002"))):null,W?t("div",{role:"alert",className:"qxsim-note"},e(W)):null,t("div",{className:"qxsim-muted",style:{lineHeight:1.5}},e("\u586B\u5199 GIA \u5BFC\u5165\u540E\u5B9E\u9645\u663E\u793A\u7684\u7D22\u5F15\uFF1B\u4FEE\u6539\u540E\u4ECE\u9875\u9762\u4E0A\u65B9\u7EE7\u7EED\u540C\u6B65 Lua\u3002")))}function Xa({snap:o,addScriptMounted:d,mountScriptTo:f,unmountScript:r,openScript:S}){let w=(o.scripts||[]).filter(y=>y.controlId===o.selectedId),T=(o.scripts||[]).filter(y=>y.controlId!==o.selectedId);return t(a.Fragment,null,t(K,{title:e("\u6302\u8F7D\u5230\u8BE5\u63A7\u4EF6\u7684\u811A\u672C")},w.length?w.map(y=>t("div",{key:y.id,className:"qxsim-script-list-row"},t("button",{className:"qxsim-script-asset",onClick:()=>S(y.id)},t("strong",null,y.path||e("(\u672A\u547D\u540D\u811A\u672C)")),t("small",null,e`脚本 ${y.id}`)),t("button",{className:"qxsim-iconbtn",title:e("\u89E3\u9664\u6302\u8F7D\uFF08\u4FDD\u7559\u811A\u672C\uFF09"),onClick:()=>r(y.id)},"\u292B"))):t("div",{className:"qxsim-note"},e("\u8BE5\u63A7\u4EF6\u5C1A\u672A\u6302\u8F7D\u811A\u672C\u3002\u811A\u672C\u6302\u8F7D\u5230\u5BA2\u6237\u7AEF\u63A7\u4EF6\u540E\u624D\u4F1A\u5728\u8BD5\u73A9\u65F6\u751F\u6548\u3002"))),t(K,{title:e("\u6302\u8F7D\u5DF2\u6709\u811A\u672C"),open:!1},T.length?t("label",{className:"qxsim-field"},t("span",{className:"qxsim-field-label"},e("\u9009\u62E9\u811A\u672C\u6302\u8F7D\u5230\u8BE5\u63A7\u4EF6")),t("select",{value:"","aria-label":e("\u9009\u62E9\u811A\u672C\u6302\u8F7D\u5230\u8BE5\u63A7\u4EF6"),onChange:y=>{let k=y.target.value;y.target.value="",k&&f(k)}},t("option",{value:""},e("\u9009\u62E9\u811A\u672C\u2026")),T.map(y=>t("option",{key:y.id,value:y.id},`${y.path||e("(\u672A\u547D\u540D\u811A\u672C)")} \xB7 ${y.id}${y.mounted?e`(当前挂载于 ${y.assetLabel} · ${y.controlName},将移动到此控件)`:e("\uFF08\u672A\u6302\u8F7D\uFF09")}`)))):t("div",{className:"qxsim-note"},e("\u5B58\u6863\u5185\u8FD8\u6CA1\u6709\u5176\u4ED6\u811A\u672C\uFF0C\u53EF\u70B9\u51FB\u4E0B\u65B9\u6309\u94AE\u65B0\u5EFA\u3002")),t("div",{className:"qxsim-script-actions",style:{marginTop:8}},t("button",{onClick:()=>d(o.selectedId)},e("\uFF0B \u65B0\u5EFA\u811A\u672C\u5E76\u6302\u8F7D\u5230\u6B64\u63A7\u4EF6")))))}function Wa(o,d){let f=null,r=null;function S(w,T){w.id===d&&(f=w,r=T);for(let y of w.children||[])S(y,w)}if(S(o,null),f?.kind==="container")return f.id;if(f?.kind==="server-container")return f.children?.find(w=>w.kind==="container")?.id||f.id;for(;r&&r.kind!=="container";){let T=function(y){for(let k of y.children||[])k===r&&(w=y),T(k)},w=null;T(o),r=w}return r?.id||o.children?.find(w=>w.kind==="container")?.id}function Ha(o,d){let f=null;function r(S){S.id===d&&(f=S);for(let w of S.children||[])r(w)}return r(o),f&&f.kind!=="server-container"?f.id:Wa(o,d)}function Dt(o,d,f,r,S,w,T=!1){let y=o,k=o.kind,W=k==="textbox"||k==="textwindow",ee=y.renderLeft??y.left,ue=y.renderBottom??y.bottom,Y=y.renderWidth??y.width,j=y.renderHeight??y.height,_=y.renderRotationZ??o.rotationZ??0,D={left:`${ee/f*100}%`,bottom:`${ue/r*100}%`,width:`${Y/f*100}%`,height:`${j/r*100}%`,"--rotation":`${-Number(_)}deg`,fontSize:Math.max(8,Math.min(40,Number(o.fontSize||12))),color:W?U(o.fontColor,4294967295):"#fff"};if(Object.assign(D,ka(y,f,r)),T)return t("div",{className:"qxsim-box selected qxsim-selection","data-selection-id":o.id,style:{...D,border:"1px solid #61b9ff",background:"transparent",zIndex:2}},k!=="container"?["tl","tr","bl","br"].map(oe=>t("i",{key:oe,className:`qxsim-handle ${oe}`})):null);W&&w&&(D.fontFamily=w),k==="image"?Object.assign(D,J(o.primitive,U(o.imageColor,4294967295))):W?(D.background=U(o.bgColor,16777215),D.justifyContent=o.horizontalAlignment==="Right"?"flex-end":o.horizontalAlignment==="Middle"?"center":"flex-start",D.alignItems=o.verticalAlignment==="Bottom"?"flex-end":o.verticalAlignment==="Middle"?"center":"flex-start",D.textShadow=o.enableOutline===!1?"none":`0 0 2px ${U(o.outlineColor,4278190080)}`):k==="container"&&(D.background="transparent");let z=k==="image"&&o.primitive==="sprite"?t(h,{key:me(o.imageId,o.imageSource),item:o}):W?t(x,{item:o,zoom:S,fontFamily:w}):k==="image"&&o.primitive==="missing"?t("span",{className:"qxsim-box-label"},e`缺少图片 ${o.imageId||""}`):k!=="container"&&k!=="image"?t("span",{className:"qxsim-box-label"},o.name||e(M[k]?.[1])||k):null;return t("div",{key:o.id,"data-control-id":o.id,className:`qxsim-box ${k}${o.instantiated?" dynamic":""}${o.pressed?" pressed":""}`,style:D},z)}function Va({sessionId:o}){let d=C(),f=Z(),[r,S]=a.useState(null),w=a.useRef(null),T=a.useRef(Promise.resolve()),[y,k]=a.useState(""),[W,ee]=a.useState(null),[ue,Y]=a.useState(!1);a.useEffect(()=>{let i=!0;return Ta().then(p=>{i&&ee(p)},p=>{i&&k(p?.message||e("\u672C\u5730\u5B57\u4F53\u52A0\u8F7D\u5931\u8D25"))}),()=>{i=!1}},[]);let j=g({sessionId:o,api:X,playUrl:l,onError:k}),[_,D]=a.useState(null),[z,oe]=a.useState(!1),[G,Se]=a.useState(!1),[qe,Q]=a.useState(""),Re=a.useRef(null),[lt,je]=a.useState([]),[Rt,jt]=a.useState([]),[be,Ja]=a.useState("ui"),[ct,dt]=a.useState("base"),[pt,Ka]=a.useState("fit"),[ut,Qa]=a.useState({}),[_e,mt]=a.useState(""),[Ee,ft]=a.useState("template"),[gt,Be]=a.useState(""),[ht,Fe]=a.useState(null),[_t,xt]=a.useState({version:1,rules:[],dirty:!1}),Bt=a.useRef(null),[Ye,Za]=a.useState({width:0,height:0});a.useEffect(()=>{let i=Bt.current;if(!i||typeof ResizeObserver>"u")return;let p=new ResizeObserver(q=>{let O=q[0]?.contentRect;O&&O.width>0&&Za({width:O.width,height:O.height})});return p.observe(i),()=>p.disconnect()},[r?.canvas?.id]);function Le(i,{keepLogicDraft:p=!0}={}){return w.current=i,S(i),i?.scripts&&Be(q=>i.scripts.some(O=>O.id===q)?q:i.scripts[0]?.id||""),xt(q=>p&&q?.dirty?q:De(i?.serverLogic)),i}let Xe=a.useCallback(async()=>{try{k(""),Le(await X(o,"get"),{keepLogicDraft:!1})}catch(i){k(i?.message||String(i))}},[o]),We=a.useCallback(async()=>{try{let i=await X(o,"archives");jt(i?.archives||[])}catch{jt([])}},[o]);a.useEffect(()=>{Xe(),We()},[Xe,We]);function V(i,p=""){let q=async()=>{let O=w.current;if(!O)throw new Error("editor is not ready");try{if(p&&O.asset?.type!==p)throw new Error(e("\u5F53\u524D\u8D44\u4EA7\u5DF2\u5207\u6362\uFF0C\u8BF7\u91CD\u65B0\u9009\u62E9\u63A7\u4EF6\u540E\u4FEE\u6539\u7D22\u5F15"));let re=await X(o,"patch",{op:{...typeof i=="function"?i(O):i,expectedRevision:O.version}});return k(""),Le(re)}catch(re){throw k(re?.message||String(re)),/revision conflict/.test(String(re?.message||re))&&await Xe(),re}};return T.current=T.current.then(q,q),T.current}async function en(i,p,q,O=!1){await ve(),await V({op:"setControlGuid",id:i,guid:p,autoFillClientGuids:O},q),Q(e("\u63A7\u4EF6\u7D22\u5F15\u5DF2\u4FEE\u6539\u3002\u8BF7\u9009\u62E9\u4E0A\u65B9\u300C\u5168\u91CF\u66FF\u6362\u811A\u672C\u7D22\u5F15\u300D\u6216\u300C\u590D\u5236\u63D0\u793A\u8BCD\u7ED9 AI\u300D\u3002"))}async function tn(){await ve(),await Ne(),await T.current;let i=w.current;if(!i.storage?.path)throw s&&D(`${i.save?.name||"project"}.save.json`),new Error(e("\u8BF7\u5148\u4FDD\u5B58\u5B8C\u6574\u5B58\u6863\uFF0C\u518D\u590D\u5236\u63D0\u793A\u8BCD\uFF1BAI \u9700\u8981\u8BFB\u53D6\u8FD9\u6B21\u5B9E\u9645\u4FEE\u6539\u7684\u5B58\u6863\u3002"));await X(o,"save",{path:i.storage.path,expectedRevision:i.version});let p=i.controlGuidChanges||[],q=[e("\u8BF7\u5B8C\u6210\u6A21\u62DF\u5668\u63A7\u4EF6\u7D22\u5F15\u4E0E Lua \u5F15\u7528\u540C\u6B65\u3002"),e`工作区:${i.workspace?.path||e("\u8BF7\u5148\u6838\u5BF9\u5DE5\u4F5C\u533A")}`,e`最新完整存档:${i.storage.path}(编辑器已保存)`,e`Lua 文件:${(i.scripts||[]).map(O=>O.path||e`内联脚本 ${O.id}`).join("\u3001")||e("\u6682\u65E0")}`,e("\u5148\u4ECE\u4E0A\u8FF0\u6587\u4EF6\u91CD\u65B0\u52A0\u8F7D\u6700\u65B0\u5B58\u6863\uFF0C\u4E0D\u8981\u4F7F\u7528\u53E6\u4E00\u4E2A MCP/Web \u8FDB\u7A0B\u91CC\u7684\u65E7\u5DE5\u7A0B\u3002"),e`获取新旧映射:读取该 JSON 顶层的 controlGuidChanges 数组,当前共 ${p.length} 条,必须读取全部记录。oldGuid 是旧索引,newGuid 是新索引;controlAsset + controlId 标识控件,controlName 是名称,id 是记录编号,batchId 是批次。`,e("\u83B7\u53D6\u811A\u672C\uFF1A\u8BFB\u53D6 assets.scripts \u6570\u7EC4\uFF1B\u6BCF\u9879\u7684 source \u662F\u5B58\u6863\u5185\u6E90\u7801\uFF0Cpath \u662F\u811A\u672C\u6587\u4EF6\u8DEF\u5F84\uFF08\u76F8\u5BF9\u8DEF\u5F84\u4EE5\u5DE5\u4F5C\u533A\u4E3A\u57FA\u51C6\uFF09\u3002"),e("\u6309\u63A7\u4EF6\u8EAB\u4EFD\u548C\u53D8\u66F4\u987A\u5E8F\u6838\u5BF9\u5168\u90E8 Lua \u811A\u672C\u7684\u7D22\u5F15\u5E38\u91CF\u3001\u914D\u7F6E\u8868\u4E0E\u8C03\u7528\uFF0C\u4FEE\u6539\u5B58\u6863\u4E2D\u7684 source \u53CA\u76F8\u5173 Lua \u6E90\u6587\u4EF6\u548C\u751F\u6210\u5668\u6620\u5C04\uFF0C\u907F\u514D\u91CD\u5EFA\u540E\u8986\u76D6\u3002\u4E0D\u8981\u5168\u5C40\u66FF\u6362\u540C\u503C\u6570\u5B57\uFF0C\u4E5F\u4E0D\u8981\u6539\u8FD0\u884C\u65F6\u5B9E\u4F8B ID \u6216\u56FE\u7247\u8D44\u6E90 ID\u3002"),e("\u540C\u4E00 batchId \u662F\u540C\u65F6\u6620\u5C04\uFF0C\u987B\u6309\u539F\u503C\u4E00\u6B21\u6027\u5E94\u7528\uFF0C\u4E0D\u80FD\u9010\u6761\u66FF\u6362\u5BFC\u81F4\u7D22\u5F15\u4E32\u6539\u3002"),e("\u68C0\u67E5\u65E7\u7D22\u5F15\u5F15\u7528\u5E76\u91CD\u65B0\u8BD5\u73A9\uFF1B\u4EC5\u5728\u5F15\u7528\u5168\u90E8\u540C\u6B65\u6216\u660E\u786E\u6CA1\u6709\u5F15\u7528\u540E\uFF0C\u7528 acknowledgeControlGuidChanges \u7684 changeIds \u6E05\u9664\u5DF2\u6838\u5BF9\u8BB0\u5F55\uFF0C\u4FDD\u5B58\u5B8C\u6574\u5B58\u6863\u3002\u672A\u5224\u65AD\u7684\u8BB0\u5F55\u7EE7\u7EED\u4FDD\u7559\u3002"),e("\u5B8C\u6210\u540E\u544A\u77E5\u7528\u6237\u91CD\u65B0\u8F7D\u5165\u8FD9\u4E2A\u5B58\u6863\uFF0C\u518D\u901A\u8FC7\u300CLua \u811A\u672C \u2192 \u5B9E\u673A\u811A\u672C\u540C\u6B65\u300D\u66F4\u65B0\u6E38\u620F\u6587\u4EF6\uFF1B\u4E0D\u8981\u91CD\u65B0\u5BFC\u5165 GIA\uFF0C\u4E5F\u4E0D\u8981\u64C5\u81EA\u590D\u5236\u5230\u6E38\u620F\u76EE\u5F55\u3002")].join(`
|
|
32
|
+
`);try{await navigator.clipboard.writeText(q),Q(e("\u5B58\u6863\u5DF2\u4FDD\u5B58\uFF0C\u63D0\u793A\u8BCD\u5DF2\u590D\u5236\uFF0C\u5305\u542B\u5B8C\u6574\u6620\u5C04\u7684\u8BFB\u53D6\u65B9\u5F0F\u3002\u7C98\u8D34\u7ED9 AI\uFF1B\u5904\u7406\u540E\u91CD\u65B0\u8F7D\u5165\u5B58\u6863\u3002"))}catch{Q(e("\u5B58\u6863\u5DF2\u4FDD\u5B58\u3002\u526A\u8D34\u677F\u4E0D\u53EF\u7528\uFF0C\u53EF\u4ECE\u4E0B\u65B9\u6587\u672C\u6846\u624B\u52A8\u590D\u5236\u63D0\u793A\u8BCD\u3002"))}return q}let an=(i,p)=>void V(q=>({op:"set",key:i,value:typeof p=="function"?p(q.inspector.fields.find(O=>O.key===i)?.value):p})).catch(()=>{});async function nn(){let{imageId:i,imageSource:p}=w.current?.boxes?.find(q=>q.id===w.current.selectedId)||{};if(Ae(i,p)){Se(!0);try{await X(o,"image-refresh",{imageId:i,imageSource:p}),fa(i,p),Q(e`图片 ${i} 已重新下载;同源试玩页会同步刷新。`)}catch(q){k(q.message)}finally{Se(!1)}}}async function on(i,p){let q=w.current?.inspector?.id;if(q)try{let O=await V({op:"add",kind:"image",parentId:q,name:e`${e(p)}图片`});await V({op:"set",id:q,key:i,value:O.selectedId}),Q(e`${e(p)}已创建并绑定;可在控件树中继续编辑图片。`)}catch{}}a.useEffect(()=>{let i=r?.scripts?.find(p=>p.id===gt);Fe(p=>p&&i&&p.id===i.id&&p.dirty?p:i?{id:i.id,path:i.path,source:i.source,controlId:i.controlId,controlAsset:i.controlAsset,dirty:!1}:null)},[r,gt]);function rn(i){Fe(p=>p&&{...p,...i,dirty:!0})}async function ve(){let i=ht;!i||!i.dirty||(await V({op:"updateScript",id:i.id,path:i.path,source:i.source,controlId:i.controlId,controlAsset:i.controlAsset}),Fe(p=>p&&p.id===i.id?{...p,dirty:!1}:p))}function Yt(){ve().then(()=>Q(e("Lua \u811A\u672C\u5DF2\u4FDD\u5B58\u5230\u5F53\u524D\u5B58\u6863"))).catch(()=>{})}async function Ne({silent:i=!1}={}){let p=_t;if(!p||!p.dirty)return;let q=Ra(p);if(q.length){let re=q[0];throw i||k(re),new Error(re)}let O=await V({op:"setServerLogic",logic:Da(p)});xt(De(O.serverLogic)),Q(e("\u670D\u52A1\u7AEF\u903B\u8F91\u5DF2\u4FDD\u5B58\u5230\u5F53\u524D\u5B58\u6863"))}function sn(){Ne({silent:!0}).catch(()=>{})}function Me(i){Yt(),sn(),Ja(i)}async function Xt(i={}){let p=await V({op:"addScript",...i}),q=p.scripts?.[p.scripts.length-1];return q&&Be(q.id),Q(i.controlId?e("\u5DF2\u65B0\u5EFA\u811A\u672C\u5E76\u6302\u8F7D\u5230\u8BE5\u63A7\u4EF6"):e("\u5DF2\u65B0\u5EFA\u811A\u672C\uFF0C\u53EF\u7F16\u8F91\u8DEF\u5F84\u3001\u6E90\u7801\u548C\u6302\u8F7D\u76EE\u6807")),q}function ln(i){ht?.id===i&&Fe(null),V({op:"removeScript",id:i}).then(()=>Q(e("\u811A\u672C\u5DF2\u5220\u9664"))).catch(()=>{})}function cn(i){V({op:"updateScript",id:i,controlId:""}).then(()=>Q(e("\u5DF2\u89E3\u9664\u6302\u8F7D\uFF0C\u811A\u672C\u4ECD\u4FDD\u7559\u5728\u5B58\u6863\u4E2D"))).catch(()=>{})}function dn(i){let p=w.current?.selectedId||"",q=w.current?.asset?.type||"";p&&(Fe(O=>O&&O.id===i?{...O,controlId:p,controlAsset:q}:O),V({op:"updateScript",id:i,controlId:p,controlAsset:q}).then(()=>Q(e("\u5DF2\u6302\u8F7D\u5230\u5F53\u524D\u63A7\u4EF6"))).catch(()=>{}))}async function Wt(i){if(w.current?.asset?.type!==i)try{let p=await V({op:"selectAsset",assetType:i});mt(""),ft(i==="client-control-template"?"template":"child"),Q(e`已切换到存档内的${e(p.asset.label)}`)}catch{}}function pn(i,p){let q=w.current;if(!q)return;let O=q.asset?.type==="client-control-template"&&Ee==="template",re=O?{op:"addTemplate",kind:i,name:e`${e(p)}模板`}:{op:"add",kind:i,parentId:Ha(q.root,q.selectedId),name:p};V(re).then(()=>Q(O?e`已新增${e(p)}模板`:e`已添加${e(p)}子控件`)).catch(()=>{})}async function He(i,p=""){try{await T.current.catch(()=>{}),await ve(),await Ne();let q=await X(o,"export",{format:i,assetType:p});if(je([...new Set([...q.warnings||[],...(q.files||[]).flatMap(O=>O.warnings||[])])]),Array.isArray(q?.files)&&q.files.length){for(let O of q.files)de(O);k(""),Q(e`已导出 ${q.files.length} 个 GIA 文件(${q.files.map(O=>O.filename).join("\u3001")});若浏览器拦截多文件下载,请允许后重试。`);return}de(q),k(""),Q(q.warnings?.length?e`已导出 ${q.filename};请查看上方导出说明。`:e`已导出 ${q.filename}`)}catch(q){k(q?.message||String(q))}}async function Ht(i){if(i)try{await T.current.catch(()=>{});let p=await X(o,"load-archive",{path:i});Le(p.snapshot,{keepLogicDraft:!1}),k(""),Q(e`已从工作区拉取 ${i}`),je([])}catch(p){k(p?.message||String(p))}}async function un(i){if(!i)return;let p=i.name.toLowerCase().endsWith(".gia")?"gia":i.name.toLowerCase().endsWith(".json")?"json":i.name.toLowerCase().endsWith(".lua")?"lua":"";if(!p){k(e("\u4EC5\u652F\u6301 .json\u3001.gia \u6216 .lua \u6587\u4EF6"));return}try{await T.current.catch(()=>{});let q=await X(o,"import",{format:p,filename:i.name,data:await ie(i)});Le(q.snapshot,{keepLogicDraft:!1}),k(""),Q([e`已导入 ${i.name}`,...q.warnings||[]].join(`
|
|
33
|
+
`)),je([])}catch(q){k(q?.message||String(q))}finally{Re.current&&(Re.current.value="")}}function mn(){j.open(async()=>{await T.current.catch(()=>{}),await ve(),await Ne(),await T.current,k("")})}async function fn(){if(!(z||!_?.trim())){oe(!0);try{await ve(),await Ne(),await T.current.catch(()=>{});let i=w.current,p=await X(o,"save",{path:_.trim(),expectedRevision:i.version});Le(await X(o,"get")),Q(e`已保存到 ${p.path}`),k(""),D(null),We()}catch(i){k(i?.message||String(i))}finally{oe(!1)}}}if(a.useEffect(()=>{r?.inspector?.kind==="server-container"&&dt("base")},[r?.inspector?.kind]),!r)return t("div",{className:"qxsim","data-qxqy-font-ui":"","data-theme":f,"data-qxsim-session-id":o},t("div",{className:"qxsim-status error"},y||e("\u6B63\u5728\u8F7D\u5165\u5343\u661F\u6C99\u7BB1\u2026")));let ye=r.canvas.width,Ce=r.canvas.height,bt=Ye.width>0&&Ye.height>0?Math.min((Ye.width-44)/ye,(Ye.height-54)/Ce):NaN,gn=Number.isFinite(bt)&&bt>0?Math.min(2,Math.round(bt*1e3)/1e3):.5,vt=pt==="fit"?gn:Number(pt)||.5,Vt=ge(ye,Ce),hn=(r.canvas.presets||[]).filter(i=>i.platform===r.canvas.platform);function xn(i){if(!r||r.canvas.platform===i)return;let p=(r.canvas.presets||[]).filter(O=>O.platform===i);if(!p.length)return;let q=p.find(O=>fe(O)===Vt)||p[0];V({op:"setCanvas",canvasId:q.id}).then(()=>Q(e`已切换到${q.label}`)).catch(()=>{})}let te=r.asset?.type==="client-control-template",yt=!!(r.inspector&&r.inspector.kind!=="server-container"),wt=new Set;for(let i of r.tree||[])(ut[i.id]||(i.ancestorIds||[]).some(p=>ut[p]))&&wt.add(i.id);let Jt=(r.boxes||[]).filter(i=>i.kind!=="server-container"&&i.visible&&i.visibleInHierarchy!==!1&&!wt.has(i.id)),Kt=Jt.find(i=>i.id===r.selectedId);function bn(i,p){i.stopPropagation(),Qa(q=>{let O={...q};return O[p]?delete O[p]:O[p]=!0,O})}let Qt=r.tree.filter(i=>!_e.trim()||`${i.name} ${i.label} ${e(i.label)}`.toLowerCase().includes(_e.trim().toLowerCase())),H=r.tree.find(i=>i.id===r.selectedId),vn=te&&H?r.tree.filter(i=>i.id!==H.id&&!(i.ancestorIds||[]).includes(H.id)):[],yn=H?.parentId||r.root.id;return t("div",{className:"qxsim","data-qxqy-font-ui":"",lang:d==="zh"?"zh-CN":"en","data-theme":f,"data-qxsim-session-id":o},j.overlay,ue?t(P,{onClose:()=>Y(!1)}):null,be==="script"&&y?t("div",{className:"qxsim-status error",role:"alert"},e(y)):null,_!==null?t("div",{className:"qxsim-save-overlay"},t("form",{className:"qxsim-save-dialog",role:"dialog","aria-modal":!0,"aria-label":e("\u4FDD\u5B58\u5230\u5DE5\u4F5C\u533A"),onSubmit:i=>{i.preventDefault(),fn()}},t("h2",null,e("\u4FDD\u5B58\u5230\u5DE5\u4F5C\u533A")),t("label",null,e("\u5B58\u6863\u76F8\u5BF9\u8DEF\u5F84"),t("input",{autoFocus:!0,required:!0,value:_,disabled:z,onChange:i=>D(i.target.value)})),y?t("div",{role:"alert"},e(y)):null,t("footer",null,t("button",{className:"qxsim-action",type:"button",disabled:z,onClick:()=>D(null)},e("\u53D6\u6D88")),t("button",{className:"qxsim-action primary",type:"submit",disabled:z||!_.trim()},z?e("\u4FDD\u5B58\u4E2D\u2026"):e("\u4FDD\u5B58"))))):null,t("header",{className:"qxsim-toolbar"},t("div",{className:"qxsim-brand",title:`${r.workspace?.bound?r.workspace.path:e("\u5DE5\u4F5C\u533A\u672A\u7ED1\u5B9A")}
|
|
34
|
+
${r.meta?.sourceFile||e("\u5C1A\u672A\u5BFC\u5165\u6587\u4EF6")}`},t("span",{className:"qxsim-appicon"},"UI"),t("span",{className:"qxsim-brand-text"},t("strong",null,e`存档:${r.save?.name||r.meta?.name||e("\u672A\u547D\u540D\u5B58\u6863")}`),t("span",null,e`工作区:${r.workspace?.bound?r.workspace.name:e("\u672A\u7ED1\u5B9A")} · 当前资产:${e(r.asset?.label)||e("UI\u63A7\u4EF6")}`))),t("div",{className:"qxsim-toolbar-center"},be==="ui"?t(a.Fragment,null,t("div",{className:"qxsim-device-switch",role:"group","aria-label":e("\u76EE\u6807\u8BBE\u5907")},ce.map(i=>t("button",{key:i.key,className:r.canvas.platform===i.key?"active":"",title:e(i.title),onClick:()=>xn(i.key)},e(i.label)))),t("select",{className:"qxsim-control ratio","aria-label":e("\u5C4F\u5E55\u6BD4\u4F8B"),value:r.canvasId,onChange:i=>void V({op:"setCanvas",canvasId:i.target.value}).catch(()=>{})},hn.map(i=>t("option",{key:i.id,value:i.id},`${fe(i)} \xB7 ${i.width}\xD7${i.height}`))),t("select",{className:"qxsim-control zoom","aria-label":e("\u753B\u5E03\u7F29\u653E"),value:pt,onChange:i=>Ka(i.target.value)},[["fit",e("\u9002\u5E94")],["0.25","25%"],["0.5","50%"],["0.75","75%"],["1","100%"]].map(([i,p])=>t("option",{key:i,value:i},p)))):t("span",{className:"qxsim-muted"},be==="logic"?e("\u670D\u52A1\u7AEF\u903B\u8F91\uFF1A\u76D1\u542C\u4FE1\u53F7 / \u81EA\u5B9A\u4E49\u53D8\u91CF / \u73A9\u5BB61-8 \u56DE\u4F20"):e("Lua \u811A\u672C\u8D44\u4EA7\u7F16\u8F91"))),t("div",{className:"qxsim-actions"},s?t("button",{className:"qxsim-action",title:e("\u4FDD\u5B58\u5B8C\u6574\u5B58\u6863\u5230\u5DE5\u4F5C\u533A"),onClick:()=>{k(""),D(w.current?.storage?.path||"qxqy-simulator.save.json")}},e("\u4FDD\u5B58\u5B58\u6863")):null,t("div",{className:"qxsim-io"},t("input",{ref:Re,hidden:!0,type:"file",accept:".json,.gia,.lua,application/json,application/octet-stream,text/plain",onChange:i=>void un(i.target.files?.[0])}),t("select",{className:"qxsim-control zoom","aria-label":e("\u4ECE\u5DE5\u4F5C\u533A\u62C9\u53D6\u5B58\u6863"),defaultValue:"",onFocus:()=>void We(),onChange:i=>{let p=i.target.value;i.target.value="",p&&Ht(p)}},t("option",{value:"",disabled:!0},r.workspace?.bound?e("\u2913 \u5DE5\u4F5C\u533A\u5B58\u6863"):e("\u5DE5\u4F5C\u533A\u672A\u7ED1\u5B9A")),...Rt.length?Rt.map(i=>t("option",{key:i.path,value:i.path},`${i.name} \xB7 ${i.path}`)):[t("option",{value:"",disabled:!0},r.workspace?.bound?e("\u672A\u53D1\u73B0 qxqy-simulator-save"):e("\u5148\u7ED1\u5B9A\u4F1A\u8BDD\u5DE5\u4F5C\u533A"))]),t("button",{className:"qxsim-action",title:e("\u5BFC\u5165\u5B58\u6863\u3001\u5355\u9879 UI \u8D44\u4EA7\u6216 Lua"),onClick:()=>Re.current?.click()},e("\u21E7 \u5BFC\u5165")),t("select",{className:"qxsim-control zoom","aria-label":e("\u5BFC\u51FA\u683C\u5F0F"),defaultValue:"",onChange:i=>{let[p,q=""]=i.target.value.split("|");i.target.value="",p&&He(p,q)}},t("option",{value:"",disabled:!0},e("\u21E9 \u5BFC\u51FA")),t("option",{value:"save"},e("\u8D44\u4EA7\u5305 JSON\uFF08\u4E09\u7C7B\u5408\u4E00\uFF09")),t("option",{value:"save-gia"},e("\u8D44\u4EA7\u5305 GIA\uFF08\u5DF2\u6539\u52A8\u9879\uFF09")),t("option",{value:"gia-combined"},e("\u8D44\u4EA7\u5305 GIA \u6574\u5408\u5305\uFF08\u63A7\u4EF6+\u811A\u672C\uFF09")),t("optgroup",{label:e("\u5F53\u524D\u754C\u9762\uFF08\u5DE6\u680F\u6B63\u5728\u770B\u7684\u90A3\u68F5\u6811\uFF09")},t("option",{value:"json"},e("\u5F53\u524D\u754C\u9762 Authoring JSON")),t("option",{value:"gia"},e("\u5F53\u524D\u754C\u9762 GIA"))),t("optgroup",{label:e("\u670D\u52A1\u5668\u63A7\u4EF6\u6A21\u677F")},t("option",{value:"json|server-control-template"},"Authoring JSON"),t("option",{value:"gia|server-control-template"},"GIA")),t("optgroup",{label:e("\u5BA2\u6237\u7AEF\u63A7\u4EF6\u6A21\u677F\uFF08\u4EC5\u5F53\u5DE6\u680F\u5207\u5230\u300CUI\u63A7\u4EF6-\u5BA2\u6237\u7AEF\u300D\u65F6\u624D\u662F\u9875\u9762\u5185\u5BB9\uFF09")},t("option",{value:"json|client-control-template"},"Authoring JSON"),t("option",{value:"gia|client-control-template"},"GIA")),t("optgroup",{label:e("Lua \u811A\u672C")},t("option",{value:"scripts"},e("\u811A\u672C\u5305 JSON\uFF08\u5168\u90E8\u811A\u672C\uFF09")),t("option",{value:"scripts-gia"},e("\u811A\u672C\u5305 GIA\uFF08\u5168\u90E8\u811A\u672C\uFF09"))))),t("button",{className:"qxsim-action primary",title:e("\u6253\u5F00\u8BD5\u73A9\uFF1B\u65B0\u7A97\u53E3\u4E0D\u53EF\u7528\u65F6\u5728\u5E94\u7528\u5185\u8BD5\u73A9"),disabled:j.opening,onClick:mn},j.opening?e("\u6B63\u5728\u51C6\u5907\u2026"):e("\u25B7 \u8BD5\u73A9 \u2197")),t("button",{className:"qxsim-iconbtn",title:e("\u91CD\u65B0\u8F7D\u5165"),onClick:Xe},"\u21BB"))),t("nav",{className:"qxsim-editor-nav","aria-label":e("\u7F16\u8F91\u9875\u9762")},t("button",{className:be==="ui"?"active":"",onClick:()=>Me("ui")},e("UI \u7F16\u8F91")),t("button",{className:be==="script"?"active":"",onClick:()=>Me("script")},e("Lua \u811A\u672C")),t("button",{className:be==="logic"?"active":"",onClick:()=>Me("logic")},e("\u670D\u52A1\u7AEF\u903B\u8F91")),t("span",{className:"save-summary"},e("\u4E00\u4E2A\u5B58\u6863 \xB7 \u670D\u52A1\u5668\u63A7\u4EF6\u6A21\u677F + \u5BA2\u6237\u7AEF\u63A7\u4EF6\u6A21\u677F + Lua \u811A\u672C + \u670D\u52A1\u7AEF\u903B\u8F91")),t("div",{className:"qxsim-editor-settings"},t("button",{onClick:()=>Y(!0),"aria-label":e("\u5B57\u4F53\u8BBE\u7F6E")},e("\u5B57\u4F53\u8BBE\u7F6E")),t("select",{className:"qxsim-control qxsim-language","aria-label":e("\u754C\u9762\u8BED\u8A00"),title:e("\u754C\u9762\u8BED\u8A00"),value:ta(),onChange:i=>ia(i.target.value)},t("option",{value:"auto"},e("\u81EA\u52A8\uFF08\u7CFB\u7EDF\u8BED\u8A00\uFF09")+" \xB7 "+Qe().language),t("option",{value:"zh"},"\u7B80\u4F53\u4E2D\u6587"),t("option",{value:"en"},"English")))),be==="script"?t(u,{snap:r,patch:V,request:(i,p)=>X(o,i,p),refresh:async()=>Le(await X(o,"get")),prepare:async()=>(await T.current,await ve(),await Ne(),w.current)}):null,t(m,{snap:r,patch:V,prepare:ve,copy:tn,onScripts:()=>Me("script"),onError:k,reloadArchive:()=>Ht(w.current.storage?.path)}),lt.length?t("details",{className:"qxsim-export-warnings",open:!0,role:"status",style:{flexShrink:0,maxHeight:180,overflow:"auto",padding:"8px 16px",borderBottom:"1px solid currentColor"}},t("summary",{style:{cursor:"pointer"}},e`上次导出说明(${lt.length} 项,请核对导入后的效果)`),t("button",{className:"qxsim-action",onClick:()=>je([])},e("\u5173\u95ED\u5BFC\u51FA\u8BF4\u660E")),t("ul",null,lt.map((i,p)=>t("li",{key:p},e(i))))):null,be==="ui"?t("div",{className:"qxsim-main"},t("aside",{className:"qxsim-tree"},t("div",{className:"qxsim-asset-switch","aria-label":e("\u7F16\u8F91\u8D44\u6E90\u7C7B\u578B")},t("button",{className:te?"":"active",title:e("\u7F16\u8F91\u5B58\u6863\u5185\u7684\u670D\u52A1\u7AEF UI \u63A7\u4EF6"),onClick:()=>void Wt("server-control-template")},e("UI\u63A7\u4EF6-\u670D\u52A1\u7AEF")),t("button",{className:te?"active":"",title:e("\u7F16\u8F91\u5B58\u6863\u5185\u7684\u5BA2\u6237\u7AEF\u63A7\u4EF6\u6A21\u677F"),onClick:()=>void Wt("client-control-template")},e("UI\u63A7\u4EF6-\u5BA2\u6237\u7AEF"))),t("div",{className:"qxsim-pane-head"},t("div",{className:"qxsim-pane-title"},te?e("\u6A21\u677F\u4E0E\u5B50\u63A7\u4EF6"):e("\u63A7\u4EF6\u6811")),t("span",{className:"qxsim-muted"},te?e`${r.asset.templateCount} 个模板 · ${r.tree.length} 个控件`:e`${r.tree.length} 个节点`)),t("label",{className:"qxsim-search"},"\u2315",t("input",{value:_e,placeholder:te?e("\u641C\u7D22\u6A21\u677F\u6216\u63A7\u4EF6"):e("\u641C\u7D22\u63A7\u4EF6"),onChange:i=>mt(i.target.value)}),_e?t("button",{onClick:()=>mt("")},"\xD7"):t("span",null,"\u2301")),t("div",{className:"qxsim-tree-scroll"},Qt.length?Qt.map(i=>{let p=M[i.kind]||["\u25C7",i.label],q=wt.has(i.id),O=!!ut[i.id];return t("div",{key:i.id,className:`qxsim-row${te&&i.depth===0?" template-root":""}${i.id===r.selectedId?" active":""}${q?" canvas-hidden":""}`,style:{paddingLeft:8+i.depth*18,"--depth":i.depth},title:`${e(p[1])} \xB7 ${i.name} \xB7 GUID ${i.guid??i.id}`,onClick:()=>void V({op:"select",id:i.id}).catch(()=>{})},t("span",{className:"qxsim-chevron"},i.childCount?"\u25BC":""),t("span",{className:"qxsim-kind"},p[0]),t("span",{className:"qxsim-row-label"},i.name),t("span",{className:"qxsim-row-end"},te&&i.depth===0?t(a.Fragment,null,t("span",{className:"qxsim-template-tag"},e("\u6A21\u677F")),t("span",{className:"qxsim-template-id"},`#${i.guid??i.id}`)):i.incomplete?t("span",{className:"qxsim-incomplete"},e("\u6682\u4E0D\u652F\u6301")):null,t("button",{className:`qxsim-eye${O?" off":""}`,type:"button",title:O?e("\u5728\u753B\u5E03\u4E0A\u663E\u793A\uFF08\u4E0D\u5F71\u54CD\u63A7\u4EF6\u521D\u59CB\u53EF\u89C1\u6027\uFF09"):e("\u5728\u753B\u5E03\u4E0A\u9690\u85CF\uFF08\u4E0D\u5F71\u54CD\u63A7\u4EF6\u521D\u59CB\u53EF\u89C1\u6027\uFF09"),"aria-label":e`${i.name}画布可见性`,"aria-pressed":!O,onClick:re=>bn(re,i.id)},O?"\u25CC":"\u25C9")))}):t("div",{className:"qxsim-empty"},e("\u6CA1\u6709\u5339\u914D\u7684\u63A7\u4EF6"))),t("div",{className:"qxsim-tree-foot"},te&&H?t("div",{className:"qxsim-hierarchy"},t("div",{className:"qxsim-hierarchy-head"},t("strong",null,e("\u5C42\u7EA7\u4E0E\u6A21\u677F\u8FB9\u754C")),t("span",null,H.name)),t("div",{className:"qxsim-parent-row"},t("select",{"aria-label":e("\u7236\u7EA7\u63A7\u4EF6"),value:yn,onChange:i=>void V({op:"reparent",id:H.id,parentId:i.target.value}).then(()=>Q(i.target.value===r.root.id?e("\u5DF2\u63D0\u5347\u4E3A\u53EF\u5B9E\u4F8B\u5316\u9876\u5C42\u6A21\u677F"):e("\u5DF2\u8C03\u6574\u63A7\u4EF6\u7236\u7EA7"))).catch(()=>{})},t("option",{value:r.root.id},e("\u9876\u5C42\u6A21\u677F\uFF08\u53EF\u5B9E\u4F8B\u5316\uFF09")),vn.map(i=>t("option",{key:i.id,value:i.id},`${"\u3000".repeat(i.depth)}${i.name}`))),t("button",{title:e("\u5728\u540C\u7EA7\u4E2D\u4E0A\u79FB"),disabled:H.siblingIndex<=0,onClick:()=>void V({op:"moveSibling",id:H.id,direction:"up"}).catch(()=>{})},"\u2191"),t("button",{title:e("\u5728\u540C\u7EA7\u4E2D\u4E0B\u79FB"),disabled:H.siblingIndex>=H.siblingCount-1,onClick:()=>void V({op:"moveSibling",id:H.id,direction:"down"}).catch(()=>{})},"\u2193")),t("div",{className:"qxsim-hierarchy-note"},H.depth===0?e("\u8BE5\u8282\u70B9\u4F1A\u5199\u5165\u72EC\u7ACB UIControlTemplate\uFF0C\u53EF\u76F4\u63A5\u4F5C\u4E3A prefabId\u3002"):e`当前为第 ${H.depth} 层子控件,不会单独成为 prefabId。`)):null,t("div",{className:"qxsim-palette-head"},t("span",{title:te&&Ee==="template"?e("\u65B0\u589E\u72EC\u7ACB\u53EF\u5B9E\u4F8B\u5316\u6A21\u677F"):e`添加到${H?H.name:e("\u5F53\u524D\u63A7\u4EF6")}`},te&&Ee==="template"?e("\u65B0\u589E\u9876\u5C42\u6A21\u677F"):e`添加到${H?`\u201C${H.name}\u201D`:e("\u5F53\u524D\u63A7\u4EF6")}`),te?t("span",{className:"qxsim-add-mode"},t("button",{className:Ee==="template"?"active":"",onClick:()=>ft("template")},e("\u9876\u5C42")),t("button",{className:Ee==="child"?"active":"",onClick:()=>ft("child")},e("\u5B50\u63A7\u4EF6"))):null),t("div",{className:"qxsim-add"},B.filter(([i])=>te||i!=="container").map(([i,p])=>t("button",{key:i,title:`${te&&Ee==="template"?e("\u65B0\u589E"):e("\u6DFB\u52A0")}${e(p)}`,onClick:()=>pn(i,e(p))},`\uFF0B ${e(p)}`))))),t("main",{className:"qxsim-center"},t("div",{className:"qxsim-workspace",ref:Bt},t("div",{className:"qxsim-stage-shell",style:{width:`${Math.max(40,Math.round(ye*vt))}px`}},t("div",{className:"qxsim-stage-label"},t("b",null,te?e("Lua \u6A21\u677F\u9884\u89C8"):e("\u754C\u9762\u63A7\u4EF6\u7EC4")),t("span",{className:"qxsim-platform-tag"},r.canvas.platform),t("span",null,e`${Vt} · ${ye}×${Ce} · 左下原点`)),t("div",{className:"qxsim-stage",style:{width:"100%",aspectRatio:`${ye} / ${Ce}`},onClick:i=>{let p=i.currentTarget.getBoundingClientRect();V({op:"pick",x:(i.clientX-p.left)*ye/p.width,y:(p.bottom-i.clientY)*Ce/p.height}).catch(()=>{})}},t(b,{boxes:Jt,canvasWidth:ye,canvasHeight:Ce,renderControl:i=>Dt(i,r,ye,Ce,vt,W)}),Kt?Dt(Kt,r,ye,Ce,vt,W,!0):null))),y?t("div",{className:"qxsim-status error"},"\u26A0 ",e(y)):t("div",{className:"qxsim-status"},t("span",null,e`● ${e(r.asset?.label)||e("\u63A7\u4EF6")}编辑`),t("span",null,qe||(H?e`当前:${H.name}`:"")),t("span",{className:"spacer"}),t("span",null,te?e("GIA \u5BFC\u51FA\u540E\u53EF\u5728 Lua \u4E2D\u6309 prefabId \u5B9E\u4F8B\u5316"):e("\u5B57\u6BB5\u5728\u5931\u7126\u6216 Enter \u65F6\u63D0\u4EA4")))),t("aside",{className:"qxsim-inspector"},r.inspector?t(a.Fragment,null,t("div",{className:"qxsim-inspector-head"},t("div",{className:"qxsim-inspector-line"},t("span",{className:"qxsim-kind"},(M[r.inspector.kind]||["\u25C7"])[0]),t("strong",null,e(r.inspector.label)),te&&H?.depth===0?t("span",{className:"qxsim-template-tag"},e("\u53EF\u5B9E\u4F8B\u5316")):null),t("div",{className:"qxsim-node-id"},te&&H?.depth===0?e("\u6A21\u677F\u7D22\u5F15 "):e("\u63A7\u4EF6 GUID "),t("code",null,r.inspector.guid??r.inspector.id)," \xB7 ",H?.name||e("\u8282\u70B9")),r.inspector.kind!=="server-container"?t(Ya,{key:`${r.asset.type}:${r.inspector.id}`,inspector:r.inspector,autofill:r.clientGuidAutofill,onSave:(i,p,q)=>en(i,p,r.asset.type,q)}):null),t("div",{className:"qxsim-tabs",style:yt?void 0:{gridTemplateColumns:"1fr"}},t("button",{className:ct==="base"?"active":"",onClick:()=>dt("base")},e("\u57FA\u7840\u5C5E\u6027")),yt?t("button",{className:ct==="script"?"active":"",onClick:()=>dt("script")},e("\u811A\u672C")):null),t("div",{className:"qxsim-inspector-scroll"},yt&&ct==="script"?t(Xa,{snap:r,addScriptMounted:i=>void Xt({controlId:i,controlAsset:r.asset?.type}).then(()=>Me("script")),mountScriptTo:dn,unmountScript:cn,openScript:i=>{Be(i),Me("script")}}):t(a.Fragment,null,t(xe,{key:`${r.asset.type}:${r.inspector.id}`,inspector:r.inspector,commit:an,createStateChild:on}),r.boxes?.some(i=>i.id===r.selectedId&&Ae(i.imageId,i.imageSource))?t("div",{className:"qxsim-section-body"},t("button",{className:"qxsim-action",disabled:G,onClick:nn},G?e("\u6B63\u5728\u5237\u65B0\u7D20\u6750\u2026"):e("\u21BB \u91CD\u65B0\u4E0B\u8F7D\u6B64\u7D20\u6750")),t("p",{className:"qxsim-muted"},e("\u767D\u540D\u5355\u56FE\u7247\u6309\u9700\u7F13\u5B58\uFF1B\u5237\u65B0\u4F1A\u91CD\u65B0\u8BBF\u95EE\u7D20\u6750\u6E90\u3002"))):null)),t("div",{className:"qxsim-tree-foot"},t("button",{className:"qxsim-action danger",style:{width:"100%"},onClick:()=>void V({op:"remove"}).catch(()=>{})},te&&H?.depth===0?e("\u232B \u5220\u9664\u5F53\u524D\u6A21\u677F"):e("\u232B \u5220\u9664\u5F53\u524D\u63A7\u4EF6")))):t("div",{className:"qxsim-empty"},e("\u8BF7\u9009\u62E9\u4E00\u4E2A\u63A7\u4EF6")))):be==="script"?t(v,{snap:r,selectedScriptId:gt,selectScript:i=>{Yt(),Be(i)},draft:ht,updateDraft:rn,saveScript:()=>void ve().then(()=>Q(e("Lua \u811A\u672C\u5DF2\u4FDD\u5B58\u5230\u5F53\u524D\u5B58\u6863"))).catch(()=>{}),addScript:()=>void Xt(),removeScript:ln,exportLua:i=>void He("lua",i),exportScripts:()=>void He("scripts"),exportScriptsGia:()=>void He("scripts-gia"),notice:qe}):t(Ba,{snap:r,draft:_t,setDraft:xt,saveLogic:()=>void Ne().catch(()=>{}),notice:qe,error:y}),t(F,{version:c,request:i=>X(o,i)}))}return{SimulatorView:Va,ensureStyle:$,removeStyle:()=>document.getElementById(I)?.remove()}}var Ga={name:"dsh-plugin-beyond-simulator",version:"2.2.1",description:"\u5343\u661F\u5947\u57DF\u5BA2\u6237\u7AEF UI \u7F16\u8F91\u4E0E\u8BD5\u73A9\u6A21\u62DF\u5668 for DeepSeek Harness",private:!0,type:"module",packageManager:"pnpm@10.15.0",engines:{node:">=22"},main:"dsh-plugin/dist/index.js",exports:{".":"./dsh-plugin/dist/index.js","./skill":"./dsh-plugin/dist/skill.js","./preset":"./dsh-plugin/dist/preset.js","./client":"./dsh-plugin/dist/client.js","./cordis.patch.yml":"./dsh-plugin/cordis.patch.yml","./package.json":"./package.json"},files:["dsh-plugin/dist","dsh-plugin/lib/play.html","dsh-plugin/skill.md","dsh-plugin/presets","dsh-plugin/cordis.patch.yml","README.md","LICENSE"],repository:{type:"git",url:"git+https://github.com/1475505/miliastra-beyond-simulator.git"},dsh:{bundle:{patch:"./dsh-plugin/cordis.patch.yml"},client:{inject:["@deepseek-ai/dsh-client-runtime","@deepseek-ai/dsh-client-ui-slots","@deepseek-ai/dsh-client-ui-conversation"],platform:"web"}},scripts:{prepare:"node scripts/build.mjs dsh-plugin",build:"node scripts/build.mjs",test:"node scripts/test.mjs","pack:release":"node scripts/pack.mjs","test:packages":"node scripts/smoke-packages.mjs","test:git-install":"node scripts/smoke-git-install.mjs","test:harness":"node scripts/smoke-harness.mjs","dev:web":"node scripts/build.mjs web && node web/server.js","start:web":"node web/dist/server.js"},dependencies:{"@napi-rs/canvas":"0.1.100",fengari:"0.1.5",protobufjs:"8.7.2"},peerDependencies:{"@deepseek-ai/cordis":"^4.0.1","@deepseek-ai/dsh-tools":"^0.1.0-rc.6 || ^0.2.0-rc.1 || ^0.2.1-rc.1"},devDependencies:{"@deepseek-ai/dsh-tools":"0.1.0-rc.6",esbuild:"0.25.12"},license:"GPL-3.0-only"};na("/qxqy-simulator/api/locale");window.__ModuleLoader__.load({id:"dsh-plugin-beyond-simulator",factory:a=>{let n={},l=a("react"),s=Ua(l,{version:Ga.version,async api(c,t,u){let m=await fetch("/qxqy-simulator/api/"+t,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({sessionId:c,...u||{}}),...t==="play"?{signal:AbortSignal.timeout(15e3)}:{}}),g=await m.json();if(!m.ok||!g.ok)throw new Error(g.error||"Request failed");return g.value},playUrl:c=>"/qxqy-simulator/play#"+encodeURIComponent(c)});return n.inject=["slots"],n.apply=c=>{s.ensureStyle(),c.effect(()=>s.removeStyle,"qxqy-simulator: style cleanup");let t=()=>e("\u6A21\u62DF\u5668");c.inject(["locale"],u=>{let m,g,h=u.locale.bind("qxqy-simulator");t=()=>h("title");let x=()=>{let b=e("\u6A21\u62DF\u5668");b!==g&&(g=b,m?.(),m=u.locale.register("qxqy-simulator",{en:{title:b},zh:{title:b}}))};u.effect(()=>{x();let b=Ct(x);return()=>{b(),t=()=>e("\u6A21\u62DF\u5668"),m?.()}},"qxqy-simulator: tab language")}),c.slots.inject("conversation.view",()=>c.slots.register({name:"conversation.view",id:"qxqy-simulator",order:20,label:()=>t()},s.SimulatorView))},n}});})();
|