From 34cac8efbf7436bcbceec104aba0a0d69bbf674e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=A2=81=E6=B6=9B?= Date: Fri, 3 Oct 2025 16:50:04 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dist-template/assets/index-1973dde7.css | 1 - dist-template/assets/index-6271e228.js | 91 ------------------------- dist-template/assets/index-880f7c5b.js | 91 ------------------------- dist-template/assets/index-a09a4142.js | 91 ------------------------- dist-template/assets/index-aa617c3d.js | 91 ------------------------- dist-template/assets/index-dab6cb02.js | 90 ------------------------ dist-template/assets/index-e4e95c79.css | 1 - dist-template/assets/index-e4ee4c1a.js | 89 ------------------------ dist-template/assets/index-f8561862.js | 91 ------------------------- dist-template/assets/sences-2e06be56.js | 1 - vite.config.js | 2 +- 11 files changed, 1 insertion(+), 638 deletions(-) delete mode 100644 dist-template/assets/index-1973dde7.css delete mode 100644 dist-template/assets/index-6271e228.js delete mode 100644 dist-template/assets/index-880f7c5b.js delete mode 100644 dist-template/assets/index-a09a4142.js delete mode 100644 dist-template/assets/index-aa617c3d.js delete mode 100644 dist-template/assets/index-dab6cb02.js delete mode 100644 dist-template/assets/index-e4e95c79.css delete mode 100644 dist-template/assets/index-e4ee4c1a.js delete mode 100644 dist-template/assets/index-f8561862.js delete mode 100644 dist-template/assets/sences-2e06be56.js diff --git a/dist-template/assets/index-1973dde7.css b/dist-template/assets/index-1973dde7.css deleted file mode 100644 index 8692cb8..0000000 --- a/dist-template/assets/index-1973dde7.css +++ /dev/null @@ -1 +0,0 @@ -*{background:white} diff --git a/dist-template/assets/index-6271e228.js b/dist-template/assets/index-6271e228.js deleted file mode 100644 index 68e1f21..0000000 --- a/dist-template/assets/index-6271e228.js +++ /dev/null @@ -1,91 +0,0 @@ -(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))s(n);new MutationObserver(n=>{for(const i of n)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&s(o)}).observe(document,{childList:!0,subtree:!0});function t(n){const i={};return n.integrity&&(i.integrity=n.integrity),n.referrerPolicy&&(i.referrerPolicy=n.referrerPolicy),n.crossOrigin==="use-credentials"?i.credentials="include":n.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function s(n){if(n.ep)return;n.ep=!0;const i=t(n);fetch(n.href,i)}})();const T="modulepreload",L=function(c){return"/"+c},P={},N=function(e,t,s){if(!t||t.length===0)return e();const n=document.getElementsByTagName("link");return Promise.all(t.map(i=>{if(i=L(i),i in P)return;P[i]=!0;const o=i.endsWith(".css"),r=o?'[rel="stylesheet"]':"";if(!!s)for(let d=n.length-1;d>=0;d--){const h=n[d];if(h.href===i&&(!o||h.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${i}"]${r}`))return;const l=document.createElement("link");if(l.rel=o?"stylesheet":T,o||(l.as="script",l.crossOrigin=""),l.href=i,document.head.appendChild(l),o)return new Promise((d,h)=>{l.addEventListener("load",d),l.addEventListener("error",()=>h(new Error(`Unable to preload CSS for ${i}`)))})})).then(()=>e()).catch(i=>{const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=i,window.dispatchEvent(o),!o.defaultPrevented)throw i})},A=(c,e)=>{const t=c[e];return t?typeof t=="function"?t():Promise.resolve(t):new Promise((s,n)=>{(typeof queueMicrotask=="function"?queueMicrotask:setTimeout)(n.bind(null,new Error("Unknown variable dynamic import: "+e)))})};class ${constructor(){this.events={}}on(e,t){this.events[e]||(this.events[e]=[]),this.events[e].push(t)}off(e,t){if(!this.events[e])return;const s=this.events[e].indexOf(t);s>-1&&this.events[e].splice(s,1)}emit(e,t){this.events[e]&&this.events[e].forEach(s=>s(t))}once(e,t){const s=n=>{t(n),this.off(e,s)};this.on(e,s)}}class F{constructor(){this.resources=new Map,this.loading=new Map}load(e){if(this.resources.has(e))return Promise.resolve(this.resources.get(e));if(this.loading.has(e))return this.loading.get(e);const t=new Promise((s,n)=>{if(this.isImage(e)){const i=new Image;i.onload=()=>{this.resources.set(e,i),this.loading.delete(e),s(i)},i.onerror=o=>{this.loading.delete(e),n(o)},i.src=e}else n(new Error(`Unsupported resource type: ${e}`))});return this.loading.set(e,t),t}isImage(e){return/\.(jpeg|jpg|png|gif|svg|webp)$/i.test(e)}get(e){return this.resources.get(e)}clear(){this.resources.clear(),this.loading.clear()}}class O{constructor(){this.sounds=new Map,this.music=new Map,this.masterVolume=1,this.soundVolume=1,this.musicVolume=1,this.enabled=!0}loadSound(e,t,s={}){return new Promise((n,i)=>{const o=new Audio;o.src=t,o.preload="auto",o.loop=s.loop||!1,o.volume=(s.volume||1)*this.soundVolume*this.masterVolume,o.addEventListener("canplaythrough",()=>{this.sounds.set(e,{audio:o,volume:s.volume||1,loop:s.loop||!1}),n(o)}),o.addEventListener("error",r=>{i(new Error(`Failed to load sound: ${t}`))})})}loadMusic(e,t,s={}){return new Promise((n,i)=>{const o=new Audio;o.src=t,o.preload="auto",o.loop=s.loop||!1,o.volume=(s.volume||1)*this.musicVolume*this.masterVolume,o.addEventListener("canplaythrough",()=>{this.music.set(e,{audio:o,volume:s.volume||1,loop:s.loop||!1}),n(o)}),o.addEventListener("error",r=>{i(new Error(`Failed to load music: ${t}`))})})}playSound(e,t={}){if(!this.enabled)return;const s=this.sounds.get(e);if(!s){console.warn(`Sound ${e} not found`);return}const n=s.audio.cloneNode();return n.volume=(t.volume||s.volume)*this.soundVolume*this.masterVolume,n.loop=t.loop||s.loop,n.play().catch(i=>{console.warn(`Failed to play sound ${e}:`,i)}),n}playMusic(e,t={}){if(!this.enabled)return;const s=this.music.get(e);if(!s){console.warn(`Music ${e} not found`);return}return s.audio.volume=(t.volume||s.volume)*this.musicVolume*this.masterVolume,s.audio.loop=t.loop||s.loop,s.audio.play().catch(n=>{console.warn(`Failed to play music ${e}:`,n)}),s.audio}stopMusic(e){const t=this.music.get(e);t&&(t.audio.pause(),t.audio.currentTime=0)}pauseMusic(e){const t=this.music.get(e);t&&t.audio.pause()}resumeMusic(e){const t=this.music.get(e);t&&t.audio.play().catch(s=>{console.warn(`Failed to resume music ${e}:`,s)})}setMasterVolume(e){this.masterVolume=Math.max(0,Math.min(1,e));for(const[t,s]of this.sounds)s.audio.volume=s.volume*this.soundVolume*this.masterVolume;for(const[t,s]of this.music)s.audio.volume=s.volume*this.musicVolume*this.masterVolume}setSoundVolume(e){this.soundVolume=Math.max(0,Math.min(1,e))}setMusicVolume(e){this.musicVolume=Math.max(0,Math.min(1,e))}setEnabled(e){if(this.enabled=e,!e)for(const[t,s]of this.music)s.audio.pause()}preload(e){const t=[];for(const[s,n]of Object.entries(e))n.type==="sound"?t.push(this.loadSound(s,n.src,n.options)):n.type==="music"&&t.push(this.loadMusic(s,n.src,n.options));return Promise.all(t)}}class _{constructor(e){this.engine=e,this.currentTransition=null,this.isTransitioning=!1}fade(e,t=1e3,s={}){if(this.isTransitioning)return;this.isTransitioning=!0;const n=document.createElement("div");return n.style.position="absolute",n.style.top="0",n.style.left="0",n.style.width="100%",n.style.height="100%",n.style.backgroundColor=s.color||"#000000",n.style.opacity="0",n.style.zIndex="9999",n.style.pointerEvents="none",this.engine.stage.appendChild(n),this.engine.tween(n.style,t/2,"easeInOutQuad").to({opacity:1}).onComplete(()=>{this.engine.switchScene(e),this.engine.tween(n.style,t/2,"easeInOutQuad").to({opacity:0}).onComplete(()=>{n.parentNode&&n.parentNode.removeChild(n),this.isTransitioning=!1,s.onComplete&&s.onComplete()}).start()}).start(),this}slide(e,t="left",s=1e3,n={}){if(this.isTransitioning)return;this.isTransitioning=!0;const i=this.engine.stage,o=document.createElement("div");o.style.position="absolute",o.style.top="0",o.style.left="0",o.style.width="100%",o.style.height="100%",o.style.overflow="hidden";const r=this.engine.width,a=this.engine.height;switch(t){case"left":o.style.transform=`translateX(${r}px)`;break;case"right":o.style.transform=`translateX(${-r}px)`;break;case"up":o.style.transform=`translateY(${a}px)`;break;case"down":o.style.transform=`translateY(${-a}px)`;break}return i.parentNode.appendChild(o),this.engine.createScene(`temp_${Date.now()}`),this.engine.tween(o.style,s,"easeInOutQuad").to({transform:"translateX(0) translateY(0)"}).onComplete(()=>{this.engine.switchScene(e),o.parentNode&&o.parentNode.removeChild(o),this.isTransitioning=!1,n.onComplete&&n.onComplete()}).start(),this}zoom(e,t=1e3,s={}){if(this.isTransitioning)return;this.isTransitioning=!0;const n=document.createElement("div");return n.style.position="absolute",n.style.top="0",n.style.left="0",n.style.width="100%",n.style.height="100%",n.style.backgroundColor=s.color||"#000000",n.style.transform="scale(0)",n.style.transformOrigin="center center",n.style.zIndex="9999",n.style.pointerEvents="none",this.engine.stage.appendChild(n),this.engine.tween(n.style,t,"easeInOutQuad").to({transform:"scale(1)"}).onComplete(()=>{this.engine.switchScene(e),n.style.transform="scale(1)",this.engine.tween(n.style,t,"easeInOutQuad").to({transform:"scale(0)"}).onComplete(()=>{n.parentNode&&n.parentNode.removeChild(n),this.isTransitioning=!1,s.onComplete&&s.onComplete()}).start()}).start(),this}flip(e,t=1e3,s={}){if(this.isTransitioning)return;this.isTransitioning=!0;const n=document.createElement("div");n.style.position="relative",n.style.width="100%",n.style.height="100%",n.style.perspective="1000px";const i=document.createElement("div");i.style.position="absolute",i.style.width="100%",i.style.height="100%",i.style.transformStyle="preserve-3d",i.style.transition=`transform ${t}ms ease-in-out`;const o=document.createElement("div");o.style.position="absolute",o.style.width="100%",o.style.height="100%",o.style.backfaceVisibility="hidden",o.style.backgroundColor=s.color||"#000000";const r=document.createElement("div");return r.style.position="absolute",r.style.width="100%",r.style.height="100%",r.style.backfaceVisibility="hidden",r.style.backgroundColor=s.color||"#000000",r.style.transform="rotateY(180deg)",i.appendChild(o),i.appendChild(r),n.appendChild(i),this.engine.stage.appendChild(n),setTimeout(()=>{i.style.transform="rotateY(180deg)",setTimeout(()=>{this.engine.switchScene(e),i.style.transform="rotateY(0deg)",setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),this.isTransitioning=!1,s.onComplete&&s.onComplete()},t)},t)},50),this}}class B{constructor(e,t={}){this.engine=e,this.x=t.x||0,this.y=t.y||0,this.width=t.width||e.width,this.height=t.height||e.height,this.zoom=t.zoom||1,this.rotation=t.rotation||0,this.following=null,this.followOffset={x:0,y:0},this.bounds=t.bounds||null,this.shakeIntensity=0,this.shakeDuration=0,this.shakeTimer=0}setPosition(e,t){return this.x=e,this.y=t,this.applyBounds(),this}move(e,t){return this.x+=e,this.y+=t,this.applyBounds(),this}setZoom(e){return this.zoom=e,this}setRotation(e){return this.rotation=e,this}follow(e,t={x:0,y:0}){return this.following=e,this.followOffset=t,this}unfollow(){return this.following=null,this}setBounds(e){return this.bounds=e,this.applyBounds(),this}applyBounds(){if(this.bounds){const{minX:e,minY:t,maxX:s,maxY:n}=this.bounds;this.x=Math.max(e,Math.min(s,this.x)),this.y=Math.max(t,Math.min(n,this.y))}}shake(e,t){return this.shakeIntensity=e,this.shakeDuration=t,this.shakeTimer=t,this}update(e){this.following&&(this.x=this.following.x-this.width/2/this.zoom+this.followOffset.x,this.y=this.following.y-this.height/2/this.zoom+this.followOffset.y,this.applyBounds()),this.shakeTimer>0&&(this.shakeTimer-=e,this.shakeTimer<=0&&(this.shakeTimer=0,this.shakeIntensity=0))}apply(){if(!this.engine.stage)return;const e=this.width/2,t=this.height/2;let s=0,n=0;this.shakeIntensity>0&&this.shakeTimer>0&&(s=(Math.random()-.5)*this.shakeIntensity*2,n=(Math.random()-.5)*this.shakeIntensity*2);const i=e-this.x*this.zoom+s,o=t-this.y*this.zoom+n;let r=`translate(${i}px, ${o}px)`;this.zoom!==1&&(r+=` scale(${this.zoom})`),this.rotation!==0&&(r+=` rotate(${this.rotation}deg)`),this.engine.stage.style.transform=r,this.engine.stage.style.transformOrigin=`${e}px ${t}px`}worldToScreen(e,t){return{x:(e-this.x)*this.zoom+this.width/2,y:(t-this.y)*this.zoom+this.height/2}}screenToWorld(e,t){return{x:(e-this.width/2)/this.zoom+this.x,y:(t-this.height/2)/this.zoom+this.y}}getViewBounds(){const e=this.width/2/this.zoom,t=this.height/2/this.zoom;return{left:this.x-e,right:this.x+e,top:this.y-t,bottom:this.y+t,width:e*2,height:t*2}}}class H{constructor(e){this.engine=e,this.elements=[],this.canvas=null,this.context=null,this.setupCanvas(),this.setupEventListeners()}setupCanvas(){this.canvas=document.createElement("canvas"),this.canvas.width=this.engine.width,this.canvas.height=this.engine.height,this.canvas.style.position="absolute",this.canvas.style.top="0",this.canvas.style.left="0",this.canvas.style.pointerEvents="none",this.context=this.canvas.getContext("2d"),this.engine.stage.appendChild(this.canvas)}setupEventListeners(){this.engine.stage.addEventListener("mousemove",e=>{const t=this.engine.stage.getBoundingClientRect(),s=e.clientX-t.left,n=e.clientY-t.top;this.handleMouseMove(s,n)}),this.engine.stage.addEventListener("mousedown",e=>{const t=this.engine.stage.getBoundingClientRect(),s=e.clientX-t.left,n=e.clientY-t.top;this.handleMouseDown(s,n)}),this.engine.stage.addEventListener("mouseup",e=>{const t=this.engine.stage.getBoundingClientRect(),s=e.clientX-t.left,n=e.clientY-t.top;this.handleMouseUp(s,n)})}handleMouseMove(e,t){this.elements.forEach(s=>{if(s.enabled&&s.visible){const n=s.isHovered,i=s.containsPoint(e,t);i&&!n&&s.onMouseEnter?s.onMouseEnter():!i&&n&&s.onMouseLeave&&s.onMouseLeave(),s.isDragging&&s.onMouseMove&&s.onMouseMove(e,t)}})}handleMouseDown(e,t){for(let s=this.elements.length-1;s>=0;s--){const n=this.elements[s];if(n.enabled&&n.visible&&n.containsPoint(e,t)){n.onMouseDown&&n.onMouseDown(e,t);break}}}handleMouseUp(e,t){this.elements.forEach(s=>{s.enabled&&s.visible&&s.onMouseUp&&s.onMouseUp(e,t)})}addElement(e){return this.elements.push(e),this}removeElement(e){const t=this.elements.indexOf(e);return t!==-1&&this.elements.splice(t,1),this}update(e){this.elements.forEach(t=>{t.update&&t.update(e)})}render(){this.context&&(this.context.clearRect(0,0,this.canvas.width,this.canvas.height),this.elements.forEach(e=>{e.visible&&e.render&&e.render(this.context)}))}resize(e,t){this.canvas&&(this.canvas.width=e,this.canvas.height=t)}destroy(){this.elements.forEach(e=>{e.destroy&&e.destroy()}),this.elements=[],this.canvas&&this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas),this.canvas=null,this.context=null}}class V{constructor(e,t,s="linear"){this.target=e,this.duration=t,this.easing=this.getEasingFunction(s),this.startTime=null,this.startValues={},this.endValues={},this.onUpdate=null,this.onComplete=null,this.onRepeat=null,this.delayTime=0,this.repeatCount=0,this.yoyo=!1,this.isYoyoBack=!1,this.isPaused=!1,this.isReversed=!1,this.progress=0}to(e){for(let t in e)if(typeof this.target[t]=="number")this.startValues[t]=this.target[t];else if(this.target.element&&this.target.element.style){const s=getComputedStyle(this.target.element);if(t==="opacity")this.startValues[t]=parseFloat(s[t])||1;else if(t==="scale"){const i=s.transform.match(/scale\(([^)]+)\)/);this.startValues[t]=i?parseFloat(i[1]):1}else if(t==="rotate"){const i=s.transform.match(/rotate\(([^)]+)deg\)/);this.startValues[t]=i?parseFloat(i[1]):0}else this.startValues[t]=parseFloat(s[t])||0}return this.endValues=e,this}from(e){for(let t in e)typeof this.target[t]=="number"?(this.startValues[t]=e[t],this.target[t]=e[t]):this.target.element&&this.target.element.style&&(t==="opacity"?(this.startValues[t]=e[t],this.target.element.style[t]=e[t]):t==="scale"?(this.startValues[t]=e[t],this.target.element.style.transform=`scale(${e[t]})`):t==="rotate"?(this.startValues[t]=e[t],this.target.element.style.transform=`rotate(${e[t]}deg)`):(this.startValues[t]=e[t],this.target.element.style[t]=`${e[t]}px`));return this}delay(e){return this.delayTime=e,this}repeat(e){return this.repeatCount=e,this}yoyo(e=!0){return this.yoyo=e,this}reverse(){return this.isReversed=!this.isReversed,this}pause(){return this.isPaused=!0,this}resume(){return this.isPaused&&(this.isPaused=!1,this.startTime=performance.now()-this.progress*this.duration,this.animate()),this}stop(){return this.startTime=null,this}start(){return this.delayTime>0?setTimeout(()=>{this._startAnimation()},this.delayTime):this._startAnimation(),this}_startAnimation(){return this.startTime=performance.now(),this.isPaused=!1,this.isReversed=!1,this.isYoyoBack=!1,this.animate(),this}animate(){if(this.isPaused||!this.startTime)return;const t=performance.now()-this.startTime;let s=Math.min(t/this.duration,1);this.isReversed&&(s=1-s),this.yoyo&&this.isYoyoBack&&(s=1-s),this.progress=s;const n=this.easing(s);for(let i in this.endValues){const o=this.startValues[i],r=this.endValues[i],a=o+(r-o)*n;if(typeof this.target[i]=="number")this.target[i]=a;else if(this.target.element&&this.target.element.style)if(i==="opacity")this.target.element.style[i]=a;else if(i==="scale"){const d=(this.target.element.style.transform||"").replace(/scale\([^)]+\)/,"")+` scale(${a})`;this.target.element.style.transform=d}else if(i==="rotate"){const d=(this.target.element.style.transform||"").replace(/rotate\([^)]+\)/,"")+` rotate(${a}deg)`;this.target.element.style.transform=d}else this.target.element.style[i]=`${a}px`}this.onUpdate&&this.onUpdate(n,this.target),s<1?requestAnimationFrame(()=>this.animate()):this.repeatCount>0?(this.repeatCount--,this.yoyo&&(this.isYoyoBack=!this.isYoyoBack),this.startTime=performance.now(),this.onRepeat&&this.onRepeat(),requestAnimationFrame(()=>this.animate())):this.repeatCount===-1?(this.yoyo&&(this.isYoyoBack=!this.isYoyoBack),this.startTime=performance.now(),this.onRepeat&&this.onRepeat(),requestAnimationFrame(()=>this.animate())):this.onComplete&&this.onComplete(this.target)}onUpdate(e){return this.onUpdate=e,this}onComplete(e){return this.onComplete=e,this}onRepeat(e){return this.onRepeat=e,this}chain(...e){if(this.onComplete){const t=this.onComplete;this.onComplete=s=>{t(s),e.forEach(n=>n.start())}}else this.onComplete=()=>{e.forEach(t=>t.start())};return this}getEasingFunction(e){const t={linear:s=>s,easeInQuad:s=>s*s,easeOutQuad:s=>s*(2-s),easeInOutQuad:s=>s<.5?2*s*s:-1+(4-2*s)*s,easeInCubic:s=>s*s*s,easeOutCubic:s=>--s*s*s+1,easeInOutCubic:s=>s<.5?4*s*s*s:(s-1)*(2*s-2)*(2*s-2)+1,easeInQuart:s=>s*s*s*s,easeOutQuart:s=>1- --s*s*s*s,easeInOutQuart:s=>s<.5?8*s*s*s*s:1-8*--s*s*s*s,easeInQuint:s=>s*s*s*s*s,easeOutQuint:s=>1+--s*s*s*s*s,easeInOutQuint:s=>s<.5?16*s*s*s*s*s:1+16*--s*s*s*s*s,easeInSine:s=>1-Math.cos(s*Math.PI/2),easeOutSine:s=>Math.sin(s*Math.PI/2),easeInOutSine:s=>-(Math.cos(Math.PI*s)-1)/2,easeInExpo:s=>s===0?0:Math.pow(2,10*(s-1)),easeOutExpo:s=>s===1?1:1-Math.pow(2,-10*s),easeInOutExpo:s=>s===0?0:s===1?1:s<.5?Math.pow(2,20*s-10)/2:(2-Math.pow(2,-20*s+10))/2,easeInCirc:s=>1-Math.sqrt(1-s*s),easeOutCirc:s=>Math.sqrt(1- --s*s),easeInOutCirc:s=>s<.5?(1-Math.sqrt(1-4*s*s))/2:(Math.sqrt(1-4*--s*s)+1)/2,easeInBack:s=>s*s*(2.70158*s-1.70158),easeOutBack:s=>--s*s*(2.70158*s+1.70158)+1,easeInOutBack:s=>{const n=2.5949095;return s<.5?s*s*(2*s*n+2*s-n)/2:(2*(s-1)*(s-1)*(2*(s-1)*n+2*(s-1)+n)+2)/2},easeInElastic:s=>s===0?0:s===1?1:-Math.pow(2,10*(s-1))*Math.sin((s-1.1)*5*Math.PI),easeOutElastic:s=>s===0?0:s===1?1:Math.pow(2,-10*s)*Math.sin((s-.1)*5*Math.PI)+1,easeInOutElastic:s=>s===0?0:s===1?1:s<.5?-(Math.pow(2,20*s-10)*Math.sin((20*s-11.125)*Math.PI/4.5))/2:Math.pow(2,-20*s+10)*Math.sin((20*s-11.125)*Math.PI/4.5)/2+1,easeInBounce:s=>1-this.getEasingFunction("easeOutBounce")(1-s),easeOutBounce:s=>s<.36363636363636365?7.5625*s*s:s<.7272727272727273?7.5625*(s-=.5454545454545454)*s+.75:s<.9090909090909091?7.5625*(s-=.8181818181818182)*s+.9375:7.5625*(s-=.9545454545454546)*s+.984375,easeInOutBounce:s=>s<.5?(1-this.getEasingFunction("easeOutBounce")(1-2*s))/2:(1+this.getEasingFunction("easeOutBounce")(2*s-1))/2};return t[e]||t.linear}}class G{constructor(){this.tweens=[],this.groups=new Map,this.timelines=[]}tween(e,t,s){const n=new V(e,t,s);return this.tweens.push(n),n}createGroup(e){const t={name:e,tweens:[],paused:!1};return this.groups.set(e,t),t}addToGroup(e,t){const s=this.groups.get(e);return s&&s.tweens.push(t),this}playGroup(e){const t=this.groups.get(e);return t&&(t.paused=!1,t.tweens.forEach(s=>{s.isPaused?s.resume():s.startTime||s.start()})),this}pauseGroup(e){const t=this.groups.get(e);return t&&(t.paused=!0,t.tweens.forEach(s=>s.pause())),this}stopGroup(e){const t=this.groups.get(e);return t&&(t.tweens.forEach(s=>s.stop()),t.tweens=[]),this}createTimeline(){const e={tweens:[],currentTime:0,duration:0,playing:!1,onComplete:null};return this.timelines.push(e),e}addtoTimeline(e,t,s=0){return e.tweens.push({tween:t,startTime:s,endTime:s+t.duration}),e.duration=Math.max(e.duration,s+t.duration),this}playTimeline(e){e.playing=!0;const t=performance.now(),s=()=>{if(!e.playing)return;const n=performance.now()-t;e.currentTime=n,e.tweens.forEach(i=>{const{tween:o,startTime:r}=i;if(n>=r&&n{t.tween.stop()}),this}update(){this.tweens=this.tweens.filter(e=>e.startTime!==null&&performance.now()-e.startTimes.startTime!==null&&performance.now()-s.startTimet.target!==e);for(const[t,s]of this.groups)s.tweens=s.tweens.filter(n=>n.target!==e);return this}pause(e){return this.tweens.filter(t=>t.target===e).forEach(t=>t.pause()),this}resume(e){return this.tweens.filter(t=>t.target===e).forEach(t=>t.resume()),this}stopAll(){this.tweens.forEach(e=>e.stop()),this.tweens=[];for(const[e,t]of this.groups)t.tweens.forEach(s=>s.stop()),t.tweens=[];return this.timelines.forEach(e=>this.stopTimeline(e)),this}pauseAll(){this.tweens.forEach(e=>e.pause());for(const[e,t]of this.groups)t.tweens.forEach(s=>s.pause()),t.paused=!0;return this.timelines.forEach(e=>this.pauseTimeline(e)),this}resumeAll(){this.tweens.forEach(e=>e.resume());for(const[e,t]of this.groups)t.tweens.forEach(s=>s.resume()),t.paused=!1;return this.timelines.forEach(e=>{e.currentTime{if(!n.playing)return;const o=n.frames[n.currentFrame];if(o&&e.imgElement&&(e.imgElement.src=o),n.currentFrame++,n.currentFrame>=n.frames.length)if(n.loop)n.currentFrame=0,n.onLoop&&n.onLoop();else{n.playing=!1,n.onComplete&&n.onComplete();return}setTimeout(i,1e3/n.frameRate)};return i(),n}stopFrameAnimation(e){const t=this.animations.get(e);return t&&(t.playing=!1),this}createSequence(e,t){const s={name:e,animations:t,currentIndex:0,loop:!1,onComplete:null,onLoop:null};return this.sequences.set(e,s),s}playSequence(e,t=!1){const s=this.sequences.get(e);if(!s){console.warn(`Sequence ${e} not found`);return}s.loop=t,s.currentIndex=0,this.currentSequence=s;const n=()=>{if(s.currentIndex>=s.animations.length)if(s.loop)s.currentIndex=0,s.onLoop&&s.onLoop();else{this.currentSequence=null,s.onComplete&&s.onComplete();return}const i=s.animations[s.currentIndex],{sprite:o,animationName:r,duration:a}=i;this.playFrameAnimation(o,r),setTimeout(()=>{s.currentIndex++,n()},a||1e3)};return n(),s}stopSequence(){return this.currentSequence&&(this.currentSequence.currentIndex=this.currentSequence.animations.length,this.currentSequence=null),this}onAnimationComplete(e,t){const s=this.animations.get(e);return s&&(s.onComplete=t),this}onSequenceComplete(e,t){const s=this.sequences.get(e);return s&&(s.onComplete=t),this}onLoop(e,t){const s=this.animations.get(e);return s&&(s.onLoop=t),this}}class y{constructor(e="div",t){this.element=document.createElement(e),this.element.style.position="absolute",this.engineId=t,this.x=0,this.y=0,this.width=0,this.height=0}setPosition(e=0,t=0){this.element.style.left=`${e}px`,this.element.style.top=`${t}px`,this.x=e,this.y=t}setSize(e=0,t=0){e&&(this.element.style.width=typeof e=="number"?`${e}px`:e,this.width=e),t&&(this.element.style.height=typeof t=="number"?`${t}px`:t,this.height=t)}setStyle(e){Object.assign(this.element.style,e)}add(e){e&&this.element.appendChild(e.element||e)}remove(e){e&&this.element.removeChild(e.element||e)}on(e,t){this.element.addEventListener(e,t)}off(e,t){this.element.removeEventListener(e,t)}hide(){this.element.style.display="none"}show(){this.element.style.display="block"}}class R extends y{constructor(e,t,s,n,i,o){super("div",o),this.imgElement=document.createElement("img"),e&&e.src?this.imgElement.src=e.src:(this.imgElement.style.backgroundColor="blue",this.imgElement.style.borderRadius="50%",this.imgElement.style.width="100%",this.imgElement.style.height="100%"),this.imgElement.style.cssText="-webkit-user-drag: none; user-drag: none;",this.element.appendChild(this.imgElement),this.setPosition(t,s),this.setSize(n,i),this.element.setAttribute("data-sprite-id",o),this.element.style.zIndex="100",this.element.style.overflow="hidden",this.name=r=>this.element.setAttribute("data-name",r),this.animate=r=>this.element.style.animation=r}}class q extends y{constructor(e,t,s,n,i){super("div",i),this.setPosition(e,t),this.setSize(s,n),this.element.setAttribute("data-box-id",i),this.element.style.zIndex="100",this.element.style.backgroundColor="lightgray",this.element.style.border="1px solid black"}}class D extends y{constructor(e,t,s,n){super("div",n),this.element.innerText=e,this.setPosition(t,s),this.element.setAttribute("data-text-id",n),this.element.style.zIndex="100",this.element.style.color="black",this.element.style.fontSize="16px",this.set=i=>this.element.innerText=i,this.setColor=i=>this.element.style.color=i,this.setFont=i=>this.element.style.font=i}}class Y extends y{constructor(e,t,s,n){super("div",n),this.element.innerHTML=e,this.setPosition(t,s),this.element.setAttribute("data-html-id",n),this.set=i=>this.element.innerHTML=i,this.get=()=>this.element.innerHTML,this.getSize=()=>{const i=this.element.getBoundingClientRect();return{width:i.width,height:i.height}}}}class X extends y{constructor(e,t,s,n,i,o){super("div",o),this.element.innerHTML=i,this.setPosition(e,t),this.setSize(s,n),this.element.setAttribute("data-svg-id",o),this.setContent=r=>this.element.innerHTML=r}}class U{constructor(){typeof window<"u"&&(window.PE_ENGINE=this);const e={width:800,height:600,background:"#f0f0f0",fps:60};this.options={...e},this.width=this.options.width,this.height=this.options.height,this.element=document.body,this.id=Date.now().toString(16),this.fps=this.options.fps,this.frameTime=1e3/this.fps,this.lastFrameTime=0,this.running=!1,this.eventBus=new $,this.resourceManager=new F,this.audioManager=new O,this.transitionManager=new _(this),this.camera=new B(this),this.animationSystem=new G,this.animationController=new z(this),this.routes=[],this.scenes=new Map,this.currentScene=null,this.currentPath=null,this.onLoadCallbacks=[],this.onShowCallbacks=[],this.onHideCallbacks=[],this.onDestoryCallbacks=[],this.gameObjects=[],this.timers=[],this.intervals=[],this.input={mouse:{x:0,y:0,isDown:!1},keyboard:{}},this.plugins=new Map,this.createStage(),this.uiManager=new H(this),this.setupInputHandlers(),this.startGameLoop(),this.loadRoutesFromConfig()}createStage(){for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild);this.stage=document.createElement("div"),this.stage.setAttribute("data-engine-id",this.id),Object.assign(this.stage.style,{width:`${this.options.width}px`,height:`${this.options.height}px`,position:"relative",userSelect:"none",overflow:"hidden",background:this.options.background,transform:"translateZ(0)",border:"2px solid red",margin:"0 auto",zIndex:"1"}),this.stage.add=e=>e&&this.stage.appendChild(e.element||e),this.stage.remove=e=>e&&this.stage.removeChild(e.element||e),this.element.appendChild(this.stage),console.log("Stage created")}setupInputHandlers(){this.stage.addEventListener("mousemove",e=>{const t=this.stage.getBoundingClientRect();this.input.mouse.x=e.clientX-t.left,this.input.mouse.y=e.clientY-t.top,this.eventBus.emit("mouseMove",{x:this.input.mouse.x,y:this.input.mouse.y})}),this.stage.addEventListener("mousedown",e=>{this.input.mouse.isDown=!0,this.eventBus.emit("mouseDown",{x:this.input.mouse.x,y:this.input.mouse.y})}),this.stage.addEventListener("mouseup",e=>{this.input.mouse.isDown=!1,this.eventBus.emit("mouseUp",{x:this.input.mouse.x,y:this.input.mouse.y})}),document.addEventListener("keydown",e=>{this.input.keyboard[e.key]=!0,this.eventBus.emit("keyDown",{key:e.key,code:e.code})}),document.addEventListener("keyup",e=>{this.input.keyboard[e.key]=!1,this.eventBus.emit("keyUp",{key:e.key,code:e.code})})}async loadRoutesFromConfig(){try{const e=await N(()=>import("./sences-2e06be56.js"),[]);if(this.routes=e.default.sence||e.sence||[],console.log("Routes loaded:",this.routes),this.routes&&this.routes.length>0){const t=this.routes[0];setTimeout(()=>{console.log("Switching to default route:",t.path),this.switchToPath(t.path)},100)}}catch(e){console.warn("Failed to load routes config:",e)}}startGameLoop(){this.running=!0;const e=t=>{if(!this.running)return;this.lastFrameTime||(this.lastFrameTime=t);const s=t-this.lastFrameTime;this.lastFrameTime=t,s>=this.frameTime&&(this.update(s),this.render()),requestAnimationFrame(e)};requestAnimationFrame(e)}stopGameLoop(){this.running=!1}update(e){this.camera.update(e),this.uiManager.update(e),this.animationSystem.update(),this.gameObjects.forEach(t=>{t.update&&t.update(e)}),this.timers=this.timers.filter(t=>(t.remaining-=e,t.remaining<=0?(t.callback(),!1):!0))}render(){this.camera.apply(),this.gameObjects.forEach(e=>{e.render&&e.render()}),this.uiManager.render()}addGameObject(e){return this.gameObjects.push(e),e.element&&this.stage.add(e),this}removeGameObject(e){const t=this.gameObjects.indexOf(e);return t!==-1&&(this.gameObjects.splice(t,1),e.element&&e.element.parentNode&&this.stage.remove(e)),this}setTimeout(e,t){const s={callback:e,remaining:t};return this.timers.push(s),s}clearTimeout(e){const t=this.timers.indexOf(e);return t!==-1&&this.timers.splice(t,1),this}setInterval(e,t){const s=setInterval(e,t);return this.intervals.push(s),s}clearInterval(e){const t=this.intervals.indexOf(e);return t!==-1&&(clearInterval(e),this.intervals.splice(t,1)),this}checkCollision(e,t){return e.xt.x&&e.yt.y}use(e,t={}){return this.plugins.has(e.name)?(console.warn(`Plugin ${e.name} is already installed.`),this):(typeof e.install=="function"&&(e.install(this,t),this.plugins.set(e.name,e)),this)}load(e){return this.resourceManager.load(e)}loadSound(e,t,s){return this.audioManager.loadSound(e,t,s)}loadMusic(e,t,s){return this.audioManager.loadMusic(e,t,s)}playSound(e,t){return this.audioManager.playSound(e,t)}playMusic(e,t){return this.audioManager.playMusic(e,t)}stopMusic(e){return this.audioManager.stopMusic(e)}pauseMusic(e){return this.audioManager.pauseMusic(e)}resumeMusic(e){return this.audioManager.resumeMusic(e)}setMasterVolume(e){return this.audioManager.setMasterVolume(e)}setSoundVolume(e){return this.audioManager.setSoundVolume(e)}setMusicVolume(e){return this.audioManager.setMusicVolume(e)}addUIElement(e){return this.uiManager.addElement(e)}removeUIElement(e){return this.uiManager.removeElement(e)}findRouteByPath(e){const t=s=>{for(const n of s){if(n.path===e)return n;if(n.extend){const i=t(n.extend);if(i)return i}}return null};return t(this.routes)}async loadSceneByPath(e){if(this.scenes.has(e)){const s=this.scenes.get(e);return s&&s.container&&(s.container.style.display="block",s.container.style.visibility="visible"),s}if(!this.findRouteByPath(e))throw new Error(`Route not found for path: ${e}`);try{const s=e==="/"?"/index":e,n=`/sence${s}/index.pe`;console.log("Loading scene from:",n);const i=await fetch(n).then(l=>{if(!l.ok)throw new Error(`Failed to load scene: ${l.status} ${l.statusText}`);return l.text()}),o=`/sence${s}/index.less`;console.log("Loading scene style from:",o);let r="";try{try{const l=await A(Object.assign({}),`../../template-example/compiled-styles${s}/index.js`);r=l.default||l.style||"",console.log("Loaded compiled scene style")}catch{console.log("Compiled style not found, falling back to dynamic loading"),r=await fetch(o).then(d=>d.ok?d.text():(console.warn(`Failed to load scene style: ${d.status} ${d.statusText}`),"")),o.endsWith(".less")&&r.includes("{")&&(r=this.compileLessToCss(r))}}catch(l){console.warn(`Failed to load scene style for path: ${e}`,l)}const a=this.parseSceneFile(i,r,e);return this.scenes.set(e,a),a}catch(s){throw console.error(`Failed to load scene for path: ${e}`,s),s}}parseSceneFile(e,t,s){console.log("Parsing scene file for path:",s);const n=e.match(/([\s\S]*?)<\/sence>/i),i=n?n[1].trim():"",o=e.match(/