handler-playable-sdk 0.3.43 → 0.3.44

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.
package/dist/index.css CHANGED
@@ -163,6 +163,27 @@
163
163
  background: var(--ui-bg);
164
164
  }
165
165
 
166
+ /* Scene Tools Container - Dynamically positioned relative to game preview */
167
+ #scene-tools-container {
168
+ position: absolute;
169
+ /* left, top, and transform will be set dynamically by JavaScript */
170
+ z-index: 60;
171
+ pointer-events: auto;
172
+ transition: left var(--ui-duration-fast) var(--ui-ease),
173
+ top var(--ui-duration-fast) var(--ui-ease);
174
+ }
175
+
176
+ /* Nudge Panel Container - Dynamically positioned relative to game preview */
177
+ #nudge-panel-container {
178
+ position: absolute;
179
+ /* left, top, and transform will be set dynamically by JavaScript */
180
+ z-index: 60;
181
+ pointer-events: auto;
182
+ transition: left var(--ui-duration-fast) var(--ui-ease),
183
+ top var(--ui-duration-fast) var(--ui-ease);
184
+ }
185
+
186
+
166
187
  .preview-container {
167
188
  width: 100%;
168
189
  height: 100%;
@@ -4643,12 +4664,10 @@
4643
4664
 
4644
4665
 
4645
4666
  /* ========== 13-nudge-panel.css ========== */
4646
- /* Nudge Panel - Floating on left side */
4667
+ /* Nudge Panel - Dynamically positioned relative to game preview */
4647
4668
  .nudge-panel {
4648
4669
  position: absolute;
4649
- left: 16px;
4650
- top: 50%;
4651
- transform: translateY(-50%);
4670
+ /* left, top, and transform will be set dynamically by JavaScript */
4652
4671
  width: 180px;
4653
4672
  background: var(--ui-surface);
4654
4673
  border: 1px solid var(--ui-border);
@@ -4656,7 +4675,9 @@
4656
4675
  box-shadow: var(--ui-shadow);
4657
4676
  z-index: 60;
4658
4677
  pointer-events: auto;
4659
- transition: opacity var(--ui-duration-fast) var(--ui-ease);
4678
+ transition: left var(--ui-duration-fast) var(--ui-ease),
4679
+ top var(--ui-duration-fast) var(--ui-ease),
4680
+ opacity var(--ui-duration-fast) var(--ui-ease);
4660
4681
  }
4661
4682
 
4662
4683
  .nudge-panel.hidden {
package/dist/index.d.cts CHANGED
@@ -139,6 +139,7 @@ declare class PreviewShell {
139
139
  private fitToScreen;
140
140
  private applyTransform;
141
141
  private applyFrameDrag;
142
+ private updatePanelPositions;
142
143
  private setupFrameDragging;
143
144
  private setupSpaceKeyListener;
144
145
  private isInputFocused;
package/dist/index.d.ts CHANGED
@@ -139,6 +139,7 @@ declare class PreviewShell {
139
139
  private fitToScreen;
140
140
  private applyTransform;
141
141
  private applyFrameDrag;
142
+ private updatePanelPositions;
142
143
  private setupFrameDragging;
143
144
  private setupSpaceKeyListener;
144
145
  private isInputFocused;
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import{E as F,F as G,G as H,H as I,I as J,J as K,K as L,L as M,M as N,N as O,O as P,P as Q,Q as R,R as S,S as T,T as U,U as V,a}from"./chunk-XSKUGJJF.js";import"./chunk-I5OOVR5U.js";import{a as q,b as r,c as s,d as t,e as u,f as v,g as w,h as x,i as y,j as z,k as A,l as B,m as C,n as D,o as E}from"./chunk-LV4HGC5G.js";import{a as b,b as c,c as d,d as e,e as f,f as g,g as h,h as i,i as j,j as k,k as l,l as m,m as n,n as o,o as p}from"./chunk-ZLL42OOV.js";import"./chunk-E6WJCS24.js";import"./chunk-JXBG6UFL.js";export{Q as COLORS,B as ConfigWatcher,K as DebugPanel,A as DefaultReloadStrategy,U as Handler,T as PlayableLoadingScreen,L as PreviewShell,R as STROKE_WIDTH,S as THEME,d as applyConfigOverride,e as applyConfigOverrides,n as applyConfigsToDisk,x as applyDefaults,a as baseLottie,P as bootstrap,f as clearConfigOverrides,g as clearConfigOverridesForObject,j as configOverrideManager,M as createPreviewShell,k as deepClone,V as default,H as defaultPreset,G as deviceGroups,F as devicePresets,C as diffConfigs,l as exportConfigsAsJSON,i as getConfigOverrides,m as getConfigStateSummary,b as getOverrideMode,I as getPresetById,J as getPresetsByCategory,s as loadAllObjectConfigs,q as loadComponentSchemas,t as loadEngineConfig,u as loadGamePromptConfig,y as loadObjectCentricConfig,r as loadObjectConfig,v as loadSceneConfig,D as rehydrateObject,h as removeConfigOverride,o as resetToApplied,p as resetToOriginal,O as setBootstrapDependencies,c as setOverrideMode,E as setupHotReload,N as setupLiveEditBridge,z as toLegacyFormat,w as validateObjectConfig};
1
+ import{E as F,F as G,G as H,H as I,I as J,J as K,K as L,L as M,M as N,N as O,O as P,P as Q,Q as R,R as S,S as T,T as U,U as V,a}from"./chunk-MNKEHT3M.js";import"./chunk-I5OOVR5U.js";import{a as q,b as r,c as s,d as t,e as u,f as v,g as w,h as x,i as y,j as z,k as A,l as B,m as C,n as D,o as E}from"./chunk-LV4HGC5G.js";import{a as b,b as c,c as d,d as e,e as f,f as g,g as h,h as i,i as j,j as k,k as l,l as m,m as n,n as o,o as p}from"./chunk-ZLL42OOV.js";import"./chunk-E6WJCS24.js";import"./chunk-JXBG6UFL.js";export{Q as COLORS,B as ConfigWatcher,K as DebugPanel,A as DefaultReloadStrategy,U as Handler,T as PlayableLoadingScreen,L as PreviewShell,R as STROKE_WIDTH,S as THEME,d as applyConfigOverride,e as applyConfigOverrides,n as applyConfigsToDisk,x as applyDefaults,a as baseLottie,P as bootstrap,f as clearConfigOverrides,g as clearConfigOverridesForObject,j as configOverrideManager,M as createPreviewShell,k as deepClone,V as default,H as defaultPreset,G as deviceGroups,F as devicePresets,C as diffConfigs,l as exportConfigsAsJSON,i as getConfigOverrides,m as getConfigStateSummary,b as getOverrideMode,I as getPresetById,J as getPresetsByCategory,s as loadAllObjectConfigs,q as loadComponentSchemas,t as loadEngineConfig,u as loadGamePromptConfig,y as loadObjectCentricConfig,r as loadObjectConfig,v as loadSceneConfig,D as rehydrateObject,h as removeConfigOverride,o as resetToApplied,p as resetToOriginal,O as setBootstrapDependencies,c as setOverrideMode,E as setupHotReload,N as setupLiveEditBridge,z as toLegacyFormat,w as validateObjectConfig};
@@ -43,7 +43,7 @@
43
43
  <button class="debug-btn primary" data-modal-apply>Apply</button>
44
44
  </div>
45
45
  </div>
46
- `,this.modal=i}attachModalListeners(){if(!this.modal)return;this.modal.querySelectorAll("[data-modal-close]").forEach(s=>{s.addEventListener("click",()=>this.close())}),this.modal.querySelectorAll("[data-tab]").forEach(s=>{s.addEventListener("click",o=>{let c=o.target.dataset.tab;c&&this.switchTab(c)})});let i=this.modal.querySelector("[data-ai-generate]");i==null||i.addEventListener("click",()=>{this.openAiEditor("generate")});let a=this.modal.querySelector("[data-ai-edit]");a==null||a.addEventListener("click",()=>{this.openAiEditor("edit")});let r=this.modal.querySelector("[data-modal-apply]");r==null||r.addEventListener("click",()=>{this.apply()}),this.modal.addEventListener("click",s=>{s.target===this.modal&&this.close()})}switchTab(e){if(!this.modal)return;this.modal.querySelectorAll("[data-tab]").forEach(a=>{a.classList.toggle("active",a.getAttribute("data-tab")===e)}),this.modal.querySelectorAll("[data-tab-panel]").forEach(a=>{a.classList.toggle("active",a.getAttribute("data-tab-panel")===e)})}openAiEditor(e){let t=window.__openAiEditor;if(typeof t!="function"){alert("AI Editor not available. Please check your setup.");return}let i="";e==="edit"&&this.currentAsset?i=`Edit this image: ${this.currentObjectId}`:i=`Create an image for: ${this.currentObjectId}`,t(this.currentObjectId||"unknown",i,this.currentAsset,{path:this.currentPath,onApply:a=>{this.onApplyCallback&&this.onApplyCallback(a),this.close()}})}apply(){this.onApplyCallback&&this.onApplyCallback("library/placeholder.png"),this.close()}close(){this.modal&&this.modal.parentNode&&this.modal.parentNode.removeChild(this.modal),this.modal=null,this.currentObjectId=null,this.currentPath=null,this.onApplyCallback=null}}});var Br={};Xn(Br,{AssetCache:()=>ee,AssetLoader:()=>fe,AssetSystem:()=>Rt,AssetTextures:()=>he,Assets:()=>fa,BaseSystem:()=>ze,GameEngine:()=>It,GameObject:()=>lt,GameObjectManager:()=>De,ObjectFactory:()=>me,Renderer:()=>ot,RuntimeObjectRegistry:()=>Ne,Transform:()=>st,applyScreenAnchor:()=>$t,basePixi:()=>da,clearResponsiveElements:()=>ma,createPixiBase:()=>kt,getRegisteredFontIds:()=>sa,globalResponsiveMultipliers:()=>dt,initAssetTextures:()=>St,initAssets:()=>ha,layout:()=>ya,playLottieOverlay:()=>la,registerFont:()=>ra,registerType:()=>Et,resolveAnchorVec2:()=>pt,resolveFont:()=>ia,resolveFontWeight:()=>aa,resolveScreenAnchorPoint:()=>He,resolveScreenRatioPoint:()=>Be,runInitSequence:()=>va,setLottieInstance:()=>Ct,spawnSceneFromConfig:()=>ua,updateScreenState:()=>Dt});module.exports=Ca(Br);var na=require("pixi.js");var pe={};function bt(n,e,t=!1){pe[n]||(pe[n]=[]),pe[n].push({fn:e,once:t})}function Gt(n,e){if(pe[n]){if(!e){delete pe[n];return}pe[n]=pe[n].filter(t=>t.fn!==e)}}function yt(n,...e){let t=pe[n];if(t)for(let i of[...t])i.fn(...e),i.once&&Gt(n,i.fn)}function q(n,e){bt(n,e,!0)}var D=null,K=[],Ce=null;function ei(n){D=n,K=[],Ce!==null&&(clearTimeout(Ce),Ce=null)}function ti(){var n,e,t;return{endpoint:(D==null?void 0:D.endpoint)||"",transport:(D==null?void 0:D.transport)||"beacon",batchSize:(n=D==null?void 0:D.batchSize)!=null?n:10,flushIntervalMs:(e=D==null?void 0:D.flushIntervalMs)!=null?e:300,maxQueue:(t=D==null?void 0:D.maxQueue)!=null?t:200,debug:!!(D!=null&&D.debug)}}async function Zn(n,e,t,i){let a=JSON.stringify(e);if(t==="beacon"&&typeof navigator!="undefined"&&typeof navigator.sendBeacon=="function")try{let r=navigator.sendBeacon(n,new Blob([a],{type:"application/json"}));i&&console.log("[handler.telemetry] beacon",r,e);return}catch(r){i&&console.warn("[handler.telemetry] beacon failed, fallback to fetch",r)}try{await fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:a,keepalive:!0}),i&&console.log("[handler.telemetry] fetch",e)}catch(r){i&&console.warn("[handler.telemetry] fetch failed",r)}}function qt(n,e){let t=ti();if(e&&t.endpoint){if(K.push(n),K.length>t.maxQueue&&(K=K.slice(K.length-t.maxQueue)),K.length>=t.batchSize){Qn();return}Ce===null&&(Ce=window.setTimeout(()=>{Ce=null,Qn()},t.flushIntervalMs))}}async function Qn(){let n=ti();if(!n.endpoint||K.length===0)return;let e=K.splice(0,n.batchSize);await Zn(n.endpoint,{events:e},n.transport,n.debug),K.length>0&&await Zn(n.endpoint,{events:K.splice(0,n.batchSize)},n.transport,n.debug)}function ni(n){return Math.max(0,Math.min(1,n))}function La(n){let e=String(n!=null?n:"power2.out");if(e==="linear")return t=>t;if(e==="sine.inOut")return t=>.5-Math.cos(Math.PI*t)/2;if(e==="power2.out"||e==="easeOutQuad")return t=>1-(1-t)*(1-t);if(e.startsWith("back.out")){let t=e.match(/back\.out\(([\d.]+)\)/),i=t?Number(t[1]):1.8;return a=>1+(i+1)*Math.pow(a-1,3)+i*Math.pow(a-1,2)}return t=>1-(1-t)*(1-t)}function Xe(){return typeof performance!="undefined"&&performance.now?performance.now():Date.now()}function Ta(n,e){let t=n==null?void 0:n[e];return typeof t=="number"?t:0}function ii(n,e,t){try{n[e]=t}catch{}}function _a(n){let e=n==null?void 0:n.scale;if(!e)return null;let t=typeof e.x=="number"?e.x:1,i=typeof e.y=="number"?e.y:1;return{x:t,y:i}}function ai(n,e){let t=n==null?void 0:n.scale;if(t)try{typeof t.set=="function"?t.set(e.x,e.y):(typeof t.x=="number"&&(t.x=e.x),typeof t.y=="number"&&(t.y=e.y))}catch{}}function ri(n,e){let t=_a(n);if(!t)return{from:null,to:null};let i=null,a=null;return typeof e.scale=="number"?(i=e.scale,a=e.scale):e.scale&&typeof e.scale=="object"&&(typeof e.scale.x=="number"&&(i=e.scale.x),typeof e.scale.y=="number"&&(a=e.scale.y)),typeof e.scaleX=="number"&&(i=e.scaleX),typeof e.scaleY=="number"&&(a=e.scaleY),i===null&&a===null?{from:null,to:null}:{from:{x:t.x,y:t.y},to:{x:i!=null?i:t.x,y:a!=null?a:t.y}}}function si(){let n=new Set,e=new WeakMap,t=null,i=()=>{if(t!=null)return;t=requestAnimationFrame(()=>{t=null,o(),n.size>0&&i()})},a=u=>{var p;n.add(u);let l=(p=e.get(u.target))!=null?p:new Set;l.add(u),e.set(u.target,l),i()},r=u=>{n.delete(u);let l=e.get(u.target);l&&(l.delete(u),l.size===0&&e.delete(u.target))},s=u=>{u.killed||(u.killed=!0,r(u))},o=()=>{var l,p;let u=Xe();for(let g of Array.from(n)){if(g.killed||g.paused)continue;let m=u-g.startMs-g.delayMs;if(m<0)continue;let h=g.durationMs>0?m/g.durationMs:1,A=ni(h),b=g.repeat>=0?g.repeat+1:1,f=g.repeat>0?Math.min(Math.floor(h),b-1):0;if(g.repeat>0&&h>=1){let y=h-f;A=ni(y)}let x=g.ease(A);g.yoyo&&f%2===1&&(x=1-x);for(let y of g.props)ii(g.target,y.key,y.from+(y.to-y.from)*x);g.scaleFrom&&g.scaleTo&&ai(g.target,{x:g.scaleFrom.x+(g.scaleTo.x-g.scaleFrom.x)*x,y:g.scaleFrom.y+(g.scaleTo.y-g.scaleFrom.y)*x});try{(l=g.onUpdate)==null||l.call(g)}catch{}if(h>=b){s(g);try{(p=g.onComplete)==null||p.call(g)}catch{}}}},d=(u,l,p)=>{var y;let g=Math.max(0,(typeof l.duration=="number"?l.duration:.5)*1e3),m=Math.max(0,(typeof l.delay=="number"?l.delay:0)*1e3+((y=p==null?void 0:p.delayMsOverride)!=null?y:0)),h=La(l.ease),A=typeof l.repeat=="number"?Math.max(0,l.repeat|0):0,b=l.yoyo===!0,f=new Set(["duration","delay","ease","repeat","yoyo","onUpdate","onComplete","scale","scaleX","scaleY"]),x=[];for(let O of Object.keys(l)){if(f.has(O))continue;let j=l[O];typeof j=="number"&&x.push({key:O,from:Ta(u,O),to:j})}let w=ri(u,l);return{target:u,startMs:Xe(),delayMs:m,durationMs:g,ease:h,props:x,scaleFrom:w.from,scaleTo:w.to,repeat:A,yoyo:b,onUpdate:typeof l.onUpdate=="function"?l.onUpdate:void 0,onComplete:typeof l.onComplete=="function"?l.onComplete:void 0,killed:!1,paused:!1,pauseAtMs:null}},c={to(u,l){let p=d(u,l);return a(p),{kill:()=>s(p),pause:()=>{p.paused||(p.paused=!0,p.pauseAtMs=Xe())},resume:()=>{var h;if(!p.paused)return;let g=(h=p.pauseAtMs)!=null?h:Xe(),m=Xe()-g;p.startMs+=m,p.paused=!1,p.pauseAtMs=null},isActive:()=>!p.killed&&!p.paused}},fromTo(u,l,p){return c.set(u,l),c.to(u,p)},set(u,l){if(!u||!l)return;for(let g of Object.keys(l)){let m=l[g];g==="scale"||g==="scaleX"||g==="scaleY"||typeof m=="number"&&ii(u,g,m)}let p=ri(u,l);p.to&&ai(u,p.to)},killTweensOf(u){let l=e.get(u);if(l)for(let p of Array.from(l))s(p)},timeline(u={}){let l=[],p=0,g=!1,m=[],h=f=>{if(typeof f=="number")return Math.max(0,f*1e3);let x=typeof f=="string"?f.trim():"";return x.startsWith("+=")?p+Math.max(0,Number(x.slice(2))*1e3||0):x?Math.max(0,Number(x)*1e3||0):p},A=f=>{l.push(f);let x=Math.max(0,(typeof f.vars.duration=="number"?f.vars.duration:.5)*1e3);p=Math.max(p,f.atMs+x)},b={to(f,x,w){return A({kind:"to",target:f,vars:x,atMs:h(w)}),b},fromTo(f,x,w,y){return A({kind:"fromTo",target:f,vars:w,from:x,atMs:h(y)}),b},play(){var f,x;if(g)return b;g=!0,m=[];for(let w of l)w.kind==="fromTo"&&c.set(w.target,(f=w.from)!=null?f:{}),m.push(c.to(w.target,{...w.vars,delay:w.atMs/1e3+((x=w.vars.delay)!=null?x:0)}));return b},pause(){for(let f of m)f.pause();return b},kill(){for(let f of m)f.kill();m=[],g=!1}};return u.paused||b.play(),b}};return c}function oi(){if(typeof window=="undefined")return;let n=window;if(!n.gsap)try{n.gsap=si()}catch{}}var li={name:"handler-playable-sdk",version:"0.3.43",type:"module",description:"Handler Playable SDK v0.1 with contract-aligned surface (root sandbox, canonical event envelope).",main:"dist/index.cjs",module:"dist/index.js",types:"dist/index.d.ts",exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js",require:"./dist/index.cjs"},"./pixi":{types:"./dist/pixi/index.d.ts",import:"./dist/pixi/index.js",require:"./dist/pixi/index.cjs"},"./pixi/index.css":{import:"./dist/pixi/index.css",require:"./dist/pixi/index.css"},"./three":{types:"./dist/three/index.d.ts",import:"./dist/three/index.js",require:"./dist/three/index.cjs"},"./cli":{types:"./dist/cli/index.d.ts",import:"./dist/cli/index.js",require:"./dist/cli/index.cjs"}},bin:{"handler-student-helper":"./bin/student-helper.mjs","handler-validate":"./bin/validate.mjs","handler-sync-screens":"./bin/sync-screens.mjs","handler-brand-dna":"./bin/brand-dna.mjs","handler-setup-library":"./bin/setup-library.mjs","handler-screen-helper":"./bin/screen-helper.mjs"},scripts:{prebuild:"python3 src/preview/build-css.py",build:"tsup src/index.ts src/pixi/index.ts src/three/index.ts src/cli/index.ts --format cjs,esm --dts --clean --minify --external lottie-web && npm run create-mjs-symlinks && npm run postbuild-cli && npm run obfuscate && npm run postbuild",postbuild:"python3 src/preview/copy-css-to-dist.py","postbuild-cli":"cp src/cli/*.mjs dist/cli/ && chmod +x dist/cli/*.mjs && chmod +x bin/*.mjs","create-mjs-symlinks":"cd dist && ln -sf index.js index.mjs && cd pixi && ln -sf index.js index.mjs && cd ../three && ln -sf index.js index.mjs","build:dev":"tsup src/index.ts src/pixi/index.ts src/three/index.ts src/cli/index.ts --format cjs,esm --dts --clean --external lottie-web && npm run create-mjs-symlinks && npm run postbuild-cli",obfuscate:"javascript-obfuscator dist/pixi/index.js --output dist/pixi/index.js --config obfuscator.config.json && javascript-obfuscator dist/three/index.js --output dist/three/index.js --config obfuscator.config.json && javascript-obfuscator dist/cli/index.js --output dist/cli/index.js --config obfuscator.config.json && npm run obfuscate-cli","obfuscate-cli":'for file in dist/cli/*.mjs; do javascript-obfuscator "$file" --output "$file" --config obfuscator.config.json; done',lint:"eslint 'src/**/*.{ts,tsx}'",typecheck:"tsc --noEmit",prepublishOnly:"npm run build","publish:update":"node scripts/publish-and-update.cjs patch","publish:update:minor":"node scripts/publish-and-update.cjs minor","publish:update:major":"node scripts/publish-and-update.cjs major"},author:"Handler",license:"MIT",publishConfig:{access:"public"},repository:{type:"git",url:"https://github.com/HandlerAIGames/handler-playable-sdk.git"},files:["dist","bin","LICENSE","README.md"],peerDependencies:{"lottie-web":"^5.0.0","pixi.js":"^8.0.0",three:"^0.182.0"},peerDependenciesMeta:{"pixi.js":{optional:!0},three:{optional:!0},"lottie-web":{optional:!0}},devDependencies:{"@types/three":"^0.182.0",eslint:"^9.39.2","javascript-obfuscator":"^5.1.0","pixi.js":"8.8.1",three:"^0.182.0","ts-node":"^10.9.2",tsup:"^8.4.0",typescript:"^5.7.2","typescript-eslint":"^8.53.0"},dependencies:{"@google/genai":"^1.35.0","@google/generative-ai":"^0.24.1",jszip:"^3.10.1",sharp:"^0.34.5"}};var V=0,Ma=V++,ci=V++,di=V++,pi=V++,ui=V++,gi=V++,fi=V++,hi=V++,mi=V++,bi=V++,yi=V++,vi=V++,M=Ma;function xi(){return M===ci}function wi(){return M===di}function Ei(){return M===pi}function Ai(){return M===ui}function Le(){return M===gi}function Te(){return M===fi}function Si(){return M===hi}function Ci(){return M===mi}function Li(){return M===bi}function Vt(){return M===yi}function Wt(){return M===vi}function Ti(){let n=typeof AD_PROTOCOL!="undefined"?AD_PROTOCOL:"none",e=typeof AD_NETWORK!="undefined"?AD_NETWORK:"web_embed";if(n==="mraid")try{mraid.getState(),M=ci;return}catch{}else if(n==="dapi")try{dapi.isReady(),M=di;return}catch{}if(e==="facebook")try{typeof FbPlayableAd!="undefined"&&(M=pi)}catch{}else if(e==="google")try{typeof ExitApi!="undefined"&&(M=ui)}catch{}else if(e==="mintegral")window.gameReady&&(M=gi);else if(e==="tapjoy")window.TJ_API&&(M=fi);else if(e==="tiktok")window.openAppStore&&(M=hi);else if(e==="smadex")try{window.smxTracking&&(M=mi)}catch{}else if(e==="snapchat")try{window.ScPlayableAd&&(M=bi)}catch{}else e==="vungle"?M=yi:(n==="nucleo"||e==="nucleo")&&(M=vi)}var vt=mt(require("lottie-web"),1),_i=vt.default;typeof window!="undefined"&&(window.lottie=vt.default,window.__baseLottie=vt.default);Xt();function $(n,e){let t=(a,r)=>r===0?a:t(r,a%r),i=t(n,e);return`${n/i}:${e/i}`}var xs=[{id:"iphone-15-pro-max",label:"iPhone 15 Pro Max",width:430,height:932,category:"iphone",ratio:$(430,932)},{id:"iphone-15-pro",label:"iPhone 15 Pro",width:393,height:852,category:"iphone",ratio:$(393,852)},{id:"iphone-15",label:"iPhone 15",width:393,height:852,category:"iphone",ratio:$(393,852)},{id:"iphone-14",label:"iPhone 14",width:390,height:844,category:"iphone",ratio:$(390,844)},{id:"iphone-se",label:"iPhone SE",width:375,height:667,category:"iphone",ratio:$(375,667)},{id:"iphone-12-mini",label:"iPhone 12 Mini",width:360,height:780,category:"iphone",ratio:$(360,780)}],ws=[{id:"pixel-8-pro",label:"Pixel 8 Pro",width:448,height:998,category:"android",ratio:$(448,998)},{id:"pixel-8",label:"Pixel 8",width:412,height:915,category:"android",ratio:$(412,915)},{id:"samsung-s24-ultra",label:"Samsung S24 Ultra",width:412,height:915,category:"android",ratio:$(412,915)},{id:"samsung-s24",label:"Samsung S24",width:360,height:780,category:"android",ratio:$(360,780)},{id:"samsung-a54",label:"Samsung A54",width:412,height:915,category:"android",ratio:$(412,915)},{id:"oneplus-12",label:"OnePlus 12",width:412,height:915,category:"android",ratio:$(412,915)}],Es=[{id:"ipad-pro-12",label:'iPad Pro 12.9"',width:1024,height:1366,category:"tablet",ratio:$(1024,1366)},{id:"ipad-pro-11",label:'iPad Pro 11"',width:834,height:1194,category:"tablet",ratio:$(834,1194)},{id:"ipad-air",label:"iPad Air",width:820,height:1180,category:"tablet",ratio:$(820,1180)},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"tablet",ratio:$(768,1024)},{id:"samsung-tab-s9",label:"Samsung Tab S9",width:800,height:1280,category:"tablet",ratio:$(800,1280)}],Oi=[{id:"playable-portrait",label:"Playable Portrait",width:320,height:480,category:"playable",ratio:"2:3",mraidScale:1},{id:"mraid-320x480",label:"MRAID 320\xD7480",width:320,height:480,category:"playable",ratio:"2:3",mraidScale:1},{id:"iphone-14",label:"iPhone 14",width:390,height:844,category:"playable",ratio:$(390,844),mraidScale:.7},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"playable",ratio:$(768,1024),mraidScale:.7}];var As=[...Oi];var za=Oi[0];ue();var Ga=mt(require("jszip"),1);function Ba(n){return new Promise((e,t)=>{let i=new FileReader;i.onerror=()=>t(new Error("FileReader failed")),i.onload=()=>e(String(i.result||"")),i.readAsDataURL(n)})}function Fa(n){var a;let[e,t]=n.split(","),i=e==null?void 0:e.match(/data:(.*?);base64/);return{base64:t!=null?t:"",mimeType:(a=i==null?void 0:i[1])!=null?a:"image/png"}}async function Ua(n){return await new Promise(e=>{let t=new Image;t.onload=()=>e({width:t.naturalWidth||t.width,height:t.naturalHeight||t.height}),t.onerror=()=>e(null),t.src=n})}async function Jt(n){var e,t;try{console.log("[ImageUtils] Fetching image data from URL:",n);let i=await fetch(n);if(!i.ok)return console.warn("[ImageUtils] Fetch failed with status:",i.status,n),null;let a=await i.blob();console.log("[ImageUtils] Blob received, size:",a.size,"type:",a.type);let r=await Ba(a),s=await Ua(r),o=Fa(r);return console.log("[ImageUtils] Success resolution:",s==null?void 0:s.width,"x",s==null?void 0:s.height,"mime:",o.mimeType),{base64:o.base64,mimeType:o.mimeType,dataUrl:r,width:(e=s==null?void 0:s.width)!=null?e:0,height:(t=s==null?void 0:s.height)!=null?t:0}}catch(i){return console.error("[ImageUtils] Error fetching image data:",i),null}}async function xt(n,e=30){try{console.log("[ImageUtils] Removing background color...");let t=await new Promise((l,p)=>{let g=new Image;g.onload=()=>l(g),g.onerror=()=>p(new Error("Failed to load image")),g.src=n}),i=document.createElement("canvas");i.width=t.width,i.height=t.height;let a=i.getContext("2d");if(!a)return console.error("[ImageUtils] Failed to get canvas context"),n;a.drawImage(t,0,0);let r=a.getImageData(0,0,i.width,i.height),s=r.data,d=[{name:"top-left",offset:0},{name:"top-right",offset:(i.width-1)*4},{name:"bottom-left",offset:(i.height-1)*i.width*4},{name:"bottom-right",offset:((i.height-1)*i.width+(i.width-1))*4}].map(l=>({r:s[l.offset],g:s[l.offset+1],b:s[l.offset+2]})),c=0;for(let l=0;l<s.length;l+=4){let p=s[l],g=s[l+1],m=s[l+2],h=!1;for(let A of d)if(Math.sqrt(Math.pow(p-A.r,2)+Math.pow(g-A.g,2)+Math.pow(m-A.b,2))<e){h=!0;break}h&&(s[l+3]=0,c++)}return console.log(`[ImageUtils] Removed background from ${c} pixels (4-corner sampling, tolerance: ${e})`),a.putImageData(r,0,0),i.toDataURL("image/png")}catch(t){return console.error("[ImageUtils] Error removing background:",t),n}}var Ii=require("@google/genai");async function Zt(n,e,t=[],i={}){var a,r,s,o,d,c,u;try{if(!(n!=null&&n.trim()))throw new Error("Gemini API key is required");if(!(e!=null&&e.trim()))throw new Error("Prompt is required");for(let b=0;b<t.length;b++){let f=t[b];if(!f.base64||!f.mimeType)throw new Error(`Image ${b+1} is missing required data`);if(f.base64.length<1e3&&console.warn(`Image ${b+1} data appears very small, may be corrupted`),!f.mimeType.startsWith("image/"))throw new Error(`Image ${b+1} has invalid MIME type: ${f.mimeType}`)}let l=new Ii.GoogleGenAI({apiKey:n}),p="gemini-2.5-flash",g=[e];t.length>0&&t.forEach((b,f)=>{g.push({inlineData:{data:b.base64,mimeType:b.mimeType}}),console.log(`[Gemini] Added image ${f+1}: ${b.mimeType}, size: ${Math.round(b.base64.length/1024)}KB`)}),console.log(`[Gemini] Making request with ${t.length} images and prompt length: ${e.length}`);let m=await l.models.generateContent({model:p,contents:g}),h="",A=(s=(r=(a=m.candidates)==null?void 0:a[0])==null?void 0:r.content)==null?void 0:s.parts;if(A)for(let b of A)b.text&&(h+=b.text);if(!h.trim())throw new Error("Empty response from Gemini API");return console.log(`[Gemini] Response received, length: ${h.length}`),h}catch(l){throw console.error("[Gemini] API error:",l),(o=l.message)!=null&&o.includes("Unable to process input image")?new Error("Unable to process the uploaded image. Please ensure it's a valid PNG, JPG, or JPEG file under 10MB and not corrupted."):(d=l.message)!=null&&d.includes("API_KEY_INVALID")?new Error("Invalid Gemini API key. Please check your API key configuration."):(c=l.message)!=null&&c.includes("QUOTA_EXCEEDED")?new Error("Gemini API quota exceeded. Please try again later or check your billing."):(u=l.message)!=null&&u.includes("SAFETY")?new Error("Content was flagged by Gemini safety filters. Please try with different images."):l}}var Ri=require("@google/genai");async function wt(n,e,t=[],i={}){try{console.info("[GEMINI-REAL-SDK] Initializing GoogleGenAI...");let a=new Ri.GoogleGenAI({apiKey:n}),r=[{text:e}];t.length>0&&t.forEach((o,d)=>{console.info(`[GEMINI-REAL-SDK] Adding image part ${d}`),r.push({inlineData:{mimeType:o.mimeType,data:o.base64}})}),console.info("[GEMINI-REAL-SDK] Calling generateContent with model: gemini-2.5-flash-image");let s=await a.models.generateContent({model:"gemini-2.5-flash-image",contents:r});if(console.info("[GEMINI-REAL-SDK] Received response from model"),!s.candidates||!s.candidates[0]||!s.candidates[0].content||!s.candidates[0].content.parts)throw new Error("Gemini 2.5 Flash Image returned invalid response structure.");for(let o of s.candidates[0].content.parts)if(o.text)console.log(o.text);else if(o.inlineData){let d=o.inlineData.data,c=o.inlineData.mimeType||"image/png";return console.info("[GEMINI-REAL-SDK] Found inline image data in response"),`data:${c};base64,${d}`}throw new Error("Gemini 2.5 Flash Image returned no image data.")}catch(a){throw console.error("[GEMINI-REAL-SDK] Error in generateImageWithGemini25Flash:",JSON.stringify(a,Object.getOwnPropertyNames(a),2)),a}}var Xa=require("pixi.js");Je();ue();var Hi=require("pixi.js");var Ja=require("pixi.js");ue();function ar(n){return new Promise((e,t)=>{let i=new FileReader;i.onerror=()=>t(new Error("FileReader failed")),i.onload=()=>e(String(i.result||"")),i.readAsDataURL(n)})}function rr(n){var a;let[e,t]=n.split(","),i=e==null?void 0:e.match(/data:(.*?);base64/);return{base64:t!=null?t:"",mimeType:(a=i==null?void 0:i[1])!=null?a:"image/png"}}function sr(n){return`
46
+ `,this.modal=i}attachModalListeners(){if(!this.modal)return;this.modal.querySelectorAll("[data-modal-close]").forEach(s=>{s.addEventListener("click",()=>this.close())}),this.modal.querySelectorAll("[data-tab]").forEach(s=>{s.addEventListener("click",o=>{let c=o.target.dataset.tab;c&&this.switchTab(c)})});let i=this.modal.querySelector("[data-ai-generate]");i==null||i.addEventListener("click",()=>{this.openAiEditor("generate")});let a=this.modal.querySelector("[data-ai-edit]");a==null||a.addEventListener("click",()=>{this.openAiEditor("edit")});let r=this.modal.querySelector("[data-modal-apply]");r==null||r.addEventListener("click",()=>{this.apply()}),this.modal.addEventListener("click",s=>{s.target===this.modal&&this.close()})}switchTab(e){if(!this.modal)return;this.modal.querySelectorAll("[data-tab]").forEach(a=>{a.classList.toggle("active",a.getAttribute("data-tab")===e)}),this.modal.querySelectorAll("[data-tab-panel]").forEach(a=>{a.classList.toggle("active",a.getAttribute("data-tab-panel")===e)})}openAiEditor(e){let t=window.__openAiEditor;if(typeof t!="function"){alert("AI Editor not available. Please check your setup.");return}let i="";e==="edit"&&this.currentAsset?i=`Edit this image: ${this.currentObjectId}`:i=`Create an image for: ${this.currentObjectId}`,t(this.currentObjectId||"unknown",i,this.currentAsset,{path:this.currentPath,onApply:a=>{this.onApplyCallback&&this.onApplyCallback(a),this.close()}})}apply(){this.onApplyCallback&&this.onApplyCallback("library/placeholder.png"),this.close()}close(){this.modal&&this.modal.parentNode&&this.modal.parentNode.removeChild(this.modal),this.modal=null,this.currentObjectId=null,this.currentPath=null,this.onApplyCallback=null}}});var Br={};Xn(Br,{AssetCache:()=>ee,AssetLoader:()=>fe,AssetSystem:()=>Rt,AssetTextures:()=>he,Assets:()=>fa,BaseSystem:()=>ze,GameEngine:()=>It,GameObject:()=>lt,GameObjectManager:()=>De,ObjectFactory:()=>me,Renderer:()=>ot,RuntimeObjectRegistry:()=>Ne,Transform:()=>st,applyScreenAnchor:()=>$t,basePixi:()=>da,clearResponsiveElements:()=>ma,createPixiBase:()=>kt,getRegisteredFontIds:()=>sa,globalResponsiveMultipliers:()=>dt,initAssetTextures:()=>St,initAssets:()=>ha,layout:()=>ya,playLottieOverlay:()=>la,registerFont:()=>ra,registerType:()=>Et,resolveAnchorVec2:()=>pt,resolveFont:()=>ia,resolveFontWeight:()=>aa,resolveScreenAnchorPoint:()=>He,resolveScreenRatioPoint:()=>Be,runInitSequence:()=>va,setLottieInstance:()=>Ct,spawnSceneFromConfig:()=>ua,updateScreenState:()=>Dt});module.exports=Ca(Br);var na=require("pixi.js");var pe={};function bt(n,e,t=!1){pe[n]||(pe[n]=[]),pe[n].push({fn:e,once:t})}function Gt(n,e){if(pe[n]){if(!e){delete pe[n];return}pe[n]=pe[n].filter(t=>t.fn!==e)}}function yt(n,...e){let t=pe[n];if(t)for(let i of[...t])i.fn(...e),i.once&&Gt(n,i.fn)}function q(n,e){bt(n,e,!0)}var D=null,K=[],Ce=null;function ei(n){D=n,K=[],Ce!==null&&(clearTimeout(Ce),Ce=null)}function ti(){var n,e,t;return{endpoint:(D==null?void 0:D.endpoint)||"",transport:(D==null?void 0:D.transport)||"beacon",batchSize:(n=D==null?void 0:D.batchSize)!=null?n:10,flushIntervalMs:(e=D==null?void 0:D.flushIntervalMs)!=null?e:300,maxQueue:(t=D==null?void 0:D.maxQueue)!=null?t:200,debug:!!(D!=null&&D.debug)}}async function Zn(n,e,t,i){let a=JSON.stringify(e);if(t==="beacon"&&typeof navigator!="undefined"&&typeof navigator.sendBeacon=="function")try{let r=navigator.sendBeacon(n,new Blob([a],{type:"application/json"}));i&&console.log("[handler.telemetry] beacon",r,e);return}catch(r){i&&console.warn("[handler.telemetry] beacon failed, fallback to fetch",r)}try{await fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:a,keepalive:!0}),i&&console.log("[handler.telemetry] fetch",e)}catch(r){i&&console.warn("[handler.telemetry] fetch failed",r)}}function qt(n,e){let t=ti();if(e&&t.endpoint){if(K.push(n),K.length>t.maxQueue&&(K=K.slice(K.length-t.maxQueue)),K.length>=t.batchSize){Qn();return}Ce===null&&(Ce=window.setTimeout(()=>{Ce=null,Qn()},t.flushIntervalMs))}}async function Qn(){let n=ti();if(!n.endpoint||K.length===0)return;let e=K.splice(0,n.batchSize);await Zn(n.endpoint,{events:e},n.transport,n.debug),K.length>0&&await Zn(n.endpoint,{events:K.splice(0,n.batchSize)},n.transport,n.debug)}function ni(n){return Math.max(0,Math.min(1,n))}function La(n){let e=String(n!=null?n:"power2.out");if(e==="linear")return t=>t;if(e==="sine.inOut")return t=>.5-Math.cos(Math.PI*t)/2;if(e==="power2.out"||e==="easeOutQuad")return t=>1-(1-t)*(1-t);if(e.startsWith("back.out")){let t=e.match(/back\.out\(([\d.]+)\)/),i=t?Number(t[1]):1.8;return a=>1+(i+1)*Math.pow(a-1,3)+i*Math.pow(a-1,2)}return t=>1-(1-t)*(1-t)}function Xe(){return typeof performance!="undefined"&&performance.now?performance.now():Date.now()}function Ta(n,e){let t=n==null?void 0:n[e];return typeof t=="number"?t:0}function ii(n,e,t){try{n[e]=t}catch{}}function _a(n){let e=n==null?void 0:n.scale;if(!e)return null;let t=typeof e.x=="number"?e.x:1,i=typeof e.y=="number"?e.y:1;return{x:t,y:i}}function ai(n,e){let t=n==null?void 0:n.scale;if(t)try{typeof t.set=="function"?t.set(e.x,e.y):(typeof t.x=="number"&&(t.x=e.x),typeof t.y=="number"&&(t.y=e.y))}catch{}}function ri(n,e){let t=_a(n);if(!t)return{from:null,to:null};let i=null,a=null;return typeof e.scale=="number"?(i=e.scale,a=e.scale):e.scale&&typeof e.scale=="object"&&(typeof e.scale.x=="number"&&(i=e.scale.x),typeof e.scale.y=="number"&&(a=e.scale.y)),typeof e.scaleX=="number"&&(i=e.scaleX),typeof e.scaleY=="number"&&(a=e.scaleY),i===null&&a===null?{from:null,to:null}:{from:{x:t.x,y:t.y},to:{x:i!=null?i:t.x,y:a!=null?a:t.y}}}function si(){let n=new Set,e=new WeakMap,t=null,i=()=>{if(t!=null)return;t=requestAnimationFrame(()=>{t=null,o(),n.size>0&&i()})},a=u=>{var p;n.add(u);let l=(p=e.get(u.target))!=null?p:new Set;l.add(u),e.set(u.target,l),i()},r=u=>{n.delete(u);let l=e.get(u.target);l&&(l.delete(u),l.size===0&&e.delete(u.target))},s=u=>{u.killed||(u.killed=!0,r(u))},o=()=>{var l,p;let u=Xe();for(let g of Array.from(n)){if(g.killed||g.paused)continue;let m=u-g.startMs-g.delayMs;if(m<0)continue;let h=g.durationMs>0?m/g.durationMs:1,A=ni(h),b=g.repeat>=0?g.repeat+1:1,f=g.repeat>0?Math.min(Math.floor(h),b-1):0;if(g.repeat>0&&h>=1){let y=h-f;A=ni(y)}let x=g.ease(A);g.yoyo&&f%2===1&&(x=1-x);for(let y of g.props)ii(g.target,y.key,y.from+(y.to-y.from)*x);g.scaleFrom&&g.scaleTo&&ai(g.target,{x:g.scaleFrom.x+(g.scaleTo.x-g.scaleFrom.x)*x,y:g.scaleFrom.y+(g.scaleTo.y-g.scaleFrom.y)*x});try{(l=g.onUpdate)==null||l.call(g)}catch{}if(h>=b){s(g);try{(p=g.onComplete)==null||p.call(g)}catch{}}}},d=(u,l,p)=>{var y;let g=Math.max(0,(typeof l.duration=="number"?l.duration:.5)*1e3),m=Math.max(0,(typeof l.delay=="number"?l.delay:0)*1e3+((y=p==null?void 0:p.delayMsOverride)!=null?y:0)),h=La(l.ease),A=typeof l.repeat=="number"?Math.max(0,l.repeat|0):0,b=l.yoyo===!0,f=new Set(["duration","delay","ease","repeat","yoyo","onUpdate","onComplete","scale","scaleX","scaleY"]),x=[];for(let O of Object.keys(l)){if(f.has(O))continue;let j=l[O];typeof j=="number"&&x.push({key:O,from:Ta(u,O),to:j})}let w=ri(u,l);return{target:u,startMs:Xe(),delayMs:m,durationMs:g,ease:h,props:x,scaleFrom:w.from,scaleTo:w.to,repeat:A,yoyo:b,onUpdate:typeof l.onUpdate=="function"?l.onUpdate:void 0,onComplete:typeof l.onComplete=="function"?l.onComplete:void 0,killed:!1,paused:!1,pauseAtMs:null}},c={to(u,l){let p=d(u,l);return a(p),{kill:()=>s(p),pause:()=>{p.paused||(p.paused=!0,p.pauseAtMs=Xe())},resume:()=>{var h;if(!p.paused)return;let g=(h=p.pauseAtMs)!=null?h:Xe(),m=Xe()-g;p.startMs+=m,p.paused=!1,p.pauseAtMs=null},isActive:()=>!p.killed&&!p.paused}},fromTo(u,l,p){return c.set(u,l),c.to(u,p)},set(u,l){if(!u||!l)return;for(let g of Object.keys(l)){let m=l[g];g==="scale"||g==="scaleX"||g==="scaleY"||typeof m=="number"&&ii(u,g,m)}let p=ri(u,l);p.to&&ai(u,p.to)},killTweensOf(u){let l=e.get(u);if(l)for(let p of Array.from(l))s(p)},timeline(u={}){let l=[],p=0,g=!1,m=[],h=f=>{if(typeof f=="number")return Math.max(0,f*1e3);let x=typeof f=="string"?f.trim():"";return x.startsWith("+=")?p+Math.max(0,Number(x.slice(2))*1e3||0):x?Math.max(0,Number(x)*1e3||0):p},A=f=>{l.push(f);let x=Math.max(0,(typeof f.vars.duration=="number"?f.vars.duration:.5)*1e3);p=Math.max(p,f.atMs+x)},b={to(f,x,w){return A({kind:"to",target:f,vars:x,atMs:h(w)}),b},fromTo(f,x,w,y){return A({kind:"fromTo",target:f,vars:w,from:x,atMs:h(y)}),b},play(){var f,x;if(g)return b;g=!0,m=[];for(let w of l)w.kind==="fromTo"&&c.set(w.target,(f=w.from)!=null?f:{}),m.push(c.to(w.target,{...w.vars,delay:w.atMs/1e3+((x=w.vars.delay)!=null?x:0)}));return b},pause(){for(let f of m)f.pause();return b},kill(){for(let f of m)f.kill();m=[],g=!1}};return u.paused||b.play(),b}};return c}function oi(){if(typeof window=="undefined")return;let n=window;if(!n.gsap)try{n.gsap=si()}catch{}}var li={name:"handler-playable-sdk",version:"0.3.44",type:"module",description:"Handler Playable SDK v0.1 with contract-aligned surface (root sandbox, canonical event envelope).",main:"dist/index.cjs",module:"dist/index.js",types:"dist/index.d.ts",exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js",require:"./dist/index.cjs"},"./pixi":{types:"./dist/pixi/index.d.ts",import:"./dist/pixi/index.js",require:"./dist/pixi/index.cjs"},"./pixi/index.css":{import:"./dist/pixi/index.css",require:"./dist/pixi/index.css"},"./three":{types:"./dist/three/index.d.ts",import:"./dist/three/index.js",require:"./dist/three/index.cjs"},"./cli":{types:"./dist/cli/index.d.ts",import:"./dist/cli/index.js",require:"./dist/cli/index.cjs"}},bin:{"handler-student-helper":"./bin/student-helper.mjs","handler-validate":"./bin/validate.mjs","handler-sync-screens":"./bin/sync-screens.mjs","handler-brand-dna":"./bin/brand-dna.mjs","handler-setup-library":"./bin/setup-library.mjs","handler-screen-helper":"./bin/screen-helper.mjs"},scripts:{prebuild:"python3 src/preview/build-css.py",build:"tsup src/index.ts src/pixi/index.ts src/three/index.ts src/cli/index.ts --format cjs,esm --dts --clean --minify --external lottie-web && npm run create-mjs-symlinks && npm run postbuild-cli && npm run obfuscate && npm run postbuild",postbuild:"python3 src/preview/copy-css-to-dist.py","postbuild-cli":"cp src/cli/*.mjs dist/cli/ && chmod +x dist/cli/*.mjs && chmod +x bin/*.mjs","create-mjs-symlinks":"cd dist && ln -sf index.js index.mjs && cd pixi && ln -sf index.js index.mjs && cd ../three && ln -sf index.js index.mjs","build:dev":"tsup src/index.ts src/pixi/index.ts src/three/index.ts src/cli/index.ts --format cjs,esm --dts --clean --external lottie-web && npm run create-mjs-symlinks && npm run postbuild-cli",obfuscate:"javascript-obfuscator dist/pixi/index.js --output dist/pixi/index.js --config obfuscator.config.json && javascript-obfuscator dist/three/index.js --output dist/three/index.js --config obfuscator.config.json && javascript-obfuscator dist/cli/index.js --output dist/cli/index.js --config obfuscator.config.json && npm run obfuscate-cli","obfuscate-cli":'for file in dist/cli/*.mjs; do javascript-obfuscator "$file" --output "$file" --config obfuscator.config.json; done',lint:"eslint 'src/**/*.{ts,tsx}'",typecheck:"tsc --noEmit",prepublishOnly:"npm run build","publish:update":"node scripts/publish-and-update.cjs patch","publish:update:minor":"node scripts/publish-and-update.cjs minor","publish:update:major":"node scripts/publish-and-update.cjs major"},author:"Handler",license:"MIT",publishConfig:{access:"public"},repository:{type:"git",url:"https://github.com/HandlerAIGames/handler-playable-sdk.git"},files:["dist","bin","LICENSE","README.md"],peerDependencies:{"lottie-web":"^5.0.0","pixi.js":"^8.0.0",three:"^0.182.0"},peerDependenciesMeta:{"pixi.js":{optional:!0},three:{optional:!0},"lottie-web":{optional:!0}},devDependencies:{"@types/three":"^0.182.0",eslint:"^9.39.2","javascript-obfuscator":"^5.1.0","pixi.js":"8.8.1",three:"^0.182.0","ts-node":"^10.9.2",tsup:"^8.4.0",typescript:"^5.7.2","typescript-eslint":"^8.53.0"},dependencies:{"@google/genai":"^1.35.0","@google/generative-ai":"^0.24.1",jszip:"^3.10.1",sharp:"^0.34.5"}};var V=0,Ma=V++,ci=V++,di=V++,pi=V++,ui=V++,gi=V++,fi=V++,hi=V++,mi=V++,bi=V++,yi=V++,vi=V++,M=Ma;function xi(){return M===ci}function wi(){return M===di}function Ei(){return M===pi}function Ai(){return M===ui}function Le(){return M===gi}function Te(){return M===fi}function Si(){return M===hi}function Ci(){return M===mi}function Li(){return M===bi}function Vt(){return M===yi}function Wt(){return M===vi}function Ti(){let n=typeof AD_PROTOCOL!="undefined"?AD_PROTOCOL:"none",e=typeof AD_NETWORK!="undefined"?AD_NETWORK:"web_embed";if(n==="mraid")try{mraid.getState(),M=ci;return}catch{}else if(n==="dapi")try{dapi.isReady(),M=di;return}catch{}if(e==="facebook")try{typeof FbPlayableAd!="undefined"&&(M=pi)}catch{}else if(e==="google")try{typeof ExitApi!="undefined"&&(M=ui)}catch{}else if(e==="mintegral")window.gameReady&&(M=gi);else if(e==="tapjoy")window.TJ_API&&(M=fi);else if(e==="tiktok")window.openAppStore&&(M=hi);else if(e==="smadex")try{window.smxTracking&&(M=mi)}catch{}else if(e==="snapchat")try{window.ScPlayableAd&&(M=bi)}catch{}else e==="vungle"?M=yi:(n==="nucleo"||e==="nucleo")&&(M=vi)}var vt=mt(require("lottie-web"),1),_i=vt.default;typeof window!="undefined"&&(window.lottie=vt.default,window.__baseLottie=vt.default);Xt();function $(n,e){let t=(a,r)=>r===0?a:t(r,a%r),i=t(n,e);return`${n/i}:${e/i}`}var xs=[{id:"iphone-15-pro-max",label:"iPhone 15 Pro Max",width:430,height:932,category:"iphone",ratio:$(430,932)},{id:"iphone-15-pro",label:"iPhone 15 Pro",width:393,height:852,category:"iphone",ratio:$(393,852)},{id:"iphone-15",label:"iPhone 15",width:393,height:852,category:"iphone",ratio:$(393,852)},{id:"iphone-14",label:"iPhone 14",width:390,height:844,category:"iphone",ratio:$(390,844)},{id:"iphone-se",label:"iPhone SE",width:375,height:667,category:"iphone",ratio:$(375,667)},{id:"iphone-12-mini",label:"iPhone 12 Mini",width:360,height:780,category:"iphone",ratio:$(360,780)}],ws=[{id:"pixel-8-pro",label:"Pixel 8 Pro",width:448,height:998,category:"android",ratio:$(448,998)},{id:"pixel-8",label:"Pixel 8",width:412,height:915,category:"android",ratio:$(412,915)},{id:"samsung-s24-ultra",label:"Samsung S24 Ultra",width:412,height:915,category:"android",ratio:$(412,915)},{id:"samsung-s24",label:"Samsung S24",width:360,height:780,category:"android",ratio:$(360,780)},{id:"samsung-a54",label:"Samsung A54",width:412,height:915,category:"android",ratio:$(412,915)},{id:"oneplus-12",label:"OnePlus 12",width:412,height:915,category:"android",ratio:$(412,915)}],Es=[{id:"ipad-pro-12",label:'iPad Pro 12.9"',width:1024,height:1366,category:"tablet",ratio:$(1024,1366)},{id:"ipad-pro-11",label:'iPad Pro 11"',width:834,height:1194,category:"tablet",ratio:$(834,1194)},{id:"ipad-air",label:"iPad Air",width:820,height:1180,category:"tablet",ratio:$(820,1180)},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"tablet",ratio:$(768,1024)},{id:"samsung-tab-s9",label:"Samsung Tab S9",width:800,height:1280,category:"tablet",ratio:$(800,1280)}],Oi=[{id:"playable-portrait",label:"Playable Portrait",width:320,height:480,category:"playable",ratio:"2:3",mraidScale:1},{id:"mraid-320x480",label:"MRAID 320\xD7480",width:320,height:480,category:"playable",ratio:"2:3",mraidScale:1},{id:"iphone-14",label:"iPhone 14",width:390,height:844,category:"playable",ratio:$(390,844),mraidScale:.7},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"playable",ratio:$(768,1024),mraidScale:.7}];var As=[...Oi];var za=Oi[0];ue();var Ga=mt(require("jszip"),1);function Ba(n){return new Promise((e,t)=>{let i=new FileReader;i.onerror=()=>t(new Error("FileReader failed")),i.onload=()=>e(String(i.result||"")),i.readAsDataURL(n)})}function Fa(n){var a;let[e,t]=n.split(","),i=e==null?void 0:e.match(/data:(.*?);base64/);return{base64:t!=null?t:"",mimeType:(a=i==null?void 0:i[1])!=null?a:"image/png"}}async function Ua(n){return await new Promise(e=>{let t=new Image;t.onload=()=>e({width:t.naturalWidth||t.width,height:t.naturalHeight||t.height}),t.onerror=()=>e(null),t.src=n})}async function Jt(n){var e,t;try{console.log("[ImageUtils] Fetching image data from URL:",n);let i=await fetch(n);if(!i.ok)return console.warn("[ImageUtils] Fetch failed with status:",i.status,n),null;let a=await i.blob();console.log("[ImageUtils] Blob received, size:",a.size,"type:",a.type);let r=await Ba(a),s=await Ua(r),o=Fa(r);return console.log("[ImageUtils] Success resolution:",s==null?void 0:s.width,"x",s==null?void 0:s.height,"mime:",o.mimeType),{base64:o.base64,mimeType:o.mimeType,dataUrl:r,width:(e=s==null?void 0:s.width)!=null?e:0,height:(t=s==null?void 0:s.height)!=null?t:0}}catch(i){return console.error("[ImageUtils] Error fetching image data:",i),null}}async function xt(n,e=30){try{console.log("[ImageUtils] Removing background color...");let t=await new Promise((l,p)=>{let g=new Image;g.onload=()=>l(g),g.onerror=()=>p(new Error("Failed to load image")),g.src=n}),i=document.createElement("canvas");i.width=t.width,i.height=t.height;let a=i.getContext("2d");if(!a)return console.error("[ImageUtils] Failed to get canvas context"),n;a.drawImage(t,0,0);let r=a.getImageData(0,0,i.width,i.height),s=r.data,d=[{name:"top-left",offset:0},{name:"top-right",offset:(i.width-1)*4},{name:"bottom-left",offset:(i.height-1)*i.width*4},{name:"bottom-right",offset:((i.height-1)*i.width+(i.width-1))*4}].map(l=>({r:s[l.offset],g:s[l.offset+1],b:s[l.offset+2]})),c=0;for(let l=0;l<s.length;l+=4){let p=s[l],g=s[l+1],m=s[l+2],h=!1;for(let A of d)if(Math.sqrt(Math.pow(p-A.r,2)+Math.pow(g-A.g,2)+Math.pow(m-A.b,2))<e){h=!0;break}h&&(s[l+3]=0,c++)}return console.log(`[ImageUtils] Removed background from ${c} pixels (4-corner sampling, tolerance: ${e})`),a.putImageData(r,0,0),i.toDataURL("image/png")}catch(t){return console.error("[ImageUtils] Error removing background:",t),n}}var Ii=require("@google/genai");async function Zt(n,e,t=[],i={}){var a,r,s,o,d,c,u;try{if(!(n!=null&&n.trim()))throw new Error("Gemini API key is required");if(!(e!=null&&e.trim()))throw new Error("Prompt is required");for(let b=0;b<t.length;b++){let f=t[b];if(!f.base64||!f.mimeType)throw new Error(`Image ${b+1} is missing required data`);if(f.base64.length<1e3&&console.warn(`Image ${b+1} data appears very small, may be corrupted`),!f.mimeType.startsWith("image/"))throw new Error(`Image ${b+1} has invalid MIME type: ${f.mimeType}`)}let l=new Ii.GoogleGenAI({apiKey:n}),p="gemini-2.5-flash",g=[e];t.length>0&&t.forEach((b,f)=>{g.push({inlineData:{data:b.base64,mimeType:b.mimeType}}),console.log(`[Gemini] Added image ${f+1}: ${b.mimeType}, size: ${Math.round(b.base64.length/1024)}KB`)}),console.log(`[Gemini] Making request with ${t.length} images and prompt length: ${e.length}`);let m=await l.models.generateContent({model:p,contents:g}),h="",A=(s=(r=(a=m.candidates)==null?void 0:a[0])==null?void 0:r.content)==null?void 0:s.parts;if(A)for(let b of A)b.text&&(h+=b.text);if(!h.trim())throw new Error("Empty response from Gemini API");return console.log(`[Gemini] Response received, length: ${h.length}`),h}catch(l){throw console.error("[Gemini] API error:",l),(o=l.message)!=null&&o.includes("Unable to process input image")?new Error("Unable to process the uploaded image. Please ensure it's a valid PNG, JPG, or JPEG file under 10MB and not corrupted."):(d=l.message)!=null&&d.includes("API_KEY_INVALID")?new Error("Invalid Gemini API key. Please check your API key configuration."):(c=l.message)!=null&&c.includes("QUOTA_EXCEEDED")?new Error("Gemini API quota exceeded. Please try again later or check your billing."):(u=l.message)!=null&&u.includes("SAFETY")?new Error("Content was flagged by Gemini safety filters. Please try with different images."):l}}var Ri=require("@google/genai");async function wt(n,e,t=[],i={}){try{console.info("[GEMINI-REAL-SDK] Initializing GoogleGenAI...");let a=new Ri.GoogleGenAI({apiKey:n}),r=[{text:e}];t.length>0&&t.forEach((o,d)=>{console.info(`[GEMINI-REAL-SDK] Adding image part ${d}`),r.push({inlineData:{mimeType:o.mimeType,data:o.base64}})}),console.info("[GEMINI-REAL-SDK] Calling generateContent with model: gemini-2.5-flash-image");let s=await a.models.generateContent({model:"gemini-2.5-flash-image",contents:r});if(console.info("[GEMINI-REAL-SDK] Received response from model"),!s.candidates||!s.candidates[0]||!s.candidates[0].content||!s.candidates[0].content.parts)throw new Error("Gemini 2.5 Flash Image returned invalid response structure.");for(let o of s.candidates[0].content.parts)if(o.text)console.log(o.text);else if(o.inlineData){let d=o.inlineData.data,c=o.inlineData.mimeType||"image/png";return console.info("[GEMINI-REAL-SDK] Found inline image data in response"),`data:${c};base64,${d}`}throw new Error("Gemini 2.5 Flash Image returned no image data.")}catch(a){throw console.error("[GEMINI-REAL-SDK] Error in generateImageWithGemini25Flash:",JSON.stringify(a,Object.getOwnPropertyNames(a),2)),a}}var Xa=require("pixi.js");Je();ue();var Hi=require("pixi.js");var Ja=require("pixi.js");ue();function ar(n){return new Promise((e,t)=>{let i=new FileReader;i.onerror=()=>t(new Error("FileReader failed")),i.onload=()=>e(String(i.result||"")),i.readAsDataURL(n)})}function rr(n){var a;let[e,t]=n.split(","),i=e==null?void 0:e.match(/data:(.*?);base64/);return{base64:t!=null?t:"",mimeType:(a=i==null?void 0:i[1])!=null?a:"image/png"}}function sr(n){return`
47
47
  Analyze these screenshots of a brand or game and extract its "Brand DNA".
48
48
 
49
49
  Provide a concise summary (2-3 sentences) covering:
@@ -163,6 +163,27 @@
163
163
  background: var(--ui-bg);
164
164
  }
165
165
 
166
+ /* Scene Tools Container - Dynamically positioned relative to game preview */
167
+ #scene-tools-container {
168
+ position: absolute;
169
+ /* left, top, and transform will be set dynamically by JavaScript */
170
+ z-index: 60;
171
+ pointer-events: auto;
172
+ transition: left var(--ui-duration-fast) var(--ui-ease),
173
+ top var(--ui-duration-fast) var(--ui-ease);
174
+ }
175
+
176
+ /* Nudge Panel Container - Dynamically positioned relative to game preview */
177
+ #nudge-panel-container {
178
+ position: absolute;
179
+ /* left, top, and transform will be set dynamically by JavaScript */
180
+ z-index: 60;
181
+ pointer-events: auto;
182
+ transition: left var(--ui-duration-fast) var(--ui-ease),
183
+ top var(--ui-duration-fast) var(--ui-ease);
184
+ }
185
+
186
+
166
187
  .preview-container {
167
188
  width: 100%;
168
189
  height: 100%;
@@ -4643,12 +4664,10 @@
4643
4664
 
4644
4665
 
4645
4666
  /* ========== 13-nudge-panel.css ========== */
4646
- /* Nudge Panel - Floating on left side */
4667
+ /* Nudge Panel - Dynamically positioned relative to game preview */
4647
4668
  .nudge-panel {
4648
4669
  position: absolute;
4649
- left: 16px;
4650
- top: 50%;
4651
- transform: translateY(-50%);
4670
+ /* left, top, and transform will be set dynamically by JavaScript */
4652
4671
  width: 180px;
4653
4672
  background: var(--ui-surface);
4654
4673
  border: 1px solid var(--ui-border);
@@ -4656,7 +4675,9 @@
4656
4675
  box-shadow: var(--ui-shadow);
4657
4676
  z-index: 60;
4658
4677
  pointer-events: auto;
4659
- transition: opacity var(--ui-duration-fast) var(--ui-ease);
4678
+ transition: left var(--ui-duration-fast) var(--ui-ease),
4679
+ top var(--ui-duration-fast) var(--ui-ease),
4680
+ opacity var(--ui-duration-fast) var(--ui-ease);
4660
4681
  }
4661
4682
 
4662
4683
  .nudge-panel.hidden {
@@ -1 +1 @@
1
- (function(_0x85f116,_0x3cbe3d){var a0_0x57f6b3={_0x18bdec:0x1ec,_0x44f34d:'YFbR',_0x1d3a3c:0x202,_0x186f84:0x1f9,_0xa23dd3:0x4d1,_0x2140d5:0x4ce,_0x3d7d27:'LsaF',_0x260917:0x4d2,_0x123724:0x4bf,_0x1df236:0x4c0,_0x122a9c:'96]C',_0x2f2ea7:0x4d0,_0x403d47:'oPyi',_0x1a29bb:0x4d1,_0x152cd7:0x4d8,_0x2b58a4:'7Afb',_0x247917:0x4c2,_0xceb7ff:0x4c9,_0x532498:0x4d7,_0x3a154c:0x4c6,_0x4b0692:0x4c6,_0x4260e1:'GJ5#',_0x1ec50b:0x4d0,_0x40e249:0x4c8,_0x2774c2:0x4c3,_0x1a423c:0x4b3,_0x3b5080:'y##2'},a0_0x40149c={_0x4969a9:0x95},a0_0x37a1f8={_0x3171df:0x35f};function _0x464782(_0x46914f,_0x444251,_0x5b746b,_0x3a1b92,_0x251aa7){return a0_0x231b(_0x251aa7- -0x108,_0x444251);}function _0x2ebb7d(_0x2c440d,_0x131393,_0x5730bf,_0x1da468,_0x30d30f){return a0_0x231b(_0x131393-a0_0x37a1f8._0x3171df,_0x30d30f);}var _0x9af144=_0x85f116();function _0x1c872c(_0x53cdc7,_0x191ad3,_0x37341d,_0x5e9bea,_0x33b443){return a0_0x231b(_0x33b443-a0_0x40149c._0x4969a9,_0x37341d);}while(!![]){try{var _0x2d7cae=parseInt(_0x1c872c(0x1fb,a0_0x57f6b3._0x18bdec,a0_0x57f6b3._0x44f34d,a0_0x57f6b3._0x1d3a3c,a0_0x57f6b3._0x186f84))/(-0x76d+-0x58*0x27+0x14d6)*(-parseInt(_0x2ebb7d(0x4c3,a0_0x57f6b3._0xa23dd3,0x4c2,a0_0x57f6b3._0x2140d5,a0_0x57f6b3._0x3d7d27))/(0xc8e*-0x2+-0xad*0x2b+0x362d))+-parseInt(_0x2ebb7d(a0_0x57f6b3._0x260917,0x4cb,a0_0x57f6b3._0x123724,a0_0x57f6b3._0x1df236,a0_0x57f6b3._0x122a9c))/(0x260+0xe3a*0x1+0x1097*-0x1)*(-parseInt(_0x2ebb7d(a0_0x57f6b3._0x2f2ea7,0x4dc,0x4e1,0x4dd,a0_0x57f6b3._0x403d47))/(-0x2*0x1365+-0x2*-0x267+0x220*0x10))+parseInt(_0x2ebb7d(a0_0x57f6b3._0x1a29bb,a0_0x57f6b3._0x152cd7,0x4e4,0x4dc,a0_0x57f6b3._0x2b58a4))/(-0x1247*-0x1+0x1bb5+-0x2df7)+parseInt(_0x2ebb7d(a0_0x57f6b3._0x247917,a0_0x57f6b3._0xceb7ff,0x4ba,a0_0x57f6b3._0x532498,'GdeP'))/(0x2*-0xdb7+0x5cf*-0x1+0x2143)+parseInt(_0x2ebb7d(0x4c5,a0_0x57f6b3._0x3a154c,a0_0x57f6b3._0x4b0692,0x4bc,a0_0x57f6b3._0x4260e1))/(0x4c4+-0x1f95+0x1ad8)+-parseInt(_0x2ebb7d(0x4c6,a0_0x57f6b3._0x1ec50b,a0_0x57f6b3._0x40e249,a0_0x57f6b3._0x2774c2,'Xvh*'))/(-0x5*-0x2dd+-0x55f+-0x8ea)+-parseInt(_0x2ebb7d(a0_0x57f6b3._0x1a423c,a0_0x57f6b3._0x247917,0x4ce,a0_0x57f6b3._0x2774c2,a0_0x57f6b3._0x3b5080))/(0x1718+-0x1*-0x1883+-0x2f92);if(_0x2d7cae===_0x3cbe3d)break;else _0x9af144['push'](_0x9af144['shift']());}catch(_0x209e46){_0x9af144['push'](_0x9af144['shift']());}}}(a0_0x29af,-0x170f4f*0x1+-0x50dae*0x2+-0x2a859*-0x12));function a0_0x231b(_0x45ff20,_0x5181d0){_0x45ff20=_0x45ff20-(0x1de0+-0x19d1+-0x2ac);var _0x3249f6=a0_0x29af();var _0xdc96e6=_0x3249f6[_0x45ff20];if(a0_0x231b['IeDsGd']===undefined){var _0x15fb86=function(_0x41b2f2){var _0x5220eb='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0x52424e='',_0x208d0a='',_0x3581d6=_0x52424e+_0x15fb86;for(var _0x92494a=-0x4eb+0x179*-0x7+0xf3a,_0x74206e,_0x2372b2,_0x235f26=-0x41*0x2d+-0x1*0x10e5+-0x91*-0x32;_0x2372b2=_0x41b2f2['charAt'](_0x235f26++);~_0x2372b2&&(_0x74206e=_0x92494a%(0x206b+0x1019+0x4*-0xc20)?_0x74206e*(0x6*-0x566+-0x14b+0x21ef)+_0x2372b2:_0x2372b2,_0x92494a++%(-0x1ff0+0x772*-0x1+0x2766))?_0x52424e+=_0x3581d6['charCodeAt'](_0x235f26+(-0x2a5*0x1+-0x191*0xb+0x13ea))-(0x10fd+0x3*-0xd5+0x94*-0x19)!==-0x1e4+-0x106b+0x6d*0x2b?String['fromCharCode'](-0x2a+-0x1654+0x35b*0x7&_0x74206e>>(-(0x1841+0xba8+-0x23e7)*_0x92494a&0x71*0x37+0x7c3+-0x2004)):_0x92494a:-0x3*-0xa15+-0x1030+-0x1*0xe0f){_0x2372b2=_0x5220eb['indexOf'](_0x2372b2);}for(var _0x412a02=-0x270f+-0x131+0x1*0x2840,_0x29228b=_0x52424e['length'];_0x412a02<_0x29228b;_0x412a02++){_0x208d0a+='%'+('00'+_0x52424e['charCodeAt'](_0x412a02)['toString'](0x19e3+-0x436+-0x159d))['slice'](-(0xf6*0x1d+0x1f97+-0x3b73));}return decodeURIComponent(_0x208d0a);};var _0x32da82=function(_0x406421,_0x190f74){var _0x164d6b=[],_0x25465c=0x8b9+0x1*0x21d9+-0x2a92,_0x4be023,_0x4d9a8a='';_0x406421=_0x15fb86(_0x406421);var _0x11d129;for(_0x11d129=0x777+-0x23fe*-0x1+-0x5*0x8b1;_0x11d129<0x1887+-0x3a2+-0x1cf*0xb;_0x11d129++){_0x164d6b[_0x11d129]=_0x11d129;}for(_0x11d129=0x17*-0x10f+0x17b+0x16de;_0x11d129<0xe42+0x8*0x2fa+-0x2512;_0x11d129++){_0x25465c=(_0x25465c+_0x164d6b[_0x11d129]+_0x190f74['charCodeAt'](_0x11d129%_0x190f74['length']))%(-0x8*-0xdd+0x23f9+0x29e1*-0x1),_0x4be023=_0x164d6b[_0x11d129],_0x164d6b[_0x11d129]=_0x164d6b[_0x25465c],_0x164d6b[_0x25465c]=_0x4be023;}_0x11d129=-0x59*0x48+0x17e*0x1+0x178a*0x1,_0x25465c=0x1*-0x2383+-0x137*-0x9+0x1*0x1894;for(var _0x319887=0x1ee9+-0xb4b+-0x139e;_0x319887<_0x406421['length'];_0x319887++){_0x11d129=(_0x11d129+(0x74c*-0x2+0xaef*-0x1+-0x4c*-0x56))%(0x2*-0x824+0x1cf7+-0xbaf),_0x25465c=(_0x25465c+_0x164d6b[_0x11d129])%(-0x51*-0x71+0x7b9*-0x3+-0xb96),_0x4be023=_0x164d6b[_0x11d129],_0x164d6b[_0x11d129]=_0x164d6b[_0x25465c],_0x164d6b[_0x25465c]=_0x4be023,_0x4d9a8a+=String['fromCharCode'](_0x406421['charCodeAt'](_0x319887)^_0x164d6b[(_0x164d6b[_0x11d129]+_0x164d6b[_0x25465c])%(-0x1a*0xe8+0x461*-0x4+0x2a14*0x1)]);}return _0x4d9a8a;};a0_0x231b['qSTize']=_0x32da82,a0_0x231b['henvPR']={},a0_0x231b['IeDsGd']=!![];}var _0x121a37=_0x3249f6[-0x2ba*0xd+0x314+0x205e*0x1],_0xe352e5=_0x45ff20+_0x121a37,_0x28991f=a0_0x231b['henvPR'][_0xe352e5];if(!_0x28991f){if(a0_0x231b['MgxoGT']===undefined){var _0x2dfceb=function(_0x1a6796){this['YAoQLI']=_0x1a6796,this['hmhlyS']=[0x1a52+-0x2042+0x5f1,0x26ba+0x1af*-0xc+0x2*-0x943,0x31d*0xb+0x47*-0xd+-0x1ea4],this['cCiLcP']=function(){return'newState';},this['nyYtmW']='\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*',this['BqSyqP']='[\x27|\x22].+[\x27|\x22];?\x20*}';};_0x2dfceb['prototype']['nRKEXn']=function(){var _0xa37446=new RegExp(this['nyYtmW']+this['BqSyqP']),_0x1f43be=_0xa37446['test'](this['cCiLcP']['toString']())?--this['hmhlyS'][-0x13d3+-0x76d+-0x1b41*-0x1]:--this['hmhlyS'][-0x16bf+0xc8e*-0x2+-0x2fdb*-0x1];return this['wXbYYK'](_0x1f43be);},_0x2dfceb['prototype']['wXbYYK']=function(_0x3f241a){if(!Boolean(~_0x3f241a))return _0x3f241a;return this['BeVQEl'](this['YAoQLI']);},_0x2dfceb['prototype']['BeVQEl']=function(_0x26155a){for(var _0x50b2de=-0x5*0x81+0x130*0x2+0x25*0x1,_0x21ed30=this['hmhlyS']['length'];_0x50b2de<_0x21ed30;_0x50b2de++){this['hmhlyS']['push'](Math['round'](Math['random']())),_0x21ed30=this['hmhlyS']['length'];}return _0x26155a(this['hmhlyS'][-0x2*0x1365+-0x2*-0x267+0x2d5*0xc]);},new _0x2dfceb(a0_0x231b)['nRKEXn'](),a0_0x231b['MgxoGT']=!![];}_0xdc96e6=a0_0x231b['qSTize'](_0xdc96e6,_0x5181d0),a0_0x231b['henvPR'][_0xe352e5]=_0xdc96e6;}else _0xdc96e6=_0x28991f;return _0xdc96e6;}var a0_0x107814=(function(){var _0x112360=!![];return function(_0x3182a2,_0x314094){var a0_0x586b20={_0x24dc8f:0x3b7,_0x430aa6:0x3c6,_0x1fc0b2:'C4lx',_0x21943d:0x3bc},_0x15f3db=_0x112360?function(){var a0_0x5899b6={_0x32ae23:0x23d};function _0x31c060(_0x82b882,_0x4cbbe6,_0x4d7a96,_0x1ad6eb,_0xeec3b3){return a0_0x231b(_0xeec3b3-a0_0x5899b6._0x32ae23,_0x1ad6eb);}if(_0x314094){var _0x388f0f=_0x314094[_0x31c060(a0_0x586b20._0x24dc8f,0x3be,a0_0x586b20._0x430aa6,a0_0x586b20._0x1fc0b2,a0_0x586b20._0x21943d)](_0x3182a2,arguments);return _0x314094=null,_0x388f0f;}}:function(){};return _0x112360=![],_0x15f3db;};}()),a0_0x2ead86=a0_0x107814(this,function(){var a0_0x160591={_0x14d16c:'!Hrq',_0x4a4e2a:0x181,_0x4777cc:0x183,_0xe9e54b:0x18b,_0x1e517f:0x1f1,_0x5c6514:0x1e0,_0x189b22:'GdeP',_0x5e1eba:0x1ef,_0x53c87a:'C4lx',_0x22e63c:0x182,_0xf0e8f3:0x18b,_0x3e4587:0x19c,_0x298dd1:0x1f2,_0x59a171:0x1dd,_0x4d00f6:'%pR9',_0x511f67:0x1e5,_0x140046:'a(aQ',_0x46ed8d:0x54c,_0x3e5c06:0x20b,_0x2a70e0:'MYaw',_0x5d81b9:0x1f6,_0xb751a5:0x1fe,_0x28818e:0x1e9,_0x1b7d06:'96]C',_0x18aaae:0x1ee,_0x369e3e:0x1f5,_0x18bcc1:0x1f7,_0x38e885:'x3FX',_0x68fec7:0x1f7,_0x2f9c6e:0x541,_0x5a5586:0x53b,_0x5e330c:0x53e,_0x4cd269:0x1e3,_0x14adeb:0x1f0},a0_0x3c3b37={_0x247735:0x3c5},a0_0x194443={_0x564136:0x304},a0_0x10165f={_0x121375:0x80},_0x59b657={};_0x59b657[_0x4092e3(-0x18f,a0_0x160591._0x14d16c,-a0_0x160591._0x4a4e2a,-a0_0x160591._0x4777cc,-a0_0x160591._0xe9e54b)]='(((.+'+_0xf45ef8(a0_0x160591._0x1e517f,a0_0x160591._0x5c6514,a0_0x160591._0x189b22,0x1e6,a0_0x160591._0x5e1eba)+'+$';function _0xf45ef8(_0x472e1b,_0x184f7a,_0x1e1550,_0x20e414,_0x1b6add){return a0_0x231b(_0x1b6add-a0_0x10165f._0x121375,_0x1e1550);}var _0x3f6af4=_0x59b657;function _0x4092e3(_0xe297dc,_0xe038ee,_0x40e96d,_0x169a32,_0x34a3f1){return a0_0x231b(_0xe297dc- -a0_0x194443._0x564136,_0xe038ee);}function _0x511d7e(_0x145344,_0x17eb0e,_0x1d37fd,_0x5f4bcc,_0x58c491){return a0_0x231b(_0x145344-a0_0x3c3b37._0x247735,_0x17eb0e);}return a0_0x2ead86['toStr'+_0x4092e3(-0x18e,a0_0x160591._0x53c87a,-a0_0x160591._0x22e63c,-a0_0x160591._0xf0e8f3,-a0_0x160591._0x3e4587)]()['searc'+'h'](_0xf45ef8(a0_0x160591._0x298dd1,a0_0x160591._0x59a171,a0_0x160591._0x4d00f6,0x1e5,a0_0x160591._0x511f67)+_0x511d7e(0x540,a0_0x160591._0x140046,a0_0x160591._0x46ed8d,0x53f,0x531)+'+$')[_0xf45ef8(0x1f2,a0_0x160591._0x3e5c06,a0_0x160591._0x2a70e0,a0_0x160591._0x5d81b9,a0_0x160591._0xb751a5)+_0xf45ef8(a0_0x160591._0x28818e,0x1f3,a0_0x160591._0x1b7d06,0x1e6,a0_0x160591._0x18aaae)]()[_0xf45ef8(a0_0x160591._0x369e3e,a0_0x160591._0x18bcc1,a0_0x160591._0x38e885,0x206,a0_0x160591._0x68fec7)+'ructo'+'r'](a0_0x2ead86)[_0x511d7e(a0_0x160591._0x2f9c6e,'3heM',a0_0x160591._0x5a5586,a0_0x160591._0x2f9c6e,a0_0x160591._0x5e330c)+'h'](_0x3f6af4[_0xf45ef8(a0_0x160591._0x28818e,a0_0x160591._0x4cd269,'7Afb',0x1e6,a0_0x160591._0x14adeb)]);});function a0_0x29af(){var _0x33d094=['vHraBCke','WPRcTCkluIy','WQvEpCoGWQBdVCkwd8kfW6Sv','W5T1WPe3WOO','aX8Jtmkg','mdK5WPxdTmk9hSouWR7dGYi','WRldPWiCEcFcHG','W5zQr3DO','W4uFW4GwgSo4Ca8qW6RdSa','W7hdSmkKW73cR8o7AmoLBSkFW6pcKmkrWQa','WQTVBmkoWP9EWOC','W7ldSCkHWPBdSSkcnCkvtG','W7RcRYddNCo4W7dcR0vPWPXXEa','kcFdN8knlaTww8khW7RdSSoOW4C','WQTtr0v9iwddQCos','gCoNWOdcRmknW4/dJCkFWPRcKv9YW5/dQW','W7aofW','W6hcSdRdHSoG','WPVdLSklWOZcOa','WRreW5iLWO1LW6yYifFdL8kEkq','pqmLWR8jW5pdPmoZWQRcLX/dQ8kM','gt/dJCkKl8kfrxxdS8kZmCop','F2PAoCkBDfKqzCochW','WOSGW4lcGmoY','cWe0','hvSjW4ef','rGvvWODcWRGakCogBCkKlKS','W4BcNmo+W6VdVSkThg9EW4bNwWm','cSkpCCk5W5ldU8oAjSoMyseBrq'];a0_0x29af=function(){return _0x33d094;};return a0_0x29af();}a0_0x2ead86();import{A as a0_0x38473d,B as a0_0x2823bf,C as a0_0x38cc2b,D as a0_0x5b9eaf,b as a0_0x51d100,c as a0_0x49ca56,d as a0_0x499d66,e as a0_0x394032,f as a0_0x27fa08,g as a0_0x4da045,h as a0_0x2b4120,i as a0_0x37b8b4,j as a0_0x48a59f,k as a0_0x4c8a1c,l as a0_0x163e43,m as a0_0x11f82a,n as a0_0x317ee0,o as a0_0x531b20,p as a0_0x3dda2d,q as a0_0xef3b6e,r as a0_0x132f17,s as a0_0x411770,t as a0_0x4cc084,u as a0_0x2401b8,v as a0_0x365fde,w as a0_0x3ba7ef,x as a0_0x1785d9,y as a0_0x381e56,z as a0_0x5b97a8}from'../chunk-XSKUGJJF.js';import{a as a0_0x36fe38,b as a0_0x25ef78,c as a0_0x1abb6a,d as a0_0x32241f,e as a0_0x57b7ae}from'../chunk-I5OOVR5U.js';import'../chunk-LV4HGC5G.js';import'../chunk-ZLL42OOV.js';import'../chunk-E6WJCS24.js';import'../chunk-JXBG6UFL.js';export{a0_0x36fe38 as AssetCache,a0_0x1abb6a as AssetLoader,a0_0x2401b8 as AssetSystem,a0_0x32241f as AssetTextures,a0_0x411770 as Assets,a0_0x531b20 as BaseSystem,a0_0x317ee0 as GameEngine,a0_0x394032 as GameObject,a0_0x27fa08 as GameObjectManager,a0_0x11f82a as ObjectFactory,a0_0x499d66 as Renderer,a0_0x3dda2d as RuntimeObjectRegistry,a0_0x49ca56 as Transform,a0_0x2823bf as applyScreenAnchor,a0_0xef3b6e as basePixi,a0_0x3ba7ef as clearResponsiveElements,a0_0x51d100 as createPixiBase,a0_0x48a59f as getRegisteredFontIds,a0_0x365fde as globalResponsiveMultipliers,a0_0x57b7ae as initAssetTextures,a0_0x4cc084 as initAssets,a0_0x38cc2b as layout,a0_0x163e43 as playLottieOverlay,a0_0x37b8b4 as registerFont,a0_0x25ef78 as registerType,a0_0x381e56 as resolveAnchorVec2,a0_0x4da045 as resolveFont,a0_0x2b4120 as resolveFontWeight,a0_0x5b97a8 as resolveScreenAnchorPoint,a0_0x38473d as resolveScreenRatioPoint,a0_0x5b9eaf as runInitSequence,a0_0x4c8a1c as setLottieInstance,a0_0x132f17 as spawnSceneFromConfig,a0_0x1785d9 as updateScreenState};
1
+ (function(_0x1aff11,_0x572d8c){var a0_0x524b57={_0x531677:'@poU',_0x96aaa5:0x130,_0x2a7def:0x12f,_0x25c564:0x273,_0x227b72:0x262,_0x357387:0x25c,_0x5128e3:'8iNc',_0xf9739f:0x124,_0xfed789:0x12f,_0x43c42a:0x133,_0x151466:0x24e,_0x98f393:0x24f,_0x5221ef:0x24e,_0x4bf38d:0x132,_0x7ef639:0x135,_0x21f707:0x133,_0x580527:'D13J',_0x2ede11:0x12b,_0x43c4aa:0x132,_0x3a9d03:'A]iQ',_0x2789ae:0x248,_0x5e22d1:0x258,_0x1fdd1a:0x257,_0x3f07cd:'N@2Y',_0x35dae7:0x269,_0x2c19dc:'WeYn',_0x3c067a:0x24f,_0x46a6b4:0x267,_0x4502f4:0x24a,_0x3db2b5:0x257,_0x428360:'Fg%M',_0x21ed7b:0x123,_0x598604:0x122,_0x1e70b5:0x11f},a0_0x2c3e66={_0x549a21:0x7e},a0_0x4c228f={_0x25826d:0x21c},a0_0x1dec3a={_0x1ac878:0xa4};function _0x5cbbce(_0x4a404d,_0x24d714,_0x196ea7,_0xc5dc6,_0x58918a){return a0_0x5c44(_0x24d714- -a0_0x1dec3a._0x1ac878,_0x4a404d);}var _0x53fdba=_0x1aff11();function _0xdd3ea8(_0x4f604f,_0x5b8315,_0x474837,_0x5af47a,_0x7c994c){return a0_0x5c44(_0x474837-a0_0x4c228f._0x25826d,_0x7c994c);}function _0x26f828(_0x2bad7d,_0x22f09e,_0x86d0a,_0x417c4d,_0x7f81e3){return a0_0x5c44(_0x7f81e3-a0_0x2c3e66._0x549a21,_0x2bad7d);}while(!![]){try{var _0x14a62c=parseInt(_0x5cbbce(a0_0x524b57._0x531677,0x12a,a0_0x524b57._0x96aaa5,0x121,a0_0x524b57._0x2a7def))/(0xd6*-0x8+0x262d*-0x1+-0x2*-0x166f)+parseInt(_0x26f828('$wG9',a0_0x524b57._0x25c564,a0_0x524b57._0x227b72,a0_0x524b57._0x357387,0x263))/(0x1*0xb15+0x4*-0x960+0x1a6d)*(parseInt(_0x5cbbce(a0_0x524b57._0x5128e3,0x128,0x11f,a0_0x524b57._0xf9739f,0x12d))/(-0x2*0x81d+-0x1f+0x574*0x3))+-parseInt(_0x5cbbce(')Q[b',0x13d,a0_0x524b57._0xfed789,0x12d,a0_0x524b57._0x43c42a))/(0x1*-0x1a+0x1d07+0x9a3*-0x3)+parseInt(_0x26f828('LFFv',0x24d,a0_0x524b57._0x151466,a0_0x524b57._0x98f393,a0_0x524b57._0x5221ef))/(-0x9*0xe5+-0x15*-0x185+-0x17d7)*(parseInt(_0x5cbbce('Fg%M',a0_0x524b57._0x4bf38d,a0_0x524b57._0x7ef639,a0_0x524b57._0x21f707,0x123))/(0x4a0*0x5+-0x7c9*-0x1+-0x1ee3))+-parseInt(_0x5cbbce(a0_0x524b57._0x580527,a0_0x524b57._0x2ede11,0x13a,a0_0x524b57._0x43c4aa,0x135))/(0x26*0xcb+-0x1a67*0x1+-0x1*0x3b4)+parseInt(_0x26f828(a0_0x524b57._0x3a9d03,a0_0x524b57._0x2789ae,a0_0x524b57._0x5e22d1,a0_0x524b57._0x1fdd1a,0x24f))/(0x81*0x49+-0xfb8+0x435*-0x5)*(-parseInt(_0x26f828(a0_0x524b57._0x3f07cd,0x270,0x26b,a0_0x524b57._0x35dae7,0x261))/(0x2*0xda3+-0x1*0xe1a+-0xd23))+parseInt(_0x26f828(a0_0x524b57._0x2c19dc,a0_0x524b57._0x3c067a,a0_0x524b57._0x46a6b4,a0_0x524b57._0x4502f4,a0_0x524b57._0x3db2b5))/(0x83+0x197b+-0x97*0x2c)*(parseInt(_0x5cbbce(a0_0x524b57._0x428360,a0_0x524b57._0x21ed7b,a0_0x524b57._0x598604,a0_0x524b57._0x1e70b5,0x12f))/(-0xef0+-0xdfa*0x1+0x1cf5));if(_0x14a62c===_0x572d8c)break;else _0x53fdba['push'](_0x53fdba['shift']());}catch(_0x3911be){_0x53fdba['push'](_0x53fdba['shift']());}}}(a0_0x5353,0xc7a41+0xe11a*0xe+-0xa0183));var a0_0x5b6a2e=(function(){var _0x2e91b4=!![];return function(_0x2ca8ff,_0x5ae705){var a0_0xfbb33d={_0x185925:'8iNc',_0x3c8510:0x5ae,_0x35c4e9:0x5b2,_0x5c5691:0x5a7,_0x1f9281:0x5a2},a0_0x21b741={_0x5f44a9:0x3c3},_0x4ea057=_0x2e91b4?function(){function _0x478615(_0x35565a,_0x3e51e1,_0x9f3d6f,_0x3cc0f6,_0x395ae7){return a0_0x5c44(_0x3cc0f6-a0_0x21b741._0x5f44a9,_0x35565a);}if(_0x5ae705){var _0x1eb0d2=_0x5ae705[_0x478615(a0_0xfbb33d._0x185925,a0_0xfbb33d._0x3c8510,a0_0xfbb33d._0x35c4e9,a0_0xfbb33d._0x5c5691,a0_0xfbb33d._0x1f9281)](_0x2ca8ff,arguments);return _0x5ae705=null,_0x1eb0d2;}}:function(){};return _0x2e91b4=![],_0x4ea057;};}()),a0_0x3c2363=a0_0x5b6a2e(this,function(){var a0_0x50b56d={_0x443f09:0x561,_0x185e78:'VF9n',_0x30914a:0x55e,_0x31b18c:0x556,_0x418fad:0x555,_0x27a31d:'cND4',_0x387b37:0x562,_0x3384a2:0x59c,_0x1a572f:'J6Fp',_0x579f67:0x5a2,_0x1d511d:0x5a3,_0x3fd53d:0x56a,_0x2ad6b5:0x567,_0x3edb78:'7*LI',_0x2e02ac:0x570,_0x1cddd5:0x55f,_0x1d320b:0x559,_0x44965a:0x56d,_0x580ee2:'xNqR',_0x19d95f:0x552,_0x128725:0x28d,_0x52ef39:'vJfR',_0x11771d:0x289,_0x3a8dc2:0x292,_0x304e35:0x298,_0x3018bc:0x29c,_0x58ff01:0x295,_0x1c6c3f:0x295,_0x3bc85d:0x5a1,_0xf26067:0x5a4,_0x4780e3:0x5b1,_0x463f27:0x5a8,_0x50f7bd:0x554,_0x324768:0x55b,_0x28c03f:'@poU',_0x30920e:0x54a,_0x3d7ec5:0x5aa,_0x2b1d01:'$wG9',_0x5b940c:0x59e,_0x5d6fa3:0x5a6},a0_0x10964c={_0x36e444:0xb3};function _0x46ce62(_0x28e0ed,_0x1e99f3,_0x351c38,_0x1a1fdb,_0x4a5a08){return a0_0x5c44(_0x28e0ed-0x38c,_0x1a1fdb);}function _0x425ea2(_0x2aae6e,_0x2ee6aa,_0x2b2bc4,_0x563071,_0xa5cc3d){return a0_0x5c44(_0x2aae6e-0x3ca,_0x2b2bc4);}function _0x46f28f(_0x49fa10,_0x3fe91c,_0x419ac5,_0x47c331,_0x194420){return a0_0x5c44(_0x47c331-a0_0x10964c._0x36e444,_0x3fe91c);}return a0_0x3c2363[_0x46ce62(a0_0x50b56d._0x443f09,0x566,a0_0x50b56d._0x443f09,a0_0x50b56d._0x185e78,a0_0x50b56d._0x30914a)+_0x46ce62(a0_0x50b56d._0x31b18c,a0_0x50b56d._0x443f09,a0_0x50b56d._0x418fad,a0_0x50b56d._0x27a31d,a0_0x50b56d._0x387b37)]()[_0x425ea2(a0_0x50b56d._0x3384a2,0x5ac,a0_0x50b56d._0x1a572f,a0_0x50b56d._0x579f67,a0_0x50b56d._0x1d511d)+'h'](_0x46ce62(a0_0x50b56d._0x3fd53d,a0_0x50b56d._0x2ad6b5,0x55f,a0_0x50b56d._0x3edb78,a0_0x50b56d._0x2e02ac)+_0x46ce62(a0_0x50b56d._0x1cddd5,a0_0x50b56d._0x1d320b,a0_0x50b56d._0x44965a,a0_0x50b56d._0x580ee2,a0_0x50b56d._0x19d95f)+'+$')[_0x46f28f(a0_0x50b56d._0x128725,a0_0x50b56d._0x52ef39,a0_0x50b56d._0x11771d,a0_0x50b56d._0x3a8dc2,a0_0x50b56d._0x304e35)+_0x46f28f(a0_0x50b56d._0x304e35,')86K',a0_0x50b56d._0x3018bc,a0_0x50b56d._0x58ff01,a0_0x50b56d._0x1c6c3f)]()[_0x425ea2(a0_0x50b56d._0x3bc85d,a0_0x50b56d._0xf26067,'j3!W',a0_0x50b56d._0x4780e3,a0_0x50b56d._0x463f27)+'ructo'+'r'](a0_0x3c2363)['searc'+'h'](_0x46ce62(a0_0x50b56d._0x50f7bd,a0_0x50b56d._0x324768,0x557,a0_0x50b56d._0x28c03f,a0_0x50b56d._0x30920e)+_0x425ea2(a0_0x50b56d._0x3d7ec5,0x5a2,a0_0x50b56d._0x2b1d01,a0_0x50b56d._0x5b940c,a0_0x50b56d._0x5d6fa3)+'+$');});a0_0x3c2363();import{A as a0_0x44995f,B as a0_0x5234f8,C as a0_0x42f58b,D as a0_0x3a90b1,b as a0_0x43228b,c as a0_0x3db3ae,d as a0_0x347861,e as a0_0x123b76,f as a0_0xd5934d,g as a0_0x3f5a39,h as a0_0x785fe4,i as a0_0x58681a,j as a0_0x5434d4,k as a0_0x32c73e,l as a0_0x32e191,m as a0_0x1d31e3,n as a0_0x221714,o as a0_0x40d0c3,p as a0_0x55aeb3,q as a0_0x2d79c8,r as a0_0x44dc7f,s as a0_0x318ef6,t as a0_0x12c846,u as a0_0x1b1d58,v as a0_0x3344d8,w as a0_0x159fb6,x as a0_0x232f57,y as a0_0x5ebee9,z as a0_0x42d703}from'../chunk-MNKEHT3M.js';function a0_0x5353(){var _0x597940=['fmkNW7ndeuSkhgddGW','WRWGaI58W6L0cCotW6vkW4bx','kNCDkx7dMSkN','vSkuW54ktq','WP0TW4K/WP0','B8ovW5dcKCof','Fs/dJ8ofFmk+Ec5Ey8kmWQbL','tmo4WQu','W6tdVmongSoWW4FcQSoO','W4RdKtDBWQy','DmkXWP3dOSkMpCk5','WRdcPCoIW67dN0PZAhxdLmk7Cq','mSorp8kAomkEBbldSGy','cgRcPCkcga','WRDEnWLjW58jW6hcTmkpWPXZW50','E8oPW7u','kmk2WRz4WRvTfSkbACoAfmk7W4u','WPNcKxudW6/cVvSwWPa3C1ddIW','W7JcSSoxWP1iB1rjqSo8l8keEq','ghBcVmkAcSk1gCkramoPW5hdVG','cSoYW4vgW5O7DeNcG1rGxCk3fq','kCk2W5ebW5qXz8k/','WRGQbcHZW6L6bSoSW4PKW713','WOvRzupdTa','DcdcN3hcOa','W7ZcSSkYW4aCcH5l','WO7dGCoyWOJdQW','mSosomkyv8o+ethdLXHmiCox','FCoWrb9q','zt/cH2ZcSmoEW7upWOK8WQBdMG','WQ1DW558W4n9W7ldLZzaW6JcGq','WOr1oCkJp19oW5W'];a0_0x5353=function(){return _0x597940;};return a0_0x5353();}import{a as a0_0x5d41ab,b as a0_0x12ddbc,c as a0_0x5d6050,d as a0_0x16066d,e as a0_0x499b58}from'../chunk-I5OOVR5U.js';import'../chunk-LV4HGC5G.js';import'../chunk-ZLL42OOV.js';import'../chunk-E6WJCS24.js';import'../chunk-JXBG6UFL.js';function a0_0x5c44(_0x4be9b5,_0x393152){_0x4be9b5=_0x4be9b5-(0x1*0xeb9+0xa4e*-0x2+0x9*0xda);var _0x3f65f3=a0_0x5353();var _0x57c5db=_0x3f65f3[_0x4be9b5];if(a0_0x5c44['wMQCRv']===undefined){var _0x528216=function(_0x5c49e8){var _0x4464e5='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0x44d6c0='',_0x46d86b='',_0x472a46=_0x44d6c0+_0x528216;for(var _0x2d7c5e=-0x3df*-0x2+-0xec1+0x5*0x167,_0x5c95d5,_0x1c80b9,_0x3433e5=-0x163*-0x19+-0x1*-0xae1+0x247*-0x14;_0x1c80b9=_0x5c49e8['charAt'](_0x3433e5++);~_0x1c80b9&&(_0x5c95d5=_0x2d7c5e%(-0x1*0x1a32+0x1263*0x1+0x7d3)?_0x5c95d5*(-0x203+-0x1912+-0x1b55*-0x1)+_0x1c80b9:_0x1c80b9,_0x2d7c5e++%(-0xf*-0x53+-0x8b0*0x4+0x1de7))?_0x44d6c0+=_0x472a46['charCodeAt'](_0x3433e5+(-0x1b62+0x1*-0x45d+0x67*0x4f))-(-0x13*-0x72+0x1106+-0x1972)!==-0x111e*-0x2+0x1183+-0x1*0x33bf?String['fromCharCode'](-0x833+-0x2242+0x2b74&_0x5c95d5>>(-(0xc31+-0x3b*-0x4a+-0x1d3d)*_0x2d7c5e&-0x3b*-0x90+-0xe*0xc1+-0x169c)):_0x2d7c5e:-0x28c*0x4+-0x16*-0x107+-0xe*0xe3){_0x1c80b9=_0x4464e5['indexOf'](_0x1c80b9);}for(var _0x480495=-0x1d4b+0x445+0xc83*0x2,_0x8bf4dd=_0x44d6c0['length'];_0x480495<_0x8bf4dd;_0x480495++){_0x46d86b+='%'+('00'+_0x44d6c0['charCodeAt'](_0x480495)['toString'](-0x891*-0x2+0x8*0x389+-0x102*0x2d))['slice'](-(-0x1c23+0x291*0x5+0x4*0x3d4));}return decodeURIComponent(_0x46d86b);};var _0xf76512=function(_0x31550d,_0x4f4f27){var _0x50fa32=[],_0x1e7a2b=0x50d*-0x3+-0xb24+0x1*0x1a4b,_0x4fc610,_0x41cb99='';_0x31550d=_0x528216(_0x31550d);var _0x474c05;for(_0x474c05=-0x81*0x2f+-0x10db+0x2*0x1445;_0x474c05<-0x76*-0x51+-0x1*0x179d+-0xcb9;_0x474c05++){_0x50fa32[_0x474c05]=_0x474c05;}for(_0x474c05=0x2368+0x3f*0x67+-0x3cc1*0x1;_0x474c05<0x197c+-0x23d3+0x1*0xb57;_0x474c05++){_0x1e7a2b=(_0x1e7a2b+_0x50fa32[_0x474c05]+_0x4f4f27['charCodeAt'](_0x474c05%_0x4f4f27['length']))%(-0x1567*0x1+0xd76*0x1+0x6d*0x15),_0x4fc610=_0x50fa32[_0x474c05],_0x50fa32[_0x474c05]=_0x50fa32[_0x1e7a2b],_0x50fa32[_0x1e7a2b]=_0x4fc610;}_0x474c05=-0x1f36+0x28+0x636*0x5,_0x1e7a2b=0x35*0x6a+-0x21af+-0x1*-0xbbd;for(var _0x2f918c=0xf22+-0x1b62+-0x1c0*-0x7;_0x2f918c<_0x31550d['length'];_0x2f918c++){_0x474c05=(_0x474c05+(-0x1*-0x7da+0xdc9*0x1+0x8e*-0x27))%(0x1b6d*-0x1+-0x241*-0x1+0x1a2c),_0x1e7a2b=(_0x1e7a2b+_0x50fa32[_0x474c05])%(-0x1fe8+0xc3c+0x17a*0xe),_0x4fc610=_0x50fa32[_0x474c05],_0x50fa32[_0x474c05]=_0x50fa32[_0x1e7a2b],_0x50fa32[_0x1e7a2b]=_0x4fc610,_0x41cb99+=String['fromCharCode'](_0x31550d['charCodeAt'](_0x2f918c)^_0x50fa32[(_0x50fa32[_0x474c05]+_0x50fa32[_0x1e7a2b])%(-0x4c*-0x6a+0x9*0x412+-0x4cb*0xe)]);}return _0x41cb99;};a0_0x5c44['lCUbBA']=_0xf76512,a0_0x5c44['iOJrxd']={},a0_0x5c44['wMQCRv']=!![];}var _0xab6573=_0x3f65f3[0x1e82+-0xb*0x287+0x9*-0x4d],_0x5510d9=_0x4be9b5+_0xab6573,_0x547727=a0_0x5c44['iOJrxd'][_0x5510d9];if(!_0x547727){if(a0_0x5c44['mySRdx']===undefined){var _0xb4a48d=function(_0x304fb9){this['XUCdJE']=_0x304fb9,this['vNLvPC']=[-0xec2+0x2367+-0x14a4,-0x1*-0x206d+0x17f0+-0x385d,0xd6*-0x8+0x262d*-0x1+-0x5*-0x8f9],this['qjdhdA']=function(){return'newState';},this['ycsMRO']='\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*',this['YdazeQ']='[\x27|\x22].+[\x27|\x22];?\x20*}';};_0xb4a48d['prototype']['uTKGOI']=function(){var _0x4ec9bd=new RegExp(this['ycsMRO']+this['YdazeQ']),_0x292af1=_0x4ec9bd['test'](this['qjdhdA']['toString']())?--this['vNLvPC'][0x1*0xb15+0x4*-0x960+0x1a6c]:--this['vNLvPC'][-0x2*0x81d+-0x1f+0x1d1*0x9];return this['YuzZji'](_0x292af1);},_0xb4a48d['prototype']['YuzZji']=function(_0x415439){if(!Boolean(~_0x415439))return _0x415439;return this['zyVoCA'](this['XUCdJE']);},_0xb4a48d['prototype']['zyVoCA']=function(_0x406611){for(var _0x16effd=0x1*-0x1a+0x1d07+0x5c9*-0x5,_0x1d756d=this['vNLvPC']['length'];_0x16effd<_0x1d756d;_0x16effd++){this['vNLvPC']['push'](Math['round'](Math['random']())),_0x1d756d=this['vNLvPC']['length'];}return _0x406611(this['vNLvPC'][-0x9*0xe5+-0x15*-0x185+-0x17dc]);},new _0xb4a48d(a0_0x5c44)['uTKGOI'](),a0_0x5c44['mySRdx']=!![];}_0x57c5db=a0_0x5c44['lCUbBA'](_0x57c5db,_0x393152),a0_0x5c44['iOJrxd'][_0x5510d9]=_0x57c5db;}else _0x57c5db=_0x547727;return _0x57c5db;}export{a0_0x5d41ab as AssetCache,a0_0x5d6050 as AssetLoader,a0_0x1b1d58 as AssetSystem,a0_0x16066d as AssetTextures,a0_0x318ef6 as Assets,a0_0x40d0c3 as BaseSystem,a0_0x221714 as GameEngine,a0_0x123b76 as GameObject,a0_0xd5934d as GameObjectManager,a0_0x1d31e3 as ObjectFactory,a0_0x347861 as Renderer,a0_0x55aeb3 as RuntimeObjectRegistry,a0_0x3db3ae as Transform,a0_0x5234f8 as applyScreenAnchor,a0_0x2d79c8 as basePixi,a0_0x159fb6 as clearResponsiveElements,a0_0x43228b as createPixiBase,a0_0x5434d4 as getRegisteredFontIds,a0_0x3344d8 as globalResponsiveMultipliers,a0_0x499b58 as initAssetTextures,a0_0x12c846 as initAssets,a0_0x42f58b as layout,a0_0x32e191 as playLottieOverlay,a0_0x58681a as registerFont,a0_0x12ddbc as registerType,a0_0x5ebee9 as resolveAnchorVec2,a0_0x3f5a39 as resolveFont,a0_0x785fe4 as resolveFontWeight,a0_0x42d703 as resolveScreenAnchorPoint,a0_0x44995f as resolveScreenRatioPoint,a0_0x3a90b1 as runInitSequence,a0_0x32c73e as setLottieInstance,a0_0x44dc7f as spawnSceneFromConfig,a0_0x232f57 as updateScreenState};
@@ -43,7 +43,7 @@
43
43
  <button class="debug-btn primary" data-modal-apply>Apply</button>
44
44
  </div>
45
45
  </div>
46
- `,this.modal=i}attachModalListeners(){if(!this.modal)return;this.modal.querySelectorAll("[data-modal-close]").forEach(r=>{r.addEventListener("click",()=>this.close())}),this.modal.querySelectorAll("[data-tab]").forEach(r=>{r.addEventListener("click",o=>{let d=o.target.dataset.tab;d&&this.switchTab(d)})});let i=this.modal.querySelector("[data-ai-generate]");i==null||i.addEventListener("click",()=>{this.openAiEditor("generate")});let a=this.modal.querySelector("[data-ai-edit]");a==null||a.addEventListener("click",()=>{this.openAiEditor("edit")});let s=this.modal.querySelector("[data-modal-apply]");s==null||s.addEventListener("click",()=>{this.apply()}),this.modal.addEventListener("click",r=>{r.target===this.modal&&this.close()})}switchTab(e){if(!this.modal)return;this.modal.querySelectorAll("[data-tab]").forEach(a=>{a.classList.toggle("active",a.getAttribute("data-tab")===e)}),this.modal.querySelectorAll("[data-tab-panel]").forEach(a=>{a.classList.toggle("active",a.getAttribute("data-tab-panel")===e)})}openAiEditor(e){let n=window.__openAiEditor;if(typeof n!="function"){alert("AI Editor not available. Please check your setup.");return}let i="";e==="edit"&&this.currentAsset?i=`Edit this image: ${this.currentObjectId}`:i=`Create an image for: ${this.currentObjectId}`,n(this.currentObjectId||"unknown",i,this.currentAsset,{path:this.currentPath,onApply:a=>{this.onApplyCallback&&this.onApplyCallback(a),this.close()}})}apply(){this.onApplyCallback&&this.onApplyCallback("library/placeholder.png"),this.close()}close(){this.modal&&this.modal.parentNode&&this.modal.parentNode.removeChild(this.modal),this.modal=null,this.currentObjectId=null,this.currentPath=null,this.onApplyCallback=null}}});var Ko={};ra(Ko,{AspectClass:()=>In,GameObject:()=>ot,GameObjectManager:()=>$t,Renderer:()=>rt,ResponsiveUISystem:()=>Ge,Transform:()=>st,animateHandClick:()=>xs,animatePanelEntrance:()=>vs,createBrushTexture:()=>_s,createEndGamePanel:()=>ys,createHandTutorial:()=>ws,createThreeBase:()=>fs,createTutorialLabel:()=>Es,getAspectClass:()=>Dt,getRegisteredFontIds:()=>bs,loadAsset:()=>$n,loadCharacterFrames:()=>Ts,registerFont:()=>ms,resolveFont:()=>Z,resolveFontWeight:()=>Q,updateHandAnimation:()=>Ss});module.exports=xr(Ko);var V=ae(require("three"),1);var ge={};function mt(t,e,n=!1){ge[t]||(ge[t]=[]),ge[t].push({fn:e,once:n})}function Xt(t,e){if(ge[t]){if(!e){delete ge[t];return}ge[t]=ge[t].filter(n=>n.fn!==e)}}function bt(t,...e){let n=ge[t];if(n)for(let i of[...n])i.fn(...e),i.once&&Xt(t,i.fn)}function B(t,e){mt(t,e,!0)}var P=null,W=[],ke=null;function da(t){P=t,W=[],ke!==null&&(clearTimeout(ke),ke=null)}function pa(){var t,e,n;return{endpoint:(P==null?void 0:P.endpoint)||"",transport:(P==null?void 0:P.transport)||"beacon",batchSize:(t=P==null?void 0:P.batchSize)!=null?t:10,flushIntervalMs:(e=P==null?void 0:P.flushIntervalMs)!=null?e:300,maxQueue:(n=P==null?void 0:P.maxQueue)!=null?n:200,debug:!!(P!=null&&P.debug)}}async function la(t,e,n,i){let a=JSON.stringify(e);if(n==="beacon"&&typeof navigator!="undefined"&&typeof navigator.sendBeacon=="function")try{let s=navigator.sendBeacon(t,new Blob([a],{type:"application/json"}));i&&console.log("[handler.telemetry] beacon",s,e);return}catch(s){i&&console.warn("[handler.telemetry] beacon failed, fallback to fetch",s)}try{await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:a,keepalive:!0}),i&&console.log("[handler.telemetry] fetch",e)}catch(s){i&&console.warn("[handler.telemetry] fetch failed",s)}}function Jt(t,e){let n=pa();if(e&&n.endpoint){if(W.push(t),W.length>n.maxQueue&&(W=W.slice(W.length-n.maxQueue)),W.length>=n.batchSize){ca();return}ke===null&&(ke=window.setTimeout(()=>{ke=null,ca()},n.flushIntervalMs))}}async function ca(){let t=pa();if(!t.endpoint||W.length===0)return;let e=W.splice(0,t.batchSize);await la(t.endpoint,{events:e},t.transport,t.debug),W.length>0&&await la(t.endpoint,{events:W.splice(0,t.batchSize)},t.transport,t.debug)}function ua(t){return Math.max(0,Math.min(1,t))}function wr(t){let e=String(t!=null?t:"power2.out");if(e==="linear")return n=>n;if(e==="sine.inOut")return n=>.5-Math.cos(Math.PI*n)/2;if(e==="power2.out"||e==="easeOutQuad")return n=>1-(1-n)*(1-n);if(e.startsWith("back.out")){let n=e.match(/back\.out\(([\d.]+)\)/),i=n?Number(n[1]):1.8;return a=>1+(i+1)*Math.pow(a-1,3)+i*Math.pow(a-1,2)}return n=>1-(1-n)*(1-n)}function Ve(){return typeof performance!="undefined"&&performance.now?performance.now():Date.now()}function Er(t,e){let n=t==null?void 0:t[e];return typeof n=="number"?n:0}function ga(t,e,n){try{t[e]=n}catch{}}function Sr(t){let e=t==null?void 0:t.scale;if(!e)return null;let n=typeof e.x=="number"?e.x:1,i=typeof e.y=="number"?e.y:1;return{x:n,y:i}}function ha(t,e){let n=t==null?void 0:t.scale;if(n)try{typeof n.set=="function"?n.set(e.x,e.y):(typeof n.x=="number"&&(n.x=e.x),typeof n.y=="number"&&(n.y=e.y))}catch{}}function fa(t,e){let n=Sr(t);if(!n)return{from:null,to:null};let i=null,a=null;return typeof e.scale=="number"?(i=e.scale,a=e.scale):e.scale&&typeof e.scale=="object"&&(typeof e.scale.x=="number"&&(i=e.scale.x),typeof e.scale.y=="number"&&(a=e.scale.y)),typeof e.scaleX=="number"&&(i=e.scaleX),typeof e.scaleY=="number"&&(a=e.scaleY),i===null&&a===null?{from:null,to:null}:{from:{x:n.x,y:n.y},to:{x:i!=null?i:n.x,y:a!=null?a:n.y}}}function ma(){let t=new Set,e=new WeakMap,n=null,i=()=>{if(n!=null)return;n=requestAnimationFrame(()=>{n=null,o(),t.size>0&&i()})},a=p=>{var g;t.add(p);let c=(g=e.get(p.target))!=null?g:new Set;c.add(p),e.set(p.target,c),i()},s=p=>{t.delete(p);let c=e.get(p.target);c&&(c.delete(p),c.size===0&&e.delete(p.target))},r=p=>{p.killed||(p.killed=!0,s(p))},o=()=>{var c,g;let p=Ve();for(let u of Array.from(t)){if(u.killed||u.paused)continue;let b=p-u.startMs-u.delayMs;if(b<0)continue;let h=u.durationMs>0?b/u.durationMs:1,x=ua(h),v=u.repeat>=0?u.repeat+1:1,y=u.repeat>0?Math.min(Math.floor(h),v-1):0;if(u.repeat>0&&h>=1){let E=h-y;x=ua(E)}let f=u.ease(x);u.yoyo&&y%2===1&&(f=1-f);for(let E of u.props)ga(u.target,E.key,E.from+(E.to-E.from)*f);u.scaleFrom&&u.scaleTo&&ha(u.target,{x:u.scaleFrom.x+(u.scaleTo.x-u.scaleFrom.x)*f,y:u.scaleFrom.y+(u.scaleTo.y-u.scaleFrom.y)*f});try{(c=u.onUpdate)==null||c.call(u)}catch{}if(h>=v){r(u);try{(g=u.onComplete)==null||g.call(u)}catch{}}}},l=(p,c,g)=>{var E;let u=Math.max(0,(typeof c.duration=="number"?c.duration:.5)*1e3),b=Math.max(0,(typeof c.delay=="number"?c.delay:0)*1e3+((E=g==null?void 0:g.delayMsOverride)!=null?E:0)),h=wr(c.ease),x=typeof c.repeat=="number"?Math.max(0,c.repeat|0):0,v=c.yoyo===!0,y=new Set(["duration","delay","ease","repeat","yoyo","onUpdate","onComplete","scale","scaleX","scaleY"]),f=[];for(let S of Object.keys(c)){if(y.has(S))continue;let A=c[S];typeof A=="number"&&f.push({key:S,from:Er(p,S),to:A})}let m=fa(p,c);return{target:p,startMs:Ve(),delayMs:b,durationMs:u,ease:h,props:f,scaleFrom:m.from,scaleTo:m.to,repeat:x,yoyo:v,onUpdate:typeof c.onUpdate=="function"?c.onUpdate:void 0,onComplete:typeof c.onComplete=="function"?c.onComplete:void 0,killed:!1,paused:!1,pauseAtMs:null}},d={to(p,c){let g=l(p,c);return a(g),{kill:()=>r(g),pause:()=>{g.paused||(g.paused=!0,g.pauseAtMs=Ve())},resume:()=>{var h;if(!g.paused)return;let u=(h=g.pauseAtMs)!=null?h:Ve(),b=Ve()-u;g.startMs+=b,g.paused=!1,g.pauseAtMs=null},isActive:()=>!g.killed&&!g.paused}},fromTo(p,c,g){return d.set(p,c),d.to(p,g)},set(p,c){if(!p||!c)return;for(let u of Object.keys(c)){let b=c[u];u==="scale"||u==="scaleX"||u==="scaleY"||typeof b=="number"&&ga(p,u,b)}let g=fa(p,c);g.to&&ha(p,g.to)},killTweensOf(p){let c=e.get(p);if(c)for(let g of Array.from(c))r(g)},timeline(p={}){let c=[],g=0,u=!1,b=[],h=y=>{if(typeof y=="number")return Math.max(0,y*1e3);let f=typeof y=="string"?y.trim():"";return f.startsWith("+=")?g+Math.max(0,Number(f.slice(2))*1e3||0):f?Math.max(0,Number(f)*1e3||0):g},x=y=>{c.push(y);let f=Math.max(0,(typeof y.vars.duration=="number"?y.vars.duration:.5)*1e3);g=Math.max(g,y.atMs+f)},v={to(y,f,m){return x({kind:"to",target:y,vars:f,atMs:h(m)}),v},fromTo(y,f,m,E){return x({kind:"fromTo",target:y,vars:m,from:f,atMs:h(E)}),v},play(){var y,f;if(u)return v;u=!0,b=[];for(let m of c)m.kind==="fromTo"&&d.set(m.target,(y=m.from)!=null?y:{}),b.push(d.to(m.target,{...m.vars,delay:m.atMs/1e3+((f=m.vars.delay)!=null?f:0)}));return v},pause(){for(let y of b)y.pause();return v},kill(){for(let y of b)y.kill();b=[],u=!1}};return p.paused||v.play(),v}};return d}function ba(){if(typeof window=="undefined")return;let t=window;if(!t.gsap)try{t.gsap=ma()}catch{}}var ya={name:"handler-playable-sdk",version:"0.3.43",type:"module",description:"Handler Playable SDK v0.1 with contract-aligned surface (root sandbox, canonical event envelope).",main:"dist/index.cjs",module:"dist/index.js",types:"dist/index.d.ts",exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js",require:"./dist/index.cjs"},"./pixi":{types:"./dist/pixi/index.d.ts",import:"./dist/pixi/index.js",require:"./dist/pixi/index.cjs"},"./pixi/index.css":{import:"./dist/pixi/index.css",require:"./dist/pixi/index.css"},"./three":{types:"./dist/three/index.d.ts",import:"./dist/three/index.js",require:"./dist/three/index.cjs"},"./cli":{types:"./dist/cli/index.d.ts",import:"./dist/cli/index.js",require:"./dist/cli/index.cjs"}},bin:{"handler-student-helper":"./bin/student-helper.mjs","handler-validate":"./bin/validate.mjs","handler-sync-screens":"./bin/sync-screens.mjs","handler-brand-dna":"./bin/brand-dna.mjs","handler-setup-library":"./bin/setup-library.mjs","handler-screen-helper":"./bin/screen-helper.mjs"},scripts:{prebuild:"python3 src/preview/build-css.py",build:"tsup src/index.ts src/pixi/index.ts src/three/index.ts src/cli/index.ts --format cjs,esm --dts --clean --minify --external lottie-web && npm run create-mjs-symlinks && npm run postbuild-cli && npm run obfuscate && npm run postbuild",postbuild:"python3 src/preview/copy-css-to-dist.py","postbuild-cli":"cp src/cli/*.mjs dist/cli/ && chmod +x dist/cli/*.mjs && chmod +x bin/*.mjs","create-mjs-symlinks":"cd dist && ln -sf index.js index.mjs && cd pixi && ln -sf index.js index.mjs && cd ../three && ln -sf index.js index.mjs","build:dev":"tsup src/index.ts src/pixi/index.ts src/three/index.ts src/cli/index.ts --format cjs,esm --dts --clean --external lottie-web && npm run create-mjs-symlinks && npm run postbuild-cli",obfuscate:"javascript-obfuscator dist/pixi/index.js --output dist/pixi/index.js --config obfuscator.config.json && javascript-obfuscator dist/three/index.js --output dist/three/index.js --config obfuscator.config.json && javascript-obfuscator dist/cli/index.js --output dist/cli/index.js --config obfuscator.config.json && npm run obfuscate-cli","obfuscate-cli":'for file in dist/cli/*.mjs; do javascript-obfuscator "$file" --output "$file" --config obfuscator.config.json; done',lint:"eslint 'src/**/*.{ts,tsx}'",typecheck:"tsc --noEmit",prepublishOnly:"npm run build","publish:update":"node scripts/publish-and-update.cjs patch","publish:update:minor":"node scripts/publish-and-update.cjs minor","publish:update:major":"node scripts/publish-and-update.cjs major"},author:"Handler",license:"MIT",publishConfig:{access:"public"},repository:{type:"git",url:"https://github.com/HandlerAIGames/handler-playable-sdk.git"},files:["dist","bin","LICENSE","README.md"],peerDependencies:{"lottie-web":"^5.0.0","pixi.js":"^8.0.0",three:"^0.182.0"},peerDependenciesMeta:{"pixi.js":{optional:!0},three:{optional:!0},"lottie-web":{optional:!0}},devDependencies:{"@types/three":"^0.182.0",eslint:"^9.39.2","javascript-obfuscator":"^5.1.0","pixi.js":"8.8.1",three:"^0.182.0","ts-node":"^10.9.2",tsup:"^8.4.0",typescript:"^5.7.2","typescript-eslint":"^8.53.0"},dependencies:{"@google/genai":"^1.35.0","@google/generative-ai":"^0.24.1",jszip:"^3.10.1",sharp:"^0.34.5"}};var G=0,Cr=G++,va=G++,xa=G++,wa=G++,Ea=G++,Sa=G++,Aa=G++,Ca=G++,Ta=G++,_a=G++,La=G++,Ma=G++,T=Cr;function Pa(){return T===va}function ka(){return T===xa}function Ra(){return T===wa}function Oa(){return T===Ea}function Re(){return T===Sa}function Oe(){return T===Aa}function Ia(){return T===Ca}function ja(){return T===Ta}function Da(){return T===_a}function Zt(){return T===La}function Qt(){return T===Ma}function $a(){let t=typeof AD_PROTOCOL!="undefined"?AD_PROTOCOL:"none",e=typeof AD_NETWORK!="undefined"?AD_NETWORK:"web_embed";if(t==="mraid")try{mraid.getState(),T=va;return}catch{}else if(t==="dapi")try{dapi.isReady(),T=xa;return}catch{}if(e==="facebook")try{typeof FbPlayableAd!="undefined"&&(T=wa)}catch{}else if(e==="google")try{typeof ExitApi!="undefined"&&(T=Ea)}catch{}else if(e==="mintegral")window.gameReady&&(T=Sa);else if(e==="tapjoy")window.TJ_API&&(T=Aa);else if(e==="tiktok")window.openAppStore&&(T=Ca);else if(e==="smadex")try{window.smxTracking&&(T=Ta)}catch{}else if(e==="snapchat")try{window.ScPlayableAd&&(T=_a)}catch{}else e==="vungle"?T=La:(t==="nucleo"||e==="nucleo")&&(T=Ma)}var yt=ae(require("lottie-web"),1),Ha=yt.default;typeof window!="undefined"&&(window.lottie=yt.default,window.__baseLottie=yt.default);var Tr=require("pixi.js");var en=require("pixi.js");var _r=null;function tn(t){_r=t}vt();nn();var Ye=require("pixi.js");vt();var Or=typeof __BUILD_MODE__!="undefined"?__BUILD_MODE__:"undefined",on=Or;if(typeof window!="undefined")try{let t=new XMLHttpRequest;if(t.open("GET","./build-settings.json",!1),t.send(),t.status===200&&t.responseText){let e=JSON.parse(t.responseText);e!=null&&e.buildMode&&(on=e.buildMode,console.log(`[ObjectFactory] Build mode overridden by settings: ${on}`))}}catch{}var Ae=class{static async create(e,n,i){var l,d,p,c,g,u,b;console.log(`[ObjectFactory] create() called for: ${e}, __BUILD_MODE__: ${on}`);let a=(l=n==null?void 0:n.render)==null?void 0:l.asset;if(!a){console.log(`[ObjectFactory] No asset definition for: ${e}, returning empty container`);let h=new Ye.Container;return this.applyTransform(h,n==null?void 0:n.transform,n),h}let s=(d=n==null?void 0:n.identity)==null?void 0:d.id;console.log(`[ObjectFactory] Calling AssetLoader.load() for: ${e}, configId: ${s}, type: ${a.type}, path: ${a.path}`);let r=await Se.load(e,a,i,s);console.log(`[ObjectFactory] AssetLoader.load() completed for: ${e}, rawAsset type: ${(p=r==null?void 0:r.constructor)==null?void 0:p.name}`);let o;if(a.type==="image")console.log("[ObjectFactory] Creating Sprite from texture:",r,"for object:",e),o=new Ye.Sprite(r),console.log("[ObjectFactory] Created object:",o,"type:",(c=o==null?void 0:o.constructor)==null?void 0:c.name),this.applyTransform(o,n==null?void 0:n.transform,n);else if(a.type==="json")if(console.log("[ObjectFactory] JSON asset for",e,"rawAsset type:",(g=r==null?void 0:r.constructor)==null?void 0:g.name,r),r&&(((u=r.constructor)==null?void 0:u.name)==="Container"||r instanceof Ye.Container)){console.warn("[ObjectFactory] JSON asset is Container (from cache), reloading JSON directly");let h=[a.path,`/assets/${a.path}`,`assets/${a.path}`,`../assets/${a.path}`],x=!1;for(let v of h)try{let y=await fetch(v);if(y.ok){o=await y.json(),console.log("[ObjectFactory] Reloaded JSON directly from:",v,"type:",(b=o==null?void 0:o.constructor)==null?void 0:b.name),x=!0;break}}catch{continue}x||(console.error("[ObjectFactory] Failed to reload JSON from any path"),o=r)}else o=r;else o=r,o&&typeof o=="object"&&("x"in o||"position"in o)&&this.applyTransform(o,n==null?void 0:n.transform,n);return o}static applyTransform(e,n,i){var a,s,r,o;!n||!e||(n.position&&("x"in e&&"y"in e?(e.x=(a=n.position.x)!=null?a:0,e.y=(s=n.position.y)!=null?s:0):"position"in e&&e.position&&e.position.set((r=n.position.x)!=null?r:0,(o=n.position.y)!=null?o:0)),n.scale!==void 0&&"scale"in e&&e.scale&&(typeof e.scale=="object"&&"set"in e.scale?e.scale.set(n.scale):e.scale=n.scale),n.rotation!==void 0&&"rotation"in e&&(e.rotation=n.rotation),n.anchor&&"anchor"in e&&e.anchor&&Array.isArray(n.anchor)&&("set"in e.anchor?e.anchor.set(n.anchor[0],n.anchor[1]):(e.anchor.x=n.anchor[0],e.anchor.y=n.anchor[1])))}};var Ke=class{constructor(){this.config=null}init(e){this.config=e}get(e){if(!this.config)throw new Error("RuntimeObjectRegistry not initialized. Call init() first.");return this.config.objects.get(e)}getAllIds(){if(!this.config)throw new Error("RuntimeObjectRegistry not initialized. Call init() first.");return Array.from(this.config.objects.keys())}has(e){return this.config?this.config.objects.has(e):!1}};var Dr=ae(require("pixi.js"),1);typeof window!="undefined"&&(window.__basePixi=Dr);Xe();var wt=require("pixi.js");Xe();var cn=class{constructor(){this.instanceCache=new Map;this.readyPromise=null;this.app=null;this.registry=new Ke}init(e,n){this.registry.init(e),this.app=n}updateConfig(e){this.registry.init(e),this.instanceCache.clear(),this.readyPromise=null}async ready(){this.readyPromise&&await this.readyPromise;let n=this.registry.getAllIds().filter(a=>!this.instanceCache.has(a));if(n.length===0)return;let i=async a=>{a.length&&(console.log("[Assets] Loading objects:",a),await Promise.all(a.map(async s=>{var o;let r=this.registry.get(s);if(!r){console.warn("[Assets] No config found for object:",s);return}try{let l=await Ae.create(s,r,this.app);this.instanceCache.set(s,l),console.log("[Assets] Loaded object:",s,(o=l==null?void 0:l.constructor)==null?void 0:o.name)}catch(l){console.error("[Assets] Failed to load object:",s,l)}})))};return this.readyPromise=(async()=>{await i(n);let a=this.registry.getAllIds().filter(s=>!this.instanceCache.has(s));a.length>0&&(console.warn("[Assets] Retrying missing assets:",a),await i(a)),console.log("[Assets] Ready. Cached objects:",Array.from(this.instanceCache.keys()))})(),this.readyPromise}resetScene(){this.instanceCache.clear(),this.readyPromise=null}async reloadObject(e){let n=this.registry.get(e);if(n){let i=await Ae.create(e,n,this.app);this.instanceCache.set(e,i)}}get(e){return this.instanceCache.get(e)}},Hr=new cn,zr=new Proxy(Hr,{get(t,e){if(e in t&&typeof t[e]=="function")return t[e].bind(t);if(t.get(e))return t.get(e)}});Xe();var Ba=require("pixi.js"),le={width:400,height:600,designWidth:400,scaleFactor:1},St={scale:1,position:1},pn=[];function Br(t,e,n,i,a,s,r){pn.push({element:t,originalScale:s,positionHelper:e,heightPercent:a}),e(t,n,i,a,s,r,!1)}function Gr(){pn.forEach(({element:t,originalScale:e,positionHelper:n,heightPercent:i})=>{let a=e*le.scaleFactor;n(t,le.width,le.height,i,a,!0,!1)})}function dn(t,e){console.log(`[SCREEN] updateScreenState called: ${t}x${e}`),le.width=t,le.height=e,le.scaleFactor=Math.min(t/le.designWidth,1.15),St.scale=le.scaleFactor,St.position=1,console.log(`[SCREEN] Global multipliers - scale: ${St.scale.toFixed(3)}`),Gr()}var Ze={layout:{scale_multiplier:1,position_offset:{x:0,y:0},debug_rect_visible:!0,debug_rect_color:16711680,debug_rect_thickness:4,debug_rect_scale_x:1,debug_rect_scale_y:1,screen_scale_x:1,screen_scale_y:1},engine:{scale:1,background_scale:1.05,background_offset_y:0,background_alpha:.98,label_pulse_speed:3,label_pulse_intensity:.03}};function Ur(t,e,n){let i=Ze[t];i&&i[e]!==void 0&&(i[e]=n,console.log(`Updated ${t}.${e} = ${n}`))}function qr(){return Ze}var Wr={center:{x:.5,y:.5},"center-center":{x:.5,y:.5},middle:{x:.5,y:.5},"middle-center":{x:.5,y:.5},"top-left":{x:0,y:0},"top-center":{x:.5,y:0},"top-right":{x:1,y:0},"bottom-left":{x:0,y:1},"bottom-center":{x:.5,y:1},"bottom-right":{x:1,y:1},"left-center":{x:0,y:.5},"right-center":{x:1,y:.5},"center-left":{x:0,y:.5},"center-right":{x:1,y:.5},left:{x:0,y:.5},right:{x:1,y:.5},top:{x:.5,y:0},bottom:{x:.5,y:1}};function Et(t,e){return typeof t=="number"&&Number.isFinite(t)?t:e}function At(t,e={x:.5,y:.5}){var n;if(Array.isArray(t))return{x:Et(t[0],e.x),y:Et(t[1],e.y)};if(t&&typeof t=="object"){let i=t;return{x:Et(i.x,e.x),y:Et(i.y,e.y)}}if(typeof t=="string"){let i=t.trim().toLowerCase();return(n=Wr[i])!=null?n:e}return e}function Ga(t,e,n,i={}){var u,b,h,x,v,y;let a=At(n),s=(u=i.inset)!=null?u:{},r=(b=i.padding)!=null?b:{x:0,y:0},o=((h=s.left)!=null?h:0)+r.x,l=((x=s.right)!=null?x:0)+r.x,d=((v=s.top)!=null?v:0)+r.y,p=((y=s.bottom)!=null?y:0)+r.y,c=Math.max(0,t-o-l),g=Math.max(0,e-d-p);return{x:o+c*a.x,y:d+g*a.y}}function Ua(t,e,n,i={}){var h,x,v,y,f,m;let a=(h=i.inset)!=null?h:{},s=(x=i.padding)!=null?x:{x:0,y:0},r=((v=a.left)!=null?v:0)+s.x,o=((y=a.right)!=null?y:0)+s.x,l=((f=a.top)!=null?f:0)+s.y,d=((m=a.bottom)!=null?m:0)+s.y,p=Math.max(0,t-r-o),c=Math.max(0,e-l-d),g=At(n,{x:.5,y:.5}),u=Math.min(Math.max(g.x,0),1),b=Math.min(Math.max(g.y,0),1);return{x:r+p*u,y:l+c*b}}if(typeof window!="undefined"){let t=window.innerWidth,e=window.innerHeight,n=()=>{let i=window.innerWidth,a=window.innerHeight;(i!==t||a!==e)&&(t=i,e=a,dn(i,a))};window.addEventListener("resize",n),window.addEventListener("orientationchange",()=>{setTimeout(n,100)}),window.mraid&&(window.mraid.addEventListener("viewableChange",n),window.mraid.addEventListener("sizeChange",n)),dn(window.innerWidth,window.innerHeight),window.updateDebugConfig=Ur,window.getDebugConfig=qr,window.copyConfig=io,window.applyConfig=Je,window.applyConfigForRatio=ao,window.positionAtBottom=qa,window.positionAtTop=Kr,window.positionAtCenter=Xr,window.positionAtLeft=Jr,window.positionAtRight=Zr,window.positionAtBottomLeft=Qr,window.positionAtBottomRight=eo,window.positionAtTopLeft=to,window.positionAtTopRight=no,window.applyPositionContract=Yr,console.log("\u{1F3AE} Debug Config Functions Available:"),console.log("\u2022 updateDebugConfig(category, key, value)"),console.log("\u2022 getDebugConfig()"),console.log("\u2022 copyConfig(presetName)"),console.log("\u2022 applyConfig(config)"),console.log("\u2022 applyConfigForRatio(width, height)"),console.log("\u{1F4CD} Positioning Helpers Available (with scale):"),console.log("\u2022 positionAtBottom(element, w, h, percent, scale)"),console.log("\u2022 positionAtTop(element, w, h, percent, scale)"),console.log("\u2022 positionAtCenter(element, w, h, offsetX, offsetY, scale)"),console.log("\u2022 positionAtLeft/Right(element, w, h, percent, scale)"),console.log("\u2022 Corner positions: BottomLeft/Right, TopLeft/Right (all with scale)"),console.log("\u2022 applyPositionContract(element, w, h, contract)"),console.log("Example: positionAtCenter(mySprite, 400, 600, 0, -50, 1.2)")}function Ct(t,e,n=0){return t*e+n}function Tt(t,e,n=0){return t*(1-e)+n}function _t(t,e,n=0){return t*e+n}function Lt(t,e,n=0){return t*(1-e)+n}function U(t,e=0){return t/2+e}function Vr(t,e){return t*e}function Yr(t,e,n,i){var r,o,l,d,p,c,g,u,b,h,x,v,y,f,m,E,S,A,M,R;let a=0,s=0;switch(i.type){case"top":a=U(e,(o=(r=i.offset)==null?void 0:r.x)!=null?o:0),s=Ct(n,i.percent,(d=(l=i.offset)==null?void 0:l.y)!=null?d:0);break;case"bottom":a=U(e,(c=(p=i.offset)==null?void 0:p.x)!=null?c:0),s=Tt(n,i.percent,(u=(g=i.offset)==null?void 0:g.y)!=null?u:0);break;case"left":a=_t(e,i.percent,(h=(b=i.offset)==null?void 0:b.x)!=null?h:0),s=U(n,(v=(x=i.offset)==null?void 0:x.y)!=null?v:0);break;case"right":a=Lt(e,i.percent,(f=(y=i.offset)==null?void 0:y.x)!=null?f:0),s=U(n,(E=(m=i.offset)==null?void 0:m.y)!=null?E:0);break;case"center":a=U(e,(A=(S=i.offset)==null?void 0:S.x)!=null?A:0),s=U(n,(R=(M=i.offset)==null?void 0:M.y)!=null?R:0);break}t.position?t.position.set(a,s):(t.x=a,t.y=s),i.scale!==void 0&&i.scale!==1&&t.scale&&(typeof t.scale.set=="function"?t.scale.set(i.scale,i.scale):(t.scale.x=i.scale,t.scale.y=i.scale))}function qa(t,e,n,i=.2,a=1,s=!0,r=!1){let o=Vr(n,i),l=Tt(n,i/2);ce(t,U(e),l);let d=s?a*le.scaleFactor:a;de(t,d),r&&!pn.find(p=>p.element===t)&&Br(t,qa,e,n,i,a,s)}function Kr(t,e,n,i=.1,a=1){ce(t,U(e),Ct(n,i)),de(t,a)}function Xr(t,e,n,i=0,a=0,s=1){ce(t,U(e,i),U(n,a)),de(t,s)}function Jr(t,e,n,i=.1,a=1){ce(t,_t(e,i),U(n)),de(t,a)}function Zr(t,e,n,i=.1,a=1){ce(t,Lt(e,i),U(n)),de(t,a)}function Qr(t,e,n,i=.05,a=.05,s=1){ce(t,_t(e,a),Tt(n,i)),de(t,s)}function eo(t,e,n,i=.05,a=.05,s=1){ce(t,Lt(e,a),Tt(n,i)),de(t,s)}function to(t,e,n,i=.05,a=.05,s=1){ce(t,_t(e,a),Ct(n,i)),de(t,s)}function no(t,e,n,i=.05,a=.05,s=1){ce(t,Lt(e,a),Ct(n,i)),de(t,s)}function ce(t,e,n){t&&t.position?typeof t.position.set=="function"?t.position.set(e,n):(t.position.x=e,t.position.y=n):t&&(t.x=e,t.y=n)}function de(t,e){e!==1&&t&&t.scale&&(typeof t.scale.set=="function"?t.scale.set(e,e):t.scale.x!==void 0&&t.scale.y!==void 0&&(t.scale.x=e,t.scale.y=e))}var Ce={default:{layout:{scale_multiplier:1,position_offset:{x:0,y:0},debug_rect_visible:!0,debug_rect_color:16711680,debug_rect_thickness:4,debug_rect_scale_x:1,debug_rect_scale_y:1,screen_scale_x:1,screen_scale_y:1},engine:{scale:1,background_scale:1.05,background_offset_y:0,background_alpha:.98,label_pulse_speed:3,label_pulse_intensity:.03}},wide:{layout:{scale_multiplier:1,position_offset:{x:0,y:0},debug_rect_visible:!0,debug_rect_color:16711680,debug_rect_thickness:4,debug_rect_scale_x:1,debug_rect_scale_y:1,screen_scale_x:.9,screen_scale_y:1.1},engine:{scale:1,background_scale:1.1,background_offset_y:0,background_alpha:.95,label_pulse_speed:3,label_pulse_intensity:.03}},square:{layout:{scale_multiplier:1,position_offset:{x:0,y:0},debug_rect_visible:!0,debug_rect_color:16711680,debug_rect_thickness:4,debug_rect_scale_x:1,debug_rect_scale_y:1,screen_scale_x:.85,screen_scale_y:.85},engine:{scale:1,background_scale:1,background_offset_y:0,background_alpha:1,label_pulse_speed:3,label_pulse_intensity:.03}},tall:{layout:{scale_multiplier:1,position_offset:{x:0,y:0},debug_rect_visible:!0,debug_rect_color:16711680,debug_rect_thickness:4,debug_rect_scale_x:1,debug_rect_scale_y:1,screen_scale_x:1.1,screen_scale_y:.9},engine:{scale:1,background_scale:.95,background_offset_y:0,background_alpha:1,label_pulse_speed:3,label_pulse_intensity:.03}}};function io(t){return t&&Ce[t]?JSON.parse(JSON.stringify(Ce[t])):JSON.parse(JSON.stringify(Ze))}function Je(t){Object.keys(t).forEach(e=>{let n=e;Ze[n]&&t[n]&&Object.assign(Ze[n],t[n])}),console.log("Config applied:",t)}function ao(t,e){let n=t/e;n>1.6?(Je(Ce.wide),console.log("Applied WIDE config for ratio:",n)):n<.7?(Je(Ce.tall),console.log("Applied TALL config for ratio:",n)):n>.8&&n<1.2?(Je(Ce.square),console.log("Applied SQUARE config for ratio:",n)):(Je(Ce.default),console.log("Applied DEFAULT config for ratio:",n))}if(typeof window!="undefined"){let t=window;t.configPresets=Ce,t.resolveAnchorVec2=t.resolveAnchorVec2||At,t.resolveScreenAnchorPoint=t.resolveScreenAnchorPoint||Ga,t.resolveScreenRatioPoint=t.resolveScreenRatioPoint||Ua}hn();function k(t,e){let n=(a,s)=>s===0?a:n(s,a%s),i=n(t,e);return`${t/i}:${e/i}`}var Fc=[{id:"iphone-15-pro-max",label:"iPhone 15 Pro Max",width:430,height:932,category:"iphone",ratio:k(430,932)},{id:"iphone-15-pro",label:"iPhone 15 Pro",width:393,height:852,category:"iphone",ratio:k(393,852)},{id:"iphone-15",label:"iPhone 15",width:393,height:852,category:"iphone",ratio:k(393,852)},{id:"iphone-14",label:"iPhone 14",width:390,height:844,category:"iphone",ratio:k(390,844)},{id:"iphone-se",label:"iPhone SE",width:375,height:667,category:"iphone",ratio:k(375,667)},{id:"iphone-12-mini",label:"iPhone 12 Mini",width:360,height:780,category:"iphone",ratio:k(360,780)}],Bc=[{id:"pixel-8-pro",label:"Pixel 8 Pro",width:448,height:998,category:"android",ratio:k(448,998)},{id:"pixel-8",label:"Pixel 8",width:412,height:915,category:"android",ratio:k(412,915)},{id:"samsung-s24-ultra",label:"Samsung S24 Ultra",width:412,height:915,category:"android",ratio:k(412,915)},{id:"samsung-s24",label:"Samsung S24",width:360,height:780,category:"android",ratio:k(360,780)},{id:"samsung-a54",label:"Samsung A54",width:412,height:915,category:"android",ratio:k(412,915)},{id:"oneplus-12",label:"OnePlus 12",width:412,height:915,category:"android",ratio:k(412,915)}],Gc=[{id:"ipad-pro-12",label:'iPad Pro 12.9"',width:1024,height:1366,category:"tablet",ratio:k(1024,1366)},{id:"ipad-pro-11",label:'iPad Pro 11"',width:834,height:1194,category:"tablet",ratio:k(834,1194)},{id:"ipad-air",label:"iPad Air",width:820,height:1180,category:"tablet",ratio:k(820,1180)},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"tablet",ratio:k(768,1024)},{id:"samsung-tab-s9",label:"Samsung Tab S9",width:800,height:1280,category:"tablet",ratio:k(800,1280)}],Ka=[{id:"playable-portrait",label:"Playable Portrait",width:320,height:480,category:"playable",ratio:"2:3",mraidScale:1},{id:"mraid-320x480",label:"MRAID 320\xD7480",width:320,height:480,category:"playable",ratio:"2:3",mraidScale:1},{id:"iphone-14",label:"iPhone 14",width:390,height:844,category:"playable",ratio:k(390,844),mraidScale:.7},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"playable",ratio:k(768,1024),mraidScale:.7}];var Uc=[...Ka];var go=Ka[0];fe();var vo=ae(require("jszip"),1);function mo(t){return new Promise((e,n)=>{let i=new FileReader;i.onerror=()=>n(new Error("FileReader failed")),i.onload=()=>e(String(i.result||"")),i.readAsDataURL(t)})}function bo(t){var a;let[e,n]=t.split(","),i=e==null?void 0:e.match(/data:(.*?);base64/);return{base64:n!=null?n:"",mimeType:(a=i==null?void 0:i[1])!=null?a:"image/png"}}async function yo(t){return await new Promise(e=>{let n=new Image;n.onload=()=>e({width:n.naturalWidth||n.width,height:n.naturalHeight||n.height}),n.onerror=()=>e(null),n.src=t})}async function fn(t){var e,n;try{console.log("[ImageUtils] Fetching image data from URL:",t);let i=await fetch(t);if(!i.ok)return console.warn("[ImageUtils] Fetch failed with status:",i.status,t),null;let a=await i.blob();console.log("[ImageUtils] Blob received, size:",a.size,"type:",a.type);let s=await mo(a),r=await yo(s),o=bo(s);return console.log("[ImageUtils] Success resolution:",r==null?void 0:r.width,"x",r==null?void 0:r.height,"mime:",o.mimeType),{base64:o.base64,mimeType:o.mimeType,dataUrl:s,width:(e=r==null?void 0:r.width)!=null?e:0,height:(n=r==null?void 0:r.height)!=null?n:0}}catch(i){return console.error("[ImageUtils] Error fetching image data:",i),null}}async function Mt(t,e=30){try{console.log("[ImageUtils] Removing background color...");let n=await new Promise((c,g)=>{let u=new Image;u.onload=()=>c(u),u.onerror=()=>g(new Error("Failed to load image")),u.src=t}),i=document.createElement("canvas");i.width=n.width,i.height=n.height;let a=i.getContext("2d");if(!a)return console.error("[ImageUtils] Failed to get canvas context"),t;a.drawImage(n,0,0);let s=a.getImageData(0,0,i.width,i.height),r=s.data,l=[{name:"top-left",offset:0},{name:"top-right",offset:(i.width-1)*4},{name:"bottom-left",offset:(i.height-1)*i.width*4},{name:"bottom-right",offset:((i.height-1)*i.width+(i.width-1))*4}].map(c=>({r:r[c.offset],g:r[c.offset+1],b:r[c.offset+2]})),d=0;for(let c=0;c<r.length;c+=4){let g=r[c],u=r[c+1],b=r[c+2],h=!1;for(let x of l)if(Math.sqrt(Math.pow(g-x.r,2)+Math.pow(u-x.g,2)+Math.pow(b-x.b,2))<e){h=!0;break}h&&(r[c+3]=0,d++)}return console.log(`[ImageUtils] Removed background from ${d} pixels (4-corner sampling, tolerance: ${e})`),a.putImageData(s,0,0),i.toDataURL("image/png")}catch(n){return console.error("[ImageUtils] Error removing background:",n),t}}var Xa=require("@google/genai");async function mn(t,e,n=[],i={}){var a,s,r,o,l,d,p;try{if(!(t!=null&&t.trim()))throw new Error("Gemini API key is required");if(!(e!=null&&e.trim()))throw new Error("Prompt is required");for(let v=0;v<n.length;v++){let y=n[v];if(!y.base64||!y.mimeType)throw new Error(`Image ${v+1} is missing required data`);if(y.base64.length<1e3&&console.warn(`Image ${v+1} data appears very small, may be corrupted`),!y.mimeType.startsWith("image/"))throw new Error(`Image ${v+1} has invalid MIME type: ${y.mimeType}`)}let c=new Xa.GoogleGenAI({apiKey:t}),g="gemini-2.5-flash",u=[e];n.length>0&&n.forEach((v,y)=>{u.push({inlineData:{data:v.base64,mimeType:v.mimeType}}),console.log(`[Gemini] Added image ${y+1}: ${v.mimeType}, size: ${Math.round(v.base64.length/1024)}KB`)}),console.log(`[Gemini] Making request with ${n.length} images and prompt length: ${e.length}`);let b=await c.models.generateContent({model:g,contents:u}),h="",x=(r=(s=(a=b.candidates)==null?void 0:a[0])==null?void 0:s.content)==null?void 0:r.parts;if(x)for(let v of x)v.text&&(h+=v.text);if(!h.trim())throw new Error("Empty response from Gemini API");return console.log(`[Gemini] Response received, length: ${h.length}`),h}catch(c){throw console.error("[Gemini] API error:",c),(o=c.message)!=null&&o.includes("Unable to process input image")?new Error("Unable to process the uploaded image. Please ensure it's a valid PNG, JPG, or JPEG file under 10MB and not corrupted."):(l=c.message)!=null&&l.includes("API_KEY_INVALID")?new Error("Invalid Gemini API key. Please check your API key configuration."):(d=c.message)!=null&&d.includes("QUOTA_EXCEEDED")?new Error("Gemini API quota exceeded. Please try again later or check your billing."):(p=c.message)!=null&&p.includes("SAFETY")?new Error("Content was flagged by Gemini safety filters. Please try with different images."):c}}var Ja=require("@google/genai");async function Pt(t,e,n=[],i={}){try{console.info("[GEMINI-REAL-SDK] Initializing GoogleGenAI...");let a=new Ja.GoogleGenAI({apiKey:t}),s=[{text:e}];n.length>0&&n.forEach((o,l)=>{console.info(`[GEMINI-REAL-SDK] Adding image part ${l}`),s.push({inlineData:{mimeType:o.mimeType,data:o.base64}})}),console.info("[GEMINI-REAL-SDK] Calling generateContent with model: gemini-2.5-flash-image");let r=await a.models.generateContent({model:"gemini-2.5-flash-image",contents:s});if(console.info("[GEMINI-REAL-SDK] Received response from model"),!r.candidates||!r.candidates[0]||!r.candidates[0].content||!r.candidates[0].content.parts)throw new Error("Gemini 2.5 Flash Image returned invalid response structure.");for(let o of r.candidates[0].content.parts)if(o.text)console.log(o.text);else if(o.inlineData){let l=o.inlineData.data,d=o.inlineData.mimeType||"image/png";return console.info("[GEMINI-REAL-SDK] Found inline image data in response"),`data:${d};base64,${l}`}throw new Error("Gemini 2.5 Flash Image returned no image data.")}catch(a){throw console.error("[GEMINI-REAL-SDK] Error in generateImageWithGemini25Flash:",JSON.stringify(a,Object.getOwnPropertyNames(a),2)),a}}var xo=require("pixi.js");Xe();fe();var Qa=require("pixi.js");var wo=require("pixi.js");fe();function Lo(t){return new Promise((e,n)=>{let i=new FileReader;i.onerror=()=>n(new Error("FileReader failed")),i.onload=()=>e(String(i.result||"")),i.readAsDataURL(t)})}function Mo(t){var a;let[e,n]=t.split(","),i=e==null?void 0:e.match(/data:(.*?);base64/);return{base64:n!=null?n:"",mimeType:(a=i==null?void 0:i[1])!=null?a:"image/png"}}function Po(t){return`
46
+ `,this.modal=i}attachModalListeners(){if(!this.modal)return;this.modal.querySelectorAll("[data-modal-close]").forEach(r=>{r.addEventListener("click",()=>this.close())}),this.modal.querySelectorAll("[data-tab]").forEach(r=>{r.addEventListener("click",o=>{let d=o.target.dataset.tab;d&&this.switchTab(d)})});let i=this.modal.querySelector("[data-ai-generate]");i==null||i.addEventListener("click",()=>{this.openAiEditor("generate")});let a=this.modal.querySelector("[data-ai-edit]");a==null||a.addEventListener("click",()=>{this.openAiEditor("edit")});let s=this.modal.querySelector("[data-modal-apply]");s==null||s.addEventListener("click",()=>{this.apply()}),this.modal.addEventListener("click",r=>{r.target===this.modal&&this.close()})}switchTab(e){if(!this.modal)return;this.modal.querySelectorAll("[data-tab]").forEach(a=>{a.classList.toggle("active",a.getAttribute("data-tab")===e)}),this.modal.querySelectorAll("[data-tab-panel]").forEach(a=>{a.classList.toggle("active",a.getAttribute("data-tab-panel")===e)})}openAiEditor(e){let n=window.__openAiEditor;if(typeof n!="function"){alert("AI Editor not available. Please check your setup.");return}let i="";e==="edit"&&this.currentAsset?i=`Edit this image: ${this.currentObjectId}`:i=`Create an image for: ${this.currentObjectId}`,n(this.currentObjectId||"unknown",i,this.currentAsset,{path:this.currentPath,onApply:a=>{this.onApplyCallback&&this.onApplyCallback(a),this.close()}})}apply(){this.onApplyCallback&&this.onApplyCallback("library/placeholder.png"),this.close()}close(){this.modal&&this.modal.parentNode&&this.modal.parentNode.removeChild(this.modal),this.modal=null,this.currentObjectId=null,this.currentPath=null,this.onApplyCallback=null}}});var Ko={};ra(Ko,{AspectClass:()=>In,GameObject:()=>ot,GameObjectManager:()=>$t,Renderer:()=>rt,ResponsiveUISystem:()=>Ge,Transform:()=>st,animateHandClick:()=>xs,animatePanelEntrance:()=>vs,createBrushTexture:()=>_s,createEndGamePanel:()=>ys,createHandTutorial:()=>ws,createThreeBase:()=>fs,createTutorialLabel:()=>Es,getAspectClass:()=>Dt,getRegisteredFontIds:()=>bs,loadAsset:()=>$n,loadCharacterFrames:()=>Ts,registerFont:()=>ms,resolveFont:()=>Z,resolveFontWeight:()=>Q,updateHandAnimation:()=>Ss});module.exports=xr(Ko);var V=ae(require("three"),1);var ge={};function mt(t,e,n=!1){ge[t]||(ge[t]=[]),ge[t].push({fn:e,once:n})}function Xt(t,e){if(ge[t]){if(!e){delete ge[t];return}ge[t]=ge[t].filter(n=>n.fn!==e)}}function bt(t,...e){let n=ge[t];if(n)for(let i of[...n])i.fn(...e),i.once&&Xt(t,i.fn)}function B(t,e){mt(t,e,!0)}var P=null,W=[],ke=null;function da(t){P=t,W=[],ke!==null&&(clearTimeout(ke),ke=null)}function pa(){var t,e,n;return{endpoint:(P==null?void 0:P.endpoint)||"",transport:(P==null?void 0:P.transport)||"beacon",batchSize:(t=P==null?void 0:P.batchSize)!=null?t:10,flushIntervalMs:(e=P==null?void 0:P.flushIntervalMs)!=null?e:300,maxQueue:(n=P==null?void 0:P.maxQueue)!=null?n:200,debug:!!(P!=null&&P.debug)}}async function la(t,e,n,i){let a=JSON.stringify(e);if(n==="beacon"&&typeof navigator!="undefined"&&typeof navigator.sendBeacon=="function")try{let s=navigator.sendBeacon(t,new Blob([a],{type:"application/json"}));i&&console.log("[handler.telemetry] beacon",s,e);return}catch(s){i&&console.warn("[handler.telemetry] beacon failed, fallback to fetch",s)}try{await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:a,keepalive:!0}),i&&console.log("[handler.telemetry] fetch",e)}catch(s){i&&console.warn("[handler.telemetry] fetch failed",s)}}function Jt(t,e){let n=pa();if(e&&n.endpoint){if(W.push(t),W.length>n.maxQueue&&(W=W.slice(W.length-n.maxQueue)),W.length>=n.batchSize){ca();return}ke===null&&(ke=window.setTimeout(()=>{ke=null,ca()},n.flushIntervalMs))}}async function ca(){let t=pa();if(!t.endpoint||W.length===0)return;let e=W.splice(0,t.batchSize);await la(t.endpoint,{events:e},t.transport,t.debug),W.length>0&&await la(t.endpoint,{events:W.splice(0,t.batchSize)},t.transport,t.debug)}function ua(t){return Math.max(0,Math.min(1,t))}function wr(t){let e=String(t!=null?t:"power2.out");if(e==="linear")return n=>n;if(e==="sine.inOut")return n=>.5-Math.cos(Math.PI*n)/2;if(e==="power2.out"||e==="easeOutQuad")return n=>1-(1-n)*(1-n);if(e.startsWith("back.out")){let n=e.match(/back\.out\(([\d.]+)\)/),i=n?Number(n[1]):1.8;return a=>1+(i+1)*Math.pow(a-1,3)+i*Math.pow(a-1,2)}return n=>1-(1-n)*(1-n)}function Ve(){return typeof performance!="undefined"&&performance.now?performance.now():Date.now()}function Er(t,e){let n=t==null?void 0:t[e];return typeof n=="number"?n:0}function ga(t,e,n){try{t[e]=n}catch{}}function Sr(t){let e=t==null?void 0:t.scale;if(!e)return null;let n=typeof e.x=="number"?e.x:1,i=typeof e.y=="number"?e.y:1;return{x:n,y:i}}function ha(t,e){let n=t==null?void 0:t.scale;if(n)try{typeof n.set=="function"?n.set(e.x,e.y):(typeof n.x=="number"&&(n.x=e.x),typeof n.y=="number"&&(n.y=e.y))}catch{}}function fa(t,e){let n=Sr(t);if(!n)return{from:null,to:null};let i=null,a=null;return typeof e.scale=="number"?(i=e.scale,a=e.scale):e.scale&&typeof e.scale=="object"&&(typeof e.scale.x=="number"&&(i=e.scale.x),typeof e.scale.y=="number"&&(a=e.scale.y)),typeof e.scaleX=="number"&&(i=e.scaleX),typeof e.scaleY=="number"&&(a=e.scaleY),i===null&&a===null?{from:null,to:null}:{from:{x:n.x,y:n.y},to:{x:i!=null?i:n.x,y:a!=null?a:n.y}}}function ma(){let t=new Set,e=new WeakMap,n=null,i=()=>{if(n!=null)return;n=requestAnimationFrame(()=>{n=null,o(),t.size>0&&i()})},a=p=>{var g;t.add(p);let c=(g=e.get(p.target))!=null?g:new Set;c.add(p),e.set(p.target,c),i()},s=p=>{t.delete(p);let c=e.get(p.target);c&&(c.delete(p),c.size===0&&e.delete(p.target))},r=p=>{p.killed||(p.killed=!0,s(p))},o=()=>{var c,g;let p=Ve();for(let u of Array.from(t)){if(u.killed||u.paused)continue;let b=p-u.startMs-u.delayMs;if(b<0)continue;let h=u.durationMs>0?b/u.durationMs:1,x=ua(h),v=u.repeat>=0?u.repeat+1:1,y=u.repeat>0?Math.min(Math.floor(h),v-1):0;if(u.repeat>0&&h>=1){let E=h-y;x=ua(E)}let f=u.ease(x);u.yoyo&&y%2===1&&(f=1-f);for(let E of u.props)ga(u.target,E.key,E.from+(E.to-E.from)*f);u.scaleFrom&&u.scaleTo&&ha(u.target,{x:u.scaleFrom.x+(u.scaleTo.x-u.scaleFrom.x)*f,y:u.scaleFrom.y+(u.scaleTo.y-u.scaleFrom.y)*f});try{(c=u.onUpdate)==null||c.call(u)}catch{}if(h>=v){r(u);try{(g=u.onComplete)==null||g.call(u)}catch{}}}},l=(p,c,g)=>{var E;let u=Math.max(0,(typeof c.duration=="number"?c.duration:.5)*1e3),b=Math.max(0,(typeof c.delay=="number"?c.delay:0)*1e3+((E=g==null?void 0:g.delayMsOverride)!=null?E:0)),h=wr(c.ease),x=typeof c.repeat=="number"?Math.max(0,c.repeat|0):0,v=c.yoyo===!0,y=new Set(["duration","delay","ease","repeat","yoyo","onUpdate","onComplete","scale","scaleX","scaleY"]),f=[];for(let S of Object.keys(c)){if(y.has(S))continue;let A=c[S];typeof A=="number"&&f.push({key:S,from:Er(p,S),to:A})}let m=fa(p,c);return{target:p,startMs:Ve(),delayMs:b,durationMs:u,ease:h,props:f,scaleFrom:m.from,scaleTo:m.to,repeat:x,yoyo:v,onUpdate:typeof c.onUpdate=="function"?c.onUpdate:void 0,onComplete:typeof c.onComplete=="function"?c.onComplete:void 0,killed:!1,paused:!1,pauseAtMs:null}},d={to(p,c){let g=l(p,c);return a(g),{kill:()=>r(g),pause:()=>{g.paused||(g.paused=!0,g.pauseAtMs=Ve())},resume:()=>{var h;if(!g.paused)return;let u=(h=g.pauseAtMs)!=null?h:Ve(),b=Ve()-u;g.startMs+=b,g.paused=!1,g.pauseAtMs=null},isActive:()=>!g.killed&&!g.paused}},fromTo(p,c,g){return d.set(p,c),d.to(p,g)},set(p,c){if(!p||!c)return;for(let u of Object.keys(c)){let b=c[u];u==="scale"||u==="scaleX"||u==="scaleY"||typeof b=="number"&&ga(p,u,b)}let g=fa(p,c);g.to&&ha(p,g.to)},killTweensOf(p){let c=e.get(p);if(c)for(let g of Array.from(c))r(g)},timeline(p={}){let c=[],g=0,u=!1,b=[],h=y=>{if(typeof y=="number")return Math.max(0,y*1e3);let f=typeof y=="string"?y.trim():"";return f.startsWith("+=")?g+Math.max(0,Number(f.slice(2))*1e3||0):f?Math.max(0,Number(f)*1e3||0):g},x=y=>{c.push(y);let f=Math.max(0,(typeof y.vars.duration=="number"?y.vars.duration:.5)*1e3);g=Math.max(g,y.atMs+f)},v={to(y,f,m){return x({kind:"to",target:y,vars:f,atMs:h(m)}),v},fromTo(y,f,m,E){return x({kind:"fromTo",target:y,vars:m,from:f,atMs:h(E)}),v},play(){var y,f;if(u)return v;u=!0,b=[];for(let m of c)m.kind==="fromTo"&&d.set(m.target,(y=m.from)!=null?y:{}),b.push(d.to(m.target,{...m.vars,delay:m.atMs/1e3+((f=m.vars.delay)!=null?f:0)}));return v},pause(){for(let y of b)y.pause();return v},kill(){for(let y of b)y.kill();b=[],u=!1}};return p.paused||v.play(),v}};return d}function ba(){if(typeof window=="undefined")return;let t=window;if(!t.gsap)try{t.gsap=ma()}catch{}}var ya={name:"handler-playable-sdk",version:"0.3.44",type:"module",description:"Handler Playable SDK v0.1 with contract-aligned surface (root sandbox, canonical event envelope).",main:"dist/index.cjs",module:"dist/index.js",types:"dist/index.d.ts",exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js",require:"./dist/index.cjs"},"./pixi":{types:"./dist/pixi/index.d.ts",import:"./dist/pixi/index.js",require:"./dist/pixi/index.cjs"},"./pixi/index.css":{import:"./dist/pixi/index.css",require:"./dist/pixi/index.css"},"./three":{types:"./dist/three/index.d.ts",import:"./dist/three/index.js",require:"./dist/three/index.cjs"},"./cli":{types:"./dist/cli/index.d.ts",import:"./dist/cli/index.js",require:"./dist/cli/index.cjs"}},bin:{"handler-student-helper":"./bin/student-helper.mjs","handler-validate":"./bin/validate.mjs","handler-sync-screens":"./bin/sync-screens.mjs","handler-brand-dna":"./bin/brand-dna.mjs","handler-setup-library":"./bin/setup-library.mjs","handler-screen-helper":"./bin/screen-helper.mjs"},scripts:{prebuild:"python3 src/preview/build-css.py",build:"tsup src/index.ts src/pixi/index.ts src/three/index.ts src/cli/index.ts --format cjs,esm --dts --clean --minify --external lottie-web && npm run create-mjs-symlinks && npm run postbuild-cli && npm run obfuscate && npm run postbuild",postbuild:"python3 src/preview/copy-css-to-dist.py","postbuild-cli":"cp src/cli/*.mjs dist/cli/ && chmod +x dist/cli/*.mjs && chmod +x bin/*.mjs","create-mjs-symlinks":"cd dist && ln -sf index.js index.mjs && cd pixi && ln -sf index.js index.mjs && cd ../three && ln -sf index.js index.mjs","build:dev":"tsup src/index.ts src/pixi/index.ts src/three/index.ts src/cli/index.ts --format cjs,esm --dts --clean --external lottie-web && npm run create-mjs-symlinks && npm run postbuild-cli",obfuscate:"javascript-obfuscator dist/pixi/index.js --output dist/pixi/index.js --config obfuscator.config.json && javascript-obfuscator dist/three/index.js --output dist/three/index.js --config obfuscator.config.json && javascript-obfuscator dist/cli/index.js --output dist/cli/index.js --config obfuscator.config.json && npm run obfuscate-cli","obfuscate-cli":'for file in dist/cli/*.mjs; do javascript-obfuscator "$file" --output "$file" --config obfuscator.config.json; done',lint:"eslint 'src/**/*.{ts,tsx}'",typecheck:"tsc --noEmit",prepublishOnly:"npm run build","publish:update":"node scripts/publish-and-update.cjs patch","publish:update:minor":"node scripts/publish-and-update.cjs minor","publish:update:major":"node scripts/publish-and-update.cjs major"},author:"Handler",license:"MIT",publishConfig:{access:"public"},repository:{type:"git",url:"https://github.com/HandlerAIGames/handler-playable-sdk.git"},files:["dist","bin","LICENSE","README.md"],peerDependencies:{"lottie-web":"^5.0.0","pixi.js":"^8.0.0",three:"^0.182.0"},peerDependenciesMeta:{"pixi.js":{optional:!0},three:{optional:!0},"lottie-web":{optional:!0}},devDependencies:{"@types/three":"^0.182.0",eslint:"^9.39.2","javascript-obfuscator":"^5.1.0","pixi.js":"8.8.1",three:"^0.182.0","ts-node":"^10.9.2",tsup:"^8.4.0",typescript:"^5.7.2","typescript-eslint":"^8.53.0"},dependencies:{"@google/genai":"^1.35.0","@google/generative-ai":"^0.24.1",jszip:"^3.10.1",sharp:"^0.34.5"}};var G=0,Cr=G++,va=G++,xa=G++,wa=G++,Ea=G++,Sa=G++,Aa=G++,Ca=G++,Ta=G++,_a=G++,La=G++,Ma=G++,T=Cr;function Pa(){return T===va}function ka(){return T===xa}function Ra(){return T===wa}function Oa(){return T===Ea}function Re(){return T===Sa}function Oe(){return T===Aa}function Ia(){return T===Ca}function ja(){return T===Ta}function Da(){return T===_a}function Zt(){return T===La}function Qt(){return T===Ma}function $a(){let t=typeof AD_PROTOCOL!="undefined"?AD_PROTOCOL:"none",e=typeof AD_NETWORK!="undefined"?AD_NETWORK:"web_embed";if(t==="mraid")try{mraid.getState(),T=va;return}catch{}else if(t==="dapi")try{dapi.isReady(),T=xa;return}catch{}if(e==="facebook")try{typeof FbPlayableAd!="undefined"&&(T=wa)}catch{}else if(e==="google")try{typeof ExitApi!="undefined"&&(T=Ea)}catch{}else if(e==="mintegral")window.gameReady&&(T=Sa);else if(e==="tapjoy")window.TJ_API&&(T=Aa);else if(e==="tiktok")window.openAppStore&&(T=Ca);else if(e==="smadex")try{window.smxTracking&&(T=Ta)}catch{}else if(e==="snapchat")try{window.ScPlayableAd&&(T=_a)}catch{}else e==="vungle"?T=La:(t==="nucleo"||e==="nucleo")&&(T=Ma)}var yt=ae(require("lottie-web"),1),Ha=yt.default;typeof window!="undefined"&&(window.lottie=yt.default,window.__baseLottie=yt.default);var Tr=require("pixi.js");var en=require("pixi.js");var _r=null;function tn(t){_r=t}vt();nn();var Ye=require("pixi.js");vt();var Or=typeof __BUILD_MODE__!="undefined"?__BUILD_MODE__:"undefined",on=Or;if(typeof window!="undefined")try{let t=new XMLHttpRequest;if(t.open("GET","./build-settings.json",!1),t.send(),t.status===200&&t.responseText){let e=JSON.parse(t.responseText);e!=null&&e.buildMode&&(on=e.buildMode,console.log(`[ObjectFactory] Build mode overridden by settings: ${on}`))}}catch{}var Ae=class{static async create(e,n,i){var l,d,p,c,g,u,b;console.log(`[ObjectFactory] create() called for: ${e}, __BUILD_MODE__: ${on}`);let a=(l=n==null?void 0:n.render)==null?void 0:l.asset;if(!a){console.log(`[ObjectFactory] No asset definition for: ${e}, returning empty container`);let h=new Ye.Container;return this.applyTransform(h,n==null?void 0:n.transform,n),h}let s=(d=n==null?void 0:n.identity)==null?void 0:d.id;console.log(`[ObjectFactory] Calling AssetLoader.load() for: ${e}, configId: ${s}, type: ${a.type}, path: ${a.path}`);let r=await Se.load(e,a,i,s);console.log(`[ObjectFactory] AssetLoader.load() completed for: ${e}, rawAsset type: ${(p=r==null?void 0:r.constructor)==null?void 0:p.name}`);let o;if(a.type==="image")console.log("[ObjectFactory] Creating Sprite from texture:",r,"for object:",e),o=new Ye.Sprite(r),console.log("[ObjectFactory] Created object:",o,"type:",(c=o==null?void 0:o.constructor)==null?void 0:c.name),this.applyTransform(o,n==null?void 0:n.transform,n);else if(a.type==="json")if(console.log("[ObjectFactory] JSON asset for",e,"rawAsset type:",(g=r==null?void 0:r.constructor)==null?void 0:g.name,r),r&&(((u=r.constructor)==null?void 0:u.name)==="Container"||r instanceof Ye.Container)){console.warn("[ObjectFactory] JSON asset is Container (from cache), reloading JSON directly");let h=[a.path,`/assets/${a.path}`,`assets/${a.path}`,`../assets/${a.path}`],x=!1;for(let v of h)try{let y=await fetch(v);if(y.ok){o=await y.json(),console.log("[ObjectFactory] Reloaded JSON directly from:",v,"type:",(b=o==null?void 0:o.constructor)==null?void 0:b.name),x=!0;break}}catch{continue}x||(console.error("[ObjectFactory] Failed to reload JSON from any path"),o=r)}else o=r;else o=r,o&&typeof o=="object"&&("x"in o||"position"in o)&&this.applyTransform(o,n==null?void 0:n.transform,n);return o}static applyTransform(e,n,i){var a,s,r,o;!n||!e||(n.position&&("x"in e&&"y"in e?(e.x=(a=n.position.x)!=null?a:0,e.y=(s=n.position.y)!=null?s:0):"position"in e&&e.position&&e.position.set((r=n.position.x)!=null?r:0,(o=n.position.y)!=null?o:0)),n.scale!==void 0&&"scale"in e&&e.scale&&(typeof e.scale=="object"&&"set"in e.scale?e.scale.set(n.scale):e.scale=n.scale),n.rotation!==void 0&&"rotation"in e&&(e.rotation=n.rotation),n.anchor&&"anchor"in e&&e.anchor&&Array.isArray(n.anchor)&&("set"in e.anchor?e.anchor.set(n.anchor[0],n.anchor[1]):(e.anchor.x=n.anchor[0],e.anchor.y=n.anchor[1])))}};var Ke=class{constructor(){this.config=null}init(e){this.config=e}get(e){if(!this.config)throw new Error("RuntimeObjectRegistry not initialized. Call init() first.");return this.config.objects.get(e)}getAllIds(){if(!this.config)throw new Error("RuntimeObjectRegistry not initialized. Call init() first.");return Array.from(this.config.objects.keys())}has(e){return this.config?this.config.objects.has(e):!1}};var Dr=ae(require("pixi.js"),1);typeof window!="undefined"&&(window.__basePixi=Dr);Xe();var wt=require("pixi.js");Xe();var cn=class{constructor(){this.instanceCache=new Map;this.readyPromise=null;this.app=null;this.registry=new Ke}init(e,n){this.registry.init(e),this.app=n}updateConfig(e){this.registry.init(e),this.instanceCache.clear(),this.readyPromise=null}async ready(){this.readyPromise&&await this.readyPromise;let n=this.registry.getAllIds().filter(a=>!this.instanceCache.has(a));if(n.length===0)return;let i=async a=>{a.length&&(console.log("[Assets] Loading objects:",a),await Promise.all(a.map(async s=>{var o;let r=this.registry.get(s);if(!r){console.warn("[Assets] No config found for object:",s);return}try{let l=await Ae.create(s,r,this.app);this.instanceCache.set(s,l),console.log("[Assets] Loaded object:",s,(o=l==null?void 0:l.constructor)==null?void 0:o.name)}catch(l){console.error("[Assets] Failed to load object:",s,l)}})))};return this.readyPromise=(async()=>{await i(n);let a=this.registry.getAllIds().filter(s=>!this.instanceCache.has(s));a.length>0&&(console.warn("[Assets] Retrying missing assets:",a),await i(a)),console.log("[Assets] Ready. Cached objects:",Array.from(this.instanceCache.keys()))})(),this.readyPromise}resetScene(){this.instanceCache.clear(),this.readyPromise=null}async reloadObject(e){let n=this.registry.get(e);if(n){let i=await Ae.create(e,n,this.app);this.instanceCache.set(e,i)}}get(e){return this.instanceCache.get(e)}},Hr=new cn,zr=new Proxy(Hr,{get(t,e){if(e in t&&typeof t[e]=="function")return t[e].bind(t);if(t.get(e))return t.get(e)}});Xe();var Ba=require("pixi.js"),le={width:400,height:600,designWidth:400,scaleFactor:1},St={scale:1,position:1},pn=[];function Br(t,e,n,i,a,s,r){pn.push({element:t,originalScale:s,positionHelper:e,heightPercent:a}),e(t,n,i,a,s,r,!1)}function Gr(){pn.forEach(({element:t,originalScale:e,positionHelper:n,heightPercent:i})=>{let a=e*le.scaleFactor;n(t,le.width,le.height,i,a,!0,!1)})}function dn(t,e){console.log(`[SCREEN] updateScreenState called: ${t}x${e}`),le.width=t,le.height=e,le.scaleFactor=Math.min(t/le.designWidth,1.15),St.scale=le.scaleFactor,St.position=1,console.log(`[SCREEN] Global multipliers - scale: ${St.scale.toFixed(3)}`),Gr()}var Ze={layout:{scale_multiplier:1,position_offset:{x:0,y:0},debug_rect_visible:!0,debug_rect_color:16711680,debug_rect_thickness:4,debug_rect_scale_x:1,debug_rect_scale_y:1,screen_scale_x:1,screen_scale_y:1},engine:{scale:1,background_scale:1.05,background_offset_y:0,background_alpha:.98,label_pulse_speed:3,label_pulse_intensity:.03}};function Ur(t,e,n){let i=Ze[t];i&&i[e]!==void 0&&(i[e]=n,console.log(`Updated ${t}.${e} = ${n}`))}function qr(){return Ze}var Wr={center:{x:.5,y:.5},"center-center":{x:.5,y:.5},middle:{x:.5,y:.5},"middle-center":{x:.5,y:.5},"top-left":{x:0,y:0},"top-center":{x:.5,y:0},"top-right":{x:1,y:0},"bottom-left":{x:0,y:1},"bottom-center":{x:.5,y:1},"bottom-right":{x:1,y:1},"left-center":{x:0,y:.5},"right-center":{x:1,y:.5},"center-left":{x:0,y:.5},"center-right":{x:1,y:.5},left:{x:0,y:.5},right:{x:1,y:.5},top:{x:.5,y:0},bottom:{x:.5,y:1}};function Et(t,e){return typeof t=="number"&&Number.isFinite(t)?t:e}function At(t,e={x:.5,y:.5}){var n;if(Array.isArray(t))return{x:Et(t[0],e.x),y:Et(t[1],e.y)};if(t&&typeof t=="object"){let i=t;return{x:Et(i.x,e.x),y:Et(i.y,e.y)}}if(typeof t=="string"){let i=t.trim().toLowerCase();return(n=Wr[i])!=null?n:e}return e}function Ga(t,e,n,i={}){var u,b,h,x,v,y;let a=At(n),s=(u=i.inset)!=null?u:{},r=(b=i.padding)!=null?b:{x:0,y:0},o=((h=s.left)!=null?h:0)+r.x,l=((x=s.right)!=null?x:0)+r.x,d=((v=s.top)!=null?v:0)+r.y,p=((y=s.bottom)!=null?y:0)+r.y,c=Math.max(0,t-o-l),g=Math.max(0,e-d-p);return{x:o+c*a.x,y:d+g*a.y}}function Ua(t,e,n,i={}){var h,x,v,y,f,m;let a=(h=i.inset)!=null?h:{},s=(x=i.padding)!=null?x:{x:0,y:0},r=((v=a.left)!=null?v:0)+s.x,o=((y=a.right)!=null?y:0)+s.x,l=((f=a.top)!=null?f:0)+s.y,d=((m=a.bottom)!=null?m:0)+s.y,p=Math.max(0,t-r-o),c=Math.max(0,e-l-d),g=At(n,{x:.5,y:.5}),u=Math.min(Math.max(g.x,0),1),b=Math.min(Math.max(g.y,0),1);return{x:r+p*u,y:l+c*b}}if(typeof window!="undefined"){let t=window.innerWidth,e=window.innerHeight,n=()=>{let i=window.innerWidth,a=window.innerHeight;(i!==t||a!==e)&&(t=i,e=a,dn(i,a))};window.addEventListener("resize",n),window.addEventListener("orientationchange",()=>{setTimeout(n,100)}),window.mraid&&(window.mraid.addEventListener("viewableChange",n),window.mraid.addEventListener("sizeChange",n)),dn(window.innerWidth,window.innerHeight),window.updateDebugConfig=Ur,window.getDebugConfig=qr,window.copyConfig=io,window.applyConfig=Je,window.applyConfigForRatio=ao,window.positionAtBottom=qa,window.positionAtTop=Kr,window.positionAtCenter=Xr,window.positionAtLeft=Jr,window.positionAtRight=Zr,window.positionAtBottomLeft=Qr,window.positionAtBottomRight=eo,window.positionAtTopLeft=to,window.positionAtTopRight=no,window.applyPositionContract=Yr,console.log("\u{1F3AE} Debug Config Functions Available:"),console.log("\u2022 updateDebugConfig(category, key, value)"),console.log("\u2022 getDebugConfig()"),console.log("\u2022 copyConfig(presetName)"),console.log("\u2022 applyConfig(config)"),console.log("\u2022 applyConfigForRatio(width, height)"),console.log("\u{1F4CD} Positioning Helpers Available (with scale):"),console.log("\u2022 positionAtBottom(element, w, h, percent, scale)"),console.log("\u2022 positionAtTop(element, w, h, percent, scale)"),console.log("\u2022 positionAtCenter(element, w, h, offsetX, offsetY, scale)"),console.log("\u2022 positionAtLeft/Right(element, w, h, percent, scale)"),console.log("\u2022 Corner positions: BottomLeft/Right, TopLeft/Right (all with scale)"),console.log("\u2022 applyPositionContract(element, w, h, contract)"),console.log("Example: positionAtCenter(mySprite, 400, 600, 0, -50, 1.2)")}function Ct(t,e,n=0){return t*e+n}function Tt(t,e,n=0){return t*(1-e)+n}function _t(t,e,n=0){return t*e+n}function Lt(t,e,n=0){return t*(1-e)+n}function U(t,e=0){return t/2+e}function Vr(t,e){return t*e}function Yr(t,e,n,i){var r,o,l,d,p,c,g,u,b,h,x,v,y,f,m,E,S,A,M,R;let a=0,s=0;switch(i.type){case"top":a=U(e,(o=(r=i.offset)==null?void 0:r.x)!=null?o:0),s=Ct(n,i.percent,(d=(l=i.offset)==null?void 0:l.y)!=null?d:0);break;case"bottom":a=U(e,(c=(p=i.offset)==null?void 0:p.x)!=null?c:0),s=Tt(n,i.percent,(u=(g=i.offset)==null?void 0:g.y)!=null?u:0);break;case"left":a=_t(e,i.percent,(h=(b=i.offset)==null?void 0:b.x)!=null?h:0),s=U(n,(v=(x=i.offset)==null?void 0:x.y)!=null?v:0);break;case"right":a=Lt(e,i.percent,(f=(y=i.offset)==null?void 0:y.x)!=null?f:0),s=U(n,(E=(m=i.offset)==null?void 0:m.y)!=null?E:0);break;case"center":a=U(e,(A=(S=i.offset)==null?void 0:S.x)!=null?A:0),s=U(n,(R=(M=i.offset)==null?void 0:M.y)!=null?R:0);break}t.position?t.position.set(a,s):(t.x=a,t.y=s),i.scale!==void 0&&i.scale!==1&&t.scale&&(typeof t.scale.set=="function"?t.scale.set(i.scale,i.scale):(t.scale.x=i.scale,t.scale.y=i.scale))}function qa(t,e,n,i=.2,a=1,s=!0,r=!1){let o=Vr(n,i),l=Tt(n,i/2);ce(t,U(e),l);let d=s?a*le.scaleFactor:a;de(t,d),r&&!pn.find(p=>p.element===t)&&Br(t,qa,e,n,i,a,s)}function Kr(t,e,n,i=.1,a=1){ce(t,U(e),Ct(n,i)),de(t,a)}function Xr(t,e,n,i=0,a=0,s=1){ce(t,U(e,i),U(n,a)),de(t,s)}function Jr(t,e,n,i=.1,a=1){ce(t,_t(e,i),U(n)),de(t,a)}function Zr(t,e,n,i=.1,a=1){ce(t,Lt(e,i),U(n)),de(t,a)}function Qr(t,e,n,i=.05,a=.05,s=1){ce(t,_t(e,a),Tt(n,i)),de(t,s)}function eo(t,e,n,i=.05,a=.05,s=1){ce(t,Lt(e,a),Tt(n,i)),de(t,s)}function to(t,e,n,i=.05,a=.05,s=1){ce(t,_t(e,a),Ct(n,i)),de(t,s)}function no(t,e,n,i=.05,a=.05,s=1){ce(t,Lt(e,a),Ct(n,i)),de(t,s)}function ce(t,e,n){t&&t.position?typeof t.position.set=="function"?t.position.set(e,n):(t.position.x=e,t.position.y=n):t&&(t.x=e,t.y=n)}function de(t,e){e!==1&&t&&t.scale&&(typeof t.scale.set=="function"?t.scale.set(e,e):t.scale.x!==void 0&&t.scale.y!==void 0&&(t.scale.x=e,t.scale.y=e))}var Ce={default:{layout:{scale_multiplier:1,position_offset:{x:0,y:0},debug_rect_visible:!0,debug_rect_color:16711680,debug_rect_thickness:4,debug_rect_scale_x:1,debug_rect_scale_y:1,screen_scale_x:1,screen_scale_y:1},engine:{scale:1,background_scale:1.05,background_offset_y:0,background_alpha:.98,label_pulse_speed:3,label_pulse_intensity:.03}},wide:{layout:{scale_multiplier:1,position_offset:{x:0,y:0},debug_rect_visible:!0,debug_rect_color:16711680,debug_rect_thickness:4,debug_rect_scale_x:1,debug_rect_scale_y:1,screen_scale_x:.9,screen_scale_y:1.1},engine:{scale:1,background_scale:1.1,background_offset_y:0,background_alpha:.95,label_pulse_speed:3,label_pulse_intensity:.03}},square:{layout:{scale_multiplier:1,position_offset:{x:0,y:0},debug_rect_visible:!0,debug_rect_color:16711680,debug_rect_thickness:4,debug_rect_scale_x:1,debug_rect_scale_y:1,screen_scale_x:.85,screen_scale_y:.85},engine:{scale:1,background_scale:1,background_offset_y:0,background_alpha:1,label_pulse_speed:3,label_pulse_intensity:.03}},tall:{layout:{scale_multiplier:1,position_offset:{x:0,y:0},debug_rect_visible:!0,debug_rect_color:16711680,debug_rect_thickness:4,debug_rect_scale_x:1,debug_rect_scale_y:1,screen_scale_x:1.1,screen_scale_y:.9},engine:{scale:1,background_scale:.95,background_offset_y:0,background_alpha:1,label_pulse_speed:3,label_pulse_intensity:.03}}};function io(t){return t&&Ce[t]?JSON.parse(JSON.stringify(Ce[t])):JSON.parse(JSON.stringify(Ze))}function Je(t){Object.keys(t).forEach(e=>{let n=e;Ze[n]&&t[n]&&Object.assign(Ze[n],t[n])}),console.log("Config applied:",t)}function ao(t,e){let n=t/e;n>1.6?(Je(Ce.wide),console.log("Applied WIDE config for ratio:",n)):n<.7?(Je(Ce.tall),console.log("Applied TALL config for ratio:",n)):n>.8&&n<1.2?(Je(Ce.square),console.log("Applied SQUARE config for ratio:",n)):(Je(Ce.default),console.log("Applied DEFAULT config for ratio:",n))}if(typeof window!="undefined"){let t=window;t.configPresets=Ce,t.resolveAnchorVec2=t.resolveAnchorVec2||At,t.resolveScreenAnchorPoint=t.resolveScreenAnchorPoint||Ga,t.resolveScreenRatioPoint=t.resolveScreenRatioPoint||Ua}hn();function k(t,e){let n=(a,s)=>s===0?a:n(s,a%s),i=n(t,e);return`${t/i}:${e/i}`}var Fc=[{id:"iphone-15-pro-max",label:"iPhone 15 Pro Max",width:430,height:932,category:"iphone",ratio:k(430,932)},{id:"iphone-15-pro",label:"iPhone 15 Pro",width:393,height:852,category:"iphone",ratio:k(393,852)},{id:"iphone-15",label:"iPhone 15",width:393,height:852,category:"iphone",ratio:k(393,852)},{id:"iphone-14",label:"iPhone 14",width:390,height:844,category:"iphone",ratio:k(390,844)},{id:"iphone-se",label:"iPhone SE",width:375,height:667,category:"iphone",ratio:k(375,667)},{id:"iphone-12-mini",label:"iPhone 12 Mini",width:360,height:780,category:"iphone",ratio:k(360,780)}],Bc=[{id:"pixel-8-pro",label:"Pixel 8 Pro",width:448,height:998,category:"android",ratio:k(448,998)},{id:"pixel-8",label:"Pixel 8",width:412,height:915,category:"android",ratio:k(412,915)},{id:"samsung-s24-ultra",label:"Samsung S24 Ultra",width:412,height:915,category:"android",ratio:k(412,915)},{id:"samsung-s24",label:"Samsung S24",width:360,height:780,category:"android",ratio:k(360,780)},{id:"samsung-a54",label:"Samsung A54",width:412,height:915,category:"android",ratio:k(412,915)},{id:"oneplus-12",label:"OnePlus 12",width:412,height:915,category:"android",ratio:k(412,915)}],Gc=[{id:"ipad-pro-12",label:'iPad Pro 12.9"',width:1024,height:1366,category:"tablet",ratio:k(1024,1366)},{id:"ipad-pro-11",label:'iPad Pro 11"',width:834,height:1194,category:"tablet",ratio:k(834,1194)},{id:"ipad-air",label:"iPad Air",width:820,height:1180,category:"tablet",ratio:k(820,1180)},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"tablet",ratio:k(768,1024)},{id:"samsung-tab-s9",label:"Samsung Tab S9",width:800,height:1280,category:"tablet",ratio:k(800,1280)}],Ka=[{id:"playable-portrait",label:"Playable Portrait",width:320,height:480,category:"playable",ratio:"2:3",mraidScale:1},{id:"mraid-320x480",label:"MRAID 320\xD7480",width:320,height:480,category:"playable",ratio:"2:3",mraidScale:1},{id:"iphone-14",label:"iPhone 14",width:390,height:844,category:"playable",ratio:k(390,844),mraidScale:.7},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"playable",ratio:k(768,1024),mraidScale:.7}];var Uc=[...Ka];var go=Ka[0];fe();var vo=ae(require("jszip"),1);function mo(t){return new Promise((e,n)=>{let i=new FileReader;i.onerror=()=>n(new Error("FileReader failed")),i.onload=()=>e(String(i.result||"")),i.readAsDataURL(t)})}function bo(t){var a;let[e,n]=t.split(","),i=e==null?void 0:e.match(/data:(.*?);base64/);return{base64:n!=null?n:"",mimeType:(a=i==null?void 0:i[1])!=null?a:"image/png"}}async function yo(t){return await new Promise(e=>{let n=new Image;n.onload=()=>e({width:n.naturalWidth||n.width,height:n.naturalHeight||n.height}),n.onerror=()=>e(null),n.src=t})}async function fn(t){var e,n;try{console.log("[ImageUtils] Fetching image data from URL:",t);let i=await fetch(t);if(!i.ok)return console.warn("[ImageUtils] Fetch failed with status:",i.status,t),null;let a=await i.blob();console.log("[ImageUtils] Blob received, size:",a.size,"type:",a.type);let s=await mo(a),r=await yo(s),o=bo(s);return console.log("[ImageUtils] Success resolution:",r==null?void 0:r.width,"x",r==null?void 0:r.height,"mime:",o.mimeType),{base64:o.base64,mimeType:o.mimeType,dataUrl:s,width:(e=r==null?void 0:r.width)!=null?e:0,height:(n=r==null?void 0:r.height)!=null?n:0}}catch(i){return console.error("[ImageUtils] Error fetching image data:",i),null}}async function Mt(t,e=30){try{console.log("[ImageUtils] Removing background color...");let n=await new Promise((c,g)=>{let u=new Image;u.onload=()=>c(u),u.onerror=()=>g(new Error("Failed to load image")),u.src=t}),i=document.createElement("canvas");i.width=n.width,i.height=n.height;let a=i.getContext("2d");if(!a)return console.error("[ImageUtils] Failed to get canvas context"),t;a.drawImage(n,0,0);let s=a.getImageData(0,0,i.width,i.height),r=s.data,l=[{name:"top-left",offset:0},{name:"top-right",offset:(i.width-1)*4},{name:"bottom-left",offset:(i.height-1)*i.width*4},{name:"bottom-right",offset:((i.height-1)*i.width+(i.width-1))*4}].map(c=>({r:r[c.offset],g:r[c.offset+1],b:r[c.offset+2]})),d=0;for(let c=0;c<r.length;c+=4){let g=r[c],u=r[c+1],b=r[c+2],h=!1;for(let x of l)if(Math.sqrt(Math.pow(g-x.r,2)+Math.pow(u-x.g,2)+Math.pow(b-x.b,2))<e){h=!0;break}h&&(r[c+3]=0,d++)}return console.log(`[ImageUtils] Removed background from ${d} pixels (4-corner sampling, tolerance: ${e})`),a.putImageData(s,0,0),i.toDataURL("image/png")}catch(n){return console.error("[ImageUtils] Error removing background:",n),t}}var Xa=require("@google/genai");async function mn(t,e,n=[],i={}){var a,s,r,o,l,d,p;try{if(!(t!=null&&t.trim()))throw new Error("Gemini API key is required");if(!(e!=null&&e.trim()))throw new Error("Prompt is required");for(let v=0;v<n.length;v++){let y=n[v];if(!y.base64||!y.mimeType)throw new Error(`Image ${v+1} is missing required data`);if(y.base64.length<1e3&&console.warn(`Image ${v+1} data appears very small, may be corrupted`),!y.mimeType.startsWith("image/"))throw new Error(`Image ${v+1} has invalid MIME type: ${y.mimeType}`)}let c=new Xa.GoogleGenAI({apiKey:t}),g="gemini-2.5-flash",u=[e];n.length>0&&n.forEach((v,y)=>{u.push({inlineData:{data:v.base64,mimeType:v.mimeType}}),console.log(`[Gemini] Added image ${y+1}: ${v.mimeType}, size: ${Math.round(v.base64.length/1024)}KB`)}),console.log(`[Gemini] Making request with ${n.length} images and prompt length: ${e.length}`);let b=await c.models.generateContent({model:g,contents:u}),h="",x=(r=(s=(a=b.candidates)==null?void 0:a[0])==null?void 0:s.content)==null?void 0:r.parts;if(x)for(let v of x)v.text&&(h+=v.text);if(!h.trim())throw new Error("Empty response from Gemini API");return console.log(`[Gemini] Response received, length: ${h.length}`),h}catch(c){throw console.error("[Gemini] API error:",c),(o=c.message)!=null&&o.includes("Unable to process input image")?new Error("Unable to process the uploaded image. Please ensure it's a valid PNG, JPG, or JPEG file under 10MB and not corrupted."):(l=c.message)!=null&&l.includes("API_KEY_INVALID")?new Error("Invalid Gemini API key. Please check your API key configuration."):(d=c.message)!=null&&d.includes("QUOTA_EXCEEDED")?new Error("Gemini API quota exceeded. Please try again later or check your billing."):(p=c.message)!=null&&p.includes("SAFETY")?new Error("Content was flagged by Gemini safety filters. Please try with different images."):c}}var Ja=require("@google/genai");async function Pt(t,e,n=[],i={}){try{console.info("[GEMINI-REAL-SDK] Initializing GoogleGenAI...");let a=new Ja.GoogleGenAI({apiKey:t}),s=[{text:e}];n.length>0&&n.forEach((o,l)=>{console.info(`[GEMINI-REAL-SDK] Adding image part ${l}`),s.push({inlineData:{mimeType:o.mimeType,data:o.base64}})}),console.info("[GEMINI-REAL-SDK] Calling generateContent with model: gemini-2.5-flash-image");let r=await a.models.generateContent({model:"gemini-2.5-flash-image",contents:s});if(console.info("[GEMINI-REAL-SDK] Received response from model"),!r.candidates||!r.candidates[0]||!r.candidates[0].content||!r.candidates[0].content.parts)throw new Error("Gemini 2.5 Flash Image returned invalid response structure.");for(let o of r.candidates[0].content.parts)if(o.text)console.log(o.text);else if(o.inlineData){let l=o.inlineData.data,d=o.inlineData.mimeType||"image/png";return console.info("[GEMINI-REAL-SDK] Found inline image data in response"),`data:${d};base64,${l}`}throw new Error("Gemini 2.5 Flash Image returned no image data.")}catch(a){throw console.error("[GEMINI-REAL-SDK] Error in generateImageWithGemini25Flash:",JSON.stringify(a,Object.getOwnPropertyNames(a),2)),a}}var xo=require("pixi.js");Xe();fe();var Qa=require("pixi.js");var wo=require("pixi.js");fe();function Lo(t){return new Promise((e,n)=>{let i=new FileReader;i.onerror=()=>n(new Error("FileReader failed")),i.onload=()=>e(String(i.result||"")),i.readAsDataURL(t)})}function Mo(t){var a;let[e,n]=t.split(","),i=e==null?void 0:e.match(/data:(.*?);base64/);return{base64:n!=null?n:"",mimeType:(a=i==null?void 0:i[1])!=null?a:"image/png"}}function Po(t){return`
47
47
  Analyze these screenshots of a brand or game and extract its "Brand DNA".
48
48
 
49
49
  Provide a concise summary (2-3 sentences) covering:
@@ -163,6 +163,27 @@
163
163
  background: var(--ui-bg);
164
164
  }
165
165
 
166
+ /* Scene Tools Container - Dynamically positioned relative to game preview */
167
+ #scene-tools-container {
168
+ position: absolute;
169
+ /* left, top, and transform will be set dynamically by JavaScript */
170
+ z-index: 60;
171
+ pointer-events: auto;
172
+ transition: left var(--ui-duration-fast) var(--ui-ease),
173
+ top var(--ui-duration-fast) var(--ui-ease);
174
+ }
175
+
176
+ /* Nudge Panel Container - Dynamically positioned relative to game preview */
177
+ #nudge-panel-container {
178
+ position: absolute;
179
+ /* left, top, and transform will be set dynamically by JavaScript */
180
+ z-index: 60;
181
+ pointer-events: auto;
182
+ transition: left var(--ui-duration-fast) var(--ui-ease),
183
+ top var(--ui-duration-fast) var(--ui-ease);
184
+ }
185
+
186
+
166
187
  .preview-container {
167
188
  width: 100%;
168
189
  height: 100%;
@@ -4643,12 +4664,10 @@
4643
4664
 
4644
4665
 
4645
4666
  /* ========== 13-nudge-panel.css ========== */
4646
- /* Nudge Panel - Floating on left side */
4667
+ /* Nudge Panel - Dynamically positioned relative to game preview */
4647
4668
  .nudge-panel {
4648
4669
  position: absolute;
4649
- left: 16px;
4650
- top: 50%;
4651
- transform: translateY(-50%);
4670
+ /* left, top, and transform will be set dynamically by JavaScript */
4652
4671
  width: 180px;
4653
4672
  background: var(--ui-surface);
4654
4673
  border: 1px solid var(--ui-border);
@@ -4656,7 +4675,9 @@
4656
4675
  box-shadow: var(--ui-shadow);
4657
4676
  z-index: 60;
4658
4677
  pointer-events: auto;
4659
- transition: opacity var(--ui-duration-fast) var(--ui-ease);
4678
+ transition: left var(--ui-duration-fast) var(--ui-ease),
4679
+ top var(--ui-duration-fast) var(--ui-ease),
4680
+ opacity var(--ui-duration-fast) var(--ui-ease);
4660
4681
  }
4661
4682
 
4662
4683
  .nudge-panel.hidden {