System.register(["./index-legacy-BGUFxny_.js"],function(e,t){"use strict";var r,n,o,l,s,d,a,i,c,f,u,y,w;return{setters:[e=>{r=e.j,n=e.B,o=e.e3,l=e.a4,s=e.au,d=e.N,a=e.ax,i=e.aZ,c=e.D,f=e.ac,u=e.S,y=e.aa,w=e.o}],execute:function(){var t=a("<div id=swf-container>");e("default",()=>{const e=w(),{replace:a}=r(),[m,h]=n(!0),[p,g]=n(!1),{ruffleJSPath:v}=o();let P=l.objs.filter(e=>e.name.toLowerCase().endsWith(".swf"));0===P.length&&(P=[l.obj]);const E=e=>{const t=P.findIndex(e=>e.name===l.obj.name);"ArrowLeft"===e.key&&t>0?a(P[t-1].name):"ArrowRight"===e.key&&t<P.length-1&&a(P[t+1].name)};s(()=>{window.addEventListener("keydown",E),L()}),d(()=>{window.removeEventListener("keydown",E);const e=document.getElementById("ruffle-player");e?.remove();const t=document.getElementById("ruffle-script");t?.remove()});const L=()=>{h(!0),g(!1);const e=document.getElementById("ruffle-player");if(e?.remove(),window.RufflePlayer)return void j();const t=document.createElement("script");t.src=v(),t.async=!0,t.id="ruffle-script",t.onload=()=>{j()},t.onerror=()=>{g(!0),h(!1),console.error("无法加载Ruffle播放器")},document.head.appendChild(t)},j=()=>{try{const e=window.RufflePlayer.newest().createPlayer();e.id="ruffle-player",e.style.width="100%",e.style.height="100%";const t=document.getElementById("swf-container");t&&(t.innerHTML="",t.appendChild(e),e.addEventListener("loaded",()=>{h(!1)}),e.addEventListener("error",()=>{g(!0),h(!1)}),e.load(l.raw_url))}catch(e){console.error("Ruffle初始化失败:",e),g(!0),h(!1)}};return(x=t()).style.setProperty("position","relative"),x.style.setProperty("width","100%"),x.style.setProperty("height","75vh"),x.style.setProperty("display","flex"),x.style.setProperty("justify-content","center"),x.style.setProperty("align-items","center"),i(x,c(u,{get when(){return m()},get children(){return c(f,{})}}),null),i(x,c(u,{get when(){return p()},get children(){return c(y,{get msg(){return e("preview.failed_load_swf")},h:"75vh"})}}),null),x;var x})}}});
