null==t?void 0:t.call_exposed_callback(e,n)}set traceObserver(e){var t;null===(t=this.instance)||void 0===t||t.set_trace_observer(e)}getPanicData(){const e=[];if(e.push("\n# Player Info\n"),e.push(this.debugPlayerInfo()),e.push("\n# Page Info\n"),e.push(`Page URL: ${document.location.href}\n`),this.swfUrl&&e.push(`SWF URL: ${this.swfUrl}\n`),e.push("\n# Browser Info\n"),e.push(`User Agent: ${window.navigator.userAgent}\n`),e.push(`Platform: ${window.navigator.platform}\n`),e.push(`Has touch support: ${window.navigator.maxTouchPoints>0}\n`),e.push("\n# Ruffle Info\n"),e.push("Version: 0.1.0\n"),e.push("Name: nightly 2022-09-26\n"),e.push("Channel: nightly\n"),e.push("Built: 2022-09-26T00:16:38.943Z\n"),e.push("Commit: 51c9e3714a71a6b67f97323f85639878156b95af\n"),e.push(`Is extension: ${this.isExtension}\n`),e.push("\n# Metadata\n"),this.metadata)for(const[t,n]of Object.entries(this.metadata))e.push(`${t}: ${n}\n`);return e.join("")}panic(e){var t;if(this.panicked)return;if(this.panicked=!0,this.hidePreloader(),e instanceof Error&&("AbortError"===e.name||e.message.includes("AbortError")))return;const n=null!==(t=null==e?void 0:e.ruffleIndexError)&&void 0!==t?t:0,i=Object.assign([],{stackIndex:-1,avmStackIndex:-1});if(i.push("# Error Info\n"),e instanceof Error){if(i.push(`Error name: ${e.name}\n`),i.push(`Error message: ${e.message}\n`),e.stack){const t=i.push(`Error stack:\n\`\`\`\n${e.stack}\n\`\`\`\n`)-1;if(e.avmStack){const t=i.push(`AVM2 stack:\n\`\`\`\n ${e.avmStack.trim().replace(/\t/g," ")}\n\`\`\`\n`)-1;i.avmStackIndex=t}i.stackIndex=t}}else i.push(`Error: ${e}\n`);i.push(this.getPanicData());const r=i.join(""),o=new Date("2022-09-26T00:16:38.943Z"),a=new Date;a.setMonth(a.getMonth()-6);const s=a>o;let l,c,d;if(s)l=`Update Ruffle`;else{const e=document.location.href.split(/[?#]/)[0];let t=`https://github.com/ruffle-rs/ruffle/issues/new?title=${encodeURIComponent(`Error on ${e}`)}&template=error_report.md&labels=error-report&body=`,n=encodeURIComponent(r);i.stackIndex>-1&&String(t+n).length>8195&&(i[i.stackIndex]=null,i.avmStackIndex>-1&&(i[i.avmStackIndex]=null),n=encodeURIComponent(i.join(""))),t+=n,l=`Report Bug`}switch(n){case 2:c='\n It appears you are running Ruffle on the "file:" protocol.
\n This doesn\'t work as browsers block many features from working for security reasons.
\n Instead, we invite you to setup a local server or either use the web demo or the desktop application.
\n ',d=`\n Web Demo\n Desktop Application\n `;break;case 4:c="\n Ruffle has encountered a major issue due to an incorrect JavaScript configuration.
\n If you are the server administrator, we invite you to check the error details to find out which parameter is at fault.
\n You can also consult the Ruffle wiki for help.
\n ",d='\n View Ruffle Wiki\n View Error Details\n ';break;case 9:c='\n Ruffle failed to load the required ".wasm" file component.
\n If you are the server administrator, please ensure the file has correctly been uploaded.
\n If the issue persists, you may need to use the "publicPath" setting: please consult the Ruffle wiki for help.
\n ',d='\n View Ruffle Wiki\n View Error Details\n ';break;case 8:c='\n Ruffle has encountered a major issue whilst trying to initialize.
\n This web server is not serving ".wasm" files with the correct MIME type.
\n If you are the server administrator, please consult the Ruffle wiki for help.
\n ',d='\n View Ruffle Wiki\n View Error Details\n ';break;case 11:c="\n Ruffle failed to load the Flash SWF file.
\n The most likely reason is that the file no longer exists, so there is nothing for Ruffle to load.
\n Try contacting the website administrator for help.
\n ",d='\n View Error Details\n ';break;case 6:c='\n Ruffle failed to load the required ".wasm" file component.
\n Access to fetch has likely been blocked by CORS policy.
\n If you are the server administrator, please consult the Ruffle wiki for help.
\n ',d='\n View Ruffle Wiki\n View Error Details\n ';break;case 3:c="\n Ruffle has encountered a major issue whilst trying to initialize.
\n It seems like this page has missing or invalid files for running Ruffle.
\n If you are the server administrator, please consult the Ruffle wiki for help.
\n ",d='\n View Ruffle Wiki\n View Error Details\n ';break;case 7:c="\n Ruffle has encountered a major issue whilst trying to initialize.
\n This can often resolve itself, so you can try reloading the page.
\n Otherwise, please contact the website administrator.
\n ",d='\n View Error Details\n ';break;case 10:c='\n Ruffle failed to load the required ".wasm" file component.
\n To fix this, try opening your browser\'s settings, clicking "Privacy, search, and services", scrolling down, and turning off "Enhance your security on the web".
\n This will allow your browser to load the required ".wasm" files.
\n If the issue persists, you might have to use a different browser.
\n ',d='\n More Information\n View Error Details\n ';break;case 5:c="\n Ruffle has encountered a major issue whilst trying to initialize.
\n It seems like this page uses JavaScript code that conflicts with Ruffle.
\n If you are the server administrator, we invite you to try loading the file on a blank page.
\n ",s&&(c+="You can also try to upload a more recent version of Ruffle that may circumvent the issue (current build is outdated: 2022-09-26T00:16:38.943Z).
"),d=`\n ${l}\n View Error Details\n `;break;case 1:c='\n Ruffle has encountered a major issue whilst trying to initialize.
\n This web server\'s Content Security Policy does not allow the required ".wasm" component to run.
\n If you are the server administrator, please consult the Ruffle wiki for help.
\n ',d='\n View Ruffle Wiki\n View Error Details\n ';break;default:c="Ruffle has encountered a major issue whilst trying to display this Flash content.
",c+=s?"If you are the server administrator, please try to upload a more recent version of Ruffle (current build is outdated: 2022-09-26T00:16:38.943Z).
":"This isn't supposed to happen, so we'd really appreciate if you could file a bug!
",d=`\n ${l}\n View Error Details\n `}this.container.innerHTML=`\n \n
Something went wrong :(
\n
${c}
\n \n
\n `;const u=this.container.querySelector("#panic-view-details");u&&(u.onclick=()=>{const e=this.container.querySelector("#panic-body");return e.classList.add("details"),e.innerHTML=``,!1}),this.destroy()}displayRootMovieDownloadFailedMessage(){if(window.location.origin===this.swfUrl.origin||!this.isExtension||!window.location.protocol.includes("http")){const e=new Error("Failed to fetch: "+this.swfUrl);return e.ruffleIndexError=11,void this.panic(e)}this.hidePreloader();const e=document.createElement("div");e.id="message_overlay",e.innerHTML=`\n
Ruffle wasn't able to run the Flash embedded in this page.
\n
You can try to open the file in a separate tab, to sidestep this issue.
\n
\n
`,this.container.prepend(e)}displayUnsupportedMessage(){const e=document.createElement("div");e.id="message_overlay",e.innerHTML='\n
The Ruffle emulator does not yet support ActionScript 3, required by this content.
\n
If you choose to run it anyway, interactivity will be missing or limited.
\n
\n
',this.container.prepend(e),e.querySelector("#run-anyway-btn").onclick=()=>{e.parentNode.removeChild(e)}}displayMessage(e){const t=document.createElement("div");t.id="message_overlay",t.innerHTML=`\n
${e}
\n
\n \n
\n
`,this.container.prepend(t),this.container.querySelector("#continue-btn").onclick=()=>{t.parentNode.removeChild(t)}}debugPlayerInfo(){var e,t;let n=`Allows script access: ${null!==(t=null===(e=this.options)||void 0===e?void 0:e.allowScriptAccess)&&void 0!==t&&t}\n`;return this.instance&&(n+=`Renderer: ${this.instance.renderer_name()}\n`),n}hidePreloader(){this.preloader.classList.add("hidden"),this.container.classList.remove("hidden")}showPreloader(){this.preloader.classList.remove("hidden"),this.container.classList.add("hidden")}setMetadata(e){this._metadata=e,this._readyState=2,this.hidePreloader(),this.dispatchEvent(new Event(M.LOADED_METADATA)),this.dispatchEvent(new Event(M.LOADED_DATA))}setIsExtension(e){this.isExtension=e}}function T(e,t){switch(e||(e="sameDomain"),e.toLowerCase()){case"always":return!0;case"never":return!1;default:try{return new URL(window.location.href).origin===new URL(t,window.location.href).origin}catch(e){return!1}}}function O(e){return null===e||"true"===e.toLowerCase()}function N(e){if(e){let t="",n="";try{const i=new URL(e,L);t=i.pathname,n=i.hostname.replace("www.","")}catch(e){}if(t.startsWith("/v/")&&("youtube.com"===n||"youtube-nocookie.com"===n))return!0}return!1}function U(e,t){var n,i;const r=e.getAttribute(t),o=null!==(i=null===(n=window.RufflePlayer)||void 0===n?void 0:n.config)&&void 0!==i?i:{};if(r)try{const n=new URL(r);"http:"===n.protocol&&"https:"===window.location.protocol&&!1!==o.upgradeToHttps&&(n.protocol="https:",e.setAttribute(t,n.toString()))}catch(e){}}function D(e){if(e){let t="";try{t=new URL(e,L).pathname}catch(e){}if(t&&t.length>=4){const e=t.slice(-4).toLowerCase();if(".swf"===e||".spl"===e)return!0}}return!1}function W(e){switch(e.toLowerCase()){case S.toLowerCase():case _.toLowerCase():case R.toLowerCase():case F.toLowerCase():return!0;default:return!1}}function $(e){let t=e.parentElement;for(;null!==t;){switch(t.tagName){case"AUDIO":case"VIDEO":return!0}t=t.parentElement}return!1}M.LOADED_METADATA="loadedmetadata",M.LOADED_DATA="loadeddata";class z{constructor(e){if(this.__mimetypes=[],this.__named_mimetypes={},e)for(let t=0;t{t+=`Param ${e}: ${this.params[e]}\n`})),Object.keys(this.attributes).forEach((e=>{var n;t+=`Attribute ${e}: ${null===(n=this.attributes.getNamedItem(e))||void 0===n?void 0:n.value}\n`})),t}get data(){return this.getAttribute("data")}set data(e){if(e){const t=document.createAttribute("data");t.value=e,this.attributes.setNamedItem(t)}else this.attributes.removeNamedItem("data")}static isInterdictable(e){var t,n;if($(e))return!1;if(e.getElementsByTagName("ruffle-object").length>0||e.getElementsByTagName("ruffle-embed").length>0)return!1;const i=null===(t=e.attributes.getNamedItem("data"))||void 0===t?void 0:t.value.toLowerCase(),r=X(e);let o;if(i){if(N(i))return U(e,"data"),!1;o=D(i)}else{if(!r||!r.movie)return!1;if(N(r.movie)){const t=e.querySelector("param[name='movie']");if(t){U(t,"value");const n=t.getAttribute("value");n&&e.setAttribute("data",n)}return!1}o=D(r.movie)}const a=null===(n=e.attributes.getNamedItem("classid"))||void 0===n?void 0:n.value.toLowerCase();if(a==="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000".toLowerCase())return!Array.from(e.getElementsByTagName("object")).some(G.isInterdictable)&&!Array.from(e.getElementsByTagName("embed")).some(Q.isInterdictable);if(a)return!1;const s=e.attributes.getNamedItem("type");return s?W(s.value):o}static fromNativeObjectElement(e){const t=B("ruffle-object",G),n=document.createElement(t);for(const t of Array.from(e.getElementsByTagName("embed")))Q.isInterdictable(t)&&t.remove();for(const t of Array.from(e.getElementsByTagName("object")))G.isInterdictable(t)&&t.remove();return n.copyElement(e),n}}var J,K;let ee;const te=null!==(K=null===(J=window.RufflePlayer)||void 0===J?void 0:J.config)&&void 0!==K?K:{},ne=x(te)+"ruffle.js";let ie,re,oe,ae;function se(){try{ie=null!=ie?ie:document.getElementsByTagName("object"),re=null!=re?re:document.getElementsByTagName("embed");for(const e of Array.from(ie))if(G.isInterdictable(e)){const t=G.fromNativeObjectElement(e);t.setIsExtension(ee),e.replaceWith(t)}for(const e of Array.from(re))if(Q.isInterdictable(e)){const t=Q.fromNativeEmbedElement(e);t.setIsExtension(ee),e.replaceWith(t)}}catch(e){console.error(`Serious error encountered when polyfilling native Flash elements: ${e}`)}}function le(){oe=null!=oe?oe:document.getElementsByTagName("iframe"),ae=null!=ae?ae:document.getElementsByTagName("frame"),[oe,ae].forEach((e=>{for(let t=0;t{ce(i,r)}),!1)}}))}async function ce(e,t){var n;let i;await new Promise((e=>{window.setTimeout((()=>{e()}),100)}));try{if(i=e.document,!i)return}catch(e){return void(ee||console.warn(t+e))}if(ee||void 0===i.documentElement.dataset.ruffleOptout)if(ee)e.RufflePlayer||(e.RufflePlayer={}),e.RufflePlayer.config=Object.assign(Object.assign({},te),null!==(n=e.RufflePlayer.config)&&void 0!==n?n:{});else if(!e.RufflePlayer){const t=i.createElement("script");t.setAttribute("src",ne),t.onload=()=>{e.RufflePlayer={},e.RufflePlayer.config=te},i.head.appendChild(t)}}class de{constructor(e,t,n,i,r){this.major=e,this.minor=t,this.patch=n,this.prIdent=i,this.buildIdent=r}static fromSemver(e){const t=e.split("+"),n=t[0].split("-"),i=n[0].split("."),r=parseInt(i[0],10);let o=0,a=0,s=null,l=null;return void 0!==i[1]&&(o=parseInt(i[1],10)),void 0!==i[2]&&(a=parseInt(i[2],10)),void 0!==n[1]&&(s=n[1].split(".")),void 0!==t[1]&&(l=t[1].split(".")),new de(r,o,a,s,l)}isCompatibleWith(e){return 0!==this.major&&this.major===e.major||0===this.major&&0===e.major&&0!==this.minor&&this.minor===e.minor||0===this.major&&0===e.major&&0===this.minor&&0===e.minor&&0!==this.patch&&this.patch===e.patch}hasPrecedenceOver(e){if(this.major>e.major)return!0;if(this.majore.minor)return!0;if(this.minore.patch)return!0;if(this.patchparseInt(e.prIdent[n],10))return!0;if(parseInt(this.prIdent[n],10)e.prIdent[n])return!0;if(this.prIdent[n]e.prIdent.length}return!1}isEqual(e){return this.major===e.major&&this.minor===e.minor&&this.patch===e.patch}isStableOrCompatiblePrerelease(e){return null===e.prIdent||this.major===e.major&&this.minor===e.minor&&this.patch===e.patch}}class ue{constructor(e){this.requirements=e}satisfiedBy(e){for(let t=0;t"===r?n=n&&e.hasPrecedenceOver(o):">="===r?n=n&&(e.hasPrecedenceOver(o)||o.isEqual(e)):"<"===r?n=n&&o.hasPrecedenceOver(e):"<="===r?n=n&&(o.hasPrecedenceOver(e)||o.isEqual(e)):"^"===r&&(n=n&&o.isCompatibleWith(e))}if(n)return!0}return!1}static fromRequirementString(e){const t=e.split(" ");let n=[];const i=[];for(let e=0;e0&&(i.push(n),n=[]);else if(t[e].length>0){const i=/[0-9]/.exec(t[e]);if(i){const r=t[e].slice(0,i.index).trim(),o=de.fromSemver(t[e].slice(i.index).trim());n.push({comparator:r,version:o})}}return n.length>0&&i.push(n),new ue(i)}}const he={version:"0.1.0",polyfill(e){!function(e){ee=e,se(),le(),new MutationObserver((function(e){e.some((e=>e.addedNodes.length>0))&&(se(),le())})).observe(document,{childList:!0,subtree:!0})}(e)},pluginPolyfill(){!function(e){"install"in navigator.plugins&&navigator.plugins.install||Object.defineProperty(navigator,"plugins",{value:new H(navigator.plugins),writable:!1}),navigator.plugins.install(e),!(e.length>0)||"install"in navigator.mimeTypes&&navigator.mimeTypes.install||Object.defineProperty(navigator,"mimeTypes",{value:new z(navigator.mimeTypes),writable:!1});const t=navigator.mimeTypes;for(let n=0;n{e.textContent="Loading"})),document.getElementById("backgroundColor").value="#FFFFFF")}function Fe(e){Re(),me=pe.createPlayer(),me.id="player",ge.append(me),me.load(e),me.addEventListener("loadedmetadata",(function(){if(this.metadata)for(const[e,t]of Object.entries(this.metadata)){const n=document.getElementById(e);if(n)switch(e){case"backgroundColor":n.value=t??"#FFFFFF";break;case"uncompressedLength":n.textContent=(t>>10)+"Kb";break;case"swfVersion":document.getElementById("flashVersion").textContent=_e[t];default:n.textContent=t}}}))}function Le(){xe.selectedIndex=-1,Ae.classList.add("hidden"),ye.textContent="",ye.href=""}async function Pe(e){e&&(e.name&&(Ie.textContent=e.name),Le(),Fe({data:await new Response(e).arrayBuffer(),...Se}))}function qe(){const e=xe[xe.selectedIndex].swfData;if(Ie.textContent="No file selected.",e){!function(e){Ae.classList.remove("hidden"),ye.textContent=e.author,ye.href=e.authorLink,we.value=null}(e);const t=e.config||Se;Fe({url:e.location,...t})}else Le(),Re()}we.addEventListener("change",(e=>{Pe(e.target.files[0])})),xe.addEventListener("change",(()=>qe())),ge.addEventListener("dragenter",(e=>{e.stopPropagation(),e.preventDefault()})),ge.addEventListener("dragleave",(e=>{e.stopPropagation(),e.preventDefault(),ve.classList.remove("drag")})),ge.addEventListener("dragover",(e=>{e.stopPropagation(),e.preventDefault(),ve.classList.add("drag")})),ge.addEventListener("drop",(e=>{e.stopPropagation(),e.preventDefault(),ve.classList.remove("drag"),we.files=e.dataTransfer.files,Pe(e.dataTransfer.files[0])})),we.addEventListener("dragleave",(e=>{e.stopPropagation(),e.preventDefault(),ve.classList.remove("drag")})),we.addEventListener("dragover",(e=>{e.stopPropagation(),e.preventDefault(),ve.classList.add("drag")})),we.addEventListener("drop",(e=>{e.stopPropagation(),e.preventDefault(),ve.classList.remove("drag"),we.files=e.dataTransfer.files,Pe(e.dataTransfer.files[0])})),Ce.addEventListener("click",(()=>{Ee.style.display="none"})),ke.addEventListener("click",(()=>{Ee.style.display="block"})),window.addEventListener("load",(()=>{(navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/iPhone/i))&&we.removeAttribute("accept"),ve.classList.remove("hidden")})),window.onclick=e=>{e.target===Ee&&(Ee.style.display="none")},(async()=>{const e=await fetch("swfs.json");if(e.ok){const t=await e.json();for(const e of t.swfs){const t=document.createElement("option");t.textContent=e.title,t.value=e.location,t.swfData=e,e.type?Be[e.type].append(t):xe.insertBefore(t,xe.firstChild)}be.classList.remove("hidden")}xe.selectedIndex=0;const t=new URL(window.location).searchParams.get("file");if(t){const e=Array.from(xe.options);xe.selectedIndex=Math.max(e.findIndex((e=>e.value.endsWith(t))),0)}qe()})()})()})();
+//# sourceMappingURL=index.js.map
\ No newline at end of file
diff --git a/static/ruffle/logo-anim.swf b/static/ruffle/logo-anim.swf
new file mode 100644
index 0000000..9e9bd50
Binary files /dev/null and b/static/ruffle/logo-anim.swf differ
diff --git a/static/ruffle/ruffle.html b/static/ruffle/ruffle.html
new file mode 100644
index 0000000..4779400
--- /dev/null
+++ b/static/ruffle/ruffle.html
@@ -0,0 +1,90 @@
+
+
+
+
+
+
+ Ruffle Web Demo
+
+
+
+
+
+
+
+ Local SWF:
+
+
+ No file selected.
+
+
+
Sample SWF:
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/static/ruffle/swfs.json b/static/ruffle/swfs.json
new file mode 100644
index 0000000..467ae29
--- /dev/null
+++ b/static/ruffle/swfs.json
@@ -0,0 +1,16 @@
+{
+ "swfs": [
+ {
+ "location": "logo-anim.swf",
+ "title": "Ruffle Logo",
+ "author": "Ruffle contributors",
+ "authorLink": "https://ruffle.rs",
+ "config": {
+ "autoplay": "on",
+ "backgroundColor": "#31497D",
+ "letterbox": "off",
+ "unmuteOverlay": "hidden"
+ }
+ }
+ ]
+}