1
0
forked from sent/waves
waves-fork/public/assets/g/mcdemo/entry/index.17cc41d9.js
2025-04-09 17:11:14 -05:00

2 lines
5.1 KiB
JavaScript

const g=function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const e of document.querySelectorAll('link[rel="modulepreload"]'))o(e);new MutationObserver(e=>{for(const i of e)if(i.type==="childList")for(const s of i.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&o(s)}).observe(document,{childList:!0,subtree:!0});function r(e){const i={};return e.integrity&&(i.integrity=e.integrity),e.referrerpolicy&&(i.referrerPolicy=e.referrerpolicy),e.crossorigin==="use-credentials"?i.credentials="include":e.crossorigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function o(e){if(e.ep)return;e.ep=!0;const i=r(e);fetch(e.href,i)}};g();const m="modulepreload",y=function(t,n){return new URL(t,n).href},d={},h=function(n,r,o){return!r||r.length===0?n():Promise.all(r.map(e=>{if(e=y(e,o),e in d)return;d[e]=!0;const i=e.endsWith(".css"),s=i?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${e}"]${s}`))return;const l=document.createElement("link");if(l.rel=i?"stylesheet":m,i||(l.as="script",l.crossOrigin=""),l.href=e,document.head.appendChild(l),i)return new Promise((f,p)=>{l.addEventListener("load",f),l.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${e}`)))})})).then(()=>n())};function a(t,...n){let r=t;(!r||!r.getAttribute("tip-el"))&&(r=document.createElement("div"),r.style.position="absolute",r.style.top="35%",r.style.width="100%",r.style.zIndex="1000",r.style.textAlign="center",r.style.fontWeight="bold",r.style.color="white",r.style.fontSize="1em",r.style.backgroundColor="rgba(0, 0, 0, 0.3)",r.setAttribute("tip-el","1"),document.body.appendChild(r)),r.innerHTML="";let o=[];if(n!==void 0)for(let e of n)if(e instanceof HTMLElement)o.push(e),o.push(document.createElement("br"));else{let i=document.createElement("span");i.style.fontSize="1.5em",i.innerText=e,o.push(i),o.push(document.createElement("br"))}for(let e of o)r.appendChild(e);return r}function b(t){setTimeout(()=>{let n=setInterval(function(){var r;if(t.style.opacity===void 0||t.style.opacity.length===0)t.style.opacity="1";else{let o=Number.parseFloat(t.style.opacity)-.1;t.style.opacity=o.toString(),o<=0&&(clearInterval(n),t.style.display="none",(r=t.parentNode)==null||r.removeChild(t))}},16)},1e3)}var w={isWebGLAvailable:function(){try{var t=document.createElement("canvas");return!!(window.WebGLRenderingContext&&(t.getContext("webgl")||t.getContext("experimental-webgl")))}catch{return!1}},isWebGL2Available:function(){try{var t=document.createElement("canvas");return!!(window.WebGL2RenderingContext&&t.getContext("webgl2"))}catch{return!1}},getWebGLErrorMessage:function(){return this.getErrorMessage(1)},getWebGL2ErrorMessage:function(){return this.getErrorMessage(2)},getErrorMessage:function(t){var n={1:"WebGL",2:"WebGL 2"},r={1:window.WebGLRenderingContext,2:window.WebGL2RenderingContext},o='Your $0 does not seem to support <a href="http://khronos.org/webgl/wiki/Getting_a_WebGL_Implementation" style="color:#000">$1</a>',e=document.createElement("div");return e.id="webglmessage",e.style.fontFamily="monospace",e.style.fontSize="13px",e.style.fontWeight="normal",e.style.textAlign="center",e.style.background="#fff",e.style.color="#000",e.style.padding="1.5em",e.style.width="400px",e.style.margin="5em auto 0",r[t]?o=o.replace("$0","graphics card"):o=o.replace("$0","browser"),o=o.replace("$1",n[t]),e.innerHTML=o,e}};function E(){let t=window.navigator.userAgent,n=function(o){return t.indexOf(o)>=0},r=function(){return"ActiveXObject"in window}();if(n("MSIE")||r)throw["\u4E0D\u652F\u6301IE\u6216\u6D4F\u89C8\u5668\u7684\u517C\u5BB9\u6A21\u5F0F :(","IE or browser compatibility mode is not OK :("]}function v(){if(navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i))throw["\u624B\u673A\u5C1A\u4E0D\u652F\u6301 :(","Mobile phone is not supported :(","\u8FD8\u662F\u7528\u7535\u8111\u6253\u5F00\u8BD5\u8BD5\u5427 :)","Let's try it with computer :)"]}function L(){let t=!1;try{const n=document.createElement("canvas");t=!!(window.WebGLRenderingContext&&(n.getContext("webgl")||n.getContext("experimental-webgl")))}catch{}if(!t)throw["\u8FD9\u4E2A\u6D4F\u89C8\u5668\u4E0D\u592A\u884C :(","This browser doesn't work well :(","\u8FD8\u662F\u7528\u6D41\u884C\u7684\u6D4F\u89C8\u5668\u8BD5\u8BD5\u5427 :)","Let's try it with a popular browser :)","","ERROR: "+w.getWebGLErrorMessage().innerText]}window.addEventListener("load",()=>{document.addEventListener("touchstart",function(n){n.touches.length>1&&n.preventDefault()});let t=0;document.addEventListener("touchend",function(n){let r=new Date().getTime();r-t<=300&&n.preventDefault(),t=r},!1),document.addEventListener("gesturestart",function(n){n.preventDefault()})});let u=a(void 0,"Loading..."),c;try{E(),L(),c=!0}catch(t){c=!1,Object.prototype.toString.call(t)==="[object Array]"&&a(u,...t)}c&&h(()=>import("../chunk/mc.f3939f66.js"),["..\\chunk\\mc.f3939f66.js","..\\chunk\\threebuild_three.05158750.js"],import.meta.url).then(({default:t})=>{new t().init();try{v(),a(u,"Done :)"),b(u)}catch(n){Object.prototype.toString.call(n)==="[object Array]"&&a(u,...n)}}).catch(t=>{a(u,"Error :("),console.log("Error Info",t)});export{h as _};