From 88cdcdfb025d0959d7eb0a156f0f9feefae5dae2 Mon Sep 17 00:00:00 2001 From: tianmo Date: Wed, 2 Sep 2026 10:24:48 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=80=E9=94=AE=E5=90=AF=E5=8A=A8=E5=81=9C?= =?UTF-8?q?=E6=AD=A2=E9=A1=B9=E7=9B=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + ...{index-nUMfzhFe.css => index-CSwdbBmn.css} | 2 +- .../{index-DujVfZi9.js => index-CnGkEkb-.js} | 4 +- dist/index.html | 4 +- src/store/particleStore.ts | 2 +- src/views/ParticlePanel.vue | 2 +- src/views/Stage.vue | 2 +- 停止项目-Windows.bat | 43 +++++++++++ 停止项目.command | 46 ++++++++++++ 启动项目-Windows.bat | 71 +++++++++++++++++++ 启动项目.command | 64 +++++++++++++++++ 11 files changed, 233 insertions(+), 8 deletions(-) rename dist/assets/{index-nUMfzhFe.css => index-CSwdbBmn.css} (58%) rename dist/assets/{index-DujVfZi9.js => index-CnGkEkb-.js} (92%) create mode 100644 停止项目-Windows.bat create mode 100755 停止项目.command create mode 100644 启动项目-Windows.bat create mode 100755 启动项目.command diff --git a/.gitignore b/.gitignore index 388a4bf..45390df 100644 --- a/.gitignore +++ b/.gitignore @@ -15,6 +15,7 @@ vite.config.d.ts .vite/ .cache/ coverage/ +/.run/ # Logs *.log npm-debug.log* diff --git a/dist/assets/index-nUMfzhFe.css b/dist/assets/index-CSwdbBmn.css similarity index 58% rename from dist/assets/index-nUMfzhFe.css rename to dist/assets/index-CSwdbBmn.css index a84e01d..aced940 100644 --- a/dist/assets/index-nUMfzhFe.css +++ b/dist/assets/index-CSwdbBmn.css @@ -1 +1 @@ -.stage-wrap[data-v-646aa9bd]{position:relative;width:100%;height:100%;overflow:hidden}.stage-holder[data-v-646aa9bd]{width:100%;height:100%;cursor:grab;touch-action:none;background-color:#0e1219;outline:none}.stage-holder.grid[data-v-646aa9bd]{background:conic-gradient(#141a26 90deg,transparent 90deg 180deg,#141a26 180deg 270deg,transparent 270deg);background-size:28px 28px}.stage-holder[data-v-646aa9bd]:active{cursor:grabbing}.topbar[data-v-646aa9bd]{position:absolute;top:10px;left:10px;right:10px;display:flex;align-items:center;gap:10px;padding:8px 12px;background:#141420d9;border-radius:10px;border:1px solid rgba(255,255,255,.08);font-size:12px;color:#aab;z-index:5;flex-wrap:wrap}.topbar input[type=range][data-v-646aa9bd]{background:#1a1a28;border:1px solid #2e2e44;color:#dde;border-radius:5px}.tool-group[data-v-646aa9bd]{display:flex;gap:6px;margin-left:6px;padding-left:12px;border-left:1px solid #2a2a3c}.tool-btn[data-v-646aa9bd]{width:30px;height:26px;background:#1e1e2e;border:1px solid #2e2e44;border-radius:6px;color:#aab;font-size:14px;cursor:pointer;display:flex;align-items:center;justify-content:center}.tool-btn[data-v-646aa9bd]:hover{background:#2b3a5c;color:#fff}.tool-btn.on[data-v-646aa9bd]{background:#3a5a8c;color:#fff;border-color:#5a7ab8}.background-menu[data-v-646aa9bd]{position:relative;flex:0 0 auto}.background-btn[data-v-646aa9bd]{height:28px;padding:0 11px;border:1px solid #3a4963;border-radius:6px;background:#202a3b;color:#cbd7ed;font-size:12px;cursor:pointer}.background-btn[data-v-646aa9bd]:hover,.background-btn.on[data-v-646aa9bd]{border-color:#7774ff;background:#343b63;color:#fff}.background-panel[data-v-646aa9bd]{position:absolute;top:calc(100% + 9px);right:0;width:248px;box-sizing:border-box;padding:10px;border:1px solid #343b50;border-radius:9px;background:#141420fa;color:#aeb8cc;box-shadow:0 8px 24px #0000007a;z-index:12}.background-upload[data-v-646aa9bd]{width:100%;height:30px;border:1px solid #5652b5;border-radius:6px;background:#4540a0;color:#fff;cursor:pointer}.background-upload[data-v-646aa9bd]:hover{border-color:#8982ff;background:#554dc2}.background-clear[data-v-646aa9bd]{width:100%;height:28px;margin-top:6px;border:1px solid #70404a;border-radius:6px;background:#512a33;color:#efb5bd;cursor:pointer}.background-clear[data-v-646aa9bd]:hover:not(:disabled){border-color:#b65b6a;background:#6a303b;color:#fff}.background-clear[data-v-646aa9bd]:disabled{opacity:.42;cursor:not-allowed}.background-file-input[data-v-646aa9bd]{display:none}.background-file-name[data-v-646aa9bd]{margin:7px 2px 9px;overflow:hidden;color:#737f98;font-size:10px;text-overflow:ellipsis;white-space:nowrap}.background-position-row[data-v-646aa9bd]{display:grid;grid-template-columns:1fr 1fr;gap:8px}.background-position-row label[data-v-646aa9bd]{display:flex;align-items:center;gap:5px;color:#8995ad;font-size:11px}.background-position-row input[data-v-646aa9bd]{width:0;min-width:0;flex:1;box-sizing:border-box;height:28px;padding:0 6px;border:1px solid #343e55;border-radius:5px;background:#101522;color:#e1e6f2}.background-opacity-row[data-v-646aa9bd]{display:grid;grid-template-columns:46px 1fr 34px;align-items:center;gap:7px;margin-top:10px;font-size:11px}.background-opacity-row input[data-v-646aa9bd]{min-width:0;accent-color:#675de0}.background-opacity-row b[data-v-646aa9bd]{color:#aeb8cc;font-size:10px;text-align:right;font-variant-numeric:tabular-nums}.help-btn[data-v-646aa9bd]{height:28px;margin-left:auto;padding:0 11px;flex:0 0 auto;border:1px solid #3a4963;border-radius:6px;background:#202a3b;color:#cbd7ed;font-size:12px;font-weight:700;cursor:pointer}.help-btn[data-v-646aa9bd]:hover,.help-btn.on[data-v-646aa9bd]{border-color:#7774ff;background:#343b63;color:#fff}.zoom-pct[data-v-646aa9bd]{margin-left:0;font-variant-numeric:tabular-nums;color:#9aa;min-width:44px;text-align:center}.help-overlay[data-v-646aa9bd]{position:absolute;top:0;right:0;bottom:0;left:0;z-index:40;display:flex;align-items:center;justify-content:center;padding:72px 24px 28px;box-sizing:border-box;background:#05080fb8;-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px)}.help-dialog[data-v-646aa9bd]{width:min(820px,100%);max-height:100%;display:flex;flex-direction:column;overflow:hidden;border:1px solid #3a4864;border-radius:14px;background:#141a27;color:#b8c3d8;box-shadow:0 22px 70px #0000009e}.help-head[data-v-646aa9bd]{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;padding:18px 20px 15px;border-bottom:1px solid #2b354a;background:linear-gradient(135deg,#202942,#181e2d)}.help-head h2[data-v-646aa9bd]{margin:0;color:#eef2ff;font-size:19px}.help-head p[data-v-646aa9bd]{margin:5px 0 0;color:#7786a3;font-size:11px}.help-close[data-v-646aa9bd]{width:28px;height:28px;flex:0 0 28px;border:1px solid #43516b;border-radius:6px;background:#273249;color:#ccd7ed;cursor:pointer}.help-close[data-v-646aa9bd]:hover{border-color:#7774ff;background:#3b4670;color:#fff}.help-body[data-v-646aa9bd]{min-height:0;overflow:auto;padding:18px 20px 21px}.help-section[data-v-646aa9bd]{padding:14px 15px;border:1px solid #2c3850;border-radius:10px;background:#181f2e}.help-section h3[data-v-646aa9bd]{margin:0 0 11px;color:#9fb2ff;font-size:13px}.help-start ol[data-v-646aa9bd]{margin:0;padding-left:21px;color:#aab6cc;font-size:12px;line-height:1.75}.help-start li[data-v-646aa9bd]::marker{color:#7774ff;font-weight:700}.help-section b[data-v-646aa9bd]{color:#dce4f7}.help-grid[data-v-646aa9bd]{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(250px,.85fr);gap:12px;margin-top:12px}.help-list[data-v-646aa9bd]{display:grid;gap:0;margin:0}.help-list>div[data-v-646aa9bd]{display:grid;grid-template-columns:78px 1fr;gap:9px;padding:7px 0;border-bottom:1px solid #263146}.help-list>div[data-v-646aa9bd]:last-child{border-bottom:0}.help-list dt[data-v-646aa9bd]{color:#d3dcf0;font-size:11px;font-weight:700}.help-list dd[data-v-646aa9bd]{margin:0;color:#8795ae;font-size:11px;line-height:1.5}.shortcut-list[data-v-646aa9bd]{display:grid;gap:7px}.shortcut-list>div[data-v-646aa9bd]{display:flex;align-items:center;min-height:25px;gap:5px}.shortcut-list kbd[data-v-646aa9bd]{min-width:24px;box-sizing:border-box;padding:3px 6px;border:1px solid #465470;border-bottom-width:2px;border-radius:5px;background:#101623;color:#e0e7f6;font:10px/1.2 ui-monospace,SFMono-Regular,Menlo,monospace;text-align:center}.shortcut-list span[data-v-646aa9bd]{color:#65728b;font-size:10px}.shortcut-list em[data-v-646aa9bd]{margin-left:auto;color:#9ca9c1;font-size:11px;font-style:normal}.help-note[data-v-646aa9bd]{margin:11px 0 0;padding-top:9px;border-top:1px solid #2a3549;color:#697791;font-size:10px;line-height:1.55}.help-export[data-v-646aa9bd]{margin-top:12px}.help-export p[data-v-646aa9bd]{margin:0;color:#8997b0;font-size:11px;line-height:1.65}@media(max-width:760px){.help-overlay[data-v-646aa9bd]{padding:66px 12px 14px}.help-grid[data-v-646aa9bd]{grid-template-columns:1fr}}.hud[data-v-646aa9bd]{position:absolute;bottom:12px;left:12px;padding:8px 12px;background:#141420bf;border-radius:8px;font-size:12px;color:#a0a8cc}.hud-number[data-v-646aa9bd]{display:inline-block;box-sizing:border-box;text-align:right;font-variant-numeric:tabular-nums;font-feature-settings:"tnum" 1}.hud-system-count[data-v-646aa9bd]{width:3ch}.hud-particle-count[data-v-646aa9bd]{width:7ch;text-align:left}.hud-tip[data-v-646aa9bd]{margin-left:12px;color:#5f6a8a;font-size:11px}b[data-v-646aa9bd]{color:#fc3}.settings-btn[data-v-646aa9bd]{height:28px;padding:0 12px;flex:0 0 auto;border:1px solid #3a4963;border-radius:6px;background:#202a3b;color:#cdf;font-size:12px;font-weight:700;cursor:pointer}.settings-btn[data-v-646aa9bd]:hover{border-color:#7774ff;background:#2b3a5c;color:#fff}.undo-btn[data-v-646aa9bd]{width:30px;height:28px;flex:0 0 30px;border:1px solid #3a4963;border-radius:6px;background:#202a3b;color:#cdd8ed;font-size:18px;line-height:1;cursor:pointer}.undo-btn[data-v-646aa9bd]:hover:not(:disabled){border-color:#7774ff;background:#2b3a5c;color:#fff}.undo-btn[data-v-646aa9bd]:disabled{opacity:.38;cursor:not-allowed}.settings-panel[data-v-646aa9bd]{position:absolute;top:52px;left:10px;width:240px;z-index:10;background:#141420f7;border:1px solid #2a2a3c;border-radius:10px;padding:10px 12px;font-size:12px;color:#aab;box-shadow:0 6px 20px #0006}.sp-head[data-v-646aa9bd]{display:flex;justify-content:space-between;align-items:center;font-weight:700;color:#cdf;margin-bottom:10px}.sp-section-title[data-v-646aa9bd]{margin:2px 0 8px;color:#8a93bb;font-size:11px}.sp-switch-row[data-v-646aa9bd]{display:flex;align-items:center;justify-content:space-between;gap:10px;color:#aab}.sp-switch-control[data-v-646aa9bd]{display:inline-flex;align-items:center;gap:7px}.sp-switch-control input[data-v-646aa9bd]{position:absolute;width:1px;height:1px;opacity:0;pointer-events:none}.sp-switch-ui[data-v-646aa9bd]{position:relative;width:34px;height:18px;border-radius:999px;background:#39445a;cursor:pointer;transition:background .16s ease}.sp-switch-ui[data-v-646aa9bd]:after{content:"";position:absolute;top:2px;left:2px;width:14px;height:14px;border-radius:50%;background:#f4f6fb;transition:transform .16s ease}.sp-switch-control input:checked+.sp-switch-ui[data-v-646aa9bd]{background:#655df0}.sp-switch-control input:checked+.sp-switch-ui[data-v-646aa9bd]:after{transform:translate(16px)}.sp-switch-control input:focus-visible+.sp-switch-ui[data-v-646aa9bd]{outline:2px solid #8b86ff;outline-offset:2px}.sp-switch-control b[data-v-646aa9bd]{min-width:24px;color:#8a93bb;font-size:11px;font-weight:500}.sp-cache-note[data-v-646aa9bd]{margin-top:10px;padding-top:9px;border-top:1px solid #2a2a3c;color:#647089;font-size:10px;text-align:center}.sp-divider[data-v-646aa9bd]{height:1px;margin:10px 0;background:#2a2a3c}.sp-close[data-v-646aa9bd]{background:#2e3a55;border:none;color:#cdf;border-radius:4px;width:18px;height:18px;cursor:pointer;font-size:11px}.sp-row[data-v-646aa9bd]{display:flex;align-items:center;gap:8px;margin:8px 0}.sp-row>span[data-v-646aa9bd]:first-child{width:76px;flex-shrink:0;color:#8a93bb}.sp-row input[type=range][data-v-646aa9bd]{flex:1;background:#1a1a28;accent-color:#3a5a8c}.sp-num[data-v-646aa9bd]{width:52px;background:#1a1a28;border:1px solid #2e2e44;border-radius:5px;color:#dde;font-size:12px;padding:2px 4px}.sp-undo-limit[data-v-646aa9bd]{margin-left:auto;width:64px;height:26px;box-sizing:border-box}.sp-colr[data-v-646aa9bd]{width:26px;height:22px;border:none;background:none;cursor:pointer}.sp-hex[data-v-646aa9bd]{font-size:11px;color:#889;font-variant-numeric:tabular-nums}.sp-chk[data-v-646aa9bd]{display:flex;align-items:center;gap:6px;margin:8px 0;color:#aab}.sp-chk.disabled[data-v-646aa9bd]{color:#5f687d;cursor:not-allowed}.sp-chk.disabled input[data-v-646aa9bd]{cursor:not-allowed;opacity:.55}.ns[data-v-7c2fbed0]{display:flex;align-items:center;gap:8px;margin:6px 0;font-size:12px;color:#aab}.ns-label[data-v-7c2fbed0]{width:60px;flex-shrink:0;color:#8a93bb}.ns-range[data-v-7c2fbed0]{flex:1;accent-color:#3a7cd6}.ns-num[data-v-7c2fbed0]{width:56px;padding:3px 5px;background:#1a1a28;border:1px solid #2e2e44;border-radius:5px;color:#dde;font-size:12px;text-align:right}.ns.disabled[data-v-7c2fbed0]{opacity:.55}.ns.disabled .ns-range[data-v-7c2fbed0],.ns.disabled .ns-num[data-v-7c2fbed0]{cursor:not-allowed}.ce[data-v-9bfb7b31]{display:flex;align-items:flex-start;gap:6px;width:100%}.ce-editor[data-v-9bfb7b31]{flex:1;min-width:0}.ce-reset[data-v-9bfb7b31]{flex:0 0 auto;padding:5px 7px;border:1px solid #3b4b65;border-radius:5px;background:#242f42;color:#c4cee2;font-size:10px;cursor:pointer}.ce-reset[data-v-9bfb7b31]:hover{border-color:#7774ff;background:#4f4dc2;color:#fff}.ce-svg[data-v-9bfb7b31]{width:100%;height:110px;display:block;border:1px solid #2a2a3c;border-radius:6px;background:#10101a;cursor:crosshair;touch-action:none}.ce-grid line[data-v-9bfb7b31]{stroke:#1e1e30;stroke-width:1}.ce-frame[data-v-9bfb7b31]{stroke:#2e2e44;stroke-width:1}.ce-line[data-v-9bfb7b31]{stroke:#6ea0e8;stroke-width:2;stroke-linejoin:round}.ce-handles line[data-v-9bfb7b31]{stroke:#8d96b5;stroke-width:1;stroke-dasharray:3 2}.ce-handles circle[data-v-9bfb7b31]{fill:#b7c2dd;stroke:#344d94;stroke-width:1.2;cursor:grab}.ce-handles circle[data-v-9bfb7b31]:active{cursor:grabbing}.ce-node[data-v-9bfb7b31]{fill:#fff;stroke:#3a55aa;stroke-width:1.6;pointer-events:none}.ce-hit[data-v-9bfb7b31]{fill:transparent;stroke:none;cursor:grab}.ce-hit[data-v-9bfb7b31]:active{cursor:grabbing}.ce-nav[data-v-9bfb7b31]{display:flex;justify-content:space-between;margin-top:3px}.ce-tip[data-v-9bfb7b31]{color:#566;font-size:10px}.pac[data-v-238f838c]{padding:10px;margin:8px 0;border:1px solid #2c3850;border-radius:7px;background:#171d2a}.pac-head[data-v-238f838c]{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:7px}.pac-label[data-v-238f838c]{color:#aeb8cf;font-size:12px;font-weight:600;white-space:nowrap}.pac-modes[data-v-238f838c]{display:flex;gap:4px;flex-wrap:wrap;justify-content:flex-end}.pac-mode[data-v-238f838c]{padding:4px 7px;border:1px solid #344158;border-radius:5px;background:#273246;color:#aeb8cf;font-size:11px;cursor:pointer}.pac-mode.on[data-v-238f838c]{border-color:#7774ff;background:#605df0;color:#fff}.pac-curve[data-v-238f838c]{margin-top:8px}.pac-axis[data-v-238f838c]{display:flex;justify-content:space-between;margin-top:3px;color:#5f6b82;font-size:10px}.pac[data-v-238f838c] .ns-label{width:58px}.pac[data-v-238f838c] .ce-svg{height:96px;background:#0f1625;border-color:#30405a}.pac[data-v-238f838c] .ce-tip{color:#657188}.gradient-editor[data-v-f6ab10bf]{margin:8px 0 11px 68px}.gradient-bar[data-v-f6ab10bf]{position:relative;height:18px;margin-bottom:14px;border:1px solid #465570;border-radius:6px;cursor:crosshair}.gradient-stop[data-v-f6ab10bf]{position:absolute;top:15px;width:14px;height:17px;padding:0;transform:translate(-50%);border:2px solid #d8deea;border-radius:2px 2px 5px 5px;background:var(--stop-color);cursor:grab;box-shadow:0 1px 3px #0009}.gradient-stop[data-v-f6ab10bf]:before{content:"";position:absolute;left:2px;top:-7px;border-left:3px solid transparent;border-right:3px solid transparent;border-bottom:5px solid #d8deea}.gradient-stop.selected[data-v-f6ab10bf]{outline:2px solid #7774ff;outline-offset:1px;z-index:2}.gradient-stop[data-v-f6ab10bf]:active{cursor:grabbing}.gradient-controls[data-v-f6ab10bf]{display:flex;align-items:center;gap:5px;margin-top:30px}.gradient-color[data-v-f6ab10bf]{width:28px;height:24px;padding:1px;border:1px solid #465570;border-radius:4px;background:#151b27;cursor:pointer}.gradient-hex-input[data-v-f6ab10bf]{width:66px;padding:4px 5px;border:1px solid #344158;border-radius:4px;outline:none;background:#101725;color:#aeb8cb;font-size:10px;font-family:monospace}.gradient-hex-input[data-v-f6ab10bf]:focus{border-color:#7774ff;color:#fff}.gradient-position[data-v-f6ab10bf]{display:flex;align-items:center;color:#71809a;font-size:10px}.gradient-position input[data-v-f6ab10bf]{width:43px;padding:3px 4px;border:1px solid #344158;border-radius:4px;outline:none;background:#101725;color:#dce3ef;text-align:right}.gradient-action[data-v-f6ab10bf]{width:25px;height:24px;padding:0;border:1px solid #3a4860;border-radius:4px;background:#273246;color:#cbd4e5;cursor:pointer}.gradient-action[data-v-f6ab10bf]:hover:not(:disabled){border-color:#7774ff;color:#fff}.gradient-action.danger[data-v-f6ab10bf]{color:#e3a5aa}.gradient-action[data-v-f6ab10bf]:disabled{opacity:.35;cursor:not-allowed}.gradient-hint[data-v-f6ab10bf]{margin-top:5px;color:#59667b;font-size:9px}.image-card[data-v-68ff5314]{margin:8px 0;padding:9px;border:1px solid #2e3c55;border-radius:7px;background:#171d2a}.imgrow[data-v-68ff5314]{display:flex;align-items:flex-start;gap:8px}.img-thumb[data-v-68ff5314]{width:48px;height:48px;padding:0;border:1px solid #3a4963;border-radius:6px;background:#1a2232;display:flex;align-items:center;justify-content:center;flex-shrink:0;cursor:pointer;overflow:hidden}.img-thumb[data-v-68ff5314]:hover{border-color:#7774ff}.img-thumb img[data-v-68ff5314]{display:block;width:100%;height:100%;object-fit:contain}.img-fields[data-v-68ff5314]{flex:1;min-width:0}.img-actions[data-v-68ff5314]{display:flex;flex-direction:column;gap:4px}.row[data-v-68ff5314]{display:flex;align-items:center;gap:8px;margin:6px 0;color:#aab;font-size:12px}.row>span[data-v-68ff5314]:first-child{width:60px;flex-shrink:0;color:#8a93bb}.inp[data-v-68ff5314]{min-width:0;flex:1;padding:3px 5px;border:1px solid #2e2e44;border-radius:5px;background:#1a1a28;color:#dde;font-size:12px}.mini-btn2[data-v-68ff5314]{width:26px;height:24px;background:#1e1e2e;border:1px solid #2e2e44;border-radius:5px;color:#aab;font-size:12px;cursor:pointer;display:flex;align-items:center;justify-content:center}.mini-btn2[data-v-68ff5314]:hover{background:#2b3a5c}.mini-btn2[data-v-68ff5314]:disabled{opacity:.35;cursor:not-allowed}.thumb-note[data-v-68ff5314]{margin:4px 0 2px;color:#667;font-size:11px}.sequence-pick[data-v-68ff5314]{width:100%;margin:2px 0 4px;padding:6px 8px;border:1px solid #4a4a76;border-radius:5px;background:#27264b;color:#d8d7ff;font-size:12px;cursor:pointer}.sequence-pick[data-v-68ff5314]:hover{border-color:#7774ff;background:#35336a}.sequence-note[data-v-68ff5314]{margin:0 0 6px;color:#727b9b;font-size:11px;line-height:1.4}.resource-weight-row[data-v-68ff5314]{display:grid;grid-template-columns:minmax(0,1fr) 28px;align-items:center;gap:7px}.resource-weight-control[data-v-68ff5314]{width:100%;min-width:0}.resource-weight-control[data-v-68ff5314] .ns-range{min-width:0}.resource-weight-control[data-v-68ff5314] .ns-num{flex:0 0 56px;box-sizing:border-box}.weight-lock[data-v-68ff5314]{width:28px;height:26px;flex:0 0 28px;padding:5px;border:1px solid #35435c;border-radius:5px;background:#202a3b;color:#78859e;cursor:pointer}.weight-lock svg[data-v-68ff5314]{display:block;width:100%;height:100%;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.weight-lock[data-v-68ff5314]:hover:not(:disabled){border-color:#7774ff;color:#b8b6ff}.weight-lock.on[data-v-68ff5314]{border-color:#7774ff;background:#514fd0;color:#fff}.weight-lock[data-v-68ff5314]:disabled{opacity:.35;cursor:not-allowed}.spine-editor[data-v-af64e8e8]{display:grid;gap:10px;color:#c5cbe0}.editor-title[data-v-af64e8e8],.section-title[data-v-af64e8e8]{color:#dce2f5;font-weight:700}.editor-title[data-v-af64e8e8]{padding-bottom:9px;border-bottom:1px solid #30394d}.grid[data-v-af64e8e8]{display:grid;gap:8px}.grid.three[data-v-af64e8e8]{grid-template-columns:repeat(3,minmax(0,1fr))}.field[data-v-af64e8e8]{display:grid;gap:5px;min-width:0;color:#919bb7;font-size:12px}.field input[data-v-af64e8e8],.field select[data-v-af64e8e8],.asset-name[data-v-af64e8e8]{box-sizing:border-box;width:100%;min-width:0;height:35px;padding:0 10px;color:#e2e6f3;background:#101625;border:1px solid #32405b;border-radius:6px}.divider[data-v-af64e8e8]{height:1px;background:#30394d;margin:2px 0}.asset-row[data-v-af64e8e8]{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px}.asset-name[data-v-af64e8e8]{display:flex;align-items:center;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;color:#7f8aa7}button[data-v-af64e8e8]{height:35px;padding:0 13px;border:1px solid #3b4a67;border-radius:6px;background:#33415b;color:#e2e6f3;cursor:pointer}button[data-v-af64e8e8]:hover{filter:brightness(1.13)}button[data-v-af64e8e8]:disabled{opacity:.55;cursor:wait}.folder-select[data-v-af64e8e8]{width:100%;border-color:#6659c7;background:#4940a8;color:#fff}.folder-hint[data-v-af64e8e8]{margin-top:-5px;color:#69758e;font-size:10px;line-height:1.45}.asset-actions[data-v-af64e8e8]{display:grid;grid-template-columns:1fr 1fr;gap:5px}.asset-actions .load[data-v-af64e8e8]{background:#5543df;border-color:#6959ec}.asset-actions .clear[data-v-af64e8e8]{background:#702b34;border-color:#803842}.runtime-note[data-v-af64e8e8]{color:#69758e;font-size:11px;text-align:center}.error[data-v-af64e8e8]{padding:8px 10px;color:#ffabb2;background:#4b2028;border:1px solid #76323e;border-radius:6px;font-size:12px}.section-box[data-v-af64e8e8]{display:grid;gap:8px;padding:10px;background:#182132;border:1px solid #303c54;border-radius:7px}.empty[data-v-af64e8e8]{color:#667187;font-size:12px;padding:5px 0}.bone-tree[data-v-af64e8e8]{max-height:240px;overflow:auto;padding:4px 0;background:#111827;border-radius:5px}.tree-title-row[data-v-af64e8e8]{display:flex;align-items:center;justify-content:space-between;gap:8px}.selected-bone[data-v-af64e8e8]{width:auto;min-width:0;max-width:100%;height:24px;flex:0 1 auto;overflow:hidden;padding:0 7px;color:#75819c;background:#182132;border:1px solid transparent;border-radius:5px;font-size:10px;text-align:right;white-space:nowrap;text-overflow:ellipsis}.selected-bone.active[data-v-af64e8e8]{color:#aeb9d4;background:#242f44;border-color:#35445e;cursor:pointer}.selected-bone.active[data-v-af64e8e8]:hover{border-color:#675ec4;background:#302b57}.selected-bone[data-v-af64e8e8]:disabled{opacity:1;cursor:default}.selected-bone strong[data-v-af64e8e8]{color:#c5cde3;font-weight:600}.tree-action[data-v-af64e8e8]{height:24px;padding:0 8px;color:#9aa7c2;background:#242f44;border-color:#35445e;font-size:10px}.bone-search[data-v-af64e8e8]{position:relative}.bone-search input[data-v-af64e8e8]{box-sizing:border-box;width:100%;height:30px;padding:0 32px 0 9px;color:#dce2f2;background:#101827;border:1px solid #33415b;border-radius:5px;font-size:11px;outline:none}.bone-search input[data-v-af64e8e8]:focus{border-color:#7065df;box-shadow:0 0 0 1px #7065df38}.bone-search button[data-v-af64e8e8]{position:absolute;top:3px;right:3px;width:24px;height:24px;padding:0;border:0;color:#8d98b0;background:transparent}.bone[data-v-af64e8e8]{display:flex;align-items:center;gap:4px;min-height:25px;color:#aeb8d2;font-size:12px;border-bottom:1px solid rgba(72,84,112,.22);cursor:pointer;outline:none}.bone[data-v-af64e8e8]:hover{background:#45567e38}.bone.selected[data-v-af64e8e8]{color:#f0edff;background:#6b53dd52;box-shadow:inset 2px 0 #8e72ff}.bone[data-v-af64e8e8]:focus-visible{box-shadow:inset 0 0 0 1px #7d72dd}.bone-toggle[data-v-af64e8e8]{width:22px;height:22px;padding:0;border:0;background:transparent;color:#9aa7c2}.bone-toggle[data-v-af64e8e8]:hover{background:#26324a}.bone-leaf[data-v-af64e8e8]{display:inline-flex;width:22px;justify-content:center;color:#58647d}.bone-name[data-v-af64e8e8]{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}@media(max-width:430px){.grid.three[data-v-af64e8e8]{grid-template-columns:1fr}}.panel[data-v-ea10f1c0]{display:flex;width:100%;height:100%;flex-direction:column;overflow:hidden;background:#14141f;border-left:1px solid #2a2a3c;padding:12px;box-sizing:border-box}.panel-scroll[data-v-ea10f1c0]{min-height:0;flex:1;overflow-y:auto;overscroll-behavior:contain;padding-right:2px;scrollbar-width:thin;scrollbar-color:#2e2e44 transparent}.panel-scroll[data-v-ea10f1c0]::-webkit-scrollbar{width:6px}.panel-scroll[data-v-ea10f1c0]::-webkit-scrollbar-track{background:transparent}.panel-scroll[data-v-ea10f1c0]::-webkit-scrollbar-thumb{background:#2e2e44;border-radius:3px}.panel-scroll[data-v-ea10f1c0]::-webkit-scrollbar-thumb:hover{background:#3a3a55}.panel-header[data-v-ea10f1c0]{display:flex;justify-content:space-between;align-items:center;margin-bottom:10px;flex:0 0 auto;font-weight:700;color:#ccd}.config-management-body[data-v-ea10f1c0]{padding-bottom:2px}.config-toolbar[data-v-ea10f1c0]{display:grid;grid-template-columns:auto auto minmax(0,1fr);gap:6px;margin-bottom:10px}.config-toolbar button[data-v-ea10f1c0],.config-toolbar select[data-v-ea10f1c0]{min-width:0;height:30px;box-sizing:border-box;border:1px solid #3b4864;border-radius:6px;background:#263149;color:#d6def0;font-size:11px}.config-toolbar button[data-v-ea10f1c0]{padding:0 9px;cursor:pointer}.config-toolbar button[data-v-ea10f1c0]:hover{border-color:#7169dc;background:#343d68;color:#fff}.config-toolbar select[data-v-ea10f1c0]{padding:0 7px;overflow:hidden;text-overflow:ellipsis}.config-toolbar select[data-v-ea10f1c0]:disabled{color:#68738a;background:#1b2130}.config-message[data-v-ea10f1c0]{margin:-4px 0 9px;color:#83b9a2;font-size:10px}.config-message.error[data-v-ea10f1c0]{color:#e8959e}.empty[data-v-ea10f1c0],.panel-hint[data-v-ea10f1c0]{color:#667;font-size:12px;padding:8px 0}.group[data-v-ea10f1c0]{border:1px solid #2a2a3c;border-radius:8px;margin-bottom:10px;overflow:hidden}.group-head[data-v-ea10f1c0]{display:flex;align-items:center;gap:6px;padding:7px 10px;cursor:pointer;font-size:12px;font-weight:600;color:#ccd;background:#191924;-webkit-user-select:none;user-select:none}.group-head[data-v-ea10f1c0]:hover{background:#20202e}.group-reset[data-v-ea10f1c0]{margin-left:auto;height:22px;padding:0 7px;border:1px solid #3a465f;border-radius:5px;background:#252d3d;color:#9eabc3;font-size:10px;line-height:20px;cursor:pointer}.group-reset[data-v-ea10f1c0]:hover{border-color:#7774ff;background:#45426f;color:#fff}.scene-head[data-v-ea10f1c0]{padding-right:6px}.scene-actions[data-v-ea10f1c0]{margin-left:auto;display:flex;align-items:center;gap:4px}.scene-add[data-v-ea10f1c0]{height:24px;padding:0 6px;border:1px solid #3a4a6a;border-radius:5px;background:#2e3a55;color:#cdf;font-size:10px;white-space:nowrap;cursor:pointer}.scene-add[data-v-ea10f1c0]:hover{border-color:#7774ff;background:#45426f;color:#fff}.scene-add[data-v-ea10f1c0]:disabled{opacity:.42;cursor:not-allowed;border-color:#343a4b;background:#252a38;color:#778095}.group-body[data-v-ea10f1c0]{padding:8px 10px 12px}.caret[data-v-ea10f1c0]{display:inline-block;width:12px;color:#667;font-size:11px}.divider[data-v-ea10f1c0]{height:1px;background:#2a2a3c;margin:8px 0}.tree[data-v-ea10f1c0]{margin-bottom:8px}.tree-item[data-v-ea10f1c0]{display:flex;align-items:center;gap:6px;padding:5px 6px;font-size:12px;color:#bcd;border-radius:6px;margin-bottom:2px}.tree-item.on[data-v-ea10f1c0]{background:#26324a;color:#ffe}.tree-item .tdot[data-v-ea10f1c0]{color:#fc3;font-size:10px}.tree-item .tdot.dim[data-v-ea10f1c0]{color:#556}.tree-item .tdot.collision-dot[data-v-ea10f1c0]{color:#ff7070}.tree-item .tdot.path-dot[data-v-ea10f1c0]{color:#ff933e;font-size:14px}.tree-item .tdot.spine-dot[data-v-ea10f1c0]{color:#c08cff;font-size:11px}.tree-item .tlabel[data-v-ea10f1c0]{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.scene-tree[data-v-ea10f1c0]{padding-bottom:8px;border-bottom:1px solid #2a2a3c}.scene-object-item[data-v-ea10f1c0]{min-height:28px;cursor:pointer}.scene-object-item[data-v-ea10f1c0]:hover{background:#202b40}.scene-object-kind[data-v-ea10f1c0]{color:#75829c;font-size:10px}.scene-object-eye[data-v-ea10f1c0]{width:24px;height:22px;padding:3px;flex:0 0 24px;border:1px solid transparent;border-radius:5px;background:transparent;color:#9aa6bf;cursor:pointer}.scene-object-eye[data-v-ea10f1c0]:hover{border-color:#4b5972;background:#29354a;color:#e1e7f4}.scene-object-eye.off[data-v-ea10f1c0]{color:#59647a}.scene-object-eye svg[data-v-ea10f1c0]{display:block;width:100%;height:100%;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.scene-object-eye .eye-slash[data-v-ea10f1c0]{stroke:#d47b88;stroke-width:2}.scene-object-delete[data-v-ea10f1c0]{width:24px;height:22px;padding:0;border:1px solid #59414a;border-radius:5px;background:#3a272f;color:#efb4bd;font-size:11px;cursor:pointer}.scene-object-delete[data-v-ea10f1c0]:hover{border-color:#a45c69;background:#57303a;color:#fff}.object-editor-title[data-v-ea10f1c0]{margin:10px 0 8px;padding-top:8px;border-top:1px solid #2a2a3c;color:#cbd4e8;font-weight:700}.field-block[data-v-ea10f1c0]{display:flex;flex-direction:column;gap:5px;margin:10px 0;color:#8f9ab3;font-size:11px}.field-block>.inp[data-v-ea10f1c0]{width:100%;box-sizing:border-box;min-height:30px}.field-block small[data-v-ea10f1c0]{color:#5f6d86;line-height:1.5}.field-grid[data-v-ea10f1c0]{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px;align-items:end}.compact-field[data-v-ea10f1c0]{display:flex;min-width:0;flex-direction:column;gap:5px;margin:5px 0;color:#8f9ab3;font-size:11px}.compact-field .inp[data-v-ea10f1c0]{width:100%;min-height:30px;box-sizing:border-box}.check-field[data-v-ea10f1c0]{align-items:flex-start}.check-field input[data-v-ea10f1c0]{width:18px;height:18px;margin:4px 0;accent-color:#4f7ee8}.tag-editor[data-v-ea10f1c0]{display:flex;flex-wrap:wrap;gap:5px}.object-tag[data-v-ea10f1c0],.tag-add[data-v-ea10f1c0]{height:26px;padding:0 8px;border:1px solid #3b4861;border-radius:5px;background:#242d40;color:#aeb8cf;cursor:pointer}.object-tag.on[data-v-ea10f1c0]{border-color:#7774ff;background:#514fd0;color:#fff}.tag-add[data-v-ea10f1c0]{width:28px;padding:0;border-style:dashed;font-size:17px}.follow-path[data-v-ea10f1c0],.setting-line[data-v-ea10f1c0]{display:flex;align-items:center;gap:8px;margin:12px 0 4px;color:#aeb8cf;font-size:12px}.setting-line[data-v-ea10f1c0]{justify-content:space-between}.follow-path input[data-v-ea10f1c0],.setting-line input[type=checkbox][data-v-ea10f1c0]{width:17px;height:17px;accent-color:#4f7ee8}.collider-follow-section[data-v-ea10f1c0]{margin-top:12px;padding-top:4px;border-top:1px solid #30394d}.collider-curve-title[data-v-ea10f1c0]{display:flex;flex-direction:column;gap:3px;margin:12px 0 6px;color:#aeb8cf;font-size:12px}.collider-curve-title small[data-v-ea10f1c0]{color:#67738c;font-size:10px;line-height:1.45}.path-color[data-v-ea10f1c0]{width:48px;height:28px;padding:0;border:1px solid #3a4963;background:transparent;cursor:pointer}.path-help[data-v-ea10f1c0]{margin:12px 0;color:#7d89a2;font-size:11px;line-height:1.55}.path-help>span[data-v-ea10f1c0]{color:#aeb8cf}.path-help ul[data-v-ea10f1c0]{margin:6px 0 0;padding-left:20px}.path-help li[data-v-ea10f1c0]{margin:3px 0}.path-action[data-v-ea10f1c0]{width:100%;height:31px;margin-top:7px;border:0;border-radius:5px;background:#33425b;color:#c9d1e1;cursor:pointer}.path-action[data-v-ea10f1c0]:hover{filter:brightness(1.12)}.path-action.primary[data-v-ea10f1c0]{background:#f05408;color:#fff}.tag[data-v-ea10f1c0]{font-size:10px;color:#667;background:#1c1c2a;border-radius:4px;padding:1px 5px}.row[data-v-ea10f1c0]{display:flex;align-items:center;gap:8px;margin:6px 0;font-size:12px;color:#aab}.row>span[data-v-ea10f1c0]:first-child{width:60px;flex-shrink:0;color:#8a93bb}.inp[data-v-ea10f1c0]{flex:1;min-width:0;padding:3px 5px;background:#1a1a28;border:1px solid #2e2e44;border-radius:5px;color:#dde;font-size:12px}.pair[data-v-ea10f1c0]{display:flex;flex-direction:column;gap:2px;flex:1}.colr[data-v-ea10f1c0]{width:28px;height:22px;border:none;background:none;cursor:pointer}.segs[data-v-ea10f1c0]{display:flex;gap:6px;margin:6px 0}.stream-behavior-segs[data-v-ea10f1c0]{margin-top:10px}.stream-loop-options[data-v-ea10f1c0]{display:grid;gap:8px;margin:8px 0 4px;padding:9px 10px;border:1px solid #32405a;border-radius:6px;background:#171f2e}.seg[data-v-ea10f1c0]{flex:1;padding:5px;background:#1e1e2e;border:1px solid #2e2e44;border-radius:6px;color:#aab;font-size:12px;cursor:pointer}.seg.on[data-v-ea10f1c0]{background:#3a5a8c;color:#fff;border-color:#5a7ab8}.mini-btn[data-v-ea10f1c0]{background:#2e3a55;border:1px solid #3a4a6a;color:#cdf;border-radius:5px;padding:3px 8px;font-size:11px;cursor:pointer}.mini-btn.danger[data-v-ea10f1c0]{background:#4a2a2e;color:#fbb}.placeholder[data-v-ea10f1c0]{color:#667;font-size:11px;padding:6px 0}.export-settings[data-v-ea10f1c0]{padding-top:3px}.export-field[data-v-ea10f1c0]{display:flex;flex-direction:column;gap:6px;margin:10px 0 13px;color:#9ca8bf;font-size:11px;font-weight:600}.export-input[data-v-ea10f1c0]{width:100%;min-height:34px;box-sizing:border-box;padding:6px 9px;color:#e3e7f2;background:#141a29;border-color:#35445f}.export-fps-row[data-v-ea10f1c0]{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:12px;align-items:end}.export-fps-field[data-v-ea10f1c0]{margin-bottom:5px}.export-checkbox[data-v-ea10f1c0]{display:flex;align-items:center;gap:7px;min-height:34px;margin-bottom:5px;color:#aeb8cc;font-size:11px;white-space:nowrap}.export-checkbox input[data-v-ea10f1c0]{width:17px;height:17px;margin:0;accent-color:#625ff1}.export-help[data-v-ea10f1c0]{margin:-6px 0 14px;color:#66758e;font-size:10px;line-height:1.5}.export-switches[data-v-ea10f1c0]{display:grid;gap:13px;margin:4px 0 7px;padding-top:2px}.export-switch[data-v-ea10f1c0]{font-weight:600}.export-switch-last[data-v-ea10f1c0]{margin-top:13px}.export-spine-json[data-v-ea10f1c0]{width:100%;margin-top:10px;padding:9px 12px;flex:0 0 auto;border:1px solid #4f4b9a;border-radius:7px;background:#403b91;color:#f1f0ff;font-size:12px;font-weight:700;cursor:pointer}.export-spine-json[data-v-ea10f1c0]:hover{border-color:#7774ff;background:#514bc0}.export-spine-json[data-v-ea10f1c0]:disabled{cursor:wait;opacity:.68}.export-message[data-v-ea10f1c0]{padding:7px 5px 0;color:#70d8ae;font-size:10px;line-height:1.45;text-align:center}.export-message.error[data-v-ea10f1c0]{color:#ff858f}.look-title[data-v-ea10f1c0]{font-size:12px;font-weight:600;color:#ccd;margin:10px 0 6px;padding-bottom:4px;border-bottom:1px solid #2a2a3c}.look-title[data-v-ea10f1c0]:first-child{margin-top:2px}.seg[data-v-ea10f1c0]{display:flex;gap:6px;margin:6px 0}.seg-btn[data-v-ea10f1c0]{flex:1;padding:5px;background:#1e1e2e;border:1px solid #2e2e44;border-radius:6px;color:#aab;font-size:12px;cursor:pointer}.seg-btn.active[data-v-ea10f1c0]{background:#3a5a8c;color:#fff;border-color:#5a7ab8}.curve-hint[data-v-ea10f1c0]{min-height:54px;border:1px dashed #2e2e44;border-radius:6px;display:flex;align-items:center;justify-content:center;color:#556;font-size:11px;margin:6px 0}.curve-wrap[data-v-ea10f1c0]{margin:6px 0}.curve-labels[data-v-ea10f1c0]{display:flex;justify-content:space-between;color:#566;font-size:10px;margin-top:2px}.image-title[data-v-ea10f1c0]{display:flex;align-items:center;justify-content:space-between}.image-add[data-v-ea10f1c0]{width:26px;height:24px;border:1px solid #4a4d9a;border-radius:5px;background:#252850;color:#8f8cff;font-size:18px;line-height:1;cursor:pointer}.image-add[data-v-ea10f1c0]:hover{background:#4542a8;color:#fff}.image-card[data-v-ea10f1c0]{margin:8px 0;padding:9px;border:1px solid #2e3c55;border-radius:7px;background:#171d2a}.imgrow[data-v-ea10f1c0]{display:flex;align-items:flex-start;gap:8px}.img-thumb[data-v-ea10f1c0]{width:48px;height:48px;padding:0;border:1px solid #3a4963;border-radius:6px;background:#1a2232;display:flex;align-items:center;justify-content:center;flex-shrink:0;cursor:pointer;overflow:hidden}.img-thumb[data-v-ea10f1c0]:hover{border-color:#7774ff}.img-thumb img[data-v-ea10f1c0]{display:block;width:100%;height:100%;object-fit:contain}.img-fields[data-v-ea10f1c0]{flex:1;min-width:0}.img-actions[data-v-ea10f1c0]{display:flex;flex-direction:column;gap:4px}.mini-btn2[data-v-ea10f1c0]{width:26px;height:24px;background:#1e1e2e;border:1px solid #2e2e44;border-radius:5px;color:#aab;font-size:12px;cursor:pointer;display:flex;align-items:center;justify-content:center}.mini-btn2[data-v-ea10f1c0]:hover{background:#2b3a5c}.mini-btn2[data-v-ea10f1c0]:disabled{opacity:.35;cursor:not-allowed}.thumb-note[data-v-ea10f1c0]{color:#667;font-size:11px;margin:4px 0 2px}.resource-divider[data-v-ea10f1c0]{height:1px;margin:9px 0 7px;background:#2a3549}.resource-color-row .blend-select[data-v-ea10f1c0]{max-width:88px}.resource-color-picker .hex[data-v-ea10f1c0]{margin-left:0}.hex-input[data-v-ea10f1c0]{width:72px;padding:4px 6px;border:1px solid #344158;border-radius:5px;outline:none;background:#101725;color:#aeb8cb;font-size:11px;font-family:monospace}.hex-input[data-v-ea10f1c0]:focus{border-color:#7774ff;color:#fff}.resource-alpha-head[data-v-ea10f1c0]{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:10px;color:#8a93bb;font-size:12px}.alpha-modes[data-v-ea10f1c0]{display:flex;gap:3px}.alpha-modes button[data-v-ea10f1c0]{padding:4px 8px;border:1px solid transparent;border-radius:5px;background:transparent;color:#8d98ae;font-size:11px;cursor:pointer}.alpha-modes button[data-v-ea10f1c0]:hover{background:#273246}.alpha-modes button.on[data-v-ea10f1c0]{border-color:#7774ff;background:#605df0;color:#fff}.resource-alpha-curve[data-v-ea10f1c0]{margin-top:7px}.resource-weight-row[data-v-ea10f1c0]{display:flex;align-items:center;gap:5px}.resource-weight-control[data-v-ea10f1c0]{flex:1;min-width:0}.weight-lock[data-v-ea10f1c0]{width:28px;height:26px;flex:0 0 28px;padding:5px;border:1px solid #35435c;border-radius:5px;background:#202a3b;color:#78859e;cursor:pointer}.weight-lock svg[data-v-ea10f1c0]{display:block;width:100%;height:100%;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.weight-lock[data-v-ea10f1c0]:hover:not(:disabled){border-color:#7774ff;color:#b8b6ff}.weight-lock.on[data-v-ea10f1c0]{border-color:#7774ff;background:#514fd0;color:#fff}.weight-lock[data-v-ea10f1c0]:disabled{opacity:.35;cursor:not-allowed}.file-input[data-v-ea10f1c0]{display:none}.hex[data-v-ea10f1c0]{font-size:11px;color:#889;margin-left:auto;font-variant-numeric:tabular-nums}.inp.tiny[data-v-ea10f1c0]{width:46px;flex:0 0 46px;text-align:center}.attr-body[data-v-ea10f1c0]{padding:10px;background:#151b27}.attr-section-title[data-v-ea10f1c0]{margin:2px 0 8px;color:#9ca8c0;font-size:12px;font-weight:700}.attr-section-title.life-title[data-v-ea10f1c0]{margin-top:14px;padding-top:12px;border-top:1px solid #2d3950}.attr-axis-head[data-v-ea10f1c0]{display:flex;align-items:center;justify-content:space-between;margin:10px 1px -2px;color:#aeb8cf;font-size:12px;font-weight:600}.axis-modes[data-v-ea10f1c0]{display:flex;gap:4px}.axis-mode[data-v-ea10f1c0]{padding:4px 8px;border:1px solid #344158;border-radius:5px;background:#273246;color:#aeb8cf;font-size:11px;cursor:pointer}.axis-mode.on[data-v-ea10f1c0]{border-color:#7774ff;background:#605df0;color:#fff}.life-item[data-v-ea10f1c0]{padding:9px 0;border-bottom:1px solid #2a3549}.switch-row[data-v-ea10f1c0]{display:flex;align-items:center;gap:9px;color:#b8c1d5;font-size:12px;cursor:pointer}.switch-row input[data-v-ea10f1c0]{position:absolute;opacity:0;pointer-events:none}.switch-ui[data-v-ea10f1c0]{position:relative;width:32px;height:18px;border-radius:10px;background:#354258;transition:background .16s ease}.switch-ui[data-v-ea10f1c0]:after{content:"";position:absolute;left:2px;top:2px;width:14px;height:14px;border-radius:50%;background:#fff;transition:transform .16s ease}.switch-row input:checked+.switch-ui[data-v-ea10f1c0]{background:#625ff1}.switch-row input:checked+.switch-ui[data-v-ea10f1c0]:after{transform:translate(14px)}.life-axis[data-v-ea10f1c0]{margin:9px 0 2px 42px}.seed-row[data-v-ea10f1c0]{display:flex;align-items:center;gap:8px;margin-top:12px;padding-top:12px;border-top:1px solid #2d3950}.seed-row label[data-v-ea10f1c0]{width:64px;color:#8f9bb5;font-size:12px}.seed-input[data-v-ea10f1c0]{min-width:0;flex:1;padding:6px 8px;border:1px solid #344158;border-radius:6px;outline:none;background:#0f1625;color:#e2e7f2;font-size:12px}.seed-input[data-v-ea10f1c0]:focus{border-color:#625ff1}.seed-random[data-v-ea10f1c0]{width:34px;height:30px;border:1px solid #3a4860;border-radius:6px;background:#2c3950;color:#d7def0;cursor:pointer}.seed-random[data-v-ea10f1c0]:hover{background:#394964}.scene-seed[data-v-ea10f1c0]{margin-top:10px}.seed-hint[data-v-ea10f1c0]{margin:5px 0 1px 72px;color:#657188;font-size:9px;line-height:1.45}.modifier-item[data-v-ea10f1c0]{padding:8px 0 10px;border-bottom:1px solid #2a3549}.modifier-switch[data-v-ea10f1c0]{font-weight:600}.modifier-params[data-v-ea10f1c0]{margin:8px 0 0 10px;padding:2px 0 2px 10px;border-left:2px solid #344158}.modifier-hint[data-v-ea10f1c0]{margin:7px 0 0 2px;color:#647086;font-size:9px;line-height:1.5}.stream-loop-hint[data-v-ea10f1c0]{margin:9px 2px 3px;padding:7px 8px;border:1px solid #4a436e;border-radius:5px;background:#211f35;color:#aaa4d7}.switch-row input:disabled+.switch-ui[data-v-ea10f1c0]{opacity:.45;cursor:not-allowed}.bone-follow-target[data-v-ea10f1c0]{margin:7px 0 9px;padding:7px 8px;overflow:hidden;color:#7f8ba3;background:#121a29;border:1px solid #2f3c53;border-radius:5px;font-size:10px;text-overflow:ellipsis;white-space:nowrap}.bone-follow-target strong[data-v-ea10f1c0]{color:#c8d0e4;font-weight:600}.bone-follow-missing[data-v-ea10f1c0]{margin:7px 0 9px;padding:7px 8px;color:#d49aa3;background:#2a1e26;border:1px solid #513540;border-radius:5px;font-size:10px;line-height:1.5}.bone-follow-rebind[data-v-ea10f1c0]{width:100%;min-height:28px;margin:0 0 8px;padding:4px 8px;overflow:hidden;border:1px solid #4a436e;border-radius:5px;background:#2d2947;color:#c8c2ee;font-size:10px;text-overflow:ellipsis;white-space:nowrap;cursor:pointer}.bone-follow-rebind[data-v-ea10f1c0]:hover{border-color:#7165bd;background:#3a335d;color:#fff}.bone-follow-transform-grid[data-v-ea10f1c0]{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}.modifier-mode-row[data-v-ea10f1c0]{display:flex;justify-content:flex-end;gap:4px;margin-bottom:6px}.gravity-curve-title[data-v-ea10f1c0]{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:10px 0 6px;color:#9ba7bd;font-size:11px}.gravity-curve-title span[data-v-ea10f1c0]:last-child{color:#657188;font-size:9px}.gravity-curve-axis[data-v-ea10f1c0]{display:flex;justify-content:space-between;margin:3px 34px 0 1px;color:#5f6b82;font-size:9px}.gravity-params[data-v-ea10f1c0] .ce-svg{height:96px;background:#0f1625;border-color:#30405a}.trail-params[data-v-ea10f1c0]{padding-right:2px}.trail-section-title[data-v-ea10f1c0]{margin:3px 0 8px;color:#aeb8cf;font-size:12px;font-weight:700}.trail-resource-row[data-v-ea10f1c0]{display:flex;align-items:stretch;gap:8px;margin-bottom:10px;padding:8px;border:1px solid #2e3c55;border-radius:7px;background:#171d2a}.trail-thumb[data-v-ea10f1c0]{width:58px;min-height:58px;padding:3px;flex:0 0 58px;border:1px solid #3a4963;border-radius:6px;background:#101725;cursor:pointer;overflow:hidden}.trail-thumb[data-v-ea10f1c0]:hover{border-color:#7774ff}.trail-thumb img[data-v-ea10f1c0]{display:block;width:100%;height:100%;object-fit:contain}.trail-resource-fields[data-v-ea10f1c0]{display:flex;min-width:0;flex:1;flex-direction:column;gap:7px}.trail-color-row[data-v-ea10f1c0]{display:flex;align-items:center;gap:5px;color:#8a93bb;font-size:11px}.trail-color-row>span[data-v-ea10f1c0]{min-width:0;flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.trail-color-row .hex-input[data-v-ea10f1c0],.trail-fixed-color .hex-input[data-v-ea10f1c0]{min-width:0;flex:1}.trail-mode-head[data-v-ea10f1c0]{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:10px 0 6px;color:#9ba7bd;font-size:11px}.trail-sub-switch[data-v-ea10f1c0]{margin:11px 0 7px;padding-top:9px;border-top:1px solid #2a3549}.trail-grid-row[data-v-ea10f1c0]{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:8px}.trail-grid-row[data-v-ea10f1c0] .ns{min-width:0;flex-wrap:wrap;align-items:center}.trail-grid-row[data-v-ea10f1c0] .ns-label{width:100%}.trail-grid-row[data-v-ea10f1c0] .ns-range{min-width:0}.trail-grid-row[data-v-ea10f1c0] .ns-num{width:42px}.trail-params[data-v-ea10f1c0] .ce-svg{height:92px;background:#0f1625;border-color:#30405a}.timeline[data-v-0ef42eef]{height:100%;background:#12121c;border-top:1px solid #2a2a3c;display:flex;flex-direction:column;padding:6px 10px;gap:4px}.tl-controls[data-v-0ef42eef]{display:flex;align-items:center;gap:8px}.tl-btn[data-v-0ef42eef]{width:30px;height:26px;background:#1e1e2e;border:1px solid #2e2e44;border-radius:6px;color:#aab;font-size:12px;cursor:pointer}.tl-btn.on[data-v-0ef42eef]{background:#3a5a8c;color:#fff;border-color:#5a7ab8}.tl-frame[data-v-0ef42eef]{display:inline-block;flex:0 0 92px;width:92px;box-sizing:border-box;font-size:12px;color:#aab;text-align:right;font-variant-numeric:tabular-nums;font-feature-settings:"tnum" 1;white-space:nowrap}.tl-frame b[data-v-0ef42eef]{display:inline;color:inherit;font-weight:400}.tl-legend[data-v-0ef42eef]{display:flex;align-items:center;gap:4px;color:#778198;font-size:10px}.tl-legend i[data-v-0ef42eef]{display:inline-block;width:10px;height:7px;border-radius:2px}.legend-emission[data-v-0ef42eef]{margin-left:4px;background:#2f8b62}.legend-life[data-v-0ef42eef]{margin-left:5px;background:#a54551}.legend-spine[data-v-0ef42eef]{margin-left:5px;background:#7448b8}.tl-anim[data-v-0ef42eef]{display:flex;align-items:center;gap:6px;font-size:12px;color:#aab}.tl-owner-animation[data-v-0ef42eef]{position:relative}.tl-animation-trigger[data-v-0ef42eef]{display:flex;align-items:center;justify-content:space-between;gap:8px;width:116px;height:25px;padding:0 7px;overflow:hidden;border:1px solid #2e2e44;border-radius:5px;background:#1a1a28;color:#dde;cursor:pointer}.tl-animation-trigger>span[data-v-0ef42eef]{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tl-animation-trigger>i[data-v-0ef42eef]{flex:0 0 auto;color:#8c96ad;font-style:normal}.tl-animation-trigger[data-v-0ef42eef]:disabled{opacity:.5;cursor:not-allowed}.tl-animation-menu[data-v-0ef42eef]{position:absolute;z-index:30;right:0;bottom:calc(100% + 6px);width:226px;padding:7px;border:1px solid #3c4760;border-radius:8px;background:#171b29;box-shadow:0 10px 24px #00000073}.tl-animation-menu-title[data-v-0ef42eef]{padding:2px 4px 6px;color:#77839c;font-size:10px}.tl-animation-option[data-v-0ef42eef]{display:flex;align-items:center;justify-content:space-between;width:100%;height:27px;padding:0 7px;border:0;border-radius:5px;background:transparent;color:#b8c1d5;text-align:left;cursor:pointer}.tl-animation-option>span[data-v-0ef42eef]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tl-animation-option[data-v-0ef42eef]:hover{background:#252e42}.tl-animation-option.on[data-v-0ef42eef]{background:#34335d;color:#fff}.tl-animation-option>i[data-v-0ef42eef]{color:#8d8aff;font-style:normal}.tl-animation-editor[data-v-0ef42eef]{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:5px;margin-top:7px;padding-top:7px;border-top:1px solid #2b3346}.tl-animation-name[data-v-0ef42eef]{min-width:0;height:27px;padding:0 7px;box-sizing:border-box;border:1px solid #343e55;border-radius:5px;background:#101522;color:#e1e6f2;outline:none}.tl-animation-name[data-v-0ef42eef]:focus{border-color:#6865d8}.tl-animation-editor button[data-v-0ef42eef],.tl-animation-actions button[data-v-0ef42eef]{height:27px;padding:0 8px;border:1px solid #3c4861;border-radius:5px;background:#29344a;color:#cbd3e3;cursor:pointer}.tl-animation-actions[data-v-0ef42eef]{display:grid;grid-template-columns:1fr 1fr;gap:5px;margin-top:6px}.tl-animation-actions button[data-v-0ef42eef]:last-child{border-color:#5b3942;background:#3b282f;color:#e2a8b2}.tl-animation-actions button[data-v-0ef42eef]:disabled{opacity:.4;cursor:not-allowed}.tl-animation-error[data-v-0ef42eef]{margin-top:5px;color:#ef8997;font-size:10px}.tl-animation-hint[data-v-0ef42eef]{margin-top:5px;color:#69758d;font-size:9px;text-align:center}.tl-sel[data-v-0ef42eef]{background:#1a1a28;border:1px solid #2e2e44;color:#dde;border-radius:5px;padding:2px 6px;font-size:12px}.tl-sel[data-v-0ef42eef]:disabled{opacity:.5;cursor:not-allowed}.tl-spine-preview .tl-sel[data-v-0ef42eef]{max-width:190px}.tl-zoom[data-v-0ef42eef]{margin-left:auto;font-size:11px;color:#667}.tl-viewport[data-v-0ef42eef]{position:relative;flex:1;overflow:hidden;background:#0d0d14;border:1px solid #2a2a3c;border-radius:6px;cursor:ew-resize}.tl-ticks[data-v-0ef42eef]{position:absolute;top:0;left:0;right:0;height:18px}.tl-tickline[data-v-0ef42eef]{position:absolute;top:0;bottom:0;width:1px;background:#263040}.tl-ticklabel[data-v-0ef42eef]{position:absolute;top:2px;transform:translate(-50%);font-size:9px;color:#667}.tl-playhead[data-v-0ef42eef]{position:absolute;top:0;bottom:0;width:2px;background:#fc3;z-index:5;pointer-events:none}.tl-lanes[data-v-0ef42eef]{position:absolute;top:22px;left:0;right:0;bottom:0}.tl-lane[data-v-0ef42eef]{position:relative;height:26px;margin-bottom:4px}.lane-ico[data-v-0ef42eef]{position:absolute;left:4px;top:6px;font-size:11px;color:#dde;z-index:2;pointer-events:none}.lane-bar[data-v-0ef42eef]{position:absolute;top:4px;height:18px;display:flex;align-items:stretch;cursor:grab;box-sizing:border-box}.lane-bar[data-v-0ef42eef]:active{cursor:grabbing}.lane-name[data-v-0ef42eef]{position:absolute;left:14px;right:5px;top:2px;z-index:2;pointer-events:none;font-size:11px;color:#fff;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.bar-life[data-v-0ef42eef]{position:absolute;inset:0 auto 0 0;z-index:0;min-width:1px;border:1px solid #c05a66;border-radius:5px;background:#a54551;box-sizing:border-box}.bar-emission[data-v-0ef42eef]{position:absolute;inset:0 auto 0 0;z-index:1;min-width:1px;border:1px solid #45a97d;border-radius:5px 0 0 5px;background:#2f8b62;box-sizing:border-box}.bar-handle[data-v-0ef42eef]{position:absolute;z-index:4;right:-4px;top:-1px;bottom:-1px;width:8px;cursor:ew-resize;background:#ffffff2e}.bar-handle[data-v-0ef42eef]:hover{background:#ffffff59}.spine-ico[data-v-0ef42eef]{color:#c08cff}.spine-bar[data-v-0ef42eef]{position:absolute;top:4px;height:18px;min-width:1px;box-sizing:border-box;border:1px solid #a575ed;border-radius:5px;background:#7448b8;cursor:grab;box-shadow:inset 0 0 0 1px #ffffff0d}.spine-bar[data-v-0ef42eef]:active{cursor:grabbing}.tl-empty[data-v-0ef42eef]{color:#667;font-size:11px;padding:8px}.layout[data-v-8eacccdc]{display:flex;width:100%;height:100%;min-height:0;overflow:clip}.parameter-panel[data-v-8eacccdc]{flex-shrink:0;height:100%;min-height:0;overflow:clip}.resizer-col[data-v-8eacccdc]{width:5px;cursor:col-resize;background:#1c1c2a;border-left:1px solid #2a2a3c;border-right:1px solid #2a2a3c;flex-shrink:0}.resizer-col[data-v-8eacccdc]:hover{background:#3a5a8c}.right[data-v-8eacccdc]{flex:1;min-width:0;height:100%;min-height:0;overflow:clip;display:flex;flex-direction:column}.panel-right .right[data-v-8eacccdc]{order:1}.panel-right .resizer-col[data-v-8eacccdc]{order:2}.panel-right .parameter-panel[data-v-8eacccdc]{order:3}.stage-area[data-v-8eacccdc]{flex:1;min-height:0;overflow:clip}.resizer-row[data-v-8eacccdc]{height:4px;cursor:row-resize;background:#1c1c2a;border-top:1px solid #2a2a3c;border-bottom:1px solid #2a2a3c;flex-shrink:0}.resizer-row[data-v-8eacccdc]:hover{background:#3a5a8c}.timeline-area[data-v-8eacccdc]{position:relative;z-index:10;flex-shrink:0;overflow:visible}html,body{width:100%;height:100%;margin:0;padding:0;overflow:clip;overscroll-behavior:none;background:#0b0b12;color:#e8e8f0;font-family:system-ui,-apple-system,Segoe UI,sans-serif}body{position:fixed;top:0;right:0;bottom:0;left:0}*{box-sizing:border-box}#app{position:fixed;top:0;right:0;bottom:0;left:0;width:auto;height:auto;overflow:clip}input[type=number]{-webkit-appearance:textfield;appearance:textfield;-moz-appearance:textfield}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{margin:0;-webkit-appearance:none;-moz-appearance:none;appearance:none} +.stage-wrap[data-v-1b609e97]{position:relative;width:100%;height:100%;overflow:hidden}.stage-holder[data-v-1b609e97]{width:100%;height:100%;cursor:grab;touch-action:none;background-color:#0e1219;outline:none}.stage-holder.grid[data-v-1b609e97]{background:conic-gradient(#141a26 90deg,transparent 90deg 180deg,#141a26 180deg 270deg,transparent 270deg);background-size:28px 28px}.stage-holder[data-v-1b609e97]:active{cursor:grabbing}.topbar[data-v-1b609e97]{position:absolute;top:10px;left:10px;right:10px;display:flex;align-items:center;gap:10px;padding:8px 12px;background:#141420d9;border-radius:10px;border:1px solid rgba(255,255,255,.08);font-size:12px;color:#aab;z-index:5;flex-wrap:wrap}.topbar input[type=range][data-v-1b609e97]{background:#1a1a28;border:1px solid #2e2e44;color:#dde;border-radius:5px}.tool-group[data-v-1b609e97]{display:flex;gap:6px;margin-left:6px;padding-left:12px;border-left:1px solid #2a2a3c}.tool-btn[data-v-1b609e97]{width:30px;height:26px;background:#1e1e2e;border:1px solid #2e2e44;border-radius:6px;color:#aab;font-size:14px;cursor:pointer;display:flex;align-items:center;justify-content:center}.tool-btn[data-v-1b609e97]:hover{background:#2b3a5c;color:#fff}.tool-btn.on[data-v-1b609e97]{background:#3a5a8c;color:#fff;border-color:#5a7ab8}.background-menu[data-v-1b609e97]{position:relative;flex:0 0 auto}.background-btn[data-v-1b609e97]{height:28px;padding:0 11px;border:1px solid #3a4963;border-radius:6px;background:#202a3b;color:#cbd7ed;font-size:12px;cursor:pointer}.background-btn[data-v-1b609e97]:hover,.background-btn.on[data-v-1b609e97]{border-color:#7774ff;background:#343b63;color:#fff}.background-panel[data-v-1b609e97]{position:absolute;top:calc(100% + 9px);right:0;width:248px;box-sizing:border-box;padding:10px;border:1px solid #343b50;border-radius:9px;background:#141420fa;color:#aeb8cc;box-shadow:0 8px 24px #0000007a;z-index:12}.background-upload[data-v-1b609e97]{width:100%;height:30px;border:1px solid #5652b5;border-radius:6px;background:#4540a0;color:#fff;cursor:pointer}.background-upload[data-v-1b609e97]:hover{border-color:#8982ff;background:#554dc2}.background-clear[data-v-1b609e97]{width:100%;height:28px;margin-top:6px;border:1px solid #70404a;border-radius:6px;background:#512a33;color:#efb5bd;cursor:pointer}.background-clear[data-v-1b609e97]:hover:not(:disabled){border-color:#b65b6a;background:#6a303b;color:#fff}.background-clear[data-v-1b609e97]:disabled{opacity:.42;cursor:not-allowed}.background-file-input[data-v-1b609e97]{display:none}.background-file-name[data-v-1b609e97]{margin:7px 2px 9px;overflow:hidden;color:#737f98;font-size:10px;text-overflow:ellipsis;white-space:nowrap}.background-position-row[data-v-1b609e97]{display:grid;grid-template-columns:1fr 1fr;gap:8px}.background-position-row label[data-v-1b609e97]{display:flex;align-items:center;gap:5px;color:#8995ad;font-size:11px}.background-position-row input[data-v-1b609e97]{width:0;min-width:0;flex:1;box-sizing:border-box;height:28px;padding:0 6px;border:1px solid #343e55;border-radius:5px;background:#101522;color:#e1e6f2}.background-opacity-row[data-v-1b609e97]{display:grid;grid-template-columns:46px 1fr 34px;align-items:center;gap:7px;margin-top:10px;font-size:11px}.background-opacity-row input[data-v-1b609e97]{min-width:0;accent-color:#675de0}.background-opacity-row b[data-v-1b609e97]{color:#aeb8cc;font-size:10px;text-align:right;font-variant-numeric:tabular-nums}.help-btn[data-v-1b609e97]{height:28px;margin-left:auto;padding:0 11px;flex:0 0 auto;border:1px solid #3a4963;border-radius:6px;background:#202a3b;color:#cbd7ed;font-size:12px;font-weight:700;cursor:pointer}.help-btn[data-v-1b609e97]:hover,.help-btn.on[data-v-1b609e97]{border-color:#7774ff;background:#343b63;color:#fff}.zoom-pct[data-v-1b609e97]{margin-left:0;font-variant-numeric:tabular-nums;color:#9aa;min-width:44px;text-align:center}.help-overlay[data-v-1b609e97]{position:absolute;top:0;right:0;bottom:0;left:0;z-index:40;display:flex;align-items:center;justify-content:center;padding:72px 24px 28px;box-sizing:border-box;background:#05080fb8;-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px)}.help-dialog[data-v-1b609e97]{width:min(820px,100%);max-height:100%;display:flex;flex-direction:column;overflow:hidden;border:1px solid #3a4864;border-radius:14px;background:#141a27;color:#b8c3d8;box-shadow:0 22px 70px #0000009e}.help-head[data-v-1b609e97]{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;padding:18px 20px 15px;border-bottom:1px solid #2b354a;background:linear-gradient(135deg,#202942,#181e2d)}.help-head h2[data-v-1b609e97]{margin:0;color:#eef2ff;font-size:19px}.help-head p[data-v-1b609e97]{margin:5px 0 0;color:#7786a3;font-size:11px}.help-close[data-v-1b609e97]{width:28px;height:28px;flex:0 0 28px;border:1px solid #43516b;border-radius:6px;background:#273249;color:#ccd7ed;cursor:pointer}.help-close[data-v-1b609e97]:hover{border-color:#7774ff;background:#3b4670;color:#fff}.help-body[data-v-1b609e97]{min-height:0;overflow:auto;padding:18px 20px 21px}.help-section[data-v-1b609e97]{padding:14px 15px;border:1px solid #2c3850;border-radius:10px;background:#181f2e}.help-section h3[data-v-1b609e97]{margin:0 0 11px;color:#9fb2ff;font-size:13px}.help-start ol[data-v-1b609e97]{margin:0;padding-left:21px;color:#aab6cc;font-size:12px;line-height:1.75}.help-start li[data-v-1b609e97]::marker{color:#7774ff;font-weight:700}.help-section b[data-v-1b609e97]{color:#dce4f7}.help-grid[data-v-1b609e97]{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(250px,.85fr);gap:12px;margin-top:12px}.help-list[data-v-1b609e97]{display:grid;gap:0;margin:0}.help-list>div[data-v-1b609e97]{display:grid;grid-template-columns:78px 1fr;gap:9px;padding:7px 0;border-bottom:1px solid #263146}.help-list>div[data-v-1b609e97]:last-child{border-bottom:0}.help-list dt[data-v-1b609e97]{color:#d3dcf0;font-size:11px;font-weight:700}.help-list dd[data-v-1b609e97]{margin:0;color:#8795ae;font-size:11px;line-height:1.5}.shortcut-list[data-v-1b609e97]{display:grid;gap:7px}.shortcut-list>div[data-v-1b609e97]{display:flex;align-items:center;min-height:25px;gap:5px}.shortcut-list kbd[data-v-1b609e97]{min-width:24px;box-sizing:border-box;padding:3px 6px;border:1px solid #465470;border-bottom-width:2px;border-radius:5px;background:#101623;color:#e0e7f6;font:10px/1.2 ui-monospace,SFMono-Regular,Menlo,monospace;text-align:center}.shortcut-list span[data-v-1b609e97]{color:#65728b;font-size:10px}.shortcut-list em[data-v-1b609e97]{margin-left:auto;color:#9ca9c1;font-size:11px;font-style:normal}.help-note[data-v-1b609e97]{margin:11px 0 0;padding-top:9px;border-top:1px solid #2a3549;color:#697791;font-size:10px;line-height:1.55}.help-export[data-v-1b609e97]{margin-top:12px}.help-export p[data-v-1b609e97]{margin:0;color:#8997b0;font-size:11px;line-height:1.65}@media(max-width:760px){.help-overlay[data-v-1b609e97]{padding:66px 12px 14px}.help-grid[data-v-1b609e97]{grid-template-columns:1fr}}.hud[data-v-1b609e97]{position:absolute;bottom:12px;left:12px;padding:8px 12px;background:#141420bf;border-radius:8px;font-size:12px;color:#a0a8cc}.hud-number[data-v-1b609e97]{display:inline-block;box-sizing:border-box;text-align:right;font-variant-numeric:tabular-nums;font-feature-settings:"tnum" 1}.hud-system-count[data-v-1b609e97]{width:3ch}.hud-particle-count[data-v-1b609e97]{width:7ch;text-align:left}.hud-tip[data-v-1b609e97]{margin-left:12px;color:#5f6a8a;font-size:11px}b[data-v-1b609e97]{color:#fc3}.settings-btn[data-v-1b609e97]{height:28px;padding:0 12px;flex:0 0 auto;border:1px solid #3a4963;border-radius:6px;background:#202a3b;color:#cdf;font-size:12px;font-weight:700;cursor:pointer}.settings-btn[data-v-1b609e97]:hover{border-color:#7774ff;background:#2b3a5c;color:#fff}.undo-btn[data-v-1b609e97]{width:30px;height:28px;flex:0 0 30px;border:1px solid #3a4963;border-radius:6px;background:#202a3b;color:#cdd8ed;font-size:18px;line-height:1;cursor:pointer}.undo-btn[data-v-1b609e97]:hover:not(:disabled){border-color:#7774ff;background:#2b3a5c;color:#fff}.undo-btn[data-v-1b609e97]:disabled{opacity:.38;cursor:not-allowed}.settings-panel[data-v-1b609e97]{position:absolute;top:52px;left:10px;width:240px;z-index:10;background:#141420f7;border:1px solid #2a2a3c;border-radius:10px;padding:10px 12px;font-size:12px;color:#aab;box-shadow:0 6px 20px #0006}.sp-head[data-v-1b609e97]{display:flex;justify-content:space-between;align-items:center;font-weight:700;color:#cdf;margin-bottom:10px}.sp-section-title[data-v-1b609e97]{margin:2px 0 8px;color:#8a93bb;font-size:11px}.sp-switch-row[data-v-1b609e97]{display:flex;align-items:center;justify-content:space-between;gap:10px;color:#aab}.sp-switch-control[data-v-1b609e97]{display:inline-flex;align-items:center;gap:7px}.sp-switch-control input[data-v-1b609e97]{position:absolute;width:1px;height:1px;opacity:0;pointer-events:none}.sp-switch-ui[data-v-1b609e97]{position:relative;width:34px;height:18px;border-radius:999px;background:#39445a;cursor:pointer;transition:background .16s ease}.sp-switch-ui[data-v-1b609e97]:after{content:"";position:absolute;top:2px;left:2px;width:14px;height:14px;border-radius:50%;background:#f4f6fb;transition:transform .16s ease}.sp-switch-control input:checked+.sp-switch-ui[data-v-1b609e97]{background:#655df0}.sp-switch-control input:checked+.sp-switch-ui[data-v-1b609e97]:after{transform:translate(16px)}.sp-switch-control input:focus-visible+.sp-switch-ui[data-v-1b609e97]{outline:2px solid #8b86ff;outline-offset:2px}.sp-switch-control b[data-v-1b609e97]{min-width:24px;color:#8a93bb;font-size:11px;font-weight:500}.sp-cache-note[data-v-1b609e97]{margin-top:10px;padding-top:9px;border-top:1px solid #2a2a3c;color:#647089;font-size:10px;text-align:center}.sp-divider[data-v-1b609e97]{height:1px;margin:10px 0;background:#2a2a3c}.sp-close[data-v-1b609e97]{background:#2e3a55;border:none;color:#cdf;border-radius:4px;width:18px;height:18px;cursor:pointer;font-size:11px}.sp-row[data-v-1b609e97]{display:flex;align-items:center;gap:8px;margin:8px 0}.sp-row>span[data-v-1b609e97]:first-child{width:76px;flex-shrink:0;color:#8a93bb}.sp-row input[type=range][data-v-1b609e97]{flex:1;background:#1a1a28;accent-color:#3a5a8c}.sp-num[data-v-1b609e97]{width:52px;background:#1a1a28;border:1px solid #2e2e44;border-radius:5px;color:#dde;font-size:12px;padding:2px 4px}.sp-undo-limit[data-v-1b609e97]{margin-left:auto;width:64px;height:26px;box-sizing:border-box}.sp-colr[data-v-1b609e97]{width:26px;height:22px;border:none;background:none;cursor:pointer}.sp-hex[data-v-1b609e97]{font-size:11px;color:#889;font-variant-numeric:tabular-nums}.sp-chk[data-v-1b609e97]{display:flex;align-items:center;gap:6px;margin:8px 0;color:#aab}.sp-chk.disabled[data-v-1b609e97]{color:#5f687d;cursor:not-allowed}.sp-chk.disabled input[data-v-1b609e97]{cursor:not-allowed;opacity:.55}.ns[data-v-7c2fbed0]{display:flex;align-items:center;gap:8px;margin:6px 0;font-size:12px;color:#aab}.ns-label[data-v-7c2fbed0]{width:60px;flex-shrink:0;color:#8a93bb}.ns-range[data-v-7c2fbed0]{flex:1;accent-color:#3a7cd6}.ns-num[data-v-7c2fbed0]{width:56px;padding:3px 5px;background:#1a1a28;border:1px solid #2e2e44;border-radius:5px;color:#dde;font-size:12px;text-align:right}.ns.disabled[data-v-7c2fbed0]{opacity:.55}.ns.disabled .ns-range[data-v-7c2fbed0],.ns.disabled .ns-num[data-v-7c2fbed0]{cursor:not-allowed}.ce[data-v-9bfb7b31]{display:flex;align-items:flex-start;gap:6px;width:100%}.ce-editor[data-v-9bfb7b31]{flex:1;min-width:0}.ce-reset[data-v-9bfb7b31]{flex:0 0 auto;padding:5px 7px;border:1px solid #3b4b65;border-radius:5px;background:#242f42;color:#c4cee2;font-size:10px;cursor:pointer}.ce-reset[data-v-9bfb7b31]:hover{border-color:#7774ff;background:#4f4dc2;color:#fff}.ce-svg[data-v-9bfb7b31]{width:100%;height:110px;display:block;border:1px solid #2a2a3c;border-radius:6px;background:#10101a;cursor:crosshair;touch-action:none}.ce-grid line[data-v-9bfb7b31]{stroke:#1e1e30;stroke-width:1}.ce-frame[data-v-9bfb7b31]{stroke:#2e2e44;stroke-width:1}.ce-line[data-v-9bfb7b31]{stroke:#6ea0e8;stroke-width:2;stroke-linejoin:round}.ce-handles line[data-v-9bfb7b31]{stroke:#8d96b5;stroke-width:1;stroke-dasharray:3 2}.ce-handles circle[data-v-9bfb7b31]{fill:#b7c2dd;stroke:#344d94;stroke-width:1.2;cursor:grab}.ce-handles circle[data-v-9bfb7b31]:active{cursor:grabbing}.ce-node[data-v-9bfb7b31]{fill:#fff;stroke:#3a55aa;stroke-width:1.6;pointer-events:none}.ce-hit[data-v-9bfb7b31]{fill:transparent;stroke:none;cursor:grab}.ce-hit[data-v-9bfb7b31]:active{cursor:grabbing}.ce-nav[data-v-9bfb7b31]{display:flex;justify-content:space-between;margin-top:3px}.ce-tip[data-v-9bfb7b31]{color:#566;font-size:10px}.pac[data-v-238f838c]{padding:10px;margin:8px 0;border:1px solid #2c3850;border-radius:7px;background:#171d2a}.pac-head[data-v-238f838c]{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:7px}.pac-label[data-v-238f838c]{color:#aeb8cf;font-size:12px;font-weight:600;white-space:nowrap}.pac-modes[data-v-238f838c]{display:flex;gap:4px;flex-wrap:wrap;justify-content:flex-end}.pac-mode[data-v-238f838c]{padding:4px 7px;border:1px solid #344158;border-radius:5px;background:#273246;color:#aeb8cf;font-size:11px;cursor:pointer}.pac-mode.on[data-v-238f838c]{border-color:#7774ff;background:#605df0;color:#fff}.pac-curve[data-v-238f838c]{margin-top:8px}.pac-axis[data-v-238f838c]{display:flex;justify-content:space-between;margin-top:3px;color:#5f6b82;font-size:10px}.pac[data-v-238f838c] .ns-label{width:58px}.pac[data-v-238f838c] .ce-svg{height:96px;background:#0f1625;border-color:#30405a}.pac[data-v-238f838c] .ce-tip{color:#657188}.gradient-editor[data-v-f6ab10bf]{margin:8px 0 11px 68px}.gradient-bar[data-v-f6ab10bf]{position:relative;height:18px;margin-bottom:14px;border:1px solid #465570;border-radius:6px;cursor:crosshair}.gradient-stop[data-v-f6ab10bf]{position:absolute;top:15px;width:14px;height:17px;padding:0;transform:translate(-50%);border:2px solid #d8deea;border-radius:2px 2px 5px 5px;background:var(--stop-color);cursor:grab;box-shadow:0 1px 3px #0009}.gradient-stop[data-v-f6ab10bf]:before{content:"";position:absolute;left:2px;top:-7px;border-left:3px solid transparent;border-right:3px solid transparent;border-bottom:5px solid #d8deea}.gradient-stop.selected[data-v-f6ab10bf]{outline:2px solid #7774ff;outline-offset:1px;z-index:2}.gradient-stop[data-v-f6ab10bf]:active{cursor:grabbing}.gradient-controls[data-v-f6ab10bf]{display:flex;align-items:center;gap:5px;margin-top:30px}.gradient-color[data-v-f6ab10bf]{width:28px;height:24px;padding:1px;border:1px solid #465570;border-radius:4px;background:#151b27;cursor:pointer}.gradient-hex-input[data-v-f6ab10bf]{width:66px;padding:4px 5px;border:1px solid #344158;border-radius:4px;outline:none;background:#101725;color:#aeb8cb;font-size:10px;font-family:monospace}.gradient-hex-input[data-v-f6ab10bf]:focus{border-color:#7774ff;color:#fff}.gradient-position[data-v-f6ab10bf]{display:flex;align-items:center;color:#71809a;font-size:10px}.gradient-position input[data-v-f6ab10bf]{width:43px;padding:3px 4px;border:1px solid #344158;border-radius:4px;outline:none;background:#101725;color:#dce3ef;text-align:right}.gradient-action[data-v-f6ab10bf]{width:25px;height:24px;padding:0;border:1px solid #3a4860;border-radius:4px;background:#273246;color:#cbd4e5;cursor:pointer}.gradient-action[data-v-f6ab10bf]:hover:not(:disabled){border-color:#7774ff;color:#fff}.gradient-action.danger[data-v-f6ab10bf]{color:#e3a5aa}.gradient-action[data-v-f6ab10bf]:disabled{opacity:.35;cursor:not-allowed}.gradient-hint[data-v-f6ab10bf]{margin-top:5px;color:#59667b;font-size:9px}.image-card[data-v-68ff5314]{margin:8px 0;padding:9px;border:1px solid #2e3c55;border-radius:7px;background:#171d2a}.imgrow[data-v-68ff5314]{display:flex;align-items:flex-start;gap:8px}.img-thumb[data-v-68ff5314]{width:48px;height:48px;padding:0;border:1px solid #3a4963;border-radius:6px;background:#1a2232;display:flex;align-items:center;justify-content:center;flex-shrink:0;cursor:pointer;overflow:hidden}.img-thumb[data-v-68ff5314]:hover{border-color:#7774ff}.img-thumb img[data-v-68ff5314]{display:block;width:100%;height:100%;object-fit:contain}.img-fields[data-v-68ff5314]{flex:1;min-width:0}.img-actions[data-v-68ff5314]{display:flex;flex-direction:column;gap:4px}.row[data-v-68ff5314]{display:flex;align-items:center;gap:8px;margin:6px 0;color:#aab;font-size:12px}.row>span[data-v-68ff5314]:first-child{width:60px;flex-shrink:0;color:#8a93bb}.inp[data-v-68ff5314]{min-width:0;flex:1;padding:3px 5px;border:1px solid #2e2e44;border-radius:5px;background:#1a1a28;color:#dde;font-size:12px}.mini-btn2[data-v-68ff5314]{width:26px;height:24px;background:#1e1e2e;border:1px solid #2e2e44;border-radius:5px;color:#aab;font-size:12px;cursor:pointer;display:flex;align-items:center;justify-content:center}.mini-btn2[data-v-68ff5314]:hover{background:#2b3a5c}.mini-btn2[data-v-68ff5314]:disabled{opacity:.35;cursor:not-allowed}.thumb-note[data-v-68ff5314]{margin:4px 0 2px;color:#667;font-size:11px}.sequence-pick[data-v-68ff5314]{width:100%;margin:2px 0 4px;padding:6px 8px;border:1px solid #4a4a76;border-radius:5px;background:#27264b;color:#d8d7ff;font-size:12px;cursor:pointer}.sequence-pick[data-v-68ff5314]:hover{border-color:#7774ff;background:#35336a}.sequence-note[data-v-68ff5314]{margin:0 0 6px;color:#727b9b;font-size:11px;line-height:1.4}.resource-weight-row[data-v-68ff5314]{display:grid;grid-template-columns:minmax(0,1fr) 28px;align-items:center;gap:7px}.resource-weight-control[data-v-68ff5314]{width:100%;min-width:0}.resource-weight-control[data-v-68ff5314] .ns-range{min-width:0}.resource-weight-control[data-v-68ff5314] .ns-num{flex:0 0 56px;box-sizing:border-box}.weight-lock[data-v-68ff5314]{width:28px;height:26px;flex:0 0 28px;padding:5px;border:1px solid #35435c;border-radius:5px;background:#202a3b;color:#78859e;cursor:pointer}.weight-lock svg[data-v-68ff5314]{display:block;width:100%;height:100%;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.weight-lock[data-v-68ff5314]:hover:not(:disabled){border-color:#7774ff;color:#b8b6ff}.weight-lock.on[data-v-68ff5314]{border-color:#7774ff;background:#514fd0;color:#fff}.weight-lock[data-v-68ff5314]:disabled{opacity:.35;cursor:not-allowed}.spine-editor[data-v-af64e8e8]{display:grid;gap:10px;color:#c5cbe0}.editor-title[data-v-af64e8e8],.section-title[data-v-af64e8e8]{color:#dce2f5;font-weight:700}.editor-title[data-v-af64e8e8]{padding-bottom:9px;border-bottom:1px solid #30394d}.grid[data-v-af64e8e8]{display:grid;gap:8px}.grid.three[data-v-af64e8e8]{grid-template-columns:repeat(3,minmax(0,1fr))}.field[data-v-af64e8e8]{display:grid;gap:5px;min-width:0;color:#919bb7;font-size:12px}.field input[data-v-af64e8e8],.field select[data-v-af64e8e8],.asset-name[data-v-af64e8e8]{box-sizing:border-box;width:100%;min-width:0;height:35px;padding:0 10px;color:#e2e6f3;background:#101625;border:1px solid #32405b;border-radius:6px}.divider[data-v-af64e8e8]{height:1px;background:#30394d;margin:2px 0}.asset-row[data-v-af64e8e8]{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px}.asset-name[data-v-af64e8e8]{display:flex;align-items:center;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;color:#7f8aa7}button[data-v-af64e8e8]{height:35px;padding:0 13px;border:1px solid #3b4a67;border-radius:6px;background:#33415b;color:#e2e6f3;cursor:pointer}button[data-v-af64e8e8]:hover{filter:brightness(1.13)}button[data-v-af64e8e8]:disabled{opacity:.55;cursor:wait}.folder-select[data-v-af64e8e8]{width:100%;border-color:#6659c7;background:#4940a8;color:#fff}.folder-hint[data-v-af64e8e8]{margin-top:-5px;color:#69758e;font-size:10px;line-height:1.45}.asset-actions[data-v-af64e8e8]{display:grid;grid-template-columns:1fr 1fr;gap:5px}.asset-actions .load[data-v-af64e8e8]{background:#5543df;border-color:#6959ec}.asset-actions .clear[data-v-af64e8e8]{background:#702b34;border-color:#803842}.runtime-note[data-v-af64e8e8]{color:#69758e;font-size:11px;text-align:center}.error[data-v-af64e8e8]{padding:8px 10px;color:#ffabb2;background:#4b2028;border:1px solid #76323e;border-radius:6px;font-size:12px}.section-box[data-v-af64e8e8]{display:grid;gap:8px;padding:10px;background:#182132;border:1px solid #303c54;border-radius:7px}.empty[data-v-af64e8e8]{color:#667187;font-size:12px;padding:5px 0}.bone-tree[data-v-af64e8e8]{max-height:240px;overflow:auto;padding:4px 0;background:#111827;border-radius:5px}.tree-title-row[data-v-af64e8e8]{display:flex;align-items:center;justify-content:space-between;gap:8px}.selected-bone[data-v-af64e8e8]{width:auto;min-width:0;max-width:100%;height:24px;flex:0 1 auto;overflow:hidden;padding:0 7px;color:#75819c;background:#182132;border:1px solid transparent;border-radius:5px;font-size:10px;text-align:right;white-space:nowrap;text-overflow:ellipsis}.selected-bone.active[data-v-af64e8e8]{color:#aeb9d4;background:#242f44;border-color:#35445e;cursor:pointer}.selected-bone.active[data-v-af64e8e8]:hover{border-color:#675ec4;background:#302b57}.selected-bone[data-v-af64e8e8]:disabled{opacity:1;cursor:default}.selected-bone strong[data-v-af64e8e8]{color:#c5cde3;font-weight:600}.tree-action[data-v-af64e8e8]{height:24px;padding:0 8px;color:#9aa7c2;background:#242f44;border-color:#35445e;font-size:10px}.bone-search[data-v-af64e8e8]{position:relative}.bone-search input[data-v-af64e8e8]{box-sizing:border-box;width:100%;height:30px;padding:0 32px 0 9px;color:#dce2f2;background:#101827;border:1px solid #33415b;border-radius:5px;font-size:11px;outline:none}.bone-search input[data-v-af64e8e8]:focus{border-color:#7065df;box-shadow:0 0 0 1px #7065df38}.bone-search button[data-v-af64e8e8]{position:absolute;top:3px;right:3px;width:24px;height:24px;padding:0;border:0;color:#8d98b0;background:transparent}.bone[data-v-af64e8e8]{display:flex;align-items:center;gap:4px;min-height:25px;color:#aeb8d2;font-size:12px;border-bottom:1px solid rgba(72,84,112,.22);cursor:pointer;outline:none}.bone[data-v-af64e8e8]:hover{background:#45567e38}.bone.selected[data-v-af64e8e8]{color:#f0edff;background:#6b53dd52;box-shadow:inset 2px 0 #8e72ff}.bone[data-v-af64e8e8]:focus-visible{box-shadow:inset 0 0 0 1px #7d72dd}.bone-toggle[data-v-af64e8e8]{width:22px;height:22px;padding:0;border:0;background:transparent;color:#9aa7c2}.bone-toggle[data-v-af64e8e8]:hover{background:#26324a}.bone-leaf[data-v-af64e8e8]{display:inline-flex;width:22px;justify-content:center;color:#58647d}.bone-name[data-v-af64e8e8]{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}@media(max-width:430px){.grid.three[data-v-af64e8e8]{grid-template-columns:1fr}}.panel[data-v-6eba135a]{display:flex;width:100%;height:100%;flex-direction:column;overflow:hidden;background:#14141f;border-left:1px solid #2a2a3c;padding:12px;box-sizing:border-box}.panel-scroll[data-v-6eba135a]{min-height:0;flex:1;overflow-y:auto;overscroll-behavior:contain;padding-right:2px;scrollbar-width:thin;scrollbar-color:#2e2e44 transparent}.panel-scroll[data-v-6eba135a]::-webkit-scrollbar{width:6px}.panel-scroll[data-v-6eba135a]::-webkit-scrollbar-track{background:transparent}.panel-scroll[data-v-6eba135a]::-webkit-scrollbar-thumb{background:#2e2e44;border-radius:3px}.panel-scroll[data-v-6eba135a]::-webkit-scrollbar-thumb:hover{background:#3a3a55}.panel-header[data-v-6eba135a]{display:flex;justify-content:space-between;align-items:center;margin-bottom:10px;flex:0 0 auto;font-weight:700;color:#ccd}.config-management-body[data-v-6eba135a]{padding-bottom:2px}.config-toolbar[data-v-6eba135a]{display:grid;grid-template-columns:auto auto minmax(0,1fr);gap:6px;margin-bottom:10px}.config-toolbar button[data-v-6eba135a],.config-toolbar select[data-v-6eba135a]{min-width:0;height:30px;box-sizing:border-box;border:1px solid #3b4864;border-radius:6px;background:#263149;color:#d6def0;font-size:11px}.config-toolbar button[data-v-6eba135a]{padding:0 9px;cursor:pointer}.config-toolbar button[data-v-6eba135a]:hover{border-color:#7169dc;background:#343d68;color:#fff}.config-toolbar select[data-v-6eba135a]{padding:0 7px;overflow:hidden;text-overflow:ellipsis}.config-toolbar select[data-v-6eba135a]:disabled{color:#68738a;background:#1b2130}.config-message[data-v-6eba135a]{margin:-4px 0 9px;color:#83b9a2;font-size:10px}.config-message.error[data-v-6eba135a]{color:#e8959e}.empty[data-v-6eba135a],.panel-hint[data-v-6eba135a]{color:#667;font-size:12px;padding:8px 0}.group[data-v-6eba135a]{border:1px solid #2a2a3c;border-radius:8px;margin-bottom:10px;overflow:hidden}.group-head[data-v-6eba135a]{display:flex;align-items:center;gap:6px;padding:7px 10px;cursor:pointer;font-size:12px;font-weight:600;color:#ccd;background:#191924;-webkit-user-select:none;user-select:none}.group-head[data-v-6eba135a]:hover{background:#20202e}.group-reset[data-v-6eba135a]{margin-left:auto;height:22px;padding:0 7px;border:1px solid #3a465f;border-radius:5px;background:#252d3d;color:#9eabc3;font-size:10px;line-height:20px;cursor:pointer}.group-reset[data-v-6eba135a]:hover{border-color:#7774ff;background:#45426f;color:#fff}.scene-head[data-v-6eba135a]{padding-right:6px}.scene-actions[data-v-6eba135a]{margin-left:auto;display:flex;align-items:center;gap:4px}.scene-add[data-v-6eba135a]{height:24px;padding:0 6px;border:1px solid #3a4a6a;border-radius:5px;background:#2e3a55;color:#cdf;font-size:10px;white-space:nowrap;cursor:pointer}.scene-add[data-v-6eba135a]:hover{border-color:#7774ff;background:#45426f;color:#fff}.scene-add[data-v-6eba135a]:disabled{opacity:.42;cursor:not-allowed;border-color:#343a4b;background:#252a38;color:#778095}.group-body[data-v-6eba135a]{padding:8px 10px 12px}.caret[data-v-6eba135a]{display:inline-block;width:12px;color:#667;font-size:11px}.divider[data-v-6eba135a]{height:1px;background:#2a2a3c;margin:8px 0}.tree[data-v-6eba135a]{margin-bottom:8px}.tree-item[data-v-6eba135a]{display:flex;align-items:center;gap:6px;padding:5px 6px;font-size:12px;color:#bcd;border-radius:6px;margin-bottom:2px}.tree-item.on[data-v-6eba135a]{background:#26324a;color:#ffe}.tree-item .tdot[data-v-6eba135a]{color:#fc3;font-size:10px}.tree-item .tdot.dim[data-v-6eba135a]{color:#556}.tree-item .tdot.collision-dot[data-v-6eba135a]{color:#ff7070}.tree-item .tdot.path-dot[data-v-6eba135a]{color:#ff933e;font-size:14px}.tree-item .tdot.spine-dot[data-v-6eba135a]{color:#c08cff;font-size:11px}.tree-item .tlabel[data-v-6eba135a]{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.scene-tree[data-v-6eba135a]{padding-bottom:8px;border-bottom:1px solid #2a2a3c}.scene-object-item[data-v-6eba135a]{min-height:28px;cursor:pointer}.scene-object-item[data-v-6eba135a]:hover{background:#202b40}.scene-object-kind[data-v-6eba135a]{color:#75829c;font-size:10px}.scene-object-eye[data-v-6eba135a]{width:24px;height:22px;padding:3px;flex:0 0 24px;border:1px solid transparent;border-radius:5px;background:transparent;color:#9aa6bf;cursor:pointer}.scene-object-eye[data-v-6eba135a]:hover{border-color:#4b5972;background:#29354a;color:#e1e7f4}.scene-object-eye.off[data-v-6eba135a]{color:#59647a}.scene-object-eye svg[data-v-6eba135a]{display:block;width:100%;height:100%;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.scene-object-eye .eye-slash[data-v-6eba135a]{stroke:#d47b88;stroke-width:2}.scene-object-delete[data-v-6eba135a]{width:24px;height:22px;padding:0;border:1px solid #59414a;border-radius:5px;background:#3a272f;color:#efb4bd;font-size:11px;cursor:pointer}.scene-object-delete[data-v-6eba135a]:hover{border-color:#a45c69;background:#57303a;color:#fff}.object-editor-title[data-v-6eba135a]{margin:10px 0 8px;padding-top:8px;border-top:1px solid #2a2a3c;color:#cbd4e8;font-weight:700}.field-block[data-v-6eba135a]{display:flex;flex-direction:column;gap:5px;margin:10px 0;color:#8f9ab3;font-size:11px}.field-block>.inp[data-v-6eba135a]{width:100%;box-sizing:border-box;min-height:30px}.field-block small[data-v-6eba135a]{color:#5f6d86;line-height:1.5}.field-grid[data-v-6eba135a]{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px;align-items:end}.compact-field[data-v-6eba135a]{display:flex;min-width:0;flex-direction:column;gap:5px;margin:5px 0;color:#8f9ab3;font-size:11px}.compact-field .inp[data-v-6eba135a]{width:100%;min-height:30px;box-sizing:border-box}.check-field[data-v-6eba135a]{align-items:flex-start}.check-field input[data-v-6eba135a]{width:18px;height:18px;margin:4px 0;accent-color:#4f7ee8}.tag-editor[data-v-6eba135a]{display:flex;flex-wrap:wrap;gap:5px}.object-tag[data-v-6eba135a],.tag-add[data-v-6eba135a]{height:26px;padding:0 8px;border:1px solid #3b4861;border-radius:5px;background:#242d40;color:#aeb8cf;cursor:pointer}.object-tag.on[data-v-6eba135a]{border-color:#7774ff;background:#514fd0;color:#fff}.tag-add[data-v-6eba135a]{width:28px;padding:0;border-style:dashed;font-size:17px}.follow-path[data-v-6eba135a],.setting-line[data-v-6eba135a]{display:flex;align-items:center;gap:8px;margin:12px 0 4px;color:#aeb8cf;font-size:12px}.setting-line[data-v-6eba135a]{justify-content:space-between}.follow-path input[data-v-6eba135a],.setting-line input[type=checkbox][data-v-6eba135a]{width:17px;height:17px;accent-color:#4f7ee8}.collider-follow-section[data-v-6eba135a]{margin-top:12px;padding-top:4px;border-top:1px solid #30394d}.collider-curve-title[data-v-6eba135a]{display:flex;flex-direction:column;gap:3px;margin:12px 0 6px;color:#aeb8cf;font-size:12px}.collider-curve-title small[data-v-6eba135a]{color:#67738c;font-size:10px;line-height:1.45}.path-color[data-v-6eba135a]{width:48px;height:28px;padding:0;border:1px solid #3a4963;background:transparent;cursor:pointer}.path-help[data-v-6eba135a]{margin:12px 0;color:#7d89a2;font-size:11px;line-height:1.55}.path-help>span[data-v-6eba135a]{color:#aeb8cf}.path-help ul[data-v-6eba135a]{margin:6px 0 0;padding-left:20px}.path-help li[data-v-6eba135a]{margin:3px 0}.path-action[data-v-6eba135a]{width:100%;height:31px;margin-top:7px;border:0;border-radius:5px;background:#33425b;color:#c9d1e1;cursor:pointer}.path-action[data-v-6eba135a]:hover{filter:brightness(1.12)}.path-action.primary[data-v-6eba135a]{background:#f05408;color:#fff}.tag[data-v-6eba135a]{font-size:10px;color:#667;background:#1c1c2a;border-radius:4px;padding:1px 5px}.row[data-v-6eba135a]{display:flex;align-items:center;gap:8px;margin:6px 0;font-size:12px;color:#aab}.row>span[data-v-6eba135a]:first-child{width:60px;flex-shrink:0;color:#8a93bb}.inp[data-v-6eba135a]{flex:1;min-width:0;padding:3px 5px;background:#1a1a28;border:1px solid #2e2e44;border-radius:5px;color:#dde;font-size:12px}.pair[data-v-6eba135a]{display:flex;flex-direction:column;gap:2px;flex:1}.colr[data-v-6eba135a]{width:28px;height:22px;border:none;background:none;cursor:pointer}.segs[data-v-6eba135a]{display:flex;gap:6px;margin:6px 0}.stream-behavior-segs[data-v-6eba135a]{margin-top:10px}.stream-loop-options[data-v-6eba135a]{display:grid;gap:8px;margin:8px 0 4px;padding:9px 10px;border:1px solid #32405a;border-radius:6px;background:#171f2e}.seg[data-v-6eba135a]{flex:1;padding:5px;background:#1e1e2e;border:1px solid #2e2e44;border-radius:6px;color:#aab;font-size:12px;cursor:pointer}.seg.on[data-v-6eba135a]{background:#3a5a8c;color:#fff;border-color:#5a7ab8}.mini-btn[data-v-6eba135a]{background:#2e3a55;border:1px solid #3a4a6a;color:#cdf;border-radius:5px;padding:3px 8px;font-size:11px;cursor:pointer}.mini-btn.danger[data-v-6eba135a]{background:#4a2a2e;color:#fbb}.placeholder[data-v-6eba135a]{color:#667;font-size:11px;padding:6px 0}.export-settings[data-v-6eba135a]{padding-top:3px}.export-field[data-v-6eba135a]{display:flex;flex-direction:column;gap:6px;margin:10px 0 13px;color:#9ca8bf;font-size:11px;font-weight:600}.export-input[data-v-6eba135a]{width:100%;min-height:34px;box-sizing:border-box;padding:6px 9px;color:#e3e7f2;background:#141a29;border-color:#35445f}.export-fps-row[data-v-6eba135a]{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:12px;align-items:end}.export-fps-field[data-v-6eba135a]{margin-bottom:5px}.export-checkbox[data-v-6eba135a]{display:flex;align-items:center;gap:7px;min-height:34px;margin-bottom:5px;color:#aeb8cc;font-size:11px;white-space:nowrap}.export-checkbox input[data-v-6eba135a]{width:17px;height:17px;margin:0;accent-color:#625ff1}.export-help[data-v-6eba135a]{margin:-6px 0 14px;color:#66758e;font-size:10px;line-height:1.5}.export-switches[data-v-6eba135a]{display:grid;gap:13px;margin:4px 0 7px;padding-top:2px}.export-switch[data-v-6eba135a]{font-weight:600}.export-switch-last[data-v-6eba135a]{margin-top:13px}.export-spine-json[data-v-6eba135a]{width:100%;margin-top:10px;padding:9px 12px;flex:0 0 auto;border:1px solid #4f4b9a;border-radius:7px;background:#403b91;color:#f1f0ff;font-size:12px;font-weight:700;cursor:pointer}.export-spine-json[data-v-6eba135a]:hover{border-color:#7774ff;background:#514bc0}.export-spine-json[data-v-6eba135a]:disabled{cursor:wait;opacity:.68}.export-message[data-v-6eba135a]{padding:7px 5px 0;color:#70d8ae;font-size:10px;line-height:1.45;text-align:center}.export-message.error[data-v-6eba135a]{color:#ff858f}.look-title[data-v-6eba135a]{font-size:12px;font-weight:600;color:#ccd;margin:10px 0 6px;padding-bottom:4px;border-bottom:1px solid #2a2a3c}.look-title[data-v-6eba135a]:first-child{margin-top:2px}.seg[data-v-6eba135a]{display:flex;gap:6px;margin:6px 0}.seg-btn[data-v-6eba135a]{flex:1;padding:5px;background:#1e1e2e;border:1px solid #2e2e44;border-radius:6px;color:#aab;font-size:12px;cursor:pointer}.seg-btn.active[data-v-6eba135a]{background:#3a5a8c;color:#fff;border-color:#5a7ab8}.curve-hint[data-v-6eba135a]{min-height:54px;border:1px dashed #2e2e44;border-radius:6px;display:flex;align-items:center;justify-content:center;color:#556;font-size:11px;margin:6px 0}.curve-wrap[data-v-6eba135a]{margin:6px 0}.curve-labels[data-v-6eba135a]{display:flex;justify-content:space-between;color:#566;font-size:10px;margin-top:2px}.image-title[data-v-6eba135a]{display:flex;align-items:center;justify-content:space-between}.image-add[data-v-6eba135a]{width:26px;height:24px;border:1px solid #4a4d9a;border-radius:5px;background:#252850;color:#8f8cff;font-size:18px;line-height:1;cursor:pointer}.image-add[data-v-6eba135a]:hover{background:#4542a8;color:#fff}.image-card[data-v-6eba135a]{margin:8px 0;padding:9px;border:1px solid #2e3c55;border-radius:7px;background:#171d2a}.imgrow[data-v-6eba135a]{display:flex;align-items:flex-start;gap:8px}.img-thumb[data-v-6eba135a]{width:48px;height:48px;padding:0;border:1px solid #3a4963;border-radius:6px;background:#1a2232;display:flex;align-items:center;justify-content:center;flex-shrink:0;cursor:pointer;overflow:hidden}.img-thumb[data-v-6eba135a]:hover{border-color:#7774ff}.img-thumb img[data-v-6eba135a]{display:block;width:100%;height:100%;object-fit:contain}.img-fields[data-v-6eba135a]{flex:1;min-width:0}.img-actions[data-v-6eba135a]{display:flex;flex-direction:column;gap:4px}.mini-btn2[data-v-6eba135a]{width:26px;height:24px;background:#1e1e2e;border:1px solid #2e2e44;border-radius:5px;color:#aab;font-size:12px;cursor:pointer;display:flex;align-items:center;justify-content:center}.mini-btn2[data-v-6eba135a]:hover{background:#2b3a5c}.mini-btn2[data-v-6eba135a]:disabled{opacity:.35;cursor:not-allowed}.thumb-note[data-v-6eba135a]{color:#667;font-size:11px;margin:4px 0 2px}.resource-divider[data-v-6eba135a]{height:1px;margin:9px 0 7px;background:#2a3549}.resource-color-row .blend-select[data-v-6eba135a]{max-width:88px}.resource-color-picker .hex[data-v-6eba135a]{margin-left:0}.hex-input[data-v-6eba135a]{width:72px;padding:4px 6px;border:1px solid #344158;border-radius:5px;outline:none;background:#101725;color:#aeb8cb;font-size:11px;font-family:monospace}.hex-input[data-v-6eba135a]:focus{border-color:#7774ff;color:#fff}.resource-alpha-head[data-v-6eba135a]{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:10px;color:#8a93bb;font-size:12px}.alpha-modes[data-v-6eba135a]{display:flex;gap:3px}.alpha-modes button[data-v-6eba135a]{padding:4px 8px;border:1px solid transparent;border-radius:5px;background:transparent;color:#8d98ae;font-size:11px;cursor:pointer}.alpha-modes button[data-v-6eba135a]:hover{background:#273246}.alpha-modes button.on[data-v-6eba135a]{border-color:#7774ff;background:#605df0;color:#fff}.resource-alpha-curve[data-v-6eba135a]{margin-top:7px}.resource-weight-row[data-v-6eba135a]{display:flex;align-items:center;gap:5px}.resource-weight-control[data-v-6eba135a]{flex:1;min-width:0}.weight-lock[data-v-6eba135a]{width:28px;height:26px;flex:0 0 28px;padding:5px;border:1px solid #35435c;border-radius:5px;background:#202a3b;color:#78859e;cursor:pointer}.weight-lock svg[data-v-6eba135a]{display:block;width:100%;height:100%;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.weight-lock[data-v-6eba135a]:hover:not(:disabled){border-color:#7774ff;color:#b8b6ff}.weight-lock.on[data-v-6eba135a]{border-color:#7774ff;background:#514fd0;color:#fff}.weight-lock[data-v-6eba135a]:disabled{opacity:.35;cursor:not-allowed}.file-input[data-v-6eba135a]{display:none}.hex[data-v-6eba135a]{font-size:11px;color:#889;margin-left:auto;font-variant-numeric:tabular-nums}.inp.tiny[data-v-6eba135a]{width:46px;flex:0 0 46px;text-align:center}.attr-body[data-v-6eba135a]{padding:10px;background:#151b27}.attr-section-title[data-v-6eba135a]{margin:2px 0 8px;color:#9ca8c0;font-size:12px;font-weight:700}.attr-section-title.life-title[data-v-6eba135a]{margin-top:14px;padding-top:12px;border-top:1px solid #2d3950}.attr-axis-head[data-v-6eba135a]{display:flex;align-items:center;justify-content:space-between;margin:10px 1px -2px;color:#aeb8cf;font-size:12px;font-weight:600}.axis-modes[data-v-6eba135a]{display:flex;gap:4px}.axis-mode[data-v-6eba135a]{padding:4px 8px;border:1px solid #344158;border-radius:5px;background:#273246;color:#aeb8cf;font-size:11px;cursor:pointer}.axis-mode.on[data-v-6eba135a]{border-color:#7774ff;background:#605df0;color:#fff}.life-item[data-v-6eba135a]{padding:9px 0;border-bottom:1px solid #2a3549}.switch-row[data-v-6eba135a]{display:flex;align-items:center;gap:9px;color:#b8c1d5;font-size:12px;cursor:pointer}.switch-row input[data-v-6eba135a]{position:absolute;opacity:0;pointer-events:none}.switch-ui[data-v-6eba135a]{position:relative;width:32px;height:18px;border-radius:10px;background:#354258;transition:background .16s ease}.switch-ui[data-v-6eba135a]:after{content:"";position:absolute;left:2px;top:2px;width:14px;height:14px;border-radius:50%;background:#fff;transition:transform .16s ease}.switch-row input:checked+.switch-ui[data-v-6eba135a]{background:#625ff1}.switch-row input:checked+.switch-ui[data-v-6eba135a]:after{transform:translate(14px)}.life-axis[data-v-6eba135a]{margin:9px 0 2px 42px}.seed-row[data-v-6eba135a]{display:flex;align-items:center;gap:8px;margin-top:12px;padding-top:12px;border-top:1px solid #2d3950}.seed-row label[data-v-6eba135a]{width:64px;color:#8f9bb5;font-size:12px}.seed-input[data-v-6eba135a]{min-width:0;flex:1;padding:6px 8px;border:1px solid #344158;border-radius:6px;outline:none;background:#0f1625;color:#e2e7f2;font-size:12px}.seed-input[data-v-6eba135a]:focus{border-color:#625ff1}.seed-random[data-v-6eba135a]{width:34px;height:30px;border:1px solid #3a4860;border-radius:6px;background:#2c3950;color:#d7def0;cursor:pointer}.seed-random[data-v-6eba135a]:hover{background:#394964}.scene-seed[data-v-6eba135a]{margin-top:10px}.seed-hint[data-v-6eba135a]{margin:5px 0 1px 72px;color:#657188;font-size:9px;line-height:1.45}.modifier-item[data-v-6eba135a]{padding:8px 0 10px;border-bottom:1px solid #2a3549}.modifier-switch[data-v-6eba135a]{font-weight:600}.modifier-params[data-v-6eba135a]{margin:8px 0 0 10px;padding:2px 0 2px 10px;border-left:2px solid #344158}.modifier-hint[data-v-6eba135a]{margin:7px 0 0 2px;color:#647086;font-size:9px;line-height:1.5}.stream-loop-hint[data-v-6eba135a]{margin:9px 2px 3px;padding:7px 8px;border:1px solid #4a436e;border-radius:5px;background:#211f35;color:#aaa4d7}.switch-row input:disabled+.switch-ui[data-v-6eba135a]{opacity:.45;cursor:not-allowed}.bone-follow-target[data-v-6eba135a]{margin:7px 0 9px;padding:7px 8px;overflow:hidden;color:#7f8ba3;background:#121a29;border:1px solid #2f3c53;border-radius:5px;font-size:10px;text-overflow:ellipsis;white-space:nowrap}.bone-follow-target strong[data-v-6eba135a]{color:#c8d0e4;font-weight:600}.bone-follow-missing[data-v-6eba135a]{margin:7px 0 9px;padding:7px 8px;color:#d49aa3;background:#2a1e26;border:1px solid #513540;border-radius:5px;font-size:10px;line-height:1.5}.bone-follow-rebind[data-v-6eba135a]{width:100%;min-height:28px;margin:0 0 8px;padding:4px 8px;overflow:hidden;border:1px solid #4a436e;border-radius:5px;background:#2d2947;color:#c8c2ee;font-size:10px;text-overflow:ellipsis;white-space:nowrap;cursor:pointer}.bone-follow-rebind[data-v-6eba135a]:hover{border-color:#7165bd;background:#3a335d;color:#fff}.bone-follow-transform-grid[data-v-6eba135a]{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}.modifier-mode-row[data-v-6eba135a]{display:flex;justify-content:flex-end;gap:4px;margin-bottom:6px}.gravity-curve-title[data-v-6eba135a]{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:10px 0 6px;color:#9ba7bd;font-size:11px}.gravity-curve-title span[data-v-6eba135a]:last-child{color:#657188;font-size:9px}.gravity-curve-axis[data-v-6eba135a]{display:flex;justify-content:space-between;margin:3px 34px 0 1px;color:#5f6b82;font-size:9px}.gravity-params[data-v-6eba135a] .ce-svg{height:96px;background:#0f1625;border-color:#30405a}.trail-params[data-v-6eba135a]{padding-right:2px}.trail-section-title[data-v-6eba135a]{margin:3px 0 8px;color:#aeb8cf;font-size:12px;font-weight:700}.trail-resource-row[data-v-6eba135a]{display:flex;align-items:stretch;gap:8px;margin-bottom:10px;padding:8px;border:1px solid #2e3c55;border-radius:7px;background:#171d2a}.trail-thumb[data-v-6eba135a]{width:58px;min-height:58px;padding:3px;flex:0 0 58px;border:1px solid #3a4963;border-radius:6px;background:#101725;cursor:pointer;overflow:hidden}.trail-thumb[data-v-6eba135a]:hover{border-color:#7774ff}.trail-thumb img[data-v-6eba135a]{display:block;width:100%;height:100%;object-fit:contain}.trail-resource-fields[data-v-6eba135a]{display:flex;min-width:0;flex:1;flex-direction:column;gap:7px}.trail-color-row[data-v-6eba135a]{display:flex;align-items:center;gap:5px;color:#8a93bb;font-size:11px}.trail-color-row>span[data-v-6eba135a]{min-width:0;flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.trail-color-row .hex-input[data-v-6eba135a],.trail-fixed-color .hex-input[data-v-6eba135a]{min-width:0;flex:1}.trail-mode-head[data-v-6eba135a]{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:10px 0 6px;color:#9ba7bd;font-size:11px}.trail-sub-switch[data-v-6eba135a]{margin:11px 0 7px;padding-top:9px;border-top:1px solid #2a3549}.trail-grid-row[data-v-6eba135a]{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:8px}.trail-grid-row[data-v-6eba135a] .ns{min-width:0;flex-wrap:wrap;align-items:center}.trail-grid-row[data-v-6eba135a] .ns-label{width:100%}.trail-grid-row[data-v-6eba135a] .ns-range{min-width:0}.trail-grid-row[data-v-6eba135a] .ns-num{width:42px}.trail-params[data-v-6eba135a] .ce-svg{height:92px;background:#0f1625;border-color:#30405a}.timeline[data-v-0ef42eef]{height:100%;background:#12121c;border-top:1px solid #2a2a3c;display:flex;flex-direction:column;padding:6px 10px;gap:4px}.tl-controls[data-v-0ef42eef]{display:flex;align-items:center;gap:8px}.tl-btn[data-v-0ef42eef]{width:30px;height:26px;background:#1e1e2e;border:1px solid #2e2e44;border-radius:6px;color:#aab;font-size:12px;cursor:pointer}.tl-btn.on[data-v-0ef42eef]{background:#3a5a8c;color:#fff;border-color:#5a7ab8}.tl-frame[data-v-0ef42eef]{display:inline-block;flex:0 0 92px;width:92px;box-sizing:border-box;font-size:12px;color:#aab;text-align:right;font-variant-numeric:tabular-nums;font-feature-settings:"tnum" 1;white-space:nowrap}.tl-frame b[data-v-0ef42eef]{display:inline;color:inherit;font-weight:400}.tl-legend[data-v-0ef42eef]{display:flex;align-items:center;gap:4px;color:#778198;font-size:10px}.tl-legend i[data-v-0ef42eef]{display:inline-block;width:10px;height:7px;border-radius:2px}.legend-emission[data-v-0ef42eef]{margin-left:4px;background:#2f8b62}.legend-life[data-v-0ef42eef]{margin-left:5px;background:#a54551}.legend-spine[data-v-0ef42eef]{margin-left:5px;background:#7448b8}.tl-anim[data-v-0ef42eef]{display:flex;align-items:center;gap:6px;font-size:12px;color:#aab}.tl-owner-animation[data-v-0ef42eef]{position:relative}.tl-animation-trigger[data-v-0ef42eef]{display:flex;align-items:center;justify-content:space-between;gap:8px;width:116px;height:25px;padding:0 7px;overflow:hidden;border:1px solid #2e2e44;border-radius:5px;background:#1a1a28;color:#dde;cursor:pointer}.tl-animation-trigger>span[data-v-0ef42eef]{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tl-animation-trigger>i[data-v-0ef42eef]{flex:0 0 auto;color:#8c96ad;font-style:normal}.tl-animation-trigger[data-v-0ef42eef]:disabled{opacity:.5;cursor:not-allowed}.tl-animation-menu[data-v-0ef42eef]{position:absolute;z-index:30;right:0;bottom:calc(100% + 6px);width:226px;padding:7px;border:1px solid #3c4760;border-radius:8px;background:#171b29;box-shadow:0 10px 24px #00000073}.tl-animation-menu-title[data-v-0ef42eef]{padding:2px 4px 6px;color:#77839c;font-size:10px}.tl-animation-option[data-v-0ef42eef]{display:flex;align-items:center;justify-content:space-between;width:100%;height:27px;padding:0 7px;border:0;border-radius:5px;background:transparent;color:#b8c1d5;text-align:left;cursor:pointer}.tl-animation-option>span[data-v-0ef42eef]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tl-animation-option[data-v-0ef42eef]:hover{background:#252e42}.tl-animation-option.on[data-v-0ef42eef]{background:#34335d;color:#fff}.tl-animation-option>i[data-v-0ef42eef]{color:#8d8aff;font-style:normal}.tl-animation-editor[data-v-0ef42eef]{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:5px;margin-top:7px;padding-top:7px;border-top:1px solid #2b3346}.tl-animation-name[data-v-0ef42eef]{min-width:0;height:27px;padding:0 7px;box-sizing:border-box;border:1px solid #343e55;border-radius:5px;background:#101522;color:#e1e6f2;outline:none}.tl-animation-name[data-v-0ef42eef]:focus{border-color:#6865d8}.tl-animation-editor button[data-v-0ef42eef],.tl-animation-actions button[data-v-0ef42eef]{height:27px;padding:0 8px;border:1px solid #3c4861;border-radius:5px;background:#29344a;color:#cbd3e3;cursor:pointer}.tl-animation-actions[data-v-0ef42eef]{display:grid;grid-template-columns:1fr 1fr;gap:5px;margin-top:6px}.tl-animation-actions button[data-v-0ef42eef]:last-child{border-color:#5b3942;background:#3b282f;color:#e2a8b2}.tl-animation-actions button[data-v-0ef42eef]:disabled{opacity:.4;cursor:not-allowed}.tl-animation-error[data-v-0ef42eef]{margin-top:5px;color:#ef8997;font-size:10px}.tl-animation-hint[data-v-0ef42eef]{margin-top:5px;color:#69758d;font-size:9px;text-align:center}.tl-sel[data-v-0ef42eef]{background:#1a1a28;border:1px solid #2e2e44;color:#dde;border-radius:5px;padding:2px 6px;font-size:12px}.tl-sel[data-v-0ef42eef]:disabled{opacity:.5;cursor:not-allowed}.tl-spine-preview .tl-sel[data-v-0ef42eef]{max-width:190px}.tl-zoom[data-v-0ef42eef]{margin-left:auto;font-size:11px;color:#667}.tl-viewport[data-v-0ef42eef]{position:relative;flex:1;overflow:hidden;background:#0d0d14;border:1px solid #2a2a3c;border-radius:6px;cursor:ew-resize}.tl-ticks[data-v-0ef42eef]{position:absolute;top:0;left:0;right:0;height:18px}.tl-tickline[data-v-0ef42eef]{position:absolute;top:0;bottom:0;width:1px;background:#263040}.tl-ticklabel[data-v-0ef42eef]{position:absolute;top:2px;transform:translate(-50%);font-size:9px;color:#667}.tl-playhead[data-v-0ef42eef]{position:absolute;top:0;bottom:0;width:2px;background:#fc3;z-index:5;pointer-events:none}.tl-lanes[data-v-0ef42eef]{position:absolute;top:22px;left:0;right:0;bottom:0}.tl-lane[data-v-0ef42eef]{position:relative;height:26px;margin-bottom:4px}.lane-ico[data-v-0ef42eef]{position:absolute;left:4px;top:6px;font-size:11px;color:#dde;z-index:2;pointer-events:none}.lane-bar[data-v-0ef42eef]{position:absolute;top:4px;height:18px;display:flex;align-items:stretch;cursor:grab;box-sizing:border-box}.lane-bar[data-v-0ef42eef]:active{cursor:grabbing}.lane-name[data-v-0ef42eef]{position:absolute;left:14px;right:5px;top:2px;z-index:2;pointer-events:none;font-size:11px;color:#fff;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.bar-life[data-v-0ef42eef]{position:absolute;inset:0 auto 0 0;z-index:0;min-width:1px;border:1px solid #c05a66;border-radius:5px;background:#a54551;box-sizing:border-box}.bar-emission[data-v-0ef42eef]{position:absolute;inset:0 auto 0 0;z-index:1;min-width:1px;border:1px solid #45a97d;border-radius:5px 0 0 5px;background:#2f8b62;box-sizing:border-box}.bar-handle[data-v-0ef42eef]{position:absolute;z-index:4;right:-4px;top:-1px;bottom:-1px;width:8px;cursor:ew-resize;background:#ffffff2e}.bar-handle[data-v-0ef42eef]:hover{background:#ffffff59}.spine-ico[data-v-0ef42eef]{color:#c08cff}.spine-bar[data-v-0ef42eef]{position:absolute;top:4px;height:18px;min-width:1px;box-sizing:border-box;border:1px solid #a575ed;border-radius:5px;background:#7448b8;cursor:grab;box-shadow:inset 0 0 0 1px #ffffff0d}.spine-bar[data-v-0ef42eef]:active{cursor:grabbing}.tl-empty[data-v-0ef42eef]{color:#667;font-size:11px;padding:8px}.layout[data-v-8eacccdc]{display:flex;width:100%;height:100%;min-height:0;overflow:clip}.parameter-panel[data-v-8eacccdc]{flex-shrink:0;height:100%;min-height:0;overflow:clip}.resizer-col[data-v-8eacccdc]{width:5px;cursor:col-resize;background:#1c1c2a;border-left:1px solid #2a2a3c;border-right:1px solid #2a2a3c;flex-shrink:0}.resizer-col[data-v-8eacccdc]:hover{background:#3a5a8c}.right[data-v-8eacccdc]{flex:1;min-width:0;height:100%;min-height:0;overflow:clip;display:flex;flex-direction:column}.panel-right .right[data-v-8eacccdc]{order:1}.panel-right .resizer-col[data-v-8eacccdc]{order:2}.panel-right .parameter-panel[data-v-8eacccdc]{order:3}.stage-area[data-v-8eacccdc]{flex:1;min-height:0;overflow:clip}.resizer-row[data-v-8eacccdc]{height:4px;cursor:row-resize;background:#1c1c2a;border-top:1px solid #2a2a3c;border-bottom:1px solid #2a2a3c;flex-shrink:0}.resizer-row[data-v-8eacccdc]:hover{background:#3a5a8c}.timeline-area[data-v-8eacccdc]{position:relative;z-index:10;flex-shrink:0;overflow:visible}html,body{width:100%;height:100%;margin:0;padding:0;overflow:clip;overscroll-behavior:none;background:#0b0b12;color:#e8e8f0;font-family:system-ui,-apple-system,Segoe UI,sans-serif}body{position:fixed;top:0;right:0;bottom:0;left:0}*{box-sizing:border-box}#app{position:fixed;top:0;right:0;bottom:0;left:0;width:auto;height:auto;overflow:clip}input[type=number]{-webkit-appearance:textfield;appearance:textfield;-moz-appearance:textfield}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{margin:0;-webkit-appearance:none;-moz-appearance:none;appearance:none} diff --git a/dist/assets/index-DujVfZi9.js b/dist/assets/index-CnGkEkb-.js similarity index 92% rename from dist/assets/index-DujVfZi9.js rename to dist/assets/index-CnGkEkb-.js index 8b6f5ec..6090584 100644 --- a/dist/assets/index-DujVfZi9.js +++ b/dist/assets/index-CnGkEkb-.js @@ -1165,7 +1165,7 @@ void main(void)\r font-weight: ${t.weight}; font-style: ${t.style}; font-display: ${t.display}; - }`,this._stylesheet)}get stylesheet(){return this._stylesheet}set stylesheet(e){this._stylesheet!==e&&(this._stylesheet=e,this.styleID++)}normalizeColor(e){return Array.isArray(e)&&(e=o_(e)),typeof e=="number"?r_(e):e}dropShadowToCSS(){let e=this.normalizeColor(this.dropShadowColor);const t=this.dropShadowAlpha,s=Math.round(Math.cos(this.dropShadowAngle)*this.dropShadowDistance),n=Math.round(Math.sin(this.dropShadowAngle)*this.dropShadowDistance);e.startsWith("#")&&t<1&&(e+=(t*255|0).toString(16).padStart(2,"0"));const r=`${s}px ${n}px`;return this.dropShadowBlur>0?`text-shadow: ${r} ${this.dropShadowBlur}px ${e}`:`text-shadow: ${r} ${e}`}reset(){Object.assign(this,qr.defaultOptions)}onBeforeDraw(){const{fontsDirty:e}=this;return this.fontsDirty=!1,this.isSafari&&this._fonts.length>0&&e?new Promise(t=>setTimeout(t,100)):Promise.resolve()}get isSafari(){const{userAgent:e}=Ve.ADAPTER.getNavigator();return/^((?!chrome|android).)*safari/i.test(e)}set fillGradientStops(e){console.warn("[HTMLTextStyle] fillGradientStops is not supported by HTMLText")}get fillGradientStops(){return super.fillGradientStops}set fillGradientType(e){console.warn("[HTMLTextStyle] fillGradientType is not supported by HTMLText")}get fillGradientType(){return super.fillGradientType}set miterLimit(e){console.warn("[HTMLTextStyle] miterLimit is not supported by HTMLText")}get miterLimit(){return super.miterLimit}set trim(e){console.warn("[HTMLTextStyle] trim is not supported by HTMLText")}get trim(){return super.trim}set textBaseline(e){console.warn("[HTMLTextStyle] textBaseline is not supported by HTMLText")}get textBaseline(){return super.textBaseline}set leading(e){console.warn("[HTMLTextStyle] leading is not supported by HTMLText")}get leading(){return super.leading}set lineJoin(e){console.warn("[HTMLTextStyle] lineJoin is not supported by HTMLText")}get lineJoin(){return super.lineJoin}};_d.availableFonts={},_d.defaultOptions={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",letterSpacing:0,lineHeight:0,padding:0,stroke:"black",strokeThickness:0,whiteSpace:"normal",wordWrap:!1,wordWrapWidth:100};let xu=_d;const Ja=class Kr extends Qn{constructor(e="",t={}){super(et.EMPTY),this._text=null,this._style=null,this._autoResolution=!0,this.localStyleID=-1,this.dirty=!1,this._updateID=0,this.ownsStyle=!1;const s=new Image,n=et.from(s,{scaleMode:Ve.SCALE_MODE,resourceOptions:{autoLoad:!1}});n.orig=new lt,n.trim=new lt,this.texture=n;const r="http://www.w3.org/2000/svg",o="http://www.w3.org/1999/xhtml",a=document.createElementNS(r,"svg"),h=document.createElementNS(r,"foreignObject"),l=document.createElementNS(o,"div"),c=document.createElementNS(o,"style");h.setAttribute("width","10000"),h.setAttribute("height","10000"),h.style.overflow="hidden",a.appendChild(h),this.maxWidth=Kr.defaultMaxWidth,this.maxHeight=Kr.defaultMaxHeight,this._domElement=l,this._styleElement=c,this._svgRoot=a,this._foreignObject=h,this._foreignObject.appendChild(c),this._foreignObject.appendChild(l),this._image=s,this._loadImage=new Image,this._autoResolution=Kr.defaultAutoResolution,this._resolution=Kr.defaultResolution??Ve.RESOLUTION,this.text=e,this.style=t}measureText(e){var c,u;const{text:t,style:s,resolution:n}=Object.assign({text:this._text,style:this._style,resolution:this._resolution},e);Object.assign(this._domElement,{innerHTML:t,style:s.toCSS(n)}),this._styleElement.textContent=s.toGlobalCSS(),document.body.appendChild(this._svgRoot);const r=this._domElement.getBoundingClientRect();this._svgRoot.remove();const{width:o,height:a}=r;(o>this.maxWidth||a>this.maxHeight)&&console.warn("[HTMLText] Large expanse of text, increase HTMLText.maxWidth or HTMLText.maxHeight property.");const h=Math.min(this.maxWidth,Math.ceil(o)),l=Math.min(this.maxHeight,Math.ceil(a));return this._svgRoot.setAttribute("width",h.toString()),this._svgRoot.setAttribute("height",l.toString()),t!==this._text&&(this._domElement.innerHTML=this._text),s!==this._style&&(Object.assign(this._domElement,{style:(c=this._style)==null?void 0:c.toCSS(n)}),this._styleElement.textContent=(u=this._style)==null?void 0:u.toGlobalCSS()),{width:h+s.padding*2,height:l+s.padding*2}}async updateText(e=!0){const{style:t,_image:s,_loadImage:n}=this;if(this.localStyleID!==t.styleID&&(this.dirty=!0,this.localStyleID=t.styleID),!this.dirty&&e)return;const{width:r,height:o}=this.measureText();s.width=n.width=Math.ceil(Math.max(1,r)),s.height=n.height=Math.ceil(Math.max(1,o)),this._updateID++;const a=this._updateID;await new Promise(h=>{n.onload=async()=>{if(a/gi,"
").replace(/
/gi,"
").replace(/ /gi," ")}};Ja.defaultDestroyOptions={texture:!0,children:!1,baseTexture:!0},Ja.defaultMaxWidth=2024,Ja.defaultMaxHeight=2024,Ja.defaultAutoResolution=!0;function ga(){return{texture:null,imageResources:[{id:1,texture:null,textureName:"star",textureFolder:"",previewUrl:"/images/star.png",imageMode:"fixed",sequencePlayback:"loop-forward",sequenceFps:30,sequenceFrames:[],weight:100,locked:!1,scale:1,anchorX:.5,anchorY:.5,colorMode:"fixed",colorStart:"#ffffff",colorEnd:"#ff4d4d",colorGradient:[{position:0,color:"#ffffff"},{position:1,color:"#ff4d4d"}],blend:"normal",independentAlpha:"off",alpha:1,alphaCurveMode:"跟随导出",alphaCurve:[{x:0,y:0},{x:.1,y:1},{x:.9,y:1},{x:1,y:0}]}],imageWeightVersion:1,name:"ParticleSystem1",mode:"stream",rate:20,streamBehavior:"normal",loopDurationFrames:30,generateLoopStartAnimation:!1,generateLoopEndAnimation:!1,burstCount:50,burstLoop:!1,delay:0,duration:1,shape:"point",radius:30,rectW:60,rectH:40,centerX:0,centerY:0,rootRotation:0,rootScaleX:1,rootScaleY:1,direction:0,spread:360,coneAngle:60,lifeMin:.6,lifeMax:1.8,lifeMode:"random",lifeCurve:[{x:0,y:0},{x:1,y:1}],speedMin:30,speedMax:140,speedMode:"random",speedCurve:[{x:0,y:0},{x:1,y:1}],scaleMin:.3,scaleMax:.8,scaleMode:"random",scaleAxisMode:"uniform",scaleYMin:.3,scaleYMax:.8,scaleCurve:[{x:0,y:0},{x:1,y:1}],scaleYCurve:[{x:0,y:0},{x:1,y:1}],scaleEndRatio:.3,initialRotationMode:"random",initialRotationMin:0,initialRotationMax:360,initialRotationCurve:[{x:0,y:0},{x:1,y:1}],alpha:.9,alphaEnd:0,rotationSpeedMin:-180,rotationSpeedMax:180,speedOverLifeEnabled:!1,speedOverLifeMode:"fixed",speedOverLifeMin:1,speedOverLifeMax:1,speedOverLifeCurve:[{x:0,y:1},{x:1,y:1}],scaleOverLifeEnabled:!1,scaleOverLifeMode:"curve",scaleOverLifeAxisMode:"uniform",scaleOverLifeMin:0,scaleOverLifeMax:1,scaleYOverLifeMin:0,scaleYOverLifeMax:1,scaleOverLifeCurve:[{x:0,y:1},{x:1,y:1}],scaleYOverLifeCurve:[{x:0,y:1},{x:1,y:1}],rotationOverLifeEnabled:!1,rotationOverLifeMode:"random",rotationOverLifeCurve:[{x:0,y:0},{x:1,y:1}],gravity:980,gravityMode:"fixed",gravityMin:980,gravityMax:980,gravityDirection:-90,gravityCurve:[{x:0,y:1},{x:1,y:1}],damping:0,seed:0,colorStart:"#ffffff",colorEnd:"#ff4d4d",colorOverLife:!1,blend:"add",alphaMode:"curve",curveMode:"线性",alphaCurve:[{x:0,y:0},{x:.2,y:1},{x:.8,y:1},{x:1,y:0}],textureName:"star",textureFolder:"",alphaScale:1,anchorX:.5,anchorY:.5,independentAlpha:"off",offsetX:0,offsetY:0,noise:!1,noiseAmt:30,noiseRange:100,noiseSpeed:1,useGravity:!1,wind:!1,windX:0,windY:0,windMode:"fixed",windMin:100,windMax:100,windDirection:0,windCurve:[{x:0,y:1},{x:1,y:1}],forceField:!1,forceStrength:10,forceRadius:100,forceCenterX:0,forceCenterY:0,forceFalloff:"linear",attraction:!1,attractionCenterX:200,attractionCenterY:0,attractionRadius:20,attractionDuration:.5,attractionDelay:.1,attractionDelayMode:"particle",attractionPath:"curve",trail:!1,trailConfigVersion:3,trailResources:[{id:1,texture:null,textureName:"trail",previewUrl:"/images/trail.png",weight:100,locked:!1,rotation:0,colorMode:"particle",color:"#ffffff",colorGradient:[{position:0,color:"#ffffff"},{position:1,color:"#ffffff"}],blend:"normal",alphaMode:"particle",alpha:1,alphaCurve:[{x:0,y:1},{x:1,y:1}],boneCount:3,trailRatio:100,lengthMode:"fixed",length:100,lengthMin:100,lengthMax:100,widthSizeMode:"fixed",width:100,widthMin:100,widthMax:100,widthMode:"particle",lifeLengthEnabled:!1,lifeLengthCurve:[{x:0,y:1},{x:1,y:1}],shapeEnabled:!1,shapeCurve:[{x:0,y:1},{x:1,y:1}]}],trailResourceVersion:6,trailTexture:null,trailTextureName:"trail",trailPreviewUrl:"/images/trail.png",trailColorMode:"particle",trailColor:"#ffffff",trailColorGradient:[{position:0,color:"#ffffff"},{position:1,color:"#ffffff"}],trailAlphaMode:"particle",trailAlpha:1,trailAlphaCurve:[{x:0,y:1},{x:1,y:1}],trailBoneCount:3,trailLength:100,trailWidth:100,trailWidthMode:"particle",trailLifeLengthEnabled:!1,trailLifeLengthCurve:[{x:0,y:1},{x:1,y:1}],trailShapeEnabled:!1,trailShapeCurve:[{x:0,y:1},{x:1,y:1}],trailGridRows:4,trailGridCols:4,collision:!1,pathFollow:!1,emitterFollow:!1,emitterFollowMode:"none",emitterFollowPathId:0,emitterFollowSpineId:0,emitterFollowBoneName:"",emitterFollowBoneOffsetX:0,emitterFollowBoneOffsetY:0,emitterFollowBoneRotation:0,emitterFollowBoneScaleX:1,emitterFollowBoneScaleY:1,emitterAngleMode:"fixed",emitterFollowCurve:[{x:0,y:0},{x:1,y:1}],emitterFollowDuration:2,emitterFollowSpace:"world",emitterFollowDirection:"forward",emitterFollowOffset:0}}function Tr(i){var M;const e=ga(),t=i,s=t.imageWeightVersion!==1,n=t.loopDurationFrames==null,r=t.gravityMode==null,o=Number(t.gravity),a=t.windMode==null,h=Number(t.windX),l=Number(t.windY),c=t.forceFalloff==null,u=Number(t.forceStrength),f=t.trailConfigVersion!==3,d=!Array.isArray(t.trailResources),m=t.trailResourceVersion!==6,g=t.trailTexture,b=String(t.trailTextureName||"trail"),_=String(t.trailPreviewUrl||"/images/trail.png").replace("/trails/trail.png","/images/trail.png");for(const[v,S]of Object.entries(e))t[v]!==void 0&&t[v]!==null||(t[v]=Array.isArray(S)?S.map(y=>typeof y=="object"&&y!==null?{...y}:y):S);i.streamBehavior!=="normal"&&i.streamBehavior!=="loop"&&(i.streamBehavior="normal"),(n||!Number.isFinite(i.loopDurationFrames))&&(i.loopDurationFrames=Math.ceil(Math.max(1/30,Number(i.duration)||1)*30)),i.loopDurationFrames=Math.min(1800,Math.max(1,Math.ceil(i.loopDurationFrames))),typeof i.generateLoopStartAnimation!="boolean"&&(i.generateLoopStartAnimation=!1),typeof i.generateLoopEndAnimation!="boolean"&&(i.generateLoopEndAnimation=!1),i.generateLoopStartAnimation&&i.generateLoopEndAnimation&&(i.generateLoopEndAnimation=!1),(!Array.isArray(i.imageResources)||i.imageResources.length===0)&&(i.imageResources=ga().imageResources);for(const v of i.imageResources){!v.texture&&i.texture&&(v.texture=i.texture),v.textureName||(v.textureName="star"),v.previewUrl==="/particles/star.png"&&(v.previewUrl="/images/star.png"),v.previewUrl||(v.previewUrl=v.textureName==="star"?"/images/star.png":""),v.imageMode!=="fixed"&&v.imageMode!=="sequence"&&(v.imageMode="fixed"),v.sequencePlayback==="once"?v.sequencePlayback="once-hold":v.sequencePlayback==="loop"?v.sequencePlayback="loop-forward":["once-hide","once-hold","loop-forward","loop-reverse"].includes(v.sequencePlayback)||(v.sequencePlayback="loop-forward"),Number.isFinite(v.sequenceFps)||(v.sequenceFps=30),v.sequenceFps=Math.min(120,Math.max(1,Number(v.sequenceFps)||30)),Array.isArray(v.sequenceFrames)||(v.sequenceFrames=[]);for(const S of v.sequenceFrames)typeof S.name!="string"&&(S.name=""),typeof S.previewUrl!="string"&&(S.previewUrl=""),S.texture===void 0&&(S.texture=null);Number.isFinite(v.weight)||(v.weight=100),typeof v.locked!="boolean"&&(v.locked=!1),Number.isFinite(v.scale)||(v.scale=1),Number.isFinite(v.anchorX)||(v.anchorX=.5),Number.isFinite(v.anchorY)||(v.anchorY=.5),v.colorMode!=="fixed"&&v.colorMode!=="lifetime"&&(v.colorMode=i.colorOverLife?"lifetime":"fixed"),v.colorStart||(v.colorStart=i.colorStart||"#ffffff"),v.colorEnd||(v.colorEnd=i.colorEnd||v.colorStart),(!Array.isArray(v.colorGradient)||v.colorGradient.length<2)&&(v.colorGradient=[{position:0,color:v.colorStart},{position:1,color:v.colorEnd}]),Object.prototype.hasOwnProperty.call(Dn,v.blend)||(v.blend=i.blend||"normal"),["off","fixed","curve"].includes(v.independentAlpha)||(v.independentAlpha=i.independentAlpha||"off"),Number.isFinite(v.alpha)||(v.alpha=Number.isFinite(i.alphaScale)?i.alphaScale:1),["跟随导出","线性","贝塞尔"].includes(v.alphaCurveMode)||(v.alphaCurveMode=i.curveMode||"跟随导出"),(!Array.isArray(v.alphaCurve)||v.alphaCurve.length<2)&&(v.alphaCurve=(i.alphaCurve||[{x:0,y:1},{x:1,y:1}]).map(S=>({...S})))}if(i.imageResources.length===1)i.imageResources[0].weight=100,i.imageResources[0].locked=!1;else if(s){const v=100/i.imageResources.length;i.imageResources.forEach((S,y)=>{S.weight=y===i.imageResources.length-1?100-v*(i.imageResources.length-1):v,S.locked=!1})}if(i.imageWeightVersion=1,r){const v=Number.isFinite(o)&&o!==0?o:980;i.gravity=v,i.gravityMin=v,i.gravityMax=v}if(a){const v=Number.isFinite(h)&&Number.isFinite(l)&&(h!==0||l!==0);i.windMin=v?Math.hypot(h,l):100,i.windMax=i.windMin,i.windDirection=v?Math.atan2(-l,h)*180/Math.PI:0}c&&(i.forceStrength=Number.isFinite(u)&&u!==0?u:10),f&&(i.trailConfigVersion=3,i.trailAlphaCurve=[{x:0,y:1},{x:1,y:1}],i.trailLifeLengthCurve=[{x:0,y:1},{x:1,y:1}],i.trailShapeCurve=[{x:0,y:1},{x:1,y:1}],i.trailGridRows=4,i.trailGridCols=4),(d||!i.trailResources.length)&&(i.trailResources=[{id:1,texture:g||null,textureName:b,previewUrl:_,weight:100,locked:!1,rotation:0,colorMode:i.trailColorMode,color:i.trailColor,colorGradient:i.trailColorGradient.map(v=>({...v})),blend:"normal",alphaMode:i.trailAlphaMode,alpha:i.trailAlpha,alphaCurve:i.trailAlphaCurve.map(v=>({...v})),boneCount:i.trailBoneCount,trailRatio:100,lengthMode:"fixed",length:i.trailLength,lengthMin:i.trailLength,lengthMax:i.trailLength,widthSizeMode:"fixed",width:i.trailWidth,widthMin:i.trailWidth,widthMax:i.trailWidth,widthMode:i.trailWidthMode,lifeLengthEnabled:i.trailLifeLengthEnabled,lifeLengthCurve:i.trailLifeLengthCurve.map(v=>({...v})),shapeEnabled:i.trailShapeEnabled,shapeCurve:i.trailShapeCurve.map(v=>({...v}))}]);for(const v of i.trailResources)v.textureName||(v.textureName="trail"),v.previewUrl==="/trails/trail.png"&&(v.previewUrl="/images/trail.png"),v.previewUrl||(v.previewUrl="/images/trail.png"),Number.isFinite(v.weight)||(v.weight=100),typeof v.locked!="boolean"&&(v.locked=!1),Number.isFinite(v.rotation)||(v.rotation=0),["particle","fixed","curve"].includes(v.colorMode)||(v.colorMode=i.trailColorMode||"particle"),v.color||(v.color=i.trailColor||"#ffffff"),(!Array.isArray(v.colorGradient)||v.colorGradient.length<2)&&(v.colorGradient=(i.trailColorGradient||[{position:0,color:"#ffffff"},{position:1,color:"#ffffff"}]).map(S=>({...S}))),Object.prototype.hasOwnProperty.call(Dn,v.blend)||(v.blend="normal"),["particle","fixed","curve"].includes(v.alphaMode)||(v.alphaMode=i.trailAlphaMode||"particle"),Number.isFinite(v.alpha)||(v.alpha=Number.isFinite(i.trailAlpha)?i.trailAlpha:1),(!Array.isArray(v.alphaCurve)||v.alphaCurve.length<2)&&(v.alphaCurve=(i.trailAlphaCurve||[{x:0,y:1},{x:1,y:1}]).map(S=>({...S}))),Number.isFinite(v.boneCount)||(v.boneCount=Number.isFinite(i.trailBoneCount)?i.trailBoneCount:3),Number.isFinite(v.trailRatio)||(v.trailRatio=100),v.trailRatio=Math.min(100,Math.max(0,v.trailRatio)),["fixed","random"].includes(v.lengthMode)||(v.lengthMode="fixed"),Number.isFinite(v.length)||(v.length=Number.isFinite(i.trailLength)?i.trailLength:100),Number.isFinite(v.lengthMin)||(v.lengthMin=v.length),Number.isFinite(v.lengthMax)||(v.lengthMax=v.length),["fixed","random"].includes(v.widthSizeMode)||(v.widthSizeMode="fixed"),Number.isFinite(v.width)||(v.width=Number.isFinite(i.trailWidth)?i.trailWidth:100),Number.isFinite(v.widthMin)||(v.widthMin=v.width),Number.isFinite(v.widthMax)||(v.widthMax=v.width),["particle","fixed"].includes(v.widthMode)||(v.widthMode=i.trailWidthMode||"particle"),typeof v.lifeLengthEnabled!="boolean"&&(v.lifeLengthEnabled=!!i.trailLifeLengthEnabled),(!Array.isArray(v.lifeLengthCurve)||v.lifeLengthCurve.length<2)&&(v.lifeLengthCurve=(i.trailLifeLengthCurve||[{x:0,y:1},{x:1,y:1}]).map(S=>({...S}))),typeof v.shapeEnabled!="boolean"&&(v.shapeEnabled=!!i.trailShapeEnabled),(!Array.isArray(v.shapeCurve)||v.shapeCurve.length<2)&&(v.shapeCurve=(i.trailShapeCurve||[{x:0,y:1},{x:1,y:1}]).map(S=>({...S})));if(i.trailResources.length===1&&(i.trailResources[0].weight=100,i.trailResources[0].locked=!1),m)for(const v of i.trailResources)v.alphaCurve=((M=v.alphaCurve)==null?void 0:M.length)>=2?v.alphaCurve:[{x:0,y:1},{x:1,y:1}];return i.trailResourceVersion=6,i}const Dn={normal:0,add:1,multiply:2,screen:3},vE=400;class yE extends gi{constructor(t,s=vE){super();A(this,"pool",[]);A(this,"cfg");A(this,"accumulator",0);A(this,"burstTimer",0);A(this,"_spawnSerial",0);A(this,"_elapsed",0);A(this,"_attractionEnabledAt",0);A(this,"_attractionWasEnabled",!1);A(this,"_emitterPos",null);A(this,"states",[]);A(this,"rng",Math.random);A(this,"_lastSeed",-1);A(this,"trailDebugGfx",new Ri);A(this,"colliders",[]);A(this,"followSpawnX",0);A(this,"followSpawnY",0);A(this,"followSpawnAngle",0);A(this,"followExportCurveMode","线性");A(this,"simulationTransform",null);this.cfg=Tr(t),this._ensurePool(s),this.addChild(this.trailDebugGfx)}setFollowExportCurveMode(t){this.followExportCurveMode=t}resolveCurveMode(t){return t==="跟随导出"?this.followExportCurveMode:t}reseed(){const t=this.cfg.seed;t!==this._lastSeed&&(this._lastSeed=t,this.rng=wu(t>>>0))}_ensurePool(t){for(;this.pool.length=n.delay),o=s==="force"||s==="normal"&&(n.mode==="burst"||this._elapsed=1;)this.accumulator-=1,this.spawnOne();else this.burstTimer+=t,n.burstLoop?this.burstTimer>=1&&(this.burstTimer=0,this.emitBurst()):t>0&&this.burstTimer<=t&&this.emitBurst();const a=[];for(let m=0;m0){const P=Math.max(1e-4,Math.abs(n.rootScaleX)),X=Math.max(1e-4,Math.abs(n.rootScaleY)),U=-(((h=this.simulationTransform)==null?void 0:h.rotation)??n.rootRotation)*Math.PI/180,Y=Math.cos(U),q=Math.sin(U),z=((l=this.simulationTransform)==null?void 0:l.centerX)??n.centerX,ne=((c=this.simulationTransform)==null?void 0:c.centerY)??n.centerY,H=z+Y*P*g.x-q*X*g.y,Z=-ne+q*P*g.x+Y*X*g.y,ae=H,me=-Z,_e=n.forceCenterX-ae,te=n.forceCenterY-me,ve=Math.hypot(_e,te);if(ve>1e-4&&ve<=n.forceRadius){let $=1;n.forceFalloff==="linear"?$=1-ve/n.forceRadius:n.forceFalloff==="inverse"&&($=Math.min(10,n.forceRadius/Math.max(ve,n.forceRadius*.1)));const W=n.forceStrength*$*10,J=_e/ve*W,Q=te/ve*W,ie=J,ue=-Q;g.vx+=(Y*ie+q*ue)/P*t,g.vy+=(-q*ie+Y*ue)/X*t}}if(!g.collisionPaused&&n.damping>0){const P=Math.max(0,1-n.damping*t);g.vx*=P,g.vy*=P}if(g.collisionPaused)g.vx=0,g.vy=0;else if(g.x+=g.vx*t,g.y+=g.vy*t,this.applyColliders(g,m))continue;if(n.attraction&&!g.collisionPaused){const P=g.maxLife-g.life;if(n.attractionDelayMode==="particle"?P>=Math.max(0,n.attractionDelay):this._elapsed-this._attractionEnabledAt>=Math.max(0,n.attractionDelay)){const U=Ur(n,g.x,g.y,this.simulationTransform),Y=n.attractionCenterX,q=n.attractionCenterY,z=Math.max(0,n.attractionRadius);if(!g.attractionActive){if(Math.hypot(Y-U.x,q-U.y)<=z){this.kill(m);continue}g.attractionActive=!0,g.attractionElapsed=0,g.attractionStartWorldX=U.x,g.attractionStartWorldY=U.y}g.attractionElapsed+=t;const ne=Math.max(1e-4,n.attractionDuration),H=Math.min(1,g.attractionElapsed/ne);let Z=ni(g.attractionStartWorldX,Y,H),ae=ni(g.attractionStartWorldY,q,H);if(n.attractionPath==="curve"){const te=Y-g.attractionStartWorldX,ve=q-g.attractionStartWorldY,$=Math.hypot(te,ve);if($>1e-4){const W=$*.25*g.attractionCurveSide,J=(g.attractionStartWorldX+Y)*.5-ve/$*W,Q=(g.attractionStartWorldY+q)*.5+te/$*W,ie=1-H;Z=ie*ie*g.attractionStartWorldX+2*ie*H*J+H*H*Y,ae=ie*ie*g.attractionStartWorldY+2*ie*H*Q+H*H*q}}const me=Math.hypot(Y-Z,q-ae);if(H>=1||me<=z){this.kill(m);continue}const _e=ig(n,Z,ae,this.simulationTransform);g.x=_e.x,g.y=_e.y,g.vx=0,g.vy=0}}const _=b,M=g.sprite,v=n.imageResources.find(P=>P.id===g.resourceId);if(v){const P=this.imageFrameState(v,g.maxLife-g.life);g.imageFrameIndex=P.index,M.texture=this.imageFrameTexture(v,g.imageFrameIndex),M.visible=P.visible}if(n.speedOverLifeEnabled){const P=Qa(bu(n.speedOverLifeMode,n.speedOverLifeMin,n.speedOverLifeMax,n.speedOverLifeCurve,_,g.speedScaleTarget),1),X=g.speedScale===0?P:P/g.speedScale;g.vx*=X,g.vy*=X,g.speedScale=P}let S=g.rotationSpeed;n.rotationOverLifeEnabled&&n.rotationOverLifeMode==="curve"&&(S=ni(n.rotationSpeedMin,n.rotationSpeedMax,Ps(n.rotationOverLifeCurve,_))),g.rotation+=S*t;let y=g.x,I=g.y;if(n.noise&&n.noiseAmt>0&&n.noiseRange>0&&n.noiseSpeed>0){const P=g.maxLife-g.life,X=Math.max(0,n.noiseRange)*Math.min(1,Math.max(0,n.noiseAmt)/100)*.5,U=P*Math.max(0,n.noiseSpeed)*Math.PI*2;y+=(Math.sin(g.noisePhaseX+U)-Math.sin(g.noisePhaseX))*X,I+=(Math.sin(g.noisePhaseY+U*.83)-Math.sin(g.noisePhaseY))*X}M.x=y,M.y=I,M.rotation=-g.rotation*Math.PI/180;let E=1,C=1;n.scaleOverLifeEnabled&&(E=bu(n.scaleOverLifeMode,n.scaleOverLifeMin,n.scaleOverLifeMax,n.scaleOverLifeCurve,_,g.scaleOverLifeX),C=n.scaleOverLifeAxisMode==="separate"?bu(n.scaleOverLifeMode,n.scaleYOverLifeMin,n.scaleYOverLifeMax,n.scaleYOverLifeCurve,_,g.scaleOverLifeY):E),M.scale.set(Qa(g.scaleStartX*E,1),Qa(g.scaleStartY*C,1));const R=n.alphaMode==="curve"?Ps(n.alphaCurve,_,this.resolveCurveMode(n.curveMode))*n.alphaScale:n.alpha*n.alphaScale;M.alpha=Qa((v==null?void 0:v.independentAlpha)==="fixed"?v.alpha:(v==null?void 0:v.independentAlpha)==="curve"?Ps(v.alphaCurve,_,this.resolveCurveMode(v.alphaCurveMode)):R,1);const B=(v==null?void 0:v.colorStart)||"#ffffff",k=(v==null?void 0:v.colorMode)==="lifetime"?ng(v.colorGradient,_):fo(B);M.tint=k,M.blendMode=Dn[(v==null?void 0:v.blend)||"normal"];const F=this.updateTrail(g,y,I,_,M),D=Ur(n,y,I,this.simulationTransform),N=((u=this.simulationTransform)==null?void 0:u.rotation)??n.rootRotation,j=Math.abs(((f=this.simulationTransform)==null?void 0:f.scaleX)??n.rootScaleX),O=Math.abs(((d=this.simulationTransform)==null?void 0:d.scaleY)??n.rootScaleY),L=F?{...F,bones:F.bones.map(P=>{const X=Ur(n,P.x,P.y,this.simulationTransform);return{...P,worldX:X.x,worldY:X.y,worldRotation:N-P.rotation}})}:void 0;a.push({boneName:g.boneName,spawnId:g.spawnId,x:y,y:I,rotation:g.rotation,scaleX:M.scale.x,scaleY:M.scale.y,worldX:D.x,worldY:D.y,worldRotation:N+g.rotation,worldScaleX:M.scale.x*j,worldScaleY:M.scale.y*O,alpha:M.alpha,colorHex:k,resourceId:g.resourceId,imageFrameIndex:g.imageFrameIndex,imageVisible:M.visible,trailState:L,active:!0})}return this.states=a,a}ensureTrailMesh(t){const s=this.cfg,n=s.trailResources.find(b=>b.id===t.trailResourceId)||s.trailResources[0],r=(n==null?void 0:n.texture)||et.EMPTY,o=Number(n==null?void 0:n.rotation)||0,a=Math.max(2,Math.min(16,Math.round(s.trailGridRows))),h=Math.max(2,Math.min(32,Math.round(s.trailGridCols))),l=Math.max(2,Math.min(16,Math.round((n==null?void 0:n.boneCount)??3))),c=`${a}:${h}:${l}:${(n==null?void 0:n.id)??0}:${o}`;if(t.trailMesh&&t.trailMeshSignature===c)return t.trailMesh.texture!==r&&(t.trailMesh.texture=r),t.trailMesh;t.trailMesh&&(this.removeChild(t.trailMesh),t.trailMesh.destroy()),t.trailMeshSignature&&t.trailMeshSignature!==c&&(t.trailHistory.length=0,t.trailBones.length=0);const u=new Float32Array(a*h*2),f=new Float32Array(a*h*2),d=[],m=[];for(let b=0;b.05?t.trailHistory.unshift({x:s,y:n}):(o.x=s,o.y=n);const a=Math.max(1,r)*1.5;let h=0,l=t.trailHistory.length;for(let c=1;c=a||c>=239){l=c+1;break}t.trailHistory.length>l&&(t.trailHistory.length=l)}sampleTrailBones(t,s,n){const r=Math.max(2,Math.min(16,Math.round(n))),o=t.trailHistory,a=[];if(!o.length)return a;let h=0;for(let c=1;c=u&&_>1e-4){const M=(u-f)/_;d={x:ni(g.x,b.x,M),y:ni(g.y,b.y,M)};break}f+=_}a.push({boneName:`${t.boneName}_trail_${c}`,x:d.x,y:d.y,rotation:0})}for(let c=0;c1){const c=a[0].rotation,f=(a[a.length-1].rotation-c+540)%360-180;for(let d=0;du.id===s.resourceId)||r.trailResources[0];if(!(o!=null&&o.texture)||s.bones.length<2){n.visible=!1;return}t.trailResourceId=o.id,n.texture!==o.texture&&(n.texture=o.texture);const a=Math.max(2,Math.min(16,Math.round(r.trailGridRows))),h=Math.max(2,Math.min(32,Math.round(r.trailGridCols))),l=n.vertices,c=[];for(let u=0;u.5&&s.alpha>0}updateTrail(t,s,n,r,o){const a=this.cfg;if(!a.trail||!t.trailEnabled||t.trailSampledLength<=0||t.trailSampledWidth<=0){t.trailHistory.length=0,t.trailBones.length=0,t.trailMesh&&(t.trailMesh.visible=!1);return}this.ensureTrailMesh(t);const h=a.trailResources.find(d=>d.id===t.trailResourceId)||a.trailResources[0];this.appendTrailPoint(t,s,n,t.trailSampledLength);const l=h!=null&&h.lifeLengthEnabled?Math.max(0,Ps(h.lifeLengthCurve,r)):1,c=Math.max(0,t.trailSampledLength)*l;t.trailBones=this.sampleTrailBones(t,c,(h==null?void 0:h.boneCount)??3),t.trailBones[0]&&(t.trailBones[0].x=s,t.trailBones[0].y=n);const u=(h==null?void 0:h.widthMode)==="particle"?(Math.abs(o.scale.x)+Math.abs(o.scale.y))*.5:1;t.trailCurrentWidth=Math.max(0,t.trailSampledWidth)*u,t.trailCurrentAlpha=(h==null?void 0:h.alphaMode)==="particle"?o.alpha:(h==null?void 0:h.alphaMode)==="curve"?Ps(h.alphaCurve,r):(h==null?void 0:h.alpha)??1,t.trailCurrentColor=(h==null?void 0:h.colorMode)==="particle"?o.tint:(h==null?void 0:h.colorMode)==="curve"?ng(h.colorGradient,r):fo((h==null?void 0:h.color)||"#ffffff");const f={bones:t.trailBones.map(d=>({...d})),activeBoneCount:t.trailBones.length,width:t.trailCurrentWidth,alpha:Math.min(1,Math.max(0,t.trailCurrentAlpha)),colorHex:t.trailCurrentColor,resourceId:t.trailResourceId};return this.skinTrailMesh(t,f),f}drawTrailMeshDebug(t){const s=this.trailDebugGfx;if(s.clear(),!t||!this.cfg.trail)return;const n=Math.max(2,Math.min(16,Math.round(this.cfg.trailGridRows))),r=Math.max(2,Math.min(32,Math.round(this.cfg.trailGridCols)));s.lineStyle(1,3790847,.72);for(const o of this.pool){const a=o.trailMesh;if(!(a!=null&&a.visible))continue;const h=a.vertices,l=(c,u)=>{const f=(c*n+u)*2;return{x:h[f],y:h[f+1]}};for(let c=0;c!v.active);if(s===-1)return;const{x:n,y:r}=this.spawnOrigin(),o=Xr(t.lifeMode,t.lifeMin,t.lifeMax,t.lifeCurve,this.rng()),a=Xr(t.speedMode,t.speedMin,t.speedMax,t.speedCurve,this.rng());let h;t.shape==="cone"?h=(t.direction+this.followSpawnAngle+ni(-t.coneAngle/2,t.coneAngle/2,this.rng()))*Math.PI/180:h=(t.direction+this.followSpawnAngle+ni(-t.spread/2,t.spread/2,this.rng()))*Math.PI/180;const l=this.pool[s],c=this.pickImageResource(),u=this._spawnSerial++;l.spawnId=u;const f=this.pickTrailResource(Vr(t.seed,u,1540483477));l.noisePhaseX=Vr(t.seed,u,1757159915)*Math.PI*2,l.noisePhaseY=Vr(t.seed,u,48610963)*Math.PI*2,l.gravityStrength=t.useGravity&&t.gravityMode==="random"?ni(t.gravityMin,t.gravityMax,this.rng()):t.gravityMin,l.windStrength=t.wind&&t.windMode==="random"?ni(t.windMin,t.windMax,this.rng()):t.windMin,l.attractionActive=!1,l.attractionElapsed=0,l.collisionPaused=!1,l.attractionCurveSide=Vr(t.seed,u,2738958700)<.5?-1:1,l.trailHistory.length=0,l.trailBones.length=0,l.trailCurrentWidth=0,l.trailCurrentAlpha=0,l.trailCurrentColor=16777215,l.trailResourceId=f.id;const d=Math.min(100,Math.max(0,Number(f.trailRatio)||0)),m=t.mode==="burst"?Math.max(0,Math.round(t.burstCount)):Math.max(0,Math.floor(t.rate*(t.streamBehavior==="loop"?Math.max(1,t.loopDurationFrames)/30:Math.max(0,t.duration)))),g=d>0&&m===1&&u===0,b=Vr(t.seed,u,668265261)*100,_=(v,S,y,I,E)=>{if(v!=="random")return Math.max(0,Number(S)||0);const C=Math.max(0,Math.min(Number(y)||0,Number(I)||0)),R=Math.max(0,Math.max(Number(y)||0,Number(I)||0));return ni(C,R,Vr(t.seed,u,E))};l.trailSampledLength=_(f.lengthMode,f.length,f.lengthMin,f.lengthMax,374761393),l.trailSampledWidth=_(f.widthSizeMode,f.width,f.widthMin,f.widthMax,3550635116),l.trailEnabled=t.trail&&(g||b0&&l.trailSampledWidth>0,l.trailMesh&&(l.trailMesh.visible=!1),l.active=!0,l.life=o,l.maxLife=o,l.x=n,l.y=r,l.trailEnabled&&l.trailHistory.push({x:n,y:r}),l.vx=Math.cos(h)*a,l.vy=(t.shape==="cone"?-Math.sin(h):Math.sin(h))*a,l.scaleStartX=Xr(t.scaleMode,t.scaleMin,t.scaleMax,t.scaleCurve,this.rng())*c.scale,l.scaleStartY=t.scaleAxisMode==="separate"?Xr(t.scaleMode,t.scaleYMin,t.scaleYMax,t.scaleYCurve,this.rng())*c.scale:l.scaleStartX,l.alphaStart=t.alpha,l.alphaEnd=t.alphaEnd,l.rotation=t.initialRotationMode==="direction"?-Math.atan2(l.vy,l.vx)*180/Math.PI+t.initialRotationMin:Xr(t.initialRotationMode,t.initialRotationMin,t.initialRotationMax,t.initialRotationCurve,this.rng()),l.rotationSpeed=t.rotationOverLifeEnabled?Xr(t.rotationOverLifeMode,t.rotationSpeedMin,t.rotationSpeedMax,t.rotationOverLifeCurve,this.rng()):0,l.speedScale=1,l.speedScaleTarget=t.speedOverLifeMode==="random"?ni(t.speedOverLifeMin,t.speedOverLifeMax,this.rng()):t.speedOverLifeMin,l.scaleOverLifeX=t.scaleOverLifeMode==="random"?ni(t.scaleOverLifeMin,t.scaleOverLifeMax,this.rng()):t.scaleOverLifeMin,l.scaleOverLifeY=t.scaleOverLifeMode==="random"?ni(t.scaleYOverLifeMin,t.scaleYOverLifeMax,this.rng()):t.scaleYOverLifeMin,l.resourceId=c.id;const M=this.imageFrameState(c,0);l.imageFrameIndex=M.index,l.sprite.texture=this.imageFrameTexture(c,M.index),l.sprite.anchor.set(c.anchorX,c.anchorY),l.sprite.blendMode=Dn[c.blend],l.sprite.tint=fo(c.colorStart),l.sprite.visible=!0}pickImageResource(){const t=this.cfg.imageResources.filter(r=>r.texture||r.sequenceFrames.some(o=>o.texture));if(!t.length)return{id:1,texture:this.cfg.texture,textureName:"star",textureFolder:"",previewUrl:"/images/star.png",imageMode:"fixed",sequencePlayback:"loop-forward",sequenceFps:30,sequenceFrames:[],weight:100,locked:!1,scale:1,anchorX:.5,anchorY:.5,colorMode:"fixed",colorStart:"#ffffff",colorEnd:"#ff4d4d",blend:"normal",colorGradient:[{position:0,color:"#ffffff"},{position:1,color:"#ff4d4d"}],independentAlpha:"off",alpha:1,alphaCurveMode:"跟随导出",alphaCurve:[{x:0,y:0},{x:.1,y:1},{x:.9,y:1},{x:1,y:0}]};const s=t.reduce((r,o)=>r+Math.max(0,o.weight),0);if(s<=0)return t[Math.floor(this.rng()*t.length)];let n=this.rng()*s;for(const r of t)if(n-=Math.max(0,r.weight),n<=0)return r;return t[t.length-1]}imageFrameState(t,s){if(t.imageMode!=="sequence"||t.sequenceFrames.length<=1)return{index:0,visible:!0};const n=Math.min(120,Math.max(1,Number(t.sequenceFps)||30)),r=Math.max(0,Math.floor(Math.max(0,s)*n)),o=t.sequenceFrames.length-1;return t.sequencePlayback==="once-hide"?{index:Math.min(o,r),visible:r<=o}:t.sequencePlayback==="once-hold"?{index:Math.min(o,r),visible:!0}:t.sequencePlayback==="loop-reverse"?{index:o-r%t.sequenceFrames.length,visible:!0}:{index:r%t.sequenceFrames.length,visible:!0}}imageFrameTexture(t,s){var n;return t.imageMode==="sequence"&&t.sequenceFrames.length?((n=t.sequenceFrames[Math.max(0,Math.min(t.sequenceFrames.length-1,s))])==null?void 0:n.texture)||t.texture||this.cfg.texture:t.texture||this.cfg.texture}pickTrailResource(t){const s=this.cfg.trailResources.filter(o=>o.texture);if(!s.length)return this.cfg.trailResources[0]||{id:1,texture:null,textureName:"trail",previewUrl:"/images/trail.png",weight:100,locked:!1,rotation:0,colorMode:"particle",color:"#ffffff",colorGradient:[{position:0,color:"#ffffff"},{position:1,color:"#ffffff"}],blend:"normal",alphaMode:"particle",alpha:1,alphaCurve:[{x:0,y:1},{x:1,y:1}],boneCount:3,trailRatio:100,lengthMode:"fixed",length:100,lengthMin:100,lengthMax:100,widthSizeMode:"fixed",width:100,widthMin:100,widthMax:100,widthMode:"particle",lifeLengthEnabled:!1,lifeLengthCurve:[{x:0,y:1},{x:1,y:1}],shapeEnabled:!1,shapeCurve:[{x:0,y:1},{x:1,y:1}]};const n=s.reduce((o,a)=>o+Math.max(0,a.weight),0);if(n<=0)return s[Math.min(s.length-1,Math.floor(t*s.length))];let r=t*n;for(const o of s)if(r-=Math.max(0,o.weight),r<=0)return o;return s[s.length-1]}kill(t){const s=this.pool[t];s.active=!1,s.sprite.visible=!1,s.trailHistory.length=0,s.trailBones.length=0,s.trailMesh&&(s.trailMesh.visible=!1)}clear(){for(const t of this.pool)t.active=!1,t.sprite.visible=!1,t.trailHistory.length=0,t.trailBones.length=0,t.trailMesh&&(t.trailMesh.visible=!1)}get activeCount(){let t=0;for(const s of this.pool)s.active&&t++;return t}capture(){const t=[];for(const s of this.pool)s.active&&t.push({boneName:s.boneName,spawnId:s.spawnId,x:s.sprite.x,y:s.sprite.y,rotation:s.rotation,scaleX:s.sprite.scale.x,scaleY:s.sprite.scale.y,...this.captureWorldTransform(s),alpha:s.sprite.alpha,colorHex:s.sprite.tint,resourceId:s.resourceId,imageFrameIndex:s.imageFrameIndex,imageVisible:s.sprite.visible,active:!0,trailState:this.cfg.trail&&s.trailBones.length?{bones:s.trailBones.map(n=>{var o;const r=Ur(this.cfg,n.x,n.y,this.simulationTransform);return{...n,worldX:r.x,worldY:r.y,worldRotation:(((o=this.simulationTransform)==null?void 0:o.rotation)??this.cfg.rootRotation)-n.rotation}}),activeBoneCount:s.trailBones.length,width:s.trailCurrentWidth,alpha:s.trailCurrentAlpha,colorHex:s.trailCurrentColor,resourceId:s.trailResourceId}:void 0});return t}captureWorldTransform(t){var r,o,a;const s=Ur(this.cfg,t.sprite.x,t.sprite.y,this.simulationTransform),n=((r=this.simulationTransform)==null?void 0:r.rotation)??this.cfg.rootRotation;return{worldX:s.x,worldY:s.y,worldRotation:n+t.rotation,worldScaleX:t.sprite.scale.x*Math.abs(((o=this.simulationTransform)==null?void 0:o.scaleX)??this.cfg.rootScaleX),worldScaleY:t.sprite.scale.y*Math.abs(((a=this.simulationTransform)==null?void 0:a.scaleY)??this.cfg.rootScaleY)}}apply(t){var n;const s=new Map;for(const r of t)s.set(r.boneName,r);for(const r of this.pool){const o=s.get(r.boneName);if(!o){r.active=!1,r.sprite.visible=!1,r.trailMesh&&(r.trailMesh.visible=!1);continue}r.active=o.active;const a=r.sprite;if(a.visible=o.active&&o.imageVisible!==!1,a.x=o.x,a.y=o.y,a.rotation=-o.rotation*Math.PI/180,a.scale.set(o.scaleX,o.scaleY),a.alpha=o.alpha,a.tint=o.colorHex,o.resourceId!=null){const h=this.cfg.imageResources.find(l=>l.id===o.resourceId);h&&(r.imageFrameIndex=o.imageFrameIndex??0,a.texture=this.imageFrameTexture(h,r.imageFrameIndex),a.anchor.set(h.anchorX,h.anchorY),a.blendMode=Dn[h.blend])}this.cfg.trail&&o.trailState?(r.trailResourceId=o.trailState.resourceId??((n=this.cfg.trailResources[0])==null?void 0:n.id)??1,r.trailBones=o.trailState.bones.map(h=>({...h})),r.trailCurrentWidth=o.trailState.width,r.trailCurrentAlpha=o.trailState.alpha,this.skinTrailMesh(r,o.trailState)):r.trailMesh&&(r.trailMesh.visible=!1)}}reset(){for(const t of this.pool)t.active=!1,t.sprite.visible=!1,t.trailHistory.length=0,t.trailBones.length=0,t.trailMesh&&(t.trailMesh.visible=!1);this.accumulator=0,this.burstTimer=0,this._spawnSerial=0,this._elapsed=0,this._attractionEnabledAt=0,this._attractionWasEnabled=!1,this._lastSeed=this.cfg.seed,this.rng=wu(this.cfg.seed>>>0)}restartEmissionCycle(){this.accumulator=0,this.burstTimer=0,this._spawnSerial=0,this._elapsed=0,this._attractionEnabledAt=0,this._attractionWasEnabled=this.cfg.attraction,this._lastSeed=this.cfg.seed,this.rng=wu(this.cfg.seed>>>0)}}function ni(i,e,t){return i+(e-i)*t}function Qa(i,e){return Number.isFinite(i)?i:e}function Ur(i,e,t,s=null){const n=Math.max(1e-4,Math.abs((s==null?void 0:s.scaleX)??i.rootScaleX)),r=Math.max(1e-4,Math.abs((s==null?void 0:s.scaleY)??i.rootScaleY)),o=-((s==null?void 0:s.rotation)??i.rootRotation)*Math.PI/180,a=Math.cos(o),h=Math.sin(o),l=(s==null?void 0:s.centerX)??i.centerX,c=(s==null?void 0:s.centerY)??i.centerY,u=l+a*n*e-h*r*t,f=-c+h*n*e+a*r*t;return{x:u,y:-f}}function ig(i,e,t,s=null){const n=Math.max(1e-4,Math.abs((s==null?void 0:s.scaleX)??i.rootScaleX)),r=Math.max(1e-4,Math.abs((s==null?void 0:s.scaleY)??i.rootScaleY)),o=-((s==null?void 0:s.rotation)??i.rootRotation)*Math.PI/180,a=Math.cos(o),h=Math.sin(o),l=e-((s==null?void 0:s.centerX)??i.centerX),c=-t+((s==null?void 0:s.centerY)??i.centerY);return{x:(a*l+h*c)/n,y:(-h*l+a*c)/r}}function xE(i,e,t,s=null){const n=Math.max(1e-4,Math.abs((s==null?void 0:s.scaleX)??i.rootScaleX)),r=Math.max(1e-4,Math.abs((s==null?void 0:s.scaleY)??i.rootScaleY)),o=-((s==null?void 0:s.rotation)??i.rootRotation)*Math.PI/180,a=Math.cos(o),h=Math.sin(o),l=a*n*e-h*r*t,c=h*n*e+a*r*t;return{x:l,y:-c}}function bE(i,e,t,s=null){const n=Math.max(1e-4,Math.abs((s==null?void 0:s.scaleX)??i.rootScaleX)),r=Math.max(1e-4,Math.abs((s==null?void 0:s.scaleY)??i.rootScaleY)),o=-((s==null?void 0:s.rotation)??i.rootRotation)*Math.PI/180,a=Math.cos(o),h=Math.sin(o),l=-t;return{x:(a*e+h*l)/n,y:(-h*e+a*l)/r}}function wE(i,e,t){const s=i.rotation*Math.PI/180,n=Math.cos(s),r=Math.sin(s),o=Math.max(1e-4,Math.abs(i.scaleX??1)),a=Math.max(1e-4,Math.abs(i.scaleY??1)),h=e-i.x,l=t-i.y,c=(n*h+r*l)/o,u=(-r*h+n*l)/a,f=(I,E,C,R)=>{const B=C/o,k=R/a,F=Math.max(1e-4,Math.hypot(B,k)),D=B/F,N=k/F,j=n*D-r*N,O=r*D+n*N;return{x:i.x+n*I*o-r*E*a+j*.05,y:i.y+r*I*o+n*E*a+O*.05,nx:j,ny:O}};if(i.shape==="circle"){const I=Math.max(.001,i.radius),E=Math.hypot(c,u);if(E>=I)return null;const C=E>1e-4?c/E:1,R=E>1e-4?u/E:0;return f(C*I,R*I,C,R)}if(i.shape==="ellipse"){const I=Math.max(.001,i.radiusX),E=Math.max(.001,i.radiusY),C=Math.hypot(c/I,u/E);if(C>=1)return null;const R=C>1e-4?1/C:1,B=C>1e-4?c*R:I,k=C>1e-4?u*R:0,F=Math.max(1e-4,Math.hypot(B/(I*I),k/(E*E)));return f(B,k,B/(I*I)/F,k/(E*E)/F)}if(i.shape==="rect"){const I=Math.max(.001,i.width*.5),E=Math.max(.001,i.height*.5);if(Math.abs(c)>=I||Math.abs(u)>=E)return null;const C=I-Math.abs(c),R=E-Math.abs(u);if(C=0?1:-1;return f(k*I,u,k,0)}const B=u>=0?1:-1;return f(c,B*E,0,B)}const d=Math.max(3,Math.min(16,Math.round(i.sides||(i.shape==="custom"?5:6)))),m=Math.max(.001,i.width*.5),g=Math.max(.001,i.height*.5),b=Array.from({length:d},(I,E)=>{const C=Math.PI*.5+E/d*Math.PI*2;return{x:Math.cos(C)*m,y:Math.sin(C)*g}});let _=!1;for(let I=0,E=b.length-1;Iu!=R.y>u&&c<(R.x-C.x)*(u-C.y)/(R.y-C.y)+C.x&&(_=!_)}if(!_)return null;let M=b[0].x,v=b[0].y,S=1/0;for(let I=0;I>>0^Math.imul(e+1,2654435761)^t)>>>0;return s^=s>>>16,s=Math.imul(s,2146121005),s^=s>>>15,s=Math.imul(s,2221713035),s^=s>>>16,(s>>>0)/4294967296}function Xr(i,e,t,s,n){return i==="fixed"?e:i==="curve"?ni(e,t,Ps(s,n)):ni(e,t,n)}function bu(i,e,t,s,n,r){return i==="curve"?ni(e,t,Ps(s,n)):i==="random"?r:e}function sg(i,e,t,s,n){const r=1-n;return r*r*r*i+3*r*r*n*e+3*r*n*n*t+n*n*n*s}function Ps(i,e,t="线性"){if(!Array.isArray(i)||i.length===0)return 1;const s=[...i].sort((n,r)=>n.x-r.x);if(e<=s[0].x)return s[0].y;if(e>=s[s.length-1].x)return s[s.length-1].y;for(let n=0;n=s[n].x&&e<=s[n+1].x){const r=s[n],o=s[n+1],a=o.x-r.x||1;if(t!=="贝塞尔")return ni(r.y,o.y,(e-r.x)/a);const h=r.x+(r.outX??a/3),l=r.y+(r.outY??(o.y-r.y)/3),c=o.x+(o.inX??-a/3),u=o.y+(o.inY??-(o.y-r.y)/3);let f=0,d=1;for(let m=0;m<14;m++){const g=(f+d)/2;sg(r.x,h,c,o.x,g)>>0;return function(){e|=0,e=e+1831565813|0;let t=Math.imul(e^e>>>15,1|e);return t=t+Math.imul(t^t>>>7,61|t)^t,((t^t>>>14)>>>0)/4294967296}}function fo(i){let e=i.replace("#","");return e.length===3&&(e=e.split("").map(t=>t+t).join("")),parseInt(e,16)}function SE(i,e,t){const s=rg(i),n=rg(e),r=Math.round(s[0]+(n[0]-s[0])*t),o=Math.round(s[1]+(n[1]-s[1])*t),a=Math.round(s[2]+(n[2]-s[2])*t);return r<<16|o<<8|a}function ng(i,e){if(!Array.isArray(i)||i.length===0)return 16777215;const t=[...i].sort((s,n)=>s.position-n.position);if(e<=t[0].position)return fo(t[0].color);if(e>=t[t.length-1].position)return fo(t[t.length-1].color);for(let s=0;sr.position)continue;const o=(e-n.position)/Math.max(1e-4,r.position-n.position);return SE(n.color,r.color,o)}return fo(t[t.length-1].color)}function rg(i){let e=i.replace("#","");e.length===3&&(e=e.split("").map(s=>s+s).join(""));const t=parseInt(e,16);return[t>>16&255,t>>8&255,t&255]}const Mr=new Map,xr=new Map;function TE(i){return[...Mr.values()].some(e=>e===i)}function py(i){if(!(TE(i)||(xr.get(i)||0)>0)){xr.delete(i);for(const e of i.textures)e.destroy(!0)}}function ME(i){const e=xr.get(i)||0;e>1?xr.set(i,e-1):xr.delete(i),py(i)}function EE(i){return Mr.get(i)||null}function Lh(i,e){Ea(i),Mr.set(i,e)}function AE(i){const e=Mr.get(i);return e?(xr.set(e,(xr.get(e)||0)+1),e):null}function CE(i,e){const t=Mr.get(i);return t?(Lh(e,t),!0):!1}function Ea(i){const e=Mr.get(i);e&&(Mr.delete(i),py(e))}function Ut(i){if(Array.isArray(i))return i.map(e=>Ut(e));if(i&&typeof i=="object"){const e=Object.getPrototypeOf(i);if(e===Object.prototype||e===null){const t={};for(const[s,n]of Object.entries(i))t[s]=Ut(n);return t}}return i}const my=["3.8","4.0","4.1","4.2"];function Wl(i){const e=String(i||"").trim();return my.find(t=>e===t||e.startsWith(`${t}.`))||null}function Sd(){return my.join(" / ")}function uf(){return{imagesPath:"./images/",spineVersion:"4.2",keyframeCurve:"linear",fps:30,omitFps:!1,integerFrameAlignment:!0,bonePool:!0,excludeEmptyAnimations:!1,fileName:"SpineParticle.json"}}function gy(i){const e=Object.assign(uf(),i||{});return e.imagesPath=String(e.imagesPath||"./images/"),e.spineVersion=Wl(e.spineVersion)||"4.2",e.keyframeCurve=e.keyframeCurve==="bezier"?"bezier":"linear",e.fps=Math.min(240,Math.max(1,Math.round(Number(e.fps)||30))),e.omitFps=e.omitFps===!0,e.integerFrameAlignment=e.integerFrameAlignment!==!1,e.bonePool=e.bonePool!==!1,e.excludeEmptyAnimations=e.excludeEmptyAnimations===!0,e.fileName=String(e.fileName||"SpineParticle.json"),e}let el=1,tl=1,il=1,sl=1;function nl(i,e){const t=new Set(e),s=`${i} Copy`;if(!t.has(s))return s;let n=2;for(;t.has(`${s} ${n}`);)n++;return`${s} ${n}`}const Aa=tw("particle",{state:()=>({editor:{viewScale:1,viewX:0,viewY:0},systems:[],colliders:[],paths:[],spines:[],activeId:0,activeObjectType:"particle",activeObjectId:0,timeline:{playing:!0,loop:!0,frame:0,totalFrames:60,fps:30,recorded:!1,animation:"animation",animations:["animation"]},settings:{parameterPanelOnRight:!1,tickEnabled:!1,axisFontSize:12,tickWidth:1,showAxisLabels:!0,axisColor:"#7a86ad",undoLimit:20,backgroundX:0,backgroundY:0,backgroundOpacity:1,backgroundImageName:"",backgroundImageData:"",showEmitter:!0,showBones:!1,bonePointDrawSize:1,boneAxisDrawSize:2,showSkinMesh:!1,showGrid:!0,exportSettings:uf()}}),getters:{activeSystemCount:i=>i.systems.length},actions:{syncSceneSequences(){el=Math.max(el,...this.systems.map(i=>i.id+1),1),tl=Math.max(tl,...this.colliders.map(i=>i.id+1),1),il=Math.max(il,...this.paths.map(i=>i.id+1),1),sl=Math.max(sl,...this.spines.map(i=>i.id+1),1)},addSystem(i){const e=ga();i!=null&&i.config&&Object.assign(e,i.config);const t=new Set(this.systems.map(r=>r.config.name));if(t.has(e.name)){let r=0;for(const a of this.systems){const h=/^ParticleSystem(\d+)$/.exec(a.config.name);h&&(r=Math.max(r,parseInt(h[1],10)))}e.name=`ParticleSystem${r+1}`;let o=2;for(;t.has(e.name);)e.name=`ParticleSystem${r+o}`,o++}const s=this.timeline.animations.includes(this.timeline.animation)?this.timeline.animation:this.timeline.animations[0]||"animation",n={id:el++,visible:!0,animation:s,config:e};return this.systems.push(n),this.activeId=n.id,this.activeObjectType="particle",this.activeObjectId=n.id,n},removeSystem(i){var s;const e=this.systems.findIndex(n=>n.id===i);e>=0&&this.systems.splice(e,1),this.activeId===i&&(this.activeId=((s=this.systems[0])==null?void 0:s.id)??0);const t=this.systems.find(n=>n.id===this.activeId);if(t&&(this.timeline.animation=t.animation),this.activeObjectType==="particle"&&this.activeObjectId===i){const n=this.systems[0];this.activeObjectId=(n==null?void 0:n.id)??0}},selectSystem(i){this.activeId=i,this.activeObjectType="particle",this.activeObjectId=i;const e=this.systems.find(t=>t.id===i);e&&(this.timeline.animation=e.animation)},setSystemAnimation(i,e){if(!this.timeline.animations.includes(e))return;const t=this.systems.find(s=>s.id===i);t&&(t.animation=e,this.timeline.animation=e)},addAnimation(){const i=new Set(this.timeline.animations);let e=2,t=`animation${e}`;for(;i.has(t);)t=`animation${++e}`;this.timeline.animations.push(t),this.timeline.animation=t;const s=this.systems.find(n=>n.id===this.activeId);return s&&(s.animation=t),t},renameAnimation(i,e){const t=e.trim(),s=this.timeline.animations.indexOf(i);if(s<0||!t||t!==i&&this.timeline.animations.includes(t))return!1;this.timeline.animations[s]=t;for(const n of this.systems)n.animation===i&&(n.animation=t);return this.timeline.animation===i&&(this.timeline.animation=t),!0},removeAnimation(i){if(this.timeline.animations.length<=1)return!1;const e=this.timeline.animations.indexOf(i);if(e<0)return!1;this.timeline.animations.splice(e,1);const t=this.timeline.animations[Math.min(e,this.timeline.animations.length-1)];for(const s of this.systems)s.animation===i&&(s.animation=t);return this.timeline.animation===i&&(this.timeline.animation=t),!0},addCollider(){const i=tl++,e={id:i,name:`Collider${i}`,visible:!0,tags:["Default"],selectedTag:"Default",shape:"circle",enabled:!0,x:0,y:0,rotation:0,scaleX:1,scaleY:1,radius:50,radiusX:70,radiusY:45,width:120,height:80,sides:6,response:"physics",elasticity:.8,friction:.3,followPath:!1,followPathId:0,followDuration:2,followPathRotation:!1,followCurveMode:"跟随导出",followCurve:[{x:0,y:0},{x:1,y:1}]};return this.colliders.push(e),this.activeObjectType="collision",this.activeObjectId=e.id,e},addPath(){const i=il++,e={id:i,name:`Path${i}`,visible:!0,enabled:!0,x:0,y:0,rotation:0,scaleX:1,scaleY:1,closed:!1,color:"#ff933e",preset:"",points:[]};return this.paths.push(e),this.activeObjectType="path",this.activeObjectId=e.id,e},addSpine(){const i=sl++,e={id:i,name:`SpineSkeleton${i}`,enabled:!0,visible:!0,x:0,y:0,rotation:0,scaleX:1,scaleY:1,timeOffset:0,skeletonFileName:"",atlasFileName:"",textureFileNames:[],dataVersion:"",sourceBundle:null,selectedAnimation:"",selectedBone:"",animations:[],bones:[],assetVersion:0,status:"empty",error:""};return this.spines.push(e),this.activeObjectType="spine",this.activeObjectId=e.id,e},duplicateSelectedObject(){const i=this.activeObjectId;if(!i)return null;if(this.activeObjectType==="particle"){const s=this.systems.find(r=>r.id===i);if(!s)return null;const n=Ut(s);return n.id=el++,n.config.name=nl(s.config.name,this.systems.map(r=>r.config.name)),n.frames=void 0,this.systems.push(n),this.activeId=n.id,this.activeObjectId=n.id,this.timeline.animation=n.animation,n}if(this.activeObjectType==="collision"){const s=this.colliders.find(r=>r.id===i);if(!s)return null;const n=Ut(s);return n.id=tl++,n.name=nl(s.name,this.colliders.map(r=>r.name)),this.colliders.push(n),this.activeObjectId=n.id,n}if(this.activeObjectType==="path"){const s=this.paths.find(r=>r.id===i);if(!s)return null;const n=Ut(s);return n.id=il++,n.name=nl(s.name,this.paths.map(r=>r.name)),this.paths.push(n),this.activeObjectId=n.id,n}const e=this.spines.find(s=>s.id===i);if(!e)return null;const t=Ut(e);return t.id=sl++,t.name=nl(e.name,this.spines.map(s=>s.name)),t.selectedBone="",CE(e.id,t.id),this.spines.push(t),this.activeObjectId=t.id,t},selectSceneObject(i,e){if(this.activeObjectType=i,this.activeObjectId=e,i==="particle"){this.activeId=e;const t=this.systems.find(s=>s.id===e);t&&(this.timeline.animation=t.animation)}},removeCollider(i){var t;const e=this.colliders.findIndex(s=>s.id===i);if(e>=0&&this.colliders.splice(e,1),this.activeObjectType==="collision"&&this.activeObjectId===i){const s=this.systems[0];this.activeObjectType=s?"particle":"collision",this.activeObjectId=(s==null?void 0:s.id)??((t=this.colliders[0])==null?void 0:t.id)??0}},removePath(i){var t;const e=this.paths.findIndex(s=>s.id===i);if(e>=0&&this.paths.splice(e,1),this.activeObjectType==="path"&&this.activeObjectId===i){const s=this.systems[0];this.activeObjectType=s?"particle":"path",this.activeObjectId=(s==null?void 0:s.id)??((t=this.paths[0])==null?void 0:t.id)??0}},removeSpine(i){Ea(i);const e=this.spines.findIndex(t=>t.id===i);if(e>=0&&this.spines.splice(e,1),this.activeObjectType==="spine"&&this.activeObjectId===i){const t=this.systems[0],s=this.colliders[0],n=this.paths[0],r=this.spines[0];t?(this.activeObjectType="particle",this.activeObjectId=t.id,this.activeId=t.id):s?(this.activeObjectType="collision",this.activeObjectId=s.id):n?(this.activeObjectType="path",this.activeObjectId=n.id):(this.activeObjectType="spine",this.activeObjectId=(r==null?void 0:r.id)??0)}this.recalcTotalFrames()},play(){this.timeline.frame>=Math.max(0,this.timeline.totalFrames-1)&&(this.timeline.frame=0),this.timeline.playing=!0},pause(){this.timeline.playing=!1},togglePlay(){this.timeline.playing?this.pause():this.play()},toStart(){this.timeline.frame=0},previousFrame(){this.timeline.playing=!1,this.timeline.frame=Math.max(0,this.timeline.frame-1)},nextFrame(){this.timeline.playing=!1,this.timeline.frame=Math.min(Math.max(0,this.timeline.totalFrames-1),this.timeline.frame+1)},toEnd(){this.timeline.playing=!1,this.timeline.frame=Math.max(0,this.timeline.totalFrames-1)},toggleLoop(){this.timeline.loop=!this.timeline.loop},setFrame(i){this.timeline.frame=Math.max(0,Math.min(i,this.timeline.totalFrames-1))},recalcTotalFrames(){const i=this.timeline.fps||30;let e=0;for(const s of this.systems){const n=s.config,r=Math.max(0,Number(n.lifeMin)||0),o=Math.max(0,Number(n.lifeMax)||0),a=n.lifeMode==="fixed"?r:Math.max(r,o),h=n.mode==="stream"?n.streamBehavior==="loop"?Math.max(1/i,Math.ceil(Math.max(1,Number(n.loopDurationFrames)||1))/i):Math.max(1/i,Number(n.duration)||0):0;let l=Math.max(0,Number(n.delay)||0)+h+a;if(n.mode==="stream"&&n.streamBehavior==="loop")if(n.generateLoopEndAnimation)l=Math.max(0,Number(n.delay)||0)+a+1/i;else if(n.generateLoopStartAnimation){const c=Math.max(1,Math.ceil(a/h));l=Math.max(0,Number(n.delay)||0)+h*c}else l=Math.max(0,Number(n.delay)||0)+h;l>e&&(e=l)}for(const s of this.spines){const n=s.animations.find(o=>o.name===s.selectedAnimation);if(!n)continue;const r=Math.max(0,Number(s.timeOffset)||0)+Math.max(0,n.duration||0);r>e&&(e=r)}for(const s of this.colliders){if(!s.followPath||!s.followPathId)continue;const n=Math.max(0,Number(s.followDuration)||0);n>e&&(e=n)}const t=Math.max(1,Math.ceil(e*i)+1);return this.timeline.totalFrames=t,this.timeline.frame>=t&&(this.timeline.frame=t-1),t}}}),vy="SpineParticle.SystemSettings",yy=1,_u="SpineParticle.SystemSettings.v1";function Lo(i,e,t,s){const n=Number(i);return Math.min(t,Math.max(e,Number.isFinite(n)?n:s))}function IE(i){return{parameterPanelOnRight:i.parameterPanelOnRight,undoLimit:i.undoLimit,showEmitter:i.showEmitter,showBones:i.showBones,bonePointDrawSize:i.bonePointDrawSize,boneAxisDrawSize:i.boneAxisDrawSize,showSkinMesh:i.showSkinMesh,tickEnabled:i.tickEnabled,axisFontSize:i.axisFontSize,tickWidth:i.tickWidth,showAxisLabels:i.showAxisLabels,axisColor:i.axisColor}}function RE(i,e){const t=n=>i[n]==null?!!e[n]:i[n]===!0,s=typeof i.axisColor=="string"&&/^#[0-9a-f]{6}$/i.test(i.axisColor)?i.axisColor:e.axisColor;return{parameterPanelOnRight:t("parameterPanelOnRight"),undoLimit:Math.round(Lo(i.undoLimit,1,200,e.undoLimit)),showEmitter:t("showEmitter"),showBones:t("showBones"),bonePointDrawSize:Lo(i.bonePointDrawSize,.1,10,e.bonePointDrawSize),boneAxisDrawSize:Lo(i.boneAxisDrawSize,.1,10,e.boneAxisDrawSize),showSkinMesh:t("showSkinMesh"),tickEnabled:t("tickEnabled"),axisFontSize:Math.round(Lo(i.axisFontSize,8,40,e.axisFontSize)),tickWidth:Lo(i.tickWidth,1,5,e.tickWidth),showAxisLabels:t("showAxisLabels"),axisColor:s}}function PE(i){let e;try{e=JSON.parse(i)}catch{throw new Error("系统设置缓存不是有效的 JSON")}const t=e;if(t.format!==vy)throw new Error("不是 Spine粒子编辑器系统设置缓存");if(t.version!==yy)throw new Error(`暂不支持系统配置版本:${t.version??"未知"}`);if(!t.settings||typeof t.settings!="object")throw new Error("系统设置缓存缺少 settings");return t}function kE(i,e){Object.assign(i.settings,RE(e,i.settings))}let rl=null;function FE(i){rl==null||rl();try{const e=localStorage.getItem(_u);e&&kE(i,PE(e).settings)}catch{try{localStorage.removeItem(_u)}catch{}}rl=cs(()=>IE(i.settings),e=>{const t={format:vy,version:yy,savedAt:new Date().toISOString(),settings:e};try{localStorage.setItem(_u,JSON.stringify(t))}catch{}},{deep:!0})}if(typeof window<"u"&&window.PIXI){let i=window.require;window.require=e=>{if(i)return i(e);if(e.startsWith("@pixi/"))return window.PIXI}}class xy{constructor(){A(this,"entries",{});A(this,"size",0)}add(e){let t=this.entries[e];return this.entries[e]=!0,t?!1:(this.size++,!0)}addAll(e){let t=this.size;for(var s=0,n=e.length;s1&&(this.r=1),this.g<0?this.g=0:this.g>1&&(this.g=1),this.b<0?this.b=0:this.b>1&&(this.b=1),this.a<0?this.a=0:this.a>1&&(this.a=1),this}static rgba8888ToColor(e,t){e.r=((t&4278190080)>>>24)/255,e.g=((t&16711680)>>>16)/255,e.b=((t&65280)>>>8)/255,e.a=(t&255)/255}static rgb888ToColor(e,t){e.r=((t&16711680)>>>16)/255,e.g=((t&65280)>>>8)/255,e.b=(t&255)/255}toRgb888(){const e=t=>("0"+(t*255).toString(16)).slice(-2);return+("0x"+e(this.r)+e(this.g)+e(this.b))}static fromString(e,t=new Di){return t.setFromString(e)}};A(Di,"WHITE",new Di(1,1,1,1)),A(Di,"RED",new Di(1,0,0,1)),A(Di,"GREEN",new Di(0,1,0,1)),A(Di,"BLUE",new Di(0,0,1,1)),A(Di,"MAGENTA",new Di(1,0,1,1));let ot=Di;const ti=class ti{static clamp(e,t,s){return es?s:e}static cosDeg(e){return Math.cos(e*ti.degRad)}static sinDeg(e){return Math.sin(e*ti.degRad)}static atan2Deg(e,t){return Math.atan2(e,t)*ti.degRad}static signum(e){return e>0?1:e<0?-1:0}static toInt(e){return e>0?Math.floor(e):Math.ceil(e)}static cbrt(e){let t=Math.pow(Math.abs(e),.3333333333333333);return e<0?-t:t}static randomTriangular(e,t){return ti.randomTriangularWith(e,t,(e+t)*.5)}static randomTriangularWith(e,t,s){let n=Math.random(),r=t-e;return n<=(s-e)/r?e+Math.sqrt(n*r*(s-e)):t-Math.sqrt((1-n)*r*(t-s))}static isPowerOfTwo(e){return e&&(e&e-1)===0}};A(ti,"PI",3.1415927),A(ti,"PI2",ti.PI*2),A(ti,"invPI2",1/ti.PI2),A(ti,"radiansToDegrees",180/ti.PI),A(ti,"radDeg",ti.radiansToDegrees),A(ti,"degreesToRadians",ti.PI/180),A(ti,"degRad",ti.degreesToRadians);let ke=ti;const Nn=class Nn{static arrayCopy(e,t,s,n,r){for(let o=t,a=n;o=t?e:Nn.setArraySize(e,t,s)}static newArray(e,t){let s=new Array(e);for(let n=0;n0?this.items.pop():this.instantiator()}free(e){e.reset&&e.reset(),this.items.push(e)}freeAll(e){for(let t=0;t>1)*a;let h=t.bone.skeleton,l=t.deform,c=this.vertices,u=this.bones;if(!u){l.length>0&&(c=l);let g=t.bone,b=g.worldX,_=g.worldY,M=g.a,v=g.b,S=g.c,y=g.d;for(let I=s,E=o;E=this.regions.length&&(s=this.regions.length-1);let n=this.regions[s];t.region!=n&&(t.region=n,t.updateRegion())}getPath(e,t){let s=e,n=(this.start+t).toString();for(let r=this.digits-n.length;r>0;r--)s+="0";return s+=n,s}static nextID(){return Qr._nextID++}};A(Qr,"_nextID",0);let Kl=Qr;var fi;(function(i){i[i.hold=0]="hold",i[i.once=1]="once",i[i.loop=2]="loop",i[i.pingpong=3]="pingpong",i[i.onceReverse=4]="onceReverse",i[i.loopReverse=5]="loopReverse",i[i.pingpongReverse=6]="pingpongReverse"})(fi||(fi={}));const wy=[fi.hold,fi.once,fi.loop,fi.pingpong,fi.onceReverse,fi.loopReverse,fi.pingpongReverse];class df{constructor(e,t,s){A(this,"name");A(this,"timelines",[]);A(this,"timelineIds",new xy);A(this,"duration");if(!e)throw new Error("name cannot be null.");this.name=e,this.setTimelines(t),this.duration=s}setTimelines(e){if(!e)throw new Error("timelines cannot be null.");this.timelines=e,this.timelineIds.clear();for(var t=0;t0&&(t%=this.duration));let l=this.timelines;for(let c=0,u=l.length;ct)return n-1;return s-1}static search(e,t,s){let n=e.length;for(let r=s;rt)return r-s;return n-s}};class qs extends Xt{constructor(t,s,n){super(t,n);A(this,"curves");this.curves=Fe.newFloatArray(t+s*18),this.curves[t-1]=1}setLinear(t){this.curves[t]=0}setStepped(t){this.curves[t]=1}shrink(t){let s=this.getFrameCount()+t*18;if(this.curves.length>s){let n=Fe.newFloatArray(s);Fe.arrayCopy(this.curves,0,n,0,s),this.curves=n}}setBezier(t,s,n,r,o,a,h,l,c,u,f){let d=this.curves,m=this.getFrameCount()+t*18;n==0&&(d[s]=2+m);let g=(r-a*2+l)*.03,b=(o-h*2+c)*.03,_=((a-l)*3-r+u)*.006,M=((h-c)*3-o+f)*.006,v=g*2+_,S=b*2+M,y=(a-r)*.3+g+_*.16666667,I=(h-o)*.3+b+M*.16666667,E=r+y,C=o+I;for(let R=m+18;mt){let c=this.frames[s],u=this.frames[s+n];return u+(t-c)/(o[r]-c)*(o[r+1]-u)}let a=r+18;for(r+=2;r=t){let c=o[r-2],u=o[r-1];return u+(t-c)/(o[r]-c)*(o[r+1]-u)}s+=this.getFrameEntries();let h=o[a-2],l=o[a-1];return l+(t-h)/(this.frames[s]-h)*(this.frames[s+n]-l)}}class ys extends qs{constructor(e,t,s){super(e,t,[s])}getFrameEntries(){return 2}setFrame(e,t,s){e<<=1,this.frames[e]=t,this.frames[e+1]=s}getCurveValue(e){let t=this.frames,s=t.length-2;for(let r=2;r<=s;r+=2)if(t[r]>e){s=r-2;break}let n=this.curves[s>>1];switch(n){case 0:let r=t[s],o=t[s+1];return o+(e-r)/(t[s+2]-r)*(t[s+2+1]-o);case 1:return t[s+1]}return this.getBezierValue(e,s,1,n-2)}getRelativeValue(e,t,s,n,r){if(e>2];switch(b){case 0:let _=c[g];f=c[g+1],d=c[g+2],m=c[g+3];let M=(n-_)/(c[g+4]-_);f+=(c[g+4+1]-f)*M,d+=(c[g+4+2]-d)*M,m+=(c[g+4+3]-m)*M;break;case 1:f=c[g+1],d=c[g+2],m=c[g+3];break;default:f=this.getBezierValue(n,g,1,b-2),d=this.getBezierValue(n,g,2,b+18-2),m=this.getBezierValue(n,g,3,b+36-2)}if(o==1)u.r=f,u.g=d,u.b=m;else{if(a==we.setup){let _=l.data.color;u.r=_.r,u.g=_.g,u.b=_.b}u.r+=(f-u.r)*o,u.g+=(d-u.g)*o,u.b+=(m-u.b)*o}}}class Oy extends ys{constructor(t,s,n){super(t,s,ht.alpha+"|"+n);A(this,"slotIndex",0);this.slotIndex=n}apply(t,s,n,r,o,a,h){let l=t.slots[this.slotIndex];if(!l.bone.active)return;let c=l.color;if(n>3];switch(y){case 0:let I=c[S];d=c[S+1],m=c[S+2],g=c[S+3],b=c[S+4],_=c[S+5],M=c[S+6],v=c[S+7];let E=(n-I)/(c[S+8]-I);d+=(c[S+8+1]-d)*E,m+=(c[S+8+2]-m)*E,g+=(c[S+8+3]-g)*E,b+=(c[S+8+4]-b)*E,_+=(c[S+8+5]-_)*E,M+=(c[S+8+6]-M)*E,v+=(c[S+8+7]-v)*E;break;case 1:d=c[S+1],m=c[S+2],g=c[S+3],b=c[S+4],_=c[S+5],M=c[S+6],v=c[S+7];break;default:d=this.getBezierValue(n,S,1,y-2),m=this.getBezierValue(n,S,2,y+18-2),g=this.getBezierValue(n,S,3,y+36-2),b=this.getBezierValue(n,S,4,y+54-2),_=this.getBezierValue(n,S,5,y+72-2),M=this.getBezierValue(n,S,6,y+90-2),v=this.getBezierValue(n,S,7,y+108-2)}if(o==1)u.set(d,m,g,b),f.r=_,f.g=M,f.b=v;else{if(a==we.setup){u.setFromColor(l.data.color);let I=l.data.darkColor;f.r=I.r,f.g=I.g,f.b=I.b}u.add((d-u.r)*o,(m-u.g)*o,(g-u.b)*o,(b-u.a)*o),f.r+=(_-f.r)*o,f.g+=(M-f.g)*o,f.b+=(v-f.b)*o}}}class Ly extends qs{constructor(t,s,n){super(t,s,[ht.rgb+"|"+n,ht.rgb2+"|"+n]);A(this,"slotIndex",0);this.slotIndex=n}getFrameEntries(){return 7}setFrame(t,s,n,r,o,a,h,l){t*=7,this.frames[t]=s,this.frames[t+1]=n,this.frames[t+2]=r,this.frames[t+3]=o,this.frames[t+4]=a,this.frames[t+5]=h,this.frames[t+6]=l}apply(t,s,n,r,o,a,h){let l=t.slots[this.slotIndex];if(!l.bone.active)return;let c=this.frames,u=l.color,f=l.darkColor;if(nt){let l=this.frames[s];return n[r+1]*(t-l)/(n[r]-l)}let o=r+18;for(r+=2;r=t){let l=n[r-2],c=n[r-1];return c+(t-l)/(n[r]-l)*(n[r+1]-c)}let a=n[o-2],h=n[o-1];return h+(1-h)*(t-a)/(this.frames[s+this.getFrameEntries()]-a)}apply(t,s,n,r,o,a,h){let l=t.slots[this.slotIndex];if(!l.bone.active)return;let c=l.getAttachment();if(!c||!(c instanceof vs)||c.timelineAttachment!=this.attachment)return;let u=l.deform;u.length==0&&(a=we.setup);let f=this.vertices,d=f[0].length,m=this.frames;if(n=m[m.length-1]){let S=f[m.length-1];if(o==1)if(a==we.add){let y=c;if(y.bones)for(let I=0;In)this.apply(t,s,Number.MAX_VALUE,r,o,a,h),s=-1;else if(s>=l[c-1])return;if(n0&&l[u-1]==f;)u--}for(;u=l[u];u++)r.push(this.events[u])}};A(lh,"propertyIds",[""+ht.event]);let va=lh;const hh=class hh extends Xt{constructor(t){super(t,hh.propertyIds);A(this,"drawOrders");this.drawOrders=new Array(t)}getFrameCount(){return this.frames.length}setFrame(t,s,n){this.frames[t]=s,this.drawOrders[t]=n}apply(t,s,n,r,o,a,h){if(h==xi.mixOut){a==we.setup&&Fe.arrayCopy(t.slots,0,t.drawOrder,0,t.slots.length);return}if(n>2];switch(g){case 0:let b=c[m];u=c[m+1],f=c[m+2],d=c[m+3];let _=(n-b)/(c[m+4]-b);u+=(c[m+4+1]-u)*_,f+=(c[m+4+2]-f)*_,d+=(c[m+4+3]-d)*_;break;case 1:u=c[m+1],f=c[m+2],d=c[m+3];break;default:u=this.getBezierValue(n,m,1,g-2),f=this.getBezierValue(n,m,2,g+18-2),d=this.getBezierValue(n,m,3,g+36-2)}if(a==we.setup){let b=l.data;l.mixRotate=b.mixRotate+(u-b.mixRotate)*o,l.mixX=b.mixX+(f-b.mixX)*o,l.mixY=b.mixY+(d-b.mixY)*o}else l.mixRotate+=(u-l.mixRotate)*o,l.mixX+=(f-l.mixX)*o,l.mixY+=(d-l.mixY)*o}}class Rr extends ys{constructor(t,s,n,r){super(t,s,r+"|"+n);A(this,"constraintIndex",0);this.constraintIndex=n}apply(t,s,n,r,o,a,h){let l;if(this.constraintIndex==-1){const c=n>=this.frames[0]?this.getCurveValue(n):0;for(const u of t.physicsConstraints)u.active&&this.global(u.data)&&this.set(u,this.getAbsoluteValue2(n,o,a,this.get(u),this.setup(u),c))}else l=t.physicsConstraints[this.constraintIndex],l.active&&this.set(l,this.getAbsoluteValue(n,o,a,this.get(l),this.setup(l)))}}class $y extends Rr{constructor(e,t,s){super(e,t,s,ht.physicsConstraintInertia)}setup(e){return e.data.inertia}get(e){return e.inertia}set(e,t){e.inertia=t}global(e){return e.inertiaGlobal}}class Gy extends Rr{constructor(e,t,s){super(e,t,s,ht.physicsConstraintStrength)}setup(e){return e.data.strength}get(e){return e.strength}set(e,t){e.strength=t}global(e){return e.strengthGlobal}}class jy extends Rr{constructor(e,t,s){super(e,t,s,ht.physicsConstraintDamping)}setup(e){return e.data.damping}get(e){return e.damping}set(e,t){e.damping=t}global(e){return e.dampingGlobal}}class Hy extends Rr{constructor(e,t,s){super(e,t,s,ht.physicsConstraintMass)}setup(e){return 1/e.data.massInverse}get(e){return 1/e.massInverse}set(e,t){e.massInverse=1/t}global(e){return e.massGlobal}}class Wy extends Rr{constructor(e,t,s){super(e,t,s,ht.physicsConstraintWind)}setup(e){return e.data.wind}get(e){return e.wind}set(e,t){e.wind=t}global(e){return e.windGlobal}}class zy extends Rr{constructor(e,t,s){super(e,t,s,ht.physicsConstraintGravity)}setup(e){return e.data.gravity}get(e){return e.gravity}set(e,t){e.gravity=t}global(e){return e.gravityGlobal}}class qy extends Rr{constructor(e,t,s){super(e,t,s,ht.physicsConstraintMix)}setup(e){return e.data.mix}get(e){return e.mix}set(e,t){e.mix=t}global(e){return e.mixGlobal}}const ch=class ch extends Xt{constructor(t,s){super(t,ch.propertyIds);A(this,"constraintIndex");this.constraintIndex=s}getFrameCount(){return this.frames.length}setFrame(t,s){this.frames[t]=s}apply(t,s,n,r,o,a,h){let l;if(this.constraintIndex!=-1&&(l=t.physicsConstraints[this.constraintIndex],!l.active))return;const c=this.frames;if(s>n)this.apply(t,s,Number.MAX_VALUE,[],o,a,h),s=-1;else if(s>=c[c.length-1])return;if(!(n=c[Xt.search1(c,s)+1]))if(l!=null)l.reset();else for(const u of t.physicsConstraints)u.active&&u.reset()}};A(ch,"propertyIds",[ht.physicsConstraintReset.toString()]);let Jl=ch;const ji=class ji extends Xt{constructor(t,s,n){super(t,[ht.sequence+"|"+s+"|"+n.sequence.id]);A(this,"slotIndex");A(this,"attachment");this.slotIndex=s,this.attachment=n}getFrameEntries(){return ji.ENTRIES}getSlotIndex(){return this.slotIndex}getAttachment(){return this.attachment}setFrame(t,s,n,r,o){let a=this.frames;t*=ji.ENTRIES,a[t]=s,a[t+ji.MODE]=n|r<<4,a[t+ji.DELAY]=o}apply(t,s,n,r,o,a,h){let l=t.slots[this.slotIndex];if(!l.bone.active)return;let c=l.attachment,u=this.attachment;if(c!=u&&(!(c instanceof vs)||c.timelineAttachment!=u))return;if(h==xi.mixOut){a==we.setup&&(l.sequenceIndex=-1);return}let f=this.frames;if(n>4,M=this.attachment.sequence.regions.length,v=wy[g&15];if(v!=fi.hold)switch(_+=(n-m)/b+1e-5|0,v){case fi.once:_=Math.min(M-1,_);break;case fi.loop:_%=M;break;case fi.pingpong:{let S=(M<<1)-2;_=S==0?0:_%S,_>=M&&(_=S-_);break}case fi.onceReverse:_=Math.max(M-1-_,0);break;case fi.loopReverse:_=M-1-_%M;break;case fi.pingpongReverse:{let S=(M<<1)-2;_=S==0?0:(_+M-1)%S,_>=M&&(_=S-_)}}l.sequenceIndex=_}};A(ji,"ENTRIES",3),A(ji,"MODE",1),A(ji,"DELAY",2);let Ql=ji;const eo=class eo{constructor(e){A(this,"data");A(this,"tracks",new Array);A(this,"timeScale",1);A(this,"unkeyedState",0);A(this,"events",new Array);A(this,"listeners",new Array);A(this,"queue",new BE(this));A(this,"propertyIDs",new xy);A(this,"animationsChanged",!1);A(this,"trackEntryPool",new zl(()=>new OE));this.data=e}static emptyAnimation(){return eo._emptyAnimation}update(e){e*=this.timeScale;let t=this.tracks;for(let s=0,n=t.length;s0){if(r.delay-=o,r.delay>0)continue;o=-r.delay,r.delay=0}let a=r.next;if(a){let h=r.trackLast-a.delay;if(h>=0){for(a.delay=0,a.trackTime+=r.timeScale==0?0:(h/r.timeScale+e)*a.timeScale,r.trackTime+=o,this.setCurrent(s,a,!0);a.mixingFrom;)a.mixTime+=e,a=a.mixingFrom;continue}}else if(r.trackLast>=r.trackEnd&&!r.mixingFrom){t[s]=null,this.queue.end(r),this.clearNext(r);continue}if(r.mixingFrom&&this.updateMixingFrom(r,e)){let h=r.mixingFrom;for(r.mixingFrom=null,h&&(h.mixingTo=null);h;)this.queue.end(h),h=h.mixingFrom}r.trackTime+=o}this.queue.drain()}updateMixingFrom(e,t){let s=e.mixingFrom;if(!s)return!0;let n=this.updateMixingFrom(s,t);return s.animationLast=s.nextAnimationLast,s.trackLast=s.nextTrackLast,e.nextTrackLast!=-1&&e.mixTime>=e.mixDuration?((s.totalAlpha==0||e.mixDuration==0)&&(e.mixingFrom=s.mixingFrom,s.mixingFrom!=null&&(s.mixingFrom.mixingTo=e),e.interruptAlpha=s.interruptAlpha,this.queue.end(s)),n):(s.trackTime+=t*s.timeScale,e.mixTime+=t,!1)}apply(e){if(!e)throw new Error("skeleton cannot be null.");this.animationsChanged&&this._animationsChanged();let t=this.events,s=this.tracks,n=!1;for(let f=0,d=s.length;f0)continue;n=!0;let g=f==0?we.first:m.mixBlend,b=m.alpha;m.mixingFrom?b*=this.applyMixingFrom(m,e,g):m.trackTime>=m.trackEnd&&!m.next&&(b=0);let _=b>=m.alphaAttachmentThreshold,M=m.animationLast,v=m.getAnimationTime(),S=v,y=t;m.reverse&&(S=m.animation.duration-S,y=null);let I=m.animation.timelines,E=I.length;if(f==0&&b==1||g==we.add){f==0&&(_=!0);for(let C=0;C1&&(r=1),s!=we.first&&(s=n.mixBlend));let o=r=n.alphaAttachmentThreshold):(a&&y instanceof br&&E==we.setup&&(I=xi.mixIn),y.apply(t,f,m,g,C,E,I))}}return e.mixDuration>0&&this.queueEvents(n,d),this.events.length=0,n.nextAnimationLast=d,n.nextTrackLast=n.trackTime,r}applyAttachmentTimeline(e,t,s,n,r){var o=t.slots[e.slotIndex];o.bone.active&&(s=0,v=g>=0;Math.abs(b)<=90&&ke.signum(b)!=ke.signum(m)&&(Math.abs(g-_)>180?(d+=360*ke.signum(g),v=M):_!=0?d-=360*ke.signum(g):v=M),v!=M&&(d+=360*ke.signum(g)),o[a]=d}o[a+1]=m,l.rotation=u+d*n}queueEvents(e,t){let s=e.animationStart,n=e.animationEnd,r=n-s,o=e.trackLast%r,a=this.events,h=0,l=a.length;for(;hn||this.queue.event(e,u)}let c=!1;if(e.loop)if(r==0)c=!0;else{const u=Math.floor(e.trackTime/r);c=u>0&&u>Math.floor(e.trackLast/r)}else c=t>=n&&e.animationLast=this.tracks.length)return;let t=this.tracks[e];if(!t)return;this.queue.end(t),this.clearNext(t);let s=t;for(;;){let n=s.mixingFrom;if(!n)break;this.queue.end(n),s.mixingFrom=null,s.mixingTo=null,s=n}this.tracks[t.trackIndex]=null,this.queue.drain()}setCurrent(e,t,s){let n=this.expandToIndex(e);this.tracks[e]=t,t.previous=null,n&&(s&&this.queue.interrupt(n),t.mixingFrom=n,n.mixingTo=t,t.mixTime=0,n.mixingFrom&&n.mixDuration>0&&(t.interruptAlpha*=Math.min(1,n.mixTime/n.mixDuration)),n.timelinesRotation.length=0),this.queue.start(t)}setAnimation(e,t,s=!1){let n=this.data.skeletonData.findAnimation(t);if(!n)throw new Error("Animation not found: "+t);return this.setAnimationWith(e,n,s)}setAnimationWith(e,t,s=!1){if(!t)throw new Error("animation cannot be null.");let n=!0,r=this.expandToIndex(e);r&&(r.nextTrackLast==-1?(this.tracks[e]=r.mixingFrom,this.queue.interrupt(r),this.queue.end(r),this.clearNext(r),r=r.mixingFrom,n=!1):this.clearNext(r));let o=this.trackEntry(e,t,s,r);return this.setCurrent(e,o,n),this.queue.drain(),o}addAnimation(e,t,s=!1,n=0){let r=this.data.skeletonData.findAnimation(t);if(!r)throw new Error("Animation not found: "+t);return this.addAnimationWith(e,r,s,n)}addAnimationWith(e,t,s=!1,n=0){if(!t)throw new Error("animation cannot be null.");let r=this.expandToIndex(e);if(r)for(;r.next;)r=r.next;let o=this.trackEntry(e,t,s,r);return r?(r.next=o,o.previous=r,n<=0&&(n=Math.max(n+r.getTrackComplete()-o.mixDuration,0))):(this.setCurrent(e,o,!0),this.queue.drain(),n<0&&(n=0)),o.delay=n,o}setEmptyAnimation(e,t=0){let s=this.setAnimationWith(e,eo.emptyAnimation(),!1);return s.mixDuration=t,s.trackEnd=t,s}addEmptyAnimation(e,t=0,s=0){let n=this.addAnimationWith(e,eo.emptyAnimation(),!1,s);return s<=0&&(n.delay=Math.max(n.delay+n.mixDuration-t,0)),n.mixDuration=t,n.trackEnd=t,n}setEmptyAnimations(e=0){let t=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(let s=0,n=this.tracks.length;s0){r[h]=LE,o[h]=u;continue e}break}r[h]=Tu}}}getCurrent(e){return e>=this.tracks.length?null:this.tracks[e]}addListener(e){if(!e)throw new Error("listener cannot be null.");this.listeners.push(e)}removeListener(e){let t=this.listeners.indexOf(e);t>=0&&this.listeners.splice(t,1)}clearListeners(){this.listeners.length=0}clearListenerNotifications(){this.queue.clear()}};A(eo,"_emptyAnimation",new df("",[],0));let Td=eo;class OE{constructor(){A(this,"animation",null);A(this,"previous",null);A(this,"next",null);A(this,"mixingFrom",null);A(this,"mixingTo",null);A(this,"listener",null);A(this,"trackIndex",0);A(this,"loop",!1);A(this,"holdPrevious",!1);A(this,"reverse",!1);A(this,"shortestRotation",!1);A(this,"eventThreshold",0);A(this,"mixAttachmentThreshold",0);A(this,"alphaAttachmentThreshold",0);A(this,"mixDrawOrderThreshold",0);A(this,"animationStart",0);A(this,"animationEnd",0);A(this,"animationLast",0);A(this,"nextAnimationLast",0);A(this,"delay",0);A(this,"trackTime",0);A(this,"trackLast",0);A(this,"nextTrackLast",0);A(this,"trackEnd",0);A(this,"timeScale",0);A(this,"alpha",0);A(this,"mixTime",0);A(this,"_mixDuration",0);A(this,"interruptAlpha",0);A(this,"totalAlpha",0);A(this,"mixBlend",we.replace);A(this,"timelineMode",new Array);A(this,"timelineHoldMix",new Array);A(this,"timelinesRotation",new Array)}get mixDuration(){return this._mixDuration}set mixDuration(e){this._mixDuration=e}setMixDurationWithDelay(e,t){this._mixDuration=e,t<=0&&(this.previous!=null?t=Math.max(t+this.previous.getTrackComplete()-e,0):t=0),this.delay=t}reset(){this.next=null,this.previous=null,this.mixingFrom=null,this.mixingTo=null,this.animation=null,this.listener=null,this.timelineMode.length=0,this.timelineHoldMix.length=0,this.timelinesRotation.length=0}getAnimationTime(){if(this.loop){let e=this.animationEnd-this.animationStart;return e==0?this.animationStart:this.trackTime%e+this.animationStart}return Math.min(this.trackTime+this.animationStart,this.animationEnd)}setAnimationLast(e){this.animationLast=e,this.nextAnimationLast=e}isComplete(){return this.trackTime>=this.animationEnd-this.animationStart}resetRotationDirections(){this.timelinesRotation.length=0}getTrackComplete(){let e=this.animationEnd-this.animationStart;if(e!=0){if(this.loop)return e*(1+(this.trackTime/e|0));if(this.trackTime=0}}class BE{constructor(e){A(this,"objects",[]);A(this,"drainDisabled",!1);A(this,"animState");this.animState=e}start(e){this.objects.push(Ci.start),this.objects.push(e),this.animState.animationsChanged=!0}interrupt(e){this.objects.push(Ci.interrupt),this.objects.push(e)}end(e){this.objects.push(Ci.end),this.objects.push(e),this.animState.animationsChanged=!0}dispose(e){this.objects.push(Ci.dispose),this.objects.push(e)}complete(e){this.objects.push(Ci.complete),this.objects.push(e)}event(e,t){this.objects.push(Ci.event),this.objects.push(e),this.objects.push(t)}drain(){if(this.drainDisabled)return;this.drainDisabled=!0;let e=this.objects;for(let t=0;t{c.width=parseInt(s[1]),c.height=parseInt(s[2])},n.format=()=>{},n.filter=c=>{c.minFilter=Fe.enumValue(hi,s[1]),c.magFilter=Fe.enumValue(hi,s[2])},n.repeat=c=>{s[1].indexOf("x")!=-1&&(c.uWrap=yn.Repeat),s[1].indexOf("y")!=-1&&(c.vWrap=yn.Repeat)},n.pma=c=>{c.pma=s[1]=="true"};var r={};r.xy=c=>{c.x=parseInt(s[1]),c.y=parseInt(s[2])},r.size=c=>{c.width=parseInt(s[1]),c.height=parseInt(s[2])},r.bounds=c=>{c.x=parseInt(s[1]),c.y=parseInt(s[2]),c.width=parseInt(s[3]),c.height=parseInt(s[4])},r.offset=c=>{c.offsetX=parseInt(s[1]),c.offsetY=parseInt(s[2])},r.orig=c=>{c.originalWidth=parseInt(s[1]),c.originalHeight=parseInt(s[2])},r.offsets=c=>{c.offsetX=parseInt(s[1]),c.offsetY=parseInt(s[2]),c.originalWidth=parseInt(s[3]),c.originalHeight=parseInt(s[4])},r.rotate=c=>{let u=s[1];u=="true"?c.degrees=90:u!="false"&&(c.degrees=parseInt(u))},r.index=c=>{c.index=parseInt(s[1])};let o=t.readLine();for(;o&&o.trim().length==0;)o=t.readLine();for(;!(!o||o.trim().length==0||t.readEntry(s,o)==0);)o=t.readLine();let a=null,h=null,l=null;for(;o!==null;)if(o.trim().length==0)a=null,o=t.readLine();else if(a){let c=new Zy(a,o);for(;;){let u=t.readEntry(s,o=t.readLine());if(u==0)break;let f=r[s[0]];if(f)f(c);else{h||(h=[]),l||(l=[]),h.push(s[0]);let d=[];for(let m=0;m0&&l&&l.length>0&&(c.names=h,c.values=l,h=null,l=null),c.u=c.x/a.width,c.v=c.y/a.height,c.degrees==90?(c.u2=(c.x+c.height)/a.width,c.v2=(c.y+c.width)/a.height):(c.u2=(c.x+c.width)/a.width,c.v2=(c.y+c.height)/a.height),this.regions.push(c)}else{for(a=new YE(o.trim());t.readEntry(s,o=t.readLine())!=0;){let c=n[s[0]];c&&c(a)}this.pages.push(a)}}findRegion(e){for(let t=0;t=this.lines.length?null:this.lines[this.index++]}readEntry(e,t){if(!t||(t=t.trim(),t.length==0))return 0;let s=t.indexOf(":");if(s==-1)return 0;e[0]=t.substr(0,s).trim();for(let n=1,r=s+1;;n++){let o=t.indexOf(",",r);if(o==-1)return e[n]=t.substr(r).trim(),n;if(e[n]=t.substr(r,o-r).trim(),r=o+1,n==4)return 4}}}class YE{constructor(e){A(this,"name");A(this,"minFilter",hi.Nearest);A(this,"magFilter",hi.Nearest);A(this,"uWrap",yn.ClampToEdge);A(this,"vWrap",yn.ClampToEdge);A(this,"texture",null);A(this,"width",0);A(this,"height",0);A(this,"pma",!1);A(this,"regions",new Array);this.name=e}setTexture(e){this.texture=e,e.setFilters(this.minFilter,this.magFilter),e.setWraps(this.uWrap,this.vWrap);for(let t of this.regions)t.texture=e}}class Zy extends VE{constructor(t,s){super();A(this,"page");A(this,"name");A(this,"x",0);A(this,"y",0);A(this,"offsetX",0);A(this,"offsetY",0);A(this,"originalWidth",0);A(this,"originalHeight",0);A(this,"index",0);A(this,"degrees",0);A(this,"names",null);A(this,"values",null);this.page=t,this.name=s,t.regions.push(this)}}class Zn extends vs{constructor(t,s){super(t);A(this,"region",null);A(this,"path");A(this,"regionUVs",[]);A(this,"uvs",[]);A(this,"triangles",[]);A(this,"color",new ot(1,1,1,1));A(this,"width",0);A(this,"height",0);A(this,"hullLength",0);A(this,"edges",[]);A(this,"parentMesh",null);A(this,"sequence",null);A(this,"tempColor",new ot(0,0,0,0));this.path=s}updateRegion(){if(!this.region)throw new Error("Region not set.");let t=this.regionUVs;(!this.uvs||this.uvs.length!=t.length)&&(this.uvs=Fe.newFloatArray(t.length));let s=this.uvs,n=this.uvs.length,r=this.region.u,o=this.region.v,a=0,h=0;if(this.region instanceof Zy){let l=this.region,c=l.page,u=c.width,f=c.height;switch(l.degrees){case 90:r-=(l.originalHeight-l.offsetY-l.height)/u,o-=(l.originalWidth-l.offsetX-l.width)/f,a=l.originalHeight/u,h=l.originalWidth/f;for(let d=0;d= 0.");if(!t)throw new Error("name cannot be null.");this.index=e,this.name=t,this.parent=s}}var jt;(function(i){i[i.Normal=0]="Normal",i[i.OnlyTranslation=1]="OnlyTranslation",i[i.NoRotationOrReflection=2]="NoRotationOrReflection",i[i.NoScale=3]="NoScale",i[i.NoScaleOrReflection=4]="NoScaleOrReflection"})(jt||(jt={}));class hg{constructor(e,t,s){A(this,"data");A(this,"skeleton");A(this,"parent",null);A(this,"children",new Array);A(this,"x",0);A(this,"y",0);A(this,"rotation",0);A(this,"scaleX",0);A(this,"scaleY",0);A(this,"shearX",0);A(this,"shearY",0);A(this,"ax",0);A(this,"ay",0);A(this,"arotation",0);A(this,"ascaleX",0);A(this,"ascaleY",0);A(this,"ashearX",0);A(this,"ashearY",0);A(this,"a",0);A(this,"b",0);A(this,"c",0);A(this,"d",0);A(this,"worldY",0);A(this,"worldX",0);A(this,"inherit",jt.Normal);A(this,"sorted",!1);A(this,"active",!1);if(!e)throw new Error("data cannot be null.");if(!t)throw new Error("skeleton cannot be null.");this.data=e,this.skeleton=t,this.parent=s,this.setToSetupPose()}isActive(){return this.active}update(e){this.updateWorldTransformWith(this.ax,this.ay,this.arotation,this.ascaleX,this.ascaleY,this.ashearX,this.ashearY)}updateWorldTransform(){this.updateWorldTransformWith(this.x,this.y,this.rotation,this.scaleX,this.scaleY,this.shearX,this.shearY)}updateWorldTransformWith(e,t,s,n,r,o,a){this.ax=e,this.ay=t,this.arotation=s,this.ascaleX=n,this.ascaleY=r,this.ashearX=o,this.ashearY=a;let h=this.parent;if(!h){let d=this.skeleton;const m=d.scaleX,g=d.scaleY,b=(s+o)*ke.degRad,_=(s+90+a)*ke.degRad;this.a=Math.cos(b)*n*m,this.b=Math.cos(_)*r*m,this.c=Math.sin(b)*n*g,this.d=Math.sin(_)*r*g,this.worldX=e*m+d.x,this.worldY=t*g+d.y;return}let l=h.a,c=h.b,u=h.c,f=h.d;switch(this.worldX=l*e+c*t+h.worldX,this.worldY=u*e+f*t+h.worldY,this.inherit){case jt.Normal:{const d=(s+o)*ke.degRad,m=(s+90+a)*ke.degRad,g=Math.cos(d)*n,b=Math.cos(m)*r,_=Math.sin(d)*n,M=Math.sin(m)*r;this.a=l*g+c*_,this.b=l*b+c*M,this.c=u*g+f*_,this.d=u*b+f*M;return}case jt.OnlyTranslation:{const d=(s+o)*ke.degRad,m=(s+90+a)*ke.degRad;this.a=Math.cos(d)*n,this.b=Math.cos(m)*r,this.c=Math.sin(d)*n,this.d=Math.sin(m)*r;break}case jt.NoRotationOrReflection:{let d=1/this.skeleton.scaleX,m=1/this.skeleton.scaleY;l*=d,u*=m;let g=l*l+u*u,b=0;g>1e-4?(g=Math.abs(l*f*m-c*d*u)/g,c=u*g,f=l*g,b=Math.atan2(u,l)*ke.radDeg):(l=0,u=0,b=90-Math.atan2(f,c)*ke.radDeg);const _=(s+o-b)*ke.degRad,M=(s+a-b+90)*ke.degRad,v=Math.cos(_)*n,S=Math.cos(M)*r,y=Math.sin(_)*n,I=Math.sin(M)*r;this.a=l*v-c*y,this.b=l*S-c*I,this.c=u*v+f*y,this.d=u*S+f*I;break}case jt.NoScale:case jt.NoScaleOrReflection:{s*=ke.degRad;const d=Math.cos(s),m=Math.sin(s);let g=(l*d+c*m)/this.skeleton.scaleX,b=(u*d+f*m)/this.skeleton.scaleY,_=Math.sqrt(g*g+b*b);_>1e-5&&(_=1/_),g*=_,b*=_,_=Math.sqrt(g*g+b*b),this.inherit==jt.NoScale&&l*f-c*u<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY<0)&&(_=-_),s=Math.PI/2+Math.atan2(b,g);const M=Math.cos(s)*_,v=Math.sin(s)*_;o*=ke.degRad,a=(90+a)*ke.degRad;const S=Math.cos(o)*n,y=Math.cos(a)*r,I=Math.sin(o)*n,E=Math.sin(a)*r;this.a=g*S+M*I,this.b=g*y+M*E,this.c=b*S+v*I,this.d=b*y+v*E;break}}this.a*=this.skeleton.scaleX,this.b*=this.skeleton.scaleX,this.c*=this.skeleton.scaleY,this.d*=this.skeleton.scaleY}setToSetupPose(){let e=this.data;this.x=e.x,this.y=e.y,this.rotation=e.rotation,this.scaleX=e.scaleX,this.scaleY=e.scaleY,this.shearX=e.shearX,this.shearY=e.shearY,this.inherit=e.inherit}updateAppliedTransform(){let e=this.parent;if(!e){this.ax=this.worldX-this.skeleton.x,this.ay=this.worldY-this.skeleton.y,this.arotation=Math.atan2(this.c,this.a)*ke.radDeg,this.ascaleX=Math.sqrt(this.a*this.a+this.c*this.c),this.ascaleY=Math.sqrt(this.b*this.b+this.d*this.d),this.ashearX=0,this.ashearY=Math.atan2(this.a*this.b+this.c*this.d,this.a*this.d-this.b*this.c)*ke.radDeg;return}let t=e.a,s=e.b,n=e.c,r=e.d,o=1/(t*r-s*n),a=r*o,h=s*o,l=n*o,c=t*o,u=this.worldX-e.worldX,f=this.worldY-e.worldY;this.ax=u*a-f*h,this.ay=f*c-u*l;let d,m,g,b;if(this.inherit==jt.OnlyTranslation)d=this.a,m=this.b,g=this.c,b=this.d;else{switch(this.inherit){case jt.NoRotationOrReflection:{let y=Math.abs(t*r-s*n)/(t*t+n*n);s=-n*this.skeleton.scaleX*y/this.skeleton.scaleY,r=t*this.skeleton.scaleY*y/this.skeleton.scaleX,o=1/(t*r-s*n),a=r*o,h=s*o;break}case jt.NoScale:case jt.NoScaleOrReflection:let _=ke.cosDeg(this.rotation),M=ke.sinDeg(this.rotation);t=(t*_+s*M)/this.skeleton.scaleX,n=(n*_+r*M)/this.skeleton.scaleY;let v=Math.sqrt(t*t+n*n);v>1e-5&&(v=1/v),t*=v,n*=v,v=Math.sqrt(t*t+n*n),this.inherit==jt.NoScale&&o<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY<0)&&(v=-v);let S=ke.PI/2+Math.atan2(n,t);s=Math.cos(S)*v,r=Math.sin(S)*v,o=1/(t*r-s*n),a=r*o,h=s*o,l=n*o,c=t*o}d=a*this.a-h*this.c,m=a*this.b-h*this.d,g=c*this.c-l*this.a,b=c*this.d-l*this.b}if(this.ashearX=0,this.ascaleX=Math.sqrt(d*d+g*g),this.ascaleX>1e-4){let _=d*b-m*g;this.ascaleY=_/this.ascaleX,this.ashearY=-Math.atan2(d*m+g*b,_)*ke.radDeg,this.arotation=Math.atan2(g,d)*ke.radDeg}else this.ascaleX=0,this.ascaleY=Math.sqrt(m*m+b*b),this.ashearY=0,this.arotation=90-Math.atan2(b,m)*ke.radDeg}getWorldRotationX(){return Math.atan2(this.c,this.a)*ke.radDeg}getWorldRotationY(){return Math.atan2(this.d,this.b)*ke.radDeg}getWorldScaleX(){return Math.sqrt(this.a*this.a+this.c*this.c)}getWorldScaleY(){return Math.sqrt(this.b*this.b+this.d*this.d)}worldToLocal(e){let t=1/(this.a*this.d-this.b*this.c),s=e.x-this.worldX,n=e.y-this.worldY;return e.x=s*this.d*t-n*this.b*t,e.y=n*this.a*t-s*this.c*t,e}localToWorld(e){let t=e.x,s=e.y;return e.x=t*this.a+s*this.b+this.worldX,e.y=t*this.c+s*this.d+this.worldY,e}worldToParent(e){if(e==null)throw new Error("world cannot be null.");return this.parent==null?e:this.parent.worldToLocal(e)}parentToWorld(e){if(e==null)throw new Error("world cannot be null.");return this.parent==null?e:this.parent.localToWorld(e)}worldToLocalRotation(e){let t=ke.sinDeg(e),s=ke.cosDeg(e);return Math.atan2(this.a*t-this.c*s,this.d*s-this.b*t)*ke.radDeg+this.rotation-this.shearX}localToWorldRotation(e){e-=this.rotation-this.shearX;let t=ke.sinDeg(e),s=ke.cosDeg(e);return Math.atan2(s*this.c+t*this.d,s*this.a+t*this.b)*ke.radDeg}rotateWorld(e){e*=ke.degRad;const t=Math.sin(e),s=Math.cos(e),n=this.a,r=this.b;this.a=s*n-t*this.c,this.b=s*r-t*this.d,this.c=t*n+s*this.c,this.d=t*r+s*this.d}}class Uh{constructor(e,t,s){A(this,"name");A(this,"order");A(this,"skinRequired");this.name=e,this.order=t,this.skinRequired=s}}let Qy=class{constructor(e,t){A(this,"data");A(this,"intValue",0);A(this,"floatValue",0);A(this,"stringValue",null);A(this,"time",0);A(this,"volume",0);A(this,"balance",0);if(!t)throw new Error("data cannot be null.");this.time=e,this.data=t}};class ex{constructor(e){A(this,"name");A(this,"intValue",0);A(this,"floatValue",0);A(this,"stringValue",null);A(this,"audioPath",null);A(this,"volume",0);A(this,"balance",0);this.name=e}}class $E{constructor(e,t){A(this,"data");A(this,"bones");A(this,"target");A(this,"bendDirection",0);A(this,"compress",!1);A(this,"stretch",!1);A(this,"mix",1);A(this,"softness",0);A(this,"active",!1);if(!e)throw new Error("data cannot be null.");if(!t)throw new Error("skeleton cannot be null.");this.data=e,this.bones=new Array;for(let n=0;n180?d-=360:d<-180&&(d+=360);let b=e.ascaleX,_=e.ascaleY;if(n||r){switch(e.inherit){case jt.NoScale:case jt.NoScaleOrReflection:m=t-e.worldX,g=s-e.worldY}const M=e.data.length*b;if(M>1e-4){const v=m*m+g*g;if(n&&vM*M){const S=(Math.sqrt(v)/M-1)*a+1;b*=S,o&&(_*=S)}}}e.updateWorldTransformWith(e.ax,e.ay,e.arotation+d*a,b,_,e.ashearX,e.ashearY)}apply2(e,t,s,n,r,o,a,h,l){if(e.inherit!=jt.Normal||t.inherit!=jt.Normal)return;let c=e.ax,u=e.ay,f=e.ascaleX,d=e.ascaleY,m=f,g=d,b=t.ascaleX,_=0,M=0,v=0;f<0?(f=-f,_=180,v=-1):(_=0,v=1),d<0&&(d=-d,v=-v),b<0?(b=-b,M=180):M=0;let S=t.ax,y=0,I=0,E=0,C=e.a,R=e.b,B=e.c,k=e.d,F=Math.abs(f-d)<=1e-4;!F||o?(y=0,I=C*S+e.worldX,E=B*S+e.worldY):(y=t.ay,I=C*S+R*y+e.worldX,E=B*S+k*y+e.worldY);let D=e.parent;if(!D)throw new Error("IK parent must itself have a parent.");C=D.a,R=D.b,B=D.c,k=D.d;let N=C*k-R*B,j=I-D.worldX,O=E-D.worldY;N=Math.abs(N)<=1e-4?0:1/N;let L=(j*k-O*R)*N-c,P=(O*C-j*B)*N-u,X=Math.sqrt(L*L+P*P),U=t.data.length*b,Y,q;if(X<1e-4){this.apply1(e,s,n,!1,o,!1,l),t.updateWorldTransformWith(S,y,0,t.ascaleX,t.ascaleY,t.ashearX,t.ashearY);return}j=s-D.worldX,O=n-D.worldY;let z=(j*k-O*R)*N-c,ne=(O*C-j*B)*N-u,H=z*z+ne*ne;if(h!=0){h*=f*(b+1)*.5;let me=Math.sqrt(H),_e=me-X-U*f+h;if(_e>0){let te=Math.min(1,_e/(h*2))-1;te=(_e-h*(1-te*te))/me,z-=te*z,ne-=te*ne,H=z*z+ne*ne}}e:if(F){U*=f;let me=(H-X*X-U*U)/(2*X*U);me<-1?(me=-1,q=Math.PI*r):me>1?(me=1,q=0,o&&(C=(Math.sqrt(H)/(X+U)-1)*l+1,m*=C,a&&(g*=C))):q=Math.acos(me)*r,C=X+U*me,R=U*Math.sin(q),Y=Math.atan2(ne*C-z*R,z*C+ne*R)}else{C=f*U,R=d*U;let me=C*C,_e=R*R,te=Math.atan2(ne,z);B=_e*X*X+me*H-me*_e;let ve=-2*_e*X,$=_e-me;if(k=ve*ve-4*$*B,k>=0){let de=Math.sqrt(k);ve<0&&(de=-de),de=-(ve+de)*.5;let De=de/$,Ie=B/de,Be=Math.abs(De)=0){O=Math.sqrt(De)*r,Y=te-Math.atan2(O,Be),q=Math.atan2(O/d,(Be-X)/f);break e}}let W=ke.PI,J=X-C,Q=J*J,ie=0,ue=0,Se=X+C,Me=Se*Se,Ee=0;B=-C*X/(me-_e),B>=-1&&B<=1&&(B=Math.acos(B),j=C*Math.cos(B)+X,O=R*Math.sin(B),k=j*j+O*O,kMe&&(ue=B,Me=k,Se=j,Ee=O)),H<=(Q+Me)*.5?(Y=te-Math.atan2(ie*r,J),q=W*r):(Y=te-Math.atan2(Ee*r,Se),q=ue*r)}let Z=Math.atan2(y,S)*v,ae=e.arotation;Y=(Y-Z)*ke.radDeg+_-ae,Y>180?Y-=360:Y<-180&&(Y+=360),e.updateWorldTransformWith(c,u,ae+Y*l,m,g,0,0),ae=t.arotation,q=((q+Z)*ke.radDeg-t.ashearX)*v+M-ae,q>180?q-=360:q<-180&&(q+=360),t.updateWorldTransformWith(S,y,ae+q*l,t.ascaleX,t.ascaleY,t.ashearX,t.ashearY)}}class tx extends Uh{constructor(t){super(t,0,!1);A(this,"bones",new Array);A(this,"_target",null);A(this,"bendDirection",0);A(this,"compress",!1);A(this,"stretch",!1);A(this,"uniform",!1);A(this,"mix",0);A(this,"softness",0)}set target(t){this._target=t}get target(){if(this._target)return this._target;throw new Error("BoneData not set.")}}class ix extends Uh{constructor(t){super(t,0,!1);A(this,"bones",new Array);A(this,"_target",null);A(this,"positionMode",Gs.Fixed);A(this,"spacingMode",oi.Fixed);A(this,"rotateMode",wr.Chain);A(this,"offsetRotation",0);A(this,"position",0);A(this,"spacing",0);A(this,"mixRotate",0);A(this,"mixX",0);A(this,"mixY",0)}set target(t){this._target=t}get target(){if(this._target)return this._target;throw new Error("SlotData not set.")}}var Gs;(function(i){i[i.Fixed=0]="Fixed",i[i.Percent=1]="Percent"})(Gs||(Gs={}));var oi;(function(i){i[i.Length=0]="Length",i[i.Fixed=1]="Fixed",i[i.Percent=2]="Percent",i[i.Proportional=3]="Proportional"})(oi||(oi={}));var wr;(function(i){i[i.Tangent=0]="Tangent",i[i.Chain=1]="Chain",i[i.ChainScale=2]="ChainScale"})(wr||(wr={}));const Ni=class Ni{constructor(e,t){A(this,"data");A(this,"bones");A(this,"target");A(this,"position",0);A(this,"spacing",0);A(this,"mixRotate",0);A(this,"mixX",0);A(this,"mixY",0);A(this,"spaces",new Array);A(this,"positions",new Array);A(this,"world",new Array);A(this,"curves",new Array);A(this,"lengths",new Array);A(this,"segments",new Array);A(this,"active",!1);if(!e)throw new Error("data cannot be null.");if(!t)throw new Error("skeleton cannot be null.");this.data=e,this.bones=new Array;for(let n=0,r=e.bones.length;n0){S=u/S*m;for(let I=1;I0?ke.degRad:-.01745329277777778}for(let S=0,y=3;S0){let k=I.a,F=I.b,D=I.c,N=I.d,j=0,O=0,L=0;if(a?j=g[y-1]:f[S+1]==0?j=g[y+2]:j=Math.atan2(B,R),j-=Math.atan2(D,k),v){O=Math.cos(j),L=Math.sin(j);let P=I.data.length;b+=(P*(O*k-L*D)-R)*s,_+=(P*(L*k+O*D)-B)*s}else j+=M;j>ke.PI?j-=ke.PI2:j<-3.1415927&&(j+=ke.PI2),j*=s,O=Math.cos(j),L=Math.sin(j),I.a=O*k-L*D,I.b=O*F-L*N,I.c=L*k+O*D,I.d=L*F+O*N}I.updateAppliedTransform()}}computeWorldPositions(e,t,s){let n=this.target,r=this.position,o=this.spaces,a=Fe.setArraySize(this.positions,t*3+2),h=this.world,l=e.closed,c=e.worldVerticesLength,u=c/6,f=Ni.NONE;if(!e.constantSpeed){let P=e.lengths;u-=l?1:2;let X=P[u];this.data.positionMode==Gs.Percent&&(r*=X);let U;switch(this.data.spacingMode){case oi.Percent:U=X;break;case oi.Proportional:U=X/t;break;default:U=1}h=Fe.setArraySize(this.world,8);for(let Y=0,q=0,z=0;YX){f!=Ni.AFTER&&(f=Ni.AFTER,e.computeWorldVertices(n,c-6,4,h,0,2)),this.addAfterPosition(H-X,h,0,a,q);continue}for(;;z++){let Z=P[z];if(!(H>Z)){if(z==0)H/=Z;else{let ae=P[z-1];H=(H-ae)/(Z-ae)}break}}z!=f&&(f=z,l&&z==u?(e.computeWorldVertices(n,c-4,4,h,0,2),e.computeWorldVertices(n,0,4,h,4,2)):e.computeWorldVertices(n,z*6+2,8,h,0,2)),this.addCurvePosition(H,h[0],h[1],h[2],h[3],h[4],h[5],h[6],h[7],a,q,s||Y>0&&ne==0)}return a}l?(c+=2,h=Fe.setArraySize(this.world,c),e.computeWorldVertices(n,2,c-4,h,0,2),e.computeWorldVertices(n,0,2,h,c-4,2),h[c-2]=h[0],h[c-1]=h[1]):(u--,c-=4,h=Fe.setArraySize(this.world,c),e.computeWorldVertices(n,2,c,h,0,2));let d=Fe.setArraySize(this.curves,u),m=0,g=h[0],b=h[1],_=0,M=0,v=0,S=0,y=0,I=0,E=0,C=0,R=0,B=0,k=0,F=0,D=0,N=0;for(let P=0,X=2;Pm){this.addAfterPosition(z-m,h,c-4,a,X);continue}for(;;U++){let ne=d[U];if(!(z>ne)){if(U==0)z/=ne;else{let H=d[U-1];z=(z-H)/(ne-H)}break}}if(U!=f){f=U;let ne=U*6;for(g=h[ne],b=h[ne+1],_=h[ne+2],M=h[ne+3],v=h[ne+4],S=h[ne+5],y=h[ne+6],I=h[ne+7],E=(g-_*2+v)*.03,C=(b-M*2+S)*.03,R=((_-v)*3-g+y)*.006,B=((M-S)*3-b+I)*.006,k=E*2+R,F=C*2+B,D=(_-g)*.3+E+R*.16666667,N=(M-b)*.3+C+B*.16666667,L=Math.sqrt(D*D+N*N),O[0]=L,ne=1;ne<8;ne++)D+=k,N+=F,k+=R,F+=B,L+=Math.sqrt(D*D+N*N),O[ne]=L;D+=k,N+=F,L+=Math.sqrt(D*D+N*N),O[8]=L,D+=k+R,N+=F+B,L+=Math.sqrt(D*D+N*N),O[9]=L,Y=0}for(z*=L;;Y++){let ne=O[Y];if(!(z>ne)){if(Y==0)z/=ne;else{let H=O[Y-1];z=Y+(z-H)/(ne-H)}break}}this.addCurvePosition(z*.1,g,b,_,M,v,S,y,I,a,X,s||P>0&&q==0)}return a}addBeforePosition(e,t,s,n,r){let o=t[s],a=t[s+1],h=t[s+2]-o,l=t[s+3]-a,c=Math.atan2(l,h);n[r]=o+e*Math.cos(c),n[r+1]=a+e*Math.sin(c),n[r+2]=c}addAfterPosition(e,t,s,n,r){let o=t[s+2],a=t[s+3],h=o-t[s],l=a-t[s+1],c=Math.atan2(l,h);n[r]=o+e*Math.cos(c),n[r+1]=a+e*Math.sin(c),n[r+2]=c}addCurvePosition(e,t,s,n,r,o,a,h,l,c,u,f){if(e==0||isNaN(e)){c[u]=t,c[u+1]=s,c[u+2]=Math.atan2(r-s,n-t);return}let d=e*e,m=d*e,g=1-e,b=g*g,_=b*g,M=g*e,v=M*3,S=g*v,y=v*e,I=t*_+n*S+o*y+h*m,E=s*_+r*S+a*y+l*m;c[u]=I,c[u+1]=E,f&&(e<.001?c[u+2]=Math.atan2(r-s,n-t):c[u+2]=Math.atan2(E-(s*b+r*M*2+a*d),I-(t*b+n*M*2+o*d)))}};A(Ni,"NONE",-1),A(Ni,"BEFORE",-2),A(Ni,"AFTER",-3),A(Ni,"epsilon",1e-5);let Ed=Ni;class GE{constructor(e,t){A(this,"data");A(this,"_bone",null);A(this,"inertia",0);A(this,"strength",0);A(this,"damping",0);A(this,"massInverse",0);A(this,"wind",0);A(this,"gravity",0);A(this,"mix",0);A(this,"_reset",!0);A(this,"ux",0);A(this,"uy",0);A(this,"cx",0);A(this,"cy",0);A(this,"tx",0);A(this,"ty",0);A(this,"xOffset",0);A(this,"xVelocity",0);A(this,"yOffset",0);A(this,"yVelocity",0);A(this,"rotateOffset",0);A(this,"rotateVelocity",0);A(this,"scaleOffset",0);A(this,"scaleVelocity",0);A(this,"active",!1);A(this,"skeleton");A(this,"remaining",0);A(this,"lastTime",0);this.data=e,this.skeleton=t,this.bone=t.bones[e.bone.index],this.inertia=e.inertia,this.strength=e.strength,this.damping=e.damping,this.massInverse=e.massInverse,this.wind=e.wind,this.gravity=e.gravity,this.mix=e.mix}set bone(e){this._bone=e}get bone(){if(this._bone)return this._bone;throw new Error("Bone not set.")}reset(){this.remaining=0,this.lastTime=this.skeleton.time,this._reset=!0,this.xOffset=0,this.xVelocity=0,this.yOffset=0,this.yVelocity=0,this.rotateOffset=0,this.rotateVelocity=0,this.scaleOffset=0,this.scaleVelocity=0}setToSetupPose(){const e=this.data;this.inertia=e.inertia,this.strength=e.strength,this.damping=e.damping,this.massInverse=e.massInverse,this.wind=e.wind,this.gravity=e.gravity,this.mix=e.mix}isActive(){return this.active}update(e){const t=this.mix;if(t==0)return;const s=this.data.x>0,n=this.data.y>0,r=this.data.rotate>0||this.data.shearX>0,o=this.data.scaleX>0,a=this.bone,h=a.data.length;switch(e){case Xn.none:return;case Xn.reset:this.reset();case Xn.update:const l=this.skeleton,c=Math.max(this.skeleton.time-this.lastTime,0);this.remaining+=c,this.lastTime=l.time;const u=a.worldX,f=a.worldY;if(this._reset)this._reset=!1,this.ux=u,this.uy=f;else{let d=this.remaining,m=this.inertia,g=this.data.step,b=this.skeleton.data.referenceScale,_=-1,M=this.data.limit*c,v=M*Math.abs(l.scaleY);if(M*=Math.abs(l.scaleX),s||n){if(s){const S=(this.ux-u)*m;this.xOffset+=S>M?M:S<-M?-M:S,this.ux=u}if(n){const S=(this.uy-f)*m;this.yOffset+=S>v?v:S<-v?-v:S,this.uy=f}if(d>=g){_=Math.pow(this.damping,60*g);const S=this.massInverse*g,y=this.strength,I=this.wind*b*l.scaleX,E=this.gravity*b*l.scaleY;do s&&(this.xVelocity+=(I-this.xOffset*y)*S,this.xOffset+=this.xVelocity*g,this.xVelocity*=_),n&&(this.yVelocity-=(E+this.yOffset*y)*S,this.yOffset+=this.yVelocity*g,this.yVelocity*=_),d-=g;while(d>=g)}s&&(a.worldX+=this.xOffset*t*this.data.x),n&&(a.worldY+=this.yOffset*t*this.data.y)}if(r||o){let S=Math.atan2(a.c,a.a),y=0,I=0,E=0,C=this.cx-a.worldX,R=this.cy-a.worldY;if(C>M?C=M:C<-M&&(C=-M),R>v?R=v:R<-v&&(R=-v),r){E=(this.data.rotate+this.data.shearX)*t;let B=Math.atan2(R+this.ty,C+this.tx)-S-this.rotateOffset*E;this.rotateOffset+=(B-Math.ceil(B*ke.invPI2-.5)*ke.PI2)*m,B=this.rotateOffset*E+S,y=Math.cos(B),I=Math.sin(B),o&&(B=h*a.getWorldScaleX(),B>0&&(this.scaleOffset+=(C*y+R*I)*m/B))}else{y=Math.cos(S),I=Math.sin(S);const B=h*a.getWorldScaleX();B>0&&(this.scaleOffset+=(C*y+R*I)*m/B)}if(d=this.remaining,d>=g){_==-1&&(_=Math.pow(this.damping,60*g));const B=this.massInverse*g,k=this.strength,F=this.wind,D=ya.yDown?-this.gravity:this.gravity,N=h/b;for(;;)if(d-=g,o&&(this.scaleVelocity+=(F*y-D*I-this.scaleOffset*k)*B,this.scaleOffset+=this.scaleVelocity*g,this.scaleVelocity*=_),r){if(this.rotateVelocity-=((F*I+D*y)*N+this.rotateOffset*k)*B,this.rotateOffset+=this.rotateVelocity*g,this.rotateVelocity*=_,d0){let d=0;this.data.rotate>0&&(d=l*this.data.rotate,c=Math.sin(d),u=Math.cos(d),f=a.b,a.b=u*f-c*a.d,a.d=c*f+u*a.d),d+=l*this.data.shearX,c=Math.sin(d),u=Math.cos(d),f=a.a,a.a=u*f-c*a.c,a.c=c*f+u*a.c}else l*=this.data.rotate,c=Math.sin(l),u=Math.cos(l),f=a.a,a.a=u*f-c*a.c,a.c=c*f+u*a.c,f=a.b,a.b=u*f-c*a.d,a.d=c*f+u*a.d}if(o){const l=1+this.scaleOffset*t*this.data.scaleX;a.a*=l,a.c*=l}e!=Xn.pose&&(this.tx=h*a.a,this.ty=h*a.c),a.updateAppliedTransform()}translate(e,t){this.ux-=e,this.uy-=t,this.cx-=e,this.cy-=t}rotate(e,t,s){const n=s*ke.degRad,r=Math.cos(n),o=Math.sin(n),a=this.cx-e,h=this.cy-t;this.translate(a*r-h*o-a,a*o+h*r-h)}}class jE{constructor(e,t){A(this,"data");A(this,"bone");A(this,"color");A(this,"darkColor",null);A(this,"attachment",null);A(this,"attachmentState",0);A(this,"sequenceIndex",-1);A(this,"deform",new Array);if(!e)throw new Error("data cannot be null.");if(!t)throw new Error("bone cannot be null.");this.data=e,this.bone=t,this.color=new ot,this.darkColor=e.darkColor?new ot:null,this.setToSetupPose()}getSkeleton(){return this.bone.skeleton}getAttachment(){return this.attachment}setAttachment(e){this.attachment!=e&&((!(e instanceof vs)||!(this.attachment instanceof vs)||e.timelineAttachment!=this.attachment.timelineAttachment)&&(this.deform.length=0),this.attachment=e,this.sequenceIndex=-1)}setToSetupPose(){this.color.setFromColor(this.data.color),this.darkColor&&this.darkColor.setFromColor(this.data.darkColor),this.data.attachmentName?(this.attachment=null,this.setAttachment(this.bone.skeleton.getAttachment(this.data.index,this.data.attachmentName))):this.attachment=null}}class HE{constructor(e,t){A(this,"data");A(this,"bones");A(this,"target");A(this,"mixRotate",0);A(this,"mixX",0);A(this,"mixY",0);A(this,"mixScaleX",0);A(this,"mixScaleY",0);A(this,"mixShearY",0);A(this,"temp",new ql);A(this,"active",!1);if(!e)throw new Error("data cannot be null.");if(!t)throw new Error("skeleton cannot be null.");this.data=e,this.bones=new Array;for(let n=0;n0?ke.degRad:-.01745329277777778,m=this.data.offsetRotation*d,g=this.data.offsetShearY*d,b=this.bones;for(let _=0,M=b.length;_ke.PI?C-=ke.PI2:C<-3.1415927&&(C+=ke.PI2),C*=e;let R=Math.cos(C),B=Math.sin(C);v.a=R*S-B*I,v.b=R*y-B*E,v.c=B*S+R*I,v.d=B*y+R*E}if(a){let S=this.temp;h.localToWorld(S.set(this.data.offsetX,this.data.offsetY)),v.worldX+=(S.x-v.worldX)*t,v.worldY+=(S.y-v.worldY)*s}if(n!=0){let S=Math.sqrt(v.a*v.a+v.c*v.c);S!=0&&(S=(S+(Math.sqrt(l*l+u*u)-S+this.data.offsetScaleX)*n)/S),v.a*=S,v.c*=S}if(r!=0){let S=Math.sqrt(v.b*v.b+v.d*v.d);S!=0&&(S=(S+(Math.sqrt(c*c+f*f)-S+this.data.offsetScaleY)*r)/S),v.b*=S,v.d*=S}if(o>0){let S=v.b,y=v.d,I=Math.atan2(y,S),E=Math.atan2(f,c)-Math.atan2(u,l)-(I-Math.atan2(v.c,v.a));E>ke.PI?E-=ke.PI2:E<-3.1415927&&(E+=ke.PI2),E=I+(E+g)*o;let C=Math.sqrt(S*S+y*y);v.b=Math.cos(E)*C,v.d=Math.sin(E)*C}v.updateAppliedTransform()}}applyRelativeWorld(){let e=this.mixRotate,t=this.mixX,s=this.mixY,n=this.mixScaleX,r=this.mixScaleY,o=this.mixShearY,a=t!=0||s!=0,h=this.target,l=h.a,c=h.b,u=h.c,f=h.d,d=l*f-c*u>0?ke.degRad:-.01745329277777778,m=this.data.offsetRotation*d,g=this.data.offsetShearY*d,b=this.bones;for(let _=0,M=b.length;_ke.PI?C-=ke.PI2:C<-3.1415927&&(C+=ke.PI2),C*=e;let R=Math.cos(C),B=Math.sin(C);v.a=R*S-B*I,v.b=R*y-B*E,v.c=B*S+R*I,v.d=B*y+R*E}if(a){let S=this.temp;h.localToWorld(S.set(this.data.offsetX,this.data.offsetY)),v.worldX+=S.x*t,v.worldY+=S.y*s}if(n!=0){let S=(Math.sqrt(l*l+u*u)-1+this.data.offsetScaleX)*n+1;v.a*=S,v.c*=S}if(r!=0){let S=(Math.sqrt(c*c+f*f)-1+this.data.offsetScaleY)*r+1;v.b*=S,v.d*=S}if(o>0){let S=Math.atan2(f,c)-Math.atan2(u,l);S>ke.PI?S-=ke.PI2:S<-3.1415927&&(S+=ke.PI2);let y=v.b,I=v.d;S=Math.atan2(I,y)+(S-ke.PI/2+g)*o;let E=Math.sqrt(y*y+I*I);v.b=Math.cos(S)*E,v.d=Math.sin(S)*E}v.updateAppliedTransform()}}applyAbsoluteLocal(){let e=this.mixRotate,t=this.mixX,s=this.mixY,n=this.mixScaleX,r=this.mixScaleY,o=this.mixShearY,a=this.target,h=this.bones;for(let l=0,c=h.length;lt.data.name==e)??null}findTransformConstraint(e){if(!e)throw new Error("constraintName cannot be null.");return this.transformConstraints.find(t=>t.data.name==e)??null}findPathConstraint(e){if(!e)throw new Error("constraintName cannot be null.");return this.pathConstraints.find(t=>t.data.name==e)??null}findPhysicsConstraint(e){if(e==null)throw new Error("constraintName cannot be null.");return this.physicsConstraints.find(t=>t.data.name==e)??null}getBoundsRect(e){let t=new ql,s=new ql;return this.getBounds(t,s,void 0,e),{x:t.x,y:t.y,width:s.x,height:s.y}}getBounds(e,t,s=new Array(2),n=null){if(!e)throw new Error("offset cannot be null.");if(!t)throw new Error("size cannot be null.");let r=this.drawOrder,o=Number.POSITIVE_INFINITY,a=Number.POSITIVE_INFINITY,h=Number.NEGATIVE_INFINITY,l=Number.NEGATIVE_INFINITY;for(let c=0,u=r.length;c=n.length&&(n.length=e+1),n[e]||(n[e]={}),n[e][t]=s}addSkin(e){for(let n=0;n= 0.");if(!t)throw new Error("name cannot be null.");if(!s)throw new Error("boneData cannot be null.");this.index=e,this.name=t,this.boneData=s}}var Hn;(function(i){i[i.Normal=0]="Normal",i[i.Additive=1]="Additive",i[i.Multiply=2]="Multiply",i[i.Screen=3]="Screen"})(Hn||(Hn={}));class rx extends Uh{constructor(t){super(t,0,!1);A(this,"bones",new Array);A(this,"_target",null);A(this,"mixRotate",0);A(this,"mixX",0);A(this,"mixY",0);A(this,"mixScaleX",0);A(this,"mixScaleY",0);A(this,"mixShearY",0);A(this,"offsetRotation",0);A(this,"offsetX",0);A(this,"offsetY",0);A(this,"offsetScaleX",0);A(this,"offsetScaleY",0);A(this,"offsetShearY",0);A(this,"relative",!1);A(this,"local",!1)}set target(t){this._target=t}get target(){if(this._target)return this._target;throw new Error("BoneData not set.")}}class Cd{constructor(e){A(this,"scale",1);A(this,"attachmentLoader");A(this,"linkedMeshes",new Array);this.attachmentLoader=e}readSkeletonData(e){let t=this.scale,s=new eh;s.name="";let n=new WE(e),r=n.readInt32(),o=n.readInt32();s.hash=o==0&&r==0?null:o.toString(16)+r.toString(16),s.version=n.readString(),s.x=n.readFloat(),s.y=n.readFloat(),s.width=n.readFloat(),s.height=n.readFloat(),s.referenceScale=n.readFloat()*t;let a=n.readBoolean();a&&(s.fps=n.readFloat(),s.imagesPath=n.readString(),s.audioPath=n.readString());let h=0;h=n.readInt(!0);for(let c=0;c>1&3,d.rotateMode=m>>3&3,(m&128)!=0&&(d.offsetRotation=n.readFloat()),d.position=n.readFloat(),d.positionMode==Gs.Fixed&&(d.position*=t),d.spacing=n.readFloat(),(d.spacingMode==oi.Length||d.spacingMode==oi.Fixed)&&(d.spacing*=t),d.mixRotate=n.readFloat(),d.mixX=n.readFloat(),d.mixY=n.readFloat(),s.pathConstraints.push(d)}h=n.readInt(!0);for(let c=0,u;c>4,e.readFloat())}n.push(I);break}}}}}let o=e.readInt(!0);if(o>0){let l=new br(o),c=s.slots.length;for(let u=0;u=0;M--)m[M]=-1;let g=Fe.newArray(c-d,0),b=0,_=0;for(let M=0;M=0;M--)m[M]==-1&&(m[M]=g[--_]);l.setFrame(u,f,m)}n.push(l)}let a=e.readInt(!0);if(a>0){let l=new va(a);for(let c=0;c>>1^-(s&1)}readStringRef(){let e=this.readInt(!0);return e==0?null:this.strings[e-1]}readString(){let e=this.readInt(!0);switch(e){case 0:return null;case 1:return""}e--;let t="";for(let s=0;s>4){case 12:case 13:t+=String.fromCharCode((n&31)<<6|this.readByte()&63),s+=2;break;case 14:t+=String.fromCharCode((n&15)<<12|(this.readByte()&63)<<6|this.readByte()&63),s+=3;break;default:t+=String.fromCharCode(n),s++}}return t}readFloat(){let e=this.buffer.getFloat32(this.index);return this.index+=4,e}readBoolean(){return this.readByte()!=0}}let zE=class{constructor(e,t,s,n,r){A(this,"parent");A(this,"skinIndex");A(this,"slotIndex");A(this,"mesh");A(this,"inheritTimeline");this.mesh=e,this.skinIndex=t,this.slotIndex=s,this.parent=n,this.inheritTimeline=r}};class qE{constructor(e=null,t=null,s=0){A(this,"bones");A(this,"vertices");A(this,"length");this.bones=e,this.vertices=t,this.length=s}}var on;(function(i){i[i.Region=0]="Region",i[i.BoundingBox=1]="BoundingBox",i[i.Mesh=2]="Mesh",i[i.LinkedMesh=3]="LinkedMesh",i[i.Path=4]="Path",i[i.Point=5]="Point",i[i.Clipping=6]="Clipping"})(on||(on={}));function vi(i,e,t){let s=i.readFloat(),n=i.readFloat()*t;for(let r=0,o=0,a=e.getFrameCount()-1;e.setFrame(r,s,n),r!=a;r++){let h=i.readFloat(),l=i.readFloat()*t;switch(i.readByte()){case ks:e.setStepped(r);break;case Fs:gt(i,e,o++,r,0,s,h,n,l,t)}s=h,n=l}return e}function Mu(i,e,t){let s=i.readFloat(),n=i.readFloat()*t,r=i.readFloat()*t;for(let o=0,a=0,h=e.getFrameCount()-1;e.setFrame(o,s,n,r),o!=h;o++){let l=i.readFloat(),c=i.readFloat()*t,u=i.readFloat()*t;switch(i.readByte()){case ks:e.setStepped(o);break;case Fs:gt(i,e,a++,o,0,s,l,n,c,t),gt(i,e,a++,o,1,s,l,r,u,t)}s=l,n=c,r=u}return e}function gt(i,e,t,s,n,r,o,a,h,l){e.setBezier(t,s,n,r,a,i.readFloat(),i.readFloat()*l,i.readFloat(),i.readFloat()*l,o,h)}const KE=0,ZE=1,JE=2,QE=3,eA=4,tA=5,iA=6,sA=7,nA=8,rA=9,oA=10,aA=0,lA=1,hA=2,cA=3,uA=4,dA=5,fA=0,pA=1,mA=0,gA=1,vA=2,yA=0,xA=1,bA=2,wA=4,_A=5,SA=6,TA=7,MA=8,ks=1,Fs=2;class Ii{constructor(){A(this,"convexPolygons",new Array);A(this,"convexPolygonsIndices",new Array);A(this,"indicesArray",new Array);A(this,"isConcaveArray",new Array);A(this,"triangles",new Array);A(this,"polygonPool",new zl(()=>new Array));A(this,"polygonIndicesPool",new zl(()=>new Array))}triangulate(e){let t=e,s=e.length>>1,n=this.indicesArray;n.length=0;for(let a=0;a3;){let a=s-1,h=0,l=1;for(;;){e:if(!r[h]){let f=n[a]<<1,d=n[h]<<1,m=n[l]<<1,g=t[f],b=t[f+1],_=t[d],M=t[d+1],v=t[m],S=t[m+1];for(let y=(l+1)%s;y!=a;y=(y+1)%s){if(!r[y])continue;let I=n[y]<<1,E=t[I],C=t[I+1];if(Ii.positiveArea(v,S,g,b,E,C)&&Ii.positiveArea(g,b,_,M,E,C)&&Ii.positiveArea(_,M,v,S,E,C))break e}break}if(l==0){do{if(!r[h])break;h--}while(h>0);break}a=h,h=l,l=(l+1)%s}o.push(n[(s+h-1)%s]),o.push(n[h]),o.push(n[(h+1)%s]),n.splice(h,1),r.splice(h,1),s--;let c=(s+h-1)%s,u=h==s?0:h;r[c]=Ii.isConcave(c,s,t,n),r[u]=Ii.isConcave(u,s,t,n)}return s==3&&(o.push(n[2]),o.push(n[0]),o.push(n[1])),o}decompose(e,t){let s=e,n=this.convexPolygons;this.polygonPool.freeAll(n),n.length=0;let r=this.convexPolygonsIndices;this.polygonIndicesPool.freeAll(r),r.length=0;let o=this.polygonIndicesPool.obtain();o.length=0;let a=this.polygonPool.obtain();a.length=0;let h=-1,l=0;for(let c=0,u=t.length;c0?(n.push(a),r.push(o)):(this.polygonPool.free(a),this.polygonIndicesPool.free(o)),a=this.polygonPool.obtain(),a.length=0,a.push(g),a.push(b),a.push(_),a.push(M),a.push(v),a.push(S),o=this.polygonIndicesPool.obtain(),o.length=0,o.push(f),o.push(d),o.push(m),l=Ii.winding(g,b,_,M,v,S),h=f)}a.length>0&&(n.push(a),r.push(o));for(let c=0,u=n.length;c=0;c--)a=n[c],a.length==0&&(n.splice(c,1),this.polygonPool.free(a),o=r[c],r.splice(c,1),this.polygonIndicesPool.free(o));return n}static isConcave(e,t,s,n){let r=n[(t+e-1)%t]<<1,o=n[e]<<1,a=n[(e+1)%t]<<1;return!this.positiveArea(s[r],s[r+1],s[o],s[o+1],s[a],s[a+1])}static positiveArea(e,t,s,n,r,o){return e*(o-n)+s*(t-o)+r*(n-t)>=0}static winding(e,t,s,n,r,o){let a=s-e,h=n-t;return r*h-o*a+a*t-e*h>=0?1:-1}}class th{constructor(){A(this,"triangulator",new Ii);A(this,"clippingPolygon",new Array);A(this,"clipOutput",new Array);A(this,"clippedVertices",new Array);A(this,"clippedUVs",new Array);A(this,"clippedTriangles",new Array);A(this,"scratch",new Array);A(this,"clipAttachment",null);A(this,"clippingPolygons",null)}clipStart(e,t){if(this.clipAttachment)return 0;this.clipAttachment=t;let s=t.worldVerticesLength,n=Fe.setArraySize(this.clippingPolygon,s);t.computeWorldVertices(e,0,s,n,0,2);let r=this.clippingPolygon;th.makeClockwise(r);let o=this.clippingPolygons=this.triangulator.decompose(r,this.triangulator.triangulate(r));for(let a=0,h=o.length;a>1,I=this.clipOutput,E=Fe.setArraySize(r,v+y*2);for(let R=0;R>1,q=this.clipOutput,z=Fe.setArraySize(l,N+Y*d);for(let H=0;H>1,X=this.clipOutput,U=Fe.setArraySize(o,k+P*2),Y=Fe.setArraySize(a,k+P*2);for(let z=0;z=2?(u=h,h=this.scratch):u=this.scratch,u.length=0,u.push(e),u.push(t),u.push(s),u.push(n),u.push(r),u.push(o),u.push(e),u.push(t),h.length=0;let f=a.length-4,d=a;for(let m=0;;m+=2){let g=d[m],b=d[m+1],_=g-d[m+2],M=b-d[m+3],v=h.length,S=u;for(let I=0,E=u.length-2;I_*(b-k),D=M*(g-C)-_*(b-R);if(D>0){if(F){h.push(B),h.push(k);continue}let N=B-C,j=k-R,O=D/(N*M-j*_);if(O>=0&&O<=1)h.push(C+N*O),h.push(R+j*O);else{h.push(B),h.push(k);continue}}else if(F){let N=B-C,j=k-R,O=D/(N*M-j*_);if(O>=0&&O<=1)h.push(C+N*O),h.push(R+j*O),h.push(B),h.push(k);else{h.push(B),h.push(k);continue}}c=!0}if(v==h.length)return l.length=0,!0;if(h.push(h[0]),h.push(h[1]),m==f)break;let y=h;h=u,h.length=0,u=y}if(l!=h){l.length=0;for(let m=0,g=h.length-2;m>1;l0){let c=s.findPhysicsConstraint(a);if(!c)throw new Error("Physics constraint not found: "+a);l=s.physicsConstraints.indexOf(c)}for(let c in h){let u=h[c],f=u[0];if(!f)continue;let d=u.length;if(c=="reset"){const g=new Jl(d,l);for(let b=0;f!=null;f=u[b+1],b++)g.setFrame(b,ee(f,"time",0));r.push(g);continue}let m;if(c=="inertia")m=new $y(d,d,l);else if(c=="strength")m=new Gy(d,d,l);else if(c=="damping")m=new jy(d,d,l);else if(c=="mass")m=new Hy(d,d,l);else if(c=="wind")m=new Wy(d,d,l);else if(c=="gravity")m=new zy(d,d,l);else if(c=="mix")m=new qy(d,d,l);else continue;r.push(ss(u,m,0,1))}}if(e.attachments)for(let a in e.attachments){let h=e.attachments[a],l=s.findSkin(a);if(!l)throw new Error("Skin not found: "+a);for(let c in h){let u=h[c],f=s.findSlot(c);if(!f)throw new Error("Slot not found: "+c);let d=f.index;for(let m in u){let g=u[m],b=l.getAttachment(d,m);for(let _ in g){let M=g[_],v=M[0];if(v){if(_=="deform"){let S=b.bones,y=b.vertices,I=S?y.length/3*2:y.length,E=new Dy(M.length,M.length,d,b),C=ee(v,"time",0);for(let R=0,B=0;;R++){let k,F=ee(v,"vertices",null);if(!F)k=S?Fe.newFloatArray(I):y;else{k=Fe.newFloatArray(I);let O=ee(v,"offset",0);if(Fe.arrayCopy(F,0,k,O,F.length),n!=1)for(let L=O,P=L+F.length;L=0;_--)f[_]==-1&&(f[_]=m[--b])}a.setFrame(l,ee(u,"time",0),f)}r.push(a)}if(e.events){let a=new va(e.events.length),h=0;for(let l=0;l"u"&&(Math.fround=(function(i){return function(e){return i[0]=e,i[0]}})(new Float32Array(1)));const an=class an extends UE{constructor(t){super(t.resource.source);A(this,"texture");this.texture=et.from(t)}static from(t){return an.textureMap.has(t)?an.textureMap.get(t):new an(t)}setFilters(t,s){this.texture.baseTexture.scaleMode=an.toPixiTextureFilter(t),this.texture.baseTexture.mipmap=an.toPixiMipMap(t)}setWraps(t,s){this.texture.baseTexture.wrapMode=an.toPixiTextureWrap(t)}dispose(){this.texture.destroy()}static toPixiTextureFilter(t){switch(t){case hi.Nearest:case hi.MipMapNearestLinear:case hi.MipMapNearestNearest:return as.NEAREST;case hi.Linear:case hi.MipMapLinearLinear:case hi.MipMapLinearNearest:return as.LINEAR;default:throw new Error(`Unknown texture filter: ${String(t)}`)}}static toPixiMipMap(t){switch(t){case hi.Nearest:case hi.Linear:return Ki.OFF;case hi.MipMapNearestLinear:case hi.MipMapNearestNearest:case hi.MipMapLinearLinear:case hi.MipMapLinearNearest:return Ki.ON;default:throw new Error(`Unknown texture filter: ${String(t)}`)}}static toPixiTextureWrap(t){switch(t){case yn.ClampToEdge:return us.CLAMP;case yn.MirroredRepeat:return us.MIRRORED_REPEAT;case yn.Repeat:return us.REPEAT;default:throw new Error(`Unknown texture wrap: ${String(t)}`)}}static toPixiBlending(t){switch(t){case Hn.Normal:return Qe.NORMAL;case Hn.Additive:return Qe.ADD;case Hn.Multiply:return Qe.MULTIPLY;case Hn.Screen:return Qe.SCREEN;default:throw new Error(`Unknown blendMode: ${String(t)}`)}}};A(an,"textureMap",new Map);let Ar=an;const ln=class ln extends ma{constructor(){const t=new hf;t.getBuffer("aVertexPosition").static=!1,t.getBuffer("aTextureCoord").static=!1;const s=new jl(et.EMPTY);super(t,s);A(this,"name","");A(this,"warnedTwoTint",!1)}updateFromSpineData(t,s,n,r,o,a,h,l){var _,M;this.texture=t.texture;const c=o/(l?12:8)*2,u=this.geometry.getBuffer("aTextureCoord");((_=u.data)==null?void 0:_.length)!==c&&(u.data=new Float32Array(c));const f=this.geometry.getBuffer("aVertexPosition");((M=f.data)==null?void 0:M.length)!==c&&(f.data=new Float32Array(c));let d=0,m=u.data,g=f.data;for(let v=0;v0?`text-shadow: ${r} ${this.dropShadowBlur}px ${e}`:`text-shadow: ${r} ${e}`}reset(){Object.assign(this,qr.defaultOptions)}onBeforeDraw(){const{fontsDirty:e}=this;return this.fontsDirty=!1,this.isSafari&&this._fonts.length>0&&e?new Promise(t=>setTimeout(t,100)):Promise.resolve()}get isSafari(){const{userAgent:e}=Ve.ADAPTER.getNavigator();return/^((?!chrome|android).)*safari/i.test(e)}set fillGradientStops(e){console.warn("[HTMLTextStyle] fillGradientStops is not supported by HTMLText")}get fillGradientStops(){return super.fillGradientStops}set fillGradientType(e){console.warn("[HTMLTextStyle] fillGradientType is not supported by HTMLText")}get fillGradientType(){return super.fillGradientType}set miterLimit(e){console.warn("[HTMLTextStyle] miterLimit is not supported by HTMLText")}get miterLimit(){return super.miterLimit}set trim(e){console.warn("[HTMLTextStyle] trim is not supported by HTMLText")}get trim(){return super.trim}set textBaseline(e){console.warn("[HTMLTextStyle] textBaseline is not supported by HTMLText")}get textBaseline(){return super.textBaseline}set leading(e){console.warn("[HTMLTextStyle] leading is not supported by HTMLText")}get leading(){return super.leading}set lineJoin(e){console.warn("[HTMLTextStyle] lineJoin is not supported by HTMLText")}get lineJoin(){return super.lineJoin}};_d.availableFonts={},_d.defaultOptions={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",letterSpacing:0,lineHeight:0,padding:0,stroke:"black",strokeThickness:0,whiteSpace:"normal",wordWrap:!1,wordWrapWidth:100};let xu=_d;const Ja=class Kr extends Qn{constructor(e="",t={}){super(et.EMPTY),this._text=null,this._style=null,this._autoResolution=!0,this.localStyleID=-1,this.dirty=!1,this._updateID=0,this.ownsStyle=!1;const s=new Image,n=et.from(s,{scaleMode:Ve.SCALE_MODE,resourceOptions:{autoLoad:!1}});n.orig=new lt,n.trim=new lt,this.texture=n;const r="http://www.w3.org/2000/svg",o="http://www.w3.org/1999/xhtml",a=document.createElementNS(r,"svg"),h=document.createElementNS(r,"foreignObject"),l=document.createElementNS(o,"div"),c=document.createElementNS(o,"style");h.setAttribute("width","10000"),h.setAttribute("height","10000"),h.style.overflow="hidden",a.appendChild(h),this.maxWidth=Kr.defaultMaxWidth,this.maxHeight=Kr.defaultMaxHeight,this._domElement=l,this._styleElement=c,this._svgRoot=a,this._foreignObject=h,this._foreignObject.appendChild(c),this._foreignObject.appendChild(l),this._image=s,this._loadImage=new Image,this._autoResolution=Kr.defaultAutoResolution,this._resolution=Kr.defaultResolution??Ve.RESOLUTION,this.text=e,this.style=t}measureText(e){var c,u;const{text:t,style:s,resolution:n}=Object.assign({text:this._text,style:this._style,resolution:this._resolution},e);Object.assign(this._domElement,{innerHTML:t,style:s.toCSS(n)}),this._styleElement.textContent=s.toGlobalCSS(),document.body.appendChild(this._svgRoot);const r=this._domElement.getBoundingClientRect();this._svgRoot.remove();const{width:o,height:a}=r;(o>this.maxWidth||a>this.maxHeight)&&console.warn("[HTMLText] Large expanse of text, increase HTMLText.maxWidth or HTMLText.maxHeight property.");const h=Math.min(this.maxWidth,Math.ceil(o)),l=Math.min(this.maxHeight,Math.ceil(a));return this._svgRoot.setAttribute("width",h.toString()),this._svgRoot.setAttribute("height",l.toString()),t!==this._text&&(this._domElement.innerHTML=this._text),s!==this._style&&(Object.assign(this._domElement,{style:(c=this._style)==null?void 0:c.toCSS(n)}),this._styleElement.textContent=(u=this._style)==null?void 0:u.toGlobalCSS()),{width:h+s.padding*2,height:l+s.padding*2}}async updateText(e=!0){const{style:t,_image:s,_loadImage:n}=this;if(this.localStyleID!==t.styleID&&(this.dirty=!0,this.localStyleID=t.styleID),!this.dirty&&e)return;const{width:r,height:o}=this.measureText();s.width=n.width=Math.ceil(Math.max(1,r)),s.height=n.height=Math.ceil(Math.max(1,o)),this._updateID++;const a=this._updateID;await new Promise(h=>{n.onload=async()=>{if(a/gi,"
").replace(/
/gi,"
").replace(/ /gi," ")}};Ja.defaultDestroyOptions={texture:!0,children:!1,baseTexture:!0},Ja.defaultMaxWidth=2024,Ja.defaultMaxHeight=2024,Ja.defaultAutoResolution=!0;function ga(){return{texture:null,imageResources:[{id:1,texture:null,textureName:"star",textureFolder:"",previewUrl:"/images/star.png",imageMode:"fixed",sequencePlayback:"loop-forward",sequenceFps:30,sequenceFrames:[],weight:100,locked:!1,scale:1,anchorX:.5,anchorY:.5,colorMode:"fixed",colorStart:"#ffffff",colorEnd:"#ff4d4d",colorGradient:[{position:0,color:"#ffffff"},{position:1,color:"#ff4d4d"}],blend:"normal",independentAlpha:"off",alpha:1,alphaCurveMode:"跟随导出",alphaCurve:[{x:0,y:0},{x:.1,y:1},{x:.9,y:1},{x:1,y:0}]}],imageWeightVersion:1,name:"ParticleSystem1",mode:"stream",rate:20,streamBehavior:"normal",loopDurationFrames:30,generateLoopStartAnimation:!1,generateLoopEndAnimation:!1,burstCount:50,burstLoop:!1,delay:0,duration:1,shape:"point",radius:30,rectW:60,rectH:40,centerX:0,centerY:0,rootRotation:0,rootScaleX:1,rootScaleY:1,direction:0,spread:360,coneAngle:60,lifeMin:.6,lifeMax:1.8,lifeMode:"random",lifeCurve:[{x:0,y:0},{x:1,y:1}],speedMin:30,speedMax:140,speedMode:"random",speedCurve:[{x:0,y:0},{x:1,y:1}],scaleMin:.3,scaleMax:.8,scaleMode:"random",scaleAxisMode:"uniform",scaleYMin:.3,scaleYMax:.8,scaleCurve:[{x:0,y:0},{x:1,y:1}],scaleYCurve:[{x:0,y:0},{x:1,y:1}],scaleEndRatio:.3,initialRotationMode:"random",initialRotationMin:0,initialRotationMax:360,initialRotationCurve:[{x:0,y:0},{x:1,y:1}],alpha:.9,alphaEnd:0,rotationSpeedMin:-180,rotationSpeedMax:180,speedOverLifeEnabled:!1,speedOverLifeMode:"fixed",speedOverLifeMin:1,speedOverLifeMax:1,speedOverLifeCurve:[{x:0,y:1},{x:1,y:1}],scaleOverLifeEnabled:!1,scaleOverLifeMode:"curve",scaleOverLifeAxisMode:"uniform",scaleOverLifeMin:0,scaleOverLifeMax:1,scaleYOverLifeMin:0,scaleYOverLifeMax:1,scaleOverLifeCurve:[{x:0,y:1},{x:1,y:1}],scaleYOverLifeCurve:[{x:0,y:1},{x:1,y:1}],rotationOverLifeEnabled:!1,rotationOverLifeMode:"random",rotationOverLifeCurve:[{x:0,y:0},{x:1,y:1}],gravity:980,gravityMode:"fixed",gravityMin:980,gravityMax:980,gravityDirection:-90,gravityCurve:[{x:0,y:1},{x:1,y:1}],damping:0,seed:0,colorStart:"#ffffff",colorEnd:"#ff4d4d",colorOverLife:!1,blend:"add",alphaMode:"curve",curveMode:"线性",alphaCurve:[{x:0,y:0},{x:.2,y:1},{x:.8,y:1},{x:1,y:0}],textureName:"star",textureFolder:"",alphaScale:1,anchorX:.5,anchorY:.5,independentAlpha:"off",offsetX:0,offsetY:0,noise:!1,noiseAmt:30,noiseRange:100,noiseSpeed:1,useGravity:!1,wind:!1,windX:0,windY:0,windMode:"fixed",windMin:100,windMax:100,windDirection:0,windCurve:[{x:0,y:1},{x:1,y:1}],forceField:!1,forceStrength:10,forceRadius:100,forceCenterX:0,forceCenterY:0,forceFalloff:"linear",attraction:!1,attractionCenterX:200,attractionCenterY:0,attractionRadius:20,attractionDuration:.5,attractionDelay:.1,attractionDelayMode:"particle",attractionPath:"curve",trail:!1,trailConfigVersion:3,trailResources:[{id:1,texture:null,textureName:"trail",previewUrl:"/images/trail.png",weight:100,locked:!1,rotation:0,colorMode:"particle",color:"#ffffff",colorGradient:[{position:0,color:"#ffffff"},{position:1,color:"#ffffff"}],blend:"normal",alphaMode:"particle",alpha:1,alphaCurve:[{x:0,y:1},{x:1,y:1}],boneCount:3,trailRatio:100,lengthMode:"fixed",length:100,lengthMin:100,lengthMax:100,widthSizeMode:"fixed",width:100,widthMin:100,widthMax:100,widthMode:"particle",lifeLengthEnabled:!1,lifeLengthCurve:[{x:0,y:1},{x:1,y:1}],shapeEnabled:!1,shapeCurve:[{x:0,y:1},{x:1,y:1}]}],trailResourceVersion:6,trailTexture:null,trailTextureName:"trail",trailPreviewUrl:"/images/trail.png",trailColorMode:"particle",trailColor:"#ffffff",trailColorGradient:[{position:0,color:"#ffffff"},{position:1,color:"#ffffff"}],trailAlphaMode:"particle",trailAlpha:1,trailAlphaCurve:[{x:0,y:1},{x:1,y:1}],trailBoneCount:3,trailLength:100,trailWidth:100,trailWidthMode:"particle",trailLifeLengthEnabled:!1,trailLifeLengthCurve:[{x:0,y:1},{x:1,y:1}],trailShapeEnabled:!1,trailShapeCurve:[{x:0,y:1},{x:1,y:1}],trailGridRows:4,trailGridCols:4,collision:!1,pathFollow:!1,emitterFollow:!1,emitterFollowMode:"none",emitterFollowPathId:0,emitterFollowSpineId:0,emitterFollowBoneName:"",emitterFollowBoneOffsetX:0,emitterFollowBoneOffsetY:0,emitterFollowBoneRotation:0,emitterFollowBoneScaleX:1,emitterFollowBoneScaleY:1,emitterAngleMode:"fixed",emitterFollowCurve:[{x:0,y:0},{x:1,y:1}],emitterFollowDuration:2,emitterFollowSpace:"world",emitterFollowDirection:"forward",emitterFollowOffset:0}}function Tr(i){var M;const e=ga(),t=i,s=t.imageWeightVersion!==1,n=t.loopDurationFrames==null,r=t.gravityMode==null,o=Number(t.gravity),a=t.windMode==null,h=Number(t.windX),l=Number(t.windY),c=t.forceFalloff==null,u=Number(t.forceStrength),f=t.trailConfigVersion!==3,d=!Array.isArray(t.trailResources),m=t.trailResourceVersion!==6,g=t.trailTexture,b=String(t.trailTextureName||"trail"),_=String(t.trailPreviewUrl||"/images/trail.png").replace("/trails/trail.png","/images/trail.png");for(const[v,S]of Object.entries(e))t[v]!==void 0&&t[v]!==null||(t[v]=Array.isArray(S)?S.map(y=>typeof y=="object"&&y!==null?{...y}:y):S);i.streamBehavior!=="normal"&&i.streamBehavior!=="loop"&&(i.streamBehavior="normal"),(n||!Number.isFinite(i.loopDurationFrames))&&(i.loopDurationFrames=Math.ceil(Math.max(1/30,Number(i.duration)||1)*30)),i.loopDurationFrames=Math.min(1800,Math.max(1,Math.ceil(i.loopDurationFrames))),typeof i.generateLoopStartAnimation!="boolean"&&(i.generateLoopStartAnimation=!1),typeof i.generateLoopEndAnimation!="boolean"&&(i.generateLoopEndAnimation=!1),i.generateLoopStartAnimation&&i.generateLoopEndAnimation&&(i.generateLoopEndAnimation=!1),(!Array.isArray(i.imageResources)||i.imageResources.length===0)&&(i.imageResources=ga().imageResources);for(const v of i.imageResources){!v.texture&&i.texture&&(v.texture=i.texture),v.textureName||(v.textureName="star"),v.previewUrl==="/particles/star.png"&&(v.previewUrl="/images/star.png"),v.previewUrl||(v.previewUrl=v.textureName==="star"?"/images/star.png":""),v.imageMode!=="fixed"&&v.imageMode!=="sequence"&&(v.imageMode="fixed"),v.sequencePlayback==="once"?v.sequencePlayback="once-hold":v.sequencePlayback==="loop"?v.sequencePlayback="loop-forward":["once-hide","once-hold","loop-forward","loop-reverse"].includes(v.sequencePlayback)||(v.sequencePlayback="loop-forward"),Number.isFinite(v.sequenceFps)||(v.sequenceFps=30),v.sequenceFps=Math.min(120,Math.max(1,Number(v.sequenceFps)||30)),Array.isArray(v.sequenceFrames)||(v.sequenceFrames=[]);for(const S of v.sequenceFrames)typeof S.name!="string"&&(S.name=""),typeof S.previewUrl!="string"&&(S.previewUrl=""),S.texture===void 0&&(S.texture=null);Number.isFinite(v.weight)||(v.weight=100),typeof v.locked!="boolean"&&(v.locked=!1),Number.isFinite(v.scale)||(v.scale=1),Number.isFinite(v.anchorX)||(v.anchorX=.5),Number.isFinite(v.anchorY)||(v.anchorY=.5),v.colorMode!=="fixed"&&v.colorMode!=="lifetime"&&(v.colorMode=i.colorOverLife?"lifetime":"fixed"),v.colorStart||(v.colorStart=i.colorStart||"#ffffff"),v.colorEnd||(v.colorEnd=i.colorEnd||v.colorStart),(!Array.isArray(v.colorGradient)||v.colorGradient.length<2)&&(v.colorGradient=[{position:0,color:v.colorStart},{position:1,color:v.colorEnd}]),Object.prototype.hasOwnProperty.call(Dn,v.blend)||(v.blend=i.blend||"normal"),["off","fixed","curve"].includes(v.independentAlpha)||(v.independentAlpha=i.independentAlpha||"off"),Number.isFinite(v.alpha)||(v.alpha=Number.isFinite(i.alphaScale)?i.alphaScale:1),["跟随导出","线性","贝塞尔"].includes(v.alphaCurveMode)||(v.alphaCurveMode=i.curveMode||"跟随导出"),(!Array.isArray(v.alphaCurve)||v.alphaCurve.length<2)&&(v.alphaCurve=(i.alphaCurve||[{x:0,y:1},{x:1,y:1}]).map(S=>({...S})))}if(i.imageResources.length===1)i.imageResources[0].weight=100,i.imageResources[0].locked=!1;else if(s){const v=100/i.imageResources.length;i.imageResources.forEach((S,y)=>{S.weight=y===i.imageResources.length-1?100-v*(i.imageResources.length-1):v,S.locked=!1})}if(i.imageWeightVersion=1,r){const v=Number.isFinite(o)&&o!==0?o:980;i.gravity=v,i.gravityMin=v,i.gravityMax=v}if(a){const v=Number.isFinite(h)&&Number.isFinite(l)&&(h!==0||l!==0);i.windMin=v?Math.hypot(h,l):100,i.windMax=i.windMin,i.windDirection=v?Math.atan2(-l,h)*180/Math.PI:0}c&&(i.forceStrength=Number.isFinite(u)&&u!==0?u:10),f&&(i.trailConfigVersion=3,i.trailAlphaCurve=[{x:0,y:1},{x:1,y:1}],i.trailLifeLengthCurve=[{x:0,y:1},{x:1,y:1}],i.trailShapeCurve=[{x:0,y:1},{x:1,y:1}],i.trailGridRows=4,i.trailGridCols=4),(d||!i.trailResources.length)&&(i.trailResources=[{id:1,texture:g||null,textureName:b,previewUrl:_,weight:100,locked:!1,rotation:0,colorMode:i.trailColorMode,color:i.trailColor,colorGradient:i.trailColorGradient.map(v=>({...v})),blend:"normal",alphaMode:i.trailAlphaMode,alpha:i.trailAlpha,alphaCurve:i.trailAlphaCurve.map(v=>({...v})),boneCount:i.trailBoneCount,trailRatio:100,lengthMode:"fixed",length:i.trailLength,lengthMin:i.trailLength,lengthMax:i.trailLength,widthSizeMode:"fixed",width:i.trailWidth,widthMin:i.trailWidth,widthMax:i.trailWidth,widthMode:i.trailWidthMode,lifeLengthEnabled:i.trailLifeLengthEnabled,lifeLengthCurve:i.trailLifeLengthCurve.map(v=>({...v})),shapeEnabled:i.trailShapeEnabled,shapeCurve:i.trailShapeCurve.map(v=>({...v}))}]);for(const v of i.trailResources)v.textureName||(v.textureName="trail"),v.previewUrl==="/trails/trail.png"&&(v.previewUrl="/images/trail.png"),v.previewUrl||(v.previewUrl="/images/trail.png"),Number.isFinite(v.weight)||(v.weight=100),typeof v.locked!="boolean"&&(v.locked=!1),Number.isFinite(v.rotation)||(v.rotation=0),["particle","fixed","curve"].includes(v.colorMode)||(v.colorMode=i.trailColorMode||"particle"),v.color||(v.color=i.trailColor||"#ffffff"),(!Array.isArray(v.colorGradient)||v.colorGradient.length<2)&&(v.colorGradient=(i.trailColorGradient||[{position:0,color:"#ffffff"},{position:1,color:"#ffffff"}]).map(S=>({...S}))),Object.prototype.hasOwnProperty.call(Dn,v.blend)||(v.blend="normal"),["particle","fixed","curve"].includes(v.alphaMode)||(v.alphaMode=i.trailAlphaMode||"particle"),Number.isFinite(v.alpha)||(v.alpha=Number.isFinite(i.trailAlpha)?i.trailAlpha:1),(!Array.isArray(v.alphaCurve)||v.alphaCurve.length<2)&&(v.alphaCurve=(i.trailAlphaCurve||[{x:0,y:1},{x:1,y:1}]).map(S=>({...S}))),Number.isFinite(v.boneCount)||(v.boneCount=Number.isFinite(i.trailBoneCount)?i.trailBoneCount:3),Number.isFinite(v.trailRatio)||(v.trailRatio=100),v.trailRatio=Math.min(100,Math.max(0,v.trailRatio)),["fixed","random"].includes(v.lengthMode)||(v.lengthMode="fixed"),Number.isFinite(v.length)||(v.length=Number.isFinite(i.trailLength)?i.trailLength:100),Number.isFinite(v.lengthMin)||(v.lengthMin=v.length),Number.isFinite(v.lengthMax)||(v.lengthMax=v.length),["fixed","random"].includes(v.widthSizeMode)||(v.widthSizeMode="fixed"),Number.isFinite(v.width)||(v.width=Number.isFinite(i.trailWidth)?i.trailWidth:100),Number.isFinite(v.widthMin)||(v.widthMin=v.width),Number.isFinite(v.widthMax)||(v.widthMax=v.width),["particle","fixed"].includes(v.widthMode)||(v.widthMode=i.trailWidthMode||"particle"),typeof v.lifeLengthEnabled!="boolean"&&(v.lifeLengthEnabled=!!i.trailLifeLengthEnabled),(!Array.isArray(v.lifeLengthCurve)||v.lifeLengthCurve.length<2)&&(v.lifeLengthCurve=(i.trailLifeLengthCurve||[{x:0,y:1},{x:1,y:1}]).map(S=>({...S}))),typeof v.shapeEnabled!="boolean"&&(v.shapeEnabled=!!i.trailShapeEnabled),(!Array.isArray(v.shapeCurve)||v.shapeCurve.length<2)&&(v.shapeCurve=(i.trailShapeCurve||[{x:0,y:1},{x:1,y:1}]).map(S=>({...S})));if(i.trailResources.length===1&&(i.trailResources[0].weight=100,i.trailResources[0].locked=!1),m)for(const v of i.trailResources)v.alphaCurve=((M=v.alphaCurve)==null?void 0:M.length)>=2?v.alphaCurve:[{x:0,y:1},{x:1,y:1}];return i.trailResourceVersion=6,i}const Dn={normal:0,add:1,multiply:2,screen:3},vE=400;class yE extends gi{constructor(t,s=vE){super();A(this,"pool",[]);A(this,"cfg");A(this,"accumulator",0);A(this,"burstTimer",0);A(this,"_spawnSerial",0);A(this,"_elapsed",0);A(this,"_attractionEnabledAt",0);A(this,"_attractionWasEnabled",!1);A(this,"_emitterPos",null);A(this,"states",[]);A(this,"rng",Math.random);A(this,"_lastSeed",-1);A(this,"trailDebugGfx",new Ri);A(this,"colliders",[]);A(this,"followSpawnX",0);A(this,"followSpawnY",0);A(this,"followSpawnAngle",0);A(this,"followExportCurveMode","线性");A(this,"simulationTransform",null);this.cfg=Tr(t),this._ensurePool(s),this.addChild(this.trailDebugGfx)}setFollowExportCurveMode(t){this.followExportCurveMode=t}resolveCurveMode(t){return t==="跟随导出"?this.followExportCurveMode:t}reseed(){const t=this.cfg.seed;t!==this._lastSeed&&(this._lastSeed=t,this.rng=wu(t>>>0))}_ensurePool(t){for(;this.pool.length=n.delay),o=s==="force"||s==="normal"&&(n.mode==="burst"||this._elapsed=1;)this.accumulator-=1,this.spawnOne();else this.burstTimer+=t,n.burstLoop?this.burstTimer>=1&&(this.burstTimer=0,this.emitBurst()):t>0&&this.burstTimer<=t&&this.emitBurst();const a=[];for(let m=0;m0){const P=Math.max(1e-4,Math.abs(n.rootScaleX)),X=Math.max(1e-4,Math.abs(n.rootScaleY)),U=-(((h=this.simulationTransform)==null?void 0:h.rotation)??n.rootRotation)*Math.PI/180,Y=Math.cos(U),q=Math.sin(U),z=((l=this.simulationTransform)==null?void 0:l.centerX)??n.centerX,ne=((c=this.simulationTransform)==null?void 0:c.centerY)??n.centerY,H=z+Y*P*g.x-q*X*g.y,Z=-ne+q*P*g.x+Y*X*g.y,ae=H,me=-Z,_e=n.forceCenterX-ae,te=n.forceCenterY-me,ve=Math.hypot(_e,te);if(ve>1e-4&&ve<=n.forceRadius){let $=1;n.forceFalloff==="linear"?$=1-ve/n.forceRadius:n.forceFalloff==="inverse"&&($=Math.min(10,n.forceRadius/Math.max(ve,n.forceRadius*.1)));const W=n.forceStrength*$*10,J=_e/ve*W,Q=te/ve*W,ie=J,ue=-Q;g.vx+=(Y*ie+q*ue)/P*t,g.vy+=(-q*ie+Y*ue)/X*t}}if(!g.collisionPaused&&n.damping>0){const P=Math.max(0,1-n.damping*t);g.vx*=P,g.vy*=P}if(g.collisionPaused)g.vx=0,g.vy=0;else if(g.x+=g.vx*t,g.y+=g.vy*t,this.applyColliders(g,m))continue;if(n.attraction&&!g.collisionPaused){const P=g.maxLife-g.life;if(n.attractionDelayMode==="particle"?P>=Math.max(0,n.attractionDelay):this._elapsed-this._attractionEnabledAt>=Math.max(0,n.attractionDelay)){const U=Ur(n,g.x,g.y,this.simulationTransform),Y=n.attractionCenterX,q=n.attractionCenterY,z=Math.max(0,n.attractionRadius);if(!g.attractionActive){if(Math.hypot(Y-U.x,q-U.y)<=z){this.kill(m);continue}g.attractionActive=!0,g.attractionElapsed=0,g.attractionStartWorldX=U.x,g.attractionStartWorldY=U.y}g.attractionElapsed+=t;const ne=Math.max(1e-4,n.attractionDuration),H=Math.min(1,g.attractionElapsed/ne);let Z=ni(g.attractionStartWorldX,Y,H),ae=ni(g.attractionStartWorldY,q,H);if(n.attractionPath==="curve"){const te=Y-g.attractionStartWorldX,ve=q-g.attractionStartWorldY,$=Math.hypot(te,ve);if($>1e-4){const W=$*.25*g.attractionCurveSide,J=(g.attractionStartWorldX+Y)*.5-ve/$*W,Q=(g.attractionStartWorldY+q)*.5+te/$*W,ie=1-H;Z=ie*ie*g.attractionStartWorldX+2*ie*H*J+H*H*Y,ae=ie*ie*g.attractionStartWorldY+2*ie*H*Q+H*H*q}}const me=Math.hypot(Y-Z,q-ae);if(H>=1||me<=z){this.kill(m);continue}const _e=ig(n,Z,ae,this.simulationTransform);g.x=_e.x,g.y=_e.y,g.vx=0,g.vy=0}}const _=b,M=g.sprite,v=n.imageResources.find(P=>P.id===g.resourceId);if(v){const P=this.imageFrameState(v,g.maxLife-g.life);g.imageFrameIndex=P.index,M.texture=this.imageFrameTexture(v,g.imageFrameIndex),M.visible=P.visible}if(n.speedOverLifeEnabled){const P=Qa(bu(n.speedOverLifeMode,n.speedOverLifeMin,n.speedOverLifeMax,n.speedOverLifeCurve,_,g.speedScaleTarget),1),X=g.speedScale===0?P:P/g.speedScale;g.vx*=X,g.vy*=X,g.speedScale=P}let S=g.rotationSpeed;n.rotationOverLifeEnabled&&n.rotationOverLifeMode==="curve"&&(S=ni(n.rotationSpeedMin,n.rotationSpeedMax,Ps(n.rotationOverLifeCurve,_))),g.rotation+=S*t;let y=g.x,I=g.y;if(n.noise&&n.noiseAmt>0&&n.noiseRange>0&&n.noiseSpeed>0){const P=g.maxLife-g.life,X=Math.max(0,n.noiseRange)*Math.min(1,Math.max(0,n.noiseAmt)/100)*.5,U=P*Math.max(0,n.noiseSpeed)*Math.PI*2;y+=(Math.sin(g.noisePhaseX+U)-Math.sin(g.noisePhaseX))*X,I+=(Math.sin(g.noisePhaseY+U*.83)-Math.sin(g.noisePhaseY))*X}M.x=y,M.y=I,M.rotation=-g.rotation*Math.PI/180;let E=1,C=1;n.scaleOverLifeEnabled&&(E=bu(n.scaleOverLifeMode,n.scaleOverLifeMin,n.scaleOverLifeMax,n.scaleOverLifeCurve,_,g.scaleOverLifeX),C=n.scaleOverLifeAxisMode==="separate"?bu(n.scaleOverLifeMode,n.scaleYOverLifeMin,n.scaleYOverLifeMax,n.scaleYOverLifeCurve,_,g.scaleOverLifeY):E),M.scale.set(Qa(g.scaleStartX*E,1),Qa(g.scaleStartY*C,1));const R=n.alphaMode==="curve"?Ps(n.alphaCurve,_,this.resolveCurveMode(n.curveMode))*n.alphaScale:n.alpha*n.alphaScale;M.alpha=Qa((v==null?void 0:v.independentAlpha)==="fixed"?v.alpha:(v==null?void 0:v.independentAlpha)==="curve"?Ps(v.alphaCurve,_,this.resolveCurveMode(v.alphaCurveMode)):R,1);const B=(v==null?void 0:v.colorStart)||"#ffffff",k=(v==null?void 0:v.colorMode)==="lifetime"?ng(v.colorGradient,_):fo(B);M.tint=k,M.blendMode=Dn[(v==null?void 0:v.blend)||"normal"];const F=this.updateTrail(g,y,I,_,M),D=Ur(n,y,I,this.simulationTransform),N=((u=this.simulationTransform)==null?void 0:u.rotation)??n.rootRotation,j=Math.abs(((f=this.simulationTransform)==null?void 0:f.scaleX)??n.rootScaleX),O=Math.abs(((d=this.simulationTransform)==null?void 0:d.scaleY)??n.rootScaleY),L=F?{...F,bones:F.bones.map(P=>{const X=Ur(n,P.x,P.y,this.simulationTransform);return{...P,worldX:X.x,worldY:X.y,worldRotation:N-P.rotation}})}:void 0;a.push({boneName:g.boneName,spawnId:g.spawnId,x:y,y:I,rotation:g.rotation,scaleX:M.scale.x,scaleY:M.scale.y,worldX:D.x,worldY:D.y,worldRotation:N+g.rotation,worldScaleX:M.scale.x*j,worldScaleY:M.scale.y*O,alpha:M.alpha,colorHex:k,resourceId:g.resourceId,imageFrameIndex:g.imageFrameIndex,imageVisible:M.visible,trailState:L,active:!0})}return this.states=a,a}ensureTrailMesh(t){const s=this.cfg,n=s.trailResources.find(b=>b.id===t.trailResourceId)||s.trailResources[0],r=(n==null?void 0:n.texture)||et.EMPTY,o=Number(n==null?void 0:n.rotation)||0,a=Math.max(2,Math.min(16,Math.round(s.trailGridRows))),h=Math.max(2,Math.min(32,Math.round(s.trailGridCols))),l=Math.max(2,Math.min(16,Math.round((n==null?void 0:n.boneCount)??3))),c=`${a}:${h}:${l}:${(n==null?void 0:n.id)??0}:${o}`;if(t.trailMesh&&t.trailMeshSignature===c)return t.trailMesh.texture!==r&&(t.trailMesh.texture=r),t.trailMesh;t.trailMesh&&(this.removeChild(t.trailMesh),t.trailMesh.destroy()),t.trailMeshSignature&&t.trailMeshSignature!==c&&(t.trailHistory.length=0,t.trailBones.length=0);const u=new Float32Array(a*h*2),f=new Float32Array(a*h*2),d=[],m=[];for(let b=0;b.05?t.trailHistory.unshift({x:s,y:n}):(o.x=s,o.y=n);const a=Math.max(1,r)*1.5;let h=0,l=t.trailHistory.length;for(let c=1;c=a||c>=239){l=c+1;break}t.trailHistory.length>l&&(t.trailHistory.length=l)}sampleTrailBones(t,s,n){const r=Math.max(2,Math.min(16,Math.round(n))),o=t.trailHistory,a=[];if(!o.length)return a;let h=0;for(let c=1;c=u&&_>1e-4){const M=(u-f)/_;d={x:ni(g.x,b.x,M),y:ni(g.y,b.y,M)};break}f+=_}a.push({boneName:`${t.boneName}_trail_${c}`,x:d.x,y:d.y,rotation:0})}for(let c=0;c1){const c=a[0].rotation,f=(a[a.length-1].rotation-c+540)%360-180;for(let d=0;du.id===s.resourceId)||r.trailResources[0];if(!(o!=null&&o.texture)||s.bones.length<2){n.visible=!1;return}t.trailResourceId=o.id,n.texture!==o.texture&&(n.texture=o.texture);const a=Math.max(2,Math.min(16,Math.round(r.trailGridRows))),h=Math.max(2,Math.min(32,Math.round(r.trailGridCols))),l=n.vertices,c=[];for(let u=0;u.5&&s.alpha>0}updateTrail(t,s,n,r,o){const a=this.cfg;if(!a.trail||!t.trailEnabled||t.trailSampledLength<=0||t.trailSampledWidth<=0){t.trailHistory.length=0,t.trailBones.length=0,t.trailMesh&&(t.trailMesh.visible=!1);return}this.ensureTrailMesh(t);const h=a.trailResources.find(d=>d.id===t.trailResourceId)||a.trailResources[0];this.appendTrailPoint(t,s,n,t.trailSampledLength);const l=h!=null&&h.lifeLengthEnabled?Math.max(0,Ps(h.lifeLengthCurve,r)):1,c=Math.max(0,t.trailSampledLength)*l;t.trailBones=this.sampleTrailBones(t,c,(h==null?void 0:h.boneCount)??3),t.trailBones[0]&&(t.trailBones[0].x=s,t.trailBones[0].y=n);const u=(h==null?void 0:h.widthMode)==="particle"?(Math.abs(o.scale.x)+Math.abs(o.scale.y))*.5:1;t.trailCurrentWidth=Math.max(0,t.trailSampledWidth)*u,t.trailCurrentAlpha=(h==null?void 0:h.alphaMode)==="particle"?o.alpha:(h==null?void 0:h.alphaMode)==="curve"?Ps(h.alphaCurve,r):(h==null?void 0:h.alpha)??1,t.trailCurrentColor=(h==null?void 0:h.colorMode)==="particle"?o.tint:(h==null?void 0:h.colorMode)==="curve"?ng(h.colorGradient,r):fo((h==null?void 0:h.color)||"#ffffff");const f={bones:t.trailBones.map(d=>({...d})),activeBoneCount:t.trailBones.length,width:t.trailCurrentWidth,alpha:Math.min(1,Math.max(0,t.trailCurrentAlpha)),colorHex:t.trailCurrentColor,resourceId:t.trailResourceId};return this.skinTrailMesh(t,f),f}drawTrailMeshDebug(t){const s=this.trailDebugGfx;if(s.clear(),!t||!this.cfg.trail)return;const n=Math.max(2,Math.min(16,Math.round(this.cfg.trailGridRows))),r=Math.max(2,Math.min(32,Math.round(this.cfg.trailGridCols)));s.lineStyle(1,3790847,.72);for(const o of this.pool){const a=o.trailMesh;if(!(a!=null&&a.visible))continue;const h=a.vertices,l=(c,u)=>{const f=(c*n+u)*2;return{x:h[f],y:h[f+1]}};for(let c=0;c!v.active);if(s===-1)return;const{x:n,y:r}=this.spawnOrigin(),o=Xr(t.lifeMode,t.lifeMin,t.lifeMax,t.lifeCurve,this.rng()),a=Xr(t.speedMode,t.speedMin,t.speedMax,t.speedCurve,this.rng());let h;t.shape==="cone"?h=(t.direction+this.followSpawnAngle+ni(-t.coneAngle/2,t.coneAngle/2,this.rng()))*Math.PI/180:h=(t.direction+this.followSpawnAngle+ni(-t.spread/2,t.spread/2,this.rng()))*Math.PI/180;const l=this.pool[s],c=this.pickImageResource(),u=this._spawnSerial++;l.spawnId=u;const f=this.pickTrailResource(Vr(t.seed,u,1540483477));l.noisePhaseX=Vr(t.seed,u,1757159915)*Math.PI*2,l.noisePhaseY=Vr(t.seed,u,48610963)*Math.PI*2,l.gravityStrength=t.useGravity&&t.gravityMode==="random"?ni(t.gravityMin,t.gravityMax,this.rng()):t.gravityMin,l.windStrength=t.wind&&t.windMode==="random"?ni(t.windMin,t.windMax,this.rng()):t.windMin,l.attractionActive=!1,l.attractionElapsed=0,l.collisionPaused=!1,l.attractionCurveSide=Vr(t.seed,u,2738958700)<.5?-1:1,l.trailHistory.length=0,l.trailBones.length=0,l.trailCurrentWidth=0,l.trailCurrentAlpha=0,l.trailCurrentColor=16777215,l.trailResourceId=f.id;const d=Math.min(100,Math.max(0,Number(f.trailRatio)||0)),m=t.mode==="burst"?Math.max(0,Math.round(t.burstCount)):Math.max(0,Math.floor(t.rate*(t.streamBehavior==="loop"?Math.max(1,t.loopDurationFrames)/30:Math.max(0,t.duration)))),g=d>0&&m===1&&u===0,b=Vr(t.seed,u,668265261)*100,_=(v,S,y,I,E)=>{if(v!=="random")return Math.max(0,Number(S)||0);const C=Math.max(0,Math.min(Number(y)||0,Number(I)||0)),R=Math.max(0,Math.max(Number(y)||0,Number(I)||0));return ni(C,R,Vr(t.seed,u,E))};l.trailSampledLength=_(f.lengthMode,f.length,f.lengthMin,f.lengthMax,374761393),l.trailSampledWidth=_(f.widthSizeMode,f.width,f.widthMin,f.widthMax,3550635116),l.trailEnabled=t.trail&&(g||b0&&l.trailSampledWidth>0,l.trailMesh&&(l.trailMesh.visible=!1),l.active=!0,l.life=o,l.maxLife=o,l.x=n,l.y=r,l.trailEnabled&&l.trailHistory.push({x:n,y:r}),l.vx=Math.cos(h)*a,l.vy=(t.shape==="cone"?-Math.sin(h):Math.sin(h))*a,l.scaleStartX=Xr(t.scaleMode,t.scaleMin,t.scaleMax,t.scaleCurve,this.rng())*c.scale,l.scaleStartY=t.scaleAxisMode==="separate"?Xr(t.scaleMode,t.scaleYMin,t.scaleYMax,t.scaleYCurve,this.rng())*c.scale:l.scaleStartX,l.alphaStart=t.alpha,l.alphaEnd=t.alphaEnd,l.rotation=t.initialRotationMode==="direction"?-Math.atan2(l.vy,l.vx)*180/Math.PI+t.initialRotationMin:Xr(t.initialRotationMode,t.initialRotationMin,t.initialRotationMax,t.initialRotationCurve,this.rng()),l.rotationSpeed=t.rotationOverLifeEnabled?Xr(t.rotationOverLifeMode,t.rotationSpeedMin,t.rotationSpeedMax,t.rotationOverLifeCurve,this.rng()):0,l.speedScale=1,l.speedScaleTarget=t.speedOverLifeMode==="random"?ni(t.speedOverLifeMin,t.speedOverLifeMax,this.rng()):t.speedOverLifeMin,l.scaleOverLifeX=t.scaleOverLifeMode==="random"?ni(t.scaleOverLifeMin,t.scaleOverLifeMax,this.rng()):t.scaleOverLifeMin,l.scaleOverLifeY=t.scaleOverLifeMode==="random"?ni(t.scaleYOverLifeMin,t.scaleYOverLifeMax,this.rng()):t.scaleYOverLifeMin,l.resourceId=c.id;const M=this.imageFrameState(c,0);l.imageFrameIndex=M.index,l.sprite.texture=this.imageFrameTexture(c,M.index),l.sprite.anchor.set(c.anchorX,c.anchorY),l.sprite.blendMode=Dn[c.blend],l.sprite.tint=fo(c.colorStart),l.sprite.visible=!0}pickImageResource(){const t=this.cfg.imageResources.filter(r=>r.texture||r.sequenceFrames.some(o=>o.texture));if(!t.length)return{id:1,texture:this.cfg.texture,textureName:"star",textureFolder:"",previewUrl:"/images/star.png",imageMode:"fixed",sequencePlayback:"loop-forward",sequenceFps:30,sequenceFrames:[],weight:100,locked:!1,scale:1,anchorX:.5,anchorY:.5,colorMode:"fixed",colorStart:"#ffffff",colorEnd:"#ff4d4d",blend:"normal",colorGradient:[{position:0,color:"#ffffff"},{position:1,color:"#ff4d4d"}],independentAlpha:"off",alpha:1,alphaCurveMode:"跟随导出",alphaCurve:[{x:0,y:0},{x:.1,y:1},{x:.9,y:1},{x:1,y:0}]};const s=t.reduce((r,o)=>r+Math.max(0,o.weight),0);if(s<=0)return t[Math.floor(this.rng()*t.length)];let n=this.rng()*s;for(const r of t)if(n-=Math.max(0,r.weight),n<=0)return r;return t[t.length-1]}imageFrameState(t,s){if(t.imageMode!=="sequence"||t.sequenceFrames.length<=1)return{index:0,visible:!0};const n=Math.min(120,Math.max(1,Number(t.sequenceFps)||30)),r=Math.max(0,Math.floor(Math.max(0,s)*n)),o=t.sequenceFrames.length-1;return t.sequencePlayback==="once-hide"?{index:Math.min(o,r),visible:r<=o}:t.sequencePlayback==="once-hold"?{index:Math.min(o,r),visible:!0}:t.sequencePlayback==="loop-reverse"?{index:o-r%t.sequenceFrames.length,visible:!0}:{index:r%t.sequenceFrames.length,visible:!0}}imageFrameTexture(t,s){var n;return t.imageMode==="sequence"&&t.sequenceFrames.length?((n=t.sequenceFrames[Math.max(0,Math.min(t.sequenceFrames.length-1,s))])==null?void 0:n.texture)||t.texture||this.cfg.texture:t.texture||this.cfg.texture}pickTrailResource(t){const s=this.cfg.trailResources.filter(o=>o.texture);if(!s.length)return this.cfg.trailResources[0]||{id:1,texture:null,textureName:"trail",previewUrl:"/images/trail.png",weight:100,locked:!1,rotation:0,colorMode:"particle",color:"#ffffff",colorGradient:[{position:0,color:"#ffffff"},{position:1,color:"#ffffff"}],blend:"normal",alphaMode:"particle",alpha:1,alphaCurve:[{x:0,y:1},{x:1,y:1}],boneCount:3,trailRatio:100,lengthMode:"fixed",length:100,lengthMin:100,lengthMax:100,widthSizeMode:"fixed",width:100,widthMin:100,widthMax:100,widthMode:"particle",lifeLengthEnabled:!1,lifeLengthCurve:[{x:0,y:1},{x:1,y:1}],shapeEnabled:!1,shapeCurve:[{x:0,y:1},{x:1,y:1}]};const n=s.reduce((o,a)=>o+Math.max(0,a.weight),0);if(n<=0)return s[Math.min(s.length-1,Math.floor(t*s.length))];let r=t*n;for(const o of s)if(r-=Math.max(0,o.weight),r<=0)return o;return s[s.length-1]}kill(t){const s=this.pool[t];s.active=!1,s.sprite.visible=!1,s.trailHistory.length=0,s.trailBones.length=0,s.trailMesh&&(s.trailMesh.visible=!1)}clear(){for(const t of this.pool)t.active=!1,t.sprite.visible=!1,t.trailHistory.length=0,t.trailBones.length=0,t.trailMesh&&(t.trailMesh.visible=!1)}get activeCount(){let t=0;for(const s of this.pool)s.active&&t++;return t}capture(){const t=[];for(const s of this.pool)s.active&&t.push({boneName:s.boneName,spawnId:s.spawnId,x:s.sprite.x,y:s.sprite.y,rotation:s.rotation,scaleX:s.sprite.scale.x,scaleY:s.sprite.scale.y,...this.captureWorldTransform(s),alpha:s.sprite.alpha,colorHex:s.sprite.tint,resourceId:s.resourceId,imageFrameIndex:s.imageFrameIndex,imageVisible:s.sprite.visible,active:!0,trailState:this.cfg.trail&&s.trailBones.length?{bones:s.trailBones.map(n=>{var o;const r=Ur(this.cfg,n.x,n.y,this.simulationTransform);return{...n,worldX:r.x,worldY:r.y,worldRotation:(((o=this.simulationTransform)==null?void 0:o.rotation)??this.cfg.rootRotation)-n.rotation}}),activeBoneCount:s.trailBones.length,width:s.trailCurrentWidth,alpha:s.trailCurrentAlpha,colorHex:s.trailCurrentColor,resourceId:s.trailResourceId}:void 0});return t}captureWorldTransform(t){var r,o,a;const s=Ur(this.cfg,t.sprite.x,t.sprite.y,this.simulationTransform),n=((r=this.simulationTransform)==null?void 0:r.rotation)??this.cfg.rootRotation;return{worldX:s.x,worldY:s.y,worldRotation:n+t.rotation,worldScaleX:t.sprite.scale.x*Math.abs(((o=this.simulationTransform)==null?void 0:o.scaleX)??this.cfg.rootScaleX),worldScaleY:t.sprite.scale.y*Math.abs(((a=this.simulationTransform)==null?void 0:a.scaleY)??this.cfg.rootScaleY)}}apply(t){var n;const s=new Map;for(const r of t)s.set(r.boneName,r);for(const r of this.pool){const o=s.get(r.boneName);if(!o){r.active=!1,r.sprite.visible=!1,r.trailMesh&&(r.trailMesh.visible=!1);continue}r.active=o.active;const a=r.sprite;if(a.visible=o.active&&o.imageVisible!==!1,a.x=o.x,a.y=o.y,a.rotation=-o.rotation*Math.PI/180,a.scale.set(o.scaleX,o.scaleY),a.alpha=o.alpha,a.tint=o.colorHex,o.resourceId!=null){const h=this.cfg.imageResources.find(l=>l.id===o.resourceId);h&&(r.imageFrameIndex=o.imageFrameIndex??0,a.texture=this.imageFrameTexture(h,r.imageFrameIndex),a.anchor.set(h.anchorX,h.anchorY),a.blendMode=Dn[h.blend])}this.cfg.trail&&o.trailState?(r.trailResourceId=o.trailState.resourceId??((n=this.cfg.trailResources[0])==null?void 0:n.id)??1,r.trailBones=o.trailState.bones.map(h=>({...h})),r.trailCurrentWidth=o.trailState.width,r.trailCurrentAlpha=o.trailState.alpha,this.skinTrailMesh(r,o.trailState)):r.trailMesh&&(r.trailMesh.visible=!1)}}reset(){for(const t of this.pool)t.active=!1,t.sprite.visible=!1,t.trailHistory.length=0,t.trailBones.length=0,t.trailMesh&&(t.trailMesh.visible=!1);this.accumulator=0,this.burstTimer=0,this._spawnSerial=0,this._elapsed=0,this._attractionEnabledAt=0,this._attractionWasEnabled=!1,this._lastSeed=this.cfg.seed,this.rng=wu(this.cfg.seed>>>0)}restartEmissionCycle(){this.accumulator=0,this.burstTimer=0,this._spawnSerial=0,this._elapsed=0,this._attractionEnabledAt=0,this._attractionWasEnabled=this.cfg.attraction,this._lastSeed=this.cfg.seed,this.rng=wu(this.cfg.seed>>>0)}}function ni(i,e,t){return i+(e-i)*t}function Qa(i,e){return Number.isFinite(i)?i:e}function Ur(i,e,t,s=null){const n=Math.max(1e-4,Math.abs((s==null?void 0:s.scaleX)??i.rootScaleX)),r=Math.max(1e-4,Math.abs((s==null?void 0:s.scaleY)??i.rootScaleY)),o=-((s==null?void 0:s.rotation)??i.rootRotation)*Math.PI/180,a=Math.cos(o),h=Math.sin(o),l=(s==null?void 0:s.centerX)??i.centerX,c=(s==null?void 0:s.centerY)??i.centerY,u=l+a*n*e-h*r*t,f=-c+h*n*e+a*r*t;return{x:u,y:-f}}function ig(i,e,t,s=null){const n=Math.max(1e-4,Math.abs((s==null?void 0:s.scaleX)??i.rootScaleX)),r=Math.max(1e-4,Math.abs((s==null?void 0:s.scaleY)??i.rootScaleY)),o=-((s==null?void 0:s.rotation)??i.rootRotation)*Math.PI/180,a=Math.cos(o),h=Math.sin(o),l=e-((s==null?void 0:s.centerX)??i.centerX),c=-t+((s==null?void 0:s.centerY)??i.centerY);return{x:(a*l+h*c)/n,y:(-h*l+a*c)/r}}function xE(i,e,t,s=null){const n=Math.max(1e-4,Math.abs((s==null?void 0:s.scaleX)??i.rootScaleX)),r=Math.max(1e-4,Math.abs((s==null?void 0:s.scaleY)??i.rootScaleY)),o=-((s==null?void 0:s.rotation)??i.rootRotation)*Math.PI/180,a=Math.cos(o),h=Math.sin(o),l=a*n*e-h*r*t,c=h*n*e+a*r*t;return{x:l,y:-c}}function bE(i,e,t,s=null){const n=Math.max(1e-4,Math.abs((s==null?void 0:s.scaleX)??i.rootScaleX)),r=Math.max(1e-4,Math.abs((s==null?void 0:s.scaleY)??i.rootScaleY)),o=-((s==null?void 0:s.rotation)??i.rootRotation)*Math.PI/180,a=Math.cos(o),h=Math.sin(o),l=-t;return{x:(a*e+h*l)/n,y:(-h*e+a*l)/r}}function wE(i,e,t){const s=i.rotation*Math.PI/180,n=Math.cos(s),r=Math.sin(s),o=Math.max(1e-4,Math.abs(i.scaleX??1)),a=Math.max(1e-4,Math.abs(i.scaleY??1)),h=e-i.x,l=t-i.y,c=(n*h+r*l)/o,u=(-r*h+n*l)/a,f=(I,E,C,R)=>{const B=C/o,k=R/a,F=Math.max(1e-4,Math.hypot(B,k)),D=B/F,N=k/F,j=n*D-r*N,O=r*D+n*N;return{x:i.x+n*I*o-r*E*a+j*.05,y:i.y+r*I*o+n*E*a+O*.05,nx:j,ny:O}};if(i.shape==="circle"){const I=Math.max(.001,i.radius),E=Math.hypot(c,u);if(E>=I)return null;const C=E>1e-4?c/E:1,R=E>1e-4?u/E:0;return f(C*I,R*I,C,R)}if(i.shape==="ellipse"){const I=Math.max(.001,i.radiusX),E=Math.max(.001,i.radiusY),C=Math.hypot(c/I,u/E);if(C>=1)return null;const R=C>1e-4?1/C:1,B=C>1e-4?c*R:I,k=C>1e-4?u*R:0,F=Math.max(1e-4,Math.hypot(B/(I*I),k/(E*E)));return f(B,k,B/(I*I)/F,k/(E*E)/F)}if(i.shape==="rect"){const I=Math.max(.001,i.width*.5),E=Math.max(.001,i.height*.5);if(Math.abs(c)>=I||Math.abs(u)>=E)return null;const C=I-Math.abs(c),R=E-Math.abs(u);if(C=0?1:-1;return f(k*I,u,k,0)}const B=u>=0?1:-1;return f(c,B*E,0,B)}const d=Math.max(3,Math.min(16,Math.round(i.sides||(i.shape==="custom"?5:6)))),m=Math.max(.001,i.width*.5),g=Math.max(.001,i.height*.5),b=Array.from({length:d},(I,E)=>{const C=Math.PI*.5+E/d*Math.PI*2;return{x:Math.cos(C)*m,y:Math.sin(C)*g}});let _=!1;for(let I=0,E=b.length-1;Iu!=R.y>u&&c<(R.x-C.x)*(u-C.y)/(R.y-C.y)+C.x&&(_=!_)}if(!_)return null;let M=b[0].x,v=b[0].y,S=1/0;for(let I=0;I>>0^Math.imul(e+1,2654435761)^t)>>>0;return s^=s>>>16,s=Math.imul(s,2146121005),s^=s>>>15,s=Math.imul(s,2221713035),s^=s>>>16,(s>>>0)/4294967296}function Xr(i,e,t,s,n){return i==="fixed"?e:i==="curve"?ni(e,t,Ps(s,n)):ni(e,t,n)}function bu(i,e,t,s,n,r){return i==="curve"?ni(e,t,Ps(s,n)):i==="random"?r:e}function sg(i,e,t,s,n){const r=1-n;return r*r*r*i+3*r*r*n*e+3*r*n*n*t+n*n*n*s}function Ps(i,e,t="线性"){if(!Array.isArray(i)||i.length===0)return 1;const s=[...i].sort((n,r)=>n.x-r.x);if(e<=s[0].x)return s[0].y;if(e>=s[s.length-1].x)return s[s.length-1].y;for(let n=0;n=s[n].x&&e<=s[n+1].x){const r=s[n],o=s[n+1],a=o.x-r.x||1;if(t!=="贝塞尔")return ni(r.y,o.y,(e-r.x)/a);const h=r.x+(r.outX??a/3),l=r.y+(r.outY??(o.y-r.y)/3),c=o.x+(o.inX??-a/3),u=o.y+(o.inY??-(o.y-r.y)/3);let f=0,d=1;for(let m=0;m<14;m++){const g=(f+d)/2;sg(r.x,h,c,o.x,g)>>0;return function(){e|=0,e=e+1831565813|0;let t=Math.imul(e^e>>>15,1|e);return t=t+Math.imul(t^t>>>7,61|t)^t,((t^t>>>14)>>>0)/4294967296}}function fo(i){let e=i.replace("#","");return e.length===3&&(e=e.split("").map(t=>t+t).join("")),parseInt(e,16)}function SE(i,e,t){const s=rg(i),n=rg(e),r=Math.round(s[0]+(n[0]-s[0])*t),o=Math.round(s[1]+(n[1]-s[1])*t),a=Math.round(s[2]+(n[2]-s[2])*t);return r<<16|o<<8|a}function ng(i,e){if(!Array.isArray(i)||i.length===0)return 16777215;const t=[...i].sort((s,n)=>s.position-n.position);if(e<=t[0].position)return fo(t[0].color);if(e>=t[t.length-1].position)return fo(t[t.length-1].color);for(let s=0;sr.position)continue;const o=(e-n.position)/Math.max(1e-4,r.position-n.position);return SE(n.color,r.color,o)}return fo(t[t.length-1].color)}function rg(i){let e=i.replace("#","");e.length===3&&(e=e.split("").map(s=>s+s).join(""));const t=parseInt(e,16);return[t>>16&255,t>>8&255,t&255]}const Mr=new Map,xr=new Map;function TE(i){return[...Mr.values()].some(e=>e===i)}function py(i){if(!(TE(i)||(xr.get(i)||0)>0)){xr.delete(i);for(const e of i.textures)e.destroy(!0)}}function ME(i){const e=xr.get(i)||0;e>1?xr.set(i,e-1):xr.delete(i),py(i)}function EE(i){return Mr.get(i)||null}function Lh(i,e){Ea(i),Mr.set(i,e)}function AE(i){const e=Mr.get(i);return e?(xr.set(e,(xr.get(e)||0)+1),e):null}function CE(i,e){const t=Mr.get(i);return t?(Lh(e,t),!0):!1}function Ea(i){const e=Mr.get(i);e&&(Mr.delete(i),py(e))}function Ut(i){if(Array.isArray(i))return i.map(e=>Ut(e));if(i&&typeof i=="object"){const e=Object.getPrototypeOf(i);if(e===Object.prototype||e===null){const t={};for(const[s,n]of Object.entries(i))t[s]=Ut(n);return t}}return i}const my=["3.8","4.0","4.1","4.2"];function Wl(i){const e=String(i||"").trim();return my.find(t=>e===t||e.startsWith(`${t}.`))||null}function Sd(){return my.join(" / ")}function uf(){return{imagesPath:"./images/",spineVersion:"4.2",keyframeCurve:"linear",fps:30,omitFps:!1,integerFrameAlignment:!0,bonePool:!0,excludeEmptyAnimations:!1,fileName:"SpineParticle.json"}}function gy(i){const e=Object.assign(uf(),i||{});return e.imagesPath=String(e.imagesPath||"./images/"),e.spineVersion=Wl(e.spineVersion)||"4.2",e.keyframeCurve=e.keyframeCurve==="bezier"?"bezier":"linear",e.fps=Math.min(240,Math.max(1,Math.round(Number(e.fps)||30))),e.omitFps=e.omitFps===!0,e.integerFrameAlignment=e.integerFrameAlignment!==!1,e.bonePool=e.bonePool!==!1,e.excludeEmptyAnimations=e.excludeEmptyAnimations===!0,e.fileName=String(e.fileName||"SpineParticle.json"),e}let el=1,tl=1,il=1,sl=1;function nl(i,e){const t=new Set(e),s=`${i} Copy`;if(!t.has(s))return s;let n=2;for(;t.has(`${s} ${n}`);)n++;return`${s} ${n}`}const Aa=tw("particle",{state:()=>({editor:{viewScale:1,viewX:0,viewY:0},systems:[],colliders:[],paths:[],spines:[],activeId:0,activeObjectType:"particle",activeObjectId:0,timeline:{playing:!0,loop:!0,frame:0,totalFrames:60,fps:30,recorded:!1,animation:"animation",animations:["animation"]},settings:{parameterPanelOnRight:!0,tickEnabled:!1,axisFontSize:12,tickWidth:1,showAxisLabels:!0,axisColor:"#7a86ad",undoLimit:20,backgroundX:0,backgroundY:0,backgroundOpacity:1,backgroundImageName:"",backgroundImageData:"",showEmitter:!0,showBones:!1,bonePointDrawSize:1,boneAxisDrawSize:2,showSkinMesh:!1,showGrid:!0,exportSettings:uf()}}),getters:{activeSystemCount:i=>i.systems.length},actions:{syncSceneSequences(){el=Math.max(el,...this.systems.map(i=>i.id+1),1),tl=Math.max(tl,...this.colliders.map(i=>i.id+1),1),il=Math.max(il,...this.paths.map(i=>i.id+1),1),sl=Math.max(sl,...this.spines.map(i=>i.id+1),1)},addSystem(i){const e=ga();i!=null&&i.config&&Object.assign(e,i.config);const t=new Set(this.systems.map(r=>r.config.name));if(t.has(e.name)){let r=0;for(const a of this.systems){const h=/^ParticleSystem(\d+)$/.exec(a.config.name);h&&(r=Math.max(r,parseInt(h[1],10)))}e.name=`ParticleSystem${r+1}`;let o=2;for(;t.has(e.name);)e.name=`ParticleSystem${r+o}`,o++}const s=this.timeline.animations.includes(this.timeline.animation)?this.timeline.animation:this.timeline.animations[0]||"animation",n={id:el++,visible:!0,animation:s,config:e};return this.systems.push(n),this.activeId=n.id,this.activeObjectType="particle",this.activeObjectId=n.id,n},removeSystem(i){var s;const e=this.systems.findIndex(n=>n.id===i);e>=0&&this.systems.splice(e,1),this.activeId===i&&(this.activeId=((s=this.systems[0])==null?void 0:s.id)??0);const t=this.systems.find(n=>n.id===this.activeId);if(t&&(this.timeline.animation=t.animation),this.activeObjectType==="particle"&&this.activeObjectId===i){const n=this.systems[0];this.activeObjectId=(n==null?void 0:n.id)??0}},selectSystem(i){this.activeId=i,this.activeObjectType="particle",this.activeObjectId=i;const e=this.systems.find(t=>t.id===i);e&&(this.timeline.animation=e.animation)},setSystemAnimation(i,e){if(!this.timeline.animations.includes(e))return;const t=this.systems.find(s=>s.id===i);t&&(t.animation=e,this.timeline.animation=e)},addAnimation(){const i=new Set(this.timeline.animations);let e=2,t=`animation${e}`;for(;i.has(t);)t=`animation${++e}`;this.timeline.animations.push(t),this.timeline.animation=t;const s=this.systems.find(n=>n.id===this.activeId);return s&&(s.animation=t),t},renameAnimation(i,e){const t=e.trim(),s=this.timeline.animations.indexOf(i);if(s<0||!t||t!==i&&this.timeline.animations.includes(t))return!1;this.timeline.animations[s]=t;for(const n of this.systems)n.animation===i&&(n.animation=t);return this.timeline.animation===i&&(this.timeline.animation=t),!0},removeAnimation(i){if(this.timeline.animations.length<=1)return!1;const e=this.timeline.animations.indexOf(i);if(e<0)return!1;this.timeline.animations.splice(e,1);const t=this.timeline.animations[Math.min(e,this.timeline.animations.length-1)];for(const s of this.systems)s.animation===i&&(s.animation=t);return this.timeline.animation===i&&(this.timeline.animation=t),!0},addCollider(){const i=tl++,e={id:i,name:`Collider${i}`,visible:!0,tags:["Default"],selectedTag:"Default",shape:"circle",enabled:!0,x:0,y:0,rotation:0,scaleX:1,scaleY:1,radius:50,radiusX:70,radiusY:45,width:120,height:80,sides:6,response:"physics",elasticity:.8,friction:.3,followPath:!1,followPathId:0,followDuration:2,followPathRotation:!1,followCurveMode:"跟随导出",followCurve:[{x:0,y:0},{x:1,y:1}]};return this.colliders.push(e),this.activeObjectType="collision",this.activeObjectId=e.id,e},addPath(){const i=il++,e={id:i,name:`Path${i}`,visible:!0,enabled:!0,x:0,y:0,rotation:0,scaleX:1,scaleY:1,closed:!1,color:"#ff933e",preset:"",points:[]};return this.paths.push(e),this.activeObjectType="path",this.activeObjectId=e.id,e},addSpine(){const i=sl++,e={id:i,name:`SpineSkeleton${i}`,enabled:!0,visible:!0,x:0,y:0,rotation:0,scaleX:1,scaleY:1,timeOffset:0,skeletonFileName:"",atlasFileName:"",textureFileNames:[],dataVersion:"",sourceBundle:null,selectedAnimation:"",selectedBone:"",animations:[],bones:[],assetVersion:0,status:"empty",error:""};return this.spines.push(e),this.activeObjectType="spine",this.activeObjectId=e.id,e},duplicateSelectedObject(){const i=this.activeObjectId;if(!i)return null;if(this.activeObjectType==="particle"){const s=this.systems.find(r=>r.id===i);if(!s)return null;const n=Ut(s);return n.id=el++,n.config.name=nl(s.config.name,this.systems.map(r=>r.config.name)),n.frames=void 0,this.systems.push(n),this.activeId=n.id,this.activeObjectId=n.id,this.timeline.animation=n.animation,n}if(this.activeObjectType==="collision"){const s=this.colliders.find(r=>r.id===i);if(!s)return null;const n=Ut(s);return n.id=tl++,n.name=nl(s.name,this.colliders.map(r=>r.name)),this.colliders.push(n),this.activeObjectId=n.id,n}if(this.activeObjectType==="path"){const s=this.paths.find(r=>r.id===i);if(!s)return null;const n=Ut(s);return n.id=il++,n.name=nl(s.name,this.paths.map(r=>r.name)),this.paths.push(n),this.activeObjectId=n.id,n}const e=this.spines.find(s=>s.id===i);if(!e)return null;const t=Ut(e);return t.id=sl++,t.name=nl(e.name,this.spines.map(s=>s.name)),t.selectedBone="",CE(e.id,t.id),this.spines.push(t),this.activeObjectId=t.id,t},selectSceneObject(i,e){if(this.activeObjectType=i,this.activeObjectId=e,i==="particle"){this.activeId=e;const t=this.systems.find(s=>s.id===e);t&&(this.timeline.animation=t.animation)}},removeCollider(i){var t;const e=this.colliders.findIndex(s=>s.id===i);if(e>=0&&this.colliders.splice(e,1),this.activeObjectType==="collision"&&this.activeObjectId===i){const s=this.systems[0];this.activeObjectType=s?"particle":"collision",this.activeObjectId=(s==null?void 0:s.id)??((t=this.colliders[0])==null?void 0:t.id)??0}},removePath(i){var t;const e=this.paths.findIndex(s=>s.id===i);if(e>=0&&this.paths.splice(e,1),this.activeObjectType==="path"&&this.activeObjectId===i){const s=this.systems[0];this.activeObjectType=s?"particle":"path",this.activeObjectId=(s==null?void 0:s.id)??((t=this.paths[0])==null?void 0:t.id)??0}},removeSpine(i){Ea(i);const e=this.spines.findIndex(t=>t.id===i);if(e>=0&&this.spines.splice(e,1),this.activeObjectType==="spine"&&this.activeObjectId===i){const t=this.systems[0],s=this.colliders[0],n=this.paths[0],r=this.spines[0];t?(this.activeObjectType="particle",this.activeObjectId=t.id,this.activeId=t.id):s?(this.activeObjectType="collision",this.activeObjectId=s.id):n?(this.activeObjectType="path",this.activeObjectId=n.id):(this.activeObjectType="spine",this.activeObjectId=(r==null?void 0:r.id)??0)}this.recalcTotalFrames()},play(){this.timeline.frame>=Math.max(0,this.timeline.totalFrames-1)&&(this.timeline.frame=0),this.timeline.playing=!0},pause(){this.timeline.playing=!1},togglePlay(){this.timeline.playing?this.pause():this.play()},toStart(){this.timeline.frame=0},previousFrame(){this.timeline.playing=!1,this.timeline.frame=Math.max(0,this.timeline.frame-1)},nextFrame(){this.timeline.playing=!1,this.timeline.frame=Math.min(Math.max(0,this.timeline.totalFrames-1),this.timeline.frame+1)},toEnd(){this.timeline.playing=!1,this.timeline.frame=Math.max(0,this.timeline.totalFrames-1)},toggleLoop(){this.timeline.loop=!this.timeline.loop},setFrame(i){this.timeline.frame=Math.max(0,Math.min(i,this.timeline.totalFrames-1))},recalcTotalFrames(){const i=this.timeline.fps||30;let e=0;for(const s of this.systems){const n=s.config,r=Math.max(0,Number(n.lifeMin)||0),o=Math.max(0,Number(n.lifeMax)||0),a=n.lifeMode==="fixed"?r:Math.max(r,o),h=n.mode==="stream"?n.streamBehavior==="loop"?Math.max(1/i,Math.ceil(Math.max(1,Number(n.loopDurationFrames)||1))/i):Math.max(1/i,Number(n.duration)||0):0;let l=Math.max(0,Number(n.delay)||0)+h+a;if(n.mode==="stream"&&n.streamBehavior==="loop")if(n.generateLoopEndAnimation)l=Math.max(0,Number(n.delay)||0)+a+1/i;else if(n.generateLoopStartAnimation){const c=Math.max(1,Math.ceil(a/h));l=Math.max(0,Number(n.delay)||0)+h*c}else l=Math.max(0,Number(n.delay)||0)+h;l>e&&(e=l)}for(const s of this.spines){const n=s.animations.find(o=>o.name===s.selectedAnimation);if(!n)continue;const r=Math.max(0,Number(s.timeOffset)||0)+Math.max(0,n.duration||0);r>e&&(e=r)}for(const s of this.colliders){if(!s.followPath||!s.followPathId)continue;const n=Math.max(0,Number(s.followDuration)||0);n>e&&(e=n)}const t=Math.max(1,Math.ceil(e*i)+1);return this.timeline.totalFrames=t,this.timeline.frame>=t&&(this.timeline.frame=t-1),t}}}),vy="SpineParticle.SystemSettings",yy=1,_u="SpineParticle.SystemSettings.v1";function Lo(i,e,t,s){const n=Number(i);return Math.min(t,Math.max(e,Number.isFinite(n)?n:s))}function IE(i){return{parameterPanelOnRight:i.parameterPanelOnRight,undoLimit:i.undoLimit,showEmitter:i.showEmitter,showBones:i.showBones,bonePointDrawSize:i.bonePointDrawSize,boneAxisDrawSize:i.boneAxisDrawSize,showSkinMesh:i.showSkinMesh,tickEnabled:i.tickEnabled,axisFontSize:i.axisFontSize,tickWidth:i.tickWidth,showAxisLabels:i.showAxisLabels,axisColor:i.axisColor}}function RE(i,e){const t=n=>i[n]==null?!!e[n]:i[n]===!0,s=typeof i.axisColor=="string"&&/^#[0-9a-f]{6}$/i.test(i.axisColor)?i.axisColor:e.axisColor;return{parameterPanelOnRight:t("parameterPanelOnRight"),undoLimit:Math.round(Lo(i.undoLimit,1,200,e.undoLimit)),showEmitter:t("showEmitter"),showBones:t("showBones"),bonePointDrawSize:Lo(i.bonePointDrawSize,.1,10,e.bonePointDrawSize),boneAxisDrawSize:Lo(i.boneAxisDrawSize,.1,10,e.boneAxisDrawSize),showSkinMesh:t("showSkinMesh"),tickEnabled:t("tickEnabled"),axisFontSize:Math.round(Lo(i.axisFontSize,8,40,e.axisFontSize)),tickWidth:Lo(i.tickWidth,1,5,e.tickWidth),showAxisLabels:t("showAxisLabels"),axisColor:s}}function PE(i){let e;try{e=JSON.parse(i)}catch{throw new Error("系统设置缓存不是有效的 JSON")}const t=e;if(t.format!==vy)throw new Error("不是 Spine粒子编辑器系统设置缓存");if(t.version!==yy)throw new Error(`暂不支持系统配置版本:${t.version??"未知"}`);if(!t.settings||typeof t.settings!="object")throw new Error("系统设置缓存缺少 settings");return t}function kE(i,e){Object.assign(i.settings,RE(e,i.settings))}let rl=null;function FE(i){rl==null||rl();try{const e=localStorage.getItem(_u);e&&kE(i,PE(e).settings)}catch{try{localStorage.removeItem(_u)}catch{}}rl=cs(()=>IE(i.settings),e=>{const t={format:vy,version:yy,savedAt:new Date().toISOString(),settings:e};try{localStorage.setItem(_u,JSON.stringify(t))}catch{}},{deep:!0})}if(typeof window<"u"&&window.PIXI){let i=window.require;window.require=e=>{if(i)return i(e);if(e.startsWith("@pixi/"))return window.PIXI}}class xy{constructor(){A(this,"entries",{});A(this,"size",0)}add(e){let t=this.entries[e];return this.entries[e]=!0,t?!1:(this.size++,!0)}addAll(e){let t=this.size;for(var s=0,n=e.length;s1&&(this.r=1),this.g<0?this.g=0:this.g>1&&(this.g=1),this.b<0?this.b=0:this.b>1&&(this.b=1),this.a<0?this.a=0:this.a>1&&(this.a=1),this}static rgba8888ToColor(e,t){e.r=((t&4278190080)>>>24)/255,e.g=((t&16711680)>>>16)/255,e.b=((t&65280)>>>8)/255,e.a=(t&255)/255}static rgb888ToColor(e,t){e.r=((t&16711680)>>>16)/255,e.g=((t&65280)>>>8)/255,e.b=(t&255)/255}toRgb888(){const e=t=>("0"+(t*255).toString(16)).slice(-2);return+("0x"+e(this.r)+e(this.g)+e(this.b))}static fromString(e,t=new Di){return t.setFromString(e)}};A(Di,"WHITE",new Di(1,1,1,1)),A(Di,"RED",new Di(1,0,0,1)),A(Di,"GREEN",new Di(0,1,0,1)),A(Di,"BLUE",new Di(0,0,1,1)),A(Di,"MAGENTA",new Di(1,0,1,1));let ot=Di;const ti=class ti{static clamp(e,t,s){return es?s:e}static cosDeg(e){return Math.cos(e*ti.degRad)}static sinDeg(e){return Math.sin(e*ti.degRad)}static atan2Deg(e,t){return Math.atan2(e,t)*ti.degRad}static signum(e){return e>0?1:e<0?-1:0}static toInt(e){return e>0?Math.floor(e):Math.ceil(e)}static cbrt(e){let t=Math.pow(Math.abs(e),.3333333333333333);return e<0?-t:t}static randomTriangular(e,t){return ti.randomTriangularWith(e,t,(e+t)*.5)}static randomTriangularWith(e,t,s){let n=Math.random(),r=t-e;return n<=(s-e)/r?e+Math.sqrt(n*r*(s-e)):t-Math.sqrt((1-n)*r*(t-s))}static isPowerOfTwo(e){return e&&(e&e-1)===0}};A(ti,"PI",3.1415927),A(ti,"PI2",ti.PI*2),A(ti,"invPI2",1/ti.PI2),A(ti,"radiansToDegrees",180/ti.PI),A(ti,"radDeg",ti.radiansToDegrees),A(ti,"degreesToRadians",ti.PI/180),A(ti,"degRad",ti.degreesToRadians);let ke=ti;const Nn=class Nn{static arrayCopy(e,t,s,n,r){for(let o=t,a=n;o=t?e:Nn.setArraySize(e,t,s)}static newArray(e,t){let s=new Array(e);for(let n=0;n0?this.items.pop():this.instantiator()}free(e){e.reset&&e.reset(),this.items.push(e)}freeAll(e){for(let t=0;t>1)*a;let h=t.bone.skeleton,l=t.deform,c=this.vertices,u=this.bones;if(!u){l.length>0&&(c=l);let g=t.bone,b=g.worldX,_=g.worldY,M=g.a,v=g.b,S=g.c,y=g.d;for(let I=s,E=o;E=this.regions.length&&(s=this.regions.length-1);let n=this.regions[s];t.region!=n&&(t.region=n,t.updateRegion())}getPath(e,t){let s=e,n=(this.start+t).toString();for(let r=this.digits-n.length;r>0;r--)s+="0";return s+=n,s}static nextID(){return Qr._nextID++}};A(Qr,"_nextID",0);let Kl=Qr;var fi;(function(i){i[i.hold=0]="hold",i[i.once=1]="once",i[i.loop=2]="loop",i[i.pingpong=3]="pingpong",i[i.onceReverse=4]="onceReverse",i[i.loopReverse=5]="loopReverse",i[i.pingpongReverse=6]="pingpongReverse"})(fi||(fi={}));const wy=[fi.hold,fi.once,fi.loop,fi.pingpong,fi.onceReverse,fi.loopReverse,fi.pingpongReverse];class df{constructor(e,t,s){A(this,"name");A(this,"timelines",[]);A(this,"timelineIds",new xy);A(this,"duration");if(!e)throw new Error("name cannot be null.");this.name=e,this.setTimelines(t),this.duration=s}setTimelines(e){if(!e)throw new Error("timelines cannot be null.");this.timelines=e,this.timelineIds.clear();for(var t=0;t0&&(t%=this.duration));let l=this.timelines;for(let c=0,u=l.length;ct)return n-1;return s-1}static search(e,t,s){let n=e.length;for(let r=s;rt)return r-s;return n-s}};class qs extends Xt{constructor(t,s,n){super(t,n);A(this,"curves");this.curves=Fe.newFloatArray(t+s*18),this.curves[t-1]=1}setLinear(t){this.curves[t]=0}setStepped(t){this.curves[t]=1}shrink(t){let s=this.getFrameCount()+t*18;if(this.curves.length>s){let n=Fe.newFloatArray(s);Fe.arrayCopy(this.curves,0,n,0,s),this.curves=n}}setBezier(t,s,n,r,o,a,h,l,c,u,f){let d=this.curves,m=this.getFrameCount()+t*18;n==0&&(d[s]=2+m);let g=(r-a*2+l)*.03,b=(o-h*2+c)*.03,_=((a-l)*3-r+u)*.006,M=((h-c)*3-o+f)*.006,v=g*2+_,S=b*2+M,y=(a-r)*.3+g+_*.16666667,I=(h-o)*.3+b+M*.16666667,E=r+y,C=o+I;for(let R=m+18;mt){let c=this.frames[s],u=this.frames[s+n];return u+(t-c)/(o[r]-c)*(o[r+1]-u)}let a=r+18;for(r+=2;r=t){let c=o[r-2],u=o[r-1];return u+(t-c)/(o[r]-c)*(o[r+1]-u)}s+=this.getFrameEntries();let h=o[a-2],l=o[a-1];return l+(t-h)/(this.frames[s]-h)*(this.frames[s+n]-l)}}class ys extends qs{constructor(e,t,s){super(e,t,[s])}getFrameEntries(){return 2}setFrame(e,t,s){e<<=1,this.frames[e]=t,this.frames[e+1]=s}getCurveValue(e){let t=this.frames,s=t.length-2;for(let r=2;r<=s;r+=2)if(t[r]>e){s=r-2;break}let n=this.curves[s>>1];switch(n){case 0:let r=t[s],o=t[s+1];return o+(e-r)/(t[s+2]-r)*(t[s+2+1]-o);case 1:return t[s+1]}return this.getBezierValue(e,s,1,n-2)}getRelativeValue(e,t,s,n,r){if(e>2];switch(b){case 0:let _=c[g];f=c[g+1],d=c[g+2],m=c[g+3];let M=(n-_)/(c[g+4]-_);f+=(c[g+4+1]-f)*M,d+=(c[g+4+2]-d)*M,m+=(c[g+4+3]-m)*M;break;case 1:f=c[g+1],d=c[g+2],m=c[g+3];break;default:f=this.getBezierValue(n,g,1,b-2),d=this.getBezierValue(n,g,2,b+18-2),m=this.getBezierValue(n,g,3,b+36-2)}if(o==1)u.r=f,u.g=d,u.b=m;else{if(a==we.setup){let _=l.data.color;u.r=_.r,u.g=_.g,u.b=_.b}u.r+=(f-u.r)*o,u.g+=(d-u.g)*o,u.b+=(m-u.b)*o}}}class Oy extends ys{constructor(t,s,n){super(t,s,ht.alpha+"|"+n);A(this,"slotIndex",0);this.slotIndex=n}apply(t,s,n,r,o,a,h){let l=t.slots[this.slotIndex];if(!l.bone.active)return;let c=l.color;if(n>3];switch(y){case 0:let I=c[S];d=c[S+1],m=c[S+2],g=c[S+3],b=c[S+4],_=c[S+5],M=c[S+6],v=c[S+7];let E=(n-I)/(c[S+8]-I);d+=(c[S+8+1]-d)*E,m+=(c[S+8+2]-m)*E,g+=(c[S+8+3]-g)*E,b+=(c[S+8+4]-b)*E,_+=(c[S+8+5]-_)*E,M+=(c[S+8+6]-M)*E,v+=(c[S+8+7]-v)*E;break;case 1:d=c[S+1],m=c[S+2],g=c[S+3],b=c[S+4],_=c[S+5],M=c[S+6],v=c[S+7];break;default:d=this.getBezierValue(n,S,1,y-2),m=this.getBezierValue(n,S,2,y+18-2),g=this.getBezierValue(n,S,3,y+36-2),b=this.getBezierValue(n,S,4,y+54-2),_=this.getBezierValue(n,S,5,y+72-2),M=this.getBezierValue(n,S,6,y+90-2),v=this.getBezierValue(n,S,7,y+108-2)}if(o==1)u.set(d,m,g,b),f.r=_,f.g=M,f.b=v;else{if(a==we.setup){u.setFromColor(l.data.color);let I=l.data.darkColor;f.r=I.r,f.g=I.g,f.b=I.b}u.add((d-u.r)*o,(m-u.g)*o,(g-u.b)*o,(b-u.a)*o),f.r+=(_-f.r)*o,f.g+=(M-f.g)*o,f.b+=(v-f.b)*o}}}class Ly extends qs{constructor(t,s,n){super(t,s,[ht.rgb+"|"+n,ht.rgb2+"|"+n]);A(this,"slotIndex",0);this.slotIndex=n}getFrameEntries(){return 7}setFrame(t,s,n,r,o,a,h,l){t*=7,this.frames[t]=s,this.frames[t+1]=n,this.frames[t+2]=r,this.frames[t+3]=o,this.frames[t+4]=a,this.frames[t+5]=h,this.frames[t+6]=l}apply(t,s,n,r,o,a,h){let l=t.slots[this.slotIndex];if(!l.bone.active)return;let c=this.frames,u=l.color,f=l.darkColor;if(nt){let l=this.frames[s];return n[r+1]*(t-l)/(n[r]-l)}let o=r+18;for(r+=2;r=t){let l=n[r-2],c=n[r-1];return c+(t-l)/(n[r]-l)*(n[r+1]-c)}let a=n[o-2],h=n[o-1];return h+(1-h)*(t-a)/(this.frames[s+this.getFrameEntries()]-a)}apply(t,s,n,r,o,a,h){let l=t.slots[this.slotIndex];if(!l.bone.active)return;let c=l.getAttachment();if(!c||!(c instanceof vs)||c.timelineAttachment!=this.attachment)return;let u=l.deform;u.length==0&&(a=we.setup);let f=this.vertices,d=f[0].length,m=this.frames;if(n=m[m.length-1]){let S=f[m.length-1];if(o==1)if(a==we.add){let y=c;if(y.bones)for(let I=0;In)this.apply(t,s,Number.MAX_VALUE,r,o,a,h),s=-1;else if(s>=l[c-1])return;if(n0&&l[u-1]==f;)u--}for(;u=l[u];u++)r.push(this.events[u])}};A(lh,"propertyIds",[""+ht.event]);let va=lh;const hh=class hh extends Xt{constructor(t){super(t,hh.propertyIds);A(this,"drawOrders");this.drawOrders=new Array(t)}getFrameCount(){return this.frames.length}setFrame(t,s,n){this.frames[t]=s,this.drawOrders[t]=n}apply(t,s,n,r,o,a,h){if(h==xi.mixOut){a==we.setup&&Fe.arrayCopy(t.slots,0,t.drawOrder,0,t.slots.length);return}if(n>2];switch(g){case 0:let b=c[m];u=c[m+1],f=c[m+2],d=c[m+3];let _=(n-b)/(c[m+4]-b);u+=(c[m+4+1]-u)*_,f+=(c[m+4+2]-f)*_,d+=(c[m+4+3]-d)*_;break;case 1:u=c[m+1],f=c[m+2],d=c[m+3];break;default:u=this.getBezierValue(n,m,1,g-2),f=this.getBezierValue(n,m,2,g+18-2),d=this.getBezierValue(n,m,3,g+36-2)}if(a==we.setup){let b=l.data;l.mixRotate=b.mixRotate+(u-b.mixRotate)*o,l.mixX=b.mixX+(f-b.mixX)*o,l.mixY=b.mixY+(d-b.mixY)*o}else l.mixRotate+=(u-l.mixRotate)*o,l.mixX+=(f-l.mixX)*o,l.mixY+=(d-l.mixY)*o}}class Rr extends ys{constructor(t,s,n,r){super(t,s,r+"|"+n);A(this,"constraintIndex",0);this.constraintIndex=n}apply(t,s,n,r,o,a,h){let l;if(this.constraintIndex==-1){const c=n>=this.frames[0]?this.getCurveValue(n):0;for(const u of t.physicsConstraints)u.active&&this.global(u.data)&&this.set(u,this.getAbsoluteValue2(n,o,a,this.get(u),this.setup(u),c))}else l=t.physicsConstraints[this.constraintIndex],l.active&&this.set(l,this.getAbsoluteValue(n,o,a,this.get(l),this.setup(l)))}}class $y extends Rr{constructor(e,t,s){super(e,t,s,ht.physicsConstraintInertia)}setup(e){return e.data.inertia}get(e){return e.inertia}set(e,t){e.inertia=t}global(e){return e.inertiaGlobal}}class Gy extends Rr{constructor(e,t,s){super(e,t,s,ht.physicsConstraintStrength)}setup(e){return e.data.strength}get(e){return e.strength}set(e,t){e.strength=t}global(e){return e.strengthGlobal}}class jy extends Rr{constructor(e,t,s){super(e,t,s,ht.physicsConstraintDamping)}setup(e){return e.data.damping}get(e){return e.damping}set(e,t){e.damping=t}global(e){return e.dampingGlobal}}class Hy extends Rr{constructor(e,t,s){super(e,t,s,ht.physicsConstraintMass)}setup(e){return 1/e.data.massInverse}get(e){return 1/e.massInverse}set(e,t){e.massInverse=1/t}global(e){return e.massGlobal}}class Wy extends Rr{constructor(e,t,s){super(e,t,s,ht.physicsConstraintWind)}setup(e){return e.data.wind}get(e){return e.wind}set(e,t){e.wind=t}global(e){return e.windGlobal}}class zy extends Rr{constructor(e,t,s){super(e,t,s,ht.physicsConstraintGravity)}setup(e){return e.data.gravity}get(e){return e.gravity}set(e,t){e.gravity=t}global(e){return e.gravityGlobal}}class qy extends Rr{constructor(e,t,s){super(e,t,s,ht.physicsConstraintMix)}setup(e){return e.data.mix}get(e){return e.mix}set(e,t){e.mix=t}global(e){return e.mixGlobal}}const ch=class ch extends Xt{constructor(t,s){super(t,ch.propertyIds);A(this,"constraintIndex");this.constraintIndex=s}getFrameCount(){return this.frames.length}setFrame(t,s){this.frames[t]=s}apply(t,s,n,r,o,a,h){let l;if(this.constraintIndex!=-1&&(l=t.physicsConstraints[this.constraintIndex],!l.active))return;const c=this.frames;if(s>n)this.apply(t,s,Number.MAX_VALUE,[],o,a,h),s=-1;else if(s>=c[c.length-1])return;if(!(n=c[Xt.search1(c,s)+1]))if(l!=null)l.reset();else for(const u of t.physicsConstraints)u.active&&u.reset()}};A(ch,"propertyIds",[ht.physicsConstraintReset.toString()]);let Jl=ch;const ji=class ji extends Xt{constructor(t,s,n){super(t,[ht.sequence+"|"+s+"|"+n.sequence.id]);A(this,"slotIndex");A(this,"attachment");this.slotIndex=s,this.attachment=n}getFrameEntries(){return ji.ENTRIES}getSlotIndex(){return this.slotIndex}getAttachment(){return this.attachment}setFrame(t,s,n,r,o){let a=this.frames;t*=ji.ENTRIES,a[t]=s,a[t+ji.MODE]=n|r<<4,a[t+ji.DELAY]=o}apply(t,s,n,r,o,a,h){let l=t.slots[this.slotIndex];if(!l.bone.active)return;let c=l.attachment,u=this.attachment;if(c!=u&&(!(c instanceof vs)||c.timelineAttachment!=u))return;if(h==xi.mixOut){a==we.setup&&(l.sequenceIndex=-1);return}let f=this.frames;if(n>4,M=this.attachment.sequence.regions.length,v=wy[g&15];if(v!=fi.hold)switch(_+=(n-m)/b+1e-5|0,v){case fi.once:_=Math.min(M-1,_);break;case fi.loop:_%=M;break;case fi.pingpong:{let S=(M<<1)-2;_=S==0?0:_%S,_>=M&&(_=S-_);break}case fi.onceReverse:_=Math.max(M-1-_,0);break;case fi.loopReverse:_=M-1-_%M;break;case fi.pingpongReverse:{let S=(M<<1)-2;_=S==0?0:(_+M-1)%S,_>=M&&(_=S-_)}}l.sequenceIndex=_}};A(ji,"ENTRIES",3),A(ji,"MODE",1),A(ji,"DELAY",2);let Ql=ji;const eo=class eo{constructor(e){A(this,"data");A(this,"tracks",new Array);A(this,"timeScale",1);A(this,"unkeyedState",0);A(this,"events",new Array);A(this,"listeners",new Array);A(this,"queue",new BE(this));A(this,"propertyIDs",new xy);A(this,"animationsChanged",!1);A(this,"trackEntryPool",new zl(()=>new OE));this.data=e}static emptyAnimation(){return eo._emptyAnimation}update(e){e*=this.timeScale;let t=this.tracks;for(let s=0,n=t.length;s0){if(r.delay-=o,r.delay>0)continue;o=-r.delay,r.delay=0}let a=r.next;if(a){let h=r.trackLast-a.delay;if(h>=0){for(a.delay=0,a.trackTime+=r.timeScale==0?0:(h/r.timeScale+e)*a.timeScale,r.trackTime+=o,this.setCurrent(s,a,!0);a.mixingFrom;)a.mixTime+=e,a=a.mixingFrom;continue}}else if(r.trackLast>=r.trackEnd&&!r.mixingFrom){t[s]=null,this.queue.end(r),this.clearNext(r);continue}if(r.mixingFrom&&this.updateMixingFrom(r,e)){let h=r.mixingFrom;for(r.mixingFrom=null,h&&(h.mixingTo=null);h;)this.queue.end(h),h=h.mixingFrom}r.trackTime+=o}this.queue.drain()}updateMixingFrom(e,t){let s=e.mixingFrom;if(!s)return!0;let n=this.updateMixingFrom(s,t);return s.animationLast=s.nextAnimationLast,s.trackLast=s.nextTrackLast,e.nextTrackLast!=-1&&e.mixTime>=e.mixDuration?((s.totalAlpha==0||e.mixDuration==0)&&(e.mixingFrom=s.mixingFrom,s.mixingFrom!=null&&(s.mixingFrom.mixingTo=e),e.interruptAlpha=s.interruptAlpha,this.queue.end(s)),n):(s.trackTime+=t*s.timeScale,e.mixTime+=t,!1)}apply(e){if(!e)throw new Error("skeleton cannot be null.");this.animationsChanged&&this._animationsChanged();let t=this.events,s=this.tracks,n=!1;for(let f=0,d=s.length;f0)continue;n=!0;let g=f==0?we.first:m.mixBlend,b=m.alpha;m.mixingFrom?b*=this.applyMixingFrom(m,e,g):m.trackTime>=m.trackEnd&&!m.next&&(b=0);let _=b>=m.alphaAttachmentThreshold,M=m.animationLast,v=m.getAnimationTime(),S=v,y=t;m.reverse&&(S=m.animation.duration-S,y=null);let I=m.animation.timelines,E=I.length;if(f==0&&b==1||g==we.add){f==0&&(_=!0);for(let C=0;C1&&(r=1),s!=we.first&&(s=n.mixBlend));let o=r=n.alphaAttachmentThreshold):(a&&y instanceof br&&E==we.setup&&(I=xi.mixIn),y.apply(t,f,m,g,C,E,I))}}return e.mixDuration>0&&this.queueEvents(n,d),this.events.length=0,n.nextAnimationLast=d,n.nextTrackLast=n.trackTime,r}applyAttachmentTimeline(e,t,s,n,r){var o=t.slots[e.slotIndex];o.bone.active&&(s=0,v=g>=0;Math.abs(b)<=90&&ke.signum(b)!=ke.signum(m)&&(Math.abs(g-_)>180?(d+=360*ke.signum(g),v=M):_!=0?d-=360*ke.signum(g):v=M),v!=M&&(d+=360*ke.signum(g)),o[a]=d}o[a+1]=m,l.rotation=u+d*n}queueEvents(e,t){let s=e.animationStart,n=e.animationEnd,r=n-s,o=e.trackLast%r,a=this.events,h=0,l=a.length;for(;hn||this.queue.event(e,u)}let c=!1;if(e.loop)if(r==0)c=!0;else{const u=Math.floor(e.trackTime/r);c=u>0&&u>Math.floor(e.trackLast/r)}else c=t>=n&&e.animationLast=this.tracks.length)return;let t=this.tracks[e];if(!t)return;this.queue.end(t),this.clearNext(t);let s=t;for(;;){let n=s.mixingFrom;if(!n)break;this.queue.end(n),s.mixingFrom=null,s.mixingTo=null,s=n}this.tracks[t.trackIndex]=null,this.queue.drain()}setCurrent(e,t,s){let n=this.expandToIndex(e);this.tracks[e]=t,t.previous=null,n&&(s&&this.queue.interrupt(n),t.mixingFrom=n,n.mixingTo=t,t.mixTime=0,n.mixingFrom&&n.mixDuration>0&&(t.interruptAlpha*=Math.min(1,n.mixTime/n.mixDuration)),n.timelinesRotation.length=0),this.queue.start(t)}setAnimation(e,t,s=!1){let n=this.data.skeletonData.findAnimation(t);if(!n)throw new Error("Animation not found: "+t);return this.setAnimationWith(e,n,s)}setAnimationWith(e,t,s=!1){if(!t)throw new Error("animation cannot be null.");let n=!0,r=this.expandToIndex(e);r&&(r.nextTrackLast==-1?(this.tracks[e]=r.mixingFrom,this.queue.interrupt(r),this.queue.end(r),this.clearNext(r),r=r.mixingFrom,n=!1):this.clearNext(r));let o=this.trackEntry(e,t,s,r);return this.setCurrent(e,o,n),this.queue.drain(),o}addAnimation(e,t,s=!1,n=0){let r=this.data.skeletonData.findAnimation(t);if(!r)throw new Error("Animation not found: "+t);return this.addAnimationWith(e,r,s,n)}addAnimationWith(e,t,s=!1,n=0){if(!t)throw new Error("animation cannot be null.");let r=this.expandToIndex(e);if(r)for(;r.next;)r=r.next;let o=this.trackEntry(e,t,s,r);return r?(r.next=o,o.previous=r,n<=0&&(n=Math.max(n+r.getTrackComplete()-o.mixDuration,0))):(this.setCurrent(e,o,!0),this.queue.drain(),n<0&&(n=0)),o.delay=n,o}setEmptyAnimation(e,t=0){let s=this.setAnimationWith(e,eo.emptyAnimation(),!1);return s.mixDuration=t,s.trackEnd=t,s}addEmptyAnimation(e,t=0,s=0){let n=this.addAnimationWith(e,eo.emptyAnimation(),!1,s);return s<=0&&(n.delay=Math.max(n.delay+n.mixDuration-t,0)),n.mixDuration=t,n.trackEnd=t,n}setEmptyAnimations(e=0){let t=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(let s=0,n=this.tracks.length;s0){r[h]=LE,o[h]=u;continue e}break}r[h]=Tu}}}getCurrent(e){return e>=this.tracks.length?null:this.tracks[e]}addListener(e){if(!e)throw new Error("listener cannot be null.");this.listeners.push(e)}removeListener(e){let t=this.listeners.indexOf(e);t>=0&&this.listeners.splice(t,1)}clearListeners(){this.listeners.length=0}clearListenerNotifications(){this.queue.clear()}};A(eo,"_emptyAnimation",new df("",[],0));let Td=eo;class OE{constructor(){A(this,"animation",null);A(this,"previous",null);A(this,"next",null);A(this,"mixingFrom",null);A(this,"mixingTo",null);A(this,"listener",null);A(this,"trackIndex",0);A(this,"loop",!1);A(this,"holdPrevious",!1);A(this,"reverse",!1);A(this,"shortestRotation",!1);A(this,"eventThreshold",0);A(this,"mixAttachmentThreshold",0);A(this,"alphaAttachmentThreshold",0);A(this,"mixDrawOrderThreshold",0);A(this,"animationStart",0);A(this,"animationEnd",0);A(this,"animationLast",0);A(this,"nextAnimationLast",0);A(this,"delay",0);A(this,"trackTime",0);A(this,"trackLast",0);A(this,"nextTrackLast",0);A(this,"trackEnd",0);A(this,"timeScale",0);A(this,"alpha",0);A(this,"mixTime",0);A(this,"_mixDuration",0);A(this,"interruptAlpha",0);A(this,"totalAlpha",0);A(this,"mixBlend",we.replace);A(this,"timelineMode",new Array);A(this,"timelineHoldMix",new Array);A(this,"timelinesRotation",new Array)}get mixDuration(){return this._mixDuration}set mixDuration(e){this._mixDuration=e}setMixDurationWithDelay(e,t){this._mixDuration=e,t<=0&&(this.previous!=null?t=Math.max(t+this.previous.getTrackComplete()-e,0):t=0),this.delay=t}reset(){this.next=null,this.previous=null,this.mixingFrom=null,this.mixingTo=null,this.animation=null,this.listener=null,this.timelineMode.length=0,this.timelineHoldMix.length=0,this.timelinesRotation.length=0}getAnimationTime(){if(this.loop){let e=this.animationEnd-this.animationStart;return e==0?this.animationStart:this.trackTime%e+this.animationStart}return Math.min(this.trackTime+this.animationStart,this.animationEnd)}setAnimationLast(e){this.animationLast=e,this.nextAnimationLast=e}isComplete(){return this.trackTime>=this.animationEnd-this.animationStart}resetRotationDirections(){this.timelinesRotation.length=0}getTrackComplete(){let e=this.animationEnd-this.animationStart;if(e!=0){if(this.loop)return e*(1+(this.trackTime/e|0));if(this.trackTime=0}}class BE{constructor(e){A(this,"objects",[]);A(this,"drainDisabled",!1);A(this,"animState");this.animState=e}start(e){this.objects.push(Ci.start),this.objects.push(e),this.animState.animationsChanged=!0}interrupt(e){this.objects.push(Ci.interrupt),this.objects.push(e)}end(e){this.objects.push(Ci.end),this.objects.push(e),this.animState.animationsChanged=!0}dispose(e){this.objects.push(Ci.dispose),this.objects.push(e)}complete(e){this.objects.push(Ci.complete),this.objects.push(e)}event(e,t){this.objects.push(Ci.event),this.objects.push(e),this.objects.push(t)}drain(){if(this.drainDisabled)return;this.drainDisabled=!0;let e=this.objects;for(let t=0;t{c.width=parseInt(s[1]),c.height=parseInt(s[2])},n.format=()=>{},n.filter=c=>{c.minFilter=Fe.enumValue(hi,s[1]),c.magFilter=Fe.enumValue(hi,s[2])},n.repeat=c=>{s[1].indexOf("x")!=-1&&(c.uWrap=yn.Repeat),s[1].indexOf("y")!=-1&&(c.vWrap=yn.Repeat)},n.pma=c=>{c.pma=s[1]=="true"};var r={};r.xy=c=>{c.x=parseInt(s[1]),c.y=parseInt(s[2])},r.size=c=>{c.width=parseInt(s[1]),c.height=parseInt(s[2])},r.bounds=c=>{c.x=parseInt(s[1]),c.y=parseInt(s[2]),c.width=parseInt(s[3]),c.height=parseInt(s[4])},r.offset=c=>{c.offsetX=parseInt(s[1]),c.offsetY=parseInt(s[2])},r.orig=c=>{c.originalWidth=parseInt(s[1]),c.originalHeight=parseInt(s[2])},r.offsets=c=>{c.offsetX=parseInt(s[1]),c.offsetY=parseInt(s[2]),c.originalWidth=parseInt(s[3]),c.originalHeight=parseInt(s[4])},r.rotate=c=>{let u=s[1];u=="true"?c.degrees=90:u!="false"&&(c.degrees=parseInt(u))},r.index=c=>{c.index=parseInt(s[1])};let o=t.readLine();for(;o&&o.trim().length==0;)o=t.readLine();for(;!(!o||o.trim().length==0||t.readEntry(s,o)==0);)o=t.readLine();let a=null,h=null,l=null;for(;o!==null;)if(o.trim().length==0)a=null,o=t.readLine();else if(a){let c=new Zy(a,o);for(;;){let u=t.readEntry(s,o=t.readLine());if(u==0)break;let f=r[s[0]];if(f)f(c);else{h||(h=[]),l||(l=[]),h.push(s[0]);let d=[];for(let m=0;m0&&l&&l.length>0&&(c.names=h,c.values=l,h=null,l=null),c.u=c.x/a.width,c.v=c.y/a.height,c.degrees==90?(c.u2=(c.x+c.height)/a.width,c.v2=(c.y+c.width)/a.height):(c.u2=(c.x+c.width)/a.width,c.v2=(c.y+c.height)/a.height),this.regions.push(c)}else{for(a=new YE(o.trim());t.readEntry(s,o=t.readLine())!=0;){let c=n[s[0]];c&&c(a)}this.pages.push(a)}}findRegion(e){for(let t=0;t=this.lines.length?null:this.lines[this.index++]}readEntry(e,t){if(!t||(t=t.trim(),t.length==0))return 0;let s=t.indexOf(":");if(s==-1)return 0;e[0]=t.substr(0,s).trim();for(let n=1,r=s+1;;n++){let o=t.indexOf(",",r);if(o==-1)return e[n]=t.substr(r).trim(),n;if(e[n]=t.substr(r,o-r).trim(),r=o+1,n==4)return 4}}}class YE{constructor(e){A(this,"name");A(this,"minFilter",hi.Nearest);A(this,"magFilter",hi.Nearest);A(this,"uWrap",yn.ClampToEdge);A(this,"vWrap",yn.ClampToEdge);A(this,"texture",null);A(this,"width",0);A(this,"height",0);A(this,"pma",!1);A(this,"regions",new Array);this.name=e}setTexture(e){this.texture=e,e.setFilters(this.minFilter,this.magFilter),e.setWraps(this.uWrap,this.vWrap);for(let t of this.regions)t.texture=e}}class Zy extends VE{constructor(t,s){super();A(this,"page");A(this,"name");A(this,"x",0);A(this,"y",0);A(this,"offsetX",0);A(this,"offsetY",0);A(this,"originalWidth",0);A(this,"originalHeight",0);A(this,"index",0);A(this,"degrees",0);A(this,"names",null);A(this,"values",null);this.page=t,this.name=s,t.regions.push(this)}}class Zn extends vs{constructor(t,s){super(t);A(this,"region",null);A(this,"path");A(this,"regionUVs",[]);A(this,"uvs",[]);A(this,"triangles",[]);A(this,"color",new ot(1,1,1,1));A(this,"width",0);A(this,"height",0);A(this,"hullLength",0);A(this,"edges",[]);A(this,"parentMesh",null);A(this,"sequence",null);A(this,"tempColor",new ot(0,0,0,0));this.path=s}updateRegion(){if(!this.region)throw new Error("Region not set.");let t=this.regionUVs;(!this.uvs||this.uvs.length!=t.length)&&(this.uvs=Fe.newFloatArray(t.length));let s=this.uvs,n=this.uvs.length,r=this.region.u,o=this.region.v,a=0,h=0;if(this.region instanceof Zy){let l=this.region,c=l.page,u=c.width,f=c.height;switch(l.degrees){case 90:r-=(l.originalHeight-l.offsetY-l.height)/u,o-=(l.originalWidth-l.offsetX-l.width)/f,a=l.originalHeight/u,h=l.originalWidth/f;for(let d=0;d= 0.");if(!t)throw new Error("name cannot be null.");this.index=e,this.name=t,this.parent=s}}var jt;(function(i){i[i.Normal=0]="Normal",i[i.OnlyTranslation=1]="OnlyTranslation",i[i.NoRotationOrReflection=2]="NoRotationOrReflection",i[i.NoScale=3]="NoScale",i[i.NoScaleOrReflection=4]="NoScaleOrReflection"})(jt||(jt={}));class hg{constructor(e,t,s){A(this,"data");A(this,"skeleton");A(this,"parent",null);A(this,"children",new Array);A(this,"x",0);A(this,"y",0);A(this,"rotation",0);A(this,"scaleX",0);A(this,"scaleY",0);A(this,"shearX",0);A(this,"shearY",0);A(this,"ax",0);A(this,"ay",0);A(this,"arotation",0);A(this,"ascaleX",0);A(this,"ascaleY",0);A(this,"ashearX",0);A(this,"ashearY",0);A(this,"a",0);A(this,"b",0);A(this,"c",0);A(this,"d",0);A(this,"worldY",0);A(this,"worldX",0);A(this,"inherit",jt.Normal);A(this,"sorted",!1);A(this,"active",!1);if(!e)throw new Error("data cannot be null.");if(!t)throw new Error("skeleton cannot be null.");this.data=e,this.skeleton=t,this.parent=s,this.setToSetupPose()}isActive(){return this.active}update(e){this.updateWorldTransformWith(this.ax,this.ay,this.arotation,this.ascaleX,this.ascaleY,this.ashearX,this.ashearY)}updateWorldTransform(){this.updateWorldTransformWith(this.x,this.y,this.rotation,this.scaleX,this.scaleY,this.shearX,this.shearY)}updateWorldTransformWith(e,t,s,n,r,o,a){this.ax=e,this.ay=t,this.arotation=s,this.ascaleX=n,this.ascaleY=r,this.ashearX=o,this.ashearY=a;let h=this.parent;if(!h){let d=this.skeleton;const m=d.scaleX,g=d.scaleY,b=(s+o)*ke.degRad,_=(s+90+a)*ke.degRad;this.a=Math.cos(b)*n*m,this.b=Math.cos(_)*r*m,this.c=Math.sin(b)*n*g,this.d=Math.sin(_)*r*g,this.worldX=e*m+d.x,this.worldY=t*g+d.y;return}let l=h.a,c=h.b,u=h.c,f=h.d;switch(this.worldX=l*e+c*t+h.worldX,this.worldY=u*e+f*t+h.worldY,this.inherit){case jt.Normal:{const d=(s+o)*ke.degRad,m=(s+90+a)*ke.degRad,g=Math.cos(d)*n,b=Math.cos(m)*r,_=Math.sin(d)*n,M=Math.sin(m)*r;this.a=l*g+c*_,this.b=l*b+c*M,this.c=u*g+f*_,this.d=u*b+f*M;return}case jt.OnlyTranslation:{const d=(s+o)*ke.degRad,m=(s+90+a)*ke.degRad;this.a=Math.cos(d)*n,this.b=Math.cos(m)*r,this.c=Math.sin(d)*n,this.d=Math.sin(m)*r;break}case jt.NoRotationOrReflection:{let d=1/this.skeleton.scaleX,m=1/this.skeleton.scaleY;l*=d,u*=m;let g=l*l+u*u,b=0;g>1e-4?(g=Math.abs(l*f*m-c*d*u)/g,c=u*g,f=l*g,b=Math.atan2(u,l)*ke.radDeg):(l=0,u=0,b=90-Math.atan2(f,c)*ke.radDeg);const _=(s+o-b)*ke.degRad,M=(s+a-b+90)*ke.degRad,v=Math.cos(_)*n,S=Math.cos(M)*r,y=Math.sin(_)*n,I=Math.sin(M)*r;this.a=l*v-c*y,this.b=l*S-c*I,this.c=u*v+f*y,this.d=u*S+f*I;break}case jt.NoScale:case jt.NoScaleOrReflection:{s*=ke.degRad;const d=Math.cos(s),m=Math.sin(s);let g=(l*d+c*m)/this.skeleton.scaleX,b=(u*d+f*m)/this.skeleton.scaleY,_=Math.sqrt(g*g+b*b);_>1e-5&&(_=1/_),g*=_,b*=_,_=Math.sqrt(g*g+b*b),this.inherit==jt.NoScale&&l*f-c*u<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY<0)&&(_=-_),s=Math.PI/2+Math.atan2(b,g);const M=Math.cos(s)*_,v=Math.sin(s)*_;o*=ke.degRad,a=(90+a)*ke.degRad;const S=Math.cos(o)*n,y=Math.cos(a)*r,I=Math.sin(o)*n,E=Math.sin(a)*r;this.a=g*S+M*I,this.b=g*y+M*E,this.c=b*S+v*I,this.d=b*y+v*E;break}}this.a*=this.skeleton.scaleX,this.b*=this.skeleton.scaleX,this.c*=this.skeleton.scaleY,this.d*=this.skeleton.scaleY}setToSetupPose(){let e=this.data;this.x=e.x,this.y=e.y,this.rotation=e.rotation,this.scaleX=e.scaleX,this.scaleY=e.scaleY,this.shearX=e.shearX,this.shearY=e.shearY,this.inherit=e.inherit}updateAppliedTransform(){let e=this.parent;if(!e){this.ax=this.worldX-this.skeleton.x,this.ay=this.worldY-this.skeleton.y,this.arotation=Math.atan2(this.c,this.a)*ke.radDeg,this.ascaleX=Math.sqrt(this.a*this.a+this.c*this.c),this.ascaleY=Math.sqrt(this.b*this.b+this.d*this.d),this.ashearX=0,this.ashearY=Math.atan2(this.a*this.b+this.c*this.d,this.a*this.d-this.b*this.c)*ke.radDeg;return}let t=e.a,s=e.b,n=e.c,r=e.d,o=1/(t*r-s*n),a=r*o,h=s*o,l=n*o,c=t*o,u=this.worldX-e.worldX,f=this.worldY-e.worldY;this.ax=u*a-f*h,this.ay=f*c-u*l;let d,m,g,b;if(this.inherit==jt.OnlyTranslation)d=this.a,m=this.b,g=this.c,b=this.d;else{switch(this.inherit){case jt.NoRotationOrReflection:{let y=Math.abs(t*r-s*n)/(t*t+n*n);s=-n*this.skeleton.scaleX*y/this.skeleton.scaleY,r=t*this.skeleton.scaleY*y/this.skeleton.scaleX,o=1/(t*r-s*n),a=r*o,h=s*o;break}case jt.NoScale:case jt.NoScaleOrReflection:let _=ke.cosDeg(this.rotation),M=ke.sinDeg(this.rotation);t=(t*_+s*M)/this.skeleton.scaleX,n=(n*_+r*M)/this.skeleton.scaleY;let v=Math.sqrt(t*t+n*n);v>1e-5&&(v=1/v),t*=v,n*=v,v=Math.sqrt(t*t+n*n),this.inherit==jt.NoScale&&o<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY<0)&&(v=-v);let S=ke.PI/2+Math.atan2(n,t);s=Math.cos(S)*v,r=Math.sin(S)*v,o=1/(t*r-s*n),a=r*o,h=s*o,l=n*o,c=t*o}d=a*this.a-h*this.c,m=a*this.b-h*this.d,g=c*this.c-l*this.a,b=c*this.d-l*this.b}if(this.ashearX=0,this.ascaleX=Math.sqrt(d*d+g*g),this.ascaleX>1e-4){let _=d*b-m*g;this.ascaleY=_/this.ascaleX,this.ashearY=-Math.atan2(d*m+g*b,_)*ke.radDeg,this.arotation=Math.atan2(g,d)*ke.radDeg}else this.ascaleX=0,this.ascaleY=Math.sqrt(m*m+b*b),this.ashearY=0,this.arotation=90-Math.atan2(b,m)*ke.radDeg}getWorldRotationX(){return Math.atan2(this.c,this.a)*ke.radDeg}getWorldRotationY(){return Math.atan2(this.d,this.b)*ke.radDeg}getWorldScaleX(){return Math.sqrt(this.a*this.a+this.c*this.c)}getWorldScaleY(){return Math.sqrt(this.b*this.b+this.d*this.d)}worldToLocal(e){let t=1/(this.a*this.d-this.b*this.c),s=e.x-this.worldX,n=e.y-this.worldY;return e.x=s*this.d*t-n*this.b*t,e.y=n*this.a*t-s*this.c*t,e}localToWorld(e){let t=e.x,s=e.y;return e.x=t*this.a+s*this.b+this.worldX,e.y=t*this.c+s*this.d+this.worldY,e}worldToParent(e){if(e==null)throw new Error("world cannot be null.");return this.parent==null?e:this.parent.worldToLocal(e)}parentToWorld(e){if(e==null)throw new Error("world cannot be null.");return this.parent==null?e:this.parent.localToWorld(e)}worldToLocalRotation(e){let t=ke.sinDeg(e),s=ke.cosDeg(e);return Math.atan2(this.a*t-this.c*s,this.d*s-this.b*t)*ke.radDeg+this.rotation-this.shearX}localToWorldRotation(e){e-=this.rotation-this.shearX;let t=ke.sinDeg(e),s=ke.cosDeg(e);return Math.atan2(s*this.c+t*this.d,s*this.a+t*this.b)*ke.radDeg}rotateWorld(e){e*=ke.degRad;const t=Math.sin(e),s=Math.cos(e),n=this.a,r=this.b;this.a=s*n-t*this.c,this.b=s*r-t*this.d,this.c=t*n+s*this.c,this.d=t*r+s*this.d}}class Uh{constructor(e,t,s){A(this,"name");A(this,"order");A(this,"skinRequired");this.name=e,this.order=t,this.skinRequired=s}}let Qy=class{constructor(e,t){A(this,"data");A(this,"intValue",0);A(this,"floatValue",0);A(this,"stringValue",null);A(this,"time",0);A(this,"volume",0);A(this,"balance",0);if(!t)throw new Error("data cannot be null.");this.time=e,this.data=t}};class ex{constructor(e){A(this,"name");A(this,"intValue",0);A(this,"floatValue",0);A(this,"stringValue",null);A(this,"audioPath",null);A(this,"volume",0);A(this,"balance",0);this.name=e}}class $E{constructor(e,t){A(this,"data");A(this,"bones");A(this,"target");A(this,"bendDirection",0);A(this,"compress",!1);A(this,"stretch",!1);A(this,"mix",1);A(this,"softness",0);A(this,"active",!1);if(!e)throw new Error("data cannot be null.");if(!t)throw new Error("skeleton cannot be null.");this.data=e,this.bones=new Array;for(let n=0;n180?d-=360:d<-180&&(d+=360);let b=e.ascaleX,_=e.ascaleY;if(n||r){switch(e.inherit){case jt.NoScale:case jt.NoScaleOrReflection:m=t-e.worldX,g=s-e.worldY}const M=e.data.length*b;if(M>1e-4){const v=m*m+g*g;if(n&&vM*M){const S=(Math.sqrt(v)/M-1)*a+1;b*=S,o&&(_*=S)}}}e.updateWorldTransformWith(e.ax,e.ay,e.arotation+d*a,b,_,e.ashearX,e.ashearY)}apply2(e,t,s,n,r,o,a,h,l){if(e.inherit!=jt.Normal||t.inherit!=jt.Normal)return;let c=e.ax,u=e.ay,f=e.ascaleX,d=e.ascaleY,m=f,g=d,b=t.ascaleX,_=0,M=0,v=0;f<0?(f=-f,_=180,v=-1):(_=0,v=1),d<0&&(d=-d,v=-v),b<0?(b=-b,M=180):M=0;let S=t.ax,y=0,I=0,E=0,C=e.a,R=e.b,B=e.c,k=e.d,F=Math.abs(f-d)<=1e-4;!F||o?(y=0,I=C*S+e.worldX,E=B*S+e.worldY):(y=t.ay,I=C*S+R*y+e.worldX,E=B*S+k*y+e.worldY);let D=e.parent;if(!D)throw new Error("IK parent must itself have a parent.");C=D.a,R=D.b,B=D.c,k=D.d;let N=C*k-R*B,j=I-D.worldX,O=E-D.worldY;N=Math.abs(N)<=1e-4?0:1/N;let L=(j*k-O*R)*N-c,P=(O*C-j*B)*N-u,X=Math.sqrt(L*L+P*P),U=t.data.length*b,Y,q;if(X<1e-4){this.apply1(e,s,n,!1,o,!1,l),t.updateWorldTransformWith(S,y,0,t.ascaleX,t.ascaleY,t.ashearX,t.ashearY);return}j=s-D.worldX,O=n-D.worldY;let z=(j*k-O*R)*N-c,ne=(O*C-j*B)*N-u,H=z*z+ne*ne;if(h!=0){h*=f*(b+1)*.5;let me=Math.sqrt(H),_e=me-X-U*f+h;if(_e>0){let te=Math.min(1,_e/(h*2))-1;te=(_e-h*(1-te*te))/me,z-=te*z,ne-=te*ne,H=z*z+ne*ne}}e:if(F){U*=f;let me=(H-X*X-U*U)/(2*X*U);me<-1?(me=-1,q=Math.PI*r):me>1?(me=1,q=0,o&&(C=(Math.sqrt(H)/(X+U)-1)*l+1,m*=C,a&&(g*=C))):q=Math.acos(me)*r,C=X+U*me,R=U*Math.sin(q),Y=Math.atan2(ne*C-z*R,z*C+ne*R)}else{C=f*U,R=d*U;let me=C*C,_e=R*R,te=Math.atan2(ne,z);B=_e*X*X+me*H-me*_e;let ve=-2*_e*X,$=_e-me;if(k=ve*ve-4*$*B,k>=0){let de=Math.sqrt(k);ve<0&&(de=-de),de=-(ve+de)*.5;let De=de/$,Ie=B/de,Be=Math.abs(De)=0){O=Math.sqrt(De)*r,Y=te-Math.atan2(O,Be),q=Math.atan2(O/d,(Be-X)/f);break e}}let W=ke.PI,J=X-C,Q=J*J,ie=0,ue=0,Se=X+C,Me=Se*Se,Ee=0;B=-C*X/(me-_e),B>=-1&&B<=1&&(B=Math.acos(B),j=C*Math.cos(B)+X,O=R*Math.sin(B),k=j*j+O*O,kMe&&(ue=B,Me=k,Se=j,Ee=O)),H<=(Q+Me)*.5?(Y=te-Math.atan2(ie*r,J),q=W*r):(Y=te-Math.atan2(Ee*r,Se),q=ue*r)}let Z=Math.atan2(y,S)*v,ae=e.arotation;Y=(Y-Z)*ke.radDeg+_-ae,Y>180?Y-=360:Y<-180&&(Y+=360),e.updateWorldTransformWith(c,u,ae+Y*l,m,g,0,0),ae=t.arotation,q=((q+Z)*ke.radDeg-t.ashearX)*v+M-ae,q>180?q-=360:q<-180&&(q+=360),t.updateWorldTransformWith(S,y,ae+q*l,t.ascaleX,t.ascaleY,t.ashearX,t.ashearY)}}class tx extends Uh{constructor(t){super(t,0,!1);A(this,"bones",new Array);A(this,"_target",null);A(this,"bendDirection",0);A(this,"compress",!1);A(this,"stretch",!1);A(this,"uniform",!1);A(this,"mix",0);A(this,"softness",0)}set target(t){this._target=t}get target(){if(this._target)return this._target;throw new Error("BoneData not set.")}}class ix extends Uh{constructor(t){super(t,0,!1);A(this,"bones",new Array);A(this,"_target",null);A(this,"positionMode",Gs.Fixed);A(this,"spacingMode",oi.Fixed);A(this,"rotateMode",wr.Chain);A(this,"offsetRotation",0);A(this,"position",0);A(this,"spacing",0);A(this,"mixRotate",0);A(this,"mixX",0);A(this,"mixY",0)}set target(t){this._target=t}get target(){if(this._target)return this._target;throw new Error("SlotData not set.")}}var Gs;(function(i){i[i.Fixed=0]="Fixed",i[i.Percent=1]="Percent"})(Gs||(Gs={}));var oi;(function(i){i[i.Length=0]="Length",i[i.Fixed=1]="Fixed",i[i.Percent=2]="Percent",i[i.Proportional=3]="Proportional"})(oi||(oi={}));var wr;(function(i){i[i.Tangent=0]="Tangent",i[i.Chain=1]="Chain",i[i.ChainScale=2]="ChainScale"})(wr||(wr={}));const Ni=class Ni{constructor(e,t){A(this,"data");A(this,"bones");A(this,"target");A(this,"position",0);A(this,"spacing",0);A(this,"mixRotate",0);A(this,"mixX",0);A(this,"mixY",0);A(this,"spaces",new Array);A(this,"positions",new Array);A(this,"world",new Array);A(this,"curves",new Array);A(this,"lengths",new Array);A(this,"segments",new Array);A(this,"active",!1);if(!e)throw new Error("data cannot be null.");if(!t)throw new Error("skeleton cannot be null.");this.data=e,this.bones=new Array;for(let n=0,r=e.bones.length;n0){S=u/S*m;for(let I=1;I0?ke.degRad:-.01745329277777778}for(let S=0,y=3;S0){let k=I.a,F=I.b,D=I.c,N=I.d,j=0,O=0,L=0;if(a?j=g[y-1]:f[S+1]==0?j=g[y+2]:j=Math.atan2(B,R),j-=Math.atan2(D,k),v){O=Math.cos(j),L=Math.sin(j);let P=I.data.length;b+=(P*(O*k-L*D)-R)*s,_+=(P*(L*k+O*D)-B)*s}else j+=M;j>ke.PI?j-=ke.PI2:j<-3.1415927&&(j+=ke.PI2),j*=s,O=Math.cos(j),L=Math.sin(j),I.a=O*k-L*D,I.b=O*F-L*N,I.c=L*k+O*D,I.d=L*F+O*N}I.updateAppliedTransform()}}computeWorldPositions(e,t,s){let n=this.target,r=this.position,o=this.spaces,a=Fe.setArraySize(this.positions,t*3+2),h=this.world,l=e.closed,c=e.worldVerticesLength,u=c/6,f=Ni.NONE;if(!e.constantSpeed){let P=e.lengths;u-=l?1:2;let X=P[u];this.data.positionMode==Gs.Percent&&(r*=X);let U;switch(this.data.spacingMode){case oi.Percent:U=X;break;case oi.Proportional:U=X/t;break;default:U=1}h=Fe.setArraySize(this.world,8);for(let Y=0,q=0,z=0;YX){f!=Ni.AFTER&&(f=Ni.AFTER,e.computeWorldVertices(n,c-6,4,h,0,2)),this.addAfterPosition(H-X,h,0,a,q);continue}for(;;z++){let Z=P[z];if(!(H>Z)){if(z==0)H/=Z;else{let ae=P[z-1];H=(H-ae)/(Z-ae)}break}}z!=f&&(f=z,l&&z==u?(e.computeWorldVertices(n,c-4,4,h,0,2),e.computeWorldVertices(n,0,4,h,4,2)):e.computeWorldVertices(n,z*6+2,8,h,0,2)),this.addCurvePosition(H,h[0],h[1],h[2],h[3],h[4],h[5],h[6],h[7],a,q,s||Y>0&&ne==0)}return a}l?(c+=2,h=Fe.setArraySize(this.world,c),e.computeWorldVertices(n,2,c-4,h,0,2),e.computeWorldVertices(n,0,2,h,c-4,2),h[c-2]=h[0],h[c-1]=h[1]):(u--,c-=4,h=Fe.setArraySize(this.world,c),e.computeWorldVertices(n,2,c,h,0,2));let d=Fe.setArraySize(this.curves,u),m=0,g=h[0],b=h[1],_=0,M=0,v=0,S=0,y=0,I=0,E=0,C=0,R=0,B=0,k=0,F=0,D=0,N=0;for(let P=0,X=2;Pm){this.addAfterPosition(z-m,h,c-4,a,X);continue}for(;;U++){let ne=d[U];if(!(z>ne)){if(U==0)z/=ne;else{let H=d[U-1];z=(z-H)/(ne-H)}break}}if(U!=f){f=U;let ne=U*6;for(g=h[ne],b=h[ne+1],_=h[ne+2],M=h[ne+3],v=h[ne+4],S=h[ne+5],y=h[ne+6],I=h[ne+7],E=(g-_*2+v)*.03,C=(b-M*2+S)*.03,R=((_-v)*3-g+y)*.006,B=((M-S)*3-b+I)*.006,k=E*2+R,F=C*2+B,D=(_-g)*.3+E+R*.16666667,N=(M-b)*.3+C+B*.16666667,L=Math.sqrt(D*D+N*N),O[0]=L,ne=1;ne<8;ne++)D+=k,N+=F,k+=R,F+=B,L+=Math.sqrt(D*D+N*N),O[ne]=L;D+=k,N+=F,L+=Math.sqrt(D*D+N*N),O[8]=L,D+=k+R,N+=F+B,L+=Math.sqrt(D*D+N*N),O[9]=L,Y=0}for(z*=L;;Y++){let ne=O[Y];if(!(z>ne)){if(Y==0)z/=ne;else{let H=O[Y-1];z=Y+(z-H)/(ne-H)}break}}this.addCurvePosition(z*.1,g,b,_,M,v,S,y,I,a,X,s||P>0&&q==0)}return a}addBeforePosition(e,t,s,n,r){let o=t[s],a=t[s+1],h=t[s+2]-o,l=t[s+3]-a,c=Math.atan2(l,h);n[r]=o+e*Math.cos(c),n[r+1]=a+e*Math.sin(c),n[r+2]=c}addAfterPosition(e,t,s,n,r){let o=t[s+2],a=t[s+3],h=o-t[s],l=a-t[s+1],c=Math.atan2(l,h);n[r]=o+e*Math.cos(c),n[r+1]=a+e*Math.sin(c),n[r+2]=c}addCurvePosition(e,t,s,n,r,o,a,h,l,c,u,f){if(e==0||isNaN(e)){c[u]=t,c[u+1]=s,c[u+2]=Math.atan2(r-s,n-t);return}let d=e*e,m=d*e,g=1-e,b=g*g,_=b*g,M=g*e,v=M*3,S=g*v,y=v*e,I=t*_+n*S+o*y+h*m,E=s*_+r*S+a*y+l*m;c[u]=I,c[u+1]=E,f&&(e<.001?c[u+2]=Math.atan2(r-s,n-t):c[u+2]=Math.atan2(E-(s*b+r*M*2+a*d),I-(t*b+n*M*2+o*d)))}};A(Ni,"NONE",-1),A(Ni,"BEFORE",-2),A(Ni,"AFTER",-3),A(Ni,"epsilon",1e-5);let Ed=Ni;class GE{constructor(e,t){A(this,"data");A(this,"_bone",null);A(this,"inertia",0);A(this,"strength",0);A(this,"damping",0);A(this,"massInverse",0);A(this,"wind",0);A(this,"gravity",0);A(this,"mix",0);A(this,"_reset",!0);A(this,"ux",0);A(this,"uy",0);A(this,"cx",0);A(this,"cy",0);A(this,"tx",0);A(this,"ty",0);A(this,"xOffset",0);A(this,"xVelocity",0);A(this,"yOffset",0);A(this,"yVelocity",0);A(this,"rotateOffset",0);A(this,"rotateVelocity",0);A(this,"scaleOffset",0);A(this,"scaleVelocity",0);A(this,"active",!1);A(this,"skeleton");A(this,"remaining",0);A(this,"lastTime",0);this.data=e,this.skeleton=t,this.bone=t.bones[e.bone.index],this.inertia=e.inertia,this.strength=e.strength,this.damping=e.damping,this.massInverse=e.massInverse,this.wind=e.wind,this.gravity=e.gravity,this.mix=e.mix}set bone(e){this._bone=e}get bone(){if(this._bone)return this._bone;throw new Error("Bone not set.")}reset(){this.remaining=0,this.lastTime=this.skeleton.time,this._reset=!0,this.xOffset=0,this.xVelocity=0,this.yOffset=0,this.yVelocity=0,this.rotateOffset=0,this.rotateVelocity=0,this.scaleOffset=0,this.scaleVelocity=0}setToSetupPose(){const e=this.data;this.inertia=e.inertia,this.strength=e.strength,this.damping=e.damping,this.massInverse=e.massInverse,this.wind=e.wind,this.gravity=e.gravity,this.mix=e.mix}isActive(){return this.active}update(e){const t=this.mix;if(t==0)return;const s=this.data.x>0,n=this.data.y>0,r=this.data.rotate>0||this.data.shearX>0,o=this.data.scaleX>0,a=this.bone,h=a.data.length;switch(e){case Xn.none:return;case Xn.reset:this.reset();case Xn.update:const l=this.skeleton,c=Math.max(this.skeleton.time-this.lastTime,0);this.remaining+=c,this.lastTime=l.time;const u=a.worldX,f=a.worldY;if(this._reset)this._reset=!1,this.ux=u,this.uy=f;else{let d=this.remaining,m=this.inertia,g=this.data.step,b=this.skeleton.data.referenceScale,_=-1,M=this.data.limit*c,v=M*Math.abs(l.scaleY);if(M*=Math.abs(l.scaleX),s||n){if(s){const S=(this.ux-u)*m;this.xOffset+=S>M?M:S<-M?-M:S,this.ux=u}if(n){const S=(this.uy-f)*m;this.yOffset+=S>v?v:S<-v?-v:S,this.uy=f}if(d>=g){_=Math.pow(this.damping,60*g);const S=this.massInverse*g,y=this.strength,I=this.wind*b*l.scaleX,E=this.gravity*b*l.scaleY;do s&&(this.xVelocity+=(I-this.xOffset*y)*S,this.xOffset+=this.xVelocity*g,this.xVelocity*=_),n&&(this.yVelocity-=(E+this.yOffset*y)*S,this.yOffset+=this.yVelocity*g,this.yVelocity*=_),d-=g;while(d>=g)}s&&(a.worldX+=this.xOffset*t*this.data.x),n&&(a.worldY+=this.yOffset*t*this.data.y)}if(r||o){let S=Math.atan2(a.c,a.a),y=0,I=0,E=0,C=this.cx-a.worldX,R=this.cy-a.worldY;if(C>M?C=M:C<-M&&(C=-M),R>v?R=v:R<-v&&(R=-v),r){E=(this.data.rotate+this.data.shearX)*t;let B=Math.atan2(R+this.ty,C+this.tx)-S-this.rotateOffset*E;this.rotateOffset+=(B-Math.ceil(B*ke.invPI2-.5)*ke.PI2)*m,B=this.rotateOffset*E+S,y=Math.cos(B),I=Math.sin(B),o&&(B=h*a.getWorldScaleX(),B>0&&(this.scaleOffset+=(C*y+R*I)*m/B))}else{y=Math.cos(S),I=Math.sin(S);const B=h*a.getWorldScaleX();B>0&&(this.scaleOffset+=(C*y+R*I)*m/B)}if(d=this.remaining,d>=g){_==-1&&(_=Math.pow(this.damping,60*g));const B=this.massInverse*g,k=this.strength,F=this.wind,D=ya.yDown?-this.gravity:this.gravity,N=h/b;for(;;)if(d-=g,o&&(this.scaleVelocity+=(F*y-D*I-this.scaleOffset*k)*B,this.scaleOffset+=this.scaleVelocity*g,this.scaleVelocity*=_),r){if(this.rotateVelocity-=((F*I+D*y)*N+this.rotateOffset*k)*B,this.rotateOffset+=this.rotateVelocity*g,this.rotateVelocity*=_,d0){let d=0;this.data.rotate>0&&(d=l*this.data.rotate,c=Math.sin(d),u=Math.cos(d),f=a.b,a.b=u*f-c*a.d,a.d=c*f+u*a.d),d+=l*this.data.shearX,c=Math.sin(d),u=Math.cos(d),f=a.a,a.a=u*f-c*a.c,a.c=c*f+u*a.c}else l*=this.data.rotate,c=Math.sin(l),u=Math.cos(l),f=a.a,a.a=u*f-c*a.c,a.c=c*f+u*a.c,f=a.b,a.b=u*f-c*a.d,a.d=c*f+u*a.d}if(o){const l=1+this.scaleOffset*t*this.data.scaleX;a.a*=l,a.c*=l}e!=Xn.pose&&(this.tx=h*a.a,this.ty=h*a.c),a.updateAppliedTransform()}translate(e,t){this.ux-=e,this.uy-=t,this.cx-=e,this.cy-=t}rotate(e,t,s){const n=s*ke.degRad,r=Math.cos(n),o=Math.sin(n),a=this.cx-e,h=this.cy-t;this.translate(a*r-h*o-a,a*o+h*r-h)}}class jE{constructor(e,t){A(this,"data");A(this,"bone");A(this,"color");A(this,"darkColor",null);A(this,"attachment",null);A(this,"attachmentState",0);A(this,"sequenceIndex",-1);A(this,"deform",new Array);if(!e)throw new Error("data cannot be null.");if(!t)throw new Error("bone cannot be null.");this.data=e,this.bone=t,this.color=new ot,this.darkColor=e.darkColor?new ot:null,this.setToSetupPose()}getSkeleton(){return this.bone.skeleton}getAttachment(){return this.attachment}setAttachment(e){this.attachment!=e&&((!(e instanceof vs)||!(this.attachment instanceof vs)||e.timelineAttachment!=this.attachment.timelineAttachment)&&(this.deform.length=0),this.attachment=e,this.sequenceIndex=-1)}setToSetupPose(){this.color.setFromColor(this.data.color),this.darkColor&&this.darkColor.setFromColor(this.data.darkColor),this.data.attachmentName?(this.attachment=null,this.setAttachment(this.bone.skeleton.getAttachment(this.data.index,this.data.attachmentName))):this.attachment=null}}class HE{constructor(e,t){A(this,"data");A(this,"bones");A(this,"target");A(this,"mixRotate",0);A(this,"mixX",0);A(this,"mixY",0);A(this,"mixScaleX",0);A(this,"mixScaleY",0);A(this,"mixShearY",0);A(this,"temp",new ql);A(this,"active",!1);if(!e)throw new Error("data cannot be null.");if(!t)throw new Error("skeleton cannot be null.");this.data=e,this.bones=new Array;for(let n=0;n0?ke.degRad:-.01745329277777778,m=this.data.offsetRotation*d,g=this.data.offsetShearY*d,b=this.bones;for(let _=0,M=b.length;_ke.PI?C-=ke.PI2:C<-3.1415927&&(C+=ke.PI2),C*=e;let R=Math.cos(C),B=Math.sin(C);v.a=R*S-B*I,v.b=R*y-B*E,v.c=B*S+R*I,v.d=B*y+R*E}if(a){let S=this.temp;h.localToWorld(S.set(this.data.offsetX,this.data.offsetY)),v.worldX+=(S.x-v.worldX)*t,v.worldY+=(S.y-v.worldY)*s}if(n!=0){let S=Math.sqrt(v.a*v.a+v.c*v.c);S!=0&&(S=(S+(Math.sqrt(l*l+u*u)-S+this.data.offsetScaleX)*n)/S),v.a*=S,v.c*=S}if(r!=0){let S=Math.sqrt(v.b*v.b+v.d*v.d);S!=0&&(S=(S+(Math.sqrt(c*c+f*f)-S+this.data.offsetScaleY)*r)/S),v.b*=S,v.d*=S}if(o>0){let S=v.b,y=v.d,I=Math.atan2(y,S),E=Math.atan2(f,c)-Math.atan2(u,l)-(I-Math.atan2(v.c,v.a));E>ke.PI?E-=ke.PI2:E<-3.1415927&&(E+=ke.PI2),E=I+(E+g)*o;let C=Math.sqrt(S*S+y*y);v.b=Math.cos(E)*C,v.d=Math.sin(E)*C}v.updateAppliedTransform()}}applyRelativeWorld(){let e=this.mixRotate,t=this.mixX,s=this.mixY,n=this.mixScaleX,r=this.mixScaleY,o=this.mixShearY,a=t!=0||s!=0,h=this.target,l=h.a,c=h.b,u=h.c,f=h.d,d=l*f-c*u>0?ke.degRad:-.01745329277777778,m=this.data.offsetRotation*d,g=this.data.offsetShearY*d,b=this.bones;for(let _=0,M=b.length;_ke.PI?C-=ke.PI2:C<-3.1415927&&(C+=ke.PI2),C*=e;let R=Math.cos(C),B=Math.sin(C);v.a=R*S-B*I,v.b=R*y-B*E,v.c=B*S+R*I,v.d=B*y+R*E}if(a){let S=this.temp;h.localToWorld(S.set(this.data.offsetX,this.data.offsetY)),v.worldX+=S.x*t,v.worldY+=S.y*s}if(n!=0){let S=(Math.sqrt(l*l+u*u)-1+this.data.offsetScaleX)*n+1;v.a*=S,v.c*=S}if(r!=0){let S=(Math.sqrt(c*c+f*f)-1+this.data.offsetScaleY)*r+1;v.b*=S,v.d*=S}if(o>0){let S=Math.atan2(f,c)-Math.atan2(u,l);S>ke.PI?S-=ke.PI2:S<-3.1415927&&(S+=ke.PI2);let y=v.b,I=v.d;S=Math.atan2(I,y)+(S-ke.PI/2+g)*o;let E=Math.sqrt(y*y+I*I);v.b=Math.cos(S)*E,v.d=Math.sin(S)*E}v.updateAppliedTransform()}}applyAbsoluteLocal(){let e=this.mixRotate,t=this.mixX,s=this.mixY,n=this.mixScaleX,r=this.mixScaleY,o=this.mixShearY,a=this.target,h=this.bones;for(let l=0,c=h.length;lt.data.name==e)??null}findTransformConstraint(e){if(!e)throw new Error("constraintName cannot be null.");return this.transformConstraints.find(t=>t.data.name==e)??null}findPathConstraint(e){if(!e)throw new Error("constraintName cannot be null.");return this.pathConstraints.find(t=>t.data.name==e)??null}findPhysicsConstraint(e){if(e==null)throw new Error("constraintName cannot be null.");return this.physicsConstraints.find(t=>t.data.name==e)??null}getBoundsRect(e){let t=new ql,s=new ql;return this.getBounds(t,s,void 0,e),{x:t.x,y:t.y,width:s.x,height:s.y}}getBounds(e,t,s=new Array(2),n=null){if(!e)throw new Error("offset cannot be null.");if(!t)throw new Error("size cannot be null.");let r=this.drawOrder,o=Number.POSITIVE_INFINITY,a=Number.POSITIVE_INFINITY,h=Number.NEGATIVE_INFINITY,l=Number.NEGATIVE_INFINITY;for(let c=0,u=r.length;c=n.length&&(n.length=e+1),n[e]||(n[e]={}),n[e][t]=s}addSkin(e){for(let n=0;n= 0.");if(!t)throw new Error("name cannot be null.");if(!s)throw new Error("boneData cannot be null.");this.index=e,this.name=t,this.boneData=s}}var Hn;(function(i){i[i.Normal=0]="Normal",i[i.Additive=1]="Additive",i[i.Multiply=2]="Multiply",i[i.Screen=3]="Screen"})(Hn||(Hn={}));class rx extends Uh{constructor(t){super(t,0,!1);A(this,"bones",new Array);A(this,"_target",null);A(this,"mixRotate",0);A(this,"mixX",0);A(this,"mixY",0);A(this,"mixScaleX",0);A(this,"mixScaleY",0);A(this,"mixShearY",0);A(this,"offsetRotation",0);A(this,"offsetX",0);A(this,"offsetY",0);A(this,"offsetScaleX",0);A(this,"offsetScaleY",0);A(this,"offsetShearY",0);A(this,"relative",!1);A(this,"local",!1)}set target(t){this._target=t}get target(){if(this._target)return this._target;throw new Error("BoneData not set.")}}class Cd{constructor(e){A(this,"scale",1);A(this,"attachmentLoader");A(this,"linkedMeshes",new Array);this.attachmentLoader=e}readSkeletonData(e){let t=this.scale,s=new eh;s.name="";let n=new WE(e),r=n.readInt32(),o=n.readInt32();s.hash=o==0&&r==0?null:o.toString(16)+r.toString(16),s.version=n.readString(),s.x=n.readFloat(),s.y=n.readFloat(),s.width=n.readFloat(),s.height=n.readFloat(),s.referenceScale=n.readFloat()*t;let a=n.readBoolean();a&&(s.fps=n.readFloat(),s.imagesPath=n.readString(),s.audioPath=n.readString());let h=0;h=n.readInt(!0);for(let c=0;c>1&3,d.rotateMode=m>>3&3,(m&128)!=0&&(d.offsetRotation=n.readFloat()),d.position=n.readFloat(),d.positionMode==Gs.Fixed&&(d.position*=t),d.spacing=n.readFloat(),(d.spacingMode==oi.Length||d.spacingMode==oi.Fixed)&&(d.spacing*=t),d.mixRotate=n.readFloat(),d.mixX=n.readFloat(),d.mixY=n.readFloat(),s.pathConstraints.push(d)}h=n.readInt(!0);for(let c=0,u;c>4,e.readFloat())}n.push(I);break}}}}}let o=e.readInt(!0);if(o>0){let l=new br(o),c=s.slots.length;for(let u=0;u=0;M--)m[M]=-1;let g=Fe.newArray(c-d,0),b=0,_=0;for(let M=0;M=0;M--)m[M]==-1&&(m[M]=g[--_]);l.setFrame(u,f,m)}n.push(l)}let a=e.readInt(!0);if(a>0){let l=new va(a);for(let c=0;c>>1^-(s&1)}readStringRef(){let e=this.readInt(!0);return e==0?null:this.strings[e-1]}readString(){let e=this.readInt(!0);switch(e){case 0:return null;case 1:return""}e--;let t="";for(let s=0;s>4){case 12:case 13:t+=String.fromCharCode((n&31)<<6|this.readByte()&63),s+=2;break;case 14:t+=String.fromCharCode((n&15)<<12|(this.readByte()&63)<<6|this.readByte()&63),s+=3;break;default:t+=String.fromCharCode(n),s++}}return t}readFloat(){let e=this.buffer.getFloat32(this.index);return this.index+=4,e}readBoolean(){return this.readByte()!=0}}let zE=class{constructor(e,t,s,n,r){A(this,"parent");A(this,"skinIndex");A(this,"slotIndex");A(this,"mesh");A(this,"inheritTimeline");this.mesh=e,this.skinIndex=t,this.slotIndex=s,this.parent=n,this.inheritTimeline=r}};class qE{constructor(e=null,t=null,s=0){A(this,"bones");A(this,"vertices");A(this,"length");this.bones=e,this.vertices=t,this.length=s}}var on;(function(i){i[i.Region=0]="Region",i[i.BoundingBox=1]="BoundingBox",i[i.Mesh=2]="Mesh",i[i.LinkedMesh=3]="LinkedMesh",i[i.Path=4]="Path",i[i.Point=5]="Point",i[i.Clipping=6]="Clipping"})(on||(on={}));function vi(i,e,t){let s=i.readFloat(),n=i.readFloat()*t;for(let r=0,o=0,a=e.getFrameCount()-1;e.setFrame(r,s,n),r!=a;r++){let h=i.readFloat(),l=i.readFloat()*t;switch(i.readByte()){case ks:e.setStepped(r);break;case Fs:gt(i,e,o++,r,0,s,h,n,l,t)}s=h,n=l}return e}function Mu(i,e,t){let s=i.readFloat(),n=i.readFloat()*t,r=i.readFloat()*t;for(let o=0,a=0,h=e.getFrameCount()-1;e.setFrame(o,s,n,r),o!=h;o++){let l=i.readFloat(),c=i.readFloat()*t,u=i.readFloat()*t;switch(i.readByte()){case ks:e.setStepped(o);break;case Fs:gt(i,e,a++,o,0,s,l,n,c,t),gt(i,e,a++,o,1,s,l,r,u,t)}s=l,n=c,r=u}return e}function gt(i,e,t,s,n,r,o,a,h,l){e.setBezier(t,s,n,r,a,i.readFloat(),i.readFloat()*l,i.readFloat(),i.readFloat()*l,o,h)}const KE=0,ZE=1,JE=2,QE=3,eA=4,tA=5,iA=6,sA=7,nA=8,rA=9,oA=10,aA=0,lA=1,hA=2,cA=3,uA=4,dA=5,fA=0,pA=1,mA=0,gA=1,vA=2,yA=0,xA=1,bA=2,wA=4,_A=5,SA=6,TA=7,MA=8,ks=1,Fs=2;class Ii{constructor(){A(this,"convexPolygons",new Array);A(this,"convexPolygonsIndices",new Array);A(this,"indicesArray",new Array);A(this,"isConcaveArray",new Array);A(this,"triangles",new Array);A(this,"polygonPool",new zl(()=>new Array));A(this,"polygonIndicesPool",new zl(()=>new Array))}triangulate(e){let t=e,s=e.length>>1,n=this.indicesArray;n.length=0;for(let a=0;a3;){let a=s-1,h=0,l=1;for(;;){e:if(!r[h]){let f=n[a]<<1,d=n[h]<<1,m=n[l]<<1,g=t[f],b=t[f+1],_=t[d],M=t[d+1],v=t[m],S=t[m+1];for(let y=(l+1)%s;y!=a;y=(y+1)%s){if(!r[y])continue;let I=n[y]<<1,E=t[I],C=t[I+1];if(Ii.positiveArea(v,S,g,b,E,C)&&Ii.positiveArea(g,b,_,M,E,C)&&Ii.positiveArea(_,M,v,S,E,C))break e}break}if(l==0){do{if(!r[h])break;h--}while(h>0);break}a=h,h=l,l=(l+1)%s}o.push(n[(s+h-1)%s]),o.push(n[h]),o.push(n[(h+1)%s]),n.splice(h,1),r.splice(h,1),s--;let c=(s+h-1)%s,u=h==s?0:h;r[c]=Ii.isConcave(c,s,t,n),r[u]=Ii.isConcave(u,s,t,n)}return s==3&&(o.push(n[2]),o.push(n[0]),o.push(n[1])),o}decompose(e,t){let s=e,n=this.convexPolygons;this.polygonPool.freeAll(n),n.length=0;let r=this.convexPolygonsIndices;this.polygonIndicesPool.freeAll(r),r.length=0;let o=this.polygonIndicesPool.obtain();o.length=0;let a=this.polygonPool.obtain();a.length=0;let h=-1,l=0;for(let c=0,u=t.length;c0?(n.push(a),r.push(o)):(this.polygonPool.free(a),this.polygonIndicesPool.free(o)),a=this.polygonPool.obtain(),a.length=0,a.push(g),a.push(b),a.push(_),a.push(M),a.push(v),a.push(S),o=this.polygonIndicesPool.obtain(),o.length=0,o.push(f),o.push(d),o.push(m),l=Ii.winding(g,b,_,M,v,S),h=f)}a.length>0&&(n.push(a),r.push(o));for(let c=0,u=n.length;c=0;c--)a=n[c],a.length==0&&(n.splice(c,1),this.polygonPool.free(a),o=r[c],r.splice(c,1),this.polygonIndicesPool.free(o));return n}static isConcave(e,t,s,n){let r=n[(t+e-1)%t]<<1,o=n[e]<<1,a=n[(e+1)%t]<<1;return!this.positiveArea(s[r],s[r+1],s[o],s[o+1],s[a],s[a+1])}static positiveArea(e,t,s,n,r,o){return e*(o-n)+s*(t-o)+r*(n-t)>=0}static winding(e,t,s,n,r,o){let a=s-e,h=n-t;return r*h-o*a+a*t-e*h>=0?1:-1}}class th{constructor(){A(this,"triangulator",new Ii);A(this,"clippingPolygon",new Array);A(this,"clipOutput",new Array);A(this,"clippedVertices",new Array);A(this,"clippedUVs",new Array);A(this,"clippedTriangles",new Array);A(this,"scratch",new Array);A(this,"clipAttachment",null);A(this,"clippingPolygons",null)}clipStart(e,t){if(this.clipAttachment)return 0;this.clipAttachment=t;let s=t.worldVerticesLength,n=Fe.setArraySize(this.clippingPolygon,s);t.computeWorldVertices(e,0,s,n,0,2);let r=this.clippingPolygon;th.makeClockwise(r);let o=this.clippingPolygons=this.triangulator.decompose(r,this.triangulator.triangulate(r));for(let a=0,h=o.length;a>1,I=this.clipOutput,E=Fe.setArraySize(r,v+y*2);for(let R=0;R>1,q=this.clipOutput,z=Fe.setArraySize(l,N+Y*d);for(let H=0;H>1,X=this.clipOutput,U=Fe.setArraySize(o,k+P*2),Y=Fe.setArraySize(a,k+P*2);for(let z=0;z=2?(u=h,h=this.scratch):u=this.scratch,u.length=0,u.push(e),u.push(t),u.push(s),u.push(n),u.push(r),u.push(o),u.push(e),u.push(t),h.length=0;let f=a.length-4,d=a;for(let m=0;;m+=2){let g=d[m],b=d[m+1],_=g-d[m+2],M=b-d[m+3],v=h.length,S=u;for(let I=0,E=u.length-2;I_*(b-k),D=M*(g-C)-_*(b-R);if(D>0){if(F){h.push(B),h.push(k);continue}let N=B-C,j=k-R,O=D/(N*M-j*_);if(O>=0&&O<=1)h.push(C+N*O),h.push(R+j*O);else{h.push(B),h.push(k);continue}}else if(F){let N=B-C,j=k-R,O=D/(N*M-j*_);if(O>=0&&O<=1)h.push(C+N*O),h.push(R+j*O),h.push(B),h.push(k);else{h.push(B),h.push(k);continue}}c=!0}if(v==h.length)return l.length=0,!0;if(h.push(h[0]),h.push(h[1]),m==f)break;let y=h;h=u,h.length=0,u=y}if(l!=h){l.length=0;for(let m=0,g=h.length-2;m>1;l0){let c=s.findPhysicsConstraint(a);if(!c)throw new Error("Physics constraint not found: "+a);l=s.physicsConstraints.indexOf(c)}for(let c in h){let u=h[c],f=u[0];if(!f)continue;let d=u.length;if(c=="reset"){const g=new Jl(d,l);for(let b=0;f!=null;f=u[b+1],b++)g.setFrame(b,ee(f,"time",0));r.push(g);continue}let m;if(c=="inertia")m=new $y(d,d,l);else if(c=="strength")m=new Gy(d,d,l);else if(c=="damping")m=new jy(d,d,l);else if(c=="mass")m=new Hy(d,d,l);else if(c=="wind")m=new Wy(d,d,l);else if(c=="gravity")m=new zy(d,d,l);else if(c=="mix")m=new qy(d,d,l);else continue;r.push(ss(u,m,0,1))}}if(e.attachments)for(let a in e.attachments){let h=e.attachments[a],l=s.findSkin(a);if(!l)throw new Error("Skin not found: "+a);for(let c in h){let u=h[c],f=s.findSlot(c);if(!f)throw new Error("Slot not found: "+c);let d=f.index;for(let m in u){let g=u[m],b=l.getAttachment(d,m);for(let _ in g){let M=g[_],v=M[0];if(v){if(_=="deform"){let S=b.bones,y=b.vertices,I=S?y.length/3*2:y.length,E=new Dy(M.length,M.length,d,b),C=ee(v,"time",0);for(let R=0,B=0;;R++){let k,F=ee(v,"vertices",null);if(!F)k=S?Fe.newFloatArray(I):y;else{k=Fe.newFloatArray(I);let O=ee(v,"offset",0);if(Fe.arrayCopy(F,0,k,O,F.length),n!=1)for(let L=O,P=L+F.length;L=0;_--)f[_]==-1&&(f[_]=m[--b])}a.setFrame(l,ee(u,"time",0),f)}r.push(a)}if(e.events){let a=new va(e.events.length),h=0;for(let l=0;l"u"&&(Math.fround=(function(i){return function(e){return i[0]=e,i[0]}})(new Float32Array(1)));const an=class an extends UE{constructor(t){super(t.resource.source);A(this,"texture");this.texture=et.from(t)}static from(t){return an.textureMap.has(t)?an.textureMap.get(t):new an(t)}setFilters(t,s){this.texture.baseTexture.scaleMode=an.toPixiTextureFilter(t),this.texture.baseTexture.mipmap=an.toPixiMipMap(t)}setWraps(t,s){this.texture.baseTexture.wrapMode=an.toPixiTextureWrap(t)}dispose(){this.texture.destroy()}static toPixiTextureFilter(t){switch(t){case hi.Nearest:case hi.MipMapNearestLinear:case hi.MipMapNearestNearest:return as.NEAREST;case hi.Linear:case hi.MipMapLinearLinear:case hi.MipMapLinearNearest:return as.LINEAR;default:throw new Error(`Unknown texture filter: ${String(t)}`)}}static toPixiMipMap(t){switch(t){case hi.Nearest:case hi.Linear:return Ki.OFF;case hi.MipMapNearestLinear:case hi.MipMapNearestNearest:case hi.MipMapLinearLinear:case hi.MipMapLinearNearest:return Ki.ON;default:throw new Error(`Unknown texture filter: ${String(t)}`)}}static toPixiTextureWrap(t){switch(t){case yn.ClampToEdge:return us.CLAMP;case yn.MirroredRepeat:return us.MIRRORED_REPEAT;case yn.Repeat:return us.REPEAT;default:throw new Error(`Unknown texture wrap: ${String(t)}`)}}static toPixiBlending(t){switch(t){case Hn.Normal:return Qe.NORMAL;case Hn.Additive:return Qe.ADD;case Hn.Multiply:return Qe.MULTIPLY;case Hn.Screen:return Qe.SCREEN;default:throw new Error(`Unknown blendMode: ${String(t)}`)}}};A(an,"textureMap",new Map);let Ar=an;const ln=class ln extends ma{constructor(){const t=new hf;t.getBuffer("aVertexPosition").static=!1,t.getBuffer("aTextureCoord").static=!1;const s=new jl(et.EMPTY);super(t,s);A(this,"name","");A(this,"warnedTwoTint",!1)}updateFromSpineData(t,s,n,r,o,a,h,l){var _,M;this.texture=t.texture;const c=o/(l?12:8)*2,u=this.geometry.getBuffer("aTextureCoord");((_=u.data)==null?void 0:_.length)!==c&&(u.data=new Float32Array(c));const f=this.geometry.getBuffer("aVertexPosition");((M=f.data)==null?void 0:M.length)!==c&&(f.data=new Float32Array(c));let d=0,m=u.data,g=f.data;for(let v=0;va.id===r)||(this.container.removeChild(o.root),o.root.destroy({children:!0}),this.entries.delete(r));for(const r of e){const o=EE(r.id);let a=this.entries.get(r.id);if(a&&a.assetVersion!==r.assetVersion&&!o&&(this.container.removeChild(a.root),a.root.destroy({children:!0}),this.entries.delete(r.id),a=void 0),(!a||a.assetVersion!==r.assetVersion)&&o){a&&(this.container.removeChild(a.root),a.root.destroy({children:!0}));const f=new gi,d=new Rd({skeletonData:o.skeletonData,autoUpdate:!1,darkTint:!1});o.skeletonData.defaultSkin&&d.skeleton.setSkin(o.skeletonData.defaultSkin),d.skeleton.setSlotsToSetupPose(),f.addChild(d),this.container.addChild(f),a={root:f,spine:d,assetVersion:r.assetVersion,animation:""},this.entries.set(r.id,a)}if(!a)continue;const h=a.root,l=a.spine,c=r.visible!==!1&&r.enabled;h.visible=c,h.renderable=c,h.position.set(r.x,-r.y),h.rotation=-r.rotation*Math.PI/180,h.scale.set(r.scaleX,r.scaleY),a.animation!==r.selectedAnimation&&(a.animation=r.selectedAnimation,l.skeleton.setToSetupPose(),l.state.clearTracks(),a.animation&&l.state.setAnimation(0,a.animation,!1));const u=l.state.getCurrent(0);if(u){const f=((n=r.animations.find(m=>m.name===r.selectedAnimation))==null?void 0:n.duration)||0,d=Math.max(0,t/Math.max(1,s)-r.timeOffset);u.trackTime=f>0?Math.min(d,f):d}l.update(0)}}getBoneWorldTransform(e,t){const s=this.entries.get(e),n=s==null?void 0:s.spine.skeleton.findBone(t);if(!s||!n||!n.active)return null;const r=s.root,o=Math.cos(r.rotation),a=Math.sin(r.rotation),h=o*r.scale.x,l=-a*r.scale.y,c=a*r.scale.x,u=o*r.scale.y,f=h*n.a+l*n.c,d=h*n.b+l*n.d,m=c*n.a+u*n.c,g=c*n.b+u*n.d,b=r.position.x+h*n.worldX+l*n.worldY,_=r.position.y+c*n.worldX+u*n.worldY;return{x:b,y:-_,rotation:-Math.atan2(m,f)*180/Math.PI,scaleX:Math.max(1e-4,Math.hypot(f,m)),scaleY:Math.max(1e-4,Math.hypot(d,g))}}destroy(){for(const e of this.entries.values())e.root.removeFromParent(),e.root.destroy({children:!0});this.entries.clear(),this.container.removeFromParent(),this.container.destroy({children:!0})}}function Yn(i,e,t){const s=Number(i[e]);return Number.isFinite(s)?s:t}function ki(i,e,t,s){i[e]==null&&(i[e]=Yn(i,t,s))}function pf(i,e,t){if(typeof i.curve!="number")return;const s=Yn(i,"time",0),r=Yn(e,"time",0)-s,o=i.curve,a=Yn(i,"c2",0),h=Yn(i,"c3",1),l=Yn(i,"c4",1);i.curve=t.flatMap(([c,u])=>[s+r*o,c+(u-c)*a,s+r*h,c+(u-c)*l]),delete i.c2,delete i.c3,delete i.c4}function Wn(i,e){if(Array.isArray(i))for(let t=0;t[Yn(s,r,o),Yn(n,r,o)]))}}function VA(i){if(Array.isArray(i))for(let e=0;eNumber.parseInt(s.slice(r,r+2),16)/255);return e?n:n.slice(0,3)}function dg(i,e){if(Array.isArray(i))for(let t=0;t[a,o[h]]))}}function XA(i){for(const e of i.bones||[])e.inherit==null&&e.transform!=null&&(e.inherit=e.transform);for(const e of i.transform||[])ki(e,"mixRotate","rotateMix",1),ki(e,"mixX","translateMix",1),e.mixY==null&&(e.mixY=e.mixX),ki(e,"mixScaleX","scaleMix",1),e.mixScaleY==null&&(e.mixScaleY=e.mixScaleX),ki(e,"mixShearY","shearMix",1);for(const e of i.path||[])ki(e,"mixRotate","rotateMix",1),ki(e,"mixX","translateMix",1),e.mixY==null&&(e.mixY=e.mixX)}function YA(i){for(const e of i.skins||[])for(const t of Object.values(e.attachments||{}))for(const s of Object.values(t||{}))s.parent!=null&&s.timelines==null&&s.deform!=null&&(s.timelines=s.deform)}function $A(i){for(const e of Object.values(i.slots||{}))e.color&&!e.rgba&&(e.rgba=e.color,delete e.color),e.twoColor&&!e.rgba2&&(e.rgba2=e.twoColor,delete e.twoColor),dg(e.rgba,!1),dg(e.rgba2,!0)}function GA(i){for(const e of Object.values(i.bones||{})){for(const t of e.rotate||[])ki(t,"value","angle",0);Wn(e.rotate,[{key:"value",fallback:0}]),Wn(e.translate,[{key:"x",fallback:0},{key:"y",fallback:0}]),Wn(e.scale,[{key:"x",fallback:1},{key:"y",fallback:1}]),Wn(e.shear,[{key:"x",fallback:0},{key:"y",fallback:0}])}}function jA(i){for(const e of Object.values(i.ik||{}))Wn(e,[{key:"mix",fallback:1},{key:"softness",fallback:0}])}function HA(i){for(const e of Object.values(i.transform||{})){for(const t of e)ki(t,"mixRotate","rotateMix",1),ki(t,"mixX","translateMix",1),t.mixY==null&&(t.mixY=t.mixX),ki(t,"mixScaleX","scaleMix",1),t.mixScaleY==null&&(t.mixScaleY=t.mixScaleX),ki(t,"mixShearY","shearMix",1);Wn(e,[{key:"mixRotate",fallback:1},{key:"mixX",fallback:1},{key:"mixY",fallback:1},{key:"mixScaleX",fallback:1},{key:"mixScaleY",fallback:1},{key:"mixShearY",fallback:1}])}}function WA(i){for(const e of Object.values(i.path||{})){for(const s of["position","spacing"]){const n=e[s];for(const r of n||[])ki(r,"value",s,0);Wn(n,[{key:"value",fallback:0}])}const t=e.mix;for(const s of t||[])ki(s,"mixRotate","rotateMix",1),ki(s,"mixX","translateMix",1),s.mixY==null&&(s.mixY=s.mixX);Wn(t,[{key:"mixRotate",fallback:1},{key:"mixX",fallback:1},{key:"mixY",fallback:1}])}}function zA(i){if(!i.deform)return;const e=i.attachments||(i.attachments={});for(const[t,s]of Object.entries(i.deform)){const n=e[t]||(e[t]={});for(const[r,o]of Object.entries(s)){const a=n[r]||(n[r]={});for(const[h,l]of Object.entries(o)){const c=a[h]||(a[h]={});c.deform=l,VA(l)}}}delete i.deform}function ax(i){XA(i),YA(i);for(const e of Object.values(i.animations||{}))$A(e),GA(e),jA(e),HA(e),WA(e),zA(e),!e.drawOrder&&e.draworder&&(e.drawOrder=e.draworder);return i}function fg(i){return i.replace(/\\/g,"/").split("/").pop()||i}async function qA(i){const e=URL.createObjectURL(i);return await et.fromURL(e)}function KA(i){const e=new Map;return i.bones.map(t=>{var r;const s=((r=t.parent)==null?void 0:r.name)||null,n=s?(e.get(s)||0)+1:0;return e.set(t.name,n),{name:t.name,parent:s,depth:n}})}async function lx(i,e,t){var o;if(!/\.(json|skel)$/i.test(i.name))throw new Error("Spine 数据仅支持 .json 或 .skel");if(!/\.atlas$/i.test(e.name))throw new Error("图集文件仅支持 .atlas");if(!t.length)throw new Error("请至少选择一张纹理图片");const s=new Ky(await e.text()),n=new Map(t.map(a=>[fg(a.name).toLowerCase(),a])),r=[];try{for(const c of s.pages){const u=n.get(fg(c.name).toLowerCase());if(!u)throw new Error(`Atlas 引用的纹理未选择:${c.name}`);const f=await qA(u);f.baseTexture.alphaMode=c.pma?ui.PMA:ui.UNPACK,r.push(f),c.setTexture(Ar.from(f.baseTexture))}const a=new Md(s);let h,l=null;if(/\.skel$/i.test(i.name))h=new Cd(a).readSkeletonData(await i.arrayBuffer()),l=Wl(h.version);else{let c;try{c=JSON.parse(await i.text())}catch{throw new Error("Spine JSON 文件格式无效")}if(l=Wl((o=c==null?void 0:c.skeleton)==null?void 0:o.spine),!l)throw new Error(`Spine JSON 版本不受支持,仅支持 ${Sd()}`);l==="3.8"&&ax(c),h=new ih(a).readSkeletonData(c)}if(!l)throw new Error(`Spine 数据版本不受支持,仅支持 ${Sd()}`);return{skeletonData:h,textures:r,dataVersion:l,animations:h.animations.map(c=>({name:c.name,duration:c.duration})),bones:KA(h)}}catch(a){for(const h of r)h.destroy(!0);throw a}}function wl(i){return new Promise((e,t)=>{const s=new FileReader;s.onload=()=>e(String(s.result||"")),s.onerror=()=>t(s.error),s.readAsDataURL(i)})}async function ZA(i,e,t){return{skeleton:{name:i.name,dataUrl:await wl(i)},atlas:{name:e.name,dataUrl:await wl(e)},textures:await Promise.all(t.map(async s=>({name:s.name,dataUrl:await wl(s)})))}}async function Au(i){const e=await fetch(i.dataUrl);if(!e.ok)throw new Error(`无法读取内嵌 Spine 文件:${i.name}`);return new File([await e.blob()],i.name)}async function JA(i){return{skeleton:await Au(i.skeleton),atlas:await Au(i.atlas),textures:await Promise.all(i.textures.map(Au))}}const hx="SpineParticle.EditorConfig",cx=1;function ux(i){return{backgroundX:i.backgroundX,backgroundY:i.backgroundY,backgroundOpacity:i.backgroundOpacity,backgroundImageName:i.backgroundImageName,backgroundImageData:i.backgroundImageData,showGrid:i.showGrid,exportSettings:Ut(i.exportSettings)}}function QA(i){return JSON.parse(JSON.stringify(i,(e,t)=>{if(!(e==="texture"||e==="trailTexture"||e==="frames"))return t}))}function eC(i){const e=ux(i.settings);return QA({format:hx,version:cx,savedAt:new Date().toISOString(),editor:Ut(i.editor),settings:e,timeline:{fps:i.timeline.fps,loop:i.timeline.loop,animations:[...i.timeline.animations]},selection:{type:i.activeObjectType,id:i.activeObjectId},scene:{systems:i.systems.map(t=>({...Ut(t),frames:void 0})),colliders:Ut(i.colliders),paths:Ut(i.paths),spines:Ut(i.spines)}})}function tC(){return`SpineParticle-${new Date().toISOString().replace(/[-:]/g,"").replace(/\.\d{3}Z$/,"").replace("T","-")}.json`}function dx(i){const e=eC(i),t=new Blob([JSON.stringify(e,null,2)],{type:"application/json;charset=utf-8"}),s=URL.createObjectURL(t),n=document.createElement("a");return n.href=s,n.download=tC(),document.body.appendChild(n),n.click(),n.remove(),setTimeout(()=>URL.revokeObjectURL(s),0),e}function fx(i){let e;try{e=JSON.parse(i)}catch{throw new Error("配置文件不是有效的 JSON")}const t=e;if(t.format!==hx)throw new Error("不是 SpineParticle 编辑器配置文件");if(t.version!==cx)throw new Error(`暂不支持配置版本:${t.version??"未知"}`);if(!t.scene||!Array.isArray(t.scene.systems)||!Array.isArray(t.scene.colliders)||!Array.isArray(t.scene.paths)||!Array.isArray(t.scene.spines))throw new Error("配置文件缺少完整场景数据");return t}async function iC(i){const e=new Map,t=n=>{const r=n==="/particles/star.png"?"/images/star.png":n==="/trails/trail.png"?"/images/trail.png":n||"/images/star.png";let o=e.get(r);return o||(o=et.fromURL(r).then(a=>$n(a)),e.set(r,o)),o},s=await t("/images/star.png");await Promise.all(i.map(async n=>{var o;const r=Tr(n.config);r.texture=s,await Promise.all(r.imageResources.map(async a=>{a.texture=await t(a.previewUrl||"/images/star.png"),await Promise.all(a.sequenceFrames.map(async h=>{h.texture=await t(h.previewUrl||a.previewUrl||"/images/star.png")}))})),await Promise.all(r.trailResources.map(async a=>{a.texture=await t(a.previewUrl||"/images/trail.png")})),r.trailTexture=((o=r.trailResources[0])==null?void 0:o.texture)||null,n.frames=[]}))}async function sC(i){const e=new Map;try{for(const t of i){if(!t.sourceBundle)continue;const s=await JA(t.sourceBundle);e.set(t.id,await lx(s.skeleton,s.atlas,s.textures))}return e}catch(t){for(const s of e.values())for(const n of s.textures)n.destroy(!0);throw t}}function nC(i,e){const t=(e==null?void 0:e.type)||"particle",s=Number(e==null?void 0:e.id)||0;(t==="particle"?i.systems.some(r=>r.id===s):t==="collision"?i.colliders.some(r=>r.id===s):t==="path"?i.paths.some(r=>r.id===s):i.spines.some(r=>r.id===s))?i.selectSceneObject(t,s):i.systems[0]?i.selectSceneObject("particle",i.systems[0].id):i.colliders[0]?i.selectSceneObject("collision",i.colliders[0].id):i.paths[0]?i.selectSceneObject("path",i.paths[0].id):i.spines[0]?i.selectSceneObject("spine",i.spines[0].id):(i.activeObjectType="particle",i.activeObjectId=0,i.activeId=0)}async function rC(i,e){var c,u,f,d,m;const t=fx(JSON.stringify(e)),s=Ut(t.scene.systems),n=Ut(t.scene.colliders),r=Ut(t.scene.paths),o=Ut(t.scene.spines);for(const g of o)g.sourceBundle==null&&(g.sourceBundle=null),g.dataVersion==null&&(g.dataVersion="");await iC(s);const a=await sC(o),h=new Map(i.spines.map(g=>[g.id,g.assetVersion]));for(const g of i.spines)Ea(g.id);i.systems=s,i.colliders=n,i.paths=r,i.spines=o,Object.assign(i.editor,Ut(t.editor||{}));const l=t.settings;if(l)for(const g of["backgroundX","backgroundY","backgroundOpacity","backgroundImageName","backgroundImageData","showGrid"])Object.prototype.hasOwnProperty.call(l,g)&&(i.settings[g]=l[g]);i.settings.exportSettings=gy((c=t.settings)==null?void 0:c.exportSettings),i.settings.undoLimit=Math.min(200,Math.max(1,Math.round(Number(i.settings.undoLimit)||20))),i.timeline.fps=Math.max(1,Math.round(Number((u=t.timeline)==null?void 0:u.fps)||30)),i.timeline.loop=((f=t.timeline)==null?void 0:f.loop)!==!1,i.timeline.animations=Array.isArray((d=t.timeline)==null?void 0:d.animations)&&t.timeline.animations.length?[...new Set(t.timeline.animations.filter(g=>typeof g=="string"&&g.trim()).map(g=>g.trim()))]:["animation"];for(const g of i.spines){const b=a.get(g.id);if(g.assetVersion=Math.max(Number(g.assetVersion)||0,h.get(g.id)||0)+1,!b){g.status="empty",g.error=g.skeletonFileName?"配置未包含可复用的 Spine 原始资源":"",g.animations=[],g.bones=[],g.selectedAnimation="";continue}Lh(g.id,b),g.dataVersion=b.dataVersion,g.animations=b.animations,g.bones=b.bones,b.animations.some(_=>_.name===g.selectedAnimation)||(g.selectedAnimation=((m=b.animations[0])==null?void 0:m.name)||""),g.status="ready",g.error=""}i.syncSceneSequences(),nC(i,t.selection),i.timeline.frame=0,i.timeline.recorded=!1,i.timeline.playing=!0;for(const g of i.systems)i.timeline.animations.includes(g.animation)||(g.animation=i.timeline.animations[0]);return i.recalcTotalFrames(),t}async function px(i,e){return rC(i,fx(e))}async function oC(i,e){if(!/\.json$/i.test(e.name))throw new Error("请选择 .json 配置文件");return px(i,await e.text())}const Vh=wo({undoCount:0});let sh=null,pn=null,qn=[],Do=null,mn=null,nh=!1;function mf(i){return{systems:i.systems.map(t=>{const s=Ut(t);return s.frames=void 0,s}),colliders:Ut(i.colliders),paths:Ut(i.paths),spines:Ut(i.spines),animations:[...i.timeline.animations],settings:ux(i.settings)}}function gf(i){return JSON.stringify(i,(e,t)=>e==="texture"||e==="trailTexture"?null:typeof t=="string"&&t.startsWith("data:")&&t.length>256?`${t.length}:${t.slice(0,96)}:${t.slice(-48)}`:t)}function mx(i,e=mf(i),t=gf(e)){const s=new Map;for(const n of e.spines){const r=AE(n.id);r&&s.set(n.id,r)}return{data:e,signature:t,spineAssets:s}}function rh(i){if(i){for(const e of i.spineAssets.values())ME(e);i.spineAssets.clear()}}function gx(i){for(;qn.length>i;)rh(qn.shift()||null);Vh.undoCount=qn.length}function vx(){const i=sh;if(!i||!pn||nh)return;const e=mf(i),t=gf(e);t!==pn.signature&&(qn.push(pn),pn=mx(i,e,t),gx(i.settings.undoLimit))}function aC(){nh||(mn&&clearTimeout(mn),mn=setTimeout(()=>{mn=null,vx()},250))}function lC(i){const e=i.activeObjectId;return i.activeObjectType==="particle"?i.systems.some(t=>t.id===e):i.activeObjectType==="collision"?i.colliders.some(t=>t.id===e):i.activeObjectType==="path"?i.paths.some(t=>t.id===e):i.spines.some(t=>t.id===e)}function hC(i){var t,s;if(!lC(i)){const n=i.systems[0],r=i.colliders[0],o=i.paths[0],a=i.spines[0];n?(i.activeObjectType="particle",i.activeObjectId=n.id):r?(i.activeObjectType="collision",i.activeObjectId=r.id):o?(i.activeObjectType="path",i.activeObjectId=o.id):(i.activeObjectType="spine",i.activeObjectId=(a==null?void 0:a.id)||0)}const e=i.activeObjectType==="particle"?i.systems.find(n=>n.id===i.activeObjectId):i.systems.find(n=>n.id===i.activeId);i.activeId=(e==null?void 0:e.id)||((t=i.systems[0])==null?void 0:t.id)||0,i.timeline.animation=(e==null?void 0:e.animation)||((s=i.systems[0])==null?void 0:s.animation)||i.timeline.animations[0]||"animation"}function cC(i,e){const t=pn;nh=!0;try{for(const s of i.spines)Ea(s.id);i.systems=Ut(e.data.systems),i.colliders=Ut(e.data.colliders),i.paths=Ut(e.data.paths),i.spines=Ut(e.data.spines),i.timeline.animations=[...e.data.animations],Object.assign(i.settings,Ut(e.data.settings));for(const[s,n]of e.spineAssets)Lh(s,n);for(const s of i.systems)s.frames=[];i.timeline.recorded=!1,i.timeline.playing=!1,hC(i),i.recalcTotalFrames(),pn=e}finally{nh=!1,rh(t)}}function uC(i){if(!(sh===i&&Do)){Do==null||Do(),mn&&clearTimeout(mn),rh(pn);for(const e of qn)rh(e);qn=[],sh=i,pn=mx(i),Vh.undoCount=0,Do=cs(()=>gf(mf(i)),aC,{flush:"post"})}}function dC(i,e){const t=Math.min(200,Math.max(1,Math.round(Number(e)||20)));i.settings.undoLimit=t,gx(t)}function Cu(){const i=sh;if(!i||!pn)return!1;mn&&(clearTimeout(mn),mn=null),vx();const e=qn.pop();return e?(cC(i,e),Vh.undoCount=qn.length,!0):!1}function fC(i){const e=i instanceof HTMLElement?i:null;return!!(e!=null&&e.closest('input, textarea, select, [contenteditable="true"]'))}function pC(i){function e(s){var r;const n=s.target instanceof Node?s.target:null;i.canvasFocused.value=!!n&&!!((r=i.canvasElement.value)!=null&&r.contains(n))}function t(s){const n=s.key.toLowerCase();if((s.ctrlKey||s.metaKey)&&!s.altKey&&n==="s"){s.preventDefault(),s.stopPropagation(),i.save();return}if((s.ctrlKey||s.metaKey)&&!s.altKey&&n==="z"){s.preventDefault(),s.stopPropagation(),i.undo();return}if(s.ctrlKey||s.metaKey||s.altKey||fC(s.target))return;if(n==="d"){s.preventDefault(),i.togglePlay();return}if(n==="s"){s.preventDefault(),i.toStart();return}if(!i.canvasFocused.value)return;const r={q:"",w:"translate",e:"rotate",r:"scale"};n in r&&(s.preventDefault(),i.setTool(r[n]))}_o(()=>{document.addEventListener("pointerdown",e,!0),window.addEventListener("keydown",t,!0)}),wa(()=>{document.removeEventListener("pointerdown",e,!0),window.removeEventListener("keydown",t,!0)})}const mC={class:"stage-wrap"},gC={class:"topbar"},vC=["disabled"],yC={class:"tool-group"},xC={class:"tool-group"},bC={key:0,class:"background-panel"},wC=["disabled"],_C=["title"],SC={class:"background-position-row"},TC={class:"background-opacity-row"},MC={class:"zoom-pct"},EC={key:0,class:"settings-panel"},AC={class:"sp-head"},CC={class:"sp-switch-row"},IC={class:"sp-switch-control"},RC={class:"sp-row"},PC={class:"sp-chk"},kC={class:"sp-chk"},FC={class:"sp-row"},OC={class:"sp-row"},BC={class:"sp-chk"},LC={class:"sp-chk"},DC={class:"sp-row"},NC={class:"sp-row"},UC={class:"sp-row"},VC={class:"sp-hex"},XC={class:"sp-chk"},YC={class:"help-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"help-title"},$C={class:"help-head"},GC={key:2,class:"hud"},jC={class:"hud-number hud-system-count"},HC={class:"hud-number hud-particle-count"},WC=Ws({__name:"Stage",setup(i){const e=Aa(),t=it(null),s=it(null),n=it(!1),r=it(!1),o=it(!1),a=it(null),h=ut(()=>e.settings.backgroundImageName),l=it(""),c=it(!1);function u(G){l.value=l.value===G?"":G}e.settings.undoLimit>0||(e.settings.undoLimit=20),e.settings.parameterPanelOnRight==null&&(e.settings.parameterPanelOnRight=!1),Number.isFinite(e.settings.backgroundX)||(e.settings.backgroundX=0),Number.isFinite(e.settings.backgroundY)||(e.settings.backgroundY=0),Number.isFinite(e.settings.backgroundOpacity)||(e.settings.backgroundOpacity=1),e.settings.backgroundImageName==null&&(e.settings.backgroundImageName=""),e.settings.backgroundImageData==null&&(e.settings.backgroundImageData=""),e.settings.showEmitter==null&&(e.settings.showEmitter=!0),e.settings.showBones==null&&(e.settings.showBones=!1),e.settings.bonePointDrawSize>0||(e.settings.bonePointDrawSize=1),e.settings.boneAxisDrawSize>0||(e.settings.boneAxisDrawSize=2),e.settings.showSkinMesh==null&&(e.settings.showSkinMesh=!1),e.settings.showGrid==null&&(e.settings.showGrid=!0);function f(){e.settings.bonePointDrawSize=Math.min(10,Math.max(.1,Number(e.settings.bonePointDrawSize)||1)),e.settings.boneAxisDrawSize=Math.min(10,Math.max(.1,Number(e.settings.boneAxisDrawSize)||2))}pC({canvasElement:t,canvasFocused:c,undo:Cu,save:()=>dx(e),togglePlay:()=>e.togglePlay(),toStart:()=>e.toStart(),setTool:G=>{l.value=G}});let d=null,m=null,g=null,b=null,_=0,M=null,v=null,S=null,y=null,I=null,E=null,C=null,R=null,B=null,k=null,F=null,D=null,N=[],j=0,O=0,L=0,P=0,X=null,U=null;const Y=new Map,q=new Map;let z=[];const ne=new Map,H=new Set;let Z=!1;cs(()=>[e.activeObjectType,e.activeObjectId],()=>H.clear());async function ae(){if(X&&U)return X;const[G,T]=await Promise.all([et.fromURL("/images/star.png"),et.fromURL("/images/trail.png")]);return X=G,U=T,X}function me(){m=new gi,d.stage.addChild(m),F=new gi,d.stage.addChild(F),g=new Qn(et.EMPTY),g.anchor.set(.5),g.visible=!1,m.addChild(g),k=new Ri,m.addChild(k),D=new UA,m.addChild(D.container),v=new Ri,m.addChild(v),M=new Ri,m.addChild(M),y=new Ri,m.addChild(y),I=new Ri,m.addChild(I),E=new Ri,m.addChild(E),C=new Ri,m.addChild(C),R=new Ri,m.addChild(R),B=new Ri,m.addChild(B),S=new Ri,m.addChild(S)}function _e(){r.value=!r.value,r.value&&(n.value=!1)}function te(){o.value=!0,n.value=!1,r.value=!1}function ve(G){G.key==="Escape"&&o.value&&(o.value=!1)}function $(){n.value=!n.value,n.value&&(r.value=!1)}function W(G){dC(e,Number(G.target.value))}async function J(G){var x;const T=G.target,p=(x=T.files)==null?void 0:x[0];if(p)try{e.settings.backgroundImageData=await wl(p),e.settings.backgroundImageName=p.name}catch(V){console.error("背景图加载失败",V)}finally{T.value=""}}async function Q(G){const T=++_;if(!G){g&&(g.texture=et.EMPTY,g.visible=!1),b&&b.destroy(!0),b=null;return}try{const p=await et.fromURL(G);if(T!==_||!g){p.destroy(!0);return}const x=b;b=p,g.texture=p,g.visible=!0,x&&x.destroy(!0)}catch(p){console.error("背景图恢复失败",p)}}function ie(G=!0){e.settings.backgroundImageData="",e.settings.backgroundImageName="",a.value&&(a.value.value=""),G&&(e.settings.backgroundX=0,e.settings.backgroundY=0,e.settings.backgroundOpacity=1)}function ue(G,T=0){if(G<=0)return 1;const p=Math.pow(10,Math.floor(Math.log10(G))),x=[1,2,5,10,20,50,100];let V=1;for(const K of x)if(K*p>=G){V=K*p;break}return Math.max(V,T)}function Se(){if(!k)return;const G=k;G.clear();const T=e.settings;if(!T.tickEnabled){for(const ge of N)ge.visible=!1;return}const p=0,x=0,V=d.screen.width/e.editor.viewScale,K=d.screen.height/e.editor.viewScale,oe=+("0x"+T.axisColor.replace("#",""));G.lineStyle(1.5,oe,.35),G.moveTo(-V,x),G.lineTo(V,x),G.moveTo(p,-K),G.lineTo(p,K);const pe=e.editor.viewScale,he=ue(50/pe),be=V,fe=K,Te=Math.max(1,T.tickWidth);if(T.tickEnabled){for(let ge=0;ge<=V;ge+=he){const rt=Math.round(ge/he)*he;rt!==0&&(G.lineStyle(Te,oe,.25),G.moveTo(rt,x-4),G.lineTo(rt,x+4))}for(let ge=0;ge<=K;ge+=he)Math.round(ge/he)*he!==0&&(G.lineStyle(Te,oe,.25),G.moveTo(p-4,ge),G.lineTo(p+4,ge))}const Ce=d.screen.width/2+e.editor.viewX,Le=d.screen.height*.5+e.editor.viewY,Ue=T.axisFontSize,Ae=+("0x"+T.axisColor.replace("#",""));for(;N.length<64;){const ge=new cf("",{fontFamily:"monospace",fontSize:Ue,fill:Ae});ge.anchor.set(.5,.5),F.addChild(ge),N.push(ge)}let ye=0;const We=T.showAxisLabels&&T.tickEnabled;for(let ge=0;ge<=V;ge+=he){const rt=Math.round(ge/he)*he;if(rt===0||!We||rt>be)continue;const mt=N[ye++];if(!mt)break;mt.style.fontSize=Ue,mt.text=String(rt),mt.position.set(Ce+rt*pe,Le+9),mt.visible=!0;const _t=N[ye++];if(!_t)break;_t.style.fontSize=Ue,_t.text=String(-rt),_t.position.set(Ce-rt*pe,Le+9),_t.visible=!0}for(let ge=0;ge<=K;ge+=he){const rt=Math.round(ge/he)*he;if(rt===0||!We||rt>fe)continue;const mt=N[ye++];if(!mt)break;mt.style.fontSize=Ue,mt.text=String(rt),mt.position.set(Ce+8,Le-ge*pe),mt.visible=!0;const _t=N[ye++];if(!_t)break;_t.style.fontSize=Ue,_t.text=String(-rt),_t.position.set(Ce+8,Le+ge*pe),_t.visible=!0}for(;ye{e.editor.viewX=x+(pe.clientX-T),e.editor.viewY=V+(pe.clientY-p)},oe=()=>{window.removeEventListener("pointermove",K),window.removeEventListener("pointerup",oe),window.removeEventListener("pointercancel",oe)};window.addEventListener("pointermove",K),window.addEventListener("pointerup",oe),window.addEventListener("pointercancel",oe)}function de(G,T){const p=t.value.getBoundingClientRect(),x=Math.max(1e-4,e.editor.viewScale),V=G-p.left,K=T-p.top;return{x:(V-d.screen.width/2-e.editor.viewX)/x,y:-(K-d.screen.height*.5-e.editor.viewY)/x}}function De(G,T,p){const x=G.rotation*Math.PI/180,V=Math.cos(x),K=Math.sin(x),oe=Math.max(1e-4,Math.abs(G.scaleX??1)),pe=Math.max(1e-4,Math.abs(G.scaleY??1));return{x:G.x+V*T*oe-K*p*pe,y:G.y+K*T*oe+V*p*pe}}function Ie(G,T,p){const x=G.rotation*Math.PI/180,V=Math.cos(x),K=Math.sin(x),oe=Math.max(1e-4,Math.abs(G.scaleX??1)),pe=Math.max(1e-4,Math.abs(G.scaleY??1)),he=T-G.x,be=p-G.y;return{x:(V*he+K*be)/oe,y:(-K*he+V*be)/pe}}function Be(){if(e.activeObjectType!=="path")return null;const G=e.paths.find(T=>T.id===e.activeObjectId)||null;return(G==null?void 0:G.visible)===!1?null:G}function Ke(G,T,p){if(G.points.length<2)return G.points.length;const x=G.closed?G.points.length:G.points.length-1;let V=G.points.length,K=1/0;for(let oe=0;oeMath.hypot(pe.x-x.x,pe.y-x.y)<=V);if(K>=0){T.points.splice(K,1),H.clear();return}const oe=Ke(T,x.x,x.y);T.points.splice(oe,0,{x:x.x,y:x.y,inX:0,inY:0,outX:0,outY:0}),H.clear(),H.add(oe)}function wt(G){const T=Be();if(!T||!T.enabled)return!1;const p=de(G.clientX,G.clientY),x=Ie(T,p.x,p.y),V=9/Math.max(.01,e.editor.viewScale);if(G.detail>=2){if(T.points.findIndex(fe=>Math.hypot(fe.x-x.x,fe.y-x.y)<=V)>=0)return!0;const he={x:x.x,y:x.y,inX:0,inY:0,outX:0,outY:0},be=Ke(T,x.x,x.y);return T.points.splice(be,0,he),H.clear(),H.add(be),Z=!0,dt(fe=>{const Te=de(fe.clientX,fe.clientY),Ce=Ie(T,Te.x,Te.y);he.outX=Ce.x-he.x,he.outY=Ce.y-he.y,he.inX=-he.outX,he.inY=-he.outY}),!0}let K=null;for(const pe of H){const he=T.points[pe];he&&(Math.hypot(he.x+he.inX-x.x,he.y+he.inY-x.y)<=V&&(K={index:pe,side:"in"}),Math.hypot(he.x+he.outX-x.x,he.y+he.outY-x.y)<=V&&(K={index:pe,side:"out"}))}if(K){const pe=T.points[K.index],he=K.side==="in"?Math.hypot(pe.outX,pe.outY):Math.hypot(pe.inX,pe.inY);return dt(fe=>{const Te=de(fe.clientX,fe.clientY),Ce=Ie(T,Te.x,Te.y),Le=Ce.x-pe.x,Ue=Ce.y-pe.y;if(K.side==="in"?(pe.inX=Le,pe.inY=Ue):(pe.outX=Le,pe.outY=Ue),!fe.altKey){const Ae=Math.max(1e-4,Math.hypot(Le,Ue)),ye=fe.shiftKey?Ae:he;K.side==="in"?(pe.outX=-Le/Ae*ye,pe.outY=-Ue/Ae*ye):(pe.inX=-Le/Ae*ye,pe.inY=-Ue/Ae*ye)}}),!0}const oe=T.points.findIndex(pe=>Math.hypot(pe.x-x.x,pe.y-x.y)<=V);if(oe>=0){if(G.altKey)return H.delete(oe),!0;G.ctrlKey||G.metaKey?H.add(oe):H.has(oe)||(H.clear(),H.add(oe));const pe=x,he=[...H].map(fe=>({index:fe,x:T.points[fe].x,y:T.points[fe].y}));return dt(fe=>{const Te=de(fe.clientX,fe.clientY),Ce=Ie(T,Te.x,Te.y);for(const Le of he)T.points[Le.index].x=Le.x+Ce.x-pe.x,T.points[Le.index].y=Le.y+Ce.y-pe.y}),!0}if(G.altKey&&!G.ctrlKey&&!G.metaKey)return H.clear(),!0;if(G.ctrlKey||G.metaKey||G.altKey){const pe=x,he=G.altKey,be=fe=>{const Te=de(fe.clientX,fe.clientY),Ce=Ie(T,Te.x,Te.y),Le=Math.min(pe.x,Ce.x),Ue=Math.max(pe.x,Ce.x),Ae=Math.min(pe.y,Ce.y),ye=Math.max(pe.y,Ce.y);T.points.forEach((We,ge)=>{We.x>=Le&&We.x<=Ue&&We.y>=Ae&&We.y<=ye&&(he?H.delete(ge):H.add(ge))}),window.removeEventListener("pointerup",be),window.removeEventListener("pointercancel",be)};return window.addEventListener("pointerup",be),window.addEventListener("pointercancel",be),!0}return!1}function dt(G){const T=()=>{window.removeEventListener("pointermove",G),window.removeEventListener("pointerup",T),window.removeEventListener("pointercancel",T)};window.addEventListener("pointermove",G),window.addEventListener("pointerup",T),window.addEventListener("pointercancel",T)}function Mt(G){if(e.activeObjectType!=="collision")return!1;const T=e.colliders.find(ye=>ye.id===e.activeObjectId);if(!(T!=null&&T.enabled)||T.visible===!1)return!1;const p=de(G.clientX,G.clientY),x=T.rotation*Math.PI/180,V=Math.cos(x),K=Math.sin(x),oe=Math.max(1e-4,Math.abs(T.scaleX??1)),pe=Math.max(1e-4,Math.abs(T.scaleY??1)),he=p.x-T.x,be=p.y-T.y,fe=(V*he+K*be)/oe,Te=(-K*he+V*be)/pe;if(!(T.shape==="circle"?Math.hypot(fe,Te)<=T.radius:T.shape==="ellipse"?Math.hypot(fe/Math.max(1,T.radiusX),Te/Math.max(1,T.radiusY))<=1:Math.abs(fe)<=T.width*.5&&Math.abs(Te)<=T.height*.5))return!1;const Le=T.x,Ue=T.y,Ae=p;return dt(ye=>{const We=de(ye.clientX,ye.clientY);T.x=Le+We.x-Ae.x,T.y=Ue+We.y-Ae.y}),!0}function Ct(G){const T=e.systems.find(be=>be.id===e.activeId);if((T==null?void 0:T.visible)===!1)return!1;const p=T==null?void 0:T.config;if(!(p!=null&&p.forceField)||p.forceRadius<=0)return!1;const x=de(G.clientX,G.clientY);if(Math.hypot(x.x-p.forceCenterX,x.y-p.forceCenterY)>p.forceRadius)return!1;const K=p.forceCenterX,oe=p.forceCenterY;t.value&&(t.value.style.cursor="grabbing");const pe=be=>{const fe=de(be.clientX,be.clientY);p.forceCenterX=K+fe.x-x.x,p.forceCenterY=oe+fe.y-x.y},he=()=>{t.value&&(t.value.style.cursor=""),window.removeEventListener("pointermove",pe),window.removeEventListener("pointerup",he),window.removeEventListener("pointercancel",he)};return window.addEventListener("pointermove",pe),window.addEventListener("pointerup",he),window.addEventListener("pointercancel",he),G.preventDefault(),!0}function ai(G){const T=e.systems.find(fe=>fe.id===e.activeId);if((T==null?void 0:T.visible)===!1)return!1;const p=T==null?void 0:T.config;if(!(p!=null&&p.attraction))return!1;const x=de(G.clientX,G.clientY),V=Math.max(p.attractionRadius,12/Math.max(1e-4,e.editor.viewScale));if(Math.hypot(x.x-p.attractionCenterX,x.y-p.attractionCenterY)>V)return!1;const oe=p.attractionCenterX,pe=p.attractionCenterY;t.value&&(t.value.style.cursor="grabbing");const he=fe=>{const Te=de(fe.clientX,fe.clientY);p.attractionCenterX=oe+Te.x-x.x,p.attractionCenterY=pe+Te.y-x.y},be=()=>{t.value&&(t.value.style.cursor=""),window.removeEventListener("pointermove",he),window.removeEventListener("pointerup",be),window.removeEventListener("pointercancel",be)};return window.addEventListener("pointermove",he),window.addEventListener("pointerup",be),window.addEventListener("pointercancel",be),G.preventDefault(),!0}function Jt(){const G=e.activeObjectId;if(e.activeObjectType==="particle"){const x=e.systems.find(K=>K.id===G);if(!x||x.visible===!1)return null;const V=x.config;return{x:V.centerX,y:V.centerY,rotation:V.rootRotation,scaleX:V.rootScaleX??1,scaleY:V.rootScaleY??1,setPosition:(K,oe)=>{V.centerX=K,V.centerY=oe},setRotation:K=>{V.rootRotation=K},setScale:(K,oe)=>{V.rootScaleX=K,V.rootScaleY=oe}}}const p=(e.activeObjectType==="collision"?e.colliders:e.activeObjectType==="path"?e.paths:e.spines).find(x=>x.id===G);return!p||p.visible===!1?null:{x:Number(p.x)||0,y:Number(p.y)||0,rotation:Number(p.rotation)||0,scaleX:Math.max(.05,Number(p.scaleX)||1),scaleY:Math.max(.05,Number(p.scaleY)||1),setPosition:(x,V)=>{p.x=x,p.y=V},setRotation:x=>{p.rotation=x},setScale:(x,V)=>{p.scaleX=x,p.scaleY=V}}}function Zi(G){const T=Jt();if(!T)return;const p=e.editor.viewScale,x=t.value.getBoundingClientRect(),V=x.left+d.screen.width/2+e.editor.viewX+T.x*p,K=x.top+d.screen.height*.5+e.editor.viewY+-T.y*p,oe=G.clientX,pe=G.clientY,he=l.value,be=T.x,fe=T.y,Te=T.rotation,Ce=T.scaleX,Le=T.scaleY,Ue=Math.hypot(oe-V,pe-K)||1,Ae=Math.atan2(pe-K,oe-V),ye=ge=>{const rt=(ge.clientX-oe)/p,mt=(ge.clientY-pe)/p;if(he==="translate")T.setPosition(be+rt,fe-mt);else if(he==="rotate"){const _t=Math.atan2(ge.clientY-K,ge.clientX-V);T.setRotation(Te-(_t-Ae)*180/Math.PI)}else if(he==="scale"){const wi=Math.hypot(ge.clientX-V,ge.clientY-K)/Ue;T.setScale(Math.max(.05,Ce*wi),Math.max(.05,Le*wi))}},We=()=>{window.removeEventListener("pointermove",ye),window.removeEventListener("pointerup",We),window.removeEventListener("pointercancel",We)};window.addEventListener("pointermove",ye),window.addEventListener("pointerup",We),window.addEventListener("pointercancel",We)}function xs(){re(1.2)}function $t(){re(1/1.2)}function re(G){const T=Math.max(.01,e.editor.viewScale*G);e.editor.viewScale=T}function le(){e.editor.viewScale=1,e.editor.viewX=0,e.editor.viewY=0}function ft(){e.editor.viewScale=1,e.editor.viewX=0,e.editor.viewY=0}function It(){e.settings.showGrid=!e.settings.showGrid}function Pt(){if(m){for(const[G,T]of Y){const p=e.systems.find(x=>x.id===G);(!p||q.get(G)!==p.config)&&(m.removeChild(T),T.destroy({children:!0}),Y.delete(G),q.delete(G))}for(const G of e.systems){X&&!G.config.texture&&(G.config.texture=X);const T=Tr(G.config);if(U)for(const x of T.trailResources)!x.texture&&(x.previewUrl==="/images/trail.png"||x.previewUrl==="/trails/trail.png")&&(x.texture=U);if(X)for(const x of T.imageResources)!x.texture&&x.textureName==="star"&&(x.texture=X);if(Y.has(G.id))continue;const p=new yE(G.config);p.setEmitterPos(()=>({x:G.config.centerX,y:G.config.centerY})),m.addChild(p),Y.set(G.id,p),q.set(G.id,G.config)}}}function nt(){if(!M)return;const G=M;if(G.clear(),!!e.settings.showEmitter&&e.systems.length)for(const T of e.systems){if(T.visible===!1)continue;const p=ne.get(T.id),x=(p==null?void 0:p.x)??T.config.centerX??0,V=-((p==null?void 0:p.y)??T.config.centerY??0),K=e.activeObjectType==="particle"&&T.id===e.activeId,oe=K?16763955:9082040,pe=K?.4:.2;G.lineStyle(1,oe,pe),G.drawCircle(x,V,10),G.beginFill(oe,K?.8:.4),G.drawCircle(x,V,3),G.endFill(),G.lineStyle(1,oe,K?.3:.15),G.moveTo(x-16,V),G.lineTo(x+16,V),G.moveTo(x,V-16),G.lineTo(x,V+16)}}function $i(){var p;if(!v)return;const G=v;(p=G.parent)==null||p.addChild(G),G.clear();const T=new Map;for(const x of e.spines)x.visible===!1||!x.selectedBone||x.status!=="ready"||T.set(`${x.id}:${x.selectedBone}`,{spineId:x.id,boneName:x.selectedBone});for(const x of e.systems){if(x.visible===!1)continue;const V=x.config;if(!V.emitterFollow||V.emitterFollowMode!=="bone"||!V.emitterFollowSpineId||!V.emitterFollowBoneName)continue;const K=e.spines.find(oe=>oe.id===V.emitterFollowSpineId);!K||K.visible===!1||T.set(`${V.emitterFollowSpineId}:${V.emitterFollowBoneName}`,{spineId:V.emitterFollowSpineId,boneName:V.emitterFollowBoneName})}for(const x of T.values()){const V=D==null?void 0:D.getBoneWorldTransform(x.spineId,x.boneName);if(!V)continue;const K=V.x,oe=-V.y;G.lineStyle(2,12881151,.95),G.beginFill(12881151,.2),G.drawCircle(K,oe,8),G.endFill(),G.beginFill(15919103,1),G.drawCircle(K,oe,3.5),G.endFill()}}function Ji(){if(!y)return;const G=y;if(G.clear(),!e.settings.showEmitter)return;const T=e.systems.find(Ae=>Ae.id===e.activeId);if(!T||T.visible===!1)return;const p=T.config,x=ne.get(T.id),V=(x==null?void 0:x.x)??p.centerX??0,K=-((x==null?void 0:x.y)??p.centerY??0),oe=p.shape;if(oe==="point"||oe==="orbit")return;const pe=p.rootScaleX??1,he=p.rootScaleY??1,be=-((x==null?void 0:x.rotation)??p.rootRotation??0)*Math.PI/180,fe=Math.cos(be),Te=Math.sin(be),Ce=p.offsetX??0,Le=p.offsetY??0,Ue=(Ae,ye)=>{const We=Ae+Ce,ge=-ye-Le,rt=We*pe,mt=ge*he;return[V+rt*fe-mt*Te,K+(rt*Te+mt*fe)]};if(oe==="circle"){G.lineStyle(2,3991658,.7);const Ae=48;for(let ye=0;ye<=Ae;ye++){const We=ye/Ae*Math.PI*2,[ge,rt]=Ue(Math.cos(We)*p.radius,Math.sin(We)*p.radius);ye===0?G.moveTo(ge,rt):G.lineTo(ge,rt)}}else if(oe==="rect"){const Ae=p.rectW/2,ye=p.rectH/2,We=Ue(-Ae,-ye),ge=Ue(Ae,-ye),rt=Ue(Ae,ye),mt=Ue(-Ae,ye);G.lineStyle(2,4885759,.7),G.moveTo(We[0],We[1]),G.lineTo(ge[0],ge[1]),G.lineTo(rt[0],rt[1]),G.lineTo(mt[0],mt[1]),G.lineTo(We[0],We[1])}else if(oe==="cone"){const Ae=p.radius,ye=p.coneAngle/2*Math.PI/180,We=p.direction*Math.PI/180,ge=Ue(Math.cos(We-ye)*Ae,Math.sin(We-ye)*Ae),rt=Ue(Math.cos(We+ye)*Ae,Math.sin(We+ye)*Ae);G.lineStyle(2,3991658,.7),G.moveTo(V,K),G.lineTo(ge[0],ge[1]),G.moveTo(V,K),G.lineTo(rt[0],rt[1]),G.lineStyle(1,3991658,.5);const mt=24;for(let _t=0;_t<=mt;_t++){const wi=We-ye+2*ye*_t/mt,[Mo,Qs]=Ue(Math.cos(wi)*Ae,Math.sin(wi)*Ae);_t===0?G.moveTo(Mo,Qs):G.lineTo(Mo,Qs)}}}function li(){if(!I)return;const G=I;G.clear();const T=e.systems.find(oe=>oe.id===e.activeId);if((T==null?void 0:T.visible)===!1)return;const p=T==null?void 0:T.config;if(!(p!=null&&p.forceField)||p.forceRadius<=0)return;const x=p.forceCenterX,V=-p.forceCenterY,K=p.forceStrength>=0?5818367:16739194;G.lineStyle(2,K,.85),G.beginFill(K,.08),G.drawCircle(x,V,p.forceRadius),G.endFill(),G.lineStyle(1,K,.7),G.moveTo(x-9,V),G.lineTo(x+9,V),G.moveTo(x,V-9),G.lineTo(x,V+9),G.beginFill(K,.95),G.drawCircle(x,V,4),G.endFill()}function Gi(){if(!E)return;const G=E;G.clear();const T=e.systems.find(pe=>pe.id===e.activeId);if((T==null?void 0:T.visible)===!1)return;const p=T==null?void 0:T.config;if(!(p!=null&&p.attraction))return;const x=p.attractionCenterX,V=-p.attractionCenterY,K=Math.max(0,p.attractionRadius),oe=16731487;K>0&&(G.lineStyle(2,oe,.95),G.beginFill(oe,.09),G.drawCircle(x,V,K),G.endFill()),G.lineStyle(1,oe,.85),G.moveTo(x-10,V),G.lineTo(x+10,V),G.moveTo(x,V-10),G.lineTo(x,V+10),G.beginFill(oe,1),G.drawCircle(x,V,K>0?4:6),G.endFill()}function er(){if(!B)return;const G=B;if(G.clear(),!l.value)return;const T=Jt();if(!T)return;const p=T.x,x=-T.y,V=T.scaleX,K=T.scaleY,oe=-T.rotation*Math.PI/180,pe=Math.cos(oe),he=Math.sin(oe),be=(Ce,Le)=>{const Ue=Ce*V,Ae=-Le*K;return[p+Ue*pe-Ae*he,x+(Ue*he+Ae*pe)]},fe=(Ce,Le,Ue,Ae)=>{const ye=be(Ce,Le),We=be(Ue,Ae);G.moveTo(ye[0],ye[1]),G.lineTo(We[0],We[1])},Te=26;if(G.lineStyle(2,3526911,.9),G.beginFill(3526911,.25),G.drawCircle(p,x,6),G.endFill(),l.value==="translate")G.lineStyle(2,3526911,.9),fe(-Te,0,Te,0),fe(0,-Te,0,Te),fe(Te-6,-4,Te,0),fe(Te,0,Te-6,4),fe(-20,-4,-Te,0),fe(-Te,0,-20,4),fe(-4,Te-6,0,Te),fe(0,Te,4,Te-6),fe(-4,-20,0,-Te),fe(0,-Te,4,-20);else if(l.value==="rotate"){G.lineStyle(2,3526911,.8);const Ce=48;for(let Ae=0;Ae<=Ce;Ae++){const ye=Ae/Ce*Math.PI*2,[We,ge]=be(Math.cos(ye)*Te,Math.sin(ye)*Te);Ae===0?G.moveTo(We,ge):G.lineTo(We,ge)}const[Le,Ue]=be(0,Te);G.beginFill(3526911,.95),G.drawCircle(Le,Ue,4),G.endFill()}else if(l.value==="scale"){G.lineStyle(2,3526911,.9);const Le=[[-Te,-Te],[Te,-Te],[Te,Te],[-Te,Te]].map(([Ue,Ae])=>be(Ue,Ae));G.moveTo(Le[0][0],Le[0][1]),G.lineTo(Le[1][0],Le[1][1]),G.lineTo(Le[2][0],Le[2][1]),G.lineTo(Le[3][0],Le[3][1]),G.lineTo(Le[0][0],Le[0][1]),G.beginFill(3526911,.9);for(const Ue of Le)G.drawRect(Ue[0]-3,Ue[1]-3,6,6);G.endFill()}}function Oi(G,T){var p;G.push({boneName:T.boneName,x:T.x,y:T.y,rotation:-T.rotation}),(p=T.trailState)!=null&&p.bones.length&&T.trailState.bones.forEach(x=>{G.push({boneName:x.boneName,x:x.x,y:x.y,rotation:x.rotation,parentX:0,parentY:0,trail:!0})})}function Qt(G){return G.map(T=>({...T,trailState:T.trailState?{...T.trailState,bones:T.trailState.bones.map(p=>({...p}))}:void 0}))}function Pr(G){const T=new Map;for(const x of G)for(const V of x)T.has(V.boneName)||T.set(V.boneName,Qt([V])[0]);const p=[...T.keys()].sort((x,V)=>{const K=Number(x.replace(/^p_/,"")),oe=Number(V.replace(/^p_/,""));return Number.isFinite(K)&&Number.isFinite(oe)?K-oe:x.localeCompare(V)});for(let x=0;x[K.boneName,K]));G[x]=p.map(K=>{const oe=V.get(K);return oe||{...Qt([T.get(K)])[0],alpha:0,imageVisible:!1,trailState:void 0,active:!0}})}}function kr(G,T,p,x){var Le;const V=G.config,K=1/Math.max(1,p),oe=V.lifeMode==="fixed"?Math.max(0,Number(V.lifeMin)||0):Math.max(0,Number(V.lifeMin)||0,Number(V.lifeMax)||0),pe=Math.max(1,Math.ceil(Number(V.loopDurationFrames)||1)),he=Math.max(1,Math.ceil(oe*p)),be=Math.max(1,Math.ceil(he/pe)),fe=Math.max(0,Math.ceil(Math.max(0,Number(V.delay)||0)*p)),Te=[];if(T.reset(),V.generateLoopStartAnimation){for(let Ue=0;Ue0&&T.restartEmissionCycle();for(let Ae=0;Ae0&&T.restartEmissionCycle();for(let ye=0;ye0;ye++)T.update(K,"off"),Te.push(T.capture());(Le=Te[Te.length-1])!=null&&Le.length&&Te.push([])}else{T.restartEmissionCycle();for(let Ae=0;Aex&&(Te.length=x);Te.length({x:T.x+K*Ce*pe-oe*Le*he,y:-(T.y+oe*Ce*pe+K*Le*he)});let fe=[];if(T.shape==="circle"||T.shape==="ellipse"){const Ce=T.shape==="circle"?T.radius:T.radiusX,Le=T.shape==="circle"?T.radius:T.radiusY;fe=Array.from({length:49},(Ue,Ae)=>{const ye=Ae/48*Math.PI*2;return be(Math.cos(ye)*Ce,Math.sin(ye)*Le)})}else if(T.shape==="rect"){const Ce=T.width*.5,Le=T.height*.5;fe=[be(-Ce,-Le),be(Ce,-Le),be(Ce,Le),be(-Ce,Le),be(-Ce,-Le)]}else{const Ce=Math.max(3,Math.min(16,Math.round(T.sides)));fe=Array.from({length:Ce+1},(Le,Ue)=>{const Ae=Math.PI*.5+Ue%Ce/Ce*Math.PI*2;return be(Math.cos(Ae)*T.width*.5,Math.sin(Ae)*T.height*.5)})}if(!fe.length)continue;G.lineStyle(p?2.5:1.5,x,T.enabled?.95:.45),G.beginFill(x,p?.12:.055),G.moveTo(fe[0].x,fe[0].y);for(let Ce=1;Ce{const fe=De(T,he,be);return{x:fe.x,y:-fe.y}},K=T.points[0],oe=V(K.x,K.y);G.lineStyle(p?2.5:1.8,x,p?1:.75),G.moveTo(oe.x,oe.y);const pe=T.closed?T.points.length:T.points.length-1;for(let he=0;he{const fe=V(he.x,he.y),Te=V(he.x+he.inX,he.y+he.inY),Ce=V(he.x+he.outX,he.y+he.outY),Le=Math.hypot(he.inX,he.inY)>.01,Ue=Math.hypot(he.outX,he.outY)>.01;G.lineStyle(1,11121867,.65),Le&&(G.moveTo(fe.x,fe.y),G.lineTo(Te.x,Te.y)),Ue&&(G.moveTo(fe.x,fe.y),G.lineTo(Ce.x,Ce.y)),Le&&(G.beginFill(14015724,.95),G.drawCircle(Te.x,Te.y,3),G.endFill()),Ue&&(G.beginFill(14015724,.95),G.drawCircle(Ce.x,Ce.y,3),G.endFill()),G.beginFill(H.has(be)?16777215:x,1),G.lineStyle(1.5,H.has(be)?6126847:16777215,.95),G.drawCircle(fe.x,fe.y,H.has(be)?5:4),G.endFill()})}}function An(G,T,p="linear"){if(!G.length)return T;const x=[...G].sort((V,K)=>V.x-K.x);if(T<=x[0].x)return x[0].y;for(let V=1;V0&&We===0)continue;const ge=We/20,rt=bs(Ae.x,Ae.x+Ae.outX,ye.x+ye.inX,ye.x,ge),mt=bs(Ae.y,Ae.y+Ae.outY,ye.y+ye.inY,ye.y,ge),_t=De(G,rt,mt),wi=x[x.length-1];wi&&(V+=Math.hypot(_t.x-wi.x,_t.y-wi.y)),x.push({..._t,distance:V})}}const K=Math.min(1,Math.max(0,T))*V;let oe=x.findIndex(Ue=>Ue.distance>=K);oe<0&&(oe=x.length-1);const pe=x[oe],he=x[Math.max(0,oe-1)],be=x[Math.min(x.length-1,oe+1)],fe=he.distance,Te=oe>0?(K-fe)/Math.max(1e-4,pe.distance-fe):0,Ce=he.x+(pe.x-he.x)*Math.min(1,Math.max(0,Te)),Le=he.y+(pe.y-he.y)*Math.min(1,Math.max(0,Te));return{x:Ce,y:Le,angle:Math.atan2(be.y-he.y,be.x-he.x)*180/Math.PI}}function Qi(G){z=e.colliders.map(T=>{if(!T.followPath||!T.followPathId)return T;const p=e.paths.find(be=>be.id===T.followPathId&&be.enabled);if(!(p!=null&&p.points.length))return T;const x=Math.max(.05,Number(T.followDuration)||2),V=Math.min(1,Math.max(0,G/x)),K=Array.isArray(T.followCurve)?T.followCurve:[{x:0,y:0},{x:1,y:1}],oe=T.followCurveMode==="跟随导出"?e.settings.exportSettings.keyframeCurve==="bezier"?"bezier":"linear":T.followCurveMode==="贝塞尔"?"bezier":"linear",pe=Math.min(1,Math.max(0,An(K,V,oe))),he=Bi(p,pe);return he?{...T,x:he.x,y:he.y,rotation:T.rotation+(T.followPathRotation?he.angle:0)}:T})}function ws(G,T,p,x=Math.max(1e-4,Math.abs(G.rootScaleX)),V=Math.max(1e-4,Math.abs(G.rootScaleY))){const K=-G.rootRotation*Math.PI/180,oe=Math.cos(K),pe=Math.sin(K),he=T-G.centerX,be=-p+G.centerY;return{x:(oe*he+pe*be)/x,y:(-pe*he+oe*be)/V}}function tr(){var p,x,V;P=requestAnimationFrame(tr);const G=performance.now()/1e3;let T=G-j;if(j=G,T>.1&&(T=.1),d&&m){m.scale.set(e.editor.viewScale),m.position.set(d.screen.width/2+e.editor.viewX,d.screen.height*.5+e.editor.viewY),g&&(g.position.set(Number(e.settings.backgroundX)||0,-(Number(e.settings.backgroundY)||0)),g.alpha=Math.min(1,Math.max(0,Number(e.settings.backgroundOpacity)||0))),Se(),Pt();const K=Math.max(1,e.timeline.fps),oe=e.timeline.frame,pe=oe/K;D==null||D.sync(e.spines,oe,K),Qi(pe);for(const Ae of e.systems){const ye=Y.get(Ae.id);if(!ye)continue;ye.setFollowExportCurveMode(e.settings.exportSettings.keyframeCurve==="bezier"?"贝塞尔":"线性");const We=Ae.visible!==!1;ye.visible=We,ye.renderable=We;const ge=Ae.config;ye.scale.set(ge.rootScaleX,ge.rootScaleY),ye.setColliders(z),ye.setEmitterFollowSpawn(0,0,0);let rt={x:ge.centerX,y:ge.centerY,rotation:ge.rootRotation};const mt=ge.emitterFollow&&ge.emitterFollowMode==="bone"?e.spines.find(es=>es.id===ge.emitterFollowSpineId&&es.enabled&&es.status==="ready"):null,_t=mt&&(D==null?void 0:D.getBoneWorldTransform(mt.id,ge.emitterFollowBoneName))||null,wi=ge.emitterFollow&&ge.emitterFollowMode==="path"?e.paths.find(es=>es.id===ge.emitterFollowPathId&&es.enabled):null,Mo=Math.max(.05,ge.emitterFollowDuration),Qs=Math.min(1,Math.max(0,pe/Mo)),vf=Math.min(1,Math.max(0,An(ge.emitterFollowCurve,Qs))),Xh=Math.min(1,Math.max(0,ge.emitterFollowOffset)),_x=ge.emitterFollowDirection==="reverse"?(1-Xh)*(1-vf):Xh+(1-Xh)*vf,_s=wi?Bi(wi,_x):null;if(_t){const es=ge.emitterFollowBoneOffsetX,Eo=ge.emitterFollowBoneOffsetY,ir=_t.x+es,Fr=_t.y+Eo,Ca=ge.rootRotation+ge.emitterFollowBoneRotation,Ao=Math.max(1e-4,Math.abs(ge.rootScaleX*ge.emitterFollowBoneScaleX)),Co=Math.max(1e-4,Math.abs(ge.rootScaleY*ge.emitterFollowBoneScaleY));if(rt={x:ir,y:Fr,rotation:Ca},ge.emitterFollowSpace==="local")ye.position.set(ir,-Fr),ye.rotation=-Ca*Math.PI/180,ye.scale.set(Ao,Co),ye.setSimulationTransform(ir,Fr,Ca,Ao,Co);else{ye.position.set(ge.centerX,-ge.centerY),ye.rotation=-ge.rootRotation*Math.PI/180,ye.scale.set(Ao,Co),ye.setSimulationTransform(ge.centerX,ge.centerY,ge.rootRotation,Ao,Co);const yf=ws(ge,ir,Fr,Ao,Co),Sx=-(Ca-ge.rootRotation);ye.setEmitterFollowSpawn(yf.x,yf.y,Sx)}}else if(_s){const es=_s.angle+(ge.emitterFollowDirection==="reverse"?180:0),Eo=ge.emitterAngleMode==="direction"?es:ge.rootRotation;if(rt={x:_s.x,y:_s.y,rotation:Eo},ge.emitterFollowSpace==="local")ye.position.set(_s.x,-_s.y),ye.rotation=-Eo*Math.PI/180,ye.setSimulationTransform(_s.x,_s.y,Eo);else{ye.position.set(ge.centerX,-ge.centerY),ye.rotation=-ge.rootRotation*Math.PI/180,ye.setSimulationTransform(ge.centerX,ge.centerY,ge.rootRotation);const ir=ws(ge,_s.x,_s.y),Fr=ge.emitterAngleMode==="direction"?-(es-ge.rootRotation):0;ye.setEmitterFollowSpawn(ir.x,ir.y,Fr)}}else ye.position.set(ge.centerX,-ge.centerY),ye.rotation=-ge.rootRotation*Math.PI/180,ye.setSimulationTransform(ge.centerX,ge.centerY,ge.rootRotation);ne.set(Ae.id,rt)}let he=0;const be=[],fe=e.timeline,Te=fe.fps,Ce=1/Math.max(1,Te);let Le=L,Ue=0;if(fe.playing?(O+=T,Ue=Math.floor(O/Ce),Ue>0&&(O-=Ue*Ce)):O=0,fe.playing&&Ue>0)for(let Ae=0;Ae=fe.totalFrames)if(fe.loop)fe.frame=0;else{fe.frame=fe.totalFrames-1,fe.playing=!1;break}}else{if(fe.frame===0)for(const ye of e.systems){const We=Y.get(ye.id);We&&(ye.config.mode==="stream"&&ye.config.streamBehavior==="loop"?kr(ye,We,Te,fe.totalFrames):We.reset())}for(const[ye,We]of Y){const ge=e.systems.find(Qs=>Qs.id===ye),rt=(ge==null?void 0:ge.config.mode)==="stream"&&ge.config.streamBehavior==="loop",mt=rt?(p=ge.frames)==null?void 0:p[fe.frame]:void 0,_t=fe.frame===0&&!rt,wi=_t?[]:mt||We.update(Ce);if(_t?We.apply([]):mt&&We.apply(mt),(ge==null?void 0:ge.visible)!==!1)for(const Qs of wi)Qs.active&&Oi(be,Qs);he+=wi.length}for(const ye of e.systems){if(!ye.config.texture)continue;ye.frames=ye.frames||[];const We=Y.get(ye.id);We&&!(ye.config.mode==="stream"&&ye.config.streamBehavior==="loop")&&(ye.frames[fe.frame]=We.capture())}fe.frame++,fe.frame>=fe.totalFrames&&(fe.frame=0,fe.recorded=!0)}else{fe.playing||(Le=fe.frame);for(const Ae of e.systems){const ye=Y.get(Ae.id),We=fe.playing?L:fe.frame,ge=(V=Ae.frames)==null?void 0:V[We],rt=Ae.config.mode==="stream"&&Ae.config.streamBehavior==="loop"&&!!ge;if((fe.recorded||rt)&&ye&&ge){ye.apply(ge);for(const mt of ge)mt.active&&(Ae.visible!==!1&&Oi(be,mt),he++)}else if(ye){const mt=fe.frame===0?[]:ye.update(0);if(fe.frame===0&&ye.apply([]),Ae.visible!==!1)for(const _t of mt)_t.active&&Oi(be,_t);he+=ye.activeCount}}}L=Le,D==null||D.sync(e.spines,Le,Te);for(const[,Ae]of Y)Ae.drawTrailMeshDebug(e.settings.showSkinMesh);En(),Js(),$i(),nt(),Ji(),li(),Gi(),er(),Mn(be),s.value&&(s.value.systems=e.systems.length,s.value.particles=he)}}return _o(async()=>{window.addEventListener("keydown",ve);const G=t.value;d=new jv({width:G.clientWidth||800,height:G.clientHeight||600,backgroundAlpha:0,antialias:!0}),G.appendChild(d.view),me(),cs(()=>e.settings.backgroundImageData,Q,{immediate:!0}),await ae();const T=X;for(const p of e.systems){p.config.texture=T;const x=Tr(p.config);if(U)for(const V of x.trailResources)!V.texture&&(V.previewUrl==="/images/trail.png"||V.previewUrl==="/trails/trail.png")&&(V.texture=U);for(const V of x.imageResources)!V.texture&&V.textureName==="star"&&(V.texture=T)}s.value={systems:e.systems.length,particles:0},e.timeline.recorded=!1,e.timeline.frame=0,O=0,L=0,e.timeline.playing=!0,e.timeline.loop=!0;for(const p of e.systems)p.frames=[];e.recalcTotalFrames(),j=performance.now()/1e3,tr(),cs(()=>e.systems.map(p=>JSON.stringify(p.config,(x,V)=>x==="texture"||x==="trailTexture"||x==="previewUrl"?void 0:V)).join("|")+`|colliders:${JSON.stringify(e.colliders)}|paths:${JSON.stringify(e.paths)}`,()=>{e.recalcTotalFrames(),e.timeline.recorded=!1,e.timeline.frame=0;for(const p of e.systems)p.frames=[];e.timeline.playing=!0,e.timeline.loop=!0}),uC(e)}),wa(()=>{window.removeEventListener("keydown",ve),cancelAnimationFrame(P),D==null||D.destroy(),D=null,_++,b&&b.destroy(!0),b=null,g=null,d&&(d.destroy(!0,{children:!0}),d=null)}),(G,T)=>(se(),ce("div",mC,[w("div",{ref_key:"holder",ref:t,class:Ze(["stage-holder",{grid:Pe(e).settings.showGrid}]),tabindex:"0",onWheel:xt(Me,["prevent"]),onPointerdown:Ee,onDblclick:xt(ct,["prevent"])},null,34),w("div",gC,[w("button",{class:"settings-btn",onClick:$,title:"系统设置"},"系统设置"),w("button",{class:"undo-btn",disabled:Pe(Vh).undoCount===0,onClick:T[0]||(T[0]=(...p)=>Pe(Cu)&&Pe(Cu)(...p)),title:"撤回上一步 (Ctrl+Z)"},"↶",8,vC),w("div",yC,[w("button",{class:Ze(["tool-btn",{on:l.value===""}]),onClick:T[1]||(T[1]=p=>u("")),title:"拖动画布 (Q)"},"✋",2),w("button",{class:Ze(["tool-btn",{on:l.value==="translate"}]),onClick:T[2]||(T[2]=p=>u("translate")),title:"位移 (W)"},"✥",2),w("button",{class:Ze(["tool-btn",{on:l.value==="rotate"}]),onClick:T[3]||(T[3]=p=>u("rotate")),title:"旋转 (E)"},"⟳",2),w("button",{class:Ze(["tool-btn",{on:l.value==="scale"}]),onClick:T[4]||(T[4]=p=>u("scale")),title:"缩放 (R)"},"⤢",2)]),w("div",xC,[w("button",{class:"tool-btn",onClick:xs,title:"放大"},"+"),w("button",{class:"tool-btn",onClick:$t,title:"缩小"},"-"),w("button",{class:"tool-btn",onClick:le,title:"适配画布"},"⤢"),w("button",{class:Ze(["tool-btn",{on:Pe(e).settings.showGrid}]),onClick:It,title:"切换网格"},"▦",2),w("button",{class:"tool-btn",onClick:ft,title:"重置视图"},"⟳")]),w("div",{class:"background-menu",onClick:T[10]||(T[10]=xt(()=>{},["stop"]))},[w("button",{class:Ze(["background-btn",{on:r.value}]),title:"背景图显示设置",onClick:_e},"背景图",2),r.value?(se(),ce("div",bC,[w("button",{class:"background-upload",onClick:T[5]||(T[5]=p=>{var x;return(x=a.value)==null?void 0:x.click()})},Ye(h.value?"更换图像":"上传图像"),1),w("button",{class:"background-clear",disabled:!h.value,onClick:T[6]||(T[6]=p=>ie())},"清除背景",8,wC),w("input",{ref_key:"backgroundFileInput",ref:a,class:"background-file-input",type:"file",accept:"image/png,image/jpeg,image/webp",onChange:J},null,544),w("div",{class:"background-file-name",title:h.value},Ye(h.value||"未上传图像"),9,_C),w("div",SC,[w("label",null,[T[28]||(T[28]=w("span",null,"X",-1)),xe(w("input",{"onUpdate:modelValue":T[7]||(T[7]=p=>Pe(e).settings.backgroundX=p),type:"number",step:"1","aria-label":"背景图 X 偏移"},null,512),[[Je,Pe(e).settings.backgroundX,void 0,{number:!0}]])]),w("label",null,[T[29]||(T[29]=w("span",null,"Y",-1)),xe(w("input",{"onUpdate:modelValue":T[8]||(T[8]=p=>Pe(e).settings.backgroundY=p),type:"number",step:"1","aria-label":"背景图 Y 偏移"},null,512),[[Je,Pe(e).settings.backgroundY,void 0,{number:!0}]])])]),w("label",TC,[T[30]||(T[30]=w("span",null,"透明度",-1)),xe(w("input",{"onUpdate:modelValue":T[9]||(T[9]=p=>Pe(e).settings.backgroundOpacity=p),type:"range",min:"0",max:"1",step:"0.01","aria-label":"背景图透明度"},null,512),[[Je,Pe(e).settings.backgroundOpacity,void 0,{number:!0}]]),w("b",null,Ye(Math.round(Pe(e).settings.backgroundOpacity*100))+"%",1)])])):$e("",!0)]),w("button",{class:Ze(["help-btn",{on:o.value}]),title:"查看使用说明",onClick:te},"使用说明",2),w("span",MC,Ye(Math.round(Pe(e).editor.viewScale*100))+"%",1)]),n.value?(se(),ce("div",EC,[w("div",AC,[T[31]||(T[31]=Yt("系统设置 ",-1)),w("button",{class:"sp-close",onClick:T[11]||(T[11]=p=>n.value=!1)},"✕")]),T[45]||(T[45]=w("div",{class:"sp-section-title"},"界面布局",-1)),w("label",CC,[T[33]||(T[33]=w("span",null,"参数面板位置",-1)),w("span",IC,[xe(w("input",{type:"checkbox","onUpdate:modelValue":T[12]||(T[12]=p=>Pe(e).settings.parameterPanelOnRight=p),"aria-label":"参数面板显示在右侧"},null,512),[[Lt,Pe(e).settings.parameterPanelOnRight]]),T[32]||(T[32]=w("span",{class:"sp-switch-ui","aria-hidden":"true"},null,-1)),w("b",null,Ye(Pe(e).settings.parameterPanelOnRight?"右侧":"左侧"),1)])]),T[46]||(T[46]=w("div",{class:"sp-divider"},null,-1)),T[47]||(T[47]=w("div",{class:"sp-section-title"},"操作历史",-1)),w("label",RC,[T[34]||(T[34]=w("span",null,"最大撤回步数",-1)),xe(w("input",{class:"sp-num sp-undo-limit",type:"number",min:"1",max:"200","onUpdate:modelValue":T[13]||(T[13]=p=>Pe(e).settings.undoLimit=p),"aria-label":"最大撤回步数",onChange:W},null,544),[[Je,Pe(e).settings.undoLimit,void 0,{number:!0}]])]),T[48]||(T[48]=w("div",{class:"sp-divider"},null,-1)),T[49]||(T[49]=w("div",{class:"sp-section-title"},"画布辅助显示",-1)),w("label",PC,[xe(w("input",{type:"checkbox","onUpdate:modelValue":T[14]||(T[14]=p=>Pe(e).settings.showEmitter=p)},null,512),[[Lt,Pe(e).settings.showEmitter]]),T[35]||(T[35]=Yt("发射点",-1))]),w("label",kC,[xe(w("input",{type:"checkbox","onUpdate:modelValue":T[15]||(T[15]=p=>Pe(e).settings.showBones=p)},null,512),[[Lt,Pe(e).settings.showBones]]),T[36]||(T[36]=Yt("骨骼连线",-1))]),Pe(e).settings.showBones?(se(),ce(qe,{key:0},[w("label",FC,[T[37]||(T[37]=w("span",null,"骨骼点绘制大小",-1)),xe(w("input",{class:"sp-num",type:"number",min:"0.1",max:"10",step:"0.1","onUpdate:modelValue":T[16]||(T[16]=p=>Pe(e).settings.bonePointDrawSize=p),"aria-label":"骨骼点绘制大小",onChange:f},null,544),[[Je,Pe(e).settings.bonePointDrawSize,void 0,{number:!0}]])]),w("label",OC,[T[38]||(T[38]=w("span",null,"坐标轴绘制大小",-1)),xe(w("input",{class:"sp-num",type:"number",min:"0.1",max:"10",step:"0.1","onUpdate:modelValue":T[17]||(T[17]=p=>Pe(e).settings.boneAxisDrawSize=p),"aria-label":"坐标轴绘制大小",onChange:f},null,544),[[Je,Pe(e).settings.boneAxisDrawSize,void 0,{number:!0}]])])],64)):$e("",!0),w("label",BC,[xe(w("input",{type:"checkbox","onUpdate:modelValue":T[18]||(T[18]=p=>Pe(e).settings.showSkinMesh=p)},null,512),[[Lt,Pe(e).settings.showSkinMesh]]),T[39]||(T[39]=Yt("蒙皮网格",-1))]),T[50]||(T[50]=w("div",{class:"sp-divider"},null,-1)),w("label",LC,[xe(w("input",{type:"checkbox","onUpdate:modelValue":T[19]||(T[19]=p=>Pe(e).settings.tickEnabled=p)},null,512),[[Lt,Pe(e).settings.tickEnabled]]),T[40]||(T[40]=Yt("启用刻度",-1))]),Pe(e).settings.tickEnabled?(se(),ce(qe,{key:1},[w("label",DC,[T[41]||(T[41]=w("span",null,"刻度文字大小",-1)),xe(w("input",{type:"range",min:"8",max:"40",step:"1","onUpdate:modelValue":T[20]||(T[20]=p=>Pe(e).settings.axisFontSize=p)},null,512),[[Je,Pe(e).settings.axisFontSize,void 0,{number:!0}]]),xe(w("input",{type:"number",min:"8",max:"40","onUpdate:modelValue":T[21]||(T[21]=p=>Pe(e).settings.axisFontSize=p),class:"sp-num"},null,512),[[Je,Pe(e).settings.axisFontSize,void 0,{number:!0}]])]),w("label",NC,[T[42]||(T[42]=w("span",null,"刻度线粗细",-1)),xe(w("input",{type:"range",min:"1",max:"5",step:"0.5","onUpdate:modelValue":T[22]||(T[22]=p=>Pe(e).settings.tickWidth=p)},null,512),[[Je,Pe(e).settings.tickWidth,void 0,{number:!0}]]),xe(w("input",{type:"number",min:"1",max:"5","onUpdate:modelValue":T[23]||(T[23]=p=>Pe(e).settings.tickWidth=p),class:"sp-num"},null,512),[[Je,Pe(e).settings.tickWidth,void 0,{number:!0}]])]),w("label",UC,[T[43]||(T[43]=w("span",null,"坐标轴颜色",-1)),xe(w("input",{type:"color","onUpdate:modelValue":T[24]||(T[24]=p=>Pe(e).settings.axisColor=p),class:"sp-colr"},null,512),[[Je,Pe(e).settings.axisColor]]),w("span",VC,Ye(Pe(e).settings.axisColor),1)]),w("label",XC,[xe(w("input",{type:"checkbox","onUpdate:modelValue":T[25]||(T[25]=p=>Pe(e).settings.showAxisLabels=p)},null,512),[[Lt,Pe(e).settings.showAxisLabels]]),T[44]||(T[44]=Yt("显示刻度数值",-1))])],64)):$e("",!0),T[51]||(T[51]=w("div",{class:"sp-cache-note"},"整个系统设置会自动保存到当前浏览器",-1))])):$e("",!0),o.value?(se(),ce("div",{key:1,class:"help-overlay",role:"presentation",onClick:T[27]||(T[27]=xt(p=>o.value=!1,["self"]))},[w("section",YC,[w("header",$C,[T[52]||(T[52]=w("div",null,[w("h2",{id:"help-title"},"使用说明"),w("p",null,"从创建粒子到保存、导出的快速入门")],-1)),w("button",{class:"help-close","aria-label":"关闭使用说明",title:"关闭 (Esc)",onClick:T[26]||(T[26]=p=>o.value=!1)},"✕")]),T[53]||(T[53]=Vo('

快速开始

  1. 创建对象:在左侧“场景对象”中添加粒子、碰撞、路径或 Spine。
  2. 编辑粒子:选中粒子系统,依次调整发射、形状、属性、外观资源和修改器。
  3. 查看效果:使用底部时间轴播放、暂停或拖动到指定帧;修改参数后会自动重新计算。
  4. 保存成果:配置文件用于继续编辑;“导出 Spine Json”支持 Spine 3.8、4.0、4.1 和 4.2。

常用功能

小眼睛
单独显示或隐藏场景对象;隐藏的粒子系统不会导出。
+Copy
完整复制当前选中对象,方便对比不同参数效果。
背景图
上传参考图并调整位置和透明度,只用于画布预览。
系统设置
管理界面与辅助显示,并自动保存在当前浏览器中。
配置管理
保存当前项目数据、加载配置,或直接使用预设文件;不包含系统设置。
Spine 骨骼
在层级树搜索并选择骨骼,可用于粒子发射器跟随。

快捷键

Ctrl/⌘+Z撤回上一步
Ctrl/⌘+S保存配置
Q拖动画布
W位移工具
E旋转工具
R缩放工具
D播放 / 暂停
S回到第一帧

Q / W / E / R 需要先点击画布。光标位于输入框时,单键快捷键不会触发。

配置与导出有什么区别?

保存配置会保存编辑器中的全部对象和参数,之后可以继续修改;导出 Spine Json只导出显示中的粒子系统,并把跟随、碰撞和拖尾结果烘焙为独立动画数据。

',1))])])):$e("",!0),s.value?(se(),ce("div",GC,[T[54]||(T[54]=Yt(" 系统: ",-1)),w("b",jC,Ye(s.value.systems),1),T[55]||(T[55]=Yt(" · 粒子(骨骼): ",-1)),w("b",HC,Ye(s.value.particles),1),T[56]||(T[56]=Yt(" · 根骨骼: ",-1)),T[57]||(T[57]=w("b",null,"root",-1)),T[58]||(T[58]=w("span",{class:"hud-tip"},"滚轮缩放 · 左键拖动画布",-1))])):$e("",!0)]))}}),Ks=(i,e)=>{const t=i.__vccOpts||i;for(const[s,n]of e)t[s]=n;return t},zC=Ks(WC,[["__scopeId","data-v-646aa9bd"]]),qC={class:"ns-label"},KC=["min","max","step","value","disabled"],ZC=["min","max","step","value","disabled"],JC=Ws({__name:"NumSlider",props:{label:{},modelValue:{},min:{},max:{},step:{},disabled:{type:Boolean}},emits:["update:modelValue"],setup(i,{emit:e}){const t=i,s=e,n=it(String(t.modelValue));cs(()=>t.modelValue,h=>{n.value=String(h)});function r(h){const l=parseFloat(h.target.value);Number.isNaN(l)||s("update:modelValue",l)}function o(h){n.value=h.target.value;const l=parseFloat(n.value);Number.isNaN(l)||s("update:modelValue",l)}function a(){const h=parseFloat(n.value);Number.isNaN(h)&&(n.value=String(t.modelValue))}return(h,l)=>(se(),ce("div",{class:Ze(["ns",{disabled:i.disabled}])},[w("span",qC,Ye(i.label),1),w("input",{type:"range",class:"ns-range",min:i.min,max:i.max,step:i.step,value:i.modelValue,disabled:i.disabled,onInput:r},null,40,KC),w("input",{type:"number",class:"ns-num",min:i.min,max:i.max,step:i.step,value:n.value,disabled:i.disabled,onInput:o,onBlur:a},null,40,ZC)],2))}}),Ge=Ks(JC,[["__scopeId","data-v-7c2fbed0"]]),QC={class:"ce"},e2={class:"ce-editor"},t2={class:"ce-grid"},i2=["x1","x2","y2"],s2=["y1","x2","y2"],n2=["x","y","width","height"],r2=["d"],o2={key:0,class:"ce-handles"},a2=["x1","y1","x2","y2"],l2=["cx","cy","onPointerdown"],h2=["x1","y1","x2","y2"],c2=["cx","cy","onPointerdown"],u2=["cx","cy"],d2=["cx","cy","onPointerdown","onDblclick"],f2={class:"ce-nav"},p2={class:"ce-tip"},Rn=8,m2=Ws({__name:"CurveEditor",props:{modelValue:{},defaultValue:{default:()=>[{x:0,y:0},{x:1,y:1}]},mode:{default:"linear"}},emits:["update:modelValue"],setup(i,{emit:e}){const t=i,s=e,n=it(null),r=it(300),o=it(110);let a=null;function h(){if(!n.value)return;const k=n.value.getBoundingClientRect();r.value=k.width,o.value=k.height}function l(k){return Rn+k*(r.value-Rn*2)}function c(k){return Rn+(1-k)*(o.value-Rn*2)}function u(){return[...t.modelValue].sort((k,F)=>k.x-F.x)}function f(k){s("update:modelValue",[...k].sort((F,D)=>F.x-D.x))}function d(){f(t.defaultValue.map(k=>({...k})))}const m=ut(()=>u());function g(k){const F=m.value[k],D=m.value[Math.max(0,k-1)];return{x:F.x-(F.x-D.x)/3,y:F.y-(F.y-D.y)/3}}function b(k){const F=m.value[k],D=m.value[Math.min(m.value.length-1,k+1)];return{x:F.x+(D.x-F.x)/3,y:F.y+(D.y-F.y)/3}}function _(k){const F=m.value[k],D=g(k);return{x:F.x+(F.inX??D.x-F.x),y:F.y+(F.inY??D.y-F.y)}}function M(k){const F=m.value[k],D=b(k);return{x:F.x+(F.outX??D.x-F.x),y:F.y+(F.outY??D.y-F.y)}}const v=ut(()=>{if(!m.value.length)return"";let k=`M ${l(m.value[0].x)} ${c(m.value[0].y)}`;for(let F=1;FMath.abs(j.x-F)>.02);N.push({x:F,y:D}),f(N)}let E={t:0,i:-1,x:0,y:0};function C(k,F){k.stopPropagation();const D=u().findIndex(L=>Math.abs(L.x-m.value[F].x)<1e-6&&Math.abs(L.y-m.value[F].y)<1e-6);if(D<0)return;const N=Date.now();if(N-E.t<300&&E.i===F&&Math.abs(k.clientX-E.x)<8&&Math.abs(k.clientY-E.y)<8){E={t:0,i:-1,x:0,y:0},B(F);return}E={t:N,i:F,x:k.clientX,y:k.clientY};const j=L=>{(Math.abs(L.clientX-k.clientX)>8||Math.abs(L.clientY-k.clientY)>8)&&(E={t:0,i:-1,x:0,y:0});const{x:P,y:X}=S(L.clientX,L.clientY),U=u();U[D]={x:P,y:X},f(U)},O=()=>{window.removeEventListener("pointermove",j),window.removeEventListener("pointerup",O)};window.addEventListener("pointermove",j),window.addEventListener("pointerup",O)}function R(k,F,D){k.stopPropagation();const N=O=>{const L=S(O.clientX,O.clientY),P=u(),X=P[F],U=D==="in"?P[Math.max(0,F-1)].x:X.x,Y=D==="in"?X.x:P[Math.min(P.length-1,F+1)].x,q=Math.min(Y,Math.max(U,L.x)),z=Math.round((q-X.x)*100)/100,ne=Math.round((L.y-X.y)*100)/100;P[F]=D==="in"?{...X,inX:z,inY:ne}:{...X,outX:z,outY:ne},f(P)},j=()=>{window.removeEventListener("pointermove",N),window.removeEventListener("pointerup",j)};window.addEventListener("pointermove",N),window.addEventListener("pointerup",j)}function B(k,F){F==null||F.stopPropagation();const D=u();D.length<=2||(y=Date.now(),f(D.filter((N,j)=>j!==k)))}return _o(()=>{h(),a=new ResizeObserver(h),n.value&&a.observe(n.value)}),wa(()=>{a==null||a.disconnect()}),(k,F)=>(se(),ce("div",QC,[w("div",e2,[(se(),ce("svg",{ref_key:"svg",ref:n,class:"ce-svg",onDblclick:I},[w("g",t2,[(se(),ce(qe,null,Ht([.25,.5,.75],D=>w("line",{key:"v"+D,x1:l(D),y1:"0",x2:l(D),y2:c(0)},null,8,i2)),64)),(se(),ce(qe,null,Ht([.25,.5,.75],D=>w("line",{key:"h"+D,x1:"0",y1:c(D),x2:l(1),y2:c(D)},null,8,s2)),64))]),w("rect",{x:l(0),y:c(1),width:l(1)-l(0),height:c(0)-c(1),class:"ce-frame",fill:"none"},null,8,n2),w("path",{d:v.value,class:"ce-line",fill:"none"},null,8,r2),i.mode==="bezier"?(se(),ce("g",o2,[(se(!0),ce(qe,null,Ht(m.value,(D,N)=>(se(),ce(qe,{key:"handles-"+N},[N>0?(se(),ce("line",{key:0,x1:l(D.x),y1:c(D.y),x2:l(_(N).x),y2:c(_(N).y)},null,8,a2)):$e("",!0),N>0?(se(),ce("circle",{key:1,cx:l(_(N).x),cy:c(_(N).y),r:"4",onPointerdown:j=>R(j,N,"in")},null,40,l2)):$e("",!0),NR(j,N,"out")},null,40,c2)):$e("",!0)],64))),128))])):$e("",!0),(se(!0),ce(qe,null,Ht(m.value,(D,N)=>(se(),ce("g",{key:N},[w("circle",{cx:l(D.x),cy:c(D.y),r:"5",class:"ce-node"},null,8,u2),w("circle",{cx:l(D.x),cy:c(D.y),r:"9",class:"ce-hit",onPointerdown:j=>C(j,N),onDblclick:j=>B(N,j)},null,40,d2)]))),128))],544)),w("div",f2,[w("span",p2,Ye(i.mode==="bezier"?"拖动方形手柄调整弧度·双击空白新建·双击节点删除":"双击空白新建·双击节点删除·拖动节点调整"),1)])]),w("button",{class:"ce-reset",type:"button",title:"恢复默认曲线",onClick:d},"重置")]))}}),Is=Ks(m2,[["__scopeId","data-v-9bfb7b31"]]),g2={class:"pac"},v2={class:"pac-head"},y2={class:"pac-label"},x2={key:0,class:"pac-modes"},b2=["onClick"],w2={class:"pac-range"},_2={class:"pac-curve"},S2={class:"pac-axis"},T2=Ws({__name:"ParticleAttributeControl",props:{label:{},mode:{},valueMin:{},valueMax:{},curve:{},defaultCurve:{default:()=>[{x:0,y:0},{x:1,y:1}]},min:{},max:{},step:{default:1},allowDirection:{type:Boolean,default:!1},allowCurve:{type:Boolean,default:!0},showModes:{type:Boolean,default:!0},curveLabel:{default:"曲线输入 →"}},emits:["update:mode","update:valueMin","update:valueMax","update:curve"],setup(i){const e=i,t=ut(()=>{const s=[{label:"固定",value:"fixed"},{label:"随机",value:"random"}];return e.allowCurve&&s.push({label:"曲线",value:"curve"}),e.allowDirection&&s.push({label:"发射方向",value:"direction"}),s});return(s,n)=>(se(),ce("div",g2,[w("div",v2,[w("span",y2,Ye(i.label),1),i.showModes?(se(),ce("div",x2,[(se(!0),ce(qe,null,Ht(t.value,r=>(se(),ce("button",{key:r.value,class:Ze(["pac-mode",{on:i.mode===r.value}]),onClick:o=>s.$emit("update:mode",r.value)},Ye(r.label),11,b2))),128))])):$e("",!0)]),i.mode==="fixed"||i.mode==="direction"?(se(),Et(Ge,{key:0,label:i.mode==="direction"?"角度偏移":"数值",min:i.min,max:i.max,step:i.step,"model-value":i.valueMin,"onUpdate:modelValue":n[0]||(n[0]=r=>s.$emit("update:valueMin",r))},null,8,["label","min","max","step","model-value"])):i.mode==="random"?(se(),ce(qe,{key:1},[Ne(Ge,{label:"下限",min:i.min,max:i.max,step:i.step,"model-value":i.valueMin,"onUpdate:modelValue":n[1]||(n[1]=r=>s.$emit("update:valueMin",r))},null,8,["min","max","step","model-value"]),Ne(Ge,{label:"上限",min:i.min,max:i.max,step:i.step,"model-value":i.valueMax,"onUpdate:modelValue":n[2]||(n[2]=r=>s.$emit("update:valueMax",r))},null,8,["min","max","step","model-value"])],64)):(se(),ce(qe,{key:2},[w("div",w2,[Ne(Ge,{label:"范围下限",min:i.min,max:i.max,step:i.step,"model-value":i.valueMin,"onUpdate:modelValue":n[3]||(n[3]=r=>s.$emit("update:valueMin",r))},null,8,["min","max","step","model-value"]),Ne(Ge,{label:"范围上限",min:i.min,max:i.max,step:i.step,"model-value":i.valueMax,"onUpdate:modelValue":n[4]||(n[4]=r=>s.$emit("update:valueMax",r))},null,8,["min","max","step","model-value"])]),w("div",_2,[Ne(Is,{"model-value":i.curve,"default-value":i.defaultCurve,"onUpdate:modelValue":n[5]||(n[5]=r=>s.$emit("update:curve",r))},null,8,["model-value","default-value"]),w("div",S2,[n[6]||(n[6]=w("span",null,"0",-1)),w("span",null,Ye(i.curveLabel),1),n[7]||(n[7]=w("span",null,"1",-1))])])],64))]))}}),nn=Ks(T2,[["__scopeId","data-v-238f838c"]]),M2={class:"gradient-editor"},E2=["title","onClick","onDblclick","onPointerdown"],A2={key:0,class:"gradient-controls"},C2=["value"],I2=["value"],R2={class:"gradient-position"},P2=["value"],k2=["disabled"],F2=Ws({__name:"ColorGradientEditor",props:{modelValue:{}},emits:["update:modelValue"],setup(i,{emit:e}){const t=i,s=e,n=it(null),r=it(0),o=ut(()=>t.modelValue[r.value]||null),a=ut(()=>[...t.modelValue].sort((C,R)=>C.position-R.position)),h=ut(()=>{const C=a.value;return C.length?`linear-gradient(90deg, ${C.map(R=>`${R.color} ${l(R.position)*100}%`).join(", ")})`:"#ffffff"});cs(()=>t.modelValue.length,C=>{r.value>=C&&(r.value=Math.max(0,C-1))});function l(C){return Math.min(1,Math.max(0,Number(C)||0))}function c(){return t.modelValue.map(C=>({position:l(C.position),color:C.color}))}function u(C,R){const B=c();B[C]&&(B[C]={...B[C],...R},s("update:modelValue",B))}function f(C){u(r.value,{color:C.target.value})}function d(C){var k;const R=C.target,B=E(R.value,((k=o.value)==null?void 0:k.color)||"#ffffff");R.value=B,u(r.value,{color:B})}function m(C){const R=C.target;d(C),R.blur()}function g(C){const R=Number(C.target.value);Number.isFinite(R)&&u(r.value,{position:l(R/100)})}function b(C){const R=c();R.push({position:l(C),color:y(R,C)}),r.value=R.length-1,s("update:modelValue",R)}function _(C){if(!n.value)return;const R=n.value.getBoundingClientRect();b((C.clientX-R.left)/Math.max(1,R.width))}function M(){const C=a.value;let R=.5;if(C.length>1){let B=-1;for(let k=0;kB&&(B=F,R=(C[k].position+C[k+1].position)/2)}}b(R)}function v(C){if(t.modelValue.length<=2||C<0)return;const R=c().filter((B,k)=>k!==C);r.value=Math.min(C,R.length-1),s("update:modelValue",R)}function S(C,R){if(!n.value)return;r.value=R;const B=F=>{const D=n.value.getBoundingClientRect();u(R,{position:l((F.clientX-D.left)/Math.max(1,D.width))})},k=()=>{window.removeEventListener("pointermove",B),window.removeEventListener("pointerup",k),window.removeEventListener("pointercancel",k)};window.addEventListener("pointermove",B),window.addEventListener("pointerup",k),window.addEventListener("pointercancel",k),C.preventDefault()}function y(C,R){const B=[...C].sort((k,F)=>k.position-F.position);if(!B.length)return"#ffffff";if(R<=B[0].position)return B[0].color;if(R>=B[B.length-1].position)return B[B.length-1].color;for(let k=0;kD.position)continue;const N=(R-F.position)/Math.max(1e-4,D.position-F.position);return I(F.color,D.color,N)}return B[B.length-1].color}function I(C,R,B){const k=j=>{const O=parseInt(j.replace("#","").padEnd(6,"0").slice(0,6),16);return[O>>16&255,O>>8&255,O&255]},F=k(C),D=k(R),N=j=>Math.round(F[j]+(D[j]-F[j])*B);return`#${[N(0),N(1),N(2)].map(j=>j.toString(16).padStart(2,"0")).join("")}`}function E(C,R){let B=C.trim().replace(/^#/,"");return/^[0-9a-f]{3}$/i.test(B)&&(B=B.split("").map(k=>k+k).join("")),/^[0-9a-f]{6}$/i.test(B)?`#${B.toLowerCase()}`:R}return(C,R)=>(se(),ce("div",M2,[w("div",{ref_key:"bar",ref:n,class:"gradient-bar",style:Pi({background:h.value}),title:"双击色带添加色标",onDblclick:_},[(se(!0),ce(qe,null,Ht(i.modelValue,(B,k)=>(se(),ce("button",{key:k,type:"button",class:Ze(["gradient-stop",{selected:k===r.value}]),style:Pi({left:`${l(B.position)*100}%`,"--stop-color":B.color}),title:`${Math.round(l(B.position)*100)}% · ${B.color}`,onClick:xt(F=>r.value=k,["stop"]),onDblclick:xt(F=>v(k),["stop"]),onPointerdown:xt(F=>S(F,k),["stop"])},null,46,E2))),128))],36),o.value?(se(),ce("div",A2,[w("input",{type:"color",class:"gradient-color",value:o.value.color,"aria-label":"色标颜色",onInput:f},null,40,C2),w("input",{type:"text",class:"gradient-hex-input",value:o.value.color,"aria-label":"色标颜色值",spellcheck:"false",onChange:d,onKeydown:da(m,["enter"])},null,40,I2),w("label",R2,[w("input",{type:"number",min:"0",max:"100",step:"1",value:Math.round(l(o.value.position)*100),"aria-label":"色标位置",onInput:g},null,40,P2),R[1]||(R[1]=w("span",null,"%",-1))]),w("button",{type:"button",class:"gradient-action",title:"在中间新增颜色",onClick:M},"+"),w("button",{type:"button",class:"gradient-action danger",title:"删除当前色标",disabled:i.modelValue.length<=2,onClick:R[0]||(R[0]=B=>v(r.value))},"×",8,k2)])):$e("",!0),R[2]||(R[2]=w("div",{class:"gradient-hint"},"双击色带新增 · 拖动色标调整位置 · 双击色标删除",-1))]))}}),pg=Ks(F2,[["__scopeId","data-v-f6ab10bf"]]),O2={class:"image-card"},B2={class:"imgrow"},L2=["title"],D2=["src","alt"],N2={key:1,viewBox:"0 0 24 24",width:"22",height:"22",fill:"none",stroke:"#8a93bb","stroke-width":"1.6"},U2={class:"img-fields"},V2={key:0,class:"row"},X2={class:"row"},Y2=["placeholder"],$2={class:"img-actions"},G2=["title"],j2=["disabled"],H2={class:"thumb-note"},W2={key:0,class:"row"},z2={class:"row"},q2={class:"row"},K2={class:"sequence-note"},Z2={class:"resource-weight-row"},J2=["disabled","title"],Q2={key:0,viewBox:"0 0 24 24","aria-hidden":"true"},eI={key:1,viewBox:"0 0 24 24","aria-hidden":"true"},tI=Ws({__name:"ImageResourceCard",props:{resource:{},resourceCount:{},defaultFile:{},namePlaceholder:{default:"particle"},showFolder:{type:Boolean,default:!0},supportsSequence:{type:Boolean,default:!1}},emits:["pick","pickSequence","reset","remove","updateWeight","toggleLock"],setup(i,{emit:e}){const t=i,s=e,n=ut(()=>{var l,c;if(t.resource.imageMode==="sequence"){const u=t.resource.sequenceFrames||[];if(!u.length)return"未选择序列帧";const f=((l=u[0])==null?void 0:l.name)||"第 1 帧",d=((c=u[u.length-1])==null?void 0:c.name)||f;return u.length===1?`1 帧 · ${f}`:`${u.length} 帧 · ${f} → ${d}`}const h=t.resource.textureName||t.defaultFile.replace(/\.[^.]+$/,"");return h.includes(".")?h:`${h}.png`}),r=ut(()=>{var h,l;return t.resource.imageMode==="sequence"?((l=(h=t.resource.sequenceFrames)==null?void 0:h[0])==null?void 0:l.previewUrl)||"":t.resource.previewUrl}),o=ut(()=>{var u,f;const h=t.resource.sequenceFrames||[];if(!h.length)return"未选择序列帧";const l=((u=h[0])==null?void 0:u.name)||"第一张图片",c=((f=h[h.length-1])==null?void 0:f.name)||"最后一张图片";return`已选择 ${h.length} 帧,按 ${l}-${c} 顺序播放`});function a(){t.supportsSequence&&t.resource.imageMode==="sequence"?s("pickSequence",t.resource.id):s("pick",t.resource.id)}return(h,l)=>(se(),ce("div",O2,[w("div",B2,[w("button",{class:"img-thumb",title:i.supportsSequence&&i.resource.imageMode==="sequence"?"选择序列帧图片":"选择本地图片",onClick:a},[r.value?(se(),ce("img",{key:0,src:r.value,alt:i.resource.textureName},null,8,D2)):(se(),ce("svg",N2,[...l[10]||(l[10]=[w("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"},null,-1),w("circle",{cx:"8.5",cy:"8.5",r:"1.6"},null,-1),w("path",{d:"M21 15l-5-5-9 9"},null,-1)])]))],8,L2),w("div",U2,[i.showFolder?(se(),ce("label",V2,[l[11]||(l[11]=w("span",null,"子文件夹",-1)),xe(w("input",{"onUpdate:modelValue":l[0]||(l[0]=c=>i.resource.textureFolder=c),type:"text",class:"inp",placeholder:"subfolder/"},null,512),[[Je,i.resource.textureFolder]])])):$e("",!0),w("label",X2,[l[12]||(l[12]=w("span",null,"名称",-1)),xe(w("input",{"onUpdate:modelValue":l[1]||(l[1]=c=>i.resource.textureName=c),type:"text",class:"inp",placeholder:i.namePlaceholder},null,8,Y2),[[Je,i.resource.textureName]])])]),w("div",$2,[w("button",{class:"mini-btn2",title:`恢复 ${i.defaultFile}`,onClick:l[2]||(l[2]=c=>h.$emit("reset",i.resource.id))},"⟳",8,G2),w("button",{class:"mini-btn2",title:"删除图片资源",disabled:i.resourceCount===1,onClick:l[3]||(l[3]=c=>h.$emit("remove",i.resource.id))},"🗑",8,j2)])]),w("div",H2,Ye(n.value),1),i.supportsSequence?(se(),ce("label",W2,[l[14]||(l[14]=w("span",null,"图片模式",-1)),xe(w("select",{"onUpdate:modelValue":l[4]||(l[4]=c=>i.resource.imageMode=c),class:"inp"},[...l[13]||(l[13]=[w("option",{value:"fixed"},"固定",-1),w("option",{value:"sequence"},"序列帧",-1)])],512),[[kt,i.resource.imageMode]])])):$e("",!0),i.supportsSequence&&i.resource.imageMode==="sequence"?(se(),ce(qe,{key:1},[w("label",z2,[l[16]||(l[16]=w("span",null,"播放模式",-1)),xe(w("select",{"onUpdate:modelValue":l[5]||(l[5]=c=>i.resource.sequencePlayback=c),class:"inp"},[...l[15]||(l[15]=[w("option",{value:"once-hide"},"单次-尾帧消失",-1),w("option",{value:"once-hold"},"单次-尾帧固定",-1),w("option",{value:"loop-forward"},"正向循环",-1),w("option",{value:"loop-reverse"},"反向循环",-1)])],512),[[kt,i.resource.sequencePlayback]])]),w("label",q2,[l[17]||(l[17]=w("span",null,"播放帧率",-1)),xe(w("input",{"onUpdate:modelValue":l[6]||(l[6]=c=>i.resource.sequenceFps=c),type:"number",min:"1",max:"120",step:"1",class:"inp"},null,512),[[Je,i.resource.sequenceFps,void 0,{number:!0}]])]),w("button",{class:"sequence-pick",onClick:l[7]||(l[7]=c=>h.$emit("pickSequence",i.resource.id))},"选择序列帧(多选)"),w("div",K2,Ye(o.value),1)],64)):$e("",!0),w("div",Z2,[Ne(Ge,{class:"resource-weight-control",label:"占比%",min:0,max:100,step:1,"model-value":i.resource.weight,disabled:i.resource.locked||i.resourceCount===1,"onUpdate:modelValue":l[8]||(l[8]=c=>h.$emit("updateWeight",i.resource.id,c))},null,8,["model-value","disabled"]),w("button",{class:Ze(["weight-lock",{on:i.resource.locked}]),disabled:i.resourceCount===1,title:i.resource.locked?"解除占比锁定":"锁定当前占比",onClick:l[9]||(l[9]=c=>h.$emit("toggleLock",i.resource.id))},[i.resource.locked?(se(),ce("svg",Q2,[...l[18]||(l[18]=[w("rect",{x:"5",y:"10",width:"14",height:"10",rx:"2"},null,-1),w("path",{d:"M8 10V7a4 4 0 0 1 8 0v3"},null,-1)])])):(se(),ce("svg",eI,[...l[19]||(l[19]=[w("rect",{x:"5",y:"10",width:"14",height:"10",rx:"2"},null,-1),w("path",{d:"M16 10V7a4 4 0 0 0-7.5-2"},null,-1)])]))],10,J2)]),O1(h.$slots,"default",{},void 0)]))}}),mg=Ks(tI,[["__scopeId","data-v-68ff5314"]]),iI={class:"spine-editor"},sI={class:"field wide"},nI={class:"grid three"},rI={class:"field"},oI={class:"field"},aI={class:"field"},lI={class:"grid three"},hI={class:"field"},cI={class:"field"},uI={class:"field"},dI=["disabled"],fI={class:"asset-row"},pI=["title"],mI={class:"asset-row"},gI=["title"],vI={class:"asset-row"},yI=["title"],xI={class:"asset-actions"},bI=["disabled"],wI={class:"runtime-note"},_I={key:0},SI={key:0,class:"error"},TI={class:"section-box"},MI={key:0,class:"empty"},EI={key:1,class:"field wide"},AI=["value"],CI={class:"section-box"},II={class:"tree-title-row"},RI=["disabled","title"],PI={key:0,class:"empty"},kI={key:1,class:"bone-search"},FI={key:2,class:"empty"},OI={key:3,class:"bone-tree"},BI=["onClick","onKeydown"],LI=["title","onClick"],DI={key:1,class:"bone-leaf"},NI={class:"bone-name"},UI=Ws({__name:"SpineObjectPanel",props:{spineObject:{}},setup(i){const e=i,t=Aa(),s=it(null),n=it(null),r=it(null),o=it(null),a=it(new Set),h=it(""),l=it(null),c=it(null),u=it([]);e.spineObject.selectedBone==null&&(e.spineObject.selectedBone=""),e.spineObject.sourceBundle==null&&(e.spineObject.sourceBundle=null),e.spineObject.dataVersion==null&&(e.spineObject.dataVersion="");const f=ut(()=>{var L;return((L=l.value)==null?void 0:L.name)||e.spineObject.skeletonFileName}),d=ut(()=>{var L;return((L=c.value)==null?void 0:L.name)||e.spineObject.atlasFileName}),m=ut(()=>u.value.length?u.value.map(L=>L.name):e.spineObject.textureFileNames),g=ut(()=>m.value.length?`${m.value.length} 张:${m.value.join(", ")}`:"PNG / JPEG / WebP..."),b=ut(()=>new Set(e.spineObject.bones.map(L=>L.parent).filter(L=>!!L))),_=ut(()=>new Map(e.spineObject.bones.map(L=>[L.name,L]))),M=ut(()=>e.spineObject.bones.filter(L=>{var U;const P=h.value.trim().toLocaleLowerCase();if(P)return L.name.toLocaleLowerCase().includes(P);let X=L.parent;for(;X;){if(a.value.has(X))return!1;X=((U=_.value.get(X))==null?void 0:U.parent)||null}return!0})),v=ut(()=>b.value.size>0&&[...b.value].every(L=>a.value.has(L)));function S(L){const P=e.spineObject.selectedBone===L;for(const X of t.spines)X.selectedBone="";P||(e.spineObject.selectedBone=L)}function y(L){a.value.has(L)?a.value.delete(L):a.value.add(L)}function I(){a.value=v.value?new Set:new Set(b.value)}function E(L){var P;return((P=L.target.files)==null?void 0:P[0])||null}function C(L){l.value=E(L)}function R(L){c.value=E(L)}function B(L){u.value=Array.from(L.target.files||[])}function k(L){return L.name.replace(/\.[^.]+$/,"").toLocaleLowerCase()}async function F(L){const P=Array.from(L.target.files||[]);if(!P.length)return;const X=P.filter(H=>/\.(json|skel)$/i.test(H.name)),U=P.filter(H=>/\.atlas$/i.test(H.name)),Y=P.filter(H=>/\.(png|jpe?g|webp|wepb)$/i.test(H.name)),q=U.map(H=>({atlas:H,skeleton:X.find(Z=>k(Z)===k(H))})).find(H=>H.skeleton),z=(q==null?void 0:q.skeleton)||X[0]||null,ne=(q==null?void 0:q.atlas)||U[0]||null;if(l.value=z,c.value=ne,u.value=Y,!z||!ne||!Y.length){const H=[!z&&"JSON / SKEL",!ne&&"Atlas",!Y.length&&"纹理图片"].filter(Boolean).join("、");e.spineObject.status="error",e.spineObject.error=`所选文件夹缺少:${H}`;return}await j()}function D(){t.recalcTotalFrames()}function N(){D(),t.timeline.frame=0}async function j(){var X;const L=l.value,P=c.value;if(!L||!P||!u.value.length){e.spineObject.status="error",e.spineObject.error="请依次选择 Spine 数据、Atlas 和全部纹理图片";return}e.spineObject.status="loading",e.spineObject.error="";try{const U=await lx(L,P,u.value);Lh(e.spineObject.id,U),e.spineObject.skeletonFileName=L.name,e.spineObject.atlasFileName=P.name,e.spineObject.textureFileNames=u.value.map(Y=>Y.name),e.spineObject.dataVersion=U.dataVersion,e.spineObject.animations=U.animations,e.spineObject.bones=U.bones,e.spineObject.selectedBone="",h.value="",a.value=new Set,e.spineObject.selectedAnimation=((X=U.animations[0])==null?void 0:X.name)||"",e.spineObject.assetVersion++,e.spineObject.status="ready",D(),t.timeline.frame=0;try{e.spineObject.sourceBundle=await ZA(L,P,u.value)}catch(Y){e.spineObject.sourceBundle=null,console.warn("Spine 配置资源嵌入失败",Y)}}catch(U){e.spineObject.status="error",e.spineObject.error=U instanceof Error?U.message:String(U)}}function O(){Ea(e.spineObject.id),l.value=null,c.value=null,u.value=[],s.value&&(s.value.value=""),n.value&&(n.value.value=""),r.value&&(r.value.value=""),o.value&&(o.value.value=""),e.spineObject.skeletonFileName="",e.spineObject.atlasFileName="",e.spineObject.textureFileNames=[],e.spineObject.dataVersion="",e.spineObject.sourceBundle=null,e.spineObject.animations=[],e.spineObject.bones=[],e.spineObject.selectedBone="",h.value="",a.value=new Set,e.spineObject.selectedAnimation="",e.spineObject.assetVersion++,e.spineObject.status="empty",e.spineObject.error="",D()}return(L,P)=>(se(),ce("div",iI,[P[30]||(P[30]=w("div",{class:"editor-title"},"Spine 属性",-1)),w("label",sI,[P[15]||(P[15]=w("span",null,"Spine 名称",-1)),xe(w("input",{"onUpdate:modelValue":P[0]||(P[0]=X=>i.spineObject.name=X)},null,512),[[Je,i.spineObject.name]])]),w("div",nI,[w("label",rI,[P[16]||(P[16]=w("span",null,"X 位置",-1)),xe(w("input",{"onUpdate:modelValue":P[1]||(P[1]=X=>i.spineObject.x=X),type:"number"},null,512),[[Je,i.spineObject.x,void 0,{number:!0}]])]),w("label",oI,[P[17]||(P[17]=w("span",null,"Y 位置",-1)),xe(w("input",{"onUpdate:modelValue":P[2]||(P[2]=X=>i.spineObject.y=X),type:"number"},null,512),[[Je,i.spineObject.y,void 0,{number:!0}]])]),w("label",aI,[P[18]||(P[18]=w("span",null,"旋转",-1)),xe(w("input",{"onUpdate:modelValue":P[3]||(P[3]=X=>i.spineObject.rotation=X),type:"number"},null,512),[[Je,i.spineObject.rotation,void 0,{number:!0}]])])]),w("div",lI,[w("label",hI,[P[19]||(P[19]=w("span",null,"Scale X",-1)),xe(w("input",{"onUpdate:modelValue":P[4]||(P[4]=X=>i.spineObject.scaleX=X),type:"number",step:"0.05"},null,512),[[Je,i.spineObject.scaleX,void 0,{number:!0}]])]),w("label",cI,[P[20]||(P[20]=w("span",null,"Scale Y",-1)),xe(w("input",{"onUpdate:modelValue":P[5]||(P[5]=X=>i.spineObject.scaleY=X),type:"number",step:"0.05"},null,512),[[Je,i.spineObject.scaleY,void 0,{number:!0}]])]),w("label",uI,[P[21]||(P[21]=w("span",null,"开始时间",-1)),xe(w("input",{"onUpdate:modelValue":P[6]||(P[6]=X=>i.spineObject.timeOffset=X),type:"number",min:"0",step:"0.033333",onChange:D},null,544),[[Je,i.spineObject.timeOffset,void 0,{number:!0}]])])]),P[31]||(P[31]=w("div",{class:"divider"},null,-1)),P[32]||(P[32]=w("div",{class:"section-title"},"Spine 资源",-1)),w("input",{ref_key:"skeletonInput",ref:s,hidden:"",type:"file",accept:".json,.skel,application/json,application/octet-stream",onChange:C},null,544),w("input",{ref_key:"atlasInput",ref:n,hidden:"",type:"file",accept:".atlas,text/plain",onChange:R},null,544),w("input",{ref_key:"textureInput",ref:r,hidden:"",type:"file",multiple:"",accept:".png,.jpg,.jpeg,.webp,.wepb,image/png,image/jpeg,image/webp",onChange:B},null,544),w("input",{ref_key:"folderInput",ref:o,hidden:"",type:"file",multiple:"",webkitdirectory:"",directory:"",onChange:F},null,544),w("button",{class:"folder-select",disabled:i.spineObject.status==="loading",onClick:P[7]||(P[7]=X=>{var U;return(U=o.value)==null?void 0:U.click()})},"选择文件夹并加载",8,dI),P[33]||(P[33]=w("div",{class:"folder-hint"},"一次读取文件夹中的 JSON / SKEL、Atlas 和全部纹理;仍可在下方单独替换资源。",-1)),w("div",fI,[w("div",{class:"asset-name",title:f.value},Ye(f.value||"JSON / SKEL..."),9,pI),w("button",{onClick:P[8]||(P[8]=X=>{var U;return(U=s.value)==null?void 0:U.click()})},"选择")]),w("div",mI,[w("div",{class:"asset-name",title:d.value},Ye(d.value||"Atlas..."),9,gI),w("button",{onClick:P[9]||(P[9]=X=>{var U;return(U=n.value)==null?void 0:U.click()})},"选择")]),w("div",vI,[w("div",{class:"asset-name",title:m.value.join(", ")},Ye(g.value),9,yI),w("button",{onClick:P[10]||(P[10]=X=>{var U;return(U=r.value)==null?void 0:U.click()})},"选择(多选)")]),w("div",xI,[w("button",{class:"load",disabled:i.spineObject.status==="loading",onClick:j},Ye(i.spineObject.status==="loading"?"加载中…":"↧ 加载"),9,bI),w("button",{class:"clear",onClick:O},"清除")]),w("div",wI,[P[22]||(P[22]=Yt(" 支持 Spine 3.8 / 4.0 / 4.1 / 4.2 JSON · 4.2.119 预览运行时 · 本地离线 ",-1)),i.spineObject.dataVersion?(se(),ce("span",_I," · 当前资源 "+Ye(i.spineObject.dataVersion),1)):$e("",!0)]),i.spineObject.error?(se(),ce("div",SI,Ye(i.spineObject.error),1)):$e("",!0),w("div",TI,[P[25]||(P[25]=w("div",{class:"section-title"},"Spine 动画",-1)),i.spineObject.animations.length?(se(),ce("label",EI,[P[24]||(P[24]=w("span",null,"时间轴播放动画",-1)),xe(w("select",{"onUpdate:modelValue":P[11]||(P[11]=X=>i.spineObject.selectedAnimation=X),onChange:N},[P[23]||(P[23]=w("option",{value:""},"无",-1)),(se(!0),ce(qe,null,Ht(i.spineObject.animations,X=>(se(),ce("option",{key:X.name,value:X.name},Ye(X.name)+"("+Ye(X.duration.toFixed(2))+"s) ",9,AI))),128))],544),[[kt,i.spineObject.selectedAnimation]])])):(se(),ce("div",MI,"无可用动画"))]),w("div",CI,[w("div",II,[P[29]||(P[29]=w("div",{class:"section-title"},"层级树",-1)),w("button",{class:Ze(["selected-bone",{active:i.spineObject.selectedBone}]),disabled:!i.spineObject.selectedBone,title:i.spineObject.selectedBone?"点击清除骨骼选择":"当前未选择骨骼",onClick:P[12]||(P[12]=X=>i.spineObject.selectedBone="")},[i.spineObject.selectedBone?(se(),ce(qe,{key:0},[P[26]||(P[26]=Yt("清除选中骨骼:",-1)),w("strong",null,Ye(i.spineObject.selectedBone),1)],64)):(se(),ce(qe,{key:1},[P[27]||(P[27]=Yt("当前骨骼:",-1)),P[28]||(P[28]=w("strong",null,"未选择",-1))],64))],10,RI),i.spineObject.bones.length?(se(),ce("button",{key:0,class:"tree-action",onClick:I},Ye(v.value?"全部展开":"全部折叠"),1)):$e("",!0)]),i.spineObject.bones.length?(se(),ce("div",kI,[xe(w("input",{"onUpdate:modelValue":P[13]||(P[13]=X=>h.value=X),type:"search","aria-label":"搜索骨骼",placeholder:"搜索骨骼名称…"},null,512),[[Je,h.value,void 0,{trim:!0}]]),h.value?(se(),ce("button",{key:0,title:"清空搜索","aria-label":"清空骨骼搜索",onClick:P[14]||(P[14]=X=>h.value="")},"✕")):$e("",!0)])):(se(),ce("div",PI,"未加载 Spine")),i.spineObject.bones.length&&!M.value.length?(se(),ce("div",FI,"未找到匹配的骨骼")):i.spineObject.bones.length?(se(),ce("div",OI,[(se(!0),ce(qe,null,Ht(M.value,X=>(se(),ce("div",{key:X.name,class:Ze(["bone",{selected:i.spineObject.selectedBone===X.name}]),style:Pi({paddingLeft:`${6+X.depth*16}px`}),role:"button",tabindex:"0",onClick:U=>S(X.name),onKeydown:da(xt(U=>S(X.name),["prevent"]),["enter"])},[b.value.has(X.name)?(se(),ce("button",{key:0,class:"bone-toggle",title:a.value.has(X.name)?"展开子骨骼":"折叠子骨骼",onClick:xt(U=>y(X.name),["stop"])},Ye(a.value.has(X.name)?"▸":"▾"),9,LI)):(se(),ce("span",DI,"•")),w("span",NI,Ye(X.name),1)],46,BI))),128))])):$e("",!0)])]))}}),VI=Ks(UI,[["__scopeId","data-v-af64e8e8"]]),XI="3.8";function Wi(i,e,t){i[e]==null&&i[t]!=null&&(i[e]=i[t]),delete i[t]}function Pd(i){if(!i||typeof i!="object")return;if(Array.isArray(i)){for(const t of i)Pd(t);return}const e=i;Array.isArray(e.curve)&&delete e.curve;for(const t of Object.values(e))Pd(t)}function YI(i){for(const e of i.bones)Wi(e,"transform","inherit");for(const e of i.transform||[])Wi(e,"rotateMix","mixRotate"),e.translateMix==null&&(e.translateMix=e.mixX??e.mixY),e.scaleMix==null&&(e.scaleMix=e.mixScaleX??e.mixScaleY),Wi(e,"shearMix","mixShearY"),delete e.mixX,delete e.mixY,delete e.mixScaleX,delete e.mixScaleY;for(const e of i.path||[])Wi(e,"rotateMix","mixRotate"),e.translateMix==null&&(e.translateMix=e.mixX??e.mixY),delete e.mixX,delete e.mixY;for(const e of i.skins)for(const t of Object.values(e.attachments||{}))for(const s of Object.values(t||{}))s.parent!=null&&Wi(s,"deform","timelines")}function $I(i){for(const e of Object.values(i.slots||{}))Wi(e,"color","rgba"),Wi(e,"twoColor","rgba2")}function GI(i){for(const e of Object.values(i.bones||{}))for(const t of e.rotate||[])Wi(t,"angle","value")}function jI(i){for(const e of Object.values(i.transform||{}))for(const t of e)Wi(t,"rotateMix","mixRotate"),t.translateMix==null&&(t.translateMix=t.mixX??t.mixY),t.scaleMix==null&&(t.scaleMix=t.mixScaleX??t.mixScaleY),Wi(t,"shearMix","mixShearY"),delete t.mixX,delete t.mixY,delete t.mixScaleX,delete t.mixScaleY}function HI(i){for(const e of Object.values(i.path||{})){for(const t of["position","spacing"])for(const s of e[t]||[])Wi(s,t,"value");for(const t of e.mix||[])Wi(t,"rotateMix","mixRotate"),t.translateMix==null&&(t.translateMix=t.mixX??t.mixY),delete t.mixX,delete t.mixY}}function WI(i){if(!i.attachments)return;const e=i.deform||(i.deform={});for(const[t,s]of Object.entries(i.attachments)){const n=e[t]||(e[t]={});for(const[r,o]of Object.entries(s)){const a=n[r]||(n[r]={});for(const[h,l]of Object.entries(o))l.deform&&(a[h]=l.deform)}}delete i.attachments}function zI(i){i.skeleton.spine=XI,YI(i);for(const e of Object.values(i.animations))$I(e),GI(e),jI(e),HI(e),WI(e);return Pd(i.animations),i}function qI(i,e,t,s){const n=t.frame-e.frame,r=n<=0?0:(i.frame-e.frame)/n;let o=0;for(let a=0;a[...s].sort((o,a)=>o-a);let r=!0;for(;r;){r=!1;const o=n();for(let a=0;au&&(u=d,c=f)}c>=0&&(s.add(c),r=!0)}}return n().map(o=>i[o])}function gg(i,e,t,s,n){const r=t-e+1;if(r<2)return 0;const o=n?e:t,a=n?e+1:t-1,h=n?e+2:t-2,l=Math.abs(i[a].frame-i[o].frame);if(r>=3&&l>0&&Math.abs(Math.abs(i[h].frame-i[a].frame)-l)<1e-6){const u=i[o].values[s],f=i[a].values[s],d=i[h].values[s];return n?(-3*u+4*f-d)/(2*l):(3*u-4*f+d)/(2*l)}const c=i[a].frame-i[o].frame;return c?(i[a].values[s]-i[o].values[s])/c:0}function vg(i,e,t){const s=i[t].frame-i[e].frame,n=[];for(let r=0;rf.values[r])),l=Math.max(...i.slice(e,t+1).map(f=>f.values[r])),c=o+gg(i,e,t,r,!0)*s/3,u=a-gg(i,e,t,r,!1)*s/3;n.push([Math.max(h,Math.min(l,c)),Math.max(h,Math.min(l,u))])}return{values:n}}function KI(i,e,t,s,n){const r=1-n;return r*r*r*i+3*r*r*n*e+3*r*n*n*t+n*n*n*s}function ZI(i,e,t,s,n){const r=t.frame-e.frame,o=r<=0?0:(i.frame-e.frame)/r;let a=0;for(let h=0;h[...s].sort((a,h)=>a-h);let r=!0;for(;r;){r=!1;const a=n();for(let h=0;hd&&(d=g,f=m)}f>=0&&(s.add(f),r=!0)}}const o=n();return{samples:o.map(a=>i[a]),controls:o.slice(0,-1).map((a,h)=>vg(i,a,o[h+1]))}}function JI(i){if(!i.length)return[];const e=[i[0]];for(let t=1;t180;)s-=360;for(;s-e[t-1]<-180;)s+=360;e.push(s)}return e}function Zt(i){if(!Number.isFinite(i))return 0;const e=Math.round(i*1e5)/1e5;return Object.is(e,-0)?0:e}function QI(i,e,t,s){const n=Math.max(2,Math.min(16,Math.round(Number(i.trailGridRows)||2))),r=Math.max(2,Math.min(32,Math.round(Number(i.trailGridCols)||2))),o=Math.max(2,t.length),a=e.lengthMode==="random"?Math.max(1,Number(e.lengthMin)||0,Number(e.lengthMax)||0):Math.max(.001,Number(e.length)||100),h=e.widthSizeMode==="random"?Math.max(1,Number(e.widthMin)||0,Number(e.widthMax)||0):Math.max(.001,Number(e.width)||100),l=(Number(e.rotation)||0)*Math.PI/180,c=Math.cos(l),u=Math.sin(l),f=[],d=[],m=[],g=[],b=[];for(let v=0;v=0;v--)b.push({col:v,row:n-1});for(let v=n-2;v>=1;v--)b.push({col:0,row:v});const _=b.length;for(let v=1;v|\s]+/g,"_").replace(/^_+|_+$/g,"")||e}function bx(i,e){let t=i,s=2;for(;e.has(t);)t=`${i}_${s++}`;return e.add(t),t}function tR(i){return i.replace(/\.[^./\\]+$/,"")}function wx(i,e){return tR([i,e].filter(Boolean).join("/").replace(/\\/g,"/").replace(/\/{2,}/g,"/").replace(/^\.\//,""))}function iR(i){var s,n;const e=Number(((s=i==null?void 0:i.orig)==null?void 0:s.width)??(i==null?void 0:i.width))||0,t=Number(((n=i==null?void 0:i.orig)==null?void 0:n.height)??(i==null?void 0:i.height))||0;return{width:e,height:t}}function hl(i){return Math.round(Math.max(0,Math.min(1,i))*255).toString(16).padStart(2,"0")}function _g(i,e){return[(i>>16&255)/255,(i>>8&255)/255,(i&255)/255,Math.max(0,Math.min(1,e))]}function na(i,e){return Zt(i/e)}function sR(i,e){const t=i.config,s=t.lifeMode==="fixed"?Math.max(0,Number(t.lifeMin)||0):Math.max(0,Number(t.lifeMin)||0,Number(t.lifeMax)||0),n=Math.max(0,Number(t.delay)||0);let r;if(t.mode!=="stream")r=n+s;else if(t.streamBehavior!=="loop")r=n+Math.max(1/e,Number(t.duration)||0)+s;else{const o=Math.max(1,Math.ceil(Number(t.loopDurationFrames)||1))/e;t.generateLoopEndAnimation?r=n+s+1/e:t.generateLoopStartAnimation?r=n+o*Math.max(1,Math.ceil(s/o)):r=n+o}return Math.max(1,Math.ceil(r*e)+1)}function oh(i,e){return e?i.boneName:`${i.spawnId??"legacy"}_${i.boneName}`}function nR(i,e,t){const s=new Set;for(const n of i)for(const r of n)s.add(oh(r,e));return[...s].sort().map((n,r)=>({key:n,name:bx(`_particle_${String(r).padStart(3,"0")}`,t),states:i.map(o=>o.find(a=>oh(a,e)===n)||null)}))}function rR(i,e,t,s){const n=e*t/s,r=Math.min(i.states.length-1,Math.max(0,Math.floor(n))),o=Math.min(i.states.length-1,r+1),a=i.states[r],h=i.states[o];if(!a||!h||oh(a,!0)!==oh(h,!0)||a.spawnId!==h.spawnId)return a;const l=n-r;if(l<=1e-6)return a;const c=(f,d)=>(f??0)+((d??f??0)-(f??0))*l,u=a.trailState&&h.trailState&&a.trailState.resourceId===h.trailState.resourceId?{...a.trailState,width:c(a.trailState.width,h.trailState.width),alpha:c(a.trailState.alpha,h.trailState.alpha),bones:a.trailState.bones.map((f,d)=>{const m=h.trailState.bones[d]||f;return{...f,worldX:c(f.worldX??f.x,m.worldX??m.x),worldY:c(f.worldY??f.y,m.worldY??m.y),worldRotation:c(f.worldRotation??-f.rotation,m.worldRotation??-m.rotation)}})}:a.trailState;return{...a,worldX:c(a.worldX,h.worldX),worldY:c(a.worldY,h.worldY),worldRotation:c(a.worldRotation,h.worldRotation),worldScaleX:c(a.worldScaleX,h.worldScaleX),worldScaleY:c(a.worldScaleY,h.worldScaleY),alpha:c(a.alpha,h.alpha),trailState:u}}function Sg(i,e){return!i||i==="跟随导出"?e.keyframeCurve:i==="贝塞尔"?"bezier":"linear"}function $r(i,e,t,s,n,r=new Set,o=n.keyframeCurve){if(!i.length)return[];const a=o==="bezier"&&n.spineVersion!=="3.8"?xx(i,s,r):{samples:yx(i,s,r),controls:[]},h=a.samples.map(l=>{const c={time:na(l.frame,e)};return t.forEach((u,f)=>{c[u]=Zt(l.values[f])}),c});for(let l=0;l0&&n&&e.add(t-1),s&&e.add(t))}return e}function aR(i){const e=new Set;for(let t=0;t0&&n&&e.add(t-1),s&&e.add(t))}return e}function lR(i,e){var s;if(!i.shapeEnabled||!((s=i.shapeCurve)!=null&&s.length))return 1;const t=[...i.shapeCurve].sort((n,r)=>n.x-r.x);if(e<=t[0].x)return Math.max(0,t[0].y);for(let n=1;n{r!==n&&(s.push(t(r,o)),n=r)}),s}function cR(i,e,t){const s=i.imageMode==="sequence"?i.sequenceFrames[e]:void 0,n=(s==null?void 0:s.name)||i.textureName||`image_${i.id}`,r=(s==null?void 0:s.texture)||i.texture,o=iR(r);(!o.width||!o.height)&&t.push({code:"missing-image",message:`图片“${n}”缺失或尺寸不可读,已保留路径。`});const a=o.width||1,h=o.height||1;return{path:wx(i.textureFolder,n),x:Zt((.5-i.anchorX)*a),y:Zt((i.anchorY-.5)*h),width:Zt(a),height:Zt(h)}}function uR(i,e,t,s,n=s.keyframeCurve){if(!i.length)return[];const r=new Set;for(let c=1;c({frame:u,values:c})),a=1/255,h=n==="bezier"&&s.spineVersion!=="3.8"?xx(o,[a,a,a,.01],r):{samples:yx(o,[a,a,a,.01],r),controls:[]},l=h.samples.map(c=>({time:na(c.frame,t),color:`${hl(c.values[0])}${hl(c.values[1])}${hl(c.values[2])}${hl(c.values[3])}`}));if(h.controls.length)for(let c=0;c({time:na(f,n),name:u??null}));h.length&&(a.attachment=h);const l=uR(s,t,n,r,o);l.length&&(a.rgba=l)}function dR(i){var m;const e=i.settings,t=Math.max(1,Number(i.timeline.fps)||30),s=Math.max(1,Math.round(e.fps||30)),n=e.integerFrameAlignment?s:t,r=[],o=i.systems.filter(g=>g.visible!==!1),a={skeleton:{hash:"",spine:e.spineVersion,x:0,y:0,width:0,height:0,images:e.imagesPath||"./images/"},bones:[{name:"root"}],slots:[],skins:[{name:"default",attachments:{}}],animations:{}};e.omitFps||(a.skeleton.fps=s);const h=a.skins[0].attachments,l=new Set(["root"]),c=[...new Set([...i.timeline.animations.length?i.timeline.animations:["animation"],...o.map(g=>g.animation||"animation")])],u=new Map;for(const g of o){const b=Math.min(((m=g.frames)==null?void 0:m.length)||0,sR(g,t)),_=(g.frames||[]).slice(0,b);_.length||r.push({code:"empty-cache",message:`“${g.config.name}”没有可用帧缓存。`});const M=bx(eR(g.config.name,`system_${g.id}`),l);a.bones.push({name:M,parent:"root"});const v=nR(_,e.bonePool,l),S=Math.max(0,(b-1)/t),y=Math.max(1,Math.ceil(S*n)+1),I=u.get(g.animation)||[];I.push({system:g,tracks:v,targetFrames:y}),u.set(g.animation,I);for(const E of v){a.bones.push({name:E.name,parent:M});const C=new Set(g.config.imageResources.map(F=>F.blend));for(const F of C){const D=`${E.name}_image_${F}`;a.slots.push({name:D,bone:E.name,color:"ffffff00",blend:yg[F]});const N=h[D]||(h[D]={});for(const j of g.config.imageResources.filter(O=>O.blend===F)){const O=j.imageMode==="sequence"?Math.max(1,j.sequenceFrames.length):1;for(let L=0;L{var X;return((X=P==null?void 0:P.trailState)==null?void 0:X.resourceId)===F.id}))continue;const D=Math.max(2,Math.min(16,Math.round(F.boneCount||3))),N=[];for(let P=0;Pa.bones.findIndex(X=>X.name===P)),L=wx("",F.textureName||`trail_${F.id}`);(h[j]||(h[j]={}))[`trail_${F.id}`]=QI(g.config,F,O,L),F.texture||r.push({code:"missing-image",message:`拖尾图片“${F.textureName||F.id}”缺失,已保留路径。`})}const R=`${E.name}_image_`,B=`${E.name}_trail_`,k=a.slots.filter(F=>String(F.name).startsWith(R)||String(F.name).startsWith(B));k.length&&(a.slots=a.slots.filter(F=>!k.includes(F)),a.slots.push(...k.filter(F=>String(F.name).startsWith(B)),...k.filter(F=>String(F.name).startsWith(R))))}}for(const g of c){const b=u.get(g)||[],_={bones:{},slots:{}};let M=!1;for(const{system:v,tracks:S,targetFrames:y}of b)for(const I of S){const E=Array.from({length:y},(U,Y)=>rR(I,Y,t,n)),C=E.map(U=>!!(U!=null&&U.active)),R=[],B=[],k=[];E.forEach((U,Y)=>{U!=null&&U.active&&(R.push({frame:Y,values:[U.worldX??U.x,U.worldY??U.y]}),B.push(U.worldRotation??U.rotation),k.push({frame:Y,values:[U.worldScaleX??U.scaleX,U.worldScaleY??U.scaleY]}))});const F=JI(B),D=R.map((U,Y)=>({frame:U.frame,values:[F[Y]??0]})),N=oR(E),j={},O=$r(R,n,["x","y"],[xg,xg],e,N),L=$r(D,n,["value"],[wg],e,N),P=$r(k,n,["x","y"],[ll,ll],e,N);O.length&&(j.translate=O),L.length&&(j.rotate=L),P.length&&(j.scale=P),Object.keys(j).length&&(_.bones[I.name]=j,M=!0);const X=new Set(v.config.imageResources.map(U=>U.blend));for(const U of X){const Y=[],q=[];let z=16777215;for(let ae=0;aeve.id===me.resourceId):void 0,te=!!me&&C[ae]&&me.imageVisible!==!1&&(_e==null?void 0:_e.blend)===U;me&&(_e==null?void 0:_e.blend)===U&&(z=me.colorHex),Y.push(te?`image_${_e.id}_${me.imageFrameIndex??0}`:null),q.push(_g(z,te?me.alpha:0))}const H=v.config.imageResources.filter(ae=>ae.blend===U).filter(ae=>ae.independentAlpha==="curve").map(ae=>Sg(ae.alphaCurveMode,e)),Z=H.length?H.includes("bezier")?"bezier":"linear":Sg(v.config.alphaMode==="curve"?v.config.curveMode:void 0,e);Tg(_,`${I.name}_image_${U}`,Y,q,n,e,Z),Y.some(Boolean)&&(M=!0)}if(v.config.trail)for(const U of v.config.trailResources){const Y=Math.max(2,Math.min(16,Math.round(U.boneCount||3))),q=E.map(ve=>{var $;return(($=ve==null?void 0:ve.trailState)==null?void 0:$.resourceId)===U.id?ve.trailState:void 0}),z=q.find(ve=>!!ve);if(!z)continue;const ne=aR(q),H=U.widthSizeMode==="random"?Math.max(1,Number(U.widthMin)||0,Number(U.widthMax)||0):Math.max(.001,Number(U.width)||100);let Z=z;const ae=q.map(ve=>(ve&&(Z=ve),Z));for(let ve=0;ve{const Be=De==null?void 0:De.bones[Math.min(De.bones.length-1,ve)];if(!Be)return;const Ke={x:Be.worldX??Be.x,y:Be.worldY??Be.y,rotation:Be.worldRotation??-Be.rotation};$.push({frame:Ie,values:[Ke.x,Ke.y]}),W.push({frame:Ie,values:[Ke.rotation]}),J.push({frame:Ie,values:[1,Math.max(0,De.width/H)*ie]})});const ue=`${I.name}_trail_${U.id}_${ve}`,Se={},Me=$r($,n,["x","y"],[bg,bg],e,Q),Ee=$r(W,n,["value"],[wg],e,Q),de=$r(J,n,["x","y"],[ll,ll],e,Q);Me.length&&(Se.translate=Me),Ee.length&&(Se.rotate=Ee),de.length&&(Se.scale=de),Object.keys(Se).length&&(_.bones[ue]=Se)}const me=q.map(()=>`trail_${U.id}`);let _e=z.colorHex;const te=q.map(ve=>(ve&&(_e=ve.colorHex),_g(_e,ve?ve.alpha:0)));Tg(_,`${I.name}_trail_${U.id}`,me,te,n,e),M=!0}}(M||!e.excludeEmptyAnimations)&&(a.animations[g]=_)}!Object.keys(a.animations).length&&!e.excludeEmptyAnimations&&(a.animations.animation={bones:{},slots:{}});const f=e.spineVersion==="3.8"?zI(a):a,d=JSON.stringify(f,null,2);return{json:f,text:d,warnings:r,particleSystemCount:o.length,animationCount:Object.keys(f.animations).length,boneCount:f.bones.length}}function fR(i,e){const t=new Blob([i.text],{type:"application/json;charset=utf-8"}),s=URL.createObjectURL(t),n=document.createElement("a");n.href=s,n.download=/\.json$/i.test(e)?e:`${e||"SpineParticle"}.json`,n.style.display="none",document.body.appendChild(n),n.click(),n.remove(),setTimeout(()=>URL.revokeObjectURL(s),1e3)}class pR{newRegionAttachment(e,t,s,n){return new yo(t,s)}newMeshAttachment(e,t,s,n){return new Zn(t,s)}newBoundingBoxAttachment(e,t){return new Dh(t)}newPathAttachment(e,t){return new Er(t)}newPointAttachment(e,t){return new Nh(t)}newClippingAttachment(e,t){return new zn(t)}}const mR=new Set(["normal","onlyTranslation","noRotationOrReflection","noScale","noScaleOrReflection"]);function gR(i,e,t){const s=i.uvs,n=i.vertices,r=i.triangles;if(!Array.isArray(s)||!s.length||s.length%2)throw new Error(`拖尾网格“${e}”的 UV 数据无效`);if(!Array.isArray(n)||!n.length)throw new Error(`拖尾网格“${e}”缺少顶点数据`);const o=s.length/2;if(!Array.isArray(r)||r.some(c=>!Number.isInteger(c)||c<0||c>=o))throw new Error(`拖尾网格“${e}”的三角形索引越界`);const a=Number(i.hull)||0;if(!Number.isInteger(a)||a<0||a>o)throw new Error(`拖尾网格“${e}”的外轮廓数量无效`);if(Array.isArray(i.edges)&&i.edges.some(c=>!Number.isInteger(c)||c<0||c>=o*2||c%2))throw new Error(`拖尾网格“${e}”的外轮廓边索引越界`);if(n.length===s.length)return;let h=0,l=0;for(;h=t)throw new Error(`拖尾网格“${e}”引用了不存在的骨骼`);if(![m,g,b].every(Number.isFinite)||b<0)throw new Error(`拖尾网格“${e}”包含无效权重数据`);u+=b}if(Math.abs(u-1)>.001)throw new Error(`拖尾网格“${e}”的顶点权重之和不为 1`);l++}if(h!==n.length||l!==o)throw new Error(`拖尾网格“${e}”的顶点数量与 UV 不一致`)}function vR(i,e){var r,o,a,h;const t=Array.isArray(i.bones)?i.bones:[],s=new Map(t.map(l=>[String(l.name||""),l])),n=new Set;for(const l of t){if(l.inherit!=null&&!mR.has(l.inherit))throw new Error(`骨骼“${l.name||""}”的 inherit 值“${l.inherit}”不符合 Spine ${e} JSON 格式`);if(/_particle_\d+_trail_/.test(String(l.name||""))){const c=s.get(String(l.parent||""));if(!c||/_particle_\d+_trail_/.test(String(c.name||"")))throw new Error(`拖尾骨骼“${l.name||""}”必须直接挂在粒子系统骨骼下,不能组成骨骼链`)}}for(const l of Array.isArray(i.skins)?i.skins:[]){const c=(l==null?void 0:l.attachments)||{};for(const u of Object.keys(c))for(const f of Object.keys(c[u]||{})){const d=c[u][f];(d==null?void 0:d.type)==="mesh"&&(gR(d,f,t.length),((r=d.vertices)==null?void 0:r.length)!==((o=d.uvs)==null?void 0:o.length)&&n.add(u))}}for(const l of Object.values(i.animations||{}))for(const c of n){const u=(h=(a=l==null?void 0:l.slots)==null?void 0:a[c])==null?void 0:h.attachment;if(Array.isArray(u)&&u.some(f=>!(f!=null&&f.name)))throw new Error(`加权拖尾插槽“${c}”不能使用空附件,未出现或死亡阶段应将对应骨骼缩放设为 0`)}}function yR(i){var e;if(String(((e=i==null?void 0:i.skeleton)==null?void 0:e.spine)||"")!=="3.8")throw new Error("Spine 3.8 导出的版本标识必须为 3.8");for(const t of i.bones||[])if(t.inherit!=null)throw new Error(`Spine 3.8 骨骼“${t.name||""}”应使用 transform,不能使用 inherit`);for(const t of Object.values(i.animations||{})){for(const n of Object.values(t.slots||{})){if(n.rgba||n.rgba2)throw new Error("Spine 3.8 插槽颜色时间轴必须使用 color / twoColor");for(const r of n.attachment||[])if(!Object.prototype.hasOwnProperty.call(r,"name"))throw new Error("Spine 3.8 附件时间轴的隐藏帧必须显式写入 name: null")}for(const n of Object.values(t.bones||{}))for(const r of n.rotate||[])if(r.value!=null||r.angle==null)throw new Error("Spine 3.8 旋转时间轴必须使用 angle");const s=[t];for(;s.length;){const n=s.pop();if(!(!n||typeof n!="object")){if(!Array.isArray(n)&&Array.isArray(n.curve))throw new Error("Spine 3.8 不支持 4.x 数组曲线格式");s.push(...Object.values(n))}}}}function xR(i,e){var a;const t=JSON.parse(i),s=Wl((a=t==null?void 0:t.skeleton)==null?void 0:a.spine);if(!s)throw new Error(`导出版本不受支持,仅支持 Spine ${Sd()}`);if(e&&s!==e)throw new Error(`导出版本不一致:设置为 Spine ${e},JSON 标记为 Spine ${s}`);vR(t,s),s==="3.8"&&yR(t);const n=s==="3.8"?ax(JSON.parse(JSON.stringify(t))):t,o=new ih(new pR).readSkeletonData(n);if(!o.bones.length)throw new Error("导出结果缺少骨骼");return{version:s,bones:o.bones.length,slots:o.slots.length,animations:o.animations.length}}const bR={class:"panel"},wR={class:"panel-scroll"},_R={class:"group config-management"},SR={class:"caret"},TR={class:"group-body config-management-body"},MR={class:"config-toolbar"},ER=["disabled"],AR={value:""},CR=["value"],IR={class:"group"},RR={class:"caret"},PR={class:"scene-actions"},kR=["disabled"],FR={class:"group-body"},OR={class:"tree scene-tree"},BR=["onClick"],LR={class:"tlabel"},DR=["title","aria-label","onClick"],NR={viewBox:"0 0 24 24","aria-hidden":"true"},UR={key:0,class:"eye-slash",d:"M4 4l16 16"},VR=["onClick"],XR=["onClick"],YR={class:"tlabel"},$R=["title","aria-label","onClick"],GR={viewBox:"0 0 24 24","aria-hidden":"true"},jR={key:0,class:"eye-slash",d:"M4 4l16 16"},HR=["onClick"],WR=["onClick"],zR={class:"tlabel"},qR=["title","aria-label","onClick"],KR={viewBox:"0 0 24 24","aria-hidden":"true"},ZR={key:0,class:"eye-slash",d:"M4 4l16 16"},JR=["onClick"],QR=["onClick"],eP={class:"tlabel"},tP=["title","aria-label","onClick"],iP={viewBox:"0 0 24 24","aria-hidden":"true"},sP={key:0,class:"eye-slash",d:"M4 4l16 16"},nP=["onClick"],rP={key:0,class:"empty"},oP={class:"row"},aP={class:"seed-row scene-seed"},lP={class:"field-block"},hP={class:"field-block"},cP={class:"tag-editor"},uP=["onClick"],dP={class:"field-grid"},fP={class:"field-block"},pP={class:"field-block check-field"},mP={class:"field-grid"},gP={class:"compact-field"},vP={class:"compact-field"},yP={class:"field-grid"},xP={class:"compact-field"},bP={class:"compact-field"},wP={key:1,class:"field-grid"},_P={class:"compact-field"},SP={class:"compact-field"},TP={key:2,class:"field-grid"},MP={class:"compact-field"},EP={class:"compact-field"},AP={class:"field-block"},CP={key:4,class:"field-grid"},IP={class:"compact-field"},RP={class:"compact-field"},PP={class:"collider-follow-section"},kP={class:"follow-path"},FP={class:"field-block"},OP=["value"],BP={class:"field-grid"},LP={class:"compact-field"},DP={class:"compact-field"},NP={class:"follow-path"},UP={class:"field-block"},VP={class:"field-grid"},XP={class:"compact-field"},YP={class:"compact-field"},$P={class:"field-grid"},GP={class:"compact-field"},jP={class:"compact-field"},HP={class:"setting-line"},WP={class:"setting-line"},zP={class:"field-block"},qP={key:4,class:"panel-hint"},KP={class:"group"},ZP={class:"caret"},JP={class:"group-body"},QP={class:"segs"},ek={class:"segs stream-behavior-segs"},tk={key:2,class:"stream-loop-options"},ik={class:"switch-row"},sk=["checked"],nk={class:"switch-row"},rk=["checked"],ok={key:3,class:"modifier-hint stream-loop-hint"},ak={class:"group"},lk={class:"caret"},hk={class:"group-body"},ck={class:"row"},uk={class:"group"},dk={class:"caret"},fk={class:"group-body attr-body"},pk={class:"attr-axis-head"},mk={class:"axis-modes"},gk={class:"life-item"},vk={class:"switch-row"},yk={class:"life-item"},xk={class:"switch-row"},bk={class:"axis-modes life-axis"},wk={class:"life-item"},_k={class:"switch-row"},Sk={class:"group"},Tk={class:"caret"},Mk={class:"group-body"},Ek={class:"seg"},Ak={class:"row"},Ck={class:"curve-wrap"},Ik={class:"row"},Rk=["onUpdate:modelValue"],Pk=["onUpdate:modelValue"],kk={class:"row resource-color-row"},Fk=["onUpdate:modelValue"],Ok=["onUpdate:modelValue"],Bk={key:0,class:"row resource-color-picker"},Lk=["onUpdate:modelValue"],Dk=["value","onChange","onKeydown"],Nk={class:"resource-alpha-head"},Uk={class:"alpha-modes"},Vk=["onClick"],Xk=["onClick"],Yk=["onClick"],$k={class:"row"},Gk=["onUpdate:modelValue"],jk={class:"resource-alpha-curve"},Hk={class:"group"},Wk={class:"caret"},zk={class:"group-body"},qk={class:"modifier-item"},Kk={class:"switch-row modifier-switch"},Zk={key:0,class:"modifier-params"},Jk={class:"modifier-item"},Qk={class:"switch-row modifier-switch"},eF={key:0,class:"modifier-params gravity-params"},tF={class:"modifier-mode-row"},iF={class:"modifier-item"},sF={class:"switch-row modifier-switch"},nF={key:0,class:"modifier-params gravity-params"},rF={class:"modifier-mode-row"},oF={class:"modifier-item"},aF={class:"switch-row modifier-switch"},lF={key:0,class:"modifier-params"},hF={class:"row"},cF={class:"modifier-item"},uF={class:"switch-row modifier-switch"},dF={key:0,class:"modifier-params"},fF={class:"row"},pF={class:"row"},mF={class:"modifier-item"},gF={class:"switch-row modifier-switch"},vF={key:0,class:"modifier-params trail-params"},yF={class:"row"},xF=["onUpdate:modelValue"],bF={class:"row"},wF=["onUpdate:modelValue"],_F={class:"row"},SF=["onUpdate:modelValue"],TF={class:"switch-row trail-sub-switch"},MF=["onUpdate:modelValue"],EF={class:"switch-row trail-sub-switch"},AF=["onUpdate:modelValue"],CF={class:"trail-mode-head"},IF={class:"alpha-modes"},RF=["onClick"],PF=["onClick"],kF=["onClick"],FF={class:"row"},OF=["onUpdate:modelValue"],BF={key:6,class:"row trail-fixed-color"},LF=["onUpdate:modelValue"],DF=["value","onChange","onKeydown"],NF={class:"trail-mode-head"},UF={class:"alpha-modes"},VF=["onClick"],XF=["onClick"],YF=["onClick"],$F={class:"trail-grid-row"},GF={class:"modifier-item"},jF={class:"switch-row modifier-switch"},HF=["disabled"],WF={key:0,class:"modifier-params emitter-follow-params"},zF={class:"field-block"},qF=["value"],KF={key:0,value:"bone"},ZF={class:"field-block"},JF=["value"],QF={class:"field-block"},eO={class:"field-grid follow-grid"},tO={class:"compact-field"},iO={class:"compact-field"},sO={class:"field-block"},nO={key:0,class:"bone-follow-target"},rO={key:1,class:"bone-follow-missing"},oO={class:"field-block"},aO={class:"field-grid follow-grid"},lO={class:"compact-field"},hO={class:"compact-field"},cO={class:"bone-follow-transform-grid"},uO={class:"compact-field"},dO={class:"compact-field"},fO={class:"compact-field"},pO={class:"group"},mO={class:"caret"},gO={class:"group-body export-settings"},vO={class:"export-field"},yO={class:"export-field"},xO={class:"export-field"},bO={key:0,class:"export-help"},wO={class:"export-fps-row"},_O={class:"export-field export-fps-field"},SO={class:"export-checkbox"},TO={class:"export-switches"},MO={class:"switch-row export-switch"},EO={class:"switch-row export-switch"},AO={class:"switch-row export-switch export-switch-last"},CO=["disabled","title"],IO=Ws({__name:"ParticlePanel",setup(i){const e=Aa();e.settings.exportSettings=gy(e.settings.exportSettings);const t=ut(()=>e.settings.exportSettings),s=it(null),n=it(""),r=it([]),o=it(!1),a=it(""),h=it(!1),l=it(!1),c=it(""),u=it(!1);function f(T){return T==="跟随导出"?t.value.keyframeCurve==="bezier"?"bezier":"linear":T==="贝塞尔"?"bezier":"linear"}e.systems.length||e.addSystem();function d(){dx(e),h.value=!1,a.value="配置已保存到本地"}async function m(T){var V;const p=T.target,x=(V=p.files)==null?void 0:V[0];if(x){a.value="正在加载配置…",h.value=!1;try{await oC(e,x),a.value=`已加载:${x.name}`}catch(K){h.value=!0,a.value=K instanceof Error?K.message:String(K)}finally{p.value=""}}}async function g(){try{const T=await fetch(`/Preset/index.json?t=${Date.now()}`,{cache:"no-store"});if(!T.ok)throw new Error("无法读取预设列表");const p=await T.json();r.value=Array.isArray(p)?p.filter(x=>!!x&&typeof x.name=="string"&&typeof x.file=="string"):[]}catch{r.value=[]}}async function b(){const T=n.value;if(T){o.value=!0,h.value=!1,a.value="正在加载预设…";try{const p=await fetch(`/Preset/${encodeURIComponent(T)}`,{cache:"no-store"});if(!p.ok)throw new Error(`无法读取预设:${T}`);await px(e,await p.text()),a.value=`已加载预设:${T.replace(/\.json$/i,"")}`}catch(p){h.value=!0;const x=p instanceof Error?p.message:String(p);a.value=`${x},请检查预设文件命名`}finally{o.value=!1,n.value=""}}}_o(g);function _(){return new Promise(T=>requestAnimationFrame(()=>T()))}async function M(){e.timeline.playing=!1,e.timeline.frame=0,e.timeline.recorded=!1;for(const x of e.systems)x.frames=void 0;e.recalcTotalFrames(),await _(),e.timeline.playing=!0;const T=e.timeline.totalFrames/Math.max(1,e.timeline.fps)*1e3,p=performance.now()+Math.max(8e3,T*2.5+3e3);for(;!e.timeline.recorded;){if(performance.now()>p)throw new Error("重新计算动画超时,请确认页面仍在运行后重试");await new Promise(x=>setTimeout(x,50))}}async function v(){if(!l.value){l.value=!0,u.value=!1,c.value="正在重新计算粒子动画…";try{await M();const T=dR({systems:e.systems,timeline:e.timeline,settings:t.value});xR(T.text,t.value.spineVersion),fR(T,t.value.fileName);const p=T.warnings.length?`;${T.warnings.length} 条资源提示(缺图仍已导出)`:"";c.value=`已导出 Spine ${t.value.spineVersion}:${T.particleSystemCount} 个粒子系统、${T.animationCount} 个动画、${T.boneCount} 根骨骼${p}`}catch(T){u.value=!0,c.value=T instanceof Error?T.message:String(T)}finally{l.value=!1}}}const S=ut(()=>{const T=e.systems.findIndex(p=>p.id===e.activeId);return T>=0?T:0}),y=ut(()=>e.systems[S.value]||null),I=ut(()=>{var p;const T=(p=y.value)==null?void 0:p.config;return T?Math.max(1,Math.ceil(Number(T.loopDurationFrames)||1)):1}),E=ut(()=>e.activeObjectType),C=ut(()=>e.activeObjectType==="collision"&&e.colliders.find(T=>T.id===e.activeObjectId)||null),R=ut(()=>e.activeObjectType==="path"&&e.paths.find(T=>T.id===e.activeObjectId)||null),B=ut(()=>e.activeObjectType==="spine"&&e.spines.find(T=>T.id===e.activeObjectId)||null),k=ut(()=>e.activeObjectType==="particle"?e.systems.some(T=>T.id===e.activeObjectId):e.activeObjectType==="collision"?e.colliders.some(T=>T.id===e.activeObjectId):e.activeObjectType==="path"?e.paths.some(T=>T.id===e.activeObjectId):e.spines.some(T=>T.id===e.activeObjectId)),F=ut(()=>{const T=e.spines.find(p=>p.selectedBone&&p.bones.some(x=>x.name===p.selectedBone));return T?{spine:T,boneName:T.selectedBone}:null}),D=ut(()=>{var x;const T=(x=y.value)==null?void 0:x.config;if(!T||T.emitterFollowMode!=="bone")return null;const p=e.spines.find(V=>V.id===T.emitterFollowSpineId);return!p||!p.bones.some(V=>V.name===T.emitterFollowBoneName)?null:{spine:p,boneName:T.emitterFollowBoneName}});No(()=>{for(const T of e.systems)T.visible==null&&(T.visible=!0);for(const T of e.colliders)T.visible==null&&(T.visible=!0);for(const T of e.paths)T.visible==null&&(T.visible=!0);for(const T of e.spines)T.visible==null&&(T.visible=!0)}),No(()=>{if(!y.value)return;const T=Tr(y.value.config);T.lifeMode==="curve"&&(T.lifeMode="random"),T.speedMode==="curve"&&(T.speedMode="random"),T.scaleMode==="curve"&&(T.scaleMode="random"),T.initialRotationMode==="curve"&&(T.initialRotationMode="random"),T.mode==="stream"&&!(T.duration>0)&&(T.duration=1),T.streamBehavior==="loop"&&(T.emitterFollow||T.emitterFollowMode!=="none")&&ne(T)}),No(()=>{for(const T of e.systems){const p=Tr(T.config);if(p.emitterFollowMode!=="bone")continue;const x=e.spines.find(K=>K.id===p.emitterFollowSpineId);!!(x!=null&&x.bones.some(K=>K.name===p.emitterFollowBoneName))||(p.emitterFollowMode="none",p.emitterFollowSpineId=0,p.emitterFollowBoneName="")}}),No(()=>{for(const T of e.colliders)T.followPathId==null&&(T.followPathId=0),T.followDuration>0||(T.followDuration=2),T.followPathRotation==null&&(T.followPathRotation=!1),["跟随导出","线性","贝塞尔"].includes(T.followCurveMode)||(T.followCurveMode="跟随导出"),(!Array.isArray(T.followCurve)||T.followCurve.length<2)&&(T.followCurve=[{x:0,y:0},{x:1,y:1}])});const N=[{x:0,y:0},{x:1,y:1}],j=[{x:0,y:1},{x:1,y:1}],O=[{x:0,y:0},{x:.2,y:1},{x:.8,y:1},{x:1,y:0}],L=[{x:0,y:0},{x:.1,y:1},{x:.9,y:1},{x:1,y:0}],P=[{x:0,y:1},{x:1,y:1}],X=[{x:0,y:1},{x:1,y:1}],U=wo({config:!0,scene:!1,emitMode:!0,shape:!0,attr:!0,look:!0,mods:!0,export:!1});function Y(T){U[T]=!U[T]}function q(T){var x;const p=(x=y.value)==null?void 0:x.config;p&&(p.mode=T,T==="stream"&&!(p.duration>0)&&(p.duration=1))}function z(T){var V;const p=(V=y.value)==null?void 0:V.config;if(!p)return;const x=Math.min(1800,Math.max(1,Math.ceil(Number(T)||1)));p.loopDurationFrames=x}function ne(T){const p=ga();T.emitterFollow=!1,T.emitterFollowMode="none",T.emitterFollowPathId=p.emitterFollowPathId,T.emitterFollowSpineId=p.emitterFollowSpineId,T.emitterFollowBoneName=p.emitterFollowBoneName,T.emitterFollowBoneOffsetX=p.emitterFollowBoneOffsetX,T.emitterFollowBoneOffsetY=p.emitterFollowBoneOffsetY,T.emitterFollowBoneRotation=p.emitterFollowBoneRotation,T.emitterFollowBoneScaleX=p.emitterFollowBoneScaleX,T.emitterFollowBoneScaleY=p.emitterFollowBoneScaleY,T.emitterAngleMode=p.emitterAngleMode,T.emitterFollowCurve=p.emitterFollowCurve.map(x=>({...x})),T.emitterFollowDuration=p.emitterFollowDuration,T.emitterFollowSpace=p.emitterFollowSpace,T.emitterFollowDirection=p.emitterFollowDirection,T.emitterFollowOffset=p.emitterFollowOffset}function H(T){var K;const p=(K=y.value)==null?void 0:K.config;if(!p||p.streamBehavior===T)return;const x=T==="loop",V=x?"进入循环持续模式后,粒子跟随设置会失效并恢复默认值。是否继续?":"退出循环持续模式后,粒子跟随设置会失效并恢复默认值。是否继续?";window.confirm(V)&&(ne(p),p.streamBehavior=T,x||(p.generateLoopStartAnimation=!1,p.generateLoopEndAnimation=!1))}function Z(T,p){var K;const x=(K=y.value)==null?void 0:K.config;if(!x)return;const V=p.target.checked;T==="start"?(x.generateLoopStartAnimation=V,V&&(x.generateLoopEndAnimation=!1)):(x.generateLoopEndAnimation=V,V&&(x.generateLoopStartAnimation=!1))}function ae(T,p){const x=T.target.value;if(p.emitterFollowMode=x,x!=="bone"){p.emitterFollowSpineId=0,p.emitterFollowBoneName="";return}me(p)}function me(T){const p=F.value;if(!p){T.emitterFollowMode="none",T.emitterFollowSpineId=0,T.emitterFollowBoneName="";return}T.emitterFollowMode="bone",T.emitterFollowSpineId=p.spine.id,T.emitterFollowBoneName=p.boneName}const _e={emitMode:["mode","rate","streamBehavior","loopDurationFrames","generateLoopStartAnimation","generateLoopEndAnimation","burstCount","burstLoop","delay","duration"],shape:["shape","radius","rectW","rectH","direction","spread","coneAngle"],attr:["lifeMin","lifeMax","lifeMode","lifeCurve","speedMin","speedMax","speedMode","speedCurve","scaleMin","scaleMax","scaleMode","scaleAxisMode","scaleYMin","scaleYMax","scaleCurve","scaleYCurve","scaleEndRatio","initialRotationMode","initialRotationMin","initialRotationMax","initialRotationCurve","rotationSpeedMin","rotationSpeedMax","speedOverLifeEnabled","speedOverLifeMode","speedOverLifeMin","speedOverLifeMax","speedOverLifeCurve","scaleOverLifeEnabled","scaleOverLifeMode","scaleOverLifeAxisMode","scaleOverLifeMin","scaleOverLifeMax","scaleYOverLifeMin","scaleYOverLifeMax","scaleOverLifeCurve","scaleYOverLifeCurve","rotationOverLifeEnabled","rotationOverLifeMode","rotationOverLifeCurve"],look:["texture","imageResources","imageWeightVersion","alpha","alphaEnd","colorStart","colorEnd","colorOverLife","blend","alphaMode","curveMode","alphaCurve","textureName","textureFolder","alphaScale","anchorX","anchorY","independentAlpha"],mods:["noise","noiseAmt","noiseRange","noiseSpeed","useGravity","gravity","gravityMode","gravityMin","gravityMax","gravityDirection","gravityCurve","wind","windX","windY","windMode","windMin","windMax","windDirection","windCurve","forceField","forceStrength","forceRadius","forceCenterX","forceCenterY","forceFalloff","attraction","attractionCenterX","attractionCenterY","attractionRadius","attractionDuration","attractionDelay","attractionDelayMode","attractionPath","trail","trailConfigVersion","trailResources","trailResourceVersion","trailTexture","trailTextureName","trailPreviewUrl","trailColorMode","trailColor","trailColorGradient","trailAlphaMode","trailAlpha","trailAlphaCurve","trailBoneCount","trailLength","trailWidth","trailWidthMode","trailLifeLengthEnabled","trailLifeLengthCurve","trailShapeEnabled","trailShapeCurve","trailGridRows","trailGridCols","collision","pathFollow","emitterFollow","emitterFollowMode","emitterFollowPathId","emitterFollowSpineId","emitterFollowBoneName","emitterFollowBoneOffsetX","emitterFollowBoneOffsetY","emitterFollowBoneRotation","emitterFollowBoneScaleX","emitterFollowBoneScaleY","emitterAngleMode","emitterFollowCurve","emitterFollowDuration","emitterFollowSpace","emitterFollowDirection","emitterFollowOffset","damping"]};function te(T){var V;const p=(V=y.value)==null?void 0:V.config;if(T==="export"){e.settings.exportSettings=uf();return}if(!p)return;const x=ga();for(const K of _e[T])p[K]=x[K]}function ve(){t.value.fps=Math.min(240,Math.max(1,Math.round(Number(t.value.fps)||30)))}function $(T){var p;e.selectSystem(((p=e.systems[T])==null?void 0:p.id)??0)}function W(){e.addSystem()}function J(){e.addCollider()}function Q(){e.addPath()}function ie(){e.addSpine()}function ue(){e.duplicateSelectedObject()}function Se(){const T=C.value;if(!T)return;let p=T.tags.length+1,x=`Tag ${p}`;for(;T.tags.includes(x);)x=`Tag ${++p}`;T.tags.push(x),T.selectedTag=x}function Me(T,p,x=0,V=0,K=0,oe=0){return{x:T,y:p,inX:x,inY:V,outX:K,outY:oe}}function Ee(){const T=R.value;if(!(!T||!T.preset))if(T.preset==="circle"){const x=60.751328;T.points=[Me(110,0,0,-x,0,x),Me(0,110,x,0,-x,0),Me(-110,0,0,x,0,-x),Me(0,-110,-x,0,x,0)],T.closed=!0}else if(T.preset==="square")T.points=[Me(-100,-100),Me(100,-100),Me(100,100),Me(-100,100)],T.closed=!0;else{const p=T.preset==="star"?10:6;T.points=Array.from({length:p},(x,V)=>{const K=T.preset==="star"&&V%2?50:110,oe=-Math.PI*.5+V/p*Math.PI*2;return Me(Math.cos(oe)*K,Math.sin(oe)*K)}),T.closed=!0}}function de(){R.value&&(R.value.points=[])}function De(){y.value&&(y.value.config.seed=Math.floor(Math.random()*999999)+1)}function Ie(T){var x;const p=(x=y.value)==null?void 0:x.config;!p||T==="direction"||(p.speedOverLifeMode=T,T==="curve"&&p.speedOverLifeMin===p.speedOverLifeMax&&(p.speedOverLifeMin=0,p.speedOverLifeMax=1))}function Be(){var p;const T=(p=y.value)==null?void 0:p.config;!T||T.scaleOverLifeMode!=="curve"||(T.scaleOverLifeMin===T.scaleOverLifeMax&&(T.scaleOverLifeMin=0,T.scaleOverLifeMax=1),T.scaleYOverLifeMin===T.scaleYOverLifeMax&&(T.scaleYOverLifeMin=0,T.scaleYOverLifeMax=1))}function Ke(T){var x;const p=(x=y.value)==null?void 0:x.config;!p||T==="direction"||(p.scaleOverLifeMode=T,Be())}const ct={point:{direction:0,spread:360},circle:{radius:100,direction:-90,spread:0},rect:{rectW:200,rectH:100,direction:-90,spread:0},cone:{radius:100,coneAngle:90,direction:90},orbit:{}};function wt(){var x;const T=(x=y.value)==null?void 0:x.config;if(!T)return;const p=ct[T.shape];p&&Object.assign(T,p)}const dt=it(null),Mt=it(null),Ct=it(null),ai=it(null),Jt=it(null);function Zi(){var x;const T=(x=y.value)==null?void 0:x.config;if(!T)return;const p=Math.max(0,...T.trailResources.map(V=>V.id))+1;T.trailResources.push({id:p,texture:null,textureName:"trail",previewUrl:"/images/trail.png",weight:100,locked:!1,rotation:0,colorMode:"particle",color:"#ffffff",colorGradient:[{position:0,color:"#ffffff"},{position:1,color:"#ffffff"}],blend:"normal",alphaMode:"particle",alpha:1,alphaCurve:P.map(V=>({...V})),boneCount:3,trailRatio:100,lengthMode:"fixed",length:100,lengthMin:100,lengthMax:100,widthSizeMode:"fixed",width:100,widthMin:100,widthMax:100,widthMode:"particle",lifeLengthEnabled:!1,lifeLengthCurve:j.map(V=>({...V})),shapeEnabled:!1,shapeCurve:X.map(V=>({...V}))}),nt()}function xs(T){var p;Jt.value=T,(p=ai.value)==null||p.click()}function $t(T,p){var K;const x=(K=y.value)==null?void 0:K.config;if(!x)return;const V=T==="trailGridCols"?32:16;x[T]=Math.min(V,Math.max(2,Math.round(Number(p)||2)))}function re(T,p){var V;const x=(V=y.value)==null?void 0:V.config.trailResources.find(K=>K.id===T);x&&(x.boneCount=Math.min(16,Math.max(2,Math.round(Number(p)||2))))}function le(T,p){var V;const x=(V=y.value)==null?void 0:V.config.trailResources.find(K=>K.id===T);x&&(x.rotation=Math.max(-360,Math.min(360,Number(p)||0)))}async function ft(T){var pe,he;const p=T.target,x=(pe=p.files)==null?void 0:pe[0],V=(he=y.value)==null?void 0:he.config,K=V==null?void 0:V.trailResources.find(be=>be.id===Jt.value);if(!x||!K){p.value="";return}const oe=await Mn(x);K.texture=$n(await et.fromURL(oe)),K.previewUrl=oe,K.textureName=x.name.replace(/\.[^.]+$/,"")||"trail",p.value="",Jt.value=null}async function It(T){var V;const p=(V=y.value)==null?void 0:V.config,x=p==null?void 0:p.trailResources.find(K=>K.id===T);x&&(x.texture=$n(await et.fromURL("/images/trail.png")),x.previewUrl="/images/trail.png",x.textureName="trail",x.weight=100,x.locked=!1,x.rotation=0,x.boneCount=3,x.trailRatio=100,x.lengthMode="fixed",x.length=100,x.lengthMin=100,x.lengthMax=100,x.widthSizeMode="fixed",x.width=100,x.widthMin=100,x.widthMax=100,x.widthMode="particle",x.lifeLengthEnabled=!1,x.lifeLengthCurve=j.map(K=>({...K})),x.shapeEnabled=!1,x.shapeCurve=X.map(K=>({...K})),x.colorMode="particle",x.color="#ffffff",x.colorGradient=[{position:0,color:"#ffffff"},{position:1,color:"#ffffff"}],x.blend="normal",x.alphaMode="particle",x.alpha=1,x.alphaCurve=P.map(K=>({...K})),nt())}function Pt(T){var V;const p=(V=y.value)==null?void 0:V.config.trailResources;if(!p||p.length<=1)return;const x=p.findIndex(K=>K.id===T);x>=0&&p.splice(x,1),nt()}function nt(){var K;const T=(K=y.value)==null?void 0:K.config.trailResources;if(!(T!=null&&T.length))return;if(T.length===1){T[0].weight=100,T[0].locked=!1;return}const p=T.filter(oe=>oe.locked),x=T.filter(oe=>!oe.locked);let V=p.reduce((oe,pe)=>oe+Math.max(0,Number(pe.weight)||0),0);V>100&&(Qi(p,100,!0),V=100),Qi(x,100-V)}function $i(T,p){var he;const x=(he=y.value)==null?void 0:he.config.trailResources;if(!(x!=null&&x.length))return;if(x.length===1){x[0].weight=100,x[0].locked=!1;return}const V=x.find(be=>be.id===T);if(!V||V.locked)return;const K=x.filter(be=>be.id!==T&&be.locked).reduce((be,fe)=>be+Math.max(0,Number(fe.weight)||0),0),oe=Math.max(0,100-K),pe=x.filter(be=>be.id!==T&&!be.locked);V.weight=Bi(Math.min(oe,Math.max(0,Number(p)||0))),pe.length?Qi(pe,oe-V.weight,!0):V.weight=Bi(oe)}function Ji(T){var V;const p=(V=y.value)==null?void 0:V.config.trailResources;if(!p||p.length===1)return;const x=p.find(K=>K.id===T);x&&(x.locked=!x.locked)}function li(T,p){const x=p.target;T.color=En(x.value,T.color),x.value=T.color}function Gi(T,p){li(T,p),p.target.blur()}function er(){var x;const T=(x=y.value)==null?void 0:x.config;if(!T)return;const p=Math.max(0,...T.imageResources.map(V=>V.id))+1;T.imageResources.push({id:p,texture:T.texture,textureName:"star",textureFolder:"",previewUrl:"/images/star.png",imageMode:"fixed",sequencePlayback:"loop-forward",sequenceFps:30,sequenceFrames:[],weight:100,locked:!1,scale:1,anchorX:.5,anchorY:.5,colorMode:"fixed",colorStart:"#ffffff",colorEnd:"#ff4d4d",colorGradient:[{position:0,color:"#ffffff"},{position:1,color:"#ff4d4d"}],blend:"normal",independentAlpha:"off",alpha:1,alphaCurveMode:"跟随导出",alphaCurve:L.map(V=>({...V}))}),ws()}function Oi(T){var p;Ct.value=T,(p=dt.value)==null||p.click()}function Qt(T){var p;Ct.value=T,(p=Mt.value)==null||p.click()}async function Pr(T){var he,be;const p=T.target,x=(he=p.files)==null?void 0:he[0],V=(be=y.value)==null?void 0:be.config,K=V==null?void 0:V.imageResources.find(fe=>fe.id===Ct.value);if(!x||!K){p.value="";return}const oe=await Mn(x),pe=$n(await et.fromURL(oe));K.texture=pe,K.previewUrl=oe,K.textureFolder="",K.textureName=x.name.replace(/\.[^.]+$/,"")||"particle",p.value="",Ct.value=null}async function kr(T){var oe;const p=T.target,x=Array.from(p.files||[]).sort((pe,he)=>pe.name.localeCompare(he.name,void 0,{numeric:!0,sensitivity:"base"})),V=(oe=y.value)==null?void 0:oe.config,K=V==null?void 0:V.imageResources.find(pe=>pe.id===Ct.value);if(!x.length||!K){p.value="";return}K.sequenceFrames=await Promise.all(x.map(async pe=>{const he=await Mn(pe);return{name:pe.name,previewUrl:he,texture:$n(await et.fromURL(he))}})),K.imageMode="sequence",p.value="",Ct.value=null}function Mn(T){return new Promise((p,x)=>{const V=new FileReader;V.onload=()=>p(String(V.result||"")),V.onerror=()=>x(V.error),V.readAsDataURL(T)})}function Zs(T){var V;const p=(V=y.value)==null?void 0:V.config,x=p==null?void 0:p.imageResources.find(K=>K.id===T);!p||!x||(x.texture=p.texture,x.textureName="star",x.textureFolder="",x.previewUrl="/images/star.png",x.imageMode="fixed",x.sequencePlayback="loop-forward",x.sequenceFps=30,x.sequenceFrames=[],x.scale=1,x.anchorX=.5,x.anchorY=.5,x.colorMode="fixed",x.colorStart="#ffffff",x.colorEnd="#ff4d4d",x.colorGradient=[{position:0,color:"#ffffff"},{position:1,color:"#ff4d4d"}],x.blend="normal",x.independentAlpha="off",x.alpha=1,x.alphaCurveMode="跟随导出",x.alphaCurve=L.map(K=>({...K})),x.locked=!1,ws())}function En(T,p){let x=T.trim().replace(/^#/,"");return/^[0-9a-f]{3}$/i.test(x)&&(x=x.split("").map(V=>V+V).join("")),/^[0-9a-f]{6}$/i.test(x)?`#${x.toLowerCase()}`:p}function Js(T,p){const x=p.target;T.colorStart=En(x.value,T.colorStart),x.value=T.colorStart}function An(T,p){Js(T,p),p.target.blur()}function bs(T){var V;const p=(V=y.value)==null?void 0:V.config.imageResources;if(!p||p.length<=1)return;const x=p.findIndex(K=>K.id===T);x>=0&&p.splice(x,1),ws()}function Bi(T){return Math.round(T)}function Qi(T,p,x=!1){if(!T.length)return;const V=Math.max(0,Bi(p)),K=x?T.reduce((pe,he)=>pe+Math.max(0,Number(he.weight)||0),0):0;let oe=0;T.forEach((pe,he)=>{const be=he===T.length-1,fe=Bi(be?V-oe:K>0?V*Math.max(0,Number(pe.weight)||0)/K:V/T.length);pe.weight=fe,oe+=fe})}function ws(){var K;const T=(K=y.value)==null?void 0:K.config.imageResources;if(!(T!=null&&T.length))return;if(T.length===1){T[0].weight=100,T[0].locked=!1;return}const p=T.filter(oe=>oe.locked),x=T.filter(oe=>!oe.locked);let V=p.reduce((oe,pe)=>oe+Math.max(0,Number(pe.weight)||0),0);V>100&&(Qi(p,100,!0),V=100),Qi(x,100-V)}function tr(T,p){var he;const x=(he=y.value)==null?void 0:he.config.imageResources;if(!(x!=null&&x.length))return;if(x.length===1){x[0].weight=100,x[0].locked=!1;return}const V=x.find(be=>be.id===T);if(!V||V.locked)return;const K=x.filter(be=>be.id!==T&&be.locked).reduce((be,fe)=>be+Math.max(0,Number(fe.weight)||0),0),oe=Math.max(0,100-K),pe=x.filter(be=>be.id!==T&&!be.locked);if(V.weight=Bi(Math.min(oe,Math.max(0,Number(p)||0))),!pe.length){V.weight=Bi(oe);return}Qi(pe,oe-V.weight,!0)}function G(T){var V;const p=(V=y.value)==null?void 0:V.config.imageResources;if(!p||p.length===1)return;const x=p.find(K=>K.id===T);x&&(x.locked=!x.locked)}return(T,p)=>(se(),ce("div",bR,[p[362]||(p[362]=w("div",{class:"panel-header"},[w("span",null,"Spine粒子编辑器")],-1)),w("div",wR,[w("div",_R,[w("div",{class:"group-head",onClick:p[0]||(p[0]=x=>Y("config"))},[w("span",SR,Ye(U.config?"▸":"▾"),1),p[182]||(p[182]=w("span",null,"配置管理",-1))]),xe(w("div",TR,[w("div",MR,[w("button",{title:"保存全部编辑器配置 (Ctrl+S)",onClick:d},"保存配置"),w("button",{title:"加载本地编辑器配置",onClick:p[1]||(p[1]=x=>{var V;return(V=s.value)==null?void 0:V.click()})},"加载配置"),xe(w("select",{"onUpdate:modelValue":p[2]||(p[2]=x=>n.value=x),"aria-label":"预设列表",disabled:!r.value.length||o.value,onPointerdown:g,onFocus:g,onChange:b},[w("option",AR,Ye(r.value.length?"选择预设":"无预设文件"),1),(se(!0),ce(qe,null,Ht(r.value,x=>(se(),ce("option",{key:x.file,value:x.file},Ye(x.name),9,CR))),128))],40,ER),[[kt,n.value]]),w("input",{ref_key:"configFileInput",ref:s,hidden:"",type:"file",accept:".json,application/json",onChange:m},null,544)]),a.value?(se(),ce("div",{key:0,class:Ze(["config-message",{error:h.value}])},Ye(a.value),3)):$e("",!0)],512),[[Cn,!U.config]])]),w("div",IR,[w("div",{class:"group-head scene-head",onClick:p[3]||(p[3]=x=>Y("scene"))},[w("span",RR,Ye(U.scene?"▸":"▾"),1),p[183]||(p[183]=w("span",null,"场景对象",-1)),w("div",PR,[w("button",{class:"scene-add",title:"添加粒子系统",onClick:xt(W,["stop"])},"+粒子"),w("button",{class:"scene-add",title:"添加碰撞体",onClick:xt(J,["stop"])},"+碰撞"),w("button",{class:"scene-add",title:"添加路径",onClick:xt(Q,["stop"])},"+路径"),w("button",{class:"scene-add",title:"添加 Spine",onClick:xt(ie,["stop"])},"+Spine"),w("button",{class:"scene-add",disabled:!k.value,title:"复制当前选中的场景对象",onClick:xt(ue,["stop"])},"+Copy",8,kR)])]),xe(w("div",FR,[w("div",OR,[(se(!0),ce(qe,null,Ht(Pe(e).systems,(x,V)=>(se(),ce("div",{key:`particle-${x.id}`,class:Ze(["tree-item scene-object-item",{on:E.value==="particle"&&x.id===Pe(e).activeObjectId}]),onClick:K=>$(V)},[p[186]||(p[186]=w("span",{class:"tdot"},"●",-1)),w("span",LR,Ye(x.config.name||"ParticleSystem"+(V+1)),1),w("button",{class:Ze(["scene-object-eye",{off:x.visible===!1}]),title:x.visible===!1?"显示粒子系统":"隐藏粒子系统","aria-label":x.visible===!1?"显示粒子系统":"隐藏粒子系统",onClick:xt(K=>x.visible=x.visible===!1,["stop"])},[(se(),ce("svg",NR,[p[184]||(p[184]=w("path",{d:"M2.5 12s3.5-6 9.5-6 9.5 6 9.5 6-3.5 6-9.5 6-9.5-6-9.5-6Z"},null,-1)),p[185]||(p[185]=w("circle",{cx:"12",cy:"12",r:"2.8"},null,-1)),x.visible===!1?(se(),ce("path",UR)):$e("",!0)]))],10,DR),p[187]||(p[187]=w("span",{class:"scene-object-kind"},"粒子",-1)),w("button",{class:"scene-object-delete",title:"删除粒子系统",onClick:xt(K=>Pe(e).removeSystem(x.id),["stop"])},"✕",8,VR)],10,BR))),128)),(se(!0),ce(qe,null,Ht(Pe(e).colliders,x=>(se(),ce("div",{key:`collision-${x.id}`,class:Ze(["tree-item scene-object-item",{on:E.value==="collision"&&x.id===Pe(e).activeObjectId}]),onClick:V=>Pe(e).selectSceneObject("collision",x.id)},[p[190]||(p[190]=w("span",{class:"tdot collision-dot"},"■",-1)),w("span",YR,Ye(x.name),1),w("button",{class:Ze(["scene-object-eye",{off:x.visible===!1}]),title:x.visible===!1?"显示碰撞体":"隐藏碰撞体","aria-label":x.visible===!1?"显示碰撞体":"隐藏碰撞体",onClick:xt(V=>x.visible=x.visible===!1,["stop"])},[(se(),ce("svg",GR,[p[188]||(p[188]=w("path",{d:"M2.5 12s3.5-6 9.5-6 9.5 6 9.5 6-3.5 6-9.5 6-9.5-6-9.5-6Z"},null,-1)),p[189]||(p[189]=w("circle",{cx:"12",cy:"12",r:"2.8"},null,-1)),x.visible===!1?(se(),ce("path",jR)):$e("",!0)]))],10,$R),p[191]||(p[191]=w("span",{class:"scene-object-kind"},"碰撞",-1)),w("button",{class:"scene-object-delete",title:"删除碰撞体",onClick:xt(V=>Pe(e).removeCollider(x.id),["stop"])},"✕",8,HR)],10,XR))),128)),(se(!0),ce(qe,null,Ht(Pe(e).paths,x=>(se(),ce("div",{key:`path-${x.id}`,class:Ze(["tree-item scene-object-item",{on:E.value==="path"&&x.id===Pe(e).activeObjectId}]),onClick:V=>Pe(e).selectSceneObject("path",x.id)},[p[194]||(p[194]=w("span",{class:"tdot path-dot"},"◇",-1)),w("span",zR,Ye(x.name),1),w("button",{class:Ze(["scene-object-eye",{off:x.visible===!1}]),title:x.visible===!1?"显示路径":"隐藏路径","aria-label":x.visible===!1?"显示路径":"隐藏路径",onClick:xt(V=>x.visible=x.visible===!1,["stop"])},[(se(),ce("svg",KR,[p[192]||(p[192]=w("path",{d:"M2.5 12s3.5-6 9.5-6 9.5 6 9.5 6-3.5 6-9.5 6-9.5-6-9.5-6Z"},null,-1)),p[193]||(p[193]=w("circle",{cx:"12",cy:"12",r:"2.8"},null,-1)),x.visible===!1?(se(),ce("path",ZR)):$e("",!0)]))],10,qR),p[195]||(p[195]=w("span",{class:"scene-object-kind"},"路径",-1)),w("button",{class:"scene-object-delete",title:"删除路径",onClick:xt(V=>Pe(e).removePath(x.id),["stop"])},"✕",8,JR)],10,WR))),128)),(se(!0),ce(qe,null,Ht(Pe(e).spines,x=>(se(),ce("div",{key:`spine-${x.id}`,class:Ze(["tree-item scene-object-item",{on:E.value==="spine"&&x.id===Pe(e).activeObjectId}]),onClick:V=>Pe(e).selectSceneObject("spine",x.id)},[p[198]||(p[198]=w("span",{class:"tdot spine-dot"},"◆",-1)),w("span",eP,Ye(x.name),1),w("button",{class:Ze(["scene-object-eye",{off:x.visible===!1}]),title:x.visible===!1?"显示 Spine":"隐藏 Spine","aria-label":x.visible===!1?"显示 Spine":"隐藏 Spine",onClick:xt(V=>x.visible=x.visible===!1,["stop"])},[(se(),ce("svg",iP,[p[196]||(p[196]=w("path",{d:"M2.5 12s3.5-6 9.5-6 9.5 6 9.5 6-3.5 6-9.5 6-9.5-6-9.5-6Z"},null,-1)),p[197]||(p[197]=w("circle",{cx:"12",cy:"12",r:"2.8"},null,-1)),x.visible===!1?(se(),ce("path",sP)):$e("",!0)]))],10,tP),p[199]||(p[199]=w("span",{class:"scene-object-kind"},"Spine",-1)),w("button",{class:"scene-object-delete",title:"删除 Spine",onClick:xt(V=>Pe(e).removeSpine(x.id),["stop"])},"✕",8,nP)],10,QR))),128)),!Pe(e).systems.length&&!Pe(e).colliders.length&&!Pe(e).paths.length&&!Pe(e).spines.length?(se(),ce("div",rP,"场景中暂无对象")):$e("",!0)]),E.value==="particle"&&y.value?(se(),ce(qe,{key:0},[w("label",oP,[p[200]||(p[200]=w("span",null,"名称",-1)),xe(w("input",{"onUpdate:modelValue":p[4]||(p[4]=x=>y.value.config.name=x),class:"inp"},null,512),[[Je,y.value.config.name]])]),Ne(Ge,{label:"位置X",min:-2e3,max:2e3,step:1,modelValue:y.value.config.centerX,"onUpdate:modelValue":p[5]||(p[5]=x=>y.value.config.centerX=x)},null,8,["modelValue"]),Ne(Ge,{label:"位置Y",min:-2e3,max:2e3,step:1,modelValue:y.value.config.centerY,"onUpdate:modelValue":p[6]||(p[6]=x=>y.value.config.centerY=x)},null,8,["modelValue"]),Ne(Ge,{label:"偏移X",min:-2e3,max:2e3,step:1,modelValue:y.value.config.offsetX,"onUpdate:modelValue":p[7]||(p[7]=x=>y.value.config.offsetX=x)},null,8,["modelValue"]),Ne(Ge,{label:"偏移Y",min:-2e3,max:2e3,step:1,modelValue:y.value.config.offsetY,"onUpdate:modelValue":p[8]||(p[8]=x=>y.value.config.offsetY=x)},null,8,["modelValue"]),Ne(Ge,{label:"旋转",min:-360,max:360,step:1,modelValue:y.value.config.rootRotation,"onUpdate:modelValue":p[9]||(p[9]=x=>y.value.config.rootRotation=x)},null,8,["modelValue"]),Ne(Ge,{label:"缩放X",min:.05,max:10,step:.05,modelValue:y.value.config.rootScaleX,"onUpdate:modelValue":p[10]||(p[10]=x=>y.value.config.rootScaleX=x)},null,8,["modelValue"]),Ne(Ge,{label:"缩放Y",min:.05,max:10,step:.05,modelValue:y.value.config.rootScaleY,"onUpdate:modelValue":p[11]||(p[11]=x=>y.value.config.rootScaleY=x)},null,8,["modelValue"]),w("div",aP,[p[201]||(p[201]=w("label",{for:"system-seed"},"随机种子",-1)),xe(w("input",{id:"system-seed",class:"seed-input",type:"number",min:"0",step:"1","onUpdate:modelValue":p[12]||(p[12]=x=>y.value.config.seed=x),title:"控制粒子系统内全部随机属性、资源选择与修改器随机采样"},null,512),[[Je,y.value.config.seed,void 0,{number:!0}]]),w("button",{class:"seed-random",title:"生成新的全局随机种子",onClick:De},"⚄")]),p[202]||(p[202]=w("div",{class:"seed-hint"},"控制初始随机参数、资源选择和修改器随机采样;相同种子可复现相同效果",-1))],64)):C.value?(se(),ce(qe,{key:1},[p[229]||(p[229]=w("div",{class:"object-editor-title"},"碰撞体属性",-1)),w("label",lP,[p[203]||(p[203]=w("span",null,"碰撞体名称",-1)),xe(w("input",{"onUpdate:modelValue":p[13]||(p[13]=x=>C.value.name=x),class:"inp"},null,512),[[Je,C.value.name]])]),w("div",hP,[p[204]||(p[204]=w("span",null,"碰撞体标签",-1)),w("div",cP,[(se(!0),ce(qe,null,Ht(C.value.tags,x=>(se(),ce("button",{key:x,class:Ze(["object-tag",{on:C.value.selectedTag===x}]),onClick:V=>C.value.selectedTag=x},Ye(x),11,uP))),128)),w("button",{class:"tag-add",title:"新增标签",onClick:Se},"+")]),p[205]||(p[205]=w("small",null,"点击标签为当前碰撞体选择标签;点击+新增标签。",-1))]),w("div",dP,[w("label",fP,[p[207]||(p[207]=w("span",null,"类型",-1)),xe(w("select",{"onUpdate:modelValue":p[14]||(p[14]=x=>C.value.shape=x),class:"inp"},[...p[206]||(p[206]=[Vo('',5)])],512),[[kt,C.value.shape]])]),w("label",pP,[p[208]||(p[208]=w("span",null,"启用",-1)),xe(w("input",{"onUpdate:modelValue":p[15]||(p[15]=x=>C.value.enabled=x),type:"checkbox"},null,512),[[Lt,C.value.enabled]])])]),w("div",mP,[w("label",gP,[p[209]||(p[209]=w("span",null,"X 位置",-1)),xe(w("input",{"onUpdate:modelValue":p[16]||(p[16]=x=>C.value.x=x),type:"number",class:"inp"},null,512),[[Je,C.value.x,void 0,{number:!0}]])]),w("label",vP,[p[210]||(p[210]=w("span",null,"Y 位置",-1)),xe(w("input",{"onUpdate:modelValue":p[17]||(p[17]=x=>C.value.y=x),type:"number",class:"inp"},null,512),[[Je,C.value.y,void 0,{number:!0}]])])]),Ne(Ge,{label:"旋转",min:-360,max:360,step:1,modelValue:C.value.rotation,"onUpdate:modelValue":p[18]||(p[18]=x=>C.value.rotation=x)},null,8,["modelValue"]),w("div",yP,[w("label",xP,[p[211]||(p[211]=w("span",null,"缩放 X",-1)),xe(w("input",{"onUpdate:modelValue":p[19]||(p[19]=x=>C.value.scaleX=x),type:"number",min:"0.05",step:"0.05",class:"inp"},null,512),[[Je,C.value.scaleX,void 0,{number:!0}]])]),w("label",bP,[p[212]||(p[212]=w("span",null,"缩放 Y",-1)),xe(w("input",{"onUpdate:modelValue":p[20]||(p[20]=x=>C.value.scaleY=x),type:"number",min:"0.05",step:"0.05",class:"inp"},null,512),[[Je,C.value.scaleY,void 0,{number:!0}]])])]),C.value.shape==="circle"?(se(),Et(Ge,{key:0,label:"半径",min:1,max:1e3,step:1,modelValue:C.value.radius,"onUpdate:modelValue":p[21]||(p[21]=x=>C.value.radius=x)},null,8,["modelValue"])):C.value.shape==="ellipse"?(se(),ce("div",wP,[w("label",_P,[p[213]||(p[213]=w("span",null,"X 半径",-1)),xe(w("input",{"onUpdate:modelValue":p[22]||(p[22]=x=>C.value.radiusX=x),type:"number",min:"1",class:"inp"},null,512),[[Je,C.value.radiusX,void 0,{number:!0}]])]),w("label",SP,[p[214]||(p[214]=w("span",null,"Y 半径",-1)),xe(w("input",{"onUpdate:modelValue":p[23]||(p[23]=x=>C.value.radiusY=x),type:"number",min:"1",class:"inp"},null,512),[[Je,C.value.radiusY,void 0,{number:!0}]])])])):(se(),ce("div",TP,[w("label",MP,[p[215]||(p[215]=w("span",null,"宽度",-1)),xe(w("input",{"onUpdate:modelValue":p[24]||(p[24]=x=>C.value.width=x),type:"number",min:"1",class:"inp"},null,512),[[Je,C.value.width,void 0,{number:!0}]])]),w("label",EP,[p[216]||(p[216]=w("span",null,"高度",-1)),xe(w("input",{"onUpdate:modelValue":p[25]||(p[25]=x=>C.value.height=x),type:"number",min:"1",class:"inp"},null,512),[[Je,C.value.height,void 0,{number:!0}]])])])),C.value.shape==="polygon"||C.value.shape==="custom"?(se(),Et(Ge,{key:3,label:"边数",min:3,max:16,step:1,modelValue:C.value.sides,"onUpdate:modelValue":p[26]||(p[26]=x=>C.value.sides=x)},null,8,["modelValue"])):$e("",!0),w("label",AP,[p[218]||(p[218]=w("span",null,"碰撞响应",-1)),xe(w("select",{"onUpdate:modelValue":p[27]||(p[27]=x=>C.value.response=x),class:"inp"},[...p[217]||(p[217]=[w("option",{value:"physics"},"物理(弹跳/摩擦)",-1),w("option",{value:"pause"},"暂停(停止不动)",-1),w("option",{value:"destroy"},"消失(立即销毁)",-1)])],512),[[kt,C.value.response]])]),C.value.response==="physics"?(se(),ce("div",CP,[w("label",IP,[p[219]||(p[219]=w("span",null,"弹性 (0-1)",-1)),xe(w("input",{"onUpdate:modelValue":p[28]||(p[28]=x=>C.value.elasticity=x),type:"number",min:"0",max:"1",step:"0.01",class:"inp"},null,512),[[Je,C.value.elasticity,void 0,{number:!0}]])]),w("label",RP,[p[220]||(p[220]=w("span",null,"摩擦 (0-1)",-1)),xe(w("input",{"onUpdate:modelValue":p[29]||(p[29]=x=>C.value.friction=x),type:"number",min:"0",max:"1",step:"0.01",class:"inp"},null,512),[[Je,C.value.friction,void 0,{number:!0}]])])])):$e("",!0),w("div",PP,[w("label",kP,[xe(w("input",{"onUpdate:modelValue":p[30]||(p[30]=x=>C.value.followPath=x),type:"checkbox"},null,512),[[Lt,C.value.followPath]]),p[221]||(p[221]=Yt("跟随路径移动",-1))]),C.value.followPath?(se(),ce(qe,{key:0},[w("label",FP,[p[223]||(p[223]=w("span",null,"目标路径",-1)),xe(w("select",{"onUpdate:modelValue":p[31]||(p[31]=x=>C.value.followPathId=x),class:"inp"},[p[222]||(p[222]=w("option",{value:0},"(未选择)",-1)),(se(!0),ce(qe,null,Ht(Pe(e).paths,x=>(se(),ce("option",{key:x.id,value:x.id},Ye(x.name),9,OP))),128))],512),[[kt,C.value.followPathId,void 0,{number:!0}]])]),w("div",BP,[w("label",LP,[p[224]||(p[224]=w("span",null,"移动时长(秒)",-1)),xe(w("input",{"onUpdate:modelValue":p[32]||(p[32]=x=>C.value.followDuration=x),type:"number",min:"0.05",step:"0.05",class:"inp"},null,512),[[Je,C.value.followDuration,void 0,{number:!0}]])]),w("label",DP,[p[226]||(p[226]=w("span",null,"曲线模式",-1)),xe(w("select",{"onUpdate:modelValue":p[33]||(p[33]=x=>C.value.followCurveMode=x),class:"inp"},[...p[225]||(p[225]=[w("option",null,"跟随导出",-1),w("option",null,"线性",-1),w("option",null,"贝塞尔",-1)])],512),[[kt,C.value.followCurveMode]])])]),w("label",NP,[xe(w("input",{"onUpdate:modelValue":p[34]||(p[34]=x=>C.value.followPathRotation=x),type:"checkbox"},null,512),[[Lt,C.value.followPathRotation]]),p[227]||(p[227]=Yt("方向沿路径",-1))]),p[228]||(p[228]=w("div",{class:"collider-curve-title"},[Yt("移动进度曲线 "),w("small",null,"横轴:实时/移动时长 纵轴:路径进度(0=起点 → 1=终点)")],-1)),Ne(Is,{"model-value":C.value.followCurve||N,"default-value":N,mode:f(C.value.followCurveMode),"onUpdate:modelValue":p[35]||(p[35]=x=>C.value.followCurve=x)},null,8,["model-value","mode"])],64)):$e("",!0)])],64)):R.value?(se(),ce(qe,{key:2},[p[239]||(p[239]=w("div",{class:"object-editor-title"},"路径属性",-1)),w("label",UP,[p[230]||(p[230]=w("span",null,"路径名称",-1)),xe(w("input",{"onUpdate:modelValue":p[36]||(p[36]=x=>R.value.name=x),class:"inp"},null,512),[[Je,R.value.name]])]),w("div",VP,[w("label",XP,[p[231]||(p[231]=w("span",null,"X 位置",-1)),xe(w("input",{"onUpdate:modelValue":p[37]||(p[37]=x=>R.value.x=x),type:"number",class:"inp"},null,512),[[Je,R.value.x,void 0,{number:!0}]])]),w("label",YP,[p[232]||(p[232]=w("span",null,"Y 位置",-1)),xe(w("input",{"onUpdate:modelValue":p[38]||(p[38]=x=>R.value.y=x),type:"number",class:"inp"},null,512),[[Je,R.value.y,void 0,{number:!0}]])])]),Ne(Ge,{label:"旋转",min:-360,max:360,step:1,modelValue:R.value.rotation,"onUpdate:modelValue":p[39]||(p[39]=x=>R.value.rotation=x)},null,8,["modelValue"]),w("div",$P,[w("label",GP,[p[233]||(p[233]=w("span",null,"缩放 X",-1)),xe(w("input",{"onUpdate:modelValue":p[40]||(p[40]=x=>R.value.scaleX=x),type:"number",min:"0.05",step:"0.05",class:"inp"},null,512),[[Je,R.value.scaleX,void 0,{number:!0}]])]),w("label",jP,[p[234]||(p[234]=w("span",null,"缩放 Y",-1)),xe(w("input",{"onUpdate:modelValue":p[41]||(p[41]=x=>R.value.scaleY=x),type:"number",min:"0.05",step:"0.05",class:"inp"},null,512),[[Je,R.value.scaleY,void 0,{number:!0}]])])]),w("label",HP,[p[235]||(p[235]=w("span",null,"闭合路径",-1)),xe(w("input",{"onUpdate:modelValue":p[42]||(p[42]=x=>R.value.closed=x),type:"checkbox"},null,512),[[Lt,R.value.closed]])]),w("label",WP,[p[236]||(p[236]=w("span",null,"路径颜色",-1)),xe(w("input",{"onUpdate:modelValue":p[43]||(p[43]=x=>R.value.color=x),type:"color",class:"path-color"},null,512),[[Je,R.value.color]])]),p[240]||(p[240]=Vo('
操作说明:
  • 双击空白处/曲线:新建锚点
  • 双击锚点:删除节点
  • 双击第二下按住拖动:新建并拉出手柄
  • 拖动锚点移动位置,拖动手柄调整曲线
  • Shift+拖动手柄:两侧完全对称
  • Alt+拖动手柄:独立控制单侧
  • Ctrl+点击/框选:加选节点
  • Alt+点击/框选:减选节点
  • Alt+单击空白处:清除全部选中
  • 选中多个节点后可整体拖动
',1)),w("label",zP,[p[238]||(p[238]=w("span",null,"应用预设形状",-1)),xe(w("select",{"onUpdate:modelValue":p[44]||(p[44]=x=>R.value.preset=x),class:"inp"},[...p[237]||(p[237]=[Vo('',5)])],512),[[kt,R.value.preset]])]),w("button",{class:"path-action primary",onClick:Ee},"应用预设"),w("button",{class:"path-action",onClick:de},"清空锚点")],64)):B.value?(se(),Et(VI,{key:3,"spine-object":B.value},null,8,["spine-object"])):(se(),ce("div",qP,"使用右上角按钮创建场景对象"))],512),[[Cn,!U.scene]])]),E.value==="particle"&&y.value?(se(),ce(qe,{key:0},[w("div",KP,[w("div",{class:"group-head",onClick:p[46]||(p[46]=x=>Y("emitMode"))},[w("span",ZP,Ye(U.emitMode?"▸":"▾"),1),p[241]||(p[241]=w("span",null,"发射模式",-1)),w("button",{class:"group-reset",title:"重置发射模式参数",onClick:p[45]||(p[45]=xt(x=>te("emitMode"),["stop"]))},"重置")]),xe(w("div",JP,[w("div",QP,[w("button",{class:Ze(["seg",{on:y.value.config.mode==="stream"}]),onClick:p[47]||(p[47]=x=>q("stream"))},"持续",2),w("button",{class:Ze(["seg",{on:y.value.config.mode==="burst"}]),onClick:p[48]||(p[48]=x=>q("burst"))},"爆发",2)]),y.value.config.mode==="stream"?(se(),ce(qe,{key:0},[w("div",ek,[w("button",{class:Ze(["seg",{on:y.value.config.streamBehavior==="normal"}]),onClick:p[49]||(p[49]=x=>H("normal"))},"常规持续",2),w("button",{class:Ze(["seg",{on:y.value.config.streamBehavior==="loop"}]),onClick:p[50]||(p[50]=x=>H("loop"))},"循环持续",2)]),Ne(Ge,{label:"发射速率",min:1,max:300,step:1,modelValue:y.value.config.rate,"onUpdate:modelValue":p[51]||(p[51]=x=>y.value.config.rate=x)},null,8,["modelValue"]),y.value.config.streamBehavior==="normal"?(se(),Et(Ge,{key:0,label:"发射时长",min:1/30,max:60,step:1/30,modelValue:y.value.config.duration,"onUpdate:modelValue":p[52]||(p[52]=x=>y.value.config.duration=x)},null,8,["modelValue"])):(se(),Et(Ge,{key:1,label:"发射时长 (f)",min:1,max:1800,step:1,"model-value":I.value,"onUpdate:modelValue":z},null,8,["model-value"])),y.value.config.streamBehavior==="loop"?(se(),ce("div",tk,[w("label",ik,[w("input",{type:"checkbox",checked:y.value.config.generateLoopStartAnimation,onChange:p[53]||(p[53]=x=>Z("start",x))},null,40,sk),p[242]||(p[242]=w("span",{class:"switch-ui"},null,-1)),p[243]||(p[243]=w("span",null,"生成开始循环动画",-1))]),w("label",nk,[w("input",{type:"checkbox",checked:y.value.config.generateLoopEndAnimation,onChange:p[54]||(p[54]=x=>Z("end",x))},null,40,rk),p[244]||(p[244]=w("span",{class:"switch-ui"},null,-1)),p[245]||(p[245]=w("span",null,"生成结束循环动画",-1))])])):$e("",!0),y.value.config.streamBehavior==="loop"?(se(),ce("div",ok,"循环持续模式不支持骨骼跟随和路径跟随;进入或退出时会将粒子跟随设置恢复默认值。")):$e("",!0)],64)):(se(),Et(Ge,{key:1,label:"单次数量",min:1,max:1e3,step:1,modelValue:y.value.config.burstCount,"onUpdate:modelValue":p[55]||(p[55]=x=>y.value.config.burstCount=x)},null,8,["modelValue"])),Ne(Ge,{label:"延迟时间",min:0,max:5,step:.1,modelValue:y.value.config.delay,"onUpdate:modelValue":p[56]||(p[56]=x=>y.value.config.delay=x)},null,8,["modelValue"])],512),[[Cn,!U.emitMode]])]),w("div",ak,[w("div",{class:"group-head",onClick:p[58]||(p[58]=x=>Y("shape"))},[w("span",lk,Ye(U.shape?"▸":"▾"),1),p[246]||(p[246]=w("span",null,"发射器形状",-1)),w("button",{class:"group-reset",title:"重置发射器形状参数",onClick:p[57]||(p[57]=xt(x=>te("shape"),["stop"]))},"重置")]),xe(w("div",hk,[w("label",ck,[p[248]||(p[248]=w("span",null,"形状",-1)),xe(w("select",{"onUpdate:modelValue":p[59]||(p[59]=x=>y.value.config.shape=x),class:"inp",onChange:wt},[...p[247]||(p[247]=[Vo('',5)])],544),[[kt,y.value.config.shape]])]),y.value.config.shape==="circle"||y.value.config.shape==="cone"?(se(),Et(Ge,{key:0,label:"半径",min:0,max:300,step:1,modelValue:y.value.config.radius,"onUpdate:modelValue":p[60]||(p[60]=x=>y.value.config.radius=x)},null,8,["modelValue"])):$e("",!0),y.value.config.shape==="cone"?(se(),Et(Ge,{key:1,label:"锥形开口角度",min:1,max:360,step:1,modelValue:y.value.config.coneAngle,"onUpdate:modelValue":p[61]||(p[61]=x=>y.value.config.coneAngle=x)},null,8,["modelValue"])):y.value.config.shape==="rect"?(se(),ce(qe,{key:2},[Ne(Ge,{label:"宽",min:1,max:400,step:1,modelValue:y.value.config.rectW,"onUpdate:modelValue":p[62]||(p[62]=x=>y.value.config.rectW=x)},null,8,["modelValue"]),Ne(Ge,{label:"高",min:1,max:400,step:1,modelValue:y.value.config.rectH,"onUpdate:modelValue":p[63]||(p[63]=x=>y.value.config.rectH=x)},null,8,["modelValue"])],64)):$e("",!0),p[249]||(p[249]=w("div",{class:"divider"},null,-1)),Ne(Ge,{label:y.value.config.shape==="cone"?"锥形朝向":"发射角度",min:-360,max:360,step:1,modelValue:y.value.config.direction,"onUpdate:modelValue":p[64]||(p[64]=x=>y.value.config.direction=x)},null,8,["label","modelValue"]),y.value.config.shape!=="cone"?(se(),Et(Ge,{key:3,label:"扩散角度",min:0,max:360,step:1,modelValue:y.value.config.spread,"onUpdate:modelValue":p[65]||(p[65]=x=>y.value.config.spread=x)},null,8,["modelValue"])):$e("",!0)],512),[[Cn,!U.shape]])]),w("div",uk,[w("div",{class:"group-head",onClick:p[67]||(p[67]=x=>Y("attr"))},[w("span",dk,Ye(U.attr?"▸":"▾"),1),p[250]||(p[250]=w("span",null,"粒子属性",-1)),w("button",{class:"group-reset",title:"重置粒子属性参数",onClick:p[66]||(p[66]=xt(x=>te("attr"),["stop"]))},"重置")]),xe(w("div",fk,[p[258]||(p[258]=w("div",{class:"attr-section-title"},"粒子初始参数",-1)),Ne(nn,{label:"初始生命周期","allow-curve":!1,mode:y.value.config.lifeMode,"onUpdate:mode":p[68]||(p[68]=x=>y.value.config.lifeMode=x),"value-min":y.value.config.lifeMin,"onUpdate:valueMin":p[69]||(p[69]=x=>y.value.config.lifeMin=x),"value-max":y.value.config.lifeMax,"onUpdate:valueMax":p[70]||(p[70]=x=>y.value.config.lifeMax=x),curve:y.value.config.lifeCurve,"onUpdate:curve":p[71]||(p[71]=x=>y.value.config.lifeCurve=x),min:.1,max:10,step:.1,"curve-label":"随机采样 →"},null,8,["mode","value-min","value-max","curve"]),Ne(nn,{label:"初始速度","allow-curve":!1,mode:y.value.config.speedMode,"onUpdate:mode":p[72]||(p[72]=x=>y.value.config.speedMode=x),"value-min":y.value.config.speedMin,"onUpdate:valueMin":p[73]||(p[73]=x=>y.value.config.speedMin=x),"value-max":y.value.config.speedMax,"onUpdate:valueMax":p[74]||(p[74]=x=>y.value.config.speedMax=x),curve:y.value.config.speedCurve,"onUpdate:curve":p[75]||(p[75]=x=>y.value.config.speedCurve=x),min:0,max:1e3,step:1,"curve-label":"随机采样 →"},null,8,["mode","value-min","value-max","curve"]),w("div",pk,[p[251]||(p[251]=w("span",null,"初始缩放",-1)),w("div",mk,[w("button",{class:Ze(["axis-mode",{on:y.value.config.scaleAxisMode==="uniform"}]),onClick:p[76]||(p[76]=x=>y.value.config.scaleAxisMode="uniform")},"统一",2),w("button",{class:Ze(["axis-mode",{on:y.value.config.scaleAxisMode==="separate"}]),onClick:p[77]||(p[77]=x=>y.value.config.scaleAxisMode="separate")},"XY分离",2)])]),Ne(nn,{label:y.value.config.scaleAxisMode==="uniform"?"初始缩放":"缩放 X","allow-curve":!1,mode:y.value.config.scaleMode,"onUpdate:mode":p[78]||(p[78]=x=>y.value.config.scaleMode=x),"value-min":y.value.config.scaleMin,"onUpdate:valueMin":p[79]||(p[79]=x=>y.value.config.scaleMin=x),"value-max":y.value.config.scaleMax,"onUpdate:valueMax":p[80]||(p[80]=x=>y.value.config.scaleMax=x),curve:y.value.config.scaleCurve,"onUpdate:curve":p[81]||(p[81]=x=>y.value.config.scaleCurve=x),min:0,max:5,step:.05,"curve-label":"随机采样 →"},null,8,["label","mode","value-min","value-max","curve"]),y.value.config.scaleAxisMode==="separate"?(se(),Et(nn,{key:0,label:"缩放 Y","show-modes":!1,"allow-curve":!1,mode:y.value.config.scaleMode,"onUpdate:mode":p[82]||(p[82]=x=>y.value.config.scaleMode=x),"value-min":y.value.config.scaleYMin,"onUpdate:valueMin":p[83]||(p[83]=x=>y.value.config.scaleYMin=x),"value-max":y.value.config.scaleYMax,"onUpdate:valueMax":p[84]||(p[84]=x=>y.value.config.scaleYMax=x),curve:y.value.config.scaleYCurve,"onUpdate:curve":p[85]||(p[85]=x=>y.value.config.scaleYCurve=x),min:0,max:5,step:.05,"curve-label":"随机采样 →"},null,8,["mode","value-min","value-max","curve"])):$e("",!0),Ne(nn,{label:"初始旋转","allow-direction":"","allow-curve":!1,mode:y.value.config.initialRotationMode,"onUpdate:mode":p[86]||(p[86]=x=>y.value.config.initialRotationMode=x),"value-min":y.value.config.initialRotationMin,"onUpdate:valueMin":p[87]||(p[87]=x=>y.value.config.initialRotationMin=x),"value-max":y.value.config.initialRotationMax,"onUpdate:valueMax":p[88]||(p[88]=x=>y.value.config.initialRotationMax=x),curve:y.value.config.initialRotationCurve,"onUpdate:curve":p[89]||(p[89]=x=>y.value.config.initialRotationCurve=x),min:-360,max:360,step:1,"curve-label":"随机采样 →"},null,8,["mode","value-min","value-max","curve"]),p[259]||(p[259]=w("div",{class:"attr-section-title life-title"},"粒子生命周期变化参数",-1)),w("div",gk,[w("label",vk,[xe(w("input",{type:"checkbox","onUpdate:modelValue":p[90]||(p[90]=x=>y.value.config.speedOverLifeEnabled=x)},null,512),[[Lt,y.value.config.speedOverLifeEnabled]]),p[252]||(p[252]=w("span",{class:"switch-ui"},null,-1)),p[253]||(p[253]=w("span",null,"生命周期内速度",-1))]),y.value.config.speedOverLifeEnabled?(se(),Et(nn,{key:0,label:"速度倍率",mode:y.value.config.speedOverLifeMode,"onUpdate:mode":Ie,"value-min":y.value.config.speedOverLifeMin,"onUpdate:valueMin":p[91]||(p[91]=x=>y.value.config.speedOverLifeMin=x),"value-max":y.value.config.speedOverLifeMax,"onUpdate:valueMax":p[92]||(p[92]=x=>y.value.config.speedOverLifeMax=x),curve:y.value.config.speedOverLifeCurve,"onUpdate:curve":p[93]||(p[93]=x=>y.value.config.speedOverLifeCurve=x),"default-curve":j,min:0,max:3,step:.05,"curve-label":"生命周期 →"},null,8,["mode","value-min","value-max","curve"])):$e("",!0)]),w("div",yk,[w("label",xk,[xe(w("input",{type:"checkbox","onUpdate:modelValue":p[94]||(p[94]=x=>y.value.config.scaleOverLifeEnabled=x),onChange:Be},null,544),[[Lt,y.value.config.scaleOverLifeEnabled]]),p[254]||(p[254]=w("span",{class:"switch-ui"},null,-1)),p[255]||(p[255]=w("span",null,"生命周期内缩放",-1))]),y.value.config.scaleOverLifeEnabled?(se(),ce(qe,{key:0},[w("div",bk,[w("button",{class:Ze(["axis-mode",{on:y.value.config.scaleOverLifeAxisMode==="uniform"}]),onClick:p[95]||(p[95]=x=>y.value.config.scaleOverLifeAxisMode="uniform")},"统一",2),w("button",{class:Ze(["axis-mode",{on:y.value.config.scaleOverLifeAxisMode==="separate"}]),onClick:p[96]||(p[96]=x=>y.value.config.scaleOverLifeAxisMode="separate")},"XY分离",2)]),Ne(nn,{label:y.value.config.scaleOverLifeAxisMode==="uniform"?"缩放倍率":"倍率 X",mode:y.value.config.scaleOverLifeMode,"onUpdate:mode":Ke,"value-min":y.value.config.scaleOverLifeMin,"onUpdate:valueMin":p[97]||(p[97]=x=>y.value.config.scaleOverLifeMin=x),"value-max":y.value.config.scaleOverLifeMax,"onUpdate:valueMax":p[98]||(p[98]=x=>y.value.config.scaleOverLifeMax=x),curve:y.value.config.scaleOverLifeCurve,"onUpdate:curve":p[99]||(p[99]=x=>y.value.config.scaleOverLifeCurve=x),"default-curve":j,min:0,max:3,step:.05,"curve-label":"生命周期 →"},null,8,["label","mode","value-min","value-max","curve"]),y.value.config.scaleOverLifeAxisMode==="separate"?(se(),Et(nn,{key:0,label:"倍率 Y","show-modes":!1,mode:y.value.config.scaleOverLifeMode,"onUpdate:mode":p[100]||(p[100]=x=>y.value.config.scaleOverLifeMode=x),"value-min":y.value.config.scaleYOverLifeMin,"onUpdate:valueMin":p[101]||(p[101]=x=>y.value.config.scaleYOverLifeMin=x),"value-max":y.value.config.scaleYOverLifeMax,"onUpdate:valueMax":p[102]||(p[102]=x=>y.value.config.scaleYOverLifeMax=x),curve:y.value.config.scaleYOverLifeCurve,"onUpdate:curve":p[103]||(p[103]=x=>y.value.config.scaleYOverLifeCurve=x),"default-curve":j,min:0,max:3,step:.05,"curve-label":"生命周期 →"},null,8,["mode","value-min","value-max","curve"])):$e("",!0)],64)):$e("",!0)]),w("div",wk,[w("label",_k,[xe(w("input",{type:"checkbox","onUpdate:modelValue":p[104]||(p[104]=x=>y.value.config.rotationOverLifeEnabled=x)},null,512),[[Lt,y.value.config.rotationOverLifeEnabled]]),p[256]||(p[256]=w("span",{class:"switch-ui"},null,-1)),p[257]||(p[257]=w("span",null,"生命周期内旋转",-1))]),y.value.config.rotationOverLifeEnabled?(se(),Et(nn,{key:0,label:"旋转速度",mode:y.value.config.rotationOverLifeMode,"onUpdate:mode":p[105]||(p[105]=x=>y.value.config.rotationOverLifeMode=x),"value-min":y.value.config.rotationSpeedMin,"onUpdate:valueMin":p[106]||(p[106]=x=>y.value.config.rotationSpeedMin=x),"value-max":y.value.config.rotationSpeedMax,"onUpdate:valueMax":p[107]||(p[107]=x=>y.value.config.rotationSpeedMax=x),curve:y.value.config.rotationOverLifeCurve,"onUpdate:curve":p[108]||(p[108]=x=>y.value.config.rotationOverLifeCurve=x),"default-curve":N,min:-720,max:720,step:10,"curve-label":"生命周期 →"},null,8,["mode","value-min","value-max","curve"])):$e("",!0)])],512),[[Cn,!U.attr]])]),w("div",Sk,[w("div",{class:"group-head",onClick:p[110]||(p[110]=x=>Y("look"))},[w("span",Tk,Ye(U.look?"▸":"▾"),1),p[260]||(p[260]=w("span",null,"外观与资源",-1)),w("button",{class:"group-reset",title:"重置外观与资源参数",onClick:p[109]||(p[109]=xt(x=>te("look"),["stop"]))},"重置")]),xe(w("div",Mk,[p[274]||(p[274]=w("div",{class:"look-title"},"透明度",-1)),w("div",Ek,[w("button",{class:Ze(["seg-btn",{active:y.value.config.alphaMode==="curve"}]),onClick:p[111]||(p[111]=x=>y.value.config.alphaMode="curve")},"曲线",2),w("button",{class:Ze(["seg-btn",{active:y.value.config.alphaMode==="fixed"}]),onClick:p[112]||(p[112]=x=>y.value.config.alphaMode="fixed")},"固定",2)]),y.value.config.alphaMode==="fixed"?(se(),Et(Ge,{key:0,label:"透明度",min:0,max:1,step:.01,modelValue:y.value.config.alpha,"onUpdate:modelValue":p[113]||(p[113]=x=>y.value.config.alpha=x)},null,8,["modelValue"])):(se(),ce(qe,{key:1},[w("label",Ak,[p[262]||(p[262]=w("span",null,"曲线模式",-1)),xe(w("select",{"onUpdate:modelValue":p[114]||(p[114]=x=>y.value.config.curveMode=x),class:"inp"},[...p[261]||(p[261]=[w("option",null,"跟随导出",-1),w("option",null,"线性",-1),w("option",null,"贝塞尔",-1)])],512),[[kt,y.value.config.curveMode]])]),w("div",Ck,[Ne(Is,{modelValue:y.value.config.alphaCurve,"onUpdate:modelValue":p[115]||(p[115]=x=>y.value.config.alphaCurve=x),"default-value":O,mode:f(y.value.config.curveMode)},null,8,["modelValue","mode"]),p[263]||(p[263]=w("div",{class:"curve-labels"},[w("span",null,"0(透明)"),w("span",null,"生命周期 →"),w("span",null,"1(不透明)")],-1))])],64)),w("div",{class:"look-title image-title"},[p[264]||(p[264]=w("span",null,"图片资源",-1)),w("button",{class:"image-add",title:"新增图片资源",onClick:er},"+")]),(se(!0),ce(qe,null,Ht(y.value.config.imageResources,x=>(se(),Et(mg,{key:x.id,resource:x,"resource-count":y.value.config.imageResources.length,"supports-sequence":"","default-file":"star.png",onPick:Oi,onPickSequence:Qt,onReset:Zs,onRemove:bs,onUpdateWeight:tr,onToggleLock:G},{default:Fu(()=>[Ne(Ge,{label:"缩放",min:.1,max:3,step:.05,modelValue:x.scale,"onUpdate:modelValue":V=>x.scale=V},null,8,["modelValue","onUpdate:modelValue"]),w("label",Ik,[p[265]||(p[265]=w("span",null,"轴心 x,y",-1)),xe(w("input",{type:"number",step:"0.05",class:"inp tiny","onUpdate:modelValue":V=>x.anchorX=V},null,8,Rk),[[Je,x.anchorX,void 0,{number:!0}]]),xe(w("input",{type:"number",step:"0.05",class:"inp tiny","onUpdate:modelValue":V=>x.anchorY=V},null,8,Pk),[[Je,x.anchorY,void 0,{number:!0}]])]),p[273]||(p[273]=w("div",{class:"resource-divider"},null,-1)),w("label",kk,[p[268]||(p[268]=w("span",null,"颜色",-1)),xe(w("select",{"onUpdate:modelValue":V=>x.colorMode=V,class:"inp"},[...p[266]||(p[266]=[w("option",{value:"fixed"},"固定色",-1),w("option",{value:"lifetime"},"生命周期",-1)])],8,Fk),[[kt,x.colorMode]]),xe(w("select",{"onUpdate:modelValue":V=>x.blend=V,class:"inp blend-select"},[...p[267]||(p[267]=[w("option",{value:"normal"},"正常",-1),w("option",{value:"add"},"相加",-1),w("option",{value:"multiply"},"相乘",-1),w("option",{value:"screen"},"滤色",-1)])],8,Ok),[[kt,x.blend]])]),x.colorMode==="fixed"?(se(),ce("label",Bk,[p[269]||(p[269]=w("span",null,"固定色",-1)),xe(w("input",{type:"color","onUpdate:modelValue":V=>x.colorStart=V,class:"colr"},null,8,Lk),[[Je,x.colorStart]]),w("input",{type:"text",class:"hex-input",value:x.colorStart,spellcheck:"false","aria-label":"固定颜色值",onChange:V=>Js(x,V),onKeydown:da(V=>An(x,V),["enter"])},null,40,Dk)])):(se(),Et(pg,{key:1,modelValue:x.colorGradient,"onUpdate:modelValue":V=>x.colorGradient=V},null,8,["modelValue","onUpdate:modelValue"])),w("div",Nk,[p[270]||(p[270]=w("span",null,"独立透明度",-1)),w("div",Uk,[w("button",{class:Ze({on:x.independentAlpha==="off"}),onClick:V=>x.independentAlpha="off"},"关闭",10,Vk),w("button",{class:Ze({on:x.independentAlpha==="fixed"}),onClick:V=>x.independentAlpha="fixed"},"固定",10,Xk),w("button",{class:Ze({on:x.independentAlpha==="curve"}),onClick:V=>x.independentAlpha="curve"},"曲线",10,Yk)])]),x.independentAlpha==="fixed"?(se(),Et(Ge,{key:2,label:"透明度",min:0,max:1,step:.01,modelValue:x.alpha,"onUpdate:modelValue":V=>x.alpha=V},null,8,["modelValue","onUpdate:modelValue"])):x.independentAlpha==="curve"?(se(),ce(qe,{key:3},[w("label",$k,[p[272]||(p[272]=w("span",null,"曲线模式",-1)),xe(w("select",{"onUpdate:modelValue":V=>x.alphaCurveMode=V,class:"inp"},[...p[271]||(p[271]=[w("option",null,"跟随导出",-1),w("option",null,"线性",-1),w("option",null,"贝塞尔",-1)])],8,Gk),[[kt,x.alphaCurveMode]])]),w("div",jk,[Ne(Is,{modelValue:x.alphaCurve,"onUpdate:modelValue":V=>x.alphaCurve=V,"default-value":L,mode:f(x.alphaCurveMode)},null,8,["modelValue","onUpdate:modelValue","mode"])])],64)):$e("",!0)]),_:2},1032,["resource","resource-count"]))),128)),w("input",{ref_key:"textureFileInput",ref:dt,class:"file-input",type:"file",accept:"image/png,image/jpeg,image/webp,image/gif",onChange:Pr},null,544),w("input",{ref_key:"sequenceFileInput",ref:Mt,class:"file-input",type:"file",multiple:"",accept:"image/png,image/jpeg,image/webp,image/gif",onChange:kr},null,544)],512),[[Cn,!U.look]])]),w("div",Hk,[w("div",{class:"group-head",onClick:p[117]||(p[117]=x=>Y("mods"))},[w("span",Wk,Ye(U.mods?"▸":"▾"),1),p[275]||(p[275]=w("span",null,"修改器",-1)),w("button",{class:"group-reset",title:"重置修改器参数",onClick:p[116]||(p[116]=xt(x=>te("mods"),["stop"]))},"重置")]),xe(w("div",zk,[w("div",qk,[w("label",Kk,[xe(w("input",{type:"checkbox","onUpdate:modelValue":p[118]||(p[118]=x=>y.value.config.noise=x)},null,512),[[Lt,y.value.config.noise]]),p[276]||(p[276]=w("span",{class:"switch-ui"},null,-1)),p[277]||(p[277]=w("span",null,"开启移动噪声",-1))]),y.value.config.noise?(se(),ce("div",Zk,[Ne(Ge,{label:"强度",min:0,max:100,step:1,modelValue:y.value.config.noiseAmt,"onUpdate:modelValue":p[119]||(p[119]=x=>y.value.config.noiseAmt=x)},null,8,["modelValue"]),Ne(Ge,{label:"波动范围",min:0,max:500,step:1,modelValue:y.value.config.noiseRange,"onUpdate:modelValue":p[120]||(p[120]=x=>y.value.config.noiseRange=x)},null,8,["modelValue"]),Ne(Ge,{label:"时间流速",min:0,max:10,step:.1,modelValue:y.value.config.noiseSpeed,"onUpdate:modelValue":p[121]||(p[121]=x=>y.value.config.noiseSpeed=x)},null,8,["modelValue"]),p[278]||(p[278]=w("div",{class:"modifier-hint"},"强度控制影响比例 · 波动范围控制最大偏移 · 时间流速控制变化速度",-1))])):$e("",!0)]),w("div",Jk,[w("label",Qk,[xe(w("input",{type:"checkbox","onUpdate:modelValue":p[122]||(p[122]=x=>y.value.config.useGravity=x)},null,512),[[Lt,y.value.config.useGravity]]),p[279]||(p[279]=w("span",{class:"switch-ui"},null,-1)),p[280]||(p[280]=w("span",null,"开启重力",-1))]),y.value.config.useGravity?(se(),ce("div",eF,[w("div",tF,[w("button",{class:Ze(["axis-mode",{on:y.value.config.gravityMode==="fixed"}]),onClick:p[123]||(p[123]=x=>y.value.config.gravityMode="fixed")},"固定",2),w("button",{class:Ze(["axis-mode",{on:y.value.config.gravityMode==="random"}]),onClick:p[124]||(p[124]=x=>y.value.config.gravityMode="random")},"随机",2)]),y.value.config.gravityMode==="fixed"?(se(),Et(Ge,{key:0,label:"重力强度",min:-3e3,max:3e3,step:10,modelValue:y.value.config.gravityMin,"onUpdate:modelValue":p[125]||(p[125]=x=>y.value.config.gravityMin=x)},null,8,["modelValue"])):(se(),ce(qe,{key:1},[Ne(Ge,{label:"强度 min",min:-3e3,max:3e3,step:10,modelValue:y.value.config.gravityMin,"onUpdate:modelValue":p[126]||(p[126]=x=>y.value.config.gravityMin=x)},null,8,["modelValue"]),Ne(Ge,{label:"强度 max",min:-3e3,max:3e3,step:10,modelValue:y.value.config.gravityMax,"onUpdate:modelValue":p[127]||(p[127]=x=>y.value.config.gravityMax=x)},null,8,["modelValue"])],64)),Ne(Ge,{label:"方向",min:-360,max:360,step:1,modelValue:y.value.config.gravityDirection,"onUpdate:modelValue":p[128]||(p[128]=x=>y.value.config.gravityDirection=x)},null,8,["modelValue"]),p[281]||(p[281]=w("div",{class:"gravity-curve-title"},[w("span",null,"生命周期内重力"),w("span",null,"纵轴:强度 0~1")],-1)),Ne(Is,{modelValue:y.value.config.gravityCurve,"onUpdate:modelValue":p[129]||(p[129]=x=>y.value.config.gravityCurve=x),"default-value":j},null,8,["modelValue"]),p[282]||(p[282]=w("div",{class:"gravity-curve-axis"},[w("span",null,"0"),w("span",null,"生命周期 →"),w("span",null,"1")],-1)),p[283]||(p[283]=w("div",{class:"modifier-hint"},"0° 向右 · -90° 向下 · 负强度会反转方向",-1))])):$e("",!0)]),w("div",iF,[w("label",sF,[xe(w("input",{type:"checkbox","onUpdate:modelValue":p[130]||(p[130]=x=>y.value.config.wind=x)},null,512),[[Lt,y.value.config.wind]]),p[284]||(p[284]=w("span",{class:"switch-ui"},null,-1)),p[285]||(p[285]=w("span",null,"开启风力",-1))]),y.value.config.wind?(se(),ce("div",nF,[w("div",rF,[w("button",{class:Ze(["axis-mode",{on:y.value.config.windMode==="fixed"}]),onClick:p[131]||(p[131]=x=>y.value.config.windMode="fixed")},"固定",2),w("button",{class:Ze(["axis-mode",{on:y.value.config.windMode==="random"}]),onClick:p[132]||(p[132]=x=>y.value.config.windMode="random")},"随机",2)]),y.value.config.windMode==="fixed"?(se(),Et(Ge,{key:0,label:"风力强度",min:-3e3,max:3e3,step:10,modelValue:y.value.config.windMin,"onUpdate:modelValue":p[133]||(p[133]=x=>y.value.config.windMin=x)},null,8,["modelValue"])):(se(),ce(qe,{key:1},[Ne(Ge,{label:"强度 min",min:-3e3,max:3e3,step:10,modelValue:y.value.config.windMin,"onUpdate:modelValue":p[134]||(p[134]=x=>y.value.config.windMin=x)},null,8,["modelValue"]),Ne(Ge,{label:"强度 max",min:-3e3,max:3e3,step:10,modelValue:y.value.config.windMax,"onUpdate:modelValue":p[135]||(p[135]=x=>y.value.config.windMax=x)},null,8,["modelValue"])],64)),Ne(Ge,{label:"方向",min:-360,max:360,step:1,modelValue:y.value.config.windDirection,"onUpdate:modelValue":p[136]||(p[136]=x=>y.value.config.windDirection=x)},null,8,["modelValue"]),p[286]||(p[286]=w("div",{class:"gravity-curve-title"},[w("span",null,"生命周期内风力"),w("span",null,"纵轴:强度 0~1")],-1)),Ne(Is,{modelValue:y.value.config.windCurve,"onUpdate:modelValue":p[137]||(p[137]=x=>y.value.config.windCurve=x),"default-value":j},null,8,["modelValue"]),p[287]||(p[287]=w("div",{class:"gravity-curve-axis"},[w("span",null,"0"),w("span",null,"生命周期 →"),w("span",null,"1")],-1)),p[288]||(p[288]=w("div",{class:"modifier-hint"},"0° 向右 · -90° 向下 · 负强度会反转方向",-1))])):$e("",!0)]),w("div",oF,[w("label",aF,[xe(w("input",{type:"checkbox","onUpdate:modelValue":p[138]||(p[138]=x=>y.value.config.forceField=x)},null,512),[[Lt,y.value.config.forceField]]),p[289]||(p[289]=w("span",{class:"switch-ui"},null,-1)),p[290]||(p[290]=w("span",null,"开启力场",-1))]),y.value.config.forceField?(se(),ce("div",lF,[Ne(Ge,{label:"中心 X",min:-5e3,max:5e3,step:1,modelValue:y.value.config.forceCenterX,"onUpdate:modelValue":p[139]||(p[139]=x=>y.value.config.forceCenterX=x)},null,8,["modelValue"]),Ne(Ge,{label:"中心 Y",min:-5e3,max:5e3,step:1,modelValue:y.value.config.forceCenterY,"onUpdate:modelValue":p[140]||(p[140]=x=>y.value.config.forceCenterY=x)},null,8,["modelValue"]),Ne(Ge,{label:"力场强度",min:-300,max:300,step:1,modelValue:y.value.config.forceStrength,"onUpdate:modelValue":p[141]||(p[141]=x=>y.value.config.forceStrength=x)},null,8,["modelValue"]),Ne(Ge,{label:"力场半径",min:1,max:2e3,step:1,modelValue:y.value.config.forceRadius,"onUpdate:modelValue":p[142]||(p[142]=x=>y.value.config.forceRadius=x)},null,8,["modelValue"]),w("label",hF,[p[292]||(p[292]=w("span",null,"衰减模式",-1)),xe(w("select",{"onUpdate:modelValue":p[143]||(p[143]=x=>y.value.config.forceFalloff=x),class:"inp"},[...p[291]||(p[291]=[w("option",{value:"constant"},"恒定(范围内力度不变)",-1),w("option",{value:"linear"},"线性衰减(边缘为 0)",-1),w("option",{value:"inverse"},"距离反比(中心最强)",-1)])],512),[[kt,y.value.config.forceFalloff]])]),p[293]||(p[293]=w("div",{class:"modifier-hint"},"正数吸向中心 · 负数向外排斥 · 可在画布内拖动力场圆",-1))])):$e("",!0)]),w("div",cF,[w("label",uF,[xe(w("input",{type:"checkbox","onUpdate:modelValue":p[144]||(p[144]=x=>y.value.config.attraction=x)},null,512),[[Lt,y.value.config.attraction]]),p[294]||(p[294]=w("span",{class:"switch-ui"},null,-1)),p[295]||(p[295]=w("span",null,"开启吸附",-1))]),y.value.config.attraction?(se(),ce("div",dF,[Ne(Ge,{label:"吸附点 X",min:-5e3,max:5e3,step:1,modelValue:y.value.config.attractionCenterX,"onUpdate:modelValue":p[145]||(p[145]=x=>y.value.config.attractionCenterX=x)},null,8,["modelValue"]),Ne(Ge,{label:"吸附点 Y",min:-5e3,max:5e3,step:1,modelValue:y.value.config.attractionCenterY,"onUpdate:modelValue":p[146]||(p[146]=x=>y.value.config.attractionCenterY=x)},null,8,["modelValue"]),Ne(Ge,{label:"吸附半径",min:0,max:2e3,step:1,modelValue:y.value.config.attractionRadius,"onUpdate:modelValue":p[147]||(p[147]=x=>y.value.config.attractionRadius=x)},null,8,["modelValue"]),Ne(Ge,{label:"吸附时长",min:.05,max:30,step:.05,modelValue:y.value.config.attractionDuration,"onUpdate:modelValue":p[148]||(p[148]=x=>y.value.config.attractionDuration=x)},null,8,["modelValue"]),Ne(Ge,{label:"延迟时间",min:0,max:30,step:.05,modelValue:y.value.config.attractionDelay,"onUpdate:modelValue":p[149]||(p[149]=x=>y.value.config.attractionDelay=x)},null,8,["modelValue"]),w("label",fF,[p[297]||(p[297]=w("span",null,"延迟方式",-1)),xe(w("select",{"onUpdate:modelValue":p[150]||(p[150]=x=>y.value.config.attractionDelayMode=x),class:"inp"},[...p[296]||(p[296]=[w("option",{value:"global"},"统一时间",-1),w("option",{value:"particle"},"单粒子生命",-1)])],512),[[kt,y.value.config.attractionDelayMode]])]),w("label",pF,[p[299]||(p[299]=w("span",null,"吸附方式",-1)),xe(w("select",{"onUpdate:modelValue":p[151]||(p[151]=x=>y.value.config.attractionPath=x),class:"inp"},[...p[298]||(p[298]=[w("option",{value:"linear"},"直线",-1),w("option",{value:"curve"},"曲线",-1)])],512),[[kt,y.value.config.attractionPath]])]),p[300]||(p[300]=w("div",{class:"modifier-hint"},"延迟后从当前位置开始吸附 · 到达红色范围即死亡 · 可在画布内拖动吸附圆",-1))])):$e("",!0)]),w("div",mF,[w("label",gF,[xe(w("input",{type:"checkbox","onUpdate:modelValue":p[152]||(p[152]=x=>y.value.config.trail=x)},null,512),[[Lt,y.value.config.trail]]),p[301]||(p[301]=w("span",{class:"switch-ui"},null,-1)),p[302]||(p[302]=w("span",null,"开启拖尾",-1))]),y.value.config.trail?(se(),ce("div",vF,[w("div",{class:"trail-section-head"},[p[303]||(p[303]=w("div",{class:"trail-section-title"},"拖尾独立图片",-1)),w("button",{class:"image-add",title:"增加拖尾图片资源",onClick:Zi},"+")]),(se(!0),ce(qe,null,Ht(y.value.config.trailResources,x=>(se(),Et(mg,{key:x.id,resource:x,"resource-count":y.value.config.trailResources.length,"default-file":"trail.png","name-placeholder":"trail","show-folder":!1,onPick:xs,onReset:It,onRemove:Pt,onUpdateWeight:$i,onToggleLock:Ji},{default:Fu(()=>[p[319]||(p[319]=w("div",{class:"resource-divider"},null,-1)),Ne(Ge,{label:"旋转",min:-360,max:360,step:1,"model-value":x.rotation,"onUpdate:modelValue":V=>le(x.id,V)},null,8,["model-value","onUpdate:modelValue"]),Ne(Ge,{label:"拖尾骨骼数",min:2,max:16,step:1,"model-value":x.boneCount,"onUpdate:modelValue":V=>re(x.id,V)},null,8,["model-value","onUpdate:modelValue"]),Ne(Ge,{label:"拖尾比例 (%)",min:0,max:100,step:1,modelValue:x.trailRatio,"onUpdate:modelValue":V=>x.trailRatio=V},null,8,["modelValue","onUpdate:modelValue"]),w("label",yF,[p[305]||(p[305]=w("span",null,"拖尾长度",-1)),xe(w("select",{"onUpdate:modelValue":V=>x.lengthMode=V,class:"inp"},[...p[304]||(p[304]=[w("option",{value:"fixed"},"固定",-1),w("option",{value:"random"},"随机范围",-1)])],8,xF),[[kt,x.lengthMode]])]),x.lengthMode==="fixed"?(se(),Et(Ge,{key:0,label:"长度比例 (%)",min:0,max:500,step:1,modelValue:x.length,"onUpdate:modelValue":V=>x.length=V},null,8,["modelValue","onUpdate:modelValue"])):(se(),ce(qe,{key:1},[Ne(Ge,{label:"长度最小 (%)",min:0,max:500,step:1,modelValue:x.lengthMin,"onUpdate:modelValue":V=>x.lengthMin=V},null,8,["modelValue","onUpdate:modelValue"]),Ne(Ge,{label:"长度最大 (%)",min:0,max:500,step:1,modelValue:x.lengthMax,"onUpdate:modelValue":V=>x.lengthMax=V},null,8,["modelValue","onUpdate:modelValue"])],64)),w("label",bF,[p[307]||(p[307]=w("span",null,"拖尾宽度",-1)),xe(w("select",{"onUpdate:modelValue":V=>x.widthSizeMode=V,class:"inp"},[...p[306]||(p[306]=[w("option",{value:"fixed"},"固定",-1),w("option",{value:"random"},"随机范围",-1)])],8,wF),[[kt,x.widthSizeMode]])]),x.widthSizeMode==="fixed"?(se(),Et(Ge,{key:2,label:"宽度比例 (%)",min:0,max:500,step:1,modelValue:x.width,"onUpdate:modelValue":V=>x.width=V},null,8,["modelValue","onUpdate:modelValue"])):(se(),ce(qe,{key:3},[Ne(Ge,{label:"宽度最小 (%)",min:0,max:500,step:1,modelValue:x.widthMin,"onUpdate:modelValue":V=>x.widthMin=V},null,8,["modelValue","onUpdate:modelValue"]),Ne(Ge,{label:"宽度最大 (%)",min:0,max:500,step:1,modelValue:x.widthMax,"onUpdate:modelValue":V=>x.widthMax=V},null,8,["modelValue","onUpdate:modelValue"])],64)),w("label",_F,[p[309]||(p[309]=w("span",null,"宽度缩放",-1)),xe(w("select",{"onUpdate:modelValue":V=>x.widthMode=V,class:"inp"},[...p[308]||(p[308]=[w("option",{value:"particle"},"跟随粒子",-1),w("option",{value:"fixed"},"固定",-1)])],8,SF),[[kt,x.widthMode]])]),w("label",TF,[xe(w("input",{type:"checkbox","onUpdate:modelValue":V=>x.lifeLengthEnabled=V},null,8,MF),[[Lt,x.lifeLengthEnabled]]),p[310]||(p[310]=w("span",{class:"switch-ui"},null,-1)),p[311]||(p[311]=w("span",null,"生命周期长度曲线",-1))]),x.lifeLengthEnabled?(se(),Et(Is,{key:4,modelValue:x.lifeLengthCurve,"onUpdate:modelValue":V=>x.lifeLengthCurve=V,"default-value":j},null,8,["modelValue","onUpdate:modelValue"])):$e("",!0),w("label",EF,[xe(w("input",{type:"checkbox","onUpdate:modelValue":V=>x.shapeEnabled=V},null,8,AF),[[Lt,x.shapeEnabled]]),p[312]||(p[312]=w("span",{class:"switch-ui"},null,-1)),p[313]||(p[313]=w("span",null,"形状曲线(首端 → 尾端宽度)",-1))]),x.shapeEnabled?(se(),Et(Is,{key:5,modelValue:x.shapeCurve,"onUpdate:modelValue":V=>x.shapeCurve=V,"default-value":X},null,8,["modelValue","onUpdate:modelValue"])):$e("",!0),w("div",CF,[p[314]||(p[314]=w("span",null,"颜色模式",-1)),w("div",IF,[w("button",{class:Ze(["axis-mode",{on:x.colorMode==="particle"}]),onClick:V=>x.colorMode="particle"},"跟随粒子",10,RF),w("button",{class:Ze(["axis-mode",{on:x.colorMode==="fixed"}]),onClick:V=>x.colorMode="fixed"},"固定",10,PF),w("button",{class:Ze(["axis-mode",{on:x.colorMode==="curve"}]),onClick:V=>x.colorMode="curve"},"曲线",10,kF)])]),w("label",FF,[p[316]||(p[316]=w("span",null,"混合模式",-1)),xe(w("select",{"onUpdate:modelValue":V=>x.blend=V,class:"inp"},[...p[315]||(p[315]=[w("option",{value:"normal"},"正常",-1),w("option",{value:"add"},"相加",-1),w("option",{value:"multiply"},"相乘",-1),w("option",{value:"screen"},"滤色",-1)])],8,OF),[[kt,x.blend]])]),x.colorMode==="fixed"?(se(),ce("label",BF,[p[317]||(p[317]=w("span",null,"固定颜色",-1)),xe(w("input",{class:"colr",type:"color","onUpdate:modelValue":V=>x.color=V},null,8,LF),[[Je,x.color]]),w("input",{class:"hex-input",value:x.color,onChange:V=>li(x,V),onKeydown:da(xt(V=>Gi(x,V),["prevent"]),["enter"])},null,40,DF)])):x.colorMode==="curve"?(se(),Et(pg,{key:7,modelValue:x.colorGradient,"onUpdate:modelValue":V=>x.colorGradient=V},null,8,["modelValue","onUpdate:modelValue"])):$e("",!0),w("div",NF,[p[318]||(p[318]=w("span",null,"透明度模式",-1)),w("div",UF,[w("button",{class:Ze(["axis-mode",{on:x.alphaMode==="particle"}]),onClick:V=>x.alphaMode="particle"},"跟随粒子",10,VF),w("button",{class:Ze(["axis-mode",{on:x.alphaMode==="fixed"}]),onClick:V=>x.alphaMode="fixed"},"固定",10,XF),w("button",{class:Ze(["axis-mode",{on:x.alphaMode==="curve"}]),onClick:V=>x.alphaMode="curve"},"曲线",10,YF)])]),x.alphaMode==="fixed"?(se(),Et(Ge,{key:8,label:"透明度",min:0,max:1,step:.01,modelValue:x.alpha,"onUpdate:modelValue":V=>x.alpha=V},null,8,["modelValue","onUpdate:modelValue"])):$e("",!0),x.alphaMode==="curve"?(se(),Et(Is,{key:9,modelValue:x.alphaCurve,"onUpdate:modelValue":V=>x.alphaCurve=V,"default-value":P},null,8,["modelValue","onUpdate:modelValue"])):$e("",!0)]),_:2},1032,["resource","resource-count"]))),128)),w("input",{ref_key:"trailTextureFileInput",ref:ai,class:"file-input",type:"file",accept:"image/png,image/jpeg,image/webp",onChange:ft},null,544),w("div",$F,[Ne(Ge,{label:"网格行数",min:2,max:16,step:1,"model-value":y.value.config.trailGridRows,"onUpdate:modelValue":p[153]||(p[153]=x=>$t("trailGridRows",x))},null,8,["model-value"]),Ne(Ge,{label:"网格列数",min:2,max:32,step:1,"model-value":y.value.config.trailGridCols,"onUpdate:modelValue":p[154]||(p[154]=x=>$t("trailGridCols",x))},null,8,["model-value"])]),p[320]||(p[320]=w("div",{class:"modifier-hint"},"每个粒子按资源比例生成一组同级拖尾骨骼;随机长度与宽度在粒子出生时确定,相同种子可稳定复现",-1))])):$e("",!0)]),w("div",GF,[w("label",jF,[xe(w("input",{type:"checkbox","onUpdate:modelValue":p[155]||(p[155]=x=>y.value.config.emitterFollow=x),disabled:y.value.config.streamBehavior==="loop"},null,8,HF),[[Lt,y.value.config.emitterFollow]]),p[321]||(p[321]=w("span",{class:"switch-ui"},null,-1)),p[322]||(p[322]=w("span",null,"开启发射器跟随",-1))]),y.value.config.emitterFollow&&y.value.config.streamBehavior!=="loop"?(se(),ce("div",WF,[w("label",zF,[p[325]||(p[325]=w("span",null,"跟随模式",-1)),w("select",{value:y.value.config.emitterFollowMode,class:"inp",onChange:p[156]||(p[156]=x=>ae(x,y.value.config))},[p[323]||(p[323]=w("option",{value:"none"},"无",-1)),p[324]||(p[324]=w("option",{value:"path"},"跟随路径",-1)),F.value||y.value.config.emitterFollowMode==="bone"?(se(),ce("option",KF,"选中的骨骼")):$e("",!0)],40,qF)]),y.value.config.emitterFollowMode==="path"?(se(),ce(qe,{key:0},[w("label",ZF,[p[327]||(p[327]=w("span",null,"跟随路径",-1)),xe(w("select",{"onUpdate:modelValue":p[157]||(p[157]=x=>y.value.config.emitterFollowPathId=x),class:"inp"},[p[326]||(p[326]=w("option",{value:0},"无",-1)),(se(!0),ce(qe,null,Ht(Pe(e).paths,x=>(se(),ce("option",{key:x.id,value:x.id},Ye(x.name),9,JF))),128))],512),[[kt,y.value.config.emitterFollowPathId,void 0,{number:!0}]])]),w("label",QF,[p[329]||(p[329]=w("span",null,"发射器角度模式",-1)),xe(w("select",{"onUpdate:modelValue":p[158]||(p[158]=x=>y.value.config.emitterAngleMode=x),class:"inp"},[...p[328]||(p[328]=[w("option",{value:"fixed"},"固定角度",-1),w("option",{value:"direction"},"跟随移动方向",-1)])],512),[[kt,y.value.config.emitterAngleMode]])]),p[335]||(p[335]=w("div",{class:"gravity-curve-title"},[w("span",null,"移动进度曲线 (0→1)")],-1)),Ne(Is,{modelValue:y.value.config.emitterFollowCurve,"onUpdate:modelValue":p[159]||(p[159]=x=>y.value.config.emitterFollowCurve=x),"default-value":N},null,8,["modelValue"]),w("div",eO,[w("label",tO,[p[330]||(p[330]=w("span",null,"移动时长 (s)",-1)),xe(w("input",{"onUpdate:modelValue":p[160]||(p[160]=x=>y.value.config.emitterFollowDuration=x),type:"number",min:"0.05",step:"0.05",class:"inp"},null,512),[[Je,y.value.config.emitterFollowDuration,void 0,{number:!0}]])]),w("label",iO,[p[332]||(p[332]=w("span",null,"跟随空间",-1)),xe(w("select",{"onUpdate:modelValue":p[161]||(p[161]=x=>y.value.config.emitterFollowSpace=x),class:"inp"},[...p[331]||(p[331]=[w("option",{value:"local"},"局部空间(GEN 移动)",-1),w("option",{value:"world"},"世界空间(粒子生成点移动)",-1)])],512),[[kt,y.value.config.emitterFollowSpace]])])]),w("label",sO,[p[334]||(p[334]=w("span",null,"移动方向",-1)),xe(w("select",{"onUpdate:modelValue":p[162]||(p[162]=x=>y.value.config.emitterFollowDirection=x),class:"inp"},[...p[333]||(p[333]=[w("option",{value:"forward"},"正向(起点 → 终点)",-1),w("option",{value:"reverse"},"反向(终点 → 起点)",-1)])],512),[[kt,y.value.config.emitterFollowDirection]])]),Ne(Ge,{label:"偏移起始点 (0-1)",min:0,max:1,step:.01,modelValue:y.value.config.emitterFollowOffset,"onUpdate:modelValue":p[163]||(p[163]=x=>y.value.config.emitterFollowOffset=x)},null,8,["modelValue"]),p[336]||(p[336]=w("div",{class:"modifier-hint"},"局部空间会移动整个发射器;世界空间只移动新粒子的生成点,已出生粒子留在世界位置。",-1))],64)):y.value.config.emitterFollowMode==="bone"?(se(),ce(qe,{key:1},[D.value?(se(),ce("div",nO,[p[337]||(p[337]=Yt("跟随目标:",-1)),w("strong",null,Ye(D.value.spine.name)+" / "+Ye(D.value.boneName),1)])):(se(),ce("div",rO,"尚未绑定有效骨骼,请先在 Spine 层级树中选择骨骼。")),F.value&&(!D.value||F.value.spine.id!==D.value.spine.id||F.value.boneName!==D.value.boneName)?(se(),ce("button",{key:2,class:"bone-follow-rebind",onClick:p[164]||(p[164]=x=>me(y.value.config))},Ye(D.value?"重新绑定":"绑定")+"当前选中骨骼:"+Ye(F.value.spine.name)+" / "+Ye(F.value.boneName),1)):$e("",!0),D.value?(se(),ce(qe,{key:3},[w("label",oO,[p[339]||(p[339]=w("span",null,"跟随空间",-1)),xe(w("select",{"onUpdate:modelValue":p[165]||(p[165]=x=>y.value.config.emitterFollowSpace=x),class:"inp"},[...p[338]||(p[338]=[w("option",{value:"local"},"本地空间(随骨骼移动)",-1),w("option",{value:"world"},"世界空间(粒子生成后保持位置)",-1)])],512),[[kt,y.value.config.emitterFollowSpace]])]),w("div",aO,[w("label",lO,[p[340]||(p[340]=w("span",null,"位移偏移 X",-1)),xe(w("input",{"onUpdate:modelValue":p[166]||(p[166]=x=>y.value.config.emitterFollowBoneOffsetX=x),type:"number",step:"1",class:"inp"},null,512),[[Je,y.value.config.emitterFollowBoneOffsetX,void 0,{number:!0}]])]),w("label",hO,[p[341]||(p[341]=w("span",null,"位移偏移 Y",-1)),xe(w("input",{"onUpdate:modelValue":p[167]||(p[167]=x=>y.value.config.emitterFollowBoneOffsetY=x),type:"number",step:"1",class:"inp"},null,512),[[Je,y.value.config.emitterFollowBoneOffsetY,void 0,{number:!0}]])])]),w("div",cO,[w("label",uO,[p[342]||(p[342]=w("span",null,"旋转偏移",-1)),xe(w("input",{"onUpdate:modelValue":p[168]||(p[168]=x=>y.value.config.emitterFollowBoneRotation=x),type:"number",step:"1",class:"inp"},null,512),[[Je,y.value.config.emitterFollowBoneRotation,void 0,{number:!0}]])]),w("label",dO,[p[343]||(p[343]=w("span",null,"缩放偏移 X",-1)),xe(w("input",{"onUpdate:modelValue":p[169]||(p[169]=x=>y.value.config.emitterFollowBoneScaleX=x),type:"number",step:"0.05",class:"inp"},null,512),[[Je,y.value.config.emitterFollowBoneScaleX,void 0,{number:!0}]])]),w("label",fO,[p[344]||(p[344]=w("span",null,"缩放偏移 Y",-1)),xe(w("input",{"onUpdate:modelValue":p[170]||(p[170]=x=>y.value.config.emitterFollowBoneScaleY=x),type:"number",step:"0.05",class:"inp"},null,512),[[Je,y.value.config.emitterFollowBoneScaleY,void 0,{number:!0}]])])]),p[345]||(p[345]=w("div",{class:"modifier-hint"},"发射器只跟随所选 Spine 骨骼的位置,不继承 Spine 的旋转或缩放;粒子变换使用粒子系统自身参数和上方偏移。",-1))],64)):$e("",!0)],64)):$e("",!0)])):$e("",!0)]),Ne(Ge,{label:"阻尼",min:0,max:2,step:.05,modelValue:y.value.config.damping,"onUpdate:modelValue":p[171]||(p[171]=x=>y.value.config.damping=x)},null,8,["modelValue"])],512),[[Cn,!U.mods]])]),w("div",pO,[w("div",{class:"group-head",onClick:p[173]||(p[173]=x=>Y("export"))},[w("span",mO,Ye(U.export?"▸":"▾"),1),p[346]||(p[346]=w("span",null,"导出设置",-1)),w("button",{class:"group-reset",title:"重置导出设置",onClick:p[172]||(p[172]=xt(x=>te("export"),["stop"]))},"重置")]),xe(w("div",gO,[w("label",vO,[p[347]||(p[347]=w("span",null,"图片路径 (Spine Images Path)",-1)),xe(w("input",{"onUpdate:modelValue":p[174]||(p[174]=x=>t.value.imagesPath=x),class:"inp export-input",type:"text",placeholder:"./images/"},null,512),[[Je,t.value.imagesPath,void 0,{trim:!0}]])]),w("label",yO,[p[349]||(p[349]=w("span",null,"Spine 版本",-1)),xe(w("select",{"onUpdate:modelValue":p[175]||(p[175]=x=>t.value.spineVersion=x),class:"inp export-input"},[...p[348]||(p[348]=[w("option",{value:"3.8"},"Spine 3.8",-1),w("option",{value:"4.0"},"Spine 4.0",-1),w("option",{value:"4.1"},"Spine 4.1",-1),w("option",{value:"4.2"},"Spine 4.2",-1)])],512),[[kt,t.value.spineVersion]])]),w("label",xO,[p[351]||(p[351]=w("span",null,"关键帧插值曲线",-1)),xe(w("select",{"onUpdate:modelValue":p[176]||(p[176]=x=>t.value.keyframeCurve=x),class:"inp export-input"},[...p[350]||(p[350]=[w("option",{value:"linear"},"线性 (Linear)",-1),w("option",{value:"bezier"},"平滑贝塞尔 (Smooth Bézier)",-1)])],512),[[kt,t.value.keyframeCurve]])]),p[360]||(p[360]=w("div",{class:"export-help"},"平滑贝塞尔会在误差允许范围内拟合连续运动;出生、死亡、附件切换和突变仍使用阶跃关键帧。",-1)),t.value.spineVersion==="3.8"?(se(),ce("div",bO,"Spine 3.8 不支持 4.x 的逐通道数组贝塞尔,导出时会转换为经过容差精简的分段线性关键帧。")):$e("",!0),w("div",wO,[w("label",_O,[p[352]||(p[352]=w("span",null,"导出 FPS",-1)),xe(w("input",{"onUpdate:modelValue":p[177]||(p[177]=x=>t.value.fps=x),class:"inp export-input",type:"number",min:"1",max:"240",step:"1",onChange:ve},null,544),[[Je,t.value.fps,void 0,{number:!0}]])]),w("label",SO,[xe(w("input",{"onUpdate:modelValue":p[178]||(p[178]=x=>t.value.omitFps=x),type:"checkbox"},null,512),[[Lt,t.value.omitFps]]),p[353]||(p[353]=Yt("不写 fps",-1))])]),p[361]||(p[361]=w("div",{class:"export-help"},"修改 FPS 时保持动画实际秒数不变;“不写 fps”只省略 Spine 的 fps 元数据。",-1)),w("div",TO,[w("label",MO,[xe(w("input",{"onUpdate:modelValue":p[179]||(p[179]=x=>t.value.integerFrameAlignment=x),type:"checkbox"},null,512),[[Lt,t.value.integerFrameAlignment]]),p[354]||(p[354]=w("span",{class:"switch-ui"},null,-1)),p[355]||(p[355]=w("span",null,"整数帧对齐",-1))]),w("label",EO,[xe(w("input",{"onUpdate:modelValue":p[180]||(p[180]=x=>t.value.bonePool=x),type:"checkbox"},null,512),[[Lt,t.value.bonePool]]),p[356]||(p[356]=w("span",{class:"switch-ui"},null,-1)),p[357]||(p[357]=w("span",null,"骨骼对象池",-1))]),w("label",AO,[xe(w("input",{"onUpdate:modelValue":p[181]||(p[181]=x=>t.value.excludeEmptyAnimations=x),type:"checkbox"},null,512),[[Lt,t.value.excludeEmptyAnimations]]),p[358]||(p[358]=w("span",{class:"switch-ui"},null,-1)),p[359]||(p[359]=w("span",null,"排除无内容动画",-1))])])],512),[[Cn,!U.export]])])],64)):$e("",!0)]),w("button",{type:"button",class:"export-spine-json",disabled:l.value,title:l.value?"正在重新计算并烘焙动画":`导出 Spine ${t.value.spineVersion} JSON`,onClick:v},Ye(l.value?"正在准备导出…":"导出Spine Json"),9,CO),c.value?(se(),ce("div",{key:0,class:Ze(["export-message",{error:u.value}])},Ye(c.value),3)):$e("",!0)]))}}),RO=Ks(IO,[["__scopeId","data-v-ea10f1c0"]]),PO={class:"timeline"},kO={class:"tl-controls"},FO=["title"],OO={class:"tl-frame"},BO=["disabled"],LO=["onClick"],DO={key:0},NO={class:"tl-animation-editor"},UO={key:0,class:"tl-animation-error"},VO={class:"tl-animation-actions"},XO=["disabled"],YO={key:1,class:"tl-animation-hint"},$O={class:"tl-anim tl-spine-preview"},GO=["value","disabled"],jO={value:""},HO=["value"],WO={class:"tl-zoom"},zO={class:"tl-ticks"},qO={class:"tl-ticklabel"},KO={class:"tl-lanes"},ZO=["onPointerdown"],JO={class:"lane-name"},QO=["onPointerdown"],e3=["onPointerdown"],t3={class:"lane-name"},i3={key:0,class:"tl-empty"},s3=Ws({__name:"Timeline",setup(i){const e=Aa(),t=it(null),s=it(null),n=it(!1),r=it("animation"),o=it("");No(()=>{(!Array.isArray(e.timeline.animations)||!e.timeline.animations.length)&&(e.timeline.animations=["animation"]),e.timeline.animations.includes(e.timeline.animation)||(e.timeline.animation=e.timeline.animations[0]);for(const H of e.systems)(!H.animation||!e.timeline.animations.includes(H.animation))&&(H.animation=e.timeline.animations[0])});const a=ut(()=>e.systems.find(H=>H.id===e.activeId)||null);function h(){a.value&&(n.value=!n.value,r.value=a.value.animation,o.value="")}function l(H){const Z=a.value;Z&&(e.setSystemAnimation(Z.id,H),r.value=H,o.value="")}function c(){const H=e.addAnimation();r.value=H,o.value=""}function u(){var ae;const H=((ae=a.value)==null?void 0:ae.animation)||e.timeline.animation,Z=r.value.trim();if(!Z){o.value="动画名称不能为空";return}if(Z!==H&&e.timeline.animations.includes(Z)){o.value="动画名称不能重复";return}if(!e.renameAnimation(H,Z)){o.value="无法修改动画名称";return}r.value=Z,o.value=""}function f(){var ae,me;const H=((ae=a.value)==null?void 0:ae.animation)||e.timeline.animation;if(!e.removeAnimation(H)){o.value="至少需要保留一个动画";return}const Z=((me=a.value)==null?void 0:me.animation)||e.timeline.animation;r.value=Z,o.value=""}function d(H){var Z;(Z=s.value)!=null&&Z.contains(H.target)||(n.value=!1)}_o(()=>document.addEventListener("pointerdown",d)),a0(()=>document.removeEventListener("pointerdown",d));const m=ut(()=>Math.max(1,e.timeline.fps||30)),g=it(120),b=it({}),_=it({}),M=it({}),v=ut(()=>e.timeline.totalFrames),S=ut(()=>g.value<=30?"放大":g.value>=300?"缩小":"适中"),y=ut(()=>e.spines.filter(H=>H.selectedAnimation&&H.animations.some(Z=>Z.name===H.selectedAnimation&&Z.duration>0))),I=ut(()=>(e.activeObjectType==="spine"?e.spines.find(Z=>Z.id===e.activeObjectId&&Z.animations.length):null)||e.spines.find(Z=>Z.animations.length)||null);function E(H){const Z=I.value;Z&&(Z.selectedAnimation=H.target.value,e.recalcTotalFrames(),e.timeline.frame=0)}function C(){var Z;const H=((Z=t.value)==null?void 0:Z.clientWidth)||600;return g.value/H}const R=ut(()=>{const H=[],Z=g.value;let ae=1;g.value<=10?ae=1:g.value<=50?ae=5:g.value<=200?ae=10:g.value<=500?ae=50:ae=100;for(let me=0;me<=Z;me+=ae)H.push({f:me,px:me/C()});return H}),B=ut(()=>e.timeline.frame/C());function k(H){const Z=H.config;return(b.value[H.id]??Math.max(0,Number(Z.delay)||0))*m.value/C()}function F(H){const Z=H.config,ae=Math.max(0,Number(Z.lifeMin)||0),me=Math.max(0,Number(Z.lifeMax)||0);return Z.lifeMode==="fixed"?ae:Math.max(ae,me)}function D(H){return j(H)}function N(H){if(H.config.mode!=="stream"||O(H))return 0;if(H.config.streamBehavior==="loop"){const ae=H.config,me=Math.max(1,Math.ceil(Number(ae.loopDurationFrames)||1));if(ae.generateLoopStartAnimation){const _e=Math.max(1,Math.ceil(F(H)*m.value/me));return me*_e/C()}return me/C()}return(_.value[H.id]??Math.max(1/m.value,Number(H.config.duration)||1))*m.value/C()}function j(H){const Z=H.config;return Z.mode==="stream"&&Z.streamBehavior==="loop"?Z.generateLoopEndAnimation?(F(H)*m.value+1)/C():N(H):N(H)+F(H)*m.value/C()}function O(H){const Z=H.config;return Z.mode==="stream"&&Z.streamBehavior==="loop"&&Z.generateLoopEndAnimation}function L(H){var Z;return((Z=H.animations.find(ae=>ae.name===H.selectedAnimation))==null?void 0:Z.duration)||0}function P(H){return(M.value[H.id]??Math.max(0,Number(H.timeOffset)||0))*m.value/C()}function X(H){return L(H)*m.value/C()}function U(H){const Z=H.deltaY<0?.8:1.25;let ae=g.value*Z;ae=Math.min(2e3,Math.max(10,ae)),g.value=Math.round(ae)}function Y(H){const Z=t.value,ae=_e=>{const te=Z.getBoundingClientRect(),ve=Math.floor((_e.clientX-te.left)/te.width*g.value);e.timeline.frame=Math.max(0,Math.min(ve,v.value-1))};ae(H);const me=()=>{window.removeEventListener("pointermove",ae),window.removeEventListener("pointerup",me)};window.addEventListener("pointermove",ae),window.addEventListener("pointerup",me)}function q(H,Z){H.stopPropagation();const ae=H.clientX,me=Math.max(0,Number(Z.config.delay)||0),_e=C()/m.value,te=J=>{const Q=(J.clientX-ae)*_e,ie=Math.max(0,Math.min(me+Q,600));b.value[Z.id]=Math.round(ie*m.value)/m.value},ve=J=>{window.removeEventListener("pointermove",te),window.removeEventListener("pointerup",$),window.removeEventListener("pointercancel",W);const Q=b.value[Z.id];delete b.value[Z.id],J&&Q!=null&&Q!==me&&(Z.config.delay=Q)},$=()=>ve(!0),W=()=>ve(!1);window.addEventListener("pointermove",te),window.addEventListener("pointerup",$),window.addEventListener("pointercancel",W)}function z(H,Z){var Q;if(H.stopPropagation(),O(Z))return;const ae=Math.max(0,Number(Z.config.duration)||0),me=C()/m.value,_e=((Q=H.currentTarget.closest(".lane-bar"))==null?void 0:Q.getBoundingClientRect().left)??H.clientX;let te=!1;const ve=ie=>{te=!0;const ue=Math.max(1/m.value,Math.min((ie.clientX-_e)*me,600));_.value[Z.id]=Math.round(ue*m.value)/m.value},$=ie=>{window.removeEventListener("pointermove",ve),window.removeEventListener("pointerup",W),window.removeEventListener("pointercancel",J);const ue=_.value[Z.id];delete _.value[Z.id],ie&&te&&ue!=null&&ue!==ae&&(Z.config.duration=ue)},W=()=>$(!0),J=()=>$(!1);window.addEventListener("pointermove",ve),window.addEventListener("pointerup",W),window.addEventListener("pointercancel",J)}function ne(H,Z){H.stopPropagation();const ae=H.clientX,me=Math.max(0,Number(Z.timeOffset)||0),_e=C()/m.value,te=J=>{const Q=Math.max(0,Math.min(me+(J.clientX-ae)*_e,600));M.value[Z.id]=Math.round(Q*m.value)/m.value},ve=J=>{window.removeEventListener("pointermove",te),window.removeEventListener("pointerup",$),window.removeEventListener("pointercancel",W);const Q=M.value[Z.id];delete M.value[Z.id],J&&Q!=null&&Q!==me&&(Z.timeOffset=Q,e.recalcTotalFrames())},$=()=>ve(!0),W=()=>ve(!1);window.addEventListener("pointermove",te),window.addEventListener("pointerup",$),window.addEventListener("pointercancel",W)}return(H,Z)=>{var ae,me,_e;return se(),ce("div",PO,[w("div",kO,[w("button",{class:Ze(["tl-btn",{on:Pe(e).timeline.playing}]),onClick:Z[0]||(Z[0]=te=>Pe(e).togglePlay()),title:Pe(e).timeline.playing?"暂停 (D)":"播放 (D)"},Ye(Pe(e).timeline.playing?"❚❚":"▶"),11,FO),w("button",{class:"tl-btn",onClick:Z[1]||(Z[1]=te=>Pe(e).toStart()),title:"回到第一帧 (S)"},"⏮"),w("button",{class:"tl-btn",onClick:Z[2]||(Z[2]=te=>Pe(e).previousFrame()),title:"前一帧"},"◀"),w("button",{class:"tl-btn",onClick:Z[3]||(Z[3]=te=>Pe(e).nextFrame()),title:"后一帧"},"▶"),w("button",{class:"tl-btn",onClick:Z[4]||(Z[4]=te=>Pe(e).toEnd()),title:"移动到最后一帧"},"⏭"),w("button",{class:Ze(["tl-btn",{on:Pe(e).timeline.loop}]),onClick:Z[5]||(Z[5]=te=>Pe(e).toggleLoop()),title:"循环"},"⟳",2),w("span",OO,[Z[8]||(Z[8]=Yt("帧 ",-1)),w("b",null,Ye(Pe(e).timeline.frame),1),Z[9]||(Z[9]=Yt(" / ",-1)),w("b",null,Ye(Math.max(0,Pe(e).timeline.totalFrames-1)),1)]),Z[14]||(Z[14]=w("span",{class:"tl-legend"},[w("i",{class:"legend-emission"}),Yt("持续发射 "),w("i",{class:"legend-life"}),Yt("粒子存在 "),w("i",{class:"legend-spine"}),Yt("Spine 动画")],-1)),w("div",{ref_key:"animationMenuRef",ref:s,class:"tl-anim tl-owner-animation"},[Z[12]||(Z[12]=w("span",null,"所属动画",-1)),w("button",{class:"tl-animation-trigger",disabled:!a.value,title:"设置当前粒子系统所属的动画",onClick:xt(h,["stop"])},[w("span",null,Ye(((ae=a.value)==null?void 0:ae.animation)||Pe(e).timeline.animation),1),Z[10]||(Z[10]=w("i",null,"⌄",-1))],8,BO),n.value?(se(),ce("div",{key:0,class:"tl-animation-menu",onPointerdown:Z[7]||(Z[7]=xt(()=>{},["stop"]))},[Z[11]||(Z[11]=w("div",{class:"tl-animation-menu-title"},"选择所属动画",-1)),(se(!0),ce(qe,null,Ht(Pe(e).timeline.animations,te=>{var ve,$;return se(),ce("button",{key:te,class:Ze(["tl-animation-option",{on:((ve=a.value)==null?void 0:ve.animation)===te}]),onClick:W=>l(te)},[w("span",null,Ye(te),1),(($=a.value)==null?void 0:$.animation)===te?(se(),ce("i",DO,"✓")):$e("",!0)],10,LO)}),128)),w("div",NO,[xe(w("input",{"onUpdate:modelValue":Z[6]||(Z[6]=te=>r.value=te),class:"tl-animation-name",maxlength:"64","aria-label":"动画名称",onKeydown:da(u,["enter"])},null,544),[[Je,r.value]]),w("button",{title:"重命名当前动画",onClick:u},"重命名")]),o.value?(se(),ce("div",UO,Ye(o.value),1)):$e("",!0),w("div",VO,[w("button",{onClick:c},"+ 新增"),w("button",{disabled:Pe(e).timeline.animations.length<=1,onClick:f},"删除",8,XO)]),Pe(e).timeline.animations.length<=1?(se(),ce("div",YO,"至少需要保留一个动画")):$e("",!0)],32)):$e("",!0)],512),w("label",$O,[Z[13]||(Z[13]=Yt("Spine 预览动画 ",-1)),w("select",{class:"tl-sel",value:((me=I.value)==null?void 0:me.selectedAnimation)||"",disabled:!I.value,onChange:E},[w("option",jO,Ye(I.value?"无":"无可用 Spine 动画"),1),(se(!0),ce(qe,null,Ht(((_e=I.value)==null?void 0:_e.animations)||[],te=>(se(),ce("option",{key:te.name,value:te.name},Ye(te.name)+"("+Ye(te.duration.toFixed(2))+"s) ",9,HO))),128))],40,GO)]),w("span",WO,Ye(S.value),1)]),w("div",{class:"tl-viewport",ref_key:"vpRef",ref:t,onWheel:xt(U,["prevent"]),onPointerdown:Y},[w("div",zO,[(se(!0),ce(qe,null,Ht(R.value,te=>(se(),ce("div",{key:te.f,class:"tl-tickline",style:Pi({left:te.px+"px"})},[w("span",qO,Ye(te.f)+"f",1)],4))),128))]),w("div",{class:"tl-playhead",style:Pi({left:B.value+"px"})},null,4),w("div",KO,[(se(!0),ce(qe,null,Ht(Pe(e).systems,(te,ve)=>(se(),ce("div",{key:te.id,class:"tl-lane"},[Z[15]||(Z[15]=w("span",{class:"lane-ico"},"●",-1)),w("div",{class:"lane-bar",style:Pi({left:k(te)+"px",width:D(te)+"px"}),onPointerdown:xt($=>q($,te),["stop"])},[w("span",JO,Ye(te.config.name||"系统 "+(ve+1)),1),w("span",{class:"bar-life",style:Pi({width:j(te)+"px"})},null,4),te.config.mode==="stream"&&!O(te)?(se(),ce("span",{key:0,class:"bar-emission",style:Pi({width:N(te)+"px"})},[w("span",{class:"bar-handle",title:"拖动持续发射时长",onPointerdown:xt($=>z($,te),["stop"])},null,40,QO)],4)):$e("",!0)],44,ZO)]))),128)),(se(!0),ce(qe,null,Ht(y.value,te=>(se(),ce("div",{key:`spine-${te.id}`,class:"tl-lane spine-lane"},[Z[16]||(Z[16]=w("span",{class:"lane-ico spine-ico"},"◆",-1)),w("div",{class:"spine-bar",style:Pi({left:P(te)+"px",width:X(te)+"px"}),title:"拖动调整动画开始时间",onPointerdown:xt(ve=>ne(ve,te),["stop"])},[w("span",t3,Ye(te.name)+" · "+Ye(te.selectedAnimation),1)],44,e3)]))),128)),!Pe(e).systems.length&&!y.value.length?(se(),ce("div",i3,"暂无可显示的动画数据")):$e("",!0)])],544)])}}}),n3=Ks(s3,[["__scopeId","data-v-0ef42eef"]]),r3={class:"right"},o3={class:"stage-area"},a3=Ws({__name:"App",setup(i){const e=Aa();FE(e);const t=it(360),s=it(180);function n(o){o.preventDefault();const a=l=>{const c=e.settings.parameterPanelOnRight?window.innerWidth-l.clientX:l.clientX,u=Math.max(240,Math.min(c,window.innerWidth-200));t.value=u},h=()=>{window.removeEventListener("pointermove",a),window.removeEventListener("pointerup",h)};window.addEventListener("pointermove",a),window.addEventListener("pointerup",h)}function r(o){o.preventDefault();const a=o.clientY,h=s.value,l=u=>{const f=Math.max(80,Math.min(h+(a-u.clientY),window.innerHeight-200));s.value=f},c=()=>{window.removeEventListener("pointermove",l),window.removeEventListener("pointerup",c)};window.addEventListener("pointermove",l),window.addEventListener("pointerup",c)}return(o,a)=>(se(),ce("div",{class:Ze(["layout",{"panel-right":Pe(e).settings.parameterPanelOnRight}])},[w("div",{class:"parameter-panel",style:Pi({width:t.value+"px"})},[Ne(RO)],4),w("div",{class:"resizer-col",onPointerdown:n},null,32),w("div",r3,[w("div",o3,[Ne(zC)]),w("div",{class:"resizer-row",onPointerdown:r,title:"拖动调整时间轴高度"},null,32),w("div",{class:"timeline-area",style:Pi({height:s.value+"px"})},[Ne(n3)],4)])],2))}}),l3=Ks(a3,[["__scopeId","data-v-8eacccdc"]]);Hb(l3).use(qb()).mount("#app"); +`;class ox extends Bn{constructor(e){super(e),this.shaderGenerator=new hv(DA,NA),this.geometryClass=LA,this.vertexSize=7}packInterleavedGeometry(e,t,s,n,r){const{uint32View:o,float32View:a}=t,h=n/this.vertexSize,l=e.uvs,c=e.indices,u=e.vertexData,f=e._texture.baseTexture._batchLocation,d=Math.min(e.worldAlpha,1),m=At.shared.setValue(e._tintRGB).toPremultiplied(d,!0),g=At.shared.setValue(e._darkTintRGB).premultiply(d,!0).toPremultiplied(1,!1);for(let b=0;ba.id===r)||(this.container.removeChild(o.root),o.root.destroy({children:!0}),this.entries.delete(r));for(const r of e){const o=EE(r.id);let a=this.entries.get(r.id);if(a&&a.assetVersion!==r.assetVersion&&!o&&(this.container.removeChild(a.root),a.root.destroy({children:!0}),this.entries.delete(r.id),a=void 0),(!a||a.assetVersion!==r.assetVersion)&&o){a&&(this.container.removeChild(a.root),a.root.destroy({children:!0}));const f=new gi,d=new Rd({skeletonData:o.skeletonData,autoUpdate:!1,darkTint:!1});o.skeletonData.defaultSkin&&d.skeleton.setSkin(o.skeletonData.defaultSkin),d.skeleton.setSlotsToSetupPose(),f.addChild(d),this.container.addChild(f),a={root:f,spine:d,assetVersion:r.assetVersion,animation:""},this.entries.set(r.id,a)}if(!a)continue;const h=a.root,l=a.spine,c=r.visible!==!1&&r.enabled;h.visible=c,h.renderable=c,h.position.set(r.x,-r.y),h.rotation=-r.rotation*Math.PI/180,h.scale.set(r.scaleX,r.scaleY),a.animation!==r.selectedAnimation&&(a.animation=r.selectedAnimation,l.skeleton.setToSetupPose(),l.state.clearTracks(),a.animation&&l.state.setAnimation(0,a.animation,!1));const u=l.state.getCurrent(0);if(u){const f=((n=r.animations.find(m=>m.name===r.selectedAnimation))==null?void 0:n.duration)||0,d=Math.max(0,t/Math.max(1,s)-r.timeOffset);u.trackTime=f>0?Math.min(d,f):d}l.update(0)}}getBoneWorldTransform(e,t){const s=this.entries.get(e),n=s==null?void 0:s.spine.skeleton.findBone(t);if(!s||!n||!n.active)return null;const r=s.root,o=Math.cos(r.rotation),a=Math.sin(r.rotation),h=o*r.scale.x,l=-a*r.scale.y,c=a*r.scale.x,u=o*r.scale.y,f=h*n.a+l*n.c,d=h*n.b+l*n.d,m=c*n.a+u*n.c,g=c*n.b+u*n.d,b=r.position.x+h*n.worldX+l*n.worldY,_=r.position.y+c*n.worldX+u*n.worldY;return{x:b,y:-_,rotation:-Math.atan2(m,f)*180/Math.PI,scaleX:Math.max(1e-4,Math.hypot(f,m)),scaleY:Math.max(1e-4,Math.hypot(d,g))}}destroy(){for(const e of this.entries.values())e.root.removeFromParent(),e.root.destroy({children:!0});this.entries.clear(),this.container.removeFromParent(),this.container.destroy({children:!0})}}function Yn(i,e,t){const s=Number(i[e]);return Number.isFinite(s)?s:t}function ki(i,e,t,s){i[e]==null&&(i[e]=Yn(i,t,s))}function pf(i,e,t){if(typeof i.curve!="number")return;const s=Yn(i,"time",0),r=Yn(e,"time",0)-s,o=i.curve,a=Yn(i,"c2",0),h=Yn(i,"c3",1),l=Yn(i,"c4",1);i.curve=t.flatMap(([c,u])=>[s+r*o,c+(u-c)*a,s+r*h,c+(u-c)*l]),delete i.c2,delete i.c3,delete i.c4}function Wn(i,e){if(Array.isArray(i))for(let t=0;t[Yn(s,r,o),Yn(n,r,o)]))}}function VA(i){if(Array.isArray(i))for(let e=0;eNumber.parseInt(s.slice(r,r+2),16)/255);return e?n:n.slice(0,3)}function dg(i,e){if(Array.isArray(i))for(let t=0;t[a,o[h]]))}}function XA(i){for(const e of i.bones||[])e.inherit==null&&e.transform!=null&&(e.inherit=e.transform);for(const e of i.transform||[])ki(e,"mixRotate","rotateMix",1),ki(e,"mixX","translateMix",1),e.mixY==null&&(e.mixY=e.mixX),ki(e,"mixScaleX","scaleMix",1),e.mixScaleY==null&&(e.mixScaleY=e.mixScaleX),ki(e,"mixShearY","shearMix",1);for(const e of i.path||[])ki(e,"mixRotate","rotateMix",1),ki(e,"mixX","translateMix",1),e.mixY==null&&(e.mixY=e.mixX)}function YA(i){for(const e of i.skins||[])for(const t of Object.values(e.attachments||{}))for(const s of Object.values(t||{}))s.parent!=null&&s.timelines==null&&s.deform!=null&&(s.timelines=s.deform)}function $A(i){for(const e of Object.values(i.slots||{}))e.color&&!e.rgba&&(e.rgba=e.color,delete e.color),e.twoColor&&!e.rgba2&&(e.rgba2=e.twoColor,delete e.twoColor),dg(e.rgba,!1),dg(e.rgba2,!0)}function GA(i){for(const e of Object.values(i.bones||{})){for(const t of e.rotate||[])ki(t,"value","angle",0);Wn(e.rotate,[{key:"value",fallback:0}]),Wn(e.translate,[{key:"x",fallback:0},{key:"y",fallback:0}]),Wn(e.scale,[{key:"x",fallback:1},{key:"y",fallback:1}]),Wn(e.shear,[{key:"x",fallback:0},{key:"y",fallback:0}])}}function jA(i){for(const e of Object.values(i.ik||{}))Wn(e,[{key:"mix",fallback:1},{key:"softness",fallback:0}])}function HA(i){for(const e of Object.values(i.transform||{})){for(const t of e)ki(t,"mixRotate","rotateMix",1),ki(t,"mixX","translateMix",1),t.mixY==null&&(t.mixY=t.mixX),ki(t,"mixScaleX","scaleMix",1),t.mixScaleY==null&&(t.mixScaleY=t.mixScaleX),ki(t,"mixShearY","shearMix",1);Wn(e,[{key:"mixRotate",fallback:1},{key:"mixX",fallback:1},{key:"mixY",fallback:1},{key:"mixScaleX",fallback:1},{key:"mixScaleY",fallback:1},{key:"mixShearY",fallback:1}])}}function WA(i){for(const e of Object.values(i.path||{})){for(const s of["position","spacing"]){const n=e[s];for(const r of n||[])ki(r,"value",s,0);Wn(n,[{key:"value",fallback:0}])}const t=e.mix;for(const s of t||[])ki(s,"mixRotate","rotateMix",1),ki(s,"mixX","translateMix",1),s.mixY==null&&(s.mixY=s.mixX);Wn(t,[{key:"mixRotate",fallback:1},{key:"mixX",fallback:1},{key:"mixY",fallback:1}])}}function zA(i){if(!i.deform)return;const e=i.attachments||(i.attachments={});for(const[t,s]of Object.entries(i.deform)){const n=e[t]||(e[t]={});for(const[r,o]of Object.entries(s)){const a=n[r]||(n[r]={});for(const[h,l]of Object.entries(o)){const c=a[h]||(a[h]={});c.deform=l,VA(l)}}}delete i.deform}function ax(i){XA(i),YA(i);for(const e of Object.values(i.animations||{}))$A(e),GA(e),jA(e),HA(e),WA(e),zA(e),!e.drawOrder&&e.draworder&&(e.drawOrder=e.draworder);return i}function fg(i){return i.replace(/\\/g,"/").split("/").pop()||i}async function qA(i){const e=URL.createObjectURL(i);return await et.fromURL(e)}function KA(i){const e=new Map;return i.bones.map(t=>{var r;const s=((r=t.parent)==null?void 0:r.name)||null,n=s?(e.get(s)||0)+1:0;return e.set(t.name,n),{name:t.name,parent:s,depth:n}})}async function lx(i,e,t){var o;if(!/\.(json|skel)$/i.test(i.name))throw new Error("Spine 数据仅支持 .json 或 .skel");if(!/\.atlas$/i.test(e.name))throw new Error("图集文件仅支持 .atlas");if(!t.length)throw new Error("请至少选择一张纹理图片");const s=new Ky(await e.text()),n=new Map(t.map(a=>[fg(a.name).toLowerCase(),a])),r=[];try{for(const c of s.pages){const u=n.get(fg(c.name).toLowerCase());if(!u)throw new Error(`Atlas 引用的纹理未选择:${c.name}`);const f=await qA(u);f.baseTexture.alphaMode=c.pma?ui.PMA:ui.UNPACK,r.push(f),c.setTexture(Ar.from(f.baseTexture))}const a=new Md(s);let h,l=null;if(/\.skel$/i.test(i.name))h=new Cd(a).readSkeletonData(await i.arrayBuffer()),l=Wl(h.version);else{let c;try{c=JSON.parse(await i.text())}catch{throw new Error("Spine JSON 文件格式无效")}if(l=Wl((o=c==null?void 0:c.skeleton)==null?void 0:o.spine),!l)throw new Error(`Spine JSON 版本不受支持,仅支持 ${Sd()}`);l==="3.8"&&ax(c),h=new ih(a).readSkeletonData(c)}if(!l)throw new Error(`Spine 数据版本不受支持,仅支持 ${Sd()}`);return{skeletonData:h,textures:r,dataVersion:l,animations:h.animations.map(c=>({name:c.name,duration:c.duration})),bones:KA(h)}}catch(a){for(const h of r)h.destroy(!0);throw a}}function wl(i){return new Promise((e,t)=>{const s=new FileReader;s.onload=()=>e(String(s.result||"")),s.onerror=()=>t(s.error),s.readAsDataURL(i)})}async function ZA(i,e,t){return{skeleton:{name:i.name,dataUrl:await wl(i)},atlas:{name:e.name,dataUrl:await wl(e)},textures:await Promise.all(t.map(async s=>({name:s.name,dataUrl:await wl(s)})))}}async function Au(i){const e=await fetch(i.dataUrl);if(!e.ok)throw new Error(`无法读取内嵌 Spine 文件:${i.name}`);return new File([await e.blob()],i.name)}async function JA(i){return{skeleton:await Au(i.skeleton),atlas:await Au(i.atlas),textures:await Promise.all(i.textures.map(Au))}}const hx="SpineParticle.EditorConfig",cx=1;function ux(i){return{backgroundX:i.backgroundX,backgroundY:i.backgroundY,backgroundOpacity:i.backgroundOpacity,backgroundImageName:i.backgroundImageName,backgroundImageData:i.backgroundImageData,showGrid:i.showGrid,exportSettings:Ut(i.exportSettings)}}function QA(i){return JSON.parse(JSON.stringify(i,(e,t)=>{if(!(e==="texture"||e==="trailTexture"||e==="frames"))return t}))}function eC(i){const e=ux(i.settings);return QA({format:hx,version:cx,savedAt:new Date().toISOString(),editor:Ut(i.editor),settings:e,timeline:{fps:i.timeline.fps,loop:i.timeline.loop,animations:[...i.timeline.animations]},selection:{type:i.activeObjectType,id:i.activeObjectId},scene:{systems:i.systems.map(t=>({...Ut(t),frames:void 0})),colliders:Ut(i.colliders),paths:Ut(i.paths),spines:Ut(i.spines)}})}function tC(){return`SpineParticle-${new Date().toISOString().replace(/[-:]/g,"").replace(/\.\d{3}Z$/,"").replace("T","-")}.json`}function dx(i){const e=eC(i),t=new Blob([JSON.stringify(e,null,2)],{type:"application/json;charset=utf-8"}),s=URL.createObjectURL(t),n=document.createElement("a");return n.href=s,n.download=tC(),document.body.appendChild(n),n.click(),n.remove(),setTimeout(()=>URL.revokeObjectURL(s),0),e}function fx(i){let e;try{e=JSON.parse(i)}catch{throw new Error("配置文件不是有效的 JSON")}const t=e;if(t.format!==hx)throw new Error("不是 SpineParticle 编辑器配置文件");if(t.version!==cx)throw new Error(`暂不支持配置版本:${t.version??"未知"}`);if(!t.scene||!Array.isArray(t.scene.systems)||!Array.isArray(t.scene.colliders)||!Array.isArray(t.scene.paths)||!Array.isArray(t.scene.spines))throw new Error("配置文件缺少完整场景数据");return t}async function iC(i){const e=new Map,t=n=>{const r=n==="/particles/star.png"?"/images/star.png":n==="/trails/trail.png"?"/images/trail.png":n||"/images/star.png";let o=e.get(r);return o||(o=et.fromURL(r).then(a=>$n(a)),e.set(r,o)),o},s=await t("/images/star.png");await Promise.all(i.map(async n=>{var o;const r=Tr(n.config);r.texture=s,await Promise.all(r.imageResources.map(async a=>{a.texture=await t(a.previewUrl||"/images/star.png"),await Promise.all(a.sequenceFrames.map(async h=>{h.texture=await t(h.previewUrl||a.previewUrl||"/images/star.png")}))})),await Promise.all(r.trailResources.map(async a=>{a.texture=await t(a.previewUrl||"/images/trail.png")})),r.trailTexture=((o=r.trailResources[0])==null?void 0:o.texture)||null,n.frames=[]}))}async function sC(i){const e=new Map;try{for(const t of i){if(!t.sourceBundle)continue;const s=await JA(t.sourceBundle);e.set(t.id,await lx(s.skeleton,s.atlas,s.textures))}return e}catch(t){for(const s of e.values())for(const n of s.textures)n.destroy(!0);throw t}}function nC(i,e){const t=(e==null?void 0:e.type)||"particle",s=Number(e==null?void 0:e.id)||0;(t==="particle"?i.systems.some(r=>r.id===s):t==="collision"?i.colliders.some(r=>r.id===s):t==="path"?i.paths.some(r=>r.id===s):i.spines.some(r=>r.id===s))?i.selectSceneObject(t,s):i.systems[0]?i.selectSceneObject("particle",i.systems[0].id):i.colliders[0]?i.selectSceneObject("collision",i.colliders[0].id):i.paths[0]?i.selectSceneObject("path",i.paths[0].id):i.spines[0]?i.selectSceneObject("spine",i.spines[0].id):(i.activeObjectType="particle",i.activeObjectId=0,i.activeId=0)}async function rC(i,e){var c,u,f,d,m;const t=fx(JSON.stringify(e)),s=Ut(t.scene.systems),n=Ut(t.scene.colliders),r=Ut(t.scene.paths),o=Ut(t.scene.spines);for(const g of o)g.sourceBundle==null&&(g.sourceBundle=null),g.dataVersion==null&&(g.dataVersion="");await iC(s);const a=await sC(o),h=new Map(i.spines.map(g=>[g.id,g.assetVersion]));for(const g of i.spines)Ea(g.id);i.systems=s,i.colliders=n,i.paths=r,i.spines=o,Object.assign(i.editor,Ut(t.editor||{}));const l=t.settings;if(l)for(const g of["backgroundX","backgroundY","backgroundOpacity","backgroundImageName","backgroundImageData","showGrid"])Object.prototype.hasOwnProperty.call(l,g)&&(i.settings[g]=l[g]);i.settings.exportSettings=gy((c=t.settings)==null?void 0:c.exportSettings),i.settings.undoLimit=Math.min(200,Math.max(1,Math.round(Number(i.settings.undoLimit)||20))),i.timeline.fps=Math.max(1,Math.round(Number((u=t.timeline)==null?void 0:u.fps)||30)),i.timeline.loop=((f=t.timeline)==null?void 0:f.loop)!==!1,i.timeline.animations=Array.isArray((d=t.timeline)==null?void 0:d.animations)&&t.timeline.animations.length?[...new Set(t.timeline.animations.filter(g=>typeof g=="string"&&g.trim()).map(g=>g.trim()))]:["animation"];for(const g of i.spines){const b=a.get(g.id);if(g.assetVersion=Math.max(Number(g.assetVersion)||0,h.get(g.id)||0)+1,!b){g.status="empty",g.error=g.skeletonFileName?"配置未包含可复用的 Spine 原始资源":"",g.animations=[],g.bones=[],g.selectedAnimation="";continue}Lh(g.id,b),g.dataVersion=b.dataVersion,g.animations=b.animations,g.bones=b.bones,b.animations.some(_=>_.name===g.selectedAnimation)||(g.selectedAnimation=((m=b.animations[0])==null?void 0:m.name)||""),g.status="ready",g.error=""}i.syncSceneSequences(),nC(i,t.selection),i.timeline.frame=0,i.timeline.recorded=!1,i.timeline.playing=!0;for(const g of i.systems)i.timeline.animations.includes(g.animation)||(g.animation=i.timeline.animations[0]);return i.recalcTotalFrames(),t}async function px(i,e){return rC(i,fx(e))}async function oC(i,e){if(!/\.json$/i.test(e.name))throw new Error("请选择 .json 配置文件");return px(i,await e.text())}const Vh=wo({undoCount:0});let sh=null,pn=null,qn=[],Do=null,mn=null,nh=!1;function mf(i){return{systems:i.systems.map(t=>{const s=Ut(t);return s.frames=void 0,s}),colliders:Ut(i.colliders),paths:Ut(i.paths),spines:Ut(i.spines),animations:[...i.timeline.animations],settings:ux(i.settings)}}function gf(i){return JSON.stringify(i,(e,t)=>e==="texture"||e==="trailTexture"?null:typeof t=="string"&&t.startsWith("data:")&&t.length>256?`${t.length}:${t.slice(0,96)}:${t.slice(-48)}`:t)}function mx(i,e=mf(i),t=gf(e)){const s=new Map;for(const n of e.spines){const r=AE(n.id);r&&s.set(n.id,r)}return{data:e,signature:t,spineAssets:s}}function rh(i){if(i){for(const e of i.spineAssets.values())ME(e);i.spineAssets.clear()}}function gx(i){for(;qn.length>i;)rh(qn.shift()||null);Vh.undoCount=qn.length}function vx(){const i=sh;if(!i||!pn||nh)return;const e=mf(i),t=gf(e);t!==pn.signature&&(qn.push(pn),pn=mx(i,e,t),gx(i.settings.undoLimit))}function aC(){nh||(mn&&clearTimeout(mn),mn=setTimeout(()=>{mn=null,vx()},250))}function lC(i){const e=i.activeObjectId;return i.activeObjectType==="particle"?i.systems.some(t=>t.id===e):i.activeObjectType==="collision"?i.colliders.some(t=>t.id===e):i.activeObjectType==="path"?i.paths.some(t=>t.id===e):i.spines.some(t=>t.id===e)}function hC(i){var t,s;if(!lC(i)){const n=i.systems[0],r=i.colliders[0],o=i.paths[0],a=i.spines[0];n?(i.activeObjectType="particle",i.activeObjectId=n.id):r?(i.activeObjectType="collision",i.activeObjectId=r.id):o?(i.activeObjectType="path",i.activeObjectId=o.id):(i.activeObjectType="spine",i.activeObjectId=(a==null?void 0:a.id)||0)}const e=i.activeObjectType==="particle"?i.systems.find(n=>n.id===i.activeObjectId):i.systems.find(n=>n.id===i.activeId);i.activeId=(e==null?void 0:e.id)||((t=i.systems[0])==null?void 0:t.id)||0,i.timeline.animation=(e==null?void 0:e.animation)||((s=i.systems[0])==null?void 0:s.animation)||i.timeline.animations[0]||"animation"}function cC(i,e){const t=pn;nh=!0;try{for(const s of i.spines)Ea(s.id);i.systems=Ut(e.data.systems),i.colliders=Ut(e.data.colliders),i.paths=Ut(e.data.paths),i.spines=Ut(e.data.spines),i.timeline.animations=[...e.data.animations],Object.assign(i.settings,Ut(e.data.settings));for(const[s,n]of e.spineAssets)Lh(s,n);for(const s of i.systems)s.frames=[];i.timeline.recorded=!1,i.timeline.playing=!1,hC(i),i.recalcTotalFrames(),pn=e}finally{nh=!1,rh(t)}}function uC(i){if(!(sh===i&&Do)){Do==null||Do(),mn&&clearTimeout(mn),rh(pn);for(const e of qn)rh(e);qn=[],sh=i,pn=mx(i),Vh.undoCount=0,Do=cs(()=>gf(mf(i)),aC,{flush:"post"})}}function dC(i,e){const t=Math.min(200,Math.max(1,Math.round(Number(e)||20)));i.settings.undoLimit=t,gx(t)}function Cu(){const i=sh;if(!i||!pn)return!1;mn&&(clearTimeout(mn),mn=null),vx();const e=qn.pop();return e?(cC(i,e),Vh.undoCount=qn.length,!0):!1}function fC(i){const e=i instanceof HTMLElement?i:null;return!!(e!=null&&e.closest('input, textarea, select, [contenteditable="true"]'))}function pC(i){function e(s){var r;const n=s.target instanceof Node?s.target:null;i.canvasFocused.value=!!n&&!!((r=i.canvasElement.value)!=null&&r.contains(n))}function t(s){const n=s.key.toLowerCase();if((s.ctrlKey||s.metaKey)&&!s.altKey&&n==="s"){s.preventDefault(),s.stopPropagation(),i.save();return}if((s.ctrlKey||s.metaKey)&&!s.altKey&&n==="z"){s.preventDefault(),s.stopPropagation(),i.undo();return}if(s.ctrlKey||s.metaKey||s.altKey||fC(s.target))return;if(n==="d"){s.preventDefault(),i.togglePlay();return}if(n==="s"){s.preventDefault(),i.toStart();return}if(!i.canvasFocused.value)return;const r={q:"",w:"translate",e:"rotate",r:"scale"};n in r&&(s.preventDefault(),i.setTool(r[n]))}_o(()=>{document.addEventListener("pointerdown",e,!0),window.addEventListener("keydown",t,!0)}),wa(()=>{document.removeEventListener("pointerdown",e,!0),window.removeEventListener("keydown",t,!0)})}const mC={class:"stage-wrap"},gC={class:"topbar"},vC=["disabled"],yC={class:"tool-group"},xC={class:"tool-group"},bC={key:0,class:"background-panel"},wC=["disabled"],_C=["title"],SC={class:"background-position-row"},TC={class:"background-opacity-row"},MC={class:"zoom-pct"},EC={key:0,class:"settings-panel"},AC={class:"sp-head"},CC={class:"sp-switch-row"},IC={class:"sp-switch-control"},RC={class:"sp-row"},PC={class:"sp-chk"},kC={class:"sp-chk"},FC={class:"sp-row"},OC={class:"sp-row"},BC={class:"sp-chk"},LC={class:"sp-chk"},DC={class:"sp-row"},NC={class:"sp-row"},UC={class:"sp-row"},VC={class:"sp-hex"},XC={class:"sp-chk"},YC={class:"help-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"help-title"},$C={class:"help-head"},GC={key:2,class:"hud"},jC={class:"hud-number hud-system-count"},HC={class:"hud-number hud-particle-count"},WC=Ws({__name:"Stage",setup(i){const e=Aa(),t=it(null),s=it(null),n=it(!1),r=it(!1),o=it(!1),a=it(null),h=ut(()=>e.settings.backgroundImageName),l=it(""),c=it(!1);function u(G){l.value=l.value===G?"":G}e.settings.undoLimit>0||(e.settings.undoLimit=20),e.settings.parameterPanelOnRight==null&&(e.settings.parameterPanelOnRight=!0),Number.isFinite(e.settings.backgroundX)||(e.settings.backgroundX=0),Number.isFinite(e.settings.backgroundY)||(e.settings.backgroundY=0),Number.isFinite(e.settings.backgroundOpacity)||(e.settings.backgroundOpacity=1),e.settings.backgroundImageName==null&&(e.settings.backgroundImageName=""),e.settings.backgroundImageData==null&&(e.settings.backgroundImageData=""),e.settings.showEmitter==null&&(e.settings.showEmitter=!0),e.settings.showBones==null&&(e.settings.showBones=!1),e.settings.bonePointDrawSize>0||(e.settings.bonePointDrawSize=1),e.settings.boneAxisDrawSize>0||(e.settings.boneAxisDrawSize=2),e.settings.showSkinMesh==null&&(e.settings.showSkinMesh=!1),e.settings.showGrid==null&&(e.settings.showGrid=!0);function f(){e.settings.bonePointDrawSize=Math.min(10,Math.max(.1,Number(e.settings.bonePointDrawSize)||1)),e.settings.boneAxisDrawSize=Math.min(10,Math.max(.1,Number(e.settings.boneAxisDrawSize)||2))}pC({canvasElement:t,canvasFocused:c,undo:Cu,save:()=>dx(e),togglePlay:()=>e.togglePlay(),toStart:()=>e.toStart(),setTool:G=>{l.value=G}});let d=null,m=null,g=null,b=null,_=0,M=null,v=null,S=null,y=null,I=null,E=null,C=null,R=null,B=null,k=null,F=null,D=null,N=[],j=0,O=0,L=0,P=0,X=null,U=null;const Y=new Map,q=new Map;let z=[];const ne=new Map,H=new Set;let Z=!1;cs(()=>[e.activeObjectType,e.activeObjectId],()=>H.clear());async function ae(){if(X&&U)return X;const[G,T]=await Promise.all([et.fromURL("/images/star.png"),et.fromURL("/images/trail.png")]);return X=G,U=T,X}function me(){m=new gi,d.stage.addChild(m),F=new gi,d.stage.addChild(F),g=new Qn(et.EMPTY),g.anchor.set(.5),g.visible=!1,m.addChild(g),k=new Ri,m.addChild(k),D=new UA,m.addChild(D.container),v=new Ri,m.addChild(v),M=new Ri,m.addChild(M),y=new Ri,m.addChild(y),I=new Ri,m.addChild(I),E=new Ri,m.addChild(E),C=new Ri,m.addChild(C),R=new Ri,m.addChild(R),B=new Ri,m.addChild(B),S=new Ri,m.addChild(S)}function _e(){r.value=!r.value,r.value&&(n.value=!1)}function te(){o.value=!0,n.value=!1,r.value=!1}function ve(G){G.key==="Escape"&&o.value&&(o.value=!1)}function $(){n.value=!n.value,n.value&&(r.value=!1)}function W(G){dC(e,Number(G.target.value))}async function J(G){var x;const T=G.target,p=(x=T.files)==null?void 0:x[0];if(p)try{e.settings.backgroundImageData=await wl(p),e.settings.backgroundImageName=p.name}catch(V){console.error("背景图加载失败",V)}finally{T.value=""}}async function Q(G){const T=++_;if(!G){g&&(g.texture=et.EMPTY,g.visible=!1),b&&b.destroy(!0),b=null;return}try{const p=await et.fromURL(G);if(T!==_||!g){p.destroy(!0);return}const x=b;b=p,g.texture=p,g.visible=!0,x&&x.destroy(!0)}catch(p){console.error("背景图恢复失败",p)}}function ie(G=!0){e.settings.backgroundImageData="",e.settings.backgroundImageName="",a.value&&(a.value.value=""),G&&(e.settings.backgroundX=0,e.settings.backgroundY=0,e.settings.backgroundOpacity=1)}function ue(G,T=0){if(G<=0)return 1;const p=Math.pow(10,Math.floor(Math.log10(G))),x=[1,2,5,10,20,50,100];let V=1;for(const K of x)if(K*p>=G){V=K*p;break}return Math.max(V,T)}function Se(){if(!k)return;const G=k;G.clear();const T=e.settings;if(!T.tickEnabled){for(const ge of N)ge.visible=!1;return}const p=0,x=0,V=d.screen.width/e.editor.viewScale,K=d.screen.height/e.editor.viewScale,oe=+("0x"+T.axisColor.replace("#",""));G.lineStyle(1.5,oe,.35),G.moveTo(-V,x),G.lineTo(V,x),G.moveTo(p,-K),G.lineTo(p,K);const pe=e.editor.viewScale,he=ue(50/pe),be=V,fe=K,Te=Math.max(1,T.tickWidth);if(T.tickEnabled){for(let ge=0;ge<=V;ge+=he){const rt=Math.round(ge/he)*he;rt!==0&&(G.lineStyle(Te,oe,.25),G.moveTo(rt,x-4),G.lineTo(rt,x+4))}for(let ge=0;ge<=K;ge+=he)Math.round(ge/he)*he!==0&&(G.lineStyle(Te,oe,.25),G.moveTo(p-4,ge),G.lineTo(p+4,ge))}const Ce=d.screen.width/2+e.editor.viewX,Le=d.screen.height*.5+e.editor.viewY,Ue=T.axisFontSize,Ae=+("0x"+T.axisColor.replace("#",""));for(;N.length<64;){const ge=new cf("",{fontFamily:"monospace",fontSize:Ue,fill:Ae});ge.anchor.set(.5,.5),F.addChild(ge),N.push(ge)}let ye=0;const We=T.showAxisLabels&&T.tickEnabled;for(let ge=0;ge<=V;ge+=he){const rt=Math.round(ge/he)*he;if(rt===0||!We||rt>be)continue;const mt=N[ye++];if(!mt)break;mt.style.fontSize=Ue,mt.text=String(rt),mt.position.set(Ce+rt*pe,Le+9),mt.visible=!0;const _t=N[ye++];if(!_t)break;_t.style.fontSize=Ue,_t.text=String(-rt),_t.position.set(Ce-rt*pe,Le+9),_t.visible=!0}for(let ge=0;ge<=K;ge+=he){const rt=Math.round(ge/he)*he;if(rt===0||!We||rt>fe)continue;const mt=N[ye++];if(!mt)break;mt.style.fontSize=Ue,mt.text=String(rt),mt.position.set(Ce+8,Le-ge*pe),mt.visible=!0;const _t=N[ye++];if(!_t)break;_t.style.fontSize=Ue,_t.text=String(-rt),_t.position.set(Ce+8,Le+ge*pe),_t.visible=!0}for(;ye{e.editor.viewX=x+(pe.clientX-T),e.editor.viewY=V+(pe.clientY-p)},oe=()=>{window.removeEventListener("pointermove",K),window.removeEventListener("pointerup",oe),window.removeEventListener("pointercancel",oe)};window.addEventListener("pointermove",K),window.addEventListener("pointerup",oe),window.addEventListener("pointercancel",oe)}function de(G,T){const p=t.value.getBoundingClientRect(),x=Math.max(1e-4,e.editor.viewScale),V=G-p.left,K=T-p.top;return{x:(V-d.screen.width/2-e.editor.viewX)/x,y:-(K-d.screen.height*.5-e.editor.viewY)/x}}function De(G,T,p){const x=G.rotation*Math.PI/180,V=Math.cos(x),K=Math.sin(x),oe=Math.max(1e-4,Math.abs(G.scaleX??1)),pe=Math.max(1e-4,Math.abs(G.scaleY??1));return{x:G.x+V*T*oe-K*p*pe,y:G.y+K*T*oe+V*p*pe}}function Ie(G,T,p){const x=G.rotation*Math.PI/180,V=Math.cos(x),K=Math.sin(x),oe=Math.max(1e-4,Math.abs(G.scaleX??1)),pe=Math.max(1e-4,Math.abs(G.scaleY??1)),he=T-G.x,be=p-G.y;return{x:(V*he+K*be)/oe,y:(-K*he+V*be)/pe}}function Be(){if(e.activeObjectType!=="path")return null;const G=e.paths.find(T=>T.id===e.activeObjectId)||null;return(G==null?void 0:G.visible)===!1?null:G}function Ke(G,T,p){if(G.points.length<2)return G.points.length;const x=G.closed?G.points.length:G.points.length-1;let V=G.points.length,K=1/0;for(let oe=0;oeMath.hypot(pe.x-x.x,pe.y-x.y)<=V);if(K>=0){T.points.splice(K,1),H.clear();return}const oe=Ke(T,x.x,x.y);T.points.splice(oe,0,{x:x.x,y:x.y,inX:0,inY:0,outX:0,outY:0}),H.clear(),H.add(oe)}function wt(G){const T=Be();if(!T||!T.enabled)return!1;const p=de(G.clientX,G.clientY),x=Ie(T,p.x,p.y),V=9/Math.max(.01,e.editor.viewScale);if(G.detail>=2){if(T.points.findIndex(fe=>Math.hypot(fe.x-x.x,fe.y-x.y)<=V)>=0)return!0;const he={x:x.x,y:x.y,inX:0,inY:0,outX:0,outY:0},be=Ke(T,x.x,x.y);return T.points.splice(be,0,he),H.clear(),H.add(be),Z=!0,dt(fe=>{const Te=de(fe.clientX,fe.clientY),Ce=Ie(T,Te.x,Te.y);he.outX=Ce.x-he.x,he.outY=Ce.y-he.y,he.inX=-he.outX,he.inY=-he.outY}),!0}let K=null;for(const pe of H){const he=T.points[pe];he&&(Math.hypot(he.x+he.inX-x.x,he.y+he.inY-x.y)<=V&&(K={index:pe,side:"in"}),Math.hypot(he.x+he.outX-x.x,he.y+he.outY-x.y)<=V&&(K={index:pe,side:"out"}))}if(K){const pe=T.points[K.index],he=K.side==="in"?Math.hypot(pe.outX,pe.outY):Math.hypot(pe.inX,pe.inY);return dt(fe=>{const Te=de(fe.clientX,fe.clientY),Ce=Ie(T,Te.x,Te.y),Le=Ce.x-pe.x,Ue=Ce.y-pe.y;if(K.side==="in"?(pe.inX=Le,pe.inY=Ue):(pe.outX=Le,pe.outY=Ue),!fe.altKey){const Ae=Math.max(1e-4,Math.hypot(Le,Ue)),ye=fe.shiftKey?Ae:he;K.side==="in"?(pe.outX=-Le/Ae*ye,pe.outY=-Ue/Ae*ye):(pe.inX=-Le/Ae*ye,pe.inY=-Ue/Ae*ye)}}),!0}const oe=T.points.findIndex(pe=>Math.hypot(pe.x-x.x,pe.y-x.y)<=V);if(oe>=0){if(G.altKey)return H.delete(oe),!0;G.ctrlKey||G.metaKey?H.add(oe):H.has(oe)||(H.clear(),H.add(oe));const pe=x,he=[...H].map(fe=>({index:fe,x:T.points[fe].x,y:T.points[fe].y}));return dt(fe=>{const Te=de(fe.clientX,fe.clientY),Ce=Ie(T,Te.x,Te.y);for(const Le of he)T.points[Le.index].x=Le.x+Ce.x-pe.x,T.points[Le.index].y=Le.y+Ce.y-pe.y}),!0}if(G.altKey&&!G.ctrlKey&&!G.metaKey)return H.clear(),!0;if(G.ctrlKey||G.metaKey||G.altKey){const pe=x,he=G.altKey,be=fe=>{const Te=de(fe.clientX,fe.clientY),Ce=Ie(T,Te.x,Te.y),Le=Math.min(pe.x,Ce.x),Ue=Math.max(pe.x,Ce.x),Ae=Math.min(pe.y,Ce.y),ye=Math.max(pe.y,Ce.y);T.points.forEach((We,ge)=>{We.x>=Le&&We.x<=Ue&&We.y>=Ae&&We.y<=ye&&(he?H.delete(ge):H.add(ge))}),window.removeEventListener("pointerup",be),window.removeEventListener("pointercancel",be)};return window.addEventListener("pointerup",be),window.addEventListener("pointercancel",be),!0}return!1}function dt(G){const T=()=>{window.removeEventListener("pointermove",G),window.removeEventListener("pointerup",T),window.removeEventListener("pointercancel",T)};window.addEventListener("pointermove",G),window.addEventListener("pointerup",T),window.addEventListener("pointercancel",T)}function Mt(G){if(e.activeObjectType!=="collision")return!1;const T=e.colliders.find(ye=>ye.id===e.activeObjectId);if(!(T!=null&&T.enabled)||T.visible===!1)return!1;const p=de(G.clientX,G.clientY),x=T.rotation*Math.PI/180,V=Math.cos(x),K=Math.sin(x),oe=Math.max(1e-4,Math.abs(T.scaleX??1)),pe=Math.max(1e-4,Math.abs(T.scaleY??1)),he=p.x-T.x,be=p.y-T.y,fe=(V*he+K*be)/oe,Te=(-K*he+V*be)/pe;if(!(T.shape==="circle"?Math.hypot(fe,Te)<=T.radius:T.shape==="ellipse"?Math.hypot(fe/Math.max(1,T.radiusX),Te/Math.max(1,T.radiusY))<=1:Math.abs(fe)<=T.width*.5&&Math.abs(Te)<=T.height*.5))return!1;const Le=T.x,Ue=T.y,Ae=p;return dt(ye=>{const We=de(ye.clientX,ye.clientY);T.x=Le+We.x-Ae.x,T.y=Ue+We.y-Ae.y}),!0}function Ct(G){const T=e.systems.find(be=>be.id===e.activeId);if((T==null?void 0:T.visible)===!1)return!1;const p=T==null?void 0:T.config;if(!(p!=null&&p.forceField)||p.forceRadius<=0)return!1;const x=de(G.clientX,G.clientY);if(Math.hypot(x.x-p.forceCenterX,x.y-p.forceCenterY)>p.forceRadius)return!1;const K=p.forceCenterX,oe=p.forceCenterY;t.value&&(t.value.style.cursor="grabbing");const pe=be=>{const fe=de(be.clientX,be.clientY);p.forceCenterX=K+fe.x-x.x,p.forceCenterY=oe+fe.y-x.y},he=()=>{t.value&&(t.value.style.cursor=""),window.removeEventListener("pointermove",pe),window.removeEventListener("pointerup",he),window.removeEventListener("pointercancel",he)};return window.addEventListener("pointermove",pe),window.addEventListener("pointerup",he),window.addEventListener("pointercancel",he),G.preventDefault(),!0}function ai(G){const T=e.systems.find(fe=>fe.id===e.activeId);if((T==null?void 0:T.visible)===!1)return!1;const p=T==null?void 0:T.config;if(!(p!=null&&p.attraction))return!1;const x=de(G.clientX,G.clientY),V=Math.max(p.attractionRadius,12/Math.max(1e-4,e.editor.viewScale));if(Math.hypot(x.x-p.attractionCenterX,x.y-p.attractionCenterY)>V)return!1;const oe=p.attractionCenterX,pe=p.attractionCenterY;t.value&&(t.value.style.cursor="grabbing");const he=fe=>{const Te=de(fe.clientX,fe.clientY);p.attractionCenterX=oe+Te.x-x.x,p.attractionCenterY=pe+Te.y-x.y},be=()=>{t.value&&(t.value.style.cursor=""),window.removeEventListener("pointermove",he),window.removeEventListener("pointerup",be),window.removeEventListener("pointercancel",be)};return window.addEventListener("pointermove",he),window.addEventListener("pointerup",be),window.addEventListener("pointercancel",be),G.preventDefault(),!0}function Jt(){const G=e.activeObjectId;if(e.activeObjectType==="particle"){const x=e.systems.find(K=>K.id===G);if(!x||x.visible===!1)return null;const V=x.config;return{x:V.centerX,y:V.centerY,rotation:V.rootRotation,scaleX:V.rootScaleX??1,scaleY:V.rootScaleY??1,setPosition:(K,oe)=>{V.centerX=K,V.centerY=oe},setRotation:K=>{V.rootRotation=K},setScale:(K,oe)=>{V.rootScaleX=K,V.rootScaleY=oe}}}const p=(e.activeObjectType==="collision"?e.colliders:e.activeObjectType==="path"?e.paths:e.spines).find(x=>x.id===G);return!p||p.visible===!1?null:{x:Number(p.x)||0,y:Number(p.y)||0,rotation:Number(p.rotation)||0,scaleX:Math.max(.05,Number(p.scaleX)||1),scaleY:Math.max(.05,Number(p.scaleY)||1),setPosition:(x,V)=>{p.x=x,p.y=V},setRotation:x=>{p.rotation=x},setScale:(x,V)=>{p.scaleX=x,p.scaleY=V}}}function Zi(G){const T=Jt();if(!T)return;const p=e.editor.viewScale,x=t.value.getBoundingClientRect(),V=x.left+d.screen.width/2+e.editor.viewX+T.x*p,K=x.top+d.screen.height*.5+e.editor.viewY+-T.y*p,oe=G.clientX,pe=G.clientY,he=l.value,be=T.x,fe=T.y,Te=T.rotation,Ce=T.scaleX,Le=T.scaleY,Ue=Math.hypot(oe-V,pe-K)||1,Ae=Math.atan2(pe-K,oe-V),ye=ge=>{const rt=(ge.clientX-oe)/p,mt=(ge.clientY-pe)/p;if(he==="translate")T.setPosition(be+rt,fe-mt);else if(he==="rotate"){const _t=Math.atan2(ge.clientY-K,ge.clientX-V);T.setRotation(Te-(_t-Ae)*180/Math.PI)}else if(he==="scale"){const wi=Math.hypot(ge.clientX-V,ge.clientY-K)/Ue;T.setScale(Math.max(.05,Ce*wi),Math.max(.05,Le*wi))}},We=()=>{window.removeEventListener("pointermove",ye),window.removeEventListener("pointerup",We),window.removeEventListener("pointercancel",We)};window.addEventListener("pointermove",ye),window.addEventListener("pointerup",We),window.addEventListener("pointercancel",We)}function xs(){re(1.2)}function $t(){re(1/1.2)}function re(G){const T=Math.max(.01,e.editor.viewScale*G);e.editor.viewScale=T}function le(){e.editor.viewScale=1,e.editor.viewX=0,e.editor.viewY=0}function ft(){e.editor.viewScale=1,e.editor.viewX=0,e.editor.viewY=0}function It(){e.settings.showGrid=!e.settings.showGrid}function Pt(){if(m){for(const[G,T]of Y){const p=e.systems.find(x=>x.id===G);(!p||q.get(G)!==p.config)&&(m.removeChild(T),T.destroy({children:!0}),Y.delete(G),q.delete(G))}for(const G of e.systems){X&&!G.config.texture&&(G.config.texture=X);const T=Tr(G.config);if(U)for(const x of T.trailResources)!x.texture&&(x.previewUrl==="/images/trail.png"||x.previewUrl==="/trails/trail.png")&&(x.texture=U);if(X)for(const x of T.imageResources)!x.texture&&x.textureName==="star"&&(x.texture=X);if(Y.has(G.id))continue;const p=new yE(G.config);p.setEmitterPos(()=>({x:G.config.centerX,y:G.config.centerY})),m.addChild(p),Y.set(G.id,p),q.set(G.id,G.config)}}}function nt(){if(!M)return;const G=M;if(G.clear(),!!e.settings.showEmitter&&e.systems.length)for(const T of e.systems){if(T.visible===!1)continue;const p=ne.get(T.id),x=(p==null?void 0:p.x)??T.config.centerX??0,V=-((p==null?void 0:p.y)??T.config.centerY??0),K=e.activeObjectType==="particle"&&T.id===e.activeId,oe=K?16763955:9082040,pe=K?.4:.2;G.lineStyle(1,oe,pe),G.drawCircle(x,V,10),G.beginFill(oe,K?.8:.4),G.drawCircle(x,V,3),G.endFill(),G.lineStyle(1,oe,K?.3:.15),G.moveTo(x-16,V),G.lineTo(x+16,V),G.moveTo(x,V-16),G.lineTo(x,V+16)}}function $i(){var p;if(!v)return;const G=v;(p=G.parent)==null||p.addChild(G),G.clear();const T=new Map;for(const x of e.spines)x.visible===!1||!x.selectedBone||x.status!=="ready"||T.set(`${x.id}:${x.selectedBone}`,{spineId:x.id,boneName:x.selectedBone});for(const x of e.systems){if(x.visible===!1)continue;const V=x.config;if(!V.emitterFollow||V.emitterFollowMode!=="bone"||!V.emitterFollowSpineId||!V.emitterFollowBoneName)continue;const K=e.spines.find(oe=>oe.id===V.emitterFollowSpineId);!K||K.visible===!1||T.set(`${V.emitterFollowSpineId}:${V.emitterFollowBoneName}`,{spineId:V.emitterFollowSpineId,boneName:V.emitterFollowBoneName})}for(const x of T.values()){const V=D==null?void 0:D.getBoneWorldTransform(x.spineId,x.boneName);if(!V)continue;const K=V.x,oe=-V.y;G.lineStyle(2,12881151,.95),G.beginFill(12881151,.2),G.drawCircle(K,oe,8),G.endFill(),G.beginFill(15919103,1),G.drawCircle(K,oe,3.5),G.endFill()}}function Ji(){if(!y)return;const G=y;if(G.clear(),!e.settings.showEmitter)return;const T=e.systems.find(Ae=>Ae.id===e.activeId);if(!T||T.visible===!1)return;const p=T.config,x=ne.get(T.id),V=(x==null?void 0:x.x)??p.centerX??0,K=-((x==null?void 0:x.y)??p.centerY??0),oe=p.shape;if(oe==="point"||oe==="orbit")return;const pe=p.rootScaleX??1,he=p.rootScaleY??1,be=-((x==null?void 0:x.rotation)??p.rootRotation??0)*Math.PI/180,fe=Math.cos(be),Te=Math.sin(be),Ce=p.offsetX??0,Le=p.offsetY??0,Ue=(Ae,ye)=>{const We=Ae+Ce,ge=-ye-Le,rt=We*pe,mt=ge*he;return[V+rt*fe-mt*Te,K+(rt*Te+mt*fe)]};if(oe==="circle"){G.lineStyle(2,3991658,.7);const Ae=48;for(let ye=0;ye<=Ae;ye++){const We=ye/Ae*Math.PI*2,[ge,rt]=Ue(Math.cos(We)*p.radius,Math.sin(We)*p.radius);ye===0?G.moveTo(ge,rt):G.lineTo(ge,rt)}}else if(oe==="rect"){const Ae=p.rectW/2,ye=p.rectH/2,We=Ue(-Ae,-ye),ge=Ue(Ae,-ye),rt=Ue(Ae,ye),mt=Ue(-Ae,ye);G.lineStyle(2,4885759,.7),G.moveTo(We[0],We[1]),G.lineTo(ge[0],ge[1]),G.lineTo(rt[0],rt[1]),G.lineTo(mt[0],mt[1]),G.lineTo(We[0],We[1])}else if(oe==="cone"){const Ae=p.radius,ye=p.coneAngle/2*Math.PI/180,We=p.direction*Math.PI/180,ge=Ue(Math.cos(We-ye)*Ae,Math.sin(We-ye)*Ae),rt=Ue(Math.cos(We+ye)*Ae,Math.sin(We+ye)*Ae);G.lineStyle(2,3991658,.7),G.moveTo(V,K),G.lineTo(ge[0],ge[1]),G.moveTo(V,K),G.lineTo(rt[0],rt[1]),G.lineStyle(1,3991658,.5);const mt=24;for(let _t=0;_t<=mt;_t++){const wi=We-ye+2*ye*_t/mt,[Mo,Qs]=Ue(Math.cos(wi)*Ae,Math.sin(wi)*Ae);_t===0?G.moveTo(Mo,Qs):G.lineTo(Mo,Qs)}}}function li(){if(!I)return;const G=I;G.clear();const T=e.systems.find(oe=>oe.id===e.activeId);if((T==null?void 0:T.visible)===!1)return;const p=T==null?void 0:T.config;if(!(p!=null&&p.forceField)||p.forceRadius<=0)return;const x=p.forceCenterX,V=-p.forceCenterY,K=p.forceStrength>=0?5818367:16739194;G.lineStyle(2,K,.85),G.beginFill(K,.08),G.drawCircle(x,V,p.forceRadius),G.endFill(),G.lineStyle(1,K,.7),G.moveTo(x-9,V),G.lineTo(x+9,V),G.moveTo(x,V-9),G.lineTo(x,V+9),G.beginFill(K,.95),G.drawCircle(x,V,4),G.endFill()}function Gi(){if(!E)return;const G=E;G.clear();const T=e.systems.find(pe=>pe.id===e.activeId);if((T==null?void 0:T.visible)===!1)return;const p=T==null?void 0:T.config;if(!(p!=null&&p.attraction))return;const x=p.attractionCenterX,V=-p.attractionCenterY,K=Math.max(0,p.attractionRadius),oe=16731487;K>0&&(G.lineStyle(2,oe,.95),G.beginFill(oe,.09),G.drawCircle(x,V,K),G.endFill()),G.lineStyle(1,oe,.85),G.moveTo(x-10,V),G.lineTo(x+10,V),G.moveTo(x,V-10),G.lineTo(x,V+10),G.beginFill(oe,1),G.drawCircle(x,V,K>0?4:6),G.endFill()}function er(){if(!B)return;const G=B;if(G.clear(),!l.value)return;const T=Jt();if(!T)return;const p=T.x,x=-T.y,V=T.scaleX,K=T.scaleY,oe=-T.rotation*Math.PI/180,pe=Math.cos(oe),he=Math.sin(oe),be=(Ce,Le)=>{const Ue=Ce*V,Ae=-Le*K;return[p+Ue*pe-Ae*he,x+(Ue*he+Ae*pe)]},fe=(Ce,Le,Ue,Ae)=>{const ye=be(Ce,Le),We=be(Ue,Ae);G.moveTo(ye[0],ye[1]),G.lineTo(We[0],We[1])},Te=26;if(G.lineStyle(2,3526911,.9),G.beginFill(3526911,.25),G.drawCircle(p,x,6),G.endFill(),l.value==="translate")G.lineStyle(2,3526911,.9),fe(-Te,0,Te,0),fe(0,-Te,0,Te),fe(Te-6,-4,Te,0),fe(Te,0,Te-6,4),fe(-20,-4,-Te,0),fe(-Te,0,-20,4),fe(-4,Te-6,0,Te),fe(0,Te,4,Te-6),fe(-4,-20,0,-Te),fe(0,-Te,4,-20);else if(l.value==="rotate"){G.lineStyle(2,3526911,.8);const Ce=48;for(let Ae=0;Ae<=Ce;Ae++){const ye=Ae/Ce*Math.PI*2,[We,ge]=be(Math.cos(ye)*Te,Math.sin(ye)*Te);Ae===0?G.moveTo(We,ge):G.lineTo(We,ge)}const[Le,Ue]=be(0,Te);G.beginFill(3526911,.95),G.drawCircle(Le,Ue,4),G.endFill()}else if(l.value==="scale"){G.lineStyle(2,3526911,.9);const Le=[[-Te,-Te],[Te,-Te],[Te,Te],[-Te,Te]].map(([Ue,Ae])=>be(Ue,Ae));G.moveTo(Le[0][0],Le[0][1]),G.lineTo(Le[1][0],Le[1][1]),G.lineTo(Le[2][0],Le[2][1]),G.lineTo(Le[3][0],Le[3][1]),G.lineTo(Le[0][0],Le[0][1]),G.beginFill(3526911,.9);for(const Ue of Le)G.drawRect(Ue[0]-3,Ue[1]-3,6,6);G.endFill()}}function Oi(G,T){var p;G.push({boneName:T.boneName,x:T.x,y:T.y,rotation:-T.rotation}),(p=T.trailState)!=null&&p.bones.length&&T.trailState.bones.forEach(x=>{G.push({boneName:x.boneName,x:x.x,y:x.y,rotation:x.rotation,parentX:0,parentY:0,trail:!0})})}function Qt(G){return G.map(T=>({...T,trailState:T.trailState?{...T.trailState,bones:T.trailState.bones.map(p=>({...p}))}:void 0}))}function Pr(G){const T=new Map;for(const x of G)for(const V of x)T.has(V.boneName)||T.set(V.boneName,Qt([V])[0]);const p=[...T.keys()].sort((x,V)=>{const K=Number(x.replace(/^p_/,"")),oe=Number(V.replace(/^p_/,""));return Number.isFinite(K)&&Number.isFinite(oe)?K-oe:x.localeCompare(V)});for(let x=0;x[K.boneName,K]));G[x]=p.map(K=>{const oe=V.get(K);return oe||{...Qt([T.get(K)])[0],alpha:0,imageVisible:!1,trailState:void 0,active:!0}})}}function kr(G,T,p,x){var Le;const V=G.config,K=1/Math.max(1,p),oe=V.lifeMode==="fixed"?Math.max(0,Number(V.lifeMin)||0):Math.max(0,Number(V.lifeMin)||0,Number(V.lifeMax)||0),pe=Math.max(1,Math.ceil(Number(V.loopDurationFrames)||1)),he=Math.max(1,Math.ceil(oe*p)),be=Math.max(1,Math.ceil(he/pe)),fe=Math.max(0,Math.ceil(Math.max(0,Number(V.delay)||0)*p)),Te=[];if(T.reset(),V.generateLoopStartAnimation){for(let Ue=0;Ue0&&T.restartEmissionCycle();for(let Ae=0;Ae0&&T.restartEmissionCycle();for(let ye=0;ye0;ye++)T.update(K,"off"),Te.push(T.capture());(Le=Te[Te.length-1])!=null&&Le.length&&Te.push([])}else{T.restartEmissionCycle();for(let Ae=0;Aex&&(Te.length=x);Te.length({x:T.x+K*Ce*pe-oe*Le*he,y:-(T.y+oe*Ce*pe+K*Le*he)});let fe=[];if(T.shape==="circle"||T.shape==="ellipse"){const Ce=T.shape==="circle"?T.radius:T.radiusX,Le=T.shape==="circle"?T.radius:T.radiusY;fe=Array.from({length:49},(Ue,Ae)=>{const ye=Ae/48*Math.PI*2;return be(Math.cos(ye)*Ce,Math.sin(ye)*Le)})}else if(T.shape==="rect"){const Ce=T.width*.5,Le=T.height*.5;fe=[be(-Ce,-Le),be(Ce,-Le),be(Ce,Le),be(-Ce,Le),be(-Ce,-Le)]}else{const Ce=Math.max(3,Math.min(16,Math.round(T.sides)));fe=Array.from({length:Ce+1},(Le,Ue)=>{const Ae=Math.PI*.5+Ue%Ce/Ce*Math.PI*2;return be(Math.cos(Ae)*T.width*.5,Math.sin(Ae)*T.height*.5)})}if(!fe.length)continue;G.lineStyle(p?2.5:1.5,x,T.enabled?.95:.45),G.beginFill(x,p?.12:.055),G.moveTo(fe[0].x,fe[0].y);for(let Ce=1;Ce{const fe=De(T,he,be);return{x:fe.x,y:-fe.y}},K=T.points[0],oe=V(K.x,K.y);G.lineStyle(p?2.5:1.8,x,p?1:.75),G.moveTo(oe.x,oe.y);const pe=T.closed?T.points.length:T.points.length-1;for(let he=0;he{const fe=V(he.x,he.y),Te=V(he.x+he.inX,he.y+he.inY),Ce=V(he.x+he.outX,he.y+he.outY),Le=Math.hypot(he.inX,he.inY)>.01,Ue=Math.hypot(he.outX,he.outY)>.01;G.lineStyle(1,11121867,.65),Le&&(G.moveTo(fe.x,fe.y),G.lineTo(Te.x,Te.y)),Ue&&(G.moveTo(fe.x,fe.y),G.lineTo(Ce.x,Ce.y)),Le&&(G.beginFill(14015724,.95),G.drawCircle(Te.x,Te.y,3),G.endFill()),Ue&&(G.beginFill(14015724,.95),G.drawCircle(Ce.x,Ce.y,3),G.endFill()),G.beginFill(H.has(be)?16777215:x,1),G.lineStyle(1.5,H.has(be)?6126847:16777215,.95),G.drawCircle(fe.x,fe.y,H.has(be)?5:4),G.endFill()})}}function An(G,T,p="linear"){if(!G.length)return T;const x=[...G].sort((V,K)=>V.x-K.x);if(T<=x[0].x)return x[0].y;for(let V=1;V0&&We===0)continue;const ge=We/20,rt=bs(Ae.x,Ae.x+Ae.outX,ye.x+ye.inX,ye.x,ge),mt=bs(Ae.y,Ae.y+Ae.outY,ye.y+ye.inY,ye.y,ge),_t=De(G,rt,mt),wi=x[x.length-1];wi&&(V+=Math.hypot(_t.x-wi.x,_t.y-wi.y)),x.push({..._t,distance:V})}}const K=Math.min(1,Math.max(0,T))*V;let oe=x.findIndex(Ue=>Ue.distance>=K);oe<0&&(oe=x.length-1);const pe=x[oe],he=x[Math.max(0,oe-1)],be=x[Math.min(x.length-1,oe+1)],fe=he.distance,Te=oe>0?(K-fe)/Math.max(1e-4,pe.distance-fe):0,Ce=he.x+(pe.x-he.x)*Math.min(1,Math.max(0,Te)),Le=he.y+(pe.y-he.y)*Math.min(1,Math.max(0,Te));return{x:Ce,y:Le,angle:Math.atan2(be.y-he.y,be.x-he.x)*180/Math.PI}}function Qi(G){z=e.colliders.map(T=>{if(!T.followPath||!T.followPathId)return T;const p=e.paths.find(be=>be.id===T.followPathId&&be.enabled);if(!(p!=null&&p.points.length))return T;const x=Math.max(.05,Number(T.followDuration)||2),V=Math.min(1,Math.max(0,G/x)),K=Array.isArray(T.followCurve)?T.followCurve:[{x:0,y:0},{x:1,y:1}],oe=T.followCurveMode==="跟随导出"?e.settings.exportSettings.keyframeCurve==="bezier"?"bezier":"linear":T.followCurveMode==="贝塞尔"?"bezier":"linear",pe=Math.min(1,Math.max(0,An(K,V,oe))),he=Bi(p,pe);return he?{...T,x:he.x,y:he.y,rotation:T.rotation+(T.followPathRotation?he.angle:0)}:T})}function ws(G,T,p,x=Math.max(1e-4,Math.abs(G.rootScaleX)),V=Math.max(1e-4,Math.abs(G.rootScaleY))){const K=-G.rootRotation*Math.PI/180,oe=Math.cos(K),pe=Math.sin(K),he=T-G.centerX,be=-p+G.centerY;return{x:(oe*he+pe*be)/x,y:(-pe*he+oe*be)/V}}function tr(){var p,x,V;P=requestAnimationFrame(tr);const G=performance.now()/1e3;let T=G-j;if(j=G,T>.1&&(T=.1),d&&m){m.scale.set(e.editor.viewScale),m.position.set(d.screen.width/2+e.editor.viewX,d.screen.height*.5+e.editor.viewY),g&&(g.position.set(Number(e.settings.backgroundX)||0,-(Number(e.settings.backgroundY)||0)),g.alpha=Math.min(1,Math.max(0,Number(e.settings.backgroundOpacity)||0))),Se(),Pt();const K=Math.max(1,e.timeline.fps),oe=e.timeline.frame,pe=oe/K;D==null||D.sync(e.spines,oe,K),Qi(pe);for(const Ae of e.systems){const ye=Y.get(Ae.id);if(!ye)continue;ye.setFollowExportCurveMode(e.settings.exportSettings.keyframeCurve==="bezier"?"贝塞尔":"线性");const We=Ae.visible!==!1;ye.visible=We,ye.renderable=We;const ge=Ae.config;ye.scale.set(ge.rootScaleX,ge.rootScaleY),ye.setColliders(z),ye.setEmitterFollowSpawn(0,0,0);let rt={x:ge.centerX,y:ge.centerY,rotation:ge.rootRotation};const mt=ge.emitterFollow&&ge.emitterFollowMode==="bone"?e.spines.find(es=>es.id===ge.emitterFollowSpineId&&es.enabled&&es.status==="ready"):null,_t=mt&&(D==null?void 0:D.getBoneWorldTransform(mt.id,ge.emitterFollowBoneName))||null,wi=ge.emitterFollow&&ge.emitterFollowMode==="path"?e.paths.find(es=>es.id===ge.emitterFollowPathId&&es.enabled):null,Mo=Math.max(.05,ge.emitterFollowDuration),Qs=Math.min(1,Math.max(0,pe/Mo)),vf=Math.min(1,Math.max(0,An(ge.emitterFollowCurve,Qs))),Xh=Math.min(1,Math.max(0,ge.emitterFollowOffset)),_x=ge.emitterFollowDirection==="reverse"?(1-Xh)*(1-vf):Xh+(1-Xh)*vf,_s=wi?Bi(wi,_x):null;if(_t){const es=ge.emitterFollowBoneOffsetX,Eo=ge.emitterFollowBoneOffsetY,ir=_t.x+es,Fr=_t.y+Eo,Ca=ge.rootRotation+ge.emitterFollowBoneRotation,Ao=Math.max(1e-4,Math.abs(ge.rootScaleX*ge.emitterFollowBoneScaleX)),Co=Math.max(1e-4,Math.abs(ge.rootScaleY*ge.emitterFollowBoneScaleY));if(rt={x:ir,y:Fr,rotation:Ca},ge.emitterFollowSpace==="local")ye.position.set(ir,-Fr),ye.rotation=-Ca*Math.PI/180,ye.scale.set(Ao,Co),ye.setSimulationTransform(ir,Fr,Ca,Ao,Co);else{ye.position.set(ge.centerX,-ge.centerY),ye.rotation=-ge.rootRotation*Math.PI/180,ye.scale.set(Ao,Co),ye.setSimulationTransform(ge.centerX,ge.centerY,ge.rootRotation,Ao,Co);const yf=ws(ge,ir,Fr,Ao,Co),Sx=-(Ca-ge.rootRotation);ye.setEmitterFollowSpawn(yf.x,yf.y,Sx)}}else if(_s){const es=_s.angle+(ge.emitterFollowDirection==="reverse"?180:0),Eo=ge.emitterAngleMode==="direction"?es:ge.rootRotation;if(rt={x:_s.x,y:_s.y,rotation:Eo},ge.emitterFollowSpace==="local")ye.position.set(_s.x,-_s.y),ye.rotation=-Eo*Math.PI/180,ye.setSimulationTransform(_s.x,_s.y,Eo);else{ye.position.set(ge.centerX,-ge.centerY),ye.rotation=-ge.rootRotation*Math.PI/180,ye.setSimulationTransform(ge.centerX,ge.centerY,ge.rootRotation);const ir=ws(ge,_s.x,_s.y),Fr=ge.emitterAngleMode==="direction"?-(es-ge.rootRotation):0;ye.setEmitterFollowSpawn(ir.x,ir.y,Fr)}}else ye.position.set(ge.centerX,-ge.centerY),ye.rotation=-ge.rootRotation*Math.PI/180,ye.setSimulationTransform(ge.centerX,ge.centerY,ge.rootRotation);ne.set(Ae.id,rt)}let he=0;const be=[],fe=e.timeline,Te=fe.fps,Ce=1/Math.max(1,Te);let Le=L,Ue=0;if(fe.playing?(O+=T,Ue=Math.floor(O/Ce),Ue>0&&(O-=Ue*Ce)):O=0,fe.playing&&Ue>0)for(let Ae=0;Ae=fe.totalFrames)if(fe.loop)fe.frame=0;else{fe.frame=fe.totalFrames-1,fe.playing=!1;break}}else{if(fe.frame===0)for(const ye of e.systems){const We=Y.get(ye.id);We&&(ye.config.mode==="stream"&&ye.config.streamBehavior==="loop"?kr(ye,We,Te,fe.totalFrames):We.reset())}for(const[ye,We]of Y){const ge=e.systems.find(Qs=>Qs.id===ye),rt=(ge==null?void 0:ge.config.mode)==="stream"&&ge.config.streamBehavior==="loop",mt=rt?(p=ge.frames)==null?void 0:p[fe.frame]:void 0,_t=fe.frame===0&&!rt,wi=_t?[]:mt||We.update(Ce);if(_t?We.apply([]):mt&&We.apply(mt),(ge==null?void 0:ge.visible)!==!1)for(const Qs of wi)Qs.active&&Oi(be,Qs);he+=wi.length}for(const ye of e.systems){if(!ye.config.texture)continue;ye.frames=ye.frames||[];const We=Y.get(ye.id);We&&!(ye.config.mode==="stream"&&ye.config.streamBehavior==="loop")&&(ye.frames[fe.frame]=We.capture())}fe.frame++,fe.frame>=fe.totalFrames&&(fe.frame=0,fe.recorded=!0)}else{fe.playing||(Le=fe.frame);for(const Ae of e.systems){const ye=Y.get(Ae.id),We=fe.playing?L:fe.frame,ge=(V=Ae.frames)==null?void 0:V[We],rt=Ae.config.mode==="stream"&&Ae.config.streamBehavior==="loop"&&!!ge;if((fe.recorded||rt)&&ye&&ge){ye.apply(ge);for(const mt of ge)mt.active&&(Ae.visible!==!1&&Oi(be,mt),he++)}else if(ye){const mt=fe.frame===0?[]:ye.update(0);if(fe.frame===0&&ye.apply([]),Ae.visible!==!1)for(const _t of mt)_t.active&&Oi(be,_t);he+=ye.activeCount}}}L=Le,D==null||D.sync(e.spines,Le,Te);for(const[,Ae]of Y)Ae.drawTrailMeshDebug(e.settings.showSkinMesh);En(),Js(),$i(),nt(),Ji(),li(),Gi(),er(),Mn(be),s.value&&(s.value.systems=e.systems.length,s.value.particles=he)}}return _o(async()=>{window.addEventListener("keydown",ve);const G=t.value;d=new jv({width:G.clientWidth||800,height:G.clientHeight||600,backgroundAlpha:0,antialias:!0}),G.appendChild(d.view),me(),cs(()=>e.settings.backgroundImageData,Q,{immediate:!0}),await ae();const T=X;for(const p of e.systems){p.config.texture=T;const x=Tr(p.config);if(U)for(const V of x.trailResources)!V.texture&&(V.previewUrl==="/images/trail.png"||V.previewUrl==="/trails/trail.png")&&(V.texture=U);for(const V of x.imageResources)!V.texture&&V.textureName==="star"&&(V.texture=T)}s.value={systems:e.systems.length,particles:0},e.timeline.recorded=!1,e.timeline.frame=0,O=0,L=0,e.timeline.playing=!0,e.timeline.loop=!0;for(const p of e.systems)p.frames=[];e.recalcTotalFrames(),j=performance.now()/1e3,tr(),cs(()=>e.systems.map(p=>JSON.stringify(p.config,(x,V)=>x==="texture"||x==="trailTexture"||x==="previewUrl"?void 0:V)).join("|")+`|colliders:${JSON.stringify(e.colliders)}|paths:${JSON.stringify(e.paths)}`,()=>{e.recalcTotalFrames(),e.timeline.recorded=!1,e.timeline.frame=0;for(const p of e.systems)p.frames=[];e.timeline.playing=!0,e.timeline.loop=!0}),uC(e)}),wa(()=>{window.removeEventListener("keydown",ve),cancelAnimationFrame(P),D==null||D.destroy(),D=null,_++,b&&b.destroy(!0),b=null,g=null,d&&(d.destroy(!0,{children:!0}),d=null)}),(G,T)=>(se(),ce("div",mC,[w("div",{ref_key:"holder",ref:t,class:Ze(["stage-holder",{grid:Pe(e).settings.showGrid}]),tabindex:"0",onWheel:xt(Me,["prevent"]),onPointerdown:Ee,onDblclick:xt(ct,["prevent"])},null,34),w("div",gC,[w("button",{class:"settings-btn",onClick:$,title:"系统设置"},"系统设置"),w("button",{class:"undo-btn",disabled:Pe(Vh).undoCount===0,onClick:T[0]||(T[0]=(...p)=>Pe(Cu)&&Pe(Cu)(...p)),title:"撤回上一步 (Ctrl+Z)"},"↶",8,vC),w("div",yC,[w("button",{class:Ze(["tool-btn",{on:l.value===""}]),onClick:T[1]||(T[1]=p=>u("")),title:"拖动画布 (Q)"},"✋",2),w("button",{class:Ze(["tool-btn",{on:l.value==="translate"}]),onClick:T[2]||(T[2]=p=>u("translate")),title:"位移 (W)"},"✥",2),w("button",{class:Ze(["tool-btn",{on:l.value==="rotate"}]),onClick:T[3]||(T[3]=p=>u("rotate")),title:"旋转 (E)"},"⟳",2),w("button",{class:Ze(["tool-btn",{on:l.value==="scale"}]),onClick:T[4]||(T[4]=p=>u("scale")),title:"缩放 (R)"},"⤢",2)]),w("div",xC,[w("button",{class:"tool-btn",onClick:xs,title:"放大"},"+"),w("button",{class:"tool-btn",onClick:$t,title:"缩小"},"-"),w("button",{class:"tool-btn",onClick:le,title:"适配画布"},"⤢"),w("button",{class:Ze(["tool-btn",{on:Pe(e).settings.showGrid}]),onClick:It,title:"切换网格"},"▦",2),w("button",{class:"tool-btn",onClick:ft,title:"重置视图"},"⟳")]),w("div",{class:"background-menu",onClick:T[10]||(T[10]=xt(()=>{},["stop"]))},[w("button",{class:Ze(["background-btn",{on:r.value}]),title:"背景图显示设置",onClick:_e},"背景图",2),r.value?(se(),ce("div",bC,[w("button",{class:"background-upload",onClick:T[5]||(T[5]=p=>{var x;return(x=a.value)==null?void 0:x.click()})},Ye(h.value?"更换图像":"上传图像"),1),w("button",{class:"background-clear",disabled:!h.value,onClick:T[6]||(T[6]=p=>ie())},"清除背景",8,wC),w("input",{ref_key:"backgroundFileInput",ref:a,class:"background-file-input",type:"file",accept:"image/png,image/jpeg,image/webp",onChange:J},null,544),w("div",{class:"background-file-name",title:h.value},Ye(h.value||"未上传图像"),9,_C),w("div",SC,[w("label",null,[T[28]||(T[28]=w("span",null,"X",-1)),xe(w("input",{"onUpdate:modelValue":T[7]||(T[7]=p=>Pe(e).settings.backgroundX=p),type:"number",step:"1","aria-label":"背景图 X 偏移"},null,512),[[Je,Pe(e).settings.backgroundX,void 0,{number:!0}]])]),w("label",null,[T[29]||(T[29]=w("span",null,"Y",-1)),xe(w("input",{"onUpdate:modelValue":T[8]||(T[8]=p=>Pe(e).settings.backgroundY=p),type:"number",step:"1","aria-label":"背景图 Y 偏移"},null,512),[[Je,Pe(e).settings.backgroundY,void 0,{number:!0}]])])]),w("label",TC,[T[30]||(T[30]=w("span",null,"透明度",-1)),xe(w("input",{"onUpdate:modelValue":T[9]||(T[9]=p=>Pe(e).settings.backgroundOpacity=p),type:"range",min:"0",max:"1",step:"0.01","aria-label":"背景图透明度"},null,512),[[Je,Pe(e).settings.backgroundOpacity,void 0,{number:!0}]]),w("b",null,Ye(Math.round(Pe(e).settings.backgroundOpacity*100))+"%",1)])])):$e("",!0)]),w("button",{class:Ze(["help-btn",{on:o.value}]),title:"查看使用说明",onClick:te},"使用说明",2),w("span",MC,Ye(Math.round(Pe(e).editor.viewScale*100))+"%",1)]),n.value?(se(),ce("div",EC,[w("div",AC,[T[31]||(T[31]=Yt("系统设置 ",-1)),w("button",{class:"sp-close",onClick:T[11]||(T[11]=p=>n.value=!1)},"✕")]),T[45]||(T[45]=w("div",{class:"sp-section-title"},"界面布局",-1)),w("label",CC,[T[33]||(T[33]=w("span",null,"参数面板位置",-1)),w("span",IC,[xe(w("input",{type:"checkbox","onUpdate:modelValue":T[12]||(T[12]=p=>Pe(e).settings.parameterPanelOnRight=p),"aria-label":"参数面板显示在右侧"},null,512),[[Lt,Pe(e).settings.parameterPanelOnRight]]),T[32]||(T[32]=w("span",{class:"sp-switch-ui","aria-hidden":"true"},null,-1)),w("b",null,Ye(Pe(e).settings.parameterPanelOnRight?"右侧":"左侧"),1)])]),T[46]||(T[46]=w("div",{class:"sp-divider"},null,-1)),T[47]||(T[47]=w("div",{class:"sp-section-title"},"操作历史",-1)),w("label",RC,[T[34]||(T[34]=w("span",null,"最大撤回步数",-1)),xe(w("input",{class:"sp-num sp-undo-limit",type:"number",min:"1",max:"200","onUpdate:modelValue":T[13]||(T[13]=p=>Pe(e).settings.undoLimit=p),"aria-label":"最大撤回步数",onChange:W},null,544),[[Je,Pe(e).settings.undoLimit,void 0,{number:!0}]])]),T[48]||(T[48]=w("div",{class:"sp-divider"},null,-1)),T[49]||(T[49]=w("div",{class:"sp-section-title"},"画布辅助显示",-1)),w("label",PC,[xe(w("input",{type:"checkbox","onUpdate:modelValue":T[14]||(T[14]=p=>Pe(e).settings.showEmitter=p)},null,512),[[Lt,Pe(e).settings.showEmitter]]),T[35]||(T[35]=Yt("发射点",-1))]),w("label",kC,[xe(w("input",{type:"checkbox","onUpdate:modelValue":T[15]||(T[15]=p=>Pe(e).settings.showBones=p)},null,512),[[Lt,Pe(e).settings.showBones]]),T[36]||(T[36]=Yt("骨骼连线",-1))]),Pe(e).settings.showBones?(se(),ce(qe,{key:0},[w("label",FC,[T[37]||(T[37]=w("span",null,"骨骼点绘制大小",-1)),xe(w("input",{class:"sp-num",type:"number",min:"0.1",max:"10",step:"0.1","onUpdate:modelValue":T[16]||(T[16]=p=>Pe(e).settings.bonePointDrawSize=p),"aria-label":"骨骼点绘制大小",onChange:f},null,544),[[Je,Pe(e).settings.bonePointDrawSize,void 0,{number:!0}]])]),w("label",OC,[T[38]||(T[38]=w("span",null,"坐标轴绘制大小",-1)),xe(w("input",{class:"sp-num",type:"number",min:"0.1",max:"10",step:"0.1","onUpdate:modelValue":T[17]||(T[17]=p=>Pe(e).settings.boneAxisDrawSize=p),"aria-label":"坐标轴绘制大小",onChange:f},null,544),[[Je,Pe(e).settings.boneAxisDrawSize,void 0,{number:!0}]])])],64)):$e("",!0),w("label",BC,[xe(w("input",{type:"checkbox","onUpdate:modelValue":T[18]||(T[18]=p=>Pe(e).settings.showSkinMesh=p)},null,512),[[Lt,Pe(e).settings.showSkinMesh]]),T[39]||(T[39]=Yt("蒙皮网格",-1))]),T[50]||(T[50]=w("div",{class:"sp-divider"},null,-1)),w("label",LC,[xe(w("input",{type:"checkbox","onUpdate:modelValue":T[19]||(T[19]=p=>Pe(e).settings.tickEnabled=p)},null,512),[[Lt,Pe(e).settings.tickEnabled]]),T[40]||(T[40]=Yt("启用刻度",-1))]),Pe(e).settings.tickEnabled?(se(),ce(qe,{key:1},[w("label",DC,[T[41]||(T[41]=w("span",null,"刻度文字大小",-1)),xe(w("input",{type:"range",min:"8",max:"40",step:"1","onUpdate:modelValue":T[20]||(T[20]=p=>Pe(e).settings.axisFontSize=p)},null,512),[[Je,Pe(e).settings.axisFontSize,void 0,{number:!0}]]),xe(w("input",{type:"number",min:"8",max:"40","onUpdate:modelValue":T[21]||(T[21]=p=>Pe(e).settings.axisFontSize=p),class:"sp-num"},null,512),[[Je,Pe(e).settings.axisFontSize,void 0,{number:!0}]])]),w("label",NC,[T[42]||(T[42]=w("span",null,"刻度线粗细",-1)),xe(w("input",{type:"range",min:"1",max:"5",step:"0.5","onUpdate:modelValue":T[22]||(T[22]=p=>Pe(e).settings.tickWidth=p)},null,512),[[Je,Pe(e).settings.tickWidth,void 0,{number:!0}]]),xe(w("input",{type:"number",min:"1",max:"5","onUpdate:modelValue":T[23]||(T[23]=p=>Pe(e).settings.tickWidth=p),class:"sp-num"},null,512),[[Je,Pe(e).settings.tickWidth,void 0,{number:!0}]])]),w("label",UC,[T[43]||(T[43]=w("span",null,"坐标轴颜色",-1)),xe(w("input",{type:"color","onUpdate:modelValue":T[24]||(T[24]=p=>Pe(e).settings.axisColor=p),class:"sp-colr"},null,512),[[Je,Pe(e).settings.axisColor]]),w("span",VC,Ye(Pe(e).settings.axisColor),1)]),w("label",XC,[xe(w("input",{type:"checkbox","onUpdate:modelValue":T[25]||(T[25]=p=>Pe(e).settings.showAxisLabels=p)},null,512),[[Lt,Pe(e).settings.showAxisLabels]]),T[44]||(T[44]=Yt("显示刻度数值",-1))])],64)):$e("",!0),T[51]||(T[51]=w("div",{class:"sp-cache-note"},"整个系统设置会自动保存到当前浏览器",-1))])):$e("",!0),o.value?(se(),ce("div",{key:1,class:"help-overlay",role:"presentation",onClick:T[27]||(T[27]=xt(p=>o.value=!1,["self"]))},[w("section",YC,[w("header",$C,[T[52]||(T[52]=w("div",null,[w("h2",{id:"help-title"},"使用说明"),w("p",null,"从创建粒子到保存、导出的快速入门")],-1)),w("button",{class:"help-close","aria-label":"关闭使用说明",title:"关闭 (Esc)",onClick:T[26]||(T[26]=p=>o.value=!1)},"✕")]),T[53]||(T[53]=Vo('

快速开始

  1. 创建对象:在左侧“场景对象”中添加粒子、碰撞、路径或 Spine。
  2. 编辑粒子:选中粒子系统,依次调整发射、形状、属性、外观资源和修改器。
  3. 查看效果:使用底部时间轴播放、暂停或拖动到指定帧;修改参数后会自动重新计算。
  4. 保存成果:配置文件用于继续编辑;“导出 Spine Json”支持 Spine 3.8、4.0、4.1 和 4.2。

常用功能

小眼睛
单独显示或隐藏场景对象;隐藏的粒子系统不会导出。
+Copy
完整复制当前选中对象,方便对比不同参数效果。
背景图
上传参考图并调整位置和透明度,只用于画布预览。
系统设置
管理界面与辅助显示,并自动保存在当前浏览器中。
配置管理
保存当前项目数据、加载配置,或直接使用预设文件;不包含系统设置。
Spine 骨骼
在层级树搜索并选择骨骼,可用于粒子发射器跟随。

快捷键

Ctrl/⌘+Z撤回上一步
Ctrl/⌘+S保存配置
Q拖动画布
W位移工具
E旋转工具
R缩放工具
D播放 / 暂停
S回到第一帧

Q / W / E / R 需要先点击画布。光标位于输入框时,单键快捷键不会触发。

配置与导出有什么区别?

保存配置会保存编辑器中的全部对象和参数,之后可以继续修改;导出 Spine Json只导出显示中的粒子系统,并把跟随、碰撞和拖尾结果烘焙为独立动画数据。

',1))])])):$e("",!0),s.value?(se(),ce("div",GC,[T[54]||(T[54]=Yt(" 系统: ",-1)),w("b",jC,Ye(s.value.systems),1),T[55]||(T[55]=Yt(" · 粒子(骨骼): ",-1)),w("b",HC,Ye(s.value.particles),1),T[56]||(T[56]=Yt(" · 根骨骼: ",-1)),T[57]||(T[57]=w("b",null,"root",-1)),T[58]||(T[58]=w("span",{class:"hud-tip"},"滚轮缩放 · 左键拖动画布",-1))])):$e("",!0)]))}}),Ks=(i,e)=>{const t=i.__vccOpts||i;for(const[s,n]of e)t[s]=n;return t},zC=Ks(WC,[["__scopeId","data-v-1b609e97"]]),qC={class:"ns-label"},KC=["min","max","step","value","disabled"],ZC=["min","max","step","value","disabled"],JC=Ws({__name:"NumSlider",props:{label:{},modelValue:{},min:{},max:{},step:{},disabled:{type:Boolean}},emits:["update:modelValue"],setup(i,{emit:e}){const t=i,s=e,n=it(String(t.modelValue));cs(()=>t.modelValue,h=>{n.value=String(h)});function r(h){const l=parseFloat(h.target.value);Number.isNaN(l)||s("update:modelValue",l)}function o(h){n.value=h.target.value;const l=parseFloat(n.value);Number.isNaN(l)||s("update:modelValue",l)}function a(){const h=parseFloat(n.value);Number.isNaN(h)&&(n.value=String(t.modelValue))}return(h,l)=>(se(),ce("div",{class:Ze(["ns",{disabled:i.disabled}])},[w("span",qC,Ye(i.label),1),w("input",{type:"range",class:"ns-range",min:i.min,max:i.max,step:i.step,value:i.modelValue,disabled:i.disabled,onInput:r},null,40,KC),w("input",{type:"number",class:"ns-num",min:i.min,max:i.max,step:i.step,value:n.value,disabled:i.disabled,onInput:o,onBlur:a},null,40,ZC)],2))}}),Ge=Ks(JC,[["__scopeId","data-v-7c2fbed0"]]),QC={class:"ce"},e2={class:"ce-editor"},t2={class:"ce-grid"},i2=["x1","x2","y2"],s2=["y1","x2","y2"],n2=["x","y","width","height"],r2=["d"],o2={key:0,class:"ce-handles"},a2=["x1","y1","x2","y2"],l2=["cx","cy","onPointerdown"],h2=["x1","y1","x2","y2"],c2=["cx","cy","onPointerdown"],u2=["cx","cy"],d2=["cx","cy","onPointerdown","onDblclick"],f2={class:"ce-nav"},p2={class:"ce-tip"},Rn=8,m2=Ws({__name:"CurveEditor",props:{modelValue:{},defaultValue:{default:()=>[{x:0,y:0},{x:1,y:1}]},mode:{default:"linear"}},emits:["update:modelValue"],setup(i,{emit:e}){const t=i,s=e,n=it(null),r=it(300),o=it(110);let a=null;function h(){if(!n.value)return;const k=n.value.getBoundingClientRect();r.value=k.width,o.value=k.height}function l(k){return Rn+k*(r.value-Rn*2)}function c(k){return Rn+(1-k)*(o.value-Rn*2)}function u(){return[...t.modelValue].sort((k,F)=>k.x-F.x)}function f(k){s("update:modelValue",[...k].sort((F,D)=>F.x-D.x))}function d(){f(t.defaultValue.map(k=>({...k})))}const m=ut(()=>u());function g(k){const F=m.value[k],D=m.value[Math.max(0,k-1)];return{x:F.x-(F.x-D.x)/3,y:F.y-(F.y-D.y)/3}}function b(k){const F=m.value[k],D=m.value[Math.min(m.value.length-1,k+1)];return{x:F.x+(D.x-F.x)/3,y:F.y+(D.y-F.y)/3}}function _(k){const F=m.value[k],D=g(k);return{x:F.x+(F.inX??D.x-F.x),y:F.y+(F.inY??D.y-F.y)}}function M(k){const F=m.value[k],D=b(k);return{x:F.x+(F.outX??D.x-F.x),y:F.y+(F.outY??D.y-F.y)}}const v=ut(()=>{if(!m.value.length)return"";let k=`M ${l(m.value[0].x)} ${c(m.value[0].y)}`;for(let F=1;FMath.abs(j.x-F)>.02);N.push({x:F,y:D}),f(N)}let E={t:0,i:-1,x:0,y:0};function C(k,F){k.stopPropagation();const D=u().findIndex(L=>Math.abs(L.x-m.value[F].x)<1e-6&&Math.abs(L.y-m.value[F].y)<1e-6);if(D<0)return;const N=Date.now();if(N-E.t<300&&E.i===F&&Math.abs(k.clientX-E.x)<8&&Math.abs(k.clientY-E.y)<8){E={t:0,i:-1,x:0,y:0},B(F);return}E={t:N,i:F,x:k.clientX,y:k.clientY};const j=L=>{(Math.abs(L.clientX-k.clientX)>8||Math.abs(L.clientY-k.clientY)>8)&&(E={t:0,i:-1,x:0,y:0});const{x:P,y:X}=S(L.clientX,L.clientY),U=u();U[D]={x:P,y:X},f(U)},O=()=>{window.removeEventListener("pointermove",j),window.removeEventListener("pointerup",O)};window.addEventListener("pointermove",j),window.addEventListener("pointerup",O)}function R(k,F,D){k.stopPropagation();const N=O=>{const L=S(O.clientX,O.clientY),P=u(),X=P[F],U=D==="in"?P[Math.max(0,F-1)].x:X.x,Y=D==="in"?X.x:P[Math.min(P.length-1,F+1)].x,q=Math.min(Y,Math.max(U,L.x)),z=Math.round((q-X.x)*100)/100,ne=Math.round((L.y-X.y)*100)/100;P[F]=D==="in"?{...X,inX:z,inY:ne}:{...X,outX:z,outY:ne},f(P)},j=()=>{window.removeEventListener("pointermove",N),window.removeEventListener("pointerup",j)};window.addEventListener("pointermove",N),window.addEventListener("pointerup",j)}function B(k,F){F==null||F.stopPropagation();const D=u();D.length<=2||(y=Date.now(),f(D.filter((N,j)=>j!==k)))}return _o(()=>{h(),a=new ResizeObserver(h),n.value&&a.observe(n.value)}),wa(()=>{a==null||a.disconnect()}),(k,F)=>(se(),ce("div",QC,[w("div",e2,[(se(),ce("svg",{ref_key:"svg",ref:n,class:"ce-svg",onDblclick:I},[w("g",t2,[(se(),ce(qe,null,Ht([.25,.5,.75],D=>w("line",{key:"v"+D,x1:l(D),y1:"0",x2:l(D),y2:c(0)},null,8,i2)),64)),(se(),ce(qe,null,Ht([.25,.5,.75],D=>w("line",{key:"h"+D,x1:"0",y1:c(D),x2:l(1),y2:c(D)},null,8,s2)),64))]),w("rect",{x:l(0),y:c(1),width:l(1)-l(0),height:c(0)-c(1),class:"ce-frame",fill:"none"},null,8,n2),w("path",{d:v.value,class:"ce-line",fill:"none"},null,8,r2),i.mode==="bezier"?(se(),ce("g",o2,[(se(!0),ce(qe,null,Ht(m.value,(D,N)=>(se(),ce(qe,{key:"handles-"+N},[N>0?(se(),ce("line",{key:0,x1:l(D.x),y1:c(D.y),x2:l(_(N).x),y2:c(_(N).y)},null,8,a2)):$e("",!0),N>0?(se(),ce("circle",{key:1,cx:l(_(N).x),cy:c(_(N).y),r:"4",onPointerdown:j=>R(j,N,"in")},null,40,l2)):$e("",!0),NR(j,N,"out")},null,40,c2)):$e("",!0)],64))),128))])):$e("",!0),(se(!0),ce(qe,null,Ht(m.value,(D,N)=>(se(),ce("g",{key:N},[w("circle",{cx:l(D.x),cy:c(D.y),r:"5",class:"ce-node"},null,8,u2),w("circle",{cx:l(D.x),cy:c(D.y),r:"9",class:"ce-hit",onPointerdown:j=>C(j,N),onDblclick:j=>B(N,j)},null,40,d2)]))),128))],544)),w("div",f2,[w("span",p2,Ye(i.mode==="bezier"?"拖动方形手柄调整弧度·双击空白新建·双击节点删除":"双击空白新建·双击节点删除·拖动节点调整"),1)])]),w("button",{class:"ce-reset",type:"button",title:"恢复默认曲线",onClick:d},"重置")]))}}),Is=Ks(m2,[["__scopeId","data-v-9bfb7b31"]]),g2={class:"pac"},v2={class:"pac-head"},y2={class:"pac-label"},x2={key:0,class:"pac-modes"},b2=["onClick"],w2={class:"pac-range"},_2={class:"pac-curve"},S2={class:"pac-axis"},T2=Ws({__name:"ParticleAttributeControl",props:{label:{},mode:{},valueMin:{},valueMax:{},curve:{},defaultCurve:{default:()=>[{x:0,y:0},{x:1,y:1}]},min:{},max:{},step:{default:1},allowDirection:{type:Boolean,default:!1},allowCurve:{type:Boolean,default:!0},showModes:{type:Boolean,default:!0},curveLabel:{default:"曲线输入 →"}},emits:["update:mode","update:valueMin","update:valueMax","update:curve"],setup(i){const e=i,t=ut(()=>{const s=[{label:"固定",value:"fixed"},{label:"随机",value:"random"}];return e.allowCurve&&s.push({label:"曲线",value:"curve"}),e.allowDirection&&s.push({label:"发射方向",value:"direction"}),s});return(s,n)=>(se(),ce("div",g2,[w("div",v2,[w("span",y2,Ye(i.label),1),i.showModes?(se(),ce("div",x2,[(se(!0),ce(qe,null,Ht(t.value,r=>(se(),ce("button",{key:r.value,class:Ze(["pac-mode",{on:i.mode===r.value}]),onClick:o=>s.$emit("update:mode",r.value)},Ye(r.label),11,b2))),128))])):$e("",!0)]),i.mode==="fixed"||i.mode==="direction"?(se(),Et(Ge,{key:0,label:i.mode==="direction"?"角度偏移":"数值",min:i.min,max:i.max,step:i.step,"model-value":i.valueMin,"onUpdate:modelValue":n[0]||(n[0]=r=>s.$emit("update:valueMin",r))},null,8,["label","min","max","step","model-value"])):i.mode==="random"?(se(),ce(qe,{key:1},[Ne(Ge,{label:"下限",min:i.min,max:i.max,step:i.step,"model-value":i.valueMin,"onUpdate:modelValue":n[1]||(n[1]=r=>s.$emit("update:valueMin",r))},null,8,["min","max","step","model-value"]),Ne(Ge,{label:"上限",min:i.min,max:i.max,step:i.step,"model-value":i.valueMax,"onUpdate:modelValue":n[2]||(n[2]=r=>s.$emit("update:valueMax",r))},null,8,["min","max","step","model-value"])],64)):(se(),ce(qe,{key:2},[w("div",w2,[Ne(Ge,{label:"范围下限",min:i.min,max:i.max,step:i.step,"model-value":i.valueMin,"onUpdate:modelValue":n[3]||(n[3]=r=>s.$emit("update:valueMin",r))},null,8,["min","max","step","model-value"]),Ne(Ge,{label:"范围上限",min:i.min,max:i.max,step:i.step,"model-value":i.valueMax,"onUpdate:modelValue":n[4]||(n[4]=r=>s.$emit("update:valueMax",r))},null,8,["min","max","step","model-value"])]),w("div",_2,[Ne(Is,{"model-value":i.curve,"default-value":i.defaultCurve,"onUpdate:modelValue":n[5]||(n[5]=r=>s.$emit("update:curve",r))},null,8,["model-value","default-value"]),w("div",S2,[n[6]||(n[6]=w("span",null,"0",-1)),w("span",null,Ye(i.curveLabel),1),n[7]||(n[7]=w("span",null,"1",-1))])])],64))]))}}),nn=Ks(T2,[["__scopeId","data-v-238f838c"]]),M2={class:"gradient-editor"},E2=["title","onClick","onDblclick","onPointerdown"],A2={key:0,class:"gradient-controls"},C2=["value"],I2=["value"],R2={class:"gradient-position"},P2=["value"],k2=["disabled"],F2=Ws({__name:"ColorGradientEditor",props:{modelValue:{}},emits:["update:modelValue"],setup(i,{emit:e}){const t=i,s=e,n=it(null),r=it(0),o=ut(()=>t.modelValue[r.value]||null),a=ut(()=>[...t.modelValue].sort((C,R)=>C.position-R.position)),h=ut(()=>{const C=a.value;return C.length?`linear-gradient(90deg, ${C.map(R=>`${R.color} ${l(R.position)*100}%`).join(", ")})`:"#ffffff"});cs(()=>t.modelValue.length,C=>{r.value>=C&&(r.value=Math.max(0,C-1))});function l(C){return Math.min(1,Math.max(0,Number(C)||0))}function c(){return t.modelValue.map(C=>({position:l(C.position),color:C.color}))}function u(C,R){const B=c();B[C]&&(B[C]={...B[C],...R},s("update:modelValue",B))}function f(C){u(r.value,{color:C.target.value})}function d(C){var k;const R=C.target,B=E(R.value,((k=o.value)==null?void 0:k.color)||"#ffffff");R.value=B,u(r.value,{color:B})}function m(C){const R=C.target;d(C),R.blur()}function g(C){const R=Number(C.target.value);Number.isFinite(R)&&u(r.value,{position:l(R/100)})}function b(C){const R=c();R.push({position:l(C),color:y(R,C)}),r.value=R.length-1,s("update:modelValue",R)}function _(C){if(!n.value)return;const R=n.value.getBoundingClientRect();b((C.clientX-R.left)/Math.max(1,R.width))}function M(){const C=a.value;let R=.5;if(C.length>1){let B=-1;for(let k=0;kB&&(B=F,R=(C[k].position+C[k+1].position)/2)}}b(R)}function v(C){if(t.modelValue.length<=2||C<0)return;const R=c().filter((B,k)=>k!==C);r.value=Math.min(C,R.length-1),s("update:modelValue",R)}function S(C,R){if(!n.value)return;r.value=R;const B=F=>{const D=n.value.getBoundingClientRect();u(R,{position:l((F.clientX-D.left)/Math.max(1,D.width))})},k=()=>{window.removeEventListener("pointermove",B),window.removeEventListener("pointerup",k),window.removeEventListener("pointercancel",k)};window.addEventListener("pointermove",B),window.addEventListener("pointerup",k),window.addEventListener("pointercancel",k),C.preventDefault()}function y(C,R){const B=[...C].sort((k,F)=>k.position-F.position);if(!B.length)return"#ffffff";if(R<=B[0].position)return B[0].color;if(R>=B[B.length-1].position)return B[B.length-1].color;for(let k=0;kD.position)continue;const N=(R-F.position)/Math.max(1e-4,D.position-F.position);return I(F.color,D.color,N)}return B[B.length-1].color}function I(C,R,B){const k=j=>{const O=parseInt(j.replace("#","").padEnd(6,"0").slice(0,6),16);return[O>>16&255,O>>8&255,O&255]},F=k(C),D=k(R),N=j=>Math.round(F[j]+(D[j]-F[j])*B);return`#${[N(0),N(1),N(2)].map(j=>j.toString(16).padStart(2,"0")).join("")}`}function E(C,R){let B=C.trim().replace(/^#/,"");return/^[0-9a-f]{3}$/i.test(B)&&(B=B.split("").map(k=>k+k).join("")),/^[0-9a-f]{6}$/i.test(B)?`#${B.toLowerCase()}`:R}return(C,R)=>(se(),ce("div",M2,[w("div",{ref_key:"bar",ref:n,class:"gradient-bar",style:Pi({background:h.value}),title:"双击色带添加色标",onDblclick:_},[(se(!0),ce(qe,null,Ht(i.modelValue,(B,k)=>(se(),ce("button",{key:k,type:"button",class:Ze(["gradient-stop",{selected:k===r.value}]),style:Pi({left:`${l(B.position)*100}%`,"--stop-color":B.color}),title:`${Math.round(l(B.position)*100)}% · ${B.color}`,onClick:xt(F=>r.value=k,["stop"]),onDblclick:xt(F=>v(k),["stop"]),onPointerdown:xt(F=>S(F,k),["stop"])},null,46,E2))),128))],36),o.value?(se(),ce("div",A2,[w("input",{type:"color",class:"gradient-color",value:o.value.color,"aria-label":"色标颜色",onInput:f},null,40,C2),w("input",{type:"text",class:"gradient-hex-input",value:o.value.color,"aria-label":"色标颜色值",spellcheck:"false",onChange:d,onKeydown:da(m,["enter"])},null,40,I2),w("label",R2,[w("input",{type:"number",min:"0",max:"100",step:"1",value:Math.round(l(o.value.position)*100),"aria-label":"色标位置",onInput:g},null,40,P2),R[1]||(R[1]=w("span",null,"%",-1))]),w("button",{type:"button",class:"gradient-action",title:"在中间新增颜色",onClick:M},"+"),w("button",{type:"button",class:"gradient-action danger",title:"删除当前色标",disabled:i.modelValue.length<=2,onClick:R[0]||(R[0]=B=>v(r.value))},"×",8,k2)])):$e("",!0),R[2]||(R[2]=w("div",{class:"gradient-hint"},"双击色带新增 · 拖动色标调整位置 · 双击色标删除",-1))]))}}),pg=Ks(F2,[["__scopeId","data-v-f6ab10bf"]]),O2={class:"image-card"},B2={class:"imgrow"},L2=["title"],D2=["src","alt"],N2={key:1,viewBox:"0 0 24 24",width:"22",height:"22",fill:"none",stroke:"#8a93bb","stroke-width":"1.6"},U2={class:"img-fields"},V2={key:0,class:"row"},X2={class:"row"},Y2=["placeholder"],$2={class:"img-actions"},G2=["title"],j2=["disabled"],H2={class:"thumb-note"},W2={key:0,class:"row"},z2={class:"row"},q2={class:"row"},K2={class:"sequence-note"},Z2={class:"resource-weight-row"},J2=["disabled","title"],Q2={key:0,viewBox:"0 0 24 24","aria-hidden":"true"},eI={key:1,viewBox:"0 0 24 24","aria-hidden":"true"},tI=Ws({__name:"ImageResourceCard",props:{resource:{},resourceCount:{},defaultFile:{},namePlaceholder:{default:"particle"},showFolder:{type:Boolean,default:!0},supportsSequence:{type:Boolean,default:!1}},emits:["pick","pickSequence","reset","remove","updateWeight","toggleLock"],setup(i,{emit:e}){const t=i,s=e,n=ut(()=>{var l,c;if(t.resource.imageMode==="sequence"){const u=t.resource.sequenceFrames||[];if(!u.length)return"未选择序列帧";const f=((l=u[0])==null?void 0:l.name)||"第 1 帧",d=((c=u[u.length-1])==null?void 0:c.name)||f;return u.length===1?`1 帧 · ${f}`:`${u.length} 帧 · ${f} → ${d}`}const h=t.resource.textureName||t.defaultFile.replace(/\.[^.]+$/,"");return h.includes(".")?h:`${h}.png`}),r=ut(()=>{var h,l;return t.resource.imageMode==="sequence"?((l=(h=t.resource.sequenceFrames)==null?void 0:h[0])==null?void 0:l.previewUrl)||"":t.resource.previewUrl}),o=ut(()=>{var u,f;const h=t.resource.sequenceFrames||[];if(!h.length)return"未选择序列帧";const l=((u=h[0])==null?void 0:u.name)||"第一张图片",c=((f=h[h.length-1])==null?void 0:f.name)||"最后一张图片";return`已选择 ${h.length} 帧,按 ${l}-${c} 顺序播放`});function a(){t.supportsSequence&&t.resource.imageMode==="sequence"?s("pickSequence",t.resource.id):s("pick",t.resource.id)}return(h,l)=>(se(),ce("div",O2,[w("div",B2,[w("button",{class:"img-thumb",title:i.supportsSequence&&i.resource.imageMode==="sequence"?"选择序列帧图片":"选择本地图片",onClick:a},[r.value?(se(),ce("img",{key:0,src:r.value,alt:i.resource.textureName},null,8,D2)):(se(),ce("svg",N2,[...l[10]||(l[10]=[w("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"},null,-1),w("circle",{cx:"8.5",cy:"8.5",r:"1.6"},null,-1),w("path",{d:"M21 15l-5-5-9 9"},null,-1)])]))],8,L2),w("div",U2,[i.showFolder?(se(),ce("label",V2,[l[11]||(l[11]=w("span",null,"子文件夹",-1)),xe(w("input",{"onUpdate:modelValue":l[0]||(l[0]=c=>i.resource.textureFolder=c),type:"text",class:"inp",placeholder:"subfolder/"},null,512),[[Je,i.resource.textureFolder]])])):$e("",!0),w("label",X2,[l[12]||(l[12]=w("span",null,"名称",-1)),xe(w("input",{"onUpdate:modelValue":l[1]||(l[1]=c=>i.resource.textureName=c),type:"text",class:"inp",placeholder:i.namePlaceholder},null,8,Y2),[[Je,i.resource.textureName]])])]),w("div",$2,[w("button",{class:"mini-btn2",title:`恢复 ${i.defaultFile}`,onClick:l[2]||(l[2]=c=>h.$emit("reset",i.resource.id))},"⟳",8,G2),w("button",{class:"mini-btn2",title:"删除图片资源",disabled:i.resourceCount===1,onClick:l[3]||(l[3]=c=>h.$emit("remove",i.resource.id))},"🗑",8,j2)])]),w("div",H2,Ye(n.value),1),i.supportsSequence?(se(),ce("label",W2,[l[14]||(l[14]=w("span",null,"图片模式",-1)),xe(w("select",{"onUpdate:modelValue":l[4]||(l[4]=c=>i.resource.imageMode=c),class:"inp"},[...l[13]||(l[13]=[w("option",{value:"fixed"},"固定",-1),w("option",{value:"sequence"},"序列帧",-1)])],512),[[kt,i.resource.imageMode]])])):$e("",!0),i.supportsSequence&&i.resource.imageMode==="sequence"?(se(),ce(qe,{key:1},[w("label",z2,[l[16]||(l[16]=w("span",null,"播放模式",-1)),xe(w("select",{"onUpdate:modelValue":l[5]||(l[5]=c=>i.resource.sequencePlayback=c),class:"inp"},[...l[15]||(l[15]=[w("option",{value:"once-hide"},"单次-尾帧消失",-1),w("option",{value:"once-hold"},"单次-尾帧固定",-1),w("option",{value:"loop-forward"},"正向循环",-1),w("option",{value:"loop-reverse"},"反向循环",-1)])],512),[[kt,i.resource.sequencePlayback]])]),w("label",q2,[l[17]||(l[17]=w("span",null,"播放帧率",-1)),xe(w("input",{"onUpdate:modelValue":l[6]||(l[6]=c=>i.resource.sequenceFps=c),type:"number",min:"1",max:"120",step:"1",class:"inp"},null,512),[[Je,i.resource.sequenceFps,void 0,{number:!0}]])]),w("button",{class:"sequence-pick",onClick:l[7]||(l[7]=c=>h.$emit("pickSequence",i.resource.id))},"选择序列帧(多选)"),w("div",K2,Ye(o.value),1)],64)):$e("",!0),w("div",Z2,[Ne(Ge,{class:"resource-weight-control",label:"占比%",min:0,max:100,step:1,"model-value":i.resource.weight,disabled:i.resource.locked||i.resourceCount===1,"onUpdate:modelValue":l[8]||(l[8]=c=>h.$emit("updateWeight",i.resource.id,c))},null,8,["model-value","disabled"]),w("button",{class:Ze(["weight-lock",{on:i.resource.locked}]),disabled:i.resourceCount===1,title:i.resource.locked?"解除占比锁定":"锁定当前占比",onClick:l[9]||(l[9]=c=>h.$emit("toggleLock",i.resource.id))},[i.resource.locked?(se(),ce("svg",Q2,[...l[18]||(l[18]=[w("rect",{x:"5",y:"10",width:"14",height:"10",rx:"2"},null,-1),w("path",{d:"M8 10V7a4 4 0 0 1 8 0v3"},null,-1)])])):(se(),ce("svg",eI,[...l[19]||(l[19]=[w("rect",{x:"5",y:"10",width:"14",height:"10",rx:"2"},null,-1),w("path",{d:"M16 10V7a4 4 0 0 0-7.5-2"},null,-1)])]))],10,J2)]),O1(h.$slots,"default",{},void 0)]))}}),mg=Ks(tI,[["__scopeId","data-v-68ff5314"]]),iI={class:"spine-editor"},sI={class:"field wide"},nI={class:"grid three"},rI={class:"field"},oI={class:"field"},aI={class:"field"},lI={class:"grid three"},hI={class:"field"},cI={class:"field"},uI={class:"field"},dI=["disabled"],fI={class:"asset-row"},pI=["title"],mI={class:"asset-row"},gI=["title"],vI={class:"asset-row"},yI=["title"],xI={class:"asset-actions"},bI=["disabled"],wI={class:"runtime-note"},_I={key:0},SI={key:0,class:"error"},TI={class:"section-box"},MI={key:0,class:"empty"},EI={key:1,class:"field wide"},AI=["value"],CI={class:"section-box"},II={class:"tree-title-row"},RI=["disabled","title"],PI={key:0,class:"empty"},kI={key:1,class:"bone-search"},FI={key:2,class:"empty"},OI={key:3,class:"bone-tree"},BI=["onClick","onKeydown"],LI=["title","onClick"],DI={key:1,class:"bone-leaf"},NI={class:"bone-name"},UI=Ws({__name:"SpineObjectPanel",props:{spineObject:{}},setup(i){const e=i,t=Aa(),s=it(null),n=it(null),r=it(null),o=it(null),a=it(new Set),h=it(""),l=it(null),c=it(null),u=it([]);e.spineObject.selectedBone==null&&(e.spineObject.selectedBone=""),e.spineObject.sourceBundle==null&&(e.spineObject.sourceBundle=null),e.spineObject.dataVersion==null&&(e.spineObject.dataVersion="");const f=ut(()=>{var L;return((L=l.value)==null?void 0:L.name)||e.spineObject.skeletonFileName}),d=ut(()=>{var L;return((L=c.value)==null?void 0:L.name)||e.spineObject.atlasFileName}),m=ut(()=>u.value.length?u.value.map(L=>L.name):e.spineObject.textureFileNames),g=ut(()=>m.value.length?`${m.value.length} 张:${m.value.join(", ")}`:"PNG / JPEG / WebP..."),b=ut(()=>new Set(e.spineObject.bones.map(L=>L.parent).filter(L=>!!L))),_=ut(()=>new Map(e.spineObject.bones.map(L=>[L.name,L]))),M=ut(()=>e.spineObject.bones.filter(L=>{var U;const P=h.value.trim().toLocaleLowerCase();if(P)return L.name.toLocaleLowerCase().includes(P);let X=L.parent;for(;X;){if(a.value.has(X))return!1;X=((U=_.value.get(X))==null?void 0:U.parent)||null}return!0})),v=ut(()=>b.value.size>0&&[...b.value].every(L=>a.value.has(L)));function S(L){const P=e.spineObject.selectedBone===L;for(const X of t.spines)X.selectedBone="";P||(e.spineObject.selectedBone=L)}function y(L){a.value.has(L)?a.value.delete(L):a.value.add(L)}function I(){a.value=v.value?new Set:new Set(b.value)}function E(L){var P;return((P=L.target.files)==null?void 0:P[0])||null}function C(L){l.value=E(L)}function R(L){c.value=E(L)}function B(L){u.value=Array.from(L.target.files||[])}function k(L){return L.name.replace(/\.[^.]+$/,"").toLocaleLowerCase()}async function F(L){const P=Array.from(L.target.files||[]);if(!P.length)return;const X=P.filter(H=>/\.(json|skel)$/i.test(H.name)),U=P.filter(H=>/\.atlas$/i.test(H.name)),Y=P.filter(H=>/\.(png|jpe?g|webp|wepb)$/i.test(H.name)),q=U.map(H=>({atlas:H,skeleton:X.find(Z=>k(Z)===k(H))})).find(H=>H.skeleton),z=(q==null?void 0:q.skeleton)||X[0]||null,ne=(q==null?void 0:q.atlas)||U[0]||null;if(l.value=z,c.value=ne,u.value=Y,!z||!ne||!Y.length){const H=[!z&&"JSON / SKEL",!ne&&"Atlas",!Y.length&&"纹理图片"].filter(Boolean).join("、");e.spineObject.status="error",e.spineObject.error=`所选文件夹缺少:${H}`;return}await j()}function D(){t.recalcTotalFrames()}function N(){D(),t.timeline.frame=0}async function j(){var X;const L=l.value,P=c.value;if(!L||!P||!u.value.length){e.spineObject.status="error",e.spineObject.error="请依次选择 Spine 数据、Atlas 和全部纹理图片";return}e.spineObject.status="loading",e.spineObject.error="";try{const U=await lx(L,P,u.value);Lh(e.spineObject.id,U),e.spineObject.skeletonFileName=L.name,e.spineObject.atlasFileName=P.name,e.spineObject.textureFileNames=u.value.map(Y=>Y.name),e.spineObject.dataVersion=U.dataVersion,e.spineObject.animations=U.animations,e.spineObject.bones=U.bones,e.spineObject.selectedBone="",h.value="",a.value=new Set,e.spineObject.selectedAnimation=((X=U.animations[0])==null?void 0:X.name)||"",e.spineObject.assetVersion++,e.spineObject.status="ready",D(),t.timeline.frame=0;try{e.spineObject.sourceBundle=await ZA(L,P,u.value)}catch(Y){e.spineObject.sourceBundle=null,console.warn("Spine 配置资源嵌入失败",Y)}}catch(U){e.spineObject.status="error",e.spineObject.error=U instanceof Error?U.message:String(U)}}function O(){Ea(e.spineObject.id),l.value=null,c.value=null,u.value=[],s.value&&(s.value.value=""),n.value&&(n.value.value=""),r.value&&(r.value.value=""),o.value&&(o.value.value=""),e.spineObject.skeletonFileName="",e.spineObject.atlasFileName="",e.spineObject.textureFileNames=[],e.spineObject.dataVersion="",e.spineObject.sourceBundle=null,e.spineObject.animations=[],e.spineObject.bones=[],e.spineObject.selectedBone="",h.value="",a.value=new Set,e.spineObject.selectedAnimation="",e.spineObject.assetVersion++,e.spineObject.status="empty",e.spineObject.error="",D()}return(L,P)=>(se(),ce("div",iI,[P[30]||(P[30]=w("div",{class:"editor-title"},"Spine 属性",-1)),w("label",sI,[P[15]||(P[15]=w("span",null,"Spine 名称",-1)),xe(w("input",{"onUpdate:modelValue":P[0]||(P[0]=X=>i.spineObject.name=X)},null,512),[[Je,i.spineObject.name]])]),w("div",nI,[w("label",rI,[P[16]||(P[16]=w("span",null,"X 位置",-1)),xe(w("input",{"onUpdate:modelValue":P[1]||(P[1]=X=>i.spineObject.x=X),type:"number"},null,512),[[Je,i.spineObject.x,void 0,{number:!0}]])]),w("label",oI,[P[17]||(P[17]=w("span",null,"Y 位置",-1)),xe(w("input",{"onUpdate:modelValue":P[2]||(P[2]=X=>i.spineObject.y=X),type:"number"},null,512),[[Je,i.spineObject.y,void 0,{number:!0}]])]),w("label",aI,[P[18]||(P[18]=w("span",null,"旋转",-1)),xe(w("input",{"onUpdate:modelValue":P[3]||(P[3]=X=>i.spineObject.rotation=X),type:"number"},null,512),[[Je,i.spineObject.rotation,void 0,{number:!0}]])])]),w("div",lI,[w("label",hI,[P[19]||(P[19]=w("span",null,"Scale X",-1)),xe(w("input",{"onUpdate:modelValue":P[4]||(P[4]=X=>i.spineObject.scaleX=X),type:"number",step:"0.05"},null,512),[[Je,i.spineObject.scaleX,void 0,{number:!0}]])]),w("label",cI,[P[20]||(P[20]=w("span",null,"Scale Y",-1)),xe(w("input",{"onUpdate:modelValue":P[5]||(P[5]=X=>i.spineObject.scaleY=X),type:"number",step:"0.05"},null,512),[[Je,i.spineObject.scaleY,void 0,{number:!0}]])]),w("label",uI,[P[21]||(P[21]=w("span",null,"开始时间",-1)),xe(w("input",{"onUpdate:modelValue":P[6]||(P[6]=X=>i.spineObject.timeOffset=X),type:"number",min:"0",step:"0.033333",onChange:D},null,544),[[Je,i.spineObject.timeOffset,void 0,{number:!0}]])])]),P[31]||(P[31]=w("div",{class:"divider"},null,-1)),P[32]||(P[32]=w("div",{class:"section-title"},"Spine 资源",-1)),w("input",{ref_key:"skeletonInput",ref:s,hidden:"",type:"file",accept:".json,.skel,application/json,application/octet-stream",onChange:C},null,544),w("input",{ref_key:"atlasInput",ref:n,hidden:"",type:"file",accept:".atlas,text/plain",onChange:R},null,544),w("input",{ref_key:"textureInput",ref:r,hidden:"",type:"file",multiple:"",accept:".png,.jpg,.jpeg,.webp,.wepb,image/png,image/jpeg,image/webp",onChange:B},null,544),w("input",{ref_key:"folderInput",ref:o,hidden:"",type:"file",multiple:"",webkitdirectory:"",directory:"",onChange:F},null,544),w("button",{class:"folder-select",disabled:i.spineObject.status==="loading",onClick:P[7]||(P[7]=X=>{var U;return(U=o.value)==null?void 0:U.click()})},"选择文件夹并加载",8,dI),P[33]||(P[33]=w("div",{class:"folder-hint"},"一次读取文件夹中的 JSON / SKEL、Atlas 和全部纹理;仍可在下方单独替换资源。",-1)),w("div",fI,[w("div",{class:"asset-name",title:f.value},Ye(f.value||"JSON / SKEL..."),9,pI),w("button",{onClick:P[8]||(P[8]=X=>{var U;return(U=s.value)==null?void 0:U.click()})},"选择")]),w("div",mI,[w("div",{class:"asset-name",title:d.value},Ye(d.value||"Atlas..."),9,gI),w("button",{onClick:P[9]||(P[9]=X=>{var U;return(U=n.value)==null?void 0:U.click()})},"选择")]),w("div",vI,[w("div",{class:"asset-name",title:m.value.join(", ")},Ye(g.value),9,yI),w("button",{onClick:P[10]||(P[10]=X=>{var U;return(U=r.value)==null?void 0:U.click()})},"选择(多选)")]),w("div",xI,[w("button",{class:"load",disabled:i.spineObject.status==="loading",onClick:j},Ye(i.spineObject.status==="loading"?"加载中…":"↧ 加载"),9,bI),w("button",{class:"clear",onClick:O},"清除")]),w("div",wI,[P[22]||(P[22]=Yt(" 支持 Spine 3.8 / 4.0 / 4.1 / 4.2 JSON · 4.2.119 预览运行时 · 本地离线 ",-1)),i.spineObject.dataVersion?(se(),ce("span",_I," · 当前资源 "+Ye(i.spineObject.dataVersion),1)):$e("",!0)]),i.spineObject.error?(se(),ce("div",SI,Ye(i.spineObject.error),1)):$e("",!0),w("div",TI,[P[25]||(P[25]=w("div",{class:"section-title"},"Spine 动画",-1)),i.spineObject.animations.length?(se(),ce("label",EI,[P[24]||(P[24]=w("span",null,"时间轴播放动画",-1)),xe(w("select",{"onUpdate:modelValue":P[11]||(P[11]=X=>i.spineObject.selectedAnimation=X),onChange:N},[P[23]||(P[23]=w("option",{value:""},"无",-1)),(se(!0),ce(qe,null,Ht(i.spineObject.animations,X=>(se(),ce("option",{key:X.name,value:X.name},Ye(X.name)+"("+Ye(X.duration.toFixed(2))+"s) ",9,AI))),128))],544),[[kt,i.spineObject.selectedAnimation]])])):(se(),ce("div",MI,"无可用动画"))]),w("div",CI,[w("div",II,[P[29]||(P[29]=w("div",{class:"section-title"},"层级树",-1)),w("button",{class:Ze(["selected-bone",{active:i.spineObject.selectedBone}]),disabled:!i.spineObject.selectedBone,title:i.spineObject.selectedBone?"点击清除骨骼选择":"当前未选择骨骼",onClick:P[12]||(P[12]=X=>i.spineObject.selectedBone="")},[i.spineObject.selectedBone?(se(),ce(qe,{key:0},[P[26]||(P[26]=Yt("清除选中骨骼:",-1)),w("strong",null,Ye(i.spineObject.selectedBone),1)],64)):(se(),ce(qe,{key:1},[P[27]||(P[27]=Yt("当前骨骼:",-1)),P[28]||(P[28]=w("strong",null,"未选择",-1))],64))],10,RI),i.spineObject.bones.length?(se(),ce("button",{key:0,class:"tree-action",onClick:I},Ye(v.value?"全部展开":"全部折叠"),1)):$e("",!0)]),i.spineObject.bones.length?(se(),ce("div",kI,[xe(w("input",{"onUpdate:modelValue":P[13]||(P[13]=X=>h.value=X),type:"search","aria-label":"搜索骨骼",placeholder:"搜索骨骼名称…"},null,512),[[Je,h.value,void 0,{trim:!0}]]),h.value?(se(),ce("button",{key:0,title:"清空搜索","aria-label":"清空骨骼搜索",onClick:P[14]||(P[14]=X=>h.value="")},"✕")):$e("",!0)])):(se(),ce("div",PI,"未加载 Spine")),i.spineObject.bones.length&&!M.value.length?(se(),ce("div",FI,"未找到匹配的骨骼")):i.spineObject.bones.length?(se(),ce("div",OI,[(se(!0),ce(qe,null,Ht(M.value,X=>(se(),ce("div",{key:X.name,class:Ze(["bone",{selected:i.spineObject.selectedBone===X.name}]),style:Pi({paddingLeft:`${6+X.depth*16}px`}),role:"button",tabindex:"0",onClick:U=>S(X.name),onKeydown:da(xt(U=>S(X.name),["prevent"]),["enter"])},[b.value.has(X.name)?(se(),ce("button",{key:0,class:"bone-toggle",title:a.value.has(X.name)?"展开子骨骼":"折叠子骨骼",onClick:xt(U=>y(X.name),["stop"])},Ye(a.value.has(X.name)?"▸":"▾"),9,LI)):(se(),ce("span",DI,"•")),w("span",NI,Ye(X.name),1)],46,BI))),128))])):$e("",!0)])]))}}),VI=Ks(UI,[["__scopeId","data-v-af64e8e8"]]),XI="3.8";function Wi(i,e,t){i[e]==null&&i[t]!=null&&(i[e]=i[t]),delete i[t]}function Pd(i){if(!i||typeof i!="object")return;if(Array.isArray(i)){for(const t of i)Pd(t);return}const e=i;Array.isArray(e.curve)&&delete e.curve;for(const t of Object.values(e))Pd(t)}function YI(i){for(const e of i.bones)Wi(e,"transform","inherit");for(const e of i.transform||[])Wi(e,"rotateMix","mixRotate"),e.translateMix==null&&(e.translateMix=e.mixX??e.mixY),e.scaleMix==null&&(e.scaleMix=e.mixScaleX??e.mixScaleY),Wi(e,"shearMix","mixShearY"),delete e.mixX,delete e.mixY,delete e.mixScaleX,delete e.mixScaleY;for(const e of i.path||[])Wi(e,"rotateMix","mixRotate"),e.translateMix==null&&(e.translateMix=e.mixX??e.mixY),delete e.mixX,delete e.mixY;for(const e of i.skins)for(const t of Object.values(e.attachments||{}))for(const s of Object.values(t||{}))s.parent!=null&&Wi(s,"deform","timelines")}function $I(i){for(const e of Object.values(i.slots||{}))Wi(e,"color","rgba"),Wi(e,"twoColor","rgba2")}function GI(i){for(const e of Object.values(i.bones||{}))for(const t of e.rotate||[])Wi(t,"angle","value")}function jI(i){for(const e of Object.values(i.transform||{}))for(const t of e)Wi(t,"rotateMix","mixRotate"),t.translateMix==null&&(t.translateMix=t.mixX??t.mixY),t.scaleMix==null&&(t.scaleMix=t.mixScaleX??t.mixScaleY),Wi(t,"shearMix","mixShearY"),delete t.mixX,delete t.mixY,delete t.mixScaleX,delete t.mixScaleY}function HI(i){for(const e of Object.values(i.path||{})){for(const t of["position","spacing"])for(const s of e[t]||[])Wi(s,t,"value");for(const t of e.mix||[])Wi(t,"rotateMix","mixRotate"),t.translateMix==null&&(t.translateMix=t.mixX??t.mixY),delete t.mixX,delete t.mixY}}function WI(i){if(!i.attachments)return;const e=i.deform||(i.deform={});for(const[t,s]of Object.entries(i.attachments)){const n=e[t]||(e[t]={});for(const[r,o]of Object.entries(s)){const a=n[r]||(n[r]={});for(const[h,l]of Object.entries(o))l.deform&&(a[h]=l.deform)}}delete i.attachments}function zI(i){i.skeleton.spine=XI,YI(i);for(const e of Object.values(i.animations))$I(e),GI(e),jI(e),HI(e),WI(e);return Pd(i.animations),i}function qI(i,e,t,s){const n=t.frame-e.frame,r=n<=0?0:(i.frame-e.frame)/n;let o=0;for(let a=0;a[...s].sort((o,a)=>o-a);let r=!0;for(;r;){r=!1;const o=n();for(let a=0;au&&(u=d,c=f)}c>=0&&(s.add(c),r=!0)}}return n().map(o=>i[o])}function gg(i,e,t,s,n){const r=t-e+1;if(r<2)return 0;const o=n?e:t,a=n?e+1:t-1,h=n?e+2:t-2,l=Math.abs(i[a].frame-i[o].frame);if(r>=3&&l>0&&Math.abs(Math.abs(i[h].frame-i[a].frame)-l)<1e-6){const u=i[o].values[s],f=i[a].values[s],d=i[h].values[s];return n?(-3*u+4*f-d)/(2*l):(3*u-4*f+d)/(2*l)}const c=i[a].frame-i[o].frame;return c?(i[a].values[s]-i[o].values[s])/c:0}function vg(i,e,t){const s=i[t].frame-i[e].frame,n=[];for(let r=0;rf.values[r])),l=Math.max(...i.slice(e,t+1).map(f=>f.values[r])),c=o+gg(i,e,t,r,!0)*s/3,u=a-gg(i,e,t,r,!1)*s/3;n.push([Math.max(h,Math.min(l,c)),Math.max(h,Math.min(l,u))])}return{values:n}}function KI(i,e,t,s,n){const r=1-n;return r*r*r*i+3*r*r*n*e+3*r*n*n*t+n*n*n*s}function ZI(i,e,t,s,n){const r=t.frame-e.frame,o=r<=0?0:(i.frame-e.frame)/r;let a=0;for(let h=0;h[...s].sort((a,h)=>a-h);let r=!0;for(;r;){r=!1;const a=n();for(let h=0;hd&&(d=g,f=m)}f>=0&&(s.add(f),r=!0)}}const o=n();return{samples:o.map(a=>i[a]),controls:o.slice(0,-1).map((a,h)=>vg(i,a,o[h+1]))}}function JI(i){if(!i.length)return[];const e=[i[0]];for(let t=1;t180;)s-=360;for(;s-e[t-1]<-180;)s+=360;e.push(s)}return e}function Zt(i){if(!Number.isFinite(i))return 0;const e=Math.round(i*1e5)/1e5;return Object.is(e,-0)?0:e}function QI(i,e,t,s){const n=Math.max(2,Math.min(16,Math.round(Number(i.trailGridRows)||2))),r=Math.max(2,Math.min(32,Math.round(Number(i.trailGridCols)||2))),o=Math.max(2,t.length),a=e.lengthMode==="random"?Math.max(1,Number(e.lengthMin)||0,Number(e.lengthMax)||0):Math.max(.001,Number(e.length)||100),h=e.widthSizeMode==="random"?Math.max(1,Number(e.widthMin)||0,Number(e.widthMax)||0):Math.max(.001,Number(e.width)||100),l=(Number(e.rotation)||0)*Math.PI/180,c=Math.cos(l),u=Math.sin(l),f=[],d=[],m=[],g=[],b=[];for(let v=0;v=0;v--)b.push({col:v,row:n-1});for(let v=n-2;v>=1;v--)b.push({col:0,row:v});const _=b.length;for(let v=1;v|\s]+/g,"_").replace(/^_+|_+$/g,"")||e}function bx(i,e){let t=i,s=2;for(;e.has(t);)t=`${i}_${s++}`;return e.add(t),t}function tR(i){return i.replace(/\.[^./\\]+$/,"")}function wx(i,e){return tR([i,e].filter(Boolean).join("/").replace(/\\/g,"/").replace(/\/{2,}/g,"/").replace(/^\.\//,""))}function iR(i){var s,n;const e=Number(((s=i==null?void 0:i.orig)==null?void 0:s.width)??(i==null?void 0:i.width))||0,t=Number(((n=i==null?void 0:i.orig)==null?void 0:n.height)??(i==null?void 0:i.height))||0;return{width:e,height:t}}function hl(i){return Math.round(Math.max(0,Math.min(1,i))*255).toString(16).padStart(2,"0")}function _g(i,e){return[(i>>16&255)/255,(i>>8&255)/255,(i&255)/255,Math.max(0,Math.min(1,e))]}function na(i,e){return Zt(i/e)}function sR(i,e){const t=i.config,s=t.lifeMode==="fixed"?Math.max(0,Number(t.lifeMin)||0):Math.max(0,Number(t.lifeMin)||0,Number(t.lifeMax)||0),n=Math.max(0,Number(t.delay)||0);let r;if(t.mode!=="stream")r=n+s;else if(t.streamBehavior!=="loop")r=n+Math.max(1/e,Number(t.duration)||0)+s;else{const o=Math.max(1,Math.ceil(Number(t.loopDurationFrames)||1))/e;t.generateLoopEndAnimation?r=n+s+1/e:t.generateLoopStartAnimation?r=n+o*Math.max(1,Math.ceil(s/o)):r=n+o}return Math.max(1,Math.ceil(r*e)+1)}function oh(i,e){return e?i.boneName:`${i.spawnId??"legacy"}_${i.boneName}`}function nR(i,e,t){const s=new Set;for(const n of i)for(const r of n)s.add(oh(r,e));return[...s].sort().map((n,r)=>({key:n,name:bx(`_particle_${String(r).padStart(3,"0")}`,t),states:i.map(o=>o.find(a=>oh(a,e)===n)||null)}))}function rR(i,e,t,s){const n=e*t/s,r=Math.min(i.states.length-1,Math.max(0,Math.floor(n))),o=Math.min(i.states.length-1,r+1),a=i.states[r],h=i.states[o];if(!a||!h||oh(a,!0)!==oh(h,!0)||a.spawnId!==h.spawnId)return a;const l=n-r;if(l<=1e-6)return a;const c=(f,d)=>(f??0)+((d??f??0)-(f??0))*l,u=a.trailState&&h.trailState&&a.trailState.resourceId===h.trailState.resourceId?{...a.trailState,width:c(a.trailState.width,h.trailState.width),alpha:c(a.trailState.alpha,h.trailState.alpha),bones:a.trailState.bones.map((f,d)=>{const m=h.trailState.bones[d]||f;return{...f,worldX:c(f.worldX??f.x,m.worldX??m.x),worldY:c(f.worldY??f.y,m.worldY??m.y),worldRotation:c(f.worldRotation??-f.rotation,m.worldRotation??-m.rotation)}})}:a.trailState;return{...a,worldX:c(a.worldX,h.worldX),worldY:c(a.worldY,h.worldY),worldRotation:c(a.worldRotation,h.worldRotation),worldScaleX:c(a.worldScaleX,h.worldScaleX),worldScaleY:c(a.worldScaleY,h.worldScaleY),alpha:c(a.alpha,h.alpha),trailState:u}}function Sg(i,e){return!i||i==="跟随导出"?e.keyframeCurve:i==="贝塞尔"?"bezier":"linear"}function $r(i,e,t,s,n,r=new Set,o=n.keyframeCurve){if(!i.length)return[];const a=o==="bezier"&&n.spineVersion!=="3.8"?xx(i,s,r):{samples:yx(i,s,r),controls:[]},h=a.samples.map(l=>{const c={time:na(l.frame,e)};return t.forEach((u,f)=>{c[u]=Zt(l.values[f])}),c});for(let l=0;l0&&n&&e.add(t-1),s&&e.add(t))}return e}function aR(i){const e=new Set;for(let t=0;t0&&n&&e.add(t-1),s&&e.add(t))}return e}function lR(i,e){var s;if(!i.shapeEnabled||!((s=i.shapeCurve)!=null&&s.length))return 1;const t=[...i.shapeCurve].sort((n,r)=>n.x-r.x);if(e<=t[0].x)return Math.max(0,t[0].y);for(let n=1;n{r!==n&&(s.push(t(r,o)),n=r)}),s}function cR(i,e,t){const s=i.imageMode==="sequence"?i.sequenceFrames[e]:void 0,n=(s==null?void 0:s.name)||i.textureName||`image_${i.id}`,r=(s==null?void 0:s.texture)||i.texture,o=iR(r);(!o.width||!o.height)&&t.push({code:"missing-image",message:`图片“${n}”缺失或尺寸不可读,已保留路径。`});const a=o.width||1,h=o.height||1;return{path:wx(i.textureFolder,n),x:Zt((.5-i.anchorX)*a),y:Zt((i.anchorY-.5)*h),width:Zt(a),height:Zt(h)}}function uR(i,e,t,s,n=s.keyframeCurve){if(!i.length)return[];const r=new Set;for(let c=1;c({frame:u,values:c})),a=1/255,h=n==="bezier"&&s.spineVersion!=="3.8"?xx(o,[a,a,a,.01],r):{samples:yx(o,[a,a,a,.01],r),controls:[]},l=h.samples.map(c=>({time:na(c.frame,t),color:`${hl(c.values[0])}${hl(c.values[1])}${hl(c.values[2])}${hl(c.values[3])}`}));if(h.controls.length)for(let c=0;c({time:na(f,n),name:u??null}));h.length&&(a.attachment=h);const l=uR(s,t,n,r,o);l.length&&(a.rgba=l)}function dR(i){var m;const e=i.settings,t=Math.max(1,Number(i.timeline.fps)||30),s=Math.max(1,Math.round(e.fps||30)),n=e.integerFrameAlignment?s:t,r=[],o=i.systems.filter(g=>g.visible!==!1),a={skeleton:{hash:"",spine:e.spineVersion,x:0,y:0,width:0,height:0,images:e.imagesPath||"./images/"},bones:[{name:"root"}],slots:[],skins:[{name:"default",attachments:{}}],animations:{}};e.omitFps||(a.skeleton.fps=s);const h=a.skins[0].attachments,l=new Set(["root"]),c=[...new Set([...i.timeline.animations.length?i.timeline.animations:["animation"],...o.map(g=>g.animation||"animation")])],u=new Map;for(const g of o){const b=Math.min(((m=g.frames)==null?void 0:m.length)||0,sR(g,t)),_=(g.frames||[]).slice(0,b);_.length||r.push({code:"empty-cache",message:`“${g.config.name}”没有可用帧缓存。`});const M=bx(eR(g.config.name,`system_${g.id}`),l);a.bones.push({name:M,parent:"root"});const v=nR(_,e.bonePool,l),S=Math.max(0,(b-1)/t),y=Math.max(1,Math.ceil(S*n)+1),I=u.get(g.animation)||[];I.push({system:g,tracks:v,targetFrames:y}),u.set(g.animation,I);for(const E of v){a.bones.push({name:E.name,parent:M});const C=new Set(g.config.imageResources.map(F=>F.blend));for(const F of C){const D=`${E.name}_image_${F}`;a.slots.push({name:D,bone:E.name,color:"ffffff00",blend:yg[F]});const N=h[D]||(h[D]={});for(const j of g.config.imageResources.filter(O=>O.blend===F)){const O=j.imageMode==="sequence"?Math.max(1,j.sequenceFrames.length):1;for(let L=0;L{var X;return((X=P==null?void 0:P.trailState)==null?void 0:X.resourceId)===F.id}))continue;const D=Math.max(2,Math.min(16,Math.round(F.boneCount||3))),N=[];for(let P=0;Pa.bones.findIndex(X=>X.name===P)),L=wx("",F.textureName||`trail_${F.id}`);(h[j]||(h[j]={}))[`trail_${F.id}`]=QI(g.config,F,O,L),F.texture||r.push({code:"missing-image",message:`拖尾图片“${F.textureName||F.id}”缺失,已保留路径。`})}const R=`${E.name}_image_`,B=`${E.name}_trail_`,k=a.slots.filter(F=>String(F.name).startsWith(R)||String(F.name).startsWith(B));k.length&&(a.slots=a.slots.filter(F=>!k.includes(F)),a.slots.push(...k.filter(F=>String(F.name).startsWith(B)),...k.filter(F=>String(F.name).startsWith(R))))}}for(const g of c){const b=u.get(g)||[],_={bones:{},slots:{}};let M=!1;for(const{system:v,tracks:S,targetFrames:y}of b)for(const I of S){const E=Array.from({length:y},(U,Y)=>rR(I,Y,t,n)),C=E.map(U=>!!(U!=null&&U.active)),R=[],B=[],k=[];E.forEach((U,Y)=>{U!=null&&U.active&&(R.push({frame:Y,values:[U.worldX??U.x,U.worldY??U.y]}),B.push(U.worldRotation??U.rotation),k.push({frame:Y,values:[U.worldScaleX??U.scaleX,U.worldScaleY??U.scaleY]}))});const F=JI(B),D=R.map((U,Y)=>({frame:U.frame,values:[F[Y]??0]})),N=oR(E),j={},O=$r(R,n,["x","y"],[xg,xg],e,N),L=$r(D,n,["value"],[wg],e,N),P=$r(k,n,["x","y"],[ll,ll],e,N);O.length&&(j.translate=O),L.length&&(j.rotate=L),P.length&&(j.scale=P),Object.keys(j).length&&(_.bones[I.name]=j,M=!0);const X=new Set(v.config.imageResources.map(U=>U.blend));for(const U of X){const Y=[],q=[];let z=16777215;for(let ae=0;aeve.id===me.resourceId):void 0,te=!!me&&C[ae]&&me.imageVisible!==!1&&(_e==null?void 0:_e.blend)===U;me&&(_e==null?void 0:_e.blend)===U&&(z=me.colorHex),Y.push(te?`image_${_e.id}_${me.imageFrameIndex??0}`:null),q.push(_g(z,te?me.alpha:0))}const H=v.config.imageResources.filter(ae=>ae.blend===U).filter(ae=>ae.independentAlpha==="curve").map(ae=>Sg(ae.alphaCurveMode,e)),Z=H.length?H.includes("bezier")?"bezier":"linear":Sg(v.config.alphaMode==="curve"?v.config.curveMode:void 0,e);Tg(_,`${I.name}_image_${U}`,Y,q,n,e,Z),Y.some(Boolean)&&(M=!0)}if(v.config.trail)for(const U of v.config.trailResources){const Y=Math.max(2,Math.min(16,Math.round(U.boneCount||3))),q=E.map(ve=>{var $;return(($=ve==null?void 0:ve.trailState)==null?void 0:$.resourceId)===U.id?ve.trailState:void 0}),z=q.find(ve=>!!ve);if(!z)continue;const ne=aR(q),H=U.widthSizeMode==="random"?Math.max(1,Number(U.widthMin)||0,Number(U.widthMax)||0):Math.max(.001,Number(U.width)||100);let Z=z;const ae=q.map(ve=>(ve&&(Z=ve),Z));for(let ve=0;ve{const Be=De==null?void 0:De.bones[Math.min(De.bones.length-1,ve)];if(!Be)return;const Ke={x:Be.worldX??Be.x,y:Be.worldY??Be.y,rotation:Be.worldRotation??-Be.rotation};$.push({frame:Ie,values:[Ke.x,Ke.y]}),W.push({frame:Ie,values:[Ke.rotation]}),J.push({frame:Ie,values:[1,Math.max(0,De.width/H)*ie]})});const ue=`${I.name}_trail_${U.id}_${ve}`,Se={},Me=$r($,n,["x","y"],[bg,bg],e,Q),Ee=$r(W,n,["value"],[wg],e,Q),de=$r(J,n,["x","y"],[ll,ll],e,Q);Me.length&&(Se.translate=Me),Ee.length&&(Se.rotate=Ee),de.length&&(Se.scale=de),Object.keys(Se).length&&(_.bones[ue]=Se)}const me=q.map(()=>`trail_${U.id}`);let _e=z.colorHex;const te=q.map(ve=>(ve&&(_e=ve.colorHex),_g(_e,ve?ve.alpha:0)));Tg(_,`${I.name}_trail_${U.id}`,me,te,n,e),M=!0}}(M||!e.excludeEmptyAnimations)&&(a.animations[g]=_)}!Object.keys(a.animations).length&&!e.excludeEmptyAnimations&&(a.animations.animation={bones:{},slots:{}});const f=e.spineVersion==="3.8"?zI(a):a,d=JSON.stringify(f,null,2);return{json:f,text:d,warnings:r,particleSystemCount:o.length,animationCount:Object.keys(f.animations).length,boneCount:f.bones.length}}function fR(i,e){const t=new Blob([i.text],{type:"application/json;charset=utf-8"}),s=URL.createObjectURL(t),n=document.createElement("a");n.href=s,n.download=/\.json$/i.test(e)?e:`${e||"SpineParticle"}.json`,n.style.display="none",document.body.appendChild(n),n.click(),n.remove(),setTimeout(()=>URL.revokeObjectURL(s),1e3)}class pR{newRegionAttachment(e,t,s,n){return new yo(t,s)}newMeshAttachment(e,t,s,n){return new Zn(t,s)}newBoundingBoxAttachment(e,t){return new Dh(t)}newPathAttachment(e,t){return new Er(t)}newPointAttachment(e,t){return new Nh(t)}newClippingAttachment(e,t){return new zn(t)}}const mR=new Set(["normal","onlyTranslation","noRotationOrReflection","noScale","noScaleOrReflection"]);function gR(i,e,t){const s=i.uvs,n=i.vertices,r=i.triangles;if(!Array.isArray(s)||!s.length||s.length%2)throw new Error(`拖尾网格“${e}”的 UV 数据无效`);if(!Array.isArray(n)||!n.length)throw new Error(`拖尾网格“${e}”缺少顶点数据`);const o=s.length/2;if(!Array.isArray(r)||r.some(c=>!Number.isInteger(c)||c<0||c>=o))throw new Error(`拖尾网格“${e}”的三角形索引越界`);const a=Number(i.hull)||0;if(!Number.isInteger(a)||a<0||a>o)throw new Error(`拖尾网格“${e}”的外轮廓数量无效`);if(Array.isArray(i.edges)&&i.edges.some(c=>!Number.isInteger(c)||c<0||c>=o*2||c%2))throw new Error(`拖尾网格“${e}”的外轮廓边索引越界`);if(n.length===s.length)return;let h=0,l=0;for(;h=t)throw new Error(`拖尾网格“${e}”引用了不存在的骨骼`);if(![m,g,b].every(Number.isFinite)||b<0)throw new Error(`拖尾网格“${e}”包含无效权重数据`);u+=b}if(Math.abs(u-1)>.001)throw new Error(`拖尾网格“${e}”的顶点权重之和不为 1`);l++}if(h!==n.length||l!==o)throw new Error(`拖尾网格“${e}”的顶点数量与 UV 不一致`)}function vR(i,e){var r,o,a,h;const t=Array.isArray(i.bones)?i.bones:[],s=new Map(t.map(l=>[String(l.name||""),l])),n=new Set;for(const l of t){if(l.inherit!=null&&!mR.has(l.inherit))throw new Error(`骨骼“${l.name||""}”的 inherit 值“${l.inherit}”不符合 Spine ${e} JSON 格式`);if(/_particle_\d+_trail_/.test(String(l.name||""))){const c=s.get(String(l.parent||""));if(!c||/_particle_\d+_trail_/.test(String(c.name||"")))throw new Error(`拖尾骨骼“${l.name||""}”必须直接挂在粒子系统骨骼下,不能组成骨骼链`)}}for(const l of Array.isArray(i.skins)?i.skins:[]){const c=(l==null?void 0:l.attachments)||{};for(const u of Object.keys(c))for(const f of Object.keys(c[u]||{})){const d=c[u][f];(d==null?void 0:d.type)==="mesh"&&(gR(d,f,t.length),((r=d.vertices)==null?void 0:r.length)!==((o=d.uvs)==null?void 0:o.length)&&n.add(u))}}for(const l of Object.values(i.animations||{}))for(const c of n){const u=(h=(a=l==null?void 0:l.slots)==null?void 0:a[c])==null?void 0:h.attachment;if(Array.isArray(u)&&u.some(f=>!(f!=null&&f.name)))throw new Error(`加权拖尾插槽“${c}”不能使用空附件,未出现或死亡阶段应将对应骨骼缩放设为 0`)}}function yR(i){var e;if(String(((e=i==null?void 0:i.skeleton)==null?void 0:e.spine)||"")!=="3.8")throw new Error("Spine 3.8 导出的版本标识必须为 3.8");for(const t of i.bones||[])if(t.inherit!=null)throw new Error(`Spine 3.8 骨骼“${t.name||""}”应使用 transform,不能使用 inherit`);for(const t of Object.values(i.animations||{})){for(const n of Object.values(t.slots||{})){if(n.rgba||n.rgba2)throw new Error("Spine 3.8 插槽颜色时间轴必须使用 color / twoColor");for(const r of n.attachment||[])if(!Object.prototype.hasOwnProperty.call(r,"name"))throw new Error("Spine 3.8 附件时间轴的隐藏帧必须显式写入 name: null")}for(const n of Object.values(t.bones||{}))for(const r of n.rotate||[])if(r.value!=null||r.angle==null)throw new Error("Spine 3.8 旋转时间轴必须使用 angle");const s=[t];for(;s.length;){const n=s.pop();if(!(!n||typeof n!="object")){if(!Array.isArray(n)&&Array.isArray(n.curve))throw new Error("Spine 3.8 不支持 4.x 数组曲线格式");s.push(...Object.values(n))}}}}function xR(i,e){var a;const t=JSON.parse(i),s=Wl((a=t==null?void 0:t.skeleton)==null?void 0:a.spine);if(!s)throw new Error(`导出版本不受支持,仅支持 Spine ${Sd()}`);if(e&&s!==e)throw new Error(`导出版本不一致:设置为 Spine ${e},JSON 标记为 Spine ${s}`);vR(t,s),s==="3.8"&&yR(t);const n=s==="3.8"?ax(JSON.parse(JSON.stringify(t))):t,o=new ih(new pR).readSkeletonData(n);if(!o.bones.length)throw new Error("导出结果缺少骨骼");return{version:s,bones:o.bones.length,slots:o.slots.length,animations:o.animations.length}}const bR={class:"panel"},wR={class:"panel-scroll"},_R={class:"group config-management"},SR={class:"caret"},TR={class:"group-body config-management-body"},MR={class:"config-toolbar"},ER=["disabled"],AR={value:""},CR=["value"],IR={class:"group"},RR={class:"caret"},PR={class:"scene-actions"},kR=["disabled"],FR={class:"group-body"},OR={class:"tree scene-tree"},BR=["onClick"],LR={class:"tlabel"},DR=["title","aria-label","onClick"],NR={viewBox:"0 0 24 24","aria-hidden":"true"},UR={key:0,class:"eye-slash",d:"M4 4l16 16"},VR=["onClick"],XR=["onClick"],YR={class:"tlabel"},$R=["title","aria-label","onClick"],GR={viewBox:"0 0 24 24","aria-hidden":"true"},jR={key:0,class:"eye-slash",d:"M4 4l16 16"},HR=["onClick"],WR=["onClick"],zR={class:"tlabel"},qR=["title","aria-label","onClick"],KR={viewBox:"0 0 24 24","aria-hidden":"true"},ZR={key:0,class:"eye-slash",d:"M4 4l16 16"},JR=["onClick"],QR=["onClick"],eP={class:"tlabel"},tP=["title","aria-label","onClick"],iP={viewBox:"0 0 24 24","aria-hidden":"true"},sP={key:0,class:"eye-slash",d:"M4 4l16 16"},nP=["onClick"],rP={key:0,class:"empty"},oP={class:"row"},aP={class:"seed-row scene-seed"},lP={class:"field-block"},hP={class:"field-block"},cP={class:"tag-editor"},uP=["onClick"],dP={class:"field-grid"},fP={class:"field-block"},pP={class:"field-block check-field"},mP={class:"field-grid"},gP={class:"compact-field"},vP={class:"compact-field"},yP={class:"field-grid"},xP={class:"compact-field"},bP={class:"compact-field"},wP={key:1,class:"field-grid"},_P={class:"compact-field"},SP={class:"compact-field"},TP={key:2,class:"field-grid"},MP={class:"compact-field"},EP={class:"compact-field"},AP={class:"field-block"},CP={key:4,class:"field-grid"},IP={class:"compact-field"},RP={class:"compact-field"},PP={class:"collider-follow-section"},kP={class:"follow-path"},FP={class:"field-block"},OP=["value"],BP={class:"field-grid"},LP={class:"compact-field"},DP={class:"compact-field"},NP={class:"follow-path"},UP={class:"field-block"},VP={class:"field-grid"},XP={class:"compact-field"},YP={class:"compact-field"},$P={class:"field-grid"},GP={class:"compact-field"},jP={class:"compact-field"},HP={class:"setting-line"},WP={class:"setting-line"},zP={class:"field-block"},qP={key:4,class:"panel-hint"},KP={class:"group"},ZP={class:"caret"},JP={class:"group-body"},QP={class:"segs"},ek={class:"segs stream-behavior-segs"},tk={key:2,class:"stream-loop-options"},ik={class:"switch-row"},sk=["checked"],nk={class:"switch-row"},rk=["checked"],ok={key:3,class:"modifier-hint stream-loop-hint"},ak={class:"group"},lk={class:"caret"},hk={class:"group-body"},ck={class:"row"},uk={class:"group"},dk={class:"caret"},fk={class:"group-body attr-body"},pk={class:"attr-axis-head"},mk={class:"axis-modes"},gk={class:"life-item"},vk={class:"switch-row"},yk={class:"life-item"},xk={class:"switch-row"},bk={class:"axis-modes life-axis"},wk={class:"life-item"},_k={class:"switch-row"},Sk={class:"group"},Tk={class:"caret"},Mk={class:"group-body"},Ek={class:"seg"},Ak={class:"row"},Ck={class:"curve-wrap"},Ik={class:"row"},Rk=["onUpdate:modelValue"],Pk=["onUpdate:modelValue"],kk={class:"row resource-color-row"},Fk=["onUpdate:modelValue"],Ok=["onUpdate:modelValue"],Bk={key:0,class:"row resource-color-picker"},Lk=["onUpdate:modelValue"],Dk=["value","onChange","onKeydown"],Nk={class:"resource-alpha-head"},Uk={class:"alpha-modes"},Vk=["onClick"],Xk=["onClick"],Yk=["onClick"],$k={class:"row"},Gk=["onUpdate:modelValue"],jk={class:"resource-alpha-curve"},Hk={class:"group"},Wk={class:"caret"},zk={class:"group-body"},qk={class:"modifier-item"},Kk={class:"switch-row modifier-switch"},Zk={key:0,class:"modifier-params"},Jk={class:"modifier-item"},Qk={class:"switch-row modifier-switch"},eF={key:0,class:"modifier-params gravity-params"},tF={class:"modifier-mode-row"},iF={class:"modifier-item"},sF={class:"switch-row modifier-switch"},nF={key:0,class:"modifier-params gravity-params"},rF={class:"modifier-mode-row"},oF={class:"modifier-item"},aF={class:"switch-row modifier-switch"},lF={key:0,class:"modifier-params"},hF={class:"row"},cF={class:"modifier-item"},uF={class:"switch-row modifier-switch"},dF={key:0,class:"modifier-params"},fF={class:"row"},pF={class:"row"},mF={class:"modifier-item"},gF={class:"switch-row modifier-switch"},vF={key:0,class:"modifier-params trail-params"},yF={class:"row"},xF=["onUpdate:modelValue"],bF={class:"row"},wF=["onUpdate:modelValue"],_F={class:"row"},SF=["onUpdate:modelValue"],TF={class:"switch-row trail-sub-switch"},MF=["onUpdate:modelValue"],EF={class:"switch-row trail-sub-switch"},AF=["onUpdate:modelValue"],CF={class:"trail-mode-head"},IF={class:"alpha-modes"},RF=["onClick"],PF=["onClick"],kF=["onClick"],FF={class:"row"},OF=["onUpdate:modelValue"],BF={key:6,class:"row trail-fixed-color"},LF=["onUpdate:modelValue"],DF=["value","onChange","onKeydown"],NF={class:"trail-mode-head"},UF={class:"alpha-modes"},VF=["onClick"],XF=["onClick"],YF=["onClick"],$F={class:"trail-grid-row"},GF={class:"modifier-item"},jF={class:"switch-row modifier-switch"},HF=["disabled"],WF={key:0,class:"modifier-params emitter-follow-params"},zF={class:"field-block"},qF=["value"],KF={key:0,value:"bone"},ZF={class:"field-block"},JF=["value"],QF={class:"field-block"},eO={class:"field-grid follow-grid"},tO={class:"compact-field"},iO={class:"compact-field"},sO={class:"field-block"},nO={key:0,class:"bone-follow-target"},rO={key:1,class:"bone-follow-missing"},oO={class:"field-block"},aO={class:"field-grid follow-grid"},lO={class:"compact-field"},hO={class:"compact-field"},cO={class:"bone-follow-transform-grid"},uO={class:"compact-field"},dO={class:"compact-field"},fO={class:"compact-field"},pO={class:"group"},mO={class:"caret"},gO={class:"group-body export-settings"},vO={class:"export-field"},yO={class:"export-field"},xO={class:"export-field"},bO={key:0,class:"export-help"},wO={class:"export-fps-row"},_O={class:"export-field export-fps-field"},SO={class:"export-checkbox"},TO={class:"export-switches"},MO={class:"switch-row export-switch"},EO={class:"switch-row export-switch"},AO={class:"switch-row export-switch export-switch-last"},CO=["disabled","title"],IO=Ws({__name:"ParticlePanel",setup(i){const e=Aa();e.settings.exportSettings=gy(e.settings.exportSettings);const t=ut(()=>e.settings.exportSettings),s=it(null),n=it(""),r=it([]),o=it(!1),a=it(""),h=it(!1),l=it(!1),c=it(""),u=it(!1);function f(T){return T==="跟随导出"?t.value.keyframeCurve==="bezier"?"bezier":"linear":T==="贝塞尔"?"bezier":"linear"}e.systems.length||e.addSystem();function d(){dx(e),h.value=!1,a.value="配置已保存到本地"}async function m(T){var V;const p=T.target,x=(V=p.files)==null?void 0:V[0];if(x){a.value="正在加载配置…",h.value=!1;try{await oC(e,x),a.value=`已加载:${x.name}`}catch(K){h.value=!0,a.value=K instanceof Error?K.message:String(K)}finally{p.value=""}}}async function g(){try{const T=await fetch(`/Preset/index.json?t=${Date.now()}`,{cache:"no-store"});if(!T.ok)throw new Error("无法读取预设列表");const p=await T.json();r.value=Array.isArray(p)?p.filter(x=>!!x&&typeof x.name=="string"&&typeof x.file=="string"):[]}catch{r.value=[]}}async function b(){const T=n.value;if(T){o.value=!0,h.value=!1,a.value="正在加载预设…";try{const p=await fetch(`/Preset/${encodeURIComponent(T)}`,{cache:"no-store"});if(!p.ok)throw new Error(`无法读取预设:${T}`);await px(e,await p.text()),a.value=`已加载预设:${T.replace(/\.json$/i,"")}`}catch(p){h.value=!0;const x=p instanceof Error?p.message:String(p);a.value=`${x},请检查预设文件命名`}finally{o.value=!1,n.value=""}}}_o(g);function _(){return new Promise(T=>requestAnimationFrame(()=>T()))}async function M(){e.timeline.playing=!1,e.timeline.frame=0,e.timeline.recorded=!1;for(const x of e.systems)x.frames=void 0;e.recalcTotalFrames(),await _(),e.timeline.playing=!0;const T=e.timeline.totalFrames/Math.max(1,e.timeline.fps)*1e3,p=performance.now()+Math.max(8e3,T*2.5+3e3);for(;!e.timeline.recorded;){if(performance.now()>p)throw new Error("重新计算动画超时,请确认页面仍在运行后重试");await new Promise(x=>setTimeout(x,50))}}async function v(){if(!l.value){l.value=!0,u.value=!1,c.value="正在重新计算粒子动画…";try{await M();const T=dR({systems:e.systems,timeline:e.timeline,settings:t.value});xR(T.text,t.value.spineVersion),fR(T,t.value.fileName);const p=T.warnings.length?`;${T.warnings.length} 条资源提示(缺图仍已导出)`:"";c.value=`已导出 Spine ${t.value.spineVersion}:${T.particleSystemCount} 个粒子系统、${T.animationCount} 个动画、${T.boneCount} 根骨骼${p}`}catch(T){u.value=!0,c.value=T instanceof Error?T.message:String(T)}finally{l.value=!1}}}const S=ut(()=>{const T=e.systems.findIndex(p=>p.id===e.activeId);return T>=0?T:0}),y=ut(()=>e.systems[S.value]||null),I=ut(()=>{var p;const T=(p=y.value)==null?void 0:p.config;return T?Math.max(1,Math.ceil(Number(T.loopDurationFrames)||1)):1}),E=ut(()=>e.activeObjectType),C=ut(()=>e.activeObjectType==="collision"&&e.colliders.find(T=>T.id===e.activeObjectId)||null),R=ut(()=>e.activeObjectType==="path"&&e.paths.find(T=>T.id===e.activeObjectId)||null),B=ut(()=>e.activeObjectType==="spine"&&e.spines.find(T=>T.id===e.activeObjectId)||null),k=ut(()=>e.activeObjectType==="particle"?e.systems.some(T=>T.id===e.activeObjectId):e.activeObjectType==="collision"?e.colliders.some(T=>T.id===e.activeObjectId):e.activeObjectType==="path"?e.paths.some(T=>T.id===e.activeObjectId):e.spines.some(T=>T.id===e.activeObjectId)),F=ut(()=>{const T=e.spines.find(p=>p.selectedBone&&p.bones.some(x=>x.name===p.selectedBone));return T?{spine:T,boneName:T.selectedBone}:null}),D=ut(()=>{var x;const T=(x=y.value)==null?void 0:x.config;if(!T||T.emitterFollowMode!=="bone")return null;const p=e.spines.find(V=>V.id===T.emitterFollowSpineId);return!p||!p.bones.some(V=>V.name===T.emitterFollowBoneName)?null:{spine:p,boneName:T.emitterFollowBoneName}});No(()=>{for(const T of e.systems)T.visible==null&&(T.visible=!0);for(const T of e.colliders)T.visible==null&&(T.visible=!0);for(const T of e.paths)T.visible==null&&(T.visible=!0);for(const T of e.spines)T.visible==null&&(T.visible=!0)}),No(()=>{if(!y.value)return;const T=Tr(y.value.config);T.lifeMode==="curve"&&(T.lifeMode="random"),T.speedMode==="curve"&&(T.speedMode="random"),T.scaleMode==="curve"&&(T.scaleMode="random"),T.initialRotationMode==="curve"&&(T.initialRotationMode="random"),T.mode==="stream"&&!(T.duration>0)&&(T.duration=1),T.streamBehavior==="loop"&&(T.emitterFollow||T.emitterFollowMode!=="none")&&ne(T)}),No(()=>{for(const T of e.systems){const p=Tr(T.config);if(p.emitterFollowMode!=="bone")continue;const x=e.spines.find(K=>K.id===p.emitterFollowSpineId);!!(x!=null&&x.bones.some(K=>K.name===p.emitterFollowBoneName))||(p.emitterFollowMode="none",p.emitterFollowSpineId=0,p.emitterFollowBoneName="")}}),No(()=>{for(const T of e.colliders)T.followPathId==null&&(T.followPathId=0),T.followDuration>0||(T.followDuration=2),T.followPathRotation==null&&(T.followPathRotation=!1),["跟随导出","线性","贝塞尔"].includes(T.followCurveMode)||(T.followCurveMode="跟随导出"),(!Array.isArray(T.followCurve)||T.followCurve.length<2)&&(T.followCurve=[{x:0,y:0},{x:1,y:1}])});const N=[{x:0,y:0},{x:1,y:1}],j=[{x:0,y:1},{x:1,y:1}],O=[{x:0,y:0},{x:.2,y:1},{x:.8,y:1},{x:1,y:0}],L=[{x:0,y:0},{x:.1,y:1},{x:.9,y:1},{x:1,y:0}],P=[{x:0,y:1},{x:1,y:1}],X=[{x:0,y:1},{x:1,y:1}],U=wo({config:!0,scene:!1,emitMode:!0,shape:!0,attr:!0,look:!0,mods:!0,export:!1});function Y(T){U[T]=!U[T]}function q(T){var x;const p=(x=y.value)==null?void 0:x.config;p&&(p.mode=T,T==="stream"&&!(p.duration>0)&&(p.duration=1))}function z(T){var V;const p=(V=y.value)==null?void 0:V.config;if(!p)return;const x=Math.min(1800,Math.max(1,Math.ceil(Number(T)||1)));p.loopDurationFrames=x}function ne(T){const p=ga();T.emitterFollow=!1,T.emitterFollowMode="none",T.emitterFollowPathId=p.emitterFollowPathId,T.emitterFollowSpineId=p.emitterFollowSpineId,T.emitterFollowBoneName=p.emitterFollowBoneName,T.emitterFollowBoneOffsetX=p.emitterFollowBoneOffsetX,T.emitterFollowBoneOffsetY=p.emitterFollowBoneOffsetY,T.emitterFollowBoneRotation=p.emitterFollowBoneRotation,T.emitterFollowBoneScaleX=p.emitterFollowBoneScaleX,T.emitterFollowBoneScaleY=p.emitterFollowBoneScaleY,T.emitterAngleMode=p.emitterAngleMode,T.emitterFollowCurve=p.emitterFollowCurve.map(x=>({...x})),T.emitterFollowDuration=p.emitterFollowDuration,T.emitterFollowSpace=p.emitterFollowSpace,T.emitterFollowDirection=p.emitterFollowDirection,T.emitterFollowOffset=p.emitterFollowOffset}function H(T){var K;const p=(K=y.value)==null?void 0:K.config;if(!p||p.streamBehavior===T)return;const x=T==="loop",V=x?"进入循环持续模式后,粒子跟随设置会失效并恢复默认值。是否继续?":"退出循环持续模式后,粒子跟随设置会失效并恢复默认值。是否继续?";window.confirm(V)&&(ne(p),p.streamBehavior=T,x||(p.generateLoopStartAnimation=!1,p.generateLoopEndAnimation=!1))}function Z(T,p){var K;const x=(K=y.value)==null?void 0:K.config;if(!x)return;const V=p.target.checked;T==="start"?(x.generateLoopStartAnimation=V,V&&(x.generateLoopEndAnimation=!1)):(x.generateLoopEndAnimation=V,V&&(x.generateLoopStartAnimation=!1))}function ae(T,p){const x=T.target.value;if(p.emitterFollowMode=x,x!=="bone"){p.emitterFollowSpineId=0,p.emitterFollowBoneName="";return}me(p)}function me(T){const p=F.value;if(!p){T.emitterFollowMode="none",T.emitterFollowSpineId=0,T.emitterFollowBoneName="";return}T.emitterFollowMode="bone",T.emitterFollowSpineId=p.spine.id,T.emitterFollowBoneName=p.boneName}const _e={emitMode:["mode","rate","streamBehavior","loopDurationFrames","generateLoopStartAnimation","generateLoopEndAnimation","burstCount","burstLoop","delay","duration"],shape:["shape","radius","rectW","rectH","direction","spread","coneAngle"],attr:["lifeMin","lifeMax","lifeMode","lifeCurve","speedMin","speedMax","speedMode","speedCurve","scaleMin","scaleMax","scaleMode","scaleAxisMode","scaleYMin","scaleYMax","scaleCurve","scaleYCurve","scaleEndRatio","initialRotationMode","initialRotationMin","initialRotationMax","initialRotationCurve","rotationSpeedMin","rotationSpeedMax","speedOverLifeEnabled","speedOverLifeMode","speedOverLifeMin","speedOverLifeMax","speedOverLifeCurve","scaleOverLifeEnabled","scaleOverLifeMode","scaleOverLifeAxisMode","scaleOverLifeMin","scaleOverLifeMax","scaleYOverLifeMin","scaleYOverLifeMax","scaleOverLifeCurve","scaleYOverLifeCurve","rotationOverLifeEnabled","rotationOverLifeMode","rotationOverLifeCurve"],look:["texture","imageResources","imageWeightVersion","alpha","alphaEnd","colorStart","colorEnd","colorOverLife","blend","alphaMode","curveMode","alphaCurve","textureName","textureFolder","alphaScale","anchorX","anchorY","independentAlpha"],mods:["noise","noiseAmt","noiseRange","noiseSpeed","useGravity","gravity","gravityMode","gravityMin","gravityMax","gravityDirection","gravityCurve","wind","windX","windY","windMode","windMin","windMax","windDirection","windCurve","forceField","forceStrength","forceRadius","forceCenterX","forceCenterY","forceFalloff","attraction","attractionCenterX","attractionCenterY","attractionRadius","attractionDuration","attractionDelay","attractionDelayMode","attractionPath","trail","trailConfigVersion","trailResources","trailResourceVersion","trailTexture","trailTextureName","trailPreviewUrl","trailColorMode","trailColor","trailColorGradient","trailAlphaMode","trailAlpha","trailAlphaCurve","trailBoneCount","trailLength","trailWidth","trailWidthMode","trailLifeLengthEnabled","trailLifeLengthCurve","trailShapeEnabled","trailShapeCurve","trailGridRows","trailGridCols","collision","pathFollow","emitterFollow","emitterFollowMode","emitterFollowPathId","emitterFollowSpineId","emitterFollowBoneName","emitterFollowBoneOffsetX","emitterFollowBoneOffsetY","emitterFollowBoneRotation","emitterFollowBoneScaleX","emitterFollowBoneScaleY","emitterAngleMode","emitterFollowCurve","emitterFollowDuration","emitterFollowSpace","emitterFollowDirection","emitterFollowOffset","damping"]};function te(T){var V;const p=(V=y.value)==null?void 0:V.config;if(T==="export"){e.settings.exportSettings=uf();return}if(!p)return;const x=ga();for(const K of _e[T])p[K]=x[K]}function ve(){t.value.fps=Math.min(240,Math.max(1,Math.round(Number(t.value.fps)||30)))}function $(T){var p;e.selectSystem(((p=e.systems[T])==null?void 0:p.id)??0)}function W(){e.addSystem()}function J(){e.addCollider()}function Q(){e.addPath()}function ie(){e.addSpine()}function ue(){e.duplicateSelectedObject()}function Se(){const T=C.value;if(!T)return;let p=T.tags.length+1,x=`Tag ${p}`;for(;T.tags.includes(x);)x=`Tag ${++p}`;T.tags.push(x),T.selectedTag=x}function Me(T,p,x=0,V=0,K=0,oe=0){return{x:T,y:p,inX:x,inY:V,outX:K,outY:oe}}function Ee(){const T=R.value;if(!(!T||!T.preset))if(T.preset==="circle"){const x=60.751328;T.points=[Me(110,0,0,-x,0,x),Me(0,110,x,0,-x,0),Me(-110,0,0,x,0,-x),Me(0,-110,-x,0,x,0)],T.closed=!0}else if(T.preset==="square")T.points=[Me(-100,-100),Me(100,-100),Me(100,100),Me(-100,100)],T.closed=!0;else{const p=T.preset==="star"?10:6;T.points=Array.from({length:p},(x,V)=>{const K=T.preset==="star"&&V%2?50:110,oe=-Math.PI*.5+V/p*Math.PI*2;return Me(Math.cos(oe)*K,Math.sin(oe)*K)}),T.closed=!0}}function de(){R.value&&(R.value.points=[])}function De(){y.value&&(y.value.config.seed=Math.floor(Math.random()*999999)+1)}function Ie(T){var x;const p=(x=y.value)==null?void 0:x.config;!p||T==="direction"||(p.speedOverLifeMode=T,T==="curve"&&p.speedOverLifeMin===p.speedOverLifeMax&&(p.speedOverLifeMin=0,p.speedOverLifeMax=1))}function Be(){var p;const T=(p=y.value)==null?void 0:p.config;!T||T.scaleOverLifeMode!=="curve"||(T.scaleOverLifeMin===T.scaleOverLifeMax&&(T.scaleOverLifeMin=0,T.scaleOverLifeMax=1),T.scaleYOverLifeMin===T.scaleYOverLifeMax&&(T.scaleYOverLifeMin=0,T.scaleYOverLifeMax=1))}function Ke(T){var x;const p=(x=y.value)==null?void 0:x.config;!p||T==="direction"||(p.scaleOverLifeMode=T,Be())}const ct={point:{direction:0,spread:360},circle:{radius:100,direction:-90,spread:0},rect:{rectW:200,rectH:100,direction:-90,spread:0},cone:{radius:100,coneAngle:90,direction:90},orbit:{}};function wt(){var x;const T=(x=y.value)==null?void 0:x.config;if(!T)return;const p=ct[T.shape];p&&Object.assign(T,p)}const dt=it(null),Mt=it(null),Ct=it(null),ai=it(null),Jt=it(null);function Zi(){var x;const T=(x=y.value)==null?void 0:x.config;if(!T)return;const p=Math.max(0,...T.trailResources.map(V=>V.id))+1;T.trailResources.push({id:p,texture:null,textureName:"trail",previewUrl:"/images/trail.png",weight:100,locked:!1,rotation:0,colorMode:"particle",color:"#ffffff",colorGradient:[{position:0,color:"#ffffff"},{position:1,color:"#ffffff"}],blend:"normal",alphaMode:"particle",alpha:1,alphaCurve:P.map(V=>({...V})),boneCount:3,trailRatio:100,lengthMode:"fixed",length:100,lengthMin:100,lengthMax:100,widthSizeMode:"fixed",width:100,widthMin:100,widthMax:100,widthMode:"particle",lifeLengthEnabled:!1,lifeLengthCurve:j.map(V=>({...V})),shapeEnabled:!1,shapeCurve:X.map(V=>({...V}))}),nt()}function xs(T){var p;Jt.value=T,(p=ai.value)==null||p.click()}function $t(T,p){var K;const x=(K=y.value)==null?void 0:K.config;if(!x)return;const V=T==="trailGridCols"?32:16;x[T]=Math.min(V,Math.max(2,Math.round(Number(p)||2)))}function re(T,p){var V;const x=(V=y.value)==null?void 0:V.config.trailResources.find(K=>K.id===T);x&&(x.boneCount=Math.min(16,Math.max(2,Math.round(Number(p)||2))))}function le(T,p){var V;const x=(V=y.value)==null?void 0:V.config.trailResources.find(K=>K.id===T);x&&(x.rotation=Math.max(-360,Math.min(360,Number(p)||0)))}async function ft(T){var pe,he;const p=T.target,x=(pe=p.files)==null?void 0:pe[0],V=(he=y.value)==null?void 0:he.config,K=V==null?void 0:V.trailResources.find(be=>be.id===Jt.value);if(!x||!K){p.value="";return}const oe=await Mn(x);K.texture=$n(await et.fromURL(oe)),K.previewUrl=oe,K.textureName=x.name.replace(/\.[^.]+$/,"")||"trail",p.value="",Jt.value=null}async function It(T){var V;const p=(V=y.value)==null?void 0:V.config,x=p==null?void 0:p.trailResources.find(K=>K.id===T);x&&(x.texture=$n(await et.fromURL("/images/trail.png")),x.previewUrl="/images/trail.png",x.textureName="trail",x.weight=100,x.locked=!1,x.rotation=0,x.boneCount=3,x.trailRatio=100,x.lengthMode="fixed",x.length=100,x.lengthMin=100,x.lengthMax=100,x.widthSizeMode="fixed",x.width=100,x.widthMin=100,x.widthMax=100,x.widthMode="particle",x.lifeLengthEnabled=!1,x.lifeLengthCurve=j.map(K=>({...K})),x.shapeEnabled=!1,x.shapeCurve=X.map(K=>({...K})),x.colorMode="particle",x.color="#ffffff",x.colorGradient=[{position:0,color:"#ffffff"},{position:1,color:"#ffffff"}],x.blend="normal",x.alphaMode="particle",x.alpha=1,x.alphaCurve=P.map(K=>({...K})),nt())}function Pt(T){var V;const p=(V=y.value)==null?void 0:V.config.trailResources;if(!p||p.length<=1)return;const x=p.findIndex(K=>K.id===T);x>=0&&p.splice(x,1),nt()}function nt(){var K;const T=(K=y.value)==null?void 0:K.config.trailResources;if(!(T!=null&&T.length))return;if(T.length===1){T[0].weight=100,T[0].locked=!1;return}const p=T.filter(oe=>oe.locked),x=T.filter(oe=>!oe.locked);let V=p.reduce((oe,pe)=>oe+Math.max(0,Number(pe.weight)||0),0);V>100&&(Qi(p,100,!0),V=100),Qi(x,100-V)}function $i(T,p){var he;const x=(he=y.value)==null?void 0:he.config.trailResources;if(!(x!=null&&x.length))return;if(x.length===1){x[0].weight=100,x[0].locked=!1;return}const V=x.find(be=>be.id===T);if(!V||V.locked)return;const K=x.filter(be=>be.id!==T&&be.locked).reduce((be,fe)=>be+Math.max(0,Number(fe.weight)||0),0),oe=Math.max(0,100-K),pe=x.filter(be=>be.id!==T&&!be.locked);V.weight=Bi(Math.min(oe,Math.max(0,Number(p)||0))),pe.length?Qi(pe,oe-V.weight,!0):V.weight=Bi(oe)}function Ji(T){var V;const p=(V=y.value)==null?void 0:V.config.trailResources;if(!p||p.length===1)return;const x=p.find(K=>K.id===T);x&&(x.locked=!x.locked)}function li(T,p){const x=p.target;T.color=En(x.value,T.color),x.value=T.color}function Gi(T,p){li(T,p),p.target.blur()}function er(){var x;const T=(x=y.value)==null?void 0:x.config;if(!T)return;const p=Math.max(0,...T.imageResources.map(V=>V.id))+1;T.imageResources.push({id:p,texture:T.texture,textureName:"star",textureFolder:"",previewUrl:"/images/star.png",imageMode:"fixed",sequencePlayback:"loop-forward",sequenceFps:30,sequenceFrames:[],weight:100,locked:!1,scale:1,anchorX:.5,anchorY:.5,colorMode:"fixed",colorStart:"#ffffff",colorEnd:"#ff4d4d",colorGradient:[{position:0,color:"#ffffff"},{position:1,color:"#ff4d4d"}],blend:"normal",independentAlpha:"off",alpha:1,alphaCurveMode:"跟随导出",alphaCurve:L.map(V=>({...V}))}),ws()}function Oi(T){var p;Ct.value=T,(p=dt.value)==null||p.click()}function Qt(T){var p;Ct.value=T,(p=Mt.value)==null||p.click()}async function Pr(T){var he,be;const p=T.target,x=(he=p.files)==null?void 0:he[0],V=(be=y.value)==null?void 0:be.config,K=V==null?void 0:V.imageResources.find(fe=>fe.id===Ct.value);if(!x||!K){p.value="";return}const oe=await Mn(x),pe=$n(await et.fromURL(oe));K.texture=pe,K.previewUrl=oe,K.textureFolder="",K.textureName=x.name.replace(/\.[^.]+$/,"")||"particle",p.value="",Ct.value=null}async function kr(T){var oe;const p=T.target,x=Array.from(p.files||[]).sort((pe,he)=>pe.name.localeCompare(he.name,void 0,{numeric:!0,sensitivity:"base"})),V=(oe=y.value)==null?void 0:oe.config,K=V==null?void 0:V.imageResources.find(pe=>pe.id===Ct.value);if(!x.length||!K){p.value="";return}K.sequenceFrames=await Promise.all(x.map(async pe=>{const he=await Mn(pe);return{name:pe.name,previewUrl:he,texture:$n(await et.fromURL(he))}})),K.imageMode="sequence",p.value="",Ct.value=null}function Mn(T){return new Promise((p,x)=>{const V=new FileReader;V.onload=()=>p(String(V.result||"")),V.onerror=()=>x(V.error),V.readAsDataURL(T)})}function Zs(T){var V;const p=(V=y.value)==null?void 0:V.config,x=p==null?void 0:p.imageResources.find(K=>K.id===T);!p||!x||(x.texture=p.texture,x.textureName="star",x.textureFolder="",x.previewUrl="/images/star.png",x.imageMode="fixed",x.sequencePlayback="loop-forward",x.sequenceFps=30,x.sequenceFrames=[],x.scale=1,x.anchorX=.5,x.anchorY=.5,x.colorMode="fixed",x.colorStart="#ffffff",x.colorEnd="#ff4d4d",x.colorGradient=[{position:0,color:"#ffffff"},{position:1,color:"#ff4d4d"}],x.blend="normal",x.independentAlpha="off",x.alpha=1,x.alphaCurveMode="跟随导出",x.alphaCurve=L.map(K=>({...K})),x.locked=!1,ws())}function En(T,p){let x=T.trim().replace(/^#/,"");return/^[0-9a-f]{3}$/i.test(x)&&(x=x.split("").map(V=>V+V).join("")),/^[0-9a-f]{6}$/i.test(x)?`#${x.toLowerCase()}`:p}function Js(T,p){const x=p.target;T.colorStart=En(x.value,T.colorStart),x.value=T.colorStart}function An(T,p){Js(T,p),p.target.blur()}function bs(T){var V;const p=(V=y.value)==null?void 0:V.config.imageResources;if(!p||p.length<=1)return;const x=p.findIndex(K=>K.id===T);x>=0&&p.splice(x,1),ws()}function Bi(T){return Math.round(T)}function Qi(T,p,x=!1){if(!T.length)return;const V=Math.max(0,Bi(p)),K=x?T.reduce((pe,he)=>pe+Math.max(0,Number(he.weight)||0),0):0;let oe=0;T.forEach((pe,he)=>{const be=he===T.length-1,fe=Bi(be?V-oe:K>0?V*Math.max(0,Number(pe.weight)||0)/K:V/T.length);pe.weight=fe,oe+=fe})}function ws(){var K;const T=(K=y.value)==null?void 0:K.config.imageResources;if(!(T!=null&&T.length))return;if(T.length===1){T[0].weight=100,T[0].locked=!1;return}const p=T.filter(oe=>oe.locked),x=T.filter(oe=>!oe.locked);let V=p.reduce((oe,pe)=>oe+Math.max(0,Number(pe.weight)||0),0);V>100&&(Qi(p,100,!0),V=100),Qi(x,100-V)}function tr(T,p){var he;const x=(he=y.value)==null?void 0:he.config.imageResources;if(!(x!=null&&x.length))return;if(x.length===1){x[0].weight=100,x[0].locked=!1;return}const V=x.find(be=>be.id===T);if(!V||V.locked)return;const K=x.filter(be=>be.id!==T&&be.locked).reduce((be,fe)=>be+Math.max(0,Number(fe.weight)||0),0),oe=Math.max(0,100-K),pe=x.filter(be=>be.id!==T&&!be.locked);if(V.weight=Bi(Math.min(oe,Math.max(0,Number(p)||0))),!pe.length){V.weight=Bi(oe);return}Qi(pe,oe-V.weight,!0)}function G(T){var V;const p=(V=y.value)==null?void 0:V.config.imageResources;if(!p||p.length===1)return;const x=p.find(K=>K.id===T);x&&(x.locked=!x.locked)}return(T,p)=>(se(),ce("div",bR,[p[362]||(p[362]=w("div",{class:"panel-header"},[w("span",null,"Spine粒子编辑器-Yeomai")],-1)),w("div",wR,[w("div",_R,[w("div",{class:"group-head",onClick:p[0]||(p[0]=x=>Y("config"))},[w("span",SR,Ye(U.config?"▸":"▾"),1),p[182]||(p[182]=w("span",null,"配置管理",-1))]),xe(w("div",TR,[w("div",MR,[w("button",{title:"保存全部编辑器配置 (Ctrl+S)",onClick:d},"保存配置"),w("button",{title:"加载本地编辑器配置",onClick:p[1]||(p[1]=x=>{var V;return(V=s.value)==null?void 0:V.click()})},"加载配置"),xe(w("select",{"onUpdate:modelValue":p[2]||(p[2]=x=>n.value=x),"aria-label":"预设列表",disabled:!r.value.length||o.value,onPointerdown:g,onFocus:g,onChange:b},[w("option",AR,Ye(r.value.length?"选择预设":"无预设文件"),1),(se(!0),ce(qe,null,Ht(r.value,x=>(se(),ce("option",{key:x.file,value:x.file},Ye(x.name),9,CR))),128))],40,ER),[[kt,n.value]]),w("input",{ref_key:"configFileInput",ref:s,hidden:"",type:"file",accept:".json,application/json",onChange:m},null,544)]),a.value?(se(),ce("div",{key:0,class:Ze(["config-message",{error:h.value}])},Ye(a.value),3)):$e("",!0)],512),[[Cn,!U.config]])]),w("div",IR,[w("div",{class:"group-head scene-head",onClick:p[3]||(p[3]=x=>Y("scene"))},[w("span",RR,Ye(U.scene?"▸":"▾"),1),p[183]||(p[183]=w("span",null,"场景对象",-1)),w("div",PR,[w("button",{class:"scene-add",title:"添加粒子系统",onClick:xt(W,["stop"])},"+粒子"),w("button",{class:"scene-add",title:"添加碰撞体",onClick:xt(J,["stop"])},"+碰撞"),w("button",{class:"scene-add",title:"添加路径",onClick:xt(Q,["stop"])},"+路径"),w("button",{class:"scene-add",title:"添加 Spine",onClick:xt(ie,["stop"])},"+Spine"),w("button",{class:"scene-add",disabled:!k.value,title:"复制当前选中的场景对象",onClick:xt(ue,["stop"])},"+Copy",8,kR)])]),xe(w("div",FR,[w("div",OR,[(se(!0),ce(qe,null,Ht(Pe(e).systems,(x,V)=>(se(),ce("div",{key:`particle-${x.id}`,class:Ze(["tree-item scene-object-item",{on:E.value==="particle"&&x.id===Pe(e).activeObjectId}]),onClick:K=>$(V)},[p[186]||(p[186]=w("span",{class:"tdot"},"●",-1)),w("span",LR,Ye(x.config.name||"ParticleSystem"+(V+1)),1),w("button",{class:Ze(["scene-object-eye",{off:x.visible===!1}]),title:x.visible===!1?"显示粒子系统":"隐藏粒子系统","aria-label":x.visible===!1?"显示粒子系统":"隐藏粒子系统",onClick:xt(K=>x.visible=x.visible===!1,["stop"])},[(se(),ce("svg",NR,[p[184]||(p[184]=w("path",{d:"M2.5 12s3.5-6 9.5-6 9.5 6 9.5 6-3.5 6-9.5 6-9.5-6-9.5-6Z"},null,-1)),p[185]||(p[185]=w("circle",{cx:"12",cy:"12",r:"2.8"},null,-1)),x.visible===!1?(se(),ce("path",UR)):$e("",!0)]))],10,DR),p[187]||(p[187]=w("span",{class:"scene-object-kind"},"粒子",-1)),w("button",{class:"scene-object-delete",title:"删除粒子系统",onClick:xt(K=>Pe(e).removeSystem(x.id),["stop"])},"✕",8,VR)],10,BR))),128)),(se(!0),ce(qe,null,Ht(Pe(e).colliders,x=>(se(),ce("div",{key:`collision-${x.id}`,class:Ze(["tree-item scene-object-item",{on:E.value==="collision"&&x.id===Pe(e).activeObjectId}]),onClick:V=>Pe(e).selectSceneObject("collision",x.id)},[p[190]||(p[190]=w("span",{class:"tdot collision-dot"},"■",-1)),w("span",YR,Ye(x.name),1),w("button",{class:Ze(["scene-object-eye",{off:x.visible===!1}]),title:x.visible===!1?"显示碰撞体":"隐藏碰撞体","aria-label":x.visible===!1?"显示碰撞体":"隐藏碰撞体",onClick:xt(V=>x.visible=x.visible===!1,["stop"])},[(se(),ce("svg",GR,[p[188]||(p[188]=w("path",{d:"M2.5 12s3.5-6 9.5-6 9.5 6 9.5 6-3.5 6-9.5 6-9.5-6-9.5-6Z"},null,-1)),p[189]||(p[189]=w("circle",{cx:"12",cy:"12",r:"2.8"},null,-1)),x.visible===!1?(se(),ce("path",jR)):$e("",!0)]))],10,$R),p[191]||(p[191]=w("span",{class:"scene-object-kind"},"碰撞",-1)),w("button",{class:"scene-object-delete",title:"删除碰撞体",onClick:xt(V=>Pe(e).removeCollider(x.id),["stop"])},"✕",8,HR)],10,XR))),128)),(se(!0),ce(qe,null,Ht(Pe(e).paths,x=>(se(),ce("div",{key:`path-${x.id}`,class:Ze(["tree-item scene-object-item",{on:E.value==="path"&&x.id===Pe(e).activeObjectId}]),onClick:V=>Pe(e).selectSceneObject("path",x.id)},[p[194]||(p[194]=w("span",{class:"tdot path-dot"},"◇",-1)),w("span",zR,Ye(x.name),1),w("button",{class:Ze(["scene-object-eye",{off:x.visible===!1}]),title:x.visible===!1?"显示路径":"隐藏路径","aria-label":x.visible===!1?"显示路径":"隐藏路径",onClick:xt(V=>x.visible=x.visible===!1,["stop"])},[(se(),ce("svg",KR,[p[192]||(p[192]=w("path",{d:"M2.5 12s3.5-6 9.5-6 9.5 6 9.5 6-3.5 6-9.5 6-9.5-6-9.5-6Z"},null,-1)),p[193]||(p[193]=w("circle",{cx:"12",cy:"12",r:"2.8"},null,-1)),x.visible===!1?(se(),ce("path",ZR)):$e("",!0)]))],10,qR),p[195]||(p[195]=w("span",{class:"scene-object-kind"},"路径",-1)),w("button",{class:"scene-object-delete",title:"删除路径",onClick:xt(V=>Pe(e).removePath(x.id),["stop"])},"✕",8,JR)],10,WR))),128)),(se(!0),ce(qe,null,Ht(Pe(e).spines,x=>(se(),ce("div",{key:`spine-${x.id}`,class:Ze(["tree-item scene-object-item",{on:E.value==="spine"&&x.id===Pe(e).activeObjectId}]),onClick:V=>Pe(e).selectSceneObject("spine",x.id)},[p[198]||(p[198]=w("span",{class:"tdot spine-dot"},"◆",-1)),w("span",eP,Ye(x.name),1),w("button",{class:Ze(["scene-object-eye",{off:x.visible===!1}]),title:x.visible===!1?"显示 Spine":"隐藏 Spine","aria-label":x.visible===!1?"显示 Spine":"隐藏 Spine",onClick:xt(V=>x.visible=x.visible===!1,["stop"])},[(se(),ce("svg",iP,[p[196]||(p[196]=w("path",{d:"M2.5 12s3.5-6 9.5-6 9.5 6 9.5 6-3.5 6-9.5 6-9.5-6-9.5-6Z"},null,-1)),p[197]||(p[197]=w("circle",{cx:"12",cy:"12",r:"2.8"},null,-1)),x.visible===!1?(se(),ce("path",sP)):$e("",!0)]))],10,tP),p[199]||(p[199]=w("span",{class:"scene-object-kind"},"Spine",-1)),w("button",{class:"scene-object-delete",title:"删除 Spine",onClick:xt(V=>Pe(e).removeSpine(x.id),["stop"])},"✕",8,nP)],10,QR))),128)),!Pe(e).systems.length&&!Pe(e).colliders.length&&!Pe(e).paths.length&&!Pe(e).spines.length?(se(),ce("div",rP,"场景中暂无对象")):$e("",!0)]),E.value==="particle"&&y.value?(se(),ce(qe,{key:0},[w("label",oP,[p[200]||(p[200]=w("span",null,"名称",-1)),xe(w("input",{"onUpdate:modelValue":p[4]||(p[4]=x=>y.value.config.name=x),class:"inp"},null,512),[[Je,y.value.config.name]])]),Ne(Ge,{label:"位置X",min:-2e3,max:2e3,step:1,modelValue:y.value.config.centerX,"onUpdate:modelValue":p[5]||(p[5]=x=>y.value.config.centerX=x)},null,8,["modelValue"]),Ne(Ge,{label:"位置Y",min:-2e3,max:2e3,step:1,modelValue:y.value.config.centerY,"onUpdate:modelValue":p[6]||(p[6]=x=>y.value.config.centerY=x)},null,8,["modelValue"]),Ne(Ge,{label:"偏移X",min:-2e3,max:2e3,step:1,modelValue:y.value.config.offsetX,"onUpdate:modelValue":p[7]||(p[7]=x=>y.value.config.offsetX=x)},null,8,["modelValue"]),Ne(Ge,{label:"偏移Y",min:-2e3,max:2e3,step:1,modelValue:y.value.config.offsetY,"onUpdate:modelValue":p[8]||(p[8]=x=>y.value.config.offsetY=x)},null,8,["modelValue"]),Ne(Ge,{label:"旋转",min:-360,max:360,step:1,modelValue:y.value.config.rootRotation,"onUpdate:modelValue":p[9]||(p[9]=x=>y.value.config.rootRotation=x)},null,8,["modelValue"]),Ne(Ge,{label:"缩放X",min:.05,max:10,step:.05,modelValue:y.value.config.rootScaleX,"onUpdate:modelValue":p[10]||(p[10]=x=>y.value.config.rootScaleX=x)},null,8,["modelValue"]),Ne(Ge,{label:"缩放Y",min:.05,max:10,step:.05,modelValue:y.value.config.rootScaleY,"onUpdate:modelValue":p[11]||(p[11]=x=>y.value.config.rootScaleY=x)},null,8,["modelValue"]),w("div",aP,[p[201]||(p[201]=w("label",{for:"system-seed"},"随机种子",-1)),xe(w("input",{id:"system-seed",class:"seed-input",type:"number",min:"0",step:"1","onUpdate:modelValue":p[12]||(p[12]=x=>y.value.config.seed=x),title:"控制粒子系统内全部随机属性、资源选择与修改器随机采样"},null,512),[[Je,y.value.config.seed,void 0,{number:!0}]]),w("button",{class:"seed-random",title:"生成新的全局随机种子",onClick:De},"⚄")]),p[202]||(p[202]=w("div",{class:"seed-hint"},"控制初始随机参数、资源选择和修改器随机采样;相同种子可复现相同效果",-1))],64)):C.value?(se(),ce(qe,{key:1},[p[229]||(p[229]=w("div",{class:"object-editor-title"},"碰撞体属性",-1)),w("label",lP,[p[203]||(p[203]=w("span",null,"碰撞体名称",-1)),xe(w("input",{"onUpdate:modelValue":p[13]||(p[13]=x=>C.value.name=x),class:"inp"},null,512),[[Je,C.value.name]])]),w("div",hP,[p[204]||(p[204]=w("span",null,"碰撞体标签",-1)),w("div",cP,[(se(!0),ce(qe,null,Ht(C.value.tags,x=>(se(),ce("button",{key:x,class:Ze(["object-tag",{on:C.value.selectedTag===x}]),onClick:V=>C.value.selectedTag=x},Ye(x),11,uP))),128)),w("button",{class:"tag-add",title:"新增标签",onClick:Se},"+")]),p[205]||(p[205]=w("small",null,"点击标签为当前碰撞体选择标签;点击+新增标签。",-1))]),w("div",dP,[w("label",fP,[p[207]||(p[207]=w("span",null,"类型",-1)),xe(w("select",{"onUpdate:modelValue":p[14]||(p[14]=x=>C.value.shape=x),class:"inp"},[...p[206]||(p[206]=[Vo('',5)])],512),[[kt,C.value.shape]])]),w("label",pP,[p[208]||(p[208]=w("span",null,"启用",-1)),xe(w("input",{"onUpdate:modelValue":p[15]||(p[15]=x=>C.value.enabled=x),type:"checkbox"},null,512),[[Lt,C.value.enabled]])])]),w("div",mP,[w("label",gP,[p[209]||(p[209]=w("span",null,"X 位置",-1)),xe(w("input",{"onUpdate:modelValue":p[16]||(p[16]=x=>C.value.x=x),type:"number",class:"inp"},null,512),[[Je,C.value.x,void 0,{number:!0}]])]),w("label",vP,[p[210]||(p[210]=w("span",null,"Y 位置",-1)),xe(w("input",{"onUpdate:modelValue":p[17]||(p[17]=x=>C.value.y=x),type:"number",class:"inp"},null,512),[[Je,C.value.y,void 0,{number:!0}]])])]),Ne(Ge,{label:"旋转",min:-360,max:360,step:1,modelValue:C.value.rotation,"onUpdate:modelValue":p[18]||(p[18]=x=>C.value.rotation=x)},null,8,["modelValue"]),w("div",yP,[w("label",xP,[p[211]||(p[211]=w("span",null,"缩放 X",-1)),xe(w("input",{"onUpdate:modelValue":p[19]||(p[19]=x=>C.value.scaleX=x),type:"number",min:"0.05",step:"0.05",class:"inp"},null,512),[[Je,C.value.scaleX,void 0,{number:!0}]])]),w("label",bP,[p[212]||(p[212]=w("span",null,"缩放 Y",-1)),xe(w("input",{"onUpdate:modelValue":p[20]||(p[20]=x=>C.value.scaleY=x),type:"number",min:"0.05",step:"0.05",class:"inp"},null,512),[[Je,C.value.scaleY,void 0,{number:!0}]])])]),C.value.shape==="circle"?(se(),Et(Ge,{key:0,label:"半径",min:1,max:1e3,step:1,modelValue:C.value.radius,"onUpdate:modelValue":p[21]||(p[21]=x=>C.value.radius=x)},null,8,["modelValue"])):C.value.shape==="ellipse"?(se(),ce("div",wP,[w("label",_P,[p[213]||(p[213]=w("span",null,"X 半径",-1)),xe(w("input",{"onUpdate:modelValue":p[22]||(p[22]=x=>C.value.radiusX=x),type:"number",min:"1",class:"inp"},null,512),[[Je,C.value.radiusX,void 0,{number:!0}]])]),w("label",SP,[p[214]||(p[214]=w("span",null,"Y 半径",-1)),xe(w("input",{"onUpdate:modelValue":p[23]||(p[23]=x=>C.value.radiusY=x),type:"number",min:"1",class:"inp"},null,512),[[Je,C.value.radiusY,void 0,{number:!0}]])])])):(se(),ce("div",TP,[w("label",MP,[p[215]||(p[215]=w("span",null,"宽度",-1)),xe(w("input",{"onUpdate:modelValue":p[24]||(p[24]=x=>C.value.width=x),type:"number",min:"1",class:"inp"},null,512),[[Je,C.value.width,void 0,{number:!0}]])]),w("label",EP,[p[216]||(p[216]=w("span",null,"高度",-1)),xe(w("input",{"onUpdate:modelValue":p[25]||(p[25]=x=>C.value.height=x),type:"number",min:"1",class:"inp"},null,512),[[Je,C.value.height,void 0,{number:!0}]])])])),C.value.shape==="polygon"||C.value.shape==="custom"?(se(),Et(Ge,{key:3,label:"边数",min:3,max:16,step:1,modelValue:C.value.sides,"onUpdate:modelValue":p[26]||(p[26]=x=>C.value.sides=x)},null,8,["modelValue"])):$e("",!0),w("label",AP,[p[218]||(p[218]=w("span",null,"碰撞响应",-1)),xe(w("select",{"onUpdate:modelValue":p[27]||(p[27]=x=>C.value.response=x),class:"inp"},[...p[217]||(p[217]=[w("option",{value:"physics"},"物理(弹跳/摩擦)",-1),w("option",{value:"pause"},"暂停(停止不动)",-1),w("option",{value:"destroy"},"消失(立即销毁)",-1)])],512),[[kt,C.value.response]])]),C.value.response==="physics"?(se(),ce("div",CP,[w("label",IP,[p[219]||(p[219]=w("span",null,"弹性 (0-1)",-1)),xe(w("input",{"onUpdate:modelValue":p[28]||(p[28]=x=>C.value.elasticity=x),type:"number",min:"0",max:"1",step:"0.01",class:"inp"},null,512),[[Je,C.value.elasticity,void 0,{number:!0}]])]),w("label",RP,[p[220]||(p[220]=w("span",null,"摩擦 (0-1)",-1)),xe(w("input",{"onUpdate:modelValue":p[29]||(p[29]=x=>C.value.friction=x),type:"number",min:"0",max:"1",step:"0.01",class:"inp"},null,512),[[Je,C.value.friction,void 0,{number:!0}]])])])):$e("",!0),w("div",PP,[w("label",kP,[xe(w("input",{"onUpdate:modelValue":p[30]||(p[30]=x=>C.value.followPath=x),type:"checkbox"},null,512),[[Lt,C.value.followPath]]),p[221]||(p[221]=Yt("跟随路径移动",-1))]),C.value.followPath?(se(),ce(qe,{key:0},[w("label",FP,[p[223]||(p[223]=w("span",null,"目标路径",-1)),xe(w("select",{"onUpdate:modelValue":p[31]||(p[31]=x=>C.value.followPathId=x),class:"inp"},[p[222]||(p[222]=w("option",{value:0},"(未选择)",-1)),(se(!0),ce(qe,null,Ht(Pe(e).paths,x=>(se(),ce("option",{key:x.id,value:x.id},Ye(x.name),9,OP))),128))],512),[[kt,C.value.followPathId,void 0,{number:!0}]])]),w("div",BP,[w("label",LP,[p[224]||(p[224]=w("span",null,"移动时长(秒)",-1)),xe(w("input",{"onUpdate:modelValue":p[32]||(p[32]=x=>C.value.followDuration=x),type:"number",min:"0.05",step:"0.05",class:"inp"},null,512),[[Je,C.value.followDuration,void 0,{number:!0}]])]),w("label",DP,[p[226]||(p[226]=w("span",null,"曲线模式",-1)),xe(w("select",{"onUpdate:modelValue":p[33]||(p[33]=x=>C.value.followCurveMode=x),class:"inp"},[...p[225]||(p[225]=[w("option",null,"跟随导出",-1),w("option",null,"线性",-1),w("option",null,"贝塞尔",-1)])],512),[[kt,C.value.followCurveMode]])])]),w("label",NP,[xe(w("input",{"onUpdate:modelValue":p[34]||(p[34]=x=>C.value.followPathRotation=x),type:"checkbox"},null,512),[[Lt,C.value.followPathRotation]]),p[227]||(p[227]=Yt("方向沿路径",-1))]),p[228]||(p[228]=w("div",{class:"collider-curve-title"},[Yt("移动进度曲线 "),w("small",null,"横轴:实时/移动时长 纵轴:路径进度(0=起点 → 1=终点)")],-1)),Ne(Is,{"model-value":C.value.followCurve||N,"default-value":N,mode:f(C.value.followCurveMode),"onUpdate:modelValue":p[35]||(p[35]=x=>C.value.followCurve=x)},null,8,["model-value","mode"])],64)):$e("",!0)])],64)):R.value?(se(),ce(qe,{key:2},[p[239]||(p[239]=w("div",{class:"object-editor-title"},"路径属性",-1)),w("label",UP,[p[230]||(p[230]=w("span",null,"路径名称",-1)),xe(w("input",{"onUpdate:modelValue":p[36]||(p[36]=x=>R.value.name=x),class:"inp"},null,512),[[Je,R.value.name]])]),w("div",VP,[w("label",XP,[p[231]||(p[231]=w("span",null,"X 位置",-1)),xe(w("input",{"onUpdate:modelValue":p[37]||(p[37]=x=>R.value.x=x),type:"number",class:"inp"},null,512),[[Je,R.value.x,void 0,{number:!0}]])]),w("label",YP,[p[232]||(p[232]=w("span",null,"Y 位置",-1)),xe(w("input",{"onUpdate:modelValue":p[38]||(p[38]=x=>R.value.y=x),type:"number",class:"inp"},null,512),[[Je,R.value.y,void 0,{number:!0}]])])]),Ne(Ge,{label:"旋转",min:-360,max:360,step:1,modelValue:R.value.rotation,"onUpdate:modelValue":p[39]||(p[39]=x=>R.value.rotation=x)},null,8,["modelValue"]),w("div",$P,[w("label",GP,[p[233]||(p[233]=w("span",null,"缩放 X",-1)),xe(w("input",{"onUpdate:modelValue":p[40]||(p[40]=x=>R.value.scaleX=x),type:"number",min:"0.05",step:"0.05",class:"inp"},null,512),[[Je,R.value.scaleX,void 0,{number:!0}]])]),w("label",jP,[p[234]||(p[234]=w("span",null,"缩放 Y",-1)),xe(w("input",{"onUpdate:modelValue":p[41]||(p[41]=x=>R.value.scaleY=x),type:"number",min:"0.05",step:"0.05",class:"inp"},null,512),[[Je,R.value.scaleY,void 0,{number:!0}]])])]),w("label",HP,[p[235]||(p[235]=w("span",null,"闭合路径",-1)),xe(w("input",{"onUpdate:modelValue":p[42]||(p[42]=x=>R.value.closed=x),type:"checkbox"},null,512),[[Lt,R.value.closed]])]),w("label",WP,[p[236]||(p[236]=w("span",null,"路径颜色",-1)),xe(w("input",{"onUpdate:modelValue":p[43]||(p[43]=x=>R.value.color=x),type:"color",class:"path-color"},null,512),[[Je,R.value.color]])]),p[240]||(p[240]=Vo('
操作说明:
  • 双击空白处/曲线:新建锚点
  • 双击锚点:删除节点
  • 双击第二下按住拖动:新建并拉出手柄
  • 拖动锚点移动位置,拖动手柄调整曲线
  • Shift+拖动手柄:两侧完全对称
  • Alt+拖动手柄:独立控制单侧
  • Ctrl+点击/框选:加选节点
  • Alt+点击/框选:减选节点
  • Alt+单击空白处:清除全部选中
  • 选中多个节点后可整体拖动
',1)),w("label",zP,[p[238]||(p[238]=w("span",null,"应用预设形状",-1)),xe(w("select",{"onUpdate:modelValue":p[44]||(p[44]=x=>R.value.preset=x),class:"inp"},[...p[237]||(p[237]=[Vo('',5)])],512),[[kt,R.value.preset]])]),w("button",{class:"path-action primary",onClick:Ee},"应用预设"),w("button",{class:"path-action",onClick:de},"清空锚点")],64)):B.value?(se(),Et(VI,{key:3,"spine-object":B.value},null,8,["spine-object"])):(se(),ce("div",qP,"使用右上角按钮创建场景对象"))],512),[[Cn,!U.scene]])]),E.value==="particle"&&y.value?(se(),ce(qe,{key:0},[w("div",KP,[w("div",{class:"group-head",onClick:p[46]||(p[46]=x=>Y("emitMode"))},[w("span",ZP,Ye(U.emitMode?"▸":"▾"),1),p[241]||(p[241]=w("span",null,"发射模式",-1)),w("button",{class:"group-reset",title:"重置发射模式参数",onClick:p[45]||(p[45]=xt(x=>te("emitMode"),["stop"]))},"重置")]),xe(w("div",JP,[w("div",QP,[w("button",{class:Ze(["seg",{on:y.value.config.mode==="stream"}]),onClick:p[47]||(p[47]=x=>q("stream"))},"持续",2),w("button",{class:Ze(["seg",{on:y.value.config.mode==="burst"}]),onClick:p[48]||(p[48]=x=>q("burst"))},"爆发",2)]),y.value.config.mode==="stream"?(se(),ce(qe,{key:0},[w("div",ek,[w("button",{class:Ze(["seg",{on:y.value.config.streamBehavior==="normal"}]),onClick:p[49]||(p[49]=x=>H("normal"))},"常规持续",2),w("button",{class:Ze(["seg",{on:y.value.config.streamBehavior==="loop"}]),onClick:p[50]||(p[50]=x=>H("loop"))},"循环持续",2)]),Ne(Ge,{label:"发射速率",min:1,max:300,step:1,modelValue:y.value.config.rate,"onUpdate:modelValue":p[51]||(p[51]=x=>y.value.config.rate=x)},null,8,["modelValue"]),y.value.config.streamBehavior==="normal"?(se(),Et(Ge,{key:0,label:"发射时长",min:1/30,max:60,step:1/30,modelValue:y.value.config.duration,"onUpdate:modelValue":p[52]||(p[52]=x=>y.value.config.duration=x)},null,8,["modelValue"])):(se(),Et(Ge,{key:1,label:"发射时长 (f)",min:1,max:1800,step:1,"model-value":I.value,"onUpdate:modelValue":z},null,8,["model-value"])),y.value.config.streamBehavior==="loop"?(se(),ce("div",tk,[w("label",ik,[w("input",{type:"checkbox",checked:y.value.config.generateLoopStartAnimation,onChange:p[53]||(p[53]=x=>Z("start",x))},null,40,sk),p[242]||(p[242]=w("span",{class:"switch-ui"},null,-1)),p[243]||(p[243]=w("span",null,"生成开始循环动画",-1))]),w("label",nk,[w("input",{type:"checkbox",checked:y.value.config.generateLoopEndAnimation,onChange:p[54]||(p[54]=x=>Z("end",x))},null,40,rk),p[244]||(p[244]=w("span",{class:"switch-ui"},null,-1)),p[245]||(p[245]=w("span",null,"生成结束循环动画",-1))])])):$e("",!0),y.value.config.streamBehavior==="loop"?(se(),ce("div",ok,"循环持续模式不支持骨骼跟随和路径跟随;进入或退出时会将粒子跟随设置恢复默认值。")):$e("",!0)],64)):(se(),Et(Ge,{key:1,label:"单次数量",min:1,max:1e3,step:1,modelValue:y.value.config.burstCount,"onUpdate:modelValue":p[55]||(p[55]=x=>y.value.config.burstCount=x)},null,8,["modelValue"])),Ne(Ge,{label:"延迟时间",min:0,max:5,step:.1,modelValue:y.value.config.delay,"onUpdate:modelValue":p[56]||(p[56]=x=>y.value.config.delay=x)},null,8,["modelValue"])],512),[[Cn,!U.emitMode]])]),w("div",ak,[w("div",{class:"group-head",onClick:p[58]||(p[58]=x=>Y("shape"))},[w("span",lk,Ye(U.shape?"▸":"▾"),1),p[246]||(p[246]=w("span",null,"发射器形状",-1)),w("button",{class:"group-reset",title:"重置发射器形状参数",onClick:p[57]||(p[57]=xt(x=>te("shape"),["stop"]))},"重置")]),xe(w("div",hk,[w("label",ck,[p[248]||(p[248]=w("span",null,"形状",-1)),xe(w("select",{"onUpdate:modelValue":p[59]||(p[59]=x=>y.value.config.shape=x),class:"inp",onChange:wt},[...p[247]||(p[247]=[Vo('',5)])],544),[[kt,y.value.config.shape]])]),y.value.config.shape==="circle"||y.value.config.shape==="cone"?(se(),Et(Ge,{key:0,label:"半径",min:0,max:300,step:1,modelValue:y.value.config.radius,"onUpdate:modelValue":p[60]||(p[60]=x=>y.value.config.radius=x)},null,8,["modelValue"])):$e("",!0),y.value.config.shape==="cone"?(se(),Et(Ge,{key:1,label:"锥形开口角度",min:1,max:360,step:1,modelValue:y.value.config.coneAngle,"onUpdate:modelValue":p[61]||(p[61]=x=>y.value.config.coneAngle=x)},null,8,["modelValue"])):y.value.config.shape==="rect"?(se(),ce(qe,{key:2},[Ne(Ge,{label:"宽",min:1,max:400,step:1,modelValue:y.value.config.rectW,"onUpdate:modelValue":p[62]||(p[62]=x=>y.value.config.rectW=x)},null,8,["modelValue"]),Ne(Ge,{label:"高",min:1,max:400,step:1,modelValue:y.value.config.rectH,"onUpdate:modelValue":p[63]||(p[63]=x=>y.value.config.rectH=x)},null,8,["modelValue"])],64)):$e("",!0),p[249]||(p[249]=w("div",{class:"divider"},null,-1)),Ne(Ge,{label:y.value.config.shape==="cone"?"锥形朝向":"发射角度",min:-360,max:360,step:1,modelValue:y.value.config.direction,"onUpdate:modelValue":p[64]||(p[64]=x=>y.value.config.direction=x)},null,8,["label","modelValue"]),y.value.config.shape!=="cone"?(se(),Et(Ge,{key:3,label:"扩散角度",min:0,max:360,step:1,modelValue:y.value.config.spread,"onUpdate:modelValue":p[65]||(p[65]=x=>y.value.config.spread=x)},null,8,["modelValue"])):$e("",!0)],512),[[Cn,!U.shape]])]),w("div",uk,[w("div",{class:"group-head",onClick:p[67]||(p[67]=x=>Y("attr"))},[w("span",dk,Ye(U.attr?"▸":"▾"),1),p[250]||(p[250]=w("span",null,"粒子属性",-1)),w("button",{class:"group-reset",title:"重置粒子属性参数",onClick:p[66]||(p[66]=xt(x=>te("attr"),["stop"]))},"重置")]),xe(w("div",fk,[p[258]||(p[258]=w("div",{class:"attr-section-title"},"粒子初始参数",-1)),Ne(nn,{label:"初始生命周期","allow-curve":!1,mode:y.value.config.lifeMode,"onUpdate:mode":p[68]||(p[68]=x=>y.value.config.lifeMode=x),"value-min":y.value.config.lifeMin,"onUpdate:valueMin":p[69]||(p[69]=x=>y.value.config.lifeMin=x),"value-max":y.value.config.lifeMax,"onUpdate:valueMax":p[70]||(p[70]=x=>y.value.config.lifeMax=x),curve:y.value.config.lifeCurve,"onUpdate:curve":p[71]||(p[71]=x=>y.value.config.lifeCurve=x),min:.1,max:10,step:.1,"curve-label":"随机采样 →"},null,8,["mode","value-min","value-max","curve"]),Ne(nn,{label:"初始速度","allow-curve":!1,mode:y.value.config.speedMode,"onUpdate:mode":p[72]||(p[72]=x=>y.value.config.speedMode=x),"value-min":y.value.config.speedMin,"onUpdate:valueMin":p[73]||(p[73]=x=>y.value.config.speedMin=x),"value-max":y.value.config.speedMax,"onUpdate:valueMax":p[74]||(p[74]=x=>y.value.config.speedMax=x),curve:y.value.config.speedCurve,"onUpdate:curve":p[75]||(p[75]=x=>y.value.config.speedCurve=x),min:0,max:1e3,step:1,"curve-label":"随机采样 →"},null,8,["mode","value-min","value-max","curve"]),w("div",pk,[p[251]||(p[251]=w("span",null,"初始缩放",-1)),w("div",mk,[w("button",{class:Ze(["axis-mode",{on:y.value.config.scaleAxisMode==="uniform"}]),onClick:p[76]||(p[76]=x=>y.value.config.scaleAxisMode="uniform")},"统一",2),w("button",{class:Ze(["axis-mode",{on:y.value.config.scaleAxisMode==="separate"}]),onClick:p[77]||(p[77]=x=>y.value.config.scaleAxisMode="separate")},"XY分离",2)])]),Ne(nn,{label:y.value.config.scaleAxisMode==="uniform"?"初始缩放":"缩放 X","allow-curve":!1,mode:y.value.config.scaleMode,"onUpdate:mode":p[78]||(p[78]=x=>y.value.config.scaleMode=x),"value-min":y.value.config.scaleMin,"onUpdate:valueMin":p[79]||(p[79]=x=>y.value.config.scaleMin=x),"value-max":y.value.config.scaleMax,"onUpdate:valueMax":p[80]||(p[80]=x=>y.value.config.scaleMax=x),curve:y.value.config.scaleCurve,"onUpdate:curve":p[81]||(p[81]=x=>y.value.config.scaleCurve=x),min:0,max:5,step:.05,"curve-label":"随机采样 →"},null,8,["label","mode","value-min","value-max","curve"]),y.value.config.scaleAxisMode==="separate"?(se(),Et(nn,{key:0,label:"缩放 Y","show-modes":!1,"allow-curve":!1,mode:y.value.config.scaleMode,"onUpdate:mode":p[82]||(p[82]=x=>y.value.config.scaleMode=x),"value-min":y.value.config.scaleYMin,"onUpdate:valueMin":p[83]||(p[83]=x=>y.value.config.scaleYMin=x),"value-max":y.value.config.scaleYMax,"onUpdate:valueMax":p[84]||(p[84]=x=>y.value.config.scaleYMax=x),curve:y.value.config.scaleYCurve,"onUpdate:curve":p[85]||(p[85]=x=>y.value.config.scaleYCurve=x),min:0,max:5,step:.05,"curve-label":"随机采样 →"},null,8,["mode","value-min","value-max","curve"])):$e("",!0),Ne(nn,{label:"初始旋转","allow-direction":"","allow-curve":!1,mode:y.value.config.initialRotationMode,"onUpdate:mode":p[86]||(p[86]=x=>y.value.config.initialRotationMode=x),"value-min":y.value.config.initialRotationMin,"onUpdate:valueMin":p[87]||(p[87]=x=>y.value.config.initialRotationMin=x),"value-max":y.value.config.initialRotationMax,"onUpdate:valueMax":p[88]||(p[88]=x=>y.value.config.initialRotationMax=x),curve:y.value.config.initialRotationCurve,"onUpdate:curve":p[89]||(p[89]=x=>y.value.config.initialRotationCurve=x),min:-360,max:360,step:1,"curve-label":"随机采样 →"},null,8,["mode","value-min","value-max","curve"]),p[259]||(p[259]=w("div",{class:"attr-section-title life-title"},"粒子生命周期变化参数",-1)),w("div",gk,[w("label",vk,[xe(w("input",{type:"checkbox","onUpdate:modelValue":p[90]||(p[90]=x=>y.value.config.speedOverLifeEnabled=x)},null,512),[[Lt,y.value.config.speedOverLifeEnabled]]),p[252]||(p[252]=w("span",{class:"switch-ui"},null,-1)),p[253]||(p[253]=w("span",null,"生命周期内速度",-1))]),y.value.config.speedOverLifeEnabled?(se(),Et(nn,{key:0,label:"速度倍率",mode:y.value.config.speedOverLifeMode,"onUpdate:mode":Ie,"value-min":y.value.config.speedOverLifeMin,"onUpdate:valueMin":p[91]||(p[91]=x=>y.value.config.speedOverLifeMin=x),"value-max":y.value.config.speedOverLifeMax,"onUpdate:valueMax":p[92]||(p[92]=x=>y.value.config.speedOverLifeMax=x),curve:y.value.config.speedOverLifeCurve,"onUpdate:curve":p[93]||(p[93]=x=>y.value.config.speedOverLifeCurve=x),"default-curve":j,min:0,max:3,step:.05,"curve-label":"生命周期 →"},null,8,["mode","value-min","value-max","curve"])):$e("",!0)]),w("div",yk,[w("label",xk,[xe(w("input",{type:"checkbox","onUpdate:modelValue":p[94]||(p[94]=x=>y.value.config.scaleOverLifeEnabled=x),onChange:Be},null,544),[[Lt,y.value.config.scaleOverLifeEnabled]]),p[254]||(p[254]=w("span",{class:"switch-ui"},null,-1)),p[255]||(p[255]=w("span",null,"生命周期内缩放",-1))]),y.value.config.scaleOverLifeEnabled?(se(),ce(qe,{key:0},[w("div",bk,[w("button",{class:Ze(["axis-mode",{on:y.value.config.scaleOverLifeAxisMode==="uniform"}]),onClick:p[95]||(p[95]=x=>y.value.config.scaleOverLifeAxisMode="uniform")},"统一",2),w("button",{class:Ze(["axis-mode",{on:y.value.config.scaleOverLifeAxisMode==="separate"}]),onClick:p[96]||(p[96]=x=>y.value.config.scaleOverLifeAxisMode="separate")},"XY分离",2)]),Ne(nn,{label:y.value.config.scaleOverLifeAxisMode==="uniform"?"缩放倍率":"倍率 X",mode:y.value.config.scaleOverLifeMode,"onUpdate:mode":Ke,"value-min":y.value.config.scaleOverLifeMin,"onUpdate:valueMin":p[97]||(p[97]=x=>y.value.config.scaleOverLifeMin=x),"value-max":y.value.config.scaleOverLifeMax,"onUpdate:valueMax":p[98]||(p[98]=x=>y.value.config.scaleOverLifeMax=x),curve:y.value.config.scaleOverLifeCurve,"onUpdate:curve":p[99]||(p[99]=x=>y.value.config.scaleOverLifeCurve=x),"default-curve":j,min:0,max:3,step:.05,"curve-label":"生命周期 →"},null,8,["label","mode","value-min","value-max","curve"]),y.value.config.scaleOverLifeAxisMode==="separate"?(se(),Et(nn,{key:0,label:"倍率 Y","show-modes":!1,mode:y.value.config.scaleOverLifeMode,"onUpdate:mode":p[100]||(p[100]=x=>y.value.config.scaleOverLifeMode=x),"value-min":y.value.config.scaleYOverLifeMin,"onUpdate:valueMin":p[101]||(p[101]=x=>y.value.config.scaleYOverLifeMin=x),"value-max":y.value.config.scaleYOverLifeMax,"onUpdate:valueMax":p[102]||(p[102]=x=>y.value.config.scaleYOverLifeMax=x),curve:y.value.config.scaleYOverLifeCurve,"onUpdate:curve":p[103]||(p[103]=x=>y.value.config.scaleYOverLifeCurve=x),"default-curve":j,min:0,max:3,step:.05,"curve-label":"生命周期 →"},null,8,["mode","value-min","value-max","curve"])):$e("",!0)],64)):$e("",!0)]),w("div",wk,[w("label",_k,[xe(w("input",{type:"checkbox","onUpdate:modelValue":p[104]||(p[104]=x=>y.value.config.rotationOverLifeEnabled=x)},null,512),[[Lt,y.value.config.rotationOverLifeEnabled]]),p[256]||(p[256]=w("span",{class:"switch-ui"},null,-1)),p[257]||(p[257]=w("span",null,"生命周期内旋转",-1))]),y.value.config.rotationOverLifeEnabled?(se(),Et(nn,{key:0,label:"旋转速度",mode:y.value.config.rotationOverLifeMode,"onUpdate:mode":p[105]||(p[105]=x=>y.value.config.rotationOverLifeMode=x),"value-min":y.value.config.rotationSpeedMin,"onUpdate:valueMin":p[106]||(p[106]=x=>y.value.config.rotationSpeedMin=x),"value-max":y.value.config.rotationSpeedMax,"onUpdate:valueMax":p[107]||(p[107]=x=>y.value.config.rotationSpeedMax=x),curve:y.value.config.rotationOverLifeCurve,"onUpdate:curve":p[108]||(p[108]=x=>y.value.config.rotationOverLifeCurve=x),"default-curve":N,min:-720,max:720,step:10,"curve-label":"生命周期 →"},null,8,["mode","value-min","value-max","curve"])):$e("",!0)])],512),[[Cn,!U.attr]])]),w("div",Sk,[w("div",{class:"group-head",onClick:p[110]||(p[110]=x=>Y("look"))},[w("span",Tk,Ye(U.look?"▸":"▾"),1),p[260]||(p[260]=w("span",null,"外观与资源",-1)),w("button",{class:"group-reset",title:"重置外观与资源参数",onClick:p[109]||(p[109]=xt(x=>te("look"),["stop"]))},"重置")]),xe(w("div",Mk,[p[274]||(p[274]=w("div",{class:"look-title"},"透明度",-1)),w("div",Ek,[w("button",{class:Ze(["seg-btn",{active:y.value.config.alphaMode==="curve"}]),onClick:p[111]||(p[111]=x=>y.value.config.alphaMode="curve")},"曲线",2),w("button",{class:Ze(["seg-btn",{active:y.value.config.alphaMode==="fixed"}]),onClick:p[112]||(p[112]=x=>y.value.config.alphaMode="fixed")},"固定",2)]),y.value.config.alphaMode==="fixed"?(se(),Et(Ge,{key:0,label:"透明度",min:0,max:1,step:.01,modelValue:y.value.config.alpha,"onUpdate:modelValue":p[113]||(p[113]=x=>y.value.config.alpha=x)},null,8,["modelValue"])):(se(),ce(qe,{key:1},[w("label",Ak,[p[262]||(p[262]=w("span",null,"曲线模式",-1)),xe(w("select",{"onUpdate:modelValue":p[114]||(p[114]=x=>y.value.config.curveMode=x),class:"inp"},[...p[261]||(p[261]=[w("option",null,"跟随导出",-1),w("option",null,"线性",-1),w("option",null,"贝塞尔",-1)])],512),[[kt,y.value.config.curveMode]])]),w("div",Ck,[Ne(Is,{modelValue:y.value.config.alphaCurve,"onUpdate:modelValue":p[115]||(p[115]=x=>y.value.config.alphaCurve=x),"default-value":O,mode:f(y.value.config.curveMode)},null,8,["modelValue","mode"]),p[263]||(p[263]=w("div",{class:"curve-labels"},[w("span",null,"0(透明)"),w("span",null,"生命周期 →"),w("span",null,"1(不透明)")],-1))])],64)),w("div",{class:"look-title image-title"},[p[264]||(p[264]=w("span",null,"图片资源",-1)),w("button",{class:"image-add",title:"新增图片资源",onClick:er},"+")]),(se(!0),ce(qe,null,Ht(y.value.config.imageResources,x=>(se(),Et(mg,{key:x.id,resource:x,"resource-count":y.value.config.imageResources.length,"supports-sequence":"","default-file":"star.png",onPick:Oi,onPickSequence:Qt,onReset:Zs,onRemove:bs,onUpdateWeight:tr,onToggleLock:G},{default:Fu(()=>[Ne(Ge,{label:"缩放",min:.1,max:3,step:.05,modelValue:x.scale,"onUpdate:modelValue":V=>x.scale=V},null,8,["modelValue","onUpdate:modelValue"]),w("label",Ik,[p[265]||(p[265]=w("span",null,"轴心 x,y",-1)),xe(w("input",{type:"number",step:"0.05",class:"inp tiny","onUpdate:modelValue":V=>x.anchorX=V},null,8,Rk),[[Je,x.anchorX,void 0,{number:!0}]]),xe(w("input",{type:"number",step:"0.05",class:"inp tiny","onUpdate:modelValue":V=>x.anchorY=V},null,8,Pk),[[Je,x.anchorY,void 0,{number:!0}]])]),p[273]||(p[273]=w("div",{class:"resource-divider"},null,-1)),w("label",kk,[p[268]||(p[268]=w("span",null,"颜色",-1)),xe(w("select",{"onUpdate:modelValue":V=>x.colorMode=V,class:"inp"},[...p[266]||(p[266]=[w("option",{value:"fixed"},"固定色",-1),w("option",{value:"lifetime"},"生命周期",-1)])],8,Fk),[[kt,x.colorMode]]),xe(w("select",{"onUpdate:modelValue":V=>x.blend=V,class:"inp blend-select"},[...p[267]||(p[267]=[w("option",{value:"normal"},"正常",-1),w("option",{value:"add"},"相加",-1),w("option",{value:"multiply"},"相乘",-1),w("option",{value:"screen"},"滤色",-1)])],8,Ok),[[kt,x.blend]])]),x.colorMode==="fixed"?(se(),ce("label",Bk,[p[269]||(p[269]=w("span",null,"固定色",-1)),xe(w("input",{type:"color","onUpdate:modelValue":V=>x.colorStart=V,class:"colr"},null,8,Lk),[[Je,x.colorStart]]),w("input",{type:"text",class:"hex-input",value:x.colorStart,spellcheck:"false","aria-label":"固定颜色值",onChange:V=>Js(x,V),onKeydown:da(V=>An(x,V),["enter"])},null,40,Dk)])):(se(),Et(pg,{key:1,modelValue:x.colorGradient,"onUpdate:modelValue":V=>x.colorGradient=V},null,8,["modelValue","onUpdate:modelValue"])),w("div",Nk,[p[270]||(p[270]=w("span",null,"独立透明度",-1)),w("div",Uk,[w("button",{class:Ze({on:x.independentAlpha==="off"}),onClick:V=>x.independentAlpha="off"},"关闭",10,Vk),w("button",{class:Ze({on:x.independentAlpha==="fixed"}),onClick:V=>x.independentAlpha="fixed"},"固定",10,Xk),w("button",{class:Ze({on:x.independentAlpha==="curve"}),onClick:V=>x.independentAlpha="curve"},"曲线",10,Yk)])]),x.independentAlpha==="fixed"?(se(),Et(Ge,{key:2,label:"透明度",min:0,max:1,step:.01,modelValue:x.alpha,"onUpdate:modelValue":V=>x.alpha=V},null,8,["modelValue","onUpdate:modelValue"])):x.independentAlpha==="curve"?(se(),ce(qe,{key:3},[w("label",$k,[p[272]||(p[272]=w("span",null,"曲线模式",-1)),xe(w("select",{"onUpdate:modelValue":V=>x.alphaCurveMode=V,class:"inp"},[...p[271]||(p[271]=[w("option",null,"跟随导出",-1),w("option",null,"线性",-1),w("option",null,"贝塞尔",-1)])],8,Gk),[[kt,x.alphaCurveMode]])]),w("div",jk,[Ne(Is,{modelValue:x.alphaCurve,"onUpdate:modelValue":V=>x.alphaCurve=V,"default-value":L,mode:f(x.alphaCurveMode)},null,8,["modelValue","onUpdate:modelValue","mode"])])],64)):$e("",!0)]),_:2},1032,["resource","resource-count"]))),128)),w("input",{ref_key:"textureFileInput",ref:dt,class:"file-input",type:"file",accept:"image/png,image/jpeg,image/webp,image/gif",onChange:Pr},null,544),w("input",{ref_key:"sequenceFileInput",ref:Mt,class:"file-input",type:"file",multiple:"",accept:"image/png,image/jpeg,image/webp,image/gif",onChange:kr},null,544)],512),[[Cn,!U.look]])]),w("div",Hk,[w("div",{class:"group-head",onClick:p[117]||(p[117]=x=>Y("mods"))},[w("span",Wk,Ye(U.mods?"▸":"▾"),1),p[275]||(p[275]=w("span",null,"修改器",-1)),w("button",{class:"group-reset",title:"重置修改器参数",onClick:p[116]||(p[116]=xt(x=>te("mods"),["stop"]))},"重置")]),xe(w("div",zk,[w("div",qk,[w("label",Kk,[xe(w("input",{type:"checkbox","onUpdate:modelValue":p[118]||(p[118]=x=>y.value.config.noise=x)},null,512),[[Lt,y.value.config.noise]]),p[276]||(p[276]=w("span",{class:"switch-ui"},null,-1)),p[277]||(p[277]=w("span",null,"开启移动噪声",-1))]),y.value.config.noise?(se(),ce("div",Zk,[Ne(Ge,{label:"强度",min:0,max:100,step:1,modelValue:y.value.config.noiseAmt,"onUpdate:modelValue":p[119]||(p[119]=x=>y.value.config.noiseAmt=x)},null,8,["modelValue"]),Ne(Ge,{label:"波动范围",min:0,max:500,step:1,modelValue:y.value.config.noiseRange,"onUpdate:modelValue":p[120]||(p[120]=x=>y.value.config.noiseRange=x)},null,8,["modelValue"]),Ne(Ge,{label:"时间流速",min:0,max:10,step:.1,modelValue:y.value.config.noiseSpeed,"onUpdate:modelValue":p[121]||(p[121]=x=>y.value.config.noiseSpeed=x)},null,8,["modelValue"]),p[278]||(p[278]=w("div",{class:"modifier-hint"},"强度控制影响比例 · 波动范围控制最大偏移 · 时间流速控制变化速度",-1))])):$e("",!0)]),w("div",Jk,[w("label",Qk,[xe(w("input",{type:"checkbox","onUpdate:modelValue":p[122]||(p[122]=x=>y.value.config.useGravity=x)},null,512),[[Lt,y.value.config.useGravity]]),p[279]||(p[279]=w("span",{class:"switch-ui"},null,-1)),p[280]||(p[280]=w("span",null,"开启重力",-1))]),y.value.config.useGravity?(se(),ce("div",eF,[w("div",tF,[w("button",{class:Ze(["axis-mode",{on:y.value.config.gravityMode==="fixed"}]),onClick:p[123]||(p[123]=x=>y.value.config.gravityMode="fixed")},"固定",2),w("button",{class:Ze(["axis-mode",{on:y.value.config.gravityMode==="random"}]),onClick:p[124]||(p[124]=x=>y.value.config.gravityMode="random")},"随机",2)]),y.value.config.gravityMode==="fixed"?(se(),Et(Ge,{key:0,label:"重力强度",min:-3e3,max:3e3,step:10,modelValue:y.value.config.gravityMin,"onUpdate:modelValue":p[125]||(p[125]=x=>y.value.config.gravityMin=x)},null,8,["modelValue"])):(se(),ce(qe,{key:1},[Ne(Ge,{label:"强度 min",min:-3e3,max:3e3,step:10,modelValue:y.value.config.gravityMin,"onUpdate:modelValue":p[126]||(p[126]=x=>y.value.config.gravityMin=x)},null,8,["modelValue"]),Ne(Ge,{label:"强度 max",min:-3e3,max:3e3,step:10,modelValue:y.value.config.gravityMax,"onUpdate:modelValue":p[127]||(p[127]=x=>y.value.config.gravityMax=x)},null,8,["modelValue"])],64)),Ne(Ge,{label:"方向",min:-360,max:360,step:1,modelValue:y.value.config.gravityDirection,"onUpdate:modelValue":p[128]||(p[128]=x=>y.value.config.gravityDirection=x)},null,8,["modelValue"]),p[281]||(p[281]=w("div",{class:"gravity-curve-title"},[w("span",null,"生命周期内重力"),w("span",null,"纵轴:强度 0~1")],-1)),Ne(Is,{modelValue:y.value.config.gravityCurve,"onUpdate:modelValue":p[129]||(p[129]=x=>y.value.config.gravityCurve=x),"default-value":j},null,8,["modelValue"]),p[282]||(p[282]=w("div",{class:"gravity-curve-axis"},[w("span",null,"0"),w("span",null,"生命周期 →"),w("span",null,"1")],-1)),p[283]||(p[283]=w("div",{class:"modifier-hint"},"0° 向右 · -90° 向下 · 负强度会反转方向",-1))])):$e("",!0)]),w("div",iF,[w("label",sF,[xe(w("input",{type:"checkbox","onUpdate:modelValue":p[130]||(p[130]=x=>y.value.config.wind=x)},null,512),[[Lt,y.value.config.wind]]),p[284]||(p[284]=w("span",{class:"switch-ui"},null,-1)),p[285]||(p[285]=w("span",null,"开启风力",-1))]),y.value.config.wind?(se(),ce("div",nF,[w("div",rF,[w("button",{class:Ze(["axis-mode",{on:y.value.config.windMode==="fixed"}]),onClick:p[131]||(p[131]=x=>y.value.config.windMode="fixed")},"固定",2),w("button",{class:Ze(["axis-mode",{on:y.value.config.windMode==="random"}]),onClick:p[132]||(p[132]=x=>y.value.config.windMode="random")},"随机",2)]),y.value.config.windMode==="fixed"?(se(),Et(Ge,{key:0,label:"风力强度",min:-3e3,max:3e3,step:10,modelValue:y.value.config.windMin,"onUpdate:modelValue":p[133]||(p[133]=x=>y.value.config.windMin=x)},null,8,["modelValue"])):(se(),ce(qe,{key:1},[Ne(Ge,{label:"强度 min",min:-3e3,max:3e3,step:10,modelValue:y.value.config.windMin,"onUpdate:modelValue":p[134]||(p[134]=x=>y.value.config.windMin=x)},null,8,["modelValue"]),Ne(Ge,{label:"强度 max",min:-3e3,max:3e3,step:10,modelValue:y.value.config.windMax,"onUpdate:modelValue":p[135]||(p[135]=x=>y.value.config.windMax=x)},null,8,["modelValue"])],64)),Ne(Ge,{label:"方向",min:-360,max:360,step:1,modelValue:y.value.config.windDirection,"onUpdate:modelValue":p[136]||(p[136]=x=>y.value.config.windDirection=x)},null,8,["modelValue"]),p[286]||(p[286]=w("div",{class:"gravity-curve-title"},[w("span",null,"生命周期内风力"),w("span",null,"纵轴:强度 0~1")],-1)),Ne(Is,{modelValue:y.value.config.windCurve,"onUpdate:modelValue":p[137]||(p[137]=x=>y.value.config.windCurve=x),"default-value":j},null,8,["modelValue"]),p[287]||(p[287]=w("div",{class:"gravity-curve-axis"},[w("span",null,"0"),w("span",null,"生命周期 →"),w("span",null,"1")],-1)),p[288]||(p[288]=w("div",{class:"modifier-hint"},"0° 向右 · -90° 向下 · 负强度会反转方向",-1))])):$e("",!0)]),w("div",oF,[w("label",aF,[xe(w("input",{type:"checkbox","onUpdate:modelValue":p[138]||(p[138]=x=>y.value.config.forceField=x)},null,512),[[Lt,y.value.config.forceField]]),p[289]||(p[289]=w("span",{class:"switch-ui"},null,-1)),p[290]||(p[290]=w("span",null,"开启力场",-1))]),y.value.config.forceField?(se(),ce("div",lF,[Ne(Ge,{label:"中心 X",min:-5e3,max:5e3,step:1,modelValue:y.value.config.forceCenterX,"onUpdate:modelValue":p[139]||(p[139]=x=>y.value.config.forceCenterX=x)},null,8,["modelValue"]),Ne(Ge,{label:"中心 Y",min:-5e3,max:5e3,step:1,modelValue:y.value.config.forceCenterY,"onUpdate:modelValue":p[140]||(p[140]=x=>y.value.config.forceCenterY=x)},null,8,["modelValue"]),Ne(Ge,{label:"力场强度",min:-300,max:300,step:1,modelValue:y.value.config.forceStrength,"onUpdate:modelValue":p[141]||(p[141]=x=>y.value.config.forceStrength=x)},null,8,["modelValue"]),Ne(Ge,{label:"力场半径",min:1,max:2e3,step:1,modelValue:y.value.config.forceRadius,"onUpdate:modelValue":p[142]||(p[142]=x=>y.value.config.forceRadius=x)},null,8,["modelValue"]),w("label",hF,[p[292]||(p[292]=w("span",null,"衰减模式",-1)),xe(w("select",{"onUpdate:modelValue":p[143]||(p[143]=x=>y.value.config.forceFalloff=x),class:"inp"},[...p[291]||(p[291]=[w("option",{value:"constant"},"恒定(范围内力度不变)",-1),w("option",{value:"linear"},"线性衰减(边缘为 0)",-1),w("option",{value:"inverse"},"距离反比(中心最强)",-1)])],512),[[kt,y.value.config.forceFalloff]])]),p[293]||(p[293]=w("div",{class:"modifier-hint"},"正数吸向中心 · 负数向外排斥 · 可在画布内拖动力场圆",-1))])):$e("",!0)]),w("div",cF,[w("label",uF,[xe(w("input",{type:"checkbox","onUpdate:modelValue":p[144]||(p[144]=x=>y.value.config.attraction=x)},null,512),[[Lt,y.value.config.attraction]]),p[294]||(p[294]=w("span",{class:"switch-ui"},null,-1)),p[295]||(p[295]=w("span",null,"开启吸附",-1))]),y.value.config.attraction?(se(),ce("div",dF,[Ne(Ge,{label:"吸附点 X",min:-5e3,max:5e3,step:1,modelValue:y.value.config.attractionCenterX,"onUpdate:modelValue":p[145]||(p[145]=x=>y.value.config.attractionCenterX=x)},null,8,["modelValue"]),Ne(Ge,{label:"吸附点 Y",min:-5e3,max:5e3,step:1,modelValue:y.value.config.attractionCenterY,"onUpdate:modelValue":p[146]||(p[146]=x=>y.value.config.attractionCenterY=x)},null,8,["modelValue"]),Ne(Ge,{label:"吸附半径",min:0,max:2e3,step:1,modelValue:y.value.config.attractionRadius,"onUpdate:modelValue":p[147]||(p[147]=x=>y.value.config.attractionRadius=x)},null,8,["modelValue"]),Ne(Ge,{label:"吸附时长",min:.05,max:30,step:.05,modelValue:y.value.config.attractionDuration,"onUpdate:modelValue":p[148]||(p[148]=x=>y.value.config.attractionDuration=x)},null,8,["modelValue"]),Ne(Ge,{label:"延迟时间",min:0,max:30,step:.05,modelValue:y.value.config.attractionDelay,"onUpdate:modelValue":p[149]||(p[149]=x=>y.value.config.attractionDelay=x)},null,8,["modelValue"]),w("label",fF,[p[297]||(p[297]=w("span",null,"延迟方式",-1)),xe(w("select",{"onUpdate:modelValue":p[150]||(p[150]=x=>y.value.config.attractionDelayMode=x),class:"inp"},[...p[296]||(p[296]=[w("option",{value:"global"},"统一时间",-1),w("option",{value:"particle"},"单粒子生命",-1)])],512),[[kt,y.value.config.attractionDelayMode]])]),w("label",pF,[p[299]||(p[299]=w("span",null,"吸附方式",-1)),xe(w("select",{"onUpdate:modelValue":p[151]||(p[151]=x=>y.value.config.attractionPath=x),class:"inp"},[...p[298]||(p[298]=[w("option",{value:"linear"},"直线",-1),w("option",{value:"curve"},"曲线",-1)])],512),[[kt,y.value.config.attractionPath]])]),p[300]||(p[300]=w("div",{class:"modifier-hint"},"延迟后从当前位置开始吸附 · 到达红色范围即死亡 · 可在画布内拖动吸附圆",-1))])):$e("",!0)]),w("div",mF,[w("label",gF,[xe(w("input",{type:"checkbox","onUpdate:modelValue":p[152]||(p[152]=x=>y.value.config.trail=x)},null,512),[[Lt,y.value.config.trail]]),p[301]||(p[301]=w("span",{class:"switch-ui"},null,-1)),p[302]||(p[302]=w("span",null,"开启拖尾",-1))]),y.value.config.trail?(se(),ce("div",vF,[w("div",{class:"trail-section-head"},[p[303]||(p[303]=w("div",{class:"trail-section-title"},"拖尾独立图片",-1)),w("button",{class:"image-add",title:"增加拖尾图片资源",onClick:Zi},"+")]),(se(!0),ce(qe,null,Ht(y.value.config.trailResources,x=>(se(),Et(mg,{key:x.id,resource:x,"resource-count":y.value.config.trailResources.length,"default-file":"trail.png","name-placeholder":"trail","show-folder":!1,onPick:xs,onReset:It,onRemove:Pt,onUpdateWeight:$i,onToggleLock:Ji},{default:Fu(()=>[p[319]||(p[319]=w("div",{class:"resource-divider"},null,-1)),Ne(Ge,{label:"旋转",min:-360,max:360,step:1,"model-value":x.rotation,"onUpdate:modelValue":V=>le(x.id,V)},null,8,["model-value","onUpdate:modelValue"]),Ne(Ge,{label:"拖尾骨骼数",min:2,max:16,step:1,"model-value":x.boneCount,"onUpdate:modelValue":V=>re(x.id,V)},null,8,["model-value","onUpdate:modelValue"]),Ne(Ge,{label:"拖尾比例 (%)",min:0,max:100,step:1,modelValue:x.trailRatio,"onUpdate:modelValue":V=>x.trailRatio=V},null,8,["modelValue","onUpdate:modelValue"]),w("label",yF,[p[305]||(p[305]=w("span",null,"拖尾长度",-1)),xe(w("select",{"onUpdate:modelValue":V=>x.lengthMode=V,class:"inp"},[...p[304]||(p[304]=[w("option",{value:"fixed"},"固定",-1),w("option",{value:"random"},"随机范围",-1)])],8,xF),[[kt,x.lengthMode]])]),x.lengthMode==="fixed"?(se(),Et(Ge,{key:0,label:"长度比例 (%)",min:0,max:500,step:1,modelValue:x.length,"onUpdate:modelValue":V=>x.length=V},null,8,["modelValue","onUpdate:modelValue"])):(se(),ce(qe,{key:1},[Ne(Ge,{label:"长度最小 (%)",min:0,max:500,step:1,modelValue:x.lengthMin,"onUpdate:modelValue":V=>x.lengthMin=V},null,8,["modelValue","onUpdate:modelValue"]),Ne(Ge,{label:"长度最大 (%)",min:0,max:500,step:1,modelValue:x.lengthMax,"onUpdate:modelValue":V=>x.lengthMax=V},null,8,["modelValue","onUpdate:modelValue"])],64)),w("label",bF,[p[307]||(p[307]=w("span",null,"拖尾宽度",-1)),xe(w("select",{"onUpdate:modelValue":V=>x.widthSizeMode=V,class:"inp"},[...p[306]||(p[306]=[w("option",{value:"fixed"},"固定",-1),w("option",{value:"random"},"随机范围",-1)])],8,wF),[[kt,x.widthSizeMode]])]),x.widthSizeMode==="fixed"?(se(),Et(Ge,{key:2,label:"宽度比例 (%)",min:0,max:500,step:1,modelValue:x.width,"onUpdate:modelValue":V=>x.width=V},null,8,["modelValue","onUpdate:modelValue"])):(se(),ce(qe,{key:3},[Ne(Ge,{label:"宽度最小 (%)",min:0,max:500,step:1,modelValue:x.widthMin,"onUpdate:modelValue":V=>x.widthMin=V},null,8,["modelValue","onUpdate:modelValue"]),Ne(Ge,{label:"宽度最大 (%)",min:0,max:500,step:1,modelValue:x.widthMax,"onUpdate:modelValue":V=>x.widthMax=V},null,8,["modelValue","onUpdate:modelValue"])],64)),w("label",_F,[p[309]||(p[309]=w("span",null,"宽度缩放",-1)),xe(w("select",{"onUpdate:modelValue":V=>x.widthMode=V,class:"inp"},[...p[308]||(p[308]=[w("option",{value:"particle"},"跟随粒子",-1),w("option",{value:"fixed"},"固定",-1)])],8,SF),[[kt,x.widthMode]])]),w("label",TF,[xe(w("input",{type:"checkbox","onUpdate:modelValue":V=>x.lifeLengthEnabled=V},null,8,MF),[[Lt,x.lifeLengthEnabled]]),p[310]||(p[310]=w("span",{class:"switch-ui"},null,-1)),p[311]||(p[311]=w("span",null,"生命周期长度曲线",-1))]),x.lifeLengthEnabled?(se(),Et(Is,{key:4,modelValue:x.lifeLengthCurve,"onUpdate:modelValue":V=>x.lifeLengthCurve=V,"default-value":j},null,8,["modelValue","onUpdate:modelValue"])):$e("",!0),w("label",EF,[xe(w("input",{type:"checkbox","onUpdate:modelValue":V=>x.shapeEnabled=V},null,8,AF),[[Lt,x.shapeEnabled]]),p[312]||(p[312]=w("span",{class:"switch-ui"},null,-1)),p[313]||(p[313]=w("span",null,"形状曲线(首端 → 尾端宽度)",-1))]),x.shapeEnabled?(se(),Et(Is,{key:5,modelValue:x.shapeCurve,"onUpdate:modelValue":V=>x.shapeCurve=V,"default-value":X},null,8,["modelValue","onUpdate:modelValue"])):$e("",!0),w("div",CF,[p[314]||(p[314]=w("span",null,"颜色模式",-1)),w("div",IF,[w("button",{class:Ze(["axis-mode",{on:x.colorMode==="particle"}]),onClick:V=>x.colorMode="particle"},"跟随粒子",10,RF),w("button",{class:Ze(["axis-mode",{on:x.colorMode==="fixed"}]),onClick:V=>x.colorMode="fixed"},"固定",10,PF),w("button",{class:Ze(["axis-mode",{on:x.colorMode==="curve"}]),onClick:V=>x.colorMode="curve"},"曲线",10,kF)])]),w("label",FF,[p[316]||(p[316]=w("span",null,"混合模式",-1)),xe(w("select",{"onUpdate:modelValue":V=>x.blend=V,class:"inp"},[...p[315]||(p[315]=[w("option",{value:"normal"},"正常",-1),w("option",{value:"add"},"相加",-1),w("option",{value:"multiply"},"相乘",-1),w("option",{value:"screen"},"滤色",-1)])],8,OF),[[kt,x.blend]])]),x.colorMode==="fixed"?(se(),ce("label",BF,[p[317]||(p[317]=w("span",null,"固定颜色",-1)),xe(w("input",{class:"colr",type:"color","onUpdate:modelValue":V=>x.color=V},null,8,LF),[[Je,x.color]]),w("input",{class:"hex-input",value:x.color,onChange:V=>li(x,V),onKeydown:da(xt(V=>Gi(x,V),["prevent"]),["enter"])},null,40,DF)])):x.colorMode==="curve"?(se(),Et(pg,{key:7,modelValue:x.colorGradient,"onUpdate:modelValue":V=>x.colorGradient=V},null,8,["modelValue","onUpdate:modelValue"])):$e("",!0),w("div",NF,[p[318]||(p[318]=w("span",null,"透明度模式",-1)),w("div",UF,[w("button",{class:Ze(["axis-mode",{on:x.alphaMode==="particle"}]),onClick:V=>x.alphaMode="particle"},"跟随粒子",10,VF),w("button",{class:Ze(["axis-mode",{on:x.alphaMode==="fixed"}]),onClick:V=>x.alphaMode="fixed"},"固定",10,XF),w("button",{class:Ze(["axis-mode",{on:x.alphaMode==="curve"}]),onClick:V=>x.alphaMode="curve"},"曲线",10,YF)])]),x.alphaMode==="fixed"?(se(),Et(Ge,{key:8,label:"透明度",min:0,max:1,step:.01,modelValue:x.alpha,"onUpdate:modelValue":V=>x.alpha=V},null,8,["modelValue","onUpdate:modelValue"])):$e("",!0),x.alphaMode==="curve"?(se(),Et(Is,{key:9,modelValue:x.alphaCurve,"onUpdate:modelValue":V=>x.alphaCurve=V,"default-value":P},null,8,["modelValue","onUpdate:modelValue"])):$e("",!0)]),_:2},1032,["resource","resource-count"]))),128)),w("input",{ref_key:"trailTextureFileInput",ref:ai,class:"file-input",type:"file",accept:"image/png,image/jpeg,image/webp",onChange:ft},null,544),w("div",$F,[Ne(Ge,{label:"网格行数",min:2,max:16,step:1,"model-value":y.value.config.trailGridRows,"onUpdate:modelValue":p[153]||(p[153]=x=>$t("trailGridRows",x))},null,8,["model-value"]),Ne(Ge,{label:"网格列数",min:2,max:32,step:1,"model-value":y.value.config.trailGridCols,"onUpdate:modelValue":p[154]||(p[154]=x=>$t("trailGridCols",x))},null,8,["model-value"])]),p[320]||(p[320]=w("div",{class:"modifier-hint"},"每个粒子按资源比例生成一组同级拖尾骨骼;随机长度与宽度在粒子出生时确定,相同种子可稳定复现",-1))])):$e("",!0)]),w("div",GF,[w("label",jF,[xe(w("input",{type:"checkbox","onUpdate:modelValue":p[155]||(p[155]=x=>y.value.config.emitterFollow=x),disabled:y.value.config.streamBehavior==="loop"},null,8,HF),[[Lt,y.value.config.emitterFollow]]),p[321]||(p[321]=w("span",{class:"switch-ui"},null,-1)),p[322]||(p[322]=w("span",null,"开启发射器跟随",-1))]),y.value.config.emitterFollow&&y.value.config.streamBehavior!=="loop"?(se(),ce("div",WF,[w("label",zF,[p[325]||(p[325]=w("span",null,"跟随模式",-1)),w("select",{value:y.value.config.emitterFollowMode,class:"inp",onChange:p[156]||(p[156]=x=>ae(x,y.value.config))},[p[323]||(p[323]=w("option",{value:"none"},"无",-1)),p[324]||(p[324]=w("option",{value:"path"},"跟随路径",-1)),F.value||y.value.config.emitterFollowMode==="bone"?(se(),ce("option",KF,"选中的骨骼")):$e("",!0)],40,qF)]),y.value.config.emitterFollowMode==="path"?(se(),ce(qe,{key:0},[w("label",ZF,[p[327]||(p[327]=w("span",null,"跟随路径",-1)),xe(w("select",{"onUpdate:modelValue":p[157]||(p[157]=x=>y.value.config.emitterFollowPathId=x),class:"inp"},[p[326]||(p[326]=w("option",{value:0},"无",-1)),(se(!0),ce(qe,null,Ht(Pe(e).paths,x=>(se(),ce("option",{key:x.id,value:x.id},Ye(x.name),9,JF))),128))],512),[[kt,y.value.config.emitterFollowPathId,void 0,{number:!0}]])]),w("label",QF,[p[329]||(p[329]=w("span",null,"发射器角度模式",-1)),xe(w("select",{"onUpdate:modelValue":p[158]||(p[158]=x=>y.value.config.emitterAngleMode=x),class:"inp"},[...p[328]||(p[328]=[w("option",{value:"fixed"},"固定角度",-1),w("option",{value:"direction"},"跟随移动方向",-1)])],512),[[kt,y.value.config.emitterAngleMode]])]),p[335]||(p[335]=w("div",{class:"gravity-curve-title"},[w("span",null,"移动进度曲线 (0→1)")],-1)),Ne(Is,{modelValue:y.value.config.emitterFollowCurve,"onUpdate:modelValue":p[159]||(p[159]=x=>y.value.config.emitterFollowCurve=x),"default-value":N},null,8,["modelValue"]),w("div",eO,[w("label",tO,[p[330]||(p[330]=w("span",null,"移动时长 (s)",-1)),xe(w("input",{"onUpdate:modelValue":p[160]||(p[160]=x=>y.value.config.emitterFollowDuration=x),type:"number",min:"0.05",step:"0.05",class:"inp"},null,512),[[Je,y.value.config.emitterFollowDuration,void 0,{number:!0}]])]),w("label",iO,[p[332]||(p[332]=w("span",null,"跟随空间",-1)),xe(w("select",{"onUpdate:modelValue":p[161]||(p[161]=x=>y.value.config.emitterFollowSpace=x),class:"inp"},[...p[331]||(p[331]=[w("option",{value:"local"},"局部空间(GEN 移动)",-1),w("option",{value:"world"},"世界空间(粒子生成点移动)",-1)])],512),[[kt,y.value.config.emitterFollowSpace]])])]),w("label",sO,[p[334]||(p[334]=w("span",null,"移动方向",-1)),xe(w("select",{"onUpdate:modelValue":p[162]||(p[162]=x=>y.value.config.emitterFollowDirection=x),class:"inp"},[...p[333]||(p[333]=[w("option",{value:"forward"},"正向(起点 → 终点)",-1),w("option",{value:"reverse"},"反向(终点 → 起点)",-1)])],512),[[kt,y.value.config.emitterFollowDirection]])]),Ne(Ge,{label:"偏移起始点 (0-1)",min:0,max:1,step:.01,modelValue:y.value.config.emitterFollowOffset,"onUpdate:modelValue":p[163]||(p[163]=x=>y.value.config.emitterFollowOffset=x)},null,8,["modelValue"]),p[336]||(p[336]=w("div",{class:"modifier-hint"},"局部空间会移动整个发射器;世界空间只移动新粒子的生成点,已出生粒子留在世界位置。",-1))],64)):y.value.config.emitterFollowMode==="bone"?(se(),ce(qe,{key:1},[D.value?(se(),ce("div",nO,[p[337]||(p[337]=Yt("跟随目标:",-1)),w("strong",null,Ye(D.value.spine.name)+" / "+Ye(D.value.boneName),1)])):(se(),ce("div",rO,"尚未绑定有效骨骼,请先在 Spine 层级树中选择骨骼。")),F.value&&(!D.value||F.value.spine.id!==D.value.spine.id||F.value.boneName!==D.value.boneName)?(se(),ce("button",{key:2,class:"bone-follow-rebind",onClick:p[164]||(p[164]=x=>me(y.value.config))},Ye(D.value?"重新绑定":"绑定")+"当前选中骨骼:"+Ye(F.value.spine.name)+" / "+Ye(F.value.boneName),1)):$e("",!0),D.value?(se(),ce(qe,{key:3},[w("label",oO,[p[339]||(p[339]=w("span",null,"跟随空间",-1)),xe(w("select",{"onUpdate:modelValue":p[165]||(p[165]=x=>y.value.config.emitterFollowSpace=x),class:"inp"},[...p[338]||(p[338]=[w("option",{value:"local"},"本地空间(随骨骼移动)",-1),w("option",{value:"world"},"世界空间(粒子生成后保持位置)",-1)])],512),[[kt,y.value.config.emitterFollowSpace]])]),w("div",aO,[w("label",lO,[p[340]||(p[340]=w("span",null,"位移偏移 X",-1)),xe(w("input",{"onUpdate:modelValue":p[166]||(p[166]=x=>y.value.config.emitterFollowBoneOffsetX=x),type:"number",step:"1",class:"inp"},null,512),[[Je,y.value.config.emitterFollowBoneOffsetX,void 0,{number:!0}]])]),w("label",hO,[p[341]||(p[341]=w("span",null,"位移偏移 Y",-1)),xe(w("input",{"onUpdate:modelValue":p[167]||(p[167]=x=>y.value.config.emitterFollowBoneOffsetY=x),type:"number",step:"1",class:"inp"},null,512),[[Je,y.value.config.emitterFollowBoneOffsetY,void 0,{number:!0}]])])]),w("div",cO,[w("label",uO,[p[342]||(p[342]=w("span",null,"旋转偏移",-1)),xe(w("input",{"onUpdate:modelValue":p[168]||(p[168]=x=>y.value.config.emitterFollowBoneRotation=x),type:"number",step:"1",class:"inp"},null,512),[[Je,y.value.config.emitterFollowBoneRotation,void 0,{number:!0}]])]),w("label",dO,[p[343]||(p[343]=w("span",null,"缩放偏移 X",-1)),xe(w("input",{"onUpdate:modelValue":p[169]||(p[169]=x=>y.value.config.emitterFollowBoneScaleX=x),type:"number",step:"0.05",class:"inp"},null,512),[[Je,y.value.config.emitterFollowBoneScaleX,void 0,{number:!0}]])]),w("label",fO,[p[344]||(p[344]=w("span",null,"缩放偏移 Y",-1)),xe(w("input",{"onUpdate:modelValue":p[170]||(p[170]=x=>y.value.config.emitterFollowBoneScaleY=x),type:"number",step:"0.05",class:"inp"},null,512),[[Je,y.value.config.emitterFollowBoneScaleY,void 0,{number:!0}]])])]),p[345]||(p[345]=w("div",{class:"modifier-hint"},"发射器只跟随所选 Spine 骨骼的位置,不继承 Spine 的旋转或缩放;粒子变换使用粒子系统自身参数和上方偏移。",-1))],64)):$e("",!0)],64)):$e("",!0)])):$e("",!0)]),Ne(Ge,{label:"阻尼",min:0,max:2,step:.05,modelValue:y.value.config.damping,"onUpdate:modelValue":p[171]||(p[171]=x=>y.value.config.damping=x)},null,8,["modelValue"])],512),[[Cn,!U.mods]])]),w("div",pO,[w("div",{class:"group-head",onClick:p[173]||(p[173]=x=>Y("export"))},[w("span",mO,Ye(U.export?"▸":"▾"),1),p[346]||(p[346]=w("span",null,"导出设置",-1)),w("button",{class:"group-reset",title:"重置导出设置",onClick:p[172]||(p[172]=xt(x=>te("export"),["stop"]))},"重置")]),xe(w("div",gO,[w("label",vO,[p[347]||(p[347]=w("span",null,"图片路径 (Spine Images Path)",-1)),xe(w("input",{"onUpdate:modelValue":p[174]||(p[174]=x=>t.value.imagesPath=x),class:"inp export-input",type:"text",placeholder:"./images/"},null,512),[[Je,t.value.imagesPath,void 0,{trim:!0}]])]),w("label",yO,[p[349]||(p[349]=w("span",null,"Spine 版本",-1)),xe(w("select",{"onUpdate:modelValue":p[175]||(p[175]=x=>t.value.spineVersion=x),class:"inp export-input"},[...p[348]||(p[348]=[w("option",{value:"3.8"},"Spine 3.8",-1),w("option",{value:"4.0"},"Spine 4.0",-1),w("option",{value:"4.1"},"Spine 4.1",-1),w("option",{value:"4.2"},"Spine 4.2",-1)])],512),[[kt,t.value.spineVersion]])]),w("label",xO,[p[351]||(p[351]=w("span",null,"关键帧插值曲线",-1)),xe(w("select",{"onUpdate:modelValue":p[176]||(p[176]=x=>t.value.keyframeCurve=x),class:"inp export-input"},[...p[350]||(p[350]=[w("option",{value:"linear"},"线性 (Linear)",-1),w("option",{value:"bezier"},"平滑贝塞尔 (Smooth Bézier)",-1)])],512),[[kt,t.value.keyframeCurve]])]),p[360]||(p[360]=w("div",{class:"export-help"},"平滑贝塞尔会在误差允许范围内拟合连续运动;出生、死亡、附件切换和突变仍使用阶跃关键帧。",-1)),t.value.spineVersion==="3.8"?(se(),ce("div",bO,"Spine 3.8 不支持 4.x 的逐通道数组贝塞尔,导出时会转换为经过容差精简的分段线性关键帧。")):$e("",!0),w("div",wO,[w("label",_O,[p[352]||(p[352]=w("span",null,"导出 FPS",-1)),xe(w("input",{"onUpdate:modelValue":p[177]||(p[177]=x=>t.value.fps=x),class:"inp export-input",type:"number",min:"1",max:"240",step:"1",onChange:ve},null,544),[[Je,t.value.fps,void 0,{number:!0}]])]),w("label",SO,[xe(w("input",{"onUpdate:modelValue":p[178]||(p[178]=x=>t.value.omitFps=x),type:"checkbox"},null,512),[[Lt,t.value.omitFps]]),p[353]||(p[353]=Yt("不写 fps",-1))])]),p[361]||(p[361]=w("div",{class:"export-help"},"修改 FPS 时保持动画实际秒数不变;“不写 fps”只省略 Spine 的 fps 元数据。",-1)),w("div",TO,[w("label",MO,[xe(w("input",{"onUpdate:modelValue":p[179]||(p[179]=x=>t.value.integerFrameAlignment=x),type:"checkbox"},null,512),[[Lt,t.value.integerFrameAlignment]]),p[354]||(p[354]=w("span",{class:"switch-ui"},null,-1)),p[355]||(p[355]=w("span",null,"整数帧对齐",-1))]),w("label",EO,[xe(w("input",{"onUpdate:modelValue":p[180]||(p[180]=x=>t.value.bonePool=x),type:"checkbox"},null,512),[[Lt,t.value.bonePool]]),p[356]||(p[356]=w("span",{class:"switch-ui"},null,-1)),p[357]||(p[357]=w("span",null,"骨骼对象池",-1))]),w("label",AO,[xe(w("input",{"onUpdate:modelValue":p[181]||(p[181]=x=>t.value.excludeEmptyAnimations=x),type:"checkbox"},null,512),[[Lt,t.value.excludeEmptyAnimations]]),p[358]||(p[358]=w("span",{class:"switch-ui"},null,-1)),p[359]||(p[359]=w("span",null,"排除无内容动画",-1))])])],512),[[Cn,!U.export]])])],64)):$e("",!0)]),w("button",{type:"button",class:"export-spine-json",disabled:l.value,title:l.value?"正在重新计算并烘焙动画":`导出 Spine ${t.value.spineVersion} JSON`,onClick:v},Ye(l.value?"正在准备导出…":"导出Spine Json"),9,CO),c.value?(se(),ce("div",{key:0,class:Ze(["export-message",{error:u.value}])},Ye(c.value),3)):$e("",!0)]))}}),RO=Ks(IO,[["__scopeId","data-v-6eba135a"]]),PO={class:"timeline"},kO={class:"tl-controls"},FO=["title"],OO={class:"tl-frame"},BO=["disabled"],LO=["onClick"],DO={key:0},NO={class:"tl-animation-editor"},UO={key:0,class:"tl-animation-error"},VO={class:"tl-animation-actions"},XO=["disabled"],YO={key:1,class:"tl-animation-hint"},$O={class:"tl-anim tl-spine-preview"},GO=["value","disabled"],jO={value:""},HO=["value"],WO={class:"tl-zoom"},zO={class:"tl-ticks"},qO={class:"tl-ticklabel"},KO={class:"tl-lanes"},ZO=["onPointerdown"],JO={class:"lane-name"},QO=["onPointerdown"],e3=["onPointerdown"],t3={class:"lane-name"},i3={key:0,class:"tl-empty"},s3=Ws({__name:"Timeline",setup(i){const e=Aa(),t=it(null),s=it(null),n=it(!1),r=it("animation"),o=it("");No(()=>{(!Array.isArray(e.timeline.animations)||!e.timeline.animations.length)&&(e.timeline.animations=["animation"]),e.timeline.animations.includes(e.timeline.animation)||(e.timeline.animation=e.timeline.animations[0]);for(const H of e.systems)(!H.animation||!e.timeline.animations.includes(H.animation))&&(H.animation=e.timeline.animations[0])});const a=ut(()=>e.systems.find(H=>H.id===e.activeId)||null);function h(){a.value&&(n.value=!n.value,r.value=a.value.animation,o.value="")}function l(H){const Z=a.value;Z&&(e.setSystemAnimation(Z.id,H),r.value=H,o.value="")}function c(){const H=e.addAnimation();r.value=H,o.value=""}function u(){var ae;const H=((ae=a.value)==null?void 0:ae.animation)||e.timeline.animation,Z=r.value.trim();if(!Z){o.value="动画名称不能为空";return}if(Z!==H&&e.timeline.animations.includes(Z)){o.value="动画名称不能重复";return}if(!e.renameAnimation(H,Z)){o.value="无法修改动画名称";return}r.value=Z,o.value=""}function f(){var ae,me;const H=((ae=a.value)==null?void 0:ae.animation)||e.timeline.animation;if(!e.removeAnimation(H)){o.value="至少需要保留一个动画";return}const Z=((me=a.value)==null?void 0:me.animation)||e.timeline.animation;r.value=Z,o.value=""}function d(H){var Z;(Z=s.value)!=null&&Z.contains(H.target)||(n.value=!1)}_o(()=>document.addEventListener("pointerdown",d)),a0(()=>document.removeEventListener("pointerdown",d));const m=ut(()=>Math.max(1,e.timeline.fps||30)),g=it(120),b=it({}),_=it({}),M=it({}),v=ut(()=>e.timeline.totalFrames),S=ut(()=>g.value<=30?"放大":g.value>=300?"缩小":"适中"),y=ut(()=>e.spines.filter(H=>H.selectedAnimation&&H.animations.some(Z=>Z.name===H.selectedAnimation&&Z.duration>0))),I=ut(()=>(e.activeObjectType==="spine"?e.spines.find(Z=>Z.id===e.activeObjectId&&Z.animations.length):null)||e.spines.find(Z=>Z.animations.length)||null);function E(H){const Z=I.value;Z&&(Z.selectedAnimation=H.target.value,e.recalcTotalFrames(),e.timeline.frame=0)}function C(){var Z;const H=((Z=t.value)==null?void 0:Z.clientWidth)||600;return g.value/H}const R=ut(()=>{const H=[],Z=g.value;let ae=1;g.value<=10?ae=1:g.value<=50?ae=5:g.value<=200?ae=10:g.value<=500?ae=50:ae=100;for(let me=0;me<=Z;me+=ae)H.push({f:me,px:me/C()});return H}),B=ut(()=>e.timeline.frame/C());function k(H){const Z=H.config;return(b.value[H.id]??Math.max(0,Number(Z.delay)||0))*m.value/C()}function F(H){const Z=H.config,ae=Math.max(0,Number(Z.lifeMin)||0),me=Math.max(0,Number(Z.lifeMax)||0);return Z.lifeMode==="fixed"?ae:Math.max(ae,me)}function D(H){return j(H)}function N(H){if(H.config.mode!=="stream"||O(H))return 0;if(H.config.streamBehavior==="loop"){const ae=H.config,me=Math.max(1,Math.ceil(Number(ae.loopDurationFrames)||1));if(ae.generateLoopStartAnimation){const _e=Math.max(1,Math.ceil(F(H)*m.value/me));return me*_e/C()}return me/C()}return(_.value[H.id]??Math.max(1/m.value,Number(H.config.duration)||1))*m.value/C()}function j(H){const Z=H.config;return Z.mode==="stream"&&Z.streamBehavior==="loop"?Z.generateLoopEndAnimation?(F(H)*m.value+1)/C():N(H):N(H)+F(H)*m.value/C()}function O(H){const Z=H.config;return Z.mode==="stream"&&Z.streamBehavior==="loop"&&Z.generateLoopEndAnimation}function L(H){var Z;return((Z=H.animations.find(ae=>ae.name===H.selectedAnimation))==null?void 0:Z.duration)||0}function P(H){return(M.value[H.id]??Math.max(0,Number(H.timeOffset)||0))*m.value/C()}function X(H){return L(H)*m.value/C()}function U(H){const Z=H.deltaY<0?.8:1.25;let ae=g.value*Z;ae=Math.min(2e3,Math.max(10,ae)),g.value=Math.round(ae)}function Y(H){const Z=t.value,ae=_e=>{const te=Z.getBoundingClientRect(),ve=Math.floor((_e.clientX-te.left)/te.width*g.value);e.timeline.frame=Math.max(0,Math.min(ve,v.value-1))};ae(H);const me=()=>{window.removeEventListener("pointermove",ae),window.removeEventListener("pointerup",me)};window.addEventListener("pointermove",ae),window.addEventListener("pointerup",me)}function q(H,Z){H.stopPropagation();const ae=H.clientX,me=Math.max(0,Number(Z.config.delay)||0),_e=C()/m.value,te=J=>{const Q=(J.clientX-ae)*_e,ie=Math.max(0,Math.min(me+Q,600));b.value[Z.id]=Math.round(ie*m.value)/m.value},ve=J=>{window.removeEventListener("pointermove",te),window.removeEventListener("pointerup",$),window.removeEventListener("pointercancel",W);const Q=b.value[Z.id];delete b.value[Z.id],J&&Q!=null&&Q!==me&&(Z.config.delay=Q)},$=()=>ve(!0),W=()=>ve(!1);window.addEventListener("pointermove",te),window.addEventListener("pointerup",$),window.addEventListener("pointercancel",W)}function z(H,Z){var Q;if(H.stopPropagation(),O(Z))return;const ae=Math.max(0,Number(Z.config.duration)||0),me=C()/m.value,_e=((Q=H.currentTarget.closest(".lane-bar"))==null?void 0:Q.getBoundingClientRect().left)??H.clientX;let te=!1;const ve=ie=>{te=!0;const ue=Math.max(1/m.value,Math.min((ie.clientX-_e)*me,600));_.value[Z.id]=Math.round(ue*m.value)/m.value},$=ie=>{window.removeEventListener("pointermove",ve),window.removeEventListener("pointerup",W),window.removeEventListener("pointercancel",J);const ue=_.value[Z.id];delete _.value[Z.id],ie&&te&&ue!=null&&ue!==ae&&(Z.config.duration=ue)},W=()=>$(!0),J=()=>$(!1);window.addEventListener("pointermove",ve),window.addEventListener("pointerup",W),window.addEventListener("pointercancel",J)}function ne(H,Z){H.stopPropagation();const ae=H.clientX,me=Math.max(0,Number(Z.timeOffset)||0),_e=C()/m.value,te=J=>{const Q=Math.max(0,Math.min(me+(J.clientX-ae)*_e,600));M.value[Z.id]=Math.round(Q*m.value)/m.value},ve=J=>{window.removeEventListener("pointermove",te),window.removeEventListener("pointerup",$),window.removeEventListener("pointercancel",W);const Q=M.value[Z.id];delete M.value[Z.id],J&&Q!=null&&Q!==me&&(Z.timeOffset=Q,e.recalcTotalFrames())},$=()=>ve(!0),W=()=>ve(!1);window.addEventListener("pointermove",te),window.addEventListener("pointerup",$),window.addEventListener("pointercancel",W)}return(H,Z)=>{var ae,me,_e;return se(),ce("div",PO,[w("div",kO,[w("button",{class:Ze(["tl-btn",{on:Pe(e).timeline.playing}]),onClick:Z[0]||(Z[0]=te=>Pe(e).togglePlay()),title:Pe(e).timeline.playing?"暂停 (D)":"播放 (D)"},Ye(Pe(e).timeline.playing?"❚❚":"▶"),11,FO),w("button",{class:"tl-btn",onClick:Z[1]||(Z[1]=te=>Pe(e).toStart()),title:"回到第一帧 (S)"},"⏮"),w("button",{class:"tl-btn",onClick:Z[2]||(Z[2]=te=>Pe(e).previousFrame()),title:"前一帧"},"◀"),w("button",{class:"tl-btn",onClick:Z[3]||(Z[3]=te=>Pe(e).nextFrame()),title:"后一帧"},"▶"),w("button",{class:"tl-btn",onClick:Z[4]||(Z[4]=te=>Pe(e).toEnd()),title:"移动到最后一帧"},"⏭"),w("button",{class:Ze(["tl-btn",{on:Pe(e).timeline.loop}]),onClick:Z[5]||(Z[5]=te=>Pe(e).toggleLoop()),title:"循环"},"⟳",2),w("span",OO,[Z[8]||(Z[8]=Yt("帧 ",-1)),w("b",null,Ye(Pe(e).timeline.frame),1),Z[9]||(Z[9]=Yt(" / ",-1)),w("b",null,Ye(Math.max(0,Pe(e).timeline.totalFrames-1)),1)]),Z[14]||(Z[14]=w("span",{class:"tl-legend"},[w("i",{class:"legend-emission"}),Yt("持续发射 "),w("i",{class:"legend-life"}),Yt("粒子存在 "),w("i",{class:"legend-spine"}),Yt("Spine 动画")],-1)),w("div",{ref_key:"animationMenuRef",ref:s,class:"tl-anim tl-owner-animation"},[Z[12]||(Z[12]=w("span",null,"所属动画",-1)),w("button",{class:"tl-animation-trigger",disabled:!a.value,title:"设置当前粒子系统所属的动画",onClick:xt(h,["stop"])},[w("span",null,Ye(((ae=a.value)==null?void 0:ae.animation)||Pe(e).timeline.animation),1),Z[10]||(Z[10]=w("i",null,"⌄",-1))],8,BO),n.value?(se(),ce("div",{key:0,class:"tl-animation-menu",onPointerdown:Z[7]||(Z[7]=xt(()=>{},["stop"]))},[Z[11]||(Z[11]=w("div",{class:"tl-animation-menu-title"},"选择所属动画",-1)),(se(!0),ce(qe,null,Ht(Pe(e).timeline.animations,te=>{var ve,$;return se(),ce("button",{key:te,class:Ze(["tl-animation-option",{on:((ve=a.value)==null?void 0:ve.animation)===te}]),onClick:W=>l(te)},[w("span",null,Ye(te),1),(($=a.value)==null?void 0:$.animation)===te?(se(),ce("i",DO,"✓")):$e("",!0)],10,LO)}),128)),w("div",NO,[xe(w("input",{"onUpdate:modelValue":Z[6]||(Z[6]=te=>r.value=te),class:"tl-animation-name",maxlength:"64","aria-label":"动画名称",onKeydown:da(u,["enter"])},null,544),[[Je,r.value]]),w("button",{title:"重命名当前动画",onClick:u},"重命名")]),o.value?(se(),ce("div",UO,Ye(o.value),1)):$e("",!0),w("div",VO,[w("button",{onClick:c},"+ 新增"),w("button",{disabled:Pe(e).timeline.animations.length<=1,onClick:f},"删除",8,XO)]),Pe(e).timeline.animations.length<=1?(se(),ce("div",YO,"至少需要保留一个动画")):$e("",!0)],32)):$e("",!0)],512),w("label",$O,[Z[13]||(Z[13]=Yt("Spine 预览动画 ",-1)),w("select",{class:"tl-sel",value:((me=I.value)==null?void 0:me.selectedAnimation)||"",disabled:!I.value,onChange:E},[w("option",jO,Ye(I.value?"无":"无可用 Spine 动画"),1),(se(!0),ce(qe,null,Ht(((_e=I.value)==null?void 0:_e.animations)||[],te=>(se(),ce("option",{key:te.name,value:te.name},Ye(te.name)+"("+Ye(te.duration.toFixed(2))+"s) ",9,HO))),128))],40,GO)]),w("span",WO,Ye(S.value),1)]),w("div",{class:"tl-viewport",ref_key:"vpRef",ref:t,onWheel:xt(U,["prevent"]),onPointerdown:Y},[w("div",zO,[(se(!0),ce(qe,null,Ht(R.value,te=>(se(),ce("div",{key:te.f,class:"tl-tickline",style:Pi({left:te.px+"px"})},[w("span",qO,Ye(te.f)+"f",1)],4))),128))]),w("div",{class:"tl-playhead",style:Pi({left:B.value+"px"})},null,4),w("div",KO,[(se(!0),ce(qe,null,Ht(Pe(e).systems,(te,ve)=>(se(),ce("div",{key:te.id,class:"tl-lane"},[Z[15]||(Z[15]=w("span",{class:"lane-ico"},"●",-1)),w("div",{class:"lane-bar",style:Pi({left:k(te)+"px",width:D(te)+"px"}),onPointerdown:xt($=>q($,te),["stop"])},[w("span",JO,Ye(te.config.name||"系统 "+(ve+1)),1),w("span",{class:"bar-life",style:Pi({width:j(te)+"px"})},null,4),te.config.mode==="stream"&&!O(te)?(se(),ce("span",{key:0,class:"bar-emission",style:Pi({width:N(te)+"px"})},[w("span",{class:"bar-handle",title:"拖动持续发射时长",onPointerdown:xt($=>z($,te),["stop"])},null,40,QO)],4)):$e("",!0)],44,ZO)]))),128)),(se(!0),ce(qe,null,Ht(y.value,te=>(se(),ce("div",{key:`spine-${te.id}`,class:"tl-lane spine-lane"},[Z[16]||(Z[16]=w("span",{class:"lane-ico spine-ico"},"◆",-1)),w("div",{class:"spine-bar",style:Pi({left:P(te)+"px",width:X(te)+"px"}),title:"拖动调整动画开始时间",onPointerdown:xt(ve=>ne(ve,te),["stop"])},[w("span",t3,Ye(te.name)+" · "+Ye(te.selectedAnimation),1)],44,e3)]))),128)),!Pe(e).systems.length&&!y.value.length?(se(),ce("div",i3,"暂无可显示的动画数据")):$e("",!0)])],544)])}}}),n3=Ks(s3,[["__scopeId","data-v-0ef42eef"]]),r3={class:"right"},o3={class:"stage-area"},a3=Ws({__name:"App",setup(i){const e=Aa();FE(e);const t=it(360),s=it(180);function n(o){o.preventDefault();const a=l=>{const c=e.settings.parameterPanelOnRight?window.innerWidth-l.clientX:l.clientX,u=Math.max(240,Math.min(c,window.innerWidth-200));t.value=u},h=()=>{window.removeEventListener("pointermove",a),window.removeEventListener("pointerup",h)};window.addEventListener("pointermove",a),window.addEventListener("pointerup",h)}function r(o){o.preventDefault();const a=o.clientY,h=s.value,l=u=>{const f=Math.max(80,Math.min(h+(a-u.clientY),window.innerHeight-200));s.value=f},c=()=>{window.removeEventListener("pointermove",l),window.removeEventListener("pointerup",c)};window.addEventListener("pointermove",l),window.addEventListener("pointerup",c)}return(o,a)=>(se(),ce("div",{class:Ze(["layout",{"panel-right":Pe(e).settings.parameterPanelOnRight}])},[w("div",{class:"parameter-panel",style:Pi({width:t.value+"px"})},[Ne(RO)],4),w("div",{class:"resizer-col",onPointerdown:n},null,32),w("div",r3,[w("div",o3,[Ne(zC)]),w("div",{class:"resizer-row",onPointerdown:r,title:"拖动调整时间轴高度"},null,32),w("div",{class:"timeline-area",style:Pi({height:s.value+"px"})},[Ne(n3)],4)])],2))}}),l3=Ks(a3,[["__scopeId","data-v-8eacccdc"]]);Hb(l3).use(qb()).mount("#app"); diff --git a/dist/index.html b/dist/index.html index 5f24768..d6c86c4 100644 --- a/dist/index.html +++ b/dist/index.html @@ -8,8 +8,8 @@ html, body { margin: 0; padding: 0; background: #111; color: #eee; font-family: system-ui, -apple-system, sans-serif; } #app { display: flex; flex-direction: column; height: 100vh; } - - + +
diff --git a/src/store/particleStore.ts b/src/store/particleStore.ts index 025858e..0133dfa 100644 --- a/src/store/particleStore.ts +++ b/src/store/particleStore.ts @@ -132,7 +132,7 @@ export const useParticleStore = defineStore('particle', { // 与 Spine 编辑器默认时间基准对齐:1 秒 = 30 帧。 timeline: { playing: true, loop: true, frame: 0, totalFrames: 60, fps: 30, recorded: false, animation: 'animation', animations: ['animation'] } as TimelineState, settings: { - parameterPanelOnRight: false, + parameterPanelOnRight: true, tickEnabled: false, axisFontSize: 12, tickWidth: 1, diff --git a/src/views/ParticlePanel.vue b/src/views/ParticlePanel.vue index 56d5e30..84e2954 100644 --- a/src/views/ParticlePanel.vue +++ b/src/views/ParticlePanel.vue @@ -1,7 +1,7 @@