handler-playable-sdk 0.1.8 → 0.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- "use strict";var ni=Object.create;var Le=Object.defineProperty;var ai=Object.getOwnPropertyDescriptor;var ii=Object.getOwnPropertyNames;var si=Object.getPrototypeOf,oi=Object.prototype.hasOwnProperty;var ri=(e,t)=>{for(var n in t)Le(e,n,{get:t[n],enumerable:!0})},Rn=(e,t,n,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of ii(t))!oi.call(e,i)&&i!==n&&Le(e,i,{get:()=>t[i],enumerable:!(a=ai(t,i))||a.enumerable});return e};var be=(e,t,n)=>(n=e!=null?ni(si(e)):{},Rn(t||!e||!e.__esModule?Le(n,"default",{value:e,enumerable:!0}):n,e)),li=e=>Rn(Le({},"__esModule",{value:!0}),e);var Ri={};ri(Ri,{GameObject:()=>Ce,GameObjectManager:()=>Ne,Renderer:()=>Ae,Transform:()=>Se,animateHandClick:()=>la,animatePanelEntrance:()=>ra,createBrushTexture:()=>fa,createEndGamePanel:()=>oa,createHandTutorial:()=>ca,createThreeBase:()=>aa,createTutorialLabel:()=>da,getRegisteredFontIds:()=>sa,loadAsset:()=>st,loadCharacterFrames:()=>ma,registerFont:()=>ia,resolveFont:()=>B,resolveFontWeight:()=>O,updateHandAnimation:()=>pa});module.exports=li(Ri);var fe=be(require("three"));var K={};function Fe(e,t,n=!1){K[e]||(K[e]=[]),K[e].push({fn:t,once:n})}function Ze(e,t){if(K[e]){if(!t){delete K[e];return}K[e]=K[e].filter(n=>n.fn!==t)}}function De(e,...t){let n=K[e];if(n)for(let a of[...n])a.fn(...t),a.once&&Ze(e,a.fn)}function P(e,t){Fe(e,t,!0)}var $e={name:"handler-playable-sdk",version:"0.1.8",description:"Handler Playable SDK v0.1 with contract-aligned surface (root sandbox, canonical event envelope).",main:"dist/index.js",module:"dist/index.mjs",types:"dist/index.d.ts",exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.mjs",require:"./dist/index.js"},"./pixi":{types:"./dist/pixi/index.d.ts",import:"./dist/pixi/index.mjs",require:"./dist/pixi/index.js"},"./three":{types:"./dist/three/index.d.ts",import:"./dist/three/index.mjs",require:"./dist/three/index.js"}},scripts:{build:"tsup src/index.ts src/pixi/index.ts src/three/index.ts --format cjs,esm --dts --clean --minify",lint:"eslint 'src/**/*.{ts,tsx}'",typecheck:"tsc --noEmit",prepublishOnly:"npm run build"},author:"Handler",license:"MIT",publishConfig:{access:"public"},repository:{type:"git",url:"https://github.com/HandlerAIGames/handler-playable-sdk.git"},files:["dist","LICENSE","README.md"],peerDependencies:{"pixi.js":"^8.0.0",three:"^0.160.0"},peerDependenciesMeta:{"pixi.js":{optional:!0},three:{optional:!0}},devDependencies:{"@types/three":"^0.160.0",eslint:"^8.57.1","pixi.js":"^8.8.1",three:"^0.160.0","ts-node":"^10.9.2",tsup:"^8.4.0",typescript:"^5.7.2"}};var z=0,di=z++,Hn=z++,Mn=z++,kn=z++,Ln=z++,Fn=z++,Dn=z++,$n=z++,Pn=z++,zn=z++,Wn=z++,Bn=z++,S=di;function On(){return S===Hn}function Nn(){return S===Mn}function Yn(){return S===kn}function In(){return S===Ln}function re(){return S===Fn}function le(){return S===Dn}function Gn(){return S===$n}function jn(){return S===Pn}function Vn(){return S===zn}function Qe(){return S===Wn}function Ue(){return S===Bn}function qn(){let e=typeof AD_PROTOCOL!="undefined"?AD_PROTOCOL:"none",t=typeof AD_NETWORK!="undefined"?AD_NETWORK:"web_embed";if(e==="mraid")try{mraid.getState(),S=Hn;return}catch{}else if(e==="dapi")try{dapi.isReady(),S=Mn;return}catch{}if(t==="facebook")try{typeof FbPlayableAd!="undefined"&&(S=kn)}catch{}else if(t==="google")try{typeof ExitApi!="undefined"&&(S=Ln)}catch{}else if(t==="mintegral")window.gameReady&&(S=Fn);else if(t==="tapjoy")window.TJ_API&&(S=Dn);else if(t==="tiktok")window.openAppStore&&(S=$n);else if(t==="smadex")try{window.smxTracking&&(S=Pn)}catch{}else if(t==="snapchat")try{window.ScPlayableAd&&(S=zn)}catch{}else t==="vungle"?S=Wn:(e==="nucleo"||t==="nucleo")&&(S=Bn)}var Un={mechanic_id:"TODO_mechanic_id",variant_id:"TODO_variant_id",deployment_id:"TODO_deployment_id",export_id:"TODO_export_id",profile_id:"TODO_profile_id",instance_id:"default"},pi=Math.random().toString(36).slice(2),ce=null,_e={...Un},ea="web_embed",ui={},et=!1,xe=!1,Ee=!1,ta=!1,it=1,nt=0,Be=!1,q=!1,We="",de=Math.floor(window.innerWidth),pe=Math.floor(window.innerHeight),at=de>pe,X=!1,we=!1,Xn=!1,Kn=!1,tt=!1,Pe=null;function Jn(){if(ce)return ce;let e=document.createElement("div");return e.id="handler-root",e.setAttribute("data-handler-root","true"),document.body.appendChild(e),ce=e,e}function ze(e){switch(e){case"interaction":return"engagement";case"finish":return"complete";case"install":return"cta_click";default:return e}}function na(e,t){return{event_name:e,ts:Date.now(),session_id:pi,deployment_id:_e.deployment_id,variant_id:_e.variant_id,export_profile_id:_e.profile_id,instance_id:_e.instance_id||"default",env:ea==="mraid"?"mraid":"web",payload:t}}function x(e,t){let n=ze(e),a=na(n,t);De(n,a),n!==e&&De(e,a)}function Te(){Pe&&(Pe(de,pe),Pe=null)}function ue(e){it=e,x("volume",e)}function me(e){e&&(ta=!0),!Ee&&(Ee=!0,x("pause"),ue(0))}function ve(e){!e&&ta||Ee&&(Ee=!1,x("resume"),ue(it))}function Z(e,t){de=Math.floor(e||window.innerWidth),pe=Math.floor(t||window.innerHeight),at=de>pe,x("resize",{width:de,height:pe})}function mi(){if(On())try{let e=mraid.getMaxSize();Z(e.width,e.height);let t=()=>{mraid.isViewable()&&mraid.getState()!=="hidden"?ve():me()};if(mraid.addEventListener("viewableChange",t),mraid.addEventListener("stateChange",t),mraid.addEventListener("sizeChange",()=>{let n=mraid.getMaxSize();Z(n.width,n.height)}),mraid.getAudioVolume){let n=mraid.getAudioVolume();ue(n?1:0)}if(mraid.addEventListener("audioVolumeChange",n=>{n!==null&&ue(n>0?1:0)}),mraid.addEventListener("error",(n,a)=>{console.warn("mraid error:",n,"action:",a)}),Be=!0,mraid.isViewable()&&mraid.getState()!=="hidden")X=!0,x("boot"),x("view"),x("ready"),q=!0,Te();else{let n=()=>{X=!0,x("boot"),x("view"),x("ready"),q=!0,Te()};mraid.addEventListener("ready",n)}}catch(e){console.warn("MRAID hook skipped",e)}}function fi(){if(Nn())try{let e=dapi.getScreenSize();Z(e.width,e.height),dapi.addEventListener("viewableChange",n=>{n.isViewable?ve():me()}),dapi.addEventListener("adResized",n=>{let a=dapi.getScreenSize();Z(n.width||a.width,n.height||a.height)});let t=dapi.getAudioVolume();if(ue(t?1:0),dapi.addEventListener("audioVolumeChange",n=>ue(n?1:0)),Be=!0,dapi.isViewable())X=!0,x("boot"),x("view"),x("ready"),q=!0,Te();else{let n=()=>{X=!0,x("boot"),x("view"),x("ready"),q=!0,Te()};dapi.addEventListener("ready",n)}}catch(e){console.warn("DAPI hook skipped",e)}}function Zn(){let e=()=>{X||document.visibilityState==="visible"&&(document.readyState==="complete"||document.readyState==="interactive")&&(X=!0,x("boot"),x("view"),x("ready"),q=!0,Te(),we&&(we=!1,J.start()))};window.addEventListener("resize",()=>Z()),document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"?(ve(),e()):me()}),document.readyState==="complete"||document.readyState==="interactive"?e():window.addEventListener("load",e),Be=!0}function yi(){let e=t=>{typeof TouchEvent!="undefined"&&t instanceof TouchEvent&&(Xn=!0),!(Xn&&t instanceof MouseEvent)&&(nt+=1,x("interaction",nt))};document.addEventListener("mousedown",e),document.addEventListener("touchstart",e)}function hi(e){var a,i,s,o,l,c,m,r,d,u,h,b;let t=typeof AD_PROTOCOL!="undefined"?AD_PROTOCOL:"none";if((typeof AD_NETWORK!="undefined"?AD_NETWORK:"web_embed")==="google")try{(a=window.ExitApi)==null||a.exit();return}catch{}if(t==="mraid"&&typeof mraid!="undefined")mraid.open(e||"");else if(t==="dapi"&&typeof dapi!="undefined")dapi.openStoreUrl();else if(le())(s=(i=window.TJ_API)==null?void 0:i.click)==null||s.call(i);else if(Yn())(l=(o=window.FbPlayableAd)==null?void 0:o.onCTAClick)==null||l.call(o);else if(Vn())(m=(c=window.ScPlayableAd)==null?void 0:c.onCTAClick)==null||m.call(c);else if(jn())try{(d=(r=window.smxTracking)==null?void 0:r.redirect)==null||d.call(r)}catch(p){console.warn("Smadex redirect failed",p)}else if(In()){let p=window.ExitApi;p&&typeof p.exit=="function"?p.exit(e||We||""):e&&window.open(e)}else re()?(u=window.install)==null||u.call(window):Gn()?(h=window.openAppStore)==null||h.call(window):Qe()?(b=parent==null?void 0:parent.postMessage)==null||b.call(parent,"download","*"):e&&window.open(e)}function gi(){let e=typeof AD_NETWORK!="undefined"?AD_NETWORK:"web_embed",t=n=>{if(!n)return;let a=new Image;a.src=n};if(e==="bigabid"){let n=window.BIGABID_BIDTIMEMACROS;if(!n)return;P("view",()=>t(n.mraid_viewable)),P("start",()=>t(n.game_viewable)),P("engagement",()=>t(n.engagement));let a=()=>t(n.complete);P("complete",a),Fe("engagement",i=>{var s;((s=i==null?void 0:i.payload)==null?void 0:s.count)>3&&a()}),P("cta_click",()=>t(n.click))}else if(e==="inmobi"){let n=window.INMOBI_DSPMACROS;if(!n)return;P("view",()=>t(n.Ad_Load_Start)),P("start",()=>t(n.Ad_Viewable)),P("engagement",()=>t(n.First_Engagement)),P("complete",()=>t(n.Gameplay_Complete)),P("cta_click",()=>t(n.DSP_Click)),P("start",()=>{[5,10,15,20,25,30].forEach(a=>setTimeout(()=>t(n[`Spent_${a}_Seconds`]),a*1e3))})}}function bi(){if(!le())return;let e=window.TJ_API;e&&e.setPlayableAPI&&e.setPlayableAPI({skipAd:()=>{try{J.finish()}catch(t){console.warn("Tapjoy skip failed",t)}}})}function Qn(){var t,n,a;let e=window.TJ_API;(t=e==null?void 0:e.objectiveComplete)==null||t.call(e),(n=e==null?void 0:e.playableFinished)==null||n.call(e),(a=e==null?void 0:e.gameplayFinished)==null||a.call(e)}function xi(){re()&&(window.mintGameStart=()=>{ve(!0),Z()},window.mintGameClose=()=>{me(!0)})}function _i(){if(!Ue())return;let e=window.NUC;!e||!e.trigger||(J.on("cta_click",()=>{var t,n;return(n=(t=e.trigger).convert)==null?void 0:n.call(t,We)}),J.on("complete",()=>{var t,n;return(n=(t=e.trigger).tryAgain)==null?void 0:n.call(t)}))}var J={init(e={},t){if(ea=e.profile||"web_embed",ui=e.consent||{},_e={...Un,...e.ids||{}},ce=e.rootEl||ce,We=e.destinationUrl||(/android/i.test(navigator.userAgent)?"https://play.google.com/store":"https://www.apple.com/app-store/"),t&&(Pe=t),x("init"),document.body.oncontextmenu=()=>!1,Jn(),wi(ce),qn(),mi(),fi(),!Be){if(document.readyState==="complete")Zn();else if(!Kn){Kn=!0;let n=()=>{Zn(),window.removeEventListener("load",n),document.removeEventListener("DOMContentLoaded",n)};window.addEventListener("load",n),document.addEventListener("DOMContentLoaded",n)}}yi(),gi(),bi(),xi(),_i(),console.log(`%c @handler/playable-sdk %c v${$e.version||"0.0.0"} `,"background: #007acc; color: #fff; font-size: 14px; padding: 4px 8px; border-top-left-radius: 4px; border-bottom-left-radius: 4px;","background: #e1e4e8; color: #333; font-size: 14px; padding: 4px 8px; border-top-right-radius: 4px; border-bottom-right-radius: 4px;"),X&&!q&&(x("boot"),x("view"),x("ready"),we&&(we=!1,J.start()),q=!0),q=X},getRoot(){return Jn()},get version(){return $e.version||"0.0.0"},get maxWidth(){return de},get maxHeight(){return pe},get isLandscape(){return at},get isReady(){return q},get isStarted(){return et},get isPaused(){return Ee},get isFinished(){return xe},get volume(){return it},get interactions(){return nt},on(e,t){Fe(ze(e),t)},off(e,t){Ze(ze(e),t)},start(){var e,t;if(!et){if(!X){we=!0;return}if(et=!0,x("start"),Z(),re())me(),(e=window.gameReady)==null||e.call(window);else if(le()){let n=window.TJ_API;(t=n==null?void 0:n.setPlayableBuild)==null||t.call(n,{orientation:at?"landscape":"portrait",buildID:$e.version||"dev"})}}},finish(){var e,t;xe||(xe=!0,x("complete"),re()?(e=window.gameEnd)==null||e.call(window):Qe()?(t=parent==null?void 0:parent.postMessage)==null||t.call(parent,"complete","*"):le()&&Qn())},install(e){if(!xe){xe=!0,le()?(Qn(),setTimeout(()=>J.install(e),300)):(x("complete"),setTimeout(()=>J.install(e),0));return}tt||(tt=!0,setTimeout(()=>tt=!1,500),x("cta_click"),x("conversion"),hi(e||We))},emit(e,t){let n=ze(e);if(!["view","boot","start","engagement","complete","cta_click","conversion","retry","pause","resume","resize","volume","error"].includes(n)&&!n.startsWith("custom."))throw new Error(`Event ${e} must be canonical or namespaced as custom.<mechanic_id>.<event>`);let a=na(n,t);De(n,a)},retry(){var e,t,n;if(re())(e=window.gameRetry)==null||e.call(window);else if(Ue()){let a=window.NUC;(n=(t=a==null?void 0:a.trigger)==null?void 0:t.tryAgain)==null||n.call(t)}x("engagement",{action:"retry"})},pause(){me(!0)},resume(){ve(!0)},resize(e,t){Z(e,t)}},Oe=J;function wi(e){let t=document.createElement("script");t.type="text/javascript",t.textContent=`
1
+ "use strict";var oa=Object.create;var De=Object.defineProperty;var ra=Object.getOwnPropertyDescriptor;var la=Object.getOwnPropertyNames;var ca=Object.getPrototypeOf,da=Object.prototype.hasOwnProperty;var pa=(e,t)=>{for(var n in t)De(e,n,{get:t[n],enumerable:!0})},Fn=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of la(t))!da.call(e,a)&&a!==n&&De(e,a,{get:()=>t[a],enumerable:!(i=ra(t,a))||i.enumerable});return e};var xe=(e,t,n)=>(n=e!=null?oa(ca(e)):{},Fn(t||!e||!e.__esModule?De(n,"default",{value:e,enumerable:!0}):n,e)),ua=e=>Fn(De({},"__esModule",{value:!0}),e);var Fa={};pa(Fa,{AspectClass:()=>lt,GameObject:()=>Re,GameObjectManager:()=>Ge,Renderer:()=>Ae,ResponsiveUISystem:()=>fe,Transform:()=>Ce,animateHandClick:()=>ui,animatePanelEntrance:()=>pi,createBrushTexture:()=>bi,createEndGamePanel:()=>di,createHandTutorial:()=>mi,createThreeBase:()=>ri,createTutorialLabel:()=>fi,getAspectClass:()=>Ie,getRegisteredFontIds:()=>ci,loadAsset:()=>ct,loadCharacterFrames:()=>gi,registerFont:()=>li,resolveFont:()=>N,resolveFontWeight:()=>O,updateHandAnimation:()=>hi});module.exports=ua(Fa);var he=xe(require("three"));var K={};function $e(e,t,n=!1){K[e]||(K[e]=[]),K[e].push({fn:t,once:n})}function et(e,t){if(K[e]){if(!t){delete K[e];return}K[e]=K[e].filter(n=>n.fn!==t)}}function Pe(e,...t){let n=K[e];if(n)for(let i of[...n])i.fn(...t),i.once&&et(e,i.fn)}function P(e,t){$e(e,t,!0)}var We={name:"handler-playable-sdk",version:"0.1.9",description:"Handler Playable SDK v0.1 with contract-aligned surface (root sandbox, canonical event envelope).",main:"dist/index.js",module:"dist/index.mjs",types:"dist/index.d.ts",exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.mjs",require:"./dist/index.js"},"./pixi":{types:"./dist/pixi/index.d.ts",import:"./dist/pixi/index.mjs",require:"./dist/pixi/index.js"},"./three":{types:"./dist/three/index.d.ts",import:"./dist/three/index.mjs",require:"./dist/three/index.js"}},scripts:{build:"tsup src/index.ts src/pixi/index.ts src/three/index.ts --format cjs,esm --dts --clean --minify",lint:"eslint 'src/**/*.{ts,tsx}'",typecheck:"tsc --noEmit",prepublishOnly:"npm run build"},author:"Handler",license:"MIT",publishConfig:{access:"public"},repository:{type:"git",url:"https://github.com/HandlerAIGames/handler-playable-sdk.git"},files:["dist","LICENSE","README.md"],peerDependencies:{"pixi.js":"^8.0.0",three:"^0.160.0"},peerDependenciesMeta:{"pixi.js":{optional:!0},three:{optional:!0}},devDependencies:{"@types/three":"^0.160.0",eslint:"^8.57.1","pixi.js":"^8.8.1",three:"^0.160.0","ts-node":"^10.9.2",tsup:"^8.4.0",typescript:"^5.7.2"}};var W=0,fa=W++,kn=W++,Dn=W++,$n=W++,Pn=W++,Wn=W++,zn=W++,Bn=W++,Nn=W++,On=W++,Yn=W++,In=W++,v=fa;function Gn(){return v===kn}function jn(){return v===Dn}function Vn(){return v===$n}function qn(){return v===Pn}function re(){return v===Wn}function le(){return v===zn}function Xn(){return v===Bn}function Kn(){return v===Nn}function Jn(){return v===On}function tt(){return v===Yn}function nt(){return v===In}function Zn(){let e=typeof AD_PROTOCOL!="undefined"?AD_PROTOCOL:"none",t=typeof AD_NETWORK!="undefined"?AD_NETWORK:"web_embed";if(e==="mraid")try{mraid.getState(),v=kn;return}catch{}else if(e==="dapi")try{dapi.isReady(),v=Dn;return}catch{}if(t==="facebook")try{typeof FbPlayableAd!="undefined"&&(v=$n)}catch{}else if(t==="google")try{typeof ExitApi!="undefined"&&(v=Pn)}catch{}else if(t==="mintegral")window.gameReady&&(v=Wn);else if(t==="tapjoy")window.TJ_API&&(v=zn);else if(t==="tiktok")window.openAppStore&&(v=Bn);else if(t==="smadex")try{window.smxTracking&&(v=Nn)}catch{}else if(t==="snapchat")try{window.ScPlayableAd&&(v=On)}catch{}else t==="vungle"?v=Yn:(e==="nucleo"||t==="nucleo")&&(v=In)}var ii={mechanic_id:"TODO_mechanic_id",variant_id:"TODO_variant_id",deployment_id:"TODO_deployment_id",export_id:"TODO_export_id",profile_id:"TODO_profile_id",instance_id:"default"},ha=Math.random().toString(36).slice(2),ce=null,Ee={...ii},ai="web_embed",ya={},it=!1,_e=!1,Te=!1,si=!1,rt=1,st=0,Oe=!1,V=!1,Ne="",de=Math.floor(window.innerWidth),pe=Math.floor(window.innerHeight),ot=de>pe,q=!1,we=!1,Qn=!1,Un=!1,at=!1,ze=null;function ei(){if(ce)return ce;let e=document.createElement("div");return e.id="handler-root",e.setAttribute("data-handler-root","true"),document.body.appendChild(e),ce=e,e}function Be(e){switch(e){case"interaction":return"engagement";case"finish":return"complete";case"install":return"cta_click";default:return e}}function oi(e,t){return{event_name:e,ts:Date.now(),session_id:ha,deployment_id:Ee.deployment_id,variant_id:Ee.variant_id,export_profile_id:Ee.profile_id,instance_id:Ee.instance_id||"default",env:ai==="mraid"?"mraid":"web",payload:t}}function _(e,t){let n=Be(e),i=oi(n,t);Pe(n,i),n!==e&&Pe(e,i)}function ve(){ze&&(ze(de,pe),ze=null)}function ue(e){rt=e,_("volume",e)}function me(e){e&&(si=!0),!Te&&(Te=!0,_("pause"),ue(0))}function Se(e){!e&&si||Te&&(Te=!1,_("resume"),ue(rt))}function Z(e,t){de=Math.floor(e||window.innerWidth),pe=Math.floor(t||window.innerHeight),ot=de>pe,_("resize",{width:de,height:pe})}function ga(){if(Gn())try{let e=mraid.getMaxSize();Z(e.width,e.height);let t=()=>{mraid.isViewable()&&mraid.getState()!=="hidden"?Se():me()};if(mraid.addEventListener("viewableChange",t),mraid.addEventListener("stateChange",t),mraid.addEventListener("sizeChange",()=>{let n=mraid.getMaxSize();Z(n.width,n.height)}),mraid.getAudioVolume){let n=mraid.getAudioVolume();ue(n?1:0)}if(mraid.addEventListener("audioVolumeChange",n=>{n!==null&&ue(n>0?1:0)}),mraid.addEventListener("error",(n,i)=>{console.warn("mraid error:",n,"action:",i)}),Oe=!0,mraid.isViewable()&&mraid.getState()!=="hidden")q=!0,_("boot"),_("view"),_("ready"),V=!0,ve();else{let n=()=>{q=!0,_("boot"),_("view"),_("ready"),V=!0,ve()};mraid.addEventListener("ready",n)}}catch(e){console.warn("MRAID hook skipped",e)}}function ba(){if(jn())try{let e=dapi.getScreenSize();Z(e.width,e.height),dapi.addEventListener("viewableChange",n=>{n.isViewable?Se():me()}),dapi.addEventListener("adResized",n=>{let i=dapi.getScreenSize();Z(n.width||i.width,n.height||i.height)});let t=dapi.getAudioVolume();if(ue(t?1:0),dapi.addEventListener("audioVolumeChange",n=>ue(n?1:0)),Oe=!0,dapi.isViewable())q=!0,_("boot"),_("view"),_("ready"),V=!0,ve();else{let n=()=>{q=!0,_("boot"),_("view"),_("ready"),V=!0,ve()};dapi.addEventListener("ready",n)}}catch(e){console.warn("DAPI hook skipped",e)}}function ti(){let e=()=>{q||document.visibilityState==="visible"&&(document.readyState==="complete"||document.readyState==="interactive")&&(q=!0,_("boot"),_("view"),_("ready"),V=!0,ve(),we&&(we=!1,J.start()))};window.addEventListener("resize",()=>Z()),document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"?(Se(),e()):me()}),document.readyState==="complete"||document.readyState==="interactive"?e():window.addEventListener("load",e),Oe=!0}function xa(){let e=t=>{typeof TouchEvent!="undefined"&&t instanceof TouchEvent&&(Qn=!0),!(Qn&&t instanceof MouseEvent)&&(st+=1,_("interaction",st))};document.addEventListener("mousedown",e),document.addEventListener("touchstart",e)}function _a(e){var i,a,s,o,p,r,m,l,c,f,u,b;let t=typeof AD_PROTOCOL!="undefined"?AD_PROTOCOL:"none";if((typeof AD_NETWORK!="undefined"?AD_NETWORK:"web_embed")==="google")try{(i=window.ExitApi)==null||i.exit();return}catch{}if(t==="mraid"&&typeof mraid!="undefined")mraid.open(e||"");else if(t==="dapi"&&typeof dapi!="undefined")dapi.openStoreUrl();else if(le())(s=(a=window.TJ_API)==null?void 0:a.click)==null||s.call(a);else if(Vn())(p=(o=window.FbPlayableAd)==null?void 0:o.onCTAClick)==null||p.call(o);else if(Jn())(m=(r=window.ScPlayableAd)==null?void 0:r.onCTAClick)==null||m.call(r);else if(Kn())try{(c=(l=window.smxTracking)==null?void 0:l.redirect)==null||c.call(l)}catch(d){console.warn("Smadex redirect failed",d)}else if(qn()){let d=window.ExitApi;d&&typeof d.exit=="function"?d.exit(e||Ne||""):e&&window.open(e)}else re()?(f=window.install)==null||f.call(window):Xn()?(u=window.openAppStore)==null||u.call(window):tt()?(b=parent==null?void 0:parent.postMessage)==null||b.call(parent,"download","*"):e&&window.open(e)}function Ea(){let e=typeof AD_NETWORK!="undefined"?AD_NETWORK:"web_embed",t=n=>{if(!n)return;let i=new Image;i.src=n};if(e==="bigabid"){let n=window.BIGABID_BIDTIMEMACROS;if(!n)return;P("view",()=>t(n.mraid_viewable)),P("start",()=>t(n.game_viewable)),P("engagement",()=>t(n.engagement));let i=()=>t(n.complete);P("complete",i),$e("engagement",a=>{var s;((s=a==null?void 0:a.payload)==null?void 0:s.count)>3&&i()}),P("cta_click",()=>t(n.click))}else if(e==="inmobi"){let n=window.INMOBI_DSPMACROS;if(!n)return;P("view",()=>t(n.Ad_Load_Start)),P("start",()=>t(n.Ad_Viewable)),P("engagement",()=>t(n.First_Engagement)),P("complete",()=>t(n.Gameplay_Complete)),P("cta_click",()=>t(n.DSP_Click)),P("start",()=>{[5,10,15,20,25,30].forEach(i=>setTimeout(()=>t(n[`Spent_${i}_Seconds`]),i*1e3))})}}function wa(){if(!le())return;let e=window.TJ_API;e&&e.setPlayableAPI&&e.setPlayableAPI({skipAd:()=>{try{J.finish()}catch(t){console.warn("Tapjoy skip failed",t)}}})}function ni(){var t,n,i;let e=window.TJ_API;(t=e==null?void 0:e.objectiveComplete)==null||t.call(e),(n=e==null?void 0:e.playableFinished)==null||n.call(e),(i=e==null?void 0:e.gameplayFinished)==null||i.call(e)}function Ta(){re()&&(window.mintGameStart=()=>{Se(!0),Z()},window.mintGameClose=()=>{me(!0)})}function va(){if(!nt())return;let e=window.NUC;!e||!e.trigger||(J.on("cta_click",()=>{var t,n;return(n=(t=e.trigger).convert)==null?void 0:n.call(t,Ne)}),J.on("complete",()=>{var t,n;return(n=(t=e.trigger).tryAgain)==null?void 0:n.call(t)}))}var J={init(e={},t){if(ai=e.profile||"web_embed",ya=e.consent||{},Ee={...ii,...e.ids||{}},ce=e.rootEl||ce,Ne=e.destinationUrl||(/android/i.test(navigator.userAgent)?"https://play.google.com/store":"https://www.apple.com/app-store/"),t&&(ze=t),_("init"),document.body.oncontextmenu=()=>!1,ei(),Sa(ce),Zn(),ga(),ba(),!Oe){if(document.readyState==="complete")ti();else if(!Un){Un=!0;let n=()=>{ti(),window.removeEventListener("load",n),document.removeEventListener("DOMContentLoaded",n)};window.addEventListener("load",n),document.addEventListener("DOMContentLoaded",n)}}xa(),Ea(),wa(),Ta(),va(),console.log(`%c @handler/playable-sdk %c v${We.version||"0.0.0"} `,"background: #007acc; color: #fff; font-size: 14px; padding: 4px 8px; border-top-left-radius: 4px; border-bottom-left-radius: 4px;","background: #e1e4e8; color: #333; font-size: 14px; padding: 4px 8px; border-top-right-radius: 4px; border-bottom-right-radius: 4px;"),q&&!V&&(_("boot"),_("view"),_("ready"),we&&(we=!1,J.start()),V=!0),V=q},getRoot(){return ei()},get version(){return We.version||"0.0.0"},get maxWidth(){return de},get maxHeight(){return pe},get isLandscape(){return ot},get isReady(){return V},get isStarted(){return it},get isPaused(){return Te},get isFinished(){return _e},get volume(){return rt},get interactions(){return st},on(e,t){$e(Be(e),t)},off(e,t){et(Be(e),t)},start(){var e,t;if(!it){if(!q){we=!0;return}if(it=!0,_("start"),Z(),re())me(),(e=window.gameReady)==null||e.call(window);else if(le()){let n=window.TJ_API;(t=n==null?void 0:n.setPlayableBuild)==null||t.call(n,{orientation:ot?"landscape":"portrait",buildID:We.version||"dev"})}}},finish(){var e,t;_e||(_e=!0,_("complete"),re()?(e=window.gameEnd)==null||e.call(window):tt()?(t=parent==null?void 0:parent.postMessage)==null||t.call(parent,"complete","*"):le()&&ni())},install(e){if(!_e){_e=!0,le()?(ni(),setTimeout(()=>J.install(e),300)):(_("complete"),setTimeout(()=>J.install(e),0));return}at||(at=!0,setTimeout(()=>at=!1,500),_("cta_click"),_("conversion"),_a(e||Ne))},emit(e,t){let n=Be(e);if(!["view","boot","start","engagement","complete","cta_click","conversion","retry","pause","resume","resize","volume","error"].includes(n)&&!n.startsWith("custom."))throw new Error(`Event ${e} must be canonical or namespaced as custom.<mechanic_id>.<event>`);let i=oi(n,t);Pe(n,i)},retry(){var e,t,n;if(re())(e=window.gameRetry)==null||e.call(window);else if(nt()){let i=window.NUC;(n=(t=i==null?void 0:i.trigger)==null?void 0:t.tryAgain)==null||n.call(t)}_("engagement",{action:"retry"})},pause(){me(!0)},resume(){Se(!0)},resize(e,t){Z(e,t)}},Ye=J;function Sa(e){let t=document.createElement("script");t.type="text/javascript",t.textContent=`
2
2
  (function(){
3
3
  var events = ['touchstart','touchend','mousedown','keydown'];
4
4
  function unlock(){
@@ -14,15 +14,15 @@
14
14
  }
15
15
  events.forEach(function(e){ document.addEventListener(e, unlock, false); });
16
16
  })();
17
- `,e.appendChild(t)}async function aa(e,t={}){let n=()=>{let p=e.style.width||"",f=e.style.height||"",y=320,g=480,E=window.getComputedStyle(e),w=p||E.width,T=f||E.height;if(w&&w!=="auto"&&!w.includes("%")){let _=parseFloat(w);!isNaN(_)&&_>0&&isFinite(_)&&(y=_)}if(T&&T!=="auto"&&!T.includes("%")){let _=parseFloat(T);!isNaN(_)&&_>0&&isFinite(_)&&(g=_)}let A=e.clientWidth,v=e.clientHeight;if((y===320||y<=0||!isFinite(y))&&A&&A>0&&(y=A),(g===480||g<=0||!isFinite(g))&&v&&v>0&&(g=v),y<=0||g<=0||!isFinite(y)||!isFinite(g)){let _=e.getBoundingClientRect();_.width>0&&isFinite(_.width)&&(y=_.width),_.height>0&&isFinite(_.height)&&(g=_.height)}return(y<=0||!isFinite(y))&&(y=e.clientWidth||window.innerWidth||320),(g<=0||!isFinite(g))&&(g=e.clientHeight||window.innerHeight||480),console.log("[THREE-BASE] getSize result:",{width:y,height:g,styleWidth:p,styleHeight:f,effectiveWidth:w,effectiveHeight:T,computedWidth:E.width,computedHeight:E.height,clientWidth:A,clientHeight:v,boundingRect:e.getBoundingClientRect()}),{width:y,height:g}},a=e.style.width&&!e.style.width.includes("%"),i=e.style.height&&!e.style.height.includes("%");e.style.position=e.style.position||"relative",e.style.display=e.style.display||"flex",e.style.flexDirection=e.style.flexDirection||"column",e.style.alignItems=e.style.alignItems||"stretch",e.style.width=e.style.width||"100%",e.style.height=e.style.height||"100dvh",e.style.minHeight=e.style.minHeight||"100vh",e.style.maxWidth=e.style.maxWidth||"100%",e.style.maxHeight=e.style.maxHeight||"100%",e.style.boxSizing=e.style.boxSizing||"border-box",e.style.overflow=e.style.overflow||"hidden",t.background&&(e.style.background=t.background);let s=document.createElement("div");s.setAttribute("style",["position:relative","width:100%","height:100%","display:flex","align-items:center","justify-content:center",`background:${t.background||"transparent"}`,"color:var(--h-text, #f4f6ff)",'font-family:var(--h-font-main, "Inter", "Helvetica Neue", Arial, sans-serif)',"box-sizing:border-box"].join(";")),e.appendChild(s);let o=document.createElement("div");o.setAttribute("style",["position:absolute","inset:0","width:100%","height:100%","pointer-events:auto"].join(";")),s.appendChild(o);let l=new fe.Scene,{width:c,height:m}=n(),r=new fe.OrthographicCamera(-c/2,c/2,m/2,-m/2,.1,1e3);r.position.set(0,0,1),r.lookAt(0,0,0),r.updateMatrixWorld();let d=new fe.WebGLRenderer({antialias:!0,alpha:!0,preserveDrawingBuffer:!0});d.setPixelRatio(window.devicePixelRatio||1),d.setSize(c,m),d.setClearColor(0,0),d.domElement.style.position="absolute",d.domElement.style.top="0",d.domElement.style.left="0",d.domElement.style.width="100%",d.domElement.style.height="100%",d.domElement.style.display="block",d.domElement.style.pointerEvents="auto",o.appendChild(d.domElement);let u=p=>{let f,y;if(typeof(p==null?void 0:p.width)=="number"&&p.width>0?f=p.width:f=n().width,typeof(p==null?void 0:p.height)=="number"&&p.height>0?y=p.height:y=n().height,f<=0||y<=0||!isFinite(f)||!isFinite(y)){console.warn("[THREE-BASE] Invalid size in applySize, using getSize fallback",{newWidth:f,newHeight:y,size:p});let g=n();f=g.width,y=g.height}console.log("[THREE-BASE] applySize:",{newWidth:f,newHeight:y,providedSize:p,containerSize:n()}),d.setSize(f,y),d.setPixelRatio(window.devicePixelRatio||1),r.left=-f/2,r.right=f/2,r.top=y/2,r.bottom=-y/2,r.updateProjectionMatrix()};requestAnimationFrame(()=>u());let h=!1;Oe.on("pause",()=>{h=!0,document.querySelectorAll("audio").forEach(f=>f.pause())}),Oe.on("resume",()=>{h=!1,document.querySelectorAll("audio").forEach(f=>{f.currentTime>0&&!f.ended&&f.play().catch(()=>{})})}),Oe.on("resize",({payload:p})=>{u({width:p==null?void 0:p.width,height:p==null?void 0:p.height})}),window.addEventListener("resize",()=>u());let b=document.createElement("div");return b.setAttribute("style",["position:absolute","inset:0","display:flex","flex-direction:column","justify-content:flex-start","gap:12px","pointer-events:none","font-family:Arial,sans-serif","padding:20px 16px","padding-bottom:clamp(24px, 6vh, 96px)","box-sizing:border-box","z-index:2"].join(";")),s.appendChild(b),{scene:l,camera:r,renderer:d,overlay:b,applySize:u}}var R=be(require("three")),Se=class{constructor(t){var n,a;this.position=(t==null?void 0:t.position)||{x:0,y:0},this.scale=(n=t==null?void 0:t.scale)!=null?n:1,this.rotation=(a=t==null?void 0:t.rotation)!=null?a:0}update(t){t.position!==void 0&&(this.position={...t.position}),t.scale!==void 0&&(this.scale=t.scale),t.rotation!==void 0&&(this.rotation=t.rotation)}syncToThree(t){let n=t.position.z,a=n===0||!isFinite(n)?.5:n;t.position.set(this.position.x,this.position.y,a),t.scale.set(this.scale,this.scale,this.scale),t.rotation.z=this.rotation}},Ae=class{constructor(t){var n,a,i,s;this.z_index=(n=t==null?void 0:t.z_index)!=null?n:0,this.alpha=(a=t==null?void 0:t.alpha)!=null?a:1,this.visible=(i=t==null?void 0:t.visible)!=null?i:!0,this.tint=(s=t==null?void 0:t.tint)!=null?s:null}update(t){t.z_index!==void 0&&(this.z_index=t.z_index),t.alpha!==void 0&&(this.alpha=t.alpha),t.visible!==void 0&&(this.visible=t.visible),t.tint!==void 0&&(this.tint=t.tint)}syncToThree(t){if(t.renderOrder=this.z_index,t.visible=this.visible,t instanceof R.Mesh&&t.material&&(Array.isArray(t.material)?t.material.forEach(n=>{n instanceof R.Material&&(n.opacity=this.alpha,n.transparent=this.alpha<1)}):t.material instanceof R.Material&&(t.material.opacity=this.alpha,t.material.transparent=this.alpha<1)),this.tint!==null&&t instanceof R.Mesh&&t.material){let n=typeof this.tint=="string"?new R.Color(this.tint):new R.Color(this.tint);Array.isArray(t.material)?t.material.forEach(a=>{(a instanceof R.MeshBasicMaterial||a instanceof R.MeshStandardMaterial)&&a.color.copy(n)}):(t.material instanceof R.MeshBasicMaterial||t.material instanceof R.MeshStandardMaterial)&&t.material.color.copy(n)}}},Ce=class{constructor(t,n,a,i){this.instanceId=t,this.objectConfig=n,this.threeObject=a,this._config=i,this.transform=new Se(i.transform),this.renderer=new Ae(i.render),this.sync()}sync(){this.transform.syncToThree(this.threeObject),this.renderer.syncToThree(this.threeObject)}updateConfig(t){this._config=t,t.transform&&this.transform.update(t.transform),t.render&&this.renderer.update(t.render),this.sync()}getComponent(t){return this._config[t]}getPosition(){return{...this.transform.position}}setPosition(t,n){this.transform.position={x:t,y:n},this.transform.syncToThree(this.threeObject)}getAlpha(){return this.renderer.alpha}setAlpha(t){this.renderer.alpha=t,this.renderer.syncToThree(this.threeObject)}getVisible(){return this.renderer.visible}setVisible(t){this.renderer.visible=t,this.renderer.syncToThree(this.threeObject)}},Ne=class{constructor(t){this.objects=new Map;this.config=t}create(t,n){let a=this.config.objects.get(t);if(!a)throw new Error(`Object config not found: ${t}`);let i=new Ce(t,a.object_config||t,n,a);return this.objects.set(t,i),i}get(t){return this.objects.get(t)}updateConfig(t){this.config=t;for(let[n,a]of this.objects.entries()){let i=t.objects.get(n);i&&a.updateConfig(i)}}getAll(){return Array.from(this.objects.values())}remove(t){this.objects.delete(t)}clear(){this.objects.clear()}};var Ye={"brand.primary":{family:"Arial, sans-serif",weight:"400"},"brand.warning":{family:"Arial Black, Arial, sans-serif",weight:"900"},"brand.heading":{family:"Arial Black, Arial, sans-serif",weight:"800"},"brand.body":{family:"Arial, sans-serif",weight:"400"}};function B(e){let t=Ye[e];return t?t.family:(console.warn(`Font ID "${e}" not found in registry, using fallback`),"Arial, sans-serif")}function O(e){var n;let t=Ye[e];return t&&(n=t.weight)!=null?n:"400"}function ia(e,t){Ye[e]=t}function sa(){return Object.keys(Ye)}var ye=be(require("three"));function ie(e){return{element:e,get alpha(){return parseFloat(e.style.opacity||"1")},set alpha(t){e.style.opacity=t.toString()},get visible(){return e.style.display!=="none"},set visible(t){e.style.display=t?"":"none"},position:{set(t,n){e.style.left=`${t}px`,e.style.top=`${n}px`},get x(){return parseFloat(e.style.left||"0")},get y(){return parseFloat(e.style.top||"0")}},scale:{set(t,n){e.style.transform=`scale(${t})`},get x(){let t=e.style.transform.match(/scale\(([^)]+)\)/);return t?parseFloat(t[1]):1}}}}function oa(e,t,n){var xt,_t,wt,Et,Tt,vt,St,At,Ct,Rt,Ht,Mt,kt,Lt,Ft,Dt,$t,Pt,zt,Wt,Bt,Ot,Nt,Yt,It,Gt,jt,Vt,qt,Xt,Kt,Jt,Zt,Qt,Ut,en,tn,nn,an,sn,on,rn,ln,cn,dn,pn,un,mn,fn,yn,hn,gn,bn,xn,_n,wn,En,Tn,vn,Sn,An,Cn;let a=e.objects.get("ui_endgame_1"),i=e.objects.get("ui_endgame_logo_1"),s=e.objects.get("ui_endgame_title_1"),o=e.objects.get("ui_endgame_subtitle_1"),l=e.objects.get("ui_endgame_footer_1"),c=e.objects.get("ui_endgame_cta_1"),m=e.objects.get("ui_endgame_cta_hint_1"),r=e.objects.get("ui_endgame_hand_1"),d=e.engine.runtime||{},u=((xt=a==null?void 0:a.gameplay)==null?void 0:xt.tuning)||{},h=(a==null?void 0:a.render)||{},b=(_t=u.panel_width)!=null?_t:320,p=(wt=u.panel_height)!=null?wt:400,f=(Et=u.panel_padding)!=null?Et:32,y=(Tt=u.panel_radius)!=null?Tt:24,g=h.background_color||u.panel_bg_color||"#1a0a0a",E=h.background_alpha!==void 0&&h.background_alpha!==null?h.background_alpha:(vt=u.panel_bg_alpha)!=null?vt:.98,w=h.border_color||u.panel_border_color||"#ffffff",T=(St=u.panel_border_width)!=null?St:2,A=(At=u.panel_border_alpha)!=null?At:.3,v=document.createElement("div");v.style.cssText=`
17
+ `,e.appendChild(t)}var lt=(i=>(i[i.PHONE_TALL=0]="PHONE_TALL",i[i.TABLET=1]="TABLET",i[i.LANDSCAPE=2]="LANDSCAPE",i))(lt||{});function Ie(e,t){let n=e/t;return n<=.62?0:n<=.85?1:2}var fe=class{constructor(t,n){this.root=t,this.stage=n,this.uiFrame=document.createElement("div"),this.uiFrame.style.position="absolute",this.uiFrame.style.top="0",this.uiFrame.style.bottom="0",this.uiFrame.style.left="50%",this.uiFrame.style.transform="translateX(-50%)",this.uiFrame.style.width="100%",this.uiFrame.style.maxWidth="420px",this.uiFrame.style.pointerEvents="none",this.stage.appendChild(this.uiFrame),this.uiContainer=document.createElement("div"),this.uiContainer.setAttribute("style",["position:absolute","inset:0","display:flex","flex-direction:column","justify-content:flex-start","gap:12px","pointer-events:none","padding:20px 16px","padding-bottom:clamp(24px, 6vh, 96px)","box-sizing:border-box","z-index:2"].join(";")),this.uiFrame.appendChild(this.uiContainer),this.updateLayout()}getUIFrame(){return this.uiFrame}getUIContainer(){return this.uiContainer}updateLayout(){let t=this.stage.getBoundingClientRect(),n=Ie(t.width,t.height);n===0?this.uiFrame.style.maxWidth="420px":n===1?this.uiFrame.style.maxWidth="520px":this.uiFrame.style.maxWidth="640px"}getAspectClass(){let t=this.stage.getBoundingClientRect();return Ie(t.width,t.height)}};async function ri(e,t={}){let n=()=>{let d=e.style.width||"",y=e.style.height||"",h=320,g=480,w=window.getComputedStyle(e),E=d||w.width,T=y||w.height;if(E&&E!=="auto"&&!E.includes("%")){let x=parseFloat(E);!isNaN(x)&&x>0&&isFinite(x)&&(h=x)}if(T&&T!=="auto"&&!T.includes("%")){let x=parseFloat(T);!isNaN(x)&&x>0&&isFinite(x)&&(g=x)}let S=e.clientWidth,C=e.clientHeight;if((h===320||h<=0||!isFinite(h))&&S&&S>0&&(h=S),(g===480||g<=0||!isFinite(g))&&C&&C>0&&(g=C),h<=0||g<=0||!isFinite(h)||!isFinite(g)){let x=e.getBoundingClientRect();x.width>0&&isFinite(x.width)&&(h=x.width),x.height>0&&isFinite(x.height)&&(g=x.height)}return(h<=0||!isFinite(h))&&(h=e.clientWidth||window.innerWidth||320),(g<=0||!isFinite(g))&&(g=e.clientHeight||window.innerHeight||480),console.log("[THREE-BASE] getSize result:",{width:h,height:g,styleWidth:d,styleHeight:y,effectiveWidth:E,effectiveHeight:T,computedWidth:w.width,computedHeight:w.height,clientWidth:S,clientHeight:C,boundingRect:e.getBoundingClientRect()}),{width:h,height:g}},i=e.style.width&&!e.style.width.includes("%"),a=e.style.height&&!e.style.height.includes("%");e.style.position=e.style.position||"relative",e.style.display=e.style.display||"flex",e.style.flexDirection=e.style.flexDirection||"column",e.style.alignItems=e.style.alignItems||"stretch",e.style.width=e.style.width||"100%",e.style.height=e.style.height||"100dvh",e.style.minHeight=e.style.minHeight||"100vh",e.style.maxWidth=e.style.maxWidth||"100%",e.style.maxHeight=e.style.maxHeight||"100%",e.style.boxSizing=e.style.boxSizing||"border-box",e.style.overflow=e.style.overflow||"hidden",t.background&&(e.style.background=t.background);let s=document.createElement("div");s.setAttribute("style",["position:relative","width:100%","height:100%","display:flex","align-items:center","justify-content:center",`background:${t.background||"transparent"}`,"color:var(--h-text, #f4f6ff)",'font-family:var(--h-font-main, "Inter", "Helvetica Neue", Arial, sans-serif)',"box-sizing:border-box"].join(";")),e.appendChild(s);let o=document.createElement("div");o.setAttribute("style",["position:absolute","inset:0","width:100%","height:100%","pointer-events:auto"].join(";")),s.appendChild(o);let p=new he.Scene,{width:r,height:m}=n(),l=new he.PerspectiveCamera(55,r/m,.1,100);l.position.set(0,0,3.2),l.lookAt(0,0,0),l.updateMatrixWorld();let c=new he.WebGLRenderer({antialias:!0,alpha:!0,preserveDrawingBuffer:!0});c.setPixelRatio(window.devicePixelRatio||1),c.setSize(r,m),c.setClearColor(0,0),c.domElement.style.position="absolute",c.domElement.style.top="0",c.domElement.style.left="0",c.domElement.style.width="100%",c.domElement.style.height="100%",c.domElement.style.display="block",c.domElement.style.pointerEvents="auto",o.appendChild(c.domElement);let f=d=>{let y,h;if(typeof(d==null?void 0:d.width)=="number"&&d.width>0?y=d.width:y=n().width,typeof(d==null?void 0:d.height)=="number"&&d.height>0?h=d.height:h=n().height,y<=0||h<=0||!isFinite(y)||!isFinite(h)){console.warn("[THREE-BASE] Invalid size in applySize, using getSize fallback",{newWidth:y,newHeight:h,size:d});let g=n();y=g.width,h=g.height}console.log("[THREE-BASE] applySize:",{newWidth:y,newHeight:h,providedSize:d,containerSize:n()}),c.setSize(y,h),c.setPixelRatio(window.devicePixelRatio||1),l.aspect=y/h,l.updateProjectionMatrix()};requestAnimationFrame(()=>f());let u=!1;Ye.on("pause",()=>{u=!0,document.querySelectorAll("audio").forEach(y=>y.pause())}),Ye.on("resume",()=>{u=!1,document.querySelectorAll("audio").forEach(y=>{y.currentTime>0&&!y.ended&&y.play().catch(()=>{})})});let b=new fe(e,s);return Ye.on("resize",({payload:d})=>{f({width:d==null?void 0:d.width,height:d==null?void 0:d.height}),b.updateLayout()}),window.addEventListener("resize",()=>{f(),b.updateLayout()}),{scene:p,camera:l,renderer:c,uiSystem:b,applySize:f}}var R=xe(require("three")),Ce=class{constructor(t){var n,i;this.position=(t==null?void 0:t.position)||{x:0,y:0},this.scale=(n=t==null?void 0:t.scale)!=null?n:1,this.rotation=(i=t==null?void 0:t.rotation)!=null?i:0}update(t){t.position!==void 0&&(this.position={...t.position}),t.scale!==void 0&&(this.scale=t.scale),t.rotation!==void 0&&(this.rotation=t.rotation)}syncToThree(t){let n=t.position.z,i=n===0||!isFinite(n)?.5:n;t.position.set(this.position.x,this.position.y,i),t.scale.set(this.scale,this.scale,this.scale),t.rotation.z=this.rotation}},Ae=class{constructor(t){var n,i,a,s;this.z_index=(n=t==null?void 0:t.z_index)!=null?n:0,this.alpha=(i=t==null?void 0:t.alpha)!=null?i:1,this.visible=(a=t==null?void 0:t.visible)!=null?a:!0,this.tint=(s=t==null?void 0:t.tint)!=null?s:null}update(t){t.z_index!==void 0&&(this.z_index=t.z_index),t.alpha!==void 0&&(this.alpha=t.alpha),t.visible!==void 0&&(this.visible=t.visible),t.tint!==void 0&&(this.tint=t.tint)}syncToThree(t){if(t.renderOrder=this.z_index,t.visible=this.visible,t instanceof R.Mesh&&t.material&&(Array.isArray(t.material)?t.material.forEach(n=>{n instanceof R.Material&&(n.opacity=this.alpha,n.transparent=this.alpha<1)}):t.material instanceof R.Material&&(t.material.opacity=this.alpha,t.material.transparent=this.alpha<1)),this.tint!==null&&t instanceof R.Mesh&&t.material){let n=typeof this.tint=="string"?new R.Color(this.tint):new R.Color(this.tint);Array.isArray(t.material)?t.material.forEach(i=>{(i instanceof R.MeshBasicMaterial||i instanceof R.MeshStandardMaterial)&&i.color.copy(n)}):(t.material instanceof R.MeshBasicMaterial||t.material instanceof R.MeshStandardMaterial)&&t.material.color.copy(n)}}},Re=class{constructor(t,n,i,a){this.instanceId=t,this.objectConfig=n,this.threeObject=i,this._config=a,this.transform=new Ce(a.transform),this.renderer=new Ae(a.render),this.sync()}sync(){this.transform.syncToThree(this.threeObject),this.renderer.syncToThree(this.threeObject)}updateConfig(t){this._config=t,t.transform&&this.transform.update(t.transform),t.render&&this.renderer.update(t.render),this.sync()}getComponent(t){return this._config[t]}getPosition(){return{...this.transform.position}}setPosition(t,n){this.transform.position={x:t,y:n},this.transform.syncToThree(this.threeObject)}getAlpha(){return this.renderer.alpha}setAlpha(t){this.renderer.alpha=t,this.renderer.syncToThree(this.threeObject)}getVisible(){return this.renderer.visible}setVisible(t){this.renderer.visible=t,this.renderer.syncToThree(this.threeObject)}},Ge=class{constructor(t){this.objects=new Map;this.config=t}create(t,n){let i=this.config.objects.get(t);if(!i)throw new Error(`Object config not found: ${t}`);let a=new Re(t,i.object_config||t,n,i);return this.objects.set(t,a),a}get(t){return this.objects.get(t)}updateConfig(t){this.config=t;for(let[n,i]of this.objects.entries()){let a=t.objects.get(n);a&&i.updateConfig(a)}}getAll(){return Array.from(this.objects.values())}remove(t){this.objects.delete(t)}clear(){this.objects.clear()}};var je={"brand.primary":{family:"Arial, sans-serif",weight:"400"},"brand.warning":{family:"Arial Black, Arial, sans-serif",weight:"900"},"brand.heading":{family:"Arial Black, Arial, sans-serif",weight:"800"},"brand.body":{family:"Arial, sans-serif",weight:"400"}};function N(e){let t=je[e];return t?t.family:(console.warn(`Font ID "${e}" not found in registry, using fallback`),"Arial, sans-serif")}function O(e){var n;let t=je[e];return t&&(n=t.weight)!=null?n:"400"}function li(e,t){je[e]=t}function ci(){return Object.keys(je)}var ye=xe(require("three"));function ae(e){return{element:e,get alpha(){return parseFloat(e.style.opacity||"1")},set alpha(t){e.style.opacity=t.toString()},get visible(){return e.style.display!=="none"},set visible(t){e.style.display=t?"":"none"},position:{set(t,n){e.style.left=`${t}px`,e.style.top=`${n}px`},get x(){return parseFloat(e.style.left||"0")},get y(){return parseFloat(e.style.top||"0")}},scale:{set(t,n){e.style.transform=`scale(${t})`},get x(){let t=e.style.transform.match(/scale\(([^)]+)\)/);return t?parseFloat(t[1]):1}}}}function di(e,t,n,i){var Tt,vt,St,Ct,At,Rt,Ht,Mt,Lt,Ft,kt,Dt,$t,Pt,Wt,zt,Bt,Nt,Ot,Yt,It,Gt,jt,Vt,qt,Xt,Kt,Jt,Zt,Qt,Ut,en,tn,nn,an,sn,on,rn,ln,cn,dn,pn,un,mn,fn,hn,yn,gn,bn,xn,_n,En,wn,Tn,vn,Sn,Cn,An,Rn,Hn,Mn,Ln;let a=e.objects.get("ui_endgame_1"),s=e.objects.get("ui_endgame_logo_1"),o=e.objects.get("ui_endgame_title_1"),p=e.objects.get("ui_endgame_subtitle_1"),r=e.objects.get("ui_endgame_footer_1"),m=e.objects.get("ui_endgame_cta_1"),l=e.objects.get("ui_endgame_cta_hint_1"),c=e.objects.get("ui_endgame_hand_1"),f=e.engine.runtime||{},u=((Tt=a==null?void 0:a.gameplay)==null?void 0:Tt.tuning)||{},b=(a==null?void 0:a.render)||{},d=(vt=u.panel_width)!=null?vt:320,y=(St=u.panel_height)!=null?St:400,h=(Ct=u.panel_padding)!=null?Ct:32,g=(At=u.panel_radius)!=null?At:24,w=b.background_color||u.panel_bg_color||"#1a0a0a",E=b.background_alpha!==void 0&&b.background_alpha!==null?b.background_alpha:(Rt=u.panel_bg_alpha)!=null?Rt:.98,T=b.border_color||u.panel_border_color||"#ffffff",S=(Ht=u.panel_border_width)!=null?Ht:2,C=(Mt=u.panel_border_alpha)!=null?Mt:.3,x=document.createElement("div");x.style.cssText=`
18
18
  position: absolute;
19
- width: ${b}px;
20
- height: ${p}px;
21
- background: ${g};
19
+ width: ${d}px;
20
+ height: ${y}px;
21
+ background: ${w};
22
22
  opacity: ${E};
23
- border: ${T}px solid ${w};
24
- border-opacity: ${A};
25
- border-radius: ${y}px;
23
+ border: ${S}px solid ${T};
24
+ border-opacity: ${C};
25
+ border-radius: ${g}px;
26
26
  display: flex;
27
27
  flex-direction: column;
28
28
  align-items: center;
@@ -31,79 +31,82 @@
31
31
  opacity: 0;
32
32
  visibility: hidden;
33
33
  pointer-events: auto;
34
- `;let _=ie(v);_.element=v;let N=((Ct=i==null?void 0:i.gameplay)==null?void 0:Ct.tuning)||{},H=(i==null?void 0:i.transform)||{},k=(Rt=N.logo_size)!=null?Rt:56,W=(Ht=H.scale)!=null?Ht:1,Y=(kt=(Mt=H.offset)==null?void 0:Mt.y)!=null?kt:-130,se=(Lt=N.logo_alpha)!=null?Lt:1,Q=new ye.SpriteMaterial({map:n||void 0,transparent:!0,alphaTest:.1}),C=new ye.Sprite(Q);C.position.set(0,Y,0),C.material.opacity=0;let I=0,U=0;if(n&&(I=((Ft=n.image)==null?void 0:Ft.width)||100,U=((Dt=n.image)==null?void 0:Dt.height)||100),I>0&&U>0){let oe=I/U,Ke,Je;oe>1?(Ke=k,Je=k/oe):(Je=k,Ke=k*oe);let ei=Ke/I*W,ti=Je/U*W;C.scale.set(ei,ti,1)}else{let oe=k/100*W;C.scale.set(oe,oe,1)}C.targetAlpha=se,C.baseScaleX=C.scale.x,C.baseScaleY=C.scale.y;let L=s==null?void 0:s.ui,G=(($t=s==null?void 0:s.gameplay)==null?void 0:$t.tuning)||{},ya=(L==null?void 0:L.text)||"MISSION ACCOMPLISHED",ot=(L==null?void 0:L.font)||"brand.heading",ha=(L==null?void 0:L.fontSize)||24,ga=(Pt=L==null?void 0:L.letterSpacing)!=null?Pt:1,Re=(zt=s==null?void 0:s.render)==null?void 0:zt.tint,ba=typeof Re=="string"?Re:Re?`#${Re.toString(16).padStart(6,"0")}`:"#00FF88",xa=b-f*2-30,_a=G.font_weight_override?G.font_weight_override:O(ot),ee=document.createElement("div");ee.textContent=ya,ee.style.cssText=`
35
- font-family: ${B(ot)};
36
- font-size: ${ha}px;
37
- font-weight: ${_a};
38
- color: ${ba};
34
+ left: 50%;
35
+ top: 50%;
36
+ z-index: 1000;
37
+ `,i.appendChild(x);let Y=ae(x);Y.element=x;let H=((Lt=s==null?void 0:s.gameplay)==null?void 0:Lt.tuning)||{},B=(s==null?void 0:s.transform)||{},L=(Ft=H.logo_size)!=null?Ft:56,z=(kt=B.scale)!=null?kt:1,se=($t=(Dt=B.offset)==null?void 0:Dt.y)!=null?$t:-130,Q=(Pt=H.logo_alpha)!=null?Pt:1,X=new ye.SpriteMaterial({map:n||void 0,transparent:!0,alphaTest:.1}),A=new ye.Sprite(X);A.position.set(0,se,0),A.material.opacity=0;let U=0,He=0;if(n&&(U=((Wt=n.image)==null?void 0:Wt.width)||100,He=((zt=n.image)==null?void 0:zt.height)||100),U>0&&He>0){let oe=U/He,Qe,Ue;oe>1?(Qe=L,Ue=L/oe):(Ue=L,Qe=L*oe);let aa=Qe/U*z,sa=Ue/He*z;A.scale.set(aa,sa,1)}else{let oe=L/100*z;A.scale.set(oe,oe,1)}A.targetAlpha=Q,A.baseScaleX=A.scale.x,A.baseScaleY=A.scale.y;let F=o==null?void 0:o.ui,I=((Bt=o==null?void 0:o.gameplay)==null?void 0:Bt.tuning)||{},xi=(F==null?void 0:F.text)||"MISSION ACCOMPLISHED",dt=(F==null?void 0:F.font)||"brand.heading",_i=(F==null?void 0:F.fontSize)||24,Ei=(Nt=F==null?void 0:F.letterSpacing)!=null?Nt:1,Me=(Ot=o==null?void 0:o.render)==null?void 0:Ot.tint,wi=typeof Me=="string"?Me:Me?`#${Me.toString(16).padStart(6,"0")}`:"#00FF88",Ti=d-h*2-30,vi=I.font_weight_override?I.font_weight_override:O(dt),ee=document.createElement("div");ee.textContent=xi,ee.style.cssText=`
38
+ font-family: ${N(dt)};
39
+ font-size: ${_i}px;
40
+ font-weight: ${vi};
41
+ color: ${wi};
39
42
  text-align: center;
40
- letter-spacing: ${ga}px;
41
- -webkit-text-stroke: ${(Wt=G.stroke_width)!=null?Wt:2}px ${G.stroke_color||"#000000"};
42
- text-shadow: ${(Bt=G.shadow_distance)!=null?Bt:4}px ${(Ot=G.shadow_distance)!=null?Ot:4}px ${(Nt=G.shadow_blur)!=null?Nt:8}px rgba(0,0,0,${(Yt=G.shadow_alpha)!=null?Yt:.9});
43
+ letter-spacing: ${Ei}px;
44
+ -webkit-text-stroke: ${(Yt=I.stroke_width)!=null?Yt:2}px ${I.stroke_color||"#000000"};
45
+ text-shadow: ${(It=I.shadow_distance)!=null?It:4}px ${(Gt=I.shadow_distance)!=null?Gt:4}px ${(jt=I.shadow_blur)!=null?jt:8}px rgba(0,0,0,${(Vt=I.shadow_alpha)!=null?Vt:.9});
43
46
  opacity: 0;
44
47
  position: absolute;
45
48
  transform: translate(-50%, -50%);
46
49
  white-space: nowrap;
47
- max-width: ${xa}px;
48
- `;let rt=(It=u.title_offset_y)!=null?It:30,wa=rt+((Gt=G.animation_start_y_offset)!=null?Gt:-20);ee.style.top=`${wa}px`,ee.style.left="50%";let lt=ie(ee);lt.element=ee,v.appendChild(ee);let F=o==null?void 0:o.ui,ct=((jt=o==null?void 0:o.gameplay)==null?void 0:jt.tuning)||{},Ea=(F==null?void 0:F.text)||"RESCUE COMPLETE",dt=(F==null?void 0:F.font)||"brand.body",Ta=(F==null?void 0:F.fontSize)||11,va=(Vt=F==null?void 0:F.letterSpacing)!=null?Vt:.5,He=(qt=o==null?void 0:o.render)==null?void 0:qt.tint,Sa=typeof He=="string"?He:He?`#${He.toString(16).padStart(6,"0")}`:"#B0B0B0",te=document.createElement("div");te.textContent=Ea,te.style.cssText=`
49
- font-family: ${B(dt)};
50
- font-size: ${Ta}px;
51
- font-weight: ${O(dt)};
52
- color: ${Sa};
50
+ max-width: ${Ti}px;
51
+ `;let pt=(qt=u.title_offset_y)!=null?qt:30,Si=pt+((Xt=I.animation_start_y_offset)!=null?Xt:-20);ee.style.top=`${Si}px`,ee.style.left="50%";let ut=ae(ee);ut.element=ee,x.appendChild(ee);let k=p==null?void 0:p.ui,mt=((Kt=p==null?void 0:p.gameplay)==null?void 0:Kt.tuning)||{},Ci=(k==null?void 0:k.text)||"RESCUE COMPLETE",ft=(k==null?void 0:k.font)||"brand.body",Ai=(k==null?void 0:k.fontSize)||11,Ri=(Jt=k==null?void 0:k.letterSpacing)!=null?Jt:.5,Le=(Zt=p==null?void 0:p.render)==null?void 0:Zt.tint,Hi=typeof Le=="string"?Le:Le?`#${Le.toString(16).padStart(6,"0")}`:"#B0B0B0",te=document.createElement("div");te.textContent=Ci,te.style.cssText=`
52
+ font-family: ${N(ft)};
53
+ font-size: ${Ai}px;
54
+ font-weight: ${O(ft)};
55
+ color: ${Hi};
53
56
  text-align: center;
54
- letter-spacing: ${va}px;
57
+ letter-spacing: ${Ri}px;
55
58
  opacity: 0;
56
59
  position: absolute;
57
60
  transform: translate(-50%, -50%);
58
61
  white-space: nowrap;
59
- `;let Aa=rt+20+((Xt=ct.animation_start_y_offset)!=null?Xt:-10);te.style.top=`${Aa}px`,te.style.left="50%";let Ge=ie(te);Ge.element=te,Ge.animationStartYOffset=(Kt=ct.animation_start_y_offset)!=null?Kt:-10,v.appendChild(te);let j=l==null?void 0:l.ui,pt=((Jt=l==null?void 0:l.gameplay)==null?void 0:Jt.tuning)||{},Ca=(j==null?void 0:j.text)||((Zt=d.ui)==null?void 0:Zt.cta_hint)||"Continue the adventure!",ut=(j==null?void 0:j.font)||"brand.body",Ra=(j==null?void 0:j.fontSize)||16,Me=(Qt=l==null?void 0:l.render)==null?void 0:Qt.tint,Ha=typeof Me=="string"?Me:Me?`#${Me.toString(16).padStart(6,"0")}`:"#FFFFFF",Ma=(Ut=pt.max_width)!=null?Ut:b-f*2,ka=(en=pt.line_height)!=null?en:1.4,ne=document.createElement("div");ne.textContent=Ca,ne.style.cssText=`
60
- font-family: ${B(ut)};
61
- font-size: ${Ra}px;
62
- font-weight: ${O(ut)};
63
- color: ${Ha};
62
+ `;let Mi=pt+20+((Qt=mt.animation_start_y_offset)!=null?Qt:-10);te.style.top=`${Mi}px`,te.style.left="50%";let qe=ae(te);qe.element=te,qe.animationStartYOffset=(Ut=mt.animation_start_y_offset)!=null?Ut:-10,x.appendChild(te);let G=r==null?void 0:r.ui,ht=((en=r==null?void 0:r.gameplay)==null?void 0:en.tuning)||{},Li=(G==null?void 0:G.text)||((tn=f.ui)==null?void 0:tn.cta_hint)||"Continue the adventure!",yt=(G==null?void 0:G.font)||"brand.body",Fi=(G==null?void 0:G.fontSize)||16,Fe=(nn=r==null?void 0:r.render)==null?void 0:nn.tint,ki=typeof Fe=="string"?Fe:Fe?`#${Fe.toString(16).padStart(6,"0")}`:"#FFFFFF",Di=(an=ht.max_width)!=null?an:d-h*2,$i=(sn=ht.line_height)!=null?sn:1.4,ne=document.createElement("div");ne.textContent=Li,ne.style.cssText=`
63
+ font-family: ${N(yt)};
64
+ font-size: ${Fi}px;
65
+ font-weight: ${O(yt)};
66
+ color: ${ki};
64
67
  text-align: center;
65
68
  opacity: 0;
66
69
  position: absolute;
67
70
  transform: translate(-50%, -50%);
68
- max-width: ${Ma}px;
69
- line-height: ${ka};
71
+ max-width: ${Di}px;
72
+ line-height: ${$i};
70
73
  word-wrap: break-word;
71
- `;let La=(tn=u.footer_offset_y)!=null?tn:120;ne.style.top=`${La}px`,ne.style.left="50%";let je=ie(ne);je.element=ne;let Fa=((nn=l==null?void 0:l.render)==null?void 0:nn.alpha)!==void 0&&((an=l==null?void 0:l.render)==null?void 0:an.alpha)!==null?l.render.alpha:1;je.targetAlpha=Fa,v.appendChild(ne);let V=((sn=c==null?void 0:c.gameplay)==null?void 0:sn.tuning)||{},D=c==null?void 0:c.ui,Da=(on=V.button_width)!=null?on:260,$a=(rn=V.button_height)!=null?rn:56,Pa=(ln=V.button_radius)!=null?ln:16,za=V.button_bg_color||((cn=d.theme)==null?void 0:cn.cta_background)||"#ffb43b",Wa=(dn=V.button_bg_alpha)!=null?dn:1,Ba=V.button_border_color||"#ffffff",Oa=(pn=V.button_border_width)!=null?pn:2,Mi=(un=V.button_border_alpha)!=null?un:.2,Ve=(mn=u.cta_offset_y)!=null?mn:160,M=document.createElement("button");M.style.cssText=`
72
- width: ${Da}px;
73
- height: ${$a}px;
74
- background: ${za};
75
- opacity: ${Wa};
76
- border: ${Oa}px solid ${Ba};
77
- border-radius: ${Pa}px;
74
+ `;let Pi=(on=u.footer_offset_y)!=null?on:120;ne.style.top=`${Pi}px`,ne.style.left="50%";let Xe=ae(ne);Xe.element=ne;let Wi=((rn=r==null?void 0:r.render)==null?void 0:rn.alpha)!==void 0&&((ln=r==null?void 0:r.render)==null?void 0:ln.alpha)!==null?r.render.alpha:1;Xe.targetAlpha=Wi,x.appendChild(ne);let j=((cn=m==null?void 0:m.gameplay)==null?void 0:cn.tuning)||{},D=m==null?void 0:m.ui,zi=(dn=j.button_width)!=null?dn:260,Bi=(pn=j.button_height)!=null?pn:56,Ni=(un=j.button_radius)!=null?un:16,Oi=j.button_bg_color||((mn=f.theme)==null?void 0:mn.cta_background)||"#ffb43b",Yi=(fn=j.button_bg_alpha)!=null?fn:1,Ii=j.button_border_color||"#ffffff",Gi=(hn=j.button_border_width)!=null?hn:2,Da=(yn=j.button_border_alpha)!=null?yn:.2,Ke=(gn=u.cta_offset_y)!=null?gn:160,M=document.createElement("button");M.style.cssText=`
75
+ width: ${zi}px;
76
+ height: ${Bi}px;
77
+ background: ${Oi};
78
+ opacity: ${Yi};
79
+ border: ${Gi}px solid ${Ii};
80
+ border-radius: ${Ni}px;
78
81
  cursor: pointer;
79
82
  opacity: 0;
80
83
  position: absolute;
81
84
  transform: translate(-50%, -50%);
82
85
  box-shadow: inset 0 0 1px rgba(0,0,0,0.15);
83
- `,M.style.top=`${Ve}px`,M.style.left="50%";let mt=ie(M);mt.element=M,v.appendChild(M);let Na=(D==null?void 0:D.text)||((fn=d.ui)==null?void 0:fn.cta_label_end)||"DOWNLOAD",ft=(D==null?void 0:D.font)||"brand.heading",Ya=(D==null?void 0:D.fontSize)||20,Ia=V.button_text_color||((yn=d.theme)==null?void 0:yn.cta_text)||"#1a0a0a";M.textContent=Na,M.style.fontFamily=B(ft),M.style.fontSize=`${Ya}px`,M.style.fontWeight=String(O(ft)),M.style.color=Ia,M.style.letterSpacing=`${(hn=D==null?void 0:D.letterSpacing)!=null?hn:1}px`;let yt=ie(M);yt.element=M;let $=m==null?void 0:m.ui,ht=((gn=m==null?void 0:m.gameplay)==null?void 0:gn.tuning)||{},Ga=($==null?void 0:$.text)||"Play the full game",gt=($==null?void 0:$.font)||"brand.body",ja=($==null?void 0:$.fontSize)||11,Va=(bn=$==null?void 0:$.letterSpacing)!=null?bn:0,ke=(xn=m==null?void 0:m.render)==null?void 0:xn.tint,qa=typeof ke=="string"?ke:ke?`#${ke.toString(16).padStart(6,"0")}`:"#CCCCCC",ae=document.createElement("div");ae.textContent=Ga,ae.style.cssText=`
84
- font-family: ${B(gt)};
85
- font-size: ${ja}px;
86
- font-weight: ${O(gt)};
87
- color: ${qa};
86
+ `,M.style.top=`${Ke}px`,M.style.left="50%";let gt=ae(M);gt.element=M,x.appendChild(M);let ji=(D==null?void 0:D.text)||((bn=f.ui)==null?void 0:bn.cta_label_end)||"DOWNLOAD",bt=(D==null?void 0:D.font)||"brand.heading",Vi=(D==null?void 0:D.fontSize)||20,qi=j.button_text_color||((xn=f.theme)==null?void 0:xn.cta_text)||"#1a0a0a";M.textContent=ji,M.style.fontFamily=N(bt),M.style.fontSize=`${Vi}px`,M.style.fontWeight=String(O(bt)),M.style.color=qi,M.style.letterSpacing=`${(_n=D==null?void 0:D.letterSpacing)!=null?_n:1}px`;let xt=ae(M);xt.element=M;let $=l==null?void 0:l.ui,_t=((En=l==null?void 0:l.gameplay)==null?void 0:En.tuning)||{},Xi=($==null?void 0:$.text)||"Play the full game",Et=($==null?void 0:$.font)||"brand.body",Ki=($==null?void 0:$.fontSize)||11,Ji=(wn=$==null?void 0:$.letterSpacing)!=null?wn:0,ke=(Tn=l==null?void 0:l.render)==null?void 0:Tn.tint,Zi=typeof ke=="string"?ke:ke?`#${ke.toString(16).padStart(6,"0")}`:"#CCCCCC",ie=document.createElement("div");ie.textContent=Xi,ie.style.cssText=`
87
+ font-family: ${N(Et)};
88
+ font-size: ${Ki}px;
89
+ font-weight: ${O(Et)};
90
+ color: ${Zi};
88
91
  text-align: center;
89
- letter-spacing: ${Va}px;
92
+ letter-spacing: ${Ji}px;
90
93
  opacity: 0;
91
94
  position: absolute;
92
95
  transform: translate(-50%, -50%);
93
96
  white-space: nowrap;
94
- `;let Xa=Ve+35+((_n=ht.animation_start_y_offset)!=null?_n:5);ae.style.top=`${Xa}px`,ae.style.left="50%";let qe=ie(ae);qe.element=ae,qe.animationStartYOffset=(wn=ht.animation_start_y_offset)!=null?wn:5,v.appendChild(ae);let Xe=((En=r==null?void 0:r.gameplay)==null?void 0:En.tuning)||{},Ka=(Tn=Xe.hand_offset_x)!=null?Tn:50,Ja=(vn=Xe.hand_offset_y)!=null?vn:50,Za=(An=(Sn=r==null?void 0:r.transform)==null?void 0:Sn.scale)!=null?An:.1875,Qa=(Cn=Xe.hand_scale_multiplier)!=null?Cn:2.5,Ua=new ye.SpriteMaterial({map:t||void 0,transparent:!0,alphaTest:.1}),ge=new ye.Sprite(Ua),bt=Za*Qa*100;return ge.scale.set(bt,bt,1),ge.position.set(Ka,Ve+Ja,0),ge.material.opacity=0,ge.visible=!1,{panel:_,logo:C,title:lt,subtitle:Ge,footer:je,ctaButton:mt,ctaText:yt,ctaHint:qe,hand:ge}}function ra(e,t,n){var A,v,_,N,H,k,W,Y;let a=t.objects.get("ui_endgame_1"),i=((A=a==null?void 0:a.gameplay)==null?void 0:A.tuning)||{},s=(v=i.animation_duration_ms)!=null?v:800,o=(_=i.fade_in_duration_ms)!=null?_:600,l=(N=i.scale_animation_intensity)!=null?N:.1,c=(H=i.logo_animation_delay_ms)!=null?H:100,m=(k=i.title_animation_delay_ms)!=null?k:200,r=(W=i.footer_animation_delay_ms)!=null?W:300,d=(Y=i.cta_animation_delay_ms)!=null?Y:400,{panel:u,logo:h,title:b,subtitle:p,footer:f,ctaButton:y,ctaText:g,ctaHint:E}=e;u.visible=!0,u.element.style.visibility="visible";let w=Date.now(),T=()=>{let se=Date.now()-w,Q=Math.min(se/o,1),C=1-Math.pow(1-Q,3);u.alpha=C,u.element.style.opacity=C.toString();let I=1+l*(1-C);u.element.style.transform=`translate(-50%, -50%) scale(${I})`,Q<1?requestAnimationFrame(T):(setTimeout(()=>Ei(h,s,t),c),setTimeout(()=>{Ti(b,s),setTimeout(()=>vi(p,s),50)},m),setTimeout(()=>Si(f,s),r),setTimeout(()=>{Ai(y,g,s),setTimeout(()=>Ci(E,s),50),n&&n()},d))};T()}function Ei(e,t,n){var u,h,b,p,f;let a=n==null?void 0:n.objects.get("ui_endgame_logo_1"),s=(h=(((u=a==null?void 0:a.gameplay)==null?void 0:u.tuning)||{}).animation_start_scale)!=null?h:1.2,o=Date.now(),l=e.material.opacity,c=(b=e.targetAlpha)!=null?b:1,m=(p=e.baseScaleX)!=null?p:e.scale.x,r=(f=e.baseScaleY)!=null?f:e.scale.y,d=()=>{let y=Date.now()-o,g=Math.min(y/t,1),E=1-Math.pow(1-g,2);e.material.opacity=l+(c-l)*E;let w=s+(1-s)*E;e.scale.set(m*w,r*w,1),g<1&&requestAnimationFrame(d)};d()}function Ti(e,t){let n=Date.now(),a=parseFloat(e.element.style.opacity||"0"),i=parseFloat(e.element.style.top||"0"),s=()=>{let o=Date.now()-n,l=Math.min(o/t,1),c=1-Math.pow(1-l,2);e.element.style.opacity=(a+(1-a)*c).toString(),e.element.style.top=`${i-20*(1-c)}px`,l<1&&requestAnimationFrame(s)};s()}function vi(e,t){var l;let n=Date.now(),a=parseFloat(e.element.style.opacity||"0"),i=parseFloat(e.element.style.top||"0"),s=i-((l=e.animationStartYOffset)!=null?l:-10),o=()=>{let c=Date.now()-n,m=Math.min(c/t,1),r=1-Math.pow(1-m,2);e.element.style.opacity=(a+(1-a)*r).toString(),e.element.style.top=`${i+(s-i)*r}px`,m<1&&requestAnimationFrame(o)};o()}function Si(e,t){var o;let n=Date.now(),a=parseFloat(e.element.style.opacity||"0"),i=(o=e.targetAlpha)!=null?o:1,s=()=>{let l=Date.now()-n,c=Math.min(l/t,1),m=1-Math.pow(1-c,2);e.element.style.opacity=(a+(i-a)*m).toString(),c<1&&requestAnimationFrame(s)};s()}function Ai(e,t,n){let a=Date.now(),i=parseFloat(e.element.style.opacity||"0"),s=()=>{let o=Date.now()-a,l=Math.min(o/n,1),c=1-Math.pow(1-l,2);e.element.style.opacity=(i+(1-i)*c).toString(),t.element.style.opacity=(i+(1-i)*c).toString(),e.element.style.transform=`translate(-50%, -50%) scale(${1+.1*(1-c)})`,l<1&&requestAnimationFrame(s)};s()}function Ci(e,t){var l;let n=Date.now(),a=parseFloat(e.element.style.opacity||"0"),i=parseFloat(e.element.style.top||"0"),s=i-((l=e.animationStartYOffset)!=null?l:5),o=()=>{let c=Date.now()-n,m=Math.min(c/t,1),r=1-Math.pow(1-m,2);e.element.style.opacity=(a+(1-a)*r).toString(),e.element.style.top=`${i+(s-i)*r}px`,m<1&&requestAnimationFrame(o)};o()}function la(e,t,n,a){var r,d,u,h;let i=n.objects.get("ui_endgame_hand_1"),s=((r=i==null?void 0:i.gameplay)==null?void 0:r.tuning)||{},o=(d=s.click_animation_duration_ms)!=null?d:600,l=(u=s.click_delay_ms)!=null?u:2e3,c=(h=s.click_repeat_delay_ms)!=null?h:3e3,m=()=>{var v,_;e.visible=!0,e.material.opacity=1;let b=e.position.x,p=e.position.y,f=(v=s.hand_offset_x)!=null?v:50,y=(_=s.hand_offset_y)!=null?_:50,g=t.element.getBoundingClientRect(),E=f,w=y,T=Date.now(),A=()=>{var C,I,U;let N=Date.now()-T,H=Math.min(N/o,1),k=H<.5?2*H*H:1-Math.pow(-2*H+2,2)/2;e.position.set(b+(E-b)*k,p+(w-p)*k,0);let W=(I=(C=i==null?void 0:i.transform)==null?void 0:C.scale)!=null?I:.1875,Y=(U=s.hand_scale_multiplier)!=null?U:2.5,se=W*Y*100,Q=se+se*.2*Math.sin(H*Math.PI);e.scale.set(Q,Q,1),H<1?requestAnimationFrame(A):(t.element.style.transform="translate(-50%, -50%) scale(0.95)",setTimeout(()=>{t.element.style.transform="translate(-50%, -50%) scale(1)",a()},100),setTimeout(()=>{e.material.opacity=0,setTimeout(()=>{e.position.set(b,p,0),m()},c)},500))};A()};setTimeout(m,l)}var Ie=be(require("three"));function ca(e,t,n){var d,u,h,b;let a=t.objects.get("hand_tutorial_1"),i=((d=a==null?void 0:a.gameplay)==null?void 0:d.tuning)||{},s=(a==null?void 0:a.render)||{},o=(a==null?void 0:a.transform)||{},l=new Ie.SpriteMaterial({map:e||void 0,transparent:!0,alphaTest:.1}),c=new Ie.Sprite(l);c.position.set(n.x,n.y,0),c.material.opacity=0;let m=(u=i.hand_scale_multiplier)!=null?u:2.5,r=(h=o.scale)!=null?h:.1875;return c.scale.set(r*m*100,r*m*100,1),c.renderOrder=(b=s.z_index)!=null?b:99999,c}function da(e){var b,p,f,y,g,E,w,T,A;let t=e.objects.get("ui_tutorial_1"),n=t==null?void 0:t.ui,a=(t==null?void 0:t.render)||{},i=((b=e.engine.runtime)==null?void 0:b.ui_styles)||{},s=((p=e.engine.runtime)==null?void 0:p.ui)||{},o=(n==null?void 0:n.text)||s.tutorial_label||s.label_text||"CLEAN!",l=(n==null?void 0:n.font)||"brand.warning",c=(n==null?void 0:n.fontSize)||i.label_font_size||52,m=(y=n==null?void 0:n.letterSpacing)!=null?y:(f=i.label_letter_spacing)!=null?f:-1,r=(n==null?void 0:n.align)||"center",d=a.tint,u=typeof d=="string"?d:d?`#${d.toString(16).padStart(6,"0")}`:i.label_fill||"#FFF1C1",h=document.createElement("div");return h.textContent=o,h.style.cssText=`
95
- font-family: ${B(l)};
96
- font-size: ${c}px;
97
- font-weight: ${O(l)};
98
- color: ${u};
99
- text-align: ${r};
97
+ `;let Qi=Ke+35+((vn=_t.animation_start_y_offset)!=null?vn:5);ie.style.top=`${Qi}px`,ie.style.left="50%";let Je=ae(ie);Je.element=ie,Je.animationStartYOffset=(Sn=_t.animation_start_y_offset)!=null?Sn:5,x.appendChild(ie);let Ze=((Cn=c==null?void 0:c.gameplay)==null?void 0:Cn.tuning)||{},Ui=(An=Ze.hand_offset_x)!=null?An:50,ea=(Rn=Ze.hand_offset_y)!=null?Rn:50,ta=(Mn=(Hn=c==null?void 0:c.transform)==null?void 0:Hn.scale)!=null?Mn:.1875,na=(Ln=Ze.hand_scale_multiplier)!=null?Ln:2.5,ia=new ye.SpriteMaterial({map:t||void 0,transparent:!0,alphaTest:.1}),be=new ye.Sprite(ia),wt=ta*na*100;return be.scale.set(wt,wt,1),be.position.set(Ui,Ke+ea,0),be.material.opacity=0,be.visible=!1,{panel:Y,logo:A,title:ut,subtitle:qe,footer:Xe,ctaButton:gt,ctaText:xt,ctaHint:Je,hand:be}}function pi(e,t,n){var S,C,x,Y,H,B,L,z;let i=t.objects.get("ui_endgame_1"),a=((S=i==null?void 0:i.gameplay)==null?void 0:S.tuning)||{},s=(C=a.animation_duration_ms)!=null?C:800,o=(x=a.fade_in_duration_ms)!=null?x:600,p=(Y=a.scale_animation_intensity)!=null?Y:.1,r=(H=a.logo_animation_delay_ms)!=null?H:100,m=(B=a.title_animation_delay_ms)!=null?B:200,l=(L=a.footer_animation_delay_ms)!=null?L:300,c=(z=a.cta_animation_delay_ms)!=null?z:400,{panel:f,logo:u,title:b,subtitle:d,footer:y,ctaButton:h,ctaText:g,ctaHint:w}=e;f.visible=!0,f.element.style.visibility="visible";let E=Date.now(),T=()=>{let se=Date.now()-E,Q=Math.min(se/o,1),X=1-Math.pow(1-Q,3);f.alpha=X,f.element.style.opacity=X.toString();let A=1+p*(1-X);f.element.style.transform=`translate(-50%, -50%) scale(${A})`,Q<1?requestAnimationFrame(T):(setTimeout(()=>Ca(u,s,t),r),setTimeout(()=>{Aa(b,s),setTimeout(()=>Ra(d,s),50)},m),setTimeout(()=>Ha(y,s),l),setTimeout(()=>{Ma(h,g,s),setTimeout(()=>La(w,s),50),n&&n()},c))};T()}function Ca(e,t,n){var f,u,b,d,y;let i=n==null?void 0:n.objects.get("ui_endgame_logo_1"),s=(u=(((f=i==null?void 0:i.gameplay)==null?void 0:f.tuning)||{}).animation_start_scale)!=null?u:1.2,o=Date.now(),p=e.material.opacity,r=(b=e.targetAlpha)!=null?b:1,m=(d=e.baseScaleX)!=null?d:e.scale.x,l=(y=e.baseScaleY)!=null?y:e.scale.y,c=()=>{let h=Date.now()-o,g=Math.min(h/t,1),w=1-Math.pow(1-g,2);e.material.opacity=p+(r-p)*w;let E=s+(1-s)*w;e.scale.set(m*E,l*E,1),g<1&&requestAnimationFrame(c)};c()}function Aa(e,t){let n=Date.now(),i=parseFloat(e.element.style.opacity||"0"),a=parseFloat(e.element.style.top||"0"),s=()=>{let o=Date.now()-n,p=Math.min(o/t,1),r=1-Math.pow(1-p,2);e.element.style.opacity=(i+(1-i)*r).toString(),e.element.style.top=`${a-20*(1-r)}px`,p<1&&requestAnimationFrame(s)};s()}function Ra(e,t){var p;let n=Date.now(),i=parseFloat(e.element.style.opacity||"0"),a=parseFloat(e.element.style.top||"0"),s=a-((p=e.animationStartYOffset)!=null?p:-10),o=()=>{let r=Date.now()-n,m=Math.min(r/t,1),l=1-Math.pow(1-m,2);e.element.style.opacity=(i+(1-i)*l).toString(),e.element.style.top=`${a+(s-a)*l}px`,m<1&&requestAnimationFrame(o)};o()}function Ha(e,t){var o;let n=Date.now(),i=parseFloat(e.element.style.opacity||"0"),a=(o=e.targetAlpha)!=null?o:1,s=()=>{let p=Date.now()-n,r=Math.min(p/t,1),m=1-Math.pow(1-r,2);e.element.style.opacity=(i+(a-i)*m).toString(),r<1&&requestAnimationFrame(s)};s()}function Ma(e,t,n){let i=Date.now(),a=parseFloat(e.element.style.opacity||"0"),s=()=>{let o=Date.now()-i,p=Math.min(o/n,1),r=1-Math.pow(1-p,2);e.element.style.opacity=(a+(1-a)*r).toString(),t.element.style.opacity=(a+(1-a)*r).toString(),e.element.style.transform=`translate(-50%, -50%) scale(${1+.1*(1-r)})`,p<1&&requestAnimationFrame(s)};s()}function La(e,t){var p;let n=Date.now(),i=parseFloat(e.element.style.opacity||"0"),a=parseFloat(e.element.style.top||"0"),s=a-((p=e.animationStartYOffset)!=null?p:5),o=()=>{let r=Date.now()-n,m=Math.min(r/t,1),l=1-Math.pow(1-m,2);e.element.style.opacity=(i+(1-i)*l).toString(),e.element.style.top=`${a+(s-a)*l}px`,m<1&&requestAnimationFrame(o)};o()}function ui(e,t,n,i){var l,c,f,u;let a=n.objects.get("ui_endgame_hand_1"),s=((l=a==null?void 0:a.gameplay)==null?void 0:l.tuning)||{},o=(c=s.click_animation_duration_ms)!=null?c:600,p=(f=s.click_delay_ms)!=null?f:2e3,r=(u=s.click_repeat_delay_ms)!=null?u:3e3,m=()=>{var C,x;e.visible=!0,e.material.opacity=1;let b=e.position.x,d=e.position.y,y=(C=s.hand_offset_x)!=null?C:50,h=(x=s.hand_offset_y)!=null?x:50,g=t.element.getBoundingClientRect(),w=y,E=h,T=Date.now(),S=()=>{var X,A,U;let Y=Date.now()-T,H=Math.min(Y/o,1),B=H<.5?2*H*H:1-Math.pow(-2*H+2,2)/2;e.position.set(b+(w-b)*B,d+(E-d)*B,0);let L=(A=(X=a==null?void 0:a.transform)==null?void 0:X.scale)!=null?A:.1875,z=(U=s.hand_scale_multiplier)!=null?U:2.5,se=L*z*100,Q=se+se*.2*Math.sin(H*Math.PI);e.scale.set(Q,Q,1),H<1?requestAnimationFrame(S):(t.element.style.transform="translate(-50%, -50%) scale(0.95)",setTimeout(()=>{t.element.style.transform="translate(-50%, -50%) scale(1)",i()},100),setTimeout(()=>{e.material.opacity=0,setTimeout(()=>{e.position.set(b,d,0),m()},r)},500))};S()};setTimeout(m,p)}var Ve=xe(require("three"));function mi(e,t,n){var c,f,u,b;let i=t.objects.get("hand_tutorial_1"),a=((c=i==null?void 0:i.gameplay)==null?void 0:c.tuning)||{},s=(i==null?void 0:i.render)||{},o=(i==null?void 0:i.transform)||{},p=new Ve.SpriteMaterial({map:e||void 0,transparent:!0,alphaTest:.1}),r=new Ve.Sprite(p);r.position.set(n.x,n.y,0),r.material.opacity=0;let m=(f=a.hand_scale_multiplier)!=null?f:2.5,l=(u=o.scale)!=null?u:.1875;return r.scale.set(l*m*100,l*m*100,1),r.renderOrder=(b=s.z_index)!=null?b:99999,r}function fi(e){var b,d,y,h,g,w,E,T,S;let t=e.objects.get("ui_tutorial_1"),n=t==null?void 0:t.ui,i=(t==null?void 0:t.render)||{},a=((b=e.engine.runtime)==null?void 0:b.ui_styles)||{},s=((d=e.engine.runtime)==null?void 0:d.ui)||{},o=(n==null?void 0:n.text)||s.tutorial_label||s.label_text||"CLEAN!",p=(n==null?void 0:n.font)||"brand.warning",r=(n==null?void 0:n.fontSize)||a.label_font_size||52,m=(h=n==null?void 0:n.letterSpacing)!=null?h:(y=a.label_letter_spacing)!=null?y:-1,l=(n==null?void 0:n.align)||"center",c=i.tint,f=typeof c=="string"?c:c?`#${c.toString(16).padStart(6,"0")}`:a.label_fill||"#FFF1C1",u=document.createElement("div");return u.textContent=o,u.style.cssText=`
98
+ font-family: ${N(p)};
99
+ font-size: ${r}px;
100
+ font-weight: ${O(p)};
101
+ color: ${f};
102
+ text-align: ${l};
100
103
  letter-spacing: ${m}px;
101
- text-shadow: ${(g=i.label_shadow_distance)!=null?g:2}px ${(E=i.label_shadow_distance)!=null?E:2}px ${(w=i.label_shadow_blur)!=null?w:4}px rgba(0,0,0,${(T=i.label_shadow_alpha)!=null?T:.8});
102
- -webkit-text-stroke: ${i.label_stroke||"#8B0000"} 2px;
103
- opacity: ${(A=a.alpha)!=null?A:0};
104
- visibility: ${a.visible!==!1?"visible":"hidden"};
104
+ text-shadow: ${(g=a.label_shadow_distance)!=null?g:2}px ${(w=a.label_shadow_distance)!=null?w:2}px ${(E=a.label_shadow_blur)!=null?E:4}px rgba(0,0,0,${(T=a.label_shadow_alpha)!=null?T:.8});
105
+ -webkit-text-stroke: ${a.label_stroke||"#8B0000"} 2px;
106
+ opacity: ${(S=i.alpha)!=null?S:0};
107
+ visibility: ${i.visible!==!1?"visible":"hidden"};
105
108
  pointer-events: none;
106
109
  position: absolute;
107
110
  transform: translate(-50%, -50%);
108
111
  white-space: nowrap;
109
- `,h}function pa(e,t,n,a,i){var c,m,r,d,u,h,b;let s=i.objects.get("hand_tutorial_1"),o=((c=s==null?void 0:s.gameplay)==null?void 0:c.tuning)||{},l=(s==null?void 0:s.transform)||{};if(!a){let p=(m=o.animation_duration)!=null?m:1.5,f=n%p/p,y=f<.5?2*f*f:-1+(4-2*f)*f,g=(r=o.x_offset)!=null?r:0,E=(d=o.y_offset)!=null?d:0,w=(u=o.animation_range)!=null?u:40,T=w*.7,A=w,v=t.x+g+T,_=t.y+E+A,N=v+T,H=_+A;e.position.set(v+(N-v)*y,_+(H-_)*y,0);let k=(h=l.scale)!=null?h:.1875,W=(b=o.hand_scale_multiplier)!=null?b:2.5,Y=k*W*100;e.scale.set(Y,Y,1)}}var he=be(require("three")),ua=new he.TextureLoader;async function st(e,t,n=16777215,a=!1){try{let s=(globalThis.INLINE_ASSETS||{})[e];return await ua.loadAsync(s||e)}catch{console.warn(`Asset missing: ${e}. Using placeholder.`);let s=document.createElement("canvas");s.width=64,s.height=64;let o=s.getContext("2d");return o&&(o.fillStyle=`#${n.toString(16).padStart(6,"0")}`,a?o.fillRect(0,0,30,60):(o.beginPath(),o.arc(32,32,30,0,Math.PI*2),o.fill(),o.fillRect(27,32,10,40))),new he.CanvasTexture(s)}}async function ma(e,t,n){var b,p,f,y;let i=(globalThis.INLINE_ASSETS||{})[e]||e,s;try{s=await ua.loadAsync(i),console.log("[character] loaded sheet",{path:e,sourceUsed:i})}catch(g){let T=((n.gameplay.character_sheet||{}).fallback_color||"#ff00ff").replace("#","");s=await st(e,t,parseInt(T,16),!0),console.warn("[character] fallback loadAsset used",{path:e,err:g})}if(!s)return[];let o=n.gameplay.character_sheet||{},l=(b=o.cols)!=null?b:3,c=(p=o.rows)!=null?p:2,m=((f=s.image)==null?void 0:f.width)||0,r=((y=s.image)==null?void 0:y.height)||0,d=m/l,u=r/c;if(!Number.isFinite(d)||!Number.isFinite(u)||d<=0||u<=0)return[s];let h=[];for(let g=0;g<c;g++)for(let E=0;E<l;E++){let w=document.createElement("canvas");w.width=d,w.height=u;let T=w.getContext("2d");T&&s.image&&T.drawImage(s.image,E*d,g*u,d,u,0,0,d,u),h.push(new he.CanvasTexture(w))}return h.length>2&&h.push(...h.slice(1,-1).reverse()),console.log("[character] frames prepared",{count:h.length}),h}function fa(e,t){var d,u,h,b;let n=t.gameplay.brush||{},a=t.theme.brush_color||"#ffffff",i=(d=n.radius)!=null?d:20,s=(u=n.inner_radius)!=null?u:15,o=(h=n.alpha)!=null?h:.8,l=(b=n.inner_alpha)!=null?b:.3,c=n.inner_color||"#ffffff",m=document.createElement("canvas");m.width=i*2,m.height=i*2;let r=m.getContext("2d");return r&&(r.clearRect(0,0,m.width,m.height),r.beginPath(),r.arc(i,i,i,0,Math.PI*2),r.fillStyle=a,r.globalAlpha=o,r.fill(),r.beginPath(),r.arc(i,i,s,0,Math.PI*2),r.fillStyle=c,r.globalAlpha=l,r.fill()),new he.CanvasTexture(m)}0&&(module.exports={GameObject,GameObjectManager,Renderer,Transform,animateHandClick,animatePanelEntrance,createBrushTexture,createEndGamePanel,createHandTutorial,createThreeBase,createTutorialLabel,getRegisteredFontIds,loadAsset,loadCharacterFrames,registerFont,resolveFont,resolveFontWeight,updateHandAnimation});
112
+ `,u}function hi(e,t,n,i,a){var r,m,l,c,f,u,b;let s=a.objects.get("hand_tutorial_1"),o=((r=s==null?void 0:s.gameplay)==null?void 0:r.tuning)||{},p=(s==null?void 0:s.transform)||{};if(!i){let d=(m=o.animation_duration)!=null?m:1.5,y=n%d/d,h=y<.5?2*y*y:-1+(4-2*y)*y,g=(l=o.x_offset)!=null?l:0,w=(c=o.y_offset)!=null?c:0,E=(f=o.animation_range)!=null?f:40,T=E*.7,S=E,C=t.x+g+T,x=t.y+w+S,Y=C+T,H=x+S;e.position.set(C+(Y-C)*h,x+(H-x)*h,0);let B=(u=p.scale)!=null?u:.1875,L=(b=o.hand_scale_multiplier)!=null?b:2.5,z=B*L*100;e.scale.set(z,z,1)}}var ge=xe(require("three")),yi=new ge.TextureLoader;async function ct(e,t,n=16777215,i=!1){try{let s=(globalThis.INLINE_ASSETS||{})[e];return await yi.loadAsync(s||e)}catch{console.warn(`Asset missing: ${e}. Using placeholder.`);let s=document.createElement("canvas");s.width=64,s.height=64;let o=s.getContext("2d");return o&&(o.fillStyle=`#${n.toString(16).padStart(6,"0")}`,i?o.fillRect(0,0,30,60):(o.beginPath(),o.arc(32,32,30,0,Math.PI*2),o.fill(),o.fillRect(27,32,10,40))),new ge.CanvasTexture(s)}}async function gi(e,t,n){var b,d,y,h;let a=(globalThis.INLINE_ASSETS||{})[e]||e,s;try{s=await yi.loadAsync(a),console.log("[character] loaded sheet",{path:e,sourceUsed:a})}catch(g){let T=((n.gameplay.character_sheet||{}).fallback_color||"#ff00ff").replace("#","");s=await ct(e,t,parseInt(T,16),!0),console.warn("[character] fallback loadAsset used",{path:e,err:g})}if(!s)return[];let o=n.gameplay.character_sheet||{},p=(b=o.cols)!=null?b:3,r=(d=o.rows)!=null?d:2,m=((y=s.image)==null?void 0:y.width)||0,l=((h=s.image)==null?void 0:h.height)||0,c=m/p,f=l/r;if(!Number.isFinite(c)||!Number.isFinite(f)||c<=0||f<=0)return[s];let u=[];for(let g=0;g<r;g++)for(let w=0;w<p;w++){let E=document.createElement("canvas");E.width=c,E.height=f;let T=E.getContext("2d");T&&s.image&&T.drawImage(s.image,w*c,g*f,c,f,0,0,c,f),u.push(new ge.CanvasTexture(E))}return u.length>2&&u.push(...u.slice(1,-1).reverse()),console.log("[character] frames prepared",{count:u.length}),u}function bi(e,t){var c,f,u,b;let n=t.gameplay.brush||{},i=t.theme.brush_color||"#ffffff",a=(c=n.radius)!=null?c:20,s=(f=n.inner_radius)!=null?f:15,o=(u=n.alpha)!=null?u:.8,p=(b=n.inner_alpha)!=null?b:.3,r=n.inner_color||"#ffffff",m=document.createElement("canvas");m.width=a*2,m.height=a*2;let l=m.getContext("2d");return l&&(l.clearRect(0,0,m.width,m.height),l.beginPath(),l.arc(a,a,a,0,Math.PI*2),l.fillStyle=i,l.globalAlpha=o,l.fill(),l.beginPath(),l.arc(a,a,s,0,Math.PI*2),l.fillStyle=r,l.globalAlpha=p,l.fill()),new ge.CanvasTexture(m)}0&&(module.exports={AspectClass,GameObject,GameObjectManager,Renderer,ResponsiveUISystem,Transform,animateHandClick,animatePanelEntrance,createBrushTexture,createEndGamePanel,createHandTutorial,createThreeBase,createTutorialLabel,getAspectClass,getRegisteredFontIds,loadAsset,loadCharacterFrames,registerFont,resolveFont,resolveFontWeight,updateHandAnimation});