diff --git a/dist/assets/index-BJgrTIS_.css b/dist/assets/index-BJgrTIS_.css new file mode 100644 index 0000000..fd60a99 --- /dev/null +++ b/dist/assets/index-BJgrTIS_.css @@ -0,0 +1 @@ +.help-overlay[data-v-4bb9bc76]{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-4bb9bc76]{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-4bb9bc76]{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-4bb9bc76]{margin:0;color:#eef2ff;font-size:19px}.help-head p[data-v-4bb9bc76]{margin:5px 0 0;color:#7786a3;font-size:11px}.help-close[data-v-4bb9bc76]{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-4bb9bc76]:hover{border-color:#7774ff;background:#3b4670;color:#fff}.help-body[data-v-4bb9bc76]{min-height:0;overflow:auto;padding:18px 20px 21px}.help-section[data-v-4bb9bc76]{padding:14px 15px;border:1px solid #2c3850;border-radius:10px;background:#181f2e}.help-section h3[data-v-4bb9bc76]{margin:0 0 11px;color:#9fb2ff;font-size:13px}.help-start ol[data-v-4bb9bc76]{margin:0;padding-left:21px;color:#aab6cc;font-size:12px;line-height:1.75}.help-start li[data-v-4bb9bc76]::marker{color:#7774ff;font-weight:700}.help-section b[data-v-4bb9bc76]{color:#dce4f7}.help-grid[data-v-4bb9bc76]{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(250px,.85fr);gap:12px;margin-top:12px}.help-list[data-v-4bb9bc76]{display:grid;gap:0;margin:0}.help-list>div[data-v-4bb9bc76]{display:grid;grid-template-columns:78px 1fr;gap:9px;padding:7px 0;border-bottom:1px solid #263146}.help-list>div[data-v-4bb9bc76]:last-child{border-bottom:0}.help-list dt[data-v-4bb9bc76]{color:#d3dcf0;font-size:11px;font-weight:700}.help-list dd[data-v-4bb9bc76]{margin:0;color:#8795ae;font-size:11px;line-height:1.5}.shortcut-list[data-v-4bb9bc76]{display:grid;gap:7px}.shortcut-list>div[data-v-4bb9bc76]{display:flex;align-items:center;min-height:25px;gap:5px}.shortcut-list kbd[data-v-4bb9bc76]{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-4bb9bc76]{color:#65728b;font-size:10px}.shortcut-list em[data-v-4bb9bc76]{margin-left:auto;color:#9ca9c1;font-size:11px;font-style:normal}.help-note[data-v-4bb9bc76]{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-4bb9bc76]{margin-top:12px}.help-export p[data-v-4bb9bc76]{margin:0;color:#8997b0;font-size:11px;line-height:1.65}.help-doc-title[data-v-4bb9bc76]{margin:16px 2px 2px;color:#9fb2ff;font-size:13px;font-weight:700;letter-spacing:.5px}.help-module[data-v-4bb9bc76]{margin-top:12px}.help-module-head[data-v-4bb9bc76]{display:flex;align-items:center;gap:8px;width:100%;padding:0;border:0;background:transparent;color:#9fb2ff;font:inherit;font-size:13px;font-weight:700;text-align:left;cursor:pointer}.help-module-head[data-v-4bb9bc76]:hover{color:#fff}.help-module-head .mtitle[data-v-4bb9bc76]{flex:1;min-width:0}.help-module-head .caret[data-v-4bb9bc76]{flex:0 0 auto;color:#7b86a2;font-size:12px}.help-module.open .help-module-head[data-v-4bb9bc76]{color:#fff}.help-module.open .help-module-head .caret[data-v-4bb9bc76]{color:#9fb2ff}.help-module .mnum[data-v-4bb9bc76]{flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;width:22px;height:22px;border-radius:6px;background:linear-gradient(135deg,#4a53b8,#6a5fd0);color:#fff;font-size:12px;font-weight:700}.help-module.help-connector[data-v-4bb9bc76]{border-color:#4a4f8a;background:linear-gradient(135deg,#1d2442,#181d2f)}.help-module.help-connector .help-module-head[data-v-4bb9bc76]{color:#b8c2ff}.help-module .connector-intro[data-v-4bb9bc76]{margin:0 0 10px;color:#9aa8c4;font-size:11px;line-height:1.6}.help-module .connector-intro b[data-v-4bb9bc76]{color:#dce4f7}.help-module .dl-link[data-v-4bb9bc76]{display:inline-flex;flex-direction:column;align-items:flex-start;gap:2px;margin:0 10px 6px 0;padding:6px 12px;border:1px solid #5652b5;border-radius:6px;background:#4540a0;color:#fff;font-size:12px;font-weight:700;text-decoration:none}.help-module .dl-link[data-v-4bb9bc76]:hover{border-color:#8982ff;background:#554dc2}.help-module .dl-link small[data-v-4bb9bc76]{color:#cfe0ff;font-weight:500;font-size:9px}.help-module-body[data-v-4bb9bc76]{padding-top:10px}@media(max-width:760px){.help-overlay[data-v-4bb9bc76]{padding:66px 12px 14px}.help-grid[data-v-4bb9bc76]{grid-template-columns:1fr}}.topbar[data-v-6411b316]{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-6411b316]{background:#1a1a28;border:1px solid #2e2e44;color:#dde;border-radius:5px}.tool-group[data-v-6411b316]{display:flex;gap:6px;margin-left:6px;padding-left:12px;border-left:1px solid #2a2a3c}.tool-btn[data-v-6411b316]{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-6411b316]:hover{background:#2b3a5c;color:#fff}.tool-btn.on[data-v-6411b316]{background:#3a5a8c;color:#fff;border-color:#5a7ab8}.background-menu[data-v-6411b316]{position:relative;flex:0 0 auto}.background-btn[data-v-6411b316]{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-6411b316]:hover,.background-btn.on[data-v-6411b316]{border-color:#7774ff;background:#343b63;color:#fff}.background-panel[data-v-6411b316]{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-6411b316]{width:100%;height:30px;border:1px solid #5652b5;border-radius:6px;background:#4540a0;color:#fff;cursor:pointer}.background-upload[data-v-6411b316]:hover{border-color:#8982ff;background:#554dc2}.background-clear[data-v-6411b316]{width:100%;height:28px;margin-top:6px;border:1px solid #70404a;border-radius:6px;background:#512a33;color:#efb5bd;cursor:pointer}.background-clear[data-v-6411b316]:hover:not(:disabled){border-color:#b65b6a;background:#6a303b;color:#fff}.background-clear[data-v-6411b316]:disabled{opacity:.42;cursor:not-allowed}.background-file-input[data-v-6411b316]{display:none}.background-file-name[data-v-6411b316]{margin:7px 2px 9px;overflow:hidden;color:#737f98;font-size:10px;text-overflow:ellipsis;white-space:nowrap}.background-position-row[data-v-6411b316]{display:grid;grid-template-columns:1fr 1fr;gap:8px}.background-position-row label[data-v-6411b316]{display:flex;align-items:center;gap:5px;color:#8995ad;font-size:11px}.background-position-row input[data-v-6411b316]{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-6411b316]{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-6411b316]{min-width:0;accent-color:#675de0}.background-opacity-row b[data-v-6411b316]{color:#aeb8cc;font-size:10px;text-align:right;font-variant-numeric:tabular-nums}.language-picker[data-v-6411b316]{display:flex;height:28px;align-items:center;gap:6px;margin-left:auto;color:#9aa8c1;font-size:11px;white-space:nowrap}.language-picker select[data-v-6411b316]{height:28px;padding:0 24px 0 8px;border:1px solid #3a4963;border-radius:6px;outline:none;background:#202a3b;color:#dbe4f5;font-size:11px;cursor:pointer}.language-picker select[data-v-6411b316]:focus{border-color:#7774ff}.help-btn[data-v-6411b316]{height:28px;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-6411b316]:hover,.help-btn.on[data-v-6411b316]{border-color:#7774ff;background:#343b63;color:#fff}.zoom-pct[data-v-6411b316]{margin-left:0;font-variant-numeric:tabular-nums;color:#9aa;min-width:44px;text-align:center}.settings-btn[data-v-6411b316]{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-6411b316]:hover{border-color:#7774ff;background:#2b3a5c;color:#fff}.undo-btn[data-v-6411b316]{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-6411b316]:hover:not(:disabled){border-color:#7774ff;background:#2b3a5c;color:#fff}.undo-btn[data-v-6411b316]:disabled{opacity:.38;cursor:not-allowed}.settings-panel[data-v-c1ded952]{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-c1ded952]{display:flex;justify-content:space-between;align-items:center;font-weight:700;color:#cdf;margin-bottom:10px}.sp-section-title[data-v-c1ded952]{margin:2px 0 8px;color:#8a93bb;font-size:11px}.sp-switch-row[data-v-c1ded952]{display:flex;align-items:center;justify-content:space-between;gap:10px;color:#aab}.sp-switch-control[data-v-c1ded952]{display:inline-flex;align-items:center;gap:7px}.sp-switch-control input[data-v-c1ded952]{position:absolute;width:1px;height:1px;opacity:0;pointer-events:none}.sp-switch-ui[data-v-c1ded952]{position:relative;width:34px;height:18px;border-radius:999px;background:#39445a;cursor:pointer;transition:background .16s ease}.sp-switch-ui[data-v-c1ded952]: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-c1ded952]{background:#655df0}.sp-switch-control input:checked+.sp-switch-ui[data-v-c1ded952]:after{transform:translate(16px)}.sp-switch-control input:focus-visible+.sp-switch-ui[data-v-c1ded952]{outline:2px solid #8b86ff;outline-offset:2px}.sp-switch-control b[data-v-c1ded952]{min-width:24px;color:#8a93bb;font-size:11px;font-weight:500}.sp-cache-note[data-v-c1ded952]{margin-top:10px;padding-top:9px;border-top:1px solid #2a2a3c;color:#647089;font-size:10px;text-align:center}.sp-divider[data-v-c1ded952]{height:1px;margin:10px 0;background:#2a2a3c}.sp-close[data-v-c1ded952]{background:#2e3a55;border:none;color:#cdf;border-radius:4px;width:18px;height:18px;cursor:pointer;font-size:11px}.sp-row[data-v-c1ded952]{display:flex;align-items:center;gap:8px;margin:8px 0}.sp-row>span[data-v-c1ded952]:first-child{width:76px;flex-shrink:0;color:#8a93bb}.sp-row input[type=range][data-v-c1ded952]{flex:1;background:#1a1a28;accent-color:#3a5a8c}.sp-num[data-v-c1ded952]{width:52px;background:#1a1a28;border:1px solid #2e2e44;border-radius:5px;color:#dde;font-size:12px;padding:2px 4px}.sp-undo-limit[data-v-c1ded952]{margin-left:auto;width:64px;height:26px;box-sizing:border-box}.sp-colr[data-v-c1ded952]{width:26px;height:22px;border:none;background:none;cursor:pointer}.sp-hex[data-v-c1ded952]{font-size:11px;color:#889;font-variant-numeric:tabular-nums}.sp-chk[data-v-c1ded952]{display:flex;align-items:center;gap:6px;margin:8px 0;color:#aab}.stage-wrap[data-v-1023341a]{position:relative;width:100%;height:100%;overflow:hidden}.stage-holder[data-v-1023341a]{width:100%;height:100%;cursor:grab;touch-action:none;background-color:#0e1219;outline:none}.stage-holder.grid[data-v-1023341a]{background:conic-gradient(#141a26 90deg,transparent 90deg 180deg,#141a26 180deg 270deg,#141a26 180deg 270deg,transparent 270deg);background-size:28px 28px}.stage-holder[data-v-1023341a]:active{cursor:grabbing}.hud[data-v-1023341a]{position:absolute;bottom:12px;left:12px;padding:8px 12px;background:#141420bf;border-radius:8px;font-size:12px;color:#a0a8cc}.hud-number[data-v-1023341a]{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-1023341a]{width:3ch}.hud-particle-count[data-v-1023341a]{width:7ch;text-align:left}.hud-tip[data-v-1023341a]{margin-left:12px;color:#5f6a8a;font-size:11px}b[data-v-1023341a]{color:#fc3}.config-management-body[data-v-09679738]{padding-bottom:2px}.config-toolbar[data-v-09679738]{display:grid;grid-template-columns:auto auto minmax(0,1fr);gap:6px;margin-bottom:10px}.config-toolbar button[data-v-09679738],.config-toolbar select[data-v-09679738]{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-09679738]{padding:0 9px;cursor:pointer}.config-toolbar button[data-v-09679738]:hover{border-color:#7169dc;background:#343d68;color:#fff}.config-toolbar select[data-v-09679738]{padding:0 7px;overflow:hidden;text-overflow:ellipsis}.config-toolbar select[data-v-09679738]:disabled{color:#68738a;background:#1b2130}.config-message[data-v-09679738]{margin:-4px 0 9px;color:#83b9a2;font-size:10px}.config-message.error[data-v-09679738]{color:#e8959e}.group[data-v-09679738]{border:1px solid #2a2a3c;border-radius:8px;margin-bottom:10px;overflow:hidden}.group-head[data-v-09679738]{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-09679738]:hover{background:#20202e}.group-body[data-v-09679738]{padding:8px 10px 12px}.caret[data-v-09679738]{display:inline-block;width:12px;color:#667;font-size:11px}.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-8f475293]{display:flex;align-items:flex-start;gap:6px;width:100%}.ce-editor[data-v-8f475293]{flex:1;min-width:0}.ce-reset[data-v-8f475293]{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-8f475293]:hover{border-color:#7774ff;background:#4f4dc2;color:#fff}.ce-svg[data-v-8f475293]{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-8f475293]{stroke:#1e1e30;stroke-width:1}.ce-frame[data-v-8f475293]{stroke:#2e2e44;stroke-width:1}.ce-line[data-v-8f475293]{stroke:#6ea0e8;stroke-width:2;stroke-linejoin:round}.ce-handles line[data-v-8f475293]{stroke:#8d96b5;stroke-width:1;stroke-dasharray:3 2}.ce-handles circle[data-v-8f475293]{fill:#b7c2dd;stroke:#344d94;stroke-width:1.2;cursor:grab}.ce-handles circle[data-v-8f475293]:active{cursor:grabbing}.ce-node[data-v-8f475293]{fill:#fff;stroke:#3a55aa;stroke-width:1.6;pointer-events:none}.ce-hit[data-v-8f475293]{fill:transparent;stroke:none;cursor:grab}.ce-hit[data-v-8f475293]:active{cursor:grabbing}.ce-nav[data-v-8f475293]{display:flex;justify-content:space-between;margin-top:3px}.ce-tip[data-v-8f475293]{color:#566;font-size:10px}.spine-editor[data-v-35137928]{display:grid;gap:10px;color:#c5cbe0}.editor-title[data-v-35137928],.section-title[data-v-35137928]{color:#dce2f5;font-weight:700}.editor-title[data-v-35137928]{padding-bottom:9px;border-bottom:1px solid #30394d}.grid[data-v-35137928]{display:grid;gap:8px}.grid.three[data-v-35137928]{grid-template-columns:repeat(3,minmax(0,1fr))}.field[data-v-35137928]{display:grid;gap:5px;min-width:0;color:#919bb7;font-size:12px}.field input[data-v-35137928],.field select[data-v-35137928],.asset-name[data-v-35137928]{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-35137928]{height:1px;background:#30394d;margin:2px 0}.asset-row[data-v-35137928]{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px}.asset-name[data-v-35137928]{display:flex;align-items:center;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;color:#7f8aa7}button[data-v-35137928]{height:35px;padding:0 13px;border:1px solid #3b4a67;border-radius:6px;background:#33415b;color:#e2e6f3;cursor:pointer}button[data-v-35137928]:hover{filter:brightness(1.13)}button[data-v-35137928]:disabled{opacity:.55;cursor:wait}.folder-select[data-v-35137928]{width:100%;border-color:#6659c7;background:#4940a8;color:#fff}.folder-hint[data-v-35137928]{margin-top:-5px;color:#69758e;font-size:10px;line-height:1.45}.asset-actions[data-v-35137928]{display:grid;grid-template-columns:1fr 1fr;gap:5px}.asset-actions .load[data-v-35137928]{background:#5543df;border-color:#6959ec}.asset-actions .clear[data-v-35137928]{background:#702b34;border-color:#803842}.runtime-note[data-v-35137928]{color:#69758e;font-size:11px;text-align:center}.error[data-v-35137928]{padding:8px 10px;color:#ffabb2;background:#4b2028;border:1px solid #76323e;border-radius:6px;font-size:12px}.section-box[data-v-35137928]{display:grid;gap:8px;padding:10px;background:#182132;border:1px solid #303c54;border-radius:7px}.empty[data-v-35137928]{color:#667187;font-size:12px;padding:5px 0}.bone-tree[data-v-35137928]{max-height:240px;overflow:auto;padding:4px 0;background:#111827;border-radius:5px}.tree-title-row[data-v-35137928]{display:flex;align-items:center;justify-content:space-between;gap:8px}.tree-tabs[data-v-35137928]{display:flex;gap:3px;margin:6px 0}.tree-tabs button[data-v-35137928]{height:24px;padding:0 8px;border:1px solid transparent;border-radius:5px;background:transparent;color:#8d98ae;font-size:10px;cursor:pointer}.tree-tabs button[data-v-35137928]:hover{background:#273246}.tree-tabs button.on[data-v-35137928]{border-color:#7774ff;background:#35336b;color:#fff}.selected-bone[data-v-35137928]{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-35137928]{color:#aeb9d4;background:#242f44;border-color:#35445e;cursor:pointer}.selected-bone.active[data-v-35137928]:hover{border-color:#675ec4;background:#302b57}.selected-bone[data-v-35137928]:disabled{opacity:1;cursor:default}.selected-bone strong[data-v-35137928]{color:#c5cde3;font-weight:600}.tree-action[data-v-35137928]{height:24px;padding:0 8px;color:#9aa7c2;background:#242f44;border-color:#35445e;font-size:10px}.bone-search[data-v-35137928]{position:relative}.bone-search input[data-v-35137928]{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-35137928]:focus{border-color:#7065df;box-shadow:0 0 0 1px #7065df38}.bone-search button[data-v-35137928]{position:absolute;top:3px;right:3px;width:24px;height:24px;padding:0;border:0;color:#8d98b0;background:transparent}.bone[data-v-35137928]{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-35137928]:hover{background:#45567e38}.bone.selected[data-v-35137928]{color:#f0edff;background:#6b53dd52;box-shadow:inset 2px 0 #8e72ff}.bone[data-v-35137928]:focus-visible{box-shadow:inset 0 0 0 1px #7d72dd}.bone-toggle[data-v-35137928]{width:22px;height:22px;padding:0;border:0;background:transparent;color:#9aa7c2}.bone-toggle[data-v-35137928]:hover{background:#26324a}.bone-leaf[data-v-35137928]{display:inline-flex;width:22px;justify-content:center;color:#58647d}.bone-name[data-v-35137928]{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.slot-row[data-v-35137928]{padding-right:8px}.slot-order[data-v-35137928]{width:24px;flex:0 0 24px;color:#66758e;font-size:10px;font-variant-numeric:tabular-nums;text-align:right}.slot-attachment[data-v-35137928]{margin-left:auto;max-width:45%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#6d7c96;font-size:10px}@media(max-width:430px){.grid.three[data-v-35137928]{grid-template-columns:1fr}}.panel[data-v-5573409f]{display:flex;width:100%;height:100%;flex-direction:column;overflow:hidden;background:#14141f;border-left:1px solid #2a2a3c;padding:12px;box-sizing:border-box}.empty[data-v-5573409f],.panel-hint[data-v-5573409f]{color:#667;font-size:12px;padding:8px 0}.group[data-v-5573409f]{border:1px solid #2a2a3c;border-radius:8px;margin-bottom:10px;overflow:hidden}.group-head[data-v-5573409f]{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-5573409f]:hover{background:#20202e}.scene-head[data-v-5573409f]{padding-right:6px}.scene-actions[data-v-5573409f]{margin-left:auto;display:flex;align-items:center;gap:4px}.scene-add[data-v-5573409f]{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-5573409f]:hover{border-color:#7774ff;background:#45426f;color:#fff}.scene-add[data-v-5573409f]:disabled{opacity:.42;cursor:not-allowed;border-color:#343a4b;background:#252a38;color:#778095}.group-body[data-v-5573409f]{padding:8px 10px 12px}.caret[data-v-5573409f]{display:inline-block;width:12px;color:#667;font-size:11px}.tree[data-v-5573409f]{margin-bottom:8px}.tree-item[data-v-5573409f]{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-5573409f]{background:#26324a;color:#ffe}.tree-item .tdot[data-v-5573409f]{color:#fc3;font-size:10px}.tree-item .tdot.dim[data-v-5573409f]{color:#556}.tree-item .tdot.collision-dot[data-v-5573409f]{color:#ff7070}.tree-item .tdot.path-dot[data-v-5573409f]{color:#ff933e;font-size:14px}.tree-item .tdot.spine-dot[data-v-5573409f]{color:#c08cff;font-size:11px}.tree-item .sub-branch[data-v-5573409f]{color:#5f7090;font-size:12px}.tree-item .tlabel[data-v-5573409f]{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.scene-tree[data-v-5573409f]{padding-bottom:8px;border-bottom:1px solid #2a2a3c}.scene-object-item[data-v-5573409f]{min-height:28px;cursor:pointer}.scene-object-item[data-v-5573409f]:hover{background:#202b40}.scene-object-child[data-v-5573409f]{background:#1e2a3e59}.scene-object-kind[data-v-5573409f]{color:#75829c;font-size:10px}.scene-object-kind.sub-emitter-kind[data-v-5573409f]{color:#8f8cff}.scene-object-eye[data-v-5573409f]{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-5573409f]:hover{border-color:#4b5972;background:#29354a;color:#e1e7f4}.scene-object-eye.off[data-v-5573409f]{color:#59647a}.scene-object-eye svg[data-v-5573409f]{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-5573409f]{stroke:#d47b88;stroke-width:2}.scene-object-delete[data-v-5573409f]{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-5573409f]:hover{border-color:#a45c69;background:#57303a;color:#fff}.object-editor-title[data-v-5573409f]{margin:10px 0 8px;padding-top:8px;border-top:1px solid #2a2a3c;color:#cbd4e8;font-weight:700}.field-block[data-v-5573409f]{display:flex;flex-direction:column;gap:5px;margin:10px 0;color:#8f9ab3;font-size:11px}.field-block>.inp[data-v-5573409f]{width:100%;box-sizing:border-box;min-height:30px}.field-block small[data-v-5573409f]{color:#5f6d86;line-height:1.5}.field-grid[data-v-5573409f]{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px;align-items:end}.compact-field[data-v-5573409f]{display:flex;min-width:0;flex-direction:column;gap:5px;margin:5px 0;color:#8f9ab3;font-size:11px}.compact-field .inp[data-v-5573409f]{width:100%;min-height:30px;box-sizing:border-box}.check-field[data-v-5573409f]{align-items:flex-start}.check-field input[data-v-5573409f]{width:18px;height:18px;margin:4px 0;accent-color:#4f7ee8}.follow-path[data-v-5573409f],.setting-line[data-v-5573409f]{display:flex;align-items:center;gap:8px;margin:12px 0 4px;color:#aeb8cf;font-size:12px}.setting-line[data-v-5573409f]{justify-content:space-between}.follow-path input[data-v-5573409f],.setting-line input[type=checkbox][data-v-5573409f]{width:17px;height:17px;accent-color:#4f7ee8}.collider-follow-section[data-v-5573409f]{margin-top:12px;padding-top:4px;border-top:1px solid #30394d}.collider-curve-title[data-v-5573409f]{display:flex;flex-direction:column;gap:3px;margin:12px 0 6px;color:#aeb8cf;font-size:12px}.collider-curve-title small[data-v-5573409f]{color:#67738c;font-size:10px;line-height:1.45}.path-color[data-v-5573409f]{width:48px;height:28px;padding:0;border:1px solid #3a4963;background:transparent;cursor:pointer}.path-help[data-v-5573409f]{margin:12px 0;color:#7d89a2;font-size:11px;line-height:1.55}.path-help>span[data-v-5573409f]{color:#aeb8cf}.path-help ul[data-v-5573409f]{margin:6px 0 0;padding-left:20px}.path-help li[data-v-5573409f]{margin:3px 0}.path-action[data-v-5573409f]{width:100%;height:31px;margin-top:7px;border:0;border-radius:5px;background:#33425b;color:#c9d1e1;cursor:pointer}.path-action[data-v-5573409f]:hover{filter:brightness(1.12)}.path-action.primary[data-v-5573409f]{background:#f05408;color:#fff}.row[data-v-5573409f]{display:flex;align-items:center;gap:8px;margin:6px 0;font-size:12px;color:#aab}.row>span[data-v-5573409f]:first-child{width:60px;flex-shrink:0;color:#8a93bb}.inp[data-v-5573409f]{flex:1;min-width:0;padding:3px 5px;background:#1a1a28;border:1px solid #2e2e44;border-radius:5px;color:#dde;font-size:12px}.inp.tiny[data-v-5573409f]{width:46px;flex:0 0 46px;text-align:center}.seed-row[data-v-5573409f]{display:flex;align-items:center;gap:8px;margin-top:12px;padding-top:12px;border-top:1px solid #2d3950}.seed-row label[data-v-5573409f]{width:64px;color:#8f9bb5;font-size:12px}.seed-input[data-v-5573409f]{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-5573409f]:focus{border-color:#625ff1}.seed-random[data-v-5573409f]{width:34px;height:30px;border:1px solid #3a4860;border-radius:6px;background:#2c3950;color:#d7def0;cursor:pointer}.seed-random[data-v-5573409f]:hover{background:#394964}.scene-seed[data-v-5573409f]{margin-top:10px}.seed-hint[data-v-5573409f]{margin:5px 0 1px 72px;color:#657188;font-size:9px;line-height:1.45}.group[data-v-dec7323c]{border:1px solid #2a2a3c;border-radius:8px;margin-bottom:10px;overflow:hidden}.group-head[data-v-dec7323c]{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-dec7323c]:hover{background:#20202e}.group-reset[data-v-dec7323c]{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-dec7323c]:hover{border-color:#7774ff;background:#45426f;color:#fff}.group-body[data-v-dec7323c]{padding:8px 10px 12px}.caret[data-v-dec7323c]{display:inline-block;width:12px;color:#667;font-size:11px}.divider[data-v-dec7323c]{height:1px;background:#2a2a3c;margin:8px 0}.row[data-v-dec7323c]{display:flex;align-items:center;gap:8px;margin:6px 0;font-size:12px;color:#aab}.row>span[data-v-dec7323c]:first-child{width:60px;flex-shrink:0;color:#8a93bb}.inp[data-v-dec7323c]{flex:1;min-width:0;padding:3px 5px;background:#1a1a28;border:1px solid #2e2e44;border-radius:5px;color:#dde;font-size:12px}.segs[data-v-dec7323c]{display:flex;gap:6px;margin:6px 0}.stream-behavior-segs[data-v-dec7323c]{margin-top:10px}.stream-loop-options[data-v-dec7323c]{display:grid;gap:8px;margin:8px 0 4px;padding:9px 10px;border:1px solid #32405a;border-radius:6px;background:#171f2e}.loop-section-row[data-v-dec7323c]{display:flex;min-height:27px;align-items:center;justify-content:space-between;gap:8px}.loop-duration-control[data-v-dec7323c]{display:flex;flex:0 0 auto;align-items:center;gap:7px}.loop-duration-toggle[data-v-dec7323c]{gap:5px;font-size:10px;white-space:nowrap}.loop-duration-toggle .switch-ui[data-v-dec7323c]{width:26px;height:14px}.loop-duration-toggle .switch-ui[data-v-dec7323c]:after{width:10px;height:10px}.loop-duration-toggle input:checked+.switch-ui[data-v-dec7323c]:after{transform:translate(12px)}.loop-section-duration[data-v-dec7323c]{display:flex;flex:0 0 auto;align-items:center;gap:4px;color:#7f8ba4;font-size:11px}.loop-section-duration input[data-v-dec7323c]{position:static;width:54px;height:25px;padding:0 6px;border:1px solid #3a465f;border-radius:5px;outline:none;background:#101725;color:#e4e8f2;text-align:right;opacity:1;pointer-events:auto}.loop-section-duration input[data-v-dec7323c]:focus{border-color:#716eff}.loop-auto-duration[data-v-dec7323c]{min-width:54px;color:#77839a;text-align:right;white-space:nowrap}.seg[data-v-dec7323c]{flex:1;padding:5px;background:#1e1e2e;border:1px solid #2e2e44;border-radius:6px;color:#aab;font-size:12px;cursor:pointer}.seg.on[data-v-dec7323c]{background:#3a5a8c;color:#fff;border-color:#5a7ab8}.seg[data-v-dec7323c]{display:flex;gap:6px;margin:6px 0}.inp.tiny[data-v-dec7323c]{width:46px;flex:0 0 46px;text-align:center}.switch-row[data-v-dec7323c]{display:flex;align-items:center;gap:9px;color:#b8c1d5;font-size:12px;cursor:pointer}.switch-row input[data-v-dec7323c]{position:absolute;opacity:0;pointer-events:none}.switch-ui[data-v-dec7323c]{position:relative;width:32px;height:18px;border-radius:10px;background:#354258;transition:background .16s ease}.switch-ui[data-v-dec7323c]: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-dec7323c]{background:#625ff1}.switch-row input:checked+.switch-ui[data-v-dec7323c]:after{transform:translate(14px)}.modifier-hint[data-v-dec7323c]{margin:7px 0 0 2px;color:#647086;font-size:9px;line-height:1.5}.stream-loop-hint[data-v-dec7323c]{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-dec7323c]{opacity:.45;cursor:not-allowed}.pac[data-v-a3a8dde3]{padding:10px;margin:8px 0;border:1px solid #2c3850;border-radius:7px;background:#171d2a}.pac-head[data-v-a3a8dde3]{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:7px}.pac-label[data-v-a3a8dde3]{color:#aeb8cf;font-size:12px;font-weight:600;white-space:nowrap}.pac-modes[data-v-a3a8dde3]{display:flex;gap:4px;flex-wrap:wrap;justify-content:flex-end}.pac-mode[data-v-a3a8dde3]{padding:4px 7px;border:1px solid #344158;border-radius:5px;background:#273246;color:#aeb8cf;font-size:11px;cursor:pointer}.pac-mode.on[data-v-a3a8dde3]{border-color:#7774ff;background:#605df0;color:#fff}.pac-curve[data-v-a3a8dde3]{margin-top:8px}.pac-axis[data-v-a3a8dde3]{display:flex;justify-content:space-between;margin-top:3px;color:#5f6b82;font-size:10px}.pac[data-v-a3a8dde3] .ns-label{width:58px}.pac[data-v-a3a8dde3] .ce-svg{height:96px;background:#0f1625;border-color:#30405a}.pac[data-v-a3a8dde3] .ce-tip{color:#657188}.group[data-v-3bbf0b5e]{border:1px solid #2a2a3c;border-radius:8px;margin-bottom:10px;overflow:hidden}.group-head[data-v-3bbf0b5e]{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-3bbf0b5e]:hover{background:#20202e}.group-reset[data-v-3bbf0b5e]{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-3bbf0b5e]:hover{border-color:#7774ff;background:#45426f;color:#fff}.group-body[data-v-3bbf0b5e]{padding:8px 10px 12px}.caret[data-v-3bbf0b5e]{display:inline-block;width:12px;color:#667;font-size:11px}.row[data-v-3bbf0b5e]{display:flex;align-items:center;gap:8px;margin:6px 0;font-size:12px;color:#aab}.row>span[data-v-3bbf0b5e]:first-child{width:60px;flex-shrink:0;color:#8a93bb}.attr-body[data-v-3bbf0b5e]{padding:10px;background:#151b27}.attr-section-title[data-v-3bbf0b5e]{margin:2px 0 8px;color:#9ca8c0;font-size:12px;font-weight:700}.attr-section-title.life-title[data-v-3bbf0b5e]{margin-top:14px;padding-top:12px;border-top:1px solid #2d3950}.attr-axis-head[data-v-3bbf0b5e]{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-3bbf0b5e]{display:flex;gap:4px}.axis-mode[data-v-3bbf0b5e]{padding:4px 8px;border:1px solid #344158;border-radius:5px;background:#273246;color:#aeb8cf;font-size:11px;cursor:pointer}.axis-mode.on[data-v-3bbf0b5e]{border-color:#7774ff;background:#605df0;color:#fff}.life-item[data-v-3bbf0b5e]{padding:9px 0;border-bottom:1px solid #2a3549}.switch-row[data-v-3bbf0b5e]{display:flex;align-items:center;gap:9px;color:#b8c1d5;font-size:12px;cursor:pointer}.switch-row input[data-v-3bbf0b5e]{position:absolute;opacity:0;pointer-events:none}.switch-ui[data-v-3bbf0b5e]{position:relative;width:32px;height:18px;border-radius:10px;background:#354258;transition:background .16s ease}.switch-ui[data-v-3bbf0b5e]: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-3bbf0b5e]{background:#625ff1}.switch-row input:checked+.switch-ui[data-v-3bbf0b5e]:after{transform:translate(14px)}.life-axis[data-v-3bbf0b5e]{margin:9px 0 2px 42px}.switch-row input:disabled+.switch-ui[data-v-3bbf0b5e]{opacity:.45;cursor:not-allowed}.gradient-editor[data-v-cb6cfaf8]{margin:8px 0 11px 68px}.gradient-bar[data-v-cb6cfaf8]{position:relative;height:18px;margin-bottom:14px;border:1px solid #465570;border-radius:6px;cursor:crosshair}.gradient-stop[data-v-cb6cfaf8]{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-cb6cfaf8]: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-cb6cfaf8]{outline:2px solid #7774ff;outline-offset:1px;z-index:2}.gradient-stop[data-v-cb6cfaf8]:active{cursor:grabbing}.gradient-controls[data-v-cb6cfaf8]{display:flex;align-items:center;gap:5px;margin-top:30px}.gradient-color[data-v-cb6cfaf8]{width:28px;height:24px;padding:1px;border:1px solid #465570;border-radius:4px;background:#151b27;cursor:pointer}.gradient-hex-input[data-v-cb6cfaf8]{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-cb6cfaf8]:focus{border-color:#7774ff;color:#fff}.gradient-position[data-v-cb6cfaf8]{display:flex;align-items:center;color:#71809a;font-size:10px}.gradient-position input[data-v-cb6cfaf8]{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-cb6cfaf8]{width:25px;height:24px;padding:0;border:1px solid #3a4860;border-radius:4px;background:#273246;color:#cbd4e5;cursor:pointer}.gradient-action[data-v-cb6cfaf8]:hover:not(:disabled){border-color:#7774ff;color:#fff}.gradient-action.danger[data-v-cb6cfaf8]{color:#e3a5aa}.gradient-action[data-v-cb6cfaf8]:disabled{opacity:.35;cursor:not-allowed}.gradient-hint[data-v-cb6cfaf8]{margin-top:5px;color:#59667b;font-size:9px}.pivot-editor[data-v-a5622844]{margin-top:8px;padding:8px;border:1px solid #2e3c55;border-radius:8px;background:#121a27}.pivot-toolbar[data-v-a5622844]{display:flex;align-items:center;gap:7px;margin-bottom:7px}.pivot-hint[data-v-a5622844]{flex:1;min-width:0;display:flex;align-items:center;gap:5px;color:#9aa8c4;font-size:10px;line-height:1.3}.pivot-hint-icon[data-v-a5622844]{color:#8f8cff;font-size:13px}.pivot-zoom[data-v-a5622844]{display:flex;align-items:center;gap:2px;padding:2px;border:1px solid #34435e;border-radius:6px;background:#182234}.pivot-zoom button[data-v-a5622844]{width:20px;height:20px;padding:0;border:0;border-radius:4px;background:transparent;color:#a9b6d0;font-size:13px;cursor:pointer}.pivot-zoom button[data-v-a5622844]:hover:not(:disabled){background:#2a3853;color:#fff}.pivot-zoom button[data-v-a5622844]:disabled{opacity:.3;cursor:default}.pivot-zoom span[data-v-a5622844]{min-width:36px;text-align:center;color:#c7d1e6;font-size:10px;font-variant-numeric:tabular-nums}.pivot-expand[data-v-a5622844]{width:24px;height:24px;padding:0;border:1px solid #34435e;border-radius:6px;background:#182234;color:#a9b6d0;font-size:13px;cursor:pointer}.pivot-expand[data-v-a5622844]:hover{border-color:#7774ff;color:#fff}.pivot-stage[data-v-a5622844]{position:relative;display:flex;align-items:center;justify-content:center;width:100%;height:156px;overflow:hidden;border:1px solid #2f3d57;border-radius:8px;background-color:#10161f;background-image:linear-gradient(45deg,#1a2230 25%,transparent 25%),linear-gradient(-45deg,#1a2230 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#1a2230 75%),linear-gradient(-45deg,transparent 75%,#1a2230 75%);background-size:16px 16px;background-position:0 0,0 8px,8px -8px,-8px 0;touch-action:none;cursor:crosshair}.pivot-large .pivot-stage[data-v-a5622844]{height:340px;background-size:22px 22px;background-position:0 0,0 11px,11px -11px,-11px 0}.pivot-stage.panning[data-v-a5622844]{cursor:grabbing}.pivot-box[data-v-a5622844]{position:relative;flex:0 0 auto}.pivot-box>img[data-v-a5622844]{display:block;width:100%;height:100%;object-fit:fill;-webkit-user-select:none;user-select:none;pointer-events:none}.pivot-empty[data-v-a5622844]{color:#4e5a70;font-size:12px}.pivot-cross[data-v-a5622844]{position:absolute;pointer-events:none;background:#7e76ffbf;box-shadow:0 0 3px #7e76ff99}.pivot-cross.vertical[data-v-a5622844]{top:0;bottom:0;width:1px;transform:translate(-.5px)}.pivot-cross.horizontal[data-v-a5622844]{left:0;right:0;height:1px;transform:translateY(-.5px)}.pivot-marker[data-v-a5622844]{position:absolute;width:13px;height:13px;transform:translate(-50%,-50%);border:2px solid #c9c6ff;border-radius:50%;background:#605ff0d9;box-shadow:0 0 0 3px #605ff047,0 0 10px #605ff0cc;pointer-events:none}.pivot-badge[data-v-a5622844]{position:absolute;transform:translate(-50%,14px);padding:2px 6px;border:1px solid #6f6bc7;border-radius:4px;background:#191c3aeb;color:#b9b6ff;font-size:9px;white-space:nowrap;pointer-events:none}.pivot-bottom[data-v-a5622844]{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px;margin-top:8px}.pivot-large .pivot-bottom[data-v-a5622844]{gap:14px;margin-top:14px}.pivot-card[data-v-a5622844]{min-width:0;padding:7px;border:1px solid #28344a;border-radius:8px;background:#151d2b}.pivot-card-head[data-v-a5622844]{display:flex;align-items:center;justify-content:space-between;gap:5px;margin-bottom:6px;color:#b9c4da;font-size:10px}.pivot-card-icon[data-v-a5622844]{color:#8f8cff}.pivot-presets[data-v-a5622844]{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px}.pivot-preset[data-v-a5622844]{height:30px;padding:0;border:1px solid #2f3d57;border-radius:5px;background:#1b2537;color:#aab6cf;font-size:16px;line-height:1;cursor:pointer}.pivot-preset[data-v-a5622844]:hover{border-color:#5d5aa8;color:#d9d8ff}.pivot-preset.on[data-v-a5622844]{border-color:#7774ff;background:#4a47b5;color:#fff}.pivot-reset[data-v-a5622844]{display:block;width:100%;height:26px;margin-top:6px;padding:0 6px;border:1px solid #2f3d57;border-radius:5px;background:#1a2435;color:#96a4c0;font-size:10px;cursor:pointer;white-space:nowrap}.pivot-reset[data-v-a5622844]:hover{border-color:#5d5aa8;background:#232f46;color:#d9d8ff}.pivot-coords[data-v-a5622844]{display:flex;flex-direction:column;gap:5px}.pivot-large .pivot-coords[data-v-a5622844]{flex-direction:row;gap:8px}.pivot-coords label[data-v-a5622844]{flex:1;display:flex;align-items:center;gap:3px;color:#8d9ab5;font-size:10px}.pivot-coords input[data-v-a5622844]{width:100%;min-width:0;height:24px;padding:0 4px;border:1px solid #34435e;border-radius:4px;background:#101827;color:#f0b465;font-size:11px;text-align:right}.pivot-rotate-head[data-v-a5622844]{margin-top:10px}.pivot-rotate-state[data-v-a5622844]{color:#6f7c96;font-size:9px}.pivot-rotate-body[data-v-a5622844]{display:flex;align-items:center;gap:7px}.pivot-rotate-modes[data-v-a5622844]{display:flex;flex-direction:column;gap:4px;flex:1}.pivot-rotate-modes button[data-v-a5622844]{height:24px;padding:0 5px;border:1px solid #2f3d57;border-radius:5px;background:#1b2537;color:#93a0ba;font-size:9px;cursor:pointer}.pivot-rotate-modes button.on[data-v-a5622844]{border-color:#7774ff;background:#4a47b5;color:#fff}.pivot-rotate-preview[data-v-a5622844]{display:flex;align-items:center;justify-content:center;width:78px;height:78px;flex:0 0 78px;border:1px solid #2b374d;border-radius:6px;background:#10161f;overflow:hidden}.pivot-large .pivot-rotate-preview[data-v-a5622844]{width:128px;height:128px;flex-basis:128px}.pivot-rotate-preview img[data-v-a5622844]{display:block}.pivot-rotate-preview img.spin[data-v-a5622844]{animation:pivot-spin-a5622844 2s linear infinite}.pivot-rotate-preview img.swing[data-v-a5622844]{animation:pivot-swing-a5622844 1.1s ease-in-out infinite alternate}@keyframes pivot-spin-a5622844{to{transform:rotate(360deg)}}@keyframes pivot-swing-a5622844{0%{transform:rotate(-28deg)}to{transform:rotate(28deg)}}.pivot-large .pivot-hint[data-v-a5622844],.pivot-large .pivot-card-head[data-v-a5622844]{font-size:12px}.pivot-large .pivot-preset[data-v-a5622844]{height:42px;font-size:20px}.pivot-large .pivot-reset[data-v-a5622844]{height:34px;margin-top:8px;font-size:12px}.pivot-large .pivot-coords input[data-v-a5622844]{height:34px;font-size:14px}.pivot-large .pivot-rotate-modes button[data-v-a5622844]{height:34px;font-size:12px}.image-card[data-v-89f1e08d]{margin:8px 0;padding:9px;border:1px solid #2e3c55;border-radius:7px;background:#171d2a}.imgrow[data-v-89f1e08d]{display:flex;align-items:flex-start;gap:8px}.img-thumb[data-v-89f1e08d]{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-89f1e08d]:hover{border-color:#7774ff}.img-thumb img[data-v-89f1e08d]{display:block;width:100%;height:100%;object-fit:contain}.img-fields[data-v-89f1e08d]{flex:1;min-width:0}.img-actions[data-v-89f1e08d]{display:flex;flex-direction:column;gap:4px}.row[data-v-89f1e08d]{display:flex;align-items:center;gap:8px;margin:6px 0;color:#aab;font-size:12px}.row>span[data-v-89f1e08d]:first-child{width:60px;flex-shrink:0;color:#8a93bb}.inp[data-v-89f1e08d]{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-89f1e08d]{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-89f1e08d]:hover{background:#2b3a5c}.mini-btn2[data-v-89f1e08d]:disabled{opacity:.35;cursor:not-allowed}.thumb-note[data-v-89f1e08d]{margin:4px 0 2px;color:#667;font-size:11px}.sequence-pick[data-v-89f1e08d]{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-89f1e08d]:hover{border-color:#7774ff;background:#35336a}.sequence-note[data-v-89f1e08d]{margin:0 0 6px;color:#727b9b;font-size:11px;line-height:1.4}.resource-weight-row[data-v-89f1e08d]{display:grid;grid-template-columns:minmax(0,1fr) 28px;align-items:center;gap:7px}.resource-weight-control[data-v-89f1e08d]{width:100%;min-width:0}.resource-weight-control[data-v-89f1e08d] .ns-range{min-width:0}.resource-weight-control[data-v-89f1e08d] .ns-num{flex:0 0 56px;box-sizing:border-box}.weight-lock[data-v-89f1e08d]{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-89f1e08d]{display:block;width:100%;height:100%;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.weight-lock[data-v-89f1e08d]:hover:not(:disabled){border-color:#7774ff;color:#b8b6ff}.weight-lock.on[data-v-89f1e08d]{border-color:#7774ff;background:#514fd0;color:#fff}.weight-lock[data-v-89f1e08d]:disabled{opacity:.35;cursor:not-allowed}.pivot-toggle-row[data-v-89f1e08d]{display:flex;align-items:center;gap:9px;margin-top:9px;padding:8px 9px;border:1px solid #2c3a54;border-radius:8px;background:#131b28}.pivot-toggle-icon[data-v-89f1e08d]{display:flex;align-items:center;justify-content:center;width:32px;height:32px;flex:0 0 32px;border:1px solid #35435c;border-radius:7px;background:#1c2638;color:#8f8cff;font-size:17px}.pivot-toggle-text[data-v-89f1e08d]{flex:1;min-width:0}.pivot-toggle-title[data-v-89f1e08d]{color:#d6deee;font-size:12px;font-weight:600}.pivot-toggle-sub[data-v-89f1e08d]{margin-top:2px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#7584a0;font-size:9px}.pivot-switch[data-v-89f1e08d]{position:relative;flex:0 0 auto;cursor:pointer}.pivot-switch input[data-v-89f1e08d]{position:absolute;opacity:0;pointer-events:none}.pivot-switch-ui[data-v-89f1e08d]{position:relative;display:block;width:34px;height:19px;border-radius:10px;background:#354258;transition:background .16s ease}.pivot-switch-ui[data-v-89f1e08d]:after{content:"";position:absolute;left:2px;top:2px;width:15px;height:15px;border-radius:50%;background:#fff;transition:transform .16s ease}.pivot-switch input:checked+.pivot-switch-ui[data-v-89f1e08d]{background:#625ff1}.pivot-switch input:checked+.pivot-switch-ui[data-v-89f1e08d]:after{transform:translate(15px)}.pivot-modal-backdrop[data-v-89f1e08d]{position:fixed;top:0;right:0;bottom:0;left:0;z-index:9999;display:flex;align-items:center;justify-content:center;padding:24px;background:#06090fc7;-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px)}.pivot-modal[data-v-89f1e08d]{display:flex;flex-direction:column;width:min(980px,94vw);max-height:92vh;overflow:auto;padding:14px;border:1px solid #2f3f5c;border-radius:14px;background:#121927;box-shadow:0 24px 70px #0009}.pivot-modal-head[data-v-89f1e08d]{display:flex;align-items:flex-start;gap:10px;padding-bottom:10px;border-bottom:1px solid #253148}.pivot-modal-icon[data-v-89f1e08d]{display:flex;align-items:center;justify-content:center;width:34px;height:34px;flex:0 0 34px;border:1px solid #3b4a66;border-radius:8px;background:#1c2638;color:#8f8cff;font-size:18px}.pivot-modal-info[data-v-89f1e08d]{flex:1;min-width:0}.pivot-modal-title[data-v-89f1e08d]{display:flex;align-items:center;gap:7px;color:#e4e9f5;font-size:15px;font-weight:700}.pivot-modal-badge[data-v-89f1e08d]{padding:2px 7px;border:1px solid #4b4a8f;border-radius:999px;background:#2c2b58;color:#b9b6ff;font-size:10px;font-weight:500}.pivot-modal-desc[data-v-89f1e08d]{margin-top:3px;color:#7f8daa;font-size:11px}.pivot-modal-close[data-v-89f1e08d]{width:28px;height:28px;padding:0;border:0;border-radius:6px;background:transparent;color:#8b98b3;font-size:15px;cursor:pointer}.pivot-modal-close[data-v-89f1e08d]:hover{background:#253148;color:#fff}.pivot-modal-hint[data-v-89f1e08d]{margin:10px 0 0;color:#8b98b3;font-size:11px}.pivot-modal-actions[data-v-89f1e08d]{display:flex;justify-content:flex-end;gap:8px;margin-top:12px;padding-top:10px;border-top:1px solid #253148}.pivot-modal-cancel[data-v-89f1e08d]{height:34px;padding:0 16px;border:1px solid #34435e;border-radius:7px;background:#1a2334;color:#a9b6d0;font-size:12px;cursor:pointer}.pivot-modal-cancel[data-v-89f1e08d]:hover{border-color:#5d5aa8;color:#fff}.pivot-modal-confirm[data-v-89f1e08d]{height:34px;padding:0 22px;border:1px solid #7774ff;border-radius:7px;background:#5b57e8;color:#fff;font-size:12px;font-weight:700;cursor:pointer}.pivot-modal-confirm[data-v-89f1e08d]:hover{background:#6a66ff}.group[data-v-86902cc8]{border:1px solid #2a2a3c;border-radius:8px;margin-bottom:10px;overflow:hidden}.group-head[data-v-86902cc8]{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-86902cc8]:hover{background:#20202e}.group-reset[data-v-86902cc8]{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-86902cc8]:hover{border-color:#7774ff;background:#45426f;color:#fff}.group-body[data-v-86902cc8]{padding:8px 10px 12px}.caret[data-v-86902cc8]{display:inline-block;width:12px;color:#667;font-size:11px}.divider[data-v-86902cc8]{height:1px;background:#2a2a3c;margin:8px 0}.row[data-v-86902cc8]{display:flex;align-items:center;gap:8px;margin:6px 0;font-size:12px;color:#aab}.row>span[data-v-86902cc8]:first-child{width:60px;flex-shrink:0;color:#8a93bb}.inp[data-v-86902cc8]{flex:1;min-width:0;padding:3px 5px;background:#1a1a28;border:1px solid #2e2e44;border-radius:5px;color:#dde;font-size:12px}.colr[data-v-86902cc8]{width:28px;height:22px;border:none;background:none;cursor:pointer}.seg[data-v-86902cc8]{flex:1;padding:5px;background:#1e1e2e;border:1px solid #2e2e44;border-radius:6px;color:#aab;font-size:12px;cursor:pointer}.seg.on[data-v-86902cc8]{background:#3a5a8c;color:#fff;border-color:#5a7ab8}.look-title[data-v-86902cc8]{font-size:12px;font-weight:600;color:#ccd;margin:10px 0 6px;padding-bottom:4px;border-bottom:1px solid #2a2a3c}.look-title[data-v-86902cc8]:first-child{margin-top:2px}.seg[data-v-86902cc8]{display:flex;gap:6px;margin:6px 0}.seg-btn[data-v-86902cc8]{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-86902cc8]{background:#3a5a8c;color:#fff;border-color:#5a7ab8}.curve-wrap[data-v-86902cc8]{margin:6px 0}.curve-labels[data-v-86902cc8]{display:flex;justify-content:space-between;color:#566;font-size:10px;margin-top:2px}.image-title[data-v-86902cc8]{display:flex;align-items:center;justify-content:space-between}.image-add[data-v-86902cc8]{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-86902cc8]:hover{background:#4542a8;color:#fff}.resource-divider[data-v-86902cc8]{height:1px;margin:9px 0 7px;background:#2a3549}.resource-color-row .blend-select[data-v-86902cc8]{max-width:88px}.resource-color-picker .hex[data-v-86902cc8]{margin-left:0}.random-color-hint[data-v-86902cc8]{margin:-5px 0 9px 68px;color:#66758e;font-size:9px;line-height:1.45}.hex-input[data-v-86902cc8]{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-86902cc8]:focus{border-color:#7774ff;color:#fff}.resource-alpha-head[data-v-86902cc8]{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:10px;color:#8a93bb;font-size:12px}.alpha-modes[data-v-86902cc8]{display:flex;gap:3px}.alpha-modes button[data-v-86902cc8]{padding:4px 8px;border:1px solid transparent;border-radius:5px;background:transparent;color:#8d98ae;font-size:11px;cursor:pointer}.alpha-modes button[data-v-86902cc8]:hover{background:#273246}.alpha-modes button.on[data-v-86902cc8]{border-color:#7774ff;background:#605df0;color:#fff}.resource-alpha-curve[data-v-86902cc8]{margin-top:7px}.file-input[data-v-86902cc8]{display:none}.hex[data-v-86902cc8]{font-size:11px;color:#889;margin-left:auto;font-variant-numeric:tabular-nums}.inp.tiny[data-v-86902cc8]{width:46px;flex:0 0 46px;text-align:center}.render-layer-current[data-v-86902cc8]{display:flex;align-items:center;gap:6px;margin:6px 0}.render-layer-text[data-v-86902cc8]{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#9aa6c2;font-size:11px}.mini-btn[data-v-86902cc8]{flex:0 0 auto;height:24px;padding:0 7px;border:1px solid #3d4a66;border-radius:5px;background:#202a3e;color:#a9b5cf;font-size:10px;cursor:pointer}.mini-btn[data-v-86902cc8]:hover{border-color:#7774ff;color:#fff}.mini-btn.ghost[data-v-86902cc8]{background:transparent}.slot-picker[data-v-86902cc8]{margin:6px 0;padding:6px;border:1px solid #2e3a52;border-radius:6px;background:#111a28}.slot-list[data-v-86902cc8]{max-height:180px;overflow:auto;margin-top:6px}.slot-item[data-v-86902cc8]{display:flex;align-items:center;gap:6px;width:100%;padding:4px 6px;border:1px solid transparent;border-radius:4px;background:transparent;color:#aab4cc;font-size:11px;text-align:left;cursor:pointer}.slot-item[data-v-86902cc8]:hover{background:#1d2a3f}.slot-item.on[data-v-86902cc8]{border-color:#7774ff;background:#2b2b55;color:#fff}.slot-order[data-v-86902cc8]{width:26px;flex:0 0 26px;color:#66758e;font-variant-numeric:tabular-nums}.slot-name[data-v-86902cc8]{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.slot-attachment[data-v-86902cc8]{max-width:45%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#6d7c96;font-size:10px}.switch-row[data-v-86902cc8]{display:flex;align-items:center;gap:9px;color:#b8c1d5;font-size:12px;cursor:pointer}.switch-row input[data-v-86902cc8]{position:absolute;opacity:0;pointer-events:none}.switch-ui[data-v-86902cc8]{position:relative;width:32px;height:18px;border-radius:10px;background:#354258;transition:background .16s ease}.switch-ui[data-v-86902cc8]: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-86902cc8]{background:#625ff1}.switch-row input:checked+.switch-ui[data-v-86902cc8]:after{transform:translate(14px)}.switch-row input:disabled+.switch-ui[data-v-86902cc8]{opacity:.45;cursor:not-allowed}.render-layer-switch[data-v-86902cc8]{margin:6px 0}.modifier-hint[data-v-86902cc8]{margin:7px 0 0 2px;color:#647086;font-size:9px;line-height:1.5}.render-layer-warning[data-v-86902cc8]{color:#d8a45e}.empty[data-v-f5ccc52c]{color:#667;font-size:12px;padding:8px 0}.group[data-v-f5ccc52c]{border:1px solid #2a2a3c;border-radius:8px;margin-bottom:10px;overflow:hidden}.group-head[data-v-f5ccc52c]{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-f5ccc52c]:hover{background:#20202e}.group-reset[data-v-f5ccc52c]{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-f5ccc52c]:hover{border-color:#7774ff;background:#45426f;color:#fff}.group-body[data-v-f5ccc52c]{padding:8px 10px 12px}.caret[data-v-f5ccc52c]{display:inline-block;width:12px;color:#667;font-size:11px}.divider[data-v-f5ccc52c]{height:1px;background:#2a2a3c;margin:8px 0}.field-block[data-v-f5ccc52c]{display:flex;flex-direction:column;gap:5px;margin:10px 0;color:#8f9ab3;font-size:11px}.field-block>.inp[data-v-f5ccc52c]{width:100%;box-sizing:border-box;min-height:30px}.field-block small[data-v-f5ccc52c]{color:#5f6d86;line-height:1.5}.field-grid[data-v-f5ccc52c]{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px;align-items:end}.compact-field[data-v-f5ccc52c]{display:flex;min-width:0;flex-direction:column;gap:5px;margin:5px 0;color:#8f9ab3;font-size:11px}.compact-field .inp[data-v-f5ccc52c]{width:100%;min-height:30px;box-sizing:border-box}.tag[data-v-f5ccc52c]{font-size:10px;color:#667;background:#1c1c2a;border-radius:4px;padding:1px 5px}.row[data-v-f5ccc52c]{display:flex;align-items:center;gap:8px;margin:6px 0;font-size:12px;color:#aab}.row>span[data-v-f5ccc52c]:first-child{width:60px;flex-shrink:0;color:#8a93bb}.inp[data-v-f5ccc52c]{flex:1;min-width:0;padding:3px 5px;background:#1a1a28;border:1px solid #2e2e44;border-radius:5px;color:#dde;font-size:12px}.colr[data-v-f5ccc52c]{width:28px;height:22px;border:none;background:none;cursor:pointer}.placeholder[data-v-f5ccc52c]{color:#667;font-size:11px;padding:6px 0}.image-add[data-v-f5ccc52c]{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-f5ccc52c]:hover{background:#4542a8;color:#fff}.resource-divider[data-v-f5ccc52c]{height:1px;margin:9px 0 7px;background:#2a3549}.hex-input[data-v-f5ccc52c]{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-f5ccc52c]:focus{border-color:#7774ff;color:#fff}.alpha-modes[data-v-f5ccc52c]{display:flex;gap:3px}.alpha-modes button[data-v-f5ccc52c]{padding:4px 8px;border:1px solid transparent;border-radius:5px;background:transparent;color:#8d98ae;font-size:11px;cursor:pointer}.alpha-modes button[data-v-f5ccc52c]:hover{background:#273246}.alpha-modes button.on[data-v-f5ccc52c]{border-color:#7774ff;background:#605df0;color:#fff}.file-input[data-v-f5ccc52c]{display:none}.hex[data-v-f5ccc52c]{font-size:11px;color:#889;margin-left:auto;font-variant-numeric:tabular-nums}.inp.tiny[data-v-f5ccc52c]{width:46px;flex:0 0 46px;text-align:center}.axis-mode[data-v-f5ccc52c]{padding:4px 8px;border:1px solid #344158;border-radius:5px;background:#273246;color:#aeb8cf;font-size:11px;cursor:pointer}.axis-mode.on[data-v-f5ccc52c]{border-color:#7774ff;background:#605df0;color:#fff}.switch-row[data-v-f5ccc52c]{display:flex;align-items:center;gap:9px;color:#b8c1d5;font-size:12px;cursor:pointer}.switch-row input[data-v-f5ccc52c]{position:absolute;opacity:0;pointer-events:none}.switch-ui[data-v-f5ccc52c]{position:relative;width:32px;height:18px;border-radius:10px;background:#354258;transition:background .16s ease}.switch-ui[data-v-f5ccc52c]: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-f5ccc52c]{background:#625ff1}.switch-row input:checked+.switch-ui[data-v-f5ccc52c]:after{transform:translate(14px)}.modifier-item[data-v-f5ccc52c]{padding:8px 0 10px;border-bottom:1px solid #2a3549}.events-item[data-v-f5ccc52c]{margin-top:4px;padding-bottom:2px;border-bottom:0}.event-rules[data-v-f5ccc52c]{display:flex;flex-direction:column;gap:7px;margin-top:8px}.event-card[data-v-f5ccc52c]{padding:7px;border:1px solid #2b3a54;border-radius:7px;background:#121a28}.event-selects[data-v-f5ccc52c]{display:flex;align-items:center;gap:5px}.event-selects .inp[data-v-f5ccc52c]{height:26px;min-height:26px;box-sizing:border-box;font-size:11px}.event-select[data-v-f5ccc52c]{flex:0 0 34%}.event-target[data-v-f5ccc52c]{flex:1;min-width:0}.event-remove[data-v-f5ccc52c]{width:24px;height:26px;flex:0 0 24px;padding:0;border:1px solid #3a465f;border-radius:5px;background:#1c2638;color:#8794ad;font-size:11px;cursor:pointer}.event-remove[data-v-f5ccc52c]:hover{border-color:#a05260;background:#3a2230;color:#ffb3c0}.event-probability[data-v-f5ccc52c]{display:flex;align-items:center;gap:8px;margin-top:6px;color:#8d9ab5;font-size:10px}.event-probability>span[data-v-f5ccc52c]{flex:0 0 56px}.event-probability .inp[data-v-f5ccc52c]{flex:1;height:26px;box-sizing:border-box;font-size:11px}.event-inherit[data-v-f5ccc52c],.event-color-mode[data-v-f5ccc52c]{margin-top:4px}.event-color-mode>span[data-v-f5ccc52c]{flex:0 0 84px}.event-color-mode .inp[data-v-f5ccc52c]{height:26px;min-height:26px;box-sizing:border-box;font-size:11px}.event-collision-limit>span[data-v-f5ccc52c]{flex-basis:72px}.inherit-trigger[data-v-f5ccc52c]{flex:1;min-width:0;height:26px;box-sizing:border-box;display:flex;align-items:center;justify-content:space-between;gap:6px;padding:0 7px;border:1px solid #34435e;border-radius:4px;background:#101827;color:#cdd6e8;font-size:11px;text-align:left;cursor:pointer}.inherit-trigger[data-v-f5ccc52c]:hover{border-color:#5d5aa8}.inherit-summary[data-v-f5ccc52c]{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.inherit-trigger i[data-v-f5ccc52c]{color:#7f8db0;font-style:normal;font-size:10px}.inherit-menu[data-v-f5ccc52c]{position:fixed;z-index:9999;padding:5px;border:1px solid #3b3f4a;border-radius:6px;background:#232427;box-shadow:0 12px 30px #0000008c}.inherit-option[data-v-f5ccc52c]{display:flex;align-items:center;gap:6px;width:100%;height:26px;padding:0 7px;border:0;border-radius:4px;background:transparent;color:#c9ccd3;font-size:12px;text-align:left;cursor:pointer}.inherit-option[data-v-f5ccc52c]:hover{background:#3a5a8c;color:#fff}.inherit-check[data-v-f5ccc52c]{width:14px;flex:0 0 14px;color:#d8dbe2;font-size:12px}.inherit-divider[data-v-f5ccc52c]{height:1px;margin:4px;background:#35373d}.event-add[data-v-f5ccc52c]{height:28px;border:1px dashed #536079;border-radius:6px;background:transparent;color:#9aa7c2;font-size:11px;cursor:pointer}.event-add[data-v-f5ccc52c]:hover{border-color:#7774ff;background:#232a45;color:#fff}.modifier-switch[data-v-f5ccc52c]{font-weight:600}.modifier-params[data-v-f5ccc52c]{margin:8px 0 0 10px;padding:2px 0 2px 10px;border-left:2px solid #344158}.modifier-hint[data-v-f5ccc52c]{margin:7px 0 0 2px;color:#647086;font-size:9px;line-height:1.5}.collision-filter-params[data-v-f5ccc52c]{position:relative;padding-top:5px;padding-bottom:5px}.collision-filter-title[data-v-f5ccc52c]{margin-bottom:8px;color:#9ba7bd;font-size:11px;font-weight:600}.collision-filter-tags[data-v-f5ccc52c]{display:flex;flex-wrap:wrap;align-items:center;gap:6px}.collision-filter-tag[data-v-f5ccc52c]{display:inline-flex;min-width:0;align-items:center;gap:6px;padding:5px 5px 5px 8px;border:1px solid #625ff1;border-radius:6px;background:#514dcf;color:#fff;font-size:11px}.collision-filter-tag>span[data-v-f5ccc52c]{max-width:150px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.collision-filter-tag.disabled[data-v-f5ccc52c]{border-color:#4b5364;background:#343b4b;color:#929bad}.collision-filter-tag button[data-v-f5ccc52c]{width:18px;height:18px;padding:0;border:0;border-radius:4px;background:#0b0f1a38;color:inherit;line-height:16px;cursor:pointer}.collision-filter-tag button[data-v-f5ccc52c]:hover{background:#0b0f1a80;color:#fff}.collision-filter-add[data-v-f5ccc52c]{width:30px;height:30px;padding:0;border:1px dashed #536079;border-radius:6px;background:#182131;color:#98a5bd;font-size:18px;line-height:28px;cursor:pointer}.collision-filter-add[data-v-f5ccc52c]:hover,.collision-filter-add.active[data-v-f5ccc52c]{border-color:#7774ff;background:#262c52;color:#fff}.collision-filter-add[data-v-f5ccc52c]:disabled{opacity:.42;cursor:not-allowed}.collision-filter-empty[data-v-f5ccc52c]{margin-top:7px;color:#6f7b91;font-size:10px}.collision-filter-picker[data-v-f5ccc52c]{display:grid;gap:4px;margin-top:7px;padding:5px;border:1px solid #344158;border-radius:6px;background:#101725}.collision-filter-picker button[data-v-f5ccc52c]{display:flex;min-width:0;align-items:center;justify-content:space-between;gap:8px;padding:6px 8px;border:0;border-radius:4px;background:transparent;color:#c7d0e3;font-size:11px;text-align:left;cursor:pointer}.collision-filter-picker button[data-v-f5ccc52c]:hover{background:#29344a;color:#fff}.collision-filter-picker button span[data-v-f5ccc52c]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.collision-filter-picker button small[data-v-f5ccc52c]{flex:none;color:#68758d;font-size:9px}.switch-row input:disabled+.switch-ui[data-v-f5ccc52c]{opacity:.45;cursor:not-allowed}.bone-follow-target[data-v-f5ccc52c]{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-f5ccc52c]{color:#c8d0e4;font-weight:600}.bone-follow-missing[data-v-f5ccc52c]{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-f5ccc52c]{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-f5ccc52c]:hover{border-color:#7165bd;background:#3a335d;color:#fff}.bone-follow-transform-grid[data-v-f5ccc52c]{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}.modifier-mode-row[data-v-f5ccc52c]{display:flex;justify-content:flex-end;gap:4px;margin-bottom:6px}.gravity-curve-title[data-v-f5ccc52c]{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-f5ccc52c]:last-child{color:#657188;font-size:9px}.gravity-curve-axis[data-v-f5ccc52c]{display:flex;justify-content:space-between;margin:3px 34px 0 1px;color:#5f6b82;font-size:9px}.gravity-params[data-v-f5ccc52c] .ce-svg{height:96px;background:#0f1625;border-color:#30405a}.trail-params[data-v-f5ccc52c]{padding-right:2px}.trail-section-title[data-v-f5ccc52c]{margin:3px 0 8px;color:#aeb8cf;font-size:12px;font-weight:700}.trail-fixed-color .hex-input[data-v-f5ccc52c]{min-width:0;flex:1}.trail-mode-head[data-v-f5ccc52c]{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-f5ccc52c]{margin:11px 0 7px;padding-top:9px;border-top:1px solid #2a3549}.trail-grid-row[data-v-f5ccc52c]{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:8px}.trail-grid-row[data-v-f5ccc52c] .ns{min-width:0;flex-wrap:wrap;align-items:center}.trail-grid-row[data-v-f5ccc52c] .ns-label{width:100%}.trail-grid-row[data-v-f5ccc52c] .ns-range{min-width:0}.trail-grid-row[data-v-f5ccc52c] .ns-num{width:42px}.trail-params[data-v-f5ccc52c] .ce-svg{height:92px;background:#0f1625;border-color:#30405a}.group[data-v-63cfb71e]{border:1px solid #2a2a3c;border-radius:8px;margin-bottom:10px;overflow:hidden}.group-head[data-v-63cfb71e]{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-63cfb71e]:hover{background:#20202e}.group-reset[data-v-63cfb71e]{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-63cfb71e]:hover{border-color:#7774ff;background:#45426f;color:#fff}.group-body[data-v-63cfb71e]{padding:8px 10px 12px}.caret[data-v-63cfb71e]{display:inline-block;width:12px;color:#667;font-size:11px}.row[data-v-63cfb71e]{display:flex;align-items:center;gap:8px;margin:6px 0;font-size:12px;color:#aab}.row>span[data-v-63cfb71e]:first-child{width:60px;flex-shrink:0;color:#8a93bb}.inp[data-v-63cfb71e]{flex:1;min-width:0;padding:3px 5px;background:#1a1a28;border:1px solid #2e2e44;border-radius:5px;color:#dde;font-size:12px}.placeholder[data-v-63cfb71e]{color:#667;font-size:11px;padding:6px 0}.export-settings[data-v-63cfb71e]{padding-top:3px}.export-field[data-v-63cfb71e]{display:flex;flex-direction:column;gap:6px;margin:10px 0 13px;color:#9ca8bf;font-size:11px;font-weight:600}.export-input[data-v-63cfb71e]{width:100%;min-height:34px;box-sizing:border-box;padding:6px 9px;color:#e3e7f2;background:#141a29;border-color:#35445f}.export-fps-row[data-v-63cfb71e]{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:12px;align-items:end}.export-fps-field[data-v-63cfb71e]{margin-bottom:5px}.export-checkbox[data-v-63cfb71e]{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-63cfb71e]{width:17px;height:17px;margin:0;accent-color:#625ff1}.export-help[data-v-63cfb71e]{margin:-6px 0 14px;color:#66758e;font-size:10px;line-height:1.5}.export-switches[data-v-63cfb71e]{display:grid;gap:13px;margin:4px 0 7px;padding-top:2px}.export-switch[data-v-63cfb71e]{font-weight:600}.export-switch-last[data-v-63cfb71e]{margin-top:13px}.inp.tiny[data-v-63cfb71e]{width:46px;flex:0 0 46px;text-align:center}.switch-row[data-v-63cfb71e]{display:flex;align-items:center;gap:9px;color:#b8c1d5;font-size:12px;cursor:pointer}.switch-row input[data-v-63cfb71e]{position:absolute;opacity:0;pointer-events:none}.switch-ui[data-v-63cfb71e]{position:relative;width:32px;height:18px;border-radius:10px;background:#354258;transition:background .16s ease}.switch-ui[data-v-63cfb71e]: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-63cfb71e]{background:#625ff1}.switch-row input:checked+.switch-ui[data-v-63cfb71e]:after{transform:translate(14px)}.switch-row input:disabled+.switch-ui[data-v-63cfb71e]{opacity:.45;cursor:not-allowed}.spine-export-actions[data-v-33af5045]{display:grid;grid-template-columns:1fr 1fr;gap:7px;margin-top:10px}.export-spine-json[data-v-33af5045]{width:100%;padding:9px 8px;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-33af5045]:hover{border-color:#7774ff;background:#514bc0}.export-spine-json[data-v-33af5045]:disabled{cursor:wait;opacity:.68}.export-spine-project[data-v-33af5045]{grid-column:1 / -1;width:100%;padding:7px 8px;border:1px solid #287d69;border-radius:7px;background:#196854;color:#edfff9;font-size:12px;font-weight:700;cursor:pointer;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px}.export-spine-project small[data-v-33af5045]{color:inherit;font-size:9px;font-weight:500;line-height:1.1}.export-spine-project[data-v-33af5045]:hover:not(:disabled){border-color:#47c89f;background:#238267}.export-spine-project[data-v-33af5045]:disabled{cursor:not-allowed;opacity:.48}.export-spine-images[data-v-33af5045]{width:100%;padding:8px;border:1px solid #3b5f8b;border-radius:7px;background:#243e64;color:#eaf3ff;font-size:12px;font-weight:700;cursor:pointer}.export-spine-images[data-v-33af5045]:hover:not(:disabled){border-color:#6099dc;background:#315581}.export-spine-images[data-v-33af5045]:disabled{cursor:wait;opacity:.55}.connector-status[data-v-33af5045]{display:flex;align-items:center;justify-content:center;gap:5px;padding-top:6px;color:#717b99;font-size:10px}.connector-status .connector-dot[data-v-33af5045]{width:6px;height:6px;border-radius:50%;background:#66718f}.connector-status.ready[data-v-33af5045]{color:#70d8ae}.connector-status.ready .connector-dot[data-v-33af5045]{background:#49c993;box-shadow:0 0 5px #49c99388}.connector-status.warning[data-v-33af5045]{color:#d4aa67}.connector-status.warning .connector-dot[data-v-33af5045]{background:#d4aa67}.connector-status button[data-v-33af5045]{padding:0 3px;border:0;background:transparent;color:#8290b6;font-size:10px;cursor:pointer}.connector-status button[data-v-33af5045]:hover{color:#c5caff}.connector-status a[data-v-33af5045]{padding:0 3px;color:#a8b0ff;font-size:10px;text-decoration:underline}.connector-status a[data-v-33af5045]:hover{color:#d8dcff}.export-message[data-v-33af5045]{padding:7px 5px 0;color:#70d8ae;font-size:10px;line-height:1.45;text-align:center}.export-message.error[data-v-33af5045]{color:#ff858f}.export-message a[data-v-33af5045]{display:inline-block;margin-left:5px;color:#9da7ff;text-decoration:underline}.panel[data-v-14a55de6]{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-14a55de6]{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-14a55de6]::-webkit-scrollbar{width:6px}.panel-scroll[data-v-14a55de6]::-webkit-scrollbar-track{background:transparent}.panel-scroll[data-v-14a55de6]::-webkit-scrollbar-thumb{background:#2e2e44;border-radius:3px}.panel-scroll[data-v-14a55de6]::-webkit-scrollbar-thumb:hover{background:#3a3a55}.panel-header[data-v-14a55de6]{display:flex;justify-content:space-between;align-items:center;margin-bottom:10px;flex:0 0 auto;font-weight:700;color:#ccd}.timeline[data-v-6213c4a4]{height:100%;background:#12121c;border-top:1px solid #2a2a3c;display:flex;flex-direction:column;padding:6px 10px;gap:4px}.tl-controls[data-v-6213c4a4]{display:flex;align-items:center;gap:8px}.tl-btn[data-v-6213c4a4]{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-6213c4a4]{background:#3a5a8c;color:#fff;border-color:#5a7ab8}.tl-ab-loop[data-v-6213c4a4]{position:relative}.tl-ab-toggle[data-v-6213c4a4]{display:flex;height:26px;align-items:center;gap:7px;padding:0 7px;border:1px solid #343a51;border-radius:6px;background:#1e1e2e;color:#8f98ad;font-size:10px;cursor:pointer}.tl-ab-toggle.on[data-v-6213c4a4]{border-color:#716eff;background:#2e2d50;color:#eef}.tl-switch[data-v-6213c4a4]{position:relative;width:22px;height:12px;border-radius:99px;background:#343a4b}.tl-switch b[data-v-6213c4a4]{position:absolute;top:2px;left:2px;width:8px;height:8px;border-radius:50%;background:#8992a5;transition:transform .15s ease,background .15s ease}.tl-ab-toggle.on .tl-switch[data-v-6213c4a4]{background:#716eff}.tl-ab-toggle.on .tl-switch b[data-v-6213c4a4]{transform:translate(10px);background:#fff}.tl-ab-popover[data-v-6213c4a4]{position:absolute;z-index:40;left:0;bottom:calc(100% + 8px);display:flex;align-items:center;gap:10px;padding:9px 10px;border:1px solid #4b4c73;border-radius:8px;background:#171724;box-shadow:0 10px 26px #00000080}.tl-ab-title[data-v-6213c4a4]{color:#b7bdd2;font-size:10px;white-space:nowrap}.tl-range[data-v-6213c4a4]{display:flex;height:25px;align-items:center;gap:3px;color:#778198;font-size:10px}.tl-range input[data-v-6213c4a4]{width:43px;height:25px;padding:0 5px;box-sizing:border-box;border:1px solid #3a3a51;border-radius:5px;outline:none;background:#181824;color:#e1e4ed;font-size:11px;text-align:center}.tl-range input[data-v-6213c4a4]:focus{border-color:#716eff}.tl-frame[data-v-6213c4a4]{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-6213c4a4]{display:inline;color:inherit;font-weight:400}.tl-legend[data-v-6213c4a4]{display:flex;align-items:center;gap:4px;color:#778198;font-size:10px}.tl-legend i[data-v-6213c4a4]{display:inline-block;width:10px;height:7px;border-radius:2px}.legend-emission[data-v-6213c4a4]{margin-left:4px;background:#2f8b62}.legend-life[data-v-6213c4a4]{margin-left:5px;background:#a54551}.legend-spine[data-v-6213c4a4]{margin-left:5px;background:#7448b8}.tl-anim[data-v-6213c4a4]{display:flex;align-items:center;gap:6px;font-size:12px;color:#aab}.tl-owner-animation[data-v-6213c4a4]{position:relative}.tl-animation-trigger[data-v-6213c4a4]{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-6213c4a4]{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tl-animation-trigger>i[data-v-6213c4a4]{flex:0 0 auto;color:#8c96ad;font-style:normal}.tl-animation-trigger[data-v-6213c4a4]:disabled{opacity:.5;cursor:not-allowed}.tl-animation-menu[data-v-6213c4a4]{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-6213c4a4]{padding:2px 4px 6px;color:#77839c;font-size:10px}.tl-animation-option[data-v-6213c4a4]{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-6213c4a4]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tl-animation-option[data-v-6213c4a4]:hover{background:#252e42}.tl-animation-option.on[data-v-6213c4a4]{background:#34335d;color:#fff}.tl-animation-option>i[data-v-6213c4a4]{color:#8d8aff;font-style:normal}.tl-animation-editor[data-v-6213c4a4]{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-6213c4a4]{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-6213c4a4]:focus{border-color:#6865d8}.tl-animation-editor button[data-v-6213c4a4],.tl-animation-actions button[data-v-6213c4a4]{height:27px;padding:0 8px;border:1px solid #3c4861;border-radius:5px;background:#29344a;color:#cbd3e3;cursor:pointer}.tl-animation-actions[data-v-6213c4a4]{display:grid;grid-template-columns:1fr 1fr;gap:5px;margin-top:6px}.tl-animation-actions button[data-v-6213c4a4]:last-child{border-color:#5b3942;background:#3b282f;color:#e2a8b2}.tl-animation-actions button[data-v-6213c4a4]:disabled{opacity:.4;cursor:not-allowed}.tl-animation-error[data-v-6213c4a4]{margin-top:5px;color:#ef8997;font-size:10px}.tl-animation-hint[data-v-6213c4a4]{margin-top:5px;color:#69758d;font-size:9px;text-align:center}.tl-sel[data-v-6213c4a4]{background:#1a1a28;border:1px solid #2e2e44;color:#dde;border-radius:5px;padding:2px 6px;font-size:12px}.tl-sel[data-v-6213c4a4]:disabled{opacity:.5;cursor:not-allowed}.tl-spine-preview .tl-sel[data-v-6213c4a4]{max-width:190px}.tl-zoom[data-v-6213c4a4]{margin-left:auto;font-size:11px;color:#667}.tl-viewport[data-v-6213c4a4]{position:relative;flex:1;overflow:hidden;background:#0d0d14;border:1px solid #2a2a3c;border-radius:6px;cursor:ew-resize}.tl-ticks[data-v-6213c4a4]{position:absolute;top:0;left:0;right:0;height:18px}.tl-tickline[data-v-6213c4a4]{position:absolute;top:0;bottom:0;width:1px;background:#263040}.tl-ticklabel[data-v-6213c4a4]{position:absolute;top:2px;transform:translate(-50%);font-size:9px;color:#667}.tl-playhead[data-v-6213c4a4]{position:absolute;top:0;bottom:0;width:2px;background:#fc3;z-index:5;pointer-events:none}.tl-lanes[data-v-6213c4a4]{position:absolute;top:22px;left:0;right:0;bottom:0}.tl-lane[data-v-6213c4a4]{position:relative;height:26px;margin-bottom:4px}.lane-ico[data-v-6213c4a4]{position:absolute;left:4px;top:6px;font-size:11px;color:#dde;z-index:2;pointer-events:none}.lane-ico.sub-lane-ico[data-v-6213c4a4]{color:#7f8999}.lane-bar[data-v-6213c4a4]{position:absolute;top:4px;height:18px;display:flex;align-items:stretch;cursor:grab;box-sizing:border-box}.lane-bar[data-v-6213c4a4]:active{cursor:grabbing}.lane-name[data-v-6213c4a4]{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-6213c4a4]{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}.sub-emitter-bar .bar-life[data-v-6213c4a4]{border-color:#727d8f;background:#596274}.bar-life.loop-life[data-v-6213c4a4]{border-color:#667085;background:#242b39}.bar-emission[data-v-6213c4a4]{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-emission.bar-loop[data-v-6213c4a4]{border-radius:0}.bar-loop-transition[data-v-6213c4a4]{position:absolute;top:0;bottom:0;z-index:1;border:1px solid #7d8799;background:#50596a;box-sizing:border-box}.bar-loop-start[data-v-6213c4a4]{left:0;border-radius:5px 0 0 5px}.bar-loop-end[data-v-6213c4a4]{border-radius:0 5px 5px 0}.bar-handle[data-v-6213c4a4]{position:absolute;z-index:4;right:-4px;top:-1px;bottom:-1px;width:8px;cursor:ew-resize;background:#ffffff2e}.bar-handle[data-v-6213c4a4]:hover{background:#ffffff59}.spine-ico[data-v-6213c4a4]{color:#c08cff}.spine-bar[data-v-6213c4a4]{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-6213c4a4]:active{cursor:grabbing}.tl-empty[data-v-6213c4a4]{color:#667;font-size:11px;padding:8px}.transfer-overlay[data-v-592b922e]{position:fixed;z-index:2000;top:0;right:0;bottom:0;left:0;display:grid;place-items:center;pointer-events:auto;cursor:wait;overscroll-behavior:contain;background:#05080f42;-webkit-backdrop-filter:blur(1px);backdrop-filter:blur(1px)}.transfer-dialog[data-v-592b922e]{width:min(420px,calc(100vw - 40px));padding:18px 20px 16px;border:1px solid #414b66;border-radius:10px;box-shadow:0 18px 55px #00000075;background:#171d2b;color:#e7ebf5}.transfer-heading[data-v-592b922e]{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:12px;font-size:14px;font-weight:700}.transfer-heading strong[data-v-592b922e]{color:#a8a6ff;font-size:12px;font-variant-numeric:tabular-nums}.transfer-track[data-v-592b922e]{height:9px;overflow:hidden;border:1px solid #35415a;border-radius:999px;background:#0d1422}.transfer-bar[data-v-592b922e]{height:100%;border-radius:inherit;background:linear-gradient(90deg,#4d75e8,#7774ff);transition:width .16s ease}.transfer-track.indeterminate .transfer-bar[data-v-592b922e]{width:42%;animation:transfer-slide-592b922e 1s ease-in-out infinite}.transfer-detail[data-v-592b922e]{min-height:17px;margin-top:9px;color:#8895ae;font-size:11px;line-height:1.5}.transfer-dialog.failed[data-v-592b922e]{border-color:#754351}.transfer-dialog.failed .transfer-heading strong[data-v-592b922e],.transfer-dialog.failed .transfer-detail[data-v-592b922e]{color:#e99aa9}.transfer-dialog.failed .transfer-bar[data-v-592b922e]{background:#c85d70}.transfer-fade-enter-active[data-v-592b922e],.transfer-fade-leave-active[data-v-592b922e]{transition:opacity .16s ease}.transfer-fade-enter-from[data-v-592b922e],.transfer-fade-leave-to[data-v-592b922e]{opacity:0}@keyframes transfer-slide-592b922e{0%{transform:translate(-110%)}to{transform:translate(250%)}}.layout[data-v-07c42c10]{display:flex;width:100%;height:100%;min-height:0;overflow:clip}.parameter-panel[data-v-07c42c10]{flex-shrink:0;height:100%;min-height:0;overflow:clip}.resizer-col[data-v-07c42c10]{width:5px;cursor:col-resize;background:#1c1c2a;border-left:1px solid #2a2a3c;border-right:1px solid #2a2a3c;flex-shrink:0}.resizer-col[data-v-07c42c10]:hover{background:#3a5a8c}.right[data-v-07c42c10]{flex:1;min-width:0;height:100%;min-height:0;overflow:clip;display:flex;flex-direction:column}.panel-right .right[data-v-07c42c10]{order:1}.panel-right .resizer-col[data-v-07c42c10]{order:2}.panel-right .parameter-panel[data-v-07c42c10]{order:3}.stage-area[data-v-07c42c10]{flex:1;min-height:0;overflow:clip}.resizer-row[data-v-07c42c10]{height:4px;cursor:row-resize;background:#1c1c2a;border-top:1px solid #2a2a3c;border-bottom:1px solid #2a2a3c;flex-shrink:0}.resizer-row[data-v-07c42c10]:hover{background:#3a5a8c}.timeline-area[data-v-07c42c10]{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}html,body,#app{-webkit-user-select:none;user-select:none}input,textarea,select,[contenteditable=true]{-webkit-user-select:text;user-select:text}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-Bjqx1iPW.js b/dist/assets/index-Bjqx1iPW.js deleted file mode 100644 index b666cf0..0000000 --- a/dist/assets/index-Bjqx1iPW.js +++ /dev/null @@ -1,1239 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-Csznclrj.js","assets/index-ChTSy5jk.js"])))=>i.map(i=>d[i]); -var oM=Object.defineProperty;var aM=(s,e,t)=>e in s?oM(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t;var M=(s,e,t)=>aM(s,typeof e!="symbol"?e+"":e,t);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))i(n);new MutationObserver(n=>{for(const r of n)if(r.type==="childList")for(const o of r.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function t(n){const r={};return n.integrity&&(r.integrity=n.integrity),n.referrerPolicy&&(r.referrerPolicy=n.referrerPolicy),n.crossOrigin==="use-credentials"?r.credentials="include":n.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function i(n){if(n.ep)return;n.ep=!0;const r=t(n);fetch(n.href,r)}})();/** -* @vue/shared v3.5.41 -* (c) 2018-present Yuxi (Evan) You and Vue contributors -* @license MIT -**/function qm(s){const e=Object.create(null);for(const t of s.split(","))e[t]=1;return t=>t in e}const Lt={},Ho=[],cn=()=>{},Py=()=>!1,Xh=s=>s.charCodeAt(0)===111&&s.charCodeAt(1)===110&&(s.charCodeAt(2)>122||s.charCodeAt(2)<97),Vh=s=>s.startsWith("onUpdate:"),pi=Object.assign,Km=(s,e)=>{const t=s.indexOf(e);t>-1&&s.splice(t,1)},lM=Object.prototype.hasOwnProperty,Rt=(s,e)=>lM.call(s,e),ze=Array.isArray,Wo=s=>Cl(s)==="[object Map]",ga=s=>Cl(s)==="[object Set]",Gp=s=>Cl(s)==="[object Date]",at=s=>typeof s=="function",Gt=s=>typeof s=="string",rs=s=>typeof s=="symbol",Pt=s=>s!==null&&typeof s=="object",ky=s=>(Pt(s)||at(s))&&at(s.then)&&at(s.catch),Fy=Object.prototype.toString,Cl=s=>Fy.call(s),cM=s=>Cl(s).slice(8,-1),Oy=s=>Cl(s)==="[object Object]",Yh=s=>Gt(s)&&s!=="NaN"&&s[0]!=="-"&&""+parseInt(s,10)===s,qa=qm(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Gh=s=>{const e=Object.create(null);return(t=>e[t]||(e[t]=s(t)))},hM=/-\w/g,ks=Gh(s=>s.replace(hM,e=>e.slice(1).toUpperCase())),uM=/\B([A-Z])/g,Ir=Gh(s=>s.replace(uM,"-$1").toLowerCase()),Ly=Gh(s=>s.charAt(0).toUpperCase()+s.slice(1)),Cu=Gh(s=>s?`on${Ly(s)}`:""),sn=(s,e)=>!Object.is(s,e),Ec=(s,...e)=>{for(let t=0;t{Object.defineProperty(s,e,{configurable:!0,enumerable:!1,writable:i,value:t})},jh=s=>{const e=parseFloat(s);return isNaN(e)?s:e},dM=s=>{const e=Gt(s)?Number(s):NaN;return isNaN(e)?s:e};let jp;const Hh=()=>jp||(jp=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Ot(s){if(ze(s)){const e={};for(let t=0;t{if(t){const i=t.split(mM);i.length>1&&(e[i[0].trim()]=i[1].trim())}}),e}function Ce(s){let e="";if(Gt(s))e=s;else if(ze(s))for(let t=0;tva(t,e))}const Dy=s=>!!(s&&s.__v_isRef===!0),ve=s=>Gt(s)?s:s==null?"":ze(s)||Pt(s)&&(s.toString===Fy||!at(s.toString))?Dy(s)?ve(s.value):JSON.stringify(s,Uy,2):String(s),Uy=(s,e)=>Dy(e)?Uy(s,e.value):Wo(e)?{[`Map(${e.size})`]:[...e.entries()].reduce((t,[i,n],r)=>(t[Eu(i,r)+" =>"]=n,t),{})}:ga(e)?{[`Set(${e.size})`]:[...e.values()].map(t=>Eu(t))}:rs(e)?Eu(e):Pt(e)&&!ze(e)&&!Oy(e)?String(e):e,Eu=(s,e="")=>{var t;return rs(s)?`Symbol(${(t=s.description)!=null?t:e})`:s};/** -* @vue/reactivity v3.5.41 -* (c) 2018-present Yuxi (Evan) You and Vue contributors -* @license MIT -**/let di;class $y{constructor(e=!1){this.detached=e,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!e&&di&&(di.active?(this.parent=di,this.index=(di.scopes||(di.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let e,t;if(this.scopes){const i=this.scopes.slice();for(e=0,t=i.length;e0&&--this._on===0){if(di===this)di=this.prevScope;else{let e=di;for(;e;){if(e.prevScope===this){e.prevScope=this.prevScope;break}e=e.prevScope}}this.prevScope=void 0}}stop(e){if(this._active){this._active=!1;let t,i;for(t=0,i=this.effects.length;t0)return;if(Za){let e=Za;for(Za=void 0;e;){const t=e.next;e.next=void 0,e.flags&=-9,e=t}}let s;for(;Ka;){let e=Ka;for(Ka=void 0;e;){const t=e.next;if(e.next=void 0,e.flags&=-9,e.flags&1)try{e.trigger()}catch(i){s||(s=i)}e=t}}if(s)throw s}function Hy(s){for(let e=s.deps;e;e=e.nextDep)e.version=-1,e.prevActiveLink=e.dep.activeLink,e.dep.activeLink=e}function Wy(s){let e,t=s.depsTail,i=t;for(;i;){const n=i.prevDep;i.version===-1?(i===t&&(t=n),ep(i),wM(i)):e=i,i.dep.activeLink=i.prevActiveLink,i.prevActiveLink=void 0,i=n}s.deps=e,s.depsTail=t}function Sf(s){for(let e=s.deps;e;e=e.nextDep)if(e.dep.version!==e.version||e.dep.computed&&(zy(e.dep.computed)||e.dep.version!==e.version))return!0;return!!s._dirty}function zy(s){if(s.flags&4&&!(s.flags&16)||(s.flags&=-17,s.globalVersion===cl)||(s.globalVersion=cl,!s.isSSR&&s.flags&128&&(!s.deps&&!s._dirty||!Sf(s))))return;s.flags|=2;const e=s.dep,t=Ut,i=Fs;Ut=s,Fs=!0;try{Hy(s);const n=s.fn(s._value);(e.version===0||sn(n,s._value))&&(s.flags|=128,s._value=n,e.version++)}catch(n){throw e.version++,n}finally{Ut=t,Fs=i,Wy(s),s.flags&=-3}}function ep(s,e=!1){const{dep:t,prevSub:i,nextSub:n}=s;if(i&&(i.nextSub=n,s.prevSub=void 0),n&&(n.prevSub=i,s.nextSub=void 0),t.subs===s&&(t.subs=i,!i&&t.computed)){t.computed.flags&=-5;for(let r=t.computed.deps;r;r=r.nextDep)ep(r,!0)}!e&&!--t.sc&&t.map&&t.map.delete(t.key)}function wM(s){const{prevDep:e,nextDep:t}=s;e&&(e.nextDep=t,s.prevDep=void 0),t&&(t.prevDep=e,s.nextDep=void 0)}let Fs=!0;const qy=[];function Yn(){qy.push(Fs),Fs=!1}function Gn(){const s=qy.pop();Fs=s===void 0?!0:s}function Hp(s){const{cleanup:e}=s;if(s.cleanup=void 0,e){const t=Ut;Ut=void 0;try{e()}finally{Ut=t}}}let cl=0;class SM{constructor(e,t){this.sub=e,this.dep=t,this.version=t.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class tp{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(e){if(!Ut||!Fs||Ut===this.computed)return;let t=this.activeLink;if(t===void 0||t.sub!==Ut)t=this.activeLink=new SM(Ut,this),Ut.deps?(t.prevDep=Ut.depsTail,Ut.depsTail.nextDep=t,Ut.depsTail=t):Ut.deps=Ut.depsTail=t,Ky(t);else if(t.version===-1&&(t.version=this.version,t.nextDep)){const i=t.nextDep;i.prevDep=t.prevDep,t.prevDep&&(t.prevDep.nextDep=i),t.prevDep=Ut.depsTail,t.nextDep=void 0,Ut.depsTail.nextDep=t,Ut.depsTail=t,Ut.deps===t&&(Ut.deps=i)}return t}trigger(e){this.version++,cl++,this.notify(e)}notify(e){Jm();try{for(let t=this.subs;t;t=t.prevSub)t.sub.notify()&&t.sub.dep.notify()}finally{Qm()}}}function Ky(s){if(s.dep.sc++,s.sub.flags&4){const e=s.dep.computed;if(e&&!s.dep.subs){e.flags|=20;for(let i=e.deps;i;i=i.nextDep)Ky(i)}const t=s.dep.subs;t!==s&&(s.prevSub=t,t&&(t.nextSub=s)),s.dep.subs=s}}const Gc=new WeakMap,so=Symbol(""),Mf=Symbol(""),hl=Symbol("");function Pi(s,e,t){if(Fs&&Ut){let i=Gc.get(s);i||Gc.set(s,i=new Map);let n=i.get(t);n||(i.set(t,n=new tp),n.map=i,n.key=t),n.track()}}function In(s,e,t,i,n,r){const o=Gc.get(s);if(!o){cl++;return}const a=l=>{l&&l.trigger()};if(Jm(),e==="clear")o.forEach(a);else{const l=ze(s),c=l&&Yh(t);if(l&&t==="length"){const h=Number(i);o.forEach((u,d)=>{(d==="length"||d===hl||!rs(d)&&d>=h)&&a(u)})}else switch((t!==void 0||o.has(void 0))&&a(o.get(t)),c&&a(o.get(hl)),e){case"add":l?c&&a(o.get("length")):(a(o.get(so)),Wo(s)&&a(o.get(Mf)));break;case"delete":l||(a(o.get(so)),Wo(s)&&a(o.get(Mf)));break;case"set":Wo(s)&&a(o.get(so));break}}Qm()}function MM(s,e){const t=Gc.get(s);return t&&t.get(e)}function To(s){const e=Tt(s);return e===s?e:(Pi(e,"iterate",hl),ns(s)?e:e.map(Ds))}function Wh(s){return Pi(s=Tt(s),"iterate",hl),s}function Js(s,e){return jn(s)?aa(Un(s)?Ds(e):e):Ds(e)}const TM={__proto__:null,[Symbol.iterator](){return Iu(this,Symbol.iterator,s=>Js(this,s))},concat(...s){return To(this).concat(...s.map(e=>ze(e)?To(e):e))},entries(){return Iu(this,"entries",s=>(s[1]=Js(this,s[1]),s))},every(s,e){return yn(this,"every",s,e,void 0,arguments)},filter(s,e){return yn(this,"filter",s,e,t=>t.map(i=>Js(this,i)),arguments)},find(s,e){return yn(this,"find",s,e,t=>Js(this,t),arguments)},findIndex(s,e){return yn(this,"findIndex",s,e,void 0,arguments)},findLast(s,e){return yn(this,"findLast",s,e,t=>Js(this,t),arguments)},findLastIndex(s,e){return yn(this,"findLastIndex",s,e,void 0,arguments)},forEach(s,e){return yn(this,"forEach",s,e,void 0,arguments)},includes(...s){return Ru(this,"includes",s)},indexOf(...s){return Ru(this,"indexOf",s)},join(s){return To(this).join(s)},lastIndexOf(...s){return Ru(this,"lastIndexOf",s)},map(s,e){return yn(this,"map",s,e,void 0,arguments)},pop(){return Aa(this,"pop")},push(...s){return Aa(this,"push",s)},reduce(s,...e){return Wp(this,"reduce",s,e)},reduceRight(s,...e){return Wp(this,"reduceRight",s,e)},shift(){return Aa(this,"shift")},some(s,e){return yn(this,"some",s,e,void 0,arguments)},splice(...s){return Aa(this,"splice",s)},toReversed(){return To(this).toReversed()},toSorted(s){return To(this).toSorted(s)},toSpliced(...s){return To(this).toSpliced(...s)},unshift(...s){return Aa(this,"unshift",s)},values(){return Iu(this,"values",s=>Js(this,s))}};function Iu(s,e,t){const i=Wh(s),n=i[e]();return i!==s&&!ns(s)&&(n._next=n.next,n.next=()=>{const r=n._next();return r.done||(r.value=t(r.value)),r}),n}const _M=Array.prototype;function yn(s,e,t,i,n,r){const o=Wh(s),a=o!==s&&!ns(s),l=o[e];if(l!==_M[e]){const u=l.apply(s,r);return a?Ds(u):u}let c=t;o!==s&&(a?c=function(u,d){return t.call(this,Js(s,u),d,s)}:t.length>2&&(c=function(u,d){return t.call(this,u,d,s)}));const h=l.call(o,c,i);return a&&n?n(h):h}function Wp(s,e,t,i){const n=Wh(s),r=n!==s&&!ns(s);let o=t,a=!1;n!==s&&(r?(a=i.length===0,o=function(c,h,u){return a&&(a=!1,c=Js(s,c)),t.call(this,c,Js(s,h),u,s)}):t.length>3&&(o=function(c,h,u){return t.call(this,c,h,u,s)}));const l=n[e](o,...i);return a?Js(s,l):l}function Ru(s,e,t){const i=Tt(s);Pi(i,"iterate",hl);const n=i[e](...t);return(n===-1||n===!1)&&zh(t[0])?(t[0]=Tt(t[0]),i[e](...t)):n}function Aa(s,e,t=[]){Yn(),Jm();const i=Tt(s)[e].apply(s,t);return Qm(),Gn(),i}const CM=qm("__proto__,__v_isRef,__isVue"),Zy=new Set(Object.getOwnPropertyNames(Symbol).filter(s=>s!=="arguments"&&s!=="caller").map(s=>Symbol[s]).filter(rs));function EM(s){rs(s)||(s=String(s));const e=Tt(this);return Pi(e,"has",s),e.hasOwnProperty(s)}class Jy{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,i){if(t==="__v_skip")return e.__v_skip;const n=this._isReadonly,r=this._isShallow;if(t==="__v_isReactive")return!n;if(t==="__v_isReadonly")return n;if(t==="__v_isShallow")return r;if(t==="__v_raw")return i===(n?r?NM:ix:r?tx:ex).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(i)?e:void 0;const o=ze(e);if(!n){let l;if(o&&(l=TM[t]))return l;if(t==="hasOwnProperty")return EM}const a=Reflect.get(e,t,jt(e)?e:i);if((rs(t)?Zy.has(t):CM(t))||(n||Pi(e,"get",t),r))return a;if(jt(a)){const l=o&&Yh(t)?a:a.value;return n&&Pt(l)?_f(l):l}return Pt(a)?n?_f(a):po(a):a}}class Qy extends Jy{constructor(e=!1){super(!1,e)}set(e,t,i,n){let r=e[t];const o=ze(e)&&Yh(t);if(!this._isShallow){const c=jn(r);if(!ns(i)&&!jn(i)&&(r=Tt(r),i=Tt(i)),!o&&jt(r)&&!jt(i))return c||(r.value=i),!0}const a=o?Number(t)s,Vl=s=>Reflect.getPrototypeOf(s);function kM(s,e,t){return function(...i){const n=this.__v_raw,r=Tt(n),o=Wo(r),a=s==="entries"||s===Symbol.iterator&&o,l=s==="keys"&&o,c=n[s](...i),h=t?Tf:e?aa:Ds;return!e&&Pi(r,"iterate",l?Mf:so),pi(Object.create(c),{next(){const{value:u,done:d}=c.next();return d?{value:u,done:d}:{value:a?[h(u[0]),h(u[1])]:h(u),done:d}}})}}function Yl(s){return function(...e){return s==="delete"?!1:s==="clear"?void 0:this}}function FM(s,e){const t={get(n){const r=this.__v_raw,o=Tt(r),a=Tt(n);s||(sn(n,a)&&Pi(o,"get",n),Pi(o,"get",a));const{has:l}=Vl(o),c=e?Tf:s?aa:Ds;if(l.call(o,n))return c(r.get(n));if(l.call(o,a))return c(r.get(a));r!==o&&r.get(n)},get size(){const n=this.__v_raw;return!s&&Pi(Tt(n),"iterate",so),n.size},has(n){const r=this.__v_raw,o=Tt(r),a=Tt(n);return s||(sn(n,a)&&Pi(o,"has",n),Pi(o,"has",a)),n===a?r.has(n):r.has(n)||r.has(a)},forEach(n,r){const o=this,a=o.__v_raw,l=Tt(a),c=e?Tf:s?aa:Ds;return!s&&Pi(l,"iterate",so),a.forEach((h,u)=>n.call(r,c(h),c(u),o))}};return pi(t,s?{add:Yl("add"),set:Yl("set"),delete:Yl("delete"),clear:Yl("clear")}:{add(n){const r=Tt(this),o=Vl(r),a=Tt(n),l=!e&&!ns(n)&&!jn(n)?a:n;return o.has.call(r,l)||sn(n,l)&&o.has.call(r,n)||sn(a,l)&&o.has.call(r,a)||(r.add(l),In(r,"add",l,l)),this},set(n,r){!e&&!ns(r)&&!jn(r)&&(r=Tt(r));const o=Tt(this),{has:a,get:l}=Vl(o);let c=a.call(o,n);c||(n=Tt(n),c=a.call(o,n));const h=l.call(o,n);return o.set(n,r),c?sn(r,h)&&In(o,"set",n,r):In(o,"add",n,r),this},delete(n){const r=Tt(this),{has:o,get:a}=Vl(r);let l=o.call(r,n);l||(n=Tt(n),l=o.call(r,n)),a&&a.call(r,n);const c=r.delete(n);return l&&In(r,"delete",n,void 0),c},clear(){const n=Tt(this),r=n.size!==0,o=n.clear();return r&&In(n,"clear",void 0,void 0),o}}),["keys","values","entries",Symbol.iterator].forEach(n=>{t[n]=kM(n,s,e)}),t}function ip(s,e){const t=FM(s,e);return(i,n,r)=>n==="__v_isReactive"?!s:n==="__v_isReadonly"?s:n==="__v_raw"?i:Reflect.get(Rt(t,n)&&n in i?t:i,n,r)}const OM={get:ip(!1,!1)},LM={get:ip(!1,!0)},BM={get:ip(!0,!1)};const ex=new WeakMap,tx=new WeakMap,ix=new WeakMap,NM=new WeakMap;function DM(s){switch(s){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function po(s){return jn(s)?s:sp(s,!1,IM,OM,ex)}function UM(s){return sp(s,!1,PM,LM,tx)}function _f(s){return sp(s,!0,RM,BM,ix)}function sp(s,e,t,i,n){if(!Pt(s)||s.__v_raw&&!(e&&s.__v_isReactive)||s.__v_skip||!Object.isExtensible(s))return s;const r=n.get(s);if(r)return r;const o=DM(cM(s));if(o===0)return s;const a=new Proxy(s,o===2?i:t);return n.set(s,a),a}function Un(s){return jn(s)?Un(s.__v_raw):!!(s&&s.__v_isReactive)}function jn(s){return!!(s&&s.__v_isReadonly)}function ns(s){return!!(s&&s.__v_isShallow)}function zh(s){return s?!!s.__v_raw:!1}function Tt(s){const e=s&&s.__v_raw;return e?Tt(e):s}function vr(s){return!Rt(s,"__v_skip")&&Object.isExtensible(s)&&By(s,"__v_skip",!0),s}const Ds=s=>Pt(s)?po(s):s,aa=s=>Pt(s)?_f(s):s;function jt(s){return s?s.__v_isRef===!0:!1}function Fe(s){return $M(s,!1)}function $M(s,e){return jt(s)?s:new XM(s,e)}class XM{constructor(e,t){this.dep=new tp,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:Tt(e),this._value=t?e:Ds(e),this.__v_isShallow=t}get value(){return this.dep.track(),this._value}set value(e){const t=this._rawValue,i=this.__v_isShallow||ns(e)||jn(e);e=i?e:Tt(e),sn(e,t)&&(this._rawValue=e,this._value=i?e:Ds(e),this.dep.trigger())}}function I(s){return jt(s)?s.value:s}const VM={get:(s,e,t)=>e==="__v_raw"?s:I(Reflect.get(s,e,t)),set:(s,e,t,i)=>{const n=s[e];return jt(n)&&!jt(t)?(n.value=t,!0):Reflect.set(s,e,t,i)}};function sx(s){return Un(s)?s:new Proxy(s,VM)}function YM(s){const e=ze(s)?new Array(s.length):{};for(const t in s)e[t]=jM(s,t);return e}class GM{constructor(e,t,i){this._object=e,this._defaultValue=i,this.__v_isRef=!0,this._value=void 0,this._key=rs(t)?t:String(t),this._raw=Tt(e);let n=!0,r=e;if(!ze(e)||rs(this._key)||!Yh(this._key))do n=!zh(r)||ns(r);while(n&&(r=r.__v_raw));this._shallow=n}get value(){let e=this._object[this._key];return this._shallow&&(e=I(e)),this._value=e===void 0?this._defaultValue:e}set value(e){if(this._shallow&&jt(this._raw[this._key])){const t=this._object[this._key];if(jt(t)){t.value=e;return}}this._object[this._key]=e}get dep(){return MM(this._raw,this._key)}}function jM(s,e,t){return new GM(s,e,t)}class HM{constructor(e,t,i){this.fn=e,this.setter=t,this._value=void 0,this.dep=new tp(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=cl-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=i}notify(){if(this.flags|=16,!(this.flags&8)&&Ut!==this)return jy(this,!0),!0}get value(){const e=this.dep.track();return zy(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}}function WM(s,e,t=!1){let i,n;return at(s)?i=s:(i=s.get,n=s.set),new HM(i,n,t)}const Gl={},jc=new WeakMap;let Xr;function zM(s,e=!1,t=Xr){if(t){let i=jc.get(t);i||jc.set(t,i=[]),i.push(s)}}function qM(s,e,t=Lt){const{immediate:i,deep:n,once:r,scheduler:o,augmentJob:a,call:l}=t,c=w=>n?w:ns(w)||n===!1||n===0?Rn(w,1):Rn(w);let h,u,d,f,m=!1,p=!1;if(jt(s)?(u=()=>s.value,m=ns(s)):Un(s)?(u=()=>c(s),m=!0):ze(s)?(p=!0,m=s.some(w=>Un(w)||ns(w)),u=()=>s.map(w=>{if(jt(w))return w.value;if(Un(w))return c(w);if(at(w))return l?l(w,2):w()})):at(s)?e?u=l?()=>l(s,2):s:u=()=>{if(d){Yn();try{d()}finally{Gn()}}const w=Xr;Xr=h;try{return l?l(s,3,[f]):s(f)}finally{Xr=w}}:u=cn,e&&n){const w=u,_=n===!0?1/0:n;u=()=>Rn(w(),_)}const g=Vy(),x=()=>{h.stop(),g&&g.active&&Km(g.effects,h)};if(r&&e){const w=e;e=(..._)=>{const S=w(..._);return x(),S}}let v=p?new Array(s.length).fill(Gl):Gl;const y=w=>{if(!(!(h.flags&1)||!h.dirty&&!w))if(e){const _=h.run();if(w||n||m||(p?_.some((S,b)=>sn(S,v[b])):sn(_,v))){d&&d();const S=Xr;Xr=h;try{const b=[_,v===Gl?void 0:p&&v[0]===Gl?[]:v,f];v=_,l?l(e,3,b):e(...b)}finally{Xr=S}}}else h.run()};return a&&a(y),h=new Yy(u),h.scheduler=o?()=>o(y,!1):y,f=w=>zM(w,!1,h),d=h.onStop=()=>{const w=jc.get(h);if(w){if(l)l(w,4);else for(const _ of w)_();jc.delete(h)}},e?i?y(!0):v=h.run():o?o(y.bind(null,!0),!0):h.run(),x.pause=h.pause.bind(h),x.resume=h.resume.bind(h),x.stop=x,x}function Rn(s,e=1/0,t){if(e<=0||!Pt(s)||s.__v_skip||(t=t||new Map,(t.get(s)||0)>=e))return s;if(t.set(s,e),e--,jt(s))Rn(s.value,e,t);else if(ze(s))for(let i=0;i{Rn(i,e,t)});else if(Oy(s)){for(const i in s)Rn(s[i],e,t);for(const i of Object.getOwnPropertySymbols(s))Object.prototype.propertyIsEnumerable.call(s,i)&&Rn(s[i],e,t)}return s}/** -* @vue/runtime-core v3.5.41 -* (c) 2018-present Yuxi (Evan) You and Vue contributors -* @license MIT -**/function El(s,e,t,i){try{return i?s(...i):s()}catch(n){qh(n,e,t)}}function gs(s,e,t,i){if(at(s)){const n=El(s,e,t,i);return n&&ky(n)&&n.catch(r=>{qh(r,e,t)}),n}if(ze(s)){const n=[];for(let r=0;r>>1,n=Ui[i],r=ul(n);r=ul(t)?Ui.push(s):Ui.splice(ZM(e),0,s),s.flags|=1,rx()}}function rx(){Hc||(Hc=nx.then(ax))}function JM(s){if(!ze(s))lr&&s.id===-1?lr.splice(Oo+1,0,s):s.flags&1||(zo.push(s),s.flags|=1);else for(let e=0;eul(t)-ul(i));if(zo.length=0,lr){for(let t=0;ts.id==null?s.flags&2?-1:1/0:s.id;function ax(s){try{for(Ws=0;Ws{i._d&&Zc(-1);const r=Wc(e),o=$n.length;let a;try{a=s(...n)}finally{for(let l=$n.length;l>o;l--)cp();Wc(r),i._d&&Zc(1)}return a};return i._n=!0,i._c=!0,i._d=!0,i}function ce(s,e){if(Oi===null)return s;const t=su(Oi),i=s.dirs||(s.dirs=[]);for(let n=0;n1)return t&&at(e)?e.call(i&&i.proxy):e}}function QM(){return!!(hp()||no)}const eT=Symbol.for("v-scx"),tT=()=>qo(eT);function Lo(s,e){return rp(s,null,e)}function ai(s,e,t){return rp(s,e,t)}function rp(s,e,t=Lt){const{immediate:i,deep:n,flush:r,once:o}=t,a=pi({},t),l=e&&i||!e&&r!=="post";let c;if(gl){if(r==="sync"){const f=tT();c=f.__watcherHandles||(f.__watcherHandles=[])}else if(!l){const f=()=>{};return f.stop=cn,f.resume=cn,f.pause=cn,f}}const h=$i;a.call=(f,m,p)=>gs(f,h,m,p);let u=!1;r==="post"?a.scheduler=f=>{Bi(f,h&&h.suspense)}:r!=="sync"&&(u=!0,a.scheduler=(f,m)=>{m?f():np(f)}),a.augmentJob=f=>{e&&(f.flags|=4),u&&(f.flags|=2,h&&(f.id=h.uid,f.i=h))};const d=qM(s,e,a);return gl&&(c?c.push(d):l&&d()),d}function iT(s,e,t){const i=this.proxy,n=Gt(s)?s.includes(".")?hx(i,s):()=>i[s]:s.bind(i,i);let r;at(e)?r=e:(r=e.handler,t=e);const o=Il(this),a=rp(n,r.bind(i),t);return o(),a}function hx(s,e){const t=e.split(".");return()=>{let i=s;for(let n=0;ns.__isTeleport,Wr=s=>s&&(s.disabled||s.disabled===""),sT=s=>s&&(s.defer||s.defer===""),qp=s=>typeof SVGElement<"u"&&s instanceof SVGElement,Kp=s=>typeof MathMLElement=="function"&&s instanceof MathMLElement,Cf=(s,e)=>{const t=s&&s.to;return Gt(t)?e?e(t):null:t},nT={name:"Teleport",__isTeleport:!0,process(s,e,t,i,n,r,o,a,l,c){const{mc:h,pc:u,pbc:d,o:{insert:f,querySelector:m,createText:p,createComment:g,parentNode:x}}=c,v=Wr(e.props);let{dynamicChildren:y}=e;const w=(b,C,A)=>{b.shapeFlag&16&&h(b.children,C,A,n,r,o,a,l)},_=(b=e)=>{const C=Wr(b.props),A=b.target=Cf(b.props,m),P=Ef(A,b,p,f);A&&(o!=="svg"&&qp(A)?o="svg":o!=="mathml"&&Kp(A)&&(o="mathml"),n&&n.isCE&&(n.ce._teleportTargets||(n.ce._teleportTargets=new Set)).add(A),C||(w(b,A,P),Da(b,!1)))},S=b=>{const C=()=>{if(sr.get(b)===C){if(sr.delete(b),Wr(b.props)){const A=x(b.el)||t;w(b,A,b.anchor),Da(b,!0)}_(b)}};sr.set(b,C),Bi(C,r)};if(s==null){const b=e.el=p(""),C=e.anchor=p("");if(f(b,t,i),f(C,t,i),sT(e.props)||r&&r.pendingBranch){S(e);return}v&&(w(e,t,C),Da(e,!0)),_()}else{e.el=s.el;const b=e.anchor=s.anchor,C=sr.get(s);if(C){C.flags|=8,sr.delete(s),S(e);return}e.targetStart=s.targetStart;const A=e.target=s.target,P=e.targetAnchor=s.targetAnchor,E=Wr(s.props),R=E?t:A,O=E?b:P;if(o==="svg"||qp(A)?o="svg":(o==="mathml"||Kp(A))&&(o="mathml"),y?(d(s.dynamicChildren,y,R,n,r,o,a),lp(s,e,!0)):l||u(s,e,R,O,n,r,o,a,!1),v)E?e.props&&s.props&&e.props.to!==s.props.to&&(e.props.to=s.props.to):jl(e,t,b,c,1);else if((e.props&&e.props.to)!==(s.props&&s.props.to)){const U=Cf(e.props,m);U&&(e.target=U,jl(e,U,null,c,0))}else E&&jl(e,A,P,c,1);Da(e,v)}},remove(s,e,t,{um:i,o:{remove:n}},r){const{shapeFlag:o,children:a,anchor:l,targetStart:c,targetAnchor:h,target:u,props:d}=s,f=Wr(d),m=r||!f,p=sr.get(s);if(p&&(p.flags|=8,sr.delete(s)),u&&(n(c),n(h)),r&&n(l),!p&&(f||u)&&o&16)for(let g=0;g{s.isMounted=!0}),Rr(()=>{s.isUnmounting=!0}),s}const as=[Function,Array],fx={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:as,onEnter:as,onAfterEnter:as,onEnterCancelled:as,onBeforeLeave:as,onLeave:as,onAfterLeave:as,onLeaveCancelled:as,onBeforeAppear:as,onAppear:as,onAfterAppear:as,onAppearCancelled:as},mx=s=>{const e=s.subTree;return e.component?mx(e.component):e},aT={name:"BaseTransition",props:fx,setup(s,{slots:e}){const t=hp(),i=oT();return()=>{const n=e.default&&vx(e.default(),!0),r=n&&n.length?px(n):t.subTree?xe():void 0;if(!r)return;const o=Tt(s),{mode:a}=o;if(i.isLeaving)return Pu(r);const l=zc(r);if(!l)return Pu(r);let c=Af(l,o,i,t,u=>c=u);l.type!==Fi&&dl(l,c);let h=t.subTree&&zc(t.subTree);if(h&&h.type!==Fi&&!zr(h,l)&&mx(t).type!==Fi){let u=Af(h,o,i,t);if(dl(h,u),a==="out-in"&&l.type!==Fi)return i.isLeaving=!0,u.afterLeave=()=>{i.isLeaving=!1,t.job.flags&8||t.update(),delete u.afterLeave,h=void 0},Pu(r);a==="in-out"&&l.type!==Fi?u.delayLeave=(d,f,m)=>{const p=gx(i,h);p[String(h.key)]=h,d[us]=()=>{f(),d[us]=void 0,delete c.delayedLeave,h=void 0},c.delayedLeave=()=>{m(),delete c.delayedLeave,h=void 0}}:h=void 0}else h&&(h=void 0);return r}}};function px(s){let e=s[0];if(s.length>1){for(const t of s)if(t.type!==Fi){e=t;break}}return e}const lT=aT;function gx(s,e){const{leavingVNodes:t}=s;let i=t.get(e.type);return i||(i=Object.create(null),t.set(e.type,i)),i}function Af(s,e,t,i,n){const{appear:r,mode:o,persisted:a=!1,onBeforeEnter:l,onEnter:c,onAfterEnter:h,onEnterCancelled:u,onBeforeLeave:d,onLeave:f,onAfterLeave:m,onLeaveCancelled:p,onBeforeAppear:g,onAppear:x,onAfterAppear:v,onAppearCancelled:y}=e,w=String(s.key),_=gx(t,s),S=(A,P)=>{A&&gs(A,i,9,P)},b=(A,P)=>{const E=P[1];S(A,P),ze(A)?A.every(R=>R.length<=1)&&E():A.length<=1&&E()},C={mode:o,persisted:a,beforeEnter(A){let P=l;if(!t.isMounted)if(r)P=g||l;else return;A[us]&&A[us](!0);const E=_[w];E&&zr(s,E)&&E.el[us]&&E.el[us](),S(P,[A])},enter(A){if(_[w]===s)return;let P=c,E=h,R=u;if(!t.isMounted)if(r)P=x||c,E=v||h,R=y||u;else return;let O=!1;A[Ia]=G=>{O||(O=!0,G?S(R,[A]):S(E,[A]),C.delayedLeave&&C.delayedLeave(),A[Ia]=void 0)};const U=A[Ia].bind(null,!1);P?b(P,[A,U]):U()},leave(A,P){const E=String(s.key);if(A[Ia]&&A[Ia](!0),t.isUnmounting)return P();S(d,[A]);let R=!1;A[us]=U=>{R||(R=!0,P(),U?S(p,[A]):S(m,[A]),A[us]=void 0,_[E]===s&&delete _[E])};const O=A[us].bind(null,!1);_[E]=s,f?b(f,[A,O]):O()},clone(A){const P=Af(A,e,t,i,n);return n&&n(P),P}};return C}function Pu(s){if(Qh(s))return s=Cr(s),s.children=null,s}function zc(s){if(!Qh(s))return Jh(s.type)&&s.children?px(s.children):s;if(s.component)return s.component.subTree;const{shapeFlag:e,children:t}=s;if(t){if(e&16)return t[0];if(e&32&&at(t.default))return t.default()}}function dl(s,e){if(s.shapeFlag&6&&s.component){s.transition=e;const t=s.component.subTree;dl(Jh(t.type)&&zc(t)||t,e)}else s.shapeFlag&128?(s.ssContent.transition=e.clone(s.ssContent),s.ssFallback.transition=e.clone(s.ssFallback)):s.transition=e}function vx(s,e=!1,t){let i=[],n=0;for(let r=0;r1)for(let r=0;rJa(p,e&&(ze(e)?e[g]:e),t,i,n));return}if(Ko(i)&&!n){i.shapeFlag&512&&i.type.__asyncResolved&&i.component.subTree.component&&Ja(s,e,t,i.component.subTree);return}const r=i.shapeFlag&4?su(i.component):i.el,o=n?null:r,{i:a,r:l}=s,c=e&&e.r,h=a.refs===Lt?a.refs={}:a.refs,u=a.setupState,d=Tt(u),f=u===Lt?Py:p=>Zp(h,p)?!1:Rt(d,p),m=(p,g)=>!(g&&Zp(h,g));if(c!=null&&c!==l){if(Jp(e),Gt(c))h[c]=null,f(c)&&(u[c]=null);else if(jt(c)){const p=e;m(c,p.k)&&(c.value=null),p.k&&(h[p.k]=null)}}if(at(l))El(l,a,12,[o,h]);else{const p=Gt(l),g=jt(l);if(p||g){const x=()=>{if(s.f){const v=p?f(l)?u[l]:h[l]:m()||!s.k?l.value:h[s.k];if(n)ze(v)&&Km(v,r);else if(ze(v))v.includes(r)||v.push(r);else if(p)h[l]=[r],f(l)&&(u[l]=h[l]);else{const y=[r];m(l,s.k)&&(l.value=y),s.k&&(h[s.k]=y)}}else p?(h[l]=o,f(l)&&(u[l]=o)):g&&(m(l,s.k)&&(l.value=o),s.k&&(h[s.k]=o))};if(o){const v=()=>{x(),qc.delete(s)};v.id=-1,qc.set(s,v),Bi(v,t)}else Jp(s),x()}}}function Jp(s){const e=qc.get(s);e&&(e.flags|=8,qc.delete(s))}Hh().requestIdleCallback;Hh().cancelIdleCallback;const Ko=s=>!!s.type.__asyncLoader,Qh=s=>s.type.__isKeepAlive;function cT(s,e){xx(s,"a",e)}function hT(s,e){xx(s,"da",e)}function xx(s,e,t=$i){const i=s.__wdc||(s.__wdc=()=>{let n=t;for(;n;){if(n.isDeactivated)return;n=n.parent}return s()});if(eu(e,i,t),t){let n=t.parent;for(;n&&n.parent;)Qh(n.parent.vnode)&&uT(i,e,t,n),n=n.parent}}function uT(s,e,t,i){const n=eu(e,s,i,!0);Al(()=>{Km(i[e],n)},t)}function eu(s,e,t=$i,i=!1){if(t){const n=t[s]||(t[s]=[]),r=e.__weh||(e.__weh=(...o)=>{Yn();const a=Il(t),l=gs(e,t,s,o);return a(),Gn(),l});return i?n.unshift(r):n.push(r),r}}const Kn=s=>(e,t=$i)=>{(!gl||s==="sp")&&eu(s,(...i)=>e(...i),t)},dT=Kn("bm"),ys=Kn("m"),fT=Kn("bu"),mT=Kn("u"),Rr=Kn("bum"),Al=Kn("um"),pT=Kn("sp"),gT=Kn("rtg"),vT=Kn("rtc");function yT(s,e=$i){eu("ec",s,e)}const xT=Symbol.for("v-ndc");function Et(s,e,t,i){let n;const r=t,o=ze(s);if(o||Gt(s)){const a=o&&Un(s);let l=!1,c=!1;a&&(l=!ns(s),c=jn(s),s=Wh(s)),n=new Array(s.length);for(let h=0,u=s.length;he(a,l,void 0,r));else{const a=Object.keys(s);n=new Array(a.length);for(let l=0,c=a.length;l0;return K(),Ct(_e,null,[we("slot",c,i)],h?-2:64)}let o=s[e];o&&o._c&&(o._d=!1);const a=$n.length;K();let l;try{const c=o&&bx(o(t)),h=t.key||r||c&&c.key;l=Ct(_e,{key:(h&&!rs(h)?h:`_${e}`)+(!c&&i?"_fb":"")},c||(i?i():[]),c&&s._===1?64:-2)}catch(c){for(let h=$n.length;h>a;h--)cp();throw c}finally{o&&o._c&&(o._d=!0)}return l}function bx(s){return s.some(e=>ml(e)?!(e.type===Fi||e.type===_e&&!bx(e.children)):!0)?s:null}const If=s=>s?Ux(s)?su(s):If(s.parent):null,Qa=pi(Object.create(null),{$:s=>s,$el:s=>s.vnode.el,$data:s=>s.data,$props:s=>s.props,$attrs:s=>s.attrs,$slots:s=>s.slots,$refs:s=>s.refs,$parent:s=>If(s.parent),$root:s=>If(s.root),$host:s=>s.ce,$emit:s=>s.emit,$options:s=>Sx(s),$forceUpdate:s=>s.f||(s.f=()=>{np(s.update)}),$nextTick:s=>s.n||(s.n=Kh.bind(s.proxy)),$watch:s=>iT.bind(s)}),ku=(s,e)=>s!==Lt&&!s.__isScriptSetup&&Rt(s,e),wT={get({_:s},e){if(e==="__v_skip")return!0;const{ctx:t,setupState:i,data:n,props:r,accessCache:o,type:a,appContext:l}=s;if(e[0]!=="$"){const d=o[e];if(d!==void 0)switch(d){case 1:return i[e];case 2:return n[e];case 4:return t[e];case 3:return r[e]}else{if(ku(i,e))return o[e]=1,i[e];if(n!==Lt&&Rt(n,e))return o[e]=2,n[e];if(Rt(r,e))return o[e]=3,r[e];if(t!==Lt&&Rt(t,e))return o[e]=4,t[e];Rf&&(o[e]=0)}}const c=Qa[e];let h,u;if(c)return e==="$attrs"&&Pi(s.attrs,"get",""),c(s);if((h=a.__cssModules)&&(h=h[e]))return h;if(t!==Lt&&Rt(t,e))return o[e]=4,t[e];if(u=l.config.globalProperties,Rt(u,e))return u[e]},set({_:s},e,t){const{data:i,setupState:n,ctx:r}=s;return ku(n,e)?(n[e]=t,!0):i!==Lt&&Rt(i,e)?(i[e]=t,!0):Rt(s.props,e)||e[0]==="$"&&e.slice(1)in s?!1:(r[e]=t,!0)},has({_:{data:s,setupState:e,accessCache:t,ctx:i,appContext:n,props:r,type:o}},a){let l;return!!(t[a]||s!==Lt&&a[0]!=="$"&&Rt(s,a)||ku(e,a)||Rt(r,a)||Rt(i,a)||Rt(Qa,a)||Rt(n.config.globalProperties,a)||(l=o.__cssModules)&&l[a])},defineProperty(s,e,t){return t.get!=null?s._.accessCache[e]=0:Rt(t,"value")&&this.set(s,e,t.value,null),Reflect.defineProperty(s,e,t)}};function Qp(s){return ze(s)?s.reduce((e,t)=>(e[t]=null,e),{}):s}let Rf=!0;function ST(s){const e=Sx(s),t=s.proxy,i=s.ctx;Rf=!1,e.beforeCreate&&eg(e.beforeCreate,s,"bc");const{data:n,computed:r,methods:o,watch:a,provide:l,inject:c,created:h,beforeMount:u,mounted:d,beforeUpdate:f,updated:m,activated:p,deactivated:g,beforeDestroy:x,beforeUnmount:v,destroyed:y,unmounted:w,render:_,renderTracked:S,renderTriggered:b,errorCaptured:C,serverPrefetch:A,expose:P,inheritAttrs:E,components:R,directives:O,filters:U}=e;if(c&&MT(c,i,null),o)for(const X in o){const D=o[X];at(D)&&(i[X]=D.bind(t))}if(n){const X=n.call(t,t);Pt(X)&&(s.data=po(X))}if(Rf=!0,r)for(const X in r){const D=r[X],k=at(D)?D.bind(t,t):at(D.get)?D.get.bind(t,t):cn,N=!at(D)&&at(D.set)?D.set.bind(t):cn,F=Le({get:k,set:N});Object.defineProperty(i,X,{enumerable:!0,configurable:!0,get:()=>F.value,set:V=>F.value=V})}if(a)for(const X in a)wx(a[X],i,t,X);if(l){const X=at(l)?l.call(t):l;Reflect.ownKeys(X).forEach(D=>{cx(D,X[D])})}h&&eg(h,s,"c");function $(X,D){ze(D)?D.forEach(k=>X(k.bind(t))):D&&X(D.bind(t))}if($(dT,u),$(ys,d),$(fT,f),$(mT,m),$(cT,p),$(hT,g),$(yT,C),$(vT,S),$(gT,b),$(Rr,v),$(Al,w),$(pT,A),ze(P))if(P.length){const X=s.exposed||(s.exposed={});P.forEach(D=>{Object.defineProperty(X,D,{get:()=>t[D],set:k=>t[D]=k,enumerable:!0})})}else s.exposed||(s.exposed={});_&&s.render===cn&&(s.render=_),E!=null&&(s.inheritAttrs=E),R&&(s.components=R),O&&(s.directives=O),A&&yx(s)}function MT(s,e,t=cn){ze(s)&&(s=Pf(s));for(const i in s){const n=s[i];let r;Pt(n)?"default"in n?r=qo(n.from||i,n.default,!0):r=qo(n.from||i):r=qo(n),jt(r)?Object.defineProperty(e,i,{enumerable:!0,configurable:!0,get:()=>r.value,set:o=>r.value=o}):e[i]=r}}function eg(s,e,t){gs(ze(s)?s.map(i=>i.bind(e.proxy)):s.bind(e.proxy),e,t)}function wx(s,e,t,i){let n=i.includes(".")?hx(t,i):()=>t[i];if(Gt(s)){const r=e[s];at(r)&&ai(n,r)}else if(at(s))ai(n,s.bind(t));else if(Pt(s))if(ze(s))s.forEach(r=>wx(r,e,t,i));else{const r=at(s.handler)?s.handler.bind(t):e[s.handler];at(r)&&ai(n,r,s)}}function Sx(s){const e=s.type,{mixins:t,extends:i}=e,{mixins:n,optionsCache:r,config:{optionMergeStrategies:o}}=s.appContext,a=r.get(e);let l;return a?l=a:!n.length&&!t&&!i?l=e:(l={},n.length&&n.forEach(c=>Kc(l,c,o,!0)),Kc(l,e,o)),Pt(e)&&r.set(e,l),l}function Kc(s,e,t,i=!1){const{mixins:n,extends:r}=e;r&&Kc(s,r,t,!0),n&&n.forEach(o=>Kc(s,o,t,!0));for(const o in e)if(!(i&&o==="expose")){const a=TT[o]||t&&t[o];s[o]=a?a(s[o],e[o]):e[o]}return s}const TT={data:tg,props:ig,emits:ig,methods:Ua,computed:Ua,beforeCreate:Li,created:Li,beforeMount:Li,mounted:Li,beforeUpdate:Li,updated:Li,beforeDestroy:Li,beforeUnmount:Li,destroyed:Li,unmounted:Li,activated:Li,deactivated:Li,errorCaptured:Li,serverPrefetch:Li,components:Ua,directives:Ua,watch:CT,provide:tg,inject:_T};function tg(s,e){return e?s?function(){return pi(at(s)?s.call(this,this):s,at(e)?e.call(this,this):e)}:e:s}function _T(s,e){return Ua(Pf(s),Pf(e))}function Pf(s){if(ze(s)){const e={};for(let t=0;te==="modelValue"||e==="model-value"?s.modelModifiers:s[`${e}Modifiers`]||s[`${ks(e)}Modifiers`]||s[`${Ir(e)}Modifiers`];function RT(s,e,...t){if(s.isUnmounted)return;const i=s.vnode.props||Lt;let n=t;const r=e.startsWith("update:"),o=r&&IT(i,e.slice(7));o&&(o.trim&&(n=t.map(h=>Gt(h)?h.trim():h)),o.number&&(n=t.map(jh)));let a,l=i[a=Cu(e)]||i[a=Cu(ks(e))];!l&&r&&(l=i[a=Cu(Ir(e))]),l&&gs(l,s,6,n);const c=i[a+"Once"];if(c){if(!s.emitted)s.emitted={};else if(s.emitted[a])return;s.emitted[a]=!0,gs(c,s,6,n)}}const PT=new WeakMap;function Tx(s,e,t=!1){const i=t?PT:e.emitsCache,n=i.get(s);if(n!==void 0)return n;const r=s.emits;let o={},a=!1;if(!at(s)){const l=c=>{const h=Tx(c,e,!0);h&&(a=!0,pi(o,h))};!t&&e.mixins.length&&e.mixins.forEach(l),s.extends&&l(s.extends),s.mixins&&s.mixins.forEach(l)}return!r&&!a?(Pt(s)&&i.set(s,null),null):(ze(r)?r.forEach(l=>o[l]=null):pi(o,r),Pt(s)&&i.set(s,o),o)}function tu(s,e){return!s||!Xh(e)?!1:(e=e.slice(2),e=e==="Once"?e:e.replace(/Once$/,""),Rt(s,e[0].toLowerCase()+e.slice(1))||Rt(s,Ir(e))||Rt(s,e))}function sg(s){const{type:e,vnode:t,proxy:i,withProxy:n,propsOptions:[r],slots:o,attrs:a,emit:l,render:c,renderCache:h,props:u,data:d,setupState:f,ctx:m,inheritAttrs:p}=s,g=Wc(s);let x,v;try{if(t.shapeFlag&4){const w=n||i,_=w;x=Qs(c.call(_,w,h,u,f,d,m)),v=a}else{const w=e;x=Qs(w.length>1?w(u,{attrs:a,slots:o,emit:l}):w(u,null)),v=e.props?a:kT(a)}}catch(w){$n.length=0,qh(w,s,1),x=we(Fi)}let y=x;if(v&&p!==!1){const w=Object.keys(v),{shapeFlag:_}=y;w.length&&_&7&&(r&&w.some(Vh)&&(v=FT(v,r)),y=Cr(y,v,!1,!0))}if(t.dirs&&(y=Cr(y,null,!1,!0),y.dirs=y.dirs?y.dirs.concat(t.dirs):t.dirs),t.transition){const w=Jh(y.type)&&zc(y)||y;dl(w,t.transition)}return x=y,Wc(g),x}const kT=s=>{let e;for(const t in s)(t==="class"||t==="style"||Xh(t))&&((e||(e={}))[t]=s[t]);return e},FT=(s,e)=>{const t={};for(const i in s)(!Vh(i)||!(i.slice(9)in e))&&(t[i]=s[i]);return t};function OT(s,e,t){const{props:i,children:n,component:r}=s,{props:o,children:a,patchFlag:l}=e,c=r.emitsOptions;if(e.dirs||e.transition)return!0;if(t&&l>=0){if(l&1024)return!0;if(l&16)return i?ng(i,o,c):!!o;if(l&8){const h=e.dynamicProps;for(let u=0;uObject.create(Cx),Ax=s=>Object.getPrototypeOf(s)===Cx;function BT(s,e,t,i=!1){const n={},r=Ex();s.propsDefaults=Object.create(null),Ix(s,e,n,r);for(const o in s.propsOptions[0])o in n||(n[o]=void 0);t?s.props=i?n:UM(n):s.type.props?s.props=n:s.props=r,s.attrs=r}function NT(s,e,t,i){const{props:n,attrs:r,vnode:{patchFlag:o}}=s,a=Tt(n),[l]=s.propsOptions;let c=!1;if((i||o>0)&&!(o&16)){if(o&8){const h=s.vnode.dynamicProps;for(let u=0;u{l=!0;const[d,f]=Rx(u,e,!0);pi(o,d),f&&a.push(...f)};!t&&e.mixins.length&&e.mixins.forEach(h),s.extends&&h(s.extends),s.mixins&&s.mixins.forEach(h)}if(!r&&!l)return Pt(s)&&i.set(s,Ho),Ho;if(ze(r))for(let h=0;hs==="_"||s==="_ctx"||s==="$stable",ap=s=>ze(s)?s.map(Qs):[Qs(s)],UT=(s,e,t)=>{if(e._n)return e;const i=Zh((...n)=>ap(e(...n)),t);return i._c=!1,i},Px=(s,e,t)=>{const i=s._ctx;for(const n in s){if(op(n))continue;const r=s[n];if(at(r))e[n]=UT(n,r,i);else if(r!=null){const o=ap(r);e[n]=()=>o}}},kx=(s,e)=>{const t=ap(e);s.slots.default=()=>t},Fx=(s,e,t)=>{for(const i in e)(t||!op(i))&&(s[i]=e[i])},$T=(s,e,t)=>{const i=s.slots=Ex();if(s.vnode.shapeFlag&32){const n=e._;n?(Fx(i,e,t),t&&By(i,"_",n,!0)):Px(e,i)}else e&&kx(s,e)},XT=(s,e,t)=>{const{vnode:i,slots:n}=s;let r=!0,o=Lt;if(i.shapeFlag&32){const a=e._;a?t&&a===1?r=!1:Fx(n,e,t):(r=!e.$stable,Px(e,n)),o=e}else e&&(kx(s,e),o={default:1});if(r)for(const a in n)!op(a)&&o[a]==null&&delete n[a]},Bi=HT;function VT(s){return YT(s)}function YT(s,e){const t=Hh();t.__VUE__=!0;const{insert:i,remove:n,patchProp:r,createElement:o,createText:a,createComment:l,setText:c,setElementText:h,parentNode:u,nextSibling:d,setScopeId:f=cn,insertStaticContent:m}=s,p=(H,W,Z,L=null,B=null,j=null,ie=void 0,ue=null,me=!!W.dynamicChildren)=>{if(H===W)return;H&&!zr(H,W)&&(L=oe(H),V(H,B,j,!0),H=null),W.patchFlag===-2&&(me=!1,W.dynamicChildren=null);const{type:ee,ref:Me,shapeFlag:be}=W;switch(ee){case iu:g(H,W,Z,L);break;case Fi:x(H,W,Z,L);break;case Ac:H==null&&v(W,Z,L,ie);break;case _e:R(H,W,Z,L,B,j,ie,ue,me);break;default:be&1?_(H,W,Z,L,B,j,ie,ue,me):be&6?O(H,W,Z,L,B,j,ie,ue,me):(be&64||be&128)&&ee.process(H,W,Z,L,B,j,ie,ue,me,he)}Me!=null&&B?Ja(Me,H&&H.ref,j,W||H,!W):Me==null&&H&&H.ref!=null&&Ja(H.ref,null,j,H,!0)},g=(H,W,Z,L)=>{if(H==null)i(W.el=a(W.children),Z,L);else{const B=W.el=H.el;W.children!==H.children&&c(B,W.children)}},x=(H,W,Z,L)=>{H==null?i(W.el=l(W.children||""),Z,L):W.el=H.el},v=(H,W,Z,L)=>{[H.el,H.anchor]=m(H.children,W,Z,L,H.el,H.anchor)},y=({el:H,anchor:W},Z,L)=>{let B;for(;H&&H!==W;)B=d(H),i(H,Z,L),H=B;i(W,Z,L)},w=({el:H,anchor:W})=>{let Z;for(;H&&H!==W;)Z=d(H),n(H),H=Z;n(W)},_=(H,W,Z,L,B,j,ie,ue,me)=>{if(W.type==="svg"?ie="svg":W.type==="math"&&(ie="mathml"),H==null)S(W,Z,L,B,j,ie,ue,me);else{const ee=H.el&&H.el._isVueCE?H.el:null;try{ee&&ee._beginPatch(),A(H,W,B,j,ie,ue,me)}finally{ee&&ee._endPatch()}}},S=(H,W,Z,L,B,j,ie,ue)=>{let me,ee;const{props:Me,shapeFlag:be,transition:pe,dirs:Ne}=H;if(me=H.el=o(H.type,j,Me&&Me.is,Me),be&8?h(me,H.children):be&16&&C(H.children,me,null,L,B,Fu(H,j),ie,ue),Ne&&Or(H,null,L,"created"),b(me,H,H.scopeId,ie,L),Me){for(const st in Me)st!=="value"&&!qa(st)&&r(me,st,null,Me[st],j,L);"value"in Me&&r(me,"value",null,Me.value,j),(ee=Me.onVnodeBeforeMount)&&Xs(ee,L,H)}Ne&&Or(H,null,L,"beforeMount");const Ye=GT(B,pe);Ye&&pe.beforeEnter(me),i(me,W,Z),((ee=Me&&Me.onVnodeMounted)||Ye||Ne)&&Bi(()=>{try{ee&&Xs(ee,L,H),Ye&&pe.enter(me),Ne&&Or(H,null,L,"mounted")}finally{}},B)},b=(H,W,Z,L,B)=>{if(Z&&f(H,Z),L)for(let j=0;j{for(let ee=me;ee{const ue=W.el=H.el;let{patchFlag:me,dynamicChildren:ee,dirs:Me}=W;me|=H.patchFlag&16;const be=H.props||Lt,pe=W.props||Lt;let Ne;if(Z&&Lr(Z,!1),(Ne=pe.onVnodeBeforeUpdate)&&Xs(Ne,Z,W,H),Me&&Or(W,H,Z,"beforeUpdate"),Z&&Lr(Z,!0),ee&&(!H.dynamicChildren||H.dynamicChildren.length!==ee.length)&&(me=0,ie=!1,ee=null),(be.innerHTML&&pe.innerHTML==null||be.textContent&&pe.textContent==null)&&h(ue,""),ee?P(H.dynamicChildren,ee,ue,Z,L,Fu(W,B),j):ie||D(H,W,ue,null,Z,L,Fu(W,B),j,!1),me>0){if(me&16)E(ue,be,pe,Z,B);else if(me&2&&be.class!==pe.class&&r(ue,"class",null,pe.class,B),me&4&&r(ue,"style",be.style,pe.style,B),me&8){const Ye=W.dynamicProps;for(let st=0;st{Ne&&Xs(Ne,Z,W,H),Me&&Or(W,H,Z,"updated")},L)},P=(H,W,Z,L,B,j,ie)=>{for(let ue=0;ue{if(W!==Z){if(W!==Lt)for(const j in W)!qa(j)&&!(j in Z)&&r(H,j,W[j],null,B,L);for(const j in Z){if(qa(j))continue;const ie=Z[j],ue=W[j];ie!==ue&&j!=="value"&&r(H,j,ue,ie,B,L)}"value"in Z&&r(H,"value",W.value,Z.value,B)}},R=(H,W,Z,L,B,j,ie,ue,me)=>{const ee=W.el=H?H.el:a(""),Me=W.anchor=H?H.anchor:a("");let{patchFlag:be,dynamicChildren:pe,slotScopeIds:Ne}=W;Ne&&(ue=ue?ue.concat(Ne):Ne),H==null?(i(ee,Z,L),i(Me,Z,L),C(W.children||[],Z,Me,B,j,ie,ue,me)):be>0&&be&64&&pe&&H.dynamicChildren&&H.dynamicChildren.length===pe.length?(P(H.dynamicChildren,pe,Z,B,j,ie,ue),(W.key!=null||B&&W===B.subTree)&&lp(H,W,!0)):D(H,W,Z,Me,B,j,ie,ue,me)},O=(H,W,Z,L,B,j,ie,ue,me)=>{W.slotScopeIds=ue,H==null?W.shapeFlag&512?B.ctx.activate(W,Z,L,ie,me):U(W,Z,L,B,j,ie,me):G(H,W,me)},U=(H,W,Z,L,B,j,ie)=>{const ue=H.component=JT(H,L,B);if(Qh(H)&&(ue.ctx.renderer=he),QT(ue,!1,ie),ue.asyncDep){if(B&&B.registerDep(ue,$,ie),!H.el){const me=ue.subTree=we(Fi);x(null,me,W,Z),H.placeholder=me.el}}else $(ue,H,W,Z,B,j,ie)},G=(H,W,Z)=>{const L=W.component=H.component;if(OT(H,W,Z))if(L.asyncDep&&!L.asyncResolved){X(L,W,Z);return}else L.next=W,L.update();else W.el=H.el,L.vnode=W},$=(H,W,Z,L,B,j,ie)=>{const ue=()=>{if(H.isMounted){let{next:be,bu:pe,u:Ne,parent:Ye,vnode:st}=H;{const Je=Ox(H);if(Je){be&&(be.el=st.el,X(H,be,ie)),Je.asyncDep.then(()=>{Bi(()=>{H.isUnmounted||ee()},B)});return}}let Ze=be,nt;Lr(H,!1),be?(be.el=st.el,X(H,be,ie)):be=st,pe&&Ec(pe),(nt=be.props&&be.props.onVnodeBeforeUpdate)&&Xs(nt,Ye,be,st),Lr(H,!0);const Ve=sg(H),Ee=H.subTree;H.subTree=Ve,p(Ee,Ve,u(Ee.el),oe(Ee),H,B,j),be.el=Ve.el,Ze===null&<(H,Ve.el),Ne&&Bi(Ne,B),(nt=be.props&&be.props.onVnodeUpdated)&&Bi(()=>Xs(nt,Ye,be,st),B)}else{let be;const{el:pe,props:Ne}=W,{bm:Ye,m:st,parent:Ze,root:nt,type:Ve}=H,Ee=Ko(W);Lr(H,!1),Ye&&Ec(Ye),!Ee&&(be=Ne&&Ne.onVnodeBeforeMount)&&Xs(be,Ze,W),Lr(H,!0);{nt.ce&&nt.ce._hasShadowRoot()&&nt.ce._injectChildStyle(Ve,H.parent?H.parent.type:void 0);const Je=H.subTree=sg(H);p(null,Je,Z,L,H,B,j),W.el=Je.el}if(st&&Bi(st,B),!Ee&&(be=Ne&&Ne.onVnodeMounted)){const Je=W;Bi(()=>Xs(be,Ze,Je),B)}(W.shapeFlag&256||Ze&&Ko(Ze.vnode)&&Ze.vnode.shapeFlag&256)&&H.a&&Bi(H.a,B),H.isMounted=!0,W=Z=L=null}};H.scope.on();const me=H.effect=new Yy(ue);H.scope.off();const ee=H.update=me.run.bind(me),Me=H.job=me.runIfDirty.bind(me);Me.i=H,Me.id=H.uid,me.scheduler=()=>np(Me),Lr(H,!0),ee()},X=(H,W,Z)=>{W.component=H;const L=H.vnode.props;H.vnode=W,H.next=null,NT(H,W.props,L,Z),XT(H,W.children,Z),Yn(),zp(H),Gn()},D=(H,W,Z,L,B,j,ie,ue,me=!1)=>{const ee=H&&H.children,Me=H?H.shapeFlag:0,be=W.children,{patchFlag:pe,shapeFlag:Ne}=W;if(pe>0){if(pe&128){N(ee,be,Z,L,B,j,ie,ue,me);return}else if(pe&256){k(ee,be,Z,L,B,j,ie,ue,me);return}}Ne&8?(Me&16&&se(ee,B,j),be!==ee&&h(Z,be)):Me&16?Ne&16?N(ee,be,Z,L,B,j,ie,ue,me):se(ee,B,j,!0):(Me&8&&h(Z,""),Ne&16&&C(be,Z,L,B,j,ie,ue,me))},k=(H,W,Z,L,B,j,ie,ue,me)=>{H=H||Ho,W=W||Ho;const ee=H.length,Me=W.length,be=Math.min(ee,Me);let pe;for(pe=0;peMe?se(H,B,j,!0,!1,be):C(W,Z,L,B,j,ie,ue,me,be)},N=(H,W,Z,L,B,j,ie,ue,me)=>{let ee=0;const Me=W.length;let be=H.length-1,pe=Me-1;for(;ee<=be&&ee<=pe;){const Ne=H[ee],Ye=W[ee]=me?An(W[ee]):Qs(W[ee]);if(zr(Ne,Ye))p(Ne,Ye,Z,null,B,j,ie,ue,me);else break;ee++}for(;ee<=be&&ee<=pe;){const Ne=H[be],Ye=W[pe]=me?An(W[pe]):Qs(W[pe]);if(zr(Ne,Ye))p(Ne,Ye,Z,null,B,j,ie,ue,me);else break;be--,pe--}if(ee>be){if(ee<=pe){const Ne=pe+1,Ye=Nepe)for(;ee<=be;)V(H[ee],B,j,!0),ee++;else{const Ne=ee,Ye=ee,st=new Map;for(ee=Ye;ee<=pe;ee++){const ut=W[ee]=me?An(W[ee]):Qs(W[ee]);ut.key!=null&&st.set(ut.key,ee)}let Ze,nt=0;const Ve=pe-Ye+1;let Ee=!1,Je=0;const Ae=new Array(Ve);for(ee=0;ee=Ve){V(ut,B,j,!0);continue}let re;if(ut.key!=null)re=st.get(ut.key);else for(Ze=Ye;Ze<=pe;Ze++)if(Ae[Ze-Ye]===0&&zr(ut,W[Ze])){re=Ze;break}re===void 0?V(ut,B,j,!0):(Ae[re-Ye]=ee+1,re>=Je?Je=re:Ee=!0,p(ut,W[re],Z,null,B,j,ie,ue,me),nt++)}const Qt=Ee?jT(Ae):Ho;for(Ze=Qt.length-1,ee=Ve-1;ee>=0;ee--){const ut=Ye+ee,re=W[ut],ae=W[ut+1],Qe=ut+1{const{el:j,type:ie,transition:ue,children:me,shapeFlag:ee}=H;if(ee&6){F(H.component.subTree,W,Z,L);return}if(ee&128){H.suspense.move(W,Z,L);return}if(ee&64){ie.move(H,W,Z,he);return}if(ie===_e){i(j,W,Z);for(let be=0;beue.enter(j),B));else{const{leave:be,delayLeave:pe,afterLeave:Ne}=ue,Ye=()=>{H.ctx.isUnmounted?n(j):i(j,W,Z)},st=()=>{const Ze=j._isLeaving||!!j[us];j._isLeaving&&j[us](!0),ue.persisted&&!Ze?Ye():be(j,()=>{Ye(),Ne&&Ne()})};pe?pe(j,Ye,st):st()}else i(j,W,Z)},V=(H,W,Z,L=!1,B=!1)=>{const{type:j,props:ie,ref:ue,children:me,dynamicChildren:ee,shapeFlag:Me,patchFlag:be,dirs:pe,cacheIndex:Ne,memo:Ye}=H;if(be===-2&&(B=!1),ue!=null&&(Yn(),Ja(ue,null,Z,H,!0),Gn()),Ne!=null&&(W.renderCache[Ne]=void 0),Me&256){W.ctx.deactivate(H);return}const st=Me&1&&pe,Ze=!Ko(H);let nt;if(Ze&&(nt=ie&&ie.onVnodeBeforeUnmount)&&Xs(nt,W,H),Me&6)z(H.component,Z,L);else{if(Me&128){H.suspense.unmount(Z,L);return}st&&Or(H,null,W,"beforeUnmount"),Me&64?H.type.remove(H,W,Z,he,L):ee&&!ee.hasOnce&&(j!==_e||be>0&&be&64)?se(ee,W,Z,!1,!0):(j===_e&&be&384||!B&&Me&16)&&se(me,W,Z),L&&Y(H)}const Ve=Ye!=null&&Ne==null;(Ze&&(nt=ie&&ie.onVnodeUnmounted)||st||Ve)&&Bi(()=>{nt&&Xs(nt,W,H),st&&Or(H,null,W,"unmounted"),Ve&&(H.el=null)},Z)},Y=H=>{const{type:W,el:Z,anchor:L,transition:B}=H;if(W===_e){q(Z,L);return}if(W===Ac){w(H);return}const j=()=>{n(Z),B&&!B.persisted&&B.afterLeave&&B.afterLeave()};if(H.shapeFlag&1&&B&&!B.persisted){const{leave:ie,delayLeave:ue}=B,me=()=>ie(Z,j);ue?ue(H.el,j,me):me()}else j()},q=(H,W)=>{let Z;for(;H!==W;)Z=d(H),n(H),H=Z;n(W)},z=(H,W,Z)=>{const{bum:L,scope:B,job:j,subTree:ie,um:ue,m:me,a:ee}=H;og(me),og(ee),L&&Ec(L),B.stop(),j&&(j.flags|=8,V(ie,H,W,Z)),ue&&Bi(ue,W),Bi(()=>{H.isUnmounted=!0},W)},se=(H,W,Z,L=!1,B=!1,j=0)=>{for(let ie=j;ie{if(H.shapeFlag&6)return oe(H.component.subTree);if(H.shapeFlag&128)return H.suspense.next();const W=d(H.anchor||H.el),Z=W&&W[ux];return Z?d(Z):W};let de=!1;const ge=(H,W,Z)=>{let L;H==null?W._vnode&&(V(W._vnode,null,null,!0),L=W._vnode.component):p(W._vnode||null,H,W,null,null,null,Z),W._vnode=H,de||(de=!0,zp(L),ox(),de=!1)},he={p,um:V,m:F,r:Y,mt:U,mc:C,pc:D,pbc:P,n:oe,o:s};return{render:ge,hydrate:void 0,createApp:AT(ge)}}function Fu({type:s,props:e},t){return t==="svg"&&s==="foreignObject"||t==="mathml"&&s==="annotation-xml"&&e&&e.encoding&&e.encoding.includes("html")?void 0:t}function Lr({effect:s,job:e},t){t?(s.flags|=32,e.flags|=4):(s.flags&=-33,e.flags&=-5)}function GT(s,e){return(!s||s&&!s.pendingBranch)&&e&&!e.persisted}function lp(s,e,t=!1){const i=s.children,n=e.children;if(ze(i)&&ze(n))for(let r=0;r>1,s[t[a]]0&&(e[i]=t[r-1]),t[r]=i)}}for(r=t.length,o=t[r-1];r-- >0;)t[r]=o,o=e[o];return t}function Ox(s){const e=s.subTree.component;if(e)return e.asyncDep&&!e.asyncResolved?e:Ox(e)}function og(s){if(s)for(let e=0;es.__isSuspense;function HT(s,e){e&&e.pendingBranch?ze(s)?e.effects.push(...s):e.effects.push(s):JM(s)}const _e=Symbol.for("v-fgt"),iu=Symbol.for("v-txt"),Fi=Symbol.for("v-cmt"),Ac=Symbol.for("v-stc"),$n=[];let ss=null;function K(s=!1){$n.push(ss=s?null:[])}function cp(){$n.pop(),ss=$n[$n.length-1]||null}let fl=1;function Zc(s,e=!1){fl+=s,s<0&&ss&&e&&(ss.hasOnce=!0)}function Nx(s){return s.dynamicChildren=fl>0?ss||Ho:null,cp(),fl>0&&ss&&ss.push(s),s}function J(s,e,t,i,n,r){return Nx(T(s,e,t,i,n,r,!0))}function Ct(s,e,t,i,n){return Nx(we(s,e,t,i,n,!0))}function ml(s){return s?s.__v_isVNode===!0:!1}function zr(s,e){return s.type===e.type&&s.key===e.key}const Dx=({key:s})=>s??null,Ic=({ref:s,ref_key:e,ref_for:t})=>(typeof s=="number"&&(s=""+s),s!=null?Gt(s)||jt(s)||at(s)?{i:Oi,r:s,k:e,f:!!t}:s:null);function T(s,e=null,t=null,i=0,n=null,r=s===_e?0:1,o=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:s,props:e,key:e&&Dx(e),ref:e&&Ic(e),scopeId:lx,slotScopeIds:null,children:t,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:r,patchFlag:i,dynamicProps:n,dynamicChildren:null,appContext:null,ctx:Oi};return a?(Jc(l,t),r&128&&s.normalize(l)):t&&(l.shapeFlag|=Gt(t)?8:16),fl>0&&!o&&ss&&(l.patchFlag>0||r&6)&&l.patchFlag!==32&&ss.push(l),l}const we=WT;function WT(s,e=null,t=null,i=0,n=null,r=!1){if((!s||s===xT)&&(s=Fi),ml(s)){const a=Cr(s,e,!0);return t&&Jc(a,t),fl>0&&!r&&ss&&(a.shapeFlag&6?ss[ss.indexOf(s)]=a:ss.push(a)),a.patchFlag=-2,a}if(s2(s)&&(s=s.__vccOpts),e){e=zT(e);let{class:a,style:l}=e;a&&!Gt(a)&&(e.class=Ce(a)),Pt(l)&&(zh(l)&&!ze(l)&&(l=pi({},l)),e.style=Ot(l))}const o=Gt(s)?1:Bx(s)?128:Jh(s)?64:Pt(s)?4:at(s)?2:0;return T(s,e,t,i,n,o,r,!0)}function zT(s){return s?zh(s)||Ax(s)?pi({},s):s:null}function Cr(s,e,t=!1,i=!1){const{props:n,ref:r,patchFlag:o,children:a,transition:l}=s,c=e?qT(n||{},e):n,h={__v_isVNode:!0,__v_skip:!0,type:s.type,props:c,key:c&&Dx(c),ref:e&&e.ref?t&&r?ze(r)?r.concat(Ic(e)):[r,Ic(e)]:Ic(e):r,scopeId:s.scopeId,slotScopeIds:s.slotScopeIds,children:a,target:s.target,targetStart:s.targetStart,targetAnchor:s.targetAnchor,staticCount:s.staticCount,shapeFlag:s.shapeFlag,patchFlag:e&&s.type!==_e?o===-1?16:o|16:o,dynamicProps:s.dynamicProps,dynamicChildren:s.dynamicChildren,appContext:s.appContext,dirs:s.dirs,transition:l,component:s.component,suspense:s.suspense,ssContent:s.ssContent&&Cr(s.ssContent),ssFallback:s.ssFallback&&Cr(s.ssFallback),placeholder:s.placeholder,el:s.el,anchor:s.anchor,ctx:s.ctx,ce:s.ce};return l&&i&&dl(h,l.clone(h)),h}function ft(s=" ",e=0){return we(iu,null,s,e)}function is(s,e){const t=we(Ac,null,s);return t.staticCount=e,t}function xe(s="",e=!1){return e?(K(),Ct(Fi,null,s)):we(Fi,null,s)}function Qs(s){return s==null||typeof s=="boolean"?we(Fi):ze(s)?we(_e,null,s.slice()):ml(s)?An(s):we(iu,null,String(s))}function An(s){return s.el===null&&s.patchFlag!==-1||s.memo?s:Cr(s)}function Jc(s,e){let t=0;const{shapeFlag:i}=s;if(e==null)e=null;else if(ze(e))t=16;else if(typeof e=="object")if(i&65){const n=e.default;n&&(n._c&&(n._d=!1),Jc(s,n()),n._c&&(n._d=!0));return}else{t=32;const n=e._;!n&&!Ax(e)?e._ctx=Oi:n===3&&Oi&&(Oi.slots._===1?e._=1:(e._=2,s.patchFlag|=1024))}else if(at(e)){if(i&65){Jc(s,{default:e});return}e={default:e,_ctx:Oi},t=32}else e=String(e),i&64?(t=16,e=[ft(e)]):t=8;s.children=e,s.shapeFlag|=t}function qT(...s){const e={};for(let t=0;t$i||Oi;let Qc,pl;{const s=Hh(),e=(t,i)=>{let n;return(n=s[t])||(n=s[t]=[]),n.push(i),r=>{n.length>1?n.forEach(o=>o(r)):n[0](r)}};Qc=e("__VUE_INSTANCE_SETTERS__",t=>$i=t),pl=e("__VUE_SSR_SETTERS__",t=>gl=t)}const Il=s=>{const e=$i;return Qc(s),s.scope.on(),()=>{s.scope.off(),Qc(e)}},ag=()=>{$i&&$i.scope.off(),Qc(null)};function Ux(s){return s.vnode.shapeFlag&4}let gl=!1;function QT(s,e=!1,t=!1){e&&pl(e);const{props:i,children:n}=s.vnode,r=Ux(s);BT(s,i,r,e),$T(s,n,t||e);const o=r?e2(s,e):void 0;return e&&pl(!1),o}function e2(s,e){const t=s.type;s.accessCache=Object.create(null),s.proxy=new Proxy(s.ctx,wT);const{setup:i}=t;if(i){Yn();const n=s.setupContext=i.length>1?i2(s):null,r=Il(s),o=El(i,s,0,[s.props,n]),a=ky(o);if(Gn(),r(),(a||s.sp)&&!Ko(s)&&yx(s),a){if(o.then(ag,ag),e)return o.then(l=>{pl(!0);try{lg(s,l,e)}finally{pl(!1)}}).catch(l=>{qh(l,s,0)});s.asyncDep=o}else lg(s,o)}else $x(s)}function lg(s,e,t){at(e)?s.type.__ssrInlineRender?s.ssrRender=e:s.render=e:Pt(e)&&(s.setupState=sx(e)),$x(s)}function $x(s,e,t){const i=s.type;s.render||(s.render=i.render||cn);{const n=Il(s);Yn();try{ST(s)}finally{Gn(),n()}}}const t2={get(s,e){return Pi(s,"get",""),s[e]}};function i2(s){const e=t=>{s.exposed=t||{}};return{attrs:new Proxy(s.attrs,t2),slots:s.slots,emit:s.emit,expose:e}}function su(s){return s.exposed?s.exposeProxy||(s.exposeProxy=new Proxy(sx(vr(s.exposed)),{get(e,t){if(t in e)return e[t];if(t in Qa)return Qa[t](s)},has(e,t){return t in e||t in Qa}})):s.proxy}function s2(s){return at(s)&&"__vccOpts"in s}const Le=(s,e)=>WM(s,e,gl);function n2(s,e,t){try{Zc(-1);const i=arguments.length;return i===2?Pt(e)&&!ze(e)?ml(e)?we(s,null,[e]):we(s,e):we(s,null,e):(i>3?t=Array.prototype.slice.call(arguments,2):i===3&&ml(t)&&(t=[t]),we(s,e,t))}finally{Zc(1)}}const r2="3.5.41";/** -* @vue/runtime-dom v3.5.41 -* (c) 2018-present Yuxi (Evan) You and Vue contributors -* @license MIT -**/let Ff;const cg=typeof window<"u"&&window.trustedTypes;if(cg)try{Ff=cg.createPolicy("vue",{createHTML:s=>s})}catch{}const Xx=Ff?s=>Ff.createHTML(s):s=>s,o2="http://www.w3.org/2000/svg",a2="http://www.w3.org/1998/Math/MathML",Mn=typeof document<"u"?document:null,hg=Mn&&Mn.createElement("template"),l2={insert:(s,e,t)=>{e.insertBefore(s,t||null)},remove:s=>{const e=s.parentNode;e&&e.removeChild(s)},createElement:(s,e,t,i)=>{const n=e==="svg"?Mn.createElementNS(o2,s):e==="mathml"?Mn.createElementNS(a2,s):t?Mn.createElement(s,{is:t}):Mn.createElement(s);return s==="select"&&i&&i.multiple!=null&&n.setAttribute("multiple",i.multiple),n},createText:s=>Mn.createTextNode(s),createComment:s=>Mn.createComment(s),setText:(s,e)=>{s.nodeValue=e},setElementText:(s,e)=>{s.textContent=e},parentNode:s=>s.parentNode,nextSibling:s=>s.nextSibling,querySelector:s=>Mn.querySelector(s),setScopeId(s,e){s.setAttribute(e,"")},insertStaticContent(s,e,t,i,n,r){const o=t?t.previousSibling:e.lastChild;if(n&&(n===r||n.nextSibling))for(;e.insertBefore(n.cloneNode(!0),t),!(n===r||!(n=n.nextSibling)););else{hg.innerHTML=Xx(i==="svg"?`${s}`:i==="mathml"?`${s}`:s);const a=hg.content;if(i==="svg"||i==="mathml"){const l=a.firstChild;for(;l.firstChild;)a.appendChild(l.firstChild);a.removeChild(l)}e.insertBefore(a,t)}return[o?o.nextSibling:e.firstChild,t?t.previousSibling:e.lastChild]}},Qn="transition",Ra="animation",vl=Symbol("_vtc"),Vx={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},c2=pi({},fx,Vx),h2=s=>(s.displayName="Transition",s.props=c2,s),u2=h2((s,{slots:e})=>n2(lT,d2(s),e)),Br=(s,e=[])=>{ze(s)?s.forEach(t=>t(...e)):s&&s(...e)},ug=s=>s?ze(s)?s.some(e=>e.length>1):s.length>1:!1;function d2(s){const e={};for(const R in s)R in Vx||(e[R]=s[R]);if(s.css===!1)return e;const{name:t="v",type:i,duration:n,enterFromClass:r=`${t}-enter-from`,enterActiveClass:o=`${t}-enter-active`,enterToClass:a=`${t}-enter-to`,appearFromClass:l=r,appearActiveClass:c=o,appearToClass:h=a,leaveFromClass:u=`${t}-leave-from`,leaveActiveClass:d=`${t}-leave-active`,leaveToClass:f=`${t}-leave-to`}=s,m=f2(n),p=m&&m[0],g=m&&m[1],{onBeforeEnter:x,onEnter:v,onEnterCancelled:y,onLeave:w,onLeaveCancelled:_,onBeforeAppear:S=x,onAppear:b=v,onAppearCancelled:C=y}=e,A=(R,O,U,G)=>{R._enterCancelled=G,Nr(R,O?h:a),Nr(R,O?c:o),U&&U()},P=(R,O)=>{R._isLeaving=!1,Nr(R,u),Nr(R,f),Nr(R,d),O&&O()},E=R=>(O,U)=>{const G=R?b:v,$=()=>A(O,R,U);Br(G,[O,$]),dg(()=>{Nr(O,R?l:r),xn(O,R?h:a),ug(G)||fg(O,i,p,$)})};return pi(e,{onBeforeEnter(R){Br(x,[R]),xn(R,r),xn(R,o)},onBeforeAppear(R){Br(S,[R]),xn(R,l),xn(R,c)},onEnter:E(!1),onAppear:E(!0),onLeave(R,O){R._isLeaving=!0;const U=()=>P(R,O);xn(R,u),R._enterCancelled?(xn(R,d),gg(R)):(gg(R),xn(R,d)),dg(()=>{R._isLeaving&&(Nr(R,u),xn(R,f),ug(w)||fg(R,i,g,U))}),Br(w,[R,U])},onEnterCancelled(R){A(R,!1,void 0,!0),Br(y,[R])},onAppearCancelled(R){A(R,!0,void 0,!0),Br(C,[R])},onLeaveCancelled(R){P(R),Br(_,[R])}})}function f2(s){if(s==null)return null;if(Pt(s))return[Ou(s.enter),Ou(s.leave)];{const e=Ou(s);return[e,e]}}function Ou(s){return dM(s)}function xn(s,e){e.split(/\s+/).forEach(t=>t&&s.classList.add(t)),(s[vl]||(s[vl]=new Set)).add(e)}function Nr(s,e){e.split(/\s+/).forEach(i=>i&&s.classList.remove(i));const t=s[vl];t&&(t.delete(e),t.size||(s[vl]=void 0))}function dg(s){requestAnimationFrame(()=>{requestAnimationFrame(s)})}let m2=0;function fg(s,e,t,i){const n=s._endId=++m2,r=()=>{n===s._endId&&i()};if(t!=null)return setTimeout(r,t);const{type:o,timeout:a,propCount:l}=p2(s,e);if(!o)return i();const c=o+"end";let h=0;const u=()=>{s.removeEventListener(c,d),r()},d=f=>{f.target===s&&++h>=l&&u()};setTimeout(()=>{h(t[m]||"").split(", "),n=i(`${Qn}Delay`),r=i(`${Qn}Duration`),o=mg(n,r),a=i(`${Ra}Delay`),l=i(`${Ra}Duration`),c=mg(a,l);let h=null,u=0,d=0;e===Qn?o>0&&(h=Qn,u=o,d=r.length):e===Ra?c>0&&(h=Ra,u=c,d=l.length):(u=Math.max(o,c),h=u>0?o>c?Qn:Ra:null,d=h?h===Qn?r.length:l.length:0);const f=h===Qn&&/\b(?:transform|all)(?:,|$)/.test(i(`${Qn}Property`).toString());return{type:h,timeout:u,propCount:d,hasTransform:f}}function mg(s,e){for(;s.lengthpg(t)+pg(s[i])))}function pg(s){return s==="auto"?0:Number(s.slice(0,-1).replace(",","."))*1e3}function gg(s){return(s?s.ownerDocument:document).body.offsetHeight}function g2(s,e,t){const i=s[vl];i&&(e=(e?[e,...i]:[...i]).join(" ")),e==null?s.removeAttribute("class"):t?s.setAttribute("class",e):s.className=e}const eh=Symbol("_vod"),Yx=Symbol("_vsh"),Si={name:"show",beforeMount(s,{value:e},{transition:t}){s[eh]=s.style.display==="none"?"":s.style.display,t&&e?t.beforeEnter(s):Pa(s,e)},mounted(s,{value:e},{transition:t}){t&&e&&t.enter(s)},updated(s,{value:e,oldValue:t},{transition:i}){!e!=!t&&(i?e?(i.beforeEnter(s),Pa(s,!0),i.enter(s)):i.leave(s,()=>{Pa(s,!1)}):Pa(s,e))},beforeUnmount(s,{value:e}){Pa(s,e)}};function Pa(s,e){s.style.display=e?s[eh]:"none",s[Yx]=!e}const v2=Symbol(""),y2=/(?:^|;)\s*display\s*:/;function x2(s,e,t){const i=s.style,n=Gt(t);let r=!1;if(t&&!n){if(e)if(Gt(e))for(const o of e.split(";")){const a=o.slice(0,o.indexOf(":")).trim();t[a]==null&&$a(i,a,"")}else for(const o in e)t[o]==null&&$a(i,o,"");for(const o in t){o==="display"&&(r=!0);const a=t[o];a!=null?w2(s,o,!Gt(e)&&e?e[o]:void 0,a)||$a(i,o,a):$a(i,o,"")}}else if(n){if(e!==t){const o=i[v2];o&&(t+=";"+o),i.cssText=t,r=y2.test(t)}}else e&&s.removeAttribute("style");eh in s&&(s[eh]=r?i.display:"",s[Yx]&&(i.display="none"))}const vg=/\s*!important$/;function $a(s,e,t){if(ze(t))t.forEach(i=>$a(s,e,i));else if(t==null&&(t=""),e.startsWith("--"))s.setProperty(e,t);else{const i=b2(s,e);vg.test(t)?s.setProperty(Ir(i),t.replace(vg,""),"important"):s[i]=t}}const yg=["Webkit","Moz","ms"],Lu={};function b2(s,e){const t=Lu[e];if(t)return t;let i=ks(e);if(i!=="filter"&&i in s)return Lu[e]=i;i=Ly(i);for(let n=0;nBu||(E2.then(()=>Bu=0),Bu=Date.now());function I2(s,e){const t=i=>{if(!i._vts)i._vts=Date.now();else if(i._vts<=t.attached)return;const n=t.value;if(ze(n)){const r=i.stopImmediatePropagation;i.stopImmediatePropagation=()=>{r.call(i),i._stopped=!0};const o=n.slice(),a=[i];for(let l=0;ls.charCodeAt(0)===111&&s.charCodeAt(1)===110&&s.charCodeAt(2)>96&&s.charCodeAt(2)<123,R2=(s,e,t,i,n,r)=>{const o=n==="svg";e==="class"?g2(s,i,o):e==="style"?x2(s,t,i):Xh(e)?Vh(e)||M2(s,e,t,i,r):(e[0]==="."?(e=e.slice(1),!0):e[0]==="^"?(e=e.slice(1),!1):P2(s,e,i,o))?(wg(s,e,i),!s.tagName.includes("-")&&(e==="value"||e==="checked"||e==="selected")&&bg(s,e,i,o,r,e!=="value")):s._isVueCE&&(k2(s,e)||s._def.__asyncLoader&&(/[A-Z]/.test(e)||!Gt(i)))?wg(s,ks(e),i,r,e):(e==="true-value"?s._trueValue=i:e==="false-value"&&(s._falseValue=i),bg(s,e,i,o))};function P2(s,e,t,i){if(i)return!!(e==="innerHTML"||e==="textContent"||e in s&&Mg(e)&&at(t));if(e==="spellcheck"||e==="draggable"||e==="translate"||e==="autocorrect"||e==="sandbox"&&s.tagName==="IFRAME"||e==="form"||e==="list"&&s.tagName==="INPUT"||e==="type"&&s.tagName==="TEXTAREA")return!1;if(e==="width"||e==="height"){const n=s.tagName;if(n==="IMG"||n==="VIDEO"||n==="CANVAS"||n==="SOURCE")return!1}return Mg(e)&&Gt(t)?!1:e in s}function k2(s,e){const t=s._def.props;if(!t)return!1;const i=ks(e);return Array.isArray(t)?t.some(n=>ks(n)===i):Object.keys(t).some(n=>ks(n)===i)}const la=s=>{const e=s.props["onUpdate:modelValue"]||!1;return ze(e)?t=>Ec(e,t):e};function F2(s){s.target.composing=!0}function Tg(s){const e=s.target;e.composing&&(e.composing=!1,e.dispatchEvent(new Event("input")))}const rn=Symbol("_assign"),Hl=Symbol("_initialValue");function Nu(s,e,t){return e&&(s=s.trim()),t&&(s=jh(s)),s}const He={created(s,{modifiers:{lazy:e,trim:t,number:i}},n){s.parentNode&&(s.type==="text"?s[Hl]=s.defaultValue.replace(/[\r\n]/g,""):s.type==="textarea"&&(s[Hl]=s.defaultValue.replace(/\r\n?/g,` -`))),s[rn]=la(n);const r=i||n.props&&n.props.type==="number";fr(s,e?"change":"input",o=>{o.target.composing||s[rn](Nu(s.value,t,r))}),(t||r)&&fr(s,"change",()=>{s.value=Nu(s.value,t,r)}),e||(fr(s,"compositionstart",F2),fr(s,"compositionend",Tg),fr(s,"change",Tg))},mounted(s,{value:e,modifiers:{trim:t,number:i}}){const n=e??"",r=s[Hl];delete s[Hl],r!==void 0&&(s.type==="text"||s.type==="textarea")&&s.value!==r?s[rn](Nu(s.value,t,i)):s.value=n},beforeUpdate(s,{value:e,oldValue:t,modifiers:{lazy:i,trim:n,number:r}},o){if(s[rn]=la(o),s.composing)return;const a=(r||s.type==="number")&&!/^0\d/.test(s.value)?jh(s.value):s.value,l=e??"";if(a===l)return;const c=s.getRootNode();(c instanceof Document||c instanceof ShadowRoot)&&c.activeElement===s&&s.type!=="range"&&(i&&e===t||n&&s.value.trim()===l)||(s.value=l)}},wt={deep:!0,created(s,e,t){s[rn]=la(t),fr(s,"change",()=>{const i=s._modelValue,n=yl(s),r=s.checked,o=s[rn];if(ze(i)){const a=Zm(i,n),l=a!==-1;if(r&&!l)o(i.concat(n));else if(!r&&l){const c=[...i];c.splice(a,1),o(c)}}else if(ga(i)){const a=new Set(i);r?a.add(n):a.delete(n),o(a)}else o(Gx(s,r))})},mounted:_g,beforeUpdate(s,e,t){s[rn]=la(t),_g(s,e,t)}};function _g(s,{value:e,oldValue:t},i){s._modelValue=e;let n;if(ze(e))n=Zm(e,i.props.value)>-1;else if(ga(e))n=e.has(i.props.value);else{if(e===t)return;n=va(e,Gx(s,!0))}s.checked!==n&&(s.checked=n)}const bt={deep:!0,created(s,{value:e,modifiers:{number:t}},i){s._modelValue=e,fr(s,"change",()=>{const n=Array.prototype.filter.call(s.options,r=>r.selected).map(r=>t?jh(yl(r)):yl(r));s[rn](s.multiple?ga(s._modelValue)?new Set(n):n:n[0]),s._assigning=!0,Kh(()=>{s._assigning=!1})}),s[rn]=la(i)},mounted(s,{value:e}){Cg(s,e)},beforeUpdate(s,{value:e},t){s._modelValue=e,s[rn]=la(t)},updated(s,{value:e}){s._assigning||Cg(s,e)}};function Cg(s,e){const t=s.multiple,i=ze(e);if(!(t&&!i&&!ga(e))){for(let n=0,r=s.options.length;nString(c)===String(a)):o.selected=Zm(e,a)>-1}else o.selected=e.has(a);else if(va(yl(o),e)){s.selectedIndex!==n&&(s.selectedIndex=n);return}}!t&&s.selectedIndex!==-1&&(s.selectedIndex=-1)}}function yl(s){return"_value"in s?s._value:s.value}function Gx(s,e){const t=e?"_trueValue":"_falseValue";return t in s?s[t]:e}const O2=["ctrl","shift","alt","meta"],L2={stop:s=>s.stopPropagation(),prevent:s=>s.preventDefault(),self:s=>s.target!==s.currentTarget,ctrl:s=>!s.ctrlKey,shift:s=>!s.shiftKey,alt:s=>!s.altKey,meta:s=>!s.metaKey,left:s=>"button"in s&&s.button!==0,middle:s=>"button"in s&&s.button!==1,right:s=>"button"in s&&s.button!==2,exact:(s,e)=>O2.some(t=>s[`${t}Key`]&&!e.includes(t))},qe=(s,e)=>{if(!s)return s;const t=s._withMods||(s._withMods={}),i=e.join(".");return t[i]||(t[i]=((n,...r)=>{for(let o=0;o{const t=s._withKeys||(s._withKeys={}),i=e.join(".");return t[i]||(t[i]=(n=>{if(!("key"in n))return;const r=Ir(n.key);if(e.some(o=>o===r||B2[o]===r))return s(n)}))},N2=pi({patchProp:R2},l2);let Eg;function D2(){return Eg||(Eg=VT(N2))}const U2=((...s)=>{const e=D2().createApp(...s),{mount:t}=e;return e.mount=i=>{const n=X2(i);if(!n)return;const r=e._component;!at(r)&&!r.render&&!r.template&&(r.template=n.innerHTML),n.nodeType===1&&(n.textContent="");const o=t(n,!1,$2(n));return n instanceof Element&&(n.removeAttribute("v-cloak"),n.setAttribute("data-v-app","")),o},e});function $2(s){if(s instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&s instanceof MathMLElement)return"mathml"}function X2(s){return Gt(s)?document.querySelector(s):s}/*! - * pinia v4.0.3 - * (c) 2026 Eduardo San Martin Morote - * @license MIT - */let jx;const nu=s=>jx=s,Hx=Symbol();function Ag(s){return s&&typeof s=="object"&&Object.prototype.toString.call(s)==="[object Object]"&&typeof s.toJSON!="function"}function V2(){const s=Xy(!0),e=s.run(()=>Fe({}));let t=[],i=[];const n=vr({install(r){nu(n),n._a=r,r.provide(Hx,n),r.config.globalProperties.$pinia=n,i.forEach(o=>t.push(o)),i=[]},use(r){return this._a?t.push(r):i.push(r),this},_p:t,_a:null,_e:s,_s:new Map,state:e});return n}const Of=()=>{};function Ig(s,e,t,i=Of){s.add(e);const n=()=>{s.delete(e)&&i()};return!t&&Vy()&&bM(n),n}function _o(s,...e){s.forEach(t=>{t(...e)})}const Y2=s=>s(),Rg=Symbol(),Du=Symbol();function Lf(s,e){s instanceof Map&&e instanceof Map?e.forEach((t,i)=>s.set(i,t)):s instanceof Set&&e instanceof Set&&e.forEach(s.add,s);for(const t in e){if(!Object.hasOwn(e,t))continue;const i=e[t],n=s[t];Ag(n)&&Ag(i)&&Object.hasOwn(s,t)&&!jt(i)&&!Un(i)?s[t]=Lf(n,i):s[t]=i}return s}const G2=Symbol();function j2(s){return!s||typeof s!="object"||!Object.hasOwn(s,G2)}const{assign:nr}=Object;function H2(s){return!!(jt(s)&&s.effect)}function W2(s,e,t,i){const{state:n,actions:r,getters:o}=e,a=t.state.value[s];let l;function c(){a||(t.state.value[s]=n?n():{});const h=YM(t.state.value[s]);return nr(h,r,Object.keys(o||{}).reduce((u,d)=>(u[d]=vr(Le(()=>{nu(t);const f=t._s.get(s);return o[d].call(f,f)})),u),{}))}return l=Wx(s,c,e,t,i,!0),l}function Wx(s,e,t={},i,n,r){let o;const a=nr({actions:{}},t),l={deep:!0};let c,h,u=new Set,d=new Set,f;const m=i.state.value[s];!r&&!m&&(i.state.value[s]={});let p;function g(b){let C;c=h=!1,typeof b=="function"?(b(i.state.value[s]),C={type:"patch function",storeId:s,events:f}):(Lf(i.state.value[s],b),C={type:"patch object",payload:b,storeId:s,events:f});const A=p=Symbol();Kh().then(()=>{p===A&&(c=!0)}),h=!0,_o(u,C,i.state.value[s])}const x=r?function(){const{state:C}=t,A=C?C():{};this.$patch(P=>{nr(P,A)})}:Of;function v(){o.stop(),u.clear(),d.clear(),i._s.delete(s)}const y=(b,C="")=>{if(Rg in b)return b[Du]=C,b;const A=function(){nu(i);const P=Array.from(arguments),E=new Set,R=new Set;function O($){E.add($)}function U($){R.add($)}_o(d,{args:P,name:A[Du],store:_,after:O,onError:U});let G;try{G=b.apply(this&&this.$id===s?this:_,P)}catch($){throw _o(R,$),$}return G instanceof Promise?G.then($=>(_o(E,$),$)).catch($=>(_o(R,$),Promise.reject($))):(_o(E,G),G)};return A[Rg]=!0,A[Du]=C,A},w={_p:i,$id:s,$onAction:Ig.bind(null,d),$patch:g,$reset:x,$subscribe(b,C={}){if(u.has(b))return Of;const A=Ig(u,b,C.detached,()=>P()),P=o.run(()=>ai(()=>i.state.value[s],E=>{(C.flush==="sync"?h:c)&&b({storeId:s,type:"direct",events:f},E)},nr({},l,C)));return A},$dispose:v},_=po(w);i._s.set(s,_);const S=(i._a&&i._a.runWithContext||Y2)(()=>i._e.run(()=>(o=Xy()).run(()=>e({action:y}))));for(const b in S){const C=S[b];jt(C)&&!H2(C)||Un(C)?r||(m&&j2(C)&&(jt(C)?C.value=m[b]:((C instanceof Set||C instanceof Map)&&C.clear(),Lf(C,m[b]))),i.state.value[s][b]=C):typeof C=="function"&&(S[b]=y(C,b),a.actions[b]=C)}return nr(_,S),nr(Tt(_),S),Object.defineProperty(_,"$state",{get:()=>i.state.value[s],set:b=>{g(C=>{nr(C,b)})}}),i._p.forEach(b=>{const C=o.run(()=>b({store:_,app:i._a,pinia:i,options:a}));nr(_,C)}),m&&r&&t.hydrate&&t.hydrate(_.$state,m),c=!0,h=!0,_}/*! #__NO_SIDE_EFFECTS__ */function z2(s,e,t){let i;const n=typeof e=="function";i=n?t:e;function r(o,a){const l=QM();return o=o||(l?qo(Hx,null):null),o&&nu(o),o=jx,o._s.has(s)||(n?Wx(s,e,i,o):W2(s,i,o)),o._s.get(s)}return r.$id=s,r}var go=(s=>(s[s.WEBGL_LEGACY=0]="WEBGL_LEGACY",s[s.WEBGL=1]="WEBGL",s[s.WEBGL2=2]="WEBGL2",s))(go||{}),zx=(s=>(s[s.UNKNOWN=0]="UNKNOWN",s[s.WEBGL=1]="WEBGL",s[s.CANVAS=2]="CANVAS",s))(zx||{}),Bf=(s=>(s[s.COLOR=16384]="COLOR",s[s.DEPTH=256]="DEPTH",s[s.STENCIL=1024]="STENCIL",s))(Bf||{}),We=(s=>(s[s.NORMAL=0]="NORMAL",s[s.ADD=1]="ADD",s[s.MULTIPLY=2]="MULTIPLY",s[s.SCREEN=3]="SCREEN",s[s.OVERLAY=4]="OVERLAY",s[s.DARKEN=5]="DARKEN",s[s.LIGHTEN=6]="LIGHTEN",s[s.COLOR_DODGE=7]="COLOR_DODGE",s[s.COLOR_BURN=8]="COLOR_BURN",s[s.HARD_LIGHT=9]="HARD_LIGHT",s[s.SOFT_LIGHT=10]="SOFT_LIGHT",s[s.DIFFERENCE=11]="DIFFERENCE",s[s.EXCLUSION=12]="EXCLUSION",s[s.HUE=13]="HUE",s[s.SATURATION=14]="SATURATION",s[s.COLOR=15]="COLOR",s[s.LUMINOSITY=16]="LUMINOSITY",s[s.NORMAL_NPM=17]="NORMAL_NPM",s[s.ADD_NPM=18]="ADD_NPM",s[s.SCREEN_NPM=19]="SCREEN_NPM",s[s.NONE=20]="NONE",s[s.SRC_OVER=0]="SRC_OVER",s[s.SRC_IN=21]="SRC_IN",s[s.SRC_OUT=22]="SRC_OUT",s[s.SRC_ATOP=23]="SRC_ATOP",s[s.DST_OVER=24]="DST_OVER",s[s.DST_IN=25]="DST_IN",s[s.DST_OUT=26]="DST_OUT",s[s.DST_ATOP=27]="DST_ATOP",s[s.ERASE=26]="ERASE",s[s.SUBTRACT=28]="SUBTRACT",s[s.XOR=29]="XOR",s))(We||{}),on=(s=>(s[s.POINTS=0]="POINTS",s[s.LINES=1]="LINES",s[s.LINE_LOOP=2]="LINE_LOOP",s[s.LINE_STRIP=3]="LINE_STRIP",s[s.TRIANGLES=4]="TRIANGLES",s[s.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",s[s.TRIANGLE_FAN=6]="TRIANGLE_FAN",s))(on||{}),Te=(s=>(s[s.RGBA=6408]="RGBA",s[s.RGB=6407]="RGB",s[s.RG=33319]="RG",s[s.RED=6403]="RED",s[s.RGBA_INTEGER=36249]="RGBA_INTEGER",s[s.RGB_INTEGER=36248]="RGB_INTEGER",s[s.RG_INTEGER=33320]="RG_INTEGER",s[s.RED_INTEGER=36244]="RED_INTEGER",s[s.ALPHA=6406]="ALPHA",s[s.LUMINANCE=6409]="LUMINANCE",s[s.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",s[s.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",s[s.DEPTH_STENCIL=34041]="DEPTH_STENCIL",s))(Te||{}),Zo=(s=>(s[s.TEXTURE_2D=3553]="TEXTURE_2D",s[s.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",s[s.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",s[s.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",s[s.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",s[s.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",s[s.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",s[s.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",s[s.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",s))(Zo||{}),Ue=(s=>(s[s.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",s[s.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",s[s.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",s[s.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",s[s.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",s[s.UNSIGNED_INT=5125]="UNSIGNED_INT",s[s.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",s[s.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",s[s.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",s[s.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",s[s.BYTE=5120]="BYTE",s[s.SHORT=5122]="SHORT",s[s.INT=5124]="INT",s[s.FLOAT=5126]="FLOAT",s[s.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",s[s.HALF_FLOAT=36193]="HALF_FLOAT",s))(Ue||{}),De=(s=>(s[s.FLOAT=0]="FLOAT",s[s.INT=1]="INT",s[s.UINT=2]="UINT",s))(De||{}),Rs=(s=>(s[s.NEAREST=0]="NEAREST",s[s.LINEAR=1]="LINEAR",s))(Rs||{}),Os=(s=>(s[s.CLAMP=33071]="CLAMP",s[s.REPEAT=10497]="REPEAT",s[s.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT",s))(Os||{}),vs=(s=>(s[s.OFF=0]="OFF",s[s.POW2=1]="POW2",s[s.ON=2]="ON",s[s.ON_MANUAL=3]="ON_MANUAL",s))(vs||{}),bi=(s=>(s[s.NPM=0]="NPM",s[s.UNPACK=1]="UNPACK",s[s.PMA=2]="PMA",s[s.NO_PREMULTIPLIED_ALPHA=0]="NO_PREMULTIPLIED_ALPHA",s[s.PREMULTIPLY_ON_UPLOAD=1]="PREMULTIPLY_ON_UPLOAD",s[s.PREMULTIPLIED_ALPHA=2]="PREMULTIPLIED_ALPHA",s))(bi||{}),en=(s=>(s[s.NO=0]="NO",s[s.YES=1]="YES",s[s.AUTO=2]="AUTO",s[s.BLEND=0]="BLEND",s[s.CLEAR=1]="CLEAR",s[s.BLIT=2]="BLIT",s))(en||{}),up=(s=>(s[s.AUTO=0]="AUTO",s[s.MANUAL=1]="MANUAL",s))(up||{}),ms=(s=>(s.LOW="lowp",s.MEDIUM="mediump",s.HIGH="highp",s))(ms||{}),ui=(s=>(s[s.NONE=0]="NONE",s[s.SCISSOR=1]="SCISSOR",s[s.STENCIL=2]="STENCIL",s[s.SPRITE=3]="SPRITE",s[s.COLOR=4]="COLOR",s))(ui||{}),ci=(s=>(s[s.NONE=0]="NONE",s[s.LOW=2]="LOW",s[s.MEDIUM=4]="MEDIUM",s[s.HIGH=8]="HIGH",s))(ci||{}),hn=(s=>(s[s.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",s[s.ARRAY_BUFFER=34962]="ARRAY_BUFFER",s[s.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER",s))(hn||{});const q2={createCanvas:(s,e)=>{const t=document.createElement("canvas");return t.width=s,t.height=e,t},getCanvasRenderingContext2D:()=>CanvasRenderingContext2D,getWebGLRenderingContext:()=>WebGLRenderingContext,getNavigator:()=>navigator,getBaseUrl:()=>document.baseURI??window.location.href,getFontFaceSet:()=>document.fonts,fetch:(s,e)=>fetch(s,e),parseXML:s=>new DOMParser().parseFromString(s,"text/xml")},Be={ADAPTER:q2,RESOLUTION:1,CREATE_IMAGE_BITMAP:!1,ROUND_PIXELS:!1};var Uu=/iPhone/i,Pg=/iPod/i,kg=/iPad/i,Fg=/\biOS-universal(?:.+)Mac\b/i,$u=/\bAndroid(?:.+)Mobile\b/i,Og=/Android/i,Co=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,Wl=/Silk/i,bn=/Windows Phone/i,Lg=/\bWindows(?:.+)ARM\b/i,Bg=/BlackBerry/i,Ng=/BB10/i,Dg=/Opera Mini/i,Ug=/\b(CriOS|Chrome)(?:.+)Mobile/i,$g=/Mobile(?:.+)Firefox\b/i,Xg=function(s){return typeof s<"u"&&s.platform==="MacIntel"&&typeof s.maxTouchPoints=="number"&&s.maxTouchPoints>1&&typeof MSStream>"u"};function K2(s){return function(e){return e.test(s)}}function Vg(s){var e={userAgent:"",platform:"",maxTouchPoints:0};!s&&typeof navigator<"u"?e={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0}:typeof s=="string"?e.userAgent=s:s&&s.userAgent&&(e={userAgent:s.userAgent,platform:s.platform,maxTouchPoints:s.maxTouchPoints||0});var t=e.userAgent,i=t.split("[FBAN");typeof i[1]<"u"&&(t=i[0]),i=t.split("Twitter"),typeof i[1]<"u"&&(t=i[0]);var n=K2(t),r={apple:{phone:n(Uu)&&!n(bn),ipod:n(Pg),tablet:!n(Uu)&&(n(kg)||Xg(e))&&!n(bn),universal:n(Fg),device:(n(Uu)||n(Pg)||n(kg)||n(Fg)||Xg(e))&&!n(bn)},amazon:{phone:n(Co),tablet:!n(Co)&&n(Wl),device:n(Co)||n(Wl)},android:{phone:!n(bn)&&n(Co)||!n(bn)&&n($u),tablet:!n(bn)&&!n(Co)&&!n($u)&&(n(Wl)||n(Og)),device:!n(bn)&&(n(Co)||n(Wl)||n($u)||n(Og))||n(/\bokhttp\b/i)},windows:{phone:n(bn),tablet:n(Lg),device:n(bn)||n(Lg)},other:{blackberry:n(Bg),blackberry10:n(Ng),opera:n(Dg),firefox:n($g),chrome:n(Ug),device:n(Bg)||n(Ng)||n(Dg)||n($g)||n(Ug)},any:!1,phone:!1,tablet:!1};return r.any=r.apple.device||r.android.device||r.windows.device||r.other.device,r.phone=r.apple.phone||r.android.phone||r.windows.phone,r.tablet=r.apple.tablet||r.android.tablet||r.windows.tablet,r}const Z2=Vg.default??Vg,kn=Z2(globalThis.navigator);Be.RETINA_PREFIX=/@([0-9\.]+)x/;Be.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT=!1;var th=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function qx(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}function J2(s){if(Object.prototype.hasOwnProperty.call(s,"__esModule"))return s;var e=s.default;if(typeof e=="function"){var t=function i(){return this instanceof i?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(s).forEach(function(i){var n=Object.getOwnPropertyDescriptor(s,i);Object.defineProperty(t,i,n.get?n:{enumerable:!0,get:function(){return s[i]}})}),t}var Xu={exports:{}},Yg;function Q2(){return Yg||(Yg=1,(function(s){var e=Object.prototype.hasOwnProperty,t="~";function i(){}Object.create&&(i.prototype=Object.create(null),new i().__proto__||(t=!1));function n(l,c,h){this.fn=l,this.context=c,this.once=h||!1}function r(l,c,h,u,d){if(typeof h!="function")throw new TypeError("The listener must be a function");var f=new n(h,u||l,d),m=t?t+c:c;return l._events[m]?l._events[m].fn?l._events[m]=[l._events[m],f]:l._events[m].push(f):(l._events[m]=f,l._eventsCount++),l}function o(l,c){--l._eventsCount===0?l._events=new i:delete l._events[c]}function a(){this._events=new i,this._eventsCount=0}a.prototype.eventNames=function(){var c=[],h,u;if(this._eventsCount===0)return c;for(u in h=this._events)e.call(h,u)&&c.push(t?u.slice(1):u);return Object.getOwnPropertySymbols?c.concat(Object.getOwnPropertySymbols(h)):c},a.prototype.listeners=function(c){var h=t?t+c:c,u=this._events[h];if(!u)return[];if(u.fn)return[u.fn];for(var d=0,f=u.length,m=new Array(f);d80*D){Y=z=$[0],q=se=$[1];for(var he=D;hez&&(z=oe),de>se&&(se=de);ge=Math.max(z-Y,se-q),ge=ge!==0?32767/ge:0}return i(F,V,D,Y,q,ge,0),V}function e($,X,D,k,N){var F,V;if(N===G($,X,D,k)>0)for(F=X;F=X;F-=k)V=R(F,$[F],$[F+1],V);return V&&w(V,V.next)&&(O(V),V=V.next),V}function t($,X){if(!$)return $;X||(X=$);var D=$,k;do if(k=!1,!D.steiner&&(w(D,D.next)||y(D.prev,D,D.next)===0)){if(O(D),D=X=D.prev,D===D.next)break;k=!0}else D=D.next;while(k||D!==X);return X}function i($,X,D,k,N,F,V){if($){!V&&F&&f($,k,N,F);for(var Y=$,q,z;$.prev!==$.next;){if(q=$.prev,z=$.next,F?r($,k,N,F):n($)){X.push(q.i/D|0),X.push($.i/D|0),X.push(z.i/D|0),O($),$=z.next,Y=z.next;continue}if($=z,$===Y){V?V===1?($=o(t($),X,D),i($,X,D,k,N,F,2)):V===2&&a($,X,D,k,N,F):i(t($),X,D,k,N,F,1);break}}}}function n($){var X=$.prev,D=$,k=$.next;if(y(X,D,k)>=0)return!1;for(var N=X.x,F=D.x,V=k.x,Y=X.y,q=D.y,z=k.y,se=NF?N>V?N:V:F>V?F:V,ge=Y>q?Y>z?Y:z:q>z?q:z,he=k.next;he!==X;){if(he.x>=se&&he.x<=de&&he.y>=oe&&he.y<=ge&&x(N,Y,F,q,V,z,he.x,he.y)&&y(he.prev,he,he.next)>=0)return!1;he=he.next}return!0}function r($,X,D,k){var N=$.prev,F=$,V=$.next;if(y(N,F,V)>=0)return!1;for(var Y=N.x,q=F.x,z=V.x,se=N.y,oe=F.y,de=V.y,ge=Yq?Y>z?Y:z:q>z?q:z,H=se>oe?se>de?se:de:oe>de?oe:de,W=p(ge,he,X,D,k),Z=p(fe,H,X,D,k),L=$.prevZ,B=$.nextZ;L&&L.z>=W&&B&&B.z<=Z;){if(L.x>=ge&&L.x<=fe&&L.y>=he&&L.y<=H&&L!==N&&L!==V&&x(Y,se,q,oe,z,de,L.x,L.y)&&y(L.prev,L,L.next)>=0||(L=L.prevZ,B.x>=ge&&B.x<=fe&&B.y>=he&&B.y<=H&&B!==N&&B!==V&&x(Y,se,q,oe,z,de,B.x,B.y)&&y(B.prev,B,B.next)>=0))return!1;B=B.nextZ}for(;L&&L.z>=W;){if(L.x>=ge&&L.x<=fe&&L.y>=he&&L.y<=H&&L!==N&&L!==V&&x(Y,se,q,oe,z,de,L.x,L.y)&&y(L.prev,L,L.next)>=0)return!1;L=L.prevZ}for(;B&&B.z<=Z;){if(B.x>=ge&&B.x<=fe&&B.y>=he&&B.y<=H&&B!==N&&B!==V&&x(Y,se,q,oe,z,de,B.x,B.y)&&y(B.prev,B,B.next)>=0)return!1;B=B.nextZ}return!0}function o($,X,D){var k=$;do{var N=k.prev,F=k.next.next;!w(N,F)&&_(N,k,k.next,F)&&A(N,F)&&A(F,N)&&(X.push(N.i/D|0),X.push(k.i/D|0),X.push(F.i/D|0),O(k),O(k.next),k=$=F),k=k.next}while(k!==$);return t(k)}function a($,X,D,k,N,F){var V=$;do{for(var Y=V.next.next;Y!==V.prev;){if(V.i!==Y.i&&v(V,Y)){var q=E(V,Y);V=t(V,V.next),q=t(q,q.next),i(V,X,D,k,N,F,0),i(q,X,D,k,N,F,0);return}Y=Y.next}V=V.next}while(V!==$)}function l($,X,D,k){var N=[],F,V,Y,q,z;for(F=0,V=X.length;F=D.next.y&&D.next.y!==D.y){var Y=D.x+(N-D.y)*(D.next.x-D.x)/(D.next.y-D.y);if(Y<=k&&Y>F&&(F=Y,V=D.x=D.x&&D.x>=z&&k!==D.x&&x(NV.x||D.x===V.x&&d(V,D)))&&(V=D,oe=de)),D=D.next;while(D!==q);return V}function d($,X){return y($.prev,$,X.prev)<0&&y(X.next,$,$.next)<0}function f($,X,D,k){var N=$;do N.z===0&&(N.z=p(N.x,N.y,X,D,k)),N.prevZ=N.prev,N.nextZ=N.next,N=N.next;while(N!==$);N.prevZ.nextZ=null,N.prevZ=null,m(N)}function m($){var X,D,k,N,F,V,Y,q,z=1;do{for(D=$,$=null,F=null,V=0;D;){for(V++,k=D,Y=0,X=0;X0||q>0&&k;)Y!==0&&(q===0||!k||D.z<=k.z)?(N=D,D=D.nextZ,Y--):(N=k,k=k.nextZ,q--),F?F.nextZ=N:$=N,N.prevZ=F,F=N;D=k}F.nextZ=null,z*=2}while(V>1);return $}function p($,X,D,k,N){return $=($-D)*N|0,X=(X-k)*N|0,$=($|$<<8)&16711935,$=($|$<<4)&252645135,$=($|$<<2)&858993459,$=($|$<<1)&1431655765,X=(X|X<<8)&16711935,X=(X|X<<4)&252645135,X=(X|X<<2)&858993459,X=(X|X<<1)&1431655765,$|X<<1}function g($){var X=$,D=$;do(X.x=($-V)*(F-Y)&&($-V)*(k-Y)>=(D-V)*(X-Y)&&(D-V)*(F-Y)>=(N-V)*(k-Y)}function v($,X){return $.next.i!==X.i&&$.prev.i!==X.i&&!C($,X)&&(A($,X)&&A(X,$)&&P($,X)&&(y($.prev,$,X.prev)||y($,X.prev,X))||w($,X)&&y($.prev,$,$.next)>0&&y(X.prev,X,X.next)>0)}function y($,X,D){return(X.y-$.y)*(D.x-X.x)-(X.x-$.x)*(D.y-X.y)}function w($,X){return $.x===X.x&&$.y===X.y}function _($,X,D,k){var N=b(y($,X,D)),F=b(y($,X,k)),V=b(y(D,k,$)),Y=b(y(D,k,X));return!!(N!==F&&V!==Y||N===0&&S($,D,X)||F===0&&S($,k,X)||V===0&&S(D,$,k)||Y===0&&S(D,X,k))}function S($,X,D){return X.x<=Math.max($.x,D.x)&&X.x>=Math.min($.x,D.x)&&X.y<=Math.max($.y,D.y)&&X.y>=Math.min($.y,D.y)}function b($){return $>0?1:$<0?-1:0}function C($,X){var D=$;do{if(D.i!==$.i&&D.next.i!==$.i&&D.i!==X.i&&D.next.i!==X.i&&_(D,D.next,$,X))return!0;D=D.next}while(D!==$);return!1}function A($,X){return y($.prev,$,$.next)<0?y($,X,$.next)>=0&&y($,$.prev,X)>=0:y($,X,$.prev)<0||y($,$.next,X)<0}function P($,X){var D=$,k=!1,N=($.x+X.x)/2,F=($.y+X.y)/2;do D.y>F!=D.next.y>F&&D.next.y!==D.y&&N<(D.next.x-D.x)*(F-D.y)/(D.next.y-D.y)+D.x&&(k=!k),D=D.next;while(D!==$);return k}function E($,X){var D=new U($.i,$.x,$.y),k=new U(X.i,X.x,X.y),N=$.next,F=X.prev;return $.next=X,X.prev=$,D.next=N,N.prev=D,k.next=D,D.prev=k,F.next=k,k.prev=F,k}function R($,X,D,k){var N=new U($,X,D);return k?(N.next=k.next,N.prev=k,k.next.prev=N,k.next=N):(N.prev=N,N.next=N),N}function O($){$.next.prev=$.prev,$.prev.next=$.next,$.prevZ&&($.prevZ.nextZ=$.nextZ),$.nextZ&&($.nextZ.prevZ=$.prevZ)}function U($,X,D){this.i=$,this.x=X,this.y=D,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}s.deviation=function($,X,D,k){var N=X&&X.length,F=N?X[0]*D:$.length,V=Math.abs(G($,0,F,D));if(N)for(var Y=0,q=X.length;Y0&&(k+=$[N-1].length,D.holes.push(k))}return D},zl.exports}var i_=t_();const s_=qx(i_);var Dr={},Xa={exports:{}};/*! https://mths.be/punycode v1.4.1 by @mathias */var n_=Xa.exports,jg;function r_(){return jg||(jg=1,(function(s,e){(function(t){var i=e&&!e.nodeType&&e,n=s&&!s.nodeType&&s,r=typeof th=="object"&&th;(r.global===r||r.window===r||r.self===r)&&(t=r);var o,a=2147483647,l=36,c=1,h=26,u=38,d=700,f=72,m=128,p="-",g=/^xn--/,x=/[^\x20-\x7E]/,v=/[\x2E\u3002\uFF0E\uFF61]/g,y={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},w=l-c,_=Math.floor,S=String.fromCharCode,b;function C(N){throw new RangeError(y[N])}function A(N,F){for(var V=N.length,Y=[];V--;)Y[V]=F(N[V]);return Y}function P(N,F){var V=N.split("@"),Y="";V.length>1&&(Y=V[0]+"@",N=V[1]),N=N.replace(v,".");var q=N.split("."),z=A(q,F).join(".");return Y+z}function E(N){for(var F=[],V=0,Y=N.length,q,z;V=55296&&q<=56319&&V65535&&(F-=65536,V+=S(F>>>10&1023|55296),F=56320|F&1023),V+=S(F),V}).join("")}function O(N){return N-48<10?N-22:N-65<26?N-65:N-97<26?N-97:l}function U(N,F){return N+22+75*(N<26)-((F!=0)<<5)}function G(N,F,V){var Y=0;for(N=V?_(N/d):N>>1,N+=_(N/F);N>w*h>>1;Y+=l)N=_(N/w);return _(Y+(w+1)*N/(N+u))}function $(N){var F=[],V=N.length,Y,q=0,z=m,se=f,oe,de,ge,he,fe,H,W,Z,L;for(oe=N.lastIndexOf(p),oe<0&&(oe=0),de=0;de=128&&C("not-basic"),F.push(N.charCodeAt(de));for(ge=oe>0?oe+1:0;ge=V&&C("invalid-input"),W=O(N.charCodeAt(ge++)),(W>=l||W>_((a-q)/fe))&&C("overflow"),q+=W*fe,Z=H<=se?c:H>=se+h?h:H-se,!(W_(a/L)&&C("overflow"),fe*=L;Y=F.length+1,se=G(q-he,Y,he==0),_(q/Y)>a-z&&C("overflow"),z+=_(q/Y),q%=Y,F.splice(q++,0,z)}return R(F)}function X(N){var F,V,Y,q,z,se,oe,de,ge,he,fe,H=[],W,Z,L,B;for(N=E(N),W=N.length,F=m,V=0,z=f,se=0;se=F&&fe_((a-V)/Z)&&C("overflow"),V+=(oe-F)*Z,F=oe,se=0;sea&&C("overflow"),fe==F){for(de=V,ge=l;he=ge<=z?c:ge>=z+h?h:ge-z,!(de-1e3&&re<1e3||S.call(/e/,ae))return ae;var Qe=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof re=="number"){var It=re<0?-P(-re):P(re);if(It!==re){var kt=String(It),ot=v.call(ae,kt.length+1);return y.call(kt,Qe,"$&_")+"."+y.call(y.call(ot,/([0-9]{3})/g,"$&_"),/_$/,"")}}return y.call(ae,Qe,"$&_")}var k=l_,N=k.custom,F=Z(N)?N:null,V={__proto__:null,double:'"',single:"'"},Y={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};Yu=function re(ae,Qe,It,kt){var ot=Qe||{};if(j(ot,"quoteStyle")&&!j(V,ot.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(j(ot,"maxStringLength")&&(typeof ot.maxStringLength=="number"?ot.maxStringLength<0&&ot.maxStringLength!==1/0:ot.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var Gi=j(ot,"customInspect")?ot.customInspect:!0;if(typeof Gi!="boolean"&&Gi!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(j(ot,"indent")&&ot.indent!==null&&ot.indent!==" "&&!(parseInt(ot.indent,10)===ot.indent&&ot.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(j(ot,"numericSeparator")&&typeof ot.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var xs=ot.numericSeparator;if(typeof ae>"u")return"undefined";if(ae===null)return"null";if(typeof ae=="boolean")return ae?"true":"false";if(typeof ae=="string")return st(ae,ot);if(typeof ae=="number"){if(ae===0)return 1/0/ae>0?"0":"-0";var Nt=String(ae);return xs?D(ae,Nt):Nt}if(typeof ae=="bigint"){var vi=String(ae)+"n";return xs?D(ae,vi):vi}var Xt=typeof ot.depth>"u"?5:ot.depth;if(typeof It>"u"&&(It=0),It>=Xt&&Xt>0&&typeof ae=="object")return oe(ae)?"[Array]":"[Object]";var ji=Ae(ot,It);if(typeof kt>"u")kt=[];else if(me(kt,ae)>=0)return"[Circular]";function ni(Jn,So,Tu){if(So&&(kt=A.call(kt),kt.push(So)),Tu){var Xl={depth:ot.depth};return j(ot,"quoteStyle")&&(Xl.quoteStyle=ot.quoteStyle),re(Jn,Xl,It+1,kt)}return re(Jn,ot,It+1,kt)}if(typeof ae=="function"&&!ge(ae)){var bs=ue(ae),ws=ut(ae,ni);return"[Function"+(bs?": "+bs:" (anonymous)")+"]"+(ws.length>0?" { "+C.call(ws,", ")+" }":"")}if(Z(ae)){var $s=U?y.call(String(ae),/^(Symbol\(.*\))_[^)]*$/,"$1"):O.call(ae);return typeof ae=="object"&&!U?nt($s):$s}if(Ye(ae)){for(var Zi="<"+_.call(String(ae.nodeName)),Zn=ae.attributes||[],gn=0;gn",Zi}if(oe(ae)){if(ae.length===0)return"[]";var Sa=ut(ae,ni);return ji&&!Je(Sa)?"["+Qt(Sa,ji)+"]":"[ "+C.call(Sa,", ")+" ]"}if(he(ae)){var Ma=ut(ae,ni);return!("cause"in Error.prototype)&&"cause"in ae&&!$.call(ae,"cause")?"{ ["+String(ae)+"] "+C.call(b.call("[cause]: "+ni(ae.cause),Ma),", ")+" }":Ma.length===0?"["+String(ae)+"]":"{ ["+String(ae)+"] "+C.call(Ma,", ")+" }"}if(typeof ae=="object"&&Gi){if(F&&typeof ae[F]=="function"&&k)return k(ae,{depth:Xt-It});if(Gi!=="symbol"&&typeof ae.inspect=="function")return ae.inspect()}if(ee(ae)){var Dl=[];return i&&i.call(ae,function(Jn,So){Dl.push(ni(So,ae,!0)+" => "+ni(Jn,ae))}),Ee("Map",t.call(ae),Dl,ji)}if(pe(ae)){var Ul=[];return a&&a.call(ae,function(Jn){Ul.push(ni(Jn,ae))}),Ee("Set",o.call(ae),Ul,ji)}if(Me(ae))return Ve("WeakMap");if(Ne(ae))return Ve("WeakSet");if(be(ae))return Ve("WeakRef");if(H(ae))return nt(ni(Number(ae)));if(L(ae))return nt(ni(E.call(ae)));if(W(ae))return nt(m.call(ae));if(fe(ae))return nt(ni(String(ae)));if(typeof window<"u"&&ae===window)return"{ [object Window] }";if(typeof globalThis<"u"&&ae===globalThis||typeof th<"u"&&ae===th)return"{ [object globalThis] }";if(!de(ae)&&!ge(ae)){var Ta=ut(ae,ni),_a=X?X(ae)===Object.prototype:ae instanceof Object||ae.constructor===Object,Ca=ae instanceof Object?"":"null prototype",$l=!_a&&G&&Object(ae)===ae&&G in ae?v.call(ie(ae),8,-1):Ca?"Object":"",Mu=_a||typeof ae.constructor!="function"?"":ae.constructor.name?ae.constructor.name+" ":"",Ea=Mu+($l||Ca?"["+C.call(b.call([],$l||[],Ca||[]),": ")+"] ":"");return Ta.length===0?Ea+"{}":ji?Ea+"{"+Qt(Ta,ji)+"}":Ea+"{ "+C.call(Ta,", ")+" }"}return String(ae)};function q(re,ae,Qe){var It=Qe.quoteStyle||ae,kt=V[It];return kt+re+kt}function z(re){return y.call(String(re),/"/g,""")}function se(re){return!G||!(typeof re=="object"&&(G in re||typeof re[G]<"u"))}function oe(re){return ie(re)==="[object Array]"&&se(re)}function de(re){return ie(re)==="[object Date]"&&se(re)}function ge(re){return ie(re)==="[object RegExp]"&&se(re)}function he(re){return ie(re)==="[object Error]"&&se(re)}function fe(re){return ie(re)==="[object String]"&&se(re)}function H(re){return ie(re)==="[object Number]"&&se(re)}function W(re){return ie(re)==="[object Boolean]"&&se(re)}function Z(re){if(U)return re&&typeof re=="object"&&re instanceof Symbol;if(typeof re=="symbol")return!0;if(!re||typeof re!="object"||!O)return!1;try{return O.call(re),!0}catch{}return!1}function L(re){if(!re||typeof re!="object"||!E)return!1;try{return E.call(re),!0}catch{}return!1}var B=Object.prototype.hasOwnProperty||function(re){return re in this};function j(re,ae){return B.call(re,ae)}function ie(re){return p.call(re)}function ue(re){if(re.name)return re.name;var ae=x.call(g.call(re),/^function\s*([\w$]+)/);return ae?ae[1]:null}function me(re,ae){if(re.indexOf)return re.indexOf(ae);for(var Qe=0,It=re.length;Qeae.maxStringLength){var Qe=re.length-ae.maxStringLength,It="... "+Qe+" more character"+(Qe>1?"s":"");return st(v.call(re,0,ae.maxStringLength),ae)+It}var kt=Y[ae.quoteStyle||"single"];kt.lastIndex=0;var ot=y.call(y.call(re,kt,"\\$1"),/[\x00-\x1f]/g,Ze);return q(ot,"single",ae)}function Ze(re){var ae=re.charCodeAt(0),Qe={8:"b",9:"t",10:"n",12:"f",13:"r"}[ae];return Qe?"\\"+Qe:"\\x"+(ae<16?"0":"")+w.call(ae.toString(16))}function nt(re){return"Object("+re+")"}function Ve(re){return re+" { ? }"}function Ee(re,ae,Qe,It){var kt=It?Qt(Qe,It):C.call(Qe,", ");return re+" ("+ae+") {"+kt+"}"}function Je(re){for(var ae=0;ae=0)return!1;return!0}function Ae(re,ae){var Qe;if(re.indent===" ")Qe=" ";else if(typeof re.indent=="number"&&re.indent>0)Qe=C.call(Array(re.indent+1)," ");else return null;return{base:Qe,prev:C.call(Array(ae+1),Qe)}}function Qt(re,ae){if(re.length===0)return"";var Qe=` -`+ae.prev+ae.base;return Qe+C.call(re,","+Qe)+` -`+ae.prev}function ut(re,ae){var Qe=oe(re),It=[];if(Qe){It.length=re.length;for(var kt=0;kt"u"||!b?s:b(Uint8Array),U={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?s:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?s:ArrayBuffer,"%ArrayIteratorPrototype%":S&&b?b([][Symbol.iterator]()):s,"%AsyncFromSyncIteratorPrototype%":s,"%AsyncFunction%":R,"%AsyncGenerator%":R,"%AsyncGeneratorFunction%":R,"%AsyncIteratorPrototype%":R,"%Atomics%":typeof Atomics>"u"?s:Atomics,"%BigInt%":typeof BigInt>"u"?s:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?s:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?s:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?s:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":t,"%eval%":eval,"%EvalError%":i,"%Float16Array%":typeof Float16Array>"u"?s:Float16Array,"%Float32Array%":typeof Float32Array>"u"?s:Float32Array,"%Float64Array%":typeof Float64Array>"u"?s:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?s:FinalizationRegistry,"%Function%":g,"%GeneratorFunction%":R,"%Int8Array%":typeof Int8Array>"u"?s:Int8Array,"%Int16Array%":typeof Int16Array>"u"?s:Int16Array,"%Int32Array%":typeof Int32Array>"u"?s:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":S&&b?b(b([][Symbol.iterator]())):s,"%JSON%":typeof JSON=="object"?JSON:s,"%Map%":typeof Map>"u"?s:Map,"%MapIteratorPrototype%":typeof Map>"u"||!S||!b?s:b(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":e,"%Object.getOwnPropertyDescriptor%":v,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?s:Promise,"%Proxy%":typeof Proxy>"u"?s:Proxy,"%RangeError%":n,"%ReferenceError%":r,"%Reflect%":typeof Reflect>"u"?s:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?s:Set,"%SetIteratorPrototype%":typeof Set>"u"||!S||!b?s:b(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?s:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":S&&b?b(""[Symbol.iterator]()):s,"%Symbol%":S?Symbol:s,"%SyntaxError%":o,"%ThrowTypeError%":_,"%TypedArray%":O,"%TypeError%":a,"%Uint8Array%":typeof Uint8Array>"u"?s:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?s:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?s:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?s:Uint32Array,"%URIError%":l,"%WeakMap%":typeof WeakMap>"u"?s:WeakMap,"%WeakRef%":typeof WeakRef>"u"?s:WeakRef,"%WeakSet%":typeof WeakSet>"u"?s:WeakSet,"%Function.prototype.call%":E,"%Function.prototype.apply%":P,"%Object.defineProperty%":y,"%Object.getPrototypeOf%":C,"%Math.abs%":c,"%Math.floor%":h,"%Math.max%":u,"%Math.min%":d,"%Math.pow%":f,"%Math.round%":m,"%Math.sign%":p,"%Reflect.getPrototypeOf%":A};if(b)try{null.error}catch(ge){var G=b(b(ge));U["%Error.prototype%"]=G}var $=function ge(he){var fe;if(he==="%AsyncFunction%")fe=x("async function () {}");else if(he==="%GeneratorFunction%")fe=x("function* () {}");else if(he==="%AsyncGeneratorFunction%")fe=x("async function* () {}");else if(he==="%AsyncGenerator%"){var H=ge("%AsyncGeneratorFunction%");H&&(fe=H.prototype)}else if(he==="%AsyncIteratorPrototype%"){var W=ge("%AsyncGenerator%");W&&b&&(fe=b(W.prototype))}return U[he]=fe,fe},X={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},D=ou(),k=k_(),N=D.call(E,Array.prototype.concat),F=D.call(P,Array.prototype.splice),V=D.call(E,String.prototype.replace),Y=D.call(E,String.prototype.slice),q=D.call(E,RegExp.prototype.exec),z=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,se=/\\(\\)?/g,oe=function(he){var fe=Y(he,0,1),H=Y(he,-1);if(fe==="%"&&H!=="%")throw new o("invalid intrinsic syntax, expected closing `%`");if(H==="%"&&fe!=="%")throw new o("invalid intrinsic syntax, expected opening `%`");var W=[];return V(he,z,function(Z,L,B,j){W[W.length]=B?V(j,se,"$1"):L||Z}),W},de=function(he,fe){var H=he,W;if(k(X,H)&&(W=X[H],H="%"+W[0]+"%"),k(U,H)){var Z=U[H];if(Z===R&&(Z=$(H)),typeof Z>"u"&&!fe)throw new a("intrinsic "+he+" exists, but is not available. Please file an issue!");return{alias:W,name:H,value:Z}}throw new o("intrinsic "+he+" does not exist!")};return Md=function(he,fe){if(typeof he!="string"||he.length===0)throw new a("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof fe!="boolean")throw new a('"allowMissing" argument must be a boolean');if(q(/^%?[^%]*%?$/,he)===null)throw new o("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var H=oe(he),W=H.length>0?H[0]:"",Z=de("%"+W+"%",fe),L=Z.name,B=Z.value,j=!1,ie=Z.alias;ie&&(W=ie[0],F(H,N([0,1],ie)));for(var ue=1,me=!0;ue=H.length){var pe=v(B,ee);me=!!pe,me&&"get"in pe&&!("originalValue"in pe.get)?B=pe.get:B=B[ee]}else me=k(B,ee),B=B[ee];me&&!j&&(U[L]=B)}}return B},Md}var Td,A0;function sb(){if(A0)return Td;A0=1;var s=fp(),e=ib(),t=e([s("%String.prototype.indexOf%")]);return Td=function(n,r){var o=s(n,!!r);return typeof o=="function"&&t(n,".prototype.")>-1?e([o]):o},Td}var _d,I0;function nb(){if(I0)return _d;I0=1;var s=fp(),e=sb(),t=ru(),i=ya(),n=s("%Map%",!0),r=e("Map.prototype.get",!0),o=e("Map.prototype.set",!0),a=e("Map.prototype.has",!0),l=e("Map.prototype.delete",!0),c=e("Map.prototype.size",!0);return _d=!!n&&function(){var u,d={assert:function(f){if(!d.has(f))throw new i("Side channel does not contain "+t(f))},delete:function(f){if(u){var m=l(u,f);return c(u)===0&&(u=void 0),m}return!1},get:function(f){if(u)return r(u,f)},has:function(f){return u?a(u,f):!1},set:function(f,m){u||(u=new n),o(u,f,m)}};return d},_d}var Cd,R0;function F_(){if(R0)return Cd;R0=1;var s=fp(),e=sb(),t=ru(),i=nb(),n=ya(),r=s("%WeakMap%",!0),o=e("WeakMap.prototype.get",!0),a=e("WeakMap.prototype.set",!0),l=e("WeakMap.prototype.has",!0),c=e("WeakMap.prototype.delete",!0);return Cd=r?function(){var u,d,f={assert:function(m){if(!f.has(m))throw new n("Side channel does not contain "+t(m))},delete:function(m){if(r&&m&&(typeof m=="object"||typeof m=="function")){if(u)return c(u,m)}else if(i&&d)return d.delete(m);return!1},get:function(m){return r&&m&&(typeof m=="object"||typeof m=="function")&&u?o(u,m):d&&d.get(m)},has:function(m){return r&&m&&(typeof m=="object"||typeof m=="function")&&u?l(u,m):!!d&&d.has(m)},set:function(m,p){r&&m&&(typeof m=="object"||typeof m=="function")?(u||(u=new r),a(u,m,p)):i&&(d||(d=i()),d.set(m,p))}};return f}:i,Cd}var Ed,P0;function rb(){if(P0)return Ed;P0=1;var s=ya(),e=ru(),t=c_(),i=nb(),n=F_(),r=n||i||t;return Ed=function(){var a,l={assert:function(c){if(!l.has(c)){var h=c&&Object(c)===c?"the given object key":e(c);throw new s("Side channel does not contain "+h)}},delete:function(c){return!!a&&a.delete(c)},get:function(c){return a&&a.get(c)},has:function(c){return!!a&&a.has(c)},set:function(c,h){a||(a=r()),a.set(c,h)}};return l},Ed}var Ad,k0;function mp(){if(k0)return Ad;k0=1;var s=String.prototype.replace,e=/%20/g,t={RFC1738:"RFC1738",RFC3986:"RFC3986"};return Ad={default:t.RFC3986,formatters:{RFC1738:function(i){return s.call(i,e,"+")},RFC3986:function(i){return String(i)}},RFC1738:t.RFC1738,RFC3986:t.RFC3986},Ad}var Id,F0;function ob(){if(F0)return Id;F0=1;var s=mp(),e=rb(),t=Jx(),i=Object.prototype.hasOwnProperty,n=Array.isArray,r=e(),o=function(A,P){return r.set(A,P),A},a=function(A){return r.has(A)},l=function(A){return r.get(A)},c=function(A,P){r.set(A,P)},h=(function(){for(var C=[],A=0;A<256;++A)C[C.length]="%"+((A<16?"0":"")+A.toString(16)).toUpperCase();return C})(),u=function(A){for(;A.length>1;){var P=A.pop(),E=P.obj[P.prop];if(n(E)){for(var R=[],O=0;O=E.arrayLimit){if(E.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+E.arrayLimit+" element"+(E.arrayLimit===1?"":"s")+" allowed in an array.");return o(d(A.concat(P),E),R)}A[R]=P}else if(A&&typeof A=="object")if(a(A)){var O=l(A)+1;A[O]=P,c(A,O)}else{if(E&&E.strictMerge)return[A,P];(E&&(E.plainObjects||E.allowPrototypes)||!i.call(Object.prototype,P))&&(A[P]=!0)}else return[A,P];return A}if(!A||typeof A!="object"){if(a(P)){for(var U=Object.keys(P),G=E&&E.plainObjects?{__proto__:null,0:A}:{0:A},$=0;$E.arrayLimit){if(E.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+E.arrayLimit+" element"+(E.arrayLimit===1?"":"s")+" allowed in an array.");return o(d(D,E),D.length-1)}return D}var k=A;if(n(A)&&!n(P)&&(k=d(A,E)),n(A)&&n(P)){if(P.forEach(function(N,F){if(i.call(A,F)){var V=A[F];V&&typeof V=="object"&&N&&typeof N=="object"?A[F]=C(V,N,E):A[A.length]=N}else A[F]=N}),E&&typeof E.arrayLimit=="number"&&A.length>E.arrayLimit){if(E.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+E.arrayLimit+" element"+(E.arrayLimit===1?"":"s")+" allowed in an array.");return o(d(A,E),A.length-1)}return A}return Object.keys(P).reduce(function(N,F){var V=P[F];if(i.call(N,F)?f(N,F,C(N[F],V,E)):f(N,F,V),a(P)&&!a(N)&&o(N,l(P)),a(N)){var Y=parseInt(F,10);String(Y)===F&&Y>=0&&Y>l(N)&&c(N,Y)}return N},k)},p=function(A,P){return Object.keys(P).reduce(function(E,R){return f(E,R,P[R]),E},A)},g=function(C,A,P){var E=C.replace(/\+/g," ");if(P==="iso-8859-1")return E.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(E)}catch{return E}},x=1024,v=function(A,P,E,R,O){if(A.length===0)return A;var U=A;if(typeof A=="symbol"?U=Symbol.prototype.toString.call(A):typeof A!="string"&&(U=String(A)),E==="iso-8859-1")return escape(U).replace(/%u[0-9a-f]{4}/gi,function(V){return"%26%23"+parseInt(V.slice(2),16)+"%3B"});for(var G="",$=0;$=x?U.slice($,$+x):U;if($+x=55296&&D<=56319&&(X=X.slice(0,-1),$-=1)}for(var k=[],N=0;N=48&&F<=57||F>=65&&F<=90||F>=97&&F<=122||O===s.RFC1738&&(F===40||F===41)){k[k.length]=X.charAt(N);continue}if(F<128){k[k.length]=h[F];continue}if(F<2048){k[k.length]=h[192|F>>6]+h[128|F&63];continue}if(F<55296||F>=57344){k[k.length]=h[224|F>>12]+h[128|F>>6&63]+h[128|F&63];continue}N+=1,F=65536+((F&1023)<<10|X.charCodeAt(N)&1023),k[k.length]=h[240|F>>18]+h[128|F>>12&63]+h[128|F>>6&63]+h[128|F&63]}G+=k.join("")}return G},y=function(A){for(var P=[{obj:{o:A},prop:"o"}],E=e(),R=0;RE){if(O)throw new RangeError("Array limit exceeded. Only "+E+" element"+(E===1?"":"s")+" allowed in an array.");return o(d(G,{plainObjects:R}),G.length-1)}return G},b=function(A,P){if(n(A)){for(var E=[],R=0;R"u"&&(N=0)}if(typeof A=="function"?D=A(x,D):D instanceof Date?D=R(D):v==="comma"&&r(D)&&(D=e.maybeMap(D,function(L){return L instanceof Date?R(L):L})),D===null){if(_)return U(C&&!G?C(x,h.encoder,$,"key",O):x);D=""}if(u(D)||e.isBuffer(D)){if(C){var Y=G?x:C(x,h.encoder,$,"key",O);return[U(Y)+"="+U(C(D,h.encoder,$,"value",O))]}return[U(x)+"="+U(String(D))]}var q=[];if(typeof D>"u")return q;var z;if(v==="comma"&&r(D))G&&C&&(D=e.maybeMap(D,function(L){return L==null?L:C(L)})),z=[{value:D.length>0?D.join(",")||null:void 0}];else if(r(A))z=A;else{var se=Object.keys(D);z=P?se.sort(P):se}var oe=b?String(x).replace(/\./g,"%2E"):String(x),de=y&&r(D)&&D.length===1?oe+"[]":oe;if(w&&r(D)&&D.length===0)return de+"[]";for(var ge=0;ge"u"?g.encodeDotInKeys===!0?!0:h.allowDots:!!g.allowDots;return{addQueryPrefix:typeof g.addQueryPrefix=="boolean"?g.addQueryPrefix:h.addQueryPrefix,allowDots:S,allowEmptyArrays:typeof g.allowEmptyArrays=="boolean"?!!g.allowEmptyArrays:h.allowEmptyArrays,arrayFormat:_,charset:x,charsetSentinel:typeof g.charsetSentinel=="boolean"?g.charsetSentinel:h.charsetSentinel,commaRoundTrip:!!g.commaRoundTrip,delimiter:typeof g.delimiter>"u"?h.delimiter:g.delimiter,encode:typeof g.encode=="boolean"?g.encode:h.encode,encodeDotInKeys:typeof g.encodeDotInKeys=="boolean"?g.encodeDotInKeys:h.encodeDotInKeys,encoder:typeof g.encoder=="function"?g.encoder:h.encoder,encodeValuesOnly:typeof g.encodeValuesOnly=="boolean"?g.encodeValuesOnly:h.encodeValuesOnly,filter:w,format:v,formatter:y,serializeDate:typeof g.serializeDate=="function"?g.serializeDate:h.serializeDate,skipNulls:typeof g.skipNulls=="boolean"?g.skipNulls:h.skipNulls,sort:typeof g.sort=="function"?g.sort:null,strictNullHandling:typeof g.strictNullHandling=="boolean"?g.strictNullHandling:h.strictNullHandling}};return Rd=function(p,g){var x=p,v=m(g),y,w;typeof v.filter=="function"?(w=v.filter,x=w("",x)):r(v.filter)&&(w=v.filter,y=w);var _=[];if(typeof x!="object"||x===null)return"";var S=n[v.arrayFormat],b=S==="comma"&&v.commaRoundTrip;y||(y=Object.keys(x)),v.sort&&y.sort(v.sort);for(var C=s(),A=0;A"u"||P===null)){var E=x[P];v.skipNulls&&E===null||a(_,f(E,P,S,b,v.allowEmptyArrays,v.strictNullHandling,v.skipNulls,v.encodeDotInKeys,v.encode?v.encoder:null,v.filter,v.sort,v.allowDots,v.serializeDate,v.format,v.formatter,v.encodeValuesOnly,v.charset,C))}}var R=_.join(v.delimiter),O=v.addQueryPrefix===!0?"?":"";return v.charsetSentinel&&(v.charset==="iso-8859-1"?O+="utf8=%26%2310003%3B"+v.delimiter:O+="utf8=%E2%9C%93"+v.delimiter),R.length>0?O+R:""},Rd}var Pd,L0;function L_(){if(L0)return Pd;L0=1;var s=ob(),e=Object.prototype.hasOwnProperty,t=Array.isArray,i={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:s.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictMerge:!0,strictNullHandling:!1,throwOnLimitExceeded:!1},n=function(f){return f.replace(/&#(\d+);/g,function(m,p){return String.fromCharCode(parseInt(p,10))})},r=function(f,m,p,g){if(f&&typeof f=="string"&&m.comma&&f.indexOf(",")>-1){if(g&&m.throwOnLimitExceeded)for(var x=0,v=f.indexOf(",");v>-1;){if(x+=1,x>=m.arrayLimit)throw new RangeError("Array limit exceeded. Only "+m.arrayLimit+" element"+(m.arrayLimit===1?"":"s")+" allowed in an array.");v=f.indexOf(",",v+1)}return f.split(",")}if(m.throwOnLimitExceeded&&p>=m.arrayLimit)throw new RangeError("Array limit exceeded. Only "+m.arrayLimit+" element"+(m.arrayLimit===1?"":"s")+" allowed in an array.");return f},o="utf8=%26%2310003%3B",a="utf8=%E2%9C%93",l=function(m,p){var g={__proto__:null},x=p.ignoreQueryPrefix?m.replace(/^\?/,""):m;x=x.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var v=p.parameterLimit===1/0?void 0:p.parameterLimit,y=x.split(p.delimiter,p.throwOnLimitExceeded&&typeof v<"u"?v+1:v);if(p.throwOnLimitExceeded&&typeof v<"u"&&y.length>v)throw new RangeError("Parameter limit exceeded. Only "+v+" parameter"+(v===1?"":"s")+" allowed.");var w=-1,_,S=p.charset;if(p.charsetSentinel)for(_=0;_-1&&(E=t(E)?[E]:E),p.comma&&t(E)&&E.length>p.arrayLimit&&(E=s.combine([],E,p.arrayLimit,p.plainObjects,p.throwOnLimitExceeded)),P!==null){var R=e.call(g,P);R&&(p.duplicates==="combine"||b.indexOf("[]=")>-1)?g[P]=s.combine(g[P],E,p.arrayLimit,p.plainObjects,p.throwOnLimitExceeded):(!R||p.duplicates==="last")&&(g[P]=E)}}return g},c=function(f,m,p,g){var x=0;if(f.length>0&&f[f.length-1]==="[]"){var v=f.slice(0,-1).join("");x=Array.isArray(m)&&m[v]?m[v].length:0}for(var y=g?m:r(m,p,x),w=f.length-1;w>=0;--w){var _,S=f[w];if(S==="[]"&&p.parseArrays)s.isOverflow(y)?_=y:_=p.allowEmptyArrays&&(y===""||p.strictNullHandling&&y===null)?[]:s.combine([],y,p.arrayLimit,p.plainObjects,p.throwOnLimitExceeded);else{_=p.plainObjects?{__proto__:null}:{};var b=S.charAt(0)==="["&&S.charAt(S.length-1)==="]"?S.slice(1,-1):S,C=p.decodeDotInKeys?b.replace(/%2E/g,"."):b,A=parseInt(C,10),P=!isNaN(A)&&S!==C&&String(A)===C&&A>=0&&p.parseArrays;if(!p.parseArrays&&C==="")_={0:y};else if(P&&A=0?g.slice(0,v):g;if(y){if(!p.plainObjects&&e.call(Object.prototype,y)&&!p.allowPrototypes)return;x[x.length]=y}for(var w=g.length,_=v,S=0;_>=0&&S=0){if(p.strictDepth===!0)throw new RangeError("Input depth exceeded depth option of "+p.depth+" and strictDepth is true");x[x.length]="["+g.slice(_)+"]"}return x},u=function(m,p,g,x){if(m){var v=h(m,g);if(v)return c(v,p,g,x)}},d=function(m){if(!m)return i;if(typeof m.allowEmptyArrays<"u"&&typeof m.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof m.decodeDotInKeys<"u"&&typeof m.decodeDotInKeys!="boolean")throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(m.decoder!==null&&typeof m.decoder<"u"&&typeof m.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof m.charset<"u"&&m.charset!=="utf-8"&&m.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");if(typeof m.throwOnLimitExceeded<"u"&&typeof m.throwOnLimitExceeded!="boolean")throw new TypeError("`throwOnLimitExceeded` option must be a boolean");var p=typeof m.charset>"u"?i.charset:m.charset,g=typeof m.duplicates>"u"?i.duplicates:m.duplicates;if(g!=="combine"&&g!=="first"&&g!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var x=typeof m.allowDots>"u"?m.decodeDotInKeys===!0?!0:i.allowDots:!!m.allowDots;return{allowDots:x,allowEmptyArrays:typeof m.allowEmptyArrays=="boolean"?!!m.allowEmptyArrays:i.allowEmptyArrays,allowPrototypes:typeof m.allowPrototypes=="boolean"?m.allowPrototypes:i.allowPrototypes,allowSparse:typeof m.allowSparse=="boolean"?m.allowSparse:i.allowSparse,arrayLimit:typeof m.arrayLimit=="number"?m.arrayLimit:i.arrayLimit,charset:p,charsetSentinel:typeof m.charsetSentinel=="boolean"?m.charsetSentinel:i.charsetSentinel,comma:typeof m.comma=="boolean"?m.comma:i.comma,decodeDotInKeys:typeof m.decodeDotInKeys=="boolean"?m.decodeDotInKeys:i.decodeDotInKeys,decoder:typeof m.decoder=="function"?m.decoder:i.decoder,delimiter:typeof m.delimiter=="string"||s.isRegExp(m.delimiter)?m.delimiter:i.delimiter,depth:typeof m.depth=="number"||m.depth===!1?+m.depth:i.depth,duplicates:g,ignoreQueryPrefix:m.ignoreQueryPrefix===!0,interpretNumericEntities:typeof m.interpretNumericEntities=="boolean"?m.interpretNumericEntities:i.interpretNumericEntities,parameterLimit:typeof m.parameterLimit=="number"?m.parameterLimit:i.parameterLimit,parseArrays:m.parseArrays!==!1,plainObjects:typeof m.plainObjects=="boolean"?m.plainObjects:i.plainObjects,strictDepth:typeof m.strictDepth=="boolean"?!!m.strictDepth:i.strictDepth,strictMerge:typeof m.strictMerge=="boolean"?!!m.strictMerge:i.strictMerge,strictNullHandling:typeof m.strictNullHandling=="boolean"?m.strictNullHandling:i.strictNullHandling,throwOnLimitExceeded:typeof m.throwOnLimitExceeded=="boolean"?m.throwOnLimitExceeded:!1}};return Pd=function(f,m){var p=d(m);if(f===""||f===null||typeof f>"u")return p.plainObjects?{__proto__:null}:{};for(var g=typeof f=="string"?l(f,p):f,x=p.plainObjects?{__proto__:null}:{},v=Object.keys(g),y=0;y",'"',"`"," ","\r",` -`," "],o=["{","}","|","\\","^","`"].concat(r),a=["'"].concat(o),l=["%","/","?",";","#"].concat(a),c=["/","?","#"],h=255,u=/^[+a-z0-9A-Z_-]{0,63}$/,d=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,f={javascript:!0,"javascript:":!0},m={javascript:!0,"javascript:":!0},p={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},g=B_();function x(_,S,b){if(_&&typeof _=="object"&&_ instanceof e)return _;var C=new e;return C.parse(_,S,b),C}e.prototype.parse=function(_,S,b){if(typeof _!="string")throw new TypeError("Parameter 'url' must be a string, not "+typeof _);var C=_.indexOf("?"),A=C!==-1&&C<_.indexOf("#")?"?":"#",P=_.split(A),E=/\\/g;P[0]=P[0].replace(E,"/"),_=P.join(A);var R=_;if(R=R.trim(),!b&&_.split("#").length===1){var O=n.exec(R);if(O)return this.path=R,this.href=R,this.pathname=O[1],O[2]?(this.search=O[2],S?this.query=g.parse(this.search.substr(1)):this.query=this.search.substr(1)):S&&(this.search="",this.query={}),this}var U=t.exec(R);if(U){U=U[0];var G=U.toLowerCase();this.protocol=G,R=R.substr(U.length)}if(b||U||R.match(/^\/\/[^@/]+@[^@/]+/)){var $=R.substr(0,2)==="//";$&&!(U&&m[U])&&(R=R.substr(2),this.slashes=!0)}if(!m[U]&&($||U&&!p[U])){for(var X=-1,D=0;D127?se+="x":se+=z[oe];if(!se.match(u)){var ge=Y.slice(0,D),he=Y.slice(D+1),fe=z.match(d);fe&&(ge.push(fe[1]),he.unshift(fe[2])),he.length&&(R="/"+he.join(".")+R),this.hostname=ge.join(".");break}}}this.hostname.length>h?this.hostname="":this.hostname=this.hostname.toLowerCase(),V||(this.hostname=s.toASCII(this.hostname));var H=this.port?":"+this.port:"",W=this.hostname||"";this.host=W+H,this.href+=this.host,V&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),R[0]!=="/"&&(R="/"+R))}if(!f[G])for(var D=0,q=a.length;D0?b.host.split("@"):!1;se&&(b.auth=se.shift(),b.hostname=se.shift(),b.host=b.hostname)}return b.search=_.search,b.query=_.query,(b.pathname!==null||b.search!==null)&&(b.path=(b.pathname?b.pathname:"")+(b.search?b.search:"")),b.href=b.format(),b}if(!Y.length)return b.pathname=null,b.search?b.path="/"+b.search:b.path=null,b.href=b.format(),b;for(var oe=Y.slice(-1)[0],de=(b.host||_.host||Y.length>1)&&(oe==="."||oe==="..")||oe==="",ge=0,he=Y.length;he>=0;he--)oe=Y[he],oe==="."?Y.splice(he,1):oe===".."?(Y.splice(he,1),ge++):ge&&(Y.splice(he,1),ge--);if(!F&&!V)for(;ge--;ge)Y.unshift("..");F&&Y[0]!==""&&(!Y[0]||Y[0].charAt(0)!=="/")&&Y.unshift(""),de&&Y.join("/").substr(-1)!=="/"&&Y.push("");var fe=Y[0]===""||Y[0]&&Y[0].charAt(0)==="/";if(z){b.hostname=fe?"":Y.length?Y.shift():"",b.host=b.hostname;var se=b.host&&b.host.indexOf("@")>0?b.host.split("@"):!1;se&&(b.auth=se.shift(),b.hostname=se.shift(),b.host=b.hostname)}return F=F||b.host&&Y.length,F&&!fe&&Y.unshift(""),Y.length>0?b.pathname=Y.join("/"):(b.pathname=null,b.path=null),(b.pathname!==null||b.search!==null)&&(b.path=(b.pathname?b.pathname:"")+(b.search?b.search:"")),b.auth=_.auth||b.auth,b.slashes=b.slashes||_.slashes,b.href=b.format(),b},e.prototype.parseHost=function(){var _=this.host,S=i.exec(_);S&&(S=S[0],S!==":"&&(this.port=S.substr(1)),_=_.substr(0,_.length-S.length)),_&&(this.hostname=_)},Dr.parse=x,Dr.resolve=y,Dr.resolveObject=w,Dr.format=v,Dr.Url=e,Dr}N_();const D0={};function mt(s,e,t=3){if(D0[e])return;let i=new Error().stack;typeof i>"u"?console.warn("PixiJS Deprecation Warning: ",`${e} -Deprecated since v${s}`):(i=i.split(` -`).splice(t).join(` -`),console.groupCollapsed?(console.groupCollapsed("%cPixiJS Deprecation Warning: %c%s","color:#614108;background:#fffbe6","font-weight:normal;color:#614108;background:#fffbe6",`${e} -Deprecated since v${s}`),console.warn(i),console.groupEnd()):(console.warn("PixiJS Deprecation Warning: ",`${e} -Deprecated since v${s}`),console.warn(i))),D0[e]=!0}function Ss(s){if(typeof s!="string")throw new TypeError(`Path must be a string. Received ${JSON.stringify(s)}`)}function ka(s){return s.split("?")[0].split("#")[0]}function D_(s){return s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function U_(s,e,t){return s.replace(new RegExp(D_(e),"g"),t)}function $_(s,e){let t="",i=0,n=-1,r=0,o=-1;for(let a=0;a<=s.length;++a){if(a2){const l=t.lastIndexOf("/");if(l!==t.length-1){l===-1?(t="",i=0):(t=t.slice(0,l),i=t.length-1-t.lastIndexOf("/")),n=a,r=0;continue}}else if(t.length===2||t.length===1){t="",i=0,n=a,r=0;continue}}}else t.length>0?t+=`/${s.slice(n+1,a)}`:t=s.slice(n+1,a),i=a-n-1;n=a,r=0}else o===46&&r!==-1?++r:r=-1}return t}const si={toPosix(s){return U_(s,"\\","/")},isUrl(s){return/^https?:/.test(this.toPosix(s))},isDataUrl(s){return/^data:([a-z]+\/[a-z0-9-+.]+(;[a-z0-9-.!#$%*+.{}|~`]+=[a-z0-9-.!#$%*+.{}()_|~`]+)*)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@\/?%\s<>]*?)$/i.test(s)},isBlobUrl(s){return s.startsWith("blob:")},hasProtocol(s){return/^[^/:]+:/.test(this.toPosix(s))},getProtocol(s){Ss(s),s=this.toPosix(s);const e=/^file:\/\/\//.exec(s);if(e)return e[0];const t=/^[^/:]+:\/{0,2}/.exec(s);return t?t[0]:""},toAbsolute(s,e,t){if(Ss(s),this.isDataUrl(s)||this.isBlobUrl(s))return s;const i=ka(this.toPosix(e??Be.ADAPTER.getBaseUrl())),n=ka(this.toPosix(t??this.rootname(i)));return s=this.toPosix(s),s.startsWith("/")?si.join(n,s.slice(1)):this.isAbsolute(s)?s:this.join(i,s)},normalize(s){if(Ss(s),s.length===0)return".";if(this.isDataUrl(s)||this.isBlobUrl(s))return s;s=this.toPosix(s);let e="";const t=s.startsWith("/");this.hasProtocol(s)&&(e=this.rootname(s),s=s.slice(e.length));const i=s.endsWith("/");return s=$_(s),s.length>0&&i&&(s+="/"),t?`/${s}`:e+s},isAbsolute(s){return Ss(s),s=this.toPosix(s),this.hasProtocol(s)?!0:s.startsWith("/")},join(...s){if(s.length===0)return".";let e;for(let t=0;t0)if(e===void 0)e=i;else{const n=s[t-1]??"";this.joinExtensions.includes(this.extname(n).toLowerCase())?e+=`/../${i}`:e+=`/${i}`}}return e===void 0?".":this.normalize(e)},dirname(s){if(Ss(s),s.length===0)return".";s=this.toPosix(s);let e=s.charCodeAt(0);const t=e===47;let i=-1,n=!0;const r=this.getProtocol(s),o=s;s=s.slice(r.length);for(let a=s.length-1;a>=1;--a)if(e=s.charCodeAt(a),e===47){if(!n){i=a;break}}else n=!1;return i===-1?t?"/":this.isUrl(o)?r+s:r:t&&i===1?"//":r+s.slice(0,i)},rootname(s){Ss(s),s=this.toPosix(s);let e="";if(s.startsWith("/")?e="/":e=this.getProtocol(s),this.isUrl(s)){const t=s.indexOf("/",e.length);t!==-1?e=s.slice(0,t):e=s,e.endsWith("/")||(e+="/")}return e},basename(s,e){Ss(s),e&&Ss(e),s=ka(this.toPosix(s));let t=0,i=-1,n=!0,r;if(e!==void 0&&e.length>0&&e.length<=s.length){if(e.length===s.length&&e===s)return"";let o=e.length-1,a=-1;for(r=s.length-1;r>=0;--r){const l=s.charCodeAt(r);if(l===47){if(!n){t=r+1;break}}else a===-1&&(n=!1,a=r+1),o>=0&&(l===e.charCodeAt(o)?--o===-1&&(i=r):(o=-1,i=a))}return t===i?i=a:i===-1&&(i=s.length),s.slice(t,i)}for(r=s.length-1;r>=0;--r)if(s.charCodeAt(r)===47){if(!n){t=r+1;break}}else i===-1&&(n=!1,i=r+1);return i===-1?"":s.slice(t,i)},extname(s){Ss(s),s=ka(this.toPosix(s));let e=-1,t=0,i=-1,n=!0,r=0;for(let o=s.length-1;o>=0;--o){const a=s.charCodeAt(o);if(a===47){if(!n){t=o+1;break}continue}i===-1&&(n=!1,i=o+1),a===46?e===-1?e=o:r!==1&&(r=1):e!==-1&&(r=-1)}return e===-1||i===-1||r===0||r===1&&e===i-1&&e===t+1?"":s.slice(e,i)},parse(s){Ss(s);const e={root:"",dir:"",base:"",ext:"",name:""};if(s.length===0)return e;s=ka(this.toPosix(s));let t=s.charCodeAt(0);const i=this.isAbsolute(s);let n;e.root=this.rootname(s),i||this.hasProtocol(s)?n=1:n=0;let r=-1,o=0,a=-1,l=!0,c=s.length-1,h=0;for(;c>=n;--c){if(t=s.charCodeAt(c),t===47){if(!l){o=c+1;break}continue}a===-1&&(l=!1,a=c+1),t===46?r===-1?r=c:h!==1&&(h=1):r!==-1&&(h=-1)}return r===-1||a===-1||h===0||h===1&&r===a-1&&r===o+1?a!==-1&&(o===0&&i?e.base=e.name=s.slice(1,a):e.base=e.name=s.slice(o,a)):(o===0&&i?(e.name=s.slice(1,r),e.base=s.slice(1,a)):(e.name=s.slice(o,r),e.base=s.slice(o,a)),e.ext=s.slice(r,a)),e.dir=this.dirname(s),e},sep:"/",delimiter:":",joinExtensions:[".html"]};let Fd;async function X_(){return Fd??(Fd=(async()=>{var r;const s=document.createElement("canvas").getContext("webgl");if(!s)return bi.UNPACK;const e=await new Promise(o=>{const a=document.createElement("video");a.onloadeddata=()=>o(a),a.onerror=()=>o(null),a.autoplay=!1,a.crossOrigin="anonymous",a.preload="auto",a.src="data:video/webm;base64,GkXfo59ChoEBQveBAULygQRC84EIQoKEd2VibUKHgQJChYECGFOAZwEAAAAAAAHTEU2bdLpNu4tTq4QVSalmU6yBoU27i1OrhBZUrmtTrIHGTbuMU6uEElTDZ1OsggEXTbuMU6uEHFO7a1OsggG97AEAAAAAAABZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmoCrXsYMPQkBNgIRMYXZmV0GETGF2ZkSJiEBEAAAAAAAAFlSua8yuAQAAAAAAAEPXgQFzxYgAAAAAAAAAAZyBACK1nIN1bmSIgQCGhVZfVlA5g4EBI+ODhAJiWgDglLCBArqBApqBAlPAgQFVsIRVuYEBElTDZ9Vzc9JjwItjxYgAAAAAAAAAAWfInEWjh0VOQ09ERVJEh49MYXZjIGxpYnZweC12cDlnyKJFo4hEVVJBVElPTkSHlDAwOjAwOjAwLjA0MDAwMDAwMAAAH0O2dcfngQCgwqGggQAAAIJJg0IAABAAFgA4JBwYSgAAICAAEb///4r+AAB1oZ2mm+6BAaWWgkmDQgAAEAAWADgkHBhKAAAgIABIQBxTu2uRu4+zgQC3iveBAfGCAXHwgQM=",a.load()});if(!e)return bi.UNPACK;const t=s.createTexture();s.bindTexture(s.TEXTURE_2D,t);const i=s.createFramebuffer();s.bindFramebuffer(s.FRAMEBUFFER,i),s.framebufferTexture2D(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.TEXTURE_2D,t,0),s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),s.pixelStorei(s.UNPACK_COLORSPACE_CONVERSION_WEBGL,s.NONE),s.texImage2D(s.TEXTURE_2D,0,s.RGBA,s.RGBA,s.UNSIGNED_BYTE,e);const n=new Uint8Array(4);return s.readPixels(0,0,1,1,s.RGBA,s.UNSIGNED_BYTE,n),s.deleteFramebuffer(i),s.deleteTexture(t),(r=s.getExtension("WEBGL_lose_context"))==null||r.loseContext(),n[0]<=n[3]?bi.PMA:bi.UNPACK})()),Fd}let Od;function V_(){return typeof Od>"u"&&(Od=(function(){var e;const s={stencil:!0,failIfMajorPerformanceCaveat:Be.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT};try{if(!Be.ADAPTER.getWebGLRenderingContext())return!1;const t=Be.ADAPTER.createCanvas();let i=t.getContext("webgl",s)||t.getContext("experimental-webgl",s);const n=!!((e=i==null?void 0:i.getContextAttributes())!=null&&e.stencil);if(i){const r=i.getExtension("WEBGL_lose_context");r&&r.loseContext()}return i=null,n}catch{return!1}})()),Od}var Y_={grad:.9,turn:360,rad:360/(2*Math.PI)},wn=function(s){return typeof s=="string"?s.length>0:typeof s=="number"},xi=function(s,e,t){return e===void 0&&(e=0),t===void 0&&(t=Math.pow(10,e)),Math.round(t*s)/t+0},ps=function(s,e,t){return e===void 0&&(e=0),t===void 0&&(t=1),s>t?t:s>e?s:e},ab=function(s){return(s=isFinite(s)?s%360:0)>0?s:s+360},U0=function(s){return{r:ps(s.r,0,255),g:ps(s.g,0,255),b:ps(s.b,0,255),a:ps(s.a)}},Ld=function(s){return{r:xi(s.r),g:xi(s.g),b:xi(s.b),a:xi(s.a,3)}},G_=/^#([0-9a-f]{3,8})$/i,ql=function(s){var e=s.toString(16);return e.length<2?"0"+e:e},lb=function(s){var e=s.r,t=s.g,i=s.b,n=s.a,r=Math.max(e,t,i),o=r-Math.min(e,t,i),a=o?r===e?(t-i)/o:r===t?2+(i-e)/o:4+(e-t)/o:0;return{h:60*(a<0?a+6:a),s:r?o/r*100:0,v:r/255*100,a:n}},cb=function(s){var e=s.h,t=s.s,i=s.v,n=s.a;e=e/360*6,t/=100,i/=100;var r=Math.floor(e),o=i*(1-t),a=i*(1-(e-r)*t),l=i*(1-(1-e+r)*t),c=r%6;return{r:255*[i,a,o,o,l,i][c],g:255*[l,i,i,a,o,o][c],b:255*[o,o,l,i,i,a][c],a:n}},$0=function(s){return{h:ab(s.h),s:ps(s.s,0,100),l:ps(s.l,0,100),a:ps(s.a)}},X0=function(s){return{h:xi(s.h),s:xi(s.s),l:xi(s.l),a:xi(s.a,3)}},V0=function(s){return cb((t=(e=s).s,{h:e.h,s:(t*=((i=e.l)<50?i:100-i)/100)>0?2*t/(i+t)*100:0,v:i+t,a:e.a}));var e,t,i},el=function(s){return{h:(e=lb(s)).h,s:(n=(200-(t=e.s))*(i=e.v)/100)>0&&n<200?t*i/100/(n<=100?n:200-n)*100:0,l:n/2,a:e.a};var e,t,i,n},j_=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,H_=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,W_=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,z_=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Nf={string:[[function(s){var e=G_.exec(s);return e?(s=e[1]).length<=4?{r:parseInt(s[0]+s[0],16),g:parseInt(s[1]+s[1],16),b:parseInt(s[2]+s[2],16),a:s.length===4?xi(parseInt(s[3]+s[3],16)/255,2):1}:s.length===6||s.length===8?{r:parseInt(s.substr(0,2),16),g:parseInt(s.substr(2,2),16),b:parseInt(s.substr(4,2),16),a:s.length===8?xi(parseInt(s.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(s){var e=W_.exec(s)||z_.exec(s);return e?e[2]!==e[4]||e[4]!==e[6]?null:U0({r:Number(e[1])/(e[2]?100/255:1),g:Number(e[3])/(e[4]?100/255:1),b:Number(e[5])/(e[6]?100/255:1),a:e[7]===void 0?1:Number(e[7])/(e[8]?100:1)}):null},"rgb"],[function(s){var e=j_.exec(s)||H_.exec(s);if(!e)return null;var t,i,n=$0({h:(t=e[1],i=e[2],i===void 0&&(i="deg"),Number(t)*(Y_[i]||1)),s:Number(e[3]),l:Number(e[4]),a:e[5]===void 0?1:Number(e[5])/(e[6]?100:1)});return V0(n)},"hsl"]],object:[[function(s){var e=s.r,t=s.g,i=s.b,n=s.a,r=n===void 0?1:n;return wn(e)&&wn(t)&&wn(i)?U0({r:Number(e),g:Number(t),b:Number(i),a:Number(r)}):null},"rgb"],[function(s){var e=s.h,t=s.s,i=s.l,n=s.a,r=n===void 0?1:n;if(!wn(e)||!wn(t)||!wn(i))return null;var o=$0({h:Number(e),s:Number(t),l:Number(i),a:Number(r)});return V0(o)},"hsl"],[function(s){var e=s.h,t=s.s,i=s.v,n=s.a,r=n===void 0?1:n;if(!wn(e)||!wn(t)||!wn(i))return null;var o=(function(a){return{h:ab(a.h),s:ps(a.s,0,100),v:ps(a.v,0,100),a:ps(a.a)}})({h:Number(e),s:Number(t),v:Number(i),a:Number(r)});return cb(o)},"hsv"]]},Y0=function(s,e){for(var t=0;t=.5},s.prototype.toHex=function(){return e=Ld(this.rgba),t=e.r,i=e.g,n=e.b,o=(r=e.a)<1?ql(xi(255*r)):"","#"+ql(t)+ql(i)+ql(n)+o;var e,t,i,n,r,o},s.prototype.toRgb=function(){return Ld(this.rgba)},s.prototype.toRgbString=function(){return e=Ld(this.rgba),t=e.r,i=e.g,n=e.b,(r=e.a)<1?"rgba("+t+", "+i+", "+n+", "+r+")":"rgb("+t+", "+i+", "+n+")";var e,t,i,n,r},s.prototype.toHsl=function(){return X0(el(this.rgba))},s.prototype.toHslString=function(){return e=X0(el(this.rgba)),t=e.h,i=e.s,n=e.l,(r=e.a)<1?"hsla("+t+", "+i+"%, "+n+"%, "+r+")":"hsl("+t+", "+i+"%, "+n+"%)";var e,t,i,n,r},s.prototype.toHsv=function(){return e=lb(this.rgba),{h:xi(e.h),s:xi(e.s),v:xi(e.v),a:xi(e.a,3)};var e},s.prototype.invert=function(){return Vs({r:255-(e=this.rgba).r,g:255-e.g,b:255-e.b,a:e.a});var e},s.prototype.saturate=function(e){return e===void 0&&(e=.1),Vs(Bd(this.rgba,e))},s.prototype.desaturate=function(e){return e===void 0&&(e=.1),Vs(Bd(this.rgba,-e))},s.prototype.grayscale=function(){return Vs(Bd(this.rgba,-1))},s.prototype.lighten=function(e){return e===void 0&&(e=.1),Vs(G0(this.rgba,e))},s.prototype.darken=function(e){return e===void 0&&(e=.1),Vs(G0(this.rgba,-e))},s.prototype.rotate=function(e){return e===void 0&&(e=15),this.hue(this.hue()+e)},s.prototype.alpha=function(e){return typeof e=="number"?Vs({r:(t=this.rgba).r,g:t.g,b:t.b,a:e}):xi(this.rgba.a,3);var t},s.prototype.hue=function(e){var t=el(this.rgba);return typeof e=="number"?Vs({h:e,s:t.s,l:t.l,a:t.a}):xi(t.h)},s.prototype.isEqual=function(e){return this.toHex()===Vs(e).toHex()},s})(),Vs=function(s){return s instanceof Df?s:new Df(s)},j0=[],K_=function(s){s.forEach(function(e){j0.indexOf(e)<0&&(e(Df,Nf),j0.push(e))})};function Z_(s,e){var t={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},i={};for(var n in t)i[t[n]]=n;var r={};s.prototype.toName=function(o){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var a,l,c=i[this.toHex()];if(c)return c;if(o!=null&&o.closest){var h=this.toRgb(),u=1/0,d="black";if(!r.length)for(var f in t)r[f]=new s(t[f]).toRgb();for(var m in t){var p=(a=h,l=r[m],Math.pow(a.r-l.r,2)+Math.pow(a.g-l.g,2)+Math.pow(a.b-l.b,2));pn===t[r]);if(e!==null&&t!==null){const n=Object.keys(e),r=Object.keys(t);return n.length!==r.length?!1:n.every(o=>e[o]===t[o])}return e===t}toRgba(){const[e,t,i,n]=this._components;return{r:e,g:t,b:i,a:n}}toRgb(){const[e,t,i]=this._components;return{r:e,g:t,b:i}}toRgbaString(){const[e,t,i]=this.toUint8RgbArray();return`rgba(${e},${t},${i},${this.alpha})`}toUint8RgbArray(e){const[t,i,n]=this._components;return e=e??[],e[0]=Math.round(t*255),e[1]=Math.round(i*255),e[2]=Math.round(n*255),e}toRgbArray(e){e=e??[];const[t,i,n]=this._components;return e[0]=t,e[1]=i,e[2]=n,e}toNumber(){return this._int}toLittleEndianNumber(){const e=this._int;return(e>>16)+(e&65280)+((e&255)<<16)}multiply(e){const[t,i,n,r]=Rc.temp.setValue(e)._components;return this._components[0]*=t,this._components[1]*=i,this._components[2]*=n,this._components[3]*=r,this.refreshInt(),this._value=null,this}premultiply(e,t=!0){return t&&(this._components[0]*=e,this._components[1]*=e,this._components[2]*=e),this._components[3]=e,this.refreshInt(),this._value=null,this}toPremultiplied(e,t=!0){if(e===1)return(255<<24)+this._int;if(e===0)return t?0:this._int;let i=this._int>>16&255,n=this._int>>8&255,r=this._int&255;return t&&(i=i*e+.5|0,n=n*e+.5|0,r=r*e+.5|0),(e*255<<24)+(i<<16)+(n<<8)+r}toHex(){const e=this._int.toString(16);return`#${"000000".substring(0,6-e.length)+e}`}toHexa(){const e=Math.round(this._components[3]*255).toString(16);return this.toHex()+"00".substring(0,2-e.length)+e}setAlpha(e){return this._components[3]=this._clamp(e),this}round(e){const[t,i,n]=this._components;return this._components[0]=Math.round(t*e)/e,this._components[1]=Math.round(i*e)/e,this._components[2]=Math.round(n*e)/e,this.refreshInt(),this._value=null,this}toArray(e){e=e??[];const[t,i,n,r]=this._components;return e[0]=t,e[1]=i,e[2]=n,e[3]=r,e}normalize(e){let t,i,n,r;if((typeof e=="number"||e instanceof Number)&&e>=0&&e<=16777215){const o=e;t=(o>>16&255)/255,i=(o>>8&255)/255,n=(o&255)/255,r=1}else if((Array.isArray(e)||e instanceof Float32Array)&&e.length>=3&&e.length<=4)e=this._clamp(e),[t,i,n,r=1]=e;else if((e instanceof Uint8Array||e instanceof Uint8ClampedArray)&&e.length>=3&&e.length<=4)e=this._clamp(e,0,255),[t,i,n,r=255]=e,t/=255,i/=255,n/=255,r/=255;else if(typeof e=="string"||typeof e=="object"){if(typeof e=="string"){const a=Rc.HEX_PATTERN.exec(e);a&&(e=`#${a[2]}`)}const o=Vs(e);o.isValid()&&({r:t,g:i,b:n,a:r}=o.rgba,t/=255,i/=255,n/=255)}if(t!==void 0)this._components[0]=t,this._components[1]=i,this._components[2]=n,this._components[3]=r,this.refreshInt();else throw new Error(`Unable to convert color ${e}`)}refreshInt(){this._clamp(this._components);const[e,t,i]=this._components;this._int=(e*255<<16)+(t*255<<8)+(i*255|0)}_clamp(e,t=0,i=1){return typeof e=="number"?Math.min(Math.max(e,t),i):(e.forEach((n,r)=>{e[r]=Math.min(Math.max(n,t),i)}),e)}};Bo.shared=new Bo,Bo.temp=new Bo,Bo.HEX_PATTERN=/^(#|0x)?(([a-f0-9]{3}){1,2}([a-f0-9]{2})?)$/i;let At=Bo;function J_(s){return mt("7.2.0","utils.hex2string is deprecated, use Color#toHex instead"),At.shared.setValue(s).toHex()}function Q_(s){return mt("7.2.0","utils.rgb2hex is deprecated, use Color#toNumber instead"),At.shared.setValue(s).toNumber()}function eC(){const s=[],e=[];for(let i=0;i<32;i++)s[i]=i,e[i]=i;s[We.NORMAL_NPM]=We.NORMAL,s[We.ADD_NPM]=We.ADD,s[We.SCREEN_NPM]=We.SCREEN,e[We.NORMAL]=We.NORMAL_NPM,e[We.ADD]=We.ADD_NPM,e[We.SCREEN]=We.SCREEN_NPM;const t=[];return t.push(e),t.push(s),t}const hb=eC();function ub(s,e){return hb[e?1:0][s]}function tC(s,e=null){const t=s*6;if(e=e||new Uint16Array(t),e.length!==t)throw new Error(`Out buffer length is incorrect, got ${e.length} and expected ${t}`);for(let i=0,n=0;i>>1,s|=s>>>2,s|=s>>>4,s|=s>>>8,s|=s>>>16,s+1}function H0(s){return!(s&s-1)&&!!s}function W0(s){let e=(s>65535?1:0)<<4;s>>>=e;let t=(s>255?1:0)<<3;return s>>>=t,e|=t,t=(s>15?1:0)<<2,s>>>=t,e|=t,t=(s>3?1:0)<<1,s>>>=t,e|=t,e|s>>1}function Jo(s,e,t){const i=s.length;let n;if(e>=i||t===0)return;t=e+t>i?i-e:t;const r=i-t;for(n=e;n(s.Renderer="renderer",s.Application="application",s.RendererSystem="renderer-webgl-system",s.RendererPlugin="renderer-webgl-plugin",s.CanvasRendererSystem="renderer-canvas-system",s.CanvasRendererPlugin="renderer-canvas-plugin",s.Asset="asset",s.LoadParser="load-parser",s.ResolveParser="resolve-parser",s.CacheParser="cache-parser",s.DetectionParser="detection-parser",s))(ke||{});const $f=s=>{if(typeof s=="function"||typeof s=="object"&&s.extension){if(!s.extension)throw new Error("Extension class must have an extension object");s={...typeof s.extension!="object"?{type:s.extension}:s.extension,ref:s}}if(typeof s=="object")s={...s};else throw new Error("Invalid extension type");return typeof s.type=="string"&&(s.type=[s.type]),s},J0=(s,e)=>$f(s).priority??e,$e={_addHandlers:{},_removeHandlers:{},_queue:{},remove(...s){return s.map($f).forEach(e=>{e.type.forEach(t=>{var i,n;return(n=(i=this._removeHandlers)[t])==null?void 0:n.call(i,e)})}),this},add(...s){return s.map($f).forEach(e=>{e.type.forEach(t=>{var r,o;const i=this._addHandlers,n=this._queue;i[t]?(r=i[t])==null||r.call(i,e):(n[t]=n[t]||[],(o=n[t])==null||o.push(e))})}),this},handle(s,e,t){var o;const i=this._addHandlers,n=this._removeHandlers;if(i[s]||n[s])throw new Error(`Extension type ${s} already has a handler`);i[s]=e,n[s]=t;const r=this._queue;return r[s]&&((o=r[s])==null||o.forEach(a=>e(a)),delete r[s]),this},handleByMap(s,e){return this.handle(s,t=>{t.name&&(e[t.name]=t.ref)},t=>{t.name&&delete e[t.name]})},handleByList(s,e,t=-1){return this.handle(s,i=>{e.includes(i.ref)||(e.push(i.ref),e.sort((n,r)=>J0(r,t)-J0(n,t)))},i=>{const n=e.indexOf(i.ref);n!==-1&&e.splice(n,1)})}};class Xf{constructor(e){typeof e=="number"?this.rawBinaryData=new ArrayBuffer(e):e instanceof Uint8Array?this.rawBinaryData=e.buffer:this.rawBinaryData=e,this.uint32View=new Uint32Array(this.rawBinaryData),this.float32View=new Float32Array(this.rawBinaryData)}get int8View(){return this._int8View||(this._int8View=new Int8Array(this.rawBinaryData)),this._int8View}get uint8View(){return this._uint8View||(this._uint8View=new Uint8Array(this.rawBinaryData)),this._uint8View}get int16View(){return this._int16View||(this._int16View=new Int16Array(this.rawBinaryData)),this._int16View}get uint16View(){return this._uint16View||(this._uint16View=new Uint16Array(this.rawBinaryData)),this._uint16View}get int32View(){return this._int32View||(this._int32View=new Int32Array(this.rawBinaryData)),this._int32View}view(e){return this[`${e}View`]}destroy(){this.rawBinaryData=null,this._int8View=null,this._uint8View=null,this._int16View=null,this._uint16View=null,this._int32View=null,this.uint32View=null,this.float32View=null}static sizeOf(e){switch(e){case"int8":case"uint8":return 1;case"int16":case"uint16":return 2;case"int32":case"uint32":case"float32":return 4;default:throw new Error(`${e} isn't a valid view type`)}}}const aC=["precision mediump float;","void main(void){","float test = 0.1;","%forloop%","gl_FragColor = vec4(0.0);","}"].join(` -`);function lC(s){let e="";for(let t=0;t0&&(e+=` -else `),t=0;--i){const n=Vf[i];if(n.test&&n.test(s,t))return new n(s,e)}throw new Error("Unrecognized source type to auto-detect Resource")}class Ls{constructor(e){this.items=[],this._name=e,this._aliasCount=0}emit(e,t,i,n,r,o,a,l){if(arguments.length>8)throw new Error("max arguments reached");const{name:c,items:h}=this;this._aliasCount++;for(let u=0,d=h.length;u0&&this.items.length>1&&(this._aliasCount=0,this.items=this.items.slice(0))}add(e){return e[this._name]&&(this.ensureNonAliasedItems(),this.remove(e),this.items.push(e)),this}remove(e){const t=this.items.indexOf(e);return t!==-1&&(this.ensureNonAliasedItems(),this.items.splice(t,1)),this}contains(e){return this.items.includes(e)}removeAll(){return this.ensureNonAliasedItems(),this.items.length=0,this}destroy(){this.removeAll(),this.items.length=0,this._name=""}get empty(){return this.items.length===0}get name(){return this._name}}Object.defineProperties(Ls.prototype,{dispatch:{value:Ls.prototype.emit},run:{value:Ls.prototype.emit}});class xl{constructor(e=0,t=0){this._width=e,this._height=t,this.destroyed=!1,this.internal=!1,this.onResize=new Ls("setRealSize"),this.onUpdate=new Ls("update"),this.onError=new Ls("onError")}bind(e){this.onResize.add(e),this.onUpdate.add(e),this.onError.add(e),(this._width||this._height)&&this.onResize.emit(this._width,this._height)}unbind(e){this.onResize.remove(e),this.onUpdate.remove(e),this.onError.remove(e)}resize(e,t){(e!==this._width||t!==this._height)&&(this._width=e,this._height=t,this.onResize.emit(e,t))}get valid(){return!!this._width&&!!this._height}update(){this.destroyed||this.onUpdate.emit()}load(){return Promise.resolve(this)}get width(){return this._width}get height(){return this._height}style(e,t,i){return!1}dispose(){}destroy(){this.destroyed||(this.destroyed=!0,this.dispose(),this.onError.removeAll(),this.onError=null,this.onResize.removeAll(),this.onResize=null,this.onUpdate.removeAll(),this.onUpdate=null)}static test(e,t){return!1}}class au extends xl{constructor(e,t){const{width:i,height:n}=t||{};if(!i||!n)throw new Error("BufferResource width or height invalid");super(i,n),this.data=e,this.unpackAlignment=t.unpackAlignment??4}upload(e,t,i){const n=e.gl;n.pixelStorei(n.UNPACK_ALIGNMENT,this.unpackAlignment),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t.alphaMode===bi.UNPACK);const r=t.realWidth,o=t.realHeight;return i.width===r&&i.height===o?n.texSubImage2D(t.target,0,0,0,r,o,t.format,i.type,this.data):(i.width=r,i.height=o,n.texImage2D(t.target,0,i.internalFormat,r,o,0,t.format,i.type,this.data)),!0}dispose(){this.data=null}static test(e){return e===null||e instanceof Int8Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Int16Array||e instanceof Uint16Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Float32Array}}const hC={scaleMode:Rs.NEAREST,alphaMode:bi.NPM},Yf=class No extends Rl{constructor(e=null,t=null){super(),t=Object.assign({},No.defaultOptions,t);const{alphaMode:i,mipmap:n,anisotropicLevel:r,scaleMode:o,width:a,height:l,wrapMode:c,format:h,type:u,target:d,resolution:f,resourceOptions:m}=t;e&&!(e instanceof xl)&&(e=fb(e,m),e.internal=!0),this.resolution=f||Be.RESOLUTION,this.width=Math.round((a||0)*this.resolution)/this.resolution,this.height=Math.round((l||0)*this.resolution)/this.resolution,this._mipmap=n,this.anisotropicLevel=r,this._wrapMode=c,this._scaleMode=o,this.format=h,this.type=u,this.target=d,this.alphaMode=i,this.uid=ho(),this.touched=0,this.isPowerOfTwo=!1,this._refreshPOT(),this._glTextures={},this.dirtyId=0,this.dirtyStyleId=0,this.cacheId=null,this.valid=a>0&&l>0,this.textureCacheIds=[],this.destroyed=!1,this.resource=null,this._batchEnabled=0,this._batchLocation=0,this.parentTextureArray=null,this.setResource(e)}get realWidth(){return Math.round(this.width*this.resolution)}get realHeight(){return Math.round(this.height*this.resolution)}get mipmap(){return this._mipmap}set mipmap(e){this._mipmap!==e&&(this._mipmap=e,this.dirtyStyleId++)}get scaleMode(){return this._scaleMode}set scaleMode(e){this._scaleMode!==e&&(this._scaleMode=e,this.dirtyStyleId++)}get wrapMode(){return this._wrapMode}set wrapMode(e){this._wrapMode!==e&&(this._wrapMode=e,this.dirtyStyleId++)}setStyle(e,t){let i;return e!==void 0&&e!==this.scaleMode&&(this.scaleMode=e,i=!0),t!==void 0&&t!==this.mipmap&&(this.mipmap=t,i=!0),i&&this.dirtyStyleId++,this}setSize(e,t,i){return i=i||this.resolution,this.setRealSize(e*i,t*i,i)}setRealSize(e,t,i){return this.resolution=i||this.resolution,this.width=Math.round(e)/this.resolution,this.height=Math.round(t)/this.resolution,this._refreshPOT(),this.update(),this}_refreshPOT(){this.isPowerOfTwo=H0(this.realWidth)&&H0(this.realHeight)}setResolution(e){const t=this.resolution;return t===e?this:(this.resolution=e,this.valid&&(this.width=Math.round(this.width*t)/e,this.height=Math.round(this.height*t)/e,this.emit("update",this)),this._refreshPOT(),this)}setResource(e){if(this.resource===e)return this;if(this.resource)throw new Error("Resource can be set only once");return e.bind(this),this.resource=e,this}update(){this.valid?(this.dirtyId++,this.dirtyStyleId++,this.emit("update",this)):this.width>0&&this.height>0&&(this.valid=!0,this.emit("loaded",this),this.emit("update",this))}onError(e){this.emit("error",this,e)}destroy(){this.resource&&(this.resource.unbind(this),this.resource.internal&&this.resource.destroy(),this.resource=null),this.cacheId&&(delete er[this.cacheId],delete Ys[this.cacheId],this.cacheId=null),this.valid=!1,this.dispose(),No.removeFromCache(this),this.textureCacheIds=null,this.destroyed=!0,this.emit("destroyed",this),this.removeAllListeners()}dispose(){this.emit("dispose",this)}castToBaseTexture(){return this}static from(e,t,i=Be.STRICT_TEXTURE_CACHE){const n=typeof e=="string";let r=null;if(n)r=e;else{if(!e._pixiId){const a=(t==null?void 0:t.pixiIdPrefix)||"pixiid";e._pixiId=`${a}_${ho()}`}r=e._pixiId}let o=er[r];if(n&&i&&!o)throw new Error(`The cacheId "${r}" does not exist in BaseTextureCache.`);return o||(o=new No(e,t),o.cacheId=r,No.addToCache(o,r)),o}static fromBuffer(e,t,i,n){e=e||new Float32Array(t*i*4);const r=new au(e,{width:t,height:i,...n==null?void 0:n.resourceOptions});let o,a;return e instanceof Float32Array?(o=Te.RGBA,a=Ue.FLOAT):e instanceof Int32Array?(o=Te.RGBA_INTEGER,a=Ue.INT):e instanceof Uint32Array?(o=Te.RGBA_INTEGER,a=Ue.UNSIGNED_INT):e instanceof Int16Array?(o=Te.RGBA_INTEGER,a=Ue.SHORT):e instanceof Uint16Array?(o=Te.RGBA_INTEGER,a=Ue.UNSIGNED_SHORT):e instanceof Int8Array?(o=Te.RGBA,a=Ue.BYTE):(o=Te.RGBA,a=Ue.UNSIGNED_BYTE),r.internal=!0,new No(r,Object.assign({},hC,{type:a,format:o},n))}static addToCache(e,t){t&&(e.textureCacheIds.includes(t)||e.textureCacheIds.push(t),er[t]&&er[t]!==e&&console.warn(`BaseTexture added to the cache with an id [${t}] that already had an entry`),er[t]=e)}static removeFromCache(e){if(typeof e=="string"){const t=er[e];if(t){const i=t.textureCacheIds.indexOf(e);return i>-1&&t.textureCacheIds.splice(i,1),delete er[e],t}}else if(e!=null&&e.textureCacheIds){for(let t=0;t1){for(let u=0;u(s[s.POLY=0]="POLY",s[s.RECT=1]="RECT",s[s.CIRC=2]="CIRC",s[s.ELIP=3]="ELIP",s[s.RREC=4]="RREC",s))(Ci||{});class St{constructor(e=0,t=0){this.x=0,this.y=0,this.x=e,this.y=t}clone(){return new St(this.x,this.y)}copyFrom(e){return this.set(e.x,e.y),this}copyTo(e){return e.set(this.x,this.y),e}equals(e){return e.x===this.x&&e.y===this.y}set(e=0,t=e){return this.x=e,this.y=t,this}}St.prototype.toString=function(){return`[@pixi/math:Point x=${this.x} y=${this.y}]`};const Kl=[new St,new St,new St,new St];class ct{constructor(e=0,t=0,i=0,n=0){this.x=Number(e),this.y=Number(t),this.width=Number(i),this.height=Number(n),this.type=Ci.RECT}get left(){return this.x}get right(){return this.x+this.width}get top(){return this.y}get bottom(){return this.y+this.height}static get EMPTY(){return new ct(0,0,0,0)}clone(){return new ct(this.x,this.y,this.width,this.height)}copyFrom(e){return this.x=e.x,this.y=e.y,this.width=e.width,this.height=e.height,this}copyTo(e){return e.x=this.x,e.y=this.y,e.width=this.width,e.height=this.height,e}contains(e,t){return this.width<=0||this.height<=0?!1:e>=this.x&&e=this.y&&te.right?e.right:this.right)<=C)return!1;const A=this.ye.bottom?e.bottom:this.bottom)>A}const i=this.left,n=this.right,r=this.top,o=this.bottom;if(n<=i||o<=r)return!1;const a=Kl[0].set(e.left,e.top),l=Kl[1].set(e.left,e.bottom),c=Kl[2].set(e.right,e.top),h=Kl[3].set(e.right,e.bottom);if(c.x<=a.x||l.y<=a.y)return!1;const u=Math.sign(t.a*t.d-t.b*t.c);if(u===0||(t.apply(a,a),t.apply(l,l),t.apply(c,c),t.apply(h,h),Math.max(a.x,l.x,c.x,h.x)<=i||Math.min(a.x,l.x,c.x,h.x)>=n||Math.max(a.y,l.y,c.y,h.y)<=r||Math.min(a.y,l.y,c.y,h.y)>=o))return!1;const d=u*(l.y-a.y),f=u*(a.x-l.x),m=d*i+f*r,p=d*n+f*r,g=d*i+f*o,x=d*n+f*o;if(Math.max(m,p,g,x)<=d*a.x+f*a.y||Math.min(m,p,g,x)>=d*h.x+f*h.y)return!1;const v=u*(a.y-c.y),y=u*(c.x-a.x),w=v*i+y*r,_=v*n+y*r,S=v*i+y*o,b=v*n+y*o;return!(Math.max(w,_,S,b)<=v*a.x+y*a.y||Math.min(w,_,S,b)>=v*h.x+y*h.y)}pad(e=0,t=e){return this.x-=e,this.y-=t,this.width+=e*2,this.height+=t*2,this}fit(e){const t=Math.max(this.x,e.x),i=Math.min(this.x+this.width,e.x+e.width),n=Math.max(this.y,e.y),r=Math.min(this.y+this.height,e.y+e.height);return this.x=t,this.width=Math.max(i-t,0),this.y=n,this.height=Math.max(r-n,0),this}ceil(e=1,t=.001){const i=Math.ceil((this.x+this.width-t)*e)/e,n=Math.ceil((this.y+this.height-t)*e)/e;return this.x=Math.floor((this.x+t)*e)/e,this.y=Math.floor((this.y+t)*e)/e,this.width=i-this.x,this.height=n-this.y,this}enlarge(e){const t=Math.min(this.x,e.x),i=Math.max(this.x+this.width,e.x+e.width),n=Math.min(this.y,e.y),r=Math.max(this.y+this.height,e.y+e.height);return this.x=t,this.width=i-t,this.y=n,this.height=r-n,this}}ct.prototype.toString=function(){return`[@pixi/math:Rectangle x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`};class lu{constructor(e=0,t=0,i=0){this.x=e,this.y=t,this.radius=i,this.type=Ci.CIRC}clone(){return new lu(this.x,this.y,this.radius)}contains(e,t){if(this.radius<=0)return!1;const i=this.radius*this.radius;let n=this.x-e,r=this.y-t;return n*=n,r*=r,n+r<=i}getBounds(){return new ct(this.x-this.radius,this.y-this.radius,this.radius*2,this.radius*2)}}lu.prototype.toString=function(){return`[@pixi/math:Circle x=${this.x} y=${this.y} radius=${this.radius}]`};class cu{constructor(e=0,t=0,i=0,n=0){this.x=e,this.y=t,this.width=i,this.height=n,this.type=Ci.ELIP}clone(){return new cu(this.x,this.y,this.width,this.height)}contains(e,t){if(this.width<=0||this.height<=0)return!1;let i=(e-this.x)/this.width,n=(t-this.y)/this.height;return i*=i,n*=n,i+n<=1}getBounds(){return new ct(this.x-this.width,this.y-this.height,this.width,this.height)}}cu.prototype.toString=function(){return`[@pixi/math:Ellipse x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`};class ro{constructor(...e){let t=Array.isArray(e[0])?e[0]:e;if(typeof t[0]!="number"){const i=[];for(let n=0,r=t.length;nt!=h>t&&e<(c-a)*((t-l)/(h-l))+a&&(i=!i)}return i}}ro.prototype.toString=function(){return`[@pixi/math:PolygoncloseStroke=${this.closeStroke}points=${this.points.reduce((s,e)=>`${s}, ${e}`,"")}]`};class hu{constructor(e=0,t=0,i=0,n=0,r=20){this.x=e,this.y=t,this.width=i,this.height=n,this.radius=r,this.type=Ci.RREC}clone(){return new hu(this.x,this.y,this.width,this.height,this.radius)}contains(e,t){if(this.width<=0||this.height<=0)return!1;if(e>=this.x&&e<=this.x+this.width&&t>=this.y&&t<=this.y+this.height){const i=Math.max(0,Math.min(this.radius,Math.min(this.width,this.height)/2));if(t>=this.y+i&&t<=this.y+this.height-i||e>=this.x+i&&e<=this.x+this.width-i)return!0;let n=e-(this.x+i),r=t-(this.y+i);const o=i*i;if(n*n+r*r<=o||(n=e-(this.x+this.width-i),n*n+r*r<=o)||(r=t-(this.y+this.height-i),n*n+r*r<=o)||(n=e-(this.x+i),n*n+r*r<=o))return!0}return!1}}hu.prototype.toString=function(){return`[@pixi/math:RoundedRectangle x=${this.x} y=${this.y}width=${this.width} height=${this.height} radius=${this.radius}]`};class Ft{constructor(e=1,t=0,i=0,n=1,r=0,o=0){this.array=null,this.a=e,this.b=t,this.c=i,this.d=n,this.tx=r,this.ty=o}fromArray(e){this.a=e[0],this.b=e[1],this.c=e[3],this.d=e[4],this.tx=e[2],this.ty=e[5]}set(e,t,i,n,r,o){return this.a=e,this.b=t,this.c=i,this.d=n,this.tx=r,this.ty=o,this}toArray(e,t){this.array||(this.array=new Float32Array(9));const i=t||this.array;return e?(i[0]=this.a,i[1]=this.b,i[2]=0,i[3]=this.c,i[4]=this.d,i[5]=0,i[6]=this.tx,i[7]=this.ty,i[8]=1):(i[0]=this.a,i[1]=this.c,i[2]=this.tx,i[3]=this.b,i[4]=this.d,i[5]=this.ty,i[6]=0,i[7]=0,i[8]=1),i}apply(e,t){t=t||new St;const i=e.x,n=e.y;return t.x=this.a*i+this.c*n+this.tx,t.y=this.b*i+this.d*n+this.ty,t}applyInverse(e,t){t=t||new St;const i=1/(this.a*this.d+this.c*-this.b),n=e.x,r=e.y;return t.x=this.d*i*n+-this.c*i*r+(this.ty*this.c-this.tx*this.d)*i,t.y=this.a*i*r+-this.b*i*n+(-this.ty*this.a+this.tx*this.b)*i,t}translate(e,t){return this.tx+=e,this.ty+=t,this}scale(e,t){return this.a*=e,this.d*=t,this.c*=e,this.b*=t,this.tx*=e,this.ty*=t,this}rotate(e){const t=Math.cos(e),i=Math.sin(e),n=this.a,r=this.c,o=this.tx;return this.a=n*t-this.b*i,this.b=n*i+this.b*t,this.c=r*t-this.d*i,this.d=r*i+this.d*t,this.tx=o*t-this.ty*i,this.ty=o*i+this.ty*t,this}append(e){const t=this.a,i=this.b,n=this.c,r=this.d;return this.a=e.a*t+e.b*n,this.b=e.a*i+e.b*r,this.c=e.c*t+e.d*n,this.d=e.c*i+e.d*r,this.tx=e.tx*t+e.ty*n+this.tx,this.ty=e.tx*i+e.ty*r+this.ty,this}setTransform(e,t,i,n,r,o,a,l,c){return this.a=Math.cos(a+c)*r,this.b=Math.sin(a+c)*r,this.c=-Math.sin(a-l)*o,this.d=Math.cos(a-l)*o,this.tx=e-(i*this.a+n*this.c),this.ty=t-(i*this.b+n*this.d),this}prepend(e){const t=this.tx;if(e.a!==1||e.b!==0||e.c!==0||e.d!==1){const i=this.a,n=this.c;this.a=i*e.a+this.b*e.c,this.b=i*e.b+this.b*e.d,this.c=n*e.a+this.d*e.c,this.d=n*e.b+this.d*e.d}return this.tx=t*e.a+this.ty*e.c+e.tx,this.ty=t*e.b+this.ty*e.d+e.ty,this}decompose(e){const t=this.a,i=this.b,n=this.c,r=this.d,o=e.pivot,a=-Math.atan2(-n,r),l=Math.atan2(i,t),c=Math.abs(a+l);return c<1e-5||Math.abs(nh-c)<1e-5?(e.rotation=l,e.skew.x=e.skew.y=0):(e.rotation=0,e.skew.x=a,e.skew.y=l),e.scale.x=Math.sqrt(t*t+i*i),e.scale.y=Math.sqrt(n*n+r*r),e.position.x=this.tx+(o.x*t+o.y*n),e.position.y=this.ty+(o.x*i+o.y*r),e}invert(){const e=this.a,t=this.b,i=this.c,n=this.d,r=this.tx,o=e*n-t*i;return this.a=n/o,this.b=-t/o,this.c=-i/o,this.d=e/o,this.tx=(i*this.ty-n*r)/o,this.ty=-(e*this.ty-t*r)/o,this}identity(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this}clone(){const e=new Ft;return e.a=this.a,e.b=this.b,e.c=this.c,e.d=this.d,e.tx=this.tx,e.ty=this.ty,e}copyTo(e){return e.a=this.a,e.b=this.b,e.c=this.c,e.d=this.d,e.tx=this.tx,e.ty=this.ty,e}copyFrom(e){return this.a=e.a,this.b=e.b,this.c=e.c,this.d=e.d,this.tx=e.tx,this.ty=e.ty,this}static get IDENTITY(){return new Ft}static get TEMP_MATRIX(){return new Ft}}Ft.prototype.toString=function(){return`[@pixi/math:Matrix a=${this.a} b=${this.b} c=${this.c} d=${this.d} tx=${this.tx} ty=${this.ty}]`};const Vr=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],Yr=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],Gr=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],jr=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],jf=[],pb=[],Zl=Math.sign;function yC(){for(let s=0;s<16;s++){const e=[];jf.push(e);for(let t=0;t<16;t++){const i=Zl(Vr[s]*Vr[t]+Gr[s]*Yr[t]),n=Zl(Yr[s]*Vr[t]+jr[s]*Yr[t]),r=Zl(Vr[s]*Gr[t]+Gr[s]*jr[t]),o=Zl(Yr[s]*Gr[t]+jr[s]*jr[t]);for(let a=0;a<16;a++)if(Vr[a]===i&&Yr[a]===n&&Gr[a]===r&&jr[a]===o){e.push(a);break}}}for(let s=0;s<16;s++){const e=new Ft;e.set(Vr[s],Yr[s],Gr[s],jr[s],0,0),pb.push(e)}}yC();const Wt={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MAIN_DIAGONAL:10,MIRROR_HORIZONTAL:12,REVERSE_DIAGONAL:14,uX:s=>Vr[s],uY:s=>Yr[s],vX:s=>Gr[s],vY:s=>jr[s],inv:s=>s&8?s&15:-s&7,add:(s,e)=>jf[s][e],sub:(s,e)=>jf[s][Wt.inv(e)],rotate180:s=>s^4,isVertical:s=>(s&3)===2,byDirection:(s,e)=>Math.abs(s)*2<=Math.abs(e)?e>=0?Wt.S:Wt.N:Math.abs(e)*2<=Math.abs(s)?s>0?Wt.E:Wt.W:e>0?s>0?Wt.SE:Wt.SW:s>0?Wt.NE:Wt.NW,matrixAppendRotationInv:(s,e,t=0,i=0)=>{const n=pb[Wt.inv(e)];n.tx=t,n.ty=i,s.append(n)}};class Fn{constructor(e,t,i=0,n=0){this._x=i,this._y=n,this.cb=e,this.scope=t}clone(e=this.cb,t=this.scope){return new Fn(e,t,this._x,this._y)}set(e=0,t=e){return(this._x!==e||this._y!==t)&&(this._x=e,this._y=t,this.cb.call(this.scope)),this}copyFrom(e){return(this._x!==e.x||this._y!==e.y)&&(this._x=e.x,this._y=e.y,this.cb.call(this.scope)),this}copyTo(e){return e.set(this._x,this._y),e}equals(e){return e.x===this._x&&e.y===this._y}get x(){return this._x}set x(e){this._x!==e&&(this._x=e,this.cb.call(this.scope))}get y(){return this._y}set y(e){this._y!==e&&(this._y=e,this.cb.call(this.scope))}}Fn.prototype.toString=function(){return`[@pixi/math:ObservablePoint x=${this.x} y=${this.y} scope=${this.scope}]`};const Hf=class{constructor(){this.worldTransform=new Ft,this.localTransform=new Ft,this.position=new Fn(this.onChange,this,0,0),this.scale=new Fn(this.onChange,this,1,1),this.pivot=new Fn(this.onChange,this,0,0),this.skew=new Fn(this.updateSkew,this,0,0),this._rotation=0,this._cx=1,this._sx=0,this._cy=0,this._sy=1,this._localID=0,this._currentLocalID=0,this._worldID=0,this._parentID=0}onChange(){this._localID++}updateSkew(){this._cx=Math.cos(this._rotation+this.skew.y),this._sx=Math.sin(this._rotation+this.skew.y),this._cy=-Math.sin(this._rotation-this.skew.x),this._sy=Math.cos(this._rotation-this.skew.x),this._localID++}updateLocalTransform(){const s=this.localTransform;this._localID!==this._currentLocalID&&(s.a=this._cx*this.scale.x,s.b=this._sx*this.scale.x,s.c=this._cy*this.scale.y,s.d=this._sy*this.scale.y,s.tx=this.position.x-(this.pivot.x*s.a+this.pivot.y*s.c),s.ty=this.position.y-(this.pivot.x*s.b+this.pivot.y*s.d),this._currentLocalID=this._localID,this._parentID=-1)}updateTransform(s){const e=this.localTransform;if(this._localID!==this._currentLocalID&&(e.a=this._cx*this.scale.x,e.b=this._sx*this.scale.x,e.c=this._cy*this.scale.y,e.d=this._sy*this.scale.y,e.tx=this.position.x-(this.pivot.x*e.a+this.pivot.y*e.c),e.ty=this.position.y-(this.pivot.x*e.b+this.pivot.y*e.d),this._currentLocalID=this._localID,this._parentID=-1),this._parentID!==s._worldID){const t=s.worldTransform,i=this.worldTransform;i.a=e.a*t.a+e.b*t.c,i.b=e.a*t.b+e.b*t.d,i.c=e.c*t.a+e.d*t.c,i.d=e.c*t.b+e.d*t.d,i.tx=e.tx*t.a+e.ty*t.c+t.tx,i.ty=e.tx*t.b+e.ty*t.d+t.ty,this._parentID=s._worldID,this._worldID++}}setFromMatrix(s){s.decompose(this),this._localID++}get rotation(){return this._rotation}set rotation(s){this._rotation!==s&&(this._rotation=s,this.updateSkew())}};Hf.IDENTITY=new Hf;let pp=Hf;pp.prototype.toString=function(){return`[@pixi/math:Transform position=(${this.position.x}, ${this.position.y}) rotation=${this.rotation} scale=(${this.scale.x}, ${this.scale.y}) skew=(${this.skew.x}, ${this.skew.y}) ]`};var xC=`varying vec2 vTextureCoord; - -uniform sampler2D uSampler; - -void main(void){ - gl_FragColor *= texture2D(uSampler, vTextureCoord); -}`,bC=`attribute vec2 aVertexPosition; -attribute vec2 aTextureCoord; - -uniform mat3 projectionMatrix; - -varying vec2 vTextureCoord; - -void main(void){ - gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); - vTextureCoord = aTextureCoord; -} -`;function ev(s,e,t){const i=s.createShader(e);return s.shaderSource(i,t),s.compileShader(i),i}function Gd(s){const e=new Array(s);for(let t=0;ts.type==="float"&&s.size===1&&!s.isArray,code:s=>` - if(uv["${s}"] !== ud["${s}"].value) - { - ud["${s}"].value = uv["${s}"] - gl.uniform1f(ud["${s}"].location, uv["${s}"]) - } - `},{test:(s,e)=>(s.type==="sampler2D"||s.type==="samplerCube"||s.type==="sampler2DArray")&&s.size===1&&!s.isArray&&(e==null||e.castToBaseTexture!==void 0),code:s=>`t = syncData.textureCount++; - - renderer.texture.bind(uv["${s}"], t); - - if(ud["${s}"].value !== t) - { - ud["${s}"].value = t; - gl.uniform1i(ud["${s}"].location, t); -; // eslint-disable-line max-len - }`},{test:(s,e)=>s.type==="mat3"&&s.size===1&&!s.isArray&&e.a!==void 0,code:s=>` - gl.uniformMatrix3fv(ud["${s}"].location, false, uv["${s}"].toArray(true)); - `,codeUbo:s=>` - var ${s}_matrix = uv.${s}.toArray(true); - - data[offset] = ${s}_matrix[0]; - data[offset+1] = ${s}_matrix[1]; - data[offset+2] = ${s}_matrix[2]; - - data[offset + 4] = ${s}_matrix[3]; - data[offset + 5] = ${s}_matrix[4]; - data[offset + 6] = ${s}_matrix[5]; - - data[offset + 8] = ${s}_matrix[6]; - data[offset + 9] = ${s}_matrix[7]; - data[offset + 10] = ${s}_matrix[8]; - `},{test:(s,e)=>s.type==="vec2"&&s.size===1&&!s.isArray&&e.x!==void 0,code:s=>` - cv = ud["${s}"].value; - v = uv["${s}"]; - - if(cv[0] !== v.x || cv[1] !== v.y) - { - cv[0] = v.x; - cv[1] = v.y; - gl.uniform2f(ud["${s}"].location, v.x, v.y); - }`,codeUbo:s=>` - v = uv.${s}; - - data[offset] = v.x; - data[offset+1] = v.y; - `},{test:s=>s.type==="vec2"&&s.size===1&&!s.isArray,code:s=>` - cv = ud["${s}"].value; - v = uv["${s}"]; - - if(cv[0] !== v[0] || cv[1] !== v[1]) - { - cv[0] = v[0]; - cv[1] = v[1]; - gl.uniform2f(ud["${s}"].location, v[0], v[1]); - } - `},{test:(s,e)=>s.type==="vec4"&&s.size===1&&!s.isArray&&e.width!==void 0,code:s=>` - cv = ud["${s}"].value; - v = uv["${s}"]; - - if(cv[0] !== v.x || cv[1] !== v.y || cv[2] !== v.width || cv[3] !== v.height) - { - cv[0] = v.x; - cv[1] = v.y; - cv[2] = v.width; - cv[3] = v.height; - gl.uniform4f(ud["${s}"].location, v.x, v.y, v.width, v.height) - }`,codeUbo:s=>` - v = uv.${s}; - - data[offset] = v.x; - data[offset+1] = v.y; - data[offset+2] = v.width; - data[offset+3] = v.height; - `},{test:(s,e)=>s.type==="vec4"&&s.size===1&&!s.isArray&&e.red!==void 0,code:s=>` - cv = ud["${s}"].value; - v = uv["${s}"]; - - if(cv[0] !== v.red || cv[1] !== v.green || cv[2] !== v.blue || cv[3] !== v.alpha) - { - cv[0] = v.red; - cv[1] = v.green; - cv[2] = v.blue; - cv[3] = v.alpha; - gl.uniform4f(ud["${s}"].location, v.red, v.green, v.blue, v.alpha) - }`,codeUbo:s=>` - v = uv.${s}; - - data[offset] = v.red; - data[offset+1] = v.green; - data[offset+2] = v.blue; - data[offset+3] = v.alpha; - `},{test:(s,e)=>s.type==="vec3"&&s.size===1&&!s.isArray&&e.red!==void 0,code:s=>` - cv = ud["${s}"].value; - v = uv["${s}"]; - - if(cv[0] !== v.red || cv[1] !== v.green || cv[2] !== v.blue || cv[3] !== v.a) - { - cv[0] = v.red; - cv[1] = v.green; - cv[2] = v.blue; - - gl.uniform3f(ud["${s}"].location, v.red, v.green, v.blue) - }`,codeUbo:s=>` - v = uv.${s}; - - data[offset] = v.red; - data[offset+1] = v.green; - data[offset+2] = v.blue; - `},{test:s=>s.type==="vec4"&&s.size===1&&!s.isArray,code:s=>` - cv = ud["${s}"].value; - v = uv["${s}"]; - - if(cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3]) - { - cv[0] = v[0]; - cv[1] = v[1]; - cv[2] = v[2]; - cv[3] = v[3]; - - gl.uniform4f(ud["${s}"].location, v[0], v[1], v[2], v[3]) - }`}],wC={float:` - if (cv !== v) - { - cu.value = v; - gl.uniform1f(location, v); - }`,vec2:` - if (cv[0] !== v[0] || cv[1] !== v[1]) - { - cv[0] = v[0]; - cv[1] = v[1]; - - gl.uniform2f(location, v[0], v[1]) - }`,vec3:` - if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2]) - { - cv[0] = v[0]; - cv[1] = v[1]; - cv[2] = v[2]; - - gl.uniform3f(location, v[0], v[1], v[2]) - }`,vec4:` - if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3]) - { - cv[0] = v[0]; - cv[1] = v[1]; - cv[2] = v[2]; - cv[3] = v[3]; - - gl.uniform4f(location, v[0], v[1], v[2], v[3]); - }`,int:` - if (cv !== v) - { - cu.value = v; - - gl.uniform1i(location, v); - }`,ivec2:` - if (cv[0] !== v[0] || cv[1] !== v[1]) - { - cv[0] = v[0]; - cv[1] = v[1]; - - gl.uniform2i(location, v[0], v[1]); - }`,ivec3:` - if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2]) - { - cv[0] = v[0]; - cv[1] = v[1]; - cv[2] = v[2]; - - gl.uniform3i(location, v[0], v[1], v[2]); - }`,ivec4:` - if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3]) - { - cv[0] = v[0]; - cv[1] = v[1]; - cv[2] = v[2]; - cv[3] = v[3]; - - gl.uniform4i(location, v[0], v[1], v[2], v[3]); - }`,uint:` - if (cv !== v) - { - cu.value = v; - - gl.uniform1ui(location, v); - }`,uvec2:` - if (cv[0] !== v[0] || cv[1] !== v[1]) - { - cv[0] = v[0]; - cv[1] = v[1]; - - gl.uniform2ui(location, v[0], v[1]); - }`,uvec3:` - if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2]) - { - cv[0] = v[0]; - cv[1] = v[1]; - cv[2] = v[2]; - - gl.uniform3ui(location, v[0], v[1], v[2]); - }`,uvec4:` - if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3]) - { - cv[0] = v[0]; - cv[1] = v[1]; - cv[2] = v[2]; - cv[3] = v[3]; - - gl.uniform4ui(location, v[0], v[1], v[2], v[3]); - }`,bool:` - if (cv !== v) - { - cu.value = v; - gl.uniform1i(location, v); - }`,bvec2:` - if (cv[0] != v[0] || cv[1] != v[1]) - { - cv[0] = v[0]; - cv[1] = v[1]; - - gl.uniform2i(location, v[0], v[1]); - }`,bvec3:` - if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2]) - { - cv[0] = v[0]; - cv[1] = v[1]; - cv[2] = v[2]; - - gl.uniform3i(location, v[0], v[1], v[2]); - }`,bvec4:` - if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3]) - { - cv[0] = v[0]; - cv[1] = v[1]; - cv[2] = v[2]; - cv[3] = v[3]; - - gl.uniform4i(location, v[0], v[1], v[2], v[3]); - }`,mat2:"gl.uniformMatrix2fv(location, false, v)",mat3:"gl.uniformMatrix3fv(location, false, v)",mat4:"gl.uniformMatrix4fv(location, false, v)",sampler2D:` - if (cv !== v) - { - cu.value = v; - - gl.uniform1i(location, v); - }`,samplerCube:` - if (cv !== v) - { - cu.value = v; - - gl.uniform1i(location, v); - }`,sampler2DArray:` - if (cv !== v) - { - cu.value = v; - - gl.uniform1i(location, v); - }`},SC={float:"gl.uniform1fv(location, v)",vec2:"gl.uniform2fv(location, v)",vec3:"gl.uniform3fv(location, v)",vec4:"gl.uniform4fv(location, v)",mat4:"gl.uniformMatrix4fv(location, false, v)",mat3:"gl.uniformMatrix3fv(location, false, v)",mat2:"gl.uniformMatrix2fv(location, false, v)",int:"gl.uniform1iv(location, v)",ivec2:"gl.uniform2iv(location, v)",ivec3:"gl.uniform3iv(location, v)",ivec4:"gl.uniform4iv(location, v)",uint:"gl.uniform1uiv(location, v)",uvec2:"gl.uniform2uiv(location, v)",uvec3:"gl.uniform3uiv(location, v)",uvec4:"gl.uniform4uiv(location, v)",bool:"gl.uniform1iv(location, v)",bvec2:"gl.uniform2iv(location, v)",bvec3:"gl.uniform3iv(location, v)",bvec4:"gl.uniform4iv(location, v)",sampler2D:"gl.uniform1iv(location, v)",samplerCube:"gl.uniform1iv(location, v)",sampler2DArray:"gl.uniform1iv(location, v)"};function MC(s,e){var i;const t=[` - var v = null; - var cv = null; - var cu = null; - var t = 0; - var gl = renderer.gl; - `];for(const n in s.uniforms){const r=e[n];if(!r){((i=s.uniforms[n])==null?void 0:i.group)===!0&&(s.uniforms[n].ubo?t.push(` - renderer.shader.syncUniformBufferGroup(uv.${n}, '${n}'); - `):t.push(` - renderer.shader.syncUniformGroup(uv.${n}, syncData); - `));continue}const o=s.uniforms[n];let a=!1;for(let l=0;l=go.WEBGL2&&(e=s.getContext("webgl2",{})),e||(e=s.getContext("webgl",{})||s.getContext("experimental-webgl",{}),e?e.getExtension("WEBGL_draw_buffers"):e=null),Eo=e}return Eo}let Jl;function _C(){if(!Jl){Jl=ms.MEDIUM;const s=TC();if(s&&s.getShaderPrecisionFormat){const e=s.getShaderPrecisionFormat(s.FRAGMENT_SHADER,s.HIGH_FLOAT);e&&(Jl=e.precision?ms.HIGH:ms.MEDIUM)}}return Jl}function tv(s,e){const t=s.getShaderSource(e).split(` -`).map((c,h)=>`${h}: ${c}`),i=s.getShaderInfoLog(e),n=i.split(` -`),r={},o=n.map(c=>parseFloat(c.replace(/^ERROR\: 0\:([\d]+)\:.*$/,"$1"))).filter(c=>c&&!r[c]?(r[c]=!0,!0):!1),a=[""];o.forEach(c=>{t[c-1]=`%c${t[c-1]}%c`,a.push("background: #FF0000; color:#FFFFFF; font-size: 10px","font-size: 10px")});const l=t.join(` -`);a[0]=l,console.error(i),console.groupCollapsed("click to view full shader code"),console.warn(...a),console.groupEnd()}function CC(s,e,t,i){s.getProgramParameter(e,s.LINK_STATUS)||(s.getShaderParameter(t,s.COMPILE_STATUS)||tv(s,t),s.getShaderParameter(i,s.COMPILE_STATUS)||tv(s,i),console.error("PixiJS Error: Could not initialize shader."),s.getProgramInfoLog(e)!==""&&console.warn("PixiJS Warning: gl.getProgramInfoLog()",s.getProgramInfoLog(e)))}const EC={float:1,vec2:2,vec3:3,vec4:4,int:1,ivec2:2,ivec3:3,ivec4:4,uint:1,uvec2:2,uvec3:3,uvec4:4,bool:1,bvec2:2,bvec3:3,bvec4:4,mat2:4,mat3:9,mat4:16,sampler2D:1};function yb(s){return EC[s]}let Ql=null;const iv={FLOAT:"float",FLOAT_VEC2:"vec2",FLOAT_VEC3:"vec3",FLOAT_VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",UNSIGNED_INT:"uint",UNSIGNED_INT_VEC2:"uvec2",UNSIGNED_INT_VEC3:"uvec3",UNSIGNED_INT_VEC4:"uvec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",FLOAT_MAT2:"mat2",FLOAT_MAT3:"mat3",FLOAT_MAT4:"mat4",SAMPLER_2D:"sampler2D",INT_SAMPLER_2D:"sampler2D",UNSIGNED_INT_SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube",INT_SAMPLER_CUBE:"samplerCube",UNSIGNED_INT_SAMPLER_CUBE:"samplerCube",SAMPLER_2D_ARRAY:"sampler2DArray",INT_SAMPLER_2D_ARRAY:"sampler2DArray",UNSIGNED_INT_SAMPLER_2D_ARRAY:"sampler2DArray"};function xb(s,e){if(!Ql){const t=Object.keys(iv);Ql={};for(let i=0;i0&&(t+=` -else `),ithis.size&&this.flush(),this._vertexCount+=e.vertexData.length/2,this._indexCount+=e.indices.length,this._bufferedTextures[this._bufferSize]=e._texture.baseTexture,this._bufferedElements[this._bufferSize++]=e)}buildTexturesAndDrawCalls(){const{_bufferedTextures:e,maxTextures:t}=this,i=_s._textureArrayPool,n=this.renderer.batch,r=this._tempBoundTextures,o=this.renderer.textureGC.count;let a=++tt._globalBatch,l=0,c=i[0],h=0;n.copyBoundTextures(r,t);for(let u=0;u=t&&(n.boundArray(c,r,a,t),this.buildDrawCalls(c,h,u),h=u,c=i[++l],++a),d._batchEnabled=a,d.touched=o,c.elements[c.count++]=d)}c.count>0&&(n.boundArray(c,r,a,t),this.buildDrawCalls(c,h,this._bufferSize),++l,++a);for(let u=0;u0);for(let p=0;p=0;--n)e[n]=i[n]||null,e[n]&&(e[n]._batchLocation=n)}boundArray(e,t,i,n){const{elements:r,ids:o,count:a}=e;let l=0;for(let c=0;c=0&&u=go.WEBGL2&&(i=e.getContext("webgl2",t)),i)this.webGLVersion=2;else if(this.webGLVersion=1,i=e.getContext("webgl",t)||e.getContext("experimental-webgl",t),!i)throw new Error("This browser does not support WebGL. Try using the canvas renderer");return this.gl=i,this.getExtensions(),this.gl}getExtensions(){const{gl:e}=this,t={loseContext:e.getExtension("WEBGL_lose_context"),anisotropicFiltering:e.getExtension("EXT_texture_filter_anisotropic"),floatTextureLinear:e.getExtension("OES_texture_float_linear"),s3tc:e.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:e.getExtension("WEBGL_compressed_texture_s3tc_srgb"),etc:e.getExtension("WEBGL_compressed_texture_etc"),etc1:e.getExtension("WEBGL_compressed_texture_etc1"),pvrtc:e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),atc:e.getExtension("WEBGL_compressed_texture_atc"),astc:e.getExtension("WEBGL_compressed_texture_astc"),bptc:e.getExtension("EXT_texture_compression_bptc")};this.webGLVersion===1?Object.assign(this.extensions,t,{drawBuffers:e.getExtension("WEBGL_draw_buffers"),depthTexture:e.getExtension("WEBGL_depth_texture"),vertexArrayObject:e.getExtension("OES_vertex_array_object")||e.getExtension("MOZ_OES_vertex_array_object")||e.getExtension("WEBKIT_OES_vertex_array_object"),uint32ElementIndex:e.getExtension("OES_element_index_uint"),floatTexture:e.getExtension("OES_texture_float"),floatTextureLinear:e.getExtension("OES_texture_float_linear"),textureHalfFloat:e.getExtension("OES_texture_half_float"),textureHalfFloatLinear:e.getExtension("OES_texture_half_float_linear")}):this.webGLVersion===2&&Object.assign(this.extensions,t,{colorBufferFloat:e.getExtension("EXT_color_buffer_float")})}handleContextLost(e){e.preventDefault(),setTimeout(()=>{this.gl.isContextLost()&&this.extensions.loseContext&&this.extensions.loseContext.restoreContext()},0)}handleContextRestored(){this.renderer.runners.contextChange.emit(this.gl)}destroy(){const e=this.renderer.view;this.renderer=null,e.removeEventListener!==void 0&&(e.removeEventListener("webglcontextlost",this.handleContextLost),e.removeEventListener("webglcontextrestored",this.handleContextRestored)),this.gl.useProgram(null),this.extensions.loseContext&&this.extensions.loseContext.loseContext()}postrender(){this.renderer.objectRenderer.renderingToScreen&&this.gl.flush()}validateContext(e){const t=e.getContextAttributes(),i="WebGL2RenderingContext"in globalThis&&e instanceof globalThis.WebGL2RenderingContext;i&&(this.webGLVersion=2),t&&!t.stencil&&console.warn("Provided WebGL context does not have a stencil buffer, masks may not render correctly");const n=i||!!e.getExtension("OES_element_index_uint");this.supports.uint32Indices=n,n||console.warn("Provided WebGL context does not support 32 index buffer, complex graphics may not render correctly")}}oh.defaultOptions={context:null,antialias:!1,premultipliedAlpha:!0,preserveDrawingBuffer:!1,powerPreference:"default"},oh.extension={type:ke.RendererSystem,name:"context"};$e.add(oh);class Kf{constructor(e,t){if(this.width=Math.round(e),this.height=Math.round(t),!this.width||!this.height)throw new Error("Framebuffer width or height is zero");this.stencil=!1,this.depth=!1,this.dirtyId=0,this.dirtyFormat=0,this.dirtySize=0,this.depthTexture=null,this.colorTextures=[],this.glFramebuffers={},this.disposeRunner=new Ls("disposeFramebuffer"),this.multisample=ci.NONE}get colorTexture(){return this.colorTextures[0]}addColorTexture(e=0,t){return this.colorTextures[e]=t||new tt(null,{scaleMode:Rs.NEAREST,resolution:1,mipmap:vs.OFF,width:this.width,height:this.height}),this.dirtyId++,this.dirtyFormat++,this}addDepthTexture(e){return this.depthTexture=e||new tt(null,{scaleMode:Rs.NEAREST,resolution:1,width:this.width,height:this.height,mipmap:vs.OFF,format:Te.DEPTH_COMPONENT,type:Ue.UNSIGNED_SHORT}),this.dirtyId++,this.dirtyFormat++,this}enableDepth(){return this.depth=!0,this.dirtyId++,this.dirtyFormat++,this}enableStencil(){return this.stencil=!0,this.dirtyId++,this.dirtyFormat++,this}resize(e,t){if(e=Math.round(e),t=Math.round(t),!e||!t)throw new Error("Framebuffer width and height must not be zero");if(!(e===this.width&&t===this.height)){this.width=e,this.height=t,this.dirtyId++,this.dirtySize++;for(let i=0;i{const n=this.source;this.url=n.src;const r=()=>{this.destroyed||(n.onload=null,n.onerror=null,this.update(),this._load=null,this.createBitmap?t(this.process()):t(this))};n.complete&&n.src?r():(n.onload=r,n.onerror=o=>{i(o),this.onError.emit(o)})}),this._load)}process(){const e=this.source;if(this._process!==null)return this._process;if(this.bitmap!==null||!globalThis.createImageBitmap)return Promise.resolve(this);const t=globalThis.createImageBitmap,i=!e.crossOrigin||e.crossOrigin==="anonymous";return this._process=fetch(e.src,{mode:i?"cors":"no-cors"}).then(n=>n.blob()).then(n=>t(n,0,0,e.width,e.height,{premultiplyAlpha:this.alphaMode===null||this.alphaMode===bi.UNPACK?"premultiply":"none"})).then(n=>this.destroyed?Promise.reject():(this.bitmap=n,this.update(),this._process=null,Promise.resolve(this))),this._process}upload(e,t,i){if(typeof this.alphaMode=="number"&&(t.alphaMode=this.alphaMode),!this.createBitmap)return super.upload(e,t,i);if(!this.bitmap&&(this.process(),!this.bitmap))return!1;if(super.upload(e,t,i,this.bitmap),!this.preserveBitmap){let n=!0;const r=t._glTextures;for(const o in r){const a=r[o];if(a!==i&&a.dirtyId!==t.dirtyId){n=!1;break}}n&&(this.bitmap.close&&this.bitmap.close(),this.bitmap=null)}return!0}dispose(){this.source.onload=null,this.source.onerror=null,super.dispose(),this.bitmap&&(this.bitmap.close(),this.bitmap=null),this._process=null,this._load=null}static test(e){return typeof HTMLImageElement<"u"&&(typeof e=="string"||e instanceof HTMLImageElement)}}class gp{constructor(){this.x0=0,this.y0=0,this.x1=1,this.y1=0,this.x2=1,this.y2=1,this.x3=0,this.y3=1,this.uvsFloat32=new Float32Array(8)}set(e,t,i){const n=t.width,r=t.height;if(i){const o=e.width/2/n,a=e.height/2/r,l=e.x/n+o,c=e.y/r+a;i=Wt.add(i,Wt.NW),this.x0=l+o*Wt.uX(i),this.y0=c+a*Wt.uY(i),i=Wt.add(i,2),this.x1=l+o*Wt.uX(i),this.y1=c+a*Wt.uY(i),i=Wt.add(i,2),this.x2=l+o*Wt.uX(i),this.y2=c+a*Wt.uY(i),i=Wt.add(i,2),this.x3=l+o*Wt.uX(i),this.y3=c+a*Wt.uY(i)}else this.x0=e.x/n,this.y0=e.y/r,this.x1=(e.x+e.width)/n,this.y1=e.y/r,this.x2=(e.x+e.width)/n,this.y2=(e.y+e.height)/r,this.x3=e.x/n,this.y3=(e.y+e.height)/r;this.uvsFloat32[0]=this.x0,this.uvsFloat32[1]=this.y0,this.uvsFloat32[2]=this.x1,this.uvsFloat32[3]=this.y1,this.uvsFloat32[4]=this.x2,this.uvsFloat32[5]=this.y2,this.uvsFloat32[6]=this.x3,this.uvsFloat32[7]=this.y3}}gp.prototype.toString=function(){return`[@pixi/core:TextureUvs x0=${this.x0} y0=${this.y0} x1=${this.x1} y1=${this.y1} x2=${this.x2} y2=${this.y2} x3=${this.x3} y3=${this.y3}]`};const rv=new gp;function tc(s){s.destroy=function(){},s.on=function(){},s.once=function(){},s.emit=function(){}}let Ke=class Dt extends Rl{constructor(e,t,i,n,r,o,a){if(super(),this.noFrame=!1,t||(this.noFrame=!0,t=new ct(0,0,1,1)),e instanceof Dt&&(e=e.baseTexture),this.baseTexture=e,this._frame=t,this.trim=n,this.valid=!1,this.destroyed=!1,this._uvs=rv,this.uvMatrix=null,this.orig=i||t,this._rotate=Number(r||0),r===!0)this._rotate=2;else if(this._rotate%2!==0)throw new Error("attempt to use diamond-shaped UVs. If you are sure, set rotation manually");this.defaultAnchor=o?new St(o.x,o.y):new St(0,0),this.defaultBorders=a,this._updateID=0,this.textureCacheIds=[],e.valid?this.noFrame?e.valid&&this.onBaseTextureUpdated(e):this.frame=t:e.once("loaded",this.onBaseTextureUpdated,this),this.noFrame&&e.on("update",this.onBaseTextureUpdated,this)}update(){this.baseTexture.resource&&this.baseTexture.resource.update()}onBaseTextureUpdated(e){if(this.noFrame){if(!this.baseTexture.valid)return;this._frame.width=e.width,this._frame.height=e.height,this.valid=!0,this.updateUvs()}else this.frame=this._frame;this.emit("update",this)}destroy(e){if(this.baseTexture){if(e){const{resource:t}=this.baseTexture;t!=null&&t.url&&Ys[t.url]&&Dt.removeFromCache(t.url),this.baseTexture.destroy()}this.baseTexture.off("loaded",this.onBaseTextureUpdated,this),this.baseTexture.off("update",this.onBaseTextureUpdated,this),this.baseTexture=null}this._frame=null,this._uvs=null,this.trim=null,this.orig=null,this.valid=!1,Dt.removeFromCache(this),this.textureCacheIds=null,this.destroyed=!0,this.emit("destroyed",this),this.removeAllListeners()}clone(){var n;const e=this._frame.clone(),t=this._frame===this.orig?e:this.orig.clone(),i=new Dt(this.baseTexture,!this.noFrame&&e,t,(n=this.trim)==null?void 0:n.clone(),this.rotate,this.defaultAnchor,this.defaultBorders);return this.noFrame&&(i._frame=e),i}updateUvs(){this._uvs===rv&&(this._uvs=new gp),this._uvs.set(this._frame,this.baseTexture,this.rotate),this._updateID++}static from(e,t={},i=Be.STRICT_TEXTURE_CACHE){const n=typeof e=="string";let r=null;if(n)r=e;else if(e instanceof tt){if(!e.cacheId){const a=(t==null?void 0:t.pixiIdPrefix)||"pixiid";e.cacheId=`${a}-${ho()}`,tt.addToCache(e,e.cacheId)}r=e.cacheId}else{if(!e._pixiId){const a=(t==null?void 0:t.pixiIdPrefix)||"pixiid";e._pixiId=`${a}_${ho()}`}r=e._pixiId}let o=Ys[r];if(n&&i&&!o)throw new Error(`The cacheId "${r}" does not exist in TextureCache.`);return!o&&!(e instanceof tt)?(t.resolution||(t.resolution=Hn(e)),o=new Dt(new tt(e,t)),o.baseTexture.cacheId=r,tt.addToCache(o.baseTexture,r),Dt.addToCache(o,r)):!o&&e instanceof tt&&(o=new Dt(e),Dt.addToCache(o,r)),o}static fromURL(e,t){const i=Object.assign({autoLoad:!1},t==null?void 0:t.resourceOptions),n=Dt.from(e,Object.assign({resourceOptions:i},t),!1),r=n.baseTexture.resource;return n.baseTexture.valid?Promise.resolve(n):r.load().then(()=>Promise.resolve(n))}static fromBuffer(e,t,i,n){return new Dt(tt.fromBuffer(e,t,i,n))}static fromLoader(e,t,i,n){const r=new tt(e,Object.assign({scaleMode:tt.defaultOptions.scaleMode,resolution:Hn(t)},n)),{resource:o}=r;o instanceof Mb&&(o.url=t);const a=new Dt(r);return i||(i=t),tt.addToCache(a.baseTexture,i),Dt.addToCache(a,i),i!==t&&(tt.addToCache(a.baseTexture,t),Dt.addToCache(a,t)),a.baseTexture.valid?Promise.resolve(a):new Promise(l=>{a.baseTexture.once("loaded",()=>l(a))})}static addToCache(e,t){t&&(e.textureCacheIds.includes(t)||e.textureCacheIds.push(t),Ys[t]&&Ys[t]!==e&&console.warn(`Texture added to the cache with an id [${t}] that already had an entry`),Ys[t]=e)}static removeFromCache(e){if(typeof e=="string"){const t=Ys[e];if(t){const i=t.textureCacheIds.indexOf(e);return i>-1&&t.textureCacheIds.splice(i,1),delete Ys[e],t}}else if(e!=null&&e.textureCacheIds){for(let t=0;tthis.baseTexture.width,a=i+r>this.baseTexture.height;if(o||a){const l=o&&a?"and":"or",c=`X: ${t} + ${n} = ${t+n} > ${this.baseTexture.width}`,h=`Y: ${i} + ${r} = ${i+r} > ${this.baseTexture.height}`;throw new Error(`Texture Error: frame does not fit inside the base Texture dimensions: ${c} ${l} ${h}`)}this.valid=n&&r&&this.baseTexture.valid,!this.trim&&!this.rotate&&(this.orig=e),this.valid&&this.updateUvs()}get rotate(){return this._rotate}set rotate(e){this._rotate=e,this.valid&&this.updateUvs()}get width(){return this.orig.width}get height(){return this.orig.height}castToBaseTexture(){return this.baseTexture}static get EMPTY(){return Dt._EMPTY||(Dt._EMPTY=new Dt(new tt),tc(Dt._EMPTY),tc(Dt._EMPTY.baseTexture)),Dt._EMPTY}static get WHITE(){if(!Dt._WHITE){const e=Be.ADAPTER.createCanvas(16,16),t=e.getContext("2d");e.width=16,e.height=16,t.fillStyle="white",t.fillRect(0,0,16,16),Dt._WHITE=new Dt(tt.from(e)),tc(Dt._WHITE),tc(Dt._WHITE.baseTexture)}return Dt._WHITE}};class vo extends Ke{constructor(e,t){super(e,t),this.valid=!0,this.filterFrame=null,this.filterPoolKey=null,this.updateUvs()}get framebuffer(){return this.baseTexture.framebuffer}get multisample(){return this.framebuffer.multisample}set multisample(e){this.framebuffer.multisample=e}resize(e,t,i=!0){const n=this.baseTexture.resolution,r=Math.round(e*n)/n,o=Math.round(t*n)/n;this.valid=r>0&&o>0,this._frame.width=this.orig.width=r,this._frame.height=this.orig.height=o,i&&this.baseTexture.resize(r,o),this.updateUvs()}setResolution(e){const{baseTexture:t}=this;t.resolution!==e&&(t.setResolution(e),this.resize(t.width,t.height,!1))}static create(e){return new vo(new Sb(e))}}class Tb{constructor(e){this.texturePool={},this.textureOptions=e||{},this.enableFullScreen=!1,this._pixelsWidth=0,this._pixelsHeight=0}createTexture(e,t,i=ci.NONE){const n=new Sb(Object.assign({width:e,height:t,resolution:1,multisample:i},this.textureOptions));return new vo(n)}getOptimalTexture(e,t,i=1,n=ci.NONE){let r;e=Math.max(Math.ceil(e*i-1e-6),1),t=Math.max(Math.ceil(t*i-1e-6),1),!this.enableFullScreen||e!==this._pixelsWidth||t!==this._pixelsHeight?(e=ih(e),t=ih(t),r=((e&65535)<<16|t&65535)>>>0,n>1&&(r+=n*4294967296)):r=n>1?-n:-1,this.texturePool[r]||(this.texturePool[r]=[]);let o=this.texturePool[r].pop();return o||(o=this.createTexture(e,t,n)),o.filterPoolKey=r,o.setResolution(i),o}getFilterTexture(e,t,i){const n=this.getOptimalTexture(e.width,e.height,t||e.resolution,i||ci.NONE);return n.filterFrame=e.filterFrame,n}returnTexture(e){const t=e.filterPoolKey;e.filterFrame=null,this.texturePool[t].push(e)}returnFilterTexture(e){this.returnTexture(e)}clear(e){if(e=e!==!1,e)for(const t in this.texturePool){const i=this.texturePool[t];if(i)for(let n=0;n0&&e.height>0;for(const t in this.texturePool){if(!(Number(t)<0))continue;const i=this.texturePool[t];if(i)for(let n=0;n1&&(h=this.getOptimalFilterTexture(c.width,c.height,t.resolution),h.filterFrame=c.filterFrame),i[u].apply(this,c,h,en.CLEAR,t);const d=c;c=h,h=d}i[u].apply(this,c,l.renderTexture,en.BLEND,t),u>1&&t.multisample>1&&this.returnFilterTexture(t.renderTexture),this.returnFilterTexture(c),this.returnFilterTexture(h)}t.clear(),this.statePool.push(t)}bindAndClear(e,t=en.CLEAR){const{renderTexture:i,state:n}=this.renderer;if(e===this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?this.renderer.projection.transform=this.activeState.transform:this.renderer.projection.transform=null,e==null?void 0:e.filterFrame){const o=this.tempRect;o.x=0,o.y=0,o.width=e.filterFrame.width,o.height=e.filterFrame.height,i.bind(e,e.filterFrame,o)}else e!==this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?i.bind(e):this.renderer.renderTexture.bind(e,this.activeState.bindingSourceFrame,this.activeState.bindingDestinationFrame);const r=n.stateId&1||this.forceClear;(t===en.CLEAR||t===en.BLIT&&r)&&this.renderer.framebuffer.clear(0,0,0,0)}applyFilter(e,t,i,n){const r=this.renderer;r.state.set(e.state),this.bindAndClear(i,n),e.uniforms.uSampler=t,e.uniforms.filterGlobals=this.globalUniforms,r.shader.bind(e),e.legacy=!!e.program.attributeData.aTextureCoord,e.legacy?(this.quadUv.map(t._frame,t.filterFrame),r.geometry.bind(this.quadUv),r.geometry.draw(on.TRIANGLES)):(r.geometry.bind(this.quad),r.geometry.draw(on.TRIANGLE_STRIP))}calculateSpriteMatrix(e,t){const{sourceFrame:i,destinationFrame:n}=this.activeState,{orig:r}=t._texture,o=e.set(n.width,0,0,n.height,i.x,i.y),a=t.worldTransform.copyTo(Ft.TEMP_MATRIX);return a.invert(),o.prepend(a),o.scale(1/r.width,1/r.height),o.translate(t.anchor.x,t.anchor.y),o}destroy(){this.renderer=null,this.texturePool.clear(!1)}getOptimalFilterTexture(e,t,i=1,n=ci.NONE){return this.texturePool.getOptimalTexture(e,t,i,n)}getFilterTexture(e,t,i){if(typeof e=="number"){const r=e;e=t,t=r}e=e||this.activeState.renderTexture;const n=this.texturePool.getOptimalTexture(e.width,e.height,t||e.resolution,i||ci.NONE);return n.filterFrame=e.filterFrame,n}returnFilterTexture(e){this.texturePool.returnTexture(e)}emptyPool(){this.texturePool.clear(!0)}resize(){this.texturePool.setScreenSize(this.renderer.view)}transformAABB(e,t){const i=ic[0],n=ic[1],r=ic[2],o=ic[3];i.set(t.left,t.top),n.set(t.left,t.bottom),r.set(t.right,t.top),o.set(t.right,t.bottom),e.apply(i,i),e.apply(n,n),e.apply(r,r),e.apply(o,o);const a=Math.min(i.x,n.x,r.x,o.x),l=Math.min(i.y,n.y,r.y,o.y),c=Math.max(i.x,n.x,r.x,o.x),h=Math.max(i.y,n.y,r.y,o.y);t.x=a,t.y=l,t.width=c-a,t.height=h-l}roundFrame(e,t,i,n,r){if(!(e.width<=0||e.height<=0||i.width<=0||i.height<=0)){if(r){const{a:o,b:a,c:l,d:c}=r;if((Math.abs(a)>1e-4||Math.abs(l)>1e-4)&&(Math.abs(o)>1e-4||Math.abs(c)>1e-4))return}r=r?jd.copyFrom(r):jd.identity(),r.translate(-i.x,-i.y).scale(n.width/i.width,n.height/i.height).translate(n.x,n.y),this.transformAABB(r,e),e.ceil(t),this.transformAABB(r.invert(),e)}}}Cb.extension={type:ke.RendererSystem,name:"filter"};$e.add(Cb);class UC{constructor(e){this.framebuffer=e,this.stencil=null,this.dirtyId=-1,this.dirtyFormat=-1,this.dirtySize=-1,this.multisample=ci.NONE,this.msaaBuffer=null,this.blitFramebuffer=null,this.mipLevel=0}}const $C=new ct;class Eb{constructor(e){this.renderer=e,this.managedFramebuffers=[],this.unknownFramebuffer=new Kf(10,10),this.msaaSamples=null}contextChange(){this.disposeAll(!0);const e=this.gl=this.renderer.gl;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.current=this.unknownFramebuffer,this.viewport=new ct,this.hasMRT=!0,this.writeDepthTexture=!0,this.renderer.context.webGLVersion===1){let t=this.renderer.context.extensions.drawBuffers,i=this.renderer.context.extensions.depthTexture;Be.PREFER_ENV===go.WEBGL_LEGACY&&(t=null,i=null),t?e.drawBuffers=n=>t.drawBuffersWEBGL(n):(this.hasMRT=!1,e.drawBuffers=()=>{}),i||(this.writeDepthTexture=!1)}else this.msaaSamples=e.getInternalformatParameter(e.RENDERBUFFER,e.RGBA8,e.SAMPLES)}bind(e,t,i=0){const{gl:n}=this;if(e){const r=e.glFramebuffers[this.CONTEXT_UID]||this.initFramebuffer(e);this.current!==e&&(this.current=e,n.bindFramebuffer(n.FRAMEBUFFER,r.framebuffer)),r.mipLevel!==i&&(e.dirtyId++,e.dirtyFormat++,r.mipLevel=i),r.dirtyId!==e.dirtyId&&(r.dirtyId=e.dirtyId,r.dirtyFormat!==e.dirtyFormat?(r.dirtyFormat=e.dirtyFormat,r.dirtySize=e.dirtySize,this.updateFramebuffer(e,i)):r.dirtySize!==e.dirtySize&&(r.dirtySize=e.dirtySize,this.resizeFramebuffer(e)));for(let o=0;o>i,a=t.height>>i,l=o/t.width;this.setViewport(t.x*l,t.y*l,o,a)}else{const o=e.width>>i,a=e.height>>i;this.setViewport(0,0,o,a)}}else this.current&&(this.current=null,n.bindFramebuffer(n.FRAMEBUFFER,null)),t?this.setViewport(t.x,t.y,t.width,t.height):this.setViewport(0,0,this.renderer.width,this.renderer.height)}setViewport(e,t,i,n){const r=this.viewport;e=Math.round(e),t=Math.round(t),i=Math.round(i),n=Math.round(n),(r.width!==i||r.height!==n||r.x!==e||r.y!==t)&&(r.x=e,r.y=t,r.width=i,r.height=n,this.gl.viewport(e,t,i,n))}get size(){return this.current?{x:0,y:0,width:this.current.width,height:this.current.height}:{x:0,y:0,width:this.renderer.width,height:this.renderer.height}}clear(e,t,i,n,r=Bf.COLOR|Bf.DEPTH){const{gl:o}=this;o.clearColor(e,t,i,n),o.clear(r)}initFramebuffer(e){const{gl:t}=this,i=new UC(t.createFramebuffer());return i.multisample=this.detectSamples(e.multisample),e.glFramebuffers[this.CONTEXT_UID]=i,this.managedFramebuffers.push(e),e.disposeRunner.add(this),i}resizeFramebuffer(e){const{gl:t}=this,i=e.glFramebuffers[this.CONTEXT_UID];if(i.stencil){t.bindRenderbuffer(t.RENDERBUFFER,i.stencil);let o;this.renderer.context.webGLVersion===1?o=t.DEPTH_STENCIL:e.depth&&e.stencil?o=t.DEPTH24_STENCIL8:e.depth?o=t.DEPTH_COMPONENT24:o=t.STENCIL_INDEX8,i.msaaBuffer?t.renderbufferStorageMultisample(t.RENDERBUFFER,i.multisample,o,e.width,e.height):t.renderbufferStorage(t.RENDERBUFFER,o,e.width,e.height)}const n=e.colorTextures;let r=n.length;t.drawBuffers||(r=Math.min(r,1));for(let o=0;o1&&this.canMultisampleFramebuffer(e)?n.msaaBuffer=n.msaaBuffer||i.createRenderbuffer():n.msaaBuffer&&(i.deleteRenderbuffer(n.msaaBuffer),n.msaaBuffer=null,n.blitFramebuffer&&(n.blitFramebuffer.dispose(),n.blitFramebuffer=null));const a=[];for(let l=0;l1&&i.drawBuffers(a),e.depthTexture&&this.writeDepthTexture){const l=e.depthTexture;this.renderer.texture.bind(l,0),i.framebufferTexture2D(i.FRAMEBUFFER,i.DEPTH_ATTACHMENT,i.TEXTURE_2D,l._glTextures[this.CONTEXT_UID].texture,t)}if((e.stencil||e.depth)&&!(e.depthTexture&&this.writeDepthTexture)){n.stencil=n.stencil||i.createRenderbuffer();let l,c;this.renderer.context.webGLVersion===1?(l=i.DEPTH_STENCIL_ATTACHMENT,c=i.DEPTH_STENCIL):e.depth&&e.stencil?(l=i.DEPTH_STENCIL_ATTACHMENT,c=i.DEPTH24_STENCIL8):e.depth?(l=i.DEPTH_ATTACHMENT,c=i.DEPTH_COMPONENT24):(l=i.STENCIL_ATTACHMENT,c=i.STENCIL_INDEX8),i.bindRenderbuffer(i.RENDERBUFFER,n.stencil),n.msaaBuffer?i.renderbufferStorageMultisample(i.RENDERBUFFER,n.multisample,c,e.width,e.height):i.renderbufferStorage(i.RENDERBUFFER,c,e.width,e.height),i.framebufferRenderbuffer(i.FRAMEBUFFER,l,i.RENDERBUFFER,n.stencil)}else n.stencil&&(i.deleteRenderbuffer(n.stencil),n.stencil=null)}canMultisampleFramebuffer(e){return this.renderer.context.webGLVersion!==1&&e.colorTextures.length<=1&&!e.depthTexture}detectSamples(e){const{msaaSamples:t}=this;let i=ci.NONE;if(e<=1||t===null)return i;for(let n=0;n=0&&this.managedFramebuffers.splice(r,1),e.disposeRunner.remove(this),t||(n.deleteFramebuffer(i.framebuffer),i.msaaBuffer&&n.deleteRenderbuffer(i.msaaBuffer),i.stencil&&n.deleteRenderbuffer(i.stencil)),i.blitFramebuffer&&this.disposeFramebuffer(i.blitFramebuffer,t)}disposeAll(e){const t=this.managedFramebuffers;this.managedFramebuffers=[];for(let i=0;ii.createVertexArrayOES(),e.bindVertexArray=n=>i.bindVertexArrayOES(n),e.deleteVertexArray=n=>i.deleteVertexArrayOES(n)):(this.hasVao=!1,e.createVertexArray=()=>null,e.bindVertexArray=()=>null,e.deleteVertexArray=()=>null)}if(t.webGLVersion!==2){const i=e.getExtension("ANGLE_instanced_arrays");i?(e.vertexAttribDivisor=(n,r)=>i.vertexAttribDivisorANGLE(n,r),e.drawElementsInstanced=(n,r,o,a,l)=>i.drawElementsInstancedANGLE(n,r,o,a,l),e.drawArraysInstanced=(n,r,o,a)=>i.drawArraysInstancedANGLE(n,r,o,a)):this.hasInstance=!1}this.canUseUInt32ElementIndex=t.webGLVersion===2||!!t.extensions.uint32ElementIndex}bind(e,t){t=t||this.renderer.shader.shader;const{gl:i}=this;let n=e.glVertexArrayObjects[this.CONTEXT_UID],r=!1;n||(this.managedGeometries[e.id]=e,e.disposeRunner.add(this),e.glVertexArrayObjects[this.CONTEXT_UID]=n={},r=!0);const o=n[t.program.id]||this.initGeometryVao(e,t,r);this._activeGeometry=e,this._activeVao!==o&&(this._activeVao=o,this.hasVao?i.bindVertexArray(o):this.activateVao(e,t.program)),this.updateBuffers()}reset(){this.unbind()}updateBuffers(){const e=this._activeGeometry,t=this.renderer.buffer;for(let i=0;i"u"?.5:t,this.isSimple=!1}get texture(){return this._texture}set texture(e){this._texture=e,this._textureID=-1}multiplyUvs(e,t){t===void 0&&(t=e);const i=this.mapCoord;for(let n=0;n0?this.maskStack[this.maskStack.length-1]._colorMask:15;i!==t&&this.renderer.gl.colorMask((i&1)!==0,(i&2)!==0,(i&4)!==0,(i&8)!==0)}destroy(){this.renderer=null}}Ib.extension={type:ke.RendererSystem,name:"mask"};$e.add(Ib);class Rb{constructor(e){this.renderer=e,this.maskStack=[],this.glConst=0}getStackLength(){return this.maskStack.length}setMaskStack(e){const{gl:t}=this.renderer,i=this.getStackLength();this.maskStack=e;const n=this.getStackLength();n!==i&&(n===0?t.disable(this.glConst):(t.enable(this.glConst),this._useCurrent()))}_useCurrent(){}destroy(){this.renderer=null,this.maskStack=null}}const av=new Ft,lv=[],Pb=class Pc extends Rb{constructor(e){super(e),this.glConst=Be.ADAPTER.getWebGLRenderingContext().SCISSOR_TEST}getStackLength(){const e=this.maskStack[this.maskStack.length-1];return e?e._scissorCounter:0}calcScissorRect(e){if(e._scissorRectLocal)return;const t=e._scissorRect,{maskObject:i}=e,{renderer:n}=this,r=n.renderTexture,o=i.getBounds(!0,lv.pop()??new ct);this.roundFrameToPixels(o,r.current?r.current.resolution:n.resolution,r.sourceFrame,r.destinationFrame,n.projection.transform),t&&o.fit(t),e._scissorRectLocal=o}static isMatrixRotated(e){if(!e)return!1;const{a:t,b:i,c:n,d:r}=e;return(Math.abs(i)>1e-4||Math.abs(n)>1e-4)&&(Math.abs(t)>1e-4||Math.abs(r)>1e-4)}testScissor(e){const{maskObject:t}=e;if(!t.isFastRect||!t.isFastRect()||Pc.isMatrixRotated(t.worldTransform)||Pc.isMatrixRotated(this.renderer.projection.transform))return!1;this.calcScissorRect(e);const i=e._scissorRectLocal;return i.width>0&&i.height>0}roundFrameToPixels(e,t,i,n,r){Pc.isMatrixRotated(r)||(r=r?av.copyFrom(r):av.identity(),r.translate(-i.x,-i.y).scale(n.width/i.width,n.height/i.height).translate(n.x,n.y),this.renderer.filter.transformAABB(r,e),e.fit(n),e.x=Math.round(e.x*t),e.y=Math.round(e.y*t),e.width=Math.round(e.width*t),e.height=Math.round(e.height*t))}push(e){e._scissorRectLocal||this.calcScissorRect(e);const{gl:t}=this.renderer;e._scissorRect||t.enable(t.SCISSOR_TEST),e._scissorCounter++,e._scissorRect=e._scissorRectLocal,this._useCurrent()}pop(e){const{gl:t}=this.renderer;e&&lv.push(e._scissorRectLocal),this.getStackLength()>0?this._useCurrent():t.disable(t.SCISSOR_TEST)}_useCurrent(){const e=this.maskStack[this.maskStack.length-1]._scissorRect;let t;this.renderer.renderTexture.current?t=e.y:t=this.renderer.height-e.height-e.y,this.renderer.gl.scissor(e.x,t,e.width,e.height)}};Pb.extension={type:ke.RendererSystem,name:"scissor"};let jC=Pb;$e.add(jC);class kb extends Rb{constructor(e){super(e),this.glConst=Be.ADAPTER.getWebGLRenderingContext().STENCIL_TEST}getStackLength(){const e=this.maskStack[this.maskStack.length-1];return e?e._stencilCounter:0}push(e){const t=e.maskObject,{gl:i}=this.renderer,n=e._stencilCounter;n===0&&(this.renderer.framebuffer.forceStencil(),i.clearStencil(0),i.clear(i.STENCIL_BUFFER_BIT),i.enable(i.STENCIL_TEST)),e._stencilCounter++;const r=e._colorMask;r!==0&&(e._colorMask=0,i.colorMask(!1,!1,!1,!1)),i.stencilFunc(i.EQUAL,n,4294967295),i.stencilOp(i.KEEP,i.KEEP,i.INCR),t.renderable=!0,t.render(this.renderer),this.renderer.batch.flush(),t.renderable=!1,r!==0&&(e._colorMask=r,i.colorMask((r&1)!==0,(r&2)!==0,(r&4)!==0,(r&8)!==0)),this._useCurrent()}pop(e){const t=this.renderer.gl;if(this.getStackLength()===0)t.disable(t.STENCIL_TEST);else{const i=this.maskStack.length!==0?this.maskStack[this.maskStack.length-1]:null,n=i?i._colorMask:15;n!==0&&(i._colorMask=0,t.colorMask(!1,!1,!1,!1)),t.stencilOp(t.KEEP,t.KEEP,t.DECR),e.renderable=!0,e.render(this.renderer),this.renderer.batch.flush(),e.renderable=!1,n!==0&&(i._colorMask=n,t.colorMask((n&1)!==0,(n&2)!==0,(n&4)!==0,(n&8)!==0)),this._useCurrent()}}_useCurrent(){const e=this.renderer.gl;e.stencilFunc(e.EQUAL,this.getStackLength(),4294967295),e.stencilOp(e.KEEP,e.KEEP,e.KEEP)}}kb.extension={type:ke.RendererSystem,name:"stencil"};$e.add(kb);class Fb{constructor(e){this.renderer=e,this.plugins={},Object.defineProperties(this.plugins,{extract:{enumerable:!1,get(){return mt("7.0.0","renderer.plugins.extract has moved to renderer.extract"),e.extract}},prepare:{enumerable:!1,get(){return mt("7.0.0","renderer.plugins.prepare has moved to renderer.prepare"),e.prepare}},interaction:{enumerable:!1,get(){return mt("7.0.0","renderer.plugins.interaction has been deprecated, use renderer.events"),e.events}}})}init(){const e=this.rendererPlugins;for(const t in e)this.plugins[t]=new e[t](this.renderer)}destroy(){for(const e in this.plugins)this.plugins[e].destroy(),this.plugins[e]=null}}Fb.extension={type:[ke.RendererSystem,ke.CanvasRendererSystem],name:"_plugin"};$e.add(Fb);class Ob{constructor(e){this.renderer=e,this.destinationFrame=null,this.sourceFrame=null,this.defaultFrame=null,this.projectionMatrix=new Ft,this.transform=null}update(e,t,i,n){this.destinationFrame=e||this.destinationFrame||this.defaultFrame,this.sourceFrame=t||this.sourceFrame||e,this.calculateProjection(this.destinationFrame,this.sourceFrame,i,n),this.transform&&this.projectionMatrix.append(this.transform);const r=this.renderer;r.globalUniforms.uniforms.projectionMatrix=this.projectionMatrix,r.globalUniforms.update(),r.shader.shader&&r.shader.syncUniformGroup(r.shader.shader.uniforms.globals)}calculateProjection(e,t,i,n){const r=this.projectionMatrix,o=n?-1:1;r.identity(),r.a=1/t.width*2,r.d=o*(1/t.height*2),r.tx=-1-t.x*r.a,r.ty=-o-t.y*r.d}setTransform(e){}destroy(){this.renderer=null}}Ob.extension={type:ke.RendererSystem,name:"projection"};$e.add(Ob);const HC=new pp,cv=new ct;class Lb{constructor(e){this.renderer=e,this._tempMatrix=new Ft}generateTexture(e,t){const{region:i,...n}=t||{},r=(i==null?void 0:i.copyTo(cv))||e.getLocalBounds(cv,!0),o=n.resolution||this.renderer.resolution;r.width=Math.max(r.width,1/o),r.height=Math.max(r.height,1/o),n.width=r.width,n.height=r.height,n.resolution=o,n.multisample??(n.multisample=this.renderer.multisample);const a=vo.create(n);this._tempMatrix.tx=-r.x,this._tempMatrix.ty=-r.y;const l=e.transform;return e.transform=HC,this.renderer.render(e,{renderTexture:a,transform:this._tempMatrix,skipUpdateTransform:!!e.parent,blit:!0}),e.transform=l,a}destroy(){}}Lb.extension={type:[ke.RendererSystem,ke.CanvasRendererSystem],name:"textureGenerator"};$e.add(Lb);const Ur=new ct,Oa=new ct;class Bb{constructor(e){this.renderer=e,this.defaultMaskStack=[],this.current=null,this.sourceFrame=new ct,this.destinationFrame=new ct,this.viewportFrame=new ct}contextChange(){var t;const e=(t=this.renderer)==null?void 0:t.gl.getContextAttributes();this._rendererPremultipliedAlpha=!!(e&&e.alpha&&e.premultipliedAlpha)}bind(e=null,t,i){const n=this.renderer;this.current=e;let r,o,a;e?(r=e.baseTexture,a=r.resolution,t||(Ur.width=e.frame.width,Ur.height=e.frame.height,t=Ur),i||(Oa.x=e.frame.x,Oa.y=e.frame.y,Oa.width=t.width,Oa.height=t.height,i=Oa),o=r.framebuffer):(a=n.resolution,t||(Ur.width=n._view.screen.width,Ur.height=n._view.screen.height,t=Ur),i||(i=Ur,i.width=t.width,i.height=t.height));const l=this.viewportFrame;l.x=i.x*a,l.y=i.y*a,l.width=i.width*a,l.height=i.height*a,e||(l.y=n.view.height-(l.y+l.height)),l.ceil(),this.renderer.framebuffer.bind(o,l),this.renderer.projection.update(i,t,a,!o),e?this.renderer.mask.setMaskStack(r.maskStack):this.renderer.mask.setMaskStack(this.defaultMaskStack),this.sourceFrame.copyFrom(t),this.destinationFrame.copyFrom(i)}clear(e,t){const i=this.current?this.current.baseTexture.clear:this.renderer.background.backgroundColor,n=At.shared.setValue(e||i);(this.current&&this.current.baseTexture.alphaMode>0||!this.current&&this._rendererPremultipliedAlpha)&&n.premultiply(n.alpha);const r=this.destinationFrame,o=this.current?this.current.baseTexture:this.renderer._view.screen,a=r.width!==o.width||r.height!==o.height;if(a){let{x:l,y:c,width:h,height:u}=this.viewportFrame;l=Math.round(l),c=Math.round(c),h=Math.round(h),u=Math.round(u),this.renderer.gl.enable(this.renderer.gl.SCISSOR_TEST),this.renderer.gl.scissor(l,c,h,u)}this.renderer.framebuffer.clear(n.red,n.green,n.blue,n.alpha,t),a&&this.renderer.scissor.pop()}resize(){this.bind(null)}reset(){this.bind(null)}destroy(){this.renderer=null}}Bb.extension={type:ke.RendererSystem,name:"renderTexture"};$e.add(Bb);class WC{constructor(e,t){this.program=e,this.uniformData=t,this.uniformGroups={},this.uniformDirtyGroups={},this.uniformBufferBindings={}}destroy(){this.uniformData=null,this.uniformGroups=null,this.uniformDirtyGroups=null,this.uniformBufferBindings=null,this.program=null}}function zC(s,e){const t={},i=e.getProgramParameter(s,e.ACTIVE_ATTRIBUTES);for(let n=0;nc>h?1:-1);for(let c=0;c({data:r,offset:0,dataLen:0,dirty:0}));let t=0,i=0,n=0;for(let r=0;r1&&(t=Math.max(t,16)*o.data.size),o.dataLen=t,i%t!==0&&i<16){const a=i%t%16;i+=a,n+=a}i+t>16?(n=Math.ceil(n/16)*16,o.offset=n,n+=t,i=t):(o.offset=n,i+=t,n+=t)}return n=Math.ceil(n/16)*16,{uboElements:e,size:n}}function eE(s,e){const t=[];for(const i in s)e[i]&&t.push(e[i]);return t.sort((i,n)=>i.index-n.index),t}function tE(s,e){if(!s.autoManage)return{size:0,syncFunc:ZC};const t=eE(s.uniforms,e),{uboElements:i,size:n}=QC(t),r=[` - var v = null; - var v2 = null; - var cv = null; - var t = 0; - var gl = renderer.gl - var index = 0; - var data = buffer.data; - `];for(let o=0;o1){const u=yb(a.data.type),d=Math.max(Nb[a.data.type]/16,1),f=u/d,m=(4-f%4)%4;r.push(` - cv = ud.${c}.value; - v = uv.${c}; - offset = ${a.offset/4}; - - t = 0; - - for(var i=0; i < ${a.data.size*d}; i++) - { - for(var j = 0; j < ${f}; j++) - { - data[offset++] = v[t++]; - } - offset += ${m}; - } - - `)}else{const u=JC[a.data.type];r.push(` - cv = ud.${c}.value; - v = uv.${c}; - offset = ${a.offset/4}; - ${u}; - `)}}return r.push(` - renderer.buffer.update(buffer); - `),{size:n,syncFunc:new Function("ud","uv","renderer","syncData","buffer",r.join(` -`))}}let iE=0;const sc={textureCount:0,uboCount:0};class Db{constructor(e){this.destroyed=!1,this.renderer=e,this.systemCheck(),this.gl=null,this.shader=null,this.program=null,this.cache={},this._uboCache={},this.id=iE++}systemCheck(){if(!AC())throw new Error("Current environment does not allow unsafe-eval, please use @pixi/unsafe-eval module to enable support.")}contextChange(e){this.gl=e,this.reset()}bind(e,t){e.disposeRunner.add(this),e.uniforms.globals=this.renderer.globalUniforms;const i=e.program,n=i.glPrograms[this.renderer.CONTEXT_UID]||this.generateProgram(e);return this.shader=e,this.program!==i&&(this.program=i,this.gl.useProgram(n.program)),t||(sc.textureCount=0,sc.uboCount=0,this.syncUniformGroup(e.uniformGroup,sc)),n}setUniforms(e){const t=this.shader.program,i=t.glPrograms[this.renderer.CONTEXT_UID];t.syncUniforms(i.uniformData,e,this.renderer)}syncUniformGroup(e,t){const i=this.getGlProgram();(!e.static||e.dirtyId!==i.uniformDirtyGroups[e.id])&&(i.uniformDirtyGroups[e.id]=e.dirtyId,this.syncUniforms(e,i,t))}syncUniforms(e,t,i){(e.syncUniforms[this.shader.program.id]||this.createSyncGroups(e))(t.uniformData,e.uniforms,this.renderer,i)}createSyncGroups(e){const t=this.getSignature(e,this.shader.program.uniformData,"u");return this.cache[t]||(this.cache[t]=MC(e,this.shader.program.uniformData)),e.syncUniforms[this.shader.program.id]=this.cache[t],e.syncUniforms[this.shader.program.id]}syncUniformBufferGroup(e,t){const i=this.getGlProgram();if(!e.static||e.dirtyId!==0||!i.uniformGroups[e.id]){e.dirtyId=0;const n=i.uniformGroups[e.id]||this.createSyncBufferGroup(e,i,t);e.buffer.update(),n(i.uniformData,e.uniforms,this.renderer,sc,e.buffer)}this.renderer.buffer.bindBufferBase(e.buffer,i.uniformBufferBindings[t])}createSyncBufferGroup(e,t,i){const{gl:n}=this.renderer;this.renderer.buffer.bind(e.buffer);const r=this.gl.getUniformBlockIndex(t.program,i);t.uniformBufferBindings[i]=this.shader.uniformBindCount,n.uniformBlockBinding(t.program,r,this.shader.uniformBindCount),this.shader.uniformBindCount++;const o=this.getSignature(e,this.shader.program.uniformData,"ubo");let a=this._uboCache[o];if(a||(a=this._uboCache[o]=tE(e,this.shader.program.uniformData)),e.autoManage){const l=new Float32Array(a.size/4);e.buffer.update(l)}return t.uniformGroups[e.id]=a.syncFunc,t.uniformGroups[e.id]}getSignature(e,t,i){const n=e.uniforms,r=[`${i}-`];for(const o in n)r.push(o),t[o]&&r.push(t[o].type);return r.join("-")}getGlProgram(){return this.shader?this.shader.program.glPrograms[this.renderer.CONTEXT_UID]:null}generateProgram(e){const t=this.gl,i=e.program,n=KC(t,i);return i.glPrograms[this.renderer.CONTEXT_UID]=n,n}reset(){this.program=null,this.shader=null}disposeShader(e){this.shader===e&&(this.shader=null)}destroy(){this.renderer=null,this.destroyed=!0}}Db.extension={type:ke.RendererSystem,name:"shader"};$e.add(Db);class ah{constructor(e){this.renderer=e}run(e){const{renderer:t}=this;t.runners.init.emit(t.options),e.hello&&console.log(`PixiJS 7.4.3 - ${t.rendererLogId} - https://pixijs.com`),t.resize(t.screen.width,t.screen.height)}destroy(){}}ah.defaultOptions={hello:!1},ah.extension={type:[ke.RendererSystem,ke.CanvasRendererSystem],name:"startup"};$e.add(ah);function sE(s,e=[]){return e[We.NORMAL]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],e[We.ADD]=[s.ONE,s.ONE],e[We.MULTIPLY]=[s.DST_COLOR,s.ONE_MINUS_SRC_ALPHA,s.ONE,s.ONE_MINUS_SRC_ALPHA],e[We.SCREEN]=[s.ONE,s.ONE_MINUS_SRC_COLOR,s.ONE,s.ONE_MINUS_SRC_ALPHA],e[We.OVERLAY]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],e[We.DARKEN]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],e[We.LIGHTEN]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],e[We.COLOR_DODGE]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],e[We.COLOR_BURN]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],e[We.HARD_LIGHT]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],e[We.SOFT_LIGHT]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],e[We.DIFFERENCE]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],e[We.EXCLUSION]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],e[We.HUE]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],e[We.SATURATION]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],e[We.COLOR]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],e[We.LUMINOSITY]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],e[We.NONE]=[0,0],e[We.NORMAL_NPM]=[s.SRC_ALPHA,s.ONE_MINUS_SRC_ALPHA,s.ONE,s.ONE_MINUS_SRC_ALPHA],e[We.ADD_NPM]=[s.SRC_ALPHA,s.ONE,s.ONE,s.ONE],e[We.SCREEN_NPM]=[s.SRC_ALPHA,s.ONE_MINUS_SRC_COLOR,s.ONE,s.ONE_MINUS_SRC_ALPHA],e[We.SRC_IN]=[s.DST_ALPHA,s.ZERO],e[We.SRC_OUT]=[s.ONE_MINUS_DST_ALPHA,s.ZERO],e[We.SRC_ATOP]=[s.DST_ALPHA,s.ONE_MINUS_SRC_ALPHA],e[We.DST_OVER]=[s.ONE_MINUS_DST_ALPHA,s.ONE],e[We.DST_IN]=[s.ZERO,s.SRC_ALPHA],e[We.DST_OUT]=[s.ZERO,s.ONE_MINUS_SRC_ALPHA],e[We.DST_ATOP]=[s.ONE_MINUS_DST_ALPHA,s.SRC_ALPHA],e[We.XOR]=[s.ONE_MINUS_DST_ALPHA,s.ONE_MINUS_SRC_ALPHA],e[We.SUBTRACT]=[s.ONE,s.ONE,s.ONE,s.ONE,s.FUNC_REVERSE_SUBTRACT,s.FUNC_ADD],e}const nE=0,rE=1,oE=2,aE=3,lE=4,cE=5,Ub=class Zf{constructor(){this.gl=null,this.stateId=0,this.polygonOffset=0,this.blendMode=We.NONE,this._blendEq=!1,this.map=[],this.map[nE]=this.setBlend,this.map[rE]=this.setOffset,this.map[oE]=this.setCullFace,this.map[aE]=this.setDepthTest,this.map[lE]=this.setFrontFace,this.map[cE]=this.setDepthMask,this.checks=[],this.defaultState=new mn,this.defaultState.blend=!0}contextChange(e){this.gl=e,this.blendModes=sE(e),this.set(this.defaultState),this.reset()}set(e){if(e=e||this.defaultState,this.stateId!==e.data){let t=this.stateId^e.data,i=0;for(;t;)t&1&&this.map[i].call(this,!!(e.data&1<>1,i++;this.stateId=e.data}for(let t=0;te.systems[n]),i=[...t,...Object.keys(e.systems).filter(n=>!t.includes(n))];for(const n of i)this.addSystem(e.systems[n],n)}addRunners(...e){e.forEach(t=>{this.runners[t]=new Ls(t)})}addSystem(e,t){const i=new e(this);if(this[t])throw new Error(`Whoops! The name "${t}" is already in use`);this[t]=i,this._systemsHash[t]=i;for(const n in this.runners)this.runners[n].add(i);return this}emitWithCustomOptions(e,t){const i=Object.keys(this._systemsHash);e.items.forEach(n=>{const r=i.find(o=>this._systemsHash[o]===n);n[e.name](t[r])})}destroy(){Object.values(this.runners).forEach(e=>{e.destroy()}),this._systemsHash={}}}const Ga=class kc{constructor(e){this.renderer=e,this.count=0,this.checkCount=0,this.maxIdle=kc.defaultMaxIdle,this.checkCountMax=kc.defaultCheckCountMax,this.mode=kc.defaultMode}postrender(){this.renderer.objectRenderer.renderingToScreen&&(this.count++,this.mode!==up.MANUAL&&(this.checkCount++,this.checkCount>this.checkCountMax&&(this.checkCount=0,this.run())))}run(){const e=this.renderer.texture,t=e.managedTextures;let i=!1;for(let n=0;nthis.maxIdle&&(e.destroyTexture(r,!0),t[n]=null,i=!0)}if(i){let n=0;for(let r=0;r=0;n--)this.unload(e.children[n])}destroy(){this.renderer=null}};Ga.defaultMode=up.AUTO,Ga.defaultMaxIdle=3600,Ga.defaultCheckCountMax=600,Ga.extension={type:ke.RendererSystem,name:"textureGC"};let Hr=Ga;$e.add(Hr);class Wd{constructor(e){this.texture=e,this.width=-1,this.height=-1,this.dirtyId=-1,this.dirtyStyleId=-1,this.mipmap=!1,this.wrapMode=33071,this.type=Ue.UNSIGNED_BYTE,this.internalFormat=Te.RGBA,this.samplerType=0}}function dE(s){let e;return"WebGL2RenderingContext"in globalThis&&s instanceof globalThis.WebGL2RenderingContext?e={[s.RGB]:De.FLOAT,[s.RGBA]:De.FLOAT,[s.ALPHA]:De.FLOAT,[s.LUMINANCE]:De.FLOAT,[s.LUMINANCE_ALPHA]:De.FLOAT,[s.R8]:De.FLOAT,[s.R8_SNORM]:De.FLOAT,[s.RG8]:De.FLOAT,[s.RG8_SNORM]:De.FLOAT,[s.RGB8]:De.FLOAT,[s.RGB8_SNORM]:De.FLOAT,[s.RGB565]:De.FLOAT,[s.RGBA4]:De.FLOAT,[s.RGB5_A1]:De.FLOAT,[s.RGBA8]:De.FLOAT,[s.RGBA8_SNORM]:De.FLOAT,[s.RGB10_A2]:De.FLOAT,[s.RGB10_A2UI]:De.FLOAT,[s.SRGB8]:De.FLOAT,[s.SRGB8_ALPHA8]:De.FLOAT,[s.R16F]:De.FLOAT,[s.RG16F]:De.FLOAT,[s.RGB16F]:De.FLOAT,[s.RGBA16F]:De.FLOAT,[s.R32F]:De.FLOAT,[s.RG32F]:De.FLOAT,[s.RGB32F]:De.FLOAT,[s.RGBA32F]:De.FLOAT,[s.R11F_G11F_B10F]:De.FLOAT,[s.RGB9_E5]:De.FLOAT,[s.R8I]:De.INT,[s.R8UI]:De.UINT,[s.R16I]:De.INT,[s.R16UI]:De.UINT,[s.R32I]:De.INT,[s.R32UI]:De.UINT,[s.RG8I]:De.INT,[s.RG8UI]:De.UINT,[s.RG16I]:De.INT,[s.RG16UI]:De.UINT,[s.RG32I]:De.INT,[s.RG32UI]:De.UINT,[s.RGB8I]:De.INT,[s.RGB8UI]:De.UINT,[s.RGB16I]:De.INT,[s.RGB16UI]:De.UINT,[s.RGB32I]:De.INT,[s.RGB32UI]:De.UINT,[s.RGBA8I]:De.INT,[s.RGBA8UI]:De.UINT,[s.RGBA16I]:De.INT,[s.RGBA16UI]:De.UINT,[s.RGBA32I]:De.INT,[s.RGBA32UI]:De.UINT,[s.DEPTH_COMPONENT16]:De.FLOAT,[s.DEPTH_COMPONENT24]:De.FLOAT,[s.DEPTH_COMPONENT32F]:De.FLOAT,[s.DEPTH_STENCIL]:De.FLOAT,[s.DEPTH24_STENCIL8]:De.FLOAT,[s.DEPTH32F_STENCIL8]:De.FLOAT}:e={[s.RGB]:De.FLOAT,[s.RGBA]:De.FLOAT,[s.ALPHA]:De.FLOAT,[s.LUMINANCE]:De.FLOAT,[s.LUMINANCE_ALPHA]:De.FLOAT,[s.DEPTH_STENCIL]:De.FLOAT},e}function fE(s){let e;return"WebGL2RenderingContext"in globalThis&&s instanceof globalThis.WebGL2RenderingContext?e={[Ue.UNSIGNED_BYTE]:{[Te.RGBA]:s.RGBA8,[Te.RGB]:s.RGB8,[Te.RG]:s.RG8,[Te.RED]:s.R8,[Te.RGBA_INTEGER]:s.RGBA8UI,[Te.RGB_INTEGER]:s.RGB8UI,[Te.RG_INTEGER]:s.RG8UI,[Te.RED_INTEGER]:s.R8UI,[Te.ALPHA]:s.ALPHA,[Te.LUMINANCE]:s.LUMINANCE,[Te.LUMINANCE_ALPHA]:s.LUMINANCE_ALPHA},[Ue.BYTE]:{[Te.RGBA]:s.RGBA8_SNORM,[Te.RGB]:s.RGB8_SNORM,[Te.RG]:s.RG8_SNORM,[Te.RED]:s.R8_SNORM,[Te.RGBA_INTEGER]:s.RGBA8I,[Te.RGB_INTEGER]:s.RGB8I,[Te.RG_INTEGER]:s.RG8I,[Te.RED_INTEGER]:s.R8I},[Ue.UNSIGNED_SHORT]:{[Te.RGBA_INTEGER]:s.RGBA16UI,[Te.RGB_INTEGER]:s.RGB16UI,[Te.RG_INTEGER]:s.RG16UI,[Te.RED_INTEGER]:s.R16UI,[Te.DEPTH_COMPONENT]:s.DEPTH_COMPONENT16},[Ue.SHORT]:{[Te.RGBA_INTEGER]:s.RGBA16I,[Te.RGB_INTEGER]:s.RGB16I,[Te.RG_INTEGER]:s.RG16I,[Te.RED_INTEGER]:s.R16I},[Ue.UNSIGNED_INT]:{[Te.RGBA_INTEGER]:s.RGBA32UI,[Te.RGB_INTEGER]:s.RGB32UI,[Te.RG_INTEGER]:s.RG32UI,[Te.RED_INTEGER]:s.R32UI,[Te.DEPTH_COMPONENT]:s.DEPTH_COMPONENT24},[Ue.INT]:{[Te.RGBA_INTEGER]:s.RGBA32I,[Te.RGB_INTEGER]:s.RGB32I,[Te.RG_INTEGER]:s.RG32I,[Te.RED_INTEGER]:s.R32I},[Ue.FLOAT]:{[Te.RGBA]:s.RGBA32F,[Te.RGB]:s.RGB32F,[Te.RG]:s.RG32F,[Te.RED]:s.R32F,[Te.DEPTH_COMPONENT]:s.DEPTH_COMPONENT32F},[Ue.HALF_FLOAT]:{[Te.RGBA]:s.RGBA16F,[Te.RGB]:s.RGB16F,[Te.RG]:s.RG16F,[Te.RED]:s.R16F},[Ue.UNSIGNED_SHORT_5_6_5]:{[Te.RGB]:s.RGB565},[Ue.UNSIGNED_SHORT_4_4_4_4]:{[Te.RGBA]:s.RGBA4},[Ue.UNSIGNED_SHORT_5_5_5_1]:{[Te.RGBA]:s.RGB5_A1},[Ue.UNSIGNED_INT_2_10_10_10_REV]:{[Te.RGBA]:s.RGB10_A2,[Te.RGBA_INTEGER]:s.RGB10_A2UI},[Ue.UNSIGNED_INT_10F_11F_11F_REV]:{[Te.RGB]:s.R11F_G11F_B10F},[Ue.UNSIGNED_INT_5_9_9_9_REV]:{[Te.RGB]:s.RGB9_E5},[Ue.UNSIGNED_INT_24_8]:{[Te.DEPTH_STENCIL]:s.DEPTH24_STENCIL8},[Ue.FLOAT_32_UNSIGNED_INT_24_8_REV]:{[Te.DEPTH_STENCIL]:s.DEPTH32F_STENCIL8}}:e={[Ue.UNSIGNED_BYTE]:{[Te.RGBA]:s.RGBA,[Te.RGB]:s.RGB,[Te.ALPHA]:s.ALPHA,[Te.LUMINANCE]:s.LUMINANCE,[Te.LUMINANCE_ALPHA]:s.LUMINANCE_ALPHA},[Ue.UNSIGNED_SHORT_5_6_5]:{[Te.RGB]:s.RGB},[Ue.UNSIGNED_SHORT_4_4_4_4]:{[Te.RGBA]:s.RGBA},[Ue.UNSIGNED_SHORT_5_5_5_1]:{[Te.RGBA]:s.RGBA}},e}class $b{constructor(e){this.renderer=e,this.boundTextures=[],this.currentLocation=-1,this.managedTextures=[],this._unknownBoundTextures=!1,this.unknownTexture=new tt,this.hasIntegerTextures=!1}contextChange(){const e=this.gl=this.renderer.gl;this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.webGLVersion=this.renderer.context.webGLVersion,this.internalFormats=fE(e),this.samplerTypes=dE(e);const t=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS);this.boundTextures.length=t;for(let n=0;n=0;--r){const o=t[r];o&&o._glTextures[n].samplerType!==De.FLOAT&&this.renderer.texture.unbind(o)}}initTexture(e){const t=new Wd(this.gl.createTexture());return t.dirtyId=-1,e._glTextures[this.CONTEXT_UID]=t,this.managedTextures.push(e),e.on("dispose",this.destroyTexture,this),t}initTextureType(e,t){var i;t.internalFormat=((i=this.internalFormats[e.type])==null?void 0:i[e.format])??e.format,t.samplerType=this.samplerTypes[t.internalFormat]??De.FLOAT,this.webGLVersion===2&&e.type===Ue.HALF_FLOAT?t.type=this.gl.HALF_FLOAT:t.type=e.type}updateTexture(e){var n;const t=e._glTextures[this.CONTEXT_UID];if(!t)return;const i=this.renderer;if(this.initTextureType(e,t),(n=e.resource)==null?void 0:n.upload(i,e,t))t.samplerType!==De.FLOAT&&(this.hasIntegerTextures=!0);else{const r=e.realWidth,o=e.realHeight,a=i.gl;(t.width!==r||t.height!==o||t.dirtyId<0)&&(t.width=r,t.height=o,a.texImage2D(e.target,0,t.internalFormat,r,o,0,e.format,t.type,null))}e.dirtyStyleId!==t.dirtyStyleId&&this.updateTextureStyle(e),t.dirtyId=e.dirtyId}destroyTexture(e,t){const{gl:i}=this;if(e=e.castToBaseTexture(),e._glTextures[this.CONTEXT_UID]&&(this.unbind(e),i.deleteTexture(e._glTextures[this.CONTEXT_UID].texture),e.off("dispose",this.destroyTexture,this),delete e._glTextures[this.CONTEXT_UID],!t)){const n=this.managedTextures.indexOf(e);n!==-1&&Jo(this.managedTextures,n,1)}}updateTextureStyle(e){var i;const t=e._glTextures[this.CONTEXT_UID];t&&((e.mipmap===vs.POW2||this.webGLVersion!==2)&&!e.isPowerOfTwo?t.mipmap=!1:t.mipmap=e.mipmap>=1,this.webGLVersion!==2&&!e.isPowerOfTwo?t.wrapMode=Os.CLAMP:t.wrapMode=e.wrapMode,(i=e.resource)!=null&&i.style(this.renderer,e,t)||this.setStyle(e,t),t.dirtyStyleId=e.dirtyStyleId)}setStyle(e,t){const i=this.gl;if(t.mipmap&&e.mipmap!==vs.ON_MANUAL&&i.generateMipmap(e.target),i.texParameteri(e.target,i.TEXTURE_WRAP_S,t.wrapMode),i.texParameteri(e.target,i.TEXTURE_WRAP_T,t.wrapMode),t.mipmap){i.texParameteri(e.target,i.TEXTURE_MIN_FILTER,e.scaleMode===Rs.LINEAR?i.LINEAR_MIPMAP_LINEAR:i.NEAREST_MIPMAP_NEAREST);const n=this.renderer.context.extensions.anisotropicFiltering;if(n&&e.anisotropicLevel>0&&e.scaleMode===Rs.LINEAR){const r=Math.min(e.anisotropicLevel,i.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT));i.texParameterf(e.target,n.TEXTURE_MAX_ANISOTROPY_EXT,r)}}else i.texParameteri(e.target,i.TEXTURE_MIN_FILTER,e.scaleMode===Rs.LINEAR?i.LINEAR:i.NEAREST);i.texParameteri(e.target,i.TEXTURE_MAG_FILTER,e.scaleMode===Rs.LINEAR?i.LINEAR:i.NEAREST)}destroy(){this.renderer=null}}$b.extension={type:ke.RendererSystem,name:"texture"};$e.add($b);class Xb{constructor(e){this.renderer=e}contextChange(){this.gl=this.renderer.gl,this.CONTEXT_UID=this.renderer.CONTEXT_UID}bind(e){const{gl:t,CONTEXT_UID:i}=this,n=e._glTransformFeedbacks[i]||this.createGLTransformFeedback(e);t.bindTransformFeedback(t.TRANSFORM_FEEDBACK,n)}unbind(){const{gl:e}=this;e.bindTransformFeedback(e.TRANSFORM_FEEDBACK,null)}beginTransformFeedback(e,t){const{gl:i,renderer:n}=this;t&&n.shader.bind(t),i.beginTransformFeedback(e)}endTransformFeedback(){const{gl:e}=this;e.endTransformFeedback()}createGLTransformFeedback(e){const{gl:t,renderer:i,CONTEXT_UID:n}=this,r=t.createTransformFeedback();e._glTransformFeedbacks[n]=r,t.bindTransformFeedback(t.TRANSFORM_FEEDBACK,r);for(let o=0;o(s[s.INTERACTION=50]="INTERACTION",s[s.HIGH=25]="HIGH",s[s.NORMAL=0]="NORMAL",s[s.LOW=-25]="LOW",s[s.UTILITY=-50]="UTILITY",s))(uo||{});class zd{constructor(e,t=null,i=0,n=!1){this.next=null,this.previous=null,this._destroyed=!1,this.fn=e,this.context=t,this.priority=i,this.once=n}match(e,t=null){return this.fn===e&&this.context===t}emit(e){this.fn&&(this.context?this.fn.call(this.context,e):this.fn(e));const t=this.next;return this.once&&this.destroy(!0),this._destroyed&&(this.next=null),t}connect(e){this.previous=e,e.next&&(e.next.previous=this),this.next=e.next,e.next=this}destroy(e=!1){this._destroyed=!0,this.fn=null,this.context=null,this.previous&&(this.previous.next=this.next),this.next&&(this.next.previous=this.previous);const t=this.next;return this.next=e?null:t,this.previous=null,t}}const Vb=class es{constructor(){this.autoStart=!1,this.deltaTime=1,this.lastTime=-1,this.speed=1,this.started=!1,this._requestId=null,this._maxElapsedMS=100,this._minElapsedMS=0,this._protected=!1,this._lastFrame=-1,this._head=new zd(null,null,1/0),this.deltaMS=1/es.targetFPMS,this.elapsedMS=1/es.targetFPMS,this._tick=e=>{this._requestId=null,this.started&&(this.update(e),this.started&&this._requestId===null&&this._head.next&&(this._requestId=requestAnimationFrame(this._tick)))}}_requestIfNeeded(){this._requestId===null&&this._head.next&&(this.lastTime=performance.now(),this._lastFrame=this.lastTime,this._requestId=requestAnimationFrame(this._tick))}_cancelIfNeeded(){this._requestId!==null&&(cancelAnimationFrame(this._requestId),this._requestId=null)}_startIfPossible(){this.started?this._requestIfNeeded():this.autoStart&&this.start()}add(e,t,i=uo.NORMAL){return this._addListener(new zd(e,t,i))}addOnce(e,t,i=uo.NORMAL){return this._addListener(new zd(e,t,i,!0))}_addListener(e){let t=this._head.next,i=this._head;if(!t)e.connect(i);else{for(;t;){if(e.priority>t.priority){e.connect(i);break}i=t,t=t.next}e.previous||e.connect(i)}return this._startIfPossible(),this}remove(e,t){let i=this._head.next;for(;i;)i.match(e,t)?i=i.destroy():i=i.next;return this._head.next||this._cancelIfNeeded(),this}get count(){if(!this._head)return 0;let e=0,t=this._head;for(;t=t.next;)e++;return e}start(){this.started||(this.started=!0,this._requestIfNeeded())}stop(){this.started&&(this.started=!1,this._cancelIfNeeded())}destroy(){if(!this._protected){this.stop();let e=this._head.next;for(;e;)e=e.destroy(!0);this._head.destroy(),this._head=null}}update(e=performance.now()){let t;if(e>this.lastTime){if(t=this.elapsedMS=e-this.lastTime,t>this._maxElapsedMS&&(t=this._maxElapsedMS),t*=this.speed,this._minElapsedMS){const r=e-this._lastFrame|0;if(r{this._ticker.stop()},this.start=()=>{this._ticker.start()},this._ticker=null,this.ticker=e.sharedTicker?Yi.shared:new Yi,e.autoStart&&this.start()}static destroy(){if(this._ticker){const e=this._ticker;this.ticker=null,e.destroy()}}}Yb.extension=ke.Application;$e.add(Yb);const Gb=[];$e.handleByList(ke.Renderer,Gb);function mE(s){for(const e of Gb)if(e.test(s))return new e(s);throw new Error("Unable to auto-detect a suitable renderer.")}var pE=`attribute vec2 aVertexPosition; -attribute vec2 aTextureCoord; - -uniform mat3 projectionMatrix; - -varying vec2 vTextureCoord; - -void main(void) -{ - gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); - vTextureCoord = aTextureCoord; -}`,gE=`attribute vec2 aVertexPosition; - -uniform mat3 projectionMatrix; - -varying vec2 vTextureCoord; - -uniform vec4 inputSize; -uniform vec4 outputFrame; - -vec4 filterVertexPosition( void ) -{ - vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy; - - return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0); -} - -vec2 filterTextureCoord( void ) -{ - return aVertexPosition * (outputFrame.zw * inputSize.zw); -} - -void main(void) -{ - gl_Position = filterVertexPosition(); - vTextureCoord = filterTextureCoord(); -} -`;const vE=pE,jb=gE;class Hb{constructor(e){this.renderer=e}contextChange(e){let t;if(this.renderer.context.webGLVersion===1){const i=e.getParameter(e.FRAMEBUFFER_BINDING);e.bindFramebuffer(e.FRAMEBUFFER,null),t=e.getParameter(e.SAMPLES),e.bindFramebuffer(e.FRAMEBUFFER,i)}else{const i=e.getParameter(e.DRAW_FRAMEBUFFER_BINDING);e.bindFramebuffer(e.DRAW_FRAMEBUFFER,null),t=e.getParameter(e.SAMPLES),e.bindFramebuffer(e.DRAW_FRAMEBUFFER,i)}t>=ci.HIGH?this.multisample=ci.HIGH:t>=ci.MEDIUM?this.multisample=ci.MEDIUM:t>=ci.LOW?this.multisample=ci.LOW:this.multisample=ci.NONE}destroy(){}}Hb.extension={type:ke.RendererSystem,name:"_multisample"};$e.add(Hb);class yE{constructor(e){this.buffer=e||null,this.updateID=-1,this.byteLength=-1,this.refCount=0}}class Wb{constructor(e){this.renderer=e,this.managedBuffers={},this.boundBufferBases={}}destroy(){this.renderer=null}contextChange(){this.disposeAll(!0),this.gl=this.renderer.gl,this.CONTEXT_UID=this.renderer.CONTEXT_UID}bind(e){const{gl:t,CONTEXT_UID:i}=this,n=e._glBuffers[i]||this.createGLBuffer(e);t.bindBuffer(e.type,n.buffer)}unbind(e){const{gl:t}=this;t.bindBuffer(e,null)}bindBufferBase(e,t){const{gl:i,CONTEXT_UID:n}=this;if(this.boundBufferBases[t]!==e){const r=e._glBuffers[n]||this.createGLBuffer(e);this.boundBufferBases[t]=e,i.bindBufferBase(i.UNIFORM_BUFFER,t,r.buffer)}}bindBufferRange(e,t,i){const{gl:n,CONTEXT_UID:r}=this;i=i||0;const o=e._glBuffers[r]||this.createGLBuffer(e);n.bindBufferRange(n.UNIFORM_BUFFER,t||0,o.buffer,i*256,256)}update(e){const{gl:t,CONTEXT_UID:i}=this,n=e._glBuffers[i]||this.createGLBuffer(e);if(e._updateID!==n.updateID)if(n.updateID=e._updateID,t.bindBuffer(e.type,n.buffer),n.byteLength>=e.data.byteLength)t.bufferSubData(e.type,0,e.data);else{const r=e.static?t.STATIC_DRAW:t.DYNAMIC_DRAW;n.byteLength=e.data.byteLength,t.bufferData(e.type,e.data,r)}}dispose(e,t){if(!this.managedBuffers[e.id])return;delete this.managedBuffers[e.id];const i=e._glBuffers[this.CONTEXT_UID],n=this.gl;e.disposeRunner.remove(this),i&&(t||n.deleteBuffer(i.buffer),delete e._glBuffers[this.CONTEXT_UID])}disposeAll(e){const t=Object.keys(this.managedBuffers);for(let i=0;it.resource).filter(t=>t).map(t=>t.load());return this._load=Promise.all(e).then(()=>{const{realWidth:t,realHeight:i}=this.items[0];return this.resize(t,i),this.update(),Promise.resolve(this)}),this._load}}class xE extends qb{constructor(e,t){const{width:i,height:n}=t||{};let r,o;Array.isArray(e)?(r=e,o=e.length):o=e,super(o,{width:i,height:n}),r&&this.initFromArray(r,t)}addBaseTextureAt(e,t){if(e.resource)this.addResourceAt(e.resource,t);else throw new Error("ArrayResource does not support RenderTexture");return this}bind(e){super.bind(e),e.target=Zo.TEXTURE_2D_ARRAY}upload(e,t,i){const{length:n,itemDirtyIds:r,items:o}=this,{gl:a}=e;i.dirtyId<0&&a.texImage3D(a.TEXTURE_2D_ARRAY,0,i.internalFormat,this._width,this._height,n,0,t.format,i.type,null);for(let l=0;l0)if(e.resource)this.addResourceAt(e.resource,t);else throw new Error("CubeResource does not support copying of renderTexture.");else e.target=Zo.TEXTURE_CUBE_MAP_POSITIVE_X+t,e.parentTextureArray=this.baseTexture,this.items[t]=e;return e.valid&&!this.valid&&this.resize(e.realWidth,e.realHeight),this.items[t]=e,this}upload(e,t,i){const n=this.itemDirtyIds;for(let r=0;r{if(this.url===null){e(this);return}try{const i=await Be.ADAPTER.fetch(this.url,{mode:this.crossOrigin?"cors":"no-cors"});if(this.destroyed)return;const n=await i.blob();if(this.destroyed)return;const r=await createImageBitmap(n,{premultiplyAlpha:this.alphaMode===null||this.alphaMode===bi.UNPACK?"premultiply":"none"});if(this.destroyed){r.close();return}this.source=r,this.update(),e(this)}catch(i){if(this.destroyed)return;t(i),this.onError.emit(i)}}),this._load)}upload(e,t,i){return this.source instanceof ImageBitmap?(typeof this.alphaMode=="number"&&(t.alphaMode=this.alphaMode),super.upload(e,t,i)):(this.load(),!1)}dispose(){this.ownsImageBitmap&&this.source instanceof ImageBitmap&&this.source.close(),super.dispose(),this._load=null}static test(e){return!!globalThis.createImageBitmap&&typeof ImageBitmap<"u"&&(typeof e=="string"||e instanceof ImageBitmap)}static get EMPTY(){return Vo._EMPTY=Vo._EMPTY??Be.ADAPTER.createCanvas(0,0),Vo._EMPTY}}const Qf=class Oc extends Wn{constructor(e,t){t=t||{},super(Be.ADAPTER.createCanvas()),this._width=0,this._height=0,this.svg=e,this.scale=t.scale||1,this._overrideWidth=t.width,this._overrideHeight=t.height,this._resolve=null,this._crossorigin=t.crossorigin,this._load=null,t.autoLoad!==!1&&this.load()}load(){return this._load?this._load:(this._load=new Promise(e=>{if(this._resolve=()=>{this.update(),e(this)},Oc.SVG_XML.test(this.svg.trim())){if(!btoa)throw new Error("Your browser doesn't support base64 conversions.");this.svg=`data:image/svg+xml;base64,${btoa(unescape(encodeURIComponent(this.svg)))}`}this._loadSvg()}),this._load)}_loadSvg(){const e=new Image;Wn.crossOrigin(e,this.svg,this._crossorigin),e.src=this.svg,e.onerror=t=>{this._resolve&&(e.onerror=null,this.onError.emit(t))},e.onload=()=>{if(!this._resolve)return;const t=e.width,i=e.height;if(!t||!i)throw new Error("The SVG image must have width and height defined (in pixels), canvas API needs them.");let n=t*this.scale,r=i*this.scale;(this._overrideWidth||this._overrideHeight)&&(n=this._overrideWidth||this._overrideHeight/i*t,r=this._overrideHeight||this._overrideWidth/t*i),n=Math.round(n),r=Math.round(r);const o=this.source;o.width=n,o.height=r,o._pixiId=`canvas_${ho()}`,o.getContext("2d").drawImage(e,0,0,t,i,0,0,n,r),this._resolve(),this._resolve=null}}static getSize(e){const t=Oc.SVG_SIZE.exec(e),i={};return t&&(i[t[1]]=Math.round(parseFloat(t[3])),i[t[5]]=Math.round(parseFloat(t[7]))),i}dispose(){super.dispose(),this._resolve=null,this._crossorigin=null}static test(e,t){return t==="svg"||typeof e=="string"&&e.startsWith("data:image/svg+xml")||typeof e=="string"&&Oc.SVG_XML.test(e)}};Qf.SVG_XML=/^(<\?xml[^?]+\?>)?\s*()]*-->)?\s*\]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i;let em=Qf;class SE extends Wn{constructor(e){super(e)}static test(e){return!!globalThis.VideoFrame&&e instanceof globalThis.VideoFrame}}const tm=class im extends Wn{constructor(e,t){if(t=t||{},!(e instanceof HTMLVideoElement)){const i=document.createElement("video");t.autoLoad!==!1&&i.setAttribute("preload","auto"),t.playsinline!==!1&&(i.setAttribute("webkit-playsinline",""),i.setAttribute("playsinline","")),t.muted===!0&&(i.setAttribute("muted",""),i.muted=!0),t.loop===!0&&i.setAttribute("loop",""),t.autoPlay!==!1&&i.setAttribute("autoplay",""),typeof e=="string"&&(e=[e]);const n=e[0].src||e[0];Wn.crossOrigin(i,n,t.crossorigin);for(let r=0;r{this.valid?t(this):(this._resolve=t,this._reject=i,e.load())}),this._load}_onError(e){this.source.removeEventListener("error",this._onError,!0),this.onError.emit(e),this._reject&&(this._reject(e),this._reject=null,this._resolve=null)}_isSourcePlaying(){const e=this.source;return!e.paused&&!e.ended}_isSourceReady(){return this.source.readyState>2}_onPlayStart(){this.valid||this._onCanPlay(),this._configureAutoUpdate()}_onPlayStop(){this._configureAutoUpdate()}_onSeeked(){this._autoUpdate&&!this._isSourcePlaying()&&(this._msToNextUpdate=0,this.update(),this._msToNextUpdate=0)}_onCanPlay(){const e=this.source;e.removeEventListener("canplay",this._onCanPlay),e.removeEventListener("canplaythrough",this._onCanPlay);const t=this.valid;this._msToNextUpdate=0,this.update(),this._msToNextUpdate=0,!t&&this._resolve&&(this._resolve(this),this._resolve=null,this._reject=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&e.play()}dispose(){this._configureAutoUpdate();const e=this.source;e&&(e.removeEventListener("play",this._onPlayStart),e.removeEventListener("pause",this._onPlayStop),e.removeEventListener("seeked",this._onSeeked),e.removeEventListener("canplay",this._onCanPlay),e.removeEventListener("canplaythrough",this._onCanPlay),e.removeEventListener("error",this._onError,!0),e.pause(),e.src="",e.load()),super.dispose()}get autoUpdate(){return this._autoUpdate}set autoUpdate(e){e!==this._autoUpdate&&(this._autoUpdate=e,this._configureAutoUpdate())}get updateFPS(){return this._updateFPS}set updateFPS(e){e!==this._updateFPS&&(this._updateFPS=e,this._configureAutoUpdate())}_configureAutoUpdate(){this._autoUpdate&&this._isSourcePlaying()?!this._updateFPS&&this.source.requestVideoFrameCallback?(this._isConnectedToTicker&&(Yi.shared.remove(this.update,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0),this._videoFrameRequestCallbackHandle===null&&(this._videoFrameRequestCallbackHandle=this.source.requestVideoFrameCallback(this._videoFrameRequestCallback))):(this._videoFrameRequestCallbackHandle!==null&&(this.source.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker||(Yi.shared.add(this.update,this),this._isConnectedToTicker=!0,this._msToNextUpdate=0)):(this._videoFrameRequestCallbackHandle!==null&&(this.source.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker&&(Yi.shared.remove(this.update,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0))}static test(e,t){return globalThis.HTMLVideoElement&&e instanceof HTMLVideoElement||im.TYPES.includes(t)}};tm.TYPES=["mp4","m4v","webm","ogg","ogv","h264","avi","mov"],tm.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"};let Zb=tm;Vf.push(Vo,Mb,bE,Zb,SE,em,au,wE,xE);class bl{constructor(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.rect=null,this.updateID=-1}isEmpty(){return this.minX>this.maxX||this.minY>this.maxY}clear(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0}getRectangle(e){return this.minX>this.maxX||this.minY>this.maxY?ct.EMPTY:(e=e||new ct(0,0,1,1),e.x=this.minX,e.y=this.minY,e.width=this.maxX-this.minX,e.height=this.maxY-this.minY,e)}addPoint(e){this.minX=Math.min(this.minX,e.x),this.maxX=Math.max(this.maxX,e.x),this.minY=Math.min(this.minY,e.y),this.maxY=Math.max(this.maxY,e.y)}addPointMatrix(e,t){const{a:i,b:n,c:r,d:o,tx:a,ty:l}=e,c=i*t.x+r*t.y+a,h=n*t.x+o*t.y+l;this.minX=Math.min(this.minX,c),this.maxX=Math.max(this.maxX,c),this.minY=Math.min(this.minY,h),this.maxY=Math.max(this.maxY,h)}addQuad(e){let t=this.minX,i=this.minY,n=this.maxX,r=this.maxY,o=e[0],a=e[1];t=on?o:n,r=a>r?a:r,o=e[2],a=e[3],t=on?o:n,r=a>r?a:r,o=e[4],a=e[5],t=on?o:n,r=a>r?a:r,o=e[6],a=e[7],t=on?o:n,r=a>r?a:r,this.minX=t,this.minY=i,this.maxX=n,this.maxY=r}addFrame(e,t,i,n,r){this.addFrameMatrix(e.worldTransform,t,i,n,r)}addFrameMatrix(e,t,i,n,r){const o=e.a,a=e.b,l=e.c,c=e.d,h=e.tx,u=e.ty;let d=this.minX,f=this.minY,m=this.maxX,p=this.maxY,g=o*t+l*i+h,x=a*t+c*i+u;d=gm?g:m,p=x>p?x:p,g=o*n+l*i+h,x=a*n+c*i+u,d=gm?g:m,p=x>p?x:p,g=o*t+l*r+h,x=a*t+c*r+u,d=gm?g:m,p=x>p?x:p,g=o*n+l*r+h,x=a*n+c*r+u,d=gm?g:m,p=x>p?x:p,this.minX=d,this.minY=f,this.maxX=m,this.maxY=p}addVertexData(e,t,i){let n=this.minX,r=this.minY,o=this.maxX,a=this.maxY;for(let l=t;lo?c:o,a=h>a?h:a}this.minX=n,this.minY=r,this.maxX=o,this.maxY=a}addVertices(e,t,i,n){this.addVerticesMatrix(e.worldTransform,t,i,n)}addVerticesMatrix(e,t,i,n,r=0,o=r){const a=e.a,l=e.b,c=e.c,h=e.d,u=e.tx,d=e.ty;let f=this.minX,m=this.minY,p=this.maxX,g=this.maxY;for(let x=i;xn?e.maxX:n,this.maxY=e.maxY>r?e.maxY:r}addBoundsMask(e,t){const i=e.minX>t.minX?e.minX:t.minX,n=e.minY>t.minY?e.minY:t.minY,r=e.maxXc?r:c,this.maxY=o>h?o:h}}addBoundsMatrix(e,t){this.addFrameMatrix(t,e.minX,e.minY,e.maxX,e.maxY)}addBoundsArea(e,t){const i=e.minX>t.x?e.minX:t.x,n=e.minY>t.y?e.minY:t.y,r=e.maxXc?r:c,this.maxY=o>h?o:h}}pad(e=0,t=e){this.isEmpty()||(this.minX-=e,this.maxX+=e,this.minY-=t,this.maxY+=t)}addFramePad(e,t,i,n,r,o){e-=r,t-=o,i+=r,n+=o,this.minX=this.minXi?this.maxX:i,this.minY=this.minYn?this.maxY:n}}class Kt extends Rl{constructor(){super(),this.tempDisplayObjectParent=null,this.transform=new pp,this.alpha=1,this.visible=!0,this.renderable=!0,this.cullable=!1,this.cullArea=null,this.parent=null,this.worldAlpha=1,this._lastSortedIndex=0,this._zIndex=0,this.filterArea=null,this.filters=null,this._enabledFilters=null,this._bounds=new bl,this._localBounds=null,this._boundsID=0,this._boundsRect=null,this._localBoundsRect=null,this._mask=null,this._maskRefCount=0,this._destroyed=!1,this.isSprite=!1,this.isMask=!1}static mixin(e){const t=Object.keys(e);for(let i=0;i1)for(let t=0;tthis.children.length)throw new Error(`${e}addChildAt: The index ${t} supplied is out of bounds ${this.children.length}`);return e.parent&&e.parent.removeChild(e),e.parent=this,this.sortDirty=!0,e.transform._parentID=-1,this.children.splice(t,0,e),this._boundsID++,this.onChildrenChange(t),e.emit("added",this),this.emit("childAdded",e,this,t),e}swapChildren(e,t){if(e===t)return;const i=this.getChildIndex(e),n=this.getChildIndex(t);this.children[i]=t,this.children[n]=e,this.onChildrenChange(i=this.children.length)throw new Error(`The index ${t} supplied is out of bounds ${this.children.length}`);const i=this.getChildIndex(e);Jo(this.children,i,1),this.children.splice(t,0,e),this.onChildrenChange(t)}getChildAt(e){if(e<0||e>=this.children.length)throw new Error(`getChildAt: Index (${e}) does not exist.`);return this.children[e]}removeChild(...e){if(e.length>1)for(let t=0;t0&&r<=n){o=this.children.splice(i,r);for(let a=0;a1&&this.children.sort(_E),this.sortDirty=!1}updateTransform(){this.sortableChildren&&this.sortDirty&&this.sortChildren(),this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha;for(let e=0,t=this.children.length;e0&&t.height>0))return;let i,n;this.cullArea?(i=this.cullArea,n=this.worldTransform):this._render!==sm.prototype._render&&(i=this.getBounds(!0));const r=e.projection.transform;if(r&&(n?(n=TE.copyFrom(n),n.prepend(r)):n=r),i&&t.intersects(i,n))this._render(e);else if(this.cullArea)return;for(let o=0,a=this.children.length;o=n&&La.x=r&&La.y=t&&(o=s-a-1),l=l.replace("%value%",e[o].toString()),n+=l,n+=` -`}return i=i.replace("%blur%",n),i=i.replace("%size%",s.toString()),i}const FE=` - attribute vec2 aVertexPosition; - - uniform mat3 projectionMatrix; - - uniform float strength; - - varying vec2 vBlurTexCoords[%size%]; - - uniform vec4 inputSize; - uniform vec4 outputFrame; - - vec4 filterVertexPosition( void ) - { - vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy; - - return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0); - } - - vec2 filterTextureCoord( void ) - { - return aVertexPosition * (outputFrame.zw * inputSize.zw); - } - - void main(void) - { - gl_Position = filterVertexPosition(); - - vec2 textureCoord = filterTextureCoord(); - %blur% - }`;function OE(s,e){const t=Math.ceil(s/2);let i=FE,n="",r;e?r="vBlurTexCoords[%index%] = textureCoord + vec2(%sampleIndex% * strength, 0.0);":r="vBlurTexCoords[%index%] = textureCoord + vec2(0.0, %sampleIndex% * strength);";for(let o=0;o 0.0) { - c.rgb /= c.a; - } - - vec4 result; - - result.r = (m[0] * c.r); - result.r += (m[1] * c.g); - result.r += (m[2] * c.b); - result.r += (m[3] * c.a); - result.r += m[4]; - - result.g = (m[5] * c.r); - result.g += (m[6] * c.g); - result.g += (m[7] * c.b); - result.g += (m[8] * c.a); - result.g += m[9]; - - result.b = (m[10] * c.r); - result.b += (m[11] * c.g); - result.b += (m[12] * c.b); - result.b += (m[13] * c.a); - result.b += m[14]; - - result.a = (m[15] * c.r); - result.a += (m[16] * c.g); - result.a += (m[17] * c.b); - result.a += (m[18] * c.a); - result.a += m[19]; - - vec3 rgb = mix(c.rgb, result.rgb, uAlpha); - - // Premultiply alpha again. - rgb *= result.a; - - gl_FragColor = vec4(rgb, result.a); -} -`;class rm extends Vi{constructor(){const e={m:new Float32Array([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0]),uAlpha:1};super(jb,BE,e),this.alpha=1}_loadMatrix(e,t=!1){let i=e;t&&(this._multiply(i,this.uniforms.m,e),i=this._colorMatrix(i)),this.uniforms.m=i}_multiply(e,t,i){return e[0]=t[0]*i[0]+t[1]*i[5]+t[2]*i[10]+t[3]*i[15],e[1]=t[0]*i[1]+t[1]*i[6]+t[2]*i[11]+t[3]*i[16],e[2]=t[0]*i[2]+t[1]*i[7]+t[2]*i[12]+t[3]*i[17],e[3]=t[0]*i[3]+t[1]*i[8]+t[2]*i[13]+t[3]*i[18],e[4]=t[0]*i[4]+t[1]*i[9]+t[2]*i[14]+t[3]*i[19]+t[4],e[5]=t[5]*i[0]+t[6]*i[5]+t[7]*i[10]+t[8]*i[15],e[6]=t[5]*i[1]+t[6]*i[6]+t[7]*i[11]+t[8]*i[16],e[7]=t[5]*i[2]+t[6]*i[7]+t[7]*i[12]+t[8]*i[17],e[8]=t[5]*i[3]+t[6]*i[8]+t[7]*i[13]+t[8]*i[18],e[9]=t[5]*i[4]+t[6]*i[9]+t[7]*i[14]+t[8]*i[19]+t[9],e[10]=t[10]*i[0]+t[11]*i[5]+t[12]*i[10]+t[13]*i[15],e[11]=t[10]*i[1]+t[11]*i[6]+t[12]*i[11]+t[13]*i[16],e[12]=t[10]*i[2]+t[11]*i[7]+t[12]*i[12]+t[13]*i[17],e[13]=t[10]*i[3]+t[11]*i[8]+t[12]*i[13]+t[13]*i[18],e[14]=t[10]*i[4]+t[11]*i[9]+t[12]*i[14]+t[13]*i[19]+t[14],e[15]=t[15]*i[0]+t[16]*i[5]+t[17]*i[10]+t[18]*i[15],e[16]=t[15]*i[1]+t[16]*i[6]+t[17]*i[11]+t[18]*i[16],e[17]=t[15]*i[2]+t[16]*i[7]+t[17]*i[12]+t[18]*i[17],e[18]=t[15]*i[3]+t[16]*i[8]+t[17]*i[13]+t[18]*i[18],e[19]=t[15]*i[4]+t[16]*i[9]+t[17]*i[14]+t[18]*i[19]+t[19],e}_colorMatrix(e){const t=new Float32Array(e);return t[4]/=255,t[9]/=255,t[14]/=255,t[19]/=255,t}brightness(e,t){const i=[e,0,0,0,0,0,e,0,0,0,0,0,e,0,0,0,0,0,1,0];this._loadMatrix(i,t)}tint(e,t){const[i,n,r]=At.shared.setValue(e).toArray(),o=[i,0,0,0,0,0,n,0,0,0,0,0,r,0,0,0,0,0,1,0];this._loadMatrix(o,t)}greyscale(e,t){const i=[e,e,e,0,0,e,e,e,0,0,e,e,e,0,0,0,0,0,1,0];this._loadMatrix(i,t)}blackAndWhite(e){const t=[.3,.6,.1,0,0,.3,.6,.1,0,0,.3,.6,.1,0,0,0,0,0,1,0];this._loadMatrix(t,e)}hue(e,t){e=(e||0)/180*Math.PI;const i=Math.cos(e),n=Math.sin(e),r=Math.sqrt,o=1/3,a=r(o),l=i+(1-i)*o,c=o*(1-i)-a*n,h=o*(1-i)+a*n,u=o*(1-i)+a*n,d=i+o*(1-i),f=o*(1-i)-a*n,m=o*(1-i)-a*n,p=o*(1-i)+a*n,g=i+o*(1-i),x=[l,c,h,0,0,u,d,f,0,0,m,p,g,0,0,0,0,0,1,0];this._loadMatrix(x,t)}contrast(e,t){const i=(e||0)+1,n=-.5*(i-1),r=[i,0,0,0,n,0,i,0,0,n,0,0,i,0,n,0,0,0,1,0];this._loadMatrix(r,t)}saturate(e=0,t){const i=e*2/3+1,n=(i-1)*-.5,r=[i,n,n,0,0,n,i,n,0,0,n,n,i,0,0,0,0,0,1,0];this._loadMatrix(r,t)}desaturate(){this.saturate(-1)}negative(e){const t=[-1,0,0,1,0,0,-1,0,1,0,0,0,-1,1,0,0,0,0,1,0];this._loadMatrix(t,e)}sepia(e){const t=[.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0];this._loadMatrix(t,e)}technicolor(e){const t=[1.9125277891456083,-.8545344976951645,-.09155508482755585,0,11.793603434377337,-.3087833385928097,1.7658908555458428,-.10601743074722245,0,-70.35205161461398,-.231103377548616,-.7501899197440212,1.847597816108189,0,30.950940869491138,0,0,0,1,0];this._loadMatrix(t,e)}polaroid(e){const t=[1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0];this._loadMatrix(t,e)}toBGR(e){const t=[0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0];this._loadMatrix(t,e)}kodachrome(e){const t=[1.1285582396593525,-.3967382283601348,-.03992559172921793,0,63.72958762196502,-.16404339962244616,1.0835251566291304,-.05498805115633132,0,24.732407896706203,-.16786010706155763,-.5603416277695248,1.6014850761964943,0,35.62982807460946,0,0,0,1,0];this._loadMatrix(t,e)}browni(e){const t=[.5997023498159715,.34553243048391263,-.2708298674538042,0,47.43192855600873,-.037703249837783157,.8609577587992641,.15059552388459913,0,-36.96841498319127,.24113635128153335,-.07441037908422492,.44972182064877153,0,-7.562075277591283,0,0,0,1,0];this._loadMatrix(t,e)}vintage(e){const t=[.6279345635605994,.3202183420819367,-.03965408211312453,0,9.651285835294123,.02578397704808868,.6441188644374771,.03259127616149294,0,7.462829176470591,.0466055556782719,-.0851232987247891,.5241648018700465,0,5.159190588235296,0,0,0,1,0];this._loadMatrix(t,e)}colorTone(e,t,i,n,r){e=e||.2,t=t||.15,i=i||16770432,n=n||3375104;const o=At.shared,[a,l,c]=o.setValue(i).toArray(),[h,u,d]=o.setValue(n).toArray(),f=[.3,.59,.11,0,0,a,l,c,e,0,h,u,d,t,0,a-h,l-u,c-d,0,0];this._loadMatrix(f,r)}night(e,t){e=e||.1;const i=[e*-2,-e,0,0,0,-e,0,e,0,0,0,e,e*2,0,0,0,0,0,1,0];this._loadMatrix(i,t)}predator(e,t){const i=[11.224130630493164*e,-4.794486999511719*e,-2.8746118545532227*e,0*e,.40342438220977783*e,-3.6330697536468506*e,9.193157196044922*e,-2.951810836791992*e,0*e,-1.316135048866272*e,-3.2184197902679443*e,-4.2375030517578125*e,7.476448059082031*e,0*e,.8044459223747253*e,0,0,0,1,0];this._loadMatrix(i,t)}lsd(e){const t=[2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0];this._loadMatrix(t,e)}reset(){const e=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0];this._loadMatrix(e,!1)}get matrix(){return this.uniforms.m}set matrix(e){this.uniforms.m=e}get alpha(){return this.uniforms.uAlpha}set alpha(e){this.uniforms.uAlpha=e}}rm.prototype.grayscale=rm.prototype.greyscale;var NE=`varying vec2 vFilterCoord; -varying vec2 vTextureCoord; - -uniform vec2 scale; -uniform mat2 rotation; -uniform sampler2D uSampler; -uniform sampler2D mapSampler; - -uniform highp vec4 inputSize; -uniform vec4 inputClamp; - -void main(void) -{ - vec4 map = texture2D(mapSampler, vFilterCoord); - - map -= 0.5; - map.xy = scale * inputSize.zw * (rotation * map.xy); - - gl_FragColor = texture2D(uSampler, clamp(vec2(vTextureCoord.x + map.x, vTextureCoord.y + map.y), inputClamp.xy, inputClamp.zw)); -} -`,DE=`attribute vec2 aVertexPosition; - -uniform mat3 projectionMatrix; -uniform mat3 filterMatrix; - -varying vec2 vTextureCoord; -varying vec2 vFilterCoord; - -uniform vec4 inputSize; -uniform vec4 outputFrame; - -vec4 filterVertexPosition( void ) -{ - vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy; - - return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0); -} - -vec2 filterTextureCoord( void ) -{ - return aVertexPosition * (outputFrame.zw * inputSize.zw); -} - -void main(void) -{ - gl_Position = filterVertexPosition(); - vTextureCoord = filterTextureCoord(); - vFilterCoord = ( filterMatrix * vec3( vTextureCoord, 1.0) ).xy; -} -`;class UE extends Vi{constructor(e,t){const i=new Ft;e.renderable=!1,super(DE,NE,{mapSampler:e._texture,filterMatrix:i,scale:{x:1,y:1},rotation:new Float32Array([1,0,0,1])}),this.maskSprite=e,this.maskMatrix=i,t==null&&(t=20),this.scale=new St(t,t)}apply(e,t,i,n){this.uniforms.filterMatrix=e.calculateSpriteMatrix(this.maskMatrix,this.maskSprite),this.uniforms.scale.x=this.scale.x,this.uniforms.scale.y=this.scale.y;const r=this.maskSprite.worldTransform,o=Math.sqrt(r.a*r.a+r.b*r.b),a=Math.sqrt(r.c*r.c+r.d*r.d);o!==0&&a!==0&&(this.uniforms.rotation[0]=r.a/o,this.uniforms.rotation[1]=r.b/o,this.uniforms.rotation[2]=r.c/a,this.uniforms.rotation[3]=r.d/a),e.applyFilter(this,t,i,n)}get map(){return this.uniforms.mapSampler}set map(e){this.uniforms.mapSampler=e}}var $E=`varying vec2 v_rgbNW; -varying vec2 v_rgbNE; -varying vec2 v_rgbSW; -varying vec2 v_rgbSE; -varying vec2 v_rgbM; - -varying vec2 vFragCoord; -uniform sampler2D uSampler; -uniform highp vec4 inputSize; - - -/** - Basic FXAA implementation based on the code on geeks3d.com with the - modification that the texture2DLod stuff was removed since it's - unsupported by WebGL. - - -- - - From: - https://github.com/mitsuhiko/webgl-meincraft - - Copyright (c) 2011 by Armin Ronacher. - - Some rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - - * The names of the contributors may not be used to endorse or - promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef FXAA_REDUCE_MIN -#define FXAA_REDUCE_MIN (1.0/ 128.0) -#endif -#ifndef FXAA_REDUCE_MUL -#define FXAA_REDUCE_MUL (1.0 / 8.0) -#endif -#ifndef FXAA_SPAN_MAX -#define FXAA_SPAN_MAX 8.0 -#endif - -//optimized version for mobile, where dependent -//texture reads can be a bottleneck -vec4 fxaa(sampler2D tex, vec2 fragCoord, vec2 inverseVP, - vec2 v_rgbNW, vec2 v_rgbNE, - vec2 v_rgbSW, vec2 v_rgbSE, - vec2 v_rgbM) { - vec4 color; - vec3 rgbNW = texture2D(tex, v_rgbNW).xyz; - vec3 rgbNE = texture2D(tex, v_rgbNE).xyz; - vec3 rgbSW = texture2D(tex, v_rgbSW).xyz; - vec3 rgbSE = texture2D(tex, v_rgbSE).xyz; - vec4 texColor = texture2D(tex, v_rgbM); - vec3 rgbM = texColor.xyz; - vec3 luma = vec3(0.299, 0.587, 0.114); - float lumaNW = dot(rgbNW, luma); - float lumaNE = dot(rgbNE, luma); - float lumaSW = dot(rgbSW, luma); - float lumaSE = dot(rgbSE, luma); - float lumaM = dot(rgbM, luma); - float lumaMin = min(lumaM, min(min(lumaNW, lumaNE), min(lumaSW, lumaSE))); - float lumaMax = max(lumaM, max(max(lumaNW, lumaNE), max(lumaSW, lumaSE))); - - mediump vec2 dir; - dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE)); - dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE)); - - float dirReduce = max((lumaNW + lumaNE + lumaSW + lumaSE) * - (0.25 * FXAA_REDUCE_MUL), FXAA_REDUCE_MIN); - - float rcpDirMin = 1.0 / (min(abs(dir.x), abs(dir.y)) + dirReduce); - dir = min(vec2(FXAA_SPAN_MAX, FXAA_SPAN_MAX), - max(vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX), - dir * rcpDirMin)) * inverseVP; - - vec3 rgbA = 0.5 * ( - texture2D(tex, fragCoord * inverseVP + dir * (1.0 / 3.0 - 0.5)).xyz + - texture2D(tex, fragCoord * inverseVP + dir * (2.0 / 3.0 - 0.5)).xyz); - vec3 rgbB = rgbA * 0.5 + 0.25 * ( - texture2D(tex, fragCoord * inverseVP + dir * -0.5).xyz + - texture2D(tex, fragCoord * inverseVP + dir * 0.5).xyz); - - float lumaB = dot(rgbB, luma); - if ((lumaB < lumaMin) || (lumaB > lumaMax)) - color = vec4(rgbA, texColor.a); - else - color = vec4(rgbB, texColor.a); - return color; -} - -void main() { - - vec4 color; - - color = fxaa(uSampler, vFragCoord, inputSize.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM); - - gl_FragColor = color; -} -`,XE=` -attribute vec2 aVertexPosition; - -uniform mat3 projectionMatrix; - -varying vec2 v_rgbNW; -varying vec2 v_rgbNE; -varying vec2 v_rgbSW; -varying vec2 v_rgbSE; -varying vec2 v_rgbM; - -varying vec2 vFragCoord; - -uniform vec4 inputSize; -uniform vec4 outputFrame; - -vec4 filterVertexPosition( void ) -{ - vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy; - - return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0); -} - -void texcoords(vec2 fragCoord, vec2 inverseVP, - out vec2 v_rgbNW, out vec2 v_rgbNE, - out vec2 v_rgbSW, out vec2 v_rgbSE, - out vec2 v_rgbM) { - v_rgbNW = (fragCoord + vec2(-1.0, -1.0)) * inverseVP; - v_rgbNE = (fragCoord + vec2(1.0, -1.0)) * inverseVP; - v_rgbSW = (fragCoord + vec2(-1.0, 1.0)) * inverseVP; - v_rgbSE = (fragCoord + vec2(1.0, 1.0)) * inverseVP; - v_rgbM = vec2(fragCoord * inverseVP); -} - -void main(void) { - - gl_Position = filterVertexPosition(); - - vFragCoord = aVertexPosition * outputFrame.zw; - - texcoords(vFragCoord, inputSize.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM); -} -`;class VE extends Vi{constructor(){super(XE,$E)}}var YE=`precision highp float; - -varying vec2 vTextureCoord; -varying vec4 vColor; - -uniform float uNoise; -uniform float uSeed; -uniform sampler2D uSampler; - -float rand(vec2 co) -{ - return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453); -} - -void main() -{ - vec4 color = texture2D(uSampler, vTextureCoord); - float randomValue = rand(gl_FragCoord.xy * uSeed); - float diff = (randomValue - 0.5) * uNoise; - - // Un-premultiply alpha before applying the color matrix. See issue #3539. - if (color.a > 0.0) { - color.rgb /= color.a; - } - - color.r += diff; - color.g += diff; - color.b += diff; - - // Premultiply alpha again. - color.rgb *= color.a; - - gl_FragColor = color; -} -`;class GE extends Vi{constructor(e=.5,t=Math.random()){super(jb,YE,{uNoise:0,uSeed:0}),this.noise=e,this.seed=t}get noise(){return this.uniforms.uNoise}set noise(e){this.uniforms.uNoise=e}get seed(){return this.uniforms.uSeed}set seed(e){this.uniforms.uSeed=e}}const hv={AlphaFilter:IE,BlurFilter:LE,BlurFilterPass:nm,ColorMatrixFilter:rm,DisplacementFilter:UE,FXAAFilter:VE,NoiseFilter:GE};Object.entries(hv).forEach(([s,e])=>{Object.defineProperty(hv,s,{get(){return mt("7.1.0",`filters.${s} has moved to ${s}`),e}})});class jE{constructor(){this.interactionFrequency=10,this._deltaTime=0,this._didMove=!1,this.tickerAdded=!1,this._pauseUpdate=!0}init(e){this.removeTickerListener(),this.events=e,this.interactionFrequency=10,this._deltaTime=0,this._didMove=!1,this.tickerAdded=!1,this._pauseUpdate=!0}get pauseUpdate(){return this._pauseUpdate}set pauseUpdate(e){this._pauseUpdate=e}addTickerListener(){this.tickerAdded||!this.domElement||(Yi.system.add(this.tickerUpdate,this,uo.INTERACTION),this.tickerAdded=!0)}removeTickerListener(){this.tickerAdded&&(Yi.system.remove(this.tickerUpdate,this),this.tickerAdded=!1)}pointerMoved(){this._didMove=!0}update(){if(!this.domElement||this._pauseUpdate)return;if(this._didMove){this._didMove=!1;return}const e=this.events.rootPointerEvent;this.events.supportsTouchEvents&&e.pointerType==="touch"||globalThis.document.dispatchEvent(new PointerEvent("pointermove",{clientX:e.clientX,clientY:e.clientY}))}tickerUpdate(e){this._deltaTime+=e,!(this._deltaTimei.priority-n.priority)}dispatchEvent(e,t){e.propagationStopped=!1,e.propagationImmediatelyStopped=!1,this.propagate(e,t),this.dispatch.emit(t||e.type,e)}mapEvent(e){if(!this.rootTarget)return;const t=this.mappingTable[e.type];if(t)for(let i=0,n=t.length;i=0;n--)if(e.currentTarget=i[n],this.notifyTarget(e,t),e.propagationStopped||e.propagationImmediatelyStopped)return}}all(e,t,i=this._allInteractiveElements){if(i.length===0)return;e.eventPhase=e.BUBBLING_PHASE;const n=Array.isArray(t)?t:[t];for(let r=i.length-1;r>=0;r--)n.forEach(o=>{e.currentTarget=i[r],this.notifyTarget(e,o)})}propagationPath(e){const t=[e];for(let i=0;i=0;u--){const d=h[u],f=this.hitTestMoveRecursive(d,this._isInteractive(t)?t:d.eventMode,i,n,r,o||r(e,i));if(f){if(f.length>0&&!f[f.length-1].parent)continue;const m=e.isInteractive();(f.length>0||m)&&(m&&this._allInteractiveElements.push(e),f.push(e)),this._hitElements.length===0&&(this._hitElements=f),a=!0}}}const l=this._isInteractive(t),c=e.isInteractive();return l&&c&&this._allInteractiveElements.push(e),o||this._hitElements.length>0?null:a?this._hitElements:l&&!r(e,i)&&n(e,i)?c?[e]:[]:null}hitTestRecursive(e,t,i,n,r){if(this._interactivePrune(e)||r(e,i))return null;if((e.eventMode==="dynamic"||t==="dynamic")&&(mr.pauseUpdate=!1),e.interactiveChildren&&e.children){const l=e.children;for(let c=l.length-1;c>=0;c--){const h=l[c],u=this.hitTestRecursive(h,this._isInteractive(t)?t:h.eventMode,i,n,r);if(u){if(u.length>0&&!u[u.length-1].parent)continue;const d=e.isInteractive();return(u.length>0||d)&&u.push(e),u}}}const o=this._isInteractive(t),a=e.isInteractive();return o&&n(e,i)?a?[e]:[]:null}_isInteractive(e){return e==="static"||e==="dynamic"}_interactivePrune(e){return!!(!e||e.isMask||!e.visible||!e.renderable||e.eventMode==="none"||e.eventMode==="passive"&&!e.interactiveChildren||e.isMask)}hitPruneFn(e,t){var i;if(e.hitArea&&(e.worldTransform.applyInverse(t,qd),!e.hitArea.contains(qd.x,qd.y)))return!0;if(e._mask){const n=e._mask.isMaskData?e._mask.maskObject:e._mask;if(n&&!((i=n.containsPoint)!=null&&i.call(n,t)))return!0}return!1}hitTestFn(e,t){return e.eventMode==="passive"?!1:e.hitArea?!0:e.containsPoint?e.containsPoint(t):!1}notifyTarget(e,t){var r,o;t=t??e.type;const i=`on${t}`;(o=(r=e.currentTarget)[i])==null||o.call(r,e);const n=e.eventPhase===e.CAPTURING_PHASE||e.eventPhase===e.AT_TARGET?`${t}capture`:t;this.notifyListeners(e,n),e.eventPhase===e.AT_TARGET&&this.notifyListeners(e,t)}mapPointerDown(e){if(!(e instanceof Cs)){console.warn("EventBoundary cannot map a non-pointer event as a pointer event");return}const t=this.createPointerEvent(e);if(this.dispatchEvent(t,"pointerdown"),t.pointerType==="touch")this.dispatchEvent(t,"touchstart");else if(t.pointerType==="mouse"||t.pointerType==="pen"){const n=t.button===2;this.dispatchEvent(t,n?"rightdown":"mousedown")}const i=this.trackingData(e.pointerId);i.pressTargetsByButton[e.button]=t.composedPath(),this.freeEvent(t)}mapPointerMove(e){var l,c;if(!(e instanceof Cs)){console.warn("EventBoundary cannot map a non-pointer event as a pointer event");return}this._allInteractiveElements.length=0,this._hitElements.length=0,this._isPointerMoveEvent=!0;const t=this.createPointerEvent(e);this._isPointerMoveEvent=!1;const i=t.pointerType==="mouse"||t.pointerType==="pen",n=this.trackingData(e.pointerId),r=this.findMountedTarget(n.overTargets);if(((l=n.overTargets)==null?void 0:l.length)>0&&r!==t.target){const h=e.type==="mousemove"?"mouseout":"pointerout",u=this.createPointerEvent(e,h,r);if(this.dispatchEvent(u,"pointerout"),i&&this.dispatchEvent(u,"mouseout"),!t.composedPath().includes(r)){const d=this.createPointerEvent(e,"pointerleave",r);for(d.eventPhase=d.AT_TARGET;d.target&&!t.composedPath().includes(d.target);)d.currentTarget=d.target,this.notifyTarget(d),i&&this.notifyTarget(d,"mouseleave"),d.target=d.target.parent;this.freeEvent(d)}this.freeEvent(u)}if(r!==t.target){const h=e.type==="mousemove"?"mouseover":"pointerover",u=this.clonePointerEvent(t,h);this.dispatchEvent(u,"pointerover"),i&&this.dispatchEvent(u,"mouseover");let d=r==null?void 0:r.parent;for(;d&&d!==this.rootTarget.parent&&d!==t.target;)d=d.parent;if(!d||d===this.rootTarget.parent){const f=this.clonePointerEvent(t,"pointerenter");for(f.eventPhase=f.AT_TARGET;f.target&&f.target!==r&&f.target!==this.rootTarget.parent;)f.currentTarget=f.target,this.notifyTarget(f),i&&this.notifyTarget(f,"mouseenter"),f.target=f.target.parent;this.freeEvent(f)}this.freeEvent(u)}const o=[],a=this.enableGlobalMoveEvents??!0;this.moveOnAll?o.push("pointermove"):this.dispatchEvent(t,"pointermove"),a&&o.push("globalpointermove"),t.pointerType==="touch"&&(this.moveOnAll?o.splice(1,0,"touchmove"):this.dispatchEvent(t,"touchmove"),a&&o.push("globaltouchmove")),i&&(this.moveOnAll?o.splice(1,0,"mousemove"):this.dispatchEvent(t,"mousemove"),a&&o.push("globalmousemove"),this.cursor=(c=t.target)==null?void 0:c.cursor),o.length>0&&this.all(t,o),this._allInteractiveElements.length=0,this._hitElements.length=0,n.overTargets=t.composedPath(),this.freeEvent(t)}mapPointerOver(e){var o;if(!(e instanceof Cs)){console.warn("EventBoundary cannot map a non-pointer event as a pointer event");return}const t=this.trackingData(e.pointerId),i=this.createPointerEvent(e),n=i.pointerType==="mouse"||i.pointerType==="pen";this.dispatchEvent(i,"pointerover"),n&&this.dispatchEvent(i,"mouseover"),i.pointerType==="mouse"&&(this.cursor=(o=i.target)==null?void 0:o.cursor);const r=this.clonePointerEvent(i,"pointerenter");for(r.eventPhase=r.AT_TARGET;r.target&&r.target!==this.rootTarget.parent;)r.currentTarget=r.target,this.notifyTarget(r),n&&this.notifyTarget(r,"mouseenter"),r.target=r.target.parent;t.overTargets=i.composedPath(),this.freeEvent(i),this.freeEvent(r)}mapPointerOut(e){if(!(e instanceof Cs)){console.warn("EventBoundary cannot map a non-pointer event as a pointer event");return}const t=this.trackingData(e.pointerId);if(t.overTargets){const i=e.pointerType==="mouse"||e.pointerType==="pen",n=this.findMountedTarget(t.overTargets),r=this.createPointerEvent(e,"pointerout",n);this.dispatchEvent(r),i&&this.dispatchEvent(r,"mouseout");const o=this.createPointerEvent(e,"pointerleave",n);for(o.eventPhase=o.AT_TARGET;o.target&&o.target!==this.rootTarget.parent;)o.currentTarget=o.target,this.notifyTarget(o),i&&this.notifyTarget(o,"mouseleave"),o.target=o.target.parent;t.overTargets=null,this.freeEvent(r),this.freeEvent(o)}this.cursor=null}mapPointerUp(e){if(!(e instanceof Cs)){console.warn("EventBoundary cannot map a non-pointer event as a pointer event");return}const t=performance.now(),i=this.createPointerEvent(e);if(this.dispatchEvent(i,"pointerup"),i.pointerType==="touch")this.dispatchEvent(i,"touchend");else if(i.pointerType==="mouse"||i.pointerType==="pen"){const a=i.button===2;this.dispatchEvent(i,a?"rightup":"mouseup")}const n=this.trackingData(e.pointerId),r=this.findMountedTarget(n.pressTargetsByButton[e.button]);let o=r;if(r&&!i.composedPath().includes(r)){let a=r;for(;a&&!i.composedPath().includes(a);){if(i.currentTarget=a,this.notifyTarget(i,"pointerupoutside"),i.pointerType==="touch")this.notifyTarget(i,"touchendoutside");else if(i.pointerType==="mouse"||i.pointerType==="pen"){const l=i.button===2;this.notifyTarget(i,l?"rightupoutside":"mouseupoutside")}a=a.parent}delete n.pressTargetsByButton[e.button],o=a}if(o){const a=this.clonePointerEvent(i,"click");a.target=o,a.path=null,n.clicksByButton[e.button]||(n.clicksByButton[e.button]={clickCount:0,target:a.target,timeStamp:t});const l=n.clicksByButton[e.button];if(l.target===a.target&&t-l.timeStamp<200?++l.clickCount:l.clickCount=1,l.target=a.target,l.timeStamp=t,a.detail=l.clickCount,a.pointerType==="mouse"){const c=a.button===2;this.dispatchEvent(a,c?"rightclick":"click")}else a.pointerType==="touch"&&this.dispatchEvent(a,"tap");this.dispatchEvent(a,"pointertap"),this.freeEvent(a)}this.freeEvent(i)}mapPointerUpOutside(e){if(!(e instanceof Cs)){console.warn("EventBoundary cannot map a non-pointer event as a pointer event");return}const t=this.trackingData(e.pointerId),i=this.findMountedTarget(t.pressTargetsByButton[e.button]),n=this.createPointerEvent(e);if(i){let r=i;for(;r;)n.currentTarget=r,this.notifyTarget(n,"pointerupoutside"),n.pointerType==="touch"?this.notifyTarget(n,"touchendoutside"):(n.pointerType==="mouse"||n.pointerType==="pen")&&this.notifyTarget(n,n.button===2?"rightupoutside":"mouseupoutside"),r=r.parent;delete t.pressTargetsByButton[e.button]}this.freeEvent(n)}mapWheel(e){if(!(e instanceof ea)){console.warn("EventBoundary cannot map a non-wheel event as a wheel event");return}const t=this.createWheelEvent(e);this.dispatchEvent(t),this.freeEvent(t)}findMountedTarget(e){if(!e)return null;let t=e[0];for(let i=1;i(i==="globalMove"&&(this.rootBoundary.enableGlobalMoveEvents=n),t[i]=n,!0)}),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onPointerOverOut=this.onPointerOverOut.bind(this),this.onWheel=this.onWheel.bind(this)}static get defaultEventMode(){return this._defaultEventMode}init(e){const{view:t,resolution:i}=this.renderer;this.setTargetElement(t),this.resolution=i,am._defaultEventMode=e.eventMode??"auto",Object.assign(this.features,e.eventFeatures??{}),this.rootBoundary.enableGlobalMoveEvents=this.features.globalMove}resolutionChange(e){this.resolution=e}destroy(){this.setTargetElement(null),this.renderer=null}setCursor(e){e=e||"default";let t=!0;if(globalThis.OffscreenCanvas&&this.domElement instanceof OffscreenCanvas&&(t=!1),this.currentCursor===e)return;this.currentCursor=e;const i=this.cursorStyles[e];if(i)switch(typeof i){case"string":t&&(this.domElement.style.cursor=i);break;case"function":i(e);break;case"object":t&&Object.assign(this.domElement.style,i);break}else t&&typeof e=="string"&&!Object.prototype.hasOwnProperty.call(this.cursorStyles,e)&&(this.domElement.style.cursor=e)}get pointer(){return this.rootPointerEvent}onPointerDown(e){if(!this.features.click)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered;const t=this.normalizeToPointerData(e);this.autoPreventDefault&&t[0].isNormalized&&(e.cancelable||!("cancelable"in e))&&e.preventDefault();for(let i=0,n=t.length;i0&&(t=e.composedPath()[0]);const i=t!==this.domElement?"outside":"",n=this.normalizeToPointerData(e);for(let r=0,o=n.length;r"u"&&(r.button=0),typeof r.buttons>"u"&&(r.buttons=1),typeof r.isPrimary>"u"&&(r.isPrimary=e.touches.length===1&&e.type==="touchstart"),typeof r.width>"u"&&(r.width=r.radiusX||1),typeof r.height>"u"&&(r.height=r.radiusY||1),typeof r.tiltX>"u"&&(r.tiltX=0),typeof r.tiltY>"u"&&(r.tiltY=0),typeof r.pointerType>"u"&&(r.pointerType="touch"),typeof r.pointerId>"u"&&(r.pointerId=r.identifier||0),typeof r.pressure>"u"&&(r.pressure=r.force||.5),typeof r.twist>"u"&&(r.twist=0),typeof r.tangentialPressure>"u"&&(r.tangentialPressure=0),typeof r.layerX>"u"&&(r.layerX=r.offsetX=r.clientX),typeof r.layerY>"u"&&(r.layerY=r.offsetY=r.clientY),r.isNormalized=!0,r.type=e.type,t.push(r)}else if(!globalThis.MouseEvent||e instanceof MouseEvent&&(!this.supportsPointerEvents||!(e instanceof globalThis.PointerEvent))){const i=e;typeof i.isPrimary>"u"&&(i.isPrimary=!0),typeof i.width>"u"&&(i.width=1),typeof i.height>"u"&&(i.height=1),typeof i.tiltX>"u"&&(i.tiltX=0),typeof i.tiltY>"u"&&(i.tiltY=0),typeof i.pointerType>"u"&&(i.pointerType="mouse"),typeof i.pointerId>"u"&&(i.pointerId=qE),typeof i.pressure>"u"&&(i.pressure=.5),typeof i.twist>"u"&&(i.twist=0),typeof i.tangentialPressure>"u"&&(i.tangentialPressure=0),i.isNormalized=!0,t.push(i)}else t.push(e);return t}normalizeWheelEvent(e){const t=this.rootWheelEvent;return this.transferMouseData(t,e),t.deltaX=e.deltaX,t.deltaY=e.deltaY,t.deltaZ=e.deltaZ,t.deltaMode=e.deltaMode,this.mapPositionToPoint(t.screen,e.clientX,e.clientY),t.global.copyFrom(t.screen),t.offset.copyFrom(t.screen),t.nativeEvent=e,t.type=e.type,t}bootstrapEvent(e,t){return e.originalEvent=null,e.nativeEvent=t,e.pointerId=t.pointerId,e.width=t.width,e.height=t.height,e.isPrimary=t.isPrimary,e.pointerType=t.pointerType,e.pressure=t.pressure,e.tangentialPressure=t.tangentialPressure,e.tiltX=t.tiltX,e.tiltY=t.tiltY,e.twist=t.twist,this.transferMouseData(e,t),this.mapPositionToPoint(e.screen,t.clientX,t.clientY),e.global.copyFrom(e.screen),e.offset.copyFrom(e.screen),e.isTrusted=t.isTrusted,e.type==="pointerleave"&&(e.type="pointerout"),e.type.startsWith("mouse")&&(e.type=e.type.replace("mouse","pointer")),e.type.startsWith("touch")&&(e.type=KE[e.type]||e.type),e}transferMouseData(e,t){e.isTrusted=t.isTrusted,e.srcElement=t.srcElement,e.timeStamp=performance.now(),e.type=t.type,e.altKey=t.altKey,e.button=t.button,e.buttons=t.buttons,e.client.x=t.clientX,e.client.y=t.clientY,e.ctrlKey=t.ctrlKey,e.metaKey=t.metaKey,e.movement.x=t.movementX,e.movement.y=t.movementY,e.page.x=t.pageX,e.page.y=t.pageY,e.relatedTarget=null,e.shiftKey=t.shiftKey}};om.extension={name:"events",type:[ke.RendererSystem,ke.CanvasRendererSystem]},om.defaultEventFeatures={move:!0,globalMove:!0,click:!0,wheel:!0};let lm=om;$e.add(lm);function uv(s){return s==="dynamic"||s==="static"}const ZE={onclick:null,onmousedown:null,onmouseenter:null,onmouseleave:null,onmousemove:null,onglobalmousemove:null,onmouseout:null,onmouseover:null,onmouseup:null,onmouseupoutside:null,onpointercancel:null,onpointerdown:null,onpointerenter:null,onpointerleave:null,onpointermove:null,onglobalpointermove:null,onpointerout:null,onpointerover:null,onpointertap:null,onpointerup:null,onpointerupoutside:null,onrightclick:null,onrightdown:null,onrightup:null,onrightupoutside:null,ontap:null,ontouchcancel:null,ontouchend:null,ontouchendoutside:null,ontouchmove:null,onglobaltouchmove:null,ontouchstart:null,onwheel:null,_internalInteractive:void 0,get interactive(){return this._internalInteractive??uv(lm.defaultEventMode)},set interactive(s){mt("7.2.0","Setting interactive is deprecated, use eventMode = 'none'/'passive'/'auto'/'static'/'dynamic' instead."),this._internalInteractive=s,this.eventMode=s?"static":"auto"},_internalEventMode:void 0,get eventMode(){return this._internalEventMode??lm.defaultEventMode},set eventMode(s){this._internalInteractive=uv(s),this._internalEventMode=s},isInteractive(){return this.eventMode==="static"||this.eventMode==="dynamic"},interactiveChildren:!0,hitArea:null,addEventListener(s,e,t){const i=typeof t=="boolean"&&t||typeof t=="object"&&t.capture,n=typeof t=="object"?t.signal:void 0,r=typeof t=="object"?t.once===!0:!1,o=typeof e=="function"?void 0:e;s=i?`${s}capture`:s;const a=typeof e=="function"?e:e.handleEvent,l=this;n&&n.addEventListener("abort",()=>{l.off(s,a,o)}),r?l.once(s,a,o):l.on(s,a,o)},removeEventListener(s,e,t){const i=typeof t=="boolean"&&t||typeof t=="object"&&t.capture,n=typeof e=="function"?void 0:e;s=i?`${s}capture`:s,e=typeof e=="function"?e:e.handleEvent,this.off(s,e,n)},dispatchEvent(s){if(!(s instanceof Pl))throw new Error("DisplayObject cannot propagate events outside of the Federated Events API");return s.defaultPrevented=!1,s.path=null,s.target=this,s.manager.dispatchEvent(s),!s.defaultPrevented}};Kt.mixin(ZE);const JE={accessible:!1,accessibleTitle:null,accessibleHint:null,tabIndex:0,_accessibleActive:!1,_accessibleDiv:null,accessibleType:"button",accessiblePointerEvents:"auto",accessibleChildren:!0,renderId:-1};Kt.mixin(JE);const QE=9,nc=100,eA=0,tA=0,dv=2,fv=1,iA=-1e3,sA=-1e3,nA=2;class e1{constructor(e){this.debug=!1,this._isActive=!1,this._isMobileAccessibility=!1,this.pool=[],this.renderId=0,this.children=[],this.androidUpdateCount=0,this.androidUpdateFrequency=500,this._hookDiv=null,(kn.tablet||kn.phone)&&this.createTouchHook();const t=document.createElement("div");t.style.width=`${nc}px`,t.style.height=`${nc}px`,t.style.position="absolute",t.style.top=`${eA}px`,t.style.left=`${tA}px`,t.style.zIndex=dv.toString(),this.div=t,this.renderer=e,this._onKeyDown=this._onKeyDown.bind(this),this._onMouseMove=this._onMouseMove.bind(this),globalThis.addEventListener("keydown",this._onKeyDown,!1)}get isActive(){return this._isActive}get isMobileAccessibility(){return this._isMobileAccessibility}createTouchHook(){const e=document.createElement("button");e.style.width=`${fv}px`,e.style.height=`${fv}px`,e.style.position="absolute",e.style.top=`${iA}px`,e.style.left=`${sA}px`,e.style.zIndex=nA.toString(),e.style.backgroundColor="#FF0000",e.title="select to enable accessibility for this content",e.addEventListener("focus",()=>{this._isMobileAccessibility=!0,this.activate(),this.destroyTouchHook()}),document.body.appendChild(e),this._hookDiv=e}destroyTouchHook(){this._hookDiv&&(document.body.removeChild(this._hookDiv),this._hookDiv=null)}activate(){var e;this._isActive||(this._isActive=!0,globalThis.document.addEventListener("mousemove",this._onMouseMove,!0),globalThis.removeEventListener("keydown",this._onKeyDown,!1),this.renderer.on("postrender",this.update,this),(e=this.renderer.view.parentNode)==null||e.appendChild(this.div))}deactivate(){var e;!this._isActive||this._isMobileAccessibility||(this._isActive=!1,globalThis.document.removeEventListener("mousemove",this._onMouseMove,!0),globalThis.addEventListener("keydown",this._onKeyDown,!1),this.renderer.off("postrender",this.update),(e=this.div.parentNode)==null||e.removeChild(this.div))}updateAccessibleObjects(e){if(!e.visible||!e.accessibleChildren)return;e.accessible&&e.isInteractive()&&(e._accessibleActive||this.addChild(e),e.renderId=this.renderId);const t=e.children;if(t)for(let i=0;i title : ${e.title}
tabIndex: ${e.tabIndex}`}capHitArea(e){e.x<0&&(e.width+=e.x,e.x=0),e.y<0&&(e.height+=e.y,e.y=0);const{width:t,height:i}=this.renderer;e.x+e.width>t&&(e.width=t-e.x),e.y+e.height>i&&(e.height=i-e.y)}addChild(e){let t=this.pool.pop();t||(t=document.createElement("button"),t.style.width=`${nc}px`,t.style.height=`${nc}px`,t.style.backgroundColor=this.debug?"rgba(255,255,255,0.5)":"transparent",t.style.position="absolute",t.style.zIndex=dv.toString(),t.style.borderStyle="none",navigator.userAgent.toLowerCase().includes("chrome")?t.setAttribute("aria-live","off"):t.setAttribute("aria-live","polite"),navigator.userAgent.match(/rv:.*Gecko\//)?t.setAttribute("aria-relevant","additions"):t.setAttribute("aria-relevant","text"),t.addEventListener("click",this._onClick.bind(this)),t.addEventListener("focus",this._onFocus.bind(this)),t.addEventListener("focusout",this._onFocusOut.bind(this))),t.style.pointerEvents=e.accessiblePointerEvents,t.type=e.accessibleType,e.accessibleTitle&&e.accessibleTitle!==null?t.title=e.accessibleTitle:(!e.accessibleHint||e.accessibleHint===null)&&(t.title=`displayObject ${e.tabIndex}`),e.accessibleHint&&e.accessibleHint!==null&&t.setAttribute("aria-label",e.accessibleHint),this.debug&&this.updateDebugHTML(t),e._accessibleActive=!0,e._accessibleDiv=t,t.displayObject=e,this.children.push(e),this.div.appendChild(e._accessibleDiv),e._accessibleDiv.tabIndex=e.tabIndex}_dispatchEvent(e,t){const{displayObject:i}=e.target,n=this.renderer.events.rootBoundary,r=Object.assign(new Pl(n),{target:i});n.rootTarget=this.renderer.lastObjectRendered,t.forEach(o=>n.dispatchEvent(r,o))}_onClick(e){this._dispatchEvent(e,["click","pointertap","tap"])}_onFocus(e){e.target.getAttribute("aria-live")||e.target.setAttribute("aria-live","assertive"),this._dispatchEvent(e,["mouseover"])}_onFocusOut(e){e.target.getAttribute("aria-live")||e.target.setAttribute("aria-live","polite"),this._dispatchEvent(e,["mouseout"])}_onKeyDown(e){e.keyCode===QE&&this.activate()}_onMouseMove(e){e.movementX===0&&e.movementY===0||this.deactivate()}destroy(){this.destroyTouchHook(),this.div=null,globalThis.document.removeEventListener("mousemove",this._onMouseMove,!0),globalThis.removeEventListener("keydown",this._onKeyDown),this.pool=null,this.children=null,this.renderer=null}}e1.extension={name:"accessibility",type:[ke.RendererPlugin,ke.CanvasRendererPlugin]};$e.add(e1);const t1=class cm{constructor(e){this.stage=new gi,e=Object.assign({forceCanvas:!1},e),this.renderer=mE(e),cm._plugins.forEach(t=>{t.init.call(this,e)})}render(){this.renderer.render(this.stage)}get view(){var e;return(e=this.renderer)==null?void 0:e.view}get screen(){var e;return(e=this.renderer)==null?void 0:e.screen}destroy(e,t){const i=cm._plugins.slice(0);i.reverse(),i.forEach(n=>{n.destroy.call(this)}),this.stage.destroy(t),this.stage=null,this.renderer.destroy(e),this.renderer=null}};t1._plugins=[];let i1=t1;$e.handleByList(ke.Application,i1._plugins);class s1{static init(e){Object.defineProperty(this,"resizeTo",{set(t){globalThis.removeEventListener("resize",this.queueResize),this._resizeTo=t,t&&(globalThis.addEventListener("resize",this.queueResize),this.resize())},get(){return this._resizeTo}}),this.queueResize=()=>{this._resizeTo&&(this.cancelResize(),this._resizeId=requestAnimationFrame(()=>this.resize()))},this.cancelResize=()=>{this._resizeId&&(cancelAnimationFrame(this._resizeId),this._resizeId=null)},this.resize=()=>{if(!this._resizeTo)return;this.cancelResize();let t,i;if(this._resizeTo===globalThis.window)t=globalThis.innerWidth,i=globalThis.innerHeight;else{const{clientWidth:n,clientHeight:r}=this._resizeTo;t=n,i=r}this.renderer.resize(t,i),this.render()},this._resizeId=null,this._resizeTo=null,this.resizeTo=e.resizeTo||null}static destroy(){globalThis.removeEventListener("resize",this.queueResize),this.cancelResize(),this.cancelResize=null,this.queueResize=null,this.resizeTo=null,this.resize=null}}s1.extension=ke.Application;$e.add(s1);const mv={loader:ke.LoadParser,resolver:ke.ResolveParser,cache:ke.CacheParser,detection:ke.DetectionParser};$e.handle(ke.Asset,s=>{const e=s.ref;Object.entries(mv).filter(([t])=>!!e[t]).forEach(([t,i])=>$e.add(Object.assign(e[t],{extension:e[t].extension??i})))},s=>{const e=s.ref;Object.keys(mv).filter(t=>!!e[t]).forEach(t=>$e.remove(e[t]))});class rA{constructor(e,t=!1){this._loader=e,this._assetList=[],this._isLoading=!1,this._maxConcurrent=1,this.verbose=t}add(e){e.forEach(t=>{this._assetList.push(t)}),this.verbose&&console.log("[BackgroundLoader] assets: ",this._assetList),this._isActive&&!this._isLoading&&this._next()}async _next(){if(this._assetList.length&&this._isActive){this._isLoading=!0;const e=[],t=Math.min(this._assetList.length,this._maxConcurrent);for(let i=0;i(Array.isArray(s)||(s=[s]),e?s.map(i=>typeof i=="string"||t?e(i):i):s),hh=(s,e)=>{const t=e.split("?")[1];return t&&(s+=`?${t}`),s};function n1(s,e,t,i,n){const r=e[t];for(let o=0;o{const o=r.substring(1,r.length-1).split(",");n.push(o)}),n1(s,n,0,t,i)}else i.push(s);return i}const uh=s=>!Array.isArray(s);class aA{constructor(){this._parsers=[],this._cache=new Map,this._cacheMap=new Map}reset(){this._cacheMap.clear(),this._cache.clear()}has(e){return this._cache.has(e)}get(e){const t=this._cache.get(e);return t||console.warn(`[Assets] Asset id ${e} was not found in the Cache`),t}set(e,t){const i=As(e);let n;for(let a=0;a{n[a]=t}));const r=Object.keys(n),o={cacheKeys:r,keys:i};if(i.forEach(a=>{this._cacheMap.set(a,o)}),r.forEach(a=>{const l=n?n[a]:t;this._cache.has(a)&&this._cache.get(a)!==l&&console.warn("[Cache] already has key:",a),this._cache.set(a,n[a])}),t instanceof Ke){const a=t;i.forEach(l=>{a.baseTexture!==Ke.EMPTY.baseTexture&&tt.addToCache(a.baseTexture,l),Ke.addToCache(a,l)})}}remove(e){if(!this._cacheMap.has(e)){console.warn(`[Assets] Asset id ${e} was not found in the Cache`);return}const t=this._cacheMap.get(e);t.cacheKeys.forEach(i=>{this._cache.delete(i)}),t.keys.forEach(i=>{this._cacheMap.delete(i)})}get parsers(){return this._parsers}}const qr=new aA;class lA{constructor(){this._parsers=[],this._parsersValidated=!1,this.parsers=new Proxy(this._parsers,{set:(e,t,i)=>(this._parsersValidated=!1,e[t]=i,!0)}),this.promiseCache={}}reset(){this._parsersValidated=!1,this.promiseCache={}}_getLoadPromiseAndParser(e,t){const i={promise:null,parser:null};return i.promise=(async()=>{var o,a;let n=null,r=null;if(t.loadParser&&(r=this._parserHash[t.loadParser],r||console.warn(`[Assets] specified load parser "${t.loadParser}" not found while loading ${e}`)),!r){for(let l=0;l({alias:[c],src:c})),a=o.length,l=o.map(async c=>{const h=si.toAbsolute(c.src);if(!n[c.src])try{this.promiseCache[h]||(this.promiseCache[h]=this._getLoadPromiseAndParser(h,c)),n[c.src]=await this.promiseCache[h].promise,t&&t(++i/a)}catch(u){throw delete this.promiseCache[h],delete n[c.src],new Error(`[Loader.load] Failed to load ${h}. -${u}`)}});return await Promise.all(l),r?n[o[0].src]:n}async unload(e){const t=As(e,i=>({alias:[i],src:i})).map(async i=>{var o,a;const n=si.toAbsolute(i.src),r=this.promiseCache[n];if(r){const l=await r.promise;delete this.promiseCache[n],(a=(o=r.parser)==null?void 0:o.unload)==null||a.call(o,l,i,this)}});await Promise.all(t)}_validateParsers(){this._parsersValidated=!0,this._parserHash=this._parsers.filter(e=>e.name).reduce((e,t)=>(e[t.name]&&console.warn(`[Assets] loadParser name conflict "${t.name}"`),{...e,[t.name]:t}),{})}}var os=(s=>(s[s.Low=0]="Low",s[s.Normal=1]="Normal",s[s.High=2]="High",s))(os||{});const cA=".json",hA="application/json",uA={extension:{type:ke.LoadParser,priority:os.Low},name:"loadJson",test(s){return xa(s,hA)||Ki(s,cA)},async load(s){return await(await Be.ADAPTER.fetch(s)).json()}};$e.add(uA);const dA=".txt",fA="text/plain",mA={name:"loadTxt",extension:{type:ke.LoadParser,priority:os.Low},test(s){return xa(s,fA)||Ki(s,dA)},async load(s){return await(await Be.ADAPTER.fetch(s)).text()}};$e.add(mA);const pA=["normal","bold","100","200","300","400","500","600","700","800","900"],gA=[".ttf",".otf",".woff",".woff2"],vA=["font/ttf","font/otf","font/woff","font/woff2"],yA=/^(--|-?[A-Z_])[0-9A-Z_-]*$/i;function xA(s){const e=si.extname(s),t=si.basename(s,e).replace(/(-|_)/g," ").toLowerCase().split(" ").map(r=>r.charAt(0).toUpperCase()+r.slice(1));let i=t.length>0;for(const r of t)if(!r.match(yA)){i=!1;break}let n=t.join(" ");return i||(n=`"${n.replace(/[\\"]/g,"\\$&")}"`),n}const bA=/^[0-9A-Za-z%:/?#\[\]@!\$&'()\*\+,;=\-._~]*$/;function wA(s){return bA.test(s)?s:encodeURI(s)}const SA={extension:{type:ke.LoadParser,priority:os.Low},name:"loadWebFont",test(s){return xa(s,vA)||Ki(s,gA)},async load(s,e){var i,n,r;const t=Be.ADAPTER.getFontFaceSet();if(t){const o=[],a=((i=e.data)==null?void 0:i.family)??xA(s),l=((r=(n=e.data)==null?void 0:n.weights)==null?void 0:r.filter(h=>pA.includes(h)))??["normal"],c=e.data??{};for(let h=0;hBe.ADAPTER.getFontFaceSet().delete(e))}};$e.add(SA);const MA=`(function() { - "use strict"; - const WHITE_PNG = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/x8AAwMCAO+ip1sAAAAASUVORK5CYII="; - async function checkImageBitmap() { - try { - if (typeof createImageBitmap != "function") - return !1; - const imageBlob = await (await fetch(WHITE_PNG)).blob(), imageBitmap = await createImageBitmap(imageBlob); - return imageBitmap.width === 1 && imageBitmap.height === 1; - } catch { - return !1; - } - } - checkImageBitmap().then((result) => { - self.postMessage(result); - }); -})(); -`;let ta=null,hm=class{constructor(){ta||(ta=URL.createObjectURL(new Blob([MA],{type:"application/javascript"}))),this.worker=new Worker(ta)}};hm.revokeObjectURL=function(){ta&&(URL.revokeObjectURL(ta),ta=null)};const TA=`(function() { - "use strict"; - async function loadImageBitmap(url) { - const response = await fetch(url); - if (!response.ok) - throw new Error(\`[WorkerManager.loadImageBitmap] Failed to fetch \${url}: \${response.status} \${response.statusText}\`); - const imageBlob = await response.blob(); - return await createImageBitmap(imageBlob); - } - self.onmessage = async (event) => { - try { - const imageBitmap = await loadImageBitmap(event.data.data[0]); - self.postMessage({ - data: imageBitmap, - uuid: event.data.uuid, - id: event.data.id - }, [imageBitmap]); - } catch (e) { - self.postMessage({ - error: e, - uuid: event.data.uuid, - id: event.data.id - }); - } - }; -})(); -`;let ia=null;class r1{constructor(){ia||(ia=URL.createObjectURL(new Blob([TA],{type:"application/javascript"}))),this.worker=new Worker(ia)}}r1.revokeObjectURL=function(){ia&&(URL.revokeObjectURL(ia),ia=null)};let pv=0,Kd;class _A{constructor(){this._initialized=!1,this._createdWorkers=0,this.workerPool=[],this.queue=[],this.resolveHash={}}isImageBitmapSupported(){return this._isImageBitmapSupported!==void 0?this._isImageBitmapSupported:(this._isImageBitmapSupported=new Promise(e=>{const{worker:t}=new hm;t.addEventListener("message",i=>{t.terminate(),hm.revokeObjectURL(),e(i.data)})}),this._isImageBitmapSupported)}loadImageBitmap(e){return this._run("loadImageBitmap",[e])}async _initWorkers(){this._initialized||(this._initialized=!0)}getWorker(){Kd===void 0&&(Kd=navigator.hardwareConcurrency||4);let e=this.workerPool.pop();return!e&&this._createdWorkers{this.complete(t.data),this.returnWorker(t.target),this.next()})),e}returnWorker(e){this.workerPool.push(e)}complete(e){e.error!==void 0?this.resolveHash[e.uuid].reject(e.error):this.resolveHash[e.uuid].resolve(e.data),this.resolveHash[e.uuid]=null}async _run(e,t){await this._initWorkers();const i=new Promise((n,r)=>{this.queue.push({id:e,arguments:t,resolve:n,reject:r})});return this.next(),i}next(){if(!this.queue.length)return;const e=this.getWorker();if(!e)return;const t=this.queue.pop(),i=t.id;this.resolveHash[pv]={resolve:t.resolve,reject:t.reject},e.postMessage({data:t.arguments,uuid:pv++,id:i})}}const gv=new _A;function kl(s,e,t){s.resource.internal=!0;const i=new Ke(s),n=()=>{delete e.promiseCache[t],qr.has(t)&&qr.remove(t)};return i.baseTexture.once("destroyed",()=>{t in e.promiseCache&&(console.warn("[Assets] A BaseTexture managed by Assets was destroyed instead of unloaded! Use Assets.unload() instead of destroying the BaseTexture."),n())}),i.once("destroyed",()=>{s.destroyed||(console.warn("[Assets] A Texture managed by Assets was destroyed instead of unloaded! Use Assets.unload() instead of destroying the Texture."),n())}),i}const CA=[".jpeg",".jpg",".png",".webp",".avif"],EA=["image/jpeg","image/png","image/webp","image/avif"];async function AA(s){const e=await Be.ADAPTER.fetch(s);if(!e.ok)throw new Error(`[loadImageBitmap] Failed to fetch ${s}: ${e.status} ${e.statusText}`);const t=await e.blob();return await createImageBitmap(t)}const du={name:"loadTextures",extension:{type:ke.LoadParser,priority:os.High},config:{preferWorkers:!0,preferCreateImageBitmap:!0,crossOrigin:"anonymous"},test(s){return xa(s,EA)||Ki(s,CA)},async load(s,e,t){var a;const i=globalThis.createImageBitmap&&this.config.preferCreateImageBitmap;let n;i?this.config.preferWorkers&&await gv.isImageBitmapSupported()?n=await gv.loadImageBitmap(s):n=await AA(s):n=await new Promise((l,c)=>{const h=new Image;h.crossOrigin=this.config.crossOrigin,h.src=s,h.complete?l(h):(h.onload=()=>l(h),h.onerror=u=>c(u))});const r={...e.data};r.resolution??(r.resolution=Hn(s)),i&&((a=r.resourceOptions)==null?void 0:a.ownsImageBitmap)===void 0&&(r.resourceOptions={...r.resourceOptions},r.resourceOptions.ownsImageBitmap=!0);const o=new tt(n,r);return o.resource.src=s,kl(o,t,s)},unload(s){s.destroy(!0)}};$e.add(du);const IA=".svg",RA="image/svg+xml",PA={extension:{type:ke.LoadParser,priority:os.High},name:"loadSVG",test(s){return xa(s,RA)||Ki(s,IA)},async testParse(s){return em.test(s)},async parse(s,e,t){var r;const i=new em(s,(r=e==null?void 0:e.data)==null?void 0:r.resourceOptions);await i.load();const n=new tt(i,{resolution:Hn(s),...e==null?void 0:e.data});return n.resource.src=e.src,kl(n,t,e.src)},async load(s,e){return(await Be.ADAPTER.fetch(s)).text()},unload:du.unload};$e.add(PA);const kA=[".mp4",".m4v",".webm",".ogv"],FA=["video/mp4","video/webm","video/ogg"],OA={name:"loadVideo",extension:{type:ke.LoadParser,priority:os.High},config:{defaultAutoPlay:!0,defaultUpdateFPS:0,defaultLoop:!1,defaultMuted:!1,defaultPlaysinline:!0},test(s){return xa(s,FA)||Ki(s,kA)},async load(s,e,t){var o;let i;const n=await(await Be.ADAPTER.fetch(s)).blob(),r=URL.createObjectURL(n);try{const a={autoPlay:this.config.defaultAutoPlay,updateFPS:this.config.defaultUpdateFPS,loop:this.config.defaultLoop,muted:this.config.defaultMuted,playsinline:this.config.defaultPlaysinline,...(o=e==null?void 0:e.data)==null?void 0:o.resourceOptions,autoLoad:!0},l=new Zb(r,a);await l.load();const c=new tt(l,{alphaMode:await X_(),resolution:Hn(s),...e==null?void 0:e.data});c.resource.src=s,i=kl(c,t,s),i.baseTexture.once("destroyed",()=>{URL.revokeObjectURL(r)})}catch(a){throw URL.revokeObjectURL(r),a}return i},unload(s){s.destroy(!0)}};$e.add(OA);class LA{constructor(){this._defaultBundleIdentifierOptions={connector:"-",createBundleAssetId:(e,t)=>`${e}${this._bundleIdConnector}${t}`,extractAssetIdFromBundle:(e,t)=>t.replace(`${e}${this._bundleIdConnector}`,"")},this._bundleIdConnector=this._defaultBundleIdentifierOptions.connector,this._createBundleAssetId=this._defaultBundleIdentifierOptions.createBundleAssetId,this._extractAssetIdFromBundle=this._defaultBundleIdentifierOptions.extractAssetIdFromBundle,this._assetMap={},this._preferredOrder=[],this._parsers=[],this._resolverHash={},this._bundles={}}setBundleIdentifier(e){if(this._bundleIdConnector=e.connector??this._bundleIdConnector,this._createBundleAssetId=e.createBundleAssetId??this._createBundleAssetId,this._extractAssetIdFromBundle=e.extractAssetIdFromBundle??this._extractAssetIdFromBundle,this._extractAssetIdFromBundle("foo",this._createBundleAssetId("foo","bar"))!=="bar")throw new Error("[Resolver] GenerateBundleAssetId are not working correctly")}prefer(...e){e.forEach(t=>{this._preferredOrder.push(t),t.priority||(t.priority=Object.keys(t.params))}),this._resolverHash={}}set basePath(e){this._basePath=e}get basePath(){return this._basePath}set rootPath(e){this._rootPath=e}get rootPath(){return this._rootPath}get parsers(){return this._parsers}reset(){this.setBundleIdentifier(this._defaultBundleIdentifierOptions),this._assetMap={},this._preferredOrder=[],this._resolverHash={},this._rootPath=null,this._basePath=null,this._manifest=null,this._bundles={},this._defaultSearchParams=null}setDefaultSearchParams(e){if(typeof e=="string")this._defaultSearchParams=e;else{const t=e;this._defaultSearchParams=Object.keys(t).map(i=>`${encodeURIComponent(i)}=${encodeURIComponent(t[i])}`).join("&")}}getAlias(e){const{alias:t,name:i,src:n,srcs:r}=e;return As(t||i||n||r,o=>typeof o=="string"?o:Array.isArray(o)?o.map(a=>(a==null?void 0:a.src)??(a==null?void 0:a.srcs)??a):o!=null&&o.src||o!=null&&o.srcs?o.src??o.srcs:o,!0)}addManifest(e){this._manifest&&console.warn("[Resolver] Manifest already exists, this will be overwritten"),this._manifest=e,e.bundles.forEach(t=>{this.addBundle(t.name,t.assets)})}addBundle(e,t){const i=[];Array.isArray(t)?t.forEach(n=>{const r=n.src??n.srcs,o=n.alias??n.name;let a;if(typeof o=="string"){const l=this._createBundleAssetId(e,o);i.push(l),a=[o,l]}else{const l=o.map(c=>this._createBundleAssetId(e,c));i.push(...l),a=[...o,...l]}this.add({...n,alias:a,src:r})}):Object.keys(t).forEach(n=>{const r=[n,this._createBundleAssetId(e,n)];if(typeof t[n]=="string")this.add({alias:r,src:t[n]});else if(Array.isArray(t[n]))this.add({alias:r,src:t[n]});else{const o=t[n],a=o.src??o.srcs;this.add({...o,alias:r,src:Array.isArray(a)?a:[a]})}i.push(...r)}),this._bundles[e]=i}add(e,t,i,n,r){const o=[];typeof e=="string"||Array.isArray(e)&&typeof e[0]=="string"?(mt("7.2.0",`Assets.add now uses an object instead of individual parameters. -Please use Assets.add({ alias, src, data, format, loadParser }) instead.`),o.push({alias:e,src:t,data:i,format:n,loadParser:r})):Array.isArray(e)?o.push(...e):o.push(e);let a;a=l=>{this.hasKey(l)&&console.warn(`[Resolver] already has key: ${l} overwriting`)},As(o).forEach(l=>{const{src:c,srcs:h}=l;let{data:u,format:d,loadParser:f}=l;const m=As(c||h).map(x=>typeof x=="string"?oA(x):Array.isArray(x)?x:[x]),p=this.getAlias(l);Array.isArray(p)?p.forEach(a):a(p);const g=[];m.forEach(x=>{x.forEach(v=>{let y={};if(typeof v!="object"){y.src=v;for(let w=0;w{this._assetMap[x]=g})})}resolveBundle(e){const t=uh(e);e=As(e);const i={};return e.forEach(n=>{const r=this._bundles[n];if(r){const o=this.resolve(r),a={};for(const l in o){const c=o[l];a[this._extractAssetIdFromBundle(n,l)]=c}i[n]=a}}),t?i[e[0]]:i}resolveUrl(e){const t=this.resolve(e);if(typeof e!="string"){const i={};for(const n in t)i[n]=t[n].src;return i}return t.src}resolve(e){const t=uh(e);e=As(e);const i={};return e.forEach(n=>{if(!this._resolverHash[n])if(this._assetMap[n]){let r=this._assetMap[n];const o=r[0],a=this._getPreferredOrder(r);a==null||a.priority.forEach(l=>{a.params[l].forEach(c=>{const h=r.filter(u=>u[l]?u[l]===c:!1);h.length&&(r=h)})}),this._resolverHash[n]=r[0]??o}else this._resolverHash[n]=this.buildResolvedAsset({alias:[n],src:n},{});i[n]=this._resolverHash[n]}),t?i[e[0]]:i}hasKey(e){return!!this._assetMap[e]}hasBundle(e){return!!this._bundles[e]}_getPreferredOrder(e){for(let t=0;tr.params.format.includes(i.format));if(n)return n}return this._preferredOrder[0]}_appendDefaultSearchParams(e){if(!this._defaultSearchParams)return e;const t=/\?/.test(e)?"&":"?";return`${e}${t}${this._defaultSearchParams}`}buildResolvedAsset(e,t){const{aliases:i,data:n,loadParser:r,format:o}=t;return(this._basePath||this._rootPath)&&(e.src=si.toAbsolute(e.src,this._basePath,this._rootPath)),e.alias=i??e.alias??[e.src],e.src=this._appendDefaultSearchParams(e.src),e.data={...n||{},...e.data},e.loadParser=r??e.loadParser,e.format=o??e.format??si.extname(e.src).slice(1),e.srcs=e.src,e.name=e.alias,e}}class BA{constructor(){this._detections=[],this._initialized=!1,this.resolver=new LA,this.loader=new lA,this.cache=qr,this._backgroundLoader=new rA(this.loader),this._backgroundLoader.active=!0,this.reset()}async init(e={}){var r,o;if(this._initialized){console.warn("[Assets]AssetManager already initialized, did you load before calling this Assets.init()?");return}if(this._initialized=!0,e.defaultSearchParams&&this.resolver.setDefaultSearchParams(e.defaultSearchParams),e.basePath&&(this.resolver.basePath=e.basePath),e.bundleIdentifier&&this.resolver.setBundleIdentifier(e.bundleIdentifier),e.manifest){let a=e.manifest;typeof a=="string"&&(a=await this.load(a)),this.resolver.addManifest(a)}const t=((r=e.texturePreference)==null?void 0:r.resolution)??1,i=typeof t=="number"?[t]:t,n=await this._detectFormats({preferredFormats:(o=e.texturePreference)==null?void 0:o.format,skipDetections:e.skipDetections,detections:this._detections});this.resolver.prefer({params:{format:n,resolution:i}}),e.preferences&&this.setPreferences(e.preferences)}add(e,t,i,n,r){this.resolver.add(e,t,i,n,r)}async load(e,t){this._initialized||await this.init();const i=uh(e),n=As(e).map(a=>{if(typeof a!="string"){const l=this.resolver.getAlias(a);return l.some(c=>!this.resolver.hasKey(c))&&this.add(a),Array.isArray(l)?l[0]:l}return this.resolver.hasKey(a)||this.add({alias:a,src:a}),a}),r=this.resolver.resolve(n),o=await this._mapLoadToResolve(r,t);return i?o[n[0]]:o}addBundle(e,t){this.resolver.addBundle(e,t)}async loadBundle(e,t){this._initialized||await this.init();let i=!1;typeof e=="string"&&(i=!0,e=[e]);const n=this.resolver.resolveBundle(e),r={},o=Object.keys(n);let a=0,l=0;const c=()=>{t==null||t(++a/l)},h=o.map(u=>{const d=n[u];return l+=Object.keys(d).length,this._mapLoadToResolve(d,c).then(f=>{r[u]=f})});return await Promise.all(h),i?r[e[0]]:r}async backgroundLoad(e){this._initialized||await this.init(),typeof e=="string"&&(e=[e]);const t=this.resolver.resolve(e);this._backgroundLoader.add(Object.values(t))}async backgroundLoadBundle(e){this._initialized||await this.init(),typeof e=="string"&&(e=[e]);const t=this.resolver.resolveBundle(e);Object.values(t).forEach(i=>{this._backgroundLoader.add(Object.values(i))})}reset(){this.resolver.reset(),this.loader.reset(),this.cache.reset(),this._initialized=!1}get(e){if(typeof e=="string")return qr.get(e);const t={};for(let i=0;i{const c=r[a.src],h=[a.src];a.alias&&h.push(...a.alias),o[n[l]]=c,qr.set(h,c)}),o}async unload(e){this._initialized||await this.init();const t=As(e).map(n=>typeof n!="string"?n.src:n),i=this.resolver.resolve(t);await this._unloadFromResolved(i)}async unloadBundle(e){this._initialized||await this.init(),e=As(e);const t=this.resolver.resolveBundle(e),i=Object.keys(t).map(n=>this._unloadFromResolved(t[n]));await Promise.all(i)}async _unloadFromResolved(e){const t=Object.values(e);t.forEach(i=>{qr.remove(i.src)}),await this.loader.unload(t)}async _detectFormats(e){let t=[];e.preferredFormats&&(t=Array.isArray(e.preferredFormats)?e.preferredFormats:[e.preferredFormats]);for(const i of e.detections)e.skipDetections||await i.test()?t=await i.add(t):e.skipDetections||(t=await i.remove(t));return t=t.filter((i,n)=>t.indexOf(i)===n),t}get detections(){return this._detections}get preferWorkers(){return du.config.preferWorkers}set preferWorkers(e){mt("7.2.0","Assets.prefersWorkers is deprecated, use Assets.setPreferences({ preferWorkers: true }) instead."),this.setPreferences({preferWorkers:e})}setPreferences(e){this.loader.parsers.forEach(t=>{t.config&&Object.keys(t.config).filter(i=>i in e).forEach(i=>{t.config[i]=e[i]})})}}const ln=new BA;$e.handleByList(ke.LoadParser,ln.loader.parsers).handleByList(ke.ResolveParser,ln.resolver.parsers).handleByList(ke.CacheParser,ln.cache.parsers).handleByList(ke.DetectionParser,ln.detections);const NA={extension:ke.CacheParser,test:s=>Array.isArray(s)&&s.every(e=>e instanceof Ke),getCacheableAssets:(s,e)=>{const t={};return s.forEach(i=>{e.forEach((n,r)=>{t[i+(r===0?"":r+1)]=n})}),t}};$e.add(NA);async function o1(s){if("Image"in globalThis)return new Promise(e=>{const t=new Image;t.onload=()=>{e(!0)},t.onerror=()=>{e(!1)},t.src=s});if("createImageBitmap"in globalThis&&"fetch"in globalThis){try{const e=await(await fetch(s)).blob();await createImageBitmap(e)}catch{return!1}return!0}return!1}const DA={extension:{type:ke.DetectionParser,priority:1},test:async()=>o1("data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAAB0AAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQ0MAAAAABNjb2xybmNseAACAAIAAYAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAACVtZGF0EgAKCBgANogQEAwgMg8f8D///8WfhwB8+ErK42A="),add:async s=>[...s,"avif"],remove:async s=>s.filter(e=>e!=="avif")};$e.add(DA);const UA={extension:{type:ke.DetectionParser,priority:0},test:async()=>o1("data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAAAAAAfQ//73v/+BiOh/AAA="),add:async s=>[...s,"webp"],remove:async s=>s.filter(e=>e!=="webp")};$e.add(UA);const vv=["png","jpg","jpeg"],$A={extension:{type:ke.DetectionParser,priority:-1},test:()=>Promise.resolve(!0),add:async s=>[...s,...vv],remove:async s=>s.filter(e=>!vv.includes(e))};$e.add($A);const XA="WorkerGlobalScope"in globalThis&&globalThis instanceof globalThis.WorkerGlobalScope;function xp(s){return XA?!1:document.createElement("video").canPlayType(s)!==""}const VA={extension:{type:ke.DetectionParser,priority:0},test:async()=>xp("video/webm"),add:async s=>[...s,"webm"],remove:async s=>s.filter(e=>e!=="webm")};$e.add(VA);const YA={extension:{type:ke.DetectionParser,priority:0},test:async()=>xp("video/mp4"),add:async s=>[...s,"mp4","m4v"],remove:async s=>s.filter(e=>e!=="mp4"&&e!=="m4v")};$e.add(YA);const GA={extension:{type:ke.DetectionParser,priority:0},test:async()=>xp("video/ogg"),add:async s=>[...s,"ogv"],remove:async s=>s.filter(e=>e!=="ogv")};$e.add(GA);const jA={extension:ke.ResolveParser,test:du.test,parse:s=>{var e;return{resolution:parseFloat(((e=Be.RETINA_PREFIX.exec(s))==null?void 0:e[1])??"1"),format:si.extname(s).slice(1),src:s}}};$e.add(jA);var wi=(s=>(s[s.COMPRESSED_RGB_S3TC_DXT1_EXT=33776]="COMPRESSED_RGB_S3TC_DXT1_EXT",s[s.COMPRESSED_RGBA_S3TC_DXT1_EXT=33777]="COMPRESSED_RGBA_S3TC_DXT1_EXT",s[s.COMPRESSED_RGBA_S3TC_DXT3_EXT=33778]="COMPRESSED_RGBA_S3TC_DXT3_EXT",s[s.COMPRESSED_RGBA_S3TC_DXT5_EXT=33779]="COMPRESSED_RGBA_S3TC_DXT5_EXT",s[s.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT=35917]="COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT",s[s.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT=35918]="COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT",s[s.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT=35919]="COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT",s[s.COMPRESSED_SRGB_S3TC_DXT1_EXT=35916]="COMPRESSED_SRGB_S3TC_DXT1_EXT",s[s.COMPRESSED_R11_EAC=37488]="COMPRESSED_R11_EAC",s[s.COMPRESSED_SIGNED_R11_EAC=37489]="COMPRESSED_SIGNED_R11_EAC",s[s.COMPRESSED_RG11_EAC=37490]="COMPRESSED_RG11_EAC",s[s.COMPRESSED_SIGNED_RG11_EAC=37491]="COMPRESSED_SIGNED_RG11_EAC",s[s.COMPRESSED_RGB8_ETC2=37492]="COMPRESSED_RGB8_ETC2",s[s.COMPRESSED_RGBA8_ETC2_EAC=37496]="COMPRESSED_RGBA8_ETC2_EAC",s[s.COMPRESSED_SRGB8_ETC2=37493]="COMPRESSED_SRGB8_ETC2",s[s.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC=37497]="COMPRESSED_SRGB8_ALPHA8_ETC2_EAC",s[s.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2=37494]="COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2",s[s.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2=37495]="COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2",s[s.COMPRESSED_RGB_PVRTC_4BPPV1_IMG=35840]="COMPRESSED_RGB_PVRTC_4BPPV1_IMG",s[s.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG=35842]="COMPRESSED_RGBA_PVRTC_4BPPV1_IMG",s[s.COMPRESSED_RGB_PVRTC_2BPPV1_IMG=35841]="COMPRESSED_RGB_PVRTC_2BPPV1_IMG",s[s.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG=35843]="COMPRESSED_RGBA_PVRTC_2BPPV1_IMG",s[s.COMPRESSED_RGB_ETC1_WEBGL=36196]="COMPRESSED_RGB_ETC1_WEBGL",s[s.COMPRESSED_RGB_ATC_WEBGL=35986]="COMPRESSED_RGB_ATC_WEBGL",s[s.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL=35987]="COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL",s[s.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL=34798]="COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL",s[s.COMPRESSED_RGBA_ASTC_4x4_KHR=37808]="COMPRESSED_RGBA_ASTC_4x4_KHR",s[s.COMPRESSED_RGBA_BPTC_UNORM_EXT=36492]="COMPRESSED_RGBA_BPTC_UNORM_EXT",s[s.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT=36493]="COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT",s[s.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT=36494]="COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT",s[s.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT=36495]="COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT",s))(wi||{});const dh={33776:.5,33777:.5,33778:1,33779:1,35916:.5,35917:.5,35918:1,35919:1,37488:.5,37489:.5,37490:1,37491:1,37492:.5,37496:1,37493:.5,37497:1,37494:.5,37495:.5,35840:.5,35842:.5,35841:.25,35843:.25,36196:.5,35986:.5,35987:1,34798:1,37808:1,36492:1,36493:1,36494:1,36495:1};let Gs,Uo;function yv(){Uo={bptc:Gs.getExtension("EXT_texture_compression_bptc"),astc:Gs.getExtension("WEBGL_compressed_texture_astc"),etc:Gs.getExtension("WEBGL_compressed_texture_etc"),s3tc:Gs.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:Gs.getExtension("WEBGL_compressed_texture_s3tc_srgb"),pvrtc:Gs.getExtension("WEBGL_compressed_texture_pvrtc")||Gs.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),etc1:Gs.getExtension("WEBGL_compressed_texture_etc1"),atc:Gs.getExtension("WEBGL_compressed_texture_atc")}}const HA={extension:{type:ke.DetectionParser,priority:2},test:async()=>{const s=Be.ADAPTER.createCanvas().getContext("webgl");return s?(Gs=s,!0):(console.warn("WebGL not available for compressed textures."),!1)},add:async s=>{Uo||yv();const e=[];for(const t in Uo)Uo[t]&&e.push(t);return[...e,...s]},remove:async s=>(Uo||yv(),s.filter(e=>!(e in Uo)))};$e.add(HA);class WA extends au{constructor(e,t={width:1,height:1,autoLoad:!0}){let i,n;typeof e=="string"?(i=e,n=new Uint8Array):(i=null,n=e),super(n,t),this.origin=i,this.buffer=n?new Xf(n):null,this._load=null,this.loaded=!1,this.origin!==null&&t.autoLoad!==!1&&this.load(),this.origin===null&&this.buffer&&(this._load=Promise.resolve(this),this.loaded=!0,this.onBlobLoaded(this.buffer.rawBinaryData))}onBlobLoaded(e){}load(){return this._load?this._load:(this._load=fetch(this.origin).then(e=>e.blob()).then(e=>e.arrayBuffer()).then(e=>(this.data=new Uint32Array(e),this.buffer=new Xf(e),this.loaded=!0,this.onBlobLoaded(e),this.update(),this)),this._load)}}class oo extends WA{constructor(e,t){super(e,t),this.format=t.format,this.levels=t.levels||1,this._width=t.width,this._height=t.height,this._extension=oo._formatToExtension(this.format),(t.levelBuffers||this.buffer)&&(this._levelBuffers=t.levelBuffers||oo._createLevelBuffers(e instanceof Uint8Array?e:this.buffer.uint8View,this.format,this.levels,4,4,this.width,this.height))}upload(e,t,i){const n=e.gl;if(!e.context.extensions[this._extension])throw new Error(`${this._extension} textures are not supported on the current machine`);if(!this._levelBuffers)return!1;n.pixelStorei(n.UNPACK_ALIGNMENT,4);for(let r=0,o=this.levels;r=33776&&e<=33779)return"s3tc";if(e>=35916&&e<=35919)return"s3tc_sRGB";if(e>=37488&&e<=37497)return"etc";if(e>=35840&&e<=35843)return"pvrtc";if(e===36196)return"etc1";if(e===35986||e===35987||e===34798)return"atc";if(e>=36492&&e<=36495)return"bptc";if(e===37808)return"astc";throw new Error(`Invalid (compressed) texture format given: ${e}`)}static _createLevelBuffers(e,t,i,n,r,o,a){const l=new Array(i);let c=e.byteOffset,h=o,u=a,d=h+n-1&~(n-1),f=u+r-1&~(r-1),m=d*f*dh[t];for(let p=0;p1?h:d,levelHeight:i>1?u:f,levelBuffer:new Uint8Array(e.buffer,c,m)},c+=m,h=h>>1||1,u=u>>1||1,d=h+n-1&~(n-1),f=u+r-1&~(r-1),m=d*f*dh[t];return l}}const Zd=4,rc=124,zA=32,xv=20,qA=542327876,oc={HEIGHT:3,WIDTH:4,MIPMAP_COUNT:7,PIXEL_FORMAT:19},KA={FOURCC:2},ac={DXGI_FORMAT:0,RESOURCE_DIMENSION:1,MISC_FLAG:2,ARRAY_SIZE:3},ZA=1,JA=2,QA=4,eI=64,tI=512,iI=131072,sI=827611204,nI=861165636,rI=894720068,oI=808540228,aI=4,lI={[sI]:wi.COMPRESSED_RGBA_S3TC_DXT1_EXT,[nI]:wi.COMPRESSED_RGBA_S3TC_DXT3_EXT,[rI]:wi.COMPRESSED_RGBA_S3TC_DXT5_EXT},cI={70:wi.COMPRESSED_RGBA_S3TC_DXT1_EXT,71:wi.COMPRESSED_RGBA_S3TC_DXT1_EXT,73:wi.COMPRESSED_RGBA_S3TC_DXT3_EXT,74:wi.COMPRESSED_RGBA_S3TC_DXT3_EXT,76:wi.COMPRESSED_RGBA_S3TC_DXT5_EXT,77:wi.COMPRESSED_RGBA_S3TC_DXT5_EXT,72:wi.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,75:wi.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,78:wi.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT,96:wi.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT,95:wi.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT,98:wi.COMPRESSED_RGBA_BPTC_UNORM_EXT,99:wi.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT};function hI(s){const e=new Uint32Array(s);if(e[0]!==qA)throw new Error("Invalid DDS file magic word");const t=new Uint32Array(s,0,rc/Uint32Array.BYTES_PER_ELEMENT),i=t[oc.HEIGHT],n=t[oc.WIDTH],r=t[oc.MIPMAP_COUNT],o=new Uint32Array(s,oc.PIXEL_FORMAT*Uint32Array.BYTES_PER_ELEMENT,zA/Uint32Array.BYTES_PER_ELEMENT),a=o[ZA];if(a&QA){const l=o[KA.FOURCC];if(l!==oI){const v=lI[l],y=Zd+rc,w=new Uint8Array(s,y);return[new oo(w,{format:v,width:n,height:i,levels:r})]}const c=Zd+rc,h=new Uint32Array(e.buffer,c,xv/Uint32Array.BYTES_PER_ELEMENT),u=h[ac.DXGI_FORMAT],d=h[ac.RESOURCE_DIMENSION],f=h[ac.MISC_FLAG],m=h[ac.ARRAY_SIZE],p=cI[u];if(p===void 0)throw new Error(`DDSParser cannot parse texture data with DXGI format ${u}`);if(f===aI)throw new Error("DDSParser does not support cubemap textures");if(d===6)throw new Error("DDSParser does not supported 3D texture data");const g=new Array,x=Zd+rc+xv;if(m===1)g.push(new Uint8Array(s,x));else{const v=dh[p];let y=0,w=n,_=i;for(let b=0;b>>1,_=_>>>1}let S=x;for(let b=0;bnew oo(v,{format:p,width:n,height:i,levels:r}))}throw a&eI?new Error("DDSParser does not support uncompressed texture data."):a&tI?new Error("DDSParser does not supported YUV uncompressed texture data."):a&iI?new Error("DDSParser does not support single-channel (lumninance) texture data!"):a&JA?new Error("DDSParser does not support single-channel (alpha) texture data!"):new Error("DDSParser failed to load a texture file due to an unknown reason!")}const bv=[171,75,84,88,32,49,49,187,13,10,26,10],uI=67305985,Ms={ENDIANNESS:12,GL_TYPE:16,GL_FORMAT:24,GL_INTERNAL_FORMAT:28,PIXEL_WIDTH:36,PIXEL_HEIGHT:40,PIXEL_DEPTH:44,NUMBER_OF_ARRAY_ELEMENTS:48,NUMBER_OF_FACES:52,NUMBER_OF_MIPMAP_LEVELS:56,BYTES_OF_KEY_VALUE_DATA:60},um=64,wv={[Ue.UNSIGNED_BYTE]:1,[Ue.UNSIGNED_SHORT]:2,[Ue.INT]:4,[Ue.UNSIGNED_INT]:4,[Ue.FLOAT]:4,[Ue.HALF_FLOAT]:8},dI={[Te.RGBA]:4,[Te.RGB]:3,[Te.RG]:2,[Te.RED]:1,[Te.LUMINANCE]:1,[Te.LUMINANCE_ALPHA]:2,[Te.ALPHA]:1},fI={[Ue.UNSIGNED_SHORT_4_4_4_4]:2,[Ue.UNSIGNED_SHORT_5_5_5_1]:2,[Ue.UNSIGNED_SHORT_5_6_5]:2};function mI(s,e,t=!1){const i=new DataView(e);if(!pI(s,i))return null;const n=i.getUint32(Ms.ENDIANNESS,!0)===uI,r=i.getUint32(Ms.GL_TYPE,n),o=i.getUint32(Ms.GL_FORMAT,n),a=i.getUint32(Ms.GL_INTERNAL_FORMAT,n),l=i.getUint32(Ms.PIXEL_WIDTH,n),c=i.getUint32(Ms.PIXEL_HEIGHT,n)||1,h=i.getUint32(Ms.PIXEL_DEPTH,n)||1,u=i.getUint32(Ms.NUMBER_OF_ARRAY_ELEMENTS,n)||1,d=i.getUint32(Ms.NUMBER_OF_FACES,n),f=i.getUint32(Ms.NUMBER_OF_MIPMAP_LEVELS,n),m=i.getUint32(Ms.BYTES_OF_KEY_VALUE_DATA,n);if(c===0||h!==1)throw new Error("Only 2D textures are supported");if(d!==1)throw new Error("CubeTextures are not supported by KTXLoader yet!");if(u!==1)throw new Error("WebGL does not support array textures");const p=4,g=4,x=l+3&-4,v=c+3&-4,y=new Array(u);let w=l*c;r===0&&(w=x*v);let _;if(r!==0?wv[r]?_=wv[r]*dI[o]:_=fI[r]:_=dh[a],_===void 0)throw new Error("Unable to resolve the pixel format stored in the *.ktx file!");const S=t?vI(i,m,n):null;let b=w*_,C=l,A=c,P=x,E=v,R=um+m;for(let O=0;O1||r!==0?C:P,levelHeight:f>1||r!==0?A:E,levelBuffer:new Uint8Array(e,G,b)},G+=b}R+=U+4,R=R%4!==0?R+4-R%4:R,C=C>>1||1,A=A>>1||1,P=C+p-1&-4,E=A+g-1&-4,b=P*E*_}return r!==0?{uncompressed:y.map(O=>{let U=O[0].levelBuffer,G=!1;return r===Ue.FLOAT?U=new Float32Array(O[0].levelBuffer.buffer,O[0].levelBuffer.byteOffset,O[0].levelBuffer.byteLength/4):r===Ue.UNSIGNED_INT?(G=!0,U=new Uint32Array(O[0].levelBuffer.buffer,O[0].levelBuffer.byteOffset,O[0].levelBuffer.byteLength/4)):r===Ue.INT&&(G=!0,U=new Int32Array(O[0].levelBuffer.buffer,O[0].levelBuffer.byteOffset,O[0].levelBuffer.byteLength/4)),{resource:new au(U,{width:O[0].levelWidth,height:O[0].levelHeight}),type:r,format:G?gI(o):o}}),kvData:S}:{compressed:y.map(O=>new oo(null,{format:a,width:l,height:c,levels:f,levelBuffers:O})),kvData:S}}function pI(s,e){for(let t=0;te-n){console.error("KTXLoader: keyAndValueByteSize out of bounds");break}let l=0;for(;l{const o=new tt(r,{mipmap:vs.OFF,alphaMode:bi.NO_PREMULTIPLIED_ALPHA,resolution:Hn(s),...e.data});return kl(o,t,s)});return n.length===1?n[0]:n},unload(s){Array.isArray(s)?s.forEach(e=>e.destroy(!0)):s.destroy(!0)}};$e.add(yI);const xI={extension:{type:ke.LoadParser,priority:os.High},name:"loadKTX",test(s){return Ki(s,".ktx")},async load(s,e,t){const i=await(await Be.ADAPTER.fetch(s)).arrayBuffer(),{compressed:n,uncompressed:r,kvData:o}=mI(s,i),a=n??r,l={mipmap:vs.OFF,alphaMode:bi.NO_PREMULTIPLIED_ALPHA,resolution:Hn(s),...e.data},c=a.map(h=>{a===r&&Object.assign(l,{type:h.type,format:h.format});const u=h.resource??h,d=new tt(u,l);return d.ktxKeyValueData=o,kl(d,t,s)});return c.length===1?c[0]:c},unload(s){Array.isArray(s)?s.forEach(e=>e.destroy(!0)):s.destroy(!0)}};$e.add(xI);const bI=["s3tc","s3tc_sRGB","etc","etc1","pvrtc","atc","astc","bptc"],wI={extension:ke.ResolveParser,test:s=>{const e=si.extname(s).slice(1);return["basis","ktx","dds"].includes(e)},parse:s=>{var i,n;const e=s.split("."),t=e.pop();if(["ktx","dds"].includes(t)){const r=e.pop();if(bI.includes(r))return{resolution:parseFloat(((i=Be.RETINA_PREFIX.exec(s))==null?void 0:i[1])??"1"),format:r,src:s}}return{resolution:parseFloat(((n=Be.RETINA_PREFIX.exec(s))==null?void 0:n[1])??"1"),format:t,src:s}}};$e.add(wI);const lc=new ct,SI=4,a1=class Ha{constructor(e){this.renderer=e,this._rendererPremultipliedAlpha=!1}contextChange(){var t;const e=(t=this.renderer)==null?void 0:t.gl.getContextAttributes();this._rendererPremultipliedAlpha=!!(e&&e.alpha&&e.premultipliedAlpha)}async image(e,t,i,n){const r=new Image;return r.src=await this.base64(e,t,i,n),r}async base64(e,t,i,n){const r=this.canvas(e,n);if(r.toBlob!==void 0)return new Promise((o,a)=>{r.toBlob(l=>{if(!l){a(new Error("ICanvas.toBlob failed!"));return}const c=new FileReader;c.onload=()=>o(c.result),c.onerror=a,c.readAsDataURL(l)},t,i)});if(r.toDataURL!==void 0)return r.toDataURL(t,i);if(r.convertToBlob!==void 0){const o=await r.convertToBlob({type:t,quality:i});return new Promise((a,l)=>{const c=new FileReader;c.onload=()=>a(c.result),c.onerror=l,c.readAsDataURL(o)})}throw new Error("Extract.base64() requires ICanvas.toDataURL, ICanvas.toBlob, or ICanvas.convertToBlob to be implemented")}canvas(e,t){const{pixels:i,width:n,height:r,flipY:o,premultipliedAlpha:a}=this._rawPixels(e,t);o&&Ha._flipY(i,n,r),a&&Ha._unpremultiplyAlpha(i);const l=new sC(n,r,1),c=new ImageData(new Uint8ClampedArray(i.buffer),n,r);return l.context.putImageData(c,0,0),l.canvas}pixels(e,t){const{pixels:i,width:n,height:r,flipY:o,premultipliedAlpha:a}=this._rawPixels(e,t);return o&&Ha._flipY(i,n,r),a&&Ha._unpremultiplyAlpha(i),i}_rawPixels(e,t){const i=this.renderer;if(!i)throw new Error("The Extract has already been destroyed");let n,r=!1,o=!1,a,l=!1;e&&(e instanceof vo?a=e:(a=i.generateTexture(e,{region:t,resolution:i.resolution,multisample:i.multisample}),l=!0,t&&(lc.width=t.width,lc.height=t.height,t=lc)));const c=i.gl;if(a){if(n=a.baseTexture.resolution,t=t??a.frame,r=!1,o=a.baseTexture.alphaMode>0&&a.baseTexture.format===Te.RGBA,!l){i.renderTexture.bind(a);const f=a.framebuffer.glFramebuffers[i.CONTEXT_UID];f.blitFramebuffer&&i.framebuffer.bind(f.blitFramebuffer)}}else n=i.resolution,t||(t=lc,t.width=i.width/n,t.height=i.height/n),r=!0,o=this._rendererPremultipliedAlpha,i.renderTexture.bind();const h=Math.max(Math.round(t.width*n),1),u=Math.max(Math.round(t.height*n),1),d=new Uint8Array(SI*h*u);return c.readPixels(Math.round(t.x*n),Math.round(t.y*n),h,u,c.RGBA,c.UNSIGNED_BYTE,d),l&&(a==null||a.destroy(!0)),{pixels:d,width:h,height:u,flipY:r,premultipliedAlpha:o}}destroy(){this.renderer=null}static _flipY(e,t,i){const n=t<<2,r=i>>1,o=new Uint8Array(n);for(let a=0;a=0&&a>=0&&n>=0&&r>=0)){e.length=0;return}const l=Math.ceil(2.3*Math.sqrt(o+a)),c=l*8+(n?4:0)+(r?4:0);if(e.length=c,c===0)return;if(l===0){e.length=8,e[0]=e[6]=t+n,e[1]=e[3]=i+r,e[2]=e[4]=t-n,e[5]=e[7]=i-r;return}let h=0,u=l*4+(n?2:0)+2,d=u,f=c;{const m=n+o,p=r,g=t+m,x=t-m,v=i+p;if(e[h++]=g,e[h++]=v,e[--u]=v,e[--u]=x,r){const y=i-p;e[d++]=x,e[d++]=y,e[--f]=y,e[--f]=g}}for(let m=1;m0||e&&i<=0){const n=t/2;for(let r=n+n%2;r=6){Sv(t,!1);const o=[];for(let c=0;c=0&&r>=0&&o.push(t,i,t+n,i,t+n,i+r,t,i+r)},triangulate(s,e){const t=s.points,i=e.points;if(t.length===0)return;const n=i.length/2;i.push(t[0],t[1],t[2],t[3],t[6],t[7],t[4],t[5]),e.indices.push(n,n+1,n+2,n+1,n+2,n+3)}},_I={build(s){fh.build(s)},triangulate(s,e){fh.triangulate(s,e)}};var hs=(s=>(s.MITER="miter",s.BEVEL="bevel",s.ROUND="round",s))(hs||{}),xr=(s=>(s.BUTT="butt",s.ROUND="round",s.SQUARE="square",s))(xr||{});const ca={adaptive:!0,maxLength:10,minSegments:8,maxSegments:2048,epsilon:1e-4,_segmentsCount(s,e=20){if(!this.adaptive||!s||isNaN(s))return e;let t=Math.ceil(s/this.maxLength);return tthis.maxSegments&&(t=this.maxSegments),t}};class Mv{static curveTo(e,t,i,n,r,o){const a=o[o.length-2],l=o[o.length-1]-t,c=a-e,h=n-t,u=i-e,d=Math.abs(l*u-c*h);if(d<1e-8||r===0)return(o[o.length-2]!==e||o[o.length-1]!==t)&&o.push(e,t),null;const f=l*l+c*c,m=h*h+u*u,p=l*h+c*u,g=r*Math.sqrt(f)/d,x=r*Math.sqrt(m)/d,v=g*p/f,y=x*p/m,w=g*u+x*c,_=g*h+x*l,S=c*(x+v),b=l*(x+v),C=u*(g+y),A=h*(g+y),P=Math.atan2(b-_,S-w),E=Math.atan2(A-_,C-w);return{cx:w+e,cy:_+t,radius:r,startAngle:P,endAngle:E,anticlockwise:c*h>u*l}}static arc(e,t,i,n,r,o,a,l,c){const h=a-o,u=ca._segmentsCount(Math.abs(h)*r,Math.ceil(Math.abs(h)/nh)*40),d=h/(u*2),f=d*2,m=Math.cos(d),p=Math.sin(d),g=u-1,x=g%1/g;for(let v=0;v<=g;++v){const y=v+x*v,w=d+o+f*y,_=Math.cos(w),S=-Math.sin(w);c.push((m*_+p*S)*r+i,(m*-S+p*_)*r+n)}}}class CI{constructor(){this.reset()}begin(e,t,i){this.reset(),this.style=e,this.start=t,this.attribStart=i}end(e,t){this.attribSize=t-this.attribStart,this.size=e-this.start}reset(){this.style=null,this.size=0,this.start=0,this.attribStart=0,this.attribSize=0}}class bp{static curveLength(e,t,i,n,r,o,a,l){let c=0,h=0,u=0,d=0,f=0,m=0,p=0,g=0,x=0,v=0,y=0,w=e,_=t;for(let S=1;S<=10;++S)h=S/10,u=h*h,d=u*h,f=1-h,m=f*f,p=m*f,g=p*e+3*m*h*i+3*f*u*r+d*a,x=p*t+3*m*h*n+3*f*u*o+d*l,v=w-g,y=_-x,w=g,_=x,c+=Math.sqrt(v*v+y*y);return c}static curveTo(e,t,i,n,r,o,a){const l=a[a.length-2],c=a[a.length-1];a.length-=2;const h=ca._segmentsCount(bp.curveLength(l,c,e,t,i,n,r,o));let u=0,d=0,f=0,m=0,p=0;a.push(l,c);for(let g=1,x=0;g<=h;++g)x=g/h,u=1-x,d=u*u,f=d*u,m=x*x,p=m*x,a.push(f*l+3*d*x*e+3*u*m*i+p*r,f*c+3*d*x*t+3*u*m*n+p*o)}}function Tv(s,e,t,i,n,r,o,a){const l=s-t*n,c=e-i*n,h=s+t*r,u=e+i*r;let d,f;o?(d=i,f=-t):(d=-i,f=t);const m=l+d,p=c+f,g=h+d,x=u+f;return a.push(m,p,g,x),2}function $r(s,e,t,i,n,r,o,a){const l=t-s,c=i-e;let h=Math.atan2(l,c),u=Math.atan2(n-s,r-e);a&&hu&&(u+=Math.PI*2);let d=h;const f=u-h,m=Math.abs(f),p=Math.sqrt(l*l+c*c),g=(15*m*Math.sqrt(p)/Math.PI>>0)+1,x=f/g;if(d+=x,a){o.push(s,e,t,i);for(let v=1,y=d;v=0&&(r.join===hs.ROUND?d+=$r(y,w,y-b*O,w-C*O,y-A*O,w-P*O,h,!1)+4:d+=2,h.push(y-A*U,w-P*U,y+A*O,w+P*O));continue}const z=(-b+x)*(-C+w)-(-b+y)*(-C+v),se=(-A+_)*(-P+w)-(-A+y)*(-P+S),oe=(D*se-N*z)/Y,de=(F*z-k*se)/Y,ge=(oe-y)*(oe-y)+(de-w)*(de-w),he=y+(oe-y)*O,fe=w+(de-w)*O,H=y-(oe-y)*U,W=w-(de-w)*U,Z=Math.min(D*D+k*k,N*N+F*F),L=q?O:U,B=Z+L*L*p,j=ge<=B;let ie=r.join;if(ie===hs.MITER&&ge/p>g&&(ie=hs.BEVEL),j)switch(ie){case hs.MITER:{h.push(he,fe,H,W);break}case hs.BEVEL:{q?h.push(he,fe,y+b*U,w+C*U,he,fe,y+A*U,w+P*U):h.push(y-b*O,w-C*O,H,W,y-A*O,w-P*O,H,W),d+=2;break}case hs.ROUND:{q?(h.push(he,fe,y+b*U,w+C*U),d+=$r(y,w,y+b*U,w+C*U,y+A*U,w+P*U,h,!0)+4,h.push(he,fe,y+A*U,w+P*U)):(h.push(y-b*O,w-C*O,H,W),d+=$r(y,w,y-b*O,w-C*O,y-A*O,w-P*O,h,!1)+4,h.push(y-A*O,w-P*O,H,W));break}}else{switch(h.push(y-b*O,w-C*O,y+b*U,w+C*U),ie){case hs.MITER:{q?h.push(H,W,H,W):h.push(he,fe,he,fe),d+=2;break}case hs.ROUND:{q?d+=$r(y,w,y+b*U,w+C*U,y+A*U,w+P*U,h,!0)+2:d+=$r(y,w,y-b*O,w-C*O,y-A*O,w-P*O,h,!1)+2;break}}h.push(y-A*O,w-P*O,y+A*U,w+P*U),d+=2}}x=i[(u-2)*2],v=i[(u-2)*2+1],y=i[(u-1)*2],w=i[(u-1)*2+1],b=-(v-w),C=x-y,E=Math.sqrt(b*b+C*C),b/=E,C/=E,b*=m,C*=m,h.push(y-b*O,w-C*O,y+b*U,w+C*U),l||(r.cap===xr.ROUND?d+=$r(y-b*(O-U)*.5,w-C*(O-U)*.5,y-b*O,w-C*O,y+b*U,w+C*U,h,!1)+2:r.cap===xr.SQUARE&&(d+=Tv(y,w,b,C,O,U,!1,h)));const G=e.indices,$=ca.epsilon*ca.epsilon;for(let X=f;X0&&(this.invalidate(),this.clearDirty++,this.graphicsData.length=0),this}drawShape(e,t=null,i=null,n=null){const r=new mh(e,t,i,n);return this.graphicsData.push(r),this.dirty++,this}drawHole(e,t=null){if(!this.graphicsData.length)return null;const i=new mh(e,null,null,t),n=this.graphicsData[this.graphicsData.length-1];return i.lineStyle=n.lineStyle,n.holes.push(i),this.dirty++,this}destroy(){super.destroy();for(let e=0;e0&&(i=this.batches[this.batches.length-1],n=i.style);for(let l=this.shapeIndex;l65535;this.indicesUint16&&this.indices.length===this.indicesUint16.length&&a===this.indicesUint16.BYTES_PER_ELEMENT>2?this.indicesUint16.set(this.indices):this.indicesUint16=a?new Uint32Array(this.indices):new Uint16Array(this.indices),this.batchable=this.isBatchable(),this.batchable?this.packBatches():this.buildDrawCalls()}_compareStyles(e,t){return!(!e||!t||e.texture.baseTexture!==t.texture.baseTexture||e.color+e.alpha!==t.color+t.alpha||!!e.native!=!!t.native)}validateBatching(){if(this.dirty===this.cacheDirty||!this.graphicsData.length)return!1;for(let e=0,t=this.graphicsData.length;e65535*2)return!1;const e=this.batches;for(let t=0;t0&&(n=cc.pop(),n||(n=new Gf,n.texArray=new zf),this.drawCalls.push(n)),n.start=h,n.size=0,n.texArray.count=0,n.type=c),p.touched=1,p._batchEnabled=e,p._batchLocation=r,p.wrapMode=Os.REPEAT,n.texArray.elements[n.texArray.count++]=p,r++)),n.size+=d.size,h+=d.size,a=p._batchLocation,this.addColors(t,m.color,m.alpha,d.attribSize,d.attribStart),this.addTextureIds(i,a,d.attribSize,d.attribStart)}tt._globalBatch=e,this.packAttributes()}packAttributes(){const e=this.points,t=this.uvs,i=this.colors,n=this.textureIds,r=new ArrayBuffer(e.length*3*4),o=new Float32Array(r),a=new Uint32Array(r);let l=0;for(let c=0;c0&&e.alpha>0;return i?(e.matrix&&(e.matrix=e.matrix.clone(),e.matrix.invert()),Object.assign(this._lineStyle,{visible:i},e)):this._lineStyle.reset(),this}startPoly(){if(this.currentPath){const e=this.currentPath.points,t=this.currentPath.points.length;t>2&&(this.drawShape(this.currentPath),this.currentPath=new ro,this.currentPath.closeStroke=!1,this.currentPath.points.push(e[t-2],e[t-1]))}else this.currentPath=new ro,this.currentPath.closeStroke=!1}finishPoly(){this.currentPath&&(this.currentPath.points.length>2?(this.drawShape(this.currentPath),this.currentPath=null):this.currentPath.points.length=0)}moveTo(e,t){return this.startPoly(),this.currentPath.points[0]=e,this.currentPath.points[1]=t,this}lineTo(e,t){this.currentPath||this.moveTo(0,0);const i=this.currentPath.points,n=i[i.length-2],r=i[i.length-1];return(n!==e||r!==t)&&i.push(e,t),this}_initCurve(e=0,t=0){this.currentPath?this.currentPath.points.length===0&&(this.currentPath.points=[e,t]):this.moveTo(e,t)}quadraticCurveTo(e,t,i,n){this._initCurve();const r=this.currentPath.points;return r.length===0&&this.moveTo(0,0),wp.curveTo(e,t,i,n,r),this}bezierCurveTo(e,t,i,n,r,o){return this._initCurve(),bp.curveTo(e,t,i,n,r,o,this.currentPath.points),this}arcTo(e,t,i,n,r){this._initCurve(e,t);const o=this.currentPath.points,a=Mv.curveTo(e,t,i,n,r,o);if(a){const{cx:l,cy:c,radius:h,startAngle:u,endAngle:d,anticlockwise:f}=a;this.arc(l,c,h,u,d,f)}return this}arc(e,t,i,n,r,o=!1){if(n===r)return this;if(!o&&r<=n?r+=nh:o&&n<=r&&(n+=nh),r-n===0)return this;const a=e+Math.cos(n)*i,l=t+Math.sin(n)*i,c=this._geometry.closePointEps;let h=this.currentPath?this.currentPath.points:null;if(h){const u=Math.abs(h[h.length-2]-a),d=Math.abs(h[h.length-1]-l);u0;return i?(e.matrix&&(e.matrix=e.matrix.clone(),e.matrix.invert()),Object.assign(this._fillStyle,{visible:i},e)):this._fillStyle.reset(),this}endFill(){return this.finishPoly(),this._fillStyle.reset(),this}drawRect(e,t,i,n){return this.drawShape(new ct(e,t,i,n))}drawRoundedRect(e,t,i,n,r){return this.drawShape(new hu(e,t,i,n,r))}drawCircle(e,t,i){return this.drawShape(new lu(e,t,i))}drawEllipse(e,t,i,n){return this.drawShape(new cu(e,t,i,n))}drawPolygon(...e){let t,i=!0;const n=e[0];n.points?(i=n.closeStroke,t=n.points):Array.isArray(e[0])?t=e[0]:t=e;const r=new ro(t);return r.closeStroke=i,this.drawShape(r),this}drawShape(e){return this._holeMode?this._geometry.drawHole(e,this._matrix):this._geometry.drawShape(e,this._fillStyle.clone(),this._lineStyle.clone(),this._matrix),this}clear(){return this._geometry.clear(),this._lineStyle.reset(),this._fillStyle.reset(),this._boundsID++,this._matrix=null,this._holeMode=!1,this.currentPath=null,this}isFastRect(){const e=this._geometry.graphicsData;return e.length===1&&e[0].shape.type===Ci.RECT&&!e[0].matrix&&!e[0].holes.length&&!(e[0].lineStyle.visible&&e[0].lineStyle.width)}_render(e){this.finishPoly();const t=this._geometry;t.updateBatches(),t.batchable?(this.batchDirty!==t.batchDirty&&this._populateBatches(),this._renderBatched(e)):(e.batch.flush(),this._renderDirect(e))}_populateBatches(){const e=this._geometry,t=this.blendMode,i=e.batches.length;this.batchTint=-1,this._transformID=-1,this.batchDirty=e.batchDirty,this.batches.length=i,this.vertexData=new Float32Array(e.points);for(let n=0;ni&&!e.autoResize&&(o=i);let a=e._buffers;a||(a=e._buffers=this.generateBuffers(e));const l=t[0]._texture.baseTexture,c=l.alphaMode>0;this.state.blendMode=ub(e.blendMode,c),r.state.set(this.state);const h=r.gl,u=e.worldTransform.copyTo(this.tempMatrix);u.prepend(r.globalUniforms.uniforms.projectionMatrix),this.shader.uniforms.translationMatrix=u.toArray(!0),this.shader.uniforms.uColor=At.shared.setValue(e.tintRgb).premultiply(e.worldAlpha,c).toArray(this.shader.uniforms.uColor),this.shader.uniforms.uSampler=l,this.renderer.shader.bind(this.shader);let d=!1;for(let f=0,m=0;fn&&(p=n),m>=a.length&&a.push(this._generateOneMoreBuffer(e));const g=a[m];g.uploadDynamic(t,f,p);const x=e._bufferUpdateIDs[m]||0;d=d||g._updateID0);n[o]=c,n[o+r]=c,n[o+r*2]=c,n[o+r*3]=c,o+=r*4}}destroy(){super.destroy(),this.shader&&(this.shader.destroy(),this.shader=null),this.tempMatrix=null}}f1.extension={name:"particle",type:ke.RendererPlugin};$e.add(f1);var mu=(s=>(s[s.LINEAR_VERTICAL=0]="LINEAR_VERTICAL",s[s.LINEAR_HORIZONTAL=1]="LINEAR_HORIZONTAL",s))(mu||{});const hc={willReadFrequently:!0},js=class Ge{static get experimentalLetterSpacingSupported(){let e=Ge._experimentalLetterSpacingSupported;if(e!==void 0){const t=Be.ADAPTER.getCanvasRenderingContext2D().prototype;e=Ge._experimentalLetterSpacingSupported="letterSpacing"in t||"textLetterSpacing"in t}return e}constructor(e,t,i,n,r,o,a,l,c){this.text=e,this.style=t,this.width=i,this.height=n,this.lines=r,this.lineWidths=o,this.lineHeight=a,this.maxLineWidth=l,this.fontProperties=c}static measureText(e,t,i,n=Ge._canvas){i=i??t.wordWrap;const r=t.toFontString(),o=Ge.measureFont(r);o.fontSize===0&&(o.fontSize=t.fontSize,o.ascent=t.fontSize);const a=n.getContext("2d",hc);a.font=r;const l=(i?Ge.wordWrap(e,t,n):e).split(/(?:\r\n|\r|\n)/),c=new Array(l.length);let h=0;for(let m=0;m0&&(n?r-=t:r+=(Ge.graphemeSegmenter(e).length-1)*t),r}static wordWrap(e,t,i=Ge._canvas){const n=i.getContext("2d",hc);let r=0,o="",a="";const l=Object.create(null),{letterSpacing:c,whiteSpace:h}=t,u=Ge.collapseSpaces(h),d=Ge.collapseNewlines(h);let f=!u;const m=t.wordWrapWidth+c,p=Ge.tokenize(e);for(let g=0;gm)if(o!==""&&(a+=Ge.addLine(o),o="",r=0),Ge.canBreakWords(x,t.breakWords)){const y=Ge.wordWrapSplit(x);for(let w=0;wm&&(a+=Ge.addLine(o),f=!1,o="",r=0),o+=_,r+=C}}else{o.length>0&&(a+=Ge.addLine(o),o="",r=0);const y=g===p.length-1;a+=Ge.addLine(x,!y),f=!1,o="",r=0}else v+r>m&&(f=!1,a+=Ge.addLine(o),o="",r=0),(o.length>0||!Ge.isBreakingSpace(x)||f)&&(o+=x,r+=v)}return a+=Ge.addLine(o,!1),a}static addLine(e,t=!0){return e=Ge.trimRight(e),e=t?`${e} -`:e,e}static getFromCache(e,t,i,n){let r=i[e];return typeof r!="number"&&(r=Ge._measureText(e,t,n)+t,i[e]=r),r}static collapseSpaces(e){return e==="normal"||e==="pre-line"}static collapseNewlines(e){return e==="normal"}static trimRight(e){if(typeof e!="string")return"";for(let t=e.length-1;t>=0;t--){const i=e[t];if(!Ge.isBreakingSpace(i))break;e=e.slice(0,-1)}return e}static isNewline(e){return typeof e!="string"?!1:Ge._newlines.includes(e.charCodeAt(0))}static isBreakingSpace(e,t){return typeof e!="string"?!1:Ge._breakingSpaces.includes(e.charCodeAt(0))}static tokenize(e){const t=[];let i="";if(typeof e!="string")return t;for(let n=0;na;--d){for(let p=0;p{if(typeof(Intl==null?void 0:Intl.Segmenter)=="function"){const s=new Intl.Segmenter;return e=>[...s.segment(e)].map(t=>t.segment)}return s=>[...s]})(),js.experimentalLetterSpacing=!1,js._fonts={},js._newlines=[10,13],js._breakingSpaces=[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288];let hr=js;const BI=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],m1=class Wa{constructor(e){this.styleID=0,this.reset(),sf(this,e,e)}clone(){const e={};return sf(e,this,Wa.defaultStyle),new Wa(e)}reset(){sf(this,Wa.defaultStyle,Wa.defaultStyle)}get align(){return this._align}set align(e){this._align!==e&&(this._align=e,this.styleID++)}get breakWords(){return this._breakWords}set breakWords(e){this._breakWords!==e&&(this._breakWords=e,this.styleID++)}get dropShadow(){return this._dropShadow}set dropShadow(e){this._dropShadow!==e&&(this._dropShadow=e,this.styleID++)}get dropShadowAlpha(){return this._dropShadowAlpha}set dropShadowAlpha(e){this._dropShadowAlpha!==e&&(this._dropShadowAlpha=e,this.styleID++)}get dropShadowAngle(){return this._dropShadowAngle}set dropShadowAngle(e){this._dropShadowAngle!==e&&(this._dropShadowAngle=e,this.styleID++)}get dropShadowBlur(){return this._dropShadowBlur}set dropShadowBlur(e){this._dropShadowBlur!==e&&(this._dropShadowBlur=e,this.styleID++)}get dropShadowColor(){return this._dropShadowColor}set dropShadowColor(e){const t=tf(e);this._dropShadowColor!==t&&(this._dropShadowColor=t,this.styleID++)}get dropShadowDistance(){return this._dropShadowDistance}set dropShadowDistance(e){this._dropShadowDistance!==e&&(this._dropShadowDistance=e,this.styleID++)}get fill(){return this._fill}set fill(e){const t=tf(e);this._fill!==t&&(this._fill=t,this.styleID++)}get fillGradientType(){return this._fillGradientType}set fillGradientType(e){this._fillGradientType!==e&&(this._fillGradientType=e,this.styleID++)}get fillGradientStops(){return this._fillGradientStops}set fillGradientStops(e){NI(this._fillGradientStops,e)||(this._fillGradientStops=e,this.styleID++)}get fontFamily(){return this._fontFamily}set fontFamily(e){this.fontFamily!==e&&(this._fontFamily=e,this.styleID++)}get fontSize(){return this._fontSize}set fontSize(e){this._fontSize!==e&&(this._fontSize=e,this.styleID++)}get fontStyle(){return this._fontStyle}set fontStyle(e){this._fontStyle!==e&&(this._fontStyle=e,this.styleID++)}get fontVariant(){return this._fontVariant}set fontVariant(e){this._fontVariant!==e&&(this._fontVariant=e,this.styleID++)}get fontWeight(){return this._fontWeight}set fontWeight(e){this._fontWeight!==e&&(this._fontWeight=e,this.styleID++)}get letterSpacing(){return this._letterSpacing}set letterSpacing(e){this._letterSpacing!==e&&(this._letterSpacing=e,this.styleID++)}get lineHeight(){return this._lineHeight}set lineHeight(e){this._lineHeight!==e&&(this._lineHeight=e,this.styleID++)}get leading(){return this._leading}set leading(e){this._leading!==e&&(this._leading=e,this.styleID++)}get lineJoin(){return this._lineJoin}set lineJoin(e){this._lineJoin!==e&&(this._lineJoin=e,this.styleID++)}get miterLimit(){return this._miterLimit}set miterLimit(e){this._miterLimit!==e&&(this._miterLimit=e,this.styleID++)}get padding(){return this._padding}set padding(e){this._padding!==e&&(this._padding=e,this.styleID++)}get stroke(){return this._stroke}set stroke(e){const t=tf(e);this._stroke!==t&&(this._stroke=t,this.styleID++)}get strokeThickness(){return this._strokeThickness}set strokeThickness(e){this._strokeThickness!==e&&(this._strokeThickness=e,this.styleID++)}get textBaseline(){return this._textBaseline}set textBaseline(e){this._textBaseline!==e&&(this._textBaseline=e,this.styleID++)}get trim(){return this._trim}set trim(e){this._trim!==e&&(this._trim=e,this.styleID++)}get whiteSpace(){return this._whiteSpace}set whiteSpace(e){this._whiteSpace!==e&&(this._whiteSpace=e,this.styleID++)}get wordWrap(){return this._wordWrap}set wordWrap(e){this._wordWrap!==e&&(this._wordWrap=e,this.styleID++)}get wordWrapWidth(){return this._wordWrapWidth}set wordWrapWidth(e){this._wordWrapWidth!==e&&(this._wordWrapWidth=e,this.styleID++)}toFontString(){const e=typeof this.fontSize=="number"?`${this.fontSize}px`:this.fontSize;let t=this.fontFamily;Array.isArray(this.fontFamily)||(t=this.fontFamily.split(","));for(let i=t.length-1;i>=0;i--){let n=t[i].trim();!/([\"\'])[^\'\"]+\1/.test(n)&&!BI.includes(n)&&(n=`"${n}"`),t[i]=n}return`${this.fontStyle} ${this.fontVariant} ${this.fontWeight} ${e} ${t.join(",")}`}};m1.defaultStyle={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fillGradientType:mu.LINEAR_VERTICAL,fillGradientStops:[],fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",leading:0,letterSpacing:0,lineHeight:0,lineJoin:"miter",miterLimit:10,padding:0,stroke:"black",strokeThickness:0,textBaseline:"alphabetic",trim:!1,whiteSpace:"pre",wordWrap:!1,wordWrapWidth:100};let Er=m1;function tf(s){const e=At.shared,t=i=>{const n=e.setValue(i);return n.alpha===1?n.toHex():n.toRgbaString()};return Array.isArray(s)?s.map(t):t(s)}function NI(s,e){if(!Array.isArray(s)||!Array.isArray(e)||s.length!==e.length)return!1;for(let t=0;t0&&m>p&&(g=(p+m)/2);const x=p+d,v=i.lineHeight*(f+1);let y=x;f+10}}function $I(s,e){var i;let t=!1;if((i=s==null?void 0:s._textures)!=null&&i.length){for(let n=0;n{this.queue&&this.prepareItems()},this.registerFindHook(jI),this.registerFindHook(HI),this.registerFindHook($I),this.registerFindHook(XI),this.registerFindHook(VI),this.registerUploadHook(YI),this.registerUploadHook(GI)}upload(e){return new Promise(t=>{e&&this.add(e),this.queue.length?(this.completes.push(t),this.ticking||(this.ticking=!0,Yi.system.addOnce(this.tick,this,uo.UTILITY))):t()})}tick(){setTimeout(this.delayedTick,0)}prepareItems(){for(this.limiter.beginFrame();this.queue.length&&this.limiter.allowedToUpload();){const e=this.queue[0];let t=!1;if(e&&!e._destroyed){for(let i=0,n=this.uploadHooks.length;i=0;t--)this.add(e.children[t]);return this}destroy(){this.ticking&&Yi.system.remove(this.tick,this),this.ticking=!1,this.addHooks=null,this.uploadHooks=null,this.renderer=null,this.completes=null,this.queue=null,this.limiter=null,this.uploadHookHelper=null}};g1.uploadsPerFrame=4;let mm=g1;Object.defineProperties(Be,{UPLOADS_PER_FRAME:{get(){return mm.uploadsPerFrame},set(s){mt("7.1.0","settings.UPLOADS_PER_FRAME is deprecated, use prepare.BasePrepare.uploadsPerFrame"),mm.uploadsPerFrame=s}}});function y1(s,e){return e instanceof tt?(e._glTextures[s.CONTEXT_UID]||s.texture.bind(e),!0):!1}function WI(s,e){if(!(e instanceof Ni))return!1;const{geometry:t}=e;e.finishPoly(),t.updateBatches();const{batches:i}=t;for(let n=0;n1?Ns.from(KI,qI,t):Ns.from(Iv,ZI,t)}render(e){const t=this.renderer,i=this.quad;let n=i.vertices;n[0]=n[6]=e._width*-e.anchor.x,n[1]=n[3]=e._height*-e.anchor.y,n[2]=n[4]=e._width*(1-e.anchor.x),n[5]=n[7]=e._height*(1-e.anchor.y);const r=e.uvRespectAnchor?e.anchor.x:0,o=e.uvRespectAnchor?e.anchor.y:0;n=i.uvs,n[0]=n[6]=-r,n[1]=n[3]=-o,n[2]=n[4]=1-r,n[5]=n[7]=1-o,i.invalidate();const a=e._texture,l=a.baseTexture,c=l.alphaMode>0,h=e.tileTransform.localTransform,u=e.uvMatrix;let d=l.isPowerOfTwo&&a.frame.width===l.width&&a.frame.height===l.height;d&&(l._glTextures[t.CONTEXT_UID]?d=l.wrapMode!==Os.CLAMP:l.wrapMode===Os.CLAMP&&(l.wrapMode=Os.REPEAT));const f=d?this.simpleShader:this.shader,m=a.width,p=a.height,g=e._width,x=e._height;uc.set(h.a*m/g,h.b*m/x,h.c*p/g,h.d*p/x,h.tx/g,h.ty/x),uc.invert(),d?uc.prepend(u.mapCoord):(f.uniforms.uMapCoord=u.mapCoord.toArray(!0),f.uniforms.uClampFrame=u.uClampFrame,f.uniforms.uClampOffset=u.uClampOffset),f.uniforms.uTransform=uc.toArray(!0),f.uniforms.uColor=At.shared.setValue(e.tint).premultiply(e.worldAlpha,c).toArray(f.uniforms.uColor),f.uniforms.translationMatrix=e.transform.worldTransform.toArray(!0),f.uniforms.uSampler=a,t.shader.bind(f),t.geometry.bind(i),this.state.blendMode=ub(e.blendMode,c),t.state.set(this.state),t.geometry.draw(this.renderer.gl.TRIANGLES,6,0)}}b1.extension={name:"tilingSprite",type:ke.RendererPlugin};$e.add(b1);const w1=class za{constructor(e,t,i){this.linkedSheets=[],(e instanceof tt||e instanceof Ke)&&(e={texture:e,data:t,resolutionFilename:i});const{texture:n,data:r,resolutionFilename:o=null,cachePrefix:a=""}=e;this.cachePrefix=a,this._texture=n instanceof Ke?n:null,this.baseTexture=n instanceof tt?n:this._texture.baseTexture,this.textures={},this.animations={},this.data=r;const l=this.baseTexture.resource;this.resolution=this._updateResolution(o||(l?l.url:null)),this._frames=this.data.frames,this._frameKeys=Object.keys(this._frames),this._batchIndex=0,this._callback=null}_updateResolution(e=null){const{scale:t}=this.data.meta;let i=Hn(e,null);return i===null&&(i=typeof t=="number"?t:parseFloat(t??"1")),i!==1&&this.baseTexture.setResolution(i),i}parse(){return new Promise(e=>{this._callback=e,this._batchIndex=0,this._frameKeys.length<=za.BATCH_SIZE?(this._processFrames(0),this._processAnimations(),this._parseComplete()):this._nextBatch()})}_processFrames(e){let t=e;const i=za.BATCH_SIZE;for(;t-e{this._batchIndex*za.BATCH_SIZE{i[n]=e}),Object.keys(e.textures).forEach(n=>{i[`${e.cachePrefix}${n}`]=e.textures[n]}),!t){const n=si.dirname(s[0]);e.linkedSheets.forEach((r,o)=>{Object.assign(i,S1([`${n}/${e.data.meta.related_multi_packs[o]}`],r,!0))})}return i}const eR={extension:ke.Asset,cache:{test:s=>s instanceof Rv,getCacheableAssets:(s,e)=>S1(s,e,!1)},resolver:{test:s=>{const e=s.split("?")[0].split("."),t=e.pop(),i=e.pop();return t==="json"&&QI.includes(i)},parse:s=>{var t;const e=s.split(".");return{resolution:parseFloat(((t=Be.RETINA_PREFIX.exec(s))==null?void 0:t[1])??"1"),format:e[e.length-2],src:s}}},loader:{name:"spritesheetLoader",extension:{type:ke.LoadParser,priority:os.Normal},async testParse(s,e){return si.extname(e.src).toLowerCase()===".json"&&!!s.frames},async parse(s,e,t){var h,u;const{texture:i,imageFilename:n,cachePrefix:r}=(e==null?void 0:e.data)??{};let o=si.dirname(e.src);o&&o.lastIndexOf("/")!==o.length-1&&(o+="/");let a;if(i&&i.baseTexture)a=i;else{const d=hh(o+(n??s.meta.image),e.src);a=(await t.load([d]))[d]}const l=new Rv({texture:a.baseTexture,data:s,resolutionFilename:e.src,cachePrefix:r});await l.parse();const c=(h=s==null?void 0:s.meta)==null?void 0:h.related_multi_packs;if(Array.isArray(c)){const d=[];for(const m of c){if(typeof m!="string")continue;let p=o+m;(u=e.data)!=null&&u.ignoreMultiPack||(p=hh(p,e.src),d.push(t.load({src:p,data:{ignoreMultiPack:!0}})))}const f=await Promise.all(d);l.linkedSheets=f,f.forEach(m=>{m.linkedSheets=[l].concat(l.linkedSheets.filter(p=>p!==m))})}return l},unload(s){s.destroy(!0)}}};$e.add(eR);class gh{constructor(){this.info=[],this.common=[],this.page=[],this.char=[],this.kerning=[],this.distanceField=[]}}class Bc{static test(e){return typeof e=="string"&&e.startsWith("info face=")}static parse(e){const t=e.match(/^[a-z]+\s+.+$/gm),i={info:[],common:[],page:[],char:[],chars:[],kerning:[],kernings:[],distanceField:[]};for(const r in t){const o=t[r].match(/^[a-z]+/gm)[0],a=t[r].match(/[a-zA-Z]+=([^\s"']+|"([^"]*)")/gm),l={};for(const c in a){const h=a[c].split("="),u=h[0],d=h[1].replace(/"/gm,""),f=parseFloat(d),m=isNaN(f)?d:f;l[u]=m}i[o].push(l)}const n=new gh;return i.info.forEach(r=>n.info.push({face:r.face,size:parseInt(r.size,10)})),i.common.forEach(r=>n.common.push({lineHeight:parseInt(r.lineHeight,10)})),i.page.forEach(r=>n.page.push({id:parseInt(r.id,10),file:r.file})),i.char.forEach(r=>n.char.push({id:parseInt(r.id,10),page:parseInt(r.page,10),x:parseInt(r.x,10),y:parseInt(r.y,10),width:parseInt(r.width,10),height:parseInt(r.height,10),xoffset:parseInt(r.xoffset,10),yoffset:parseInt(r.yoffset,10),xadvance:parseInt(r.xadvance,10)})),i.kerning.forEach(r=>n.kerning.push({first:parseInt(r.first,10),second:parseInt(r.second,10),amount:parseInt(r.amount,10)})),i.distanceField.forEach(r=>n.distanceField.push({distanceRange:parseInt(r.distanceRange,10),fieldType:r.fieldType})),n}}class pm{static test(e){const t=e;return typeof e!="string"&&"getElementsByTagName"in e&&t.getElementsByTagName("page").length&&t.getElementsByTagName("info")[0].getAttribute("face")!==null}static parse(e){const t=new gh,i=e.getElementsByTagName("info"),n=e.getElementsByTagName("common"),r=e.getElementsByTagName("page"),o=e.getElementsByTagName("char"),a=e.getElementsByTagName("kerning"),l=e.getElementsByTagName("distanceField");for(let c=0;c")?pm.test(Be.ADAPTER.parseXML(e)):!1}static parse(e){return pm.parse(Be.ADAPTER.parseXML(e))}}const nf=[Bc,pm,gm];function tR(s){for(let e=0;e=l-P*o){if(p===0)throw new Error(`[BitmapFont] textureHeight ${l}px is too small (fontFamily: '${u.fontFamily}', fontSize: ${u.fontSize}px, char: '${b}')`);--S,g=null,x=null,v=null,p=0,m=0,y=0;continue}if(y=Math.max(P+C.fontProperties.descent,y),E*o+m>=d){if(m===0)throw new Error(`[BitmapFont] textureWidth ${a}px is too small (fontFamily: '${u.fontFamily}', fontSize: ${u.fontSize}px, char: '${b}')`);--S,p+=y*o,p=Math.ceil(p),m=0,y=0;continue}sR(g,x,C,m,p,o,u);const R=Nc(C.text);f.char.push({id:R,page:w.length-1,x:m/o,y:p/o,width:E,height:P,xoffset:0,yoffset:0,xadvance:A-(u.dropShadow?u.dropShadowDistance:0)-(u.stroke?u.strokeThickness:0)}),m+=(E+2*r)*o,m=Math.ceil(m)}if(!(i!=null&&i.skipKerning))for(let S=0,b=h.length;S 0.99) {\r - alpha = 1.0;\r - }\r -\r - // Gamma correction for coverage-like alpha\r - float luma = dot(uColor.rgb, vec3(0.299, 0.587, 0.114));\r - float gamma = mix(1.0, 1.0 / 2.2, luma);\r - float coverage = pow(uColor.a * alpha, gamma); \r -\r - // NPM Textures, NPM outputs\r - gl_FragColor = vec4(uColor.rgb, coverage);\r -}\r -`,oR=`// Mesh material default fragment\r -attribute vec2 aVertexPosition;\r -attribute vec2 aTextureCoord;\r -\r -uniform mat3 projectionMatrix;\r -uniform mat3 translationMatrix;\r -uniform mat3 uTextureMatrix;\r -\r -varying vec2 vTextureCoord;\r -\r -void main(void)\r -{\r - gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\r -\r - vTextureCoord = (uTextureMatrix * vec3(aTextureCoord, 1.0)).xy;\r -}\r -`;const Pv=[],kv=[],Fv=[],aR=class T1 extends gi{constructor(e,t={}){super();const{align:i,tint:n,maxWidth:r,letterSpacing:o,fontName:a,fontSize:l}=Object.assign({},T1.styleDefaults,t);if(!or.available[a])throw new Error(`Missing BitmapFont "${a}"`);this._activePagesMeshData=[],this._textWidth=0,this._textHeight=0,this._align=i,this._tintColor=new At(n),this._font=void 0,this._fontName=a,this._fontSize=l,this.text=e,this._maxWidth=r,this._maxLineHeight=0,this._letterSpacing=o,this._anchor=new Fn(()=>{this.dirty=!0},this,0,0),this._roundPixels=Be.ROUND_PIXELS,this.dirty=!0,this._resolution=Be.RESOLUTION,this._autoResolution=!0,this._textureCache={}}updateText(){var E;const e=or.available[this._fontName],t=this.fontSize,i=t/e.size,n=new St,r=[],o=[],a=[],l=this._text.replace(/(?:\r\n|\r)/g,` -`)||" ",c=M1(l),h=this._maxWidth*e.size/t,u=e.distanceFieldType==="none"?Pv:kv;let d=null,f=0,m=0,p=0,g=-1,x=0,v=0,y=0,w=0;for(let R=0;R0&&n.x>h&&(++v,Jo(r,1+g-v,1+R-g),R=g,g=-1,o.push(x),a.push(r.length>0?r[r.length-1].prevSpaces:0),m=Math.max(m,x),p++,n.x=0,n.y+=e.lineHeight,d=null,w=0)}const _=c[c.length-1];_!=="\r"&&_!==` -`&&(/(?:\s)/.test(_)&&(f=x),o.push(f),m=Math.max(m,f),a.push(-1));const S=[];for(let R=0;R<=p;R++){let O=0;this._align==="right"?O=m-o[R]:this._align==="center"?O=(m-o[R])/2:this._align==="justify"&&(O=a[R]<0?0:(m-o[R])/a[R]),S.push(O)}const b=r.length,C={},A=[],P=this._activePagesMeshData;u.push(...P);for(let R=0;R6*U)||O.vertices.lengtht[n.mesh.texture.baseTexture.uid]).forEach(n=>{n.mesh.texture=Ke.EMPTY});for(const n in t)t[n].destroy(),delete t[n];this._font=null,this._tintColor=null,this._textureCache=null,super.destroy(e)}};aR.styleDefaults={align:"left",tint:16777215,maxWidth:0,letterSpacing:0};const lR=[".xml",".fnt"],cR={extension:{type:ke.LoadParser,priority:os.Normal},name:"loadBitmapFont",test(s){return lR.includes(si.extname(s).toLowerCase())},async testParse(s){return Bc.test(s)||gm.test(s)},async parse(s,e,t){const i=Bc.test(s)?Bc.parse(s):gm.parse(s),{src:n}=e,{page:r}=i,o=[];for(let c=0;ca[c]);return or.install(i,l,!0)},async load(s,e){return(await Be.ADAPTER.fetch(s)).text()},unload(s){s.destroy()}};$e.add(cR);const vm=class $o extends Er{constructor(){super(...arguments),this._fonts=[],this._overrides=[],this._stylesheet="",this.fontsDirty=!1}static from(e){return new $o(Object.keys($o.defaultOptions).reduce((t,i)=>({...t,[i]:e[i]}),{}))}cleanFonts(){this._fonts.length>0&&(this._fonts.forEach(e=>{URL.revokeObjectURL(e.src),e.refs--,e.refs===0&&(e.fontFace&&document.fonts.delete(e.fontFace),delete $o.availableFonts[e.originalUrl])}),this.fontFamily="Arial",this._fonts.length=0,this.styleID++,this.fontsDirty=!0)}loadFont(e,t={}){const{availableFonts:i}=$o;if(i[e]){const n=i[e];return this._fonts.push(n),n.refs++,this.styleID++,this.fontsDirty=!0,Promise.resolve()}return Be.ADAPTER.fetch(e).then(n=>n.blob()).then(async n=>new Promise((r,o)=>{const a=URL.createObjectURL(n),l=new FileReader;l.onload=()=>r([a,l.result]),l.onerror=o,l.readAsDataURL(n)})).then(async([n,r])=>{const o=Object.assign({family:si.basename(e,si.extname(e)),weight:"normal",style:"normal",display:"auto",src:n,dataSrc:r,refs:1,originalUrl:e,fontFace:null},t);i[e]=o,this._fonts.push(o),this.styleID++;const a=new FontFace(o.family,`url(${o.src})`,{weight:o.weight,style:o.style,display:o.display});o.fontFace=a,await a.load(),document.fonts.add(a),await document.fonts.ready,this.styleID++,this.fontsDirty=!0})}addOverride(...e){const t=e.filter(i=>!this._overrides.includes(i));t.length>0&&(this._overrides.push(...t),this.styleID++)}removeOverride(...e){const t=e.filter(i=>this._overrides.includes(i));t.length>0&&(this._overrides=this._overrides.filter(i=>!t.includes(i)),this.styleID++)}toCSS(e){return[`transform: scale(${e})`,"transform-origin: top left","display: inline-block",`color: ${this.normalizeColor(this.fill)}`,`font-size: ${this.fontSize}px`,`font-family: ${this.fontFamily}`,`font-weight: ${this.fontWeight}`,`font-style: ${this.fontStyle}`,`font-variant: ${this.fontVariant}`,`letter-spacing: ${this.letterSpacing}px`,`text-align: ${this.align}`,`padding: ${this.padding}px`,`white-space: ${this.whiteSpace}`,...this.lineHeight?[`line-height: ${this.lineHeight}px`]:[],...this.wordWrap?[`word-wrap: ${this.breakWords?"break-all":"break-word"}`,`max-width: ${this.wordWrapWidth}px`]:[],...this.strokeThickness?[`-webkit-text-stroke-width: ${this.strokeThickness}px`,`-webkit-text-stroke-color: ${this.normalizeColor(this.stroke)}`,`text-stroke-width: ${this.strokeThickness}px`,`text-stroke-color: ${this.normalizeColor(this.stroke)}`,"paint-order: stroke"]:[],...this.dropShadow?[this.dropShadowToCSS()]:[],...this._overrides].join(";")}toGlobalCSS(){return this._fonts.reduce((e,t)=>`${e} - @font-face { - font-family: "${t.family}"; - src: url('${t.dataSrc}'); - 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=Q_(e)),typeof e=="number"?J_(e):e}dropShadowToCSS(){let e=this.normalizeColor(this.dropShadowColor);const t=this.dropShadowAlpha,i=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=`${i}px ${n}px`;return this.dropShadowBlur>0?`text-shadow: ${r} ${this.dropShadowBlur}px ${e}`:`text-shadow: ${r} ${e}`}reset(){Object.assign(this,$o.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}=Be.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}};vm.availableFonts={},vm.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 rf=vm;const dc=class Xo extends Pr{constructor(e="",t={}){super(Ke.EMPTY),this._text=null,this._style=null,this._autoResolution=!0,this.localStyleID=-1,this.dirty=!1,this._updateID=0,this.ownsStyle=!1;const i=new Image,n=Ke.from(i,{scaleMode:Be.SCALE_MODE,resourceOptions:{autoLoad:!1}});n.orig=new ct,n.trim=new ct,this.texture=n;const r="http://www.w3.org/2000/svg",o="http://www.w3.org/1999/xhtml",a=document.createElementNS(r,"svg"),l=document.createElementNS(r,"foreignObject"),c=document.createElementNS(o,"div"),h=document.createElementNS(o,"style");l.setAttribute("width","10000"),l.setAttribute("height","10000"),l.style.overflow="hidden",a.appendChild(l),this.maxWidth=Xo.defaultMaxWidth,this.maxHeight=Xo.defaultMaxHeight,this._domElement=c,this._styleElement=h,this._svgRoot=a,this._foreignObject=l,this._foreignObject.appendChild(h),this._foreignObject.appendChild(c),this._image=i,this._loadImage=new Image,this._autoResolution=Xo.defaultAutoResolution,this._resolution=Xo.defaultResolution??Be.RESOLUTION,this.text=e,this.style=t}measureText(e){var h,u;const{text:t,style:i,resolution:n}=Object.assign({text:this._text,style:this._style,resolution:this._resolution},e);Object.assign(this._domElement,{innerHTML:t,style:i.toCSS(n)}),this._styleElement.textContent=i.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 l=Math.min(this.maxWidth,Math.ceil(o)),c=Math.min(this.maxHeight,Math.ceil(a));return this._svgRoot.setAttribute("width",l.toString()),this._svgRoot.setAttribute("height",c.toString()),t!==this._text&&(this._domElement.innerHTML=this._text),i!==this._style&&(Object.assign(this._domElement,{style:(h=this._style)==null?void 0:h.toCSS(n)}),this._styleElement.textContent=(u=this._style)==null?void 0:u.toGlobalCSS()),{width:l+i.padding*2,height:c+i.padding*2}}async updateText(e=!0){const{style:t,_image:i,_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();i.width=n.width=Math.ceil(Math.max(1,r)),i.height=n.height=Math.ceil(Math.max(1,o)),this._updateID++;const a=this._updateID;await new Promise(l=>{n.onload=async()=>{if(a/gi,"

").replace(/
/gi,"
").replace(/ /gi," ")}};dc.defaultDestroyOptions={texture:!0,children:!1,baseTexture:!0},dc.defaultMaxWidth=2024,dc.defaultMaxHeight=2024,dc.defaultAutoResolution=!0;function vh(s,e){const t=Math.max(0,Number(s)||0),i=Math.max(0,Number(e)||0);return{inner:Math.min(t,i),outer:Math.max(t,i)}}function _1(s){const e=Math.max(0,Number(s.outerRectW)||0),t=Math.max(0,Number(s.outerRectH)||0);return{innerW:Math.min(e,Math.max(0,Number(s.innerRectW)||0)),innerH:Math.min(t,Math.max(0,Number(s.innerRectH)||0)),outerW:e,outerH:t}}function hR(s,e,t,i,n){if(s==="random")return n();const r=Math.max(1,Math.round(t)),o=Math.max(0,Math.round(e))%r;return i?o/r:r<=1?.5:o/(r-1)}function Ov(s,e,t,i){const n=Math.sqrt(s*s+i()*(e*e-s*s));return{x:Math.cos(t)*n,y:-Math.sin(t)*n,radialAngle:-t*180/Math.PI}}function uR(s,e){const{innerW:t,innerH:i,outerW:n,outerH:r}=_1(s),o=Math.max(0,(n-t)/2),a=Math.max(0,(r-i)/2),l=o*r,c=t*a,h=l*2+c*2;if(h<=0){const m=n*2+r*2;if(m<=0)return{x:0,y:0,radialAngle:0};let p=e()*m,g,x;return pt?0:s==="linear"?1-e/t:s==="inverse"?Math.min(10,t/Math.max(e,t*.1)):1}function pR(s,e,t,i,n,r,o){const a=s-t,l=e-i,c=Math.hypot(a,l);if(c<=1e-4||c>r)return{x:0,y:0};const h=n*C1(o,c,r)*10;return{x:-l/c*h,y:a/c*h}}function gR(s,e,t){const i=s.rotation*Math.PI/180,n=Math.cos(i),r=Math.sin(i),o=Math.max(1e-4,Math.abs(s.scaleX??1)),a=Math.max(1e-4,Math.abs(s.scaleY??1)),l=e-s.x,c=t-s.y,h=(n*l+r*c)/o,u=(-r*l+n*c)/a,d=(S,b,C,A)=>{const P=C/o,E=A/a,R=Math.max(1e-4,Math.hypot(P,E)),O=P/R,U=E/R,G=n*O-r*U,$=r*O+n*U;return{x:s.x+n*S*o-r*b*a+G*.05,y:s.y+r*S*o+n*b*a+$*.05,nx:G,ny:$}};if(s.shape==="circle"){const S=Math.max(.001,s.radius),b=Math.hypot(h,u);if(b>=S)return null;const C=b>1e-4?h/b:1,A=b>1e-4?u/b:0;return d(C*S,A*S,C,A)}if(s.shape==="ellipse"){const S=Math.max(.001,s.radiusX),b=Math.max(.001,s.radiusY),C=Math.hypot(h/S,u/b);if(C>=1)return null;const A=C>1e-4?1/C:1,P=C>1e-4?h*A:S,E=C>1e-4?u*A:0,R=Math.max(1e-4,Math.hypot(P/(S*S),E/(b*b)));return d(P,E,P/(S*S)/R,E/(b*b)/R)}if(s.shape==="rect"){const S=Math.max(.001,s.width*.5),b=Math.max(.001,s.height*.5);if(Math.abs(h)>=S||Math.abs(u)>=b)return null;const C=S-Math.abs(h),A=b-Math.abs(u);if(C=0?1:-1;return d(E*S,u,E,0)}const P=u>=0?1:-1;return d(h,P*b,0,P)}const f=Math.max(3,Math.min(16,Math.round(s.sides||(s.shape==="custom"?5:6)))),m=Math.max(.001,s.width*.5),p=Math.max(.001,s.height*.5),g=Array.from({length:f},(S,b)=>{const C=Math.PI*.5+b/f*Math.PI*2;return{x:Math.cos(C)*m,y:Math.sin(C)*p}});let x=!1;for(let S=0,b=g.length-1;Su!=A.y>u&&h<(A.x-C.x)*(u-C.y)/(A.y-C.y)+C.x&&(x=!x)}if(!x)return null;let v=g[0].x,y=g[0].y,w=1/0;for(let S=0;S>>0^Math.imul(e+1,2654435761)^t)>>>0;return i^=i>>>16,i=Math.imul(i,2146121005),i^=i>>>15,i=Math.imul(i,2221713035),i^=i>>>16,(i>>>0)/4294967296}function Io(s,e,t,i,n){return s==="fixed"?e:s==="curve"?Mi(e,t,nn(i,n)):Mi(e,t,n)}function of(s,e,t,i,n,r){return s==="curve"?Mi(e,t,nn(i,n)):s==="random"?r:e}function Nv(s,e,t,i,n){const r=1-n;return r*r*r*s+3*r*r*n*e+3*r*n*n*t+n*n*n*i}function nn(s,e,t="线性"){if(!Array.isArray(s)||s.length===0)return 1;const i=[...s].sort((n,r)=>n.x-r.x);if(e<=i[0].x)return i[0].y;if(e>=i[i.length-1].x)return i[i.length-1].y;for(let n=0;n=i[n].x&&e<=i[n+1].x){const r=i[n],o=i[n+1],a=o.x-r.x||1;if(t!=="贝塞尔")return Mi(r.y,o.y,(e-r.x)/a);const l=r.x+(r.outX??a/3),c=r.y+(r.outY??(o.y-r.y)/3),h=o.x+(o.inX??-a/3),u=o.y+(o.inY??-(o.y-r.y)/3);let d=0,f=1;for(let m=0;m<14;m++){const p=(d+f)/2;Nv(r.x,l,h,o.x,p)>>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 sa(s){let e=s.replace("#","");return e.length===3&&(e=e.split("").map(t=>t+t).join("")),parseInt(e,16)}function yR(s,e,t){const i=Dv(s),n=Dv(e),r=Math.round(i[0]+(n[0]-i[0])*t),o=Math.round(i[1]+(n[1]-i[1])*t),a=Math.round(i[2]+(n[2]-i[2])*t);return r<<16|o<<8|a}function ym(s,e){if(!Array.isArray(s)||s.length===0)return 16777215;const t=[...s].sort((i,n)=>i.position-n.position);if(e<=t[0].position)return sa(t[0].color);if(e>=t[t.length-1].position)return sa(t[t.length-1].color);for(let i=0;ir.position)continue;const o=(e-n.position)/Math.max(1e-4,r.position-n.position);return yR(n.color,r.color,o)}return sa(t[t.length-1].color)}function Dv(s){let e=s.replace("#","");e.length===3&&(e=e.split("").map(i=>i+i).join(""));const t=parseInt(e,16);return[t>>16&255,t>>8&255,t&255]}function Uv(s,e){const t=Math.min(255,(s>>16&255)+(e>>16&255)),i=Math.min(255,(s>>8&255)+(e>>8&255)),n=Math.min(255,(s&255)+(e&255));return t<<16|i<<8|n}function xR(){return{sprite:null,boneName:"",mesh:null,meshSignature:"",history:[],bones:[],skinWeights:[],currentWidth:0,currentAlpha:0,currentColor:16777215,resourceId:1,enabled:!1,sampledLength:100,sampledWidth:100}}function Dc(s){s.history.length=0,s.bones.length=0,s.mesh&&(s.mesh.visible=!1)}class bR{constructor(e){M(this,"container");this.container=e}ensureMesh(e,t,i){const n=t.trailResources.find(g=>g.id===e.resourceId)||t.trailResources[0],r=(n==null?void 0:n.texture)||Ke.EMPTY,o=Number(n==null?void 0:n.rotation)||0,a=Math.max(2,Math.min(16,Math.round(t.trailGridRows))),l=Math.max(2,Math.min(32,Math.round(t.trailGridCols))),c=Math.max(2,Math.min(16,Math.round((n==null?void 0:n.boneCount)??3))),h=`${a}:${l}:${c}:${(n==null?void 0:n.id)??0}:${o}`;if(e.mesh&&e.meshSignature===h)return e.mesh.texture!==r&&(e.mesh.texture=r),e.mesh;e.mesh&&(this.container.removeChild(e.mesh),e.mesh.destroy()),e.meshSignature&&e.meshSignature!==h&&(e.history.length=0,e.bones.length=0);const u=new Float32Array(a*l*2),d=new Float32Array(a*l*2),f=[],m=[];for(let g=0;g.05?e.history.unshift({x:t,y:i}):(r.x=t,r.y=i);const o=Math.max(1,n)*1.5;let a=0,l=e.history.length;for(let c=1;c=o||c>=239){l=c+1;break}e.history.length>l&&(e.history.length=l)}sampleBones(e,t,i){const n=Math.max(2,Math.min(16,Math.round(i))),r=e.history,o=[];if(!r.length)return o;let a=0;for(let c=1;c=h&&g>1e-4){const x=(h-u)/g;d={x:Mi(m.x,p.x,x),y:Mi(m.y,p.y,x)};break}u+=g}o.push({boneName:`${e.boneName}_trail_${c}`,x:d.x,y:d.y,rotation:0})}for(let c=0;c1){const c=o[0].rotation,u=(o[o.length-1].rotation-c+540)%360-180;for(let d=0;dh.id===i.resourceId)||t.trailResources[0];if(!(r!=null&&r.texture)||i.bones.length<2){n.visible=!1;return}e.resourceId=r.id,n.texture!==r.texture&&(n.texture=r.texture);const o=Math.max(2,Math.min(16,Math.round(t.trailGridRows))),a=Math.max(2,Math.min(32,Math.round(t.trailGridCols))),l=n.vertices,c=[];for(let h=0;h.5&&i.alpha>0}update(e,t,i,n,r,o,a){if(e.sprite=a,e.boneName=i,!t.trail||!e.enabled||e.sampledLength<=0||e.sampledWidth<=0){Dc(e);return}this.ensureMesh(e,t,a);const l=t.trailResources.find(f=>f.id===e.resourceId)||t.trailResources[0];this.appendPoint(e,n,r,e.sampledLength);const c=l!=null&&l.lifeLengthEnabled?Math.max(0,nn(l.lifeLengthCurve,o)):1,h=Math.max(0,e.sampledLength)*c;e.bones=this.sampleBones(e,h,(l==null?void 0:l.boneCount)??3),e.bones[0]&&(e.bones[0].x=n,e.bones[0].y=r);const u=(l==null?void 0:l.widthMode)==="particle"?(Math.abs(a.scale.x)+Math.abs(a.scale.y))*.5:1;e.currentWidth=Math.max(0,e.sampledWidth)*u,e.currentAlpha=(l==null?void 0:l.alphaMode)==="particle"?a.alpha:(l==null?void 0:l.alphaMode)==="curve"?nn(l.alphaCurve,o):(l==null?void 0:l.alpha)??1,e.currentColor=(l==null?void 0:l.colorMode)==="particle"?a.tint:(l==null?void 0:l.colorMode)==="curve"?ym(l.colorGradient,o):sa((l==null?void 0:l.color)||"#ffffff");const d={bones:e.bones.map(f=>({...f})),activeBoneCount:e.bones.length,width:e.currentWidth,alpha:Math.min(1,Math.max(0,e.currentAlpha)),colorHex:e.currentColor,resourceId:e.resourceId};return this.skinMesh(e,t,d),d}applyState(e,t,i,n){var r;e.sprite=i,e.resourceId=n.resourceId??((r=t.trailResources[0])==null?void 0:r.id)??1,e.bones=n.bones.map(o=>({...o})),e.currentWidth=n.width,e.currentAlpha=n.alpha,this.skinMesh(e,t,n)}drawDebug(e,t,i,n){if(e.clear(),!t||!i.trail)return;const r=Math.max(2,Math.min(16,Math.round(i.trailGridRows))),o=Math.max(2,Math.min(32,Math.round(i.trailGridCols)));e.lineStyle(1,3790847,.72);for(const a of n){const l=a.mesh;if(!(l!=null&&l.visible))continue;const c=l.vertices,h=(u,d)=>{const f=(u*r+d)*2;return{x:c[f],y:c[f+1]}};for(let u=0;ur.texture||r.sequenceFrames.some(o=>o.texture));if(!t.length)return wR(s.texture);const i=t.reduce((r,o)=>r+Math.max(0,o.weight),0);if(i<=0)return t[Math.floor(e()*t.length)];let n=e()*i;for(const r of t)if(n-=Math.max(0,r.weight),n<=0)return r;return t[t.length-1]}function TR(s,e){const t=s.trailResources.filter(r=>r.texture);if(!t.length)return s.trailResources[0]||SR();const i=t.reduce((r,o)=>r+Math.max(0,o.weight),0);if(i<=0)return t[Math.min(t.length-1,Math.floor(e*t.length))];let n=e*i;for(const r of t)if(n-=Math.max(0,r.weight),n<=0)return r;return t[t.length-1]}function $v(s,e){if(s.imageMode!=="sequence"||s.sequenceFrames.length<=1)return{index:0,visible:!0};const t=Math.min(120,Math.max(1,Number(s.sequenceFps)||30)),i=Math.max(0,Math.floor(Math.max(0,e)*t)),n=s.sequenceFrames.length-1;return s.sequencePlayback==="once-hide"?{index:Math.min(n,i),visible:i<=n}:s.sequencePlayback==="once-hold"?{index:Math.min(n,i),visible:!0}:s.sequencePlayback==="loop-reverse"?{index:n-i%s.sequenceFrames.length,visible:!0}:{index:i%s.sequenceFrames.length,visible:!0}}function lf(s,e,t){var i;return s.imageMode==="sequence"&&s.sequenceFrames.length?((i=s.sequenceFrames[Math.max(0,Math.min(s.sequenceFrames.length-1,t))])==null?void 0:i.texture)||s.texture||e:s.texture||e}function Sl(){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,loopStartUseCustomDuration:!1,loopStartDurationFrames:30,generateLoopEndAnimation:!1,loopEndUseCustomDuration:!1,loopEndDurationFrames:30,burstCount:50,burstLoop:!1,delay:0,duration:1,shape:"point",showShape:!0,shapeRangeVersion:1,innerRadius:0,outerRadius:30,innerRectW:0,innerRectH:0,outerRectW:60,outerRectH:40,spawnPathId:0,spawnPathDistribution:"fixed",radius:30,rectW:60,rectH:40,centerX:0,centerY:0,rootRotation:0,rootScaleX:1,rootScaleY:1,renderLayerMode:"top",renderLayerSpineId:0,renderLayerSlotName:"",renderLayerSlotPosition:"above",renderLayerFollowAttachment:!1,emissionAngleMode:"random",direction:0,spread:360,coneDirection:90,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",showForceFieldShape:!0,vortex:!1,vortexStrength:10,vortexRadius:100,vortexCenterX:0,vortexCenterY:0,vortexFalloff:"linear",showVortexShape:!0,attraction:!1,attractionCenterX:200,attractionCenterY:0,attractionRadius:20,attractionDuration:.5,attractionDelay:.1,attractionDelayMode:"particle",attractionPath:"curve",showAttractionShape:!0,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,collisionColliderIds:[],pathFollow:!1,eventEnabled:!1,events:[],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 Xn(s){var P;const e=Sl(),t=s,i=t.shapeRangeVersion!==1,n=Number(t.radius),r=Number(t.rectW),o=Number(t.rectH),a=Number(t.direction),l=Number(t.spread),c=t.shape,h=t.imageWeightVersion!==1,u=t.loopDurationFrames==null,d=t.gravityMode==null,f=Number(t.gravity),m=t.windMode==null,p=Number(t.windX),g=Number(t.windY),x=t.forceFalloff==null,v=Number(t.forceStrength),y=t.trailConfigVersion!==3,w=!Array.isArray(t.trailResources),_=t.trailResourceVersion!==6,S=t.trailTexture,b=String(t.trailTextureName||"trail"),C=String(t.trailPreviewUrl||"/images/trail.png").replace("/trails/trail.png","/images/trail.png");for(const[E,R]of Object.entries(e))t[E]!==void 0&&t[E]!==null||(t[E]=Array.isArray(R)?R.map(O=>typeof O=="object"&&O!==null?{...O}:O):R);i&&(s.innerRadius=0,s.outerRadius=Math.max(0,Number.isFinite(n)?n:e.outerRadius),s.innerRectW=0,s.innerRectH=0,s.outerRectW=Math.max(0,Number.isFinite(r)?r:e.outerRectW),s.outerRectH=Math.max(0,Number.isFinite(o)?o:e.outerRectH),s.coneDirection=Number.isFinite(a)?a:90,s.emissionAngleMode=Number.isFinite(l)&&l>0?"random":"fixed",c==="cone"&&(s.spread=Math.max(0,Number(s.coneAngle)||0)),s.shapeRangeVersion=1),s.shape==="orbit"&&(s.shape="path"),["fixed","random","radial","path-normal","path-tangent"].includes(s.emissionAngleMode)||(s.emissionAngleMode="fixed"),!["circle","rect","cone"].includes(s.shape)&&s.emissionAngleMode==="radial"&&(s.emissionAngleMode="fixed"),s.shape!=="path"&&(s.emissionAngleMode==="path-normal"||s.emissionAngleMode==="path-tangent")&&(s.emissionAngleMode="fixed"),s.spawnPathId=Math.max(0,Math.round(Number(s.spawnPathId)||0)),s.spawnPathDistribution!=="fixed"&&s.spawnPathDistribution!=="random"&&(s.spawnPathDistribution="fixed"),s.renderLayerMode!=="top"&&s.renderLayerMode!=="slot"&&(s.renderLayerMode="top"),s.renderLayerSpineId=Math.max(0,Math.round(Number(s.renderLayerSpineId)||0)),typeof s.renderLayerSlotName!="string"&&(s.renderLayerSlotName=""),s.renderLayerSlotPosition!=="above"&&s.renderLayerSlotPosition!=="below"&&(s.renderLayerSlotPosition="above"),typeof s.renderLayerFollowAttachment!="boolean"&&(s.renderLayerFollowAttachment=!1),typeof s.eventEnabled!="boolean"&&(s.eventEnabled=!1),Array.isArray(s.events)||(s.events=[]);for(const E of s.events){E.id=Math.max(1,Math.round(Number(E.id)||1)),E.event!=="birth"&&E.event!=="death"&&E.event!=="collision"&&(E.event="birth"),E.targetSystemId=Math.max(0,Math.round(Number(E.targetSystemId)||0));const R=Number(E.probability);E.probability=Math.min(1,Math.max(0,Number.isFinite(R)?R:1));const O=Math.round(Number(E.collisionLimit));E.collisionLimit=Math.min(4,Math.max(1,Number.isFinite(O)?O:1));const U=E.inherit,G=["color","scale","rotation","life"],$=Array.isArray(U)?U:U==="all"?[...G]:G.includes(String(U))?[String(U)]:[],X=[...new Set($.filter(k=>G.includes(String(k))))],D=Array.isArray(U)?U:null;(!D||D.length!==X.length||X.some((k,N)=>k!==D[N]))&&(E.inherit=X),E.colorInheritMode!=="add"&&E.colorInheritMode!=="replace"&&(E.colorInheritMode="add")}s.innerRadius=Math.max(0,Number(s.innerRadius)||0),s.outerRadius=Math.max(s.innerRadius,Number(s.outerRadius)||0),s.innerRectW=Math.max(0,Number(s.innerRectW)||0),s.innerRectH=Math.max(0,Number(s.innerRectH)||0),s.outerRectW=Math.max(s.innerRectW,Number(s.outerRectW)||0),s.outerRectH=Math.max(s.innerRectH,Number(s.outerRectH)||0);const A=Array.from(new Set((Array.isArray(s.collisionColliderIds)?s.collisionColliderIds:[]).map(E=>Math.round(Number(E))).filter(E=>Number.isFinite(E)&&E>0)));(A.length!==s.collisionColliderIds.length||A.some((E,R)=>E!==s.collisionColliderIds[R]))&&(s.collisionColliderIds=A),s.streamBehavior!=="normal"&&s.streamBehavior!=="loop"&&(s.streamBehavior="normal"),(u||!Number.isFinite(s.loopDurationFrames))&&(s.loopDurationFrames=Math.ceil(Math.max(1/30,Number(s.duration)||1)*30)),s.loopDurationFrames=Math.min(1800,Math.max(1,Math.ceil(s.loopDurationFrames))),typeof s.generateLoopStartAnimation!="boolean"&&(s.generateLoopStartAnimation=!1),typeof s.generateLoopEndAnimation!="boolean"&&(s.generateLoopEndAnimation=!1),typeof s.loopStartUseCustomDuration!="boolean"&&(s.loopStartUseCustomDuration=!1),typeof s.loopEndUseCustomDuration!="boolean"&&(s.loopEndUseCustomDuration=!1),s.loopStartDurationFrames=Math.min(1800,Math.max(1,Math.ceil(Number(s.loopStartDurationFrames)||30))),s.loopEndDurationFrames=Math.min(1800,Math.max(1,Math.ceil(Number(s.loopEndDurationFrames)||30))),(!Array.isArray(s.imageResources)||s.imageResources.length===0)&&(s.imageResources=Sl().imageResources);for(const E of s.imageResources){!E.texture&&s.texture&&(E.texture=s.texture),E.textureName||(E.textureName="star"),E.previewUrl==="/particles/star.png"&&(E.previewUrl="/images/star.png"),E.previewUrl||(E.previewUrl=E.textureName==="star"?"/images/star.png":""),E.imageMode!=="fixed"&&E.imageMode!=="sequence"&&(E.imageMode="fixed"),E.sequencePlayback==="once"?E.sequencePlayback="once-hold":E.sequencePlayback==="loop"?E.sequencePlayback="loop-forward":["once-hide","once-hold","loop-forward","loop-reverse"].includes(E.sequencePlayback)||(E.sequencePlayback="loop-forward"),Number.isFinite(E.sequenceFps)||(E.sequenceFps=30),E.sequenceFps=Math.min(120,Math.max(1,Number(E.sequenceFps)||30)),Array.isArray(E.sequenceFrames)||(E.sequenceFrames=[]);for(const R of E.sequenceFrames)typeof R.name!="string"&&(R.name=""),typeof R.previewUrl!="string"&&(R.previewUrl=""),R.texture===void 0&&(R.texture=null);Number.isFinite(E.weight)||(E.weight=100),typeof E.locked!="boolean"&&(E.locked=!1),Number.isFinite(E.scale)||(E.scale=1),Number.isFinite(E.anchorX)||(E.anchorX=.5),Number.isFinite(E.anchorY)||(E.anchorY=.5),E.colorMode!=="fixed"&&E.colorMode!=="random"&&E.colorMode!=="lifetime"&&(E.colorMode=s.colorOverLife?"lifetime":"fixed"),E.colorStart||(E.colorStart=s.colorStart||"#ffffff"),E.colorEnd||(E.colorEnd=s.colorEnd||E.colorStart),(!Array.isArray(E.colorGradient)||E.colorGradient.length<2)&&(E.colorGradient=[{position:0,color:E.colorStart},{position:1,color:E.colorEnd}]),Object.prototype.hasOwnProperty.call(br,E.blend)||(E.blend=s.blend||"normal"),["off","fixed","curve"].includes(E.independentAlpha)||(E.independentAlpha=s.independentAlpha||"off"),Number.isFinite(E.alpha)||(E.alpha=Number.isFinite(s.alphaScale)?s.alphaScale:1),["跟随导出","线性","贝塞尔"].includes(E.alphaCurveMode)||(E.alphaCurveMode=s.curveMode||"跟随导出"),(!Array.isArray(E.alphaCurve)||E.alphaCurve.length<2)&&(E.alphaCurve=(s.alphaCurve||[{x:0,y:1},{x:1,y:1}]).map(R=>({...R})))}if(s.imageResources.length===1)s.imageResources[0].weight=100,s.imageResources[0].locked=!1;else if(h){const E=100/s.imageResources.length;s.imageResources.forEach((R,O)=>{R.weight=O===s.imageResources.length-1?100-E*(s.imageResources.length-1):E,R.locked=!1})}if(s.imageWeightVersion=1,d){const E=Number.isFinite(f)&&f!==0?f:980;s.gravity=E,s.gravityMin=E,s.gravityMax=E}if(m){const E=Number.isFinite(p)&&Number.isFinite(g)&&(p!==0||g!==0);s.windMin=E?Math.hypot(p,g):100,s.windMax=s.windMin,s.windDirection=E?Math.atan2(-g,p)*180/Math.PI:0}x&&(s.forceStrength=Number.isFinite(v)&&v!==0?v:10),y&&(s.trailConfigVersion=3,s.trailAlphaCurve=[{x:0,y:1},{x:1,y:1}],s.trailLifeLengthCurve=[{x:0,y:1},{x:1,y:1}],s.trailShapeCurve=[{x:0,y:1},{x:1,y:1}],s.trailGridRows=4,s.trailGridCols=4),(w||!s.trailResources.length)&&(s.trailResources=[{id:1,texture:S||null,textureName:b,previewUrl:C,weight:100,locked:!1,rotation:0,colorMode:s.trailColorMode,color:s.trailColor,colorGradient:s.trailColorGradient.map(E=>({...E})),blend:"normal",alphaMode:s.trailAlphaMode,alpha:s.trailAlpha,alphaCurve:s.trailAlphaCurve.map(E=>({...E})),boneCount:s.trailBoneCount,trailRatio:100,lengthMode:"fixed",length:s.trailLength,lengthMin:s.trailLength,lengthMax:s.trailLength,widthSizeMode:"fixed",width:s.trailWidth,widthMin:s.trailWidth,widthMax:s.trailWidth,widthMode:s.trailWidthMode,lifeLengthEnabled:s.trailLifeLengthEnabled,lifeLengthCurve:s.trailLifeLengthCurve.map(E=>({...E})),shapeEnabled:s.trailShapeEnabled,shapeCurve:s.trailShapeCurve.map(E=>({...E}))}]);for(const E of s.trailResources)E.textureName||(E.textureName="trail"),E.previewUrl==="/trails/trail.png"&&(E.previewUrl="/images/trail.png"),E.previewUrl||(E.previewUrl="/images/trail.png"),Number.isFinite(E.weight)||(E.weight=100),typeof E.locked!="boolean"&&(E.locked=!1),Number.isFinite(E.rotation)||(E.rotation=0),["particle","fixed","curve"].includes(E.colorMode)||(E.colorMode=s.trailColorMode||"particle"),E.color||(E.color=s.trailColor||"#ffffff"),(!Array.isArray(E.colorGradient)||E.colorGradient.length<2)&&(E.colorGradient=(s.trailColorGradient||[{position:0,color:"#ffffff"},{position:1,color:"#ffffff"}]).map(R=>({...R}))),Object.prototype.hasOwnProperty.call(br,E.blend)||(E.blend="normal"),["particle","fixed","curve"].includes(E.alphaMode)||(E.alphaMode=s.trailAlphaMode||"particle"),Number.isFinite(E.alpha)||(E.alpha=Number.isFinite(s.trailAlpha)?s.trailAlpha:1),(!Array.isArray(E.alphaCurve)||E.alphaCurve.length<2)&&(E.alphaCurve=(s.trailAlphaCurve||[{x:0,y:1},{x:1,y:1}]).map(R=>({...R}))),Number.isFinite(E.boneCount)||(E.boneCount=Number.isFinite(s.trailBoneCount)?s.trailBoneCount:3),Number.isFinite(E.trailRatio)||(E.trailRatio=100),E.trailRatio=Math.min(100,Math.max(0,E.trailRatio)),["fixed","random"].includes(E.lengthMode)||(E.lengthMode="fixed"),Number.isFinite(E.length)||(E.length=Number.isFinite(s.trailLength)?s.trailLength:100),Number.isFinite(E.lengthMin)||(E.lengthMin=E.length),Number.isFinite(E.lengthMax)||(E.lengthMax=E.length),["fixed","random"].includes(E.widthSizeMode)||(E.widthSizeMode="fixed"),Number.isFinite(E.width)||(E.width=Number.isFinite(s.trailWidth)?s.trailWidth:100),Number.isFinite(E.widthMin)||(E.widthMin=E.width),Number.isFinite(E.widthMax)||(E.widthMax=E.width),["particle","fixed"].includes(E.widthMode)||(E.widthMode=s.trailWidthMode||"particle"),typeof E.lifeLengthEnabled!="boolean"&&(E.lifeLengthEnabled=!!s.trailLifeLengthEnabled),(!Array.isArray(E.lifeLengthCurve)||E.lifeLengthCurve.length<2)&&(E.lifeLengthCurve=(s.trailLifeLengthCurve||[{x:0,y:1},{x:1,y:1}]).map(R=>({...R}))),typeof E.shapeEnabled!="boolean"&&(E.shapeEnabled=!!s.trailShapeEnabled),(!Array.isArray(E.shapeCurve)||E.shapeCurve.length<2)&&(E.shapeCurve=(s.trailShapeCurve||[{x:0,y:1},{x:1,y:1}]).map(R=>({...R})));if(s.trailResources.length===1&&(s.trailResources[0].weight=100,s.trailResources[0].locked=!1),_)for(const E of s.trailResources)E.alphaCurve=((P=E.alphaCurve)==null?void 0:P.length)>=2?E.alphaCurve:[{x:0,y:1},{x:1,y:1}];return s.trailResourceVersion=6,s}class Xv extends gi{constructor(t,i=Lv){super();M(this,"pool",[]);M(this,"cfg");M(this,"accumulator",0);M(this,"burstTimer",0);M(this,"_spawnSerial",0);M(this,"_elapsed",0);M(this,"_attractionEnabledAt",0);M(this,"_attractionWasEnabled",!1);M(this,"autoEmission",!0);M(this,"pendingEventSpawns",[]);M(this,"states",[]);M(this,"onParticleEvent",null);M(this,"rng",Math.random);M(this,"_lastSeed",-1);M(this,"trailDebugGfx",new Ni);M(this,"trail");M(this,"colliders",[]);M(this,"followSpawnX",0);M(this,"followSpawnY",0);M(this,"followSpawnAngle",0);M(this,"spawnPathSampler",null);M(this,"spawnPathClosed",!1);M(this,"followExportCurveMode","线性");M(this,"simulationTransform",null);this.cfg=Xn(t),this.trail=new bR(this),this._ensurePool(i),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=af(t>>>0))}_ensurePool(t){for(;this.pool.length=n.delay),o=i==="force"||i==="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();if(this.pendingEventSpawns.length&&t>0){const m=[],p=[];for(const g of this.pendingEventSpawns)g.remaining-=t,g.remaining<=0?m.push(g):p.push(g);this.pendingEventSpawns=p;for(const g of m){const x=mc(this.cfg,g.worldX,g.worldY,this.simulationTransform);for(let v=0;v0){const k=Math.max(1e-4,Math.abs(n.rootScaleX)),N=Math.max(1e-4,Math.abs(n.rootScaleY)),F=-(((l=this.simulationTransform)==null?void 0:l.rotation)??n.rootRotation)*Math.PI/180,V=Math.cos(F),Y=Math.sin(F),q=((c=this.simulationTransform)==null?void 0:c.centerX)??n.centerX,z=((h=this.simulationTransform)==null?void 0:h.centerY)??n.centerY,se=q+V*k*p.x-Y*N*p.y,oe=-z+Y*k*p.x+V*N*p.y,de=se,ge=-oe,he=n.forceCenterX-de,fe=n.forceCenterY-ge,H=Math.hypot(he,fe);if(H>1e-4&&H<=n.forceRadius){const W=C1(n.forceFalloff,H,n.forceRadius),Z=n.forceStrength*W*10,L=he/H*Z,B=fe/H*Z,j=L,ie=-B;p.vx+=(V*j+Y*ie)/k*t,p.vy+=(-Y*j+V*ie)/N*t}}if(!p.collisionPaused&&n.vortex&&n.vortexStrength!==0&&n.vortexRadius>0){const k=tr(n,p.x,p.y,this.simulationTransform),N=pR(k.x,k.y,n.vortexCenterX,n.vortexCenterY,n.vortexStrength,n.vortexRadius,n.vortexFalloff),F=Bv(n,N.x,N.y,this.simulationTransform);p.vx+=F.x*t,p.vy+=F.y*t}if(!p.collisionPaused&&n.damping>0){const k=Math.max(0,1-n.damping*t);p.vx*=k,p.vy*=k}if(p.collisionPaused)p.vx=0,p.vy=0;else if(p.x+=p.vx*t,p.y+=p.vy*t,this.applyColliders(p,m))continue;if(n.attraction&&!p.collisionPaused){const k=p.maxLife-p.life;if(n.attractionDelayMode==="particle"?k>=Math.max(0,n.attractionDelay):this._elapsed-this._attractionEnabledAt>=Math.max(0,n.attractionDelay)){const F=tr(n,p.x,p.y,this.simulationTransform),V=n.attractionCenterX,Y=n.attractionCenterY,q=Math.max(0,n.attractionRadius);if(!p.attractionActive){if(Math.hypot(V-F.x,Y-F.y)<=q){this.kill(m);continue}p.attractionActive=!0,p.attractionElapsed=0,p.attractionStartWorldX=F.x,p.attractionStartWorldY=F.y}p.attractionElapsed+=t;const z=Math.max(1e-4,n.attractionDuration),se=Math.min(1,p.attractionElapsed/z);let oe=Mi(p.attractionStartWorldX,V,se),de=Mi(p.attractionStartWorldY,Y,se);if(n.attractionPath==="curve"){const fe=V-p.attractionStartWorldX,H=Y-p.attractionStartWorldY,W=Math.hypot(fe,H);if(W>1e-4){const Z=W*.25*p.attractionCurveSide,L=(p.attractionStartWorldX+V)*.5-H/W*Z,B=(p.attractionStartWorldY+Y)*.5+fe/W*Z,j=1-se;oe=j*j*p.attractionStartWorldX+2*j*se*L+se*se*V,de=j*j*p.attractionStartWorldY+2*j*se*B+se*se*Y}}const ge=Math.hypot(V-oe,Y-de);if(se>=1||ge<=q){this.kill(m);continue}const he=mc(n,oe,de,this.simulationTransform);p.x=he.x,p.y=he.y,p.vx=0,p.vy=0}}const x=g,v=p.sprite,y=n.imageResources.find(k=>k.id===p.resourceId);if(y){const k=$v(y,p.maxLife-p.life);p.imageFrameIndex=k.index,v.texture=lf(y,n.texture,p.imageFrameIndex),v.visible=k.visible}if(n.speedOverLifeEnabled){const k=fc(of(n.speedOverLifeMode,n.speedOverLifeMin,n.speedOverLifeMax,n.speedOverLifeCurve,x,p.speedScaleTarget),1),N=p.speedScale===0?k:k/p.speedScale;p.vx*=N,p.vy*=N,p.speedScale=k}let w=p.rotationSpeed;n.rotationOverLifeEnabled&&n.rotationOverLifeMode==="curve"&&(w=Mi(n.rotationSpeedMin,n.rotationSpeedMax,nn(n.rotationOverLifeCurve,x))),p.rotation+=w*t;let _=p.x,S=p.y;if(n.noise&&n.noiseAmt>0&&n.noiseRange>0&&n.noiseSpeed>0){const k=p.maxLife-p.life,N=Math.max(0,n.noiseRange)*Math.min(1,Math.max(0,n.noiseAmt)/100)*.5,F=k*Math.max(0,n.noiseSpeed)*Math.PI*2;_+=(Math.sin(p.noisePhaseX+F)-Math.sin(p.noisePhaseX))*N,S+=(Math.sin(p.noisePhaseY+F*.83)-Math.sin(p.noisePhaseY))*N}v.x=_,v.y=S,v.rotation=-p.rotation*Math.PI/180;let b=1,C=1;n.scaleOverLifeEnabled&&(b=of(n.scaleOverLifeMode,n.scaleOverLifeMin,n.scaleOverLifeMax,n.scaleOverLifeCurve,x,p.scaleOverLifeX),C=n.scaleOverLifeAxisMode==="separate"?of(n.scaleOverLifeMode,n.scaleYOverLifeMin,n.scaleYOverLifeMax,n.scaleYOverLifeCurve,x,p.scaleOverLifeY):b),v.scale.set(fc(p.scaleStartX*b,1),fc(p.scaleStartY*C,1)),p.currentScaleX=v.scale.x,p.currentScaleY=v.scale.y;const A=n.alphaMode==="curve"?nn(n.alphaCurve,x,this.resolveCurveMode(n.curveMode))*n.alphaScale:n.alpha*n.alphaScale;v.alpha=fc((y==null?void 0:y.independentAlpha)==="fixed"?y.alpha:(y==null?void 0:y.independentAlpha)==="curve"?nn(y.alphaCurve,x,this.resolveCurveMode(y.alphaCurveMode)):A,1);const P=(y==null?void 0:y.colorStart)||"#ffffff",E=(y==null?void 0:y.colorMode)==="lifetime"?ym(y.colorGradient,x):(y==null?void 0:y.colorMode)==="random"?p.colorSample:sa(P),R=p.colorOverride??Uv(E,p.colorAdd);v.tint=R,v.blendMode=br[(y==null?void 0:y.blend)||"normal"];const O=this.trail.update(p.trail,n,p.boneName,_,S,x,v),U=tr(n,_,S,this.simulationTransform),G=((u=this.simulationTransform)==null?void 0:u.rotation)??n.rootRotation,$=Math.abs(((d=this.simulationTransform)==null?void 0:d.scaleX)??n.rootScaleX),X=Math.abs(((f=this.simulationTransform)==null?void 0:f.scaleY)??n.rootScaleY),D=O?{...O,bones:O.bones.map(k=>{const N=tr(n,k.x,k.y,this.simulationTransform);return{...k,worldX:N.x,worldY:N.y,worldRotation:G-k.rotation}})}:void 0;a.push({boneName:p.boneName,spawnId:p.spawnId,x:_,y:S,rotation:p.rotation,scaleX:v.scale.x,scaleY:v.scale.y,worldX:U.x,worldY:U.y,worldRotation:G+p.rotation,worldScaleX:v.scale.x*$,worldScaleY:v.scale.y*X,alpha:v.alpha,colorHex:R,resourceId:p.resourceId,imageFrameIndex:p.imageFrameIndex,imageVisible:v.visible,trailState:D,active:!0})}return this.states=a,a}drawTrailMeshDebug(t){this.trail.drawDebug(this.trailDebugGfx,t,this.cfg,this.pool.map(i=>i.trail))}emitBurst(){for(let t=0;t0&&this.spawnPathSampler){const a=this.estimatedEmissionCount(),l=hR(t.spawnPathDistribution,this._spawnSerial,a,this.spawnPathClosed,this.rng),c=this.spawnPathSampler(l);if(c)return{...this.applyFollowToOrigin(c.x+i,c.y+n),radialAngle:0,pathAngle:c.angle}}const r=dR(t,this.rng);return{...this.applyFollowToOrigin(i+r.x,n+r.y),radialAngle:r.radialAngle}}estimatedEmissionCount(){const t=this.cfg;return t.mode==="burst"?Math.max(1,Math.round(t.burstCount)):Math.max(1,Math.floor(t.rate*(t.streamBehavior==="loop"?Math.max(1,t.loopDurationFrames)/30:Math.max(0,t.duration))))}applyFollowToOrigin(t,i){const n=this.followSpawnAngle*Math.PI/180,r=Math.cos(n),o=Math.sin(n);return{x:this.followSpawnX+r*t-o*i,y:this.followSpawnY+o*t+r*i}}spawnEventParticle(t,i,n=1,r,o){if(n>2)return!1;const a=o??(this.cfg.mode==="burst"?this.cfg.burstCount:1),l=Math.max(1,Math.min(Lv,Math.round(Number(a)||1))),c=Math.max(0,Number(this.cfg.delay)||0);if(c>0)return this.pendingEventSpawns.push({worldX:t,worldY:i,depth:n,inherit:r,count:l,remaining:c}),!0;const h=mc(this.cfg,t,i,this.simulationTransform);let u=!1;for(let d=0;d!C.active);if(o===-1)return!1;const a=t?{x:t.x,y:t.y,radialAngle:0}:this.spawnOrigin(),{x:l,y:c}=a,h=Io(r.lifeMode,r.lifeMin,r.lifeMax,r.lifeCurve,this.rng()),u=Io(r.speedMode,r.speedMin,r.speedMax,r.speedCurve,this.rng()),d=n!=null&&n.attributes.includes("rotation")?n.data.rotation:0,f=fR(r,a,this.followSpawnAngle,this.rng)+d*Math.PI/180,m=this.pool[o],p=MR(r,this.rng),g=this._spawnSerial++;m.spawnId=g;const x=TR(r,ar(r.seed,g,1540483477));m.noisePhaseX=ar(r.seed,g,1757159915)*Math.PI*2,m.noisePhaseY=ar(r.seed,g,48610963)*Math.PI*2,m.gravityStrength=r.useGravity&&r.gravityMode==="random"?Mi(r.gravityMin,r.gravityMax,this.rng()):r.gravityMin,m.windStrength=r.wind&&r.windMode==="random"?Mi(r.windMin,r.windMax,this.rng()):r.windMin,m.attractionActive=!1,m.attractionElapsed=0,m.collisionPaused=!1,m.collisionCount=0,m.eventDepth=i,m.attractionCurveSide=ar(r.seed,g,2738958700)<.5?-1:1,m.trail.history.length=0,m.trail.bones.length=0,m.trail.currentWidth=0,m.trail.currentAlpha=0,m.trail.currentColor=16777215,m.trail.resourceId=x.id;const v=Math.min(100,Math.max(0,Number(x.trailRatio)||0)),y=r.mode==="burst"?Math.max(0,Math.round(r.burstCount)):Math.max(0,Math.floor(r.rate*(r.streamBehavior==="loop"?Math.max(1,r.loopDurationFrames)/30:Math.max(0,r.duration)))),w=v>0&&y===1&&g===0,_=ar(r.seed,g,668265261)*100,S=(C,A,P,E,R)=>{if(C!=="random")return Math.max(0,Number(A)||0);const O=Math.max(0,Math.min(Number(P)||0,Number(E)||0)),U=Math.max(0,Math.max(Number(P)||0,Number(E)||0));return Mi(O,U,ar(r.seed,g,R))};if(m.trail.sampledLength=S(x.lengthMode,x.length,x.lengthMin,x.lengthMax,374761393),m.trail.sampledWidth=S(x.widthSizeMode,x.width,x.widthMin,x.widthMax,3550635116),m.trail.enabled=r.trail&&(w||_0&&m.trail.sampledWidth>0,m.trail.mesh&&(m.trail.mesh.visible=!1),m.active=!0,m.life=h,m.maxLife=h,m.x=l,m.y=c,m.trail.enabled&&m.trail.history.push({x:l,y:c}),m.vx=Math.cos(f)*u,m.vy=Math.sin(f)*u,m.scaleStartX=Io(r.scaleMode,r.scaleMin,r.scaleMax,r.scaleCurve,this.rng())*p.scale,m.scaleStartY=r.scaleAxisMode==="separate"?Io(r.scaleMode,r.scaleYMin,r.scaleYMax,r.scaleYCurve,this.rng())*p.scale:m.scaleStartX,m.alphaStart=r.alpha,m.alphaEnd=r.alphaEnd,m.rotation=r.initialRotationMode==="direction"?-Math.atan2(m.vy,m.vx)*180/Math.PI+r.initialRotationMin:Io(r.initialRotationMode,r.initialRotationMin,r.initialRotationMax,r.initialRotationCurve,this.rng())+d,m.rotationSpeed=r.rotationOverLifeEnabled?Io(r.rotationOverLifeMode,r.rotationSpeedMin,r.rotationSpeedMax,r.rotationOverLifeCurve,this.rng()):0,m.speedScale=1,m.speedScaleTarget=r.speedOverLifeMode==="random"?Mi(r.speedOverLifeMin,r.speedOverLifeMax,this.rng()):r.speedOverLifeMin,m.scaleOverLifeX=r.scaleOverLifeMode==="random"?Mi(r.scaleOverLifeMin,r.scaleOverLifeMax,this.rng()):r.scaleOverLifeMin,m.scaleOverLifeY=r.scaleOverLifeMode==="random"?Mi(r.scaleYOverLifeMin,r.scaleYOverLifeMax,this.rng()):r.scaleYOverLifeMin,m.resourceId=p.id,m.colorSample=p.colorMode==="random"?ym(p.colorGradient,ar(r.seed,g,2654435769)):sa(p.colorStart),m.colorAdd=0,m.colorOverride=null,n){const C=n.attributes;C.includes("color")&&(n.colorMode==="replace"?m.colorOverride=n.data.colorHex:m.colorAdd=n.data.colorHex),C.includes("scale")&&(m.scaleStartX*=n.data.scaleX,m.scaleStartY*=n.data.scaleY),C.includes("life")&&(m.life=Math.max(1e-4,n.data.life),m.maxLife=m.life)}m.currentScaleX=m.scaleStartX,m.currentScaleY=m.scaleStartY;const b=$v(p,0);return m.imageFrameIndex=b.index,m.sprite.texture=lf(p,r.texture,b.index),m.sprite.anchor.set(p.anchorX,p.anchorY),m.sprite.blendMode=br[p.blend],m.sprite.tint=m.colorOverride??Uv(m.colorSample,m.colorAdd),m.sprite.visible=!0,this.emitLocalEvent("birth",m,m.x,m.y),!0}kill(t){const i=this.pool[t];i.active&&this.emitLocalEvent("death",i,i.x,i.y),i.active=!1,i.sprite.visible=!1,Dc(i.trail)}clear(){this.pendingEventSpawns.length=0;for(const t of this.pool)t.active=!1,t.sprite.visible=!1,Dc(t.trail)}get activeCount(){let t=0;for(const i of this.pool)i.active&&t++;return t}capture(){const t=[];for(const i of this.pool)i.active&&t.push({boneName:i.boneName,spawnId:i.spawnId,x:i.sprite.x,y:i.sprite.y,rotation:i.rotation,scaleX:i.sprite.scale.x,scaleY:i.sprite.scale.y,...this.captureWorldTransform(i),alpha:i.sprite.alpha,colorHex:i.sprite.tint,resourceId:i.resourceId,imageFrameIndex:i.imageFrameIndex,imageVisible:i.sprite.visible,active:!0,trailState:this.cfg.trail&&i.trail.bones.length?{bones:i.trail.bones.map(n=>{var o;const r=tr(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:i.trail.bones.length,width:i.trail.currentWidth,alpha:i.trail.currentAlpha,colorHex:i.trail.currentColor,resourceId:i.trail.resourceId}:void 0});return t}captureWorldTransform(t){var r,o,a;const i=tr(this.cfg,t.sprite.x,t.sprite.y,this.simulationTransform),n=((r=this.simulationTransform)==null?void 0:r.rotation)??this.cfg.rootRotation;return{worldX:i.x,worldY:i.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){const i=new Map;for(const n of t)i.set(n.boneName,n);for(const n of this.pool){const r=i.get(n.boneName);if(!r){n.active=!1,n.sprite.visible=!1,n.trail.mesh&&(n.trail.mesh.visible=!1);continue}n.active=r.active;const o=n.sprite;if(o.visible=r.active&&r.imageVisible!==!1,o.x=r.x,o.y=r.y,o.rotation=-r.rotation*Math.PI/180,o.scale.set(r.scaleX,r.scaleY),o.alpha=r.alpha,o.tint=r.colorHex,r.resourceId!=null){const a=this.cfg.imageResources.find(l=>l.id===r.resourceId);a&&(n.imageFrameIndex=r.imageFrameIndex??0,o.texture=lf(a,this.cfg.texture,n.imageFrameIndex),o.anchor.set(a.anchorX,a.anchorY),o.blendMode=br[a.blend])}this.cfg.trail&&r.trailState?this.trail.applyState(n.trail,this.cfg,n.sprite,r.trailState):n.trail.mesh&&(n.trail.mesh.visible=!1)}}reset(){this.pendingEventSpawns.length=0;for(const t of this.pool)t.active=!1,t.sprite.visible=!1,Dc(t.trail);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=af(this.cfg.seed>>>0)}restartEmissionCycle(){this.pendingEventSpawns.length=0,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=af(this.cfg.seed>>>0)}}const fo=new Map,ao=new Map;function _R(s){return[...fo.values()].some(e=>e===s)}function E1(s){if(!(_R(s)||(ao.get(s)||0)>0)){ao.delete(s);for(const e of s.textures)e.destroy(!0)}}function CR(s){const e=ao.get(s)||0;e>1?ao.set(s,e-1):ao.delete(s),E1(s)}function ER(s){return fo.get(s)||null}function pu(s,e){Fl(s),fo.set(s,e)}function AR(s){const e=fo.get(s);return e?(ao.set(e,(ao.get(e)||0)+1),e):null}function IR(s,e){const t=fo.get(s);return t?(pu(e,t),!0):!1}function Fl(s){const e=fo.get(s);e&&(fo.delete(s),E1(e))}function Vt(s){if(Array.isArray(s))return s.map(e=>Vt(e));if(s&&typeof s=="object"){const e=Object.getPrototypeOf(s);if(e===Object.prototype||e===null){const t={};for(const[i,n]of Object.entries(s))t[i]=Vt(n);return t}}return s}const A1=["3.8","4.0","4.1","4.2","4.3"];function yh(s){const e=String(s||"").trim();return A1.find(t=>e===t||e.startsWith(`${t}.`))||null}function xm(){return A1.join(" / ")}function RR(s){return s==="4.3"?"4.3":"4.2"}function _p(){return{imagesPath:"./images/",spineVersion:"4.2",keyframeCurve:"bezier",fps:30,omitFps:!1,integerFrameAlignment:!0,bonePool:!0,excludeEmptyAnimations:!1,fileName:"SpineParticle.json"}}function I1(s){const e=Object.assign(_p(),s||{});return e.imagesPath=String(e.imagesPath||"./images/"),e.spineVersion=yh(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}const bm=30;function Uc(s,e=1){return Math.min(1800,Math.max(1,Math.ceil(Number(s)||e)))}function R1(s,e=30){const t=Math.max(0,Number(s.lifeMin)||0),i=Math.max(0,Number(s.lifeMax)||0),n=s.lifeMode==="fixed"?t:Math.max(t,i);return Uc(Math.ceil(n*Math.max(1,e)),bm)}function Ps(s,e=30){const t=Uc(s.loopDurationFrames),i=R1(s,e),n=s.generateLoopStartAnimation?s.loopStartUseCustomDuration?Uc(s.loopStartDurationFrames,bm):i:0,r=s.generateLoopEndAnimation?s.loopEndUseCustomDuration?Uc(s.loopEndDurationFrames,bm):i:0;return{start:n,loop:t,end:r,total:n+t+r}}function P1(s,e){const t=Ps(s,e),n=Math.max(0,Math.ceil(Math.max(0,Number(s.delay)||0)*Math.max(1,e)))+t.start;return{start:n,end:n+t.loop}}function ha(s){var t,i;const e=new Set;for(const n of s){if(((t=n.config)==null?void 0:t.eventEnabled)===!1)continue;const r=(i=n.config)==null?void 0:i.events;if(Array.isArray(r))for(const o of r)o.targetSystemId>0&&o.targetSystemId!==n.id&&e.add(o.targetSystemId)}return e}function k1(s,e){var r,o;const t=new Map;for(const a of s){if(((r=a.config)==null?void 0:r.eventEnabled)===!1)continue;const l=(o=a.config)==null?void 0:o.events;if(Array.isArray(l))for(const c of l){if(c.targetSystemId<=0||c.targetSystemId===a.id)continue;const h=t.get(c.targetSystemId);h?h.push(a.id):t.set(c.targetSystemId,[a.id])}}const i=new Set,n=[...t.get(e)||[]];for(;n.length;){const a=n.pop();i.has(a)||(i.add(a),n.push(...t.get(a)||[]))}return i.delete(e),i}const PR=.001;function F1(s,e){const t=Math.max(1,Number(e)||30),n=Math.max(0,Number(s)||0)*t+PR*t;return Math.max(0,Math.floor(n))}function O1(s,e,t){const i=Math.max(1,Math.floor(t)-1),n=Math.min(i-1,Math.max(0,Math.floor(Number(s)||0))),r=Math.min(i,Math.max(n+1,Math.floor(Number(e)||i)));return{start:n,end:r}}function cf(s,e,t,i){const n=Math.max(1,Math.floor(i)-1);return O1(s?e:0,s?t:n,i)}function kR(s,e,t){const i=Math.max(1,e-1),n=Math.max(1,t-1),r=s.end>=i?n:s.end;return O1(s.start,r,t)}let pc=1,gc=1,vc=1,yc=1;function xc(s,e){const t=new Set(e),i=`${s} Copy`;if(!t.has(i))return i;let n=2;for(;t.has(`${i} ${n}`);)n++;return`${i} ${n}`}const yo=z2("particle",{state:()=>({editor:{viewScale:1,viewX:0,viewY:0},systems:[],colliders:[],paths:[],spines:[],activeId:0,activeObjectType:"particle",activeObjectId:0,timeline:{playing:!0,loop:!0,abLoop:!1,frame:0,totalFrames:60,playbackStart:0,playbackEnd:59,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:_p()}}),getters:{activeSystemCount:s=>s.systems.length,playbackRange:s=>cf(s.timeline.abLoop,s.timeline.playbackStart,s.timeline.playbackEnd,s.timeline.totalFrames)},actions:{syncSceneSequences(){pc=Math.max(pc,...this.systems.map(s=>s.id+1),1),gc=Math.max(gc,...this.colliders.map(s=>s.id+1),1),vc=Math.max(vc,...this.paths.map(s=>s.id+1),1),yc=Math.max(yc,...this.spines.map(s=>s.id+1),1)},addSystem(s){const e=Sl();s!=null&&s.config&&Object.assign(e,s.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 l=/^ParticleSystem(\d+)$/.exec(a.config.name);l&&(r=Math.max(r,parseInt(l[1],10)))}e.name=`ParticleSystem${r+1}`;let o=2;for(;t.has(e.name);)e.name=`ParticleSystem${r+o}`,o++}const i=this.timeline.animations.includes(this.timeline.animation)?this.timeline.animation:this.timeline.animations[0]||"animation",n={id:pc++,visible:!0,animation:i,config:e};return this.systems.push(n),this.activeId=n.id,this.activeObjectType="particle",this.activeObjectId=n.id,n},removeSystem(s){var i;const e=this.systems.findIndex(n=>n.id===s);e>=0&&this.systems.splice(e,1),this.activeId===s&&(this.activeId=((i=this.systems[0])==null?void 0:i.id)??0);const t=this.systems.find(n=>n.id===this.activeId);if(t&&(this.timeline.animation=t.animation),this.activeObjectType==="particle"&&this.activeObjectId===s){const n=this.systems[0];this.activeObjectId=(n==null?void 0:n.id)??0}},selectSystem(s){this.activeId=s,this.activeObjectType="particle",this.activeObjectId=s;const e=this.systems.find(t=>t.id===s);e&&(this.timeline.animation=e.animation)},setSystemAnimation(s,e){if(!this.timeline.animations.includes(e))return;const t=this.systems.find(i=>i.id===s);t&&(t.animation=e,this.timeline.animation=e)},addAnimation(){const s=new Set(this.timeline.animations);let e=2,t=`animation${e}`;for(;s.has(t);)t=`animation${++e}`;this.timeline.animations.push(t),this.timeline.animation=t;const i=this.systems.find(n=>n.id===this.activeId);return i&&(i.animation=t),t},renameAnimation(s,e){const t=e.trim(),i=this.timeline.animations.indexOf(s);if(i<0||!t||t!==s&&this.timeline.animations.includes(t))return!1;this.timeline.animations[i]=t;for(const n of this.systems)n.animation===s&&(n.animation=t);return this.timeline.animation===s&&(this.timeline.animation=t),!0},removeAnimation(s){if(this.timeline.animations.length<=1)return!1;const e=this.timeline.animations.indexOf(s);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 i of this.systems)i.animation===s&&(i.animation=t);return this.timeline.animation===s&&(this.timeline.animation=t),!0},addCollider(){const s=gc++,e={id:s,name:`Collider${s}`,visible:!0,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 s=vc++,e={id:s,name:`Path${s}`,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 s=yc++,e={id:s,name:`SpineSkeleton${s}`,enabled:!0,visible:!0,x:0,y:0,rotation:0,scaleX:1,scaleY:1,timeOffset:0,skeletonFileName:"",atlasFileName:"",textureFileNames:[],dataVersion:"",sourceBundle:null,selectedAnimation:"",selectedBone:"",selectedSlot:"",animations:[],bones:[],slots:[],assetVersion:0,status:"empty",error:""};return this.spines.push(e),this.activeObjectType="spine",this.activeObjectId=e.id,e},duplicateSelectedObject(){const s=this.activeObjectId;if(!s)return null;if(this.activeObjectType==="particle"){const i=this.systems.find(r=>r.id===s);if(!i)return null;const n=Vt(i);return n.id=pc++,n.config.name=xc(i.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 i=this.colliders.find(r=>r.id===s);if(!i)return null;const n=Vt(i);return n.id=gc++,n.name=xc(i.name,this.colliders.map(r=>r.name)),this.colliders.push(n),this.activeObjectId=n.id,n}if(this.activeObjectType==="path"){const i=this.paths.find(r=>r.id===s);if(!i)return null;const n=Vt(i);return n.id=vc++,n.name=xc(i.name,this.paths.map(r=>r.name)),this.paths.push(n),this.activeObjectId=n.id,n}const e=this.spines.find(i=>i.id===s);if(!e)return null;const t=Vt(e);return t.id=yc++,t.name=xc(e.name,this.spines.map(i=>i.name)),t.selectedBone="",t.selectedSlot="",IR(e.id,t.id),this.spines.push(t),this.activeObjectId=t.id,t},selectSceneObject(s,e){if(this.activeObjectType=s,this.activeObjectId=e,s==="particle"){this.activeId=e;const t=this.systems.find(i=>i.id===e);t&&(this.timeline.animation=t.animation)}},removeCollider(s){var t;const e=this.colliders.findIndex(i=>i.id===s);e>=0&&this.colliders.splice(e,1);for(const i of this.systems){const n=Xn(i.config);n.collisionColliderIds=n.collisionColliderIds.filter(r=>r!==s)}if(this.activeObjectType==="collision"&&this.activeObjectId===s){const i=this.systems[0];this.activeObjectType=i?"particle":"collision",this.activeObjectId=(i==null?void 0:i.id)??((t=this.colliders[0])==null?void 0:t.id)??0}},removePath(s){var t;const e=this.paths.findIndex(i=>i.id===s);if(e>=0&&this.paths.splice(e,1),this.activeObjectType==="path"&&this.activeObjectId===s){const i=this.systems[0];this.activeObjectType=i?"particle":"path",this.activeObjectId=(i==null?void 0:i.id)??((t=this.paths[0])==null?void 0:t.id)??0}},removeSpine(s){Fl(s);const e=this.spines.findIndex(t=>t.id===s);if(e>=0&&this.spines.splice(e,1),this.activeObjectType==="spine"&&this.activeObjectId===s){const t=this.systems[0],i=this.colliders[0],n=this.paths[0],r=this.spines[0];t?(this.activeObjectType="particle",this.activeObjectId=t.id,this.activeId=t.id):i?(this.activeObjectType="collision",this.activeObjectId=i.id):n?(this.activeObjectType="path",this.activeObjectId=n.id):(this.activeObjectType="spine",this.activeObjectId=(r==null?void 0:r.id)??0)}this.recalcTotalFrames()},play(){const s=this.playbackRange;(this.timeline.frame=s.end)&&(this.timeline.frame=s.start),this.timeline.playing=!0},pause(){this.timeline.playing=!1},togglePlay(){this.timeline.playing?this.pause():this.play()},toStart(){this.timeline.frame=this.playbackRange.start},previousFrame(){this.timeline.playing=!1,this.timeline.frame=Math.max(this.playbackRange.start,this.timeline.frame-1)},nextFrame(){this.timeline.playing=!1,this.timeline.frame=Math.min(this.playbackRange.end,this.timeline.frame+1)},toEnd(){this.timeline.playing=!1,this.timeline.frame=this.playbackRange.end},toggleLoop(){this.timeline.loop=!this.timeline.loop},toggleABLoop(){this.timeline.abLoop=!this.timeline.abLoop;const s=this.playbackRange;(this.timeline.frames.end)&&(this.timeline.frame=s.start)},setFrame(s){this.timeline.frame=Math.max(0,Math.min(s,this.timeline.totalFrames-1))},setPlaybackStart(s){const e=cf(!0,s,this.timeline.playbackEnd,this.timeline.totalFrames);this.timeline.playbackStart=e.start,this.timeline.playbackEnd=e.end,this.timeline.abLoop&&this.timeline.framee.end&&(this.timeline.frame=e.end)},recalcTotalFrames(){const s=Math.max(1,this.timeline.fps||30),e=u=>{const d=Math.max(0,Number(u.lifeMin)||0),f=Math.max(0,Number(u.lifeMax)||0);return u.lifeMode==="fixed"?d:Math.max(d,f)},t=new Map(this.systems.map(u=>[u.id,u])),i=new Map,n=new Set,r=u=>{const d=i.get(u.id);if(d!=null)return d;if(n.has(u.id))return 0;n.add(u.id);const f=u.config,m=e(f);let p=m;if(f.eventEnabled)for(const g of f.events||[]){const x=t.get(g.targetSystemId);if(!x||x.id===u.id)continue;const v=r(x),y=g.event==="birth"?0:m,w=Math.max(0,Number(x.config.delay)||0);p=Math.max(p,y+w+v)}return n.delete(u.id),i.set(u.id,p),p},o=ha(this.systems);let a=0;for(const u of this.systems){if(o.has(u.id))continue;const d=u.config,f=Math.max(0,Number(d.delay)||0),m=d.mode==="stream"&&d.streamBehavior==="loop";let p;if(d.mode==="stream"){const g=m?Ps(d,s).total/s:Math.max(1/s,Number(d.duration)||0);if(p=f+g,m){let x=0;if(d.eventEnabled){const v=e(d);for(const y of d.events||[]){const w=t.get(y.targetSystemId);if(!w||w.id===u.id)continue;const _=Math.max(0,Number(w.config.delay)||0);x=Math.max(x,(y.event==="birth"?0:v)+_+r(w))}}p+=x}else p+=r(u)}else p=f+r(u);p>a&&(a=p)}for(const u of this.spines){const d=u.animations.find(m=>m.name===u.selectedAnimation);if(!d)continue;const f=Math.max(0,Number(u.timeOffset)||0)+Math.max(0,d.duration||0);f>a&&(a=f)}for(const u of this.colliders){if(!u.followPath||!u.followPathId)continue;const d=Math.max(0,Number(u.followDuration)||0);d>a&&(a=d)}const l=this.timeline.totalFrames,c=Math.max(2,F1(a,s)+1);this.timeline.totalFrames=c;const h=kR({start:this.timeline.playbackStart,end:this.timeline.playbackEnd},l,c);return this.timeline.playbackStart=h.start,this.timeline.playbackEnd=h.end,this.timeline.frame>=c&&(this.timeline.frame=c-1),c}}}),L1="SpineParticle.SystemSettings",B1=1,hf="SpineParticle.SystemSettings.v1";function Ba(s,e,t,i){const n=Number(s);return Math.min(t,Math.max(e,Number.isFinite(n)?n:i))}function FR(s){return{parameterPanelOnRight:s.parameterPanelOnRight,undoLimit:s.undoLimit,showEmitter:s.showEmitter,showBones:s.showBones,bonePointDrawSize:s.bonePointDrawSize,boneAxisDrawSize:s.boneAxisDrawSize,showSkinMesh:s.showSkinMesh,tickEnabled:s.tickEnabled,axisFontSize:s.axisFontSize,tickWidth:s.tickWidth,showAxisLabels:s.showAxisLabels,axisColor:s.axisColor}}function OR(s,e){const t=n=>s[n]==null?!!e[n]:s[n]===!0,i=typeof s.axisColor=="string"&&/^#[0-9a-f]{6}$/i.test(s.axisColor)?s.axisColor:e.axisColor;return{parameterPanelOnRight:t("parameterPanelOnRight"),undoLimit:Math.round(Ba(s.undoLimit,1,200,e.undoLimit)),showEmitter:t("showEmitter"),showBones:t("showBones"),bonePointDrawSize:Ba(s.bonePointDrawSize,.1,10,e.bonePointDrawSize),boneAxisDrawSize:Ba(s.boneAxisDrawSize,.1,10,e.boneAxisDrawSize),showSkinMesh:t("showSkinMesh"),tickEnabled:t("tickEnabled"),axisFontSize:Math.round(Ba(s.axisFontSize,8,40,e.axisFontSize)),tickWidth:Ba(s.tickWidth,1,5,e.tickWidth),showAxisLabels:t("showAxisLabels"),axisColor:i}}function LR(s){let e;try{e=JSON.parse(s)}catch{throw new Error("系统设置缓存不是有效的 JSON")}const t=e;if(t.format!==L1)throw new Error("不是 Spine粒子编辑器系统设置缓存");if(t.version!==B1)throw new Error(`暂不支持系统配置版本:${t.version??"未知"}`);if(!t.settings||typeof t.settings!="object")throw new Error("系统设置缓存缺少 settings");return t}function BR(s,e){Object.assign(s.settings,OR(e,s.settings))}let bc=null;function NR(s){bc==null||bc();try{const e=localStorage.getItem(hf);e&&BR(s,LR(e).settings)}catch{try{localStorage.removeItem(hf)}catch{}}bc=ai(()=>FR(s.settings),e=>{const t={format:L1,version:B1,savedAt:new Date().toISOString(),settings:e};try{localStorage.setItem(hf,JSON.stringify(t))}catch{}},{deep:!0})}function DR(s,e=0){if(s<=0)return 1;const t=Math.pow(10,Math.floor(Math.log10(s))),i=[1,2,5,10,20,50,100];let n=1;for(const r of i)if(r*t>=s){n=r*t;break}return Math.max(n,e)}function UR(s,e,t,i,n){if(!t)return;const r=t;r.clear();const o=s.settings;if(!o.tickEnabled){for(const b of n)b.visible=!1;return}const a=0,l=0,c=e.screen.width/s.editor.viewScale,h=e.screen.height/s.editor.viewScale,u=+("0x"+o.axisColor.replace("#",""));r.lineStyle(1.5,u,.35),r.moveTo(-c,l),r.lineTo(c,l),r.moveTo(a,-h),r.lineTo(a,h);const d=s.editor.viewScale,f=DR(50/d),m=c,p=h,g=Math.max(1,o.tickWidth);if(o.tickEnabled){for(let b=0;b<=c;b+=f){const C=Math.round(b/f)*f;C!==0&&(r.lineStyle(g,u,.25),r.moveTo(C,l-4),r.lineTo(C,l+4),r.moveTo(-C,l-4),r.lineTo(-C,l+4))}for(let b=0;b<=h;b+=f)Math.round(b/f)*f!==0&&(r.lineStyle(g,u,.25),r.moveTo(a-4,b),r.lineTo(a+4,b),r.moveTo(a-4,-b),r.lineTo(a+4,-b))}const x=e.screen.width/2+s.editor.viewX,v=e.screen.height*.5+s.editor.viewY,y=o.axisFontSize,w=+("0x"+o.axisColor.replace("#",""));for(;n.length<64;){const b=new Tp("",{fontFamily:"monospace",fontSize:y,fill:w});b.anchor.set(.5,.5),i.addChild(b),n.push(b)}let _=0;const S=o.showAxisLabels&&o.tickEnabled;for(let b=0;b<=c;b+=f){const C=Math.round(b/f)*f;if(C===0||!S||C>m)continue;const A=n[_++];if(!A)break;A.style.fontSize=y,A.text=String(C),A.position.set(x+C*d,v+9),A.visible=!0;const P=n[_++];if(!P)break;P.style.fontSize=y,P.text=String(-C),P.position.set(x-C*d,v+9),P.visible=!0}for(let b=0;b<=h;b+=f){const C=Math.round(b/f)*f;if(C===0||!S||C>p)continue;const A=n[_++];if(!A)break;A.style.fontSize=y,A.text=String(C),A.position.set(x+8,v-b*d),A.visible=!0;const P=n[_++];if(!P)break;P.style.fontSize=y,P.text=String(-C),P.position.set(x+8,v+b*d),P.visible=!0}for(;_v.id===s.activeId);if(!n||n.visible===!1)return;const r=n.config;if(!r.showShape)return;const o=e.get(n.id),a=(o==null?void 0:o.x)??r.centerX??0,l=-((o==null?void 0:o.y)??r.centerY??0),c=r.shape;if(c==="point"||c==="path")return;const h=r.rootScaleX??1,u=r.rootScaleY??1,d=-((o==null?void 0:o.rotation)??r.rootRotation??0)*Math.PI/180,f=Math.cos(d),m=Math.sin(d),p=r.offsetX??0,g=r.offsetY??0,x=(v,y)=>{const w=v+p,_=-y-g,S=w*h,b=_*u;return[a+S*f-b*m,l+(S*m+b*f)]};if(c==="circle"){const v=vh(r.innerRadius,r.outerRadius);i.lineStyle(2,3991658,.7);const y=48;for(const w of[v.outer,v.inner])if(!(w<=0))for(let _=0;_<=y;_++){const S=_/y*Math.PI*2,[b,C]=x(Math.cos(S)*w,Math.sin(S)*w);_===0?i.moveTo(b,C):i.lineTo(b,C)}}else if(c==="rect"){const v=_1(r);i.lineStyle(2,4885759,.7);for(const[y,w]of[[v.outerW,v.outerH],[v.innerW,v.innerH]]){if(y<=0||w<=0)continue;const _=y/2,S=w/2,b=x(-_,-S),C=x(_,-S),A=x(_,S),P=x(-_,S);i.moveTo(b[0],b[1]),i.lineTo(C[0],C[1]),i.lineTo(A[0],A[1]),i.lineTo(P[0],P[1]),i.lineTo(b[0],b[1])}}else if(c==="cone"){const v=vh(r.innerRadius,r.outerRadius),y=r.coneAngle/2*Math.PI/180,w=r.coneDirection*Math.PI/180,_=x(Math.cos(w-y)*v.inner,Math.sin(w-y)*v.inner),S=x(Math.cos(w+y)*v.inner,Math.sin(w+y)*v.inner),b=x(Math.cos(w-y)*v.outer,Math.sin(w-y)*v.outer),C=x(Math.cos(w+y)*v.outer,Math.sin(w+y)*v.outer);i.lineStyle(2,3991658,.7),i.moveTo(_[0],_[1]),i.lineTo(b[0],b[1]),i.moveTo(S[0],S[1]),i.lineTo(C[0],C[1]),i.lineStyle(1,3991658,.5);const A=24;for(const P of[v.outer,v.inner])if(!(P<=0))for(let E=0;E<=A;E++){const R=w-y+2*y*E/A,[O,U]=x(Math.cos(R)*P,Math.sin(R)*P);E===0?i.moveTo(O,U):i.lineTo(O,U)}}}function VR(s,e){if(!e)return;const t=e;t.clear();const i=s.systems.find(l=>l.id===s.activeId);if((i==null?void 0:i.visible)===!1)return;const n=i==null?void 0:i.config;if(!(n!=null&&n.forceField)||!n.showForceFieldShape||n.forceRadius<=0)return;const r=n.forceCenterX,o=-n.forceCenterY,a=n.forceStrength>=0?5818367:16739194;t.lineStyle(2,a,.85),t.beginFill(a,.08),t.drawCircle(r,o,n.forceRadius),t.endFill(),t.lineStyle(1,a,.7),t.moveTo(r-9,o),t.lineTo(r+9,o),t.moveTo(r,o-9),t.lineTo(r,o+9),t.beginFill(a,.95),t.drawCircle(r,o,4),t.endFill()}function YR(s,e){if(!e)return;const t=e;t.clear();const i=s.systems.find(u=>u.id===s.activeId);if((i==null?void 0:i.visible)===!1)return;const n=i==null?void 0:i.config;if(!(n!=null&&n.vortex)||!n.showVortexShape||n.vortexRadius<=0)return;const r=n.vortexCenterX,o=-n.vortexCenterY,a=n.vortexStrength>=0?12156159:16753228;t.lineStyle(2,a,.9),t.beginFill(a,.07),t.drawCircle(r,o,n.vortexRadius),t.endFill(),t.beginFill(a,.95),t.drawCircle(r,o,4),t.endFill();const l=r+Math.min(n.vortexRadius*.65,50),c=n.vortexStrength>=0?-1:1,h=o+c*14;t.lineStyle(2,a,.9),t.moveTo(l,o+c*-8),t.lineTo(l,h),t.moveTo(l,h),t.lineTo(l-4,h-c*5),t.moveTo(l,h),t.lineTo(l+4,h-c*5)}function GR(s,e){if(!e)return;const t=e;t.clear();const i=s.systems.find(c=>c.id===s.activeId);if((i==null?void 0:i.visible)===!1)return;const n=i==null?void 0:i.config;if(!(n!=null&&n.attraction)||!n.showAttractionShape)return;const r=n.attractionCenterX,o=-n.attractionCenterY,a=Math.max(0,n.attractionRadius),l=16731487;a>0&&(t.lineStyle(2,l,.95),t.beginFill(l,.09),t.drawCircle(r,o,a),t.endFill()),t.lineStyle(1,l,.85),t.moveTo(r-10,o),t.lineTo(r+10,o),t.moveTo(r,o-10),t.lineTo(r,o+10),t.beginFill(l,1),t.drawCircle(r,o,a>0?4:6),t.endFill()}function jR(s,e,t){const i=s.rotation*Math.PI/180,n=Math.cos(i),r=Math.sin(i),o=Math.max(1e-4,Math.abs(s.scaleX??1)),a=Math.max(1e-4,Math.abs(s.scaleY??1));return{x:s.x+n*e*o-r*t*a,y:s.y+r*e*o+n*t*a}}function Ro(s,e,t){const i=s.rotation*Math.PI/180,n=Math.cos(i),r=Math.sin(i),o=Math.max(1e-4,Math.abs(s.scaleX??1)),a=Math.max(1e-4,Math.abs(s.scaleY??1)),l=e-s.x,c=t-s.y;return{x:(n*l+r*c)/o,y:(-r*l+n*c)/a}}function N1(s,e,t="linear"){if(!s.length)return e;const i=[...s].sort((n,r)=>n.x-r.x);if(e<=i[0].x)return i[0].y;for(let n=1;nc.id===a.emitterFollowSpineId);!l||l.visible===!1||n.set(`${a.emitterFollowSpineId}:${a.emitterFollowBoneName}`,{spineId:a.emitterFollowSpineId,boneName:a.emitterFollowBoneName})}for(const o of n.values()){const a=e==null?void 0:e.getBoneWorldTransform(o.spineId,o.boneName);if(!a)continue;const l=a.x,c=-a.y;i.lineStyle(2,12881151,.95),i.beginFill(12881151,.2),i.drawCircle(l,c,8),i.endFill(),i.beginFill(15919103,1),i.drawCircle(l,c,3.5),i.endFill()}}function WR(s,e,t){if(!t)return;const i=t;if(i.clear(),!s.value)return;const n=e();if(!n)return;const r=n.x,o=-n.y,a=n.scaleX,l=n.scaleY,c=-n.rotation*Math.PI/180,h=Math.cos(c),u=Math.sin(c),d=(p,g)=>{const x=p*a,v=-g*l;return[r+x*h-v*u,o+(x*u+v*h)]},f=(p,g,x,v)=>{const y=d(p,g),w=d(x,v);i.moveTo(y[0],y[1]),i.lineTo(w[0],w[1])},m=26;if(i.lineStyle(2,3526911,.9),i.beginFill(3526911,.25),i.drawCircle(r,o,6),i.endFill(),s.value==="translate")i.lineStyle(2,3526911,.9),f(-m,0,m,0),f(0,-m,0,m),f(m-6,-4,m,0),f(m,0,m-6,4),f(-20,-4,-m,0),f(-m,0,-20,4),f(-4,m-6,0,m),f(0,m,4,m-6),f(-4,-20,0,-m),f(0,-m,4,-20);else if(s.value==="rotate"){i.lineStyle(2,3526911,.8);const p=48;for(let v=0;v<=p;v++){const y=v/p*Math.PI*2,[w,_]=d(Math.cos(y)*m,Math.sin(y)*m);v===0?i.moveTo(w,_):i.lineTo(w,_)}const[g,x]=d(0,m);i.beginFill(3526911,.95),i.drawCircle(g,x,4),i.endFill()}else if(s.value==="scale"){i.lineStyle(2,3526911,.9);const g=[[-m,-m],[m,-m],[m,m],[-m,m]].map(([x,v])=>d(x,v));i.moveTo(g[0][0],g[0][1]),i.lineTo(g[1][0],g[1][1]),i.lineTo(g[2][0],g[2][1]),i.lineTo(g[3][0],g[3][1]),i.lineTo(g[0][0],g[0][1]),i.beginFill(3526911,.9);for(const x of g)i.drawRect(x[0]-3,x[1]-3,6,6);i.endFill()}}function zR(s,e=16777215){const t=Number.parseInt(s.replace("#",""),16);return Number.isFinite(t)?t:e}function qR(s,e,t){if(!t)return;const i=t;i.clear();for(const n of e){if(n.visible===!1)continue;const r=s.activeObjectType==="collision"&&s.activeObjectId===n.id,o=n.enabled?r?16735858:13911899:5792116,a=n.rotation*Math.PI/180,l=Math.cos(a),c=Math.sin(a),h=Math.max(1e-4,Math.abs(n.scaleX??1)),u=Math.max(1e-4,Math.abs(n.scaleY??1)),d=(p,g)=>({x:n.x+l*p*h-c*g*u,y:-(n.y+c*p*h+l*g*u)});let f=[];if(n.shape==="circle"||n.shape==="ellipse"){const p=n.shape==="circle"?n.radius:n.radiusX,g=n.shape==="circle"?n.radius:n.radiusY;f=Array.from({length:49},(x,v)=>{const y=v/48*Math.PI*2;return d(Math.cos(y)*p,Math.sin(y)*g)})}else if(n.shape==="rect"){const p=n.width*.5,g=n.height*.5;f=[d(-p,-g),d(p,-g),d(p,g),d(-p,g),d(-p,-g)]}else{const p=Math.max(3,Math.min(16,Math.round(n.sides)));f=Array.from({length:p+1},(g,x)=>{const v=Math.PI*.5+x%p/p*Math.PI*2;return d(Math.cos(v)*n.width*.5,Math.sin(v)*n.height*.5)})}if(!f.length)continue;i.lineStyle(r?2.5:1.5,o,n.enabled?.95:.45),i.beginFill(o,r?.12:.055),i.moveTo(f[0].x,f[0].y);for(let p=1;po.id===s.activeObjectId):null,r=(n==null?void 0:n.config.shape)==="path"&&!n.config.showShape?n.config.spawnPathId:0;for(const o of s.paths){if(o.id===r||o.visible===!1||!o.enabled||!o.points.length)continue;const a=s.activeObjectType==="path"&&s.activeObjectId===o.id,l=zR(o.color,16749374),c=(f,m)=>{const p=jR(o,f,m);return{x:p.x,y:-p.y}},h=o.points[0],u=c(h.x,h.y);i.lineStyle(a?2.5:1.8,l,a?1:.75),i.moveTo(u.x,u.y);const d=o.closed?o.points.length:o.points.length-1;for(let f=0;f{const p=c(f.x,f.y),g=c(f.x+f.inX,f.y+f.inY),x=c(f.x+f.outX,f.y+f.outY),v=Math.hypot(f.inX,f.inY)>.01,y=Math.hypot(f.outX,f.outY)>.01;i.lineStyle(1,11121867,.65),v&&(i.moveTo(p.x,p.y),i.lineTo(g.x,g.y)),y&&(i.moveTo(p.x,p.y),i.lineTo(x.x,x.y)),v&&(i.beginFill(14015724,.95),i.drawCircle(g.x,g.y,3),i.endFill()),y&&(i.beginFill(14015724,.95),i.drawCircle(x.x,x.y,3),i.endFill()),i.beginFill(e.has(m)?16777215:l,1),i.lineStyle(1.5,e.has(m)?6126847:16777215,.95),i.drawCircle(p.x,p.y,e.has(m)?5:4),i.endFill()})}}function ZR(s,e,t,i){var o;const n=Number.isFinite(e.worldX)&&Number.isFinite(e.worldY),r=Number.isFinite(e.worldRotation);s.push({boneName:e.boneName,x:n?e.worldX:e.x,y:n?-e.worldY:e.y,rotation:r?-e.worldRotation:-e.rotation,parentX:t,parentY:i}),(o=e.trailState)!=null&&o.bones.length&&e.trailState.bones.forEach(a=>{const l=Number.isFinite(a.worldX)&&Number.isFinite(a.worldY),c=Number.isFinite(a.worldRotation);s.push({boneName:a.boneName,x:l?a.worldX:a.x,y:l?-a.worldY:a.y,rotation:c?-a.worldRotation:a.rotation,parentX:t,parentY:i,trail:!0})})}function Yv(s,e,t,i,n,r,o,a){const l=r*.62,c=e+i*r,h=t+n*r,u=Math.max(2.5,r*.32),d=Math.max(1.7,r*.22),f=c-i*u,m=h-n*u,p=-n,g=i;s.lineStyle(o,a,.95),s.moveTo(e-i*l,t-n*l),s.lineTo(f,m),s.lineStyle(0),s.beginFill(a,.95),s.drawPolygon([c,h,f+p*d,m+g*d,f-p*d,m-g*d]),s.endFill()}function JR(s,e,t){if(!t)return;const i=t;if(i.clear(),!e.settings.showBones)return;const n=0,r=0,o=Math.max(.25,Math.abs(e.editor.viewScale)||1),a=Math.min(10,Math.max(.1,Number(e.settings.bonePointDrawSize)||1)),l=Math.min(10,Math.max(.1,Number(e.settings.boneAxisDrawSize)||2)),c=2.5*a/o,h=4.5*l/o,u=Math.max(.65,l*.625)/o;for(const d of s){const f=d.trail?16731533:16747610;i.lineStyle(1,f,d.trail?.65:.35),i.moveTo(d.parentX??n,d.parentY??r),i.lineTo(d.x,d.y);const m=d.rotation*Math.PI/180,p=Math.cos(m),g=Math.sin(m);Yv(i,d.x,d.y,p,g,h,u,15684432),Yv(i,d.x,d.y,g,-p,h,u,5622123),i.beginFill(f,.9),i.drawCircle(d.x,d.y,c),i.endFill()}}function Ii(s){return s.map(e=>({...e,trailState:e.trailState?{...e.trailState,bones:e.trailState.bones.map(t=>({...t}))}:void 0}))}function QR(s){const e=new Map;for(const i of s)for(const n of i)e.has(n.boneName)||e.set(n.boneName,Ii([n])[0]);const t=[...e.keys()].sort((i,n)=>{const r=Number(i.replace(/^p_/,"")),o=Number(n.replace(/^p_/,""));return Number.isFinite(r)&&Number.isFinite(o)?r-o:i.localeCompare(n)});for(let i=0;i[r.boneName,r]));s[i]=t.map(r=>{const o=n.get(r);return o||{...Ii([e.get(r)])[0],alpha:0,imageVisible:!1,trailState:void 0,active:!0}})}}function eP(s){s.length<2||(s[s.length-1]=Ii(s[0]))}function tP(s,e){const t=Math.max(0,s.length-1),i=[];for(let n=0;n<=e;n++){const r=Math.min(t,Math.round(n/e*t));i.push(Ii(s[r]||[]))}return i}function uf(s){return`${s.boneName}:${s.spawnId??"legacy"}`}function Gv(s){return{...Ii([s])[0],alpha:0,imageVisible:!1,trailState:void 0,active:!0}}function iP(s,e,t,i){const n=Math.min(s.length,i+1),r=s.slice(Math.max(0,s.length-n)),o=new Map;for(const c of e){if(c.imageVisible===!1||c.alpha<=0)continue;const h=uf(c),u=new Map;let d=!1;for(let f=r.length-1;f>=0;f--){const m=r[f].find(p=>uf(p)===h);if(m)d=!0,u.set(f,m);else if(d)break}o.set(h,u)}const a=Math.max(0,r.length-1),l=[];for(let c=0;c<=t;c++){const h=Math.min(a,Math.round(c/t*a));l.push(e.map(u=>{var f;if(u.imageVisible===!1||u.alpha<=0)return Ii([u])[0];const d=(f=o.get(uf(u)))==null?void 0:f.get(h);return d?Ii([d])[0]:Gv(u)}))}return l[0]=l[0].map(Gv),l[l.length-1]=Ii(e),l}function jv(s,e){const t=s.length?1:0;for(let i=t;i{const y=v?[[]]:[];e.reset();for(let w=0;w0&&e.restartEmissionCycle();for(let _=0;_0;w++)e.update(r,"off"),v.push(e.capture());(x=v[v.length-1])!=null&&x.length&&v.push([]),jv(u,tP(v,a.end))}const g=Ii(u[u.length-1]||[]);for(u.length>i&&(u.length=i);u.length{var a;return String(((a=o==null?void 0:o.data)==null?void 0:a.name)||"")}):null}catch{return null}}getSlotLocalMatrix(e,t){var o,a,l;const i=(o=this.entries.get(e))==null?void 0:o.spine,n=(l=(a=i==null?void 0:i.skeleton)==null?void 0:a.findSlot)==null?void 0:l.call(a,t),r=n==null?void 0:n.bone;return r!=null&&r.active?new Ft(r.a,r.c,-r.b,-r.d,r.worldX,r.worldY):null}getSlotParentMatrix(e,t,i){const n=this.getSlotLocalMatrix(e,t);if(!n)return null;const r=-i.rotation*Math.PI/180,o=Math.cos(r),a=Math.sin(r);return new Ft(o*i.scaleX,a*i.scaleX,-a*i.scaleY,o*i.scaleY,i.x,-i.y).append(n)}attachSlotObject(e,t,i,n){var o;const r=(o=this.entries.get(e))==null?void 0:o.spine;if(!(r!=null&&r.addSlotObject))return!1;try{return r.addSlotObject(t,i,{followAttachmentTimeline:n}),!0}catch{return!1}}detachSlotObject(e,t,i){var r,o;const n=(r=this.entries.get(e))==null?void 0:r.spine;try{(o=n==null?void 0:n.removeSlotObject)==null||o.call(n,t,i)}catch{}}destroyEntry(e){var t,i;try{(i=(t=e.spine)==null?void 0:t.removeSlotObjects)==null||i.call(t)}catch{}this.container.removeChild(e.root),e.root.destroy({children:!0})}sync(e,t,i){var n;for(const[r,o]of this.entries)e.some(a=>a.id===r)||(this.destroyEntry(o),this.entries.delete(r));for(const r of e){const o=ER(r.id);let a=this.entries.get(r.id);if(a&&a.assetVersion!==r.assetVersion&&!o&&(this.destroyEntry(a),this.entries.delete(r.id),a=void 0),(!a||a.assetVersion!==r.assetVersion)&&o){a&&this.destroyEntry(a);const d=new gi,f=new o.SpineClass({skeletonData:o.skeletonData,autoUpdate:!1,darkTint:!1});o.skeletonData.defaultSkin&&f.skeleton.setSkin(o.skeletonData.defaultSkin),o.runtimeVersion==="4.3"?f.skeleton.setupPoseSlots():f.skeleton.setSlotsToSetupPose(),d.addChild(f),this.container.addChild(d),a={root:d,spine:f,runtimeVersion:o.runtimeVersion,assetVersion:r.assetVersion,animation:""},this.entries.set(r.id,a)}if(!a)continue;const l=a.root,c=a.spine,h=r.visible!==!1&&r.enabled;l.visible=h,l.renderable=h,l.position.set(r.x,-r.y),l.rotation=-r.rotation*Math.PI/180,l.scale.set(r.scaleX,r.scaleY),a.animation!==r.selectedAnimation&&(a.animation=r.selectedAnimation,a.runtimeVersion==="4.3"?c.skeleton.setupPose():c.skeleton.setToSetupPose(),c.state.clearTracks(),a.animation&&c.state.setAnimation(0,a.animation,!1));const u=a.runtimeVersion==="4.3"?c.state.getTrack(0):c.state.getCurrent(0);if(u){const d=((n=r.animations.find(m=>m.name===r.selectedAnimation))==null?void 0:n.duration)||0,f=Math.max(0,t/Math.max(1,i)-r.timeOffset);u.trackTime=d>0?Math.min(f,d):f}c.update(0)}}getBoneWorldTransform(e,t){const i=this.entries.get(e),n=i==null?void 0:i.spine.skeleton.findBone(t);if(!i||!n||!n.active)return null;const r=i.runtimeVersion==="4.3"?n.appliedPose:n,o=i.root,a=Math.cos(o.rotation),l=Math.sin(o.rotation),c=a*o.scale.x,h=-l*o.scale.y,u=l*o.scale.x,d=a*o.scale.y,f=c*r.a+h*r.c,m=c*r.b+h*r.d,p=u*r.a+d*r.c,g=u*r.b+d*r.d,x=o.position.x+c*r.worldX+h*r.worldY,v=o.position.y+u*r.worldX+d*r.worldY;return{x,y:-v,rotation:-Math.atan2(p,f)*180/Math.PI,scaleX:Math.max(1e-4,Math.hypot(f,p)),scaleY:Math.max(1e-4,Math.hypot(m,g))}}destroy(){for(const e of this.entries.values())this.destroyEntry(e);this.entries.clear(),this.container.removeFromParent(),this.container.destroy({children:!0})}}let D1=class{constructor(){M(this,"entries",{});M(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 i=0,n=e.length;i1&&(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 Ai){return t.setFromString(e)}},M(Ai,"WHITE",new Ai(1,1,1,1)),M(Ai,"RED",new Ai(1,0,0,1)),M(Ai,"GREEN",new Ai(0,1,0,1)),M(Ai,"BLUE",new Ai(0,0,1,1)),M(Ai,"MAGENTA",new Ai(1,0,1,1)),Ai);var ii;let Re=(ii=class{static clamp(e,t,i){return ei?i:e}static cosDeg(e){return Math.cos(e*ii.degRad)}static sinDeg(e){return Math.sin(e*ii.degRad)}static atan2Deg(e,t){return Math.atan2(e,t)*ii.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 ii.randomTriangularWith(e,t,(e+t)*.5)}static randomTriangularWith(e,t,i){let n=Math.random(),r=t-e;return n<=(i-e)/r?e+Math.sqrt(n*r*(i-e)):t-Math.sqrt((1-n)*r*(t-i))}static isPowerOfTwo(e){return e&&(e&e-1)===0}},M(ii,"PI",3.1415927),M(ii,"PI2",ii.PI*2),M(ii,"invPI2",1/ii.PI2),M(ii,"radiansToDegrees",180/ii.PI),M(ii,"radDeg",ii.radiansToDegrees),M(ii,"degreesToRadians",ii.PI/180),M(ii,"degRad",ii.degreesToRadians),ii);var Is;let Pe=(Is=class{static arrayCopy(e,t,i,n,r){for(let o=t,a=n;o=t?e:Is.setArraySize(e,t,i)}static newArray(e,t){let i=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 l=t.bone.skeleton,c=t.deform,h=this.vertices,u=this.bones;if(!u){c.length>0&&(h=c);let p=t.bone,g=p.worldX,x=p.worldY,v=p.a,y=p.b,w=p.c,_=p.d;for(let S=i,b=o;b=this.regions.length&&(i=this.regions.length-1);let n=this.regions[i];t.region!=n&&(t.region=n,t.updateRegion())}getPath(e,t){let i=e,n=(this.start+t).toString();for(let r=this.digits-n.length;r>0;r--)i+="0";return i+=n,i}static nextID(){return Nn._nextID++}},M(Nn,"_nextID",0),Nn);var Ti;(function(s){s[s.hold=0]="hold",s[s.once=1]="once",s[s.loop=2]="loop",s[s.pingpong=3]="pingpong",s[s.onceReverse=4]="onceReverse",s[s.loopReverse=5]="loopReverse",s[s.pingpongReverse=6]="pingpongReverse"})(Ti||(Ti={}));const X1=[Ti.hold,Ti.once,Ti.loop,Ti.pingpong,Ti.onceReverse,Ti.loopReverse,Ti.pingpongReverse];let Cp=class{constructor(e,t,i){M(this,"name");M(this,"timelines",[]);M(this,"timelineIds",new D1);M(this,"duration");if(!e)throw new Error("name cannot be null.");this.name=e,this.setTimelines(t),this.duration=i}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 c=this.timelines;for(let h=0,u=c.length;ht)return n-1;return i-1}static search(e,t,i){let n=e.length;for(let r=i;rt)return r-i;return n-i}},pn=class extends Yt{constructor(t,i,n){super(t,n);M(this,"curves");this.curves=Pe.newFloatArray(t+i*18),this.curves[t-1]=1}setLinear(t){this.curves[t]=0}setStepped(t){this.curves[t]=1}shrink(t){let i=this.getFrameCount()+t*18;if(this.curves.length>i){let n=Pe.newFloatArray(i);Pe.arrayCopy(this.curves,0,n,0,i),this.curves=n}}setBezier(t,i,n,r,o,a,l,c,h,u,d){let f=this.curves,m=this.getFrameCount()+t*18;n==0&&(f[i]=2+m);let p=(r-a*2+c)*.03,g=(o-l*2+h)*.03,x=((a-c)*3-r+u)*.006,v=((l-h)*3-o+d)*.006,y=p*2+x,w=g*2+v,_=(a-r)*.3+p+x*.16666667,S=(l-o)*.3+g+v*.16666667,b=r+_,C=o+S;for(let A=m+18;mt){let h=this.frames[i],u=this.frames[i+n];return u+(t-h)/(o[r]-h)*(o[r+1]-u)}let a=r+18;for(r+=2;r=t){let h=o[r-2],u=o[r-1];return u+(t-h)/(o[r]-h)*(o[r+1]-u)}i+=this.getFrameEntries();let l=o[a-2],c=o[a-1];return c+(t-l)/(this.frames[i]-l)*(this.frames[i+n]-c)}},Us=class extends pn{constructor(e,t,i){super(e,t,[i])}getFrameEntries(){return 2}setFrame(e,t,i){e<<=1,this.frames[e]=t,this.frames[e+1]=i}getCurveValue(e){let t=this.frames,i=t.length-2;for(let r=2;r<=i;r+=2)if(t[r]>e){i=r-2;break}let n=this.curves[i>>1];switch(n){case 0:let r=t[i],o=t[i+1];return o+(e-r)/(t[i+2]-r)*(t[i+2+1]-o);case 1:return t[i+1]}return this.getBezierValue(e,i,1,n-2)}getRelativeValue(e,t,i,n,r){if(e>2];switch(g){case 0:let x=h[p];d=h[p+1],f=h[p+2],m=h[p+3];let v=(n-x)/(h[p+4]-x);d+=(h[p+4+1]-d)*v,f+=(h[p+4+2]-f)*v,m+=(h[p+4+3]-m)*v;break;case 1:d=h[p+1],f=h[p+2],m=h[p+3];break;default:d=this.getBezierValue(n,p,1,g-2),f=this.getBezierValue(n,p,2,g+18-2),m=this.getBezierValue(n,p,3,g+36-2)}if(o==1)u.r=d,u.g=f,u.b=m;else{if(a==ye.setup){let x=c.data.color;u.r=x.r,u.g=x.g,u.b=x.b}u.r+=(d-u.r)*o,u.g+=(f-u.g)*o,u.b+=(m-u.b)*o}}},ew=class extends Us{constructor(t,i,n){super(t,i,ht.alpha+"|"+n);M(this,"slotIndex",0);this.slotIndex=n}apply(t,i,n,r,o,a,l){let c=t.slots[this.slotIndex];if(!c.bone.active)return;let h=c.color;if(n>3];switch(_){case 0:let S=h[w];f=h[w+1],m=h[w+2],p=h[w+3],g=h[w+4],x=h[w+5],v=h[w+6],y=h[w+7];let b=(n-S)/(h[w+8]-S);f+=(h[w+8+1]-f)*b,m+=(h[w+8+2]-m)*b,p+=(h[w+8+3]-p)*b,g+=(h[w+8+4]-g)*b,x+=(h[w+8+5]-x)*b,v+=(h[w+8+6]-v)*b,y+=(h[w+8+7]-y)*b;break;case 1:f=h[w+1],m=h[w+2],p=h[w+3],g=h[w+4],x=h[w+5],v=h[w+6],y=h[w+7];break;default:f=this.getBezierValue(n,w,1,_-2),m=this.getBezierValue(n,w,2,_+18-2),p=this.getBezierValue(n,w,3,_+36-2),g=this.getBezierValue(n,w,4,_+54-2),x=this.getBezierValue(n,w,5,_+72-2),v=this.getBezierValue(n,w,6,_+90-2),y=this.getBezierValue(n,w,7,_+108-2)}if(o==1)u.set(f,m,p,g),d.r=x,d.g=v,d.b=y;else{if(a==ye.setup){u.setFromColor(c.data.color);let S=c.data.darkColor;d.r=S.r,d.g=S.g,d.b=S.b}u.add((f-u.r)*o,(m-u.g)*o,(p-u.b)*o,(g-u.a)*o),d.r+=(x-d.r)*o,d.g+=(v-d.g)*o,d.b+=(y-d.b)*o}}},iw=class extends pn{constructor(t,i,n){super(t,i,[ht.rgb+"|"+n,ht.rgb2+"|"+n]);M(this,"slotIndex",0);this.slotIndex=n}getFrameEntries(){return 7}setFrame(t,i,n,r,o,a,l,c){t*=7,this.frames[t]=i,this.frames[t+1]=n,this.frames[t+2]=r,this.frames[t+3]=o,this.frames[t+4]=a,this.frames[t+5]=l,this.frames[t+6]=c}apply(t,i,n,r,o,a,l){let c=t.slots[this.slotIndex];if(!c.bone.active)return;let h=this.frames,u=c.color,d=c.darkColor;if(nt){let c=this.frames[i];return n[r+1]*(t-c)/(n[r]-c)}let o=r+18;for(r+=2;r=t){let c=n[r-2],h=n[r-1];return h+(t-c)/(n[r]-c)*(n[r+1]-h)}let a=n[o-2],l=n[o-1];return l+(1-l)*(t-a)/(this.frames[i+this.getFrameEntries()]-a)}apply(t,i,n,r,o,a,l){let c=t.slots[this.slotIndex];if(!c.bone.active)return;let h=c.getAttachment();if(!h||!(h instanceof zn)||h.timelineAttachment!=this.attachment)return;let u=c.deform;u.length==0&&(a=ye.setup);let d=this.vertices,f=d[0].length,m=this.frames;if(n=m[m.length-1]){let w=d[m.length-1];if(o==1)if(a==ye.add){let _=h;if(_.bones)for(let S=0;Sn)this.apply(t,i,Number.MAX_VALUE,r,o,a,l),i=-1;else if(i>=c[h-1])return;if(n0&&c[u-1]==d;)u--}for(;u=c[u];u++)r.push(this.events[u])}},M(eo,"propertyIds",[""+ht.event]),eo);var to;let tl=(to=class extends Yt{constructor(t){super(t,to.propertyIds);M(this,"drawOrders");this.drawOrders=new Array(t)}getFrameCount(){return this.frames.length}setFrame(t,i,n){this.frames[t]=i,this.drawOrders[t]=n}apply(t,i,n,r,o,a,l){if(l==ki.mixOut){a==ye.setup&&Pe.arrayCopy(t.slots,0,t.drawOrder,0,t.slots.length);return}if(n>2];switch(p){case 0:let g=h[m];u=h[m+1],d=h[m+2],f=h[m+3];let x=(n-g)/(h[m+4]-g);u+=(h[m+4+1]-u)*x,d+=(h[m+4+2]-d)*x,f+=(h[m+4+3]-f)*x;break;case 1:u=h[m+1],d=h[m+2],f=h[m+3];break;default:u=this.getBezierValue(n,m,1,p-2),d=this.getBezierValue(n,m,2,p+18-2),f=this.getBezierValue(n,m,3,p+36-2)}if(a==ye.setup){let g=c.data;c.mixRotate=g.mixRotate+(u-g.mixRotate)*o,c.mixX=g.mixX+(d-g.mixX)*o,c.mixY=g.mixY+(f-g.mixY)*o}else c.mixRotate+=(u-c.mixRotate)*o,c.mixX+=(d-c.mixX)*o,c.mixY+=(f-c.mixY)*o}},xo=class extends Us{constructor(t,i,n,r){super(t,i,r+"|"+n);M(this,"constraintIndex",0);this.constraintIndex=n}apply(t,i,n,r,o,a,l){let c;if(this.constraintIndex==-1){const h=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),h))}else c=t.physicsConstraints[this.constraintIndex],c.active&&this.set(c,this.getAbsoluteValue(n,o,a,this.get(c),this.setup(c)))}},cw=class extends xo{constructor(e,t,i){super(e,t,i,ht.physicsConstraintInertia)}setup(e){return e.data.inertia}get(e){return e.inertia}set(e,t){e.inertia=t}global(e){return e.inertiaGlobal}},hw=class extends xo{constructor(e,t,i){super(e,t,i,ht.physicsConstraintStrength)}setup(e){return e.data.strength}get(e){return e.strength}set(e,t){e.strength=t}global(e){return e.strengthGlobal}},uw=class extends xo{constructor(e,t,i){super(e,t,i,ht.physicsConstraintDamping)}setup(e){return e.data.damping}get(e){return e.damping}set(e,t){e.damping=t}global(e){return e.dampingGlobal}},dw=class extends xo{constructor(e,t,i){super(e,t,i,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}},fw=class extends xo{constructor(e,t,i){super(e,t,i,ht.physicsConstraintWind)}setup(e){return e.data.wind}get(e){return e.wind}set(e,t){e.wind=t}global(e){return e.windGlobal}},mw=class extends xo{constructor(e,t,i){super(e,t,i,ht.physicsConstraintGravity)}setup(e){return e.data.gravity}get(e){return e.gravity}set(e,t){e.gravity=t}global(e){return e.gravityGlobal}},pw=class extends xo{constructor(e,t,i){super(e,t,i,ht.physicsConstraintMix)}setup(e){return e.data.mix}get(e){return e.mix}set(e,t){e.mix=t}global(e){return e.mixGlobal}};var io;let gw=(io=class extends Yt{constructor(t,i){super(t,io.propertyIds);M(this,"constraintIndex");this.constraintIndex=i}getFrameCount(){return this.frames.length}setFrame(t,i){this.frames[t]=i}apply(t,i,n,r,o,a,l){let c;if(this.constraintIndex!=-1&&(c=t.physicsConstraints[this.constraintIndex],!c.active))return;const h=this.frames;if(i>n)this.apply(t,i,Number.MAX_VALUE,[],o,a,l),i=-1;else if(i>=h[h.length-1])return;if(!(n=h[Yt.search1(h,i)+1]))if(c!=null)c.reset();else for(const u of t.physicsConstraints)u.active&&u.reset()}},M(io,"propertyIds",[ht.physicsConstraintReset.toString()]),io);var Di;let vw=(Di=class extends Yt{constructor(t,i,n){super(t,[ht.sequence+"|"+i+"|"+n.sequence.id]);M(this,"slotIndex");M(this,"attachment");this.slotIndex=i,this.attachment=n}getFrameEntries(){return Di.ENTRIES}getSlotIndex(){return this.slotIndex}getAttachment(){return this.attachment}setFrame(t,i,n,r,o){let a=this.frames;t*=Di.ENTRIES,a[t]=i,a[t+Di.MODE]=n|r<<4,a[t+Di.DELAY]=o}apply(t,i,n,r,o,a,l){let c=t.slots[this.slotIndex];if(!c.bone.active)return;let h=c.attachment,u=this.attachment;if(h!=u&&(!(h instanceof zn)||h.timelineAttachment!=u))return;if(l==ki.mixOut){a==ye.setup&&(c.sequenceIndex=-1);return}let d=this.frames;if(n>4,v=this.attachment.sequence.regions.length,y=X1[p&15];if(y!=Ti.hold)switch(x+=(n-m)/g+1e-5|0,y){case Ti.once:x=Math.min(v-1,x);break;case Ti.loop:x%=v;break;case Ti.pingpong:{let w=(v<<1)-2;x=w==0?0:x%w,x>=v&&(x=w-x);break}case Ti.onceReverse:x=Math.max(v-1-x,0);break;case Ti.loopReverse:x=v-1-x%v;break;case Ti.pingpongReverse:{let w=(v<<1)-2;x=w==0?0:(x+v-1)%w,x>=v&&(x=w-x)}}c.sequenceIndex=x}},M(Di,"ENTRIES",3),M(Di,"MODE",1),M(Di,"DELAY",2),Di);var Dn;let nP=(Dn=class{constructor(e){M(this,"data");M(this,"tracks",new Array);M(this,"timeScale",1);M(this,"unkeyedState",0);M(this,"events",new Array);M(this,"listeners",new Array);M(this,"queue",new oP(this));M(this,"propertyIDs",new D1);M(this,"animationsChanged",!1);M(this,"trackEntryPool",new xh(()=>new rP));this.data=e}static emptyAnimation(){return Dn._emptyAnimation}update(e){e*=this.timeScale;let t=this.tracks;for(let i=0,n=t.length;i0){if(r.delay-=o,r.delay>0)continue;o=-r.delay,r.delay=0}let a=r.next;if(a){let l=r.trackLast-a.delay;if(l>=0){for(a.delay=0,a.trackTime+=r.timeScale==0?0:(l/r.timeScale+e)*a.timeScale,r.trackTime+=o,this.setCurrent(i,a,!0);a.mixingFrom;)a.mixTime+=e,a=a.mixingFrom;continue}}else if(r.trackLast>=r.trackEnd&&!r.mixingFrom){t[i]=null,this.queue.end(r),this.clearNext(r);continue}if(r.mixingFrom&&this.updateMixingFrom(r,e)){let l=r.mixingFrom;for(r.mixingFrom=null,l&&(l.mixingTo=null);l;)this.queue.end(l),l=l.mixingFrom}r.trackTime+=o}this.queue.drain()}updateMixingFrom(e,t){let i=e.mixingFrom;if(!i)return!0;let n=this.updateMixingFrom(i,t);return i.animationLast=i.nextAnimationLast,i.trackLast=i.nextTrackLast,e.nextTrackLast!=-1&&e.mixTime>=e.mixDuration?((i.totalAlpha==0||e.mixDuration==0)&&(e.mixingFrom=i.mixingFrom,i.mixingFrom!=null&&(i.mixingFrom.mixingTo=e),e.interruptAlpha=i.interruptAlpha,this.queue.end(i)),n):(i.trackTime+=t*i.timeScale,e.mixTime+=t,!1)}apply(e){if(!e)throw new Error("skeleton cannot be null.");this.animationsChanged&&this._animationsChanged();let t=this.events,i=this.tracks,n=!1;for(let d=0,f=i.length;d0)continue;n=!0;let p=d==0?ye.first:m.mixBlend,g=m.alpha;m.mixingFrom?g*=this.applyMixingFrom(m,e,p):m.trackTime>=m.trackEnd&&!m.next&&(g=0);let x=g>=m.alphaAttachmentThreshold,v=m.animationLast,y=m.getAnimationTime(),w=y,_=t;m.reverse&&(w=m.animation.duration-w,_=null);let S=m.animation.timelines,b=S.length;if(d==0&&g==1||p==ye.add){d==0&&(x=!0);for(let C=0;C1&&(r=1),i!=ye.first&&(i=n.mixBlend));let o=r=n.alphaAttachmentThreshold):(a&&_ instanceof tl&&b==ye.setup&&(S=ki.mixIn),_.apply(t,d,m,p,C,b,S))}}return e.mixDuration>0&&this.queueEvents(n,f),this.events.length=0,n.nextAnimationLast=f,n.nextTrackLast=n.trackTime,r}applyAttachmentTimeline(e,t,i,n,r){var o=t.slots[e.slotIndex];o.bone.active&&(i=0,y=p>=0;Math.abs(g)<=90&&Re.signum(g)!=Re.signum(m)&&(Math.abs(p-x)>180?(f+=360*Re.signum(p),y=v):x!=0?f-=360*Re.signum(p):y=v),y!=v&&(f+=360*Re.signum(p)),o[a]=f}o[a+1]=m,c.rotation=u+f*n}queueEvents(e,t){let i=e.animationStart,n=e.animationEnd,r=n-i,o=e.trackLast%r,a=this.events,l=0,c=a.length;for(;ln||this.queue.event(e,u)}let h=!1;if(e.loop)if(r==0)h=!0;else{const u=Math.floor(e.trackTime/r);h=u>0&&u>Math.floor(e.trackLast/r)}else h=t>=n&&e.animationLast=this.tracks.length)return;let t=this.tracks[e];if(!t)return;this.queue.end(t),this.clearNext(t);let i=t;for(;;){let n=i.mixingFrom;if(!n)break;this.queue.end(n),i.mixingFrom=null,i.mixingTo=null,i=n}this.tracks[t.trackIndex]=null,this.queue.drain()}setCurrent(e,t,i){let n=this.expandToIndex(e);this.tracks[e]=t,t.previous=null,n&&(i&&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,i=!1){let n=this.data.skeletonData.findAnimation(t);if(!n)throw new Error("Animation not found: "+t);return this.setAnimationWith(e,n,i)}setAnimationWith(e,t,i=!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,i,r);return this.setCurrent(e,o,n),this.queue.drain(),o}addAnimation(e,t,i=!1,n=0){let r=this.data.skeletonData.findAnimation(t);if(!r)throw new Error("Animation not found: "+t);return this.addAnimationWith(e,r,i,n)}addAnimationWith(e,t,i=!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,i,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 i=this.setAnimationWith(e,Dn.emptyAnimation(),!1);return i.mixDuration=t,i.trackEnd=t,i}addEmptyAnimation(e,t=0,i=0){let n=this.addAnimationWith(e,Dn.emptyAnimation(),!1,i);return i<=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 i=0,n=this.tracks.length;i0){r[l]=aP,o[l]=u;continue e}break}r[l]=ff}}}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()}},M(Dn,"_emptyAnimation",new Cp("",[],0)),Dn),rP=class{constructor(){M(this,"animation",null);M(this,"previous",null);M(this,"next",null);M(this,"mixingFrom",null);M(this,"mixingTo",null);M(this,"listener",null);M(this,"trackIndex",0);M(this,"loop",!1);M(this,"holdPrevious",!1);M(this,"reverse",!1);M(this,"shortestRotation",!1);M(this,"eventThreshold",0);M(this,"mixAttachmentThreshold",0);M(this,"alphaAttachmentThreshold",0);M(this,"mixDrawOrderThreshold",0);M(this,"animationStart",0);M(this,"animationEnd",0);M(this,"animationLast",0);M(this,"nextAnimationLast",0);M(this,"delay",0);M(this,"trackTime",0);M(this,"trackLast",0);M(this,"nextTrackLast",0);M(this,"trackEnd",0);M(this,"timeScale",0);M(this,"alpha",0);M(this,"mixTime",0);M(this,"_mixDuration",0);M(this,"interruptAlpha",0);M(this,"totalAlpha",0);M(this,"mixBlend",ye.replace);M(this,"timelineMode",new Array);M(this,"timelineHoldMix",new Array);M(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}},oP=class{constructor(e){M(this,"objects",[]);M(this,"drainDisabled",!1);M(this,"animState");this.animState=e}start(e){this.objects.push(Hi.start),this.objects.push(e),this.animState.animationsChanged=!0}interrupt(e){this.objects.push(Hi.interrupt),this.objects.push(e)}end(e){this.objects.push(Hi.end),this.objects.push(e),this.animState.animationsChanged=!0}dispose(e){this.objects.push(Hi.dispose),this.objects.push(e)}complete(e){this.objects.push(Hi.complete),this.objects.push(e)}event(e,t){this.objects.push(Hi.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{h.width=parseInt(i[1]),h.height=parseInt(i[2])},n.format=()=>{},n.filter=h=>{h.minFilter=Pe.enumValue(yi,i[1]),h.magFilter=Pe.enumValue(yi,i[2])},n.repeat=h=>{i[1].indexOf("x")!=-1&&(h.uWrap=Vn.Repeat),i[1].indexOf("y")!=-1&&(h.vWrap=Vn.Repeat)},n.pma=h=>{h.pma=i[1]=="true"};var r={};r.xy=h=>{h.x=parseInt(i[1]),h.y=parseInt(i[2])},r.size=h=>{h.width=parseInt(i[1]),h.height=parseInt(i[2])},r.bounds=h=>{h.x=parseInt(i[1]),h.y=parseInt(i[2]),h.width=parseInt(i[3]),h.height=parseInt(i[4])},r.offset=h=>{h.offsetX=parseInt(i[1]),h.offsetY=parseInt(i[2])},r.orig=h=>{h.originalWidth=parseInt(i[1]),h.originalHeight=parseInt(i[2])},r.offsets=h=>{h.offsetX=parseInt(i[1]),h.offsetY=parseInt(i[2]),h.originalWidth=parseInt(i[3]),h.originalHeight=parseInt(i[4])},r.rotate=h=>{let u=i[1];u=="true"?h.degrees=90:u!="false"&&(h.degrees=parseInt(u))},r.index=h=>{h.index=parseInt(i[1])};let o=t.readLine();for(;o&&o.trim().length==0;)o=t.readLine();for(;!(!o||o.trim().length==0||t.readEntry(i,o)==0);)o=t.readLine();let a=null,l=null,c=null;for(;o!==null;)if(o.trim().length==0)a=null,o=t.readLine();else if(a){let h=new Sw(a,o);for(;;){let u=t.readEntry(i,o=t.readLine());if(u==0)break;let d=r[i[0]];if(d)d(h);else{l||(l=[]),c||(c=[]),l.push(i[0]);let f=[];for(let m=0;m0&&c&&c.length>0&&(h.names=l,h.values=c,l=null,c=null),h.u=h.x/a.width,h.v=h.y/a.height,h.degrees==90?(h.u2=(h.x+h.height)/a.width,h.v2=(h.y+h.width)/a.height):(h.u2=(h.x+h.width)/a.width,h.v2=(h.y+h.height)/a.height),this.regions.push(h)}else{for(a=new fP(o.trim());t.readEntry(i,o=t.readLine())!=0;){let h=n[i[0]];h&&h(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 i=t.indexOf(":");if(i==-1)return 0;e[0]=t.substr(0,i).trim();for(let n=1,r=i+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}}},fP=class{constructor(e){M(this,"name");M(this,"minFilter",yi.Nearest);M(this,"magFilter",yi.Nearest);M(this,"uWrap",Vn.ClampToEdge);M(this,"vWrap",Vn.ClampToEdge);M(this,"texture",null);M(this,"width",0);M(this,"height",0);M(this,"pma",!1);M(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}},Sw=class extends uP{constructor(t,i){super();M(this,"page");M(this,"name");M(this,"x",0);M(this,"y",0);M(this,"offsetX",0);M(this,"offsetY",0);M(this,"originalWidth",0);M(this,"originalHeight",0);M(this,"index",0);M(this,"degrees",0);M(this,"names",null);M(this,"values",null);this.page=t,this.name=i,t.regions.push(this)}},Ol=class wm extends zn{constructor(t,i){super(t);M(this,"region",null);M(this,"path");M(this,"regionUVs",[]);M(this,"uvs",[]);M(this,"triangles",[]);M(this,"color",new lt(1,1,1,1));M(this,"width",0);M(this,"height",0);M(this,"hullLength",0);M(this,"edges",[]);M(this,"parentMesh",null);M(this,"sequence",null);M(this,"tempColor",new lt(0,0,0,0));this.path=i}updateRegion(){if(!this.region)throw new Error("Region not set.");let t=this.regionUVs;(!this.uvs||this.uvs.length!=t.length)&&(this.uvs=Pe.newFloatArray(t.length));let i=this.uvs,n=this.uvs.length,r=this.region.u,o=this.region.v,a=0,l=0;if(this.region instanceof Sw){let c=this.region,h=c.page,u=h.width,d=h.height;switch(c.degrees){case 90:r-=(c.originalHeight-c.offsetY-c.height)/u,o-=(c.originalWidth-c.offsetX-c.width)/d,a=c.originalHeight/u,l=c.originalWidth/d;for(let f=0;f= 0.");if(!t)throw new Error("name cannot be null.");this.index=e,this.name=t,this.parent=i}};var qt;(function(s){s[s.Normal=0]="Normal",s[s.OnlyTranslation=1]="OnlyTranslation",s[s.NoRotationOrReflection=2]="NoRotationOrReflection",s[s.NoScale=3]="NoScale",s[s.NoScaleOrReflection=4]="NoScaleOrReflection"})(qt||(qt={}));let Kv=class{constructor(e,t,i){M(this,"data");M(this,"skeleton");M(this,"parent",null);M(this,"children",new Array);M(this,"x",0);M(this,"y",0);M(this,"rotation",0);M(this,"scaleX",0);M(this,"scaleY",0);M(this,"shearX",0);M(this,"shearY",0);M(this,"ax",0);M(this,"ay",0);M(this,"arotation",0);M(this,"ascaleX",0);M(this,"ascaleY",0);M(this,"ashearX",0);M(this,"ashearY",0);M(this,"a",0);M(this,"b",0);M(this,"c",0);M(this,"d",0);M(this,"worldY",0);M(this,"worldX",0);M(this,"inherit",qt.Normal);M(this,"sorted",!1);M(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=i,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,i,n,r,o,a){this.ax=e,this.ay=t,this.arotation=i,this.ascaleX=n,this.ascaleY=r,this.ashearX=o,this.ashearY=a;let l=this.parent;if(!l){let f=this.skeleton;const m=f.scaleX,p=f.scaleY,g=(i+o)*Re.degRad,x=(i+90+a)*Re.degRad;this.a=Math.cos(g)*n*m,this.b=Math.cos(x)*r*m,this.c=Math.sin(g)*n*p,this.d=Math.sin(x)*r*p,this.worldX=e*m+f.x,this.worldY=t*p+f.y;return}let c=l.a,h=l.b,u=l.c,d=l.d;switch(this.worldX=c*e+h*t+l.worldX,this.worldY=u*e+d*t+l.worldY,this.inherit){case qt.Normal:{const f=(i+o)*Re.degRad,m=(i+90+a)*Re.degRad,p=Math.cos(f)*n,g=Math.cos(m)*r,x=Math.sin(f)*n,v=Math.sin(m)*r;this.a=c*p+h*x,this.b=c*g+h*v,this.c=u*p+d*x,this.d=u*g+d*v;return}case qt.OnlyTranslation:{const f=(i+o)*Re.degRad,m=(i+90+a)*Re.degRad;this.a=Math.cos(f)*n,this.b=Math.cos(m)*r,this.c=Math.sin(f)*n,this.d=Math.sin(m)*r;break}case qt.NoRotationOrReflection:{let f=1/this.skeleton.scaleX,m=1/this.skeleton.scaleY;c*=f,u*=m;let p=c*c+u*u,g=0;p>1e-4?(p=Math.abs(c*d*m-h*f*u)/p,h=u*p,d=c*p,g=Math.atan2(u,c)*Re.radDeg):(c=0,u=0,g=90-Math.atan2(d,h)*Re.radDeg);const x=(i+o-g)*Re.degRad,v=(i+a-g+90)*Re.degRad,y=Math.cos(x)*n,w=Math.cos(v)*r,_=Math.sin(x)*n,S=Math.sin(v)*r;this.a=c*y-h*_,this.b=c*w-h*S,this.c=u*y+d*_,this.d=u*w+d*S;break}case qt.NoScale:case qt.NoScaleOrReflection:{i*=Re.degRad;const f=Math.cos(i),m=Math.sin(i);let p=(c*f+h*m)/this.skeleton.scaleX,g=(u*f+d*m)/this.skeleton.scaleY,x=Math.sqrt(p*p+g*g);x>1e-5&&(x=1/x),p*=x,g*=x,x=Math.sqrt(p*p+g*g),this.inherit==qt.NoScale&&c*d-h*u<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY<0)&&(x=-x),i=Math.PI/2+Math.atan2(g,p);const v=Math.cos(i)*x,y=Math.sin(i)*x;o*=Re.degRad,a=(90+a)*Re.degRad;const w=Math.cos(o)*n,_=Math.cos(a)*r,S=Math.sin(o)*n,b=Math.sin(a)*r;this.a=p*w+v*S,this.b=p*_+v*b,this.c=g*w+y*S,this.d=g*_+y*b;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)*Re.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)*Re.radDeg;return}let t=e.a,i=e.b,n=e.c,r=e.d,o=1/(t*r-i*n),a=r*o,l=i*o,c=n*o,h=t*o,u=this.worldX-e.worldX,d=this.worldY-e.worldY;this.ax=u*a-d*l,this.ay=d*h-u*c;let f,m,p,g;if(this.inherit==qt.OnlyTranslation)f=this.a,m=this.b,p=this.c,g=this.d;else{switch(this.inherit){case qt.NoRotationOrReflection:{let _=Math.abs(t*r-i*n)/(t*t+n*n);i=-n*this.skeleton.scaleX*_/this.skeleton.scaleY,r=t*this.skeleton.scaleY*_/this.skeleton.scaleX,o=1/(t*r-i*n),a=r*o,l=i*o;break}case qt.NoScale:case qt.NoScaleOrReflection:let x=Re.cosDeg(this.rotation),v=Re.sinDeg(this.rotation);t=(t*x+i*v)/this.skeleton.scaleX,n=(n*x+r*v)/this.skeleton.scaleY;let y=Math.sqrt(t*t+n*n);y>1e-5&&(y=1/y),t*=y,n*=y,y=Math.sqrt(t*t+n*n),this.inherit==qt.NoScale&&o<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY<0)&&(y=-y);let w=Re.PI/2+Math.atan2(n,t);i=Math.cos(w)*y,r=Math.sin(w)*y,o=1/(t*r-i*n),a=r*o,l=i*o,c=n*o,h=t*o}f=a*this.a-l*this.c,m=a*this.b-l*this.d,p=h*this.c-c*this.a,g=h*this.d-c*this.b}if(this.ashearX=0,this.ascaleX=Math.sqrt(f*f+p*p),this.ascaleX>1e-4){let x=f*g-m*p;this.ascaleY=x/this.ascaleX,this.ashearY=-Math.atan2(f*m+p*g,x)*Re.radDeg,this.arotation=Math.atan2(p,f)*Re.radDeg}else this.ascaleX=0,this.ascaleY=Math.sqrt(m*m+g*g),this.ashearY=0,this.arotation=90-Math.atan2(g,m)*Re.radDeg}getWorldRotationX(){return Math.atan2(this.c,this.a)*Re.radDeg}getWorldRotationY(){return Math.atan2(this.d,this.b)*Re.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),i=e.x-this.worldX,n=e.y-this.worldY;return e.x=i*this.d*t-n*this.b*t,e.y=n*this.a*t-i*this.c*t,e}localToWorld(e){let t=e.x,i=e.y;return e.x=t*this.a+i*this.b+this.worldX,e.y=t*this.c+i*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=Re.sinDeg(e),i=Re.cosDeg(e);return Math.atan2(this.a*t-this.c*i,this.d*i-this.b*t)*Re.radDeg+this.rotation-this.shearX}localToWorldRotation(e){e-=this.rotation-this.shearX;let t=Re.sinDeg(e),i=Re.cosDeg(e);return Math.atan2(i*this.c+t*this.d,i*this.a+t*this.b)*Re.radDeg}rotateWorld(e){e*=Re.degRad;const t=Math.sin(e),i=Math.cos(e),n=this.a,r=this.b;this.a=i*n-t*this.c,this.b=i*r-t*this.d,this.c=t*n+i*this.c,this.d=t*r+i*this.d}},vu=class{constructor(e,t,i){M(this,"name");M(this,"order");M(this,"skinRequired");this.name=e,this.order=t,this.skinRequired=i}},Ew=class{constructor(e,t){M(this,"data");M(this,"intValue",0);M(this,"floatValue",0);M(this,"stringValue",null);M(this,"time",0);M(this,"volume",0);M(this,"balance",0);if(!t)throw new Error("data cannot be null.");this.time=e,this.data=t}},Aw=class{constructor(e){M(this,"name");M(this,"intValue",0);M(this,"floatValue",0);M(this,"stringValue",null);M(this,"audioPath",null);M(this,"volume",0);M(this,"balance",0);this.name=e}},mP=class{constructor(e,t){M(this,"data");M(this,"bones");M(this,"target");M(this,"bendDirection",0);M(this,"compress",!1);M(this,"stretch",!1);M(this,"mix",1);M(this,"softness",0);M(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?f-=360:f<-180&&(f+=360);let g=e.ascaleX,x=e.ascaleY;if(n||r){switch(e.inherit){case qt.NoScale:case qt.NoScaleOrReflection:m=t-e.worldX,p=i-e.worldY}const v=e.data.length*g;if(v>1e-4){const y=m*m+p*p;if(n&&yv*v){const w=(Math.sqrt(y)/v-1)*a+1;g*=w,o&&(x*=w)}}}e.updateWorldTransformWith(e.ax,e.ay,e.arotation+f*a,g,x,e.ashearX,e.ashearY)}apply2(e,t,i,n,r,o,a,l,c){if(e.inherit!=qt.Normal||t.inherit!=qt.Normal)return;let h=e.ax,u=e.ay,d=e.ascaleX,f=e.ascaleY,m=d,p=f,g=t.ascaleX,x=0,v=0,y=0;d<0?(d=-d,x=180,y=-1):(x=0,y=1),f<0&&(f=-f,y=-y),g<0?(g=-g,v=180):v=0;let w=t.ax,_=0,S=0,b=0,C=e.a,A=e.b,P=e.c,E=e.d,R=Math.abs(d-f)<=1e-4;!R||o?(_=0,S=C*w+e.worldX,b=P*w+e.worldY):(_=t.ay,S=C*w+A*_+e.worldX,b=P*w+E*_+e.worldY);let O=e.parent;if(!O)throw new Error("IK parent must itself have a parent.");C=O.a,A=O.b,P=O.c,E=O.d;let U=C*E-A*P,G=S-O.worldX,$=b-O.worldY;U=Math.abs(U)<=1e-4?0:1/U;let X=(G*E-$*A)*U-h,D=($*C-G*P)*U-u,k=Math.sqrt(X*X+D*D),N=t.data.length*g,F,V;if(k<1e-4){this.apply1(e,i,n,!1,o,!1,c),t.updateWorldTransformWith(w,_,0,t.ascaleX,t.ascaleY,t.ashearX,t.ashearY);return}G=i-O.worldX,$=n-O.worldY;let Y=(G*E-$*A)*U-h,q=($*C-G*P)*U-u,z=Y*Y+q*q;if(l!=0){l*=d*(g+1)*.5;let de=Math.sqrt(z),ge=de-k-N*d+l;if(ge>0){let he=Math.min(1,ge/(l*2))-1;he=(ge-l*(1-he*he))/de,Y-=he*Y,q-=he*q,z=Y*Y+q*q}}e:if(R){N*=d;let de=(z-k*k-N*N)/(2*k*N);de<-1?(de=-1,V=Math.PI*r):de>1?(de=1,V=0,o&&(C=(Math.sqrt(z)/(k+N)-1)*c+1,m*=C,a&&(p*=C))):V=Math.acos(de)*r,C=k+N*de,A=N*Math.sin(V),F=Math.atan2(q*C-Y*A,Y*C+q*A)}else{C=d*N,A=f*N;let de=C*C,ge=A*A,he=Math.atan2(q,Y);P=ge*k*k+de*z-de*ge;let fe=-2*ge*k,H=ge-de;if(E=fe*fe-4*H*P,E>=0){let ee=Math.sqrt(E);fe<0&&(ee=-ee),ee=-(fe+ee)*.5;let Me=ee/H,be=P/ee,pe=Math.abs(Me)=0){$=Math.sqrt(Me)*r,F=he-Math.atan2($,pe),V=Math.atan2($/f,(pe-k)/d);break e}}let W=Re.PI,Z=k-C,L=Z*Z,B=0,j=0,ie=k+C,ue=ie*ie,me=0;P=-C*k/(de-ge),P>=-1&&P<=1&&(P=Math.acos(P),G=C*Math.cos(P)+k,$=A*Math.sin(P),E=G*G+$*$,Eue&&(j=P,ue=E,ie=G,me=$)),z<=(L+ue)*.5?(F=he-Math.atan2(B*r,Z),V=W*r):(F=he-Math.atan2(me*r,ie),V=j*r)}let se=Math.atan2(_,w)*y,oe=e.arotation;F=(F-se)*Re.radDeg+x-oe,F>180?F-=360:F<-180&&(F+=360),e.updateWorldTransformWith(h,u,oe+F*c,m,p,0,0),oe=t.arotation,V=((V+se)*Re.radDeg-t.ashearX)*y+v-oe,V>180?V-=360:V<-180&&(V+=360),t.updateWorldTransformWith(w,_,oe+V*c,t.ascaleX,t.ascaleY,t.ashearX,t.ashearY)}},Iw=class extends vu{constructor(t){super(t,0,!1);M(this,"bones",new Array);M(this,"_target",null);M(this,"bendDirection",0);M(this,"compress",!1);M(this,"stretch",!1);M(this,"uniform",!1);M(this,"mix",0);M(this,"softness",0)}set target(t){this._target=t}get target(){if(this._target)return this._target;throw new Error("BoneData not set.")}},Rw=class extends vu{constructor(t){super(t,0,!1);M(this,"bones",new Array);M(this,"_target",null);M(this,"positionMode",un.Fixed);M(this,"spacingMode",fi.Fixed);M(this,"rotateMode",lo.Chain);M(this,"offsetRotation",0);M(this,"position",0);M(this,"spacing",0);M(this,"mixRotate",0);M(this,"mixX",0);M(this,"mixY",0)}set target(t){this._target=t}get target(){if(this._target)return this._target;throw new Error("SlotData not set.")}};var un;(function(s){s[s.Fixed=0]="Fixed",s[s.Percent=1]="Percent"})(un||(un={}));var fi;(function(s){s[s.Length=0]="Length",s[s.Fixed=1]="Fixed",s[s.Percent=2]="Percent",s[s.Proportional=3]="Proportional"})(fi||(fi={}));var lo;(function(s){s[s.Tangent=0]="Tangent",s[s.Chain=1]="Chain",s[s.ChainScale=2]="ChainScale"})(lo||(lo={}));var Ri;let pP=(Ri=class{constructor(e,t){M(this,"data");M(this,"bones");M(this,"target");M(this,"position",0);M(this,"spacing",0);M(this,"mixRotate",0);M(this,"mixX",0);M(this,"mixY",0);M(this,"spaces",new Array);M(this,"positions",new Array);M(this,"world",new Array);M(this,"curves",new Array);M(this,"lengths",new Array);M(this,"segments",new Array);M(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){w=u/w*m;for(let S=1;S0?Re.degRad:-.01745329277777778}for(let w=0,_=3;w0){let E=S.a,R=S.b,O=S.c,U=S.d,G=0,$=0,X=0;if(a?G=p[_-1]:d[w+1]==0?G=p[_+2]:G=Math.atan2(P,A),G-=Math.atan2(O,E),y){$=Math.cos(G),X=Math.sin(G);let D=S.data.length;g+=(D*($*E-X*O)-A)*i,x+=(D*(X*E+$*O)-P)*i}else G+=v;G>Re.PI?G-=Re.PI2:G<-3.1415927&&(G+=Re.PI2),G*=i,$=Math.cos(G),X=Math.sin(G),S.a=$*E-X*O,S.b=$*R-X*U,S.c=X*E+$*O,S.d=X*R+$*U}S.updateAppliedTransform()}}computeWorldPositions(e,t,i){let n=this.target,r=this.position,o=this.spaces,a=Pe.setArraySize(this.positions,t*3+2),l=this.world,c=e.closed,h=e.worldVerticesLength,u=h/6,d=Ri.NONE;if(!e.constantSpeed){let D=e.lengths;u-=c?1:2;let k=D[u];this.data.positionMode==un.Percent&&(r*=k);let N;switch(this.data.spacingMode){case fi.Percent:N=k;break;case fi.Proportional:N=k/t;break;default:N=1}l=Pe.setArraySize(this.world,8);for(let F=0,V=0,Y=0;Fk){d!=Ri.AFTER&&(d=Ri.AFTER,e.computeWorldVertices(n,h-6,4,l,0,2)),this.addAfterPosition(z-k,l,0,a,V);continue}for(;;Y++){let se=D[Y];if(!(z>se)){if(Y==0)z/=se;else{let oe=D[Y-1];z=(z-oe)/(se-oe)}break}}Y!=d&&(d=Y,c&&Y==u?(e.computeWorldVertices(n,h-4,4,l,0,2),e.computeWorldVertices(n,0,4,l,4,2)):e.computeWorldVertices(n,Y*6+2,8,l,0,2)),this.addCurvePosition(z,l[0],l[1],l[2],l[3],l[4],l[5],l[6],l[7],a,V,i||F>0&&q==0)}return a}c?(h+=2,l=Pe.setArraySize(this.world,h),e.computeWorldVertices(n,2,h-4,l,0,2),e.computeWorldVertices(n,0,2,l,h-4,2),l[h-2]=l[0],l[h-1]=l[1]):(u--,h-=4,l=Pe.setArraySize(this.world,h),e.computeWorldVertices(n,2,h,l,0,2));let f=Pe.setArraySize(this.curves,u),m=0,p=l[0],g=l[1],x=0,v=0,y=0,w=0,_=0,S=0,b=0,C=0,A=0,P=0,E=0,R=0,O=0,U=0;for(let D=0,k=2;Dm){this.addAfterPosition(Y-m,l,h-4,a,k);continue}for(;;N++){let q=f[N];if(!(Y>q)){if(N==0)Y/=q;else{let z=f[N-1];Y=(Y-z)/(q-z)}break}}if(N!=d){d=N;let q=N*6;for(p=l[q],g=l[q+1],x=l[q+2],v=l[q+3],y=l[q+4],w=l[q+5],_=l[q+6],S=l[q+7],b=(p-x*2+y)*.03,C=(g-v*2+w)*.03,A=((x-y)*3-p+_)*.006,P=((v-w)*3-g+S)*.006,E=b*2+A,R=C*2+P,O=(x-p)*.3+b+A*.16666667,U=(v-g)*.3+C+P*.16666667,X=Math.sqrt(O*O+U*U),$[0]=X,q=1;q<8;q++)O+=E,U+=R,E+=A,R+=P,X+=Math.sqrt(O*O+U*U),$[q]=X;O+=E,U+=R,X+=Math.sqrt(O*O+U*U),$[8]=X,O+=E+A,U+=R+P,X+=Math.sqrt(O*O+U*U),$[9]=X,F=0}for(Y*=X;;F++){let q=$[F];if(!(Y>q)){if(F==0)Y/=q;else{let z=$[F-1];Y=F+(Y-z)/(q-z)}break}}this.addCurvePosition(Y*.1,p,g,x,v,y,w,_,S,a,k,i||D>0&&V==0)}return a}addBeforePosition(e,t,i,n,r){let o=t[i],a=t[i+1],l=t[i+2]-o,c=t[i+3]-a,h=Math.atan2(c,l);n[r]=o+e*Math.cos(h),n[r+1]=a+e*Math.sin(h),n[r+2]=h}addAfterPosition(e,t,i,n,r){let o=t[i+2],a=t[i+3],l=o-t[i],c=a-t[i+1],h=Math.atan2(c,l);n[r]=o+e*Math.cos(h),n[r+1]=a+e*Math.sin(h),n[r+2]=h}addCurvePosition(e,t,i,n,r,o,a,l,c,h,u,d){if(e==0||isNaN(e)){h[u]=t,h[u+1]=i,h[u+2]=Math.atan2(r-i,n-t);return}let f=e*e,m=f*e,p=1-e,g=p*p,x=g*p,v=p*e,y=v*3,w=p*y,_=y*e,S=t*x+n*w+o*_+l*m,b=i*x+r*w+a*_+c*m;h[u]=S,h[u+1]=b,d&&(e<.001?h[u+2]=Math.atan2(r-i,n-t):h[u+2]=Math.atan2(b-(i*g+r*v*2+a*f),S-(t*g+n*v*2+o*f)))}},M(Ri,"NONE",-1),M(Ri,"BEFORE",-2),M(Ri,"AFTER",-3),M(Ri,"epsilon",1e-5),Ri),gP=class{constructor(e,t){M(this,"data");M(this,"_bone",null);M(this,"inertia",0);M(this,"strength",0);M(this,"damping",0);M(this,"massInverse",0);M(this,"wind",0);M(this,"gravity",0);M(this,"mix",0);M(this,"_reset",!0);M(this,"ux",0);M(this,"uy",0);M(this,"cx",0);M(this,"cy",0);M(this,"tx",0);M(this,"ty",0);M(this,"xOffset",0);M(this,"xVelocity",0);M(this,"yOffset",0);M(this,"yVelocity",0);M(this,"rotateOffset",0);M(this,"rotateVelocity",0);M(this,"scaleOffset",0);M(this,"scaleVelocity",0);M(this,"active",!1);M(this,"skeleton");M(this,"remaining",0);M(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 i=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,l=a.data.length;switch(e){case pr.none:return;case pr.reset:this.reset();case pr.update:const c=this.skeleton,h=Math.max(this.skeleton.time-this.lastTime,0);this.remaining+=h,this.lastTime=c.time;const u=a.worldX,d=a.worldY;if(this._reset)this._reset=!1,this.ux=u,this.uy=d;else{let f=this.remaining,m=this.inertia,p=this.data.step,g=this.skeleton.data.referenceScale,x=-1,v=this.data.limit*h,y=v*Math.abs(c.scaleY);if(v*=Math.abs(c.scaleX),i||n){if(i){const w=(this.ux-u)*m;this.xOffset+=w>v?v:w<-v?-v:w,this.ux=u}if(n){const w=(this.uy-d)*m;this.yOffset+=w>y?y:w<-y?-y:w,this.uy=d}if(f>=p){x=Math.pow(this.damping,60*p);const w=this.massInverse*p,_=this.strength,S=this.wind*g*c.scaleX,b=this.gravity*g*c.scaleY;do i&&(this.xVelocity+=(S-this.xOffset*_)*w,this.xOffset+=this.xVelocity*p,this.xVelocity*=x),n&&(this.yVelocity-=(b+this.yOffset*_)*w,this.yOffset+=this.yVelocity*p,this.yVelocity*=x),f-=p;while(f>=p)}i&&(a.worldX+=this.xOffset*t*this.data.x),n&&(a.worldY+=this.yOffset*t*this.data.y)}if(r||o){let w=Math.atan2(a.c,a.a),_=0,S=0,b=0,C=this.cx-a.worldX,A=this.cy-a.worldY;if(C>v?C=v:C<-v&&(C=-v),A>y?A=y:A<-y&&(A=-y),r){b=(this.data.rotate+this.data.shearX)*t;let P=Math.atan2(A+this.ty,C+this.tx)-w-this.rotateOffset*b;this.rotateOffset+=(P-Math.ceil(P*Re.invPI2-.5)*Re.PI2)*m,P=this.rotateOffset*b+w,_=Math.cos(P),S=Math.sin(P),o&&(P=l*a.getWorldScaleX(),P>0&&(this.scaleOffset+=(C*_+A*S)*m/P))}else{_=Math.cos(w),S=Math.sin(w);const P=l*a.getWorldScaleX();P>0&&(this.scaleOffset+=(C*_+A*S)*m/P)}if(f=this.remaining,f>=p){x==-1&&(x=Math.pow(this.damping,60*p));const P=this.massInverse*p,E=this.strength,R=this.wind,O=Ip.yDown?-this.gravity:this.gravity,U=l/g;for(;;)if(f-=p,o&&(this.scaleVelocity+=(R*_-O*S-this.scaleOffset*E)*P,this.scaleOffset+=this.scaleVelocity*p,this.scaleVelocity*=x),r){if(this.rotateVelocity-=((R*S+O*_)*U+this.rotateOffset*E)*P,this.rotateOffset+=this.rotateVelocity*p,this.rotateVelocity*=x,f0){let f=0;this.data.rotate>0&&(f=c*this.data.rotate,h=Math.sin(f),u=Math.cos(f),d=a.b,a.b=u*d-h*a.d,a.d=h*d+u*a.d),f+=c*this.data.shearX,h=Math.sin(f),u=Math.cos(f),d=a.a,a.a=u*d-h*a.c,a.c=h*d+u*a.c}else c*=this.data.rotate,h=Math.sin(c),u=Math.cos(c),d=a.a,a.a=u*d-h*a.c,a.c=h*d+u*a.c,d=a.b,a.b=u*d-h*a.d,a.d=h*d+u*a.d}if(o){const c=1+this.scaleOffset*t*this.data.scaleX;a.a*=c,a.c*=c}e!=pr.pose&&(this.tx=l*a.a,this.ty=l*a.c),a.updateAppliedTransform()}translate(e,t){this.ux-=e,this.uy-=t,this.cx-=e,this.cy-=t}rotate(e,t,i){const n=i*Re.degRad,r=Math.cos(n),o=Math.sin(n),a=this.cx-e,l=this.cy-t;this.translate(a*r-l*o-a,a*o+l*r-l)}},vP=class{constructor(e,t){M(this,"data");M(this,"bone");M(this,"color");M(this,"darkColor",null);M(this,"attachment",null);M(this,"attachmentState",0);M(this,"sequenceIndex",-1);M(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 lt,this.darkColor=e.darkColor?new lt:null,this.setToSetupPose()}getSkeleton(){return this.bone.skeleton}getAttachment(){return this.attachment}setAttachment(e){this.attachment!=e&&((!(e instanceof zn)||!(this.attachment instanceof zn)||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}},yP=class{constructor(e,t){M(this,"data");M(this,"bones");M(this,"target");M(this,"mixRotate",0);M(this,"mixX",0);M(this,"mixY",0);M(this,"mixScaleX",0);M(this,"mixScaleY",0);M(this,"mixShearY",0);M(this,"temp",new bh);M(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?Re.degRad:-.01745329277777778,m=this.data.offsetRotation*f,p=this.data.offsetShearY*f,g=this.bones;for(let x=0,v=g.length;xRe.PI?C-=Re.PI2:C<-3.1415927&&(C+=Re.PI2),C*=e;let A=Math.cos(C),P=Math.sin(C);y.a=A*w-P*S,y.b=A*_-P*b,y.c=P*w+A*S,y.d=P*_+A*b}if(a){let w=this.temp;l.localToWorld(w.set(this.data.offsetX,this.data.offsetY)),y.worldX+=(w.x-y.worldX)*t,y.worldY+=(w.y-y.worldY)*i}if(n!=0){let w=Math.sqrt(y.a*y.a+y.c*y.c);w!=0&&(w=(w+(Math.sqrt(c*c+u*u)-w+this.data.offsetScaleX)*n)/w),y.a*=w,y.c*=w}if(r!=0){let w=Math.sqrt(y.b*y.b+y.d*y.d);w!=0&&(w=(w+(Math.sqrt(h*h+d*d)-w+this.data.offsetScaleY)*r)/w),y.b*=w,y.d*=w}if(o>0){let w=y.b,_=y.d,S=Math.atan2(_,w),b=Math.atan2(d,h)-Math.atan2(u,c)-(S-Math.atan2(y.c,y.a));b>Re.PI?b-=Re.PI2:b<-3.1415927&&(b+=Re.PI2),b=S+(b+p)*o;let C=Math.sqrt(w*w+_*_);y.b=Math.cos(b)*C,y.d=Math.sin(b)*C}y.updateAppliedTransform()}}applyRelativeWorld(){let e=this.mixRotate,t=this.mixX,i=this.mixY,n=this.mixScaleX,r=this.mixScaleY,o=this.mixShearY,a=t!=0||i!=0,l=this.target,c=l.a,h=l.b,u=l.c,d=l.d,f=c*d-h*u>0?Re.degRad:-.01745329277777778,m=this.data.offsetRotation*f,p=this.data.offsetShearY*f,g=this.bones;for(let x=0,v=g.length;xRe.PI?C-=Re.PI2:C<-3.1415927&&(C+=Re.PI2),C*=e;let A=Math.cos(C),P=Math.sin(C);y.a=A*w-P*S,y.b=A*_-P*b,y.c=P*w+A*S,y.d=P*_+A*b}if(a){let w=this.temp;l.localToWorld(w.set(this.data.offsetX,this.data.offsetY)),y.worldX+=w.x*t,y.worldY+=w.y*i}if(n!=0){let w=(Math.sqrt(c*c+u*u)-1+this.data.offsetScaleX)*n+1;y.a*=w,y.c*=w}if(r!=0){let w=(Math.sqrt(h*h+d*d)-1+this.data.offsetScaleY)*r+1;y.b*=w,y.d*=w}if(o>0){let w=Math.atan2(d,h)-Math.atan2(u,c);w>Re.PI?w-=Re.PI2:w<-3.1415927&&(w+=Re.PI2);let _=y.b,S=y.d;w=Math.atan2(S,_)+(w-Re.PI/2+p)*o;let b=Math.sqrt(_*_+S*S);y.b=Math.cos(w)*b,y.d=Math.sin(w)*b}y.updateAppliedTransform()}}applyAbsoluteLocal(){let e=this.mixRotate,t=this.mixX,i=this.mixY,n=this.mixScaleX,r=this.mixScaleY,o=this.mixShearY,a=this.target,l=this.bones;for(let c=0,h=l.length;ct.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 bh,i=new bh;return this.getBounds(t,i,void 0,e),{x:t.x,y:t.y,width:i.x,height:i.y}}getBounds(e,t,i=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,l=Number.NEGATIVE_INFINITY,c=Number.NEGATIVE_INFINITY;for(let h=0,u=r.length;h=n.length&&(n.length=e+1),n[e]||(n[e]={}),n[e][t]=i}addSkin(e){for(let n=0;n= 0.");if(!t)throw new Error("name cannot be null.");if(!i)throw new Error("boneData cannot be null.");this.index=e,this.name=t,this.boneData=i}};var wr;(function(s){s[s.Normal=0]="Normal",s[s.Additive=1]="Additive",s[s.Multiply=2]="Multiply",s[s.Screen=3]="Screen"})(wr||(wr={}));let Fw=class extends vu{constructor(t){super(t,0,!1);M(this,"bones",new Array);M(this,"_target",null);M(this,"mixRotate",0);M(this,"mixX",0);M(this,"mixY",0);M(this,"mixScaleX",0);M(this,"mixScaleY",0);M(this,"mixShearY",0);M(this,"offsetRotation",0);M(this,"offsetX",0);M(this,"offsetY",0);M(this,"offsetScaleX",0);M(this,"offsetScaleY",0);M(this,"offsetShearY",0);M(this,"relative",!1);M(this,"local",!1)}set target(t){this._target=t}get target(){if(this._target)return this._target;throw new Error("BoneData not set.")}},Tm=class{constructor(e){M(this,"scale",1);M(this,"attachmentLoader");M(this,"linkedMeshes",new Array);this.attachmentLoader=e}readSkeletonData(e){let t=this.scale,i=new Sh;i.name="";let n=new xP(e),r=n.readInt32(),o=n.readInt32();i.hash=o==0&&r==0?null:o.toString(16)+r.toString(16),i.version=n.readString(),i.x=n.readFloat(),i.y=n.readFloat(),i.width=n.readFloat(),i.height=n.readFloat(),i.referenceScale=n.readFloat()*t;let a=n.readBoolean();a&&(i.fps=n.readFloat(),i.imagesPath=n.readString(),i.audioPath=n.readString());let l=0;l=n.readInt(!0);for(let h=0;h>1&3,f.rotateMode=m>>3&3,(m&128)!=0&&(f.offsetRotation=n.readFloat()),f.position=n.readFloat(),f.positionMode==un.Fixed&&(f.position*=t),f.spacing=n.readFloat(),(f.spacingMode==fi.Length||f.spacingMode==fi.Fixed)&&(f.spacing*=t),f.mixRotate=n.readFloat(),f.mixX=n.readFloat(),f.mixY=n.readFloat(),i.pathConstraints.push(f)}l=n.readInt(!0);for(let h=0,u;h>4,e.readFloat())}n.push(S);break}}}}}let o=e.readInt(!0);if(o>0){let c=new tl(o),h=i.slots.length;for(let u=0;u=0;v--)m[v]=-1;let p=Pe.newArray(h-f,0),g=0,x=0;for(let v=0;v=0;v--)m[v]==-1&&(m[v]=p[--x]);c.setFrame(u,d,m)}n.push(c)}let a=e.readInt(!0);if(a>0){let c=new Ap(a);for(let h=0;h>>1^-(i&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 i=0;i>4){case 12:case 13:t+=String.fromCharCode((n&31)<<6|this.readByte()&63),i+=2;break;case 14:t+=String.fromCharCode((n&15)<<12|(this.readByte()&63)<<6|this.readByte()&63),i+=3;break;default:t+=String.fromCharCode(n),i++}}return t}readFloat(){let e=this.buffer.getFloat32(this.index);return this.index+=4,e}readBoolean(){return this.readByte()!=0}},bP=class{constructor(e,t,i,n,r){M(this,"parent");M(this,"skinIndex");M(this,"slotIndex");M(this,"mesh");M(this,"inheritTimeline");this.mesh=e,this.skinIndex=t,this.slotIndex=i,this.parent=n,this.inheritTimeline=r}},wP=class{constructor(e=null,t=null,i=0){M(this,"bones");M(this,"vertices");M(this,"length");this.bones=e,this.vertices=t,this.length=i}};var Tn;(function(s){s[s.Region=0]="Region",s[s.BoundingBox=1]="BoundingBox",s[s.Mesh=2]="Mesh",s[s.LinkedMesh=3]="LinkedMesh",s[s.Path=4]="Path",s[s.Point=5]="Point",s[s.Clipping=6]="Clipping"})(Tn||(Tn={}));function Ei(s,e,t){let i=s.readFloat(),n=s.readFloat()*t;for(let r=0,o=0,a=e.getFrameCount()-1;e.setFrame(r,i,n),r!=a;r++){let l=s.readFloat(),c=s.readFloat()*t;switch(s.readByte()){case zs:e.setStepped(r);break;case qs:pt(s,e,o++,r,0,i,l,n,c,t)}i=l,n=c}return e}function mf(s,e,t){let i=s.readFloat(),n=s.readFloat()*t,r=s.readFloat()*t;for(let o=0,a=0,l=e.getFrameCount()-1;e.setFrame(o,i,n,r),o!=l;o++){let c=s.readFloat(),h=s.readFloat()*t,u=s.readFloat()*t;switch(s.readByte()){case zs:e.setStepped(o);break;case qs:pt(s,e,a++,o,0,i,c,n,h,t),pt(s,e,a++,o,1,i,c,r,u,t)}i=c,n=h,r=u}return e}function pt(s,e,t,i,n,r,o,a,l,c){e.setBezier(t,i,n,r,a,s.readFloat(),s.readFloat()*c,s.readFloat(),s.readFloat()*c,o,l)}const SP=0,MP=1,TP=2,_P=3,CP=4,EP=5,AP=6,IP=7,RP=8,PP=9,kP=10,FP=0,OP=1,LP=2,BP=3,NP=4,DP=5,UP=0,$P=1,XP=0,VP=1,YP=2,GP=0,jP=1,HP=2,WP=4,zP=5,qP=6,KP=7,ZP=8,zs=1,qs=2;class Wi{constructor(){M(this,"convexPolygons",new Array);M(this,"convexPolygonsIndices",new Array);M(this,"indicesArray",new Array);M(this,"isConcaveArray",new Array);M(this,"triangles",new Array);M(this,"polygonPool",new xh(()=>new Array));M(this,"polygonIndicesPool",new xh(()=>new Array))}triangulate(e){let t=e,i=e.length>>1,n=this.indicesArray;n.length=0;for(let a=0;a3;){let a=i-1,l=0,c=1;for(;;){e:if(!r[l]){let d=n[a]<<1,f=n[l]<<1,m=n[c]<<1,p=t[d],g=t[d+1],x=t[f],v=t[f+1],y=t[m],w=t[m+1];for(let _=(c+1)%i;_!=a;_=(_+1)%i){if(!r[_])continue;let S=n[_]<<1,b=t[S],C=t[S+1];if(Wi.positiveArea(y,w,p,g,b,C)&&Wi.positiveArea(p,g,x,v,b,C)&&Wi.positiveArea(x,v,y,w,b,C))break e}break}if(c==0){do{if(!r[l])break;l--}while(l>0);break}a=l,l=c,c=(c+1)%i}o.push(n[(i+l-1)%i]),o.push(n[l]),o.push(n[(l+1)%i]),n.splice(l,1),r.splice(l,1),i--;let h=(i+l-1)%i,u=l==i?0:l;r[h]=Wi.isConcave(h,i,t,n),r[u]=Wi.isConcave(u,i,t,n)}return i==3&&(o.push(n[2]),o.push(n[0]),o.push(n[1])),o}decompose(e,t){let i=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 l=-1,c=0;for(let h=0,u=t.length;h0?(n.push(a),r.push(o)):(this.polygonPool.free(a),this.polygonIndicesPool.free(o)),a=this.polygonPool.obtain(),a.length=0,a.push(p),a.push(g),a.push(x),a.push(v),a.push(y),a.push(w),o=this.polygonIndicesPool.obtain(),o.length=0,o.push(d),o.push(f),o.push(m),c=Wi.winding(p,g,x,v,y,w),l=d)}a.length>0&&(n.push(a),r.push(o));for(let h=0,u=n.length;h=0;h--)a=n[h],a.length==0&&(n.splice(h,1),this.polygonPool.free(a),o=r[h],r.splice(h,1),this.polygonIndicesPool.free(o));return n}static isConcave(e,t,i,n){let r=n[(t+e-1)%t]<<1,o=n[e]<<1,a=n[(e+1)%t]<<1;return!this.positiveArea(i[r],i[r+1],i[o],i[o+1],i[a],i[a+1])}static positiveArea(e,t,i,n,r,o){return e*(o-n)+i*(t-o)+r*(n-t)>=0}static winding(e,t,i,n,r,o){let a=i-e,l=n-t;return r*l-o*a+a*t-e*l>=0?1:-1}}class Mh{constructor(){M(this,"triangulator",new Wi);M(this,"clippingPolygon",new Array);M(this,"clipOutput",new Array);M(this,"clippedVertices",new Array);M(this,"clippedUVs",new Array);M(this,"clippedTriangles",new Array);M(this,"scratch",new Array);M(this,"clipAttachment",null);M(this,"clippingPolygons",null)}clipStart(e,t){if(this.clipAttachment)return 0;this.clipAttachment=t;let i=t.worldVerticesLength,n=Pe.setArraySize(this.clippingPolygon,i);t.computeWorldVertices(e,0,i,n,0,2);let r=this.clippingPolygon;Mh.makeClockwise(r);let o=this.clippingPolygons=this.triangulator.decompose(r,this.triangulator.triangulate(r));for(let a=0,l=o.length;a>1,S=this.clipOutput,b=Pe.setArraySize(r,y+_*2);for(let A=0;A>1,V=this.clipOutput,Y=Pe.setArraySize(c,U+F*f);for(let z=0;z>1,k=this.clipOutput,N=Pe.setArraySize(o,E+D*2),F=Pe.setArraySize(a,E+D*2);for(let Y=0;Y=2?(u=l,l=this.scratch):u=this.scratch,u.length=0,u.push(e),u.push(t),u.push(i),u.push(n),u.push(r),u.push(o),u.push(e),u.push(t),l.length=0;let d=a.length-4,f=a;for(let m=0;;m+=2){let p=f[m],g=f[m+1],x=p-f[m+2],v=g-f[m+3],y=l.length,w=u;for(let S=0,b=u.length-2;Sx*(g-E),O=v*(p-C)-x*(g-A);if(O>0){if(R){l.push(P),l.push(E);continue}let U=P-C,G=E-A,$=O/(U*v-G*x);if($>=0&&$<=1)l.push(C+U*$),l.push(A+G*$);else{l.push(P),l.push(E);continue}}else if(R){let U=P-C,G=E-A,$=O/(U*v-G*x);if($>=0&&$<=1)l.push(C+U*$),l.push(A+G*$),l.push(P),l.push(E);else{l.push(P),l.push(E);continue}}h=!0}if(y==l.length)return c.length=0,!0;if(l.push(l[0]),l.push(l[1]),m==d)break;let _=l;l=u,l.length=0,u=_}if(c!=l){c.length=0;for(let m=0,p=l.length-2;m>1;c0){let h=i.findPhysicsConstraint(a);if(!h)throw new Error("Physics constraint not found: "+a);c=i.physicsConstraints.indexOf(h)}for(let h in l){let u=l[h],d=u[0];if(!d)continue;let f=u.length;if(h=="reset"){const p=new gw(f,c);for(let g=0;d!=null;d=u[g+1],g++)p.setFrame(g,ne(d,"time",0));r.push(p);continue}let m;if(h=="inertia")m=new cw(f,f,c);else if(h=="strength")m=new hw(f,f,c);else if(h=="damping")m=new uw(f,f,c);else if(h=="mass")m=new dw(f,f,c);else if(h=="wind")m=new fw(f,f,c);else if(h=="gravity")m=new mw(f,f,c);else if(h=="mix")m=new pw(f,f,c);else continue;r.push(Ts(u,m,0,1))}}if(e.attachments)for(let a in e.attachments){let l=e.attachments[a],c=i.findSkin(a);if(!c)throw new Error("Skin not found: "+a);for(let h in l){let u=l[h],d=i.findSlot(h);if(!d)throw new Error("Slot not found: "+h);let f=d.index;for(let m in u){let p=u[m],g=c.getAttachment(f,m);for(let x in p){let v=p[x],y=v[0];if(y){if(x=="deform"){let w=g.bones,_=g.vertices,S=w?_.length/3*2:_.length,b=new sw(v.length,v.length,f,g),C=ne(y,"time",0);for(let A=0,P=0;;A++){let E,R=ne(y,"vertices",null);if(!R)E=w?Pe.newFloatArray(S):_;else{E=Pe.newFloatArray(S);let $=ne(y,"offset",0);if(Pe.arrayCopy(R,0,E,$,R.length),n!=1)for(let X=$,D=X+R.length;X=0;x--)d[x]==-1&&(d[x]=m[--g])}a.setFrame(c,ne(u,"time",0),d)}r.push(a)}if(e.events){let a=new Ap(e.events.length),l=0;for(let c=0;c"u"&&(Math.fround=(function(s){return function(e){return s[0]=e,s[0]}})(new Float32Array(1)));if(typeof window<"u"&&window.PIXI){let s=window.require;window.require=e=>{if(s)return s(e);if(e.startsWith("@pixi/"))return window.PIXI}}const Cn=class Cn extends hP{constructor(t){super(t.resource.source);M(this,"texture");this.texture=Ke.from(t)}static from(t){return Cn.textureMap.has(t)?Cn.textureMap.get(t):new Cn(t)}setFilters(t,i){this.texture.baseTexture.scaleMode=Cn.toPixiTextureFilter(t),this.texture.baseTexture.mipmap=Cn.toPixiMipMap(t)}setWraps(t,i){this.texture.baseTexture.wrapMode=Cn.toPixiTextureWrap(t)}dispose(){this.texture.destroy()}static toPixiTextureFilter(t){switch(t){case yi.Nearest:case yi.MipMapNearestLinear:case yi.MipMapNearestNearest:return Rs.NEAREST;case yi.Linear:case yi.MipMapLinearLinear:case yi.MipMapLinearNearest:return Rs.LINEAR;default:throw new Error(`Unknown texture filter: ${String(t)}`)}}static toPixiMipMap(t){switch(t){case yi.Nearest:case yi.Linear:return vs.OFF;case yi.MipMapNearestLinear:case yi.MipMapNearestNearest:case yi.MipMapLinearLinear:case yi.MipMapLinearNearest:return vs.ON;default:throw new Error(`Unknown texture filter: ${String(t)}`)}}static toPixiTextureWrap(t){switch(t){case Vn.ClampToEdge:return Os.CLAMP;case Vn.MirroredRepeat:return Os.MIRRORED_REPEAT;case Vn.Repeat:return Os.REPEAT;default:throw new Error(`Unknown texture wrap: ${String(t)}`)}}static toPixiBlending(t){switch(t){case wr.Normal:return We.NORMAL;case wr.Additive:return We.ADD;case wr.Multiply:return We.MULTIPLY;case wr.Screen:return We.SCREEN;default:throw new Error(`Unknown blendMode: ${String(t)}`)}}};M(Cn,"textureMap",new Map);let mo=Cn;const En=class En extends wl{constructor(){const t=new Mp;t.getBuffer("aVertexPosition").static=!1,t.getBuffer("aTextureCoord").static=!1;const i=new ph(Ke.EMPTY);super(t,i);M(this,"name","");M(this,"warnedTwoTint",!1)}updateFromSpineData(t,i,n,r,o,a,l,c){var x,v;this.texture=t.texture;const h=o/(c?12:8)*2,u=this.geometry.getBuffer("aTextureCoord");((x=u.data)==null?void 0:x.length)!==h&&(u.data=new Float32Array(h));const d=this.geometry.getBuffer("aVertexPosition");((v=d.data)==null?void 0:v.length)!==h&&(d.data=new Float32Array(h));let f=0,m=u.data,p=d.data;for(let y=0;ynew _m);M(this,"beforeUpdateWorldTransforms",()=>{});M(this,"afterUpdateWorldTransforms",()=>{});M(this,"_autoUpdate",!1);M(this,"_ticker",Yi.shared);M(this,"meshesCache",new Map);M(this,"lightColor",new lt);M(this,"darkColor",new lt);M(this,"_boundsProvider");M(this,"_boundsPoint",new St);M(this,"_boundsSpineID",-1);M(this,"_boundsSpineDirty",!0);M(this,"slotsObject",new Map);M(this,"verticesCache",Pe.newFloatArray(1024));M(this,"clippingSlotToPixiMasks",{});M(this,"currentClippingSlot");const n=t instanceof Sh?t:t.skeletonData;this.skeleton=new Ip(n);const r=new cP(n);this.state=new nP(r),(t==null?void 0:t.darkTint)!==void 0||(i==null?void 0:i.slotMeshFactory)===void 0?(this.darkTint=(t==null?void 0:t.darkTint)===void 0?this.skeleton.slots.some(o=>!!o.data.darkColor):t==null?void 0:t.darkTint,this.darkTint&&(this.slotMeshFactory=()=>new il)):this.initializeMeshFactory(i==null?void 0:i.slotMeshFactory),t!=null&&t.ticker&&(this._ticker=t.ticker),this.autoUpdate=(t==null?void 0:t.autoUpdate)??!0,this.boundsProvider=t.boundsProvider}get debug(){return this._debug}set debug(t){this._debug&&this._debug.unregisterSpine(this),t&&t.registerSpine(this),this._debug=t}get autoUpdate(){return this._autoUpdate}set autoUpdate(t){t&&!this._autoUpdate?this._ticker.add(this.internalUpdate,this):!t&&this._autoUpdate&&this._ticker.remove(this.internalUpdate,this),this._autoUpdate=t}get ticker(){return this._ticker}set ticker(t){t=t??Yi.shared,this._ticker!==t&&(this._autoUpdate&&(this._ticker.remove(this.internalUpdate,this),t.add(this.internalUpdate,this)),this._ticker=t)}get boundsProvider(){return this._boundsProvider}set boundsProvider(t){this._boundsProvider=t,t?(this._boundsSpineID=-1,this._boundsSpineDirty=!0,this.interactiveChildren=!1):(this.interactiveChildren=!0,this.hitArea=null),this.hasNeverUpdated||this.calculateBounds()}initializeMeshFactory(t){if(t){this.slotMeshFactory=t;const i=this.slotMeshFactory();i instanceof il&&(this.darkTint=!0),i.destroy()}else for(let i=0;inew il,this.darkTint=!0;break}}update(t){this.internalUpdate(0,t)}internalUpdate(t,i){this.hasNeverUpdated=!1;const n=i??this._ticker.deltaMS/1e3;this.state.update(n),this.state.apply(this.skeleton),this.beforeUpdateWorldTransforms(this),this.skeleton.update(n),this.skeleton.updateWorldTransform(pr.update),this.afterUpdateWorldTransforms(this)}updateTransform(){var t;this.renderMeshes(),this.sortChildren(),(t=this.debug)==null||t.renderDebug(this),super.updateTransform()}destroy(t){var i;this.autoUpdate&&(this.autoUpdate=!1),this._ticker=null;for(const[,n]of this.meshesCache)n==null||n.destroy();this.state.clearListeners(),this.debug=void 0,this.meshesCache.clear(),this.slotsObject.clear();for(let n in this.clippingSlotToPixiMasks)(i=this.clippingSlotToPixiMasks[n].mask)==null||i.destroy(),delete this.clippingSlotToPixiMasks[n];super.destroy(t)}resetMeshes(){for(const[,t]of this.meshesCache)t.zIndex=-1,t.visible=!1}_calculateBounds(){this.hasNeverUpdated&&(this.internalUpdate(0,0),this.renderMeshes())}hasMeshForSlot(t){return this.meshesCache.has(t)}getMeshForSlot(t){if(this.hasMeshForSlot(t)){let i=this.meshesCache.get(t);return i.visible=!0,i}else{let i=this.slotMeshFactory();return this.addChild(i),this.meshesCache.set(t,i),i}}getSlotFromRef(t){let i;if(typeof t=="number"?i=this.skeleton.slots[t]:typeof t=="string"?i=this.skeleton.findSlot(t):i=t,!i)throw new Error(`No slot found with the given slot reference: ${t}`);return i}addSlotObject(t,i,n){var a;let r=this.getSlotFromRef(t);const o=(a=this.slotsObject.get(r))==null?void 0:a.container;if(!(o&&o===i)){for(const[l,{container:c}]of this.slotsObject)if(l!==r&&c===i){this.removeSlotObject(l,i);break}o&&this.removeChild(o),this.slotsObject.set(r,{container:i,followAttachmentTimeline:(n==null?void 0:n.followAttachmentTimeline)||!1,followSlotColor:(n==null?void 0:n.followSlotColor)||!1}),this.addChild(i)}}getSlotObject(t){const i=this.slotsObject.get(this.getSlotFromRef(t));return i?i.container:void 0}removeSlotObject(t,i){var o;let n=this.getSlotFromRef(t),r=(o=this.slotsObject.get(n))==null?void 0:o.container;r&&(i&&i!==r||(this.removeChild(r),this.slotsObject.delete(n)))}removeSlotObjects(){for(const[,t]of this.slotsObject)t.container.removeFromParent();this.slotsObject.clear()}updateSlotObject(t,i,n){const{container:r,followAttachmentTimeline:o}=t,a=o?!!i.attachment:!0;if(r.visible=this.skeleton.drawOrder.includes(i)&&a,r.visible){let l=i.bone;const c=r.localTransform;c.a=l.a,c.b=l.c,c.c=-l.b,c.d=-l.d,c.tx=l.worldX,c.ty=l.worldY,r.transform.setFromMatrix(c),r.zIndex=n,r.alpha=this.skeleton.color.a*i.color.a,t.followSlotColor&&this.setSlotObjectTint(r,255*this.skeleton.color.r*i.color.r<<16|255*this.skeleton.color.g*i.color.g<<8|255*this.skeleton.color.b*i.color.b)}}setSlotObjectTint(t,i){const n=t;"tint"in n&&(n.tint=i);for(const r of n.children??[])this.setSlotObjectTint(r,i)}updateAndSetPixiMask(t,i){var a,l;const n=t.attachment;if(n&&n instanceof na){const c=(a=this.clippingSlotToPixiMasks)[l=t.data.name]||(a[l]={slot:t,vertices:new Array});c.maskComputed=!1,this.currentClippingSlot=c;return}let r=this.currentClippingSlot;const o=this.slotsObject.get(t);if(r&&o){let c=r.mask;if(c||(c=Jv.obtain(),r.mask=c,this.addChild(c)),!r.maskComputed){let h=r.slot,u=h.attachment;r.maskComputed=!0;const d=u.worldVerticesLength,f=r.vertices;u.computeWorldVertices(h,0,d,f,0,2),c.clear().lineStyle(0).beginFill(0).drawPolygon(f).endFill()}o.container.mask=c}else o!=null&&o.container.mask&&(o.container.mask=null);if(r&&r.slot.attachment.endSlot==t.data&&(this.currentClippingSlot=void 0),i){for(const c in this.clippingSlotToPixiMasks){const h=this.clippingSlotToPixiMasks[c];(!(h.slot.attachment instanceof na)||!h.maskComputed)&&h.mask&&(this.removeChild(h.mask),Jv.free(h.mask),h.mask=void 0)}this.currentClippingSlot=void 0}}renderMeshes(){var r,o;this.resetMeshes();let t=null,i=null;const n=this.skeleton.drawOrder;for(let a=0,l=n.length,c=0;a>1)*m,v>this.verticesCache.length&&(this.verticesCache=Pe.newFloatArray(v)),y.computeWorldVertices(h,0,y.worldVerticesLength,this.verticesCache,0,m),t=y.triangles,i=y.uvs,x=(o=y.region)==null?void 0:o.texture}else if(p instanceof na){Mt.clipper.clipStart(h,p);continue}else{this.hasMeshForSlot(h)&&(this.getMeshForSlot(h).visible=!1),Mt.clipper.clipEndWithSlot(h);continue}if(x!=null){const w=h.bone.skeleton.color,_=h.color,S=w.a*_.a*g.a;this.lightColor.set(w.r*_.r*g.r,w.g*_.g*g.g,w.b*_.b*g.b,S),h.darkColor!=null?this.darkColor.set(h.darkColor.r,h.darkColor.g,h.darkColor.b,1):this.darkColor.set(0,0,0,1);let b,C,A,P;if(Mt.clipper.isClipping())Mt.clipper.clipTriangles(this.verticesCache,t,t.length,i,this.lightColor,this.darkColor,f),b=Mt.clipper.clippedVertices,C=b.length,A=Mt.clipper.clippedTriangles,P=A.length;else{const R=this.verticesCache;for(let O=2,U=0,G=v;Onew Ni);Ip.yDown=!0;const wc="spineTextureAtlasLoader",nk={extension:ke.Asset,resolver:{test:s=>Ki(s,".atlas"),parse:s=>{var t,i;const e=s.split(".");return{resolution:parseFloat(((i=(t=Be.RETINA_PREFIX)==null?void 0:t.exec(s))==null?void 0:i[1])??"1"),format:e[e.length-2],src:s}}},loader:{name:wc,extension:{type:ke.LoadParser,priority:os.Normal,name:wc},test(s){return Ki(s,".atlas")},async load(s){const e=await Be.ADAPTER.fetch(s);if(!e.ok)throw new Error(`[${wc}] Failed to fetch ${s}: ${e.status} ${e.statusText}`);return await e.text()},testParse(s,e){const t=Ki(e.src,".atlas"),i=typeof s=="string",n=e.loadParser===wc;return Promise.resolve((t||n)&&i)},unload(s){s.dispose()},async parse(s,e,t){var l;const i=e.data||{};let n=si.dirname(e.src);n&&n.lastIndexOf("/")!==n.length-1&&(n+="/");const r=new ww(s);if(i.images instanceof tt||typeof i.images=="string"){const c=i.images;i.images={},i.images[r.pages[0].name]=c}const o=[];let a=!0;for(const c of t.parsers)if(c.name=="loadTextures"){a=(l=c.config)==null?void 0:l.preferCreateImageBitmap;break}ln.setPreferences({preferCreateImageBitmap:!1});for(const c of r.pages){const h=c.name,u=i!=null&&i.images?i.images[h]:void 0;if(u instanceof tt)c.setTexture(mo.from(u));else{const d=u??si.normalize([...n.split(si.sep),h].join(si.sep)),f={src:hh(d,e.src),data:{...i.imageMetadata,alphaMode:c.pma?bi.PMA:bi.UNPACK}},m=t.load(f).then(p=>{c.setTexture(mo.from(p.baseTexture))});o.push(m)}}return await Promise.all(o),ln.setPreferences({preferCreateImageBitmap:a}),r}}};$e.add(nk);const Sc="spineSkeletonLoader";function rk(s){return s.hasOwnProperty("bones")}function ok(s){return s instanceof Uint8Array}const ak={extension:ke.Asset,loader:{name:Sc,extension:{type:ke.LoadParser,priority:os.Normal,name:Sc},test(s){return Ki(s,".skel")},async load(s){const e=await Be.ADAPTER.fetch(s);if(!e.ok)throw new Error(`[${Sc}] Failed to fetch ${s}: ${e.status} ${e.statusText}`);return new Uint8Array(await e.arrayBuffer())},testParse(s,e){const t=Ki(e.src,".json")&&rk(s),i=Ki(e.src,".skel")&&ok(s),n=e.loadParser===Sc;return Promise.resolve(t||i||n)}}};$e.add(ak);class lk extends fn{constructor(t=!1){super();M(this,"_buffer");M(this,"_indexBuffer");this._buffer=new $t(void 0,t,!1),this._indexBuffer=new $t(void 0,t,!0),this.addAttribute("aVertexPosition",this._buffer,2,!1,Ue.FLOAT).addAttribute("aTextureCoord",this._buffer,2,!1,Ue.FLOAT).addAttribute("aColor",this._buffer,4,!0,Ue.UNSIGNED_BYTE).addAttribute("aDarkColor",this._buffer,4,!0,Ue.UNSIGNED_BYTE).addAttribute("aTextureId",this._buffer,1,!0,Ue.FLOAT).addIndex(this._indexBuffer)}}const ck=` -precision highp float; -attribute vec2 aVertexPosition; -attribute vec2 aTextureCoord; -attribute vec4 aColor; -attribute vec4 aDarkColor; -attribute float aTextureId; - -uniform mat3 projectionMatrix; -uniform mat3 translationMatrix; -uniform vec4 tint; - -varying vec2 vTextureCoord; -varying vec4 vColor; -varying vec4 vDarkColor; -varying float vTextureId; - -void main(void){ - gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); - - vTextureCoord = aTextureCoord; - vTextureId = aTextureId; - vColor = aColor * tint; - vDarkColor = aDarkColor * tint; - -} -`,hk=` -varying vec2 vTextureCoord; -varying vec4 vColor; -varying vec4 vDarkColor; -varying float vTextureId; -uniform sampler2D uSamplers[%count%]; - -void main(void){ - vec4 color; - %forloop% - - - gl_FragColor.a = color.a * vColor.a; - gl_FragColor.rgb = ((color.a - 1.0) * vDarkColor.a + 1.0 - color.rgb) * vDarkColor.rgb + color.rgb * vColor.rgb; -} -`;class Ow extends cr{constructor(e){super(e),this.shaderGenerator=new bb(ck,hk),this.geometryClass=lk,this.vertexSize=7}packInterleavedGeometry(e,t,i,n,r){const{uint32View:o,float32View:a}=t,l=n/this.vertexSize,c=e.uvs,h=e.indices,u=e.vertexData,d=e._texture.baseTexture._batchLocation,f=Math.min(e.worldAlpha,1),m=At.shared.setValue(e._tintRGB).toPremultiplied(f,!0),p=At.shared.setValue(e._darkTintRGB).premultiply(f,!0).toPremultiplied(1,!1);for(let g=0;g0){let o=function(c){return Promise.all(c.map(h=>Promise.resolve(h).then(u=>({status:"fulfilled",value:u}),u=>({status:"rejected",reason:u}))))};document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),l=(a==null?void 0:a.nonce)||(a==null?void 0:a.getAttribute("nonce"));n=o(t.map(c=>{if(c=pk(c),c in Qv)return;Qv[c]=!0;const h=c.endsWith(".css"),u=h?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${u}`))return;const d=document.createElement("link");if(d.rel=h?"stylesheet":mk,h||(d.as="script"),d.crossOrigin="",d.href=c,l&&d.setAttribute("nonce",l),document.head.appendChild(d),h)return new Promise((f,m)=>{d.addEventListener("load",f),d.addEventListener("error",()=>m(new Error(`Unable to preload CSS for ${c}`)))})}))}function r(o){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o}return n.then(o=>{for(const a of o||[])a.status==="rejected"&&r(a.reason);return e().catch(r)})};async function Bw(){const[s,e]=await Promise.all([ey(()=>import("./index-ChTSy5jk.js"),[]),ey(()=>import("./index-Csznclrj.js"),__vite__mapDeps([0,1]))]);return{core:s,pixi:e}}async function gk(s,e,t){const{core:i,pixi:n}=await Bw(),r=new i.TextureAtlas(e);return Rp(r,t,n.SpineTexture),{skeletonData:new i.SkeletonJson(new i.AtlasAttachmentLoader(r)).readSkeletonData(s),SpineClass:n.Spine}}async function vk(s,e,t){const{core:i,pixi:n}=await Bw(),r=new i.TextureAtlas(e);return Rp(r,t,n.SpineTexture),{skeletonData:new i.SkeletonBinary(new i.AtlasAttachmentLoader(r)).readSkeletonData(s),SpineClass:n.Spine}}function gr(s,e,t){const i=Number(s[e]);return Number.isFinite(i)?i:t}function qi(s,e,t,i){s[e]==null&&(s[e]=gr(s,t,i))}function Pp(s,e,t){if(typeof s.curve!="number")return;const i=gr(s,"time",0),r=gr(e,"time",0)-i,o=s.curve,a=gr(s,"c2",0),l=gr(s,"c3",1),c=gr(s,"c4",1);s.curve=t.flatMap(([h,u])=>[i+r*o,h+(u-h)*a,i+r*l,h+(u-h)*c]),delete s.c2,delete s.c3,delete s.c4}function Sr(s,e){if(Array.isArray(s))for(let t=0;t[gr(i,r,o),gr(n,r,o)]))}}function yk(s){if(Array.isArray(s))for(let e=0;eNumber.parseInt(i.slice(r,r+2),16)/255);return e?n:n.slice(0,3)}function ty(s,e){if(Array.isArray(s))for(let t=0;t[a,o[l]]))}}function xk(s){for(const e of s.bones||[])e.inherit==null&&e.transform!=null&&(e.inherit=e.transform);for(const e of s.transform||[])qi(e,"mixRotate","rotateMix",1),qi(e,"mixX","translateMix",1),e.mixY==null&&(e.mixY=e.mixX),qi(e,"mixScaleX","scaleMix",1),e.mixScaleY==null&&(e.mixScaleY=e.mixScaleX),qi(e,"mixShearY","shearMix",1);for(const e of s.path||[])qi(e,"mixRotate","rotateMix",1),qi(e,"mixX","translateMix",1),e.mixY==null&&(e.mixY=e.mixX)}function bk(s){for(const e of s.skins||[])for(const t of Object.values(e.attachments||{}))for(const i of Object.values(t||{}))i.parent!=null&&i.timelines==null&&i.deform!=null&&(i.timelines=i.deform)}function wk(s){for(const e of Object.values(s.slots||{}))e.color&&!e.rgba&&(e.rgba=e.color,delete e.color),e.twoColor&&!e.rgba2&&(e.rgba2=e.twoColor,delete e.twoColor),ty(e.rgba,!1),ty(e.rgba2,!0)}function Sk(s){for(const e of Object.values(s.bones||{})){for(const t of e.rotate||[])qi(t,"value","angle",0);Sr(e.rotate,[{key:"value",fallback:0}]),Sr(e.translate,[{key:"x",fallback:0},{key:"y",fallback:0}]),Sr(e.scale,[{key:"x",fallback:1},{key:"y",fallback:1}]),Sr(e.shear,[{key:"x",fallback:0},{key:"y",fallback:0}])}}function Mk(s){for(const e of Object.values(s.ik||{}))Sr(e,[{key:"mix",fallback:1},{key:"softness",fallback:0}])}function Tk(s){for(const e of Object.values(s.transform||{})){for(const t of e)qi(t,"mixRotate","rotateMix",1),qi(t,"mixX","translateMix",1),t.mixY==null&&(t.mixY=t.mixX),qi(t,"mixScaleX","scaleMix",1),t.mixScaleY==null&&(t.mixScaleY=t.mixScaleX),qi(t,"mixShearY","shearMix",1);Sr(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 _k(s){for(const e of Object.values(s.path||{})){for(const i of["position","spacing"]){const n=e[i];for(const r of n||[])qi(r,"value",i,0);Sr(n,[{key:"value",fallback:0}])}const t=e.mix;for(const i of t||[])qi(i,"mixRotate","rotateMix",1),qi(i,"mixX","translateMix",1),i.mixY==null&&(i.mixY=i.mixX);Sr(t,[{key:"mixRotate",fallback:1},{key:"mixX",fallback:1},{key:"mixY",fallback:1}])}}function Ck(s){if(!s.deform)return;const e=s.attachments||(s.attachments={});for(const[t,i]of Object.entries(s.deform)){const n=e[t]||(e[t]={});for(const[r,o]of Object.entries(i)){const a=n[r]||(n[r]={});for(const[l,c]of Object.entries(o)){const h=a[l]||(a[l]={});h.deform=c,yk(c)}}}delete s.deform}function Nw(s){xk(s),bk(s);for(const e of Object.values(s.animations||{}))wk(e),Sk(e),Mk(e),Tk(e),_k(e),Ck(e),!e.drawOrder&&e.draworder&&(e.drawOrder=e.draworder);return s}function Ek(s){return s.replace(/\\/g,"/").split("/").pop()||s}async function Ak(s){const e=await Promise.all(s.map(async t=>{const i=URL.createObjectURL(t);try{return[Ek(t.name).toLowerCase(),await Ke.fromURL(i)]}finally{URL.revokeObjectURL(i)}}));return new Map(e)}function Ik(s){const e=new Map;return s.bones.map(t=>{var r;const i=((r=t.parent)==null?void 0:r.name)||null,n=i?(e.get(i)||0)+1:0;return e.set(t.name,n),{name:t.name,parent:i,depth:n}})}function Rk(s){return s.slots.map(e=>{var t;return{name:e.name,order:Number(e.index)||0,bone:((t=e.boneData)==null?void 0:t.name)||"",attachment:e.attachmentName||""}})}async function Dw(s,e,t){var o;if(!/\.(json|skel)$/i.test(s.name))throw new Error("Spine 数据仅支持 .json 或 .skel");if(!/\.atlas$/i.test(e.name))throw new Error("图集文件仅支持 .atlas");if(!t.length)throw new Error("请至少选择一张纹理图片");const i=await e.text(),n=await Ak(t),r=[...n.values()];try{let a,l,c=null,h;if(/\.skel$/i.test(s.name)){const u=await s.arrayBuffer();try{({skeletonData:a,SpineClass:l}=await vk(u,i,n)),h="4.3"}catch(d){try{({skeletonData:a,SpineClass:l}=fk(u,i,n)),h="4.2"}catch(f){const m=d instanceof Error?d.message:String(d),p=f instanceof Error?f.message:String(f);throw new Error(`Spine 二进制解析失败(4.3:${m};旧版:${p})`)}}c=yh(a.version)}else{let u;try{u=JSON.parse(await s.text())}catch{throw new Error("Spine JSON 文件格式无效")}if(c=yh((o=u==null?void 0:u.skeleton)==null?void 0:o.spine),!c)throw new Error(`Spine JSON 版本不受支持,仅支持 ${xm()}`);h=RR(c),c==="3.8"&&Nw(u);const d=h==="4.3"?await gk(u,i,n):dk(u,i,n);a=d.skeletonData,l=d.SpineClass}if(!c)throw new Error(`Spine 数据版本不受支持,仅支持 ${xm()}`);return{skeletonData:a,textures:r,runtimeVersion:h,SpineClass:l,dataVersion:c,animations:a.animations.map(u=>({name:u.name,duration:u.duration})),bones:Ik(a),slots:Rk(a)}}catch(a){for(const l of r)l.destroy(!0);throw a}}function $c(s){return new Promise((e,t)=>{const i=new FileReader;i.onload=()=>e(String(i.result||"")),i.onerror=()=>t(i.error),i.readAsDataURL(s)})}async function Pk(s,e,t){return{skeleton:{name:s.name,dataUrl:await $c(s)},atlas:{name:e.name,dataUrl:await $c(e)},textures:await Promise.all(t.map(async i=>({name:i.name,dataUrl:await $c(i)})))}}async function gf(s){const e=await fetch(s.dataUrl);if(!e.ok)throw new Error(`无法读取内嵌 Spine 文件:${s.name}`);return new File([await e.blob()],s.name)}async function kk(s){return{skeleton:await gf(s.skeleton),atlas:await gf(s.atlas),textures:await Promise.all(s.textures.map(gf))}}const Uw="SpineParticle.EditorConfig",$w=1;function Xw(s){return{backgroundX:s.backgroundX,backgroundY:s.backgroundY,backgroundOpacity:s.backgroundOpacity,backgroundImageName:s.backgroundImageName,backgroundImageData:s.backgroundImageData,showGrid:s.showGrid,exportSettings:Vt(s.exportSettings)}}function Fk(s){return JSON.parse(JSON.stringify(s,(e,t)=>{if(!(e==="texture"||e==="trailTexture"||e==="frames"))return t}))}function Vw(s){const e=Vt(s);return delete e.tags,delete e.selectedTag,e}function Ok(s){const e=Xw(s.settings),t=s.timeline.playbackEnd>=Math.max(1,s.timeline.totalFrames-1);return Fk({format:Uw,version:$w,savedAt:new Date().toISOString(),editor:Vt(s.editor),settings:e,timeline:{fps:s.timeline.fps,loop:s.timeline.loop,playbackStart:s.timeline.playbackStart,playbackEnd:s.timeline.playbackEnd,playbackEndAuto:t,abLoop:s.timeline.abLoop,animations:[...s.timeline.animations]},selection:{type:s.activeObjectType,id:s.activeObjectId},scene:{systems:s.systems.map(i=>({...Vt(i),frames:void 0})),colliders:s.colliders.map(Vw),paths:Vt(s.paths),spines:Vt(s.spines)}})}function Lk(s,e,t,i){const n=Math.max(1,i);let r=0;for(const o of s){const a=o.config,l=Math.max(0,Number(a.lifeMin)||0),c=Math.max(0,Number(a.lifeMax)||0),h=a.lifeMode==="fixed"?l:Math.max(l,c),u=a.mode==="stream"?a.streamBehavior==="loop"?Ps(a,n).total/n:Math.max(1/n,Number(a.duration)||0):0;let d=Math.max(0,Number(a.delay)||0)+u+h;a.mode==="stream"&&a.streamBehavior==="loop"&&(d=Math.max(0,Number(a.delay)||0)+Ps(a,n).total/n),r=Math.max(r,d)}for(const o of t){const a=o.animations.find(l=>l.name===o.selectedAnimation);a&&(r=Math.max(r,Math.max(0,Number(o.timeOffset)||0)+Math.max(0,a.duration||0)))}for(const o of e)o.followPath&&o.followPathId&&(r=Math.max(r,Math.max(0,o.followDuration)||0));return F1(r,n)}function Bk(){return`SpineParticle-${new Date().toISOString().replace(/[-:]/g,"").replace(/\.\d{3}Z$/,"").replace("T","-")}.json`}function Yw(s){const e=Ok(s),t=new Blob([JSON.stringify(e,null,2)],{type:"application/json;charset=utf-8"}),i=URL.createObjectURL(t),n=document.createElement("a");return n.href=i,n.download=Bk(),document.body.appendChild(n),n.click(),n.remove(),setTimeout(()=>URL.revokeObjectURL(i),0),e}function Gw(s){let e;try{e=JSON.parse(s)}catch{throw new Error("配置文件不是有效的 JSON")}const t=e;if(t.format!==Uw)throw new Error("不是 SpineParticle 编辑器配置文件");if(t.version!==$w)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 Nk(s){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=Ke.fromURL(r).then(a=>vr(a)),e.set(r,o)),o},i=await t("/images/star.png");await Promise.all(s.map(async n=>{var o;const r=Xn(n.config);r.texture=i,await Promise.all(r.imageResources.map(async a=>{a.texture=await t(a.previewUrl||"/images/star.png"),await Promise.all(a.sequenceFrames.map(async l=>{l.texture=await t(l.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 Dk(s){const e=new Map;try{for(const t of s){if(!t.sourceBundle)continue;const i=await kk(t.sourceBundle);e.set(t.id,await Dw(i.skeleton,i.atlas,i.textures))}return e}catch(t){for(const i of e.values())for(const n of i.textures)n.destroy(!0);throw t}}function Uk(s,e){const t=(e==null?void 0:e.type)||"particle",i=Number(e==null?void 0:e.id)||0;(t==="particle"?s.systems.some(r=>r.id===i):t==="collision"?s.colliders.some(r=>r.id===i):t==="path"?s.paths.some(r=>r.id===i):s.spines.some(r=>r.id===i))?s.selectSceneObject(t,i):s.systems[0]?s.selectSceneObject("particle",s.systems[0].id):s.colliders[0]?s.selectSceneObject("collision",s.colliders[0].id):s.paths[0]?s.selectSceneObject("path",s.paths[0].id):s.spines[0]?s.selectSceneObject("spine",s.spines[0].id):(s.activeObjectType="particle",s.activeObjectId=0,s.activeId=0)}async function $k(s,e){var d,f,m,p,g,x,v,y,w;const t=Gw(JSON.stringify(e)),i=Vt(t.scene.systems),n=t.scene.colliders.map(Vw),r=Vt(t.scene.paths),o=Vt(t.scene.spines);for(const _ of o)_.sourceBundle==null&&(_.sourceBundle=null),_.dataVersion==null&&(_.dataVersion=""),Array.isArray(_.slots)||(_.slots=[]),typeof _.selectedBone!="string"&&(_.selectedBone=""),typeof _.selectedSlot!="string"&&(_.selectedSlot="");await Nk(i);const a=await Dk(o),l=new Map(s.spines.map(_=>[_.id,_.assetVersion]));for(const _ of s.spines)Fl(_.id);s.systems=i,s.colliders=n,s.paths=r,s.spines=o,Object.assign(s.editor,Vt(t.editor||{}));const c=t.settings;if(c)for(const _ of["backgroundX","backgroundY","backgroundOpacity","backgroundImageName","backgroundImageData","showGrid"])Object.prototype.hasOwnProperty.call(c,_)&&(s.settings[_]=c[_]);s.settings.exportSettings=I1((d=t.settings)==null?void 0:d.exportSettings),s.settings.undoLimit=Math.min(200,Math.max(1,Math.round(Number(s.settings.undoLimit)||20))),s.timeline.fps=Math.max(1,Math.round(Number((f=t.timeline)==null?void 0:f.fps)||30));const h=Math.max(1,Math.floor(Number((m=t.timeline)==null?void 0:m.playbackEnd)||Number.MAX_SAFE_INTEGER)),u=((p=t.timeline)==null?void 0:p.playbackEndAuto)??h>=Lk(i,n,o,s.timeline.fps);s.timeline.abLoop=((g=t.timeline)==null?void 0:g.abLoop)===!0,s.timeline.loop=((x=t.timeline)==null?void 0:x.loop)!==!1,s.timeline.animations=Array.isArray((v=t.timeline)==null?void 0:v.animations)&&t.timeline.animations.length?[...new Set(t.timeline.animations.filter(_=>typeof _=="string"&&_.trim()).map(_=>_.trim()))]:["animation"];for(const _ of s.spines){const S=a.get(_.id);if(_.assetVersion=Math.max(Number(_.assetVersion)||0,l.get(_.id)||0)+1,!S){_.status="empty",_.error=_.skeletonFileName?"配置未包含可复用的 Spine 原始资源":"",_.animations=[],_.bones=[],_.slots=[],_.selectedAnimation="";continue}pu(_.id,S),_.dataVersion=S.dataVersion,_.animations=S.animations,_.bones=S.bones,_.slots=S.slots,S.animations.some(b=>b.name===_.selectedAnimation)||(_.selectedAnimation=((y=S.animations[0])==null?void 0:y.name)||""),_.status="ready",_.error=""}s.syncSceneSequences(),Uk(s,t.selection),s.timeline.playbackStart=Math.max(0,Math.floor(Number((w=t.timeline)==null?void 0:w.playbackStart)||0)),s.timeline.playbackEnd=h,s.timeline.frame=0,s.timeline.recorded=!1,s.timeline.playing=!0;for(const _ of s.systems)s.timeline.animations.includes(_.animation)||(_.animation=s.timeline.animations[0]);return s.recalcTotalFrames(),u&&(s.timeline.playbackEnd=s.timeline.totalFrames-1),s.timeline.frame=s.timeline.playbackStart,t}async function jw(s,e){return $k(s,Gw(e))}async function Xk(s,e){if(!/\.json$/i.test(e.name))throw new Error("请选择 .json 配置文件");return jw(s,await e.text())}const yu=po({undoCount:0});let Ch=null,On=null,Tr=[],Na=null,Ln=null,Eh=!1;function kp(s){return{systems:s.systems.map(t=>{const i=Vt(t);return i.frames=void 0,i}),colliders:Vt(s.colliders),paths:Vt(s.paths),spines:Vt(s.spines),animations:[...s.timeline.animations],settings:Xw(s.settings)}}function Fp(s){return JSON.stringify(s,(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 Hw(s,e=kp(s),t=Fp(e)){const i=new Map;for(const n of e.spines){const r=AR(n.id);r&&i.set(n.id,r)}return{data:e,signature:t,spineAssets:i}}function Ah(s){if(s){for(const e of s.spineAssets.values())CR(e);s.spineAssets.clear()}}function Ww(s){for(;Tr.length>s;)Ah(Tr.shift()||null);yu.undoCount=Tr.length}function zw(){const s=Ch;if(!s||!On||Eh)return;const e=kp(s),t=Fp(e);t!==On.signature&&(Tr.push(On),On=Hw(s,e,t),Ww(s.settings.undoLimit))}function Vk(){Eh||(Ln&&clearTimeout(Ln),Ln=setTimeout(()=>{Ln=null,zw()},250))}function Yk(s){const e=s.activeObjectId;return s.activeObjectType==="particle"?s.systems.some(t=>t.id===e):s.activeObjectType==="collision"?s.colliders.some(t=>t.id===e):s.activeObjectType==="path"?s.paths.some(t=>t.id===e):s.spines.some(t=>t.id===e)}function Gk(s){var t,i;if(!Yk(s)){const n=s.systems[0],r=s.colliders[0],o=s.paths[0],a=s.spines[0];n?(s.activeObjectType="particle",s.activeObjectId=n.id):r?(s.activeObjectType="collision",s.activeObjectId=r.id):o?(s.activeObjectType="path",s.activeObjectId=o.id):(s.activeObjectType="spine",s.activeObjectId=(a==null?void 0:a.id)||0)}const e=s.activeObjectType==="particle"?s.systems.find(n=>n.id===s.activeObjectId):s.systems.find(n=>n.id===s.activeId);s.activeId=(e==null?void 0:e.id)||((t=s.systems[0])==null?void 0:t.id)||0,s.timeline.animation=(e==null?void 0:e.animation)||((i=s.systems[0])==null?void 0:i.animation)||s.timeline.animations[0]||"animation"}function jk(s,e){const t=On;Eh=!0;try{for(const i of s.spines)Fl(i.id);s.systems=Vt(e.data.systems),s.colliders=Vt(e.data.colliders),s.paths=Vt(e.data.paths),s.spines=Vt(e.data.spines),s.timeline.animations=[...e.data.animations],Object.assign(s.settings,Vt(e.data.settings));for(const[i,n]of e.spineAssets)pu(i,n);for(const i of s.systems)i.frames=[];s.timeline.recorded=!1,s.timeline.playing=!1,Gk(s),s.recalcTotalFrames(),On=e}finally{Eh=!1,Ah(t)}}function Hk(s){if(!(Ch===s&&Na)){Na==null||Na(),Ln&&clearTimeout(Ln),Ah(On);for(const e of Tr)Ah(e);Tr=[],Ch=s,On=Hw(s),yu.undoCount=0,Na=ai(()=>Fp(kp(s)),Vk,{flush:"post"})}}function Wk(s,e){const t=Math.min(200,Math.max(1,Math.round(Number(e)||20)));s.settings.undoLimit=t,Ww(t)}function qw(){const s=Ch;if(!s||!On)return!1;Ln&&(clearTimeout(Ln),Ln=null),zw();const e=Tr.pop();return e?(jk(s,e),yu.undoCount=Tr.length,!0):!1}function zk(s){const e=s instanceof HTMLElement?s:null;return!!(e!=null&&e.closest('input, textarea, select, [contenteditable="true"]'))}function qk(s){function e(i){var r;const n=i.target instanceof Node?i.target:null;s.canvasFocused.value=!!n&&!!((r=s.canvasElement.value)!=null&&r.contains(n))}function t(i){const n=i.key.toLowerCase();if((i.ctrlKey||i.metaKey)&&!i.altKey&&n==="s"){i.preventDefault(),i.stopPropagation(),s.save();return}if((i.ctrlKey||i.metaKey)&&!i.altKey&&n==="z"){i.preventDefault(),i.stopPropagation(),s.undo();return}if(i.ctrlKey||i.metaKey||i.altKey||zk(i.target))return;if(n==="d"){i.preventDefault(),s.togglePlay();return}if(n==="s"){i.preventDefault(),s.toStart();return}if(!s.canvasFocused.value)return;const r={q:"",w:"translate",e:"rotate",r:"scale"};n in r&&(i.preventDefault(),s.setTool(r[n]))}ys(()=>{document.addEventListener("pointerdown",e,!0),window.addEventListener("keydown",t,!0)}),Al(()=>{document.removeEventListener("pointerdown",e,!0),window.removeEventListener("keydown",t,!0)})}const Kk={class:"help-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"help-title"},Zk={class:"help-body"},Jk=["aria-expanded"],Qk={class:"caret"},eF={class:"help-module-body"},tF=["aria-expanded"],iF={class:"caret"},sF={class:"help-module-body"},nF=["aria-expanded"],rF={class:"caret"},oF={class:"help-module-body"},aF=["aria-expanded"],lF={class:"caret"},cF={class:"help-module-body"},hF=["aria-expanded"],uF={class:"caret"},dF={class:"help-module-body"},fF=["aria-expanded"],mF={class:"caret"},pF={class:"help-module-body"},gF=["aria-expanded"],vF={class:"caret"},yF={class:"help-module-body"},xF=["aria-expanded"],bF={class:"caret"},wF={class:"help-module-body"},SF=["aria-expanded"],MF={class:"caret"},TF={class:"help-module-body"},_F=Zt({__name:"HelpDialog",props:{show:{type:Boolean}},emits:["close"],setup(s,{emit:e}){const t=e,i=Fe(Array.from({length:9},()=>!1));function n(){t("close")}function r(o){o.key==="Escape"&&n()}return ys(()=>window.addEventListener("keydown",r)),Rr(()=>window.removeEventListener("keydown",r)),(o,a)=>s.show?(K(),J("div",{key:0,class:"help-overlay",role:"presentation",onClick:qe(n,["self"])},[T("section",Kk,[T("header",{class:"help-head"},[a[9]||(a[9]=T("div",null,[T("h2",{id:"help-title"},"使用说明"),T("p",null,"从创建粒子到保存、导出的快速入门")],-1)),T("button",{class:"help-close","aria-label":"关闭使用说明",title:"关闭 (Esc)",onClick:n},"✕")]),T("div",Zk,[a[37]||(a[37]=is('

快速开始

  1. 创建对象:在左侧“场景对象”中用 +粒子 / +碰撞 / +路径 / +Spine 添加场景对象。
  2. 编辑粒子:选中某个粒子系统,依次调整“发射模式 → 发射器形状 → 粒子属性 → 外观与资源 → 修改器”。
  3. 查看效果:底部时间轴可播放、暂停、逐帧或拖动;修改任意参数后会自动重新计算。
  4. 保存与导出:用“保存配置”保留工程;“导出 Spine Json / images 包 / .spine 包”输出成品。

每个模块组标题右侧的“重置”可把该组参数恢复默认;系统设置会自动保存在当前浏览器。

常用操作

小眼睛
单独显示/隐藏对象;隐藏的粒子系统不会被导出。
+Copy
完整复制当前选中对象,方便对比不同参数。
背景图
上传参考图并调整位置和透明度,只用于画布预览。
系统设置
管理界面布局、辅助显示、刻度等,自动存入浏览器。
撤销/重做
Ctrl+Z 撤回一步;可达成的步数在系统设置中调整。
Spine 骨骼
在层级树搜索并选择骨骼,可用于粒子发射器跟随。

快捷键

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

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

功能模块详解
',3)),T("section",{class:Ce(["help-section help-module",{open:i.value[0]}])},[T("button",{type:"button",class:"help-module-head","aria-expanded":i.value[0]?"true":"false",onClick:a[0]||(a[0]=l=>i.value[0]=!i.value[0])},[a[10]||(a[10]=T("span",{class:"mnum"},"1",-1)),a[11]||(a[11]=T("span",{class:"mtitle"},"配置管理",-1)),T("span",Qk,ve(i.value[0]?"▾":"▸"),1)],8,Jk),ce(T("div",eF,[...a[12]||(a[12]=[is('
保存配置
把当前全部场景对象和参数保存为工程 JSON 文件(也支持 Ctrl+S)。
加载配置
选择本地配置文件,恢复完整工程。
预设
从下拉中选择已保存的预设快速套用;点击下拉即可刷新列表。
范围
配置只含对象与参数,不含“系统设置”;系统设置单独存于浏览器。
',1)])],512),[[Si,i.value[0]]])],2),T("section",{class:Ce(["help-section help-module",{open:i.value[1]}])},[T("button",{type:"button",class:"help-module-head","aria-expanded":i.value[1]?"true":"false",onClick:a[1]||(a[1]=l=>i.value[1]=!i.value[1])},[a[13]||(a[13]=T("span",{class:"mnum"},"2",-1)),a[14]||(a[14]=T("span",{class:"mtitle"},"场景对象",-1)),T("span",iF,ve(i.value[1]?"▾":"▸"),1)],8,tF),ce(T("div",sF,[...a[15]||(a[15]=[is('
粒子
核心对象。可设名称、位置 X/Y、偏移、旋转、缩放 X/Y,以及“随机种子”——相同种子可精确复现同一次效果。
碰撞
圆形/椭圆/矩形/多边形/自定义;启用开关、碰撞响应(物理弹跳/暂停/销毁)、弹性与摩擦,还可沿某条路径移动并带进度曲线。
路径
贝塞尔路径,可双击新建/删除锚点、拖手柄调曲线;内置圆/方/多边形/星形预设,支持闭合与颜色。
Spine
加载 .json+.atlas+.png 预览骨骼动画,可查看/搜索骨骼层级树,用于粒子“发射器跟随”。
通用
每个对象都有小眼睛显隐;“+Copy”可以复制当前对象;隐藏的粒子系统不会进入导出。
',1)])],512),[[Si,i.value[1]]])],2),T("section",{class:Ce(["help-section help-module",{open:i.value[2]}])},[T("button",{type:"button",class:"help-module-head","aria-expanded":i.value[2]?"true":"false",onClick:a[2]||(a[2]=l=>i.value[2]=!i.value[2])},[a[16]||(a[16]=T("span",{class:"mnum"},"3",-1)),a[17]||(a[17]=T("span",{class:"mtitle"},"发射模式",-1)),T("span",rF,ve(i.value[2]?"▾":"▸"),1)],8,nF),ce(T("div",oF,[...a[18]||(a[18]=[is('
持续
按“每秒发射数量”持续喷射;再分“常规持续”(发射时长)与“循环持续”(三段式:开始循环 / 纯循环 / 结束循环,可自动或自定义帧长,做到无缝衔接)。
爆发
一次性发射“单次数量”颗粒子。
延迟时间
粒子条左端位置,表示发射开始前的等待时间。
注意
循环持续模式不支持骨骼跟随和路径跟随;开关时会把跟随设置恢复默认。
',1)])],512),[[Si,i.value[2]]])],2),T("section",{class:Ce(["help-section help-module",{open:i.value[3]}])},[T("button",{type:"button",class:"help-module-head","aria-expanded":i.value[3]?"true":"false",onClick:a[3]||(a[3]=l=>i.value[3]=!i.value[3])},[a[19]||(a[19]=T("span",{class:"mnum"},"4",-1)),a[20]||(a[20]=T("span",{class:"mtitle"},"发射器形状",-1)),T("span",lF,ve(i.value[3]?"▾":"▸"),1)],8,aF),ce(T("div",cF,[...a[21]||(a[21]=[is('
形状
点 / 圆形 / 矩形 / 锥形 / 路径。
圆·锥
内半径与外半径,形成环形或锥形发射区;锥形额外有“锥形朝向”和“开口角度”。
矩形
“外框 − 内框”形成环带,可分别设置内外宽高。
路径
选一条场景路径作为出生线;出生分布可选等距固定或随机。
发射角度
固定 / 随机(基准角度 + 随机范围)/ 径向(圆、矩、锥中心向外)/ 垂直于路径 / 沿路径方向。
',1)])],512),[[Si,i.value[3]]])],2),T("section",{class:Ce(["help-section help-module",{open:i.value[4]}])},[T("button",{type:"button",class:"help-module-head","aria-expanded":i.value[4]?"true":"false",onClick:a[4]||(a[4]=l=>i.value[4]=!i.value[4])},[a[22]||(a[22]=T("span",{class:"mnum"},"5",-1)),a[23]||(a[23]=T("span",{class:"mtitle"},"粒子属性",-1)),T("span",uF,ve(i.value[4]?"▾":"▸"),1)],8,hF),ce(T("div",dF,[...a[24]||(a[24]=[T("dl",{class:"help-list"},[T("div",null,[T("dt",null,"初始参数"),T("dd",null,"生命周期、速度、缩放(统一或 X/Y 分离)、初始旋转(可跟随发射方向)。每个属性支持固定 / 随机 / 曲线三种取值。")]),T("div",null,[T("dt",null,"生命周期变化"),T("dd",null,"速度倍率、缩放倍率(统一/分离)、旋转速度,均可用“生命周期 → 倍率”曲线控制。")]),T("div",null,[T("dt",null,"曲线含义"),T("dd",null,"横轴为粒子生命周期 0→1,纵轴为倍率或对应数值。")])],-1)])],512),[[Si,i.value[4]]])],2),T("section",{class:Ce(["help-section help-module",{open:i.value[5]}])},[T("button",{type:"button",class:"help-module-head","aria-expanded":i.value[5]?"true":"false",onClick:a[5]||(a[5]=l=>i.value[5]=!i.value[5])},[a[25]||(a[25]=T("span",{class:"mnum"},"6",-1)),a[26]||(a[26]=T("span",{class:"mtitle"},"外观与资源",-1)),T("span",mF,ve(i.value[5]?"▾":"▸"),1)],8,fF),ce(T("div",pF,[...a[27]||(a[27]=[T("dl",{class:"help-list"},[T("div",null,[T("dt",null,"透明度"),T("dd",null,"曲线或固定;曲线模式可选“跟随导出 / 线性 / 贝塞尔”。")]),T("div",null,[T("dt",null,"图片资源"),T("dd",null,"“+”新增,可上传单图或序列帧;多张图片按权重随机。每张可调缩放、轴心、颜色(固定/随机/生命周期渐变)、混合模式(正常/相加/相乘/滤色)、独立透明度(关/固定/曲线)。")]),T("div",null,[T("dt",null,"序列帧"),T("dd",null,"播放方式:单次隐藏 / 单次定格 / 正向循环 / 反向循环,可设每秒帧数。")])],-1)])],512),[[Si,i.value[5]]])],2),T("section",{class:Ce(["help-section help-module",{open:i.value[6]}])},[T("button",{type:"button",class:"help-module-head","aria-expanded":i.value[6]?"true":"false",onClick:a[6]||(a[6]=l=>i.value[6]=!i.value[6])},[a[28]||(a[28]=T("span",{class:"mnum"},"7",-1)),a[29]||(a[29]=T("span",{class:"mtitle"},"修改器",-1)),T("span",vF,ve(i.value[6]?"▾":"▸"),1)],8,gF),ce(T("div",yF,[...a[30]||(a[30]=[is('
移动噪声
强度、波动范围、时间流速,让粒子轨迹产生抖动。
重力 / 风力
固定或随机强度、方向,以及生命周期内强度曲线。
力场
中心 X/Y、强度(正吸负斥)、半径、衰减(恒定/线性/反比)。
吸附
延迟后把粒子吸到指定点,到达范围即死亡;可直线或曲线。
拖尾
独立拖尾图片(多资源按权重)、旋转、拖尾骨骼数、拖尾比例;长度/宽度可固定或随机并支持放大;可加生命周期长度曲线与形状曲线;颜色/透明度可跟随粒子、固定或曲线。
发射器跟随
跟随某条路径(局部/世界、正/反向、进度曲线),或跟随 Spine 骨骼(选中的骨骼 + 偏移)。
碰撞 + 阻尼
选择场景中已启用的碰撞对象参与,并设置速度阻尼。
',1)])],512),[[Si,i.value[6]]])],2),T("section",{class:Ce(["help-section help-module",{open:i.value[7]}])},[T("button",{type:"button",class:"help-module-head","aria-expanded":i.value[7]?"true":"false",onClick:a[7]||(a[7]=l=>i.value[7]=!i.value[7])},[a[31]||(a[31]=T("span",{class:"mnum"},"8",-1)),a[32]||(a[32]=T("span",{class:"mtitle"},"导出设置",-1)),T("span",bF,ve(i.value[7]?"▾":"▸"),1)],8,xF),ce(T("div",wF,[...a[33]||(a[33]=[is('
图片路径
写入 Spine 的 images 路径,例如 ./images/。
Spine 版本
3.8 / 4.0 / 4.1 / 4.2 / 4.3。
关键帧曲线
线性或平滑贝塞尔;出生、死亡、突变仍使用阶跃关键帧。
导出 FPS
修改 FPS 会保持动画实际秒数不变;“不写 fps”只省略元数据。
其它
整数帧对齐、骨骼对象池、排除无内容动画。
导出按钮
“导出 Spine Json”生成骨骼动画文件;“导出 images 包”单独下载图片 ZIP;“导出 .spine 包”需要连接器。
',1)])],512),[[Si,i.value[7]]])],2),T("section",{class:Ce(["help-section help-module help-connector",{open:i.value[8]}])},[T("button",{type:"button",class:"help-module-head","aria-expanded":i.value[8]?"true":"false",onClick:a[8]||(a[8]=l=>i.value[8]=!i.value[8])},[a[34]||(a[34]=T("span",{class:"mnum"},"9",-1)),a[35]||(a[35]=T("span",{class:"mtitle"},"连接器(Spine 连接器)使用说明",-1)),T("span",MF,ve(i.value[8]?"▾":"▸"),1)],8,SF),ce(T("div",TF,[...a[36]||(a[36]=[is('

连接器用于把网页生成的 JSON 和图片,调用你电脑上已安装并激活的 Spine,转换成可编辑的 .spine 工程。

前置
电脑已安装并激活 Spine;并已启动桌面版连接器APP。
网页端
导出区状态显示“连接器可用 · Spine 已就绪”后,点击“导出 .spine 包”。
首次授权
生产网站首次连接会显示“授权当前网站”;点击后在本机确认页核对完整来源(协议 + 域名 + 端口),再点“允许此网站”。授权一次后本机会保存白名单。本地 127.0.0.1:5173 默认允许。
路径设置
连接器自动检测 Spine 安装位置;检测不到时可在桌面窗口手动指定:Windows 选 Spine.com,macOS 选 Spine.app/Contents/MacOS/Spine。
下载结果
得到 ZIP 包,内含 .spine 工程和图片目录(如 images/star.png)。
版本
连接器按请求与 JSON 内的版本自动匹配 3.8~4.3,使用最新可用补丁。
安全
仅监听本机 127.0.0.1:27843;授权与白名单保存在连接器里;文件在临时目录转换后清理,并有大小限制。
',2)])],512),[[Si,i.value[8]]])],2),a[38]||(a[38]=T("section",{class:"help-section help-export"},[T("h3",null,"配置与导出有什么区别?"),T("p",null,[T("b",null,"保存配置"),ft("会保存编辑器中的全部对象和参数,之后可以继续修改;"),T("b",null,"导出 Spine Json"),ft("只导出显示中的粒子系统,并把跟随、碰撞和拖尾结果烘焙为独立动画数据。")])],-1))])])])):xe("",!0)}}),Jt=(s,e)=>{const t=s.__vccOpts||s;for(const[i,n]of e)t[i]=n;return t},CF=Jt(_F,[["__scopeId","data-v-78204b9d"]]);function ra(s){const e=()=>{window.removeEventListener("pointermove",s),window.removeEventListener("pointerup",e),window.removeEventListener("pointercancel",e)};window.addEventListener("pointermove",s),window.addEventListener("pointerup",e),window.addEventListener("pointercancel",e)}function ds(s,e,t){const i=s.holder.value,n=s.app(),r=i.getBoundingClientRect(),o=Math.max(1e-4,s.store.editor.viewScale),a=e-r.left,l=t-r.top;return{x:(a-n.screen.width/2-s.store.editor.viewX)/o,y:-(l-n.screen.height*.5-s.store.editor.viewY)/o}}function EF(s,e){const t=s.holder.value,i=s.app(),n=s.store,r=t.getBoundingClientRect(),o=e.clientX-r.left,a=e.clientY-r.top,l=e.deltaY<0?1.12:1/1.12,c=n.editor.viewScale,h=Math.max(.01,c*l),u=i.screen.width/2,d=i.screen.height*.5,f=n.editor.viewX,m=n.editor.viewY,p=(o-u-f)/c,g=(a-d-m)/c;n.editor.viewX=o-u-p*h,n.editor.viewY=a-d-g*h,n.editor.viewScale=h}function AF(s,e,t){const i=s.store,n=i.editor.viewX,r=i.editor.viewY;ra(o=>{i.editor.viewX=n+(o.clientX-e),i.editor.viewY=r+(o.clientY-t)})}function Kw(s,e){const t=Math.max(.01,s.store.editor.viewScale*e);s.store.editor.viewScale=t}function IF(s){Kw(s,1.2)}function RF(s){Kw(s,1/1.2)}function PF(s){s.store.editor.viewScale=1,s.store.editor.viewX=0,s.store.editor.viewY=0}function kF(s){s.store.editor.viewScale=1,s.store.editor.viewX=0,s.store.editor.viewY=0}function FF(s){s.store.settings.showGrid=!s.store.settings.showGrid}const OF={class:"topbar"},LF=["disabled"],BF={class:"tool-group"},NF={class:"tool-group"},DF={key:0,class:"background-panel"},UF=["disabled"],$F=["title"],XF={class:"background-position-row"},VF={class:"background-opacity-row"},YF={class:"zoom-pct"},GF=Zt({__name:"StageToolbar",props:{ctx:{},activeTool:{},showSettings:{type:Boolean},showHelp:{type:Boolean}},emits:["update:activeTool","update:showSettings","update:showHelp","clear-background","background-file"],setup(s,{emit:e}){const t=s,i=e,n=yo(),r=Fe(!1),o=Fe(null),a=Le(()=>n.settings.backgroundImageName);function l(p){i("update:activeTool",t.activeTool===p?"":p)}function c(){r.value=!r.value,r.value&&i("update:showSettings",!1)}function h(){const p=!t.showSettings;i("update:showSettings",p),p&&(r.value=!1)}function u(){i("update:showHelp",!0),r.value=!1,i("update:showSettings",!1)}function d(p){i("background-file",p)}function f(p=!0){o.value&&(o.value.value=""),i("clear-background",p)}function m(){qw()}return(p,g)=>(K(),J("div",OF,[T("button",{class:"settings-btn",onClick:h,title:"系统设置"},"系统设置"),T("button",{class:"undo-btn",disabled:I(yu).undoCount===0,onClick:m,title:"撤回上一步 (Ctrl+Z)"},"↶",8,LF),T("div",BF,[T("button",{class:Ce(["tool-btn",{on:s.activeTool===""}]),onClick:g[0]||(g[0]=x=>l("")),title:"拖动画布 (Q)"},"✋",2),T("button",{class:Ce(["tool-btn",{on:s.activeTool==="translate"}]),onClick:g[1]||(g[1]=x=>l("translate")),title:"位移 (W)"},"✥",2),T("button",{class:Ce(["tool-btn",{on:s.activeTool==="rotate"}]),onClick:g[2]||(g[2]=x=>l("rotate")),title:"旋转 (E)"},"⟳",2),T("button",{class:Ce(["tool-btn",{on:s.activeTool==="scale"}]),onClick:g[3]||(g[3]=x=>l("scale")),title:"缩放 (R)"},"⤢",2)]),T("div",NF,[T("button",{class:"tool-btn",onClick:g[4]||(g[4]=x=>I(IF)(s.ctx)),title:"放大"},"+"),T("button",{class:"tool-btn",onClick:g[5]||(g[5]=x=>I(RF)(s.ctx)),title:"缩小"},"-"),T("button",{class:"tool-btn",onClick:g[6]||(g[6]=x=>I(PF)(s.ctx)),title:"适配画布"},"⤢"),T("button",{class:Ce(["tool-btn",{on:I(n).settings.showGrid}]),onClick:g[7]||(g[7]=x=>I(FF)(s.ctx)),title:"切换网格"},"▦",2),T("button",{class:"tool-btn",onClick:g[8]||(g[8]=x=>I(kF)(s.ctx)),title:"重置视图"},"⟳")]),T("div",{class:"background-menu",onClick:g[14]||(g[14]=qe(()=>{},["stop"]))},[T("button",{class:Ce(["background-btn",{on:r.value}]),title:"背景图显示设置",onClick:c},"背景图",2),r.value?(K(),J("div",DF,[T("button",{class:"background-upload",onClick:g[9]||(g[9]=x=>{var v;return(v=o.value)==null?void 0:v.click()})},ve(a.value?"更换图像":"上传图像"),1),T("button",{class:"background-clear",disabled:!a.value,onClick:g[10]||(g[10]=x=>f())},"清除背景",8,UF),T("input",{ref_key:"backgroundFileInput",ref:o,class:"background-file-input",type:"file",accept:"image/png,image/jpeg,image/webp",onChange:d},null,544),T("div",{class:"background-file-name",title:a.value},ve(a.value||"未上传图像"),9,$F),T("div",XF,[T("label",null,[g[15]||(g[15]=T("span",null,"X",-1)),ce(T("input",{"onUpdate:modelValue":g[11]||(g[11]=x=>I(n).settings.backgroundX=x),type:"number",step:"1","aria-label":"背景图 X 偏移"},null,512),[[He,I(n).settings.backgroundX,void 0,{number:!0}]])]),T("label",null,[g[16]||(g[16]=T("span",null,"Y",-1)),ce(T("input",{"onUpdate:modelValue":g[12]||(g[12]=x=>I(n).settings.backgroundY=x),type:"number",step:"1","aria-label":"背景图 Y 偏移"},null,512),[[He,I(n).settings.backgroundY,void 0,{number:!0}]])])]),T("label",VF,[g[17]||(g[17]=T("span",null,"透明度",-1)),ce(T("input",{"onUpdate:modelValue":g[13]||(g[13]=x=>I(n).settings.backgroundOpacity=x),type:"range",min:"0",max:"1",step:"0.01","aria-label":"背景图透明度"},null,512),[[He,I(n).settings.backgroundOpacity,void 0,{number:!0}]]),T("b",null,ve(Math.round(I(n).settings.backgroundOpacity*100))+"%",1)])])):xe("",!0)]),T("button",{class:Ce(["help-btn",{on:s.showHelp}]),title:"查看使用说明",onClick:u},"使用说明",2),T("span",YF,ve(Math.round(I(n).editor.viewScale*100))+"%",1)]))}}),jF=Jt(GF,[["__scopeId","data-v-4749834a"]]),HF={key:0,class:"settings-panel"},WF={class:"sp-head"},zF={class:"sp-switch-row"},qF={class:"sp-switch-control"},KF={class:"sp-row"},ZF={class:"sp-chk"},JF={class:"sp-chk"},QF={class:"sp-row"},e3={class:"sp-row"},t3={class:"sp-chk"},i3={class:"sp-chk"},s3={class:"sp-row"},n3={class:"sp-row"},r3={class:"sp-row"},o3={class:"sp-hex"},a3={class:"sp-chk"},l3=Zt({__name:"StageSettingsPanel",props:{show:{type:Boolean}},emits:["close"],setup(s,{emit:e}){const t=e,i=yo();function n(o){Wk(i,Number(o.target.value))}function r(){i.settings.bonePointDrawSize=Math.min(10,Math.max(.1,Number(i.settings.bonePointDrawSize)||1)),i.settings.boneAxisDrawSize=Math.min(10,Math.max(.1,Number(i.settings.boneAxisDrawSize)||2))}return(o,a)=>s.show?(K(),J("div",HF,[T("div",WF,[a[15]||(a[15]=ft("系统设置 ",-1)),T("button",{class:"sp-close",onClick:a[0]||(a[0]=l=>t("close"))},"✕")]),a[29]||(a[29]=T("div",{class:"sp-section-title"},"界面布局",-1)),T("label",zF,[a[17]||(a[17]=T("span",null,"参数面板位置",-1)),T("span",qF,[ce(T("input",{type:"checkbox","onUpdate:modelValue":a[1]||(a[1]=l=>I(i).settings.parameterPanelOnRight=l),"aria-label":"参数面板显示在右侧"},null,512),[[wt,I(i).settings.parameterPanelOnRight]]),a[16]||(a[16]=T("span",{class:"sp-switch-ui","aria-hidden":"true"},null,-1)),T("b",null,ve(I(i).settings.parameterPanelOnRight?"右侧":"左侧"),1)])]),a[30]||(a[30]=T("div",{class:"sp-divider"},null,-1)),a[31]||(a[31]=T("div",{class:"sp-section-title"},"操作历史",-1)),T("label",KF,[a[18]||(a[18]=T("span",null,"最大撤回步数",-1)),ce(T("input",{class:"sp-num sp-undo-limit",type:"number",min:"1",max:"200","onUpdate:modelValue":a[2]||(a[2]=l=>I(i).settings.undoLimit=l),"aria-label":"最大撤回步数",onChange:n},null,544),[[He,I(i).settings.undoLimit,void 0,{number:!0}]])]),a[32]||(a[32]=T("div",{class:"sp-divider"},null,-1)),a[33]||(a[33]=T("div",{class:"sp-section-title"},"画布辅助显示",-1)),T("label",ZF,[ce(T("input",{type:"checkbox","onUpdate:modelValue":a[3]||(a[3]=l=>I(i).settings.showEmitter=l)},null,512),[[wt,I(i).settings.showEmitter]]),a[19]||(a[19]=ft("发射点",-1))]),T("label",JF,[ce(T("input",{type:"checkbox","onUpdate:modelValue":a[4]||(a[4]=l=>I(i).settings.showBones=l)},null,512),[[wt,I(i).settings.showBones]]),a[20]||(a[20]=ft("骨骼连线",-1))]),I(i).settings.showBones?(K(),J(_e,{key:0},[T("label",QF,[a[21]||(a[21]=T("span",null,"骨骼点绘制大小",-1)),ce(T("input",{class:"sp-num",type:"number",min:"0.1",max:"10",step:"0.1","onUpdate:modelValue":a[5]||(a[5]=l=>I(i).settings.bonePointDrawSize=l),"aria-label":"骨骼点绘制大小",onChange:r},null,544),[[He,I(i).settings.bonePointDrawSize,void 0,{number:!0}]])]),T("label",e3,[a[22]||(a[22]=T("span",null,"坐标轴绘制大小",-1)),ce(T("input",{class:"sp-num",type:"number",min:"0.1",max:"10",step:"0.1","onUpdate:modelValue":a[6]||(a[6]=l=>I(i).settings.boneAxisDrawSize=l),"aria-label":"坐标轴绘制大小",onChange:r},null,544),[[He,I(i).settings.boneAxisDrawSize,void 0,{number:!0}]])])],64)):xe("",!0),T("label",t3,[ce(T("input",{type:"checkbox","onUpdate:modelValue":a[7]||(a[7]=l=>I(i).settings.showSkinMesh=l)},null,512),[[wt,I(i).settings.showSkinMesh]]),a[23]||(a[23]=ft("蒙皮网格",-1))]),a[34]||(a[34]=T("div",{class:"sp-divider"},null,-1)),T("label",i3,[ce(T("input",{type:"checkbox","onUpdate:modelValue":a[8]||(a[8]=l=>I(i).settings.tickEnabled=l)},null,512),[[wt,I(i).settings.tickEnabled]]),a[24]||(a[24]=ft("启用刻度",-1))]),I(i).settings.tickEnabled?(K(),J(_e,{key:1},[T("label",s3,[a[25]||(a[25]=T("span",null,"刻度文字大小",-1)),ce(T("input",{type:"range",min:"8",max:"40",step:"1","onUpdate:modelValue":a[9]||(a[9]=l=>I(i).settings.axisFontSize=l)},null,512),[[He,I(i).settings.axisFontSize,void 0,{number:!0}]]),ce(T("input",{type:"number",min:"8",max:"40","onUpdate:modelValue":a[10]||(a[10]=l=>I(i).settings.axisFontSize=l),class:"sp-num"},null,512),[[He,I(i).settings.axisFontSize,void 0,{number:!0}]])]),T("label",n3,[a[26]||(a[26]=T("span",null,"刻度线粗细",-1)),ce(T("input",{type:"range",min:"1",max:"5",step:"0.5","onUpdate:modelValue":a[11]||(a[11]=l=>I(i).settings.tickWidth=l)},null,512),[[He,I(i).settings.tickWidth,void 0,{number:!0}]]),ce(T("input",{type:"number",min:"1",max:"5","onUpdate:modelValue":a[12]||(a[12]=l=>I(i).settings.tickWidth=l),class:"sp-num"},null,512),[[He,I(i).settings.tickWidth,void 0,{number:!0}]])]),T("label",r3,[a[27]||(a[27]=T("span",null,"坐标轴颜色",-1)),ce(T("input",{type:"color","onUpdate:modelValue":a[13]||(a[13]=l=>I(i).settings.axisColor=l),class:"sp-colr"},null,512),[[He,I(i).settings.axisColor]]),T("span",o3,ve(I(i).settings.axisColor),1)]),T("label",a3,[ce(T("input",{type:"checkbox","onUpdate:modelValue":a[14]||(a[14]=l=>I(i).settings.showAxisLabels=l)},null,512),[[wt,I(i).settings.showAxisLabels]]),a[28]||(a[28]=ft("显示刻度数值",-1))])],64)):xe("",!0),a[35]||(a[35]=T("div",{class:"sp-cache-note"},"整个系统设置会自动保存到当前浏览器",-1))])):xe("",!0)}}),c3=Jt(l3,[["__scopeId","data-v-1bba85d9"]]);class vf{constructor(){M(this,"sprite",null);M(this,"texture",null);M(this,"loadVersion",0)}createSprite(e){const t=new Pr(Ke.EMPTY);return t.anchor.set(.5),t.visible=!1,e.addChild(t),this.sprite=t,t}applyTransform(e,t,i){this.sprite&&(this.sprite.position.set(Number(e)||0,-(Number(t)||0)),this.sprite.alpha=Math.min(1,Math.max(0,Number(i)||0)))}async syncTexture(e){const t=++this.loadVersion;if(!e){this.sprite&&(this.sprite.texture=Ke.EMPTY,this.sprite.visible=!1),this.texture&&this.texture.destroy(!0),this.texture=null;return}try{const i=await Ke.fromURL(e);if(t!==this.loadVersion||!this.sprite){i.destroy(!0);return}const n=this.texture;this.texture=i,this.sprite.texture=i,this.sprite.visible=!0,n&&n.destroy(!0)}catch(i){console.error("背景图恢复失败",i)}}static clearStoreBackground(e,t){e.settings.backgroundImageData="",e.settings.backgroundImageName="",t&&(e.settings.backgroundX=0,e.settings.backgroundY=0,e.settings.backgroundOpacity=1)}static async handleFileChange(e,t){var r;const i=t.target,n=(r=i.files)==null?void 0:r[0];if(n)try{e.settings.backgroundImageData=await $c(n),e.settings.backgroundImageName=n.name}catch(o){console.error("背景图加载失败",o)}finally{i.value=""}}destroy(){this.loadVersion++,this.texture&&this.texture.destroy(!0),this.texture=null,this.sprite=null}}class h3{constructor(e){M(this,"selectedNodes",new Set);M(this,"suppressNextDoubleClick",!1);this.ctx=e}resetSelection(){this.selectedNodes.clear()}activePath(){const e=this.ctx.store;if(e.activeObjectType!=="path")return null;const t=e.paths.find(i=>i.id===e.activeObjectId)||null;return(t==null?void 0:t.visible)===!1?null:t}pathInsertIndex(e,t,i){if(e.points.length<2)return e.points.length;const n=e.closed?e.points.length:e.points.length-1;let r=e.points.length,o=1/0;for(let a=0;aMath.hypot(l.x-n.x,l.y-n.y)<=r);if(o>=0){t.points.splice(o,1),this.selectedNodes.clear();return}const a=this.pathInsertIndex(t,n.x,n.y);t.points.splice(a,0,{x:n.x,y:n.y,inX:0,inY:0,outX:0,outY:0}),this.selectedNodes.clear(),this.selectedNodes.add(a)}onPointerDown(e){const t=this.activePath();if(!t||!t.enabled)return!1;const i=ds(this.ctx,e.clientX,e.clientY),n=Ro(t,i.x,i.y),r=9/Math.max(.01,this.ctx.store.editor.viewScale);if(e.detail>=2){if(t.points.findIndex(u=>Math.hypot(u.x-n.x,u.y-n.y)<=r)>=0)return!0;const c={x:n.x,y:n.y,inX:0,inY:0,outX:0,outY:0},h=this.pathInsertIndex(t,n.x,n.y);return t.points.splice(h,0,c),this.selectedNodes.clear(),this.selectedNodes.add(h),this.suppressNextDoubleClick=!0,ra(u=>{const d=ds(this.ctx,u.clientX,u.clientY),f=Ro(t,d.x,d.y);c.outX=f.x-c.x,c.outY=f.y-c.y,c.inX=-c.outX,c.inY=-c.outY}),!0}let o=null;for(const l of this.selectedNodes){const c=t.points[l];c&&(Math.hypot(c.x+c.inX-n.x,c.y+c.inY-n.y)<=r&&(o={index:l,side:"in"}),Math.hypot(c.x+c.outX-n.x,c.y+c.outY-n.y)<=r&&(o={index:l,side:"out"}))}if(o){const l=t.points[o.index],c=o.side==="in"?Math.hypot(l.outX,l.outY):Math.hypot(l.inX,l.inY);return ra(u=>{const d=ds(this.ctx,u.clientX,u.clientY),f=Ro(t,d.x,d.y),m=f.x-l.x,p=f.y-l.y;if(o.side==="in"?(l.inX=m,l.inY=p):(l.outX=m,l.outY=p),!u.altKey){const g=Math.max(1e-4,Math.hypot(m,p)),x=u.shiftKey?g:c;o.side==="in"?(l.outX=-m/g*x,l.outY=-p/g*x):(l.inX=-m/g*x,l.inY=-p/g*x)}}),!0}const a=t.points.findIndex(l=>Math.hypot(l.x-n.x,l.y-n.y)<=r);if(a>=0){if(e.altKey)return this.selectedNodes.delete(a),!0;e.ctrlKey||e.metaKey?this.selectedNodes.add(a):this.selectedNodes.has(a)||(this.selectedNodes.clear(),this.selectedNodes.add(a));const l=n,c=[...this.selectedNodes].map(u=>({index:u,x:t.points[u].x,y:t.points[u].y}));return ra(u=>{const d=ds(this.ctx,u.clientX,u.clientY),f=Ro(t,d.x,d.y);for(const m of c)t.points[m.index].x=m.x+f.x-l.x,t.points[m.index].y=m.y+f.y-l.y}),!0}if(e.altKey&&!e.ctrlKey&&!e.metaKey)return this.selectedNodes.clear(),!0;if(e.ctrlKey||e.metaKey||e.altKey){const l=n,c=e.altKey,h=u=>{const d=ds(this.ctx,u.clientX,u.clientY),f=Ro(t,d.x,d.y),m=Math.min(l.x,f.x),p=Math.max(l.x,f.x),g=Math.min(l.y,f.y),x=Math.max(l.y,f.y);t.points.forEach((v,y)=>{v.x>=m&&v.x<=p&&v.y>=g&&v.y<=x&&(c?this.selectedNodes.delete(y):this.selectedNodes.add(y))}),window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",h)};return window.addEventListener("pointerup",h),window.addEventListener("pointercancel",h),!0}return!1}}class u3{constructor(e,t){this.ctx=e,this.getTool=t}onColliderPointerDown(e){const t=this.ctx.store;if(t.activeObjectType!=="collision")return!1;const i=t.colliders.find(v=>v.id===t.activeObjectId);if(!(i!=null&&i.enabled)||i.visible===!1)return!1;const n=ds(this.ctx,e.clientX,e.clientY),r=i.rotation*Math.PI/180,o=Math.cos(r),a=Math.sin(r),l=Math.max(1e-4,Math.abs(i.scaleX??1)),c=Math.max(1e-4,Math.abs(i.scaleY??1)),h=n.x-i.x,u=n.y-i.y,d=(o*h+a*u)/l,f=(-a*h+o*u)/c;if(!(i.shape==="circle"?Math.hypot(d,f)<=i.radius:i.shape==="ellipse"?Math.hypot(d/Math.max(1,i.radiusX),f/Math.max(1,i.radiusY))<=1:Math.abs(d)<=i.width*.5&&Math.abs(f)<=i.height*.5))return!1;const p=i.x,g=i.y,x=n;return ra(v=>{const y=ds(this.ctx,v.clientX,v.clientY);i.x=p+y.x-x.x,i.y=g+y.y-x.y}),!0}onForceFieldDown(e){const t=this.ctx.store.systems.find(h=>h.id===this.ctx.store.activeId);if((t==null?void 0:t.visible)===!1)return!1;const i=t==null?void 0:t.config;if(!(i!=null&&i.forceField)||!i.showForceFieldShape||i.forceRadius<=0)return!1;const n=ds(this.ctx,e.clientX,e.clientY);if(Math.hypot(n.x-i.forceCenterX,n.y-i.forceCenterY)>i.forceRadius)return!1;const o=i.forceCenterX,a=i.forceCenterY;this.ctx.holder.value&&(this.ctx.holder.value.style.cursor="grabbing");const l=h=>{const u=ds(this.ctx,h.clientX,h.clientY);i.forceCenterX=o+u.x-n.x,i.forceCenterY=a+u.y-n.y},c=()=>{this.ctx.holder.value&&(this.ctx.holder.value.style.cursor=""),window.removeEventListener("pointermove",l),window.removeEventListener("pointerup",c),window.removeEventListener("pointercancel",c)};return window.addEventListener("pointermove",l),window.addEventListener("pointerup",c),window.addEventListener("pointercancel",c),e.preventDefault(),!0}onAttractionDown(e){const t=this.ctx.store.systems.find(u=>u.id===this.ctx.store.activeId);if((t==null?void 0:t.visible)===!1)return!1;const i=t==null?void 0:t.config;if(!(i!=null&&i.attraction)||!i.showAttractionShape)return!1;const n=ds(this.ctx,e.clientX,e.clientY),r=Math.max(i.attractionRadius,12/Math.max(1e-4,this.ctx.store.editor.viewScale));if(Math.hypot(n.x-i.attractionCenterX,n.y-i.attractionCenterY)>r)return!1;const a=i.attractionCenterX,l=i.attractionCenterY;this.ctx.holder.value&&(this.ctx.holder.value.style.cursor="grabbing");const c=u=>{const d=ds(this.ctx,u.clientX,u.clientY);i.attractionCenterX=a+d.x-n.x,i.attractionCenterY=l+d.y-n.y},h=()=>{this.ctx.holder.value&&(this.ctx.holder.value.style.cursor=""),window.removeEventListener("pointermove",c),window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",h)};return window.addEventListener("pointermove",c),window.addEventListener("pointerup",h),window.addEventListener("pointercancel",h),e.preventDefault(),!0}selectedTransformTarget(){const e=this.ctx.store,t=e.activeObjectId;if(e.activeObjectType==="particle"){const r=e.systems.find(a=>a.id===t);if(!r||r.visible===!1)return null;const o=r.config;return{x:o.centerX,y:o.centerY,rotation:o.rootRotation,scaleX:o.rootScaleX??1,scaleY:o.rootScaleY??1,setPosition:(a,l)=>{o.centerX=a,o.centerY=l},setRotation:a=>{o.rootRotation=a},setScale:(a,l)=>{o.rootScaleX=a,o.rootScaleY=l}}}const n=(e.activeObjectType==="collision"?e.colliders:e.activeObjectType==="path"?e.paths:e.spines).find(r=>r.id===t);return!n||n.visible===!1?null:{x:Number(n.x)||0,y:Number(n.y)||0,rotation:Number(n.rotation)||0,scaleX:Math.max(.05,Number(n.scaleX)||1),scaleY:Math.max(.05,Number(n.scaleY)||1),setPosition:(r,o)=>{n.x=r,n.y=o},setRotation:r=>{n.rotation=r},setScale:(r,o)=>{n.scaleX=r,n.scaleY=o}}}onGizmoDown(e){const t=this.selectedTransformTarget();if(!t)return;const i=this.ctx.app(),n=this.ctx.store,r=n.editor.viewScale,o=this.ctx.holder.value.getBoundingClientRect(),a=o.left+i.screen.width/2+n.editor.viewX+t.x*r,l=o.top+i.screen.height*.5+n.editor.viewY+-t.y*r,c=e.clientX,h=e.clientY,u=this.getTool(),d=t.x,f=t.y,m=t.rotation,p=t.scaleX,g=t.scaleY,x=Math.hypot(c-a,h-l)||1,v=Math.atan2(h-l,c-a);ra(w=>{const _=(w.clientX-c)/r,S=(w.clientY-h)/r;if(u==="translate")t.setPosition(d+_,f-S);else if(u==="rotate"){const b=Math.atan2(w.clientY-l,w.clientX-a);t.setRotation(m-(b-v)*180/Math.PI)}else if(u==="scale"){const C=Math.hypot(w.clientX-a,w.clientY-l)/x;t.setScale(Math.max(.05,p*C),Math.max(.05,g*C))}})}}function iy(s,e,t,i,n){const r=1-n;return r*r*r*s+3*r*r*n*e+3*r*n*n*t+n*n*n*i}function sy(s,e,t){const i=s.rotation*Math.PI/180,n=Math.cos(i),r=Math.sin(i),o=Math.max(1e-4,Math.abs(s.scaleX??1)),a=Math.max(1e-4,Math.abs(s.scaleY??1));return{x:s.x+n*e*o-r*t*a,y:s.y+r*e*o+n*t*a}}function Op(s,e){if(!s.points.length)return null;if(s.points.length===1)return{...sy(s,s.points[0].x,s.points[0].y),angle:s.rotation};const t=s.closed?s.points.length:s.points.length-1,i=[];let n=0;for(let m=0;m0&&x===0)continue;const v=x/20,y=iy(p.x,p.x+p.outX,g.x+g.inX,g.x,v),w=iy(p.y,p.y+p.outY,g.y+g.inY,g.y,v),_=sy(s,y,w),S=i[i.length-1];S&&(n+=Math.hypot(_.x-S.x,_.y-S.y)),i.push({..._,distance:n})}}const r=Math.min(1,Math.max(0,e))*n;let o=i.findIndex(m=>m.distance>=r);o<0&&(o=i.length-1);const a=i[o],l=i[Math.max(0,o-1)],c=i[Math.min(i.length-1,o+1)],h=l.distance,u=o>0?(r-h)/Math.max(1e-4,a.distance-h):0,d=l.x+(a.x-l.x)*Math.min(1,Math.max(0,u)),f=l.y+(a.y-l.y)*Math.min(1,Math.max(0,u));return{x:d,y:f,angle:Math.atan2(c.y-l.y,c.x-l.x)*180/Math.PI}}function d3(s,e,t){if(e.renderLayerMode!=="slot")return null;const i=s.find(o=>o.id===e.renderLayerSpineId&&o.enabled&&o.status==="ready");if(!i)return null;const n=i.slots||[],r=n.find(o=>o.name===e.renderLayerSlotName);if(!r)return null;if(e.renderLayerSlotPosition==="below"){let o="";if(t!=null&&t.length){const a=t.indexOf(r.name);if(a===0)return null;a>0&&(o=t[a-1])}if(!o){const a=n.filter(l=>l.orderc.order-l.order)[0];if(!a)return null;o=a.name}return{spineId:i.id,slotName:o,targetSlotName:r.name,followAttachment:!1}}return{spineId:i.id,slotName:r.name,targetSlotName:r.name,followAttachment:e.renderLayerFollowAttachment}}function Ih(s,e,t,i=Math.max(1e-4,Math.abs(s.rootScaleX)),n=Math.max(1e-4,Math.abs(s.rootScaleY))){const r=-s.rootRotation*Math.PI/180,o=Math.cos(r),a=Math.sin(r),l=e-s.centerX,c=-t+s.centerY;return{x:(o*l+a*c)/i,y:(-a*l+o*c)/n}}function f3(s,e,t){const i=Op(e,t);if(!i)return null;const n=Ih(s,i.x,i.y),r=i.angle*Math.PI/180,o=Ih(s,i.x+Math.cos(r),i.y+Math.sin(r)),a=Math.atan2(o.y-n.y,o.x-n.x)*180/Math.PI;return{...n,angle:a}}function m3(s,e){return s.colliders.map(t=>{if(!t.followPath||!t.followPathId)return t;const i=s.paths.find(h=>h.id===t.followPathId&&h.enabled);if(!(i!=null&&i.points.length))return t;const n=Math.max(.05,Number(t.followDuration)||2),r=Math.min(1,Math.max(0,e/n)),o=Array.isArray(t.followCurve)?t.followCurve:[{x:0,y:0},{x:1,y:1}],a=t.followCurveMode==="跟随导出"?s.settings.exportSettings.keyframeCurve==="bezier"?"bezier":"linear":t.followCurveMode==="贝塞尔"?"bezier":"linear",l=Math.min(1,Math.max(0,N1(o,r,a))),c=Op(i,l);return c?{...t,x:c.x,y:c.y,rotation:t.rotation+(t.followPathRotation?c.angle:0)}:t})}class p3{constructor(){M(this,"emitters",new Map);M(this,"configs",new Map);M(this,"store",null);M(this,"eventsSuspended",!1);M(this,"subEmitterState",new Map);M(this,"slotGroups",new Map)}sync(e,t,i,n,r=null){this.store=e;for(const[l,c]of this.emitters){const h=e.systems.find(u=>u.id===l);(!h||this.configs.get(l)!==h.config)&&(c.removeFromParent(),c.destroy({children:!0}),this.emitters.delete(l),this.configs.delete(l))}for(const l of e.systems){i&&!l.config.texture&&(l.config.texture=i);const c=Xn(l.config);if(n)for(const u of c.trailResources)!u.texture&&(u.previewUrl==="/images/trail.png"||u.previewUrl==="/trails/trail.png")&&(u.texture=n);if(i)for(const u of c.imageResources)!u.texture&&u.textureName==="star"&&(u.texture=i);if(this.emitters.has(l.id))continue;const h=new Xv(l.config);h.onParticleEvent=u=>this.handleParticleEvent(l.id,u),t.addChild(h),this.emitters.set(l.id,h),this.configs.set(l.id,l.config)}const o=ha(e.systems);for(const l of e.systems){const c=this.emitters.get(l.id);if(!c)continue;c.onParticleEvent||(c.onParticleEvent=u=>this.handleParticleEvent(l.id,u));const h=o.has(l.id);this.subEmitterState.get(l.id)!==h&&(h&&c.clear(),this.subEmitterState.set(l.id,h)),c.setAutoEmission(!h)}const a=new Set;for(const l of e.systems){const c=this.emitters.get(l.id);if(!c)continue;const h=r&&l.config.renderLayerMode==="slot"?r.getDrawOrder(l.config.renderLayerSpineId):null,u=d3(e.spines,l.config,h),d=u&&r?this.ensureSlotGroup(u,r,l.config):null;d?(a.add(d.key),c.parent!==d.compensator&&d.compensator.addChild(c)):c.parent!==t&&t.addChild(c)}for(const[l,c]of[...this.slotGroups])if(!a.has(l)){for(const h of[...c.compensator.children])h instanceof Xv&&h.parent===c.compensator&&t.addChild(h);r==null||r.detachSlotObject(c.spineId,c.slotName,c.wrapper),c.wrapper.removeFromParent(),c.wrapper.removeChild(c.compensator),c.compensator.destroy(),c.wrapper.destroy(),this.slotGroups.delete(l)}}ensureSlotGroup(e,t,i){const n=`${e.spineId}:${e.targetSlotName}:${i.renderLayerSlotPosition}`;let r=this.slotGroups.get(n);if(!r){const o=new gi,a=new gi;o.addChild(a),r={key:n,spineId:e.spineId,slotName:e.slotName,wrapper:o,compensator:a,followAttachment:i.renderLayerFollowAttachment,attached:!1},this.slotGroups.set(n,r)}return(!r.attached||!r.wrapper.parent||r.slotName!==e.slotName)&&(r.wrapper.parent&&t.detachSlotObject(r.spineId,r.slotName,r.wrapper),r.slotName=e.slotName,r.attached=t.attachSlotObject(r.spineId,r.slotName,r.wrapper,e.followAttachment)),r.attached?r:null}updateRenderCompensation(e,t){if(t)for(const i of this.slotGroups.values()){if(!i.attached||!i.wrapper.parent)continue;const n=e.spines.find(o=>o.id===i.spineId);if(!n)continue;const r=t.getSlotParentMatrix(i.spineId,i.slotName,n);r&&(r.invert(),i.compensator.transform.setFromMatrix(r))}}suspendEvents(e){this.eventsSuspended=e}handleParticleEvent(e,t){if(this.eventsSuspended)return;const i=this.store;if(!i)return;const n=i.systems.find(o=>o.id===e),r=n==null?void 0:n.config;if(!(!(r!=null&&r.eventEnabled)||!Array.isArray(r.events)||!r.events.length)&&!(t.depth>=2))for(const o of r.events){if(o.event!==t.kind||o.event==="collision"&&t.collisionCount>o.collisionLimit||o.targetSystemId<=0||o.targetSystemId===e)continue;const a=Math.min(1,Math.max(0,Number(o.probability)||0));if(a<=0)continue;const l=(Math.imul(o.id+1,2654435761)^Math.imul(t.depth+1,2246822507))>>>0;if(ar(r.seed>>>0,t.spawnId+1,l)>=a)continue;const h=this.emitters.get(o.targetSystemId);if(!h)continue;const u=Array.isArray(o.inherit)?o.inherit:[],d=u.length?{attributes:u,colorMode:o.colorInheritMode==="replace"?"replace":"add",data:{colorHex:t.colorHex,scaleX:t.scaleX,scaleY:t.scaleY,rotation:t.rotation,life:t.maxLife}}:void 0;h.spawnEventParticle(t.worldX,t.worldY,t.depth+1,d)}}destroy(e){for(const t of this.slotGroups.values()){for(const i of[...t.compensator.children])t.compensator.removeChild(i);t.wrapper.removeFromParent(),t.compensator.destroy(),t.wrapper.destroy()}this.slotGroups.clear();for(const[t,i]of this.emitters)i.removeFromParent(),i.destroy({children:!0}),this.emitters.delete(t),this.configs.delete(t)}}async function g3(){const[s,e]=await Promise.all([Ke.fromURL("/images/star.png"),Ke.fromURL("/images/trail.png")]);return{dotTex:s,trailTex:e}}function v3(s,e,t){for(const i of s.systems){i.config.texture=e;const n=Xn(i.config);if(t)for(const r of n.trailResources)!r.texture&&(r.previewUrl==="/images/trail.png"||r.previewUrl==="/trails/trail.png")&&(r.texture=t);for(const r of n.imageResources)!r.texture&&r.textureName==="star"&&(r.texture=e)}}const y3={class:"stage-wrap"},x3={key:0,class:"hud"},b3={class:"hud-number hud-system-count"},w3={class:"hud-number hud-particle-count"},S3=Zt({__name:"Stage",setup(s){const e=yo(),t=Fe(null),i=Fe(null),n=Fe(!1),r=Fe(!1),o=Fe(""),a=Fe(!1);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);let l=null,c=null,h=null,u=null,d=null,f=null,m=null,p=null,g=null,x=null,v=null,y=null,w=null,_=null,S=null,b=[],C=0,A=0,P=0,E=0,R=null,O=null;const U=new vf,G=new p3,$={store:e,holder:t,app:()=>l},X=new h3($),D=new u3($,()=>o.value);let k=[];const N=new Map;function F(){c=new gi,l.stage.addChild(c),_=new gi,l.stage.addChild(_),U.createSprite(c),w=new Ni,c.addChild(w),S=new sP,c.addChild(S.container),u=new Ni,c.addChild(u),h=new Ni,c.addChild(h),f=new Ni,c.addChild(f),m=new Ni,c.addChild(m),p=new Ni,c.addChild(p),g=new Ni,c.addChild(g),x=new Ni,c.addChild(x),v=new Ni,c.addChild(v),y=new Ni,c.addChild(y),d=new Ni,c.addChild(d)}function V(fe){if(fe.button===0){if(o.value&&D.selectedTransformTarget()){D.onGizmoDown(fe);return}X.onPointerDown(fe)||D.onColliderPointerDown(fe)||D.onAttractionDown(fe)||D.onForceFieldDown(fe)||AF($,fe.clientX,fe.clientY)}}function Y(fe){X.onStageDoubleClick(fe)}function q(fe){EF($,fe)}function z(fe=!0){vf.clearStoreBackground(e,fe)}async function se(fe){await vf.handleFileChange(e,fe)}qk({canvasElement:t,canvasFocused:a,undo:qw,save:()=>Yw(e),togglePlay:()=>e.togglePlay(),toStart:()=>e.toStart(),setTool:fe=>{o.value=fe}});function oe(){c&&G.sync(e,c,R,O,S)}function de(fe,H,W,Z){const L=Math.max(2,Math.floor(Z)||2);if(fe.config.mode==="stream"&&fe.config.streamBehavior==="loop"){Hv(fe,H,W,L);return}H.reset();const B=1/Math.max(1,W),j=[];for(let ie=0;ie=H)continue;const B=G.emitters.get(L.id);B&&de(L,B,fe,H)}}finally{G.suspendEvents(!1)}e.systems.every(L=>{var B;return(((B=L.frames)==null?void 0:B.length)||0)>=H})&&(e.timeline.recorded=!0)}function he(){var W,Z,L,B;E=requestAnimationFrame(he);const fe=performance.now()/1e3;let H=fe-C;if(C=fe,H>.1&&(H=.1),l&&c){c.scale.set(e.editor.viewScale),c.position.set(l.screen.width/2+e.editor.viewX,l.screen.height*.5+e.editor.viewY),U.applyTransform(e.settings.backgroundX,e.settings.backgroundY,e.settings.backgroundOpacity),UR(e,l,w,_,b);const j=Math.max(1,e.timeline.fps),ie=e.timeline.frame,ue=ie/j;S==null||S.sync(e.spines,ie,j),oe(),G.updateRenderCompensation(e,S),k=m3(e,ue);for(const Ve of e.systems){const Ee=G.emitters.get(Ve.id);if(!Ee)continue;Ee.setFollowExportCurveMode(e.settings.exportSettings.keyframeCurve==="bezier"?"贝塞尔":"线性");const Je=Ve.visible!==!1;Ee.visible=Je,Ee.renderable=Je;const Ae=Ve.config;Ee.scale.set(Ae.rootScaleX,Ae.rootScaleY);const Qt=new Set(Ae.collisionColliderIds);Ee.setColliders(Ae.collision?k.filter(Xt=>Qt.has(Xt.id)):[]),Ee.setEmitterFollowSpawn(0,0,0);let ut={x:Ae.centerX,y:Ae.centerY,rotation:Ae.rootRotation};const re=Ae.emitterFollow&&Ae.emitterFollowMode==="bone"?e.spines.find(Xt=>Xt.id===Ae.emitterFollowSpineId&&Xt.enabled&&Xt.status==="ready"):null,ae=re&&(S==null?void 0:S.getBoneWorldTransform(re.id,Ae.emitterFollowBoneName))||null,Qe=Ae.emitterFollow&&Ae.emitterFollowMode==="path"?e.paths.find(Xt=>Xt.id===Ae.emitterFollowPathId&&Xt.enabled):null,It=Math.max(.05,Ae.emitterFollowDuration),kt=Math.min(1,Math.max(0,ue/It)),ot=Math.min(1,Math.max(0,N1(Ae.emitterFollowCurve,kt))),Gi=Math.min(1,Math.max(0,Ae.emitterFollowOffset)),xs=Ae.emitterFollowDirection==="reverse"?(1-Gi)*(1-ot):Gi+(1-Gi)*ot,Nt=Qe?Op(Qe,xs):null;if(ae){const Xt=Ae.emitterFollowBoneOffsetX,ji=Ae.emitterFollowBoneOffsetY,ni=ae.x+Xt,bs=ae.y+ji,ws=Ae.rootRotation+Ae.emitterFollowBoneRotation,$s=Math.max(1e-4,Math.abs(Ae.rootScaleX*Ae.emitterFollowBoneScaleX)),Zi=Math.max(1e-4,Math.abs(Ae.rootScaleY*Ae.emitterFollowBoneScaleY));if(ut={x:ni,y:bs,rotation:ws},Ae.emitterFollowSpace==="local")Ee.position.set(ni,-bs),Ee.rotation=-ws*Math.PI/180,Ee.scale.set($s,Zi),Ee.setSimulationTransform(ni,bs,ws,$s,Zi);else{Ee.position.set(Ae.centerX,-Ae.centerY),Ee.rotation=-Ae.rootRotation*Math.PI/180,Ee.scale.set($s,Zi),Ee.setSimulationTransform(Ae.centerX,Ae.centerY,Ae.rootRotation,$s,Zi);const Zn=Ih(Ae,ni,bs,$s,Zi),gn=-(ws-Ae.rootRotation);Ee.setEmitterFollowSpawn(Zn.x,Zn.y,gn)}}else if(Nt){const Xt=Nt.angle+(Ae.emitterFollowDirection==="reverse"?180:0),ji=Ae.emitterAngleMode==="direction"?Xt:Ae.rootRotation;if(ut={x:Nt.x,y:Nt.y,rotation:ji},Ae.emitterFollowSpace==="local")Ee.position.set(Nt.x,-Nt.y),Ee.rotation=-ji*Math.PI/180,Ee.setSimulationTransform(Nt.x,Nt.y,ji);else{Ee.position.set(Ae.centerX,-Ae.centerY),Ee.rotation=-Ae.rootRotation*Math.PI/180,Ee.setSimulationTransform(Ae.centerX,Ae.centerY,Ae.rootRotation);const ni=Ih(Ae,Nt.x,Nt.y),bs=Ae.emitterAngleMode==="direction"?-(Xt-Ae.rootRotation):0;Ee.setEmitterFollowSpawn(ni.x,ni.y,bs)}}else Ee.position.set(Ae.centerX,-Ae.centerY),Ee.rotation=-Ae.rootRotation*Math.PI/180,Ee.setSimulationTransform(Ae.centerX,Ae.centerY,Ae.rootRotation);const vi=Ae.shape==="path"&&Ae.spawnPathId>0&&e.paths.find(Xt=>Xt.id===Ae.spawnPathId&&Xt.enabled&&Xt.points.length>0)||null;Ee.setSpawnPathSampler(vi?Xt=>f3(Ae,vi,Xt):null,(vi==null?void 0:vi.closed)===!0),N.set(Ve.id,ut)}let me=0;const ee=[],Me=e.settings.showBones&&e.activeObjectType==="particle"?e.activeObjectId:0,be=(Ve,Ee,Je)=>{!Ve||Ve.id!==Me||Ve.visible===!1||ZR(ee,Je,Ee.position.x,Ee.position.y)},pe=e.timeline,Ne=e.playbackRange,Ye=pe.fps,st=1/Math.max(1,Ye);let Ze=P,nt=0;if(pe.playing?(A+=H,nt=Math.floor(A/st),nt>0&&(A-=nt*st)):(A=0,ge(Ye)),pe.playing&&nt>0)for(let Ve=0;Veut.id===e.activeId),Je=(Ee==null?void 0:Ee.config.mode)==="stream"&&Ee.config.streamBehavior==="loop"?P1(Ee.config,Ye):null,Qt=pe.loop&&pe.abLoop&&(Je==null?void 0:Je.start)===Ne.start&&Je.end===Ne.end?Ne.end-1:Ne.end;if(pe.frame>Qt)if(pe.loop)pe.frame=Ne.start;else{pe.frame=Ne.end,pe.playing=!1;break}}else{G.suspendEvents(!0);try{const Ee=ha(e.systems);for(const Je of e.systems){const Ae=G.emitters.get(Je.id);if(!Ae)continue;!Ee.has(Je.id)&&Je.config.mode==="stream"&&Je.config.streamBehavior==="loop"?(W=Je.frames)!=null&&W.length||Hv(Je,Ae,Ye,pe.totalFrames):pe.frame===0&&Ae.reset()}}finally{G.suspendEvents(!1)}for(const[Ee,Je]of G.emitters){const Ae=e.systems.find(Qe=>Qe.id===Ee),Qt=(Ae==null?void 0:Ae.config.mode)==="stream"&&Ae.config.streamBehavior==="loop",ut=Qt?(Z=Ae.frames)==null?void 0:Z[pe.frame]:void 0,re=pe.frame===0&&!Qt,ae=re?[]:ut||Je.update(st);if(re?Je.apply([]):ut&&Je.apply(ut),(Ae==null?void 0:Ae.visible)!==!1)for(const Qe of ae)Qe.active&&be(Ae,Je,Qe);me+=ae.length}for(const Ee of e.systems){if(!Ee.config.texture)continue;Ee.frames=Ee.frames||[];const Je=G.emitters.get(Ee.id);Je&&!(Ee.config.mode==="stream"&&Ee.config.streamBehavior==="loop")&&(Ee.frames[pe.frame]=Je.capture())}pe.frame++,pe.frame>=pe.totalFrames&&(pe.frame=Ne.start,pe.recorded=!0)}else{pe.playing||(Ze=pe.frame);for(const Ve of e.systems){const Ee=G.emitters.get(Ve.id),Je=pe.playing?P:pe.frame,Ae=(B=Ve.frames)==null?void 0:B[Je],Qt=Ve.config.mode==="stream"&&Ve.config.streamBehavior==="loop"&&!!Ae;if((pe.recorded||Qt)&&Ee&&Ae){Ee.apply(Ae);for(const ut of Ae)ut.active&&(be(Ve,Ee,ut),me++)}else if(Ee){const ut=pe.frame===0?[]:Ee.update(0);if(pe.frame===0&&Ee.apply([]),Ve.visible!==!1)for(const re of ut)re.active&&be(Ve,Ee,re);me+=Ee.activeCount}}}P=Ze,S==null||S.sync(e.spines,Ze,Ye);for(const[,Ve]of G.emitters)Ve.drawTrailMeshDebug(e.settings.showSkinMesh);qR(e,k,x),KR(e,X.selectedNodes,v),HR(e,S,u),$R(e,N,h),XR(e,N,f),VR(e,m),YR(e,p),GR(e,g),WR(o,D.selectedTransformTarget.bind(D),y),JR(ee,e,d),i.value&&(i.value.systems=e.systems.length,i.value.particles=me)}}return ys(async()=>{const fe=t.value;l=new i1({width:fe.clientWidth||800,height:fe.clientHeight||600,backgroundAlpha:0,antialias:!0}),fe.appendChild(l.view),F(),ai(()=>e.settings.backgroundImageData,W=>U.syncTexture(W),{immediate:!0});const H=await g3();R=H.dotTex,O=H.trailTex,v3(e,R,O),i.value={systems:e.systems.length,particles:0},e.timeline.recorded=!1,e.timeline.frame=0,A=0,P=0,e.timeline.playing=!0,e.timeline.loop=!0;for(const W of e.systems)W.frames=[];e.recalcTotalFrames(),C=performance.now()/1e3,he(),ai(()=>e.systems.map(W=>JSON.stringify(W.config,(Z,L)=>Z==="texture"||Z==="trailTexture"||Z==="previewUrl"?void 0:L)).join("|")+`|colliders:${JSON.stringify(e.colliders)}|paths:${JSON.stringify(e.paths)}`,()=>{e.recalcTotalFrames(),e.timeline.recorded=!1,e.timeline.frame=0;for(const W of e.systems)W.frames=[];e.timeline.playing=!0,e.timeline.loop=!0}),Hk(e)}),Al(()=>{cancelAnimationFrame(E),S==null||S.destroy(),S=null,U.destroy(),c&&l&&G.destroy(c),l&&(l.destroy(!0,{children:!0}),l=null)}),ai(()=>[e.activeObjectType,e.activeObjectId],()=>X.resetSelection()),(fe,H)=>(K(),J("div",y3,[T("div",{ref_key:"holder",ref:t,class:Ce(["stage-holder",{grid:I(e).settings.showGrid}]),tabindex:"0",onWheel:qe(q,["prevent"]),onPointerdown:V,onDblclick:qe(Y,["prevent"])},null,34),we(jF,{ctx:$,"active-tool":o.value,"show-settings":n.value,"show-help":r.value,"onUpdate:activeTool":H[0]||(H[0]=W=>o.value=W),"onUpdate:showSettings":H[1]||(H[1]=W=>n.value=W),"onUpdate:showHelp":H[2]||(H[2]=W=>r.value=W),onClearBackground:z,onBackgroundFile:se},null,8,["active-tool","show-settings","show-help"]),we(c3,{show:n.value,onClose:H[3]||(H[3]=W=>n.value=!1)},null,8,["show"]),we(CF,{show:r.value,onClose:H[4]||(H[4]=W=>r.value=!1)},null,8,["show"]),i.value?(K(),J("div",x3,[H[5]||(H[5]=ft(" 系统: ",-1)),T("b",b3,ve(i.value.systems),1),H[6]||(H[6]=ft(" · 粒子(骨骼): ",-1)),T("b",w3,ve(i.value.particles),1),H[7]||(H[7]=ft(" · 根骨骼: ",-1)),H[8]||(H[8]=T("b",null,"root",-1)),H[9]||(H[9]=T("span",{class:"hud-tip"},"滚轮缩放 · 左键拖动画布",-1))])):xe("",!0)]))}}),M3=Jt(S3,[["__scopeId","data-v-769d4380"]]),T3=[{x:0,y:0},{x:1,y:1}],Cm=[{x:0,y:1},{x:1,y:1}],_3=[{x:0,y:0},{x:.2,y:1},{x:.8,y:1},{x:1,y:0}],Em=[{x:0,y:0},{x:.1,y:1},{x:.9,y:1},{x:1,y:0}],Am=[{x:0,y:1},{x:1,y:1}],Im=[{x:0,y:1},{x:1,y:1}],ti=po({visible:!1,title:"",detail:"",progress:0,indeterminate:!1,failed:!1});let Mc=0;function C3(s){return new Promise(e=>window.setTimeout(e,s))}function Zw(s,e){const t=++Mc,i=performance.now();Object.assign(ti,{visible:!0,title:s,detail:e,progress:0,indeterminate:!1,failed:!1});const n=(o,a)=>{t===Mc&&(ti.indeterminate=o==null,o!=null&&(ti.progress=Math.min(100,Math.max(0,o))),a&&(ti.detail=a))},r=async(o,a)=>{if(t!==Mc)return;ti.failed=o,ti.indeterminate=!1,ti.progress=o?ti.progress:100,ti.detail=a,await C3(Math.max(180,(o?850:450)-(performance.now()-i))),t===Mc&&(ti.visible=!1)};return{update:n,paint:()=>new Promise(o=>requestAnimationFrame(()=>o())),finish:(o="已完成")=>r(!1,o),fail:(o="操作失败")=>r(!0,o)}}async function E3(s,e){if(!s.body)return e(null),s.text();const t=Number(s.headers.get("content-length")),i=Number.isFinite(t)&&t>0,n=s.body.getReader(),r=new TextDecoder;let o=0,a="";for(e(i?0:null);;){const{done:l,value:c}=await n.read();if(l)break;o+=c.byteLength,a+=r.decode(c,{stream:!0}),e(i?Math.min(1,o/t):null)}return a+=r.decode(),i&&e(1),a}const A3="3.8";function fs(s,e,t){s[e]==null&&s[t]!=null&&(s[e]=s[t]),delete s[t]}function Rm(s){if(!s||typeof s!="object")return;if(Array.isArray(s)){for(const t of s)Rm(t);return}const e=s;Array.isArray(e.curve)&&delete e.curve;for(const t of Object.values(e))Rm(t)}function I3(s){for(const e of s.bones)fs(e,"transform","inherit");for(const e of s.transform||[])fs(e,"rotateMix","mixRotate"),e.translateMix==null&&(e.translateMix=e.mixX??e.mixY),e.scaleMix==null&&(e.scaleMix=e.mixScaleX??e.mixScaleY),fs(e,"shearMix","mixShearY"),delete e.mixX,delete e.mixY,delete e.mixScaleX,delete e.mixScaleY;for(const e of s.path||[])fs(e,"rotateMix","mixRotate"),e.translateMix==null&&(e.translateMix=e.mixX??e.mixY),delete e.mixX,delete e.mixY;for(const e of s.skins)for(const t of Object.values(e.attachments||{}))for(const i of Object.values(t||{}))i.parent!=null&&fs(i,"deform","timelines")}function R3(s){for(const e of Object.values(s.slots||{}))fs(e,"color","rgba"),fs(e,"twoColor","rgba2")}function P3(s){for(const e of Object.values(s.bones||{}))for(const t of e.rotate||[])fs(t,"angle","value")}function k3(s){for(const e of Object.values(s.transform||{}))for(const t of e)fs(t,"rotateMix","mixRotate"),t.translateMix==null&&(t.translateMix=t.mixX??t.mixY),t.scaleMix==null&&(t.scaleMix=t.mixScaleX??t.mixScaleY),fs(t,"shearMix","mixShearY"),delete t.mixX,delete t.mixY,delete t.mixScaleX,delete t.mixScaleY}function F3(s){for(const e of Object.values(s.path||{})){for(const t of["position","spacing"])for(const i of e[t]||[])fs(i,t,"value");for(const t of e.mix||[])fs(t,"rotateMix","mixRotate"),t.translateMix==null&&(t.translateMix=t.mixX??t.mixY),delete t.mixX,delete t.mixY}}function O3(s){if(!s.attachments)return;const e=s.deform||(s.deform={});for(const[t,i]of Object.entries(s.attachments)){const n=e[t]||(e[t]={});for(const[r,o]of Object.entries(i)){const a=n[r]||(n[r]={});for(const[l,c]of Object.entries(o))c.deform&&(a[l]=c.deform)}}delete s.attachments}function L3(s){s.skeleton.spine=A3,I3(s);for(const e of Object.values(s.animations))R3(e),P3(e),k3(e),F3(e),O3(e);return Rm(s.animations),s}function B3(s,e,t,i,n=!1){if(n){let l=0;for(let c=0;c[...n].sort((a,l)=>a-l);let o=!0;for(;o;){o=!1;const a=r();for(let l=0;lf&&(f=p,d=m)}d>=0&&(n.add(d),o=!0)}}return r().map(a=>s[a])}function ny(s,e,t,i,n){const r=t-e+1;if(r<2)return 0;const o=n?e:t,a=n?e+1:t-1,l=n?e+2:t-2,c=Math.abs(s[a].frame-s[o].frame);if(r>=3&&c>0&&Math.abs(Math.abs(s[l].frame-s[a].frame)-c)<1e-6){const u=s[o].values[i],d=s[a].values[i],f=s[l].values[i];return n?(-3*u+4*d-f)/(2*c):(3*u-4*d+f)/(2*c)}const h=s[a].frame-s[o].frame;return h?(s[a].values[i]-s[o].values[i])/h:0}function ry(s,e,t){const i=s[t].frame-s[e].frame,n=[];for(let r=0;rd.values[r])),c=Math.max(...s.slice(e,t+1).map(d=>d.values[r])),h=o+ny(s,e,t,r,!0)*i/3,u=a-ny(s,e,t,r,!1)*i/3;n.push([Math.max(l,Math.min(c,h)),Math.max(l,Math.min(c,u))])}return{values:n}}function N3(s,e,t,i,n){const r=1-n;return r*r*r*s+3*r*r*n*e+3*r*n*n*t+n*n*n*i}function D3(s,e,t,i,n,r=!1){if(r){let c=0;for(let h=0;h[...n].sort((l,c)=>l-c);let o=!0;for(;o;){o=!1;const l=r();for(let c=0;cp&&(p=x,m=g)}m>=0&&(n.add(m),o=!0)}}const a=r();return{samples:a.map(l=>s[l]),controls:a.slice(0,-1).map((l,c)=>ry(s,l,a[c+1]))}}function U3(s){if(!s.length)return[];const e=[s[0]];for(let t=1;t180;)i-=360;for(;i-e[t-1]<-180;)i+=360;e.push(i)}return e}function oi(s){if(!Number.isFinite(s))return 0;const e=Math.round(s*1e5)/1e5;return Object.is(e,-0)?0:e}function $3(s,e,t,i){const n=Math.max(2,Math.min(16,Math.round(Number(s.trailGridRows)||2))),r=Math.max(2,Math.min(32,Math.round(Number(s.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),l=e.widthSizeMode==="random"?Math.max(1,Number(e.widthMin)||0,Number(e.widthMax)||0):Math.max(.001,Number(e.width)||100),c=(Number(e.rotation)||0)*Math.PI/180,h=Math.cos(c),u=Math.sin(c),d=[],f=[],m=[],p=[],g=[];for(let y=0;y=0;y--)g.push({col:y,row:n-1});for(let y=n-2;y>=1;y--)g.push({col:0,row:y});const x=g.length;for(let y=1;y|\s]+/g,"_").replace(/^_+|_+$/g,"")||e}function eS(s,e){let t=s,i=2;for(;e.has(t);)t=`${s}_${i++}`;return e.add(t),t}function V3(s){return s.replace(/\.[^./\\]+$/,"")}function tS(s,e){return V3([s,e].filter(Boolean).join("/").replace(/\\/g,"/").replace(/\/{2,}/g,"/").replace(/^\.\//,""))}function Y3(s){var i,n;const e=Number(((i=s==null?void 0:s.orig)==null?void 0:i.width)??(s==null?void 0:s.width))||0,t=Number(((n=s==null?void 0:s.orig)==null?void 0:n.height)??(s==null?void 0:s.height))||0;return{width:e,height:t}}function _c(s){return Math.round(Math.max(0,Math.min(1,s))*255).toString(16).padStart(2,"0")}function hy(s,e){return[(s>>16&255)/255,(s>>8&255)/255,(s&255)/255,Math.max(0,Math.min(1,e))]}function sl(s,e){return oi(s/e)}function G3(s,e){const t=s.config,i=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;return t.mode!=="stream"?r=n+i:t.streamBehavior!=="loop"?r=n+Math.max(1/e,Number(t.duration)||0)+i:r=n+Ps(t,e).total/e,Math.max(1,Math.ceil(r*e)+1)}function j3(s,e,t){const i=s.config;if(i.mode!=="stream"||i.streamBehavior!=="loop")return new Set;const n=P1(i,e),r=Math.max(1,t)/Math.max(1,e);return new Set([Math.round(n.start*r),Math.round(n.end*r)])}function Rh(s,e){return e?s.boneName:`${s.spawnId??"legacy"}_${s.boneName}`}function H3(s,e,t,i){const n=new Set;for(const r of s)for(const o of r)n.add(Rh(o,e));return[...n].sort().map((r,o)=>({key:r,name:eS(`${i}_${o}`,t),states:s.map(a=>a.find(l=>Rh(l,e)===r)||null)}))}function uy(s,e){const t=new Set(e.states.map(i=>i==null?void 0:i.resourceId).filter(i=>typeof i=="number"));return s.config.imageResources.filter(i=>t.has(i.id))}function W3(s,e,t,i){const n=e*t/i,r=Math.min(s.states.length-1,Math.max(0,Math.floor(n))),o=Math.min(s.states.length-1,r+1),a=s.states[r],l=s.states[o];if(!a||!l||Rh(a,!0)!==Rh(l,!0)||a.spawnId!==l.spawnId)return a;const c=n-r;if(c<=1e-6)return a;const h=(d,f)=>(d??0)+((f??d??0)-(d??0))*c,u=a.trailState&&l.trailState&&a.trailState.resourceId===l.trailState.resourceId?{...a.trailState,width:h(a.trailState.width,l.trailState.width),alpha:h(a.trailState.alpha,l.trailState.alpha),bones:a.trailState.bones.map((d,f)=>{const m=l.trailState.bones[f]||d;return{...d,worldX:h(d.worldX??d.x,m.worldX??m.x),worldY:h(d.worldY??d.y,m.worldY??m.y),worldRotation:h(d.worldRotation??-d.rotation,m.worldRotation??-m.rotation)}})}:a.trailState;return{...a,worldX:h(a.worldX,l.worldX),worldY:h(a.worldY,l.worldY),worldRotation:h(a.worldRotation,l.worldRotation),worldScaleX:h(a.worldScaleX,l.worldScaleX),worldScaleY:h(a.worldScaleY,l.worldScaleY),alpha:h(a.alpha,l.alpha),trailState:u}}function dy(s,e){return!s||s==="跟随导出"?e.keyframeCurve:s==="贝塞尔"?"bezier":"linear"}function ko(s,e,t,i,n,r=new Set,o=new Set,a=n.keyframeCurve){if(!s.length)return[];const l=new Set(r);for(const u of o)l.add(u);const c=a==="bezier"&&n.spineVersion!=="3.8"?Qw(s,i,l,o):{samples:Jw(s,i,l,o),controls:[]},h=c.samples.map(u=>{const d={time:sl(u.frame,e)};return t.forEach((f,m)=>{d[f]=oi(u.values[m])}),o.has(u.frame)&&(d.curve="stepped"),d});for(let u=0;u0&&n&&e.add(t-1),i&&e.add(t))}return e}function q3(s){const e=new Set;for(let t=0;t0&&n&&e.add(t-1),i&&e.add(t))}return e}function J3(s,e){var i;if(!s.shapeEnabled||!((i=s.shapeCurve)!=null&&i.length))return 1;const t=[...s.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{(o!==r||i.has(a))&&(n.push(t(o,a)),r=o)}),n}function eO(s,e,t){const i=s.imageMode==="sequence"?s.sequenceFrames[e]:void 0,n=(i==null?void 0:i.name)||s.textureName||`image_${s.id}`,r=(i==null?void 0:i.texture)||s.texture,o=Y3(r);(!o.width||!o.height)&&t.push({code:"missing-image",message:`图片“${n}”缺失或尺寸不可读,已保留路径。`});const a=o.width||1,l=o.height||1;return{path:tS(s.textureFolder,n),x:oi((.5-s.anchorX)*a),y:oi((s.anchorY-.5)*l),width:oi(a),height:oi(l)}}function fy(s,e){const t=[];for(const n of e){const r=n.imageMode==="sequence"?Math.max(1,n.sequenceFrames.length):1;for(let o=0;o1;return new Map(t.map((n,r)=>[n,i?`${s}_${r}`:s]))}function tO(s,e,t,i,n=i.keyframeCurve,r=new Set,o=new Set){if(!s.length)return[];const a=new Set;for(let d=1;d({frame:f,values:d})),c=1/255,h=n==="bezier"&&i.spineVersion!=="3.8"?Qw(l,[c,c,c,.01],a,r):{samples:Jw(l,[c,c,c,.01],a,r),controls:[]},u=h.samples.map(d=>{const f={time:sl(d.frame,t),color:`${_c(d.values[0])}${_c(d.values[1])}${_c(d.values[2])}${_c(d.values[3])}`};return r.has(d.frame)&&(f.curve="stepped"),f});if(h.controls.length)for(let d=0;d({time:sl(m,n),name:f??null}),l);h.length&&(c.attachment=h);const u=tO(i,t,n,r,o,a,l);u.length&&(c.rgba=u)}function py(s){var p;const e=s.settings,t=Math.max(1,Number(s.timeline.fps)||30),i=Math.max(1,Math.round(e.fps||30)),n=e.integerFrameAlignment?i:t,r=[],o=s.systems.filter(g=>g.visible!==!1),a=ha(s.systems),l={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||(l.skeleton.fps=i);const c=l.skins[0].attachments,h=new Set(["root"]),u=[...new Set([...s.timeline.animations.length?s.timeline.animations:["animation"],...o.map(g=>g.animation||"animation")])],d=new Map;for(const g of o){const x=((p=g.frames)==null?void 0:p.length)||0,v=a.has(g.id)?x:Math.min(x,G3(g,t)),y=(g.frames||[]).slice(0,v);y.length||r.push({code:"empty-cache",message:`“${g.config.name}”没有可用帧缓存。`});const w=eS(X3(g.config.name,`system_${g.id}`),h);l.bones.push({name:w,parent:"root"});const _=H3(y,e.bonePool,h,w),S=Math.max(0,(v-1)/t),b=Math.max(1,Math.ceil(S*n)+1),C=j3(g,t,n),A=d.get(g.animation)||[];A.push({system:g,tracks:_,targetFrames:b,boundaryFrames:C,attachmentPrefix:w}),d.set(g.animation,A);for(const P of _){l.bones.push({name:P.name,parent:w});const E=uy(g,P),R=new Set(E.map(X=>X.blend)),O=[],U=[];for(const X of R){const D=`${P.name}_${X}`;O.push(D),l.slots.push({name:D,bone:P.name,color:"ffffff00",blend:oy[X]});const k=c[D]||(c[D]={}),N=E.filter(V=>V.blend===X),F=fy(w,N);for(const V of N){const Y=V.imageMode==="sequence"?Math.max(1,V.sequenceFrames.length):1;for(let q=0;q{var q;return((q=Y==null?void 0:Y.trailState)==null?void 0:q.resourceId)===X.id}))continue;const D=Math.max(2,Math.min(16,Math.round(X.boneCount||3))),k=[];for(let Y=0;Yl.bones.findIndex(q=>q.name===Y)),V=tS("",X.textureName||`trail_${X.id}`);(c[N]||(c[N]={}))[`trail_${X.id}`]=$3(g.config,X,F,V),X.texture||r.push({code:"missing-image",message:`拖尾图片“${X.textureName||X.id}”缺失,已保留路径。`})}const G=new Set([...O,...U]),$=l.slots.filter(X=>G.has(String(X.name)));$.length&&(l.slots=l.slots.filter(X=>!$.includes(X)),l.slots.push(...$.filter(X=>U.includes(String(X.name))),...$.filter(X=>O.includes(String(X.name)))))}}for(const g of u){const x=d.get(g)||[],v={bones:{},slots:{}};let y=!1;for(const{system:w,tracks:_,targetFrames:S,boundaryFrames:b,attachmentPrefix:C}of x)for(const A of _){const P=Array.from({length:S},(z,se)=>W3(A,se,t,n)),E=P.map(z=>!!(z!=null&&z.active)),R=[],O=[],U=[];P.forEach((z,se)=>{z!=null&&z.active&&(R.push({frame:se,values:[z.worldX??z.x,z.worldY??z.y]}),O.push(z.worldRotation??z.rotation),U.push({frame:se,values:[z.worldScaleX??z.scaleX,z.worldScaleY??z.scaleY]}))});const G=U3(O),$=R.map((z,se)=>({frame:z.frame,values:[G[se]??0]})),X=z3(P);for(const z of b)X.add(z);const D=q3(P),k={},N=ko(R,n,["x","y"],[ay,ay],e,X,D),F=ko($,n,["value"],[cy],e,X,D),V=ko(U,n,["x","y"],[Tc,Tc],e,X,D);N.length&&(k.translate=N),F.length&&(k.rotate=F),V.length&&(k.scale=V),Object.keys(k).length&&(v.bones[A.name]=k,y=!0);const Y=uy(w,A),q=new Set(Y.map(z=>z.blend));for(const z of q){const se=Y.filter(W=>W.blend===z),oe=fy(C,se),de=[],ge=[];let he=16777215;for(let W=0;Wie.id===Z.resourceId):void 0,B=!!Z&&E[W]&&Z.imageVisible!==!1&&(L==null?void 0:L.blend)===z;Z&&(L==null?void 0:L.blend)===z&&(he=Z.colorHex);const j=B?oe.get(`${L.id}_${Z.imageFrameIndex??0}`):void 0;de.push(j??null),ge.push(hy(he,B?Z.alpha:0))}const fe=se.filter(W=>W.independentAlpha==="curve").map(W=>dy(W.alphaCurveMode,e)),H=fe.length?fe.includes("bezier")?"bezier":"linear":dy(w.config.alphaMode==="curve"?w.config.curveMode:void 0,e);my(v,`${A.name}_${z}`,de,ge,n,e,H,D,b),de.some(Boolean)&&(y=!0)}if(w.config.trail)for(const z of w.config.trailResources){const se=Math.max(2,Math.min(16,Math.round(z.boneCount||3))),oe=P.map(j=>{var ie;return((ie=j==null?void 0:j.trailState)==null?void 0:ie.resourceId)===z.id?j.trailState:void 0}),de=oe.find(j=>!!j);if(!de)continue;const ge=Z3(oe),he=K3(oe),fe=z.widthSizeMode==="random"?Math.max(1,Number(z.widthMin)||0,Number(z.widthMax)||0):Math.max(.001,Number(z.width)||100);let H=de;const W=oe.map(j=>(j&&(H=j),H));for(let j=0;j{const Ve=Ze==null?void 0:Ze.bones[Math.min(Ze.bones.length-1,j)];if(!Ve)return;const Ee={x:Ve.worldX??Ve.x,y:Ve.worldY??Ve.y,rotation:Ve.worldRotation??-Ve.rotation};ie.push({frame:nt,values:[Ee.x,Ee.y]}),ue.push({frame:nt,values:[Ee.rotation]}),me.push({frame:nt,values:[1,Math.max(0,Ze.width/fe)*Me]})});const be=`${A.name}_trail_${z.id}_${j}`,pe={},Ne=ko(ie,n,["x","y"],[ly,ly],e,ee,he),Ye=ko(ue,n,["value"],[cy],e,ee,he),st=ko(me,n,["x","y"],[Tc,Tc],e,ee,he);Ne.length&&(pe.translate=Ne),Ye.length&&(pe.rotate=Ye),st.length&&(pe.scale=st),Object.keys(pe).length&&(v.bones[be]=pe)}const Z=oe.map(()=>`trail_${z.id}`);let L=de.colorHex;const B=oe.map(j=>(j&&(L=j.colorHex),hy(L,j?j.alpha:0)));my(v,`${A.name}_trail_${z.id}`,Z,B,n,e,e.keyframeCurve,he,b),y=!0}}(y||!e.excludeEmptyAnimations)&&(l.animations[g]=v)}!Object.keys(l.animations).length&&!e.excludeEmptyAnimations&&(l.animations.animation={bones:{},slots:{}});const f=e.spineVersion==="3.8"?L3(l):l,m=JSON.stringify(f,null,2);return{json:f,text:m,warnings:r,particleSystemCount:o.length,animationCount:Object.keys(f.animations).length,boneCount:f.bones.length}}function iO(s,e){const t=new Blob([s.text],{type:"application/json;charset=utf-8"}),i=URL.createObjectURL(t),n=document.createElement("a");n.href=i,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(i),1e3)}class CV{constructor(){M(this,"array",[])}add(e){const t=this.contains(e);return this.array[e|0]=e|0,!t}contains(e){return this.array[e|0]!==void 0}remove(e){this.array[e|0]=void 0}clear(){this.array.length=0}}class sO{constructor(){M(this,"entries",{});M(this,"size",0)}add(e){const t=this.entries[e];return this.entries[e]=!0,t?!1:(this.size++,!0)}addAll(e){const t=this.size;for(let i=0,n=e.length;i1&&(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 ts){return t.setFromString(e)}};M(ts,"WHITE",new ts(1,1,1,1)),M(ts,"RED",new ts(1,0,0,1)),M(ts,"GREEN",new ts(0,1,0,1)),M(ts,"BLUE",new ts(0,0,1,1)),M(ts,"MAGENTA",new ts(1,0,1,1));let rt=ts;const Ht=class Ht{static clamp(e,t,i){return ei?i:e}static cosDeg(e){return Math.cos(e*Ht.degRad)}static sinDeg(e){return Math.sin(e*Ht.degRad)}static atan2Deg(e,t){return Math.atan2(e,t)*Ht.radDeg}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){const t=Math.pow(Math.abs(e),.3333333333333333);return e<0?-t:t}static randomTriangular(e,t){return Ht.randomTriangularWith(e,t,(e+t)*.5)}static randomTriangularWith(e,t,i){const n=Math.random(),r=t-e;return n<=(i-e)/r?e+Math.sqrt(n*r*(i-e)):t-Math.sqrt((1-n)*r*(t-i))}static isPowerOfTwo(e){return e&&(e&e-1)===0}};M(Ht,"epsilon",1e-5),M(Ht,"epsilon2",Ht.epsilon*Ht.epsilon),M(Ht,"PI",3.1415927),M(Ht,"PI2",Ht.PI*2),M(Ht,"invPI2",1/Ht.PI2),M(Ht,"radiansToDegrees",180/Ht.PI),M(Ht,"radDeg",Ht.radiansToDegrees),M(Ht,"degreesToRadians",Ht.PI/180),M(Ht,"degRad",Ht.degreesToRadians);let Ie=Ht;const ls=class ls{apply(e,t,i){return t===void 0||i===void 0?this.applyInternal(e):e+(t-e)*this.applyInternal(i)}};M(ls,"linear",new class extends ls{applyInternal(e){return e}}),M(ls,"smooth",new class extends ls{applyInternal(e){return e*e*(3-2*e)}}),M(ls,"slowFast",new class extends ls{applyInternal(e){return e*e}}),M(ls,"fastSlow",new class extends ls{applyInternal(e){return(e-1)*(e-1)*-1+1}}),M(ls,"circle",new class extends ls{applyInternal(e){return e<=.5?(e*=2,(1-Math.sqrt(1-e*e))/2):(e--,e*=2,(Math.sqrt(1-e*e)+1)/2)}});let oa=ls;class nO extends oa{constructor(t){super();M(this,"power",2);this.power=t}applyInternal(t){return t<=.5?Math.pow(t*2,this.power)/2:Math.pow((t-1)*2,this.power)/(this.power%2===0?-2:2)+1}}class EV extends nO{constructor(e){super(e)}applyInternal(e){return Math.pow(e-1,this.power)*(this.power%2===0?-1:1)+1}}const dr=class dr{static arrayCopy(e,t,i,n,r){for(let o=t,a=n;o=t?e:dr.setArraySize(e,t,i)}static newArray(e,t){const i=[];for(let n=0;n0?this.items.pop():this.instantiator()}free(e){var t;(t=e.reset)==null||t.call(e),this.items.push(e)}freeAll(e){for(let t=0;tthis.maxDelta&&(this.delta=this.maxDelta),this.lastTime=e,this.frameCount++,this.frameTime>1&&(this.framesPerSecond=this.frameCount/this.frameTime,this.frameTime=0,this.frameCount=0)}}class RV{constructor(e=32){M(this,"values");M(this,"addedValues",0);M(this,"lastValue",0);M(this,"mean",0);M(this,"dirty",!0);this.values=new Array(e)}hasEnoughData(){return this.addedValues>=this.values.length}addValue(e){this.addedValuesthis.values.length-1&&(this.lastValue=0),this.dirty=!0}getMean(){if(this.hasEnoughData()){if(this.dirty){let e=0;for(let t=0;t{h.width=parseInt(i[1]),h.height=parseInt(i[2])},n.format=()=>{},n.filter=h=>{h.minFilter=je.enumValue(ua,i[1]),h.magFilter=je.enumValue(ua,i[2])},n.repeat=h=>{i[1].indexOf("x")!==-1&&(h.uWrap=da.Repeat),i[1].indexOf("y")!==-1&&(h.vWrap=da.Repeat)},n.pma=h=>{h.pma=i[1]==="true"};var r={};r.xy=h=>{h.x=parseInt(i[1]),h.y=parseInt(i[2])},r.size=h=>{h.width=parseInt(i[1]),h.height=parseInt(i[2])},r.bounds=h=>{h.x=parseInt(i[1]),h.y=parseInt(i[2]),h.width=parseInt(i[3]),h.height=parseInt(i[4])},r.offset=h=>{h.offsetX=parseInt(i[1]),h.offsetY=parseInt(i[2])},r.orig=h=>{h.originalWidth=parseInt(i[1]),h.originalHeight=parseInt(i[2])},r.offsets=h=>{h.offsetX=parseInt(i[1]),h.offsetY=parseInt(i[2]),h.originalWidth=parseInt(i[3]),h.originalHeight=parseInt(i[4])},r.rotate=h=>{const u=i[1];u==="true"?h.degrees=90:u!=="false"&&(h.degrees=parseInt(u))},r.index=h=>{h.index=parseInt(i[1])};let o=t.readLine();for(;o&&o.trim().length===0;)o=t.readLine();for(;!(!o||o.trim().length===0||t.readEntry(i,o)===0);)o=t.readLine();let a=null,l=null,c=null;for(;o!==null;)if(o.trim().length===0)a=null,o=t.readLine();else if(a){const h=new sS(a,o);for(;;){const u=t.readEntry(i,o=t.readLine());if(u===0)break;const d=r[i[0]];if(d)d(h);else{l||(l=[]),c||(c=[]),l.push(i[0]);const f=[];for(let m=0;m0&&c&&c.length>0&&(h.names=l,h.values=c,l=null,c=null),h.u=h.x/a.width,h.v=h.y/a.height,h.degrees===90?(h.u2=(h.x+h.height)/a.width,h.v2=(h.y+h.width)/a.height):(h.u2=(h.x+h.width)/a.width,h.v2=(h.y+h.height)/a.height),this.regions.push(h)}else{for(a=new lO(o.trim());t.readEntry(i,o=t.readLine())!==0;){const h=n[i[0]];h&&h(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;const i=t.indexOf(":");if(i===-1)return 0;e[0]=t.substr(0,i).trim();for(let n=1,r=i+1;;n++){const 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 lO{constructor(e){M(this,"name");M(this,"minFilter",ua.Nearest);M(this,"magFilter",ua.Nearest);M(this,"uWrap",da.ClampToEdge);M(this,"vWrap",da.ClampToEdge);M(this,"texture",null);M(this,"width",0);M(this,"height",0);M(this,"pma",!1);M(this,"regions",[]);this.name=e}setTexture(e){this.texture=e,e.setFilters(this.minFilter,this.magFilter),e.setWraps(this.uWrap,this.vWrap);for(const t of this.regions)t.texture=e}}class sS extends iS{constructor(t,i){super();M(this,"page");M(this,"name");M(this,"x",0);M(this,"y",0);M(this,"offsetX",0);M(this,"offsetY",0);M(this,"originalWidth",0);M(this,"originalHeight",0);M(this,"index",0);M(this,"degrees",0);M(this,"names",null);M(this,"values",null);this.page=t,this.name=i,t.regions.push(this)}}const Nh=class Nh{constructor(e){M(this,"name");M(this,"timelineAttachment");M(this,"timelineSlots",Nh.empty);if(!e)throw new Error("name cannot be null.");this.name=e,this.timelineAttachment=this}isTimelineActive(e,t,i){let n=e[t];if(n.bone.isActive()){const r=(i?n.getAppliedPose():n.getPose()).getAttachment();if(r!=null&&r.timelineAttachment===this)return!0}for(let r=0,o=this.timelineSlots.length;r>1)*l;const c=i.appliedPose.deform;let h=this.vertices;const u=this.bones;if(!u){c.length>0&&(h=c);const p=i.bone.appliedPose,g=p.worldX,x=p.worldY,v=p.a,y=p.b,w=p.c,_=p.d;for(let S=n,b=a;b=this.regions.length&&(t=this.regions.length-1),t}getUVs(e){return this.uvs[e]}hasPathSuffix(){return this.pathSuffix}getPath(e,t){if(!this.pathSuffix)return e;let i=e;const n=(this.start+t).toString();for(let r=this.digits-n.length;r>0;r--)i+="0";return i+=n,i}static nextID(){return Go._nextID++}};M(Go,"_nextID",0);let ma=Go;var _i;(function(s){s[s.hold=0]="hold",s[s.once=1]="once",s[s.loop=2]="loop",s[s.pingpong=3]="pingpong",s[s.onceReverse=4]="onceReverse",s[s.loopReverse=5]="loopReverse",s[s.pingpongReverse=6]="pingpongReverse"})(_i||(_i={}));const nS=[_i.hold,_i.once,_i.loop,_i.pingpong,_i.onceReverse,_i.loopReverse,_i.pingpongReverse];class Lp{constructor(e,t,i){M(this,"name");M(this,"timelines",[]);M(this,"timelineIds");M(this,"bones");M(this,"color",new rt(1,1,1,1));M(this,"duration");if(!e)throw new Error("name cannot be null.");this.name=e,this.duration=i,this.timelineIds=new sO,this.bones=[],this.setTimelines(t)}setTimelines(e){if(!e)throw new Error("timelines cannot be null.");this.timelines=e;const t=e.length;this.timelineIds.clear(),this.bones.length=0;const i=new Set,n=e;for(let r=0;r0&&(t%=this.duration));const u=this.timelines;for(let d=0,f=u.length;dt)return r-i;return n-i}};function cO(s){return typeof s=="object"&&s!==null&&typeof s.slotIndex=="number"}class bo extends Bt{constructor(t,i,...n){super(t,...n);M(this,"curves");this.curves=je.newFloatArray(t+i*18),this.curves[t-1]=1}setLinear(t){this.curves[t]=0}setStepped(t){this.curves[t]=1}shrink(t){const i=this.getFrameCount()+t*18;if(this.curves.length>i){const n=je.newFloatArray(i);je.arrayCopy(this.curves,0,n,0,i),this.curves=n}}setBezier(t,i,n,r,o,a,l,c,h,u,d){const f=this.curves;let m=this.getFrameCount()+t*18;n===0&&(f[i]=2+m);const p=(r-a*2+c)*.03,g=(o-l*2+h)*.03,x=((a-c)*3-r+u)*.006,v=((l-h)*3-o+d)*.006;let y=p*2+x,w=g*2+v,_=(a-r)*.3+p+x*.16666667,S=(l-o)*.3+g+v*.16666667,b=r+_,C=o+S;for(let A=m+18;mt){const h=this.frames[i],u=this.frames[i+n];return u+(t-h)/(o[r]-h)*(o[r+1]-u)}const a=r+18;for(r+=2;r=t){const h=o[r-2],u=o[r-1];return u+(t-h)/(o[r]-h)*(o[r+1]-u)}i+=this.getFrameEntries();const l=o[a-2],c=o[a-1];return c+(t-l)/(this.frames[i]-l)*(this.frames[i+n]-c)}}class Bn extends bo{constructor(e,t,i){super(e,t,i)}getFrameEntries(){return 2}setFrame(e,t,i){e<<=1,this.frames[e]=t,this.frames[e+1]=i}getCurveValue(e){const t=this.frames;let i=t.length-2;for(let r=2;r<=i;r+=2)if(t[r]>e){i=r-2;break}const n=this.curves[i>>1];switch(n){case 0:{const r=t[i],o=t[i+1];return o+(e-r)/(t[i+2]-r)*(t[i+2+1]-o)}case 1:return t[i+1]}return this.getBezierValue(e,i,1,n-2)}getRelativeValue(e,t,i,n,r,o){if(e>2];switch(f){case 0:{const m=u[d];l=u[d+1],c=u[d+2],h=u[d+3];const p=(i-m)/(u[d+4]-m);l+=(u[d+4+1]-l)*p,c+=(u[d+4+2]-c)*p,h+=(u[d+4+3]-h)*p;break}case 1:l=u[d+1],c=u[d+2],h=u[d+3];break;default:l=this.getBezierValue(i,d,1,f-2),c=this.getBezierValue(i,d,2,f+18-2),h=this.getBezierValue(i,d,3,f+36-2)}if(n!==1)if(r===Xe.setup){const m=e.data.setupPose.color;l=m.r+(l-m.r)*n,c=m.g+(c-m.g)*n,h=m.b+(h-m.b)*n}else l=a.r+(l-a.r)*n,c=a.g+(c-a.g)*n,h=a.b+(h-a.b)*n;a.r=l<0?0:l>1?1:l,a.g=c<0?0:c>1?1:c,a.b=h<0?0:h>1?1:h}}class vS extends Bn{constructor(t,i,n){super(t,i,`${it.alpha}|${n}`);M(this,"slotIndex",0);this.slotIndex=n}apply(t,i,n,r,o,a,l,c,h){const u=t.slots[this.slotIndex];if(!u.bone.active)return;const d=(h?u.appliedPose:u.pose).color;let f=0;const m=this.frames;if(n1?1:f}}class yS extends xu{constructor(e,t,i){super(e,t,i,`${it.rgb}|${i}`,`${it.alpha}|${i}`,`${it.rgb2}|${i}`)}getFrameEntries(){return 8}setFrame(e,t,i,n,r,o,a,l,c){e<<=3,this.frames[e]=t,this.frames[e+1]=i,this.frames[e+2]=n,this.frames[e+3]=r,this.frames[e+4]=o,this.frames[e+5]=a,this.frames[e+6]=l,this.frames[e+7]=c}apply1(e,t,i,n,r,o){const a=t.color,l=t.darkColor;let c=0,h=0,u=0;const d=this.frames;if(i>3];switch(v){case 0:{const y=d[x];f=d[x+1],m=d[x+2],p=d[x+3],g=d[x+4],c=d[x+5],h=d[x+6],u=d[x+7];const w=(i-y)/(d[x+8]-y);f+=(d[x+8+1]-f)*w,m+=(d[x+8+2]-m)*w,p+=(d[x+8+3]-p)*w,g+=(d[x+8+4]-g)*w,c+=(d[x+8+5]-c)*w,h+=(d[x+8+6]-h)*w,u+=(d[x+8+7]-u)*w;break}case 1:f=d[x+1],m=d[x+2],p=d[x+3],g=d[x+4],c=d[x+5],h=d[x+6],u=d[x+7];break;default:f=this.getBezierValue(i,x,1,v-2),m=this.getBezierValue(i,x,2,v+18-2),p=this.getBezierValue(i,x,3,v+36-2),g=this.getBezierValue(i,x,4,v+54-2),c=this.getBezierValue(i,x,5,v+72-2),h=this.getBezierValue(i,x,6,v+90-2),u=this.getBezierValue(i,x,7,v+108-2)}if(n===1)a.set(f,m,p,g);else if(r===Xe.setup){const y=e.data.setupPose;let w=y.color;a.set(w.r+(f-w.r)*n,w.g+(m-w.g)*n,w.b+(p-w.b)*n,w.a+(g-w.a)*n),w=y.darkColor,c=w.r+(c-w.r)*n,h=w.g+(h-w.g)*n,u=w.b+(u-w.b)*n}else a.add((f-a.r)*n,(m-a.g)*n,(p-a.b)*n,(g-a.a)*n),c=l.r+(c-l.r)*n,h=l.g+(h-l.g)*n,u=l.b+(u-l.b)*n;l.r=c<0?0:c>1?1:c,l.g=h<0?0:h>1?1:h,l.b=u<0?0:u>1?1:u}}class xS extends xu{constructor(e,t,i){super(e,t,i,`${it.rgb}|${i}`,`${it.rgb2}|${i}`)}getFrameEntries(){return 7}setFrame(e,t,i,n,r,o,a,l){e*=7,this.frames[e]=t,this.frames[e+1]=i,this.frames[e+2]=n,this.frames[e+3]=r,this.frames[e+4]=o,this.frames[e+5]=a,this.frames[e+6]=l}apply1(e,t,i,n,r,o){const a=t.color,l=t.darkColor;let c=0,h=0,u=0,d=0,f=0,m=0;const p=this.frames;if(i1?1:c,a.g=h<0?0:h>1?1:h,a.b=u<0?0:u>1?1:u,l.r=d<0?0:d>1?1:d,l.g=f<0?0:f>1?1:f,l.b=m<0?0:m>1?1:m}}class nl extends Bt{constructor(t,i){super(t,`${it.attachment}|${i}`);M(this,"slotIndex",0);M(this,"attachmentNames");this.slotIndex=i,this.attachmentNames=new Array(t),this.instant=!0}getFrameCount(){return this.frames.length}setFrame(t,i,n){this.frames[t]=i,this.attachmentNames[t]=n}apply(t,i,n,r,o,a,l,c,h){const u=t.slots[this.slotIndex];if(!u.bone.active)return;const d=h?u.appliedPose:u.pose;c||nt){const c=this.frames[i];return n[r+1]*(t-c)/(n[r]-c)}const o=r+18;for(r+=2;r=t){const c=n[r-2],h=n[r-1];return h+(t-c)/(n[r]-c)*(n[r+1]-h)}const a=n[o-2],l=n[o-1];return l+(1-l)*(t-a)/(this.frames[i+this.getFrameEntries()]-a)}apply(t,i,n,r,o,a,l,c,h){const u=t.slots;if(!this.attachment.isTimelineActive(u,this.slotIndex,h))return;const d=this.attachment.timelineSlots,f=this.frames;if(n=f[f.length-1])g=0,m=this.vertices[f.length-1],p=null;else{const v=Bt.search(f,n);g=this.getCurvePercent(n,v),m=this.vertices[v],p=this.vertices[v+1]}const x=this.vertices[0].length;this.applyToSlot(u[this.slotIndex],h,m,p,g,x,o,a,l);for(const v of d)this.applyToSlot(u[v],h,m,p,g,x,o,a,l)}applyBeforeFirst(t,i,n,r){if(!t.bone.active)return;const o=i?t.appliedPose:t.pose;if(o.attachment==null||o.attachment.timelineAttachment!==this.attachment)return;const a=o.deform;switch(a.length===0&&(r=Xe.setup),r){case Xe.setup:a.length=0;break;case Xe.first:{if(n===1){a.length=0;return}const l=this.vertices[0].length;a.length=l;const c=a,h=o.attachment;if(h.bones===null){const u=h.vertices;for(let d=0;d>4,h=l.attachment.sequence.regions.length;const u=nS[o&15];if(u!==_i.hold)switch(c+=(n-r)/a+1e-5|0,u){case _i.once:c=Math.min(h-1,c);break;case _i.loop:c%=h;break;case _i.pingpong:{const d=(h<<1)-2;c=d===0?0:c%d,c>=h&&(c=d-c);break}case _i.onceReverse:c=Math.max(h-1-c,0);break;case _i.loopReverse:c=h-1-c%h;break;case _i.pingpongReverse:{const d=(h<<1)-2;c=d===0?0:(c+h-1)%d,c>=h&&(c=d-c)}}l.sequenceIndex=c}};M(cs,"ENTRIES",3),M(cs,"MODE",1),M(cs,"DELAY",2);let Fh=cs;const Uh=class Uh extends Bt{constructor(t){super(t,...Uh.propertyIds);M(this,"events");this.events=new Array(t),this.instant=!0}getFrameCount(){return this.frames.length}setFrame(t,i){this.frames[t]=i.time,this.events[t]=i}apply(t,i,n,r,o,a,l,c,h){if(!r)return;const u=this.frames,d=this.frames.length;if(i>n)this.apply(null,i,Number.MAX_VALUE,r,0,a,!1,!1,!1),i=-1;else if(i>=u[d-1])return;if(n0&&u[f-1]===m;)f--}for(;f=u[f];f++)r.push(this.events[f])}};M(Uh,"propertyIds",[`${it.event}`]);let Tl=Uh;const jo=class jo extends Bt{constructor(t){super(t,...jo.propertyIds);M(this,"drawOrders");this.drawOrders=new Array(t),this.instant=!0}getFrameCount(){return this.frames.length}setFrame(t,i,n){this.frames[t]=i,this.drawOrders[t]=n}apply(t,i,n,r,o,a,l,c,h){const u=h?t.drawOrder.appliedPose:t.drawOrder.pose,d=t.slots;if(c||n>2];switch(v){case 0:{const w=f[x];m=f[x+1],p=f[x+2],g=f[x+3];const _=(n-w)/(f[x+4]-w);m+=(f[x+4+1]-m)*_,p+=(f[x+4+2]-p)*_,g+=(f[x+4+3]-g)*_;break}case 1:m=f[x+1],p=f[x+2],g=f[x+3];break;default:m=this.getBezierValue(n,x,1,v-2),p=this.getBezierValue(n,x,2,v+18-2),g=this.getBezierValue(n,x,3,v+36-2)}const y=a===Xe.setup?u.data.setupPose:d;l?(d.mixRotate=y.mixRotate+m*o,d.mixX=y.mixX+p*o,d.mixY=y.mixY+g*o):(d.mixRotate=y.mixRotate+(m-y.mixRotate)*o,d.mixX=y.mixX+(p-y.mixX)*o,d.mixY=y.mixY+(g-y.mixY)*o)}}class kr extends Ll{constructor(e,t,i,n){super(e,t,i,n)}apply(e,t,i,n,r,o,a,l,c){if(a&&!this.additive&&(a=!1),this.constraintIndex===-1){const h=i>=this.frames[0]?this.getCurveValue(i):0,u=e.physics;for(const d of u)if(d.active&&this.global(d.data)){const f=c?d.appliedPose:d.pose;this.set(f,this.getAbsoluteValue(i,r,o,a,this.get(f),this.get(d.data.setupPose),h))}}else{const h=e.constraints[this.constraintIndex];if(h.active){const u=c?h.appliedPose:h.pose;this.set(u,this.getAbsoluteValue(i,r,o,a,this.get(u),this.get(h.data.setupPose)))}}}}class CS extends kr{constructor(e,t,i){super(e,t,i,it.physicsConstraintInertia)}get(e){return e.inertia}set(e,t){e.inertia=t}global(e){return e.inertiaGlobal}}class ES extends kr{constructor(e,t,i){super(e,t,i,it.physicsConstraintStrength)}get(e){return e.strength}set(e,t){e.strength=t}global(e){return e.strengthGlobal}}class AS extends kr{constructor(e,t,i){super(e,t,i,it.physicsConstraintDamping)}get(e){return e.damping}set(e,t){e.damping=t}global(e){return e.dampingGlobal}}class IS extends kr{constructor(e,t,i){super(e,t,i,it.physicsConstraintMass)}get(e){return 1/e.massInverse}set(e,t){e.massInverse=1/t}global(e){return e.massGlobal}}class RS extends kr{constructor(e,t,i){super(e,t,i,it.physicsConstraintWind),this.additive=!0}get(e){return e.wind}set(e,t){e.wind=t}global(e){return e.windGlobal}}class PS extends kr{constructor(e,t,i){super(e,t,i,it.physicsConstraintGravity),this.additive=!0}get(e){return e.gravity}set(e,t){e.gravity=t}global(e){return e.gravityGlobal}}class kS extends kr{constructor(e,t,i){super(e,t,i,it.physicsConstraintMix)}get(e){return e.mix}set(e,t){e.mix=t}global(e){return e.mixGlobal}}const $h=class $h extends Bt{constructor(t,i){super(t,...$h.propertyIds);M(this,"constraintIndex");this.constraintIndex=i,this.instant=!0}getFrameCount(){return this.frames.length}setFrame(t,i){this.frames[t]=i}apply(t,i,n,r,o,a,l,c,h){let u;if(this.constraintIndex!==-1&&(u=t.constraints[this.constraintIndex],!u.active))return;const d=this.frames;if(i>n)this.apply(t,i,Number.MAX_VALUE,[],o,a,!1,!1,!1),i=-1;else if(i>=d[d.length-1])return;if(!(n=d[Bt.search(d,i)+1]))if(u!=null)u.reset(t);else for(const f of t.physics)f.active&&f.reset(t)}};M($h,"propertyIds",[it.physicsConstraintReset.toString()]);let Oh=$h;class FS extends Ll{constructor(e,t,i){super(e,t,i,it.sliderTime)}apply(e,t,i,n,r,o,a,l,c){const h=e.constraints[this.constraintIndex];if(h.active){const u=c?h.appliedPose:h.pose;u.time=this.getAbsoluteValue(i,r,o,a,u.time,h.data.setupPose.time)}}}class OS extends Ll{constructor(e,t,i){super(e,t,i,it.sliderMix),this.additive=!0}apply(e,t,i,n,r,o,a,l,c){const h=e.constraints[this.constraintIndex];if(h.active){const u=c?h.appliedPose:h.pose;u.mix=this.getAbsoluteValue(i,r,o,a,u.mix,h.data.setupPose.mix)}}}const al=class al{constructor(e){M(this,"data");M(this,"tracks",[]);M(this,"timeScale",1);M(this,"unkeyedState",0);M(this,"events",[]);M(this,"listeners",[]);M(this,"queue",new fO(this));M(this,"propertyIds",new Map);M(this,"animationsChanged",!1);M(this,"trackEntryPool",new rO(()=>new dO));this.data=e}update(e){e*=this.timeScale;const t=this.tracks;for(let i=0,n=t.length;i0){if(r.delay-=o,r.delay>0)continue;o=-r.delay,r.delay=0}let a=r.next;if(a){const l=r.trackLast-a.delay;if(l>=0){for(a.delay=0,a.trackTime+=r.timeScale===0?0:(l/r.timeScale+e)*a.timeScale,r.trackTime+=o,this.setTrack(i,a,!0);a.mixingFrom;)a.mixTime+=e,a=a.mixingFrom;continue}}else if(r.trackLast>=r.trackEnd&&!r.mixingFrom){t[i]=null,this.queue.end(r),this.clearNext(r);continue}if(r.mixingFrom&&this.updateMixingFrom(r,e)){let l=r.mixingFrom;for(r.mixingFrom=null,l&&(l.mixingTo=null);l;)this.queue.end(l),l=l.mixingFrom}r.trackTime+=o}this.queue.drain()}updateMixingFrom(e,t){const i=e.mixingFrom;if(!i)return!0;const n=this.updateMixingFrom(i,t);if(i.animationLast=i.nextAnimationLast,i.trackLast=i.nextTrackLast,e.nextTrackLast!==-1&&e.mixTime>=e.mixDuration){if(i.totalAlpha===0||e.mixDuration===0){if(e.mixingFrom=i.mixingFrom,i.mixingFrom!=null&&(i.mixingFrom.mixingTo=e),i.totalAlpha===0)for(let r=e;r.mixingTo!=null;r=r.mixingTo)r.keepHold=!0;this.queue.end(i)}return n}return i.trackTime+=t*i.timeScale,e.mixTime+=t,!1}apply(e){if(!e)throw new Error("skeleton cannot be null.");this.animationsChanged&&this._animationsChanged();const t=this.events,i=this.tracks;let n=!1;for(let a=0,l=i.length;a0)continue;n=!0;let h=c.alpha;c.mixingFrom?h*=this.applyMixingFrom(c,e):c.trackTime>=c.trackEnd&&!c.next&&(h=0);let u=c.animationLast,d=c.getAnimationTime(),f=d,m=t;c.reverse&&(f=c.animation.duration-f,m=null);const p=c.animation.timelines,g=p.length;if(a===0&&h===1)for(let x=0;x=c.alphaAttachmentThreshold,y=c.additive,w=y||c.shortestRotation,_=!w&&c.timelinesRotation.length!==g<<1;_&&(c.timelinesRotation.length=g<<1);for(let S=0;S0?l/a:o,h=i.animation.timelines,u=h.length,d=i.timelineMode,f=i.timelineHoldMix,m=r=i.alphaAttachmentThreshold);else{const O=!p||!(A instanceof _r)||E===Xe.current;A.apply(t,w,S,b,R,E,g,O,!1)}}return i.reverse&&r0&&this.queueEvents(i,_),this.events.length=0,i.nextAnimationLast=_,i.nextTrackLast=i.trackTime,r}applyAttachmentTimeline(e,t,i,n,r){const o=t.slots[e.slotIndex];if(!o.bone.active||!r&&o.attachmentState===this.unkeyedState+Sy)return;let a=i=0,_=x>=0;Math.abs(v)<=90&&Ie.signum(v)!==Ie.signum(g)&&(Math.abs(x-y)>180?(p+=360*Ie.signum(x),_=w):y!==0?p-=360*Ie.signum(x):_=w),_!==w&&(p+=360*Ie.signum(x)),o[a]=p}o[a+1]=g,h.rotation=f+p*n}queueEvents(e,t){const i=e.animationStart,n=e.animationEnd,r=n-i,o=e.reverse;let a=e.trackLast%r;o&&(a=r-a);const l=this.events;let c=0,h=l.length;for(;c=i&&d.time<=n&&this.queue.event(e,d)}let u=!1;if(e.loop)if(r===0)u=!0;else{const d=Math.floor(e.trackTime/r);u=d>0&&d>Math.floor(e.trackLast/r)}else u=t>=n&&e.animationLast=i&&d.time<=n&&this.queue.event(e,d)}}eventsReverse(e,t,i){const n=e.animation.duration,r=n-t,o=n-i,a=e.animation.timelines;for(let l=0,c=e.animation.timelines.length;l=o){for(let m=0;m=r)break;this.events.push(u[m])}}else{for(let p=0;p=r);p++)this.events.push(u[p]);let m=0;for(;m=o);m++);for(;m= 0.");if(e>=this.tracks.length)return;const t=this.tracks[e];if(!t)return;this.queue.end(t),this.clearNext(t);let i=t;for(;;){const n=i.mixingFrom;if(!n)break;this.queue.end(n),i.mixingFrom=null,i.mixingTo=null,i=n}this.tracks[t.trackIndex]=null,this.queue.drain()}setTrack(e,t,i){const n=this.expandToIndex(e);this.tracks[e]=t,t.previous=null,n&&(n.next=null,i&&this.queue.interrupt(n),t.mixingFrom=n,n.mixingTo=t,t.mixTime=0,n.timelinesRotation.length=0),this.queue.start(t)}setAnimation(e,t,i=!1){return typeof t=="string"?this.setAnimation1(e,t,i):this.setAnimation2(e,t,i)}setAnimation1(e,t,i=!1){const n=this.data.skeletonData.findAnimation(t);if(!n)throw new Error(`Animation not found: ${t}`);return this.setAnimation2(e,n,i)}setAnimation2(e,t,i=!1){if(e<0)throw new Error("trackIndex must be >= 0.");if(!t)throw new Error("animation cannot be null.");let n=!0,r=this.expandToIndex(e);r&&(r.nextTrackLast===-1&&r.animation===t?(this.tracks[e]=r.mixingFrom,this.queue.interrupt(r),this.queue.end(r),this.clearNext(r),r=r.mixingFrom,n=!1):this.clearNext(r));const o=this.trackEntry(e,t,i,r);return this.setTrack(e,o,n),this.queue.drain(),o}addAnimation(e,t,i=!1,n=0){return typeof t=="string"?this.addAnimation1(e,t,i,n):this.addAnimation2(e,t,i,n)}addAnimation1(e,t,i=!1,n=0){const r=this.data.skeletonData.findAnimation(t);if(!r)throw new Error(`Animation not found: ${t}`);return this.addAnimation2(e,r,i,n)}addAnimation2(e,t,i=!1,n=0){if(e<0)throw new Error("trackIndex must be >= 0.");if(!t)throw new Error("animation cannot be null.");let r=this.expandToIndex(e);if(r)for(;r.next;)r=r.next;const o=this.trackEntry(e,t,i,r);return r?(r.next=o,o.previous=r,n<=0&&(n=Math.max(n+r.getTrackComplete()-o.mixDuration,0))):(this.setTrack(e,o,!0),this.queue.drain(),n<0&&(n=0)),o.delay=n,o}setEmptyAnimation(e,t=0){const i=this.setAnimation(e,al.emptyAnimation,!1);return i.mixDuration=t,i.trackEnd=t,i}addEmptyAnimation(e,t=0,i=0){const n=this.addAnimation(e,al.emptyAnimation,!1,i);return i<=0&&(n.delay=Math.max(n.delay+n.mixDuration-t,0)),n.mixDuration=t,n.trackEnd=t,n}setEmptyAnimations(e=0){const t=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(let i=0,n=this.tracks.length;i0&&(o[d]=x);break}}l&&(g=g&~Cc|r[d]&Cc),r[d]=g}}from(e,t,i){const n=this.propertyIds;let r=mO;for(let o=0,a=i.length;o= 0.");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){const t=this.listeners.indexOf(e);t>=0&&this.listeners.splice(t,1)}clearListeners(){this.listeners.length=0}clearListenerNotifications(){this.queue.clear()}};M(al,"emptyAnimation",new Lp("",[],0));let vy=al;class dO{constructor(){M(this,"animation",null);M(this,"previous",null);M(this,"next",null);M(this,"mixingFrom",null);M(this,"mixingTo",null);M(this,"listener",null);M(this,"trackIndex",0);M(this,"loop",!1);M(this,"additive",!1);M(this,"reverse",!1);M(this,"shortestRotation",!1);M(this,"keepHold",!1);M(this,"eventThreshold",0);M(this,"mixAttachmentThreshold",0);M(this,"alphaAttachmentThreshold",0);M(this,"mixDrawOrderThreshold",0);M(this,"animationStart",0);M(this,"animationEnd",0);M(this,"animationLast",0);M(this,"nextAnimationLast",0);M(this,"delay",0);M(this,"trackTime",0);M(this,"trackLast",0);M(this,"nextTrackLast",0);M(this,"trackEnd",0);M(this,"timeScale",0);M(this,"alpha",0);M(this,"mixTime",0);M(this,"mixDuration",0);M(this,"totalAlpha",0);M(this,"mixInterpolation",oa.linear);M(this,"timelineMode",[]);M(this,"timelineHoldMix",[]);M(this,"timelinesRotation",[])}setMixDuration(e,t){this.mixDuration=e,t!==void 0&&(t<=0&&(t=this.previous==null?0:Math.max(t+this.previous.getTrackComplete()-e,0)),this.delay=t)}setMixInterpolation(e){if(!e)throw new Error("mixInterpolation cannot be null.");this.mixInterpolation=e}mix(){if(this.mixDuration===0)return 1;let e=this.mixTime/this.mixDuration;return e>=1?1:this.mixInterpolation===oa.linear?e:(e=this.mixInterpolation.apply(e),e<0?0:e>1?1:e)}reset(){this.next=null,this.previous=null,this.mixingFrom=null,this.mixingTo=null,this.mixInterpolation=oa.linear,this.animation=null,this.listener=null,this.timelineMode.length=0,this.timelineHoldMix.length=0,this.timelinesRotation.length=0}getAnimationTime(){if(!this.loop)return Math.min(this.trackTime+this.animationStart,this.animationEnd);const e=this.animationEnd-this.animationStart;return e===0?this.animationStart:this.trackTime%e+this.animationStart}setAnimationLast(e){this.animationLast=e,this.nextAnimationLast=e}isComplete(){return this.trackTime>=this.animationEnd-this.animationStart}resetRotationDirections(){this.timelinesRotation.length=0}getTrackComplete(){const e=this.animationEnd-this.animationStart;if(e!==0){if(this.loop)return e*(1+(this.trackTime/e|0));if(this.trackTime=0}}class fO{constructor(e){M(this,"objects",[]);M(this,"drainDisabled",!1);M(this,"animState");this.animState=e}start(e){this.objects.push(zi.start),this.objects.push(e),this.animState.animationsChanged=!0}interrupt(e){this.objects.push(zi.interrupt),this.objects.push(e)}end(e){this.objects.push(zi.end),this.objects.push(e),this.animState.animationsChanged=!0}dispose(e){this.objects.push(zi.dispose),this.objects.push(e)}complete(e){this.objects.push(zi.complete),this.objects.push(e)}event(e,t){this.objects.push(zi.event),this.objects.push(e),this.objects.push(t)}drain(){var e,t,i,n,r,o;if(!this.drainDisabled){this.drainDisabled=!0;for(let a=0;a= 0.");if(!i)throw new Error("name cannot be null.");this.index=t,this.parent=n}copy(t){const i=new wu(this.index,this.name,t);return i.length=this.length,i.setupPose.set(this.setupPose),i}}var zt;(function(s){s[s.Normal=0]="Normal",s[s.OnlyTranslation=1]="OnlyTranslation",s[s.NoRotationOrReflection=2]="NoRotationOrReflection",s[s.NoScale=3]="NoScale",s[s.NoScaleOrReflection=4]="NoScaleOrReflection"})(zt||(zt={}));class Pm{constructor(){M(this,"bone");M(this,"x",0);M(this,"y",0);M(this,"rotation",0);M(this,"scaleX",0);M(this,"scaleY",0);M(this,"shearX",0);M(this,"shearY",0);M(this,"inherit",zt.Normal);M(this,"a",0);M(this,"b",0);M(this,"c",0);M(this,"d",0);M(this,"worldY",0);M(this,"worldX",0);M(this,"world",0);M(this,"local",0)}set(e){if(e==null)throw new Error("pose cannot be null.");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}setPosition(e,t){this.x=e,this.y=t}setScale(e,t){this.scaleX=e,this.scaleY=t===void 0?e:t}getInherit(){return this.inherit}setInherit(e){if(e==null)throw new Error("inherit cannot be null.");this.inherit=e}update(e,t){this.world!==e._update&&this.updateWorldTransform(e)}updateWorldTransform(e){this.local===e._update?this.updateLocalTransform(e):this.world=e._update;const t=this.rotation,i=this.scaleX,n=this.scaleY,r=this.shearX,o=this.shearY;if(!this.bone.parent){const d=e.scaleX,f=e.scaleY,m=(t+r)*Ie.degRad,p=(t+90+o)*Ie.degRad;this.a=Math.cos(m)*i*d,this.b=Math.cos(p)*n*d,this.c=Math.sin(m)*i*f,this.d=Math.sin(p)*n*f,this.worldX=this.x*d+e.x,this.worldY=this.y*f+e.y;return}const a=this.bone.parent.appliedPose;let l=a.a,c=a.b,h=a.c,u=a.d;switch(this.worldX=l*this.x+c*this.y+a.worldX,this.worldY=h*this.x+u*this.y+a.worldY,this.inherit){case zt.Normal:{const d=(t+r)*Ie.degRad,f=(t+90+o)*Ie.degRad,m=Math.cos(d)*i,p=Math.cos(f)*n,g=Math.sin(d)*i,x=Math.sin(f)*n;this.a=l*m+c*g,this.b=l*p+c*x,this.c=h*m+u*g,this.d=h*p+u*x;return}case zt.OnlyTranslation:{const d=e.scaleX,f=e.scaleY,m=(t+r)*Ie.degRad,p=(t+90+o)*Ie.degRad;this.a=Math.cos(m)*i*d,this.b=Math.cos(p)*n*d,this.c=Math.sin(m)*i*f,this.d=Math.sin(p)*n*f;break}case zt.NoRotationOrReflection:{const d=e.scaleX,f=e.scaleY,m=1/d,p=1/f;l*=m,h*=p;let g=l*l+h*h,x=0;g>Ie.epsilon2?(g=Math.abs(l*u*p-c*m*h)/g,c=h*g,u=l*g,x=t-Ie.atan2Deg(h,l)):(l=0,h=0,x=t-90+Ie.atan2Deg(u,c));const v=(x+r)*Ie.degRad,y=(x+o+90)*Ie.degRad,w=Math.cos(v)*i,_=Math.cos(y)*n,S=Math.sin(v)*i,b=Math.sin(y)*n;this.a=(l*w-c*S)*d,this.b=(l*_-c*b)*d,this.c=(h*w+u*S)*f,this.d=(h*_+u*b)*f;break}case zt.NoScale:case zt.NoScaleOrReflection:{const d=e.scaleX,f=e.scaleY,m=1/d,p=1/f,g=t*Ie.degRad,x=Math.cos(g),v=Math.sin(g);let y=(l*x+c*v)*m,w=(h*x+u*v)*p;const _=1/Math.sqrt(y*y+w*w);y*=_,w*=_;let S=-w,b=y;this.inherit===zt.NoScale&&l*u-c*h<0!=(d<0!=f<0)&&(S=-S,b=-b);const C=r*Ie.degRad,A=(90+o)*Ie.degRad,P=Math.cos(C)*i,E=Math.cos(A)*n,R=Math.sin(C)*i,O=Math.sin(A)*n;this.a=(y*P+S*R)*d,this.b=(y*E+S*O)*d,this.c=(w*P+b*R)*f,this.d=(w*E+b*O)*f;break}}}updateLocalTransform(e){this.local=0,this.world=e._update;const t=e.scaleX,i=e.scaleY;if(!this.bone.parent){const x=1/t,v=1/i;this.x=(this.worldX-e.x)*x,this.y=(this.worldY-e.y)*v,this.set5(this.a*x,this.b*x,this.c*v,this.d*v,0);return}const n=this.bone.parent.appliedPose;let r=n.a,o=n.b,a=n.c,l=n.d;const c=r*l-o*a,h=1/(r*l-o*a),u=l*h,d=o*h,f=a*h,m=r*h,p=this.worldX-n.worldX,g=this.worldY-n.worldY;switch(this.x=p*u-g*d,this.y=g*m-p*f,this.inherit){case zt.Normal:this.set5(u*this.a-d*this.c,u*this.b-d*this.d,m*this.c-f*this.a,m*this.d-f*this.b,0);break;case zt.OnlyTranslation:{const x=1/t,v=1/i;this.set5(this.a*x,this.b*x,this.c*v,this.d*v,0);break}case zt.NoRotationOrReflection:{const x=1/t,v=1/i;r*=x,a*=v;const y=this.a*x,w=this.b*x,_=this.c*v,S=this.d*v,b=1/(r*r+a*a),C=1/Math.abs(c*x*v);this.set5((r*y+a*_)*b,(r*w+a*S)*b,(r*_-a*y)*C,(r*S-a*w)*C,Ie.atan2Deg(a,r));break}case zt.NoScale:case zt.NoScaleOrReflection:{const x=1/t,v=1/i,y=this.a*x,w=this.b*x,_=this.c*v,S=this.d*v;let b=l*this.a-o*this.c,C=r*this.c-a*this.a;c<0&&(b=-b,C=-C);let A=Ie.atan2Deg(C,b);this.rotation=A,A*=Ie.degRad;const P=Math.cos(A),E=Math.sin(A);let R=(r*P+o*E)*x,O=(a*P+l*E)*v;const U=1/Math.sqrt(R*R+O*O);R*=U,O*=U;const G=this.inherit===zt.NoScale&&c<0!=(t<0!=i<0)?-1:1;this.set4(R*y+O*_,R*w+O*S,(R*_-O*y)*G,(R*S-O*w)*G)}}}set4(e,t,i,n){const r=e*e+i*i,o=t*t+n*n;r>Ie.epsilon2?(this.shearX=Ie.atan2Deg(i,e),this.scaleX=Math.sqrt(r)):(this.shearX=0,this.scaleX=0),this.scaleY=Math.sqrt(o),o>Ie.epsilon2?(this.shearY=Ie.atan2Deg(n,t),e*n-t*i<0?(this.scaleY=-this.scaleY,this.shearY+=90):this.shearY-=90,this.shearY>180?this.shearY-=360:this.shearY<=-180&&(this.shearY+=360)):this.shearY=0}set5(e,t,i,n,r){this.shearX=0;const o=e*e+i*i,a=t*t+n*n;if(o>Ie.epsilon2){const l=Ie.atan2Deg(i,e);this.rotation=l+r,this.scaleX=Math.sqrt(o),this.scaleY=Math.sqrt(a),a>Ie.epsilon2?(this.shearY=Ie.atan2Deg(n,t),e*n-t*i<0?(this.scaleY=-this.scaleY,this.shearY+=90-l):this.shearY-=90+l,this.shearY>180?this.shearY-=360:this.shearY<=-180&&(this.shearY+=360)):this.shearY=0}else this.scaleX=0,this.scaleY=Math.sqrt(a),this.shearY=0,this.rotation=a>Ie.epsilon2?Ie.atan2Deg(n,t)-90+r:r}validateLocalTransform(e){this.local===e._update&&this.updateLocalTransform(e)}modifyLocal(e){this.local===e._update&&this.updateLocalTransform(e),this.world=0,this.resetWorld(e,e._update)}modifyWorld(e){const t=e._update;this.local=t,this.world=t,this.resetWorld(e,t)}resetWorld(e,t){const i=this.bone.children;for(let n=0,r=i.length;n1&&t.constrained(this.bones[1].bone)}isSourceActive(){return this.target.active}static apply(t,i,n,r,o,a,l,c,h,u){typeof n=="number"?ur.apply1(t,i,n,r,o,a,l,c):ur.apply2(t,i,n,r,o,a,l,c,h,u)}static apply1(t,i,n,r,o,a,l,c){i.modifyLocal(t);const h=i.bone.parent.appliedPose;let u=h.a,d=h.b,f=h.c,m=h.d,p=-i.shearX-i.rotation,g=0,x=0;switch(i.inherit){case zt.OnlyTranslation:g=(n-i.worldX)*Ie.signum(t.scaleX),x=(r-i.worldY)*Ie.signum(t.scaleY);break;case zt.NoRotationOrReflection:{const v=Math.abs(u*m-d*f)/Math.max(Ie.epsilon,u*u+f*f),y=u/t.scaleX,w=f/t.scaleY;d=-w*v*t.scaleX,m=y*v*t.scaleY,p+=Ie.atan2Deg(w,y)}default:{const v=n-h.worldX,y=r-h.worldY,w=u*m-d*f;Math.abs(w)<=Ie.epsilon?(g=0,x=0):(g=(v*m-y*d)/w-i.x,x=(y*u-v*f)/w-i.y)}}if(p+=Ie.atan2Deg(x,g),i.scaleX<0&&(p+=180),p>180?p-=360:p<=-180&&(p+=360),i.rotation+=p*c,o||a){switch(i.inherit){case zt.NoScale:case zt.NoScaleOrReflection:g=n-i.worldX,x=r-i.worldY}const v=i.bone.data.length*i.scaleX;if(v>Ie.epsilon){const y=g*g+x*x;if(o&&yv*v){const w=(Math.sqrt(y)/v-1)*c+1;switch(i.scaleX*=w,l){case Xi.Uniform:i.scaleY*=w;break;case Xi.Volume:i.scaleY/=w<.7?.25+.642857*w:w}}}}}static apply2(t,i,n,r,o,a,l,c,h,u){if(i.inherit!==zt.Normal||n.inherit!==zt.Normal)return;i.modifyLocal(t),n.modifyLocal(t);let d=i.x,f=i.y,m=i.scaleX,p=i.scaleY,g=n.scaleX,x=0,v=0,y=0;m<0?(m=-m,x=180,y=-1):(x=0,y=1),p<0&&(p=-p,y=-y),g<0?(g=-g,v=180):v=0;let w=0,_=0,S=i.a,b=i.b,C=i.c,A=i.d;const P=Math.abs(m-p)<=Ie.epsilon;!P||l?(n.y=0,w=S*n.x+i.worldX,_=C*n.x+i.worldY):(w=S*n.x+b*n.y+i.worldX,_=C*n.x+A*n.y+i.worldY);const E=i.bone.parent.appliedPose;S=E.a,b=E.b,C=E.c,A=E.d;let R=S*A-b*C,O=w-E.worldX,U=_-E.worldY;R=Math.abs(R)<=Ie.epsilon?0:1/R;const G=(O*A-U*b)*R-d,$=(U*S-O*C)*R-f;let X=Math.sqrt(G*G+$*$),D=n.bone.data.length*g,k,N;if(X0){let oe=Math.min(1,se/(h*2))-1;oe=(se-h*(1-oe*oe))/z,F-=oe*F,V-=oe*V,Y=F*F+V*V}}e:if(P){D*=m;let z=(Y-X*X-D*D)/(2*X*D);if(z<-1)z=-1,N=Math.PI*a;else if(z>1){if(z=1,N=0,l)switch(S=(Math.sqrt(Y)/(X+D)-1)*u+1,i.scaleX*=S,c){case Xi.Uniform:i.scaleY*=S;break;case Xi.Volume:i.scaleY/=S<.7?.25+.642857*S:S}}else N=Math.acos(z)*a;S=X+D*z,b=D*Math.sin(N),k=Math.atan2(V*S-F*b,F*S+V*b)}else{S=m*D,b=p*D;const z=S*S,se=b*b,oe=Math.atan2(V,F);C=se*X*X+z*Y-z*se;const de=-2*se*X,ge=se-z;if(A=de*de-4*ge*C,A>=0){let ie=Math.sqrt(A);de<0&&(ie=-ie),ie=-(de+ie)*.5;let ue=ie/ge,me=C/ie;const ee=Math.abs(ue)=0){U=Math.sqrt(ue)*a,k=oe-Math.atan2(U,ee),N=Math.atan2(U/p,(ee-X)/m);break e}}let he=Ie.PI,fe=X-S,H=fe*fe,W=0,Z=0,L=X+S,B=L*L,j=0;C=-S*X/(z-se),C>=-1&&C<=1&&(C=Math.acos(C),O=S*Math.cos(C)+X,U=b*Math.sin(C),A=O*O+U*U,AB&&(Z=C,B=A,L=O,j=U)),Y<=(H+B)*.5?(k=oe-Math.atan2(W*a,fe),N=he*a):(k=oe-Math.atan2(j*a,L),N=Z*a)}const q=Math.atan2(n.y,n.x)*y;k=(k-q)*Ie.radDeg+x-i.rotation,k>180?k-=360:k<=-180&&(k+=360),i.rotation+=k*u,N=((N+q)*Ie.radDeg-n.shearX)*y+v-n.rotation,N>180?N-=360:N<=-180&&(N+=360),n.rotation+=N*u}}class Xc extends Nl{constructor(t){super(t,new km);M(this,"bones",[]);M(this,"_target",null);M(this,"_scaleYMode",Xi.None)}set target(t){this._target=t}get target(){if(!this._target)throw new Error("target cannot be null.");return this._target}set scaleYMode(t){this._scaleYMode=t}get scaleYMode(){if(this._scaleYMode==null)throw new Error("scaleYMode cannot be null.");return this._scaleYMode}create(t){return new ur(this,t)}}class Fm{constructor(){M(this,"position",0);M(this,"spacing",0);M(this,"mixRotate",0);M(this,"mixX",0);M(this,"mixY",0)}set(e){this.position=e.position,this.spacing=e.spacing,this.mixRotate=e.mixRotate,this.mixX=e.mixX,this.mixY=e.mixY}}class Vc extends Nl{constructor(t){super(t,new Fm);M(this,"bones",[]);M(this,"_slot",null);M(this,"positionMode",dn.Fixed);M(this,"spacingMode",mi.Fixed);M(this,"rotateMode",co.Chain);M(this,"offsetRotation",0)}set slot(t){this._slot=t}get slot(){if(this._slot)return this._slot;throw new Error("SlotData not set.")}create(t){return new Om(this,t)}}var dn;(function(s){s[s.Fixed=0]="Fixed",s[s.Percent=1]="Percent"})(dn||(dn={}));var mi;(function(s){s[s.Length=0]="Length",s[s.Fixed=1]="Fixed",s[s.Percent=2]="Percent",s[s.Proportional=3]="Proportional"})(mi||(mi={}));var co;(function(s){s[s.Tangent=0]="Tangent",s[s.Chain=1]="Chain",s[s.ChainScale=2]="ChainScale"})(co||(co={}));const Es=class Es extends Bl{constructor(t,i){super(t,new Fm,new Fm);M(this,"data");M(this,"bones");M(this,"slot");M(this,"spaces",[]);M(this,"positions",[]);M(this,"world",[]);M(this,"curves",[]);M(this,"lengths",[]);M(this,"segments",[]);if(!i)throw new Error("skeleton cannot be null.");this.data=t,this.bones=[];for(const n of this.data.bones)this.bones.push(i.bones[n.index].constrainedPose);this.slot=i.slots[t.slot.index]}copy(t){var i=new Es(this.data,t);return i.pose.set(this.pose),i}update(t,i){const n=this.slot.appliedPose.attachment;if(!(n instanceof _l))return;const r=this.appliedPose,o=r.mixRotate,a=r.mixX,l=r.mixY;if(o===0&&a===0&&l===0)return;const c=this.data,h=c.rotateMode===co.Tangent,u=c.rotateMode===co.ChainScale,d=this.bones,f=d.length,m=h?f:f+1,p=je.setArraySize(this.spaces,m),g=u?this.lengths=je.setArraySize(this.lengths,f):[],x=r.spacing;switch(c.spacingMode){case mi.Percent:if(u)for(let b=0,C=m-1;b0){b=m/b*x;for(let C=1;C0?Ie.degRad:-Ie.degRad}for(let b=0,C=3;b0){let U=A.a,G=A.b,$=A.c,X=A.d,D=0,k=0,N=0;if(h?D=v[C-1]:p[b+1]===0?D=v[C+2]:D=Math.atan2(O,R),D-=Math.atan2($,U),S){k=Math.cos(D),N=Math.sin(D);const F=A.bone.data.length;y+=(F*(k*U-N*$)-R)*o,w+=(F*(N*U+k*$)-O)*o}else D+=_;D>Ie.PI?D-=Ie.PI2:D<-Ie.PI&&(D+=Ie.PI2),D*=o,k=Math.cos(D),N=Math.sin(D),A.a=k*U-N*$,A.b=k*G-N*X,A.c=N*U+k*$,A.d=N*G+k*X}}}computeWorldPositions(t,i,n,r){const o=this.slot;let a=this.appliedPose.position,l=this.spaces,c=je.setArraySize(this.positions,n*3+2),h=this.world;const u=i.closed;let d=i.worldVerticesLength,f=d/6,m=Es.NONE;if(!i.constantSpeed){const N=i.lengths;f-=u?1:2;const F=N[f];this.data.positionMode===dn.Percent&&(a*=F);let V;switch(this.data.spacingMode){case mi.Percent:V=F;break;case mi.Proportional:V=F/n;break;default:V=1}h=je.setArraySize(this.world,8);for(let Y=0,q=0,z=0;YF){m!==Es.AFTER&&(m=Es.AFTER,i.computeWorldVertices(t,o,d-6,4,h,0,2)),this.addAfterPosition(oe-F,h,0,c,q);continue}for(;;z++){const de=N[z];if(!(oe>de)){if(z===0)oe/=de;else{const ge=N[z-1];oe=(oe-ge)/(de-ge)}break}}z!==m&&(m=z,u&&z===f?(i.computeWorldVertices(t,o,d-4,4,h,0,2),i.computeWorldVertices(t,o,0,4,h,4,2)):i.computeWorldVertices(t,o,z*6+2,8,h,0,2)),this.addCurvePosition(oe,h[0],h[1],h[2],h[3],h[4],h[5],h[6],h[7],c,q,r||Y>0&&se===0)}return c}u?(d+=2,h=je.setArraySize(this.world,d),i.computeWorldVertices(t,o,2,d-4,h,0,2),i.computeWorldVertices(t,o,0,2,h,d-4,2),h[d-2]=h[0],h[d-1]=h[1]):(f--,d-=4,h=je.setArraySize(this.world,d),i.computeWorldVertices(t,o,2,d,h,0,2));const p=je.setArraySize(this.curves,f);let g=0,x=h[0],v=h[1],y=0,w=0,_=0,S=0,b=0,C=0,A=0,P=0,E=0,R=0,O=0,U=0,G=0,$=0;for(let N=0,F=2;Ng){this.addAfterPosition(z-g,h,d-4,c,F);continue}for(;;V++){const se=p[V];if(!(z>se)){if(V===0)z/=se;else{const oe=p[V-1];z=(z-oe)/(se-oe)}break}}if(V!==m){m=V;let se=V*6;for(x=h[se],v=h[se+1],y=h[se+2],w=h[se+3],_=h[se+4],S=h[se+5],b=h[se+6],C=h[se+7],A=(x-y*2+_)*.03,P=(v-w*2+S)*.03,E=((y-_)*3-x+b)*.006,R=((w-S)*3-v+C)*.006,O=A*2+E,U=P*2+R,G=(y-x)*.3+A+E*.16666667,$=(w-v)*.3+P+R*.16666667,k=Math.sqrt(G*G+$*$),D[0]=k,se=1;se<8;se++)G+=O,$+=U,O+=E,U+=R,k+=Math.sqrt(G*G+$*$),D[se]=k;G+=O,$+=U,k+=Math.sqrt(G*G+$*$),D[8]=k,G+=O+E,$+=U+R,k+=Math.sqrt(G*G+$*$),D[9]=k,Y=0}for(z*=k;;Y++){const se=D[Y];if(!(z>se)){if(Y===0)z/=se;else{const oe=D[Y-1];z=Y+(z-oe)/(se-oe)}break}}this.addCurvePosition(z*.1,x,v,y,w,_,S,b,C,c,F,r||N>0&&q===0)}return c}addBeforePosition(t,i,n,r,o){const a=i[n],l=i[n+1],c=i[n+2]-a,h=i[n+3]-l,u=Math.atan2(h,c);r[o]=a+t*Math.cos(u),r[o+1]=l+t*Math.sin(u),r[o+2]=u}addAfterPosition(t,i,n,r,o){const a=i[n+2],l=i[n+3],c=a-i[n],h=l-i[n+1],u=Math.atan2(h,c);r[o]=a+t*Math.cos(u),r[o+1]=l+t*Math.sin(u),r[o+2]=u}addCurvePosition(t,i,n,r,o,a,l,c,h,u,d,f){if(t===0||Number.isNaN(t)){u[d]=i,u[d+1]=n,u[d+2]=Math.atan2(o-n,r-i);return}const m=t*t,p=m*t,g=1-t,x=g*g,v=x*g,y=g*t,w=y*3,_=g*w,S=w*t,b=i*v+r*_+a*S+c*p,C=n*v+o*_+l*S+h*p;u[d]=b,u[d+1]=C,f&&(t<.001?u[d+2]=Math.atan2(o-n,r-i):u[d+2]=Math.atan2(C-(n*x+o*y*2+l*m),b-(i*x+r*y*2+a*m)))}sort(t){const i=this.slot.data.index,n=this.slot.bone;t.skin!=null&&this.sortPathSlot(t,t.skin,i,n),t.data.defaultSkin!=null&&t.data.defaultSkin!==t.skin&&this.sortPathSlot(t,t.data.defaultSkin,i,n),this.sortPath(t,this.slot.pose.attachment,n);const r=this.bones,o=this.bones.length;for(let a=0;a0,a=this.data.y>0,l=this.data.rotate>0||this.data.shearX>0,c=this.data.scaleX>0,h=this.bone;let u=h.bone.data.length,d=this.data.step,f=0;if(i!==Kr.none){switch(h.modifyWorld(t),i){case Kr.reset:this.reset(t);case Kr.update:{const m=Math.max(t.time-this.lastTime,0),p=this.remaining;this.remaining+=m,this.lastTime=t.time;const g=h.worldX,x=h.worldY;if(this._reset)this._reset=!1,this.ux=g,this.uy=x;else{let v=this.remaining,y=n.inertia,w=t.data.referenceScale,_=-1,S=0,b=0,C=this.data.limit*m,A=C*Math.abs(t.scaleY);if(C*=Math.abs(t.scaleX),o||a){if(o){const P=(this.ux-g)*y;this.xOffset+=P>C?C:P<-C?-C:P,this.ux=g}if(a){const P=(this.uy-x)*y;this.yOffset+=P>A?A:P<-A?-A:P,this.uy=x}if(v>=d){const P=this.xOffset,E=this.yOffset;_=n.damping**(60*d),S=d*n.massInverse,b=n.strength;const R=w*n.wind,O=w*n.gravity,U=(R*t.windX+O*t.gravityX)*t.scaleX,G=(R*t.windY+O*t.gravityY)*t.scaleY;do o&&(this.xVelocity+=(U-this.xOffset*b)*S,this.xOffset+=this.xVelocity*d,this.xVelocity*=_),a&&(this.yVelocity-=(G+this.yOffset*b)*S,this.yOffset+=this.yVelocity*d,this.yVelocity*=_),v-=d;while(v>=d);this.xLag=this.xOffset-P,this.yLag=this.yOffset-E}f=Math.max(0,1-v/d),o&&(h.worldX+=(this.xOffset-this.xLag*f)*r*this.data.x),a&&(h.worldY+=(this.yOffset-this.yLag*f)*r*this.data.y)}if(l||c){let P=Math.atan2(h.c,h.a),E=0,R=0,O=0,U=this.cx-h.worldX,G=this.cy-h.worldY;if(U>C?U=C:U<-C&&(U=-C),G>A?G=A:G<-A&&(G=-A),v=this.remaining,l){O=(this.data.rotate+this.data.shearX)*r,f=this.rotateLag*Math.max(0,1-p/d);let $=Math.atan2(G+this.ty,U+this.tx)-P-(this.rotateOffset-f)*O;this.rotateOffset+=($-Math.ceil($*Ie.invPI2-.5)*Ie.PI2)*y,$=(this.rotateOffset-f)*O+P,E=Math.cos($),R=Math.sin($),c&&($=u*h.getWorldScaleX(),$>0&&(this.scaleOffset+=(U*E+G*R)*y/$))}else{E=Math.cos(P),R=Math.sin(P);const $=u*h.getWorldScaleX()-this.scaleLag*Math.max(0,1-p/d);$>0&&(this.scaleOffset+=(U*E+G*R)*y/$)}if(v>=d){_===-1&&(_=n.damping**(60*d),S=d*n.massInverse,b=n.strength);const $=n.wind*t.windX+n.gravity*t.gravityX,X=(n.wind*t.windY+n.gravity*t.gravityY)*Nm.yDir,D=this.rotateOffset,k=this.scaleOffset,N=u/w;for(;;)if(v-=d,c&&(this.scaleVelocity+=($*E-X*R-this.scaleOffset*b)*S,this.scaleOffset+=this.scaleVelocity*d,this.scaleVelocity*=_),l){if(this.rotateVelocity-=(($*R+X*E)*N+this.rotateOffset*b)*S,this.rotateOffset+=this.rotateVelocity*d,this.rotateVelocity*=_,v0){let v=0;this.data.rotate>0&&(v=m*this.data.rotate,p=Math.sin(v),g=Math.cos(v),x=h.b,h.b=g*x-p*h.d,h.d=p*x+g*h.d),v+=m*this.data.shearX,p=Math.sin(v),g=Math.cos(v),x=h.a,h.a=g*x-p*h.c,h.c=p*x+g*h.c}else m*=this.data.rotate,p=Math.sin(m),g=Math.cos(m),x=h.a,h.a=g*x-p*h.c,h.c=p*x+g*h.c,x=h.b,h.b=g*x-p*h.d,h.d=p*x+g*h.d}if(c){let m=1+(this.scaleOffset-this.scaleLag*f)*r*this.data.scaleX;switch(h.a*=m,h.c*=m,this.data.scaleYMode){case Xi.Uniform:h.b*=m,h.d*=m;break;case Xi.Volume:m=Math.abs(m),m=m>=.7?1/m:4-3.67347*m,h.b*=m,h.d*=m}}i!==Kr.pose&&(this.tx=u*h.a,this.ty=u*h.c)}}sort(t){const i=this.bone.bone;t.sortBone(i),t._updateCache.push(this),t.sortReset(i.children),t.constrained(i)}isSourceActive(){return this.bone.bone.active}}class Yc extends Nl{constructor(t){super(t,new Lm);M(this,"_bone",null);M(this,"x",0);M(this,"y",0);M(this,"rotate",0);M(this,"scaleX",0);M(this,"shearX",0);M(this,"limit",0);M(this,"step",0);M(this,"inertiaGlobal",!1);M(this,"strengthGlobal",!1);M(this,"dampingGlobal",!1);M(this,"massGlobal",!1);M(this,"windGlobal",!1);M(this,"gravityGlobal",!1);M(this,"mixGlobal",!1);M(this,"_scaleYMode",Xi.None)}set bone(t){this._bone=t}get bone(){if(this._bone)return this._bone;throw new Error("BoneData not set.")}get scaleYMode(){return this._scaleYMode}set scaleYMode(t){if(t==null)throw new Error("scaleYMode cannot be null.");this._scaleYMode=t}create(t){return new Su(this,t)}}typeof Math.fround>"u"&&(Math.fround=(s=>e=>(s[0]=e,s[0]))(new Float32Array(1)));class Dm{constructor(){M(this,"time",0);M(this,"mix",0)}set(e){this.time=e.time,this.mix=e.mix}}const ll=class ll extends Bl{constructor(t,i){super(t,new Dm,new Dm);M(this,"bone",null);if(!i)throw new Error("skeleton cannot be null.");t.bone!=null&&(this.bone=i.bones[t.bone.index])}copy(t){var i=new ll(this.data,t);return i.pose.set(this.pose),i}update(t,i){const n=this.appliedPose;if(n.mix===0)return;const r=this.data,o=r.animation,a=this.bone;if(a!==null){if(!a.active)return;r.local&&a.appliedPose.validateLocalTransform(t),n.time=r.offset+(r.property.value(t,a.appliedPose,r.local,ll.offsets)-r.property.offset)*r.scale,r.loop?n.time=o.duration+n.time%o.duration:n.time=Math.max(0,n.time)}const l=t.bones,c=o.bones;for(let h=0,u=o.bones.length;h=n.length&&(n.length=e+1),n[e]||(n[e]={}),n[e][t]=i}addSkin(e){for(let i=0;i= 0.");if(!n)throw new Error("boneData cannot be null.");this.index=t,this.boneData=n}}var Lh;(function(s){s[s.Normal=0]="Normal",s[s.Additive=1]="Additive",s[s.Multiply=2]="Multiply",s[s.Screen=3]="Screen"})(Lh||(Lh={}));class Xm{constructor(){M(this,"mixRotate",0);M(this,"mixX",0);M(this,"mixY",0);M(this,"mixScaleX",0);M(this,"mixScaleY",0);M(this,"mixShearY",0)}set(e){this.mixRotate=e.mixRotate,this.mixX=e.mixX,this.mixY=e.mixY,this.mixScaleX=e.mixScaleX,this.mixScaleY=e.mixScaleY,this.mixShearY=e.mixShearY}}class Vp extends Bl{constructor(t,i){super(t,new Xm,new Xm);M(this,"bones");M(this,"source");if(!i)throw new Error("skeleton cannot be null.");this.bones=[];for(const r of t.bones)this.bones.push(i.bones[r.index].constrainedPose);const n=i.bones[t.source.index];if(n==null)throw new Error("source cannot be null.");this.source=n}copy(t){var i=new Vp(this.data,t);return i.pose.set(this.pose),i}update(t,i){const n=this.appliedPose;if(n.mixRotate===0&&n.mixX===0&&n.mixY===0&&n.mixScaleX===0&&n.mixScaleY===0&&n.mixShearY===0)return;const r=this.data,o=r.localSource,a=r.localTarget,l=r.additive,c=r.clamp,h=r.offsets,u=this.source.appliedPose;o&&u.validateLocalTransform(t);const d=r.properties,f=r.properties.length,m=this.bones;for(let p=0,g=this.bones.length;p0?n[_t.ROTATION]:-n[_t.ROTATION]);return a<0&&(a+=360),a}}class $S extends wa{mix(e){return e.mixRotate}apply(e,t,i,n,r,o){if(r)i.rotation+=(o?n:n-i.rotation)*t.mixRotate;else{const a=e.scaleX,l=e.scaleY,c=1/a,h=1/l,u=i.a*c,d=i.b*c,f=i.c*h,m=i.d*h;n*=Ie.degRad,o||(n-=Math.atan2(f,u)),n>Ie.PI?n-=Ie.PI2:n<-Ie.PI&&(n+=Ie.PI2),n*=t.mixRotate;const p=Math.cos(n),g=Math.sin(n);i.a=(p*u-g*f)*a,i.b=(p*d-g*m)*a,i.c=(g*u+p*f)*l,i.d=(g*d+p*m)*l}}}class Ym extends ba{value(e,t,i,n){return i?t.x+n[_t.X]:(n[_t.X]*t.a+n[_t.Y]*t.b+t.worldX)/e.scaleX}}class XS extends wa{mix(e){return e.mixX}apply(e,t,i,n,r,o){r?i.x+=(o?n:n-i.x)*t.mixX:(o||(n-=i.worldX/e.scaleX),i.worldX+=n*t.mixX*e.scaleX)}}class Gm extends ba{value(e,t,i,n){return i?t.y+n[_t.Y]:(n[_t.X]*t.c+n[_t.Y]*t.d+t.worldY)/e.scaleY}}class VS extends wa{mix(e){return e.mixY}apply(e,t,i,n,r,o){r?i.y+=(o?n:n-i.y)*t.mixY:(o||(n-=i.worldY/e.scaleY),i.worldY+=n*t.mixY*e.scaleY)}}class jm extends ba{value(e,t,i,n){if(i)return t.scaleX+n[_t.SCALEX];const r=t.a/e.scaleX,o=t.c/e.scaleY;return Math.sqrt(r*r+o*o)+n[_t.SCALEX]}}class YS extends wa{mix(e){return e.mixScaleX}apply(e,t,i,n,r,o){if(r)o?i.scaleX*=1+(n-1)*t.mixScaleX:i.scaleX!==0&&(i.scaleX+=(n-i.scaleX)*t.mixScaleX);else if(o){const a=1+(n-1)*t.mixScaleX;i.a*=a,i.c*=a}else{let a=i.a/e.scaleX,l=i.c/e.scaleY,c=Math.sqrt(a*a+l*l);c!==0&&(c=1+(n-c)*t.mixScaleX/c,i.a*=c,i.c*=c)}}}class Hm extends ba{value(e,t,i,n){if(i)return t.scaleY+n[_t.SCALEY];const r=t.b/e.scaleX,o=t.d/e.scaleY;return Math.sqrt(r*r+o*o)+n[_t.SCALEY]}}class GS extends wa{mix(e){return e.mixScaleY}apply(e,t,i,n,r,o){if(r)o?i.scaleY*=1+(n-1)*t.mixScaleY:i.scaleY!==0&&(i.scaleY+=(n-i.scaleY)*t.mixScaleY);else if(o){const a=1+(n-1)*t.mixScaleY;i.b*=a,i.d*=a}else{let a=i.b/e.scaleX,l=i.d/e.scaleY,c=Math.sqrt(a*a+l*l);c!==0&&(c=1+(n-c)*t.mixScaleY/c,i.b*=c,i.d*=c)}}}class Wm extends ba{value(e,t,i,n){if(i)return t.shearY+n[_t.SHEARY];const r=1/e.scaleX,o=1/e.scaleY;return(Math.atan2(t.d*o,t.b*r)-Math.atan2(t.c*o,t.a*r))*Ie.radDeg-90+n[_t.SHEARY]}}class jS extends wa{mix(e){return e.mixShearY}apply(e,t,i,n,r,o){if(r)o||(n-=i.shearY),i.shearY+=n*t.mixShearY;else{const a=e.scaleX,l=e.scaleY,c=i.b/a,h=i.d/l,u=Math.atan2(h,c);n=(n+90)*Ie.degRad,o?n-=Ie.PI/2:(n-=u-Math.atan2(i.c/l,i.a/a),n>Ie.PI?n-=Ie.PI2:n<-Ie.PI&&(n+=Ie.PI2)),n=u+n*t.mixShearY;const d=Math.sqrt(c*c+h*h);i.b=Math.cos(n)*d*a,i.d=Math.sin(n)*d*l}}}class BV{constructor(e){M(this,"scale",1);M(this,"attachmentLoader");M(this,"linkedMeshes",[]);this.attachmentLoader=e}readSkeletonData(e){const t=this.scale,i=new DS;i.name="";const n=new gO(e),r=n.readInt32(),o=n.readInt32();i.hash=o===0&&r===0?null:o.toString(16)+r.toString(16),i.version=n.readString(),i.x=n.readFloat(),i.y=n.readFloat(),i.width=n.readFloat(),i.height=n.readFloat(),i.referenceScale=n.readFloat()*t;const a=n.readBoolean();a&&(i.fps=n.readFloat(),i.imagesPath=n.readString(),i.audioPath=n.readString());let l=0;l=n.readInt(!0);for(let m=0;m>5;for(let w=0,_;w>1&1,x.spacingMode=v>>2&3,x.rotateMode=v>>4&3,(v&128)!==0&&(x.offsetRotation=n.readFloat());const y=x.setupPose;y.position=n.readFloat(),x.positionMode===dn.Fixed&&(y.position*=t),y.spacing=n.readFloat(),(x.spacingMode===mi.Length||x.spacingMode===mi.Fixed)&&(y.spacing*=t),y.mixRotate=n.readFloat(),y.mixX=n.readFloat(),y.mixY=n.readFloat(),h.push(x);break}case $O:{const x=new Yc(p);x.bone=c[n.readInt(!0)];let v=n.readByte();if(x.skinRequired=(v&1)!==0,(v&2)!==0&&(x.x=n.readFloat()),(v&4)!==0&&(x.y=n.readFloat()),(v&8)!==0&&(x.rotate=n.readFloat()),(v&16)!==0){let w=n.readFloat();w<-2?(x.scaleYMode=Xi.Volume,w=-2-w):w<0&&(x.scaleYMode=Xi.Uniform,w=-1-w),x.scaleX=w}(v&32)!==0&&(x.shearX=n.readFloat()),x.limit=((v&64)!==0?n.readFloat():5e3)*t,x.step=1/n.readUnsignedByte();const y=x.setupPose;y.inertia=n.readFloat(),y.strength=n.readFloat(),y.damping=n.readFloat(),y.massInverse=(v&128)!==0?n.readFloat():1,y.wind=n.readFloat(),y.gravity=n.readFloat(),v=n.readByte(),(v&1)!==0&&(x.inertiaGlobal=!0),(v&2)!==0&&(x.strengthGlobal=!0),(v&4)!==0&&(x.dampingGlobal=!0),(v&8)!==0&&(x.massGlobal=!0),(v&16)!==0&&(x.windGlobal=!0),(v&32)!==0&&(x.gravityGlobal=!0),(v&64)!==0&&(x.mixGlobal=!0),y.mix=(v&128)!==0?n.readFloat():1,h.push(x);break}case XO:{const x=new Jr(p),v=n.readByte();if(x.skinRequired=(v&1)!==0,x.loop=(v&2)!==0,x.additive=(v&4)!==0,(v&8)!==0){const y=n.readFloat();a&&(v&64)!==0?x.max=y:x.setupPose.time=y}if((v&16)!==0&&(x.setupPose.mix=(v&32)!==0?n.readFloat():1),(v&64)!==0){x.local=(v&128)!==0,x.bone=c[n.readInt(!0)];const y=n.readFloat();let w=1;switch(n.readByte()){case 0:x.property=new Vm;break;case 1:{w=t,x.property=new Ym;break}case 2:{w=t,x.property=new Gm;break}case 3:x.property=new jm;break;case 4:x.property=new Hm;break;case 5:x.property=new Wm;break;default:continue}x.property.offset=y*w,x.offset=n.readFloat(),x.scale=n.readFloat()/w}h.push(x);break}}}const d=this.readSkin(n,i,!0,a);d&&(i.defaultSkin=d,i.skins.push(d));{let m=i.skins.length;for(je.setArraySize(i.skins,l=m+n.readInt(!0));m0){v=[];for(let b=0;b>4,e.readFloat())}r.push(P);break}}}}}const a=i.slots.length,l=e.readInt(!0);if(l>0){const f=new _r(l);for(let m=0;m0){const f=new Tl(h);for(let m=0;m>>1^-(i&1)}readStringRef(){const 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 i=0;i>4){case 12:case 13:t+=String.fromCharCode((n&31)<<6|this.readByte()&63),i+=2;break;case 14:t+=String.fromCharCode((n&15)<<12|(this.readByte()&63)<<6|this.readByte()&63),i+=3;break;default:t+=String.fromCharCode(n),i++}}return t}readFloat(){const e=this.buffer.getFloat32(this.index);return this.index+=4,e}readBoolean(){return this.readByte()!==0}}let vO=class{constructor(e,t,i,n,r,o){M(this,"source");M(this,"skinIndex");M(this,"slotIndex");M(this,"sourceIndex");M(this,"mesh");M(this,"inheritTimelines");this.mesh=e,this.skinIndex=t,this.slotIndex=i,this.sourceIndex=n,this.source=r,this.inheritTimelines=o}};class Ty{constructor(e=null,t,i=0){M(this,"bones");M(this,"vertices");M(this,"length");this.bones=e,this.vertices=t,this.length=i}}var _n;(function(s){s[s.Region=0]="Region",s[s.BoundingBox=1]="BoundingBox",s[s.Mesh=2]="Mesh",s[s.LinkedMesh=3]="LinkedMesh",s[s.Path=4]="Path",s[s.Point=5]="Point",s[s.Clipping=6]="Clipping"})(_n||(_n={}));function ri(s,e,t,i){t instanceof Bn?yO(s,e,t,i):xO(s,e,t,i)}function yO(s,e,t,i){let n=s.readFloat(),r=s.readFloat()*i;for(let o=0,a=0,l=t.getFrameCount()-1;t.setFrame(o,n,r),o!==l;o++){const c=s.readFloat(),h=s.readFloat()*i;switch(s.readByte()){case Ks:t.setStepped(o);break;case Zs:gt(s,t,a++,o,0,n,c,r,h,i)}n=c,r=h}e.push(t)}function xO(s,e,t,i){let n=s.readFloat(),r=s.readFloat()*i,o=s.readFloat()*i;for(let a=0,l=0,c=t.getFrameCount()-1;t.setFrame(a,n,r,o),a!==c;a++){const h=s.readFloat(),u=s.readFloat()*i,d=s.readFloat()*i;switch(s.readByte()){case Ks:t.setStepped(a);break;case Zs:gt(s,t,l++,a,0,n,h,r,u,i),gt(s,t,l++,a,1,n,h,o,d,i)}n=h,r=u,o=d}e.push(t)}function _y(s,e){const t=s.readInt(!0);if(t===0)return null;const i=new Array(e).fill(-1),n=new Array(e-t);let r=0,o=0;for(let a=0;a=0;a--)i[a]===-1&&(i[a]=n[--o]);return i}function gt(s,e,t,i,n,r,o,a,l,c){e.setBezier(t,i,n,r,a,s.readFloat(),s.readFloat()*c,s.readFloat(),s.readFloat()*c,o,l)}const bO=0,wO=1,SO=2,MO=3,TO=4,_O=5,CO=6,EO=7,AO=8,IO=9,RO=10,PO=0,kO=1,FO=2,OO=3,LO=4,BO=5,NO=0,DO=1,UO=2,$O=3,XO=4,VO=0,YO=1,GO=0,jO=1,HO=2,WO=0,zO=1,qO=2,KO=4,ZO=5,JO=6,QO=7,eL=8,tL=0,iL=1,Ks=1,Zs=2;class sL{constructor(e){M(this,"attachmentLoader");M(this,"scale",1);M(this,"linkedMeshes",[]);this.attachmentLoader=e}readSkeletonData(e){const t=this.scale,i=new DS,n=typeof e=="string"?JSON.parse(e):e,r=n.skeleton;if(r&&(i.hash=r.hash,i.version=r.spine,i.x=r.x,i.y=r.y,i.width=r.width,i.height=r.height,i.referenceScale=te(r,"referenceScale",100)*t,i.fps=r.fps,i.imagesPath=r.images??null,i.audioPath=r.audio??null),n.bones)for(let o=0;o0&&c.properties.push(S)}c.offsets[_t.ROTATION]=te(o,"rotation",0),c.offsets[_t.X]=te(o,"x",0)*t,c.offsets[_t.Y]=te(o,"y",0)*t,c.offsets[_t.SCALEX]=te(o,"scaleX",0),c.offsets[_t.SCALEY]=te(o,"scaleY",0),c.offsets[_t.SHEARY]=te(o,"shearY",0);const y=c.setupPose;d&&(y.mixRotate=te(o,"mixRotate",1)),f&&(y.mixX=te(o,"mixX",1)),m&&(y.mixY=te(o,"mixY",y.mixX)),p&&(y.mixScaleX=te(o,"mixScaleX",1)),g&&(y.mixScaleY=te(o,"mixScaleY",y.mixScaleX)),x&&(y.mixShearY=te(o,"mixShearY",1)),i.constraints.push(c);break}case"path":{const c=new Vc(a);c.skinRequired=l;for(let f=0;f0){const d=i.findConstraint(c,Yc);if(!d)throw new Error(`Physics constraint not found: ${c}`);u=i.constraints.indexOf(d)}for(const d in h){const f=h[d];let m=f[0];if(!m)continue;const p=f.length;let g,x=0;if(d==="reset"){const v=new Oh(p,u);for(let y=0;m!=null;m=f[y+1],y++)v.setFrame(y,te(m,"time",0));r.push(v);continue}switch(d){case"inertia":g=new CS(p,p,u);break;case"strength":g=new ES(p,p,u);break;case"damping":g=new AS(p,p,u);break;case"mass":g=new IS(p,p,u);break;case"wind":g=new RS(p,p,u);break;case"gravity":g=new PS(p,p,u);break;case"mix":{x=1,g=new kS(p,p,u);break}default:continue}Qi(r,f,g,x,1)}}if(e.slider)for(const c in e.slider){const h=e.slider[c],u=i.findConstraint(c,Jr);if(!u)throw new Error(`Slider not found: ${c}`);const d=i.constraints.indexOf(u);for(const f in h){const m=h[f];if(!m[0])continue;const g=m.length;switch(f){case"time":Qi(r,m,new FS(g,g,d),1,1);break;case"mix":Qi(r,m,new OS(g,g,d),1,1);break}}}if(e.attachments)for(const c in e.attachments){const h=e.attachments[c],u=i.findSkin(c);if(!u)throw new Error(`Skin not found: ${c}`);for(const d in h){const f=h[d],m=i.findSlot(d);if(!m)throw new Error(`Attachment slot not found: ${d}`);const p=m.index;for(const g in f){const x=f[g],v=u.getAttachment(p,g);if(!v)throw new Error(`Timeline attachment not found: ${g}`);for(const y in x){const w=x[y];let _=w[0];if(_){if(y==="deform"){const S=v.bones,b=v.vertices,C=S?b.length/3*2:b.length,A=new bS(w.length,w.length,p,v);let P=te(_,"time",0);for(let E=0,R=0;;E++){let O;const U=te(_,"vertices",null);if(!U)O=S?je.newFloatArray(C):b;else{O=je.newFloatArray(C);const D=te(_,"offset",0);if(je.arrayCopy(U,0,O,D,U.length),n!==1)for(let k=D,N=k+U.length;k=0;c--)r[c]===-1&&(r[c]=o[--l]);return r}function xt(s,e,t,i,n,r,o,a,l,c){if(s==="stepped")return e.setStepped(i),t;const h=n<<2,u=s[h],d=s[h+1]*c,f=s[h+2],m=s[h+3]*c;return e.setBezier(t,i,n,r,a,u,d,f,m,o,l),t+1}function te(s,e,t){return s[e]!==void 0?s[e]:t}class rL{newRegionAttachment(e,t,i,n){return new gu(t,i)}newMeshAttachment(e,t,i,n){return new Ol(t,i)}newBoundingBoxAttachment(e,t){return new yw(t)}newPathAttachment(e,t){return new Ml(t)}newPointAttachment(e,t){return new Tw(t)}newClippingAttachment(e,t){return new na(t)}}class oL{sequence(e){for(let t=0;t!Number.isInteger(h)||h<0||h>=o))throw new Error(`拖尾网格“${e}”的三角形索引越界`);const a=Number(s.hull)||0;if(!Number.isInteger(a)||a<0||a>o)throw new Error(`拖尾网格“${e}”的外轮廓数量无效`);if(Array.isArray(s.edges)&&s.edges.some(h=>!Number.isInteger(h)||h<0||h>=o*2||h%2))throw new Error(`拖尾网格“${e}”的外轮廓边索引越界`);if(n.length===i.length)return;let l=0,c=0;for(;l=t)throw new Error(`拖尾网格“${e}”引用了不存在的骨骼`);if(![m,p,g].every(Number.isFinite)||g<0)throw new Error(`拖尾网格“${e}”包含无效权重数据`);u+=g}if(Math.abs(u-1)>.001)throw new Error(`拖尾网格“${e}”的顶点权重之和不为 1`);c++}if(l!==n.length||c!==o)throw new Error(`拖尾网格“${e}”的顶点数量与 UV 不一致`)}function cL(s,e){var r,o,a,l;const t=Array.isArray(s.bones)?s.bones:[],i=new Map(t.map(c=>[String(c.name||""),c])),n=new Set;for(const c of t){if(c.inherit!=null&&!aL.has(c.inherit))throw new Error(`骨骼“${c.name||""}”的 inherit 值“${c.inherit}”不符合 Spine ${e} JSON 格式`);if(/_trail_\d+_\d+$/.test(String(c.name||""))){const h=i.get(String(c.parent||""));if(!h||/_trail_\d+_\d+$/.test(String(h.name||"")))throw new Error(`拖尾骨骼“${c.name||""}”必须直接挂在粒子系统骨骼下,不能组成骨骼链`)}}for(const c of Array.isArray(s.skins)?s.skins:[]){const h=(c==null?void 0:c.attachments)||{};for(const u of Object.keys(h))for(const d of Object.keys(h[u]||{})){const f=h[u][d];(f==null?void 0:f.type)==="mesh"&&(lL(f,d,t.length),((r=f.vertices)==null?void 0:r.length)!==((o=f.uvs)==null?void 0:o.length)&&n.add(u))}}for(const c of Object.values(s.animations||{}))for(const h of n){const u=(l=(a=c==null?void 0:c.slots)==null?void 0:a[h])==null?void 0:l.attachment;if(Array.isArray(u)&&u.some(d=>!(d!=null&&d.name)))throw new Error(`加权拖尾插槽“${h}”不能使用空附件,未出现或死亡阶段应将对应骨骼缩放设为 0`)}}function hL(s){var e;if(String(((e=s==null?void 0:s.skeleton)==null?void 0:e.spine)||"")!=="3.8")throw new Error("Spine 3.8 导出的版本标识必须为 3.8");for(const t of s.bones||[])if(t.inherit!=null)throw new Error(`Spine 3.8 骨骼“${t.name||""}”应使用 transform,不能使用 inherit`);for(const t of Object.values(s.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 i=[t];for(;i.length;){const n=i.pop();if(!(!n||typeof n!="object")){if(!Array.isArray(n)&&Array.isArray(n.curve))throw new Error("Spine 3.8 不支持 4.x 数组曲线格式");i.push(...Object.values(n))}}}}function Ey(s,e){var o;const t=JSON.parse(s),i=yh((o=t==null?void 0:t.skeleton)==null?void 0:o.spine);if(!i)throw new Error(`导出版本不受支持,仅支持 Spine ${xm()}`);if(e&&i!==e)throw new Error(`导出版本不一致:设置为 Spine ${e},JSON 标记为 Spine ${i}`);cL(t,i),i==="3.8"&&hL(t);const n=i==="3.8"?Nw(JSON.parse(JSON.stringify(t))):t,r=i==="4.3"?new sL(new oL).readSkeletonData(n):new Th(new rL).readSkeletonData(n);if(!r.bones.length)throw new Error("导出结果缺少骨骼");return{version:i,bones:r.bones.length,slots:r.slots.length,animations:r.animations.length}}const HS="http://127.0.0.1:27843";class Bh extends Error{constructor(t,i="CONNECTOR_ERROR",n){super(t);M(this,"code");M(this,"pairUrl");this.name="SpineConnectorError",this.code=i,this.pairUrl=n}}function zm(s,e){return String(s||"").trim().replace(/[\\/:*?"<>|]+/g,"_").replace(/^\.+/,"")||e}function uL(s,e){const t=/\.([a-z0-9]{2,5})$/i.exec(s);return t?`.${t[1].toLowerCase()}`:e.includes("jpeg")?".jpg":e.includes("webp")?".webp":e.includes("gif")?".gif":".png"}function dL(s,e,t){const i=String(s||"").replace(/\\/g,"/").split("/").filter(Boolean).map(r=>zm(r,"images")),n=zm(e.replace(/\.[^./\\]+$/,""),"image");return[...i,`${n}${uL(e,t)}`].join("/")}async function xf(s,e,t){if(!s)return null;const i=await fetch(s);if(!i.ok)throw new Error(`无法读取导出图片:${t}`);const n=await i.blob(),r=new Uint8Array(await n.arrayBuffer());let o="";const a=32768;for(let l=0;lo.finally(()=>{i++,e==null||e(i,t.length)});for(const o of s.filter(a=>a.visible!==!1)){for(const a of o.config.imageResources)if(a.imageMode==="sequence"&&a.sequenceFrames.length)for(const l of a.sequenceFrames)t.push(n(xf(l.previewUrl,a.textureFolder,l.name||a.textureName)));else t.push(n(xf(a.previewUrl,a.textureFolder,a.textureName)));if(o.config.trail)for(const a of o.config.trailResources)t.push(n(xf(a.previewUrl,"",a.textureName)))}const r=new Map;for(const o of await Promise.all(t))o&&!r.has(o.path)&&r.set(o.path,o);return[...r.values()]}async function fL(){try{const s=await fetch(`${HS}/v1/health`,{cache:"no-store"});if(!s.ok)throw new Error(`HTTP ${s.status}`);return{available:!0,...await s.json()}}catch(s){return{available:!1,authorized:!1,error:s instanceof Error?s.message:String(s)}}}async function mL(s,e){const t=await WS(s.systems,(n,r)=>{e==null||e({phase:"images",progress:r?n/r:1})}),i=JSON.stringify({schemaVersion:1,projectName:s.projectName,spineVersion:s.spineVersion,skeletonJson:s.skeletonJson,images:t});return new Promise((n,r)=>{const o=new XMLHttpRequest;o.open("POST",`${HS}/v1/convert`),o.responseType="blob",o.setRequestHeader("Content-Type","application/json"),o.upload.onprogress=a=>{e==null||e({phase:"upload",progress:a.lengthComputable&&a.total>0?a.loaded/a.total:null})},o.upload.onloadend=()=>e==null?void 0:e({phase:"processing",progress:null}),o.onprogress=a=>{e==null||e({phase:"download",progress:a.lengthComputable&&a.total>0?a.loaded/a.total:null})},o.onerror=()=>r(new Bh("未检测到本地 Spine 连接器,请先启动连接器","CONNECTOR_OFFLINE")),o.onload=async()=>{const a=o.response;if(o.status<200||o.status>=300){let h={};try{h=JSON.parse(await a.text())}catch{}r(new Bh(h.message||`Spine 连接器返回错误:HTTP ${o.status}`,h.code,h.pairUrl));return}const l=o.getResponseHeader("X-Spine-File-Name");let c=`${zm(s.projectName,"SpineParticle")}.zip`;if(l)try{c=decodeURIComponent(l)}catch{}n({blob:a,fileName:c,spineEditorVersion:o.getResponseHeader("X-Spine-Editor-Version")||s.spineVersion,imageCount:t.length})},o.send(i)})}function pL(s,e){const t=URL.createObjectURL(s),i=document.createElement("a");i.href=t,i.download=/\.zip$/i.test(e)?e:`${e}.zip`,i.style.display="none",document.body.appendChild(i),i.click(),i.remove(),setTimeout(()=>URL.revokeObjectURL(t),1e3)}const gL=Array.from({length:256},(s,e)=>{let t=e;for(let i=0;i<8;i++)t=t&1?3988292384^t>>>1:t>>>1;return t>>>0});function vL(s){let e=4294967295;for(const t of s)e=gL[(e^t)&255]^e>>>8;return(e^4294967295)>>>0}function yL(s){const e=String(s||"").replace(/\\/g,"/").split("/").filter(t=>t&&t!==".");if(!e.length||e.some(t=>t===".."))throw new Error("ZIP 文件路径无效");return e.join("/")}function xL(s=new Date){const e=Math.max(1980,s.getFullYear());return{time:s.getHours()<<11|s.getMinutes()<<5|Math.floor(s.getSeconds()/2),date:e-1980<<9|s.getMonth()+1<<5|s.getDate()}}function bf(s){const e=new Uint8Array(s);return{bytes:e,view:new DataView(e.buffer)}}function Ay(s){const e=new Uint8Array(s.reduce((i,n)=>i+n.length,0));let t=0;for(const i of s)e.set(i,t),t+=i.length;return e}function bL(s){const e=new TextEncoder,t=[],i=[],n=xL();let r=0;for(const l of s){const c=e.encode(yL(l.name)),h=vL(l.data),u=bf(30);u.view.setUint32(0,67324752,!0),u.view.setUint16(4,20,!0),u.view.setUint16(6,2048,!0),u.view.setUint16(10,n.time,!0),u.view.setUint16(12,n.date,!0),u.view.setUint32(14,h,!0),u.view.setUint32(18,l.data.length,!0),u.view.setUint32(22,l.data.length,!0),u.view.setUint16(26,c.length,!0),t.push(u.bytes,c,l.data);const d=bf(46);d.view.setUint32(0,33639248,!0),d.view.setUint16(4,20,!0),d.view.setUint16(6,20,!0),d.view.setUint16(8,2048,!0),d.view.setUint16(12,n.time,!0),d.view.setUint16(14,n.date,!0),d.view.setUint32(16,h,!0),d.view.setUint32(20,l.data.length,!0),d.view.setUint32(24,l.data.length,!0),d.view.setUint16(28,c.length,!0),d.view.setUint32(42,r,!0),i.push(d.bytes,c),r+=u.bytes.length+c.length+l.data.length}const o=Ay(i),a=bf(22);return a.view.setUint32(0,101010256,!0),a.view.setUint16(8,s.length,!0),a.view.setUint16(10,s.length,!0),a.view.setUint32(12,o.length,!0),a.view.setUint32(16,r,!0),new Blob([Ay([...t,o,a.bytes])],{type:"application/zip"})}function wL(s){const e=atob(s),t=new Uint8Array(e.length);for(let i=0;ii===".."||/^[a-z]+:/i.test(i))?"images":t.join("/")}function ML(s){return String(s||"SpineParticle").replace(/\.json$/i,"").replace(/[\\/:*?"<>|]+/g,"_").replace(/^\.+/,"")||"SpineParticle"}async function TL(s){const e=await WS(s.systems);if(!e.length)throw new Error("当前可见粒子系统没有可导出的图片");const t=SL(s.imagesPath);return{blob:bL(e.map(n=>({name:`${t}/${n.path}`,data:wL(n.dataBase64)}))),imageCount:e.length,folder:t}}function _L(s,e){const t=`${ML(e)}-images.zip`,i=URL.createObjectURL(s),n=document.createElement("a");return n.href=i,n.download=t,n.style.display="none",document.body.appendChild(n),n.click(),n.remove(),setTimeout(()=>URL.revokeObjectURL(i),1e3),t}function CL(s){s.settings.exportSettings=I1(s.settings.exportSettings);const e=Le(()=>s.settings.exportSettings),t=Fe(!1),i=Fe(null),n=Fe(""),r=Fe(!1),o=Fe(null),a=Fe(""),l=Fe(""),c=Le(()=>{const b=o.value;return b?b.available?b.spineFound?b.authorized?"连接器可用 · Spine 已就绪":"连接器已启动,当前网站尚未授权":"连接器已启动,但未找到 Spine":"本地 Spine 连接器未启动":"正在检测本地 Spine 连接器…"}),h=Le(()=>{var b,C,A,P,E,R;return{ready:!!((b=o.value)!=null&&b.available)&&!!((C=o.value)!=null&&C.spineFound)&&!!((A=o.value)!=null&&A.authorized),warning:!!((P=o.value)!=null&&P.available)&&(!((E=o.value)!=null&&E.spineFound)||!((R=o.value)!=null&&R.authorized))}}),u=Le(()=>{var b,C,A;return!!((b=o.value)!=null&&b.available)&&!!((C=o.value)!=null&&C.spineFound)&&!!((A=o.value)!=null&&A.authorized)}),d=Le(()=>{const b=o.value;return!(b!=null&&b.available)||!b.spineFound||b.authorized||typeof window>"u"?"":`http://127.0.0.1:27843/pair?origin=${encodeURIComponent(window.location.origin)}`}),f=Le(()=>{const b=o.value;return b?b.available?b.spineFound?b.authorized?"":"未授权":"未找到 Spine":"未启动":"检测中"}),m=Le(()=>t.value?"正在重新计算并生成 Spine 工程":f.value?`暂不可用:${f.value}`:`调用本机 Spine 自动生成 ${e.value.spineVersion} 工程`);ys(()=>{x(),p=window.setInterval(x,3e3)});let p,g=0;Rr(()=>{p!==void 0&&window.clearInterval(p)});async function x(){const b=++g,C=await fL();if(b!==g)return;o.value=C;const A=l.value;(A==="CONNECTOR_OFFLINE"?C.available:A==="SPINE_NOT_FOUND"?C.available&&C.spineFound:A==="ORIGIN_NOT_ALLOWED"?C.available&&C.spineFound&&C.authorized:!!A&&C.available&&C.spineFound&&C.authorized)&&(l.value="",a.value="",r.value&&(r.value=!1,n.value=""))}function v(){return new Promise(b=>requestAnimationFrame(()=>b()))}async function y(b){s.timeline.playing=!1,s.timeline.frame=0,s.timeline.recorded=!1;for(const P of s.systems)P.frames=void 0;s.recalcTotalFrames(),await v(),s.timeline.playing=!0;const C=s.timeline.totalFrames/Math.max(1,s.timeline.fps)*1e3,A=performance.now()+Math.max(8e3,C*2.5+3e3);for(;!s.timeline.recorded;){if(performance.now()>A)throw new Error("重新计算动画超时,请确认页面仍在运行后重试");b==null||b(Math.min(.98,s.timeline.frame/Math.max(1,s.timeline.totalFrames-1))),await new Promise(P=>setTimeout(P,50))}b==null||b(1)}async function w(){if(!t.value){t.value=!0,i.value="json",r.value=!1,l.value="",a.value="",n.value="正在重新计算粒子动画…";try{await y();const b=py({systems:s.systems,timeline:s.timeline,settings:e.value});Ey(b.text,e.value.spineVersion),iO(b,e.value.fileName);const C=b.warnings.length?`;${b.warnings.length} 条资源提示(缺图仍已导出)`:"";n.value=`已导出 Spine ${e.value.spineVersion}:${b.particleSystemCount} 个粒子系统、${b.animationCount} 个动画、${b.boneCount} 根骨骼${C}`}catch(b){r.value=!0,n.value=b instanceof Error?b.message:String(b)}finally{t.value=!1,i.value=null}}}async function _(){if(t.value)return;t.value=!0,i.value="spine",r.value=!1,l.value="",a.value="",n.value="正在重新计算粒子动画…";const b=Zw("导出 Spine 包","正在重新计算粒子动画…");try{await b.paint(),await y(E=>b.update(E*18,"正在重新计算粒子动画…")),b.update(20,"正在生成 Spine JSON…");const C=py({systems:s.systems,timeline:s.timeline,settings:e.value});Ey(C.text,e.value.spineVersion),n.value="正在整理图片并调用本机 Spine…";const A=e.value.fileName.replace(/\.json$/i,"")||"SpineParticle",P=await mL({projectName:A,spineVersion:e.value.spineVersion,skeletonJson:C.text,systems:s.systems},({phase:E,progress:R})=>{E==="images"?b.update(R==null?null:22+R*18,"正在整理工程图片…"):E==="upload"?b.update(R==null?null:40+R*30,"正在上传数据到 Spine 连接器…"):E==="processing"?b.update(null,"Spine 正在转换工程,请稍候…"):b.update(R==null?null:82+R*16,"正在下载生成的 Spine 工程包…")});b.update(99,"正在交给浏览器下载…"),pL(P.blob,P.fileName),n.value=`已生成 ${P.fileName}:包含 .spine 工程和 ${P.imageCount} 张图片,Spine ${P.spineEditorVersion}`,await x(),await b.finish("Spine 工程包已开始下载")}catch(C){const A=C instanceof Error?C.message:String(C);r.value=!0,l.value=C instanceof Bh?C.code:"",C instanceof Bh&&C.pairUrl&&(a.value=C.pairUrl),n.value=A,await x(),await b.fail(A)}finally{t.value=!1,i.value=null}}async function S(){if(!t.value){t.value=!0,i.value="images",r.value=!1,l.value="",a.value="",n.value="正在整理当前粒子系统使用的图片…";try{const b=await TL({systems:s.systems,imagesPath:e.value.imagesPath}),C=_L(b.blob,e.value.fileName);n.value=`已生成 ${C}:${b.folder}/ 内包含 ${b.imageCount} 张图片`}catch(b){r.value=!0,n.value=b instanceof Error?b.message:String(b)}finally{t.value=!1,i.value=null}}}return{exportSettings:e,exportBusy:t,exportTarget:i,exportMessage:n,exportError:r,connectorHealth:o,connectorPairUrl:a,connectorExportErrorCode:l,connectorStatusText:c,connectorStatusClass:h,connectorReady:u,connectorAuthorizationUrl:d,connectorDisabledReason:f,connectorButtonTitle:m,connectorHealthTimer:p,connectorHealthRequestId:g,refreshConnectorHealth:x,nextPaint:v,prepareExportFrames:y,exportSpineJson:w,exportSpineProject:_,exportSpineImages:S}}function EL(s){const e=Fe(null),t=Fe(""),i=Fe([]),n=Fe(!1),r=Fe(""),o=Fe(!1);function a(){Yw(s),o.value=!1,r.value="配置已保存到本地"}async function l(u){var m;const d=u.target,f=(m=d.files)==null?void 0:m[0];if(f){r.value="正在加载配置…",o.value=!1;try{await Xk(s,f),r.value=`已加载:${f.name}`}catch(p){o.value=!0,r.value=p instanceof Error?p.message:String(p)}finally{d.value=""}}}async function c(){try{const u=await fetch(`/Preset/index.json?t=${Date.now()}`,{cache:"no-store"});if(!u.ok)throw new Error("无法读取预设列表");const d=await u.json();i.value=Array.isArray(d)?d.filter(f=>!!f&&typeof f.name=="string"&&typeof f.file=="string"):[]}catch{i.value=[]}}async function h(){const u=t.value;if(!u)return;n.value=!0,o.value=!1,r.value="正在加载预设…";const d=Zw("加载预设",`正在下载 ${u}…`);try{await d.paint();const f=await fetch(`/Preset/${encodeURIComponent(u)}`,{cache:"no-store"});if(!f.ok)throw new Error(`无法读取预设:${u}`);const m=await E3(f,p=>{d.update(p==null?null:p*55,`正在下载 ${u}…`)});d.update(58,"正在解析预设配置…"),d.update(70,"正在解析并恢复预设资源…"),await jw(s,m),r.value=`已加载预设:${u.replace(/\.json$/i,"")}`,await d.finish("预设加载完成")}catch(f){o.value=!0;const m=f instanceof Error?f.message:String(f);r.value=`${m},请检查预设文件命名`,await d.fail(m)}finally{n.value=!1,t.value=""}}return ys(c),{configFileInput:e,selectedPreset:t,presetOptions:i,presetLoading:n,configMessage:r,configError:o,saveConfig:a,onConfigFileChange:l,refreshPresets:c,loadSelectedPreset:h}}function AL(s){const e=Fe(null),t=Fe(null),i=Fe(null),n=Fe(null),r=Fe(null);function o(){var F;const k=(F=s.value)==null?void 0:F.config;if(!k)return;const N=Math.max(0,...k.trailResources.map(V=>V.id))+1;k.trailResources.push({id:N,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:Am.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:Cm.map(V=>({...V})),shapeEnabled:!1,shapeCurve:Im.map(V=>({...V}))}),m()}function a(k){var N;r.value=k,(N=n.value)==null||N.click()}function l(k,N){var Y;const F=(Y=s.value)==null?void 0:Y.config;if(!F)return;const V=k==="trailGridCols"?32:16;F[k]=Math.min(V,Math.max(2,Math.round(Number(N)||2)))}function c(k,N){var V;const F=(V=s.value)==null?void 0:V.config.trailResources.find(Y=>Y.id===k);F&&(F.boneCount=Math.min(16,Math.max(2,Math.round(Number(N)||2))))}function h(k,N){var V;const F=(V=s.value)==null?void 0:V.config.trailResources.find(Y=>Y.id===k);F&&(F.rotation=Math.max(-360,Math.min(360,Number(N)||0)))}async function u(k){var z,se;const N=k.target,F=(z=N.files)==null?void 0:z[0],V=(se=s.value)==null?void 0:se.config,Y=V==null?void 0:V.trailResources.find(oe=>oe.id===r.value);if(!F||!Y){N.value="";return}const q=await C(F);Y.texture=vr(await Ke.fromURL(q)),Y.previewUrl=q,Y.textureName=F.name.replace(/\.[^.]+$/,"")||"trail",N.value="",r.value=null}async function d(k){var V;const N=(V=s.value)==null?void 0:V.config,F=N==null?void 0:N.trailResources.find(Y=>Y.id===k);F&&(F.texture=vr(await Ke.fromURL("/images/trail.png")),F.previewUrl="/images/trail.png",F.textureName="trail",F.weight=100,F.locked=!1,F.rotation=0,F.boneCount=3,F.trailRatio=100,F.lengthMode="fixed",F.length=100,F.lengthMin=100,F.lengthMax=100,F.widthSizeMode="fixed",F.width=100,F.widthMin=100,F.widthMax=100,F.widthMode="particle",F.lifeLengthEnabled=!1,F.lifeLengthCurve=Cm.map(Y=>({...Y})),F.shapeEnabled=!1,F.shapeCurve=Im.map(Y=>({...Y})),F.colorMode="particle",F.color="#ffffff",F.colorGradient=[{position:0,color:"#ffffff"},{position:1,color:"#ffffff"}],F.blend="normal",F.alphaMode="particle",F.alpha=1,F.alphaCurve=Am.map(Y=>({...Y})),m())}function f(k){var V;const N=(V=s.value)==null?void 0:V.config.trailResources;if(!N||N.length<=1)return;const F=N.findIndex(Y=>Y.id===k);F>=0&&N.splice(F,1),m()}function m(){var Y;const k=(Y=s.value)==null?void 0:Y.config.trailResources;if(!(k!=null&&k.length))return;if(k.length===1){k[0].weight=100,k[0].locked=!1;return}const N=k.filter(q=>q.locked),F=k.filter(q=>!q.locked);let V=N.reduce((q,z)=>q+Math.max(0,Number(z.weight)||0),0);V>100&&(G(N,100,!0),V=100),G(F,100-V)}function p(k,N){var se;const F=(se=s.value)==null?void 0:se.config.trailResources;if(!(F!=null&&F.length))return;if(F.length===1){F[0].weight=100,F[0].locked=!1;return}const V=F.find(oe=>oe.id===k);if(!V||V.locked)return;const Y=F.filter(oe=>oe.id!==k&&oe.locked).reduce((oe,de)=>oe+Math.max(0,Number(de.weight)||0),0),q=Math.max(0,100-Y),z=F.filter(oe=>oe.id!==k&&!oe.locked);V.weight=U(Math.min(q,Math.max(0,Number(N)||0))),z.length?G(z,q-V.weight,!0):V.weight=U(q)}function g(k){var V;const N=(V=s.value)==null?void 0:V.config.trailResources;if(!N||N.length===1)return;const F=N.find(Y=>Y.id===k);F&&(F.locked=!F.locked)}function x(k,N){const F=N.target;k.color=P(F.value,k.color),F.value=k.color}function v(k,N){x(k,N),N.target.blur()}function y(){var F;const k=(F=s.value)==null?void 0:F.config;if(!k)return;const N=Math.max(0,...k.imageResources.map(V=>V.id))+1;k.imageResources.push({id:N,texture:k.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:Em.map(V=>({...V}))}),$()}function w(k){var N;i.value=k,(N=e.value)==null||N.click()}function _(k){var N;i.value=k,(N=t.value)==null||N.click()}async function S(k){var se,oe;const N=k.target,F=(se=N.files)==null?void 0:se[0],V=(oe=s.value)==null?void 0:oe.config,Y=V==null?void 0:V.imageResources.find(de=>de.id===i.value);if(!F||!Y){N.value="";return}const q=await C(F),z=vr(await Ke.fromURL(q));Y.texture=z,Y.previewUrl=q,Y.textureFolder="",Y.textureName=F.name.replace(/\.[^.]+$/,"")||"particle",N.value="",i.value=null}async function b(k){var q;const N=k.target,F=Array.from(N.files||[]).sort((z,se)=>z.name.localeCompare(se.name,void 0,{numeric:!0,sensitivity:"base"})),V=(q=s.value)==null?void 0:q.config,Y=V==null?void 0:V.imageResources.find(z=>z.id===i.value);if(!F.length||!Y){N.value="";return}Y.sequenceFrames=await Promise.all(F.map(async z=>{const se=await C(z);return{name:z.name,previewUrl:se,texture:vr(await Ke.fromURL(se))}})),Y.imageMode="sequence",N.value="",i.value=null}function C(k){return new Promise((N,F)=>{const V=new FileReader;V.onload=()=>N(String(V.result||"")),V.onerror=()=>F(V.error),V.readAsDataURL(k)})}function A(k){var V;const N=(V=s.value)==null?void 0:V.config,F=N==null?void 0:N.imageResources.find(Y=>Y.id===k);!N||!F||(F.texture=N.texture,F.textureName="star",F.textureFolder="",F.previewUrl="/images/star.png",F.imageMode="fixed",F.sequencePlayback="loop-forward",F.sequenceFps=30,F.sequenceFrames=[],F.scale=1,F.anchorX=.5,F.anchorY=.5,F.colorMode="fixed",F.colorStart="#ffffff",F.colorEnd="#ff4d4d",F.colorGradient=[{position:0,color:"#ffffff"},{position:1,color:"#ff4d4d"}],F.blend="normal",F.independentAlpha="off",F.alpha=1,F.alphaCurveMode="跟随导出",F.alphaCurve=Em.map(Y=>({...Y})),F.locked=!1,$())}function P(k,N){let F=k.trim().replace(/^#/,"");return/^[0-9a-f]{3}$/i.test(F)&&(F=F.split("").map(V=>V+V).join("")),/^[0-9a-f]{6}$/i.test(F)?`#${F.toLowerCase()}`:N}function E(k,N){const F=N.target;k.colorStart=P(F.value,k.colorStart),F.value=k.colorStart}function R(k,N){E(k,N),N.target.blur()}function O(k){var V;const N=(V=s.value)==null?void 0:V.config.imageResources;if(!N||N.length<=1)return;const F=N.findIndex(Y=>Y.id===k);F>=0&&N.splice(F,1),$()}function U(k){return Math.round(k)}function G(k,N,F=!1){if(!k.length)return;const V=Math.max(0,U(N)),Y=F?k.reduce((z,se)=>z+Math.max(0,Number(se.weight)||0),0):0;let q=0;k.forEach((z,se)=>{const oe=se===k.length-1,de=U(oe?V-q:Y>0?V*Math.max(0,Number(z.weight)||0)/Y:V/k.length);z.weight=de,q+=de})}function $(){var Y;const k=(Y=s.value)==null?void 0:Y.config.imageResources;if(!(k!=null&&k.length))return;if(k.length===1){k[0].weight=100,k[0].locked=!1;return}const N=k.filter(q=>q.locked),F=k.filter(q=>!q.locked);let V=N.reduce((q,z)=>q+Math.max(0,Number(z.weight)||0),0);V>100&&(G(N,100,!0),V=100),G(F,100-V)}function X(k,N){var se;const F=(se=s.value)==null?void 0:se.config.imageResources;if(!(F!=null&&F.length))return;if(F.length===1){F[0].weight=100,F[0].locked=!1;return}const V=F.find(oe=>oe.id===k);if(!V||V.locked)return;const Y=F.filter(oe=>oe.id!==k&&oe.locked).reduce((oe,de)=>oe+Math.max(0,Number(de.weight)||0),0),q=Math.max(0,100-Y),z=F.filter(oe=>oe.id!==k&&!oe.locked);if(V.weight=U(Math.min(q,Math.max(0,Number(N)||0))),!z.length){V.weight=U(q);return}G(z,q-V.weight,!0)}function D(k){var V;const N=(V=s.value)==null?void 0:V.config.imageResources;if(!N||N.length===1)return;const F=N.find(Y=>Y.id===k);F&&(F.locked=!F.locked)}return{textureFileInput:e,sequenceFileInput:t,pendingResourceId:i,trailTextureFileInput:n,pendingTrailResourceId:r,addTrailResource:o,openTrailTexturePicker:a,onTrailRigChange:l,onTrailResourceBoneCountChange:c,onTrailResourceRotationChange:h,onTrailTextureFile:u,resetTrailTexture:d,removeTrailResource:f,rebalanceTrailWeights:m,setTrailResourceWeight:p,toggleTrailResourceLock:g,setTrailColor:x,commitTrailColor:v,addImageResource:y,openTexturePicker:w,openSequencePicker:_,onTextureFile:S,onSequenceFiles:b,readFileAsDataUrl:C,resetTexture:A,normalizeHex:P,setResourceFixedColor:E,commitResourceFixedColor:R,removeImageResource:O,roundWeight:U,distributeImageWeights:G,rebalanceImageWeights:$,setResourceWeight:X,toggleResourceLock:D}}function IL(){const s=yo(),{exportSettings:e,exportBusy:t,exportTarget:i,exportMessage:n,exportError:r,connectorPairUrl:o,connectorStatusText:a,connectorStatusClass:l,connectorReady:c,connectorAuthorizationUrl:h,connectorDisabledReason:u,connectorButtonTitle:d,refreshConnectorHealth:f,exportSpineJson:m,exportSpineProject:p,exportSpineImages:g}=CL(s),{configFileInput:x,selectedPreset:v,presetOptions:y,presetLoading:w,configMessage:_,configError:S,saveConfig:b,onConfigFileChange:C,refreshPresets:A,loadSelectedPreset:P}=EL(s);function E(Q){return Q==="跟随导出"?e.value.keyframeCurve==="bezier"?"bezier":"linear":Q==="贝塞尔"?"bezier":"linear"}s.systems.length||s.addSystem();const R=Le(()=>{const Q=s.systems.findIndex(le=>le.id===s.activeId);return Q>=0?Q:0}),O=Le(()=>s.systems[R.value]||null),{textureFileInput:U,sequenceFileInput:G,trailTextureFileInput:$,addTrailResource:X,openTrailTexturePicker:D,onTrailRigChange:k,onTrailResourceBoneCountChange:N,onTrailResourceRotationChange:F,onTrailTextureFile:V,resetTrailTexture:Y,removeTrailResource:q,setTrailResourceWeight:z,toggleTrailResourceLock:se,setTrailColor:oe,commitTrailColor:de,addImageResource:ge,openTexturePicker:he,openSequencePicker:fe,onTextureFile:H,onSequenceFiles:W,resetTexture:Z,setResourceFixedColor:L,commitResourceFixedColor:B,removeImageResource:j,setResourceWeight:ie,toggleResourceLock:ue}=AL(O),me=Le(()=>O.value?R1(O.value.config,s.timeline.fps):30),ee=Le(()=>{var le;const Q=(le=O.value)==null?void 0:le.config;return Q?Math.max(1,Math.ceil(Number(Q.loopDurationFrames)||1)):1}),Me=Le(()=>s.activeObjectType),be=Le(()=>s.activeObjectType==="collision"&&s.colliders.find(Q=>Q.id===s.activeObjectId)||null),pe=Le(()=>s.activeObjectType==="path"&&s.paths.find(Q=>Q.id===s.activeObjectId)||null),Ne=Le(()=>s.activeObjectType==="spine"&&s.spines.find(Q=>Q.id===s.activeObjectId)||null),Ye=Le(()=>s.activeObjectType==="particle"?s.systems.some(Q=>Q.id===s.activeObjectId):s.activeObjectType==="collision"?s.colliders.some(Q=>Q.id===s.activeObjectId):s.activeObjectType==="path"?s.paths.some(Q=>Q.id===s.activeObjectId):s.spines.some(Q=>Q.id===s.activeObjectId)),st=Le(()=>{const Q=s.spines.find(le=>le.selectedBone&&le.bones.some(Se=>Se.name===le.selectedBone));return Q?{spine:Q,boneName:Q.selectedBone}:null}),Ze=Le(()=>{var Se;const Q=(Se=O.value)==null?void 0:Se.config;if(!Q||Q.emitterFollowMode!=="bone")return null;const le=s.spines.find(et=>et.id===Q.emitterFollowSpineId);return!le||!le.bones.some(et=>et.name===Q.emitterFollowBoneName)?null:{spine:le,boneName:Q.emitterFollowBoneName}}),nt=Fe(!1),Ve=Fe(""),Ee=Le(()=>s.spines.filter(Q=>Q.enabled&&Q.visible!==!1&&Q.status==="ready")),Je=Le(()=>s.spines.find(Q=>{var le;return Q.id===((le=O.value)==null?void 0:le.config.renderLayerSpineId)})||null),Ae=Le(()=>{const Q=Je.value;return!!Q&&Q.enabled&&Q.visible!==!1&&Q.status==="ready"}),Qt=Le(()=>{var Q;return[...((Q=Je.value)==null?void 0:Q.slots)||[]].sort((le,Se)=>le.order-Se.order)}),ut=Le(()=>{const Q=Ve.value.trim().toLocaleLowerCase();return Q?Qt.value.filter(le=>le.name.toLocaleLowerCase().includes(Q)||le.attachment.toLocaleLowerCase().includes(Q)):Qt.value}),re=Le(()=>Qt.value.find(Q=>{var le;return Q.name===((le=O.value)==null?void 0:le.config.renderLayerSlotName)})||null),ae=Le(()=>{const Q=re.value;return Q&&Qt.value.filter(le=>le.orderSe.order-le.order)[0]||null}),Qe=Le(()=>{var et;const Q=(et=O.value)==null?void 0:et.config,le=Je.value,Se=re.value;return!Q||!le||!Se?"":`${le.name} / ${Se.name} · 图片${Q.renderLayerSlotPosition==="below"?"之下":"之上"}`}),It=Le(()=>{var Se;const Q=(Se=O.value)==null?void 0:Se.config,le=re.value;return!Q||!le?"":Q.renderLayerSlotPosition==="above"?`渲染在 ${le.name} 图片之上、其后插槽之下`:ae.value?`渲染在 ${ae.value.name} 与 ${le.name} 之间`:""}),kt=Le(()=>{var Se;const Q=(Se=O.value)==null?void 0:Se.config;if(!Q||Q.renderLayerMode!=="slot")return"";if(!Ee.value.length)return"没有已加载的 Spine,粒子临时显示在最上层。";if(!Q.renderLayerSpineId)return"尚未选择 Spine,粒子临时显示在最上层。";const le=Je.value;return le?!le.enabled||le.status!=="ready"?"目标 Spine 未就绪,粒子临时显示在最上层。":Q.renderLayerSlotName?re.value?Q.renderLayerSlotPosition==="below"&&!ae.value?"这是第一个插槽,无法显示在其下方,粒子临时显示在最上层。":"":"目标插槽不存在(资源可能已更换),粒子临时显示在最上层。":"":"目标 Spine 不存在,粒子临时显示在最上层。"});function ot(){var le;const Q=(le=O.value)==null?void 0:le.config;Q&&(Q.renderLayerMode="slot",!Q.renderLayerSpineId&&Ee.value.length&&(Q.renderLayerSpineId=Ee.value[0].id),nt.value=!Q.renderLayerSlotName)}function Gi(Q){var Se;const le=(Se=O.value)==null?void 0:Se.config;le&&(le.renderLayerSpineId=Math.max(0,Math.round(Number(Q.target.value)||0)),le.renderLayerSlotName="",nt.value=!0)}function xs(Q){var Se;const le=(Se=O.value)==null?void 0:Se.config;le&&(le.renderLayerSlotName=Q.name,nt.value=!1,Ve.value="")}function Nt(){var le;const Q=(le=O.value)==null?void 0:le.config;Q&&(Q.renderLayerSlotName="",Q.renderLayerSlotPosition="above")}const vi=Fe(!1),Xt=Le(()=>{var le;const Q=new Set(((le=O.value)==null?void 0:le.config.collisionColliderIds)||[]);return s.colliders.filter(Se=>Q.has(Se.id))}),ji=Le(()=>{var le;const Q=new Set(((le=O.value)==null?void 0:le.config.collisionColliderIds)||[]);return s.colliders.filter(Se=>!Q.has(Se.id))});ai(()=>{var Q,le;return[(Q=O.value)==null?void 0:Q.id,(le=O.value)==null?void 0:le.config.collision]},()=>{vi.value=!1}),ai(()=>{var Q;return(Q=O.value)==null?void 0:Q.id},()=>{nt.value=!1,Ve.value=""});function ni(Q){var Se;const le=(Se=O.value)==null?void 0:Se.config;!le||le.collisionColliderIds.includes(Q)||(le.collisionColliderIds.push(Q),vi.value=!1)}function bs(Q){var Se;const le=(Se=O.value)==null?void 0:Se.config;le&&(le.collisionColliderIds=le.collisionColliderIds.filter(et=>et!==Q))}Lo(()=>{for(const Q of s.systems)Q.visible==null&&(Q.visible=!0);for(const Q of s.colliders)Q.visible==null&&(Q.visible=!0);for(const Q of s.paths)Q.visible==null&&(Q.visible=!0);for(const Q of s.spines)Q.visible==null&&(Q.visible=!0)}),Lo(()=>{if(!O.value)return;const Q=Xn(O.value.config);Q.lifeMode==="curve"&&(Q.lifeMode="random"),Q.speedMode==="curve"&&(Q.speedMode="random"),Q.scaleMode==="curve"&&(Q.scaleMode="random"),Q.initialRotationMode==="curve"&&(Q.initialRotationMode="random"),Q.mode==="stream"&&!(Q.duration>0)&&(Q.duration=1),Q.streamBehavior==="loop"&&(Q.emitterFollow||Q.emitterFollowMode!=="none")&&gn(Q)}),Lo(()=>{const Q=new Set(s.colliders.map(Se=>Se.id)),le=new Set(s.systems.map(Se=>Se.id));for(const Se of s.systems){const et=Xn(Se.config),ei=et.collisionColliderIds.filter(Ji=>Q.has(Ji));ei.length!==et.collisionColliderIds.length&&(et.collisionColliderIds=ei),et.spawnPathId>0&&!s.paths.some(Ji=>Ji.id===et.spawnPathId)&&(et.spawnPathId=0,(et.emissionAngleMode==="path-normal"||et.emissionAngleMode==="path-tangent")&&(et.emissionAngleMode="fixed"));const Mo=k1(s.systems,Se.id);for(const Ji of et.events||[])Ji.targetSystemId>0&&(Ji.targetSystemId===Se.id||Mo.has(Ji.targetSystemId)||!le.has(Ji.targetSystemId))&&(Ji.targetSystemId=0);if(et.emitterFollowMode!=="bone")continue;const _u=s.spines.find(Ji=>Ji.id===et.emitterFollowSpineId);!!(_u!=null&&_u.bones.some(Ji=>Ji.name===et.emitterFollowBoneName))||(et.emitterFollowMode="none",et.emitterFollowSpineId=0,et.emitterFollowBoneName="")}}),Lo(()=>{for(const Q of s.systems){const le=Xn(Q.config);le.renderLayerMode!=="slot"||!le.renderLayerSpineId||s.spines.some(Se=>Se.id===le.renderLayerSpineId)||(le.renderLayerSpineId=0,le.renderLayerSlotName="")}}),Lo(()=>{for(const Q of s.colliders)Q.followPathId==null&&(Q.followPathId=0),Q.followDuration>0||(Q.followDuration=2),Q.followPathRotation==null&&(Q.followPathRotation=!1),["跟随导出","线性","贝塞尔"].includes(Q.followCurveMode)||(Q.followCurveMode="跟随导出"),(!Array.isArray(Q.followCurve)||Q.followCurve.length<2)&&(Q.followCurve=[{x:0,y:0},{x:1,y:1}])});const ws=po({config:!0,scene:!1,emitMode:!0,shape:!0,attr:!0,look:!0,mods:!0,export:!1});function $s(Q){ws[Q]=!ws[Q]}function Zi(Q){var Se;const le=(Se=O.value)==null?void 0:Se.config;le&&(le.mode=Q,Q==="stream"&&!(le.duration>0)&&(le.duration=1))}function Zn(Q){var et;const le=(et=O.value)==null?void 0:et.config;if(!le)return;const Se=Math.min(1800,Math.max(1,Math.ceil(Number(Q)||1)));le.loopDurationFrames=Se}function gn(Q){const le=Sl();Q.emitterFollow=!1,Q.emitterFollowMode="none",Q.emitterFollowPathId=le.emitterFollowPathId,Q.emitterFollowSpineId=le.emitterFollowSpineId,Q.emitterFollowBoneName=le.emitterFollowBoneName,Q.emitterFollowBoneOffsetX=le.emitterFollowBoneOffsetX,Q.emitterFollowBoneOffsetY=le.emitterFollowBoneOffsetY,Q.emitterFollowBoneRotation=le.emitterFollowBoneRotation,Q.emitterFollowBoneScaleX=le.emitterFollowBoneScaleX,Q.emitterFollowBoneScaleY=le.emitterFollowBoneScaleY,Q.emitterAngleMode=le.emitterAngleMode,Q.emitterFollowCurve=le.emitterFollowCurve.map(Se=>({...Se})),Q.emitterFollowDuration=le.emitterFollowDuration,Q.emitterFollowSpace=le.emitterFollowSpace,Q.emitterFollowDirection=le.emitterFollowDirection,Q.emitterFollowOffset=le.emitterFollowOffset}function Sa(Q){var ei;const le=(ei=O.value)==null?void 0:ei.config;if(!le||le.streamBehavior===Q)return;const Se=Q==="loop",et=Se?"进入循环持续模式后,粒子跟随设置会失效并恢复默认值。是否继续?":"退出循环持续模式后,粒子跟随设置会失效并恢复默认值。是否继续?";window.confirm(et)&&(gn(le),le.streamBehavior=Q,Se||(le.generateLoopStartAnimation=!1,le.generateLoopEndAnimation=!1))}function Ma(Q,le){var ei;const Se=(ei=O.value)==null?void 0:ei.config;if(!Se)return;const et=le.target.checked;Q==="start"?Se.generateLoopStartAnimation=et:Se.generateLoopEndAnimation=et}function Dl(Q,le){var ei;const Se=(ei=O.value)==null?void 0:ei.config;if(!Se)return;const et=Math.min(1800,Math.max(1,Math.ceil(Number(le.target.value)||30)));Q==="start"?Se.loopStartDurationFrames=et:Se.loopEndDurationFrames=et}function Ul(Q,le){var ei;const Se=(ei=O.value)==null?void 0:ei.config;if(!Se)return;const et=le.target.checked;Q==="start"?Se.loopStartUseCustomDuration=et:Se.loopEndUseCustomDuration=et}function Ta(Q,le){const Se=Q.target.value;if(le.emitterFollowMode=Se,Se!=="bone"){le.emitterFollowSpineId=0,le.emitterFollowBoneName="";return}_a(le)}function _a(Q){const le=st.value;if(!le){Q.emitterFollowMode="none",Q.emitterFollowSpineId=0,Q.emitterFollowBoneName="";return}Q.emitterFollowMode="bone",Q.emitterFollowSpineId=le.spine.id,Q.emitterFollowBoneName=le.boneName}const Ca={emitMode:["mode","rate","streamBehavior","loopDurationFrames","generateLoopStartAnimation","loopStartUseCustomDuration","loopStartDurationFrames","generateLoopEndAnimation","loopEndUseCustomDuration","loopEndDurationFrames","burstCount","burstLoop","delay","duration"],shape:["shape","showShape","shapeRangeVersion","innerRadius","outerRadius","innerRectW","innerRectH","outerRectW","outerRectH","spawnPathId","spawnPathDistribution","radius","rectW","rectH","emissionAngleMode","direction","spread","coneDirection","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","renderLayerMode","renderLayerSpineId","renderLayerSlotName","renderLayerSlotPosition","renderLayerFollowAttachment"],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","showForceFieldShape","vortex","vortexStrength","vortexRadius","vortexCenterX","vortexCenterY","vortexFalloff","showVortexShape","attraction","attractionCenterX","attractionCenterY","attractionRadius","attractionDuration","attractionDelay","attractionDelayMode","attractionPath","showAttractionShape","trail","trailConfigVersion","trailResources","trailResourceVersion","trailTexture","trailTextureName","trailPreviewUrl","trailColorMode","trailColor","trailColorGradient","trailAlphaMode","trailAlpha","trailAlphaCurve","trailBoneCount","trailLength","trailWidth","trailWidthMode","trailLifeLengthEnabled","trailLifeLengthCurve","trailShapeEnabled","trailShapeCurve","trailGridRows","trailGridCols","collision","collisionColliderIds","pathFollow","eventEnabled","events","emitterFollow","emitterFollowMode","emitterFollowPathId","emitterFollowSpineId","emitterFollowBoneName","emitterFollowBoneOffsetX","emitterFollowBoneOffsetY","emitterFollowBoneRotation","emitterFollowBoneScaleX","emitterFollowBoneScaleY","emitterAngleMode","emitterFollowCurve","emitterFollowDuration","emitterFollowSpace","emitterFollowDirection","emitterFollowOffset","damping"]};function $l(Q){var et;const le=(et=O.value)==null?void 0:et.config;if(Q==="export"){s.settings.exportSettings=_p();return}if(!le)return;const Se=Sl();for(const ei of Ca[Q])le[ei]=Se[ei]}function Mu(){e.value.fps=Math.min(240,Math.max(1,Math.round(Number(e.value.fps)||30)))}function Ea(Q){var le;s.selectSystem(((le=s.systems[Q])==null?void 0:le.id)??0)}function Jn(){s.addSystem()}function So(){s.addCollider()}function Tu(){s.addPath()}function Xl(){s.addSpine()}function ZS(){s.duplicateSelectedObject()}function vn(Q,le,Se=0,et=0,ei=0,Mo=0){return{x:Q,y:le,inX:Se,inY:et,outX:ei,outY:Mo}}function JS(){const Q=pe.value;if(!(!Q||!Q.preset))if(Q.preset==="circle"){const Se=60.751328;Q.points=[vn(110,0,0,-Se,0,Se),vn(0,110,Se,0,-Se,0),vn(-110,0,0,Se,0,-Se),vn(0,-110,-Se,0,Se,0)],Q.closed=!0}else if(Q.preset==="square")Q.points=[vn(-100,-100),vn(100,-100),vn(100,100),vn(-100,100)],Q.closed=!0;else{const le=Q.preset==="star"?10:6;Q.points=Array.from({length:le},(Se,et)=>{const ei=Q.preset==="star"&&et%2?50:110,Mo=-Math.PI*.5+et/le*Math.PI*2;return vn(Math.cos(Mo)*ei,Math.sin(Mo)*ei)}),Q.closed=!0}}function QS(){pe.value&&(pe.value.points=[])}function eM(){O.value&&(O.value.config.seed=Math.floor(Math.random()*999999)+1)}function tM(Q){var Se;const le=(Se=O.value)==null?void 0:Se.config;!le||Q==="direction"||(le.speedOverLifeMode=Q,Q==="curve"&&le.speedOverLifeMin===le.speedOverLifeMax&&(le.speedOverLifeMin=0,le.speedOverLifeMax=1))}function Yp(){var le;const Q=(le=O.value)==null?void 0:le.config;!Q||Q.scaleOverLifeMode!=="curve"||(Q.scaleOverLifeMin===Q.scaleOverLifeMax&&(Q.scaleOverLifeMin=0,Q.scaleOverLifeMax=1),Q.scaleYOverLifeMin===Q.scaleYOverLifeMax&&(Q.scaleYOverLifeMin=0,Q.scaleYOverLifeMax=1))}function iM(Q){var Se;const le=(Se=O.value)==null?void 0:Se.config;!le||Q==="direction"||(le.scaleOverLifeMode=Q,Yp())}const sM={point:{emissionAngleMode:"random",direction:0,spread:360},circle:{innerRadius:0,outerRadius:100,emissionAngleMode:"fixed",direction:-90,spread:0},rect:{innerRectW:0,innerRectH:0,outerRectW:200,outerRectH:100,emissionAngleMode:"fixed",direction:-90,spread:0},cone:{innerRadius:0,outerRadius:100,coneAngle:90,coneDirection:90,emissionAngleMode:"random",direction:90,spread:90},path:{spawnPathId:0,spawnPathDistribution:"fixed",emissionAngleMode:"fixed",direction:0,spread:0}};function nM(){var Se;const Q=(Se=O.value)==null?void 0:Se.config;if(!Q)return;const le=sM[Q.shape];le&&Object.assign(Q,le)}function rM(){var le;const Q=(le=O.value)==null?void 0:le.config;!Q||Q.spawnPathId>0||(Q.emissionAngleMode==="path-normal"||Q.emissionAngleMode==="path-tangent")&&(Q.emissionAngleMode="fixed")}return{store:s,exportSettings:e,exportBusy:t,exportTarget:i,exportMessage:n,exportError:r,connectorPairUrl:o,connectorStatusText:a,connectorStatusClass:l,connectorReady:c,connectorAuthorizationUrl:h,connectorDisabledReason:u,connectorButtonTitle:d,refreshConnectorHealth:f,exportSpineJson:m,exportSpineProject:p,exportSpineImages:g,configFileInput:x,selectedPreset:v,presetOptions:y,presetLoading:w,configMessage:_,configError:S,saveConfig:b,onConfigFileChange:C,refreshPresets:A,loadSelectedPreset:P,resolvedCurveEditorMode:E,sys:O,textureFileInput:U,sequenceFileInput:G,trailTextureFileInput:$,addTrailResource:X,openTrailTexturePicker:D,onTrailRigChange:k,onTrailResourceBoneCountChange:N,onTrailResourceRotationChange:F,onTrailTextureFile:V,resetTrailTexture:Y,removeTrailResource:q,setTrailResourceWeight:z,toggleTrailResourceLock:se,setTrailColor:oe,commitTrailColor:de,addImageResource:ge,openTexturePicker:he,openSequencePicker:fe,onTextureFile:H,onSequenceFiles:W,resetTexture:Z,setResourceFixedColor:L,commitResourceFixedColor:B,removeImageResource:j,setResourceWeight:ie,toggleResourceLock:ue,automaticLoopDuration:me,loopDurationFrames:ee,activeObjectType:Me,activeCollider:be,activePath:pe,activeSpine:Ne,canCopyObject:Ye,selectedSpineBone:st,boundSpineBone:Ze,renderLayerSlotPickerOpen:nt,renderLayerSlotSearch:Ve,renderLayerReadySpines:Ee,renderLayerSpineReady:Ae,renderLayerSlots:Qt,renderLayerFilteredSlots:ut,renderLayerSlotLabel:Qe,renderLayerResolvedLabel:It,renderLayerWarning:kt,setRenderLayerSlotMode:ot,selectRenderLayerSpine:Gi,pickRenderLayerSlot:xs,clearRenderLayerSlot:Nt,collisionPickerOpen:vi,selectedCollisionBodies:Xt,availableCollisionBodies:ji,addCollisionBody:ni,removeCollisionBody:bs,collapsed:ws,toggle:$s,setEmitMode:Zi,setLoopDurationFrames:Zn,setStreamBehavior:Sa,setLoopSection:Ma,setLoopSectionDuration:Dl,setLoopCustomDuration:Ul,onEmitterFollowModeChange:Ta,bindSelectedBone:_a,resetModule:$l,normalizeExportFps:Mu,select:Ea,addSys:Jn,addCollider:So,addPath:Tu,addSpine:Xl,copySelectedObject:ZS,applyPathPreset:JS,clearPathAnchors:QS,randomizeSeed:eM,setSpeedOverLifeMode:tM,prepareScaleOverLifeCurve:Yp,setScaleOverLifeMode:iM,onShapeChange:nM,onSpawnPathChange:rM,LINEAR_CURVE:T3,FLAT_CURVE:Cm,ALPHA_CURVE:_3,RESOURCE_ALPHA_CURVE:Em,TRAIL_ALPHA_CURVE:Am,TRAIL_SHAPE_CURVE:Im}}const zS=Symbol("particle-panel");function RL(){const s=IL();return cx(zS,s),s}function Fr(){const s=qo(zS);if(!s)throw new Error("Particle panel sections require a ParticlePanel parent");return s}const PL={class:"group config-management"},kL={class:"caret"},FL={class:"group-body config-management-body"},OL={class:"config-toolbar"},LL=["disabled"],BL={value:""},NL=["value"],DL=Zt({__name:"ProjectConfigSection",setup(s){const{configFileInput:e,selectedPreset:t,presetOptions:i,presetLoading:n,configMessage:r,configError:o,saveConfig:a,onConfigFileChange:l,refreshPresets:c,loadSelectedPreset:h,collapsed:u,toggle:d,select:f}=Fr();return(m,p)=>(K(),J("div",PL,[T("div",{class:"group-head",onClick:p[0]||(p[0]=g=>I(d)("config"))},[T("span",kL,ve(I(u).config?"▸":"▾"),1),p[8]||(p[8]=T("span",null,"配置管理",-1))]),ce(T("div",FL,[T("div",OL,[T("button",{title:"保存全部编辑器配置 (Ctrl+S)",onClick:p[1]||(p[1]=(...g)=>I(a)&&I(a)(...g))},"保存配置"),T("button",{title:"加载本地编辑器配置",onClick:p[2]||(p[2]=g=>{var x;return(x=I(e))==null?void 0:x.click()})},"加载配置"),ce(T("select",{"onUpdate:modelValue":p[3]||(p[3]=g=>jt(t)?t.value=g:null),"aria-label":"预设列表",disabled:!I(i).length||I(n),onPointerdown:p[4]||(p[4]=(...g)=>I(c)&&I(c)(...g)),onFocus:p[5]||(p[5]=(...g)=>I(c)&&I(c)(...g)),onChange:p[6]||(p[6]=(...g)=>I(h)&&I(h)(...g))},[T("option",BL,ve(I(i).length?"选择预设":"无预设文件"),1),(K(!0),J(_e,null,Et(I(i),g=>(K(),J("option",{key:g.file,value:g.file},ve(g.name),9,NL))),128))],40,LL),[[bt,I(t)]]),T("input",{ref_key:"configFileInput",ref:e,hidden:"",type:"file",accept:".json,application/json",onChange:p[7]||(p[7]=(...g)=>I(l)&&I(l)(...g))},null,544)]),I(r)?(K(),J("div",{key:0,class:Ce(["config-message",{error:I(o)}])},ve(I(r)),3)):xe("",!0)],512),[[Si,!I(u).config]])]))}}),UL=Jt(DL,[["__scopeId","data-v-cb52d3e0"]]),$L={class:"ns-label"},XL=["min","max","step","value","disabled"],VL=["min","max","step","value","disabled"],YL=Zt({__name:"NumSlider",props:{label:{},modelValue:{},min:{},max:{},step:{},disabled:{type:Boolean}},emits:["update:modelValue"],setup(s,{emit:e}){const t=s,i=e,n=Fe(String(t.modelValue));ai(()=>t.modelValue,l=>{n.value=String(l)});function r(l){const c=parseFloat(l.target.value);Number.isNaN(c)||i("update:modelValue",c)}function o(l){n.value=l.target.value;const c=parseFloat(n.value);Number.isNaN(c)||i("update:modelValue",c)}function a(){const l=parseFloat(n.value);Number.isNaN(l)&&(n.value=String(t.modelValue))}return(l,c)=>(K(),J("div",{class:Ce(["ns",{disabled:s.disabled}])},[T("span",$L,ve(s.label),1),T("input",{type:"range",class:"ns-range",min:s.min,max:s.max,step:s.step,value:s.modelValue,disabled:s.disabled,onInput:r},null,40,XL),T("input",{type:"number",class:"ns-num",min:s.min,max:s.max,step:s.step,value:n.value,disabled:s.disabled,onInput:o,onBlur:a},null,40,VL)],2))}}),Oe=Jt(YL,[["__scopeId","data-v-7c2fbed0"]]),GL={class:"ce"},jL={class:"ce-editor"},HL={class:"ce-grid"},WL=["x1","x2","y2"],zL=["y1","x2","y2"],qL=["x","y","width","height"],KL=["d"],ZL={key:0,class:"ce-handles"},JL=["x1","y1","x2","y2"],QL=["cx","cy","onPointerdown"],eB=["x1","y1","x2","y2"],tB=["cx","cy","onPointerdown"],iB=["cx","cy"],sB=["cx","cy","onPointerdown","onDblclick"],nB={class:"ce-nav"},rB={class:"ce-tip"},ir=8,oB=Zt({__name:"CurveEditor",props:{modelValue:{},defaultValue:{default:()=>[{x:0,y:0},{x:1,y:1}]},mode:{default:"linear"}},emits:["update:modelValue"],setup(s,{emit:e}){const t=s,i=e,n=Fe(null),r=Fe(300),o=Fe(110);let a=null;function l(){if(!n.value)return;const E=n.value.getBoundingClientRect();r.value=E.width,o.value=E.height}function c(E){return ir+E*(r.value-ir*2)}function h(E){return ir+(1-E)*(o.value-ir*2)}function u(){return[...t.modelValue].sort((E,R)=>E.x-R.x)}function d(E){i("update:modelValue",[...E].sort((R,O)=>R.x-O.x))}function f(){d(t.defaultValue.map(E=>({...E})))}const m=Le(()=>u());function p(E){const R=m.value[E],O=m.value[Math.max(0,E-1)];return{x:R.x-(R.x-O.x)/3,y:R.y-(R.y-O.y)/3}}function g(E){const R=m.value[E],O=m.value[Math.min(m.value.length-1,E+1)];return{x:R.x+(O.x-R.x)/3,y:R.y+(O.y-R.y)/3}}function x(E){const R=m.value[E],O=p(E);return{x:R.x+(R.inX??O.x-R.x),y:R.y+(R.inY??O.y-R.y)}}function v(E){const R=m.value[E],O=g(E);return{x:R.x+(R.outX??O.x-R.x),y:R.y+(R.outY??O.y-R.y)}}const y=Le(()=>{if(!m.value.length)return"";let E=`M ${c(m.value[0].x)} ${h(m.value[0].y)}`;for(let R=1;RMath.abs(G.x-R)>.02);U.push({x:R,y:O}),d(U)}let b={t:0,i:-1,x:0,y:0};function C(E,R){E.stopPropagation();const O=u().findIndex(X=>Math.abs(X.x-m.value[R].x)<1e-6&&Math.abs(X.y-m.value[R].y)<1e-6);if(O<0)return;const U=Date.now();if(U-b.t<300&&b.i===R&&Math.abs(E.clientX-b.x)<8&&Math.abs(E.clientY-b.y)<8){b={t:0,i:-1,x:0,y:0},P(R);return}b={t:U,i:R,x:E.clientX,y:E.clientY};const G=X=>{(Math.abs(X.clientX-E.clientX)>8||Math.abs(X.clientY-E.clientY)>8)&&(b={t:0,i:-1,x:0,y:0});const{x:D,y:k}=w(X.clientX,X.clientY),N=u();N[O]={x:D,y:k},d(N)},$=()=>{window.removeEventListener("pointermove",G),window.removeEventListener("pointerup",$)};window.addEventListener("pointermove",G),window.addEventListener("pointerup",$)}function A(E,R,O){E.stopPropagation();const U=$=>{const X=w($.clientX,$.clientY),D=u(),k=D[R],N=O==="in"?D[Math.max(0,R-1)].x:k.x,F=O==="in"?k.x:D[Math.min(D.length-1,R+1)].x,V=Math.min(F,Math.max(N,X.x)),Y=Math.round((V-k.x)*100)/100,q=Math.round((X.y-k.y)*100)/100;D[R]=O==="in"?{...k,inX:Y,inY:q}:{...k,outX:Y,outY:q},d(D)},G=()=>{window.removeEventListener("pointermove",U),window.removeEventListener("pointerup",G)};window.addEventListener("pointermove",U),window.addEventListener("pointerup",G)}function P(E,R){R==null||R.stopPropagation();const O=u();O.length<=2||(_=Date.now(),d(O.filter((U,G)=>G!==E)))}return ys(()=>{l(),a=new ResizeObserver(l),n.value&&a.observe(n.value)}),Al(()=>{a==null||a.disconnect()}),(E,R)=>(K(),J("div",GL,[T("div",jL,[(K(),J("svg",{ref_key:"svg",ref:n,class:"ce-svg",onDblclick:S},[T("g",HL,[(K(),J(_e,null,Et([.25,.5,.75],O=>T("line",{key:"v"+O,x1:c(O),y1:"0",x2:c(O),y2:h(0)},null,8,WL)),64)),(K(),J(_e,null,Et([.25,.5,.75],O=>T("line",{key:"h"+O,x1:"0",y1:h(O),x2:c(1),y2:h(O)},null,8,zL)),64))]),T("rect",{x:c(0),y:h(1),width:c(1)-c(0),height:h(0)-h(1),class:"ce-frame",fill:"none"},null,8,qL),T("path",{d:y.value,class:"ce-line",fill:"none"},null,8,KL),s.mode==="bezier"?(K(),J("g",ZL,[(K(!0),J(_e,null,Et(m.value,(O,U)=>(K(),J(_e,{key:"handles-"+U},[U>0?(K(),J("line",{key:0,x1:c(O.x),y1:h(O.y),x2:c(x(U).x),y2:h(x(U).y)},null,8,JL)):xe("",!0),U>0?(K(),J("circle",{key:1,cx:c(x(U).x),cy:h(x(U).y),r:"4",onPointerdown:G=>A(G,U,"in")},null,40,QL)):xe("",!0),UA(G,U,"out")},null,40,tB)):xe("",!0)],64))),128))])):xe("",!0),(K(!0),J(_e,null,Et(m.value,(O,U)=>(K(),J("g",{key:U},[T("circle",{cx:c(O.x),cy:h(O.y),r:"5",class:"ce-node"},null,8,iB),T("circle",{cx:c(O.x),cy:h(O.y),r:"9",class:"ce-hit",onPointerdown:G=>C(G,U),onDblclick:G=>P(U,G)},null,40,sB)]))),128))],544)),T("div",nB,[T("span",rB,ve(s.mode==="bezier"?"拖动方形手柄调整弧度·双击空白新建·双击节点删除":"双击空白新建·双击节点删除·拖动节点调整"),1)])]),T("button",{class:"ce-reset",type:"button",title:"恢复默认曲线",onClick:f},"重置")]))}}),tn=Jt(oB,[["__scopeId","data-v-9bfb7b31"]]),aB={class:"spine-editor"},lB={class:"field wide"},cB={class:"grid three"},hB={class:"field"},uB={class:"field"},dB={class:"field"},fB={class:"grid three"},mB={class:"field"},pB={class:"field"},gB={class:"field"},vB=["disabled"],yB={class:"asset-row"},xB=["title"],bB={class:"asset-row"},wB=["title"],SB={class:"asset-row"},MB=["title"],TB={class:"asset-actions"},_B=["disabled"],CB={class:"runtime-note"},EB={key:0},AB={key:0,class:"error"},IB={class:"section-box"},RB={key:0,class:"empty"},PB={key:1,class:"field wide"},kB=["value"],FB={class:"section-box"},OB={class:"tree-title-row"},LB=["disabled","title"],BB=["disabled","title"],NB={class:"tree-tabs"},DB={key:0,class:"empty"},UB={key:1,class:"bone-search"},$B={key:2,class:"empty"},XB={key:3,class:"bone-tree"},VB=["onClick","onKeydown"],YB=["title","onClick"],GB={key:1,class:"bone-leaf"},jB={class:"bone-name"},HB={key:0,class:"empty"},WB={key:1,class:"bone-search"},zB={key:2,class:"empty"},qB={key:3,class:"bone-tree slot-tree"},KB=["title","onClick","onKeydown"],ZB={class:"slot-order"},JB={class:"bone-name"},QB={class:"slot-attachment"},eN=Zt({__name:"SpineObjectPanel",props:{spineObject:{}},setup(s){const e=s,t=yo(),i=Fe(null),n=Fe(null),r=Fe(null),o=Fe(null),a=Fe(new Set),l=Fe(""),c=Fe("bone"),h=Fe(""),u=Fe(null),d=Fe(null),f=Fe([]);e.spineObject.selectedBone==null&&(e.spineObject.selectedBone=""),e.spineObject.selectedSlot==null&&(e.spineObject.selectedSlot=""),Array.isArray(e.spineObject.slots)||(e.spineObject.slots=[]),e.spineObject.sourceBundle==null&&(e.spineObject.sourceBundle=null),e.spineObject.dataVersion==null&&(e.spineObject.dataVersion="");const m=Le(()=>{var F;return((F=u.value)==null?void 0:F.name)||e.spineObject.skeletonFileName}),p=Le(()=>{var F;return((F=d.value)==null?void 0:F.name)||e.spineObject.atlasFileName}),g=Le(()=>f.value.length?f.value.map(F=>F.name):e.spineObject.textureFileNames),x=Le(()=>g.value.length?`${g.value.length} 张:${g.value.join(", ")}`:"PNG / JPEG / WebP..."),v=Le(()=>new Set(e.spineObject.bones.map(F=>F.parent).filter(F=>!!F))),y=Le(()=>new Map(e.spineObject.bones.map(F=>[F.name,F]))),w=Le(()=>e.spineObject.bones.filter(F=>{var q;const V=l.value.trim().toLocaleLowerCase();if(V)return F.name.toLocaleLowerCase().includes(V);let Y=F.parent;for(;Y;){if(a.value.has(Y))return!1;Y=((q=y.value.get(Y))==null?void 0:q.parent)||null}return!0})),_=Le(()=>v.value.size>0&&[...v.value].every(F=>a.value.has(F))),S=Le(()=>{const F=h.value.trim().toLocaleLowerCase(),V=[...e.spineObject.slots].sort((Y,q)=>Y.order-q.order);return F?V.filter(Y=>Y.name.toLocaleLowerCase().includes(F)||Y.attachment.toLocaleLowerCase().includes(F)):V});function b(F){const V=e.spineObject.selectedBone===F;for(const Y of t.spines)Y.selectedBone="";V||(e.spineObject.selectedBone=F)}function C(F){const V=e.spineObject.selectedSlot===F;for(const Y of t.spines)Y.selectedSlot="";V||(e.spineObject.selectedSlot=F)}function A(F){a.value.has(F)?a.value.delete(F):a.value.add(F)}function P(){a.value=_.value?new Set:new Set(v.value)}function E(F){var V;return((V=F.target.files)==null?void 0:V[0])||null}function R(F){u.value=E(F)}function O(F){d.value=E(F)}function U(F){f.value=Array.from(F.target.files||[])}function G(F){return F.name.replace(/\.[^.]+$/,"").toLocaleLowerCase()}async function $(F){const V=Array.from(F.target.files||[]);if(!V.length)return;const Y=V.filter(ge=>/\.(json|skel)$/i.test(ge.name)),q=V.filter(ge=>/\.atlas$/i.test(ge.name)),z=V.filter(ge=>/\.(png|jpe?g|webp|wepb)$/i.test(ge.name)),se=q.map(ge=>({atlas:ge,skeleton:Y.find(he=>G(he)===G(ge))})).find(ge=>ge.skeleton),oe=(se==null?void 0:se.skeleton)||Y[0]||null,de=(se==null?void 0:se.atlas)||q[0]||null;if(u.value=oe,d.value=de,f.value=z,!oe||!de||!z.length){const ge=[!oe&&"JSON / SKEL",!de&&"Atlas",!z.length&&"纹理图片"].filter(Boolean).join("、");e.spineObject.status="error",e.spineObject.error=`所选文件夹缺少:${ge}`;return}await k()}function X(){t.recalcTotalFrames()}function D(){X(),t.timeline.frame=0}async function k(){var Y;const F=u.value,V=d.value;if(!F||!V||!f.value.length){e.spineObject.status="error",e.spineObject.error="请依次选择 Spine 数据、Atlas 和全部纹理图片";return}e.spineObject.status="loading",e.spineObject.error="";try{const q=await Dw(F,V,f.value);pu(e.spineObject.id,q),e.spineObject.skeletonFileName=F.name,e.spineObject.atlasFileName=V.name,e.spineObject.textureFileNames=f.value.map(z=>z.name),e.spineObject.dataVersion=q.dataVersion,e.spineObject.animations=q.animations,e.spineObject.bones=q.bones,e.spineObject.slots=q.slots,e.spineObject.selectedBone="",e.spineObject.selectedSlot="",l.value="",h.value="",a.value=new Set,e.spineObject.selectedAnimation=((Y=q.animations[0])==null?void 0:Y.name)||"",e.spineObject.assetVersion++,e.spineObject.status="ready",X(),t.timeline.frame=0;try{e.spineObject.sourceBundle=await Pk(F,V,f.value)}catch(z){e.spineObject.sourceBundle=null,console.warn("Spine 配置资源嵌入失败",z)}}catch(q){e.spineObject.status="error",e.spineObject.error=q instanceof Error?q.message:String(q)}}function N(){Fl(e.spineObject.id),u.value=null,d.value=null,f.value=[],i.value&&(i.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.slots=[],e.spineObject.selectedBone="",e.spineObject.selectedSlot="",l.value="",h.value="",a.value=new Set,e.spineObject.selectedAnimation="",e.spineObject.assetVersion++,e.spineObject.status="empty",e.spineObject.error="",X()}return(F,V)=>(K(),J("div",aB,[V[38]||(V[38]=T("div",{class:"editor-title"},"Spine 属性",-1)),T("label",lB,[V[20]||(V[20]=T("span",null,"Spine 名称",-1)),ce(T("input",{"onUpdate:modelValue":V[0]||(V[0]=Y=>s.spineObject.name=Y)},null,512),[[He,s.spineObject.name]])]),T("div",cB,[T("label",hB,[V[21]||(V[21]=T("span",null,"X 位置",-1)),ce(T("input",{"onUpdate:modelValue":V[1]||(V[1]=Y=>s.spineObject.x=Y),type:"number"},null,512),[[He,s.spineObject.x,void 0,{number:!0}]])]),T("label",uB,[V[22]||(V[22]=T("span",null,"Y 位置",-1)),ce(T("input",{"onUpdate:modelValue":V[2]||(V[2]=Y=>s.spineObject.y=Y),type:"number"},null,512),[[He,s.spineObject.y,void 0,{number:!0}]])]),T("label",dB,[V[23]||(V[23]=T("span",null,"旋转",-1)),ce(T("input",{"onUpdate:modelValue":V[3]||(V[3]=Y=>s.spineObject.rotation=Y),type:"number"},null,512),[[He,s.spineObject.rotation,void 0,{number:!0}]])])]),T("div",fB,[T("label",mB,[V[24]||(V[24]=T("span",null,"Scale X",-1)),ce(T("input",{"onUpdate:modelValue":V[4]||(V[4]=Y=>s.spineObject.scaleX=Y),type:"number",step:"0.05"},null,512),[[He,s.spineObject.scaleX,void 0,{number:!0}]])]),T("label",pB,[V[25]||(V[25]=T("span",null,"Scale Y",-1)),ce(T("input",{"onUpdate:modelValue":V[5]||(V[5]=Y=>s.spineObject.scaleY=Y),type:"number",step:"0.05"},null,512),[[He,s.spineObject.scaleY,void 0,{number:!0}]])]),T("label",gB,[V[26]||(V[26]=T("span",null,"开始时间",-1)),ce(T("input",{"onUpdate:modelValue":V[6]||(V[6]=Y=>s.spineObject.timeOffset=Y),type:"number",min:"0",step:"0.033333",onChange:X},null,544),[[He,s.spineObject.timeOffset,void 0,{number:!0}]])])]),V[39]||(V[39]=T("div",{class:"divider"},null,-1)),V[40]||(V[40]=T("div",{class:"section-title"},"Spine 资源",-1)),T("input",{ref_key:"skeletonInput",ref:i,hidden:"",type:"file",accept:".json,.skel,application/json,application/octet-stream",onChange:R},null,544),T("input",{ref_key:"atlasInput",ref:n,hidden:"",type:"file",accept:".atlas,text/plain",onChange:O},null,544),T("input",{ref_key:"textureInput",ref:r,hidden:"",type:"file",multiple:"",accept:".png,.jpg,.jpeg,.webp,.wepb,image/png,image/jpeg,image/webp",onChange:U},null,544),T("input",{ref_key:"folderInput",ref:o,hidden:"",type:"file",multiple:"",webkitdirectory:"",directory:"",onChange:$},null,544),T("button",{class:"folder-select",disabled:s.spineObject.status==="loading",onClick:V[7]||(V[7]=Y=>{var q;return(q=o.value)==null?void 0:q.click()})},"选择文件夹并加载",8,vB),V[41]||(V[41]=T("div",{class:"folder-hint"},"一次读取文件夹中的 JSON / SKEL、Atlas 和全部纹理;仍可在下方单独替换资源。",-1)),T("div",yB,[T("div",{class:"asset-name",title:m.value},ve(m.value||"JSON / SKEL..."),9,xB),T("button",{onClick:V[8]||(V[8]=Y=>{var q;return(q=i.value)==null?void 0:q.click()})},"选择")]),T("div",bB,[T("div",{class:"asset-name",title:p.value},ve(p.value||"Atlas..."),9,wB),T("button",{onClick:V[9]||(V[9]=Y=>{var q;return(q=n.value)==null?void 0:q.click()})},"选择")]),T("div",SB,[T("div",{class:"asset-name",title:g.value.join(", ")},ve(x.value),9,MB),T("button",{onClick:V[10]||(V[10]=Y=>{var q;return(q=r.value)==null?void 0:q.click()})},"选择(多选)")]),T("div",TB,[T("button",{class:"load",disabled:s.spineObject.status==="loading",onClick:k},ve(s.spineObject.status==="loading"?"加载中…":"↧ 加载"),9,_B),T("button",{class:"clear",onClick:N},"清除")]),T("div",CB,[V[27]||(V[27]=ft(" 支持 Spine 3.8 / 4.0 / 4.1 / 4.2 / 4.3 JSON · 对应版本运行时按需加载 · 本地离线 ",-1)),s.spineObject.dataVersion?(K(),J("span",EB," · 当前资源 "+ve(s.spineObject.dataVersion),1)):xe("",!0)]),s.spineObject.error?(K(),J("div",AB,ve(s.spineObject.error),1)):xe("",!0),T("div",IB,[V[30]||(V[30]=T("div",{class:"section-title"},"Spine 动画",-1)),s.spineObject.animations.length?(K(),J("label",PB,[V[29]||(V[29]=T("span",null,"时间轴播放动画",-1)),ce(T("select",{"onUpdate:modelValue":V[11]||(V[11]=Y=>s.spineObject.selectedAnimation=Y),onChange:D},[V[28]||(V[28]=T("option",{value:""},"无",-1)),(K(!0),J(_e,null,Et(s.spineObject.animations,Y=>(K(),J("option",{key:Y.name,value:Y.name},ve(Y.name)+"("+ve(Y.duration.toFixed(2))+"s) ",9,kB))),128))],544),[[bt,s.spineObject.selectedAnimation]])])):(K(),J("div",RB,"无可用动画"))]),T("div",FB,[T("div",OB,[V[37]||(V[37]=T("div",{class:"section-title"},"层级树",-1)),c.value==="bone"?(K(),J("button",{key:0,class:Ce(["selected-bone",{active:s.spineObject.selectedBone}]),disabled:!s.spineObject.selectedBone,title:s.spineObject.selectedBone?"点击清除骨骼选择":"当前未选择骨骼",onClick:V[12]||(V[12]=Y=>s.spineObject.selectedBone="")},[s.spineObject.selectedBone?(K(),J(_e,{key:0},[V[31]||(V[31]=ft("清除选中骨骼:",-1)),T("strong",null,ve(s.spineObject.selectedBone),1)],64)):(K(),J(_e,{key:1},[V[32]||(V[32]=ft("当前骨骼:",-1)),V[33]||(V[33]=T("strong",null,"未选择",-1))],64))],10,LB)):(K(),J("button",{key:1,class:Ce(["selected-bone",{active:s.spineObject.selectedSlot}]),disabled:!s.spineObject.selectedSlot,title:s.spineObject.selectedSlot?"点击清除插槽选择":"当前未选择插槽",onClick:V[13]||(V[13]=Y=>s.spineObject.selectedSlot="")},[s.spineObject.selectedSlot?(K(),J(_e,{key:0},[V[34]||(V[34]=ft("清除选中插槽:",-1)),T("strong",null,ve(s.spineObject.selectedSlot),1)],64)):(K(),J(_e,{key:1},[V[35]||(V[35]=ft("当前插槽:",-1)),V[36]||(V[36]=T("strong",null,"未选择",-1))],64))],10,BB)),c.value==="bone"&&s.spineObject.bones.length?(K(),J("button",{key:2,class:"tree-action",onClick:P},ve(_.value?"全部展开":"全部折叠"),1)):xe("",!0)]),T("div",NB,[T("button",{class:Ce({on:c.value==="bone"}),onClick:V[14]||(V[14]=Y=>c.value="bone")},"骨骼",2),T("button",{class:Ce({on:c.value==="slot"}),onClick:V[15]||(V[15]=Y=>c.value="slot")},"插槽",2)]),c.value==="bone"?(K(),J(_e,{key:0},[s.spineObject.bones.length?(K(),J("div",UB,[ce(T("input",{"onUpdate:modelValue":V[16]||(V[16]=Y=>l.value=Y),type:"search","aria-label":"搜索骨骼",placeholder:"搜索骨骼名称…"},null,512),[[He,l.value,void 0,{trim:!0}]]),l.value?(K(),J("button",{key:0,title:"清空搜索","aria-label":"清空骨骼搜索",onClick:V[17]||(V[17]=Y=>l.value="")},"✕")):xe("",!0)])):(K(),J("div",DB,"未加载 Spine")),s.spineObject.bones.length&&!w.value.length?(K(),J("div",$B,"未找到匹配的骨骼")):s.spineObject.bones.length?(K(),J("div",XB,[(K(!0),J(_e,null,Et(w.value,Y=>(K(),J("div",{key:Y.name,class:Ce(["bone",{selected:s.spineObject.selectedBone===Y.name}]),style:Ot({paddingLeft:`${6+Y.depth*16}px`}),role:"button",tabindex:"0",onClick:q=>b(Y.name),onKeydown:Mr(qe(q=>b(Y.name),["prevent"]),["enter"])},[v.value.has(Y.name)?(K(),J("button",{key:0,class:"bone-toggle",title:a.value.has(Y.name)?"展开子骨骼":"折叠子骨骼",onClick:qe(q=>A(Y.name),["stop"])},ve(a.value.has(Y.name)?"▸":"▾"),9,YB)):(K(),J("span",GB,"•")),T("span",jB,ve(Y.name),1)],46,VB))),128))])):xe("",!0)],64)):(K(),J(_e,{key:1},[s.spineObject.slots.length?(K(),J("div",WB,[ce(T("input",{"onUpdate:modelValue":V[18]||(V[18]=Y=>h.value=Y),type:"search","aria-label":"搜索插槽",placeholder:"搜索插槽或附件名称…"},null,512),[[He,h.value,void 0,{trim:!0}]]),h.value?(K(),J("button",{key:0,title:"清空搜索","aria-label":"清空插槽搜索",onClick:V[19]||(V[19]=Y=>h.value="")},"✕")):xe("",!0)])):(K(),J("div",HB,"未加载 Spine 插槽")),s.spineObject.slots.length&&!S.value.length?(K(),J("div",zB,"未找到匹配的插槽")):s.spineObject.slots.length?(K(),J("div",qB,[(K(!0),J(_e,null,Et(S.value,Y=>(K(),J("div",{key:Y.name,class:Ce(["bone slot-row",{selected:s.spineObject.selectedSlot===Y.name}]),role:"button",tabindex:"0",title:`${Y.name}(骨骼:${Y.bone||"-"},附件:${Y.attachment||"空"})`,onClick:q=>C(Y.name),onKeydown:Mr(qe(q=>C(Y.name),["prevent"]),["enter"])},[T("span",ZB,ve(Y.order+1),1),T("span",JB,ve(Y.name),1),T("span",QB,ve(Y.attachment||"空"),1)],42,KB))),128))])):xe("",!0)],64))])]))}}),tN=Jt(eN,[["__scopeId","data-v-3545b078"]]),iN={class:"group"},sN={class:"caret"},nN={class:"scene-actions"},rN=["disabled"],oN={class:"group-body"},aN={class:"tree scene-tree"},lN=["onClick"],cN={key:0,class:"sub-branch"},hN={key:1,class:"tdot"},uN={class:"tlabel"},dN=["title","aria-label","onClick"],fN={viewBox:"0 0 24 24","aria-hidden":"true"},mN={key:0,class:"eye-slash",d:"M4 4l16 16"},pN=["onClick"],gN=["onClick"],vN={class:"tlabel"},yN=["title","aria-label","onClick"],xN={viewBox:"0 0 24 24","aria-hidden":"true"},bN={key:0,class:"eye-slash",d:"M4 4l16 16"},wN=["onClick"],SN=["onClick"],MN={class:"tlabel"},TN=["title","aria-label","onClick"],_N={viewBox:"0 0 24 24","aria-hidden":"true"},CN={key:0,class:"eye-slash",d:"M4 4l16 16"},EN=["onClick"],AN=["onClick"],IN={class:"tlabel"},RN=["title","aria-label","onClick"],PN={viewBox:"0 0 24 24","aria-hidden":"true"},kN={key:0,class:"eye-slash",d:"M4 4l16 16"},FN=["onClick"],ON={key:0,class:"empty"},LN={class:"row"},BN={class:"seed-row scene-seed"},NN={class:"field-block"},DN={class:"field-grid"},UN={class:"field-block"},$N={class:"field-block check-field"},XN={class:"field-grid"},VN={class:"compact-field"},YN={class:"compact-field"},GN={class:"field-grid"},jN={class:"compact-field"},HN={class:"compact-field"},WN={key:1,class:"field-grid"},zN={class:"compact-field"},qN={class:"compact-field"},KN={key:2,class:"field-grid"},ZN={class:"compact-field"},JN={class:"compact-field"},QN={class:"field-block"},eD={key:4,class:"field-grid"},tD={class:"compact-field"},iD={class:"compact-field"},sD={class:"collider-follow-section"},nD={class:"follow-path"},rD={class:"field-block"},oD=["value"],aD={class:"field-grid"},lD={class:"compact-field"},cD={class:"compact-field"},hD={class:"follow-path"},uD={class:"field-block"},dD={class:"field-grid"},fD={class:"compact-field"},mD={class:"compact-field"},pD={class:"field-grid"},gD={class:"compact-field"},vD={class:"compact-field"},yD={class:"setting-line"},xD={class:"setting-line"},bD={class:"field-block"},wD={key:4,class:"panel-hint"},SD=Zt({__name:"SceneObjectsSection",setup(s){const{store:e,resolvedCurveEditorMode:t,sys:i,activeObjectType:n,activeCollider:r,activePath:o,activeSpine:a,canCopyObject:l,collapsed:c,toggle:h,addSys:u,addCollider:d,addPath:f,addSpine:m,copySelectedObject:p,applyPathPreset:g,clearPathAnchors:x,randomizeSeed:v,LINEAR_CURVE:y}=Fr(),w=Le(()=>{const _=new Map(e.systems.map(E=>[E.id,E])),S=new Map;for(const E of e.systems)if(E.config.eventEnabled!==!1)for(const R of E.config.events||[])R.targetSystemId<=0||R.targetSystemId===E.id||!_.has(R.targetSystemId)||S.has(R.targetSystemId)||S.set(R.targetSystemId,E.id);const b=new Map;for(const[E,R]of S){const O=b.get(R);O?O.push(E):b.set(R,[E])}const C=[],A=new Set,P=(E,R)=>{if(!A.has(E.id)){A.add(E.id),C.push({system:E,depth:R});for(const O of b.get(E.id)||[]){const U=_.get(O);U&&P(U,R+1)}}};for(const E of e.systems)S.has(E.id)||P(E,0);for(const E of e.systems)A.has(E.id)||P(E,0);return C});return(_,S)=>(K(),J("div",iN,[T("div",{class:"group-head scene-head",onClick:S[5]||(S[5]=b=>I(h)("scene"))},[T("span",sN,ve(I(c).scene?"▸":"▾"),1),S[50]||(S[50]=T("span",null,"场景对象",-1)),T("div",nN,[T("button",{class:"scene-add",title:"添加粒子系统",onClick:S[0]||(S[0]=qe((...b)=>I(u)&&I(u)(...b),["stop"]))},"+粒子"),T("button",{class:"scene-add",title:"添加碰撞体",onClick:S[1]||(S[1]=qe((...b)=>I(d)&&I(d)(...b),["stop"]))},"+碰撞"),T("button",{class:"scene-add",title:"添加路径",onClick:S[2]||(S[2]=qe((...b)=>I(f)&&I(f)(...b),["stop"]))},"+路径"),T("button",{class:"scene-add",title:"添加 Spine",onClick:S[3]||(S[3]=qe((...b)=>I(m)&&I(m)(...b),["stop"]))},"+Spine"),T("button",{class:"scene-add",disabled:!I(l),title:"复制当前选中的场景对象",onClick:S[4]||(S[4]=qe((...b)=>I(p)&&I(p)(...b),["stop"]))},"+Copy",8,rN)])]),ce(T("div",oN,[T("div",aN,[(K(!0),J(_e,null,Et(w.value,b=>(K(),J("div",{key:`particle-${b.system.id}`,class:Ce(["tree-item scene-object-item",{on:I(n)==="particle"&&b.system.id===I(e).activeObjectId,"scene-object-child":b.depth>0}]),style:Ot(b.depth>0?{paddingLeft:`${b.depth*18}px`}:void 0),onClick:C=>I(e).selectSystem(b.system.id)},[b.depth>0?(K(),J("span",cN,"└")):(K(),J("span",hN,"●")),T("span",uN,ve(b.system.config.name||"ParticleSystem"),1),T("button",{class:Ce(["scene-object-eye",{off:b.system.visible===!1}]),title:b.system.visible===!1?"显示粒子系统":"隐藏粒子系统","aria-label":b.system.visible===!1?"显示粒子系统":"隐藏粒子系统",onClick:qe(C=>b.system.visible=b.system.visible===!1,["stop"])},[(K(),J("svg",fN,[S[51]||(S[51]=T("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)),S[52]||(S[52]=T("circle",{cx:"12",cy:"12",r:"2.8"},null,-1)),b.system.visible===!1?(K(),J("path",mN)):xe("",!0)]))],10,dN),T("span",{class:Ce(["scene-object-kind",{"sub-emitter-kind":b.depth>0}])},ve(b.depth>0?"子发射器":"粒子"),3),T("button",{class:"scene-object-delete",title:"删除粒子系统",onClick:qe(C=>I(e).removeSystem(b.system.id),["stop"])},"✕",8,pN)],14,lN))),128)),(K(!0),J(_e,null,Et(I(e).colliders,b=>(K(),J("div",{key:`collision-${b.id}`,class:Ce(["tree-item scene-object-item",{on:I(n)==="collision"&&b.id===I(e).activeObjectId}]),onClick:C=>I(e).selectSceneObject("collision",b.id)},[S[55]||(S[55]=T("span",{class:"tdot collision-dot"},"■",-1)),T("span",vN,ve(b.name),1),T("button",{class:Ce(["scene-object-eye",{off:b.visible===!1}]),title:b.visible===!1?"显示碰撞体":"隐藏碰撞体","aria-label":b.visible===!1?"显示碰撞体":"隐藏碰撞体",onClick:qe(C=>b.visible=b.visible===!1,["stop"])},[(K(),J("svg",xN,[S[53]||(S[53]=T("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)),S[54]||(S[54]=T("circle",{cx:"12",cy:"12",r:"2.8"},null,-1)),b.visible===!1?(K(),J("path",bN)):xe("",!0)]))],10,yN),S[56]||(S[56]=T("span",{class:"scene-object-kind"},"碰撞",-1)),T("button",{class:"scene-object-delete",title:"删除碰撞体",onClick:qe(C=>I(e).removeCollider(b.id),["stop"])},"✕",8,wN)],10,gN))),128)),(K(!0),J(_e,null,Et(I(e).paths,b=>(K(),J("div",{key:`path-${b.id}`,class:Ce(["tree-item scene-object-item",{on:I(n)==="path"&&b.id===I(e).activeObjectId}]),onClick:C=>I(e).selectSceneObject("path",b.id)},[S[59]||(S[59]=T("span",{class:"tdot path-dot"},"◇",-1)),T("span",MN,ve(b.name),1),T("button",{class:Ce(["scene-object-eye",{off:b.visible===!1}]),title:b.visible===!1?"显示路径":"隐藏路径","aria-label":b.visible===!1?"显示路径":"隐藏路径",onClick:qe(C=>b.visible=b.visible===!1,["stop"])},[(K(),J("svg",_N,[S[57]||(S[57]=T("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)),S[58]||(S[58]=T("circle",{cx:"12",cy:"12",r:"2.8"},null,-1)),b.visible===!1?(K(),J("path",CN)):xe("",!0)]))],10,TN),S[60]||(S[60]=T("span",{class:"scene-object-kind"},"路径",-1)),T("button",{class:"scene-object-delete",title:"删除路径",onClick:qe(C=>I(e).removePath(b.id),["stop"])},"✕",8,EN)],10,SN))),128)),(K(!0),J(_e,null,Et(I(e).spines,b=>(K(),J("div",{key:`spine-${b.id}`,class:Ce(["tree-item scene-object-item",{on:I(n)==="spine"&&b.id===I(e).activeObjectId}]),onClick:C=>I(e).selectSceneObject("spine",b.id)},[S[63]||(S[63]=T("span",{class:"tdot spine-dot"},"◆",-1)),T("span",IN,ve(b.name),1),T("button",{class:Ce(["scene-object-eye",{off:b.visible===!1}]),title:b.visible===!1?"显示 Spine":"隐藏 Spine","aria-label":b.visible===!1?"显示 Spine":"隐藏 Spine",onClick:qe(C=>b.visible=b.visible===!1,["stop"])},[(K(),J("svg",PN,[S[61]||(S[61]=T("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)),S[62]||(S[62]=T("circle",{cx:"12",cy:"12",r:"2.8"},null,-1)),b.visible===!1?(K(),J("path",kN)):xe("",!0)]))],10,RN),S[64]||(S[64]=T("span",{class:"scene-object-kind"},"Spine",-1)),T("button",{class:"scene-object-delete",title:"删除 Spine",onClick:qe(C=>I(e).removeSpine(b.id),["stop"])},"✕",8,FN)],10,AN))),128)),!I(e).systems.length&&!I(e).colliders.length&&!I(e).paths.length&&!I(e).spines.length?(K(),J("div",ON,"场景中暂无对象")):xe("",!0)]),I(n)==="particle"&&I(i)?(K(),J(_e,{key:0},[T("label",LN,[S[65]||(S[65]=T("span",null,"名称",-1)),ce(T("input",{"onUpdate:modelValue":S[6]||(S[6]=b=>I(i).config.name=b),class:"inp"},null,512),[[He,I(i).config.name]])]),we(Oe,{label:"位置X",min:-2e3,max:2e3,step:1,modelValue:I(i).config.centerX,"onUpdate:modelValue":S[7]||(S[7]=b=>I(i).config.centerX=b)},null,8,["modelValue"]),we(Oe,{label:"位置Y",min:-2e3,max:2e3,step:1,modelValue:I(i).config.centerY,"onUpdate:modelValue":S[8]||(S[8]=b=>I(i).config.centerY=b)},null,8,["modelValue"]),we(Oe,{label:"偏移X",min:-2e3,max:2e3,step:1,modelValue:I(i).config.offsetX,"onUpdate:modelValue":S[9]||(S[9]=b=>I(i).config.offsetX=b)},null,8,["modelValue"]),we(Oe,{label:"偏移Y",min:-2e3,max:2e3,step:1,modelValue:I(i).config.offsetY,"onUpdate:modelValue":S[10]||(S[10]=b=>I(i).config.offsetY=b)},null,8,["modelValue"]),we(Oe,{label:"旋转",min:-360,max:360,step:1,modelValue:I(i).config.rootRotation,"onUpdate:modelValue":S[11]||(S[11]=b=>I(i).config.rootRotation=b)},null,8,["modelValue"]),we(Oe,{label:"缩放X",min:.05,max:10,step:.05,modelValue:I(i).config.rootScaleX,"onUpdate:modelValue":S[12]||(S[12]=b=>I(i).config.rootScaleX=b)},null,8,["modelValue"]),we(Oe,{label:"缩放Y",min:.05,max:10,step:.05,modelValue:I(i).config.rootScaleY,"onUpdate:modelValue":S[13]||(S[13]=b=>I(i).config.rootScaleY=b)},null,8,["modelValue"]),T("div",BN,[S[66]||(S[66]=T("label",{for:"system-seed"},"随机种子",-1)),ce(T("input",{id:"system-seed",class:"seed-input",type:"number",min:"0",step:"1","onUpdate:modelValue":S[14]||(S[14]=b=>I(i).config.seed=b),title:"控制粒子系统内全部随机属性、资源选择与修改器随机采样"},null,512),[[He,I(i).config.seed,void 0,{number:!0}]]),T("button",{class:"seed-random",title:"生成新的全局随机种子",onClick:S[15]||(S[15]=(...b)=>I(v)&&I(v)(...b))},"⚄")]),S[67]||(S[67]=T("div",{class:"seed-hint"},"控制初始随机参数、资源选择和修改器随机采样;相同种子可复现相同效果",-1))],64)):I(r)?(K(),J(_e,{key:1},[S[92]||(S[92]=T("div",{class:"object-editor-title"},"碰撞体属性",-1)),T("label",NN,[S[68]||(S[68]=T("span",null,"碰撞体名称",-1)),ce(T("input",{"onUpdate:modelValue":S[16]||(S[16]=b=>I(r).name=b),class:"inp"},null,512),[[He,I(r).name]])]),T("div",DN,[T("label",UN,[S[70]||(S[70]=T("span",null,"类型",-1)),ce(T("select",{"onUpdate:modelValue":S[17]||(S[17]=b=>I(r).shape=b),class:"inp"},[...S[69]||(S[69]=[is('',5)])],512),[[bt,I(r).shape]])]),T("label",$N,[S[71]||(S[71]=T("span",null,"启用",-1)),ce(T("input",{"onUpdate:modelValue":S[18]||(S[18]=b=>I(r).enabled=b),type:"checkbox"},null,512),[[wt,I(r).enabled]])])]),T("div",XN,[T("label",VN,[S[72]||(S[72]=T("span",null,"X 位置",-1)),ce(T("input",{"onUpdate:modelValue":S[19]||(S[19]=b=>I(r).x=b),type:"number",class:"inp"},null,512),[[He,I(r).x,void 0,{number:!0}]])]),T("label",YN,[S[73]||(S[73]=T("span",null,"Y 位置",-1)),ce(T("input",{"onUpdate:modelValue":S[20]||(S[20]=b=>I(r).y=b),type:"number",class:"inp"},null,512),[[He,I(r).y,void 0,{number:!0}]])])]),we(Oe,{label:"旋转",min:-360,max:360,step:1,modelValue:I(r).rotation,"onUpdate:modelValue":S[21]||(S[21]=b=>I(r).rotation=b)},null,8,["modelValue"]),T("div",GN,[T("label",jN,[S[74]||(S[74]=T("span",null,"缩放 X",-1)),ce(T("input",{"onUpdate:modelValue":S[22]||(S[22]=b=>I(r).scaleX=b),type:"number",min:"0.05",step:"0.05",class:"inp"},null,512),[[He,I(r).scaleX,void 0,{number:!0}]])]),T("label",HN,[S[75]||(S[75]=T("span",null,"缩放 Y",-1)),ce(T("input",{"onUpdate:modelValue":S[23]||(S[23]=b=>I(r).scaleY=b),type:"number",min:"0.05",step:"0.05",class:"inp"},null,512),[[He,I(r).scaleY,void 0,{number:!0}]])])]),I(r).shape==="circle"?(K(),Ct(Oe,{key:0,label:"半径",min:1,max:1e3,step:1,modelValue:I(r).radius,"onUpdate:modelValue":S[24]||(S[24]=b=>I(r).radius=b)},null,8,["modelValue"])):I(r).shape==="ellipse"?(K(),J("div",WN,[T("label",zN,[S[76]||(S[76]=T("span",null,"X 半径",-1)),ce(T("input",{"onUpdate:modelValue":S[25]||(S[25]=b=>I(r).radiusX=b),type:"number",min:"1",class:"inp"},null,512),[[He,I(r).radiusX,void 0,{number:!0}]])]),T("label",qN,[S[77]||(S[77]=T("span",null,"Y 半径",-1)),ce(T("input",{"onUpdate:modelValue":S[26]||(S[26]=b=>I(r).radiusY=b),type:"number",min:"1",class:"inp"},null,512),[[He,I(r).radiusY,void 0,{number:!0}]])])])):(K(),J("div",KN,[T("label",ZN,[S[78]||(S[78]=T("span",null,"宽度",-1)),ce(T("input",{"onUpdate:modelValue":S[27]||(S[27]=b=>I(r).width=b),type:"number",min:"1",class:"inp"},null,512),[[He,I(r).width,void 0,{number:!0}]])]),T("label",JN,[S[79]||(S[79]=T("span",null,"高度",-1)),ce(T("input",{"onUpdate:modelValue":S[28]||(S[28]=b=>I(r).height=b),type:"number",min:"1",class:"inp"},null,512),[[He,I(r).height,void 0,{number:!0}]])])])),I(r).shape==="polygon"||I(r).shape==="custom"?(K(),Ct(Oe,{key:3,label:"边数",min:3,max:16,step:1,modelValue:I(r).sides,"onUpdate:modelValue":S[29]||(S[29]=b=>I(r).sides=b)},null,8,["modelValue"])):xe("",!0),T("label",QN,[S[81]||(S[81]=T("span",null,"碰撞响应",-1)),ce(T("select",{"onUpdate:modelValue":S[30]||(S[30]=b=>I(r).response=b),class:"inp"},[...S[80]||(S[80]=[T("option",{value:"physics"},"物理(弹跳/摩擦)",-1),T("option",{value:"pause"},"暂停(停止不动)",-1),T("option",{value:"destroy"},"消失(立即销毁)",-1)])],512),[[bt,I(r).response]])]),I(r).response==="physics"?(K(),J("div",eD,[T("label",tD,[S[82]||(S[82]=T("span",null,"弹性 (0-1)",-1)),ce(T("input",{"onUpdate:modelValue":S[31]||(S[31]=b=>I(r).elasticity=b),type:"number",min:"0",max:"1",step:"0.01",class:"inp"},null,512),[[He,I(r).elasticity,void 0,{number:!0}]])]),T("label",iD,[S[83]||(S[83]=T("span",null,"摩擦 (0-1)",-1)),ce(T("input",{"onUpdate:modelValue":S[32]||(S[32]=b=>I(r).friction=b),type:"number",min:"0",max:"1",step:"0.01",class:"inp"},null,512),[[He,I(r).friction,void 0,{number:!0}]])])])):xe("",!0),T("div",sD,[T("label",nD,[ce(T("input",{"onUpdate:modelValue":S[33]||(S[33]=b=>I(r).followPath=b),type:"checkbox"},null,512),[[wt,I(r).followPath]]),S[84]||(S[84]=ft("跟随路径移动",-1))]),I(r).followPath?(K(),J(_e,{key:0},[T("label",rD,[S[86]||(S[86]=T("span",null,"目标路径",-1)),ce(T("select",{"onUpdate:modelValue":S[34]||(S[34]=b=>I(r).followPathId=b),class:"inp"},[S[85]||(S[85]=T("option",{value:0},"(未选择)",-1)),(K(!0),J(_e,null,Et(I(e).paths,b=>(K(),J("option",{key:b.id,value:b.id},ve(b.name),9,oD))),128))],512),[[bt,I(r).followPathId,void 0,{number:!0}]])]),T("div",aD,[T("label",lD,[S[87]||(S[87]=T("span",null,"移动时长(秒)",-1)),ce(T("input",{"onUpdate:modelValue":S[35]||(S[35]=b=>I(r).followDuration=b),type:"number",min:"0.05",step:"0.05",class:"inp"},null,512),[[He,I(r).followDuration,void 0,{number:!0}]])]),T("label",cD,[S[89]||(S[89]=T("span",null,"曲线模式",-1)),ce(T("select",{"onUpdate:modelValue":S[36]||(S[36]=b=>I(r).followCurveMode=b),class:"inp"},[...S[88]||(S[88]=[T("option",null,"跟随导出",-1),T("option",null,"线性",-1),T("option",null,"贝塞尔",-1)])],512),[[bt,I(r).followCurveMode]])])]),T("label",hD,[ce(T("input",{"onUpdate:modelValue":S[37]||(S[37]=b=>I(r).followPathRotation=b),type:"checkbox"},null,512),[[wt,I(r).followPathRotation]]),S[90]||(S[90]=ft("方向沿路径",-1))]),S[91]||(S[91]=T("div",{class:"collider-curve-title"},[ft("移动进度曲线 "),T("small",null,"横轴:实时/移动时长 纵轴:路径进度(0=起点 → 1=终点)")],-1)),we(tn,{"model-value":I(r).followCurve||I(y),"default-value":I(y),mode:I(t)(I(r).followCurveMode),"onUpdate:modelValue":S[38]||(S[38]=b=>I(r).followCurve=b)},null,8,["model-value","default-value","mode"])],64)):xe("",!0)])],64)):I(o)?(K(),J(_e,{key:2},[S[102]||(S[102]=T("div",{class:"object-editor-title"},"路径属性",-1)),T("label",uD,[S[93]||(S[93]=T("span",null,"路径名称",-1)),ce(T("input",{"onUpdate:modelValue":S[39]||(S[39]=b=>I(o).name=b),class:"inp"},null,512),[[He,I(o).name]])]),T("div",dD,[T("label",fD,[S[94]||(S[94]=T("span",null,"X 位置",-1)),ce(T("input",{"onUpdate:modelValue":S[40]||(S[40]=b=>I(o).x=b),type:"number",class:"inp"},null,512),[[He,I(o).x,void 0,{number:!0}]])]),T("label",mD,[S[95]||(S[95]=T("span",null,"Y 位置",-1)),ce(T("input",{"onUpdate:modelValue":S[41]||(S[41]=b=>I(o).y=b),type:"number",class:"inp"},null,512),[[He,I(o).y,void 0,{number:!0}]])])]),we(Oe,{label:"旋转",min:-360,max:360,step:1,modelValue:I(o).rotation,"onUpdate:modelValue":S[42]||(S[42]=b=>I(o).rotation=b)},null,8,["modelValue"]),T("div",pD,[T("label",gD,[S[96]||(S[96]=T("span",null,"缩放 X",-1)),ce(T("input",{"onUpdate:modelValue":S[43]||(S[43]=b=>I(o).scaleX=b),type:"number",min:"0.05",step:"0.05",class:"inp"},null,512),[[He,I(o).scaleX,void 0,{number:!0}]])]),T("label",vD,[S[97]||(S[97]=T("span",null,"缩放 Y",-1)),ce(T("input",{"onUpdate:modelValue":S[44]||(S[44]=b=>I(o).scaleY=b),type:"number",min:"0.05",step:"0.05",class:"inp"},null,512),[[He,I(o).scaleY,void 0,{number:!0}]])])]),T("label",yD,[S[98]||(S[98]=T("span",null,"闭合路径",-1)),ce(T("input",{"onUpdate:modelValue":S[45]||(S[45]=b=>I(o).closed=b),type:"checkbox"},null,512),[[wt,I(o).closed]])]),T("label",xD,[S[99]||(S[99]=T("span",null,"路径颜色",-1)),ce(T("input",{"onUpdate:modelValue":S[46]||(S[46]=b=>I(o).color=b),type:"color",class:"path-color"},null,512),[[He,I(o).color]])]),S[103]||(S[103]=is('
操作说明:
  • 双击空白处/曲线:新建锚点
  • 双击锚点:删除节点
  • 双击第二下按住拖动:新建并拉出手柄
  • 拖动锚点移动位置,拖动手柄调整曲线
  • Shift+拖动手柄:两侧完全对称
  • Alt+拖动手柄:独立控制单侧
  • Ctrl+点击/框选:加选节点
  • Alt+点击/框选:减选节点
  • Alt+单击空白处:清除全部选中
  • 选中多个节点后可整体拖动
',1)),T("label",bD,[S[101]||(S[101]=T("span",null,"应用预设形状",-1)),ce(T("select",{"onUpdate:modelValue":S[47]||(S[47]=b=>I(o).preset=b),class:"inp"},[...S[100]||(S[100]=[is('',5)])],512),[[bt,I(o).preset]])]),T("button",{class:"path-action primary",onClick:S[48]||(S[48]=(...b)=>I(g)&&I(g)(...b))},"应用预设"),T("button",{class:"path-action",onClick:S[49]||(S[49]=(...b)=>I(x)&&I(x)(...b))},"清空锚点")],64)):I(a)?(K(),Ct(tN,{key:3,"spine-object":I(a)},null,8,["spine-object"])):(K(),J("div",wD,"使用右上角按钮创建场景对象"))],512),[[Si,!I(c).scene]])]))}}),MD=Jt(SD,[["__scopeId","data-v-55dcf3b2"]]),TD={class:"group"},_D={class:"caret"},CD={class:"group-body"},ED={class:"segs"},AD={class:"segs stream-behavior-segs"},ID={key:2,class:"stream-loop-options"},RD={class:"loop-section-row"},PD={class:"switch-row"},kD=["checked"],FD={key:0,class:"loop-duration-control"},OD={class:"switch-row loop-duration-toggle"},LD=["checked"],BD={class:"loop-section-duration"},ND=["value"],DD={key:1},UD={key:2,class:"loop-auto-duration"},$D={class:"loop-section-row"},XD={class:"switch-row"},VD=["checked"],YD={key:0,class:"loop-duration-control"},GD={class:"switch-row loop-duration-toggle"},jD=["checked"],HD={class:"loop-section-duration"},WD=["value"],zD={key:1},qD={key:2,class:"loop-auto-duration"},KD={key:3,class:"modifier-hint stream-loop-hint"},ZD={class:"group"},JD={class:"caret"},QD={class:"group-body"},e4={class:"row"},t4={class:"row"},i4=["value","disabled"],s4={key:0,class:"row"},n4={class:"row"},r4={key:0,value:"radial"},o4={key:1,value:"path-normal"},a4={key:2,value:"path-tangent"},l4={key:6,class:"switch-row"},c4=Zt({__name:"EmissionSection",setup(s){const{store:e,sys:t,automaticLoopDuration:i,loopDurationFrames:n,collapsed:r,toggle:o,setEmitMode:a,setLoopDurationFrames:l,setStreamBehavior:c,setLoopSection:h,setLoopSectionDuration:u,setLoopCustomDuration:d,resetModule:f,select:m,onShapeChange:p,onSpawnPathChange:g}=Fr();return(x,v)=>(K(),J(_e,null,[T("div",TD,[T("div",{class:"group-head",onClick:v[1]||(v[1]=y=>I(o)("emitMode"))},[T("span",_D,ve(I(r).emitMode?"▸":"▾"),1),v[36]||(v[36]=T("span",null,"发射模式",-1)),T("button",{class:"group-reset",title:"重置发射模式参数",onClick:v[0]||(v[0]=qe(y=>I(f)("emitMode"),["stop"]))},"重置")]),ce(T("div",CD,[T("div",ED,[T("button",{class:Ce(["seg",{on:I(t).config.mode==="stream"}]),onClick:v[2]||(v[2]=y=>I(a)("stream"))},"持续",2),T("button",{class:Ce(["seg",{on:I(t).config.mode==="burst"}]),onClick:v[3]||(v[3]=y=>I(a)("burst"))},"爆发",2)]),I(t).config.mode==="stream"?(K(),J(_e,{key:0},[T("div",AD,[T("button",{class:Ce(["seg",{on:I(t).config.streamBehavior==="normal"}]),onClick:v[4]||(v[4]=y=>I(c)("normal"))},"常规持续",2),T("button",{class:Ce(["seg",{on:I(t).config.streamBehavior==="loop"}]),onClick:v[5]||(v[5]=y=>I(c)("loop"))},"循环持续",2)]),we(Oe,{label:"发射速率",min:1,max:300,step:1,modelValue:I(t).config.rate,"onUpdate:modelValue":v[6]||(v[6]=y=>I(t).config.rate=y)},null,8,["modelValue"]),I(t).config.streamBehavior==="normal"?(K(),Ct(Oe,{key:0,label:"发射时长",min:1/30,max:60,step:1/30,modelValue:I(t).config.duration,"onUpdate:modelValue":v[7]||(v[7]=y=>I(t).config.duration=y)},null,8,["modelValue"])):(K(),Ct(Oe,{key:1,label:"发射时长 (f)",min:1,max:1800,step:1,"model-value":I(n),"onUpdate:modelValue":I(l)},null,8,["model-value","onUpdate:modelValue"])),I(t).config.streamBehavior==="loop"?(K(),J("div",ID,[T("div",RD,[T("label",PD,[T("input",{type:"checkbox",checked:I(t).config.generateLoopStartAnimation,onChange:v[8]||(v[8]=y=>I(h)("start",y))},null,40,kD),v[37]||(v[37]=T("span",{class:"switch-ui"},null,-1)),v[38]||(v[38]=T("span",null,"生成开始循环动画",-1))]),I(t).config.generateLoopStartAnimation?(K(),J("div",FD,[T("label",OD,[T("input",{type:"checkbox",checked:I(t).config.loopStartUseCustomDuration,onChange:v[9]||(v[9]=y=>I(d)("start",y))},null,40,LD),v[39]||(v[39]=T("span",{class:"switch-ui"},null,-1)),v[40]||(v[40]=T("span",null,"指定时长",-1))]),T("label",BD,[I(t).config.loopStartUseCustomDuration?(K(),J("input",{key:0,value:I(t).config.loopStartDurationFrames,type:"number",min:"1",max:"1800",step:"1","aria-label":"开始循环段时长",onChange:v[10]||(v[10]=y=>I(u)("start",y))},null,40,ND)):xe("",!0),I(t).config.loopStartUseCustomDuration?(K(),J("span",DD,"f")):(K(),J("span",UD,"自动 "+ve(I(i))+"f",1))])])):xe("",!0)]),T("div",$D,[T("label",XD,[T("input",{type:"checkbox",checked:I(t).config.generateLoopEndAnimation,onChange:v[11]||(v[11]=y=>I(h)("end",y))},null,40,VD),v[41]||(v[41]=T("span",{class:"switch-ui"},null,-1)),v[42]||(v[42]=T("span",null,"生成结束循环动画",-1))]),I(t).config.generateLoopEndAnimation?(K(),J("div",YD,[T("label",GD,[T("input",{type:"checkbox",checked:I(t).config.loopEndUseCustomDuration,onChange:v[12]||(v[12]=y=>I(d)("end",y))},null,40,jD),v[43]||(v[43]=T("span",{class:"switch-ui"},null,-1)),v[44]||(v[44]=T("span",null,"指定时长",-1))]),T("label",HD,[I(t).config.loopEndUseCustomDuration?(K(),J("input",{key:0,value:I(t).config.loopEndDurationFrames,type:"number",min:"1",max:"1800",step:"1","aria-label":"结束循环段时长",onChange:v[13]||(v[13]=y=>I(u)("end",y))},null,40,WD)):xe("",!0),I(t).config.loopEndUseCustomDuration?(K(),J("span",zD,"f")):(K(),J("span",qD,"自动 "+ve(I(i))+"f",1))])])):xe("",!0)])])):xe("",!0),I(t).config.streamBehavior==="loop"?(K(),J("div",KD,"循环持续模式不支持骨骼跟随和路径跟随;进入或退出时会将粒子跟随设置恢复默认值。")):xe("",!0)],64)):(K(),Ct(Oe,{key:1,label:"单次数量",min:1,max:1e3,step:1,modelValue:I(t).config.burstCount,"onUpdate:modelValue":v[14]||(v[14]=y=>I(t).config.burstCount=y)},null,8,["modelValue"])),we(Oe,{label:"延迟时间",min:0,max:5,step:.1,modelValue:I(t).config.delay,"onUpdate:modelValue":v[15]||(v[15]=y=>I(t).config.delay=y)},null,8,["modelValue"])],512),[[Si,!I(r).emitMode]])]),T("div",ZD,[T("div",{class:"group-head",onClick:v[17]||(v[17]=y=>I(o)("shape"))},[T("span",JD,ve(I(r).shape?"▸":"▾"),1),v[45]||(v[45]=T("span",null,"发射器形状",-1)),T("button",{class:"group-reset",title:"重置发射器形状参数",onClick:v[16]||(v[16]=qe(y=>I(f)("shape"),["stop"]))},"重置")]),ce(T("div",QD,[T("label",e4,[v[47]||(v[47]=T("span",null,"形状",-1)),ce(T("select",{"onUpdate:modelValue":v[18]||(v[18]=y=>I(t).config.shape=y),class:"inp",onChange:v[19]||(v[19]=(...y)=>I(p)&&I(p)(...y))},[...v[46]||(v[46]=[is('',5)])],544),[[bt,I(t).config.shape]])]),I(t).config.shape==="circle"||I(t).config.shape==="cone"?(K(),J(_e,{key:0},[we(Oe,{label:I(t).config.shape==="cone"?"内径":"内半径",min:0,max:I(t).config.outerRadius,step:1,modelValue:I(t).config.innerRadius,"onUpdate:modelValue":v[20]||(v[20]=y=>I(t).config.innerRadius=y)},null,8,["label","max","modelValue"]),we(Oe,{label:I(t).config.shape==="cone"?"外径":"外半径",min:I(t).config.innerRadius,max:300,step:1,modelValue:I(t).config.outerRadius,"onUpdate:modelValue":v[21]||(v[21]=y=>I(t).config.outerRadius=y)},null,8,["label","min","modelValue"])],64)):xe("",!0),I(t).config.shape==="cone"?(K(),J(_e,{key:1},[we(Oe,{label:"锥形朝向",min:-360,max:360,step:1,modelValue:I(t).config.coneDirection,"onUpdate:modelValue":v[22]||(v[22]=y=>I(t).config.coneDirection=y)},null,8,["modelValue"]),we(Oe,{label:"锥形开口角度",min:1,max:360,step:1,modelValue:I(t).config.coneAngle,"onUpdate:modelValue":v[23]||(v[23]=y=>I(t).config.coneAngle=y)},null,8,["modelValue"])],64)):I(t).config.shape==="rect"?(K(),J(_e,{key:2},[we(Oe,{label:"内宽",min:0,max:I(t).config.outerRectW,step:1,modelValue:I(t).config.innerRectW,"onUpdate:modelValue":v[24]||(v[24]=y=>I(t).config.innerRectW=y)},null,8,["max","modelValue"]),we(Oe,{label:"内高",min:0,max:I(t).config.outerRectH,step:1,modelValue:I(t).config.innerRectH,"onUpdate:modelValue":v[25]||(v[25]=y=>I(t).config.innerRectH=y)},null,8,["max","modelValue"]),we(Oe,{label:"外宽",min:I(t).config.innerRectW,max:400,step:1,modelValue:I(t).config.outerRectW,"onUpdate:modelValue":v[26]||(v[26]=y=>I(t).config.outerRectW=y)},null,8,["min","modelValue"]),we(Oe,{label:"外高",min:I(t).config.innerRectH,max:400,step:1,modelValue:I(t).config.outerRectH,"onUpdate:modelValue":v[27]||(v[27]=y=>I(t).config.outerRectH=y)},null,8,["min","modelValue"])],64)):I(t).config.shape==="path"?(K(),J(_e,{key:3},[T("label",t4,[v[49]||(v[49]=T("span",null,"选择路径",-1)),ce(T("select",{"onUpdate:modelValue":v[28]||(v[28]=y=>I(t).config.spawnPathId=y),class:"inp",onChange:v[29]||(v[29]=(...y)=>I(g)&&I(g)(...y))},[v[48]||(v[48]=T("option",{value:0},"无路径(点发射)",-1)),(K(!0),J(_e,null,Et(I(e).paths,y=>(K(),J("option",{key:y.id,value:y.id,disabled:!y.enabled},ve(y.name),9,i4))),128))],544),[[bt,I(t).config.spawnPathId,void 0,{number:!0}]])]),I(t).config.spawnPathId>0?(K(),J("label",s4,[v[51]||(v[51]=T("span",null,"出生分布",-1)),ce(T("select",{"onUpdate:modelValue":v[30]||(v[30]=y=>I(t).config.spawnPathDistribution=y),class:"inp"},[...v[50]||(v[50]=[T("option",{value:"fixed"},"等间距固定分布",-1),T("option",{value:"random"},"随机分布",-1)])],512),[[bt,I(t).config.spawnPathDistribution]])])):xe("",!0)],64)):xe("",!0),v[57]||(v[57]=T("div",{class:"divider"},null,-1)),T("label",n4,[v[54]||(v[54]=T("span",null,"发射角度",-1)),ce(T("select",{"onUpdate:modelValue":v[31]||(v[31]=y=>I(t).config.emissionAngleMode=y),class:"inp"},[v[52]||(v[52]=T("option",{value:"fixed"},"固定",-1)),v[53]||(v[53]=T("option",{value:"random"},"随机",-1)),I(t).config.shape==="circle"||I(t).config.shape==="rect"||I(t).config.shape==="cone"?(K(),J("option",r4,"径向(中心向外)")):xe("",!0),I(t).config.shape==="path"&&I(t).config.spawnPathId>0?(K(),J("option",o4,"垂直于路径")):xe("",!0),I(t).config.shape==="path"&&I(t).config.spawnPathId>0?(K(),J("option",a4,"沿路径方向")):xe("",!0)],512),[[bt,I(t).config.emissionAngleMode]])]),I(t).config.emissionAngleMode==="fixed"?(K(),Ct(Oe,{key:4,label:"固定角度",min:-360,max:360,step:1,modelValue:I(t).config.direction,"onUpdate:modelValue":v[32]||(v[32]=y=>I(t).config.direction=y)},null,8,["modelValue"])):I(t).config.emissionAngleMode==="random"?(K(),J(_e,{key:5},[we(Oe,{label:"基准角度",min:-360,max:360,step:1,modelValue:I(t).config.direction,"onUpdate:modelValue":v[33]||(v[33]=y=>I(t).config.direction=y)},null,8,["modelValue"]),we(Oe,{label:"随机范围",min:0,max:360,step:1,modelValue:I(t).config.spread,"onUpdate:modelValue":v[34]||(v[34]=y=>I(t).config.spread=y)},null,8,["modelValue"])],64)):xe("",!0),I(t).config.shape!=="point"?(K(),J("label",l4,[ce(T("input",{type:"checkbox","onUpdate:modelValue":v[35]||(v[35]=y=>I(t).config.showShape=y)},null,512),[[wt,I(t).config.showShape]]),v[55]||(v[55]=T("span",{class:"switch-ui"},null,-1)),v[56]||(v[56]=T("span",null,"显示形状",-1))])):xe("",!0)],512),[[Si,!I(r).shape]])])],64))}}),h4=Jt(c4,[["__scopeId","data-v-f9eac627"]]),u4={class:"pac"},d4={class:"pac-head"},f4={class:"pac-label"},m4={key:0,class:"pac-modes"},p4=["onClick"],g4={class:"pac-range"},v4={class:"pac-curve"},y4={class:"pac-axis"},x4=Zt({__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(s){const e=s,t=Le(()=>{const i=[{label:"固定",value:"fixed"},{label:"随机",value:"random"}];return e.allowCurve&&i.push({label:"曲线",value:"curve"}),e.allowDirection&&i.push({label:"发射方向",value:"direction"}),i});return(i,n)=>(K(),J("div",u4,[T("div",d4,[T("span",f4,ve(s.label),1),s.showModes?(K(),J("div",m4,[(K(!0),J(_e,null,Et(t.value,r=>(K(),J("button",{key:r.value,class:Ce(["pac-mode",{on:s.mode===r.value}]),onClick:o=>i.$emit("update:mode",r.value)},ve(r.label),11,p4))),128))])):xe("",!0)]),s.mode==="fixed"||s.mode==="direction"?(K(),Ct(Oe,{key:0,label:s.mode==="direction"?"角度偏移":"数值",min:s.min,max:s.max,step:s.step,"model-value":s.valueMin,"onUpdate:modelValue":n[0]||(n[0]=r=>i.$emit("update:valueMin",r))},null,8,["label","min","max","step","model-value"])):s.mode==="random"?(K(),J(_e,{key:1},[we(Oe,{label:"下限",min:s.min,max:s.max,step:s.step,"model-value":s.valueMin,"onUpdate:modelValue":n[1]||(n[1]=r=>i.$emit("update:valueMin",r))},null,8,["min","max","step","model-value"]),we(Oe,{label:"上限",min:s.min,max:s.max,step:s.step,"model-value":s.valueMax,"onUpdate:modelValue":n[2]||(n[2]=r=>i.$emit("update:valueMax",r))},null,8,["min","max","step","model-value"])],64)):(K(),J(_e,{key:2},[T("div",g4,[we(Oe,{label:"范围下限",min:s.min,max:s.max,step:s.step,"model-value":s.valueMin,"onUpdate:modelValue":n[3]||(n[3]=r=>i.$emit("update:valueMin",r))},null,8,["min","max","step","model-value"]),we(Oe,{label:"范围上限",min:s.min,max:s.max,step:s.step,"model-value":s.valueMax,"onUpdate:modelValue":n[4]||(n[4]=r=>i.$emit("update:valueMax",r))},null,8,["min","max","step","model-value"])]),T("div",v4,[we(tn,{"model-value":s.curve,"default-value":s.defaultCurve,"onUpdate:modelValue":n[5]||(n[5]=r=>i.$emit("update:curve",r))},null,8,["model-value","default-value"]),T("div",y4,[n[6]||(n[6]=T("span",null,"0",-1)),T("span",null,ve(s.curveLabel),1),n[7]||(n[7]=T("span",null,"1",-1))])])],64))]))}}),Sn=Jt(x4,[["__scopeId","data-v-238f838c"]]),b4={class:"group"},w4={class:"caret"},S4={class:"group-body attr-body"},M4={class:"attr-axis-head"},T4={class:"axis-modes"},_4={class:"life-item"},C4={class:"switch-row"},E4={class:"life-item"},A4={class:"switch-row"},I4={class:"axis-modes life-axis"},R4={class:"life-item"},P4={class:"switch-row"},k4=Zt({__name:"ParticleAttributesSection",setup(s){const{sys:e,collapsed:t,toggle:i,resetModule:n,setSpeedOverLifeMode:r,prepareScaleOverLifeCurve:o,setScaleOverLifeMode:a,LINEAR_CURVE:l,FLAT_CURVE:c}=Fr();return(h,u)=>(K(),J("div",b4,[T("div",{class:"group-head",onClick:u[1]||(u[1]=d=>I(i)("attr"))},[T("span",w4,ve(I(t).attr?"▸":"▾"),1),u[44]||(u[44]=T("span",null,"粒子属性",-1)),T("button",{class:"group-reset",title:"重置粒子属性参数",onClick:u[0]||(u[0]=qe(d=>I(n)("attr"),["stop"]))},"重置")]),ce(T("div",S4,[u[52]||(u[52]=T("div",{class:"attr-section-title"},"粒子初始参数",-1)),we(Sn,{label:"初始生命周期","allow-curve":!1,mode:I(e).config.lifeMode,"onUpdate:mode":u[2]||(u[2]=d=>I(e).config.lifeMode=d),"value-min":I(e).config.lifeMin,"onUpdate:valueMin":u[3]||(u[3]=d=>I(e).config.lifeMin=d),"value-max":I(e).config.lifeMax,"onUpdate:valueMax":u[4]||(u[4]=d=>I(e).config.lifeMax=d),curve:I(e).config.lifeCurve,"onUpdate:curve":u[5]||(u[5]=d=>I(e).config.lifeCurve=d),min:.1,max:10,step:.1,"curve-label":"随机采样 →"},null,8,["mode","value-min","value-max","curve"]),we(Sn,{label:"初始速度","allow-curve":!1,mode:I(e).config.speedMode,"onUpdate:mode":u[6]||(u[6]=d=>I(e).config.speedMode=d),"value-min":I(e).config.speedMin,"onUpdate:valueMin":u[7]||(u[7]=d=>I(e).config.speedMin=d),"value-max":I(e).config.speedMax,"onUpdate:valueMax":u[8]||(u[8]=d=>I(e).config.speedMax=d),curve:I(e).config.speedCurve,"onUpdate:curve":u[9]||(u[9]=d=>I(e).config.speedCurve=d),min:0,max:1e3,step:1,"curve-label":"随机采样 →"},null,8,["mode","value-min","value-max","curve"]),T("div",M4,[u[45]||(u[45]=T("span",null,"初始缩放",-1)),T("div",T4,[T("button",{class:Ce(["axis-mode",{on:I(e).config.scaleAxisMode==="uniform"}]),onClick:u[10]||(u[10]=d=>I(e).config.scaleAxisMode="uniform")},"统一",2),T("button",{class:Ce(["axis-mode",{on:I(e).config.scaleAxisMode==="separate"}]),onClick:u[11]||(u[11]=d=>I(e).config.scaleAxisMode="separate")},"XY分离",2)])]),we(Sn,{label:I(e).config.scaleAxisMode==="uniform"?"初始缩放":"缩放 X","allow-curve":!1,mode:I(e).config.scaleMode,"onUpdate:mode":u[12]||(u[12]=d=>I(e).config.scaleMode=d),"value-min":I(e).config.scaleMin,"onUpdate:valueMin":u[13]||(u[13]=d=>I(e).config.scaleMin=d),"value-max":I(e).config.scaleMax,"onUpdate:valueMax":u[14]||(u[14]=d=>I(e).config.scaleMax=d),curve:I(e).config.scaleCurve,"onUpdate:curve":u[15]||(u[15]=d=>I(e).config.scaleCurve=d),min:0,max:5,step:.05,"curve-label":"随机采样 →"},null,8,["label","mode","value-min","value-max","curve"]),I(e).config.scaleAxisMode==="separate"?(K(),Ct(Sn,{key:0,label:"缩放 Y","show-modes":!1,"allow-curve":!1,mode:I(e).config.scaleMode,"onUpdate:mode":u[16]||(u[16]=d=>I(e).config.scaleMode=d),"value-min":I(e).config.scaleYMin,"onUpdate:valueMin":u[17]||(u[17]=d=>I(e).config.scaleYMin=d),"value-max":I(e).config.scaleYMax,"onUpdate:valueMax":u[18]||(u[18]=d=>I(e).config.scaleYMax=d),curve:I(e).config.scaleYCurve,"onUpdate:curve":u[19]||(u[19]=d=>I(e).config.scaleYCurve=d),min:0,max:5,step:.05,"curve-label":"随机采样 →"},null,8,["mode","value-min","value-max","curve"])):xe("",!0),we(Sn,{label:"初始旋转","allow-direction":"","allow-curve":!1,mode:I(e).config.initialRotationMode,"onUpdate:mode":u[20]||(u[20]=d=>I(e).config.initialRotationMode=d),"value-min":I(e).config.initialRotationMin,"onUpdate:valueMin":u[21]||(u[21]=d=>I(e).config.initialRotationMin=d),"value-max":I(e).config.initialRotationMax,"onUpdate:valueMax":u[22]||(u[22]=d=>I(e).config.initialRotationMax=d),curve:I(e).config.initialRotationCurve,"onUpdate:curve":u[23]||(u[23]=d=>I(e).config.initialRotationCurve=d),min:-360,max:360,step:1,"curve-label":"随机采样 →"},null,8,["mode","value-min","value-max","curve"]),u[53]||(u[53]=T("div",{class:"attr-section-title life-title"},"粒子生命周期变化参数",-1)),T("div",_4,[T("label",C4,[ce(T("input",{type:"checkbox","onUpdate:modelValue":u[24]||(u[24]=d=>I(e).config.speedOverLifeEnabled=d)},null,512),[[wt,I(e).config.speedOverLifeEnabled]]),u[46]||(u[46]=T("span",{class:"switch-ui"},null,-1)),u[47]||(u[47]=T("span",null,"生命周期内速度",-1))]),I(e).config.speedOverLifeEnabled?(K(),Ct(Sn,{key:0,label:"速度倍率",mode:I(e).config.speedOverLifeMode,"onUpdate:mode":I(r),"value-min":I(e).config.speedOverLifeMin,"onUpdate:valueMin":u[25]||(u[25]=d=>I(e).config.speedOverLifeMin=d),"value-max":I(e).config.speedOverLifeMax,"onUpdate:valueMax":u[26]||(u[26]=d=>I(e).config.speedOverLifeMax=d),curve:I(e).config.speedOverLifeCurve,"onUpdate:curve":u[27]||(u[27]=d=>I(e).config.speedOverLifeCurve=d),"default-curve":I(c),min:0,max:3,step:.05,"curve-label":"生命周期 →"},null,8,["mode","onUpdate:mode","value-min","value-max","curve","default-curve"])):xe("",!0)]),T("div",E4,[T("label",A4,[ce(T("input",{type:"checkbox","onUpdate:modelValue":u[28]||(u[28]=d=>I(e).config.scaleOverLifeEnabled=d),onChange:u[29]||(u[29]=(...d)=>I(o)&&I(o)(...d))},null,544),[[wt,I(e).config.scaleOverLifeEnabled]]),u[48]||(u[48]=T("span",{class:"switch-ui"},null,-1)),u[49]||(u[49]=T("span",null,"生命周期内缩放",-1))]),I(e).config.scaleOverLifeEnabled?(K(),J(_e,{key:0},[T("div",I4,[T("button",{class:Ce(["axis-mode",{on:I(e).config.scaleOverLifeAxisMode==="uniform"}]),onClick:u[30]||(u[30]=d=>I(e).config.scaleOverLifeAxisMode="uniform")},"统一",2),T("button",{class:Ce(["axis-mode",{on:I(e).config.scaleOverLifeAxisMode==="separate"}]),onClick:u[31]||(u[31]=d=>I(e).config.scaleOverLifeAxisMode="separate")},"XY分离",2)]),we(Sn,{label:I(e).config.scaleOverLifeAxisMode==="uniform"?"缩放倍率":"倍率 X",mode:I(e).config.scaleOverLifeMode,"onUpdate:mode":I(a),"value-min":I(e).config.scaleOverLifeMin,"onUpdate:valueMin":u[32]||(u[32]=d=>I(e).config.scaleOverLifeMin=d),"value-max":I(e).config.scaleOverLifeMax,"onUpdate:valueMax":u[33]||(u[33]=d=>I(e).config.scaleOverLifeMax=d),curve:I(e).config.scaleOverLifeCurve,"onUpdate:curve":u[34]||(u[34]=d=>I(e).config.scaleOverLifeCurve=d),"default-curve":I(c),min:0,max:3,step:.05,"curve-label":"生命周期 →"},null,8,["label","mode","onUpdate:mode","value-min","value-max","curve","default-curve"]),I(e).config.scaleOverLifeAxisMode==="separate"?(K(),Ct(Sn,{key:0,label:"倍率 Y","show-modes":!1,mode:I(e).config.scaleOverLifeMode,"onUpdate:mode":u[35]||(u[35]=d=>I(e).config.scaleOverLifeMode=d),"value-min":I(e).config.scaleYOverLifeMin,"onUpdate:valueMin":u[36]||(u[36]=d=>I(e).config.scaleYOverLifeMin=d),"value-max":I(e).config.scaleYOverLifeMax,"onUpdate:valueMax":u[37]||(u[37]=d=>I(e).config.scaleYOverLifeMax=d),curve:I(e).config.scaleYOverLifeCurve,"onUpdate:curve":u[38]||(u[38]=d=>I(e).config.scaleYOverLifeCurve=d),"default-curve":I(c),min:0,max:3,step:.05,"curve-label":"生命周期 →"},null,8,["mode","value-min","value-max","curve","default-curve"])):xe("",!0)],64)):xe("",!0)]),T("div",R4,[T("label",P4,[ce(T("input",{type:"checkbox","onUpdate:modelValue":u[39]||(u[39]=d=>I(e).config.rotationOverLifeEnabled=d)},null,512),[[wt,I(e).config.rotationOverLifeEnabled]]),u[50]||(u[50]=T("span",{class:"switch-ui"},null,-1)),u[51]||(u[51]=T("span",null,"生命周期内旋转",-1))]),I(e).config.rotationOverLifeEnabled?(K(),Ct(Sn,{key:0,label:"旋转速度",mode:I(e).config.rotationOverLifeMode,"onUpdate:mode":u[40]||(u[40]=d=>I(e).config.rotationOverLifeMode=d),"value-min":I(e).config.rotationSpeedMin,"onUpdate:valueMin":u[41]||(u[41]=d=>I(e).config.rotationSpeedMin=d),"value-max":I(e).config.rotationSpeedMax,"onUpdate:valueMax":u[42]||(u[42]=d=>I(e).config.rotationSpeedMax=d),curve:I(e).config.rotationOverLifeCurve,"onUpdate:curve":u[43]||(u[43]=d=>I(e).config.rotationOverLifeCurve=d),"default-curve":I(l),min:-720,max:720,step:10,"curve-label":"生命周期 →"},null,8,["mode","value-min","value-max","curve","default-curve"])):xe("",!0)])],512),[[Si,!I(t).attr]])]))}}),F4=Jt(k4,[["__scopeId","data-v-cf6b86a5"]]),O4={class:"gradient-editor"},L4=["title","onClick","onDblclick","onPointerdown"],B4={key:0,class:"gradient-controls"},N4=["value"],D4=["value"],U4={class:"gradient-position"},$4=["value"],X4=["disabled"],V4=Zt({__name:"ColorGradientEditor",props:{modelValue:{}},emits:["update:modelValue"],setup(s,{emit:e}){const t=s,i=e,n=Fe(null),r=Fe(0),o=Le(()=>t.modelValue[r.value]||null),a=Le(()=>[...t.modelValue].sort((C,A)=>C.position-A.position)),l=Le(()=>{const C=a.value;return C.length?`linear-gradient(90deg, ${C.map(A=>`${A.color} ${c(A.position)*100}%`).join(", ")})`:"#ffffff"});ai(()=>t.modelValue.length,C=>{r.value>=C&&(r.value=Math.max(0,C-1))});function c(C){return Math.min(1,Math.max(0,Number(C)||0))}function h(){return t.modelValue.map(C=>({position:c(C.position),color:C.color}))}function u(C,A){const P=h();P[C]&&(P[C]={...P[C],...A},i("update:modelValue",P))}function d(C){u(r.value,{color:C.target.value})}function f(C){var E;const A=C.target,P=b(A.value,((E=o.value)==null?void 0:E.color)||"#ffffff");A.value=P,u(r.value,{color:P})}function m(C){const A=C.target;f(C),A.blur()}function p(C){const A=Number(C.target.value);Number.isFinite(A)&&u(r.value,{position:c(A/100)})}function g(C){const A=h();A.push({position:c(C),color:_(A,C)}),r.value=A.length-1,i("update:modelValue",A)}function x(C){if(!n.value)return;const A=n.value.getBoundingClientRect();g((C.clientX-A.left)/Math.max(1,A.width))}function v(){const C=a.value;let A=.5;if(C.length>1){let P=-1;for(let E=0;EP&&(P=R,A=(C[E].position+C[E+1].position)/2)}}g(A)}function y(C){if(t.modelValue.length<=2||C<0)return;const A=h().filter((P,E)=>E!==C);r.value=Math.min(C,A.length-1),i("update:modelValue",A)}function w(C,A){if(!n.value)return;r.value=A;const P=R=>{const O=n.value.getBoundingClientRect();u(A,{position:c((R.clientX-O.left)/Math.max(1,O.width))})},E=()=>{window.removeEventListener("pointermove",P),window.removeEventListener("pointerup",E),window.removeEventListener("pointercancel",E)};window.addEventListener("pointermove",P),window.addEventListener("pointerup",E),window.addEventListener("pointercancel",E),C.preventDefault()}function _(C,A){const P=[...C].sort((E,R)=>E.position-R.position);if(!P.length)return"#ffffff";if(A<=P[0].position)return P[0].color;if(A>=P[P.length-1].position)return P[P.length-1].color;for(let E=0;EO.position)continue;const U=(A-R.position)/Math.max(1e-4,O.position-R.position);return S(R.color,O.color,U)}return P[P.length-1].color}function S(C,A,P){const E=G=>{const $=parseInt(G.replace("#","").padEnd(6,"0").slice(0,6),16);return[$>>16&255,$>>8&255,$&255]},R=E(C),O=E(A),U=G=>Math.round(R[G]+(O[G]-R[G])*P);return`#${[U(0),U(1),U(2)].map(G=>G.toString(16).padStart(2,"0")).join("")}`}function b(C,A){let P=C.trim().replace(/^#/,"");return/^[0-9a-f]{3}$/i.test(P)&&(P=P.split("").map(E=>E+E).join("")),/^[0-9a-f]{6}$/i.test(P)?`#${P.toLowerCase()}`:A}return(C,A)=>(K(),J("div",O4,[T("div",{ref_key:"bar",ref:n,class:"gradient-bar",style:Ot({background:l.value}),title:"双击色带添加色标",onDblclick:x},[(K(!0),J(_e,null,Et(s.modelValue,(P,E)=>(K(),J("button",{key:E,type:"button",class:Ce(["gradient-stop",{selected:E===r.value}]),style:Ot({left:`${c(P.position)*100}%`,"--stop-color":P.color}),title:`${Math.round(c(P.position)*100)}% · ${P.color}`,onClick:qe(R=>r.value=E,["stop"]),onDblclick:qe(R=>y(E),["stop"]),onPointerdown:qe(R=>w(R,E),["stop"])},null,46,L4))),128))],36),o.value?(K(),J("div",B4,[T("input",{type:"color",class:"gradient-color",value:o.value.color,"aria-label":"色标颜色",onInput:d},null,40,N4),T("input",{type:"text",class:"gradient-hex-input",value:o.value.color,"aria-label":"色标颜色值",spellcheck:"false",onChange:f,onKeydown:Mr(m,["enter"])},null,40,D4),T("label",U4,[T("input",{type:"number",min:"0",max:"100",step:"1",value:Math.round(c(o.value.position)*100),"aria-label":"色标位置",onInput:p},null,40,$4),A[1]||(A[1]=T("span",null,"%",-1))]),T("button",{type:"button",class:"gradient-action",title:"在中间新增颜色",onClick:v},"+"),T("button",{type:"button",class:"gradient-action danger",title:"删除当前色标",disabled:s.modelValue.length<=2,onClick:A[0]||(A[0]=P=>y(r.value))},"×",8,X4)])):xe("",!0),A[2]||(A[2]=T("div",{class:"gradient-hint"},"双击色带新增 · 拖动色标调整位置 · 双击色标删除",-1))]))}}),qS=Jt(V4,[["__scopeId","data-v-f6ab10bf"]]),Y4={class:"pivot-toolbar"},G4={class:"pivot-zoom"},j4=["disabled"],H4=["disabled"],W4=["src"],z4={key:2,class:"pivot-empty"},q4={class:"pivot-bottom"},K4={class:"pivot-card"},Z4={class:"pivot-presets"},J4=["title","aria-label","onClick"],Q4={class:"pivot-card"},e5={class:"pivot-coords"},t5=["value"],i5=["value"],s5={class:"pivot-card-head pivot-rotate-head"},n5={class:"pivot-rotate-state"},r5={class:"pivot-rotate-body"},o5={class:"pivot-rotate-modes"},a5={class:"pivot-rotate-preview"},l5=["src"],wf=1e3,c5=Zt({__name:"PivotEditor",props:{previewUrl:{},anchorX:{},anchorY:{},large:{type:Boolean,default:!1}},emits:["update:anchorX","update:anchorY","fullscreen"],setup(s,{emit:e}){const t=s,i=e,n=[{icon:"↖",label:"左上",x:0,y:0},{icon:"↑",label:"正上",x:50,y:0},{icon:"↗",label:"右上",x:100,y:0},{icon:"←",label:"正左",x:0,y:50},{icon:"◯",label:"正中",x:50,y:50},{icon:"→",label:"正右",x:100,y:50},{icon:"↙",label:"左下",x:0,y:100},{icon:"↓",label:"正下·底部",x:50,y:100},{icon:"↘",label:"右下",x:100,y:100}],r=Fe(null),o=Fe(null),a=Fe({w:0,h:0}),l=Fe({w:1,h:1}),c=Fe(100),h=Fe({x:0,y:0}),u=Fe(!1),d=Fe("static");let f=null;const m=X=>Math.min(wf,Math.max(-wf,Number.isFinite(X)?X:0)),p=Le(()=>m(t.anchorX*100).toFixed(1)),g=Le(()=>m(t.anchorY*100).toFixed(1));function x(X,D){const k=l.value.w/Math.max(1,l.value.h);let N=X,F=N/k;return F>D&&(F=D,N=F*k),{w:Math.max(1,N),h:Math.max(1,F)}}const v=Le(()=>{const X=t.large?26:12,D=Math.max(1,a.value.w-X*2),k=Math.max(1,a.value.h-X*2);return x(D,k)}),y=Le(()=>({width:`${v.value.w}px`,height:`${v.value.h}px`,transform:`translate(${h.value.x}px, ${h.value.y}px) scale(${c.value/100})`})),w=Le(()=>{const X=c.value/100;return{x:a.value.w/2+h.value.x+(m(t.anchorX*100)/100-.5)*v.value.w*X,y:a.value.h/2+h.value.y+(m(t.anchorY*100)/100-.5)*v.value.h*X}}),_=Le(()=>{const X=t.large?128:72,D=x(X,X);return{width:`${D.w}px`,height:`${D.h}px`,transformOrigin:`${m(t.anchorX*100)}% ${m(t.anchorY*100)}%`}});function S(X,D){const k=wf/100;i("update:anchorX",Math.min(k,Math.max(-k,Number.isFinite(X)?X:0))),i("update:anchorY",Math.min(k,Math.max(-k,Number.isFinite(D)?D:0)))}function b(X){const D=o.value;if(!D)return;const k=D.getBoundingClientRect();k.width<=0||k.height<=0||S((X.clientX-k.left)/k.width,(X.clientY-k.top)/k.height)}function C(X){if(!t.previewUrl)return;if(X.button===2){A(X);return}if(X.button!==0)return;X.preventDefault(),b(X);const D=N=>b(N),k=()=>{window.removeEventListener("pointermove",D),window.removeEventListener("pointerup",k),window.removeEventListener("pointercancel",k)};window.addEventListener("pointermove",D),window.addEventListener("pointerup",k),window.addEventListener("pointercancel",k)}function A(X){X.preventDefault(),u.value=!0;const D=X.clientX,k=X.clientY,N=h.value.x,F=h.value.y,V=q=>{h.value={x:N+q.clientX-D,y:F+q.clientY-k}},Y=()=>{u.value=!1,window.removeEventListener("pointermove",V),window.removeEventListener("pointerup",Y),window.removeEventListener("pointercancel",Y)};window.addEventListener("pointermove",V),window.addEventListener("pointerup",Y),window.addEventListener("pointercancel",Y)}function P(X){const D=X.deltaY<0?1.12:.8928571428571428,k=Math.min(400,Math.max(100,Math.round(c.value*D)));if(k===c.value)return;const N=r.value;if(!N){c.value=k;return}const F=N.getBoundingClientRect(),V=X.clientX-F.left,Y=X.clientY-F.top,q=k/c.value;h.value={x:h.value.x+(V-F.width/2-h.value.x)*(1-q),y:h.value.y+(Y-F.height/2-h.value.y)*(1-q)},c.value=k}function E(X){const D=X.target;l.value={w:D.naturalWidth||1,h:D.naturalHeight||1}}function R(X){c.value=Math.min(400,Math.max(100,c.value+X))}function O(){S(.5,.5)}function U(X){S(X.x/100,X.y/100)}function G(X){return Math.abs(m(t.anchorX*100)-X.x)<.05&&Math.abs(m(t.anchorY*100)-X.y)<.05}function $(X,D){const k=m(Number(D.target.value));i(X==="x"?"update:anchorX":"update:anchorY",k/100)}return ai(()=>t.previewUrl,()=>{l.value={w:1,h:1},h.value={x:0,y:0},c.value=100}),ys(()=>{r.value&&(f=new ResizeObserver(X=>{var k;const D=(k=X[0])==null?void 0:k.contentRect;D&&(a.value={w:D.width,h:D.height})}),f.observe(r.value))}),Rr(()=>{f==null||f.disconnect(),f=null}),(X,D)=>(K(),J("div",{class:Ce(["pivot-editor",{"pivot-large":s.large}])},[T("div",Y4,[D[9]||(D[9]=T("div",{class:"pivot-hint"},[T("span",{class:"pivot-hint-icon"},"⊕"),T("span",null,"贴图轴点")],-1)),T("div",G4,[T("button",{type:"button",disabled:c.value<=100,title:"缩小",onClick:D[0]||(D[0]=k=>R(-25))},"−",8,j4),T("span",null,ve(c.value)+"%",1),T("button",{type:"button",disabled:c.value>=400,title:"放大",onClick:D[1]||(D[1]=k=>R(25))},"+",8,H4)]),s.large?xe("",!0):(K(),J("button",{key:0,type:"button",class:"pivot-expand",title:"放大到全屏操作",onClick:D[2]||(D[2]=k=>X.$emit("fullscreen"))},"⤢"))]),T("div",{ref_key:"stageRef",ref:r,class:Ce(["pivot-stage",{panning:u.value}]),title:"左键点击/拖动设置轴点 · 右键拖动画布 · 滚轮缩放",onPointerdown:C,onWheel:qe(P,["prevent"]),onContextmenu:D[3]||(D[3]=qe(()=>{},["prevent"]))},[s.previewUrl?(K(),J("div",{key:0,ref_key:"boxRef",ref:o,class:"pivot-box",style:Ot(y.value)},[T("img",{src:s.previewUrl,alt:"轴点预览",draggable:"false",onLoad:E},null,40,W4)],4)):xe("",!0),s.previewUrl?(K(),J(_e,{key:1},[T("div",{class:"pivot-cross vertical",style:Ot({left:`${w.value.x}px`})},null,4),T("div",{class:"pivot-cross horizontal",style:Ot({top:`${w.value.y}px`})},null,4),T("div",{class:"pivot-marker",style:Ot({left:`${w.value.x}px`,top:`${w.value.y}px`})},null,4),T("div",{class:"pivot-badge",style:Ot({left:`${w.value.x}px`,top:`${w.value.y}px`})},"X: "+ve(p.value)+"% | Y: "+ve(g.value)+"%",5)],64)):(K(),J("div",z4,"未选择图片"))],34),T("div",q4,[T("div",K4,[T("div",Z4,[(K(),J(_e,null,Et(n,k=>T("button",{key:k.label,type:"button",class:Ce(["pivot-preset",{on:G(k)}]),title:`${k.label}(${k.x}%, ${k.y}%)`,"aria-label":k.label,onClick:N=>U(k)},ve(k.icon),11,J4)),64))]),T("button",{type:"button",class:"pivot-reset",onClick:O},"↺ 复位居中 (50%, 50%)")]),T("div",Q4,[D[15]||(D[15]=T("div",{class:"pivot-card-head"},[T("span",null,[T("span",{class:"pivot-card-icon"},"◎"),ft(" 轴点坐标(%)")])],-1)),T("div",e5,[T("label",null,[D[10]||(D[10]=ft("X: ",-1)),T("input",{type:"number",min:"-1000",max:"1000",step:"0.1",value:p.value,onInput:D[4]||(D[4]=k=>$("x",k))},null,40,t5),D[11]||(D[11]=T("span",null,"%",-1))]),T("label",null,[D[12]||(D[12]=ft("Y: ",-1)),T("input",{type:"number",min:"-1000",max:"1000",step:"0.1",value:g.value,onInput:D[5]||(D[5]=k=>$("y",k))},null,40,i5),D[13]||(D[13]=T("span",null,"%",-1))])]),s.large?(K(),J(_e,{key:0},[T("div",s5,[D[14]||(D[14]=T("span",null,[T("span",{class:"pivot-card-icon"},"✥"),ft(" 轴心旋转测试")],-1)),T("span",n5,ve(d.value==="static"?"静止":d.value==="spin"?"自转":"摆动"),1)]),T("div",r5,[T("div",o5,[T("button",{type:"button",class:Ce({on:d.value==="static"}),onClick:D[6]||(D[6]=k=>d.value="static")},"静止",2),T("button",{type:"button",class:Ce({on:d.value==="spin"}),onClick:D[7]||(D[7]=k=>d.value="spin")},"↻ 自转",2),T("button",{type:"button",class:Ce({on:d.value==="swing"}),onClick:D[8]||(D[8]=k=>d.value="swing")},"⇄ 摆动",2)]),T("div",a5,[s.previewUrl?(K(),J("img",{key:0,src:s.previewUrl,alt:"旋转测试",draggable:"false",class:Ce(d.value),style:Ot(_.value)},null,14,l5)):xe("",!0)])])],64)):xe("",!0)])])],2))}}),Iy=Jt(c5,[["__scopeId","data-v-1261b03a"]]),h5={class:"image-card"},u5={class:"imgrow"},d5=["title"],f5=["src","alt"],m5={key:1,viewBox:"0 0 24 24",width:"22",height:"22",fill:"none",stroke:"#8a93bb","stroke-width":"1.6"},p5={class:"img-fields"},g5={key:0,class:"row"},v5={class:"row"},y5=["placeholder"],x5={class:"img-actions"},b5=["title"],w5=["disabled"],S5={class:"thumb-note"},M5={key:0,class:"row"},T5={class:"row"},_5={class:"row"},C5={class:"sequence-note"},E5={class:"resource-weight-row"},A5=["disabled","title"],I5={key:0,viewBox:"0 0 24 24","aria-hidden":"true"},R5={key:1,viewBox:"0 0 24 24","aria-hidden":"true"},P5={key:2,class:"pivot-toggle-row"},k5={class:"pivot-toggle-text"},F5=["title"],O5=["title"],L5={class:"pivot-modal",role:"dialog","aria-modal":"true","aria-label":"贴图旋转轴点大图精修"},B5={class:"pivot-modal-head"},N5={class:"pivot-modal-info"},D5={class:"pivot-modal-title"},U5={class:"pivot-modal-badge"},$5={class:"pivot-modal-actions"},Ry="SpineParticle.PivotPanels.v1",X5=Zt({__name:"ImageResourceCard",props:{resource:{},resourceCount:{},defaultFile:{},namePlaceholder:{default:"particle"},showFolder:{type:Boolean,default:!0},supportsSequence:{type:Boolean,default:!1},pivotKey:{}},emits:["pick","pickSequence","reset","remove","updateWeight","toggleLock"],setup(s,{emit:e}){const t=s,i=e,n=Le(()=>{var C,A;if(t.resource.imageMode==="sequence"){const P=t.resource.sequenceFrames||[];if(!P.length)return"未选择序列帧";const E=((C=P[0])==null?void 0:C.name)||"第 1 帧",R=((A=P[P.length-1])==null?void 0:A.name)||E;return P.length===1?`1 帧 · ${E}`:`${P.length} 帧 · ${E} → ${R}`}const b=t.resource.textureName||t.defaultFile.replace(/\.[^.]+$/,"");return b.includes(".")?b:`${b}.png`}),r=Le(()=>{var b,C;return t.resource.imageMode==="sequence"?((C=(b=t.resource.sequenceFrames)==null?void 0:b[0])==null?void 0:C.previewUrl)||"":t.resource.previewUrl});function o(){try{const b=JSON.parse(sessionStorage.getItem(Ry)||"{}");return b&&typeof b=="object"?b:{}}catch{return{}}}const a=o(),l=Le(()=>t.pivotKey||`particle-image:${t.resource.id}`),c=Le(()=>typeof t.resource.anchorX=="number"&&typeof t.resource.anchorY=="number"),h=Le(()=>Math.abs((t.resource.anchorX??.5)-.5)<1e-4&&Math.abs((t.resource.anchorY??.5)-.5)<1e-4),u=typeof a[l.value]=="boolean",d=Fe(u?a[l.value]:!h.value);ai(d,b=>{a[l.value]=b;try{sessionStorage.setItem(Ry,JSON.stringify(a))}catch{}}),ai(l,b=>{d.value=typeof a[b]=="boolean"?a[b]:!h.value}),ai(()=>h.value,b=>{b||(d.value=!0)},{immediate:!0});const f=Fe(!1),m=Fe(.5),p=Fe(.5),g=Le(()=>{const b=((t.resource.anchorX??.5)*100).toFixed(1),C=((t.resource.anchorY??.5)*100).toFixed(1);return d.value?`已开启:X ${b}% | Y ${C}%`:h.value?"未开启,默认围绕图片正中心 (50%, 50%)":`轴点已自定义:X ${b}% | Y ${C}%`});function x(){m.value=t.resource.anchorX??.5,p.value=t.resource.anchorY??.5,f.value=!0}function v(){d.value||(t.resource.anchorX=.5,t.resource.anchorY=.5,f.value=!1)}function y(b){b&&(t.resource.anchorX=m.value,t.resource.anchorY=p.value),f.value=!1}function w(b){b.key==="Escape"&&f.value&&y(!1)}ys(()=>window.addEventListener("keydown",w)),Rr(()=>window.removeEventListener("keydown",w));const _=Le(()=>{var P,E;const b=t.resource.sequenceFrames||[];if(!b.length)return"未选择序列帧";const C=((P=b[0])==null?void 0:P.name)||"第一张图片",A=((E=b[b.length-1])==null?void 0:E.name)||"最后一张图片";return`已选择 ${b.length} 帧,按 ${C}-${A} 顺序播放`});function S(){t.supportsSequence&&t.resource.imageMode==="sequence"?i("pickSequence",t.resource.id):i("pick",t.resource.id)}return(b,C)=>(K(),J(_e,null,[T("div",h5,[T("div",u5,[T("button",{class:"img-thumb",title:s.supportsSequence&&s.resource.imageMode==="sequence"?"选择序列帧图片":"选择本地图片",onClick:S},[r.value?(K(),J("img",{key:0,src:r.value,alt:s.resource.textureName},null,8,f5)):(K(),J("svg",m5,[...C[19]||(C[19]=[T("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"},null,-1),T("circle",{cx:"8.5",cy:"8.5",r:"1.6"},null,-1),T("path",{d:"M21 15l-5-5-9 9"},null,-1)])]))],8,d5),T("div",p5,[s.showFolder?(K(),J("label",g5,[C[20]||(C[20]=T("span",null,"子文件夹",-1)),ce(T("input",{"onUpdate:modelValue":C[0]||(C[0]=A=>s.resource.textureFolder=A),type:"text",class:"inp",placeholder:"subfolder/"},null,512),[[He,s.resource.textureFolder]])])):xe("",!0),T("label",v5,[C[21]||(C[21]=T("span",null,"名称",-1)),ce(T("input",{"onUpdate:modelValue":C[1]||(C[1]=A=>s.resource.textureName=A),type:"text",class:"inp",placeholder:s.namePlaceholder},null,8,y5),[[He,s.resource.textureName]])])]),T("div",x5,[T("button",{class:"mini-btn2",title:`恢复 ${s.defaultFile}`,onClick:C[2]||(C[2]=A=>b.$emit("reset",s.resource.id))},"⟳",8,b5),T("button",{class:"mini-btn2",title:"删除图片资源",disabled:s.resourceCount===1,onClick:C[3]||(C[3]=A=>b.$emit("remove",s.resource.id))},"🗑",8,w5)])]),T("div",S5,ve(n.value),1),s.supportsSequence?(K(),J("label",M5,[C[23]||(C[23]=T("span",null,"图片模式",-1)),ce(T("select",{"onUpdate:modelValue":C[4]||(C[4]=A=>s.resource.imageMode=A),class:"inp"},[...C[22]||(C[22]=[T("option",{value:"fixed"},"固定",-1),T("option",{value:"sequence"},"序列帧",-1)])],512),[[bt,s.resource.imageMode]])])):xe("",!0),s.supportsSequence&&s.resource.imageMode==="sequence"?(K(),J(_e,{key:1},[T("label",T5,[C[25]||(C[25]=T("span",null,"播放模式",-1)),ce(T("select",{"onUpdate:modelValue":C[5]||(C[5]=A=>s.resource.sequencePlayback=A),class:"inp"},[...C[24]||(C[24]=[T("option",{value:"once-hide"},"单次-尾帧消失",-1),T("option",{value:"once-hold"},"单次-尾帧固定",-1),T("option",{value:"loop-forward"},"正向循环",-1),T("option",{value:"loop-reverse"},"反向循环",-1)])],512),[[bt,s.resource.sequencePlayback]])]),T("label",_5,[C[26]||(C[26]=T("span",null,"播放帧率",-1)),ce(T("input",{"onUpdate:modelValue":C[6]||(C[6]=A=>s.resource.sequenceFps=A),type:"number",min:"1",max:"120",step:"1",class:"inp"},null,512),[[He,s.resource.sequenceFps,void 0,{number:!0}]])]),T("button",{class:"sequence-pick",onClick:C[7]||(C[7]=A=>b.$emit("pickSequence",s.resource.id))},"选择序列帧(多选)"),T("div",C5,ve(_.value),1)],64)):xe("",!0),T("div",E5,[we(Oe,{class:"resource-weight-control",label:"占比%",min:0,max:100,step:1,"model-value":s.resource.weight,disabled:s.resource.locked||s.resourceCount===1,"onUpdate:modelValue":C[8]||(C[8]=A=>b.$emit("updateWeight",s.resource.id,A))},null,8,["model-value","disabled"]),T("button",{class:Ce(["weight-lock",{on:s.resource.locked}]),disabled:s.resourceCount===1,title:s.resource.locked?"解除占比锁定":"锁定当前占比",onClick:C[9]||(C[9]=A=>b.$emit("toggleLock",s.resource.id))},[s.resource.locked?(K(),J("svg",I5,[...C[27]||(C[27]=[T("rect",{x:"5",y:"10",width:"14",height:"10",rx:"2"},null,-1),T("path",{d:"M8 10V7a4 4 0 0 1 8 0v3"},null,-1)])])):(K(),J("svg",R5,[...C[28]||(C[28]=[T("rect",{x:"5",y:"10",width:"14",height:"10",rx:"2"},null,-1),T("path",{d:"M16 10V7a4 4 0 0 0-7.5-2"},null,-1)])]))],10,A5)]),bT(b.$slots,"default",{},void 0),c.value?(K(),J("div",P5,[C[31]||(C[31]=T("div",{class:"pivot-toggle-icon"},"◎",-1)),T("div",k5,[C[29]||(C[29]=T("div",{class:"pivot-toggle-title"},"贴图轴点",-1)),T("div",{class:"pivot-toggle-sub",title:g.value},ve(g.value),9,F5)]),T("label",{class:"pivot-switch",title:d.value?"收起轴点调整":"展开轴点调整"},[ce(T("input",{"onUpdate:modelValue":C[10]||(C[10]=A=>d.value=A),type:"checkbox",onChange:v},null,544),[[wt,d.value]]),C[30]||(C[30]=T("span",{class:"pivot-switch-ui"},null,-1))],8,O5)])):xe("",!0),c.value&&d.value?(K(),Ct(Iy,{key:3,"preview-url":r.value,"anchor-x":s.resource.anchorX??.5,"anchor-y":s.resource.anchorY??.5,"onUpdate:anchorX":C[11]||(C[11]=A=>s.resource.anchorX=A),"onUpdate:anchorY":C[12]||(C[12]=A=>s.resource.anchorY=A),onFullscreen:x},null,8,["preview-url","anchor-x","anchor-y"])):xe("",!0)]),(K(),Ct(dx,{to:"body"},[f.value?(K(),J("div",{key:0,class:"pivot-modal-backdrop",onPointerdown:C[18]||(C[18]=qe(A=>y(!1),["self"]))},[T("div",L5,[T("div",B5,[C[34]||(C[34]=T("div",{class:"pivot-modal-icon"},"◎",-1)),T("div",N5,[T("div",D5,[C[32]||(C[32]=ft(" 贴图旋转轴点大图精修 ",-1)),T("span",U5,ve(s.resource.textureName||s.defaultFile),1)]),C[33]||(C[33]=T("div",{class:"pivot-modal-desc"},"在下方贴图上任意点击或拖拽,精确设置粒子的旋转/摆动中心",-1))]),T("button",{type:"button",class:"pivot-modal-close",title:"关闭",onClick:C[13]||(C[13]=A=>y(!1))},"✕")]),C[35]||(C[35]=T("div",{class:"pivot-modal-hint"},"支持 100% ~ 400% 放大,精确对准尖端或根部:",-1)),we(Iy,{large:"","preview-url":r.value,"anchor-x":m.value,"anchor-y":p.value,"onUpdate:anchorX":C[14]||(C[14]=A=>m.value=A),"onUpdate:anchorY":C[15]||(C[15]=A=>p.value=A)},null,8,["preview-url","anchor-x","anchor-y"]),T("div",$5,[T("button",{type:"button",class:"pivot-modal-cancel",onClick:C[16]||(C[16]=A=>y(!1))},"取消"),T("button",{type:"button",class:"pivot-modal-confirm",onClick:C[17]||(C[17]=A=>y(!0))},"确定并保存轴点")])])],32)):xe("",!0)]))],64))}}),KS=Jt(X5,[["__scopeId","data-v-cb3a8e2c"]]),V5={class:"group"},Y5={class:"caret"},G5={class:"group-body"},j5={class:"seg"},H5={class:"row"},W5={class:"curve-wrap"},z5={class:"seg"},q5={class:"row"},K5=["value"],Z5={value:0},J5=["value"],Q5={class:"render-layer-current"},e8=["title"],t8={key:0,class:"slot-picker"},i8={class:"slot-list"},s8=["onClick"],n8={class:"slot-order"},r8={class:"slot-name"},o8={class:"slot-attachment"},a8={key:0,class:"modifier-hint"},l8={class:"seg"},c8={class:"switch-row render-layer-switch"},h8=["disabled"],u8={key:0,class:"modifier-hint"},d8={key:2,class:"modifier-hint render-layer-warning"},f8={class:"look-title image-title"},m8={class:"row resource-color-row"},p8=["onUpdate:modelValue"],g8=["onUpdate:modelValue"],v8={key:0,class:"row resource-color-picker"},y8=["onUpdate:modelValue"],x8=["value","onChange","onKeydown"],b8={key:0,class:"random-color-hint"},w8={class:"resource-alpha-head"},S8={class:"alpha-modes"},M8=["onClick"],T8=["onClick"],_8=["onClick"],C8={class:"row"},E8=["onUpdate:modelValue"],A8={class:"resource-alpha-curve"},I8=Zt({__name:"ParticleAppearanceSection",setup(s){const{resolvedCurveEditorMode:e,sys:t,textureFileInput:i,sequenceFileInput:n,addImageResource:r,openTexturePicker:o,openSequencePicker:a,onTextureFile:l,onSequenceFiles:c,resetTexture:h,setResourceFixedColor:u,commitResourceFixedColor:d,removeImageResource:f,setResourceWeight:m,toggleResourceLock:p,collapsed:g,toggle:x,resetModule:v,select:y,renderLayerSlotPickerOpen:w,renderLayerSlotSearch:_,renderLayerReadySpines:S,renderLayerSpineReady:b,renderLayerFilteredSlots:C,renderLayerSlotLabel:A,renderLayerResolvedLabel:P,renderLayerWarning:E,setRenderLayerSlotMode:R,selectRenderLayerSpine:O,pickRenderLayerSlot:U,clearRenderLayerSlot:G,ALPHA_CURVE:$,RESOURCE_ALPHA_CURVE:X}=Fr();return(D,k)=>(K(),J("div",V5,[T("div",{class:"group-head",onClick:k[1]||(k[1]=N=>I(x)("look"))},[T("span",Y5,ve(I(g).look?"▸":"▾"),1),k[19]||(k[19]=T("span",null,"外观与资源",-1)),T("button",{class:"group-reset",title:"重置外观与资源参数",onClick:k[0]||(k[0]=qe(N=>I(v)("look"),["stop"]))},"重置")]),ce(T("div",G5,[k[36]||(k[36]=T("div",{class:"look-title"},"透明度",-1)),T("div",j5,[T("button",{class:Ce(["seg-btn",{active:I(t).config.alphaMode==="curve"}]),onClick:k[2]||(k[2]=N=>I(t).config.alphaMode="curve")},"曲线",2),T("button",{class:Ce(["seg-btn",{active:I(t).config.alphaMode==="fixed"}]),onClick:k[3]||(k[3]=N=>I(t).config.alphaMode="fixed")},"固定",2)]),I(t).config.alphaMode==="fixed"?(K(),Ct(Oe,{key:0,label:"透明度",min:0,max:1,step:.01,modelValue:I(t).config.alpha,"onUpdate:modelValue":k[4]||(k[4]=N=>I(t).config.alpha=N)},null,8,["modelValue"])):(K(),J(_e,{key:1},[T("label",H5,[k[21]||(k[21]=T("span",null,"曲线模式",-1)),ce(T("select",{"onUpdate:modelValue":k[5]||(k[5]=N=>I(t).config.curveMode=N),class:"inp"},[...k[20]||(k[20]=[T("option",null,"跟随导出",-1),T("option",null,"线性",-1),T("option",null,"贝塞尔",-1)])],512),[[bt,I(t).config.curveMode]])]),T("div",W5,[we(tn,{modelValue:I(t).config.alphaCurve,"onUpdate:modelValue":k[6]||(k[6]=N=>I(t).config.alphaCurve=N),"default-value":I($),mode:I(e)(I(t).config.curveMode)},null,8,["modelValue","default-value","mode"]),k[22]||(k[22]=T("div",{class:"curve-labels"},[T("span",null,"0(透明)"),T("span",null,"生命周期 →"),T("span",null,"1(不透明)")],-1))])],64)),k[37]||(k[37]=T("div",{class:"look-title"},"渲染层级(Spine 插槽)",-1)),T("div",z5,[T("button",{class:Ce(["seg-btn",{active:I(t).config.renderLayerMode==="top"}]),onClick:k[7]||(k[7]=N=>I(t).config.renderLayerMode="top")},"最上层",2),T("button",{class:Ce(["seg-btn",{active:I(t).config.renderLayerMode==="slot"}]),onClick:k[8]||(k[8]=(...N)=>I(R)&&I(R)(...N))},"Spine 插槽",2)]),I(t).config.renderLayerMode==="slot"?(K(),J(_e,{key:2},[T("label",q5,[k[23]||(k[23]=T("span",null,"Spine",-1)),T("select",{class:"inp",value:I(t).config.renderLayerSpineId,onChange:k[9]||(k[9]=(...N)=>I(O)&&I(O)(...N))},[T("option",Z5,ve(I(S).length?"请选择 Spine":"无可用 Spine"),1),(K(!0),J(_e,null,Et(I(S),N=>(K(),J("option",{key:N.id,value:N.id},ve(N.name),9,J5))),128))],40,K5)]),I(b)?(K(),J(_e,{key:0},[T("div",Q5,[T("span",{class:"render-layer-text",title:I(A)},ve(I(A)||"尚未选择插槽"),9,e8),T("button",{class:"mini-btn",onClick:k[10]||(k[10]=N=>w.value=!I(w))},ve(I(A)?"重新选择":"选择插槽"),1),I(t).config.renderLayerSlotName?(K(),J("button",{key:0,class:"mini-btn ghost",onClick:k[11]||(k[11]=(...N)=>I(G)&&I(G)(...N))},"清除")):xe("",!0)]),I(w)?(K(),J("div",t8,[ce(T("input",{"onUpdate:modelValue":k[12]||(k[12]=N=>jt(_)?_.value=N:null),class:"inp",type:"search",placeholder:"搜索插槽或附件名称…","aria-label":"搜索插槽"},null,512),[[He,I(_),void 0,{trim:!0}]]),T("div",i8,[(K(!0),J(_e,null,Et(I(C),N=>(K(),J("button",{key:N.name,class:Ce(["slot-item",{on:I(t).config.renderLayerSlotName===N.name}]),onClick:F=>I(U)(N)},[T("span",n8,ve(N.order+1),1),T("span",r8,ve(N.name),1),T("span",o8,ve(N.attachment||"空插槽"),1)],10,s8))),128)),I(C).length?xe("",!0):(K(),J("div",a8,"没有匹配的插槽"))])])):xe("",!0),I(t).config.renderLayerSlotName?(K(),J(_e,{key:1},[T("div",l8,[T("button",{class:Ce(["seg-btn",{active:I(t).config.renderLayerSlotPosition==="above"}]),onClick:k[13]||(k[13]=N=>I(t).config.renderLayerSlotPosition="above")},"在此插槽图片之上",2),T("button",{class:Ce(["seg-btn",{active:I(t).config.renderLayerSlotPosition==="below"}]),onClick:k[14]||(k[14]=N=>I(t).config.renderLayerSlotPosition="below")},"在此插槽图片之下",2)]),T("label",c8,[ce(T("input",{"onUpdate:modelValue":k[15]||(k[15]=N=>I(t).config.renderLayerFollowAttachment=N),type:"checkbox",disabled:I(t).config.renderLayerSlotPosition==="below"},null,8,h8),[[wt,I(t).config.renderLayerFollowAttachment]]),k[24]||(k[24]=T("span",{class:"switch-ui"},null,-1)),k[25]||(k[25]=T("span",null,"随插槽附件显隐",-1))]),I(P)?(K(),J("div",u8,ve(I(P)),1)):xe("",!0)],64)):xe("",!0),I(E)?(K(),J("div",d8,ve(I(E)),1)):xe("",!0),k[26]||(k[26]=T("div",{class:"modifier-hint"},"调整显示层级只影响编辑器预览,不影响导出数据。",-1))],64)):xe("",!0)],64)):xe("",!0),T("div",f8,[k[27]||(k[27]=T("span",null,"图片资源",-1)),T("button",{class:"image-add",title:"新增图片资源",onClick:k[16]||(k[16]=(...N)=>I(r)&&I(r)(...N))},"+")]),(K(!0),J(_e,null,Et(I(t).config.imageResources,N=>(K(),Ct(KS,{key:`${I(t).id}:${N.id}`,resource:N,"resource-count":I(t).config.imageResources.length,"pivot-key":`${I(t).id}:${N.id}`,"supports-sequence":"","default-file":"star.png",onPick:I(o),onPickSequence:I(a),onReset:I(h),onRemove:I(f),onUpdateWeight:I(m),onToggleLock:I(p)},{default:Zh(()=>[we(Oe,{label:"缩放",min:.1,max:3,step:.05,modelValue:N.scale,"onUpdate:modelValue":F=>N.scale=F},null,8,["modelValue","onUpdate:modelValue"]),k[35]||(k[35]=T("div",{class:"resource-divider"},null,-1)),T("label",m8,[k[30]||(k[30]=T("span",null,"颜色",-1)),ce(T("select",{"onUpdate:modelValue":F=>N.colorMode=F,class:"inp"},[...k[28]||(k[28]=[T("option",{value:"fixed"},"固定色",-1),T("option",{value:"random"},"随机颜色",-1),T("option",{value:"lifetime"},"生命周期",-1)])],8,p8),[[bt,N.colorMode]]),ce(T("select",{"onUpdate:modelValue":F=>N.blend=F,class:"inp blend-select"},[...k[29]||(k[29]=[T("option",{value:"normal"},"正常",-1),T("option",{value:"add"},"相加",-1),T("option",{value:"multiply"},"相乘",-1),T("option",{value:"screen"},"滤色",-1)])],8,g8),[[bt,N.blend]])]),N.colorMode==="fixed"?(K(),J("label",v8,[k[31]||(k[31]=T("span",null,"固定色",-1)),ce(T("input",{type:"color","onUpdate:modelValue":F=>N.colorStart=F,class:"colr"},null,8,y8),[[He,N.colorStart]]),T("input",{type:"text",class:"hex-input",value:N.colorStart,spellcheck:"false","aria-label":"固定颜色值",onChange:F=>I(u)(N,F),onKeydown:Mr(F=>I(d)(N,F),["enter"])},null,40,x8)])):(K(),J(_e,{key:1},[we(qS,{modelValue:N.colorGradient,"onUpdate:modelValue":F=>N.colorGradient=F},null,8,["modelValue","onUpdate:modelValue"]),N.colorMode==="random"?(K(),J("div",b8,"每个粒子出生时从色带随机取色,生命周期内保持不变")):xe("",!0)],64)),T("div",w8,[k[32]||(k[32]=T("span",null,"独立透明度",-1)),T("div",S8,[T("button",{class:Ce({on:N.independentAlpha==="off"}),onClick:F=>N.independentAlpha="off"},"关闭",10,M8),T("button",{class:Ce({on:N.independentAlpha==="fixed"}),onClick:F=>N.independentAlpha="fixed"},"固定",10,T8),T("button",{class:Ce({on:N.independentAlpha==="curve"}),onClick:F=>N.independentAlpha="curve"},"曲线",10,_8)])]),N.independentAlpha==="fixed"?(K(),Ct(Oe,{key:2,label:"透明度",min:0,max:1,step:.01,modelValue:N.alpha,"onUpdate:modelValue":F=>N.alpha=F},null,8,["modelValue","onUpdate:modelValue"])):N.independentAlpha==="curve"?(K(),J(_e,{key:3},[T("label",C8,[k[34]||(k[34]=T("span",null,"曲线模式",-1)),ce(T("select",{"onUpdate:modelValue":F=>N.alphaCurveMode=F,class:"inp"},[...k[33]||(k[33]=[T("option",null,"跟随导出",-1),T("option",null,"线性",-1),T("option",null,"贝塞尔",-1)])],8,E8),[[bt,N.alphaCurveMode]])]),T("div",A8,[we(tn,{modelValue:N.alphaCurve,"onUpdate:modelValue":F=>N.alphaCurve=F,"default-value":I(X),mode:I(e)(N.alphaCurveMode)},null,8,["modelValue","onUpdate:modelValue","default-value","mode"])])],64)):xe("",!0)]),_:2},1032,["resource","resource-count","pivot-key","onPick","onPickSequence","onReset","onRemove","onUpdateWeight","onToggleLock"]))),128)),T("input",{ref_key:"textureFileInput",ref:i,class:"file-input",type:"file",accept:"image/png,image/jpeg,image/webp,image/gif",onChange:k[17]||(k[17]=(...N)=>I(l)&&I(l)(...N))},null,544),T("input",{ref_key:"sequenceFileInput",ref:n,class:"file-input",type:"file",multiple:"",accept:"image/png,image/jpeg,image/webp,image/gif",onChange:k[18]||(k[18]=(...N)=>I(c)&&I(c)(...N))},null,544)],512),[[Si,!I(g).look]])]))}}),R8=Jt(I8,[["__scopeId","data-v-5709815f"]]),P8={class:"group"},k8={class:"caret"},F8={class:"group-body"},O8={class:"modifier-item damping-item"},L8={class:"modifier-item"},B8={class:"switch-row modifier-switch"},N8={key:0,class:"modifier-params"},D8={class:"modifier-item"},U8={class:"switch-row modifier-switch"},$8={key:0,class:"modifier-params gravity-params"},X8={class:"modifier-mode-row"},V8={class:"modifier-item"},Y8={class:"switch-row modifier-switch"},G8={key:0,class:"modifier-params gravity-params"},j8={class:"modifier-mode-row"},H8={class:"modifier-item"},W8={class:"switch-row modifier-switch"},z8={key:0,class:"modifier-params"},q8={class:"row"},K8={class:"switch-row"},Z8={class:"modifier-item"},J8={class:"switch-row modifier-switch"},Q8={key:0,class:"modifier-params"},eU={class:"row"},tU={class:"switch-row"},iU={class:"modifier-item"},sU={class:"switch-row modifier-switch"},nU={key:0,class:"modifier-params"},rU={class:"row"},oU={class:"row"},aU={class:"switch-row"},lU={class:"modifier-item"},cU={class:"switch-row modifier-switch"},hU={key:0,class:"modifier-params trail-params"},uU={class:"trail-section-head"},dU={class:"row"},fU=["onUpdate:modelValue"],mU={class:"row"},pU=["onUpdate:modelValue"],gU={class:"row"},vU=["onUpdate:modelValue"],yU={class:"switch-row trail-sub-switch"},xU=["onUpdate:modelValue"],bU={class:"switch-row trail-sub-switch"},wU=["onUpdate:modelValue"],SU={class:"trail-mode-head"},MU={class:"alpha-modes"},TU=["onClick"],_U=["onClick"],CU=["onClick"],EU={class:"row"},AU=["onUpdate:modelValue"],IU={key:6,class:"row trail-fixed-color"},RU=["onUpdate:modelValue"],PU=["value","onChange","onKeydown"],kU={class:"trail-mode-head"},FU={class:"alpha-modes"},OU=["onClick"],LU=["onClick"],BU=["onClick"],NU={class:"trail-grid-row"},DU={class:"modifier-item"},UU={class:"switch-row modifier-switch"},$U=["disabled"],XU={key:0,class:"modifier-params emitter-follow-params"},VU={class:"field-block"},YU=["value"],GU={key:0,value:"bone"},jU={class:"field-block"},HU=["value"],WU={class:"field-block"},zU={class:"field-grid follow-grid"},qU={class:"compact-field"},KU={class:"compact-field"},ZU={class:"field-block"},JU={key:0,class:"bone-follow-target"},QU={key:1,class:"bone-follow-missing"},e$={class:"field-block"},t$={class:"field-grid follow-grid"},i$={class:"compact-field"},s$={class:"compact-field"},n$={class:"bone-follow-transform-grid"},r$={class:"compact-field"},o$={class:"compact-field"},a$={class:"compact-field"},l$={class:"modifier-item"},c$={class:"switch-row modifier-switch"},h$={key:0,class:"modifier-params collision-filter-params"},u$={class:"collision-filter-tags"},d$=["title"],f$=["aria-label","onClick"],m$=["disabled","title"],p$={key:0,class:"collision-filter-empty"},g$={key:1,class:"collision-filter-picker"},v$=["onClick"],y$={class:"modifier-item events-item"},x$={class:"switch-row modifier-switch"},b$={key:0,class:"event-rules"},w$={class:"event-selects"},S$=["onUpdate:modelValue"],M$=["onUpdate:modelValue"],T$=["value"],_$=["onClick"],C$={class:"event-probability"},E$=["onUpdate:modelValue"],A$={key:0,class:"event-probability event-collision-limit"},I$=["value","onInput"],R$={class:"event-probability event-inherit"},P$=["onClick"],k$={class:"inherit-summary"},F$={key:1,class:"event-probability event-color-mode"},O$=["onUpdate:modelValue"],L$={class:"inherit-check"},B$={class:"inherit-check"},N$=["onClick"],D$={class:"inherit-check"},U$=Zt({__name:"ParticleModifiersSection",setup(s){const{store:e,sys:t,trailTextureFileInput:i,addTrailResource:n,openTrailTexturePicker:r,onTrailRigChange:o,onTrailResourceBoneCountChange:a,onTrailResourceRotationChange:l,onTrailTextureFile:c,resetTrailTexture:h,removeTrailResource:u,setTrailResourceWeight:d,toggleTrailResourceLock:f,setTrailColor:m,commitTrailColor:p,selectedSpineBone:g,boundSpineBone:x,collisionPickerOpen:v,selectedCollisionBodies:y,availableCollisionBodies:w,addCollisionBody:_,removeCollisionBody:S,collapsed:b,toggle:C,onEmitterFollowModeChange:A,bindSelectedBone:P,resetModule:E,select:R,LINEAR_CURVE:O,FLAT_CURVE:U,TRAIL_ALPHA_CURVE:G,TRAIL_SHAPE_CURVE:$}=Fr(),X=Le(()=>{var B;const Z=(B=t.value)==null?void 0:B.id;if(!Z)return[];const L=k1(e.systems,Z);return e.systems.filter(j=>j.id!==Z&&!L.has(j.id))}),D=[{key:"color",label:"颜色"},{key:"scale",label:"大小"},{key:"rotation",label:"旋转"},{key:"life",label:"生命周期"}],k=Fe(null),N=Le(()=>{var B;const Z=k.value,L=(B=t.value)==null?void 0:B.config.events;return!Z||!Array.isArray(L)?null:L.find(j=>j.id===Z.ruleId)||null});function F(Z){return Array.isArray(Z.inherit)||(Z.inherit=[]),Z.inherit}function V(Z){const L=F(Z);return L.length?L.length===D.length?"所有属性":D.filter(B=>L.includes(B.key)).map(B=>B.label).join("、"):"无(默认值)"}function Y(Z,L){return F(Z).includes(L)}function q(Z,L){const B=F(Z),j=B.indexOf(L);j>=0?B.splice(j,1):B.push(L)}function z(Z){F(Z).splice(0)}function se(Z){F(Z).splice(0,F(Z).length,...D.map(L=>L.key))}function oe(Z,L){var Me;if(((Me=k.value)==null?void 0:Me.ruleId)===Z.id){k.value=null;return}const B=L.currentTarget;if(!B)return;const j=B.getBoundingClientRect(),ie=Math.max(168,j.width),ue=212,me=Math.min(Math.max(8,j.left),Math.max(8,window.innerWidth-ie-8));let ee=j.bottom+4;ee+ue>window.innerHeight-8&&(ee=Math.max(8,j.top-ue-4)),k.value={ruleId:Z.id,left:me,top:ee,width:ie}}function de(){k.value=null}function ge(){de()}function he(Z){Z.key==="Escape"&&de()}ys(()=>{document.addEventListener("pointerdown",de),window.addEventListener("scroll",ge,!0),window.addEventListener("resize",ge),window.addEventListener("keydown",he)}),Rr(()=>{document.removeEventListener("pointerdown",de),window.removeEventListener("scroll",ge,!0),window.removeEventListener("resize",ge),window.removeEventListener("keydown",he)});function fe(){var B;const Z=(B=t.value)==null?void 0:B.config;if(!Z)return;Array.isArray(Z.events)||(Z.events=[]);const L=Math.max(0,...Z.events.map(j=>j.id))+1;Z.events.push({id:L,event:"birth",targetSystemId:0,probability:1,collisionLimit:1,inherit:[],colorInheritMode:"add"})}function H(Z){var L;(L=t.value)==null||L.config.events.splice(Z,1)}function W(Z,L){const B=L.target,j=Math.round(Number(B.value));Z.collisionLimit=Math.min(4,Math.max(1,Number.isFinite(j)?j:1)),B.value=String(Z.collisionLimit)}return(Z,L)=>(K(),J(_e,null,[T("div",P8,[T("div",{class:"group-head",onClick:L[1]||(L[1]=B=>I(C)("mods"))},[T("span",k8,ve(I(b).mods?"▸":"▾"),1),L[74]||(L[74]=T("span",null,"修改器",-1)),T("button",{class:"group-reset",title:"重置修改器参数",onClick:L[0]||(L[0]=qe(B=>I(E)("mods"),["stop"]))},"重置")]),ce(T("div",F8,[T("div",O8,[we(Oe,{label:"阻尼",min:0,max:2,step:.05,modelValue:I(t).config.damping,"onUpdate:modelValue":L[2]||(L[2]=B=>I(t).config.damping=B)},null,8,["modelValue"])]),T("div",L8,[T("label",B8,[ce(T("input",{type:"checkbox","onUpdate:modelValue":L[3]||(L[3]=B=>I(t).config.noise=B)},null,512),[[wt,I(t).config.noise]]),L[75]||(L[75]=T("span",{class:"switch-ui"},null,-1)),L[76]||(L[76]=T("span",null,"开启移动噪声",-1))]),I(t).config.noise?(K(),J("div",N8,[we(Oe,{label:"强度",min:0,max:100,step:1,modelValue:I(t).config.noiseAmt,"onUpdate:modelValue":L[4]||(L[4]=B=>I(t).config.noiseAmt=B)},null,8,["modelValue"]),we(Oe,{label:"波动范围",min:0,max:500,step:1,modelValue:I(t).config.noiseRange,"onUpdate:modelValue":L[5]||(L[5]=B=>I(t).config.noiseRange=B)},null,8,["modelValue"]),we(Oe,{label:"时间流速",min:0,max:10,step:.1,modelValue:I(t).config.noiseSpeed,"onUpdate:modelValue":L[6]||(L[6]=B=>I(t).config.noiseSpeed=B)},null,8,["modelValue"]),L[77]||(L[77]=T("div",{class:"modifier-hint"},"强度控制影响比例 · 波动范围控制最大偏移 · 时间流速控制变化速度",-1))])):xe("",!0)]),T("div",D8,[T("label",U8,[ce(T("input",{type:"checkbox","onUpdate:modelValue":L[7]||(L[7]=B=>I(t).config.useGravity=B)},null,512),[[wt,I(t).config.useGravity]]),L[78]||(L[78]=T("span",{class:"switch-ui"},null,-1)),L[79]||(L[79]=T("span",null,"开启重力",-1))]),I(t).config.useGravity?(K(),J("div",$8,[T("div",X8,[T("button",{class:Ce(["axis-mode",{on:I(t).config.gravityMode==="fixed"}]),onClick:L[8]||(L[8]=B=>I(t).config.gravityMode="fixed")},"固定",2),T("button",{class:Ce(["axis-mode",{on:I(t).config.gravityMode==="random"}]),onClick:L[9]||(L[9]=B=>I(t).config.gravityMode="random")},"随机",2)]),I(t).config.gravityMode==="fixed"?(K(),Ct(Oe,{key:0,label:"重力强度",min:-3e3,max:3e3,step:10,modelValue:I(t).config.gravityMin,"onUpdate:modelValue":L[10]||(L[10]=B=>I(t).config.gravityMin=B)},null,8,["modelValue"])):(K(),J(_e,{key:1},[we(Oe,{label:"强度 min",min:-3e3,max:3e3,step:10,modelValue:I(t).config.gravityMin,"onUpdate:modelValue":L[11]||(L[11]=B=>I(t).config.gravityMin=B)},null,8,["modelValue"]),we(Oe,{label:"强度 max",min:-3e3,max:3e3,step:10,modelValue:I(t).config.gravityMax,"onUpdate:modelValue":L[12]||(L[12]=B=>I(t).config.gravityMax=B)},null,8,["modelValue"])],64)),we(Oe,{label:"方向",min:-360,max:360,step:1,modelValue:I(t).config.gravityDirection,"onUpdate:modelValue":L[13]||(L[13]=B=>I(t).config.gravityDirection=B)},null,8,["modelValue"]),L[80]||(L[80]=T("div",{class:"gravity-curve-title"},[T("span",null,"生命周期内重力"),T("span",null,"纵轴:强度 0~1")],-1)),we(tn,{modelValue:I(t).config.gravityCurve,"onUpdate:modelValue":L[14]||(L[14]=B=>I(t).config.gravityCurve=B),"default-value":I(U)},null,8,["modelValue","default-value"]),L[81]||(L[81]=T("div",{class:"gravity-curve-axis"},[T("span",null,"0"),T("span",null,"生命周期 →"),T("span",null,"1")],-1)),L[82]||(L[82]=T("div",{class:"modifier-hint"},"0° 向右 · -90° 向下 · 负强度会反转方向",-1))])):xe("",!0)]),T("div",V8,[T("label",Y8,[ce(T("input",{type:"checkbox","onUpdate:modelValue":L[15]||(L[15]=B=>I(t).config.wind=B)},null,512),[[wt,I(t).config.wind]]),L[83]||(L[83]=T("span",{class:"switch-ui"},null,-1)),L[84]||(L[84]=T("span",null,"开启风力",-1))]),I(t).config.wind?(K(),J("div",G8,[T("div",j8,[T("button",{class:Ce(["axis-mode",{on:I(t).config.windMode==="fixed"}]),onClick:L[16]||(L[16]=B=>I(t).config.windMode="fixed")},"固定",2),T("button",{class:Ce(["axis-mode",{on:I(t).config.windMode==="random"}]),onClick:L[17]||(L[17]=B=>I(t).config.windMode="random")},"随机",2)]),I(t).config.windMode==="fixed"?(K(),Ct(Oe,{key:0,label:"风力强度",min:-3e3,max:3e3,step:10,modelValue:I(t).config.windMin,"onUpdate:modelValue":L[18]||(L[18]=B=>I(t).config.windMin=B)},null,8,["modelValue"])):(K(),J(_e,{key:1},[we(Oe,{label:"强度 min",min:-3e3,max:3e3,step:10,modelValue:I(t).config.windMin,"onUpdate:modelValue":L[19]||(L[19]=B=>I(t).config.windMin=B)},null,8,["modelValue"]),we(Oe,{label:"强度 max",min:-3e3,max:3e3,step:10,modelValue:I(t).config.windMax,"onUpdate:modelValue":L[20]||(L[20]=B=>I(t).config.windMax=B)},null,8,["modelValue"])],64)),we(Oe,{label:"方向",min:-360,max:360,step:1,modelValue:I(t).config.windDirection,"onUpdate:modelValue":L[21]||(L[21]=B=>I(t).config.windDirection=B)},null,8,["modelValue"]),L[85]||(L[85]=T("div",{class:"gravity-curve-title"},[T("span",null,"生命周期内风力"),T("span",null,"纵轴:强度 0~1")],-1)),we(tn,{modelValue:I(t).config.windCurve,"onUpdate:modelValue":L[22]||(L[22]=B=>I(t).config.windCurve=B),"default-value":I(U)},null,8,["modelValue","default-value"]),L[86]||(L[86]=T("div",{class:"gravity-curve-axis"},[T("span",null,"0"),T("span",null,"生命周期 →"),T("span",null,"1")],-1)),L[87]||(L[87]=T("div",{class:"modifier-hint"},"0° 向右 · -90° 向下 · 负强度会反转方向",-1))])):xe("",!0)]),T("div",H8,[T("label",W8,[ce(T("input",{type:"checkbox","onUpdate:modelValue":L[23]||(L[23]=B=>I(t).config.forceField=B)},null,512),[[wt,I(t).config.forceField]]),L[88]||(L[88]=T("span",{class:"switch-ui"},null,-1)),L[89]||(L[89]=T("span",null,"开启力场",-1))]),I(t).config.forceField?(K(),J("div",z8,[we(Oe,{label:"中心 X",min:-5e3,max:5e3,step:1,modelValue:I(t).config.forceCenterX,"onUpdate:modelValue":L[24]||(L[24]=B=>I(t).config.forceCenterX=B)},null,8,["modelValue"]),we(Oe,{label:"中心 Y",min:-5e3,max:5e3,step:1,modelValue:I(t).config.forceCenterY,"onUpdate:modelValue":L[25]||(L[25]=B=>I(t).config.forceCenterY=B)},null,8,["modelValue"]),we(Oe,{label:"力场强度",min:-300,max:300,step:1,modelValue:I(t).config.forceStrength,"onUpdate:modelValue":L[26]||(L[26]=B=>I(t).config.forceStrength=B)},null,8,["modelValue"]),we(Oe,{label:"力场半径",min:1,max:2e3,step:1,modelValue:I(t).config.forceRadius,"onUpdate:modelValue":L[27]||(L[27]=B=>I(t).config.forceRadius=B)},null,8,["modelValue"]),T("label",q8,[L[91]||(L[91]=T("span",null,"衰减模式",-1)),ce(T("select",{"onUpdate:modelValue":L[28]||(L[28]=B=>I(t).config.forceFalloff=B),class:"inp"},[...L[90]||(L[90]=[T("option",{value:"constant"},"恒定(范围内力度不变)",-1),T("option",{value:"linear"},"线性衰减(边缘为 0)",-1),T("option",{value:"inverse"},"距离反比(中心最强)",-1)])],512),[[bt,I(t).config.forceFalloff]])]),L[94]||(L[94]=T("div",{class:"modifier-hint"},"正数吸向中心 · 负数向外排斥 · 可在画布内拖动力场圆",-1)),T("label",K8,[ce(T("input",{type:"checkbox","onUpdate:modelValue":L[29]||(L[29]=B=>I(t).config.showForceFieldShape=B)},null,512),[[wt,I(t).config.showForceFieldShape]]),L[92]||(L[92]=T("span",{class:"switch-ui"},null,-1)),L[93]||(L[93]=T("span",null,"显示形状",-1))])])):xe("",!0)]),T("div",Z8,[T("label",J8,[ce(T("input",{type:"checkbox","onUpdate:modelValue":L[30]||(L[30]=B=>I(t).config.vortex=B)},null,512),[[wt,I(t).config.vortex]]),L[95]||(L[95]=T("span",{class:"switch-ui"},null,-1)),L[96]||(L[96]=T("span",null,"开启漩涡",-1))]),I(t).config.vortex?(K(),J("div",Q8,[we(Oe,{label:"中心 X",min:-5e3,max:5e3,step:1,modelValue:I(t).config.vortexCenterX,"onUpdate:modelValue":L[31]||(L[31]=B=>I(t).config.vortexCenterX=B)},null,8,["modelValue"]),we(Oe,{label:"中心 Y",min:-5e3,max:5e3,step:1,modelValue:I(t).config.vortexCenterY,"onUpdate:modelValue":L[32]||(L[32]=B=>I(t).config.vortexCenterY=B)},null,8,["modelValue"]),we(Oe,{label:"力场强度",min:-300,max:300,step:1,modelValue:I(t).config.vortexStrength,"onUpdate:modelValue":L[33]||(L[33]=B=>I(t).config.vortexStrength=B)},null,8,["modelValue"]),we(Oe,{label:"力场半径",min:1,max:2e3,step:1,modelValue:I(t).config.vortexRadius,"onUpdate:modelValue":L[34]||(L[34]=B=>I(t).config.vortexRadius=B)},null,8,["modelValue"]),T("label",eU,[L[98]||(L[98]=T("span",null,"衰减模式",-1)),ce(T("select",{"onUpdate:modelValue":L[35]||(L[35]=B=>I(t).config.vortexFalloff=B),class:"inp"},[...L[97]||(L[97]=[T("option",{value:"constant"},"恒定(范围内力度不变)",-1),T("option",{value:"linear"},"线性衰减(边缘为 0)",-1),T("option",{value:"inverse"},"距离反比(中心最强)",-1)])],512),[[bt,I(t).config.vortexFalloff]])]),L[101]||(L[101]=T("div",{class:"modifier-hint"},"正数逆时针 · 负数顺时针",-1)),T("label",tU,[ce(T("input",{type:"checkbox","onUpdate:modelValue":L[36]||(L[36]=B=>I(t).config.showVortexShape=B)},null,512),[[wt,I(t).config.showVortexShape]]),L[99]||(L[99]=T("span",{class:"switch-ui"},null,-1)),L[100]||(L[100]=T("span",null,"显示形状",-1))])])):xe("",!0)]),T("div",iU,[T("label",sU,[ce(T("input",{type:"checkbox","onUpdate:modelValue":L[37]||(L[37]=B=>I(t).config.attraction=B)},null,512),[[wt,I(t).config.attraction]]),L[102]||(L[102]=T("span",{class:"switch-ui"},null,-1)),L[103]||(L[103]=T("span",null,"开启吸附",-1))]),I(t).config.attraction?(K(),J("div",nU,[we(Oe,{label:"吸附点 X",min:-5e3,max:5e3,step:1,modelValue:I(t).config.attractionCenterX,"onUpdate:modelValue":L[38]||(L[38]=B=>I(t).config.attractionCenterX=B)},null,8,["modelValue"]),we(Oe,{label:"吸附点 Y",min:-5e3,max:5e3,step:1,modelValue:I(t).config.attractionCenterY,"onUpdate:modelValue":L[39]||(L[39]=B=>I(t).config.attractionCenterY=B)},null,8,["modelValue"]),we(Oe,{label:"吸附半径",min:0,max:2e3,step:1,modelValue:I(t).config.attractionRadius,"onUpdate:modelValue":L[40]||(L[40]=B=>I(t).config.attractionRadius=B)},null,8,["modelValue"]),we(Oe,{label:"吸附时长",min:.05,max:30,step:.05,modelValue:I(t).config.attractionDuration,"onUpdate:modelValue":L[41]||(L[41]=B=>I(t).config.attractionDuration=B)},null,8,["modelValue"]),we(Oe,{label:"延迟时间",min:0,max:30,step:.05,modelValue:I(t).config.attractionDelay,"onUpdate:modelValue":L[42]||(L[42]=B=>I(t).config.attractionDelay=B)},null,8,["modelValue"]),T("label",rU,[L[105]||(L[105]=T("span",null,"延迟方式",-1)),ce(T("select",{"onUpdate:modelValue":L[43]||(L[43]=B=>I(t).config.attractionDelayMode=B),class:"inp"},[...L[104]||(L[104]=[T("option",{value:"global"},"统一时间",-1),T("option",{value:"particle"},"单粒子生命",-1)])],512),[[bt,I(t).config.attractionDelayMode]])]),T("label",oU,[L[107]||(L[107]=T("span",null,"吸附方式",-1)),ce(T("select",{"onUpdate:modelValue":L[44]||(L[44]=B=>I(t).config.attractionPath=B),class:"inp"},[...L[106]||(L[106]=[T("option",{value:"linear"},"直线",-1),T("option",{value:"curve"},"曲线",-1)])],512),[[bt,I(t).config.attractionPath]])]),L[110]||(L[110]=T("div",{class:"modifier-hint"},"延迟后从当前位置开始吸附 · 到达红色范围即死亡 · 可在画布内拖动吸附圆",-1)),T("label",aU,[ce(T("input",{type:"checkbox","onUpdate:modelValue":L[45]||(L[45]=B=>I(t).config.showAttractionShape=B)},null,512),[[wt,I(t).config.showAttractionShape]]),L[108]||(L[108]=T("span",{class:"switch-ui"},null,-1)),L[109]||(L[109]=T("span",null,"显示形状",-1))])])):xe("",!0)]),T("div",lU,[T("label",cU,[ce(T("input",{type:"checkbox","onUpdate:modelValue":L[46]||(L[46]=B=>I(t).config.trail=B)},null,512),[[wt,I(t).config.trail]]),L[111]||(L[111]=T("span",{class:"switch-ui"},null,-1)),L[112]||(L[112]=T("span",null,"开启拖尾",-1))]),I(t).config.trail?(K(),J("div",hU,[T("div",uU,[L[113]||(L[113]=T("div",{class:"trail-section-title"},"拖尾独立图片",-1)),T("button",{class:"image-add",title:"增加拖尾图片资源",onClick:L[47]||(L[47]=(...B)=>I(n)&&I(n)(...B))},"+")]),(K(!0),J(_e,null,Et(I(t).config.trailResources,B=>(K(),Ct(KS,{key:B.id,resource:B,"resource-count":I(t).config.trailResources.length,"default-file":"trail.png","name-placeholder":"trail","show-folder":!1,onPick:I(r),onReset:I(h),onRemove:I(u),onUpdateWeight:I(d),onToggleLock:I(f)},{default:Zh(()=>[L[129]||(L[129]=T("div",{class:"resource-divider"},null,-1)),we(Oe,{label:"旋转",min:-360,max:360,step:1,"model-value":B.rotation,"onUpdate:modelValue":j=>I(l)(B.id,j)},null,8,["model-value","onUpdate:modelValue"]),we(Oe,{label:"拖尾骨骼数",min:2,max:16,step:1,"model-value":B.boneCount,"onUpdate:modelValue":j=>I(a)(B.id,j)},null,8,["model-value","onUpdate:modelValue"]),we(Oe,{label:"拖尾比例 (%)",min:0,max:100,step:1,modelValue:B.trailRatio,"onUpdate:modelValue":j=>B.trailRatio=j},null,8,["modelValue","onUpdate:modelValue"]),T("label",dU,[L[115]||(L[115]=T("span",null,"拖尾长度",-1)),ce(T("select",{"onUpdate:modelValue":j=>B.lengthMode=j,class:"inp"},[...L[114]||(L[114]=[T("option",{value:"fixed"},"固定",-1),T("option",{value:"random"},"随机范围",-1)])],8,fU),[[bt,B.lengthMode]])]),B.lengthMode==="fixed"?(K(),Ct(Oe,{key:0,label:"长度比例 (%)",min:0,max:500,step:1,modelValue:B.length,"onUpdate:modelValue":j=>B.length=j},null,8,["modelValue","onUpdate:modelValue"])):(K(),J(_e,{key:1},[we(Oe,{label:"长度最小 (%)",min:0,max:500,step:1,modelValue:B.lengthMin,"onUpdate:modelValue":j=>B.lengthMin=j},null,8,["modelValue","onUpdate:modelValue"]),we(Oe,{label:"长度最大 (%)",min:0,max:500,step:1,modelValue:B.lengthMax,"onUpdate:modelValue":j=>B.lengthMax=j},null,8,["modelValue","onUpdate:modelValue"])],64)),T("label",mU,[L[117]||(L[117]=T("span",null,"拖尾宽度",-1)),ce(T("select",{"onUpdate:modelValue":j=>B.widthSizeMode=j,class:"inp"},[...L[116]||(L[116]=[T("option",{value:"fixed"},"固定",-1),T("option",{value:"random"},"随机范围",-1)])],8,pU),[[bt,B.widthSizeMode]])]),B.widthSizeMode==="fixed"?(K(),Ct(Oe,{key:2,label:"宽度比例 (%)",min:0,max:500,step:1,modelValue:B.width,"onUpdate:modelValue":j=>B.width=j},null,8,["modelValue","onUpdate:modelValue"])):(K(),J(_e,{key:3},[we(Oe,{label:"宽度最小 (%)",min:0,max:500,step:1,modelValue:B.widthMin,"onUpdate:modelValue":j=>B.widthMin=j},null,8,["modelValue","onUpdate:modelValue"]),we(Oe,{label:"宽度最大 (%)",min:0,max:500,step:1,modelValue:B.widthMax,"onUpdate:modelValue":j=>B.widthMax=j},null,8,["modelValue","onUpdate:modelValue"])],64)),T("label",gU,[L[119]||(L[119]=T("span",null,"宽度缩放",-1)),ce(T("select",{"onUpdate:modelValue":j=>B.widthMode=j,class:"inp"},[...L[118]||(L[118]=[T("option",{value:"particle"},"跟随粒子",-1),T("option",{value:"fixed"},"固定",-1)])],8,vU),[[bt,B.widthMode]])]),T("label",yU,[ce(T("input",{type:"checkbox","onUpdate:modelValue":j=>B.lifeLengthEnabled=j},null,8,xU),[[wt,B.lifeLengthEnabled]]),L[120]||(L[120]=T("span",{class:"switch-ui"},null,-1)),L[121]||(L[121]=T("span",null,"生命周期长度曲线",-1))]),B.lifeLengthEnabled?(K(),Ct(tn,{key:4,modelValue:B.lifeLengthCurve,"onUpdate:modelValue":j=>B.lifeLengthCurve=j,"default-value":I(U)},null,8,["modelValue","onUpdate:modelValue","default-value"])):xe("",!0),T("label",bU,[ce(T("input",{type:"checkbox","onUpdate:modelValue":j=>B.shapeEnabled=j},null,8,wU),[[wt,B.shapeEnabled]]),L[122]||(L[122]=T("span",{class:"switch-ui"},null,-1)),L[123]||(L[123]=T("span",null,"形状曲线(首端 → 尾端宽度)",-1))]),B.shapeEnabled?(K(),Ct(tn,{key:5,modelValue:B.shapeCurve,"onUpdate:modelValue":j=>B.shapeCurve=j,"default-value":I($)},null,8,["modelValue","onUpdate:modelValue","default-value"])):xe("",!0),T("div",SU,[L[124]||(L[124]=T("span",null,"颜色模式",-1)),T("div",MU,[T("button",{class:Ce(["axis-mode",{on:B.colorMode==="particle"}]),onClick:j=>B.colorMode="particle"},"跟随粒子",10,TU),T("button",{class:Ce(["axis-mode",{on:B.colorMode==="fixed"}]),onClick:j=>B.colorMode="fixed"},"固定",10,_U),T("button",{class:Ce(["axis-mode",{on:B.colorMode==="curve"}]),onClick:j=>B.colorMode="curve"},"曲线",10,CU)])]),T("label",EU,[L[126]||(L[126]=T("span",null,"混合模式",-1)),ce(T("select",{"onUpdate:modelValue":j=>B.blend=j,class:"inp"},[...L[125]||(L[125]=[T("option",{value:"normal"},"正常",-1),T("option",{value:"add"},"相加",-1),T("option",{value:"multiply"},"相乘",-1),T("option",{value:"screen"},"滤色",-1)])],8,AU),[[bt,B.blend]])]),B.colorMode==="fixed"?(K(),J("label",IU,[L[127]||(L[127]=T("span",null,"固定颜色",-1)),ce(T("input",{class:"colr",type:"color","onUpdate:modelValue":j=>B.color=j},null,8,RU),[[He,B.color]]),T("input",{class:"hex-input",value:B.color,onChange:j=>I(m)(B,j),onKeydown:Mr(qe(j=>I(p)(B,j),["prevent"]),["enter"])},null,40,PU)])):B.colorMode==="curve"?(K(),Ct(qS,{key:7,modelValue:B.colorGradient,"onUpdate:modelValue":j=>B.colorGradient=j},null,8,["modelValue","onUpdate:modelValue"])):xe("",!0),T("div",kU,[L[128]||(L[128]=T("span",null,"透明度模式",-1)),T("div",FU,[T("button",{class:Ce(["axis-mode",{on:B.alphaMode==="particle"}]),onClick:j=>B.alphaMode="particle"},"跟随粒子",10,OU),T("button",{class:Ce(["axis-mode",{on:B.alphaMode==="fixed"}]),onClick:j=>B.alphaMode="fixed"},"固定",10,LU),T("button",{class:Ce(["axis-mode",{on:B.alphaMode==="curve"}]),onClick:j=>B.alphaMode="curve"},"曲线",10,BU)])]),B.alphaMode==="fixed"?(K(),Ct(Oe,{key:8,label:"透明度",min:0,max:1,step:.01,modelValue:B.alpha,"onUpdate:modelValue":j=>B.alpha=j},null,8,["modelValue","onUpdate:modelValue"])):xe("",!0),B.alphaMode==="curve"?(K(),Ct(tn,{key:9,modelValue:B.alphaCurve,"onUpdate:modelValue":j=>B.alphaCurve=j,"default-value":I(G)},null,8,["modelValue","onUpdate:modelValue","default-value"])):xe("",!0)]),_:2},1032,["resource","resource-count","onPick","onReset","onRemove","onUpdateWeight","onToggleLock"]))),128)),T("input",{ref_key:"trailTextureFileInput",ref:i,class:"file-input",type:"file",accept:"image/png,image/jpeg,image/webp",onChange:L[48]||(L[48]=(...B)=>I(c)&&I(c)(...B))},null,544),T("div",NU,[we(Oe,{label:"网格行数",min:2,max:16,step:1,"model-value":I(t).config.trailGridRows,"onUpdate:modelValue":L[49]||(L[49]=B=>I(o)("trailGridRows",B))},null,8,["model-value"]),we(Oe,{label:"网格列数",min:2,max:32,step:1,"model-value":I(t).config.trailGridCols,"onUpdate:modelValue":L[50]||(L[50]=B=>I(o)("trailGridCols",B))},null,8,["model-value"])]),L[130]||(L[130]=T("div",{class:"modifier-hint"},"每个粒子按资源比例生成一组同级拖尾骨骼;随机长度与宽度在粒子出生时确定,相同种子可稳定复现",-1))])):xe("",!0)]),T("div",DU,[T("label",UU,[ce(T("input",{type:"checkbox","onUpdate:modelValue":L[51]||(L[51]=B=>I(t).config.emitterFollow=B),disabled:I(t).config.streamBehavior==="loop"},null,8,$U),[[wt,I(t).config.emitterFollow]]),L[131]||(L[131]=T("span",{class:"switch-ui"},null,-1)),L[132]||(L[132]=T("span",null,"开启发射器跟随",-1))]),I(t).config.emitterFollow&&I(t).config.streamBehavior!=="loop"?(K(),J("div",XU,[T("label",VU,[L[135]||(L[135]=T("span",null,"跟随模式",-1)),T("select",{value:I(t).config.emitterFollowMode,class:"inp",onChange:L[52]||(L[52]=B=>I(A)(B,I(t).config))},[L[133]||(L[133]=T("option",{value:"none"},"无",-1)),L[134]||(L[134]=T("option",{value:"path"},"跟随路径",-1)),I(g)||I(t).config.emitterFollowMode==="bone"?(K(),J("option",GU,"选中的骨骼")):xe("",!0)],40,YU)]),I(t).config.emitterFollowMode==="path"?(K(),J(_e,{key:0},[T("label",jU,[L[137]||(L[137]=T("span",null,"跟随路径",-1)),ce(T("select",{"onUpdate:modelValue":L[53]||(L[53]=B=>I(t).config.emitterFollowPathId=B),class:"inp"},[L[136]||(L[136]=T("option",{value:0},"无",-1)),(K(!0),J(_e,null,Et(I(e).paths,B=>(K(),J("option",{key:B.id,value:B.id},ve(B.name),9,HU))),128))],512),[[bt,I(t).config.emitterFollowPathId,void 0,{number:!0}]])]),T("label",WU,[L[139]||(L[139]=T("span",null,"发射器角度模式",-1)),ce(T("select",{"onUpdate:modelValue":L[54]||(L[54]=B=>I(t).config.emitterAngleMode=B),class:"inp"},[...L[138]||(L[138]=[T("option",{value:"fixed"},"固定角度",-1),T("option",{value:"direction"},"跟随移动方向",-1)])],512),[[bt,I(t).config.emitterAngleMode]])]),L[145]||(L[145]=T("div",{class:"gravity-curve-title"},[T("span",null,"移动进度曲线 (0→1)")],-1)),we(tn,{modelValue:I(t).config.emitterFollowCurve,"onUpdate:modelValue":L[55]||(L[55]=B=>I(t).config.emitterFollowCurve=B),"default-value":I(O)},null,8,["modelValue","default-value"]),T("div",zU,[T("label",qU,[L[140]||(L[140]=T("span",null,"移动时长 (s)",-1)),ce(T("input",{"onUpdate:modelValue":L[56]||(L[56]=B=>I(t).config.emitterFollowDuration=B),type:"number",min:"0.05",step:"0.05",class:"inp"},null,512),[[He,I(t).config.emitterFollowDuration,void 0,{number:!0}]])]),T("label",KU,[L[142]||(L[142]=T("span",null,"跟随空间",-1)),ce(T("select",{"onUpdate:modelValue":L[57]||(L[57]=B=>I(t).config.emitterFollowSpace=B),class:"inp"},[...L[141]||(L[141]=[T("option",{value:"local"},"局部空间(GEN 移动)",-1),T("option",{value:"world"},"世界空间(粒子生成点移动)",-1)])],512),[[bt,I(t).config.emitterFollowSpace]])])]),T("label",ZU,[L[144]||(L[144]=T("span",null,"移动方向",-1)),ce(T("select",{"onUpdate:modelValue":L[58]||(L[58]=B=>I(t).config.emitterFollowDirection=B),class:"inp"},[...L[143]||(L[143]=[T("option",{value:"forward"},"正向(起点 → 终点)",-1),T("option",{value:"reverse"},"反向(终点 → 起点)",-1)])],512),[[bt,I(t).config.emitterFollowDirection]])]),we(Oe,{label:"偏移起始点 (0-1)",min:0,max:1,step:.01,modelValue:I(t).config.emitterFollowOffset,"onUpdate:modelValue":L[59]||(L[59]=B=>I(t).config.emitterFollowOffset=B)},null,8,["modelValue"]),L[146]||(L[146]=T("div",{class:"modifier-hint"},"局部空间会移动整个发射器;世界空间只移动新粒子的生成点,已出生粒子留在世界位置。",-1))],64)):I(t).config.emitterFollowMode==="bone"?(K(),J(_e,{key:1},[I(x)?(K(),J("div",JU,[L[147]||(L[147]=ft("跟随目标:",-1)),T("strong",null,ve(I(x).spine.name)+" / "+ve(I(x).boneName),1)])):(K(),J("div",QU,"尚未绑定有效骨骼,请先在 Spine 层级树中选择骨骼。")),I(g)&&(!I(x)||I(g).spine.id!==I(x).spine.id||I(g).boneName!==I(x).boneName)?(K(),J("button",{key:2,class:"bone-follow-rebind",onClick:L[60]||(L[60]=B=>I(P)(I(t).config))},ve(I(x)?"重新绑定":"绑定")+"当前选中骨骼:"+ve(I(g).spine.name)+" / "+ve(I(g).boneName),1)):xe("",!0),I(x)?(K(),J(_e,{key:3},[T("label",e$,[L[149]||(L[149]=T("span",null,"跟随空间",-1)),ce(T("select",{"onUpdate:modelValue":L[61]||(L[61]=B=>I(t).config.emitterFollowSpace=B),class:"inp"},[...L[148]||(L[148]=[T("option",{value:"local"},"本地空间(随骨骼移动)",-1),T("option",{value:"world"},"世界空间(粒子生成后保持位置)",-1)])],512),[[bt,I(t).config.emitterFollowSpace]])]),T("div",t$,[T("label",i$,[L[150]||(L[150]=T("span",null,"位移偏移 X",-1)),ce(T("input",{"onUpdate:modelValue":L[62]||(L[62]=B=>I(t).config.emitterFollowBoneOffsetX=B),type:"number",step:"1",class:"inp"},null,512),[[He,I(t).config.emitterFollowBoneOffsetX,void 0,{number:!0}]])]),T("label",s$,[L[151]||(L[151]=T("span",null,"位移偏移 Y",-1)),ce(T("input",{"onUpdate:modelValue":L[63]||(L[63]=B=>I(t).config.emitterFollowBoneOffsetY=B),type:"number",step:"1",class:"inp"},null,512),[[He,I(t).config.emitterFollowBoneOffsetY,void 0,{number:!0}]])])]),T("div",n$,[T("label",r$,[L[152]||(L[152]=T("span",null,"旋转偏移",-1)),ce(T("input",{"onUpdate:modelValue":L[64]||(L[64]=B=>I(t).config.emitterFollowBoneRotation=B),type:"number",step:"1",class:"inp"},null,512),[[He,I(t).config.emitterFollowBoneRotation,void 0,{number:!0}]])]),T("label",o$,[L[153]||(L[153]=T("span",null,"缩放偏移 X",-1)),ce(T("input",{"onUpdate:modelValue":L[65]||(L[65]=B=>I(t).config.emitterFollowBoneScaleX=B),type:"number",step:"0.05",class:"inp"},null,512),[[He,I(t).config.emitterFollowBoneScaleX,void 0,{number:!0}]])]),T("label",a$,[L[154]||(L[154]=T("span",null,"缩放偏移 Y",-1)),ce(T("input",{"onUpdate:modelValue":L[66]||(L[66]=B=>I(t).config.emitterFollowBoneScaleY=B),type:"number",step:"0.05",class:"inp"},null,512),[[He,I(t).config.emitterFollowBoneScaleY,void 0,{number:!0}]])])]),L[155]||(L[155]=T("div",{class:"modifier-hint"},"发射器只跟随所选 Spine 骨骼的位置,不继承 Spine 的旋转或缩放;粒子变换使用粒子系统自身参数和上方偏移。",-1))],64)):xe("",!0)],64)):xe("",!0)])):xe("",!0)]),T("div",l$,[T("label",c$,[ce(T("input",{type:"checkbox","onUpdate:modelValue":L[67]||(L[67]=B=>I(t).config.collision=B)},null,512),[[wt,I(t).config.collision]]),L[156]||(L[156]=T("span",{class:"switch-ui"},null,-1)),L[157]||(L[157]=T("span",null,"开启碰撞",-1))]),I(t).config.collision?(K(),J("div",h$,[L[158]||(L[158]=T("div",{class:"collision-filter-title"},"参与的碰撞对象",-1)),T("div",u$,[(K(!0),J(_e,null,Et(I(y),B=>(K(),J("span",{key:B.id,class:Ce(["collision-filter-tag",{disabled:!B.enabled}]),title:B.enabled?B.name:`${B.name}(碰撞体已禁用)`},[T("span",null,ve(B.name),1),T("button",{type:"button","aria-label":`清除碰撞对象 ${B.name}`,onClick:j=>I(S)(B.id)},"×",8,f$)],10,d$))),128)),T("button",{type:"button",class:Ce(["collision-filter-add",{active:I(v)}]),disabled:I(w).length===0,title:I(w).length?"加入场景碰撞对象":"没有可加入的碰撞对象",onClick:L[68]||(L[68]=B=>v.value=!I(v))},"+",10,m$)]),I(y).length===0?(K(),J("div",p$,"未选择碰撞对象,当前粒子不会发生碰撞")):xe("",!0),I(v)&&I(w).length?(K(),J("div",g$,[(K(!0),J(_e,null,Et(I(w),B=>(K(),J("button",{key:B.id,type:"button",onClick:j=>I(_)(B.id)},[T("span",null,ve(B.name),1),T("small",null,ve(B.enabled?"可用":"已禁用"),1)],8,v$))),128))])):xe("",!0),L[159]||(L[159]=T("div",{class:"modifier-hint"},"只有已加入且启用的场景碰撞对象会参与当前粒子系统的碰撞",-1))])):xe("",!0)]),T("div",y$,[T("label",x$,[ce(T("input",{"onUpdate:modelValue":L[69]||(L[69]=B=>I(t).config.eventEnabled=B),type:"checkbox"},null,512),[[wt,I(t).config.eventEnabled]]),L[160]||(L[160]=T("span",{class:"switch-ui"},null,-1)),L[161]||(L[161]=T("span",null,"开启子发射器",-1))]),I(t).config.eventEnabled?(K(),J("div",b$,[(K(!0),J(_e,null,Et(I(t).config.events,(B,j)=>(K(),J("div",{key:B.id,class:"event-card"},[T("div",w$,[ce(T("select",{"onUpdate:modelValue":ie=>B.event=ie,class:"inp event-select",title:"选择触发时机"},[...L[162]||(L[162]=[T("option",{value:"birth"},"出生",-1),T("option",{value:"death"},"死亡",-1),T("option",{value:"collision"},"碰撞",-1)])],8,S$),[[bt,B.event]]),ce(T("select",{"onUpdate:modelValue":ie=>B.targetSystemId=ie,class:"inp event-target",title:"选择目标粒子系统"},[L[163]||(L[163]=T("option",{value:0},"无(粒子系统)",-1)),(K(!0),J(_e,null,Et(X.value,ie=>(K(),J("option",{key:ie.id,value:ie.id},ve(ie.config.name||`ParticleSystem${ie.id}`),9,T$))),128))],8,M$),[[bt,B.targetSystemId,void 0,{number:!0}]]),T("button",{type:"button",class:"event-remove",title:"删除该子发射器",onClick:ie=>H(j)},"✕",8,_$)]),T("label",C$,[L[164]||(L[164]=T("span",null,"发射概率",-1)),ce(T("input",{"onUpdate:modelValue":ie=>B.probability=ie,type:"number",min:"0",max:"1",step:"0.01",class:"inp"},null,8,E$),[[He,B.probability,void 0,{number:!0}]])]),B.event==="collision"?(K(),J("label",A$,[L[165]||(L[165]=T("span",null,"碰撞次数限制",-1)),T("input",{value:B.collisionLimit??1,type:"number",min:"1",max:"4",step:"1",class:"inp",onInput:ie=>W(B,ie)},null,40,I$)])):xe("",!0),T("div",R$,[L[167]||(L[167]=T("span",null,"继承",-1)),T("button",{type:"button",class:"inherit-trigger",onPointerdown:L[70]||(L[70]=qe(()=>{},["stop"])),onClick:qe(ie=>oe(B,ie),["stop"])},[T("span",k$,ve(V(B)),1),L[166]||(L[166]=T("i",null,"⌄",-1))],40,P$)]),Y(B,"color")?(K(),J("label",F$,[L[169]||(L[169]=T("span",null,"颜色继承方式",-1)),ce(T("select",{"onUpdate:modelValue":ie=>B.colorInheritMode=ie,class:"inp"},[...L[168]||(L[168]=[T("option",{value:"add"},"相加",-1),T("option",{value:"replace"},"覆盖",-1)])],8,O$),[[bt,B.colorInheritMode]])])):xe("",!0)]))),128)),T("button",{type:"button",class:"event-add",onClick:fe},"+ 新增子发射器")])):xe("",!0)])],512),[[Si,!I(b).mods]])]),(K(),Ct(dx,{to:"body"},[k.value&&N.value?(K(),J("div",{key:0,class:"inherit-menu",style:Ot({left:`${k.value.left}px`,top:`${k.value.top}px`,width:`${k.value.width}px`}),onPointerdown:L[73]||(L[73]=qe(()=>{},["stop"]))},[T("button",{type:"button",class:"inherit-option",onClick:L[71]||(L[71]=B=>z(N.value))},[T("span",L$,ve(F(N.value).length===0?"✓":""),1),L[170]||(L[170]=ft("无(默认值) ",-1))]),T("button",{type:"button",class:"inherit-option",onClick:L[72]||(L[72]=B=>se(N.value))},[T("span",B$,ve(F(N.value).length===4?"✓":""),1),L[171]||(L[171]=ft("所有属性 ",-1))]),L[172]||(L[172]=T("div",{class:"inherit-divider"},null,-1)),(K(),J(_e,null,Et(D,B=>T("button",{key:B.key,type:"button",class:"inherit-option",onClick:j=>q(N.value,B.key)},[T("span",D$,ve(Y(N.value,B.key)?"✓":""),1),ft(ve(B.label),1)],8,N$)),64))],36)):xe("",!0)]))],64))}}),$$=Jt(U$,[["__scopeId","data-v-affb8652"]]),X$={class:"group"},V$={class:"caret"},Y$={class:"group-body export-settings"},G$={class:"export-field"},j$={class:"export-field"},H$={class:"export-field"},W$={key:0,class:"export-help"},z$={class:"export-fps-row"},q$={class:"export-field export-fps-field"},K$={class:"export-checkbox"},Z$={class:"export-switches"},J$={class:"switch-row export-switch"},Q$={class:"switch-row export-switch"},e6={class:"switch-row export-switch export-switch-last"},t6=Zt({__name:"ExportSettingsSection",setup(s){const{exportSettings:e,collapsed:t,toggle:i,resetModule:n,normalizeExportFps:r,select:o}=Fr();return(a,l)=>(K(),J("div",X$,[T("div",{class:"group-head",onClick:l[1]||(l[1]=c=>I(i)("export"))},[T("span",V$,ve(I(t).export?"▸":"▾"),1),l[11]||(l[11]=T("span",null,"导出设置",-1)),T("button",{class:"group-reset",title:"重置导出设置",onClick:l[0]||(l[0]=qe(c=>I(n)("export"),["stop"]))},"重置")]),ce(T("div",Y$,[T("label",G$,[l[12]||(l[12]=T("span",null,"图片路径 (Spine Images Path)",-1)),ce(T("input",{"onUpdate:modelValue":l[2]||(l[2]=c=>I(e).imagesPath=c),class:"inp export-input",type:"text",placeholder:"./images/"},null,512),[[He,I(e).imagesPath,void 0,{trim:!0}]])]),T("label",j$,[l[14]||(l[14]=T("span",null,"Spine 版本",-1)),ce(T("select",{"onUpdate:modelValue":l[3]||(l[3]=c=>I(e).spineVersion=c),class:"inp export-input"},[...l[13]||(l[13]=[is('',5)])],512),[[bt,I(e).spineVersion]])]),T("label",H$,[l[16]||(l[16]=T("span",null,"关键帧插值曲线",-1)),ce(T("select",{"onUpdate:modelValue":l[4]||(l[4]=c=>I(e).keyframeCurve=c),class:"inp export-input"},[...l[15]||(l[15]=[T("option",{value:"linear"},"线性 (Linear)",-1),T("option",{value:"bezier"},"平滑贝塞尔 (Smooth Bézier)",-1)])],512),[[bt,I(e).keyframeCurve]])]),l[25]||(l[25]=T("div",{class:"export-help"},"平滑贝塞尔会在误差允许范围内拟合连续运动;出生、死亡、附件切换和突变仍使用阶跃关键帧。",-1)),I(e).spineVersion==="3.8"?(K(),J("div",W$,"Spine 3.8 不支持 4.x 的逐通道数组贝塞尔,导出时会转换为经过容差精简的分段线性关键帧。")):xe("",!0),T("div",z$,[T("label",q$,[l[17]||(l[17]=T("span",null,"导出 FPS",-1)),ce(T("input",{"onUpdate:modelValue":l[5]||(l[5]=c=>I(e).fps=c),class:"inp export-input",type:"number",min:"1",max:"240",step:"1",onChange:l[6]||(l[6]=(...c)=>I(r)&&I(r)(...c))},null,544),[[He,I(e).fps,void 0,{number:!0}]])]),T("label",K$,[ce(T("input",{"onUpdate:modelValue":l[7]||(l[7]=c=>I(e).omitFps=c),type:"checkbox"},null,512),[[wt,I(e).omitFps]]),l[18]||(l[18]=ft("不写 fps",-1))])]),l[26]||(l[26]=T("div",{class:"export-help"},"修改 FPS 时保持动画实际秒数不变;“不写 fps”只省略 Spine 的 fps 元数据。",-1)),T("div",Z$,[T("label",J$,[ce(T("input",{"onUpdate:modelValue":l[8]||(l[8]=c=>I(e).integerFrameAlignment=c),type:"checkbox"},null,512),[[wt,I(e).integerFrameAlignment]]),l[19]||(l[19]=T("span",{class:"switch-ui"},null,-1)),l[20]||(l[20]=T("span",null,"整数帧对齐",-1))]),T("label",Q$,[ce(T("input",{"onUpdate:modelValue":l[9]||(l[9]=c=>I(e).bonePool=c),type:"checkbox"},null,512),[[wt,I(e).bonePool]]),l[21]||(l[21]=T("span",{class:"switch-ui"},null,-1)),l[22]||(l[22]=T("span",null,"骨骼对象池",-1))]),T("label",e6,[ce(T("input",{"onUpdate:modelValue":l[10]||(l[10]=c=>I(e).excludeEmptyAnimations=c),type:"checkbox"},null,512),[[wt,I(e).excludeEmptyAnimations]]),l[23]||(l[23]=T("span",{class:"switch-ui"},null,-1)),l[24]||(l[24]=T("span",null,"排除无内容动画",-1))])])],512),[[Si,!I(t).export]])]))}}),i6=Jt(t6,[["__scopeId","data-v-04462c7a"]]),s6={class:"spine-export-actions"},n6=["disabled","title"],r6=["disabled"],o6=["disabled","title"],a6={key:0},l6=["href"],c6=["href"],h6=Zt({__name:"ParticleExportFooter",setup(s){const{exportSettings:e,exportBusy:t,exportTarget:i,exportMessage:n,exportError:r,connectorPairUrl:o,connectorStatusText:a,connectorStatusClass:l,connectorReady:c,connectorAuthorizationUrl:h,connectorDisabledReason:u,connectorButtonTitle:d,refreshConnectorHealth:f,exportSpineJson:m,exportSpineProject:p,exportSpineImages:g}=Fr();return(x,v)=>(K(),J(_e,null,[T("div",s6,[T("button",{type:"button",class:"export-spine-json",disabled:I(t),title:I(t)?"正在重新计算并烘焙动画":`导出 Spine ${I(e).spineVersion} JSON`,onClick:v[0]||(v[0]=(...y)=>I(m)&&I(m)(...y))},ve(I(t)&&I(i)==="json"?"正在准备导出…":"导出Spine Json"),9,n6),T("button",{type:"button",class:"export-spine-images",disabled:I(t),title:"单独下载当前粒子系统使用的图片 ZIP",onClick:v[1]||(v[1]=(...y)=>I(g)&&I(g)(...y))},ve(I(t)&&I(i)==="images"?"正在整理图片…":"导出 images 包"),9,r6),T("button",{type:"button",class:"export-spine-project",disabled:I(t)||!I(c),title:I(d),onClick:v[2]||(v[2]=(...y)=>I(p)&&I(p)(...y))},[T("span",null,ve(I(t)&&I(i)==="spine"?"正在生成工程…":"导出 .spine 包"),1),!I(t)&&I(u)?(K(),J("small",a6,ve(I(u)),1)):xe("",!0)],8,o6)]),T("div",{class:Ce(["connector-status",I(l)])},[v[5]||(v[5]=T("span",{class:"connector-dot"},null,-1)),ft(ve(I(a))+" ",1),I(h)?(K(),J("a",{key:0,href:I(h),target:"_blank",rel:"noopener",title:"在本机连接器中授权当前网站"},"授权当前网站",8,l6)):xe("",!0),T("button",{type:"button",title:"重新检测连接器",onClick:v[3]||(v[3]=(...y)=>I(f)&&I(f)(...y))},"刷新")],2),I(n)?(K(),J("div",{key:0,class:Ce(["export-message",{error:I(r)}])},[ft(ve(I(n))+" ",1),I(o)?(K(),J("a",{key:0,href:I(o),target:"_blank",rel:"noopener",onClick:v[4]||(v[4]=y=>o.value="")},"授权当前网站",8,c6)):xe("",!0)],2)):xe("",!0)],64))}}),u6=Jt(h6,[["__scopeId","data-v-7ff40afe"]]),d6={class:"panel"},f6={class:"panel-scroll"},m6=Zt({__name:"ParticlePanel",setup(s){const{activeObjectType:e,sys:t}=RL();return(i,n)=>(K(),J("div",d6,[n[0]||(n[0]=T("div",{class:"panel-header"},[T("span",null,"Spine粒子编辑器-Yeomai")],-1)),T("div",f6,[we(UL),we(MD),I(e)==="particle"&&I(t)?(K(),J(_e,{key:0},[we(h4),we(F4),we(R8),we($$),we(i6)],64)):xe("",!0)]),we(u6)]))}}),p6=Jt(m6,[["__scopeId","data-v-283ef8eb"]]),Fo=s=>Math.max(0,Number(s)||0);function g6(s,e){const t=Math.max(1,e),i=new Map(s.map(v=>[v.id,v])),n=new Set;for(const v of s)if(v.config.eventEnabled)for(const y of v.config.events||[])y.targetSystemId>0&&y.targetSystemId!==v.id&&i.has(y.targetSystemId)&&n.add(y.targetSystemId);const r=new Map;for(const v of s)if(v.config.eventEnabled)for(const y of v.config.events||[]){if(y.targetSystemId<=0||y.targetSystemId===v.id||!i.has(y.targetSystemId))continue;const w=r.get(y.targetSystemId);w?w.push({parent:v,rule:y}):r.set(y.targetSystemId,[{parent:v,rule:y}])}const o=v=>Fo(v.delay),a=v=>Fo(v.delay),l=v=>{const y=o(v);return v.mode!=="stream"?y:v.streamBehavior==="loop"?y+Ps(v,t).total/t:y+Math.max(1/t,Number(v.duration)||0)},c=v=>{const y=Fo(v.lifeMin),w=Fo(v.lifeMax);return v.lifeMode==="fixed"?y:Math.min(y,w)},h=v=>{const y=Fo(v.lifeMin),w=Fo(v.lifeMax);return v.lifeMode==="fixed"?y:Math.max(y,w)},u=new Map,d=new Map,f=new Set,m=new Set,p=v=>{const y=u.get(v.id);if(y!=null)return y;if(f.has(v.id))return o(v.config);f.add(v.id);let w=1/0;for(const{parent:_,rule:S}of r.get(v.id)||[]){const b=n.has(_.id)?p(_)+a(_.config):o(_.config),C=S.event==="death"?c(_.config):0;w=Math.min(w,b+C)}return Number.isFinite(w)||(w=o(v.config)),f.delete(v.id),u.set(v.id,w),w},g=v=>{const y=d.get(v.id);if(y!=null)return y;if(m.has(v.id))return l(v.config);m.add(v.id);let w=-1/0;for(const{parent:_,rule:S}of r.get(v.id)||[]){const b=n.has(_.id)?g(_)+a(_.config):l(_.config),C=S.event==="birth"?0:h(_.config);w=Math.max(w,b+C)}return Number.isFinite(w)||(w=l(v.config)),m.delete(v.id),d.set(v.id,w),w},x=new Map;for(const v of n){const y=i.get(v);if(!y)continue;const w=p(y),_=g(y);x.set(v,{firstTrigger:w,lastTrigger:_,end:Math.max(w,_)+h(y.config)})}return x}const v6={class:"timeline"},y6={class:"tl-controls"},x6=["title"],b6={class:"tl-ab-loop"},w6={class:"tl-range",title:"自定义播放起始帧"},S6=["max","onKeydown"],M6={class:"tl-range",title:"自定义播放结束帧"},T6=["min","max","onKeydown"],_6={class:"tl-frame"},C6=["disabled"],E6=["onClick"],A6={key:0},I6={class:"tl-animation-editor"},R6={key:0,class:"tl-animation-error"},P6={class:"tl-animation-actions"},k6=["disabled"],F6={key:1,class:"tl-animation-hint"},O6={class:"tl-anim tl-spine-preview"},L6=["value","disabled"],B6={value:""},N6=["value"],D6={class:"tl-zoom"},U6={class:"tl-ticks"},$6={class:"tl-ticklabel"},X6={class:"tl-lanes"},V6=["onPointerdown"],Y6={class:"lane-name"},G6=["onPointerdown"],j6=["onPointerdown"],H6=["onPointerdown"],W6={class:"lane-name"},z6={key:0,class:"tl-empty"},q6=Zt({__name:"Timeline",setup(s){const e=yo(),t=Fe(null),i=Fe(null),n=Fe(!1),r=Fe("animation"),o=Fe("");Lo(()=>{(!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 B of e.systems)(!B.animation||!e.timeline.animations.includes(B.animation))&&(B.animation=e.timeline.animations[0])});const a=Le(()=>e.systems.find(B=>B.id===e.activeId)||null);function l(){a.value&&(n.value=!n.value,r.value=a.value.animation,o.value="")}function c(B){const j=a.value;j&&(e.setSystemAnimation(j.id,B),r.value=B,o.value="")}function h(){const B=e.addAnimation();r.value=B,o.value=""}function u(){var ie;const B=((ie=a.value)==null?void 0:ie.animation)||e.timeline.animation,j=r.value.trim();if(!j){o.value="动画名称不能为空";return}if(j!==B&&e.timeline.animations.includes(j)){o.value="动画名称不能重复";return}if(!e.renameAnimation(B,j)){o.value="无法修改动画名称";return}r.value=j,o.value=""}function d(){var ie,ue;const B=((ie=a.value)==null?void 0:ie.animation)||e.timeline.animation;if(!e.removeAnimation(B)){o.value="至少需要保留一个动画";return}const j=((ue=a.value)==null?void 0:ue.animation)||e.timeline.animation;r.value=j,o.value=""}function f(B){var j;(j=i.value)!=null&&j.contains(B.target)||(n.value=!1)}ys(()=>document.addEventListener("pointerdown",f)),Rr(()=>document.removeEventListener("pointerdown",f));const m=Le(()=>Math.max(1,e.timeline.fps||30)),p=Fe(Math.max(120,e.timeline.totalFrames)),g=Fe({}),x=Fe({}),v=Fe({}),y=Fe({}),w=Fe(String(e.timeline.playbackStart)),_=Fe(String(e.timeline.playbackEnd));ai(()=>e.timeline.playbackStart,B=>{w.value=String(B)}),ai(()=>e.timeline.playbackEnd,B=>{_.value=String(B)});const S=Le(()=>e.timeline.totalFrames);ai(S,B=>{B>p.value&&(p.value=Math.min(2e3,B))});const b=Le(()=>p.value<=30?"放大":p.value>=300?"缩小":"适中"),C=Le(()=>e.spines.filter(B=>B.selectedAnimation&&B.animations.some(j=>j.name===B.selectedAnimation&&j.duration>0))),A=Le(()=>(e.activeObjectType==="spine"?e.spines.find(j=>j.id===e.activeObjectId&&j.animations.length):null)||e.spines.find(j=>j.animations.length)||null);function P(B){const j=A.value;j&&(j.selectedAnimation=B.target.value,e.recalcTotalFrames(),e.timeline.frame=0)}function E(){e.setPlaybackStart(Number(w.value)),w.value=String(e.timeline.playbackStart)}function R(){e.setPlaybackEnd(Number(_.value)),_.value=String(e.timeline.playbackEnd)}function O(){var j;const B=((j=t.value)==null?void 0:j.clientWidth)||600;return p.value/B}const U=Le(()=>{const B=[],j=p.value;let ie=1;p.value<=10?ie=1:p.value<=50?ie=5:p.value<=200?ie=10:p.value<=500?ie=50:ie=100;for(let ue=0;ue<=j;ue+=ie)B.push({f:ue,px:ue/O()});return B}),G=Le(()=>e.timeline.frame/O()),$=Le(()=>ha(e.systems)),X=Le(()=>g6(e.systems,m.value));function D(B){return $.value.has(B.id)}function k(B){var ie;return(D(B)?((ie=X.value.get(B.id))==null?void 0:ie.firstTrigger)??0:0)*m.value/O()+4}function N(B){var ue;const j=B.config;if(D(B)){const me=((ue=X.value.get(B.id))==null?void 0:ue.firstTrigger)??0,ee=g.value[B.id]??Math.max(0,Number(j.delay)||0);return(me+ee)*m.value/O()}return(g.value[B.id]??Math.max(0,Number(j.delay)||0))*m.value/O()}function F(B){const j=B.config,ie=Math.max(0,Number(j.lifeMin)||0),ue=Math.max(0,Number(j.lifeMax)||0);return j.lifeMode==="fixed"?ie:Math.max(ie,ue)}function V(B){if(D(B)){const j=X.value.get(B.id),ie=(j==null?void 0:j.firstTrigger)??0,ue=(j==null?void 0:j.end)??ie;return Math.max(0,ue-ie)*m.value/O()}return q(B)}function Y(B){if(D(B)||B.config.mode!=="stream")return 0;if(B.config.streamBehavior==="loop"){const ie=B.config;return(v.value[B.id]??Ps(ie,m.value).loop)/O()}return(x.value[B.id]??Math.max(1/m.value,Number(B.config.duration)||1))*m.value/O()}function q(B){if(D(B))return V(B);const j=B.config;return j.mode==="stream"&&j.streamBehavior==="loop"?se(B)+Y(B)+oe(B):Y(B)+F(B)*m.value/O()}function z(B){const j=B.config;return j.mode==="stream"&&j.streamBehavior==="loop"}function se(B){return z(B)?Ps(B.config,m.value).start/O():0}function oe(B){return z(B)?Ps(B.config,m.value).end/O():0}function de(B){var j;return((j=B.animations.find(ie=>ie.name===B.selectedAnimation))==null?void 0:j.duration)||0}function ge(B){return(y.value[B.id]??Math.max(0,Number(B.timeOffset)||0))*m.value/O()}function he(B){return de(B)*m.value/O()}function fe(B){const j=B.deltaY<0?.8:1.25;let ie=p.value*j;ie=Math.min(2e3,Math.max(10,ie)),p.value=Math.round(ie)}function H(B){const j=t.value;e.pause();const ie=me=>{const ee=j.getBoundingClientRect(),Me=Math.floor((me.clientX-ee.left)/ee.width*p.value);e.timeline.frame=Math.max(0,Math.min(Me,S.value-1))};ie(B);const ue=()=>{window.removeEventListener("pointermove",ie),window.removeEventListener("pointerup",ue)};window.addEventListener("pointermove",ie),window.addEventListener("pointerup",ue)}function W(B,j){B.stopPropagation();const ie=B.clientX,ue=Math.max(0,Number(j.config.delay)||0),me=O()/m.value,ee=Ne=>{const Ye=(Ne.clientX-ie)*me,st=Math.max(0,Math.min(ue+Ye,600));g.value[j.id]=Math.round(st*m.value)/m.value},Me=Ne=>{window.removeEventListener("pointermove",ee),window.removeEventListener("pointerup",be),window.removeEventListener("pointercancel",pe);const Ye=g.value[j.id];delete g.value[j.id],Ne&&Ye!=null&&Ye!==ue&&(j.config.delay=Ye)},be=()=>Me(!0),pe=()=>Me(!1);window.addEventListener("pointermove",ee),window.addEventListener("pointerup",be),window.addEventListener("pointercancel",pe)}function Z(B,j){var nt;B.stopPropagation();const ie=z(j),ue=Math.max(0,Number(j.config.duration)||0),me=Ps(j.config,m.value).loop,ee=O()/m.value,Me=((nt=B.currentTarget.closest(".lane-bar"))==null?void 0:nt.getBoundingClientRect().left)??B.clientX,be=se(j);let pe=!1;const Ne=Ve=>{if(pe=!0,ie){const Ee=Math.min(1800,Math.max(1,Math.round((Ve.clientX-Me-be)/O())));v.value[j.id]=Ee}else{const Ee=Math.max(1/m.value,Math.min((Ve.clientX-Me)*ee,600));x.value[j.id]=Math.round(Ee*m.value)/m.value}},Ye=Ve=>{window.removeEventListener("pointermove",Ne),window.removeEventListener("pointerup",st),window.removeEventListener("pointercancel",Ze);const Ee=x.value[j.id],Je=v.value[j.id];delete x.value[j.id],delete v.value[j.id],Ve&&pe&&ie&&Je!=null&&Je!==me?j.config.loopDurationFrames=Je:Ve&&pe&&!ie&&Ee!=null&&Ee!==ue&&(j.config.duration=Ee)},st=()=>Ye(!0),Ze=()=>Ye(!1);window.addEventListener("pointermove",Ne),window.addEventListener("pointerup",st),window.addEventListener("pointercancel",Ze)}function L(B,j){B.stopPropagation();const ie=B.clientX,ue=Math.max(0,Number(j.timeOffset)||0),me=O()/m.value,ee=Ne=>{const Ye=Math.max(0,Math.min(ue+(Ne.clientX-ie)*me,600));y.value[j.id]=Math.round(Ye*m.value)/m.value},Me=Ne=>{window.removeEventListener("pointermove",ee),window.removeEventListener("pointerup",be),window.removeEventListener("pointercancel",pe);const Ye=y.value[j.id];delete y.value[j.id],Ne&&Ye!=null&&Ye!==ue&&(j.timeOffset=Ye,e.recalcTotalFrames())},be=()=>Me(!0),pe=()=>Me(!1);window.addEventListener("pointermove",ee),window.addEventListener("pointerup",be),window.addEventListener("pointercancel",pe)}return(B,j)=>{var ie,ue,me;return K(),J("div",v6,[T("div",y6,[T("button",{class:Ce(["tl-btn",{on:I(e).timeline.playing}]),onClick:j[0]||(j[0]=ee=>I(e).togglePlay()),title:I(e).timeline.playing?"暂停 (D)":"播放 (D)"},ve(I(e).timeline.playing?"❚❚":"▶"),11,x6),T("button",{class:"tl-btn",onClick:j[1]||(j[1]=ee=>I(e).toStart()),title:"回到第一帧 (S)"},"⏮"),T("button",{class:"tl-btn",onClick:j[2]||(j[2]=ee=>I(e).previousFrame()),title:"前一帧"},"◀"),T("button",{class:"tl-btn",onClick:j[3]||(j[3]=ee=>I(e).nextFrame()),title:"后一帧"},"▶"),T("button",{class:"tl-btn",onClick:j[4]||(j[4]=ee=>I(e).toEnd()),title:"移动到最后一帧"},"⏭"),T("button",{class:Ce(["tl-btn",{on:I(e).timeline.loop}]),title:"持续循环播放","aria-label":"持续循环播放",onClick:j[5]||(j[5]=ee=>I(e).toggleLoop())},"⟳",2),T("div",b6,[T("button",{class:Ce(["tl-ab-toggle",{on:I(e).timeline.abLoop}]),title:"独立 A/B 区间循环",onClick:j[6]||(j[6]=ee=>I(e).toggleABLoop())},[...j[12]||(j[12]=[T("span",null,"AB 循环",-1),T("i",{class:"tl-switch"},[T("b")],-1)])],2),I(e).timeline.abLoop?(K(),J("div",{key:0,class:"tl-ab-popover",onPointerdown:j[9]||(j[9]=qe(()=>{},["stop"]))},[j[15]||(j[15]=T("div",{class:"tl-ab-title"},"AB 循环区间",-1)),T("label",w6,[j[13]||(j[13]=T("span",null,"A",-1)),ce(T("input",{"onUpdate:modelValue":j[7]||(j[7]=ee=>w.value=ee),type:"number",min:"0",max:Math.max(0,I(e).timeline.playbackEnd-1),"aria-label":"播放起始帧",onChange:E,onKeydown:Mr(qe(E,["prevent"]),["enter"])},null,40,S6),[[He,w.value]])]),T("label",M6,[j[14]||(j[14]=T("span",null,"B",-1)),ce(T("input",{"onUpdate:modelValue":j[8]||(j[8]=ee=>_.value=ee),type:"number",min:I(e).timeline.playbackStart+1,max:Math.max(1,I(e).timeline.totalFrames-1),"aria-label":"播放结束帧",onChange:R,onKeydown:Mr(qe(R,["prevent"]),["enter"])},null,40,T6),[[He,_.value]])])],32)):xe("",!0)]),T("span",_6,[j[16]||(j[16]=ft("帧 ",-1)),T("b",null,ve(I(e).timeline.frame),1),j[17]||(j[17]=ft(" / ",-1)),T("b",null,ve(Math.max(0,I(e).timeline.totalFrames-1)),1)]),j[22]||(j[22]=T("span",{class:"tl-legend"},[T("i",{class:"legend-emission"}),ft("持续发射 "),T("i",{class:"legend-life"}),ft("粒子存在 "),T("i",{class:"legend-spine"}),ft("Spine 动画")],-1)),T("div",{ref_key:"animationMenuRef",ref:i,class:"tl-anim tl-owner-animation"},[j[20]||(j[20]=T("span",null,"所属动画",-1)),T("button",{class:"tl-animation-trigger",disabled:!a.value,title:"设置当前粒子系统所属的动画",onClick:qe(l,["stop"])},[T("span",null,ve(((ie=a.value)==null?void 0:ie.animation)||I(e).timeline.animation),1),j[18]||(j[18]=T("i",null,"⌄",-1))],8,C6),n.value?(K(),J("div",{key:0,class:"tl-animation-menu",onPointerdown:j[11]||(j[11]=qe(()=>{},["stop"]))},[j[19]||(j[19]=T("div",{class:"tl-animation-menu-title"},"选择所属动画",-1)),(K(!0),J(_e,null,Et(I(e).timeline.animations,ee=>{var Me,be;return K(),J("button",{key:ee,class:Ce(["tl-animation-option",{on:((Me=a.value)==null?void 0:Me.animation)===ee}]),onClick:pe=>c(ee)},[T("span",null,ve(ee),1),((be=a.value)==null?void 0:be.animation)===ee?(K(),J("i",A6,"✓")):xe("",!0)],10,E6)}),128)),T("div",I6,[ce(T("input",{"onUpdate:modelValue":j[10]||(j[10]=ee=>r.value=ee),class:"tl-animation-name",maxlength:"64","aria-label":"动画名称",onKeydown:Mr(u,["enter"])},null,544),[[He,r.value]]),T("button",{title:"重命名当前动画",onClick:u},"重命名")]),o.value?(K(),J("div",R6,ve(o.value),1)):xe("",!0),T("div",P6,[T("button",{onClick:h},"+ 新增"),T("button",{disabled:I(e).timeline.animations.length<=1,onClick:d},"删除",8,k6)]),I(e).timeline.animations.length<=1?(K(),J("div",F6,"至少需要保留一个动画")):xe("",!0)],32)):xe("",!0)],512),T("label",O6,[j[21]||(j[21]=ft("Spine 预览动画 ",-1)),T("select",{class:"tl-sel",value:((ue=A.value)==null?void 0:ue.selectedAnimation)||"",disabled:!A.value,onChange:P},[T("option",B6,ve(A.value?"无":"无可用 Spine 动画"),1),(K(!0),J(_e,null,Et(((me=A.value)==null?void 0:me.animations)||[],ee=>(K(),J("option",{key:ee.name,value:ee.name},ve(ee.name)+"("+ve(ee.duration.toFixed(2))+"s) ",9,N6))),128))],40,L6)]),T("span",D6,ve(b.value),1)]),T("div",{class:"tl-viewport",ref_key:"vpRef",ref:t,onWheel:qe(fe,["prevent"]),onPointerdown:H},[T("div",U6,[(K(!0),J(_e,null,Et(U.value,ee=>(K(),J("div",{key:ee.f,class:"tl-tickline",style:Ot({left:ee.px+"px"})},[T("span",$6,ve(ee.f)+"f",1)],4))),128))]),T("div",{class:"tl-playhead",style:Ot({left:G.value+"px"})},null,4),T("div",X6,[(K(!0),J(_e,null,Et(I(e).systems,(ee,Me)=>(K(),J("div",{key:ee.id,class:"tl-lane"},[T("span",{class:Ce(["lane-ico",{"sub-lane-ico":D(ee)}]),style:Ot({left:k(ee)+"px"})},"●",6),T("div",{class:Ce(["lane-bar",{"sub-emitter-bar":D(ee)}]),style:Ot({left:N(ee)+"px",width:V(ee)+"px"}),onPointerdown:qe(be=>W(be,ee),["stop"])},[T("span",Y6,ve(ee.config.name||"系统 "+(Me+1)),1),T("span",{class:Ce(["bar-life",{"loop-life":!D(ee)&&z(ee)}]),style:Ot({width:q(ee)+"px"})},null,6),!D(ee)&&z(ee)?(K(),J(_e,{key:0},[se(ee)?(K(),J("span",{key:0,class:"bar-loop-transition bar-loop-start",style:Ot({width:se(ee)+"px"})},null,4)):xe("",!0),T("span",{class:"bar-emission bar-loop",style:Ot({left:se(ee)+"px",width:Y(ee)+"px"})},[T("span",{class:"bar-handle",title:"拖动循环段时长",onPointerdown:qe(be=>Z(be,ee),["stop"])},null,40,G6)],4),oe(ee)?(K(),J("span",{key:1,class:"bar-loop-transition bar-loop-end",style:Ot({left:se(ee)+Y(ee)+"px",width:oe(ee)+"px"})},null,4)):xe("",!0)],64)):!D(ee)&&ee.config.mode==="stream"?(K(),J("span",{key:1,class:"bar-emission",style:Ot({width:Y(ee)+"px"})},[T("span",{class:"bar-handle",title:"拖动持续发射时长",onPointerdown:qe(be=>Z(be,ee),["stop"])},null,40,j6)],4)):xe("",!0)],46,V6)]))),128)),(K(!0),J(_e,null,Et(C.value,ee=>(K(),J("div",{key:`spine-${ee.id}`,class:"tl-lane spine-lane"},[j[23]||(j[23]=T("span",{class:"lane-ico spine-ico"},"◆",-1)),T("div",{class:"spine-bar",style:Ot({left:ge(ee)+"px",width:he(ee)+"px"}),title:"拖动调整动画开始时间",onPointerdown:qe(Me=>L(Me,ee),["stop"])},[T("span",W6,ve(ee.name)+" · "+ve(ee.selectedAnimation),1)],44,H6)]))),128)),!I(e).systems.length&&!C.value.length?(K(),J("div",z6,"暂无可显示的动画数据")):xe("",!0)])],544)])}}}),K6=Jt(q6,[["__scopeId","data-v-6b4c353d"]]),Z6={class:"transfer-heading"},J6={key:0},Q6={class:"transfer-detail"},eX=Zt({__name:"TransferProgressOverlay",setup(s){const e=Fe(null);return ai(()=>ti.visible,async t=>{var i;t&&(await Kh(),(i=e.value)==null||i.focus({preventScroll:!0}))},{flush:"post"}),(t,i)=>(K(),Ct(u2,{name:"transfer-fade"},{default:Zh(()=>[I(ti).visible?(K(),J("div",{key:0,ref_key:"overlayElement",ref:e,class:"transfer-overlay",role:"dialog","aria-modal":"true","aria-live":"polite",tabindex:"-1",onPointerdown:i[0]||(i[0]=qe(()=>{},["stop","prevent"])),onPointerup:i[1]||(i[1]=qe(()=>{},["stop","prevent"])),onClick:i[2]||(i[2]=qe(()=>{},["stop","prevent"])),onDblclick:i[3]||(i[3]=qe(()=>{},["stop","prevent"])),onContextmenu:i[4]||(i[4]=qe(()=>{},["stop","prevent"])),onWheel:i[5]||(i[5]=qe(()=>{},["stop","prevent"])),onKeydown:i[6]||(i[6]=qe(()=>{},["stop","prevent"]))},[T("div",{class:Ce(["transfer-dialog",{failed:I(ti).failed}])},[T("div",Z6,[T("span",null,ve(I(ti).title),1),I(ti).indeterminate?xe("",!0):(K(),J("strong",J6,ve(Math.round(I(ti).progress))+"%",1))]),T("div",{class:Ce(["transfer-track",{indeterminate:I(ti).indeterminate}])},[T("div",{class:"transfer-bar",style:Ot(I(ti).indeterminate?void 0:{width:`${I(ti).progress}%`})},null,4)],2),T("div",Q6,ve(I(ti).detail),1)],2)],544)):xe("",!0)]),_:1}))}}),tX=Jt(eX,[["__scopeId","data-v-592b922e"]]),iX=["inert","aria-hidden"],sX={class:"right"},nX={class:"stage-area"},rX=Zt({__name:"App",setup(s){const e=yo();NR(e);const t=Fe(360),i=Fe(180);function n(o){o.preventDefault();const a=c=>{const h=e.settings.parameterPanelOnRight?window.innerWidth-c.clientX:c.clientX,u=Math.max(240,Math.min(h,window.innerWidth-200));t.value=u},l=()=>{window.removeEventListener("pointermove",a),window.removeEventListener("pointerup",l)};window.addEventListener("pointermove",a),window.addEventListener("pointerup",l)}function r(o){o.preventDefault();const a=o.clientY,l=i.value,c=u=>{const d=Math.max(80,Math.min(l+(a-u.clientY),window.innerHeight-200));i.value=d},h=()=>{window.removeEventListener("pointermove",c),window.removeEventListener("pointerup",h)};window.addEventListener("pointermove",c),window.addEventListener("pointerup",h)}return(o,a)=>(K(),J(_e,null,[T("div",{class:Ce(["layout",{"panel-right":I(e).settings.parameterPanelOnRight}]),inert:I(ti).visible?!0:void 0,"aria-hidden":I(ti).visible?"true":void 0},[T("div",{class:"parameter-panel",style:Ot({width:t.value+"px"})},[we(p6)],4),T("div",{class:"resizer-col",onPointerdown:n},null,32),T("div",sX,[T("div",nX,[we(M3)]),T("div",{class:"resizer-row",onPointerdown:r,title:"拖动调整时间轴高度"},null,32),T("div",{class:"timeline-area",style:Ot({height:i.value+"px"})},[we(K6)],4)])],10,iX),we(tX)],64))}}),oX=Jt(rX,[["__scopeId","data-v-42c4fa00"]]);U2(oX).use(V2()).mount("#app");export{Sy as $,ln as A,Lh as B,At as C,gi as D,ke as E,Yi as F,fn as G,rt as H,St as I,DS as J,Ni as K,os as L,vs as M,Ar as N,bu as O,an as P,bl as Q,fa as R,Rs as S,oO as T,je as U,gy as V,Os as W,BV as X,sL as Y,_l as Z,Tp as _,Ke as a,Lm as a$,wy as a0,vS as a1,Lp as a2,OV as a3,Ph as a4,nl as a5,gO as a6,rl as a7,wu as a8,Pm as a9,Ym as aA,Gm as aB,Cc as aC,ur as aD,Xc as aE,km as aF,wS as aG,zt as aH,mS as aI,CV as aJ,oa as aK,by as aL,Ie as aM,Xe as aN,Om as aO,Vc as aP,_S as aQ,Fm as aR,MS as aS,TS as aT,Su as aU,AS as aV,Yc as aW,PS as aX,CS as aY,IS as aZ,kS as a_,wo as aa,Bp as ab,Np as ac,yy as ad,Bl as ae,Nl as af,Ll as ag,bo as ah,Bn as ai,AV as aj,bS as ak,pO as al,pa as am,_r as an,$p as ao,NS as ap,fO as aq,Tl as ar,zi as as,xy as at,PV as au,ba as av,Vm as aw,jm as ax,Hm as ay,Wm as az,ua as b,qn as b$,Oh as b0,ES as b1,kr as b2,RS as b3,Dp as b4,rO as b5,LS as b6,BS as b7,Up as b8,dn as b9,FS as bA,Xp as bB,xu as bC,US as bD,Bm as bE,mi as bF,sO as bG,lO as bH,sS as bI,iS as bJ,IV as bK,Bt as bL,wa as bM,$S as bN,YS as bO,GS as bP,jS as bQ,XS as bR,VS as bS,dO as bT,Vp as bU,_t as bV,Xm as bW,SS as bX,rS as bY,oS as bZ,aS as b_,nO as ba,EV as bb,it as bc,xS as bd,yS as be,pS as bf,gS as bg,co as bh,kh as bi,mO as bj,lS as bk,cS as bl,Xi as bm,hS as bn,ma as bo,_i as bp,nS as bq,Fh as br,uS as bs,dS as bt,fS as bu,My as bv,Um as bw,Jr as bx,OS as by,Dm as bz,da as c,RV as c0,hO as c1,uO as c2,cO as c3,We as d,$e as e,kV as f,tt as g,bi as h,hh as i,Ki as j,$t as k,Ue as l,Ns as m,Ft as n,vp as o,si as p,wl as q,cr as r,Be as s,bb as t,Mp as u,ph as v,Nm as w,Kr as x,vy as y,$m as z}; diff --git a/dist/assets/index-Csznclrj.js b/dist/assets/index-CC5ru70P.js similarity index 99% rename from dist/assets/index-Csznclrj.js rename to dist/assets/index-CC5ru70P.js index cff955c..5bb54a0 100644 --- a/dist/assets/index-Csznclrj.js +++ b/dist/assets/index-CC5ru70P.js @@ -1,4 +1,4 @@ -var Ae=Object.defineProperty;var Be=(m,o,e)=>o in m?Ae(m,o,{enumerable:!0,configurable:!0,writable:!0,value:e}):m[o]=e;var a=(m,o,e)=>Be(m,typeof o!="symbol"?o+"":o,e);import{T as Fe,a as he,b as F,S as ue,M as pe,c as oe,W as ne,B as H,d as z,L as Te,E as O,e as ce,p as q,f as Ee,g as fe,A as Q,h as me,i as De,j as V,s as re,G as we,k as $,l as Y,m as Le,P as Ie,n as Re,o as Ne,C as X,q as be,r as _e,t as Ue,u as Ye,v as Xe,w as ee,x as j,y as ke,z as Ve,D as J,F as ge,V as Ge,H as ae,I as We,J as $e,U as xe,K as E,R as ve,N as ye,O as Pe,Q as Oe,X as He,Y as ze,Z as qe,_ as Ke}from"./index-Bjqx1iPW.js";import{$ as bt,a0 as kt,a1 as vt,a2 as yt,a3 as Pt,a4 as St,a5 as Mt,a6 as At,a7 as Bt,a8 as Ft,a9 as Et,aa as Dt,ab as Lt,ac as It,ad as Rt,ae as Nt,af as _t,ag as Ut,ah as Yt,ai as Xt,aj as Vt,ak as Gt,al as Wt,am as $t,an as Ot,ao as Ht,ap as zt,aq as qt,ar as Kt,as as Zt,at as Jt,au as Qt,av as jt,aw as es,ax as ts,ay as ss,az as os,aA as ns,aB as as,aC as rs,aD as is,aE as ls,aF as hs,aG as cs,aH as ds,aI as us,aJ as ps,aK as fs,aL as ms,aM as gs,aN as xs,aO as Cs,aP as Ts,aQ as ws,aR as bs,aS as ks,aT as vs,aU as ys,aV as Ps,aW as Ss,aX as Ms,aY as As,aZ as Bs,a_ as Fs,a$ as Es,b0 as Ds,b1 as Ls,b2 as Is,b3 as Rs,b4 as Ns,b5 as _s,b6 as Us,b7 as Ys,b8 as Xs,b9 as Vs,ba as Gs,bb as Ws,bc as $s,bd as Os,be as Hs,bf as zs,bg as qs,bh as Ks,bi as Zs,bj as Js,bk as Qs,bl as js,bm as eo,bn as to,bo as so,bp as oo,bq as no,br as ao,bs as ro,bt as io,bu as lo,bv as ho,bw as co,bx as uo,by as po,bz as fo,bA as mo,bB as go,bC as xo,bD as Co,bE as To,bF as wo,bG as bo,bH as ko,bI as vo,bJ as yo,bK as Po,bL as So,bM as Mo,bN as Ao,bO as Bo,bP as Fo,bQ as Eo,bR as Do,bS as Lo,bT as Io,bU as Ro,bV as No,bW as _o,bX as Uo,bY as Yo,bZ as Xo,b_ as Vo,b$ as Go,c0 as Wo,c1 as $o,c2 as Oo,c3 as Ho}from"./index-Bjqx1iPW.js";import{SkeletonClipping as de,SkeletonPhysicsMovement as Ze,AnimationStateData as Je,AtlasAttachmentLoader as Qe,SkeletonBounds as je}from"./index-ChTSy5jk.js";import{AssetCache as qo,AssetManagerBase as Ko,Downloader as Zo,SkeletonRendererCore as Jo,Triangulator as Qo}from"./index-ChTSy5jk.js";if(typeof window<"u"&&window.PIXI){const m=window.require;window.require=o=>{if(m)return m(o);if(o.startsWith("@pixi/"))return window.PIXI}}const _=class _ extends Fe{constructor(e){super(e.resource.source);a(this,"texture");this.texture=he.from(e)}static from(e){return _.textureMap.has(e)?_.textureMap.get(e):new _(e)}setFilters(e,t){this.texture.baseTexture.scaleMode=_.toPixiTextureFilter(e),this.texture.baseTexture.mipmap=_.toPixiMipMap(e)}setWraps(e,t){this.texture.baseTexture.wrapMode=_.toPixiTextureWrap(e)}dispose(){this.texture.destroy()}static toPixiTextureFilter(e){switch(e){case F.Nearest:case F.MipMapNearestLinear:case F.MipMapNearestNearest:return ue.NEAREST;case F.Linear:case F.MipMapLinearLinear:case F.MipMapLinearNearest:return ue.LINEAR;default:throw new Error(`Unknown texture filter: ${String(e)}`)}}static toPixiMipMap(e){switch(e){case F.Nearest:case F.Linear:return pe.OFF;case F.MipMapNearestLinear:case F.MipMapNearestNearest:case F.MipMapLinearLinear:case F.MipMapLinearNearest:return pe.ON;default:throw new Error(`Unknown texture filter: ${String(e)}`)}}static toPixiTextureWrap(e){switch(e){case oe.ClampToEdge:return ne.CLAMP;case oe.MirroredRepeat:return ne.MIRRORED_REPEAT;case oe.Repeat:return ne.REPEAT;default:throw new Error(`Unknown texture wrap: ${String(e)}`)}}static toPixiBlending(e){switch(e){case H.Normal:return z.NORMAL;case H.Additive:return z.ADD;case H.Multiply:return z.MULTIPLY;case H.Screen:return z.SCREEN;default:throw new Error(`Unknown blendMode: ${String(e)}`)}}};a(_,"textureMap",new Map);let G=_;const K="spineTextureAtlasLoader",et={extension:O.Asset,resolver:{test:m=>V(m,".atlas"),parse:m=>{var e,t;const o=m.split(".");return{resolution:parseFloat(((t=(e=re.RETINA_PREFIX)==null?void 0:e.exec(m))==null?void 0:t[1])??"1"),format:o[o.length-2],src:m}}},loader:{name:K,extension:{type:O.LoadParser,priority:Te.Normal,name:K},test(m){return V(m,".atlas")},async load(m){const o=await re.ADAPTER.fetch(m);if(!o.ok)throw new Error(`[${K}] Failed to fetch ${m}: ${o.status} ${o.statusText}`);return await o.text()},testParse(m,o){const e=V(o.src,".atlas"),t=typeof m=="string",s=o.loadParser===K;return Promise.resolve((e||s)&&t)},unload(m){m.dispose()},async parse(m,o,e){var p;const t=o.data||{};let s=q.dirname(o.src);s&&s.lastIndexOf("/")!==s.length-1&&(s+="/");const n=new Ee(m);if(t.images instanceof fe||typeof t.images=="string"){const h=t.images;t.images={},t.images[n.pages[0].name]=h}const r=[];let l=!0;for(const h of e.parsers)if(h.name==="loadTextures"){l=(p=h.config)==null?void 0:p.preferCreateImageBitmap;break}Q.setPreferences({preferCreateImageBitmap:!1});for(const h of n.pages){const u=h.name,c=t!=null&&t.images?t.images[u]:void 0;if(c instanceof fe)h.setTexture(G.from(c));else{const i=c??q.normalize([...s.split(q.sep),u].join(q.sep)),g={src:De(i,o.src),data:{...t.imageMetadata,alphaMode:h.pma?me.PMA:me.UNPACK}},x=e.load(g).then(d=>{h.setTexture(G.from(d.baseTexture))});r.push(x)}}return await Promise.all(r),Q.setPreferences({preferCreateImageBitmap:l}),n}}};ce.add(et);const Z="spineSkeletonLoader";function tt(m){return m.hasOwnProperty("bones")}function st(m){return m instanceof Uint8Array}const ot={extension:O.Asset,loader:{name:Z,extension:{type:O.LoadParser,priority:Te.Normal,name:Z},test(m){return V(m,".skel")},async load(m){const o=await re.ADAPTER.fetch(m);if(!o.ok)throw new Error(`[${Z}] Failed to fetch ${m}: ${o.status} ${o.statusText}`);return new Uint8Array(await o.arrayBuffer())},testParse(m,o){const e=V(o.src,".json")&&tt(m),t=V(o.src,".skel")&&st(m),s=o.loadParser===Z;return Promise.resolve(e||t||s)}}};ce.add(ot);class nt extends we{constructor(o=!1){super();const e=new $(void 0),t=new $(void 0,!0),s=new $(void 0,!0,!0);this.addAttribute("aVertexPosition",e,2,!1,Y.FLOAT),this.addAttribute("aTextureCoord",t,2,!1,Y.FLOAT),this.addIndex(s)}}const at=` +var Ae=Object.defineProperty;var Be=(m,o,e)=>o in m?Ae(m,o,{enumerable:!0,configurable:!0,writable:!0,value:e}):m[o]=e;var a=(m,o,e)=>Be(m,typeof o!="symbol"?o+"":o,e);import{T as Fe,a as he,b as F,S as ue,M as pe,c as oe,W as ne,B as H,d as z,L as Te,E as O,e as ce,p as q,f as Ee,g as fe,A as Q,h as me,i as De,j as V,s as re,G as we,k as $,l as Y,m as Le,P as Ie,n as Re,o as Ne,C as X,q as be,r as _e,t as Ue,u as Ye,v as Xe,w as ee,x as j,y as ke,z as Ve,D as J,F as ge,V as Ge,H as ae,I as We,J as $e,U as xe,K as E,R as ve,N as ye,O as Pe,Q as Oe,X as He,Y as ze,Z as qe,_ as Ke}from"./index-DQ5rq6hP.js";import{$ as bt,a0 as kt,a1 as vt,a2 as yt,a3 as Pt,a4 as St,a5 as Mt,a6 as At,a7 as Bt,a8 as Ft,a9 as Et,aa as Dt,ab as Lt,ac as It,ad as Rt,ae as Nt,af as _t,ag as Ut,ah as Yt,ai as Xt,aj as Vt,ak as Gt,al as Wt,am as $t,an as Ot,ao as Ht,ap as zt,aq as qt,ar as Kt,as as Zt,at as Jt,au as Qt,av as jt,aw as es,ax as ts,ay as ss,az as os,aA as ns,aB as as,aC as rs,aD as is,aE as ls,aF as hs,aG as cs,aH as ds,aI as us,aJ as ps,aK as fs,aL as ms,aM as gs,aN as xs,aO as Cs,aP as Ts,aQ as ws,aR as bs,aS as ks,aT as vs,aU as ys,aV as Ps,aW as Ss,aX as Ms,aY as As,aZ as Bs,a_ as Fs,a$ as Es,b0 as Ds,b1 as Ls,b2 as Is,b3 as Rs,b4 as Ns,b5 as _s,b6 as Us,b7 as Ys,b8 as Xs,b9 as Vs,ba as Gs,bb as Ws,bc as $s,bd as Os,be as Hs,bf as zs,bg as qs,bh as Ks,bi as Zs,bj as Js,bk as Qs,bl as js,bm as eo,bn as to,bo as so,bp as oo,bq as no,br as ao,bs as ro,bt as io,bu as lo,bv as ho,bw as co,bx as uo,by as po,bz as fo,bA as mo,bB as go,bC as xo,bD as Co,bE as To,bF as wo,bG as bo,bH as ko,bI as vo,bJ as yo,bK as Po,bL as So,bM as Mo,bN as Ao,bO as Bo,bP as Fo,bQ as Eo,bR as Do,bS as Lo,bT as Io,bU as Ro,bV as No,bW as _o,bX as Uo,bY as Yo,bZ as Xo,b_ as Vo,b$ as Go,c0 as Wo,c1 as $o,c2 as Oo,c3 as Ho}from"./index-DQ5rq6hP.js";import{SkeletonClipping as de,SkeletonPhysicsMovement as Ze,AnimationStateData as Je,AtlasAttachmentLoader as Qe,SkeletonBounds as je}from"./index-Ck8IwYQq.js";import{AssetCache as qo,AssetManagerBase as Ko,Downloader as Zo,SkeletonRendererCore as Jo,Triangulator as Qo}from"./index-Ck8IwYQq.js";if(typeof window<"u"&&window.PIXI){const m=window.require;window.require=o=>{if(m)return m(o);if(o.startsWith("@pixi/"))return window.PIXI}}const _=class _ extends Fe{constructor(e){super(e.resource.source);a(this,"texture");this.texture=he.from(e)}static from(e){return _.textureMap.has(e)?_.textureMap.get(e):new _(e)}setFilters(e,t){this.texture.baseTexture.scaleMode=_.toPixiTextureFilter(e),this.texture.baseTexture.mipmap=_.toPixiMipMap(e)}setWraps(e,t){this.texture.baseTexture.wrapMode=_.toPixiTextureWrap(e)}dispose(){this.texture.destroy()}static toPixiTextureFilter(e){switch(e){case F.Nearest:case F.MipMapNearestLinear:case F.MipMapNearestNearest:return ue.NEAREST;case F.Linear:case F.MipMapLinearLinear:case F.MipMapLinearNearest:return ue.LINEAR;default:throw new Error(`Unknown texture filter: ${String(e)}`)}}static toPixiMipMap(e){switch(e){case F.Nearest:case F.Linear:return pe.OFF;case F.MipMapNearestLinear:case F.MipMapNearestNearest:case F.MipMapLinearLinear:case F.MipMapLinearNearest:return pe.ON;default:throw new Error(`Unknown texture filter: ${String(e)}`)}}static toPixiTextureWrap(e){switch(e){case oe.ClampToEdge:return ne.CLAMP;case oe.MirroredRepeat:return ne.MIRRORED_REPEAT;case oe.Repeat:return ne.REPEAT;default:throw new Error(`Unknown texture wrap: ${String(e)}`)}}static toPixiBlending(e){switch(e){case H.Normal:return z.NORMAL;case H.Additive:return z.ADD;case H.Multiply:return z.MULTIPLY;case H.Screen:return z.SCREEN;default:throw new Error(`Unknown blendMode: ${String(e)}`)}}};a(_,"textureMap",new Map);let G=_;const K="spineTextureAtlasLoader",et={extension:O.Asset,resolver:{test:m=>V(m,".atlas"),parse:m=>{var e,t;const o=m.split(".");return{resolution:parseFloat(((t=(e=re.RETINA_PREFIX)==null?void 0:e.exec(m))==null?void 0:t[1])??"1"),format:o[o.length-2],src:m}}},loader:{name:K,extension:{type:O.LoadParser,priority:Te.Normal,name:K},test(m){return V(m,".atlas")},async load(m){const o=await re.ADAPTER.fetch(m);if(!o.ok)throw new Error(`[${K}] Failed to fetch ${m}: ${o.status} ${o.statusText}`);return await o.text()},testParse(m,o){const e=V(o.src,".atlas"),t=typeof m=="string",s=o.loadParser===K;return Promise.resolve((e||s)&&t)},unload(m){m.dispose()},async parse(m,o,e){var p;const t=o.data||{};let s=q.dirname(o.src);s&&s.lastIndexOf("/")!==s.length-1&&(s+="/");const n=new Ee(m);if(t.images instanceof fe||typeof t.images=="string"){const h=t.images;t.images={},t.images[n.pages[0].name]=h}const r=[];let l=!0;for(const h of e.parsers)if(h.name==="loadTextures"){l=(p=h.config)==null?void 0:p.preferCreateImageBitmap;break}Q.setPreferences({preferCreateImageBitmap:!1});for(const h of n.pages){const u=h.name,c=t!=null&&t.images?t.images[u]:void 0;if(c instanceof fe)h.setTexture(G.from(c));else{const i=c??q.normalize([...s.split(q.sep),u].join(q.sep)),g={src:De(i,o.src),data:{...t.imageMetadata,alphaMode:h.pma?me.PMA:me.UNPACK}},x=e.load(g).then(d=>{h.setTexture(G.from(d.baseTexture))});r.push(x)}}return await Promise.all(r),Q.setPreferences({preferCreateImageBitmap:l}),n}}};ce.add(et);const Z="spineSkeletonLoader";function tt(m){return m.hasOwnProperty("bones")}function st(m){return m instanceof Uint8Array}const ot={extension:O.Asset,loader:{name:Z,extension:{type:O.LoadParser,priority:Te.Normal,name:Z},test(m){return V(m,".skel")},async load(m){const o=await re.ADAPTER.fetch(m);if(!o.ok)throw new Error(`[${Z}] Failed to fetch ${m}: ${o.status} ${o.statusText}`);return new Uint8Array(await o.arrayBuffer())},testParse(m,o){const e=V(o.src,".json")&&tt(m),t=V(o.src,".skel")&&st(m),s=o.loadParser===Z;return Promise.resolve(e||t||s)}}};ce.add(ot);class nt extends we{constructor(o=!1){super();const e=new $(void 0),t=new $(void 0,!0),s=new $(void 0,!0,!0);this.addAttribute("aVertexPosition",e,2,!1,Y.FLOAT),this.addAttribute("aTextureCoord",t,2,!1,Y.FLOAT),this.addIndex(s)}}const at=` attribute vec2 aVertexPosition; attribute vec2 aTextureCoord; diff --git a/dist/assets/index-ChdWidWA.css b/dist/assets/index-ChdWidWA.css deleted file mode 100644 index 5a764d5..0000000 --- a/dist/assets/index-ChdWidWA.css +++ /dev/null @@ -1 +0,0 @@ -.help-overlay[data-v-78204b9d]{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-78204b9d]{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-78204b9d]{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-78204b9d]{margin:0;color:#eef2ff;font-size:19px}.help-head p[data-v-78204b9d]{margin:5px 0 0;color:#7786a3;font-size:11px}.help-close[data-v-78204b9d]{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-78204b9d]:hover{border-color:#7774ff;background:#3b4670;color:#fff}.help-body[data-v-78204b9d]{min-height:0;overflow:auto;padding:18px 20px 21px}.help-section[data-v-78204b9d]{padding:14px 15px;border:1px solid #2c3850;border-radius:10px;background:#181f2e}.help-section h3[data-v-78204b9d]{margin:0 0 11px;color:#9fb2ff;font-size:13px}.help-start ol[data-v-78204b9d]{margin:0;padding-left:21px;color:#aab6cc;font-size:12px;line-height:1.75}.help-start li[data-v-78204b9d]::marker{color:#7774ff;font-weight:700}.help-section b[data-v-78204b9d]{color:#dce4f7}.help-grid[data-v-78204b9d]{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(250px,.85fr);gap:12px;margin-top:12px}.help-list[data-v-78204b9d]{display:grid;gap:0;margin:0}.help-list>div[data-v-78204b9d]{display:grid;grid-template-columns:78px 1fr;gap:9px;padding:7px 0;border-bottom:1px solid #263146}.help-list>div[data-v-78204b9d]:last-child{border-bottom:0}.help-list dt[data-v-78204b9d]{color:#d3dcf0;font-size:11px;font-weight:700}.help-list dd[data-v-78204b9d]{margin:0;color:#8795ae;font-size:11px;line-height:1.5}.shortcut-list[data-v-78204b9d]{display:grid;gap:7px}.shortcut-list>div[data-v-78204b9d]{display:flex;align-items:center;min-height:25px;gap:5px}.shortcut-list kbd[data-v-78204b9d]{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-78204b9d]{color:#65728b;font-size:10px}.shortcut-list em[data-v-78204b9d]{margin-left:auto;color:#9ca9c1;font-size:11px;font-style:normal}.help-note[data-v-78204b9d]{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-78204b9d]{margin-top:12px}.help-export p[data-v-78204b9d]{margin:0;color:#8997b0;font-size:11px;line-height:1.65}.help-doc-title[data-v-78204b9d]{margin:16px 2px 2px;color:#9fb2ff;font-size:13px;font-weight:700;letter-spacing:.5px}.help-module[data-v-78204b9d]{margin-top:12px}.help-module-head[data-v-78204b9d]{display:flex;align-items:center;gap:8px;width:100%;padding:0;border:0;background:transparent;color:#9fb2ff;font:inherit;font-size:13px;font-weight:700;text-align:left;cursor:pointer}.help-module-head[data-v-78204b9d]:hover{color:#fff}.help-module-head .mtitle[data-v-78204b9d]{flex:1;min-width:0}.help-module-head .caret[data-v-78204b9d]{flex:0 0 auto;color:#7b86a2;font-size:12px}.help-module.open .help-module-head[data-v-78204b9d]{color:#fff}.help-module.open .help-module-head .caret[data-v-78204b9d]{color:#9fb2ff}.help-module .mnum[data-v-78204b9d]{flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;width:22px;height:22px;border-radius:6px;background:linear-gradient(135deg,#4a53b8,#6a5fd0);color:#fff;font-size:12px;font-weight:700}.help-module.help-connector[data-v-78204b9d]{border-color:#4a4f8a;background:linear-gradient(135deg,#1d2442,#181d2f)}.help-module.help-connector .help-module-head[data-v-78204b9d]{color:#b8c2ff}.help-module .connector-intro[data-v-78204b9d]{margin:0 0 10px;color:#9aa8c4;font-size:11px;line-height:1.6}.help-module .connector-intro b[data-v-78204b9d]{color:#dce4f7}.help-module .dl-link[data-v-78204b9d]{display:inline-flex;flex-direction:column;align-items:flex-start;gap:2px;margin:0 10px 6px 0;padding:6px 12px;border:1px solid #5652b5;border-radius:6px;background:#4540a0;color:#fff;font-size:12px;font-weight:700;text-decoration:none}.help-module .dl-link[data-v-78204b9d]:hover{border-color:#8982ff;background:#554dc2}.help-module .dl-link small[data-v-78204b9d]{color:#cfe0ff;font-weight:500;font-size:9px}.help-module-body[data-v-78204b9d]{padding-top:10px}@media(max-width:760px){.help-overlay[data-v-78204b9d]{padding:66px 12px 14px}.help-grid[data-v-78204b9d]{grid-template-columns:1fr}}.topbar[data-v-4749834a]{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-4749834a]{background:#1a1a28;border:1px solid #2e2e44;color:#dde;border-radius:5px}.tool-group[data-v-4749834a]{display:flex;gap:6px;margin-left:6px;padding-left:12px;border-left:1px solid #2a2a3c}.tool-btn[data-v-4749834a]{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-4749834a]:hover{background:#2b3a5c;color:#fff}.tool-btn.on[data-v-4749834a]{background:#3a5a8c;color:#fff;border-color:#5a7ab8}.background-menu[data-v-4749834a]{position:relative;flex:0 0 auto}.background-btn[data-v-4749834a]{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-4749834a]:hover,.background-btn.on[data-v-4749834a]{border-color:#7774ff;background:#343b63;color:#fff}.background-panel[data-v-4749834a]{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-4749834a]{width:100%;height:30px;border:1px solid #5652b5;border-radius:6px;background:#4540a0;color:#fff;cursor:pointer}.background-upload[data-v-4749834a]:hover{border-color:#8982ff;background:#554dc2}.background-clear[data-v-4749834a]{width:100%;height:28px;margin-top:6px;border:1px solid #70404a;border-radius:6px;background:#512a33;color:#efb5bd;cursor:pointer}.background-clear[data-v-4749834a]:hover:not(:disabled){border-color:#b65b6a;background:#6a303b;color:#fff}.background-clear[data-v-4749834a]:disabled{opacity:.42;cursor:not-allowed}.background-file-input[data-v-4749834a]{display:none}.background-file-name[data-v-4749834a]{margin:7px 2px 9px;overflow:hidden;color:#737f98;font-size:10px;text-overflow:ellipsis;white-space:nowrap}.background-position-row[data-v-4749834a]{display:grid;grid-template-columns:1fr 1fr;gap:8px}.background-position-row label[data-v-4749834a]{display:flex;align-items:center;gap:5px;color:#8995ad;font-size:11px}.background-position-row input[data-v-4749834a]{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-4749834a]{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-4749834a]{min-width:0;accent-color:#675de0}.background-opacity-row b[data-v-4749834a]{color:#aeb8cc;font-size:10px;text-align:right;font-variant-numeric:tabular-nums}.help-btn[data-v-4749834a]{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-4749834a]:hover,.help-btn.on[data-v-4749834a]{border-color:#7774ff;background:#343b63;color:#fff}.zoom-pct[data-v-4749834a]{margin-left:0;font-variant-numeric:tabular-nums;color:#9aa;min-width:44px;text-align:center}.settings-btn[data-v-4749834a]{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-4749834a]:hover{border-color:#7774ff;background:#2b3a5c;color:#fff}.undo-btn[data-v-4749834a]{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-4749834a]:hover:not(:disabled){border-color:#7774ff;background:#2b3a5c;color:#fff}.undo-btn[data-v-4749834a]:disabled{opacity:.38;cursor:not-allowed}.settings-panel[data-v-1bba85d9]{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-1bba85d9]{display:flex;justify-content:space-between;align-items:center;font-weight:700;color:#cdf;margin-bottom:10px}.sp-section-title[data-v-1bba85d9]{margin:2px 0 8px;color:#8a93bb;font-size:11px}.sp-switch-row[data-v-1bba85d9]{display:flex;align-items:center;justify-content:space-between;gap:10px;color:#aab}.sp-switch-control[data-v-1bba85d9]{display:inline-flex;align-items:center;gap:7px}.sp-switch-control input[data-v-1bba85d9]{position:absolute;width:1px;height:1px;opacity:0;pointer-events:none}.sp-switch-ui[data-v-1bba85d9]{position:relative;width:34px;height:18px;border-radius:999px;background:#39445a;cursor:pointer;transition:background .16s ease}.sp-switch-ui[data-v-1bba85d9]: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-1bba85d9]{background:#655df0}.sp-switch-control input:checked+.sp-switch-ui[data-v-1bba85d9]:after{transform:translate(16px)}.sp-switch-control input:focus-visible+.sp-switch-ui[data-v-1bba85d9]{outline:2px solid #8b86ff;outline-offset:2px}.sp-switch-control b[data-v-1bba85d9]{min-width:24px;color:#8a93bb;font-size:11px;font-weight:500}.sp-cache-note[data-v-1bba85d9]{margin-top:10px;padding-top:9px;border-top:1px solid #2a2a3c;color:#647089;font-size:10px;text-align:center}.sp-divider[data-v-1bba85d9]{height:1px;margin:10px 0;background:#2a2a3c}.sp-close[data-v-1bba85d9]{background:#2e3a55;border:none;color:#cdf;border-radius:4px;width:18px;height:18px;cursor:pointer;font-size:11px}.sp-row[data-v-1bba85d9]{display:flex;align-items:center;gap:8px;margin:8px 0}.sp-row>span[data-v-1bba85d9]:first-child{width:76px;flex-shrink:0;color:#8a93bb}.sp-row input[type=range][data-v-1bba85d9]{flex:1;background:#1a1a28;accent-color:#3a5a8c}.sp-num[data-v-1bba85d9]{width:52px;background:#1a1a28;border:1px solid #2e2e44;border-radius:5px;color:#dde;font-size:12px;padding:2px 4px}.sp-undo-limit[data-v-1bba85d9]{margin-left:auto;width:64px;height:26px;box-sizing:border-box}.sp-colr[data-v-1bba85d9]{width:26px;height:22px;border:none;background:none;cursor:pointer}.sp-hex[data-v-1bba85d9]{font-size:11px;color:#889;font-variant-numeric:tabular-nums}.sp-chk[data-v-1bba85d9]{display:flex;align-items:center;gap:6px;margin:8px 0;color:#aab}.stage-wrap[data-v-769d4380]{position:relative;width:100%;height:100%;overflow:hidden}.stage-holder[data-v-769d4380]{width:100%;height:100%;cursor:grab;touch-action:none;background-color:#0e1219;outline:none}.stage-holder.grid[data-v-769d4380]{background:conic-gradient(#141a26 90deg,transparent 90deg 180deg,#141a26 180deg 270deg,#141a26 180deg 270deg,transparent 270deg);background-size:28px 28px}.stage-holder[data-v-769d4380]:active{cursor:grabbing}.hud[data-v-769d4380]{position:absolute;bottom:12px;left:12px;padding:8px 12px;background:#141420bf;border-radius:8px;font-size:12px;color:#a0a8cc}.hud-number[data-v-769d4380]{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-769d4380]{width:3ch}.hud-particle-count[data-v-769d4380]{width:7ch;text-align:left}.hud-tip[data-v-769d4380]{margin-left:12px;color:#5f6a8a;font-size:11px}b[data-v-769d4380]{color:#fc3}.config-management-body[data-v-cb52d3e0]{padding-bottom:2px}.config-toolbar[data-v-cb52d3e0]{display:grid;grid-template-columns:auto auto minmax(0,1fr);gap:6px;margin-bottom:10px}.config-toolbar button[data-v-cb52d3e0],.config-toolbar select[data-v-cb52d3e0]{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-cb52d3e0]{padding:0 9px;cursor:pointer}.config-toolbar button[data-v-cb52d3e0]:hover{border-color:#7169dc;background:#343d68;color:#fff}.config-toolbar select[data-v-cb52d3e0]{padding:0 7px;overflow:hidden;text-overflow:ellipsis}.config-toolbar select[data-v-cb52d3e0]:disabled{color:#68738a;background:#1b2130}.config-message[data-v-cb52d3e0]{margin:-4px 0 9px;color:#83b9a2;font-size:10px}.config-message.error[data-v-cb52d3e0]{color:#e8959e}.group[data-v-cb52d3e0]{border:1px solid #2a2a3c;border-radius:8px;margin-bottom:10px;overflow:hidden}.group-head[data-v-cb52d3e0]{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-cb52d3e0]:hover{background:#20202e}.group-body[data-v-cb52d3e0]{padding:8px 10px 12px}.caret[data-v-cb52d3e0]{display:inline-block;width:12px;color:#667;font-size:11px}.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}.spine-editor[data-v-3545b078]{display:grid;gap:10px;color:#c5cbe0}.editor-title[data-v-3545b078],.section-title[data-v-3545b078]{color:#dce2f5;font-weight:700}.editor-title[data-v-3545b078]{padding-bottom:9px;border-bottom:1px solid #30394d}.grid[data-v-3545b078]{display:grid;gap:8px}.grid.three[data-v-3545b078]{grid-template-columns:repeat(3,minmax(0,1fr))}.field[data-v-3545b078]{display:grid;gap:5px;min-width:0;color:#919bb7;font-size:12px}.field input[data-v-3545b078],.field select[data-v-3545b078],.asset-name[data-v-3545b078]{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-3545b078]{height:1px;background:#30394d;margin:2px 0}.asset-row[data-v-3545b078]{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px}.asset-name[data-v-3545b078]{display:flex;align-items:center;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;color:#7f8aa7}button[data-v-3545b078]{height:35px;padding:0 13px;border:1px solid #3b4a67;border-radius:6px;background:#33415b;color:#e2e6f3;cursor:pointer}button[data-v-3545b078]:hover{filter:brightness(1.13)}button[data-v-3545b078]:disabled{opacity:.55;cursor:wait}.folder-select[data-v-3545b078]{width:100%;border-color:#6659c7;background:#4940a8;color:#fff}.folder-hint[data-v-3545b078]{margin-top:-5px;color:#69758e;font-size:10px;line-height:1.45}.asset-actions[data-v-3545b078]{display:grid;grid-template-columns:1fr 1fr;gap:5px}.asset-actions .load[data-v-3545b078]{background:#5543df;border-color:#6959ec}.asset-actions .clear[data-v-3545b078]{background:#702b34;border-color:#803842}.runtime-note[data-v-3545b078]{color:#69758e;font-size:11px;text-align:center}.error[data-v-3545b078]{padding:8px 10px;color:#ffabb2;background:#4b2028;border:1px solid #76323e;border-radius:6px;font-size:12px}.section-box[data-v-3545b078]{display:grid;gap:8px;padding:10px;background:#182132;border:1px solid #303c54;border-radius:7px}.empty[data-v-3545b078]{color:#667187;font-size:12px;padding:5px 0}.bone-tree[data-v-3545b078]{max-height:240px;overflow:auto;padding:4px 0;background:#111827;border-radius:5px}.tree-title-row[data-v-3545b078]{display:flex;align-items:center;justify-content:space-between;gap:8px}.tree-tabs[data-v-3545b078]{display:flex;gap:3px;margin:6px 0}.tree-tabs button[data-v-3545b078]{height:24px;padding:0 8px;border:1px solid transparent;border-radius:5px;background:transparent;color:#8d98ae;font-size:10px;cursor:pointer}.tree-tabs button[data-v-3545b078]:hover{background:#273246}.tree-tabs button.on[data-v-3545b078]{border-color:#7774ff;background:#35336b;color:#fff}.selected-bone[data-v-3545b078]{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-3545b078]{color:#aeb9d4;background:#242f44;border-color:#35445e;cursor:pointer}.selected-bone.active[data-v-3545b078]:hover{border-color:#675ec4;background:#302b57}.selected-bone[data-v-3545b078]:disabled{opacity:1;cursor:default}.selected-bone strong[data-v-3545b078]{color:#c5cde3;font-weight:600}.tree-action[data-v-3545b078]{height:24px;padding:0 8px;color:#9aa7c2;background:#242f44;border-color:#35445e;font-size:10px}.bone-search[data-v-3545b078]{position:relative}.bone-search input[data-v-3545b078]{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-3545b078]:focus{border-color:#7065df;box-shadow:0 0 0 1px #7065df38}.bone-search button[data-v-3545b078]{position:absolute;top:3px;right:3px;width:24px;height:24px;padding:0;border:0;color:#8d98b0;background:transparent}.bone[data-v-3545b078]{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-3545b078]:hover{background:#45567e38}.bone.selected[data-v-3545b078]{color:#f0edff;background:#6b53dd52;box-shadow:inset 2px 0 #8e72ff}.bone[data-v-3545b078]:focus-visible{box-shadow:inset 0 0 0 1px #7d72dd}.bone-toggle[data-v-3545b078]{width:22px;height:22px;padding:0;border:0;background:transparent;color:#9aa7c2}.bone-toggle[data-v-3545b078]:hover{background:#26324a}.bone-leaf[data-v-3545b078]{display:inline-flex;width:22px;justify-content:center;color:#58647d}.bone-name[data-v-3545b078]{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.slot-row[data-v-3545b078]{padding-right:8px}.slot-order[data-v-3545b078]{width:24px;flex:0 0 24px;color:#66758e;font-size:10px;font-variant-numeric:tabular-nums;text-align:right}.slot-attachment[data-v-3545b078]{margin-left:auto;max-width:45%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#6d7c96;font-size:10px}@media(max-width:430px){.grid.three[data-v-3545b078]{grid-template-columns:1fr}}.panel[data-v-55dcf3b2]{display:flex;width:100%;height:100%;flex-direction:column;overflow:hidden;background:#14141f;border-left:1px solid #2a2a3c;padding:12px;box-sizing:border-box}.empty[data-v-55dcf3b2],.panel-hint[data-v-55dcf3b2]{color:#667;font-size:12px;padding:8px 0}.group[data-v-55dcf3b2]{border:1px solid #2a2a3c;border-radius:8px;margin-bottom:10px;overflow:hidden}.group-head[data-v-55dcf3b2]{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-55dcf3b2]:hover{background:#20202e}.scene-head[data-v-55dcf3b2]{padding-right:6px}.scene-actions[data-v-55dcf3b2]{margin-left:auto;display:flex;align-items:center;gap:4px}.scene-add[data-v-55dcf3b2]{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-55dcf3b2]:hover{border-color:#7774ff;background:#45426f;color:#fff}.scene-add[data-v-55dcf3b2]:disabled{opacity:.42;cursor:not-allowed;border-color:#343a4b;background:#252a38;color:#778095}.group-body[data-v-55dcf3b2]{padding:8px 10px 12px}.caret[data-v-55dcf3b2]{display:inline-block;width:12px;color:#667;font-size:11px}.tree[data-v-55dcf3b2]{margin-bottom:8px}.tree-item[data-v-55dcf3b2]{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-55dcf3b2]{background:#26324a;color:#ffe}.tree-item .tdot[data-v-55dcf3b2]{color:#fc3;font-size:10px}.tree-item .tdot.dim[data-v-55dcf3b2]{color:#556}.tree-item .tdot.collision-dot[data-v-55dcf3b2]{color:#ff7070}.tree-item .tdot.path-dot[data-v-55dcf3b2]{color:#ff933e;font-size:14px}.tree-item .tdot.spine-dot[data-v-55dcf3b2]{color:#c08cff;font-size:11px}.tree-item .sub-branch[data-v-55dcf3b2]{color:#5f7090;font-size:12px}.tree-item .tlabel[data-v-55dcf3b2]{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.scene-tree[data-v-55dcf3b2]{padding-bottom:8px;border-bottom:1px solid #2a2a3c}.scene-object-item[data-v-55dcf3b2]{min-height:28px;cursor:pointer}.scene-object-item[data-v-55dcf3b2]:hover{background:#202b40}.scene-object-child[data-v-55dcf3b2]{background:#1e2a3e59}.scene-object-kind[data-v-55dcf3b2]{color:#75829c;font-size:10px}.scene-object-kind.sub-emitter-kind[data-v-55dcf3b2]{color:#8f8cff}.scene-object-eye[data-v-55dcf3b2]{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-55dcf3b2]:hover{border-color:#4b5972;background:#29354a;color:#e1e7f4}.scene-object-eye.off[data-v-55dcf3b2]{color:#59647a}.scene-object-eye svg[data-v-55dcf3b2]{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-55dcf3b2]{stroke:#d47b88;stroke-width:2}.scene-object-delete[data-v-55dcf3b2]{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-55dcf3b2]:hover{border-color:#a45c69;background:#57303a;color:#fff}.object-editor-title[data-v-55dcf3b2]{margin:10px 0 8px;padding-top:8px;border-top:1px solid #2a2a3c;color:#cbd4e8;font-weight:700}.field-block[data-v-55dcf3b2]{display:flex;flex-direction:column;gap:5px;margin:10px 0;color:#8f9ab3;font-size:11px}.field-block>.inp[data-v-55dcf3b2]{width:100%;box-sizing:border-box;min-height:30px}.field-block small[data-v-55dcf3b2]{color:#5f6d86;line-height:1.5}.field-grid[data-v-55dcf3b2]{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px;align-items:end}.compact-field[data-v-55dcf3b2]{display:flex;min-width:0;flex-direction:column;gap:5px;margin:5px 0;color:#8f9ab3;font-size:11px}.compact-field .inp[data-v-55dcf3b2]{width:100%;min-height:30px;box-sizing:border-box}.check-field[data-v-55dcf3b2]{align-items:flex-start}.check-field input[data-v-55dcf3b2]{width:18px;height:18px;margin:4px 0;accent-color:#4f7ee8}.follow-path[data-v-55dcf3b2],.setting-line[data-v-55dcf3b2]{display:flex;align-items:center;gap:8px;margin:12px 0 4px;color:#aeb8cf;font-size:12px}.setting-line[data-v-55dcf3b2]{justify-content:space-between}.follow-path input[data-v-55dcf3b2],.setting-line input[type=checkbox][data-v-55dcf3b2]{width:17px;height:17px;accent-color:#4f7ee8}.collider-follow-section[data-v-55dcf3b2]{margin-top:12px;padding-top:4px;border-top:1px solid #30394d}.collider-curve-title[data-v-55dcf3b2]{display:flex;flex-direction:column;gap:3px;margin:12px 0 6px;color:#aeb8cf;font-size:12px}.collider-curve-title small[data-v-55dcf3b2]{color:#67738c;font-size:10px;line-height:1.45}.path-color[data-v-55dcf3b2]{width:48px;height:28px;padding:0;border:1px solid #3a4963;background:transparent;cursor:pointer}.path-help[data-v-55dcf3b2]{margin:12px 0;color:#7d89a2;font-size:11px;line-height:1.55}.path-help>span[data-v-55dcf3b2]{color:#aeb8cf}.path-help ul[data-v-55dcf3b2]{margin:6px 0 0;padding-left:20px}.path-help li[data-v-55dcf3b2]{margin:3px 0}.path-action[data-v-55dcf3b2]{width:100%;height:31px;margin-top:7px;border:0;border-radius:5px;background:#33425b;color:#c9d1e1;cursor:pointer}.path-action[data-v-55dcf3b2]:hover{filter:brightness(1.12)}.path-action.primary[data-v-55dcf3b2]{background:#f05408;color:#fff}.row[data-v-55dcf3b2]{display:flex;align-items:center;gap:8px;margin:6px 0;font-size:12px;color:#aab}.row>span[data-v-55dcf3b2]:first-child{width:60px;flex-shrink:0;color:#8a93bb}.inp[data-v-55dcf3b2]{flex:1;min-width:0;padding:3px 5px;background:#1a1a28;border:1px solid #2e2e44;border-radius:5px;color:#dde;font-size:12px}.inp.tiny[data-v-55dcf3b2]{width:46px;flex:0 0 46px;text-align:center}.seed-row[data-v-55dcf3b2]{display:flex;align-items:center;gap:8px;margin-top:12px;padding-top:12px;border-top:1px solid #2d3950}.seed-row label[data-v-55dcf3b2]{width:64px;color:#8f9bb5;font-size:12px}.seed-input[data-v-55dcf3b2]{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-55dcf3b2]:focus{border-color:#625ff1}.seed-random[data-v-55dcf3b2]{width:34px;height:30px;border:1px solid #3a4860;border-radius:6px;background:#2c3950;color:#d7def0;cursor:pointer}.seed-random[data-v-55dcf3b2]:hover{background:#394964}.scene-seed[data-v-55dcf3b2]{margin-top:10px}.seed-hint[data-v-55dcf3b2]{margin:5px 0 1px 72px;color:#657188;font-size:9px;line-height:1.45}.group[data-v-f9eac627]{border:1px solid #2a2a3c;border-radius:8px;margin-bottom:10px;overflow:hidden}.group-head[data-v-f9eac627]{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-f9eac627]:hover{background:#20202e}.group-reset[data-v-f9eac627]{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-f9eac627]:hover{border-color:#7774ff;background:#45426f;color:#fff}.group-body[data-v-f9eac627]{padding:8px 10px 12px}.caret[data-v-f9eac627]{display:inline-block;width:12px;color:#667;font-size:11px}.divider[data-v-f9eac627]{height:1px;background:#2a2a3c;margin:8px 0}.row[data-v-f9eac627]{display:flex;align-items:center;gap:8px;margin:6px 0;font-size:12px;color:#aab}.row>span[data-v-f9eac627]:first-child{width:60px;flex-shrink:0;color:#8a93bb}.inp[data-v-f9eac627]{flex:1;min-width:0;padding:3px 5px;background:#1a1a28;border:1px solid #2e2e44;border-radius:5px;color:#dde;font-size:12px}.segs[data-v-f9eac627]{display:flex;gap:6px;margin:6px 0}.stream-behavior-segs[data-v-f9eac627]{margin-top:10px}.stream-loop-options[data-v-f9eac627]{display:grid;gap:8px;margin:8px 0 4px;padding:9px 10px;border:1px solid #32405a;border-radius:6px;background:#171f2e}.loop-section-row[data-v-f9eac627]{display:flex;min-height:27px;align-items:center;justify-content:space-between;gap:8px}.loop-duration-control[data-v-f9eac627]{display:flex;flex:0 0 auto;align-items:center;gap:7px}.loop-duration-toggle[data-v-f9eac627]{gap:5px;font-size:10px;white-space:nowrap}.loop-duration-toggle .switch-ui[data-v-f9eac627]{width:26px;height:14px}.loop-duration-toggle .switch-ui[data-v-f9eac627]:after{width:10px;height:10px}.loop-duration-toggle input:checked+.switch-ui[data-v-f9eac627]:after{transform:translate(12px)}.loop-section-duration[data-v-f9eac627]{display:flex;flex:0 0 auto;align-items:center;gap:4px;color:#7f8ba4;font-size:11px}.loop-section-duration input[data-v-f9eac627]{position:static;width:54px;height:25px;padding:0 6px;border:1px solid #3a465f;border-radius:5px;outline:none;background:#101725;color:#e4e8f2;text-align:right;opacity:1;pointer-events:auto}.loop-section-duration input[data-v-f9eac627]:focus{border-color:#716eff}.loop-auto-duration[data-v-f9eac627]{min-width:54px;color:#77839a;text-align:right;white-space:nowrap}.seg[data-v-f9eac627]{flex:1;padding:5px;background:#1e1e2e;border:1px solid #2e2e44;border-radius:6px;color:#aab;font-size:12px;cursor:pointer}.seg.on[data-v-f9eac627]{background:#3a5a8c;color:#fff;border-color:#5a7ab8}.seg[data-v-f9eac627]{display:flex;gap:6px;margin:6px 0}.inp.tiny[data-v-f9eac627]{width:46px;flex:0 0 46px;text-align:center}.switch-row[data-v-f9eac627]{display:flex;align-items:center;gap:9px;color:#b8c1d5;font-size:12px;cursor:pointer}.switch-row input[data-v-f9eac627]{position:absolute;opacity:0;pointer-events:none}.switch-ui[data-v-f9eac627]{position:relative;width:32px;height:18px;border-radius:10px;background:#354258;transition:background .16s ease}.switch-ui[data-v-f9eac627]: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-f9eac627]{background:#625ff1}.switch-row input:checked+.switch-ui[data-v-f9eac627]:after{transform:translate(14px)}.modifier-hint[data-v-f9eac627]{margin:7px 0 0 2px;color:#647086;font-size:9px;line-height:1.5}.stream-loop-hint[data-v-f9eac627]{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-f9eac627]{opacity:.45;cursor:not-allowed}.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}.group[data-v-cf6b86a5]{border:1px solid #2a2a3c;border-radius:8px;margin-bottom:10px;overflow:hidden}.group-head[data-v-cf6b86a5]{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-cf6b86a5]:hover{background:#20202e}.group-reset[data-v-cf6b86a5]{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-cf6b86a5]:hover{border-color:#7774ff;background:#45426f;color:#fff}.group-body[data-v-cf6b86a5]{padding:8px 10px 12px}.caret[data-v-cf6b86a5]{display:inline-block;width:12px;color:#667;font-size:11px}.row[data-v-cf6b86a5]{display:flex;align-items:center;gap:8px;margin:6px 0;font-size:12px;color:#aab}.row>span[data-v-cf6b86a5]:first-child{width:60px;flex-shrink:0;color:#8a93bb}.attr-body[data-v-cf6b86a5]{padding:10px;background:#151b27}.attr-section-title[data-v-cf6b86a5]{margin:2px 0 8px;color:#9ca8c0;font-size:12px;font-weight:700}.attr-section-title.life-title[data-v-cf6b86a5]{margin-top:14px;padding-top:12px;border-top:1px solid #2d3950}.attr-axis-head[data-v-cf6b86a5]{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-cf6b86a5]{display:flex;gap:4px}.axis-mode[data-v-cf6b86a5]{padding:4px 8px;border:1px solid #344158;border-radius:5px;background:#273246;color:#aeb8cf;font-size:11px;cursor:pointer}.axis-mode.on[data-v-cf6b86a5]{border-color:#7774ff;background:#605df0;color:#fff}.life-item[data-v-cf6b86a5]{padding:9px 0;border-bottom:1px solid #2a3549}.switch-row[data-v-cf6b86a5]{display:flex;align-items:center;gap:9px;color:#b8c1d5;font-size:12px;cursor:pointer}.switch-row input[data-v-cf6b86a5]{position:absolute;opacity:0;pointer-events:none}.switch-ui[data-v-cf6b86a5]{position:relative;width:32px;height:18px;border-radius:10px;background:#354258;transition:background .16s ease}.switch-ui[data-v-cf6b86a5]: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-cf6b86a5]{background:#625ff1}.switch-row input:checked+.switch-ui[data-v-cf6b86a5]:after{transform:translate(14px)}.life-axis[data-v-cf6b86a5]{margin:9px 0 2px 42px}.switch-row input:disabled+.switch-ui[data-v-cf6b86a5]{opacity:.45;cursor:not-allowed}.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}.pivot-editor[data-v-1261b03a]{margin-top:8px;padding:8px;border:1px solid #2e3c55;border-radius:8px;background:#121a27}.pivot-toolbar[data-v-1261b03a]{display:flex;align-items:center;gap:7px;margin-bottom:7px}.pivot-hint[data-v-1261b03a]{flex:1;min-width:0;display:flex;align-items:center;gap:5px;color:#9aa8c4;font-size:10px;line-height:1.3}.pivot-hint-icon[data-v-1261b03a]{color:#8f8cff;font-size:13px}.pivot-zoom[data-v-1261b03a]{display:flex;align-items:center;gap:2px;padding:2px;border:1px solid #34435e;border-radius:6px;background:#182234}.pivot-zoom button[data-v-1261b03a]{width:20px;height:20px;padding:0;border:0;border-radius:4px;background:transparent;color:#a9b6d0;font-size:13px;cursor:pointer}.pivot-zoom button[data-v-1261b03a]:hover:not(:disabled){background:#2a3853;color:#fff}.pivot-zoom button[data-v-1261b03a]:disabled{opacity:.3;cursor:default}.pivot-zoom span[data-v-1261b03a]{min-width:36px;text-align:center;color:#c7d1e6;font-size:10px;font-variant-numeric:tabular-nums}.pivot-expand[data-v-1261b03a]{width:24px;height:24px;padding:0;border:1px solid #34435e;border-radius:6px;background:#182234;color:#a9b6d0;font-size:13px;cursor:pointer}.pivot-expand[data-v-1261b03a]:hover{border-color:#7774ff;color:#fff}.pivot-stage[data-v-1261b03a]{position:relative;display:flex;align-items:center;justify-content:center;width:100%;height:156px;overflow:hidden;border:1px solid #2f3d57;border-radius:8px;background-color:#10161f;background-image:linear-gradient(45deg,#1a2230 25%,transparent 25%),linear-gradient(-45deg,#1a2230 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#1a2230 75%),linear-gradient(-45deg,transparent 75%,#1a2230 75%);background-size:16px 16px;background-position:0 0,0 8px,8px -8px,-8px 0;touch-action:none;cursor:crosshair}.pivot-large .pivot-stage[data-v-1261b03a]{height:340px;background-size:22px 22px;background-position:0 0,0 11px,11px -11px,-11px 0}.pivot-stage.panning[data-v-1261b03a]{cursor:grabbing}.pivot-box[data-v-1261b03a]{position:relative;flex:0 0 auto}.pivot-box>img[data-v-1261b03a]{display:block;width:100%;height:100%;object-fit:fill;-webkit-user-select:none;user-select:none;pointer-events:none}.pivot-empty[data-v-1261b03a]{color:#4e5a70;font-size:12px}.pivot-cross[data-v-1261b03a]{position:absolute;pointer-events:none;background:#7e76ffbf;box-shadow:0 0 3px #7e76ff99}.pivot-cross.vertical[data-v-1261b03a]{top:0;bottom:0;width:1px;transform:translate(-.5px)}.pivot-cross.horizontal[data-v-1261b03a]{left:0;right:0;height:1px;transform:translateY(-.5px)}.pivot-marker[data-v-1261b03a]{position:absolute;width:13px;height:13px;transform:translate(-50%,-50%);border:2px solid #c9c6ff;border-radius:50%;background:#605ff0d9;box-shadow:0 0 0 3px #605ff047,0 0 10px #605ff0cc;pointer-events:none}.pivot-badge[data-v-1261b03a]{position:absolute;transform:translate(-50%,14px);padding:2px 6px;border:1px solid #6f6bc7;border-radius:4px;background:#191c3aeb;color:#b9b6ff;font-size:9px;white-space:nowrap;pointer-events:none}.pivot-bottom[data-v-1261b03a]{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px;margin-top:8px}.pivot-large .pivot-bottom[data-v-1261b03a]{gap:14px;margin-top:14px}.pivot-card[data-v-1261b03a]{min-width:0;padding:7px;border:1px solid #28344a;border-radius:8px;background:#151d2b}.pivot-card-head[data-v-1261b03a]{display:flex;align-items:center;justify-content:space-between;gap:5px;margin-bottom:6px;color:#b9c4da;font-size:10px}.pivot-card-icon[data-v-1261b03a]{color:#8f8cff}.pivot-presets[data-v-1261b03a]{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px}.pivot-preset[data-v-1261b03a]{height:30px;padding:0;border:1px solid #2f3d57;border-radius:5px;background:#1b2537;color:#aab6cf;font-size:16px;line-height:1;cursor:pointer}.pivot-preset[data-v-1261b03a]:hover{border-color:#5d5aa8;color:#d9d8ff}.pivot-preset.on[data-v-1261b03a]{border-color:#7774ff;background:#4a47b5;color:#fff}.pivot-reset[data-v-1261b03a]{display:block;width:100%;height:26px;margin-top:6px;padding:0 6px;border:1px solid #2f3d57;border-radius:5px;background:#1a2435;color:#96a4c0;font-size:10px;cursor:pointer;white-space:nowrap}.pivot-reset[data-v-1261b03a]:hover{border-color:#5d5aa8;background:#232f46;color:#d9d8ff}.pivot-coords[data-v-1261b03a]{display:flex;flex-direction:column;gap:5px}.pivot-large .pivot-coords[data-v-1261b03a]{flex-direction:row;gap:8px}.pivot-coords label[data-v-1261b03a]{flex:1;display:flex;align-items:center;gap:3px;color:#8d9ab5;font-size:10px}.pivot-coords input[data-v-1261b03a]{width:100%;min-width:0;height:24px;padding:0 4px;border:1px solid #34435e;border-radius:4px;background:#101827;color:#f0b465;font-size:11px;text-align:right}.pivot-rotate-head[data-v-1261b03a]{margin-top:10px}.pivot-rotate-state[data-v-1261b03a]{color:#6f7c96;font-size:9px}.pivot-rotate-body[data-v-1261b03a]{display:flex;align-items:center;gap:7px}.pivot-rotate-modes[data-v-1261b03a]{display:flex;flex-direction:column;gap:4px;flex:1}.pivot-rotate-modes button[data-v-1261b03a]{height:24px;padding:0 5px;border:1px solid #2f3d57;border-radius:5px;background:#1b2537;color:#93a0ba;font-size:9px;cursor:pointer}.pivot-rotate-modes button.on[data-v-1261b03a]{border-color:#7774ff;background:#4a47b5;color:#fff}.pivot-rotate-preview[data-v-1261b03a]{display:flex;align-items:center;justify-content:center;width:78px;height:78px;flex:0 0 78px;border:1px solid #2b374d;border-radius:6px;background:#10161f;overflow:hidden}.pivot-large .pivot-rotate-preview[data-v-1261b03a]{width:128px;height:128px;flex-basis:128px}.pivot-rotate-preview img[data-v-1261b03a]{display:block}.pivot-rotate-preview img.spin[data-v-1261b03a]{animation:pivot-spin-1261b03a 2s linear infinite}.pivot-rotate-preview img.swing[data-v-1261b03a]{animation:pivot-swing-1261b03a 1.1s ease-in-out infinite alternate}@keyframes pivot-spin-1261b03a{to{transform:rotate(360deg)}}@keyframes pivot-swing-1261b03a{0%{transform:rotate(-28deg)}to{transform:rotate(28deg)}}.pivot-large .pivot-hint[data-v-1261b03a],.pivot-large .pivot-card-head[data-v-1261b03a]{font-size:12px}.pivot-large .pivot-preset[data-v-1261b03a]{height:42px;font-size:20px}.pivot-large .pivot-reset[data-v-1261b03a]{height:34px;margin-top:8px;font-size:12px}.pivot-large .pivot-coords input[data-v-1261b03a]{height:34px;font-size:14px}.pivot-large .pivot-rotate-modes button[data-v-1261b03a]{height:34px;font-size:12px}.image-card[data-v-cb3a8e2c]{margin:8px 0;padding:9px;border:1px solid #2e3c55;border-radius:7px;background:#171d2a}.imgrow[data-v-cb3a8e2c]{display:flex;align-items:flex-start;gap:8px}.img-thumb[data-v-cb3a8e2c]{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-cb3a8e2c]:hover{border-color:#7774ff}.img-thumb img[data-v-cb3a8e2c]{display:block;width:100%;height:100%;object-fit:contain}.img-fields[data-v-cb3a8e2c]{flex:1;min-width:0}.img-actions[data-v-cb3a8e2c]{display:flex;flex-direction:column;gap:4px}.row[data-v-cb3a8e2c]{display:flex;align-items:center;gap:8px;margin:6px 0;color:#aab;font-size:12px}.row>span[data-v-cb3a8e2c]:first-child{width:60px;flex-shrink:0;color:#8a93bb}.inp[data-v-cb3a8e2c]{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-cb3a8e2c]{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-cb3a8e2c]:hover{background:#2b3a5c}.mini-btn2[data-v-cb3a8e2c]:disabled{opacity:.35;cursor:not-allowed}.thumb-note[data-v-cb3a8e2c]{margin:4px 0 2px;color:#667;font-size:11px}.sequence-pick[data-v-cb3a8e2c]{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-cb3a8e2c]:hover{border-color:#7774ff;background:#35336a}.sequence-note[data-v-cb3a8e2c]{margin:0 0 6px;color:#727b9b;font-size:11px;line-height:1.4}.resource-weight-row[data-v-cb3a8e2c]{display:grid;grid-template-columns:minmax(0,1fr) 28px;align-items:center;gap:7px}.resource-weight-control[data-v-cb3a8e2c]{width:100%;min-width:0}.resource-weight-control[data-v-cb3a8e2c] .ns-range{min-width:0}.resource-weight-control[data-v-cb3a8e2c] .ns-num{flex:0 0 56px;box-sizing:border-box}.weight-lock[data-v-cb3a8e2c]{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-cb3a8e2c]{display:block;width:100%;height:100%;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.weight-lock[data-v-cb3a8e2c]:hover:not(:disabled){border-color:#7774ff;color:#b8b6ff}.weight-lock.on[data-v-cb3a8e2c]{border-color:#7774ff;background:#514fd0;color:#fff}.weight-lock[data-v-cb3a8e2c]:disabled{opacity:.35;cursor:not-allowed}.pivot-toggle-row[data-v-cb3a8e2c]{display:flex;align-items:center;gap:9px;margin-top:9px;padding:8px 9px;border:1px solid #2c3a54;border-radius:8px;background:#131b28}.pivot-toggle-icon[data-v-cb3a8e2c]{display:flex;align-items:center;justify-content:center;width:32px;height:32px;flex:0 0 32px;border:1px solid #35435c;border-radius:7px;background:#1c2638;color:#8f8cff;font-size:17px}.pivot-toggle-text[data-v-cb3a8e2c]{flex:1;min-width:0}.pivot-toggle-title[data-v-cb3a8e2c]{color:#d6deee;font-size:12px;font-weight:600}.pivot-toggle-sub[data-v-cb3a8e2c]{margin-top:2px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#7584a0;font-size:9px}.pivot-switch[data-v-cb3a8e2c]{position:relative;flex:0 0 auto;cursor:pointer}.pivot-switch input[data-v-cb3a8e2c]{position:absolute;opacity:0;pointer-events:none}.pivot-switch-ui[data-v-cb3a8e2c]{position:relative;display:block;width:34px;height:19px;border-radius:10px;background:#354258;transition:background .16s ease}.pivot-switch-ui[data-v-cb3a8e2c]:after{content:"";position:absolute;left:2px;top:2px;width:15px;height:15px;border-radius:50%;background:#fff;transition:transform .16s ease}.pivot-switch input:checked+.pivot-switch-ui[data-v-cb3a8e2c]{background:#625ff1}.pivot-switch input:checked+.pivot-switch-ui[data-v-cb3a8e2c]:after{transform:translate(15px)}.pivot-modal-backdrop[data-v-cb3a8e2c]{position:fixed;top:0;right:0;bottom:0;left:0;z-index:9999;display:flex;align-items:center;justify-content:center;padding:24px;background:#06090fc7;-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px)}.pivot-modal[data-v-cb3a8e2c]{display:flex;flex-direction:column;width:min(980px,94vw);max-height:92vh;overflow:auto;padding:14px;border:1px solid #2f3f5c;border-radius:14px;background:#121927;box-shadow:0 24px 70px #0009}.pivot-modal-head[data-v-cb3a8e2c]{display:flex;align-items:flex-start;gap:10px;padding-bottom:10px;border-bottom:1px solid #253148}.pivot-modal-icon[data-v-cb3a8e2c]{display:flex;align-items:center;justify-content:center;width:34px;height:34px;flex:0 0 34px;border:1px solid #3b4a66;border-radius:8px;background:#1c2638;color:#8f8cff;font-size:18px}.pivot-modal-info[data-v-cb3a8e2c]{flex:1;min-width:0}.pivot-modal-title[data-v-cb3a8e2c]{display:flex;align-items:center;gap:7px;color:#e4e9f5;font-size:15px;font-weight:700}.pivot-modal-badge[data-v-cb3a8e2c]{padding:2px 7px;border:1px solid #4b4a8f;border-radius:999px;background:#2c2b58;color:#b9b6ff;font-size:10px;font-weight:500}.pivot-modal-desc[data-v-cb3a8e2c]{margin-top:3px;color:#7f8daa;font-size:11px}.pivot-modal-close[data-v-cb3a8e2c]{width:28px;height:28px;padding:0;border:0;border-radius:6px;background:transparent;color:#8b98b3;font-size:15px;cursor:pointer}.pivot-modal-close[data-v-cb3a8e2c]:hover{background:#253148;color:#fff}.pivot-modal-hint[data-v-cb3a8e2c]{margin:10px 0 0;color:#8b98b3;font-size:11px}.pivot-modal-actions[data-v-cb3a8e2c]{display:flex;justify-content:flex-end;gap:8px;margin-top:12px;padding-top:10px;border-top:1px solid #253148}.pivot-modal-cancel[data-v-cb3a8e2c]{height:34px;padding:0 16px;border:1px solid #34435e;border-radius:7px;background:#1a2334;color:#a9b6d0;font-size:12px;cursor:pointer}.pivot-modal-cancel[data-v-cb3a8e2c]:hover{border-color:#5d5aa8;color:#fff}.pivot-modal-confirm[data-v-cb3a8e2c]{height:34px;padding:0 22px;border:1px solid #7774ff;border-radius:7px;background:#5b57e8;color:#fff;font-size:12px;font-weight:700;cursor:pointer}.pivot-modal-confirm[data-v-cb3a8e2c]:hover{background:#6a66ff}.group[data-v-5709815f]{border:1px solid #2a2a3c;border-radius:8px;margin-bottom:10px;overflow:hidden}.group-head[data-v-5709815f]{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-5709815f]:hover{background:#20202e}.group-reset[data-v-5709815f]{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-5709815f]:hover{border-color:#7774ff;background:#45426f;color:#fff}.group-body[data-v-5709815f]{padding:8px 10px 12px}.caret[data-v-5709815f]{display:inline-block;width:12px;color:#667;font-size:11px}.divider[data-v-5709815f]{height:1px;background:#2a2a3c;margin:8px 0}.row[data-v-5709815f]{display:flex;align-items:center;gap:8px;margin:6px 0;font-size:12px;color:#aab}.row>span[data-v-5709815f]:first-child{width:60px;flex-shrink:0;color:#8a93bb}.inp[data-v-5709815f]{flex:1;min-width:0;padding:3px 5px;background:#1a1a28;border:1px solid #2e2e44;border-radius:5px;color:#dde;font-size:12px}.colr[data-v-5709815f]{width:28px;height:22px;border:none;background:none;cursor:pointer}.seg[data-v-5709815f]{flex:1;padding:5px;background:#1e1e2e;border:1px solid #2e2e44;border-radius:6px;color:#aab;font-size:12px;cursor:pointer}.seg.on[data-v-5709815f]{background:#3a5a8c;color:#fff;border-color:#5a7ab8}.look-title[data-v-5709815f]{font-size:12px;font-weight:600;color:#ccd;margin:10px 0 6px;padding-bottom:4px;border-bottom:1px solid #2a2a3c}.look-title[data-v-5709815f]:first-child{margin-top:2px}.seg[data-v-5709815f]{display:flex;gap:6px;margin:6px 0}.seg-btn[data-v-5709815f]{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-5709815f]{background:#3a5a8c;color:#fff;border-color:#5a7ab8}.curve-wrap[data-v-5709815f]{margin:6px 0}.curve-labels[data-v-5709815f]{display:flex;justify-content:space-between;color:#566;font-size:10px;margin-top:2px}.image-title[data-v-5709815f]{display:flex;align-items:center;justify-content:space-between}.image-add[data-v-5709815f]{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-5709815f]:hover{background:#4542a8;color:#fff}.resource-divider[data-v-5709815f]{height:1px;margin:9px 0 7px;background:#2a3549}.resource-color-row .blend-select[data-v-5709815f]{max-width:88px}.resource-color-picker .hex[data-v-5709815f]{margin-left:0}.random-color-hint[data-v-5709815f]{margin:-5px 0 9px 68px;color:#66758e;font-size:9px;line-height:1.45}.hex-input[data-v-5709815f]{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-5709815f]:focus{border-color:#7774ff;color:#fff}.resource-alpha-head[data-v-5709815f]{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:10px;color:#8a93bb;font-size:12px}.alpha-modes[data-v-5709815f]{display:flex;gap:3px}.alpha-modes button[data-v-5709815f]{padding:4px 8px;border:1px solid transparent;border-radius:5px;background:transparent;color:#8d98ae;font-size:11px;cursor:pointer}.alpha-modes button[data-v-5709815f]:hover{background:#273246}.alpha-modes button.on[data-v-5709815f]{border-color:#7774ff;background:#605df0;color:#fff}.resource-alpha-curve[data-v-5709815f]{margin-top:7px}.file-input[data-v-5709815f]{display:none}.hex[data-v-5709815f]{font-size:11px;color:#889;margin-left:auto;font-variant-numeric:tabular-nums}.inp.tiny[data-v-5709815f]{width:46px;flex:0 0 46px;text-align:center}.render-layer-current[data-v-5709815f]{display:flex;align-items:center;gap:6px;margin:6px 0}.render-layer-text[data-v-5709815f]{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#9aa6c2;font-size:11px}.mini-btn[data-v-5709815f]{flex:0 0 auto;height:24px;padding:0 7px;border:1px solid #3d4a66;border-radius:5px;background:#202a3e;color:#a9b5cf;font-size:10px;cursor:pointer}.mini-btn[data-v-5709815f]:hover{border-color:#7774ff;color:#fff}.mini-btn.ghost[data-v-5709815f]{background:transparent}.slot-picker[data-v-5709815f]{margin:6px 0;padding:6px;border:1px solid #2e3a52;border-radius:6px;background:#111a28}.slot-list[data-v-5709815f]{max-height:180px;overflow:auto;margin-top:6px}.slot-item[data-v-5709815f]{display:flex;align-items:center;gap:6px;width:100%;padding:4px 6px;border:1px solid transparent;border-radius:4px;background:transparent;color:#aab4cc;font-size:11px;text-align:left;cursor:pointer}.slot-item[data-v-5709815f]:hover{background:#1d2a3f}.slot-item.on[data-v-5709815f]{border-color:#7774ff;background:#2b2b55;color:#fff}.slot-order[data-v-5709815f]{width:26px;flex:0 0 26px;color:#66758e;font-variant-numeric:tabular-nums}.slot-name[data-v-5709815f]{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.slot-attachment[data-v-5709815f]{max-width:45%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#6d7c96;font-size:10px}.switch-row[data-v-5709815f]{display:flex;align-items:center;gap:9px;color:#b8c1d5;font-size:12px;cursor:pointer}.switch-row input[data-v-5709815f]{position:absolute;opacity:0;pointer-events:none}.switch-ui[data-v-5709815f]{position:relative;width:32px;height:18px;border-radius:10px;background:#354258;transition:background .16s ease}.switch-ui[data-v-5709815f]: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-5709815f]{background:#625ff1}.switch-row input:checked+.switch-ui[data-v-5709815f]:after{transform:translate(14px)}.switch-row input:disabled+.switch-ui[data-v-5709815f]{opacity:.45;cursor:not-allowed}.render-layer-switch[data-v-5709815f]{margin:6px 0}.modifier-hint[data-v-5709815f]{margin:7px 0 0 2px;color:#647086;font-size:9px;line-height:1.5}.render-layer-warning[data-v-5709815f]{color:#d8a45e}.empty[data-v-affb8652]{color:#667;font-size:12px;padding:8px 0}.group[data-v-affb8652]{border:1px solid #2a2a3c;border-radius:8px;margin-bottom:10px;overflow:hidden}.group-head[data-v-affb8652]{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-affb8652]:hover{background:#20202e}.group-reset[data-v-affb8652]{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-affb8652]:hover{border-color:#7774ff;background:#45426f;color:#fff}.group-body[data-v-affb8652]{padding:8px 10px 12px}.caret[data-v-affb8652]{display:inline-block;width:12px;color:#667;font-size:11px}.divider[data-v-affb8652]{height:1px;background:#2a2a3c;margin:8px 0}.field-block[data-v-affb8652]{display:flex;flex-direction:column;gap:5px;margin:10px 0;color:#8f9ab3;font-size:11px}.field-block>.inp[data-v-affb8652]{width:100%;box-sizing:border-box;min-height:30px}.field-block small[data-v-affb8652]{color:#5f6d86;line-height:1.5}.field-grid[data-v-affb8652]{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px;align-items:end}.compact-field[data-v-affb8652]{display:flex;min-width:0;flex-direction:column;gap:5px;margin:5px 0;color:#8f9ab3;font-size:11px}.compact-field .inp[data-v-affb8652]{width:100%;min-height:30px;box-sizing:border-box}.tag[data-v-affb8652]{font-size:10px;color:#667;background:#1c1c2a;border-radius:4px;padding:1px 5px}.row[data-v-affb8652]{display:flex;align-items:center;gap:8px;margin:6px 0;font-size:12px;color:#aab}.row>span[data-v-affb8652]:first-child{width:60px;flex-shrink:0;color:#8a93bb}.inp[data-v-affb8652]{flex:1;min-width:0;padding:3px 5px;background:#1a1a28;border:1px solid #2e2e44;border-radius:5px;color:#dde;font-size:12px}.colr[data-v-affb8652]{width:28px;height:22px;border:none;background:none;cursor:pointer}.placeholder[data-v-affb8652]{color:#667;font-size:11px;padding:6px 0}.image-add[data-v-affb8652]{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-affb8652]:hover{background:#4542a8;color:#fff}.resource-divider[data-v-affb8652]{height:1px;margin:9px 0 7px;background:#2a3549}.hex-input[data-v-affb8652]{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-affb8652]:focus{border-color:#7774ff;color:#fff}.alpha-modes[data-v-affb8652]{display:flex;gap:3px}.alpha-modes button[data-v-affb8652]{padding:4px 8px;border:1px solid transparent;border-radius:5px;background:transparent;color:#8d98ae;font-size:11px;cursor:pointer}.alpha-modes button[data-v-affb8652]:hover{background:#273246}.alpha-modes button.on[data-v-affb8652]{border-color:#7774ff;background:#605df0;color:#fff}.file-input[data-v-affb8652]{display:none}.hex[data-v-affb8652]{font-size:11px;color:#889;margin-left:auto;font-variant-numeric:tabular-nums}.inp.tiny[data-v-affb8652]{width:46px;flex:0 0 46px;text-align:center}.axis-mode[data-v-affb8652]{padding:4px 8px;border:1px solid #344158;border-radius:5px;background:#273246;color:#aeb8cf;font-size:11px;cursor:pointer}.axis-mode.on[data-v-affb8652]{border-color:#7774ff;background:#605df0;color:#fff}.switch-row[data-v-affb8652]{display:flex;align-items:center;gap:9px;color:#b8c1d5;font-size:12px;cursor:pointer}.switch-row input[data-v-affb8652]{position:absolute;opacity:0;pointer-events:none}.switch-ui[data-v-affb8652]{position:relative;width:32px;height:18px;border-radius:10px;background:#354258;transition:background .16s ease}.switch-ui[data-v-affb8652]: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-affb8652]{background:#625ff1}.switch-row input:checked+.switch-ui[data-v-affb8652]:after{transform:translate(14px)}.modifier-item[data-v-affb8652]{padding:8px 0 10px;border-bottom:1px solid #2a3549}.events-item[data-v-affb8652]{margin-top:4px;padding-bottom:2px;border-bottom:0}.event-rules[data-v-affb8652]{display:flex;flex-direction:column;gap:7px;margin-top:8px}.event-card[data-v-affb8652]{padding:7px;border:1px solid #2b3a54;border-radius:7px;background:#121a28}.event-selects[data-v-affb8652]{display:flex;align-items:center;gap:5px}.event-selects .inp[data-v-affb8652]{height:26px;min-height:26px;box-sizing:border-box;font-size:11px}.event-select[data-v-affb8652]{flex:0 0 34%}.event-target[data-v-affb8652]{flex:1;min-width:0}.event-remove[data-v-affb8652]{width:24px;height:26px;flex:0 0 24px;padding:0;border:1px solid #3a465f;border-radius:5px;background:#1c2638;color:#8794ad;font-size:11px;cursor:pointer}.event-remove[data-v-affb8652]:hover{border-color:#a05260;background:#3a2230;color:#ffb3c0}.event-probability[data-v-affb8652]{display:flex;align-items:center;gap:8px;margin-top:6px;color:#8d9ab5;font-size:10px}.event-probability>span[data-v-affb8652]{flex:0 0 56px}.event-probability .inp[data-v-affb8652]{flex:1;height:26px;box-sizing:border-box;font-size:11px}.event-inherit[data-v-affb8652],.event-color-mode[data-v-affb8652]{margin-top:4px}.event-color-mode>span[data-v-affb8652]{flex:0 0 84px}.event-color-mode .inp[data-v-affb8652]{height:26px;min-height:26px;box-sizing:border-box;font-size:11px}.event-collision-limit>span[data-v-affb8652]{flex-basis:72px}.inherit-trigger[data-v-affb8652]{flex:1;min-width:0;height:26px;box-sizing:border-box;display:flex;align-items:center;justify-content:space-between;gap:6px;padding:0 7px;border:1px solid #34435e;border-radius:4px;background:#101827;color:#cdd6e8;font-size:11px;text-align:left;cursor:pointer}.inherit-trigger[data-v-affb8652]:hover{border-color:#5d5aa8}.inherit-summary[data-v-affb8652]{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.inherit-trigger i[data-v-affb8652]{color:#7f8db0;font-style:normal;font-size:10px}.inherit-menu[data-v-affb8652]{position:fixed;z-index:9999;padding:5px;border:1px solid #3b3f4a;border-radius:6px;background:#232427;box-shadow:0 12px 30px #0000008c}.inherit-option[data-v-affb8652]{display:flex;align-items:center;gap:6px;width:100%;height:26px;padding:0 7px;border:0;border-radius:4px;background:transparent;color:#c9ccd3;font-size:12px;text-align:left;cursor:pointer}.inherit-option[data-v-affb8652]:hover{background:#3a5a8c;color:#fff}.inherit-check[data-v-affb8652]{width:14px;flex:0 0 14px;color:#d8dbe2;font-size:12px}.inherit-divider[data-v-affb8652]{height:1px;margin:4px;background:#35373d}.event-add[data-v-affb8652]{height:28px;border:1px dashed #536079;border-radius:6px;background:transparent;color:#9aa7c2;font-size:11px;cursor:pointer}.event-add[data-v-affb8652]:hover{border-color:#7774ff;background:#232a45;color:#fff}.modifier-switch[data-v-affb8652]{font-weight:600}.modifier-params[data-v-affb8652]{margin:8px 0 0 10px;padding:2px 0 2px 10px;border-left:2px solid #344158}.modifier-hint[data-v-affb8652]{margin:7px 0 0 2px;color:#647086;font-size:9px;line-height:1.5}.collision-filter-params[data-v-affb8652]{position:relative;padding-top:5px;padding-bottom:5px}.collision-filter-title[data-v-affb8652]{margin-bottom:8px;color:#9ba7bd;font-size:11px;font-weight:600}.collision-filter-tags[data-v-affb8652]{display:flex;flex-wrap:wrap;align-items:center;gap:6px}.collision-filter-tag[data-v-affb8652]{display:inline-flex;min-width:0;align-items:center;gap:6px;padding:5px 5px 5px 8px;border:1px solid #625ff1;border-radius:6px;background:#514dcf;color:#fff;font-size:11px}.collision-filter-tag>span[data-v-affb8652]{max-width:150px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.collision-filter-tag.disabled[data-v-affb8652]{border-color:#4b5364;background:#343b4b;color:#929bad}.collision-filter-tag button[data-v-affb8652]{width:18px;height:18px;padding:0;border:0;border-radius:4px;background:#0b0f1a38;color:inherit;line-height:16px;cursor:pointer}.collision-filter-tag button[data-v-affb8652]:hover{background:#0b0f1a80;color:#fff}.collision-filter-add[data-v-affb8652]{width:30px;height:30px;padding:0;border:1px dashed #536079;border-radius:6px;background:#182131;color:#98a5bd;font-size:18px;line-height:28px;cursor:pointer}.collision-filter-add[data-v-affb8652]:hover,.collision-filter-add.active[data-v-affb8652]{border-color:#7774ff;background:#262c52;color:#fff}.collision-filter-add[data-v-affb8652]:disabled{opacity:.42;cursor:not-allowed}.collision-filter-empty[data-v-affb8652]{margin-top:7px;color:#6f7b91;font-size:10px}.collision-filter-picker[data-v-affb8652]{display:grid;gap:4px;margin-top:7px;padding:5px;border:1px solid #344158;border-radius:6px;background:#101725}.collision-filter-picker button[data-v-affb8652]{display:flex;min-width:0;align-items:center;justify-content:space-between;gap:8px;padding:6px 8px;border:0;border-radius:4px;background:transparent;color:#c7d0e3;font-size:11px;text-align:left;cursor:pointer}.collision-filter-picker button[data-v-affb8652]:hover{background:#29344a;color:#fff}.collision-filter-picker button span[data-v-affb8652]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.collision-filter-picker button small[data-v-affb8652]{flex:none;color:#68758d;font-size:9px}.switch-row input:disabled+.switch-ui[data-v-affb8652]{opacity:.45;cursor:not-allowed}.bone-follow-target[data-v-affb8652]{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-affb8652]{color:#c8d0e4;font-weight:600}.bone-follow-missing[data-v-affb8652]{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-affb8652]{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-affb8652]:hover{border-color:#7165bd;background:#3a335d;color:#fff}.bone-follow-transform-grid[data-v-affb8652]{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}.modifier-mode-row[data-v-affb8652]{display:flex;justify-content:flex-end;gap:4px;margin-bottom:6px}.gravity-curve-title[data-v-affb8652]{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-affb8652]:last-child{color:#657188;font-size:9px}.gravity-curve-axis[data-v-affb8652]{display:flex;justify-content:space-between;margin:3px 34px 0 1px;color:#5f6b82;font-size:9px}.gravity-params[data-v-affb8652] .ce-svg{height:96px;background:#0f1625;border-color:#30405a}.trail-params[data-v-affb8652]{padding-right:2px}.trail-section-title[data-v-affb8652]{margin:3px 0 8px;color:#aeb8cf;font-size:12px;font-weight:700}.trail-fixed-color .hex-input[data-v-affb8652]{min-width:0;flex:1}.trail-mode-head[data-v-affb8652]{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-affb8652]{margin:11px 0 7px;padding-top:9px;border-top:1px solid #2a3549}.trail-grid-row[data-v-affb8652]{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:8px}.trail-grid-row[data-v-affb8652] .ns{min-width:0;flex-wrap:wrap;align-items:center}.trail-grid-row[data-v-affb8652] .ns-label{width:100%}.trail-grid-row[data-v-affb8652] .ns-range{min-width:0}.trail-grid-row[data-v-affb8652] .ns-num{width:42px}.trail-params[data-v-affb8652] .ce-svg{height:92px;background:#0f1625;border-color:#30405a}.group[data-v-04462c7a]{border:1px solid #2a2a3c;border-radius:8px;margin-bottom:10px;overflow:hidden}.group-head[data-v-04462c7a]{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-04462c7a]:hover{background:#20202e}.group-reset[data-v-04462c7a]{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-04462c7a]:hover{border-color:#7774ff;background:#45426f;color:#fff}.group-body[data-v-04462c7a]{padding:8px 10px 12px}.caret[data-v-04462c7a]{display:inline-block;width:12px;color:#667;font-size:11px}.row[data-v-04462c7a]{display:flex;align-items:center;gap:8px;margin:6px 0;font-size:12px;color:#aab}.row>span[data-v-04462c7a]:first-child{width:60px;flex-shrink:0;color:#8a93bb}.inp[data-v-04462c7a]{flex:1;min-width:0;padding:3px 5px;background:#1a1a28;border:1px solid #2e2e44;border-radius:5px;color:#dde;font-size:12px}.placeholder[data-v-04462c7a]{color:#667;font-size:11px;padding:6px 0}.export-settings[data-v-04462c7a]{padding-top:3px}.export-field[data-v-04462c7a]{display:flex;flex-direction:column;gap:6px;margin:10px 0 13px;color:#9ca8bf;font-size:11px;font-weight:600}.export-input[data-v-04462c7a]{width:100%;min-height:34px;box-sizing:border-box;padding:6px 9px;color:#e3e7f2;background:#141a29;border-color:#35445f}.export-fps-row[data-v-04462c7a]{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:12px;align-items:end}.export-fps-field[data-v-04462c7a]{margin-bottom:5px}.export-checkbox[data-v-04462c7a]{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-04462c7a]{width:17px;height:17px;margin:0;accent-color:#625ff1}.export-help[data-v-04462c7a]{margin:-6px 0 14px;color:#66758e;font-size:10px;line-height:1.5}.export-switches[data-v-04462c7a]{display:grid;gap:13px;margin:4px 0 7px;padding-top:2px}.export-switch[data-v-04462c7a]{font-weight:600}.export-switch-last[data-v-04462c7a]{margin-top:13px}.inp.tiny[data-v-04462c7a]{width:46px;flex:0 0 46px;text-align:center}.switch-row[data-v-04462c7a]{display:flex;align-items:center;gap:9px;color:#b8c1d5;font-size:12px;cursor:pointer}.switch-row input[data-v-04462c7a]{position:absolute;opacity:0;pointer-events:none}.switch-ui[data-v-04462c7a]{position:relative;width:32px;height:18px;border-radius:10px;background:#354258;transition:background .16s ease}.switch-ui[data-v-04462c7a]: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-04462c7a]{background:#625ff1}.switch-row input:checked+.switch-ui[data-v-04462c7a]:after{transform:translate(14px)}.switch-row input:disabled+.switch-ui[data-v-04462c7a]{opacity:.45;cursor:not-allowed}.spine-export-actions[data-v-7ff40afe]{display:grid;grid-template-columns:1fr 1fr;gap:7px;margin-top:10px}.export-spine-json[data-v-7ff40afe]{width:100%;padding:9px 8px;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-7ff40afe]:hover{border-color:#7774ff;background:#514bc0}.export-spine-json[data-v-7ff40afe]:disabled{cursor:wait;opacity:.68}.export-spine-project[data-v-7ff40afe]{grid-column:1 / -1;width:100%;padding:7px 8px;border:1px solid #287d69;border-radius:7px;background:#196854;color:#edfff9;font-size:12px;font-weight:700;cursor:pointer;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px}.export-spine-project small[data-v-7ff40afe]{color:inherit;font-size:9px;font-weight:500;line-height:1.1}.export-spine-project[data-v-7ff40afe]:hover:not(:disabled){border-color:#47c89f;background:#238267}.export-spine-project[data-v-7ff40afe]:disabled{cursor:not-allowed;opacity:.48}.export-spine-images[data-v-7ff40afe]{width:100%;padding:8px;border:1px solid #3b5f8b;border-radius:7px;background:#243e64;color:#eaf3ff;font-size:12px;font-weight:700;cursor:pointer}.export-spine-images[data-v-7ff40afe]:hover:not(:disabled){border-color:#6099dc;background:#315581}.export-spine-images[data-v-7ff40afe]:disabled{cursor:wait;opacity:.55}.connector-status[data-v-7ff40afe]{display:flex;align-items:center;justify-content:center;gap:5px;padding-top:6px;color:#717b99;font-size:10px}.connector-status .connector-dot[data-v-7ff40afe]{width:6px;height:6px;border-radius:50%;background:#66718f}.connector-status.ready[data-v-7ff40afe]{color:#70d8ae}.connector-status.ready .connector-dot[data-v-7ff40afe]{background:#49c993;box-shadow:0 0 5px #49c99388}.connector-status.warning[data-v-7ff40afe]{color:#d4aa67}.connector-status.warning .connector-dot[data-v-7ff40afe]{background:#d4aa67}.connector-status button[data-v-7ff40afe]{padding:0 3px;border:0;background:transparent;color:#8290b6;font-size:10px;cursor:pointer}.connector-status button[data-v-7ff40afe]:hover{color:#c5caff}.connector-status a[data-v-7ff40afe]{padding:0 3px;color:#a8b0ff;font-size:10px;text-decoration:underline}.connector-status a[data-v-7ff40afe]:hover{color:#d8dcff}.export-message[data-v-7ff40afe]{padding:7px 5px 0;color:#70d8ae;font-size:10px;line-height:1.45;text-align:center}.export-message.error[data-v-7ff40afe]{color:#ff858f}.export-message a[data-v-7ff40afe]{display:inline-block;margin-left:5px;color:#9da7ff;text-decoration:underline}.panel[data-v-283ef8eb]{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-283ef8eb]{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-283ef8eb]::-webkit-scrollbar{width:6px}.panel-scroll[data-v-283ef8eb]::-webkit-scrollbar-track{background:transparent}.panel-scroll[data-v-283ef8eb]::-webkit-scrollbar-thumb{background:#2e2e44;border-radius:3px}.panel-scroll[data-v-283ef8eb]::-webkit-scrollbar-thumb:hover{background:#3a3a55}.panel-header[data-v-283ef8eb]{display:flex;justify-content:space-between;align-items:center;margin-bottom:10px;flex:0 0 auto;font-weight:700;color:#ccd}.timeline[data-v-6b4c353d]{height:100%;background:#12121c;border-top:1px solid #2a2a3c;display:flex;flex-direction:column;padding:6px 10px;gap:4px}.tl-controls[data-v-6b4c353d]{display:flex;align-items:center;gap:8px}.tl-btn[data-v-6b4c353d]{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-6b4c353d]{background:#3a5a8c;color:#fff;border-color:#5a7ab8}.tl-ab-loop[data-v-6b4c353d]{position:relative}.tl-ab-toggle[data-v-6b4c353d]{display:flex;height:26px;align-items:center;gap:7px;padding:0 7px;border:1px solid #343a51;border-radius:6px;background:#1e1e2e;color:#8f98ad;font-size:10px;cursor:pointer}.tl-ab-toggle.on[data-v-6b4c353d]{border-color:#716eff;background:#2e2d50;color:#eef}.tl-switch[data-v-6b4c353d]{position:relative;width:22px;height:12px;border-radius:99px;background:#343a4b}.tl-switch b[data-v-6b4c353d]{position:absolute;top:2px;left:2px;width:8px;height:8px;border-radius:50%;background:#8992a5;transition:transform .15s ease,background .15s ease}.tl-ab-toggle.on .tl-switch[data-v-6b4c353d]{background:#716eff}.tl-ab-toggle.on .tl-switch b[data-v-6b4c353d]{transform:translate(10px);background:#fff}.tl-ab-popover[data-v-6b4c353d]{position:absolute;z-index:40;left:0;bottom:calc(100% + 8px);display:flex;align-items:center;gap:10px;padding:9px 10px;border:1px solid #4b4c73;border-radius:8px;background:#171724;box-shadow:0 10px 26px #00000080}.tl-ab-title[data-v-6b4c353d]{color:#b7bdd2;font-size:10px;white-space:nowrap}.tl-range[data-v-6b4c353d]{display:flex;height:25px;align-items:center;gap:3px;color:#778198;font-size:10px}.tl-range input[data-v-6b4c353d]{width:43px;height:25px;padding:0 5px;box-sizing:border-box;border:1px solid #3a3a51;border-radius:5px;outline:none;background:#181824;color:#e1e4ed;font-size:11px;text-align:center}.tl-range input[data-v-6b4c353d]:focus{border-color:#716eff}.tl-frame[data-v-6b4c353d]{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-6b4c353d]{display:inline;color:inherit;font-weight:400}.tl-legend[data-v-6b4c353d]{display:flex;align-items:center;gap:4px;color:#778198;font-size:10px}.tl-legend i[data-v-6b4c353d]{display:inline-block;width:10px;height:7px;border-radius:2px}.legend-emission[data-v-6b4c353d]{margin-left:4px;background:#2f8b62}.legend-life[data-v-6b4c353d]{margin-left:5px;background:#a54551}.legend-spine[data-v-6b4c353d]{margin-left:5px;background:#7448b8}.tl-anim[data-v-6b4c353d]{display:flex;align-items:center;gap:6px;font-size:12px;color:#aab}.tl-owner-animation[data-v-6b4c353d]{position:relative}.tl-animation-trigger[data-v-6b4c353d]{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-6b4c353d]{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tl-animation-trigger>i[data-v-6b4c353d]{flex:0 0 auto;color:#8c96ad;font-style:normal}.tl-animation-trigger[data-v-6b4c353d]:disabled{opacity:.5;cursor:not-allowed}.tl-animation-menu[data-v-6b4c353d]{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-6b4c353d]{padding:2px 4px 6px;color:#77839c;font-size:10px}.tl-animation-option[data-v-6b4c353d]{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-6b4c353d]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tl-animation-option[data-v-6b4c353d]:hover{background:#252e42}.tl-animation-option.on[data-v-6b4c353d]{background:#34335d;color:#fff}.tl-animation-option>i[data-v-6b4c353d]{color:#8d8aff;font-style:normal}.tl-animation-editor[data-v-6b4c353d]{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-6b4c353d]{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-6b4c353d]:focus{border-color:#6865d8}.tl-animation-editor button[data-v-6b4c353d],.tl-animation-actions button[data-v-6b4c353d]{height:27px;padding:0 8px;border:1px solid #3c4861;border-radius:5px;background:#29344a;color:#cbd3e3;cursor:pointer}.tl-animation-actions[data-v-6b4c353d]{display:grid;grid-template-columns:1fr 1fr;gap:5px;margin-top:6px}.tl-animation-actions button[data-v-6b4c353d]:last-child{border-color:#5b3942;background:#3b282f;color:#e2a8b2}.tl-animation-actions button[data-v-6b4c353d]:disabled{opacity:.4;cursor:not-allowed}.tl-animation-error[data-v-6b4c353d]{margin-top:5px;color:#ef8997;font-size:10px}.tl-animation-hint[data-v-6b4c353d]{margin-top:5px;color:#69758d;font-size:9px;text-align:center}.tl-sel[data-v-6b4c353d]{background:#1a1a28;border:1px solid #2e2e44;color:#dde;border-radius:5px;padding:2px 6px;font-size:12px}.tl-sel[data-v-6b4c353d]:disabled{opacity:.5;cursor:not-allowed}.tl-spine-preview .tl-sel[data-v-6b4c353d]{max-width:190px}.tl-zoom[data-v-6b4c353d]{margin-left:auto;font-size:11px;color:#667}.tl-viewport[data-v-6b4c353d]{position:relative;flex:1;overflow:hidden;background:#0d0d14;border:1px solid #2a2a3c;border-radius:6px;cursor:ew-resize}.tl-ticks[data-v-6b4c353d]{position:absolute;top:0;left:0;right:0;height:18px}.tl-tickline[data-v-6b4c353d]{position:absolute;top:0;bottom:0;width:1px;background:#263040}.tl-ticklabel[data-v-6b4c353d]{position:absolute;top:2px;transform:translate(-50%);font-size:9px;color:#667}.tl-playhead[data-v-6b4c353d]{position:absolute;top:0;bottom:0;width:2px;background:#fc3;z-index:5;pointer-events:none}.tl-lanes[data-v-6b4c353d]{position:absolute;top:22px;left:0;right:0;bottom:0}.tl-lane[data-v-6b4c353d]{position:relative;height:26px;margin-bottom:4px}.lane-ico[data-v-6b4c353d]{position:absolute;left:4px;top:6px;font-size:11px;color:#dde;z-index:2;pointer-events:none}.lane-ico.sub-lane-ico[data-v-6b4c353d]{color:#7f8999}.lane-bar[data-v-6b4c353d]{position:absolute;top:4px;height:18px;display:flex;align-items:stretch;cursor:grab;box-sizing:border-box}.lane-bar[data-v-6b4c353d]:active{cursor:grabbing}.lane-name[data-v-6b4c353d]{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-6b4c353d]{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}.sub-emitter-bar .bar-life[data-v-6b4c353d]{border-color:#727d8f;background:#596274}.bar-life.loop-life[data-v-6b4c353d]{border-color:#667085;background:#242b39}.bar-emission[data-v-6b4c353d]{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-emission.bar-loop[data-v-6b4c353d]{border-radius:0}.bar-loop-transition[data-v-6b4c353d]{position:absolute;top:0;bottom:0;z-index:1;border:1px solid #7d8799;background:#50596a;box-sizing:border-box}.bar-loop-start[data-v-6b4c353d]{left:0;border-radius:5px 0 0 5px}.bar-loop-end[data-v-6b4c353d]{border-radius:0 5px 5px 0}.bar-handle[data-v-6b4c353d]{position:absolute;z-index:4;right:-4px;top:-1px;bottom:-1px;width:8px;cursor:ew-resize;background:#ffffff2e}.bar-handle[data-v-6b4c353d]:hover{background:#ffffff59}.spine-ico[data-v-6b4c353d]{color:#c08cff}.spine-bar[data-v-6b4c353d]{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-6b4c353d]:active{cursor:grabbing}.tl-empty[data-v-6b4c353d]{color:#667;font-size:11px;padding:8px}.transfer-overlay[data-v-592b922e]{position:fixed;z-index:2000;top:0;right:0;bottom:0;left:0;display:grid;place-items:center;pointer-events:auto;cursor:wait;overscroll-behavior:contain;background:#05080f42;-webkit-backdrop-filter:blur(1px);backdrop-filter:blur(1px)}.transfer-dialog[data-v-592b922e]{width:min(420px,calc(100vw - 40px));padding:18px 20px 16px;border:1px solid #414b66;border-radius:10px;box-shadow:0 18px 55px #00000075;background:#171d2b;color:#e7ebf5}.transfer-heading[data-v-592b922e]{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:12px;font-size:14px;font-weight:700}.transfer-heading strong[data-v-592b922e]{color:#a8a6ff;font-size:12px;font-variant-numeric:tabular-nums}.transfer-track[data-v-592b922e]{height:9px;overflow:hidden;border:1px solid #35415a;border-radius:999px;background:#0d1422}.transfer-bar[data-v-592b922e]{height:100%;border-radius:inherit;background:linear-gradient(90deg,#4d75e8,#7774ff);transition:width .16s ease}.transfer-track.indeterminate .transfer-bar[data-v-592b922e]{width:42%;animation:transfer-slide-592b922e 1s ease-in-out infinite}.transfer-detail[data-v-592b922e]{min-height:17px;margin-top:9px;color:#8895ae;font-size:11px;line-height:1.5}.transfer-dialog.failed[data-v-592b922e]{border-color:#754351}.transfer-dialog.failed .transfer-heading strong[data-v-592b922e],.transfer-dialog.failed .transfer-detail[data-v-592b922e]{color:#e99aa9}.transfer-dialog.failed .transfer-bar[data-v-592b922e]{background:#c85d70}.transfer-fade-enter-active[data-v-592b922e],.transfer-fade-leave-active[data-v-592b922e]{transition:opacity .16s ease}.transfer-fade-enter-from[data-v-592b922e],.transfer-fade-leave-to[data-v-592b922e]{opacity:0}@keyframes transfer-slide-592b922e{0%{transform:translate(-110%)}to{transform:translate(250%)}}.layout[data-v-42c4fa00]{display:flex;width:100%;height:100%;min-height:0;overflow:clip}.parameter-panel[data-v-42c4fa00]{flex-shrink:0;height:100%;min-height:0;overflow:clip}.resizer-col[data-v-42c4fa00]{width:5px;cursor:col-resize;background:#1c1c2a;border-left:1px solid #2a2a3c;border-right:1px solid #2a2a3c;flex-shrink:0}.resizer-col[data-v-42c4fa00]:hover{background:#3a5a8c}.right[data-v-42c4fa00]{flex:1;min-width:0;height:100%;min-height:0;overflow:clip;display:flex;flex-direction:column}.panel-right .right[data-v-42c4fa00]{order:1}.panel-right .resizer-col[data-v-42c4fa00]{order:2}.panel-right .parameter-panel[data-v-42c4fa00]{order:3}.stage-area[data-v-42c4fa00]{flex:1;min-height:0;overflow:clip}.resizer-row[data-v-42c4fa00]{height:4px;cursor:row-resize;background:#1c1c2a;border-top:1px solid #2a2a3c;border-bottom:1px solid #2a2a3c;flex-shrink:0}.resizer-row[data-v-42c4fa00]:hover{background:#3a5a8c}.timeline-area[data-v-42c4fa00]{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}html,body,#app{-webkit-user-select:none;user-select:none}input,textarea,select,[contenteditable=true]{-webkit-user-select:text;user-select:text}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-ChTSy5jk.js b/dist/assets/index-Ck8IwYQq.js similarity index 99% rename from dist/assets/index-ChTSy5jk.js rename to dist/assets/index-Ck8IwYQq.js index 7f0f89c..79f7439 100644 --- a/dist/assets/index-ChTSy5jk.js +++ b/dist/assets/index-Ck8IwYQq.js @@ -1,2 +1,2 @@ -var ft=Object.defineProperty;var gt=(W,t,e)=>t in W?ft(W,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):W[t]=e;var T=(W,t,e)=>gt(W,typeof t!="symbol"?t+"":t,e);import{f as ht,R as pt,N as dt,ac as ut,Z as mt,b4 as yt,O as rt,b5 as at,U as D,B as Tt}from"./index-Bjqx1iPW.js";import{$ as Rt,a0 as Yt,a1 as Ft,a2 as Et,y as _t,a3 as Ot,a4 as kt,a5 as Xt,a6 as Bt,a7 as Nt,a8 as Dt,a9 as $t,aa as zt,ab as Wt,ad as qt,H as Gt,ae as Jt,af as Ht,ag as Zt,ah as Kt,ai as Qt,aj as jt,ak as te,al as ee,am as se,an as ne,ao as ie,ap as oe,aq as re,ar as ae,as as le,at as ce,au as he,av as pe,aw as de,ax as ue,ay as fe,az as ge,aA as me,aB as ye,aC as Te,aD as be,aE as we,aF as xe,aG as Ae,aH as Pe,aI as Ie,aJ as Ce,aK as Ve,aL as Le,aM as Se,aN as Me,aO as ve,aP as Ue,aQ as Re,aR as Ye,aS as Fe,aT as Ee,x as _e,aU as Oe,aV as ke,aW as Xe,aX as Be,aY as Ne,aZ as De,a_ as $e,a$ as ze,b0 as We,b1 as qe,b2 as Ge,b3 as Je,b6 as He,b7 as Ze,b8 as Ke,b9 as Qe,ba as je,bb as ts,bc as es,bd as ss,be as ns,bf as is,bg as os,bh as rs,bi as as,bj as ls,bk as cs,bl as hs,bm as ps,bn as ds,bo as us,bp as fs,bq as gs,br as ms,bs as ys,bt as Ts,bu as bs,w as ws,X as xs,J as As,Y as Ps,z as Is,bv as Cs,bw as Vs,bx as Ls,by as Ss,bz as Ms,bA as vs,bB as Us,bC as Rs,bD as Ys,bE as Fs,bF as Es,bG as _s,T as Os,bH as ks,bI as Xs,b as Bs,bJ as Ns,c as Ds,bK as $s,bL as zs,bM as Ws,bN as qs,bO as Gs,bP as Js,bQ as Hs,bR as Zs,bS as Ks,bT as Qs,bU as js,bV as tn,bW as en,bX as sn,bY as nn,bZ as on,b_ as rn,V as an,b$ as ln,c0 as cn,c1 as hn,c2 as pn,c3 as dn}from"./index-Bjqx1iPW.js";class It{constructor(t){T(this,"skeletonData");T(this,"animationToMixTime",{});T(this,"defaultMix",0);if(!t)throw new Error("skeletonData cannot be null.");this.skeletonData=t}setMix(t,e,n){return typeof t=="string"?this.setMix1(t,e,n):this.setMix2(t,e,n)}setMix1(t,e,n){const s=this.skeletonData.findAnimation(t);if(!s)throw new Error(`Animation not found: ${t}`);const i=this.skeletonData.findAnimation(e);if(!i)throw new Error(`Animation not found: ${e}`);this.setMix2(s,i,n)}setMix2(t,e,n){if(!t)throw new Error("from cannot be null.");if(!e)throw new Error("to cannot be null.");const s=`${t.name}.${e.name}`;this.animationToMixTime[s]=n}getMix(t,e){const n=`${t.name}.${e.name}`,s=this.animationToMixTime[n];return s===void 0?this.defaultMix:s}}class Ct{constructor(t,e="",n=new bt,s=new lt){T(this,"textureLoader");T(this,"pathPrefix");T(this,"downloader");T(this,"cache");T(this,"errors",{});T(this,"toLoad",0);T(this,"loaded",0);T(this,"texturePmaInfo",{});this.textureLoader=t,this.pathPrefix=e,this.downloader=n,this.cache=s}start(t){return this.toLoad++,this.pathPrefix+t}success(t,e,n){this.toLoad--,this.loaded++,this.cache.assets[e]=n,this.cache.assetsRefCount[e]=(this.cache.assetsRefCount[e]||0)+1,t&&t(e,n)}error(t,e,n){this.toLoad--,this.loaded++,this.errors[e]=n,t&&t(e,n)}loadAll(){return new Promise((e,n)=>{const s=()=>{if(this.isLoadingComplete()){this.hasErrors()?n(this.errors):e(this);return}requestAnimationFrame(s)};requestAnimationFrame(s)})}setRawDataURI(t,e){this.downloader.rawDataUris[this.pathPrefix+t]=e}loadBinary(t,e=()=>{},n=()=>{}){t=this.start(t),!this.reuseAssets(t,e,n)&&(this.cache.assetsLoaded[t]=new Promise((s,i)=>{this.downloader.downloadBinary(t,o=>{this.success(e,t,o),s(o)},(o,r)=>{const l=`Couldn't load binary ${t}: status ${o}, ${r}`;this.error(n,t,l),i(l)})}))}loadText(t,e=()=>{},n=()=>{}){t=this.start(t),this.downloader.downloadText(t,s=>{this.success(e,t,s)},(s,i)=>{this.error(n,t,`Couldn't load text ${t}: status ${s}, ${i}`)})}loadJson(t,e=()=>{},n=()=>{}){t=this.start(t),!this.reuseAssets(t,e,n)&&(this.cache.assetsLoaded[t]=new Promise((s,i)=>{this.downloader.downloadJson(t,o=>{this.success(e,t,o),s(o)},(o,r)=>{const l=`Couldn't load JSON ${t}: status ${o}, ${r}`;this.error(n,t,l),i(l)})}))}reuseAssets(t,e=()=>{},n=()=>{}){const s=this.cache.getAsset(t),i=s!==void 0;return i&&(this.cache.assetsLoaded[t]=s.then(o=>(o=o instanceof Image||o instanceof ImageBitmap?this.textureLoader(o):o,this.success(e,t,o),o)).catch(o=>{this.error(n,t,o)})),i}loadTexture(t,e=()=>{},n=()=>{}){if(t=this.start(t),this.reuseAssets(t,e,n))return;const s=this.texturePmaInfo[t];this.cache.assetsLoaded[t]=new Promise((i,o)=>{if(!!!(typeof window<"u"&&typeof navigator<"u"&&window.document))fetch(t,{mode:"cors"}).then(c=>{if(c.ok)return c.blob();const a=`Couldn't load image: ${t}`;this.error(n,t,`Couldn't load image: ${t}`),o(a)}).then(c=>c?createImageBitmap(c,{premultiplyAlpha:"none",colorSpaceConversion:"none"}):null).then(c=>{if(c){const a=this.createTexture(t,s,c);this.success(e,t,a),i(a)}});else{const c=new Image;c.crossOrigin="anonymous",c.onload=()=>{const a=this.createTexture(t,s,c);this.success(e,t,a),i(a)},c.onerror=()=>{const a=`Couldn't load image: ${t}`;this.error(n,t,a),o(a)},this.downloader.rawDataUris[t]&&(t=this.downloader.rawDataUris[t]),c.src=t}})}loadTextureAtlas(t,e=()=>{},n=()=>{},s){const i=t.lastIndexOf("/"),o=i>=0?t.substring(0,i+1):"";t=this.start(t),!this.reuseAssets(t,e,n)&&(this.cache.assetsLoaded[t]=new Promise((r,l)=>{this.downloader.downloadText(t,c=>{try{const a=this.createTextureAtlas(c,o,t,s);let h=a.pages.length,m=!1;if(h===0){this.success(e,t,a),r(a);return}for(const y of a.pages)this.loadTexture(this.texturePath(o,y.name,s),(A,u)=>{m||(y.setTexture(u),--h===0&&(this.success(e,t,a),r(a)))},(A,u)=>{if(!m){const g=`Couldn't load texture ${t} page image: ${A}`;this.error(n,t,g),l(g)}m=!0})}catch(a){const h=`Couldn't parse texture atlas ${t}: ${a.message}`;this.error(n,t,h),l(h)}},(c,a)=>{const h=`Couldn't load texture atlas ${t}: status ${c}, ${a}`;this.error(n,t,h),l(h)})}))}loadTextureAtlasButNoTextures(t,e=()=>{},n=()=>{}){const s=t.lastIndexOf("/"),i=s>=0?t.substring(0,s+1):"";t=this.start(t),!this.reuseAssets(t,e,n)&&(this.cache.assetsLoaded[t]=new Promise((o,r)=>{this.downloader.downloadText(t,l=>{try{const c=this.createTextureAtlas(l,i,t);this.success(e,t,c),o(c)}catch(c){const a=`Couldn't parse texture atlas ${t}: ${c.message}`;this.error(n,t,a),r(a)}},(l,c)=>{const a=`Couldn't load texture atlas ${t}: status ${l}, ${c}`;this.error(n,t,a),r(a)})}))}async loadBinaryAsync(t){return new Promise((e,n)=>{this.loadBinary(t,(s,i)=>e(i),(s,i)=>n(i))})}async loadJsonAsync(t){return new Promise((e,n)=>{this.loadJson(t,(s,i)=>e(i),(s,i)=>n(i))})}async loadTextureAsync(t){return new Promise((e,n)=>{this.loadTexture(t,(s,i)=>e(i),(s,i)=>n(i))})}async loadTextureAtlasAsync(t){return new Promise((e,n)=>{this.loadTextureAtlas(t,(s,i)=>e(i),(s,i)=>n(i))})}async loadTextureAtlasButNoTexturesAsync(t){return new Promise((e,n)=>{this.loadTextureAtlasButNoTextures(t,(s,i)=>e(i),(s,i)=>n(i))})}setCache(t){this.cache=t}get(t){return this.cache.assets[this.pathPrefix+t]}require(t){t=this.pathPrefix+t;const e=this.cache.assets[t];if(e)return e;const n=this.errors[t];throw Error(`Asset not found: ${t}${n?` +var ft=Object.defineProperty;var gt=(W,t,e)=>t in W?ft(W,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):W[t]=e;var T=(W,t,e)=>gt(W,typeof t!="symbol"?t+"":t,e);import{f as ht,R as pt,N as dt,ac as ut,Z as mt,b4 as yt,O as rt,b5 as at,U as D,B as Tt}from"./index-DQ5rq6hP.js";import{$ as Rt,a0 as Yt,a1 as Ft,a2 as Et,y as _t,a3 as Ot,a4 as kt,a5 as Xt,a6 as Bt,a7 as Nt,a8 as Dt,a9 as $t,aa as zt,ab as Wt,ad as qt,H as Gt,ae as Jt,af as Ht,ag as Zt,ah as Kt,ai as Qt,aj as jt,ak as te,al as ee,am as se,an as ne,ao as ie,ap as oe,aq as re,ar as ae,as as le,at as ce,au as he,av as pe,aw as de,ax as ue,ay as fe,az as ge,aA as me,aB as ye,aC as Te,aD as be,aE as we,aF as xe,aG as Ae,aH as Pe,aI as Ie,aJ as Ce,aK as Ve,aL as Le,aM as Se,aN as Me,aO as ve,aP as Ue,aQ as Re,aR as Ye,aS as Fe,aT as Ee,x as _e,aU as Oe,aV as ke,aW as Xe,aX as Be,aY as Ne,aZ as De,a_ as $e,a$ as ze,b0 as We,b1 as qe,b2 as Ge,b3 as Je,b6 as He,b7 as Ze,b8 as Ke,b9 as Qe,ba as je,bb as ts,bc as es,bd as ss,be as ns,bf as is,bg as os,bh as rs,bi as as,bj as ls,bk as cs,bl as hs,bm as ps,bn as ds,bo as us,bp as fs,bq as gs,br as ms,bs as ys,bt as Ts,bu as bs,w as ws,X as xs,J as As,Y as Ps,z as Is,bv as Cs,bw as Vs,bx as Ls,by as Ss,bz as Ms,bA as vs,bB as Us,bC as Rs,bD as Ys,bE as Fs,bF as Es,bG as _s,T as Os,bH as ks,bI as Xs,b as Bs,bJ as Ns,c as Ds,bK as $s,bL as zs,bM as Ws,bN as qs,bO as Gs,bP as Js,bQ as Hs,bR as Zs,bS as Ks,bT as Qs,bU as js,bV as tn,bW as en,bX as sn,bY as nn,bZ as on,b_ as rn,V as an,b$ as ln,c0 as cn,c1 as hn,c2 as pn,c3 as dn}from"./index-DQ5rq6hP.js";class It{constructor(t){T(this,"skeletonData");T(this,"animationToMixTime",{});T(this,"defaultMix",0);if(!t)throw new Error("skeletonData cannot be null.");this.skeletonData=t}setMix(t,e,n){return typeof t=="string"?this.setMix1(t,e,n):this.setMix2(t,e,n)}setMix1(t,e,n){const s=this.skeletonData.findAnimation(t);if(!s)throw new Error(`Animation not found: ${t}`);const i=this.skeletonData.findAnimation(e);if(!i)throw new Error(`Animation not found: ${e}`);this.setMix2(s,i,n)}setMix2(t,e,n){if(!t)throw new Error("from cannot be null.");if(!e)throw new Error("to cannot be null.");const s=`${t.name}.${e.name}`;this.animationToMixTime[s]=n}getMix(t,e){const n=`${t.name}.${e.name}`,s=this.animationToMixTime[n];return s===void 0?this.defaultMix:s}}class Ct{constructor(t,e="",n=new bt,s=new lt){T(this,"textureLoader");T(this,"pathPrefix");T(this,"downloader");T(this,"cache");T(this,"errors",{});T(this,"toLoad",0);T(this,"loaded",0);T(this,"texturePmaInfo",{});this.textureLoader=t,this.pathPrefix=e,this.downloader=n,this.cache=s}start(t){return this.toLoad++,this.pathPrefix+t}success(t,e,n){this.toLoad--,this.loaded++,this.cache.assets[e]=n,this.cache.assetsRefCount[e]=(this.cache.assetsRefCount[e]||0)+1,t&&t(e,n)}error(t,e,n){this.toLoad--,this.loaded++,this.errors[e]=n,t&&t(e,n)}loadAll(){return new Promise((e,n)=>{const s=()=>{if(this.isLoadingComplete()){this.hasErrors()?n(this.errors):e(this);return}requestAnimationFrame(s)};requestAnimationFrame(s)})}setRawDataURI(t,e){this.downloader.rawDataUris[this.pathPrefix+t]=e}loadBinary(t,e=()=>{},n=()=>{}){t=this.start(t),!this.reuseAssets(t,e,n)&&(this.cache.assetsLoaded[t]=new Promise((s,i)=>{this.downloader.downloadBinary(t,o=>{this.success(e,t,o),s(o)},(o,r)=>{const l=`Couldn't load binary ${t}: status ${o}, ${r}`;this.error(n,t,l),i(l)})}))}loadText(t,e=()=>{},n=()=>{}){t=this.start(t),this.downloader.downloadText(t,s=>{this.success(e,t,s)},(s,i)=>{this.error(n,t,`Couldn't load text ${t}: status ${s}, ${i}`)})}loadJson(t,e=()=>{},n=()=>{}){t=this.start(t),!this.reuseAssets(t,e,n)&&(this.cache.assetsLoaded[t]=new Promise((s,i)=>{this.downloader.downloadJson(t,o=>{this.success(e,t,o),s(o)},(o,r)=>{const l=`Couldn't load JSON ${t}: status ${o}, ${r}`;this.error(n,t,l),i(l)})}))}reuseAssets(t,e=()=>{},n=()=>{}){const s=this.cache.getAsset(t),i=s!==void 0;return i&&(this.cache.assetsLoaded[t]=s.then(o=>(o=o instanceof Image||o instanceof ImageBitmap?this.textureLoader(o):o,this.success(e,t,o),o)).catch(o=>{this.error(n,t,o)})),i}loadTexture(t,e=()=>{},n=()=>{}){if(t=this.start(t),this.reuseAssets(t,e,n))return;const s=this.texturePmaInfo[t];this.cache.assetsLoaded[t]=new Promise((i,o)=>{if(!!!(typeof window<"u"&&typeof navigator<"u"&&window.document))fetch(t,{mode:"cors"}).then(c=>{if(c.ok)return c.blob();const a=`Couldn't load image: ${t}`;this.error(n,t,`Couldn't load image: ${t}`),o(a)}).then(c=>c?createImageBitmap(c,{premultiplyAlpha:"none",colorSpaceConversion:"none"}):null).then(c=>{if(c){const a=this.createTexture(t,s,c);this.success(e,t,a),i(a)}});else{const c=new Image;c.crossOrigin="anonymous",c.onload=()=>{const a=this.createTexture(t,s,c);this.success(e,t,a),i(a)},c.onerror=()=>{const a=`Couldn't load image: ${t}`;this.error(n,t,a),o(a)},this.downloader.rawDataUris[t]&&(t=this.downloader.rawDataUris[t]),c.src=t}})}loadTextureAtlas(t,e=()=>{},n=()=>{},s){const i=t.lastIndexOf("/"),o=i>=0?t.substring(0,i+1):"";t=this.start(t),!this.reuseAssets(t,e,n)&&(this.cache.assetsLoaded[t]=new Promise((r,l)=>{this.downloader.downloadText(t,c=>{try{const a=this.createTextureAtlas(c,o,t,s);let h=a.pages.length,m=!1;if(h===0){this.success(e,t,a),r(a);return}for(const y of a.pages)this.loadTexture(this.texturePath(o,y.name,s),(A,u)=>{m||(y.setTexture(u),--h===0&&(this.success(e,t,a),r(a)))},(A,u)=>{if(!m){const g=`Couldn't load texture ${t} page image: ${A}`;this.error(n,t,g),l(g)}m=!0})}catch(a){const h=`Couldn't parse texture atlas ${t}: ${a.message}`;this.error(n,t,h),l(h)}},(c,a)=>{const h=`Couldn't load texture atlas ${t}: status ${c}, ${a}`;this.error(n,t,h),l(h)})}))}loadTextureAtlasButNoTextures(t,e=()=>{},n=()=>{}){const s=t.lastIndexOf("/"),i=s>=0?t.substring(0,s+1):"";t=this.start(t),!this.reuseAssets(t,e,n)&&(this.cache.assetsLoaded[t]=new Promise((o,r)=>{this.downloader.downloadText(t,l=>{try{const c=this.createTextureAtlas(l,i,t);this.success(e,t,c),o(c)}catch(c){const a=`Couldn't parse texture atlas ${t}: ${c.message}`;this.error(n,t,a),r(a)}},(l,c)=>{const a=`Couldn't load texture atlas ${t}: status ${l}, ${c}`;this.error(n,t,a),r(a)})}))}async loadBinaryAsync(t){return new Promise((e,n)=>{this.loadBinary(t,(s,i)=>e(i),(s,i)=>n(i))})}async loadJsonAsync(t){return new Promise((e,n)=>{this.loadJson(t,(s,i)=>e(i),(s,i)=>n(i))})}async loadTextureAsync(t){return new Promise((e,n)=>{this.loadTexture(t,(s,i)=>e(i),(s,i)=>n(i))})}async loadTextureAtlasAsync(t){return new Promise((e,n)=>{this.loadTextureAtlas(t,(s,i)=>e(i),(s,i)=>n(i))})}async loadTextureAtlasButNoTexturesAsync(t){return new Promise((e,n)=>{this.loadTextureAtlasButNoTextures(t,(s,i)=>e(i),(s,i)=>n(i))})}setCache(t){this.cache=t}get(t){return this.cache.assets[this.pathPrefix+t]}require(t){t=this.pathPrefix+t;const e=this.cache.assets[t];if(e)return e;const n=this.errors[t];throw Error(`Asset not found: ${t}${n?` ${n}`:""}`)}remove(t){t=this.pathPrefix+t;const e=this.cache.assets[t];return e.dispose&&e.dispose(),delete this.cache.assets[t],delete this.cache.assetsRefCount[t],delete this.cache.assetsLoaded[t],e}removeAll(){for(const t in this.cache.assets){const e=this.cache.assets[t];e.dispose&&e.dispose()}this.cache.assets={},this.cache.assetsLoaded={},this.cache.assetsRefCount={}}isLoadingComplete(){return this.toLoad===0}getToLoad(){return this.toLoad}getLoaded(){return this.loaded}dispose(){this.removeAll()}disposeAsset(t){const e=this.cache.assets[t];if(e instanceof ht){e.dispose();return}this.disposeAssetInternal(t)}hasErrors(){return Object.keys(this.errors).length>0}getErrors(){return this.errors}disposeAssetInternal(t){if(this.cache.assetsRefCount[t]>0&&--this.cache.assetsRefCount[t]===0)return this.remove(t)}createTextureAtlas(t,e,n,s){const i=new ht(t);i.dispose=()=>{var o;if(!(this.cache.assetsRefCount[n]<=0)){this.disposeAssetInternal(n);for(const r of i.pages)(o=r.texture)==null||o.dispose()}};for(const o of i.pages){const r=this.texturePath(e,o.name,s);this.texturePmaInfo[this.pathPrefix+r]=o.pma}return i}createTexture(t,e,n){const s=this.textureLoader(n,e),i=s.dispose.bind(s);return s.dispose=()=>{this.disposeAssetInternal(t)&&i()},s}texturePath(t,e,n){return n?n[e]:t+e}}const nt=class nt{constructor(){T(this,"assets",{});T(this,"assetsRefCount",{});T(this,"assetsLoaded",{})}static getCache(t){const e=nt.AVAILABLE_CACHES.get(t);if(e)return e;const n=new nt;return nt.AVAILABLE_CACHES.set(t,n),n}async addAsset(t,e){return this.assetsLoaded[t]=Promise.resolve(e),this.assets[t]=e,e}getAsset(t){return this.assetsLoaded[t]}};T(nt,"AVAILABLE_CACHES",new Map);let lt=nt;class bt{constructor(){T(this,"callbacks",{});T(this,"rawDataUris",{})}dataUriToString(t){if(!t.startsWith("data:"))throw new Error("Not a data URI.");let e=t.indexOf("base64,");return e!==-1?(e+=7,atob(t.substr(e))):t.substr(t.indexOf(",")+1)}base64ToUint8Array(t){var e=window.atob(t),n=e.length,s=new Uint8Array(n);for(let i=0;i{this.finish(t,i.status,i.responseText)};i.onload=o,i.onerror=o,i.send()}downloadJson(t,e,n){this.downloadText(t,s=>{e(JSON.parse(s))},n)}downloadBinary(t,e,n){if(this.start(t,e,n))return;const s=this.rawDataUris[t];if(s&&!s.includes(".")){try{this.finish(t,200,this.dataUriToUint8Array(s))}catch(r){this.finish(t,400,JSON.stringify(r))}return}const i=new XMLHttpRequest;i.open("GET",s||t,!0),i.responseType="arraybuffer";const o=()=>{this.finish(t,i.status,i.response)};i.onload=()=>{i.status===200||i.status===0?this.finish(t,200,new Uint8Array(i.response)):o()},i.onerror=o,i.send()}start(t,e,n){let s=this.callbacks[t];try{if(s)return!0;this.callbacks[t]=s=[]}finally{s.push(e,n)}}finish(t,e,n){const s=this.callbacks[t];if(delete this.callbacks[t],e===200||e===0)for(let i=0,o=s.length;iD.newFloatArray(16)))}update(t,e){if(!t)throw new Error("skeleton cannot be null.");const n=this.boundingBoxes,s=this.polygons,i=this.polygonPool,o=t.slots,r=o.length;n.length=0,i.freeAll(s),s.length=0;for(let l=0;l=this.minX&&t<=this.maxX&&e>=this.minY&&e<=this.maxY}aabbIntersectsSegment(t,e,n,s){const i=this.minX,o=this.minY,r=this.maxX,l=this.maxY;if(t<=i&&n<=i||e<=o&&s<=o||t>=r&&n>=r||e>=l&&s>=l)return!1;const c=(s-e)/(n-t);let a=c*(i-t)+e;if(a>o&&ao&&ai&&hi&&ht.minX&&this.minYt.minY}containsPoint(t,e){const n=this.polygons;for(let s=0,i=n.length;s=n||a=n){const h=s[l];h+(n-c)/(a-c)*(s[o]-h)=h&&f<=A||f>=A&&f<=h)&&(f>=e&&f<=s||f>=s&&f<=e)){const x=(a*L-c*g)/C;if((x>=m&&x<=u||x>=u&&x<=m)&&(x>=n&&x<=i||x>=i&&x<=n))return!0}h=A,m=u}return!1}getPolygon(t){if(!t)throw new Error("boundingBox cannot be null.");const e=this.boundingBoxes.indexOf(t);return e===-1?null:this.polygons[e]}getWidth(){return this.maxX-this.minX}getHeight(){return this.maxY-this.minY}}class z{constructor(){T(this,"convexPolygons",[]);T(this,"convexPolygonsIndices",[]);T(this,"indicesArray",[]);T(this,"isConcaveArray",[]);T(this,"triangles",[]);T(this,"polygonPool",new at(()=>[]));T(this,"polygonIndicesPool",new at(()=>[]))}triangulate(t){const e=t;let n=t.length>>1;const s=this.indicesArray;s.length=0;for(let r=0;r3;){let r=n-1,l=0,c=1;for(;;){t:if(!i[l]){const m=s[r]<<1,y=s[l]<<1,A=s[c]<<1,u=e[m],g=e[m+1],b=e[y],L=e[y+1],C=e[A],f=e[A+1];for(let x=c+10);r=l>0?l-1:n-1,c=l+10?l-1:n-1,h=l0&&(s.push(r),i.push(o),r=this.polygonPool.obtain(),o=this.polygonIndicesPool.obtain()),r.length=0,r.push(u,g,b,L),r.push(C,f),o.length=0,o.push(m,y,A),c=z.winding(u,g,b,L,C,f),l=m}r.length>0&&(s.push(r),i.push(o));for(let a=0,h=s.length;a=0;a--)r=s[a],r.length===0?(s.splice(a,1),this.polygonPool.free(r),o=i[a],i.splice(a,1),this.polygonIndicesPool.free(o)):r.push(r[0],r[1]);return s}static isConcave(t,e,n,s){const i=s[t>0?t-1:e-1]<<1,o=s[t]<<1,r=s[t+1=0}static winding(t,e,n,s,i,o){return t*(o-s)+n*(e-o)+i*(s-e)>=0?1:-1}}class wt{constructor(){T(this,"triangulator",null);T(this,"clippingPolygon",[]);T(this,"clippingPolygons",[]);T(this,"clipOutput",[]);T(this,"clippedVertices",[]);T(this,"clippedUVs",[]);T(this,"clippedTriangles",[]);T(this,"inverseVertices",[]);T(this,"_clippedVerticesTyped",new Float32Array(1024));T(this,"_clippedUVsTyped",new Float32Array(1024));T(this,"_clippedTrianglesTyped",new Uint16Array(1024));T(this,"clippedVerticesTyped",new Float32Array(0));T(this,"clippedUVsTyped",new Float32Array(0));T(this,"clippedTrianglesTyped",new Uint16Array(0));T(this,"clippedVerticesLength",0);T(this,"clippedUVsLength",0);T(this,"clippedTrianglesLength",0);T(this,"scratch",[]);T(this,"inverse",!1);T(this,"clipAttachment",null)}clipStart(t,e,n){if(this.clipAttachment)return;const s=n.worldVerticesLength;this.clipAttachment=n,this.inverse=n.inverse;const i=D.setArraySize(this.clippingPolygon,s);n.computeWorldVertices(t,e,0,s,i,0,2);const o=this.clippingPolygon,r=this.makeClockwise(o);r||this.inverse||n.convex?(r||this.makeConvex(o),this.clippingPolygon.push(o[0],o[1]),this.clippingPolygons.push(o)):(this.triangulator===null&&(this.triangulator=new z),this.clippingPolygons.push(...this.triangulator.decompose(o,this.triangulator.triangulate(o))))}clipEnd(t){this.clipAttachment&&(t&&this.clipAttachment.endSlot!==t.data||(this.clipAttachment=null,this.clippingPolygons.length=0))}isClipping(){return this.clipAttachment!=null}clipTriangles(t,e,n,s,i,o,r,l){return s&&i&&o&&typeof r=="boolean"&&typeof l=="number"?this.clipTrianglesRender(t,e,n,s,i,o,r,l):this.clipTrianglesNoRender(t,e,n)}clipTrianglesNoRender(t,e,n){const s=this.clippedVertices;s.length=0;const i=this.clippedTriangles;i.length=0;let o=0;if(this.inverse){const h=this.clippingPolygons[0];for(let m=0;m>1,I=s.length;const R=D.setArraySize(s,I+P);D.arrayCopy(f,x,R,I,P),I=i.length;const v=D.setArraySize(i,I+3*(M-2));for(let V=1;V>1;const P=D.setArraySize(s,f+x);D.arrayCopy(a,0,P,f,x),f=i.length;const M=D.setArraySize(i,f+3*(S-2));S--;for(let I=1;I>1;let F=c.length;const N=D.setArraySize(c,F+G*l);for(let X=0;X>1;q===0&&(U=P-v,O=R-S,B=L-R,K=v-C,q=1/(U*B-O*K));const E=D.setArraySize(c,d+_*l);for(let Y=0;Y>1;let Y=this.clippedVerticesLength;const G=Y+k*o,F=this.clippedUVsLength+k*2;r.length>1;J===0&&(O=M-V,B=v-P,K=L-v,q=V-C,J=1/(O*K-B*q));const k=p+E*o;r.length=2?(a=this.clipOutput,h=this.scratch):(a=this.scratch,h=this.clipOutput);const m=r;a.length=8;const y=a;y[0]=t,y[1]=e,y[2]=n,y[3]=s,y[4]=i,y[5]=o,y[6]=t,y[7]=e,h.length=0;const A=r.length-4;for(let u=0;;u+=2){const g=m[u],b=m[u+1],L=g-m[u+2],C=b-m[u+3],f=h.length,x=a;t=x[0],e=x[1];let S=C*(g-t)-L*(b-e);for(let M=2,I=a.length-2;M<=I;M+=2){n=x[M],s=x[M+1];const R=C*(g-n)-L*(b-s);if(S>0)if(R>0)h.push(n,s);else{const v=n-t,V=s-e,w=S/(v*C-V*L);w>=0&&w<=1?(h.push(t+v*w,e+V*w),c=!0):h.push(n,s)}else if(R>0){const v=n-t,V=s-e,w=S/(v*C-V*L);w>=0&&w<=1?(h.push(t+v*w,e+V*w,n,s),c=!0):h.push(n,s)}else c=!0;t=n,e=s,S=R}if(f===h.length)return l.length=0,!0;if(h.push(h[0],h[1]),u===A)break;const P=h;h=a,h.length=0,a=P}if(l!==h){l.length=0;for(let u=0,g=h.length-2;u=2?(c=this.clipOutput,a=this.scratch):(c=this.scratch,a=this.clipOutput),c.length=8;let h=r,m=c;m[0]=t,m[1]=e,m[2]=n,m[3]=s,m[4]=i,m[5]=o,m[6]=t,m[7]=e,a.length=0;for(let y=0;;y+=2){const A=h[y],u=h[y+1],g=A-h[y+2],b=u-h[y+3],L=a.length,C=this.inverseVertices.length;this.inverseVertices.push(0),m=c,t=m[0],e=m[1];let f=b*(A-t)-g*(u-e);for(let P=2,M=c.length-2;P<=M;P+=2){n=m[P],s=m[P+1];const I=b*(A-n)-g*(u-s);if(f>0)if(I>0)a.push(n,s);else{const R=n-t,v=s-e,V=f/(R*b-v*g);if(V>=0&&V<=1){const w=t+R*V,U=e+v*V;a.push(w,U),this.inverseVertices.push(w,U,n,s)}else a.push(n,s)}else if(I>0){const R=n-t,v=s-e,V=f/(R*b-v*g);if(V>=0&&V<=1){const w=t+R*V,U=e+v*V;this.inverseVertices.push(w,U),a.push(w,U,n,s)}else a.push(n,s)}else this.inverseVertices.push(n,s);t=n,e=s,f=I}const x=this.inverseVertices.length-C-1;if(x>=6?this.inverseVertices[C]=x:this.inverseVertices.length=C,L===a.length||(a.push(a[0],a[1]),y===l))break;const S=a;a=c,a.length=0,c=S}}makeClockwise(t){const e=t,n=t.length;let s=!0,i=!0,o=0,r=e[n-2],l=e[n-1],c=e[0],a=e[1];for(let m=2;m=0,r=c,l=a,c=y,a=A}o+=c*e[1]-e[0]*a;const h=(c-r)*(e[1]-a)-(a-l)*(e[0]-c);if(i=i&&h<=0,s=s&&h>=0,o>=0){for(let m=0,y=n-2,A=n>>1;m=0&&(s[a]>l||s[a]===l&&s[a+1]>c);a-=2)s[a+2]=s[a],s[a+3]=s[a+1];s[a+2]=l,s[a+3]=c}n[0]=s[0],n[1]=s[1],n[2]=s[2],n[3]=s[3];let i=4;for(let r=4;r=0&&(i-=2,i!==2););n[i]=l,n[i+1]=c}n[i]=s[e-4],n[i+1]=s[e-3];const o=i;i+=2;for(let r=e-6;r>=0;r-=2,i+=2){const l=s[r],c=s[r+1];for(;(n[i-2]-n[i-4])*(c-n[i-3])-(n[i-1]-n[i-3])*(l-n[i-4])>=0&&(i-=2,i!==o););n[i]=l,n[i+1]=c}t.length=i-2}}class St{constructor(t,e,n={}){T(this,"skeleton");T(this,"adapter");T(this,"positionInheritanceFactorX",0);T(this,"positionInheritanceFactorY",0);T(this,"rotationInheritanceFactor",0);T(this,"hasLastTransform",!1);T(this,"lastX",0);T(this,"lastY",0);T(this,"lastZ",0);T(this,"lastRotation",0);T(this,"currentTransform",{x:0,y:0,z:0,rotation:0});T(this,"currentPosition",{x:0,y:0,z:0});T(this,"lastPosition",{x:0,y:0,z:0});this.skeleton=t,this.adapter=e,this.positionInheritanceFactorX=n.positionInheritanceX??0,this.positionInheritanceFactorY=n.positionInheritanceY??0,this.rotationInheritanceFactor=n.rotationInheritance??0}get positionInheritanceX(){return this.positionInheritanceFactorX}get positionInheritanceY(){return this.positionInheritanceFactorY}setPositionInheritance(t,e){const n=this.positionInheritanceFactorX===0&&this.positionInheritanceFactorY===0,s=t!==0||e!==0;this.positionInheritanceFactorX=t,this.positionInheritanceFactorY=e,n&&s&&this.resetPosition()}get rotationInheritance(){return this.rotationInheritanceFactor}set rotationInheritance(t){const e=this.rotationInheritanceFactor===0;this.rotationInheritanceFactor=t,e&&t!==0&&this.resetRotation()}resetPosition(){const t=this.currentTransform,e=!this.hasLastTransform&&this.rotationInheritanceFactor!==0;this.adapter.readTransform(t,e),this.lastX=t.x,this.lastY=t.y,this.lastZ=t.z,e&&(this.lastRotation=t.rotation),this.hasLastTransform=!0}resetRotation(){const t=this.currentTransform;this.adapter.readTransform(t,!0),this.lastRotation=t.rotation,this.hasLastTransform||(this.lastX=t.x,this.lastY=t.y,this.lastZ=t.z),this.hasLastTransform=!0}resetTransform(){const t=this.currentTransform;this.adapter.readTransform(t,!0),this.setLastTransform(t.x,t.y,t.z,t.rotation)}applyTransformMovement(){const t=this.positionInheritanceFactorX!==0||this.positionInheritanceFactorY!==0,e=this.rotationInheritanceFactor!==0;if(!t&&!e)return;const n=this.currentTransform;this.adapter.readTransform(n,e);const{x:s,y:i,z:o}=n,r=e?n.rotation:this.lastRotation,l=s!==this.lastX||i!==this.lastY||o!==this.lastZ;if(this.hasLastTransform){if(!l&&r===this.lastRotation)return;t&&l&&this.applyPositionMovement(s,i,o),e&&r!==this.lastRotation&&this.applyRotationMovement(r)}this.setLastTransform(s,i,o,r)}applyPositionMovement(t,e,n){const s=this.currentPosition;s.x=t,s.y=e,s.z=n,this.adapter.worldToSkeleton(s);const i=this.lastPosition;i.x=this.lastX,i.y=this.lastY,i.z=this.lastZ,this.adapter.worldToSkeleton(i),this.skeleton.physicsTranslate((s.x-i.x)*this.positionInheritanceFactorX,(s.y-i.y)*this.positionInheritanceFactorY)}applyRotationMovement(t){const e=this.rotationInheritanceFactor;e!==0&&this.skeleton.physicsRotate(0,0,this.getRotationDelta(t,this.lastRotation)*e)}setLastTransform(t,e,n,s){this.lastX=t,this.lastY=e,this.lastZ=n,this.lastRotation=s,this.hasLastTransform=!0}getRotationDelta(t,e){let n=t-e;return n=(n+180)%360-180,n<-180?n+360:n}}class Mt{constructor(){T(this,"commandPool",new xt);T(this,"worldVertices",new Float32Array(12*1024));T(this,"quadIndices",new Uint16Array([0,1,2,2,3,0]));T(this,"clipping",new wt);T(this,"renderCommands",[])}render(t,e=!1,n,s=2,i=0){var c,a;this.commandPool.reset(),this.renderCommands.length=0;const o=this.clipping;let r=0;const l=t.drawOrder.appliedPose;for(let h=0,m=l.length;h>1;const w=u.sequence,U=w.resolveIndex(A);f=w.getUVs(U),x=u.triangles,S=x.length,M=(a=w.regions[U])==null?void 0:a.texture}else if(u instanceof rt){o.clipEnd(y),o.clipStart(t,y,u);continue}else{o.clipEnd(y);continue}if(!M){o.clipEnd(y);continue}const I=t.color;let R,v;if(e){let w;if(n){w=Math.floor(n[3]*I.a*g.a*P.a*255);const U=Math.floor(w*n[0]*I.r*g.r*P.r),O=Math.floor(w*n[1]*I.g*g.g*P.g),B=Math.floor(w*n[2]*I.b*g.b*P.b);R=w<<24|U<<16|O<<8|B}else{w=Math.floor(I.a*g.a*P.a*255);const U=Math.floor(w*I.r*g.r*P.r),O=Math.floor(w*I.g*g.g*P.g),B=Math.floor(w*I.b*g.b*P.b);R=w<<24|U<<16|O<<8|B}if(v=4278190080,A.darkColor){const{r:U,g:O,b:B}=A.darkColor;v=4278190080|Math.floor(U*w)<<16|Math.floor(O*w)<<8|Math.floor(B*w)}}else{if(n){const w=Math.floor(n[3]*I.a*g.a*P.a*255),U=Math.floor(n[0]*I.r*g.r*P.r*255),O=Math.floor(n[1]*I.g*g.g*P.g*255),B=Math.floor(n[2]*I.b*g.b*P.b*255);R=w<<24|U<<16|O<<8|B}else{const w=Math.floor(I.a*g.a*P.a*255),U=Math.floor(I.r*g.r*P.r*255),O=Math.floor(I.g*g.g*P.g*255),B=Math.floor(I.b*g.b*P.b*255);R=w<<24|U<<16|O<<8|B}if(v=0,A.darkColor){const{r:w,g:U,b:O}=A.darkColor;v=Math.floor(w*255)<<16|Math.floor(U*255)<<8|Math.floor(O*255)}}o.isClipping()&&(o.clipTrianglesUnpacked(L,0,x,S,f,s),L=o.clippedVerticesTyped,C=o.clippedVerticesLength/s,f=o.clippedUVsTyped,x=o.clippedTrianglesTyped,S=o.clippedTrianglesLength);const V=this.commandPool.getCommand(C,S,s);if(V.blendMode=y.data.blendMode,V.texture=M,V.positions.set(L.subarray(0,C*s)),s>=3)for(let w=2,U=C*s;w=t*n&&i._indices.length>=e){s=i;break}if(s)this.pool.splice(this.pool.indexOf(s),1),s.next=void 0,s.numVertices=t,s.numIndices=e,s.positions=s._positions.subarray(0,t*n),s.uvs=s._uvs.subarray(0,t<<1),s.colors=s._colors.subarray(0,t),s.darkColors=s._darkColors.subarray(0,t),s.indices=s._indices.subarray(0,e);else{const i=new Float32Array(t*n),o=new Float32Array(t<<1),r=new Uint32Array(t),l=new Uint32Array(t),c=new Uint16Array(e);s={positions:i,uvs:o,colors:r,darkColors:l,indices:c,_positions:i,_uvs:o,_colors:r,_darkColors:l,_indices:c,numVertices:t,numIndices:e,blendMode:Tt.Normal,texture:null}}return this.inUse.push(s),s}reset(){this.pool.push(...this.inUse),this.inUse.length=0}}export{Rt as ATTACH_RETAIN,Yt as ATTACH_SETUP,Ft as AlphaTimeline,Et as Animation,_t as AnimationState,Ot as AnimationStateAdapter,It as AnimationStateData,lt as AssetCache,Ct as AssetManagerBase,Vt as AtlasAttachmentLoader,kt as Attachment,Xt as AttachmentTimeline,Bt as BinaryInput,Tt as BlendMode,Nt as Bone,Dt as BoneData,$t as BonePose,zt as BoneTimeline1,Wt as BoneTimeline2,ut as BoundingBoxAttachment,qt as CURRENT,rt as ClippingAttachment,Gt as Color,Jt as Constraint,Ht as ConstraintData,Zt as ConstraintTimeline1,Kt as CurveTimeline,Qt as CurveTimeline1,jt as DebugUtils,te as DeformTimeline,bt as Downloader,ee as DrawOrder,se as DrawOrderFolderTimeline,ne as DrawOrderTimeline,ie as Event,oe as EventData,re as EventQueue,ae as EventTimeline,le as EventType,ce as FIRST,he as FakeTexture,pe as FromProperty,de as FromRotate,ue as FromScaleX,fe as FromScaleY,ge as FromShearY,me as FromX,ye as FromY,Te as HOLD,be as IkConstraint,we as IkConstraintData,xe as IkConstraintPose,Ae as IkConstraintTimeline,Pe as Inherit,Ie as InheritTimeline,Ce as IntSet,Ve as Interpolation,Le as MODE,Se as MathUtils,dt as MeshAttachment,Me as MixFrom,mt as PathAttachment,ve as PathConstraint,Ue as PathConstraintData,Re as PathConstraintMixTimeline,Ye as PathConstraintPose,Fe as PathConstraintPositionTimeline,Ee as PathConstraintSpacingTimeline,_e as Physics,Oe as PhysicsConstraint,ke as PhysicsConstraintDampingTimeline,Xe as PhysicsConstraintData,Be as PhysicsConstraintGravityTimeline,Ne as PhysicsConstraintInertiaTimeline,De as PhysicsConstraintMassTimeline,$e as PhysicsConstraintMixTimeline,ze as PhysicsConstraintPose,We as PhysicsConstraintResetTimeline,qe as PhysicsConstraintStrengthTimeline,Ge as PhysicsConstraintTimeline,Je as PhysicsConstraintWindTimeline,yt as PointAttachment,at as Pool,He as Posed,Ze as PosedActive,Ke as PosedData,Qe as PositionMode,je as Pow,ts as PowOut,es as Property,ss as RGB2Timeline,ns as RGBA2Timeline,is as RGBATimeline,os as RGBTimeline,pt as RegionAttachment,rs as RotateMode,as as RotateTimeline,ls as SETUP,cs as ScaleTimeline,hs as ScaleXTimeline,ps as ScaleYMode,ds as ScaleYTimeline,us as Sequence,fs as SequenceMode,gs as SequenceModeValues,ms as SequenceTimeline,ys as ShearTimeline,Ts as ShearXTimeline,bs as ShearYTimeline,ws as Skeleton,xs as SkeletonBinary,Lt as SkeletonBounds,wt as SkeletonClipping,As as SkeletonData,Ps as SkeletonJson,St as SkeletonPhysicsMovement,Mt as SkeletonRendererCore,Is as Skin,Cs as SkinEntry,Vs as Slider,Ls as SliderData,Ss as SliderMixTimeline,Ms as SliderPose,vs as SliderTimeline,Us as Slot,Rs as SlotCurveTimeline,Ys as SlotData,Fs as SlotPose,Es as SpacingMode,_s as StringSet,Os as Texture,ht as TextureAtlas,ks as TextureAtlasPage,Xs as TextureAtlasRegion,Bs as TextureFilter,Ns as TextureRegion,Ds as TextureWrap,$s as TimeKeeper,zs as Timeline,Ws as ToProperty,qs as ToRotate,Gs as ToScaleX,Js as ToScaleY,Hs as ToShearY,Zs as ToX,Ks as ToY,Qs as TrackEntry,js as TransformConstraint,tn as TransformConstraintData,en as TransformConstraintPose,sn as TransformConstraintTimeline,nn as TranslateTimeline,on as TranslateXTimeline,rn as TranslateYTimeline,z as Triangulator,D as Utils,an as Vector2,ln as VertexAttachment,cn as WindowedMean,hn as isBoneTimeline,pn as isConstraintTimeline,dn as isSlotTimeline}; diff --git a/dist/assets/index-DQ5rq6hP.js b/dist/assets/index-DQ5rq6hP.js new file mode 100644 index 0000000..4b9ecb3 --- /dev/null +++ b/dist/assets/index-DQ5rq6hP.js @@ -0,0 +1,1257 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-CC5ru70P.js","assets/index-Ck8IwYQq.js"])))=>i.map(i=>d[i]); +var YE=Object.defineProperty;var GE=(n,e,t)=>e in n?YE(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var T=(n,e,t)=>GE(n,typeof e!="symbol"?e+"":e,t);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))i(s);new MutationObserver(s=>{for(const r of s)if(r.type==="childList")for(const o of r.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function t(s){const r={};return s.integrity&&(r.integrity=s.integrity),s.referrerPolicy&&(r.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?r.credentials="include":s.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function i(s){if(s.ep)return;s.ep=!0;const r=t(s);fetch(s.href,r)}})();/** +* @vue/shared v3.5.41 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/function sg(n){const e=Object.create(null);for(const t of n.split(","))e[t]=1;return t=>t in e}const Xt={},Ea=[],Cs=()=>{},P1=()=>!1,Ou=n=>n.charCodeAt(0)===111&&n.charCodeAt(1)===110&&(n.charCodeAt(2)>122||n.charCodeAt(2)<97),$u=n=>n.startsWith("onUpdate:"),Ci=Object.assign,rg=(n,e)=>{const t=n.indexOf(e);t>-1&&n.splice(t,1)},HE=Object.prototype.hasOwnProperty,Ot=(n,e)=>HE.call(n,e),et=Array.isArray,Ca=n=>uc(n)==="[object Map]",Ka=n=>uc(n)==="[object Set]",c0=n=>uc(n)==="[object Date]",ht=n=>typeof n=="function",ii=n=>typeof n=="string",wn=n=>typeof n=="symbol",$t=n=>n!==null&&typeof n=="object",R1=n=>($t(n)||ht(n))&&ht(n.then)&&ht(n.catch),k1=Object.prototype.toString,uc=n=>k1.call(n),jE=n=>uc(n).slice(8,-1),F1=n=>uc(n)==="[object Object]",Nu=n=>ii(n)&&n!=="NaN"&&n[0]!=="-"&&""+parseInt(n,10)===n,Ml=sg(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Du=n=>{const e=Object.create(null);return(t=>e[t]||(e[t]=n(t)))},WE=/-\w/g,qn=Du(n=>n.replace(WE,e=>e.slice(1).toUpperCase())),zE=/\B([A-Z])/g,Qr=Du(n=>n.replace(zE,"-$1").toLowerCase()),L1=Du(n=>n.charAt(0).toUpperCase()+n.slice(1)),Sd=Du(n=>n?`on${L1(n)}`:""),xs=(n,e)=>!Object.is(n,e),gh=(n,...e)=>{for(let t=0;t{Object.defineProperty(n,e,{configurable:!0,enumerable:!1,writable:i,value:t})},Bu=n=>{const e=parseFloat(n);return isNaN(e)?n:e},qE=n=>{const e=ii(n)?Number(n):NaN;return isNaN(e)?n:e};let h0;const Uu=()=>h0||(h0=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Vt(n){if(et(n)){const e={};for(let t=0;t{if(t){const i=t.split(JE);i.length>1&&(e[i[0].trim()]=i[1].trim())}}),e}function Pe(n){let e="";if(ii(n))e=n;else if(et(n))for(let t=0;tJa(t,e))}const N1=n=>!!(n&&n.__v_isRef===!0),k=n=>ii(n)?n:n==null?"":et(n)||$t(n)&&(n.toString===k1||!ht(n.toString))?N1(n)?k(n.value):JSON.stringify(n,D1,2):String(n),D1=(n,e)=>N1(e)?D1(n,e.value):Ca(e)?{[`Map(${e.size})`]:[...e.entries()].reduce((t,[i,s],r)=>(t[_d(i,r)+" =>"]=s,t),{})}:Ka(e)?{[`Set(${e.size})`]:[...e.values()].map(t=>_d(t))}:wn(e)?_d(e):$t(e)&&!et(e)&&!F1(e)?String(e):e,_d=(n,e="")=>{var t;return wn(n)?`Symbol(${(t=n.description)!=null?t:e})`:n};/** +* @vue/reactivity v3.5.41 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/let _i;class B1{constructor(e=!1){this.detached=e,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!e&&_i&&(_i.active?(this.parent=_i,this.index=(_i.scopes||(_i.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let e,t;if(this.scopes){const i=this.scopes.slice();for(e=0,t=i.length;e0&&--this._on===0){if(_i===this)_i=this.prevScope;else{let e=_i;for(;e;){if(e.prevScope===this){e.prevScope=this.prevScope;break}e=e.prevScope}}this.prevScope=void 0}}stop(e){if(this._active){this._active=!1;let t,i;for(t=0,i=this.effects.length;t0)return;if(Il){let e=Il;for(Il=void 0;e;){const t=e.next;e.next=void 0,e.flags&=-9,e=t}}let n;for(;Al;){let e=Al;for(Al=void 0;e;){const t=e.next;if(e.next=void 0,e.flags&=-9,e.flags&1)try{e.trigger()}catch(i){n||(n=i)}e=t}}if(n)throw n}function G1(n){for(let e=n.deps;e;e=e.nextDep)e.version=-1,e.prevActiveLink=e.dep.activeLink,e.dep.activeLink=e}function H1(n){let e,t=n.depsTail,i=t;for(;i;){const s=i.prevDep;i.version===-1?(i===t&&(t=s),ug(i),nC(i)):e=i,i.dep.activeLink=i.prevActiveLink,i.prevActiveLink=void 0,i=s}n.deps=e,n.depsTail=t}function Sm(n){for(let e=n.deps;e;e=e.nextDep)if(e.dep.version!==e.version||e.dep.computed&&(j1(e.dep.computed)||e.dep.version!==e.version))return!0;return!!n._dirty}function j1(n){if(n.flags&4&&!(n.flags&16)||(n.flags&=-17,n.globalVersion===Vl)||(n.globalVersion=Vl,!n.isSSR&&n.flags&128&&(!n.deps&&!n._dirty||!Sm(n))))return;n.flags|=2;const e=n.dep,t=Wt,i=Kn;Wt=n,Kn=!0;try{G1(n);const s=n.fn(n._value);(e.version===0||xs(s,n._value))&&(n.flags|=128,n._value=s,e.version++)}catch(s){throw e.version++,s}finally{Wt=t,Kn=i,H1(n),n.flags&=-3}}function ug(n,e=!1){const{dep:t,prevSub:i,nextSub:s}=n;if(i&&(i.nextSub=s,n.prevSub=void 0),s&&(s.prevSub=i,n.nextSub=void 0),t.subs===n&&(t.subs=i,!i&&t.computed)){t.computed.flags&=-5;for(let r=t.computed.deps;r;r=r.nextDep)ug(r,!0)}!e&&!--t.sc&&t.map&&t.map.delete(t.key)}function nC(n){const{prevDep:e,nextDep:t}=n;e&&(e.nextDep=t,n.prevDep=void 0),t&&(t.prevDep=e,n.nextDep=void 0)}let Kn=!0;const W1=[];function hr(){W1.push(Kn),Kn=!1}function ur(){const n=W1.pop();Kn=n===void 0?!0:n}function u0(n){const{cleanup:e}=n;if(n.cleanup=void 0,e){const t=Wt;Wt=void 0;try{e()}finally{Wt=t}}}let Vl=0;class sC{constructor(e,t){this.sub=e,this.dep=t,this.version=t.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class dg{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(e){if(!Wt||!Kn||Wt===this.computed)return;let t=this.activeLink;if(t===void 0||t.sub!==Wt)t=this.activeLink=new sC(Wt,this),Wt.deps?(t.prevDep=Wt.depsTail,Wt.depsTail.nextDep=t,Wt.depsTail=t):Wt.deps=Wt.depsTail=t,z1(t);else if(t.version===-1&&(t.version=this.version,t.nextDep)){const i=t.nextDep;i.prevDep=t.prevDep,t.prevDep&&(t.prevDep.nextDep=i),t.prevDep=Wt.depsTail,t.nextDep=void 0,Wt.depsTail.nextDep=t,Wt.depsTail=t,Wt.deps===t&&(Wt.deps=i)}return t}trigger(e){this.version++,Vl++,this.notify(e)}notify(e){cg();try{for(let t=this.subs;t;t=t.prevSub)t.sub.notify()&&t.sub.dep.notify()}finally{hg()}}}function z1(n){if(n.dep.sc++,n.sub.flags&4){const e=n.dep.computed;if(e&&!n.dep.subs){e.flags|=20;for(let i=e.deps;i;i=i.nextDep)z1(i)}const t=n.dep.subs;t!==n&&(n.prevSub=t,t&&(t.nextSub=n)),n.dep.subs=n}}const Lh=new WeakMap,Ro=Symbol(""),_m=Symbol(""),Xl=Symbol("");function Gi(n,e,t){if(Kn&&Wt){let i=Lh.get(n);i||Lh.set(n,i=new Map);let s=i.get(t);s||(i.set(t,s=new dg),s.map=i,s.key=t),s.track()}}function Ws(n,e,t,i,s,r){const o=Lh.get(n);if(!o){Vl++;return}const a=c=>{c&&c.trigger()};if(cg(),e==="clear")o.forEach(a);else{const c=et(n),l=c&&Nu(t);if(c&&t==="length"){const h=Number(i);o.forEach((u,d)=>{(d==="length"||d===Xl||!wn(d)&&d>=h)&&a(u)})}else switch((t!==void 0||o.has(void 0))&&a(o.get(t)),l&&a(o.get(Xl)),e){case"add":c?l&&a(o.get("length")):(a(o.get(Ro)),Ca(n)&&a(o.get(_m)));break;case"delete":c||(a(o.get(Ro)),Ca(n)&&a(o.get(_m)));break;case"set":Ca(n)&&a(o.get(Ro));break}}hg()}function rC(n,e){const t=Lh.get(n);return t&&t.get(e)}function ta(n){const e=Mt(n);return e===n?e:(Gi(e,"iterate",Xl),xn(n)?e:e.map(ts))}function Vu(n){return Gi(n=Mt(n),"iterate",Xl),n}function gs(n,e){return dr(n)?Ba(or(n)?ts(e):e):ts(e)}const oC={__proto__:null,[Symbol.iterator](){return Ed(this,Symbol.iterator,n=>gs(this,n))},concat(...n){return ta(this).concat(...n.map(e=>et(e)?ta(e):e))},entries(){return Ed(this,"entries",n=>(n[1]=gs(this,n[1]),n))},every(n,e){return Os(this,"every",n,e,void 0,arguments)},filter(n,e){return Os(this,"filter",n,e,t=>t.map(i=>gs(this,i)),arguments)},find(n,e){return Os(this,"find",n,e,t=>gs(this,t),arguments)},findIndex(n,e){return Os(this,"findIndex",n,e,void 0,arguments)},findLast(n,e){return Os(this,"findLast",n,e,t=>gs(this,t),arguments)},findLastIndex(n,e){return Os(this,"findLastIndex",n,e,void 0,arguments)},forEach(n,e){return Os(this,"forEach",n,e,void 0,arguments)},includes(...n){return Cd(this,"includes",n)},indexOf(...n){return Cd(this,"indexOf",n)},join(n){return ta(this).join(n)},lastIndexOf(...n){return Cd(this,"lastIndexOf",n)},map(n,e){return Os(this,"map",n,e,void 0,arguments)},pop(){return ol(this,"pop")},push(...n){return ol(this,"push",n)},reduce(n,...e){return d0(this,"reduce",n,e)},reduceRight(n,...e){return d0(this,"reduceRight",n,e)},shift(){return ol(this,"shift")},some(n,e){return Os(this,"some",n,e,void 0,arguments)},splice(...n){return ol(this,"splice",n)},toReversed(){return ta(this).toReversed()},toSorted(n){return ta(this).toSorted(n)},toSpliced(...n){return ta(this).toSpliced(...n)},unshift(...n){return ol(this,"unshift",n)},values(){return Ed(this,"values",n=>gs(this,n))}};function Ed(n,e,t){const i=Vu(n),s=i[e]();return i!==n&&!xn(n)&&(s._next=s.next,s.next=()=>{const r=s._next();return r.done||(r.value=t(r.value)),r}),s}const aC=Array.prototype;function Os(n,e,t,i,s,r){const o=Vu(n),a=o!==n&&!xn(n),c=o[e];if(c!==aC[e]){const u=c.apply(n,r);return a?ts(u):u}let l=t;o!==n&&(a?l=function(u,d){return t.call(this,gs(n,u),d,n)}:t.length>2&&(l=function(u,d){return t.call(this,u,d,n)}));const h=c.call(o,l,i);return a&&s?s(h):h}function d0(n,e,t,i){const s=Vu(n),r=s!==n&&!xn(n);let o=t,a=!1;s!==n&&(r?(a=i.length===0,o=function(l,h,u){return a&&(a=!1,l=gs(n,l)),t.call(this,l,gs(n,h),u,n)}):t.length>3&&(o=function(l,h,u){return t.call(this,l,h,u,n)}));const c=s[e](o,...i);return a?gs(n,c):c}function Cd(n,e,t){const i=Mt(n);Gi(i,"iterate",Xl);const s=i[e](...t);return(s===-1||s===!1)&&Xu(t[0])?(t[0]=Mt(t[0]),i[e](...t)):s}function ol(n,e,t=[]){hr(),cg();const i=Mt(n)[e].apply(n,t);return hg(),ur(),i}const lC=sg("__proto__,__v_isRef,__isVue"),q1=new Set(Object.getOwnPropertyNames(Symbol).filter(n=>n!=="arguments"&&n!=="caller").map(n=>Symbol[n]).filter(wn));function cC(n){wn(n)||(n=String(n));const e=Mt(this);return Gi(e,"has",n),e.hasOwnProperty(n)}class K1{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,i){if(t==="__v_skip")return e.__v_skip;const s=this._isReadonly,r=this._isShallow;if(t==="__v_isReactive")return!s;if(t==="__v_isReadonly")return s;if(t==="__v_isShallow")return r;if(t==="__v_raw")return i===(s?r?bC:ex:r?Q1:Z1).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(i)?e:void 0;const o=et(e);if(!s){let c;if(o&&(c=oC[t]))return c;if(t==="hasOwnProperty")return cC}const a=Reflect.get(e,t,Qt(e)?e:i);if((wn(t)?q1.has(t):lC(t))||(s||Gi(e,"get",t),r))return a;if(Qt(a)){const c=o&&Nu(t)?a:a.value;return s&&$t(c)?Em(c):c}return $t(a)?s?Em(a):Go(a):a}}class J1 extends K1{constructor(e=!1){super(!1,e)}set(e,t,i,s){let r=e[t];const o=et(e)&&Nu(t);if(!this._isShallow){const l=dr(r);if(!xn(i)&&!dr(i)&&(r=Mt(r),i=Mt(i)),!o&&Qt(r)&&!Qt(i))return l||(r.value=i),!0}const a=o?Number(t)n,Ac=n=>Reflect.getPrototypeOf(n);function mC(n,e,t){return function(...i){const s=this.__v_raw,r=Mt(s),o=Ca(r),a=n==="entries"||n===Symbol.iterator&&o,c=n==="keys"&&o,l=s[n](...i),h=t?Tm:e?Ba:ts;return!e&&Gi(r,"iterate",c?_m:Ro),Ci(Object.create(l),{next(){const{value:u,done:d}=l.next();return d?{value:u,done:d}:{value:a?[h(u[0]),h(u[1])]:h(u),done:d}}})}}function Ic(n){return function(...e){return n==="delete"?!1:n==="clear"?void 0:this}}function pC(n,e){const t={get(s){const r=this.__v_raw,o=Mt(r),a=Mt(s);n||(xs(s,a)&&Gi(o,"get",s),Gi(o,"get",a));const{has:c}=Ac(o),l=e?Tm:n?Ba:ts;if(c.call(o,s))return l(r.get(s));if(c.call(o,a))return l(r.get(a));r!==o&&r.get(s)},get size(){const s=this.__v_raw;return!n&&Gi(Mt(s),"iterate",Ro),s.size},has(s){const r=this.__v_raw,o=Mt(r),a=Mt(s);return n||(xs(s,a)&&Gi(o,"has",s),Gi(o,"has",a)),s===a?r.has(s):r.has(s)||r.has(a)},forEach(s,r){const o=this,a=o.__v_raw,c=Mt(a),l=e?Tm:n?Ba:ts;return!n&&Gi(c,"iterate",Ro),a.forEach((h,u)=>s.call(r,l(h),l(u),o))}};return Ci(t,n?{add:Ic("add"),set:Ic("set"),delete:Ic("delete"),clear:Ic("clear")}:{add(s){const r=Mt(this),o=Ac(r),a=Mt(s),c=!e&&!xn(s)&&!dr(s)?a:s;return o.has.call(r,c)||xs(s,c)&&o.has.call(r,s)||xs(a,c)&&o.has.call(r,a)||(r.add(c),Ws(r,"add",c,c)),this},set(s,r){!e&&!xn(r)&&!dr(r)&&(r=Mt(r));const o=Mt(this),{has:a,get:c}=Ac(o);let l=a.call(o,s);l||(s=Mt(s),l=a.call(o,s));const h=c.call(o,s);return o.set(s,r),l?xs(r,h)&&Ws(o,"set",s,r):Ws(o,"add",s,r),this},delete(s){const r=Mt(this),{has:o,get:a}=Ac(r);let c=o.call(r,s);c||(s=Mt(s),c=o.call(r,s)),a&&a.call(r,s);const l=r.delete(s);return c&&Ws(r,"delete",s,void 0),l},clear(){const s=Mt(this),r=s.size!==0,o=s.clear();return r&&Ws(s,"clear",void 0,void 0),o}}),["keys","values","entries",Symbol.iterator].forEach(s=>{t[s]=mC(s,n,e)}),t}function fg(n,e){const t=pC(n,e);return(i,s,r)=>s==="__v_isReactive"?!n:s==="__v_isReadonly"?n:s==="__v_raw"?i:Reflect.get(Ot(t,s)&&s in i?t:i,s,r)}const gC={get:fg(!1,!1)},vC={get:fg(!1,!0)},yC={get:fg(!0,!1)};const Z1=new WeakMap,Q1=new WeakMap,ex=new WeakMap,bC=new WeakMap;function xC(n){switch(n){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Go(n){return dr(n)?n:mg(n,!1,uC,gC,Z1)}function wC(n){return mg(n,!1,fC,vC,Q1)}function Em(n){return mg(n,!0,dC,yC,ex)}function mg(n,e,t,i,s){if(!$t(n)||n.__v_raw&&!(e&&n.__v_isReactive)||n.__v_skip||!Object.isExtensible(n))return n;const r=s.get(n);if(r)return r;const o=xC(jE(n));if(o===0)return n;const a=new Proxy(n,o===2?i:t);return s.set(n,a),a}function or(n){return dr(n)?or(n.__v_raw):!!(n&&n.__v_isReactive)}function dr(n){return!!(n&&n.__v_isReadonly)}function xn(n){return!!(n&&n.__v_isShallow)}function Xu(n){return n?!!n.__v_raw:!1}function Mt(n){const e=n&&n.__v_raw;return e?Mt(e):n}function Ur(n){return!Ot(n,"__v_skip")&&Object.isExtensible(n)&&O1(n,"__v_skip",!0),n}const ts=n=>$t(n)?Go(n):n,Ba=n=>$t(n)?Em(n):n;function Qt(n){return n?n.__v_isRef===!0:!1}function De(n){return tx(n,!1)}function SC(n){return tx(n,!0)}function tx(n,e){return Qt(n)?n:new _C(n,e)}class _C{constructor(e,t){this.dep=new dg,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:Mt(e),this._value=t?e:ts(e),this.__v_isShallow=t}get value(){return this.dep.track(),this._value}set value(e){const t=this._rawValue,i=this.__v_isShallow||xn(e)||dr(e);e=i?e:Mt(e),xs(e,t)&&(this._rawValue=e,this._value=i?e:ts(e),this.dep.trigger())}}function I(n){return Qt(n)?n.value:n}const TC={get:(n,e,t)=>e==="__v_raw"?n:I(Reflect.get(n,e,t)),set:(n,e,t,i)=>{const s=n[e];return Qt(s)&&!Qt(t)?(s.value=t,!0):Reflect.set(n,e,t,i)}};function ix(n){return or(n)?n:new Proxy(n,TC)}function EC(n){const e=et(n)?new Array(n.length):{};for(const t in n)e[t]=MC(n,t);return e}class CC{constructor(e,t,i){this._object=e,this._defaultValue=i,this.__v_isRef=!0,this._value=void 0,this._key=wn(t)?t:String(t),this._raw=Mt(e);let s=!0,r=e;if(!et(e)||wn(this._key)||!Nu(this._key))do s=!Xu(r)||xn(r);while(s&&(r=r.__v_raw));this._shallow=s}get value(){let e=this._object[this._key];return this._shallow&&(e=I(e)),this._value=e===void 0?this._defaultValue:e}set value(e){if(this._shallow&&Qt(this._raw[this._key])){const t=this._object[this._key];if(Qt(t)){t.value=e;return}}this._object[this._key]=e}get dep(){return rC(this._raw,this._key)}}function MC(n,e,t){return new CC(n,e,t)}class AC{constructor(e,t,i){this.fn=e,this.setter=t,this._value=void 0,this.dep=new dg(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Vl-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=i}notify(){if(this.flags|=16,!(this.flags&8)&&Wt!==this)return Y1(this,!0),!0}get value(){const e=this.dep.track();return j1(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}}function IC(n,e,t=!1){let i,s;return ht(n)?i=n:(i=n.get,s=n.set),new AC(i,s,t)}const Pc={},Oh=new WeakMap;let po;function PC(n,e=!1,t=po){if(t){let i=Oh.get(t);i||Oh.set(t,i=[]),i.push(n)}}function RC(n,e,t=Xt){const{immediate:i,deep:s,once:r,scheduler:o,augmentJob:a,call:c}=t,l=x=>s?x:xn(x)||s===!1||s===0?zs(x,1):zs(x);let h,u,d,f,m=!1,p=!1;if(Qt(n)?(u=()=>n.value,m=xn(n)):or(n)?(u=()=>l(n),m=!0):et(n)?(p=!0,m=n.some(x=>or(x)||xn(x)),u=()=>n.map(x=>{if(Qt(x))return x.value;if(or(x))return l(x);if(ht(x))return c?c(x,2):x()})):ht(n)?e?u=c?()=>c(n,2):n:u=()=>{if(d){hr();try{d()}finally{ur()}}const x=po;po=h;try{return c?c(n,3,[f]):n(f)}finally{po=x}}:u=Cs,e&&s){const x=u,_=s===!0?1/0:s;u=()=>zs(x(),_)}const g=lg(),v=()=>{h.stop(),g&&g.active&&rg(g.effects,h)};if(r&&e){const x=e;e=(..._)=>{const E=x(..._);return v(),E}}let b=p?new Array(n.length).fill(Pc):Pc;const y=x=>{if(!(!(h.flags&1)||!h.dirty&&!x))if(e){const _=h.run();if(x||s||m||(p?_.some((E,S)=>xs(E,b[S])):xs(_,b))){d&&d();const E=po;po=h;try{const S=[_,b===Pc?void 0:p&&b[0]===Pc?[]:b,f];b=_,c?c(e,3,S):e(...S)}finally{po=E}}}else h.run()};return a&&a(y),h=new V1(u),h.scheduler=o?()=>o(y,!1):y,f=x=>PC(x,!1,h),d=h.onStop=()=>{const x=Oh.get(h);if(x){if(c)c(x,4);else for(const _ of x)_();Oh.delete(h)}},e?i?y(!0):b=h.run():o?o(y.bind(null,!0),!0):h.run(),v.pause=h.pause.bind(h),v.resume=h.resume.bind(h),v.stop=v,v}function zs(n,e=1/0,t){if(e<=0||!$t(n)||n.__v_skip||(t=t||new Map,(t.get(n)||0)>=e))return n;if(t.set(n,e),e--,Qt(n))zs(n.value,e,t);else if(et(n))for(let i=0;i{zs(i,e,t)});else if(F1(n)){for(const i in n)zs(n[i],e,t);for(const i of Object.getOwnPropertySymbols(n))Object.prototype.propertyIsEnumerable.call(n,i)&&zs(n[i],e,t)}return n}/** +* @vue/runtime-core v3.5.41 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/function dc(n,e,t,i){try{return i?n(...i):n()}catch(s){Yu(s,e,t)}}function On(n,e,t,i){if(ht(n)){const s=dc(n,e,t,i);return s&&R1(s)&&s.catch(r=>{Yu(r,e,t)}),s}if(et(n)){const s=[];for(let r=0;r>>1,s=Zi[i],r=Yl(s);r=Yl(t)?Zi.push(n):Zi.splice(FC(e),0,n),n.flags|=1,sx()}}function sx(){$h||($h=nx.then(ox))}function LC(n){if(!et(n))Pr&&n.id===-1?Pr.splice(ua+1,0,n):n.flags&1||(Ma.push(n),n.flags|=1);else for(let e=0;eYl(t)-Yl(i));if(Ma.length=0,Pr){for(let t=0;tn.id==null?n.flags&2?-1:1/0:n.id;function ox(n){try{for(us=0;us{i._d&&Vh(-1);const r=Nh(e),o=ar.length;let a;try{a=n(...s)}finally{for(let c=ar.length;c>o;c--)xg();Nh(r),i._d&&Vh(1)}return a};return i._n=!0,i._c=!0,i._d=!0,i}function pe(n,e){if(Wi===null)return n;const t=Ju(Wi),i=n.dirs||(n.dirs=[]);for(let s=0;s1)return t&&ht(e)?e.call(i&&i.proxy):e}}function OC(){return!!(Ku()||Fo)}const $C=Symbol.for("v-scx"),NC=()=>ko($C);function da(n,e){return gg(n,null,e)}function ei(n,e,t){return gg(n,e,t)}function gg(n,e,t=Xt){const{immediate:i,deep:s,flush:r,once:o}=t,a=Ci({},t),c=e&&i||!e&&r!=="post";let l;if(zl){if(r==="sync"){const f=NC();l=f.__watcherHandles||(f.__watcherHandles=[])}else if(!c){const f=()=>{};return f.stop=Cs,f.resume=Cs,f.pause=Cs,f}}const h=Qi;a.call=(f,m,p)=>On(f,h,m,p);let u=!1;r==="post"?a.scheduler=f=>{qi(f,h&&h.suspense)}:r!=="sync"&&(u=!0,a.scheduler=(f,m)=>{m?f():pg(f)}),a.augmentJob=f=>{e&&(f.flags|=4),u&&(f.flags|=2,h&&(f.id=h.uid,f.i=h))};const d=RC(n,e,a);return zl&&(l?l.push(d):c&&d()),d}function DC(n,e,t){const i=this.proxy,s=ii(n)?n.includes(".")?cx(i,n):()=>i[n]:n.bind(i,i);let r;ht(e)?r=e:(r=e.handler,t=e);const o=mc(this),a=gg(s,r.bind(i),t);return o(),a}function cx(n,e){const t=e.split(".");return()=>{let i=n;for(let s=0;sn.__isTeleport,wo=n=>n&&(n.disabled||n.disabled===""),BC=n=>n&&(n.defer||n.defer===""),m0=n=>typeof SVGElement<"u"&&n instanceof SVGElement,p0=n=>typeof MathMLElement=="function"&&n instanceof MathMLElement,Cm=(n,e)=>{const t=n&&n.to;return ii(t)?e?e(t):null:t},UC={name:"Teleport",__isTeleport:!0,process(n,e,t,i,s,r,o,a,c,l){const{mc:h,pc:u,pbc:d,o:{insert:f,querySelector:m,createText:p,createComment:g,parentNode:v}}=l,b=wo(e.props);let{dynamicChildren:y}=e;const x=(S,C,M)=>{S.shapeFlag&16&&h(S.children,C,M,s,r,o,a,c)},_=(S=e)=>{const C=wo(S.props),M=S.target=Cm(S.props,m),P=Mm(M,S,p,f);M&&(o!=="svg"&&m0(M)?o="svg":o!=="mathml"&&p0(M)&&(o="mathml"),s&&s.isCE&&(s.ce._teleportTargets||(s.ce._teleportTargets=new Set)).add(M),C||(x(S,M,P),gl(S,!1)))},E=S=>{const C=()=>{if(Er.get(S)===C){if(Er.delete(S),wo(S.props)){const M=v(S.el)||t;x(S,M,S.anchor),gl(S,!0)}_(S)}};Er.set(S,C),qi(C,r)};if(n==null){const S=e.el=p(""),C=e.anchor=p("");if(f(S,t,i),f(C,t,i),BC(e.props)||r&&r.pendingBranch){E(e);return}b&&(x(e,t,C),gl(e,!0)),_()}else{e.el=n.el;const S=e.anchor=n.anchor,C=Er.get(n);if(C){C.flags|=8,Er.delete(n),E(e);return}e.targetStart=n.targetStart;const M=e.target=n.target,P=e.targetAnchor=n.targetAnchor,A=wo(n.props),R=A?t:M,B=A?S:P;if(o==="svg"||m0(M)?o="svg":(o==="mathml"||p0(M))&&(o="mathml"),y?(d(n.dynamicChildren,y,R,s,r,o,a),bg(n,e,!0)):c||u(n,e,R,B,s,r,o,a,!1),b)A?e.props&&n.props&&e.props.to!==n.props.to&&(e.props.to=n.props.to):Rc(e,t,S,l,1);else if((e.props&&e.props.to)!==(n.props&&n.props.to)){const O=Cm(e.props,m);O&&(e.target=O,Rc(e,O,null,l,0))}else A&&Rc(e,M,P,l,1);gl(e,b)}},remove(n,e,t,{um:i,o:{remove:s}},r){const{shapeFlag:o,children:a,anchor:c,targetStart:l,targetAnchor:h,target:u,props:d}=n,f=wo(d),m=r||!f,p=Er.get(n);if(p&&(p.flags|=8,Er.delete(n)),u&&(s(l),s(h)),r&&s(c),!p&&(f||u)&&o&16)for(let g=0;g{n.isMounted=!0}),eo(()=>{n.isUnmounting=!0}),n}const En=[Function,Array],dx={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:En,onEnter:En,onAfterEnter:En,onEnterCancelled:En,onBeforeLeave:En,onLeave:En,onAfterLeave:En,onLeaveCancelled:En,onBeforeAppear:En,onAppear:En,onAfterAppear:En,onAppearCancelled:En},fx=n=>{const e=n.subTree;return e.component?fx(e.component):e},YC={name:"BaseTransition",props:dx,setup(n,{slots:e}){const t=Ku(),i=XC();return()=>{const s=e.default&&gx(e.default(),!0),r=s&&s.length?mx(s):t.subTree?_e():void 0;if(!r)return;const o=Mt(n),{mode:a}=o;if(i.isLeaving)return Md(r);const c=Dh(r);if(!c)return Md(r);let l=Am(c,o,i,t,u=>l=u);c.type!==ji&&Gl(c,l);let h=t.subTree&&Dh(t.subTree);if(h&&h.type!==ji&&!So(h,c)&&fx(t).type!==ji){let u=Am(h,o,i,t);if(Gl(h,u),a==="out-in"&&c.type!==ji)return i.isLeaving=!0,u.afterLeave=()=>{i.isLeaving=!1,t.job.flags&8||t.update(),delete u.afterLeave,h=void 0},Md(r);a==="in-out"&&c.type!==ji?u.delayLeave=(d,f,m)=>{const p=px(i,h);p[String(h.key)]=h,d[In]=()=>{f(),d[In]=void 0,delete l.delayedLeave,h=void 0},l.delayedLeave=()=>{m(),delete l.delayedLeave,h=void 0}}:h=void 0}else h&&(h=void 0);return r}}};function mx(n){let e=n[0];if(n.length>1){for(const t of n)if(t.type!==ji){e=t;break}}return e}const GC=YC;function px(n,e){const{leavingVNodes:t}=n;let i=t.get(e.type);return i||(i=Object.create(null),t.set(e.type,i)),i}function Am(n,e,t,i,s){const{appear:r,mode:o,persisted:a=!1,onBeforeEnter:c,onEnter:l,onAfterEnter:h,onEnterCancelled:u,onBeforeLeave:d,onLeave:f,onAfterLeave:m,onLeaveCancelled:p,onBeforeAppear:g,onAppear:v,onAfterAppear:b,onAppearCancelled:y}=e,x=String(n.key),_=px(t,n),E=(M,P)=>{M&&On(M,i,9,P)},S=(M,P)=>{const A=P[1];E(M,P),et(M)?M.every(R=>R.length<=1)&&A():M.length<=1&&A()},C={mode:o,persisted:a,beforeEnter(M){let P=c;if(!t.isMounted)if(r)P=g||c;else return;M[In]&&M[In](!0);const A=_[x];A&&So(n,A)&&A.el[In]&&A.el[In](),E(P,[M])},enter(M){if(_[x]===n)return;let P=l,A=h,R=u;if(!t.isMounted)if(r)P=v||l,A=b||h,R=y||u;else return;let B=!1;M[al]=W=>{B||(B=!0,W?E(R,[M]):E(A,[M]),C.delayedLeave&&C.delayedLeave(),M[al]=void 0)};const O=M[al].bind(null,!1);P?S(P,[M,O]):O()},leave(M,P){const A=String(n.key);if(M[al]&&M[al](!0),t.isUnmounting)return P();E(d,[M]);let R=!1;M[In]=O=>{R||(R=!0,P(),O?E(p,[M]):E(m,[M]),M[In]=void 0,_[A]===n&&delete _[A])};const B=M[In].bind(null,!1);_[A]=n,f?S(f,[M,B]):B()},clone(M){const P=Am(M,e,t,i,s);return s&&s(P),P}};return C}function Md(n){if(Wu(n))return n=Kr(n),n.children=null,n}function Dh(n){if(!Wu(n))return ju(n.type)&&n.children?mx(n.children):n;if(n.component)return n.component.subTree;const{shapeFlag:e,children:t}=n;if(t){if(e&16)return t[0];if(e&32&&ht(t.default))return t.default()}}function Gl(n,e){if(n.shapeFlag&6&&n.component){n.transition=e;const t=n.component.subTree;Gl(ju(t.type)&&Dh(t)||t,e)}else n.shapeFlag&128?(n.ssContent.transition=e.clone(n.ssContent),n.ssFallback.transition=e.clone(n.ssFallback)):n.transition=e}function gx(n,e=!1,t){let i=[],s=0;for(let r=0;r1)for(let r=0;rPl(p,e&&(et(e)?e[g]:e),t,i,s));return}if(Aa(i)&&!s){i.shapeFlag&512&&i.type.__asyncResolved&&i.component.subTree.component&&Pl(n,e,t,i.component.subTree);return}const r=i.shapeFlag&4?Ju(i.component):i.el,o=s?null:r,{i:a,r:c}=n,l=e&&e.r,h=a.refs===Xt?a.refs={}:a.refs,u=a.setupState,d=Mt(u),f=u===Xt?P1:p=>g0(h,p)?!1:Ot(d,p),m=(p,g)=>!(g&&g0(h,g));if(l!=null&&l!==c){if(v0(e),ii(l))h[l]=null,f(l)&&(u[l]=null);else if(Qt(l)){const p=e;m(l,p.k)&&(l.value=null),p.k&&(h[p.k]=null)}}if(ht(c))dc(c,a,12,[o,h]);else{const p=ii(c),g=Qt(c);if(p||g){const v=()=>{if(n.f){const b=p?f(c)?u[c]:h[c]:m()||!n.k?c.value:h[n.k];if(s)et(b)&&rg(b,r);else if(et(b))b.includes(r)||b.push(r);else if(p)h[c]=[r],f(c)&&(u[c]=h[c]);else{const y=[r];m(c,n.k)&&(c.value=y),n.k&&(h[n.k]=y)}}else p?(h[c]=o,f(c)&&(u[c]=o)):g&&(m(c,n.k)&&(c.value=o),n.k&&(h[n.k]=o))};if(o){const b=()=>{v(),Bh.delete(n)};b.id=-1,Bh.set(n,b),qi(b,t)}else v0(n),v()}}}function v0(n){const e=Bh.get(n);e&&(e.flags|=8,Bh.delete(n))}Uu().requestIdleCallback;Uu().cancelIdleCallback;const Aa=n=>!!n.type.__asyncLoader,Wu=n=>n.type.__isKeepAlive;function HC(n,e){yx(n,"a",e)}function jC(n,e){yx(n,"da",e)}function yx(n,e,t=Qi){const i=n.__wdc||(n.__wdc=()=>{let s=t;for(;s;){if(s.isDeactivated)return;s=s.parent}return n()});if(zu(e,i,t),t){let s=t.parent;for(;s&&s.parent;)Wu(s.parent.vnode)&&WC(i,e,t,s),s=s.parent}}function WC(n,e,t,i){const s=zu(e,n,i,!0);Za(()=>{rg(i[e],s)},t)}function zu(n,e,t=Qi,i=!1){if(t){const s=t[n]||(t[n]=[]),r=e.__weh||(e.__weh=(...o)=>{hr();const a=mc(t),c=On(e,t,n,o);return a(),ur(),c});return i?s.unshift(r):s.push(r),r}}const vr=n=>(e,t=Qi)=>{(!zl||n==="sp")&&zu(n,(...i)=>e(...i),t)},zC=vr("bm"),Sn=vr("m"),qC=vr("bu"),KC=vr("u"),eo=vr("bum"),Za=vr("um"),JC=vr("sp"),ZC=vr("rtg"),QC=vr("rtc");function eM(n,e=Qi){zu("ec",n,e)}const tM=Symbol.for("v-ndc");function It(n,e,t,i){let s;const r=t,o=et(n);if(o||ii(n)){const a=o&&or(n);let c=!1,l=!1;a&&(c=!xn(n),l=dr(n),n=Vu(n)),s=new Array(n.length);for(let h=0,u=n.length;he(a,c,void 0,r));else{const a=Object.keys(n);s=new Array(a.length);for(let c=0,l=a.length;c0;return Q(),Pt(Me,null,[Te("slot",l,i)],h?-2:64)}let o=n[e];o&&o._c&&(o._d=!1);const a=ar.length;Q();let c;try{const l=o&&bx(o(t)),h=t.key||r||l&&l.key;c=Pt(Me,{key:(h&&!wn(h)?h:`_${e}`)+(!l&&i?"_fb":"")},l||(i?i():[]),l&&n._===1?64:-2)}catch(l){for(let h=ar.length;h>a;h--)xg();throw l}finally{o&&o._c&&(o._d=!0)}return c}function bx(n){return n.some(e=>jl(e)?!(e.type===ji||e.type===Me&&!bx(e.children)):!0)?n:null}const Im=n=>n?Dx(n)?Ju(n):Im(n.parent):null,Rl=Ci(Object.create(null),{$:n=>n,$el:n=>n.vnode.el,$data:n=>n.data,$props:n=>n.props,$attrs:n=>n.attrs,$slots:n=>n.slots,$refs:n=>n.refs,$parent:n=>Im(n.parent),$root:n=>Im(n.root),$host:n=>n.ce,$emit:n=>n.emit,$options:n=>wx(n),$forceUpdate:n=>n.f||(n.f=()=>{pg(n.update)}),$nextTick:n=>n.n||(n.n=Gu.bind(n.proxy)),$watch:n=>DC.bind(n)}),Ad=(n,e)=>n!==Xt&&!n.__isScriptSetup&&Ot(n,e),nM={get({_:n},e){if(e==="__v_skip")return!0;const{ctx:t,setupState:i,data:s,props:r,accessCache:o,type:a,appContext:c}=n;if(e[0]!=="$"){const d=o[e];if(d!==void 0)switch(d){case 1:return i[e];case 2:return s[e];case 4:return t[e];case 3:return r[e]}else{if(Ad(i,e))return o[e]=1,i[e];if(s!==Xt&&Ot(s,e))return o[e]=2,s[e];if(Ot(r,e))return o[e]=3,r[e];if(t!==Xt&&Ot(t,e))return o[e]=4,t[e];Pm&&(o[e]=0)}}const l=Rl[e];let h,u;if(l)return e==="$attrs"&&Gi(n.attrs,"get",""),l(n);if((h=a.__cssModules)&&(h=h[e]))return h;if(t!==Xt&&Ot(t,e))return o[e]=4,t[e];if(u=c.config.globalProperties,Ot(u,e))return u[e]},set({_:n},e,t){const{data:i,setupState:s,ctx:r}=n;return Ad(s,e)?(s[e]=t,!0):i!==Xt&&Ot(i,e)?(i[e]=t,!0):Ot(n.props,e)||e[0]==="$"&&e.slice(1)in n?!1:(r[e]=t,!0)},has({_:{data:n,setupState:e,accessCache:t,ctx:i,appContext:s,props:r,type:o}},a){let c;return!!(t[a]||n!==Xt&&a[0]!=="$"&&Ot(n,a)||Ad(e,a)||Ot(r,a)||Ot(i,a)||Ot(Rl,a)||Ot(s.config.globalProperties,a)||(c=o.__cssModules)&&c[a])},defineProperty(n,e,t){return t.get!=null?n._.accessCache[e]=0:Ot(t,"value")&&this.set(n,e,t.value,null),Reflect.defineProperty(n,e,t)}};function y0(n){return et(n)?n.reduce((e,t)=>(e[t]=null,e),{}):n}let Pm=!0;function sM(n){const e=wx(n),t=n.proxy,i=n.ctx;Pm=!1,e.beforeCreate&&b0(e.beforeCreate,n,"bc");const{data:s,computed:r,methods:o,watch:a,provide:c,inject:l,created:h,beforeMount:u,mounted:d,beforeUpdate:f,updated:m,activated:p,deactivated:g,beforeDestroy:v,beforeUnmount:b,destroyed:y,unmounted:x,render:_,renderTracked:E,renderTriggered:S,errorCaptured:C,serverPrefetch:M,expose:P,inheritAttrs:A,components:R,directives:B,filters:O}=e;if(l&&rM(l,i,null),o)for(const Y in o){const L=o[Y];ht(L)&&(i[Y]=L.bind(t))}if(s){const Y=s.call(t,t);$t(Y)&&(n.data=Go(Y))}if(Pm=!0,r)for(const Y in r){const L=r[Y],N=ht(L)?L.bind(t,t):ht(L.get)?L.get.bind(t,t):Cs,F=!ht(L)&&ht(L.set)?L.set.bind(t):Cs,D=Fe({get:N,set:F});Object.defineProperty(i,Y,{enumerable:!0,configurable:!0,get:()=>D.value,set:X=>D.value=X})}if(a)for(const Y in a)xx(a[Y],i,t,Y);if(c){const Y=ht(c)?c.call(t):c;Reflect.ownKeys(Y).forEach(L=>{lx(L,Y[L])})}h&&b0(h,n,"c");function V(Y,L){et(L)?L.forEach(N=>Y(N.bind(t))):L&&Y(L.bind(t))}if(V(zC,u),V(Sn,d),V(qC,f),V(KC,m),V(HC,p),V(jC,g),V(eM,C),V(QC,E),V(ZC,S),V(eo,b),V(Za,x),V(JC,M),et(P))if(P.length){const Y=n.exposed||(n.exposed={});P.forEach(L=>{Object.defineProperty(Y,L,{get:()=>t[L],set:N=>t[L]=N,enumerable:!0})})}else n.exposed||(n.exposed={});_&&n.render===Cs&&(n.render=_),A!=null&&(n.inheritAttrs=A),R&&(n.components=R),B&&(n.directives=B),M&&vx(n)}function rM(n,e,t=Cs){et(n)&&(n=Rm(n));for(const i in n){const s=n[i];let r;$t(s)?"default"in s?r=ko(s.from||i,s.default,!0):r=ko(s.from||i):r=ko(s),Qt(r)?Object.defineProperty(e,i,{enumerable:!0,configurable:!0,get:()=>r.value,set:o=>r.value=o}):e[i]=r}}function b0(n,e,t){On(et(n)?n.map(i=>i.bind(e.proxy)):n.bind(e.proxy),e,t)}function xx(n,e,t,i){let s=i.includes(".")?cx(t,i):()=>t[i];if(ii(n)){const r=e[n];ht(r)&&ei(s,r)}else if(ht(n))ei(s,n.bind(t));else if($t(n))if(et(n))n.forEach(r=>xx(r,e,t,i));else{const r=ht(n.handler)?n.handler.bind(t):e[n.handler];ht(r)&&ei(s,r,n)}}function wx(n){const e=n.type,{mixins:t,extends:i}=e,{mixins:s,optionsCache:r,config:{optionMergeStrategies:o}}=n.appContext,a=r.get(e);let c;return a?c=a:!s.length&&!t&&!i?c=e:(c={},s.length&&s.forEach(l=>Uh(c,l,o,!0)),Uh(c,e,o)),$t(e)&&r.set(e,c),c}function Uh(n,e,t,i=!1){const{mixins:s,extends:r}=e;r&&Uh(n,r,t,!0),s&&s.forEach(o=>Uh(n,o,t,!0));for(const o in e)if(!(i&&o==="expose")){const a=oM[o]||t&&t[o];n[o]=a?a(n[o],e[o]):e[o]}return n}const oM={data:x0,props:w0,emits:w0,methods:vl,computed:vl,beforeCreate:zi,created:zi,beforeMount:zi,mounted:zi,beforeUpdate:zi,updated:zi,beforeDestroy:zi,beforeUnmount:zi,destroyed:zi,unmounted:zi,activated:zi,deactivated:zi,errorCaptured:zi,serverPrefetch:zi,components:vl,directives:vl,watch:lM,provide:x0,inject:aM};function x0(n,e){return e?n?function(){return Ci(ht(n)?n.call(this,this):n,ht(e)?e.call(this,this):e)}:e:n}function aM(n,e){return vl(Rm(n),Rm(e))}function Rm(n){if(et(n)){const e={};for(let t=0;te==="modelValue"||e==="model-value"?n.modelModifiers:n[`${e}Modifiers`]||n[`${qn(e)}Modifiers`]||n[`${Qr(e)}Modifiers`];function dM(n,e,...t){if(n.isUnmounted)return;const i=n.vnode.props||Xt;let s=t;const r=e.startsWith("update:"),o=r&&uM(i,e.slice(7));o&&(o.trim&&(s=t.map(h=>ii(h)?h.trim():h)),o.number&&(s=t.map(Bu)));let a,c=i[a=Sd(e)]||i[a=Sd(qn(e))];!c&&r&&(c=i[a=Sd(Qr(e))]),c&&On(c,n,6,s);const l=i[a+"Once"];if(l){if(!n.emitted)n.emitted={};else if(n.emitted[a])return;n.emitted[a]=!0,On(l,n,6,s)}}const fM=new WeakMap;function _x(n,e,t=!1){const i=t?fM:e.emitsCache,s=i.get(n);if(s!==void 0)return s;const r=n.emits;let o={},a=!1;if(!ht(n)){const c=l=>{const h=_x(l,e,!0);h&&(a=!0,Ci(o,h))};!t&&e.mixins.length&&e.mixins.forEach(c),n.extends&&c(n.extends),n.mixins&&n.mixins.forEach(c)}return!r&&!a?($t(n)&&i.set(n,null),null):(et(r)?r.forEach(c=>o[c]=null):Ci(o,r),$t(n)&&i.set(n,o),o)}function qu(n,e){return!n||!Ou(e)?!1:(e=e.slice(2),e=e==="Once"?e:e.replace(/Once$/,""),Ot(n,e[0].toLowerCase()+e.slice(1))||Ot(n,Qr(e))||Ot(n,e))}function S0(n){const{type:e,vnode:t,proxy:i,withProxy:s,propsOptions:[r],slots:o,attrs:a,emit:c,render:l,renderCache:h,props:u,data:d,setupState:f,ctx:m,inheritAttrs:p}=n,g=Nh(n);let v,b;try{if(t.shapeFlag&4){const x=s||i,_=x;v=vs(l.call(_,x,h,u,f,d,m)),b=a}else{const x=e;v=vs(x.length>1?x(u,{attrs:a,slots:o,emit:c}):x(u,null)),b=e.props?a:mM(a)}}catch(x){ar.length=0,Yu(x,n,1),v=Te(ji)}let y=v;if(b&&p!==!1){const x=Object.keys(b),{shapeFlag:_}=y;x.length&&_&7&&(r&&x.some($u)&&(b=pM(b,r)),y=Kr(y,b,!1,!0))}if(t.dirs&&(y=Kr(y,null,!1,!0),y.dirs=y.dirs?y.dirs.concat(t.dirs):t.dirs),t.transition){const x=ju(y.type)&&Dh(y)||y;Gl(x,t.transition)}return v=y,Nh(g),v}const mM=n=>{let e;for(const t in n)(t==="class"||t==="style"||Ou(t))&&((e||(e={}))[t]=n[t]);return e},pM=(n,e)=>{const t={};for(const i in n)(!$u(i)||!(i.slice(9)in e))&&(t[i]=n[i]);return t};function gM(n,e,t){const{props:i,children:s,component:r}=n,{props:o,children:a,patchFlag:c}=e,l=r.emitsOptions;if(e.dirs||e.transition)return!0;if(t&&c>=0){if(c&1024)return!0;if(c&16)return i?_0(i,o,l):!!o;if(c&8){const h=e.dynamicProps;for(let u=0;uObject.create(Ex),Mx=n=>Object.getPrototypeOf(n)===Ex;function yM(n,e,t,i=!1){const s={},r=Cx();n.propsDefaults=Object.create(null),Ax(n,e,s,r);for(const o in n.propsOptions[0])o in s||(s[o]=void 0);t?n.props=i?s:wC(s):n.type.props?n.props=s:n.props=r,n.attrs=r}function bM(n,e,t,i){const{props:s,attrs:r,vnode:{patchFlag:o}}=n,a=Mt(s),[c]=n.propsOptions;let l=!1;if((i||o>0)&&!(o&16)){if(o&8){const h=n.vnode.dynamicProps;for(let u=0;u{c=!0;const[d,f]=Ix(u,e,!0);Ci(o,d),f&&a.push(...f)};!t&&e.mixins.length&&e.mixins.forEach(h),n.extends&&h(n.extends),n.mixins&&n.mixins.forEach(h)}if(!r&&!c)return $t(n)&&i.set(n,Ea),Ea;if(et(r))for(let h=0;hn==="_"||n==="_ctx"||n==="$stable",yg=n=>et(n)?n.map(vs):[vs(n)],wM=(n,e,t)=>{if(e._n)return e;const i=Hu((...s)=>yg(e(...s)),t);return i._c=!1,i},Px=(n,e,t)=>{const i=n._ctx;for(const s in n){if(vg(s))continue;const r=n[s];if(ht(r))e[s]=wM(s,r,i);else if(r!=null){const o=yg(r);e[s]=()=>o}}},Rx=(n,e)=>{const t=yg(e);n.slots.default=()=>t},kx=(n,e,t)=>{for(const i in e)(t||!vg(i))&&(n[i]=e[i])},SM=(n,e,t)=>{const i=n.slots=Cx();if(n.vnode.shapeFlag&32){const s=e._;s?(kx(i,e,t),t&&O1(i,"_",s,!0)):Px(e,i)}else e&&Rx(n,e)},_M=(n,e,t)=>{const{vnode:i,slots:s}=n;let r=!0,o=Xt;if(i.shapeFlag&32){const a=e._;a?t&&a===1?r=!1:kx(s,e,t):(r=!e.$stable,Px(e,s)),o=e}else e&&(Rx(n,e),o={default:1});if(r)for(const a in s)!vg(a)&&o[a]==null&&delete s[a]},qi=AM;function TM(n){return EM(n)}function EM(n,e){const t=Uu();t.__VUE__=!0;const{insert:i,remove:s,patchProp:r,createElement:o,createText:a,createComment:c,setText:l,setElementText:h,parentNode:u,nextSibling:d,setScopeId:f=Cs,insertStaticContent:m}=n,p=(q,Z,se,H=null,j=null,$=null,U=void 0,z=null,ee=!!Z.dynamicChildren)=>{if(q===Z)return;q&&!So(q,Z)&&(H=le(q),X(q,j,$,!0),q=null),Z.patchFlag===-2&&(ee=!1,Z.dynamicChildren=null);const{type:ne,ref:ue,shapeFlag:xe}=Z;switch(ne){case fc:g(q,Z,se,H);break;case ji:v(q,Z,se,H);break;case vh:q==null&&b(Z,se,H,U);break;case Me:R(q,Z,se,H,j,$,U,z,ee);break;default:xe&1?_(q,Z,se,H,j,$,U,z,ee):xe&6?B(q,Z,se,H,j,$,U,z,ee):(xe&64||xe&128)&&ne.process(q,Z,se,H,j,$,U,z,ee,fe)}ue!=null&&j?Pl(ue,q&&q.ref,$,Z||q,!Z):ue==null&&q&&q.ref!=null&&Pl(q.ref,null,$,q,!0)},g=(q,Z,se,H)=>{if(q==null)i(Z.el=a(Z.children),se,H);else{const j=Z.el=q.el;Z.children!==q.children&&l(j,Z.children)}},v=(q,Z,se,H)=>{q==null?i(Z.el=c(Z.children||""),se,H):Z.el=q.el},b=(q,Z,se,H)=>{[q.el,q.anchor]=m(q.children,Z,se,H,q.el,q.anchor)},y=({el:q,anchor:Z},se,H)=>{let j;for(;q&&q!==Z;)j=d(q),i(q,se,H),q=j;i(Z,se,H)},x=({el:q,anchor:Z})=>{let se;for(;q&&q!==Z;)se=d(q),s(q),q=se;s(Z)},_=(q,Z,se,H,j,$,U,z,ee)=>{if(Z.type==="svg"?U="svg":Z.type==="math"&&(U="mathml"),q==null)E(Z,se,H,j,$,U,z,ee);else{const ne=q.el&&q.el._isVueCE?q.el:null;try{ne&&ne._beginPatch(),M(q,Z,j,$,U,z,ee)}finally{ne&&ne._endPatch()}}},E=(q,Z,se,H,j,$,U,z)=>{let ee,ne;const{props:ue,shapeFlag:xe,transition:be,dirs:Ne}=q;if(ee=q.el=o(q.type,$,ue&&ue.is,ue),xe&8?h(ee,q.children):xe&16&&C(q.children,ee,null,H,j,Id(q,$),U,z),Ne&&ao(q,null,H,"created"),S(ee,q,q.scopeId,U,H),ue){for(const he in ue)he!=="value"&&!Ml(he)&&r(ee,he,null,ue[he],$,H);"value"in ue&&r(ee,"value",null,ue.value,$),(ne=ue.onVnodeBeforeMount)&&ns(ne,H,q)}Ne&&ao(q,null,H,"beforeMount");const Be=CM(j,be);Be&&be.beforeEnter(ee),i(ee,Z,se),((ne=ue&&ue.onVnodeMounted)||Be||Ne)&&qi(()=>{try{ne&&ns(ne,H,q),Be&&be.enter(ee),Ne&&ao(q,null,H,"mounted")}finally{}},j)},S=(q,Z,se,H,j)=>{if(se&&f(q,se),H)for(let $=0;${for(let ne=ee;ne{const z=Z.el=q.el;let{patchFlag:ee,dynamicChildren:ne,dirs:ue}=Z;ee|=q.patchFlag&16;const xe=q.props||Xt,be=Z.props||Xt;let Ne;if(se&&lo(se,!1),(Ne=be.onVnodeBeforeUpdate)&&ns(Ne,se,Z,q),ue&&ao(Z,q,se,"beforeUpdate"),se&&lo(se,!0),ne&&(!q.dynamicChildren||q.dynamicChildren.length!==ne.length)&&(ee=0,U=!1,ne=null),(xe.innerHTML&&be.innerHTML==null||xe.textContent&&be.textContent==null)&&h(z,""),ne?P(q.dynamicChildren,ne,z,se,H,Id(Z,j),$):U||L(q,Z,z,null,se,H,Id(Z,j),$,!1),ee>0){if(ee&16)A(z,xe,be,se,j);else if(ee&2&&xe.class!==be.class&&r(z,"class",null,be.class,j),ee&4&&r(z,"style",xe.style,be.style,j),ee&8){const Be=Z.dynamicProps;for(let he=0;he{Ne&&ns(Ne,se,Z,q),ue&&ao(Z,q,se,"updated")},H)},P=(q,Z,se,H,j,$,U)=>{for(let z=0;z{if(Z!==se){if(Z!==Xt)for(const $ in Z)!Ml($)&&!($ in se)&&r(q,$,Z[$],null,j,H);for(const $ in se){if(Ml($))continue;const U=se[$],z=Z[$];U!==z&&$!=="value"&&r(q,$,z,U,j,H)}"value"in se&&r(q,"value",Z.value,se.value,j)}},R=(q,Z,se,H,j,$,U,z,ee)=>{const ne=Z.el=q?q.el:a(""),ue=Z.anchor=q?q.anchor:a("");let{patchFlag:xe,dynamicChildren:be,slotScopeIds:Ne}=Z;Ne&&(z=z?z.concat(Ne):Ne),q==null?(i(ne,se,H),i(ue,se,H),C(Z.children||[],se,ue,j,$,U,z,ee)):xe>0&&xe&64&&be&&q.dynamicChildren&&q.dynamicChildren.length===be.length?(P(q.dynamicChildren,be,se,j,$,U,z),(Z.key!=null||j&&Z===j.subTree)&&bg(q,Z,!0)):L(q,Z,se,ue,j,$,U,z,ee)},B=(q,Z,se,H,j,$,U,z,ee)=>{Z.slotScopeIds=z,q==null?Z.shapeFlag&512?j.ctx.activate(Z,se,H,U,ee):O(Z,se,H,j,$,U,ee):W(q,Z,ee)},O=(q,Z,se,H,j,$,U)=>{const z=q.component=OM(q,H,j);if(Wu(q)&&(z.ctx.renderer=fe),$M(z,!1,U),z.asyncDep){if(j&&j.registerDep(z,V,U),!q.el){const ee=z.subTree=Te(ji);v(null,ee,Z,se),q.placeholder=ee.el}}else V(z,q,Z,se,j,$,U)},W=(q,Z,se)=>{const H=Z.component=q.component;if(gM(q,Z,se))if(H.asyncDep&&!H.asyncResolved){Y(H,Z,se);return}else H.next=Z,H.update();else Z.el=q.el,H.vnode=Z},V=(q,Z,se,H,j,$,U)=>{const z=()=>{if(q.isMounted){let{next:xe,bu:be,u:Ne,parent:Be,vnode:he}=q;{const Ze=Fx(q);if(Ze){xe&&(xe.el=he.el,Y(q,xe,U)),Ze.asyncDep.then(()=>{qi(()=>{q.isUnmounted||ne()},j)});return}}let ge=xe,We;lo(q,!1),xe?(xe.el=he.el,Y(q,xe,U)):xe=he,be&&gh(be),(We=xe.props&&xe.props.onVnodeBeforeUpdate)&&ns(We,Be,xe,he),lo(q,!0);const Le=S0(q),Ce=q.subTree;q.subTree=Le,p(Ce,Le,u(Ce.el),le(Ce),q,j,$),xe.el=Le.el,ge===null&&vM(q,Le.el),Ne&&qi(Ne,j),(We=xe.props&&xe.props.onVnodeUpdated)&&qi(()=>ns(We,Be,xe,he),j)}else{let xe;const{el:be,props:Ne}=Z,{bm:Be,m:he,parent:ge,root:We,type:Le}=q,Ce=Aa(Z);lo(q,!1),Be&&gh(Be),!Ce&&(xe=Ne&&Ne.onVnodeBeforeMount)&&ns(xe,ge,Z),lo(q,!0);{We.ce&&We.ce._hasShadowRoot()&&We.ce._injectChildStyle(Le,q.parent?q.parent.type:void 0);const Ze=q.subTree=S0(q);p(null,Ze,se,H,q,j,$),Z.el=Ze.el}if(he&&qi(he,j),!Ce&&(xe=Ne&&Ne.onVnodeMounted)){const Ze=Z;qi(()=>ns(xe,ge,Ze),j)}(Z.shapeFlag&256||ge&&Aa(ge.vnode)&&ge.vnode.shapeFlag&256)&&q.a&&qi(q.a,j),q.isMounted=!0,Z=se=H=null}};q.scope.on();const ee=q.effect=new V1(z);q.scope.off();const ne=q.update=ee.run.bind(ee),ue=q.job=ee.runIfDirty.bind(ee);ue.i=q,ue.id=q.uid,ee.scheduler=()=>pg(ue),lo(q,!0),ne()},Y=(q,Z,se)=>{Z.component=q;const H=q.vnode.props;q.vnode=Z,q.next=null,bM(q,Z.props,H,se),_M(q,Z.children,se),hr(),f0(q),ur()},L=(q,Z,se,H,j,$,U,z,ee=!1)=>{const ne=q&&q.children,ue=q?q.shapeFlag:0,xe=Z.children,{patchFlag:be,shapeFlag:Ne}=Z;if(be>0){if(be&128){F(ne,xe,se,H,j,$,U,z,ee);return}else if(be&256){N(ne,xe,se,H,j,$,U,z,ee);return}}Ne&8?(ue&16&&oe(ne,j,$),xe!==ne&&h(se,xe)):ue&16?Ne&16?F(ne,xe,se,H,j,$,U,z,ee):oe(ne,j,$,!0):(ue&8&&h(se,""),Ne&16&&C(xe,se,H,j,$,U,z,ee))},N=(q,Z,se,H,j,$,U,z,ee)=>{q=q||Ea,Z=Z||Ea;const ne=q.length,ue=Z.length,xe=Math.min(ne,ue);let be;for(be=0;beue?oe(q,j,$,!0,!1,xe):C(Z,se,H,j,$,U,z,ee,xe)},F=(q,Z,se,H,j,$,U,z,ee)=>{let ne=0;const ue=Z.length;let xe=q.length-1,be=ue-1;for(;ne<=xe&&ne<=be;){const Ne=q[ne],Be=Z[ne]=ee?js(Z[ne]):vs(Z[ne]);if(So(Ne,Be))p(Ne,Be,se,null,j,$,U,z,ee);else break;ne++}for(;ne<=xe&&ne<=be;){const Ne=q[xe],Be=Z[be]=ee?js(Z[be]):vs(Z[be]);if(So(Ne,Be))p(Ne,Be,se,null,j,$,U,z,ee);else break;xe--,be--}if(ne>xe){if(ne<=be){const Ne=be+1,Be=Nebe)for(;ne<=xe;)X(q[ne],j,$,!0),ne++;else{const Ne=ne,Be=ne,he=new Map;for(ne=Be;ne<=be;ne++){const lt=Z[ne]=ee?js(Z[ne]):vs(Z[ne]);lt.key!=null&&he.set(lt.key,ne)}let ge,We=0;const Le=be-Be+1;let Ce=!1,Ze=0;const Ee=new Array(Le);for(ne=0;ne=Le){X(lt,j,$,!0);continue}let ce;if(lt.key!=null)ce=he.get(lt.key);else for(ge=Be;ge<=be;ge++)if(Ee[ge-Be]===0&&So(lt,Z[ge])){ce=ge;break}ce===void 0?X(lt,j,$,!0):(Ee[ce-Be]=ne+1,ce>=Ze?Ze=ce:Ce=!0,p(lt,Z[ce],se,null,j,$,U,z,ee),We++)}const vi=Ce?MM(Ee):Ea;for(ge=vi.length-1,ne=Le-1;ne>=0;ne--){const lt=Be+ne,ce=Z[lt],de=Z[lt+1],nt=lt+1{const{el:$,type:U,transition:z,children:ee,shapeFlag:ne}=q;if(ne&6){D(q.component.subTree,Z,se,H);return}if(ne&128){q.suspense.move(Z,se,H);return}if(ne&64){U.move(q,Z,se,fe);return}if(U===Me){i($,Z,se);for(let xe=0;xez.enter($),j));else{const{leave:xe,delayLeave:be,afterLeave:Ne}=z,Be=()=>{q.ctx.isUnmounted?s($):i($,Z,se)},he=()=>{const ge=$._isLeaving||!!$[In];$._isLeaving&&$[In](!0),z.persisted&&!ge?Be():xe($,()=>{Be(),Ne&&Ne()})};be?be($,Be,he):he()}else i($,Z,se)},X=(q,Z,se,H=!1,j=!1)=>{const{type:$,props:U,ref:z,children:ee,dynamicChildren:ne,shapeFlag:ue,patchFlag:xe,dirs:be,cacheIndex:Ne,memo:Be}=q;if(xe===-2&&(j=!1),z!=null&&(hr(),Pl(z,null,se,q,!0),ur()),Ne!=null&&(Z.renderCache[Ne]=void 0),ue&256){Z.ctx.deactivate(q);return}const he=ue&1&&be,ge=!Aa(q);let We;if(ge&&(We=U&&U.onVnodeBeforeUnmount)&&ns(We,Z,q),ue&6)J(q.component,se,H);else{if(ue&128){q.suspense.unmount(se,H);return}he&&ao(q,null,Z,"beforeUnmount"),ue&64?q.type.remove(q,Z,se,fe,H):ne&&!ne.hasOnce&&($!==Me||xe>0&&xe&64)?oe(ne,Z,se,!1,!0):($===Me&&xe&384||!j&&ue&16)&&oe(ee,Z,se),H&&G(q)}const Le=Be!=null&&Ne==null;(ge&&(We=U&&U.onVnodeUnmounted)||he||Le)&&qi(()=>{We&&ns(We,Z,q),he&&ao(q,null,Z,"unmounted"),Le&&(q.el=null)},se)},G=q=>{const{type:Z,el:se,anchor:H,transition:j}=q;if(Z===Me){K(se,H);return}if(Z===vh){x(q);return}const $=()=>{s(se),j&&!j.persisted&&j.afterLeave&&j.afterLeave()};if(q.shapeFlag&1&&j&&!j.persisted){const{leave:U,delayLeave:z}=j,ee=()=>U(se,$);z?z(q.el,$,ee):ee()}else $()},K=(q,Z)=>{let se;for(;q!==Z;)se=d(q),s(q),q=se;s(Z)},J=(q,Z,se)=>{const{bum:H,scope:j,job:$,subTree:U,um:z,m:ee,a:ne}=q;E0(ee),E0(ne),H&&gh(H),j.stop(),$&&($.flags|=8,X(U,q,Z,se)),z&&qi(z,Z),qi(()=>{q.isUnmounted=!0},Z)},oe=(q,Z,se,H=!1,j=!1,$=0)=>{for(let U=$;U{if(q.shapeFlag&6)return le(q.component.subTree);if(q.shapeFlag&128)return q.suspense.next();const Z=d(q.anchor||q.el),se=Z&&Z[hx];return se?d(se):Z};let ve=!1;const Se=(q,Z,se)=>{let H;q==null?Z._vnode&&(X(Z._vnode,null,null,!0),H=Z._vnode.component):p(Z._vnode||null,q,Z,null,null,null,se),Z._vnode=q,ve||(ve=!0,f0(H),rx(),ve=!1)},fe={p,um:X,m:D,r:G,mt:O,mc:C,pc:L,pbc:P,n:le,o:n};return{render:Se,hydrate:void 0,createApp:hM(Se)}}function Id({type:n,props:e},t){return t==="svg"&&n==="foreignObject"||t==="mathml"&&n==="annotation-xml"&&e&&e.encoding&&e.encoding.includes("html")?void 0:t}function lo({effect:n,job:e},t){t?(n.flags|=32,e.flags|=4):(n.flags&=-33,e.flags&=-5)}function CM(n,e){return(!n||n&&!n.pendingBranch)&&e&&!e.persisted}function bg(n,e,t=!1){const i=n.children,s=e.children;if(et(i)&&et(s))for(let r=0;r>1,n[t[a]]0&&(e[i]=t[r-1]),t[r]=i)}}for(r=t.length,o=t[r-1];r-- >0;)t[r]=o,o=e[o];return t}function Fx(n){const e=n.subTree.component;if(e)return e.asyncDep&&!e.asyncResolved?e:Fx(e)}function E0(n){if(n)for(let e=0;en.__isSuspense;function AM(n,e){e&&e.pendingBranch?et(n)?e.effects.push(...n):e.effects.push(n):LC(n)}const Me=Symbol.for("v-fgt"),fc=Symbol.for("v-txt"),ji=Symbol.for("v-cmt"),vh=Symbol.for("v-stc"),ar=[];let bn=null;function Q(n=!1){ar.push(bn=n?null:[])}function xg(){ar.pop(),bn=ar[ar.length-1]||null}let Hl=1;function Vh(n,e=!1){Hl+=n,n<0&&bn&&e&&(bn.hasOnce=!0)}function $x(n){return n.dynamicChildren=Hl>0?bn||Ea:null,xg(),Hl>0&&bn&&bn.push(n),n}function te(n,e,t,i,s,r){return $x(w(n,e,t,i,s,r,!0))}function Pt(n,e,t,i,s){return $x(Te(n,e,t,i,s,!0))}function jl(n){return n?n.__v_isVNode===!0:!1}function So(n,e){return n.type===e.type&&n.key===e.key}const Nx=({key:n})=>n??null,yh=({ref:n,ref_key:e,ref_for:t})=>(typeof n=="number"&&(n=""+n),n!=null?ii(n)||Qt(n)||ht(n)?{i:Wi,r:n,k:e,f:!!t}:n:null);function w(n,e=null,t=null,i=0,s=null,r=n===Me?0:1,o=!1,a=!1){const c={__v_isVNode:!0,__v_skip:!0,type:n,props:e,key:e&&Nx(e),ref:e&&yh(e),scopeId:ax,slotScopeIds:null,children:t,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:r,patchFlag:i,dynamicProps:s,dynamicChildren:null,appContext:null,ctx:Wi};return a?(Xh(c,t),r&128&&n.normalize(c)):t&&(c.shapeFlag|=ii(t)?8:16),Hl>0&&!o&&bn&&(c.patchFlag>0||r&6)&&c.patchFlag!==32&&bn.push(c),c}const Te=IM;function IM(n,e=null,t=null,i=0,s=null,r=!1){if((!n||n===tM)&&(n=ji),jl(n)){const a=Kr(n,e,!0);return t&&Xh(a,t),Hl>0&&!r&&bn&&(a.shapeFlag&6?bn[bn.indexOf(n)]=a:bn.push(a)),a.patchFlag=-2,a}if(UM(n)&&(n=n.__vccOpts),e){e=PM(e);let{class:a,style:c}=e;a&&!ii(a)&&(e.class=Pe(a)),$t(c)&&(Xu(c)&&!et(c)&&(c=Ci({},c)),e.style=Vt(c))}const o=ii(n)?1:Ox(n)?128:ju(n)?64:$t(n)?4:ht(n)?2:0;return w(n,e,t,i,s,o,r,!0)}function PM(n){return n?Xu(n)||Mx(n)?Ci({},n):n:null}function Kr(n,e,t=!1,i=!1){const{props:s,ref:r,patchFlag:o,children:a,transition:c}=n,l=e?kM(s||{},e):s,h={__v_isVNode:!0,__v_skip:!0,type:n.type,props:l,key:l&&Nx(l),ref:e&&e.ref?t&&r?et(r)?r.concat(yh(e)):[r,yh(e)]:yh(e):r,scopeId:n.scopeId,slotScopeIds:n.slotScopeIds,children:a,target:n.target,targetStart:n.targetStart,targetAnchor:n.targetAnchor,staticCount:n.staticCount,shapeFlag:n.shapeFlag,patchFlag:e&&n.type!==Me?o===-1?16:o|16:o,dynamicProps:n.dynamicProps,dynamicChildren:n.dynamicChildren,appContext:n.appContext,dirs:n.dirs,transition:c,component:n.component,suspense:n.suspense,ssContent:n.ssContent&&Kr(n.ssContent),ssFallback:n.ssFallback&&Kr(n.ssFallback),placeholder:n.placeholder,el:n.el,anchor:n.anchor,ctx:n.ctx,ce:n.ce};return c&&i&&Gl(h,c.clone(h)),h}function yt(n=" ",e=0){return Te(fc,null,n,e)}function RM(n,e){const t=Te(vh,null,n);return t.staticCount=e,t}function _e(n="",e=!1){return e?(Q(),Pt(ji,null,n)):Te(ji,null,n)}function vs(n){return n==null||typeof n=="boolean"?Te(ji):et(n)?Te(Me,null,n.slice()):jl(n)?js(n):Te(fc,null,String(n))}function js(n){return n.el===null&&n.patchFlag!==-1||n.memo?n:Kr(n)}function Xh(n,e){let t=0;const{shapeFlag:i}=n;if(e==null)e=null;else if(et(e))t=16;else if(typeof e=="object")if(i&65){const s=e.default;s&&(s._c&&(s._d=!1),Xh(n,s()),s._c&&(s._d=!0));return}else{t=32;const s=e._;!s&&!Mx(e)?e._ctx=Wi:s===3&&Wi&&(Wi.slots._===1?e._=1:(e._=2,n.patchFlag|=1024))}else if(ht(e)){if(i&65){Xh(n,{default:e});return}e={default:e,_ctx:Wi},t=32}else e=String(e),i&64?(t=16,e=[yt(e)]):t=8;n.children=e,n.shapeFlag|=t}function kM(...n){const e={};for(let t=0;tQi||Wi;let Yh,Wl;{const n=Uu(),e=(t,i)=>{let s;return(s=n[t])||(s=n[t]=[]),s.push(i),r=>{s.length>1?s.forEach(o=>o(r)):s[0](r)}};Yh=e("__VUE_INSTANCE_SETTERS__",t=>Qi=t),Wl=e("__VUE_SSR_SETTERS__",t=>zl=t)}const mc=n=>{const e=Qi;return Yh(n),n.scope.on(),()=>{n.scope.off(),Yh(e)}},C0=()=>{Qi&&Qi.scope.off(),Yh(null)};function Dx(n){return n.vnode.shapeFlag&4}let zl=!1;function $M(n,e=!1,t=!1){e&&Wl(e);const{props:i,children:s}=n.vnode,r=Dx(n);yM(n,i,r,e),SM(n,s,t||e);const o=r?NM(n,e):void 0;return e&&Wl(!1),o}function NM(n,e){const t=n.type;n.accessCache=Object.create(null),n.proxy=new Proxy(n.ctx,nM);const{setup:i}=t;if(i){hr();const s=n.setupContext=i.length>1?BM(n):null,r=mc(n),o=dc(i,n,0,[n.props,s]),a=R1(o);if(ur(),r(),(a||n.sp)&&!Aa(n)&&vx(n),a){if(o.then(C0,C0),e)return o.then(c=>{Wl(!0);try{M0(n,c,e)}finally{Wl(!1)}}).catch(c=>{Yu(c,n,0)});n.asyncDep=o}else M0(n,o)}else Bx(n)}function M0(n,e,t){ht(e)?n.type.__ssrInlineRender?n.ssrRender=e:n.render=e:$t(e)&&(n.setupState=ix(e)),Bx(n)}function Bx(n,e,t){const i=n.type;n.render||(n.render=i.render||Cs);{const s=mc(n);hr();try{sM(n)}finally{ur(),s()}}}const DM={get(n,e){return Gi(n,"get",""),n[e]}};function BM(n){const e=t=>{n.exposed=t||{}};return{attrs:new Proxy(n.attrs,DM),slots:n.slots,emit:n.emit,expose:e}}function Ju(n){return n.exposed?n.exposeProxy||(n.exposeProxy=new Proxy(ix(Ur(n.exposed)),{get(e,t){if(t in e)return e[t];if(t in Rl)return Rl[t](n)},has(e,t){return t in e||t in Rl}})):n.proxy}function UM(n){return ht(n)&&"__vccOpts"in n}const Fe=(n,e)=>IC(n,e,zl);function ql(n,e,t){try{Vh(-1);const i=arguments.length;return i===2?$t(e)&&!et(e)?jl(e)?Te(n,null,[e]):Te(n,e):Te(n,null,e):(i>3?t=Array.prototype.slice.call(arguments,2):i===3&&jl(t)&&(t=[t]),Te(n,e,t))}finally{Vh(1)}}const VM="3.5.41";/** +* @vue/runtime-dom v3.5.41 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/let Fm;const A0=typeof window<"u"&&window.trustedTypes;if(A0)try{Fm=A0.createPolicy("vue",{createHTML:n=>n})}catch{}const Ux=Fm?n=>Fm.createHTML(n):n=>n,XM="http://www.w3.org/2000/svg",YM="http://www.w3.org/1998/Math/MathML",Vs=typeof document<"u"?document:null,I0=Vs&&Vs.createElement("template"),GM={insert:(n,e,t)=>{e.insertBefore(n,t||null)},remove:n=>{const e=n.parentNode;e&&e.removeChild(n)},createElement:(n,e,t,i)=>{const s=e==="svg"?Vs.createElementNS(XM,n):e==="mathml"?Vs.createElementNS(YM,n):t?Vs.createElement(n,{is:t}):Vs.createElement(n);return n==="select"&&i&&i.multiple!=null&&s.setAttribute("multiple",i.multiple),s},createText:n=>Vs.createTextNode(n),createComment:n=>Vs.createComment(n),setText:(n,e)=>{n.nodeValue=e},setElementText:(n,e)=>{n.textContent=e},parentNode:n=>n.parentNode,nextSibling:n=>n.nextSibling,querySelector:n=>Vs.querySelector(n),setScopeId(n,e){n.setAttribute(e,"")},insertStaticContent(n,e,t,i,s,r){const o=t?t.previousSibling:e.lastChild;if(s&&(s===r||s.nextSibling))for(;e.insertBefore(s.cloneNode(!0),t),!(s===r||!(s=s.nextSibling)););else{I0.innerHTML=Ux(i==="svg"?`${n}`:i==="mathml"?`${n}`:n);const a=I0.content;if(i==="svg"||i==="mathml"){const c=a.firstChild;for(;c.firstChild;)a.appendChild(c.firstChild);a.removeChild(c)}e.insertBefore(a,t)}return[o?o.nextSibling:e.firstChild,t?t.previousSibling:e.lastChild]}},wr="transition",ll="animation",Kl=Symbol("_vtc"),Vx={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},HM=Ci({},dx,Vx),jM=n=>(n.displayName="Transition",n.props=HM,n),WM=jM((n,{slots:e})=>ql(GC,zM(n),e)),co=(n,e=[])=>{et(n)?n.forEach(t=>t(...e)):n&&n(...e)},P0=n=>n?et(n)?n.some(e=>e.length>1):n.length>1:!1;function zM(n){const e={};for(const R in n)R in Vx||(e[R]=n[R]);if(n.css===!1)return e;const{name:t="v",type:i,duration:s,enterFromClass:r=`${t}-enter-from`,enterActiveClass:o=`${t}-enter-active`,enterToClass:a=`${t}-enter-to`,appearFromClass:c=r,appearActiveClass:l=o,appearToClass:h=a,leaveFromClass:u=`${t}-leave-from`,leaveActiveClass:d=`${t}-leave-active`,leaveToClass:f=`${t}-leave-to`}=n,m=qM(s),p=m&&m[0],g=m&&m[1],{onBeforeEnter:v,onEnter:b,onEnterCancelled:y,onLeave:x,onLeaveCancelled:_,onBeforeAppear:E=v,onAppear:S=b,onAppearCancelled:C=y}=e,M=(R,B,O,W)=>{R._enterCancelled=W,ho(R,B?h:a),ho(R,B?l:o),O&&O()},P=(R,B)=>{R._isLeaving=!1,ho(R,u),ho(R,f),ho(R,d),B&&B()},A=R=>(B,O)=>{const W=R?S:b,V=()=>M(B,R,O);co(W,[B,V]),R0(()=>{ho(B,R?c:r),$s(B,R?h:a),P0(W)||k0(B,i,p,V)})};return Ci(e,{onBeforeEnter(R){co(v,[R]),$s(R,r),$s(R,o)},onBeforeAppear(R){co(E,[R]),$s(R,c),$s(R,l)},onEnter:A(!1),onAppear:A(!0),onLeave(R,B){R._isLeaving=!0;const O=()=>P(R,B);$s(R,u),R._enterCancelled?($s(R,d),O0(R)):(O0(R),$s(R,d)),R0(()=>{R._isLeaving&&(ho(R,u),$s(R,f),P0(x)||k0(R,i,g,O))}),co(x,[R,O])},onEnterCancelled(R){M(R,!1,void 0,!0),co(y,[R])},onAppearCancelled(R){M(R,!0,void 0,!0),co(C,[R])},onLeaveCancelled(R){P(R),co(_,[R])}})}function qM(n){if(n==null)return null;if($t(n))return[Pd(n.enter),Pd(n.leave)];{const e=Pd(n);return[e,e]}}function Pd(n){return qE(n)}function $s(n,e){e.split(/\s+/).forEach(t=>t&&n.classList.add(t)),(n[Kl]||(n[Kl]=new Set)).add(e)}function ho(n,e){e.split(/\s+/).forEach(i=>i&&n.classList.remove(i));const t=n[Kl];t&&(t.delete(e),t.size||(n[Kl]=void 0))}function R0(n){requestAnimationFrame(()=>{requestAnimationFrame(n)})}let KM=0;function k0(n,e,t,i){const s=n._endId=++KM,r=()=>{s===n._endId&&i()};if(t!=null)return setTimeout(r,t);const{type:o,timeout:a,propCount:c}=JM(n,e);if(!o)return i();const l=o+"end";let h=0;const u=()=>{n.removeEventListener(l,d),r()},d=f=>{f.target===n&&++h>=c&&u()};setTimeout(()=>{h(t[m]||"").split(", "),s=i(`${wr}Delay`),r=i(`${wr}Duration`),o=F0(s,r),a=i(`${ll}Delay`),c=i(`${ll}Duration`),l=F0(a,c);let h=null,u=0,d=0;e===wr?o>0&&(h=wr,u=o,d=r.length):e===ll?l>0&&(h=ll,u=l,d=c.length):(u=Math.max(o,l),h=u>0?o>l?wr:ll:null,d=h?h===wr?r.length:c.length:0);const f=h===wr&&/\b(?:transform|all)(?:,|$)/.test(i(`${wr}Property`).toString());return{type:h,timeout:u,propCount:d,hasTransform:f}}function F0(n,e){for(;n.lengthL0(t)+L0(n[i])))}function L0(n){return n==="auto"?0:Number(n.slice(0,-1).replace(",","."))*1e3}function O0(n){return(n?n.ownerDocument:document).body.offsetHeight}function ZM(n,e,t){const i=n[Kl];i&&(e=(e?[e,...i]:[...i]).join(" ")),e==null?n.removeAttribute("class"):t?n.setAttribute("class",e):n.className=e}const Gh=Symbol("_vod"),Xx=Symbol("_vsh"),Fi={name:"show",beforeMount(n,{value:e},{transition:t}){n[Gh]=n.style.display==="none"?"":n.style.display,t&&e?t.beforeEnter(n):cl(n,e)},mounted(n,{value:e},{transition:t}){t&&e&&t.enter(n)},updated(n,{value:e,oldValue:t},{transition:i}){!e!=!t&&(i?e?(i.beforeEnter(n),cl(n,!0),i.enter(n)):i.leave(n,()=>{cl(n,!1)}):cl(n,e))},beforeUnmount(n,{value:e}){cl(n,e)}};function cl(n,e){n.style.display=e?n[Gh]:"none",n[Xx]=!e}const QM=Symbol(""),eA=/(?:^|;)\s*display\s*:/;function tA(n,e,t){const i=n.style,s=ii(t);let r=!1;if(t&&!s){if(e)if(ii(e))for(const o of e.split(";")){const a=o.slice(0,o.indexOf(":")).trim();t[a]==null&&yl(i,a,"")}else for(const o in e)t[o]==null&&yl(i,o,"");for(const o in t){o==="display"&&(r=!0);const a=t[o];a!=null?nA(n,o,!ii(e)&&e?e[o]:void 0,a)||yl(i,o,a):yl(i,o,"")}}else if(s){if(e!==t){const o=i[QM];o&&(t+=";"+o),i.cssText=t,r=eA.test(t)}}else e&&n.removeAttribute("style");Gh in n&&(n[Gh]=r?i.display:"",n[Xx]&&(i.display="none"))}const $0=/\s*!important$/;function yl(n,e,t){if(et(t))t.forEach(i=>yl(n,e,i));else if(t==null&&(t=""),e.startsWith("--"))n.setProperty(e,t);else{const i=iA(n,e);$0.test(t)?n.setProperty(Qr(i),t.replace($0,""),"important"):n[i]=t}}const N0=["Webkit","Moz","ms"],Rd={};function iA(n,e){const t=Rd[e];if(t)return t;let i=qn(e);if(i!=="filter"&&i in n)return Rd[e]=i;i=L1(i);for(let s=0;skd||(cA.then(()=>kd=0),kd=Date.now());function uA(n,e){const t=i=>{if(!i._vts)i._vts=Date.now();else if(i._vts<=t.attached)return;const s=t.value;if(et(s)){const r=i.stopImmediatePropagation;i.stopImmediatePropagation=()=>{r.call(i),i._stopped=!0};const o=s.slice(),a=[i];for(let c=0;cn.charCodeAt(0)===111&&n.charCodeAt(1)===110&&n.charCodeAt(2)>96&&n.charCodeAt(2)<123,dA=(n,e,t,i,s,r)=>{const o=s==="svg";e==="class"?ZM(n,i,o):e==="style"?tA(n,t,i):Ou(e)?$u(e)||rA(n,e,t,i,r):(e[0]==="."?(e=e.slice(1),!0):e[0]==="^"?(e=e.slice(1),!1):fA(n,e,i,o))?(U0(n,e,i),!n.tagName.includes("-")&&(e==="value"||e==="checked"||e==="selected")&&B0(n,e,i,o,r,e!=="value")):n._isVueCE&&(mA(n,e)||n._def.__asyncLoader&&(/[A-Z]/.test(e)||!ii(i)))?U0(n,qn(e),i,r,e):(e==="true-value"?n._trueValue=i:e==="false-value"&&(n._falseValue=i),B0(n,e,i,o))};function fA(n,e,t,i){if(i)return!!(e==="innerHTML"||e==="textContent"||e in n&&X0(e)&&ht(t));if(e==="spellcheck"||e==="draggable"||e==="translate"||e==="autocorrect"||e==="sandbox"&&n.tagName==="IFRAME"||e==="form"||e==="list"&&n.tagName==="INPUT"||e==="type"&&n.tagName==="TEXTAREA")return!1;if(e==="width"||e==="height"){const s=n.tagName;if(s==="IMG"||s==="VIDEO"||s==="CANVAS"||s==="SOURCE")return!1}return X0(e)&&ii(t)?!1:e in n}function mA(n,e){const t=n._def.props;if(!t)return!1;const i=qn(e);return Array.isArray(t)?t.some(s=>qn(s)===i):Object.keys(t).some(s=>qn(s)===i)}const Ua=n=>{const e=n.props["onUpdate:modelValue"]||!1;return et(e)?t=>gh(e,t):e};function pA(n){n.target.composing=!0}function Y0(n){const e=n.target;e.composing&&(e.composing=!1,e.dispatchEvent(new Event("input")))}const Ss=Symbol("_assign"),kc=Symbol("_initialValue");function Fd(n,e,t){return e&&(n=n.trim()),t&&(n=Bu(n)),n}const Je={created(n,{modifiers:{lazy:e,trim:t,number:i}},s){n.parentNode&&(n.type==="text"?n[kc]=n.defaultValue.replace(/[\r\n]/g,""):n.type==="textarea"&&(n[kc]=n.defaultValue.replace(/\r\n?/g,` +`))),n[Ss]=Ua(s);const r=i||s.props&&s.props.type==="number";$r(n,e?"change":"input",o=>{o.target.composing||n[Ss](Fd(n.value,t,r))}),(t||r)&&$r(n,"change",()=>{n.value=Fd(n.value,t,r)}),e||($r(n,"compositionstart",pA),$r(n,"compositionend",Y0),$r(n,"change",Y0))},mounted(n,{value:e,modifiers:{trim:t,number:i}}){const s=e??"",r=n[kc];delete n[kc],r!==void 0&&(n.type==="text"||n.type==="textarea")&&n.value!==r?n[Ss](Fd(n.value,t,i)):n.value=s},beforeUpdate(n,{value:e,oldValue:t,modifiers:{lazy:i,trim:s,number:r}},o){if(n[Ss]=Ua(o),n.composing)return;const a=(r||n.type==="number")&&!/^0\d/.test(n.value)?Bu(n.value):n.value,c=e??"";if(a===c)return;const l=n.getRootNode();(l instanceof Document||l instanceof ShadowRoot)&&l.activeElement===n&&n.type!=="range"&&(i&&e===t||s&&n.value.trim()===c)||(n.value=c)}},_t={deep:!0,created(n,e,t){n[Ss]=Ua(t),$r(n,"change",()=>{const i=n._modelValue,s=Jl(n),r=n.checked,o=n[Ss];if(et(i)){const a=og(i,s),c=a!==-1;if(r&&!c)o(i.concat(s));else if(!r&&c){const l=[...i];l.splice(a,1),o(l)}}else if(Ka(i)){const a=new Set(i);r?a.add(s):a.delete(s),o(a)}else o(Yx(n,r))})},mounted:G0,beforeUpdate(n,e,t){n[Ss]=Ua(t),G0(n,e,t)}};function G0(n,{value:e,oldValue:t},i){n._modelValue=e;let s;if(et(e))s=og(e,i.props.value)>-1;else if(Ka(e))s=e.has(i.props.value);else{if(e===t)return;s=Ja(e,Yx(n,!0))}n.checked!==s&&(n.checked=s)}const St={deep:!0,created(n,{value:e,modifiers:{number:t}},i){n._modelValue=e,$r(n,"change",()=>{const s=Array.prototype.filter.call(n.options,r=>r.selected).map(r=>t?Bu(Jl(r)):Jl(r));n[Ss](n.multiple?Ka(n._modelValue)?new Set(s):s:s[0]),n._assigning=!0,Gu(()=>{n._assigning=!1})}),n[Ss]=Ua(i)},mounted(n,{value:e}){H0(n,e)},beforeUpdate(n,{value:e},t){n._modelValue=e,n[Ss]=Ua(t)},updated(n,{value:e}){n._assigning||H0(n,e)}};function H0(n,e){const t=n.multiple,i=et(e);if(!(t&&!i&&!Ka(e))){for(let s=0,r=n.options.length;sString(l)===String(a)):o.selected=og(e,a)>-1}else o.selected=e.has(a);else if(Ja(Jl(o),e)){n.selectedIndex!==s&&(n.selectedIndex=s);return}}!t&&n.selectedIndex!==-1&&(n.selectedIndex=-1)}}function Jl(n){return"_value"in n?n._value:n.value}function Yx(n,e){const t=e?"_trueValue":"_falseValue";return t in n?n[t]:e}const gA=["ctrl","shift","alt","meta"],vA={stop:n=>n.stopPropagation(),prevent:n=>n.preventDefault(),self:n=>n.target!==n.currentTarget,ctrl:n=>!n.ctrlKey,shift:n=>!n.shiftKey,alt:n=>!n.altKey,meta:n=>!n.metaKey,left:n=>"button"in n&&n.button!==0,middle:n=>"button"in n&&n.button!==1,right:n=>"button"in n&&n.button!==2,exact:(n,e)=>gA.some(t=>n[`${t}Key`]&&!e.includes(t))},tt=(n,e)=>{if(!n)return n;const t=n._withMods||(n._withMods={}),i=e.join(".");return t[i]||(t[i]=((s,...r)=>{for(let o=0;o{const t=n._withKeys||(n._withKeys={}),i=e.join(".");return t[i]||(t[i]=(s=>{if(!("key"in s))return;const r=Qr(s.key);if(e.some(o=>o===r||yA[o]===r))return n(s)}))},bA=Ci({patchProp:dA},GM);let j0;function xA(){return j0||(j0=TM(bA))}const wA=((...n)=>{const e=xA().createApp(...n),{mount:t}=e;return e.mount=i=>{const s=_A(i);if(!s)return;const r=e._component;!ht(r)&&!r.render&&!r.template&&(r.template=s.innerHTML),s.nodeType===1&&(s.textContent="");const o=t(s,!1,SA(s));return s instanceof Element&&(s.removeAttribute("v-cloak"),s.setAttribute("data-v-app","")),o},e});function SA(n){if(n instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&n instanceof MathMLElement)return"mathml"}function _A(n){return ii(n)?document.querySelector(n):n}/*! + * pinia v4.0.3 + * (c) 2026 Eduardo San Martin Morote + * @license MIT + */let Gx;const Zu=n=>Gx=n,Hx=Symbol();function W0(n){return n&&typeof n=="object"&&Object.prototype.toString.call(n)==="[object Object]"&&typeof n.toJSON!="function"}function TA(){const n=ag(!0),e=n.run(()=>De({}));let t=[],i=[];const s=Ur({install(r){Zu(s),s._a=r,r.provide(Hx,s),r.config.globalProperties.$pinia=s,i.forEach(o=>t.push(o)),i=[]},use(r){return this._a?t.push(r):i.push(r),this},_p:t,_a:null,_e:n,_s:new Map,state:e});return s}const Lm=()=>{};function z0(n,e,t,i=Lm){n.add(e);const s=()=>{n.delete(e)&&i()};return!t&&lg()&&U1(s),s}function ia(n,...e){n.forEach(t=>{t(...e)})}const EA=n=>n(),q0=Symbol(),Ld=Symbol();function Om(n,e){n instanceof Map&&e instanceof Map?e.forEach((t,i)=>n.set(i,t)):n instanceof Set&&e instanceof Set&&e.forEach(n.add,n);for(const t in e){if(!Object.hasOwn(e,t))continue;const i=e[t],s=n[t];W0(s)&&W0(i)&&Object.hasOwn(n,t)&&!Qt(i)&&!or(i)?n[t]=Om(s,i):n[t]=i}return n}const CA=Symbol();function MA(n){return!n||typeof n!="object"||!Object.hasOwn(n,CA)}const{assign:Cr}=Object;function AA(n){return!!(Qt(n)&&n.effect)}function IA(n,e,t,i){const{state:s,actions:r,getters:o}=e,a=t.state.value[n];let c;function l(){a||(t.state.value[n]=s?s():{});const h=EC(t.state.value[n]);return Cr(h,r,Object.keys(o||{}).reduce((u,d)=>(u[d]=Ur(Fe(()=>{Zu(t);const f=t._s.get(n);return o[d].call(f,f)})),u),{}))}return c=jx(n,l,e,t,i,!0),c}function jx(n,e,t={},i,s,r){let o;const a=Cr({actions:{}},t),c={deep:!0};let l,h,u=new Set,d=new Set,f;const m=i.state.value[n];!r&&!m&&(i.state.value[n]={});let p;function g(S){let C;l=h=!1,typeof S=="function"?(S(i.state.value[n]),C={type:"patch function",storeId:n,events:f}):(Om(i.state.value[n],S),C={type:"patch object",payload:S,storeId:n,events:f});const M=p=Symbol();Gu().then(()=>{p===M&&(l=!0)}),h=!0,ia(u,C,i.state.value[n])}const v=r?function(){const{state:C}=t,M=C?C():{};this.$patch(P=>{Cr(P,M)})}:Lm;function b(){o.stop(),u.clear(),d.clear(),i._s.delete(n)}const y=(S,C="")=>{if(q0 in S)return S[Ld]=C,S;const M=function(){Zu(i);const P=Array.from(arguments),A=new Set,R=new Set;function B(V){A.add(V)}function O(V){R.add(V)}ia(d,{args:P,name:M[Ld],store:_,after:B,onError:O});let W;try{W=S.apply(this&&this.$id===n?this:_,P)}catch(V){throw ia(R,V),V}return W instanceof Promise?W.then(V=>(ia(A,V),V)).catch(V=>(ia(R,V),Promise.reject(V))):(ia(A,W),W)};return M[q0]=!0,M[Ld]=C,M},x={_p:i,$id:n,$onAction:z0.bind(null,d),$patch:g,$reset:v,$subscribe(S,C={}){if(u.has(S))return Lm;const M=z0(u,S,C.detached,()=>P()),P=o.run(()=>ei(()=>i.state.value[n],A=>{(C.flush==="sync"?h:l)&&S({storeId:n,type:"direct",events:f},A)},Cr({},c,C)));return M},$dispose:b},_=Go(x);i._s.set(n,_);const E=(i._a&&i._a.runWithContext||EA)(()=>i._e.run(()=>(o=ag()).run(()=>e({action:y}))));for(const S in E){const C=E[S];Qt(C)&&!AA(C)||or(C)?r||(m&&MA(C)&&(Qt(C)?C.value=m[S]:((C instanceof Set||C instanceof Map)&&C.clear(),Om(C,m[S]))),i.state.value[n][S]=C):typeof C=="function"&&(E[S]=y(C,S),a.actions[S]=C)}return Cr(_,E),Cr(Mt(_),E),Object.defineProperty(_,"$state",{get:()=>i.state.value[n],set:S=>{g(C=>{Cr(C,S)})}}),i._p.forEach(S=>{const C=o.run(()=>S({store:_,app:i._a,pinia:i,options:a}));Cr(_,C)}),m&&r&&t.hydrate&&t.hydrate(_.$state,m),l=!0,h=!0,_}/*! #__NO_SIDE_EFFECTS__ */function PA(n,e,t){let i;const s=typeof e=="function";i=s?t:e;function r(o,a){const c=OC();return o=o||(c?ko(Hx,null):null),o&&Zu(o),o=Gx,o._s.has(n)||(s?jx(n,e,i,o):IA(n,i,o)),o._s.get(n)}return r.$id=n,r}var Ho=(n=>(n[n.WEBGL_LEGACY=0]="WEBGL_LEGACY",n[n.WEBGL=1]="WEBGL",n[n.WEBGL2=2]="WEBGL2",n))(Ho||{}),Wx=(n=>(n[n.UNKNOWN=0]="UNKNOWN",n[n.WEBGL=1]="WEBGL",n[n.CANVAS=2]="CANVAS",n))(Wx||{}),$m=(n=>(n[n.COLOR=16384]="COLOR",n[n.DEPTH=256]="DEPTH",n[n.STENCIL=1024]="STENCIL",n))($m||{}),Qe=(n=>(n[n.NORMAL=0]="NORMAL",n[n.ADD=1]="ADD",n[n.MULTIPLY=2]="MULTIPLY",n[n.SCREEN=3]="SCREEN",n[n.OVERLAY=4]="OVERLAY",n[n.DARKEN=5]="DARKEN",n[n.LIGHTEN=6]="LIGHTEN",n[n.COLOR_DODGE=7]="COLOR_DODGE",n[n.COLOR_BURN=8]="COLOR_BURN",n[n.HARD_LIGHT=9]="HARD_LIGHT",n[n.SOFT_LIGHT=10]="SOFT_LIGHT",n[n.DIFFERENCE=11]="DIFFERENCE",n[n.EXCLUSION=12]="EXCLUSION",n[n.HUE=13]="HUE",n[n.SATURATION=14]="SATURATION",n[n.COLOR=15]="COLOR",n[n.LUMINOSITY=16]="LUMINOSITY",n[n.NORMAL_NPM=17]="NORMAL_NPM",n[n.ADD_NPM=18]="ADD_NPM",n[n.SCREEN_NPM=19]="SCREEN_NPM",n[n.NONE=20]="NONE",n[n.SRC_OVER=0]="SRC_OVER",n[n.SRC_IN=21]="SRC_IN",n[n.SRC_OUT=22]="SRC_OUT",n[n.SRC_ATOP=23]="SRC_ATOP",n[n.DST_OVER=24]="DST_OVER",n[n.DST_IN=25]="DST_IN",n[n.DST_OUT=26]="DST_OUT",n[n.DST_ATOP=27]="DST_ATOP",n[n.ERASE=26]="ERASE",n[n.SUBTRACT=28]="SUBTRACT",n[n.XOR=29]="XOR",n))(Qe||{}),_s=(n=>(n[n.POINTS=0]="POINTS",n[n.LINES=1]="LINES",n[n.LINE_LOOP=2]="LINE_LOOP",n[n.LINE_STRIP=3]="LINE_STRIP",n[n.TRIANGLES=4]="TRIANGLES",n[n.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",n[n.TRIANGLE_FAN=6]="TRIANGLE_FAN",n))(_s||{}),Ie=(n=>(n[n.RGBA=6408]="RGBA",n[n.RGB=6407]="RGB",n[n.RG=33319]="RG",n[n.RED=6403]="RED",n[n.RGBA_INTEGER=36249]="RGBA_INTEGER",n[n.RGB_INTEGER=36248]="RGB_INTEGER",n[n.RG_INTEGER=33320]="RG_INTEGER",n[n.RED_INTEGER=36244]="RED_INTEGER",n[n.ALPHA=6406]="ALPHA",n[n.LUMINANCE=6409]="LUMINANCE",n[n.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",n[n.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",n[n.DEPTH_STENCIL=34041]="DEPTH_STENCIL",n))(Ie||{}),Ia=(n=>(n[n.TEXTURE_2D=3553]="TEXTURE_2D",n[n.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",n[n.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",n[n.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",n[n.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",n[n.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",n[n.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",n[n.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",n[n.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",n))(Ia||{}),He=(n=>(n[n.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",n[n.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",n[n.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",n[n.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",n[n.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",n[n.UNSIGNED_INT=5125]="UNSIGNED_INT",n[n.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",n[n.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",n[n.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",n[n.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",n[n.BYTE=5120]="BYTE",n[n.SHORT=5122]="SHORT",n[n.INT=5124]="INT",n[n.FLOAT=5126]="FLOAT",n[n.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",n[n.HALF_FLOAT=36193]="HALF_FLOAT",n))(He||{}),Xe=(n=>(n[n.FLOAT=0]="FLOAT",n[n.INT=1]="INT",n[n.UINT=2]="UINT",n))(Xe||{}),Wn=(n=>(n[n.NEAREST=0]="NEAREST",n[n.LINEAR=1]="LINEAR",n))(Wn||{}),Jn=(n=>(n[n.CLAMP=33071]="CLAMP",n[n.REPEAT=10497]="REPEAT",n[n.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT",n))(Jn||{}),$n=(n=>(n[n.OFF=0]="OFF",n[n.POW2=1]="POW2",n[n.ON=2]="ON",n[n.ON_MANUAL=3]="ON_MANUAL",n))($n||{}),Ri=(n=>(n[n.NPM=0]="NPM",n[n.UNPACK=1]="UNPACK",n[n.PMA=2]="PMA",n[n.NO_PREMULTIPLIED_ALPHA=0]="NO_PREMULTIPLIED_ALPHA",n[n.PREMULTIPLY_ON_UPLOAD=1]="PREMULTIPLY_ON_UPLOAD",n[n.PREMULTIPLIED_ALPHA=2]="PREMULTIPLIED_ALPHA",n))(Ri||{}),ys=(n=>(n[n.NO=0]="NO",n[n.YES=1]="YES",n[n.AUTO=2]="AUTO",n[n.BLEND=0]="BLEND",n[n.CLEAR=1]="CLEAR",n[n.BLIT=2]="BLIT",n))(ys||{}),wg=(n=>(n[n.AUTO=0]="AUTO",n[n.MANUAL=1]="MANUAL",n))(wg||{}),kn=(n=>(n.LOW="lowp",n.MEDIUM="mediump",n.HIGH="highp",n))(kn||{}),Si=(n=>(n[n.NONE=0]="NONE",n[n.SCISSOR=1]="SCISSOR",n[n.STENCIL=2]="STENCIL",n[n.SPRITE=3]="SPRITE",n[n.COLOR=4]="COLOR",n))(Si||{}),bi=(n=>(n[n.NONE=0]="NONE",n[n.LOW=2]="LOW",n[n.MEDIUM=4]="MEDIUM",n[n.HIGH=8]="HIGH",n))(bi||{}),Ms=(n=>(n[n.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",n[n.ARRAY_BUFFER=34962]="ARRAY_BUFFER",n[n.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER",n))(Ms||{});const RA={createCanvas:(n,e)=>{const t=document.createElement("canvas");return t.width=n,t.height=e,t},getCanvasRenderingContext2D:()=>CanvasRenderingContext2D,getWebGLRenderingContext:()=>WebGLRenderingContext,getNavigator:()=>navigator,getBaseUrl:()=>document.baseURI??window.location.href,getFontFaceSet:()=>document.fonts,fetch:(n,e)=>fetch(n,e),parseXML:n=>new DOMParser().parseFromString(n,"text/xml")},Ve={ADAPTER:RA,RESOLUTION:1,CREATE_IMAGE_BITMAP:!1,ROUND_PIXELS:!1};var Od=/iPhone/i,K0=/iPod/i,J0=/iPad/i,Z0=/\biOS-universal(?:.+)Mac\b/i,$d=/\bAndroid(?:.+)Mobile\b/i,Q0=/Android/i,na=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,Fc=/Silk/i,Ns=/Windows Phone/i,ev=/\bWindows(?:.+)ARM\b/i,tv=/BlackBerry/i,iv=/BB10/i,nv=/Opera Mini/i,sv=/\b(CriOS|Chrome)(?:.+)Mobile/i,rv=/Mobile(?:.+)Firefox\b/i,ov=function(n){return typeof n<"u"&&n.platform==="MacIntel"&&typeof n.maxTouchPoints=="number"&&n.maxTouchPoints>1&&typeof MSStream>"u"};function kA(n){return function(e){return e.test(n)}}function av(n){var e={userAgent:"",platform:"",maxTouchPoints:0};!n&&typeof navigator<"u"?e={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0}:typeof n=="string"?e.userAgent=n:n&&n.userAgent&&(e={userAgent:n.userAgent,platform:n.platform,maxTouchPoints:n.maxTouchPoints||0});var t=e.userAgent,i=t.split("[FBAN");typeof i[1]<"u"&&(t=i[0]),i=t.split("Twitter"),typeof i[1]<"u"&&(t=i[0]);var s=kA(t),r={apple:{phone:s(Od)&&!s(Ns),ipod:s(K0),tablet:!s(Od)&&(s(J0)||ov(e))&&!s(Ns),universal:s(Z0),device:(s(Od)||s(K0)||s(J0)||s(Z0)||ov(e))&&!s(Ns)},amazon:{phone:s(na),tablet:!s(na)&&s(Fc),device:s(na)||s(Fc)},android:{phone:!s(Ns)&&s(na)||!s(Ns)&&s($d),tablet:!s(Ns)&&!s(na)&&!s($d)&&(s(Fc)||s(Q0)),device:!s(Ns)&&(s(na)||s(Fc)||s($d)||s(Q0))||s(/\bokhttp\b/i)},windows:{phone:s(Ns),tablet:s(ev),device:s(Ns)||s(ev)},other:{blackberry:s(tv),blackberry10:s(iv),opera:s(nv),firefox:s(rv),chrome:s(sv),device:s(tv)||s(iv)||s(nv)||s(rv)||s(sv)},any:!1,phone:!1,tablet:!1};return r.any=r.apple.device||r.android.device||r.windows.device||r.other.device,r.phone=r.apple.phone||r.android.phone||r.windows.phone,r.tablet=r.apple.tablet||r.android.tablet||r.windows.tablet,r}const FA=av.default??av,Ks=FA(globalThis.navigator);Ve.RETINA_PREFIX=/@([0-9\.]+)x/;Ve.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT=!1;var Hh=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function zx(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function LA(n){if(Object.prototype.hasOwnProperty.call(n,"__esModule"))return n;var e=n.default;if(typeof e=="function"){var t=function i(){return this instanceof i?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(n).forEach(function(i){var s=Object.getOwnPropertyDescriptor(n,i);Object.defineProperty(t,i,s.get?s:{enumerable:!0,get:function(){return n[i]}})}),t}var Nd={exports:{}},lv;function OA(){return lv||(lv=1,(function(n){var e=Object.prototype.hasOwnProperty,t="~";function i(){}Object.create&&(i.prototype=Object.create(null),new i().__proto__||(t=!1));function s(c,l,h){this.fn=c,this.context=l,this.once=h||!1}function r(c,l,h,u,d){if(typeof h!="function")throw new TypeError("The listener must be a function");var f=new s(h,u||c,d),m=t?t+l:l;return c._events[m]?c._events[m].fn?c._events[m]=[c._events[m],f]:c._events[m].push(f):(c._events[m]=f,c._eventsCount++),c}function o(c,l){--c._eventsCount===0?c._events=new i:delete c._events[l]}function a(){this._events=new i,this._eventsCount=0}a.prototype.eventNames=function(){var l=[],h,u;if(this._eventsCount===0)return l;for(u in h=this._events)e.call(h,u)&&l.push(t?u.slice(1):u);return Object.getOwnPropertySymbols?l.concat(Object.getOwnPropertySymbols(h)):l},a.prototype.listeners=function(l){var h=t?t+l:l,u=this._events[h];if(!u)return[];if(u.fn)return[u.fn];for(var d=0,f=u.length,m=new Array(f);d80*L){G=J=V[0],K=oe=V[1];for(var fe=L;feJ&&(J=le),ve>oe&&(oe=ve);Se=Math.max(J-G,oe-K),Se=Se!==0?32767/Se:0}return i(D,X,L,G,K,Se,0),X}function e(V,Y,L,N,F){var D,X;if(F===W(V,Y,L,N)>0)for(D=Y;D=Y;D-=N)X=R(D,V[D],V[D+1],X);return X&&x(X,X.next)&&(B(X),X=X.next),X}function t(V,Y){if(!V)return V;Y||(Y=V);var L=V,N;do if(N=!1,!L.steiner&&(x(L,L.next)||y(L.prev,L,L.next)===0)){if(B(L),L=Y=L.prev,L===L.next)break;N=!0}else L=L.next;while(N||L!==Y);return Y}function i(V,Y,L,N,F,D,X){if(V){!X&&D&&f(V,N,F,D);for(var G=V,K,J;V.prev!==V.next;){if(K=V.prev,J=V.next,D?r(V,N,F,D):s(V)){Y.push(K.i/L|0),Y.push(V.i/L|0),Y.push(J.i/L|0),B(V),V=J.next,G=J.next;continue}if(V=J,V===G){X?X===1?(V=o(t(V),Y,L),i(V,Y,L,N,F,D,2)):X===2&&a(V,Y,L,N,F,D):i(t(V),Y,L,N,F,D,1);break}}}}function s(V){var Y=V.prev,L=V,N=V.next;if(y(Y,L,N)>=0)return!1;for(var F=Y.x,D=L.x,X=N.x,G=Y.y,K=L.y,J=N.y,oe=FD?F>X?F:X:D>X?D:X,Se=G>K?G>J?G:J:K>J?K:J,fe=N.next;fe!==Y;){if(fe.x>=oe&&fe.x<=ve&&fe.y>=le&&fe.y<=Se&&v(F,G,D,K,X,J,fe.x,fe.y)&&y(fe.prev,fe,fe.next)>=0)return!1;fe=fe.next}return!0}function r(V,Y,L,N){var F=V.prev,D=V,X=V.next;if(y(F,D,X)>=0)return!1;for(var G=F.x,K=D.x,J=X.x,oe=F.y,le=D.y,ve=X.y,Se=GK?G>J?G:J:K>J?K:J,q=oe>le?oe>ve?oe:ve:le>ve?le:ve,Z=p(Se,fe,Y,L,N),se=p(ye,q,Y,L,N),H=V.prevZ,j=V.nextZ;H&&H.z>=Z&&j&&j.z<=se;){if(H.x>=Se&&H.x<=ye&&H.y>=fe&&H.y<=q&&H!==F&&H!==X&&v(G,oe,K,le,J,ve,H.x,H.y)&&y(H.prev,H,H.next)>=0||(H=H.prevZ,j.x>=Se&&j.x<=ye&&j.y>=fe&&j.y<=q&&j!==F&&j!==X&&v(G,oe,K,le,J,ve,j.x,j.y)&&y(j.prev,j,j.next)>=0))return!1;j=j.nextZ}for(;H&&H.z>=Z;){if(H.x>=Se&&H.x<=ye&&H.y>=fe&&H.y<=q&&H!==F&&H!==X&&v(G,oe,K,le,J,ve,H.x,H.y)&&y(H.prev,H,H.next)>=0)return!1;H=H.prevZ}for(;j&&j.z<=se;){if(j.x>=Se&&j.x<=ye&&j.y>=fe&&j.y<=q&&j!==F&&j!==X&&v(G,oe,K,le,J,ve,j.x,j.y)&&y(j.prev,j,j.next)>=0)return!1;j=j.nextZ}return!0}function o(V,Y,L){var N=V;do{var F=N.prev,D=N.next.next;!x(F,D)&&_(F,N,N.next,D)&&M(F,D)&&M(D,F)&&(Y.push(F.i/L|0),Y.push(N.i/L|0),Y.push(D.i/L|0),B(N),B(N.next),N=V=D),N=N.next}while(N!==V);return t(N)}function a(V,Y,L,N,F,D){var X=V;do{for(var G=X.next.next;G!==X.prev;){if(X.i!==G.i&&b(X,G)){var K=A(X,G);X=t(X,X.next),K=t(K,K.next),i(X,Y,L,N,F,D,0),i(K,Y,L,N,F,D,0);return}G=G.next}X=X.next}while(X!==V)}function c(V,Y,L,N){var F=[],D,X,G,K,J;for(D=0,X=Y.length;D=L.next.y&&L.next.y!==L.y){var G=L.x+(F-L.y)*(L.next.x-L.x)/(L.next.y-L.y);if(G<=N&&G>D&&(D=G,X=L.x=L.x&&L.x>=J&&N!==L.x&&v(FX.x||L.x===X.x&&d(X,L)))&&(X=L,le=ve)),L=L.next;while(L!==K);return X}function d(V,Y){return y(V.prev,V,Y.prev)<0&&y(Y.next,V,V.next)<0}function f(V,Y,L,N){var F=V;do F.z===0&&(F.z=p(F.x,F.y,Y,L,N)),F.prevZ=F.prev,F.nextZ=F.next,F=F.next;while(F!==V);F.prevZ.nextZ=null,F.prevZ=null,m(F)}function m(V){var Y,L,N,F,D,X,G,K,J=1;do{for(L=V,V=null,D=null,X=0;L;){for(X++,N=L,G=0,Y=0;Y0||K>0&&N;)G!==0&&(K===0||!N||L.z<=N.z)?(F=L,L=L.nextZ,G--):(F=N,N=N.nextZ,K--),D?D.nextZ=F:V=F,F.prevZ=D,D=F;L=N}D.nextZ=null,J*=2}while(X>1);return V}function p(V,Y,L,N,F){return V=(V-L)*F|0,Y=(Y-N)*F|0,V=(V|V<<8)&16711935,V=(V|V<<4)&252645135,V=(V|V<<2)&858993459,V=(V|V<<1)&1431655765,Y=(Y|Y<<8)&16711935,Y=(Y|Y<<4)&252645135,Y=(Y|Y<<2)&858993459,Y=(Y|Y<<1)&1431655765,V|Y<<1}function g(V){var Y=V,L=V;do(Y.x=(V-X)*(D-G)&&(V-X)*(N-G)>=(L-X)*(Y-G)&&(L-X)*(D-G)>=(F-X)*(N-G)}function b(V,Y){return V.next.i!==Y.i&&V.prev.i!==Y.i&&!C(V,Y)&&(M(V,Y)&&M(Y,V)&&P(V,Y)&&(y(V.prev,V,Y.prev)||y(V,Y.prev,Y))||x(V,Y)&&y(V.prev,V,V.next)>0&&y(Y.prev,Y,Y.next)>0)}function y(V,Y,L){return(Y.y-V.y)*(L.x-Y.x)-(Y.x-V.x)*(L.y-Y.y)}function x(V,Y){return V.x===Y.x&&V.y===Y.y}function _(V,Y,L,N){var F=S(y(V,Y,L)),D=S(y(V,Y,N)),X=S(y(L,N,V)),G=S(y(L,N,Y));return!!(F!==D&&X!==G||F===0&&E(V,L,Y)||D===0&&E(V,N,Y)||X===0&&E(L,V,N)||G===0&&E(L,Y,N))}function E(V,Y,L){return Y.x<=Math.max(V.x,L.x)&&Y.x>=Math.min(V.x,L.x)&&Y.y<=Math.max(V.y,L.y)&&Y.y>=Math.min(V.y,L.y)}function S(V){return V>0?1:V<0?-1:0}function C(V,Y){var L=V;do{if(L.i!==V.i&&L.next.i!==V.i&&L.i!==Y.i&&L.next.i!==Y.i&&_(L,L.next,V,Y))return!0;L=L.next}while(L!==V);return!1}function M(V,Y){return y(V.prev,V,V.next)<0?y(V,Y,V.next)>=0&&y(V,V.prev,Y)>=0:y(V,Y,V.prev)<0||y(V,V.next,Y)<0}function P(V,Y){var L=V,N=!1,F=(V.x+Y.x)/2,D=(V.y+Y.y)/2;do L.y>D!=L.next.y>D&&L.next.y!==L.y&&F<(L.next.x-L.x)*(D-L.y)/(L.next.y-L.y)+L.x&&(N=!N),L=L.next;while(L!==V);return N}function A(V,Y){var L=new O(V.i,V.x,V.y),N=new O(Y.i,Y.x,Y.y),F=V.next,D=Y.prev;return V.next=Y,Y.prev=V,L.next=F,F.prev=L,N.next=L,L.prev=N,D.next=N,N.prev=D,N}function R(V,Y,L,N){var F=new O(V,Y,L);return N?(F.next=N.next,F.prev=N,N.next.prev=F,N.next=F):(F.prev=F,F.next=F),F}function B(V){V.next.prev=V.prev,V.prev.next=V.next,V.prevZ&&(V.prevZ.nextZ=V.nextZ),V.nextZ&&(V.nextZ.prevZ=V.prevZ)}function O(V,Y,L){this.i=V,this.x=Y,this.y=L,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}n.deviation=function(V,Y,L,N){var F=Y&&Y.length,D=F?Y[0]*L:V.length,X=Math.abs(W(V,0,D,L));if(F)for(var G=0,K=Y.length;G0&&(N+=V[F-1].length,L.holes.push(N))}return L},Lc.exports}var DA=NA();const BA=zx(DA);var uo={},bl={exports:{}};/*! https://mths.be/punycode v1.4.1 by @mathias */var UA=bl.exports,hv;function VA(){return hv||(hv=1,(function(n,e){(function(t){var i=e&&!e.nodeType&&e,s=n&&!n.nodeType&&n,r=typeof Hh=="object"&&Hh;(r.global===r||r.window===r||r.self===r)&&(t=r);var o,a=2147483647,c=36,l=1,h=26,u=38,d=700,f=72,m=128,p="-",g=/^xn--/,v=/[^\x20-\x7E]/,b=/[\x2E\u3002\uFF0E\uFF61]/g,y={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},x=c-l,_=Math.floor,E=String.fromCharCode,S;function C(F){throw new RangeError(y[F])}function M(F,D){for(var X=F.length,G=[];X--;)G[X]=D(F[X]);return G}function P(F,D){var X=F.split("@"),G="";X.length>1&&(G=X[0]+"@",F=X[1]),F=F.replace(b,".");var K=F.split("."),J=M(K,D).join(".");return G+J}function A(F){for(var D=[],X=0,G=F.length,K,J;X=55296&&K<=56319&&X65535&&(D-=65536,X+=E(D>>>10&1023|55296),D=56320|D&1023),X+=E(D),X}).join("")}function B(F){return F-48<10?F-22:F-65<26?F-65:F-97<26?F-97:c}function O(F,D){return F+22+75*(F<26)-((D!=0)<<5)}function W(F,D,X){var G=0;for(F=X?_(F/d):F>>1,F+=_(F/D);F>x*h>>1;G+=c)F=_(F/x);return _(G+(x+1)*F/(F+u))}function V(F){var D=[],X=F.length,G,K=0,J=m,oe=f,le,ve,Se,fe,ye,q,Z,se,H;for(le=F.lastIndexOf(p),le<0&&(le=0),ve=0;ve=128&&C("not-basic"),D.push(F.charCodeAt(ve));for(Se=le>0?le+1:0;Se=X&&C("invalid-input"),Z=B(F.charCodeAt(Se++)),(Z>=c||Z>_((a-K)/ye))&&C("overflow"),K+=Z*ye,se=q<=oe?l:q>=oe+h?h:q-oe,!(Z_(a/H)&&C("overflow"),ye*=H;G=D.length+1,oe=W(K-fe,G,fe==0),_(K/G)>a-J&&C("overflow"),J+=_(K/G),K%=G,D.splice(K++,0,J)}return R(D)}function Y(F){var D,X,G,K,J,oe,le,ve,Se,fe,ye,q=[],Z,se,H,j;for(F=A(F),Z=F.length,D=m,X=0,J=f,oe=0;oe=D&&ye_((a-X)/se)&&C("overflow"),X+=(le-D)*se,D=le,oe=0;oea&&C("overflow"),ye==D){for(ve=X,Se=c;fe=Se<=J?l:Se>=J+h?h:Se-J,!(ve-1e3&&ce<1e3||E.call(/e/,de))return de;var nt=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof ce=="number"){var Ft=ce<0?-P(-ce):P(ce);if(Ft!==ce){var Nt=String(Ft),ct=b.call(de,Nt.length+1);return y.call(Nt,nt,"$&_")+"."+y.call(y.call(ct,/([0-9]{3})/g,"$&_"),/_$/,"")}}return y.call(de,nt,"$&_")}var N=GA,F=N.custom,D=se(F)?F:null,X={__proto__:null,double:'"',single:"'"},G={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};Bd=function ce(de,nt,Ft,Nt){var ct=nt||{};if($(ct,"quoteStyle")&&!$(X,ct.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if($(ct,"maxStringLength")&&(typeof ct.maxStringLength=="number"?ct.maxStringLength<0&&ct.maxStringLength!==1/0:ct.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var rn=$(ct,"customInspect")?ct.customInspect:!0;if(typeof rn!="boolean"&&rn!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if($(ct,"indent")&&ct.indent!==null&&ct.indent!==" "&&!(parseInt(ct.indent,10)===ct.indent&&ct.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if($(ct,"numericSeparator")&&typeof ct.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var Nn=ct.numericSeparator;if(typeof de>"u")return"undefined";if(de===null)return"null";if(typeof de=="boolean")return de?"true":"false";if(typeof de=="string")return he(de,ct);if(typeof de=="number"){if(de===0)return 1/0/de>0?"0":"-0";var Ht=String(de);return Nn?L(de,Ht):Ht}if(typeof de=="bigint"){var Di=String(de)+"n";return Nn?L(de,Di):Di}var Ut=typeof ct.depth>"u"?5:ct.depth;if(typeof Ft>"u"&&(Ft=0),Ft>=Ut&&Ut>0&&typeof de=="object")return le(de)?"[Array]":"[Object]";var on=Ee(ct,Ft);if(typeof Nt>"u")Nt=[];else if(ee(Nt,de)>=0)return"[Circular]";function fi(xr,Qo,xd){if(Qo&&(Nt=M.call(Nt),Nt.push(Qo)),xd){var Mc={depth:ct.depth};return $(ct,"quoteStyle")&&(Mc.quoteStyle=ct.quoteStyle),ce(xr,Mc,Ft+1,Nt)}return ce(xr,ct,Ft+1,Nt)}if(typeof de=="function"&&!Se(de)){var Dn=z(de),Fs=lt(de,fi);return"[Function"+(Dn?": "+Dn:" (anonymous)")+"]"+(Fs.length>0?" { "+C.call(Fs,", ")+" }":"")}if(se(de)){var Tn=O?y.call(String(de),/^(Symbol\(.*\))_[^)]*$/,"$1"):B.call(de);return typeof de=="object"&&!O?We(Tn):Tn}if(Be(de)){for(var mn="<"+_.call(String(de.nodeName)),yr=de.attributes||[],br=0;br",mn}if(le(de)){if(de.length===0)return"[]";var Jo=lt(de,fi);return on&&!Ze(Jo)?"["+vi(Jo,on)+"]":"[ "+C.call(Jo,", ")+" ]"}if(fe(de)){var nl=lt(de,fi);return!("cause"in Error.prototype)&&"cause"in de&&!V.call(de,"cause")?"{ ["+String(de)+"] "+C.call(S.call("[cause]: "+fi(de.cause),nl),", ")+" }":nl.length===0?"["+String(de)+"]":"{ ["+String(de)+"] "+C.call(nl,", ")+" }"}if(typeof de=="object"&&rn){if(D&&typeof de[D]=="function"&&N)return N(de,{depth:Ut-Ft});if(rn!=="symbol"&&typeof de.inspect=="function")return de.inspect()}if(ne(de)){var _c=[];return i&&i.call(de,function(xr,Qo){_c.push(fi(Qo,de,!0)+" => "+fi(xr,de))}),Ce("Map",t.call(de),_c,on)}if(be(de)){var Tc=[];return a&&a.call(de,function(xr){Tc.push(fi(xr,de))}),Ce("Set",o.call(de),Tc,on)}if(ue(de))return Le("WeakMap");if(Ne(de))return Le("WeakSet");if(xe(de))return Le("WeakRef");if(q(de))return We(fi(Number(de)));if(H(de))return We(fi(A.call(de)));if(Z(de))return We(m.call(de));if(ye(de))return We(fi(String(de)));if(typeof window<"u"&&de===window)return"{ [object Window] }";if(typeof globalThis<"u"&&de===globalThis||typeof Hh<"u"&&de===Hh)return"{ [object globalThis] }";if(!ve(de)&&!Se(de)){var sl=lt(de,fi),Ec=Y?Y(de)===Object.prototype:de instanceof Object||de.constructor===Object,Zo=de instanceof Object?"":"null prototype",Cc=!Ec&&W&&Object(de)===de&&W in de?b.call(U(de),8,-1):Zo?"Object":"",bd=Ec||typeof de.constructor!="function"?"":de.constructor.name?de.constructor.name+" ":"",rl=bd+(Cc||Zo?"["+C.call(S.call([],Cc||[],Zo||[]),": ")+"] ":"");return sl.length===0?rl+"{}":on?rl+"{"+vi(sl,on)+"}":rl+"{ "+C.call(sl,", ")+" }"}return String(de)};function K(ce,de,nt){var Ft=nt.quoteStyle||de,Nt=X[Ft];return Nt+ce+Nt}function J(ce){return y.call(String(ce),/"/g,""")}function oe(ce){return!W||!(typeof ce=="object"&&(W in ce||typeof ce[W]<"u"))}function le(ce){return U(ce)==="[object Array]"&&oe(ce)}function ve(ce){return U(ce)==="[object Date]"&&oe(ce)}function Se(ce){return U(ce)==="[object RegExp]"&&oe(ce)}function fe(ce){return U(ce)==="[object Error]"&&oe(ce)}function ye(ce){return U(ce)==="[object String]"&&oe(ce)}function q(ce){return U(ce)==="[object Number]"&&oe(ce)}function Z(ce){return U(ce)==="[object Boolean]"&&oe(ce)}function se(ce){if(O)return ce&&typeof ce=="object"&&ce instanceof Symbol;if(typeof ce=="symbol")return!0;if(!ce||typeof ce!="object"||!B)return!1;try{return B.call(ce),!0}catch{}return!1}function H(ce){if(!ce||typeof ce!="object"||!A)return!1;try{return A.call(ce),!0}catch{}return!1}var j=Object.prototype.hasOwnProperty||function(ce){return ce in this};function $(ce,de){return j.call(ce,de)}function U(ce){return p.call(ce)}function z(ce){if(ce.name)return ce.name;var de=v.call(g.call(ce),/^function\s*([\w$]+)/);return de?de[1]:null}function ee(ce,de){if(ce.indexOf)return ce.indexOf(de);for(var nt=0,Ft=ce.length;ntde.maxStringLength){var nt=ce.length-de.maxStringLength,Ft="... "+nt+" more character"+(nt>1?"s":"");return he(b.call(ce,0,de.maxStringLength),de)+Ft}var Nt=G[de.quoteStyle||"single"];Nt.lastIndex=0;var ct=y.call(y.call(ce,Nt,"\\$1"),/[\x00-\x1f]/g,ge);return K(ct,"single",de)}function ge(ce){var de=ce.charCodeAt(0),nt={8:"b",9:"t",10:"n",12:"f",13:"r"}[de];return nt?"\\"+nt:"\\x"+(de<16?"0":"")+x.call(de.toString(16))}function We(ce){return"Object("+ce+")"}function Le(ce){return ce+" { ? }"}function Ce(ce,de,nt,Ft){var Nt=Ft?vi(nt,Ft):C.call(nt,", ");return ce+" ("+de+") {"+Nt+"}"}function Ze(ce){for(var de=0;de=0)return!1;return!0}function Ee(ce,de){var nt;if(ce.indent===" ")nt=" ";else if(typeof ce.indent=="number"&&ce.indent>0)nt=C.call(Array(ce.indent+1)," ");else return null;return{base:nt,prev:C.call(Array(de+1),nt)}}function vi(ce,de){if(ce.length===0)return"";var nt=` +`+de.prev+de.base;return nt+C.call(ce,","+nt)+` +`+de.prev}function lt(ce,de){var nt=le(ce),Ft=[];if(nt){Ft.length=ce.length;for(var Nt=0;Nt"u"||!S?n:S(Uint8Array),O={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?n:ArrayBuffer,"%ArrayIteratorPrototype%":E&&S?S([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":R,"%AsyncGenerator%":R,"%AsyncGeneratorFunction%":R,"%AsyncIteratorPrototype%":R,"%Atomics%":typeof Atomics>"u"?n:Atomics,"%BigInt%":typeof BigInt>"u"?n:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?n:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?n:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":t,"%eval%":eval,"%EvalError%":i,"%Float16Array%":typeof Float16Array>"u"?n:Float16Array,"%Float32Array%":typeof Float32Array>"u"?n:Float32Array,"%Float64Array%":typeof Float64Array>"u"?n:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?n:FinalizationRegistry,"%Function%":g,"%GeneratorFunction%":R,"%Int8Array%":typeof Int8Array>"u"?n:Int8Array,"%Int16Array%":typeof Int16Array>"u"?n:Int16Array,"%Int32Array%":typeof Int32Array>"u"?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":E&&S?S(S([][Symbol.iterator]())):n,"%JSON%":typeof JSON=="object"?JSON:n,"%Map%":typeof Map>"u"?n:Map,"%MapIteratorPrototype%":typeof Map>"u"||!E||!S?n:S(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":e,"%Object.getOwnPropertyDescriptor%":b,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?n:Promise,"%Proxy%":typeof Proxy>"u"?n:Proxy,"%RangeError%":s,"%ReferenceError%":r,"%Reflect%":typeof Reflect>"u"?n:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?n:Set,"%SetIteratorPrototype%":typeof Set>"u"||!E||!S?n:S(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":E&&S?S(""[Symbol.iterator]()):n,"%Symbol%":E?Symbol:n,"%SyntaxError%":o,"%ThrowTypeError%":_,"%TypedArray%":B,"%TypeError%":a,"%Uint8Array%":typeof Uint8Array>"u"?n:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?n:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?n:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?n:Uint32Array,"%URIError%":c,"%WeakMap%":typeof WeakMap>"u"?n:WeakMap,"%WeakRef%":typeof WeakRef>"u"?n:WeakRef,"%WeakSet%":typeof WeakSet>"u"?n:WeakSet,"%Function.prototype.call%":A,"%Function.prototype.apply%":P,"%Object.defineProperty%":y,"%Object.getPrototypeOf%":C,"%Math.abs%":l,"%Math.floor%":h,"%Math.max%":u,"%Math.min%":d,"%Math.pow%":f,"%Math.round%":m,"%Math.sign%":p,"%Reflect.getPrototypeOf%":M};if(S)try{null.error}catch(Se){var W=S(S(Se));O["%Error.prototype%"]=W}var V=function Se(fe){var ye;if(fe==="%AsyncFunction%")ye=v("async function () {}");else if(fe==="%GeneratorFunction%")ye=v("function* () {}");else if(fe==="%AsyncGeneratorFunction%")ye=v("async function* () {}");else if(fe==="%AsyncGenerator%"){var q=Se("%AsyncGeneratorFunction%");q&&(ye=q.prototype)}else if(fe==="%AsyncIteratorPrototype%"){var Z=Se("%AsyncGenerator%");Z&&S&&(ye=S(Z.prototype))}return O[fe]=ye,ye},Y={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},L=ed(),N=mI(),F=L.call(A,Array.prototype.concat),D=L.call(P,Array.prototype.splice),X=L.call(A,String.prototype.replace),G=L.call(A,String.prototype.slice),K=L.call(A,RegExp.prototype.exec),J=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,oe=/\\(\\)?/g,le=function(fe){var ye=G(fe,0,1),q=G(fe,-1);if(ye==="%"&&q!=="%")throw new o("invalid intrinsic syntax, expected closing `%`");if(q==="%"&&ye!=="%")throw new o("invalid intrinsic syntax, expected opening `%`");var Z=[];return X(fe,J,function(se,H,j,$){Z[Z.length]=j?X($,oe,"$1"):H||se}),Z},ve=function(fe,ye){var q=fe,Z;if(N(Y,q)&&(Z=Y[q],q="%"+Z[0]+"%"),N(O,q)){var se=O[q];if(se===R&&(se=V(q)),typeof se>"u"&&!ye)throw new a("intrinsic "+fe+" exists, but is not available. Please file an issue!");return{alias:Z,name:q,value:se}}throw new o("intrinsic "+fe+" does not exist!")};return xf=function(fe,ye){if(typeof fe!="string"||fe.length===0)throw new a("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof ye!="boolean")throw new a('"allowMissing" argument must be a boolean');if(K(/^%?[^%]*%?$/,fe)===null)throw new o("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var q=le(fe),Z=q.length>0?q[0]:"",se=ve("%"+Z+"%",ye),H=se.name,j=se.value,$=!1,U=se.alias;U&&(Z=U[0],D(q,F([0,1],U)));for(var z=1,ee=!0;z=q.length){var be=b(j,ne);ee=!!be,ee&&"get"in be&&!("originalValue"in be.get)?j=be.get:j=j[ne]}else ee=N(j,ne),j=j[ne];ee&&!$&&(O[H]=j)}}return j},xf}var wf,Wv;function iw(){if(Wv)return wf;Wv=1;var n=_g(),e=tw(),t=e([n("%String.prototype.indexOf%")]);return wf=function(s,r){var o=n(s,!!r);return typeof o=="function"&&t(s,".prototype.")>-1?e([o]):o},wf}var Sf,zv;function nw(){if(zv)return Sf;zv=1;var n=_g(),e=iw(),t=Qu(),i=Qa(),s=n("%Map%",!0),r=e("Map.prototype.get",!0),o=e("Map.prototype.set",!0),a=e("Map.prototype.has",!0),c=e("Map.prototype.delete",!0),l=e("Map.prototype.size",!0);return Sf=!!s&&function(){var u,d={assert:function(f){if(!d.has(f))throw new i("Side channel does not contain "+t(f))},delete:function(f){if(u){var m=c(u,f);return l(u)===0&&(u=void 0),m}return!1},get:function(f){if(u)return r(u,f)},has:function(f){return u?a(u,f):!1},set:function(f,m){u||(u=new s),o(u,f,m)}};return d},Sf}var _f,qv;function pI(){if(qv)return _f;qv=1;var n=_g(),e=iw(),t=Qu(),i=nw(),s=Qa(),r=n("%WeakMap%",!0),o=e("WeakMap.prototype.get",!0),a=e("WeakMap.prototype.set",!0),c=e("WeakMap.prototype.has",!0),l=e("WeakMap.prototype.delete",!0);return _f=r?function(){var u,d,f={assert:function(m){if(!f.has(m))throw new s("Side channel does not contain "+t(m))},delete:function(m){if(r&&m&&(typeof m=="object"||typeof m=="function")){if(u)return l(u,m)}else if(i&&d)return d.delete(m);return!1},get:function(m){return r&&m&&(typeof m=="object"||typeof m=="function")&&u?o(u,m):d&&d.get(m)},has:function(m){return r&&m&&(typeof m=="object"||typeof m=="function")&&u?c(u,m):!!d&&d.has(m)},set:function(m,p){r&&m&&(typeof m=="object"||typeof m=="function")?(u||(u=new r),a(u,m,p)):i&&(d||(d=i()),d.set(m,p))}};return f}:i,_f}var Tf,Kv;function sw(){if(Kv)return Tf;Kv=1;var n=Qa(),e=Qu(),t=HA(),i=nw(),s=pI(),r=s||i||t;return Tf=function(){var a,c={assert:function(l){if(!c.has(l)){var h=l&&Object(l)===l?"the given object key":e(l);throw new n("Side channel does not contain "+h)}},delete:function(l){return!!a&&a.delete(l)},get:function(l){return a&&a.get(l)},has:function(l){return!!a&&a.has(l)},set:function(l,h){a||(a=r()),a.set(l,h)}};return c},Tf}var Ef,Jv;function Tg(){if(Jv)return Ef;Jv=1;var n=String.prototype.replace,e=/%20/g,t={RFC1738:"RFC1738",RFC3986:"RFC3986"};return Ef={default:t.RFC3986,formatters:{RFC1738:function(i){return n.call(i,e,"+")},RFC3986:function(i){return String(i)}},RFC1738:t.RFC1738,RFC3986:t.RFC3986},Ef}var Cf,Zv;function rw(){if(Zv)return Cf;Zv=1;var n=Tg(),e=sw(),t=Jx(),i=Object.prototype.hasOwnProperty,s=Array.isArray,r=e(),o=function(M,P){return r.set(M,P),M},a=function(M){return r.has(M)},c=function(M){return r.get(M)},l=function(M,P){r.set(M,P)},h=(function(){for(var C=[],M=0;M<256;++M)C[C.length]="%"+((M<16?"0":"")+M.toString(16)).toUpperCase();return C})(),u=function(M){for(;M.length>1;){var P=M.pop(),A=P.obj[P.prop];if(s(A)){for(var R=[],B=0;B=A.arrayLimit){if(A.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+A.arrayLimit+" element"+(A.arrayLimit===1?"":"s")+" allowed in an array.");return o(d(M.concat(P),A),R)}M[R]=P}else if(M&&typeof M=="object")if(a(M)){var B=c(M)+1;M[B]=P,l(M,B)}else{if(A&&A.strictMerge)return[M,P];(A&&(A.plainObjects||A.allowPrototypes)||!i.call(Object.prototype,P))&&(M[P]=!0)}else return[M,P];return M}if(!M||typeof M!="object"){if(a(P)){for(var O=Object.keys(P),W=A&&A.plainObjects?{__proto__:null,0:M}:{0:M},V=0;VA.arrayLimit){if(A.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+A.arrayLimit+" element"+(A.arrayLimit===1?"":"s")+" allowed in an array.");return o(d(L,A),L.length-1)}return L}var N=M;if(s(M)&&!s(P)&&(N=d(M,A)),s(M)&&s(P)){if(P.forEach(function(F,D){if(i.call(M,D)){var X=M[D];X&&typeof X=="object"&&F&&typeof F=="object"?M[D]=C(X,F,A):M[M.length]=F}else M[D]=F}),A&&typeof A.arrayLimit=="number"&&M.length>A.arrayLimit){if(A.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+A.arrayLimit+" element"+(A.arrayLimit===1?"":"s")+" allowed in an array.");return o(d(M,A),M.length-1)}return M}return Object.keys(P).reduce(function(F,D){var X=P[D];if(i.call(F,D)?f(F,D,C(F[D],X,A)):f(F,D,X),a(P)&&!a(F)&&o(F,c(P)),a(F)){var G=parseInt(D,10);String(G)===D&&G>=0&&G>c(F)&&l(F,G)}return F},N)},p=function(M,P){return Object.keys(P).reduce(function(A,R){return f(A,R,P[R]),A},M)},g=function(C,M,P){var A=C.replace(/\+/g," ");if(P==="iso-8859-1")return A.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(A)}catch{return A}},v=1024,b=function(M,P,A,R,B){if(M.length===0)return M;var O=M;if(typeof M=="symbol"?O=Symbol.prototype.toString.call(M):typeof M!="string"&&(O=String(M)),A==="iso-8859-1")return escape(O).replace(/%u[0-9a-f]{4}/gi,function(X){return"%26%23"+parseInt(X.slice(2),16)+"%3B"});for(var W="",V=0;V=v?O.slice(V,V+v):O;if(V+v=55296&&L<=56319&&(Y=Y.slice(0,-1),V-=1)}for(var N=[],F=0;F=48&&D<=57||D>=65&&D<=90||D>=97&&D<=122||B===n.RFC1738&&(D===40||D===41)){N[N.length]=Y.charAt(F);continue}if(D<128){N[N.length]=h[D];continue}if(D<2048){N[N.length]=h[192|D>>6]+h[128|D&63];continue}if(D<55296||D>=57344){N[N.length]=h[224|D>>12]+h[128|D>>6&63]+h[128|D&63];continue}F+=1,D=65536+((D&1023)<<10|Y.charCodeAt(F)&1023),N[N.length]=h[240|D>>18]+h[128|D>>12&63]+h[128|D>>6&63]+h[128|D&63]}W+=N.join("")}return W},y=function(M){for(var P=[{obj:{o:M},prop:"o"}],A=e(),R=0;RA){if(B)throw new RangeError("Array limit exceeded. Only "+A+" element"+(A===1?"":"s")+" allowed in an array.");return o(d(W,{plainObjects:R}),W.length-1)}return W},S=function(M,P){if(s(M)){for(var A=[],R=0;R"u"&&(F=0)}if(typeof M=="function"?L=M(v,L):L instanceof Date?L=R(L):b==="comma"&&r(L)&&(L=e.maybeMap(L,function(H){return H instanceof Date?R(H):H})),L===null){if(_)return O(C&&!W?C(v,h.encoder,V,"key",B):v);L=""}if(u(L)||e.isBuffer(L)){if(C){var G=W?v:C(v,h.encoder,V,"key",B);return[O(G)+"="+O(C(L,h.encoder,V,"value",B))]}return[O(v)+"="+O(String(L))]}var K=[];if(typeof L>"u")return K;var J;if(b==="comma"&&r(L))W&&C&&(L=e.maybeMap(L,function(H){return H==null?H:C(H)})),J=[{value:L.length>0?L.join(",")||null:void 0}];else if(r(M))J=M;else{var oe=Object.keys(L);J=P?oe.sort(P):oe}var le=S?String(v).replace(/\./g,"%2E"):String(v),ve=y&&r(L)&&L.length===1?le+"[]":le;if(x&&r(L)&&L.length===0)return ve+"[]";for(var Se=0;Se"u"?g.encodeDotInKeys===!0?!0:h.allowDots:!!g.allowDots;return{addQueryPrefix:typeof g.addQueryPrefix=="boolean"?g.addQueryPrefix:h.addQueryPrefix,allowDots:E,allowEmptyArrays:typeof g.allowEmptyArrays=="boolean"?!!g.allowEmptyArrays:h.allowEmptyArrays,arrayFormat:_,charset:v,charsetSentinel:typeof g.charsetSentinel=="boolean"?g.charsetSentinel:h.charsetSentinel,commaRoundTrip:!!g.commaRoundTrip,delimiter:typeof g.delimiter>"u"?h.delimiter:g.delimiter,encode:typeof g.encode=="boolean"?g.encode:h.encode,encodeDotInKeys:typeof g.encodeDotInKeys=="boolean"?g.encodeDotInKeys:h.encodeDotInKeys,encoder:typeof g.encoder=="function"?g.encoder:h.encoder,encodeValuesOnly:typeof g.encodeValuesOnly=="boolean"?g.encodeValuesOnly:h.encodeValuesOnly,filter:x,format:b,formatter:y,serializeDate:typeof g.serializeDate=="function"?g.serializeDate:h.serializeDate,skipNulls:typeof g.skipNulls=="boolean"?g.skipNulls:h.skipNulls,sort:typeof g.sort=="function"?g.sort:null,strictNullHandling:typeof g.strictNullHandling=="boolean"?g.strictNullHandling:h.strictNullHandling}};return Mf=function(p,g){var v=p,b=m(g),y,x;typeof b.filter=="function"?(x=b.filter,v=x("",v)):r(b.filter)&&(x=b.filter,y=x);var _=[];if(typeof v!="object"||v===null)return"";var E=s[b.arrayFormat],S=E==="comma"&&b.commaRoundTrip;y||(y=Object.keys(v)),b.sort&&y.sort(b.sort);for(var C=n(),M=0;M"u"||P===null)){var A=v[P];b.skipNulls&&A===null||a(_,f(A,P,E,S,b.allowEmptyArrays,b.strictNullHandling,b.skipNulls,b.encodeDotInKeys,b.encode?b.encoder:null,b.filter,b.sort,b.allowDots,b.serializeDate,b.format,b.formatter,b.encodeValuesOnly,b.charset,C))}}var R=_.join(b.delimiter),B=b.addQueryPrefix===!0?"?":"";return b.charsetSentinel&&(b.charset==="iso-8859-1"?B+="utf8=%26%2310003%3B"+b.delimiter:B+="utf8=%E2%9C%93"+b.delimiter),R.length>0?B+R:""},Mf}var Af,ey;function vI(){if(ey)return Af;ey=1;var n=rw(),e=Object.prototype.hasOwnProperty,t=Array.isArray,i={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:n.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictMerge:!0,strictNullHandling:!1,throwOnLimitExceeded:!1},s=function(f){return f.replace(/&#(\d+);/g,function(m,p){return String.fromCharCode(parseInt(p,10))})},r=function(f,m,p,g){if(f&&typeof f=="string"&&m.comma&&f.indexOf(",")>-1){if(g&&m.throwOnLimitExceeded)for(var v=0,b=f.indexOf(",");b>-1;){if(v+=1,v>=m.arrayLimit)throw new RangeError("Array limit exceeded. Only "+m.arrayLimit+" element"+(m.arrayLimit===1?"":"s")+" allowed in an array.");b=f.indexOf(",",b+1)}return f.split(",")}if(m.throwOnLimitExceeded&&p>=m.arrayLimit)throw new RangeError("Array limit exceeded. Only "+m.arrayLimit+" element"+(m.arrayLimit===1?"":"s")+" allowed in an array.");return f},o="utf8=%26%2310003%3B",a="utf8=%E2%9C%93",c=function(m,p){var g={__proto__:null},v=p.ignoreQueryPrefix?m.replace(/^\?/,""):m;v=v.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var b=p.parameterLimit===1/0?void 0:p.parameterLimit,y=v.split(p.delimiter,p.throwOnLimitExceeded&&typeof b<"u"?b+1:b);if(p.throwOnLimitExceeded&&typeof b<"u"&&y.length>b)throw new RangeError("Parameter limit exceeded. Only "+b+" parameter"+(b===1?"":"s")+" allowed.");var x=-1,_,E=p.charset;if(p.charsetSentinel)for(_=0;_-1&&(A=t(A)?[A]:A),p.comma&&t(A)&&A.length>p.arrayLimit&&(A=n.combine([],A,p.arrayLimit,p.plainObjects,p.throwOnLimitExceeded)),P!==null){var R=e.call(g,P);R&&(p.duplicates==="combine"||S.indexOf("[]=")>-1)?g[P]=n.combine(g[P],A,p.arrayLimit,p.plainObjects,p.throwOnLimitExceeded):(!R||p.duplicates==="last")&&(g[P]=A)}}return g},l=function(f,m,p,g){var v=0;if(f.length>0&&f[f.length-1]==="[]"){var b=f.slice(0,-1).join("");v=Array.isArray(m)&&m[b]?m[b].length:0}for(var y=g?m:r(m,p,v),x=f.length-1;x>=0;--x){var _,E=f[x];if(E==="[]"&&p.parseArrays)n.isOverflow(y)?_=y:_=p.allowEmptyArrays&&(y===""||p.strictNullHandling&&y===null)?[]:n.combine([],y,p.arrayLimit,p.plainObjects,p.throwOnLimitExceeded);else{_=p.plainObjects?{__proto__:null}:{};var S=E.charAt(0)==="["&&E.charAt(E.length-1)==="]"?E.slice(1,-1):E,C=p.decodeDotInKeys?S.replace(/%2E/g,"."):S,M=parseInt(C,10),P=!isNaN(M)&&E!==C&&String(M)===C&&M>=0&&p.parseArrays;if(!p.parseArrays&&C==="")_={0:y};else if(P&&M=0?g.slice(0,b):g;if(y){if(!p.plainObjects&&e.call(Object.prototype,y)&&!p.allowPrototypes)return;v[v.length]=y}for(var x=g.length,_=b,E=0;_>=0&&E=0){if(p.strictDepth===!0)throw new RangeError("Input depth exceeded depth option of "+p.depth+" and strictDepth is true");v[v.length]="["+g.slice(_)+"]"}return v},u=function(m,p,g,v){if(m){var b=h(m,g);if(b)return l(b,p,g,v)}},d=function(m){if(!m)return i;if(typeof m.allowEmptyArrays<"u"&&typeof m.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof m.decodeDotInKeys<"u"&&typeof m.decodeDotInKeys!="boolean")throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(m.decoder!==null&&typeof m.decoder<"u"&&typeof m.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof m.charset<"u"&&m.charset!=="utf-8"&&m.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");if(typeof m.throwOnLimitExceeded<"u"&&typeof m.throwOnLimitExceeded!="boolean")throw new TypeError("`throwOnLimitExceeded` option must be a boolean");var p=typeof m.charset>"u"?i.charset:m.charset,g=typeof m.duplicates>"u"?i.duplicates:m.duplicates;if(g!=="combine"&&g!=="first"&&g!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var v=typeof m.allowDots>"u"?m.decodeDotInKeys===!0?!0:i.allowDots:!!m.allowDots;return{allowDots:v,allowEmptyArrays:typeof m.allowEmptyArrays=="boolean"?!!m.allowEmptyArrays:i.allowEmptyArrays,allowPrototypes:typeof m.allowPrototypes=="boolean"?m.allowPrototypes:i.allowPrototypes,allowSparse:typeof m.allowSparse=="boolean"?m.allowSparse:i.allowSparse,arrayLimit:typeof m.arrayLimit=="number"?m.arrayLimit:i.arrayLimit,charset:p,charsetSentinel:typeof m.charsetSentinel=="boolean"?m.charsetSentinel:i.charsetSentinel,comma:typeof m.comma=="boolean"?m.comma:i.comma,decodeDotInKeys:typeof m.decodeDotInKeys=="boolean"?m.decodeDotInKeys:i.decodeDotInKeys,decoder:typeof m.decoder=="function"?m.decoder:i.decoder,delimiter:typeof m.delimiter=="string"||n.isRegExp(m.delimiter)?m.delimiter:i.delimiter,depth:typeof m.depth=="number"||m.depth===!1?+m.depth:i.depth,duplicates:g,ignoreQueryPrefix:m.ignoreQueryPrefix===!0,interpretNumericEntities:typeof m.interpretNumericEntities=="boolean"?m.interpretNumericEntities:i.interpretNumericEntities,parameterLimit:typeof m.parameterLimit=="number"?m.parameterLimit:i.parameterLimit,parseArrays:m.parseArrays!==!1,plainObjects:typeof m.plainObjects=="boolean"?m.plainObjects:i.plainObjects,strictDepth:typeof m.strictDepth=="boolean"?!!m.strictDepth:i.strictDepth,strictMerge:typeof m.strictMerge=="boolean"?!!m.strictMerge:i.strictMerge,strictNullHandling:typeof m.strictNullHandling=="boolean"?m.strictNullHandling:i.strictNullHandling,throwOnLimitExceeded:typeof m.throwOnLimitExceeded=="boolean"?m.throwOnLimitExceeded:!1}};return Af=function(f,m){var p=d(m);if(f===""||f===null||typeof f>"u")return p.plainObjects?{__proto__:null}:{};for(var g=typeof f=="string"?c(f,p):f,v=p.plainObjects?{__proto__:null}:{},b=Object.keys(g),y=0;y",'"',"`"," ","\r",` +`," "],o=["{","}","|","\\","^","`"].concat(r),a=["'"].concat(o),c=["%","/","?",";","#"].concat(a),l=["/","?","#"],h=255,u=/^[+a-z0-9A-Z_-]{0,63}$/,d=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,f={javascript:!0,"javascript:":!0},m={javascript:!0,"javascript:":!0},p={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},g=yI();function v(_,E,S){if(_&&typeof _=="object"&&_ instanceof e)return _;var C=new e;return C.parse(_,E,S),C}e.prototype.parse=function(_,E,S){if(typeof _!="string")throw new TypeError("Parameter 'url' must be a string, not "+typeof _);var C=_.indexOf("?"),M=C!==-1&&C<_.indexOf("#")?"?":"#",P=_.split(M),A=/\\/g;P[0]=P[0].replace(A,"/"),_=P.join(M);var R=_;if(R=R.trim(),!S&&_.split("#").length===1){var B=s.exec(R);if(B)return this.path=R,this.href=R,this.pathname=B[1],B[2]?(this.search=B[2],E?this.query=g.parse(this.search.substr(1)):this.query=this.search.substr(1)):E&&(this.search="",this.query={}),this}var O=t.exec(R);if(O){O=O[0];var W=O.toLowerCase();this.protocol=W,R=R.substr(O.length)}if(S||O||R.match(/^\/\/[^@/]+@[^@/]+/)){var V=R.substr(0,2)==="//";V&&!(O&&m[O])&&(R=R.substr(2),this.slashes=!0)}if(!m[O]&&(V||O&&!p[O])){for(var Y=-1,L=0;L127?oe+="x":oe+=J[le];if(!oe.match(u)){var Se=G.slice(0,L),fe=G.slice(L+1),ye=J.match(d);ye&&(Se.push(ye[1]),fe.unshift(ye[2])),fe.length&&(R="/"+fe.join(".")+R),this.hostname=Se.join(".");break}}}this.hostname.length>h?this.hostname="":this.hostname=this.hostname.toLowerCase(),X||(this.hostname=n.toASCII(this.hostname));var q=this.port?":"+this.port:"",Z=this.hostname||"";this.host=Z+q,this.href+=this.host,X&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),R[0]!=="/"&&(R="/"+R))}if(!f[W])for(var L=0,K=a.length;L0?S.host.split("@"):!1;oe&&(S.auth=oe.shift(),S.hostname=oe.shift(),S.host=S.hostname)}return S.search=_.search,S.query=_.query,(S.pathname!==null||S.search!==null)&&(S.path=(S.pathname?S.pathname:"")+(S.search?S.search:"")),S.href=S.format(),S}if(!G.length)return S.pathname=null,S.search?S.path="/"+S.search:S.path=null,S.href=S.format(),S;for(var le=G.slice(-1)[0],ve=(S.host||_.host||G.length>1)&&(le==="."||le==="..")||le==="",Se=0,fe=G.length;fe>=0;fe--)le=G[fe],le==="."?G.splice(fe,1):le===".."?(G.splice(fe,1),Se++):Se&&(G.splice(fe,1),Se--);if(!D&&!X)for(;Se--;Se)G.unshift("..");D&&G[0]!==""&&(!G[0]||G[0].charAt(0)!=="/")&&G.unshift(""),ve&&G.join("/").substr(-1)!=="/"&&G.push("");var ye=G[0]===""||G[0]&&G[0].charAt(0)==="/";if(J){S.hostname=ye?"":G.length?G.shift():"",S.host=S.hostname;var oe=S.host&&S.host.indexOf("@")>0?S.host.split("@"):!1;oe&&(S.auth=oe.shift(),S.hostname=oe.shift(),S.host=S.hostname)}return D=D||S.host&&G.length,D&&!ye&&G.unshift(""),G.length>0?S.pathname=G.join("/"):(S.pathname=null,S.path=null),(S.pathname!==null||S.search!==null)&&(S.path=(S.pathname?S.pathname:"")+(S.search?S.search:"")),S.auth=_.auth||S.auth,S.slashes=S.slashes||_.slashes,S.href=S.format(),S},e.prototype.parseHost=function(){var _=this.host,E=i.exec(_);E&&(E=E[0],E!==":"&&(this.port=E.substr(1)),_=_.substr(0,_.length-E.length)),_&&(this.hostname=_)},uo.parse=v,uo.resolve=y,uo.resolveObject=x,uo.format=b,uo.Url=e,uo}bI();const ny={};function pt(n,e,t=3){if(ny[e])return;let i=new Error().stack;typeof i>"u"?console.warn("PixiJS Deprecation Warning: ",`${e} +Deprecated since v${n}`):(i=i.split(` +`).splice(t).join(` +`),console.groupCollapsed?(console.groupCollapsed("%cPixiJS Deprecation Warning: %c%s","color:#614108;background:#fffbe6","font-weight:normal;color:#614108;background:#fffbe6",`${e} +Deprecated since v${n}`),console.warn(i),console.groupEnd()):(console.warn("PixiJS Deprecation Warning: ",`${e} +Deprecated since v${n}`),console.warn(i))),ny[e]=!0}function Bn(n){if(typeof n!="string")throw new TypeError(`Path must be a string. Received ${JSON.stringify(n)}`)}function hl(n){return n.split("?")[0].split("#")[0]}function xI(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function wI(n,e,t){return n.replace(new RegExp(xI(e),"g"),t)}function SI(n,e){let t="",i=0,s=-1,r=0,o=-1;for(let a=0;a<=n.length;++a){if(a2){const c=t.lastIndexOf("/");if(c!==t.length-1){c===-1?(t="",i=0):(t=t.slice(0,c),i=t.length-1-t.lastIndexOf("/")),s=a,r=0;continue}}else if(t.length===2||t.length===1){t="",i=0,s=a,r=0;continue}}}else t.length>0?t+=`/${n.slice(s+1,a)}`:t=n.slice(s+1,a),i=a-s-1;s=a,r=0}else o===46&&r!==-1?++r:r=-1}return t}const di={toPosix(n){return wI(n,"\\","/")},isUrl(n){return/^https?:/.test(this.toPosix(n))},isDataUrl(n){return/^data:([a-z]+\/[a-z0-9-+.]+(;[a-z0-9-.!#$%*+.{}|~`]+=[a-z0-9-.!#$%*+.{}()_|~`]+)*)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@\/?%\s<>]*?)$/i.test(n)},isBlobUrl(n){return n.startsWith("blob:")},hasProtocol(n){return/^[^/:]+:/.test(this.toPosix(n))},getProtocol(n){Bn(n),n=this.toPosix(n);const e=/^file:\/\/\//.exec(n);if(e)return e[0];const t=/^[^/:]+:\/{0,2}/.exec(n);return t?t[0]:""},toAbsolute(n,e,t){if(Bn(n),this.isDataUrl(n)||this.isBlobUrl(n))return n;const i=hl(this.toPosix(e??Ve.ADAPTER.getBaseUrl())),s=hl(this.toPosix(t??this.rootname(i)));return n=this.toPosix(n),n.startsWith("/")?di.join(s,n.slice(1)):this.isAbsolute(n)?n:this.join(i,n)},normalize(n){if(Bn(n),n.length===0)return".";if(this.isDataUrl(n)||this.isBlobUrl(n))return n;n=this.toPosix(n);let e="";const t=n.startsWith("/");this.hasProtocol(n)&&(e=this.rootname(n),n=n.slice(e.length));const i=n.endsWith("/");return n=SI(n),n.length>0&&i&&(n+="/"),t?`/${n}`:e+n},isAbsolute(n){return Bn(n),n=this.toPosix(n),this.hasProtocol(n)?!0:n.startsWith("/")},join(...n){if(n.length===0)return".";let e;for(let t=0;t0)if(e===void 0)e=i;else{const s=n[t-1]??"";this.joinExtensions.includes(this.extname(s).toLowerCase())?e+=`/../${i}`:e+=`/${i}`}}return e===void 0?".":this.normalize(e)},dirname(n){if(Bn(n),n.length===0)return".";n=this.toPosix(n);let e=n.charCodeAt(0);const t=e===47;let i=-1,s=!0;const r=this.getProtocol(n),o=n;n=n.slice(r.length);for(let a=n.length-1;a>=1;--a)if(e=n.charCodeAt(a),e===47){if(!s){i=a;break}}else s=!1;return i===-1?t?"/":this.isUrl(o)?r+n:r:t&&i===1?"//":r+n.slice(0,i)},rootname(n){Bn(n),n=this.toPosix(n);let e="";if(n.startsWith("/")?e="/":e=this.getProtocol(n),this.isUrl(n)){const t=n.indexOf("/",e.length);t!==-1?e=n.slice(0,t):e=n,e.endsWith("/")||(e+="/")}return e},basename(n,e){Bn(n),e&&Bn(e),n=hl(this.toPosix(n));let t=0,i=-1,s=!0,r;if(e!==void 0&&e.length>0&&e.length<=n.length){if(e.length===n.length&&e===n)return"";let o=e.length-1,a=-1;for(r=n.length-1;r>=0;--r){const c=n.charCodeAt(r);if(c===47){if(!s){t=r+1;break}}else a===-1&&(s=!1,a=r+1),o>=0&&(c===e.charCodeAt(o)?--o===-1&&(i=r):(o=-1,i=a))}return t===i?i=a:i===-1&&(i=n.length),n.slice(t,i)}for(r=n.length-1;r>=0;--r)if(n.charCodeAt(r)===47){if(!s){t=r+1;break}}else i===-1&&(s=!1,i=r+1);return i===-1?"":n.slice(t,i)},extname(n){Bn(n),n=hl(this.toPosix(n));let e=-1,t=0,i=-1,s=!0,r=0;for(let o=n.length-1;o>=0;--o){const a=n.charCodeAt(o);if(a===47){if(!s){t=o+1;break}continue}i===-1&&(s=!1,i=o+1),a===46?e===-1?e=o:r!==1&&(r=1):e!==-1&&(r=-1)}return e===-1||i===-1||r===0||r===1&&e===i-1&&e===t+1?"":n.slice(e,i)},parse(n){Bn(n);const e={root:"",dir:"",base:"",ext:"",name:""};if(n.length===0)return e;n=hl(this.toPosix(n));let t=n.charCodeAt(0);const i=this.isAbsolute(n);let s;e.root=this.rootname(n),i||this.hasProtocol(n)?s=1:s=0;let r=-1,o=0,a=-1,c=!0,l=n.length-1,h=0;for(;l>=s;--l){if(t=n.charCodeAt(l),t===47){if(!c){o=l+1;break}continue}a===-1&&(c=!1,a=l+1),t===46?r===-1?r=l:h!==1&&(h=1):r!==-1&&(h=-1)}return r===-1||a===-1||h===0||h===1&&r===a-1&&r===o+1?a!==-1&&(o===0&&i?e.base=e.name=n.slice(1,a):e.base=e.name=n.slice(o,a)):(o===0&&i?(e.name=n.slice(1,r),e.base=n.slice(1,a)):(e.name=n.slice(o,r),e.base=n.slice(o,a)),e.ext=n.slice(r,a)),e.dir=this.dirname(n),e},sep:"/",delimiter:":",joinExtensions:[".html"]};let Pf;async function _I(){return Pf??(Pf=(async()=>{var r;const n=document.createElement("canvas").getContext("webgl");if(!n)return Ri.UNPACK;const e=await new Promise(o=>{const a=document.createElement("video");a.onloadeddata=()=>o(a),a.onerror=()=>o(null),a.autoplay=!1,a.crossOrigin="anonymous",a.preload="auto",a.src="data:video/webm;base64,GkXfo59ChoEBQveBAULygQRC84EIQoKEd2VibUKHgQJChYECGFOAZwEAAAAAAAHTEU2bdLpNu4tTq4QVSalmU6yBoU27i1OrhBZUrmtTrIHGTbuMU6uEElTDZ1OsggEXTbuMU6uEHFO7a1OsggG97AEAAAAAAABZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmoCrXsYMPQkBNgIRMYXZmV0GETGF2ZkSJiEBEAAAAAAAAFlSua8yuAQAAAAAAAEPXgQFzxYgAAAAAAAAAAZyBACK1nIN1bmSIgQCGhVZfVlA5g4EBI+ODhAJiWgDglLCBArqBApqBAlPAgQFVsIRVuYEBElTDZ9Vzc9JjwItjxYgAAAAAAAAAAWfInEWjh0VOQ09ERVJEh49MYXZjIGxpYnZweC12cDlnyKJFo4hEVVJBVElPTkSHlDAwOjAwOjAwLjA0MDAwMDAwMAAAH0O2dcfngQCgwqGggQAAAIJJg0IAABAAFgA4JBwYSgAAICAAEb///4r+AAB1oZ2mm+6BAaWWgkmDQgAAEAAWADgkHBhKAAAgIABIQBxTu2uRu4+zgQC3iveBAfGCAXHwgQM=",a.load()});if(!e)return Ri.UNPACK;const t=n.createTexture();n.bindTexture(n.TEXTURE_2D,t);const i=n.createFramebuffer();n.bindFramebuffer(n.FRAMEBUFFER,i),n.framebufferTexture2D(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,t,0),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,n.NONE),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,e);const s=new Uint8Array(4);return n.readPixels(0,0,1,1,n.RGBA,n.UNSIGNED_BYTE,s),n.deleteFramebuffer(i),n.deleteTexture(t),(r=n.getExtension("WEBGL_lose_context"))==null||r.loseContext(),s[0]<=s[3]?Ri.PMA:Ri.UNPACK})()),Pf}let Rf;function TI(){return typeof Rf>"u"&&(Rf=(function(){var e;const n={stencil:!0,failIfMajorPerformanceCaveat:Ve.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT};try{if(!Ve.ADAPTER.getWebGLRenderingContext())return!1;const t=Ve.ADAPTER.createCanvas();let i=t.getContext("webgl",n)||t.getContext("experimental-webgl",n);const s=!!((e=i==null?void 0:i.getContextAttributes())!=null&&e.stencil);if(i){const r=i.getExtension("WEBGL_lose_context");r&&r.loseContext()}return i=null,s}catch{return!1}})()),Rf}var EI={grad:.9,turn:360,rad:360/(2*Math.PI)},Ds=function(n){return typeof n=="string"?n.length>0:typeof n=="number"},Ii=function(n,e,t){return e===void 0&&(e=0),t===void 0&&(t=Math.pow(10,e)),Math.round(t*n)/t+0},Fn=function(n,e,t){return e===void 0&&(e=0),t===void 0&&(t=1),n>t?t:n>e?n:e},ow=function(n){return(n=isFinite(n)?n%360:0)>0?n:n+360},sy=function(n){return{r:Fn(n.r,0,255),g:Fn(n.g,0,255),b:Fn(n.b,0,255),a:Fn(n.a)}},kf=function(n){return{r:Ii(n.r),g:Ii(n.g),b:Ii(n.b),a:Ii(n.a,3)}},CI=/^#([0-9a-f]{3,8})$/i,Oc=function(n){var e=n.toString(16);return e.length<2?"0"+e:e},aw=function(n){var e=n.r,t=n.g,i=n.b,s=n.a,r=Math.max(e,t,i),o=r-Math.min(e,t,i),a=o?r===e?(t-i)/o:r===t?2+(i-e)/o:4+(e-t)/o:0;return{h:60*(a<0?a+6:a),s:r?o/r*100:0,v:r/255*100,a:s}},lw=function(n){var e=n.h,t=n.s,i=n.v,s=n.a;e=e/360*6,t/=100,i/=100;var r=Math.floor(e),o=i*(1-t),a=i*(1-(e-r)*t),c=i*(1-(1-e+r)*t),l=r%6;return{r:255*[i,a,o,o,c,i][l],g:255*[c,i,i,a,o,o][l],b:255*[o,o,c,i,i,a][l],a:s}},ry=function(n){return{h:ow(n.h),s:Fn(n.s,0,100),l:Fn(n.l,0,100),a:Fn(n.a)}},oy=function(n){return{h:Ii(n.h),s:Ii(n.s),l:Ii(n.l),a:Ii(n.a,3)}},ay=function(n){return lw((t=(e=n).s,{h:e.h,s:(t*=((i=e.l)<50?i:100-i)/100)>0?2*t/(i+t)*100:0,v:i+t,a:e.a}));var e,t,i},kl=function(n){return{h:(e=aw(n)).h,s:(s=(200-(t=e.s))*(i=e.v)/100)>0&&s<200?t*i/100/(s<=100?s:200-s)*100:0,l:s/2,a:e.a};var e,t,i,s},MI=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,AI=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,II=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,PI=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Nm={string:[[function(n){var e=CI.exec(n);return e?(n=e[1]).length<=4?{r:parseInt(n[0]+n[0],16),g:parseInt(n[1]+n[1],16),b:parseInt(n[2]+n[2],16),a:n.length===4?Ii(parseInt(n[3]+n[3],16)/255,2):1}:n.length===6||n.length===8?{r:parseInt(n.substr(0,2),16),g:parseInt(n.substr(2,2),16),b:parseInt(n.substr(4,2),16),a:n.length===8?Ii(parseInt(n.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(n){var e=II.exec(n)||PI.exec(n);return e?e[2]!==e[4]||e[4]!==e[6]?null:sy({r:Number(e[1])/(e[2]?100/255:1),g:Number(e[3])/(e[4]?100/255:1),b:Number(e[5])/(e[6]?100/255:1),a:e[7]===void 0?1:Number(e[7])/(e[8]?100:1)}):null},"rgb"],[function(n){var e=MI.exec(n)||AI.exec(n);if(!e)return null;var t,i,s=ry({h:(t=e[1],i=e[2],i===void 0&&(i="deg"),Number(t)*(EI[i]||1)),s:Number(e[3]),l:Number(e[4]),a:e[5]===void 0?1:Number(e[5])/(e[6]?100:1)});return ay(s)},"hsl"]],object:[[function(n){var e=n.r,t=n.g,i=n.b,s=n.a,r=s===void 0?1:s;return Ds(e)&&Ds(t)&&Ds(i)?sy({r:Number(e),g:Number(t),b:Number(i),a:Number(r)}):null},"rgb"],[function(n){var e=n.h,t=n.s,i=n.l,s=n.a,r=s===void 0?1:s;if(!Ds(e)||!Ds(t)||!Ds(i))return null;var o=ry({h:Number(e),s:Number(t),l:Number(i),a:Number(r)});return ay(o)},"hsl"],[function(n){var e=n.h,t=n.s,i=n.v,s=n.a,r=s===void 0?1:s;if(!Ds(e)||!Ds(t)||!Ds(i))return null;var o=(function(a){return{h:ow(a.h),s:Fn(a.s,0,100),v:Fn(a.v,0,100),a:Fn(a.a)}})({h:Number(e),s:Number(t),v:Number(i),a:Number(r)});return lw(o)},"hsv"]]},ly=function(n,e){for(var t=0;t=.5},n.prototype.toHex=function(){return e=kf(this.rgba),t=e.r,i=e.g,s=e.b,o=(r=e.a)<1?Oc(Ii(255*r)):"","#"+Oc(t)+Oc(i)+Oc(s)+o;var e,t,i,s,r,o},n.prototype.toRgb=function(){return kf(this.rgba)},n.prototype.toRgbString=function(){return e=kf(this.rgba),t=e.r,i=e.g,s=e.b,(r=e.a)<1?"rgba("+t+", "+i+", "+s+", "+r+")":"rgb("+t+", "+i+", "+s+")";var e,t,i,s,r},n.prototype.toHsl=function(){return oy(kl(this.rgba))},n.prototype.toHslString=function(){return e=oy(kl(this.rgba)),t=e.h,i=e.s,s=e.l,(r=e.a)<1?"hsla("+t+", "+i+"%, "+s+"%, "+r+")":"hsl("+t+", "+i+"%, "+s+"%)";var e,t,i,s,r},n.prototype.toHsv=function(){return e=aw(this.rgba),{h:Ii(e.h),s:Ii(e.s),v:Ii(e.v),a:Ii(e.a,3)};var e},n.prototype.invert=function(){return os({r:255-(e=this.rgba).r,g:255-e.g,b:255-e.b,a:e.a});var e},n.prototype.saturate=function(e){return e===void 0&&(e=.1),os(Ff(this.rgba,e))},n.prototype.desaturate=function(e){return e===void 0&&(e=.1),os(Ff(this.rgba,-e))},n.prototype.grayscale=function(){return os(Ff(this.rgba,-1))},n.prototype.lighten=function(e){return e===void 0&&(e=.1),os(cy(this.rgba,e))},n.prototype.darken=function(e){return e===void 0&&(e=.1),os(cy(this.rgba,-e))},n.prototype.rotate=function(e){return e===void 0&&(e=15),this.hue(this.hue()+e)},n.prototype.alpha=function(e){return typeof e=="number"?os({r:(t=this.rgba).r,g:t.g,b:t.b,a:e}):Ii(this.rgba.a,3);var t},n.prototype.hue=function(e){var t=kl(this.rgba);return typeof e=="number"?os({h:e,s:t.s,l:t.l,a:t.a}):Ii(t.h)},n.prototype.isEqual=function(e){return this.toHex()===os(e).toHex()},n})(),os=function(n){return n instanceof Dm?n:new Dm(n)},hy=[],kI=function(n){n.forEach(function(e){hy.indexOf(e)<0&&(e(Dm,Nm),hy.push(e))})};function FI(n,e){var t={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},i={};for(var s in t)i[t[s]]=s;var r={};n.prototype.toName=function(o){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var a,c,l=i[this.toHex()];if(l)return l;if(o!=null&&o.closest){var h=this.toRgb(),u=1/0,d="black";if(!r.length)for(var f in t)r[f]=new n(t[f]).toRgb();for(var m in t){var p=(a=h,c=r[m],Math.pow(a.r-c.r,2)+Math.pow(a.g-c.g,2)+Math.pow(a.b-c.b,2));ps===t[r]);if(e!==null&&t!==null){const s=Object.keys(e),r=Object.keys(t);return s.length!==r.length?!1:s.every(o=>e[o]===t[o])}return e===t}toRgba(){const[e,t,i,s]=this._components;return{r:e,g:t,b:i,a:s}}toRgb(){const[e,t,i]=this._components;return{r:e,g:t,b:i}}toRgbaString(){const[e,t,i]=this.toUint8RgbArray();return`rgba(${e},${t},${i},${this.alpha})`}toUint8RgbArray(e){const[t,i,s]=this._components;return e=e??[],e[0]=Math.round(t*255),e[1]=Math.round(i*255),e[2]=Math.round(s*255),e}toRgbArray(e){e=e??[];const[t,i,s]=this._components;return e[0]=t,e[1]=i,e[2]=s,e}toNumber(){return this._int}toLittleEndianNumber(){const e=this._int;return(e>>16)+(e&65280)+((e&255)<<16)}multiply(e){const[t,i,s,r]=bh.temp.setValue(e)._components;return this._components[0]*=t,this._components[1]*=i,this._components[2]*=s,this._components[3]*=r,this.refreshInt(),this._value=null,this}premultiply(e,t=!0){return t&&(this._components[0]*=e,this._components[1]*=e,this._components[2]*=e),this._components[3]=e,this.refreshInt(),this._value=null,this}toPremultiplied(e,t=!0){if(e===1)return(255<<24)+this._int;if(e===0)return t?0:this._int;let i=this._int>>16&255,s=this._int>>8&255,r=this._int&255;return t&&(i=i*e+.5|0,s=s*e+.5|0,r=r*e+.5|0),(e*255<<24)+(i<<16)+(s<<8)+r}toHex(){const e=this._int.toString(16);return`#${"000000".substring(0,6-e.length)+e}`}toHexa(){const e=Math.round(this._components[3]*255).toString(16);return this.toHex()+"00".substring(0,2-e.length)+e}setAlpha(e){return this._components[3]=this._clamp(e),this}round(e){const[t,i,s]=this._components;return this._components[0]=Math.round(t*e)/e,this._components[1]=Math.round(i*e)/e,this._components[2]=Math.round(s*e)/e,this.refreshInt(),this._value=null,this}toArray(e){e=e??[];const[t,i,s,r]=this._components;return e[0]=t,e[1]=i,e[2]=s,e[3]=r,e}normalize(e){let t,i,s,r;if((typeof e=="number"||e instanceof Number)&&e>=0&&e<=16777215){const o=e;t=(o>>16&255)/255,i=(o>>8&255)/255,s=(o&255)/255,r=1}else if((Array.isArray(e)||e instanceof Float32Array)&&e.length>=3&&e.length<=4)e=this._clamp(e),[t,i,s,r=1]=e;else if((e instanceof Uint8Array||e instanceof Uint8ClampedArray)&&e.length>=3&&e.length<=4)e=this._clamp(e,0,255),[t,i,s,r=255]=e,t/=255,i/=255,s/=255,r/=255;else if(typeof e=="string"||typeof e=="object"){if(typeof e=="string"){const a=bh.HEX_PATTERN.exec(e);a&&(e=`#${a[2]}`)}const o=os(e);o.isValid()&&({r:t,g:i,b:s,a:r}=o.rgba,t/=255,i/=255,s/=255)}if(t!==void 0)this._components[0]=t,this._components[1]=i,this._components[2]=s,this._components[3]=r,this.refreshInt();else throw new Error(`Unable to convert color ${e}`)}refreshInt(){this._clamp(this._components);const[e,t,i]=this._components;this._int=(e*255<<16)+(t*255<<8)+(i*255|0)}_clamp(e,t=0,i=1){return typeof e=="number"?Math.min(Math.max(e,t),i):(e.forEach((s,r)=>{e[r]=Math.min(Math.max(s,t),i)}),e)}};fa.shared=new fa,fa.temp=new fa,fa.HEX_PATTERN=/^(#|0x)?(([a-f0-9]{3}){1,2}([a-f0-9]{2})?)$/i;let kt=fa;function LI(n){return pt("7.2.0","utils.hex2string is deprecated, use Color#toHex instead"),kt.shared.setValue(n).toHex()}function OI(n){return pt("7.2.0","utils.rgb2hex is deprecated, use Color#toNumber instead"),kt.shared.setValue(n).toNumber()}function $I(){const n=[],e=[];for(let i=0;i<32;i++)n[i]=i,e[i]=i;n[Qe.NORMAL_NPM]=Qe.NORMAL,n[Qe.ADD_NPM]=Qe.ADD,n[Qe.SCREEN_NPM]=Qe.SCREEN,e[Qe.NORMAL]=Qe.NORMAL_NPM,e[Qe.ADD]=Qe.ADD_NPM,e[Qe.SCREEN]=Qe.SCREEN_NPM;const t=[];return t.push(e),t.push(n),t}const cw=$I();function hw(n,e){return cw[e?1:0][n]}function NI(n,e=null){const t=n*6;if(e=e||new Uint16Array(t),e.length!==t)throw new Error(`Out buffer length is incorrect, got ${e.length} and expected ${t}`);for(let i=0,s=0;i>>1,n|=n>>>2,n|=n>>>4,n|=n>>>8,n|=n>>>16,n+1}function uy(n){return!(n&n-1)&&!!n}function dy(n){let e=(n>65535?1:0)<<4;n>>>=e;let t=(n>255?1:0)<<3;return n>>>=t,e|=t,t=(n>15?1:0)<<2,n>>>=t,e|=t,t=(n>3?1:0)<<1,n>>>=t,e|=t,e|n>>1}function Pa(n,e,t){const i=n.length;let s;if(e>=i||t===0)return;t=e+t>i?i-e:t;const r=i-t;for(s=e;s(n.Renderer="renderer",n.Application="application",n.RendererSystem="renderer-webgl-system",n.RendererPlugin="renderer-webgl-plugin",n.CanvasRendererSystem="renderer-canvas-system",n.CanvasRendererPlugin="renderer-canvas-plugin",n.Asset="asset",n.LoadParser="load-parser",n.ResolveParser="resolve-parser",n.CacheParser="cache-parser",n.DetectionParser="detection-parser",n))($e||{});const Um=n=>{if(typeof n=="function"||typeof n=="object"&&n.extension){if(!n.extension)throw new Error("Extension class must have an extension object");n={...typeof n.extension!="object"?{type:n.extension}:n.extension,ref:n}}if(typeof n=="object")n={...n};else throw new Error("Invalid extension type");return typeof n.type=="string"&&(n.type=[n.type]),n},vy=(n,e)=>Um(n).priority??e,je={_addHandlers:{},_removeHandlers:{},_queue:{},remove(...n){return n.map(Um).forEach(e=>{e.type.forEach(t=>{var i,s;return(s=(i=this._removeHandlers)[t])==null?void 0:s.call(i,e)})}),this},add(...n){return n.map(Um).forEach(e=>{e.type.forEach(t=>{var r,o;const i=this._addHandlers,s=this._queue;i[t]?(r=i[t])==null||r.call(i,e):(s[t]=s[t]||[],(o=s[t])==null||o.push(e))})}),this},handle(n,e,t){var o;const i=this._addHandlers,s=this._removeHandlers;if(i[n]||s[n])throw new Error(`Extension type ${n} already has a handler`);i[n]=e,s[n]=t;const r=this._queue;return r[n]&&((o=r[n])==null||o.forEach(a=>e(a)),delete r[n]),this},handleByMap(n,e){return this.handle(n,t=>{t.name&&(e[t.name]=t.ref)},t=>{t.name&&delete e[t.name]})},handleByList(n,e,t=-1){return this.handle(n,i=>{e.includes(i.ref)||(e.push(i.ref),e.sort((s,r)=>vy(r,t)-vy(s,t)))},i=>{const s=e.indexOf(i.ref);s!==-1&&e.splice(s,1)})}};class Vm{constructor(e){typeof e=="number"?this.rawBinaryData=new ArrayBuffer(e):e instanceof Uint8Array?this.rawBinaryData=e.buffer:this.rawBinaryData=e,this.uint32View=new Uint32Array(this.rawBinaryData),this.float32View=new Float32Array(this.rawBinaryData)}get int8View(){return this._int8View||(this._int8View=new Int8Array(this.rawBinaryData)),this._int8View}get uint8View(){return this._uint8View||(this._uint8View=new Uint8Array(this.rawBinaryData)),this._uint8View}get int16View(){return this._int16View||(this._int16View=new Int16Array(this.rawBinaryData)),this._int16View}get uint16View(){return this._uint16View||(this._uint16View=new Uint16Array(this.rawBinaryData)),this._uint16View}get int32View(){return this._int32View||(this._int32View=new Int32Array(this.rawBinaryData)),this._int32View}view(e){return this[`${e}View`]}destroy(){this.rawBinaryData=null,this._int8View=null,this._uint8View=null,this._int16View=null,this._uint16View=null,this._int32View=null,this.uint32View=null,this.float32View=null}static sizeOf(e){switch(e){case"int8":case"uint8":return 1;case"int16":case"uint16":return 2;case"int32":case"uint32":case"float32":return 4;default:throw new Error(`${e} isn't a valid view type`)}}}const YI=["precision mediump float;","void main(void){","float test = 0.1;","%forloop%","gl_FragColor = vec4(0.0);","}"].join(` +`);function GI(n){let e="";for(let t=0;t0&&(e+=` +else `),t=0;--i){const s=Xm[i];if(s.test&&s.test(n,t))return new s(n,e)}throw new Error("Unrecognized source type to auto-detect Resource")}class Zn{constructor(e){this.items=[],this._name=e,this._aliasCount=0}emit(e,t,i,s,r,o,a,c){if(arguments.length>8)throw new Error("max arguments reached");const{name:l,items:h}=this;this._aliasCount++;for(let u=0,d=h.length;u0&&this.items.length>1&&(this._aliasCount=0,this.items=this.items.slice(0))}add(e){return e[this._name]&&(this.ensureNonAliasedItems(),this.remove(e),this.items.push(e)),this}remove(e){const t=this.items.indexOf(e);return t!==-1&&(this.ensureNonAliasedItems(),this.items.splice(t,1)),this}contains(e){return this.items.includes(e)}removeAll(){return this.ensureNonAliasedItems(),this.items.length=0,this}destroy(){this.removeAll(),this.items.length=0,this._name=""}get empty(){return this.items.length===0}get name(){return this._name}}Object.defineProperties(Zn.prototype,{dispatch:{value:Zn.prototype.emit},run:{value:Zn.prototype.emit}});class Zl{constructor(e=0,t=0){this._width=e,this._height=t,this.destroyed=!1,this.internal=!1,this.onResize=new Zn("setRealSize"),this.onUpdate=new Zn("update"),this.onError=new Zn("onError")}bind(e){this.onResize.add(e),this.onUpdate.add(e),this.onError.add(e),(this._width||this._height)&&this.onResize.emit(this._width,this._height)}unbind(e){this.onResize.remove(e),this.onUpdate.remove(e),this.onError.remove(e)}resize(e,t){(e!==this._width||t!==this._height)&&(this._width=e,this._height=t,this.onResize.emit(e,t))}get valid(){return!!this._width&&!!this._height}update(){this.destroyed||this.onUpdate.emit()}load(){return Promise.resolve(this)}get width(){return this._width}get height(){return this._height}style(e,t,i){return!1}dispose(){}destroy(){this.destroyed||(this.destroyed=!0,this.dispose(),this.onError.removeAll(),this.onError=null,this.onResize.removeAll(),this.onResize=null,this.onUpdate.removeAll(),this.onUpdate=null)}static test(e,t){return!1}}class td extends Zl{constructor(e,t){const{width:i,height:s}=t||{};if(!i||!s)throw new Error("BufferResource width or height invalid");super(i,s),this.data=e,this.unpackAlignment=t.unpackAlignment??4}upload(e,t,i){const s=e.gl;s.pixelStorei(s.UNPACK_ALIGNMENT,this.unpackAlignment),s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t.alphaMode===Ri.UNPACK);const r=t.realWidth,o=t.realHeight;return i.width===r&&i.height===o?s.texSubImage2D(t.target,0,0,0,r,o,t.format,i.type,this.data):(i.width=r,i.height=o,s.texImage2D(t.target,0,i.internalFormat,r,o,0,t.format,i.type,this.data)),!0}dispose(){this.data=null}static test(e){return e===null||e instanceof Int8Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Int16Array||e instanceof Uint16Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Float32Array}}const jI={scaleMode:Wn.NEAREST,alphaMode:Ri.NPM},Ym=class ma extends pc{constructor(e=null,t=null){super(),t=Object.assign({},ma.defaultOptions,t);const{alphaMode:i,mipmap:s,anisotropicLevel:r,scaleMode:o,width:a,height:c,wrapMode:l,format:h,type:u,target:d,resolution:f,resourceOptions:m}=t;e&&!(e instanceof Zl)&&(e=dw(e,m),e.internal=!0),this.resolution=f||Ve.RESOLUTION,this.width=Math.round((a||0)*this.resolution)/this.resolution,this.height=Math.round((c||0)*this.resolution)/this.resolution,this._mipmap=s,this.anisotropicLevel=r,this._wrapMode=l,this._scaleMode=o,this.format=h,this.type=u,this.target=d,this.alphaMode=i,this.uid=Bo(),this.touched=0,this.isPowerOfTwo=!1,this._refreshPOT(),this._glTextures={},this.dirtyId=0,this.dirtyStyleId=0,this.cacheId=null,this.valid=a>0&&c>0,this.textureCacheIds=[],this.destroyed=!1,this.resource=null,this._batchEnabled=0,this._batchLocation=0,this.parentTextureArray=null,this.setResource(e)}get realWidth(){return Math.round(this.width*this.resolution)}get realHeight(){return Math.round(this.height*this.resolution)}get mipmap(){return this._mipmap}set mipmap(e){this._mipmap!==e&&(this._mipmap=e,this.dirtyStyleId++)}get scaleMode(){return this._scaleMode}set scaleMode(e){this._scaleMode!==e&&(this._scaleMode=e,this.dirtyStyleId++)}get wrapMode(){return this._wrapMode}set wrapMode(e){this._wrapMode!==e&&(this._wrapMode=e,this.dirtyStyleId++)}setStyle(e,t){let i;return e!==void 0&&e!==this.scaleMode&&(this.scaleMode=e,i=!0),t!==void 0&&t!==this.mipmap&&(this.mipmap=t,i=!0),i&&this.dirtyStyleId++,this}setSize(e,t,i){return i=i||this.resolution,this.setRealSize(e*i,t*i,i)}setRealSize(e,t,i){return this.resolution=i||this.resolution,this.width=Math.round(e)/this.resolution,this.height=Math.round(t)/this.resolution,this._refreshPOT(),this.update(),this}_refreshPOT(){this.isPowerOfTwo=uy(this.realWidth)&&uy(this.realHeight)}setResolution(e){const t=this.resolution;return t===e?this:(this.resolution=e,this.valid&&(this.width=Math.round(this.width*t)/e,this.height=Math.round(this.height*t)/e,this.emit("update",this)),this._refreshPOT(),this)}setResource(e){if(this.resource===e)return this;if(this.resource)throw new Error("Resource can be set only once");return e.bind(this),this.resource=e,this}update(){this.valid?(this.dirtyId++,this.dirtyStyleId++,this.emit("update",this)):this.width>0&&this.height>0&&(this.valid=!0,this.emit("loaded",this),this.emit("update",this))}onError(e){this.emit("error",this,e)}destroy(){this.resource&&(this.resource.unbind(this),this.resource.internal&&this.resource.destroy(),this.resource=null),this.cacheId&&(delete Sr[this.cacheId],delete as[this.cacheId],this.cacheId=null),this.valid=!1,this.dispose(),ma.removeFromCache(this),this.textureCacheIds=null,this.destroyed=!0,this.emit("destroyed",this),this.removeAllListeners()}dispose(){this.emit("dispose",this)}castToBaseTexture(){return this}static from(e,t,i=Ve.STRICT_TEXTURE_CACHE){const s=typeof e=="string";let r=null;if(s)r=e;else{if(!e._pixiId){const a=(t==null?void 0:t.pixiIdPrefix)||"pixiid";e._pixiId=`${a}_${Bo()}`}r=e._pixiId}let o=Sr[r];if(s&&i&&!o)throw new Error(`The cacheId "${r}" does not exist in BaseTextureCache.`);return o||(o=new ma(e,t),o.cacheId=r,ma.addToCache(o,r)),o}static fromBuffer(e,t,i,s){e=e||new Float32Array(t*i*4);const r=new td(e,{width:t,height:i,...s==null?void 0:s.resourceOptions});let o,a;return e instanceof Float32Array?(o=Ie.RGBA,a=He.FLOAT):e instanceof Int32Array?(o=Ie.RGBA_INTEGER,a=He.INT):e instanceof Uint32Array?(o=Ie.RGBA_INTEGER,a=He.UNSIGNED_INT):e instanceof Int16Array?(o=Ie.RGBA_INTEGER,a=He.SHORT):e instanceof Uint16Array?(o=Ie.RGBA_INTEGER,a=He.UNSIGNED_SHORT):e instanceof Int8Array?(o=Ie.RGBA,a=He.BYTE):(o=Ie.RGBA,a=He.UNSIGNED_BYTE),r.internal=!0,new ma(r,Object.assign({},jI,{type:a,format:o},s))}static addToCache(e,t){t&&(e.textureCacheIds.includes(t)||e.textureCacheIds.push(t),Sr[t]&&Sr[t]!==e&&console.warn(`BaseTexture added to the cache with an id [${t}] that already had an entry`),Sr[t]=e)}static removeFromCache(e){if(typeof e=="string"){const t=Sr[e];if(t){const i=t.textureCacheIds.indexOf(e);return i>-1&&t.textureCacheIds.splice(i,1),delete Sr[e],t}}else if(e!=null&&e.textureCacheIds){for(let t=0;t1){for(let u=0;u(n[n.POLY=0]="POLY",n[n.RECT=1]="RECT",n[n.CIRC=2]="CIRC",n[n.ELIP=3]="ELIP",n[n.RREC=4]="RREC",n))(Ni||{});class Tt{constructor(e=0,t=0){this.x=0,this.y=0,this.x=e,this.y=t}clone(){return new Tt(this.x,this.y)}copyFrom(e){return this.set(e.x,e.y),this}copyTo(e){return e.set(this.x,this.y),e}equals(e){return e.x===this.x&&e.y===this.y}set(e=0,t=e){return this.x=e,this.y=t,this}}Tt.prototype.toString=function(){return`[@pixi/math:Point x=${this.x} y=${this.y}]`};const $c=[new Tt,new Tt,new Tt,new Tt];class dt{constructor(e=0,t=0,i=0,s=0){this.x=Number(e),this.y=Number(t),this.width=Number(i),this.height=Number(s),this.type=Ni.RECT}get left(){return this.x}get right(){return this.x+this.width}get top(){return this.y}get bottom(){return this.y+this.height}static get EMPTY(){return new dt(0,0,0,0)}clone(){return new dt(this.x,this.y,this.width,this.height)}copyFrom(e){return this.x=e.x,this.y=e.y,this.width=e.width,this.height=e.height,this}copyTo(e){return e.x=this.x,e.y=this.y,e.width=this.width,e.height=this.height,e}contains(e,t){return this.width<=0||this.height<=0?!1:e>=this.x&&e=this.y&&te.right?e.right:this.right)<=C)return!1;const M=this.ye.bottom?e.bottom:this.bottom)>M}const i=this.left,s=this.right,r=this.top,o=this.bottom;if(s<=i||o<=r)return!1;const a=$c[0].set(e.left,e.top),c=$c[1].set(e.left,e.bottom),l=$c[2].set(e.right,e.top),h=$c[3].set(e.right,e.bottom);if(l.x<=a.x||c.y<=a.y)return!1;const u=Math.sign(t.a*t.d-t.b*t.c);if(u===0||(t.apply(a,a),t.apply(c,c),t.apply(l,l),t.apply(h,h),Math.max(a.x,c.x,l.x,h.x)<=i||Math.min(a.x,c.x,l.x,h.x)>=s||Math.max(a.y,c.y,l.y,h.y)<=r||Math.min(a.y,c.y,l.y,h.y)>=o))return!1;const d=u*(c.y-a.y),f=u*(a.x-c.x),m=d*i+f*r,p=d*s+f*r,g=d*i+f*o,v=d*s+f*o;if(Math.max(m,p,g,v)<=d*a.x+f*a.y||Math.min(m,p,g,v)>=d*h.x+f*h.y)return!1;const b=u*(a.y-l.y),y=u*(l.x-a.x),x=b*i+y*r,_=b*s+y*r,E=b*i+y*o,S=b*s+y*o;return!(Math.max(x,_,E,S)<=b*a.x+y*a.y||Math.min(x,_,E,S)>=b*h.x+y*h.y)}pad(e=0,t=e){return this.x-=e,this.y-=t,this.width+=e*2,this.height+=t*2,this}fit(e){const t=Math.max(this.x,e.x),i=Math.min(this.x+this.width,e.x+e.width),s=Math.max(this.y,e.y),r=Math.min(this.y+this.height,e.y+e.height);return this.x=t,this.width=Math.max(i-t,0),this.y=s,this.height=Math.max(r-s,0),this}ceil(e=1,t=.001){const i=Math.ceil((this.x+this.width-t)*e)/e,s=Math.ceil((this.y+this.height-t)*e)/e;return this.x=Math.floor((this.x+t)*e)/e,this.y=Math.floor((this.y+t)*e)/e,this.width=i-this.x,this.height=s-this.y,this}enlarge(e){const t=Math.min(this.x,e.x),i=Math.max(this.x+this.width,e.x+e.width),s=Math.min(this.y,e.y),r=Math.max(this.y+this.height,e.y+e.height);return this.x=t,this.width=i-t,this.y=s,this.height=r-s,this}}dt.prototype.toString=function(){return`[@pixi/math:Rectangle x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`};class id{constructor(e=0,t=0,i=0){this.x=e,this.y=t,this.radius=i,this.type=Ni.CIRC}clone(){return new id(this.x,this.y,this.radius)}contains(e,t){if(this.radius<=0)return!1;const i=this.radius*this.radius;let s=this.x-e,r=this.y-t;return s*=s,r*=r,s+r<=i}getBounds(){return new dt(this.x-this.radius,this.y-this.radius,this.radius*2,this.radius*2)}}id.prototype.toString=function(){return`[@pixi/math:Circle x=${this.x} y=${this.y} radius=${this.radius}]`};class nd{constructor(e=0,t=0,i=0,s=0){this.x=e,this.y=t,this.width=i,this.height=s,this.type=Ni.ELIP}clone(){return new nd(this.x,this.y,this.width,this.height)}contains(e,t){if(this.width<=0||this.height<=0)return!1;let i=(e-this.x)/this.width,s=(t-this.y)/this.height;return i*=i,s*=s,i+s<=1}getBounds(){return new dt(this.x-this.width,this.y-this.height,this.width,this.height)}}nd.prototype.toString=function(){return`[@pixi/math:Ellipse x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`};class Lo{constructor(...e){let t=Array.isArray(e[0])?e[0]:e;if(typeof t[0]!="number"){const i=[];for(let s=0,r=t.length;st!=h>t&&e<(l-a)*((t-c)/(h-c))+a&&(i=!i)}return i}}Lo.prototype.toString=function(){return`[@pixi/math:PolygoncloseStroke=${this.closeStroke}points=${this.points.reduce((n,e)=>`${n}, ${e}`,"")}]`};class sd{constructor(e=0,t=0,i=0,s=0,r=20){this.x=e,this.y=t,this.width=i,this.height=s,this.radius=r,this.type=Ni.RREC}clone(){return new sd(this.x,this.y,this.width,this.height,this.radius)}contains(e,t){if(this.width<=0||this.height<=0)return!1;if(e>=this.x&&e<=this.x+this.width&&t>=this.y&&t<=this.y+this.height){const i=Math.max(0,Math.min(this.radius,Math.min(this.width,this.height)/2));if(t>=this.y+i&&t<=this.y+this.height-i||e>=this.x+i&&e<=this.x+this.width-i)return!0;let s=e-(this.x+i),r=t-(this.y+i);const o=i*i;if(s*s+r*r<=o||(s=e-(this.x+this.width-i),s*s+r*r<=o)||(r=t-(this.y+this.height-i),s*s+r*r<=o)||(s=e-(this.x+i),s*s+r*r<=o))return!0}return!1}}sd.prototype.toString=function(){return`[@pixi/math:RoundedRectangle x=${this.x} y=${this.y}width=${this.width} height=${this.height} radius=${this.radius}]`};class Bt{constructor(e=1,t=0,i=0,s=1,r=0,o=0){this.array=null,this.a=e,this.b=t,this.c=i,this.d=s,this.tx=r,this.ty=o}fromArray(e){this.a=e[0],this.b=e[1],this.c=e[3],this.d=e[4],this.tx=e[2],this.ty=e[5]}set(e,t,i,s,r,o){return this.a=e,this.b=t,this.c=i,this.d=s,this.tx=r,this.ty=o,this}toArray(e,t){this.array||(this.array=new Float32Array(9));const i=t||this.array;return e?(i[0]=this.a,i[1]=this.b,i[2]=0,i[3]=this.c,i[4]=this.d,i[5]=0,i[6]=this.tx,i[7]=this.ty,i[8]=1):(i[0]=this.a,i[1]=this.c,i[2]=this.tx,i[3]=this.b,i[4]=this.d,i[5]=this.ty,i[6]=0,i[7]=0,i[8]=1),i}apply(e,t){t=t||new Tt;const i=e.x,s=e.y;return t.x=this.a*i+this.c*s+this.tx,t.y=this.b*i+this.d*s+this.ty,t}applyInverse(e,t){t=t||new Tt;const i=1/(this.a*this.d+this.c*-this.b),s=e.x,r=e.y;return t.x=this.d*i*s+-this.c*i*r+(this.ty*this.c-this.tx*this.d)*i,t.y=this.a*i*r+-this.b*i*s+(-this.ty*this.a+this.tx*this.b)*i,t}translate(e,t){return this.tx+=e,this.ty+=t,this}scale(e,t){return this.a*=e,this.d*=t,this.c*=e,this.b*=t,this.tx*=e,this.ty*=t,this}rotate(e){const t=Math.cos(e),i=Math.sin(e),s=this.a,r=this.c,o=this.tx;return this.a=s*t-this.b*i,this.b=s*i+this.b*t,this.c=r*t-this.d*i,this.d=r*i+this.d*t,this.tx=o*t-this.ty*i,this.ty=o*i+this.ty*t,this}append(e){const t=this.a,i=this.b,s=this.c,r=this.d;return this.a=e.a*t+e.b*s,this.b=e.a*i+e.b*r,this.c=e.c*t+e.d*s,this.d=e.c*i+e.d*r,this.tx=e.tx*t+e.ty*s+this.tx,this.ty=e.tx*i+e.ty*r+this.ty,this}setTransform(e,t,i,s,r,o,a,c,l){return this.a=Math.cos(a+l)*r,this.b=Math.sin(a+l)*r,this.c=-Math.sin(a-c)*o,this.d=Math.cos(a-c)*o,this.tx=e-(i*this.a+s*this.c),this.ty=t-(i*this.b+s*this.d),this}prepend(e){const t=this.tx;if(e.a!==1||e.b!==0||e.c!==0||e.d!==1){const i=this.a,s=this.c;this.a=i*e.a+this.b*e.c,this.b=i*e.b+this.b*e.d,this.c=s*e.a+this.d*e.c,this.d=s*e.b+this.d*e.d}return this.tx=t*e.a+this.ty*e.c+e.tx,this.ty=t*e.b+this.ty*e.d+e.ty,this}decompose(e){const t=this.a,i=this.b,s=this.c,r=this.d,o=e.pivot,a=-Math.atan2(-s,r),c=Math.atan2(i,t),l=Math.abs(a+c);return l<1e-5||Math.abs(zh-l)<1e-5?(e.rotation=c,e.skew.x=e.skew.y=0):(e.rotation=0,e.skew.x=a,e.skew.y=c),e.scale.x=Math.sqrt(t*t+i*i),e.scale.y=Math.sqrt(s*s+r*r),e.position.x=this.tx+(o.x*t+o.y*s),e.position.y=this.ty+(o.x*i+o.y*r),e}invert(){const e=this.a,t=this.b,i=this.c,s=this.d,r=this.tx,o=e*s-t*i;return this.a=s/o,this.b=-t/o,this.c=-i/o,this.d=e/o,this.tx=(i*this.ty-s*r)/o,this.ty=-(e*this.ty-t*r)/o,this}identity(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this}clone(){const e=new Bt;return e.a=this.a,e.b=this.b,e.c=this.c,e.d=this.d,e.tx=this.tx,e.ty=this.ty,e}copyTo(e){return e.a=this.a,e.b=this.b,e.c=this.c,e.d=this.d,e.tx=this.tx,e.ty=this.ty,e}copyFrom(e){return this.a=e.a,this.b=e.b,this.c=e.c,this.d=e.d,this.tx=e.tx,this.ty=e.ty,this}static get IDENTITY(){return new Bt}static get TEMP_MATRIX(){return new Bt}}Bt.prototype.toString=function(){return`[@pixi/math:Matrix a=${this.a} b=${this.b} c=${this.c} d=${this.d} tx=${this.tx} ty=${this.ty}]`};const go=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],vo=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],yo=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],bo=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],Hm=[],mw=[],Nc=Math.sign;function e2(){for(let n=0;n<16;n++){const e=[];Hm.push(e);for(let t=0;t<16;t++){const i=Nc(go[n]*go[t]+yo[n]*vo[t]),s=Nc(vo[n]*go[t]+bo[n]*vo[t]),r=Nc(go[n]*yo[t]+yo[n]*bo[t]),o=Nc(vo[n]*yo[t]+bo[n]*bo[t]);for(let a=0;a<16;a++)if(go[a]===i&&vo[a]===s&&yo[a]===r&&bo[a]===o){e.push(a);break}}}for(let n=0;n<16;n++){const e=new Bt;e.set(go[n],vo[n],yo[n],bo[n],0,0),mw.push(e)}}e2();const si={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MAIN_DIAGONAL:10,MIRROR_HORIZONTAL:12,REVERSE_DIAGONAL:14,uX:n=>go[n],uY:n=>vo[n],vX:n=>yo[n],vY:n=>bo[n],inv:n=>n&8?n&15:-n&7,add:(n,e)=>Hm[n][e],sub:(n,e)=>Hm[n][si.inv(e)],rotate180:n=>n^4,isVertical:n=>(n&3)===2,byDirection:(n,e)=>Math.abs(n)*2<=Math.abs(e)?e>=0?si.S:si.N:Math.abs(e)*2<=Math.abs(n)?n>0?si.E:si.W:e>0?n>0?si.SE:si.SW:n>0?si.NE:si.NW,matrixAppendRotationInv:(n,e,t=0,i=0)=>{const s=mw[si.inv(e)];s.tx=t,s.ty=i,n.append(s)}};class Js{constructor(e,t,i=0,s=0){this._x=i,this._y=s,this.cb=e,this.scope=t}clone(e=this.cb,t=this.scope){return new Js(e,t,this._x,this._y)}set(e=0,t=e){return(this._x!==e||this._y!==t)&&(this._x=e,this._y=t,this.cb.call(this.scope)),this}copyFrom(e){return(this._x!==e.x||this._y!==e.y)&&(this._x=e.x,this._y=e.y,this.cb.call(this.scope)),this}copyTo(e){return e.set(this._x,this._y),e}equals(e){return e.x===this._x&&e.y===this._y}get x(){return this._x}set x(e){this._x!==e&&(this._x=e,this.cb.call(this.scope))}get y(){return this._y}set y(e){this._y!==e&&(this._y=e,this.cb.call(this.scope))}}Js.prototype.toString=function(){return`[@pixi/math:ObservablePoint x=${this.x} y=${this.y} scope=${this.scope}]`};const jm=class{constructor(){this.worldTransform=new Bt,this.localTransform=new Bt,this.position=new Js(this.onChange,this,0,0),this.scale=new Js(this.onChange,this,1,1),this.pivot=new Js(this.onChange,this,0,0),this.skew=new Js(this.updateSkew,this,0,0),this._rotation=0,this._cx=1,this._sx=0,this._cy=0,this._sy=1,this._localID=0,this._currentLocalID=0,this._worldID=0,this._parentID=0}onChange(){this._localID++}updateSkew(){this._cx=Math.cos(this._rotation+this.skew.y),this._sx=Math.sin(this._rotation+this.skew.y),this._cy=-Math.sin(this._rotation-this.skew.x),this._sy=Math.cos(this._rotation-this.skew.x),this._localID++}updateLocalTransform(){const n=this.localTransform;this._localID!==this._currentLocalID&&(n.a=this._cx*this.scale.x,n.b=this._sx*this.scale.x,n.c=this._cy*this.scale.y,n.d=this._sy*this.scale.y,n.tx=this.position.x-(this.pivot.x*n.a+this.pivot.y*n.c),n.ty=this.position.y-(this.pivot.x*n.b+this.pivot.y*n.d),this._currentLocalID=this._localID,this._parentID=-1)}updateTransform(n){const e=this.localTransform;if(this._localID!==this._currentLocalID&&(e.a=this._cx*this.scale.x,e.b=this._sx*this.scale.x,e.c=this._cy*this.scale.y,e.d=this._sy*this.scale.y,e.tx=this.position.x-(this.pivot.x*e.a+this.pivot.y*e.c),e.ty=this.position.y-(this.pivot.x*e.b+this.pivot.y*e.d),this._currentLocalID=this._localID,this._parentID=-1),this._parentID!==n._worldID){const t=n.worldTransform,i=this.worldTransform;i.a=e.a*t.a+e.b*t.c,i.b=e.a*t.b+e.b*t.d,i.c=e.c*t.a+e.d*t.c,i.d=e.c*t.b+e.d*t.d,i.tx=e.tx*t.a+e.ty*t.c+t.tx,i.ty=e.tx*t.b+e.ty*t.d+t.ty,this._parentID=n._worldID,this._worldID++}}setFromMatrix(n){n.decompose(this),this._localID++}get rotation(){return this._rotation}set rotation(n){this._rotation!==n&&(this._rotation=n,this.updateSkew())}};jm.IDENTITY=new jm;let Eg=jm;Eg.prototype.toString=function(){return`[@pixi/math:Transform position=(${this.position.x}, ${this.position.y}) rotation=${this.rotation} scale=(${this.scale.x}, ${this.scale.y}) skew=(${this.skew.x}, ${this.skew.y}) ]`};var t2=`varying vec2 vTextureCoord; + +uniform sampler2D uSampler; + +void main(void){ + gl_FragColor *= texture2D(uSampler, vTextureCoord); +}`,i2=`attribute vec2 aVertexPosition; +attribute vec2 aTextureCoord; + +uniform mat3 projectionMatrix; + +varying vec2 vTextureCoord; + +void main(void){ + gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); + vTextureCoord = aTextureCoord; +} +`;function by(n,e,t){const i=n.createShader(e);return n.shaderSource(i,t),n.compileShader(i),i}function Vf(n){const e=new Array(n);for(let t=0;tn.type==="float"&&n.size===1&&!n.isArray,code:n=>` + if(uv["${n}"] !== ud["${n}"].value) + { + ud["${n}"].value = uv["${n}"] + gl.uniform1f(ud["${n}"].location, uv["${n}"]) + } + `},{test:(n,e)=>(n.type==="sampler2D"||n.type==="samplerCube"||n.type==="sampler2DArray")&&n.size===1&&!n.isArray&&(e==null||e.castToBaseTexture!==void 0),code:n=>`t = syncData.textureCount++; + + renderer.texture.bind(uv["${n}"], t); + + if(ud["${n}"].value !== t) + { + ud["${n}"].value = t; + gl.uniform1i(ud["${n}"].location, t); +; // eslint-disable-line max-len + }`},{test:(n,e)=>n.type==="mat3"&&n.size===1&&!n.isArray&&e.a!==void 0,code:n=>` + gl.uniformMatrix3fv(ud["${n}"].location, false, uv["${n}"].toArray(true)); + `,codeUbo:n=>` + var ${n}_matrix = uv.${n}.toArray(true); + + data[offset] = ${n}_matrix[0]; + data[offset+1] = ${n}_matrix[1]; + data[offset+2] = ${n}_matrix[2]; + + data[offset + 4] = ${n}_matrix[3]; + data[offset + 5] = ${n}_matrix[4]; + data[offset + 6] = ${n}_matrix[5]; + + data[offset + 8] = ${n}_matrix[6]; + data[offset + 9] = ${n}_matrix[7]; + data[offset + 10] = ${n}_matrix[8]; + `},{test:(n,e)=>n.type==="vec2"&&n.size===1&&!n.isArray&&e.x!==void 0,code:n=>` + cv = ud["${n}"].value; + v = uv["${n}"]; + + if(cv[0] !== v.x || cv[1] !== v.y) + { + cv[0] = v.x; + cv[1] = v.y; + gl.uniform2f(ud["${n}"].location, v.x, v.y); + }`,codeUbo:n=>` + v = uv.${n}; + + data[offset] = v.x; + data[offset+1] = v.y; + `},{test:n=>n.type==="vec2"&&n.size===1&&!n.isArray,code:n=>` + cv = ud["${n}"].value; + v = uv["${n}"]; + + if(cv[0] !== v[0] || cv[1] !== v[1]) + { + cv[0] = v[0]; + cv[1] = v[1]; + gl.uniform2f(ud["${n}"].location, v[0], v[1]); + } + `},{test:(n,e)=>n.type==="vec4"&&n.size===1&&!n.isArray&&e.width!==void 0,code:n=>` + cv = ud["${n}"].value; + v = uv["${n}"]; + + if(cv[0] !== v.x || cv[1] !== v.y || cv[2] !== v.width || cv[3] !== v.height) + { + cv[0] = v.x; + cv[1] = v.y; + cv[2] = v.width; + cv[3] = v.height; + gl.uniform4f(ud["${n}"].location, v.x, v.y, v.width, v.height) + }`,codeUbo:n=>` + v = uv.${n}; + + data[offset] = v.x; + data[offset+1] = v.y; + data[offset+2] = v.width; + data[offset+3] = v.height; + `},{test:(n,e)=>n.type==="vec4"&&n.size===1&&!n.isArray&&e.red!==void 0,code:n=>` + cv = ud["${n}"].value; + v = uv["${n}"]; + + if(cv[0] !== v.red || cv[1] !== v.green || cv[2] !== v.blue || cv[3] !== v.alpha) + { + cv[0] = v.red; + cv[1] = v.green; + cv[2] = v.blue; + cv[3] = v.alpha; + gl.uniform4f(ud["${n}"].location, v.red, v.green, v.blue, v.alpha) + }`,codeUbo:n=>` + v = uv.${n}; + + data[offset] = v.red; + data[offset+1] = v.green; + data[offset+2] = v.blue; + data[offset+3] = v.alpha; + `},{test:(n,e)=>n.type==="vec3"&&n.size===1&&!n.isArray&&e.red!==void 0,code:n=>` + cv = ud["${n}"].value; + v = uv["${n}"]; + + if(cv[0] !== v.red || cv[1] !== v.green || cv[2] !== v.blue || cv[3] !== v.a) + { + cv[0] = v.red; + cv[1] = v.green; + cv[2] = v.blue; + + gl.uniform3f(ud["${n}"].location, v.red, v.green, v.blue) + }`,codeUbo:n=>` + v = uv.${n}; + + data[offset] = v.red; + data[offset+1] = v.green; + data[offset+2] = v.blue; + `},{test:n=>n.type==="vec4"&&n.size===1&&!n.isArray,code:n=>` + cv = ud["${n}"].value; + v = uv["${n}"]; + + if(cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3]) + { + cv[0] = v[0]; + cv[1] = v[1]; + cv[2] = v[2]; + cv[3] = v[3]; + + gl.uniform4f(ud["${n}"].location, v[0], v[1], v[2], v[3]) + }`}],n2={float:` + if (cv !== v) + { + cu.value = v; + gl.uniform1f(location, v); + }`,vec2:` + if (cv[0] !== v[0] || cv[1] !== v[1]) + { + cv[0] = v[0]; + cv[1] = v[1]; + + gl.uniform2f(location, v[0], v[1]) + }`,vec3:` + if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2]) + { + cv[0] = v[0]; + cv[1] = v[1]; + cv[2] = v[2]; + + gl.uniform3f(location, v[0], v[1], v[2]) + }`,vec4:` + if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3]) + { + cv[0] = v[0]; + cv[1] = v[1]; + cv[2] = v[2]; + cv[3] = v[3]; + + gl.uniform4f(location, v[0], v[1], v[2], v[3]); + }`,int:` + if (cv !== v) + { + cu.value = v; + + gl.uniform1i(location, v); + }`,ivec2:` + if (cv[0] !== v[0] || cv[1] !== v[1]) + { + cv[0] = v[0]; + cv[1] = v[1]; + + gl.uniform2i(location, v[0], v[1]); + }`,ivec3:` + if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2]) + { + cv[0] = v[0]; + cv[1] = v[1]; + cv[2] = v[2]; + + gl.uniform3i(location, v[0], v[1], v[2]); + }`,ivec4:` + if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3]) + { + cv[0] = v[0]; + cv[1] = v[1]; + cv[2] = v[2]; + cv[3] = v[3]; + + gl.uniform4i(location, v[0], v[1], v[2], v[3]); + }`,uint:` + if (cv !== v) + { + cu.value = v; + + gl.uniform1ui(location, v); + }`,uvec2:` + if (cv[0] !== v[0] || cv[1] !== v[1]) + { + cv[0] = v[0]; + cv[1] = v[1]; + + gl.uniform2ui(location, v[0], v[1]); + }`,uvec3:` + if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2]) + { + cv[0] = v[0]; + cv[1] = v[1]; + cv[2] = v[2]; + + gl.uniform3ui(location, v[0], v[1], v[2]); + }`,uvec4:` + if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3]) + { + cv[0] = v[0]; + cv[1] = v[1]; + cv[2] = v[2]; + cv[3] = v[3]; + + gl.uniform4ui(location, v[0], v[1], v[2], v[3]); + }`,bool:` + if (cv !== v) + { + cu.value = v; + gl.uniform1i(location, v); + }`,bvec2:` + if (cv[0] != v[0] || cv[1] != v[1]) + { + cv[0] = v[0]; + cv[1] = v[1]; + + gl.uniform2i(location, v[0], v[1]); + }`,bvec3:` + if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2]) + { + cv[0] = v[0]; + cv[1] = v[1]; + cv[2] = v[2]; + + gl.uniform3i(location, v[0], v[1], v[2]); + }`,bvec4:` + if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3]) + { + cv[0] = v[0]; + cv[1] = v[1]; + cv[2] = v[2]; + cv[3] = v[3]; + + gl.uniform4i(location, v[0], v[1], v[2], v[3]); + }`,mat2:"gl.uniformMatrix2fv(location, false, v)",mat3:"gl.uniformMatrix3fv(location, false, v)",mat4:"gl.uniformMatrix4fv(location, false, v)",sampler2D:` + if (cv !== v) + { + cu.value = v; + + gl.uniform1i(location, v); + }`,samplerCube:` + if (cv !== v) + { + cu.value = v; + + gl.uniform1i(location, v); + }`,sampler2DArray:` + if (cv !== v) + { + cu.value = v; + + gl.uniform1i(location, v); + }`},s2={float:"gl.uniform1fv(location, v)",vec2:"gl.uniform2fv(location, v)",vec3:"gl.uniform3fv(location, v)",vec4:"gl.uniform4fv(location, v)",mat4:"gl.uniformMatrix4fv(location, false, v)",mat3:"gl.uniformMatrix3fv(location, false, v)",mat2:"gl.uniformMatrix2fv(location, false, v)",int:"gl.uniform1iv(location, v)",ivec2:"gl.uniform2iv(location, v)",ivec3:"gl.uniform3iv(location, v)",ivec4:"gl.uniform4iv(location, v)",uint:"gl.uniform1uiv(location, v)",uvec2:"gl.uniform2uiv(location, v)",uvec3:"gl.uniform3uiv(location, v)",uvec4:"gl.uniform4uiv(location, v)",bool:"gl.uniform1iv(location, v)",bvec2:"gl.uniform2iv(location, v)",bvec3:"gl.uniform3iv(location, v)",bvec4:"gl.uniform4iv(location, v)",sampler2D:"gl.uniform1iv(location, v)",samplerCube:"gl.uniform1iv(location, v)",sampler2DArray:"gl.uniform1iv(location, v)"};function r2(n,e){var i;const t=[` + var v = null; + var cv = null; + var cu = null; + var t = 0; + var gl = renderer.gl; + `];for(const s in n.uniforms){const r=e[s];if(!r){((i=n.uniforms[s])==null?void 0:i.group)===!0&&(n.uniforms[s].ubo?t.push(` + renderer.shader.syncUniformBufferGroup(uv.${s}, '${s}'); + `):t.push(` + renderer.shader.syncUniformGroup(uv.${s}, syncData); + `));continue}const o=n.uniforms[s];let a=!1;for(let c=0;c=Ho.WEBGL2&&(e=n.getContext("webgl2",{})),e||(e=n.getContext("webgl",{})||n.getContext("experimental-webgl",{}),e?e.getExtension("WEBGL_draw_buffers"):e=null),sa=e}return sa}let Dc;function a2(){if(!Dc){Dc=kn.MEDIUM;const n=o2();if(n&&n.getShaderPrecisionFormat){const e=n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.HIGH_FLOAT);e&&(Dc=e.precision?kn.HIGH:kn.MEDIUM)}}return Dc}function xy(n,e){const t=n.getShaderSource(e).split(` +`).map((l,h)=>`${h}: ${l}`),i=n.getShaderInfoLog(e),s=i.split(` +`),r={},o=s.map(l=>parseFloat(l.replace(/^ERROR\: 0\:([\d]+)\:.*$/,"$1"))).filter(l=>l&&!r[l]?(r[l]=!0,!0):!1),a=[""];o.forEach(l=>{t[l-1]=`%c${t[l-1]}%c`,a.push("background: #FF0000; color:#FFFFFF; font-size: 10px","font-size: 10px")});const c=t.join(` +`);a[0]=c,console.error(i),console.groupCollapsed("click to view full shader code"),console.warn(...a),console.groupEnd()}function l2(n,e,t,i){n.getProgramParameter(e,n.LINK_STATUS)||(n.getShaderParameter(t,n.COMPILE_STATUS)||xy(n,t),n.getShaderParameter(i,n.COMPILE_STATUS)||xy(n,i),console.error("PixiJS Error: Could not initialize shader."),n.getProgramInfoLog(e)!==""&&console.warn("PixiJS Warning: gl.getProgramInfoLog()",n.getProgramInfoLog(e)))}const c2={float:1,vec2:2,vec3:3,vec4:4,int:1,ivec2:2,ivec3:3,ivec4:4,uint:1,uvec2:2,uvec3:3,uvec4:4,bool:1,bvec2:2,bvec3:3,bvec4:4,mat2:4,mat3:9,mat4:16,sampler2D:1};function vw(n){return c2[n]}let Bc=null;const wy={FLOAT:"float",FLOAT_VEC2:"vec2",FLOAT_VEC3:"vec3",FLOAT_VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",UNSIGNED_INT:"uint",UNSIGNED_INT_VEC2:"uvec2",UNSIGNED_INT_VEC3:"uvec3",UNSIGNED_INT_VEC4:"uvec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",FLOAT_MAT2:"mat2",FLOAT_MAT3:"mat3",FLOAT_MAT4:"mat4",SAMPLER_2D:"sampler2D",INT_SAMPLER_2D:"sampler2D",UNSIGNED_INT_SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube",INT_SAMPLER_CUBE:"samplerCube",UNSIGNED_INT_SAMPLER_CUBE:"samplerCube",SAMPLER_2D_ARRAY:"sampler2DArray",INT_SAMPLER_2D_ARRAY:"sampler2DArray",UNSIGNED_INT_SAMPLER_2D_ARRAY:"sampler2DArray"};function yw(n,e){if(!Bc){const t=Object.keys(wy);Bc={};for(let i=0;i0&&(t+=` +else `),ithis.size&&this.flush(),this._vertexCount+=e.vertexData.length/2,this._indexCount+=e.indices.length,this._bufferedTextures[this._bufferSize]=e._texture.baseTexture,this._bufferedElements[this._bufferSize++]=e)}buildTexturesAndDrawCalls(){const{_bufferedTextures:e,maxTextures:t}=this,i=Xn._textureArrayPool,s=this.renderer.batch,r=this._tempBoundTextures,o=this.renderer.textureGC.count;let a=++rt._globalBatch,c=0,l=i[0],h=0;s.copyBoundTextures(r,t);for(let u=0;u=t&&(s.boundArray(l,r,a,t),this.buildDrawCalls(l,h,u),h=u,l=i[++c],++a),d._batchEnabled=a,d.touched=o,l.elements[l.count++]=d)}l.count>0&&(s.boundArray(l,r,a,t),this.buildDrawCalls(l,h,this._bufferSize),++c,++a);for(let u=0;u0);for(let p=0;p=0;--s)e[s]=i[s]||null,e[s]&&(e[s]._batchLocation=s)}boundArray(e,t,i,s){const{elements:r,ids:o,count:a}=e;let c=0;for(let l=0;l=0&&u=Ho.WEBGL2&&(i=e.getContext("webgl2",t)),i)this.webGLVersion=2;else if(this.webGLVersion=1,i=e.getContext("webgl",t)||e.getContext("experimental-webgl",t),!i)throw new Error("This browser does not support WebGL. Try using the canvas renderer");return this.gl=i,this.getExtensions(),this.gl}getExtensions(){const{gl:e}=this,t={loseContext:e.getExtension("WEBGL_lose_context"),anisotropicFiltering:e.getExtension("EXT_texture_filter_anisotropic"),floatTextureLinear:e.getExtension("OES_texture_float_linear"),s3tc:e.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:e.getExtension("WEBGL_compressed_texture_s3tc_srgb"),etc:e.getExtension("WEBGL_compressed_texture_etc"),etc1:e.getExtension("WEBGL_compressed_texture_etc1"),pvrtc:e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),atc:e.getExtension("WEBGL_compressed_texture_atc"),astc:e.getExtension("WEBGL_compressed_texture_astc"),bptc:e.getExtension("EXT_texture_compression_bptc")};this.webGLVersion===1?Object.assign(this.extensions,t,{drawBuffers:e.getExtension("WEBGL_draw_buffers"),depthTexture:e.getExtension("WEBGL_depth_texture"),vertexArrayObject:e.getExtension("OES_vertex_array_object")||e.getExtension("MOZ_OES_vertex_array_object")||e.getExtension("WEBKIT_OES_vertex_array_object"),uint32ElementIndex:e.getExtension("OES_element_index_uint"),floatTexture:e.getExtension("OES_texture_float"),floatTextureLinear:e.getExtension("OES_texture_float_linear"),textureHalfFloat:e.getExtension("OES_texture_half_float"),textureHalfFloatLinear:e.getExtension("OES_texture_half_float_linear")}):this.webGLVersion===2&&Object.assign(this.extensions,t,{colorBufferFloat:e.getExtension("EXT_color_buffer_float")})}handleContextLost(e){e.preventDefault(),setTimeout(()=>{this.gl.isContextLost()&&this.extensions.loseContext&&this.extensions.loseContext.restoreContext()},0)}handleContextRestored(){this.renderer.runners.contextChange.emit(this.gl)}destroy(){const e=this.renderer.view;this.renderer=null,e.removeEventListener!==void 0&&(e.removeEventListener("webglcontextlost",this.handleContextLost),e.removeEventListener("webglcontextrestored",this.handleContextRestored)),this.gl.useProgram(null),this.extensions.loseContext&&this.extensions.loseContext.loseContext()}postrender(){this.renderer.objectRenderer.renderingToScreen&&this.gl.flush()}validateContext(e){const t=e.getContextAttributes(),i="WebGL2RenderingContext"in globalThis&&e instanceof globalThis.WebGL2RenderingContext;i&&(this.webGLVersion=2),t&&!t.stencil&&console.warn("Provided WebGL context does not have a stencil buffer, masks may not render correctly");const s=i||!!e.getExtension("OES_element_index_uint");this.supports.uint32Indices=s,s||console.warn("Provided WebGL context does not support 32 index buffer, complex graphics may not render correctly")}}Kh.defaultOptions={context:null,antialias:!1,premultipliedAlpha:!0,preserveDrawingBuffer:!1,powerPreference:"default"},Kh.extension={type:$e.RendererSystem,name:"context"};je.add(Kh);class Km{constructor(e,t){if(this.width=Math.round(e),this.height=Math.round(t),!this.width||!this.height)throw new Error("Framebuffer width or height is zero");this.stencil=!1,this.depth=!1,this.dirtyId=0,this.dirtyFormat=0,this.dirtySize=0,this.depthTexture=null,this.colorTextures=[],this.glFramebuffers={},this.disposeRunner=new Zn("disposeFramebuffer"),this.multisample=bi.NONE}get colorTexture(){return this.colorTextures[0]}addColorTexture(e=0,t){return this.colorTextures[e]=t||new rt(null,{scaleMode:Wn.NEAREST,resolution:1,mipmap:$n.OFF,width:this.width,height:this.height}),this.dirtyId++,this.dirtyFormat++,this}addDepthTexture(e){return this.depthTexture=e||new rt(null,{scaleMode:Wn.NEAREST,resolution:1,width:this.width,height:this.height,mipmap:$n.OFF,format:Ie.DEPTH_COMPONENT,type:He.UNSIGNED_SHORT}),this.dirtyId++,this.dirtyFormat++,this}enableDepth(){return this.depth=!0,this.dirtyId++,this.dirtyFormat++,this}enableStencil(){return this.stencil=!0,this.dirtyId++,this.dirtyFormat++,this}resize(e,t){if(e=Math.round(e),t=Math.round(t),!e||!t)throw new Error("Framebuffer width and height must not be zero");if(!(e===this.width&&t===this.height)){this.width=e,this.height=t,this.dirtyId++,this.dirtySize++;for(let i=0;i{const s=this.source;this.url=s.src;const r=()=>{this.destroyed||(s.onload=null,s.onerror=null,this.update(),this._load=null,this.createBitmap?t(this.process()):t(this))};s.complete&&s.src?r():(s.onload=r,s.onerror=o=>{i(o),this.onError.emit(o)})}),this._load)}process(){const e=this.source;if(this._process!==null)return this._process;if(this.bitmap!==null||!globalThis.createImageBitmap)return Promise.resolve(this);const t=globalThis.createImageBitmap,i=!e.crossOrigin||e.crossOrigin==="anonymous";return this._process=fetch(e.src,{mode:i?"cors":"no-cors"}).then(s=>s.blob()).then(s=>t(s,0,0,e.width,e.height,{premultiplyAlpha:this.alphaMode===null||this.alphaMode===Ri.UNPACK?"premultiply":"none"})).then(s=>this.destroyed?Promise.reject():(this.bitmap=s,this.update(),this._process=null,Promise.resolve(this))),this._process}upload(e,t,i){if(typeof this.alphaMode=="number"&&(t.alphaMode=this.alphaMode),!this.createBitmap)return super.upload(e,t,i);if(!this.bitmap&&(this.process(),!this.bitmap))return!1;if(super.upload(e,t,i,this.bitmap),!this.preserveBitmap){let s=!0;const r=t._glTextures;for(const o in r){const a=r[o];if(a!==i&&a.dirtyId!==t.dirtyId){s=!1;break}}s&&(this.bitmap.close&&this.bitmap.close(),this.bitmap=null)}return!0}dispose(){this.source.onload=null,this.source.onerror=null,super.dispose(),this.bitmap&&(this.bitmap.close(),this.bitmap=null),this._process=null,this._load=null}static test(e){return typeof HTMLImageElement<"u"&&(typeof e=="string"||e instanceof HTMLImageElement)}}class Cg{constructor(){this.x0=0,this.y0=0,this.x1=1,this.y1=0,this.x2=1,this.y2=1,this.x3=0,this.y3=1,this.uvsFloat32=new Float32Array(8)}set(e,t,i){const s=t.width,r=t.height;if(i){const o=e.width/2/s,a=e.height/2/r,c=e.x/s+o,l=e.y/r+a;i=si.add(i,si.NW),this.x0=c+o*si.uX(i),this.y0=l+a*si.uY(i),i=si.add(i,2),this.x1=c+o*si.uX(i),this.y1=l+a*si.uY(i),i=si.add(i,2),this.x2=c+o*si.uX(i),this.y2=l+a*si.uY(i),i=si.add(i,2),this.x3=c+o*si.uX(i),this.y3=l+a*si.uY(i)}else this.x0=e.x/s,this.y0=e.y/r,this.x1=(e.x+e.width)/s,this.y1=e.y/r,this.x2=(e.x+e.width)/s,this.y2=(e.y+e.height)/r,this.x3=e.x/s,this.y3=(e.y+e.height)/r;this.uvsFloat32[0]=this.x0,this.uvsFloat32[1]=this.y0,this.uvsFloat32[2]=this.x1,this.uvsFloat32[3]=this.y1,this.uvsFloat32[4]=this.x2,this.uvsFloat32[5]=this.y2,this.uvsFloat32[6]=this.x3,this.uvsFloat32[7]=this.y3}}Cg.prototype.toString=function(){return`[@pixi/core:TextureUvs x0=${this.x0} y0=${this.y0} x1=${this.x1} y1=${this.y1} x2=${this.x2} y2=${this.y2} x3=${this.x3} y3=${this.y3}]`};const Ty=new Cg;function Vc(n){n.destroy=function(){},n.on=function(){},n.once=function(){},n.emit=function(){}}let it=class jt extends pc{constructor(e,t,i,s,r,o,a){if(super(),this.noFrame=!1,t||(this.noFrame=!0,t=new dt(0,0,1,1)),e instanceof jt&&(e=e.baseTexture),this.baseTexture=e,this._frame=t,this.trim=s,this.valid=!1,this.destroyed=!1,this._uvs=Ty,this.uvMatrix=null,this.orig=i||t,this._rotate=Number(r||0),r===!0)this._rotate=2;else if(this._rotate%2!==0)throw new Error("attempt to use diamond-shaped UVs. If you are sure, set rotation manually");this.defaultAnchor=o?new Tt(o.x,o.y):new Tt(0,0),this.defaultBorders=a,this._updateID=0,this.textureCacheIds=[],e.valid?this.noFrame?e.valid&&this.onBaseTextureUpdated(e):this.frame=t:e.once("loaded",this.onBaseTextureUpdated,this),this.noFrame&&e.on("update",this.onBaseTextureUpdated,this)}update(){this.baseTexture.resource&&this.baseTexture.resource.update()}onBaseTextureUpdated(e){if(this.noFrame){if(!this.baseTexture.valid)return;this._frame.width=e.width,this._frame.height=e.height,this.valid=!0,this.updateUvs()}else this.frame=this._frame;this.emit("update",this)}destroy(e){if(this.baseTexture){if(e){const{resource:t}=this.baseTexture;t!=null&&t.url&&as[t.url]&&jt.removeFromCache(t.url),this.baseTexture.destroy()}this.baseTexture.off("loaded",this.onBaseTextureUpdated,this),this.baseTexture.off("update",this.onBaseTextureUpdated,this),this.baseTexture=null}this._frame=null,this._uvs=null,this.trim=null,this.orig=null,this.valid=!1,jt.removeFromCache(this),this.textureCacheIds=null,this.destroyed=!0,this.emit("destroyed",this),this.removeAllListeners()}clone(){var s;const e=this._frame.clone(),t=this._frame===this.orig?e:this.orig.clone(),i=new jt(this.baseTexture,!this.noFrame&&e,t,(s=this.trim)==null?void 0:s.clone(),this.rotate,this.defaultAnchor,this.defaultBorders);return this.noFrame&&(i._frame=e),i}updateUvs(){this._uvs===Ty&&(this._uvs=new Cg),this._uvs.set(this._frame,this.baseTexture,this.rotate),this._updateID++}static from(e,t={},i=Ve.STRICT_TEXTURE_CACHE){const s=typeof e=="string";let r=null;if(s)r=e;else if(e instanceof rt){if(!e.cacheId){const a=(t==null?void 0:t.pixiIdPrefix)||"pixiid";e.cacheId=`${a}-${Bo()}`,rt.addToCache(e,e.cacheId)}r=e.cacheId}else{if(!e._pixiId){const a=(t==null?void 0:t.pixiIdPrefix)||"pixiid";e._pixiId=`${a}_${Bo()}`}r=e._pixiId}let o=as[r];if(s&&i&&!o)throw new Error(`The cacheId "${r}" does not exist in TextureCache.`);return!o&&!(e instanceof rt)?(t.resolution||(t.resolution=fr(e)),o=new jt(new rt(e,t)),o.baseTexture.cacheId=r,rt.addToCache(o.baseTexture,r),jt.addToCache(o,r)):!o&&e instanceof rt&&(o=new jt(e),jt.addToCache(o,r)),o}static fromURL(e,t){const i=Object.assign({autoLoad:!1},t==null?void 0:t.resourceOptions),s=jt.from(e,Object.assign({resourceOptions:i},t),!1),r=s.baseTexture.resource;return s.baseTexture.valid?Promise.resolve(s):r.load().then(()=>Promise.resolve(s))}static fromBuffer(e,t,i,s){return new jt(rt.fromBuffer(e,t,i,s))}static fromLoader(e,t,i,s){const r=new rt(e,Object.assign({scaleMode:rt.defaultOptions.scaleMode,resolution:fr(t)},s)),{resource:o}=r;o instanceof Sw&&(o.url=t);const a=new jt(r);return i||(i=t),rt.addToCache(a.baseTexture,i),jt.addToCache(a,i),i!==t&&(rt.addToCache(a.baseTexture,t),jt.addToCache(a,t)),a.baseTexture.valid?Promise.resolve(a):new Promise(c=>{a.baseTexture.once("loaded",()=>c(a))})}static addToCache(e,t){t&&(e.textureCacheIds.includes(t)||e.textureCacheIds.push(t),as[t]&&as[t]!==e&&console.warn(`Texture added to the cache with an id [${t}] that already had an entry`),as[t]=e)}static removeFromCache(e){if(typeof e=="string"){const t=as[e];if(t){const i=t.textureCacheIds.indexOf(e);return i>-1&&t.textureCacheIds.splice(i,1),delete as[e],t}}else if(e!=null&&e.textureCacheIds){for(let t=0;tthis.baseTexture.width,a=i+r>this.baseTexture.height;if(o||a){const c=o&&a?"and":"or",l=`X: ${t} + ${s} = ${t+s} > ${this.baseTexture.width}`,h=`Y: ${i} + ${r} = ${i+r} > ${this.baseTexture.height}`;throw new Error(`Texture Error: frame does not fit inside the base Texture dimensions: ${l} ${c} ${h}`)}this.valid=s&&r&&this.baseTexture.valid,!this.trim&&!this.rotate&&(this.orig=e),this.valid&&this.updateUvs()}get rotate(){return this._rotate}set rotate(e){this._rotate=e,this.valid&&this.updateUvs()}get width(){return this.orig.width}get height(){return this.orig.height}castToBaseTexture(){return this.baseTexture}static get EMPTY(){return jt._EMPTY||(jt._EMPTY=new jt(new rt),Vc(jt._EMPTY),Vc(jt._EMPTY.baseTexture)),jt._EMPTY}static get WHITE(){if(!jt._WHITE){const e=Ve.ADAPTER.createCanvas(16,16),t=e.getContext("2d");e.width=16,e.height=16,t.fillStyle="white",t.fillRect(0,0,16,16),jt._WHITE=new jt(rt.from(e)),Vc(jt._WHITE),Vc(jt._WHITE.baseTexture)}return jt._WHITE}};class jo extends it{constructor(e,t){super(e,t),this.valid=!0,this.filterFrame=null,this.filterPoolKey=null,this.updateUvs()}get framebuffer(){return this.baseTexture.framebuffer}get multisample(){return this.framebuffer.multisample}set multisample(e){this.framebuffer.multisample=e}resize(e,t,i=!0){const s=this.baseTexture.resolution,r=Math.round(e*s)/s,o=Math.round(t*s)/s;this.valid=r>0&&o>0,this._frame.width=this.orig.width=r,this._frame.height=this.orig.height=o,i&&this.baseTexture.resize(r,o),this.updateUvs()}setResolution(e){const{baseTexture:t}=this;t.resolution!==e&&(t.setResolution(e),this.resize(t.width,t.height,!1))}static create(e){return new jo(new ww(e))}}class _w{constructor(e){this.texturePool={},this.textureOptions=e||{},this.enableFullScreen=!1,this._pixelsWidth=0,this._pixelsHeight=0}createTexture(e,t,i=bi.NONE){const s=new ww(Object.assign({width:e,height:t,resolution:1,multisample:i},this.textureOptions));return new jo(s)}getOptimalTexture(e,t,i=1,s=bi.NONE){let r;e=Math.max(Math.ceil(e*i-1e-6),1),t=Math.max(Math.ceil(t*i-1e-6),1),!this.enableFullScreen||e!==this._pixelsWidth||t!==this._pixelsHeight?(e=jh(e),t=jh(t),r=((e&65535)<<16|t&65535)>>>0,s>1&&(r+=s*4294967296)):r=s>1?-s:-1,this.texturePool[r]||(this.texturePool[r]=[]);let o=this.texturePool[r].pop();return o||(o=this.createTexture(e,t,s)),o.filterPoolKey=r,o.setResolution(i),o}getFilterTexture(e,t,i){const s=this.getOptimalTexture(e.width,e.height,t||e.resolution,i||bi.NONE);return s.filterFrame=e.filterFrame,s}returnTexture(e){const t=e.filterPoolKey;e.filterFrame=null,this.texturePool[t].push(e)}returnFilterTexture(e){this.returnTexture(e)}clear(e){if(e=e!==!1,e)for(const t in this.texturePool){const i=this.texturePool[t];if(i)for(let s=0;s0&&e.height>0;for(const t in this.texturePool){if(!(Number(t)<0))continue;const i=this.texturePool[t];if(i)for(let s=0;s1&&(h=this.getOptimalFilterTexture(l.width,l.height,t.resolution),h.filterFrame=l.filterFrame),i[u].apply(this,l,h,ys.CLEAR,t);const d=l;l=h,h=d}i[u].apply(this,l,c.renderTexture,ys.BLEND,t),u>1&&t.multisample>1&&this.returnFilterTexture(t.renderTexture),this.returnFilterTexture(l),this.returnFilterTexture(h)}t.clear(),this.statePool.push(t)}bindAndClear(e,t=ys.CLEAR){const{renderTexture:i,state:s}=this.renderer;if(e===this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?this.renderer.projection.transform=this.activeState.transform:this.renderer.projection.transform=null,e==null?void 0:e.filterFrame){const o=this.tempRect;o.x=0,o.y=0,o.width=e.filterFrame.width,o.height=e.filterFrame.height,i.bind(e,e.filterFrame,o)}else e!==this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?i.bind(e):this.renderer.renderTexture.bind(e,this.activeState.bindingSourceFrame,this.activeState.bindingDestinationFrame);const r=s.stateId&1||this.forceClear;(t===ys.CLEAR||t===ys.BLIT&&r)&&this.renderer.framebuffer.clear(0,0,0,0)}applyFilter(e,t,i,s){const r=this.renderer;r.state.set(e.state),this.bindAndClear(i,s),e.uniforms.uSampler=t,e.uniforms.filterGlobals=this.globalUniforms,r.shader.bind(e),e.legacy=!!e.program.attributeData.aTextureCoord,e.legacy?(this.quadUv.map(t._frame,t.filterFrame),r.geometry.bind(this.quadUv),r.geometry.draw(_s.TRIANGLES)):(r.geometry.bind(this.quad),r.geometry.draw(_s.TRIANGLE_STRIP))}calculateSpriteMatrix(e,t){const{sourceFrame:i,destinationFrame:s}=this.activeState,{orig:r}=t._texture,o=e.set(s.width,0,0,s.height,i.x,i.y),a=t.worldTransform.copyTo(Bt.TEMP_MATRIX);return a.invert(),o.prepend(a),o.scale(1/r.width,1/r.height),o.translate(t.anchor.x,t.anchor.y),o}destroy(){this.renderer=null,this.texturePool.clear(!1)}getOptimalFilterTexture(e,t,i=1,s=bi.NONE){return this.texturePool.getOptimalTexture(e,t,i,s)}getFilterTexture(e,t,i){if(typeof e=="number"){const r=e;e=t,t=r}e=e||this.activeState.renderTexture;const s=this.texturePool.getOptimalTexture(e.width,e.height,t||e.resolution,i||bi.NONE);return s.filterFrame=e.filterFrame,s}returnFilterTexture(e){this.texturePool.returnTexture(e)}emptyPool(){this.texturePool.clear(!0)}resize(){this.texturePool.setScreenSize(this.renderer.view)}transformAABB(e,t){const i=Xc[0],s=Xc[1],r=Xc[2],o=Xc[3];i.set(t.left,t.top),s.set(t.left,t.bottom),r.set(t.right,t.top),o.set(t.right,t.bottom),e.apply(i,i),e.apply(s,s),e.apply(r,r),e.apply(o,o);const a=Math.min(i.x,s.x,r.x,o.x),c=Math.min(i.y,s.y,r.y,o.y),l=Math.max(i.x,s.x,r.x,o.x),h=Math.max(i.y,s.y,r.y,o.y);t.x=a,t.y=c,t.width=l-a,t.height=h-c}roundFrame(e,t,i,s,r){if(!(e.width<=0||e.height<=0||i.width<=0||i.height<=0)){if(r){const{a:o,b:a,c,d:l}=r;if((Math.abs(a)>1e-4||Math.abs(c)>1e-4)&&(Math.abs(o)>1e-4||Math.abs(l)>1e-4))return}r=r?Xf.copyFrom(r):Xf.identity(),r.translate(-i.x,-i.y).scale(s.width/i.width,s.height/i.height).translate(s.x,s.y),this.transformAABB(r,e),e.ceil(t),this.transformAABB(r.invert(),e)}}}Ew.extension={type:$e.RendererSystem,name:"filter"};je.add(Ew);class w2{constructor(e){this.framebuffer=e,this.stencil=null,this.dirtyId=-1,this.dirtyFormat=-1,this.dirtySize=-1,this.multisample=bi.NONE,this.msaaBuffer=null,this.blitFramebuffer=null,this.mipLevel=0}}const S2=new dt;class Cw{constructor(e){this.renderer=e,this.managedFramebuffers=[],this.unknownFramebuffer=new Km(10,10),this.msaaSamples=null}contextChange(){this.disposeAll(!0);const e=this.gl=this.renderer.gl;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.current=this.unknownFramebuffer,this.viewport=new dt,this.hasMRT=!0,this.writeDepthTexture=!0,this.renderer.context.webGLVersion===1){let t=this.renderer.context.extensions.drawBuffers,i=this.renderer.context.extensions.depthTexture;Ve.PREFER_ENV===Ho.WEBGL_LEGACY&&(t=null,i=null),t?e.drawBuffers=s=>t.drawBuffersWEBGL(s):(this.hasMRT=!1,e.drawBuffers=()=>{}),i||(this.writeDepthTexture=!1)}else this.msaaSamples=e.getInternalformatParameter(e.RENDERBUFFER,e.RGBA8,e.SAMPLES)}bind(e,t,i=0){const{gl:s}=this;if(e){const r=e.glFramebuffers[this.CONTEXT_UID]||this.initFramebuffer(e);this.current!==e&&(this.current=e,s.bindFramebuffer(s.FRAMEBUFFER,r.framebuffer)),r.mipLevel!==i&&(e.dirtyId++,e.dirtyFormat++,r.mipLevel=i),r.dirtyId!==e.dirtyId&&(r.dirtyId=e.dirtyId,r.dirtyFormat!==e.dirtyFormat?(r.dirtyFormat=e.dirtyFormat,r.dirtySize=e.dirtySize,this.updateFramebuffer(e,i)):r.dirtySize!==e.dirtySize&&(r.dirtySize=e.dirtySize,this.resizeFramebuffer(e)));for(let o=0;o>i,a=t.height>>i,c=o/t.width;this.setViewport(t.x*c,t.y*c,o,a)}else{const o=e.width>>i,a=e.height>>i;this.setViewport(0,0,o,a)}}else this.current&&(this.current=null,s.bindFramebuffer(s.FRAMEBUFFER,null)),t?this.setViewport(t.x,t.y,t.width,t.height):this.setViewport(0,0,this.renderer.width,this.renderer.height)}setViewport(e,t,i,s){const r=this.viewport;e=Math.round(e),t=Math.round(t),i=Math.round(i),s=Math.round(s),(r.width!==i||r.height!==s||r.x!==e||r.y!==t)&&(r.x=e,r.y=t,r.width=i,r.height=s,this.gl.viewport(e,t,i,s))}get size(){return this.current?{x:0,y:0,width:this.current.width,height:this.current.height}:{x:0,y:0,width:this.renderer.width,height:this.renderer.height}}clear(e,t,i,s,r=$m.COLOR|$m.DEPTH){const{gl:o}=this;o.clearColor(e,t,i,s),o.clear(r)}initFramebuffer(e){const{gl:t}=this,i=new w2(t.createFramebuffer());return i.multisample=this.detectSamples(e.multisample),e.glFramebuffers[this.CONTEXT_UID]=i,this.managedFramebuffers.push(e),e.disposeRunner.add(this),i}resizeFramebuffer(e){const{gl:t}=this,i=e.glFramebuffers[this.CONTEXT_UID];if(i.stencil){t.bindRenderbuffer(t.RENDERBUFFER,i.stencil);let o;this.renderer.context.webGLVersion===1?o=t.DEPTH_STENCIL:e.depth&&e.stencil?o=t.DEPTH24_STENCIL8:e.depth?o=t.DEPTH_COMPONENT24:o=t.STENCIL_INDEX8,i.msaaBuffer?t.renderbufferStorageMultisample(t.RENDERBUFFER,i.multisample,o,e.width,e.height):t.renderbufferStorage(t.RENDERBUFFER,o,e.width,e.height)}const s=e.colorTextures;let r=s.length;t.drawBuffers||(r=Math.min(r,1));for(let o=0;o1&&this.canMultisampleFramebuffer(e)?s.msaaBuffer=s.msaaBuffer||i.createRenderbuffer():s.msaaBuffer&&(i.deleteRenderbuffer(s.msaaBuffer),s.msaaBuffer=null,s.blitFramebuffer&&(s.blitFramebuffer.dispose(),s.blitFramebuffer=null));const a=[];for(let c=0;c1&&i.drawBuffers(a),e.depthTexture&&this.writeDepthTexture){const c=e.depthTexture;this.renderer.texture.bind(c,0),i.framebufferTexture2D(i.FRAMEBUFFER,i.DEPTH_ATTACHMENT,i.TEXTURE_2D,c._glTextures[this.CONTEXT_UID].texture,t)}if((e.stencil||e.depth)&&!(e.depthTexture&&this.writeDepthTexture)){s.stencil=s.stencil||i.createRenderbuffer();let c,l;this.renderer.context.webGLVersion===1?(c=i.DEPTH_STENCIL_ATTACHMENT,l=i.DEPTH_STENCIL):e.depth&&e.stencil?(c=i.DEPTH_STENCIL_ATTACHMENT,l=i.DEPTH24_STENCIL8):e.depth?(c=i.DEPTH_ATTACHMENT,l=i.DEPTH_COMPONENT24):(c=i.STENCIL_ATTACHMENT,l=i.STENCIL_INDEX8),i.bindRenderbuffer(i.RENDERBUFFER,s.stencil),s.msaaBuffer?i.renderbufferStorageMultisample(i.RENDERBUFFER,s.multisample,l,e.width,e.height):i.renderbufferStorage(i.RENDERBUFFER,l,e.width,e.height),i.framebufferRenderbuffer(i.FRAMEBUFFER,c,i.RENDERBUFFER,s.stencil)}else s.stencil&&(i.deleteRenderbuffer(s.stencil),s.stencil=null)}canMultisampleFramebuffer(e){return this.renderer.context.webGLVersion!==1&&e.colorTextures.length<=1&&!e.depthTexture}detectSamples(e){const{msaaSamples:t}=this;let i=bi.NONE;if(e<=1||t===null)return i;for(let s=0;s=0&&this.managedFramebuffers.splice(r,1),e.disposeRunner.remove(this),t||(s.deleteFramebuffer(i.framebuffer),i.msaaBuffer&&s.deleteRenderbuffer(i.msaaBuffer),i.stencil&&s.deleteRenderbuffer(i.stencil)),i.blitFramebuffer&&this.disposeFramebuffer(i.blitFramebuffer,t)}disposeAll(e){const t=this.managedFramebuffers;this.managedFramebuffers=[];for(let i=0;ii.createVertexArrayOES(),e.bindVertexArray=s=>i.bindVertexArrayOES(s),e.deleteVertexArray=s=>i.deleteVertexArrayOES(s)):(this.hasVao=!1,e.createVertexArray=()=>null,e.bindVertexArray=()=>null,e.deleteVertexArray=()=>null)}if(t.webGLVersion!==2){const i=e.getExtension("ANGLE_instanced_arrays");i?(e.vertexAttribDivisor=(s,r)=>i.vertexAttribDivisorANGLE(s,r),e.drawElementsInstanced=(s,r,o,a,c)=>i.drawElementsInstancedANGLE(s,r,o,a,c),e.drawArraysInstanced=(s,r,o,a)=>i.drawArraysInstancedANGLE(s,r,o,a)):this.hasInstance=!1}this.canUseUInt32ElementIndex=t.webGLVersion===2||!!t.extensions.uint32ElementIndex}bind(e,t){t=t||this.renderer.shader.shader;const{gl:i}=this;let s=e.glVertexArrayObjects[this.CONTEXT_UID],r=!1;s||(this.managedGeometries[e.id]=e,e.disposeRunner.add(this),e.glVertexArrayObjects[this.CONTEXT_UID]=s={},r=!0);const o=s[t.program.id]||this.initGeometryVao(e,t,r);this._activeGeometry=e,this._activeVao!==o&&(this._activeVao=o,this.hasVao?i.bindVertexArray(o):this.activateVao(e,t.program)),this.updateBuffers()}reset(){this.unbind()}updateBuffers(){const e=this._activeGeometry,t=this.renderer.buffer;for(let i=0;i"u"?.5:t,this.isSimple=!1}get texture(){return this._texture}set texture(e){this._texture=e,this._textureID=-1}multiplyUvs(e,t){t===void 0&&(t=e);const i=this.mapCoord;for(let s=0;s0?this.maskStack[this.maskStack.length-1]._colorMask:15;i!==t&&this.renderer.gl.colorMask((i&1)!==0,(i&2)!==0,(i&4)!==0,(i&8)!==0)}destroy(){this.renderer=null}}Aw.extension={type:$e.RendererSystem,name:"mask"};je.add(Aw);class Iw{constructor(e){this.renderer=e,this.maskStack=[],this.glConst=0}getStackLength(){return this.maskStack.length}setMaskStack(e){const{gl:t}=this.renderer,i=this.getStackLength();this.maskStack=e;const s=this.getStackLength();s!==i&&(s===0?t.disable(this.glConst):(t.enable(this.glConst),this._useCurrent()))}_useCurrent(){}destroy(){this.renderer=null,this.maskStack=null}}const Cy=new Bt,My=[],Pw=class xh extends Iw{constructor(e){super(e),this.glConst=Ve.ADAPTER.getWebGLRenderingContext().SCISSOR_TEST}getStackLength(){const e=this.maskStack[this.maskStack.length-1];return e?e._scissorCounter:0}calcScissorRect(e){if(e._scissorRectLocal)return;const t=e._scissorRect,{maskObject:i}=e,{renderer:s}=this,r=s.renderTexture,o=i.getBounds(!0,My.pop()??new dt);this.roundFrameToPixels(o,r.current?r.current.resolution:s.resolution,r.sourceFrame,r.destinationFrame,s.projection.transform),t&&o.fit(t),e._scissorRectLocal=o}static isMatrixRotated(e){if(!e)return!1;const{a:t,b:i,c:s,d:r}=e;return(Math.abs(i)>1e-4||Math.abs(s)>1e-4)&&(Math.abs(t)>1e-4||Math.abs(r)>1e-4)}testScissor(e){const{maskObject:t}=e;if(!t.isFastRect||!t.isFastRect()||xh.isMatrixRotated(t.worldTransform)||xh.isMatrixRotated(this.renderer.projection.transform))return!1;this.calcScissorRect(e);const i=e._scissorRectLocal;return i.width>0&&i.height>0}roundFrameToPixels(e,t,i,s,r){xh.isMatrixRotated(r)||(r=r?Cy.copyFrom(r):Cy.identity(),r.translate(-i.x,-i.y).scale(s.width/i.width,s.height/i.height).translate(s.x,s.y),this.renderer.filter.transformAABB(r,e),e.fit(s),e.x=Math.round(e.x*t),e.y=Math.round(e.y*t),e.width=Math.round(e.width*t),e.height=Math.round(e.height*t))}push(e){e._scissorRectLocal||this.calcScissorRect(e);const{gl:t}=this.renderer;e._scissorRect||t.enable(t.SCISSOR_TEST),e._scissorCounter++,e._scissorRect=e._scissorRectLocal,this._useCurrent()}pop(e){const{gl:t}=this.renderer;e&&My.push(e._scissorRectLocal),this.getStackLength()>0?this._useCurrent():t.disable(t.SCISSOR_TEST)}_useCurrent(){const e=this.maskStack[this.maskStack.length-1]._scissorRect;let t;this.renderer.renderTexture.current?t=e.y:t=this.renderer.height-e.height-e.y,this.renderer.gl.scissor(e.x,t,e.width,e.height)}};Pw.extension={type:$e.RendererSystem,name:"scissor"};let M2=Pw;je.add(M2);class Rw extends Iw{constructor(e){super(e),this.glConst=Ve.ADAPTER.getWebGLRenderingContext().STENCIL_TEST}getStackLength(){const e=this.maskStack[this.maskStack.length-1];return e?e._stencilCounter:0}push(e){const t=e.maskObject,{gl:i}=this.renderer,s=e._stencilCounter;s===0&&(this.renderer.framebuffer.forceStencil(),i.clearStencil(0),i.clear(i.STENCIL_BUFFER_BIT),i.enable(i.STENCIL_TEST)),e._stencilCounter++;const r=e._colorMask;r!==0&&(e._colorMask=0,i.colorMask(!1,!1,!1,!1)),i.stencilFunc(i.EQUAL,s,4294967295),i.stencilOp(i.KEEP,i.KEEP,i.INCR),t.renderable=!0,t.render(this.renderer),this.renderer.batch.flush(),t.renderable=!1,r!==0&&(e._colorMask=r,i.colorMask((r&1)!==0,(r&2)!==0,(r&4)!==0,(r&8)!==0)),this._useCurrent()}pop(e){const t=this.renderer.gl;if(this.getStackLength()===0)t.disable(t.STENCIL_TEST);else{const i=this.maskStack.length!==0?this.maskStack[this.maskStack.length-1]:null,s=i?i._colorMask:15;s!==0&&(i._colorMask=0,t.colorMask(!1,!1,!1,!1)),t.stencilOp(t.KEEP,t.KEEP,t.DECR),e.renderable=!0,e.render(this.renderer),this.renderer.batch.flush(),e.renderable=!1,s!==0&&(i._colorMask=s,t.colorMask((s&1)!==0,(s&2)!==0,(s&4)!==0,(s&8)!==0)),this._useCurrent()}}_useCurrent(){const e=this.renderer.gl;e.stencilFunc(e.EQUAL,this.getStackLength(),4294967295),e.stencilOp(e.KEEP,e.KEEP,e.KEEP)}}Rw.extension={type:$e.RendererSystem,name:"stencil"};je.add(Rw);class kw{constructor(e){this.renderer=e,this.plugins={},Object.defineProperties(this.plugins,{extract:{enumerable:!1,get(){return pt("7.0.0","renderer.plugins.extract has moved to renderer.extract"),e.extract}},prepare:{enumerable:!1,get(){return pt("7.0.0","renderer.plugins.prepare has moved to renderer.prepare"),e.prepare}},interaction:{enumerable:!1,get(){return pt("7.0.0","renderer.plugins.interaction has been deprecated, use renderer.events"),e.events}}})}init(){const e=this.rendererPlugins;for(const t in e)this.plugins[t]=new e[t](this.renderer)}destroy(){for(const e in this.plugins)this.plugins[e].destroy(),this.plugins[e]=null}}kw.extension={type:[$e.RendererSystem,$e.CanvasRendererSystem],name:"_plugin"};je.add(kw);class Fw{constructor(e){this.renderer=e,this.destinationFrame=null,this.sourceFrame=null,this.defaultFrame=null,this.projectionMatrix=new Bt,this.transform=null}update(e,t,i,s){this.destinationFrame=e||this.destinationFrame||this.defaultFrame,this.sourceFrame=t||this.sourceFrame||e,this.calculateProjection(this.destinationFrame,this.sourceFrame,i,s),this.transform&&this.projectionMatrix.append(this.transform);const r=this.renderer;r.globalUniforms.uniforms.projectionMatrix=this.projectionMatrix,r.globalUniforms.update(),r.shader.shader&&r.shader.syncUniformGroup(r.shader.shader.uniforms.globals)}calculateProjection(e,t,i,s){const r=this.projectionMatrix,o=s?-1:1;r.identity(),r.a=1/t.width*2,r.d=o*(1/t.height*2),r.tx=-1-t.x*r.a,r.ty=-o-t.y*r.d}setTransform(e){}destroy(){this.renderer=null}}Fw.extension={type:$e.RendererSystem,name:"projection"};je.add(Fw);const A2=new Eg,Ay=new dt;class Lw{constructor(e){this.renderer=e,this._tempMatrix=new Bt}generateTexture(e,t){const{region:i,...s}=t||{},r=(i==null?void 0:i.copyTo(Ay))||e.getLocalBounds(Ay,!0),o=s.resolution||this.renderer.resolution;r.width=Math.max(r.width,1/o),r.height=Math.max(r.height,1/o),s.width=r.width,s.height=r.height,s.resolution=o,s.multisample??(s.multisample=this.renderer.multisample);const a=jo.create(s);this._tempMatrix.tx=-r.x,this._tempMatrix.ty=-r.y;const c=e.transform;return e.transform=A2,this.renderer.render(e,{renderTexture:a,transform:this._tempMatrix,skipUpdateTransform:!!e.parent,blit:!0}),e.transform=c,a}destroy(){}}Lw.extension={type:[$e.RendererSystem,$e.CanvasRendererSystem],name:"textureGenerator"};je.add(Lw);const fo=new dt,dl=new dt;class Ow{constructor(e){this.renderer=e,this.defaultMaskStack=[],this.current=null,this.sourceFrame=new dt,this.destinationFrame=new dt,this.viewportFrame=new dt}contextChange(){var t;const e=(t=this.renderer)==null?void 0:t.gl.getContextAttributes();this._rendererPremultipliedAlpha=!!(e&&e.alpha&&e.premultipliedAlpha)}bind(e=null,t,i){const s=this.renderer;this.current=e;let r,o,a;e?(r=e.baseTexture,a=r.resolution,t||(fo.width=e.frame.width,fo.height=e.frame.height,t=fo),i||(dl.x=e.frame.x,dl.y=e.frame.y,dl.width=t.width,dl.height=t.height,i=dl),o=r.framebuffer):(a=s.resolution,t||(fo.width=s._view.screen.width,fo.height=s._view.screen.height,t=fo),i||(i=fo,i.width=t.width,i.height=t.height));const c=this.viewportFrame;c.x=i.x*a,c.y=i.y*a,c.width=i.width*a,c.height=i.height*a,e||(c.y=s.view.height-(c.y+c.height)),c.ceil(),this.renderer.framebuffer.bind(o,c),this.renderer.projection.update(i,t,a,!o),e?this.renderer.mask.setMaskStack(r.maskStack):this.renderer.mask.setMaskStack(this.defaultMaskStack),this.sourceFrame.copyFrom(t),this.destinationFrame.copyFrom(i)}clear(e,t){const i=this.current?this.current.baseTexture.clear:this.renderer.background.backgroundColor,s=kt.shared.setValue(e||i);(this.current&&this.current.baseTexture.alphaMode>0||!this.current&&this._rendererPremultipliedAlpha)&&s.premultiply(s.alpha);const r=this.destinationFrame,o=this.current?this.current.baseTexture:this.renderer._view.screen,a=r.width!==o.width||r.height!==o.height;if(a){let{x:c,y:l,width:h,height:u}=this.viewportFrame;c=Math.round(c),l=Math.round(l),h=Math.round(h),u=Math.round(u),this.renderer.gl.enable(this.renderer.gl.SCISSOR_TEST),this.renderer.gl.scissor(c,l,h,u)}this.renderer.framebuffer.clear(s.red,s.green,s.blue,s.alpha,t),a&&this.renderer.scissor.pop()}resize(){this.bind(null)}reset(){this.bind(null)}destroy(){this.renderer=null}}Ow.extension={type:$e.RendererSystem,name:"renderTexture"};je.add(Ow);class I2{constructor(e,t){this.program=e,this.uniformData=t,this.uniformGroups={},this.uniformDirtyGroups={},this.uniformBufferBindings={}}destroy(){this.uniformData=null,this.uniformGroups=null,this.uniformDirtyGroups=null,this.uniformBufferBindings=null,this.program=null}}function P2(n,e){const t={},i=e.getProgramParameter(n,e.ACTIVE_ATTRIBUTES);for(let s=0;sl>h?1:-1);for(let l=0;l({data:r,offset:0,dataLen:0,dirty:0}));let t=0,i=0,s=0;for(let r=0;r1&&(t=Math.max(t,16)*o.data.size),o.dataLen=t,i%t!==0&&i<16){const a=i%t%16;i+=a,s+=a}i+t>16?(s=Math.ceil(s/16)*16,o.offset=s,s+=t,i=t):(o.offset=s,i+=t,s+=t)}return s=Math.ceil(s/16)*16,{uboElements:e,size:s}}function $2(n,e){const t=[];for(const i in n)e[i]&&t.push(e[i]);return t.sort((i,s)=>i.index-s.index),t}function N2(n,e){if(!n.autoManage)return{size:0,syncFunc:F2};const t=$2(n.uniforms,e),{uboElements:i,size:s}=O2(t),r=[` + var v = null; + var v2 = null; + var cv = null; + var t = 0; + var gl = renderer.gl + var index = 0; + var data = buffer.data; + `];for(let o=0;o1){const u=vw(a.data.type),d=Math.max($w[a.data.type]/16,1),f=u/d,m=(4-f%4)%4;r.push(` + cv = ud.${l}.value; + v = uv.${l}; + offset = ${a.offset/4}; + + t = 0; + + for(var i=0; i < ${a.data.size*d}; i++) + { + for(var j = 0; j < ${f}; j++) + { + data[offset++] = v[t++]; + } + offset += ${m}; + } + + `)}else{const u=L2[a.data.type];r.push(` + cv = ud.${l}.value; + v = uv.${l}; + offset = ${a.offset/4}; + ${u}; + `)}}return r.push(` + renderer.buffer.update(buffer); + `),{size:s,syncFunc:new Function("ud","uv","renderer","syncData","buffer",r.join(` +`))}}let D2=0;const Yc={textureCount:0,uboCount:0};class Nw{constructor(e){this.destroyed=!1,this.renderer=e,this.systemCheck(),this.gl=null,this.shader=null,this.program=null,this.cache={},this._uboCache={},this.id=D2++}systemCheck(){if(!h2())throw new Error("Current environment does not allow unsafe-eval, please use @pixi/unsafe-eval module to enable support.")}contextChange(e){this.gl=e,this.reset()}bind(e,t){e.disposeRunner.add(this),e.uniforms.globals=this.renderer.globalUniforms;const i=e.program,s=i.glPrograms[this.renderer.CONTEXT_UID]||this.generateProgram(e);return this.shader=e,this.program!==i&&(this.program=i,this.gl.useProgram(s.program)),t||(Yc.textureCount=0,Yc.uboCount=0,this.syncUniformGroup(e.uniformGroup,Yc)),s}setUniforms(e){const t=this.shader.program,i=t.glPrograms[this.renderer.CONTEXT_UID];t.syncUniforms(i.uniformData,e,this.renderer)}syncUniformGroup(e,t){const i=this.getGlProgram();(!e.static||e.dirtyId!==i.uniformDirtyGroups[e.id])&&(i.uniformDirtyGroups[e.id]=e.dirtyId,this.syncUniforms(e,i,t))}syncUniforms(e,t,i){(e.syncUniforms[this.shader.program.id]||this.createSyncGroups(e))(t.uniformData,e.uniforms,this.renderer,i)}createSyncGroups(e){const t=this.getSignature(e,this.shader.program.uniformData,"u");return this.cache[t]||(this.cache[t]=r2(e,this.shader.program.uniformData)),e.syncUniforms[this.shader.program.id]=this.cache[t],e.syncUniforms[this.shader.program.id]}syncUniformBufferGroup(e,t){const i=this.getGlProgram();if(!e.static||e.dirtyId!==0||!i.uniformGroups[e.id]){e.dirtyId=0;const s=i.uniformGroups[e.id]||this.createSyncBufferGroup(e,i,t);e.buffer.update(),s(i.uniformData,e.uniforms,this.renderer,Yc,e.buffer)}this.renderer.buffer.bindBufferBase(e.buffer,i.uniformBufferBindings[t])}createSyncBufferGroup(e,t,i){const{gl:s}=this.renderer;this.renderer.buffer.bind(e.buffer);const r=this.gl.getUniformBlockIndex(t.program,i);t.uniformBufferBindings[i]=this.shader.uniformBindCount,s.uniformBlockBinding(t.program,r,this.shader.uniformBindCount),this.shader.uniformBindCount++;const o=this.getSignature(e,this.shader.program.uniformData,"ubo");let a=this._uboCache[o];if(a||(a=this._uboCache[o]=N2(e,this.shader.program.uniformData)),e.autoManage){const c=new Float32Array(a.size/4);e.buffer.update(c)}return t.uniformGroups[e.id]=a.syncFunc,t.uniformGroups[e.id]}getSignature(e,t,i){const s=e.uniforms,r=[`${i}-`];for(const o in s)r.push(o),t[o]&&r.push(t[o].type);return r.join("-")}getGlProgram(){return this.shader?this.shader.program.glPrograms[this.renderer.CONTEXT_UID]:null}generateProgram(e){const t=this.gl,i=e.program,s=k2(t,i);return i.glPrograms[this.renderer.CONTEXT_UID]=s,s}reset(){this.program=null,this.shader=null}disposeShader(e){this.shader===e&&(this.shader=null)}destroy(){this.renderer=null,this.destroyed=!0}}Nw.extension={type:$e.RendererSystem,name:"shader"};je.add(Nw);class Jh{constructor(e){this.renderer=e}run(e){const{renderer:t}=this;t.runners.init.emit(t.options),e.hello&&console.log(`PixiJS 7.4.3 - ${t.rendererLogId} - https://pixijs.com`),t.resize(t.screen.width,t.screen.height)}destroy(){}}Jh.defaultOptions={hello:!1},Jh.extension={type:[$e.RendererSystem,$e.CanvasRendererSystem],name:"startup"};je.add(Jh);function B2(n,e=[]){return e[Qe.NORMAL]=[n.ONE,n.ONE_MINUS_SRC_ALPHA],e[Qe.ADD]=[n.ONE,n.ONE],e[Qe.MULTIPLY]=[n.DST_COLOR,n.ONE_MINUS_SRC_ALPHA,n.ONE,n.ONE_MINUS_SRC_ALPHA],e[Qe.SCREEN]=[n.ONE,n.ONE_MINUS_SRC_COLOR,n.ONE,n.ONE_MINUS_SRC_ALPHA],e[Qe.OVERLAY]=[n.ONE,n.ONE_MINUS_SRC_ALPHA],e[Qe.DARKEN]=[n.ONE,n.ONE_MINUS_SRC_ALPHA],e[Qe.LIGHTEN]=[n.ONE,n.ONE_MINUS_SRC_ALPHA],e[Qe.COLOR_DODGE]=[n.ONE,n.ONE_MINUS_SRC_ALPHA],e[Qe.COLOR_BURN]=[n.ONE,n.ONE_MINUS_SRC_ALPHA],e[Qe.HARD_LIGHT]=[n.ONE,n.ONE_MINUS_SRC_ALPHA],e[Qe.SOFT_LIGHT]=[n.ONE,n.ONE_MINUS_SRC_ALPHA],e[Qe.DIFFERENCE]=[n.ONE,n.ONE_MINUS_SRC_ALPHA],e[Qe.EXCLUSION]=[n.ONE,n.ONE_MINUS_SRC_ALPHA],e[Qe.HUE]=[n.ONE,n.ONE_MINUS_SRC_ALPHA],e[Qe.SATURATION]=[n.ONE,n.ONE_MINUS_SRC_ALPHA],e[Qe.COLOR]=[n.ONE,n.ONE_MINUS_SRC_ALPHA],e[Qe.LUMINOSITY]=[n.ONE,n.ONE_MINUS_SRC_ALPHA],e[Qe.NONE]=[0,0],e[Qe.NORMAL_NPM]=[n.SRC_ALPHA,n.ONE_MINUS_SRC_ALPHA,n.ONE,n.ONE_MINUS_SRC_ALPHA],e[Qe.ADD_NPM]=[n.SRC_ALPHA,n.ONE,n.ONE,n.ONE],e[Qe.SCREEN_NPM]=[n.SRC_ALPHA,n.ONE_MINUS_SRC_COLOR,n.ONE,n.ONE_MINUS_SRC_ALPHA],e[Qe.SRC_IN]=[n.DST_ALPHA,n.ZERO],e[Qe.SRC_OUT]=[n.ONE_MINUS_DST_ALPHA,n.ZERO],e[Qe.SRC_ATOP]=[n.DST_ALPHA,n.ONE_MINUS_SRC_ALPHA],e[Qe.DST_OVER]=[n.ONE_MINUS_DST_ALPHA,n.ONE],e[Qe.DST_IN]=[n.ZERO,n.SRC_ALPHA],e[Qe.DST_OUT]=[n.ZERO,n.ONE_MINUS_SRC_ALPHA],e[Qe.DST_ATOP]=[n.ONE_MINUS_DST_ALPHA,n.SRC_ALPHA],e[Qe.XOR]=[n.ONE_MINUS_DST_ALPHA,n.ONE_MINUS_SRC_ALPHA],e[Qe.SUBTRACT]=[n.ONE,n.ONE,n.ONE,n.ONE,n.FUNC_REVERSE_SUBTRACT,n.FUNC_ADD],e}const U2=0,V2=1,X2=2,Y2=3,G2=4,H2=5,Dw=class Jm{constructor(){this.gl=null,this.stateId=0,this.polygonOffset=0,this.blendMode=Qe.NONE,this._blendEq=!1,this.map=[],this.map[U2]=this.setBlend,this.map[V2]=this.setOffset,this.map[X2]=this.setCullFace,this.map[Y2]=this.setDepthTest,this.map[G2]=this.setFrontFace,this.map[H2]=this.setDepthMask,this.checks=[],this.defaultState=new Rs,this.defaultState.blend=!0}contextChange(e){this.gl=e,this.blendModes=B2(e),this.set(this.defaultState),this.reset()}set(e){if(e=e||this.defaultState,this.stateId!==e.data){let t=this.stateId^e.data,i=0;for(;t;)t&1&&this.map[i].call(this,!!(e.data&1<>1,i++;this.stateId=e.data}for(let t=0;te.systems[s]),i=[...t,...Object.keys(e.systems).filter(s=>!t.includes(s))];for(const s of i)this.addSystem(e.systems[s],s)}addRunners(...e){e.forEach(t=>{this.runners[t]=new Zn(t)})}addSystem(e,t){const i=new e(this);if(this[t])throw new Error(`Whoops! The name "${t}" is already in use`);this[t]=i,this._systemsHash[t]=i;for(const s in this.runners)this.runners[s].add(i);return this}emitWithCustomOptions(e,t){const i=Object.keys(this._systemsHash);e.items.forEach(s=>{const r=i.find(o=>this._systemsHash[o]===s);s[e.name](t[r])})}destroy(){Object.values(this.runners).forEach(e=>{e.destroy()}),this._systemsHash={}}}const Sl=class wh{constructor(e){this.renderer=e,this.count=0,this.checkCount=0,this.maxIdle=wh.defaultMaxIdle,this.checkCountMax=wh.defaultCheckCountMax,this.mode=wh.defaultMode}postrender(){this.renderer.objectRenderer.renderingToScreen&&(this.count++,this.mode!==wg.MANUAL&&(this.checkCount++,this.checkCount>this.checkCountMax&&(this.checkCount=0,this.run())))}run(){const e=this.renderer.texture,t=e.managedTextures;let i=!1;for(let s=0;sthis.maxIdle&&(e.destroyTexture(r,!0),t[s]=null,i=!0)}if(i){let s=0;for(let r=0;r=0;s--)this.unload(e.children[s])}destroy(){this.renderer=null}};Sl.defaultMode=wg.AUTO,Sl.defaultMaxIdle=3600,Sl.defaultCheckCountMax=600,Sl.extension={type:$e.RendererSystem,name:"textureGC"};let xo=Sl;je.add(xo);class Gf{constructor(e){this.texture=e,this.width=-1,this.height=-1,this.dirtyId=-1,this.dirtyStyleId=-1,this.mipmap=!1,this.wrapMode=33071,this.type=He.UNSIGNED_BYTE,this.internalFormat=Ie.RGBA,this.samplerType=0}}function z2(n){let e;return"WebGL2RenderingContext"in globalThis&&n instanceof globalThis.WebGL2RenderingContext?e={[n.RGB]:Xe.FLOAT,[n.RGBA]:Xe.FLOAT,[n.ALPHA]:Xe.FLOAT,[n.LUMINANCE]:Xe.FLOAT,[n.LUMINANCE_ALPHA]:Xe.FLOAT,[n.R8]:Xe.FLOAT,[n.R8_SNORM]:Xe.FLOAT,[n.RG8]:Xe.FLOAT,[n.RG8_SNORM]:Xe.FLOAT,[n.RGB8]:Xe.FLOAT,[n.RGB8_SNORM]:Xe.FLOAT,[n.RGB565]:Xe.FLOAT,[n.RGBA4]:Xe.FLOAT,[n.RGB5_A1]:Xe.FLOAT,[n.RGBA8]:Xe.FLOAT,[n.RGBA8_SNORM]:Xe.FLOAT,[n.RGB10_A2]:Xe.FLOAT,[n.RGB10_A2UI]:Xe.FLOAT,[n.SRGB8]:Xe.FLOAT,[n.SRGB8_ALPHA8]:Xe.FLOAT,[n.R16F]:Xe.FLOAT,[n.RG16F]:Xe.FLOAT,[n.RGB16F]:Xe.FLOAT,[n.RGBA16F]:Xe.FLOAT,[n.R32F]:Xe.FLOAT,[n.RG32F]:Xe.FLOAT,[n.RGB32F]:Xe.FLOAT,[n.RGBA32F]:Xe.FLOAT,[n.R11F_G11F_B10F]:Xe.FLOAT,[n.RGB9_E5]:Xe.FLOAT,[n.R8I]:Xe.INT,[n.R8UI]:Xe.UINT,[n.R16I]:Xe.INT,[n.R16UI]:Xe.UINT,[n.R32I]:Xe.INT,[n.R32UI]:Xe.UINT,[n.RG8I]:Xe.INT,[n.RG8UI]:Xe.UINT,[n.RG16I]:Xe.INT,[n.RG16UI]:Xe.UINT,[n.RG32I]:Xe.INT,[n.RG32UI]:Xe.UINT,[n.RGB8I]:Xe.INT,[n.RGB8UI]:Xe.UINT,[n.RGB16I]:Xe.INT,[n.RGB16UI]:Xe.UINT,[n.RGB32I]:Xe.INT,[n.RGB32UI]:Xe.UINT,[n.RGBA8I]:Xe.INT,[n.RGBA8UI]:Xe.UINT,[n.RGBA16I]:Xe.INT,[n.RGBA16UI]:Xe.UINT,[n.RGBA32I]:Xe.INT,[n.RGBA32UI]:Xe.UINT,[n.DEPTH_COMPONENT16]:Xe.FLOAT,[n.DEPTH_COMPONENT24]:Xe.FLOAT,[n.DEPTH_COMPONENT32F]:Xe.FLOAT,[n.DEPTH_STENCIL]:Xe.FLOAT,[n.DEPTH24_STENCIL8]:Xe.FLOAT,[n.DEPTH32F_STENCIL8]:Xe.FLOAT}:e={[n.RGB]:Xe.FLOAT,[n.RGBA]:Xe.FLOAT,[n.ALPHA]:Xe.FLOAT,[n.LUMINANCE]:Xe.FLOAT,[n.LUMINANCE_ALPHA]:Xe.FLOAT,[n.DEPTH_STENCIL]:Xe.FLOAT},e}function q2(n){let e;return"WebGL2RenderingContext"in globalThis&&n instanceof globalThis.WebGL2RenderingContext?e={[He.UNSIGNED_BYTE]:{[Ie.RGBA]:n.RGBA8,[Ie.RGB]:n.RGB8,[Ie.RG]:n.RG8,[Ie.RED]:n.R8,[Ie.RGBA_INTEGER]:n.RGBA8UI,[Ie.RGB_INTEGER]:n.RGB8UI,[Ie.RG_INTEGER]:n.RG8UI,[Ie.RED_INTEGER]:n.R8UI,[Ie.ALPHA]:n.ALPHA,[Ie.LUMINANCE]:n.LUMINANCE,[Ie.LUMINANCE_ALPHA]:n.LUMINANCE_ALPHA},[He.BYTE]:{[Ie.RGBA]:n.RGBA8_SNORM,[Ie.RGB]:n.RGB8_SNORM,[Ie.RG]:n.RG8_SNORM,[Ie.RED]:n.R8_SNORM,[Ie.RGBA_INTEGER]:n.RGBA8I,[Ie.RGB_INTEGER]:n.RGB8I,[Ie.RG_INTEGER]:n.RG8I,[Ie.RED_INTEGER]:n.R8I},[He.UNSIGNED_SHORT]:{[Ie.RGBA_INTEGER]:n.RGBA16UI,[Ie.RGB_INTEGER]:n.RGB16UI,[Ie.RG_INTEGER]:n.RG16UI,[Ie.RED_INTEGER]:n.R16UI,[Ie.DEPTH_COMPONENT]:n.DEPTH_COMPONENT16},[He.SHORT]:{[Ie.RGBA_INTEGER]:n.RGBA16I,[Ie.RGB_INTEGER]:n.RGB16I,[Ie.RG_INTEGER]:n.RG16I,[Ie.RED_INTEGER]:n.R16I},[He.UNSIGNED_INT]:{[Ie.RGBA_INTEGER]:n.RGBA32UI,[Ie.RGB_INTEGER]:n.RGB32UI,[Ie.RG_INTEGER]:n.RG32UI,[Ie.RED_INTEGER]:n.R32UI,[Ie.DEPTH_COMPONENT]:n.DEPTH_COMPONENT24},[He.INT]:{[Ie.RGBA_INTEGER]:n.RGBA32I,[Ie.RGB_INTEGER]:n.RGB32I,[Ie.RG_INTEGER]:n.RG32I,[Ie.RED_INTEGER]:n.R32I},[He.FLOAT]:{[Ie.RGBA]:n.RGBA32F,[Ie.RGB]:n.RGB32F,[Ie.RG]:n.RG32F,[Ie.RED]:n.R32F,[Ie.DEPTH_COMPONENT]:n.DEPTH_COMPONENT32F},[He.HALF_FLOAT]:{[Ie.RGBA]:n.RGBA16F,[Ie.RGB]:n.RGB16F,[Ie.RG]:n.RG16F,[Ie.RED]:n.R16F},[He.UNSIGNED_SHORT_5_6_5]:{[Ie.RGB]:n.RGB565},[He.UNSIGNED_SHORT_4_4_4_4]:{[Ie.RGBA]:n.RGBA4},[He.UNSIGNED_SHORT_5_5_5_1]:{[Ie.RGBA]:n.RGB5_A1},[He.UNSIGNED_INT_2_10_10_10_REV]:{[Ie.RGBA]:n.RGB10_A2,[Ie.RGBA_INTEGER]:n.RGB10_A2UI},[He.UNSIGNED_INT_10F_11F_11F_REV]:{[Ie.RGB]:n.R11F_G11F_B10F},[He.UNSIGNED_INT_5_9_9_9_REV]:{[Ie.RGB]:n.RGB9_E5},[He.UNSIGNED_INT_24_8]:{[Ie.DEPTH_STENCIL]:n.DEPTH24_STENCIL8},[He.FLOAT_32_UNSIGNED_INT_24_8_REV]:{[Ie.DEPTH_STENCIL]:n.DEPTH32F_STENCIL8}}:e={[He.UNSIGNED_BYTE]:{[Ie.RGBA]:n.RGBA,[Ie.RGB]:n.RGB,[Ie.ALPHA]:n.ALPHA,[Ie.LUMINANCE]:n.LUMINANCE,[Ie.LUMINANCE_ALPHA]:n.LUMINANCE_ALPHA},[He.UNSIGNED_SHORT_5_6_5]:{[Ie.RGB]:n.RGB},[He.UNSIGNED_SHORT_4_4_4_4]:{[Ie.RGBA]:n.RGBA},[He.UNSIGNED_SHORT_5_5_5_1]:{[Ie.RGBA]:n.RGBA}},e}class Bw{constructor(e){this.renderer=e,this.boundTextures=[],this.currentLocation=-1,this.managedTextures=[],this._unknownBoundTextures=!1,this.unknownTexture=new rt,this.hasIntegerTextures=!1}contextChange(){const e=this.gl=this.renderer.gl;this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.webGLVersion=this.renderer.context.webGLVersion,this.internalFormats=q2(e),this.samplerTypes=z2(e);const t=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS);this.boundTextures.length=t;for(let s=0;s=0;--r){const o=t[r];o&&o._glTextures[s].samplerType!==Xe.FLOAT&&this.renderer.texture.unbind(o)}}initTexture(e){const t=new Gf(this.gl.createTexture());return t.dirtyId=-1,e._glTextures[this.CONTEXT_UID]=t,this.managedTextures.push(e),e.on("dispose",this.destroyTexture,this),t}initTextureType(e,t){var i;t.internalFormat=((i=this.internalFormats[e.type])==null?void 0:i[e.format])??e.format,t.samplerType=this.samplerTypes[t.internalFormat]??Xe.FLOAT,this.webGLVersion===2&&e.type===He.HALF_FLOAT?t.type=this.gl.HALF_FLOAT:t.type=e.type}updateTexture(e){var s;const t=e._glTextures[this.CONTEXT_UID];if(!t)return;const i=this.renderer;if(this.initTextureType(e,t),(s=e.resource)==null?void 0:s.upload(i,e,t))t.samplerType!==Xe.FLOAT&&(this.hasIntegerTextures=!0);else{const r=e.realWidth,o=e.realHeight,a=i.gl;(t.width!==r||t.height!==o||t.dirtyId<0)&&(t.width=r,t.height=o,a.texImage2D(e.target,0,t.internalFormat,r,o,0,e.format,t.type,null))}e.dirtyStyleId!==t.dirtyStyleId&&this.updateTextureStyle(e),t.dirtyId=e.dirtyId}destroyTexture(e,t){const{gl:i}=this;if(e=e.castToBaseTexture(),e._glTextures[this.CONTEXT_UID]&&(this.unbind(e),i.deleteTexture(e._glTextures[this.CONTEXT_UID].texture),e.off("dispose",this.destroyTexture,this),delete e._glTextures[this.CONTEXT_UID],!t)){const s=this.managedTextures.indexOf(e);s!==-1&&Pa(this.managedTextures,s,1)}}updateTextureStyle(e){var i;const t=e._glTextures[this.CONTEXT_UID];t&&((e.mipmap===$n.POW2||this.webGLVersion!==2)&&!e.isPowerOfTwo?t.mipmap=!1:t.mipmap=e.mipmap>=1,this.webGLVersion!==2&&!e.isPowerOfTwo?t.wrapMode=Jn.CLAMP:t.wrapMode=e.wrapMode,(i=e.resource)!=null&&i.style(this.renderer,e,t)||this.setStyle(e,t),t.dirtyStyleId=e.dirtyStyleId)}setStyle(e,t){const i=this.gl;if(t.mipmap&&e.mipmap!==$n.ON_MANUAL&&i.generateMipmap(e.target),i.texParameteri(e.target,i.TEXTURE_WRAP_S,t.wrapMode),i.texParameteri(e.target,i.TEXTURE_WRAP_T,t.wrapMode),t.mipmap){i.texParameteri(e.target,i.TEXTURE_MIN_FILTER,e.scaleMode===Wn.LINEAR?i.LINEAR_MIPMAP_LINEAR:i.NEAREST_MIPMAP_NEAREST);const s=this.renderer.context.extensions.anisotropicFiltering;if(s&&e.anisotropicLevel>0&&e.scaleMode===Wn.LINEAR){const r=Math.min(e.anisotropicLevel,i.getParameter(s.MAX_TEXTURE_MAX_ANISOTROPY_EXT));i.texParameterf(e.target,s.TEXTURE_MAX_ANISOTROPY_EXT,r)}}else i.texParameteri(e.target,i.TEXTURE_MIN_FILTER,e.scaleMode===Wn.LINEAR?i.LINEAR:i.NEAREST);i.texParameteri(e.target,i.TEXTURE_MAG_FILTER,e.scaleMode===Wn.LINEAR?i.LINEAR:i.NEAREST)}destroy(){this.renderer=null}}Bw.extension={type:$e.RendererSystem,name:"texture"};je.add(Bw);class Uw{constructor(e){this.renderer=e}contextChange(){this.gl=this.renderer.gl,this.CONTEXT_UID=this.renderer.CONTEXT_UID}bind(e){const{gl:t,CONTEXT_UID:i}=this,s=e._glTransformFeedbacks[i]||this.createGLTransformFeedback(e);t.bindTransformFeedback(t.TRANSFORM_FEEDBACK,s)}unbind(){const{gl:e}=this;e.bindTransformFeedback(e.TRANSFORM_FEEDBACK,null)}beginTransformFeedback(e,t){const{gl:i,renderer:s}=this;t&&s.shader.bind(t),i.beginTransformFeedback(e)}endTransformFeedback(){const{gl:e}=this;e.endTransformFeedback()}createGLTransformFeedback(e){const{gl:t,renderer:i,CONTEXT_UID:s}=this,r=t.createTransformFeedback();e._glTransformFeedbacks[s]=r,t.bindTransformFeedback(t.TRANSFORM_FEEDBACK,r);for(let o=0;o(n[n.INTERACTION=50]="INTERACTION",n[n.HIGH=25]="HIGH",n[n.NORMAL=0]="NORMAL",n[n.LOW=-25]="LOW",n[n.UTILITY=-50]="UTILITY",n))(Uo||{});class Hf{constructor(e,t=null,i=0,s=!1){this.next=null,this.previous=null,this._destroyed=!1,this.fn=e,this.context=t,this.priority=i,this.once=s}match(e,t=null){return this.fn===e&&this.context===t}emit(e){this.fn&&(this.context?this.fn.call(this.context,e):this.fn(e));const t=this.next;return this.once&&this.destroy(!0),this._destroyed&&(this.next=null),t}connect(e){this.previous=e,e.next&&(e.next.previous=this),this.next=e.next,e.next=this}destroy(e=!1){this._destroyed=!0,this.fn=null,this.context=null,this.previous&&(this.previous.next=this.next),this.next&&(this.next.previous=this.previous);const t=this.next;return this.next=e?null:t,this.previous=null,t}}const Vw=class vn{constructor(){this.autoStart=!1,this.deltaTime=1,this.lastTime=-1,this.speed=1,this.started=!1,this._requestId=null,this._maxElapsedMS=100,this._minElapsedMS=0,this._protected=!1,this._lastFrame=-1,this._head=new Hf(null,null,1/0),this.deltaMS=1/vn.targetFPMS,this.elapsedMS=1/vn.targetFPMS,this._tick=e=>{this._requestId=null,this.started&&(this.update(e),this.started&&this._requestId===null&&this._head.next&&(this._requestId=requestAnimationFrame(this._tick)))}}_requestIfNeeded(){this._requestId===null&&this._head.next&&(this.lastTime=performance.now(),this._lastFrame=this.lastTime,this._requestId=requestAnimationFrame(this._tick))}_cancelIfNeeded(){this._requestId!==null&&(cancelAnimationFrame(this._requestId),this._requestId=null)}_startIfPossible(){this.started?this._requestIfNeeded():this.autoStart&&this.start()}add(e,t,i=Uo.NORMAL){return this._addListener(new Hf(e,t,i))}addOnce(e,t,i=Uo.NORMAL){return this._addListener(new Hf(e,t,i,!0))}_addListener(e){let t=this._head.next,i=this._head;if(!t)e.connect(i);else{for(;t;){if(e.priority>t.priority){e.connect(i);break}i=t,t=t.next}e.previous||e.connect(i)}return this._startIfPossible(),this}remove(e,t){let i=this._head.next;for(;i;)i.match(e,t)?i=i.destroy():i=i.next;return this._head.next||this._cancelIfNeeded(),this}get count(){if(!this._head)return 0;let e=0,t=this._head;for(;t=t.next;)e++;return e}start(){this.started||(this.started=!0,this._requestIfNeeded())}stop(){this.started&&(this.started=!1,this._cancelIfNeeded())}destroy(){if(!this._protected){this.stop();let e=this._head.next;for(;e;)e=e.destroy(!0);this._head.destroy(),this._head=null}}update(e=performance.now()){let t;if(e>this.lastTime){if(t=this.elapsedMS=e-this.lastTime,t>this._maxElapsedMS&&(t=this._maxElapsedMS),t*=this.speed,this._minElapsedMS){const r=e-this._lastFrame|0;if(r{this._ticker.stop()},this.start=()=>{this._ticker.start()},this._ticker=null,this.ticker=e.sharedTicker?nn.shared:new nn,e.autoStart&&this.start()}static destroy(){if(this._ticker){const e=this._ticker;this.ticker=null,e.destroy()}}}Xw.extension=$e.Application;je.add(Xw);const Yw=[];je.handleByList($e.Renderer,Yw);function K2(n){for(const e of Yw)if(e.test(n))return new e(n);throw new Error("Unable to auto-detect a suitable renderer.")}var J2=`attribute vec2 aVertexPosition; +attribute vec2 aTextureCoord; + +uniform mat3 projectionMatrix; + +varying vec2 vTextureCoord; + +void main(void) +{ + gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); + vTextureCoord = aTextureCoord; +}`,Z2=`attribute vec2 aVertexPosition; + +uniform mat3 projectionMatrix; + +varying vec2 vTextureCoord; + +uniform vec4 inputSize; +uniform vec4 outputFrame; + +vec4 filterVertexPosition( void ) +{ + vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy; + + return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0); +} + +vec2 filterTextureCoord( void ) +{ + return aVertexPosition * (outputFrame.zw * inputSize.zw); +} + +void main(void) +{ + gl_Position = filterVertexPosition(); + vTextureCoord = filterTextureCoord(); +} +`;const Q2=J2,Gw=Z2;class Hw{constructor(e){this.renderer=e}contextChange(e){let t;if(this.renderer.context.webGLVersion===1){const i=e.getParameter(e.FRAMEBUFFER_BINDING);e.bindFramebuffer(e.FRAMEBUFFER,null),t=e.getParameter(e.SAMPLES),e.bindFramebuffer(e.FRAMEBUFFER,i)}else{const i=e.getParameter(e.DRAW_FRAMEBUFFER_BINDING);e.bindFramebuffer(e.DRAW_FRAMEBUFFER,null),t=e.getParameter(e.SAMPLES),e.bindFramebuffer(e.DRAW_FRAMEBUFFER,i)}t>=bi.HIGH?this.multisample=bi.HIGH:t>=bi.MEDIUM?this.multisample=bi.MEDIUM:t>=bi.LOW?this.multisample=bi.LOW:this.multisample=bi.NONE}destroy(){}}Hw.extension={type:$e.RendererSystem,name:"_multisample"};je.add(Hw);class eP{constructor(e){this.buffer=e||null,this.updateID=-1,this.byteLength=-1,this.refCount=0}}class jw{constructor(e){this.renderer=e,this.managedBuffers={},this.boundBufferBases={}}destroy(){this.renderer=null}contextChange(){this.disposeAll(!0),this.gl=this.renderer.gl,this.CONTEXT_UID=this.renderer.CONTEXT_UID}bind(e){const{gl:t,CONTEXT_UID:i}=this,s=e._glBuffers[i]||this.createGLBuffer(e);t.bindBuffer(e.type,s.buffer)}unbind(e){const{gl:t}=this;t.bindBuffer(e,null)}bindBufferBase(e,t){const{gl:i,CONTEXT_UID:s}=this;if(this.boundBufferBases[t]!==e){const r=e._glBuffers[s]||this.createGLBuffer(e);this.boundBufferBases[t]=e,i.bindBufferBase(i.UNIFORM_BUFFER,t,r.buffer)}}bindBufferRange(e,t,i){const{gl:s,CONTEXT_UID:r}=this;i=i||0;const o=e._glBuffers[r]||this.createGLBuffer(e);s.bindBufferRange(s.UNIFORM_BUFFER,t||0,o.buffer,i*256,256)}update(e){const{gl:t,CONTEXT_UID:i}=this,s=e._glBuffers[i]||this.createGLBuffer(e);if(e._updateID!==s.updateID)if(s.updateID=e._updateID,t.bindBuffer(e.type,s.buffer),s.byteLength>=e.data.byteLength)t.bufferSubData(e.type,0,e.data);else{const r=e.static?t.STATIC_DRAW:t.DYNAMIC_DRAW;s.byteLength=e.data.byteLength,t.bufferData(e.type,e.data,r)}}dispose(e,t){if(!this.managedBuffers[e.id])return;delete this.managedBuffers[e.id];const i=e._glBuffers[this.CONTEXT_UID],s=this.gl;e.disposeRunner.remove(this),i&&(t||s.deleteBuffer(i.buffer),delete e._glBuffers[this.CONTEXT_UID])}disposeAll(e){const t=Object.keys(this.managedBuffers);for(let i=0;it.resource).filter(t=>t).map(t=>t.load());return this._load=Promise.all(e).then(()=>{const{realWidth:t,realHeight:i}=this.items[0];return this.resize(t,i),this.update(),Promise.resolve(this)}),this._load}}class tP extends zw{constructor(e,t){const{width:i,height:s}=t||{};let r,o;Array.isArray(e)?(r=e,o=e.length):o=e,super(o,{width:i,height:s}),r&&this.initFromArray(r,t)}addBaseTextureAt(e,t){if(e.resource)this.addResourceAt(e.resource,t);else throw new Error("ArrayResource does not support RenderTexture");return this}bind(e){super.bind(e),e.target=Ia.TEXTURE_2D_ARRAY}upload(e,t,i){const{length:s,itemDirtyIds:r,items:o}=this,{gl:a}=e;i.dirtyId<0&&a.texImage3D(a.TEXTURE_2D_ARRAY,0,i.internalFormat,this._width,this._height,s,0,t.format,i.type,null);for(let c=0;c0)if(e.resource)this.addResourceAt(e.resource,t);else throw new Error("CubeResource does not support copying of renderTexture.");else e.target=Ia.TEXTURE_CUBE_MAP_POSITIVE_X+t,e.parentTextureArray=this.baseTexture,this.items[t]=e;return e.valid&&!this.valid&&this.resize(e.realWidth,e.realHeight),this.items[t]=e,this}upload(e,t,i){const s=this.itemDirtyIds;for(let r=0;r<_l.SIDES;r++){const o=this.items[r];(s[r]{if(this.url===null){e(this);return}try{const i=await Ve.ADAPTER.fetch(this.url,{mode:this.crossOrigin?"cors":"no-cors"});if(this.destroyed)return;const s=await i.blob();if(this.destroyed)return;const r=await createImageBitmap(s,{premultiplyAlpha:this.alphaMode===null||this.alphaMode===Ri.UNPACK?"premultiply":"none"});if(this.destroyed){r.close();return}this.source=r,this.update(),e(this)}catch(i){if(this.destroyed)return;t(i),this.onError.emit(i)}}),this._load)}upload(e,t,i){return this.source instanceof ImageBitmap?(typeof this.alphaMode=="number"&&(t.alphaMode=this.alphaMode),super.upload(e,t,i)):(this.load(),!1)}dispose(){this.ownsImageBitmap&&this.source instanceof ImageBitmap&&this.source.close(),super.dispose(),this._load=null}static test(e){return!!globalThis.createImageBitmap&&typeof ImageBitmap<"u"&&(typeof e=="string"||e instanceof ImageBitmap)}static get EMPTY(){return xa._EMPTY=xa._EMPTY??Ve.ADAPTER.createCanvas(0,0),xa._EMPTY}}const Qm=class _h extends mr{constructor(e,t){t=t||{},super(Ve.ADAPTER.createCanvas()),this._width=0,this._height=0,this.svg=e,this.scale=t.scale||1,this._overrideWidth=t.width,this._overrideHeight=t.height,this._resolve=null,this._crossorigin=t.crossorigin,this._load=null,t.autoLoad!==!1&&this.load()}load(){return this._load?this._load:(this._load=new Promise(e=>{if(this._resolve=()=>{this.update(),e(this)},_h.SVG_XML.test(this.svg.trim())){if(!btoa)throw new Error("Your browser doesn't support base64 conversions.");this.svg=`data:image/svg+xml;base64,${btoa(unescape(encodeURIComponent(this.svg)))}`}this._loadSvg()}),this._load)}_loadSvg(){const e=new Image;mr.crossOrigin(e,this.svg,this._crossorigin),e.src=this.svg,e.onerror=t=>{this._resolve&&(e.onerror=null,this.onError.emit(t))},e.onload=()=>{if(!this._resolve)return;const t=e.width,i=e.height;if(!t||!i)throw new Error("The SVG image must have width and height defined (in pixels), canvas API needs them.");let s=t*this.scale,r=i*this.scale;(this._overrideWidth||this._overrideHeight)&&(s=this._overrideWidth||this._overrideHeight/i*t,r=this._overrideHeight||this._overrideWidth/t*i),s=Math.round(s),r=Math.round(r);const o=this.source;o.width=s,o.height=r,o._pixiId=`canvas_${Bo()}`,o.getContext("2d").drawImage(e,0,0,t,i,0,0,s,r),this._resolve(),this._resolve=null}}static getSize(e){const t=_h.SVG_SIZE.exec(e),i={};return t&&(i[t[1]]=Math.round(parseFloat(t[3])),i[t[5]]=Math.round(parseFloat(t[7]))),i}dispose(){super.dispose(),this._resolve=null,this._crossorigin=null}static test(e,t){return t==="svg"||typeof e=="string"&&e.startsWith("data:image/svg+xml")||typeof e=="string"&&_h.SVG_XML.test(e)}};Qm.SVG_XML=/^(<\?xml[^?]+\?>)?\s*()]*-->)?\s*\]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i;let ep=Qm;class sP extends mr{constructor(e){super(e)}static test(e){return!!globalThis.VideoFrame&&e instanceof globalThis.VideoFrame}}const tp=class ip extends mr{constructor(e,t){if(t=t||{},!(e instanceof HTMLVideoElement)){const i=document.createElement("video");t.autoLoad!==!1&&i.setAttribute("preload","auto"),t.playsinline!==!1&&(i.setAttribute("webkit-playsinline",""),i.setAttribute("playsinline","")),t.muted===!0&&(i.setAttribute("muted",""),i.muted=!0),t.loop===!0&&i.setAttribute("loop",""),t.autoPlay!==!1&&i.setAttribute("autoplay",""),typeof e=="string"&&(e=[e]);const s=e[0].src||e[0];mr.crossOrigin(i,s,t.crossorigin);for(let r=0;r{this.valid?t(this):(this._resolve=t,this._reject=i,e.load())}),this._load}_onError(e){this.source.removeEventListener("error",this._onError,!0),this.onError.emit(e),this._reject&&(this._reject(e),this._reject=null,this._resolve=null)}_isSourcePlaying(){const e=this.source;return!e.paused&&!e.ended}_isSourceReady(){return this.source.readyState>2}_onPlayStart(){this.valid||this._onCanPlay(),this._configureAutoUpdate()}_onPlayStop(){this._configureAutoUpdate()}_onSeeked(){this._autoUpdate&&!this._isSourcePlaying()&&(this._msToNextUpdate=0,this.update(),this._msToNextUpdate=0)}_onCanPlay(){const e=this.source;e.removeEventListener("canplay",this._onCanPlay),e.removeEventListener("canplaythrough",this._onCanPlay);const t=this.valid;this._msToNextUpdate=0,this.update(),this._msToNextUpdate=0,!t&&this._resolve&&(this._resolve(this),this._resolve=null,this._reject=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&e.play()}dispose(){this._configureAutoUpdate();const e=this.source;e&&(e.removeEventListener("play",this._onPlayStart),e.removeEventListener("pause",this._onPlayStop),e.removeEventListener("seeked",this._onSeeked),e.removeEventListener("canplay",this._onCanPlay),e.removeEventListener("canplaythrough",this._onCanPlay),e.removeEventListener("error",this._onError,!0),e.pause(),e.src="",e.load()),super.dispose()}get autoUpdate(){return this._autoUpdate}set autoUpdate(e){e!==this._autoUpdate&&(this._autoUpdate=e,this._configureAutoUpdate())}get updateFPS(){return this._updateFPS}set updateFPS(e){e!==this._updateFPS&&(this._updateFPS=e,this._configureAutoUpdate())}_configureAutoUpdate(){this._autoUpdate&&this._isSourcePlaying()?!this._updateFPS&&this.source.requestVideoFrameCallback?(this._isConnectedToTicker&&(nn.shared.remove(this.update,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0),this._videoFrameRequestCallbackHandle===null&&(this._videoFrameRequestCallbackHandle=this.source.requestVideoFrameCallback(this._videoFrameRequestCallback))):(this._videoFrameRequestCallbackHandle!==null&&(this.source.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker||(nn.shared.add(this.update,this),this._isConnectedToTicker=!0,this._msToNextUpdate=0)):(this._videoFrameRequestCallbackHandle!==null&&(this.source.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker&&(nn.shared.remove(this.update,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0))}static test(e,t){return globalThis.HTMLVideoElement&&e instanceof HTMLVideoElement||ip.TYPES.includes(t)}};tp.TYPES=["mp4","m4v","webm","ogg","ogv","h264","avi","mov"],tp.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"};let Kw=tp;Xm.push(xa,Sw,iP,Kw,sP,ep,td,nP,tP);class Ql{constructor(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.rect=null,this.updateID=-1}isEmpty(){return this.minX>this.maxX||this.minY>this.maxY}clear(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0}getRectangle(e){return this.minX>this.maxX||this.minY>this.maxY?dt.EMPTY:(e=e||new dt(0,0,1,1),e.x=this.minX,e.y=this.minY,e.width=this.maxX-this.minX,e.height=this.maxY-this.minY,e)}addPoint(e){this.minX=Math.min(this.minX,e.x),this.maxX=Math.max(this.maxX,e.x),this.minY=Math.min(this.minY,e.y),this.maxY=Math.max(this.maxY,e.y)}addPointMatrix(e,t){const{a:i,b:s,c:r,d:o,tx:a,ty:c}=e,l=i*t.x+r*t.y+a,h=s*t.x+o*t.y+c;this.minX=Math.min(this.minX,l),this.maxX=Math.max(this.maxX,l),this.minY=Math.min(this.minY,h),this.maxY=Math.max(this.maxY,h)}addQuad(e){let t=this.minX,i=this.minY,s=this.maxX,r=this.maxY,o=e[0],a=e[1];t=os?o:s,r=a>r?a:r,o=e[2],a=e[3],t=os?o:s,r=a>r?a:r,o=e[4],a=e[5],t=os?o:s,r=a>r?a:r,o=e[6],a=e[7],t=os?o:s,r=a>r?a:r,this.minX=t,this.minY=i,this.maxX=s,this.maxY=r}addFrame(e,t,i,s,r){this.addFrameMatrix(e.worldTransform,t,i,s,r)}addFrameMatrix(e,t,i,s,r){const o=e.a,a=e.b,c=e.c,l=e.d,h=e.tx,u=e.ty;let d=this.minX,f=this.minY,m=this.maxX,p=this.maxY,g=o*t+c*i+h,v=a*t+l*i+u;d=gm?g:m,p=v>p?v:p,g=o*s+c*i+h,v=a*s+l*i+u,d=gm?g:m,p=v>p?v:p,g=o*t+c*r+h,v=a*t+l*r+u,d=gm?g:m,p=v>p?v:p,g=o*s+c*r+h,v=a*s+l*r+u,d=gm?g:m,p=v>p?v:p,this.minX=d,this.minY=f,this.maxX=m,this.maxY=p}addVertexData(e,t,i){let s=this.minX,r=this.minY,o=this.maxX,a=this.maxY;for(let c=t;co?l:o,a=h>a?h:a}this.minX=s,this.minY=r,this.maxX=o,this.maxY=a}addVertices(e,t,i,s){this.addVerticesMatrix(e.worldTransform,t,i,s)}addVerticesMatrix(e,t,i,s,r=0,o=r){const a=e.a,c=e.b,l=e.c,h=e.d,u=e.tx,d=e.ty;let f=this.minX,m=this.minY,p=this.maxX,g=this.maxY;for(let v=i;vs?e.maxX:s,this.maxY=e.maxY>r?e.maxY:r}addBoundsMask(e,t){const i=e.minX>t.minX?e.minX:t.minX,s=e.minY>t.minY?e.minY:t.minY,r=e.maxXl?r:l,this.maxY=o>h?o:h}}addBoundsMatrix(e,t){this.addFrameMatrix(t,e.minX,e.minY,e.maxX,e.maxY)}addBoundsArea(e,t){const i=e.minX>t.x?e.minX:t.x,s=e.minY>t.y?e.minY:t.y,r=e.maxXl?r:l,this.maxY=o>h?o:h}}pad(e=0,t=e){this.isEmpty()||(this.minX-=e,this.maxX+=e,this.minY-=t,this.maxY+=t)}addFramePad(e,t,i,s,r,o){e-=r,t-=o,i+=r,s+=o,this.minX=this.minXi?this.maxX:i,this.minY=this.minYs?this.maxY:s}}class ai extends pc{constructor(){super(),this.tempDisplayObjectParent=null,this.transform=new Eg,this.alpha=1,this.visible=!0,this.renderable=!0,this.cullable=!1,this.cullArea=null,this.parent=null,this.worldAlpha=1,this._lastSortedIndex=0,this._zIndex=0,this.filterArea=null,this.filters=null,this._enabledFilters=null,this._bounds=new Ql,this._localBounds=null,this._boundsID=0,this._boundsRect=null,this._localBoundsRect=null,this._mask=null,this._maskRefCount=0,this._destroyed=!1,this.isSprite=!1,this.isMask=!1}static mixin(e){const t=Object.keys(e);for(let i=0;i1)for(let t=0;tthis.children.length)throw new Error(`${e}addChildAt: The index ${t} supplied is out of bounds ${this.children.length}`);return e.parent&&e.parent.removeChild(e),e.parent=this,this.sortDirty=!0,e.transform._parentID=-1,this.children.splice(t,0,e),this._boundsID++,this.onChildrenChange(t),e.emit("added",this),this.emit("childAdded",e,this,t),e}swapChildren(e,t){if(e===t)return;const i=this.getChildIndex(e),s=this.getChildIndex(t);this.children[i]=t,this.children[s]=e,this.onChildrenChange(i=this.children.length)throw new Error(`The index ${t} supplied is out of bounds ${this.children.length}`);const i=this.getChildIndex(e);Pa(this.children,i,1),this.children.splice(t,0,e),this.onChildrenChange(t)}getChildAt(e){if(e<0||e>=this.children.length)throw new Error(`getChildAt: Index (${e}) does not exist.`);return this.children[e]}removeChild(...e){if(e.length>1)for(let t=0;t0&&r<=s){o=this.children.splice(i,r);for(let a=0;a1&&this.children.sort(aP),this.sortDirty=!1}updateTransform(){this.sortableChildren&&this.sortDirty&&this.sortChildren(),this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha;for(let e=0,t=this.children.length;e0&&t.height>0))return;let i,s;this.cullArea?(i=this.cullArea,s=this.worldTransform):this._render!==np.prototype._render&&(i=this.getBounds(!0));const r=e.projection.transform;if(r&&(s?(s=oP.copyFrom(s),s.prepend(r)):s=r),i&&t.intersects(i,s))this._render(e);else if(this.cullArea)return;for(let o=0,a=this.children.length;o=s&&fl.x=r&&fl.y=t&&(o=n-a-1),c=c.replace("%value%",e[o].toString()),s+=c,s+=` +`}return i=i.replace("%blur%",s),i=i.replace("%size%",n.toString()),i}const pP=` + attribute vec2 aVertexPosition; + + uniform mat3 projectionMatrix; + + uniform float strength; + + varying vec2 vBlurTexCoords[%size%]; + + uniform vec4 inputSize; + uniform vec4 outputFrame; + + vec4 filterVertexPosition( void ) + { + vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy; + + return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0); + } + + vec2 filterTextureCoord( void ) + { + return aVertexPosition * (outputFrame.zw * inputSize.zw); + } + + void main(void) + { + gl_Position = filterVertexPosition(); + + vec2 textureCoord = filterTextureCoord(); + %blur% + }`;function gP(n,e){const t=Math.ceil(n/2);let i=pP,s="",r;e?r="vBlurTexCoords[%index%] = textureCoord + vec2(%sampleIndex% * strength, 0.0);":r="vBlurTexCoords[%index%] = textureCoord + vec2(0.0, %sampleIndex% * strength);";for(let o=0;o 0.0) { + c.rgb /= c.a; + } + + vec4 result; + + result.r = (m[0] * c.r); + result.r += (m[1] * c.g); + result.r += (m[2] * c.b); + result.r += (m[3] * c.a); + result.r += m[4]; + + result.g = (m[5] * c.r); + result.g += (m[6] * c.g); + result.g += (m[7] * c.b); + result.g += (m[8] * c.a); + result.g += m[9]; + + result.b = (m[10] * c.r); + result.b += (m[11] * c.g); + result.b += (m[12] * c.b); + result.b += (m[13] * c.a); + result.b += m[14]; + + result.a = (m[15] * c.r); + result.a += (m[16] * c.g); + result.a += (m[17] * c.b); + result.a += (m[18] * c.a); + result.a += m[19]; + + vec3 rgb = mix(c.rgb, result.rgb, uAlpha); + + // Premultiply alpha again. + rgb *= result.a; + + gl_FragColor = vec4(rgb, result.a); +} +`;class rp extends tn{constructor(){const e={m:new Float32Array([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0]),uAlpha:1};super(Gw,yP,e),this.alpha=1}_loadMatrix(e,t=!1){let i=e;t&&(this._multiply(i,this.uniforms.m,e),i=this._colorMatrix(i)),this.uniforms.m=i}_multiply(e,t,i){return e[0]=t[0]*i[0]+t[1]*i[5]+t[2]*i[10]+t[3]*i[15],e[1]=t[0]*i[1]+t[1]*i[6]+t[2]*i[11]+t[3]*i[16],e[2]=t[0]*i[2]+t[1]*i[7]+t[2]*i[12]+t[3]*i[17],e[3]=t[0]*i[3]+t[1]*i[8]+t[2]*i[13]+t[3]*i[18],e[4]=t[0]*i[4]+t[1]*i[9]+t[2]*i[14]+t[3]*i[19]+t[4],e[5]=t[5]*i[0]+t[6]*i[5]+t[7]*i[10]+t[8]*i[15],e[6]=t[5]*i[1]+t[6]*i[6]+t[7]*i[11]+t[8]*i[16],e[7]=t[5]*i[2]+t[6]*i[7]+t[7]*i[12]+t[8]*i[17],e[8]=t[5]*i[3]+t[6]*i[8]+t[7]*i[13]+t[8]*i[18],e[9]=t[5]*i[4]+t[6]*i[9]+t[7]*i[14]+t[8]*i[19]+t[9],e[10]=t[10]*i[0]+t[11]*i[5]+t[12]*i[10]+t[13]*i[15],e[11]=t[10]*i[1]+t[11]*i[6]+t[12]*i[11]+t[13]*i[16],e[12]=t[10]*i[2]+t[11]*i[7]+t[12]*i[12]+t[13]*i[17],e[13]=t[10]*i[3]+t[11]*i[8]+t[12]*i[13]+t[13]*i[18],e[14]=t[10]*i[4]+t[11]*i[9]+t[12]*i[14]+t[13]*i[19]+t[14],e[15]=t[15]*i[0]+t[16]*i[5]+t[17]*i[10]+t[18]*i[15],e[16]=t[15]*i[1]+t[16]*i[6]+t[17]*i[11]+t[18]*i[16],e[17]=t[15]*i[2]+t[16]*i[7]+t[17]*i[12]+t[18]*i[17],e[18]=t[15]*i[3]+t[16]*i[8]+t[17]*i[13]+t[18]*i[18],e[19]=t[15]*i[4]+t[16]*i[9]+t[17]*i[14]+t[18]*i[19]+t[19],e}_colorMatrix(e){const t=new Float32Array(e);return t[4]/=255,t[9]/=255,t[14]/=255,t[19]/=255,t}brightness(e,t){const i=[e,0,0,0,0,0,e,0,0,0,0,0,e,0,0,0,0,0,1,0];this._loadMatrix(i,t)}tint(e,t){const[i,s,r]=kt.shared.setValue(e).toArray(),o=[i,0,0,0,0,0,s,0,0,0,0,0,r,0,0,0,0,0,1,0];this._loadMatrix(o,t)}greyscale(e,t){const i=[e,e,e,0,0,e,e,e,0,0,e,e,e,0,0,0,0,0,1,0];this._loadMatrix(i,t)}blackAndWhite(e){const t=[.3,.6,.1,0,0,.3,.6,.1,0,0,.3,.6,.1,0,0,0,0,0,1,0];this._loadMatrix(t,e)}hue(e,t){e=(e||0)/180*Math.PI;const i=Math.cos(e),s=Math.sin(e),r=Math.sqrt,o=1/3,a=r(o),c=i+(1-i)*o,l=o*(1-i)-a*s,h=o*(1-i)+a*s,u=o*(1-i)+a*s,d=i+o*(1-i),f=o*(1-i)-a*s,m=o*(1-i)-a*s,p=o*(1-i)+a*s,g=i+o*(1-i),v=[c,l,h,0,0,u,d,f,0,0,m,p,g,0,0,0,0,0,1,0];this._loadMatrix(v,t)}contrast(e,t){const i=(e||0)+1,s=-.5*(i-1),r=[i,0,0,0,s,0,i,0,0,s,0,0,i,0,s,0,0,0,1,0];this._loadMatrix(r,t)}saturate(e=0,t){const i=e*2/3+1,s=(i-1)*-.5,r=[i,s,s,0,0,s,i,s,0,0,s,s,i,0,0,0,0,0,1,0];this._loadMatrix(r,t)}desaturate(){this.saturate(-1)}negative(e){const t=[-1,0,0,1,0,0,-1,0,1,0,0,0,-1,1,0,0,0,0,1,0];this._loadMatrix(t,e)}sepia(e){const t=[.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0];this._loadMatrix(t,e)}technicolor(e){const t=[1.9125277891456083,-.8545344976951645,-.09155508482755585,0,11.793603434377337,-.3087833385928097,1.7658908555458428,-.10601743074722245,0,-70.35205161461398,-.231103377548616,-.7501899197440212,1.847597816108189,0,30.950940869491138,0,0,0,1,0];this._loadMatrix(t,e)}polaroid(e){const t=[1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0];this._loadMatrix(t,e)}toBGR(e){const t=[0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0];this._loadMatrix(t,e)}kodachrome(e){const t=[1.1285582396593525,-.3967382283601348,-.03992559172921793,0,63.72958762196502,-.16404339962244616,1.0835251566291304,-.05498805115633132,0,24.732407896706203,-.16786010706155763,-.5603416277695248,1.6014850761964943,0,35.62982807460946,0,0,0,1,0];this._loadMatrix(t,e)}browni(e){const t=[.5997023498159715,.34553243048391263,-.2708298674538042,0,47.43192855600873,-.037703249837783157,.8609577587992641,.15059552388459913,0,-36.96841498319127,.24113635128153335,-.07441037908422492,.44972182064877153,0,-7.562075277591283,0,0,0,1,0];this._loadMatrix(t,e)}vintage(e){const t=[.6279345635605994,.3202183420819367,-.03965408211312453,0,9.651285835294123,.02578397704808868,.6441188644374771,.03259127616149294,0,7.462829176470591,.0466055556782719,-.0851232987247891,.5241648018700465,0,5.159190588235296,0,0,0,1,0];this._loadMatrix(t,e)}colorTone(e,t,i,s,r){e=e||.2,t=t||.15,i=i||16770432,s=s||3375104;const o=kt.shared,[a,c,l]=o.setValue(i).toArray(),[h,u,d]=o.setValue(s).toArray(),f=[.3,.59,.11,0,0,a,c,l,e,0,h,u,d,t,0,a-h,c-u,l-d,0,0];this._loadMatrix(f,r)}night(e,t){e=e||.1;const i=[e*-2,-e,0,0,0,-e,0,e,0,0,0,e,e*2,0,0,0,0,0,1,0];this._loadMatrix(i,t)}predator(e,t){const i=[11.224130630493164*e,-4.794486999511719*e,-2.8746118545532227*e,0*e,.40342438220977783*e,-3.6330697536468506*e,9.193157196044922*e,-2.951810836791992*e,0*e,-1.316135048866272*e,-3.2184197902679443*e,-4.2375030517578125*e,7.476448059082031*e,0*e,.8044459223747253*e,0,0,0,1,0];this._loadMatrix(i,t)}lsd(e){const t=[2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0];this._loadMatrix(t,e)}reset(){const e=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0];this._loadMatrix(e,!1)}get matrix(){return this.uniforms.m}set matrix(e){this.uniforms.m=e}get alpha(){return this.uniforms.uAlpha}set alpha(e){this.uniforms.uAlpha=e}}rp.prototype.grayscale=rp.prototype.greyscale;var bP=`varying vec2 vFilterCoord; +varying vec2 vTextureCoord; + +uniform vec2 scale; +uniform mat2 rotation; +uniform sampler2D uSampler; +uniform sampler2D mapSampler; + +uniform highp vec4 inputSize; +uniform vec4 inputClamp; + +void main(void) +{ + vec4 map = texture2D(mapSampler, vFilterCoord); + + map -= 0.5; + map.xy = scale * inputSize.zw * (rotation * map.xy); + + gl_FragColor = texture2D(uSampler, clamp(vec2(vTextureCoord.x + map.x, vTextureCoord.y + map.y), inputClamp.xy, inputClamp.zw)); +} +`,xP=`attribute vec2 aVertexPosition; + +uniform mat3 projectionMatrix; +uniform mat3 filterMatrix; + +varying vec2 vTextureCoord; +varying vec2 vFilterCoord; + +uniform vec4 inputSize; +uniform vec4 outputFrame; + +vec4 filterVertexPosition( void ) +{ + vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy; + + return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0); +} + +vec2 filterTextureCoord( void ) +{ + return aVertexPosition * (outputFrame.zw * inputSize.zw); +} + +void main(void) +{ + gl_Position = filterVertexPosition(); + vTextureCoord = filterTextureCoord(); + vFilterCoord = ( filterMatrix * vec3( vTextureCoord, 1.0) ).xy; +} +`;class wP extends tn{constructor(e,t){const i=new Bt;e.renderable=!1,super(xP,bP,{mapSampler:e._texture,filterMatrix:i,scale:{x:1,y:1},rotation:new Float32Array([1,0,0,1])}),this.maskSprite=e,this.maskMatrix=i,t==null&&(t=20),this.scale=new Tt(t,t)}apply(e,t,i,s){this.uniforms.filterMatrix=e.calculateSpriteMatrix(this.maskMatrix,this.maskSprite),this.uniforms.scale.x=this.scale.x,this.uniforms.scale.y=this.scale.y;const r=this.maskSprite.worldTransform,o=Math.sqrt(r.a*r.a+r.b*r.b),a=Math.sqrt(r.c*r.c+r.d*r.d);o!==0&&a!==0&&(this.uniforms.rotation[0]=r.a/o,this.uniforms.rotation[1]=r.b/o,this.uniforms.rotation[2]=r.c/a,this.uniforms.rotation[3]=r.d/a),e.applyFilter(this,t,i,s)}get map(){return this.uniforms.mapSampler}set map(e){this.uniforms.mapSampler=e}}var SP=`varying vec2 v_rgbNW; +varying vec2 v_rgbNE; +varying vec2 v_rgbSW; +varying vec2 v_rgbSE; +varying vec2 v_rgbM; + +varying vec2 vFragCoord; +uniform sampler2D uSampler; +uniform highp vec4 inputSize; + + +/** + Basic FXAA implementation based on the code on geeks3d.com with the + modification that the texture2DLod stuff was removed since it's + unsupported by WebGL. + + -- + + From: + https://github.com/mitsuhiko/webgl-meincraft + + Copyright (c) 2011 by Armin Ronacher. + + Some rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + + * The names of the contributors may not be used to endorse or + promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef FXAA_REDUCE_MIN +#define FXAA_REDUCE_MIN (1.0/ 128.0) +#endif +#ifndef FXAA_REDUCE_MUL +#define FXAA_REDUCE_MUL (1.0 / 8.0) +#endif +#ifndef FXAA_SPAN_MAX +#define FXAA_SPAN_MAX 8.0 +#endif + +//optimized version for mobile, where dependent +//texture reads can be a bottleneck +vec4 fxaa(sampler2D tex, vec2 fragCoord, vec2 inverseVP, + vec2 v_rgbNW, vec2 v_rgbNE, + vec2 v_rgbSW, vec2 v_rgbSE, + vec2 v_rgbM) { + vec4 color; + vec3 rgbNW = texture2D(tex, v_rgbNW).xyz; + vec3 rgbNE = texture2D(tex, v_rgbNE).xyz; + vec3 rgbSW = texture2D(tex, v_rgbSW).xyz; + vec3 rgbSE = texture2D(tex, v_rgbSE).xyz; + vec4 texColor = texture2D(tex, v_rgbM); + vec3 rgbM = texColor.xyz; + vec3 luma = vec3(0.299, 0.587, 0.114); + float lumaNW = dot(rgbNW, luma); + float lumaNE = dot(rgbNE, luma); + float lumaSW = dot(rgbSW, luma); + float lumaSE = dot(rgbSE, luma); + float lumaM = dot(rgbM, luma); + float lumaMin = min(lumaM, min(min(lumaNW, lumaNE), min(lumaSW, lumaSE))); + float lumaMax = max(lumaM, max(max(lumaNW, lumaNE), max(lumaSW, lumaSE))); + + mediump vec2 dir; + dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE)); + dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE)); + + float dirReduce = max((lumaNW + lumaNE + lumaSW + lumaSE) * + (0.25 * FXAA_REDUCE_MUL), FXAA_REDUCE_MIN); + + float rcpDirMin = 1.0 / (min(abs(dir.x), abs(dir.y)) + dirReduce); + dir = min(vec2(FXAA_SPAN_MAX, FXAA_SPAN_MAX), + max(vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX), + dir * rcpDirMin)) * inverseVP; + + vec3 rgbA = 0.5 * ( + texture2D(tex, fragCoord * inverseVP + dir * (1.0 / 3.0 - 0.5)).xyz + + texture2D(tex, fragCoord * inverseVP + dir * (2.0 / 3.0 - 0.5)).xyz); + vec3 rgbB = rgbA * 0.5 + 0.25 * ( + texture2D(tex, fragCoord * inverseVP + dir * -0.5).xyz + + texture2D(tex, fragCoord * inverseVP + dir * 0.5).xyz); + + float lumaB = dot(rgbB, luma); + if ((lumaB < lumaMin) || (lumaB > lumaMax)) + color = vec4(rgbA, texColor.a); + else + color = vec4(rgbB, texColor.a); + return color; +} + +void main() { + + vec4 color; + + color = fxaa(uSampler, vFragCoord, inputSize.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM); + + gl_FragColor = color; +} +`,_P=` +attribute vec2 aVertexPosition; + +uniform mat3 projectionMatrix; + +varying vec2 v_rgbNW; +varying vec2 v_rgbNE; +varying vec2 v_rgbSW; +varying vec2 v_rgbSE; +varying vec2 v_rgbM; + +varying vec2 vFragCoord; + +uniform vec4 inputSize; +uniform vec4 outputFrame; + +vec4 filterVertexPosition( void ) +{ + vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy; + + return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0); +} + +void texcoords(vec2 fragCoord, vec2 inverseVP, + out vec2 v_rgbNW, out vec2 v_rgbNE, + out vec2 v_rgbSW, out vec2 v_rgbSE, + out vec2 v_rgbM) { + v_rgbNW = (fragCoord + vec2(-1.0, -1.0)) * inverseVP; + v_rgbNE = (fragCoord + vec2(1.0, -1.0)) * inverseVP; + v_rgbSW = (fragCoord + vec2(-1.0, 1.0)) * inverseVP; + v_rgbSE = (fragCoord + vec2(1.0, 1.0)) * inverseVP; + v_rgbM = vec2(fragCoord * inverseVP); +} + +void main(void) { + + gl_Position = filterVertexPosition(); + + vFragCoord = aVertexPosition * outputFrame.zw; + + texcoords(vFragCoord, inputSize.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM); +} +`;class TP extends tn{constructor(){super(_P,SP)}}var EP=`precision highp float; + +varying vec2 vTextureCoord; +varying vec4 vColor; + +uniform float uNoise; +uniform float uSeed; +uniform sampler2D uSampler; + +float rand(vec2 co) +{ + return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453); +} + +void main() +{ + vec4 color = texture2D(uSampler, vTextureCoord); + float randomValue = rand(gl_FragCoord.xy * uSeed); + float diff = (randomValue - 0.5) * uNoise; + + // Un-premultiply alpha before applying the color matrix. See issue #3539. + if (color.a > 0.0) { + color.rgb /= color.a; + } + + color.r += diff; + color.g += diff; + color.b += diff; + + // Premultiply alpha again. + color.rgb *= color.a; + + gl_FragColor = color; +} +`;class CP extends tn{constructor(e=.5,t=Math.random()){super(Gw,EP,{uNoise:0,uSeed:0}),this.noise=e,this.seed=t}get noise(){return this.uniforms.uNoise}set noise(e){this.uniforms.uNoise=e}get seed(){return this.uniforms.uSeed}set seed(e){this.uniforms.uSeed=e}}const Iy={AlphaFilter:uP,BlurFilter:vP,BlurFilterPass:sp,ColorMatrixFilter:rp,DisplacementFilter:wP,FXAAFilter:TP,NoiseFilter:CP};Object.entries(Iy).forEach(([n,e])=>{Object.defineProperty(Iy,n,{get(){return pt("7.1.0",`filters.${n} has moved to ${n}`),e}})});class MP{constructor(){this.interactionFrequency=10,this._deltaTime=0,this._didMove=!1,this.tickerAdded=!1,this._pauseUpdate=!0}init(e){this.removeTickerListener(),this.events=e,this.interactionFrequency=10,this._deltaTime=0,this._didMove=!1,this.tickerAdded=!1,this._pauseUpdate=!0}get pauseUpdate(){return this._pauseUpdate}set pauseUpdate(e){this._pauseUpdate=e}addTickerListener(){this.tickerAdded||!this.domElement||(nn.system.add(this.tickerUpdate,this,Uo.INTERACTION),this.tickerAdded=!0)}removeTickerListener(){this.tickerAdded&&(nn.system.remove(this.tickerUpdate,this),this.tickerAdded=!1)}pointerMoved(){this._didMove=!0}update(){if(!this.domElement||this._pauseUpdate)return;if(this._didMove){this._didMove=!1;return}const e=this.events.rootPointerEvent;this.events.supportsTouchEvents&&e.pointerType==="touch"||globalThis.document.dispatchEvent(new PointerEvent("pointermove",{clientX:e.clientX,clientY:e.clientY}))}tickerUpdate(e){this._deltaTime+=e,!(this._deltaTimei.priority-s.priority)}dispatchEvent(e,t){e.propagationStopped=!1,e.propagationImmediatelyStopped=!1,this.propagate(e,t),this.dispatch.emit(t||e.type,e)}mapEvent(e){if(!this.rootTarget)return;const t=this.mappingTable[e.type];if(t)for(let i=0,s=t.length;i=0;s--)if(e.currentTarget=i[s],this.notifyTarget(e,t),e.propagationStopped||e.propagationImmediatelyStopped)return}}all(e,t,i=this._allInteractiveElements){if(i.length===0)return;e.eventPhase=e.BUBBLING_PHASE;const s=Array.isArray(t)?t:[t];for(let r=i.length-1;r>=0;r--)s.forEach(o=>{e.currentTarget=i[r],this.notifyTarget(e,o)})}propagationPath(e){const t=[e];for(let i=0;i=0;u--){const d=h[u],f=this.hitTestMoveRecursive(d,this._isInteractive(t)?t:d.eventMode,i,s,r,o||r(e,i));if(f){if(f.length>0&&!f[f.length-1].parent)continue;const m=e.isInteractive();(f.length>0||m)&&(m&&this._allInteractiveElements.push(e),f.push(e)),this._hitElements.length===0&&(this._hitElements=f),a=!0}}}const c=this._isInteractive(t),l=e.isInteractive();return c&&l&&this._allInteractiveElements.push(e),o||this._hitElements.length>0?null:a?this._hitElements:c&&!r(e,i)&&s(e,i)?l?[e]:[]:null}hitTestRecursive(e,t,i,s,r){if(this._interactivePrune(e)||r(e,i))return null;if((e.eventMode==="dynamic"||t==="dynamic")&&(Nr.pauseUpdate=!1),e.interactiveChildren&&e.children){const c=e.children;for(let l=c.length-1;l>=0;l--){const h=c[l],u=this.hitTestRecursive(h,this._isInteractive(t)?t:h.eventMode,i,s,r);if(u){if(u.length>0&&!u[u.length-1].parent)continue;const d=e.isInteractive();return(u.length>0||d)&&u.push(e),u}}}const o=this._isInteractive(t),a=e.isInteractive();return o&&s(e,i)?a?[e]:[]:null}_isInteractive(e){return e==="static"||e==="dynamic"}_interactivePrune(e){return!!(!e||e.isMask||!e.visible||!e.renderable||e.eventMode==="none"||e.eventMode==="passive"&&!e.interactiveChildren||e.isMask)}hitPruneFn(e,t){var i;if(e.hitArea&&(e.worldTransform.applyInverse(t,jf),!e.hitArea.contains(jf.x,jf.y)))return!0;if(e._mask){const s=e._mask.isMaskData?e._mask.maskObject:e._mask;if(s&&!((i=s.containsPoint)!=null&&i.call(s,t)))return!0}return!1}hitTestFn(e,t){return e.eventMode==="passive"?!1:e.hitArea?!0:e.containsPoint?e.containsPoint(t):!1}notifyTarget(e,t){var r,o;t=t??e.type;const i=`on${t}`;(o=(r=e.currentTarget)[i])==null||o.call(r,e);const s=e.eventPhase===e.CAPTURING_PHASE||e.eventPhase===e.AT_TARGET?`${t}capture`:t;this.notifyListeners(e,s),e.eventPhase===e.AT_TARGET&&this.notifyListeners(e,t)}mapPointerDown(e){if(!(e instanceof Yn)){console.warn("EventBoundary cannot map a non-pointer event as a pointer event");return}const t=this.createPointerEvent(e);if(this.dispatchEvent(t,"pointerdown"),t.pointerType==="touch")this.dispatchEvent(t,"touchstart");else if(t.pointerType==="mouse"||t.pointerType==="pen"){const s=t.button===2;this.dispatchEvent(t,s?"rightdown":"mousedown")}const i=this.trackingData(e.pointerId);i.pressTargetsByButton[e.button]=t.composedPath(),this.freeEvent(t)}mapPointerMove(e){var c,l;if(!(e instanceof Yn)){console.warn("EventBoundary cannot map a non-pointer event as a pointer event");return}this._allInteractiveElements.length=0,this._hitElements.length=0,this._isPointerMoveEvent=!0;const t=this.createPointerEvent(e);this._isPointerMoveEvent=!1;const i=t.pointerType==="mouse"||t.pointerType==="pen",s=this.trackingData(e.pointerId),r=this.findMountedTarget(s.overTargets);if(((c=s.overTargets)==null?void 0:c.length)>0&&r!==t.target){const h=e.type==="mousemove"?"mouseout":"pointerout",u=this.createPointerEvent(e,h,r);if(this.dispatchEvent(u,"pointerout"),i&&this.dispatchEvent(u,"mouseout"),!t.composedPath().includes(r)){const d=this.createPointerEvent(e,"pointerleave",r);for(d.eventPhase=d.AT_TARGET;d.target&&!t.composedPath().includes(d.target);)d.currentTarget=d.target,this.notifyTarget(d),i&&this.notifyTarget(d,"mouseleave"),d.target=d.target.parent;this.freeEvent(d)}this.freeEvent(u)}if(r!==t.target){const h=e.type==="mousemove"?"mouseover":"pointerover",u=this.clonePointerEvent(t,h);this.dispatchEvent(u,"pointerover"),i&&this.dispatchEvent(u,"mouseover");let d=r==null?void 0:r.parent;for(;d&&d!==this.rootTarget.parent&&d!==t.target;)d=d.parent;if(!d||d===this.rootTarget.parent){const f=this.clonePointerEvent(t,"pointerenter");for(f.eventPhase=f.AT_TARGET;f.target&&f.target!==r&&f.target!==this.rootTarget.parent;)f.currentTarget=f.target,this.notifyTarget(f),i&&this.notifyTarget(f,"mouseenter"),f.target=f.target.parent;this.freeEvent(f)}this.freeEvent(u)}const o=[],a=this.enableGlobalMoveEvents??!0;this.moveOnAll?o.push("pointermove"):this.dispatchEvent(t,"pointermove"),a&&o.push("globalpointermove"),t.pointerType==="touch"&&(this.moveOnAll?o.splice(1,0,"touchmove"):this.dispatchEvent(t,"touchmove"),a&&o.push("globaltouchmove")),i&&(this.moveOnAll?o.splice(1,0,"mousemove"):this.dispatchEvent(t,"mousemove"),a&&o.push("globalmousemove"),this.cursor=(l=t.target)==null?void 0:l.cursor),o.length>0&&this.all(t,o),this._allInteractiveElements.length=0,this._hitElements.length=0,s.overTargets=t.composedPath(),this.freeEvent(t)}mapPointerOver(e){var o;if(!(e instanceof Yn)){console.warn("EventBoundary cannot map a non-pointer event as a pointer event");return}const t=this.trackingData(e.pointerId),i=this.createPointerEvent(e),s=i.pointerType==="mouse"||i.pointerType==="pen";this.dispatchEvent(i,"pointerover"),s&&this.dispatchEvent(i,"mouseover"),i.pointerType==="mouse"&&(this.cursor=(o=i.target)==null?void 0:o.cursor);const r=this.clonePointerEvent(i,"pointerenter");for(r.eventPhase=r.AT_TARGET;r.target&&r.target!==this.rootTarget.parent;)r.currentTarget=r.target,this.notifyTarget(r),s&&this.notifyTarget(r,"mouseenter"),r.target=r.target.parent;t.overTargets=i.composedPath(),this.freeEvent(i),this.freeEvent(r)}mapPointerOut(e){if(!(e instanceof Yn)){console.warn("EventBoundary cannot map a non-pointer event as a pointer event");return}const t=this.trackingData(e.pointerId);if(t.overTargets){const i=e.pointerType==="mouse"||e.pointerType==="pen",s=this.findMountedTarget(t.overTargets),r=this.createPointerEvent(e,"pointerout",s);this.dispatchEvent(r),i&&this.dispatchEvent(r,"mouseout");const o=this.createPointerEvent(e,"pointerleave",s);for(o.eventPhase=o.AT_TARGET;o.target&&o.target!==this.rootTarget.parent;)o.currentTarget=o.target,this.notifyTarget(o),i&&this.notifyTarget(o,"mouseleave"),o.target=o.target.parent;t.overTargets=null,this.freeEvent(r),this.freeEvent(o)}this.cursor=null}mapPointerUp(e){if(!(e instanceof Yn)){console.warn("EventBoundary cannot map a non-pointer event as a pointer event");return}const t=performance.now(),i=this.createPointerEvent(e);if(this.dispatchEvent(i,"pointerup"),i.pointerType==="touch")this.dispatchEvent(i,"touchend");else if(i.pointerType==="mouse"||i.pointerType==="pen"){const a=i.button===2;this.dispatchEvent(i,a?"rightup":"mouseup")}const s=this.trackingData(e.pointerId),r=this.findMountedTarget(s.pressTargetsByButton[e.button]);let o=r;if(r&&!i.composedPath().includes(r)){let a=r;for(;a&&!i.composedPath().includes(a);){if(i.currentTarget=a,this.notifyTarget(i,"pointerupoutside"),i.pointerType==="touch")this.notifyTarget(i,"touchendoutside");else if(i.pointerType==="mouse"||i.pointerType==="pen"){const c=i.button===2;this.notifyTarget(i,c?"rightupoutside":"mouseupoutside")}a=a.parent}delete s.pressTargetsByButton[e.button],o=a}if(o){const a=this.clonePointerEvent(i,"click");a.target=o,a.path=null,s.clicksByButton[e.button]||(s.clicksByButton[e.button]={clickCount:0,target:a.target,timeStamp:t});const c=s.clicksByButton[e.button];if(c.target===a.target&&t-c.timeStamp<200?++c.clickCount:c.clickCount=1,c.target=a.target,c.timeStamp=t,a.detail=c.clickCount,a.pointerType==="mouse"){const l=a.button===2;this.dispatchEvent(a,l?"rightclick":"click")}else a.pointerType==="touch"&&this.dispatchEvent(a,"tap");this.dispatchEvent(a,"pointertap"),this.freeEvent(a)}this.freeEvent(i)}mapPointerUpOutside(e){if(!(e instanceof Yn)){console.warn("EventBoundary cannot map a non-pointer event as a pointer event");return}const t=this.trackingData(e.pointerId),i=this.findMountedTarget(t.pressTargetsByButton[e.button]),s=this.createPointerEvent(e);if(i){let r=i;for(;r;)s.currentTarget=r,this.notifyTarget(s,"pointerupoutside"),s.pointerType==="touch"?this.notifyTarget(s,"touchendoutside"):(s.pointerType==="mouse"||s.pointerType==="pen")&&this.notifyTarget(s,s.button===2?"rightupoutside":"mouseupoutside"),r=r.parent;delete t.pressTargetsByButton[e.button]}this.freeEvent(s)}mapWheel(e){if(!(e instanceof ka)){console.warn("EventBoundary cannot map a non-wheel event as a wheel event");return}const t=this.createWheelEvent(e);this.dispatchEvent(t),this.freeEvent(t)}findMountedTarget(e){if(!e)return null;let t=e[0];for(let i=1;i(i==="globalMove"&&(this.rootBoundary.enableGlobalMoveEvents=s),t[i]=s,!0)}),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onPointerOverOut=this.onPointerOverOut.bind(this),this.onWheel=this.onWheel.bind(this)}static get defaultEventMode(){return this._defaultEventMode}init(e){const{view:t,resolution:i}=this.renderer;this.setTargetElement(t),this.resolution=i,ap._defaultEventMode=e.eventMode??"auto",Object.assign(this.features,e.eventFeatures??{}),this.rootBoundary.enableGlobalMoveEvents=this.features.globalMove}resolutionChange(e){this.resolution=e}destroy(){this.setTargetElement(null),this.renderer=null}setCursor(e){e=e||"default";let t=!0;if(globalThis.OffscreenCanvas&&this.domElement instanceof OffscreenCanvas&&(t=!1),this.currentCursor===e)return;this.currentCursor=e;const i=this.cursorStyles[e];if(i)switch(typeof i){case"string":t&&(this.domElement.style.cursor=i);break;case"function":i(e);break;case"object":t&&Object.assign(this.domElement.style,i);break}else t&&typeof e=="string"&&!Object.prototype.hasOwnProperty.call(this.cursorStyles,e)&&(this.domElement.style.cursor=e)}get pointer(){return this.rootPointerEvent}onPointerDown(e){if(!this.features.click)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered;const t=this.normalizeToPointerData(e);this.autoPreventDefault&&t[0].isNormalized&&(e.cancelable||!("cancelable"in e))&&e.preventDefault();for(let i=0,s=t.length;i0&&(t=e.composedPath()[0]);const i=t!==this.domElement?"outside":"",s=this.normalizeToPointerData(e);for(let r=0,o=s.length;r"u"&&(r.button=0),typeof r.buttons>"u"&&(r.buttons=1),typeof r.isPrimary>"u"&&(r.isPrimary=e.touches.length===1&&e.type==="touchstart"),typeof r.width>"u"&&(r.width=r.radiusX||1),typeof r.height>"u"&&(r.height=r.radiusY||1),typeof r.tiltX>"u"&&(r.tiltX=0),typeof r.tiltY>"u"&&(r.tiltY=0),typeof r.pointerType>"u"&&(r.pointerType="touch"),typeof r.pointerId>"u"&&(r.pointerId=r.identifier||0),typeof r.pressure>"u"&&(r.pressure=r.force||.5),typeof r.twist>"u"&&(r.twist=0),typeof r.tangentialPressure>"u"&&(r.tangentialPressure=0),typeof r.layerX>"u"&&(r.layerX=r.offsetX=r.clientX),typeof r.layerY>"u"&&(r.layerY=r.offsetY=r.clientY),r.isNormalized=!0,r.type=e.type,t.push(r)}else if(!globalThis.MouseEvent||e instanceof MouseEvent&&(!this.supportsPointerEvents||!(e instanceof globalThis.PointerEvent))){const i=e;typeof i.isPrimary>"u"&&(i.isPrimary=!0),typeof i.width>"u"&&(i.width=1),typeof i.height>"u"&&(i.height=1),typeof i.tiltX>"u"&&(i.tiltX=0),typeof i.tiltY>"u"&&(i.tiltY=0),typeof i.pointerType>"u"&&(i.pointerType="mouse"),typeof i.pointerId>"u"&&(i.pointerId=RP),typeof i.pressure>"u"&&(i.pressure=.5),typeof i.twist>"u"&&(i.twist=0),typeof i.tangentialPressure>"u"&&(i.tangentialPressure=0),i.isNormalized=!0,t.push(i)}else t.push(e);return t}normalizeWheelEvent(e){const t=this.rootWheelEvent;return this.transferMouseData(t,e),t.deltaX=e.deltaX,t.deltaY=e.deltaY,t.deltaZ=e.deltaZ,t.deltaMode=e.deltaMode,this.mapPositionToPoint(t.screen,e.clientX,e.clientY),t.global.copyFrom(t.screen),t.offset.copyFrom(t.screen),t.nativeEvent=e,t.type=e.type,t}bootstrapEvent(e,t){return e.originalEvent=null,e.nativeEvent=t,e.pointerId=t.pointerId,e.width=t.width,e.height=t.height,e.isPrimary=t.isPrimary,e.pointerType=t.pointerType,e.pressure=t.pressure,e.tangentialPressure=t.tangentialPressure,e.tiltX=t.tiltX,e.tiltY=t.tiltY,e.twist=t.twist,this.transferMouseData(e,t),this.mapPositionToPoint(e.screen,t.clientX,t.clientY),e.global.copyFrom(e.screen),e.offset.copyFrom(e.screen),e.isTrusted=t.isTrusted,e.type==="pointerleave"&&(e.type="pointerout"),e.type.startsWith("mouse")&&(e.type=e.type.replace("mouse","pointer")),e.type.startsWith("touch")&&(e.type=kP[e.type]||e.type),e}transferMouseData(e,t){e.isTrusted=t.isTrusted,e.srcElement=t.srcElement,e.timeStamp=performance.now(),e.type=t.type,e.altKey=t.altKey,e.button=t.button,e.buttons=t.buttons,e.client.x=t.clientX,e.client.y=t.clientY,e.ctrlKey=t.ctrlKey,e.metaKey=t.metaKey,e.movement.x=t.movementX,e.movement.y=t.movementY,e.page.x=t.pageX,e.page.y=t.pageY,e.relatedTarget=null,e.shiftKey=t.shiftKey}};op.extension={name:"events",type:[$e.RendererSystem,$e.CanvasRendererSystem]},op.defaultEventFeatures={move:!0,globalMove:!0,click:!0,wheel:!0};let lp=op;je.add(lp);function Py(n){return n==="dynamic"||n==="static"}const FP={onclick:null,onmousedown:null,onmouseenter:null,onmouseleave:null,onmousemove:null,onglobalmousemove:null,onmouseout:null,onmouseover:null,onmouseup:null,onmouseupoutside:null,onpointercancel:null,onpointerdown:null,onpointerenter:null,onpointerleave:null,onpointermove:null,onglobalpointermove:null,onpointerout:null,onpointerover:null,onpointertap:null,onpointerup:null,onpointerupoutside:null,onrightclick:null,onrightdown:null,onrightup:null,onrightupoutside:null,ontap:null,ontouchcancel:null,ontouchend:null,ontouchendoutside:null,ontouchmove:null,onglobaltouchmove:null,ontouchstart:null,onwheel:null,_internalInteractive:void 0,get interactive(){return this._internalInteractive??Py(lp.defaultEventMode)},set interactive(n){pt("7.2.0","Setting interactive is deprecated, use eventMode = 'none'/'passive'/'auto'/'static'/'dynamic' instead."),this._internalInteractive=n,this.eventMode=n?"static":"auto"},_internalEventMode:void 0,get eventMode(){return this._internalEventMode??lp.defaultEventMode},set eventMode(n){this._internalInteractive=Py(n),this._internalEventMode=n},isInteractive(){return this.eventMode==="static"||this.eventMode==="dynamic"},interactiveChildren:!0,hitArea:null,addEventListener(n,e,t){const i=typeof t=="boolean"&&t||typeof t=="object"&&t.capture,s=typeof t=="object"?t.signal:void 0,r=typeof t=="object"?t.once===!0:!1,o=typeof e=="function"?void 0:e;n=i?`${n}capture`:n;const a=typeof e=="function"?e:e.handleEvent,c=this;s&&s.addEventListener("abort",()=>{c.off(n,a,o)}),r?c.once(n,a,o):c.on(n,a,o)},removeEventListener(n,e,t){const i=typeof t=="boolean"&&t||typeof t=="object"&&t.capture,s=typeof e=="function"?void 0:e;n=i?`${n}capture`:n,e=typeof e=="function"?e:e.handleEvent,this.off(n,e,s)},dispatchEvent(n){if(!(n instanceof gc))throw new Error("DisplayObject cannot propagate events outside of the Federated Events API");return n.defaultPrevented=!1,n.path=null,n.target=this,n.manager.dispatchEvent(n),!n.defaultPrevented}};ai.mixin(FP);const LP={accessible:!1,accessibleTitle:null,accessibleHint:null,tabIndex:0,_accessibleActive:!1,_accessibleDiv:null,accessibleType:"button",accessiblePointerEvents:"auto",accessibleChildren:!0,renderId:-1};ai.mixin(LP);const OP=9,Gc=100,$P=0,NP=0,Ry=2,ky=1,DP=-1e3,BP=-1e3,UP=2;class Qw{constructor(e){this.debug=!1,this._isActive=!1,this._isMobileAccessibility=!1,this.pool=[],this.renderId=0,this.children=[],this.androidUpdateCount=0,this.androidUpdateFrequency=500,this._hookDiv=null,(Ks.tablet||Ks.phone)&&this.createTouchHook();const t=document.createElement("div");t.style.width=`${Gc}px`,t.style.height=`${Gc}px`,t.style.position="absolute",t.style.top=`${$P}px`,t.style.left=`${NP}px`,t.style.zIndex=Ry.toString(),this.div=t,this.renderer=e,this._onKeyDown=this._onKeyDown.bind(this),this._onMouseMove=this._onMouseMove.bind(this),globalThis.addEventListener("keydown",this._onKeyDown,!1)}get isActive(){return this._isActive}get isMobileAccessibility(){return this._isMobileAccessibility}createTouchHook(){const e=document.createElement("button");e.style.width=`${ky}px`,e.style.height=`${ky}px`,e.style.position="absolute",e.style.top=`${DP}px`,e.style.left=`${BP}px`,e.style.zIndex=UP.toString(),e.style.backgroundColor="#FF0000",e.title="select to enable accessibility for this content",e.addEventListener("focus",()=>{this._isMobileAccessibility=!0,this.activate(),this.destroyTouchHook()}),document.body.appendChild(e),this._hookDiv=e}destroyTouchHook(){this._hookDiv&&(document.body.removeChild(this._hookDiv),this._hookDiv=null)}activate(){var e;this._isActive||(this._isActive=!0,globalThis.document.addEventListener("mousemove",this._onMouseMove,!0),globalThis.removeEventListener("keydown",this._onKeyDown,!1),this.renderer.on("postrender",this.update,this),(e=this.renderer.view.parentNode)==null||e.appendChild(this.div))}deactivate(){var e;!this._isActive||this._isMobileAccessibility||(this._isActive=!1,globalThis.document.removeEventListener("mousemove",this._onMouseMove,!0),globalThis.addEventListener("keydown",this._onKeyDown,!1),this.renderer.off("postrender",this.update),(e=this.div.parentNode)==null||e.removeChild(this.div))}updateAccessibleObjects(e){if(!e.visible||!e.accessibleChildren)return;e.accessible&&e.isInteractive()&&(e._accessibleActive||this.addChild(e),e.renderId=this.renderId);const t=e.children;if(t)for(let i=0;i title : ${e.title}
tabIndex: ${e.tabIndex}`}capHitArea(e){e.x<0&&(e.width+=e.x,e.x=0),e.y<0&&(e.height+=e.y,e.y=0);const{width:t,height:i}=this.renderer;e.x+e.width>t&&(e.width=t-e.x),e.y+e.height>i&&(e.height=i-e.y)}addChild(e){let t=this.pool.pop();t||(t=document.createElement("button"),t.style.width=`${Gc}px`,t.style.height=`${Gc}px`,t.style.backgroundColor=this.debug?"rgba(255,255,255,0.5)":"transparent",t.style.position="absolute",t.style.zIndex=Ry.toString(),t.style.borderStyle="none",navigator.userAgent.toLowerCase().includes("chrome")?t.setAttribute("aria-live","off"):t.setAttribute("aria-live","polite"),navigator.userAgent.match(/rv:.*Gecko\//)?t.setAttribute("aria-relevant","additions"):t.setAttribute("aria-relevant","text"),t.addEventListener("click",this._onClick.bind(this)),t.addEventListener("focus",this._onFocus.bind(this)),t.addEventListener("focusout",this._onFocusOut.bind(this))),t.style.pointerEvents=e.accessiblePointerEvents,t.type=e.accessibleType,e.accessibleTitle&&e.accessibleTitle!==null?t.title=e.accessibleTitle:(!e.accessibleHint||e.accessibleHint===null)&&(t.title=`displayObject ${e.tabIndex}`),e.accessibleHint&&e.accessibleHint!==null&&t.setAttribute("aria-label",e.accessibleHint),this.debug&&this.updateDebugHTML(t),e._accessibleActive=!0,e._accessibleDiv=t,t.displayObject=e,this.children.push(e),this.div.appendChild(e._accessibleDiv),e._accessibleDiv.tabIndex=e.tabIndex}_dispatchEvent(e,t){const{displayObject:i}=e.target,s=this.renderer.events.rootBoundary,r=Object.assign(new gc(s),{target:i});s.rootTarget=this.renderer.lastObjectRendered,t.forEach(o=>s.dispatchEvent(r,o))}_onClick(e){this._dispatchEvent(e,["click","pointertap","tap"])}_onFocus(e){e.target.getAttribute("aria-live")||e.target.setAttribute("aria-live","assertive"),this._dispatchEvent(e,["mouseover"])}_onFocusOut(e){e.target.getAttribute("aria-live")||e.target.setAttribute("aria-live","polite"),this._dispatchEvent(e,["mouseout"])}_onKeyDown(e){e.keyCode===OP&&this.activate()}_onMouseMove(e){e.movementX===0&&e.movementY===0||this.deactivate()}destroy(){this.destroyTouchHook(),this.div=null,globalThis.document.removeEventListener("mousemove",this._onMouseMove,!0),globalThis.removeEventListener("keydown",this._onKeyDown),this.pool=null,this.children=null,this.renderer=null}}Qw.extension={name:"accessibility",type:[$e.RendererPlugin,$e.CanvasRendererPlugin]};je.add(Qw);const eS=class cp{constructor(e){this.stage=new Mi,e=Object.assign({forceCanvas:!1},e),this.renderer=K2(e),cp._plugins.forEach(t=>{t.init.call(this,e)})}render(){this.renderer.render(this.stage)}get view(){var e;return(e=this.renderer)==null?void 0:e.view}get screen(){var e;return(e=this.renderer)==null?void 0:e.screen}destroy(e,t){const i=cp._plugins.slice(0);i.reverse(),i.forEach(s=>{s.destroy.call(this)}),this.stage.destroy(t),this.stage=null,this.renderer.destroy(e),this.renderer=null}};eS._plugins=[];let tS=eS;je.handleByList($e.Application,tS._plugins);class iS{static init(e){Object.defineProperty(this,"resizeTo",{set(t){globalThis.removeEventListener("resize",this.queueResize),this._resizeTo=t,t&&(globalThis.addEventListener("resize",this.queueResize),this.resize())},get(){return this._resizeTo}}),this.queueResize=()=>{this._resizeTo&&(this.cancelResize(),this._resizeId=requestAnimationFrame(()=>this.resize()))},this.cancelResize=()=>{this._resizeId&&(cancelAnimationFrame(this._resizeId),this._resizeId=null)},this.resize=()=>{if(!this._resizeTo)return;this.cancelResize();let t,i;if(this._resizeTo===globalThis.window)t=globalThis.innerWidth,i=globalThis.innerHeight;else{const{clientWidth:s,clientHeight:r}=this._resizeTo;t=s,i=r}this.renderer.resize(t,i),this.render()},this._resizeId=null,this._resizeTo=null,this.resizeTo=e.resizeTo||null}static destroy(){globalThis.removeEventListener("resize",this.queueResize),this.cancelResize(),this.cancelResize=null,this.queueResize=null,this.resizeTo=null,this.resize=null}}iS.extension=$e.Application;je.add(iS);const Fy={loader:$e.LoadParser,resolver:$e.ResolveParser,cache:$e.CacheParser,detection:$e.DetectionParser};je.handle($e.Asset,n=>{const e=n.ref;Object.entries(Fy).filter(([t])=>!!e[t]).forEach(([t,i])=>je.add(Object.assign(e[t],{extension:e[t].extension??i})))},n=>{const e=n.ref;Object.keys(Fy).filter(t=>!!e[t]).forEach(t=>je.remove(e[t]))});class VP{constructor(e,t=!1){this._loader=e,this._assetList=[],this._isLoading=!1,this._maxConcurrent=1,this.verbose=t}add(e){e.forEach(t=>{this._assetList.push(t)}),this.verbose&&console.log("[BackgroundLoader] assets: ",this._assetList),this._isActive&&!this._isLoading&&this._next()}async _next(){if(this._assetList.length&&this._isActive){this._isLoading=!0;const e=[],t=Math.min(this._assetList.length,this._maxConcurrent);for(let i=0;i(Array.isArray(n)||(n=[n]),e?n.map(i=>typeof i=="string"||t?e(i):i):n),eu=(n,e)=>{const t=e.split("?")[1];return t&&(n+=`?${t}`),n};function nS(n,e,t,i,s){const r=e[t];for(let o=0;o{const o=r.substring(1,r.length-1).split(",");s.push(o)}),nS(n,s,0,t,i)}else i.push(n);return i}const tu=n=>!Array.isArray(n);class YP{constructor(){this._parsers=[],this._cache=new Map,this._cacheMap=new Map}reset(){this._cacheMap.clear(),this._cache.clear()}has(e){return this._cache.has(e)}get(e){const t=this._cache.get(e);return t||console.warn(`[Assets] Asset id ${e} was not found in the Cache`),t}set(e,t){const i=Hn(e);let s;for(let a=0;a{s[a]=t}));const r=Object.keys(s),o={cacheKeys:r,keys:i};if(i.forEach(a=>{this._cacheMap.set(a,o)}),r.forEach(a=>{const c=s?s[a]:t;this._cache.has(a)&&this._cache.get(a)!==c&&console.warn("[Cache] already has key:",a),this._cache.set(a,s[a])}),t instanceof it){const a=t;i.forEach(c=>{a.baseTexture!==it.EMPTY.baseTexture&&rt.addToCache(a.baseTexture,c),it.addToCache(a,c)})}}remove(e){if(!this._cacheMap.has(e)){console.warn(`[Assets] Asset id ${e} was not found in the Cache`);return}const t=this._cacheMap.get(e);t.cacheKeys.forEach(i=>{this._cache.delete(i)}),t.keys.forEach(i=>{this._cacheMap.delete(i)})}get parsers(){return this._parsers}}const _o=new YP;class GP{constructor(){this._parsers=[],this._parsersValidated=!1,this.parsers=new Proxy(this._parsers,{set:(e,t,i)=>(this._parsersValidated=!1,e[t]=i,!0)}),this.promiseCache={}}reset(){this._parsersValidated=!1,this.promiseCache={}}_getLoadPromiseAndParser(e,t){const i={promise:null,parser:null};return i.promise=(async()=>{var o,a;let s=null,r=null;if(t.loadParser&&(r=this._parserHash[t.loadParser],r||console.warn(`[Assets] specified load parser "${t.loadParser}" not found while loading ${e}`)),!r){for(let c=0;c({alias:[l],src:l})),a=o.length,c=o.map(async l=>{const h=di.toAbsolute(l.src);if(!s[l.src])try{this.promiseCache[h]||(this.promiseCache[h]=this._getLoadPromiseAndParser(h,l)),s[l.src]=await this.promiseCache[h].promise,t&&t(++i/a)}catch(u){throw delete this.promiseCache[h],delete s[l.src],new Error(`[Loader.load] Failed to load ${h}. +${u}`)}});return await Promise.all(c),r?s[o[0].src]:s}async unload(e){const t=Hn(e,i=>({alias:[i],src:i})).map(async i=>{var o,a;const s=di.toAbsolute(i.src),r=this.promiseCache[s];if(r){const c=await r.promise;delete this.promiseCache[s],(a=(o=r.parser)==null?void 0:o.unload)==null||a.call(o,c,i,this)}});await Promise.all(t)}_validateParsers(){this._parsersValidated=!0,this._parserHash=this._parsers.filter(e=>e.name).reduce((e,t)=>(e[t.name]&&console.warn(`[Assets] loadParser name conflict "${t.name}"`),{...e,[t.name]:t}),{})}}var _n=(n=>(n[n.Low=0]="Low",n[n.Normal=1]="Normal",n[n.High=2]="High",n))(_n||{});const HP=".json",jP="application/json",WP={extension:{type:$e.LoadParser,priority:_n.Low},name:"loadJson",test(n){return el(n,jP)||un(n,HP)},async load(n){return await(await Ve.ADAPTER.fetch(n)).json()}};je.add(WP);const zP=".txt",qP="text/plain",KP={name:"loadTxt",extension:{type:$e.LoadParser,priority:_n.Low},test(n){return el(n,qP)||un(n,zP)},async load(n){return await(await Ve.ADAPTER.fetch(n)).text()}};je.add(KP);const JP=["normal","bold","100","200","300","400","500","600","700","800","900"],ZP=[".ttf",".otf",".woff",".woff2"],QP=["font/ttf","font/otf","font/woff","font/woff2"],eR=/^(--|-?[A-Z_])[0-9A-Z_-]*$/i;function tR(n){const e=di.extname(n),t=di.basename(n,e).replace(/(-|_)/g," ").toLowerCase().split(" ").map(r=>r.charAt(0).toUpperCase()+r.slice(1));let i=t.length>0;for(const r of t)if(!r.match(eR)){i=!1;break}let s=t.join(" ");return i||(s=`"${s.replace(/[\\"]/g,"\\$&")}"`),s}const iR=/^[0-9A-Za-z%:/?#\[\]@!\$&'()\*\+,;=\-._~]*$/;function nR(n){return iR.test(n)?n:encodeURI(n)}const sR={extension:{type:$e.LoadParser,priority:_n.Low},name:"loadWebFont",test(n){return el(n,QP)||un(n,ZP)},async load(n,e){var i,s,r;const t=Ve.ADAPTER.getFontFaceSet();if(t){const o=[],a=((i=e.data)==null?void 0:i.family)??tR(n),c=((r=(s=e.data)==null?void 0:s.weights)==null?void 0:r.filter(h=>JP.includes(h)))??["normal"],l=e.data??{};for(let h=0;hVe.ADAPTER.getFontFaceSet().delete(e))}};je.add(sR);const rR=`(function() { + "use strict"; + const WHITE_PNG = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/x8AAwMCAO+ip1sAAAAASUVORK5CYII="; + async function checkImageBitmap() { + try { + if (typeof createImageBitmap != "function") + return !1; + const imageBlob = await (await fetch(WHITE_PNG)).blob(), imageBitmap = await createImageBitmap(imageBlob); + return imageBitmap.width === 1 && imageBitmap.height === 1; + } catch { + return !1; + } + } + checkImageBitmap().then((result) => { + self.postMessage(result); + }); +})(); +`;let Fa=null,hp=class{constructor(){Fa||(Fa=URL.createObjectURL(new Blob([rR],{type:"application/javascript"}))),this.worker=new Worker(Fa)}};hp.revokeObjectURL=function(){Fa&&(URL.revokeObjectURL(Fa),Fa=null)};const oR=`(function() { + "use strict"; + async function loadImageBitmap(url) { + const response = await fetch(url); + if (!response.ok) + throw new Error(\`[WorkerManager.loadImageBitmap] Failed to fetch \${url}: \${response.status} \${response.statusText}\`); + const imageBlob = await response.blob(); + return await createImageBitmap(imageBlob); + } + self.onmessage = async (event) => { + try { + const imageBitmap = await loadImageBitmap(event.data.data[0]); + self.postMessage({ + data: imageBitmap, + uuid: event.data.uuid, + id: event.data.id + }, [imageBitmap]); + } catch (e) { + self.postMessage({ + error: e, + uuid: event.data.uuid, + id: event.data.id + }); + } + }; +})(); +`;let La=null;class sS{constructor(){La||(La=URL.createObjectURL(new Blob([oR],{type:"application/javascript"}))),this.worker=new Worker(La)}}sS.revokeObjectURL=function(){La&&(URL.revokeObjectURL(La),La=null)};let Ly=0,Wf;class aR{constructor(){this._initialized=!1,this._createdWorkers=0,this.workerPool=[],this.queue=[],this.resolveHash={}}isImageBitmapSupported(){return this._isImageBitmapSupported!==void 0?this._isImageBitmapSupported:(this._isImageBitmapSupported=new Promise(e=>{const{worker:t}=new hp;t.addEventListener("message",i=>{t.terminate(),hp.revokeObjectURL(),e(i.data)})}),this._isImageBitmapSupported)}loadImageBitmap(e){return this._run("loadImageBitmap",[e])}async _initWorkers(){this._initialized||(this._initialized=!0)}getWorker(){Wf===void 0&&(Wf=navigator.hardwareConcurrency||4);let e=this.workerPool.pop();return!e&&this._createdWorkers{this.complete(t.data),this.returnWorker(t.target),this.next()})),e}returnWorker(e){this.workerPool.push(e)}complete(e){e.error!==void 0?this.resolveHash[e.uuid].reject(e.error):this.resolveHash[e.uuid].resolve(e.data),this.resolveHash[e.uuid]=null}async _run(e,t){await this._initWorkers();const i=new Promise((s,r)=>{this.queue.push({id:e,arguments:t,resolve:s,reject:r})});return this.next(),i}next(){if(!this.queue.length)return;const e=this.getWorker();if(!e)return;const t=this.queue.pop(),i=t.id;this.resolveHash[Ly]={resolve:t.resolve,reject:t.reject},e.postMessage({data:t.arguments,uuid:Ly++,id:i})}}const Oy=new aR;function vc(n,e,t){n.resource.internal=!0;const i=new it(n),s=()=>{delete e.promiseCache[t],_o.has(t)&&_o.remove(t)};return i.baseTexture.once("destroyed",()=>{t in e.promiseCache&&(console.warn("[Assets] A BaseTexture managed by Assets was destroyed instead of unloaded! Use Assets.unload() instead of destroying the BaseTexture."),s())}),i.once("destroyed",()=>{n.destroyed||(console.warn("[Assets] A Texture managed by Assets was destroyed instead of unloaded! Use Assets.unload() instead of destroying the Texture."),s())}),i}const lR=[".jpeg",".jpg",".png",".webp",".avif"],cR=["image/jpeg","image/png","image/webp","image/avif"];async function hR(n){const e=await Ve.ADAPTER.fetch(n);if(!e.ok)throw new Error(`[loadImageBitmap] Failed to fetch ${n}: ${e.status} ${e.statusText}`);const t=await e.blob();return await createImageBitmap(t)}const od={name:"loadTextures",extension:{type:$e.LoadParser,priority:_n.High},config:{preferWorkers:!0,preferCreateImageBitmap:!0,crossOrigin:"anonymous"},test(n){return el(n,cR)||un(n,lR)},async load(n,e,t){var a;const i=globalThis.createImageBitmap&&this.config.preferCreateImageBitmap;let s;i?this.config.preferWorkers&&await Oy.isImageBitmapSupported()?s=await Oy.loadImageBitmap(n):s=await hR(n):s=await new Promise((c,l)=>{const h=new Image;h.crossOrigin=this.config.crossOrigin,h.src=n,h.complete?c(h):(h.onload=()=>c(h),h.onerror=u=>l(u))});const r={...e.data};r.resolution??(r.resolution=fr(n)),i&&((a=r.resourceOptions)==null?void 0:a.ownsImageBitmap)===void 0&&(r.resourceOptions={...r.resourceOptions},r.resourceOptions.ownsImageBitmap=!0);const o=new rt(s,r);return o.resource.src=n,vc(o,t,n)},unload(n){n.destroy(!0)}};je.add(od);const uR=".svg",dR="image/svg+xml",fR={extension:{type:$e.LoadParser,priority:_n.High},name:"loadSVG",test(n){return el(n,dR)||un(n,uR)},async testParse(n){return ep.test(n)},async parse(n,e,t){var r;const i=new ep(n,(r=e==null?void 0:e.data)==null?void 0:r.resourceOptions);await i.load();const s=new rt(i,{resolution:fr(n),...e==null?void 0:e.data});return s.resource.src=e.src,vc(s,t,e.src)},async load(n,e){return(await Ve.ADAPTER.fetch(n)).text()},unload:od.unload};je.add(fR);const mR=[".mp4",".m4v",".webm",".ogv"],pR=["video/mp4","video/webm","video/ogg"],gR={name:"loadVideo",extension:{type:$e.LoadParser,priority:_n.High},config:{defaultAutoPlay:!0,defaultUpdateFPS:0,defaultLoop:!1,defaultMuted:!1,defaultPlaysinline:!0},test(n){return el(n,pR)||un(n,mR)},async load(n,e,t){var o;let i;const s=await(await Ve.ADAPTER.fetch(n)).blob(),r=URL.createObjectURL(s);try{const a={autoPlay:this.config.defaultAutoPlay,updateFPS:this.config.defaultUpdateFPS,loop:this.config.defaultLoop,muted:this.config.defaultMuted,playsinline:this.config.defaultPlaysinline,...(o=e==null?void 0:e.data)==null?void 0:o.resourceOptions,autoLoad:!0},c=new Kw(r,a);await c.load();const l=new rt(c,{alphaMode:await _I(),resolution:fr(n),...e==null?void 0:e.data});l.resource.src=n,i=vc(l,t,n),i.baseTexture.once("destroyed",()=>{URL.revokeObjectURL(r)})}catch(a){throw URL.revokeObjectURL(r),a}return i},unload(n){n.destroy(!0)}};je.add(gR);class vR{constructor(){this._defaultBundleIdentifierOptions={connector:"-",createBundleAssetId:(e,t)=>`${e}${this._bundleIdConnector}${t}`,extractAssetIdFromBundle:(e,t)=>t.replace(`${e}${this._bundleIdConnector}`,"")},this._bundleIdConnector=this._defaultBundleIdentifierOptions.connector,this._createBundleAssetId=this._defaultBundleIdentifierOptions.createBundleAssetId,this._extractAssetIdFromBundle=this._defaultBundleIdentifierOptions.extractAssetIdFromBundle,this._assetMap={},this._preferredOrder=[],this._parsers=[],this._resolverHash={},this._bundles={}}setBundleIdentifier(e){if(this._bundleIdConnector=e.connector??this._bundleIdConnector,this._createBundleAssetId=e.createBundleAssetId??this._createBundleAssetId,this._extractAssetIdFromBundle=e.extractAssetIdFromBundle??this._extractAssetIdFromBundle,this._extractAssetIdFromBundle("foo",this._createBundleAssetId("foo","bar"))!=="bar")throw new Error("[Resolver] GenerateBundleAssetId are not working correctly")}prefer(...e){e.forEach(t=>{this._preferredOrder.push(t),t.priority||(t.priority=Object.keys(t.params))}),this._resolverHash={}}set basePath(e){this._basePath=e}get basePath(){return this._basePath}set rootPath(e){this._rootPath=e}get rootPath(){return this._rootPath}get parsers(){return this._parsers}reset(){this.setBundleIdentifier(this._defaultBundleIdentifierOptions),this._assetMap={},this._preferredOrder=[],this._resolverHash={},this._rootPath=null,this._basePath=null,this._manifest=null,this._bundles={},this._defaultSearchParams=null}setDefaultSearchParams(e){if(typeof e=="string")this._defaultSearchParams=e;else{const t=e;this._defaultSearchParams=Object.keys(t).map(i=>`${encodeURIComponent(i)}=${encodeURIComponent(t[i])}`).join("&")}}getAlias(e){const{alias:t,name:i,src:s,srcs:r}=e;return Hn(t||i||s||r,o=>typeof o=="string"?o:Array.isArray(o)?o.map(a=>(a==null?void 0:a.src)??(a==null?void 0:a.srcs)??a):o!=null&&o.src||o!=null&&o.srcs?o.src??o.srcs:o,!0)}addManifest(e){this._manifest&&console.warn("[Resolver] Manifest already exists, this will be overwritten"),this._manifest=e,e.bundles.forEach(t=>{this.addBundle(t.name,t.assets)})}addBundle(e,t){const i=[];Array.isArray(t)?t.forEach(s=>{const r=s.src??s.srcs,o=s.alias??s.name;let a;if(typeof o=="string"){const c=this._createBundleAssetId(e,o);i.push(c),a=[o,c]}else{const c=o.map(l=>this._createBundleAssetId(e,l));i.push(...c),a=[...o,...c]}this.add({...s,alias:a,src:r})}):Object.keys(t).forEach(s=>{const r=[s,this._createBundleAssetId(e,s)];if(typeof t[s]=="string")this.add({alias:r,src:t[s]});else if(Array.isArray(t[s]))this.add({alias:r,src:t[s]});else{const o=t[s],a=o.src??o.srcs;this.add({...o,alias:r,src:Array.isArray(a)?a:[a]})}i.push(...r)}),this._bundles[e]=i}add(e,t,i,s,r){const o=[];typeof e=="string"||Array.isArray(e)&&typeof e[0]=="string"?(pt("7.2.0",`Assets.add now uses an object instead of individual parameters. +Please use Assets.add({ alias, src, data, format, loadParser }) instead.`),o.push({alias:e,src:t,data:i,format:s,loadParser:r})):Array.isArray(e)?o.push(...e):o.push(e);let a;a=c=>{this.hasKey(c)&&console.warn(`[Resolver] already has key: ${c} overwriting`)},Hn(o).forEach(c=>{const{src:l,srcs:h}=c;let{data:u,format:d,loadParser:f}=c;const m=Hn(l||h).map(v=>typeof v=="string"?XP(v):Array.isArray(v)?v:[v]),p=this.getAlias(c);Array.isArray(p)?p.forEach(a):a(p);const g=[];m.forEach(v=>{v.forEach(b=>{let y={};if(typeof b!="object"){y.src=b;for(let x=0;x{this._assetMap[v]=g})})}resolveBundle(e){const t=tu(e);e=Hn(e);const i={};return e.forEach(s=>{const r=this._bundles[s];if(r){const o=this.resolve(r),a={};for(const c in o){const l=o[c];a[this._extractAssetIdFromBundle(s,c)]=l}i[s]=a}}),t?i[e[0]]:i}resolveUrl(e){const t=this.resolve(e);if(typeof e!="string"){const i={};for(const s in t)i[s]=t[s].src;return i}return t.src}resolve(e){const t=tu(e);e=Hn(e);const i={};return e.forEach(s=>{if(!this._resolverHash[s])if(this._assetMap[s]){let r=this._assetMap[s];const o=r[0],a=this._getPreferredOrder(r);a==null||a.priority.forEach(c=>{a.params[c].forEach(l=>{const h=r.filter(u=>u[c]?u[c]===l:!1);h.length&&(r=h)})}),this._resolverHash[s]=r[0]??o}else this._resolverHash[s]=this.buildResolvedAsset({alias:[s],src:s},{});i[s]=this._resolverHash[s]}),t?i[e[0]]:i}hasKey(e){return!!this._assetMap[e]}hasBundle(e){return!!this._bundles[e]}_getPreferredOrder(e){for(let t=0;tr.params.format.includes(i.format));if(s)return s}return this._preferredOrder[0]}_appendDefaultSearchParams(e){if(!this._defaultSearchParams)return e;const t=/\?/.test(e)?"&":"?";return`${e}${t}${this._defaultSearchParams}`}buildResolvedAsset(e,t){const{aliases:i,data:s,loadParser:r,format:o}=t;return(this._basePath||this._rootPath)&&(e.src=di.toAbsolute(e.src,this._basePath,this._rootPath)),e.alias=i??e.alias??[e.src],e.src=this._appendDefaultSearchParams(e.src),e.data={...s||{},...e.data},e.loadParser=r??e.loadParser,e.format=o??e.format??di.extname(e.src).slice(1),e.srcs=e.src,e.name=e.alias,e}}class yR{constructor(){this._detections=[],this._initialized=!1,this.resolver=new vR,this.loader=new GP,this.cache=_o,this._backgroundLoader=new VP(this.loader),this._backgroundLoader.active=!0,this.reset()}async init(e={}){var r,o;if(this._initialized){console.warn("[Assets]AssetManager already initialized, did you load before calling this Assets.init()?");return}if(this._initialized=!0,e.defaultSearchParams&&this.resolver.setDefaultSearchParams(e.defaultSearchParams),e.basePath&&(this.resolver.basePath=e.basePath),e.bundleIdentifier&&this.resolver.setBundleIdentifier(e.bundleIdentifier),e.manifest){let a=e.manifest;typeof a=="string"&&(a=await this.load(a)),this.resolver.addManifest(a)}const t=((r=e.texturePreference)==null?void 0:r.resolution)??1,i=typeof t=="number"?[t]:t,s=await this._detectFormats({preferredFormats:(o=e.texturePreference)==null?void 0:o.format,skipDetections:e.skipDetections,detections:this._detections});this.resolver.prefer({params:{format:s,resolution:i}}),e.preferences&&this.setPreferences(e.preferences)}add(e,t,i,s,r){this.resolver.add(e,t,i,s,r)}async load(e,t){this._initialized||await this.init();const i=tu(e),s=Hn(e).map(a=>{if(typeof a!="string"){const c=this.resolver.getAlias(a);return c.some(l=>!this.resolver.hasKey(l))&&this.add(a),Array.isArray(c)?c[0]:c}return this.resolver.hasKey(a)||this.add({alias:a,src:a}),a}),r=this.resolver.resolve(s),o=await this._mapLoadToResolve(r,t);return i?o[s[0]]:o}addBundle(e,t){this.resolver.addBundle(e,t)}async loadBundle(e,t){this._initialized||await this.init();let i=!1;typeof e=="string"&&(i=!0,e=[e]);const s=this.resolver.resolveBundle(e),r={},o=Object.keys(s);let a=0,c=0;const l=()=>{t==null||t(++a/c)},h=o.map(u=>{const d=s[u];return c+=Object.keys(d).length,this._mapLoadToResolve(d,l).then(f=>{r[u]=f})});return await Promise.all(h),i?r[e[0]]:r}async backgroundLoad(e){this._initialized||await this.init(),typeof e=="string"&&(e=[e]);const t=this.resolver.resolve(e);this._backgroundLoader.add(Object.values(t))}async backgroundLoadBundle(e){this._initialized||await this.init(),typeof e=="string"&&(e=[e]);const t=this.resolver.resolveBundle(e);Object.values(t).forEach(i=>{this._backgroundLoader.add(Object.values(i))})}reset(){this.resolver.reset(),this.loader.reset(),this.cache.reset(),this._initialized=!1}get(e){if(typeof e=="string")return _o.get(e);const t={};for(let i=0;i{const l=r[a.src],h=[a.src];a.alias&&h.push(...a.alias),o[s[c]]=l,_o.set(h,l)}),o}async unload(e){this._initialized||await this.init();const t=Hn(e).map(s=>typeof s!="string"?s.src:s),i=this.resolver.resolve(t);await this._unloadFromResolved(i)}async unloadBundle(e){this._initialized||await this.init(),e=Hn(e);const t=this.resolver.resolveBundle(e),i=Object.keys(t).map(s=>this._unloadFromResolved(t[s]));await Promise.all(i)}async _unloadFromResolved(e){const t=Object.values(e);t.forEach(i=>{_o.remove(i.src)}),await this.loader.unload(t)}async _detectFormats(e){let t=[];e.preferredFormats&&(t=Array.isArray(e.preferredFormats)?e.preferredFormats:[e.preferredFormats]);for(const i of e.detections)e.skipDetections||await i.test()?t=await i.add(t):e.skipDetections||(t=await i.remove(t));return t=t.filter((i,s)=>t.indexOf(i)===s),t}get detections(){return this._detections}get preferWorkers(){return od.config.preferWorkers}set preferWorkers(e){pt("7.2.0","Assets.prefersWorkers is deprecated, use Assets.setPreferences({ preferWorkers: true }) instead."),this.setPreferences({preferWorkers:e})}setPreferences(e){this.loader.parsers.forEach(t=>{t.config&&Object.keys(t.config).filter(i=>i in e).forEach(i=>{t.config[i]=e[i]})})}}const Es=new yR;je.handleByList($e.LoadParser,Es.loader.parsers).handleByList($e.ResolveParser,Es.resolver.parsers).handleByList($e.CacheParser,Es.cache.parsers).handleByList($e.DetectionParser,Es.detections);const bR={extension:$e.CacheParser,test:n=>Array.isArray(n)&&n.every(e=>e instanceof it),getCacheableAssets:(n,e)=>{const t={};return n.forEach(i=>{e.forEach((s,r)=>{t[i+(r===0?"":r+1)]=s})}),t}};je.add(bR);async function rS(n){if("Image"in globalThis)return new Promise(e=>{const t=new Image;t.onload=()=>{e(!0)},t.onerror=()=>{e(!1)},t.src=n});if("createImageBitmap"in globalThis&&"fetch"in globalThis){try{const e=await(await fetch(n)).blob();await createImageBitmap(e)}catch{return!1}return!0}return!1}const xR={extension:{type:$e.DetectionParser,priority:1},test:async()=>rS("data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAAB0AAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQ0MAAAAABNjb2xybmNseAACAAIAAYAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAACVtZGF0EgAKCBgANogQEAwgMg8f8D///8WfhwB8+ErK42A="),add:async n=>[...n,"avif"],remove:async n=>n.filter(e=>e!=="avif")};je.add(xR);const wR={extension:{type:$e.DetectionParser,priority:0},test:async()=>rS("data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAAAAAAfQ//73v/+BiOh/AAA="),add:async n=>[...n,"webp"],remove:async n=>n.filter(e=>e!=="webp")};je.add(wR);const $y=["png","jpg","jpeg"],SR={extension:{type:$e.DetectionParser,priority:-1},test:()=>Promise.resolve(!0),add:async n=>[...n,...$y],remove:async n=>n.filter(e=>!$y.includes(e))};je.add(SR);const _R="WorkerGlobalScope"in globalThis&&globalThis instanceof globalThis.WorkerGlobalScope;function Ig(n){return _R?!1:document.createElement("video").canPlayType(n)!==""}const TR={extension:{type:$e.DetectionParser,priority:0},test:async()=>Ig("video/webm"),add:async n=>[...n,"webm"],remove:async n=>n.filter(e=>e!=="webm")};je.add(TR);const ER={extension:{type:$e.DetectionParser,priority:0},test:async()=>Ig("video/mp4"),add:async n=>[...n,"mp4","m4v"],remove:async n=>n.filter(e=>e!=="mp4"&&e!=="m4v")};je.add(ER);const CR={extension:{type:$e.DetectionParser,priority:0},test:async()=>Ig("video/ogg"),add:async n=>[...n,"ogv"],remove:async n=>n.filter(e=>e!=="ogv")};je.add(CR);const MR={extension:$e.ResolveParser,test:od.test,parse:n=>{var e;return{resolution:parseFloat(((e=Ve.RETINA_PREFIX.exec(n))==null?void 0:e[1])??"1"),format:di.extname(n).slice(1),src:n}}};je.add(MR);var ki=(n=>(n[n.COMPRESSED_RGB_S3TC_DXT1_EXT=33776]="COMPRESSED_RGB_S3TC_DXT1_EXT",n[n.COMPRESSED_RGBA_S3TC_DXT1_EXT=33777]="COMPRESSED_RGBA_S3TC_DXT1_EXT",n[n.COMPRESSED_RGBA_S3TC_DXT3_EXT=33778]="COMPRESSED_RGBA_S3TC_DXT3_EXT",n[n.COMPRESSED_RGBA_S3TC_DXT5_EXT=33779]="COMPRESSED_RGBA_S3TC_DXT5_EXT",n[n.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT=35917]="COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT",n[n.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT=35918]="COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT",n[n.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT=35919]="COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT",n[n.COMPRESSED_SRGB_S3TC_DXT1_EXT=35916]="COMPRESSED_SRGB_S3TC_DXT1_EXT",n[n.COMPRESSED_R11_EAC=37488]="COMPRESSED_R11_EAC",n[n.COMPRESSED_SIGNED_R11_EAC=37489]="COMPRESSED_SIGNED_R11_EAC",n[n.COMPRESSED_RG11_EAC=37490]="COMPRESSED_RG11_EAC",n[n.COMPRESSED_SIGNED_RG11_EAC=37491]="COMPRESSED_SIGNED_RG11_EAC",n[n.COMPRESSED_RGB8_ETC2=37492]="COMPRESSED_RGB8_ETC2",n[n.COMPRESSED_RGBA8_ETC2_EAC=37496]="COMPRESSED_RGBA8_ETC2_EAC",n[n.COMPRESSED_SRGB8_ETC2=37493]="COMPRESSED_SRGB8_ETC2",n[n.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC=37497]="COMPRESSED_SRGB8_ALPHA8_ETC2_EAC",n[n.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2=37494]="COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2",n[n.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2=37495]="COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2",n[n.COMPRESSED_RGB_PVRTC_4BPPV1_IMG=35840]="COMPRESSED_RGB_PVRTC_4BPPV1_IMG",n[n.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG=35842]="COMPRESSED_RGBA_PVRTC_4BPPV1_IMG",n[n.COMPRESSED_RGB_PVRTC_2BPPV1_IMG=35841]="COMPRESSED_RGB_PVRTC_2BPPV1_IMG",n[n.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG=35843]="COMPRESSED_RGBA_PVRTC_2BPPV1_IMG",n[n.COMPRESSED_RGB_ETC1_WEBGL=36196]="COMPRESSED_RGB_ETC1_WEBGL",n[n.COMPRESSED_RGB_ATC_WEBGL=35986]="COMPRESSED_RGB_ATC_WEBGL",n[n.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL=35987]="COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL",n[n.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL=34798]="COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL",n[n.COMPRESSED_RGBA_ASTC_4x4_KHR=37808]="COMPRESSED_RGBA_ASTC_4x4_KHR",n[n.COMPRESSED_RGBA_BPTC_UNORM_EXT=36492]="COMPRESSED_RGBA_BPTC_UNORM_EXT",n[n.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT=36493]="COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT",n[n.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT=36494]="COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT",n[n.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT=36495]="COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT",n))(ki||{});const iu={33776:.5,33777:.5,33778:1,33779:1,35916:.5,35917:.5,35918:1,35919:1,37488:.5,37489:.5,37490:1,37491:1,37492:.5,37496:1,37493:.5,37497:1,37494:.5,37495:.5,35840:.5,35842:.5,35841:.25,35843:.25,36196:.5,35986:.5,35987:1,34798:1,37808:1,36492:1,36493:1,36494:1,36495:1};let ls,ga;function Ny(){ga={bptc:ls.getExtension("EXT_texture_compression_bptc"),astc:ls.getExtension("WEBGL_compressed_texture_astc"),etc:ls.getExtension("WEBGL_compressed_texture_etc"),s3tc:ls.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:ls.getExtension("WEBGL_compressed_texture_s3tc_srgb"),pvrtc:ls.getExtension("WEBGL_compressed_texture_pvrtc")||ls.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),etc1:ls.getExtension("WEBGL_compressed_texture_etc1"),atc:ls.getExtension("WEBGL_compressed_texture_atc")}}const AR={extension:{type:$e.DetectionParser,priority:2},test:async()=>{const n=Ve.ADAPTER.createCanvas().getContext("webgl");return n?(ls=n,!0):(console.warn("WebGL not available for compressed textures."),!1)},add:async n=>{ga||Ny();const e=[];for(const t in ga)ga[t]&&e.push(t);return[...e,...n]},remove:async n=>(ga||Ny(),n.filter(e=>!(e in ga)))};je.add(AR);class IR extends td{constructor(e,t={width:1,height:1,autoLoad:!0}){let i,s;typeof e=="string"?(i=e,s=new Uint8Array):(i=null,s=e),super(s,t),this.origin=i,this.buffer=s?new Vm(s):null,this._load=null,this.loaded=!1,this.origin!==null&&t.autoLoad!==!1&&this.load(),this.origin===null&&this.buffer&&(this._load=Promise.resolve(this),this.loaded=!0,this.onBlobLoaded(this.buffer.rawBinaryData))}onBlobLoaded(e){}load(){return this._load?this._load:(this._load=fetch(this.origin).then(e=>e.blob()).then(e=>e.arrayBuffer()).then(e=>(this.data=new Uint32Array(e),this.buffer=new Vm(e),this.loaded=!0,this.onBlobLoaded(e),this.update(),this)),this._load)}}class Oo extends IR{constructor(e,t){super(e,t),this.format=t.format,this.levels=t.levels||1,this._width=t.width,this._height=t.height,this._extension=Oo._formatToExtension(this.format),(t.levelBuffers||this.buffer)&&(this._levelBuffers=t.levelBuffers||Oo._createLevelBuffers(e instanceof Uint8Array?e:this.buffer.uint8View,this.format,this.levels,4,4,this.width,this.height))}upload(e,t,i){const s=e.gl;if(!e.context.extensions[this._extension])throw new Error(`${this._extension} textures are not supported on the current machine`);if(!this._levelBuffers)return!1;s.pixelStorei(s.UNPACK_ALIGNMENT,4);for(let r=0,o=this.levels;r=33776&&e<=33779)return"s3tc";if(e>=35916&&e<=35919)return"s3tc_sRGB";if(e>=37488&&e<=37497)return"etc";if(e>=35840&&e<=35843)return"pvrtc";if(e===36196)return"etc1";if(e===35986||e===35987||e===34798)return"atc";if(e>=36492&&e<=36495)return"bptc";if(e===37808)return"astc";throw new Error(`Invalid (compressed) texture format given: ${e}`)}static _createLevelBuffers(e,t,i,s,r,o,a){const c=new Array(i);let l=e.byteOffset,h=o,u=a,d=h+s-1&~(s-1),f=u+r-1&~(r-1),m=d*f*iu[t];for(let p=0;p1?h:d,levelHeight:i>1?u:f,levelBuffer:new Uint8Array(e.buffer,l,m)},l+=m,h=h>>1||1,u=u>>1||1,d=h+s-1&~(s-1),f=u+r-1&~(r-1),m=d*f*iu[t];return c}}const zf=4,Hc=124,PR=32,Dy=20,RR=542327876,jc={HEIGHT:3,WIDTH:4,MIPMAP_COUNT:7,PIXEL_FORMAT:19},kR={FOURCC:2},Wc={DXGI_FORMAT:0,RESOURCE_DIMENSION:1,MISC_FLAG:2,ARRAY_SIZE:3},FR=1,LR=2,OR=4,$R=64,NR=512,DR=131072,BR=827611204,UR=861165636,VR=894720068,XR=808540228,YR=4,GR={[BR]:ki.COMPRESSED_RGBA_S3TC_DXT1_EXT,[UR]:ki.COMPRESSED_RGBA_S3TC_DXT3_EXT,[VR]:ki.COMPRESSED_RGBA_S3TC_DXT5_EXT},HR={70:ki.COMPRESSED_RGBA_S3TC_DXT1_EXT,71:ki.COMPRESSED_RGBA_S3TC_DXT1_EXT,73:ki.COMPRESSED_RGBA_S3TC_DXT3_EXT,74:ki.COMPRESSED_RGBA_S3TC_DXT3_EXT,76:ki.COMPRESSED_RGBA_S3TC_DXT5_EXT,77:ki.COMPRESSED_RGBA_S3TC_DXT5_EXT,72:ki.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,75:ki.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,78:ki.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT,96:ki.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT,95:ki.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT,98:ki.COMPRESSED_RGBA_BPTC_UNORM_EXT,99:ki.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT};function jR(n){const e=new Uint32Array(n);if(e[0]!==RR)throw new Error("Invalid DDS file magic word");const t=new Uint32Array(n,0,Hc/Uint32Array.BYTES_PER_ELEMENT),i=t[jc.HEIGHT],s=t[jc.WIDTH],r=t[jc.MIPMAP_COUNT],o=new Uint32Array(n,jc.PIXEL_FORMAT*Uint32Array.BYTES_PER_ELEMENT,PR/Uint32Array.BYTES_PER_ELEMENT),a=o[FR];if(a&OR){const c=o[kR.FOURCC];if(c!==XR){const b=GR[c],y=zf+Hc,x=new Uint8Array(n,y);return[new Oo(x,{format:b,width:s,height:i,levels:r})]}const l=zf+Hc,h=new Uint32Array(e.buffer,l,Dy/Uint32Array.BYTES_PER_ELEMENT),u=h[Wc.DXGI_FORMAT],d=h[Wc.RESOURCE_DIMENSION],f=h[Wc.MISC_FLAG],m=h[Wc.ARRAY_SIZE],p=HR[u];if(p===void 0)throw new Error(`DDSParser cannot parse texture data with DXGI format ${u}`);if(f===YR)throw new Error("DDSParser does not support cubemap textures");if(d===6)throw new Error("DDSParser does not supported 3D texture data");const g=new Array,v=zf+Hc+Dy;if(m===1)g.push(new Uint8Array(n,v));else{const b=iu[p];let y=0,x=s,_=i;for(let S=0;S>>1,_=_>>>1}let E=v;for(let S=0;Snew Oo(b,{format:p,width:s,height:i,levels:r}))}throw a&$R?new Error("DDSParser does not support uncompressed texture data."):a&NR?new Error("DDSParser does not supported YUV uncompressed texture data."):a&DR?new Error("DDSParser does not support single-channel (lumninance) texture data!"):a&LR?new Error("DDSParser does not support single-channel (alpha) texture data!"):new Error("DDSParser failed to load a texture file due to an unknown reason!")}const By=[171,75,84,88,32,49,49,187,13,10,26,10],WR=67305985,Un={ENDIANNESS:12,GL_TYPE:16,GL_FORMAT:24,GL_INTERNAL_FORMAT:28,PIXEL_WIDTH:36,PIXEL_HEIGHT:40,PIXEL_DEPTH:44,NUMBER_OF_ARRAY_ELEMENTS:48,NUMBER_OF_FACES:52,NUMBER_OF_MIPMAP_LEVELS:56,BYTES_OF_KEY_VALUE_DATA:60},up=64,Uy={[He.UNSIGNED_BYTE]:1,[He.UNSIGNED_SHORT]:2,[He.INT]:4,[He.UNSIGNED_INT]:4,[He.FLOAT]:4,[He.HALF_FLOAT]:8},zR={[Ie.RGBA]:4,[Ie.RGB]:3,[Ie.RG]:2,[Ie.RED]:1,[Ie.LUMINANCE]:1,[Ie.LUMINANCE_ALPHA]:2,[Ie.ALPHA]:1},qR={[He.UNSIGNED_SHORT_4_4_4_4]:2,[He.UNSIGNED_SHORT_5_5_5_1]:2,[He.UNSIGNED_SHORT_5_6_5]:2};function KR(n,e,t=!1){const i=new DataView(e);if(!JR(n,i))return null;const s=i.getUint32(Un.ENDIANNESS,!0)===WR,r=i.getUint32(Un.GL_TYPE,s),o=i.getUint32(Un.GL_FORMAT,s),a=i.getUint32(Un.GL_INTERNAL_FORMAT,s),c=i.getUint32(Un.PIXEL_WIDTH,s),l=i.getUint32(Un.PIXEL_HEIGHT,s)||1,h=i.getUint32(Un.PIXEL_DEPTH,s)||1,u=i.getUint32(Un.NUMBER_OF_ARRAY_ELEMENTS,s)||1,d=i.getUint32(Un.NUMBER_OF_FACES,s),f=i.getUint32(Un.NUMBER_OF_MIPMAP_LEVELS,s),m=i.getUint32(Un.BYTES_OF_KEY_VALUE_DATA,s);if(l===0||h!==1)throw new Error("Only 2D textures are supported");if(d!==1)throw new Error("CubeTextures are not supported by KTXLoader yet!");if(u!==1)throw new Error("WebGL does not support array textures");const p=4,g=4,v=c+3&-4,b=l+3&-4,y=new Array(u);let x=c*l;r===0&&(x=v*b);let _;if(r!==0?Uy[r]?_=Uy[r]*zR[o]:_=qR[r]:_=iu[a],_===void 0)throw new Error("Unable to resolve the pixel format stored in the *.ktx file!");const E=t?QR(i,m,s):null;let S=x*_,C=c,M=l,P=v,A=b,R=up+m;for(let B=0;B1||r!==0?C:P,levelHeight:f>1||r!==0?M:A,levelBuffer:new Uint8Array(e,W,S)},W+=S}R+=O+4,R=R%4!==0?R+4-R%4:R,C=C>>1||1,M=M>>1||1,P=C+p-1&-4,A=M+g-1&-4,S=P*A*_}return r!==0?{uncompressed:y.map(B=>{let O=B[0].levelBuffer,W=!1;return r===He.FLOAT?O=new Float32Array(B[0].levelBuffer.buffer,B[0].levelBuffer.byteOffset,B[0].levelBuffer.byteLength/4):r===He.UNSIGNED_INT?(W=!0,O=new Uint32Array(B[0].levelBuffer.buffer,B[0].levelBuffer.byteOffset,B[0].levelBuffer.byteLength/4)):r===He.INT&&(W=!0,O=new Int32Array(B[0].levelBuffer.buffer,B[0].levelBuffer.byteOffset,B[0].levelBuffer.byteLength/4)),{resource:new td(O,{width:B[0].levelWidth,height:B[0].levelHeight}),type:r,format:W?ZR(o):o}}),kvData:E}:{compressed:y.map(B=>new Oo(null,{format:a,width:c,height:l,levels:f,levelBuffers:B})),kvData:E}}function JR(n,e){for(let t=0;te-s){console.error("KTXLoader: keyAndValueByteSize out of bounds");break}let c=0;for(;c{const o=new rt(r,{mipmap:$n.OFF,alphaMode:Ri.NO_PREMULTIPLIED_ALPHA,resolution:fr(n),...e.data});return vc(o,t,n)});return s.length===1?s[0]:s},unload(n){Array.isArray(n)?n.forEach(e=>e.destroy(!0)):n.destroy(!0)}};je.add(ek);const tk={extension:{type:$e.LoadParser,priority:_n.High},name:"loadKTX",test(n){return un(n,".ktx")},async load(n,e,t){const i=await(await Ve.ADAPTER.fetch(n)).arrayBuffer(),{compressed:s,uncompressed:r,kvData:o}=KR(n,i),a=s??r,c={mipmap:$n.OFF,alphaMode:Ri.NO_PREMULTIPLIED_ALPHA,resolution:fr(n),...e.data},l=a.map(h=>{a===r&&Object.assign(c,{type:h.type,format:h.format});const u=h.resource??h,d=new rt(u,c);return d.ktxKeyValueData=o,vc(d,t,n)});return l.length===1?l[0]:l},unload(n){Array.isArray(n)?n.forEach(e=>e.destroy(!0)):n.destroy(!0)}};je.add(tk);const ik=["s3tc","s3tc_sRGB","etc","etc1","pvrtc","atc","astc","bptc"],nk={extension:$e.ResolveParser,test:n=>{const e=di.extname(n).slice(1);return["basis","ktx","dds"].includes(e)},parse:n=>{var i,s;const e=n.split("."),t=e.pop();if(["ktx","dds"].includes(t)){const r=e.pop();if(ik.includes(r))return{resolution:parseFloat(((i=Ve.RETINA_PREFIX.exec(n))==null?void 0:i[1])??"1"),format:r,src:n}}return{resolution:parseFloat(((s=Ve.RETINA_PREFIX.exec(n))==null?void 0:s[1])??"1"),format:t,src:n}}};je.add(nk);const zc=new dt,sk=4,oS=class Tl{constructor(e){this.renderer=e,this._rendererPremultipliedAlpha=!1}contextChange(){var t;const e=(t=this.renderer)==null?void 0:t.gl.getContextAttributes();this._rendererPremultipliedAlpha=!!(e&&e.alpha&&e.premultipliedAlpha)}async image(e,t,i,s){const r=new Image;return r.src=await this.base64(e,t,i,s),r}async base64(e,t,i,s){const r=this.canvas(e,s);if(r.toBlob!==void 0)return new Promise((o,a)=>{r.toBlob(c=>{if(!c){a(new Error("ICanvas.toBlob failed!"));return}const l=new FileReader;l.onload=()=>o(l.result),l.onerror=a,l.readAsDataURL(c)},t,i)});if(r.toDataURL!==void 0)return r.toDataURL(t,i);if(r.convertToBlob!==void 0){const o=await r.convertToBlob({type:t,quality:i});return new Promise((a,c)=>{const l=new FileReader;l.onload=()=>a(l.result),l.onerror=c,l.readAsDataURL(o)})}throw new Error("Extract.base64() requires ICanvas.toDataURL, ICanvas.toBlob, or ICanvas.convertToBlob to be implemented")}canvas(e,t){const{pixels:i,width:s,height:r,flipY:o,premultipliedAlpha:a}=this._rawPixels(e,t);o&&Tl._flipY(i,s,r),a&&Tl._unpremultiplyAlpha(i);const c=new BI(s,r,1),l=new ImageData(new Uint8ClampedArray(i.buffer),s,r);return c.context.putImageData(l,0,0),c.canvas}pixels(e,t){const{pixels:i,width:s,height:r,flipY:o,premultipliedAlpha:a}=this._rawPixels(e,t);return o&&Tl._flipY(i,s,r),a&&Tl._unpremultiplyAlpha(i),i}_rawPixels(e,t){const i=this.renderer;if(!i)throw new Error("The Extract has already been destroyed");let s,r=!1,o=!1,a,c=!1;e&&(e instanceof jo?a=e:(a=i.generateTexture(e,{region:t,resolution:i.resolution,multisample:i.multisample}),c=!0,t&&(zc.width=t.width,zc.height=t.height,t=zc)));const l=i.gl;if(a){if(s=a.baseTexture.resolution,t=t??a.frame,r=!1,o=a.baseTexture.alphaMode>0&&a.baseTexture.format===Ie.RGBA,!c){i.renderTexture.bind(a);const f=a.framebuffer.glFramebuffers[i.CONTEXT_UID];f.blitFramebuffer&&i.framebuffer.bind(f.blitFramebuffer)}}else s=i.resolution,t||(t=zc,t.width=i.width/s,t.height=i.height/s),r=!0,o=this._rendererPremultipliedAlpha,i.renderTexture.bind();const h=Math.max(Math.round(t.width*s),1),u=Math.max(Math.round(t.height*s),1),d=new Uint8Array(sk*h*u);return l.readPixels(Math.round(t.x*s),Math.round(t.y*s),h,u,l.RGBA,l.UNSIGNED_BYTE,d),c&&(a==null||a.destroy(!0)),{pixels:d,width:h,height:u,flipY:r,premultipliedAlpha:o}}destroy(){this.renderer=null}static _flipY(e,t,i){const s=t<<2,r=i>>1,o=new Uint8Array(s);for(let a=0;a=0&&a>=0&&s>=0&&r>=0)){e.length=0;return}const c=Math.ceil(2.3*Math.sqrt(o+a)),l=c*8+(s?4:0)+(r?4:0);if(e.length=l,l===0)return;if(c===0){e.length=8,e[0]=e[6]=t+s,e[1]=e[3]=i+r,e[2]=e[4]=t-s,e[5]=e[7]=i-r;return}let h=0,u=c*4+(s?2:0)+2,d=u,f=l;{const m=s+o,p=r,g=t+m,v=t-m,b=i+p;if(e[h++]=g,e[h++]=b,e[--u]=b,e[--u]=v,r){const y=i-p;e[d++]=v,e[d++]=y,e[--f]=y,e[--f]=g}}for(let m=1;m0||e&&i<=0){const s=t/2;for(let r=s+s%2;r=6){Vy(t,!1);const o=[];for(let l=0;l=0&&r>=0&&o.push(t,i,t+s,i,t+s,i+r,t,i+r)},triangulate(n,e){const t=n.points,i=e.points;if(t.length===0)return;const s=i.length/2;i.push(t[0],t[1],t[2],t[3],t[6],t[7],t[4],t[5]),e.indices.push(s,s+1,s+2,s+1,s+2,s+3)}},ak={build(n){nu.build(n)},triangulate(n,e){nu.triangulate(n,e)}};var An=(n=>(n.MITER="miter",n.BEVEL="bevel",n.ROUND="round",n))(An||{}),Xr=(n=>(n.BUTT="butt",n.ROUND="round",n.SQUARE="square",n))(Xr||{});const Va={adaptive:!0,maxLength:10,minSegments:8,maxSegments:2048,epsilon:1e-4,_segmentsCount(n,e=20){if(!this.adaptive||!n||isNaN(n))return e;let t=Math.ceil(n/this.maxLength);return tthis.maxSegments&&(t=this.maxSegments),t}};class Xy{static curveTo(e,t,i,s,r,o){const a=o[o.length-2],c=o[o.length-1]-t,l=a-e,h=s-t,u=i-e,d=Math.abs(c*u-l*h);if(d<1e-8||r===0)return(o[o.length-2]!==e||o[o.length-1]!==t)&&o.push(e,t),null;const f=c*c+l*l,m=h*h+u*u,p=c*h+l*u,g=r*Math.sqrt(f)/d,v=r*Math.sqrt(m)/d,b=g*p/f,y=v*p/m,x=g*u+v*l,_=g*h+v*c,E=l*(v+b),S=c*(v+b),C=u*(g+y),M=h*(g+y),P=Math.atan2(S-_,E-x),A=Math.atan2(M-_,C-x);return{cx:x+e,cy:_+t,radius:r,startAngle:P,endAngle:A,anticlockwise:l*h>u*c}}static arc(e,t,i,s,r,o,a,c,l){const h=a-o,u=Va._segmentsCount(Math.abs(h)*r,Math.ceil(Math.abs(h)/zh)*40),d=h/(u*2),f=d*2,m=Math.cos(d),p=Math.sin(d),g=u-1,v=g%1/g;for(let b=0;b<=g;++b){const y=b+v*b,x=d+o+f*y,_=Math.cos(x),E=-Math.sin(x);l.push((m*_+p*E)*r+i,(m*-E+p*_)*r+s)}}}class lk{constructor(){this.reset()}begin(e,t,i){this.reset(),this.style=e,this.start=t,this.attribStart=i}end(e,t){this.attribSize=t-this.attribStart,this.size=e-this.start}reset(){this.style=null,this.size=0,this.start=0,this.attribStart=0,this.attribSize=0}}class Pg{static curveLength(e,t,i,s,r,o,a,c){let l=0,h=0,u=0,d=0,f=0,m=0,p=0,g=0,v=0,b=0,y=0,x=e,_=t;for(let E=1;E<=10;++E)h=E/10,u=h*h,d=u*h,f=1-h,m=f*f,p=m*f,g=p*e+3*m*h*i+3*f*u*r+d*a,v=p*t+3*m*h*s+3*f*u*o+d*c,b=x-g,y=_-v,x=g,_=v,l+=Math.sqrt(b*b+y*y);return l}static curveTo(e,t,i,s,r,o,a){const c=a[a.length-2],l=a[a.length-1];a.length-=2;const h=Va._segmentsCount(Pg.curveLength(c,l,e,t,i,s,r,o));let u=0,d=0,f=0,m=0,p=0;a.push(c,l);for(let g=1,v=0;g<=h;++g)v=g/h,u=1-v,d=u*u,f=d*u,m=v*v,p=m*v,a.push(f*c+3*d*v*e+3*u*m*i+p*r,f*l+3*d*v*t+3*u*m*s+p*o)}}function Yy(n,e,t,i,s,r,o,a){const c=n-t*s,l=e-i*s,h=n+t*r,u=e+i*r;let d,f;o?(d=i,f=-t):(d=-i,f=t);const m=c+d,p=l+f,g=h+d,v=u+f;return a.push(m,p,g,v),2}function mo(n,e,t,i,s,r,o,a){const c=t-n,l=i-e;let h=Math.atan2(c,l),u=Math.atan2(s-n,r-e);a&&hu&&(u+=Math.PI*2);let d=h;const f=u-h,m=Math.abs(f),p=Math.sqrt(c*c+l*l),g=(15*m*Math.sqrt(p)/Math.PI>>0)+1,v=f/g;if(d+=v,a){o.push(n,e,t,i);for(let b=1,y=d;b=0&&(r.join===An.ROUND?d+=mo(y,x,y-S*B,x-C*B,y-M*B,x-P*B,h,!1)+4:d+=2,h.push(y-M*O,x-P*O,y+M*B,x+P*B));continue}const J=(-S+v)*(-C+x)-(-S+y)*(-C+b),oe=(-M+_)*(-P+x)-(-M+y)*(-P+E),le=(L*oe-F*J)/G,ve=(D*J-N*oe)/G,Se=(le-y)*(le-y)+(ve-x)*(ve-x),fe=y+(le-y)*B,ye=x+(ve-x)*B,q=y-(le-y)*O,Z=x-(ve-x)*O,se=Math.min(L*L+N*N,F*F+D*D),H=K?B:O,j=se+H*H*p,$=Se<=j;let U=r.join;if(U===An.MITER&&Se/p>g&&(U=An.BEVEL),$)switch(U){case An.MITER:{h.push(fe,ye,q,Z);break}case An.BEVEL:{K?h.push(fe,ye,y+S*O,x+C*O,fe,ye,y+M*O,x+P*O):h.push(y-S*B,x-C*B,q,Z,y-M*B,x-P*B,q,Z),d+=2;break}case An.ROUND:{K?(h.push(fe,ye,y+S*O,x+C*O),d+=mo(y,x,y+S*O,x+C*O,y+M*O,x+P*O,h,!0)+4,h.push(fe,ye,y+M*O,x+P*O)):(h.push(y-S*B,x-C*B,q,Z),d+=mo(y,x,y-S*B,x-C*B,y-M*B,x-P*B,h,!1)+4,h.push(y-M*B,x-P*B,q,Z));break}}else{switch(h.push(y-S*B,x-C*B,y+S*O,x+C*O),U){case An.MITER:{K?h.push(q,Z,q,Z):h.push(fe,ye,fe,ye),d+=2;break}case An.ROUND:{K?d+=mo(y,x,y+S*O,x+C*O,y+M*O,x+P*O,h,!0)+2:d+=mo(y,x,y-S*B,x-C*B,y-M*B,x-P*B,h,!1)+2;break}}h.push(y-M*B,x-P*B,y+M*O,x+P*O),d+=2}}v=i[(u-2)*2],b=i[(u-2)*2+1],y=i[(u-1)*2],x=i[(u-1)*2+1],S=-(b-x),C=v-y,A=Math.sqrt(S*S+C*C),S/=A,C/=A,S*=m,C*=m,h.push(y-S*B,x-C*B,y+S*O,x+C*O),c||(r.cap===Xr.ROUND?d+=mo(y-S*(B-O)*.5,x-C*(B-O)*.5,y-S*B,x-C*B,y+S*O,x+C*O,h,!1)+2:r.cap===Xr.SQUARE&&(d+=Yy(y,x,S,C,B,O,!1,h)));const W=e.indices,V=Va.epsilon*Va.epsilon;for(let Y=f;Y0&&(this.invalidate(),this.clearDirty++,this.graphicsData.length=0),this}drawShape(e,t=null,i=null,s=null){const r=new su(e,t,i,s);return this.graphicsData.push(r),this.dirty++,this}drawHole(e,t=null){if(!this.graphicsData.length)return null;const i=new su(e,null,null,t),s=this.graphicsData[this.graphicsData.length-1];return i.lineStyle=s.lineStyle,s.holes.push(i),this.dirty++,this}destroy(){super.destroy();for(let e=0;e0&&(i=this.batches[this.batches.length-1],s=i.style);for(let c=this.shapeIndex;c65535;this.indicesUint16&&this.indices.length===this.indicesUint16.length&&a===this.indicesUint16.BYTES_PER_ELEMENT>2?this.indicesUint16.set(this.indices):this.indicesUint16=a?new Uint32Array(this.indices):new Uint16Array(this.indices),this.batchable=this.isBatchable(),this.batchable?this.packBatches():this.buildDrawCalls()}_compareStyles(e,t){return!(!e||!t||e.texture.baseTexture!==t.texture.baseTexture||e.color+e.alpha!==t.color+t.alpha||!!e.native!=!!t.native)}validateBatching(){if(this.dirty===this.cacheDirty||!this.graphicsData.length)return!1;for(let e=0,t=this.graphicsData.length;e65535*2)return!1;const e=this.batches;for(let t=0;t0&&(s=qc.pop(),s||(s=new Gm,s.texArray=new zm),this.drawCalls.push(s)),s.start=h,s.size=0,s.texArray.count=0,s.type=l),p.touched=1,p._batchEnabled=e,p._batchLocation=r,p.wrapMode=Jn.REPEAT,s.texArray.elements[s.texArray.count++]=p,r++)),s.size+=d.size,h+=d.size,a=p._batchLocation,this.addColors(t,m.color,m.alpha,d.attribSize,d.attribStart),this.addTextureIds(i,a,d.attribSize,d.attribStart)}rt._globalBatch=e,this.packAttributes()}packAttributes(){const e=this.points,t=this.uvs,i=this.colors,s=this.textureIds,r=new ArrayBuffer(e.length*3*4),o=new Float32Array(r),a=new Uint32Array(r);let c=0;for(let l=0;l0&&e.alpha>0;return i?(e.matrix&&(e.matrix=e.matrix.clone(),e.matrix.invert()),Object.assign(this._lineStyle,{visible:i},e)):this._lineStyle.reset(),this}startPoly(){if(this.currentPath){const e=this.currentPath.points,t=this.currentPath.points.length;t>2&&(this.drawShape(this.currentPath),this.currentPath=new Lo,this.currentPath.closeStroke=!1,this.currentPath.points.push(e[t-2],e[t-1]))}else this.currentPath=new Lo,this.currentPath.closeStroke=!1}finishPoly(){this.currentPath&&(this.currentPath.points.length>2?(this.drawShape(this.currentPath),this.currentPath=null):this.currentPath.points.length=0)}moveTo(e,t){return this.startPoly(),this.currentPath.points[0]=e,this.currentPath.points[1]=t,this}lineTo(e,t){this.currentPath||this.moveTo(0,0);const i=this.currentPath.points,s=i[i.length-2],r=i[i.length-1];return(s!==e||r!==t)&&i.push(e,t),this}_initCurve(e=0,t=0){this.currentPath?this.currentPath.points.length===0&&(this.currentPath.points=[e,t]):this.moveTo(e,t)}quadraticCurveTo(e,t,i,s){this._initCurve();const r=this.currentPath.points;return r.length===0&&this.moveTo(0,0),Rg.curveTo(e,t,i,s,r),this}bezierCurveTo(e,t,i,s,r,o){return this._initCurve(),Pg.curveTo(e,t,i,s,r,o,this.currentPath.points),this}arcTo(e,t,i,s,r){this._initCurve(e,t);const o=this.currentPath.points,a=Xy.curveTo(e,t,i,s,r,o);if(a){const{cx:c,cy:l,radius:h,startAngle:u,endAngle:d,anticlockwise:f}=a;this.arc(c,l,h,u,d,f)}return this}arc(e,t,i,s,r,o=!1){if(s===r)return this;if(!o&&r<=s?r+=zh:o&&s<=r&&(s+=zh),r-s===0)return this;const a=e+Math.cos(s)*i,c=t+Math.sin(s)*i,l=this._geometry.closePointEps;let h=this.currentPath?this.currentPath.points:null;if(h){const u=Math.abs(h[h.length-2]-a),d=Math.abs(h[h.length-1]-c);u0;return i?(e.matrix&&(e.matrix=e.matrix.clone(),e.matrix.invert()),Object.assign(this._fillStyle,{visible:i},e)):this._fillStyle.reset(),this}endFill(){return this.finishPoly(),this._fillStyle.reset(),this}drawRect(e,t,i,s){return this.drawShape(new dt(e,t,i,s))}drawRoundedRect(e,t,i,s,r){return this.drawShape(new sd(e,t,i,s,r))}drawCircle(e,t,i){return this.drawShape(new id(e,t,i))}drawEllipse(e,t,i,s){return this.drawShape(new nd(e,t,i,s))}drawPolygon(...e){let t,i=!0;const s=e[0];s.points?(i=s.closeStroke,t=s.points):Array.isArray(e[0])?t=e[0]:t=e;const r=new Lo(t);return r.closeStroke=i,this.drawShape(r),this}drawShape(e){return this._holeMode?this._geometry.drawHole(e,this._matrix):this._geometry.drawShape(e,this._fillStyle.clone(),this._lineStyle.clone(),this._matrix),this}clear(){return this._geometry.clear(),this._lineStyle.reset(),this._fillStyle.reset(),this._boundsID++,this._matrix=null,this._holeMode=!1,this.currentPath=null,this}isFastRect(){const e=this._geometry.graphicsData;return e.length===1&&e[0].shape.type===Ni.RECT&&!e[0].matrix&&!e[0].holes.length&&!(e[0].lineStyle.visible&&e[0].lineStyle.width)}_render(e){this.finishPoly();const t=this._geometry;t.updateBatches(),t.batchable?(this.batchDirty!==t.batchDirty&&this._populateBatches(),this._renderBatched(e)):(e.batch.flush(),this._renderDirect(e))}_populateBatches(){const e=this._geometry,t=this.blendMode,i=e.batches.length;this.batchTint=-1,this._transformID=-1,this.batchDirty=e.batchDirty,this.batches.length=i,this.vertexData=new Float32Array(e.points);for(let s=0;si&&!e.autoResize&&(o=i);let a=e._buffers;a||(a=e._buffers=this.generateBuffers(e));const c=t[0]._texture.baseTexture,l=c.alphaMode>0;this.state.blendMode=hw(e.blendMode,l),r.state.set(this.state);const h=r.gl,u=e.worldTransform.copyTo(this.tempMatrix);u.prepend(r.globalUniforms.uniforms.projectionMatrix),this.shader.uniforms.translationMatrix=u.toArray(!0),this.shader.uniforms.uColor=kt.shared.setValue(e.tintRgb).premultiply(e.worldAlpha,l).toArray(this.shader.uniforms.uColor),this.shader.uniforms.uSampler=c,this.renderer.shader.bind(this.shader);let d=!1;for(let f=0,m=0;fs&&(p=s),m>=a.length&&a.push(this._generateOneMoreBuffer(e));const g=a[m];g.uploadDynamic(t,f,p);const v=e._bufferUpdateIDs[m]||0;d=d||g._updateID0);s[o]=l,s[o+r]=l,s[o+r*2]=l,s[o+r*3]=l,o+=r*4}}destroy(){super.destroy(),this.shader&&(this.shader.destroy(),this.shader=null),this.tempMatrix=null}}dS.extension={name:"particle",type:$e.RendererPlugin};je.add(dS);var ld=(n=>(n[n.LINEAR_VERTICAL=0]="LINEAR_VERTICAL",n[n.LINEAR_HORIZONTAL=1]="LINEAR_HORIZONTAL",n))(ld||{});const Kc={willReadFrequently:!0},cs=class qe{static get experimentalLetterSpacingSupported(){let e=qe._experimentalLetterSpacingSupported;if(e!==void 0){const t=Ve.ADAPTER.getCanvasRenderingContext2D().prototype;e=qe._experimentalLetterSpacingSupported="letterSpacing"in t||"textLetterSpacing"in t}return e}constructor(e,t,i,s,r,o,a,c,l){this.text=e,this.style=t,this.width=i,this.height=s,this.lines=r,this.lineWidths=o,this.lineHeight=a,this.maxLineWidth=c,this.fontProperties=l}static measureText(e,t,i,s=qe._canvas){i=i??t.wordWrap;const r=t.toFontString(),o=qe.measureFont(r);o.fontSize===0&&(o.fontSize=t.fontSize,o.ascent=t.fontSize);const a=s.getContext("2d",Kc);a.font=r;const c=(i?qe.wordWrap(e,t,s):e).split(/(?:\r\n|\r|\n)/),l=new Array(c.length);let h=0;for(let m=0;m0&&(s?r-=t:r+=(qe.graphemeSegmenter(e).length-1)*t),r}static wordWrap(e,t,i=qe._canvas){const s=i.getContext("2d",Kc);let r=0,o="",a="";const c=Object.create(null),{letterSpacing:l,whiteSpace:h}=t,u=qe.collapseSpaces(h),d=qe.collapseNewlines(h);let f=!u;const m=t.wordWrapWidth+l,p=qe.tokenize(e);for(let g=0;gm)if(o!==""&&(a+=qe.addLine(o),o="",r=0),qe.canBreakWords(v,t.breakWords)){const y=qe.wordWrapSplit(v);for(let x=0;xm&&(a+=qe.addLine(o),f=!1,o="",r=0),o+=_,r+=C}}else{o.length>0&&(a+=qe.addLine(o),o="",r=0);const y=g===p.length-1;a+=qe.addLine(v,!y),f=!1,o="",r=0}else b+r>m&&(f=!1,a+=qe.addLine(o),o="",r=0),(o.length>0||!qe.isBreakingSpace(v)||f)&&(o+=v,r+=b)}return a+=qe.addLine(o,!1),a}static addLine(e,t=!0){return e=qe.trimRight(e),e=t?`${e} +`:e,e}static getFromCache(e,t,i,s){let r=i[e];return typeof r!="number"&&(r=qe._measureText(e,t,s)+t,i[e]=r),r}static collapseSpaces(e){return e==="normal"||e==="pre-line"}static collapseNewlines(e){return e==="normal"}static trimRight(e){if(typeof e!="string")return"";for(let t=e.length-1;t>=0;t--){const i=e[t];if(!qe.isBreakingSpace(i))break;e=e.slice(0,-1)}return e}static isNewline(e){return typeof e!="string"?!1:qe._newlines.includes(e.charCodeAt(0))}static isBreakingSpace(e,t){return typeof e!="string"?!1:qe._breakingSpaces.includes(e.charCodeAt(0))}static tokenize(e){const t=[];let i="";if(typeof e!="string")return t;for(let s=0;sa;--d){for(let p=0;p{if(typeof(Intl==null?void 0:Intl.Segmenter)=="function"){const n=new Intl.Segmenter;return e=>[...n.segment(e)].map(t=>t.segment)}return n=>[...n]})(),cs.experimentalLetterSpacing=!1,cs._fonts={},cs._newlines=[10,13],cs._breakingSpaces=[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288];let kr=cs;const yk=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],fS=class El{constructor(e){this.styleID=0,this.reset(),Qf(this,e,e)}clone(){const e={};return Qf(e,this,El.defaultStyle),new El(e)}reset(){Qf(this,El.defaultStyle,El.defaultStyle)}get align(){return this._align}set align(e){this._align!==e&&(this._align=e,this.styleID++)}get breakWords(){return this._breakWords}set breakWords(e){this._breakWords!==e&&(this._breakWords=e,this.styleID++)}get dropShadow(){return this._dropShadow}set dropShadow(e){this._dropShadow!==e&&(this._dropShadow=e,this.styleID++)}get dropShadowAlpha(){return this._dropShadowAlpha}set dropShadowAlpha(e){this._dropShadowAlpha!==e&&(this._dropShadowAlpha=e,this.styleID++)}get dropShadowAngle(){return this._dropShadowAngle}set dropShadowAngle(e){this._dropShadowAngle!==e&&(this._dropShadowAngle=e,this.styleID++)}get dropShadowBlur(){return this._dropShadowBlur}set dropShadowBlur(e){this._dropShadowBlur!==e&&(this._dropShadowBlur=e,this.styleID++)}get dropShadowColor(){return this._dropShadowColor}set dropShadowColor(e){const t=Zf(e);this._dropShadowColor!==t&&(this._dropShadowColor=t,this.styleID++)}get dropShadowDistance(){return this._dropShadowDistance}set dropShadowDistance(e){this._dropShadowDistance!==e&&(this._dropShadowDistance=e,this.styleID++)}get fill(){return this._fill}set fill(e){const t=Zf(e);this._fill!==t&&(this._fill=t,this.styleID++)}get fillGradientType(){return this._fillGradientType}set fillGradientType(e){this._fillGradientType!==e&&(this._fillGradientType=e,this.styleID++)}get fillGradientStops(){return this._fillGradientStops}set fillGradientStops(e){bk(this._fillGradientStops,e)||(this._fillGradientStops=e,this.styleID++)}get fontFamily(){return this._fontFamily}set fontFamily(e){this.fontFamily!==e&&(this._fontFamily=e,this.styleID++)}get fontSize(){return this._fontSize}set fontSize(e){this._fontSize!==e&&(this._fontSize=e,this.styleID++)}get fontStyle(){return this._fontStyle}set fontStyle(e){this._fontStyle!==e&&(this._fontStyle=e,this.styleID++)}get fontVariant(){return this._fontVariant}set fontVariant(e){this._fontVariant!==e&&(this._fontVariant=e,this.styleID++)}get fontWeight(){return this._fontWeight}set fontWeight(e){this._fontWeight!==e&&(this._fontWeight=e,this.styleID++)}get letterSpacing(){return this._letterSpacing}set letterSpacing(e){this._letterSpacing!==e&&(this._letterSpacing=e,this.styleID++)}get lineHeight(){return this._lineHeight}set lineHeight(e){this._lineHeight!==e&&(this._lineHeight=e,this.styleID++)}get leading(){return this._leading}set leading(e){this._leading!==e&&(this._leading=e,this.styleID++)}get lineJoin(){return this._lineJoin}set lineJoin(e){this._lineJoin!==e&&(this._lineJoin=e,this.styleID++)}get miterLimit(){return this._miterLimit}set miterLimit(e){this._miterLimit!==e&&(this._miterLimit=e,this.styleID++)}get padding(){return this._padding}set padding(e){this._padding!==e&&(this._padding=e,this.styleID++)}get stroke(){return this._stroke}set stroke(e){const t=Zf(e);this._stroke!==t&&(this._stroke=t,this.styleID++)}get strokeThickness(){return this._strokeThickness}set strokeThickness(e){this._strokeThickness!==e&&(this._strokeThickness=e,this.styleID++)}get textBaseline(){return this._textBaseline}set textBaseline(e){this._textBaseline!==e&&(this._textBaseline=e,this.styleID++)}get trim(){return this._trim}set trim(e){this._trim!==e&&(this._trim=e,this.styleID++)}get whiteSpace(){return this._whiteSpace}set whiteSpace(e){this._whiteSpace!==e&&(this._whiteSpace=e,this.styleID++)}get wordWrap(){return this._wordWrap}set wordWrap(e){this._wordWrap!==e&&(this._wordWrap=e,this.styleID++)}get wordWrapWidth(){return this._wordWrapWidth}set wordWrapWidth(e){this._wordWrapWidth!==e&&(this._wordWrapWidth=e,this.styleID++)}toFontString(){const e=typeof this.fontSize=="number"?`${this.fontSize}px`:this.fontSize;let t=this.fontFamily;Array.isArray(this.fontFamily)||(t=this.fontFamily.split(","));for(let i=t.length-1;i>=0;i--){let s=t[i].trim();!/([\"\'])[^\'\"]+\1/.test(s)&&!yk.includes(s)&&(s=`"${s}"`),t[i]=s}return`${this.fontStyle} ${this.fontVariant} ${this.fontWeight} ${e} ${t.join(",")}`}};fS.defaultStyle={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fillGradientType:ld.LINEAR_VERTICAL,fillGradientStops:[],fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",leading:0,letterSpacing:0,lineHeight:0,lineJoin:"miter",miterLimit:10,padding:0,stroke:"black",strokeThickness:0,textBaseline:"alphabetic",trim:!1,whiteSpace:"pre",wordWrap:!1,wordWrapWidth:100};let Jr=fS;function Zf(n){const e=kt.shared,t=i=>{const s=e.setValue(i);return s.alpha===1?s.toHex():s.toRgbaString()};return Array.isArray(n)?n.map(t):t(n)}function bk(n,e){if(!Array.isArray(n)||!Array.isArray(e)||n.length!==e.length)return!1;for(let t=0;t0&&m>p&&(g=(p+m)/2);const v=p+d,b=i.lineHeight*(f+1);let y=v;f+10}}function Sk(n,e){var i;let t=!1;if((i=n==null?void 0:n._textures)!=null&&i.length){for(let s=0;s{this.queue&&this.prepareItems()},this.registerFindHook(Mk),this.registerFindHook(Ak),this.registerFindHook(Sk),this.registerFindHook(_k),this.registerFindHook(Tk),this.registerUploadHook(Ek),this.registerUploadHook(Ck)}upload(e){return new Promise(t=>{e&&this.add(e),this.queue.length?(this.completes.push(t),this.ticking||(this.ticking=!0,nn.system.addOnce(this.tick,this,Uo.UTILITY))):t()})}tick(){setTimeout(this.delayedTick,0)}prepareItems(){for(this.limiter.beginFrame();this.queue.length&&this.limiter.allowedToUpload();){const e=this.queue[0];let t=!1;if(e&&!e._destroyed){for(let i=0,s=this.uploadHooks.length;i=0;t--)this.add(e.children[t]);return this}destroy(){this.ticking&&nn.system.remove(this.tick,this),this.ticking=!1,this.addHooks=null,this.uploadHooks=null,this.renderer=null,this.completes=null,this.queue=null,this.limiter=null,this.uploadHookHelper=null}};pS.uploadsPerFrame=4;let mp=pS;Object.defineProperties(Ve,{UPLOADS_PER_FRAME:{get(){return mp.uploadsPerFrame},set(n){pt("7.1.0","settings.UPLOADS_PER_FRAME is deprecated, use prepare.BasePrepare.uploadsPerFrame"),mp.uploadsPerFrame=n}}});function vS(n,e){return e instanceof rt?(e._glTextures[n.CONTEXT_UID]||n.texture.bind(e),!0):!1}function Ik(n,e){if(!(e instanceof Ki))return!1;const{geometry:t}=e;e.finishPoly(),t.updateBatches();const{batches:i}=t;for(let s=0;s1?es.from(kk,Rk,t):es.from(zy,Fk,t)}render(e){const t=this.renderer,i=this.quad;let s=i.vertices;s[0]=s[6]=e._width*-e.anchor.x,s[1]=s[3]=e._height*-e.anchor.y,s[2]=s[4]=e._width*(1-e.anchor.x),s[5]=s[7]=e._height*(1-e.anchor.y);const r=e.uvRespectAnchor?e.anchor.x:0,o=e.uvRespectAnchor?e.anchor.y:0;s=i.uvs,s[0]=s[6]=-r,s[1]=s[3]=-o,s[2]=s[4]=1-r,s[5]=s[7]=1-o,i.invalidate();const a=e._texture,c=a.baseTexture,l=c.alphaMode>0,h=e.tileTransform.localTransform,u=e.uvMatrix;let d=c.isPowerOfTwo&&a.frame.width===c.width&&a.frame.height===c.height;d&&(c._glTextures[t.CONTEXT_UID]?d=c.wrapMode!==Jn.CLAMP:c.wrapMode===Jn.CLAMP&&(c.wrapMode=Jn.REPEAT));const f=d?this.simpleShader:this.shader,m=a.width,p=a.height,g=e._width,v=e._height;Jc.set(h.a*m/g,h.b*m/v,h.c*p/g,h.d*p/v,h.tx/g,h.ty/v),Jc.invert(),d?Jc.prepend(u.mapCoord):(f.uniforms.uMapCoord=u.mapCoord.toArray(!0),f.uniforms.uClampFrame=u.uClampFrame,f.uniforms.uClampOffset=u.uClampOffset),f.uniforms.uTransform=Jc.toArray(!0),f.uniforms.uColor=kt.shared.setValue(e.tint).premultiply(e.worldAlpha,l).toArray(f.uniforms.uColor),f.uniforms.translationMatrix=e.transform.worldTransform.toArray(!0),f.uniforms.uSampler=a,t.shader.bind(f),t.geometry.bind(i),this.state.blendMode=hw(e.blendMode,l),t.state.set(this.state),t.geometry.draw(this.renderer.gl.TRIANGLES,6,0)}}bS.extension={name:"tilingSprite",type:$e.RendererPlugin};je.add(bS);const xS=class Cl{constructor(e,t,i){this.linkedSheets=[],(e instanceof rt||e instanceof it)&&(e={texture:e,data:t,resolutionFilename:i});const{texture:s,data:r,resolutionFilename:o=null,cachePrefix:a=""}=e;this.cachePrefix=a,this._texture=s instanceof it?s:null,this.baseTexture=s instanceof rt?s:this._texture.baseTexture,this.textures={},this.animations={},this.data=r;const c=this.baseTexture.resource;this.resolution=this._updateResolution(o||(c?c.url:null)),this._frames=this.data.frames,this._frameKeys=Object.keys(this._frames),this._batchIndex=0,this._callback=null}_updateResolution(e=null){const{scale:t}=this.data.meta;let i=fr(e,null);return i===null&&(i=typeof t=="number"?t:parseFloat(t??"1")),i!==1&&this.baseTexture.setResolution(i),i}parse(){return new Promise(e=>{this._callback=e,this._batchIndex=0,this._frameKeys.length<=Cl.BATCH_SIZE?(this._processFrames(0),this._processAnimations(),this._parseComplete()):this._nextBatch()})}_processFrames(e){let t=e;const i=Cl.BATCH_SIZE;for(;t-e{this._batchIndex*Cl.BATCH_SIZE{i[s]=e}),Object.keys(e.textures).forEach(s=>{i[`${e.cachePrefix}${s}`]=e.textures[s]}),!t){const s=di.dirname(n[0]);e.linkedSheets.forEach((r,o)=>{Object.assign(i,wS([`${s}/${e.data.meta.related_multi_packs[o]}`],r,!0))})}return i}const $k={extension:$e.Asset,cache:{test:n=>n instanceof qy,getCacheableAssets:(n,e)=>wS(n,e,!1)},resolver:{test:n=>{const e=n.split("?")[0].split("."),t=e.pop(),i=e.pop();return t==="json"&&Ok.includes(i)},parse:n=>{var t;const e=n.split(".");return{resolution:parseFloat(((t=Ve.RETINA_PREFIX.exec(n))==null?void 0:t[1])??"1"),format:e[e.length-2],src:n}}},loader:{name:"spritesheetLoader",extension:{type:$e.LoadParser,priority:_n.Normal},async testParse(n,e){return di.extname(e.src).toLowerCase()===".json"&&!!n.frames},async parse(n,e,t){var h,u;const{texture:i,imageFilename:s,cachePrefix:r}=(e==null?void 0:e.data)??{};let o=di.dirname(e.src);o&&o.lastIndexOf("/")!==o.length-1&&(o+="/");let a;if(i&&i.baseTexture)a=i;else{const d=eu(o+(s??n.meta.image),e.src);a=(await t.load([d]))[d]}const c=new qy({texture:a.baseTexture,data:n,resolutionFilename:e.src,cachePrefix:r});await c.parse();const l=(h=n==null?void 0:n.meta)==null?void 0:h.related_multi_packs;if(Array.isArray(l)){const d=[];for(const m of l){if(typeof m!="string")continue;let p=o+m;(u=e.data)!=null&&u.ignoreMultiPack||(p=eu(p,e.src),d.push(t.load({src:p,data:{ignoreMultiPack:!0}})))}const f=await Promise.all(d);c.linkedSheets=f,f.forEach(m=>{m.linkedSheets=[c].concat(c.linkedSheets.filter(p=>p!==m))})}return c},unload(n){n.destroy(!0)}}};je.add($k);class ou{constructor(){this.info=[],this.common=[],this.page=[],this.char=[],this.kerning=[],this.distanceField=[]}}class Eh{static test(e){return typeof e=="string"&&e.startsWith("info face=")}static parse(e){const t=e.match(/^[a-z]+\s+.+$/gm),i={info:[],common:[],page:[],char:[],chars:[],kerning:[],kernings:[],distanceField:[]};for(const r in t){const o=t[r].match(/^[a-z]+/gm)[0],a=t[r].match(/[a-zA-Z]+=([^\s"']+|"([^"]*)")/gm),c={};for(const l in a){const h=a[l].split("="),u=h[0],d=h[1].replace(/"/gm,""),f=parseFloat(d),m=isNaN(f)?d:f;c[u]=m}i[o].push(c)}const s=new ou;return i.info.forEach(r=>s.info.push({face:r.face,size:parseInt(r.size,10)})),i.common.forEach(r=>s.common.push({lineHeight:parseInt(r.lineHeight,10)})),i.page.forEach(r=>s.page.push({id:parseInt(r.id,10),file:r.file})),i.char.forEach(r=>s.char.push({id:parseInt(r.id,10),page:parseInt(r.page,10),x:parseInt(r.x,10),y:parseInt(r.y,10),width:parseInt(r.width,10),height:parseInt(r.height,10),xoffset:parseInt(r.xoffset,10),yoffset:parseInt(r.yoffset,10),xadvance:parseInt(r.xadvance,10)})),i.kerning.forEach(r=>s.kerning.push({first:parseInt(r.first,10),second:parseInt(r.second,10),amount:parseInt(r.amount,10)})),i.distanceField.forEach(r=>s.distanceField.push({distanceRange:parseInt(r.distanceRange,10),fieldType:r.fieldType})),s}}class pp{static test(e){const t=e;return typeof e!="string"&&"getElementsByTagName"in e&&t.getElementsByTagName("page").length&&t.getElementsByTagName("info")[0].getAttribute("face")!==null}static parse(e){const t=new ou,i=e.getElementsByTagName("info"),s=e.getElementsByTagName("common"),r=e.getElementsByTagName("page"),o=e.getElementsByTagName("char"),a=e.getElementsByTagName("kerning"),c=e.getElementsByTagName("distanceField");for(let l=0;l")?pp.test(Ve.ADAPTER.parseXML(e)):!1}static parse(e){return pp.parse(Ve.ADAPTER.parseXML(e))}}const em=[Eh,pp,gp];function Nk(n){for(let e=0;e=c-P*o){if(p===0)throw new Error(`[BitmapFont] textureHeight ${c}px is too small (fontFamily: '${u.fontFamily}', fontSize: ${u.fontSize}px, char: '${S}')`);--E,g=null,v=null,b=null,p=0,m=0,y=0;continue}if(y=Math.max(P+C.fontProperties.descent,y),A*o+m>=d){if(m===0)throw new Error(`[BitmapFont] textureWidth ${a}px is too small (fontFamily: '${u.fontFamily}', fontSize: ${u.fontSize}px, char: '${S}')`);--E,p+=y*o,p=Math.ceil(p),m=0,y=0;continue}Bk(g,v,C,m,p,o,u);const R=Ch(C.text);f.char.push({id:R,page:x.length-1,x:m/o,y:p/o,width:A,height:P,xoffset:0,yoffset:0,xadvance:M-(u.dropShadow?u.dropShadowDistance:0)-(u.stroke?u.strokeThickness:0)}),m+=(A+2*r)*o,m=Math.ceil(m)}if(!(i!=null&&i.skipKerning))for(let E=0,S=h.length;E 0.99) {\r + alpha = 1.0;\r + }\r +\r + // Gamma correction for coverage-like alpha\r + float luma = dot(uColor.rgb, vec3(0.299, 0.587, 0.114));\r + float gamma = mix(1.0, 1.0 / 2.2, luma);\r + float coverage = pow(uColor.a * alpha, gamma); \r +\r + // NPM Textures, NPM outputs\r + gl_FragColor = vec4(uColor.rgb, coverage);\r +}\r +`,Xk=`// Mesh material default fragment\r +attribute vec2 aVertexPosition;\r +attribute vec2 aTextureCoord;\r +\r +uniform mat3 projectionMatrix;\r +uniform mat3 translationMatrix;\r +uniform mat3 uTextureMatrix;\r +\r +varying vec2 vTextureCoord;\r +\r +void main(void)\r +{\r + gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\r +\r + vTextureCoord = (uTextureMatrix * vec3(aTextureCoord, 1.0)).xy;\r +}\r +`;const Ky=[],Jy=[],Zy=[],Yk=class _S extends Mi{constructor(e,t={}){super();const{align:i,tint:s,maxWidth:r,letterSpacing:o,fontName:a,fontSize:c}=Object.assign({},_S.styleDefaults,t);if(!Ar.available[a])throw new Error(`Missing BitmapFont "${a}"`);this._activePagesMeshData=[],this._textWidth=0,this._textHeight=0,this._align=i,this._tintColor=new kt(s),this._font=void 0,this._fontName=a,this._fontSize=c,this.text=e,this._maxWidth=r,this._maxLineHeight=0,this._letterSpacing=o,this._anchor=new Js(()=>{this.dirty=!0},this,0,0),this._roundPixels=Ve.ROUND_PIXELS,this.dirty=!0,this._resolution=Ve.RESOLUTION,this._autoResolution=!0,this._textureCache={}}updateText(){var A;const e=Ar.available[this._fontName],t=this.fontSize,i=t/e.size,s=new Tt,r=[],o=[],a=[],c=this._text.replace(/(?:\r\n|\r)/g,` +`)||" ",l=SS(c),h=this._maxWidth*e.size/t,u=e.distanceFieldType==="none"?Ky:Jy;let d=null,f=0,m=0,p=0,g=-1,v=0,b=0,y=0,x=0;for(let R=0;R0&&s.x>h&&(++b,Pa(r,1+g-b,1+R-g),R=g,g=-1,o.push(v),a.push(r.length>0?r[r.length-1].prevSpaces:0),m=Math.max(m,v),p++,s.x=0,s.y+=e.lineHeight,d=null,x=0)}const _=l[l.length-1];_!=="\r"&&_!==` +`&&(/(?:\s)/.test(_)&&(f=v),o.push(f),m=Math.max(m,f),a.push(-1));const E=[];for(let R=0;R<=p;R++){let B=0;this._align==="right"?B=m-o[R]:this._align==="center"?B=(m-o[R])/2:this._align==="justify"&&(B=a[R]<0?0:(m-o[R])/a[R]),E.push(B)}const S=r.length,C={},M=[],P=this._activePagesMeshData;u.push(...P);for(let R=0;R6*O)||B.vertices.lengtht[s.mesh.texture.baseTexture.uid]).forEach(s=>{s.mesh.texture=it.EMPTY});for(const s in t)t[s].destroy(),delete t[s];this._font=null,this._tintColor=null,this._textureCache=null,super.destroy(e)}};Yk.styleDefaults={align:"left",tint:16777215,maxWidth:0,letterSpacing:0};const Gk=[".xml",".fnt"],Hk={extension:{type:$e.LoadParser,priority:_n.Normal},name:"loadBitmapFont",test(n){return Gk.includes(di.extname(n).toLowerCase())},async testParse(n){return Eh.test(n)||gp.test(n)},async parse(n,e,t){const i=Eh.test(n)?Eh.parse(n):gp.parse(n),{src:s}=e,{page:r}=i,o=[];for(let l=0;la[l]);return Ar.install(i,c,!0)},async load(n,e){return(await Ve.ADAPTER.fetch(n)).text()},unload(n){n.destroy()}};je.add(Hk);const vp=class va extends Jr{constructor(){super(...arguments),this._fonts=[],this._overrides=[],this._stylesheet="",this.fontsDirty=!1}static from(e){return new va(Object.keys(va.defaultOptions).reduce((t,i)=>({...t,[i]:e[i]}),{}))}cleanFonts(){this._fonts.length>0&&(this._fonts.forEach(e=>{URL.revokeObjectURL(e.src),e.refs--,e.refs===0&&(e.fontFace&&document.fonts.delete(e.fontFace),delete va.availableFonts[e.originalUrl])}),this.fontFamily="Arial",this._fonts.length=0,this.styleID++,this.fontsDirty=!0)}loadFont(e,t={}){const{availableFonts:i}=va;if(i[e]){const s=i[e];return this._fonts.push(s),s.refs++,this.styleID++,this.fontsDirty=!0,Promise.resolve()}return Ve.ADAPTER.fetch(e).then(s=>s.blob()).then(async s=>new Promise((r,o)=>{const a=URL.createObjectURL(s),c=new FileReader;c.onload=()=>r([a,c.result]),c.onerror=o,c.readAsDataURL(s)})).then(async([s,r])=>{const o=Object.assign({family:di.basename(e,di.extname(e)),weight:"normal",style:"normal",display:"auto",src:s,dataSrc:r,refs:1,originalUrl:e,fontFace:null},t);i[e]=o,this._fonts.push(o),this.styleID++;const a=new FontFace(o.family,`url(${o.src})`,{weight:o.weight,style:o.style,display:o.display});o.fontFace=a,await a.load(),document.fonts.add(a),await document.fonts.ready,this.styleID++,this.fontsDirty=!0})}addOverride(...e){const t=e.filter(i=>!this._overrides.includes(i));t.length>0&&(this._overrides.push(...t),this.styleID++)}removeOverride(...e){const t=e.filter(i=>this._overrides.includes(i));t.length>0&&(this._overrides=this._overrides.filter(i=>!t.includes(i)),this.styleID++)}toCSS(e){return[`transform: scale(${e})`,"transform-origin: top left","display: inline-block",`color: ${this.normalizeColor(this.fill)}`,`font-size: ${this.fontSize}px`,`font-family: ${this.fontFamily}`,`font-weight: ${this.fontWeight}`,`font-style: ${this.fontStyle}`,`font-variant: ${this.fontVariant}`,`letter-spacing: ${this.letterSpacing}px`,`text-align: ${this.align}`,`padding: ${this.padding}px`,`white-space: ${this.whiteSpace}`,...this.lineHeight?[`line-height: ${this.lineHeight}px`]:[],...this.wordWrap?[`word-wrap: ${this.breakWords?"break-all":"break-word"}`,`max-width: ${this.wordWrapWidth}px`]:[],...this.strokeThickness?[`-webkit-text-stroke-width: ${this.strokeThickness}px`,`-webkit-text-stroke-color: ${this.normalizeColor(this.stroke)}`,`text-stroke-width: ${this.strokeThickness}px`,`text-stroke-color: ${this.normalizeColor(this.stroke)}`,"paint-order: stroke"]:[],...this.dropShadow?[this.dropShadowToCSS()]:[],...this._overrides].join(";")}toGlobalCSS(){return this._fonts.reduce((e,t)=>`${e} + @font-face { + font-family: "${t.family}"; + src: url('${t.dataSrc}'); + 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=OI(e)),typeof e=="number"?LI(e):e}dropShadowToCSS(){let e=this.normalizeColor(this.dropShadowColor);const t=this.dropShadowAlpha,i=Math.round(Math.cos(this.dropShadowAngle)*this.dropShadowDistance),s=Math.round(Math.sin(this.dropShadowAngle)*this.dropShadowDistance);e.startsWith("#")&&t<1&&(e+=(t*255|0).toString(16).padStart(2,"0"));const r=`${i}px ${s}px`;return this.dropShadowBlur>0?`text-shadow: ${r} ${this.dropShadowBlur}px ${e}`:`text-shadow: ${r} ${e}`}reset(){Object.assign(this,va.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}};vp.availableFonts={},vp.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 tm=vp;const Zc=class ya extends to{constructor(e="",t={}){super(it.EMPTY),this._text=null,this._style=null,this._autoResolution=!0,this.localStyleID=-1,this.dirty=!1,this._updateID=0,this.ownsStyle=!1;const i=new Image,s=it.from(i,{scaleMode:Ve.SCALE_MODE,resourceOptions:{autoLoad:!1}});s.orig=new dt,s.trim=new dt,this.texture=s;const r="http://www.w3.org/2000/svg",o="http://www.w3.org/1999/xhtml",a=document.createElementNS(r,"svg"),c=document.createElementNS(r,"foreignObject"),l=document.createElementNS(o,"div"),h=document.createElementNS(o,"style");c.setAttribute("width","10000"),c.setAttribute("height","10000"),c.style.overflow="hidden",a.appendChild(c),this.maxWidth=ya.defaultMaxWidth,this.maxHeight=ya.defaultMaxHeight,this._domElement=l,this._styleElement=h,this._svgRoot=a,this._foreignObject=c,this._foreignObject.appendChild(h),this._foreignObject.appendChild(l),this._image=i,this._loadImage=new Image,this._autoResolution=ya.defaultAutoResolution,this._resolution=ya.defaultResolution??Ve.RESOLUTION,this.text=e,this.style=t}measureText(e){var h,u;const{text:t,style:i,resolution:s}=Object.assign({text:this._text,style:this._style,resolution:this._resolution},e);Object.assign(this._domElement,{innerHTML:t,style:i.toCSS(s)}),this._styleElement.textContent=i.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 c=Math.min(this.maxWidth,Math.ceil(o)),l=Math.min(this.maxHeight,Math.ceil(a));return this._svgRoot.setAttribute("width",c.toString()),this._svgRoot.setAttribute("height",l.toString()),t!==this._text&&(this._domElement.innerHTML=this._text),i!==this._style&&(Object.assign(this._domElement,{style:(h=this._style)==null?void 0:h.toCSS(s)}),this._styleElement.textContent=(u=this._style)==null?void 0:u.toGlobalCSS()),{width:c+i.padding*2,height:l+i.padding*2}}async updateText(e=!0){const{style:t,_image:i,_loadImage:s}=this;if(this.localStyleID!==t.styleID&&(this.dirty=!0,this.localStyleID=t.styleID),!this.dirty&&e)return;const{width:r,height:o}=this.measureText();i.width=s.width=Math.ceil(Math.max(1,r)),i.height=s.height=Math.ceil(Math.max(1,o)),this._updateID++;const a=this._updateID;await new Promise(c=>{s.onload=async()=>{if(a/gi,"

").replace(/
/gi,"
").replace(/ /gi," ")}};Zc.defaultDestroyOptions={texture:!0,children:!1,baseTexture:!0},Zc.defaultMaxWidth=2024,Zc.defaultMaxHeight=2024,Zc.defaultAutoResolution=!0;function au(n,e){const t=Math.max(0,Number(n)||0),i=Math.max(0,Number(e)||0);return{inner:Math.min(t,i),outer:Math.max(t,i)}}function TS(n){const e=Math.max(0,Number(n.outerRectW)||0),t=Math.max(0,Number(n.outerRectH)||0);return{innerW:Math.min(e,Math.max(0,Number(n.innerRectW)||0)),innerH:Math.min(t,Math.max(0,Number(n.innerRectH)||0)),outerW:e,outerH:t}}function jk(n,e,t,i,s){if(n==="random")return s();const r=Math.max(1,Math.round(t)),o=Math.max(0,Math.round(e))%r;return i?o/r:r<=1?.5:o/(r-1)}function Qy(n,e,t,i){const s=Math.sqrt(n*n+i()*(e*e-n*n));return{x:Math.cos(t)*s,y:-Math.sin(t)*s,radialAngle:-t*180/Math.PI}}function Wk(n,e){const{innerW:t,innerH:i,outerW:s,outerH:r}=TS(n),o=Math.max(0,(s-t)/2),a=Math.max(0,(r-i)/2),c=o*r,l=t*a,h=c*2+l*2;if(h<=0){const m=s*2+r*2;if(m<=0)return{x:0,y:0,radialAngle:0};let p=e()*m,g,v;return pt?0:n==="linear"?1-e/t:n==="inverse"?Math.min(10,t/Math.max(e,t*.1)):1}function Jk(n,e,t,i,s,r,o){const a=n-t,c=e-i,l=Math.hypot(a,c);if(l<=1e-4||l>r)return{x:0,y:0};const h=s*ES(o,l,r)*10;return{x:-c/l*h,y:a/l*h}}function Zk(n,e,t){const i=n.rotation*Math.PI/180,s=Math.cos(i),r=Math.sin(i),o=Math.max(1e-4,Math.abs(n.scaleX??1)),a=Math.max(1e-4,Math.abs(n.scaleY??1)),c=e-n.x,l=t-n.y,h=(s*c+r*l)/o,u=(-r*c+s*l)/a,d=(E,S,C,M)=>{const P=C/o,A=M/a,R=Math.max(1e-4,Math.hypot(P,A)),B=P/R,O=A/R,W=s*B-r*O,V=r*B+s*O;return{x:n.x+s*E*o-r*S*a+W*.05,y:n.y+r*E*o+s*S*a+V*.05,nx:W,ny:V}};if(n.shape==="circle"){const E=Math.max(.001,n.radius),S=Math.hypot(h,u);if(S>=E)return null;const C=S>1e-4?h/S:1,M=S>1e-4?u/S:0;return d(C*E,M*E,C,M)}if(n.shape==="ellipse"){const E=Math.max(.001,n.radiusX),S=Math.max(.001,n.radiusY),C=Math.hypot(h/E,u/S);if(C>=1)return null;const M=C>1e-4?1/C:1,P=C>1e-4?h*M:E,A=C>1e-4?u*M:0,R=Math.max(1e-4,Math.hypot(P/(E*E),A/(S*S)));return d(P,A,P/(E*E)/R,A/(S*S)/R)}if(n.shape==="rect"){const E=Math.max(.001,n.width*.5),S=Math.max(.001,n.height*.5);if(Math.abs(h)>=E||Math.abs(u)>=S)return null;const C=E-Math.abs(h),M=S-Math.abs(u);if(C=0?1:-1;return d(A*E,u,A,0)}const P=u>=0?1:-1;return d(h,P*S,0,P)}const f=Math.max(3,Math.min(16,Math.round(n.sides||(n.shape==="custom"?5:6)))),m=Math.max(.001,n.width*.5),p=Math.max(.001,n.height*.5),g=Array.from({length:f},(E,S)=>{const C=Math.PI*.5+S/f*Math.PI*2;return{x:Math.cos(C)*m,y:Math.sin(C)*p}});let v=!1;for(let E=0,S=g.length-1;Eu!=M.y>u&&h<(M.x-C.x)*(u-C.y)/(M.y-C.y)+C.x&&(v=!v)}if(!v)return null;let b=g[0].x,y=g[0].y,x=1/0;for(let E=0;E>>0^Math.imul(e+1,2654435761)^t)>>>0;return i^=i>>>16,i=Math.imul(i,2146121005),i^=i>>>15,i=Math.imul(i,2221713035),i^=i>>>16,(i>>>0)/4294967296}function oa(n,e,t,i,s){return n==="fixed"?e:n==="curve"?Li(e,t,ws(i,s)):Li(e,t,s)}function im(n,e,t,i,s,r){return n==="curve"?Li(e,t,ws(i,s)):n==="random"?r:e}function ib(n,e,t,i,s){const r=1-s;return r*r*r*n+3*r*r*s*e+3*r*s*s*t+s*s*s*i}function ws(n,e,t="线性"){if(!Array.isArray(n)||n.length===0)return 1;const i=[...n].sort((s,r)=>s.x-r.x);if(e<=i[0].x)return i[0].y;if(e>=i[i.length-1].x)return i[i.length-1].y;for(let s=0;s=i[s].x&&e<=i[s+1].x){const r=i[s],o=i[s+1],a=o.x-r.x||1;if(t!=="贝塞尔")return Li(r.y,o.y,(e-r.x)/a);const c=r.x+(r.outX??a/3),l=r.y+(r.outY??(o.y-r.y)/3),h=o.x+(o.inX??-a/3),u=o.y+(o.inY??-(o.y-r.y)/3);let d=0,f=1;for(let m=0;m<14;m++){const p=(d+f)/2;ib(r.x,c,h,o.x,p)>>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 Oa(n){let e=n.replace("#","");return e.length===3&&(e=e.split("").map(t=>t+t).join("")),parseInt(e,16)}function eF(n,e,t){const i=nb(n),s=nb(e),r=Math.round(i[0]+(s[0]-i[0])*t),o=Math.round(i[1]+(s[1]-i[1])*t),a=Math.round(i[2]+(s[2]-i[2])*t);return r<<16|o<<8|a}function yp(n,e){if(!Array.isArray(n)||n.length===0)return 16777215;const t=[...n].sort((i,s)=>i.position-s.position);if(e<=t[0].position)return Oa(t[0].color);if(e>=t[t.length-1].position)return Oa(t[t.length-1].color);for(let i=0;ir.position)continue;const o=(e-s.position)/Math.max(1e-4,r.position-s.position);return eF(s.color,r.color,o)}return Oa(t[t.length-1].color)}function nb(n){let e=n.replace("#","");e.length===3&&(e=e.split("").map(i=>i+i).join(""));const t=parseInt(e,16);return[t>>16&255,t>>8&255,t&255]}function sb(n,e){const t=Math.min(255,(n>>16&255)+(e>>16&255)),i=Math.min(255,(n>>8&255)+(e>>8&255)),s=Math.min(255,(n&255)+(e&255));return t<<16|i<<8|s}function tF(){return{sprite:null,boneName:"",mesh:null,meshSignature:"",history:[],bones:[],skinWeights:[],currentWidth:0,currentAlpha:0,currentColor:16777215,resourceId:1,enabled:!1,sampledLength:100,sampledWidth:100}}function Mh(n){n.history.length=0,n.bones.length=0,n.mesh&&(n.mesh.visible=!1)}class iF{constructor(e){T(this,"container");this.container=e}ensureMesh(e,t,i){const s=t.trailResources.find(g=>g.id===e.resourceId)||t.trailResources[0],r=(s==null?void 0:s.texture)||it.EMPTY,o=Number(s==null?void 0:s.rotation)||0,a=Math.max(2,Math.min(16,Math.round(t.trailGridRows))),c=Math.max(2,Math.min(32,Math.round(t.trailGridCols))),l=Math.max(2,Math.min(16,Math.round((s==null?void 0:s.boneCount)??3))),h=`${a}:${c}:${l}:${(s==null?void 0:s.id)??0}:${o}`;if(e.mesh&&e.meshSignature===h)return e.mesh.texture!==r&&(e.mesh.texture=r),e.mesh;e.mesh&&(this.container.removeChild(e.mesh),e.mesh.destroy()),e.meshSignature&&e.meshSignature!==h&&(e.history.length=0,e.bones.length=0);const u=new Float32Array(a*c*2),d=new Float32Array(a*c*2),f=[],m=[];for(let g=0;g.05?e.history.unshift({x:t,y:i}):(r.x=t,r.y=i);const o=Math.max(1,s)*1.5;let a=0,c=e.history.length;for(let l=1;l=o||l>=239){c=l+1;break}e.history.length>c&&(e.history.length=c)}sampleBones(e,t,i){const s=Math.max(2,Math.min(16,Math.round(i))),r=e.history,o=[];if(!r.length)return o;let a=0;for(let l=1;l=h&&g>1e-4){const v=(h-u)/g;d={x:Li(m.x,p.x,v),y:Li(m.y,p.y,v)};break}u+=g}o.push({boneName:`${e.boneName}_trail_${l}`,x:d.x,y:d.y,rotation:0})}for(let l=0;l1){const l=o[0].rotation,u=(o[o.length-1].rotation-l+540)%360-180;for(let d=0;dh.id===i.resourceId)||t.trailResources[0];if(!(r!=null&&r.texture)||i.bones.length<2){s.visible=!1;return}e.resourceId=r.id,s.texture!==r.texture&&(s.texture=r.texture);const o=Math.max(2,Math.min(16,Math.round(t.trailGridRows))),a=Math.max(2,Math.min(32,Math.round(t.trailGridCols))),c=s.vertices,l=[];for(let h=0;h.5&&i.alpha>0}update(e,t,i,s,r,o,a){if(e.sprite=a,e.boneName=i,!t.trail||!e.enabled||e.sampledLength<=0||e.sampledWidth<=0){Mh(e);return}this.ensureMesh(e,t,a);const c=t.trailResources.find(f=>f.id===e.resourceId)||t.trailResources[0];this.appendPoint(e,s,r,e.sampledLength);const l=c!=null&&c.lifeLengthEnabled?Math.max(0,ws(c.lifeLengthCurve,o)):1,h=Math.max(0,e.sampledLength)*l;e.bones=this.sampleBones(e,h,(c==null?void 0:c.boneCount)??3),e.bones[0]&&(e.bones[0].x=s,e.bones[0].y=r);const u=(c==null?void 0:c.widthMode)==="particle"?(Math.abs(a.scale.x)+Math.abs(a.scale.y))*.5:1;e.currentWidth=Math.max(0,e.sampledWidth)*u,e.currentAlpha=(c==null?void 0:c.alphaMode)==="particle"?a.alpha:(c==null?void 0:c.alphaMode)==="curve"?ws(c.alphaCurve,o):(c==null?void 0:c.alpha)??1,e.currentColor=(c==null?void 0:c.colorMode)==="particle"?a.tint:(c==null?void 0:c.colorMode)==="curve"?yp(c.colorGradient,o):Oa((c==null?void 0:c.color)||"#ffffff");const d={bones:e.bones.map(f=>({...f})),activeBoneCount:e.bones.length,width:e.currentWidth,alpha:Math.min(1,Math.max(0,e.currentAlpha)),colorHex:e.currentColor,resourceId:e.resourceId};return this.skinMesh(e,t,d),d}applyState(e,t,i,s){var r;e.sprite=i,e.resourceId=s.resourceId??((r=t.trailResources[0])==null?void 0:r.id)??1,e.bones=s.bones.map(o=>({...o})),e.currentWidth=s.width,e.currentAlpha=s.alpha,this.skinMesh(e,t,s)}drawDebug(e,t,i,s){if(e.clear(),!t||!i.trail)return;const r=Math.max(2,Math.min(16,Math.round(i.trailGridRows))),o=Math.max(2,Math.min(32,Math.round(i.trailGridCols)));e.lineStyle(1,3790847,.72);for(const a of s){const c=a.mesh;if(!(c!=null&&c.visible))continue;const l=c.vertices,h=(u,d)=>{const f=(u*r+d)*2;return{x:l[f],y:l[f+1]}};for(let u=0;ur.texture||r.sequenceFrames.some(o=>o.texture));if(!t.length)return nF(n.texture);const i=t.reduce((r,o)=>r+Math.max(0,o.weight),0);if(i<=0)return t[Math.floor(e()*t.length)];let s=e()*i;for(const r of t)if(s-=Math.max(0,r.weight),s<=0)return r;return t[t.length-1]}function oF(n,e){const t=n.trailResources.filter(r=>r.texture);if(!t.length)return n.trailResources[0]||sF();const i=t.reduce((r,o)=>r+Math.max(0,o.weight),0);if(i<=0)return t[Math.min(t.length-1,Math.floor(e*t.length))];let s=e*i;for(const r of t)if(s-=Math.max(0,r.weight),s<=0)return r;return t[t.length-1]}function rb(n,e){if(n.imageMode!=="sequence"||n.sequenceFrames.length<=1)return{index:0,visible:!0};const t=Math.min(120,Math.max(1,Number(n.sequenceFps)||30)),i=Math.max(0,Math.floor(Math.max(0,e)*t)),s=n.sequenceFrames.length-1;return n.sequencePlayback==="once-hide"?{index:Math.min(s,i),visible:i<=s}:n.sequencePlayback==="once-hold"?{index:Math.min(s,i),visible:!0}:n.sequencePlayback==="loop-reverse"?{index:s-i%n.sequenceFrames.length,visible:!0}:{index:i%n.sequenceFrames.length,visible:!0}}function sm(n,e,t){var i;return n.imageMode==="sequence"&&n.sequenceFrames.length?((i=n.sequenceFrames[Math.max(0,Math.min(n.sequenceFrames.length-1,t))])==null?void 0:i.texture)||n.texture||e:n.texture||e}function tc(){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,loopStartUseCustomDuration:!1,loopStartDurationFrames:30,generateLoopEndAnimation:!1,loopEndUseCustomDuration:!1,loopEndDurationFrames:30,burstCount:50,burstLoop:!1,delay:0,duration:1,shape:"point",showShape:!0,shapeRangeVersion:1,innerRadius:0,outerRadius:30,innerRectW:0,innerRectH:0,outerRectW:60,outerRectH:40,spawnPathId:0,spawnPathDistribution:"fixed",radius:30,rectW:60,rectH:40,centerX:0,centerY:0,rootRotation:0,rootScaleX:1,rootScaleY:1,renderLayerMode:"top",renderLayerSpineId:0,renderLayerSlotName:"",renderLayerSlotPosition:"above",renderLayerFollowAttachment:!1,emissionAngleMode:"random",direction:0,spread:360,coneDirection:90,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",showForceFieldShape:!0,vortex:!1,vortexStrength:10,vortexRadius:100,vortexCenterX:0,vortexCenterY:0,vortexFalloff:"linear",showVortexShape:!0,attraction:!1,attractionCenterX:200,attractionCenterY:0,attractionRadius:20,attractionDuration:.5,attractionDelay:.1,attractionDelayMode:"particle",attractionPath:"curve",showAttractionShape:!0,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,collisionColliderIds:[],pathFollow:!1,eventEnabled:!1,events:[],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 lr(n){var P;const e=tc(),t=n,i=t.shapeRangeVersion!==1,s=Number(t.radius),r=Number(t.rectW),o=Number(t.rectH),a=Number(t.direction),c=Number(t.spread),l=t.shape,h=t.imageWeightVersion!==1,u=t.loopDurationFrames==null,d=t.gravityMode==null,f=Number(t.gravity),m=t.windMode==null,p=Number(t.windX),g=Number(t.windY),v=t.forceFalloff==null,b=Number(t.forceStrength),y=t.trailConfigVersion!==3,x=!Array.isArray(t.trailResources),_=t.trailResourceVersion!==6,E=t.trailTexture,S=String(t.trailTextureName||"trail"),C=String(t.trailPreviewUrl||"/images/trail.png").replace("/trails/trail.png","/images/trail.png");for(const[A,R]of Object.entries(e))t[A]!==void 0&&t[A]!==null||(t[A]=Array.isArray(R)?R.map(B=>typeof B=="object"&&B!==null?{...B}:B):R);i&&(n.innerRadius=0,n.outerRadius=Math.max(0,Number.isFinite(s)?s:e.outerRadius),n.innerRectW=0,n.innerRectH=0,n.outerRectW=Math.max(0,Number.isFinite(r)?r:e.outerRectW),n.outerRectH=Math.max(0,Number.isFinite(o)?o:e.outerRectH),n.coneDirection=Number.isFinite(a)?a:90,n.emissionAngleMode=Number.isFinite(c)&&c>0?"random":"fixed",l==="cone"&&(n.spread=Math.max(0,Number(n.coneAngle)||0)),n.shapeRangeVersion=1),n.shape==="orbit"&&(n.shape="path"),["fixed","random","radial","path-normal","path-tangent"].includes(n.emissionAngleMode)||(n.emissionAngleMode="fixed"),!["circle","rect","cone"].includes(n.shape)&&n.emissionAngleMode==="radial"&&(n.emissionAngleMode="fixed"),n.shape!=="path"&&(n.emissionAngleMode==="path-normal"||n.emissionAngleMode==="path-tangent")&&(n.emissionAngleMode="fixed"),n.spawnPathId=Math.max(0,Math.round(Number(n.spawnPathId)||0)),n.spawnPathDistribution!=="fixed"&&n.spawnPathDistribution!=="random"&&(n.spawnPathDistribution="fixed"),n.renderLayerMode!=="top"&&n.renderLayerMode!=="slot"&&(n.renderLayerMode="top"),n.renderLayerSpineId=Math.max(0,Math.round(Number(n.renderLayerSpineId)||0)),typeof n.renderLayerSlotName!="string"&&(n.renderLayerSlotName=""),n.renderLayerSlotPosition!=="above"&&n.renderLayerSlotPosition!=="below"&&(n.renderLayerSlotPosition="above"),typeof n.renderLayerFollowAttachment!="boolean"&&(n.renderLayerFollowAttachment=!1),typeof n.eventEnabled!="boolean"&&(n.eventEnabled=!1),Array.isArray(n.events)||(n.events=[]);for(const A of n.events){A.id=Math.max(1,Math.round(Number(A.id)||1)),A.event!=="birth"&&A.event!=="death"&&A.event!=="collision"&&(A.event="birth"),A.targetSystemId=Math.max(0,Math.round(Number(A.targetSystemId)||0));const R=Number(A.probability);A.probability=Math.min(1,Math.max(0,Number.isFinite(R)?R:1));const B=Math.round(Number(A.collisionLimit));A.collisionLimit=Math.min(4,Math.max(1,Number.isFinite(B)?B:1));const O=A.inherit,W=["color","scale","rotation","life"],V=Array.isArray(O)?O:O==="all"?[...W]:W.includes(String(O))?[String(O)]:[],Y=[...new Set(V.filter(N=>W.includes(String(N))))],L=Array.isArray(O)?O:null;(!L||L.length!==Y.length||Y.some((N,F)=>N!==L[F]))&&(A.inherit=Y),A.colorInheritMode!=="add"&&A.colorInheritMode!=="replace"&&(A.colorInheritMode="add")}n.innerRadius=Math.max(0,Number(n.innerRadius)||0),n.outerRadius=Math.max(n.innerRadius,Number(n.outerRadius)||0),n.innerRectW=Math.max(0,Number(n.innerRectW)||0),n.innerRectH=Math.max(0,Number(n.innerRectH)||0),n.outerRectW=Math.max(n.innerRectW,Number(n.outerRectW)||0),n.outerRectH=Math.max(n.innerRectH,Number(n.outerRectH)||0);const M=Array.from(new Set((Array.isArray(n.collisionColliderIds)?n.collisionColliderIds:[]).map(A=>Math.round(Number(A))).filter(A=>Number.isFinite(A)&&A>0)));(M.length!==n.collisionColliderIds.length||M.some((A,R)=>A!==n.collisionColliderIds[R]))&&(n.collisionColliderIds=M),n.streamBehavior!=="normal"&&n.streamBehavior!=="loop"&&(n.streamBehavior="normal"),(u||!Number.isFinite(n.loopDurationFrames))&&(n.loopDurationFrames=Math.ceil(Math.max(1/30,Number(n.duration)||1)*30)),n.loopDurationFrames=Math.min(1800,Math.max(1,Math.ceil(n.loopDurationFrames))),typeof n.generateLoopStartAnimation!="boolean"&&(n.generateLoopStartAnimation=!1),typeof n.generateLoopEndAnimation!="boolean"&&(n.generateLoopEndAnimation=!1),typeof n.loopStartUseCustomDuration!="boolean"&&(n.loopStartUseCustomDuration=!1),typeof n.loopEndUseCustomDuration!="boolean"&&(n.loopEndUseCustomDuration=!1),n.loopStartDurationFrames=Math.min(1800,Math.max(1,Math.ceil(Number(n.loopStartDurationFrames)||30))),n.loopEndDurationFrames=Math.min(1800,Math.max(1,Math.ceil(Number(n.loopEndDurationFrames)||30))),(!Array.isArray(n.imageResources)||n.imageResources.length===0)&&(n.imageResources=tc().imageResources);for(const A of n.imageResources){!A.texture&&n.texture&&(A.texture=n.texture),A.textureName||(A.textureName="star"),A.previewUrl==="/particles/star.png"&&(A.previewUrl="/images/star.png"),A.previewUrl||(A.previewUrl=A.textureName==="star"?"/images/star.png":""),A.imageMode!=="fixed"&&A.imageMode!=="sequence"&&(A.imageMode="fixed"),A.sequencePlayback==="once"?A.sequencePlayback="once-hold":A.sequencePlayback==="loop"?A.sequencePlayback="loop-forward":["once-hide","once-hold","loop-forward","loop-reverse"].includes(A.sequencePlayback)||(A.sequencePlayback="loop-forward"),Number.isFinite(A.sequenceFps)||(A.sequenceFps=30),A.sequenceFps=Math.min(120,Math.max(1,Number(A.sequenceFps)||30)),Array.isArray(A.sequenceFrames)||(A.sequenceFrames=[]);for(const R of A.sequenceFrames)typeof R.name!="string"&&(R.name=""),typeof R.previewUrl!="string"&&(R.previewUrl=""),R.texture===void 0&&(R.texture=null);Number.isFinite(A.weight)||(A.weight=100),typeof A.locked!="boolean"&&(A.locked=!1),Number.isFinite(A.scale)||(A.scale=1),Number.isFinite(A.anchorX)||(A.anchorX=.5),Number.isFinite(A.anchorY)||(A.anchorY=.5),A.colorMode!=="fixed"&&A.colorMode!=="random"&&A.colorMode!=="lifetime"&&(A.colorMode=n.colorOverLife?"lifetime":"fixed"),A.colorStart||(A.colorStart=n.colorStart||"#ffffff"),A.colorEnd||(A.colorEnd=n.colorEnd||A.colorStart),(!Array.isArray(A.colorGradient)||A.colorGradient.length<2)&&(A.colorGradient=[{position:0,color:A.colorStart},{position:1,color:A.colorEnd}]),Object.prototype.hasOwnProperty.call(Yr,A.blend)||(A.blend=n.blend||"normal"),["off","fixed","curve"].includes(A.independentAlpha)||(A.independentAlpha=n.independentAlpha||"off"),Number.isFinite(A.alpha)||(A.alpha=Number.isFinite(n.alphaScale)?n.alphaScale:1),["跟随导出","线性","贝塞尔"].includes(A.alphaCurveMode)||(A.alphaCurveMode=n.curveMode||"跟随导出"),(!Array.isArray(A.alphaCurve)||A.alphaCurve.length<2)&&(A.alphaCurve=(n.alphaCurve||[{x:0,y:1},{x:1,y:1}]).map(R=>({...R})))}if(n.imageResources.length===1)n.imageResources[0].weight=100,n.imageResources[0].locked=!1;else if(h){const A=100/n.imageResources.length;n.imageResources.forEach((R,B)=>{R.weight=B===n.imageResources.length-1?100-A*(n.imageResources.length-1):A,R.locked=!1})}if(n.imageWeightVersion=1,d){const A=Number.isFinite(f)&&f!==0?f:980;n.gravity=A,n.gravityMin=A,n.gravityMax=A}if(m){const A=Number.isFinite(p)&&Number.isFinite(g)&&(p!==0||g!==0);n.windMin=A?Math.hypot(p,g):100,n.windMax=n.windMin,n.windDirection=A?Math.atan2(-g,p)*180/Math.PI:0}v&&(n.forceStrength=Number.isFinite(b)&&b!==0?b:10),y&&(n.trailConfigVersion=3,n.trailAlphaCurve=[{x:0,y:1},{x:1,y:1}],n.trailLifeLengthCurve=[{x:0,y:1},{x:1,y:1}],n.trailShapeCurve=[{x:0,y:1},{x:1,y:1}],n.trailGridRows=4,n.trailGridCols=4),(x||!n.trailResources.length)&&(n.trailResources=[{id:1,texture:E||null,textureName:S,previewUrl:C,weight:100,locked:!1,rotation:0,colorMode:n.trailColorMode,color:n.trailColor,colorGradient:n.trailColorGradient.map(A=>({...A})),blend:"normal",alphaMode:n.trailAlphaMode,alpha:n.trailAlpha,alphaCurve:n.trailAlphaCurve.map(A=>({...A})),boneCount:n.trailBoneCount,trailRatio:100,lengthMode:"fixed",length:n.trailLength,lengthMin:n.trailLength,lengthMax:n.trailLength,widthSizeMode:"fixed",width:n.trailWidth,widthMin:n.trailWidth,widthMax:n.trailWidth,widthMode:n.trailWidthMode,lifeLengthEnabled:n.trailLifeLengthEnabled,lifeLengthCurve:n.trailLifeLengthCurve.map(A=>({...A})),shapeEnabled:n.trailShapeEnabled,shapeCurve:n.trailShapeCurve.map(A=>({...A}))}]);for(const A of n.trailResources)A.textureName||(A.textureName="trail"),A.previewUrl==="/trails/trail.png"&&(A.previewUrl="/images/trail.png"),A.previewUrl||(A.previewUrl="/images/trail.png"),Number.isFinite(A.weight)||(A.weight=100),typeof A.locked!="boolean"&&(A.locked=!1),Number.isFinite(A.rotation)||(A.rotation=0),["particle","fixed","curve"].includes(A.colorMode)||(A.colorMode=n.trailColorMode||"particle"),A.color||(A.color=n.trailColor||"#ffffff"),(!Array.isArray(A.colorGradient)||A.colorGradient.length<2)&&(A.colorGradient=(n.trailColorGradient||[{position:0,color:"#ffffff"},{position:1,color:"#ffffff"}]).map(R=>({...R}))),Object.prototype.hasOwnProperty.call(Yr,A.blend)||(A.blend="normal"),["particle","fixed","curve"].includes(A.alphaMode)||(A.alphaMode=n.trailAlphaMode||"particle"),Number.isFinite(A.alpha)||(A.alpha=Number.isFinite(n.trailAlpha)?n.trailAlpha:1),(!Array.isArray(A.alphaCurve)||A.alphaCurve.length<2)&&(A.alphaCurve=(n.trailAlphaCurve||[{x:0,y:1},{x:1,y:1}]).map(R=>({...R}))),Number.isFinite(A.boneCount)||(A.boneCount=Number.isFinite(n.trailBoneCount)?n.trailBoneCount:3),Number.isFinite(A.trailRatio)||(A.trailRatio=100),A.trailRatio=Math.min(100,Math.max(0,A.trailRatio)),["fixed","random"].includes(A.lengthMode)||(A.lengthMode="fixed"),Number.isFinite(A.length)||(A.length=Number.isFinite(n.trailLength)?n.trailLength:100),Number.isFinite(A.lengthMin)||(A.lengthMin=A.length),Number.isFinite(A.lengthMax)||(A.lengthMax=A.length),["fixed","random"].includes(A.widthSizeMode)||(A.widthSizeMode="fixed"),Number.isFinite(A.width)||(A.width=Number.isFinite(n.trailWidth)?n.trailWidth:100),Number.isFinite(A.widthMin)||(A.widthMin=A.width),Number.isFinite(A.widthMax)||(A.widthMax=A.width),["particle","fixed"].includes(A.widthMode)||(A.widthMode=n.trailWidthMode||"particle"),typeof A.lifeLengthEnabled!="boolean"&&(A.lifeLengthEnabled=!!n.trailLifeLengthEnabled),(!Array.isArray(A.lifeLengthCurve)||A.lifeLengthCurve.length<2)&&(A.lifeLengthCurve=(n.trailLifeLengthCurve||[{x:0,y:1},{x:1,y:1}]).map(R=>({...R}))),typeof A.shapeEnabled!="boolean"&&(A.shapeEnabled=!!n.trailShapeEnabled),(!Array.isArray(A.shapeCurve)||A.shapeCurve.length<2)&&(A.shapeCurve=(n.trailShapeCurve||[{x:0,y:1},{x:1,y:1}]).map(R=>({...R})));if(n.trailResources.length===1&&(n.trailResources[0].weight=100,n.trailResources[0].locked=!1),_)for(const A of n.trailResources)A.alphaCurve=((P=A.alphaCurve)==null?void 0:P.length)>=2?A.alphaCurve:[{x:0,y:1},{x:1,y:1}];return n.trailResourceVersion=6,n}class ob extends Mi{constructor(t,i=eb){super();T(this,"pool",[]);T(this,"cfg");T(this,"accumulator",0);T(this,"burstTimer",0);T(this,"_spawnSerial",0);T(this,"_elapsed",0);T(this,"_attractionEnabledAt",0);T(this,"_attractionWasEnabled",!1);T(this,"autoEmission",!0);T(this,"pendingEventSpawns",[]);T(this,"states",[]);T(this,"onParticleEvent",null);T(this,"rng",Math.random);T(this,"_lastSeed",-1);T(this,"trailDebugGfx",new Ki);T(this,"trail");T(this,"colliders",[]);T(this,"followSpawnX",0);T(this,"followSpawnY",0);T(this,"followSpawnAngle",0);T(this,"spawnPathSampler",null);T(this,"spawnPathClosed",!1);T(this,"followExportCurveMode","线性");T(this,"simulationTransform",null);this.cfg=lr(t),this.trail=new iF(this),this._ensurePool(i),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=nm(t>>>0))}_ensurePool(t){for(;this.pool.length=s.delay),o=i==="force"||i==="normal"&&(s.mode==="burst"||this._elapsed=1;)this.accumulator-=1,this.spawnOne();else this.burstTimer+=t,s.burstLoop?this.burstTimer>=1&&(this.burstTimer=0,this.emitBurst()):t>0&&this.burstTimer<=t&&this.emitBurst();if(this.pendingEventSpawns.length&&t>0){const m=[],p=[];for(const g of this.pendingEventSpawns)g.remaining-=t,g.remaining<=0?m.push(g):p.push(g);this.pendingEventSpawns=p;for(const g of m){const v=eh(this.cfg,g.worldX,g.worldY,this.simulationTransform);for(let b=0;b0){const N=Math.max(1e-4,Math.abs(s.rootScaleX)),F=Math.max(1e-4,Math.abs(s.rootScaleY)),D=-(((c=this.simulationTransform)==null?void 0:c.rotation)??s.rootRotation)*Math.PI/180,X=Math.cos(D),G=Math.sin(D),K=((l=this.simulationTransform)==null?void 0:l.centerX)??s.centerX,J=((h=this.simulationTransform)==null?void 0:h.centerY)??s.centerY,oe=K+X*N*p.x-G*F*p.y,le=-J+G*N*p.x+X*F*p.y,ve=oe,Se=-le,fe=s.forceCenterX-ve,ye=s.forceCenterY-Se,q=Math.hypot(fe,ye);if(q>1e-4&&q<=s.forceRadius){const Z=ES(s.forceFalloff,q,s.forceRadius),se=s.forceStrength*Z*10,H=fe/q*se,j=ye/q*se,$=H,U=-j;p.vx+=(X*$+G*U)/N*t,p.vy+=(-G*$+X*U)/F*t}}if(!p.collisionPaused&&s.vortex&&s.vortexStrength!==0&&s.vortexRadius>0){const N=_r(s,p.x,p.y,this.simulationTransform),F=Jk(N.x,N.y,s.vortexCenterX,s.vortexCenterY,s.vortexStrength,s.vortexRadius,s.vortexFalloff),D=tb(s,F.x,F.y,this.simulationTransform);p.vx+=D.x*t,p.vy+=D.y*t}if(!p.collisionPaused&&s.damping>0){const N=Math.max(0,1-s.damping*t);p.vx*=N,p.vy*=N}if(p.collisionPaused)p.vx=0,p.vy=0;else if(p.x+=p.vx*t,p.y+=p.vy*t,this.applyColliders(p,m))continue;if(s.attraction&&!p.collisionPaused){const N=p.maxLife-p.life;if(s.attractionDelayMode==="particle"?N>=Math.max(0,s.attractionDelay):this._elapsed-this._attractionEnabledAt>=Math.max(0,s.attractionDelay)){const D=_r(s,p.x,p.y,this.simulationTransform),X=s.attractionCenterX,G=s.attractionCenterY,K=Math.max(0,s.attractionRadius);if(!p.attractionActive){if(Math.hypot(X-D.x,G-D.y)<=K){this.kill(m);continue}p.attractionActive=!0,p.attractionElapsed=0,p.attractionStartWorldX=D.x,p.attractionStartWorldY=D.y}p.attractionElapsed+=t;const J=Math.max(1e-4,s.attractionDuration),oe=Math.min(1,p.attractionElapsed/J);let le=Li(p.attractionStartWorldX,X,oe),ve=Li(p.attractionStartWorldY,G,oe);if(s.attractionPath==="curve"){const ye=X-p.attractionStartWorldX,q=G-p.attractionStartWorldY,Z=Math.hypot(ye,q);if(Z>1e-4){const se=Z*.25*p.attractionCurveSide,H=(p.attractionStartWorldX+X)*.5-q/Z*se,j=(p.attractionStartWorldY+G)*.5+ye/Z*se,$=1-oe;le=$*$*p.attractionStartWorldX+2*$*oe*H+oe*oe*X,ve=$*$*p.attractionStartWorldY+2*$*oe*j+oe*oe*G}}const Se=Math.hypot(X-le,G-ve);if(oe>=1||Se<=K){this.kill(m);continue}const fe=eh(s,le,ve,this.simulationTransform);p.x=fe.x,p.y=fe.y,p.vx=0,p.vy=0}}const v=g,b=p.sprite,y=s.imageResources.find(N=>N.id===p.resourceId);if(y){const N=rb(y,p.maxLife-p.life);p.imageFrameIndex=N.index,b.texture=sm(y,s.texture,p.imageFrameIndex),b.visible=N.visible}if(s.speedOverLifeEnabled){const N=Qc(im(s.speedOverLifeMode,s.speedOverLifeMin,s.speedOverLifeMax,s.speedOverLifeCurve,v,p.speedScaleTarget),1),F=p.speedScale===0?N:N/p.speedScale;p.vx*=F,p.vy*=F,p.speedScale=N}let x=p.rotationSpeed;s.rotationOverLifeEnabled&&s.rotationOverLifeMode==="curve"&&(x=Li(s.rotationSpeedMin,s.rotationSpeedMax,ws(s.rotationOverLifeCurve,v))),p.rotation+=x*t;let _=p.x,E=p.y;if(s.noise&&s.noiseAmt>0&&s.noiseRange>0&&s.noiseSpeed>0){const N=p.maxLife-p.life,F=Math.max(0,s.noiseRange)*Math.min(1,Math.max(0,s.noiseAmt)/100)*.5,D=N*Math.max(0,s.noiseSpeed)*Math.PI*2;_+=(Math.sin(p.noisePhaseX+D)-Math.sin(p.noisePhaseX))*F,E+=(Math.sin(p.noisePhaseY+D*.83)-Math.sin(p.noisePhaseY))*F}b.x=_,b.y=E,b.rotation=-p.rotation*Math.PI/180;let S=1,C=1;s.scaleOverLifeEnabled&&(S=im(s.scaleOverLifeMode,s.scaleOverLifeMin,s.scaleOverLifeMax,s.scaleOverLifeCurve,v,p.scaleOverLifeX),C=s.scaleOverLifeAxisMode==="separate"?im(s.scaleOverLifeMode,s.scaleYOverLifeMin,s.scaleYOverLifeMax,s.scaleYOverLifeCurve,v,p.scaleOverLifeY):S),b.scale.set(Qc(p.scaleStartX*S,1),Qc(p.scaleStartY*C,1)),p.currentScaleX=b.scale.x,p.currentScaleY=b.scale.y;const M=s.alphaMode==="curve"?ws(s.alphaCurve,v,this.resolveCurveMode(s.curveMode))*s.alphaScale:s.alpha*s.alphaScale;b.alpha=Qc((y==null?void 0:y.independentAlpha)==="fixed"?y.alpha:(y==null?void 0:y.independentAlpha)==="curve"?ws(y.alphaCurve,v,this.resolveCurveMode(y.alphaCurveMode)):M,1);const P=(y==null?void 0:y.colorStart)||"#ffffff",A=(y==null?void 0:y.colorMode)==="lifetime"?yp(y.colorGradient,v):(y==null?void 0:y.colorMode)==="random"?p.colorSample:Oa(P),R=p.colorOverride??sb(A,p.colorAdd);b.tint=R,b.blendMode=Yr[(y==null?void 0:y.blend)||"normal"];const B=this.trail.update(p.trail,s,p.boneName,_,E,v,b),O=_r(s,_,E,this.simulationTransform),W=((u=this.simulationTransform)==null?void 0:u.rotation)??s.rootRotation,V=Math.abs(((d=this.simulationTransform)==null?void 0:d.scaleX)??s.rootScaleX),Y=Math.abs(((f=this.simulationTransform)==null?void 0:f.scaleY)??s.rootScaleY),L=B?{...B,bones:B.bones.map(N=>{const F=_r(s,N.x,N.y,this.simulationTransform);return{...N,worldX:F.x,worldY:F.y,worldRotation:W-N.rotation}})}:void 0;a.push({boneName:p.boneName,spawnId:p.spawnId,x:_,y:E,rotation:p.rotation,scaleX:b.scale.x,scaleY:b.scale.y,worldX:O.x,worldY:O.y,worldRotation:W+p.rotation,worldScaleX:b.scale.x*V,worldScaleY:b.scale.y*Y,alpha:b.alpha,colorHex:R,resourceId:p.resourceId,imageFrameIndex:p.imageFrameIndex,imageVisible:b.visible,trailState:L,active:!0})}return this.states=a,a}drawTrailMeshDebug(t){this.trail.drawDebug(this.trailDebugGfx,t,this.cfg,this.pool.map(i=>i.trail))}emitBurst(){for(let t=0;t0&&this.spawnPathSampler){const a=this.estimatedEmissionCount(),c=jk(t.spawnPathDistribution,this._spawnSerial,a,this.spawnPathClosed,this.rng),l=this.spawnPathSampler(c);if(l)return{...this.applyFollowToOrigin(l.x+i,l.y+s),radialAngle:0,pathAngle:l.angle}}const r=zk(t,this.rng);return{...this.applyFollowToOrigin(i+r.x,s+r.y),radialAngle:r.radialAngle}}estimatedEmissionCount(){const t=this.cfg;return t.mode==="burst"?Math.max(1,Math.round(t.burstCount)):Math.max(1,Math.floor(t.rate*(t.streamBehavior==="loop"?Math.max(1,t.loopDurationFrames)/30:Math.max(0,t.duration))))}applyFollowToOrigin(t,i){const s=this.followSpawnAngle*Math.PI/180,r=Math.cos(s),o=Math.sin(s);return{x:this.followSpawnX+r*t-o*i,y:this.followSpawnY+o*t+r*i}}spawnEventParticle(t,i,s=1,r,o){if(s>2)return!1;const a=o??(this.cfg.mode==="burst"?this.cfg.burstCount:1),c=Math.max(1,Math.min(eb,Math.round(Number(a)||1))),l=Math.max(0,Number(this.cfg.delay)||0);if(l>0)return this.pendingEventSpawns.push({worldX:t,worldY:i,depth:s,inherit:r,count:c,remaining:l}),!0;const h=eh(this.cfg,t,i,this.simulationTransform);let u=!1;for(let d=0;d!C.active);if(o===-1)return!1;const a=t?{x:t.x,y:t.y,radialAngle:0}:this.spawnOrigin(),{x:c,y:l}=a,h=oa(r.lifeMode,r.lifeMin,r.lifeMax,r.lifeCurve,this.rng()),u=oa(r.speedMode,r.speedMin,r.speedMax,r.speedCurve,this.rng()),d=s!=null&&s.attributes.includes("rotation")?s.data.rotation:0,f=qk(r,a,this.followSpawnAngle,this.rng)+d*Math.PI/180,m=this.pool[o],p=rF(r,this.rng),g=this._spawnSerial++;m.spawnId=g;const v=oF(r,Ir(r.seed,g,1540483477));m.noisePhaseX=Ir(r.seed,g,1757159915)*Math.PI*2,m.noisePhaseY=Ir(r.seed,g,48610963)*Math.PI*2,m.gravityStrength=r.useGravity&&r.gravityMode==="random"?Li(r.gravityMin,r.gravityMax,this.rng()):r.gravityMin,m.windStrength=r.wind&&r.windMode==="random"?Li(r.windMin,r.windMax,this.rng()):r.windMin,m.attractionActive=!1,m.attractionElapsed=0,m.collisionPaused=!1,m.collisionCount=0,m.eventDepth=i,m.attractionCurveSide=Ir(r.seed,g,2738958700)<.5?-1:1,m.trail.history.length=0,m.trail.bones.length=0,m.trail.currentWidth=0,m.trail.currentAlpha=0,m.trail.currentColor=16777215,m.trail.resourceId=v.id;const b=Math.min(100,Math.max(0,Number(v.trailRatio)||0)),y=r.mode==="burst"?Math.max(0,Math.round(r.burstCount)):Math.max(0,Math.floor(r.rate*(r.streamBehavior==="loop"?Math.max(1,r.loopDurationFrames)/30:Math.max(0,r.duration)))),x=b>0&&y===1&&g===0,_=Ir(r.seed,g,668265261)*100,E=(C,M,P,A,R)=>{if(C!=="random")return Math.max(0,Number(M)||0);const B=Math.max(0,Math.min(Number(P)||0,Number(A)||0)),O=Math.max(0,Math.max(Number(P)||0,Number(A)||0));return Li(B,O,Ir(r.seed,g,R))};if(m.trail.sampledLength=E(v.lengthMode,v.length,v.lengthMin,v.lengthMax,374761393),m.trail.sampledWidth=E(v.widthSizeMode,v.width,v.widthMin,v.widthMax,3550635116),m.trail.enabled=r.trail&&(x||_0&&m.trail.sampledWidth>0,m.trail.mesh&&(m.trail.mesh.visible=!1),m.active=!0,m.life=h,m.maxLife=h,m.x=c,m.y=l,m.trail.enabled&&m.trail.history.push({x:c,y:l}),m.vx=Math.cos(f)*u,m.vy=Math.sin(f)*u,m.scaleStartX=oa(r.scaleMode,r.scaleMin,r.scaleMax,r.scaleCurve,this.rng())*p.scale,m.scaleStartY=r.scaleAxisMode==="separate"?oa(r.scaleMode,r.scaleYMin,r.scaleYMax,r.scaleYCurve,this.rng())*p.scale:m.scaleStartX,m.alphaStart=r.alpha,m.alphaEnd=r.alphaEnd,m.rotation=r.initialRotationMode==="direction"?-Math.atan2(m.vy,m.vx)*180/Math.PI+r.initialRotationMin:oa(r.initialRotationMode,r.initialRotationMin,r.initialRotationMax,r.initialRotationCurve,this.rng())+d,m.rotationSpeed=r.rotationOverLifeEnabled?oa(r.rotationOverLifeMode,r.rotationSpeedMin,r.rotationSpeedMax,r.rotationOverLifeCurve,this.rng()):0,m.speedScale=1,m.speedScaleTarget=r.speedOverLifeMode==="random"?Li(r.speedOverLifeMin,r.speedOverLifeMax,this.rng()):r.speedOverLifeMin,m.scaleOverLifeX=r.scaleOverLifeMode==="random"?Li(r.scaleOverLifeMin,r.scaleOverLifeMax,this.rng()):r.scaleOverLifeMin,m.scaleOverLifeY=r.scaleOverLifeMode==="random"?Li(r.scaleYOverLifeMin,r.scaleYOverLifeMax,this.rng()):r.scaleYOverLifeMin,m.resourceId=p.id,m.colorSample=p.colorMode==="random"?yp(p.colorGradient,Ir(r.seed,g,2654435769)):Oa(p.colorStart),m.colorAdd=0,m.colorOverride=null,s){const C=s.attributes;C.includes("color")&&(s.colorMode==="replace"?m.colorOverride=s.data.colorHex:m.colorAdd=s.data.colorHex),C.includes("scale")&&(m.scaleStartX*=s.data.scaleX,m.scaleStartY*=s.data.scaleY),C.includes("life")&&(m.life=Math.max(1e-4,s.data.life),m.maxLife=m.life)}m.currentScaleX=m.scaleStartX,m.currentScaleY=m.scaleStartY;const S=rb(p,0);return m.imageFrameIndex=S.index,m.sprite.texture=sm(p,r.texture,S.index),m.sprite.anchor.set(p.anchorX,p.anchorY),m.sprite.blendMode=Yr[p.blend],m.sprite.tint=m.colorOverride??sb(m.colorSample,m.colorAdd),m.sprite.visible=!0,this.emitLocalEvent("birth",m,m.x,m.y),!0}kill(t){const i=this.pool[t];i.active&&this.emitLocalEvent("death",i,i.x,i.y),i.active=!1,i.sprite.visible=!1,Mh(i.trail)}clear(){this.pendingEventSpawns.length=0;for(const t of this.pool)t.active=!1,t.sprite.visible=!1,Mh(t.trail)}get activeCount(){let t=0;for(const i of this.pool)i.active&&t++;return t}capture(){const t=[];for(const i of this.pool)i.active&&t.push({boneName:i.boneName,spawnId:i.spawnId,x:i.sprite.x,y:i.sprite.y,rotation:i.rotation,scaleX:i.sprite.scale.x,scaleY:i.sprite.scale.y,...this.captureWorldTransform(i),alpha:i.sprite.alpha,colorHex:i.sprite.tint,resourceId:i.resourceId,imageFrameIndex:i.imageFrameIndex,imageVisible:i.sprite.visible,active:!0,trailState:this.cfg.trail&&i.trail.bones.length?{bones:i.trail.bones.map(s=>{var o;const r=_r(this.cfg,s.x,s.y,this.simulationTransform);return{...s,worldX:r.x,worldY:r.y,worldRotation:(((o=this.simulationTransform)==null?void 0:o.rotation)??this.cfg.rootRotation)-s.rotation}}),activeBoneCount:i.trail.bones.length,width:i.trail.currentWidth,alpha:i.trail.currentAlpha,colorHex:i.trail.currentColor,resourceId:i.trail.resourceId}:void 0});return t}captureWorldTransform(t){var r,o,a;const i=_r(this.cfg,t.sprite.x,t.sprite.y,this.simulationTransform),s=((r=this.simulationTransform)==null?void 0:r.rotation)??this.cfg.rootRotation;return{worldX:i.x,worldY:i.y,worldRotation:s+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){const i=new Map;for(const s of t)i.set(s.boneName,s);for(const s of this.pool){const r=i.get(s.boneName);if(!r){s.active=!1,s.sprite.visible=!1,s.trail.mesh&&(s.trail.mesh.visible=!1);continue}s.active=r.active;const o=s.sprite;if(o.visible=r.active&&r.imageVisible!==!1,o.x=r.x,o.y=r.y,o.rotation=-r.rotation*Math.PI/180,o.scale.set(r.scaleX,r.scaleY),o.alpha=r.alpha,o.tint=r.colorHex,r.resourceId!=null){const a=this.cfg.imageResources.find(c=>c.id===r.resourceId);a&&(s.imageFrameIndex=r.imageFrameIndex??0,o.texture=sm(a,this.cfg.texture,s.imageFrameIndex),o.anchor.set(a.anchorX,a.anchorY),o.blendMode=Yr[a.blend])}this.cfg.trail&&r.trailState?this.trail.applyState(s.trail,this.cfg,s.sprite,r.trailState):s.trail.mesh&&(s.trail.mesh.visible=!1)}}reset(){this.pendingEventSpawns.length=0;for(const t of this.pool)t.active=!1,t.sprite.visible=!1,Mh(t.trail);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=nm(this.cfg.seed>>>0)}restartEmissionCycle(){this.pendingEventSpawns.length=0,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=nm(this.cfg.seed>>>0)}}const Vo=new Map,$o=new Map;function aF(n){return[...Vo.values()].some(e=>e===n)}function CS(n){if(!(aF(n)||($o.get(n)||0)>0)){$o.delete(n);for(const e of n.textures)e.destroy(!0)}}function lF(n){const e=$o.get(n)||0;e>1?$o.set(n,e-1):$o.delete(n),CS(n)}function cF(n){return Vo.get(n)||null}function cd(n,e){yc(n),Vo.set(n,e)}function hF(n){const e=Vo.get(n);return e?($o.set(e,($o.get(e)||0)+1),e):null}function uF(n,e){const t=Vo.get(n);return t?(cd(e,t),!0):!1}function yc(n){const e=Vo.get(n);e&&(Vo.delete(n),CS(e))}function Zt(n){if(Array.isArray(n))return n.map(e=>Zt(e));if(n&&typeof n=="object"){const e=Object.getPrototypeOf(n);if(e===Object.prototype||e===null){const t={};for(const[i,s]of Object.entries(n))t[i]=Zt(s);return t}}return n}const MS=["3.8","4.0","4.1","4.2","4.3"];function lu(n){const e=String(n||"").trim();return MS.find(t=>e===t||e.startsWith(`${t}.`))||null}function bp(){return MS.join(" / ")}function dF(n){return n==="4.3"?"4.3":"4.2"}function Og(){return{imagesPath:"./images/",spineVersion:"4.2",keyframeCurve:"bezier",fps:30,omitFps:!1,integerFrameAlignment:!0,bonePool:!0,excludeEmptyAnimations:!1,fileName:"SpineParticle.json"}}function AS(n){const e=Object.assign(Og(),n||{});return e.imagesPath=String(e.imagesPath||"./images/"),e.spineVersion=lu(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}const xp=30;function Ah(n,e=1){return Math.min(1800,Math.max(1,Math.ceil(Number(n)||e)))}function IS(n,e=30){const t=Math.max(0,Number(n.lifeMin)||0),i=Math.max(0,Number(n.lifeMax)||0),s=n.lifeMode==="fixed"?t:Math.max(t,i);return Ah(Math.ceil(s*Math.max(1,e)),xp)}function zn(n,e=30){const t=Ah(n.loopDurationFrames),i=IS(n,e),s=n.generateLoopStartAnimation?n.loopStartUseCustomDuration?Ah(n.loopStartDurationFrames,xp):i:0,r=n.generateLoopEndAnimation?n.loopEndUseCustomDuration?Ah(n.loopEndDurationFrames,xp):i:0;return{start:s,loop:t,end:r,total:s+t+r}}function PS(n,e){const t=zn(n,e),s=Math.max(0,Math.ceil(Math.max(0,Number(n.delay)||0)*Math.max(1,e)))+t.start;return{start:s,end:s+t.loop}}function Xa(n){var t,i;const e=new Set;for(const s of n){if(((t=s.config)==null?void 0:t.eventEnabled)===!1)continue;const r=(i=s.config)==null?void 0:i.events;if(Array.isArray(r))for(const o of r)o.targetSystemId>0&&o.targetSystemId!==s.id&&e.add(o.targetSystemId)}return e}function RS(n,e){var r,o;const t=new Map;for(const a of n){if(((r=a.config)==null?void 0:r.eventEnabled)===!1)continue;const c=(o=a.config)==null?void 0:o.events;if(Array.isArray(c))for(const l of c){if(l.targetSystemId<=0||l.targetSystemId===a.id)continue;const h=t.get(l.targetSystemId);h?h.push(a.id):t.set(l.targetSystemId,[a.id])}}const i=new Set,s=[...t.get(e)||[]];for(;s.length;){const a=s.pop();i.has(a)||(i.add(a),s.push(...t.get(a)||[]))}return i.delete(e),i}const fF=.001;function kS(n,e){const t=Math.max(1,Number(e)||30),s=Math.max(0,Number(n)||0)*t+fF*t;return Math.max(0,Math.floor(s))}function FS(n,e,t){const i=Math.max(1,Math.floor(t)-1),s=Math.min(i-1,Math.max(0,Math.floor(Number(n)||0))),r=Math.min(i,Math.max(s+1,Math.floor(Number(e)||i)));return{start:s,end:r}}function rm(n,e,t,i){const s=Math.max(1,Math.floor(i)-1);return FS(n?e:0,n?t:s,i)}function mF(n,e,t){const i=Math.max(1,e-1),s=Math.max(1,t-1),r=n.end>=i?s:n.end;return FS(n.start,r,t)}let th=1,ih=1,nh=1,sh=1;function rh(n,e){const t=new Set(e),i=`${n} Copy`;if(!t.has(i))return i;let s=2;for(;t.has(`${i} ${s}`);)s++;return`${i} ${s}`}const Wo=PA("particle",{state:()=>({editor:{viewScale:1,viewX:0,viewY:0},systems:[],colliders:[],paths:[],spines:[],activeId:0,activeObjectType:"particle",activeObjectId:0,timeline:{playing:!0,loop:!0,abLoop:!1,frame:0,totalFrames:60,playbackStart:0,playbackEnd:59,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:Og()}}),getters:{activeSystemCount:n=>n.systems.length,playbackRange:n=>rm(n.timeline.abLoop,n.timeline.playbackStart,n.timeline.playbackEnd,n.timeline.totalFrames)},actions:{syncSceneSequences(){th=Math.max(th,...this.systems.map(n=>n.id+1),1),ih=Math.max(ih,...this.colliders.map(n=>n.id+1),1),nh=Math.max(nh,...this.paths.map(n=>n.id+1),1),sh=Math.max(sh,...this.spines.map(n=>n.id+1),1)},addSystem(n){const e=tc();n!=null&&n.config&&Object.assign(e,n.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 c=/^ParticleSystem(\d+)$/.exec(a.config.name);c&&(r=Math.max(r,parseInt(c[1],10)))}e.name=`ParticleSystem${r+1}`;let o=2;for(;t.has(e.name);)e.name=`ParticleSystem${r+o}`,o++}const i=this.timeline.animations.includes(this.timeline.animation)?this.timeline.animation:this.timeline.animations[0]||"animation",s={id:th++,visible:!0,animation:i,config:e};return this.systems.push(s),this.activeId=s.id,this.activeObjectType="particle",this.activeObjectId=s.id,s},removeSystem(n){var i;const e=this.systems.findIndex(s=>s.id===n);e>=0&&this.systems.splice(e,1),this.activeId===n&&(this.activeId=((i=this.systems[0])==null?void 0:i.id)??0);const t=this.systems.find(s=>s.id===this.activeId);if(t&&(this.timeline.animation=t.animation),this.activeObjectType==="particle"&&this.activeObjectId===n){const s=this.systems[0];this.activeObjectId=(s==null?void 0:s.id)??0}},selectSystem(n){this.activeId=n,this.activeObjectType="particle",this.activeObjectId=n;const e=this.systems.find(t=>t.id===n);e&&(this.timeline.animation=e.animation)},setSystemAnimation(n,e){if(!this.timeline.animations.includes(e))return;const t=this.systems.find(i=>i.id===n);t&&(t.animation=e,this.timeline.animation=e)},addAnimation(){const n=new Set(this.timeline.animations);let e=2,t=`animation${e}`;for(;n.has(t);)t=`animation${++e}`;this.timeline.animations.push(t),this.timeline.animation=t;const i=this.systems.find(s=>s.id===this.activeId);return i&&(i.animation=t),t},renameAnimation(n,e){const t=e.trim(),i=this.timeline.animations.indexOf(n);if(i<0||!t||t!==n&&this.timeline.animations.includes(t))return!1;this.timeline.animations[i]=t;for(const s of this.systems)s.animation===n&&(s.animation=t);return this.timeline.animation===n&&(this.timeline.animation=t),!0},removeAnimation(n){if(this.timeline.animations.length<=1)return!1;const e=this.timeline.animations.indexOf(n);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 i of this.systems)i.animation===n&&(i.animation=t);return this.timeline.animation===n&&(this.timeline.animation=t),!0},addCollider(){const n=ih++,e={id:n,name:`Collider${n}`,visible:!0,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 n=nh++,e={id:n,name:`Path${n}`,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 n=sh++,e={id:n,name:`SpineSkeleton${n}`,enabled:!0,visible:!0,x:0,y:0,rotation:0,scaleX:1,scaleY:1,timeOffset:0,skeletonFileName:"",atlasFileName:"",textureFileNames:[],dataVersion:"",sourceBundle:null,selectedAnimation:"",selectedBone:"",selectedSlot:"",animations:[],bones:[],slots:[],assetVersion:0,status:"empty",error:""};return this.spines.push(e),this.activeObjectType="spine",this.activeObjectId=e.id,e},duplicateSelectedObject(){const n=this.activeObjectId;if(!n)return null;if(this.activeObjectType==="particle"){const i=this.systems.find(r=>r.id===n);if(!i)return null;const s=Zt(i);return s.id=th++,s.config.name=rh(i.config.name,this.systems.map(r=>r.config.name)),s.frames=void 0,this.systems.push(s),this.activeId=s.id,this.activeObjectId=s.id,this.timeline.animation=s.animation,s}if(this.activeObjectType==="collision"){const i=this.colliders.find(r=>r.id===n);if(!i)return null;const s=Zt(i);return s.id=ih++,s.name=rh(i.name,this.colliders.map(r=>r.name)),this.colliders.push(s),this.activeObjectId=s.id,s}if(this.activeObjectType==="path"){const i=this.paths.find(r=>r.id===n);if(!i)return null;const s=Zt(i);return s.id=nh++,s.name=rh(i.name,this.paths.map(r=>r.name)),this.paths.push(s),this.activeObjectId=s.id,s}const e=this.spines.find(i=>i.id===n);if(!e)return null;const t=Zt(e);return t.id=sh++,t.name=rh(e.name,this.spines.map(i=>i.name)),t.selectedBone="",t.selectedSlot="",uF(e.id,t.id),this.spines.push(t),this.activeObjectId=t.id,t},selectSceneObject(n,e){if(this.activeObjectType=n,this.activeObjectId=e,n==="particle"){this.activeId=e;const t=this.systems.find(i=>i.id===e);t&&(this.timeline.animation=t.animation)}},removeCollider(n){var t;const e=this.colliders.findIndex(i=>i.id===n);e>=0&&this.colliders.splice(e,1);for(const i of this.systems){const s=lr(i.config);s.collisionColliderIds=s.collisionColliderIds.filter(r=>r!==n)}if(this.activeObjectType==="collision"&&this.activeObjectId===n){const i=this.systems[0];this.activeObjectType=i?"particle":"collision",this.activeObjectId=(i==null?void 0:i.id)??((t=this.colliders[0])==null?void 0:t.id)??0}},removePath(n){var t;const e=this.paths.findIndex(i=>i.id===n);if(e>=0&&this.paths.splice(e,1),this.activeObjectType==="path"&&this.activeObjectId===n){const i=this.systems[0];this.activeObjectType=i?"particle":"path",this.activeObjectId=(i==null?void 0:i.id)??((t=this.paths[0])==null?void 0:t.id)??0}},removeSpine(n){yc(n);const e=this.spines.findIndex(t=>t.id===n);if(e>=0&&this.spines.splice(e,1),this.activeObjectType==="spine"&&this.activeObjectId===n){const t=this.systems[0],i=this.colliders[0],s=this.paths[0],r=this.spines[0];t?(this.activeObjectType="particle",this.activeObjectId=t.id,this.activeId=t.id):i?(this.activeObjectType="collision",this.activeObjectId=i.id):s?(this.activeObjectType="path",this.activeObjectId=s.id):(this.activeObjectType="spine",this.activeObjectId=(r==null?void 0:r.id)??0)}this.recalcTotalFrames()},play(){const n=this.playbackRange;(this.timeline.frame=n.end)&&(this.timeline.frame=n.start),this.timeline.playing=!0},pause(){this.timeline.playing=!1},togglePlay(){this.timeline.playing?this.pause():this.play()},toStart(){this.timeline.frame=this.playbackRange.start},previousFrame(){this.timeline.playing=!1,this.timeline.frame=Math.max(this.playbackRange.start,this.timeline.frame-1)},nextFrame(){this.timeline.playing=!1,this.timeline.frame=Math.min(this.playbackRange.end,this.timeline.frame+1)},toEnd(){this.timeline.playing=!1,this.timeline.frame=this.playbackRange.end},toggleLoop(){this.timeline.loop=!this.timeline.loop},toggleABLoop(){this.timeline.abLoop=!this.timeline.abLoop;const n=this.playbackRange;(this.timeline.framen.end)&&(this.timeline.frame=n.start)},setFrame(n){this.timeline.frame=Math.max(0,Math.min(n,this.timeline.totalFrames-1))},setPlaybackStart(n){const e=rm(!0,n,this.timeline.playbackEnd,this.timeline.totalFrames);this.timeline.playbackStart=e.start,this.timeline.playbackEnd=e.end,this.timeline.abLoop&&this.timeline.framee.end&&(this.timeline.frame=e.end)},recalcTotalFrames(){const n=Math.max(1,this.timeline.fps||30),e=u=>{const d=Math.max(0,Number(u.lifeMin)||0),f=Math.max(0,Number(u.lifeMax)||0);return u.lifeMode==="fixed"?d:Math.max(d,f)},t=new Map(this.systems.map(u=>[u.id,u])),i=new Map,s=new Set,r=u=>{const d=i.get(u.id);if(d!=null)return d;if(s.has(u.id))return 0;s.add(u.id);const f=u.config,m=e(f);let p=m;if(f.eventEnabled)for(const g of f.events||[]){const v=t.get(g.targetSystemId);if(!v||v.id===u.id)continue;const b=r(v),y=g.event==="birth"?0:m,x=Math.max(0,Number(v.config.delay)||0);p=Math.max(p,y+x+b)}return s.delete(u.id),i.set(u.id,p),p},o=Xa(this.systems);let a=0;for(const u of this.systems){if(o.has(u.id))continue;const d=u.config,f=Math.max(0,Number(d.delay)||0),m=d.mode==="stream"&&d.streamBehavior==="loop";let p;if(d.mode==="stream"){const g=m?zn(d,n).total/n:Math.max(1/n,Number(d.duration)||0);if(p=f+g,m){let v=0;if(d.eventEnabled){const b=e(d);for(const y of d.events||[]){const x=t.get(y.targetSystemId);if(!x||x.id===u.id)continue;const _=Math.max(0,Number(x.config.delay)||0);v=Math.max(v,(y.event==="birth"?0:b)+_+r(x))}}p+=v}else p+=r(u)}else p=f+r(u);p>a&&(a=p)}for(const u of this.spines){const d=u.animations.find(m=>m.name===u.selectedAnimation);if(!d)continue;const f=Math.max(0,Number(u.timeOffset)||0)+Math.max(0,d.duration||0);f>a&&(a=f)}for(const u of this.colliders){if(!u.followPath||!u.followPathId)continue;const d=Math.max(0,Number(u.followDuration)||0);d>a&&(a=d)}const c=this.timeline.totalFrames,l=Math.max(2,kS(a,n)+1);this.timeline.totalFrames=l;const h=mF({start:this.timeline.playbackStart,end:this.timeline.playbackEnd},c,l);return this.timeline.playbackStart=h.start,this.timeline.playbackEnd=h.end,this.timeline.frame>=l&&(this.timeline.frame=l-1),l}}});/*! + * shared v11.4.16 + * (c) 2026 kazuya kawaguchi + * Released under the MIT License. + */const cu=typeof window<"u",io=(n,e=!1)=>e?Symbol.for(n):Symbol(n),pF=(n,e,t)=>gF({l:n,k:e,s:t}),gF=n=>JSON.stringify(n).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/\u0027/g,"\\u0027"),xi=n=>typeof n=="number"&&isFinite(n),LS=n=>Ng(n)==="[object Date]",Ya=n=>Ng(n)==="[object RegExp]",$g=n=>Yt(n)&&Object.keys(n).length===0,gi=Object.assign,vF=Object.create,Dt=(n=null)=>vF(n);let ab;const Gr=()=>ab||(ab=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:Dt()),yF=Object.prototype.hasOwnProperty;function Ln(n,e){return yF.call(n,e)}function Pi(n,e){const t=n[e];return Ln(n,e)?t:void 0}function OS(n){return Ln(Object.prototype,n)}const Jt=Array.isArray,Kt=n=>typeof n=="function",Ge=n=>typeof n=="string",Rt=n=>typeof n=="boolean",Et=n=>n!==null&&typeof n=="object",bF=n=>Et(n)&&Kt(n.then)&&Kt(n.catch),$S=Object.prototype.toString,Ng=n=>$S.call(n),Yt=n=>Ng(n)==="[object Object]",xF=n=>n==null?"":Jt(n)||Yt(n)&&n.toString===$S?JSON.stringify(n,null,2):String(n);function Dg(n,e=""){return n.reduce((t,i,s)=>s===0?t+i:t+e+i,"")}function wF(n,e){typeof console<"u"&&(console.warn("[intlify] "+n),e&&console.warn(e.stack))}function lb(n){return n.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/").replace(/=/g,"=")}function SF(n){return n.replace(/&(?![a-z0-9#]{2,6};)/gi,"&").replace(/"/g,""").replace(/'/g,"'").replace(//g,">")}const _F=/^javascript:/i,TF=/^(?:href|src|action|formaction)$/i,EF=/&#(?:x([0-9a-f]+)|(\d+));?/gi,CF=/&(?:Tab|NewLine);/g,MF=/:?/gi,AF=/[\u0000-\u0020\u007f-\u009f]/g,IF=/(?:^|[\s"'<>/])on\w+\s*=\s*["']?[^"'>]+["']?/i,PF=/(^|[\s"'<>/])on(\w+\s*=)/gi,RF=/(?:^|[\s"'<>/])srcdoc\s*=/i,kF=/(^|[\s"'<>/])s(rcdoc\s*=)/gi,FF=/(^|[\s"'<>/])((?:href|src|action|formaction)\s*=\s*)([^\s"'=<>`]+)/gi;function LF(n,e,t){const i=e||t;if(!i)return n;const s=Number.parseInt(i,e?16:10);return s<=127?String.fromCharCode(s):n}function Bg(n){const e=n.replace(EF,LF).replace(CF,"").replace(MF,":").replace(AF,"");return _F.test(e)}function OF(n){const e=/url\s*\(/gi;let t="",i=0,s;for(;(s=e.exec(n))!==null;){const r=s.index,o=e.lastIndex-1;let a=o+1,c=1,l=null;for(;a`${t}="${cb(t,i)}"`),n=n.replace(/([\w:-]+)\s*=\s*'([^']*)'/g,(e,t,i)=>`${t}='${cb(t,i)}'`),IF.test(n)&&(n=n.replace(PF,"$1on$2")),RF.test(n)&&(n=n.replace(kF,"$1s$2")),n=n.replace(FF,(e,t,i,s)=>Bg(s)?`${t}${i}about:blank`:e),n}const hb=n=>!Et(n)||Jt(n);function Ih(n,e){if(hb(n)||hb(e)||e===Object.prototype)throw new Error("Invalid value");const t=[{src:n,des:e}];for(;t.length;){const{src:i,des:s}=t.pop();Object.keys(i).forEach(r=>{if(r==="__proto__")return;const o=i[r];if(Jt(o)){const a=[];a.length=o.length,s[r]=a,t.push({src:o,des:a})}else Et(o)?((!Et(s[r])||Jt(s[r]))&&(s[r]=Dt()),t.push({src:o,des:s[r]})):s[r]=o})}}/*! + * message-compiler v11.4.16 + * (c) 2026 kazuya kawaguchi + * Released under the MIT License. + */function NF(n,e,t){return{line:n,column:e,offset:t}}function wp(n,e,t){return{start:n,end:e}}const Lt={EXPECTED_TOKEN:1,INVALID_TOKEN_IN_PLACEHOLDER:2,UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER:3,UNKNOWN_ESCAPE_SEQUENCE:4,INVALID_UNICODE_ESCAPE_SEQUENCE:5,UNBALANCED_CLOSING_BRACE:6,UNTERMINATED_CLOSING_BRACE:7,EMPTY_PLACEHOLDER:8,NOT_ALLOW_NEST_PLACEHOLDER:9,INVALID_LINKED_FORMAT:10,MUST_HAVE_MESSAGES_IN_PLURAL:11,UNEXPECTED_EMPTY_LINKED_MODIFIER:12,UNEXPECTED_EMPTY_LINKED_KEY:13,UNEXPECTED_LEXICAL_ANALYSIS:14},DF=17;function hd(n,e,t={}){const{domain:i,messages:s,args:r}=t,o=n,a=new SyntaxError(String(o));return a.code=n,e&&(a.location=e),a.domain=i,a}function BF(n){throw n}const ss=" ",UF="\r",Ui=` +`,VF="\u2028",XF="\u2029";function YF(n){const e=n;let t=0,i=1,s=1,r=0;const o=S=>e[S]===UF&&e[S+1]===Ui,a=S=>e[S]===Ui,c=S=>e[S]===XF,l=S=>e[S]===VF,h=S=>o(S)||a(S)||c(S)||l(S),u=()=>t,d=()=>i,f=()=>s,m=()=>r,p=S=>o(S)||c(S)||l(S)?Ui:e[S],g=()=>p(t),v=()=>p(t+r);function b(){return r=0,h(t)&&(i++,s=0),o(t)&&t++,t++,s++,e[t]}function y(){return o(t+r)&&r++,r++,e[t+r]}function x(){t=0,i=1,s=1,r=0}function _(S=0){r=S}function E(){const S=t+r;for(;S!==t;)b();r=0}return{index:u,line:d,column:f,peekOffset:m,charAt:p,currentChar:g,currentPeek:v,next:b,peek:y,reset:x,resetPeek:_,skipToPeek:E}}const Bs=void 0,GF=".",ub="'",HF="tokenizer";function jF(n,e={}){const t=e.location!==!1,i=YF(n),s=()=>i.index(),r=()=>NF(i.line(),i.column(),i.index()),o=r(),a=s(),c={currentType:13,offset:a,startLoc:o,endLoc:o,lastType:13,lastOffset:a,lastStartLoc:o,lastEndLoc:o,braceNest:0,inLinked:!1,text:""},l=()=>c,{onError:h}=e;function u(U,z,ee,...ne){const ue=l();if(z.column+=ee,z.offset+=ee,h){const xe=t?wp(ue.startLoc,z):null,be=hd(U,xe,{domain:HF,args:ne});h(be)}}function d(U,z,ee){U.endLoc=r(),U.currentType=z;const ne={type:z};return t&&(ne.loc=wp(U.startLoc,U.endLoc)),ee!=null&&(ne.value=ee),ne}const f=U=>d(U,13);function m(U,z){return U.currentChar()===z?(U.next(),z):(u(Lt.EXPECTED_TOKEN,r(),0,z),"")}function p(U){let z="";for(;U.currentPeek()===ss||U.currentPeek()===Ui;)z+=U.currentPeek(),U.peek();return z}function g(U){const z=p(U);return U.skipToPeek(),z}function v(U){if(U===Bs)return!1;const z=U.charCodeAt(0);return z>=97&&z<=122||z>=65&&z<=90||z===95}function b(U){if(U===Bs)return!1;const z=U.charCodeAt(0);return z>=48&&z<=57}function y(U,z){const{currentType:ee}=z;if(ee!==2)return!1;p(U);const ne=v(U.currentPeek());return U.resetPeek(),ne}function x(U,z){const{currentType:ee}=z;if(ee!==2)return!1;p(U);const ne=U.currentPeek()==="-"?U.peek():U.currentPeek(),ue=b(ne);return U.resetPeek(),ue}function _(U,z){const{currentType:ee}=z;if(ee!==2)return!1;p(U);const ne=U.currentPeek()===ub;return U.resetPeek(),ne}function E(U,z){const{currentType:ee}=z;if(ee!==7)return!1;p(U);const ne=U.currentPeek()===".";return U.resetPeek(),ne}function S(U,z){const{currentType:ee}=z;if(ee!==8)return!1;p(U);const ne=v(U.currentPeek());return U.resetPeek(),ne}function C(U,z){const{currentType:ee}=z;if(!(ee===7||ee===11))return!1;p(U);const ne=U.currentPeek()===":";return U.resetPeek(),ne}function M(U,z){const{currentType:ee}=z;if(ee!==9)return!1;const ne=()=>{const xe=U.currentPeek();return xe==="{"?v(U.peek()):xe==="@"||xe==="|"||xe===":"||xe==="."||xe===ss||!xe?!1:xe===Ui?(U.peek(),ne()):A(U,!1)},ue=ne();return U.resetPeek(),ue}function P(U){p(U);const z=U.currentPeek()==="|";return U.resetPeek(),z}function A(U,z=!0){const ee=(ue=!1,xe="")=>{const be=U.currentPeek();return be==="{"||be==="@"||!be?ue:be==="|"?!(xe===ss||xe===Ui):be===ss?(U.peek(),ee(!0,ss)):be===Ui?(U.peek(),ee(!0,Ui)):!0},ne=ee();return z&&U.resetPeek(),ne}function R(U,z){const ee=U.currentChar();return ee===Bs?Bs:z(ee)?(U.next(),ee):null}function B(U){const z=U.charCodeAt(0);return z>=97&&z<=122||z>=65&&z<=90||z>=48&&z<=57||z===95||z===36}function O(U){return R(U,B)}function W(U){const z=U.charCodeAt(0);return z>=97&&z<=122||z>=65&&z<=90||z>=48&&z<=57||z===95||z===36||z===45}function V(U){return R(U,W)}function Y(U){const z=U.charCodeAt(0);return z>=48&&z<=57}function L(U){return R(U,Y)}function N(U){const z=U.charCodeAt(0);return z>=48&&z<=57||z>=65&&z<=70||z>=97&&z<=102}function F(U){return R(U,N)}function D(U){let z="",ee="";for(;z=L(U);)ee+=z;return ee}function X(U){let z="";for(;;){const ee=U.currentChar();if(ee==="\\"){const ne=U.peek();ne==="{"||ne==="}"||ne==="@"||ne==="|"||ne==="\\"?(z+=ee+ne,U.next(),U.next()):(U.resetPeek(),z+=ee,U.next())}else{if(ee==="{"||ee==="}"||ee==="@"||ee==="|"||!ee)break;if(ee===ss||ee===Ui)if(A(U))z+=ee,U.next();else{if(P(U))break;z+=ee,U.next()}else z+=ee,U.next()}}return z}function G(U){g(U);let z="",ee="";for(;z=V(U);)ee+=z;const ne=U.currentChar();if(ne&&ne!=="}"&&ne!==Bs&&ne!==ss&&ne!==Ui&&ne!==" "){const ue=fe(U);return u(Lt.INVALID_TOKEN_IN_PLACEHOLDER,r(),0,ee+ue),ee+ue}return U.currentChar()===Bs&&u(Lt.UNTERMINATED_CLOSING_BRACE,r(),0),ee}function K(U){g(U);let z="";return U.currentChar()==="-"?(U.next(),z+=`-${D(U)}`):z+=D(U),U.currentChar()===Bs&&u(Lt.UNTERMINATED_CLOSING_BRACE,r(),0),z}function J(U){return U!==ub&&U!==Ui}function oe(U){g(U),m(U,"'");let z="",ee="";for(;z=R(U,J);)z==="\\"?ee+=le(U):ee+=z;const ne=U.currentChar();return ne===Ui||ne===Bs?(u(Lt.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,r(),0),ne===Ui&&(U.next(),m(U,"'")),ee):(m(U,"'"),ee)}function le(U){const z=U.currentChar();switch(z){case"\\":case"'":return U.next(),`\\${z}`;case"u":return ve(U,z,4);case"U":return ve(U,z,6);default:return u(Lt.UNKNOWN_ESCAPE_SEQUENCE,r(),0,z),""}}function ve(U,z,ee){m(U,z);let ne="";for(let ue=0;ue{const ne=U.currentChar();return ne==="{"||ne==="@"||ne==="|"||ne==="("||ne===")"||!ne||ne===ss?ee:(ee+=ne,U.next(),z(ee))};return z("")}function Z(U){g(U);const z=m(U,"|");return g(U),z}function se(U,z){let ee=null;switch(U.currentChar()){case"{":return z.braceNest>=1&&u(Lt.NOT_ALLOW_NEST_PLACEHOLDER,r(),0),U.next(),ee=d(z,2,"{"),g(U),z.braceNest++,ee;case"}":return z.braceNest>0&&z.currentType===2&&u(Lt.EMPTY_PLACEHOLDER,r(),0),U.next(),ee=d(z,3,"}"),z.braceNest--,z.braceNest>0&&g(U),z.inLinked&&z.braceNest===0&&(z.inLinked=!1),ee;case"@":return z.braceNest>0&&u(Lt.UNTERMINATED_CLOSING_BRACE,r(),0),ee=H(U,z)||f(z),z.braceNest=0,ee;default:{let ue=!0,xe=!0,be=!0;if(P(U))return z.braceNest>0&&u(Lt.UNTERMINATED_CLOSING_BRACE,r(),0),ee=d(z,1,Z(U)),z.braceNest=0,z.inLinked=!1,ee;if(z.braceNest>0&&(z.currentType===4||z.currentType===5||z.currentType===6))return u(Lt.UNTERMINATED_CLOSING_BRACE,r(),0),z.braceNest=0,j(U,z);if(ue=y(U,z))return ee=d(z,4,G(U)),g(U),ee;if(xe=x(U,z))return ee=d(z,5,K(U)),g(U),ee;if(be=_(U,z))return ee=d(z,6,oe(U)),g(U),ee;if(!ue&&!xe&&!be)return ee=d(z,12,fe(U)),u(Lt.INVALID_TOKEN_IN_PLACEHOLDER,r(),0,ee.value),g(U),ee;break}}return ee}function H(U,z){const{currentType:ee}=z;let ne=null;const ue=U.currentChar();switch((ee===7||ee===8||ee===11||ee===9)&&(ue===Ui||ue===ss)&&u(Lt.INVALID_LINKED_FORMAT,r(),0),ue){case"@":return U.next(),ne=d(z,7,"@"),z.inLinked=!0,ne;case".":return g(U),U.next(),d(z,8,".");case":":return g(U),U.next(),d(z,9,":");default:return P(U)?(ne=d(z,1,Z(U)),z.braceNest=0,z.inLinked=!1,ne):E(U,z)||C(U,z)?(g(U),H(U,z)):S(U,z)?(g(U),d(z,11,ye(U))):M(U,z)?(g(U),ue==="{"?se(U,z)||ne:d(z,10,q(U))):(ee===7&&u(Lt.INVALID_LINKED_FORMAT,r(),0),z.braceNest=0,z.inLinked=!1,j(U,z))}}function j(U,z){let ee={type:13};if(z.braceNest>0)return se(U,z)||f(z);if(z.inLinked)return H(U,z)||f(z);switch(U.currentChar()){case"{":return se(U,z)||f(z);case"}":return u(Lt.UNBALANCED_CLOSING_BRACE,r(),0),U.next(),d(z,3,"}");case"@":return H(U,z)||f(z);default:{if(P(U))return ee=d(z,1,Z(U)),z.braceNest=0,z.inLinked=!1,ee;if(A(U))return d(z,0,X(U));break}}return ee}function $(){const{currentType:U,offset:z,startLoc:ee,endLoc:ne}=c;return c.lastType=U,c.lastOffset=z,c.lastStartLoc=ee,c.lastEndLoc=ne,c.offset=s(),c.startLoc=r(),i.currentChar()===Bs?d(c,13):j(i,c)}return{nextToken:$,currentOffset:s,currentPosition:r,context:l}}const WF="parser",zF=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g,qF=/\\([\\@{}|])/g;function KF(n,e){return e}function JF(n,e,t){switch(n){case"\\\\":return"\\";case"\\'":return"'";default:{const i=parseInt(e||t,16);return i<=55295||i>=57344?String.fromCodePoint(i):"�"}}}function ZF(n={}){const e=n.location!==!1,{onError:t}=n;function i(v,b,y,x,..._){const E=v.currentPosition();if(E.offset+=x,E.column+=x,t){const S=e?wp(y,E):null,C=hd(b,S,{domain:WF,args:_});t(C)}}function s(v,b,y){const x={type:v};return e&&(x.start=b,x.end=b,x.loc={start:y,end:y}),x}function r(v,b,y,x){e&&(v.end=b,v.loc&&(v.loc.end=y))}function o(v,b){const y=v.context(),x=s(3,y.offset,y.startLoc);return x.value=b.replace(qF,KF),r(x,v.currentOffset(),v.currentPosition()),x}function a(v,b){const y=v.context(),{lastOffset:x,lastStartLoc:_}=y,E=s(5,x,_);return E.index=parseInt(b,10),v.nextToken(),r(E,v.currentOffset(),v.currentPosition()),E}function c(v,b){const y=v.context(),{lastOffset:x,lastStartLoc:_}=y,E=s(4,x,_);return E.key=b,v.nextToken(),r(E,v.currentOffset(),v.currentPosition()),E}function l(v,b){const y=v.context(),{lastOffset:x,lastStartLoc:_}=y,E=s(9,x,_);return E.value=b.replace(zF,JF),v.nextToken(),r(E,v.currentOffset(),v.currentPosition()),E}function h(v){const b=v.nextToken(),y=v.context(),{lastOffset:x,lastStartLoc:_}=y,E=s(8,x,_);return b.type!==11?(i(v,Lt.UNEXPECTED_EMPTY_LINKED_MODIFIER,y.lastStartLoc,0),E.value="",r(E,x,_),{nextConsumeToken:b,node:E}):(b.value==null&&i(v,Lt.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,rs(b)),E.value=b.value||"",r(E,v.currentOffset(),v.currentPosition()),{node:E})}function u(v,b){const y=v.context(),x=s(7,y.offset,y.startLoc);return x.value=b,r(x,v.currentOffset(),v.currentPosition()),x}function d(v){const b=v.context(),y=s(6,b.offset,b.startLoc);let x=v.nextToken();if(x.type===8){const _=h(v);y.modifier=_.node,x=_.nextConsumeToken||v.nextToken()}switch(x.type!==9&&i(v,Lt.UNEXPECTED_LEXICAL_ANALYSIS,b.lastStartLoc,0,rs(x)),x=v.nextToken(),x.type===2&&(x=v.nextToken()),x.type){case 10:x.value==null&&i(v,Lt.UNEXPECTED_LEXICAL_ANALYSIS,b.lastStartLoc,0,rs(x)),y.key=u(v,x.value||"");break;case 4:x.value==null&&i(v,Lt.UNEXPECTED_LEXICAL_ANALYSIS,b.lastStartLoc,0,rs(x)),y.key=c(v,x.value||"");break;case 5:x.value==null&&i(v,Lt.UNEXPECTED_LEXICAL_ANALYSIS,b.lastStartLoc,0,rs(x)),y.key=a(v,x.value||"");break;case 6:x.value==null&&i(v,Lt.UNEXPECTED_LEXICAL_ANALYSIS,b.lastStartLoc,0,rs(x)),y.key=l(v,x.value||"");break;default:{i(v,Lt.UNEXPECTED_EMPTY_LINKED_KEY,b.lastStartLoc,0);const _=v.context(),E=s(7,_.offset,_.startLoc);return E.value="",r(E,_.offset,_.startLoc),y.key=E,r(y,_.offset,_.startLoc),{nextConsumeToken:x,node:y}}}return r(y,v.currentOffset(),v.currentPosition()),{node:y}}function f(v){const b=v.context(),y=b.currentType===1?v.currentOffset():b.offset,x=b.currentType===1?b.endLoc:b.startLoc,_=s(2,y,x);_.items=[];let E=null;do{const M=E||v.nextToken();switch(E=null,M.type){case 0:M.value==null&&i(v,Lt.UNEXPECTED_LEXICAL_ANALYSIS,b.lastStartLoc,0,rs(M)),_.items.push(o(v,M.value||""));break;case 5:M.value==null&&i(v,Lt.UNEXPECTED_LEXICAL_ANALYSIS,b.lastStartLoc,0,rs(M)),_.items.push(a(v,M.value||""));break;case 4:M.value==null&&i(v,Lt.UNEXPECTED_LEXICAL_ANALYSIS,b.lastStartLoc,0,rs(M)),_.items.push(c(v,M.value||""));break;case 6:M.value==null&&i(v,Lt.UNEXPECTED_LEXICAL_ANALYSIS,b.lastStartLoc,0,rs(M)),_.items.push(l(v,M.value||""));break;case 7:{const P=d(v);_.items.push(P.node),E=P.nextConsumeToken||null;break}}}while(b.currentType!==13&&b.currentType!==1);const S=b.currentType===1?b.lastOffset:v.currentOffset(),C=b.currentType===1?b.lastEndLoc:v.currentPosition();return r(_,S,C),_}function m(v,b,y,x){const _=v.context();let E=x.items.length===0;const S=s(1,b,y);S.cases=[],S.cases.push(x);do{const C=f(v);E||(E=C.items.length===0),S.cases.push(C)}while(_.currentType!==13);return E&&i(v,Lt.MUST_HAVE_MESSAGES_IN_PLURAL,y,0),r(S,v.currentOffset(),v.currentPosition()),S}function p(v){const b=v.context(),{offset:y,startLoc:x}=b,_=f(v);return b.currentType===13?_:m(v,y,x,_)}function g(v){const b=jF(v,gi({},n)),y=b.context(),x=s(0,y.offset,y.startLoc);return e&&x.loc&&(x.loc.source=v),x.body=p(b),n.onCacheKey&&(x.cacheKey=n.onCacheKey(v)),y.currentType!==13&&i(b,Lt.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,v[y.offset]||""),r(x,b.currentOffset(),b.currentPosition()),x}return{parse:g}}function rs(n){if(n.type===13)return"EOF";const e=(n.value||"").replace(/\r?\n/gu,"\\n");return e.length>10?e.slice(0,9)+"…":e}function QF(n,e={}){const t={ast:n,helpers:new Set};return{context:()=>t,helper:r=>(t.helpers.add(r),r)}}function db(n,e){for(let t=0;tfb(t)),n}function fb(n){if(n.items.length===1){const e=n.items[0];(e.type===3||e.type===9)&&(n.static=e.value,delete e.value)}else{const e=[];for(let t=0;to;function c(p,g){o.code+=p}function l(p,g=!0){const v=g?i:"";c(s?v+" ".repeat(p):v)}function h(p=!0){const g=++o.indentLevel;p&&l(g)}function u(p=!0){const g=--o.indentLevel;p&&l(g)}function d(){l(o.indentLevel)}return{context:a,push:c,indent:h,deindent:u,newline:d,helper:p=>`_${p}`,needIndent:()=>o.needIndent}}function nL(n,e){const{helper:t}=n;n.push(`${t("linked")}(`),Ga(n,e.key),e.modifier?(n.push(", "),Ga(n,e.modifier),n.push(", _type")):n.push(", undefined, _type"),n.push(")")}function sL(n,e){const{helper:t,needIndent:i}=n;n.push(`${t("normalize")}([`),n.indent(i());const s=e.items.length;for(let r=0;r1){n.push(`${t("plural")}([`),n.indent(i());const s=e.cases.length;for(let r=0;r{const t=Ge(e.mode)?e.mode:"normal",i=Ge(e.filename)?e.filename:"message.intl";e.sourceMap;const s=e.breakLineCode!=null?e.breakLineCode:t==="arrow"?";":` +`,r=e.needIndent?e.needIndent:t!=="arrow",o=n.helpers||[],a=iL(n,{filename:i,breakLineCode:s,needIndent:r});a.push(t==="normal"?"function __msg__ (ctx) {":"(ctx) => {"),a.indent(r),o.length>0&&(a.push(`const { ${Dg(o.map(h=>`${h}: _${h}`),", ")} } = ctx`),a.newline()),a.push("return "),Ga(a,n),a.deindent(r),a.push("}"),delete n.helpers;const{code:c,map:l}=a.context();return{ast:n,code:c,map:l?l.toJSON():void 0}};function lL(n,e={}){const t=gi({},e),i=!!t.jit,s=!!t.minify,r=t.optimize==null?!0:t.optimize,a=ZF(t).parse(n);return i?(r&&tL(a),s&&ba(a),{ast:a,code:""}):(eL(a,t),aL(a,t))}/*! + * core-base v11.4.16 + * (c) 2026 kazuya kawaguchi + * Released under the MIT License. + */function cL(){typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(Gr().__INTLIFY_PROD_DEVTOOLS__=!1),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(Gr().__INTLIFY_DROP_MESSAGE_COMPILER__=!1)}function Xo(n){return Et(n)&&Vg(n)===0&&(Ln(n,"b")||Ln(n,"body"))}const NS=["b","body"];function hL(n){return no(n,NS)}const DS=["c","cases"];function uL(n){return no(n,DS,[])}const BS=["s","static"];function dL(n){return no(n,BS)}const US=["i","items"];function fL(n){return no(n,US,[])}const VS=["t","type"];function Vg(n){return no(n,VS)}const XS=["v","value"];function oh(n,e){const t=no(n,XS);if(t!=null)return t;throw ic(e)}const YS=["m","modifier"];function mL(n){return no(n,YS)}const GS=["k","key"];function pL(n){const e=no(n,GS);if(e)return e;throw ic(6)}function no(n,e,t){for(let i=0;igL(t,n)}function gL(n,e){const t=hL(e);if(t==null)throw ic(0);if(Vg(t)===1){const r=uL(t);return n.plural(r.reduce((o,a)=>[...o,mb(n,a)],[]))}else return mb(n,t)}function mb(n,e){const t=dL(e);if(t!=null)return n.type==="text"?t:n.normalize([t]);{const i=fL(e).reduce((s,r)=>[...s,Sp(n,r)],[]);return n.normalize(i)}}function Sp(n,e){const t=Vg(e);switch(t){case 3:return oh(e,t);case 9:return oh(e,t);case 4:{const i=e;if(Ln(i,"k")&&i.k)return n.interpolate(n.named(i.k));if(Ln(i,"key")&&i.key)return n.interpolate(n.named(i.key));throw ic(t)}case 5:{const i=e;if(Ln(i,"i")&&xi(i.i))return n.interpolate(n.list(i.i));if(Ln(i,"index")&&xi(i.index))return n.interpolate(n.list(i.index));throw ic(t)}case 6:{const i=e,s=mL(i),r=pL(i);return n.linked(Sp(n,r),s?Sp(n,s):void 0,n.type)}case 7:return oh(e,t);case 8:return oh(e,t);default:throw new Error(`unhandled node on format message part: ${t}`)}}const vL=n=>n;let ah=Dt();function yL(n,e={}){let t=!1;const i=e.onError||BF;return e.onError=s=>{t=!0,i(s)},{...lL(n,e),detectError:t}}function bL(n,e){if(!__INTLIFY_DROP_MESSAGE_COMPILER__&&Ge(n)){Rt(e.warnHtmlMessage)&&e.warnHtmlMessage;const i=(e.onCacheKey||vL)(n),s=ah[i];if(s)return s;const{ast:r,detectError:o}=yL(n,{...e,location:!1,jit:!0}),a=om(r);return o?a:ah[i]=a}else{if(!Xo(n))return(()=>n);const t=n.cacheKey;if(t){const i=ah[t];return i||(ah[t]=om(n))}else return om(n)}}let nc=null;function xL(n){nc=n}function wL(n,e,t){nc&&nc.emit("i18n:init",{timestamp:Date.now(),i18n:n,version:e,meta:t})}const SL=_L("function:translate");function _L(n){return e=>nc&&nc.emit(n,e)}const Zs={INVALID_ARGUMENT:DF,INVALID_DATE_ARGUMENT:18,INVALID_ISO_DATE_ARGUMENT:19,NOT_SUPPORT_LOCALE_PROMISE_VALUE:21,NOT_SUPPORT_LOCALE_ASYNC_FUNCTION:22,NOT_SUPPORT_LOCALE_TYPE:23},TL=24;function Qs(n){return hd(n,null,void 0)}function Xg(n,e){return e.locale!=null?pb(e.locale):pb(n.locale)}let am;function pb(n){if(Ge(n))return n;if(Kt(n)){if(n.resolvedOnce&&am!=null)return am;if(n.constructor.name==="Function"){const e=n();if(bF(e))throw Qs(Zs.NOT_SUPPORT_LOCALE_PROMISE_VALUE);return am=e}else throw Qs(Zs.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION)}else throw Qs(Zs.NOT_SUPPORT_LOCALE_TYPE)}function EL(n,e,t){return[...new Set([t,...Jt(e)?e:Et(e)?Object.keys(e).filter(i=>i!=="default"):Ge(e)?[e]:[t]])]}function CL(n,e,t){const i=Ge(t)?t:sc,s=n;let r;Et(e)?(s.__localeChainObjectCache||(s.__localeChainObjectCache=new WeakMap),r=s.__localeChainObjectCache.get(e),r||(r=new Map,s.__localeChainObjectCache.set(e,r))):(s.__localeChainCache||(s.__localeChainCache=new Map),r=s.__localeChainCache.get(e),r||(r=new Map,s.__localeChainCache.set(e,r)));const o=r.get(i);if(o)return o;const a=[];let c=[t];for(;Jt(c);)c=gb(a,c,e);const l=Jt(e)||!Yt(e)?e:e.default?e.default:null;return c=Ge(l)?[l]:l,Jt(c)&&gb(a,c,!1),r.set(i,a),a}function gb(n,e,t){let i=!0;for(let s=0;s{o===void 0?o=a:o+=a},d[1]=()=>{o!==void 0&&(e.push(o),o=void 0)},d[2]=()=>{d[0](),s++},d[3]=()=>{if(s>0)s--,i=4,d[0]();else{if(s=0,o===void 0||(o=FL(o),o===!1))return!1;d[1]()}};function f(){const m=n[t+1];if(i===5&&m==="'"||i===6&&m==='"')return t++,a="\\"+m,d[0](),!0}for(;i!==null;)if(t++,r=n[t],!(r==="\\"&&f())){if(c=kL(r),u=so[i],l=u[c]||u.l||8,l===8||(i=l[0],l[1]!==void 0&&(h=d[l[1]],h&&(a=r,h()===!1))))return;if(i===7)return e}}const vb=new Map;function OL(n,e){return Et(n)?Pi(n,e):null}function $L(n,e){if(!Et(n))return null;let t=vb.get(e);if(t||(t=LL(e),t&&vb.set(e,t)),!t)return null;const i=t.length;let s=n,r=0;for(;r`${n.charAt(0).toLocaleUpperCase()}${n.substr(1)}`;function DL(){return{upper:(n,e)=>e==="text"&&Ge(n)?n.toUpperCase():e==="vnode"&&Et(n)&&"__v_isVNode"in n?n.children.toUpperCase():n,lower:(n,e)=>e==="text"&&Ge(n)?n.toLowerCase():e==="vnode"&&Et(n)&&"__v_isVNode"in n?n.children.toLowerCase():n,capitalize:(n,e)=>e==="text"&&Ge(n)?yb(n):e==="vnode"&&Et(n)&&"__v_isVNode"in n?yb(n.children):n}}let jS;function BL(n){jS=n}let WS;function UL(n){WS=n}let zS;function VL(n){zS=n}let qS=null;const XL=n=>{qS=n},YL=()=>qS;let KS=null;const bb=n=>{KS=n},GL=()=>KS;let xb=0;function HL(n={}){const e=Kt(n.onWarn)?n.onWarn:wF,t=Ge(n.version)?n.version:NL,i=Ge(n.locale)||Kt(n.locale)?n.locale:sc,s=Kt(i)?sc:i,r=Jt(n.fallbackLocale)||Yt(n.fallbackLocale)||Ge(n.fallbackLocale)||n.fallbackLocale===!1?n.fallbackLocale:s,o=Yt(n.messages)?n.messages:lm(s),a=Yt(n.datetimeFormats)?n.datetimeFormats:lm(s),c=Yt(n.numberFormats)?n.numberFormats:lm(s),l=gi(Dt(),n.modifiers,DL()),h=n.pluralRules||Dt(),u=Kt(n.missing)?n.missing:null,d=Rt(n.missingWarn)||Ya(n.missingWarn)?n.missingWarn:!0,f=Rt(n.fallbackWarn)||Ya(n.fallbackWarn)?n.fallbackWarn:!0,m=!!n.fallbackFormat,p=!!n.unresolving,g=Kt(n.postTranslation)?n.postTranslation:null,v=Yt(n.processor)?n.processor:null,b=Rt(n.warnHtmlMessage)?n.warnHtmlMessage:!0,y=!!n.escapeParameter,x=Kt(n.messageCompiler)?n.messageCompiler:jS,_=Kt(n.messageResolver)?n.messageResolver:WS||OL,E=Kt(n.localeFallbacker)?n.localeFallbacker:zS||EL,S=Et(n.fallbackContext)?n.fallbackContext:void 0,C=n,M=Et(C.__datetimeFormatters)?C.__datetimeFormatters:new Map,P=Et(C.__numberFormatters)?C.__numberFormatters:new Map,A=Et(C.__meta)?C.__meta:{};xb++;const R={version:t,cid:xb,locale:i,fallbackLocale:r,messages:o,modifiers:l,pluralRules:h,missing:u,missingWarn:d,fallbackWarn:f,fallbackFormat:m,unresolving:p,postTranslation:g,processor:v,warnHtmlMessage:b,escapeParameter:y,messageCompiler:x,messageResolver:_,localeFallbacker:E,fallbackContext:S,onWarn:e,__meta:A};return R.datetimeFormats=a,R.numberFormats=c,R.__datetimeFormatters=M,R.__numberFormatters=P,__INTLIFY_PROD_DEVTOOLS__&&wL(R,t,A),R}const lm=n=>({[n]:Dt()});function JS(n,e,t,i,s){const{missing:r,onWarn:o}=n;if(r!==null){const a=r(n,t,e,s);return Ge(a)?a:e}else return e}function wb(n,e){var i,s;const t=n;Et(e)?(i=t.__localeChainObjectCache)==null||i.delete(e):(s=t.__localeChainCache)==null||s.delete(e)}function lh(n,e,t){wb(n,t),n.fallbackContext&&wb(n.fallbackContext,t),n.localeFallbacker(n,t,e)}function jL(n,e){return n===e?!1:n.split("-")[0]===e.split("-")[0]}function WL(n,e){const t=e.indexOf(n);if(t===-1)return!1;for(let i=t+1;i{i.includes(c)?a[c]=s[c]:e[c]=s[c]}),Ge(r)?e.locale=r:Yt(r)&&(a=r),Yt(o)&&(a=o),a}function Sb(n,...e){const{datetimeFormats:t,unresolving:i,onWarn:s}=n,{__datetimeFormatters:r}=n;if(!Ge(e[0])&&!LS(e[0])&&!xi(e[0]))return hu;const[o,a,c,l]=_p(...e),h=Rt(c.missingWarn)?c.missingWarn:n.missingWarn,u=Rt(c.fallbackWarn)?c.fallbackWarn:n.fallbackWarn,d=!!c.part,f=Xg(n,c);if(!Ge(o)||o===""){const b=new Intl.DateTimeFormat(f.replace(/!/g,""),l);return d?b.formatToParts(a):b.format(a)}const m=ZS(n,o,f,t,h,u,"datetime format");if(!Ge(m))return i?ud:o;const p=t[m][o],g=QS(m,o,l);let v=r.get(g);return v||(v=new Intl.DateTimeFormat(m,gi({},p,l)),r.set(g,v)),d?v.formatToParts(a):v.format(a)}const i_=["localeMatcher","weekday","era","year","month","day","hour","minute","second","timeZoneName","formatMatcher","hour12","timeZone","dateStyle","timeStyle","calendar","dayPeriod","numberingSystem","hourCycle","fractionalSecondDigits"];function _p(...n){const[e]=n,t=Dt(),i=Dt();let s;if(Ge(e)){const o=e.match(/(\d{4}-\d{2}-\d{2})(T|\s)?(.*)/);if(!o)throw Qs(Zs.INVALID_ISO_DATE_ARGUMENT);const a=o[3]?o[3].trim().startsWith("T")?`${o[1].trim()}${o[3].trim()}`:`${o[1].trim()}T${o[3].trim()}`:o[1].trim();s=new Date(a);try{s.toISOString()}catch{throw Qs(Zs.INVALID_ISO_DATE_ARGUMENT)}}else if(LS(e)){if(isNaN(e.getTime()))throw Qs(Zs.INVALID_DATE_ARGUMENT);s=e}else if(xi(e))s=e;else throw Qs(Zs.INVALID_ARGUMENT);const r=t_(n,t,i,i_);return[t.key||"",s,t,r]}function _b(n,e,t){e_(n.__datetimeFormatters,e,t)}function Tb(n,...e){const{numberFormats:t,unresolving:i,onWarn:s}=n,{__numberFormatters:r}=n;if(!xi(e[0]))return hu;const[o,a,c,l]=Tp(...e),h=Rt(c.missingWarn)?c.missingWarn:n.missingWarn,u=Rt(c.fallbackWarn)?c.fallbackWarn:n.fallbackWarn,d=!!c.part,f=Xg(n,c);if(!Ge(o)||o===""){const b=new Intl.NumberFormat(f.replace(/!/g,""),l);return d?b.formatToParts(a):b.format(a)}const m=ZS(n,o,f,t,h,u,"number format");if(!Ge(m))return i?ud:o;const p=t[m][o],g=QS(m,o,l);let v=r.get(g);return v||(v=new Intl.NumberFormat(m,gi({},p,l)),r.set(g,v)),d?v.formatToParts(a):v.format(a)}const n_=["localeMatcher","style","currency","currencyDisplay","currencySign","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","compactDisplay","notation","signDisplay","unit","unitDisplay","roundingMode","roundingPriority","roundingIncrement","trailingZeroDisplay"];function Tp(...n){const[e]=n,t=Dt(),i=Dt();if(!xi(e))throw Qs(Zs.INVALID_ARGUMENT);const s=e,r=t_(n,t,i,n_);return[t.key||"",s,t,r]}function Eb(n,e,t){e_(n.__numberFormatters,e,t)}const zL=n=>n,qL=n=>"",KL="text",JL=n=>n.length===0?"":Dg(n),ZL=xF;function cm(n,e){return n=Math.abs(n),e===2?n===1?0:1:Math.min(n,2)}function QL(n){var t,i;const e=xi(n.pluralIndex)?n.pluralIndex:-1;return xi((t=n.named)==null?void 0:t.count)?n.named.count:xi((i=n.named)==null?void 0:i.n)?n.named.n:e}function eO(n={}){var b,y,x;const e=n.locale,t=QL(n),i=Ge(e)&&n.pluralRules&&Kt(Pi(n.pluralRules,e))?n.pluralRules[e]:cm,s=i===cm?void 0:cm,r=_=>_[i(t,_.length,s)],o=n.list||[],a=_=>o[_],c=n.named||Dt(),l=xi(n.pluralIndex),h=_=>{const E=OS(_)?Pi(c,_):c[_];return l&&!E&&(_==="count"||_==="n")?n.pluralIndex:E};function u(_,E){const S=Kt(n.messages)?n.messages(_,!!E):Et(n.messages)?n.messages[_]:!1;return S||(n.parent?n.parent.message(_):qL)}const d=_=>n.modifiers?Pi(n.modifiers,_):zL,f=Kt((b=n.processor)==null?void 0:b.normalize)?n.processor.normalize:JL,m=Kt((y=n.processor)==null?void 0:y.interpolate)?n.processor.interpolate:ZL,p=Ge((x=n.processor)==null?void 0:x.type)?n.processor.type:KL,v={list:a,named:h,plural:r,linked:(_,...E)=>{const[S,C]=E;let M="text",P="";E.length===1?Et(S)?(P=S.modifier||P,M=S.type||M):Ge(S)&&(P=S||P):E.length===2&&(Ge(S)&&(P=S||P),Ge(C)&&(M=C||M));const A=u(_,!0)(v),R=A===""||A===void 0?_:A,B=M==="vnode"&&Jt(R)&&P?R[0]:R;if(!P)return B;const O=d(P);return Kt(O)?O(B,M):B},message:u,type:p,interpolate:m,normalize:f,values:gi(Dt(),o,c,l?{count:h("count"),n:h("n")}:{})};return v}const Cb=()=>"",er=n=>Kt(n),uu=n=>Ge(n)||Xo(n)||er(n);function Mb(n,...e){const{fallbackFormat:t,postTranslation:i,unresolving:s,messageCompiler:r,fallbackLocale:o,messages:a}=n,[c,l]=Ep(...e),h=Rt(l.missingWarn)?l.missingWarn:n.missingWarn,u=Rt(l.fallbackWarn)?l.fallbackWarn:n.fallbackWarn,d=Rt(l.escapeParameter)?l.escapeParameter:n.escapeParameter,f=!!l.resolvedMessage,m=Ge(l.default)||Rt(l.default)?Rt(l.default)?r?c:()=>c:l.default:t?r?c:()=>c:null,p=t||m!=null&&(Ge(m)||Kt(m)),g=Xg(n,l);d&&tO(l);let[v,b,y]=f?[c,g,Pi(a,g)||Dt()]:s_(n,c,g,o,u,h),x=v,_=c;if(!f&&!uu(x)&&p&&(x=m,_=x),!f&&(!uu(x)||!Ge(b)))return s?ud:c;let E=!1;const S=()=>{E=!0},C=er(x)?x:r_(n,c,b,x,_,S);if(E)return x;const M=sO(n,b,y,l),P=eO(M),A=iO(n,C,P);let R=i?i(A,c):A;if(d&&Ge(R)&&(R=$F(R)),__INTLIFY_PROD_DEVTOOLS__){const B={timestamp:Date.now(),key:Ge(c)?c:er(x)?x.key:"",locale:b||(er(x)?x.locale:""),format:Ge(x)?x:er(x)?x.source:"",message:R};B.meta=gi({},n.__meta,YL()||{}),SL(B)}return R}function tO(n){if(Jt(n.list)&&(n.list=n.list.map(e=>Ge(e)?lb(e):e)),Et(n.named)){const e=n.named,t=Dt();for(const i of Object.keys(e)){const s=e[i];t[i]=Ge(s)?lb(s):s}n.named=t}}function s_(n,e,t,i,s,r){const{messages:o,onWarn:a,messageResolver:c,localeFallbacker:l}=n,h=l(n,i,t);let u=Dt(),d,f=null;const m="translate";for(let p=0;pi);return l.locale=t,l.key=e,l}const c=o(i,nO(n,t,s,i,a,r));return c.locale=t,c.key=e,c.source=i,c}function iO(n,e,t){return e(t)}function Ep(...n){const[e,t,i]=n,s=Dt();if(!Ge(e)&&!xi(e)&&!er(e)&&!Xo(e))throw Qs(Zs.INVALID_ARGUMENT);const r=xi(e)?String(e):(er(e),e);return xi(t)?s.plural=t:Ge(t)?s.default=t:Yt(t)&&!$g(t)?s.named=t:Jt(t)&&(s.list=t),xi(i)?s.plural=i:Ge(i)?s.default=i:Yt(i)&&gi(s,i),[r,s]}function nO(n,e,t,i,s,r){return{locale:e,key:t,warnHtmlMessage:s,onError:o=>{throw r&&r(o),o},onCacheKey:o=>pF(e,t,o)}}function sO(n,e,t,i){const{modifiers:s,pluralRules:r,messageResolver:o,fallbackLocale:a,fallbackWarn:c,missingWarn:l,fallbackContext:h}=n,d={locale:e,modifiers:s,pluralRules:r,messages:(f,m)=>{let p=o(t,f);if(p==null&&(h||m)){const[g,,v]=s_(h||n,f,e,a,c,l);p=g??o(v,f)}if(Ge(p)||Xo(p)){let g=!1;const b=r_(n,f,e,p,f,()=>{g=!0});return g?Cb:b}else return er(p)?p:Cb}};return n.processor&&(d.processor=n.processor),i.list&&(d.list=i.list),i.named&&(d.named=i.named),xi(i.plural)&&(d.pluralIndex=i.plural),d}cL();/*! + * vue-i18n v11.4.16 + * (c) 2026 kazuya kawaguchi + * Released under the MIT License. + */const rO="11.4.16";function oO(){typeof __VUE_I18N_FULL_INSTALL__!="boolean"&&(Gr().__VUE_I18N_FULL_INSTALL__=!0),typeof __VUE_I18N_LEGACY_API__!="boolean"&&(Gr().__VUE_I18N_LEGACY_API__=!0),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(Gr().__INTLIFY_DROP_MESSAGE_COMPILER__=!1),typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(Gr().__INTLIFY_PROD_DEVTOOLS__=!1)}const sn={UNEXPECTED_RETURN_TYPE:TL,INVALID_ARGUMENT:25,MUST_BE_CALL_SETUP_TOP:26,NOT_INSTALLED:27,REQUIRED_VALUE:28,INVALID_VALUE:29,NOT_INSTALLED_WITH_PROVIDE:31,UNEXPECTED_ERROR:32,NOT_AVAILABLE_COMPOSITION_IN_LEGACY:34};function dn(n,...e){return hd(n,null,void 0)}const Cp=io("__translateVNode"),Mp=io("__datetimeParts"),Ap=io("__numberParts"),o_=io("__setPluralRules"),a_=io("__injectWithOption"),wa=io("__dispose");let l_=null;{const n=Gr().__VUE_INSTANCE_SETTERS__;Jt(n)&&n.push(e=>{l_=e})}function Fr(n){return!!OS(n)}function rc(n){if(!Et(n)||Xo(n))return n;for(const e in n)if(Ln(n,e))if(!e.includes("."))Et(n[e])&&rc(n[e]);else{const t=e.split("."),i=t.length-1;let s=n,r=!1;for(let a=0;a{if("locale"in a&&"resource"in a){const{locale:c,resource:l}=a;if(c){if(Fr(c))return;o[c]=Pi(o,c)||Dt(),Ih(l,o[c])}else Ih(l,o)}else Ge(a)&&Ih(JSON.parse(a),o)}),s==null&&r)for(const a in o)Ln(o,a)&&rc(o[a]);return o}function c_(n){return n.type}function h_(n,e,t){let i=Et(e.messages)?e.messages:Dt();"__i18nGlobal"in t&&(i=Yg(n.locale.value,{messages:i,__i18n:t.__i18nGlobal}));const s=Object.keys(i);s.length&&s.forEach(r=>{n.mergeLocaleMessage(r,i[r])});{if(Et(e.datetimeFormats)){const r=Object.keys(e.datetimeFormats);r.length&&r.forEach(o=>{n.mergeDateTimeFormat(o,e.datetimeFormats[o])})}if(Et(e.numberFormats)){const r=Object.keys(e.numberFormats);r.length&&r.forEach(o=>{n.mergeNumberFormat(o,e.numberFormats[o])})}}}function Ab(n){return Te(fc,null,n,0)}function oc(){return l_??Ku()}const Ib="__INTLIFY_META__",Pb=()=>[],aO=()=>!1;let Rb=0;function kb(n){return((e,t,i,s)=>n(t,i,oc()||void 0,s))}const lO=()=>{const n=oc();let e=null;return n&&(e=c_(n)[Ib])?{[Ib]:e}:null};function du(n={}){const{__root:e,__injectWithOption:t}=n,i=e===void 0,s=n.flatJson,r=cu?De:SC;let o=Rt(n.inheritLocale)?n.inheritLocale:!0;const a=r(e&&o?e.locale.value:Ge(n.locale)?n.locale:sc),c=r(e&&o?e.fallbackLocale.value:Ge(n.fallbackLocale)||Jt(n.fallbackLocale)||Yt(n.fallbackLocale)||n.fallbackLocale===!1?n.fallbackLocale:a.value),l=r(Yg(a.value,n)),h=r(Yt(n.datetimeFormats)?n.datetimeFormats:{[a.value]:{}}),u=r(Yt(n.numberFormats)?n.numberFormats:{[a.value]:{}});let d=e?e.missingWarn:Rt(n.missingWarn)||Ya(n.missingWarn)?n.missingWarn:!0,f=e?e.fallbackWarn:Rt(n.fallbackWarn)||Ya(n.fallbackWarn)?n.fallbackWarn:!0,m=e?e.fallbackRoot:Rt(n.fallbackRoot)?n.fallbackRoot:!0,p=!!n.fallbackFormat,g=Kt(n.missing)?n.missing:null,v=Kt(n.missing)?kb(n.missing):null,b=Kt(n.postTranslation)?n.postTranslation:null,y=e?e.warnHtmlMessage:Rt(n.warnHtmlMessage)?n.warnHtmlMessage:!0,x=!!n.escapeParameter;const _=e?e.modifiers:Yt(n.modifiers)?n.modifiers:{};let E=n.pluralRules||e&&e.pluralRules,S;S=(()=>{i&&bb(null);const he={version:rO,locale:a.value,fallbackLocale:c.value,messages:l.value,modifiers:_,pluralRules:E,missing:v===null?void 0:v,missingWarn:d,fallbackWarn:f,fallbackFormat:p,unresolving:!0,postTranslation:b===null?void 0:b,warnHtmlMessage:y,escapeParameter:x,messageResolver:n.messageResolver,messageCompiler:n.messageCompiler,__meta:{framework:"vue"}};he.datetimeFormats=h.value,he.numberFormats=u.value;const ge=HL(he);return i&&bb(ge),ge})(),lh(S,a.value,c.value);function M(){return[a.value,c.value,l.value,h.value,u.value]}const P=Fe({get:()=>a.value,set:he=>{S.locale=he,a.value=he}});function A(he){i||(S.fallbackContext=GL());try{return he()}finally{i||(S.fallbackContext=void 0)}}function R(he){A(()=>lh(S,a.value,he))}const B=Fe({get:()=>c.value,set:he=>{c.value=he,S.fallbackLocale=c.value,R(c.value)}}),O=Fe(()=>l.value),W=Fe(()=>h.value),V=Fe(()=>u.value);function Y(){return Kt(b)?b:null}function L(he){b=he,S.postTranslation=he}function N(){return g}function F(he){he!==null&&(v=kb(he)),g=he,S.missing=v}const D=(he,ge,We,Le,Ce,Ze)=>{M();let Ee;try{__INTLIFY_PROD_DEVTOOLS__,Ee=A(()=>he(S))}finally{__INTLIFY_PROD_DEVTOOLS__}if(We!=="translate exists"&&xi(Ee)&&Ee===ud||We==="translate exists"&&!Ee){const[vi,lt]=ge();return e&&m?Le(e):Ce(vi)}else{if(Ze(Ee))return Ee;throw dn(sn.UNEXPECTED_RETURN_TYPE)}};function X(...he){return D(ge=>Reflect.apply(Mb,null,[ge,...he]),()=>Ep(...he),"translate",ge=>Reflect.apply(ge.t,ge,[...he]),ge=>ge,ge=>Ge(ge))}function G(...he){const[ge,We,Le]=he;if(Le&&!Et(Le))throw dn(sn.INVALID_ARGUMENT);return X(ge,We,gi({resolvedMessage:!0},Le||{}))}function K(...he){return D(ge=>Reflect.apply(Sb,null,[ge,...he]),()=>_p(...he),"datetime format",ge=>Reflect.apply(ge.d,ge,[...he]),()=>hu,ge=>Ge(ge)||Jt(ge))}function J(...he){return D(ge=>Reflect.apply(Tb,null,[ge,...he]),()=>Tp(...he),"number format",ge=>Reflect.apply(ge.n,ge,[...he]),()=>hu,ge=>Ge(ge)||Jt(ge))}function oe(he){return he.map(ge=>Ge(ge)||xi(ge)||Rt(ge)?Ab(String(ge)):ge)}const ve={normalize:oe,interpolate:he=>he,type:"vnode"};function Se(...he){return D(ge=>{let We;const Le=ge;try{Le.processor=ve,We=Reflect.apply(Mb,null,[Le,...he])}finally{Le.processor=null}return We},()=>Ep(...he),"translate",ge=>ge[Cp](...he),ge=>[Ab(ge)],ge=>Jt(ge))}function fe(...he){return D(ge=>Reflect.apply(Tb,null,[ge,...he]),()=>Tp(...he),"number format",ge=>ge[Ap](...he),Pb,ge=>Ge(ge)||Jt(ge))}function ye(...he){return D(ge=>Reflect.apply(Sb,null,[ge,...he]),()=>_p(...he),"datetime format",ge=>ge[Mp](...he),Pb,ge=>Ge(ge)||Jt(ge))}function q(he){E=he,S.pluralRules=E}function Z(he,ge){const We=$(he),Le=S.messageResolver(We,ge);return Le===null?Pi(We,ge):Le}function se(he,ge){return D(()=>{if(!he)return!1;const We=Ge(ge)?ge:a.value,Le=Ge(ge)?[We]:S.localeFallbacker(S,c.value,We);for(let Ce=0;Ce[he],"translate exists",We=>Reflect.apply(We.te,We,[he,ge]),aO,We=>Rt(We))}function H(he){let ge=null;const We=S.localeFallbacker(S,c.value,a.value);for(let Le=0;LeR(c.value),{deep:!0,flush:"sync"}),e&&cu&&(ei(e.locale,he=>{o&&(a.value=he,S.locale=he,lh(S,a.value,c.value))}),ei(e.fallbackLocale,he=>{o&&(c.value=he,S.fallbackLocale=c.value,lh(S,a.value,c.value))}));const Be={id:Rb,locale:P,fallbackLocale:B,get inheritLocale(){return o},set inheritLocale(he){o=he,he&&e&&(P.value=e.locale.value,B.value=e.fallbackLocale.value)},get availableLocales(){return Object.keys(l.value).sort()},messages:O,get modifiers(){return _},get pluralRules(){return E||{}},get isGlobal(){return i},get missingWarn(){return d},set missingWarn(he){d=he,S.missingWarn=d},get fallbackWarn(){return f},set fallbackWarn(he){f=he,S.fallbackWarn=f},get fallbackRoot(){return m},set fallbackRoot(he){m=he},get fallbackFormat(){return p},set fallbackFormat(he){p=he,S.fallbackFormat=p},get warnHtmlMessage(){return y},set warnHtmlMessage(he){y=he,S.warnHtmlMessage=he},get escapeParameter(){return x},set escapeParameter(he){x=he,S.escapeParameter=he},t:X,getLocaleMessage:$,setLocaleMessage:U,mergeLocaleMessage:z,getPostTranslationHandler:Y,setPostTranslationHandler:L,getMissingHandler:N,setMissingHandler:F,[o_]:q};return Be.datetimeFormats=W,Be.numberFormats=V,Be.rt=G,Be.te=se,Be.tm=j,Be.d=K,Be.n=J,Be.getDateTimeFormat=ee,Be.setDateTimeFormat=ne,Be.mergeDateTimeFormat=ue,Be.getNumberFormat=xe,Be.setNumberFormat=be,Be.mergeNumberFormat=Ne,Be[a_]=t,Be[Cp]=Se,Be[Mp]=ye,Be[Ap]=fe,Be}function cO(n){const e=Ge(n.locale)?n.locale:sc,t=Ge(n.fallbackLocale)||Jt(n.fallbackLocale)||Yt(n.fallbackLocale)||n.fallbackLocale===!1?n.fallbackLocale:e,i=Kt(n.missing)?n.missing:void 0,s=Rt(n.silentTranslationWarn)||Ya(n.silentTranslationWarn)?!n.silentTranslationWarn:!0,r=Rt(n.silentFallbackWarn)||Ya(n.silentFallbackWarn)?!n.silentFallbackWarn:!0,o=Rt(n.fallbackRoot)?n.fallbackRoot:!0,a=!!n.formatFallbackMessages,c=Yt(n.modifiers)?n.modifiers:{},l=n.pluralizationRules,h=Kt(n.postTranslation)?n.postTranslation:void 0,u=Ge(n.warnHtmlInMessage)?n.warnHtmlInMessage!=="off":!0,d=!!n.escapeParameterHtml,f=Rt(n.sync)?n.sync:!0;let m=n.messages;if(Yt(n.sharedMessages)){const _=n.sharedMessages;m=Object.keys(_).reduce((S,C)=>{if(Fr(C))return S;const M=Pi(S,C)||(S[C]={});return gi(M,_[C]),S},m||{})}const{__i18n:p,__root:g,__injectWithOption:v}=n,b=n.datetimeFormats,y=n.numberFormats,x=n.flatJson;return{locale:e,fallbackLocale:t,messages:m,flatJson:x,datetimeFormats:b,numberFormats:y,missing:i,missingWarn:s,fallbackWarn:r,fallbackRoot:o,fallbackFormat:a,modifiers:c,pluralRules:l,postTranslation:h,warnHtmlMessage:u,escapeParameter:d,messageResolver:n.messageResolver,inheritLocale:f,__i18n:p,__root:g,__injectWithOption:v}}function Ip(n={}){const e=du(cO(n)),{__extender:t}=n,i={id:e.id,get locale(){return e.locale.value},set locale(s){e.locale.value=s},get fallbackLocale(){return e.fallbackLocale.value},set fallbackLocale(s){e.fallbackLocale.value=s},get messages(){return e.messages.value},get datetimeFormats(){return e.datetimeFormats.value},get numberFormats(){return e.numberFormats.value},get availableLocales(){return e.availableLocales},get missing(){return e.getMissingHandler()},set missing(s){e.setMissingHandler(s)},get silentTranslationWarn(){return Rt(e.missingWarn)?!e.missingWarn:e.missingWarn},set silentTranslationWarn(s){e.missingWarn=Rt(s)?!s:s},get silentFallbackWarn(){return Rt(e.fallbackWarn)?!e.fallbackWarn:e.fallbackWarn},set silentFallbackWarn(s){e.fallbackWarn=Rt(s)?!s:s},get modifiers(){return e.modifiers},get formatFallbackMessages(){return e.fallbackFormat},set formatFallbackMessages(s){e.fallbackFormat=s},get postTranslation(){return e.getPostTranslationHandler()},set postTranslation(s){e.setPostTranslationHandler(s)},get sync(){return e.inheritLocale},set sync(s){e.inheritLocale=s},get warnHtmlInMessage(){return e.warnHtmlMessage?"warn":"off"},set warnHtmlInMessage(s){e.warnHtmlMessage=s!=="off"},get escapeParameterHtml(){return e.escapeParameter},set escapeParameterHtml(s){e.escapeParameter=s},get pluralizationRules(){return e.pluralRules||{}},__composer:e,t(...s){return Reflect.apply(e.t,e,[...s])},rt(...s){return Reflect.apply(e.rt,e,[...s])},te(s,r){return e.te(s,r)},tm(s){return e.tm(s)},getLocaleMessage(s){return e.getLocaleMessage(s)},setLocaleMessage(s,r){e.setLocaleMessage(s,r)},mergeLocaleMessage(s,r){e.mergeLocaleMessage(s,r)},d(...s){return Reflect.apply(e.d,e,[...s])},getDateTimeFormat(s){return e.getDateTimeFormat(s)},setDateTimeFormat(s,r){e.setDateTimeFormat(s,r)},mergeDateTimeFormat(s,r){e.mergeDateTimeFormat(s,r)},n(...s){return Reflect.apply(e.n,e,[...s])},getNumberFormat(s){return e.getNumberFormat(s)},setNumberFormat(s,r){e.setNumberFormat(s,r)},mergeNumberFormat(s,r){e.mergeNumberFormat(s,r)}};return i.__extender=t,i}function hO(n,e,t){return{beforeCreate(){const i=oc();if(!i)throw dn(sn.UNEXPECTED_ERROR);const s=this.$options;if(s.i18n){const r=gi({},s.i18n);if(s.__i18n&&(r.__i18n=s.__i18n),r.__root=e,this===this.$root)this.$i18n=Fb(n,r);else{r.__injectWithOption=!0,r.__extender=t.__vueI18nExtend,this.$i18n=Ip(r);const o=this.$i18n;o.__extender&&(o.__disposer=o.__extender(this.$i18n))}}else if(s.__i18n)if(this===this.$root)this.$i18n=Fb(n,s);else{this.$i18n=Ip({__i18n:s.__i18n,__injectWithOption:!0,__extender:t.__vueI18nExtend,__root:e});const r=this.$i18n;r.__extender&&(r.__disposer=r.__extender(this.$i18n))}else this.$i18n=n;s.__i18nGlobal&&h_(e,s,s),this.$t=(...r)=>this.$i18n.t(...r),this.$rt=(...r)=>this.$i18n.rt(...r),this.$te=(r,o)=>this.$i18n.te(r,o),this.$d=(...r)=>this.$i18n.d(...r),this.$n=(...r)=>this.$i18n.n(...r),this.$tm=r=>this.$i18n.tm(r),t.__setInstance(i,this.$i18n)},mounted(){},unmounted(){const i=oc();if(!i)throw dn(sn.UNEXPECTED_ERROR);const s=this.$i18n;s&&(delete this.$t,delete this.$rt,delete this.$te,delete this.$d,delete this.$n,delete this.$tm,s!=null&&s.__disposer&&(s.__disposer(),delete s.__disposer,delete s.__extender),t.__deleteInstance(i),delete this.$i18n)}}}function Fb(n,e){n.locale=e.locale||n.locale,n.fallbackLocale=e.fallbackLocale||n.fallbackLocale,n.missing=e.missing||n.missing,n.silentTranslationWarn=e.silentTranslationWarn||n.silentFallbackWarn,n.silentFallbackWarn=e.silentFallbackWarn||n.silentFallbackWarn,n.formatFallbackMessages=e.formatFallbackMessages||n.formatFallbackMessages,n.postTranslation=e.postTranslation||n.postTranslation,n.warnHtmlInMessage=e.warnHtmlInMessage||n.warnHtmlInMessage,n.escapeParameterHtml=e.escapeParameterHtml||n.escapeParameterHtml,n.sync=e.sync||n.sync,n.__composer[o_](e.pluralizationRules||n.pluralizationRules);const t=Yg(n.locale,{messages:e.messages,__i18n:e.__i18n});return Object.keys(t).forEach(i=>n.mergeLocaleMessage(i,t[i])),e.datetimeFormats&&Object.keys(e.datetimeFormats).forEach(i=>n.mergeDateTimeFormat(i,e.datetimeFormats[i])),e.numberFormats&&Object.keys(e.numberFormats).forEach(i=>n.mergeNumberFormat(i,e.numberFormats[i])),n}const Gg={tag:{type:[String,Object]},locale:{type:String},scope:{type:String,validator:n=>n==="parent"||n==="global",default:"parent"},i18n:{type:Object}};function uO({slots:n},e){return e.length===1&&e[0]==="default"?(n.default?n.default():[]).reduce((i,s)=>[...i,...s.type===Me?s.children:[s]],[]):e.reduce((t,i)=>{const s=n[i];return s&&(t[i]=s()),t},Dt())}function u_(){return Me}const dO=qt({name:"i18n-t",props:gi({keypath:{type:String,required:!0},plural:{type:[Number,String],validator:n=>xi(n)||!isNaN(n)}},Gg),setup(n,e){const{slots:t,attrs:i}=e,s=n.i18n||fn({useScope:n.scope,__useComponent:!0});return()=>{const r=()=>{const c=Object.keys(t).filter(u=>u[0]!=="_"),l=Dt();n.locale&&(l.locale=n.locale),n.plural!==void 0&&(l.plural=Ge(n.plural)?+n.plural:n.plural);const h=uO(e,c);return s[Cp](n.keypath,h,l)},o=gi(Dt(),i),a=Ge(n.tag)||Et(n.tag)?n.tag:u_();return Et(a)?ql(a,o,{default:r}):ql(a,o,r())}}}),Lb=dO;function fO(n){return Jt(n)&&!Ge(n[0])}function d_(n,e,t,i){const{slots:s,attrs:r}=e;return()=>{const o=()=>{const l={part:!0};let h=Dt();n.locale&&(l.locale=n.locale),Ge(n.format)?l.key=n.format:Et(n.format)&&(Ge(n.format.key)&&(l.key=n.format.key),h=Object.keys(n.format).reduce((f,m)=>t.includes(m)?gi(Dt(),f,{[m]:n.format[m]}):f,Dt()));const u=i(n.value,l,h);let d=[l.key];return Jt(u)?d=u.map((f,m)=>{const p=s[f.type],g=p?p({[f.type]:f.value,index:m,parts:u}):[f.value];return fO(g)&&(g[0].key=`${f.type}-${m}`),g}):Ge(u)&&(d=[u]),d},a=gi(Dt(),r),c=Ge(n.tag)||Et(n.tag)?n.tag:u_();return Et(c)?ql(c,a,{default:o}):ql(c,a,o())}}const mO=qt({name:"i18n-n",props:gi({value:{type:Number,required:!0},format:{type:[String,Object]}},Gg),setup(n,e){const t=n.i18n||fn({useScope:n.scope,__useComponent:!0});return d_(n,e,n_,(...i)=>t[Ap](...i))}}),Ob=mO;function pO(n,e){const t=n;if(n.mode==="composition")return t.__getInstance(e)||n.global;{const i=t.__getInstance(e);return i!=null?i.__composer:n.global.__composer}}function gO(n){const e=o=>{const{instance:a,value:c}=o;if(!a||!a.$)throw dn(sn.UNEXPECTED_ERROR);const l=pO(n,a.$),h=$b(c);return[Reflect.apply(l.t,l,[...Nb(h)]),l]};return{created:(o,a)=>{const[c,l]=e(a);cu&&(o.__i18nWatcher=ei(l.locale,()=>{a.instance&&a.instance.$forceUpdate()})),o.__composer=l,o.textContent=c},unmounted:o=>{cu&&o.__i18nWatcher&&(o.__i18nWatcher(),o.__i18nWatcher=void 0,delete o.__i18nWatcher),o.__composer&&(o.__composer=void 0,delete o.__composer)},beforeUpdate:(o,{value:a})=>{if(o.__composer){const c=o.__composer,l=$b(a);o.textContent=Reflect.apply(c.t,c,[...Nb(l)])}},getSSRProps:o=>{const[a]=e(o);return{textContent:a}}}}function $b(n){if(Ge(n))return{path:n};if(Yt(n)){if(!("path"in n))throw dn(sn.REQUIRED_VALUE,"path");return n}else throw dn(sn.INVALID_VALUE)}function Nb(n){const{path:e,locale:t,args:i,choice:s,plural:r}=n,o={},a=i||{};return Ge(t)&&(o.locale=t),xi(s)&&(o.plural=s),xi(r)&&(o.plural=r),[e,a,o]}function vO(n,e,...t){const i=Yt(t[0])?t[0]:{};(Rt(i.globalInstall)?i.globalInstall:!0)&&([Lb.name,"I18nT"].forEach(r=>n.component(r,Lb)),[Ob.name,"I18nN"].forEach(r=>n.component(r,Ob)),[Ub.name,"I18nD"].forEach(r=>n.component(r,Ub))),n.directive("t",gO(e))}const yO=io("global-vue-i18n");function bO(n={}){const e=__VUE_I18N_LEGACY_API__&&Rt(n.legacy)?n.legacy:__VUE_I18N_LEGACY_API__,t=Rt(n.globalInjection)?n.globalInjection:!0,i=new Map,[s,r]=xO(n,e),o=io("");function a(u){return i.get(u)||null}function c(u,d){i.set(u,d)}function l(u){i.delete(u)}const h={get mode(){return __VUE_I18N_LEGACY_API__&&e?"legacy":"composition"},async install(u,...d){if(u.__VUE_I18N_SYMBOL__=o,u.provide(u.__VUE_I18N_SYMBOL__,h),Yt(d[0])){const p=d[0];h.__composerExtend=p.__composerExtend,h.__vueI18nExtend=p.__vueI18nExtend}let f=null;!e&&t&&(f=MO(u,h.global)),__VUE_I18N_FULL_INSTALL__&&vO(u,h,...d),__VUE_I18N_LEGACY_API__&&e&&u.mixin(hO(r,r.__composer,h));const m=u.unmount;u.unmount=()=>{f&&f(),h.dispose(),m()}},get global(){return r},dispose(){s.stop()},__instances:i,__getInstance:a,__setInstance:c,__deleteInstance:l};return h}function fn(n={}){const e=oc();if(e==null)throw dn(sn.MUST_BE_CALL_SETUP_TOP);if(!e.isCE&&e.appContext.app!=null&&!e.appContext.app.__VUE_I18N_SYMBOL__)throw dn(sn.NOT_INSTALLED);const t=wO(e),i=_O(t),s=c_(e),r=SO(n,s);if(r==="global")return h_(i,n,s),i;if(r==="parent"){let c=Db(t,e,n.__useComponent);return c==null&&(c=i),c}if(r==="isolated"){if(t.mode!=="composition")throw dn(sn.NOT_AVAILABLE_COMPOSITION_IN_LEGACY);const c=t,l=gi({},n),h=Db(t,e);l.__root=h||i;const u=du(l);return c.__composerExtend&&(u[wa]=c.__composerExtend(u)),lg()&&U1(()=>{const f=u[wa];f&&(f(),delete u[wa])}),u}const o=t;let a=o.__getInstance(e);if(a==null){const c=gi({},n);"__i18n"in s&&(c.__i18n=s.__i18n),i&&(c.__root=i),a=du(c),o.__composerExtend&&(a[wa]=o.__composerExtend(a)),EO(o,e,a),o.__setInstance(e,a)}return a}function xO(n,e){const t=ag(),i=__VUE_I18N_LEGACY_API__&&e?t.run(()=>Ip(n)):t.run(()=>du(n));if(i==null)throw dn(sn.UNEXPECTED_ERROR);return[t,i]}function wO(n){const e=ko(n.isCE?yO:n.appContext.app.__VUE_I18N_SYMBOL__);if(!e)throw dn(n.isCE?sn.NOT_INSTALLED_WITH_PROVIDE:sn.UNEXPECTED_ERROR);return e}function SO(n,e){return $g(n)?"__i18n"in e?"local":"global":n.useScope?n.useScope:"local"}function _O(n){return n.mode==="composition"?n.global:n.global.__composer}function Db(n,e,t=!1){let i=null;const s=e.root;let r=TO(e,t);for(;r!=null;){const o=n;if(n.mode==="composition")i=o.__getInstance(r);else if(__VUE_I18N_LEGACY_API__){const a=o.__getInstance(r);a!=null&&(i=a.__composer,t&&i&&!i[a_]&&(i=null))}if(i!=null||s===r)break;r=r.parent}return i}function TO(n,e=!1){return n==null?null:e&&n.vnode.ctx||n.parent}function EO(n,e,t){Sn(()=>{},e),Za(()=>{const i=t;n.__deleteInstance(e);const s=i[wa];s&&(s(),delete i[wa])},e)}const CO=["locale","fallbackLocale","availableLocales"],Bb=["t","rt","d","n","tm","te"];function MO(n,e){const t=Object.create(null);return CO.forEach(s=>{const r=Object.getOwnPropertyDescriptor(e,s);if(!r)throw dn(sn.UNEXPECTED_ERROR);const o=Qt(r.value)?{get(){return r.value.value},set(a){r.value.value=a}}:{get(){return r.get&&r.get()}};Object.defineProperty(t,s,o)}),n.config.globalProperties.$i18n=t,Bb.forEach(s=>{const r=Object.getOwnPropertyDescriptor(e,s);if(!r||!r.value)throw dn(sn.UNEXPECTED_ERROR);Object.defineProperty(n.config.globalProperties,`$${s}`,r)}),()=>{delete n.config.globalProperties.$i18n,Bb.forEach(s=>{delete n.config.globalProperties[`$${s}`]})}}const AO=qt({name:"i18n-d",props:gi({value:{type:[Number,Date],required:!0},format:{type:[String,Object]}},Gg),setup(n,e){const t=n.i18n||fn({useScope:n.scope,__useComponent:!0});return d_(n,e,i_,(...i)=>t[Mp](...i))}}),Ub=AO;oO();BL(bL);UL($L);VL(CL);if(__INTLIFY_PROD_DEVTOOLS__){const n=Gr();n.__INTLIFY__=!0,xL(n.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__)}const IO={title:"Spine Particle Editor - Yeomai",resizeTimeline:"Drag to resize the timeline",systems:"Systems",particlesBones:"Particles (bones)",rootBone:"Root bone",hudTip:"Scroll to zoom · Drag with left mouse to pan"},PO={label:"Language",zhCN:"中文",en:"English"},RO={close:"Close",reset:"Reset",add:"Add",remove:"Remove",delete:"Delete",clear:"Clear",cancel:"Cancel",confirm:"Confirm",none:"None",enabled:"Enabled",disabled:"Disabled",fixed:"Fixed",random:"Random",curve:"Curve",followExport:"Follow export",linear:"Linear",bezier:"Bézier",above:"Above",below:"Below",left:"Left",right:"Right",seconds:"s",frames:"f"},kO={settings:"Settings",undo:"Undo (Ctrl+Z)",pan:"Pan canvas (Q)",translate:"Move (W)",rotate:"Rotate (E)",scale:"Scale (R)",zoomIn:"Zoom in",zoomOut:"Zoom out",fitView:"Fit canvas",toggleGrid:"Toggle grid",resetView:"Reset view",background:"Background",backgroundSettings:"Background settings",changeBackground:"Replace image",uploadBackground:"Upload image",clearBackground:"Clear background",noBackground:"No image",backgroundX:"Background X offset",backgroundY:"Background Y offset",backgroundOpacity:"Background opacity",opacity:"Opacity",help:"Help",openHelp:"Open help"},FO={title:"Settings",layout:"Layout",parameterPanelPosition:"Parameter panel position",panelOnRight:"Show parameter panel on the right",history:"History",maxUndo:"Maximum undo steps",canvasGuides:"Canvas guides",emitter:"Emitter point",bones:"Bone links",bonePointSize:"Bone point size",boneAxisSize:"Axis size",skinMesh:"Skin mesh",enableTicks:"Show ticks",tickFontSize:"Tick text size",tickWidth:"Tick line width",axisColor:"Axis color",showAxisLabels:"Show tick values",cacheNote:"Settings are saved automatically in this browser"},LO={title:"Configuration",save:"Save Config",saveTitle:"Save the complete editor configuration (Ctrl+S)",load:"Load Config",loadTitle:"Load an editor configuration file",presets:"Preset list",selectPreset:"Select preset",noPresets:"No presets",saved:"Configuration saved locally",loading:"Loading configuration…",loaded:"Loaded: {name}",presetLoading:"Loading preset…",presetLoaded:"Preset loaded: {name}",presetNamingError:"{message}. Check the preset file name.",presetTransferTitle:"Load Preset",presetDownloading:"Downloading {file}…",presetParsing:"Parsing preset configuration…",presetRestoring:"Parsing and restoring preset resources…",presetComplete:"Preset loaded",presetListError:"Unable to read preset list",presetReadError:"Unable to read preset: {file}"},OO={particleSweep:"1. Particle Sweep",barBlocks:"2. Bar Blocks",forceTrail:"3. Force Field Trail",lightningSequence:"4. Lightning Sequence",texturePivot:"5. Texture Pivot",subEmitter:"6. Sub-emitter"},$O={bezierHint:"Drag square handles · Double-click empty space to add · Double-click a node to delete",linearHint:"Double-click empty space to add · Double-click a node to delete · Drag nodes to adjust",resetTitle:"Restore default curve"},NO={addTitle:"Double-click the color bar to add a stop",color:"Stop color",colorValue:"Stop color value",position:"Stop position",addMiddle:"Add color in the middle",delete:"Delete selected stop",hint:"Double-click to add · Drag a stop to move · Double-click a stop to delete"},DO={angleOffset:"Angle offset",value:"Value",lower:"Min",upper:"Max",rangeLower:"Range min",rangeUpper:"Range max",curveInput:"Curve input →",direction:"Emission direction"},BO={title:"Texture Pivot",zoomOut:"Zoom out",zoomIn:"Zoom in",expand:"Open full-screen pivot editor",interaction:"Click/drag to set pivot · Right-drag to pan · Scroll to zoom",previewAlt:"Pivot preview",noImage:"No image selected",resetCenter:"Center (50%, 50%)",coordinates:"Pivot coordinates (%)",rotationTest:"Pivot rotation test",static:"Static",spin:"Spin",swing:"Swing",rotationAlt:"Rotation test",topLeft:"Top left",top:"Top",topRight:"Top right",left:"Left",center:"Center",right:"Right",bottomLeft:"Bottom left",bottom:"Bottom",bottomRight:"Bottom right"},UO={chooseSequence:"Choose sequence images",chooseLocal:"Choose local image",subfolder:"Subfolder",name:"Name",restore:"Restore {name}",deleteResource:"Delete image resource",imageMode:"Image mode",fixed:"Single image",sequence:"Sequence",playbackMode:"Playback",onceHide:"Once, hide at end",onceHold:"Once, hold last frame",loopForward:"Loop forward",loopReverse:"Loop reverse",playbackFps:"Playback FPS",chooseSequenceMulti:"Choose sequence images (multiple)",weight:"Weight %",unlockWeight:"Unlock weight",lockWeight:"Lock current weight",pivot:"Texture Pivot",collapsePivot:"Collapse pivot editor",expandPivot:"Expand pivot editor",pivotModal:"Full-screen texture pivot editor",pivotModalDesc:"Click or drag on the texture to set the exact particle rotation center",pivotZoomHint:"Zoom from 100% to 400% to align tips or roots precisely:",confirmPivot:"Apply and save pivot",noSequence:"No sequence selected",firstFrame:"Frame 1",firstImage:"first image",lastImage:"last image",pivotOn:"Enabled: X {x}% | Y {y}%",pivotOff:"Disabled, using image center (50%, 50%)",pivotCustom:"Custom pivot: X {x}% | Y {y}%",frameCountOne:"1 frame · {name}",frameCountMany:"{count} frames · {first} → {last}",sequenceSelected:"{count} frames selected, playing {first} to {last}"},VO={play:"Play (D)",pause:"Pause (D)",toStart:"Go to first frame (S)",previous:"Previous frame",next:"Next frame",toEnd:"Go to last frame",continuousLoop:"Continuous loop playback",abLoop:"Independent A/B range loop",abLoopShort:"AB Loop",abRange:"A/B loop range",playbackStart:"Custom playback start frame",playbackEnd:"Custom playback end frame",startFrame:"Playback start frame",endFrame:"Playback end frame",frame:"Frame",emission:"Emitting",particleLife:"Particles alive",spineAnimation:"Spine animation",ownerAnimation:"Owner animation",setOwnerAnimation:"Set the animation that owns this particle system",chooseOwnerAnimation:"Choose owner animation",animationName:"Animation name",renameAnimation:"Rename current animation",rename:"Rename",newAnimation:"+ New",keepOneAnimation:"At least one animation is required",spinePreview:"Spine preview animation",noSpineAnimation:"No Spine animation available",none:"None",systemName:"System {index}",dragLoopDuration:"Drag to change loop duration",dragEmissionDuration:"Drag to change emission duration",dragSpineStart:"Drag to change animation start time",noAnimationData:"No animation data",animationNameEmpty:"Animation name cannot be empty",animationNameDuplicate:"Animation name already exists",animationRenameFailed:"Unable to rename animation",zoomIn:"Zoom in",zoomOut:"Zoom out",zoomFit:"Fit",frameStatus:"Frame {current} / {total}"},XO={title:"Emission",reset:"Reset emission settings",stream:"Stream",burst:"Burst",normalStream:"Standard stream",loopStream:"Loop stream",rate:"Emission rate",duration:"Emission duration",loopDuration:"Emission duration (f)",generateStart:"Generate loop start animation",generateEnd:"Generate loop end animation",customDuration:"Custom duration",auto:"Auto {frames}f",startLoopDuration:"Loop start duration",endLoopDuration:"Loop end duration",loopWarning:"Bone and path following are unavailable in loop stream mode and will be reset when entering or leaving it.",burstCount:"Burst count",delay:"Delay",shapeTitle:"Emitter Shape",shapeReset:"Reset emitter shape settings",shape:"Shape",point:"Point",circle:"Circle",rect:"Rectangle",cone:"Cone",path:"Path",innerDiameter:"Inner diameter",outerDiameter:"Outer diameter",innerRadius:"Inner radius",outerRadius:"Outer radius",coneDirection:"Cone direction",coneAngle:"Cone opening angle",innerWidth:"Inner width",innerHeight:"Inner height",outerWidth:"Outer width",outerHeight:"Outer height",selectPath:"Spawn path",noPath:"No path (point emission)",birthDistribution:"Birth distribution",evenDistribution:"Even spacing",randomDistribution:"Random",emissionAngle:"Emission angle",radial:"Radial (outward)",pathNormal:"Path normal",pathTangent:"Path tangent",fixedAngle:"Fixed angle",baseAngle:"Base angle",randomRange:"Random range",showShape:"Show shape"},YO={title:"Particle Attributes",reset:"Reset particle attribute settings",initialParams:"Initial particle values",initialLife:"Initial life",randomSample:"Random sample →",initialSpeed:"Initial speed",initialScale:"Initial scale",uniform:"Uniform",separateXY:"Separate XY",scaleX:"Scale X",scaleY:"Scale Y",initialRotation:"Initial rotation",lifecycleTitle:"Values over particle life",speedOverLife:"Speed over life",speedMultiplier:"Speed multiplier",lifeTo:"Lifetime →",scaleOverLife:"Scale over life",scaleMultiplier:"Scale multiplier",multiplierX:"Multiplier X",multiplierY:"Multiplier Y",rotationOverLife:"Rotation over life",rotationSpeed:"Rotation speed"},GO={title:"Appearance & Resources",reset:"Reset appearance and resource settings",opacity:"Opacity",curveMode:"Curve mode",transparent:"0 (transparent)",opaque:"1 (opaque)",renderLayer:"Render layer (Spine slot)",top:"Topmost",spineSlot:"Spine slot",selectSpine:"Select Spine",noSpine:"No Spine available",noSlot:"No slot selected",reselect:"Reselect",selectSlot:"Select slot",searchSlots:"Search slots or attachments…",searchSlotsAria:"Search slots",emptySlot:"Empty slot",noMatchingSlots:"No matching slots",above:"Above slot image",below:"Below slot image",followAttachment:"Follow attachment visibility",previewOnly:"Render layer changes only affect the editor preview and are not exported.",imageResources:"Image Resources",addImage:"Add image resource",scale:"Scale",color:"Color",fixedColor:"Fixed color",randomColor:"Random color",lifetime:"Over lifetime",normal:"Normal",add:"Add",multiply:"Multiply",screen:"Screen",fixedColorValue:"Fixed color value",randomColorHint:"Each particle samples a color from the gradient at birth and keeps it for its lifetime",independentAlpha:"Independent opacity",off:"Off"},HO={slotLabelAbove:"{spine} / {slot} · above image",slotLabelBelow:"{spine} / {slot} · below image",resolvedAbove:"Render above {slot} and below the following slot",resolvedBetween:"Render between {previous} and {slot}",warningNoSpine:"No loaded Spine resource. Particles are temporarily rendered on top.",warningNoSelection:"No Spine selected. Particles are temporarily rendered on top.",warningMissingSpine:"The target Spine no longer exists. Particles are temporarily rendered on top.",warningNotReady:"The target Spine is not ready. Particles are temporarily rendered on top.",warningMissingSlot:"The target slot no longer exists. Particles are temporarily rendered on top.",warningFirstSlot:"This is the first slot, so particles cannot render below it and are temporarily shown on top."},jO={completed:"Completed",failed:"Operation failed"},WO={title:"Scene Objects",addParticle:"Add particle system",addParticleShort:"+ Particle",addCollider:"Add collider",addColliderShort:"+ Collider",addPath:"Add path",addPathShort:"+ Path",addSpine:"Add Spine",copyTitle:"Duplicate selected scene object",showParticle:"Show particle system",hideParticle:"Hide particle system",showCollider:"Show collider",hideCollider:"Hide collider",showPath:"Show path",hidePath:"Hide path",showSpine:"Show Spine",hideSpine:"Hide Spine",particle:"Particle",subEmitter:"Sub-emitter",collision:"Collision",path:"Path",deleteParticle:"Delete particle system",deleteCollider:"Delete collider",deletePath:"Delete path",deleteSpine:"Delete Spine",empty:"No scene objects",name:"Name",positionX:"Position X",positionY:"Position Y",offsetX:"Offset X",offsetY:"Offset Y",rotation:"Rotation",scaleX:"Scale X",scaleY:"Scale Y",seed:"Random seed",seedTitle:"Controls random attributes, resource selection, and modifier sampling",randomizeSeed:"Generate a new global random seed",seedHint:"Controls initial random values, resource selection, and modifier sampling. The same seed reproduces the same result.",colliderTitle:"Collider Properties",colliderName:"Collider name",type:"Type",circle:"Circle",ellipse:"Ellipse",rect:"Rectangle",polygon:"Polygon",custom:"Custom",enabled:"Enabled",xPosition:"X position",yPosition:"Y position",scaleXShort:"Scale X",scaleYShort:"Scale Y",radius:"Radius",radiusX:"X radius",radiusY:"Y radius",width:"Width",height:"Height",sides:"Sides",collisionResponse:"Collision response",physics:"Physics (bounce / friction)",pause:"Pause in place",destroy:"Destroy immediately",elasticity:"Elasticity (0-1)",friction:"Friction (0-1)",followPath:"Follow a path",targetPath:"Target path",notSelected:"(Not selected)",moveDuration:"Move duration (s)",followDirection:"Orient along path",moveProgressCurve:"Movement progress curve",moveProgressHelp:"X: elapsed / duration · Y: path progress (0 = start, 1 = end)",pathTitle:"Path Properties",pathName:"Path name",closedPath:"Closed path",pathColor:"Path color",pathHelp:"Controls:",pathHelpItems:["Double-click empty space or a curve to add an anchor","Double-click an anchor to delete it","Double-click, hold on the second click, and drag to create handles","Drag anchors to move them and handles to reshape the curve","Shift + handle drag: symmetric handles","Alt + handle drag: independent handles","Ctrl + click / box select: add nodes","Alt + click / box select: remove nodes","Alt + click empty space: clear selection","Move multiple selected anchors together"],applyPresetShape:"Apply preset shape",choosePreset:"Choose preset…",square:"Square",star:"Star",applyPreset:"Apply preset",clearAnchors:"Clear anchors",panelHint:"Use the buttons above to create a scene object"},zO={title:"Modifiers",reset:"Reset modifiers",damping:"Damping",enableNoise:"Enable movement noise",strength:"Strength",noiseRange:"Wander range",noiseSpeed:"Time speed",noiseHint:"Strength controls influence · Wander range controls maximum offset · Time speed controls variation rate",enableGravity:"Enable gravity",gravityStrength:"Gravity strength",strengthMin:"Strength min",strengthMax:"Strength max",direction:"Direction",gravityOverLife:"Gravity over lifetime",windOverLife:"Wind over lifetime",axisStrength:"Y: strength 0–1",directionHint:"0° right · -90° down · Negative strength reverses direction",enableWind:"Enable wind",windStrength:"Wind strength",enableForceField:"Enable force field",centerX:"Center X",centerY:"Center Y",forceStrength:"Force strength",forceRadius:"Force radius",falloffMode:"Falloff",constant:"Constant",linearFalloff:"Linear (zero at edge)",inverseFalloff:"Inverse distance (strongest at center)",forceHint:"Positive attracts · Negative repels · Drag the force circle on the canvas",showShape:"Show shape",enableVortex:"Enable vortex",vortexHint:"Positive counter-clockwise · Negative clockwise",enableAttraction:"Enable attraction",attractionX:"Attraction point X",attractionY:"Attraction point Y",attractionRadius:"Arrival radius",attractionDuration:"Attraction duration",delay:"Delay",delayMode:"Delay mode",globalTime:"Global time",particleLife:"Per particle life",attractionPath:"Attraction path",straight:"Straight",attractionHint:"Starts attraction after the delay · Dies on reaching the red radius · Drag the attraction circle on the canvas",enableTrail:"Enable trail",trailImages:"Trail Images",addTrailImage:"Add trail image resource",trailRotation:"Rotation",trailBones:"Trail bones",trailRatio:"Trail ratio (%)",trailLength:"Trail length",randomRange:"Random range",lengthRatio:"Length ratio (%)",lengthMin:"Length min (%)",lengthMax:"Length max (%)",trailWidth:"Trail width",widthRatio:"Width ratio (%)",widthMin:"Width min (%)",widthMax:"Width max (%)",widthScale:"Width scale",followParticle:"Follow particle",lifeLengthCurve:"Length over lifetime",shapeCurve:"Shape curve (head to tail width)",colorMode:"Color mode",blendMode:"Blend mode",fixedColor:"Fixed color",alphaMode:"Opacity mode",opacity:"Opacity",gridRows:"Grid rows",gridCols:"Grid columns",trailHint:"Each particle creates a sibling trail bone group according to the resource ratio. Random length and width are fixed at birth and reproducible with the same seed.",enableFollow:"Enable emitter following",followMode:"Follow mode",noFollow:"None",followPath:"Follow path",selectedBone:"Selected bone",emitterAngleMode:"Emitter angle mode",fixedAngle:"Fixed angle",followMoveDirection:"Follow movement direction",moveProgressCurve:"Movement progress curve (0→1)",moveDuration:"Move duration (s)",followSpace:"Follow space",localSpace:"Local space (move emitter)",worldSpace:"World space (move spawn point)",moveDirection:"Movement direction",forward:"Forward (start → end)",reverse:"Reverse (end → start)",followOffset:"Start offset (0-1)",followSpaceHint:"Local space moves the entire emitter. World space moves only the spawn point; existing particles stay in world position.",followTarget:"Follow target: ",noValidBone:"No valid bone is bound. Select a bone in the Spine hierarchy first.",rebind:"Rebind",bind:"Bind",selectedBoneLabel:"Selected bone: ",boneLocalSpace:"Local space (follow bone)",boneWorldSpace:"World space (keep particle position)",offsetX:"Position offset X",offsetY:"Position offset Y",rotationOffset:"Rotation offset",scaleOffsetX:"Scale offset X",scaleOffsetY:"Scale offset Y",boneFollowHint:"The emitter follows only the selected Spine bone position. Particle transforms use the particle system settings and offsets above.",enableCollision:"Enable collision",collisionObjects:"Collision objects",colliderDisabled:"{name} (disabled)",clearCollider:"Remove collider {name}",addCollider:"Add a scene collider",noAvailableColliders:"No colliders available",noCollidersSelected:"No collider selected. Current particles will not collide.",available:"Available",disabled:"Disabled",collisionHint:"Only enabled scene colliders added here participate in this particle system's collisions.",enableSubEmitter:"Enable sub-emitters",triggerTiming:"Choose trigger event",birth:"Birth",death:"Death",collision:"Collision",chooseTarget:"Choose target particle system",noTarget:"None (particle system)",deleteSubEmitter:"Delete this sub-emitter",probability:"Trigger probability",collisionLimit:"Collision trigger limit",inherit:"Inherit",colorInheritMode:"Color inheritance",add:"Add",replace:"Replace",addSubEmitter:"+ Add sub-emitter",inheritNone:"None (default)",inheritAll:"All attributes",inheritColor:"Color",inheritScale:"Size",inheritRotation:"Rotation",inheritLife:"Lifetime"},qO={title:"Spine Properties",name:"Spine name",xPosition:"X position",yPosition:"Y position",rotation:"Rotation",scaleX:"Scale X",scaleY:"Scale Y",startTime:"Start time",resources:"Spine Resources",chooseFolder:"Choose folder and load",folderHint:"Reads JSON / SKEL, Atlas, and all textures from the folder. Assets can still be replaced individually below.",choose:"Choose",chooseMultiple:"Choose multiple",loading:"Loading…",load:"↧ Load",clear:"Clear",supportNote:"Supports Spine 3.8 / 4.0 / 4.1 / 4.2 / 4.3 JSON · Runtime loaded on demand · Fully local",currentResource:"Current asset {version}",animations:"Spine Animations",noAnimations:"No animations available",timelineAnimation:"Timeline animation",no:"None",hierarchy:"Hierarchy",clearBoneTitle:"Click to clear bone selection",noBoneTitle:"No bone selected",clearBone:"Clear selected bone: {name}",currentBone:"Current bone: ",clearSlotTitle:"Click to clear slot selection",noSlotTitle:"No slot selected",clearSlot:"Clear selected slot: {name}",currentSlot:"Current slot: ",notSelected:"Not selected",expandAll:"Expand all",collapseAll:"Collapse all",bones:"Bones",slots:"Slots",notLoaded:"Spine not loaded",searchBones:"Search bones",searchBonesPlaceholder:"Search bone names…",clearSearch:"Clear search",clearBoneSearch:"Clear bone search",noMatchingBones:"No matching bones",expandChildren:"Expand child bones",collapseChildren:"Collapse child bones",notLoadedSlots:"Spine slots not loaded",searchSlots:"Search slots",searchSlotsPlaceholder:"Search slots or attachments…",clearSlotSearch:"Clear slot search",noMatchingSlots:"No matching slots",slotTitle:"{name} (bone: {bone}, attachment: {attachment})",empty:"Empty",textureSummary:"{count} textures: {names}",textureImages:"texture images",missingFolderAssets:"The selected folder is missing: {missing}",chooseAssets:"Select Spine data, Atlas, and all texture images"},KO={title:"Help",subtitle:"Quick start from creating particles to saving and exporting",close:"Close help",closeShort:"Close (Esc)",quickStart:"Quick Start",stepCreate:"Create objects: use + Particle / + Collider / + Path / + Spine in Scene Objects.",stepEdit:"Edit particles: select a particle system, then adjust Emission → Emitter Shape → Particle Attributes → Appearance & Resources → Modifiers.",stepPreview:"Preview: play, pause, step, or scrub on the timeline. Parameter changes are recalculated automatically.",stepExport:"Save and export: Save Config keeps the project; Export Spine JSON / images ZIP / .spine package produces the deliverable.",quickNote:"Reset beside each section restores that section's defaults. Settings are saved automatically in this browser.",commonOps:"Common Actions",eye:"Visibility",eyeDesc:"Show or hide an object independently. Hidden particle systems are not exported.",copyDesc:"Duplicate the selected object for parameter comparisons.",backgroundDesc:"Upload a reference image and adjust its position and opacity for canvas preview only.",settingsDesc:"Manage layout, canvas guides, tick display, and other editor settings.",undoDesc:"Ctrl+Z undoes one step. The maximum history size is configurable.",spineBoneDesc:"Search and select bones in the hierarchy for emitter following.",shortcuts:"Shortcuts",undoShortcut:"Undo",saveShortcut:"Save config",panShortcut:"Pan canvas",translateShortcut:"Move tool",rotateShortcut:"Rotate tool",scaleShortcut:"Scale tool",playShortcut:"Play / pause",startShortcut:"Go to first frame",shortcutNote:"Click the canvas before using Q / W / E / R. Single-key shortcuts are disabled while typing in inputs.",modules:"Module Guide",configTitle:"Configuration",saveConfigDesc:"Save all scene objects and parameters to a project JSON file. Ctrl+S is supported.",loadConfigDesc:"Load a local configuration and restore the complete project.",presetDesc:"Choose a preset from the dropdown. Open the dropdown to refresh the list.",configScope:"Scope",configScopeDesc:"The project includes objects and parameters. Interface settings are stored separately in the browser.",sceneTitle:"Scene Objects",particleDesc:"The core object. Set position, offset, rotation, scale, and random seed. The same seed reproduces the same result.",colliderDesc:"Circle, ellipse, rectangle, polygon, or custom shape with physics, pause, destroy, and path-following responses.",pathDesc:"Bézier path with anchors, handles, closing, color, and preset shapes.",spineDesc:"Load Spine data, Atlas, and textures; browse bones and slots, and use them for emitter following.",sceneCommonDesc:"Objects can be hidden and duplicated independently. Hidden particle systems are not exported.",emissionDesc:"Streaming, burst, delay, and three-part loop streaming with start, loop, and end sections.",burstDesc:"Emit a fixed number of particles once.",delayDesc:"Wait time before emission starts, shown at the left edge of the particle bar.",loopNote:"Loop streaming does not support bone or path following and resets those settings when enabled.",shapeDesc:"Point, circle, rectangle, cone, or path spawn areas. Circle/cone use inner and outer radii; rectangles use inner and outer dimensions.",angleDesc:"Fixed, random, radial, path normal, or path tangent.",initialDesc:"Life, speed, scale, and rotation support fixed, random, and curve modes. Rotation can follow emission direction.",overLifeDesc:"Speed, scale, and rotation can be controlled by lifetime curves.",alphaDesc:"Opacity can be fixed or curved. Curve mode can follow export, linear, or Bézier.",imageDesc:"Single images or sequence frames, weighted image selection, pivots, colors, blend modes, and independent opacity.",sequenceDesc:"Playback can hide after one pass, hold the last frame, loop forward, or loop in reverse.",noiseDesc:"Adds movement noise with strength, range, and speed controls.",gravityDesc:"Gravity, wind, and lifetime strength curves.",forceDesc:"Global force field, vortex, attraction, and collision.",trailDesc:"Independent trail resources with bones, length, width, shape, color, and opacity curves.",followDesc:"The emitter can follow a path or a Spine bone.",collisionDesc:"Choose scene colliders and particle collision response.",exportDesc:"Configure image path, Spine version, keyframe curves, FPS, frame alignment, bone pool, and empty animations.",exportButtonsDesc:"Export Spine JSON, an images ZIP, or a complete .spine project through the connector.",connectorTitle:"Spine Connector",connectorIntro:"The connector sends generated JSON and images to a locally installed and activated Spine editor and converts them into an editable .spine project.",prerequisite:"Requirements",prerequisiteDesc:"Install and activate Spine, then start the desktop connector.",download:"Download",webSide:"Website",webSideDesc:"When the connector reports ready, click Export .spine package.",authorization:"First authorization",authorizationDesc:"Approve the website origin once. The connector stores the local allowlist.",pathSetup:"Application path",pathSetupDesc:"The connector detects Spine automatically. Set the application path manually if detection fails.",downloadResult:"Output",downloadResultDesc:"The downloaded ZIP contains the .spine project and image folder.",version:"Version",versionDesc:"The connector matches Spine 3.8–4.3 from the JSON version.",security:"Security",securityDesc:"The connector listens only on the local machine and deletes temporary conversion files.",differenceTitle:"Config vs. export",differenceDesc:"Save Config preserves editable objects and parameters. Export Spine JSON includes only visible particle systems and bakes collisions, following, trails, and sub-emitters into editable animation data."},JO={confirmLoopFollowEnter:"Enabling loop stream disables particle following and resets its settings. Continue?",confirmLoopFollowExit:"Leaving loop stream disables particle following and resets its settings. Continue?",invalidJson:"The configuration file is not valid JSON",invalidConfigFormat:"This is not a SpineParticle editor configuration",unsupportedConfigVersion:"Unsupported configuration version: {version}",missingScene:"The configuration is missing complete scene data",missingEmbeddedSpine:"The configuration does not contain reusable Spine source assets",chooseJsonConfig:"Choose a .json configuration file",settingsInvalidJson:"The cached settings are not valid JSON",settingsFormat:"This is not a SpineParticle settings cache",settingsVersion:"Unsupported settings version: {version}",settingsMissing:"The settings cache is missing settings",noExportableImages:"The visible particle systems have no exportable images",invalidZipPath:"Invalid ZIP file path",spineFileType:"Spine data must be .json or .skel",atlasFileType:"Atlas files must use .atlas",chooseTexture:"Choose at least one texture image",binaryParseFailed:"Spine binary parsing failed (4.3: {v43}; legacy: {v42})",invalidSpineJson:"Invalid Spine JSON format",unsupportedSpineJsonVersion:"Unsupported Spine JSON version. Supported versions: {versions}",unsupportedSpineDataVersion:"Unsupported Spine data version. Supported versions: {versions}",embeddedReadFailed:"Unable to read embedded Spine file: {name}",missingImageWarning:"Image “{file}” is missing or has unreadable dimensions. Its path was kept.",missingTrailImageWarning:"Trail image “{file}” is missing. Its path was kept.",emptyCacheWarning:"“{name}” has no baked frame cache.",readExportImageFailed:"Unable to read export image: {name}",connectorOffline:"Local Spine connector was not detected. Start the connector first.",connectorHttpError:"Spine connector returned HTTP {status}",invalidTrailUV:"Trail mesh “{name}” has invalid UV data",missingTrailVertices:"Trail mesh “{name}” has no vertex data",trailIndexOutOfRange:"Trail mesh “{name}” has an out-of-range triangle index",invalidTrailHull:"Trail mesh “{name}” has an invalid hull size",trailHullIndexOutOfRange:"Trail mesh “{name}” has an out-of-range hull edge index",invalidInfluenceCount:"Trail mesh “{name}” has an invalid bone influence count",missingBoneReference:"Trail mesh “{name}” references a missing bone",invalidWeight:"Trail mesh “{name}” contains invalid weights",weightSum:"Trail mesh “{name}” vertex weights do not sum to 1",vertexCountMismatch:"Trail mesh “{name}” vertex count does not match its UV count",invalidInherit:"Bone “{name}” has inherit value “{inherit}” incompatible with Spine {version} JSON",trailBoneParent:"Trail bone “{name}” must be a direct child of the particle system bone, not a bone chain",trailSlotEmpty:"Weighted trail slot “{name}” cannot use an empty attachment. Hide the bones with zero scale instead.",spine38Version:"Spine 3.8 export must identify its version as 3.8",spine38Inherit:"Spine 3.8 bone “{name}” must use transform instead of inherit",spine38SlotColor:"Spine 3.8 slot color timelines must use color / twoColor",spine38AttachmentName:"Spine 3.8 hidden attachment frames must explicitly write name: null",spine38RotationAngle:"Spine 3.8 rotation timelines must use angle",spine38Curve:"Spine 3.8 does not support Spine 4.x array curves",unsupportedExportVersion:"Unsupported export version. Supported Spine versions: {versions}",exportVersionMismatch:"Export version mismatch: expected Spine {expected}, JSON reports Spine {actual}",exportMissingBones:"Export result contains no bones",missingAtlasTexture:"Atlas texture was not selected: {name}"},ZO={app:IO,language:PO,common:RO,toolbar:kO,settings:FO,config:LO,presets:OO,curve:$O,gradient:NO,attributeControl:DO,pivot:BO,image:UO,timeline:VO,emission:XO,attributes:YO,appearance:GO,renderLayer:HO,export:{title:"Export Settings",reset:"Reset export settings",imagesPath:"Image path (Spine Images Path)",spineVersion:"Spine version",keyframeCurve:"Keyframe interpolation",linear:"Linear",smoothBezier:"Smooth Bézier",bezierHelp:"Smooth Bézier fits continuous motion within the error tolerance; birth, death, attachment changes, and jumps still use stepped keys.",spine38Help:"Spine 3.8 does not support per-channel array Bézier curves. Export converts them to tolerance-reduced piecewise linear keys.",fps:"Export FPS",omitFps:"Omit fps",fpsHelp:"Changing FPS preserves real animation duration. “Omit fps” only removes the Spine fps metadata.",integerFrames:"Integer frame alignment",bonePool:"Bone object pool",excludeEmpty:"Exclude empty animations",baking:"Recalculating and baking animation",exportJsonTitle:"Export Spine {version} JSON",preparing:"Preparing export…",exportJson:"Export Spine JSON",exportImagesTitle:"Download the images used by the current particle systems as a ZIP",organizingImages:"Collecting images…",exportImages:"Export images ZIP",generatingProject:"Generating project…",exportSpine:"Export .spine package",authorize:"Authorize this site",authorizeTitle:"Authorize this site in the local connector",refreshConnector:"Check connector again",refresh:"Refresh",recalculating:"Recalculating particle animation…",exported:"Exported Spine {version}: {systems} particle systems, {animations} animations, {bones} bones{warning}",resourceWarning:"; {count} resource warnings (export continued without missing images)",timeout:"Baking timed out. Ensure the page is still running and try again.",preparingProject:"Collecting images and calling local Spine…",projectExported:"Generated {fileName}: .spine project with {images} images, Spine {version}",collectingImages:"Collecting images used by the current particle systems…",imagesExported:"Generated {fileName}: {images} images in {folder}/",connectorChecking:"Checking the local Spine connector…",connectorOffline:"Local Spine connector is not running",spineNotFound:"Connector is running, but Spine was not found",notAuthorized:"Connector is running, but this site is not authorized",connectorReady:"Connector available · Spine ready",connectorBusy:"Recalculating and generating the Spine project",connectorGenerate:"Generate a Spine {version} project with the local Spine",unknown:"Unknown",checking:"Checking",offline:"Offline",notFound:"Spine not found",unauthorized:"Not authorized",projectTransferTitle:"Export Spine Package",projectTransferDetail:"Recalculating particle animation…",projectTransferDownload:"Spine project download started",generatingJson:"Generating Spine JSON…",preparingProjectFiles:"Preparing project images…",uploading:"Uploading data to the Spine connector…",spineProcessing:"Spine is converting the project…",downloadingProject:"Downloading the generated Spine project…",handingToBrowser:"Starting browser download…"},transfer:jO,scene:WO,modifiers:zO,spine:qO,help:KO,errors:JO},QO={title:"Spine粒子编辑器-Yeomai",resizeTimeline:"拖动调整时间轴高度",systems:"系统",particlesBones:"粒子(骨骼)",rootBone:"根骨骼",hudTip:"滚轮缩放 · 左键拖动画布"},e$={label:"语言",zhCN:"中文",en:"English"},t$={close:"关闭",reset:"重置",add:"添加",remove:"移除",delete:"删除",clear:"清除",cancel:"取消",confirm:"确定",none:"无",enabled:"启用",disabled:"禁用",fixed:"固定",random:"随机",curve:"曲线",followExport:"跟随导出",linear:"线性",bezier:"贝塞尔",above:"之上",below:"之下",left:"左侧",right:"右侧",seconds:"秒",frames:"帧"},i$={settings:"系统设置",undo:"撤回上一步 (Ctrl+Z)",pan:"拖动画布 (Q)",translate:"位移 (W)",rotate:"旋转 (E)",scale:"缩放 (R)",zoomIn:"放大",zoomOut:"缩小",fitView:"适配画布",toggleGrid:"切换网格",resetView:"重置视图",background:"背景图",backgroundSettings:"背景图显示设置",changeBackground:"更换图像",uploadBackground:"上传图像",clearBackground:"清除背景",noBackground:"未上传图像",backgroundX:"背景图 X 偏移",backgroundY:"背景图 Y 偏移",backgroundOpacity:"背景图透明度",opacity:"透明度",help:"使用说明",openHelp:"查看使用说明"},n$={title:"系统设置",layout:"界面布局",parameterPanelPosition:"参数面板位置",panelOnRight:"参数面板显示在右侧",history:"操作历史",maxUndo:"最大撤回步数",canvasGuides:"画布辅助显示",emitter:"发射点",bones:"骨骼连线",bonePointSize:"骨骼点绘制大小",boneAxisSize:"坐标轴绘制大小",skinMesh:"蒙皮网格",enableTicks:"启用刻度",tickFontSize:"刻度文字大小",tickWidth:"刻度线粗细",axisColor:"坐标轴颜色",showAxisLabels:"显示刻度数值",cacheNote:"整个系统设置会自动保存到当前浏览器"},s$={title:"配置管理",save:"保存配置",saveTitle:"保存全部编辑器配置 (Ctrl+S)",load:"加载配置",loadTitle:"加载本地编辑器配置",presets:"预设列表",selectPreset:"选择预设",noPresets:"无预设文件",saved:"配置已保存到本地",loading:"正在加载配置…",loaded:"已加载:{name}",presetLoading:"正在加载预设…",presetLoaded:"已加载预设:{name}",presetNamingError:"{message},请检查预设文件命名",presetTransferTitle:"加载预设",presetDownloading:"正在下载 {file}…",presetParsing:"正在解析预设配置…",presetRestoring:"正在解析并恢复预设资源…",presetComplete:"预设加载完成",presetListError:"无法读取预设列表",presetReadError:"无法读取预设:{file}"},r$={particleSweep:"1.粒子扫过",barBlocks:"2.长条方块",forceTrail:"3.力场拖尾",lightningSequence:"4.雷电序列帧",texturePivot:"5.贴图轴点",subEmitter:"6.子发射器"},o$={bezierHint:"拖动方形手柄调整弧度 · 双击空白新建 · 双击节点删除",linearHint:"双击空白新建 · 双击节点删除 · 拖动节点调整",resetTitle:"恢复默认曲线"},a$={addTitle:"双击色带添加色标",color:"色标颜色",colorValue:"色标颜色值",position:"色标位置",addMiddle:"在中间新增颜色",delete:"删除当前色标",hint:"双击色带新增 · 拖动色标调整位置 · 双击色标删除"},l$={angleOffset:"角度偏移",value:"数值",lower:"下限",upper:"上限",rangeLower:"范围下限",rangeUpper:"范围上限",curveInput:"曲线输入 →",direction:"发射方向"},c$={title:"贴图轴点",zoomOut:"缩小",zoomIn:"放大",expand:"放大到全屏操作",interaction:"左键点击/拖动设置轴点 · 右键拖动画布 · 滚轮缩放",previewAlt:"轴点预览",noImage:"未选择图片",resetCenter:"复位居中 (50%, 50%)",coordinates:"轴点坐标(%)",rotationTest:"轴心旋转测试",static:"静止",spin:"自转",swing:"摆动",rotationAlt:"旋转测试",topLeft:"左上",top:"正上",topRight:"右上",left:"正左",center:"正中",right:"正右",bottomLeft:"左下",bottom:"正下·底部",bottomRight:"右下"},h$={chooseSequence:"选择序列帧图片",chooseLocal:"选择本地图片",subfolder:"子文件夹",name:"名称",restore:"恢复 {name}",deleteResource:"删除图片资源",imageMode:"图片模式",fixed:"固定",sequence:"序列帧",playbackMode:"播放模式",onceHide:"单次-尾帧消失",onceHold:"单次-尾帧固定",loopForward:"正向循环",loopReverse:"反向循环",playbackFps:"播放帧率",chooseSequenceMulti:"选择序列帧(多选)",weight:"占比%",unlockWeight:"解除占比锁定",lockWeight:"锁定当前占比",pivot:"贴图轴点",collapsePivot:"收起轴点调整",expandPivot:"展开轴点调整",pivotModal:"贴图旋转轴点大图精修",pivotModalDesc:"在下方贴图上任意点击或拖拽,精确设置粒子的旋转/摆动中心",pivotZoomHint:"支持 100% ~ 400% 放大,精确对准尖端或根部:",confirmPivot:"确定并保存轴点",noSequence:"未选择序列帧",firstFrame:"第 1 帧",firstImage:"第一张图片",lastImage:"最后一张图片",pivotOn:"已开启:X {x}% | Y {y}%",pivotOff:"未开启,默认围绕图片正中心 (50%, 50%)",pivotCustom:"轴点已自定义:X {x}% | Y {y}%",frameCountOne:"1 帧 · {name}",frameCountMany:"{count} 帧 · {first} → {last}",sequenceSelected:"已选择 {count} 帧,按 {first}-{last} 顺序播放"},u$={play:"播放 (D)",pause:"暂停 (D)",toStart:"回到第一帧 (S)",previous:"前一帧",next:"后一帧",toEnd:"移动到最后一帧",continuousLoop:"持续循环播放",abLoop:"独立 A/B 区间循环",abLoopShort:"AB 循环",abRange:"AB 循环区间",playbackStart:"自定义播放起始帧",playbackEnd:"自定义播放结束帧",startFrame:"播放起始帧",endFrame:"播放结束帧",frame:"帧",emission:"持续发射",particleLife:"粒子存在",spineAnimation:"Spine 动画",ownerAnimation:"所属动画",setOwnerAnimation:"设置当前粒子系统所属的动画",chooseOwnerAnimation:"选择所属动画",animationName:"动画名称",renameAnimation:"重命名当前动画",rename:"重命名",newAnimation:"+ 新增",keepOneAnimation:"至少需要保留一个动画",spinePreview:"Spine 预览动画",noSpineAnimation:"无可用 Spine 动画",none:"无",systemName:"系统 {index}",dragLoopDuration:"拖动循环段时长",dragEmissionDuration:"拖动持续发射时长",dragSpineStart:"拖动调整动画开始时间",noAnimationData:"暂无可显示的动画数据",animationNameEmpty:"动画名称不能为空",animationNameDuplicate:"动画名称不能重复",animationRenameFailed:"无法修改动画名称",zoomIn:"放大",zoomOut:"缩小",zoomFit:"适中",frameStatus:"帧 {current} / {total}"},d$={title:"发射模式",reset:"重置发射模式参数",stream:"持续",burst:"爆发",normalStream:"常规持续",loopStream:"循环持续",rate:"发射速率",duration:"发射时长",loopDuration:"发射时长 (f)",generateStart:"生成开始循环动画",generateEnd:"生成结束循环动画",customDuration:"指定时长",auto:"自动 {frames}f",startLoopDuration:"开始循环段时长",endLoopDuration:"结束循环段时长",loopWarning:"循环持续模式不支持骨骼跟随和路径跟随;进入或退出时会将粒子跟随设置恢复默认值。",burstCount:"单次数量",delay:"延迟时间",shapeTitle:"发射器形状",shapeReset:"重置发射器形状参数",shape:"形状",point:"点",circle:"圆形",rect:"矩形",cone:"锥形",path:"路径",innerDiameter:"内径",outerDiameter:"外径",innerRadius:"内半径",outerRadius:"外半径",coneDirection:"锥形朝向",coneAngle:"锥形开口角度",innerWidth:"内宽",innerHeight:"内高",outerWidth:"外宽",outerHeight:"外高",selectPath:"选择路径",noPath:"无路径(点发射)",birthDistribution:"出生分布",evenDistribution:"等间距固定分布",randomDistribution:"随机分布",emissionAngle:"发射角度",radial:"径向(中心向外)",pathNormal:"垂直于路径",pathTangent:"沿路径方向",fixedAngle:"固定角度",baseAngle:"基准角度",randomRange:"随机范围",showShape:"显示形状"},f$={title:"粒子属性",reset:"重置粒子属性参数",initialParams:"粒子初始参数",initialLife:"初始生命周期",randomSample:"随机采样 →",initialSpeed:"初始速度",initialScale:"初始缩放",uniform:"统一",separateXY:"XY分离",scaleX:"缩放 X",scaleY:"缩放 Y",initialRotation:"初始旋转",lifecycleTitle:"粒子生命周期变化参数",speedOverLife:"生命周期内速度",speedMultiplier:"速度倍率",lifeTo:"生命周期 →",scaleOverLife:"生命周期内缩放",scaleMultiplier:"缩放倍率",multiplierX:"倍率 X",multiplierY:"倍率 Y",rotationOverLife:"生命周期内旋转",rotationSpeed:"旋转速度"},m$={title:"外观与资源",reset:"重置外观与资源参数",opacity:"透明度",curveMode:"曲线模式",transparent:"0(透明)",opaque:"1(不透明)",renderLayer:"渲染层级(Spine 插槽)",top:"最上层",spineSlot:"Spine 插槽",selectSpine:"请选择 Spine",noSpine:"无可用 Spine",noSlot:"尚未选择插槽",reselect:"重新选择",selectSlot:"选择插槽",searchSlots:"搜索插槽或附件名称…",searchSlotsAria:"搜索插槽",emptySlot:"空插槽",noMatchingSlots:"没有匹配的插槽",above:"在此插槽图片之上",below:"在此插槽图片之下",followAttachment:"随插槽附件显隐",previewOnly:"调整显示层级只影响编辑器预览,不影响导出数据。",imageResources:"图片资源",addImage:"新增图片资源",scale:"缩放",color:"颜色",fixedColor:"固定色",randomColor:"随机颜色",lifetime:"生命周期",normal:"正常",add:"相加",multiply:"相乘",screen:"滤色",fixedColorValue:"固定颜色值",randomColorHint:"每个粒子出生时从色带随机取色,生命周期内保持不变",independentAlpha:"独立透明度",off:"关闭"},p$={slotLabelAbove:"{spine} / {slot} · 图片之上",slotLabelBelow:"{spine} / {slot} · 图片之下",resolvedAbove:"渲染在 {slot} 图片之上、其后插槽之下",resolvedBetween:"渲染在 {previous} 与 {slot} 之间",warningNoSpine:"没有已加载的 Spine,粒子临时显示在最上层。",warningNoSelection:"尚未选择 Spine,粒子临时显示在最上层。",warningMissingSpine:"目标 Spine 不存在,粒子临时显示在最上层。",warningNotReady:"目标 Spine 未就绪,粒子临时显示在最上层。",warningMissingSlot:"目标插槽不存在(资源可能已更换),粒子临时显示在最上层。",warningFirstSlot:"这是第一个插槽,无法显示在其下方,粒子临时显示在最上层。"},g$={completed:"已完成",failed:"操作失败"},v$={title:"场景对象",addParticle:"添加粒子系统",addParticleShort:"+粒子",addCollider:"添加碰撞体",addColliderShort:"+碰撞",addPath:"添加路径",addPathShort:"+路径",addSpine:"添加 Spine",copyTitle:"复制当前选中的场景对象",showParticle:"显示粒子系统",hideParticle:"隐藏粒子系统",showCollider:"显示碰撞体",hideCollider:"隐藏碰撞体",showPath:"显示路径",hidePath:"隐藏路径",showSpine:"显示 Spine",hideSpine:"隐藏 Spine",particle:"粒子",subEmitter:"子发射器",collision:"碰撞",path:"路径",deleteParticle:"删除粒子系统",deleteCollider:"删除碰撞体",deletePath:"删除路径",deleteSpine:"删除 Spine",empty:"场景中暂无对象",name:"名称",positionX:"位置X",positionY:"位置Y",offsetX:"偏移X",offsetY:"偏移Y",rotation:"旋转",scaleX:"缩放X",scaleY:"缩放Y",seed:"随机种子",seedTitle:"控制粒子系统内全部随机属性、资源选择与修改器随机采样",randomizeSeed:"生成新的全局随机种子",seedHint:"控制初始随机参数、资源选择和修改器随机采样;相同种子可复现相同效果",colliderTitle:"碰撞体属性",colliderName:"碰撞体名称",type:"类型",circle:"圆形",ellipse:"椭圆",rect:"矩形",polygon:"多边形",custom:"自定义",enabled:"启用",xPosition:"X 位置",yPosition:"Y 位置",scaleXShort:"缩放 X",scaleYShort:"缩放 Y",radius:"半径",radiusX:"X 半径",radiusY:"Y 半径",width:"宽度",height:"高度",sides:"边数",collisionResponse:"碰撞响应",physics:"物理(弹跳/摩擦)",pause:"暂停(停止不动)",destroy:"消失(立即销毁)",elasticity:"弹性 (0-1)",friction:"摩擦 (0-1)",followPath:"跟随路径移动",targetPath:"目标路径",notSelected:"(未选择)",moveDuration:"移动时长(秒)",followDirection:"方向沿路径",moveProgressCurve:"移动进度曲线",moveProgressHelp:"横轴:实时/移动时长 纵轴:路径进度(0=起点 → 1=终点)",pathTitle:"路径属性",pathName:"路径名称",closedPath:"闭合路径",pathColor:"路径颜色",pathHelp:"操作说明:",pathHelpItems:["双击空白处/曲线:新建锚点","双击锚点:删除节点","双击第二下按住拖动:新建并拉出手柄","拖动锚点移动位置,拖动手柄调整曲线","Shift+拖动手柄:两侧完全对称","Alt+拖动手柄:独立控制单侧","Ctrl+点击/框选:加选节点","Alt+点击/框选:减选节点","Alt+单击空白处:清除全部选中","选中多个节点后可整体拖动"],applyPresetShape:"应用预设形状",choosePreset:"选择预设...",square:"方形",star:"星形",applyPreset:"应用预设",clearAnchors:"清空锚点",panelHint:"使用右上角按钮创建场景对象"},y$={title:"修改器",reset:"重置修改器参数",damping:"阻尼",enableNoise:"开启移动噪声",strength:"强度",noiseRange:"波动范围",noiseSpeed:"时间流速",noiseHint:"强度控制影响比例 · 波动范围控制最大偏移 · 时间流速控制变化速度",enableGravity:"开启重力",gravityStrength:"重力强度",strengthMin:"强度 min",strengthMax:"强度 max",direction:"方向",gravityOverLife:"生命周期内重力",windOverLife:"生命周期内风力",axisStrength:"纵轴:强度 0~1",directionHint:"0° 向右 · -90° 向下 · 负强度会反转方向",enableWind:"开启风力",windStrength:"风力强度",enableForceField:"开启力场",centerX:"中心 X",centerY:"中心 Y",forceStrength:"力场强度",forceRadius:"力场半径",falloffMode:"衰减模式",constant:"恒定(范围内力度不变)",linearFalloff:"线性衰减(边缘为 0)",inverseFalloff:"距离反比(中心最强)",forceHint:"正数吸向中心 · 负数向外排斥 · 可在画布内拖动力场圆",showShape:"显示形状",enableVortex:"开启漩涡",vortexHint:"正数逆时针 · 负数顺时针",enableAttraction:"开启吸附",attractionX:"吸附点 X",attractionY:"吸附点 Y",attractionRadius:"吸附半径",attractionDuration:"吸附时长",delay:"延迟时间",delayMode:"延迟方式",globalTime:"统一时间",particleLife:"单粒子生命",attractionPath:"吸附方式",straight:"直线",attractionHint:"延迟后从当前位置开始吸附 · 到达红色范围即死亡 · 可在画布内拖动吸附圆",enableTrail:"开启拖尾",trailImages:"拖尾独立图片",addTrailImage:"增加拖尾图片资源",trailRotation:"旋转",trailBones:"拖尾骨骼数",trailRatio:"拖尾比例 (%)",trailLength:"拖尾长度",randomRange:"随机范围",lengthRatio:"长度比例 (%)",lengthMin:"长度最小 (%)",lengthMax:"长度最大 (%)",trailWidth:"拖尾宽度",widthRatio:"宽度比例 (%)",widthMin:"宽度最小 (%)",widthMax:"宽度最大 (%)",widthScale:"宽度缩放",followParticle:"跟随粒子",lifeLengthCurve:"生命周期长度曲线",shapeCurve:"形状曲线(首端 → 尾端宽度)",colorMode:"颜色模式",blendMode:"混合模式",fixedColor:"固定颜色",alphaMode:"透明度模式",opacity:"透明度",gridRows:"网格行数",gridCols:"网格列数",trailHint:"每个粒子按资源比例生成一组同级拖尾骨骼;随机长度与宽度在粒子出生时确定,相同种子可稳定复现",enableFollow:"开启发射器跟随",followMode:"跟随模式",noFollow:"无",followPath:"跟随路径",selectedBone:"选中的骨骼",emitterAngleMode:"发射器角度模式",fixedAngle:"固定角度",followMoveDirection:"跟随移动方向",moveProgressCurve:"移动进度曲线 (0→1)",moveDuration:"移动时长 (s)",followSpace:"跟随空间",localSpace:"局部空间(GEN 移动)",worldSpace:"世界空间(粒子生成点移动)",moveDirection:"移动方向",forward:"正向(起点 → 终点)",reverse:"反向(终点 → 起点)",followOffset:"偏移起始点 (0-1)",followSpaceHint:"局部空间会移动整个发射器;世界空间只移动新粒子的生成点,已出生粒子留在世界位置。",followTarget:"跟随目标:",noValidBone:"尚未绑定有效骨骼,请先在 Spine 层级树中选择骨骼。",rebind:"重新绑定",bind:"绑定",selectedBoneLabel:"当前选中骨骼:",boneLocalSpace:"本地空间(随骨骼移动)",boneWorldSpace:"世界空间(粒子生成后保持位置)",offsetX:"位移偏移 X",offsetY:"位移偏移 Y",rotationOffset:"旋转偏移",scaleOffsetX:"缩放偏移 X",scaleOffsetY:"缩放偏移 Y",boneFollowHint:"发射器只跟随所选 Spine 骨骼的位置,不继承 Spine 的旋转或缩放;粒子变换使用粒子系统自身参数和上方偏移。",enableCollision:"开启碰撞",collisionObjects:"参与的碰撞对象",colliderDisabled:"{name}(碰撞体已禁用)",clearCollider:"清除碰撞对象 {name}",addCollider:"加入场景碰撞对象",noAvailableColliders:"没有可加入的碰撞对象",noCollidersSelected:"未选择碰撞对象,当前粒子不会发生碰撞",available:"可用",disabled:"已禁用",collisionHint:"只有已加入且启用的场景碰撞对象会参与当前粒子系统的碰撞",enableSubEmitter:"开启子发射器",triggerTiming:"选择触发时机",birth:"出生",death:"死亡",collision:"碰撞",chooseTarget:"选择目标粒子系统",noTarget:"无(粒子系统)",deleteSubEmitter:"删除该子发射器",probability:"发射概率",collisionLimit:"碰撞次数限制",inherit:"继承",colorInheritMode:"颜色继承方式",add:"相加",replace:"覆盖",addSubEmitter:"+ 新增子发射器",inheritNone:"无(默认值)",inheritAll:"所有属性",inheritColor:"颜色",inheritScale:"大小",inheritRotation:"旋转",inheritLife:"生命周期"},b$={title:"Spine 属性",name:"Spine 名称",xPosition:"X 位置",yPosition:"Y 位置",rotation:"旋转",scaleX:"Scale X",scaleY:"Scale Y",startTime:"开始时间",resources:"Spine 资源",chooseFolder:"选择文件夹并加载",folderHint:"一次读取文件夹中的 JSON / SKEL、Atlas 和全部纹理;仍可在下方单独替换资源。",choose:"选择",chooseMultiple:"选择(多选)",loading:"加载中…",load:"↧ 加载",clear:"清除",supportNote:"支持 Spine 3.8 / 4.0 / 4.1 / 4.2 / 4.3 JSON · 对应版本运行时按需加载 · 本地离线",currentResource:"当前资源 {version}",animations:"Spine 动画",noAnimations:"无可用动画",timelineAnimation:"时间轴播放动画",no:"无",hierarchy:"层级树",clearBoneTitle:"点击清除骨骼选择",noBoneTitle:"当前未选择骨骼",clearBone:"清除选中骨骼:{name}",currentBone:"当前骨骼:",clearSlotTitle:"点击清除插槽选择",noSlotTitle:"当前未选择插槽",clearSlot:"清除选中插槽:{name}",currentSlot:"当前插槽:",notSelected:"未选择",expandAll:"全部展开",collapseAll:"全部折叠",bones:"骨骼",slots:"插槽",notLoaded:"未加载 Spine",searchBones:"搜索骨骼",searchBonesPlaceholder:"搜索骨骼名称…",clearSearch:"清空搜索",clearBoneSearch:"清空骨骼搜索",noMatchingBones:"未找到匹配的骨骼",expandChildren:"展开子骨骼",collapseChildren:"折叠子骨骼",notLoadedSlots:"未加载 Spine 插槽",searchSlots:"搜索插槽",searchSlotsPlaceholder:"搜索插槽或附件名称…",clearSlotSearch:"清空插槽搜索",noMatchingSlots:"未找到匹配的插槽",slotTitle:"{name}(骨骼:{bone},附件:{attachment})",empty:"空",textureSummary:"{count} 张:{names}",textureImages:"纹理图片",missingFolderAssets:"所选文件夹缺少:{missing}",chooseAssets:"请依次选择 Spine 数据、Atlas 和全部纹理图片"},x$={title:"使用说明",subtitle:"从创建粒子到保存、导出的快速入门",close:"关闭使用说明",closeShort:"关闭 (Esc)",quickStart:"快速开始",stepCreate:"创建对象:在左侧“场景对象”中用 +粒子 / +碰撞 / +路径 / +Spine 添加场景对象。",stepEdit:"编辑粒子:选中粒子系统,依次调整“发射模式 → 发射器形状 → 粒子属性 → 外观与资源 → 修改器”。",stepPreview:"查看效果:底部时间轴可播放、暂停、逐帧或拖动;修改参数后会自动重新计算。",stepExport:"保存与导出:用“保存配置”保留工程;“导出 Spine Json / images 包 / .spine 包”输出成品。",quickNote:"每个模块组标题右侧的“重置”可恢复该组默认参数;系统设置会自动保存在当前浏览器。",commonOps:"常用操作",eye:"小眼睛",eyeDesc:"单独显示/隐藏对象;隐藏的粒子系统不会被导出。",copyDesc:"完整复制当前选中对象,方便对比不同参数。",backgroundDesc:"上传参考图并调整位置和透明度,只用于画布预览。",settingsDesc:"管理界面布局、辅助显示、刻度等,自动存入浏览器。",undoDesc:"Ctrl+Z 撤回一步;最大步数可在系统设置中调整。",spineBoneDesc:"在层级树搜索并选择骨骼,可用于粒子发射器跟随。",shortcuts:"快捷键",undoShortcut:"撤回上一步",saveShortcut:"保存配置",panShortcut:"拖动画布",translateShortcut:"位移工具",rotateShortcut:"旋转工具",scaleShortcut:"缩放工具",playShortcut:"播放 / 暂停",startShortcut:"回到第一帧",shortcutNote:"Q / W / E / R 需先点击画布;光标位于输入框时,单键快捷键不会触发。",modules:"功能模块详解",configTitle:"配置管理",saveConfigDesc:"把当前全部场景对象和参数保存为工程 JSON 文件(也支持 Ctrl+S)。",loadConfigDesc:"选择本地配置文件,恢复完整工程。",presetDesc:"从下拉中选择预设快速套用;点击下拉刷新列表。",configScope:"范围",configScopeDesc:"配置包含对象与参数;界面和系统设置单独存于浏览器。",sceneTitle:"场景对象",particleDesc:"核心对象。可设置位置、偏移、旋转、缩放和随机种子;相同种子可复现相同效果。",colliderDesc:"圆形/椭圆/矩形/多边形/自定义,支持物理弹跳、暂停、销毁,以及沿路径移动。",pathDesc:"贝塞尔路径,支持锚点、控制手柄、闭合、颜色和预设形状。",spineDesc:"加载 Spine 数据、Atlas 和纹理,浏览骨骼与插槽,并用于发射器跟随。",sceneCommonDesc:"对象可独立显隐和复制;隐藏的粒子系统不会导出。",emissionDesc:"持续发射、爆发、延迟,以及开始/循环/结束三段式循环持续。",burstDesc:"一次性发射指定数量的粒子。",delayDesc:"发射开始前的等待时间,对应粒子条左端。",loopNote:"循环持续不支持骨骼和路径跟随,切换时会恢复跟随设置。",shapeDesc:"点、圆形、矩形、锥形或路径出生区域。圆/锥支持内外半径,矩形支持内外宽高。",angleDesc:"固定、随机、径向、路径法线或路径切线。",initialDesc:"生命周期、速度、缩放和旋转支持固定、随机、曲线,旋转可跟随发射方向。",overLifeDesc:"速度倍率、缩放倍率、旋转速度可用生命周期曲线控制。",alphaDesc:"透明度支持固定或曲线;曲线模式可跟随导出、线性或贝塞尔。",imageDesc:"单图或序列帧、多图权重随机、轴点、颜色、混合模式和独立透明度。",sequenceDesc:"播放方式有单次隐藏、单次定格、正向循环、反向循环。",noiseDesc:"产生抖动轨迹,并控制强度、范围和速度。",gravityDesc:"重力、风力和生命周期强度曲线。",forceDesc:"全局力场、漩涡、吸附和碰撞。",trailDesc:"独立拖尾资源、骨骼数、长度、宽度、形状、颜色与透明度曲线。",followDesc:"发射器可跟随路径或 Spine 骨骼。",collisionDesc:"选择场景碰撞对象和粒子碰撞响应。",exportDesc:"设置图片路径、Spine 版本、关键帧曲线、FPS、整数帧、骨骼池和空动画。",exportButtonsDesc:"可导出 Spine JSON、images ZIP,或通过连接器生成 .spine 工程。",connectorTitle:"Spine 连接器使用说明",connectorIntro:"连接器把网页生成的 JSON 和图片交给本机已安装并激活的 Spine,转换成可编辑的 .spine 工程。",prerequisite:"前置",prerequisiteDesc:"电脑已安装并激活 Spine,并已启动桌面版连接器。",download:"下载",webSide:"网页端",webSideDesc:"显示“连接器可用 · Spine 已就绪”后,点击“导出 .spine 包”。",authorization:"首次授权",authorizationDesc:"首次连接需核对网站来源并允许一次;本机会保存授权白名单。",pathSetup:"路径设置",pathSetupDesc:"连接器会自动检测 Spine;找不到时可手动指定应用路径。",downloadResult:"下载结果",downloadResultDesc:"得到 ZIP 包,内含 .spine 工程和图片目录。",version:"版本",versionDesc:"连接器按 JSON 版本自动匹配 Spine 3.8~4.3。",security:"安全",securityDesc:"仅监听本机地址,授权保存在连接器,临时文件转换后清理。",differenceTitle:"配置与导出有什么区别?",differenceDesc:"“保存配置”保存全部可继续编辑的对象和参数;“导出 Spine Json”只导出显示中的粒子系统,并把碰撞、跟随、拖尾和子发射器结果烘焙为独立动画数据。"},w$={confirmLoopFollowEnter:"进入循环持续模式后,粒子跟随设置会失效并恢复默认值。是否继续?",confirmLoopFollowExit:"退出循环持续模式后,粒子跟随设置会失效并恢复默认值。是否继续?",invalidJson:"配置文件不是有效的 JSON",invalidConfigFormat:"不是 SpineParticle 编辑器配置文件",unsupportedConfigVersion:"暂不支持配置版本:{version}",missingScene:"配置文件缺少完整场景数据",missingEmbeddedSpine:"配置未包含可复用的 Spine 原始资源",chooseJsonConfig:"请选择 .json 配置文件",settingsInvalidJson:"系统设置缓存不是有效的 JSON",settingsFormat:"不是 SpineParticle 编辑器系统设置缓存",settingsVersion:"暂不支持系统配置版本:{version}",settingsMissing:"系统设置缓存缺少 settings",noExportableImages:"当前可见粒子系统没有可导出的图片",invalidZipPath:"ZIP 文件路径无效",spineFileType:"Spine 数据仅支持 .json 或 .skel",atlasFileType:"图集文件仅支持 .atlas",chooseTexture:"请至少选择一张纹理图片",binaryParseFailed:"Spine 二进制解析失败(4.3:{v43};旧版:{v42})",invalidSpineJson:"Spine JSON 文件格式无效",unsupportedSpineJsonVersion:"Spine JSON 版本不受支持,仅支持 {versions}",unsupportedSpineDataVersion:"Spine 数据版本不受支持,仅支持 {versions}",embeddedReadFailed:"无法读取内嵌 Spine 文件:{name}",missingImageWarning:"图片“{file}”缺失或尺寸不可读,已保留路径。",missingTrailImageWarning:"拖尾图片“{file}”缺失,已保留路径。",emptyCacheWarning:"“{name}”没有可用帧缓存。",readExportImageFailed:"无法读取导出图片:{name}",connectorOffline:"未检测到本地 Spine 连接器,请先启动连接器",connectorHttpError:"Spine 连接器返回错误:HTTP {status}",invalidTrailUV:"拖尾网格“{name}”的 UV 数据无效",missingTrailVertices:"拖尾网格“{name}”缺少顶点数据",trailIndexOutOfRange:"拖尾网格“{name}”的三角形索引越界",invalidTrailHull:"拖尾网格“{name}”的外轮廓数量无效",trailHullIndexOutOfRange:"拖尾网格“{name}”的外轮廓边索引越界",invalidInfluenceCount:"拖尾网格“{name}”包含无效骨骼权重数量",missingBoneReference:"拖尾网格“{name}”引用了不存在的骨骼",invalidWeight:"拖尾网格“{name}”包含无效权重数据",weightSum:"拖尾网格“{name}”的顶点权重之和不为 1",vertexCountMismatch:"拖尾网格“{name}”的顶点数量与 UV 不一致",invalidInherit:"骨骼“{name}”的 inherit 值“{inherit}”不符合 Spine {version} JSON 格式",trailBoneParent:"拖尾骨骼“{name}”必须直接挂在粒子系统骨骼下,不能组成骨骼链",trailSlotEmpty:"加权拖尾插槽“{name}”不能使用空附件,未出现或死亡阶段应将对应骨骼缩放设为 0",spine38Version:"Spine 3.8 导出的版本标识必须为 3.8",spine38Inherit:"Spine 3.8 骨骼“{name}”应使用 transform,不能使用 inherit",spine38SlotColor:"Spine 3.8 插槽颜色时间轴必须使用 color / twoColor",spine38AttachmentName:"Spine 3.8 附件时间轴的隐藏帧必须显式写入 name: null",spine38RotationAngle:"Spine 3.8 旋转时间轴必须使用 angle",spine38Curve:"Spine 3.8 不支持 4.x 数组曲线格式",unsupportedExportVersion:"导出版本不受支持,仅支持 Spine {versions}",exportVersionMismatch:"导出版本不一致:设置为 Spine {expected},JSON 标记为 Spine {actual}",exportMissingBones:"导出结果缺少骨骼",missingAtlasTexture:"Atlas 引用的纹理未选择:{name}"},S$={app:QO,language:e$,common:t$,toolbar:i$,settings:n$,config:s$,presets:r$,curve:o$,gradient:a$,attributeControl:l$,pivot:c$,image:h$,timeline:u$,emission:d$,attributes:f$,appearance:m$,renderLayer:p$,export:{title:"导出设置",reset:"重置导出设置",imagesPath:"图片路径 (Spine Images Path)",spineVersion:"Spine 版本",keyframeCurve:"关键帧插值曲线",linear:"线性 (Linear)",smoothBezier:"平滑贝塞尔 (Smooth Bézier)",bezierHelp:"平滑贝塞尔会在误差允许范围内拟合连续运动;出生、死亡、附件切换和突变仍使用阶跃关键帧。",spine38Help:"Spine 3.8 不支持 4.x 的逐通道数组贝塞尔,导出时会转换为经过容差精简的分段线性关键帧。",fps:"导出 FPS",omitFps:"不写 fps",fpsHelp:"修改 FPS 时保持动画实际秒数不变;“不写 fps”只省略 Spine 的 fps 元数据。",integerFrames:"整数帧对齐",bonePool:"骨骼对象池",excludeEmpty:"排除无内容动画",baking:"正在重新计算并烘焙动画",exportJsonTitle:"导出 Spine {version} JSON",preparing:"正在准备导出…",exportJson:"导出Spine Json",exportImagesTitle:"单独下载当前粒子系统使用的图片 ZIP",organizingImages:"正在整理图片…",exportImages:"导出 images 包",generatingProject:"正在生成工程…",exportSpine:"导出 .spine 包",authorize:"授权当前网站",authorizeTitle:"在本机连接器中授权当前网站",refreshConnector:"重新检测连接器",refresh:"刷新",recalculating:"正在重新计算粒子动画…",exported:"已导出 Spine {version}:{systems} 个粒子系统、{animations} 个动画、{bones} 根骨骼{warning}",resourceWarning:";{count} 条资源提示(缺图仍已导出)",timeout:"重新计算动画超时,请确认页面仍在运行后重试",preparingProject:"正在整理图片并调用本机 Spine…",projectExported:"已生成 {fileName}:包含 .spine 工程和 {images} 张图片,Spine {version}",collectingImages:"正在整理当前粒子系统使用的图片…",imagesExported:"已生成 {fileName}:{folder}/ 内包含 {images} 张图片",connectorChecking:"正在检测本地 Spine 连接器…",connectorOffline:"本地 Spine 连接器未启动",spineNotFound:"连接器已启动,但未找到 Spine",notAuthorized:"连接器已启动,当前网站尚未授权",connectorReady:"连接器可用 · Spine 已就绪",connectorBusy:"正在重新计算并生成 Spine 工程",connectorGenerate:"调用本机 Spine 自动生成 {version} 工程",unknown:"未知",checking:"检测中",offline:"未启动",notFound:"未找到 Spine",unauthorized:"未授权",projectTransferTitle:"导出 Spine 包",projectTransferDetail:"正在重新计算粒子动画…",projectTransferDownload:"Spine 工程包已开始下载",generatingJson:"正在生成 Spine JSON…",preparingProjectFiles:"正在整理工程图片…",uploading:"正在上传数据到 Spine 连接器…",spineProcessing:"Spine 正在转换工程,请稍候…",downloadingProject:"正在下载生成的 Spine 工程包…",handingToBrowser:"正在交给浏览器下载…"},transfer:g$,scene:v$,modifiers:y$,spine:b$,help:x$,errors:w$},f_=[{code:"zh-CN",label:"中文"},{code:"en",label:"English"}],m_="spine-particle.locale";function _$(n){return f_.some(e=>e.code===n)}function T$(n,e){return _$(n)?n:e.some(t=>t.toLowerCase().startsWith("zh"))?"zh-CN":"en"}function E$(){var t;let n=null;if(typeof window<"u")try{n=localStorage.getItem(m_)}catch{}const e=typeof navigator>"u"?[]:(t=navigator.languages)!=null&&t.length?[...navigator.languages]:[navigator.language];return T$(n,e)}const p_=E$(),ac=bO({legacy:!1,locale:p_,fallbackLocale:"en",messages:{"zh-CN":S$,en:ZO}});function g_(n){if(ac.global.locale.value=n,typeof window<"u")try{localStorage.setItem(m_,n)}catch{}typeof document<"u"&&(document.documentElement.lang=n,document.title=ac.global.t("app.title"))}function Ye(n,e){return e?ac.global.t(n,e):ac.global.t(n)}g_(p_);const v_="SpineParticle.SystemSettings",y_=1,hm="SpineParticle.SystemSettings.v1";function ml(n,e,t,i){const s=Number(n);return Math.min(t,Math.max(e,Number.isFinite(s)?s:i))}function C$(n){return{parameterPanelOnRight:n.parameterPanelOnRight,undoLimit:n.undoLimit,showEmitter:n.showEmitter,showBones:n.showBones,bonePointDrawSize:n.bonePointDrawSize,boneAxisDrawSize:n.boneAxisDrawSize,showSkinMesh:n.showSkinMesh,tickEnabled:n.tickEnabled,axisFontSize:n.axisFontSize,tickWidth:n.tickWidth,showAxisLabels:n.showAxisLabels,axisColor:n.axisColor}}function M$(n,e){const t=s=>n[s]==null?!!e[s]:n[s]===!0,i=typeof n.axisColor=="string"&&/^#[0-9a-f]{6}$/i.test(n.axisColor)?n.axisColor:e.axisColor;return{parameterPanelOnRight:t("parameterPanelOnRight"),undoLimit:Math.round(ml(n.undoLimit,1,200,e.undoLimit)),showEmitter:t("showEmitter"),showBones:t("showBones"),bonePointDrawSize:ml(n.bonePointDrawSize,.1,10,e.bonePointDrawSize),boneAxisDrawSize:ml(n.boneAxisDrawSize,.1,10,e.boneAxisDrawSize),showSkinMesh:t("showSkinMesh"),tickEnabled:t("tickEnabled"),axisFontSize:Math.round(ml(n.axisFontSize,8,40,e.axisFontSize)),tickWidth:ml(n.tickWidth,1,5,e.tickWidth),showAxisLabels:t("showAxisLabels"),axisColor:i}}function A$(n){let e;try{e=JSON.parse(n)}catch{throw new Error(Ye("errors.settingsInvalidJson"))}const t=e;if(t.format!==v_)throw new Error(Ye("errors.settingsFormat"));if(t.version!==y_)throw new Error(Ye("errors.settingsVersion",{version:t.version??Ye("export.unknown")}));if(!t.settings||typeof t.settings!="object")throw new Error(Ye("errors.settingsMissing"));return t}function I$(n,e){Object.assign(n.settings,M$(e,n.settings))}let ch=null;function P$(n){ch==null||ch();try{const e=localStorage.getItem(hm);e&&I$(n,A$(e).settings)}catch{try{localStorage.removeItem(hm)}catch{}}ch=ei(()=>C$(n.settings),e=>{const t={format:v_,version:y_,savedAt:new Date().toISOString(),settings:e};try{localStorage.setItem(hm,JSON.stringify(t))}catch{}},{deep:!0})}function R$(n,e=0){if(n<=0)return 1;const t=Math.pow(10,Math.floor(Math.log10(n))),i=[1,2,5,10,20,50,100];let s=1;for(const r of i)if(r*t>=n){s=r*t;break}return Math.max(s,e)}function k$(n,e,t,i,s){if(!t)return;const r=t;r.clear();const o=n.settings;if(!o.tickEnabled){for(const S of s)S.visible=!1;return}const a=0,c=0,l=e.screen.width/n.editor.viewScale,h=e.screen.height/n.editor.viewScale,u=+("0x"+o.axisColor.replace("#",""));r.lineStyle(1.5,u,.35),r.moveTo(-l,c),r.lineTo(l,c),r.moveTo(a,-h),r.lineTo(a,h);const d=n.editor.viewScale,f=R$(50/d),m=l,p=h,g=Math.max(1,o.tickWidth);if(o.tickEnabled){for(let S=0;S<=l;S+=f){const C=Math.round(S/f)*f;C!==0&&(r.lineStyle(g,u,.25),r.moveTo(C,c-4),r.lineTo(C,c+4),r.moveTo(-C,c-4),r.lineTo(-C,c+4))}for(let S=0;S<=h;S+=f)Math.round(S/f)*f!==0&&(r.lineStyle(g,u,.25),r.moveTo(a-4,S),r.lineTo(a+4,S),r.moveTo(a-4,-S),r.lineTo(a+4,-S))}const v=e.screen.width/2+n.editor.viewX,b=e.screen.height*.5+n.editor.viewY,y=o.axisFontSize,x=+("0x"+o.axisColor.replace("#",""));for(;s.length<64;){const S=new Lg("",{fontFamily:"monospace",fontSize:y,fill:x});S.anchor.set(.5,.5),i.addChild(S),s.push(S)}let _=0;const E=o.showAxisLabels&&o.tickEnabled;for(let S=0;S<=l;S+=f){const C=Math.round(S/f)*f;if(C===0||!E||C>m)continue;const M=s[_++];if(!M)break;M.style.fontSize=y,M.text=String(C),M.position.set(v+C*d,b+9),M.visible=!0;const P=s[_++];if(!P)break;P.style.fontSize=y,P.text=String(-C),P.position.set(v-C*d,b+9),P.visible=!0}for(let S=0;S<=h;S+=f){const C=Math.round(S/f)*f;if(C===0||!E||C>p)continue;const M=s[_++];if(!M)break;M.style.fontSize=y,M.text=String(C),M.position.set(v+8,b-S*d),M.visible=!0;const P=s[_++];if(!P)break;P.style.fontSize=y,P.text=String(-C),P.position.set(v+8,b+S*d),P.visible=!0}for(;_b.id===n.activeId);if(!s||s.visible===!1)return;const r=s.config;if(!r.showShape)return;const o=e.get(s.id),a=(o==null?void 0:o.x)??r.centerX??0,c=-((o==null?void 0:o.y)??r.centerY??0),l=r.shape;if(l==="point"||l==="path")return;const h=r.rootScaleX??1,u=r.rootScaleY??1,d=-((o==null?void 0:o.rotation)??r.rootRotation??0)*Math.PI/180,f=Math.cos(d),m=Math.sin(d),p=r.offsetX??0,g=r.offsetY??0,v=(b,y)=>{const x=b+p,_=-y-g,E=x*h,S=_*u;return[a+E*f-S*m,c+(E*m+S*f)]};if(l==="circle"){const b=au(r.innerRadius,r.outerRadius);i.lineStyle(2,3991658,.7);const y=48;for(const x of[b.outer,b.inner])if(!(x<=0))for(let _=0;_<=y;_++){const E=_/y*Math.PI*2,[S,C]=v(Math.cos(E)*x,Math.sin(E)*x);_===0?i.moveTo(S,C):i.lineTo(S,C)}}else if(l==="rect"){const b=TS(r);i.lineStyle(2,4885759,.7);for(const[y,x]of[[b.outerW,b.outerH],[b.innerW,b.innerH]]){if(y<=0||x<=0)continue;const _=y/2,E=x/2,S=v(-_,-E),C=v(_,-E),M=v(_,E),P=v(-_,E);i.moveTo(S[0],S[1]),i.lineTo(C[0],C[1]),i.lineTo(M[0],M[1]),i.lineTo(P[0],P[1]),i.lineTo(S[0],S[1])}}else if(l==="cone"){const b=au(r.innerRadius,r.outerRadius),y=r.coneAngle/2*Math.PI/180,x=r.coneDirection*Math.PI/180,_=v(Math.cos(x-y)*b.inner,Math.sin(x-y)*b.inner),E=v(Math.cos(x+y)*b.inner,Math.sin(x+y)*b.inner),S=v(Math.cos(x-y)*b.outer,Math.sin(x-y)*b.outer),C=v(Math.cos(x+y)*b.outer,Math.sin(x+y)*b.outer);i.lineStyle(2,3991658,.7),i.moveTo(_[0],_[1]),i.lineTo(S[0],S[1]),i.moveTo(E[0],E[1]),i.lineTo(C[0],C[1]),i.lineStyle(1,3991658,.5);const M=24;for(const P of[b.outer,b.inner])if(!(P<=0))for(let A=0;A<=M;A++){const R=x-y+2*y*A/M,[B,O]=v(Math.cos(R)*P,Math.sin(R)*P);A===0?i.moveTo(B,O):i.lineTo(B,O)}}}function O$(n,e){if(!e)return;const t=e;t.clear();const i=n.systems.find(c=>c.id===n.activeId);if((i==null?void 0:i.visible)===!1)return;const s=i==null?void 0:i.config;if(!(s!=null&&s.forceField)||!s.showForceFieldShape||s.forceRadius<=0)return;const r=s.forceCenterX,o=-s.forceCenterY,a=s.forceStrength>=0?5818367:16739194;t.lineStyle(2,a,.85),t.beginFill(a,.08),t.drawCircle(r,o,s.forceRadius),t.endFill(),t.lineStyle(1,a,.7),t.moveTo(r-9,o),t.lineTo(r+9,o),t.moveTo(r,o-9),t.lineTo(r,o+9),t.beginFill(a,.95),t.drawCircle(r,o,4),t.endFill()}function $$(n,e){if(!e)return;const t=e;t.clear();const i=n.systems.find(u=>u.id===n.activeId);if((i==null?void 0:i.visible)===!1)return;const s=i==null?void 0:i.config;if(!(s!=null&&s.vortex)||!s.showVortexShape||s.vortexRadius<=0)return;const r=s.vortexCenterX,o=-s.vortexCenterY,a=s.vortexStrength>=0?12156159:16753228;t.lineStyle(2,a,.9),t.beginFill(a,.07),t.drawCircle(r,o,s.vortexRadius),t.endFill(),t.beginFill(a,.95),t.drawCircle(r,o,4),t.endFill();const c=r+Math.min(s.vortexRadius*.65,50),l=s.vortexStrength>=0?-1:1,h=o+l*14;t.lineStyle(2,a,.9),t.moveTo(c,o+l*-8),t.lineTo(c,h),t.moveTo(c,h),t.lineTo(c-4,h-l*5),t.moveTo(c,h),t.lineTo(c+4,h-l*5)}function N$(n,e){if(!e)return;const t=e;t.clear();const i=n.systems.find(l=>l.id===n.activeId);if((i==null?void 0:i.visible)===!1)return;const s=i==null?void 0:i.config;if(!(s!=null&&s.attraction)||!s.showAttractionShape)return;const r=s.attractionCenterX,o=-s.attractionCenterY,a=Math.max(0,s.attractionRadius),c=16731487;a>0&&(t.lineStyle(2,c,.95),t.beginFill(c,.09),t.drawCircle(r,o,a),t.endFill()),t.lineStyle(1,c,.85),t.moveTo(r-10,o),t.lineTo(r+10,o),t.moveTo(r,o-10),t.lineTo(r,o+10),t.beginFill(c,1),t.drawCircle(r,o,a>0?4:6),t.endFill()}function D$(n,e,t){const i=n.rotation*Math.PI/180,s=Math.cos(i),r=Math.sin(i),o=Math.max(1e-4,Math.abs(n.scaleX??1)),a=Math.max(1e-4,Math.abs(n.scaleY??1));return{x:n.x+s*e*o-r*t*a,y:n.y+r*e*o+s*t*a}}function aa(n,e,t){const i=n.rotation*Math.PI/180,s=Math.cos(i),r=Math.sin(i),o=Math.max(1e-4,Math.abs(n.scaleX??1)),a=Math.max(1e-4,Math.abs(n.scaleY??1)),c=e-n.x,l=t-n.y;return{x:(s*c+r*l)/o,y:(-r*c+s*l)/a}}function b_(n,e,t="linear"){if(!n.length)return e;const i=[...n].sort((s,r)=>s.x-r.x);if(e<=i[0].x)return i[0].y;for(let s=1;sl.id===a.emitterFollowSpineId);!c||c.visible===!1||s.set(`${a.emitterFollowSpineId}:${a.emitterFollowBoneName}`,{spineId:a.emitterFollowSpineId,boneName:a.emitterFollowBoneName})}for(const o of s.values()){const a=e==null?void 0:e.getBoneWorldTransform(o.spineId,o.boneName);if(!a)continue;const c=a.x,l=-a.y;i.lineStyle(2,12881151,.95),i.beginFill(12881151,.2),i.drawCircle(c,l,8),i.endFill(),i.beginFill(15919103,1),i.drawCircle(c,l,3.5),i.endFill()}}function U$(n,e,t){if(!t)return;const i=t;if(i.clear(),!n.value)return;const s=e();if(!s)return;const r=s.x,o=-s.y,a=s.scaleX,c=s.scaleY,l=-s.rotation*Math.PI/180,h=Math.cos(l),u=Math.sin(l),d=(p,g)=>{const v=p*a,b=-g*c;return[r+v*h-b*u,o+(v*u+b*h)]},f=(p,g,v,b)=>{const y=d(p,g),x=d(v,b);i.moveTo(y[0],y[1]),i.lineTo(x[0],x[1])},m=26;if(i.lineStyle(2,3526911,.9),i.beginFill(3526911,.25),i.drawCircle(r,o,6),i.endFill(),n.value==="translate")i.lineStyle(2,3526911,.9),f(-m,0,m,0),f(0,-m,0,m),f(m-6,-4,m,0),f(m,0,m-6,4),f(-20,-4,-m,0),f(-m,0,-20,4),f(-4,m-6,0,m),f(0,m,4,m-6),f(-4,-20,0,-m),f(0,-m,4,-20);else if(n.value==="rotate"){i.lineStyle(2,3526911,.8);const p=48;for(let b=0;b<=p;b++){const y=b/p*Math.PI*2,[x,_]=d(Math.cos(y)*m,Math.sin(y)*m);b===0?i.moveTo(x,_):i.lineTo(x,_)}const[g,v]=d(0,m);i.beginFill(3526911,.95),i.drawCircle(g,v,4),i.endFill()}else if(n.value==="scale"){i.lineStyle(2,3526911,.9);const g=[[-m,-m],[m,-m],[m,m],[-m,m]].map(([v,b])=>d(v,b));i.moveTo(g[0][0],g[0][1]),i.lineTo(g[1][0],g[1][1]),i.lineTo(g[2][0],g[2][1]),i.lineTo(g[3][0],g[3][1]),i.lineTo(g[0][0],g[0][1]),i.beginFill(3526911,.9);for(const v of g)i.drawRect(v[0]-3,v[1]-3,6,6);i.endFill()}}function V$(n,e=16777215){const t=Number.parseInt(n.replace("#",""),16);return Number.isFinite(t)?t:e}function X$(n,e,t){if(!t)return;const i=t;i.clear();for(const s of e){if(s.visible===!1)continue;const r=n.activeObjectType==="collision"&&n.activeObjectId===s.id,o=s.enabled?r?16735858:13911899:5792116,a=s.rotation*Math.PI/180,c=Math.cos(a),l=Math.sin(a),h=Math.max(1e-4,Math.abs(s.scaleX??1)),u=Math.max(1e-4,Math.abs(s.scaleY??1)),d=(p,g)=>({x:s.x+c*p*h-l*g*u,y:-(s.y+l*p*h+c*g*u)});let f=[];if(s.shape==="circle"||s.shape==="ellipse"){const p=s.shape==="circle"?s.radius:s.radiusX,g=s.shape==="circle"?s.radius:s.radiusY;f=Array.from({length:49},(v,b)=>{const y=b/48*Math.PI*2;return d(Math.cos(y)*p,Math.sin(y)*g)})}else if(s.shape==="rect"){const p=s.width*.5,g=s.height*.5;f=[d(-p,-g),d(p,-g),d(p,g),d(-p,g),d(-p,-g)]}else{const p=Math.max(3,Math.min(16,Math.round(s.sides)));f=Array.from({length:p+1},(g,v)=>{const b=Math.PI*.5+v%p/p*Math.PI*2;return d(Math.cos(b)*s.width*.5,Math.sin(b)*s.height*.5)})}if(!f.length)continue;i.lineStyle(r?2.5:1.5,o,s.enabled?.95:.45),i.beginFill(o,r?.12:.055),i.moveTo(f[0].x,f[0].y);for(let p=1;po.id===n.activeObjectId):null,r=(s==null?void 0:s.config.shape)==="path"&&!s.config.showShape?s.config.spawnPathId:0;for(const o of n.paths){if(o.id===r||o.visible===!1||!o.enabled||!o.points.length)continue;const a=n.activeObjectType==="path"&&n.activeObjectId===o.id,c=V$(o.color,16749374),l=(f,m)=>{const p=D$(o,f,m);return{x:p.x,y:-p.y}},h=o.points[0],u=l(h.x,h.y);i.lineStyle(a?2.5:1.8,c,a?1:.75),i.moveTo(u.x,u.y);const d=o.closed?o.points.length:o.points.length-1;for(let f=0;f{const p=l(f.x,f.y),g=l(f.x+f.inX,f.y+f.inY),v=l(f.x+f.outX,f.y+f.outY),b=Math.hypot(f.inX,f.inY)>.01,y=Math.hypot(f.outX,f.outY)>.01;i.lineStyle(1,11121867,.65),b&&(i.moveTo(p.x,p.y),i.lineTo(g.x,g.y)),y&&(i.moveTo(p.x,p.y),i.lineTo(v.x,v.y)),b&&(i.beginFill(14015724,.95),i.drawCircle(g.x,g.y,3),i.endFill()),y&&(i.beginFill(14015724,.95),i.drawCircle(v.x,v.y,3),i.endFill()),i.beginFill(e.has(m)?16777215:c,1),i.lineStyle(1.5,e.has(m)?6126847:16777215,.95),i.drawCircle(p.x,p.y,e.has(m)?5:4),i.endFill()})}}function G$(n,e,t,i){var o;const s=Number.isFinite(e.worldX)&&Number.isFinite(e.worldY),r=Number.isFinite(e.worldRotation);n.push({boneName:e.boneName,x:s?e.worldX:e.x,y:s?-e.worldY:e.y,rotation:r?-e.worldRotation:-e.rotation,parentX:t,parentY:i}),(o=e.trailState)!=null&&o.bones.length&&e.trailState.bones.forEach(a=>{const c=Number.isFinite(a.worldX)&&Number.isFinite(a.worldY),l=Number.isFinite(a.worldRotation);n.push({boneName:a.boneName,x:c?a.worldX:a.x,y:c?-a.worldY:a.y,rotation:l?-a.worldRotation:a.rotation,parentX:t,parentY:i,trail:!0})})}function Xb(n,e,t,i,s,r,o,a){const c=r*.62,l=e+i*r,h=t+s*r,u=Math.max(2.5,r*.32),d=Math.max(1.7,r*.22),f=l-i*u,m=h-s*u,p=-s,g=i;n.lineStyle(o,a,.95),n.moveTo(e-i*c,t-s*c),n.lineTo(f,m),n.lineStyle(0),n.beginFill(a,.95),n.drawPolygon([l,h,f+p*d,m+g*d,f-p*d,m-g*d]),n.endFill()}function H$(n,e,t){if(!t)return;const i=t;if(i.clear(),!e.settings.showBones)return;const s=0,r=0,o=Math.max(.25,Math.abs(e.editor.viewScale)||1),a=Math.min(10,Math.max(.1,Number(e.settings.bonePointDrawSize)||1)),c=Math.min(10,Math.max(.1,Number(e.settings.boneAxisDrawSize)||2)),l=2.5*a/o,h=4.5*c/o,u=Math.max(.65,c*.625)/o;for(const d of n){const f=d.trail?16731533:16747610;i.lineStyle(1,f,d.trail?.65:.35),i.moveTo(d.parentX??s,d.parentY??r),i.lineTo(d.x,d.y);const m=d.rotation*Math.PI/180,p=Math.cos(m),g=Math.sin(m);Xb(i,d.x,d.y,p,g,h,u,15684432),Xb(i,d.x,d.y,g,-p,h,u,5622123),i.beginFill(f,.9),i.drawCircle(d.x,d.y,l),i.endFill()}}function Xi(n){return n.map(e=>({...e,trailState:e.trailState?{...e.trailState,bones:e.trailState.bones.map(t=>({...t}))}:void 0}))}function j$(n){const e=new Map;for(const i of n)for(const s of i)e.has(s.boneName)||e.set(s.boneName,Xi([s])[0]);const t=[...e.keys()].sort((i,s)=>{const r=Number(i.replace(/^p_/,"")),o=Number(s.replace(/^p_/,""));return Number.isFinite(r)&&Number.isFinite(o)?r-o:i.localeCompare(s)});for(let i=0;i[r.boneName,r]));n[i]=t.map(r=>{const o=s.get(r);return o||{...Xi([e.get(r)])[0],alpha:0,imageVisible:!1,trailState:void 0,active:!0}})}}function W$(n){n.length<2||(n[n.length-1]=Xi(n[0]))}function z$(n,e){const t=Math.max(0,n.length-1),i=[];for(let s=0;s<=e;s++){const r=Math.min(t,Math.round(s/e*t));i.push(Xi(n[r]||[]))}return i}function um(n){return`${n.boneName}:${n.spawnId??"legacy"}`}function Yb(n){return{...Xi([n])[0],alpha:0,imageVisible:!1,trailState:void 0,active:!0}}function q$(n,e,t,i){const s=Math.min(n.length,i+1),r=n.slice(Math.max(0,n.length-s)),o=new Map;for(const l of e){if(l.imageVisible===!1||l.alpha<=0)continue;const h=um(l),u=new Map;let d=!1;for(let f=r.length-1;f>=0;f--){const m=r[f].find(p=>um(p)===h);if(m)d=!0,u.set(f,m);else if(d)break}o.set(h,u)}const a=Math.max(0,r.length-1),c=[];for(let l=0;l<=t;l++){const h=Math.min(a,Math.round(l/t*a));c.push(e.map(u=>{var f;if(u.imageVisible===!1||u.alpha<=0)return Xi([u])[0];const d=(f=o.get(um(u)))==null?void 0:f.get(h);return d?Xi([d])[0]:Yb(u)}))}return c[0]=c[0].map(Yb),c[c.length-1]=Xi(e),c}function Gb(n,e){const t=n.length?1:0;for(let i=t;i{const y=b?[[]]:[];e.reset();for(let x=0;x0&&e.restartEmissionCycle();for(let _=0;_0;x++)e.update(r,"off"),b.push(e.capture());(v=b[b.length-1])!=null&&v.length&&b.push([]),Gb(u,z$(b,a.end))}const g=Xi(u[u.length-1]||[]);for(u.length>i&&(u.length=i);u.length{var a;return String(((a=o==null?void 0:o.data)==null?void 0:a.name)||"")}):null}catch{return null}}getSlotLocalMatrix(e,t){var o,a,c;const i=(o=this.entries.get(e))==null?void 0:o.spine,s=(c=(a=i==null?void 0:i.skeleton)==null?void 0:a.findSlot)==null?void 0:c.call(a,t),r=s==null?void 0:s.bone;return r!=null&&r.active?new Bt(r.a,r.c,-r.b,-r.d,r.worldX,r.worldY):null}getSlotParentMatrix(e,t,i){const s=this.getSlotLocalMatrix(e,t);if(!s)return null;const r=-i.rotation*Math.PI/180,o=Math.cos(r),a=Math.sin(r);return new Bt(o*i.scaleX,a*i.scaleX,-a*i.scaleY,o*i.scaleY,i.x,-i.y).append(s)}attachSlotObject(e,t,i,s){var o;const r=(o=this.entries.get(e))==null?void 0:o.spine;if(!(r!=null&&r.addSlotObject))return!1;try{return r.addSlotObject(t,i,{followAttachmentTimeline:s}),!0}catch{return!1}}detachSlotObject(e,t,i){var r,o;const s=(r=this.entries.get(e))==null?void 0:r.spine;try{(o=s==null?void 0:s.removeSlotObject)==null||o.call(s,t,i)}catch{}}destroyEntry(e){var t,i;try{(i=(t=e.spine)==null?void 0:t.removeSlotObjects)==null||i.call(t)}catch{}this.container.removeChild(e.root),e.root.destroy({children:!0})}sync(e,t,i){var s;for(const[r,o]of this.entries)e.some(a=>a.id===r)||(this.destroyEntry(o),this.entries.delete(r));for(const r of e){const o=cF(r.id);let a=this.entries.get(r.id);if(a&&a.assetVersion!==r.assetVersion&&!o&&(this.destroyEntry(a),this.entries.delete(r.id),a=void 0),(!a||a.assetVersion!==r.assetVersion)&&o){a&&this.destroyEntry(a);const d=new Mi,f=new o.SpineClass({skeletonData:o.skeletonData,autoUpdate:!1,darkTint:!1});o.skeletonData.defaultSkin&&f.skeleton.setSkin(o.skeletonData.defaultSkin),o.runtimeVersion==="4.3"?f.skeleton.setupPoseSlots():f.skeleton.setSlotsToSetupPose(),d.addChild(f),this.container.addChild(d),a={root:d,spine:f,runtimeVersion:o.runtimeVersion,assetVersion:r.assetVersion,animation:""},this.entries.set(r.id,a)}if(!a)continue;const c=a.root,l=a.spine,h=r.visible!==!1&&r.enabled;c.visible=h,c.renderable=h,c.position.set(r.x,-r.y),c.rotation=-r.rotation*Math.PI/180,c.scale.set(r.scaleX,r.scaleY),a.animation!==r.selectedAnimation&&(a.animation=r.selectedAnimation,a.runtimeVersion==="4.3"?l.skeleton.setupPose():l.skeleton.setToSetupPose(),l.state.clearTracks(),a.animation&&l.state.setAnimation(0,a.animation,!1));const u=a.runtimeVersion==="4.3"?l.state.getTrack(0):l.state.getCurrent(0);if(u){const d=((s=r.animations.find(m=>m.name===r.selectedAnimation))==null?void 0:s.duration)||0,f=Math.max(0,t/Math.max(1,i)-r.timeOffset);u.trackTime=d>0?Math.min(f,d):f}l.update(0)}}getBoneWorldTransform(e,t){const i=this.entries.get(e),s=i==null?void 0:i.spine.skeleton.findBone(t);if(!i||!s||!s.active)return null;const r=i.runtimeVersion==="4.3"?s.appliedPose:s,o=i.root,a=Math.cos(o.rotation),c=Math.sin(o.rotation),l=a*o.scale.x,h=-c*o.scale.y,u=c*o.scale.x,d=a*o.scale.y,f=l*r.a+h*r.c,m=l*r.b+h*r.d,p=u*r.a+d*r.c,g=u*r.b+d*r.d,v=o.position.x+l*r.worldX+h*r.worldY,b=o.position.y+u*r.worldX+d*r.worldY;return{x:v,y:-b,rotation:-Math.atan2(p,f)*180/Math.PI,scaleX:Math.max(1e-4,Math.hypot(f,p)),scaleY:Math.max(1e-4,Math.hypot(m,g))}}destroy(){for(const e of this.entries.values())this.destroyEntry(e);this.entries.clear(),this.container.removeFromParent(),this.container.destroy({children:!0})}}let x_=class{constructor(){T(this,"entries",{});T(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 i=0,s=e.length;i1&&(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 Vi){return t.setFromString(e)}},T(Vi,"WHITE",new Vi(1,1,1,1)),T(Vi,"RED",new Vi(1,0,0,1)),T(Vi,"GREEN",new Vi(0,1,0,1)),T(Vi,"BLUE",new Vi(0,0,1,1)),T(Vi,"MAGENTA",new Vi(1,0,1,1)),Vi);var ui;let ke=(ui=class{static clamp(e,t,i){return ei?i:e}static cosDeg(e){return Math.cos(e*ui.degRad)}static sinDeg(e){return Math.sin(e*ui.degRad)}static atan2Deg(e,t){return Math.atan2(e,t)*ui.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 ui.randomTriangularWith(e,t,(e+t)*.5)}static randomTriangularWith(e,t,i){let s=Math.random(),r=t-e;return s<=(i-e)/r?e+Math.sqrt(s*r*(i-e)):t-Math.sqrt((1-s)*r*(t-i))}static isPowerOfTwo(e){return e&&(e&e-1)===0}},T(ui,"PI",3.1415927),T(ui,"PI2",ui.PI*2),T(ui,"invPI2",1/ui.PI2),T(ui,"radiansToDegrees",180/ui.PI),T(ui,"radDeg",ui.radiansToDegrees),T(ui,"degreesToRadians",ui.PI/180),T(ui,"degRad",ui.degreesToRadians),ui);var jn;let Oe=(jn=class{static arrayCopy(e,t,i,s,r){for(let o=t,a=s;o=t?e:jn.setArraySize(e,t,i)}static newArray(e,t){let i=new Array(e);for(let s=0;s0?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 c=t.bone.skeleton,l=t.deform,h=this.vertices,u=this.bones;if(!u){l.length>0&&(h=l);let p=t.bone,g=p.worldX,v=p.worldY,b=p.a,y=p.b,x=p.c,_=p.d;for(let E=i,S=o;S=this.regions.length&&(i=this.regions.length-1);let s=this.regions[i];t.region!=s&&(t.region=s,t.updateRegion())}getPath(e,t){let i=e,s=(this.start+t).toString();for(let r=this.digits-s.length;r>0;r--)i+="0";return i+=s,i}static nextID(){return sr._nextID++}},T(sr,"_nextID",0),sr);var Oi;(function(n){n[n.hold=0]="hold",n[n.once=1]="once",n[n.loop=2]="loop",n[n.pingpong=3]="pingpong",n[n.onceReverse=4]="onceReverse",n[n.loopReverse=5]="loopReverse",n[n.pingpongReverse=6]="pingpongReverse"})(Oi||(Oi={}));const __=[Oi.hold,Oi.once,Oi.loop,Oi.pingpong,Oi.onceReverse,Oi.loopReverse,Oi.pingpongReverse];let Hg=class{constructor(e,t,i){T(this,"name");T(this,"timelines",[]);T(this,"timelineIds",new x_);T(this,"duration");if(!e)throw new Error("name cannot be null.");this.name=e,this.setTimelines(t),this.duration=i}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 h=0,u=l.length;ht)return s-1;return i-1}static search(e,t,i){let s=e.length;for(let r=i;rt)return r-i;return s-i}},ks=class extends ti{constructor(t,i,s){super(t,s);T(this,"curves");this.curves=Oe.newFloatArray(t+i*18),this.curves[t-1]=1}setLinear(t){this.curves[t]=0}setStepped(t){this.curves[t]=1}shrink(t){let i=this.getFrameCount()+t*18;if(this.curves.length>i){let s=Oe.newFloatArray(i);Oe.arrayCopy(this.curves,0,s,0,i),this.curves=s}}setBezier(t,i,s,r,o,a,c,l,h,u,d){let f=this.curves,m=this.getFrameCount()+t*18;s==0&&(f[i]=2+m);let p=(r-a*2+l)*.03,g=(o-c*2+h)*.03,v=((a-l)*3-r+u)*.006,b=((c-h)*3-o+d)*.006,y=p*2+v,x=g*2+b,_=(a-r)*.3+p+v*.16666667,E=(c-o)*.3+g+b*.16666667,S=r+_,C=o+E;for(let M=m+18;mt){let h=this.frames[i],u=this.frames[i+s];return u+(t-h)/(o[r]-h)*(o[r+1]-u)}let a=r+18;for(r+=2;r=t){let h=o[r-2],u=o[r-1];return u+(t-h)/(o[r]-h)*(o[r+1]-u)}i+=this.getFrameEntries();let c=o[a-2],l=o[a-1];return l+(t-c)/(this.frames[i]-c)*(this.frames[i+s]-l)}},is=class extends ks{constructor(e,t,i){super(e,t,[i])}getFrameEntries(){return 2}setFrame(e,t,i){e<<=1,this.frames[e]=t,this.frames[e+1]=i}getCurveValue(e){let t=this.frames,i=t.length-2;for(let r=2;r<=i;r+=2)if(t[r]>e){i=r-2;break}let s=this.curves[i>>1];switch(s){case 0:let r=t[i],o=t[i+1];return o+(e-r)/(t[i+2]-r)*(t[i+2+1]-o);case 1:return t[i+1]}return this.getBezierValue(e,i,1,s-2)}getRelativeValue(e,t,i,s,r){if(e>2];switch(g){case 0:let v=h[p];d=h[p+1],f=h[p+2],m=h[p+3];let b=(s-v)/(h[p+4]-v);d+=(h[p+4+1]-d)*b,f+=(h[p+4+2]-f)*b,m+=(h[p+4+3]-m)*b;break;case 1:d=h[p+1],f=h[p+2],m=h[p+3];break;default:d=this.getBezierValue(s,p,1,g-2),f=this.getBezierValue(s,p,2,g+18-2),m=this.getBezierValue(s,p,3,g+36-2)}if(o==1)u.r=d,u.g=f,u.b=m;else{if(a==we.setup){let v=l.data.color;u.r=v.r,u.g=v.g,u.b=v.b}u.r+=(d-u.r)*o,u.g+=(f-u.g)*o,u.b+=(m-u.b)*o}}},$_=class extends is{constructor(t,i,s){super(t,i,ft.alpha+"|"+s);T(this,"slotIndex",0);this.slotIndex=s}apply(t,i,s,r,o,a,c){let l=t.slots[this.slotIndex];if(!l.bone.active)return;let h=l.color;if(s>3];switch(_){case 0:let E=h[x];f=h[x+1],m=h[x+2],p=h[x+3],g=h[x+4],v=h[x+5],b=h[x+6],y=h[x+7];let S=(s-E)/(h[x+8]-E);f+=(h[x+8+1]-f)*S,m+=(h[x+8+2]-m)*S,p+=(h[x+8+3]-p)*S,g+=(h[x+8+4]-g)*S,v+=(h[x+8+5]-v)*S,b+=(h[x+8+6]-b)*S,y+=(h[x+8+7]-y)*S;break;case 1:f=h[x+1],m=h[x+2],p=h[x+3],g=h[x+4],v=h[x+5],b=h[x+6],y=h[x+7];break;default:f=this.getBezierValue(s,x,1,_-2),m=this.getBezierValue(s,x,2,_+18-2),p=this.getBezierValue(s,x,3,_+36-2),g=this.getBezierValue(s,x,4,_+54-2),v=this.getBezierValue(s,x,5,_+72-2),b=this.getBezierValue(s,x,6,_+90-2),y=this.getBezierValue(s,x,7,_+108-2)}if(o==1)u.set(f,m,p,g),d.r=v,d.g=b,d.b=y;else{if(a==we.setup){u.setFromColor(l.data.color);let E=l.data.darkColor;d.r=E.r,d.g=E.g,d.b=E.b}u.add((f-u.r)*o,(m-u.g)*o,(p-u.b)*o,(g-u.a)*o),d.r+=(v-d.r)*o,d.g+=(b-d.g)*o,d.b+=(y-d.b)*o}}},D_=class extends ks{constructor(t,i,s){super(t,i,[ft.rgb+"|"+s,ft.rgb2+"|"+s]);T(this,"slotIndex",0);this.slotIndex=s}getFrameEntries(){return 7}setFrame(t,i,s,r,o,a,c,l){t*=7,this.frames[t]=i,this.frames[t+1]=s,this.frames[t+2]=r,this.frames[t+3]=o,this.frames[t+4]=a,this.frames[t+5]=c,this.frames[t+6]=l}apply(t,i,s,r,o,a,c){let l=t.slots[this.slotIndex];if(!l.bone.active)return;let h=this.frames,u=l.color,d=l.darkColor;if(st){let l=this.frames[i];return s[r+1]*(t-l)/(s[r]-l)}let o=r+18;for(r+=2;r=t){let l=s[r-2],h=s[r-1];return h+(t-l)/(s[r]-l)*(s[r+1]-h)}let a=s[o-2],c=s[o-1];return c+(1-c)*(t-a)/(this.frames[i+this.getFrameEntries()]-a)}apply(t,i,s,r,o,a,c){let l=t.slots[this.slotIndex];if(!l.bone.active)return;let h=l.getAttachment();if(!h||!(h instanceof pr)||h.timelineAttachment!=this.attachment)return;let u=l.deform;u.length==0&&(a=we.setup);let d=this.vertices,f=d[0].length,m=this.frames;if(s=m[m.length-1]){let x=d[m.length-1];if(o==1)if(a==we.add){let _=h;if(_.bones)for(let E=0;Es)this.apply(t,i,Number.MAX_VALUE,r,o,a,c),i=-1;else if(i>=l[h-1])return;if(s0&&l[u-1]==d;)u--}for(;u=l[u];u++)r.push(this.events[u])}},T(Ao,"propertyIds",[""+ft.event]),Ao);var Io;let Fl=(Io=class extends ti{constructor(t){super(t,Io.propertyIds);T(this,"drawOrders");this.drawOrders=new Array(t)}getFrameCount(){return this.frames.length}setFrame(t,i,s){this.frames[t]=i,this.drawOrders[t]=s}apply(t,i,s,r,o,a,c){if(c==Hi.mixOut){a==we.setup&&Oe.arrayCopy(t.slots,0,t.drawOrder,0,t.slots.length);return}if(s>2];switch(p){case 0:let g=h[m];u=h[m+1],d=h[m+2],f=h[m+3];let v=(s-g)/(h[m+4]-g);u+=(h[m+4+1]-u)*v,d+=(h[m+4+2]-d)*v,f+=(h[m+4+3]-f)*v;break;case 1:u=h[m+1],d=h[m+2],f=h[m+3];break;default:u=this.getBezierValue(s,m,1,p-2),d=this.getBezierValue(s,m,2,p+18-2),f=this.getBezierValue(s,m,3,p+36-2)}if(a==we.setup){let g=l.data;l.mixRotate=g.mixRotate+(u-g.mixRotate)*o,l.mixX=g.mixX+(d-g.mixX)*o,l.mixY=g.mixY+(f-g.mixY)*o}else l.mixRotate+=(u-l.mixRotate)*o,l.mixX+=(d-l.mixX)*o,l.mixY+=(f-l.mixY)*o}},zo=class extends is{constructor(t,i,s,r){super(t,i,r+"|"+s);T(this,"constraintIndex",0);this.constraintIndex=s}apply(t,i,s,r,o,a,c){let l;if(this.constraintIndex==-1){const h=s>=this.frames[0]?this.getCurveValue(s):0;for(const u of t.physicsConstraints)u.active&&this.global(u.data)&&this.set(u,this.getAbsoluteValue2(s,o,a,this.get(u),this.setup(u),h))}else l=t.physicsConstraints[this.constraintIndex],l.active&&this.set(l,this.getAbsoluteValue(s,o,a,this.get(l),this.setup(l)))}},H_=class extends zo{constructor(e,t,i){super(e,t,i,ft.physicsConstraintInertia)}setup(e){return e.data.inertia}get(e){return e.inertia}set(e,t){e.inertia=t}global(e){return e.inertiaGlobal}},j_=class extends zo{constructor(e,t,i){super(e,t,i,ft.physicsConstraintStrength)}setup(e){return e.data.strength}get(e){return e.strength}set(e,t){e.strength=t}global(e){return e.strengthGlobal}},W_=class extends zo{constructor(e,t,i){super(e,t,i,ft.physicsConstraintDamping)}setup(e){return e.data.damping}get(e){return e.damping}set(e,t){e.damping=t}global(e){return e.dampingGlobal}},z_=class extends zo{constructor(e,t,i){super(e,t,i,ft.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}},q_=class extends zo{constructor(e,t,i){super(e,t,i,ft.physicsConstraintWind)}setup(e){return e.data.wind}get(e){return e.wind}set(e,t){e.wind=t}global(e){return e.windGlobal}},K_=class extends zo{constructor(e,t,i){super(e,t,i,ft.physicsConstraintGravity)}setup(e){return e.data.gravity}get(e){return e.gravity}set(e,t){e.gravity=t}global(e){return e.gravityGlobal}},J_=class extends zo{constructor(e,t,i){super(e,t,i,ft.physicsConstraintMix)}setup(e){return e.data.mix}get(e){return e.mix}set(e,t){e.mix=t}global(e){return e.mixGlobal}};var Po;let Z_=(Po=class extends ti{constructor(t,i){super(t,Po.propertyIds);T(this,"constraintIndex");this.constraintIndex=i}getFrameCount(){return this.frames.length}setFrame(t,i){this.frames[t]=i}apply(t,i,s,r,o,a,c){let l;if(this.constraintIndex!=-1&&(l=t.physicsConstraints[this.constraintIndex],!l.active))return;const h=this.frames;if(i>s)this.apply(t,i,Number.MAX_VALUE,[],o,a,c),i=-1;else if(i>=h[h.length-1])return;if(!(s=h[ti.search1(h,i)+1]))if(l!=null)l.reset();else for(const u of t.physicsConstraints)u.active&&u.reset()}},T(Po,"propertyIds",[ft.physicsConstraintReset.toString()]),Po);var Ji;let Q_=(Ji=class extends ti{constructor(t,i,s){super(t,[ft.sequence+"|"+i+"|"+s.sequence.id]);T(this,"slotIndex");T(this,"attachment");this.slotIndex=i,this.attachment=s}getFrameEntries(){return Ji.ENTRIES}getSlotIndex(){return this.slotIndex}getAttachment(){return this.attachment}setFrame(t,i,s,r,o){let a=this.frames;t*=Ji.ENTRIES,a[t]=i,a[t+Ji.MODE]=s|r<<4,a[t+Ji.DELAY]=o}apply(t,i,s,r,o,a,c){let l=t.slots[this.slotIndex];if(!l.bone.active)return;let h=l.attachment,u=this.attachment;if(h!=u&&(!(h instanceof pr)||h.timelineAttachment!=u))return;if(c==Hi.mixOut){a==we.setup&&(l.sequenceIndex=-1);return}let d=this.frames;if(s>4,b=this.attachment.sequence.regions.length,y=__[p&15];if(y!=Oi.hold)switch(v+=(s-m)/g+1e-5|0,y){case Oi.once:v=Math.min(b-1,v);break;case Oi.loop:v%=b;break;case Oi.pingpong:{let x=(b<<1)-2;v=x==0?0:v%x,v>=b&&(v=x-v);break}case Oi.onceReverse:v=Math.max(b-1-v,0);break;case Oi.loopReverse:v=b-1-v%b;break;case Oi.pingpongReverse:{let x=(b<<1)-2;v=x==0?0:(v+b-1)%x,v>=b&&(v=x-v)}}l.sequenceIndex=v}},T(Ji,"ENTRIES",3),T(Ji,"MODE",1),T(Ji,"DELAY",2),Ji);var rr;let J$=(rr=class{constructor(e){T(this,"data");T(this,"tracks",new Array);T(this,"timeScale",1);T(this,"unkeyedState",0);T(this,"events",new Array);T(this,"listeners",new Array);T(this,"queue",new Q$(this));T(this,"propertyIDs",new x_);T(this,"animationsChanged",!1);T(this,"trackEntryPool",new fu(()=>new Z$));this.data=e}static emptyAnimation(){return rr._emptyAnimation}update(e){e*=this.timeScale;let t=this.tracks;for(let i=0,s=t.length;i0){if(r.delay-=o,r.delay>0)continue;o=-r.delay,r.delay=0}let a=r.next;if(a){let c=r.trackLast-a.delay;if(c>=0){for(a.delay=0,a.trackTime+=r.timeScale==0?0:(c/r.timeScale+e)*a.timeScale,r.trackTime+=o,this.setCurrent(i,a,!0);a.mixingFrom;)a.mixTime+=e,a=a.mixingFrom;continue}}else if(r.trackLast>=r.trackEnd&&!r.mixingFrom){t[i]=null,this.queue.end(r),this.clearNext(r);continue}if(r.mixingFrom&&this.updateMixingFrom(r,e)){let c=r.mixingFrom;for(r.mixingFrom=null,c&&(c.mixingTo=null);c;)this.queue.end(c),c=c.mixingFrom}r.trackTime+=o}this.queue.drain()}updateMixingFrom(e,t){let i=e.mixingFrom;if(!i)return!0;let s=this.updateMixingFrom(i,t);return i.animationLast=i.nextAnimationLast,i.trackLast=i.nextTrackLast,e.nextTrackLast!=-1&&e.mixTime>=e.mixDuration?((i.totalAlpha==0||e.mixDuration==0)&&(e.mixingFrom=i.mixingFrom,i.mixingFrom!=null&&(i.mixingFrom.mixingTo=e),e.interruptAlpha=i.interruptAlpha,this.queue.end(i)),s):(i.trackTime+=t*i.timeScale,e.mixTime+=t,!1)}apply(e){if(!e)throw new Error("skeleton cannot be null.");this.animationsChanged&&this._animationsChanged();let t=this.events,i=this.tracks,s=!1;for(let d=0,f=i.length;d0)continue;s=!0;let p=d==0?we.first:m.mixBlend,g=m.alpha;m.mixingFrom?g*=this.applyMixingFrom(m,e,p):m.trackTime>=m.trackEnd&&!m.next&&(g=0);let v=g>=m.alphaAttachmentThreshold,b=m.animationLast,y=m.getAnimationTime(),x=y,_=t;m.reverse&&(x=m.animation.duration-x,_=null);let E=m.animation.timelines,S=E.length;if(d==0&&g==1||p==we.add){d==0&&(v=!0);for(let C=0;C1&&(r=1),i!=we.first&&(i=s.mixBlend));let o=r=s.alphaAttachmentThreshold):(a&&_ instanceof Fl&&S==we.setup&&(E=Hi.mixIn),_.apply(t,d,m,p,C,S,E))}}return e.mixDuration>0&&this.queueEvents(s,f),this.events.length=0,s.nextAnimationLast=f,s.nextTrackLast=s.trackTime,r}applyAttachmentTimeline(e,t,i,s,r){var o=t.slots[e.slotIndex];o.bone.active&&(i=0,y=p>=0;Math.abs(g)<=90&&ke.signum(g)!=ke.signum(m)&&(Math.abs(p-v)>180?(f+=360*ke.signum(p),y=b):v!=0?f-=360*ke.signum(p):y=b),y!=b&&(f+=360*ke.signum(p)),o[a]=f}o[a+1]=m,l.rotation=u+f*s}queueEvents(e,t){let i=e.animationStart,s=e.animationEnd,r=s-i,o=e.trackLast%r,a=this.events,c=0,l=a.length;for(;cs||this.queue.event(e,u)}let h=!1;if(e.loop)if(r==0)h=!0;else{const u=Math.floor(e.trackTime/r);h=u>0&&u>Math.floor(e.trackLast/r)}else h=t>=s&&e.animationLast=this.tracks.length)return;let t=this.tracks[e];if(!t)return;this.queue.end(t),this.clearNext(t);let i=t;for(;;){let s=i.mixingFrom;if(!s)break;this.queue.end(s),i.mixingFrom=null,i.mixingTo=null,i=s}this.tracks[t.trackIndex]=null,this.queue.drain()}setCurrent(e,t,i){let s=this.expandToIndex(e);this.tracks[e]=t,t.previous=null,s&&(i&&this.queue.interrupt(s),t.mixingFrom=s,s.mixingTo=t,t.mixTime=0,s.mixingFrom&&s.mixDuration>0&&(t.interruptAlpha*=Math.min(1,s.mixTime/s.mixDuration)),s.timelinesRotation.length=0),this.queue.start(t)}setAnimation(e,t,i=!1){let s=this.data.skeletonData.findAnimation(t);if(!s)throw new Error("Animation not found: "+t);return this.setAnimationWith(e,s,i)}setAnimationWith(e,t,i=!1){if(!t)throw new Error("animation cannot be null.");let s=!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,s=!1):this.clearNext(r));let o=this.trackEntry(e,t,i,r);return this.setCurrent(e,o,s),this.queue.drain(),o}addAnimation(e,t,i=!1,s=0){let r=this.data.skeletonData.findAnimation(t);if(!r)throw new Error("Animation not found: "+t);return this.addAnimationWith(e,r,i,s)}addAnimationWith(e,t,i=!1,s=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,i,r);return r?(r.next=o,o.previous=r,s<=0&&(s=Math.max(s+r.getTrackComplete()-o.mixDuration,0))):(this.setCurrent(e,o,!0),this.queue.drain(),s<0&&(s=0)),o.delay=s,o}setEmptyAnimation(e,t=0){let i=this.setAnimationWith(e,rr.emptyAnimation(),!1);return i.mixDuration=t,i.trackEnd=t,i}addEmptyAnimation(e,t=0,i=0){let s=this.addAnimationWith(e,rr.emptyAnimation(),!1,i);return i<=0&&(s.delay=Math.max(s.delay+s.mixDuration-t,0)),s.mixDuration=t,s.trackEnd=t,s}setEmptyAnimations(e=0){let t=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(let i=0,s=this.tracks.length;i0){r[c]=eN,o[c]=u;continue e}break}r[c]=fm}}}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()}},T(rr,"_emptyAnimation",new Hg("",[],0)),rr),Z$=class{constructor(){T(this,"animation",null);T(this,"previous",null);T(this,"next",null);T(this,"mixingFrom",null);T(this,"mixingTo",null);T(this,"listener",null);T(this,"trackIndex",0);T(this,"loop",!1);T(this,"holdPrevious",!1);T(this,"reverse",!1);T(this,"shortestRotation",!1);T(this,"eventThreshold",0);T(this,"mixAttachmentThreshold",0);T(this,"alphaAttachmentThreshold",0);T(this,"mixDrawOrderThreshold",0);T(this,"animationStart",0);T(this,"animationEnd",0);T(this,"animationLast",0);T(this,"nextAnimationLast",0);T(this,"delay",0);T(this,"trackTime",0);T(this,"trackLast",0);T(this,"nextTrackLast",0);T(this,"trackEnd",0);T(this,"timeScale",0);T(this,"alpha",0);T(this,"mixTime",0);T(this,"_mixDuration",0);T(this,"interruptAlpha",0);T(this,"totalAlpha",0);T(this,"mixBlend",we.replace);T(this,"timelineMode",new Array);T(this,"timelineHoldMix",new Array);T(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}},Q$=class{constructor(e){T(this,"objects",[]);T(this,"drainDisabled",!1);T(this,"animState");this.animState=e}start(e){this.objects.push(an.start),this.objects.push(e),this.animState.animationsChanged=!0}interrupt(e){this.objects.push(an.interrupt),this.objects.push(e)}end(e){this.objects.push(an.end),this.objects.push(e),this.animState.animationsChanged=!0}dispose(e){this.objects.push(an.dispose),this.objects.push(e)}complete(e){this.objects.push(an.complete),this.objects.push(e)}event(e,t){this.objects.push(an.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{h.width=parseInt(i[1]),h.height=parseInt(i[2])},s.format=()=>{},s.filter=h=>{h.minFilter=Oe.enumValue(Ai,i[1]),h.magFilter=Oe.enumValue(Ai,i[2])},s.repeat=h=>{i[1].indexOf("x")!=-1&&(h.uWrap=cr.Repeat),i[1].indexOf("y")!=-1&&(h.vWrap=cr.Repeat)},s.pma=h=>{h.pma=i[1]=="true"};var r={};r.xy=h=>{h.x=parseInt(i[1]),h.y=parseInt(i[2])},r.size=h=>{h.width=parseInt(i[1]),h.height=parseInt(i[2])},r.bounds=h=>{h.x=parseInt(i[1]),h.y=parseInt(i[2]),h.width=parseInt(i[3]),h.height=parseInt(i[4])},r.offset=h=>{h.offsetX=parseInt(i[1]),h.offsetY=parseInt(i[2])},r.orig=h=>{h.originalWidth=parseInt(i[1]),h.originalHeight=parseInt(i[2])},r.offsets=h=>{h.offsetX=parseInt(i[1]),h.offsetY=parseInt(i[2]),h.originalWidth=parseInt(i[3]),h.originalHeight=parseInt(i[4])},r.rotate=h=>{let u=i[1];u=="true"?h.degrees=90:u!="false"&&(h.degrees=parseInt(u))},r.index=h=>{h.index=parseInt(i[1])};let o=t.readLine();for(;o&&o.trim().length==0;)o=t.readLine();for(;!(!o||o.trim().length==0||t.readEntry(i,o)==0);)o=t.readLine();let a=null,c=null,l=null;for(;o!==null;)if(o.trim().length==0)a=null,o=t.readLine();else if(a){let h=new sT(a,o);for(;;){let u=t.readEntry(i,o=t.readLine());if(u==0)break;let d=r[i[0]];if(d)d(h);else{c||(c=[]),l||(l=[]),c.push(i[0]);let f=[];for(let m=0;m0&&l&&l.length>0&&(h.names=c,h.values=l,c=null,l=null),h.u=h.x/a.width,h.v=h.y/a.height,h.degrees==90?(h.u2=(h.x+h.height)/a.width,h.v2=(h.y+h.width)/a.height):(h.u2=(h.x+h.width)/a.width,h.v2=(h.y+h.height)/a.height),this.regions.push(h)}else{for(a=new oN(o.trim());t.readEntry(i,o=t.readLine())!=0;){let h=s[i[0]];h&&h(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 i=t.indexOf(":");if(i==-1)return 0;e[0]=t.substr(0,i).trim();for(let s=1,r=i+1;;s++){let o=t.indexOf(",",r);if(o==-1)return e[s]=t.substr(r).trim(),s;if(e[s]=t.substr(r,o-r).trim(),r=o+1,s==4)return 4}}},oN=class{constructor(e){T(this,"name");T(this,"minFilter",Ai.Nearest);T(this,"magFilter",Ai.Nearest);T(this,"uWrap",cr.ClampToEdge);T(this,"vWrap",cr.ClampToEdge);T(this,"texture",null);T(this,"width",0);T(this,"height",0);T(this,"pma",!1);T(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}},sT=class extends sN{constructor(t,i){super();T(this,"page");T(this,"name");T(this,"x",0);T(this,"y",0);T(this,"offsetX",0);T(this,"offsetY",0);T(this,"originalWidth",0);T(this,"originalHeight",0);T(this,"index",0);T(this,"degrees",0);T(this,"names",null);T(this,"values",null);this.page=t,this.name=i,t.regions.push(this)}},bc=class Pp extends pr{constructor(t,i){super(t);T(this,"region",null);T(this,"path");T(this,"regionUVs",[]);T(this,"uvs",[]);T(this,"triangles",[]);T(this,"color",new ut(1,1,1,1));T(this,"width",0);T(this,"height",0);T(this,"hullLength",0);T(this,"edges",[]);T(this,"parentMesh",null);T(this,"sequence",null);T(this,"tempColor",new ut(0,0,0,0));this.path=i}updateRegion(){if(!this.region)throw new Error("Region not set.");let t=this.regionUVs;(!this.uvs||this.uvs.length!=t.length)&&(this.uvs=Oe.newFloatArray(t.length));let i=this.uvs,s=this.uvs.length,r=this.region.u,o=this.region.v,a=0,c=0;if(this.region instanceof sT){let l=this.region,h=l.page,u=h.width,d=h.height;switch(l.degrees){case 90:r-=(l.originalHeight-l.offsetY-l.height)/u,o-=(l.originalWidth-l.offsetX-l.width)/d,a=l.originalHeight/u,c=l.originalWidth/d;for(let f=0;f= 0.");if(!t)throw new Error("name cannot be null.");this.index=e,this.name=t,this.parent=i}};var oi;(function(n){n[n.Normal=0]="Normal",n[n.OnlyTranslation=1]="OnlyTranslation",n[n.NoRotationOrReflection=2]="NoRotationOrReflection",n[n.NoScale=3]="NoScale",n[n.NoScaleOrReflection=4]="NoScaleOrReflection"})(oi||(oi={}));let qb=class{constructor(e,t,i){T(this,"data");T(this,"skeleton");T(this,"parent",null);T(this,"children",new Array);T(this,"x",0);T(this,"y",0);T(this,"rotation",0);T(this,"scaleX",0);T(this,"scaleY",0);T(this,"shearX",0);T(this,"shearY",0);T(this,"ax",0);T(this,"ay",0);T(this,"arotation",0);T(this,"ascaleX",0);T(this,"ascaleY",0);T(this,"ashearX",0);T(this,"ashearY",0);T(this,"a",0);T(this,"b",0);T(this,"c",0);T(this,"d",0);T(this,"worldY",0);T(this,"worldX",0);T(this,"inherit",oi.Normal);T(this,"sorted",!1);T(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=i,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,i,s,r,o,a){this.ax=e,this.ay=t,this.arotation=i,this.ascaleX=s,this.ascaleY=r,this.ashearX=o,this.ashearY=a;let c=this.parent;if(!c){let f=this.skeleton;const m=f.scaleX,p=f.scaleY,g=(i+o)*ke.degRad,v=(i+90+a)*ke.degRad;this.a=Math.cos(g)*s*m,this.b=Math.cos(v)*r*m,this.c=Math.sin(g)*s*p,this.d=Math.sin(v)*r*p,this.worldX=e*m+f.x,this.worldY=t*p+f.y;return}let l=c.a,h=c.b,u=c.c,d=c.d;switch(this.worldX=l*e+h*t+c.worldX,this.worldY=u*e+d*t+c.worldY,this.inherit){case oi.Normal:{const f=(i+o)*ke.degRad,m=(i+90+a)*ke.degRad,p=Math.cos(f)*s,g=Math.cos(m)*r,v=Math.sin(f)*s,b=Math.sin(m)*r;this.a=l*p+h*v,this.b=l*g+h*b,this.c=u*p+d*v,this.d=u*g+d*b;return}case oi.OnlyTranslation:{const f=(i+o)*ke.degRad,m=(i+90+a)*ke.degRad;this.a=Math.cos(f)*s,this.b=Math.cos(m)*r,this.c=Math.sin(f)*s,this.d=Math.sin(m)*r;break}case oi.NoRotationOrReflection:{let f=1/this.skeleton.scaleX,m=1/this.skeleton.scaleY;l*=f,u*=m;let p=l*l+u*u,g=0;p>1e-4?(p=Math.abs(l*d*m-h*f*u)/p,h=u*p,d=l*p,g=Math.atan2(u,l)*ke.radDeg):(l=0,u=0,g=90-Math.atan2(d,h)*ke.radDeg);const v=(i+o-g)*ke.degRad,b=(i+a-g+90)*ke.degRad,y=Math.cos(v)*s,x=Math.cos(b)*r,_=Math.sin(v)*s,E=Math.sin(b)*r;this.a=l*y-h*_,this.b=l*x-h*E,this.c=u*y+d*_,this.d=u*x+d*E;break}case oi.NoScale:case oi.NoScaleOrReflection:{i*=ke.degRad;const f=Math.cos(i),m=Math.sin(i);let p=(l*f+h*m)/this.skeleton.scaleX,g=(u*f+d*m)/this.skeleton.scaleY,v=Math.sqrt(p*p+g*g);v>1e-5&&(v=1/v),p*=v,g*=v,v=Math.sqrt(p*p+g*g),this.inherit==oi.NoScale&&l*d-h*u<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY<0)&&(v=-v),i=Math.PI/2+Math.atan2(g,p);const b=Math.cos(i)*v,y=Math.sin(i)*v;o*=ke.degRad,a=(90+a)*ke.degRad;const x=Math.cos(o)*s,_=Math.cos(a)*r,E=Math.sin(o)*s,S=Math.sin(a)*r;this.a=p*x+b*E,this.b=p*_+b*S,this.c=g*x+y*E,this.d=g*_+y*S;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,i=e.b,s=e.c,r=e.d,o=1/(t*r-i*s),a=r*o,c=i*o,l=s*o,h=t*o,u=this.worldX-e.worldX,d=this.worldY-e.worldY;this.ax=u*a-d*c,this.ay=d*h-u*l;let f,m,p,g;if(this.inherit==oi.OnlyTranslation)f=this.a,m=this.b,p=this.c,g=this.d;else{switch(this.inherit){case oi.NoRotationOrReflection:{let _=Math.abs(t*r-i*s)/(t*t+s*s);i=-s*this.skeleton.scaleX*_/this.skeleton.scaleY,r=t*this.skeleton.scaleY*_/this.skeleton.scaleX,o=1/(t*r-i*s),a=r*o,c=i*o;break}case oi.NoScale:case oi.NoScaleOrReflection:let v=ke.cosDeg(this.rotation),b=ke.sinDeg(this.rotation);t=(t*v+i*b)/this.skeleton.scaleX,s=(s*v+r*b)/this.skeleton.scaleY;let y=Math.sqrt(t*t+s*s);y>1e-5&&(y=1/y),t*=y,s*=y,y=Math.sqrt(t*t+s*s),this.inherit==oi.NoScale&&o<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY<0)&&(y=-y);let x=ke.PI/2+Math.atan2(s,t);i=Math.cos(x)*y,r=Math.sin(x)*y,o=1/(t*r-i*s),a=r*o,c=i*o,l=s*o,h=t*o}f=a*this.a-c*this.c,m=a*this.b-c*this.d,p=h*this.c-l*this.a,g=h*this.d-l*this.b}if(this.ashearX=0,this.ascaleX=Math.sqrt(f*f+p*p),this.ascaleX>1e-4){let v=f*g-m*p;this.ascaleY=v/this.ascaleX,this.ashearY=-Math.atan2(f*m+p*g,v)*ke.radDeg,this.arotation=Math.atan2(p,f)*ke.radDeg}else this.ascaleX=0,this.ascaleY=Math.sqrt(m*m+g*g),this.ashearY=0,this.arotation=90-Math.atan2(g,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),i=e.x-this.worldX,s=e.y-this.worldY;return e.x=i*this.d*t-s*this.b*t,e.y=s*this.a*t-i*this.c*t,e}localToWorld(e){let t=e.x,i=e.y;return e.x=t*this.a+i*this.b+this.worldX,e.y=t*this.c+i*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),i=ke.cosDeg(e);return Math.atan2(this.a*t-this.c*i,this.d*i-this.b*t)*ke.radDeg+this.rotation-this.shearX}localToWorldRotation(e){e-=this.rotation-this.shearX;let t=ke.sinDeg(e),i=ke.cosDeg(e);return Math.atan2(i*this.c+t*this.d,i*this.a+t*this.b)*ke.radDeg}rotateWorld(e){e*=ke.degRad;const t=Math.sin(e),i=Math.cos(e),s=this.a,r=this.b;this.a=i*s-t*this.c,this.b=i*r-t*this.d,this.c=t*s+i*this.c,this.d=t*r+i*this.d}},fd=class{constructor(e,t,i){T(this,"name");T(this,"order");T(this,"skinRequired");this.name=e,this.order=t,this.skinRequired=i}},cT=class{constructor(e,t){T(this,"data");T(this,"intValue",0);T(this,"floatValue",0);T(this,"stringValue",null);T(this,"time",0);T(this,"volume",0);T(this,"balance",0);if(!t)throw new Error("data cannot be null.");this.time=e,this.data=t}},hT=class{constructor(e){T(this,"name");T(this,"intValue",0);T(this,"floatValue",0);T(this,"stringValue",null);T(this,"audioPath",null);T(this,"volume",0);T(this,"balance",0);this.name=e}},aN=class{constructor(e,t){T(this,"data");T(this,"bones");T(this,"target");T(this,"bendDirection",0);T(this,"compress",!1);T(this,"stretch",!1);T(this,"mix",1);T(this,"softness",0);T(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 s=0;s180?f-=360:f<-180&&(f+=360);let g=e.ascaleX,v=e.ascaleY;if(s||r){switch(e.inherit){case oi.NoScale:case oi.NoScaleOrReflection:m=t-e.worldX,p=i-e.worldY}const b=e.data.length*g;if(b>1e-4){const y=m*m+p*p;if(s&&yb*b){const x=(Math.sqrt(y)/b-1)*a+1;g*=x,o&&(v*=x)}}}e.updateWorldTransformWith(e.ax,e.ay,e.arotation+f*a,g,v,e.ashearX,e.ashearY)}apply2(e,t,i,s,r,o,a,c,l){if(e.inherit!=oi.Normal||t.inherit!=oi.Normal)return;let h=e.ax,u=e.ay,d=e.ascaleX,f=e.ascaleY,m=d,p=f,g=t.ascaleX,v=0,b=0,y=0;d<0?(d=-d,v=180,y=-1):(v=0,y=1),f<0&&(f=-f,y=-y),g<0?(g=-g,b=180):b=0;let x=t.ax,_=0,E=0,S=0,C=e.a,M=e.b,P=e.c,A=e.d,R=Math.abs(d-f)<=1e-4;!R||o?(_=0,E=C*x+e.worldX,S=P*x+e.worldY):(_=t.ay,E=C*x+M*_+e.worldX,S=P*x+A*_+e.worldY);let B=e.parent;if(!B)throw new Error("IK parent must itself have a parent.");C=B.a,M=B.b,P=B.c,A=B.d;let O=C*A-M*P,W=E-B.worldX,V=S-B.worldY;O=Math.abs(O)<=1e-4?0:1/O;let Y=(W*A-V*M)*O-h,L=(V*C-W*P)*O-u,N=Math.sqrt(Y*Y+L*L),F=t.data.length*g,D,X;if(N<1e-4){this.apply1(e,i,s,!1,o,!1,l),t.updateWorldTransformWith(x,_,0,t.ascaleX,t.ascaleY,t.ashearX,t.ashearY);return}W=i-B.worldX,V=s-B.worldY;let G=(W*A-V*M)*O-h,K=(V*C-W*P)*O-u,J=G*G+K*K;if(c!=0){c*=d*(g+1)*.5;let ve=Math.sqrt(J),Se=ve-N-F*d+c;if(Se>0){let fe=Math.min(1,Se/(c*2))-1;fe=(Se-c*(1-fe*fe))/ve,G-=fe*G,K-=fe*K,J=G*G+K*K}}e:if(R){F*=d;let ve=(J-N*N-F*F)/(2*N*F);ve<-1?(ve=-1,X=Math.PI*r):ve>1?(ve=1,X=0,o&&(C=(Math.sqrt(J)/(N+F)-1)*l+1,m*=C,a&&(p*=C))):X=Math.acos(ve)*r,C=N+F*ve,M=F*Math.sin(X),D=Math.atan2(K*C-G*M,G*C+K*M)}else{C=d*F,M=f*F;let ve=C*C,Se=M*M,fe=Math.atan2(K,G);P=Se*N*N+ve*J-ve*Se;let ye=-2*Se*N,q=Se-ve;if(A=ye*ye-4*q*P,A>=0){let ne=Math.sqrt(A);ye<0&&(ne=-ne),ne=-(ye+ne)*.5;let ue=ne/q,xe=P/ne,be=Math.abs(ue)=0){V=Math.sqrt(ue)*r,D=fe-Math.atan2(V,be),X=Math.atan2(V/f,(be-N)/d);break e}}let Z=ke.PI,se=N-C,H=se*se,j=0,$=0,U=N+C,z=U*U,ee=0;P=-C*N/(ve-Se),P>=-1&&P<=1&&(P=Math.acos(P),W=C*Math.cos(P)+N,V=M*Math.sin(P),A=W*W+V*V,Az&&($=P,z=A,U=W,ee=V)),J<=(H+z)*.5?(D=fe-Math.atan2(j*r,se),X=Z*r):(D=fe-Math.atan2(ee*r,U),X=$*r)}let oe=Math.atan2(_,x)*y,le=e.arotation;D=(D-oe)*ke.radDeg+v-le,D>180?D-=360:D<-180&&(D+=360),e.updateWorldTransformWith(h,u,le+D*l,m,p,0,0),le=t.arotation,X=((X+oe)*ke.radDeg-t.ashearX)*y+b-le,X>180?X-=360:X<-180&&(X+=360),t.updateWorldTransformWith(x,_,le+X*l,t.ascaleX,t.ascaleY,t.ashearX,t.ashearY)}},uT=class extends fd{constructor(t){super(t,0,!1);T(this,"bones",new Array);T(this,"_target",null);T(this,"bendDirection",0);T(this,"compress",!1);T(this,"stretch",!1);T(this,"uniform",!1);T(this,"mix",0);T(this,"softness",0)}set target(t){this._target=t}get target(){if(this._target)return this._target;throw new Error("BoneData not set.")}},dT=class extends fd{constructor(t){super(t,0,!1);T(this,"bones",new Array);T(this,"_target",null);T(this,"positionMode",As.Fixed);T(this,"spacingMode",Ti.Fixed);T(this,"rotateMode",No.Chain);T(this,"offsetRotation",0);T(this,"position",0);T(this,"spacing",0);T(this,"mixRotate",0);T(this,"mixX",0);T(this,"mixY",0)}set target(t){this._target=t}get target(){if(this._target)return this._target;throw new Error("SlotData not set.")}};var As;(function(n){n[n.Fixed=0]="Fixed",n[n.Percent=1]="Percent"})(As||(As={}));var Ti;(function(n){n[n.Length=0]="Length",n[n.Fixed=1]="Fixed",n[n.Percent=2]="Percent",n[n.Proportional=3]="Proportional"})(Ti||(Ti={}));var No;(function(n){n[n.Tangent=0]="Tangent",n[n.Chain=1]="Chain",n[n.ChainScale=2]="ChainScale"})(No||(No={}));var Yi;let lN=(Yi=class{constructor(e,t){T(this,"data");T(this,"bones");T(this,"target");T(this,"position",0);T(this,"spacing",0);T(this,"mixRotate",0);T(this,"mixX",0);T(this,"mixY",0);T(this,"spaces",new Array);T(this,"positions",new Array);T(this,"world",new Array);T(this,"curves",new Array);T(this,"lengths",new Array);T(this,"segments",new Array);T(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 s=0,r=e.bones.length;s0){x=u/x*m;for(let E=1;E0?ke.degRad:-.01745329277777778}for(let x=0,_=3;x0){let A=E.a,R=E.b,B=E.c,O=E.d,W=0,V=0,Y=0;if(a?W=p[_-1]:d[x+1]==0?W=p[_+2]:W=Math.atan2(P,M),W-=Math.atan2(B,A),y){V=Math.cos(W),Y=Math.sin(W);let L=E.data.length;g+=(L*(V*A-Y*B)-M)*i,v+=(L*(Y*A+V*B)-P)*i}else W+=b;W>ke.PI?W-=ke.PI2:W<-3.1415927&&(W+=ke.PI2),W*=i,V=Math.cos(W),Y=Math.sin(W),E.a=V*A-Y*B,E.b=V*R-Y*O,E.c=Y*A+V*B,E.d=Y*R+V*O}E.updateAppliedTransform()}}computeWorldPositions(e,t,i){let s=this.target,r=this.position,o=this.spaces,a=Oe.setArraySize(this.positions,t*3+2),c=this.world,l=e.closed,h=e.worldVerticesLength,u=h/6,d=Yi.NONE;if(!e.constantSpeed){let L=e.lengths;u-=l?1:2;let N=L[u];this.data.positionMode==As.Percent&&(r*=N);let F;switch(this.data.spacingMode){case Ti.Percent:F=N;break;case Ti.Proportional:F=N/t;break;default:F=1}c=Oe.setArraySize(this.world,8);for(let D=0,X=0,G=0;DN){d!=Yi.AFTER&&(d=Yi.AFTER,e.computeWorldVertices(s,h-6,4,c,0,2)),this.addAfterPosition(J-N,c,0,a,X);continue}for(;;G++){let oe=L[G];if(!(J>oe)){if(G==0)J/=oe;else{let le=L[G-1];J=(J-le)/(oe-le)}break}}G!=d&&(d=G,l&&G==u?(e.computeWorldVertices(s,h-4,4,c,0,2),e.computeWorldVertices(s,0,4,c,4,2)):e.computeWorldVertices(s,G*6+2,8,c,0,2)),this.addCurvePosition(J,c[0],c[1],c[2],c[3],c[4],c[5],c[6],c[7],a,X,i||D>0&&K==0)}return a}l?(h+=2,c=Oe.setArraySize(this.world,h),e.computeWorldVertices(s,2,h-4,c,0,2),e.computeWorldVertices(s,0,2,c,h-4,2),c[h-2]=c[0],c[h-1]=c[1]):(u--,h-=4,c=Oe.setArraySize(this.world,h),e.computeWorldVertices(s,2,h,c,0,2));let f=Oe.setArraySize(this.curves,u),m=0,p=c[0],g=c[1],v=0,b=0,y=0,x=0,_=0,E=0,S=0,C=0,M=0,P=0,A=0,R=0,B=0,O=0;for(let L=0,N=2;Lm){this.addAfterPosition(G-m,c,h-4,a,N);continue}for(;;F++){let K=f[F];if(!(G>K)){if(F==0)G/=K;else{let J=f[F-1];G=(G-J)/(K-J)}break}}if(F!=d){d=F;let K=F*6;for(p=c[K],g=c[K+1],v=c[K+2],b=c[K+3],y=c[K+4],x=c[K+5],_=c[K+6],E=c[K+7],S=(p-v*2+y)*.03,C=(g-b*2+x)*.03,M=((v-y)*3-p+_)*.006,P=((b-x)*3-g+E)*.006,A=S*2+M,R=C*2+P,B=(v-p)*.3+S+M*.16666667,O=(b-g)*.3+C+P*.16666667,Y=Math.sqrt(B*B+O*O),V[0]=Y,K=1;K<8;K++)B+=A,O+=R,A+=M,R+=P,Y+=Math.sqrt(B*B+O*O),V[K]=Y;B+=A,O+=R,Y+=Math.sqrt(B*B+O*O),V[8]=Y,B+=A+M,O+=R+P,Y+=Math.sqrt(B*B+O*O),V[9]=Y,D=0}for(G*=Y;;D++){let K=V[D];if(!(G>K)){if(D==0)G/=K;else{let J=V[D-1];G=D+(G-J)/(K-J)}break}}this.addCurvePosition(G*.1,p,g,v,b,y,x,_,E,a,N,i||L>0&&X==0)}return a}addBeforePosition(e,t,i,s,r){let o=t[i],a=t[i+1],c=t[i+2]-o,l=t[i+3]-a,h=Math.atan2(l,c);s[r]=o+e*Math.cos(h),s[r+1]=a+e*Math.sin(h),s[r+2]=h}addAfterPosition(e,t,i,s,r){let o=t[i+2],a=t[i+3],c=o-t[i],l=a-t[i+1],h=Math.atan2(l,c);s[r]=o+e*Math.cos(h),s[r+1]=a+e*Math.sin(h),s[r+2]=h}addCurvePosition(e,t,i,s,r,o,a,c,l,h,u,d){if(e==0||isNaN(e)){h[u]=t,h[u+1]=i,h[u+2]=Math.atan2(r-i,s-t);return}let f=e*e,m=f*e,p=1-e,g=p*p,v=g*p,b=p*e,y=b*3,x=p*y,_=y*e,E=t*v+s*x+o*_+c*m,S=i*v+r*x+a*_+l*m;h[u]=E,h[u+1]=S,d&&(e<.001?h[u+2]=Math.atan2(r-i,s-t):h[u+2]=Math.atan2(S-(i*g+r*b*2+a*f),E-(t*g+s*b*2+o*f)))}},T(Yi,"NONE",-1),T(Yi,"BEFORE",-2),T(Yi,"AFTER",-3),T(Yi,"epsilon",1e-5),Yi),cN=class{constructor(e,t){T(this,"data");T(this,"_bone",null);T(this,"inertia",0);T(this,"strength",0);T(this,"damping",0);T(this,"massInverse",0);T(this,"wind",0);T(this,"gravity",0);T(this,"mix",0);T(this,"_reset",!0);T(this,"ux",0);T(this,"uy",0);T(this,"cx",0);T(this,"cy",0);T(this,"tx",0);T(this,"ty",0);T(this,"xOffset",0);T(this,"xVelocity",0);T(this,"yOffset",0);T(this,"yVelocity",0);T(this,"rotateOffset",0);T(this,"rotateVelocity",0);T(this,"scaleOffset",0);T(this,"scaleVelocity",0);T(this,"active",!1);T(this,"skeleton");T(this,"remaining",0);T(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 i=this.data.x>0,s=this.data.y>0,r=this.data.rotate>0||this.data.shearX>0,o=this.data.scaleX>0,a=this.bone,c=a.data.length;switch(e){case Dr.none:return;case Dr.reset:this.reset();case Dr.update:const l=this.skeleton,h=Math.max(this.skeleton.time-this.lastTime,0);this.remaining+=h,this.lastTime=l.time;const u=a.worldX,d=a.worldY;if(this._reset)this._reset=!1,this.ux=u,this.uy=d;else{let f=this.remaining,m=this.inertia,p=this.data.step,g=this.skeleton.data.referenceScale,v=-1,b=this.data.limit*h,y=b*Math.abs(l.scaleY);if(b*=Math.abs(l.scaleX),i||s){if(i){const x=(this.ux-u)*m;this.xOffset+=x>b?b:x<-b?-b:x,this.ux=u}if(s){const x=(this.uy-d)*m;this.yOffset+=x>y?y:x<-y?-y:x,this.uy=d}if(f>=p){v=Math.pow(this.damping,60*p);const x=this.massInverse*p,_=this.strength,E=this.wind*g*l.scaleX,S=this.gravity*g*l.scaleY;do i&&(this.xVelocity+=(E-this.xOffset*_)*x,this.xOffset+=this.xVelocity*p,this.xVelocity*=v),s&&(this.yVelocity-=(S+this.yOffset*_)*x,this.yOffset+=this.yVelocity*p,this.yVelocity*=v),f-=p;while(f>=p)}i&&(a.worldX+=this.xOffset*t*this.data.x),s&&(a.worldY+=this.yOffset*t*this.data.y)}if(r||o){let x=Math.atan2(a.c,a.a),_=0,E=0,S=0,C=this.cx-a.worldX,M=this.cy-a.worldY;if(C>b?C=b:C<-b&&(C=-b),M>y?M=y:M<-y&&(M=-y),r){S=(this.data.rotate+this.data.shearX)*t;let P=Math.atan2(M+this.ty,C+this.tx)-x-this.rotateOffset*S;this.rotateOffset+=(P-Math.ceil(P*ke.invPI2-.5)*ke.PI2)*m,P=this.rotateOffset*S+x,_=Math.cos(P),E=Math.sin(P),o&&(P=c*a.getWorldScaleX(),P>0&&(this.scaleOffset+=(C*_+M*E)*m/P))}else{_=Math.cos(x),E=Math.sin(x);const P=c*a.getWorldScaleX();P>0&&(this.scaleOffset+=(C*_+M*E)*m/P)}if(f=this.remaining,f>=p){v==-1&&(v=Math.pow(this.damping,60*p));const P=this.massInverse*p,A=this.strength,R=this.wind,B=zg.yDown?-this.gravity:this.gravity,O=c/g;for(;;)if(f-=p,o&&(this.scaleVelocity+=(R*_-B*E-this.scaleOffset*A)*P,this.scaleOffset+=this.scaleVelocity*p,this.scaleVelocity*=v),r){if(this.rotateVelocity-=((R*E+B*_)*O+this.rotateOffset*A)*P,this.rotateOffset+=this.rotateVelocity*p,this.rotateVelocity*=v,f0){let f=0;this.data.rotate>0&&(f=l*this.data.rotate,h=Math.sin(f),u=Math.cos(f),d=a.b,a.b=u*d-h*a.d,a.d=h*d+u*a.d),f+=l*this.data.shearX,h=Math.sin(f),u=Math.cos(f),d=a.a,a.a=u*d-h*a.c,a.c=h*d+u*a.c}else l*=this.data.rotate,h=Math.sin(l),u=Math.cos(l),d=a.a,a.a=u*d-h*a.c,a.c=h*d+u*a.c,d=a.b,a.b=u*d-h*a.d,a.d=h*d+u*a.d}if(o){const l=1+this.scaleOffset*t*this.data.scaleX;a.a*=l,a.c*=l}e!=Dr.pose&&(this.tx=c*a.a,this.ty=c*a.c),a.updateAppliedTransform()}translate(e,t){this.ux-=e,this.uy-=t,this.cx-=e,this.cy-=t}rotate(e,t,i){const s=i*ke.degRad,r=Math.cos(s),o=Math.sin(s),a=this.cx-e,c=this.cy-t;this.translate(a*r-c*o-a,a*o+c*r-c)}},hN=class{constructor(e,t){T(this,"data");T(this,"bone");T(this,"color");T(this,"darkColor",null);T(this,"attachment",null);T(this,"attachmentState",0);T(this,"sequenceIndex",-1);T(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 ut,this.darkColor=e.darkColor?new ut:null,this.setToSetupPose()}getSkeleton(){return this.bone.skeleton}getAttachment(){return this.attachment}setAttachment(e){this.attachment!=e&&((!(e instanceof pr)||!(this.attachment instanceof pr)||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}},uN=class{constructor(e,t){T(this,"data");T(this,"bones");T(this,"target");T(this,"mixRotate",0);T(this,"mixX",0);T(this,"mixY",0);T(this,"mixScaleX",0);T(this,"mixScaleY",0);T(this,"mixShearY",0);T(this,"temp",new mu);T(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 s=0;s0?ke.degRad:-.01745329277777778,m=this.data.offsetRotation*f,p=this.data.offsetShearY*f,g=this.bones;for(let v=0,b=g.length;vke.PI?C-=ke.PI2:C<-3.1415927&&(C+=ke.PI2),C*=e;let M=Math.cos(C),P=Math.sin(C);y.a=M*x-P*E,y.b=M*_-P*S,y.c=P*x+M*E,y.d=P*_+M*S}if(a){let x=this.temp;c.localToWorld(x.set(this.data.offsetX,this.data.offsetY)),y.worldX+=(x.x-y.worldX)*t,y.worldY+=(x.y-y.worldY)*i}if(s!=0){let x=Math.sqrt(y.a*y.a+y.c*y.c);x!=0&&(x=(x+(Math.sqrt(l*l+u*u)-x+this.data.offsetScaleX)*s)/x),y.a*=x,y.c*=x}if(r!=0){let x=Math.sqrt(y.b*y.b+y.d*y.d);x!=0&&(x=(x+(Math.sqrt(h*h+d*d)-x+this.data.offsetScaleY)*r)/x),y.b*=x,y.d*=x}if(o>0){let x=y.b,_=y.d,E=Math.atan2(_,x),S=Math.atan2(d,h)-Math.atan2(u,l)-(E-Math.atan2(y.c,y.a));S>ke.PI?S-=ke.PI2:S<-3.1415927&&(S+=ke.PI2),S=E+(S+p)*o;let C=Math.sqrt(x*x+_*_);y.b=Math.cos(S)*C,y.d=Math.sin(S)*C}y.updateAppliedTransform()}}applyRelativeWorld(){let e=this.mixRotate,t=this.mixX,i=this.mixY,s=this.mixScaleX,r=this.mixScaleY,o=this.mixShearY,a=t!=0||i!=0,c=this.target,l=c.a,h=c.b,u=c.c,d=c.d,f=l*d-h*u>0?ke.degRad:-.01745329277777778,m=this.data.offsetRotation*f,p=this.data.offsetShearY*f,g=this.bones;for(let v=0,b=g.length;vke.PI?C-=ke.PI2:C<-3.1415927&&(C+=ke.PI2),C*=e;let M=Math.cos(C),P=Math.sin(C);y.a=M*x-P*E,y.b=M*_-P*S,y.c=P*x+M*E,y.d=P*_+M*S}if(a){let x=this.temp;c.localToWorld(x.set(this.data.offsetX,this.data.offsetY)),y.worldX+=x.x*t,y.worldY+=x.y*i}if(s!=0){let x=(Math.sqrt(l*l+u*u)-1+this.data.offsetScaleX)*s+1;y.a*=x,y.c*=x}if(r!=0){let x=(Math.sqrt(h*h+d*d)-1+this.data.offsetScaleY)*r+1;y.b*=x,y.d*=x}if(o>0){let x=Math.atan2(d,h)-Math.atan2(u,l);x>ke.PI?x-=ke.PI2:x<-3.1415927&&(x+=ke.PI2);let _=y.b,E=y.d;x=Math.atan2(E,_)+(x-ke.PI/2+p)*o;let S=Math.sqrt(_*_+E*E);y.b=Math.cos(x)*S,y.d=Math.sin(x)*S}y.updateAppliedTransform()}}applyAbsoluteLocal(){let e=this.mixRotate,t=this.mixX,i=this.mixY,s=this.mixScaleX,r=this.mixScaleY,o=this.mixShearY,a=this.target,c=this.bones;for(let l=0,h=c.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 mu,i=new mu;return this.getBounds(t,i,void 0,e),{x:t.x,y:t.y,width:i.x,height:i.y}}getBounds(e,t,i=new Array(2),s=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,c=Number.NEGATIVE_INFINITY,l=Number.NEGATIVE_INFINITY;for(let h=0,u=r.length;h=s.length&&(s.length=e+1),s[e]||(s[e]={}),s[e][t]=i}addSkin(e){for(let s=0;s= 0.");if(!t)throw new Error("name cannot be null.");if(!i)throw new Error("boneData cannot be null.");this.index=e,this.name=t,this.boneData=i}};var Hr;(function(n){n[n.Normal=0]="Normal",n[n.Additive=1]="Additive",n[n.Multiply=2]="Multiply",n[n.Screen=3]="Screen"})(Hr||(Hr={}));let pT=class extends fd{constructor(t){super(t,0,!1);T(this,"bones",new Array);T(this,"_target",null);T(this,"mixRotate",0);T(this,"mixX",0);T(this,"mixY",0);T(this,"mixScaleX",0);T(this,"mixScaleY",0);T(this,"mixShearY",0);T(this,"offsetRotation",0);T(this,"offsetX",0);T(this,"offsetY",0);T(this,"offsetScaleX",0);T(this,"offsetScaleY",0);T(this,"offsetShearY",0);T(this,"relative",!1);T(this,"local",!1)}set target(t){this._target=t}get target(){if(this._target)return this._target;throw new Error("BoneData not set.")}},Fp=class{constructor(e){T(this,"scale",1);T(this,"attachmentLoader");T(this,"linkedMeshes",new Array);this.attachmentLoader=e}readSkeletonData(e){let t=this.scale,i=new gu;i.name="";let s=new dN(e),r=s.readInt32(),o=s.readInt32();i.hash=o==0&&r==0?null:o.toString(16)+r.toString(16),i.version=s.readString(),i.x=s.readFloat(),i.y=s.readFloat(),i.width=s.readFloat(),i.height=s.readFloat(),i.referenceScale=s.readFloat()*t;let a=s.readBoolean();a&&(i.fps=s.readFloat(),i.imagesPath=s.readString(),i.audioPath=s.readString());let c=0;c=s.readInt(!0);for(let h=0;h>1&3,f.rotateMode=m>>3&3,(m&128)!=0&&(f.offsetRotation=s.readFloat()),f.position=s.readFloat(),f.positionMode==As.Fixed&&(f.position*=t),f.spacing=s.readFloat(),(f.spacingMode==Ti.Length||f.spacingMode==Ti.Fixed)&&(f.spacing*=t),f.mixRotate=s.readFloat(),f.mixX=s.readFloat(),f.mixY=s.readFloat(),i.pathConstraints.push(f)}c=s.readInt(!0);for(let h=0,u;h>4,e.readFloat())}s.push(E);break}}}}}let o=e.readInt(!0);if(o>0){let l=new Fl(o),h=i.slots.length;for(let u=0;u=0;b--)m[b]=-1;let p=Oe.newArray(h-f,0),g=0,v=0;for(let b=0;b=0;b--)m[b]==-1&&(m[b]=p[--v]);l.setFrame(u,d,m)}s.push(l)}let a=e.readInt(!0);if(a>0){let l=new Wg(a);for(let h=0;h>>1^-(i&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 i=0;i>4){case 12:case 13:t+=String.fromCharCode((s&31)<<6|this.readByte()&63),i+=2;break;case 14:t+=String.fromCharCode((s&15)<<12|(this.readByte()&63)<<6|this.readByte()&63),i+=3;break;default:t+=String.fromCharCode(s),i++}}return t}readFloat(){let e=this.buffer.getFloat32(this.index);return this.index+=4,e}readBoolean(){return this.readByte()!=0}},fN=class{constructor(e,t,i,s,r){T(this,"parent");T(this,"skinIndex");T(this,"slotIndex");T(this,"mesh");T(this,"inheritTimeline");this.mesh=e,this.skinIndex=t,this.slotIndex=i,this.parent=s,this.inheritTimeline=r}},mN=class{constructor(e=null,t=null,i=0){T(this,"bones");T(this,"vertices");T(this,"length");this.bones=e,this.vertices=t,this.length=i}};var Xs;(function(n){n[n.Region=0]="Region",n[n.BoundingBox=1]="BoundingBox",n[n.Mesh=2]="Mesh",n[n.LinkedMesh=3]="LinkedMesh",n[n.Path=4]="Path",n[n.Point=5]="Point",n[n.Clipping=6]="Clipping"})(Xs||(Xs={}));function Bi(n,e,t){let i=n.readFloat(),s=n.readFloat()*t;for(let r=0,o=0,a=e.getFrameCount()-1;e.setFrame(r,i,s),r!=a;r++){let c=n.readFloat(),l=n.readFloat()*t;switch(n.readByte()){case ds:e.setStepped(r);break;case fs:gt(n,e,o++,r,0,i,c,s,l,t)}i=c,s=l}return e}function mm(n,e,t){let i=n.readFloat(),s=n.readFloat()*t,r=n.readFloat()*t;for(let o=0,a=0,c=e.getFrameCount()-1;e.setFrame(o,i,s,r),o!=c;o++){let l=n.readFloat(),h=n.readFloat()*t,u=n.readFloat()*t;switch(n.readByte()){case ds:e.setStepped(o);break;case fs:gt(n,e,a++,o,0,i,l,s,h,t),gt(n,e,a++,o,1,i,l,r,u,t)}i=l,s=h,r=u}return e}function gt(n,e,t,i,s,r,o,a,c,l){e.setBezier(t,i,s,r,a,n.readFloat(),n.readFloat()*l,n.readFloat(),n.readFloat()*l,o,c)}const pN=0,gN=1,vN=2,yN=3,bN=4,xN=5,wN=6,SN=7,_N=8,TN=9,EN=10,CN=0,MN=1,AN=2,IN=3,PN=4,RN=5,kN=0,FN=1,LN=0,ON=1,$N=2,NN=0,DN=1,BN=2,UN=4,VN=5,XN=6,YN=7,GN=8,ds=1,fs=2;class ln{constructor(){T(this,"convexPolygons",new Array);T(this,"convexPolygonsIndices",new Array);T(this,"indicesArray",new Array);T(this,"isConcaveArray",new Array);T(this,"triangles",new Array);T(this,"polygonPool",new fu(()=>new Array));T(this,"polygonIndicesPool",new fu(()=>new Array))}triangulate(e){let t=e,i=e.length>>1,s=this.indicesArray;s.length=0;for(let a=0;a3;){let a=i-1,c=0,l=1;for(;;){e:if(!r[c]){let d=s[a]<<1,f=s[c]<<1,m=s[l]<<1,p=t[d],g=t[d+1],v=t[f],b=t[f+1],y=t[m],x=t[m+1];for(let _=(l+1)%i;_!=a;_=(_+1)%i){if(!r[_])continue;let E=s[_]<<1,S=t[E],C=t[E+1];if(ln.positiveArea(y,x,p,g,S,C)&&ln.positiveArea(p,g,v,b,S,C)&&ln.positiveArea(v,b,y,x,S,C))break e}break}if(l==0){do{if(!r[c])break;c--}while(c>0);break}a=c,c=l,l=(l+1)%i}o.push(s[(i+c-1)%i]),o.push(s[c]),o.push(s[(c+1)%i]),s.splice(c,1),r.splice(c,1),i--;let h=(i+c-1)%i,u=c==i?0:c;r[h]=ln.isConcave(h,i,t,s),r[u]=ln.isConcave(u,i,t,s)}return i==3&&(o.push(s[2]),o.push(s[0]),o.push(s[1])),o}decompose(e,t){let i=e,s=this.convexPolygons;this.polygonPool.freeAll(s),s.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 c=-1,l=0;for(let h=0,u=t.length;h0?(s.push(a),r.push(o)):(this.polygonPool.free(a),this.polygonIndicesPool.free(o)),a=this.polygonPool.obtain(),a.length=0,a.push(p),a.push(g),a.push(v),a.push(b),a.push(y),a.push(x),o=this.polygonIndicesPool.obtain(),o.length=0,o.push(d),o.push(f),o.push(m),l=ln.winding(p,g,v,b,y,x),c=d)}a.length>0&&(s.push(a),r.push(o));for(let h=0,u=s.length;h=0;h--)a=s[h],a.length==0&&(s.splice(h,1),this.polygonPool.free(a),o=r[h],r.splice(h,1),this.polygonIndicesPool.free(o));return s}static isConcave(e,t,i,s){let r=s[(t+e-1)%t]<<1,o=s[e]<<1,a=s[(e+1)%t]<<1;return!this.positiveArea(i[r],i[r+1],i[o],i[o+1],i[a],i[a+1])}static positiveArea(e,t,i,s,r,o){return e*(o-s)+i*(t-o)+r*(s-t)>=0}static winding(e,t,i,s,r,o){let a=i-e,c=s-t;return r*c-o*a+a*t-e*c>=0?1:-1}}class vu{constructor(){T(this,"triangulator",new ln);T(this,"clippingPolygon",new Array);T(this,"clipOutput",new Array);T(this,"clippedVertices",new Array);T(this,"clippedUVs",new Array);T(this,"clippedTriangles",new Array);T(this,"scratch",new Array);T(this,"clipAttachment",null);T(this,"clippingPolygons",null)}clipStart(e,t){if(this.clipAttachment)return 0;this.clipAttachment=t;let i=t.worldVerticesLength,s=Oe.setArraySize(this.clippingPolygon,i);t.computeWorldVertices(e,0,i,s,0,2);let r=this.clippingPolygon;vu.makeClockwise(r);let o=this.clippingPolygons=this.triangulator.decompose(r,this.triangulator.triangulate(r));for(let a=0,c=o.length;a>1,E=this.clipOutput,S=Oe.setArraySize(r,y+_*2);for(let M=0;M>1,X=this.clipOutput,G=Oe.setArraySize(l,O+D*f);for(let J=0;J>1,N=this.clipOutput,F=Oe.setArraySize(o,A+L*2),D=Oe.setArraySize(a,A+L*2);for(let G=0;G=2?(u=c,c=this.scratch):u=this.scratch,u.length=0,u.push(e),u.push(t),u.push(i),u.push(s),u.push(r),u.push(o),u.push(e),u.push(t),c.length=0;let d=a.length-4,f=a;for(let m=0;;m+=2){let p=f[m],g=f[m+1],v=p-f[m+2],b=g-f[m+3],y=c.length,x=u;for(let E=0,S=u.length-2;Ev*(g-A),B=b*(p-C)-v*(g-M);if(B>0){if(R){c.push(P),c.push(A);continue}let O=P-C,W=A-M,V=B/(O*b-W*v);if(V>=0&&V<=1)c.push(C+O*V),c.push(M+W*V);else{c.push(P),c.push(A);continue}}else if(R){let O=P-C,W=A-M,V=B/(O*b-W*v);if(V>=0&&V<=1)c.push(C+O*V),c.push(M+W*V),c.push(P),c.push(A);else{c.push(P),c.push(A);continue}}h=!0}if(y==c.length)return l.length=0,!0;if(c.push(c[0]),c.push(c[1]),m==d)break;let _=c;c=u,c.length=0,u=_}if(l!=c){l.length=0;for(let m=0,p=c.length-2;m>1;l0){let h=i.findPhysicsConstraint(a);if(!h)throw new Error("Physics constraint not found: "+a);l=i.physicsConstraints.indexOf(h)}for(let h in c){let u=c[h],d=u[0];if(!d)continue;let f=u.length;if(h=="reset"){const p=new Z_(f,l);for(let g=0;d!=null;d=u[g+1],g++)p.setFrame(g,ae(d,"time",0));r.push(p);continue}let m;if(h=="inertia")m=new H_(f,f,l);else if(h=="strength")m=new j_(f,f,l);else if(h=="damping")m=new W_(f,f,l);else if(h=="mass")m=new z_(f,f,l);else if(h=="wind")m=new q_(f,f,l);else if(h=="gravity")m=new K_(f,f,l);else if(h=="mix")m=new J_(f,f,l);else continue;r.push(Vn(u,m,0,1))}}if(e.attachments)for(let a in e.attachments){let c=e.attachments[a],l=i.findSkin(a);if(!l)throw new Error("Skin not found: "+a);for(let h in c){let u=c[h],d=i.findSlot(h);if(!d)throw new Error("Slot not found: "+h);let f=d.index;for(let m in u){let p=u[m],g=l.getAttachment(f,m);for(let v in p){let b=p[v],y=b[0];if(y){if(v=="deform"){let x=g.bones,_=g.vertices,E=x?_.length/3*2:_.length,S=new B_(b.length,b.length,f,g),C=ae(y,"time",0);for(let M=0,P=0;;M++){let A,R=ae(y,"vertices",null);if(!R)A=x?Oe.newFloatArray(E):_;else{A=Oe.newFloatArray(E);let V=ae(y,"offset",0);if(Oe.arrayCopy(R,0,A,V,R.length),s!=1)for(let Y=V,L=Y+R.length;Y=0;v--)d[v]==-1&&(d[v]=m[--g])}a.setFrame(l,ae(u,"time",0),d)}r.push(a)}if(e.events){let a=new Wg(e.events.length),c=0;for(let l=0;l"u"&&(Math.fround=(function(n){return function(e){return n[0]=e,n[0]}})(new Float32Array(1)));if(typeof window<"u"&&window.PIXI){let n=window.require;window.require=e=>{if(n)return n(e);if(e.startsWith("@pixi/"))return window.PIXI}}const Gs=class Gs extends nN{constructor(t){super(t.resource.source);T(this,"texture");this.texture=it.from(t)}static from(t){return Gs.textureMap.has(t)?Gs.textureMap.get(t):new Gs(t)}setFilters(t,i){this.texture.baseTexture.scaleMode=Gs.toPixiTextureFilter(t),this.texture.baseTexture.mipmap=Gs.toPixiMipMap(t)}setWraps(t,i){this.texture.baseTexture.wrapMode=Gs.toPixiTextureWrap(t)}dispose(){this.texture.destroy()}static toPixiTextureFilter(t){switch(t){case Ai.Nearest:case Ai.MipMapNearestLinear:case Ai.MipMapNearestNearest:return Wn.NEAREST;case Ai.Linear:case Ai.MipMapLinearLinear:case Ai.MipMapLinearNearest:return Wn.LINEAR;default:throw new Error(`Unknown texture filter: ${String(t)}`)}}static toPixiMipMap(t){switch(t){case Ai.Nearest:case Ai.Linear:return $n.OFF;case Ai.MipMapNearestLinear:case Ai.MipMapNearestNearest:case Ai.MipMapLinearLinear:case Ai.MipMapLinearNearest:return $n.ON;default:throw new Error(`Unknown texture filter: ${String(t)}`)}}static toPixiTextureWrap(t){switch(t){case cr.ClampToEdge:return Jn.CLAMP;case cr.MirroredRepeat:return Jn.MIRRORED_REPEAT;case cr.Repeat:return Jn.REPEAT;default:throw new Error(`Unknown texture wrap: ${String(t)}`)}}static toPixiBlending(t){switch(t){case Hr.Normal:return Qe.NORMAL;case Hr.Additive:return Qe.ADD;case Hr.Multiply:return Qe.MULTIPLY;case Hr.Screen:return Qe.SCREEN;default:throw new Error(`Unknown blendMode: ${String(t)}`)}}};T(Gs,"textureMap",new Map);let Yo=Gs;const Hs=class Hs extends ec{constructor(){const t=new Fg;t.getBuffer("aVertexPosition").static=!1,t.getBuffer("aTextureCoord").static=!1;const i=new ru(it.EMPTY);super(t,i);T(this,"name","");T(this,"warnedTwoTint",!1)}updateFromSpineData(t,i,s,r,o,a,c,l){var v,b;this.texture=t.texture;const h=o/(l?12:8)*2,u=this.geometry.getBuffer("aTextureCoord");((v=u.data)==null?void 0:v.length)!==h&&(u.data=new Float32Array(h));const d=this.geometry.getBuffer("aVertexPosition");((b=d.data)==null?void 0:b.length)!==h&&(d.data=new Float32Array(h));let f=0,m=u.data,p=d.data;for(let y=0;ynew Lp);T(this,"beforeUpdateWorldTransforms",()=>{});T(this,"afterUpdateWorldTransforms",()=>{});T(this,"_autoUpdate",!1);T(this,"_ticker",nn.shared);T(this,"meshesCache",new Map);T(this,"lightColor",new ut);T(this,"darkColor",new ut);T(this,"_boundsProvider");T(this,"_boundsPoint",new Tt);T(this,"_boundsSpineID",-1);T(this,"_boundsSpineDirty",!0);T(this,"slotsObject",new Map);T(this,"verticesCache",Oe.newFloatArray(1024));T(this,"clippingSlotToPixiMasks",{});T(this,"currentClippingSlot");const s=t instanceof gu?t:t.skeletonData;this.skeleton=new zg(s);const r=new iN(s);this.state=new J$(r),(t==null?void 0:t.darkTint)!==void 0||(i==null?void 0:i.slotMeshFactory)===void 0?(this.darkTint=(t==null?void 0:t.darkTint)===void 0?this.skeleton.slots.some(o=>!!o.data.darkColor):t==null?void 0:t.darkTint,this.darkTint&&(this.slotMeshFactory=()=>new Ll)):this.initializeMeshFactory(i==null?void 0:i.slotMeshFactory),t!=null&&t.ticker&&(this._ticker=t.ticker),this.autoUpdate=(t==null?void 0:t.autoUpdate)??!0,this.boundsProvider=t.boundsProvider}get debug(){return this._debug}set debug(t){this._debug&&this._debug.unregisterSpine(this),t&&t.registerSpine(this),this._debug=t}get autoUpdate(){return this._autoUpdate}set autoUpdate(t){t&&!this._autoUpdate?this._ticker.add(this.internalUpdate,this):!t&&this._autoUpdate&&this._ticker.remove(this.internalUpdate,this),this._autoUpdate=t}get ticker(){return this._ticker}set ticker(t){t=t??nn.shared,this._ticker!==t&&(this._autoUpdate&&(this._ticker.remove(this.internalUpdate,this),t.add(this.internalUpdate,this)),this._ticker=t)}get boundsProvider(){return this._boundsProvider}set boundsProvider(t){this._boundsProvider=t,t?(this._boundsSpineID=-1,this._boundsSpineDirty=!0,this.interactiveChildren=!1):(this.interactiveChildren=!0,this.hitArea=null),this.hasNeverUpdated||this.calculateBounds()}initializeMeshFactory(t){if(t){this.slotMeshFactory=t;const i=this.slotMeshFactory();i instanceof Ll&&(this.darkTint=!0),i.destroy()}else for(let i=0;inew Ll,this.darkTint=!0;break}}update(t){this.internalUpdate(0,t)}internalUpdate(t,i){this.hasNeverUpdated=!1;const s=i??this._ticker.deltaMS/1e3;this.state.update(s),this.state.apply(this.skeleton),this.beforeUpdateWorldTransforms(this),this.skeleton.update(s),this.skeleton.updateWorldTransform(Dr.update),this.afterUpdateWorldTransforms(this)}updateTransform(){var t;this.renderMeshes(),this.sortChildren(),(t=this.debug)==null||t.renderDebug(this),super.updateTransform()}destroy(t){var i;this.autoUpdate&&(this.autoUpdate=!1),this._ticker=null;for(const[,s]of this.meshesCache)s==null||s.destroy();this.state.clearListeners(),this.debug=void 0,this.meshesCache.clear(),this.slotsObject.clear();for(let s in this.clippingSlotToPixiMasks)(i=this.clippingSlotToPixiMasks[s].mask)==null||i.destroy(),delete this.clippingSlotToPixiMasks[s];super.destroy(t)}resetMeshes(){for(const[,t]of this.meshesCache)t.zIndex=-1,t.visible=!1}_calculateBounds(){this.hasNeverUpdated&&(this.internalUpdate(0,0),this.renderMeshes())}hasMeshForSlot(t){return this.meshesCache.has(t)}getMeshForSlot(t){if(this.hasMeshForSlot(t)){let i=this.meshesCache.get(t);return i.visible=!0,i}else{let i=this.slotMeshFactory();return this.addChild(i),this.meshesCache.set(t,i),i}}getSlotFromRef(t){let i;if(typeof t=="number"?i=this.skeleton.slots[t]:typeof t=="string"?i=this.skeleton.findSlot(t):i=t,!i)throw new Error(`No slot found with the given slot reference: ${t}`);return i}addSlotObject(t,i,s){var a;let r=this.getSlotFromRef(t);const o=(a=this.slotsObject.get(r))==null?void 0:a.container;if(!(o&&o===i)){for(const[c,{container:l}]of this.slotsObject)if(c!==r&&l===i){this.removeSlotObject(c,i);break}o&&this.removeChild(o),this.slotsObject.set(r,{container:i,followAttachmentTimeline:(s==null?void 0:s.followAttachmentTimeline)||!1,followSlotColor:(s==null?void 0:s.followSlotColor)||!1}),this.addChild(i)}}getSlotObject(t){const i=this.slotsObject.get(this.getSlotFromRef(t));return i?i.container:void 0}removeSlotObject(t,i){var o;let s=this.getSlotFromRef(t),r=(o=this.slotsObject.get(s))==null?void 0:o.container;r&&(i&&i!==r||(this.removeChild(r),this.slotsObject.delete(s)))}removeSlotObjects(){for(const[,t]of this.slotsObject)t.container.removeFromParent();this.slotsObject.clear()}updateSlotObject(t,i,s){const{container:r,followAttachmentTimeline:o}=t,a=o?!!i.attachment:!0;if(r.visible=this.skeleton.drawOrder.includes(i)&&a,r.visible){let c=i.bone;const l=r.localTransform;l.a=c.a,l.b=c.c,l.c=-c.b,l.d=-c.d,l.tx=c.worldX,l.ty=c.worldY,r.transform.setFromMatrix(l),r.zIndex=s,r.alpha=this.skeleton.color.a*i.color.a,t.followSlotColor&&this.setSlotObjectTint(r,255*this.skeleton.color.r*i.color.r<<16|255*this.skeleton.color.g*i.color.g<<8|255*this.skeleton.color.b*i.color.b)}}setSlotObjectTint(t,i){const s=t;"tint"in s&&(s.tint=i);for(const r of s.children??[])this.setSlotObjectTint(r,i)}updateAndSetPixiMask(t,i){var a,c;const s=t.attachment;if(s&&s instanceof $a){const l=(a=this.clippingSlotToPixiMasks)[c=t.data.name]||(a[c]={slot:t,vertices:new Array});l.maskComputed=!1,this.currentClippingSlot=l;return}let r=this.currentClippingSlot;const o=this.slotsObject.get(t);if(r&&o){let l=r.mask;if(l||(l=Jb.obtain(),r.mask=l,this.addChild(l)),!r.maskComputed){let h=r.slot,u=h.attachment;r.maskComputed=!0;const d=u.worldVerticesLength,f=r.vertices;u.computeWorldVertices(h,0,d,f,0,2),l.clear().lineStyle(0).beginFill(0).drawPolygon(f).endFill()}o.container.mask=l}else o!=null&&o.container.mask&&(o.container.mask=null);if(r&&r.slot.attachment.endSlot==t.data&&(this.currentClippingSlot=void 0),i){for(const l in this.clippingSlotToPixiMasks){const h=this.clippingSlotToPixiMasks[l];(!(h.slot.attachment instanceof $a)||!h.maskComputed)&&h.mask&&(this.removeChild(h.mask),Jb.free(h.mask),h.mask=void 0)}this.currentClippingSlot=void 0}}renderMeshes(){var r,o;this.resetMeshes();let t=null,i=null;const s=this.skeleton.drawOrder;for(let a=0,c=s.length,l=0;a>1)*m,b>this.verticesCache.length&&(this.verticesCache=Oe.newFloatArray(b)),y.computeWorldVertices(h,0,y.worldVerticesLength,this.verticesCache,0,m),t=y.triangles,i=y.uvs,v=(o=y.region)==null?void 0:o.texture}else if(p instanceof $a){Ct.clipper.clipStart(h,p);continue}else{this.hasMeshForSlot(h)&&(this.getMeshForSlot(h).visible=!1),Ct.clipper.clipEndWithSlot(h);continue}if(v!=null){const x=h.bone.skeleton.color,_=h.color,E=x.a*_.a*g.a;this.lightColor.set(x.r*_.r*g.r,x.g*_.g*g.g,x.b*_.b*g.b,E),h.darkColor!=null?this.darkColor.set(h.darkColor.r,h.darkColor.g,h.darkColor.b,1):this.darkColor.set(0,0,0,1);let S,C,M,P;if(Ct.clipper.isClipping())Ct.clipper.clipTriangles(this.verticesCache,t,t.length,i,this.lightColor,this.darkColor,f),S=Ct.clipper.clippedVertices,C=S.length,M=Ct.clipper.clippedTriangles,P=M.length;else{const R=this.verticesCache;for(let B=2,O=0,W=b;Bnew Ki);zg.yDown=!0;const hh="spineTextureAtlasLoader",JN={extension:$e.Asset,resolver:{test:n=>un(n,".atlas"),parse:n=>{var t,i;const e=n.split(".");return{resolution:parseFloat(((i=(t=Ve.RETINA_PREFIX)==null?void 0:t.exec(n))==null?void 0:i[1])??"1"),format:e[e.length-2],src:n}}},loader:{name:hh,extension:{type:$e.LoadParser,priority:_n.Normal,name:hh},test(n){return un(n,".atlas")},async load(n){const e=await Ve.ADAPTER.fetch(n);if(!e.ok)throw new Error(`[${hh}] Failed to fetch ${n}: ${e.status} ${e.statusText}`);return await e.text()},testParse(n,e){const t=un(e.src,".atlas"),i=typeof n=="string",s=e.loadParser===hh;return Promise.resolve((t||s)&&i)},unload(n){n.dispose()},async parse(n,e,t){var c;const i=e.data||{};let s=di.dirname(e.src);s&&s.lastIndexOf("/")!==s.length-1&&(s+="/");const r=new nT(n);if(i.images instanceof rt||typeof i.images=="string"){const l=i.images;i.images={},i.images[r.pages[0].name]=l}const o=[];let a=!0;for(const l of t.parsers)if(l.name=="loadTextures"){a=(c=l.config)==null?void 0:c.preferCreateImageBitmap;break}Es.setPreferences({preferCreateImageBitmap:!1});for(const l of r.pages){const h=l.name,u=i!=null&&i.images?i.images[h]:void 0;if(u instanceof rt)l.setTexture(Yo.from(u));else{const d=u??di.normalize([...s.split(di.sep),h].join(di.sep)),f={src:eu(d,e.src),data:{...i.imageMetadata,alphaMode:l.pma?Ri.PMA:Ri.UNPACK}},m=t.load(f).then(p=>{l.setTexture(Yo.from(p.baseTexture))});o.push(m)}}return await Promise.all(o),Es.setPreferences({preferCreateImageBitmap:a}),r}}};je.add(JN);const uh="spineSkeletonLoader";function ZN(n){return n.hasOwnProperty("bones")}function QN(n){return n instanceof Uint8Array}const eD={extension:$e.Asset,loader:{name:uh,extension:{type:$e.LoadParser,priority:_n.Normal,name:uh},test(n){return un(n,".skel")},async load(n){const e=await Ve.ADAPTER.fetch(n);if(!e.ok)throw new Error(`[${uh}] Failed to fetch ${n}: ${e.status} ${e.statusText}`);return new Uint8Array(await e.arrayBuffer())},testParse(n,e){const t=un(e.src,".json")&&ZN(n),i=un(e.src,".skel")&&QN(n),s=e.loadParser===uh;return Promise.resolve(t||i||s)}}};je.add(eD);class tD extends Ps{constructor(t=!1){super();T(this,"_buffer");T(this,"_indexBuffer");this._buffer=new zt(void 0,t,!1),this._indexBuffer=new zt(void 0,t,!0),this.addAttribute("aVertexPosition",this._buffer,2,!1,He.FLOAT).addAttribute("aTextureCoord",this._buffer,2,!1,He.FLOAT).addAttribute("aColor",this._buffer,4,!0,He.UNSIGNED_BYTE).addAttribute("aDarkColor",this._buffer,4,!0,He.UNSIGNED_BYTE).addAttribute("aTextureId",this._buffer,1,!0,He.FLOAT).addIndex(this._indexBuffer)}}const iD=` +precision highp float; +attribute vec2 aVertexPosition; +attribute vec2 aTextureCoord; +attribute vec4 aColor; +attribute vec4 aDarkColor; +attribute float aTextureId; + +uniform mat3 projectionMatrix; +uniform mat3 translationMatrix; +uniform vec4 tint; + +varying vec2 vTextureCoord; +varying vec4 vColor; +varying vec4 vDarkColor; +varying float vTextureId; + +void main(void){ + gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); + + vTextureCoord = aTextureCoord; + vTextureId = aTextureId; + vColor = aColor * tint; + vDarkColor = aDarkColor * tint; + +} +`,nD=` +varying vec2 vTextureCoord; +varying vec4 vColor; +varying vec4 vDarkColor; +varying float vTextureId; +uniform sampler2D uSamplers[%count%]; + +void main(void){ + vec4 color; + %forloop% + + + gl_FragColor.a = color.a * vColor.a; + gl_FragColor.rgb = ((color.a - 1.0) * vDarkColor.a + 1.0 - color.rgb) * vDarkColor.rgb + color.rgb * vColor.rgb; +} +`;class gT extends Rr{constructor(e){super(e),this.shaderGenerator=new bw(iD,nD),this.geometryClass=tD,this.vertexSize=7}packInterleavedGeometry(e,t,i,s,r){const{uint32View:o,float32View:a}=t,c=s/this.vertexSize,l=e.uvs,h=e.indices,u=e.vertexData,d=e._texture.baseTexture._batchLocation,f=Math.min(e.worldAlpha,1),m=kt.shared.setValue(e._tintRGB).toPremultiplied(f,!0),p=kt.shared.setValue(e._darkTintRGB).premultiply(f,!0).toPremultiplied(1,!1);for(let g=0;g0){let o=function(l){return Promise.all(l.map(h=>Promise.resolve(h).then(u=>({status:"fulfilled",value:u}),u=>({status:"rejected",reason:u}))))};document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),c=(a==null?void 0:a.nonce)||(a==null?void 0:a.getAttribute("nonce"));s=o(t.map(l=>{if(l=lD(l),l in Zb)return;Zb[l]=!0;const h=l.endsWith(".css"),u=h?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${u}`))return;const d=document.createElement("link");if(d.rel=h?"stylesheet":aD,h||(d.as="script"),d.crossOrigin="",d.href=l,c&&d.setAttribute("nonce",c),document.head.appendChild(d),h)return new Promise((f,m)=>{d.addEventListener("load",f),d.addEventListener("error",()=>m(new Error(`Unable to preload CSS for ${l}`)))})}))}function r(o){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o}return s.then(o=>{for(const a of o||[])a.status==="rejected"&&r(a.reason);return e().catch(r)})};async function yT(){const[n,e]=await Promise.all([Qb(()=>import("./index-Ck8IwYQq.js"),[]),Qb(()=>import("./index-CC5ru70P.js"),__vite__mapDeps([0,1]))]);return{core:n,pixi:e}}async function cD(n,e,t){const{core:i,pixi:s}=await yT(),r=new i.TextureAtlas(e);return qg(r,t,s.SpineTexture),{skeletonData:new i.SkeletonJson(new i.AtlasAttachmentLoader(r)).readSkeletonData(n),SpineClass:s.Spine}}async function hD(n,e,t){const{core:i,pixi:s}=await yT(),r=new i.TextureAtlas(e);return qg(r,t,s.SpineTexture),{skeletonData:new i.SkeletonBinary(new i.AtlasAttachmentLoader(r)).readSkeletonData(n),SpineClass:s.Spine}}function Br(n,e,t){const i=Number(n[e]);return Number.isFinite(i)?i:t}function hn(n,e,t,i){n[e]==null&&(n[e]=Br(n,t,i))}function Kg(n,e,t){if(typeof n.curve!="number")return;const i=Br(n,"time",0),r=Br(e,"time",0)-i,o=n.curve,a=Br(n,"c2",0),c=Br(n,"c3",1),l=Br(n,"c4",1);n.curve=t.flatMap(([h,u])=>[i+r*o,h+(u-h)*a,i+r*c,h+(u-h)*l]),delete n.c2,delete n.c3,delete n.c4}function jr(n,e){if(Array.isArray(n))for(let t=0;t[Br(i,r,o),Br(s,r,o)]))}}function uD(n){if(Array.isArray(n))for(let e=0;eNumber.parseInt(i.slice(r,r+2),16)/255);return e?s:s.slice(0,3)}function e1(n,e){if(Array.isArray(n))for(let t=0;t[a,o[c]]))}}function dD(n){for(const e of n.bones||[])e.inherit==null&&e.transform!=null&&(e.inherit=e.transform);for(const e of n.transform||[])hn(e,"mixRotate","rotateMix",1),hn(e,"mixX","translateMix",1),e.mixY==null&&(e.mixY=e.mixX),hn(e,"mixScaleX","scaleMix",1),e.mixScaleY==null&&(e.mixScaleY=e.mixScaleX),hn(e,"mixShearY","shearMix",1);for(const e of n.path||[])hn(e,"mixRotate","rotateMix",1),hn(e,"mixX","translateMix",1),e.mixY==null&&(e.mixY=e.mixX)}function fD(n){for(const e of n.skins||[])for(const t of Object.values(e.attachments||{}))for(const i of Object.values(t||{}))i.parent!=null&&i.timelines==null&&i.deform!=null&&(i.timelines=i.deform)}function mD(n){for(const e of Object.values(n.slots||{}))e.color&&!e.rgba&&(e.rgba=e.color,delete e.color),e.twoColor&&!e.rgba2&&(e.rgba2=e.twoColor,delete e.twoColor),e1(e.rgba,!1),e1(e.rgba2,!0)}function pD(n){for(const e of Object.values(n.bones||{})){for(const t of e.rotate||[])hn(t,"value","angle",0);jr(e.rotate,[{key:"value",fallback:0}]),jr(e.translate,[{key:"x",fallback:0},{key:"y",fallback:0}]),jr(e.scale,[{key:"x",fallback:1},{key:"y",fallback:1}]),jr(e.shear,[{key:"x",fallback:0},{key:"y",fallback:0}])}}function gD(n){for(const e of Object.values(n.ik||{}))jr(e,[{key:"mix",fallback:1},{key:"softness",fallback:0}])}function vD(n){for(const e of Object.values(n.transform||{})){for(const t of e)hn(t,"mixRotate","rotateMix",1),hn(t,"mixX","translateMix",1),t.mixY==null&&(t.mixY=t.mixX),hn(t,"mixScaleX","scaleMix",1),t.mixScaleY==null&&(t.mixScaleY=t.mixScaleX),hn(t,"mixShearY","shearMix",1);jr(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 yD(n){for(const e of Object.values(n.path||{})){for(const i of["position","spacing"]){const s=e[i];for(const r of s||[])hn(r,"value",i,0);jr(s,[{key:"value",fallback:0}])}const t=e.mix;for(const i of t||[])hn(i,"mixRotate","rotateMix",1),hn(i,"mixX","translateMix",1),i.mixY==null&&(i.mixY=i.mixX);jr(t,[{key:"mixRotate",fallback:1},{key:"mixX",fallback:1},{key:"mixY",fallback:1}])}}function bD(n){if(!n.deform)return;const e=n.attachments||(n.attachments={});for(const[t,i]of Object.entries(n.deform)){const s=e[t]||(e[t]={});for(const[r,o]of Object.entries(i)){const a=s[r]||(s[r]={});for(const[c,l]of Object.entries(o)){const h=a[c]||(a[c]={});h.deform=l,uD(l)}}}delete n.deform}function bT(n){dD(n),fD(n);for(const e of Object.values(n.animations||{}))mD(e),pD(e),gD(e),vD(e),yD(e),bD(e),!e.drawOrder&&e.draworder&&(e.drawOrder=e.draworder);return n}function xD(n){return n.replace(/\\/g,"/").split("/").pop()||n}async function wD(n){const e=await Promise.all(n.map(async t=>{const i=URL.createObjectURL(t);try{return[xD(t.name).toLowerCase(),await it.fromURL(i)]}finally{URL.revokeObjectURL(i)}}));return new Map(e)}function SD(n){const e=new Map;return n.bones.map(t=>{var r;const i=((r=t.parent)==null?void 0:r.name)||null,s=i?(e.get(i)||0)+1:0;return e.set(t.name,s),{name:t.name,parent:i,depth:s}})}function _D(n){return n.slots.map(e=>{var t;return{name:e.name,order:Number(e.index)||0,bone:((t=e.boneData)==null?void 0:t.name)||"",attachment:e.attachmentName||""}})}async function xT(n,e,t){var o;if(!/\.(json|skel)$/i.test(n.name))throw new Error(Ye("errors.spineFileType"));if(!/\.atlas$/i.test(e.name))throw new Error(Ye("errors.atlasFileType"));if(!t.length)throw new Error(Ye("errors.chooseTexture"));const i=await e.text(),s=await wD(t),r=[...s.values()];try{let a,c,l=null,h;if(/\.skel$/i.test(n.name)){const u=await n.arrayBuffer();try{({skeletonData:a,SpineClass:c}=await hD(u,i,s)),h="4.3"}catch(d){try{({skeletonData:a,SpineClass:c}=oD(u,i,s)),h="4.2"}catch(f){const m=d instanceof Error?d.message:String(d),p=f instanceof Error?f.message:String(f);throw new Error(Ye("errors.binaryParseFailed",{v43:m,v42:p}))}}l=lu(a.version)}else{let u;try{u=JSON.parse(await n.text())}catch{throw new Error(Ye("errors.invalidSpineJson"))}if(l=lu((o=u==null?void 0:u.skeleton)==null?void 0:o.spine),!l)throw new Error(Ye("errors.unsupportedSpineJsonVersion",{versions:bp()}));h=dF(l),l==="3.8"&&bT(u);const d=h==="4.3"?await cD(u,i,s):rD(u,i,s);a=d.skeletonData,c=d.SpineClass}if(!l)throw new Error(Ye("errors.unsupportedSpineDataVersion",{versions:bp()}));return{skeletonData:a,textures:r,runtimeVersion:h,SpineClass:c,dataVersion:l,animations:a.animations.map(u=>({name:u.name,duration:u.duration})),bones:SD(a),slots:_D(a)}}catch(a){for(const c of r)c.destroy(!0);throw a}}function Ph(n){return new Promise((e,t)=>{const i=new FileReader;i.onload=()=>e(String(i.result||"")),i.onerror=()=>t(i.error),i.readAsDataURL(n)})}async function TD(n,e,t){return{skeleton:{name:n.name,dataUrl:await Ph(n)},atlas:{name:e.name,dataUrl:await Ph(e)},textures:await Promise.all(t.map(async i=>({name:i.name,dataUrl:await Ph(i)})))}}async function gm(n){const e=await fetch(n.dataUrl);if(!e.ok)throw new Error(Ye("errors.embeddedReadFailed",{name:n.name}));return new File([await e.blob()],n.name)}async function ED(n){return{skeleton:await gm(n.skeleton),atlas:await gm(n.atlas),textures:await Promise.all(n.textures.map(gm))}}const wT="SpineParticle.EditorConfig",ST=1;function _T(n){return{backgroundX:n.backgroundX,backgroundY:n.backgroundY,backgroundOpacity:n.backgroundOpacity,backgroundImageName:n.backgroundImageName,backgroundImageData:n.backgroundImageData,showGrid:n.showGrid,exportSettings:Zt(n.exportSettings)}}function CD(n){return JSON.parse(JSON.stringify(n,(e,t)=>{if(!(e==="texture"||e==="trailTexture"||e==="frames"))return t}))}function TT(n){const e=Zt(n);return delete e.tags,delete e.selectedTag,e}function MD(n){const e=_T(n.settings),t=n.timeline.playbackEnd>=Math.max(1,n.timeline.totalFrames-1);return CD({format:wT,version:ST,savedAt:new Date().toISOString(),editor:Zt(n.editor),settings:e,timeline:{fps:n.timeline.fps,loop:n.timeline.loop,playbackStart:n.timeline.playbackStart,playbackEnd:n.timeline.playbackEnd,playbackEndAuto:t,abLoop:n.timeline.abLoop,animations:[...n.timeline.animations]},selection:{type:n.activeObjectType,id:n.activeObjectId},scene:{systems:n.systems.map(i=>({...Zt(i),frames:void 0})),colliders:n.colliders.map(TT),paths:Zt(n.paths),spines:Zt(n.spines)}})}function AD(n,e,t,i){const s=Math.max(1,i);let r=0;for(const o of n){const a=o.config,c=Math.max(0,Number(a.lifeMin)||0),l=Math.max(0,Number(a.lifeMax)||0),h=a.lifeMode==="fixed"?c:Math.max(c,l),u=a.mode==="stream"?a.streamBehavior==="loop"?zn(a,s).total/s:Math.max(1/s,Number(a.duration)||0):0;let d=Math.max(0,Number(a.delay)||0)+u+h;a.mode==="stream"&&a.streamBehavior==="loop"&&(d=Math.max(0,Number(a.delay)||0)+zn(a,s).total/s),r=Math.max(r,d)}for(const o of t){const a=o.animations.find(c=>c.name===o.selectedAnimation);a&&(r=Math.max(r,Math.max(0,Number(o.timeOffset)||0)+Math.max(0,a.duration||0)))}for(const o of e)o.followPath&&o.followPathId&&(r=Math.max(r,Math.max(0,o.followDuration)||0));return kS(r,s)}function ID(){return`SpineParticle-${new Date().toISOString().replace(/[-:]/g,"").replace(/\.\d{3}Z$/,"").replace("T","-")}.json`}function ET(n){const e=MD(n),t=new Blob([JSON.stringify(e,null,2)],{type:"application/json;charset=utf-8"}),i=URL.createObjectURL(t),s=document.createElement("a");return s.href=i,s.download=ID(),document.body.appendChild(s),s.click(),s.remove(),setTimeout(()=>URL.revokeObjectURL(i),0),e}function CT(n){let e;try{e=JSON.parse(n)}catch{throw new Error(Ye("errors.invalidJson"))}const t=e;if(t.format!==wT)throw new Error(Ye("errors.invalidConfigFormat"));if(t.version!==ST)throw new Error(Ye("errors.unsupportedConfigVersion",{version:t.version??Ye("export.unknown")}));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(Ye("errors.missingScene"));return t}async function PD(n){const e=new Map,t=s=>{const r=s==="/particles/star.png"?"/images/star.png":s==="/trails/trail.png"?"/images/trail.png":s||"/images/star.png";let o=e.get(r);return o||(o=it.fromURL(r).then(a=>Ur(a)),e.set(r,o)),o},i=await t("/images/star.png");await Promise.all(n.map(async s=>{var o;const r=lr(s.config);r.texture=i,await Promise.all(r.imageResources.map(async a=>{a.texture=await t(a.previewUrl||"/images/star.png"),await Promise.all(a.sequenceFrames.map(async c=>{c.texture=await t(c.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,s.frames=[]}))}async function RD(n){const e=new Map;try{for(const t of n){if(!t.sourceBundle)continue;const i=await ED(t.sourceBundle);e.set(t.id,await xT(i.skeleton,i.atlas,i.textures))}return e}catch(t){for(const i of e.values())for(const s of i.textures)s.destroy(!0);throw t}}function kD(n,e){const t=(e==null?void 0:e.type)||"particle",i=Number(e==null?void 0:e.id)||0;(t==="particle"?n.systems.some(r=>r.id===i):t==="collision"?n.colliders.some(r=>r.id===i):t==="path"?n.paths.some(r=>r.id===i):n.spines.some(r=>r.id===i))?n.selectSceneObject(t,i):n.systems[0]?n.selectSceneObject("particle",n.systems[0].id):n.colliders[0]?n.selectSceneObject("collision",n.colliders[0].id):n.paths[0]?n.selectSceneObject("path",n.paths[0].id):n.spines[0]?n.selectSceneObject("spine",n.spines[0].id):(n.activeObjectType="particle",n.activeObjectId=0,n.activeId=0)}async function FD(n,e){var d,f,m,p,g,v,b,y,x;const t=CT(JSON.stringify(e)),i=Zt(t.scene.systems),s=t.scene.colliders.map(TT),r=Zt(t.scene.paths),o=Zt(t.scene.spines);for(const _ of o)_.sourceBundle==null&&(_.sourceBundle=null),_.dataVersion==null&&(_.dataVersion=""),Array.isArray(_.slots)||(_.slots=[]),typeof _.selectedBone!="string"&&(_.selectedBone=""),typeof _.selectedSlot!="string"&&(_.selectedSlot="");await PD(i);const a=await RD(o),c=new Map(n.spines.map(_=>[_.id,_.assetVersion]));for(const _ of n.spines)yc(_.id);n.systems=i,n.colliders=s,n.paths=r,n.spines=o,Object.assign(n.editor,Zt(t.editor||{}));const l=t.settings;if(l)for(const _ of["backgroundX","backgroundY","backgroundOpacity","backgroundImageName","backgroundImageData","showGrid"])Object.prototype.hasOwnProperty.call(l,_)&&(n.settings[_]=l[_]);n.settings.exportSettings=AS((d=t.settings)==null?void 0:d.exportSettings),n.settings.undoLimit=Math.min(200,Math.max(1,Math.round(Number(n.settings.undoLimit)||20))),n.timeline.fps=Math.max(1,Math.round(Number((f=t.timeline)==null?void 0:f.fps)||30));const h=Math.max(1,Math.floor(Number((m=t.timeline)==null?void 0:m.playbackEnd)||Number.MAX_SAFE_INTEGER)),u=((p=t.timeline)==null?void 0:p.playbackEndAuto)??h>=AD(i,s,o,n.timeline.fps);n.timeline.abLoop=((g=t.timeline)==null?void 0:g.abLoop)===!0,n.timeline.loop=((v=t.timeline)==null?void 0:v.loop)!==!1,n.timeline.animations=Array.isArray((b=t.timeline)==null?void 0:b.animations)&&t.timeline.animations.length?[...new Set(t.timeline.animations.filter(_=>typeof _=="string"&&_.trim()).map(_=>_.trim()))]:["animation"];for(const _ of n.spines){const E=a.get(_.id);if(_.assetVersion=Math.max(Number(_.assetVersion)||0,c.get(_.id)||0)+1,!E){_.status="empty",_.error=_.skeletonFileName?Ye("errors.missingEmbeddedSpine"):"",_.animations=[],_.bones=[],_.slots=[],_.selectedAnimation="";continue}cd(_.id,E),_.dataVersion=E.dataVersion,_.animations=E.animations,_.bones=E.bones,_.slots=E.slots,E.animations.some(S=>S.name===_.selectedAnimation)||(_.selectedAnimation=((y=E.animations[0])==null?void 0:y.name)||""),_.status="ready",_.error=""}n.syncSceneSequences(),kD(n,t.selection),n.timeline.playbackStart=Math.max(0,Math.floor(Number((x=t.timeline)==null?void 0:x.playbackStart)||0)),n.timeline.playbackEnd=h,n.timeline.frame=0,n.timeline.recorded=!1,n.timeline.playing=!0;for(const _ of n.systems)n.timeline.animations.includes(_.animation)||(_.animation=n.timeline.animations[0]);return n.recalcTotalFrames(),u&&(n.timeline.playbackEnd=n.timeline.totalFrames-1),n.timeline.frame=n.timeline.playbackStart,t}async function MT(n,e){return FD(n,CT(e))}async function LD(n,e){if(!/\.json$/i.test(e.name))throw new Error(Ye("errors.chooseJsonConfig"));return MT(n,await e.text())}const md=Go({undoCount:0});let xu=null,tr=null,zr=[],pl=null,ir=null,wu=!1;function Jg(n){return{systems:n.systems.map(t=>{const i=Zt(t);return i.frames=void 0,i}),colliders:Zt(n.colliders),paths:Zt(n.paths),spines:Zt(n.spines),animations:[...n.timeline.animations],settings:_T(n.settings)}}function Zg(n){return JSON.stringify(n,(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 AT(n,e=Jg(n),t=Zg(e)){const i=new Map;for(const s of e.spines){const r=hF(s.id);r&&i.set(s.id,r)}return{data:e,signature:t,spineAssets:i}}function Su(n){if(n){for(const e of n.spineAssets.values())lF(e);n.spineAssets.clear()}}function IT(n){for(;zr.length>n;)Su(zr.shift()||null);md.undoCount=zr.length}function PT(){const n=xu;if(!n||!tr||wu)return;const e=Jg(n),t=Zg(e);t!==tr.signature&&(zr.push(tr),tr=AT(n,e,t),IT(n.settings.undoLimit))}function OD(){wu||(ir&&clearTimeout(ir),ir=setTimeout(()=>{ir=null,PT()},250))}function $D(n){const e=n.activeObjectId;return n.activeObjectType==="particle"?n.systems.some(t=>t.id===e):n.activeObjectType==="collision"?n.colliders.some(t=>t.id===e):n.activeObjectType==="path"?n.paths.some(t=>t.id===e):n.spines.some(t=>t.id===e)}function ND(n){var t,i;if(!$D(n)){const s=n.systems[0],r=n.colliders[0],o=n.paths[0],a=n.spines[0];s?(n.activeObjectType="particle",n.activeObjectId=s.id):r?(n.activeObjectType="collision",n.activeObjectId=r.id):o?(n.activeObjectType="path",n.activeObjectId=o.id):(n.activeObjectType="spine",n.activeObjectId=(a==null?void 0:a.id)||0)}const e=n.activeObjectType==="particle"?n.systems.find(s=>s.id===n.activeObjectId):n.systems.find(s=>s.id===n.activeId);n.activeId=(e==null?void 0:e.id)||((t=n.systems[0])==null?void 0:t.id)||0,n.timeline.animation=(e==null?void 0:e.animation)||((i=n.systems[0])==null?void 0:i.animation)||n.timeline.animations[0]||"animation"}function DD(n,e){const t=tr;wu=!0;try{for(const i of n.spines)yc(i.id);n.systems=Zt(e.data.systems),n.colliders=Zt(e.data.colliders),n.paths=Zt(e.data.paths),n.spines=Zt(e.data.spines),n.timeline.animations=[...e.data.animations],Object.assign(n.settings,Zt(e.data.settings));for(const[i,s]of e.spineAssets)cd(i,s);for(const i of n.systems)i.frames=[];n.timeline.recorded=!1,n.timeline.playing=!1,ND(n),n.recalcTotalFrames(),tr=e}finally{wu=!1,Su(t)}}function BD(n){if(!(xu===n&&pl)){pl==null||pl(),ir&&clearTimeout(ir),Su(tr);for(const e of zr)Su(e);zr=[],xu=n,tr=AT(n),md.undoCount=0,pl=ei(()=>Zg(Jg(n)),OD,{flush:"post"})}}function UD(n,e){const t=Math.min(200,Math.max(1,Math.round(Number(e)||20)));n.settings.undoLimit=t,IT(t)}function RT(){const n=xu;if(!n||!tr)return!1;ir&&(clearTimeout(ir),ir=null),PT();const e=zr.pop();return e?(DD(n,e),md.undoCount=zr.length,!0):!1}function VD(n){const e=n instanceof HTMLElement?n:null;return!!(e!=null&&e.closest('input, textarea, select, [contenteditable="true"]'))}function XD(n){function e(i){var r;const s=i.target instanceof Node?i.target:null;n.canvasFocused.value=!!s&&!!((r=n.canvasElement.value)!=null&&r.contains(s))}function t(i){const s=i.key.toLowerCase();if((i.ctrlKey||i.metaKey)&&!i.altKey&&s==="s"){i.preventDefault(),i.stopPropagation(),n.save();return}if((i.ctrlKey||i.metaKey)&&!i.altKey&&s==="z"){i.preventDefault(),i.stopPropagation(),n.undo();return}if(i.ctrlKey||i.metaKey||i.altKey||VD(i.target))return;if(s==="d"){i.preventDefault(),n.togglePlay();return}if(s==="s"){i.preventDefault(),n.toStart();return}if(!n.canvasFocused.value)return;const r={q:"",w:"translate",e:"rotate",r:"scale"};s in r&&(i.preventDefault(),n.setTool(r[s]))}Sn(()=>{document.addEventListener("pointerdown",e,!0),window.addEventListener("keydown",t,!0)}),Za(()=>{document.removeEventListener("pointerdown",e,!0),window.removeEventListener("keydown",t,!0)})}const YD={class:"help-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"help-title"},GD={class:"help-head"},HD={id:"help-title"},jD=["aria-label","title"],WD={class:"help-body"},zD={class:"help-section help-start"},qD={class:"help-note"},KD={class:"help-grid"},JD={class:"help-section"},ZD={class:"help-list"},QD={class:"help-section"},e3={class:"shortcut-list"},t3={class:"help-note"},i3={class:"help-doc-title"},n3=["aria-expanded"],s3={class:"mtitle"},r3={class:"caret"},o3={class:"help-module-body"},a3={class:"help-list"},l3=["aria-expanded"],c3={class:"mtitle"},h3={class:"caret"},u3={class:"help-module-body"},d3={class:"help-list"},f3=["aria-expanded"],m3={class:"mtitle"},p3={class:"caret"},g3={class:"help-module-body"},v3={class:"help-list"},y3=["aria-expanded"],b3={class:"mtitle"},x3={class:"caret"},w3={class:"help-module-body"},S3={class:"help-list"},_3=["aria-expanded"],T3={class:"mtitle"},E3={class:"caret"},C3={class:"help-module-body"},M3={class:"help-list"},A3=["aria-expanded"],I3={class:"mtitle"},P3={class:"caret"},R3={class:"help-module-body"},k3={class:"help-list"},F3=["aria-expanded"],L3={class:"mtitle"},O3={class:"caret"},$3={class:"help-module-body"},N3={class:"help-list"},D3=["aria-expanded"],B3={class:"mtitle"},U3={class:"caret"},V3={class:"help-module-body"},X3={class:"help-list"},Y3=["aria-expanded"],G3={class:"mtitle"},H3={class:"caret"},j3={class:"help-module-body"},W3={class:"connector-intro"},z3={class:"help-list"},q3={class:"help-section help-export"},K3=qt({__name:"HelpDialog",props:{show:{type:Boolean}},emits:["close"],setup(n,{emit:e}){const t=e,i=De(Array.from({length:9},()=>!1));function s(){t("close")}function r(o){o.key==="Escape"&&s()}return Sn(()=>window.addEventListener("keydown",r)),eo(()=>window.removeEventListener("keydown",r)),(o,a)=>n.show?(Q(),te("div",{key:0,class:"help-overlay",role:"presentation",onClick:tt(s,["self"])},[w("section",YD,[w("header",GD,[w("div",null,[w("h2",HD,k(o.$t("help.title")),1),w("p",null,k(o.$t("help.subtitle")),1)]),w("button",{class:"help-close","aria-label":o.$t("help.close"),title:o.$t("help.closeShort"),onClick:s},"✕",8,jD)]),w("div",WD,[w("section",zD,[w("h3",null,k(o.$t("help.quickStart")),1),w("ol",null,[w("li",null,k(o.$t("help.stepCreate")),1),w("li",null,k(o.$t("help.stepEdit")),1),w("li",null,k(o.$t("help.stepPreview")),1),w("li",null,k(o.$t("help.stepExport")),1)]),w("p",qD,k(o.$t("help.quickNote")),1)]),w("div",KD,[w("section",JD,[w("h3",null,k(o.$t("help.commonOps")),1),w("dl",ZD,[w("div",null,[w("dt",null,k(o.$t("help.eye")),1),w("dd",null,k(o.$t("help.eyeDesc")),1)]),w("div",null,[a[9]||(a[9]=w("dt",null,"+Copy",-1)),w("dd",null,k(o.$t("help.copyDesc")),1)]),w("div",null,[w("dt",null,k(o.$t("toolbar.background")),1),w("dd",null,k(o.$t("help.backgroundDesc")),1)]),w("div",null,[w("dt",null,k(o.$t("toolbar.settings")),1),w("dd",null,k(o.$t("help.settingsDesc")),1)]),w("div",null,[w("dt",null,k(o.$t("help.undoShortcut")),1),w("dd",null,k(o.$t("help.undoDesc")),1)]),w("div",null,[a[10]||(a[10]=w("dt",null,"Spine Bone",-1)),w("dd",null,k(o.$t("help.spineBoneDesc")),1)])])]),w("section",QD,[w("h3",null,k(o.$t("help.shortcuts")),1),w("div",e3,[w("div",null,[a[11]||(a[11]=w("kbd",null,"Ctrl/⌘",-1)),a[12]||(a[12]=w("span",null,"+",-1)),a[13]||(a[13]=w("kbd",null,"Z",-1)),w("em",null,k(o.$t("help.undoShortcut")),1)]),w("div",null,[a[14]||(a[14]=w("kbd",null,"Ctrl/⌘",-1)),a[15]||(a[15]=w("span",null,"+",-1)),a[16]||(a[16]=w("kbd",null,"S",-1)),w("em",null,k(o.$t("help.saveShortcut")),1)]),w("div",null,[a[17]||(a[17]=w("kbd",null,"Q",-1)),w("em",null,k(o.$t("help.panShortcut")),1)]),w("div",null,[a[18]||(a[18]=w("kbd",null,"W",-1)),w("em",null,k(o.$t("help.translateShortcut")),1)]),w("div",null,[a[19]||(a[19]=w("kbd",null,"E",-1)),w("em",null,k(o.$t("help.rotateShortcut")),1)]),w("div",null,[a[20]||(a[20]=w("kbd",null,"R",-1)),w("em",null,k(o.$t("help.scaleShortcut")),1)]),w("div",null,[a[21]||(a[21]=w("kbd",null,"D",-1)),w("em",null,k(o.$t("help.playShortcut")),1)]),w("div",null,[a[22]||(a[22]=w("kbd",null,"S",-1)),w("em",null,k(o.$t("help.startShortcut")),1)])]),w("p",t3,k(o.$t("help.shortcutNote")),1)])]),w("div",i3,k(o.$t("help.modules")),1),w("section",{class:Pe(["help-section help-module",{open:i.value[0]}])},[w("button",{type:"button",class:"help-module-head","aria-expanded":i.value[0]?"true":"false",onClick:a[0]||(a[0]=c=>i.value[0]=!i.value[0])},[a[23]||(a[23]=w("span",{class:"mnum"},"1",-1)),w("span",s3,k(o.$t("help.configTitle")),1),w("span",r3,k(i.value[0]?"▾":"▸"),1)],8,n3),pe(w("div",o3,[w("dl",a3,[w("div",null,[w("dt",null,k(o.$t("config.save")),1),w("dd",null,k(o.$t("help.saveConfigDesc")),1)]),w("div",null,[w("dt",null,k(o.$t("config.load")),1),w("dd",null,k(o.$t("help.loadConfigDesc")),1)]),w("div",null,[w("dt",null,k(o.$t("config.selectPreset")),1),w("dd",null,k(o.$t("help.presetDesc")),1)]),w("div",null,[w("dt",null,k(o.$t("help.configScope")),1),w("dd",null,k(o.$t("help.configScopeDesc")),1)])])],512),[[Fi,i.value[0]]])],2),w("section",{class:Pe(["help-section help-module",{open:i.value[1]}])},[w("button",{type:"button",class:"help-module-head","aria-expanded":i.value[1]?"true":"false",onClick:a[1]||(a[1]=c=>i.value[1]=!i.value[1])},[a[24]||(a[24]=w("span",{class:"mnum"},"2",-1)),w("span",c3,k(o.$t("help.sceneTitle")),1),w("span",h3,k(i.value[1]?"▾":"▸"),1)],8,l3),pe(w("div",u3,[w("dl",d3,[w("div",null,[w("dt",null,k(o.$t("scene.particle")),1),w("dd",null,k(o.$t("help.particleDesc")),1)]),w("div",null,[w("dt",null,k(o.$t("scene.collision")),1),w("dd",null,k(o.$t("help.colliderDesc")),1)]),w("div",null,[w("dt",null,k(o.$t("scene.path")),1),w("dd",null,k(o.$t("help.pathDesc")),1)]),w("div",null,[a[25]||(a[25]=w("dt",null,"Spine",-1)),w("dd",null,k(o.$t("help.spineDesc")),1)]),w("div",null,[w("dt",null,k(o.$t("help.commonOps")),1),w("dd",null,k(o.$t("help.sceneCommonDesc")),1)])])],512),[[Fi,i.value[1]]])],2),w("section",{class:Pe(["help-section help-module",{open:i.value[2]}])},[w("button",{type:"button",class:"help-module-head","aria-expanded":i.value[2]?"true":"false",onClick:a[2]||(a[2]=c=>i.value[2]=!i.value[2])},[a[26]||(a[26]=w("span",{class:"mnum"},"3",-1)),w("span",m3,k(o.$t("emission.title")),1),w("span",p3,k(i.value[2]?"▾":"▸"),1)],8,f3),pe(w("div",g3,[w("dl",v3,[w("div",null,[w("dt",null,k(o.$t("emission.stream")),1),w("dd",null,k(o.$t("help.emissionDesc")),1)]),w("div",null,[w("dt",null,k(o.$t("emission.burst")),1),w("dd",null,k(o.$t("help.burstDesc")),1)]),w("div",null,[w("dt",null,k(o.$t("emission.delay")),1),w("dd",null,k(o.$t("help.delayDesc")),1)]),w("div",null,[w("dt",null,k(o.$t("modifiers.showShape")),1),w("dd",null,k(o.$t("help.loopNote")),1)])])],512),[[Fi,i.value[2]]])],2),w("section",{class:Pe(["help-section help-module",{open:i.value[3]}])},[w("button",{type:"button",class:"help-module-head","aria-expanded":i.value[3]?"true":"false",onClick:a[3]||(a[3]=c=>i.value[3]=!i.value[3])},[a[27]||(a[27]=w("span",{class:"mnum"},"4",-1)),w("span",b3,k(o.$t("emission.shapeTitle")),1),w("span",x3,k(i.value[3]?"▾":"▸"),1)],8,y3),pe(w("div",w3,[w("dl",S3,[w("div",null,[w("dt",null,k(o.$t("emission.shape")),1),w("dd",null,k(o.$t("help.shapeDesc")),1)]),w("div",null,[w("dt",null,k(o.$t("emission.emissionAngle")),1),w("dd",null,k(o.$t("help.angleDesc")),1)])])],512),[[Fi,i.value[3]]])],2),w("section",{class:Pe(["help-section help-module",{open:i.value[4]}])},[w("button",{type:"button",class:"help-module-head","aria-expanded":i.value[4]?"true":"false",onClick:a[4]||(a[4]=c=>i.value[4]=!i.value[4])},[a[28]||(a[28]=w("span",{class:"mnum"},"5",-1)),w("span",T3,k(o.$t("attributes.title")),1),w("span",E3,k(i.value[4]?"▾":"▸"),1)],8,_3),pe(w("div",C3,[w("dl",M3,[w("div",null,[w("dt",null,k(o.$t("attributes.initialParams")),1),w("dd",null,k(o.$t("help.initialDesc")),1)]),w("div",null,[w("dt",null,k(o.$t("attributes.lifecycleTitle")),1),w("dd",null,k(o.$t("help.overLifeDesc")),1)])])],512),[[Fi,i.value[4]]])],2),w("section",{class:Pe(["help-section help-module",{open:i.value[5]}])},[w("button",{type:"button",class:"help-module-head","aria-expanded":i.value[5]?"true":"false",onClick:a[5]||(a[5]=c=>i.value[5]=!i.value[5])},[a[29]||(a[29]=w("span",{class:"mnum"},"6",-1)),w("span",I3,k(o.$t("appearance.title")),1),w("span",P3,k(i.value[5]?"▾":"▸"),1)],8,A3),pe(w("div",R3,[w("dl",k3,[w("div",null,[w("dt",null,k(o.$t("appearance.opacity")),1),w("dd",null,k(o.$t("help.alphaDesc")),1)]),w("div",null,[w("dt",null,k(o.$t("appearance.imageResources")),1),w("dd",null,k(o.$t("help.imageDesc")),1)]),w("div",null,[w("dt",null,k(o.$t("image.sequence")),1),w("dd",null,k(o.$t("help.sequenceDesc")),1)])])],512),[[Fi,i.value[5]]])],2),w("section",{class:Pe(["help-section help-module",{open:i.value[6]}])},[w("button",{type:"button",class:"help-module-head","aria-expanded":i.value[6]?"true":"false",onClick:a[6]||(a[6]=c=>i.value[6]=!i.value[6])},[a[30]||(a[30]=w("span",{class:"mnum"},"7",-1)),w("span",L3,k(o.$t("modifiers.title")),1),w("span",O3,k(i.value[6]?"▾":"▸"),1)],8,F3),pe(w("div",$3,[w("dl",N3,[w("div",null,[w("dt",null,k(o.$t("modifiers.enableNoise")),1),w("dd",null,k(o.$t("help.noiseDesc")),1)]),w("div",null,[w("dt",null,k(o.$t("modifiers.enableGravity"))+" / "+k(o.$t("modifiers.enableWind")),1),w("dd",null,k(o.$t("help.gravityDesc")),1)]),w("div",null,[w("dt",null,k(o.$t("modifiers.enableForceField"))+" / "+k(o.$t("modifiers.enableVortex"))+" / "+k(o.$t("modifiers.enableAttraction")),1),w("dd",null,k(o.$t("help.forceDesc")),1)]),w("div",null,[w("dt",null,k(o.$t("modifiers.enableTrail")),1),w("dd",null,k(o.$t("help.trailDesc")),1)]),w("div",null,[w("dt",null,k(o.$t("modifiers.enableFollow")),1),w("dd",null,k(o.$t("help.followDesc")),1)]),w("div",null,[w("dt",null,k(o.$t("modifiers.enableCollision"))+" / "+k(o.$t("modifiers.damping")),1),w("dd",null,k(o.$t("help.collisionDesc")),1)])])],512),[[Fi,i.value[6]]])],2),w("section",{class:Pe(["help-section help-module",{open:i.value[7]}])},[w("button",{type:"button",class:"help-module-head","aria-expanded":i.value[7]?"true":"false",onClick:a[7]||(a[7]=c=>i.value[7]=!i.value[7])},[a[31]||(a[31]=w("span",{class:"mnum"},"8",-1)),w("span",B3,k(o.$t("export.title")),1),w("span",U3,k(i.value[7]?"▾":"▸"),1)],8,D3),pe(w("div",V3,[w("dl",X3,[w("div",null,[w("dt",null,k(o.$t("export.imagesPath")),1),w("dd",null,k(o.$t("help.exportDesc")),1)]),w("div",null,[w("dt",null,k(o.$t("export.spineVersion")),1),a[32]||(a[32]=w("dd",null,"3.8 / 4.0 / 4.1 / 4.2 / 4.3",-1))]),w("div",null,[w("dt",null,k(o.$t("export.keyframeCurve")),1),w("dd",null,k(o.$t("export.bezierHelp")),1)]),w("div",null,[w("dt",null,k(o.$t("export.fps")),1),w("dd",null,k(o.$t("export.fpsHelp")),1)]),w("div",null,[w("dt",null,k(o.$t("export.title")),1),w("dd",null,k(o.$t("help.exportButtonsDesc")),1)])])],512),[[Fi,i.value[7]]])],2),w("section",{class:Pe(["help-section help-module help-connector",{open:i.value[8]}])},[w("button",{type:"button",class:"help-module-head","aria-expanded":i.value[8]?"true":"false",onClick:a[8]||(a[8]=c=>i.value[8]=!i.value[8])},[a[33]||(a[33]=w("span",{class:"mnum"},"9",-1)),w("span",G3,k(o.$t("help.connectorTitle")),1),w("span",H3,k(i.value[8]?"▾":"▸"),1)],8,Y3),pe(w("div",j3,[w("p",W3,k(o.$t("help.connectorIntro")),1),w("dl",z3,[w("div",null,[w("dt",null,k(o.$t("help.prerequisite")),1),w("dd",null,k(o.$t("help.prerequisiteDesc")),1)]),w("div",null,[w("dt",null,k(o.$t("help.download")),1),a[34]||(a[34]=w("dd",null,[w("a",{class:"dl-link",href:"/downloads/connector/SpineParticleConnector-windows-x64.exe",download:""},[yt("Windows"),w("br"),w("small",null,"SpineParticleConnector-windows-x64.exe")]),w("a",{class:"dl-link",href:"/downloads/connector/SpineParticleConnector-macos-universal.zip",download:""},[yt("macOS (Universal)"),w("br"),w("small",null,"SpineParticleConnector-macos-universal.zip")])],-1))]),w("div",null,[w("dt",null,k(o.$t("help.webSide")),1),w("dd",null,k(o.$t("help.webSideDesc")),1)]),w("div",null,[w("dt",null,k(o.$t("help.authorization")),1),w("dd",null,k(o.$t("help.authorizationDesc")),1)]),w("div",null,[w("dt",null,k(o.$t("help.pathSetup")),1),w("dd",null,k(o.$t("help.pathSetupDesc")),1)]),w("div",null,[w("dt",null,k(o.$t("help.downloadResult")),1),w("dd",null,k(o.$t("help.downloadResultDesc")),1)]),w("div",null,[w("dt",null,k(o.$t("help.version")),1),w("dd",null,k(o.$t("help.versionDesc")),1)]),w("div",null,[w("dt",null,k(o.$t("help.security")),1),w("dd",null,k(o.$t("help.securityDesc")),1)])])],512),[[Fi,i.value[8]]])],2),w("section",q3,[w("h3",null,k(o.$t("help.differenceTitle")),1),w("p",null,k(o.$t("help.differenceDesc")),1)])])])])):_e("",!0)}}),li=(n,e)=>{const t=n.__vccOpts||n;for(const[i,s]of e)t[i]=s;return t},J3=li(K3,[["__scopeId","data-v-4bb9bc76"]]);function Na(n){const e=()=>{window.removeEventListener("pointermove",n),window.removeEventListener("pointerup",e),window.removeEventListener("pointercancel",e)};window.addEventListener("pointermove",n),window.addEventListener("pointerup",e),window.addEventListener("pointercancel",e)}function Pn(n,e,t){const i=n.holder.value,s=n.app(),r=i.getBoundingClientRect(),o=Math.max(1e-4,n.store.editor.viewScale),a=e-r.left,c=t-r.top;return{x:(a-s.screen.width/2-n.store.editor.viewX)/o,y:-(c-s.screen.height*.5-n.store.editor.viewY)/o}}function Z3(n,e){const t=n.holder.value,i=n.app(),s=n.store,r=t.getBoundingClientRect(),o=e.clientX-r.left,a=e.clientY-r.top,c=e.deltaY<0?1.12:1/1.12,l=s.editor.viewScale,h=Math.max(.01,l*c),u=i.screen.width/2,d=i.screen.height*.5,f=s.editor.viewX,m=s.editor.viewY,p=(o-u-f)/l,g=(a-d-m)/l;s.editor.viewX=o-u-p*h,s.editor.viewY=a-d-g*h,s.editor.viewScale=h}function Q3(n,e,t){const i=n.store,s=i.editor.viewX,r=i.editor.viewY;Na(o=>{i.editor.viewX=s+(o.clientX-e),i.editor.viewY=r+(o.clientY-t)})}function kT(n,e){const t=Math.max(.01,n.store.editor.viewScale*e);n.store.editor.viewScale=t}function eB(n){kT(n,1.2)}function tB(n){kT(n,1/1.2)}function iB(n){n.store.editor.viewScale=1,n.store.editor.viewX=0,n.store.editor.viewY=0}function nB(n){n.store.editor.viewScale=1,n.store.editor.viewX=0,n.store.editor.viewY=0}function sB(n){n.store.settings.showGrid=!n.store.settings.showGrid}const rB={class:"topbar"},oB=["title"],aB=["disabled","title"],lB={class:"tool-group"},cB=["title"],hB=["title"],uB=["title"],dB=["title"],fB={class:"tool-group"},mB=["title"],pB=["title"],gB=["title"],vB=["title"],yB=["title"],bB=["title"],xB={key:0,class:"background-panel"},wB=["disabled"],SB=["title"],_B={class:"background-position-row"},TB=["aria-label"],EB=["aria-label"],CB={class:"background-opacity-row"},MB=["aria-label"],AB={class:"language-picker"},IB=["value","aria-label"],PB=["value"],RB=["title"],kB={class:"zoom-pct"},FB=qt({__name:"StageToolbar",props:{ctx:{},activeTool:{},showSettings:{type:Boolean},showHelp:{type:Boolean}},emits:["update:activeTool","update:showSettings","update:showHelp","clear-background","background-file"],setup(n,{emit:e}){const t=n,i=e,s=Wo(),{t:r,locale:o}=fn(),a=De(!1),c=De(null),l=Fe(()=>s.settings.backgroundImageName);function h(b){i("update:activeTool",t.activeTool===b?"":b)}function u(){a.value=!a.value,a.value&&i("update:showSettings",!1)}function d(){const b=!t.showSettings;i("update:showSettings",b),b&&(a.value=!1)}function f(){i("update:showHelp",!0),a.value=!1,i("update:showSettings",!1)}function m(b){i("background-file",b)}function p(b=!0){c.value&&(c.value.value=""),i("clear-background",b)}function g(){RT()}function v(b){const y=b.target.value;g_(y)}return(b,y)=>(Q(),te("div",rB,[w("button",{class:"settings-btn",onClick:d,title:I(r)("toolbar.settings")},k(I(r)("toolbar.settings")),9,oB),w("button",{class:"undo-btn",disabled:I(md).undoCount===0,onClick:g,title:I(r)("toolbar.undo")},"↶",8,aB),w("div",lB,[w("button",{class:Pe(["tool-btn",{on:n.activeTool===""}]),onClick:y[0]||(y[0]=x=>h("")),title:I(r)("toolbar.pan")},"✋",10,cB),w("button",{class:Pe(["tool-btn",{on:n.activeTool==="translate"}]),onClick:y[1]||(y[1]=x=>h("translate")),title:I(r)("toolbar.translate")},"✥",10,hB),w("button",{class:Pe(["tool-btn",{on:n.activeTool==="rotate"}]),onClick:y[2]||(y[2]=x=>h("rotate")),title:I(r)("toolbar.rotate")},"⟳",10,uB),w("button",{class:Pe(["tool-btn",{on:n.activeTool==="scale"}]),onClick:y[3]||(y[3]=x=>h("scale")),title:I(r)("toolbar.scale")},"⤢",10,dB)]),w("div",fB,[w("button",{class:"tool-btn",onClick:y[4]||(y[4]=x=>I(eB)(n.ctx)),title:I(r)("toolbar.zoomIn")},"+",8,mB),w("button",{class:"tool-btn",onClick:y[5]||(y[5]=x=>I(tB)(n.ctx)),title:I(r)("toolbar.zoomOut")},"-",8,pB),w("button",{class:"tool-btn",onClick:y[6]||(y[6]=x=>I(iB)(n.ctx)),title:I(r)("toolbar.fitView")},"⤢",8,gB),w("button",{class:Pe(["tool-btn",{on:I(s).settings.showGrid}]),onClick:y[7]||(y[7]=x=>I(sB)(n.ctx)),title:I(r)("toolbar.toggleGrid")},"▦",10,vB),w("button",{class:"tool-btn",onClick:y[8]||(y[8]=x=>I(nB)(n.ctx)),title:I(r)("toolbar.resetView")},"⟳",8,yB)]),w("div",{class:"background-menu",onClick:y[14]||(y[14]=tt(()=>{},["stop"]))},[w("button",{class:Pe(["background-btn",{on:a.value}]),title:I(r)("toolbar.backgroundSettings"),onClick:u},k(I(r)("toolbar.background")),11,bB),a.value?(Q(),te("div",xB,[w("button",{class:"background-upload",onClick:y[9]||(y[9]=x=>{var _;return(_=c.value)==null?void 0:_.click()})},k(l.value?I(r)("toolbar.changeBackground"):I(r)("toolbar.uploadBackground")),1),w("button",{class:"background-clear",disabled:!l.value,onClick:y[10]||(y[10]=x=>p())},k(I(r)("toolbar.clearBackground")),9,wB),w("input",{ref_key:"backgroundFileInput",ref:c,class:"background-file-input",type:"file",accept:"image/png,image/jpeg,image/webp",onChange:m},null,544),w("div",{class:"background-file-name",title:l.value},k(l.value||I(r)("toolbar.noBackground")),9,SB),w("div",_B,[w("label",null,[y[15]||(y[15]=w("span",null,"X",-1)),pe(w("input",{"onUpdate:modelValue":y[11]||(y[11]=x=>I(s).settings.backgroundX=x),type:"number",step:"1","aria-label":I(r)("toolbar.backgroundX")},null,8,TB),[[Je,I(s).settings.backgroundX,void 0,{number:!0}]])]),w("label",null,[y[16]||(y[16]=w("span",null,"Y",-1)),pe(w("input",{"onUpdate:modelValue":y[12]||(y[12]=x=>I(s).settings.backgroundY=x),type:"number",step:"1","aria-label":I(r)("toolbar.backgroundY")},null,8,EB),[[Je,I(s).settings.backgroundY,void 0,{number:!0}]])])]),w("label",CB,[w("span",null,k(I(r)("toolbar.opacity")),1),pe(w("input",{"onUpdate:modelValue":y[13]||(y[13]=x=>I(s).settings.backgroundOpacity=x),type:"range",min:"0",max:"1",step:"0.01","aria-label":I(r)("toolbar.backgroundOpacity")},null,8,MB),[[Je,I(s).settings.backgroundOpacity,void 0,{number:!0}]]),w("b",null,k(Math.round(I(s).settings.backgroundOpacity*100))+"%",1)])])):_e("",!0)]),w("label",AB,[w("span",null,k(I(r)("language.label")),1),w("select",{value:I(o),"aria-label":I(r)("language.label"),onChange:v},[(Q(!0),te(Me,null,It(I(f_),x=>(Q(),te("option",{key:x.code,value:x.code},k(x.label),9,PB))),128))],40,IB)]),w("button",{class:Pe(["help-btn",{on:n.showHelp}]),title:I(r)("toolbar.openHelp"),onClick:f},k(I(r)("toolbar.help")),11,RB),w("span",kB,k(Math.round(I(s).editor.viewScale*100))+"%",1)]))}}),LB=li(FB,[["__scopeId","data-v-6411b316"]]),OB={key:0,class:"settings-panel"},$B={class:"sp-head"},NB={class:"sp-section-title"},DB={class:"sp-switch-row"},BB={class:"sp-switch-control"},UB=["aria-label"],VB={class:"sp-section-title"},XB={class:"sp-row"},YB=["aria-label"],GB={class:"sp-section-title"},HB={class:"sp-chk"},jB={class:"sp-chk"},WB={class:"sp-row"},zB=["aria-label"],qB={class:"sp-row"},KB=["aria-label"],JB={class:"sp-chk"},ZB={class:"sp-chk"},QB={class:"sp-row"},e4={class:"sp-row"},t4={class:"sp-row"},i4={class:"sp-hex"},n4={class:"sp-chk"},s4={class:"sp-cache-note"},r4=qt({__name:"StageSettingsPanel",props:{show:{type:Boolean}},emits:["close"],setup(n,{emit:e}){const t=e,i=Wo(),{t:s}=fn();function r(a){UD(i,Number(a.target.value))}function o(){i.settings.bonePointDrawSize=Math.min(10,Math.max(.1,Number(i.settings.bonePointDrawSize)||1)),i.settings.boneAxisDrawSize=Math.min(10,Math.max(.1,Number(i.settings.boneAxisDrawSize)||2))}return(a,c)=>n.show?(Q(),te("div",OB,[w("div",$B,[yt(k(I(s)("settings.title"))+" ",1),w("button",{class:"sp-close",onClick:c[0]||(c[0]=l=>t("close"))},"✕")]),w("div",NB,k(I(s)("settings.layout")),1),w("label",DB,[w("span",null,k(I(s)("settings.parameterPanelPosition")),1),w("span",BB,[pe(w("input",{type:"checkbox","onUpdate:modelValue":c[1]||(c[1]=l=>I(i).settings.parameterPanelOnRight=l),"aria-label":I(s)("settings.panelOnRight")},null,8,UB),[[_t,I(i).settings.parameterPanelOnRight]]),c[15]||(c[15]=w("span",{class:"sp-switch-ui","aria-hidden":"true"},null,-1)),w("b",null,k(I(i).settings.parameterPanelOnRight?I(s)("common.right"):I(s)("common.left")),1)])]),c[16]||(c[16]=w("div",{class:"sp-divider"},null,-1)),w("div",VB,k(I(s)("settings.history")),1),w("label",XB,[w("span",null,k(I(s)("settings.maxUndo")),1),pe(w("input",{class:"sp-num sp-undo-limit",type:"number",min:"1",max:"200","onUpdate:modelValue":c[2]||(c[2]=l=>I(i).settings.undoLimit=l),"aria-label":I(s)("settings.maxUndo"),onChange:r},null,40,YB),[[Je,I(i).settings.undoLimit,void 0,{number:!0}]])]),c[17]||(c[17]=w("div",{class:"sp-divider"},null,-1)),w("div",GB,k(I(s)("settings.canvasGuides")),1),w("label",HB,[pe(w("input",{type:"checkbox","onUpdate:modelValue":c[3]||(c[3]=l=>I(i).settings.showEmitter=l)},null,512),[[_t,I(i).settings.showEmitter]]),yt(k(I(s)("settings.emitter")),1)]),w("label",jB,[pe(w("input",{type:"checkbox","onUpdate:modelValue":c[4]||(c[4]=l=>I(i).settings.showBones=l)},null,512),[[_t,I(i).settings.showBones]]),yt(k(I(s)("settings.bones")),1)]),I(i).settings.showBones?(Q(),te(Me,{key:0},[w("label",WB,[w("span",null,k(I(s)("settings.bonePointSize")),1),pe(w("input",{class:"sp-num",type:"number",min:"0.1",max:"10",step:"0.1","onUpdate:modelValue":c[5]||(c[5]=l=>I(i).settings.bonePointDrawSize=l),"aria-label":I(s)("settings.bonePointSize"),onChange:o},null,40,zB),[[Je,I(i).settings.bonePointDrawSize,void 0,{number:!0}]])]),w("label",qB,[w("span",null,k(I(s)("settings.boneAxisSize")),1),pe(w("input",{class:"sp-num",type:"number",min:"0.1",max:"10",step:"0.1","onUpdate:modelValue":c[6]||(c[6]=l=>I(i).settings.boneAxisDrawSize=l),"aria-label":I(s)("settings.boneAxisSize"),onChange:o},null,40,KB),[[Je,I(i).settings.boneAxisDrawSize,void 0,{number:!0}]])])],64)):_e("",!0),w("label",JB,[pe(w("input",{type:"checkbox","onUpdate:modelValue":c[7]||(c[7]=l=>I(i).settings.showSkinMesh=l)},null,512),[[_t,I(i).settings.showSkinMesh]]),yt(k(I(s)("settings.skinMesh")),1)]),c[18]||(c[18]=w("div",{class:"sp-divider"},null,-1)),w("label",ZB,[pe(w("input",{type:"checkbox","onUpdate:modelValue":c[8]||(c[8]=l=>I(i).settings.tickEnabled=l)},null,512),[[_t,I(i).settings.tickEnabled]]),yt(k(I(s)("settings.enableTicks")),1)]),I(i).settings.tickEnabled?(Q(),te(Me,{key:1},[w("label",QB,[w("span",null,k(I(s)("settings.tickFontSize")),1),pe(w("input",{type:"range",min:"8",max:"40",step:"1","onUpdate:modelValue":c[9]||(c[9]=l=>I(i).settings.axisFontSize=l)},null,512),[[Je,I(i).settings.axisFontSize,void 0,{number:!0}]]),pe(w("input",{type:"number",min:"8",max:"40","onUpdate:modelValue":c[10]||(c[10]=l=>I(i).settings.axisFontSize=l),class:"sp-num"},null,512),[[Je,I(i).settings.axisFontSize,void 0,{number:!0}]])]),w("label",e4,[w("span",null,k(I(s)("settings.tickWidth")),1),pe(w("input",{type:"range",min:"1",max:"5",step:"0.5","onUpdate:modelValue":c[11]||(c[11]=l=>I(i).settings.tickWidth=l)},null,512),[[Je,I(i).settings.tickWidth,void 0,{number:!0}]]),pe(w("input",{type:"number",min:"1",max:"5","onUpdate:modelValue":c[12]||(c[12]=l=>I(i).settings.tickWidth=l),class:"sp-num"},null,512),[[Je,I(i).settings.tickWidth,void 0,{number:!0}]])]),w("label",t4,[w("span",null,k(I(s)("settings.axisColor")),1),pe(w("input",{type:"color","onUpdate:modelValue":c[13]||(c[13]=l=>I(i).settings.axisColor=l),class:"sp-colr"},null,512),[[Je,I(i).settings.axisColor]]),w("span",i4,k(I(i).settings.axisColor),1)]),w("label",n4,[pe(w("input",{type:"checkbox","onUpdate:modelValue":c[14]||(c[14]=l=>I(i).settings.showAxisLabels=l)},null,512),[[_t,I(i).settings.showAxisLabels]]),yt(k(I(s)("settings.showAxisLabels")),1)])],64)):_e("",!0),w("div",s4,k(I(s)("settings.cacheNote")),1)])):_e("",!0)}}),o4=li(r4,[["__scopeId","data-v-c1ded952"]]);class vm{constructor(){T(this,"sprite",null);T(this,"texture",null);T(this,"loadVersion",0)}createSprite(e){const t=new to(it.EMPTY);return t.anchor.set(.5),t.visible=!1,e.addChild(t),this.sprite=t,t}applyTransform(e,t,i){this.sprite&&(this.sprite.position.set(Number(e)||0,-(Number(t)||0)),this.sprite.alpha=Math.min(1,Math.max(0,Number(i)||0)))}async syncTexture(e){const t=++this.loadVersion;if(!e){this.sprite&&(this.sprite.texture=it.EMPTY,this.sprite.visible=!1),this.texture&&this.texture.destroy(!0),this.texture=null;return}try{const i=await it.fromURL(e);if(t!==this.loadVersion||!this.sprite){i.destroy(!0);return}const s=this.texture;this.texture=i,this.sprite.texture=i,this.sprite.visible=!0,s&&s.destroy(!0)}catch(i){console.error("背景图恢复失败",i)}}static clearStoreBackground(e,t){e.settings.backgroundImageData="",e.settings.backgroundImageName="",t&&(e.settings.backgroundX=0,e.settings.backgroundY=0,e.settings.backgroundOpacity=1)}static async handleFileChange(e,t){var r;const i=t.target,s=(r=i.files)==null?void 0:r[0];if(s)try{e.settings.backgroundImageData=await Ph(s),e.settings.backgroundImageName=s.name}catch(o){console.error("背景图加载失败",o)}finally{i.value=""}}destroy(){this.loadVersion++,this.texture&&this.texture.destroy(!0),this.texture=null,this.sprite=null}}class a4{constructor(e){T(this,"selectedNodes",new Set);T(this,"suppressNextDoubleClick",!1);this.ctx=e}resetSelection(){this.selectedNodes.clear()}activePath(){const e=this.ctx.store;if(e.activeObjectType!=="path")return null;const t=e.paths.find(i=>i.id===e.activeObjectId)||null;return(t==null?void 0:t.visible)===!1?null:t}pathInsertIndex(e,t,i){if(e.points.length<2)return e.points.length;const s=e.closed?e.points.length:e.points.length-1;let r=e.points.length,o=1/0;for(let a=0;aMath.hypot(c.x-s.x,c.y-s.y)<=r);if(o>=0){t.points.splice(o,1),this.selectedNodes.clear();return}const a=this.pathInsertIndex(t,s.x,s.y);t.points.splice(a,0,{x:s.x,y:s.y,inX:0,inY:0,outX:0,outY:0}),this.selectedNodes.clear(),this.selectedNodes.add(a)}onPointerDown(e){const t=this.activePath();if(!t||!t.enabled)return!1;const i=Pn(this.ctx,e.clientX,e.clientY),s=aa(t,i.x,i.y),r=9/Math.max(.01,this.ctx.store.editor.viewScale);if(e.detail>=2){if(t.points.findIndex(u=>Math.hypot(u.x-s.x,u.y-s.y)<=r)>=0)return!0;const l={x:s.x,y:s.y,inX:0,inY:0,outX:0,outY:0},h=this.pathInsertIndex(t,s.x,s.y);return t.points.splice(h,0,l),this.selectedNodes.clear(),this.selectedNodes.add(h),this.suppressNextDoubleClick=!0,Na(u=>{const d=Pn(this.ctx,u.clientX,u.clientY),f=aa(t,d.x,d.y);l.outX=f.x-l.x,l.outY=f.y-l.y,l.inX=-l.outX,l.inY=-l.outY}),!0}let o=null;for(const c of this.selectedNodes){const l=t.points[c];l&&(Math.hypot(l.x+l.inX-s.x,l.y+l.inY-s.y)<=r&&(o={index:c,side:"in"}),Math.hypot(l.x+l.outX-s.x,l.y+l.outY-s.y)<=r&&(o={index:c,side:"out"}))}if(o){const c=t.points[o.index],l=o.side==="in"?Math.hypot(c.outX,c.outY):Math.hypot(c.inX,c.inY);return Na(u=>{const d=Pn(this.ctx,u.clientX,u.clientY),f=aa(t,d.x,d.y),m=f.x-c.x,p=f.y-c.y;if(o.side==="in"?(c.inX=m,c.inY=p):(c.outX=m,c.outY=p),!u.altKey){const g=Math.max(1e-4,Math.hypot(m,p)),v=u.shiftKey?g:l;o.side==="in"?(c.outX=-m/g*v,c.outY=-p/g*v):(c.inX=-m/g*v,c.inY=-p/g*v)}}),!0}const a=t.points.findIndex(c=>Math.hypot(c.x-s.x,c.y-s.y)<=r);if(a>=0){if(e.altKey)return this.selectedNodes.delete(a),!0;e.ctrlKey||e.metaKey?this.selectedNodes.add(a):this.selectedNodes.has(a)||(this.selectedNodes.clear(),this.selectedNodes.add(a));const c=s,l=[...this.selectedNodes].map(u=>({index:u,x:t.points[u].x,y:t.points[u].y}));return Na(u=>{const d=Pn(this.ctx,u.clientX,u.clientY),f=aa(t,d.x,d.y);for(const m of l)t.points[m.index].x=m.x+f.x-c.x,t.points[m.index].y=m.y+f.y-c.y}),!0}if(e.altKey&&!e.ctrlKey&&!e.metaKey)return this.selectedNodes.clear(),!0;if(e.ctrlKey||e.metaKey||e.altKey){const c=s,l=e.altKey,h=u=>{const d=Pn(this.ctx,u.clientX,u.clientY),f=aa(t,d.x,d.y),m=Math.min(c.x,f.x),p=Math.max(c.x,f.x),g=Math.min(c.y,f.y),v=Math.max(c.y,f.y);t.points.forEach((b,y)=>{b.x>=m&&b.x<=p&&b.y>=g&&b.y<=v&&(l?this.selectedNodes.delete(y):this.selectedNodes.add(y))}),window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",h)};return window.addEventListener("pointerup",h),window.addEventListener("pointercancel",h),!0}return!1}}class l4{constructor(e,t){this.ctx=e,this.getTool=t}onColliderPointerDown(e){const t=this.ctx.store;if(t.activeObjectType!=="collision")return!1;const i=t.colliders.find(b=>b.id===t.activeObjectId);if(!(i!=null&&i.enabled)||i.visible===!1)return!1;const s=Pn(this.ctx,e.clientX,e.clientY),r=i.rotation*Math.PI/180,o=Math.cos(r),a=Math.sin(r),c=Math.max(1e-4,Math.abs(i.scaleX??1)),l=Math.max(1e-4,Math.abs(i.scaleY??1)),h=s.x-i.x,u=s.y-i.y,d=(o*h+a*u)/c,f=(-a*h+o*u)/l;if(!(i.shape==="circle"?Math.hypot(d,f)<=i.radius:i.shape==="ellipse"?Math.hypot(d/Math.max(1,i.radiusX),f/Math.max(1,i.radiusY))<=1:Math.abs(d)<=i.width*.5&&Math.abs(f)<=i.height*.5))return!1;const p=i.x,g=i.y,v=s;return Na(b=>{const y=Pn(this.ctx,b.clientX,b.clientY);i.x=p+y.x-v.x,i.y=g+y.y-v.y}),!0}onForceFieldDown(e){const t=this.ctx.store.systems.find(h=>h.id===this.ctx.store.activeId);if((t==null?void 0:t.visible)===!1)return!1;const i=t==null?void 0:t.config;if(!(i!=null&&i.forceField)||!i.showForceFieldShape||i.forceRadius<=0)return!1;const s=Pn(this.ctx,e.clientX,e.clientY);if(Math.hypot(s.x-i.forceCenterX,s.y-i.forceCenterY)>i.forceRadius)return!1;const o=i.forceCenterX,a=i.forceCenterY;this.ctx.holder.value&&(this.ctx.holder.value.style.cursor="grabbing");const c=h=>{const u=Pn(this.ctx,h.clientX,h.clientY);i.forceCenterX=o+u.x-s.x,i.forceCenterY=a+u.y-s.y},l=()=>{this.ctx.holder.value&&(this.ctx.holder.value.style.cursor=""),window.removeEventListener("pointermove",c),window.removeEventListener("pointerup",l),window.removeEventListener("pointercancel",l)};return window.addEventListener("pointermove",c),window.addEventListener("pointerup",l),window.addEventListener("pointercancel",l),e.preventDefault(),!0}onAttractionDown(e){const t=this.ctx.store.systems.find(u=>u.id===this.ctx.store.activeId);if((t==null?void 0:t.visible)===!1)return!1;const i=t==null?void 0:t.config;if(!(i!=null&&i.attraction)||!i.showAttractionShape)return!1;const s=Pn(this.ctx,e.clientX,e.clientY),r=Math.max(i.attractionRadius,12/Math.max(1e-4,this.ctx.store.editor.viewScale));if(Math.hypot(s.x-i.attractionCenterX,s.y-i.attractionCenterY)>r)return!1;const a=i.attractionCenterX,c=i.attractionCenterY;this.ctx.holder.value&&(this.ctx.holder.value.style.cursor="grabbing");const l=u=>{const d=Pn(this.ctx,u.clientX,u.clientY);i.attractionCenterX=a+d.x-s.x,i.attractionCenterY=c+d.y-s.y},h=()=>{this.ctx.holder.value&&(this.ctx.holder.value.style.cursor=""),window.removeEventListener("pointermove",l),window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",h)};return window.addEventListener("pointermove",l),window.addEventListener("pointerup",h),window.addEventListener("pointercancel",h),e.preventDefault(),!0}selectedTransformTarget(){const e=this.ctx.store,t=e.activeObjectId;if(e.activeObjectType==="particle"){const r=e.systems.find(a=>a.id===t);if(!r||r.visible===!1)return null;const o=r.config;return{x:o.centerX,y:o.centerY,rotation:o.rootRotation,scaleX:o.rootScaleX??1,scaleY:o.rootScaleY??1,setPosition:(a,c)=>{o.centerX=a,o.centerY=c},setRotation:a=>{o.rootRotation=a},setScale:(a,c)=>{o.rootScaleX=a,o.rootScaleY=c}}}const s=(e.activeObjectType==="collision"?e.colliders:e.activeObjectType==="path"?e.paths:e.spines).find(r=>r.id===t);return!s||s.visible===!1?null:{x:Number(s.x)||0,y:Number(s.y)||0,rotation:Number(s.rotation)||0,scaleX:Math.max(.05,Number(s.scaleX)||1),scaleY:Math.max(.05,Number(s.scaleY)||1),setPosition:(r,o)=>{s.x=r,s.y=o},setRotation:r=>{s.rotation=r},setScale:(r,o)=>{s.scaleX=r,s.scaleY=o}}}onGizmoDown(e){const t=this.selectedTransformTarget();if(!t)return;const i=this.ctx.app(),s=this.ctx.store,r=s.editor.viewScale,o=this.ctx.holder.value.getBoundingClientRect(),a=o.left+i.screen.width/2+s.editor.viewX+t.x*r,c=o.top+i.screen.height*.5+s.editor.viewY+-t.y*r,l=e.clientX,h=e.clientY,u=this.getTool(),d=t.x,f=t.y,m=t.rotation,p=t.scaleX,g=t.scaleY,v=Math.hypot(l-a,h-c)||1,b=Math.atan2(h-c,l-a);Na(x=>{const _=(x.clientX-l)/r,E=(x.clientY-h)/r;if(u==="translate")t.setPosition(d+_,f-E);else if(u==="rotate"){const S=Math.atan2(x.clientY-c,x.clientX-a);t.setRotation(m-(S-b)*180/Math.PI)}else if(u==="scale"){const C=Math.hypot(x.clientX-a,x.clientY-c)/v;t.setScale(Math.max(.05,p*C),Math.max(.05,g*C))}})}}function t1(n,e,t,i,s){const r=1-s;return r*r*r*n+3*r*r*s*e+3*r*s*s*t+s*s*s*i}function i1(n,e,t){const i=n.rotation*Math.PI/180,s=Math.cos(i),r=Math.sin(i),o=Math.max(1e-4,Math.abs(n.scaleX??1)),a=Math.max(1e-4,Math.abs(n.scaleY??1));return{x:n.x+s*e*o-r*t*a,y:n.y+r*e*o+s*t*a}}function Qg(n,e){if(!n.points.length)return null;if(n.points.length===1)return{...i1(n,n.points[0].x,n.points[0].y),angle:n.rotation};const t=n.closed?n.points.length:n.points.length-1,i=[];let s=0;for(let m=0;m0&&v===0)continue;const b=v/20,y=t1(p.x,p.x+p.outX,g.x+g.inX,g.x,b),x=t1(p.y,p.y+p.outY,g.y+g.inY,g.y,b),_=i1(n,y,x),E=i[i.length-1];E&&(s+=Math.hypot(_.x-E.x,_.y-E.y)),i.push({..._,distance:s})}}const r=Math.min(1,Math.max(0,e))*s;let o=i.findIndex(m=>m.distance>=r);o<0&&(o=i.length-1);const a=i[o],c=i[Math.max(0,o-1)],l=i[Math.min(i.length-1,o+1)],h=c.distance,u=o>0?(r-h)/Math.max(1e-4,a.distance-h):0,d=c.x+(a.x-c.x)*Math.min(1,Math.max(0,u)),f=c.y+(a.y-c.y)*Math.min(1,Math.max(0,u));return{x:d,y:f,angle:Math.atan2(l.y-c.y,l.x-c.x)*180/Math.PI}}function c4(n,e,t){if(e.renderLayerMode!=="slot")return null;const i=n.find(o=>o.id===e.renderLayerSpineId&&o.enabled&&o.status==="ready");if(!i)return null;const s=i.slots||[],r=s.find(o=>o.name===e.renderLayerSlotName);if(!r)return null;if(e.renderLayerSlotPosition==="below"){let o="";if(t!=null&&t.length){const a=t.indexOf(r.name);if(a===0)return null;a>0&&(o=t[a-1])}if(!o){const a=s.filter(c=>c.orderl.order-c.order)[0];if(!a)return null;o=a.name}return{spineId:i.id,slotName:o,targetSlotName:r.name,followAttachment:!1}}return{spineId:i.id,slotName:r.name,targetSlotName:r.name,followAttachment:e.renderLayerFollowAttachment}}function _u(n,e,t,i=Math.max(1e-4,Math.abs(n.rootScaleX)),s=Math.max(1e-4,Math.abs(n.rootScaleY))){const r=-n.rootRotation*Math.PI/180,o=Math.cos(r),a=Math.sin(r),c=e-n.centerX,l=-t+n.centerY;return{x:(o*c+a*l)/i,y:(-a*c+o*l)/s}}function h4(n,e,t){const i=Qg(e,t);if(!i)return null;const s=_u(n,i.x,i.y),r=i.angle*Math.PI/180,o=_u(n,i.x+Math.cos(r),i.y+Math.sin(r)),a=Math.atan2(o.y-s.y,o.x-s.x)*180/Math.PI;return{...s,angle:a}}function u4(n,e){return n.colliders.map(t=>{if(!t.followPath||!t.followPathId)return t;const i=n.paths.find(h=>h.id===t.followPathId&&h.enabled);if(!(i!=null&&i.points.length))return t;const s=Math.max(.05,Number(t.followDuration)||2),r=Math.min(1,Math.max(0,e/s)),o=Array.isArray(t.followCurve)?t.followCurve:[{x:0,y:0},{x:1,y:1}],a=t.followCurveMode==="跟随导出"?n.settings.exportSettings.keyframeCurve==="bezier"?"bezier":"linear":t.followCurveMode==="贝塞尔"?"bezier":"linear",c=Math.min(1,Math.max(0,b_(o,r,a))),l=Qg(i,c);return l?{...t,x:l.x,y:l.y,rotation:t.rotation+(t.followPathRotation?l.angle:0)}:t})}class d4{constructor(){T(this,"emitters",new Map);T(this,"configs",new Map);T(this,"store",null);T(this,"eventsSuspended",!1);T(this,"subEmitterState",new Map);T(this,"slotGroups",new Map)}sync(e,t,i,s,r=null){this.store=e;for(const[c,l]of this.emitters){const h=e.systems.find(u=>u.id===c);(!h||this.configs.get(c)!==h.config)&&(l.removeFromParent(),l.destroy({children:!0}),this.emitters.delete(c),this.configs.delete(c))}for(const c of e.systems){i&&!c.config.texture&&(c.config.texture=i);const l=lr(c.config);if(s)for(const u of l.trailResources)!u.texture&&(u.previewUrl==="/images/trail.png"||u.previewUrl==="/trails/trail.png")&&(u.texture=s);if(i)for(const u of l.imageResources)!u.texture&&u.textureName==="star"&&(u.texture=i);if(this.emitters.has(c.id))continue;const h=new ob(c.config);h.onParticleEvent=u=>this.handleParticleEvent(c.id,u),t.addChild(h),this.emitters.set(c.id,h),this.configs.set(c.id,c.config)}const o=Xa(e.systems);for(const c of e.systems){const l=this.emitters.get(c.id);if(!l)continue;l.onParticleEvent||(l.onParticleEvent=u=>this.handleParticleEvent(c.id,u));const h=o.has(c.id);this.subEmitterState.get(c.id)!==h&&(h&&l.clear(),this.subEmitterState.set(c.id,h)),l.setAutoEmission(!h)}const a=new Set;for(const c of e.systems){const l=this.emitters.get(c.id);if(!l)continue;const h=r&&c.config.renderLayerMode==="slot"?r.getDrawOrder(c.config.renderLayerSpineId):null,u=c4(e.spines,c.config,h),d=u&&r?this.ensureSlotGroup(u,r,c.config):null;d?(a.add(d.key),l.parent!==d.compensator&&d.compensator.addChild(l)):l.parent!==t&&t.addChild(l)}for(const[c,l]of[...this.slotGroups])if(!a.has(c)){for(const h of[...l.compensator.children])h instanceof ob&&h.parent===l.compensator&&t.addChild(h);r==null||r.detachSlotObject(l.spineId,l.slotName,l.wrapper),l.wrapper.removeFromParent(),l.wrapper.removeChild(l.compensator),l.compensator.destroy(),l.wrapper.destroy(),this.slotGroups.delete(c)}}ensureSlotGroup(e,t,i){const s=`${e.spineId}:${e.targetSlotName}:${i.renderLayerSlotPosition}`;let r=this.slotGroups.get(s);if(!r){const o=new Mi,a=new Mi;o.addChild(a),r={key:s,spineId:e.spineId,slotName:e.slotName,wrapper:o,compensator:a,followAttachment:i.renderLayerFollowAttachment,attached:!1},this.slotGroups.set(s,r)}return(!r.attached||!r.wrapper.parent||r.slotName!==e.slotName)&&(r.wrapper.parent&&t.detachSlotObject(r.spineId,r.slotName,r.wrapper),r.slotName=e.slotName,r.attached=t.attachSlotObject(r.spineId,r.slotName,r.wrapper,e.followAttachment)),r.attached?r:null}updateRenderCompensation(e,t){if(t)for(const i of this.slotGroups.values()){if(!i.attached||!i.wrapper.parent)continue;const s=e.spines.find(o=>o.id===i.spineId);if(!s)continue;const r=t.getSlotParentMatrix(i.spineId,i.slotName,s);r&&(r.invert(),i.compensator.transform.setFromMatrix(r))}}suspendEvents(e){this.eventsSuspended=e}handleParticleEvent(e,t){if(this.eventsSuspended)return;const i=this.store;if(!i)return;const s=i.systems.find(o=>o.id===e),r=s==null?void 0:s.config;if(!(!(r!=null&&r.eventEnabled)||!Array.isArray(r.events)||!r.events.length)&&!(t.depth>=2))for(const o of r.events){if(o.event!==t.kind||o.event==="collision"&&t.collisionCount>o.collisionLimit||o.targetSystemId<=0||o.targetSystemId===e)continue;const a=Math.min(1,Math.max(0,Number(o.probability)||0));if(a<=0)continue;const c=(Math.imul(o.id+1,2654435761)^Math.imul(t.depth+1,2246822507))>>>0;if(Ir(r.seed>>>0,t.spawnId+1,c)>=a)continue;const h=this.emitters.get(o.targetSystemId);if(!h)continue;const u=Array.isArray(o.inherit)?o.inherit:[],d=u.length?{attributes:u,colorMode:o.colorInheritMode==="replace"?"replace":"add",data:{colorHex:t.colorHex,scaleX:t.scaleX,scaleY:t.scaleY,rotation:t.rotation,life:t.maxLife}}:void 0;h.spawnEventParticle(t.worldX,t.worldY,t.depth+1,d)}}destroy(e){for(const t of this.slotGroups.values()){for(const i of[...t.compensator.children])t.compensator.removeChild(i);t.wrapper.removeFromParent(),t.compensator.destroy(),t.wrapper.destroy()}this.slotGroups.clear();for(const[t,i]of this.emitters)i.removeFromParent(),i.destroy({children:!0}),this.emitters.delete(t),this.configs.delete(t)}}async function f4(){const[n,e]=await Promise.all([it.fromURL("/images/star.png"),it.fromURL("/images/trail.png")]);return{dotTex:n,trailTex:e}}function m4(n,e,t){for(const i of n.systems){i.config.texture=e;const s=lr(i.config);if(t)for(const r of s.trailResources)!r.texture&&(r.previewUrl==="/images/trail.png"||r.previewUrl==="/trails/trail.png")&&(r.texture=t);for(const r of s.imageResources)!r.texture&&r.textureName==="star"&&(r.texture=e)}}const p4={class:"stage-wrap"},g4={key:0,class:"hud"},v4={class:"hud-number hud-system-count"},y4={class:"hud-number hud-particle-count"},b4={class:"hud-tip"},x4=qt({__name:"Stage",setup(n){const e=Wo(),t=De(null),i=De(null),s=De(!1),r=De(!1),o=De(""),a=De(!1);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);let c=null,l=null,h=null,u=null,d=null,f=null,m=null,p=null,g=null,v=null,b=null,y=null,x=null,_=null,E=null,S=[],C=0,M=0,P=0,A=0,R=null,B=null;const O=new vm,W=new d4,V={store:e,holder:t,app:()=>c},Y=new a4(V),L=new l4(V,()=>o.value);let N=[];const F=new Map;function D(){l=new Mi,c.stage.addChild(l),_=new Mi,c.stage.addChild(_),O.createSprite(l),x=new Ki,l.addChild(x),E=new K$,l.addChild(E.container),u=new Ki,l.addChild(u),h=new Ki,l.addChild(h),f=new Ki,l.addChild(f),m=new Ki,l.addChild(m),p=new Ki,l.addChild(p),g=new Ki,l.addChild(g),v=new Ki,l.addChild(v),b=new Ki,l.addChild(b),y=new Ki,l.addChild(y),d=new Ki,l.addChild(d)}function X(ye){if(ye.button===0){if(o.value&&L.selectedTransformTarget()){L.onGizmoDown(ye);return}Y.onPointerDown(ye)||L.onColliderPointerDown(ye)||L.onAttractionDown(ye)||L.onForceFieldDown(ye)||Q3(V,ye.clientX,ye.clientY)}}function G(ye){Y.onStageDoubleClick(ye)}function K(ye){Z3(V,ye)}function J(ye=!0){vm.clearStoreBackground(e,ye)}async function oe(ye){await vm.handleFileChange(e,ye)}XD({canvasElement:t,canvasFocused:a,undo:RT,save:()=>ET(e),togglePlay:()=>e.togglePlay(),toStart:()=>e.toStart(),setTool:ye=>{o.value=ye}});function le(){l&&W.sync(e,l,R,B,E)}function ve(ye,q,Z,se){const H=Math.max(2,Math.floor(se)||2);if(ye.config.mode==="stream"&&ye.config.streamBehavior==="loop"){Hb(ye,q,Z,H);return}q.reset();const j=1/Math.max(1,Z),$=[];for(let U=0;U=q)continue;const j=W.emitters.get(H.id);j&&ve(H,j,ye,q)}}finally{W.suspendEvents(!1)}e.systems.every(H=>{var j;return(((j=H.frames)==null?void 0:j.length)||0)>=q})&&(e.timeline.recorded=!0)}function fe(){var Z,se,H,j;A=requestAnimationFrame(fe);const ye=performance.now()/1e3;let q=ye-C;if(C=ye,q>.1&&(q=.1),c&&l){l.scale.set(e.editor.viewScale),l.position.set(c.screen.width/2+e.editor.viewX,c.screen.height*.5+e.editor.viewY),O.applyTransform(e.settings.backgroundX,e.settings.backgroundY,e.settings.backgroundOpacity),k$(e,c,x,_,S);const $=Math.max(1,e.timeline.fps),U=e.timeline.frame,z=U/$;E==null||E.sync(e.spines,U,$),le(),W.updateRenderCompensation(e,E),N=u4(e,z);for(const Le of e.systems){const Ce=W.emitters.get(Le.id);if(!Ce)continue;Ce.setFollowExportCurveMode(e.settings.exportSettings.keyframeCurve==="bezier"?"贝塞尔":"线性");const Ze=Le.visible!==!1;Ce.visible=Ze,Ce.renderable=Ze;const Ee=Le.config;Ce.scale.set(Ee.rootScaleX,Ee.rootScaleY);const vi=new Set(Ee.collisionColliderIds);Ce.setColliders(Ee.collision?N.filter(Ut=>vi.has(Ut.id)):[]),Ce.setEmitterFollowSpawn(0,0,0);let lt={x:Ee.centerX,y:Ee.centerY,rotation:Ee.rootRotation};const ce=Ee.emitterFollow&&Ee.emitterFollowMode==="bone"?e.spines.find(Ut=>Ut.id===Ee.emitterFollowSpineId&&Ut.enabled&&Ut.status==="ready"):null,de=ce&&(E==null?void 0:E.getBoneWorldTransform(ce.id,Ee.emitterFollowBoneName))||null,nt=Ee.emitterFollow&&Ee.emitterFollowMode==="path"?e.paths.find(Ut=>Ut.id===Ee.emitterFollowPathId&&Ut.enabled):null,Ft=Math.max(.05,Ee.emitterFollowDuration),Nt=Math.min(1,Math.max(0,z/Ft)),ct=Math.min(1,Math.max(0,b_(Ee.emitterFollowCurve,Nt))),rn=Math.min(1,Math.max(0,Ee.emitterFollowOffset)),Nn=Ee.emitterFollowDirection==="reverse"?(1-rn)*(1-ct):rn+(1-rn)*ct,Ht=nt?Qg(nt,Nn):null;if(de){const Ut=Ee.emitterFollowBoneOffsetX,on=Ee.emitterFollowBoneOffsetY,fi=de.x+Ut,Dn=de.y+on,Fs=Ee.rootRotation+Ee.emitterFollowBoneRotation,Tn=Math.max(1e-4,Math.abs(Ee.rootScaleX*Ee.emitterFollowBoneScaleX)),mn=Math.max(1e-4,Math.abs(Ee.rootScaleY*Ee.emitterFollowBoneScaleY));if(lt={x:fi,y:Dn,rotation:Fs},Ee.emitterFollowSpace==="local")Ce.position.set(fi,-Dn),Ce.rotation=-Fs*Math.PI/180,Ce.scale.set(Tn,mn),Ce.setSimulationTransform(fi,Dn,Fs,Tn,mn);else{Ce.position.set(Ee.centerX,-Ee.centerY),Ce.rotation=-Ee.rootRotation*Math.PI/180,Ce.scale.set(Tn,mn),Ce.setSimulationTransform(Ee.centerX,Ee.centerY,Ee.rootRotation,Tn,mn);const yr=_u(Ee,fi,Dn,Tn,mn),br=-(Fs-Ee.rootRotation);Ce.setEmitterFollowSpawn(yr.x,yr.y,br)}}else if(Ht){const Ut=Ht.angle+(Ee.emitterFollowDirection==="reverse"?180:0),on=Ee.emitterAngleMode==="direction"?Ut:Ee.rootRotation;if(lt={x:Ht.x,y:Ht.y,rotation:on},Ee.emitterFollowSpace==="local")Ce.position.set(Ht.x,-Ht.y),Ce.rotation=-on*Math.PI/180,Ce.setSimulationTransform(Ht.x,Ht.y,on);else{Ce.position.set(Ee.centerX,-Ee.centerY),Ce.rotation=-Ee.rootRotation*Math.PI/180,Ce.setSimulationTransform(Ee.centerX,Ee.centerY,Ee.rootRotation);const fi=_u(Ee,Ht.x,Ht.y),Dn=Ee.emitterAngleMode==="direction"?-(Ut-Ee.rootRotation):0;Ce.setEmitterFollowSpawn(fi.x,fi.y,Dn)}}else Ce.position.set(Ee.centerX,-Ee.centerY),Ce.rotation=-Ee.rootRotation*Math.PI/180,Ce.setSimulationTransform(Ee.centerX,Ee.centerY,Ee.rootRotation);const Di=Ee.shape==="path"&&Ee.spawnPathId>0&&e.paths.find(Ut=>Ut.id===Ee.spawnPathId&&Ut.enabled&&Ut.points.length>0)||null;Ce.setSpawnPathSampler(Di?Ut=>h4(Ee,Di,Ut):null,(Di==null?void 0:Di.closed)===!0),F.set(Le.id,lt)}let ee=0;const ne=[],ue=e.settings.showBones&&e.activeObjectType==="particle"?e.activeObjectId:0,xe=(Le,Ce,Ze)=>{!Le||Le.id!==ue||Le.visible===!1||G$(ne,Ze,Ce.position.x,Ce.position.y)},be=e.timeline,Ne=e.playbackRange,Be=be.fps,he=1/Math.max(1,Be);let ge=P,We=0;if(be.playing?(M+=q,We=Math.floor(M/he),We>0&&(M-=We*he)):(M=0,Se(Be)),be.playing&&We>0)for(let Le=0;Lelt.id===e.activeId),Ze=(Ce==null?void 0:Ce.config.mode)==="stream"&&Ce.config.streamBehavior==="loop"?PS(Ce.config,Be):null,vi=be.loop&&be.abLoop&&(Ze==null?void 0:Ze.start)===Ne.start&&Ze.end===Ne.end?Ne.end-1:Ne.end;if(be.frame>vi)if(be.loop)be.frame=Ne.start;else{be.frame=Ne.end,be.playing=!1;break}}else{W.suspendEvents(!0);try{const Ce=Xa(e.systems);for(const Ze of e.systems){const Ee=W.emitters.get(Ze.id);if(!Ee)continue;!Ce.has(Ze.id)&&Ze.config.mode==="stream"&&Ze.config.streamBehavior==="loop"?(Z=Ze.frames)!=null&&Z.length||Hb(Ze,Ee,Be,be.totalFrames):be.frame===0&&Ee.reset()}}finally{W.suspendEvents(!1)}for(const[Ce,Ze]of W.emitters){const Ee=e.systems.find(nt=>nt.id===Ce),vi=(Ee==null?void 0:Ee.config.mode)==="stream"&&Ee.config.streamBehavior==="loop",lt=vi?(se=Ee.frames)==null?void 0:se[be.frame]:void 0,ce=be.frame===0&&!vi,de=ce?[]:lt||Ze.update(he);if(ce?Ze.apply([]):lt&&Ze.apply(lt),(Ee==null?void 0:Ee.visible)!==!1)for(const nt of de)nt.active&&xe(Ee,Ze,nt);ee+=de.length}for(const Ce of e.systems){if(!Ce.config.texture)continue;Ce.frames=Ce.frames||[];const Ze=W.emitters.get(Ce.id);Ze&&!(Ce.config.mode==="stream"&&Ce.config.streamBehavior==="loop")&&(Ce.frames[be.frame]=Ze.capture())}be.frame++,be.frame>=be.totalFrames&&(be.frame=Ne.start,be.recorded=!0)}else{be.playing||(ge=be.frame);for(const Le of e.systems){const Ce=W.emitters.get(Le.id),Ze=be.playing?P:be.frame,Ee=(j=Le.frames)==null?void 0:j[Ze],vi=Le.config.mode==="stream"&&Le.config.streamBehavior==="loop"&&!!Ee;if((be.recorded||vi)&&Ce&&Ee){Ce.apply(Ee);for(const lt of Ee)lt.active&&(xe(Le,Ce,lt),ee++)}else if(Ce){const lt=be.frame===0?[]:Ce.update(0);if(be.frame===0&&Ce.apply([]),Le.visible!==!1)for(const ce of lt)ce.active&&xe(Le,Ce,ce);ee+=Ce.activeCount}}}P=ge,E==null||E.sync(e.spines,ge,Be);for(const[,Le]of W.emitters)Le.drawTrailMeshDebug(e.settings.showSkinMesh);X$(e,N,v),Y$(e,Y.selectedNodes,b),B$(e,E,u),F$(e,F,h),L$(e,F,f),O$(e,m),$$(e,p),N$(e,g),U$(o,L.selectedTransformTarget.bind(L),y),H$(ne,e,d),i.value&&(i.value.systems=e.systems.length,i.value.particles=ee)}}return Sn(async()=>{const ye=t.value;c=new tS({width:ye.clientWidth||800,height:ye.clientHeight||600,backgroundAlpha:0,antialias:!0}),ye.appendChild(c.view),D(),ei(()=>e.settings.backgroundImageData,Z=>O.syncTexture(Z),{immediate:!0});const q=await f4();R=q.dotTex,B=q.trailTex,m4(e,R,B),i.value={systems:e.systems.length,particles:0},e.timeline.recorded=!1,e.timeline.frame=0,M=0,P=0,e.timeline.playing=!0,e.timeline.loop=!0;for(const Z of e.systems)Z.frames=[];e.recalcTotalFrames(),C=performance.now()/1e3,fe(),ei(()=>e.systems.map(Z=>JSON.stringify(Z.config,(se,H)=>se==="texture"||se==="trailTexture"||se==="previewUrl"?void 0:H)).join("|")+`|colliders:${JSON.stringify(e.colliders)}|paths:${JSON.stringify(e.paths)}`,()=>{e.recalcTotalFrames(),e.timeline.recorded=!1,e.timeline.frame=0;for(const Z of e.systems)Z.frames=[];e.timeline.playing=!0,e.timeline.loop=!0}),BD(e)}),Za(()=>{cancelAnimationFrame(A),E==null||E.destroy(),E=null,O.destroy(),l&&c&&W.destroy(l),c&&(c.destroy(!0,{children:!0}),c=null)}),ei(()=>[e.activeObjectType,e.activeObjectId],()=>Y.resetSelection()),(ye,q)=>(Q(),te("div",p4,[w("div",{ref_key:"holder",ref:t,class:Pe(["stage-holder",{grid:I(e).settings.showGrid}]),tabindex:"0",onWheel:tt(K,["prevent"]),onPointerdown:X,onDblclick:tt(G,["prevent"])},null,34),Te(LB,{ctx:V,"active-tool":o.value,"show-settings":s.value,"show-help":r.value,"onUpdate:activeTool":q[0]||(q[0]=Z=>o.value=Z),"onUpdate:showSettings":q[1]||(q[1]=Z=>s.value=Z),"onUpdate:showHelp":q[2]||(q[2]=Z=>r.value=Z),onClearBackground:J,onBackgroundFile:oe},null,8,["active-tool","show-settings","show-help"]),Te(o4,{show:s.value,onClose:q[3]||(q[3]=Z=>s.value=!1)},null,8,["show"]),Te(J3,{show:r.value,onClose:q[4]||(q[4]=Z=>r.value=!1)},null,8,["show"]),i.value?(Q(),te("div",g4,[yt(k(ye.$t("app.systems"))+": ",1),w("b",v4,k(i.value.systems),1),yt(" · "+k(ye.$t("app.particlesBones"))+": ",1),w("b",y4,k(i.value.particles),1),yt(" · "+k(ye.$t("app.rootBone"))+": ",1),q[5]||(q[5]=w("b",null,"root",-1)),w("span",b4,k(ye.$t("app.hudTip")),1)])):_e("",!0)]))}}),w4=li(x4,[["__scopeId","data-v-1023341a"]]),S4=[{x:0,y:0},{x:1,y:1}],Op=[{x:0,y:1},{x:1,y:1}],_4=[{x:0,y:0},{x:.2,y:1},{x:.8,y:1},{x:1,y:0}],$p=[{x:0,y:0},{x:.1,y:1},{x:.9,y:1},{x:1,y:0}],Np=[{x:0,y:1},{x:1,y:1}],Dp=[{x:0,y:1},{x:1,y:1}],hi=Go({visible:!1,title:"",detail:"",progress:0,indeterminate:!1,failed:!1});let dh=0;function T4(n){return new Promise(e=>window.setTimeout(e,n))}function FT(n,e){const t=++dh,i=performance.now();Object.assign(hi,{visible:!0,title:n,detail:e,progress:0,indeterminate:!1,failed:!1});const s=(o,a)=>{t===dh&&(hi.indeterminate=o==null,o!=null&&(hi.progress=Math.min(100,Math.max(0,o))),a&&(hi.detail=a))},r=async(o,a)=>{if(t!==dh)return;hi.failed=o,hi.indeterminate=!1,hi.progress=o?hi.progress:100,hi.detail=a,await T4(Math.max(180,(o?850:450)-(performance.now()-i))),t===dh&&(hi.visible=!1)};return{update:s,paint:()=>new Promise(o=>requestAnimationFrame(()=>o())),finish:(o=Ye("transfer.completed"))=>r(!1,o),fail:(o=Ye("transfer.failed"))=>r(!0,o)}}async function E4(n,e){if(!n.body)return e(null),n.text();const t=Number(n.headers.get("content-length")),i=Number.isFinite(t)&&t>0,s=n.body.getReader(),r=new TextDecoder;let o=0,a="";for(e(i?0:null);;){const{done:c,value:l}=await s.read();if(c)break;o+=l.byteLength,a+=r.decode(l,{stream:!0}),e(i?Math.min(1,o/t):null)}return a+=r.decode(),i&&e(1),a}const C4="3.8";function Rn(n,e,t){n[e]==null&&n[t]!=null&&(n[e]=n[t]),delete n[t]}function Bp(n){if(!n||typeof n!="object")return;if(Array.isArray(n)){for(const t of n)Bp(t);return}const e=n;Array.isArray(e.curve)&&delete e.curve;for(const t of Object.values(e))Bp(t)}function M4(n){for(const e of n.bones)Rn(e,"transform","inherit");for(const e of n.transform||[])Rn(e,"rotateMix","mixRotate"),e.translateMix==null&&(e.translateMix=e.mixX??e.mixY),e.scaleMix==null&&(e.scaleMix=e.mixScaleX??e.mixScaleY),Rn(e,"shearMix","mixShearY"),delete e.mixX,delete e.mixY,delete e.mixScaleX,delete e.mixScaleY;for(const e of n.path||[])Rn(e,"rotateMix","mixRotate"),e.translateMix==null&&(e.translateMix=e.mixX??e.mixY),delete e.mixX,delete e.mixY;for(const e of n.skins)for(const t of Object.values(e.attachments||{}))for(const i of Object.values(t||{}))i.parent!=null&&Rn(i,"deform","timelines")}function A4(n){for(const e of Object.values(n.slots||{}))Rn(e,"color","rgba"),Rn(e,"twoColor","rgba2")}function I4(n){for(const e of Object.values(n.bones||{}))for(const t of e.rotate||[])Rn(t,"angle","value")}function P4(n){for(const e of Object.values(n.transform||{}))for(const t of e)Rn(t,"rotateMix","mixRotate"),t.translateMix==null&&(t.translateMix=t.mixX??t.mixY),t.scaleMix==null&&(t.scaleMix=t.mixScaleX??t.mixScaleY),Rn(t,"shearMix","mixShearY"),delete t.mixX,delete t.mixY,delete t.mixScaleX,delete t.mixScaleY}function R4(n){for(const e of Object.values(n.path||{})){for(const t of["position","spacing"])for(const i of e[t]||[])Rn(i,t,"value");for(const t of e.mix||[])Rn(t,"rotateMix","mixRotate"),t.translateMix==null&&(t.translateMix=t.mixX??t.mixY),delete t.mixX,delete t.mixY}}function k4(n){if(!n.attachments)return;const e=n.deform||(n.deform={});for(const[t,i]of Object.entries(n.attachments)){const s=e[t]||(e[t]={});for(const[r,o]of Object.entries(i)){const a=s[r]||(s[r]={});for(const[c,l]of Object.entries(o))l.deform&&(a[c]=l.deform)}}delete n.attachments}function F4(n){n.skeleton.spine=C4,M4(n);for(const e of Object.values(n.animations))A4(e),I4(e),P4(e),R4(e),k4(e);return Bp(n.animations),n}function L4(n,e,t,i,s=!1){if(s){let c=0;for(let l=0;l[...s].sort((a,c)=>a-c);let o=!0;for(;o;){o=!1;const a=r();for(let c=0;cf&&(f=p,d=m)}d>=0&&(s.add(d),o=!0)}}return r().map(a=>n[a])}function n1(n,e,t,i,s){const r=t-e+1;if(r<2)return 0;const o=s?e:t,a=s?e+1:t-1,c=s?e+2:t-2,l=Math.abs(n[a].frame-n[o].frame);if(r>=3&&l>0&&Math.abs(Math.abs(n[c].frame-n[a].frame)-l)<1e-6){const u=n[o].values[i],d=n[a].values[i],f=n[c].values[i];return s?(-3*u+4*d-f)/(2*l):(3*u-4*d+f)/(2*l)}const h=n[a].frame-n[o].frame;return h?(n[a].values[i]-n[o].values[i])/h:0}function s1(n,e,t){const i=n[t].frame-n[e].frame,s=[];for(let r=0;rd.values[r])),l=Math.max(...n.slice(e,t+1).map(d=>d.values[r])),h=o+n1(n,e,t,r,!0)*i/3,u=a-n1(n,e,t,r,!1)*i/3;s.push([Math.max(c,Math.min(l,h)),Math.max(c,Math.min(l,u))])}return{values:s}}function O4(n,e,t,i,s){const r=1-s;return r*r*r*n+3*r*r*s*e+3*r*s*s*t+s*s*s*i}function $4(n,e,t,i,s,r=!1){if(r){let l=0;for(let h=0;h[...s].sort((c,l)=>c-l);let o=!0;for(;o;){o=!1;const c=r();for(let l=0;lp&&(p=v,m=g)}m>=0&&(s.add(m),o=!0)}}const a=r();return{samples:a.map(c=>n[c]),controls:a.slice(0,-1).map((c,l)=>s1(n,c,a[l+1]))}}function N4(n){if(!n.length)return[];const e=[n[0]];for(let t=1;t180;)i-=360;for(;i-e[t-1]<-180;)i+=360;e.push(i)}return e}function pi(n){if(!Number.isFinite(n))return 0;const e=Math.round(n*1e5)/1e5;return Object.is(e,-0)?0:e}function D4(n,e,t,i){const s=Math.max(2,Math.min(16,Math.round(Number(n.trailGridRows)||2))),r=Math.max(2,Math.min(32,Math.round(Number(n.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),c=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,h=Math.cos(l),u=Math.sin(l),d=[],f=[],m=[],p=[],g=[];for(let y=0;y=0;y--)g.push({col:y,row:s-1});for(let y=s-2;y>=1;y--)g.push({col:0,row:y});const v=g.length;for(let y=1;y|\s]+/g,"_").replace(/^_+|_+$/g,"")||e}function $T(n,e){let t=n,i=2;for(;e.has(t);)t=`${n}_${i++}`;return e.add(t),t}function U4(n){return n.replace(/\.[^./\\]+$/,"")}function NT(n,e){return U4([n,e].filter(Boolean).join("/").replace(/\\/g,"/").replace(/\/{2,}/g,"/").replace(/^\.\//,""))}function V4(n){var i,s;const e=Number(((i=n==null?void 0:n.orig)==null?void 0:i.width)??(n==null?void 0:n.width))||0,t=Number(((s=n==null?void 0:n.orig)==null?void 0:s.height)??(n==null?void 0:n.height))||0;return{width:e,height:t}}function mh(n){return Math.round(Math.max(0,Math.min(1,n))*255).toString(16).padStart(2,"0")}function c1(n,e){return[(n>>16&255)/255,(n>>8&255)/255,(n&255)/255,Math.max(0,Math.min(1,e))]}function Ol(n,e){return pi(n/e)}function X4(n,e){const t=n.config,i=t.lifeMode==="fixed"?Math.max(0,Number(t.lifeMin)||0):Math.max(0,Number(t.lifeMin)||0,Number(t.lifeMax)||0),s=Math.max(0,Number(t.delay)||0);let r;return t.mode!=="stream"?r=s+i:t.streamBehavior!=="loop"?r=s+Math.max(1/e,Number(t.duration)||0)+i:r=s+zn(t,e).total/e,Math.max(1,Math.ceil(r*e)+1)}function Y4(n,e,t){const i=n.config;if(i.mode!=="stream"||i.streamBehavior!=="loop")return new Set;const s=PS(i,e),r=Math.max(1,t)/Math.max(1,e);return new Set([Math.round(s.start*r),Math.round(s.end*r)])}function Tu(n,e){return e?n.boneName:`${n.spawnId??"legacy"}_${n.boneName}`}function G4(n,e,t,i){const s=new Set;for(const r of n)for(const o of r)s.add(Tu(o,e));return[...s].sort().map((r,o)=>({key:r,name:$T(`${i}_${o}`,t),states:n.map(a=>a.find(c=>Tu(c,e)===r)||null)}))}function h1(n,e){const t=new Set(e.states.map(i=>i==null?void 0:i.resourceId).filter(i=>typeof i=="number"));return n.config.imageResources.filter(i=>t.has(i.id))}function H4(n,e,t,i){const s=e*t/i,r=Math.min(n.states.length-1,Math.max(0,Math.floor(s))),o=Math.min(n.states.length-1,r+1),a=n.states[r],c=n.states[o];if(!a||!c||Tu(a,!0)!==Tu(c,!0)||a.spawnId!==c.spawnId)return a;const l=s-r;if(l<=1e-6)return a;const h=(d,f)=>(d??0)+((f??d??0)-(d??0))*l,u=a.trailState&&c.trailState&&a.trailState.resourceId===c.trailState.resourceId?{...a.trailState,width:h(a.trailState.width,c.trailState.width),alpha:h(a.trailState.alpha,c.trailState.alpha),bones:a.trailState.bones.map((d,f)=>{const m=c.trailState.bones[f]||d;return{...d,worldX:h(d.worldX??d.x,m.worldX??m.x),worldY:h(d.worldY??d.y,m.worldY??m.y),worldRotation:h(d.worldRotation??-d.rotation,m.worldRotation??-m.rotation)}})}:a.trailState;return{...a,worldX:h(a.worldX,c.worldX),worldY:h(a.worldY,c.worldY),worldRotation:h(a.worldRotation,c.worldRotation),worldScaleX:h(a.worldScaleX,c.worldScaleX),worldScaleY:h(a.worldScaleY,c.worldScaleY),alpha:h(a.alpha,c.alpha),trailState:u}}function u1(n,e){return!n||n==="跟随导出"?e.keyframeCurve:n==="贝塞尔"?"bezier":"linear"}function ca(n,e,t,i,s,r=new Set,o=new Set,a=s.keyframeCurve){if(!n.length)return[];const c=new Set(r);for(const u of o)c.add(u);const l=a==="bezier"&&s.spineVersion!=="3.8"?OT(n,i,c,o):{samples:LT(n,i,c,o),controls:[]},h=l.samples.map(u=>{const d={time:Ol(u.frame,e)};return t.forEach((f,m)=>{d[f]=pi(u.values[m])}),o.has(u.frame)&&(d.curve="stepped"),d});for(let u=0;u0&&s&&e.add(t-1),i&&e.add(t))}return e}function W4(n){const e=new Set;for(let t=0;t0&&s&&e.add(t-1),i&&e.add(t))}return e}function K4(n,e){var i;if(!n.shapeEnabled||!((i=n.shapeCurve)!=null&&i.length))return 1;const t=[...n.shapeCurve].sort((s,r)=>s.x-r.x);if(e<=t[0].x)return Math.max(0,t[0].y);for(let s=1;s{(o!==r||i.has(a))&&(s.push(t(o,a)),r=o)}),s}function Z4(n,e,t){const i=n.imageMode==="sequence"?n.sequenceFrames[e]:void 0,s=(i==null?void 0:i.name)||n.textureName||`image_${n.id}`,r=(i==null?void 0:i.texture)||n.texture,o=V4(r);(!o.width||!o.height)&&t.push({code:"missing-image",message:Ye("errors.missingImageWarning",{file:s})});const a=o.width||1,c=o.height||1;return{path:NT(n.textureFolder,s),x:pi((.5-n.anchorX)*a),y:pi((n.anchorY-.5)*c),width:pi(a),height:pi(c)}}function d1(n,e){const t=[];for(const s of e){const r=s.imageMode==="sequence"?Math.max(1,s.sequenceFrames.length):1;for(let o=0;o1;return new Map(t.map((s,r)=>[s,i?`${n}_${r}`:n]))}function Q4(n,e,t,i,s=i.keyframeCurve,r=new Set,o=new Set){if(!n.length)return[];const a=new Set;for(let d=1;d({frame:f,values:d})),l=1/255,h=s==="bezier"&&i.spineVersion!=="3.8"?OT(c,[l,l,l,.01],a,r):{samples:LT(c,[l,l,l,.01],a,r),controls:[]},u=h.samples.map(d=>{const f={time:Ol(d.frame,t),color:`${mh(d.values[0])}${mh(d.values[1])}${mh(d.values[2])}${mh(d.values[3])}`};return r.has(d.frame)&&(f.curve="stepped"),f});if(h.controls.length)for(let d=0;d({time:Ol(m,s),name:f??null}),c);h.length&&(l.attachment=h);const u=Q4(i,t,s,r,o,a,c);u.length&&(l.rgba=u)}function m1(n){var p;const e=n.settings,t=Math.max(1,Number(n.timeline.fps)||30),i=Math.max(1,Math.round(e.fps||30)),s=e.integerFrameAlignment?i:t,r=[],o=n.systems.filter(g=>g.visible!==!1),a=Xa(n.systems),c={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||(c.skeleton.fps=i);const l=c.skins[0].attachments,h=new Set(["root"]),u=[...new Set([...n.timeline.animations.length?n.timeline.animations:["animation"],...o.map(g=>g.animation||"animation")])],d=new Map;for(const g of o){const v=((p=g.frames)==null?void 0:p.length)||0,b=a.has(g.id)?v:Math.min(v,X4(g,t)),y=(g.frames||[]).slice(0,b);y.length||r.push({code:"empty-cache",message:Ye("errors.emptyCacheWarning",{name:g.config.name})});const x=$T(B4(g.config.name,`system_${g.id}`),h);c.bones.push({name:x,parent:"root"});const _=G4(y,e.bonePool,h,x),E=Math.max(0,(b-1)/t),S=Math.max(1,Math.ceil(E*s)+1),C=Y4(g,t,s),M=d.get(g.animation)||[];M.push({system:g,tracks:_,targetFrames:S,boundaryFrames:C,attachmentPrefix:x}),d.set(g.animation,M);for(const P of _){c.bones.push({name:P.name,parent:x});const A=h1(g,P),R=new Set(A.map(Y=>Y.blend)),B=[],O=[];for(const Y of R){const L=`${P.name}_${Y}`;B.push(L),c.slots.push({name:L,bone:P.name,color:"ffffff00",blend:r1[Y]});const N=l[L]||(l[L]={}),F=A.filter(X=>X.blend===Y),D=d1(x,F);for(const X of F){const G=X.imageMode==="sequence"?Math.max(1,X.sequenceFrames.length):1;for(let K=0;K{var K;return((K=G==null?void 0:G.trailState)==null?void 0:K.resourceId)===Y.id}))continue;const L=Math.max(2,Math.min(16,Math.round(Y.boneCount||3))),N=[];for(let G=0;Gc.bones.findIndex(K=>K.name===G)),X=NT("",Y.textureName||`trail_${Y.id}`);(l[F]||(l[F]={}))[`trail_${Y.id}`]=D4(g.config,Y,D,X),Y.texture||r.push({code:"missing-image",message:Ye("errors.missingTrailImageWarning",{file:Y.textureName||Y.id})})}const W=new Set([...B,...O]),V=c.slots.filter(Y=>W.has(String(Y.name)));V.length&&(c.slots=c.slots.filter(Y=>!V.includes(Y)),c.slots.push(...V.filter(Y=>O.includes(String(Y.name))),...V.filter(Y=>B.includes(String(Y.name)))))}}for(const g of u){const v=d.get(g)||[],b={bones:{},slots:{}};let y=!1;for(const{system:x,tracks:_,targetFrames:E,boundaryFrames:S,attachmentPrefix:C}of v)for(const M of _){const P=Array.from({length:E},(J,oe)=>H4(M,oe,t,s)),A=P.map(J=>!!(J!=null&&J.active)),R=[],B=[],O=[];P.forEach((J,oe)=>{J!=null&&J.active&&(R.push({frame:oe,values:[J.worldX??J.x,J.worldY??J.y]}),B.push(J.worldRotation??J.rotation),O.push({frame:oe,values:[J.worldScaleX??J.scaleX,J.worldScaleY??J.scaleY]}))});const W=N4(B),V=R.map((J,oe)=>({frame:J.frame,values:[W[oe]??0]})),Y=j4(P);for(const J of S)Y.add(J);const L=W4(P),N={},F=ca(R,s,["x","y"],[o1,o1],e,Y,L),D=ca(V,s,["value"],[l1],e,Y,L),X=ca(O,s,["x","y"],[fh,fh],e,Y,L);F.length&&(N.translate=F),D.length&&(N.rotate=D),X.length&&(N.scale=X),Object.keys(N).length&&(b.bones[M.name]=N,y=!0);const G=h1(x,M),K=new Set(G.map(J=>J.blend));for(const J of K){const oe=G.filter(Z=>Z.blend===J),le=d1(C,oe),ve=[],Se=[];let fe=16777215;for(let Z=0;ZU.id===se.resourceId):void 0,j=!!se&&A[Z]&&se.imageVisible!==!1&&(H==null?void 0:H.blend)===J;se&&(H==null?void 0:H.blend)===J&&(fe=se.colorHex);const $=j?le.get(`${H.id}_${se.imageFrameIndex??0}`):void 0;ve.push($??null),Se.push(c1(fe,j?se.alpha:0))}const ye=oe.filter(Z=>Z.independentAlpha==="curve").map(Z=>u1(Z.alphaCurveMode,e)),q=ye.length?ye.includes("bezier")?"bezier":"linear":u1(x.config.alphaMode==="curve"?x.config.curveMode:void 0,e);f1(b,`${M.name}_${J}`,ve,Se,s,e,q,L,S),ve.some(Boolean)&&(y=!0)}if(x.config.trail)for(const J of x.config.trailResources){const oe=Math.max(2,Math.min(16,Math.round(J.boneCount||3))),le=P.map($=>{var U;return((U=$==null?void 0:$.trailState)==null?void 0:U.resourceId)===J.id?$.trailState:void 0}),ve=le.find($=>!!$);if(!ve)continue;const Se=q4(le),fe=z4(le),ye=J.widthSizeMode==="random"?Math.max(1,Number(J.widthMin)||0,Number(J.widthMax)||0):Math.max(.001,Number(J.width)||100);let q=ve;const Z=le.map($=>($&&(q=$),q));for(let $=0;${const Le=ge==null?void 0:ge.bones[Math.min(ge.bones.length-1,$)];if(!Le)return;const Ce={x:Le.worldX??Le.x,y:Le.worldY??Le.y,rotation:Le.worldRotation??-Le.rotation};U.push({frame:We,values:[Ce.x,Ce.y]}),z.push({frame:We,values:[Ce.rotation]}),ee.push({frame:We,values:[1,Math.max(0,ge.width/ye)*ue]})});const xe=`${M.name}_trail_${J.id}_${$}`,be={},Ne=ca(U,s,["x","y"],[a1,a1],e,ne,fe),Be=ca(z,s,["value"],[l1],e,ne,fe),he=ca(ee,s,["x","y"],[fh,fh],e,ne,fe);Ne.length&&(be.translate=Ne),Be.length&&(be.rotate=Be),he.length&&(be.scale=he),Object.keys(be).length&&(b.bones[xe]=be)}const se=le.map(()=>`trail_${J.id}`);let H=ve.colorHex;const j=le.map($=>($&&(H=$.colorHex),c1(H,$?$.alpha:0)));f1(b,`${M.name}_trail_${J.id}`,se,j,s,e,e.keyframeCurve,fe,S),y=!0}}(y||!e.excludeEmptyAnimations)&&(c.animations[g]=b)}!Object.keys(c.animations).length&&!e.excludeEmptyAnimations&&(c.animations.animation={bones:{},slots:{}});const f=e.spineVersion==="3.8"?F4(c):c,m=JSON.stringify(f,null,2);return{json:f,text:m,warnings:r,particleSystemCount:o.length,animationCount:Object.keys(f.animations).length,boneCount:f.bones.length}}function eU(n,e){const t=new Blob([n.text],{type:"application/json;charset=utf-8"}),i=URL.createObjectURL(t),s=document.createElement("a");s.href=i,s.download=/\.json$/i.test(e)?e:`${e||"SpineParticle"}.json`,s.style.display="none",document.body.appendChild(s),s.click(),s.remove(),setTimeout(()=>URL.revokeObjectURL(i),1e3)}class FK{constructor(){T(this,"array",[])}add(e){const t=this.contains(e);return this.array[e|0]=e|0,!t}contains(e){return this.array[e|0]!==void 0}remove(e){this.array[e|0]=void 0}clear(){this.array.length=0}}class tU{constructor(){T(this,"entries",{});T(this,"size",0)}add(e){const t=this.entries[e];return this.entries[e]=!0,t?!1:(this.size++,!0)}addAll(e){const t=this.size;for(let i=0,s=e.length;i1&&(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 yn){return t.setFromString(e)}};T(yn,"WHITE",new yn(1,1,1,1)),T(yn,"RED",new yn(1,0,0,1)),T(yn,"GREEN",new yn(0,1,0,1)),T(yn,"BLUE",new yn(0,0,1,1)),T(yn,"MAGENTA",new yn(1,0,1,1));let at=yn;const ni=class ni{static clamp(e,t,i){return ei?i:e}static cosDeg(e){return Math.cos(e*ni.degRad)}static sinDeg(e){return Math.sin(e*ni.degRad)}static atan2Deg(e,t){return Math.atan2(e,t)*ni.radDeg}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){const t=Math.pow(Math.abs(e),.3333333333333333);return e<0?-t:t}static randomTriangular(e,t){return ni.randomTriangularWith(e,t,(e+t)*.5)}static randomTriangularWith(e,t,i){const s=Math.random(),r=t-e;return s<=(i-e)/r?e+Math.sqrt(s*r*(i-e)):t-Math.sqrt((1-s)*r*(t-i))}static isPowerOfTwo(e){return e&&(e&e-1)===0}};T(ni,"epsilon",1e-5),T(ni,"epsilon2",ni.epsilon*ni.epsilon),T(ni,"PI",3.1415927),T(ni,"PI2",ni.PI*2),T(ni,"invPI2",1/ni.PI2),T(ni,"radiansToDegrees",180/ni.PI),T(ni,"radDeg",ni.radiansToDegrees),T(ni,"degreesToRadians",ni.PI/180),T(ni,"degRad",ni.degreesToRadians);let Re=ni;const Cn=class Cn{apply(e,t,i){return t===void 0||i===void 0?this.applyInternal(e):e+(t-e)*this.applyInternal(i)}};T(Cn,"linear",new class extends Cn{applyInternal(e){return e}}),T(Cn,"smooth",new class extends Cn{applyInternal(e){return e*e*(3-2*e)}}),T(Cn,"slowFast",new class extends Cn{applyInternal(e){return e*e}}),T(Cn,"fastSlow",new class extends Cn{applyInternal(e){return(e-1)*(e-1)*-1+1}}),T(Cn,"circle",new class extends Cn{applyInternal(e){return e<=.5?(e*=2,(1-Math.sqrt(1-e*e))/2):(e--,e*=2,(Math.sqrt(1-e*e)+1)/2)}});let Da=Cn;class iU extends Da{constructor(t){super();T(this,"power",2);this.power=t}applyInternal(t){return t<=.5?Math.pow(t*2,this.power)/2:Math.pow((t-1)*2,this.power)/(this.power%2===0?-2:2)+1}}class LK extends iU{constructor(e){super(e)}applyInternal(e){return Math.pow(e-1,this.power)*(this.power%2===0?-1:1)+1}}const Or=class Or{static arrayCopy(e,t,i,s,r){for(let o=t,a=s;o=t?e:Or.setArraySize(e,t,i)}static newArray(e,t){const i=[];for(let s=0;s0?this.items.pop():this.instantiator()}free(e){var t;(t=e.reset)==null||t.call(e),this.items.push(e)}freeAll(e){for(let t=0;tthis.maxDelta&&(this.delta=this.maxDelta),this.lastTime=e,this.frameCount++,this.frameTime>1&&(this.framesPerSecond=this.frameCount/this.frameTime,this.frameTime=0,this.frameCount=0)}}class NK{constructor(e=32){T(this,"values");T(this,"addedValues",0);T(this,"lastValue",0);T(this,"mean",0);T(this,"dirty",!0);this.values=new Array(e)}hasEnoughData(){return this.addedValues>=this.values.length}addValue(e){this.addedValuesthis.values.length-1&&(this.lastValue=0),this.dirty=!0}getMean(){if(this.hasEnoughData()){if(this.dirty){let e=0;for(let t=0;t{h.width=parseInt(i[1]),h.height=parseInt(i[2])},s.format=()=>{},s.filter=h=>{h.minFilter=Ke.enumValue(Ha,i[1]),h.magFilter=Ke.enumValue(Ha,i[2])},s.repeat=h=>{i[1].indexOf("x")!==-1&&(h.uWrap=ja.Repeat),i[1].indexOf("y")!==-1&&(h.vWrap=ja.Repeat)},s.pma=h=>{h.pma=i[1]==="true"};var r={};r.xy=h=>{h.x=parseInt(i[1]),h.y=parseInt(i[2])},r.size=h=>{h.width=parseInt(i[1]),h.height=parseInt(i[2])},r.bounds=h=>{h.x=parseInt(i[1]),h.y=parseInt(i[2]),h.width=parseInt(i[3]),h.height=parseInt(i[4])},r.offset=h=>{h.offsetX=parseInt(i[1]),h.offsetY=parseInt(i[2])},r.orig=h=>{h.originalWidth=parseInt(i[1]),h.originalHeight=parseInt(i[2])},r.offsets=h=>{h.offsetX=parseInt(i[1]),h.offsetY=parseInt(i[2]),h.originalWidth=parseInt(i[3]),h.originalHeight=parseInt(i[4])},r.rotate=h=>{const u=i[1];u==="true"?h.degrees=90:u!=="false"&&(h.degrees=parseInt(u))},r.index=h=>{h.index=parseInt(i[1])};let o=t.readLine();for(;o&&o.trim().length===0;)o=t.readLine();for(;!(!o||o.trim().length===0||t.readEntry(i,o)===0);)o=t.readLine();let a=null,c=null,l=null;for(;o!==null;)if(o.trim().length===0)a=null,o=t.readLine();else if(a){const h=new BT(a,o);for(;;){const u=t.readEntry(i,o=t.readLine());if(u===0)break;const d=r[i[0]];if(d)d(h);else{c||(c=[]),l||(l=[]),c.push(i[0]);const f=[];for(let m=0;m0&&l&&l.length>0&&(h.names=c,h.values=l,c=null,l=null),h.u=h.x/a.width,h.v=h.y/a.height,h.degrees===90?(h.u2=(h.x+h.height)/a.width,h.v2=(h.y+h.width)/a.height):(h.u2=(h.x+h.width)/a.width,h.v2=(h.y+h.height)/a.height),this.regions.push(h)}else{for(a=new oU(o.trim());t.readEntry(i,o=t.readLine())!==0;){const h=s[i[0]];h&&h(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;const i=t.indexOf(":");if(i===-1)return 0;e[0]=t.substr(0,i).trim();for(let s=1,r=i+1;;s++){const o=t.indexOf(",",r);if(o===-1)return e[s]=t.substr(r).trim(),s;if(e[s]=t.substr(r,o-r).trim(),r=o+1,s===4)return 4}}}class oU{constructor(e){T(this,"name");T(this,"minFilter",Ha.Nearest);T(this,"magFilter",Ha.Nearest);T(this,"uWrap",ja.ClampToEdge);T(this,"vWrap",ja.ClampToEdge);T(this,"texture",null);T(this,"width",0);T(this,"height",0);T(this,"pma",!1);T(this,"regions",[]);this.name=e}setTexture(e){this.texture=e,e.setFilters(this.minFilter,this.magFilter),e.setWraps(this.uWrap,this.vWrap);for(const t of this.regions)t.texture=e}}class BT extends DT{constructor(t,i){super();T(this,"page");T(this,"name");T(this,"x",0);T(this,"y",0);T(this,"offsetX",0);T(this,"offsetY",0);T(this,"originalWidth",0);T(this,"originalHeight",0);T(this,"index",0);T(this,"degrees",0);T(this,"names",null);T(this,"values",null);this.page=t,this.name=i,t.regions.push(this)}}const Ru=class Ru{constructor(e){T(this,"name");T(this,"timelineAttachment");T(this,"timelineSlots",Ru.empty);if(!e)throw new Error("name cannot be null.");this.name=e,this.timelineAttachment=this}isTimelineActive(e,t,i){let s=e[t];if(s.bone.isActive()){const r=(i?s.getAppliedPose():s.getPose()).getAttachment();if(r!=null&&r.timelineAttachment===this)return!0}for(let r=0,o=this.timelineSlots.length;r>1)*c;const l=i.appliedPose.deform;let h=this.vertices;const u=this.bones;if(!u){l.length>0&&(h=l);const p=i.bone.appliedPose,g=p.worldX,v=p.worldY,b=p.a,y=p.b,x=p.c,_=p.d;for(let E=s,S=a;S=this.regions.length&&(t=this.regions.length-1),t}getUVs(e){return this.uvs[e]}hasPathSuffix(){return this.pathSuffix}getPath(e,t){if(!this.pathSuffix)return e;let i=e;const s=(this.start+t).toString();for(let r=this.digits-s.length;r>0;r--)i+="0";return i+=s,i}static nextID(){return _a._nextID++}};T(_a,"_nextID",0);let za=_a;var $i;(function(n){n[n.hold=0]="hold",n[n.once=1]="once",n[n.loop=2]="loop",n[n.pingpong=3]="pingpong",n[n.onceReverse=4]="onceReverse",n[n.loopReverse=5]="loopReverse",n[n.pingpongReverse=6]="pingpongReverse"})($i||($i={}));const UT=[$i.hold,$i.once,$i.loop,$i.pingpong,$i.onceReverse,$i.loopReverse,$i.pingpongReverse];class e0{constructor(e,t,i){T(this,"name");T(this,"timelines",[]);T(this,"timelineIds");T(this,"bones");T(this,"color",new at(1,1,1,1));T(this,"duration");if(!e)throw new Error("name cannot be null.");this.name=e,this.duration=i,this.timelineIds=new tU,this.bones=[],this.setTimelines(t)}setTimelines(e){if(!e)throw new Error("timelines cannot be null.");this.timelines=e;const t=e.length;this.timelineIds.clear(),this.bones.length=0;const i=new Set,s=e;for(let r=0;r0&&(t%=this.duration));const u=this.timelines;for(let d=0,f=u.length;dt)return r-i;return s-i}};function aU(n){return typeof n=="object"&&n!==null&&typeof n.slotIndex=="number"}class qo extends Gt{constructor(t,i,...s){super(t,...s);T(this,"curves");this.curves=Ke.newFloatArray(t+i*18),this.curves[t-1]=1}setLinear(t){this.curves[t]=0}setStepped(t){this.curves[t]=1}shrink(t){const i=this.getFrameCount()+t*18;if(this.curves.length>i){const s=Ke.newFloatArray(i);Ke.arrayCopy(this.curves,0,s,0,i),this.curves=s}}setBezier(t,i,s,r,o,a,c,l,h,u,d){const f=this.curves;let m=this.getFrameCount()+t*18;s===0&&(f[i]=2+m);const p=(r-a*2+l)*.03,g=(o-c*2+h)*.03,v=((a-l)*3-r+u)*.006,b=((c-h)*3-o+d)*.006;let y=p*2+v,x=g*2+b,_=(a-r)*.3+p+v*.16666667,E=(c-o)*.3+g+b*.16666667,S=r+_,C=o+E;for(let M=m+18;mt){const h=this.frames[i],u=this.frames[i+s];return u+(t-h)/(o[r]-h)*(o[r+1]-u)}const a=r+18;for(r+=2;r=t){const h=o[r-2],u=o[r-1];return u+(t-h)/(o[r]-h)*(o[r+1]-u)}i+=this.getFrameEntries();const c=o[a-2],l=o[a-1];return l+(t-c)/(this.frames[i]-c)*(this.frames[i+s]-l)}}class nr extends qo{constructor(e,t,i){super(e,t,i)}getFrameEntries(){return 2}setFrame(e,t,i){e<<=1,this.frames[e]=t,this.frames[e+1]=i}getCurveValue(e){const t=this.frames;let i=t.length-2;for(let r=2;r<=i;r+=2)if(t[r]>e){i=r-2;break}const s=this.curves[i>>1];switch(s){case 0:{const r=t[i],o=t[i+1];return o+(e-r)/(t[i+2]-r)*(t[i+2+1]-o)}case 1:return t[i+1]}return this.getBezierValue(e,i,1,s-2)}getRelativeValue(e,t,i,s,r,o){if(e>2];switch(f){case 0:{const m=u[d];c=u[d+1],l=u[d+2],h=u[d+3];const p=(i-m)/(u[d+4]-m);c+=(u[d+4+1]-c)*p,l+=(u[d+4+2]-l)*p,h+=(u[d+4+3]-h)*p;break}case 1:c=u[d+1],l=u[d+2],h=u[d+3];break;default:c=this.getBezierValue(i,d,1,f-2),l=this.getBezierValue(i,d,2,f+18-2),h=this.getBezierValue(i,d,3,f+36-2)}if(s!==1)if(r===ze.setup){const m=e.data.setupPose.color;c=m.r+(c-m.r)*s,l=m.g+(l-m.g)*s,h=m.b+(h-m.b)*s}else c=a.r+(c-a.r)*s,l=a.g+(l-a.g)*s,h=a.b+(h-a.b)*s;a.r=c<0?0:c>1?1:c,a.g=l<0?0:l>1?1:l,a.b=h<0?0:h>1?1:h}}class QT extends nr{constructor(t,i,s){super(t,i,`${ot.alpha}|${s}`);T(this,"slotIndex",0);this.slotIndex=s}apply(t,i,s,r,o,a,c,l,h){const u=t.slots[this.slotIndex];if(!u.bone.active)return;const d=(h?u.appliedPose:u.pose).color;let f=0;const m=this.frames;if(s1?1:f}}class eE extends pd{constructor(e,t,i){super(e,t,i,`${ot.rgb}|${i}`,`${ot.alpha}|${i}`,`${ot.rgb2}|${i}`)}getFrameEntries(){return 8}setFrame(e,t,i,s,r,o,a,c,l){e<<=3,this.frames[e]=t,this.frames[e+1]=i,this.frames[e+2]=s,this.frames[e+3]=r,this.frames[e+4]=o,this.frames[e+5]=a,this.frames[e+6]=c,this.frames[e+7]=l}apply1(e,t,i,s,r,o){const a=t.color,c=t.darkColor;let l=0,h=0,u=0;const d=this.frames;if(i>3];switch(b){case 0:{const y=d[v];f=d[v+1],m=d[v+2],p=d[v+3],g=d[v+4],l=d[v+5],h=d[v+6],u=d[v+7];const x=(i-y)/(d[v+8]-y);f+=(d[v+8+1]-f)*x,m+=(d[v+8+2]-m)*x,p+=(d[v+8+3]-p)*x,g+=(d[v+8+4]-g)*x,l+=(d[v+8+5]-l)*x,h+=(d[v+8+6]-h)*x,u+=(d[v+8+7]-u)*x;break}case 1:f=d[v+1],m=d[v+2],p=d[v+3],g=d[v+4],l=d[v+5],h=d[v+6],u=d[v+7];break;default:f=this.getBezierValue(i,v,1,b-2),m=this.getBezierValue(i,v,2,b+18-2),p=this.getBezierValue(i,v,3,b+36-2),g=this.getBezierValue(i,v,4,b+54-2),l=this.getBezierValue(i,v,5,b+72-2),h=this.getBezierValue(i,v,6,b+90-2),u=this.getBezierValue(i,v,7,b+108-2)}if(s===1)a.set(f,m,p,g);else if(r===ze.setup){const y=e.data.setupPose;let x=y.color;a.set(x.r+(f-x.r)*s,x.g+(m-x.g)*s,x.b+(p-x.b)*s,x.a+(g-x.a)*s),x=y.darkColor,l=x.r+(l-x.r)*s,h=x.g+(h-x.g)*s,u=x.b+(u-x.b)*s}else a.add((f-a.r)*s,(m-a.g)*s,(p-a.b)*s,(g-a.a)*s),l=c.r+(l-c.r)*s,h=c.g+(h-c.g)*s,u=c.b+(u-c.b)*s;c.r=l<0?0:l>1?1:l,c.g=h<0?0:h>1?1:h,c.b=u<0?0:u>1?1:u}}class tE extends pd{constructor(e,t,i){super(e,t,i,`${ot.rgb}|${i}`,`${ot.rgb2}|${i}`)}getFrameEntries(){return 7}setFrame(e,t,i,s,r,o,a,c){e*=7,this.frames[e]=t,this.frames[e+1]=i,this.frames[e+2]=s,this.frames[e+3]=r,this.frames[e+4]=o,this.frames[e+5]=a,this.frames[e+6]=c}apply1(e,t,i,s,r,o){const a=t.color,c=t.darkColor;let l=0,h=0,u=0,d=0,f=0,m=0;const p=this.frames;if(i1?1:l,a.g=h<0?0:h>1?1:h,a.b=u<0?0:u>1?1:u,c.r=d<0?0:d>1?1:d,c.g=f<0?0:f>1?1:f,c.b=m<0?0:m>1?1:m}}class $l extends Gt{constructor(t,i){super(t,`${ot.attachment}|${i}`);T(this,"slotIndex",0);T(this,"attachmentNames");this.slotIndex=i,this.attachmentNames=new Array(t),this.instant=!0}getFrameCount(){return this.frames.length}setFrame(t,i,s){this.frames[t]=i,this.attachmentNames[t]=s}apply(t,i,s,r,o,a,c,l,h){const u=t.slots[this.slotIndex];if(!u.bone.active)return;const d=h?u.appliedPose:u.pose;l||st){const l=this.frames[i];return s[r+1]*(t-l)/(s[r]-l)}const o=r+18;for(r+=2;r=t){const l=s[r-2],h=s[r-1];return h+(t-l)/(s[r]-l)*(s[r+1]-h)}const a=s[o-2],c=s[o-1];return c+(1-c)*(t-a)/(this.frames[i+this.getFrameEntries()]-a)}apply(t,i,s,r,o,a,c,l,h){const u=t.slots;if(!this.attachment.isTimelineActive(u,this.slotIndex,h))return;const d=this.attachment.timelineSlots,f=this.frames;if(s=f[f.length-1])g=0,m=this.vertices[f.length-1],p=null;else{const b=Gt.search(f,s);g=this.getCurvePercent(s,b),m=this.vertices[b],p=this.vertices[b+1]}const v=this.vertices[0].length;this.applyToSlot(u[this.slotIndex],h,m,p,g,v,o,a,c);for(const b of d)this.applyToSlot(u[b],h,m,p,g,v,o,a,c)}applyBeforeFirst(t,i,s,r){if(!t.bone.active)return;const o=i?t.appliedPose:t.pose;if(o.attachment==null||o.attachment.timelineAttachment!==this.attachment)return;const a=o.deform;switch(a.length===0&&(r=ze.setup),r){case ze.setup:a.length=0;break;case ze.first:{if(s===1){a.length=0;return}const c=this.vertices[0].length;a.length=c;const l=a,h=o.attachment;if(h.bones===null){const u=h.vertices;for(let d=0;d>4,h=c.attachment.sequence.regions.length;const u=UT[o&15];if(u!==$i.hold)switch(l+=(s-r)/a+1e-5|0,u){case $i.once:l=Math.min(h-1,l);break;case $i.loop:l%=h;break;case $i.pingpong:{const d=(h<<1)-2;l=d===0?0:l%d,l>=h&&(l=d-l);break}case $i.onceReverse:l=Math.max(h-1-l,0);break;case $i.loopReverse:l=h-1-l%h;break;case $i.pingpongReverse:{const d=(h<<1)-2;l=d===0?0:(l+h-1)%d,l>=h&&(l=d-l)}}c.sequenceIndex=l}};T(Mn,"ENTRIES",3),T(Mn,"MODE",1),T(Mn,"DELAY",2);let Mu=Mn;const Fu=class Fu extends Gt{constructor(t){super(t,...Fu.propertyIds);T(this,"events");this.events=new Array(t),this.instant=!0}getFrameCount(){return this.frames.length}setFrame(t,i){this.frames[t]=i.time,this.events[t]=i}apply(t,i,s,r,o,a,c,l,h){if(!r)return;const u=this.frames,d=this.frames.length;if(i>s)this.apply(null,i,Number.MAX_VALUE,r,0,a,!1,!1,!1),i=-1;else if(i>=u[d-1])return;if(s0&&u[f-1]===m;)f--}for(;f=u[f];f++)r.push(this.events[f])}};T(Fu,"propertyIds",[`${ot.event}`]);let cc=Fu;const Ta=class Ta extends Gt{constructor(t){super(t,...Ta.propertyIds);T(this,"drawOrders");this.drawOrders=new Array(t),this.instant=!0}getFrameCount(){return this.frames.length}setFrame(t,i,s){this.frames[t]=i,this.drawOrders[t]=s}apply(t,i,s,r,o,a,c,l,h){const u=h?t.drawOrder.appliedPose:t.drawOrder.pose,d=t.slots;if(l||s>2];switch(b){case 0:{const x=f[v];m=f[v+1],p=f[v+2],g=f[v+3];const _=(s-x)/(f[v+4]-x);m+=(f[v+4+1]-m)*_,p+=(f[v+4+2]-p)*_,g+=(f[v+4+3]-g)*_;break}case 1:m=f[v+1],p=f[v+2],g=f[v+3];break;default:m=this.getBezierValue(s,v,1,b-2),p=this.getBezierValue(s,v,2,b+18-2),g=this.getBezierValue(s,v,3,b+36-2)}const y=a===ze.setup?u.data.setupPose:d;c?(d.mixRotate=y.mixRotate+m*o,d.mixX=y.mixX+p*o,d.mixY=y.mixY+g*o):(d.mixRotate=y.mixRotate+(m-y.mixRotate)*o,d.mixX=y.mixX+(p-y.mixX)*o,d.mixY=y.mixY+(g-y.mixY)*o)}}class ro extends xc{constructor(e,t,i,s){super(e,t,i,s)}apply(e,t,i,s,r,o,a,c,l){if(a&&!this.additive&&(a=!1),this.constraintIndex===-1){const h=i>=this.frames[0]?this.getCurveValue(i):0,u=e.physics;for(const d of u)if(d.active&&this.global(d.data)){const f=l?d.appliedPose:d.pose;this.set(f,this.getAbsoluteValue(i,r,o,a,this.get(f),this.get(d.data.setupPose),h))}}else{const h=e.constraints[this.constraintIndex];if(h.active){const u=l?h.appliedPose:h.pose;this.set(u,this.getAbsoluteValue(i,r,o,a,this.get(u),this.get(h.data.setupPose)))}}}}class lE extends ro{constructor(e,t,i){super(e,t,i,ot.physicsConstraintInertia)}get(e){return e.inertia}set(e,t){e.inertia=t}global(e){return e.inertiaGlobal}}class cE extends ro{constructor(e,t,i){super(e,t,i,ot.physicsConstraintStrength)}get(e){return e.strength}set(e,t){e.strength=t}global(e){return e.strengthGlobal}}class hE extends ro{constructor(e,t,i){super(e,t,i,ot.physicsConstraintDamping)}get(e){return e.damping}set(e,t){e.damping=t}global(e){return e.dampingGlobal}}class uE extends ro{constructor(e,t,i){super(e,t,i,ot.physicsConstraintMass)}get(e){return 1/e.massInverse}set(e,t){e.massInverse=1/t}global(e){return e.massGlobal}}class dE extends ro{constructor(e,t,i){super(e,t,i,ot.physicsConstraintWind),this.additive=!0}get(e){return e.wind}set(e,t){e.wind=t}global(e){return e.windGlobal}}class fE extends ro{constructor(e,t,i){super(e,t,i,ot.physicsConstraintGravity),this.additive=!0}get(e){return e.gravity}set(e,t){e.gravity=t}global(e){return e.gravityGlobal}}class mE extends ro{constructor(e,t,i){super(e,t,i,ot.physicsConstraintMix)}get(e){return e.mix}set(e,t){e.mix=t}global(e){return e.mixGlobal}}const Lu=class Lu extends Gt{constructor(t,i){super(t,...Lu.propertyIds);T(this,"constraintIndex");this.constraintIndex=i,this.instant=!0}getFrameCount(){return this.frames.length}setFrame(t,i){this.frames[t]=i}apply(t,i,s,r,o,a,c,l,h){let u;if(this.constraintIndex!==-1&&(u=t.constraints[this.constraintIndex],!u.active))return;const d=this.frames;if(i>s)this.apply(t,i,Number.MAX_VALUE,[],o,a,!1,!1,!1),i=-1;else if(i>=d[d.length-1])return;if(!(s=d[Gt.search(d,i)+1]))if(u!=null)u.reset(t);else for(const f of t.physics)f.active&&f.reset(t)}};T(Lu,"propertyIds",[ot.physicsConstraintReset.toString()]);let Au=Lu;class pE extends xc{constructor(e,t,i){super(e,t,i,ot.sliderTime)}apply(e,t,i,s,r,o,a,c,l){const h=e.constraints[this.constraintIndex];if(h.active){const u=l?h.appliedPose:h.pose;u.time=this.getAbsoluteValue(i,r,o,a,u.time,h.data.setupPose.time)}}}class gE extends xc{constructor(e,t,i){super(e,t,i,ot.sliderMix),this.additive=!0}apply(e,t,i,s,r,o,a,c,l){const h=e.constraints[this.constraintIndex];if(h.active){const u=l?h.appliedPose:h.pose;u.mix=this.getAbsoluteValue(i,r,o,a,u.mix,h.data.setupPose.mix)}}}const Bl=class Bl{constructor(e){T(this,"data");T(this,"tracks",[]);T(this,"timeScale",1);T(this,"unkeyedState",0);T(this,"events",[]);T(this,"listeners",[]);T(this,"queue",new uU(this));T(this,"propertyIds",new Map);T(this,"animationsChanged",!1);T(this,"trackEntryPool",new nU(()=>new hU));this.data=e}update(e){e*=this.timeScale;const t=this.tracks;for(let i=0,s=t.length;i0){if(r.delay-=o,r.delay>0)continue;o=-r.delay,r.delay=0}let a=r.next;if(a){const c=r.trackLast-a.delay;if(c>=0){for(a.delay=0,a.trackTime+=r.timeScale===0?0:(c/r.timeScale+e)*a.timeScale,r.trackTime+=o,this.setTrack(i,a,!0);a.mixingFrom;)a.mixTime+=e,a=a.mixingFrom;continue}}else if(r.trackLast>=r.trackEnd&&!r.mixingFrom){t[i]=null,this.queue.end(r),this.clearNext(r);continue}if(r.mixingFrom&&this.updateMixingFrom(r,e)){let c=r.mixingFrom;for(r.mixingFrom=null,c&&(c.mixingTo=null);c;)this.queue.end(c),c=c.mixingFrom}r.trackTime+=o}this.queue.drain()}updateMixingFrom(e,t){const i=e.mixingFrom;if(!i)return!0;const s=this.updateMixingFrom(i,t);if(i.animationLast=i.nextAnimationLast,i.trackLast=i.nextTrackLast,e.nextTrackLast!==-1&&e.mixTime>=e.mixDuration){if(i.totalAlpha===0||e.mixDuration===0){if(e.mixingFrom=i.mixingFrom,i.mixingFrom!=null&&(i.mixingFrom.mixingTo=e),i.totalAlpha===0)for(let r=e;r.mixingTo!=null;r=r.mixingTo)r.keepHold=!0;this.queue.end(i)}return s}return i.trackTime+=t*i.timeScale,e.mixTime+=t,!1}apply(e){if(!e)throw new Error("skeleton cannot be null.");this.animationsChanged&&this._animationsChanged();const t=this.events,i=this.tracks;let s=!1;for(let a=0,c=i.length;a0)continue;s=!0;let h=l.alpha;l.mixingFrom?h*=this.applyMixingFrom(l,e):l.trackTime>=l.trackEnd&&!l.next&&(h=0);let u=l.animationLast,d=l.getAnimationTime(),f=d,m=t;l.reverse&&(f=l.animation.duration-f,m=null);const p=l.animation.timelines,g=p.length;if(a===0&&h===1)for(let v=0;v=l.alphaAttachmentThreshold,y=l.additive,x=y||l.shortestRotation,_=!x&&l.timelinesRotation.length!==g<<1;_&&(l.timelinesRotation.length=g<<1);for(let E=0;E0?c/a:o,h=i.animation.timelines,u=h.length,d=i.timelineMode,f=i.timelineHoldMix,m=r=i.alphaAttachmentThreshold);else{const B=!p||!(M instanceof qr)||A===ze.current;M.apply(t,x,E,S,R,A,g,B,!1)}}return i.reverse&&r0&&this.queueEvents(i,_),this.events.length=0,i.nextAnimationLast=_,i.nextTrackLast=i.trackTime,r}applyAttachmentTimeline(e,t,i,s,r){const o=t.slots[e.slotIndex];if(!o.bone.active||!r&&o.attachmentState===this.unkeyedState+w1)return;let a=i=0,_=v>=0;Math.abs(b)<=90&&Re.signum(b)!==Re.signum(g)&&(Math.abs(v-y)>180?(p+=360*Re.signum(v),_=x):y!==0?p-=360*Re.signum(v):_=x),_!==x&&(p+=360*Re.signum(v)),o[a]=p}o[a+1]=g,h.rotation=f+p*s}queueEvents(e,t){const i=e.animationStart,s=e.animationEnd,r=s-i,o=e.reverse;let a=e.trackLast%r;o&&(a=r-a);const c=this.events;let l=0,h=c.length;for(;l=i&&d.time<=s&&this.queue.event(e,d)}let u=!1;if(e.loop)if(r===0)u=!0;else{const d=Math.floor(e.trackTime/r);u=d>0&&d>Math.floor(e.trackLast/r)}else u=t>=s&&e.animationLast=i&&d.time<=s&&this.queue.event(e,d)}}eventsReverse(e,t,i){const s=e.animation.duration,r=s-t,o=s-i,a=e.animation.timelines;for(let c=0,l=e.animation.timelines.length;c=o){for(let m=0;m=r)break;this.events.push(u[m])}}else{for(let p=0;p=r);p++)this.events.push(u[p]);let m=0;for(;m=o);m++);for(;m= 0.");if(e>=this.tracks.length)return;const t=this.tracks[e];if(!t)return;this.queue.end(t),this.clearNext(t);let i=t;for(;;){const s=i.mixingFrom;if(!s)break;this.queue.end(s),i.mixingFrom=null,i.mixingTo=null,i=s}this.tracks[t.trackIndex]=null,this.queue.drain()}setTrack(e,t,i){const s=this.expandToIndex(e);this.tracks[e]=t,t.previous=null,s&&(s.next=null,i&&this.queue.interrupt(s),t.mixingFrom=s,s.mixingTo=t,t.mixTime=0,s.timelinesRotation.length=0),this.queue.start(t)}setAnimation(e,t,i=!1){return typeof t=="string"?this.setAnimation1(e,t,i):this.setAnimation2(e,t,i)}setAnimation1(e,t,i=!1){const s=this.data.skeletonData.findAnimation(t);if(!s)throw new Error(`Animation not found: ${t}`);return this.setAnimation2(e,s,i)}setAnimation2(e,t,i=!1){if(e<0)throw new Error("trackIndex must be >= 0.");if(!t)throw new Error("animation cannot be null.");let s=!0,r=this.expandToIndex(e);r&&(r.nextTrackLast===-1&&r.animation===t?(this.tracks[e]=r.mixingFrom,this.queue.interrupt(r),this.queue.end(r),this.clearNext(r),r=r.mixingFrom,s=!1):this.clearNext(r));const o=this.trackEntry(e,t,i,r);return this.setTrack(e,o,s),this.queue.drain(),o}addAnimation(e,t,i=!1,s=0){return typeof t=="string"?this.addAnimation1(e,t,i,s):this.addAnimation2(e,t,i,s)}addAnimation1(e,t,i=!1,s=0){const r=this.data.skeletonData.findAnimation(t);if(!r)throw new Error(`Animation not found: ${t}`);return this.addAnimation2(e,r,i,s)}addAnimation2(e,t,i=!1,s=0){if(e<0)throw new Error("trackIndex must be >= 0.");if(!t)throw new Error("animation cannot be null.");let r=this.expandToIndex(e);if(r)for(;r.next;)r=r.next;const o=this.trackEntry(e,t,i,r);return r?(r.next=o,o.previous=r,s<=0&&(s=Math.max(s+r.getTrackComplete()-o.mixDuration,0))):(this.setTrack(e,o,!0),this.queue.drain(),s<0&&(s=0)),o.delay=s,o}setEmptyAnimation(e,t=0){const i=this.setAnimation(e,Bl.emptyAnimation,!1);return i.mixDuration=t,i.trackEnd=t,i}addEmptyAnimation(e,t=0,i=0){const s=this.addAnimation(e,Bl.emptyAnimation,!1,i);return i<=0&&(s.delay=Math.max(s.delay+s.mixDuration-t,0)),s.mixDuration=t,s.trackEnd=t,s}setEmptyAnimations(e=0){const t=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(let i=0,s=this.tracks.length;i0&&(o[d]=v);break}}c&&(g=g&~ph|r[d]&ph),r[d]=g}}from(e,t,i){const s=this.propertyIds;let r=dU;for(let o=0,a=i.length;o= 0.");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){const t=this.listeners.indexOf(e);t>=0&&this.listeners.splice(t,1)}clearListeners(){this.listeners.length=0}clearListenerNotifications(){this.queue.clear()}};T(Bl,"emptyAnimation",new e0("",[],0));let g1=Bl;class hU{constructor(){T(this,"animation",null);T(this,"previous",null);T(this,"next",null);T(this,"mixingFrom",null);T(this,"mixingTo",null);T(this,"listener",null);T(this,"trackIndex",0);T(this,"loop",!1);T(this,"additive",!1);T(this,"reverse",!1);T(this,"shortestRotation",!1);T(this,"keepHold",!1);T(this,"eventThreshold",0);T(this,"mixAttachmentThreshold",0);T(this,"alphaAttachmentThreshold",0);T(this,"mixDrawOrderThreshold",0);T(this,"animationStart",0);T(this,"animationEnd",0);T(this,"animationLast",0);T(this,"nextAnimationLast",0);T(this,"delay",0);T(this,"trackTime",0);T(this,"trackLast",0);T(this,"nextTrackLast",0);T(this,"trackEnd",0);T(this,"timeScale",0);T(this,"alpha",0);T(this,"mixTime",0);T(this,"mixDuration",0);T(this,"totalAlpha",0);T(this,"mixInterpolation",Da.linear);T(this,"timelineMode",[]);T(this,"timelineHoldMix",[]);T(this,"timelinesRotation",[])}setMixDuration(e,t){this.mixDuration=e,t!==void 0&&(t<=0&&(t=this.previous==null?0:Math.max(t+this.previous.getTrackComplete()-e,0)),this.delay=t)}setMixInterpolation(e){if(!e)throw new Error("mixInterpolation cannot be null.");this.mixInterpolation=e}mix(){if(this.mixDuration===0)return 1;let e=this.mixTime/this.mixDuration;return e>=1?1:this.mixInterpolation===Da.linear?e:(e=this.mixInterpolation.apply(e),e<0?0:e>1?1:e)}reset(){this.next=null,this.previous=null,this.mixingFrom=null,this.mixingTo=null,this.mixInterpolation=Da.linear,this.animation=null,this.listener=null,this.timelineMode.length=0,this.timelineHoldMix.length=0,this.timelinesRotation.length=0}getAnimationTime(){if(!this.loop)return Math.min(this.trackTime+this.animationStart,this.animationEnd);const e=this.animationEnd-this.animationStart;return e===0?this.animationStart:this.trackTime%e+this.animationStart}setAnimationLast(e){this.animationLast=e,this.nextAnimationLast=e}isComplete(){return this.trackTime>=this.animationEnd-this.animationStart}resetRotationDirections(){this.timelinesRotation.length=0}getTrackComplete(){const e=this.animationEnd-this.animationStart;if(e!==0){if(this.loop)return e*(1+(this.trackTime/e|0));if(this.trackTime=0}}class uU{constructor(e){T(this,"objects",[]);T(this,"drainDisabled",!1);T(this,"animState");this.animState=e}start(e){this.objects.push(cn.start),this.objects.push(e),this.animState.animationsChanged=!0}interrupt(e){this.objects.push(cn.interrupt),this.objects.push(e)}end(e){this.objects.push(cn.end),this.objects.push(e),this.animState.animationsChanged=!0}dispose(e){this.objects.push(cn.dispose),this.objects.push(e)}complete(e){this.objects.push(cn.complete),this.objects.push(e)}event(e,t){this.objects.push(cn.event),this.objects.push(e),this.objects.push(t)}drain(){var e,t,i,s,r,o;if(!this.drainDisabled){this.drainDisabled=!0;for(let a=0;a= 0.");if(!i)throw new Error("name cannot be null.");this.index=t,this.parent=s}copy(t){const i=new vd(this.index,this.name,t);return i.length=this.length,i.setupPose.set(this.setupPose),i}}var ri;(function(n){n[n.Normal=0]="Normal",n[n.OnlyTranslation=1]="OnlyTranslation",n[n.NoRotationOrReflection=2]="NoRotationOrReflection",n[n.NoScale=3]="NoScale",n[n.NoScaleOrReflection=4]="NoScaleOrReflection"})(ri||(ri={}));class Up{constructor(){T(this,"bone");T(this,"x",0);T(this,"y",0);T(this,"rotation",0);T(this,"scaleX",0);T(this,"scaleY",0);T(this,"shearX",0);T(this,"shearY",0);T(this,"inherit",ri.Normal);T(this,"a",0);T(this,"b",0);T(this,"c",0);T(this,"d",0);T(this,"worldY",0);T(this,"worldX",0);T(this,"world",0);T(this,"local",0)}set(e){if(e==null)throw new Error("pose cannot be null.");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}setPosition(e,t){this.x=e,this.y=t}setScale(e,t){this.scaleX=e,this.scaleY=t===void 0?e:t}getInherit(){return this.inherit}setInherit(e){if(e==null)throw new Error("inherit cannot be null.");this.inherit=e}update(e,t){this.world!==e._update&&this.updateWorldTransform(e)}updateWorldTransform(e){this.local===e._update?this.updateLocalTransform(e):this.world=e._update;const t=this.rotation,i=this.scaleX,s=this.scaleY,r=this.shearX,o=this.shearY;if(!this.bone.parent){const d=e.scaleX,f=e.scaleY,m=(t+r)*Re.degRad,p=(t+90+o)*Re.degRad;this.a=Math.cos(m)*i*d,this.b=Math.cos(p)*s*d,this.c=Math.sin(m)*i*f,this.d=Math.sin(p)*s*f,this.worldX=this.x*d+e.x,this.worldY=this.y*f+e.y;return}const a=this.bone.parent.appliedPose;let c=a.a,l=a.b,h=a.c,u=a.d;switch(this.worldX=c*this.x+l*this.y+a.worldX,this.worldY=h*this.x+u*this.y+a.worldY,this.inherit){case ri.Normal:{const d=(t+r)*Re.degRad,f=(t+90+o)*Re.degRad,m=Math.cos(d)*i,p=Math.cos(f)*s,g=Math.sin(d)*i,v=Math.sin(f)*s;this.a=c*m+l*g,this.b=c*p+l*v,this.c=h*m+u*g,this.d=h*p+u*v;return}case ri.OnlyTranslation:{const d=e.scaleX,f=e.scaleY,m=(t+r)*Re.degRad,p=(t+90+o)*Re.degRad;this.a=Math.cos(m)*i*d,this.b=Math.cos(p)*s*d,this.c=Math.sin(m)*i*f,this.d=Math.sin(p)*s*f;break}case ri.NoRotationOrReflection:{const d=e.scaleX,f=e.scaleY,m=1/d,p=1/f;c*=m,h*=p;let g=c*c+h*h,v=0;g>Re.epsilon2?(g=Math.abs(c*u*p-l*m*h)/g,l=h*g,u=c*g,v=t-Re.atan2Deg(h,c)):(c=0,h=0,v=t-90+Re.atan2Deg(u,l));const b=(v+r)*Re.degRad,y=(v+o+90)*Re.degRad,x=Math.cos(b)*i,_=Math.cos(y)*s,E=Math.sin(b)*i,S=Math.sin(y)*s;this.a=(c*x-l*E)*d,this.b=(c*_-l*S)*d,this.c=(h*x+u*E)*f,this.d=(h*_+u*S)*f;break}case ri.NoScale:case ri.NoScaleOrReflection:{const d=e.scaleX,f=e.scaleY,m=1/d,p=1/f,g=t*Re.degRad,v=Math.cos(g),b=Math.sin(g);let y=(c*v+l*b)*m,x=(h*v+u*b)*p;const _=1/Math.sqrt(y*y+x*x);y*=_,x*=_;let E=-x,S=y;this.inherit===ri.NoScale&&c*u-l*h<0!=(d<0!=f<0)&&(E=-E,S=-S);const C=r*Re.degRad,M=(90+o)*Re.degRad,P=Math.cos(C)*i,A=Math.cos(M)*s,R=Math.sin(C)*i,B=Math.sin(M)*s;this.a=(y*P+E*R)*d,this.b=(y*A+E*B)*d,this.c=(x*P+S*R)*f,this.d=(x*A+S*B)*f;break}}}updateLocalTransform(e){this.local=0,this.world=e._update;const t=e.scaleX,i=e.scaleY;if(!this.bone.parent){const v=1/t,b=1/i;this.x=(this.worldX-e.x)*v,this.y=(this.worldY-e.y)*b,this.set5(this.a*v,this.b*v,this.c*b,this.d*b,0);return}const s=this.bone.parent.appliedPose;let r=s.a,o=s.b,a=s.c,c=s.d;const l=r*c-o*a,h=1/(r*c-o*a),u=c*h,d=o*h,f=a*h,m=r*h,p=this.worldX-s.worldX,g=this.worldY-s.worldY;switch(this.x=p*u-g*d,this.y=g*m-p*f,this.inherit){case ri.Normal:this.set5(u*this.a-d*this.c,u*this.b-d*this.d,m*this.c-f*this.a,m*this.d-f*this.b,0);break;case ri.OnlyTranslation:{const v=1/t,b=1/i;this.set5(this.a*v,this.b*v,this.c*b,this.d*b,0);break}case ri.NoRotationOrReflection:{const v=1/t,b=1/i;r*=v,a*=b;const y=this.a*v,x=this.b*v,_=this.c*b,E=this.d*b,S=1/(r*r+a*a),C=1/Math.abs(l*v*b);this.set5((r*y+a*_)*S,(r*x+a*E)*S,(r*_-a*y)*C,(r*E-a*x)*C,Re.atan2Deg(a,r));break}case ri.NoScale:case ri.NoScaleOrReflection:{const v=1/t,b=1/i,y=this.a*v,x=this.b*v,_=this.c*b,E=this.d*b;let S=c*this.a-o*this.c,C=r*this.c-a*this.a;l<0&&(S=-S,C=-C);let M=Re.atan2Deg(C,S);this.rotation=M,M*=Re.degRad;const P=Math.cos(M),A=Math.sin(M);let R=(r*P+o*A)*v,B=(a*P+c*A)*b;const O=1/Math.sqrt(R*R+B*B);R*=O,B*=O;const W=this.inherit===ri.NoScale&&l<0!=(t<0!=i<0)?-1:1;this.set4(R*y+B*_,R*x+B*E,(R*_-B*y)*W,(R*E-B*x)*W)}}}set4(e,t,i,s){const r=e*e+i*i,o=t*t+s*s;r>Re.epsilon2?(this.shearX=Re.atan2Deg(i,e),this.scaleX=Math.sqrt(r)):(this.shearX=0,this.scaleX=0),this.scaleY=Math.sqrt(o),o>Re.epsilon2?(this.shearY=Re.atan2Deg(s,t),e*s-t*i<0?(this.scaleY=-this.scaleY,this.shearY+=90):this.shearY-=90,this.shearY>180?this.shearY-=360:this.shearY<=-180&&(this.shearY+=360)):this.shearY=0}set5(e,t,i,s,r){this.shearX=0;const o=e*e+i*i,a=t*t+s*s;if(o>Re.epsilon2){const c=Re.atan2Deg(i,e);this.rotation=c+r,this.scaleX=Math.sqrt(o),this.scaleY=Math.sqrt(a),a>Re.epsilon2?(this.shearY=Re.atan2Deg(s,t),e*s-t*i<0?(this.scaleY=-this.scaleY,this.shearY+=90-c):this.shearY-=90+c,this.shearY>180?this.shearY-=360:this.shearY<=-180&&(this.shearY+=360)):this.shearY=0}else this.scaleX=0,this.scaleY=Math.sqrt(a),this.shearY=0,this.rotation=a>Re.epsilon2?Re.atan2Deg(s,t)-90+r:r}validateLocalTransform(e){this.local===e._update&&this.updateLocalTransform(e)}modifyLocal(e){this.local===e._update&&this.updateLocalTransform(e),this.world=0,this.resetWorld(e,e._update)}modifyWorld(e){const t=e._update;this.local=t,this.world=t,this.resetWorld(e,t)}resetWorld(e,t){const i=this.bone.children;for(let s=0,r=i.length;s1&&t.constrained(this.bones[1].bone)}isSourceActive(){return this.target.active}static apply(t,i,s,r,o,a,c,l,h,u){typeof s=="number"?Lr.apply1(t,i,s,r,o,a,c,l):Lr.apply2(t,i,s,r,o,a,c,l,h,u)}static apply1(t,i,s,r,o,a,c,l){i.modifyLocal(t);const h=i.bone.parent.appliedPose;let u=h.a,d=h.b,f=h.c,m=h.d,p=-i.shearX-i.rotation,g=0,v=0;switch(i.inherit){case ri.OnlyTranslation:g=(s-i.worldX)*Re.signum(t.scaleX),v=(r-i.worldY)*Re.signum(t.scaleY);break;case ri.NoRotationOrReflection:{const b=Math.abs(u*m-d*f)/Math.max(Re.epsilon,u*u+f*f),y=u/t.scaleX,x=f/t.scaleY;d=-x*b*t.scaleX,m=y*b*t.scaleY,p+=Re.atan2Deg(x,y)}default:{const b=s-h.worldX,y=r-h.worldY,x=u*m-d*f;Math.abs(x)<=Re.epsilon?(g=0,v=0):(g=(b*m-y*d)/x-i.x,v=(y*u-b*f)/x-i.y)}}if(p+=Re.atan2Deg(v,g),i.scaleX<0&&(p+=180),p>180?p-=360:p<=-180&&(p+=360),i.rotation+=p*l,o||a){switch(i.inherit){case ri.NoScale:case ri.NoScaleOrReflection:g=s-i.worldX,v=r-i.worldY}const b=i.bone.data.length*i.scaleX;if(b>Re.epsilon){const y=g*g+v*v;if(o&&yb*b){const x=(Math.sqrt(y)/b-1)*l+1;switch(i.scaleX*=x,c){case en.Uniform:i.scaleY*=x;break;case en.Volume:i.scaleY/=x<.7?.25+.642857*x:x}}}}}static apply2(t,i,s,r,o,a,c,l,h,u){if(i.inherit!==ri.Normal||s.inherit!==ri.Normal)return;i.modifyLocal(t),s.modifyLocal(t);let d=i.x,f=i.y,m=i.scaleX,p=i.scaleY,g=s.scaleX,v=0,b=0,y=0;m<0?(m=-m,v=180,y=-1):(v=0,y=1),p<0&&(p=-p,y=-y),g<0?(g=-g,b=180):b=0;let x=0,_=0,E=i.a,S=i.b,C=i.c,M=i.d;const P=Math.abs(m-p)<=Re.epsilon;!P||c?(s.y=0,x=E*s.x+i.worldX,_=C*s.x+i.worldY):(x=E*s.x+S*s.y+i.worldX,_=C*s.x+M*s.y+i.worldY);const A=i.bone.parent.appliedPose;E=A.a,S=A.b,C=A.c,M=A.d;let R=E*M-S*C,B=x-A.worldX,O=_-A.worldY;R=Math.abs(R)<=Re.epsilon?0:1/R;const W=(B*M-O*S)*R-d,V=(O*E-B*C)*R-f;let Y=Math.sqrt(W*W+V*V),L=s.bone.data.length*g,N,F;if(Y0){let le=Math.min(1,oe/(h*2))-1;le=(oe-h*(1-le*le))/J,D-=le*D,X-=le*X,G=D*D+X*X}}e:if(P){L*=m;let J=(G-Y*Y-L*L)/(2*Y*L);if(J<-1)J=-1,F=Math.PI*a;else if(J>1){if(J=1,F=0,c)switch(E=(Math.sqrt(G)/(Y+L)-1)*u+1,i.scaleX*=E,l){case en.Uniform:i.scaleY*=E;break;case en.Volume:i.scaleY/=E<.7?.25+.642857*E:E}}else F=Math.acos(J)*a;E=Y+L*J,S=L*Math.sin(F),N=Math.atan2(X*E-D*S,D*E+X*S)}else{E=m*L,S=p*L;const J=E*E,oe=S*S,le=Math.atan2(X,D);C=oe*Y*Y+J*G-J*oe;const ve=-2*oe*Y,Se=oe-J;if(M=ve*ve-4*Se*C,M>=0){let U=Math.sqrt(M);ve<0&&(U=-U),U=-(ve+U)*.5;let z=U/Se,ee=C/U;const ne=Math.abs(z)=0){O=Math.sqrt(z)*a,N=le-Math.atan2(O,ne),F=Math.atan2(O/p,(ne-Y)/m);break e}}let fe=Re.PI,ye=Y-E,q=ye*ye,Z=0,se=0,H=Y+E,j=H*H,$=0;C=-E*Y/(J-oe),C>=-1&&C<=1&&(C=Math.acos(C),B=E*Math.cos(C)+Y,O=S*Math.sin(C),M=B*B+O*O,Mj&&(se=C,j=M,H=B,$=O)),G<=(q+j)*.5?(N=le-Math.atan2(Z*a,ye),F=fe*a):(N=le-Math.atan2($*a,H),F=se*a)}const K=Math.atan2(s.y,s.x)*y;N=(N-K)*Re.radDeg+v-i.rotation,N>180?N-=360:N<=-180&&(N+=360),i.rotation+=N*u,F=((F+K)*Re.radDeg-s.shearX)*y+b-s.rotation,F>180?F-=360:F<=-180&&(F+=360),s.rotation+=F*u}}class Rh extends Sc{constructor(t){super(t,new Vp);T(this,"bones",[]);T(this,"_target",null);T(this,"_scaleYMode",en.None)}set target(t){this._target=t}get target(){if(!this._target)throw new Error("target cannot be null.");return this._target}set scaleYMode(t){this._scaleYMode=t}get scaleYMode(){if(this._scaleYMode==null)throw new Error("scaleYMode cannot be null.");return this._scaleYMode}create(t){return new Lr(this,t)}}class Xp{constructor(){T(this,"position",0);T(this,"spacing",0);T(this,"mixRotate",0);T(this,"mixX",0);T(this,"mixY",0)}set(e){this.position=e.position,this.spacing=e.spacing,this.mixRotate=e.mixRotate,this.mixX=e.mixX,this.mixY=e.mixY}}class kh extends Sc{constructor(t){super(t,new Xp);T(this,"bones",[]);T(this,"_slot",null);T(this,"positionMode",Is.Fixed);T(this,"spacingMode",Ei.Fixed);T(this,"rotateMode",Do.Chain);T(this,"offsetRotation",0)}set slot(t){this._slot=t}get slot(){if(this._slot)return this._slot;throw new Error("SlotData not set.")}create(t){return new Yp(this,t)}}var Is;(function(n){n[n.Fixed=0]="Fixed",n[n.Percent=1]="Percent"})(Is||(Is={}));var Ei;(function(n){n[n.Length=0]="Length",n[n.Fixed=1]="Fixed",n[n.Percent=2]="Percent",n[n.Proportional=3]="Proportional"})(Ei||(Ei={}));var Do;(function(n){n[n.Tangent=0]="Tangent",n[n.Chain=1]="Chain",n[n.ChainScale=2]="ChainScale"})(Do||(Do={}));const Gn=class Gn extends wc{constructor(t,i){super(t,new Xp,new Xp);T(this,"data");T(this,"bones");T(this,"slot");T(this,"spaces",[]);T(this,"positions",[]);T(this,"world",[]);T(this,"curves",[]);T(this,"lengths",[]);T(this,"segments",[]);if(!i)throw new Error("skeleton cannot be null.");this.data=t,this.bones=[];for(const s of this.data.bones)this.bones.push(i.bones[s.index].constrainedPose);this.slot=i.slots[t.slot.index]}copy(t){var i=new Gn(this.data,t);return i.pose.set(this.pose),i}update(t,i){const s=this.slot.appliedPose.attachment;if(!(s instanceof hc))return;const r=this.appliedPose,o=r.mixRotate,a=r.mixX,c=r.mixY;if(o===0&&a===0&&c===0)return;const l=this.data,h=l.rotateMode===Do.Tangent,u=l.rotateMode===Do.ChainScale,d=this.bones,f=d.length,m=h?f:f+1,p=Ke.setArraySize(this.spaces,m),g=u?this.lengths=Ke.setArraySize(this.lengths,f):[],v=r.spacing;switch(l.spacingMode){case Ei.Percent:if(u)for(let S=0,C=m-1;S0){S=m/S*v;for(let C=1;C0?Re.degRad:-Re.degRad}for(let S=0,C=3;S0){let O=M.a,W=M.b,V=M.c,Y=M.d,L=0,N=0,F=0;if(h?L=b[C-1]:p[S+1]===0?L=b[C+2]:L=Math.atan2(B,R),L-=Math.atan2(V,O),E){N=Math.cos(L),F=Math.sin(L);const D=M.bone.data.length;y+=(D*(N*O-F*V)-R)*o,x+=(D*(F*O+N*V)-B)*o}else L+=_;L>Re.PI?L-=Re.PI2:L<-Re.PI&&(L+=Re.PI2),L*=o,N=Math.cos(L),F=Math.sin(L),M.a=N*O-F*V,M.b=N*W-F*Y,M.c=F*O+N*V,M.d=F*W+N*Y}}}computeWorldPositions(t,i,s,r){const o=this.slot;let a=this.appliedPose.position,c=this.spaces,l=Ke.setArraySize(this.positions,s*3+2),h=this.world;const u=i.closed;let d=i.worldVerticesLength,f=d/6,m=Gn.NONE;if(!i.constantSpeed){const F=i.lengths;f-=u?1:2;const D=F[f];this.data.positionMode===Is.Percent&&(a*=D);let X;switch(this.data.spacingMode){case Ei.Percent:X=D;break;case Ei.Proportional:X=D/s;break;default:X=1}h=Ke.setArraySize(this.world,8);for(let G=0,K=0,J=0;GD){m!==Gn.AFTER&&(m=Gn.AFTER,i.computeWorldVertices(t,o,d-6,4,h,0,2)),this.addAfterPosition(le-D,h,0,l,K);continue}for(;;J++){const ve=F[J];if(!(le>ve)){if(J===0)le/=ve;else{const Se=F[J-1];le=(le-Se)/(ve-Se)}break}}J!==m&&(m=J,u&&J===f?(i.computeWorldVertices(t,o,d-4,4,h,0,2),i.computeWorldVertices(t,o,0,4,h,4,2)):i.computeWorldVertices(t,o,J*6+2,8,h,0,2)),this.addCurvePosition(le,h[0],h[1],h[2],h[3],h[4],h[5],h[6],h[7],l,K,r||G>0&&oe===0)}return l}u?(d+=2,h=Ke.setArraySize(this.world,d),i.computeWorldVertices(t,o,2,d-4,h,0,2),i.computeWorldVertices(t,o,0,2,h,d-4,2),h[d-2]=h[0],h[d-1]=h[1]):(f--,d-=4,h=Ke.setArraySize(this.world,d),i.computeWorldVertices(t,o,2,d,h,0,2));const p=Ke.setArraySize(this.curves,f);let g=0,v=h[0],b=h[1],y=0,x=0,_=0,E=0,S=0,C=0,M=0,P=0,A=0,R=0,B=0,O=0,W=0,V=0;for(let F=0,D=2;Fg){this.addAfterPosition(J-g,h,d-4,l,D);continue}for(;;X++){const oe=p[X];if(!(J>oe)){if(X===0)J/=oe;else{const le=p[X-1];J=(J-le)/(oe-le)}break}}if(X!==m){m=X;let oe=X*6;for(v=h[oe],b=h[oe+1],y=h[oe+2],x=h[oe+3],_=h[oe+4],E=h[oe+5],S=h[oe+6],C=h[oe+7],M=(v-y*2+_)*.03,P=(b-x*2+E)*.03,A=((y-_)*3-v+S)*.006,R=((x-E)*3-b+C)*.006,B=M*2+A,O=P*2+R,W=(y-v)*.3+M+A*.16666667,V=(x-b)*.3+P+R*.16666667,N=Math.sqrt(W*W+V*V),L[0]=N,oe=1;oe<8;oe++)W+=B,V+=O,B+=A,O+=R,N+=Math.sqrt(W*W+V*V),L[oe]=N;W+=B,V+=O,N+=Math.sqrt(W*W+V*V),L[8]=N,W+=B+A,V+=O+R,N+=Math.sqrt(W*W+V*V),L[9]=N,G=0}for(J*=N;;G++){const oe=L[G];if(!(J>oe)){if(G===0)J/=oe;else{const le=L[G-1];J=G+(J-le)/(oe-le)}break}}this.addCurvePosition(J*.1,v,b,y,x,_,E,S,C,l,D,r||F>0&&K===0)}return l}addBeforePosition(t,i,s,r,o){const a=i[s],c=i[s+1],l=i[s+2]-a,h=i[s+3]-c,u=Math.atan2(h,l);r[o]=a+t*Math.cos(u),r[o+1]=c+t*Math.sin(u),r[o+2]=u}addAfterPosition(t,i,s,r,o){const a=i[s+2],c=i[s+3],l=a-i[s],h=c-i[s+1],u=Math.atan2(h,l);r[o]=a+t*Math.cos(u),r[o+1]=c+t*Math.sin(u),r[o+2]=u}addCurvePosition(t,i,s,r,o,a,c,l,h,u,d,f){if(t===0||Number.isNaN(t)){u[d]=i,u[d+1]=s,u[d+2]=Math.atan2(o-s,r-i);return}const m=t*t,p=m*t,g=1-t,v=g*g,b=v*g,y=g*t,x=y*3,_=g*x,E=x*t,S=i*b+r*_+a*E+l*p,C=s*b+o*_+c*E+h*p;u[d]=S,u[d+1]=C,f&&(t<.001?u[d+2]=Math.atan2(o-s,r-i):u[d+2]=Math.atan2(C-(s*v+o*y*2+c*m),S-(i*v+r*y*2+a*m)))}sort(t){const i=this.slot.data.index,s=this.slot.bone;t.skin!=null&&this.sortPathSlot(t,t.skin,i,s),t.data.defaultSkin!=null&&t.data.defaultSkin!==t.skin&&this.sortPathSlot(t,t.data.defaultSkin,i,s),this.sortPath(t,this.slot.pose.attachment,s);const r=this.bones,o=this.bones.length;for(let a=0;a0,a=this.data.y>0,c=this.data.rotate>0||this.data.shearX>0,l=this.data.scaleX>0,h=this.bone;let u=h.bone.data.length,d=this.data.step,f=0;if(i!==To.none){switch(h.modifyWorld(t),i){case To.reset:this.reset(t);case To.update:{const m=Math.max(t.time-this.lastTime,0),p=this.remaining;this.remaining+=m,this.lastTime=t.time;const g=h.worldX,v=h.worldY;if(this._reset)this._reset=!1,this.ux=g,this.uy=v;else{let b=this.remaining,y=s.inertia,x=t.data.referenceScale,_=-1,E=0,S=0,C=this.data.limit*m,M=C*Math.abs(t.scaleY);if(C*=Math.abs(t.scaleX),o||a){if(o){const P=(this.ux-g)*y;this.xOffset+=P>C?C:P<-C?-C:P,this.ux=g}if(a){const P=(this.uy-v)*y;this.yOffset+=P>M?M:P<-M?-M:P,this.uy=v}if(b>=d){const P=this.xOffset,A=this.yOffset;_=s.damping**(60*d),E=d*s.massInverse,S=s.strength;const R=x*s.wind,B=x*s.gravity,O=(R*t.windX+B*t.gravityX)*t.scaleX,W=(R*t.windY+B*t.gravityY)*t.scaleY;do o&&(this.xVelocity+=(O-this.xOffset*S)*E,this.xOffset+=this.xVelocity*d,this.xVelocity*=_),a&&(this.yVelocity-=(W+this.yOffset*S)*E,this.yOffset+=this.yVelocity*d,this.yVelocity*=_),b-=d;while(b>=d);this.xLag=this.xOffset-P,this.yLag=this.yOffset-A}f=Math.max(0,1-b/d),o&&(h.worldX+=(this.xOffset-this.xLag*f)*r*this.data.x),a&&(h.worldY+=(this.yOffset-this.yLag*f)*r*this.data.y)}if(c||l){let P=Math.atan2(h.c,h.a),A=0,R=0,B=0,O=this.cx-h.worldX,W=this.cy-h.worldY;if(O>C?O=C:O<-C&&(O=-C),W>M?W=M:W<-M&&(W=-M),b=this.remaining,c){B=(this.data.rotate+this.data.shearX)*r,f=this.rotateLag*Math.max(0,1-p/d);let V=Math.atan2(W+this.ty,O+this.tx)-P-(this.rotateOffset-f)*B;this.rotateOffset+=(V-Math.ceil(V*Re.invPI2-.5)*Re.PI2)*y,V=(this.rotateOffset-f)*B+P,A=Math.cos(V),R=Math.sin(V),l&&(V=u*h.getWorldScaleX(),V>0&&(this.scaleOffset+=(O*A+W*R)*y/V))}else{A=Math.cos(P),R=Math.sin(P);const V=u*h.getWorldScaleX()-this.scaleLag*Math.max(0,1-p/d);V>0&&(this.scaleOffset+=(O*A+W*R)*y/V)}if(b>=d){_===-1&&(_=s.damping**(60*d),E=d*s.massInverse,S=s.strength);const V=s.wind*t.windX+s.gravity*t.gravityX,Y=(s.wind*t.windY+s.gravity*t.gravityY)*jp.yDir,L=this.rotateOffset,N=this.scaleOffset,F=u/x;for(;;)if(b-=d,l&&(this.scaleVelocity+=(V*A-Y*R-this.scaleOffset*S)*E,this.scaleOffset+=this.scaleVelocity*d,this.scaleVelocity*=_),c){if(this.rotateVelocity-=((V*R+Y*A)*F+this.rotateOffset*S)*E,this.rotateOffset+=this.rotateVelocity*d,this.rotateVelocity*=_,b0){let b=0;this.data.rotate>0&&(b=m*this.data.rotate,p=Math.sin(b),g=Math.cos(b),v=h.b,h.b=g*v-p*h.d,h.d=p*v+g*h.d),b+=m*this.data.shearX,p=Math.sin(b),g=Math.cos(b),v=h.a,h.a=g*v-p*h.c,h.c=p*v+g*h.c}else m*=this.data.rotate,p=Math.sin(m),g=Math.cos(m),v=h.a,h.a=g*v-p*h.c,h.c=p*v+g*h.c,v=h.b,h.b=g*v-p*h.d,h.d=p*v+g*h.d}if(l){let m=1+(this.scaleOffset-this.scaleLag*f)*r*this.data.scaleX;switch(h.a*=m,h.c*=m,this.data.scaleYMode){case en.Uniform:h.b*=m,h.d*=m;break;case en.Volume:m=Math.abs(m),m=m>=.7?1/m:4-3.67347*m,h.b*=m,h.d*=m}}i!==To.pose&&(this.tx=u*h.a,this.ty=u*h.c)}}sort(t){const i=this.bone.bone;t.sortBone(i),t._updateCache.push(this),t.sortReset(i.children),t.constrained(i)}isSourceActive(){return this.bone.bone.active}}class Fh extends Sc{constructor(t){super(t,new Gp);T(this,"_bone",null);T(this,"x",0);T(this,"y",0);T(this,"rotate",0);T(this,"scaleX",0);T(this,"shearX",0);T(this,"limit",0);T(this,"step",0);T(this,"inertiaGlobal",!1);T(this,"strengthGlobal",!1);T(this,"dampingGlobal",!1);T(this,"massGlobal",!1);T(this,"windGlobal",!1);T(this,"gravityGlobal",!1);T(this,"mixGlobal",!1);T(this,"_scaleYMode",en.None)}set bone(t){this._bone=t}get bone(){if(this._bone)return this._bone;throw new Error("BoneData not set.")}get scaleYMode(){return this._scaleYMode}set scaleYMode(t){if(t==null)throw new Error("scaleYMode cannot be null.");this._scaleYMode=t}create(t){return new yd(this,t)}}typeof Math.fround>"u"&&(Math.fround=(n=>e=>(n[0]=e,n[0]))(new Float32Array(1)));class Wp{constructor(){T(this,"time",0);T(this,"mix",0)}set(e){this.time=e.time,this.mix=e.mix}}const Ul=class Ul extends wc{constructor(t,i){super(t,new Wp,new Wp);T(this,"bone",null);if(!i)throw new Error("skeleton cannot be null.");t.bone!=null&&(this.bone=i.bones[t.bone.index])}copy(t){var i=new Ul(this.data,t);return i.pose.set(this.pose),i}update(t,i){const s=this.appliedPose;if(s.mix===0)return;const r=this.data,o=r.animation,a=this.bone;if(a!==null){if(!a.active)return;r.local&&a.appliedPose.validateLocalTransform(t),s.time=r.offset+(r.property.value(t,a.appliedPose,r.local,Ul.offsets)-r.property.offset)*r.scale,r.loop?s.time=o.duration+s.time%o.duration:s.time=Math.max(0,s.time)}const c=t.bones,l=o.bones;for(let h=0,u=o.bones.length;h=s.length&&(s.length=e+1),s[e]||(s[e]={}),s[e][t]=i}addSkin(e){for(let i=0;i= 0.");if(!s)throw new Error("boneData cannot be null.");this.index=t,this.boneData=s}}var Iu;(function(n){n[n.Normal=0]="Normal",n[n.Additive=1]="Additive",n[n.Multiply=2]="Multiply",n[n.Screen=3]="Screen"})(Iu||(Iu={}));class Kp{constructor(){T(this,"mixRotate",0);T(this,"mixX",0);T(this,"mixY",0);T(this,"mixScaleX",0);T(this,"mixScaleY",0);T(this,"mixShearY",0)}set(e){this.mixRotate=e.mixRotate,this.mixX=e.mixX,this.mixY=e.mixY,this.mixScaleX=e.mixScaleX,this.mixScaleY=e.mixScaleY,this.mixShearY=e.mixShearY}}class a0 extends wc{constructor(t,i){super(t,new Kp,new Kp);T(this,"bones");T(this,"source");if(!i)throw new Error("skeleton cannot be null.");this.bones=[];for(const r of t.bones)this.bones.push(i.bones[r.index].constrainedPose);const s=i.bones[t.source.index];if(s==null)throw new Error("source cannot be null.");this.source=s}copy(t){var i=new a0(this.data,t);return i.pose.set(this.pose),i}update(t,i){const s=this.appliedPose;if(s.mixRotate===0&&s.mixX===0&&s.mixY===0&&s.mixScaleX===0&&s.mixScaleY===0&&s.mixShearY===0)return;const r=this.data,o=r.localSource,a=r.localTarget,c=r.additive,l=r.clamp,h=r.offsets,u=this.source.appliedPose;o&&u.validateLocalTransform(t);const d=r.properties,f=r.properties.length,m=this.bones;for(let p=0,g=this.bones.length;p0?s[At.ROTATION]:-s[At.ROTATION]);return a<0&&(a+=360),a}}class SE extends il{mix(e){return e.mixRotate}apply(e,t,i,s,r,o){if(r)i.rotation+=(o?s:s-i.rotation)*t.mixRotate;else{const a=e.scaleX,c=e.scaleY,l=1/a,h=1/c,u=i.a*l,d=i.b*l,f=i.c*h,m=i.d*h;s*=Re.degRad,o||(s-=Math.atan2(f,u)),s>Re.PI?s-=Re.PI2:s<-Re.PI&&(s+=Re.PI2),s*=t.mixRotate;const p=Math.cos(s),g=Math.sin(s);i.a=(p*u-g*f)*a,i.b=(p*d-g*m)*a,i.c=(g*u+p*f)*c,i.d=(g*d+p*m)*c}}}class Zp extends tl{value(e,t,i,s){return i?t.x+s[At.X]:(s[At.X]*t.a+s[At.Y]*t.b+t.worldX)/e.scaleX}}class _E extends il{mix(e){return e.mixX}apply(e,t,i,s,r,o){r?i.x+=(o?s:s-i.x)*t.mixX:(o||(s-=i.worldX/e.scaleX),i.worldX+=s*t.mixX*e.scaleX)}}class Qp extends tl{value(e,t,i,s){return i?t.y+s[At.Y]:(s[At.X]*t.c+s[At.Y]*t.d+t.worldY)/e.scaleY}}class TE extends il{mix(e){return e.mixY}apply(e,t,i,s,r,o){r?i.y+=(o?s:s-i.y)*t.mixY:(o||(s-=i.worldY/e.scaleY),i.worldY+=s*t.mixY*e.scaleY)}}class eg extends tl{value(e,t,i,s){if(i)return t.scaleX+s[At.SCALEX];const r=t.a/e.scaleX,o=t.c/e.scaleY;return Math.sqrt(r*r+o*o)+s[At.SCALEX]}}class EE extends il{mix(e){return e.mixScaleX}apply(e,t,i,s,r,o){if(r)o?i.scaleX*=1+(s-1)*t.mixScaleX:i.scaleX!==0&&(i.scaleX+=(s-i.scaleX)*t.mixScaleX);else if(o){const a=1+(s-1)*t.mixScaleX;i.a*=a,i.c*=a}else{let a=i.a/e.scaleX,c=i.c/e.scaleY,l=Math.sqrt(a*a+c*c);l!==0&&(l=1+(s-l)*t.mixScaleX/l,i.a*=l,i.c*=l)}}}class tg extends tl{value(e,t,i,s){if(i)return t.scaleY+s[At.SCALEY];const r=t.b/e.scaleX,o=t.d/e.scaleY;return Math.sqrt(r*r+o*o)+s[At.SCALEY]}}class CE extends il{mix(e){return e.mixScaleY}apply(e,t,i,s,r,o){if(r)o?i.scaleY*=1+(s-1)*t.mixScaleY:i.scaleY!==0&&(i.scaleY+=(s-i.scaleY)*t.mixScaleY);else if(o){const a=1+(s-1)*t.mixScaleY;i.b*=a,i.d*=a}else{let a=i.b/e.scaleX,c=i.d/e.scaleY,l=Math.sqrt(a*a+c*c);l!==0&&(l=1+(s-l)*t.mixScaleY/l,i.b*=l,i.d*=l)}}}class ig extends tl{value(e,t,i,s){if(i)return t.shearY+s[At.SHEARY];const r=1/e.scaleX,o=1/e.scaleY;return(Math.atan2(t.d*o,t.b*r)-Math.atan2(t.c*o,t.a*r))*Re.radDeg-90+s[At.SHEARY]}}class ME extends il{mix(e){return e.mixShearY}apply(e,t,i,s,r,o){if(r)o||(s-=i.shearY),i.shearY+=s*t.mixShearY;else{const a=e.scaleX,c=e.scaleY,l=i.b/a,h=i.d/c,u=Math.atan2(h,l);s=(s+90)*Re.degRad,o?s-=Re.PI/2:(s-=u-Math.atan2(i.c/c,i.a/a),s>Re.PI?s-=Re.PI2:s<-Re.PI&&(s+=Re.PI2)),s=u+s*t.mixShearY;const d=Math.sqrt(l*l+h*h);i.b=Math.cos(s)*d*a,i.d=Math.sin(s)*d*c}}}class YK{constructor(e){T(this,"scale",1);T(this,"attachmentLoader");T(this,"linkedMeshes",[]);this.attachmentLoader=e}readSkeletonData(e){const t=this.scale,i=new xE;i.name="";const s=new mU(e),r=s.readInt32(),o=s.readInt32();i.hash=o===0&&r===0?null:o.toString(16)+r.toString(16),i.version=s.readString(),i.x=s.readFloat(),i.y=s.readFloat(),i.width=s.readFloat(),i.height=s.readFloat(),i.referenceScale=s.readFloat()*t;const a=s.readBoolean();a&&(i.fps=s.readFloat(),i.imagesPath=s.readString(),i.audioPath=s.readString());let c=0;c=s.readInt(!0);for(let m=0;m>5;for(let x=0,_;x>1&1,v.spacingMode=b>>2&3,v.rotateMode=b>>4&3,(b&128)!==0&&(v.offsetRotation=s.readFloat());const y=v.setupPose;y.position=s.readFloat(),v.positionMode===Is.Fixed&&(y.position*=t),y.spacing=s.readFloat(),(v.spacingMode===Ei.Length||v.spacingMode===Ei.Fixed)&&(y.spacing*=t),y.mixRotate=s.readFloat(),y.mixX=s.readFloat(),y.mixY=s.readFloat(),h.push(v);break}case DU:{const v=new Fh(p);v.bone=l[s.readInt(!0)];let b=s.readByte();if(v.skinRequired=(b&1)!==0,(b&2)!==0&&(v.x=s.readFloat()),(b&4)!==0&&(v.y=s.readFloat()),(b&8)!==0&&(v.rotate=s.readFloat()),(b&16)!==0){let x=s.readFloat();x<-2?(v.scaleYMode=en.Volume,x=-2-x):x<0&&(v.scaleYMode=en.Uniform,x=-1-x),v.scaleX=x}(b&32)!==0&&(v.shearX=s.readFloat()),v.limit=((b&64)!==0?s.readFloat():5e3)*t,v.step=1/s.readUnsignedByte();const y=v.setupPose;y.inertia=s.readFloat(),y.strength=s.readFloat(),y.damping=s.readFloat(),y.massInverse=(b&128)!==0?s.readFloat():1,y.wind=s.readFloat(),y.gravity=s.readFloat(),b=s.readByte(),(b&1)!==0&&(v.inertiaGlobal=!0),(b&2)!==0&&(v.strengthGlobal=!0),(b&4)!==0&&(v.dampingGlobal=!0),(b&8)!==0&&(v.massGlobal=!0),(b&16)!==0&&(v.windGlobal=!0),(b&32)!==0&&(v.gravityGlobal=!0),(b&64)!==0&&(v.mixGlobal=!0),y.mix=(b&128)!==0?s.readFloat():1,h.push(v);break}case BU:{const v=new Co(p),b=s.readByte();if(v.skinRequired=(b&1)!==0,v.loop=(b&2)!==0,v.additive=(b&4)!==0,(b&8)!==0){const y=s.readFloat();a&&(b&64)!==0?v.max=y:v.setupPose.time=y}if((b&16)!==0&&(v.setupPose.mix=(b&32)!==0?s.readFloat():1),(b&64)!==0){v.local=(b&128)!==0,v.bone=l[s.readInt(!0)];const y=s.readFloat();let x=1;switch(s.readByte()){case 0:v.property=new Jp;break;case 1:{x=t,v.property=new Zp;break}case 2:{x=t,v.property=new Qp;break}case 3:v.property=new eg;break;case 4:v.property=new tg;break;case 5:v.property=new ig;break;default:continue}v.property.offset=y*x,v.offset=s.readFloat(),v.scale=s.readFloat()/x}h.push(v);break}}}const d=this.readSkin(s,i,!0,a);d&&(i.defaultSkin=d,i.skins.push(d));{let m=i.skins.length;for(Ke.setArraySize(i.skins,c=m+s.readInt(!0));m0){b=[];for(let S=0;S>4,e.readFloat())}r.push(P);break}}}}}const a=i.slots.length,c=e.readInt(!0);if(c>0){const f=new qr(c);for(let m=0;m0){const f=new cc(h);for(let m=0;m>>1^-(i&1)}readStringRef(){const 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 i=0;i>4){case 12:case 13:t+=String.fromCharCode((s&31)<<6|this.readByte()&63),i+=2;break;case 14:t+=String.fromCharCode((s&15)<<12|(this.readByte()&63)<<6|this.readByte()&63),i+=3;break;default:t+=String.fromCharCode(s),i++}}return t}readFloat(){const e=this.buffer.getFloat32(this.index);return this.index+=4,e}readBoolean(){return this.readByte()!==0}}let pU=class{constructor(e,t,i,s,r,o){T(this,"source");T(this,"skinIndex");T(this,"slotIndex");T(this,"sourceIndex");T(this,"mesh");T(this,"inheritTimelines");this.mesh=e,this.skinIndex=t,this.slotIndex=i,this.sourceIndex=s,this.source=r,this.inheritTimelines=o}};class _1{constructor(e=null,t,i=0){T(this,"bones");T(this,"vertices");T(this,"length");this.bones=e,this.vertices=t,this.length=i}}var Ys;(function(n){n[n.Region=0]="Region",n[n.BoundingBox=1]="BoundingBox",n[n.Mesh=2]="Mesh",n[n.LinkedMesh=3]="LinkedMesh",n[n.Path=4]="Path",n[n.Point=5]="Point",n[n.Clipping=6]="Clipping"})(Ys||(Ys={}));function mi(n,e,t,i){t instanceof nr?gU(n,e,t,i):vU(n,e,t,i)}function gU(n,e,t,i){let s=n.readFloat(),r=n.readFloat()*i;for(let o=0,a=0,c=t.getFrameCount()-1;t.setFrame(o,s,r),o!==c;o++){const l=n.readFloat(),h=n.readFloat()*i;switch(n.readByte()){case ms:t.setStepped(o);break;case ps:vt(n,t,a++,o,0,s,l,r,h,i)}s=l,r=h}e.push(t)}function vU(n,e,t,i){let s=n.readFloat(),r=n.readFloat()*i,o=n.readFloat()*i;for(let a=0,c=0,l=t.getFrameCount()-1;t.setFrame(a,s,r,o),a!==l;a++){const h=n.readFloat(),u=n.readFloat()*i,d=n.readFloat()*i;switch(n.readByte()){case ms:t.setStepped(a);break;case ps:vt(n,t,c++,a,0,s,h,r,u,i),vt(n,t,c++,a,1,s,h,o,d,i)}s=h,r=u,o=d}e.push(t)}function T1(n,e){const t=n.readInt(!0);if(t===0)return null;const i=new Array(e).fill(-1),s=new Array(e-t);let r=0,o=0;for(let a=0;a=0;a--)i[a]===-1&&(i[a]=s[--o]);return i}function vt(n,e,t,i,s,r,o,a,c,l){e.setBezier(t,i,s,r,a,n.readFloat(),n.readFloat()*l,n.readFloat(),n.readFloat()*l,o,c)}const yU=0,bU=1,xU=2,wU=3,SU=4,_U=5,TU=6,EU=7,CU=8,MU=9,AU=10,IU=0,PU=1,RU=2,kU=3,FU=4,LU=5,OU=0,$U=1,NU=2,DU=3,BU=4,UU=0,VU=1,XU=0,YU=1,GU=2,HU=0,jU=1,WU=2,zU=4,qU=5,KU=6,JU=7,ZU=8,QU=0,e5=1,ms=1,ps=2;class t5{constructor(e){T(this,"attachmentLoader");T(this,"scale",1);T(this,"linkedMeshes",[]);this.attachmentLoader=e}readSkeletonData(e){const t=this.scale,i=new xE,s=typeof e=="string"?JSON.parse(e):e,r=s.skeleton;if(r&&(i.hash=r.hash,i.version=r.spine,i.x=r.x,i.y=r.y,i.width=r.width,i.height=r.height,i.referenceScale=re(r,"referenceScale",100)*t,i.fps=r.fps,i.imagesPath=r.images??null,i.audioPath=r.audio??null),s.bones)for(let o=0;o0&&l.properties.push(E)}l.offsets[At.ROTATION]=re(o,"rotation",0),l.offsets[At.X]=re(o,"x",0)*t,l.offsets[At.Y]=re(o,"y",0)*t,l.offsets[At.SCALEX]=re(o,"scaleX",0),l.offsets[At.SCALEY]=re(o,"scaleY",0),l.offsets[At.SHEARY]=re(o,"shearY",0);const y=l.setupPose;d&&(y.mixRotate=re(o,"mixRotate",1)),f&&(y.mixX=re(o,"mixX",1)),m&&(y.mixY=re(o,"mixY",y.mixX)),p&&(y.mixScaleX=re(o,"mixScaleX",1)),g&&(y.mixScaleY=re(o,"mixScaleY",y.mixScaleX)),v&&(y.mixShearY=re(o,"mixShearY",1)),i.constraints.push(l);break}case"path":{const l=new kh(a);l.skinRequired=c;for(let f=0;f0){const d=i.findConstraint(l,Fh);if(!d)throw new Error(`Physics constraint not found: ${l}`);u=i.constraints.indexOf(d)}for(const d in h){const f=h[d];let m=f[0];if(!m)continue;const p=f.length;let g,v=0;if(d==="reset"){const b=new Au(p,u);for(let y=0;m!=null;m=f[y+1],y++)b.setFrame(y,re(m,"time",0));r.push(b);continue}switch(d){case"inertia":g=new lE(p,p,u);break;case"strength":g=new cE(p,p,u);break;case"damping":g=new hE(p,p,u);break;case"mass":g=new uE(p,p,u);break;case"wind":g=new dE(p,p,u);break;case"gravity":g=new fE(p,p,u);break;case"mix":{v=1,g=new mE(p,p,u);break}default:continue}gn(r,f,g,v,1)}}if(e.slider)for(const l in e.slider){const h=e.slider[l],u=i.findConstraint(l,Co);if(!u)throw new Error(`Slider not found: ${l}`);const d=i.constraints.indexOf(u);for(const f in h){const m=h[f];if(!m[0])continue;const g=m.length;switch(f){case"time":gn(r,m,new pE(g,g,d),1,1);break;case"mix":gn(r,m,new gE(g,g,d),1,1);break}}}if(e.attachments)for(const l in e.attachments){const h=e.attachments[l],u=i.findSkin(l);if(!u)throw new Error(`Skin not found: ${l}`);for(const d in h){const f=h[d],m=i.findSlot(d);if(!m)throw new Error(`Attachment slot not found: ${d}`);const p=m.index;for(const g in f){const v=f[g],b=u.getAttachment(p,g);if(!b)throw new Error(`Timeline attachment not found: ${g}`);for(const y in v){const x=v[y];let _=x[0];if(_){if(y==="deform"){const E=b.bones,S=b.vertices,C=E?S.length/3*2:S.length,M=new iE(x.length,x.length,p,b);let P=re(_,"time",0);for(let A=0,R=0;;A++){let B;const O=re(_,"vertices",null);if(!O)B=E?Ke.newFloatArray(C):S;else{B=Ke.newFloatArray(C);const L=re(_,"offset",0);if(Ke.arrayCopy(O,0,B,L,O.length),s!==1)for(let N=L,F=N+O.length;N=0;l--)r[l]===-1&&(r[l]=o[--c]);return r}function wt(n,e,t,i,s,r,o,a,c,l){if(n==="stepped")return e.setStepped(i),t;const h=s<<2,u=n[h],d=n[h+1]*l,f=n[h+2],m=n[h+3]*l;return e.setBezier(t,i,s,r,a,u,d,f,m,o,c),t+1}function re(n,e,t){return n[e]!==void 0?n[e]:t}class n5{newRegionAttachment(e,t,i,s){return new dd(t,i)}newMeshAttachment(e,t,i,s){return new bc(t,i)}newBoundingBoxAttachment(e,t){return new eT(t)}newPathAttachment(e,t){return new lc(t)}newPointAttachment(e,t){return new oT(t)}newClippingAttachment(e,t){return new $a(t)}}class s5{sequence(e){for(let t=0;t!Number.isInteger(h)||h<0||h>=o))throw new Error(Ye("errors.trailIndexOutOfRange",{name:e}));const a=Number(n.hull)||0;if(!Number.isInteger(a)||a<0||a>o)throw new Error(Ye("errors.invalidTrailHull",{name:e}));if(Array.isArray(n.edges)&&n.edges.some(h=>!Number.isInteger(h)||h<0||h>=o*2||h%2))throw new Error(Ye("errors.trailHullIndexOutOfRange",{name:e}));if(s.length===i.length)return;let c=0,l=0;for(;c=t)throw new Error(Ye("errors.missingBoneReference",{name:e}));if(![m,p,g].every(Number.isFinite)||g<0)throw new Error(Ye("errors.invalidWeight",{name:e}));u+=g}if(Math.abs(u-1)>.001)throw new Error(Ye("errors.weightSum",{name:e}));l++}if(c!==s.length||l!==o)throw new Error(Ye("errors.vertexCountMismatch",{name:e}))}function a5(n,e){var r,o,a,c;const t=Array.isArray(n.bones)?n.bones:[],i=new Map(t.map(l=>[String(l.name||""),l])),s=new Set;for(const l of t){if(l.inherit!=null&&!r5.has(l.inherit))throw new Error(Ye("errors.invalidInherit",{name:l.name||"",inherit:l.inherit,version:e}));if(/_trail_\d+_\d+$/.test(String(l.name||""))){const h=i.get(String(l.parent||""));if(!h||/_trail_\d+_\d+$/.test(String(h.name||"")))throw new Error(Ye("errors.trailBoneParent",{name:l.name||""}))}}for(const l of Array.isArray(n.skins)?n.skins:[]){const h=(l==null?void 0:l.attachments)||{};for(const u of Object.keys(h))for(const d of Object.keys(h[u]||{})){const f=h[u][d];(f==null?void 0:f.type)==="mesh"&&(o5(f,d,t.length),((r=f.vertices)==null?void 0:r.length)!==((o=f.uvs)==null?void 0:o.length)&&s.add(u))}}for(const l of Object.values(n.animations||{}))for(const h of s){const u=(c=(a=l==null?void 0:l.slots)==null?void 0:a[h])==null?void 0:c.attachment;if(Array.isArray(u)&&u.some(d=>!(d!=null&&d.name)))throw new Error(Ye("errors.trailSlotEmpty",{name:h}))}}function l5(n){var e;if(String(((e=n==null?void 0:n.skeleton)==null?void 0:e.spine)||"")!=="3.8")throw new Error(Ye("errors.spine38Version"));for(const t of n.bones||[])if(t.inherit!=null)throw new Error(Ye("errors.spine38Inherit",{name:t.name||""}));for(const t of Object.values(n.animations||{})){for(const s of Object.values(t.slots||{})){if(s.rgba||s.rgba2)throw new Error(Ye("errors.spine38SlotColor"));for(const r of s.attachment||[])if(!Object.prototype.hasOwnProperty.call(r,"name"))throw new Error(Ye("errors.spine38AttachmentName"))}for(const s of Object.values(t.bones||{}))for(const r of s.rotate||[])if(r.value!=null||r.angle==null)throw new Error(Ye("errors.spine38RotationAngle"));const i=[t];for(;i.length;){const s=i.pop();if(!(!s||typeof s!="object")){if(!Array.isArray(s)&&Array.isArray(s.curve))throw new Error(Ye("errors.spine38Curve"));i.push(...Object.values(s))}}}}function C1(n,e){var o;const t=JSON.parse(n),i=lu((o=t==null?void 0:t.skeleton)==null?void 0:o.spine);if(!i)throw new Error(Ye("errors.unsupportedExportVersion",{versions:bp()}));if(e&&i!==e)throw new Error(Ye("errors.exportVersionMismatch",{expected:e,actual:i}));a5(t,i),i==="3.8"&&l5(t);const s=i==="3.8"?bT(JSON.parse(JSON.stringify(t))):t,r=i==="4.3"?new t5(new s5).readSkeletonData(s):new yu(new n5).readSkeletonData(s);if(!r.bones.length)throw new Error(Ye("errors.exportMissingBones"));return{version:i,bones:r.bones.length,slots:r.slots.length,animations:r.animations.length}}const AE="http://127.0.0.1:27843";class Pu extends Error{constructor(t,i="CONNECTOR_ERROR",s){super(t);T(this,"code");T(this,"pairUrl");this.name="SpineConnectorError",this.code=i,this.pairUrl=s}}function ng(n,e){return String(n||"").trim().replace(/[\\/:*?"<>|]+/g,"_").replace(/^\.+/,"")||e}function c5(n,e){const t=/\.([a-z0-9]{2,5})$/i.exec(n);return t?`.${t[1].toLowerCase()}`:e.includes("jpeg")?".jpg":e.includes("webp")?".webp":e.includes("gif")?".gif":".png"}function h5(n,e,t){const i=String(n||"").replace(/\\/g,"/").split("/").filter(Boolean).map(r=>ng(r,"images")),s=ng(e.replace(/\.[^./\\]+$/,""),"image");return[...i,`${s}${c5(e,t)}`].join("/")}async function bm(n,e,t){if(!n)return null;const i=await fetch(n);if(!i.ok)throw new Error(Ye("errors.readExportImageFailed",{name:t}));const s=await i.blob(),r=new Uint8Array(await s.arrayBuffer());let o="";const a=32768;for(let c=0;co.finally(()=>{i++,e==null||e(i,t.length)});for(const o of n.filter(a=>a.visible!==!1)){for(const a of o.config.imageResources)if(a.imageMode==="sequence"&&a.sequenceFrames.length)for(const c of a.sequenceFrames)t.push(s(bm(c.previewUrl,a.textureFolder,c.name||a.textureName)));else t.push(s(bm(a.previewUrl,a.textureFolder,a.textureName)));if(o.config.trail)for(const a of o.config.trailResources)t.push(s(bm(a.previewUrl,"",a.textureName)))}const r=new Map;for(const o of await Promise.all(t))o&&!r.has(o.path)&&r.set(o.path,o);return[...r.values()]}async function u5(){try{const n=await fetch(`${AE}/v1/health`,{cache:"no-store"});if(!n.ok)throw new Error(`HTTP ${n.status}`);return{available:!0,...await n.json()}}catch(n){return{available:!1,authorized:!1,error:n instanceof Error?n.message:String(n)}}}async function d5(n,e){const t=await IE(n.systems,(s,r)=>{e==null||e({phase:"images",progress:r?s/r:1})}),i=JSON.stringify({schemaVersion:1,projectName:n.projectName,spineVersion:n.spineVersion,skeletonJson:n.skeletonJson,images:t});return new Promise((s,r)=>{const o=new XMLHttpRequest;o.open("POST",`${AE}/v1/convert`),o.responseType="blob",o.setRequestHeader("Content-Type","application/json"),o.upload.onprogress=a=>{e==null||e({phase:"upload",progress:a.lengthComputable&&a.total>0?a.loaded/a.total:null})},o.upload.onloadend=()=>e==null?void 0:e({phase:"processing",progress:null}),o.onprogress=a=>{e==null||e({phase:"download",progress:a.lengthComputable&&a.total>0?a.loaded/a.total:null})},o.onerror=()=>r(new Pu(Ye("errors.connectorOffline"),"CONNECTOR_OFFLINE")),o.onload=async()=>{const a=o.response;if(o.status<200||o.status>=300){let h={};try{h=JSON.parse(await a.text())}catch{}r(new Pu(Ye("errors.connectorHttpError",{status:o.status}),h.code,h.pairUrl));return}const c=o.getResponseHeader("X-Spine-File-Name");let l=`${ng(n.projectName,"SpineParticle")}.zip`;if(c)try{l=decodeURIComponent(c)}catch{}s({blob:a,fileName:l,spineEditorVersion:o.getResponseHeader("X-Spine-Editor-Version")||n.spineVersion,imageCount:t.length})},o.send(i)})}function f5(n,e){const t=URL.createObjectURL(n),i=document.createElement("a");i.href=t,i.download=/\.zip$/i.test(e)?e:`${e}.zip`,i.style.display="none",document.body.appendChild(i),i.click(),i.remove(),setTimeout(()=>URL.revokeObjectURL(t),1e3)}const m5=Array.from({length:256},(n,e)=>{let t=e;for(let i=0;i<8;i++)t=t&1?3988292384^t>>>1:t>>>1;return t>>>0});function p5(n){let e=4294967295;for(const t of n)e=m5[(e^t)&255]^e>>>8;return(e^4294967295)>>>0}function g5(n){const e=String(n||"").replace(/\\/g,"/").split("/").filter(t=>t&&t!==".");if(!e.length||e.some(t=>t===".."))throw new Error(Ye("errors.invalidZipPath"));return e.join("/")}function v5(n=new Date){const e=Math.max(1980,n.getFullYear());return{time:n.getHours()<<11|n.getMinutes()<<5|Math.floor(n.getSeconds()/2),date:e-1980<<9|n.getMonth()+1<<5|n.getDate()}}function xm(n){const e=new Uint8Array(n);return{bytes:e,view:new DataView(e.buffer)}}function M1(n){const e=new Uint8Array(n.reduce((i,s)=>i+s.length,0));let t=0;for(const i of n)e.set(i,t),t+=i.length;return e}function y5(n){const e=new TextEncoder,t=[],i=[],s=v5();let r=0;for(const c of n){const l=e.encode(g5(c.name)),h=p5(c.data),u=xm(30);u.view.setUint32(0,67324752,!0),u.view.setUint16(4,20,!0),u.view.setUint16(6,2048,!0),u.view.setUint16(10,s.time,!0),u.view.setUint16(12,s.date,!0),u.view.setUint32(14,h,!0),u.view.setUint32(18,c.data.length,!0),u.view.setUint32(22,c.data.length,!0),u.view.setUint16(26,l.length,!0),t.push(u.bytes,l,c.data);const d=xm(46);d.view.setUint32(0,33639248,!0),d.view.setUint16(4,20,!0),d.view.setUint16(6,20,!0),d.view.setUint16(8,2048,!0),d.view.setUint16(12,s.time,!0),d.view.setUint16(14,s.date,!0),d.view.setUint32(16,h,!0),d.view.setUint32(20,c.data.length,!0),d.view.setUint32(24,c.data.length,!0),d.view.setUint16(28,l.length,!0),d.view.setUint32(42,r,!0),i.push(d.bytes,l),r+=u.bytes.length+l.length+c.data.length}const o=M1(i),a=xm(22);return a.view.setUint32(0,101010256,!0),a.view.setUint16(8,n.length,!0),a.view.setUint16(10,n.length,!0),a.view.setUint32(12,o.length,!0),a.view.setUint32(16,r,!0),new Blob([M1([...t,o,a.bytes])],{type:"application/zip"})}function b5(n){const e=atob(n),t=new Uint8Array(e.length);for(let i=0;ii===".."||/^[a-z]+:/i.test(i))?"images":t.join("/")}function w5(n){return String(n||"SpineParticle").replace(/\.json$/i,"").replace(/[\\/:*?"<>|]+/g,"_").replace(/^\.+/,"")||"SpineParticle"}async function S5(n){const e=await IE(n.systems);if(!e.length)throw new Error(Ye("errors.noExportableImages"));const t=x5(n.imagesPath);return{blob:y5(e.map(s=>({name:`${t}/${s.path}`,data:b5(s.dataBase64)}))),imageCount:e.length,folder:t}}function _5(n,e){const t=`${w5(e)}-images.zip`,i=URL.createObjectURL(n),s=document.createElement("a");return s.href=i,s.download=t,s.style.display="none",document.body.appendChild(s),s.click(),s.remove(),setTimeout(()=>URL.revokeObjectURL(i),1e3),t}function T5(n){const{t:e}=fn();n.settings.exportSettings=AS(n.settings.exportSettings);const t=Fe(()=>n.settings.exportSettings),i=De(!1),s=De(null),r=De(""),o=De(!1),a=De(null),c=De(""),l=De(""),h=Fe(()=>{const C=a.value;return C?C.available?C.spineFound?C.authorized?e("export.connectorReady"):e("export.notAuthorized"):e("export.spineNotFound"):e("export.connectorOffline"):e("export.connectorChecking")}),u=Fe(()=>{var C,M,P,A,R,B;return{ready:!!((C=a.value)!=null&&C.available)&&!!((M=a.value)!=null&&M.spineFound)&&!!((P=a.value)!=null&&P.authorized),warning:!!((A=a.value)!=null&&A.available)&&(!((R=a.value)!=null&&R.spineFound)||!((B=a.value)!=null&&B.authorized))}}),d=Fe(()=>{var C,M,P;return!!((C=a.value)!=null&&C.available)&&!!((M=a.value)!=null&&M.spineFound)&&!!((P=a.value)!=null&&P.authorized)}),f=Fe(()=>{const C=a.value;return!(C!=null&&C.available)||!C.spineFound||C.authorized||typeof window>"u"?"":`http://127.0.0.1:27843/pair?origin=${encodeURIComponent(window.location.origin)}`}),m=Fe(()=>{const C=a.value;return C?C.available?C.spineFound?C.authorized?"":e("export.unauthorized"):e("export.notFound"):e("export.offline"):e("export.checking")}),p=Fe(()=>i.value?e("export.connectorBusy"):m.value?`${e("common.disabled")}: ${m.value}`:e("export.connectorGenerate",{version:t.value.spineVersion}));Sn(()=>{b(),g=window.setInterval(b,3e3)});let g,v=0;eo(()=>{g!==void 0&&window.clearInterval(g)});async function b(){const C=++v,M=await u5();if(C!==v)return;a.value=M;const P=l.value;(P==="CONNECTOR_OFFLINE"?M.available:P==="SPINE_NOT_FOUND"?M.available&&M.spineFound:P==="ORIGIN_NOT_ALLOWED"?M.available&&M.spineFound&&M.authorized:!!P&&M.available&&M.spineFound&&M.authorized)&&(l.value="",c.value="",o.value&&(o.value=!1,r.value=""))}function y(){return new Promise(C=>requestAnimationFrame(()=>C()))}async function x(C){n.timeline.playing=!1,n.timeline.frame=0,n.timeline.recorded=!1;for(const A of n.systems)A.frames=void 0;n.recalcTotalFrames(),await y(),n.timeline.playing=!0;const M=n.timeline.totalFrames/Math.max(1,n.timeline.fps)*1e3,P=performance.now()+Math.max(8e3,M*2.5+3e3);for(;!n.timeline.recorded;){if(performance.now()>P)throw new Error(e("export.timeout"));C==null||C(Math.min(.98,n.timeline.frame/Math.max(1,n.timeline.totalFrames-1))),await new Promise(A=>setTimeout(A,50))}C==null||C(1)}async function _(){if(!i.value){i.value=!0,s.value="json",o.value=!1,l.value="",c.value="",r.value=e("export.recalculating");try{await x();const C=m1({systems:n.systems,timeline:n.timeline,settings:t.value});C1(C.text,t.value.spineVersion),eU(C,t.value.fileName);const M=C.warnings.length?e("export.resourceWarning",{count:C.warnings.length}):"";r.value=e("export.exported",{version:t.value.spineVersion,systems:C.particleSystemCount,animations:C.animationCount,bones:C.boneCount,warning:M})}catch(C){o.value=!0,r.value=C instanceof Error?C.message:String(C)}finally{i.value=!1,s.value=null}}}async function E(){if(i.value)return;i.value=!0,s.value="spine",o.value=!1,l.value="",c.value="",r.value=e("export.recalculating");const C=FT(e("export.projectTransferTitle"),e("export.projectTransferDetail"));try{await C.paint(),await x(R=>C.update(R*18,e("export.recalculating"))),C.update(20,e("export.generatingJson"));const M=m1({systems:n.systems,timeline:n.timeline,settings:t.value});C1(M.text,t.value.spineVersion),r.value=e("export.preparingProject");const P=t.value.fileName.replace(/\.json$/i,"")||"SpineParticle",A=await d5({projectName:P,spineVersion:t.value.spineVersion,skeletonJson:M.text,systems:n.systems},({phase:R,progress:B})=>{R==="images"?C.update(B==null?null:22+B*18,e("export.preparingProjectFiles")):R==="upload"?C.update(B==null?null:40+B*30,e("export.uploading")):R==="processing"?C.update(null,e("export.spineProcessing")):C.update(B==null?null:82+B*16,e("export.downloadingProject"))});C.update(99,e("export.handingToBrowser")),f5(A.blob,A.fileName),r.value=e("export.projectExported",{fileName:A.fileName,images:A.imageCount,version:A.spineEditorVersion}),await b(),await C.finish(e("export.projectTransferDownload"))}catch(M){const P=M instanceof Error?M.message:String(M);o.value=!0,l.value=M instanceof Pu?M.code:"",M instanceof Pu&&M.pairUrl&&(c.value=M.pairUrl),r.value=P,await b(),await C.fail(P)}finally{i.value=!1,s.value=null}}async function S(){if(!i.value){i.value=!0,s.value="images",o.value=!1,l.value="",c.value="",r.value=e("export.collectingImages");try{const C=await S5({systems:n.systems,imagesPath:t.value.imagesPath}),M=_5(C.blob,t.value.fileName);r.value=e("export.imagesExported",{fileName:M,folder:C.folder,images:C.imageCount})}catch(C){o.value=!0,r.value=C instanceof Error?C.message:String(C)}finally{i.value=!1,s.value=null}}}return{exportSettings:t,exportBusy:i,exportTarget:s,exportMessage:r,exportError:o,connectorHealth:a,connectorPairUrl:c,connectorExportErrorCode:l,connectorStatusText:h,connectorStatusClass:u,connectorReady:d,connectorAuthorizationUrl:f,connectorDisabledReason:m,connectorButtonTitle:p,connectorHealthTimer:g,connectorHealthRequestId:v,refreshConnectorHealth:b,nextPaint:y,prepareExportFrames:x,exportSpineJson:_,exportSpineProject:E,exportSpineImages:S}}function E5(n){const e=De(null),t=De(""),i=De([]),s=De(!1),r=De(""),o=De(!1);function a(){ET(n),o.value=!1,r.value=Ye("config.saved")}async function c(u){var m;const d=u.target,f=(m=d.files)==null?void 0:m[0];if(f){r.value=Ye("config.loading"),o.value=!1;try{await LD(n,f),r.value=Ye("config.loaded",{name:f.name})}catch(p){o.value=!0,r.value=p instanceof Error?p.message:String(p)}finally{d.value=""}}}async function l(){try{const u=await fetch(`/Preset/index.json?t=${Date.now()}`,{cache:"no-store"});if(!u.ok)throw new Error(Ye("config.presetListError"));const d=await u.json();i.value=Array.isArray(d)?d.filter(f=>!!f&&typeof f.name=="string"&&typeof f.file=="string"):[]}catch{i.value=[]}}async function h(){const u=t.value;if(!u)return;s.value=!0,o.value=!1,r.value=Ye("config.presetLoading");const d=FT(Ye("config.presetTransferTitle"),Ye("config.presetDownloading",{file:u}));try{await d.paint();const f=await fetch(`/Preset/${encodeURIComponent(u)}`,{cache:"no-store"});if(!f.ok)throw new Error(Ye("config.presetReadError",{file:u}));const m=await E4(f,p=>{d.update(p==null?null:p*55,Ye("config.presetDownloading",{file:u}))});d.update(58,Ye("config.presetParsing")),d.update(70,Ye("config.presetRestoring")),await MT(n,m),r.value=Ye("config.presetLoaded",{name:u.replace(/\.json$/i,"")}),await d.finish(Ye("config.presetComplete"))}catch(f){o.value=!0;const m=f instanceof Error?f.message:String(f);r.value=Ye("config.presetNamingError",{message:m}),await d.fail(m)}finally{s.value=!1,t.value=""}}return Sn(l),{configFileInput:e,selectedPreset:t,presetOptions:i,presetLoading:s,configMessage:r,configError:o,saveConfig:a,onConfigFileChange:c,refreshPresets:l,loadSelectedPreset:h}}function C5(n){const e=De(null),t=De(null),i=De(null),s=De(null),r=De(null);function o(){var D;const N=(D=n.value)==null?void 0:D.config;if(!N)return;const F=Math.max(0,...N.trailResources.map(X=>X.id))+1;N.trailResources.push({id:F,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:Np.map(X=>({...X})),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:Op.map(X=>({...X})),shapeEnabled:!1,shapeCurve:Dp.map(X=>({...X}))}),m()}function a(N){var F;r.value=N,(F=s.value)==null||F.click()}function c(N,F){var G;const D=(G=n.value)==null?void 0:G.config;if(!D)return;const X=N==="trailGridCols"?32:16;D[N]=Math.min(X,Math.max(2,Math.round(Number(F)||2)))}function l(N,F){var X;const D=(X=n.value)==null?void 0:X.config.trailResources.find(G=>G.id===N);D&&(D.boneCount=Math.min(16,Math.max(2,Math.round(Number(F)||2))))}function h(N,F){var X;const D=(X=n.value)==null?void 0:X.config.trailResources.find(G=>G.id===N);D&&(D.rotation=Math.max(-360,Math.min(360,Number(F)||0)))}async function u(N){var J,oe;const F=N.target,D=(J=F.files)==null?void 0:J[0],X=(oe=n.value)==null?void 0:oe.config,G=X==null?void 0:X.trailResources.find(le=>le.id===r.value);if(!D||!G){F.value="";return}const K=await C(D);G.texture=Ur(await it.fromURL(K)),G.previewUrl=K,G.textureName=D.name.replace(/\.[^.]+$/,"")||"trail",F.value="",r.value=null}async function d(N){var X;const F=(X=n.value)==null?void 0:X.config,D=F==null?void 0:F.trailResources.find(G=>G.id===N);D&&(D.texture=Ur(await it.fromURL("/images/trail.png")),D.previewUrl="/images/trail.png",D.textureName="trail",D.weight=100,D.locked=!1,D.rotation=0,D.boneCount=3,D.trailRatio=100,D.lengthMode="fixed",D.length=100,D.lengthMin=100,D.lengthMax=100,D.widthSizeMode="fixed",D.width=100,D.widthMin=100,D.widthMax=100,D.widthMode="particle",D.lifeLengthEnabled=!1,D.lifeLengthCurve=Op.map(G=>({...G})),D.shapeEnabled=!1,D.shapeCurve=Dp.map(G=>({...G})),D.colorMode="particle",D.color="#ffffff",D.colorGradient=[{position:0,color:"#ffffff"},{position:1,color:"#ffffff"}],D.blend="normal",D.alphaMode="particle",D.alpha=1,D.alphaCurve=Np.map(G=>({...G})),m())}function f(N){var X;const F=(X=n.value)==null?void 0:X.config.trailResources;if(!F||F.length<=1)return;const D=F.findIndex(G=>G.id===N);D>=0&&F.splice(D,1),m()}function m(){var G;const N=(G=n.value)==null?void 0:G.config.trailResources;if(!(N!=null&&N.length))return;if(N.length===1){N[0].weight=100,N[0].locked=!1;return}const F=N.filter(K=>K.locked),D=N.filter(K=>!K.locked);let X=F.reduce((K,J)=>K+Math.max(0,Number(J.weight)||0),0);X>100&&(W(F,100,!0),X=100),W(D,100-X)}function p(N,F){var oe;const D=(oe=n.value)==null?void 0:oe.config.trailResources;if(!(D!=null&&D.length))return;if(D.length===1){D[0].weight=100,D[0].locked=!1;return}const X=D.find(le=>le.id===N);if(!X||X.locked)return;const G=D.filter(le=>le.id!==N&&le.locked).reduce((le,ve)=>le+Math.max(0,Number(ve.weight)||0),0),K=Math.max(0,100-G),J=D.filter(le=>le.id!==N&&!le.locked);X.weight=O(Math.min(K,Math.max(0,Number(F)||0))),J.length?W(J,K-X.weight,!0):X.weight=O(K)}function g(N){var X;const F=(X=n.value)==null?void 0:X.config.trailResources;if(!F||F.length===1)return;const D=F.find(G=>G.id===N);D&&(D.locked=!D.locked)}function v(N,F){const D=F.target;N.color=P(D.value,N.color),D.value=N.color}function b(N,F){v(N,F),F.target.blur()}function y(){var D;const N=(D=n.value)==null?void 0:D.config;if(!N)return;const F=Math.max(0,...N.imageResources.map(X=>X.id))+1;N.imageResources.push({id:F,texture:N.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:$p.map(X=>({...X}))}),V()}function x(N){var F;i.value=N,(F=e.value)==null||F.click()}function _(N){var F;i.value=N,(F=t.value)==null||F.click()}async function E(N){var oe,le;const F=N.target,D=(oe=F.files)==null?void 0:oe[0],X=(le=n.value)==null?void 0:le.config,G=X==null?void 0:X.imageResources.find(ve=>ve.id===i.value);if(!D||!G){F.value="";return}const K=await C(D),J=Ur(await it.fromURL(K));G.texture=J,G.previewUrl=K,G.textureFolder="",G.textureName=D.name.replace(/\.[^.]+$/,"")||"particle",F.value="",i.value=null}async function S(N){var K;const F=N.target,D=Array.from(F.files||[]).sort((J,oe)=>J.name.localeCompare(oe.name,void 0,{numeric:!0,sensitivity:"base"})),X=(K=n.value)==null?void 0:K.config,G=X==null?void 0:X.imageResources.find(J=>J.id===i.value);if(!D.length||!G){F.value="";return}G.sequenceFrames=await Promise.all(D.map(async J=>{const oe=await C(J);return{name:J.name,previewUrl:oe,texture:Ur(await it.fromURL(oe))}})),G.imageMode="sequence",F.value="",i.value=null}function C(N){return new Promise((F,D)=>{const X=new FileReader;X.onload=()=>F(String(X.result||"")),X.onerror=()=>D(X.error),X.readAsDataURL(N)})}function M(N){var X;const F=(X=n.value)==null?void 0:X.config,D=F==null?void 0:F.imageResources.find(G=>G.id===N);!F||!D||(D.texture=F.texture,D.textureName="star",D.textureFolder="",D.previewUrl="/images/star.png",D.imageMode="fixed",D.sequencePlayback="loop-forward",D.sequenceFps=30,D.sequenceFrames=[],D.scale=1,D.anchorX=.5,D.anchorY=.5,D.colorMode="fixed",D.colorStart="#ffffff",D.colorEnd="#ff4d4d",D.colorGradient=[{position:0,color:"#ffffff"},{position:1,color:"#ff4d4d"}],D.blend="normal",D.independentAlpha="off",D.alpha=1,D.alphaCurveMode="跟随导出",D.alphaCurve=$p.map(G=>({...G})),D.locked=!1,V())}function P(N,F){let D=N.trim().replace(/^#/,"");return/^[0-9a-f]{3}$/i.test(D)&&(D=D.split("").map(X=>X+X).join("")),/^[0-9a-f]{6}$/i.test(D)?`#${D.toLowerCase()}`:F}function A(N,F){const D=F.target;N.colorStart=P(D.value,N.colorStart),D.value=N.colorStart}function R(N,F){A(N,F),F.target.blur()}function B(N){var X;const F=(X=n.value)==null?void 0:X.config.imageResources;if(!F||F.length<=1)return;const D=F.findIndex(G=>G.id===N);D>=0&&F.splice(D,1),V()}function O(N){return Math.round(N)}function W(N,F,D=!1){if(!N.length)return;const X=Math.max(0,O(F)),G=D?N.reduce((J,oe)=>J+Math.max(0,Number(oe.weight)||0),0):0;let K=0;N.forEach((J,oe)=>{const le=oe===N.length-1,ve=O(le?X-K:G>0?X*Math.max(0,Number(J.weight)||0)/G:X/N.length);J.weight=ve,K+=ve})}function V(){var G;const N=(G=n.value)==null?void 0:G.config.imageResources;if(!(N!=null&&N.length))return;if(N.length===1){N[0].weight=100,N[0].locked=!1;return}const F=N.filter(K=>K.locked),D=N.filter(K=>!K.locked);let X=F.reduce((K,J)=>K+Math.max(0,Number(J.weight)||0),0);X>100&&(W(F,100,!0),X=100),W(D,100-X)}function Y(N,F){var oe;const D=(oe=n.value)==null?void 0:oe.config.imageResources;if(!(D!=null&&D.length))return;if(D.length===1){D[0].weight=100,D[0].locked=!1;return}const X=D.find(le=>le.id===N);if(!X||X.locked)return;const G=D.filter(le=>le.id!==N&&le.locked).reduce((le,ve)=>le+Math.max(0,Number(ve.weight)||0),0),K=Math.max(0,100-G),J=D.filter(le=>le.id!==N&&!le.locked);if(X.weight=O(Math.min(K,Math.max(0,Number(F)||0))),!J.length){X.weight=O(K);return}W(J,K-X.weight,!0)}function L(N){var X;const F=(X=n.value)==null?void 0:X.config.imageResources;if(!F||F.length===1)return;const D=F.find(G=>G.id===N);D&&(D.locked=!D.locked)}return{textureFileInput:e,sequenceFileInput:t,pendingResourceId:i,trailTextureFileInput:s,pendingTrailResourceId:r,addTrailResource:o,openTrailTexturePicker:a,onTrailRigChange:c,onTrailResourceBoneCountChange:l,onTrailResourceRotationChange:h,onTrailTextureFile:u,resetTrailTexture:d,removeTrailResource:f,rebalanceTrailWeights:m,setTrailResourceWeight:p,toggleTrailResourceLock:g,setTrailColor:v,commitTrailColor:b,addImageResource:y,openTexturePicker:x,openSequencePicker:_,onTextureFile:E,onSequenceFiles:S,readFileAsDataUrl:C,resetTexture:M,normalizeHex:P,setResourceFixedColor:A,commitResourceFixedColor:R,removeImageResource:B,roundWeight:O,distributeImageWeights:W,rebalanceImageWeights:V,setResourceWeight:Y,toggleResourceLock:L}}function M5(){const n=Wo(),{t:e}=fn(),{exportSettings:t,exportBusy:i,exportTarget:s,exportMessage:r,exportError:o,connectorPairUrl:a,connectorStatusText:c,connectorStatusClass:l,connectorReady:h,connectorAuthorizationUrl:u,connectorDisabledReason:d,connectorButtonTitle:f,refreshConnectorHealth:m,exportSpineJson:p,exportSpineProject:g,exportSpineImages:v}=T5(n),{configFileInput:b,selectedPreset:y,presetOptions:x,presetLoading:_,configMessage:E,configError:S,saveConfig:C,onConfigFileChange:M,refreshPresets:P,loadSelectedPreset:A}=E5(n);function R(ie){return ie==="跟随导出"?t.value.keyframeCurve==="bezier"?"bezier":"linear":ie==="贝塞尔"?"bezier":"linear"}n.systems.length||n.addSystem();const B=Fe(()=>{const ie=n.systems.findIndex(me=>me.id===n.activeId);return ie>=0?ie:0}),O=Fe(()=>n.systems[B.value]||null),{textureFileInput:W,sequenceFileInput:V,trailTextureFileInput:Y,addTrailResource:L,openTrailTexturePicker:N,onTrailRigChange:F,onTrailResourceBoneCountChange:D,onTrailResourceRotationChange:X,onTrailTextureFile:G,resetTrailTexture:K,removeTrailResource:J,setTrailResourceWeight:oe,toggleTrailResourceLock:le,setTrailColor:ve,commitTrailColor:Se,addImageResource:fe,openTexturePicker:ye,openSequencePicker:q,onTextureFile:Z,onSequenceFiles:se,resetTexture:H,setResourceFixedColor:j,commitResourceFixedColor:$,removeImageResource:U,setResourceWeight:z,toggleResourceLock:ee}=C5(O),ne=Fe(()=>O.value?IS(O.value.config,n.timeline.fps):30),ue=Fe(()=>{var me;const ie=(me=O.value)==null?void 0:me.config;return ie?Math.max(1,Math.ceil(Number(ie.loopDurationFrames)||1)):1}),xe=Fe(()=>n.activeObjectType),be=Fe(()=>n.activeObjectType==="collision"&&n.colliders.find(ie=>ie.id===n.activeObjectId)||null),Ne=Fe(()=>n.activeObjectType==="path"&&n.paths.find(ie=>ie.id===n.activeObjectId)||null),Be=Fe(()=>n.activeObjectType==="spine"&&n.spines.find(ie=>ie.id===n.activeObjectId)||null),he=Fe(()=>n.activeObjectType==="particle"?n.systems.some(ie=>ie.id===n.activeObjectId):n.activeObjectType==="collision"?n.colliders.some(ie=>ie.id===n.activeObjectId):n.activeObjectType==="path"?n.paths.some(ie=>ie.id===n.activeObjectId):n.spines.some(ie=>ie.id===n.activeObjectId)),ge=Fe(()=>{const ie=n.spines.find(me=>me.selectedBone&&me.bones.some(Ae=>Ae.name===me.selectedBone));return ie?{spine:ie,boneName:ie.selectedBone}:null}),We=Fe(()=>{var Ae;const ie=(Ae=O.value)==null?void 0:Ae.config;if(!ie||ie.emitterFollowMode!=="bone")return null;const me=n.spines.find(st=>st.id===ie.emitterFollowSpineId);return!me||!me.bones.some(st=>st.name===ie.emitterFollowBoneName)?null:{spine:me,boneName:ie.emitterFollowBoneName}}),Le=De(!1),Ce=De(""),Ze=Fe(()=>n.spines.filter(ie=>ie.enabled&&ie.visible!==!1&&ie.status==="ready")),Ee=Fe(()=>n.spines.find(ie=>{var me;return ie.id===((me=O.value)==null?void 0:me.config.renderLayerSpineId)})||null),vi=Fe(()=>{const ie=Ee.value;return!!ie&&ie.enabled&&ie.visible!==!1&&ie.status==="ready"}),lt=Fe(()=>{var ie;return[...((ie=Ee.value)==null?void 0:ie.slots)||[]].sort((me,Ae)=>me.order-Ae.order)}),ce=Fe(()=>{const ie=Ce.value.trim().toLocaleLowerCase();return ie?lt.value.filter(me=>me.name.toLocaleLowerCase().includes(ie)||me.attachment.toLocaleLowerCase().includes(ie)):lt.value}),de=Fe(()=>lt.value.find(ie=>{var me;return ie.name===((me=O.value)==null?void 0:me.config.renderLayerSlotName)})||null),nt=Fe(()=>{const ie=de.value;return ie&<.value.filter(me=>me.orderAe.order-me.order)[0]||null}),Ft=Fe(()=>{var st;const ie=(st=O.value)==null?void 0:st.config,me=Ee.value,Ae=de.value;return!ie||!me||!Ae?"":e(ie.renderLayerSlotPosition==="below"?"renderLayer.slotLabelBelow":"renderLayer.slotLabelAbove",{spine:me.name,slot:Ae.name})}),Nt=Fe(()=>{var Ae;const ie=(Ae=O.value)==null?void 0:Ae.config,me=de.value;return!ie||!me?"":ie.renderLayerSlotPosition==="above"?e("renderLayer.resolvedAbove",{slot:me.name}):nt.value?e("renderLayer.resolvedBetween",{previous:nt.value.name,slot:me.name}):""}),ct=Fe(()=>{var Ae;const ie=(Ae=O.value)==null?void 0:Ae.config;if(!ie||ie.renderLayerMode!=="slot")return"";if(!Ze.value.length)return e("renderLayer.warningNoSpine");if(!ie.renderLayerSpineId)return e("renderLayer.warningNoSelection");const me=Ee.value;return me?!me.enabled||me.status!=="ready"?e("renderLayer.warningNotReady"):ie.renderLayerSlotName?de.value?ie.renderLayerSlotPosition==="below"&&!nt.value?e("renderLayer.warningFirstSlot"):"":e("renderLayer.warningMissingSlot"):"":e("renderLayer.warningMissingSpine")});function rn(){var me;const ie=(me=O.value)==null?void 0:me.config;ie&&(ie.renderLayerMode="slot",!ie.renderLayerSpineId&&Ze.value.length&&(ie.renderLayerSpineId=Ze.value[0].id),Le.value=!ie.renderLayerSlotName)}function Nn(ie){var Ae;const me=(Ae=O.value)==null?void 0:Ae.config;me&&(me.renderLayerSpineId=Math.max(0,Math.round(Number(ie.target.value)||0)),me.renderLayerSlotName="",Le.value=!0)}function Ht(ie){var Ae;const me=(Ae=O.value)==null?void 0:Ae.config;me&&(me.renderLayerSlotName=ie.name,Le.value=!1,Ce.value="")}function Di(){var me;const ie=(me=O.value)==null?void 0:me.config;ie&&(ie.renderLayerSlotName="",ie.renderLayerSlotPosition="above")}const Ut=De(!1),on=Fe(()=>{var me;const ie=new Set(((me=O.value)==null?void 0:me.config.collisionColliderIds)||[]);return n.colliders.filter(Ae=>ie.has(Ae.id))}),fi=Fe(()=>{var me;const ie=new Set(((me=O.value)==null?void 0:me.config.collisionColliderIds)||[]);return n.colliders.filter(Ae=>!ie.has(Ae.id))});ei(()=>{var ie,me;return[(ie=O.value)==null?void 0:ie.id,(me=O.value)==null?void 0:me.config.collision]},()=>{Ut.value=!1}),ei(()=>{var ie;return(ie=O.value)==null?void 0:ie.id},()=>{Le.value=!1,Ce.value=""});function Dn(ie){var Ae;const me=(Ae=O.value)==null?void 0:Ae.config;!me||me.collisionColliderIds.includes(ie)||(me.collisionColliderIds.push(ie),Ut.value=!1)}function Fs(ie){var Ae;const me=(Ae=O.value)==null?void 0:Ae.config;me&&(me.collisionColliderIds=me.collisionColliderIds.filter(st=>st!==ie))}da(()=>{for(const ie of n.systems)ie.visible==null&&(ie.visible=!0);for(const ie of n.colliders)ie.visible==null&&(ie.visible=!0);for(const ie of n.paths)ie.visible==null&&(ie.visible=!0);for(const ie of n.spines)ie.visible==null&&(ie.visible=!0)}),da(()=>{if(!O.value)return;const ie=lr(O.value.config);ie.lifeMode==="curve"&&(ie.lifeMode="random"),ie.speedMode==="curve"&&(ie.speedMode="random"),ie.scaleMode==="curve"&&(ie.scaleMode="random"),ie.initialRotationMode==="curve"&&(ie.initialRotationMode="random"),ie.mode==="stream"&&!(ie.duration>0)&&(ie.duration=1),ie.streamBehavior==="loop"&&(ie.emitterFollow||ie.emitterFollowMode!=="none")&&Jo(ie)}),da(()=>{const ie=new Set(n.colliders.map(Ae=>Ae.id)),me=new Set(n.systems.map(Ae=>Ae.id));for(const Ae of n.systems){const st=lr(Ae.config),ci=st.collisionColliderIds.filter(pn=>ie.has(pn));ci.length!==st.collisionColliderIds.length&&(st.collisionColliderIds=ci),st.spawnPathId>0&&!n.paths.some(pn=>pn.id===st.spawnPathId)&&(st.spawnPathId=0,(st.emissionAngleMode==="path-normal"||st.emissionAngleMode==="path-tangent")&&(st.emissionAngleMode="fixed"));const ea=RS(n.systems,Ae.id);for(const pn of st.events||[])pn.targetSystemId>0&&(pn.targetSystemId===Ae.id||ea.has(pn.targetSystemId)||!me.has(pn.targetSystemId))&&(pn.targetSystemId=0);if(st.emitterFollowMode!=="bone")continue;const wd=n.spines.find(pn=>pn.id===st.emitterFollowSpineId);!!(wd!=null&&wd.bones.some(pn=>pn.name===st.emitterFollowBoneName))||(st.emitterFollowMode="none",st.emitterFollowSpineId=0,st.emitterFollowBoneName="")}}),da(()=>{for(const ie of n.systems){const me=lr(ie.config);me.renderLayerMode!=="slot"||!me.renderLayerSpineId||n.spines.some(Ae=>Ae.id===me.renderLayerSpineId)||(me.renderLayerSpineId=0,me.renderLayerSlotName="")}}),da(()=>{for(const ie of n.colliders)ie.followPathId==null&&(ie.followPathId=0),ie.followDuration>0||(ie.followDuration=2),ie.followPathRotation==null&&(ie.followPathRotation=!1),["跟随导出","线性","贝塞尔"].includes(ie.followCurveMode)||(ie.followCurveMode="跟随导出"),(!Array.isArray(ie.followCurve)||ie.followCurve.length<2)&&(ie.followCurve=[{x:0,y:0},{x:1,y:1}])});const Tn=Go({config:!0,scene:!1,emitMode:!0,shape:!0,attr:!0,look:!0,mods:!0,export:!1});function mn(ie){Tn[ie]=!Tn[ie]}function yr(ie){var Ae;const me=(Ae=O.value)==null?void 0:Ae.config;me&&(me.mode=ie,ie==="stream"&&!(me.duration>0)&&(me.duration=1))}function br(ie){var st;const me=(st=O.value)==null?void 0:st.config;if(!me)return;const Ae=Math.min(1800,Math.max(1,Math.ceil(Number(ie)||1)));me.loopDurationFrames=Ae}function Jo(ie){const me=tc();ie.emitterFollow=!1,ie.emitterFollowMode="none",ie.emitterFollowPathId=me.emitterFollowPathId,ie.emitterFollowSpineId=me.emitterFollowSpineId,ie.emitterFollowBoneName=me.emitterFollowBoneName,ie.emitterFollowBoneOffsetX=me.emitterFollowBoneOffsetX,ie.emitterFollowBoneOffsetY=me.emitterFollowBoneOffsetY,ie.emitterFollowBoneRotation=me.emitterFollowBoneRotation,ie.emitterFollowBoneScaleX=me.emitterFollowBoneScaleX,ie.emitterFollowBoneScaleY=me.emitterFollowBoneScaleY,ie.emitterAngleMode=me.emitterAngleMode,ie.emitterFollowCurve=me.emitterFollowCurve.map(Ae=>({...Ae})),ie.emitterFollowDuration=me.emitterFollowDuration,ie.emitterFollowSpace=me.emitterFollowSpace,ie.emitterFollowDirection=me.emitterFollowDirection,ie.emitterFollowOffset=me.emitterFollowOffset}function nl(ie){var ci;const me=(ci=O.value)==null?void 0:ci.config;if(!me||me.streamBehavior===ie)return;const Ae=ie==="loop",st=e(Ae?"errors.confirmLoopFollowEnter":"errors.confirmLoopFollowExit");window.confirm(st)&&(Jo(me),me.streamBehavior=ie,Ae||(me.generateLoopStartAnimation=!1,me.generateLoopEndAnimation=!1))}function _c(ie,me){var ci;const Ae=(ci=O.value)==null?void 0:ci.config;if(!Ae)return;const st=me.target.checked;ie==="start"?Ae.generateLoopStartAnimation=st:Ae.generateLoopEndAnimation=st}function Tc(ie,me){var ci;const Ae=(ci=O.value)==null?void 0:ci.config;if(!Ae)return;const st=Math.min(1800,Math.max(1,Math.ceil(Number(me.target.value)||30)));ie==="start"?Ae.loopStartDurationFrames=st:Ae.loopEndDurationFrames=st}function sl(ie,me){var ci;const Ae=(ci=O.value)==null?void 0:ci.config;if(!Ae)return;const st=me.target.checked;ie==="start"?Ae.loopStartUseCustomDuration=st:Ae.loopEndUseCustomDuration=st}function Ec(ie,me){const Ae=ie.target.value;if(me.emitterFollowMode=Ae,Ae!=="bone"){me.emitterFollowSpineId=0,me.emitterFollowBoneName="";return}Zo(me)}function Zo(ie){const me=ge.value;if(!me){ie.emitterFollowMode="none",ie.emitterFollowSpineId=0,ie.emitterFollowBoneName="";return}ie.emitterFollowMode="bone",ie.emitterFollowSpineId=me.spine.id,ie.emitterFollowBoneName=me.boneName}const Cc={emitMode:["mode","rate","streamBehavior","loopDurationFrames","generateLoopStartAnimation","loopStartUseCustomDuration","loopStartDurationFrames","generateLoopEndAnimation","loopEndUseCustomDuration","loopEndDurationFrames","burstCount","burstLoop","delay","duration"],shape:["shape","showShape","shapeRangeVersion","innerRadius","outerRadius","innerRectW","innerRectH","outerRectW","outerRectH","spawnPathId","spawnPathDistribution","radius","rectW","rectH","emissionAngleMode","direction","spread","coneDirection","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","renderLayerMode","renderLayerSpineId","renderLayerSlotName","renderLayerSlotPosition","renderLayerFollowAttachment"],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","showForceFieldShape","vortex","vortexStrength","vortexRadius","vortexCenterX","vortexCenterY","vortexFalloff","showVortexShape","attraction","attractionCenterX","attractionCenterY","attractionRadius","attractionDuration","attractionDelay","attractionDelayMode","attractionPath","showAttractionShape","trail","trailConfigVersion","trailResources","trailResourceVersion","trailTexture","trailTextureName","trailPreviewUrl","trailColorMode","trailColor","trailColorGradient","trailAlphaMode","trailAlpha","trailAlphaCurve","trailBoneCount","trailLength","trailWidth","trailWidthMode","trailLifeLengthEnabled","trailLifeLengthCurve","trailShapeEnabled","trailShapeCurve","trailGridRows","trailGridCols","collision","collisionColliderIds","pathFollow","eventEnabled","events","emitterFollow","emitterFollowMode","emitterFollowPathId","emitterFollowSpineId","emitterFollowBoneName","emitterFollowBoneOffsetX","emitterFollowBoneOffsetY","emitterFollowBoneRotation","emitterFollowBoneScaleX","emitterFollowBoneScaleY","emitterAngleMode","emitterFollowCurve","emitterFollowDuration","emitterFollowSpace","emitterFollowDirection","emitterFollowOffset","damping"]};function bd(ie){var st;const me=(st=O.value)==null?void 0:st.config;if(ie==="export"){n.settings.exportSettings=Og();return}if(!me)return;const Ae=tc();for(const ci of Cc[ie])me[ci]=Ae[ci]}function rl(){t.value.fps=Math.min(240,Math.max(1,Math.round(Number(t.value.fps)||30)))}function xr(ie){var me;n.selectSystem(((me=n.systems[ie])==null?void 0:me.id)??0)}function Qo(){n.addSystem()}function xd(){n.addCollider()}function Mc(){n.addPath()}function FE(){n.addSpine()}function LE(){n.duplicateSelectedObject()}function Ls(ie,me,Ae=0,st=0,ci=0,ea=0){return{x:ie,y:me,inX:Ae,inY:st,outX:ci,outY:ea}}function OE(){const ie=Ne.value;if(!(!ie||!ie.preset))if(ie.preset==="circle"){const Ae=60.751328;ie.points=[Ls(110,0,0,-Ae,0,Ae),Ls(0,110,Ae,0,-Ae,0),Ls(-110,0,0,Ae,0,-Ae),Ls(0,-110,-Ae,0,Ae,0)],ie.closed=!0}else if(ie.preset==="square")ie.points=[Ls(-100,-100),Ls(100,-100),Ls(100,100),Ls(-100,100)],ie.closed=!0;else{const me=ie.preset==="star"?10:6;ie.points=Array.from({length:me},(Ae,st)=>{const ci=ie.preset==="star"&&st%2?50:110,ea=-Math.PI*.5+st/me*Math.PI*2;return Ls(Math.cos(ea)*ci,Math.sin(ea)*ci)}),ie.closed=!0}}function $E(){Ne.value&&(Ne.value.points=[])}function NE(){O.value&&(O.value.config.seed=Math.floor(Math.random()*999999)+1)}function DE(ie){var Ae;const me=(Ae=O.value)==null?void 0:Ae.config;!me||ie==="direction"||(me.speedOverLifeMode=ie,ie==="curve"&&me.speedOverLifeMin===me.speedOverLifeMax&&(me.speedOverLifeMin=0,me.speedOverLifeMax=1))}function l0(){var me;const ie=(me=O.value)==null?void 0:me.config;!ie||ie.scaleOverLifeMode!=="curve"||(ie.scaleOverLifeMin===ie.scaleOverLifeMax&&(ie.scaleOverLifeMin=0,ie.scaleOverLifeMax=1),ie.scaleYOverLifeMin===ie.scaleYOverLifeMax&&(ie.scaleYOverLifeMin=0,ie.scaleYOverLifeMax=1))}function BE(ie){var Ae;const me=(Ae=O.value)==null?void 0:Ae.config;!me||ie==="direction"||(me.scaleOverLifeMode=ie,l0())}const UE={point:{emissionAngleMode:"random",direction:0,spread:360},circle:{innerRadius:0,outerRadius:100,emissionAngleMode:"fixed",direction:-90,spread:0},rect:{innerRectW:0,innerRectH:0,outerRectW:200,outerRectH:100,emissionAngleMode:"fixed",direction:-90,spread:0},cone:{innerRadius:0,outerRadius:100,coneAngle:90,coneDirection:90,emissionAngleMode:"random",direction:90,spread:90},path:{spawnPathId:0,spawnPathDistribution:"fixed",emissionAngleMode:"fixed",direction:0,spread:0}};function VE(){var Ae;const ie=(Ae=O.value)==null?void 0:Ae.config;if(!ie)return;const me=UE[ie.shape];me&&Object.assign(ie,me)}function XE(){var me;const ie=(me=O.value)==null?void 0:me.config;!ie||ie.spawnPathId>0||(ie.emissionAngleMode==="path-normal"||ie.emissionAngleMode==="path-tangent")&&(ie.emissionAngleMode="fixed")}return{store:n,exportSettings:t,exportBusy:i,exportTarget:s,exportMessage:r,exportError:o,connectorPairUrl:a,connectorStatusText:c,connectorStatusClass:l,connectorReady:h,connectorAuthorizationUrl:u,connectorDisabledReason:d,connectorButtonTitle:f,refreshConnectorHealth:m,exportSpineJson:p,exportSpineProject:g,exportSpineImages:v,configFileInput:b,selectedPreset:y,presetOptions:x,presetLoading:_,configMessage:E,configError:S,saveConfig:C,onConfigFileChange:M,refreshPresets:P,loadSelectedPreset:A,resolvedCurveEditorMode:R,sys:O,textureFileInput:W,sequenceFileInput:V,trailTextureFileInput:Y,addTrailResource:L,openTrailTexturePicker:N,onTrailRigChange:F,onTrailResourceBoneCountChange:D,onTrailResourceRotationChange:X,onTrailTextureFile:G,resetTrailTexture:K,removeTrailResource:J,setTrailResourceWeight:oe,toggleTrailResourceLock:le,setTrailColor:ve,commitTrailColor:Se,addImageResource:fe,openTexturePicker:ye,openSequencePicker:q,onTextureFile:Z,onSequenceFiles:se,resetTexture:H,setResourceFixedColor:j,commitResourceFixedColor:$,removeImageResource:U,setResourceWeight:z,toggleResourceLock:ee,automaticLoopDuration:ne,loopDurationFrames:ue,activeObjectType:xe,activeCollider:be,activePath:Ne,activeSpine:Be,canCopyObject:he,selectedSpineBone:ge,boundSpineBone:We,renderLayerSlotPickerOpen:Le,renderLayerSlotSearch:Ce,renderLayerReadySpines:Ze,renderLayerSpineReady:vi,renderLayerSlots:lt,renderLayerFilteredSlots:ce,renderLayerSlotLabel:Ft,renderLayerResolvedLabel:Nt,renderLayerWarning:ct,setRenderLayerSlotMode:rn,selectRenderLayerSpine:Nn,pickRenderLayerSlot:Ht,clearRenderLayerSlot:Di,collisionPickerOpen:Ut,selectedCollisionBodies:on,availableCollisionBodies:fi,addCollisionBody:Dn,removeCollisionBody:Fs,collapsed:Tn,toggle:mn,setEmitMode:yr,setLoopDurationFrames:br,setStreamBehavior:nl,setLoopSection:_c,setLoopSectionDuration:Tc,setLoopCustomDuration:sl,onEmitterFollowModeChange:Ec,bindSelectedBone:Zo,resetModule:bd,normalizeExportFps:rl,select:xr,addSys:Qo,addCollider:xd,addPath:Mc,addSpine:FE,copySelectedObject:LE,applyPathPreset:OE,clearPathAnchors:$E,randomizeSeed:NE,setSpeedOverLifeMode:DE,prepareScaleOverLifeCurve:l0,setScaleOverLifeMode:BE,onShapeChange:VE,onSpawnPathChange:XE,LINEAR_CURVE:S4,FLAT_CURVE:Op,ALPHA_CURVE:_4,RESOURCE_ALPHA_CURVE:$p,TRAIL_ALPHA_CURVE:Np,TRAIL_SHAPE_CURVE:Dp}}const PE=Symbol("particle-panel");function A5(){const n=M5();return lx(PE,n),n}function oo(){const n=ko(PE);if(!n)throw new Error("Particle panel sections require a ParticlePanel parent");return n}const I5={class:"group config-management"},P5={class:"caret"},R5={class:"group-body config-management-body"},k5={class:"config-toolbar"},F5=["title"],L5=["title"],O5=["aria-label","disabled"],$5={value:""},N5=["value"],D5=qt({__name:"ProjectConfigSection",setup(n){const{configFileInput:e,selectedPreset:t,presetOptions:i,presetLoading:s,configMessage:r,configError:o,saveConfig:a,onConfigFileChange:c,refreshPresets:l,loadSelectedPreset:h,collapsed:u,toggle:d,select:f}=oo(),{t:m}=fn(),p={"1.粒子扫过.json":"presets.particleSweep","2.长条方块.json":"presets.barBlocks","3.力场拖尾.json":"presets.forceTrail","4.雷电序列帧.json":"presets.lightningSequence","5.贴图轴点.json":"presets.texturePivot","6.子发射器.json":"presets.subEmitter"};function g(v){const b=p[v.file];return b?m(b):v.name}return(v,b)=>(Q(),te("div",I5,[w("div",{class:"group-head",onClick:b[0]||(b[0]=y=>I(d)("config"))},[w("span",P5,k(I(u).config?"▸":"▾"),1),w("span",null,k(v.$t("config.title")),1)]),pe(w("div",R5,[w("div",k5,[w("button",{title:v.$t("config.saveTitle"),onClick:b[1]||(b[1]=(...y)=>I(a)&&I(a)(...y))},k(v.$t("config.save")),9,F5),w("button",{title:v.$t("config.loadTitle"),onClick:b[2]||(b[2]=y=>{var x;return(x=I(e))==null?void 0:x.click()})},k(v.$t("config.load")),9,L5),pe(w("select",{"onUpdate:modelValue":b[3]||(b[3]=y=>Qt(t)?t.value=y:null),"aria-label":v.$t("config.presets"),disabled:!I(i).length||I(s),onPointerdown:b[4]||(b[4]=(...y)=>I(l)&&I(l)(...y)),onFocus:b[5]||(b[5]=(...y)=>I(l)&&I(l)(...y)),onChange:b[6]||(b[6]=(...y)=>I(h)&&I(h)(...y))},[w("option",$5,k(I(i).length?v.$t("config.selectPreset"):v.$t("config.noPresets")),1),(Q(!0),te(Me,null,It(I(i),y=>(Q(),te("option",{key:y.file,value:y.file},k(g(y)),9,N5))),128))],40,O5),[[St,I(t)]]),w("input",{ref_key:"configFileInput",ref:e,hidden:"",type:"file",accept:".json,application/json",onChange:b[7]||(b[7]=(...y)=>I(c)&&I(c)(...y))},null,544)]),I(r)?(Q(),te("div",{key:0,class:Pe(["config-message",{error:I(o)}])},k(I(r)),3)):_e("",!0)],512),[[Fi,!I(u).config]])]))}}),B5=li(D5,[["__scopeId","data-v-09679738"]]),U5={class:"ns-label"},V5=["min","max","step","value","disabled"],X5=["min","max","step","value","disabled"],Y5=qt({__name:"NumSlider",props:{label:{},modelValue:{},min:{},max:{},step:{},disabled:{type:Boolean}},emits:["update:modelValue"],setup(n,{emit:e}){const t=n,i=e,s=De(String(t.modelValue));ei(()=>t.modelValue,c=>{s.value=String(c)});function r(c){const l=parseFloat(c.target.value);Number.isNaN(l)||i("update:modelValue",l)}function o(c){s.value=c.target.value;const l=parseFloat(s.value);Number.isNaN(l)||i("update:modelValue",l)}function a(){const c=parseFloat(s.value);Number.isNaN(c)&&(s.value=String(t.modelValue))}return(c,l)=>(Q(),te("div",{class:Pe(["ns",{disabled:n.disabled}])},[w("span",U5,k(n.label),1),w("input",{type:"range",class:"ns-range",min:n.min,max:n.max,step:n.step,value:n.modelValue,disabled:n.disabled,onInput:r},null,40,V5),w("input",{type:"number",class:"ns-num",min:n.min,max:n.max,step:n.step,value:s.value,disabled:n.disabled,onInput:o,onBlur:a},null,40,X5)],2))}}),Ue=li(Y5,[["__scopeId","data-v-7c2fbed0"]]),G5={class:"ce"},H5={class:"ce-editor"},j5={class:"ce-grid"},W5=["x1","x2","y2"],z5=["y1","x2","y2"],q5=["x","y","width","height"],K5=["d"],J5={key:0,class:"ce-handles"},Z5=["x1","y1","x2","y2"],Q5=["cx","cy","onPointerdown"],e8=["x1","y1","x2","y2"],t8=["cx","cy","onPointerdown"],i8=["cx","cy"],n8=["cx","cy","onPointerdown","onDblclick"],s8={class:"ce-nav"},r8={class:"ce-tip"},o8=["title"],Tr=8,a8=qt({__name:"CurveEditor",props:{modelValue:{},defaultValue:{default:()=>[{x:0,y:0},{x:1,y:1}]},mode:{default:"linear"}},emits:["update:modelValue"],setup(n,{emit:e}){const t=n,i=e,s=De(null),r=De(300),o=De(110);let a=null;function c(){if(!s.value)return;const A=s.value.getBoundingClientRect();r.value=A.width,o.value=A.height}function l(A){return Tr+A*(r.value-Tr*2)}function h(A){return Tr+(1-A)*(o.value-Tr*2)}function u(){return[...t.modelValue].sort((A,R)=>A.x-R.x)}function d(A){i("update:modelValue",[...A].sort((R,B)=>R.x-B.x))}function f(){d(t.defaultValue.map(A=>({...A})))}const m=Fe(()=>u());function p(A){const R=m.value[A],B=m.value[Math.max(0,A-1)];return{x:R.x-(R.x-B.x)/3,y:R.y-(R.y-B.y)/3}}function g(A){const R=m.value[A],B=m.value[Math.min(m.value.length-1,A+1)];return{x:R.x+(B.x-R.x)/3,y:R.y+(B.y-R.y)/3}}function v(A){const R=m.value[A],B=p(A);return{x:R.x+(R.inX??B.x-R.x),y:R.y+(R.inY??B.y-R.y)}}function b(A){const R=m.value[A],B=g(A);return{x:R.x+(R.outX??B.x-R.x),y:R.y+(R.outY??B.y-R.y)}}const y=Fe(()=>{if(!m.value.length)return"";let A=`M ${l(m.value[0].x)} ${h(m.value[0].y)}`;for(let R=1;RMath.abs(W.x-R)>.02);O.push({x:R,y:B}),d(O)}let S={t:0,i:-1,x:0,y:0};function C(A,R){A.stopPropagation();const B=u().findIndex(Y=>Math.abs(Y.x-m.value[R].x)<1e-6&&Math.abs(Y.y-m.value[R].y)<1e-6);if(B<0)return;const O=Date.now();if(O-S.t<300&&S.i===R&&Math.abs(A.clientX-S.x)<8&&Math.abs(A.clientY-S.y)<8){S={t:0,i:-1,x:0,y:0},P(R);return}S={t:O,i:R,x:A.clientX,y:A.clientY};const W=Y=>{(Math.abs(Y.clientX-A.clientX)>8||Math.abs(Y.clientY-A.clientY)>8)&&(S={t:0,i:-1,x:0,y:0});const{x:L,y:N}=x(Y.clientX,Y.clientY),F=u();F[B]={x:L,y:N},d(F)},V=()=>{window.removeEventListener("pointermove",W),window.removeEventListener("pointerup",V)};window.addEventListener("pointermove",W),window.addEventListener("pointerup",V)}function M(A,R,B){A.stopPropagation();const O=V=>{const Y=x(V.clientX,V.clientY),L=u(),N=L[R],F=B==="in"?L[Math.max(0,R-1)].x:N.x,D=B==="in"?N.x:L[Math.min(L.length-1,R+1)].x,X=Math.min(D,Math.max(F,Y.x)),G=Math.round((X-N.x)*100)/100,K=Math.round((Y.y-N.y)*100)/100;L[R]=B==="in"?{...N,inX:G,inY:K}:{...N,outX:G,outY:K},d(L)},W=()=>{window.removeEventListener("pointermove",O),window.removeEventListener("pointerup",W)};window.addEventListener("pointermove",O),window.addEventListener("pointerup",W)}function P(A,R){R==null||R.stopPropagation();const B=u();B.length<=2||(_=Date.now(),d(B.filter((O,W)=>W!==A)))}return Sn(()=>{c(),a=new ResizeObserver(c),s.value&&a.observe(s.value)}),Za(()=>{a==null||a.disconnect()}),(A,R)=>(Q(),te("div",G5,[w("div",H5,[(Q(),te("svg",{ref_key:"svg",ref:s,class:"ce-svg",onDblclick:E},[w("g",j5,[(Q(),te(Me,null,It([.25,.5,.75],B=>w("line",{key:"v"+B,x1:l(B),y1:"0",x2:l(B),y2:h(0)},null,8,W5)),64)),(Q(),te(Me,null,It([.25,.5,.75],B=>w("line",{key:"h"+B,x1:"0",y1:h(B),x2:l(1),y2:h(B)},null,8,z5)),64))]),w("rect",{x:l(0),y:h(1),width:l(1)-l(0),height:h(0)-h(1),class:"ce-frame",fill:"none"},null,8,q5),w("path",{d:y.value,class:"ce-line",fill:"none"},null,8,K5),n.mode==="bezier"?(Q(),te("g",J5,[(Q(!0),te(Me,null,It(m.value,(B,O)=>(Q(),te(Me,{key:"handles-"+O},[O>0?(Q(),te("line",{key:0,x1:l(B.x),y1:h(B.y),x2:l(v(O).x),y2:h(v(O).y)},null,8,Z5)):_e("",!0),O>0?(Q(),te("circle",{key:1,cx:l(v(O).x),cy:h(v(O).y),r:"4",onPointerdown:W=>M(W,O,"in")},null,40,Q5)):_e("",!0),OM(W,O,"out")},null,40,t8)):_e("",!0)],64))),128))])):_e("",!0),(Q(!0),te(Me,null,It(m.value,(B,O)=>(Q(),te("g",{key:O},[w("circle",{cx:l(B.x),cy:h(B.y),r:"5",class:"ce-node"},null,8,i8),w("circle",{cx:l(B.x),cy:h(B.y),r:"9",class:"ce-hit",onPointerdown:W=>C(W,O),onDblclick:W=>P(O,W)},null,40,n8)]))),128))],544)),w("div",s8,[w("span",r8,k(n.mode==="bezier"?A.$t("curve.bezierHint"):A.$t("curve.linearHint")),1)])]),w("button",{class:"ce-reset",type:"button",title:A.$t("curve.resetTitle"),onClick:f},k(A.$t("common.reset")),9,o8)]))}}),bs=li(a8,[["__scopeId","data-v-8f475293"]]),l8={class:"spine-editor"},c8={class:"editor-title"},h8={class:"field wide"},u8={class:"grid three"},d8={class:"field"},f8={class:"field"},m8={class:"field"},p8={class:"grid three"},g8={class:"field"},v8={class:"field"},y8={class:"field"},b8={class:"section-title"},x8=["disabled"],w8={class:"folder-hint"},S8={class:"asset-row"},_8=["title"],T8={class:"asset-row"},E8=["title"],C8={class:"asset-row"},M8=["title"],A8={class:"asset-actions"},I8=["disabled"],P8={class:"runtime-note"},R8={key:0},k8={key:0,class:"error"},F8={class:"section-box"},L8={class:"section-title"},O8={key:0,class:"empty"},$8={key:1,class:"field wide"},N8={value:""},D8=["value"],B8={class:"section-box"},U8={class:"tree-title-row"},V8={class:"section-title"},X8=["disabled","title"],Y8=["disabled","title"],G8={class:"tree-tabs"},H8={key:0,class:"empty"},j8={key:1,class:"bone-search"},W8=["aria-label","placeholder"],z8=["title","aria-label"],q8={key:2,class:"empty"},K8={key:3,class:"bone-tree"},J8=["onClick","onKeydown"],Z8=["title","onClick"],Q8={key:1,class:"bone-leaf"},eV={class:"bone-name"},tV={key:0,class:"empty"},iV={key:1,class:"bone-search"},nV=["aria-label","placeholder"],sV=["title","aria-label"],rV={key:2,class:"empty"},oV={key:3,class:"bone-tree slot-tree"},aV=["title","onClick","onKeydown"],lV={class:"slot-order"},cV={class:"bone-name"},hV={class:"slot-attachment"},uV=qt({__name:"SpineObjectPanel",props:{spineObject:{}},setup(n){const e=n,{t}=fn(),i=Wo(),s=De(null),r=De(null),o=De(null),a=De(null),c=De(new Set),l=De(""),h=De("bone"),u=De(""),d=De(null),f=De(null),m=De([]);e.spineObject.selectedBone==null&&(e.spineObject.selectedBone=""),e.spineObject.selectedSlot==null&&(e.spineObject.selectedSlot=""),Array.isArray(e.spineObject.slots)||(e.spineObject.slots=[]),e.spineObject.sourceBundle==null&&(e.spineObject.sourceBundle=null),e.spineObject.dataVersion==null&&(e.spineObject.dataVersion="");const p=Fe(()=>{var X;return((X=d.value)==null?void 0:X.name)||e.spineObject.skeletonFileName}),g=Fe(()=>{var X;return((X=f.value)==null?void 0:X.name)||e.spineObject.atlasFileName}),v=Fe(()=>m.value.length?m.value.map(X=>X.name):e.spineObject.textureFileNames),b=Fe(()=>v.value.length?t("spine.textureSummary",{count:v.value.length,names:v.value.join(", ")}):"PNG / JPEG / WebP..."),y=Fe(()=>new Set(e.spineObject.bones.map(X=>X.parent).filter(X=>!!X))),x=Fe(()=>new Map(e.spineObject.bones.map(X=>[X.name,X]))),_=Fe(()=>e.spineObject.bones.filter(X=>{var J;const G=l.value.trim().toLocaleLowerCase();if(G)return X.name.toLocaleLowerCase().includes(G);let K=X.parent;for(;K;){if(c.value.has(K))return!1;K=((J=x.value.get(K))==null?void 0:J.parent)||null}return!0})),E=Fe(()=>y.value.size>0&&[...y.value].every(X=>c.value.has(X))),S=Fe(()=>{const X=u.value.trim().toLocaleLowerCase(),G=[...e.spineObject.slots].sort((K,J)=>K.order-J.order);return X?G.filter(K=>K.name.toLocaleLowerCase().includes(X)||K.attachment.toLocaleLowerCase().includes(X)):G});function C(X){const G=e.spineObject.selectedBone===X;for(const K of i.spines)K.selectedBone="";G||(e.spineObject.selectedBone=X)}function M(X){const G=e.spineObject.selectedSlot===X;for(const K of i.spines)K.selectedSlot="";G||(e.spineObject.selectedSlot=X)}function P(X){c.value.has(X)?c.value.delete(X):c.value.add(X)}function A(){c.value=E.value?new Set:new Set(y.value)}function R(X){var G;return((G=X.target.files)==null?void 0:G[0])||null}function B(X){d.value=R(X)}function O(X){f.value=R(X)}function W(X){m.value=Array.from(X.target.files||[])}function V(X){return X.name.replace(/\.[^.]+$/,"").toLocaleLowerCase()}async function Y(X){const G=Array.from(X.target.files||[]);if(!G.length)return;const K=G.filter(fe=>/\.(json|skel)$/i.test(fe.name)),J=G.filter(fe=>/\.atlas$/i.test(fe.name)),oe=G.filter(fe=>/\.(png|jpe?g|webp|wepb)$/i.test(fe.name)),le=J.map(fe=>({atlas:fe,skeleton:K.find(ye=>V(ye)===V(fe))})).find(fe=>fe.skeleton),ve=(le==null?void 0:le.skeleton)||K[0]||null,Se=(le==null?void 0:le.atlas)||J[0]||null;if(d.value=ve,f.value=Se,m.value=oe,!ve||!Se||!oe.length){const fe=[!ve&&"JSON / SKEL",!Se&&"Atlas",!oe.length&&t("spine.textureImages")].filter(Boolean).join(", ");e.spineObject.status="error",e.spineObject.error=t("spine.missingFolderAssets",{missing:fe});return}await F()}function L(){i.recalcTotalFrames()}function N(){L(),i.timeline.frame=0}async function F(){var K;const X=d.value,G=f.value;if(!X||!G||!m.value.length){e.spineObject.status="error",e.spineObject.error=t("spine.chooseAssets");return}e.spineObject.status="loading",e.spineObject.error="";try{const J=await xT(X,G,m.value);cd(e.spineObject.id,J),e.spineObject.skeletonFileName=X.name,e.spineObject.atlasFileName=G.name,e.spineObject.textureFileNames=m.value.map(oe=>oe.name),e.spineObject.dataVersion=J.dataVersion,e.spineObject.animations=J.animations,e.spineObject.bones=J.bones,e.spineObject.slots=J.slots,e.spineObject.selectedBone="",e.spineObject.selectedSlot="",l.value="",u.value="",c.value=new Set,e.spineObject.selectedAnimation=((K=J.animations[0])==null?void 0:K.name)||"",e.spineObject.assetVersion++,e.spineObject.status="ready",L(),i.timeline.frame=0;try{e.spineObject.sourceBundle=await TD(X,G,m.value)}catch(oe){e.spineObject.sourceBundle=null,console.warn("Spine 配置资源嵌入失败",oe)}}catch(J){e.spineObject.status="error",e.spineObject.error=J instanceof Error?J.message:String(J)}}function D(){yc(e.spineObject.id),d.value=null,f.value=null,m.value=[],s.value&&(s.value.value=""),r.value&&(r.value.value=""),o.value&&(o.value.value=""),a.value&&(a.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.slots=[],e.spineObject.selectedBone="",e.spineObject.selectedSlot="",l.value="",u.value="",c.value=new Set,e.spineObject.selectedAnimation="",e.spineObject.assetVersion++,e.spineObject.status="empty",e.spineObject.error="",L()}return(X,G)=>(Q(),te("div",l8,[w("div",c8,k(X.$t("spine.title")),1),w("label",h8,[w("span",null,k(X.$t("spine.name")),1),pe(w("input",{"onUpdate:modelValue":G[0]||(G[0]=K=>n.spineObject.name=K)},null,512),[[Je,n.spineObject.name]])]),w("div",u8,[w("label",d8,[w("span",null,k(X.$t("spine.xPosition")),1),pe(w("input",{"onUpdate:modelValue":G[1]||(G[1]=K=>n.spineObject.x=K),type:"number"},null,512),[[Je,n.spineObject.x,void 0,{number:!0}]])]),w("label",f8,[w("span",null,k(X.$t("spine.yPosition")),1),pe(w("input",{"onUpdate:modelValue":G[2]||(G[2]=K=>n.spineObject.y=K),type:"number"},null,512),[[Je,n.spineObject.y,void 0,{number:!0}]])]),w("label",m8,[w("span",null,k(X.$t("spine.rotation")),1),pe(w("input",{"onUpdate:modelValue":G[3]||(G[3]=K=>n.spineObject.rotation=K),type:"number"},null,512),[[Je,n.spineObject.rotation,void 0,{number:!0}]])])]),w("div",p8,[w("label",g8,[G[20]||(G[20]=w("span",null,"Scale X",-1)),pe(w("input",{"onUpdate:modelValue":G[4]||(G[4]=K=>n.spineObject.scaleX=K),type:"number",step:"0.05"},null,512),[[Je,n.spineObject.scaleX,void 0,{number:!0}]])]),w("label",v8,[G[21]||(G[21]=w("span",null,"Scale Y",-1)),pe(w("input",{"onUpdate:modelValue":G[5]||(G[5]=K=>n.spineObject.scaleY=K),type:"number",step:"0.05"},null,512),[[Je,n.spineObject.scaleY,void 0,{number:!0}]])]),w("label",y8,[w("span",null,k(X.$t("spine.startTime")),1),pe(w("input",{"onUpdate:modelValue":G[6]||(G[6]=K=>n.spineObject.timeOffset=K),type:"number",min:"0",step:"0.033333",onChange:L},null,544),[[Je,n.spineObject.timeOffset,void 0,{number:!0}]])])]),G[22]||(G[22]=w("div",{class:"divider"},null,-1)),w("div",b8,k(X.$t("spine.resources")),1),w("input",{ref_key:"skeletonInput",ref:s,hidden:"",type:"file",accept:".json,.skel,application/json,application/octet-stream",onChange:B},null,544),w("input",{ref_key:"atlasInput",ref:r,hidden:"",type:"file",accept:".atlas,text/plain",onChange:O},null,544),w("input",{ref_key:"textureInput",ref:o,hidden:"",type:"file",multiple:"",accept:".png,.jpg,.jpeg,.webp,.wepb,image/png,image/jpeg,image/webp",onChange:W},null,544),w("input",{ref_key:"folderInput",ref:a,hidden:"",type:"file",multiple:"",webkitdirectory:"",directory:"",onChange:Y},null,544),w("button",{class:"folder-select",disabled:n.spineObject.status==="loading",onClick:G[7]||(G[7]=K=>{var J;return(J=a.value)==null?void 0:J.click()})},k(X.$t("spine.chooseFolder")),9,x8),w("div",w8,k(X.$t("spine.folderHint")),1),w("div",S8,[w("div",{class:"asset-name",title:p.value},k(p.value||"JSON / SKEL..."),9,_8),w("button",{onClick:G[8]||(G[8]=K=>{var J;return(J=s.value)==null?void 0:J.click()})},k(X.$t("spine.choose")),1)]),w("div",T8,[w("div",{class:"asset-name",title:g.value},k(g.value||"Atlas..."),9,E8),w("button",{onClick:G[9]||(G[9]=K=>{var J;return(J=r.value)==null?void 0:J.click()})},k(X.$t("spine.choose")),1)]),w("div",C8,[w("div",{class:"asset-name",title:v.value.join(", ")},k(b.value),9,M8),w("button",{onClick:G[10]||(G[10]=K=>{var J;return(J=o.value)==null?void 0:J.click()})},k(X.$t("spine.chooseMultiple")),1)]),w("div",A8,[w("button",{class:"load",disabled:n.spineObject.status==="loading",onClick:F},k(n.spineObject.status==="loading"?X.$t("spine.loading"):X.$t("spine.load")),9,I8),w("button",{class:"clear",onClick:D},k(X.$t("spine.clear")),1)]),w("div",P8,[yt(k(X.$t("spine.supportNote"))+" ",1),n.spineObject.dataVersion?(Q(),te("span",R8," · "+k(X.$t("spine.currentResource",{version:n.spineObject.dataVersion})),1)):_e("",!0)]),n.spineObject.error?(Q(),te("div",k8,k(n.spineObject.error),1)):_e("",!0),w("div",F8,[w("div",L8,k(X.$t("spine.animations")),1),n.spineObject.animations.length?(Q(),te("label",$8,[w("span",null,k(X.$t("spine.timelineAnimation")),1),pe(w("select",{"onUpdate:modelValue":G[11]||(G[11]=K=>n.spineObject.selectedAnimation=K),onChange:N},[w("option",N8,k(X.$t("spine.no")),1),(Q(!0),te(Me,null,It(n.spineObject.animations,K=>(Q(),te("option",{key:K.name,value:K.name},k(K.name)+"("+k(K.duration.toFixed(2))+"s) ",9,D8))),128))],544),[[St,n.spineObject.selectedAnimation]])])):(Q(),te("div",O8,k(X.$t("spine.noAnimations")),1))]),w("div",B8,[w("div",U8,[w("div",V8,k(X.$t("spine.hierarchy")),1),h.value==="bone"?(Q(),te("button",{key:0,class:Pe(["selected-bone",{active:n.spineObject.selectedBone}]),disabled:!n.spineObject.selectedBone,title:n.spineObject.selectedBone?X.$t("spine.clearBoneTitle"):X.$t("spine.noBoneTitle"),onClick:G[12]||(G[12]=K=>n.spineObject.selectedBone="")},[n.spineObject.selectedBone?(Q(),te(Me,{key:0},[yt(k(X.$t("spine.clearBone",{name:""})),1),w("strong",null,k(n.spineObject.selectedBone),1)],64)):(Q(),te(Me,{key:1},[yt(k(X.$t("spine.currentBone")),1),w("strong",null,k(X.$t("spine.notSelected")),1)],64))],10,X8)):(Q(),te("button",{key:1,class:Pe(["selected-bone",{active:n.spineObject.selectedSlot}]),disabled:!n.spineObject.selectedSlot,title:n.spineObject.selectedSlot?X.$t("spine.clearSlotTitle"):X.$t("spine.noSlotTitle"),onClick:G[13]||(G[13]=K=>n.spineObject.selectedSlot="")},[n.spineObject.selectedSlot?(Q(),te(Me,{key:0},[yt(k(X.$t("spine.clearSlot",{name:""})),1),w("strong",null,k(n.spineObject.selectedSlot),1)],64)):(Q(),te(Me,{key:1},[yt(k(X.$t("spine.currentSlot")),1),w("strong",null,k(X.$t("spine.notSelected")),1)],64))],10,Y8)),h.value==="bone"&&n.spineObject.bones.length?(Q(),te("button",{key:2,class:"tree-action",onClick:A},k(E.value?X.$t("spine.expandAll"):X.$t("spine.collapseAll")),1)):_e("",!0)]),w("div",G8,[w("button",{class:Pe({on:h.value==="bone"}),onClick:G[14]||(G[14]=K=>h.value="bone")},k(X.$t("spine.bones")),3),w("button",{class:Pe({on:h.value==="slot"}),onClick:G[15]||(G[15]=K=>h.value="slot")},k(X.$t("spine.slots")),3)]),h.value==="bone"?(Q(),te(Me,{key:0},[n.spineObject.bones.length?(Q(),te("div",j8,[pe(w("input",{"onUpdate:modelValue":G[16]||(G[16]=K=>l.value=K),type:"search","aria-label":X.$t("spine.searchBones"),placeholder:X.$t("spine.searchBonesPlaceholder")},null,8,W8),[[Je,l.value,void 0,{trim:!0}]]),l.value?(Q(),te("button",{key:0,title:X.$t("spine.clearSearch"),"aria-label":X.$t("spine.clearBoneSearch"),onClick:G[17]||(G[17]=K=>l.value="")},"✕",8,z8)):_e("",!0)])):(Q(),te("div",H8,k(X.$t("spine.notLoaded")),1)),n.spineObject.bones.length&&!_.value.length?(Q(),te("div",q8,k(X.$t("spine.noMatchingBones")),1)):n.spineObject.bones.length?(Q(),te("div",K8,[(Q(!0),te(Me,null,It(_.value,K=>(Q(),te("div",{key:K.name,class:Pe(["bone",{selected:n.spineObject.selectedBone===K.name}]),style:Vt({paddingLeft:`${6+K.depth*16}px`}),role:"button",tabindex:"0",onClick:J=>C(K.name),onKeydown:Wr(tt(J=>C(K.name),["prevent"]),["enter"])},[y.value.has(K.name)?(Q(),te("button",{key:0,class:"bone-toggle",title:c.value.has(K.name)?X.$t("spine.expandChildren"):X.$t("spine.collapseChildren"),onClick:tt(J=>P(K.name),["stop"])},k(c.value.has(K.name)?"▸":"▾"),9,Z8)):(Q(),te("span",Q8,"•")),w("span",eV,k(K.name),1)],46,J8))),128))])):_e("",!0)],64)):(Q(),te(Me,{key:1},[n.spineObject.slots.length?(Q(),te("div",iV,[pe(w("input",{"onUpdate:modelValue":G[18]||(G[18]=K=>u.value=K),type:"search","aria-label":X.$t("spine.searchSlots"),placeholder:X.$t("spine.searchSlotsPlaceholder")},null,8,nV),[[Je,u.value,void 0,{trim:!0}]]),u.value?(Q(),te("button",{key:0,title:X.$t("spine.clearSearch"),"aria-label":X.$t("spine.clearSlotSearch"),onClick:G[19]||(G[19]=K=>u.value="")},"✕",8,sV)):_e("",!0)])):(Q(),te("div",tV,k(X.$t("spine.notLoadedSlots")),1)),n.spineObject.slots.length&&!S.value.length?(Q(),te("div",rV,k(X.$t("spine.noMatchingSlots")),1)):n.spineObject.slots.length?(Q(),te("div",oV,[(Q(!0),te(Me,null,It(S.value,K=>(Q(),te("div",{key:K.name,class:Pe(["bone slot-row",{selected:n.spineObject.selectedSlot===K.name}]),role:"button",tabindex:"0",title:X.$t("spine.slotTitle",{name:K.name,bone:K.bone||"-",attachment:K.attachment||X.$t("spine.empty")}),onClick:J=>M(K.name),onKeydown:Wr(tt(J=>M(K.name),["prevent"]),["enter"])},[w("span",lV,k(K.order+1),1),w("span",cV,k(K.name),1),w("span",hV,k(K.attachment||X.$t("spine.empty")),1)],42,aV))),128))])):_e("",!0)],64))])]))}}),dV=li(uV,[["__scopeId","data-v-35137928"]]),fV={class:"group"},mV={class:"caret"},pV={class:"scene-actions"},gV=["title"],vV=["title"],yV=["title"],bV=["title"],xV=["disabled","title"],wV={class:"group-body"},SV={class:"tree scene-tree"},_V=["onClick"],TV={key:0,class:"sub-branch"},EV={key:1,class:"tdot"},CV={class:"tlabel"},MV=["title","aria-label","onClick"],AV={viewBox:"0 0 24 24","aria-hidden":"true"},IV={key:0,class:"eye-slash",d:"M4 4l16 16"},PV=["title","onClick"],RV=["onClick"],kV={class:"tlabel"},FV=["title","aria-label","onClick"],LV={viewBox:"0 0 24 24","aria-hidden":"true"},OV={key:0,class:"eye-slash",d:"M4 4l16 16"},$V={class:"scene-object-kind"},NV=["title","onClick"],DV=["onClick"],BV={class:"tlabel"},UV=["title","aria-label","onClick"],VV={viewBox:"0 0 24 24","aria-hidden":"true"},XV={key:0,class:"eye-slash",d:"M4 4l16 16"},YV={class:"scene-object-kind"},GV=["title","onClick"],HV=["onClick"],jV={class:"tlabel"},WV=["title","aria-label","onClick"],zV={viewBox:"0 0 24 24","aria-hidden":"true"},qV={key:0,class:"eye-slash",d:"M4 4l16 16"},KV=["title","onClick"],JV={key:0,class:"empty"},ZV={class:"row"},QV={class:"seed-row scene-seed"},eX={for:"system-seed"},tX=["title"],iX=["title"],nX={class:"seed-hint"},sX={class:"object-editor-title"},rX={class:"field-block"},oX={class:"field-grid"},aX={class:"field-block"},lX={value:"circle"},cX={value:"ellipse"},hX={value:"rect"},uX={value:"polygon"},dX={value:"custom"},fX={class:"field-block check-field"},mX={class:"field-grid"},pX={class:"compact-field"},gX={class:"compact-field"},vX={class:"field-grid"},yX={class:"compact-field"},bX={class:"compact-field"},xX={key:1,class:"field-grid"},wX={class:"compact-field"},SX={class:"compact-field"},_X={key:2,class:"field-grid"},TX={class:"compact-field"},EX={class:"compact-field"},CX={class:"field-block"},MX={value:"physics"},AX={value:"pause"},IX={value:"destroy"},PX={key:4,class:"field-grid"},RX={class:"compact-field"},kX={class:"compact-field"},FX={class:"collider-follow-section"},LX={class:"follow-path"},OX={class:"field-block"},$X={value:0},NX=["value"],DX={class:"field-grid"},BX={class:"compact-field"},UX={class:"compact-field"},VX={value:"跟随导出"},XX={value:"线性"},YX={value:"贝塞尔"},GX={class:"follow-path"},HX={class:"collider-curve-title"},jX={class:"object-editor-title"},WX={class:"field-block"},zX={class:"field-grid"},qX={class:"compact-field"},KX={class:"compact-field"},JX={class:"field-grid"},ZX={class:"compact-field"},QX={class:"compact-field"},eY={class:"setting-line"},tY={class:"setting-line"},iY={class:"path-help"},nY={class:"field-block"},sY={value:""},rY={value:"circle"},oY={value:"square"},aY={value:"polygon"},lY={value:"star"},cY={key:4,class:"panel-hint"},hY=qt({__name:"SceneObjectsSection",setup(n){const{store:e,resolvedCurveEditorMode:t,sys:i,activeObjectType:s,activeCollider:r,activePath:o,activeSpine:a,canCopyObject:c,collapsed:l,toggle:h,addSys:u,addCollider:d,addPath:f,addSpine:m,copySelectedObject:p,applyPathPreset:g,clearPathAnchors:v,randomizeSeed:b,LINEAR_CURVE:y}=oo(),x=Fe(()=>{const _=new Map(e.systems.map(A=>[A.id,A])),E=new Map;for(const A of e.systems)if(A.config.eventEnabled!==!1)for(const R of A.config.events||[])R.targetSystemId<=0||R.targetSystemId===A.id||!_.has(R.targetSystemId)||E.has(R.targetSystemId)||E.set(R.targetSystemId,A.id);const S=new Map;for(const[A,R]of E){const B=S.get(R);B?B.push(A):S.set(R,[A])}const C=[],M=new Set,P=(A,R)=>{if(!M.has(A.id)){M.add(A.id),C.push({system:A,depth:R});for(const B of S.get(A.id)||[]){const O=_.get(B);O&&P(O,R+1)}}};for(const A of e.systems)E.has(A.id)||P(A,0);for(const A of e.systems)M.has(A.id)||P(A,0);return C});return(_,E)=>(Q(),te("div",fV,[w("div",{class:"group-head scene-head",onClick:E[5]||(E[5]=S=>I(h)("scene"))},[w("span",mV,k(I(l).scene?"▸":"▾"),1),w("span",null,k(_.$t("scene.title")),1),w("div",pV,[w("button",{class:"scene-add",title:_.$t("scene.addParticle"),onClick:E[0]||(E[0]=tt((...S)=>I(u)&&I(u)(...S),["stop"]))},k(_.$t("scene.addParticleShort")),9,gV),w("button",{class:"scene-add",title:_.$t("scene.addCollider"),onClick:E[1]||(E[1]=tt((...S)=>I(d)&&I(d)(...S),["stop"]))},k(_.$t("scene.addColliderShort")),9,vV),w("button",{class:"scene-add",title:_.$t("scene.addPath"),onClick:E[2]||(E[2]=tt((...S)=>I(f)&&I(f)(...S),["stop"]))},k(_.$t("scene.addPathShort")),9,yV),w("button",{class:"scene-add",title:_.$t("scene.addSpine"),onClick:E[3]||(E[3]=tt((...S)=>I(m)&&I(m)(...S),["stop"]))},"+Spine",8,bV),w("button",{class:"scene-add",disabled:!I(c),title:_.$t("scene.copyTitle"),onClick:E[4]||(E[4]=tt((...S)=>I(p)&&I(p)(...S),["stop"]))},"+Copy",8,xV)])]),pe(w("div",wV,[w("div",SV,[(Q(!0),te(Me,null,It(x.value,S=>(Q(),te("div",{key:`particle-${S.system.id}`,class:Pe(["tree-item scene-object-item",{on:I(s)==="particle"&&S.system.id===I(e).activeObjectId,"scene-object-child":S.depth>0}]),style:Vt(S.depth>0?{paddingLeft:`${S.depth*18}px`}:void 0),onClick:C=>I(e).selectSystem(S.system.id)},[S.depth>0?(Q(),te("span",TV,"└")):(Q(),te("span",EV,"●")),w("span",CV,k(S.system.config.name||"ParticleSystem"),1),w("button",{class:Pe(["scene-object-eye",{off:S.system.visible===!1}]),title:S.system.visible===!1?_.$t("scene.showParticle"):_.$t("scene.hideParticle"),"aria-label":S.system.visible===!1?_.$t("scene.showParticle"):_.$t("scene.hideParticle"),onClick:tt(C=>S.system.visible=S.system.visible===!1,["stop"])},[(Q(),te("svg",AV,[E[50]||(E[50]=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)),E[51]||(E[51]=w("circle",{cx:"12",cy:"12",r:"2.8"},null,-1)),S.system.visible===!1?(Q(),te("path",IV)):_e("",!0)]))],10,MV),w("span",{class:Pe(["scene-object-kind",{"sub-emitter-kind":S.depth>0}])},k(S.depth>0?_.$t("scene.subEmitter"):_.$t("scene.particle")),3),w("button",{class:"scene-object-delete",title:_.$t("scene.deleteParticle"),onClick:tt(C=>I(e).removeSystem(S.system.id),["stop"])},"✕",8,PV)],14,_V))),128)),(Q(!0),te(Me,null,It(I(e).colliders,S=>(Q(),te("div",{key:`collision-${S.id}`,class:Pe(["tree-item scene-object-item",{on:I(s)==="collision"&&S.id===I(e).activeObjectId}]),onClick:C=>I(e).selectSceneObject("collision",S.id)},[E[54]||(E[54]=w("span",{class:"tdot collision-dot"},"■",-1)),w("span",kV,k(S.name),1),w("button",{class:Pe(["scene-object-eye",{off:S.visible===!1}]),title:S.visible===!1?_.$t("scene.showCollider"):_.$t("scene.hideCollider"),"aria-label":S.visible===!1?_.$t("scene.showCollider"):_.$t("scene.hideCollider"),onClick:tt(C=>S.visible=S.visible===!1,["stop"])},[(Q(),te("svg",LV,[E[52]||(E[52]=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)),E[53]||(E[53]=w("circle",{cx:"12",cy:"12",r:"2.8"},null,-1)),S.visible===!1?(Q(),te("path",OV)):_e("",!0)]))],10,FV),w("span",$V,k(_.$t("scene.collision")),1),w("button",{class:"scene-object-delete",title:_.$t("scene.deleteCollider"),onClick:tt(C=>I(e).removeCollider(S.id),["stop"])},"✕",8,NV)],10,RV))),128)),(Q(!0),te(Me,null,It(I(e).paths,S=>(Q(),te("div",{key:`path-${S.id}`,class:Pe(["tree-item scene-object-item",{on:I(s)==="path"&&S.id===I(e).activeObjectId}]),onClick:C=>I(e).selectSceneObject("path",S.id)},[E[57]||(E[57]=w("span",{class:"tdot path-dot"},"◇",-1)),w("span",BV,k(S.name),1),w("button",{class:Pe(["scene-object-eye",{off:S.visible===!1}]),title:S.visible===!1?_.$t("scene.showPath"):_.$t("scene.hidePath"),"aria-label":S.visible===!1?_.$t("scene.showPath"):_.$t("scene.hidePath"),onClick:tt(C=>S.visible=S.visible===!1,["stop"])},[(Q(),te("svg",VV,[E[55]||(E[55]=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)),E[56]||(E[56]=w("circle",{cx:"12",cy:"12",r:"2.8"},null,-1)),S.visible===!1?(Q(),te("path",XV)):_e("",!0)]))],10,UV),w("span",YV,k(_.$t("scene.path")),1),w("button",{class:"scene-object-delete",title:_.$t("scene.deletePath"),onClick:tt(C=>I(e).removePath(S.id),["stop"])},"✕",8,GV)],10,DV))),128)),(Q(!0),te(Me,null,It(I(e).spines,S=>(Q(),te("div",{key:`spine-${S.id}`,class:Pe(["tree-item scene-object-item",{on:I(s)==="spine"&&S.id===I(e).activeObjectId}]),onClick:C=>I(e).selectSceneObject("spine",S.id)},[E[60]||(E[60]=w("span",{class:"tdot spine-dot"},"◆",-1)),w("span",jV,k(S.name),1),w("button",{class:Pe(["scene-object-eye",{off:S.visible===!1}]),title:S.visible===!1?_.$t("scene.showSpine"):_.$t("scene.hideSpine"),"aria-label":S.visible===!1?_.$t("scene.showSpine"):_.$t("scene.hideSpine"),onClick:tt(C=>S.visible=S.visible===!1,["stop"])},[(Q(),te("svg",zV,[E[58]||(E[58]=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)),E[59]||(E[59]=w("circle",{cx:"12",cy:"12",r:"2.8"},null,-1)),S.visible===!1?(Q(),te("path",qV)):_e("",!0)]))],10,WV),E[61]||(E[61]=w("span",{class:"scene-object-kind"},"Spine",-1)),w("button",{class:"scene-object-delete",title:_.$t("scene.deleteSpine"),onClick:tt(C=>I(e).removeSpine(S.id),["stop"])},"✕",8,KV)],10,HV))),128)),!I(e).systems.length&&!I(e).colliders.length&&!I(e).paths.length&&!I(e).spines.length?(Q(),te("div",JV,k(_.$t("scene.empty")),1)):_e("",!0)]),I(s)==="particle"&&I(i)?(Q(),te(Me,{key:0},[w("label",ZV,[w("span",null,k(_.$t("scene.name")),1),pe(w("input",{"onUpdate:modelValue":E[6]||(E[6]=S=>I(i).config.name=S),class:"inp"},null,512),[[Je,I(i).config.name]])]),Te(Ue,{label:_.$t("scene.positionX"),min:-2e3,max:2e3,step:1,modelValue:I(i).config.centerX,"onUpdate:modelValue":E[7]||(E[7]=S=>I(i).config.centerX=S)},null,8,["label","modelValue"]),Te(Ue,{label:_.$t("scene.positionY"),min:-2e3,max:2e3,step:1,modelValue:I(i).config.centerY,"onUpdate:modelValue":E[8]||(E[8]=S=>I(i).config.centerY=S)},null,8,["label","modelValue"]),Te(Ue,{label:_.$t("scene.offsetX"),min:-2e3,max:2e3,step:1,modelValue:I(i).config.offsetX,"onUpdate:modelValue":E[9]||(E[9]=S=>I(i).config.offsetX=S)},null,8,["label","modelValue"]),Te(Ue,{label:_.$t("scene.offsetY"),min:-2e3,max:2e3,step:1,modelValue:I(i).config.offsetY,"onUpdate:modelValue":E[10]||(E[10]=S=>I(i).config.offsetY=S)},null,8,["label","modelValue"]),Te(Ue,{label:_.$t("scene.rotation"),min:-360,max:360,step:1,modelValue:I(i).config.rootRotation,"onUpdate:modelValue":E[11]||(E[11]=S=>I(i).config.rootRotation=S)},null,8,["label","modelValue"]),Te(Ue,{label:_.$t("scene.scaleX"),min:.05,max:10,step:.05,modelValue:I(i).config.rootScaleX,"onUpdate:modelValue":E[12]||(E[12]=S=>I(i).config.rootScaleX=S)},null,8,["label","modelValue"]),Te(Ue,{label:_.$t("scene.scaleY"),min:.05,max:10,step:.05,modelValue:I(i).config.rootScaleY,"onUpdate:modelValue":E[13]||(E[13]=S=>I(i).config.rootScaleY=S)},null,8,["label","modelValue"]),w("div",QV,[w("label",eX,k(_.$t("scene.seed")),1),pe(w("input",{id:"system-seed",class:"seed-input",type:"number",min:"0",step:"1","onUpdate:modelValue":E[14]||(E[14]=S=>I(i).config.seed=S),title:_.$t("scene.seedTitle")},null,8,tX),[[Je,I(i).config.seed,void 0,{number:!0}]]),w("button",{class:"seed-random",title:_.$t("scene.randomizeSeed"),onClick:E[15]||(E[15]=(...S)=>I(b)&&I(b)(...S))},"⚄",8,iX)]),w("div",nX,k(_.$t("scene.seedHint")),1)],64)):I(r)?(Q(),te(Me,{key:1},[w("div",sX,k(_.$t("scene.colliderTitle")),1),w("label",rX,[w("span",null,k(_.$t("scene.colliderName")),1),pe(w("input",{"onUpdate:modelValue":E[16]||(E[16]=S=>I(r).name=S),class:"inp"},null,512),[[Je,I(r).name]])]),w("div",oX,[w("label",aX,[w("span",null,k(_.$t("scene.type")),1),pe(w("select",{"onUpdate:modelValue":E[17]||(E[17]=S=>I(r).shape=S),class:"inp"},[w("option",lX,k(_.$t("scene.circle")),1),w("option",cX,k(_.$t("scene.ellipse")),1),w("option",hX,k(_.$t("scene.rect")),1),w("option",uX,k(_.$t("scene.polygon")),1),w("option",dX,k(_.$t("scene.custom")),1)],512),[[St,I(r).shape]])]),w("label",fX,[w("span",null,k(_.$t("scene.enabled")),1),pe(w("input",{"onUpdate:modelValue":E[18]||(E[18]=S=>I(r).enabled=S),type:"checkbox"},null,512),[[_t,I(r).enabled]])])]),w("div",mX,[w("label",pX,[w("span",null,k(_.$t("scene.xPosition")),1),pe(w("input",{"onUpdate:modelValue":E[19]||(E[19]=S=>I(r).x=S),type:"number",class:"inp"},null,512),[[Je,I(r).x,void 0,{number:!0}]])]),w("label",gX,[w("span",null,k(_.$t("scene.yPosition")),1),pe(w("input",{"onUpdate:modelValue":E[20]||(E[20]=S=>I(r).y=S),type:"number",class:"inp"},null,512),[[Je,I(r).y,void 0,{number:!0}]])])]),Te(Ue,{label:_.$t("scene.rotation"),min:-360,max:360,step:1,modelValue:I(r).rotation,"onUpdate:modelValue":E[21]||(E[21]=S=>I(r).rotation=S)},null,8,["label","modelValue"]),w("div",vX,[w("label",yX,[w("span",null,k(_.$t("scene.scaleXShort")),1),pe(w("input",{"onUpdate:modelValue":E[22]||(E[22]=S=>I(r).scaleX=S),type:"number",min:"0.05",step:"0.05",class:"inp"},null,512),[[Je,I(r).scaleX,void 0,{number:!0}]])]),w("label",bX,[w("span",null,k(_.$t("scene.scaleYShort")),1),pe(w("input",{"onUpdate:modelValue":E[23]||(E[23]=S=>I(r).scaleY=S),type:"number",min:"0.05",step:"0.05",class:"inp"},null,512),[[Je,I(r).scaleY,void 0,{number:!0}]])])]),I(r).shape==="circle"?(Q(),Pt(Ue,{key:0,label:_.$t("scene.radius"),min:1,max:1e3,step:1,modelValue:I(r).radius,"onUpdate:modelValue":E[24]||(E[24]=S=>I(r).radius=S)},null,8,["label","modelValue"])):I(r).shape==="ellipse"?(Q(),te("div",xX,[w("label",wX,[w("span",null,k(_.$t("scene.radiusX")),1),pe(w("input",{"onUpdate:modelValue":E[25]||(E[25]=S=>I(r).radiusX=S),type:"number",min:"1",class:"inp"},null,512),[[Je,I(r).radiusX,void 0,{number:!0}]])]),w("label",SX,[w("span",null,k(_.$t("scene.radiusY")),1),pe(w("input",{"onUpdate:modelValue":E[26]||(E[26]=S=>I(r).radiusY=S),type:"number",min:"1",class:"inp"},null,512),[[Je,I(r).radiusY,void 0,{number:!0}]])])])):(Q(),te("div",_X,[w("label",TX,[w("span",null,k(_.$t("scene.width")),1),pe(w("input",{"onUpdate:modelValue":E[27]||(E[27]=S=>I(r).width=S),type:"number",min:"1",class:"inp"},null,512),[[Je,I(r).width,void 0,{number:!0}]])]),w("label",EX,[w("span",null,k(_.$t("scene.height")),1),pe(w("input",{"onUpdate:modelValue":E[28]||(E[28]=S=>I(r).height=S),type:"number",min:"1",class:"inp"},null,512),[[Je,I(r).height,void 0,{number:!0}]])])])),I(r).shape==="polygon"||I(r).shape==="custom"?(Q(),Pt(Ue,{key:3,label:_.$t("scene.sides"),min:3,max:16,step:1,modelValue:I(r).sides,"onUpdate:modelValue":E[29]||(E[29]=S=>I(r).sides=S)},null,8,["label","modelValue"])):_e("",!0),w("label",CX,[w("span",null,k(_.$t("scene.collisionResponse")),1),pe(w("select",{"onUpdate:modelValue":E[30]||(E[30]=S=>I(r).response=S),class:"inp"},[w("option",MX,k(_.$t("scene.physics")),1),w("option",AX,k(_.$t("scene.pause")),1),w("option",IX,k(_.$t("scene.destroy")),1)],512),[[St,I(r).response]])]),I(r).response==="physics"?(Q(),te("div",PX,[w("label",RX,[w("span",null,k(_.$t("scene.elasticity")),1),pe(w("input",{"onUpdate:modelValue":E[31]||(E[31]=S=>I(r).elasticity=S),type:"number",min:"0",max:"1",step:"0.01",class:"inp"},null,512),[[Je,I(r).elasticity,void 0,{number:!0}]])]),w("label",kX,[w("span",null,k(_.$t("scene.friction")),1),pe(w("input",{"onUpdate:modelValue":E[32]||(E[32]=S=>I(r).friction=S),type:"number",min:"0",max:"1",step:"0.01",class:"inp"},null,512),[[Je,I(r).friction,void 0,{number:!0}]])])])):_e("",!0),w("div",FX,[w("label",LX,[pe(w("input",{"onUpdate:modelValue":E[33]||(E[33]=S=>I(r).followPath=S),type:"checkbox"},null,512),[[_t,I(r).followPath]]),yt(k(_.$t("scene.followPath")),1)]),I(r).followPath?(Q(),te(Me,{key:0},[w("label",OX,[w("span",null,k(_.$t("scene.targetPath")),1),pe(w("select",{"onUpdate:modelValue":E[34]||(E[34]=S=>I(r).followPathId=S),class:"inp"},[w("option",$X,k(_.$t("scene.notSelected")),1),(Q(!0),te(Me,null,It(I(e).paths,S=>(Q(),te("option",{key:S.id,value:S.id},k(S.name),9,NX))),128))],512),[[St,I(r).followPathId,void 0,{number:!0}]])]),w("div",DX,[w("label",BX,[w("span",null,k(_.$t("scene.moveDuration")),1),pe(w("input",{"onUpdate:modelValue":E[35]||(E[35]=S=>I(r).followDuration=S),type:"number",min:"0.05",step:"0.05",class:"inp"},null,512),[[Je,I(r).followDuration,void 0,{number:!0}]])]),w("label",UX,[w("span",null,k(_.$t("appearance.curveMode")),1),pe(w("select",{"onUpdate:modelValue":E[36]||(E[36]=S=>I(r).followCurveMode=S),class:"inp"},[w("option",VX,k(_.$t("common.followExport")),1),w("option",XX,k(_.$t("common.linear")),1),w("option",YX,k(_.$t("common.bezier")),1)],512),[[St,I(r).followCurveMode]])])]),w("label",GX,[pe(w("input",{"onUpdate:modelValue":E[37]||(E[37]=S=>I(r).followPathRotation=S),type:"checkbox"},null,512),[[_t,I(r).followPathRotation]]),yt(k(_.$t("scene.followDirection")),1)]),w("div",HX,[yt(k(_.$t("scene.moveProgressCurve"))+" ",1),w("small",null,k(_.$t("scene.moveProgressHelp")),1)]),Te(bs,{"model-value":I(r).followCurve||I(y),"default-value":I(y),mode:I(t)(I(r).followCurveMode),"onUpdate:modelValue":E[38]||(E[38]=S=>I(r).followCurve=S)},null,8,["model-value","default-value","mode"])],64)):_e("",!0)])],64)):I(o)?(Q(),te(Me,{key:2},[w("div",jX,k(_.$t("scene.pathTitle")),1),w("label",WX,[w("span",null,k(_.$t("scene.pathName")),1),pe(w("input",{"onUpdate:modelValue":E[39]||(E[39]=S=>I(o).name=S),class:"inp"},null,512),[[Je,I(o).name]])]),w("div",zX,[w("label",qX,[w("span",null,k(_.$t("scene.xPosition")),1),pe(w("input",{"onUpdate:modelValue":E[40]||(E[40]=S=>I(o).x=S),type:"number",class:"inp"},null,512),[[Je,I(o).x,void 0,{number:!0}]])]),w("label",KX,[w("span",null,k(_.$t("scene.yPosition")),1),pe(w("input",{"onUpdate:modelValue":E[41]||(E[41]=S=>I(o).y=S),type:"number",class:"inp"},null,512),[[Je,I(o).y,void 0,{number:!0}]])])]),Te(Ue,{label:_.$t("scene.rotation"),min:-360,max:360,step:1,modelValue:I(o).rotation,"onUpdate:modelValue":E[42]||(E[42]=S=>I(o).rotation=S)},null,8,["label","modelValue"]),w("div",JX,[w("label",ZX,[w("span",null,k(_.$t("scene.scaleXShort")),1),pe(w("input",{"onUpdate:modelValue":E[43]||(E[43]=S=>I(o).scaleX=S),type:"number",min:"0.05",step:"0.05",class:"inp"},null,512),[[Je,I(o).scaleX,void 0,{number:!0}]])]),w("label",QX,[w("span",null,k(_.$t("scene.scaleYShort")),1),pe(w("input",{"onUpdate:modelValue":E[44]||(E[44]=S=>I(o).scaleY=S),type:"number",min:"0.05",step:"0.05",class:"inp"},null,512),[[Je,I(o).scaleY,void 0,{number:!0}]])])]),w("label",eY,[w("span",null,k(_.$t("scene.closedPath")),1),pe(w("input",{"onUpdate:modelValue":E[45]||(E[45]=S=>I(o).closed=S),type:"checkbox"},null,512),[[_t,I(o).closed]])]),w("label",tY,[w("span",null,k(_.$t("scene.pathColor")),1),pe(w("input",{"onUpdate:modelValue":E[46]||(E[46]=S=>I(o).color=S),type:"color",class:"path-color"},null,512),[[Je,I(o).color]])]),w("div",iY,[w("span",null,k(_.$t("scene.pathHelp")),1),w("ul",null,[w("li",null,k(_.$t("scene.pathHelpItems.0")),1),w("li",null,k(_.$t("scene.pathHelpItems.1")),1),w("li",null,k(_.$t("scene.pathHelpItems.2")),1),w("li",null,k(_.$t("scene.pathHelpItems.3")),1),w("li",null,k(_.$t("scene.pathHelpItems.4")),1),w("li",null,k(_.$t("scene.pathHelpItems.5")),1),w("li",null,k(_.$t("scene.pathHelpItems.6")),1),w("li",null,k(_.$t("scene.pathHelpItems.7")),1),w("li",null,k(_.$t("scene.pathHelpItems.8")),1),w("li",null,k(_.$t("scene.pathHelpItems.9")),1)])]),w("label",nY,[w("span",null,k(_.$t("scene.applyPresetShape")),1),pe(w("select",{"onUpdate:modelValue":E[47]||(E[47]=S=>I(o).preset=S),class:"inp"},[w("option",sY,k(_.$t("scene.choosePreset")),1),w("option",rY,k(_.$t("scene.circle")),1),w("option",oY,k(_.$t("scene.square")),1),w("option",aY,k(_.$t("scene.polygon")),1),w("option",lY,k(_.$t("scene.star")),1)],512),[[St,I(o).preset]])]),w("button",{class:"path-action primary",onClick:E[48]||(E[48]=(...S)=>I(g)&&I(g)(...S))},k(_.$t("scene.applyPreset")),1),w("button",{class:"path-action",onClick:E[49]||(E[49]=(...S)=>I(v)&&I(v)(...S))},k(_.$t("scene.clearAnchors")),1)],64)):I(a)?(Q(),Pt(dV,{key:3,"spine-object":I(a)},null,8,["spine-object"])):(Q(),te("div",cY,k(_.$t("scene.panelHint")),1))],512),[[Fi,!I(l).scene]])]))}}),uY=li(hY,[["__scopeId","data-v-5573409f"]]),dY={class:"group"},fY={class:"caret"},mY=["title"],pY={class:"group-body"},gY={class:"segs"},vY={class:"segs stream-behavior-segs"},yY={key:2,class:"stream-loop-options"},bY={class:"loop-section-row"},xY={class:"switch-row"},wY=["checked"],SY={key:0,class:"loop-duration-control"},_Y={class:"switch-row loop-duration-toggle"},TY=["checked"],EY={class:"loop-section-duration"},CY=["value","aria-label"],MY={key:1},AY={key:2,class:"loop-auto-duration"},IY={class:"loop-section-row"},PY={class:"switch-row"},RY=["checked"],kY={key:0,class:"loop-duration-control"},FY={class:"switch-row loop-duration-toggle"},LY=["checked"],OY={class:"loop-section-duration"},$Y=["value","aria-label"],NY={key:1},DY={key:2,class:"loop-auto-duration"},BY={key:3,class:"modifier-hint stream-loop-hint"},UY={class:"group"},VY={class:"caret"},XY=["title"],YY={class:"group-body"},GY={class:"row"},HY={value:"point"},jY={value:"circle"},WY={value:"rect"},zY={value:"cone"},qY={value:"path"},KY={class:"row"},JY={value:0},ZY=["value","disabled"],QY={key:0,class:"row"},e6={value:"fixed"},t6={value:"random"},i6={class:"row"},n6={value:"fixed"},s6={value:"random"},r6={key:0,value:"radial"},o6={key:1,value:"path-normal"},a6={key:2,value:"path-tangent"},l6={key:6,class:"switch-row"},c6=qt({__name:"EmissionSection",setup(n){const{store:e,sys:t,automaticLoopDuration:i,loopDurationFrames:s,collapsed:r,toggle:o,setEmitMode:a,setLoopDurationFrames:c,setStreamBehavior:l,setLoopSection:h,setLoopSectionDuration:u,setLoopCustomDuration:d,resetModule:f,select:m,onShapeChange:p,onSpawnPathChange:g}=oo();return(v,b)=>(Q(),te(Me,null,[w("div",dY,[w("div",{class:"group-head",onClick:b[1]||(b[1]=y=>I(o)("emitMode"))},[w("span",fY,k(I(r).emitMode?"▸":"▾"),1),w("span",null,k(v.$t("emission.title")),1),w("button",{class:"group-reset",title:v.$t("emission.reset"),onClick:b[0]||(b[0]=tt(y=>I(f)("emitMode"),["stop"]))},k(v.$t("common.reset")),9,mY)]),pe(w("div",pY,[w("div",gY,[w("button",{class:Pe(["seg",{on:I(t).config.mode==="stream"}]),onClick:b[2]||(b[2]=y=>I(a)("stream"))},k(v.$t("emission.stream")),3),w("button",{class:Pe(["seg",{on:I(t).config.mode==="burst"}]),onClick:b[3]||(b[3]=y=>I(a)("burst"))},k(v.$t("emission.burst")),3)]),I(t).config.mode==="stream"?(Q(),te(Me,{key:0},[w("div",vY,[w("button",{class:Pe(["seg",{on:I(t).config.streamBehavior==="normal"}]),onClick:b[4]||(b[4]=y=>I(l)("normal"))},k(v.$t("emission.normalStream")),3),w("button",{class:Pe(["seg",{on:I(t).config.streamBehavior==="loop"}]),onClick:b[5]||(b[5]=y=>I(l)("loop"))},k(v.$t("emission.loopStream")),3)]),Te(Ue,{label:v.$t("emission.rate"),min:1,max:300,step:1,modelValue:I(t).config.rate,"onUpdate:modelValue":b[6]||(b[6]=y=>I(t).config.rate=y)},null,8,["label","modelValue"]),I(t).config.streamBehavior==="normal"?(Q(),Pt(Ue,{key:0,label:v.$t("emission.duration"),min:1/30,max:60,step:1/30,modelValue:I(t).config.duration,"onUpdate:modelValue":b[7]||(b[7]=y=>I(t).config.duration=y)},null,8,["label","modelValue"])):(Q(),Pt(Ue,{key:1,label:v.$t("emission.loopDuration"),min:1,max:1800,step:1,"model-value":I(s),"onUpdate:modelValue":I(c)},null,8,["label","model-value","onUpdate:modelValue"])),I(t).config.streamBehavior==="loop"?(Q(),te("div",yY,[w("div",bY,[w("label",xY,[w("input",{type:"checkbox",checked:I(t).config.generateLoopStartAnimation,onChange:b[8]||(b[8]=y=>I(h)("start",y))},null,40,wY),b[36]||(b[36]=w("span",{class:"switch-ui"},null,-1)),w("span",null,k(v.$t("emission.generateStart")),1)]),I(t).config.generateLoopStartAnimation?(Q(),te("div",SY,[w("label",_Y,[w("input",{type:"checkbox",checked:I(t).config.loopStartUseCustomDuration,onChange:b[9]||(b[9]=y=>I(d)("start",y))},null,40,TY),b[37]||(b[37]=w("span",{class:"switch-ui"},null,-1)),w("span",null,k(v.$t("emission.customDuration")),1)]),w("label",EY,[I(t).config.loopStartUseCustomDuration?(Q(),te("input",{key:0,value:I(t).config.loopStartDurationFrames,type:"number",min:"1",max:"1800",step:"1","aria-label":v.$t("emission.startLoopDuration"),onChange:b[10]||(b[10]=y=>I(u)("start",y))},null,40,CY)):_e("",!0),I(t).config.loopStartUseCustomDuration?(Q(),te("span",MY,"f")):(Q(),te("span",AY,k(v.$t("emission.auto",{frames:I(i)})),1))])])):_e("",!0)]),w("div",IY,[w("label",PY,[w("input",{type:"checkbox",checked:I(t).config.generateLoopEndAnimation,onChange:b[11]||(b[11]=y=>I(h)("end",y))},null,40,RY),b[38]||(b[38]=w("span",{class:"switch-ui"},null,-1)),w("span",null,k(v.$t("emission.generateEnd")),1)]),I(t).config.generateLoopEndAnimation?(Q(),te("div",kY,[w("label",FY,[w("input",{type:"checkbox",checked:I(t).config.loopEndUseCustomDuration,onChange:b[12]||(b[12]=y=>I(d)("end",y))},null,40,LY),b[39]||(b[39]=w("span",{class:"switch-ui"},null,-1)),w("span",null,k(v.$t("emission.customDuration")),1)]),w("label",OY,[I(t).config.loopEndUseCustomDuration?(Q(),te("input",{key:0,value:I(t).config.loopEndDurationFrames,type:"number",min:"1",max:"1800",step:"1","aria-label":v.$t("emission.endLoopDuration"),onChange:b[13]||(b[13]=y=>I(u)("end",y))},null,40,$Y)):_e("",!0),I(t).config.loopEndUseCustomDuration?(Q(),te("span",NY,"f")):(Q(),te("span",DY,k(v.$t("emission.auto",{frames:I(i)})),1))])])):_e("",!0)])])):_e("",!0),I(t).config.streamBehavior==="loop"?(Q(),te("div",BY,k(v.$t("emission.loopWarning")),1)):_e("",!0)],64)):(Q(),Pt(Ue,{key:1,label:v.$t("emission.burstCount"),min:1,max:1e3,step:1,modelValue:I(t).config.burstCount,"onUpdate:modelValue":b[14]||(b[14]=y=>I(t).config.burstCount=y)},null,8,["label","modelValue"])),Te(Ue,{label:v.$t("emission.delay"),min:0,max:5,step:.1,modelValue:I(t).config.delay,"onUpdate:modelValue":b[15]||(b[15]=y=>I(t).config.delay=y)},null,8,["label","modelValue"])],512),[[Fi,!I(r).emitMode]])]),w("div",UY,[w("div",{class:"group-head",onClick:b[17]||(b[17]=y=>I(o)("shape"))},[w("span",VY,k(I(r).shape?"▸":"▾"),1),w("span",null,k(v.$t("emission.shapeTitle")),1),w("button",{class:"group-reset",title:v.$t("emission.shapeReset"),onClick:b[16]||(b[16]=tt(y=>I(f)("shape"),["stop"]))},k(v.$t("common.reset")),9,XY)]),pe(w("div",YY,[w("label",GY,[w("span",null,k(v.$t("emission.shape")),1),pe(w("select",{"onUpdate:modelValue":b[18]||(b[18]=y=>I(t).config.shape=y),class:"inp",onChange:b[19]||(b[19]=(...y)=>I(p)&&I(p)(...y))},[w("option",HY,k(v.$t("emission.point")),1),w("option",jY,k(v.$t("emission.circle")),1),w("option",WY,k(v.$t("emission.rect")),1),w("option",zY,k(v.$t("emission.cone")),1),w("option",qY,k(v.$t("emission.path")),1)],544),[[St,I(t).config.shape]])]),I(t).config.shape==="circle"||I(t).config.shape==="cone"?(Q(),te(Me,{key:0},[Te(Ue,{label:I(t).config.shape==="cone"?v.$t("emission.innerDiameter"):v.$t("emission.innerRadius"),min:0,max:I(t).config.outerRadius,step:1,modelValue:I(t).config.innerRadius,"onUpdate:modelValue":b[20]||(b[20]=y=>I(t).config.innerRadius=y)},null,8,["label","max","modelValue"]),Te(Ue,{label:I(t).config.shape==="cone"?v.$t("emission.outerDiameter"):v.$t("emission.outerRadius"),min:I(t).config.innerRadius,max:300,step:1,modelValue:I(t).config.outerRadius,"onUpdate:modelValue":b[21]||(b[21]=y=>I(t).config.outerRadius=y)},null,8,["label","min","modelValue"])],64)):_e("",!0),I(t).config.shape==="cone"?(Q(),te(Me,{key:1},[Te(Ue,{label:v.$t("emission.coneDirection"),min:-360,max:360,step:1,modelValue:I(t).config.coneDirection,"onUpdate:modelValue":b[22]||(b[22]=y=>I(t).config.coneDirection=y)},null,8,["label","modelValue"]),Te(Ue,{label:v.$t("emission.coneAngle"),min:1,max:360,step:1,modelValue:I(t).config.coneAngle,"onUpdate:modelValue":b[23]||(b[23]=y=>I(t).config.coneAngle=y)},null,8,["label","modelValue"])],64)):I(t).config.shape==="rect"?(Q(),te(Me,{key:2},[Te(Ue,{label:v.$t("emission.innerWidth"),min:0,max:I(t).config.outerRectW,step:1,modelValue:I(t).config.innerRectW,"onUpdate:modelValue":b[24]||(b[24]=y=>I(t).config.innerRectW=y)},null,8,["label","max","modelValue"]),Te(Ue,{label:v.$t("emission.innerHeight"),min:0,max:I(t).config.outerRectH,step:1,modelValue:I(t).config.innerRectH,"onUpdate:modelValue":b[25]||(b[25]=y=>I(t).config.innerRectH=y)},null,8,["label","max","modelValue"]),Te(Ue,{label:v.$t("emission.outerWidth"),min:I(t).config.innerRectW,max:400,step:1,modelValue:I(t).config.outerRectW,"onUpdate:modelValue":b[26]||(b[26]=y=>I(t).config.outerRectW=y)},null,8,["label","min","modelValue"]),Te(Ue,{label:v.$t("emission.outerHeight"),min:I(t).config.innerRectH,max:400,step:1,modelValue:I(t).config.outerRectH,"onUpdate:modelValue":b[27]||(b[27]=y=>I(t).config.outerRectH=y)},null,8,["label","min","modelValue"])],64)):I(t).config.shape==="path"?(Q(),te(Me,{key:3},[w("label",KY,[w("span",null,k(v.$t("emission.selectPath")),1),pe(w("select",{"onUpdate:modelValue":b[28]||(b[28]=y=>I(t).config.spawnPathId=y),class:"inp",onChange:b[29]||(b[29]=(...y)=>I(g)&&I(g)(...y))},[w("option",JY,k(v.$t("emission.noPath")),1),(Q(!0),te(Me,null,It(I(e).paths,y=>(Q(),te("option",{key:y.id,value:y.id,disabled:!y.enabled},k(y.name),9,ZY))),128))],544),[[St,I(t).config.spawnPathId,void 0,{number:!0}]])]),I(t).config.spawnPathId>0?(Q(),te("label",QY,[w("span",null,k(v.$t("emission.birthDistribution")),1),pe(w("select",{"onUpdate:modelValue":b[30]||(b[30]=y=>I(t).config.spawnPathDistribution=y),class:"inp"},[w("option",e6,k(v.$t("emission.evenDistribution")),1),w("option",t6,k(v.$t("emission.randomDistribution")),1)],512),[[St,I(t).config.spawnPathDistribution]])])):_e("",!0)],64)):_e("",!0),b[41]||(b[41]=w("div",{class:"divider"},null,-1)),w("label",i6,[w("span",null,k(v.$t("emission.emissionAngle")),1),pe(w("select",{"onUpdate:modelValue":b[31]||(b[31]=y=>I(t).config.emissionAngleMode=y),class:"inp"},[w("option",n6,k(v.$t("common.fixed")),1),w("option",s6,k(v.$t("common.random")),1),I(t).config.shape==="circle"||I(t).config.shape==="rect"||I(t).config.shape==="cone"?(Q(),te("option",r6,k(v.$t("emission.radial")),1)):_e("",!0),I(t).config.shape==="path"&&I(t).config.spawnPathId>0?(Q(),te("option",o6,k(v.$t("emission.pathNormal")),1)):_e("",!0),I(t).config.shape==="path"&&I(t).config.spawnPathId>0?(Q(),te("option",a6,k(v.$t("emission.pathTangent")),1)):_e("",!0)],512),[[St,I(t).config.emissionAngleMode]])]),I(t).config.emissionAngleMode==="fixed"?(Q(),Pt(Ue,{key:4,label:v.$t("emission.fixedAngle"),min:-360,max:360,step:1,modelValue:I(t).config.direction,"onUpdate:modelValue":b[32]||(b[32]=y=>I(t).config.direction=y)},null,8,["label","modelValue"])):I(t).config.emissionAngleMode==="random"?(Q(),te(Me,{key:5},[Te(Ue,{label:v.$t("emission.baseAngle"),min:-360,max:360,step:1,modelValue:I(t).config.direction,"onUpdate:modelValue":b[33]||(b[33]=y=>I(t).config.direction=y)},null,8,["label","modelValue"]),Te(Ue,{label:v.$t("emission.randomRange"),min:0,max:360,step:1,modelValue:I(t).config.spread,"onUpdate:modelValue":b[34]||(b[34]=y=>I(t).config.spread=y)},null,8,["label","modelValue"])],64)):_e("",!0),I(t).config.shape!=="point"?(Q(),te("label",l6,[pe(w("input",{type:"checkbox","onUpdate:modelValue":b[35]||(b[35]=y=>I(t).config.showShape=y)},null,512),[[_t,I(t).config.showShape]]),b[40]||(b[40]=w("span",{class:"switch-ui"},null,-1)),w("span",null,k(v.$t("emission.showShape")),1)])):_e("",!0)],512),[[Fi,!I(r).shape]])])],64))}}),h6=li(c6,[["__scopeId","data-v-dec7323c"]]),u6={class:"pac"},d6={class:"pac-head"},f6={class:"pac-label"},m6={key:0,class:"pac-modes"},p6=["onClick"],g6={class:"pac-range"},v6={class:"pac-curve"},y6={class:"pac-axis"},b6=qt({__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(n){const e=n,{t}=fn(),i=Fe(()=>{const s=[{label:t("common.fixed"),value:"fixed"},{label:t("common.random"),value:"random"}];return e.allowCurve&&s.push({label:t("common.curve"),value:"curve"}),e.allowDirection&&s.push({label:t("attributeControl.direction"),value:"direction"}),s});return(s,r)=>(Q(),te("div",u6,[w("div",d6,[w("span",f6,k(n.label),1),n.showModes?(Q(),te("div",m6,[(Q(!0),te(Me,null,It(i.value,o=>(Q(),te("button",{key:o.value,class:Pe(["pac-mode",{on:n.mode===o.value}]),onClick:a=>s.$emit("update:mode",o.value)},k(o.label),11,p6))),128))])):_e("",!0)]),n.mode==="fixed"||n.mode==="direction"?(Q(),Pt(Ue,{key:0,label:n.mode==="direction"?s.$t("attributeControl.angleOffset"):s.$t("attributeControl.value"),min:n.min,max:n.max,step:n.step,"model-value":n.valueMin,"onUpdate:modelValue":r[0]||(r[0]=o=>s.$emit("update:valueMin",o))},null,8,["label","min","max","step","model-value"])):n.mode==="random"?(Q(),te(Me,{key:1},[Te(Ue,{label:s.$t("attributeControl.lower"),min:n.min,max:n.max,step:n.step,"model-value":n.valueMin,"onUpdate:modelValue":r[1]||(r[1]=o=>s.$emit("update:valueMin",o))},null,8,["label","min","max","step","model-value"]),Te(Ue,{label:s.$t("attributeControl.upper"),min:n.min,max:n.max,step:n.step,"model-value":n.valueMax,"onUpdate:modelValue":r[2]||(r[2]=o=>s.$emit("update:valueMax",o))},null,8,["label","min","max","step","model-value"])],64)):(Q(),te(Me,{key:2},[w("div",g6,[Te(Ue,{label:s.$t("attributeControl.rangeLower"),min:n.min,max:n.max,step:n.step,"model-value":n.valueMin,"onUpdate:modelValue":r[3]||(r[3]=o=>s.$emit("update:valueMin",o))},null,8,["label","min","max","step","model-value"]),Te(Ue,{label:s.$t("attributeControl.rangeUpper"),min:n.min,max:n.max,step:n.step,"model-value":n.valueMax,"onUpdate:modelValue":r[4]||(r[4]=o=>s.$emit("update:valueMax",o))},null,8,["label","min","max","step","model-value"])]),w("div",v6,[Te(bs,{"model-value":n.curve,"default-value":n.defaultCurve,"onUpdate:modelValue":r[5]||(r[5]=o=>s.$emit("update:curve",o))},null,8,["model-value","default-value"]),w("div",y6,[r[6]||(r[6]=w("span",null,"0",-1)),w("span",null,k(n.curveLabel||s.$t("attributeControl.curveInput")),1),r[7]||(r[7]=w("span",null,"1",-1))])])],64))]))}}),Us=li(b6,[["__scopeId","data-v-a3a8dde3"]]),x6={class:"group"},w6={class:"caret"},S6=["title"],_6={class:"group-body attr-body"},T6={class:"attr-section-title"},E6={class:"attr-axis-head"},C6={class:"axis-modes"},M6={class:"attr-section-title life-title"},A6={class:"life-item"},I6={class:"switch-row"},P6={class:"life-item"},R6={class:"switch-row"},k6={class:"axis-modes life-axis"},F6={class:"life-item"},L6={class:"switch-row"},O6=qt({__name:"ParticleAttributesSection",setup(n){const{sys:e,collapsed:t,toggle:i,resetModule:s,setSpeedOverLifeMode:r,prepareScaleOverLifeCurve:o,setScaleOverLifeMode:a,LINEAR_CURVE:c,FLAT_CURVE:l}=oo();return(h,u)=>(Q(),te("div",x6,[w("div",{class:"group-head",onClick:u[1]||(u[1]=d=>I(i)("attr"))},[w("span",w6,k(I(t).attr?"▸":"▾"),1),w("span",null,k(h.$t("attributes.title")),1),w("button",{class:"group-reset",title:h.$t("attributes.reset"),onClick:u[0]||(u[0]=tt(d=>I(s)("attr"),["stop"]))},k(h.$t("common.reset")),9,S6)]),pe(w("div",_6,[w("div",T6,k(h.$t("attributes.initialParams")),1),Te(Us,{label:h.$t("attributes.initialLife"),"allow-curve":!1,mode:I(e).config.lifeMode,"onUpdate:mode":u[2]||(u[2]=d=>I(e).config.lifeMode=d),"value-min":I(e).config.lifeMin,"onUpdate:valueMin":u[3]||(u[3]=d=>I(e).config.lifeMin=d),"value-max":I(e).config.lifeMax,"onUpdate:valueMax":u[4]||(u[4]=d=>I(e).config.lifeMax=d),curve:I(e).config.lifeCurve,"onUpdate:curve":u[5]||(u[5]=d=>I(e).config.lifeCurve=d),min:.1,max:10,step:.1,"curve-label":h.$t("attributes.randomSample")},null,8,["label","mode","value-min","value-max","curve","curve-label"]),Te(Us,{label:h.$t("attributes.initialSpeed"),"allow-curve":!1,mode:I(e).config.speedMode,"onUpdate:mode":u[6]||(u[6]=d=>I(e).config.speedMode=d),"value-min":I(e).config.speedMin,"onUpdate:valueMin":u[7]||(u[7]=d=>I(e).config.speedMin=d),"value-max":I(e).config.speedMax,"onUpdate:valueMax":u[8]||(u[8]=d=>I(e).config.speedMax=d),curve:I(e).config.speedCurve,"onUpdate:curve":u[9]||(u[9]=d=>I(e).config.speedCurve=d),min:0,max:1e3,step:1,"curve-label":h.$t("attributes.randomSample")},null,8,["label","mode","value-min","value-max","curve","curve-label"]),w("div",E6,[w("span",null,k(h.$t("attributes.initialScale")),1),w("div",C6,[w("button",{class:Pe(["axis-mode",{on:I(e).config.scaleAxisMode==="uniform"}]),onClick:u[10]||(u[10]=d=>I(e).config.scaleAxisMode="uniform")},k(h.$t("attributes.uniform")),3),w("button",{class:Pe(["axis-mode",{on:I(e).config.scaleAxisMode==="separate"}]),onClick:u[11]||(u[11]=d=>I(e).config.scaleAxisMode="separate")},k(h.$t("attributes.separateXY")),3)])]),Te(Us,{label:I(e).config.scaleAxisMode==="uniform"?h.$t("attributes.initialScale"):h.$t("attributes.scaleX"),"allow-curve":!1,mode:I(e).config.scaleMode,"onUpdate:mode":u[12]||(u[12]=d=>I(e).config.scaleMode=d),"value-min":I(e).config.scaleMin,"onUpdate:valueMin":u[13]||(u[13]=d=>I(e).config.scaleMin=d),"value-max":I(e).config.scaleMax,"onUpdate:valueMax":u[14]||(u[14]=d=>I(e).config.scaleMax=d),curve:I(e).config.scaleCurve,"onUpdate:curve":u[15]||(u[15]=d=>I(e).config.scaleCurve=d),min:0,max:5,step:.05,"curve-label":h.$t("attributes.randomSample")},null,8,["label","mode","value-min","value-max","curve","curve-label"]),I(e).config.scaleAxisMode==="separate"?(Q(),Pt(Us,{key:0,label:h.$t("attributes.scaleY"),"show-modes":!1,"allow-curve":!1,mode:I(e).config.scaleMode,"onUpdate:mode":u[16]||(u[16]=d=>I(e).config.scaleMode=d),"value-min":I(e).config.scaleYMin,"onUpdate:valueMin":u[17]||(u[17]=d=>I(e).config.scaleYMin=d),"value-max":I(e).config.scaleYMax,"onUpdate:valueMax":u[18]||(u[18]=d=>I(e).config.scaleYMax=d),curve:I(e).config.scaleYCurve,"onUpdate:curve":u[19]||(u[19]=d=>I(e).config.scaleYCurve=d),min:0,max:5,step:.05,"curve-label":h.$t("attributes.randomSample")},null,8,["label","mode","value-min","value-max","curve","curve-label"])):_e("",!0),Te(Us,{label:h.$t("attributes.initialRotation"),"allow-direction":"","allow-curve":!1,mode:I(e).config.initialRotationMode,"onUpdate:mode":u[20]||(u[20]=d=>I(e).config.initialRotationMode=d),"value-min":I(e).config.initialRotationMin,"onUpdate:valueMin":u[21]||(u[21]=d=>I(e).config.initialRotationMin=d),"value-max":I(e).config.initialRotationMax,"onUpdate:valueMax":u[22]||(u[22]=d=>I(e).config.initialRotationMax=d),curve:I(e).config.initialRotationCurve,"onUpdate:curve":u[23]||(u[23]=d=>I(e).config.initialRotationCurve=d),min:-360,max:360,step:1,"curve-label":h.$t("attributes.randomSample")},null,8,["label","mode","value-min","value-max","curve","curve-label"]),w("div",M6,k(h.$t("attributes.lifecycleTitle")),1),w("div",A6,[w("label",I6,[pe(w("input",{type:"checkbox","onUpdate:modelValue":u[24]||(u[24]=d=>I(e).config.speedOverLifeEnabled=d)},null,512),[[_t,I(e).config.speedOverLifeEnabled]]),u[44]||(u[44]=w("span",{class:"switch-ui"},null,-1)),w("span",null,k(h.$t("attributes.speedOverLife")),1)]),I(e).config.speedOverLifeEnabled?(Q(),Pt(Us,{key:0,label:h.$t("attributes.speedMultiplier"),mode:I(e).config.speedOverLifeMode,"onUpdate:mode":I(r),"value-min":I(e).config.speedOverLifeMin,"onUpdate:valueMin":u[25]||(u[25]=d=>I(e).config.speedOverLifeMin=d),"value-max":I(e).config.speedOverLifeMax,"onUpdate:valueMax":u[26]||(u[26]=d=>I(e).config.speedOverLifeMax=d),curve:I(e).config.speedOverLifeCurve,"onUpdate:curve":u[27]||(u[27]=d=>I(e).config.speedOverLifeCurve=d),"default-curve":I(l),min:0,max:3,step:.05,"curve-label":h.$t("attributes.lifeTo")},null,8,["label","mode","onUpdate:mode","value-min","value-max","curve","default-curve","curve-label"])):_e("",!0)]),w("div",P6,[w("label",R6,[pe(w("input",{type:"checkbox","onUpdate:modelValue":u[28]||(u[28]=d=>I(e).config.scaleOverLifeEnabled=d),onChange:u[29]||(u[29]=(...d)=>I(o)&&I(o)(...d))},null,544),[[_t,I(e).config.scaleOverLifeEnabled]]),u[45]||(u[45]=w("span",{class:"switch-ui"},null,-1)),w("span",null,k(h.$t("attributes.scaleOverLife")),1)]),I(e).config.scaleOverLifeEnabled?(Q(),te(Me,{key:0},[w("div",k6,[w("button",{class:Pe(["axis-mode",{on:I(e).config.scaleOverLifeAxisMode==="uniform"}]),onClick:u[30]||(u[30]=d=>I(e).config.scaleOverLifeAxisMode="uniform")},k(h.$t("attributes.uniform")),3),w("button",{class:Pe(["axis-mode",{on:I(e).config.scaleOverLifeAxisMode==="separate"}]),onClick:u[31]||(u[31]=d=>I(e).config.scaleOverLifeAxisMode="separate")},k(h.$t("attributes.separateXY")),3)]),Te(Us,{label:I(e).config.scaleOverLifeAxisMode==="uniform"?h.$t("attributes.scaleMultiplier"):h.$t("attributes.multiplierX"),mode:I(e).config.scaleOverLifeMode,"onUpdate:mode":I(a),"value-min":I(e).config.scaleOverLifeMin,"onUpdate:valueMin":u[32]||(u[32]=d=>I(e).config.scaleOverLifeMin=d),"value-max":I(e).config.scaleOverLifeMax,"onUpdate:valueMax":u[33]||(u[33]=d=>I(e).config.scaleOverLifeMax=d),curve:I(e).config.scaleOverLifeCurve,"onUpdate:curve":u[34]||(u[34]=d=>I(e).config.scaleOverLifeCurve=d),"default-curve":I(l),min:0,max:3,step:.05,"curve-label":h.$t("attributes.lifeTo")},null,8,["label","mode","onUpdate:mode","value-min","value-max","curve","default-curve","curve-label"]),I(e).config.scaleOverLifeAxisMode==="separate"?(Q(),Pt(Us,{key:0,label:h.$t("attributes.multiplierY"),"show-modes":!1,mode:I(e).config.scaleOverLifeMode,"onUpdate:mode":u[35]||(u[35]=d=>I(e).config.scaleOverLifeMode=d),"value-min":I(e).config.scaleYOverLifeMin,"onUpdate:valueMin":u[36]||(u[36]=d=>I(e).config.scaleYOverLifeMin=d),"value-max":I(e).config.scaleYOverLifeMax,"onUpdate:valueMax":u[37]||(u[37]=d=>I(e).config.scaleYOverLifeMax=d),curve:I(e).config.scaleYOverLifeCurve,"onUpdate:curve":u[38]||(u[38]=d=>I(e).config.scaleYOverLifeCurve=d),"default-curve":I(l),min:0,max:3,step:.05,"curve-label":h.$t("attributes.lifeTo")},null,8,["label","mode","value-min","value-max","curve","default-curve","curve-label"])):_e("",!0)],64)):_e("",!0)]),w("div",F6,[w("label",L6,[pe(w("input",{type:"checkbox","onUpdate:modelValue":u[39]||(u[39]=d=>I(e).config.rotationOverLifeEnabled=d)},null,512),[[_t,I(e).config.rotationOverLifeEnabled]]),u[46]||(u[46]=w("span",{class:"switch-ui"},null,-1)),w("span",null,k(h.$t("attributes.rotationOverLife")),1)]),I(e).config.rotationOverLifeEnabled?(Q(),Pt(Us,{key:0,label:h.$t("attributes.rotationSpeed"),mode:I(e).config.rotationOverLifeMode,"onUpdate:mode":u[40]||(u[40]=d=>I(e).config.rotationOverLifeMode=d),"value-min":I(e).config.rotationSpeedMin,"onUpdate:valueMin":u[41]||(u[41]=d=>I(e).config.rotationSpeedMin=d),"value-max":I(e).config.rotationSpeedMax,"onUpdate:valueMax":u[42]||(u[42]=d=>I(e).config.rotationSpeedMax=d),curve:I(e).config.rotationOverLifeCurve,"onUpdate:curve":u[43]||(u[43]=d=>I(e).config.rotationOverLifeCurve=d),"default-curve":I(c),min:-720,max:720,step:10,"curve-label":h.$t("attributes.lifeTo")},null,8,["label","mode","value-min","value-max","curve","default-curve","curve-label"])):_e("",!0)])],512),[[Fi,!I(t).attr]])]))}}),$6=li(O6,[["__scopeId","data-v-3bbf0b5e"]]),N6={class:"gradient-editor"},D6=["title"],B6=["title","onClick","onDblclick","onPointerdown"],U6={key:0,class:"gradient-controls"},V6=["value","aria-label"],X6=["value","aria-label"],Y6={class:"gradient-position"},G6=["value","aria-label"],H6=["title"],j6=["title","disabled"],W6={class:"gradient-hint"},z6=qt({__name:"ColorGradientEditor",props:{modelValue:{}},emits:["update:modelValue"],setup(n,{emit:e}){const t=n,i=e,s=De(null),r=De(0),o=Fe(()=>t.modelValue[r.value]||null),a=Fe(()=>[...t.modelValue].sort((C,M)=>C.position-M.position)),c=Fe(()=>{const C=a.value;return C.length?`linear-gradient(90deg, ${C.map(M=>`${M.color} ${l(M.position)*100}%`).join(", ")})`:"#ffffff"});ei(()=>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 h(){return t.modelValue.map(C=>({position:l(C.position),color:C.color}))}function u(C,M){const P=h();P[C]&&(P[C]={...P[C],...M},i("update:modelValue",P))}function d(C){u(r.value,{color:C.target.value})}function f(C){var A;const M=C.target,P=S(M.value,((A=o.value)==null?void 0:A.color)||"#ffffff");M.value=P,u(r.value,{color:P})}function m(C){const M=C.target;f(C),M.blur()}function p(C){const M=Number(C.target.value);Number.isFinite(M)&&u(r.value,{position:l(M/100)})}function g(C){const M=h();M.push({position:l(C),color:_(M,C)}),r.value=M.length-1,i("update:modelValue",M)}function v(C){if(!s.value)return;const M=s.value.getBoundingClientRect();g((C.clientX-M.left)/Math.max(1,M.width))}function b(){const C=a.value;let M=.5;if(C.length>1){let P=-1;for(let A=0;AP&&(P=R,M=(C[A].position+C[A+1].position)/2)}}g(M)}function y(C){if(t.modelValue.length<=2||C<0)return;const M=h().filter((P,A)=>A!==C);r.value=Math.min(C,M.length-1),i("update:modelValue",M)}function x(C,M){if(!s.value)return;r.value=M;const P=R=>{const B=s.value.getBoundingClientRect();u(M,{position:l((R.clientX-B.left)/Math.max(1,B.width))})},A=()=>{window.removeEventListener("pointermove",P),window.removeEventListener("pointerup",A),window.removeEventListener("pointercancel",A)};window.addEventListener("pointermove",P),window.addEventListener("pointerup",A),window.addEventListener("pointercancel",A),C.preventDefault()}function _(C,M){const P=[...C].sort((A,R)=>A.position-R.position);if(!P.length)return"#ffffff";if(M<=P[0].position)return P[0].color;if(M>=P[P.length-1].position)return P[P.length-1].color;for(let A=0;AB.position)continue;const O=(M-R.position)/Math.max(1e-4,B.position-R.position);return E(R.color,B.color,O)}return P[P.length-1].color}function E(C,M,P){const A=W=>{const V=parseInt(W.replace("#","").padEnd(6,"0").slice(0,6),16);return[V>>16&255,V>>8&255,V&255]},R=A(C),B=A(M),O=W=>Math.round(R[W]+(B[W]-R[W])*P);return`#${[O(0),O(1),O(2)].map(W=>W.toString(16).padStart(2,"0")).join("")}`}function S(C,M){let P=C.trim().replace(/^#/,"");return/^[0-9a-f]{3}$/i.test(P)&&(P=P.split("").map(A=>A+A).join("")),/^[0-9a-f]{6}$/i.test(P)?`#${P.toLowerCase()}`:M}return(C,M)=>(Q(),te("div",N6,[w("div",{ref_key:"bar",ref:s,class:"gradient-bar",style:Vt({background:c.value}),title:C.$t("gradient.addTitle"),onDblclick:v},[(Q(!0),te(Me,null,It(n.modelValue,(P,A)=>(Q(),te("button",{key:A,type:"button",class:Pe(["gradient-stop",{selected:A===r.value}]),style:Vt({left:`${l(P.position)*100}%`,"--stop-color":P.color}),title:`${Math.round(l(P.position)*100)}% · ${P.color}`,onClick:tt(R=>r.value=A,["stop"]),onDblclick:tt(R=>y(A),["stop"]),onPointerdown:tt(R=>x(R,A),["stop"])},null,46,B6))),128))],44,D6),o.value?(Q(),te("div",U6,[w("input",{type:"color",class:"gradient-color",value:o.value.color,"aria-label":C.$t("gradient.color"),onInput:d},null,40,V6),w("input",{type:"text",class:"gradient-hex-input",value:o.value.color,"aria-label":C.$t("gradient.colorValue"),spellcheck:"false",onChange:f,onKeydown:Wr(m,["enter"])},null,40,X6),w("label",Y6,[w("input",{type:"number",min:"0",max:"100",step:"1",value:Math.round(l(o.value.position)*100),"aria-label":C.$t("gradient.position"),onInput:p},null,40,G6),M[1]||(M[1]=w("span",null,"%",-1))]),w("button",{type:"button",class:"gradient-action",title:C.$t("gradient.addMiddle"),onClick:b},"+",8,H6),w("button",{type:"button",class:"gradient-action danger",title:C.$t("gradient.delete"),disabled:n.modelValue.length<=2,onClick:M[0]||(M[0]=P=>y(r.value))},"×",8,j6)])):_e("",!0),w("div",W6,k(C.$t("gradient.hint")),1)]))}}),RE=li(z6,[["__scopeId","data-v-cb6cfaf8"]]),q6={class:"pivot-toolbar"},K6={class:"pivot-hint"},J6={class:"pivot-zoom"},Z6=["disabled","title"],Q6=["disabled","title"],eG=["title"],tG=["title"],iG=["src","alt"],nG={key:2,class:"pivot-empty"},sG={class:"pivot-bottom"},rG={class:"pivot-card"},oG={class:"pivot-presets"},aG=["title","aria-label","onClick"],lG={class:"pivot-card"},cG={class:"pivot-card-head"},hG={class:"pivot-coords"},uG=["value"],dG=["value"],fG={class:"pivot-card-head pivot-rotate-head"},mG={class:"pivot-rotate-state"},pG={class:"pivot-rotate-body"},gG={class:"pivot-rotate-modes"},vG={class:"pivot-rotate-preview"},yG=["src","alt"],wm=1e3,bG=qt({__name:"PivotEditor",props:{previewUrl:{},anchorX:{},anchorY:{},large:{type:Boolean,default:!1}},emits:["update:anchorX","update:anchorY","fullscreen"],setup(n,{emit:e}){const t=n,i=e,{t:s}=fn(),r=Fe(()=>[{icon:"↖",label:s("pivot.topLeft"),x:0,y:0},{icon:"↑",label:s("pivot.top"),x:50,y:0},{icon:"↗",label:s("pivot.topRight"),x:100,y:0},{icon:"←",label:s("pivot.left"),x:0,y:50},{icon:"◯",label:s("pivot.center"),x:50,y:50},{icon:"→",label:s("pivot.right"),x:100,y:50},{icon:"↙",label:s("pivot.bottomLeft"),x:0,y:100},{icon:"↓",label:s("pivot.bottom"),x:50,y:100},{icon:"↘",label:s("pivot.bottomRight"),x:100,y:100}]),o=De(null),a=De(null),c=De({w:0,h:0}),l=De({w:1,h:1}),h=De(100),u=De({x:0,y:0}),d=De(!1),f=De("static");let m=null;const p=L=>Math.min(wm,Math.max(-wm,Number.isFinite(L)?L:0)),g=Fe(()=>p(t.anchorX*100).toFixed(1)),v=Fe(()=>p(t.anchorY*100).toFixed(1));function b(L,N){const F=l.value.w/Math.max(1,l.value.h);let D=L,X=D/F;return X>N&&(X=N,D=X*F),{w:Math.max(1,D),h:Math.max(1,X)}}const y=Fe(()=>{const L=t.large?26:12,N=Math.max(1,c.value.w-L*2),F=Math.max(1,c.value.h-L*2);return b(N,F)}),x=Fe(()=>({width:`${y.value.w}px`,height:`${y.value.h}px`,transform:`translate(${u.value.x}px, ${u.value.y}px) scale(${h.value/100})`})),_=Fe(()=>{const L=h.value/100;return{x:c.value.w/2+u.value.x+(p(t.anchorX*100)/100-.5)*y.value.w*L,y:c.value.h/2+u.value.y+(p(t.anchorY*100)/100-.5)*y.value.h*L}}),E=Fe(()=>{const L=t.large?128:72,N=b(L,L);return{width:`${N.w}px`,height:`${N.h}px`,transformOrigin:`${p(t.anchorX*100)}% ${p(t.anchorY*100)}%`}});function S(L,N){const F=wm/100;i("update:anchorX",Math.min(F,Math.max(-F,Number.isFinite(L)?L:0))),i("update:anchorY",Math.min(F,Math.max(-F,Number.isFinite(N)?N:0)))}function C(L){const N=a.value;if(!N)return;const F=N.getBoundingClientRect();F.width<=0||F.height<=0||S((L.clientX-F.left)/F.width,(L.clientY-F.top)/F.height)}function M(L){if(!t.previewUrl)return;if(L.button===2){P(L);return}if(L.button!==0)return;L.preventDefault(),C(L);const N=D=>C(D),F=()=>{window.removeEventListener("pointermove",N),window.removeEventListener("pointerup",F),window.removeEventListener("pointercancel",F)};window.addEventListener("pointermove",N),window.addEventListener("pointerup",F),window.addEventListener("pointercancel",F)}function P(L){L.preventDefault(),d.value=!0;const N=L.clientX,F=L.clientY,D=u.value.x,X=u.value.y,G=J=>{u.value={x:D+J.clientX-N,y:X+J.clientY-F}},K=()=>{d.value=!1,window.removeEventListener("pointermove",G),window.removeEventListener("pointerup",K),window.removeEventListener("pointercancel",K)};window.addEventListener("pointermove",G),window.addEventListener("pointerup",K),window.addEventListener("pointercancel",K)}function A(L){const N=L.deltaY<0?1.12:.8928571428571428,F=Math.min(400,Math.max(100,Math.round(h.value*N)));if(F===h.value)return;const D=o.value;if(!D){h.value=F;return}const X=D.getBoundingClientRect(),G=L.clientX-X.left,K=L.clientY-X.top,J=F/h.value;u.value={x:u.value.x+(G-X.width/2-u.value.x)*(1-J),y:u.value.y+(K-X.height/2-u.value.y)*(1-J)},h.value=F}function R(L){const N=L.target;l.value={w:N.naturalWidth||1,h:N.naturalHeight||1}}function B(L){h.value=Math.min(400,Math.max(100,h.value+L))}function O(){S(.5,.5)}function W(L){S(L.x/100,L.y/100)}function V(L){return Math.abs(p(t.anchorX*100)-L.x)<.05&&Math.abs(p(t.anchorY*100)-L.y)<.05}function Y(L,N){const F=p(Number(N.target.value));i(L==="x"?"update:anchorX":"update:anchorY",F/100)}return ei(()=>t.previewUrl,()=>{l.value={w:1,h:1},u.value={x:0,y:0},h.value=100}),Sn(()=>{o.value&&(m=new ResizeObserver(L=>{var F;const N=(F=L[0])==null?void 0:F.contentRect;N&&(c.value={w:N.width,h:N.height})}),m.observe(o.value))}),eo(()=>{m==null||m.disconnect(),m=null}),(L,N)=>(Q(),te("div",{class:Pe(["pivot-editor",{"pivot-large":n.large}])},[w("div",q6,[w("div",K6,[N[9]||(N[9]=w("span",{class:"pivot-hint-icon"},"⊕",-1)),w("span",null,k(L.$t("pivot.title")),1)]),w("div",J6,[w("button",{type:"button",disabled:h.value<=100,title:L.$t("pivot.zoomOut"),onClick:N[0]||(N[0]=F=>B(-25))},"−",8,Z6),w("span",null,k(h.value)+"%",1),w("button",{type:"button",disabled:h.value>=400,title:L.$t("pivot.zoomIn"),onClick:N[1]||(N[1]=F=>B(25))},"+",8,Q6)]),n.large?_e("",!0):(Q(),te("button",{key:0,type:"button",class:"pivot-expand",title:L.$t("pivot.expand"),onClick:N[2]||(N[2]=F=>L.$emit("fullscreen"))},"⤢",8,eG))]),w("div",{ref_key:"stageRef",ref:o,class:Pe(["pivot-stage",{panning:d.value}]),title:L.$t("pivot.interaction"),onPointerdown:M,onWheel:tt(A,["prevent"]),onContextmenu:N[3]||(N[3]=tt(()=>{},["prevent"]))},[n.previewUrl?(Q(),te("div",{key:0,ref_key:"boxRef",ref:a,class:"pivot-box",style:Vt(x.value)},[w("img",{src:n.previewUrl,alt:L.$t("pivot.previewAlt"),draggable:"false",onLoad:R},null,40,iG)],4)):_e("",!0),n.previewUrl?(Q(),te(Me,{key:1},[w("div",{class:"pivot-cross vertical",style:Vt({left:`${_.value.x}px`})},null,4),w("div",{class:"pivot-cross horizontal",style:Vt({top:`${_.value.y}px`})},null,4),w("div",{class:"pivot-marker",style:Vt({left:`${_.value.x}px`,top:`${_.value.y}px`})},null,4),w("div",{class:"pivot-badge",style:Vt({left:`${_.value.x}px`,top:`${_.value.y}px`})},"X: "+k(g.value)+"% | Y: "+k(v.value)+"%",5)],64)):(Q(),te("div",nG,k(L.$t("pivot.noImage")),1))],42,tG),w("div",sG,[w("div",rG,[w("div",oG,[(Q(!0),te(Me,null,It(r.value,F=>(Q(),te("button",{key:F.label,type:"button",class:Pe(["pivot-preset",{on:V(F)}]),title:`${F.label}(${F.x}%, ${F.y}%)`,"aria-label":F.label,onClick:D=>W(F)},k(F.icon),11,aG))),128))]),w("button",{type:"button",class:"pivot-reset",onClick:O},"↺ "+k(L.$t("pivot.resetCenter")),1)]),w("div",lG,[w("div",cG,[w("span",null,[N[10]||(N[10]=w("span",{class:"pivot-card-icon"},"◎",-1)),yt(" "+k(L.$t("pivot.coordinates")),1)])]),w("div",hG,[w("label",null,[N[11]||(N[11]=yt("X: ",-1)),w("input",{type:"number",min:"-1000",max:"1000",step:"0.1",value:g.value,onInput:N[4]||(N[4]=F=>Y("x",F))},null,40,uG),N[12]||(N[12]=w("span",null,"%",-1))]),w("label",null,[N[13]||(N[13]=yt("Y: ",-1)),w("input",{type:"number",min:"-1000",max:"1000",step:"0.1",value:v.value,onInput:N[5]||(N[5]=F=>Y("y",F))},null,40,dG),N[14]||(N[14]=w("span",null,"%",-1))])]),n.large?(Q(),te(Me,{key:0},[w("div",fG,[w("span",null,[N[15]||(N[15]=w("span",{class:"pivot-card-icon"},"✥",-1)),yt(" "+k(L.$t("pivot.rotationTest")),1)]),w("span",mG,k(f.value==="static"?L.$t("pivot.static"):f.value==="spin"?L.$t("pivot.spin"):L.$t("pivot.swing")),1)]),w("div",pG,[w("div",gG,[w("button",{type:"button",class:Pe({on:f.value==="static"}),onClick:N[6]||(N[6]=F=>f.value="static")},k(L.$t("pivot.static")),3),w("button",{type:"button",class:Pe({on:f.value==="spin"}),onClick:N[7]||(N[7]=F=>f.value="spin")},"↻ "+k(L.$t("pivot.spin")),3),w("button",{type:"button",class:Pe({on:f.value==="swing"}),onClick:N[8]||(N[8]=F=>f.value="swing")},"⇄ "+k(L.$t("pivot.swing")),3)]),w("div",vG,[n.previewUrl?(Q(),te("img",{key:0,src:n.previewUrl,alt:L.$t("pivot.rotationAlt"),draggable:"false",class:Pe(f.value),style:Vt(E.value)},null,14,yG)):_e("",!0)])])],64)):_e("",!0)])])],2))}}),A1=li(bG,[["__scopeId","data-v-a5622844"]]),xG={class:"image-card"},wG={class:"imgrow"},SG=["title"],_G=["src","alt"],TG={key:1,viewBox:"0 0 24 24",width:"22",height:"22",fill:"none",stroke:"#8a93bb","stroke-width":"1.6"},EG={class:"img-fields"},CG={key:0,class:"row"},MG={class:"row"},AG=["placeholder"],IG={class:"img-actions"},PG=["title"],RG=["title","disabled"],kG={class:"thumb-note"},FG={key:0,class:"row"},LG={value:"fixed"},OG={value:"sequence"},$G={class:"row"},NG={value:"once-hide"},DG={value:"once-hold"},BG={value:"loop-forward"},UG={value:"loop-reverse"},VG={class:"row"},XG={class:"sequence-note"},YG={class:"resource-weight-row"},GG=["disabled","title"],HG={key:0,viewBox:"0 0 24 24","aria-hidden":"true"},jG={key:1,viewBox:"0 0 24 24","aria-hidden":"true"},WG={key:2,class:"pivot-toggle-row"},zG={class:"pivot-toggle-text"},qG={class:"pivot-toggle-title"},KG=["title"],JG=["title"],ZG=["aria-label"],QG={class:"pivot-modal-head"},eH={class:"pivot-modal-info"},tH={class:"pivot-modal-title"},iH={class:"pivot-modal-badge"},nH={class:"pivot-modal-desc"},sH=["title"],rH={class:"pivot-modal-hint"},oH={class:"pivot-modal-actions"},I1="SpineParticle.PivotPanels.v1",aH=qt({__name:"ImageResourceCard",props:{resource:{},resourceCount:{},defaultFile:{},namePlaceholder:{default:"particle"},showFolder:{type:Boolean,default:!0},supportsSequence:{type:Boolean,default:!1},pivotKey:{}},emits:["pick","pickSequence","reset","remove","updateWeight","toggleLock"],setup(n,{emit:e}){const t=n,i=e,{t:s}=fn(),r=Fe(()=>{var M,P;if(t.resource.imageMode==="sequence"){const A=t.resource.sequenceFrames||[];if(!A.length)return s("image.noSequence");const R=((M=A[0])==null?void 0:M.name)||s("image.firstFrame"),B=((P=A[A.length-1])==null?void 0:P.name)||R;return A.length===1?s("image.frameCountOne",{name:R}):s("image.frameCountMany",{count:A.length,first:R,last:B})}const C=t.resource.textureName||t.defaultFile.replace(/\.[^.]+$/,"");return C.includes(".")?C:`${C}.png`}),o=Fe(()=>{var C,M;return t.resource.imageMode==="sequence"?((M=(C=t.resource.sequenceFrames)==null?void 0:C[0])==null?void 0:M.previewUrl)||"":t.resource.previewUrl});function a(){try{const C=JSON.parse(sessionStorage.getItem(I1)||"{}");return C&&typeof C=="object"?C:{}}catch{return{}}}const c=a(),l=Fe(()=>t.pivotKey||`particle-image:${t.resource.id}`),h=Fe(()=>typeof t.resource.anchorX=="number"&&typeof t.resource.anchorY=="number"),u=Fe(()=>Math.abs((t.resource.anchorX??.5)-.5)<1e-4&&Math.abs((t.resource.anchorY??.5)-.5)<1e-4),d=typeof c[l.value]=="boolean",f=De(d?c[l.value]:!u.value);ei(f,C=>{c[l.value]=C;try{sessionStorage.setItem(I1,JSON.stringify(c))}catch{}}),ei(l,C=>{f.value=typeof c[C]=="boolean"?c[C]:!u.value}),ei(()=>u.value,C=>{C||(f.value=!0)},{immediate:!0});const m=De(!1),p=De(.5),g=De(.5),v=Fe(()=>{const C=((t.resource.anchorX??.5)*100).toFixed(1),M=((t.resource.anchorY??.5)*100).toFixed(1);return f.value?s("image.pivotOn",{x:C,y:M}):u.value?s("image.pivotOff"):s("image.pivotCustom",{x:C,y:M})});function b(){p.value=t.resource.anchorX??.5,g.value=t.resource.anchorY??.5,m.value=!0}function y(){f.value||(t.resource.anchorX=.5,t.resource.anchorY=.5,m.value=!1)}function x(C){C&&(t.resource.anchorX=p.value,t.resource.anchorY=g.value),m.value=!1}function _(C){C.key==="Escape"&&m.value&&x(!1)}Sn(()=>window.addEventListener("keydown",_)),eo(()=>window.removeEventListener("keydown",_));const E=Fe(()=>{var A,R;const C=t.resource.sequenceFrames||[];if(!C.length)return s("image.noSequence");const M=((A=C[0])==null?void 0:A.name)||s("image.firstImage"),P=((R=C[C.length-1])==null?void 0:R.name)||s("image.lastImage");return s("image.sequenceSelected",{count:C.length,first:M,last:P})});function S(){t.supportsSequence&&t.resource.imageMode==="sequence"?i("pickSequence",t.resource.id):i("pick",t.resource.id)}return(C,M)=>(Q(),te(Me,null,[w("div",xG,[w("div",wG,[w("button",{class:"img-thumb",title:n.supportsSequence&&n.resource.imageMode==="sequence"?C.$t("image.chooseSequence"):C.$t("image.chooseLocal"),onClick:S},[o.value?(Q(),te("img",{key:0,src:o.value,alt:n.resource.textureName},null,8,_G)):(Q(),te("svg",TG,[...M[19]||(M[19]=[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,SG),w("div",EG,[n.showFolder?(Q(),te("label",CG,[w("span",null,k(C.$t("image.subfolder")),1),pe(w("input",{"onUpdate:modelValue":M[0]||(M[0]=P=>n.resource.textureFolder=P),type:"text",class:"inp",placeholder:"subfolder/"},null,512),[[Je,n.resource.textureFolder]])])):_e("",!0),w("label",MG,[w("span",null,k(C.$t("image.name")),1),pe(w("input",{"onUpdate:modelValue":M[1]||(M[1]=P=>n.resource.textureName=P),type:"text",class:"inp",placeholder:n.namePlaceholder},null,8,AG),[[Je,n.resource.textureName]])])]),w("div",IG,[w("button",{class:"mini-btn2",title:C.$t("image.restore",{name:n.defaultFile}),onClick:M[2]||(M[2]=P=>C.$emit("reset",n.resource.id))},"⟳",8,PG),w("button",{class:"mini-btn2",title:C.$t("image.deleteResource"),disabled:n.resourceCount===1,onClick:M[3]||(M[3]=P=>C.$emit("remove",n.resource.id))},"🗑",8,RG)])]),w("div",kG,k(r.value),1),n.supportsSequence?(Q(),te("label",FG,[w("span",null,k(C.$t("image.imageMode")),1),pe(w("select",{"onUpdate:modelValue":M[4]||(M[4]=P=>n.resource.imageMode=P),class:"inp"},[w("option",LG,k(C.$t("image.fixed")),1),w("option",OG,k(C.$t("image.sequence")),1)],512),[[St,n.resource.imageMode]])])):_e("",!0),n.supportsSequence&&n.resource.imageMode==="sequence"?(Q(),te(Me,{key:1},[w("label",$G,[w("span",null,k(C.$t("image.playbackMode")),1),pe(w("select",{"onUpdate:modelValue":M[5]||(M[5]=P=>n.resource.sequencePlayback=P),class:"inp"},[w("option",NG,k(C.$t("image.onceHide")),1),w("option",DG,k(C.$t("image.onceHold")),1),w("option",BG,k(C.$t("image.loopForward")),1),w("option",UG,k(C.$t("image.loopReverse")),1)],512),[[St,n.resource.sequencePlayback]])]),w("label",VG,[w("span",null,k(C.$t("image.playbackFps")),1),pe(w("input",{"onUpdate:modelValue":M[6]||(M[6]=P=>n.resource.sequenceFps=P),type:"number",min:"1",max:"120",step:"1",class:"inp"},null,512),[[Je,n.resource.sequenceFps,void 0,{number:!0}]])]),w("button",{class:"sequence-pick",onClick:M[7]||(M[7]=P=>C.$emit("pickSequence",n.resource.id))},k(C.$t("image.chooseSequenceMulti")),1),w("div",XG,k(E.value),1)],64)):_e("",!0),w("div",YG,[Te(Ue,{class:"resource-weight-control",label:C.$t("image.weight"),min:0,max:100,step:1,"model-value":n.resource.weight,disabled:n.resource.locked||n.resourceCount===1,"onUpdate:modelValue":M[8]||(M[8]=P=>C.$emit("updateWeight",n.resource.id,P))},null,8,["label","model-value","disabled"]),w("button",{class:Pe(["weight-lock",{on:n.resource.locked}]),disabled:n.resourceCount===1,title:n.resource.locked?C.$t("image.unlockWeight"):C.$t("image.lockWeight"),onClick:M[9]||(M[9]=P=>C.$emit("toggleLock",n.resource.id))},[n.resource.locked?(Q(),te("svg",HG,[...M[20]||(M[20]=[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)])])):(Q(),te("svg",jG,[...M[21]||(M[21]=[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,GG)]),iM(C.$slots,"default",{},void 0),h.value?(Q(),te("div",WG,[M[23]||(M[23]=w("div",{class:"pivot-toggle-icon"},"◎",-1)),w("div",zG,[w("div",qG,k(C.$t("image.pivot")),1),w("div",{class:"pivot-toggle-sub",title:v.value},k(v.value),9,KG)]),w("label",{class:"pivot-switch",title:f.value?C.$t("image.collapsePivot"):C.$t("image.expandPivot")},[pe(w("input",{"onUpdate:modelValue":M[10]||(M[10]=P=>f.value=P),type:"checkbox",onChange:y},null,544),[[_t,f.value]]),M[22]||(M[22]=w("span",{class:"pivot-switch-ui"},null,-1))],8,JG)])):_e("",!0),h.value&&f.value?(Q(),Pt(A1,{key:3,"preview-url":o.value,"anchor-x":n.resource.anchorX??.5,"anchor-y":n.resource.anchorY??.5,"onUpdate:anchorX":M[11]||(M[11]=P=>n.resource.anchorX=P),"onUpdate:anchorY":M[12]||(M[12]=P=>n.resource.anchorY=P),onFullscreen:b},null,8,["preview-url","anchor-x","anchor-y"])):_e("",!0)]),(Q(),Pt(ux,{to:"body"},[m.value?(Q(),te("div",{key:0,class:"pivot-modal-backdrop",onPointerdown:M[18]||(M[18]=tt(P=>x(!1),["self"]))},[w("div",{class:"pivot-modal",role:"dialog","aria-modal":"true","aria-label":C.$t("image.pivotModal")},[w("div",QG,[M[24]||(M[24]=w("div",{class:"pivot-modal-icon"},"◎",-1)),w("div",eH,[w("div",tH,[yt(k(C.$t("image.pivotModal"))+" ",1),w("span",iH,k(n.resource.textureName||n.defaultFile),1)]),w("div",nH,k(C.$t("image.pivotModalDesc")),1)]),w("button",{type:"button",class:"pivot-modal-close",title:C.$t("common.close"),onClick:M[13]||(M[13]=P=>x(!1))},"✕",8,sH)]),w("div",rH,k(C.$t("image.pivotZoomHint")),1),Te(A1,{large:"","preview-url":o.value,"anchor-x":p.value,"anchor-y":g.value,"onUpdate:anchorX":M[14]||(M[14]=P=>p.value=P),"onUpdate:anchorY":M[15]||(M[15]=P=>g.value=P)},null,8,["preview-url","anchor-x","anchor-y"]),w("div",oH,[w("button",{type:"button",class:"pivot-modal-cancel",onClick:M[16]||(M[16]=P=>x(!1))},k(C.$t("common.cancel")),1),w("button",{type:"button",class:"pivot-modal-confirm",onClick:M[17]||(M[17]=P=>x(!0))},k(C.$t("image.confirmPivot")),1)])],8,ZG)],32)):_e("",!0)]))],64))}}),kE=li(aH,[["__scopeId","data-v-89f1e08d"]]),lH={class:"group"},cH={class:"caret"},hH=["title"],uH={class:"group-body"},dH={class:"look-title"},fH={class:"seg"},mH={class:"row"},pH={value:"跟随导出"},gH={value:"线性"},vH={value:"贝塞尔"},yH={class:"curve-wrap"},bH={class:"curve-labels"},xH={class:"look-title"},wH={class:"seg"},SH={class:"row"},_H=["value"],TH={value:0},EH=["value"],CH={class:"render-layer-current"},MH=["title"],AH={key:0,class:"slot-picker"},IH=["placeholder","aria-label"],PH={class:"slot-list"},RH=["onClick"],kH={class:"slot-order"},FH={class:"slot-name"},LH={class:"slot-attachment"},OH={key:0,class:"modifier-hint"},$H={class:"seg"},NH={class:"switch-row render-layer-switch"},DH=["disabled"],BH={key:0,class:"modifier-hint"},UH={key:2,class:"modifier-hint render-layer-warning"},VH={class:"modifier-hint"},XH={class:"look-title image-title"},YH=["title"],GH={class:"row resource-color-row"},HH=["onUpdate:modelValue"],jH={value:"fixed"},WH={value:"random"},zH={value:"lifetime"},qH=["onUpdate:modelValue"],KH={value:"normal"},JH={value:"add"},ZH={value:"multiply"},QH={value:"screen"},ej={key:0,class:"row resource-color-picker"},tj=["onUpdate:modelValue"],ij=["value","aria-label","onChange","onKeydown"],nj={key:0,class:"random-color-hint"},sj={class:"resource-alpha-head"},rj={class:"alpha-modes"},oj=["onClick"],aj=["onClick"],lj=["onClick"],cj={class:"row"},hj=["onUpdate:modelValue"],uj={value:"跟随导出"},dj={value:"线性"},fj={value:"贝塞尔"},mj={class:"resource-alpha-curve"},pj=qt({__name:"ParticleAppearanceSection",setup(n){const{resolvedCurveEditorMode:e,sys:t,textureFileInput:i,sequenceFileInput:s,addImageResource:r,openTexturePicker:o,openSequencePicker:a,onTextureFile:c,onSequenceFiles:l,resetTexture:h,setResourceFixedColor:u,commitResourceFixedColor:d,removeImageResource:f,setResourceWeight:m,toggleResourceLock:p,collapsed:g,toggle:v,resetModule:b,select:y,renderLayerSlotPickerOpen:x,renderLayerSlotSearch:_,renderLayerReadySpines:E,renderLayerSpineReady:S,renderLayerFilteredSlots:C,renderLayerSlotLabel:M,renderLayerResolvedLabel:P,renderLayerWarning:A,setRenderLayerSlotMode:R,selectRenderLayerSpine:B,pickRenderLayerSlot:O,clearRenderLayerSlot:W,ALPHA_CURVE:V,RESOURCE_ALPHA_CURVE:Y}=oo();return(L,N)=>(Q(),te("div",lH,[w("div",{class:"group-head",onClick:N[1]||(N[1]=F=>I(v)("look"))},[w("span",cH,k(I(g).look?"▸":"▾"),1),w("span",null,k(L.$t("appearance.title")),1),w("button",{class:"group-reset",title:L.$t("appearance.reset"),onClick:N[0]||(N[0]=tt(F=>I(b)("look"),["stop"]))},k(L.$t("common.reset")),9,hH)]),pe(w("div",uH,[w("div",dH,k(L.$t("appearance.opacity")),1),w("div",fH,[w("button",{class:Pe(["seg-btn",{active:I(t).config.alphaMode==="curve"}]),onClick:N[2]||(N[2]=F=>I(t).config.alphaMode="curve")},k(L.$t("common.curve")),3),w("button",{class:Pe(["seg-btn",{active:I(t).config.alphaMode==="fixed"}]),onClick:N[3]||(N[3]=F=>I(t).config.alphaMode="fixed")},k(L.$t("common.fixed")),3)]),I(t).config.alphaMode==="fixed"?(Q(),Pt(Ue,{key:0,label:L.$t("appearance.opacity"),min:0,max:1,step:.01,modelValue:I(t).config.alpha,"onUpdate:modelValue":N[4]||(N[4]=F=>I(t).config.alpha=F)},null,8,["label","modelValue"])):(Q(),te(Me,{key:1},[w("label",mH,[w("span",null,k(L.$t("appearance.curveMode")),1),pe(w("select",{"onUpdate:modelValue":N[5]||(N[5]=F=>I(t).config.curveMode=F),class:"inp"},[w("option",pH,k(L.$t("common.followExport")),1),w("option",gH,k(L.$t("common.linear")),1),w("option",vH,k(L.$t("common.bezier")),1)],512),[[St,I(t).config.curveMode]])]),w("div",yH,[Te(bs,{modelValue:I(t).config.alphaCurve,"onUpdate:modelValue":N[6]||(N[6]=F=>I(t).config.alphaCurve=F),"default-value":I(V),mode:I(e)(I(t).config.curveMode)},null,8,["modelValue","default-value","mode"]),w("div",bH,[w("span",null,k(L.$t("appearance.transparent")),1),w("span",null,k(L.$t("attributes.lifeTo")),1),w("span",null,k(L.$t("appearance.opaque")),1)])])],64)),w("div",xH,k(L.$t("appearance.renderLayer")),1),w("div",wH,[w("button",{class:Pe(["seg-btn",{active:I(t).config.renderLayerMode==="top"}]),onClick:N[7]||(N[7]=F=>I(t).config.renderLayerMode="top")},k(L.$t("appearance.top")),3),w("button",{class:Pe(["seg-btn",{active:I(t).config.renderLayerMode==="slot"}]),onClick:N[8]||(N[8]=(...F)=>I(R)&&I(R)(...F))},k(L.$t("appearance.spineSlot")),3)]),I(t).config.renderLayerMode==="slot"?(Q(),te(Me,{key:2},[w("label",SH,[N[19]||(N[19]=w("span",null,"Spine",-1)),w("select",{class:"inp",value:I(t).config.renderLayerSpineId,onChange:N[9]||(N[9]=(...F)=>I(B)&&I(B)(...F))},[w("option",TH,k(I(E).length?L.$t("appearance.selectSpine"):L.$t("appearance.noSpine")),1),(Q(!0),te(Me,null,It(I(E),F=>(Q(),te("option",{key:F.id,value:F.id},k(F.name),9,EH))),128))],40,_H)]),I(S)?(Q(),te(Me,{key:0},[w("div",CH,[w("span",{class:"render-layer-text",title:I(M)},k(I(M)||L.$t("appearance.noSlot")),9,MH),w("button",{class:"mini-btn",onClick:N[10]||(N[10]=F=>x.value=!I(x))},k(I(M)?L.$t("appearance.reselect"):L.$t("appearance.selectSlot")),1),I(t).config.renderLayerSlotName?(Q(),te("button",{key:0,class:"mini-btn ghost",onClick:N[11]||(N[11]=(...F)=>I(W)&&I(W)(...F))},k(L.$t("common.clear")),1)):_e("",!0)]),I(x)?(Q(),te("div",AH,[pe(w("input",{"onUpdate:modelValue":N[12]||(N[12]=F=>Qt(_)?_.value=F:null),class:"inp",type:"search",placeholder:L.$t("appearance.searchSlots"),"aria-label":L.$t("appearance.searchSlotsAria")},null,8,IH),[[Je,I(_),void 0,{trim:!0}]]),w("div",PH,[(Q(!0),te(Me,null,It(I(C),F=>(Q(),te("button",{key:F.name,class:Pe(["slot-item",{on:I(t).config.renderLayerSlotName===F.name}]),onClick:D=>I(O)(F)},[w("span",kH,k(F.order+1),1),w("span",FH,k(F.name),1),w("span",LH,k(F.attachment||L.$t("appearance.emptySlot")),1)],10,RH))),128)),I(C).length?_e("",!0):(Q(),te("div",OH,k(L.$t("appearance.noMatchingSlots")),1))])])):_e("",!0),I(t).config.renderLayerSlotName?(Q(),te(Me,{key:1},[w("div",$H,[w("button",{class:Pe(["seg-btn",{active:I(t).config.renderLayerSlotPosition==="above"}]),onClick:N[13]||(N[13]=F=>I(t).config.renderLayerSlotPosition="above")},k(L.$t("appearance.above")),3),w("button",{class:Pe(["seg-btn",{active:I(t).config.renderLayerSlotPosition==="below"}]),onClick:N[14]||(N[14]=F=>I(t).config.renderLayerSlotPosition="below")},k(L.$t("appearance.below")),3)]),w("label",NH,[pe(w("input",{"onUpdate:modelValue":N[15]||(N[15]=F=>I(t).config.renderLayerFollowAttachment=F),type:"checkbox",disabled:I(t).config.renderLayerSlotPosition==="below"},null,8,DH),[[_t,I(t).config.renderLayerFollowAttachment]]),N[20]||(N[20]=w("span",{class:"switch-ui"},null,-1)),w("span",null,k(L.$t("appearance.followAttachment")),1)]),I(P)?(Q(),te("div",BH,k(I(P)),1)):_e("",!0)],64)):_e("",!0),I(A)?(Q(),te("div",UH,k(I(A)),1)):_e("",!0),w("div",VH,k(L.$t("appearance.previewOnly")),1)],64)):_e("",!0)],64)):_e("",!0),w("div",XH,[w("span",null,k(L.$t("appearance.imageResources")),1),w("button",{class:"image-add",title:L.$t("appearance.addImage"),onClick:N[16]||(N[16]=(...F)=>I(r)&&I(r)(...F))},"+",8,YH)]),(Q(!0),te(Me,null,It(I(t).config.imageResources,F=>(Q(),Pt(kE,{key:`${I(t).id}:${F.id}`,resource:F,"resource-count":I(t).config.imageResources.length,"pivot-key":`${I(t).id}:${F.id}`,"supports-sequence":"","default-file":"star.png",onPick:I(o),onPickSequence:I(a),onReset:I(h),onRemove:I(f),onUpdateWeight:I(m),onToggleLock:I(p)},{default:Hu(()=>[Te(Ue,{label:L.$t("appearance.scale"),min:.1,max:3,step:.05,modelValue:F.scale,"onUpdate:modelValue":D=>F.scale=D},null,8,["label","modelValue","onUpdate:modelValue"]),N[21]||(N[21]=w("div",{class:"resource-divider"},null,-1)),w("label",GH,[w("span",null,k(L.$t("appearance.color")),1),pe(w("select",{"onUpdate:modelValue":D=>F.colorMode=D,class:"inp"},[w("option",jH,k(L.$t("appearance.fixedColor")),1),w("option",WH,k(L.$t("appearance.randomColor")),1),w("option",zH,k(L.$t("appearance.lifetime")),1)],8,HH),[[St,F.colorMode]]),pe(w("select",{"onUpdate:modelValue":D=>F.blend=D,class:"inp blend-select"},[w("option",KH,k(L.$t("appearance.normal")),1),w("option",JH,k(L.$t("appearance.add")),1),w("option",ZH,k(L.$t("appearance.multiply")),1),w("option",QH,k(L.$t("appearance.screen")),1)],8,qH),[[St,F.blend]])]),F.colorMode==="fixed"?(Q(),te("label",ej,[w("span",null,k(L.$t("appearance.fixedColor")),1),pe(w("input",{type:"color","onUpdate:modelValue":D=>F.colorStart=D,class:"colr"},null,8,tj),[[Je,F.colorStart]]),w("input",{type:"text",class:"hex-input",value:F.colorStart,spellcheck:"false","aria-label":L.$t("appearance.fixedColorValue"),onChange:D=>I(u)(F,D),onKeydown:Wr(D=>I(d)(F,D),["enter"])},null,40,ij)])):(Q(),te(Me,{key:1},[Te(RE,{modelValue:F.colorGradient,"onUpdate:modelValue":D=>F.colorGradient=D},null,8,["modelValue","onUpdate:modelValue"]),F.colorMode==="random"?(Q(),te("div",nj,k(L.$t("appearance.randomColorHint")),1)):_e("",!0)],64)),w("div",sj,[w("span",null,k(L.$t("appearance.independentAlpha")),1),w("div",rj,[w("button",{class:Pe({on:F.independentAlpha==="off"}),onClick:D=>F.independentAlpha="off"},k(L.$t("appearance.off")),11,oj),w("button",{class:Pe({on:F.independentAlpha==="fixed"}),onClick:D=>F.independentAlpha="fixed"},k(L.$t("common.fixed")),11,aj),w("button",{class:Pe({on:F.independentAlpha==="curve"}),onClick:D=>F.independentAlpha="curve"},k(L.$t("common.curve")),11,lj)])]),F.independentAlpha==="fixed"?(Q(),Pt(Ue,{key:2,label:L.$t("appearance.opacity"),min:0,max:1,step:.01,modelValue:F.alpha,"onUpdate:modelValue":D=>F.alpha=D},null,8,["label","modelValue","onUpdate:modelValue"])):F.independentAlpha==="curve"?(Q(),te(Me,{key:3},[w("label",cj,[w("span",null,k(L.$t("appearance.curveMode")),1),pe(w("select",{"onUpdate:modelValue":D=>F.alphaCurveMode=D,class:"inp"},[w("option",uj,k(L.$t("common.followExport")),1),w("option",dj,k(L.$t("common.linear")),1),w("option",fj,k(L.$t("common.bezier")),1)],8,hj),[[St,F.alphaCurveMode]])]),w("div",mj,[Te(bs,{modelValue:F.alphaCurve,"onUpdate:modelValue":D=>F.alphaCurve=D,"default-value":I(Y),mode:I(e)(F.alphaCurveMode)},null,8,["modelValue","onUpdate:modelValue","default-value","mode"])])],64)):_e("",!0)]),_:2},1032,["resource","resource-count","pivot-key","onPick","onPickSequence","onReset","onRemove","onUpdateWeight","onToggleLock"]))),128)),w("input",{ref_key:"textureFileInput",ref:i,class:"file-input",type:"file",accept:"image/png,image/jpeg,image/webp,image/gif",onChange:N[17]||(N[17]=(...F)=>I(c)&&I(c)(...F))},null,544),w("input",{ref_key:"sequenceFileInput",ref:s,class:"file-input",type:"file",multiple:"",accept:"image/png,image/jpeg,image/webp,image/gif",onChange:N[18]||(N[18]=(...F)=>I(l)&&I(l)(...F))},null,544)],512),[[Fi,!I(g).look]])]))}}),gj=li(pj,[["__scopeId","data-v-86902cc8"]]),vj={class:"group"},yj={class:"caret"},bj=["title"],xj={class:"group-body"},wj={class:"modifier-item damping-item"},Sj={class:"modifier-item"},_j={class:"switch-row modifier-switch"},Tj={key:0,class:"modifier-params"},Ej={class:"modifier-hint"},Cj={class:"modifier-item"},Mj={class:"switch-row modifier-switch"},Aj={key:0,class:"modifier-params gravity-params"},Ij={class:"modifier-mode-row"},Pj={class:"gravity-curve-title"},Rj={class:"gravity-curve-axis"},kj={class:"modifier-hint"},Fj={class:"modifier-item"},Lj={class:"switch-row modifier-switch"},Oj={key:0,class:"modifier-params gravity-params"},$j={class:"modifier-mode-row"},Nj={class:"gravity-curve-title"},Dj={class:"gravity-curve-axis"},Bj={class:"modifier-hint"},Uj={class:"modifier-item"},Vj={class:"switch-row modifier-switch"},Xj={key:0,class:"modifier-params"},Yj={class:"row"},Gj={value:"constant"},Hj={value:"linear"},jj={value:"inverse"},Wj={class:"modifier-hint"},zj={class:"switch-row"},qj={class:"modifier-item"},Kj={class:"switch-row modifier-switch"},Jj={key:0,class:"modifier-params"},Zj={class:"row"},Qj={value:"constant"},eW={value:"linear"},tW={value:"inverse"},iW={class:"modifier-hint"},nW={class:"switch-row"},sW={class:"modifier-item"},rW={class:"switch-row modifier-switch"},oW={key:0,class:"modifier-params"},aW={class:"row"},lW={value:"global"},cW={value:"particle"},hW={class:"row"},uW={value:"linear"},dW={value:"curve"},fW={class:"modifier-hint"},mW={class:"switch-row"},pW={class:"modifier-item"},gW={class:"switch-row modifier-switch"},vW={key:0,class:"modifier-params trail-params"},yW={class:"trail-section-head"},bW={class:"trail-section-title"},xW=["title"],wW={class:"row"},SW=["onUpdate:modelValue"],_W={value:"fixed"},TW={value:"random"},EW={class:"row"},CW=["onUpdate:modelValue"],MW={value:"fixed"},AW={value:"random"},IW={class:"row"},PW=["onUpdate:modelValue"],RW={value:"particle"},kW={value:"fixed"},FW={class:"switch-row trail-sub-switch"},LW=["onUpdate:modelValue"],OW={class:"switch-row trail-sub-switch"},$W=["onUpdate:modelValue"],NW={class:"trail-mode-head"},DW={class:"alpha-modes"},BW=["onClick"],UW=["onClick"],VW=["onClick"],XW={class:"row"},YW=["onUpdate:modelValue"],GW={value:"normal"},HW={value:"add"},jW={value:"multiply"},WW={value:"screen"},zW={key:6,class:"row trail-fixed-color"},qW=["onUpdate:modelValue"],KW=["value","onChange","onKeydown"],JW={class:"trail-mode-head"},ZW={class:"alpha-modes"},QW=["onClick"],e7=["onClick"],t7=["onClick"],i7={class:"trail-grid-row"},n7={class:"modifier-hint"},s7={class:"modifier-item"},r7={class:"switch-row modifier-switch"},o7=["disabled"],a7={key:0,class:"modifier-params emitter-follow-params"},l7={class:"field-block"},c7=["value"],h7={value:"none"},u7={value:"path"},d7={key:0,value:"bone"},f7={class:"field-block"},m7={value:0},p7=["value"],g7={class:"field-block"},v7={value:"fixed"},y7={value:"direction"},b7={class:"gravity-curve-title"},x7={class:"field-grid follow-grid"},w7={class:"compact-field"},S7={class:"compact-field"},_7={value:"local"},T7={value:"world"},E7={class:"field-block"},C7={value:"forward"},M7={value:"reverse"},A7={class:"modifier-hint"},I7={key:0,class:"bone-follow-target"},P7={key:1,class:"bone-follow-missing"},R7={class:"field-block"},k7={value:"local"},F7={value:"world"},L7={class:"field-grid follow-grid"},O7={class:"compact-field"},$7={class:"compact-field"},N7={class:"bone-follow-transform-grid"},D7={class:"compact-field"},B7={class:"compact-field"},U7={class:"compact-field"},V7={class:"modifier-hint"},X7={class:"modifier-item"},Y7={class:"switch-row modifier-switch"},G7={key:0,class:"modifier-params collision-filter-params"},H7={class:"collision-filter-title"},j7={class:"collision-filter-tags"},W7=["title"],z7=["aria-label","onClick"],q7=["disabled","title"],K7={key:0,class:"collision-filter-empty"},J7={key:1,class:"collision-filter-picker"},Z7=["onClick"],Q7={class:"modifier-hint"},e9={class:"modifier-item events-item"},t9={class:"switch-row modifier-switch"},i9={key:0,class:"event-rules"},n9={class:"event-selects"},s9=["onUpdate:modelValue","title"],r9={value:"birth"},o9={value:"death"},a9={value:"collision"},l9=["onUpdate:modelValue","title"],c9={value:0},h9=["value"],u9=["title","onClick"],d9={class:"event-probability"},f9=["onUpdate:modelValue"],m9={key:0,class:"event-probability event-collision-limit"},p9=["value","onInput"],g9={class:"event-probability event-inherit"},v9=["onClick"],y9={class:"inherit-summary"},b9={key:1,class:"event-probability event-color-mode"},x9=["onUpdate:modelValue"],w9={value:"add"},S9={value:"replace"},_9={class:"inherit-check"},T9={class:"inherit-check"},E9=["onClick"],C9={class:"inherit-check"},M9=qt({__name:"ParticleModifiersSection",setup(n){const{store:e,sys:t,trailTextureFileInput:i,addTrailResource:s,openTrailTexturePicker:r,onTrailRigChange:o,onTrailResourceBoneCountChange:a,onTrailResourceRotationChange:c,onTrailTextureFile:l,resetTrailTexture:h,removeTrailResource:u,setTrailResourceWeight:d,toggleTrailResourceLock:f,setTrailColor:m,commitTrailColor:p,selectedSpineBone:g,boundSpineBone:v,collisionPickerOpen:b,selectedCollisionBodies:y,availableCollisionBodies:x,addCollisionBody:_,removeCollisionBody:E,collapsed:S,toggle:C,onEmitterFollowModeChange:M,bindSelectedBone:P,resetModule:A,select:R,LINEAR_CURVE:B,FLAT_CURVE:O,TRAIL_ALPHA_CURVE:W,TRAIL_SHAPE_CURVE:V}=oo(),{t:Y}=fn(),L=Fe(()=>{var $;const H=($=t.value)==null?void 0:$.id;if(!H)return[];const j=RS(e.systems,H);return e.systems.filter(U=>U.id!==H&&!j.has(U.id))}),N=Fe(()=>[{key:"color",label:Y("modifiers.inheritColor")},{key:"scale",label:Y("modifiers.inheritScale")},{key:"rotation",label:Y("modifiers.inheritRotation")},{key:"life",label:Y("modifiers.inheritLife")}]),F=De(null),D=Fe(()=>{var $;const H=F.value,j=($=t.value)==null?void 0:$.config.events;return!H||!Array.isArray(j)?null:j.find(U=>U.id===H.ruleId)||null});function X(H){return Array.isArray(H.inherit)||(H.inherit=[]),H.inherit}function G(H){const j=X(H);return j.length?j.length===N.value.length?Y("modifiers.inheritAll"):N.value.filter($=>j.includes($.key)).map($=>$.label).join("、"):Y("modifiers.inheritNone")}function K(H,j){return X(H).includes(j)}function J(H,j){const $=X(H),U=$.indexOf(j);U>=0?$.splice(U,1):$.push(j)}function oe(H){X(H).splice(0)}function le(H){X(H).splice(0,X(H).length,...N.value.map(j=>j.key))}function ve(H,j){var xe;if(((xe=F.value)==null?void 0:xe.ruleId)===H.id){F.value=null;return}const $=j.currentTarget;if(!$)return;const U=$.getBoundingClientRect(),z=Math.max(168,U.width),ee=212,ne=Math.min(Math.max(8,U.left),Math.max(8,window.innerWidth-z-8));let ue=U.bottom+4;ue+ee>window.innerHeight-8&&(ue=Math.max(8,U.top-ee-4)),F.value={ruleId:H.id,left:ne,top:ue,width:z}}function Se(){F.value=null}function fe(){Se()}function ye(H){H.key==="Escape"&&Se()}Sn(()=>{document.addEventListener("pointerdown",Se),window.addEventListener("scroll",fe,!0),window.addEventListener("resize",fe),window.addEventListener("keydown",ye)}),eo(()=>{document.removeEventListener("pointerdown",Se),window.removeEventListener("scroll",fe,!0),window.removeEventListener("resize",fe),window.removeEventListener("keydown",ye)});function q(){var $;const H=($=t.value)==null?void 0:$.config;if(!H)return;Array.isArray(H.events)||(H.events=[]);const j=Math.max(0,...H.events.map(U=>U.id))+1;H.events.push({id:j,event:"birth",targetSystemId:0,probability:1,collisionLimit:1,inherit:[],colorInheritMode:"add"})}function Z(H){var j;(j=t.value)==null||j.config.events.splice(H,1)}function se(H,j){const $=j.target,U=Math.round(Number($.value));H.collisionLimit=Math.min(4,Math.max(1,Number.isFinite(U)?U:1)),$.value=String(H.collisionLimit)}return(H,j)=>(Q(),te(Me,null,[w("div",vj,[w("div",{class:"group-head",onClick:j[1]||(j[1]=$=>I(C)("mods"))},[w("span",yj,k(I(S).mods?"▸":"▾"),1),w("span",null,k(H.$t("modifiers.title")),1),w("button",{class:"group-reset",title:H.$t("modifiers.reset"),onClick:j[0]||(j[0]=tt($=>I(A)("mods"),["stop"]))},k(H.$t("common.reset")),9,bj)]),pe(w("div",xj,[w("div",wj,[Te(Ue,{label:H.$t("modifiers.damping"),min:0,max:2,step:.05,modelValue:I(t).config.damping,"onUpdate:modelValue":j[2]||(j[2]=$=>I(t).config.damping=$)},null,8,["label","modelValue"])]),w("div",Sj,[w("label",_j,[pe(w("input",{type:"checkbox","onUpdate:modelValue":j[3]||(j[3]=$=>I(t).config.noise=$)},null,512),[[_t,I(t).config.noise]]),j[74]||(j[74]=w("span",{class:"switch-ui"},null,-1)),w("span",null,k(H.$t("modifiers.enableNoise")),1)]),I(t).config.noise?(Q(),te("div",Tj,[Te(Ue,{label:H.$t("modifiers.strength"),min:0,max:100,step:1,modelValue:I(t).config.noiseAmt,"onUpdate:modelValue":j[4]||(j[4]=$=>I(t).config.noiseAmt=$)},null,8,["label","modelValue"]),Te(Ue,{label:H.$t("modifiers.noiseRange"),min:0,max:500,step:1,modelValue:I(t).config.noiseRange,"onUpdate:modelValue":j[5]||(j[5]=$=>I(t).config.noiseRange=$)},null,8,["label","modelValue"]),Te(Ue,{label:H.$t("modifiers.noiseSpeed"),min:0,max:10,step:.1,modelValue:I(t).config.noiseSpeed,"onUpdate:modelValue":j[6]||(j[6]=$=>I(t).config.noiseSpeed=$)},null,8,["label","modelValue"]),w("div",Ej,k(H.$t("modifiers.noiseHint")),1)])):_e("",!0)]),w("div",Cj,[w("label",Mj,[pe(w("input",{type:"checkbox","onUpdate:modelValue":j[7]||(j[7]=$=>I(t).config.useGravity=$)},null,512),[[_t,I(t).config.useGravity]]),j[75]||(j[75]=w("span",{class:"switch-ui"},null,-1)),w("span",null,k(H.$t("modifiers.enableGravity")),1)]),I(t).config.useGravity?(Q(),te("div",Aj,[w("div",Ij,[w("button",{class:Pe(["axis-mode",{on:I(t).config.gravityMode==="fixed"}]),onClick:j[8]||(j[8]=$=>I(t).config.gravityMode="fixed")},k(H.$t("common.fixed")),3),w("button",{class:Pe(["axis-mode",{on:I(t).config.gravityMode==="random"}]),onClick:j[9]||(j[9]=$=>I(t).config.gravityMode="random")},k(H.$t("common.random")),3)]),I(t).config.gravityMode==="fixed"?(Q(),Pt(Ue,{key:0,label:H.$t("modifiers.gravityStrength"),min:-3e3,max:3e3,step:10,modelValue:I(t).config.gravityMin,"onUpdate:modelValue":j[10]||(j[10]=$=>I(t).config.gravityMin=$)},null,8,["label","modelValue"])):(Q(),te(Me,{key:1},[Te(Ue,{label:H.$t("modifiers.strengthMin"),min:-3e3,max:3e3,step:10,modelValue:I(t).config.gravityMin,"onUpdate:modelValue":j[11]||(j[11]=$=>I(t).config.gravityMin=$)},null,8,["label","modelValue"]),Te(Ue,{label:H.$t("modifiers.strengthMax"),min:-3e3,max:3e3,step:10,modelValue:I(t).config.gravityMax,"onUpdate:modelValue":j[12]||(j[12]=$=>I(t).config.gravityMax=$)},null,8,["label","modelValue"])],64)),Te(Ue,{label:H.$t("modifiers.direction"),min:-360,max:360,step:1,modelValue:I(t).config.gravityDirection,"onUpdate:modelValue":j[13]||(j[13]=$=>I(t).config.gravityDirection=$)},null,8,["label","modelValue"]),w("div",Pj,[w("span",null,k(H.$t("modifiers.gravityOverLife")),1),w("span",null,k(H.$t("modifiers.axisStrength")),1)]),Te(bs,{modelValue:I(t).config.gravityCurve,"onUpdate:modelValue":j[14]||(j[14]=$=>I(t).config.gravityCurve=$),"default-value":I(O)},null,8,["modelValue","default-value"]),w("div",Rj,[j[76]||(j[76]=w("span",null,"0",-1)),w("span",null,k(H.$t("attributes.lifeTo")),1),j[77]||(j[77]=w("span",null,"1",-1))]),w("div",kj,k(H.$t("modifiers.directionHint")),1)])):_e("",!0)]),w("div",Fj,[w("label",Lj,[pe(w("input",{type:"checkbox","onUpdate:modelValue":j[15]||(j[15]=$=>I(t).config.wind=$)},null,512),[[_t,I(t).config.wind]]),j[78]||(j[78]=w("span",{class:"switch-ui"},null,-1)),w("span",null,k(H.$t("modifiers.enableWind")),1)]),I(t).config.wind?(Q(),te("div",Oj,[w("div",$j,[w("button",{class:Pe(["axis-mode",{on:I(t).config.windMode==="fixed"}]),onClick:j[16]||(j[16]=$=>I(t).config.windMode="fixed")},k(H.$t("common.fixed")),3),w("button",{class:Pe(["axis-mode",{on:I(t).config.windMode==="random"}]),onClick:j[17]||(j[17]=$=>I(t).config.windMode="random")},k(H.$t("common.random")),3)]),I(t).config.windMode==="fixed"?(Q(),Pt(Ue,{key:0,label:H.$t("modifiers.windStrength"),min:-3e3,max:3e3,step:10,modelValue:I(t).config.windMin,"onUpdate:modelValue":j[18]||(j[18]=$=>I(t).config.windMin=$)},null,8,["label","modelValue"])):(Q(),te(Me,{key:1},[Te(Ue,{label:H.$t("modifiers.strengthMin"),min:-3e3,max:3e3,step:10,modelValue:I(t).config.windMin,"onUpdate:modelValue":j[19]||(j[19]=$=>I(t).config.windMin=$)},null,8,["label","modelValue"]),Te(Ue,{label:H.$t("modifiers.strengthMax"),min:-3e3,max:3e3,step:10,modelValue:I(t).config.windMax,"onUpdate:modelValue":j[20]||(j[20]=$=>I(t).config.windMax=$)},null,8,["label","modelValue"])],64)),Te(Ue,{label:H.$t("modifiers.direction"),min:-360,max:360,step:1,modelValue:I(t).config.windDirection,"onUpdate:modelValue":j[21]||(j[21]=$=>I(t).config.windDirection=$)},null,8,["label","modelValue"]),w("div",Nj,[w("span",null,k(H.$t("modifiers.windOverLife")),1),w("span",null,k(H.$t("modifiers.axisStrength")),1)]),Te(bs,{modelValue:I(t).config.windCurve,"onUpdate:modelValue":j[22]||(j[22]=$=>I(t).config.windCurve=$),"default-value":I(O)},null,8,["modelValue","default-value"]),w("div",Dj,[j[79]||(j[79]=w("span",null,"0",-1)),w("span",null,k(H.$t("attributes.lifeTo")),1),j[80]||(j[80]=w("span",null,"1",-1))]),w("div",Bj,k(H.$t("modifiers.directionHint")),1)])):_e("",!0)]),w("div",Uj,[w("label",Vj,[pe(w("input",{type:"checkbox","onUpdate:modelValue":j[23]||(j[23]=$=>I(t).config.forceField=$)},null,512),[[_t,I(t).config.forceField]]),j[81]||(j[81]=w("span",{class:"switch-ui"},null,-1)),w("span",null,k(H.$t("modifiers.enableForceField")),1)]),I(t).config.forceField?(Q(),te("div",Xj,[Te(Ue,{label:H.$t("modifiers.centerX"),min:-5e3,max:5e3,step:1,modelValue:I(t).config.forceCenterX,"onUpdate:modelValue":j[24]||(j[24]=$=>I(t).config.forceCenterX=$)},null,8,["label","modelValue"]),Te(Ue,{label:H.$t("modifiers.centerY"),min:-5e3,max:5e3,step:1,modelValue:I(t).config.forceCenterY,"onUpdate:modelValue":j[25]||(j[25]=$=>I(t).config.forceCenterY=$)},null,8,["label","modelValue"]),Te(Ue,{label:H.$t("modifiers.forceStrength"),min:-300,max:300,step:1,modelValue:I(t).config.forceStrength,"onUpdate:modelValue":j[26]||(j[26]=$=>I(t).config.forceStrength=$)},null,8,["label","modelValue"]),Te(Ue,{label:H.$t("modifiers.forceRadius"),min:1,max:2e3,step:1,modelValue:I(t).config.forceRadius,"onUpdate:modelValue":j[27]||(j[27]=$=>I(t).config.forceRadius=$)},null,8,["label","modelValue"]),w("label",Yj,[w("span",null,k(H.$t("modifiers.falloffMode")),1),pe(w("select",{"onUpdate:modelValue":j[28]||(j[28]=$=>I(t).config.forceFalloff=$),class:"inp"},[w("option",Gj,k(H.$t("modifiers.constant")),1),w("option",Hj,k(H.$t("modifiers.linearFalloff")),1),w("option",jj,k(H.$t("modifiers.inverseFalloff")),1)],512),[[St,I(t).config.forceFalloff]])]),w("div",Wj,k(H.$t("modifiers.forceHint")),1),w("label",zj,[pe(w("input",{type:"checkbox","onUpdate:modelValue":j[29]||(j[29]=$=>I(t).config.showForceFieldShape=$)},null,512),[[_t,I(t).config.showForceFieldShape]]),j[82]||(j[82]=w("span",{class:"switch-ui"},null,-1)),w("span",null,k(H.$t("modifiers.showShape")),1)])])):_e("",!0)]),w("div",qj,[w("label",Kj,[pe(w("input",{type:"checkbox","onUpdate:modelValue":j[30]||(j[30]=$=>I(t).config.vortex=$)},null,512),[[_t,I(t).config.vortex]]),j[83]||(j[83]=w("span",{class:"switch-ui"},null,-1)),w("span",null,k(H.$t("modifiers.enableVortex")),1)]),I(t).config.vortex?(Q(),te("div",Jj,[Te(Ue,{label:H.$t("modifiers.centerX"),min:-5e3,max:5e3,step:1,modelValue:I(t).config.vortexCenterX,"onUpdate:modelValue":j[31]||(j[31]=$=>I(t).config.vortexCenterX=$)},null,8,["label","modelValue"]),Te(Ue,{label:H.$t("modifiers.centerY"),min:-5e3,max:5e3,step:1,modelValue:I(t).config.vortexCenterY,"onUpdate:modelValue":j[32]||(j[32]=$=>I(t).config.vortexCenterY=$)},null,8,["label","modelValue"]),Te(Ue,{label:H.$t("modifiers.forceStrength"),min:-300,max:300,step:1,modelValue:I(t).config.vortexStrength,"onUpdate:modelValue":j[33]||(j[33]=$=>I(t).config.vortexStrength=$)},null,8,["label","modelValue"]),Te(Ue,{label:H.$t("modifiers.forceRadius"),min:1,max:2e3,step:1,modelValue:I(t).config.vortexRadius,"onUpdate:modelValue":j[34]||(j[34]=$=>I(t).config.vortexRadius=$)},null,8,["label","modelValue"]),w("label",Zj,[w("span",null,k(H.$t("modifiers.falloffMode")),1),pe(w("select",{"onUpdate:modelValue":j[35]||(j[35]=$=>I(t).config.vortexFalloff=$),class:"inp"},[w("option",Qj,k(H.$t("modifiers.constant")),1),w("option",eW,k(H.$t("modifiers.linearFalloff")),1),w("option",tW,k(H.$t("modifiers.inverseFalloff")),1)],512),[[St,I(t).config.vortexFalloff]])]),w("div",iW,k(H.$t("modifiers.vortexHint")),1),w("label",nW,[pe(w("input",{type:"checkbox","onUpdate:modelValue":j[36]||(j[36]=$=>I(t).config.showVortexShape=$)},null,512),[[_t,I(t).config.showVortexShape]]),j[84]||(j[84]=w("span",{class:"switch-ui"},null,-1)),w("span",null,k(H.$t("modifiers.showShape")),1)])])):_e("",!0)]),w("div",sW,[w("label",rW,[pe(w("input",{type:"checkbox","onUpdate:modelValue":j[37]||(j[37]=$=>I(t).config.attraction=$)},null,512),[[_t,I(t).config.attraction]]),j[85]||(j[85]=w("span",{class:"switch-ui"},null,-1)),w("span",null,k(H.$t("modifiers.enableAttraction")),1)]),I(t).config.attraction?(Q(),te("div",oW,[Te(Ue,{label:H.$t("modifiers.attractionX"),min:-5e3,max:5e3,step:1,modelValue:I(t).config.attractionCenterX,"onUpdate:modelValue":j[38]||(j[38]=$=>I(t).config.attractionCenterX=$)},null,8,["label","modelValue"]),Te(Ue,{label:H.$t("modifiers.attractionY"),min:-5e3,max:5e3,step:1,modelValue:I(t).config.attractionCenterY,"onUpdate:modelValue":j[39]||(j[39]=$=>I(t).config.attractionCenterY=$)},null,8,["label","modelValue"]),Te(Ue,{label:H.$t("modifiers.attractionRadius"),min:0,max:2e3,step:1,modelValue:I(t).config.attractionRadius,"onUpdate:modelValue":j[40]||(j[40]=$=>I(t).config.attractionRadius=$)},null,8,["label","modelValue"]),Te(Ue,{label:H.$t("modifiers.attractionDuration"),min:.05,max:30,step:.05,modelValue:I(t).config.attractionDuration,"onUpdate:modelValue":j[41]||(j[41]=$=>I(t).config.attractionDuration=$)},null,8,["label","modelValue"]),Te(Ue,{label:H.$t("modifiers.delay"),min:0,max:30,step:.05,modelValue:I(t).config.attractionDelay,"onUpdate:modelValue":j[42]||(j[42]=$=>I(t).config.attractionDelay=$)},null,8,["label","modelValue"]),w("label",aW,[w("span",null,k(H.$t("modifiers.delayMode")),1),pe(w("select",{"onUpdate:modelValue":j[43]||(j[43]=$=>I(t).config.attractionDelayMode=$),class:"inp"},[w("option",lW,k(H.$t("modifiers.globalTime")),1),w("option",cW,k(H.$t("modifiers.particleLife")),1)],512),[[St,I(t).config.attractionDelayMode]])]),w("label",hW,[w("span",null,k(H.$t("modifiers.attractionPath")),1),pe(w("select",{"onUpdate:modelValue":j[44]||(j[44]=$=>I(t).config.attractionPath=$),class:"inp"},[w("option",uW,k(H.$t("modifiers.straight")),1),w("option",dW,k(H.$t("common.curve")),1)],512),[[St,I(t).config.attractionPath]])]),w("div",fW,k(H.$t("modifiers.attractionHint")),1),w("label",mW,[pe(w("input",{type:"checkbox","onUpdate:modelValue":j[45]||(j[45]=$=>I(t).config.showAttractionShape=$)},null,512),[[_t,I(t).config.showAttractionShape]]),j[86]||(j[86]=w("span",{class:"switch-ui"},null,-1)),w("span",null,k(H.$t("modifiers.showShape")),1)])])):_e("",!0)]),w("div",pW,[w("label",gW,[pe(w("input",{type:"checkbox","onUpdate:modelValue":j[46]||(j[46]=$=>I(t).config.trail=$)},null,512),[[_t,I(t).config.trail]]),j[87]||(j[87]=w("span",{class:"switch-ui"},null,-1)),w("span",null,k(H.$t("modifiers.enableTrail")),1)]),I(t).config.trail?(Q(),te("div",vW,[w("div",yW,[w("div",bW,k(H.$t("modifiers.trailImages")),1),w("button",{class:"image-add",title:H.$t("modifiers.addTrailImage"),onClick:j[47]||(j[47]=(...$)=>I(s)&&I(s)(...$))},"+",8,xW)]),(Q(!0),te(Me,null,It(I(t).config.trailResources,$=>(Q(),Pt(kE,{key:$.id,resource:$,"resource-count":I(t).config.trailResources.length,"default-file":"trail.png","name-placeholder":"trail","show-folder":!1,onPick:I(r),onReset:I(h),onRemove:I(u),onUpdateWeight:I(d),onToggleLock:I(f)},{default:Hu(()=>[j[90]||(j[90]=w("div",{class:"resource-divider"},null,-1)),Te(Ue,{label:H.$t("modifiers.trailRotation"),min:-360,max:360,step:1,"model-value":$.rotation,"onUpdate:modelValue":U=>I(c)($.id,U)},null,8,["label","model-value","onUpdate:modelValue"]),Te(Ue,{label:H.$t("modifiers.trailBones"),min:2,max:16,step:1,"model-value":$.boneCount,"onUpdate:modelValue":U=>I(a)($.id,U)},null,8,["label","model-value","onUpdate:modelValue"]),Te(Ue,{label:H.$t("modifiers.trailRatio"),min:0,max:100,step:1,modelValue:$.trailRatio,"onUpdate:modelValue":U=>$.trailRatio=U},null,8,["label","modelValue","onUpdate:modelValue"]),w("label",wW,[w("span",null,k(H.$t("modifiers.trailLength")),1),pe(w("select",{"onUpdate:modelValue":U=>$.lengthMode=U,class:"inp"},[w("option",_W,k(H.$t("common.fixed")),1),w("option",TW,k(H.$t("modifiers.randomRange")),1)],8,SW),[[St,$.lengthMode]])]),$.lengthMode==="fixed"?(Q(),Pt(Ue,{key:0,label:H.$t("modifiers.lengthRatio"),min:0,max:500,step:1,modelValue:$.length,"onUpdate:modelValue":U=>$.length=U},null,8,["label","modelValue","onUpdate:modelValue"])):(Q(),te(Me,{key:1},[Te(Ue,{label:H.$t("modifiers.lengthMin"),min:0,max:500,step:1,modelValue:$.lengthMin,"onUpdate:modelValue":U=>$.lengthMin=U},null,8,["label","modelValue","onUpdate:modelValue"]),Te(Ue,{label:H.$t("modifiers.lengthMax"),min:0,max:500,step:1,modelValue:$.lengthMax,"onUpdate:modelValue":U=>$.lengthMax=U},null,8,["label","modelValue","onUpdate:modelValue"])],64)),w("label",EW,[w("span",null,k(H.$t("modifiers.trailWidth")),1),pe(w("select",{"onUpdate:modelValue":U=>$.widthSizeMode=U,class:"inp"},[w("option",MW,k(H.$t("common.fixed")),1),w("option",AW,k(H.$t("modifiers.randomRange")),1)],8,CW),[[St,$.widthSizeMode]])]),$.widthSizeMode==="fixed"?(Q(),Pt(Ue,{key:2,label:H.$t("modifiers.widthRatio"),min:0,max:500,step:1,modelValue:$.width,"onUpdate:modelValue":U=>$.width=U},null,8,["label","modelValue","onUpdate:modelValue"])):(Q(),te(Me,{key:3},[Te(Ue,{label:H.$t("modifiers.widthMin"),min:0,max:500,step:1,modelValue:$.widthMin,"onUpdate:modelValue":U=>$.widthMin=U},null,8,["label","modelValue","onUpdate:modelValue"]),Te(Ue,{label:H.$t("modifiers.widthMax"),min:0,max:500,step:1,modelValue:$.widthMax,"onUpdate:modelValue":U=>$.widthMax=U},null,8,["label","modelValue","onUpdate:modelValue"])],64)),w("label",IW,[w("span",null,k(H.$t("modifiers.widthScale")),1),pe(w("select",{"onUpdate:modelValue":U=>$.widthMode=U,class:"inp"},[w("option",RW,k(H.$t("modifiers.followParticle")),1),w("option",kW,k(H.$t("common.fixed")),1)],8,PW),[[St,$.widthMode]])]),w("label",FW,[pe(w("input",{type:"checkbox","onUpdate:modelValue":U=>$.lifeLengthEnabled=U},null,8,LW),[[_t,$.lifeLengthEnabled]]),j[88]||(j[88]=w("span",{class:"switch-ui"},null,-1)),w("span",null,k(H.$t("modifiers.lifeLengthCurve")),1)]),$.lifeLengthEnabled?(Q(),Pt(bs,{key:4,modelValue:$.lifeLengthCurve,"onUpdate:modelValue":U=>$.lifeLengthCurve=U,"default-value":I(O)},null,8,["modelValue","onUpdate:modelValue","default-value"])):_e("",!0),w("label",OW,[pe(w("input",{type:"checkbox","onUpdate:modelValue":U=>$.shapeEnabled=U},null,8,$W),[[_t,$.shapeEnabled]]),j[89]||(j[89]=w("span",{class:"switch-ui"},null,-1)),w("span",null,k(H.$t("modifiers.shapeCurve")),1)]),$.shapeEnabled?(Q(),Pt(bs,{key:5,modelValue:$.shapeCurve,"onUpdate:modelValue":U=>$.shapeCurve=U,"default-value":I(V)},null,8,["modelValue","onUpdate:modelValue","default-value"])):_e("",!0),w("div",NW,[w("span",null,k(H.$t("modifiers.colorMode")),1),w("div",DW,[w("button",{class:Pe(["axis-mode",{on:$.colorMode==="particle"}]),onClick:U=>$.colorMode="particle"},k(H.$t("modifiers.followParticle")),11,BW),w("button",{class:Pe(["axis-mode",{on:$.colorMode==="fixed"}]),onClick:U=>$.colorMode="fixed"},k(H.$t("common.fixed")),11,UW),w("button",{class:Pe(["axis-mode",{on:$.colorMode==="curve"}]),onClick:U=>$.colorMode="curve"},k(H.$t("common.curve")),11,VW)])]),w("label",XW,[w("span",null,k(H.$t("modifiers.blendMode")),1),pe(w("select",{"onUpdate:modelValue":U=>$.blend=U,class:"inp"},[w("option",GW,k(H.$t("appearance.normal")),1),w("option",HW,k(H.$t("appearance.add")),1),w("option",jW,k(H.$t("appearance.multiply")),1),w("option",WW,k(H.$t("appearance.screen")),1)],8,YW),[[St,$.blend]])]),$.colorMode==="fixed"?(Q(),te("label",zW,[w("span",null,k(H.$t("modifiers.fixedColor")),1),pe(w("input",{class:"colr",type:"color","onUpdate:modelValue":U=>$.color=U},null,8,qW),[[Je,$.color]]),w("input",{class:"hex-input",value:$.color,onChange:U=>I(m)($,U),onKeydown:Wr(tt(U=>I(p)($,U),["prevent"]),["enter"])},null,40,KW)])):$.colorMode==="curve"?(Q(),Pt(RE,{key:7,modelValue:$.colorGradient,"onUpdate:modelValue":U=>$.colorGradient=U},null,8,["modelValue","onUpdate:modelValue"])):_e("",!0),w("div",JW,[w("span",null,k(H.$t("modifiers.alphaMode")),1),w("div",ZW,[w("button",{class:Pe(["axis-mode",{on:$.alphaMode==="particle"}]),onClick:U=>$.alphaMode="particle"},k(H.$t("modifiers.followParticle")),11,QW),w("button",{class:Pe(["axis-mode",{on:$.alphaMode==="fixed"}]),onClick:U=>$.alphaMode="fixed"},k(H.$t("common.fixed")),11,e7),w("button",{class:Pe(["axis-mode",{on:$.alphaMode==="curve"}]),onClick:U=>$.alphaMode="curve"},k(H.$t("common.curve")),11,t7)])]),$.alphaMode==="fixed"?(Q(),Pt(Ue,{key:8,label:H.$t("modifiers.opacity"),min:0,max:1,step:.01,modelValue:$.alpha,"onUpdate:modelValue":U=>$.alpha=U},null,8,["label","modelValue","onUpdate:modelValue"])):_e("",!0),$.alphaMode==="curve"?(Q(),Pt(bs,{key:9,modelValue:$.alphaCurve,"onUpdate:modelValue":U=>$.alphaCurve=U,"default-value":I(W)},null,8,["modelValue","onUpdate:modelValue","default-value"])):_e("",!0)]),_:2},1032,["resource","resource-count","onPick","onReset","onRemove","onUpdateWeight","onToggleLock"]))),128)),w("input",{ref_key:"trailTextureFileInput",ref:i,class:"file-input",type:"file",accept:"image/png,image/jpeg,image/webp",onChange:j[48]||(j[48]=(...$)=>I(l)&&I(l)(...$))},null,544),w("div",i7,[Te(Ue,{label:H.$t("modifiers.gridRows"),min:2,max:16,step:1,"model-value":I(t).config.trailGridRows,"onUpdate:modelValue":j[49]||(j[49]=$=>I(o)("trailGridRows",$))},null,8,["label","model-value"]),Te(Ue,{label:H.$t("modifiers.gridCols"),min:2,max:32,step:1,"model-value":I(t).config.trailGridCols,"onUpdate:modelValue":j[50]||(j[50]=$=>I(o)("trailGridCols",$))},null,8,["label","model-value"])]),w("div",n7,k(H.$t("modifiers.trailHint")),1)])):_e("",!0)]),w("div",s7,[w("label",r7,[pe(w("input",{type:"checkbox","onUpdate:modelValue":j[51]||(j[51]=$=>I(t).config.emitterFollow=$),disabled:I(t).config.streamBehavior==="loop"},null,8,o7),[[_t,I(t).config.emitterFollow]]),j[91]||(j[91]=w("span",{class:"switch-ui"},null,-1)),w("span",null,k(H.$t("modifiers.enableFollow")),1)]),I(t).config.emitterFollow&&I(t).config.streamBehavior!=="loop"?(Q(),te("div",a7,[w("label",l7,[w("span",null,k(H.$t("modifiers.followMode")),1),w("select",{value:I(t).config.emitterFollowMode,class:"inp",onChange:j[52]||(j[52]=$=>I(M)($,I(t).config))},[w("option",h7,k(H.$t("modifiers.noFollow")),1),w("option",u7,k(H.$t("modifiers.followPath")),1),I(g)||I(t).config.emitterFollowMode==="bone"?(Q(),te("option",d7,k(H.$t("modifiers.selectedBone")),1)):_e("",!0)],40,c7)]),I(t).config.emitterFollowMode==="path"?(Q(),te(Me,{key:0},[w("label",f7,[w("span",null,k(H.$t("modifiers.followPath")),1),pe(w("select",{"onUpdate:modelValue":j[53]||(j[53]=$=>I(t).config.emitterFollowPathId=$),class:"inp"},[w("option",m7,k(H.$t("modifiers.noFollow")),1),(Q(!0),te(Me,null,It(I(e).paths,$=>(Q(),te("option",{key:$.id,value:$.id},k($.name),9,p7))),128))],512),[[St,I(t).config.emitterFollowPathId,void 0,{number:!0}]])]),w("label",g7,[w("span",null,k(H.$t("modifiers.emitterAngleMode")),1),pe(w("select",{"onUpdate:modelValue":j[54]||(j[54]=$=>I(t).config.emitterAngleMode=$),class:"inp"},[w("option",v7,k(H.$t("modifiers.fixedAngle")),1),w("option",y7,k(H.$t("modifiers.followMoveDirection")),1)],512),[[St,I(t).config.emitterAngleMode]])]),w("div",b7,[w("span",null,k(H.$t("modifiers.moveProgressCurve")),1)]),Te(bs,{modelValue:I(t).config.emitterFollowCurve,"onUpdate:modelValue":j[55]||(j[55]=$=>I(t).config.emitterFollowCurve=$),"default-value":I(B)},null,8,["modelValue","default-value"]),w("div",x7,[w("label",w7,[w("span",null,k(H.$t("modifiers.moveDuration")),1),pe(w("input",{"onUpdate:modelValue":j[56]||(j[56]=$=>I(t).config.emitterFollowDuration=$),type:"number",min:"0.05",step:"0.05",class:"inp"},null,512),[[Je,I(t).config.emitterFollowDuration,void 0,{number:!0}]])]),w("label",S7,[w("span",null,k(H.$t("modifiers.followSpace")),1),pe(w("select",{"onUpdate:modelValue":j[57]||(j[57]=$=>I(t).config.emitterFollowSpace=$),class:"inp"},[w("option",_7,k(H.$t("modifiers.localSpace")),1),w("option",T7,k(H.$t("modifiers.worldSpace")),1)],512),[[St,I(t).config.emitterFollowSpace]])])]),w("label",E7,[w("span",null,k(H.$t("modifiers.moveDirection")),1),pe(w("select",{"onUpdate:modelValue":j[58]||(j[58]=$=>I(t).config.emitterFollowDirection=$),class:"inp"},[w("option",C7,k(H.$t("modifiers.forward")),1),w("option",M7,k(H.$t("modifiers.reverse")),1)],512),[[St,I(t).config.emitterFollowDirection]])]),Te(Ue,{label:H.$t("modifiers.followOffset"),min:0,max:1,step:.01,modelValue:I(t).config.emitterFollowOffset,"onUpdate:modelValue":j[59]||(j[59]=$=>I(t).config.emitterFollowOffset=$)},null,8,["label","modelValue"]),w("div",A7,k(H.$t("modifiers.followSpaceHint")),1)],64)):I(t).config.emitterFollowMode==="bone"?(Q(),te(Me,{key:1},[I(v)?(Q(),te("div",I7,[yt(k(H.$t("modifiers.followTarget")),1),w("strong",null,k(I(v).spine.name)+" / "+k(I(v).boneName),1)])):(Q(),te("div",P7,k(H.$t("modifiers.noValidBone")),1)),I(g)&&(!I(v)||I(g).spine.id!==I(v).spine.id||I(g).boneName!==I(v).boneName)?(Q(),te("button",{key:2,class:"bone-follow-rebind",onClick:j[60]||(j[60]=$=>I(P)(I(t).config))},k(I(v)?H.$t("modifiers.rebind"):H.$t("modifiers.bind"))+k(H.$t("modifiers.selectedBoneLabel"))+k(I(g).spine.name)+" / "+k(I(g).boneName),1)):_e("",!0),I(v)?(Q(),te(Me,{key:3},[w("label",R7,[w("span",null,k(H.$t("modifiers.followSpace")),1),pe(w("select",{"onUpdate:modelValue":j[61]||(j[61]=$=>I(t).config.emitterFollowSpace=$),class:"inp"},[w("option",k7,k(H.$t("modifiers.boneLocalSpace")),1),w("option",F7,k(H.$t("modifiers.boneWorldSpace")),1)],512),[[St,I(t).config.emitterFollowSpace]])]),w("div",L7,[w("label",O7,[w("span",null,k(H.$t("modifiers.offsetX")),1),pe(w("input",{"onUpdate:modelValue":j[62]||(j[62]=$=>I(t).config.emitterFollowBoneOffsetX=$),type:"number",step:"1",class:"inp"},null,512),[[Je,I(t).config.emitterFollowBoneOffsetX,void 0,{number:!0}]])]),w("label",$7,[w("span",null,k(H.$t("modifiers.offsetY")),1),pe(w("input",{"onUpdate:modelValue":j[63]||(j[63]=$=>I(t).config.emitterFollowBoneOffsetY=$),type:"number",step:"1",class:"inp"},null,512),[[Je,I(t).config.emitterFollowBoneOffsetY,void 0,{number:!0}]])])]),w("div",N7,[w("label",D7,[w("span",null,k(H.$t("modifiers.rotationOffset")),1),pe(w("input",{"onUpdate:modelValue":j[64]||(j[64]=$=>I(t).config.emitterFollowBoneRotation=$),type:"number",step:"1",class:"inp"},null,512),[[Je,I(t).config.emitterFollowBoneRotation,void 0,{number:!0}]])]),w("label",B7,[w("span",null,k(H.$t("modifiers.scaleOffsetX")),1),pe(w("input",{"onUpdate:modelValue":j[65]||(j[65]=$=>I(t).config.emitterFollowBoneScaleX=$),type:"number",step:"0.05",class:"inp"},null,512),[[Je,I(t).config.emitterFollowBoneScaleX,void 0,{number:!0}]])]),w("label",U7,[w("span",null,k(H.$t("modifiers.scaleOffsetY")),1),pe(w("input",{"onUpdate:modelValue":j[66]||(j[66]=$=>I(t).config.emitterFollowBoneScaleY=$),type:"number",step:"0.05",class:"inp"},null,512),[[Je,I(t).config.emitterFollowBoneScaleY,void 0,{number:!0}]])])]),w("div",V7,k(H.$t("modifiers.boneFollowHint")),1)],64)):_e("",!0)],64)):_e("",!0)])):_e("",!0)]),w("div",X7,[w("label",Y7,[pe(w("input",{type:"checkbox","onUpdate:modelValue":j[67]||(j[67]=$=>I(t).config.collision=$)},null,512),[[_t,I(t).config.collision]]),j[92]||(j[92]=w("span",{class:"switch-ui"},null,-1)),w("span",null,k(H.$t("modifiers.enableCollision")),1)]),I(t).config.collision?(Q(),te("div",G7,[w("div",H7,k(H.$t("modifiers.collisionObjects")),1),w("div",j7,[(Q(!0),te(Me,null,It(I(y),$=>(Q(),te("span",{key:$.id,class:Pe(["collision-filter-tag",{disabled:!$.enabled}]),title:$.enabled?$.name:H.$t("modifiers.colliderDisabled",{name:$.name})},[w("span",null,k($.name),1),w("button",{type:"button","aria-label":H.$t("modifiers.clearCollider",{name:$.name}),onClick:U=>I(E)($.id)},"×",8,z7)],10,W7))),128)),w("button",{type:"button",class:Pe(["collision-filter-add",{active:I(b)}]),disabled:I(x).length===0,title:I(x).length?H.$t("modifiers.addCollider"):H.$t("modifiers.noAvailableColliders"),onClick:j[68]||(j[68]=$=>b.value=!I(b))},"+",10,q7)]),I(y).length===0?(Q(),te("div",K7,k(H.$t("modifiers.noCollidersSelected")),1)):_e("",!0),I(b)&&I(x).length?(Q(),te("div",J7,[(Q(!0),te(Me,null,It(I(x),$=>(Q(),te("button",{key:$.id,type:"button",onClick:U=>I(_)($.id)},[w("span",null,k($.name),1),w("small",null,k($.enabled?H.$t("modifiers.available"):H.$t("modifiers.disabled")),1)],8,Z7))),128))])):_e("",!0),w("div",Q7,k(H.$t("modifiers.collisionHint")),1)])):_e("",!0)]),w("div",e9,[w("label",t9,[pe(w("input",{"onUpdate:modelValue":j[69]||(j[69]=$=>I(t).config.eventEnabled=$),type:"checkbox"},null,512),[[_t,I(t).config.eventEnabled]]),j[93]||(j[93]=w("span",{class:"switch-ui"},null,-1)),w("span",null,k(H.$t("modifiers.enableSubEmitter")),1)]),I(t).config.eventEnabled?(Q(),te("div",i9,[(Q(!0),te(Me,null,It(I(t).config.events,($,U)=>(Q(),te("div",{key:$.id,class:"event-card"},[w("div",n9,[pe(w("select",{"onUpdate:modelValue":z=>$.event=z,class:"inp event-select",title:H.$t("modifiers.triggerTiming")},[w("option",r9,k(H.$t("modifiers.birth")),1),w("option",o9,k(H.$t("modifiers.death")),1),w("option",a9,k(H.$t("modifiers.collision")),1)],8,s9),[[St,$.event]]),pe(w("select",{"onUpdate:modelValue":z=>$.targetSystemId=z,class:"inp event-target",title:H.$t("modifiers.chooseTarget")},[w("option",c9,k(H.$t("modifiers.noTarget")),1),(Q(!0),te(Me,null,It(L.value,z=>(Q(),te("option",{key:z.id,value:z.id},k(z.config.name||`ParticleSystem${z.id}`),9,h9))),128))],8,l9),[[St,$.targetSystemId,void 0,{number:!0}]]),w("button",{type:"button",class:"event-remove",title:H.$t("modifiers.deleteSubEmitter"),onClick:z=>Z(U)},"✕",8,u9)]),w("label",d9,[w("span",null,k(H.$t("modifiers.probability")),1),pe(w("input",{"onUpdate:modelValue":z=>$.probability=z,type:"number",min:"0",max:"1",step:"0.01",class:"inp"},null,8,f9),[[Je,$.probability,void 0,{number:!0}]])]),$.event==="collision"?(Q(),te("label",m9,[w("span",null,k(H.$t("modifiers.collisionLimit")),1),w("input",{value:$.collisionLimit??1,type:"number",min:"1",max:"4",step:"1",class:"inp",onInput:z=>se($,z)},null,40,p9)])):_e("",!0),w("div",g9,[w("span",null,k(H.$t("modifiers.inherit")),1),w("button",{type:"button",class:"inherit-trigger",onPointerdown:j[70]||(j[70]=tt(()=>{},["stop"])),onClick:tt(z=>ve($,z),["stop"])},[w("span",y9,k(G($)),1),j[94]||(j[94]=w("i",null,"⌄",-1))],40,v9)]),K($,"color")?(Q(),te("label",b9,[w("span",null,k(H.$t("modifiers.colorInheritMode")),1),pe(w("select",{"onUpdate:modelValue":z=>$.colorInheritMode=z,class:"inp"},[w("option",w9,k(H.$t("modifiers.add")),1),w("option",S9,k(H.$t("modifiers.replace")),1)],8,x9),[[St,$.colorInheritMode]])])):_e("",!0)]))),128)),w("button",{type:"button",class:"event-add",onClick:q},k(H.$t("modifiers.addSubEmitter")),1)])):_e("",!0)])],512),[[Fi,!I(S).mods]])]),(Q(),Pt(ux,{to:"body"},[F.value&&D.value?(Q(),te("div",{key:0,class:"inherit-menu",style:Vt({left:`${F.value.left}px`,top:`${F.value.top}px`,width:`${F.value.width}px`}),onPointerdown:j[73]||(j[73]=tt(()=>{},["stop"]))},[w("button",{type:"button",class:"inherit-option",onClick:j[71]||(j[71]=$=>oe(D.value))},[w("span",_9,k(X(D.value).length===0?"✓":""),1),yt(k(H.$t("modifiers.inheritNone")),1)]),w("button",{type:"button",class:"inherit-option",onClick:j[72]||(j[72]=$=>le(D.value))},[w("span",T9,k(X(D.value).length===4?"✓":""),1),yt(k(H.$t("modifiers.inheritAll")),1)]),j[95]||(j[95]=w("div",{class:"inherit-divider"},null,-1)),(Q(!0),te(Me,null,It(N.value,$=>(Q(),te("button",{key:$.key,type:"button",class:"inherit-option",onClick:U=>J(D.value,$.key)},[w("span",C9,k(K(D.value,$.key)?"✓":""),1),yt(k($.label),1)],8,E9))),128))],36)):_e("",!0)]))],64))}}),A9=li(M9,[["__scopeId","data-v-f5ccc52c"]]),I9={class:"group"},P9={class:"caret"},R9=["title"],k9={class:"group-body export-settings"},F9={class:"export-field"},L9={class:"export-field"},O9={class:"export-field"},$9={value:"linear"},N9={value:"bezier"},D9={class:"export-help"},B9={key:0,class:"export-help"},U9={class:"export-fps-row"},V9={class:"export-field export-fps-field"},X9={class:"export-checkbox"},Y9={class:"export-help"},G9={class:"export-switches"},H9={class:"switch-row export-switch"},j9={class:"switch-row export-switch"},W9={class:"switch-row export-switch export-switch-last"},z9=qt({__name:"ExportSettingsSection",setup(n){const{exportSettings:e,collapsed:t,toggle:i,resetModule:s,normalizeExportFps:r,select:o}=oo();return(a,c)=>(Q(),te("div",I9,[w("div",{class:"group-head",onClick:c[1]||(c[1]=l=>I(i)("export"))},[w("span",P9,k(I(t).export?"▸":"▾"),1),w("span",null,k(a.$t("export.title")),1),w("button",{class:"group-reset",title:a.$t("export.reset"),onClick:c[0]||(c[0]=tt(l=>I(s)("export"),["stop"]))},k(a.$t("common.reset")),9,R9)]),pe(w("div",k9,[w("label",F9,[w("span",null,k(a.$t("export.imagesPath")),1),pe(w("input",{"onUpdate:modelValue":c[2]||(c[2]=l=>I(e).imagesPath=l),class:"inp export-input",type:"text",placeholder:"./images/"},null,512),[[Je,I(e).imagesPath,void 0,{trim:!0}]])]),w("label",L9,[w("span",null,k(a.$t("export.spineVersion")),1),pe(w("select",{"onUpdate:modelValue":c[3]||(c[3]=l=>I(e).spineVersion=l),class:"inp export-input"},[...c[11]||(c[11]=[RM('',5)])],512),[[St,I(e).spineVersion]])]),w("label",O9,[w("span",null,k(a.$t("export.keyframeCurve")),1),pe(w("select",{"onUpdate:modelValue":c[4]||(c[4]=l=>I(e).keyframeCurve=l),class:"inp export-input"},[w("option",$9,k(a.$t("export.linear")),1),w("option",N9,k(a.$t("export.smoothBezier")),1)],512),[[St,I(e).keyframeCurve]])]),w("div",D9,k(a.$t("export.bezierHelp")),1),I(e).spineVersion==="3.8"?(Q(),te("div",B9,k(a.$t("export.spine38Help")),1)):_e("",!0),w("div",U9,[w("label",V9,[w("span",null,k(a.$t("export.fps")),1),pe(w("input",{"onUpdate:modelValue":c[5]||(c[5]=l=>I(e).fps=l),class:"inp export-input",type:"number",min:"1",max:"240",step:"1",onChange:c[6]||(c[6]=(...l)=>I(r)&&I(r)(...l))},null,544),[[Je,I(e).fps,void 0,{number:!0}]])]),w("label",X9,[pe(w("input",{"onUpdate:modelValue":c[7]||(c[7]=l=>I(e).omitFps=l),type:"checkbox"},null,512),[[_t,I(e).omitFps]]),yt(k(a.$t("export.omitFps")),1)])]),w("div",Y9,k(a.$t("export.fpsHelp")),1),w("div",G9,[w("label",H9,[pe(w("input",{"onUpdate:modelValue":c[8]||(c[8]=l=>I(e).integerFrameAlignment=l),type:"checkbox"},null,512),[[_t,I(e).integerFrameAlignment]]),c[12]||(c[12]=w("span",{class:"switch-ui"},null,-1)),w("span",null,k(a.$t("export.integerFrames")),1)]),w("label",j9,[pe(w("input",{"onUpdate:modelValue":c[9]||(c[9]=l=>I(e).bonePool=l),type:"checkbox"},null,512),[[_t,I(e).bonePool]]),c[13]||(c[13]=w("span",{class:"switch-ui"},null,-1)),w("span",null,k(a.$t("export.bonePool")),1)]),w("label",W9,[pe(w("input",{"onUpdate:modelValue":c[10]||(c[10]=l=>I(e).excludeEmptyAnimations=l),type:"checkbox"},null,512),[[_t,I(e).excludeEmptyAnimations]]),c[14]||(c[14]=w("span",{class:"switch-ui"},null,-1)),w("span",null,k(a.$t("export.excludeEmpty")),1)])])],512),[[Fi,!I(t).export]])]))}}),q9=li(z9,[["__scopeId","data-v-63cfb71e"]]),K9={class:"spine-export-actions"},J9=["disabled","title"],Z9=["disabled","title"],Q9=["disabled","title"],ez={key:0},tz=["href","title"],iz=["title"],nz=["href"],sz=qt({__name:"ParticleExportFooter",setup(n){const{exportSettings:e,exportBusy:t,exportTarget:i,exportMessage:s,exportError:r,connectorPairUrl:o,connectorStatusText:a,connectorStatusClass:c,connectorReady:l,connectorAuthorizationUrl:h,connectorDisabledReason:u,connectorButtonTitle:d,refreshConnectorHealth:f,exportSpineJson:m,exportSpineProject:p,exportSpineImages:g}=oo();return(v,b)=>(Q(),te(Me,null,[w("div",K9,[w("button",{type:"button",class:"export-spine-json",disabled:I(t),title:I(t)?v.$t("export.baking"):v.$t("export.exportJsonTitle",{version:I(e).spineVersion}),onClick:b[0]||(b[0]=(...y)=>I(m)&&I(m)(...y))},k(I(t)&&I(i)==="json"?v.$t("export.preparing"):v.$t("export.exportJson")),9,J9),w("button",{type:"button",class:"export-spine-images",disabled:I(t),title:v.$t("export.exportImagesTitle"),onClick:b[1]||(b[1]=(...y)=>I(g)&&I(g)(...y))},k(I(t)&&I(i)==="images"?v.$t("export.organizingImages"):v.$t("export.exportImages")),9,Z9),w("button",{type:"button",class:"export-spine-project",disabled:I(t)||!I(l),title:I(d),onClick:b[2]||(b[2]=(...y)=>I(p)&&I(p)(...y))},[w("span",null,k(I(t)&&I(i)==="spine"?v.$t("export.generatingProject"):v.$t("export.exportSpine")),1),!I(t)&&I(u)?(Q(),te("small",ez,k(I(u)),1)):_e("",!0)],8,Q9)]),w("div",{class:Pe(["connector-status",I(c)])},[b[5]||(b[5]=w("span",{class:"connector-dot"},null,-1)),yt(k(I(a))+" ",1),I(h)?(Q(),te("a",{key:0,href:I(h),target:"_blank",rel:"noopener",title:v.$t("export.authorizeTitle")},k(v.$t("export.authorize")),9,tz)):_e("",!0),w("button",{type:"button",title:v.$t("export.refreshConnector"),onClick:b[3]||(b[3]=(...y)=>I(f)&&I(f)(...y))},k(v.$t("export.refresh")),9,iz)],2),I(s)?(Q(),te("div",{key:0,class:Pe(["export-message",{error:I(r)}])},[yt(k(I(s))+" ",1),I(o)?(Q(),te("a",{key:0,href:I(o),target:"_blank",rel:"noopener",onClick:b[4]||(b[4]=y=>o.value="")},k(v.$t("export.authorize")),9,nz)):_e("",!0)],2)):_e("",!0)],64))}}),rz=li(sz,[["__scopeId","data-v-33af5045"]]),oz={class:"panel"},az={class:"panel-header"},lz={class:"panel-scroll"},cz=qt({__name:"ParticlePanel",setup(n){const{activeObjectType:e,sys:t}=A5();return(i,s)=>(Q(),te("div",oz,[w("div",az,[w("span",null,k(i.$t("app.title")),1)]),w("div",lz,[Te(B5),Te(uY),I(e)==="particle"&&I(t)?(Q(),te(Me,{key:0},[Te(h6),Te($6),Te(gj),Te(A9),Te(q9)],64)):_e("",!0)]),Te(rz)]))}}),hz=li(cz,[["__scopeId","data-v-14a55de6"]]),ha=n=>Math.max(0,Number(n)||0);function uz(n,e){const t=Math.max(1,e),i=new Map(n.map(b=>[b.id,b])),s=new Set;for(const b of n)if(b.config.eventEnabled)for(const y of b.config.events||[])y.targetSystemId>0&&y.targetSystemId!==b.id&&i.has(y.targetSystemId)&&s.add(y.targetSystemId);const r=new Map;for(const b of n)if(b.config.eventEnabled)for(const y of b.config.events||[]){if(y.targetSystemId<=0||y.targetSystemId===b.id||!i.has(y.targetSystemId))continue;const x=r.get(y.targetSystemId);x?x.push({parent:b,rule:y}):r.set(y.targetSystemId,[{parent:b,rule:y}])}const o=b=>ha(b.delay),a=b=>ha(b.delay),c=b=>{const y=o(b);return b.mode!=="stream"?y:b.streamBehavior==="loop"?y+zn(b,t).total/t:y+Math.max(1/t,Number(b.duration)||0)},l=b=>{const y=ha(b.lifeMin),x=ha(b.lifeMax);return b.lifeMode==="fixed"?y:Math.min(y,x)},h=b=>{const y=ha(b.lifeMin),x=ha(b.lifeMax);return b.lifeMode==="fixed"?y:Math.max(y,x)},u=new Map,d=new Map,f=new Set,m=new Set,p=b=>{const y=u.get(b.id);if(y!=null)return y;if(f.has(b.id))return o(b.config);f.add(b.id);let x=1/0;for(const{parent:_,rule:E}of r.get(b.id)||[]){const S=s.has(_.id)?p(_)+a(_.config):o(_.config),C=E.event==="death"?l(_.config):0;x=Math.min(x,S+C)}return Number.isFinite(x)||(x=o(b.config)),f.delete(b.id),u.set(b.id,x),x},g=b=>{const y=d.get(b.id);if(y!=null)return y;if(m.has(b.id))return c(b.config);m.add(b.id);let x=-1/0;for(const{parent:_,rule:E}of r.get(b.id)||[]){const S=s.has(_.id)?g(_)+a(_.config):c(_.config),C=E.event==="birth"?0:h(_.config);x=Math.max(x,S+C)}return Number.isFinite(x)||(x=c(b.config)),m.delete(b.id),d.set(b.id,x),x},v=new Map;for(const b of s){const y=i.get(b);if(!y)continue;const x=p(y),_=g(y);v.set(b,{firstTrigger:x,lastTrigger:_,end:Math.max(x,_)+h(y.config)})}return v}const dz={class:"timeline"},fz={class:"tl-controls"},mz=["title"],pz=["title"],gz=["title"],vz=["title"],yz=["title"],bz=["title","aria-label"],xz={class:"tl-ab-loop"},wz=["title"],Sz={class:"tl-ab-title"},_z=["title"],Tz=["max","aria-label","onKeydown"],Ez=["title"],Cz=["min","max","aria-label","onKeydown"],Mz={class:"tl-frame"},Az={class:"tl-legend"},Iz=["disabled","title"],Pz={class:"tl-animation-menu-title"},Rz=["onClick"],kz={key:0},Fz={class:"tl-animation-editor"},Lz=["aria-label"],Oz=["title"],$z={key:0,class:"tl-animation-error"},Nz={class:"tl-animation-actions"},Dz=["disabled"],Bz={key:1,class:"tl-animation-hint"},Uz={class:"tl-anim tl-spine-preview"},Vz=["value","disabled"],Xz={value:""},Yz=["value"],Gz={class:"tl-zoom"},Hz={class:"tl-ticks"},jz={class:"tl-ticklabel"},Wz={class:"tl-lanes"},zz=["onPointerdown"],qz={class:"lane-name"},Kz=["title","onPointerdown"],Jz=["title","onPointerdown"],Zz=["title","onPointerdown"],Qz={class:"lane-name"},eq={key:0,class:"tl-empty"},tq=qt({__name:"Timeline",setup(n){const e=Wo(),{t}=fn(),i=De(null),s=De(null),r=De(!1),o=De("animation"),a=De("");da(()=>{(!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 $ of e.systems)(!$.animation||!e.timeline.animations.includes($.animation))&&($.animation=e.timeline.animations[0])});const c=Fe(()=>e.systems.find($=>$.id===e.activeId)||null);function l(){c.value&&(r.value=!r.value,o.value=c.value.animation,a.value="")}function h($){const U=c.value;U&&(e.setSystemAnimation(U.id,$),o.value=$,a.value="")}function u(){const $=e.addAnimation();o.value=$,a.value=""}function d(){var z;const $=((z=c.value)==null?void 0:z.animation)||e.timeline.animation,U=o.value.trim();if(!U){a.value=t("timeline.animationNameEmpty");return}if(U!==$&&e.timeline.animations.includes(U)){a.value=t("timeline.animationNameDuplicate");return}if(!e.renameAnimation($,U)){a.value=t("timeline.animationRenameFailed");return}o.value=U,a.value=""}function f(){var z,ee;const $=((z=c.value)==null?void 0:z.animation)||e.timeline.animation;if(!e.removeAnimation($)){a.value=t("timeline.keepOneAnimation");return}const U=((ee=c.value)==null?void 0:ee.animation)||e.timeline.animation;o.value=U,a.value=""}function m($){var U;(U=s.value)!=null&&U.contains($.target)||(r.value=!1)}Sn(()=>document.addEventListener("pointerdown",m)),eo(()=>document.removeEventListener("pointerdown",m));const p=Fe(()=>Math.max(1,e.timeline.fps||30)),g=De(Math.max(120,e.timeline.totalFrames)),v=De({}),b=De({}),y=De({}),x=De({}),_=De(String(e.timeline.playbackStart)),E=De(String(e.timeline.playbackEnd));ei(()=>e.timeline.playbackStart,$=>{_.value=String($)}),ei(()=>e.timeline.playbackEnd,$=>{E.value=String($)});const S=Fe(()=>e.timeline.totalFrames);ei(S,$=>{$>g.value&&(g.value=Math.min(2e3,$))});const C=Fe(()=>g.value<=30?t("timeline.zoomIn"):g.value>=300?t("timeline.zoomOut"):t("timeline.zoomFit")),M=Fe(()=>e.spines.filter($=>$.selectedAnimation&&$.animations.some(U=>U.name===$.selectedAnimation&&U.duration>0))),P=Fe(()=>(e.activeObjectType==="spine"?e.spines.find(U=>U.id===e.activeObjectId&&U.animations.length):null)||e.spines.find(U=>U.animations.length)||null);function A($){const U=P.value;U&&(U.selectedAnimation=$.target.value,e.recalcTotalFrames(),e.timeline.frame=0)}function R(){e.setPlaybackStart(Number(_.value)),_.value=String(e.timeline.playbackStart)}function B(){e.setPlaybackEnd(Number(E.value)),E.value=String(e.timeline.playbackEnd)}function O(){var U;const $=((U=i.value)==null?void 0:U.clientWidth)||600;return g.value/$}const W=Fe(()=>{const $=[],U=g.value;let z=1;g.value<=10?z=1:g.value<=50?z=5:g.value<=200?z=10:g.value<=500?z=50:z=100;for(let ee=0;ee<=U;ee+=z)$.push({f:ee,px:ee/O()});return $}),V=Fe(()=>e.timeline.frame/O()),Y=Fe(()=>Xa(e.systems)),L=Fe(()=>uz(e.systems,p.value));function N($){return Y.value.has($.id)}function F($){var z;return(N($)?((z=L.value.get($.id))==null?void 0:z.firstTrigger)??0:0)*p.value/O()+4}function D($){var ee;const U=$.config;if(N($)){const ne=((ee=L.value.get($.id))==null?void 0:ee.firstTrigger)??0,ue=v.value[$.id]??Math.max(0,Number(U.delay)||0);return(ne+ue)*p.value/O()}return(v.value[$.id]??Math.max(0,Number(U.delay)||0))*p.value/O()}function X($){const U=$.config,z=Math.max(0,Number(U.lifeMin)||0),ee=Math.max(0,Number(U.lifeMax)||0);return U.lifeMode==="fixed"?z:Math.max(z,ee)}function G($){if(N($)){const U=L.value.get($.id),z=(U==null?void 0:U.firstTrigger)??0,ee=(U==null?void 0:U.end)??z;return Math.max(0,ee-z)*p.value/O()}return J($)}function K($){if(N($)||$.config.mode!=="stream")return 0;if($.config.streamBehavior==="loop"){const z=$.config;return(y.value[$.id]??zn(z,p.value).loop)/O()}return(b.value[$.id]??Math.max(1/p.value,Number($.config.duration)||1))*p.value/O()}function J($){if(N($))return G($);const U=$.config;return U.mode==="stream"&&U.streamBehavior==="loop"?le($)+K($)+ve($):K($)+X($)*p.value/O()}function oe($){const U=$.config;return U.mode==="stream"&&U.streamBehavior==="loop"}function le($){return oe($)?zn($.config,p.value).start/O():0}function ve($){return oe($)?zn($.config,p.value).end/O():0}function Se($){var U;return((U=$.animations.find(z=>z.name===$.selectedAnimation))==null?void 0:U.duration)||0}function fe($){return(x.value[$.id]??Math.max(0,Number($.timeOffset)||0))*p.value/O()}function ye($){return Se($)*p.value/O()}function q($){const U=$.deltaY<0?.8:1.25;let z=g.value*U;z=Math.min(2e3,Math.max(10,z)),g.value=Math.round(z)}function Z($){const U=i.value;e.pause();const z=ne=>{const ue=U.getBoundingClientRect(),xe=Math.floor((ne.clientX-ue.left)/ue.width*g.value);e.timeline.frame=Math.max(0,Math.min(xe,S.value-1))};z($);const ee=()=>{window.removeEventListener("pointermove",z),window.removeEventListener("pointerup",ee)};window.addEventListener("pointermove",z),window.addEventListener("pointerup",ee)}function se($,U){$.stopPropagation();const z=$.clientX,ee=Math.max(0,Number(U.config.delay)||0),ne=O()/p.value,ue=Be=>{const he=(Be.clientX-z)*ne,ge=Math.max(0,Math.min(ee+he,600));v.value[U.id]=Math.round(ge*p.value)/p.value},xe=Be=>{window.removeEventListener("pointermove",ue),window.removeEventListener("pointerup",be),window.removeEventListener("pointercancel",Ne);const he=v.value[U.id];delete v.value[U.id],Be&&he!=null&&he!==ee&&(U.config.delay=he)},be=()=>xe(!0),Ne=()=>xe(!1);window.addEventListener("pointermove",ue),window.addEventListener("pointerup",be),window.addEventListener("pointercancel",Ne)}function H($,U){var Le;$.stopPropagation();const z=oe(U),ee=Math.max(0,Number(U.config.duration)||0),ne=zn(U.config,p.value).loop,ue=O()/p.value,xe=((Le=$.currentTarget.closest(".lane-bar"))==null?void 0:Le.getBoundingClientRect().left)??$.clientX,be=le(U);let Ne=!1;const Be=Ce=>{if(Ne=!0,z){const Ze=Math.min(1800,Math.max(1,Math.round((Ce.clientX-xe-be)/O())));y.value[U.id]=Ze}else{const Ze=Math.max(1/p.value,Math.min((Ce.clientX-xe)*ue,600));b.value[U.id]=Math.round(Ze*p.value)/p.value}},he=Ce=>{window.removeEventListener("pointermove",Be),window.removeEventListener("pointerup",ge),window.removeEventListener("pointercancel",We);const Ze=b.value[U.id],Ee=y.value[U.id];delete b.value[U.id],delete y.value[U.id],Ce&&Ne&&z&&Ee!=null&&Ee!==ne?U.config.loopDurationFrames=Ee:Ce&&Ne&&!z&&Ze!=null&&Ze!==ee&&(U.config.duration=Ze)},ge=()=>he(!0),We=()=>he(!1);window.addEventListener("pointermove",Be),window.addEventListener("pointerup",ge),window.addEventListener("pointercancel",We)}function j($,U){$.stopPropagation();const z=$.clientX,ee=Math.max(0,Number(U.timeOffset)||0),ne=O()/p.value,ue=Be=>{const he=Math.max(0,Math.min(ee+(Be.clientX-z)*ne,600));x.value[U.id]=Math.round(he*p.value)/p.value},xe=Be=>{window.removeEventListener("pointermove",ue),window.removeEventListener("pointerup",be),window.removeEventListener("pointercancel",Ne);const he=x.value[U.id];delete x.value[U.id],Be&&he!=null&&he!==ee&&(U.timeOffset=he,e.recalcTotalFrames())},be=()=>xe(!0),Ne=()=>xe(!1);window.addEventListener("pointermove",ue),window.addEventListener("pointerup",be),window.addEventListener("pointercancel",Ne)}return($,U)=>{var z,ee,ne;return Q(),te("div",dz,[w("div",fz,[w("button",{class:Pe(["tl-btn",{on:I(e).timeline.playing}]),onClick:U[0]||(U[0]=ue=>I(e).togglePlay()),title:I(e).timeline.playing?$.$t("timeline.pause"):$.$t("timeline.play")},k(I(e).timeline.playing?"❚❚":"▶"),11,mz),w("button",{class:"tl-btn",onClick:U[1]||(U[1]=ue=>I(e).toStart()),title:$.$t("timeline.toStart")},"⏮",8,pz),w("button",{class:"tl-btn",onClick:U[2]||(U[2]=ue=>I(e).previousFrame()),title:$.$t("timeline.previous")},"◀",8,gz),w("button",{class:"tl-btn",onClick:U[3]||(U[3]=ue=>I(e).nextFrame()),title:$.$t("timeline.next")},"▶",8,vz),w("button",{class:"tl-btn",onClick:U[4]||(U[4]=ue=>I(e).toEnd()),title:$.$t("timeline.toEnd")},"⏭",8,yz),w("button",{class:Pe(["tl-btn",{on:I(e).timeline.loop}]),title:$.$t("timeline.continuousLoop"),"aria-label":$.$t("timeline.continuousLoop"),onClick:U[5]||(U[5]=ue=>I(e).toggleLoop())},"⟳",10,bz),w("div",xz,[w("button",{class:Pe(["tl-ab-toggle",{on:I(e).timeline.abLoop}]),title:$.$t("timeline.abLoop"),onClick:U[6]||(U[6]=ue=>I(e).toggleABLoop())},[w("span",null,k($.$t("timeline.abLoopShort")),1),U[12]||(U[12]=w("i",{class:"tl-switch"},[w("b")],-1))],10,wz),I(e).timeline.abLoop?(Q(),te("div",{key:0,class:"tl-ab-popover",onPointerdown:U[9]||(U[9]=tt(()=>{},["stop"]))},[w("div",Sz,k($.$t("timeline.abRange")),1),w("label",{class:"tl-range",title:$.$t("timeline.playbackStart")},[U[13]||(U[13]=w("span",null,"A",-1)),pe(w("input",{"onUpdate:modelValue":U[7]||(U[7]=ue=>_.value=ue),type:"number",min:"0",max:Math.max(0,I(e).timeline.playbackEnd-1),"aria-label":$.$t("timeline.startFrame"),onChange:R,onKeydown:Wr(tt(R,["prevent"]),["enter"])},null,40,Tz),[[Je,_.value]])],8,_z),w("label",{class:"tl-range",title:$.$t("timeline.playbackEnd")},[U[14]||(U[14]=w("span",null,"B",-1)),pe(w("input",{"onUpdate:modelValue":U[8]||(U[8]=ue=>E.value=ue),type:"number",min:I(e).timeline.playbackStart+1,max:Math.max(1,I(e).timeline.totalFrames-1),"aria-label":$.$t("timeline.endFrame"),onChange:B,onKeydown:Wr(tt(B,["prevent"]),["enter"])},null,40,Cz),[[Je,E.value]])],8,Ez)],32)):_e("",!0)]),w("span",Mz,k($.$t("timeline.frameStatus",{current:I(e).timeline.frame,total:Math.max(0,I(e).timeline.totalFrames-1)})),1),w("span",Az,[U[15]||(U[15]=w("i",{class:"legend-emission"},null,-1)),yt(k($.$t("timeline.emission"))+" ",1),U[16]||(U[16]=w("i",{class:"legend-life"},null,-1)),yt(k($.$t("timeline.particleLife"))+" ",1),U[17]||(U[17]=w("i",{class:"legend-spine"},null,-1)),yt(k($.$t("timeline.spineAnimation")),1)]),w("div",{ref_key:"animationMenuRef",ref:s,class:"tl-anim tl-owner-animation"},[w("span",null,k($.$t("timeline.ownerAnimation")),1),w("button",{class:"tl-animation-trigger",disabled:!c.value,title:$.$t("timeline.setOwnerAnimation"),onClick:tt(l,["stop"])},[w("span",null,k(((z=c.value)==null?void 0:z.animation)||I(e).timeline.animation),1),U[18]||(U[18]=w("i",null,"⌄",-1))],8,Iz),r.value?(Q(),te("div",{key:0,class:"tl-animation-menu",onPointerdown:U[11]||(U[11]=tt(()=>{},["stop"]))},[w("div",Pz,k($.$t("timeline.chooseOwnerAnimation")),1),(Q(!0),te(Me,null,It(I(e).timeline.animations,ue=>{var xe,be;return Q(),te("button",{key:ue,class:Pe(["tl-animation-option",{on:((xe=c.value)==null?void 0:xe.animation)===ue}]),onClick:Ne=>h(ue)},[w("span",null,k(ue),1),((be=c.value)==null?void 0:be.animation)===ue?(Q(),te("i",kz,"✓")):_e("",!0)],10,Rz)}),128)),w("div",Fz,[pe(w("input",{"onUpdate:modelValue":U[10]||(U[10]=ue=>o.value=ue),class:"tl-animation-name",maxlength:"64","aria-label":$.$t("timeline.animationName"),onKeydown:Wr(d,["enter"])},null,40,Lz),[[Je,o.value]]),w("button",{title:$.$t("timeline.renameAnimation"),onClick:d},k($.$t("timeline.rename")),9,Oz)]),a.value?(Q(),te("div",$z,k(a.value),1)):_e("",!0),w("div",Nz,[w("button",{onClick:u},k($.$t("timeline.newAnimation")),1),w("button",{disabled:I(e).timeline.animations.length<=1,onClick:f},k($.$t("common.delete")),9,Dz)]),I(e).timeline.animations.length<=1?(Q(),te("div",Bz,k($.$t("timeline.keepOneAnimation")),1)):_e("",!0)],32)):_e("",!0)],512),w("label",Uz,[yt(k($.$t("timeline.spinePreview"))+" ",1),w("select",{class:"tl-sel",value:((ee=P.value)==null?void 0:ee.selectedAnimation)||"",disabled:!P.value,onChange:A},[w("option",Xz,k(P.value?$.$t("timeline.none"):$.$t("timeline.noSpineAnimation")),1),(Q(!0),te(Me,null,It(((ne=P.value)==null?void 0:ne.animations)||[],ue=>(Q(),te("option",{key:ue.name,value:ue.name},k(ue.name)+"("+k(ue.duration.toFixed(2))+"s) ",9,Yz))),128))],40,Vz)]),w("span",Gz,k(C.value),1)]),w("div",{class:"tl-viewport",ref_key:"vpRef",ref:i,onWheel:tt(q,["prevent"]),onPointerdown:Z},[w("div",Hz,[(Q(!0),te(Me,null,It(W.value,ue=>(Q(),te("div",{key:ue.f,class:"tl-tickline",style:Vt({left:ue.px+"px"})},[w("span",jz,k(ue.f)+"f",1)],4))),128))]),w("div",{class:"tl-playhead",style:Vt({left:V.value+"px"})},null,4),w("div",Wz,[(Q(!0),te(Me,null,It(I(e).systems,(ue,xe)=>(Q(),te("div",{key:ue.id,class:"tl-lane"},[w("span",{class:Pe(["lane-ico",{"sub-lane-ico":N(ue)}]),style:Vt({left:F(ue)+"px"})},"●",6),w("div",{class:Pe(["lane-bar",{"sub-emitter-bar":N(ue)}]),style:Vt({left:D(ue)+"px",width:G(ue)+"px"}),onPointerdown:tt(be=>se(be,ue),["stop"])},[w("span",qz,k(ue.config.name||$.$t("timeline.systemName",{index:xe+1})),1),w("span",{class:Pe(["bar-life",{"loop-life":!N(ue)&&oe(ue)}]),style:Vt({width:J(ue)+"px"})},null,6),!N(ue)&&oe(ue)?(Q(),te(Me,{key:0},[le(ue)?(Q(),te("span",{key:0,class:"bar-loop-transition bar-loop-start",style:Vt({width:le(ue)+"px"})},null,4)):_e("",!0),w("span",{class:"bar-emission bar-loop",style:Vt({left:le(ue)+"px",width:K(ue)+"px"})},[w("span",{class:"bar-handle",title:$.$t("timeline.dragLoopDuration"),onPointerdown:tt(be=>H(be,ue),["stop"])},null,40,Kz)],4),ve(ue)?(Q(),te("span",{key:1,class:"bar-loop-transition bar-loop-end",style:Vt({left:le(ue)+K(ue)+"px",width:ve(ue)+"px"})},null,4)):_e("",!0)],64)):!N(ue)&&ue.config.mode==="stream"?(Q(),te("span",{key:1,class:"bar-emission",style:Vt({width:K(ue)+"px"})},[w("span",{class:"bar-handle",title:$.$t("timeline.dragEmissionDuration"),onPointerdown:tt(be=>H(be,ue),["stop"])},null,40,Jz)],4)):_e("",!0)],46,zz)]))),128)),(Q(!0),te(Me,null,It(M.value,ue=>(Q(),te("div",{key:`spine-${ue.id}`,class:"tl-lane spine-lane"},[U[19]||(U[19]=w("span",{class:"lane-ico spine-ico"},"◆",-1)),w("div",{class:"spine-bar",style:Vt({left:fe(ue)+"px",width:ye(ue)+"px"}),title:$.$t("timeline.dragSpineStart"),onPointerdown:tt(xe=>j(xe,ue),["stop"])},[w("span",Qz,k(ue.name)+" · "+k(ue.selectedAnimation),1)],44,Zz)]))),128)),!I(e).systems.length&&!M.value.length?(Q(),te("div",eq,k($.$t("timeline.noAnimationData")),1)):_e("",!0)])],544)])}}}),iq=li(tq,[["__scopeId","data-v-6213c4a4"]]),nq={class:"transfer-heading"},sq={key:0},rq={class:"transfer-detail"},oq=qt({__name:"TransferProgressOverlay",setup(n){const e=De(null);return ei(()=>hi.visible,async t=>{var i;t&&(await Gu(),(i=e.value)==null||i.focus({preventScroll:!0}))},{flush:"post"}),(t,i)=>(Q(),Pt(WM,{name:"transfer-fade"},{default:Hu(()=>[I(hi).visible?(Q(),te("div",{key:0,ref_key:"overlayElement",ref:e,class:"transfer-overlay",role:"dialog","aria-modal":"true","aria-live":"polite",tabindex:"-1",onPointerdown:i[0]||(i[0]=tt(()=>{},["stop","prevent"])),onPointerup:i[1]||(i[1]=tt(()=>{},["stop","prevent"])),onClick:i[2]||(i[2]=tt(()=>{},["stop","prevent"])),onDblclick:i[3]||(i[3]=tt(()=>{},["stop","prevent"])),onContextmenu:i[4]||(i[4]=tt(()=>{},["stop","prevent"])),onWheel:i[5]||(i[5]=tt(()=>{},["stop","prevent"])),onKeydown:i[6]||(i[6]=tt(()=>{},["stop","prevent"]))},[w("div",{class:Pe(["transfer-dialog",{failed:I(hi).failed}])},[w("div",nq,[w("span",null,k(I(hi).title),1),I(hi).indeterminate?_e("",!0):(Q(),te("strong",sq,k(Math.round(I(hi).progress))+"%",1))]),w("div",{class:Pe(["transfer-track",{indeterminate:I(hi).indeterminate}])},[w("div",{class:"transfer-bar",style:Vt(I(hi).indeterminate?void 0:{width:`${I(hi).progress}%`})},null,4)],2),w("div",rq,k(I(hi).detail),1)],2)],544)):_e("",!0)]),_:1}))}}),aq=li(oq,[["__scopeId","data-v-592b922e"]]),lq=["inert","aria-hidden"],cq={class:"right"},hq={class:"stage-area"},uq=["title"],dq=qt({__name:"App",setup(n){const e=Wo();P$(e);const t=De(360),i=De(180);function s(o){o.preventDefault();const a=l=>{const h=e.settings.parameterPanelOnRight?window.innerWidth-l.clientX:l.clientX,u=Math.max(240,Math.min(h,window.innerWidth-200));t.value=u},c=()=>{window.removeEventListener("pointermove",a),window.removeEventListener("pointerup",c)};window.addEventListener("pointermove",a),window.addEventListener("pointerup",c)}function r(o){o.preventDefault();const a=o.clientY,c=i.value,l=u=>{const d=Math.max(80,Math.min(c+(a-u.clientY),window.innerHeight-200));i.value=d},h=()=>{window.removeEventListener("pointermove",l),window.removeEventListener("pointerup",h)};window.addEventListener("pointermove",l),window.addEventListener("pointerup",h)}return(o,a)=>(Q(),te(Me,null,[w("div",{class:Pe(["layout",{"panel-right":I(e).settings.parameterPanelOnRight}]),inert:I(hi).visible?!0:void 0,"aria-hidden":I(hi).visible?"true":void 0},[w("div",{class:"parameter-panel",style:Vt({width:t.value+"px"})},[Te(hz)],4),w("div",{class:"resizer-col",onPointerdown:s},null,32),w("div",cq,[w("div",hq,[Te(w4)]),w("div",{class:"resizer-row",onPointerdown:r,title:o.$t("app.resizeTimeline")},null,40,uq),w("div",{class:"timeline-area",style:Vt({height:i.value+"px"})},[Te(iq)],4)])],10,lq),Te(aq)],64))}}),fq=li(dq,[["__scopeId","data-v-07c42c10"]]);wA(fq).use(TA()).use(ac).mount("#app");export{w1 as $,Es as A,Iu as B,kt as C,Mi as D,$e as E,nn as F,Ps as G,at as H,Tt as I,xE as J,Ki as K,_n as L,$n as M,Zr as N,gd as O,Ts as P,Ql as Q,Wa as R,Wn as S,sU as T,Ke as U,p1 as V,Jn as W,YK as X,t5 as Y,hc as Z,Lg as _,it as a,Gp as a$,x1 as a0,QT as a1,e0 as a2,VK as a3,Eu as a4,$l as a5,mU as a6,Nl as a7,vd as a8,Up as a9,Zp as aA,Qp as aB,ph as aC,Lr as aD,Rh as aE,Vp as aF,nE as aG,ri as aH,KT as aI,FK as aJ,Da as aK,b1 as aL,Re as aM,ze as aN,Yp as aO,kh as aP,aE as aQ,Xp as aR,rE as aS,oE as aT,yd as aU,hE as aV,Fh as aW,fE as aX,lE as aY,uE as aZ,mE as a_,Ko as aa,t0 as ab,i0 as ac,v1 as ad,wc as ae,Sc as af,xc as ag,qo as ah,nr as ai,OK as aj,iE as ak,fU as al,qa as am,qr as an,r0 as ao,bE as ap,uU as aq,cc as ar,cn as as,y1 as at,DK as au,tl as av,Jp as aw,eg as ax,tg as ay,ig as az,Ha as b,gr as b$,Au as b0,cE as b1,ro as b2,dE as b3,n0 as b4,nU as b5,vE as b6,yE as b7,s0 as b8,Is as b9,pE as bA,o0 as bB,pd as bC,wE as bD,Hp as bE,Ei as bF,tU as bG,oU as bH,BT as bI,DT as bJ,$K as bK,Gt as bL,il as bM,SE as bN,EE as bO,CE as bP,ME as bQ,_E as bR,TE as bS,hU as bT,a0 as bU,At as bV,Kp as bW,sE as bX,VT as bY,XT as bZ,YT as b_,iU as ba,LK as bb,ot as bc,tE as bd,eE as be,JT as bf,ZT as bg,Do as bh,Cu as bi,dU as bj,GT as bk,HT as bl,en as bm,jT as bn,za as bo,$i as bp,UT as bq,Mu as br,WT as bs,zT as bt,qT as bu,S1 as bv,zp as bw,Co as bx,gE as by,Wp as bz,ja as c,NK as c0,lU as c1,cU as c2,aU as c3,Qe as d,je as e,BK as f,rt as g,Ri as h,eu as i,un as j,zt as k,He as l,es as m,Bt as n,Mg as o,di as p,ec as q,Rr as r,Ve as s,bw as t,Fg as u,ru as v,jp as w,To as x,g1 as y,qp as z}; diff --git a/dist/index.html b/dist/index.html index de27d4f..0f0981a 100644 --- a/dist/index.html +++ b/dist/index.html @@ -3,13 +3,13 @@ - Spine粒子编辑器 + Spine粒子编辑器-Yeomai - - + +
diff --git a/index.html b/index.html index a455a25..a4a0687 100644 --- a/index.html +++ b/index.html @@ -3,7 +3,7 @@ - Spine粒子编辑器 + Spine粒子编辑器-Yeomai