handler-playable-sdk 0.3.32 → 0.3.34

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.cjs CHANGED
@@ -44,7 +44,7 @@
44
44
  <button class="debug-btn primary" data-modal-apply>Apply</button>
45
45
  </div>
46
46
  </div>
47
- `,this.modal=n}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 n=this.modal.querySelector("[data-ai-generate]");n==null||n.addEventListener("click",()=>{this.openAiEditor("generate")});let r=this.modal.querySelector("[data-ai-edit]");r==null||r.addEventListener("click",()=>{this.openAiEditor("edit")});let a=this.modal.querySelector("[data-modal-apply]");a==null||a.addEventListener("click",()=>{this.apply()}),this.modal.addEventListener("click",s=>{s.target===this.modal&&this.close()})}switchTab(t){if(!this.modal)return;this.modal.querySelectorAll("[data-tab]").forEach(r=>{r.classList.toggle("active",r.getAttribute("data-tab")===t)}),this.modal.querySelectorAll("[data-tab-panel]").forEach(r=>{r.classList.toggle("active",r.getAttribute("data-tab-panel")===t)})}openAiEditor(t){let i=window.__openAiEditor;if(typeof i!="function"){alert("AI Editor not available. Please check your setup.");return}let n="";t==="edit"&&this.currentAsset?n=`Edit this image: ${this.currentObjectId}`:n=`Create an image for: ${this.currentObjectId}`,i(this.currentObjectId||"unknown",n,this.currentAsset,{path:this.currentPath,onApply:r=>{this.onApplyCallback&&this.onApplyCallback(r),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 l0={};an(l0,{COLORS:()=>We,ConfigWatcher:()=>Ht,DebugPanel:()=>rr,DefaultReloadStrategy:()=>bn,Handler:()=>Pe,PlayableLoadingScreen:()=>ss,PreviewShell:()=>ns,STROKE_WIDTH:()=>jg,THEME:()=>Dg,applyConfigOverride:()=>bt,applyConfigOverrides:()=>yt,applyConfigsToDisk:()=>hn,applyDefaults:()=>$t,baseLottie:()=>ws,bootstrap:()=>Zw,clearConfigOverrides:()=>vt,clearConfigOverridesForObject:()=>Ed,configOverrideManager:()=>Sd,createPreviewShell:()=>hc,deepClone:()=>ne,default:()=>zt,defaultPreset:()=>Nr,deviceGroups:()=>Vs,devicePresets:()=>Ws,diffConfigs:()=>Fs,exportConfigsAsJSON:()=>fn,getConfigOverrides:()=>de,getConfigStateSummary:()=>Or,getOverrideMode:()=>pn,getPresetById:()=>Ut,getPresetsByCategory:()=>Xm,loadAllObjectConfigs:()=>Rr,loadComponentSchemas:()=>Pr,loadEngineConfig:()=>jr,loadGamePromptConfig:()=>zs,loadObjectCentricConfig:()=>et,loadObjectConfig:()=>xt,loadSceneConfig:()=>Dr,rehydrateObject:()=>$s,removeConfigOverride:()=>Lr,resetToApplied:()=>gn,resetToOriginal:()=>Ir,setBootstrapDependencies:()=>Kw,setOverrideMode:()=>Rs,setupHotReload:()=>qs,setupLiveEditBridge:()=>rs,toLegacyFormat:()=>Ns,validateObjectConfig:()=>gi});module.exports=nm(l0);var ht={};function gr(e,t,i=!1){ht[e]||(ht[e]=[]),ht[e].push({fn:t,once:i})}function bs(e,t){if(ht[e]){if(!t){delete ht[e];return}ht[e]=ht[e].filter(i=>i.fn!==t)}}function mr(e,...t){let i=ht[e];if(i)for(let n of[...i])n.fn(...t),n.once&&bs(e,n.fn)}function be(e,t){gr(e,t,!0)}var ee=null,Ce=[],ui=null;function Pc(e){ee=e,Ce=[],ui!==null&&(clearTimeout(ui),ui=null)}function Rc(){var e,t,i;return{endpoint:(ee==null?void 0:ee.endpoint)||"",transport:(ee==null?void 0:ee.transport)||"beacon",batchSize:(e=ee==null?void 0:ee.batchSize)!=null?e:10,flushIntervalMs:(t=ee==null?void 0:ee.flushIntervalMs)!=null?t:300,maxQueue:(i=ee==null?void 0:ee.maxQueue)!=null?i:200,debug:!!(ee!=null&&ee.debug)}}async function Ic(e,t,i,n){let r=JSON.stringify(t);if(i==="beacon"&&typeof navigator!="undefined"&&typeof navigator.sendBeacon=="function")try{let a=navigator.sendBeacon(e,new Blob([r],{type:"application/json"}));n&&console.log("[handler.telemetry] beacon",a,t);return}catch(a){n&&console.warn("[handler.telemetry] beacon failed, fallback to fetch",a)}try{await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:r,keepalive:!0}),n&&console.log("[handler.telemetry] fetch",t)}catch(a){n&&console.warn("[handler.telemetry] fetch failed",a)}}function ys(e,t){let i=Rc();if(t&&i.endpoint){if(Ce.push(e),Ce.length>i.maxQueue&&(Ce=Ce.slice(Ce.length-i.maxQueue)),Ce.length>=i.batchSize){Mc();return}ui===null&&(ui=window.setTimeout(()=>{ui=null,Mc()},i.flushIntervalMs))}}async function Mc(){let e=Rc();if(!e.endpoint||Ce.length===0)return;let t=Ce.splice(0,e.batchSize);await Ic(e.endpoint,{events:t},e.transport,e.debug),Ce.length>0&&await Ic(e.endpoint,{events:Ce.splice(0,e.batchSize)},e.transport,e.debug)}function jc(e){return Math.max(0,Math.min(1,e))}function rm(e){let t=String(e!=null?e:"power2.out");if(t==="linear")return i=>i;if(t==="sine.inOut")return i=>.5-Math.cos(Math.PI*i)/2;if(t==="power2.out"||t==="easeOutQuad")return i=>1-(1-i)*(1-i);if(t.startsWith("back.out")){let i=t.match(/back\.out\(([\d.]+)\)/),n=i?Number(i[1]):1.8;return r=>1+(n+1)*Math.pow(r-1,3)+n*Math.pow(r-1,2)}return i=>1-(1-i)*(1-i)}function sn(){return typeof performance!="undefined"&&performance.now?performance.now():Date.now()}function am(e,t){let i=e==null?void 0:e[t];return typeof i=="number"?i:0}function Dc(e,t,i){try{e[t]=i}catch{}}function sm(e){let t=e==null?void 0:e.scale;if(!t)return null;let i=typeof t.x=="number"?t.x:1,n=typeof t.y=="number"?t.y:1;return{x:i,y:n}}function zc(e,t){let i=e==null?void 0:e.scale;if(i)try{typeof i.set=="function"?i.set(t.x,t.y):(typeof i.x=="number"&&(i.x=t.x),typeof i.y=="number"&&(i.y=t.y))}catch{}}function Nc(e,t){let i=sm(e);if(!i)return{from:null,to:null};let n=null,r=null;return typeof t.scale=="number"?(n=t.scale,r=t.scale):t.scale&&typeof t.scale=="object"&&(typeof t.scale.x=="number"&&(n=t.scale.x),typeof t.scale.y=="number"&&(r=t.scale.y)),typeof t.scaleX=="number"&&(n=t.scaleX),typeof t.scaleY=="number"&&(r=t.scaleY),n===null&&r===null?{from:null,to:null}:{from:{x:i.x,y:i.y},to:{x:n!=null?n:i.x,y:r!=null?r:i.y}}}function Bc(){let e=new Set,t=new WeakMap,i=null,n=()=>{if(i!=null)return;i=requestAnimationFrame(()=>{i=null,o(),e.size>0&&n()})},r=d=>{var p;e.add(d);let u=(p=t.get(d.target))!=null?p:new Set;u.add(d),t.set(d.target,u),n()},a=d=>{e.delete(d);let u=t.get(d.target);u&&(u.delete(d),u.size===0&&t.delete(d.target))},s=d=>{d.killed||(d.killed=!0,a(d))},o=()=>{var u,p;let d=sn();for(let f of Array.from(e)){if(f.killed||f.paused)continue;let g=d-f.startMs-f.delayMs;if(g<0)continue;let h=f.durationMs>0?g/f.durationMs:1,m=jc(h),b=f.repeat>=0?f.repeat+1:1,y=f.repeat>0?Math.min(Math.floor(h),b-1):0;if(f.repeat>0&&h>=1){let w=h-y;m=jc(w)}let v=f.ease(m);f.yoyo&&y%2===1&&(v=1-v);for(let w of f.props)Dc(f.target,w.key,w.from+(w.to-w.from)*v);f.scaleFrom&&f.scaleTo&&zc(f.target,{x:f.scaleFrom.x+(f.scaleTo.x-f.scaleFrom.x)*v,y:f.scaleFrom.y+(f.scaleTo.y-f.scaleFrom.y)*v});try{(u=f.onUpdate)==null||u.call(f)}catch{}if(h>=b){s(f);try{(p=f.onComplete)==null||p.call(f)}catch{}}}},l=(d,u,p)=>{var w;let f=Math.max(0,(typeof u.duration=="number"?u.duration:.5)*1e3),g=Math.max(0,(typeof u.delay=="number"?u.delay:0)*1e3+((w=p==null?void 0:p.delayMsOverride)!=null?w:0)),h=rm(u.ease),m=typeof u.repeat=="number"?Math.max(0,u.repeat|0):0,b=u.yoyo===!0,y=new Set(["duration","delay","ease","repeat","yoyo","onUpdate","onComplete","scale","scaleX","scaleY"]),v=[];for(let E of Object.keys(u)){if(y.has(E))continue;let A=u[E];typeof A=="number"&&v.push({key:E,from:am(d,E),to:A})}let x=Nc(d,u);return{target:d,startMs:sn(),delayMs:g,durationMs:f,ease:h,props:v,scaleFrom:x.from,scaleTo:x.to,repeat:m,yoyo:b,onUpdate:typeof u.onUpdate=="function"?u.onUpdate:void 0,onComplete:typeof u.onComplete=="function"?u.onComplete:void 0,killed:!1,paused:!1,pauseAtMs:null}},c={to(d,u){let p=l(d,u);return r(p),{kill:()=>s(p),pause:()=>{p.paused||(p.paused=!0,p.pauseAtMs=sn())},resume:()=>{var h;if(!p.paused)return;let f=(h=p.pauseAtMs)!=null?h:sn(),g=sn()-f;p.startMs+=g,p.paused=!1,p.pauseAtMs=null},isActive:()=>!p.killed&&!p.paused}},fromTo(d,u,p){return c.set(d,u),c.to(d,p)},set(d,u){if(!d||!u)return;for(let f of Object.keys(u)){let g=u[f];f==="scale"||f==="scaleX"||f==="scaleY"||typeof g=="number"&&Dc(d,f,g)}let p=Nc(d,u);p.to&&zc(d,p.to)},killTweensOf(d){let u=t.get(d);if(u)for(let p of Array.from(u))s(p)},timeline(d={}){let u=[],p=0,f=!1,g=[],h=y=>{if(typeof y=="number")return Math.max(0,y*1e3);let v=typeof y=="string"?y.trim():"";return v.startsWith("+=")?p+Math.max(0,Number(v.slice(2))*1e3||0):v?Math.max(0,Number(v)*1e3||0):p},m=y=>{u.push(y);let v=Math.max(0,(typeof y.vars.duration=="number"?y.vars.duration:.5)*1e3);p=Math.max(p,y.atMs+v)},b={to(y,v,x){return m({kind:"to",target:y,vars:v,atMs:h(x)}),b},fromTo(y,v,x,w){return m({kind:"fromTo",target:y,vars:x,from:v,atMs:h(w)}),b},play(){var y,v;if(f)return b;f=!0,g=[];for(let x of u)x.kind==="fromTo"&&c.set(x.target,(y=x.from)!=null?y:{}),g.push(c.to(x.target,{...x.vars,delay:x.atMs/1e3+((v=x.vars.delay)!=null?v:0)}));return b},pause(){for(let y of g)y.pause();return b},kill(){for(let y of g)y.kill();g=[],f=!1}};return d.paused||b.play(),b}};return c}function Fc(){if(typeof window=="undefined")return;let e=window;if(!e.gsap)try{e.gsap=Bc()}catch{}}var $c={name:"handler-playable-sdk",version:"0.3.32",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",sharp:"^0.34.5"}};var ye=0,lm=ye++,Hc=ye++,Uc=ye++,qc=ye++,Gc=ye++,Wc=ye++,Vc=ye++,Yc=ye++,Kc=ye++,Xc=ye++,Zc=ye++,Jc=ye++,K=lm;function Qc(){return K===Hc}function ed(){return K===Uc}function td(){return K===qc}function id(){return K===Gc}function pi(){return K===Wc}function fi(){return K===Vc}function nd(){return K===Yc}function rd(){return K===Kc}function ad(){return K===Xc}function vs(){return K===Zc}function xs(){return K===Jc}function sd(){let e=typeof AD_PROTOCOL!="undefined"?AD_PROTOCOL:"none",t=typeof AD_NETWORK!="undefined"?AD_NETWORK:"web_embed";if(e==="mraid")try{mraid.getState(),K=Hc;return}catch{}else if(e==="dapi")try{dapi.isReady(),K=Uc;return}catch{}if(t==="facebook")try{typeof FbPlayableAd!="undefined"&&(K=qc)}catch{}else if(t==="google")try{typeof ExitApi!="undefined"&&(K=Gc)}catch{}else if(t==="mintegral")window.gameReady&&(K=Wc);else if(t==="tapjoy")window.TJ_API&&(K=Vc);else if(t==="tiktok")window.openAppStore&&(K=Yc);else if(t==="smadex")try{window.smxTracking&&(K=Kc)}catch{}else if(t==="snapchat")try{window.ScPlayableAd&&(K=Xc)}catch{}else t==="vungle"?K=Zc:(e==="nucleo"||t==="nucleo")&&(K=Jc)}var br=di(require("lottie-web"),1),ws=br.default;typeof window!="undefined"&&(window.lottie=br.default,window.__baseLottie=br.default);var cm=require("pixi.js");var _s=require("pixi.js");var dm=null;function Es(e){dm=e}yr();Ss();var on=require("pixi.js");yr();var mm=typeof __BUILD_MODE__!="undefined"?__BUILD_MODE__:"undefined",ks=mm;if(typeof window!="undefined")try{let e=new XMLHttpRequest;if(e.open("GET","./build-settings.json",!1),e.send(),e.status===200&&e.responseText){let t=JSON.parse(e.responseText);t!=null&&t.buildMode&&(ks=t.buildMode,console.log(`[ObjectFactory] Build mode overridden by settings: ${ks}`))}}catch{}var mt=class{static async create(t,i,n){var l,c,d,u,p,f,g;console.log(`[ObjectFactory] create() called for: ${t}, __BUILD_MODE__: ${ks}`);let r=(l=i==null?void 0:i.render)==null?void 0:l.asset;if(!r){console.log(`[ObjectFactory] No asset definition for: ${t}, returning empty container`);let h=new on.Container;return this.applyTransform(h,i==null?void 0:i.transform),h}let a=(c=i==null?void 0:i.identity)==null?void 0:c.id;console.log(`[ObjectFactory] Calling AssetLoader.load() for: ${t}, configId: ${a}, type: ${r.type}, path: ${r.path}`);let s=await Bt.load(t,r,n,a);console.log(`[ObjectFactory] AssetLoader.load() completed for: ${t}, rawAsset type: ${(d=s==null?void 0:s.constructor)==null?void 0:d.name}`);let o;if(r.type==="image")console.log("[ObjectFactory] Creating Sprite from texture:",s,"for object:",t),o=new on.Sprite(s),console.log("[ObjectFactory] Created object:",o,"type:",(u=o==null?void 0:o.constructor)==null?void 0:u.name),this.applyTransform(o,i==null?void 0:i.transform);else if(r.type==="json")if(console.log("[ObjectFactory] JSON asset for",t,"rawAsset type:",(p=s==null?void 0:s.constructor)==null?void 0:p.name,s),s&&(((f=s.constructor)==null?void 0:f.name)==="Container"||s instanceof on.Container)){console.warn("[ObjectFactory] JSON asset is Container (from cache), reloading JSON directly");let h=[r.path,`/assets/${r.path}`,`assets/${r.path}`,`../assets/${r.path}`],m=!1;for(let b of h)try{let y=await fetch(b);if(y.ok){o=await y.json(),console.log("[ObjectFactory] Reloaded JSON directly from:",b,"type:",(g=o==null?void 0:o.constructor)==null?void 0:g.name),m=!0;break}}catch{continue}m||(console.error("[ObjectFactory] Failed to reload JSON from any path"),o=s)}else o=s;else o=s,o&&typeof o=="object"&&("x"in o||"position"in o)&&this.applyTransform(o,i==null?void 0:i.transform);return o}static applyTransform(t,i){var n,r,a,s;!i||!t||(i.position&&("x"in t&&"y"in t?(t.x=(n=i.position.x)!=null?n:0,t.y=(r=i.position.y)!=null?r:0):"position"in t&&t.position&&t.position.set((a=i.position.x)!=null?a:0,(s=i.position.y)!=null?s:0)),i.scale!==void 0&&"scale"in t&&t.scale&&(typeof t.scale=="object"&&"set"in t.scale?t.scale.set(i.scale):t.scale=i.scale),i.rotation!==void 0&&"rotation"in t&&(t.rotation=i.rotation),i.anchor&&"anchor"in t&&t.anchor&&Array.isArray(i.anchor)&&("set"in t.anchor?t.anchor.set(i.anchor[0],i.anchor[1]):(t.anchor.x=i.anchor[0],t.anchor.y=i.anchor[1])))}};var ln=class{constructor(){this.config=null}init(t){this.config=t}get(t){if(!this.config)throw new Error("RuntimeObjectRegistry not initialized. Call init() first.");return this.config.objects.get(t)}getAllIds(){if(!this.config)throw new Error("RuntimeObjectRegistry not initialized. Call init() first.");return Array.from(this.config.objects.keys())}has(t){return this.config?this.config.objects.has(t):!1}};var vm=di(require("pixi.js"),1);typeof window!="undefined"&&(window.__basePixi=vm);hi();var vr=require("pixi.js");hi();var Is=class{constructor(){this.instanceCache=new Map;this.readyPromise=null;this.app=null;this.registry=new ln}init(t,i){this.registry.init(t),this.app=i}updateConfig(t){this.registry.init(t),this.instanceCache.clear(),this.readyPromise=null}async ready(){this.readyPromise&&await this.readyPromise;let i=this.registry.getAllIds().filter(r=>!this.instanceCache.has(r));if(i.length===0)return;let n=async r=>{r.length&&(console.log("[Assets] Loading objects:",r),await Promise.all(r.map(async a=>{var o;let s=this.registry.get(a);if(!s){console.warn("[Assets] No config found for object:",a);return}try{let l=await mt.create(a,s,this.app);this.instanceCache.set(a,l),console.log("[Assets] Loaded object:",a,(o=l==null?void 0:l.constructor)==null?void 0:o.name)}catch(l){console.error("[Assets] Failed to load object:",a,l)}})))};return this.readyPromise=(async()=>{await n(i);let r=this.registry.getAllIds().filter(a=>!this.instanceCache.has(a));r.length>0&&(console.warn("[Assets] Retrying missing assets:",r),await n(r)),console.log("[Assets] Ready. Cached objects:",Array.from(this.instanceCache.keys()))})(),this.readyPromise}resetScene(){this.instanceCache.clear(),this.readyPromise=null}async reloadObject(t){let i=this.registry.get(t);if(i){let n=await mt.create(t,i,this.app);this.instanceCache.set(t,n)}}get(t){return this.instanceCache.get(t)}},xm=new Is,wm=new Proxy(xm,{get(e,t){if(t in e&&typeof e[t]=="function")return e[t].bind(e);if(e.get(t))return e.get(t)}});hi();var pd=require("pixi.js"),Ze={width:400,height:600,designWidth:400,scaleFactor:1},wr={scale:1,position:1},Ps=[];function Em(e,t,i,n,r,a,s){Ps.push({element:e,originalScale:a,positionHelper:t,heightPercent:r}),t(e,i,n,r,a,s,!1)}function Sm(){Ps.forEach(({element:e,originalScale:t,positionHelper:i,heightPercent:n})=>{let r=t*Ze.scaleFactor;i(e,Ze.width,Ze.height,n,r,!0,!1)})}function Ms(e,t){console.log(`[SCREEN] updateScreenState called: ${e}x${t}`),Ze.width=e,Ze.height=t,Ze.scaleFactor=Math.min(e/Ze.designWidth,1.15),wr.scale=Ze.scaleFactor,wr.position=1,console.log(`[SCREEN] Global multipliers - scale: ${wr.scale.toFixed(3)}`),Sm()}var dn={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 Am(e,t,i){let n=dn[e];n&&n[t]!==void 0&&(n[t]=i,console.log(`Updated ${e}.${t} = ${i}`))}function Cm(){return dn}var Tm={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 xr(e,t){return typeof e=="number"&&Number.isFinite(e)?e:t}function _r(e,t={x:.5,y:.5}){var i;if(Array.isArray(e))return{x:xr(e[0],t.x),y:xr(e[1],t.y)};if(e&&typeof e=="object"){let n=e;return{x:xr(n.x,t.x),y:xr(n.y,t.y)}}if(typeof e=="string"){let n=e.trim().toLowerCase();return(i=Tm[n])!=null?i:t}return t}function fd(e,t,i,n={}){var f,g,h,m,b,y;let r=_r(i),a=(f=n.inset)!=null?f:{},s=(g=n.padding)!=null?g:{x:0,y:0},o=((h=a.left)!=null?h:0)+s.x,l=((m=a.right)!=null?m:0)+s.x,c=((b=a.top)!=null?b:0)+s.y,d=((y=a.bottom)!=null?y:0)+s.y,u=Math.max(0,e-o-l),p=Math.max(0,t-c-d);return{x:o+u*r.x,y:c+p*r.y}}function hd(e,t,i,n={}){var h,m,b,y,v,x;let r=(h=n.inset)!=null?h:{},a=(m=n.padding)!=null?m:{x:0,y:0},s=((b=r.left)!=null?b:0)+a.x,o=((y=r.right)!=null?y:0)+a.x,l=((v=r.top)!=null?v:0)+a.y,c=((x=r.bottom)!=null?x:0)+a.y,d=Math.max(0,e-s-o),u=Math.max(0,t-l-c),p=_r(i,{x:.5,y:.5}),f=Math.min(Math.max(p.x,0),1),g=Math.min(Math.max(p.y,0),1);return{x:s+d*f,y:l+u*g}}if(typeof window!="undefined"){let e=window.innerWidth,t=window.innerHeight,i=()=>{let n=window.innerWidth,r=window.innerHeight;(n!==e||r!==t)&&(e=n,t=r,Ms(n,r))};window.addEventListener("resize",i),window.addEventListener("orientationchange",()=>{setTimeout(i,100)}),window.mraid&&(window.mraid.addEventListener("viewableChange",i),window.mraid.addEventListener("sizeChange",i)),Ms(window.innerWidth,window.innerHeight),window.updateDebugConfig=Am,window.getDebugConfig=Cm,window.copyConfig=Nm,window.applyConfig=cn,window.applyConfigForRatio=Bm,window.positionAtBottom=gd,window.positionAtTop=Om,window.positionAtCenter=Im,window.positionAtLeft=Mm,window.positionAtRight=Pm,window.positionAtBottomLeft=Rm,window.positionAtBottomRight=jm,window.positionAtTopLeft=Dm,window.positionAtTopRight=zm,window.applyPositionContract=Lm,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 Er(e,t,i=0){return e*t+i}function Sr(e,t,i=0){return e*(1-t)+i}function Ar(e,t,i=0){return e*t+i}function Cr(e,t,i=0){return e*(1-t)+i}function ve(e,t=0){return e/2+t}function km(e,t){return e*t}function Lm(e,t,i,n){var s,o,l,c,d,u,p,f,g,h,m,b,y,v,x,w,E,A,_,T;let r=0,a=0;switch(n.type){case"top":r=ve(t,(o=(s=n.offset)==null?void 0:s.x)!=null?o:0),a=Er(i,n.percent,(c=(l=n.offset)==null?void 0:l.y)!=null?c:0);break;case"bottom":r=ve(t,(u=(d=n.offset)==null?void 0:d.x)!=null?u:0),a=Sr(i,n.percent,(f=(p=n.offset)==null?void 0:p.y)!=null?f:0);break;case"left":r=Ar(t,n.percent,(h=(g=n.offset)==null?void 0:g.x)!=null?h:0),a=ve(i,(b=(m=n.offset)==null?void 0:m.y)!=null?b:0);break;case"right":r=Cr(t,n.percent,(v=(y=n.offset)==null?void 0:y.x)!=null?v:0),a=ve(i,(w=(x=n.offset)==null?void 0:x.y)!=null?w:0);break;case"center":r=ve(t,(A=(E=n.offset)==null?void 0:E.x)!=null?A:0),a=ve(i,(T=(_=n.offset)==null?void 0:_.y)!=null?T:0);break}e.position?e.position.set(r,a):(e.x=r,e.y=a),n.scale!==void 0&&n.scale!==1&&e.scale&&(typeof e.scale.set=="function"?e.scale.set(n.scale,n.scale):(e.scale.x=n.scale,e.scale.y=n.scale))}function gd(e,t,i,n=.2,r=1,a=!0,s=!1){let o=km(i,n),l=Sr(i,n/2);Je(e,ve(t),l);let c=a?r*Ze.scaleFactor:r;Qe(e,c),s&&!Ps.find(d=>d.element===e)&&Em(e,gd,t,i,n,r,a)}function Om(e,t,i,n=.1,r=1){Je(e,ve(t),Er(i,n)),Qe(e,r)}function Im(e,t,i,n=0,r=0,a=1){Je(e,ve(t,n),ve(i,r)),Qe(e,a)}function Mm(e,t,i,n=.1,r=1){Je(e,Ar(t,n),ve(i)),Qe(e,r)}function Pm(e,t,i,n=.1,r=1){Je(e,Cr(t,n),ve(i)),Qe(e,r)}function Rm(e,t,i,n=.05,r=.05,a=1){Je(e,Ar(t,r),Sr(i,n)),Qe(e,a)}function jm(e,t,i,n=.05,r=.05,a=1){Je(e,Cr(t,r),Sr(i,n)),Qe(e,a)}function Dm(e,t,i,n=.05,r=.05,a=1){Je(e,Ar(t,r),Er(i,n)),Qe(e,a)}function zm(e,t,i,n=.05,r=.05,a=1){Je(e,Cr(t,r),Er(i,n)),Qe(e,a)}function Je(e,t,i){e&&e.position?typeof e.position.set=="function"?e.position.set(t,i):(e.position.x=t,e.position.y=i):e&&(e.x=t,e.y=i)}function Qe(e,t){t!==1&&e&&e.scale&&(typeof e.scale.set=="function"?e.scale.set(t,t):e.scale.x!==void 0&&e.scale.y!==void 0&&(e.scale.x=t,e.scale.y=t))}var Ft={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 Nm(e){return e&&Ft[e]?JSON.parse(JSON.stringify(Ft[e])):JSON.parse(JSON.stringify(dn))}function cn(e){Object.keys(e).forEach(t=>{let i=t;dn[i]&&e[i]&&Object.assign(dn[i],e[i])}),console.log("Config applied:",e)}function Bm(e,t){let i=e/t;i>1.6?(cn(Ft.wide),console.log("Applied WIDE config for ratio:",i)):i<.7?(cn(Ft.tall),console.log("Applied TALL config for ratio:",i)):i>.8&&i<1.2?(cn(Ft.square),console.log("Applied SQUARE config for ratio:",i)):(cn(Ft.default),console.log("Applied DEFAULT config for ratio:",i))}if(typeof window!="undefined"){let e=window;e.configPresets=Ft,e.resolveAnchorVec2=e.resolveAnchorVec2||_r,e.resolveScreenAnchorPoint=e.resolveScreenAnchorPoint||fd,e.resolveScreenRatioPoint=e.resolveScreenRatioPoint||hd}zr();function te(e,t){let i=(r,a)=>a===0?r:i(a,r%a),n=i(e,t);return`${e/n}:${t/n}`}var D_=[{id:"iphone-15-pro-max",label:"iPhone 15 Pro Max",width:430,height:932,category:"iphone",ratio:te(430,932)},{id:"iphone-15-pro",label:"iPhone 15 Pro",width:393,height:852,category:"iphone",ratio:te(393,852)},{id:"iphone-15",label:"iPhone 15",width:393,height:852,category:"iphone",ratio:te(393,852)},{id:"iphone-14",label:"iPhone 14",width:390,height:844,category:"iphone",ratio:te(390,844)},{id:"iphone-se",label:"iPhone SE",width:375,height:667,category:"iphone",ratio:te(375,667)},{id:"iphone-12-mini",label:"iPhone 12 Mini",width:360,height:780,category:"iphone",ratio:te(360,780)}],z_=[{id:"pixel-8-pro",label:"Pixel 8 Pro",width:448,height:998,category:"android",ratio:te(448,998)},{id:"pixel-8",label:"Pixel 8",width:412,height:915,category:"android",ratio:te(412,915)},{id:"samsung-s24-ultra",label:"Samsung S24 Ultra",width:412,height:915,category:"android",ratio:te(412,915)},{id:"samsung-s24",label:"Samsung S24",width:360,height:780,category:"android",ratio:te(360,780)},{id:"samsung-a54",label:"Samsung A54",width:412,height:915,category:"android",ratio:te(412,915)},{id:"oneplus-12",label:"OnePlus 12",width:412,height:915,category:"android",ratio:te(412,915)}],N_=[{id:"ipad-pro-12",label:'iPad Pro 12.9"',width:1024,height:1366,category:"tablet",ratio:te(1024,1366)},{id:"ipad-pro-11",label:'iPad Pro 11"',width:834,height:1194,category:"tablet",ratio:te(834,1194)},{id:"ipad-air",label:"iPad Air",width:820,height:1180,category:"tablet",ratio:te(820,1180)},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"tablet",ratio:te(768,1024)},{id:"samsung-tab-s9",label:"Samsung Tab S9",width:800,height:1280,category:"tablet",ratio:te(800,1280)}],Gs=[{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:te(390,844),mraidScale:.7},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"playable",ratio:te(768,1024),mraidScale:.7}];var Ws=[...Gs],Vs=[{category:"playable",label:"Playable Ad",devices:Gs}],Nr=Gs[0];function Ut(e){return Ws.find(t=>t.id===e)||Nr}function Xm(e){return Ws.filter(t=>t.category===e)}var Br=class{constructor(){this.root=null;this.listContainer=null;this.searchInput=null;this.selectedId=null;this.options=null;this.retryTimer=null;this.screenFilter="all"}getScreenFilterStorageKey(){return`handler_preview_screen_filter::${typeof window!="undefined"&&window.__HANDLER_PROJECT_ID||"default"}`}render(){return`
47
+ `,this.modal=n}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 n=this.modal.querySelector("[data-ai-generate]");n==null||n.addEventListener("click",()=>{this.openAiEditor("generate")});let r=this.modal.querySelector("[data-ai-edit]");r==null||r.addEventListener("click",()=>{this.openAiEditor("edit")});let a=this.modal.querySelector("[data-modal-apply]");a==null||a.addEventListener("click",()=>{this.apply()}),this.modal.addEventListener("click",s=>{s.target===this.modal&&this.close()})}switchTab(t){if(!this.modal)return;this.modal.querySelectorAll("[data-tab]").forEach(r=>{r.classList.toggle("active",r.getAttribute("data-tab")===t)}),this.modal.querySelectorAll("[data-tab-panel]").forEach(r=>{r.classList.toggle("active",r.getAttribute("data-tab-panel")===t)})}openAiEditor(t){let i=window.__openAiEditor;if(typeof i!="function"){alert("AI Editor not available. Please check your setup.");return}let n="";t==="edit"&&this.currentAsset?n=`Edit this image: ${this.currentObjectId}`:n=`Create an image for: ${this.currentObjectId}`,i(this.currentObjectId||"unknown",n,this.currentAsset,{path:this.currentPath,onApply:r=>{this.onApplyCallback&&this.onApplyCallback(r),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 l0={};an(l0,{COLORS:()=>We,ConfigWatcher:()=>Ht,DebugPanel:()=>rr,DefaultReloadStrategy:()=>bn,Handler:()=>Pe,PlayableLoadingScreen:()=>ss,PreviewShell:()=>ns,STROKE_WIDTH:()=>jg,THEME:()=>Dg,applyConfigOverride:()=>bt,applyConfigOverrides:()=>yt,applyConfigsToDisk:()=>hn,applyDefaults:()=>$t,baseLottie:()=>ws,bootstrap:()=>Zw,clearConfigOverrides:()=>vt,clearConfigOverridesForObject:()=>Ed,configOverrideManager:()=>Sd,createPreviewShell:()=>hc,deepClone:()=>ne,default:()=>zt,defaultPreset:()=>Nr,deviceGroups:()=>Vs,devicePresets:()=>Ws,diffConfigs:()=>Fs,exportConfigsAsJSON:()=>fn,getConfigOverrides:()=>de,getConfigStateSummary:()=>Or,getOverrideMode:()=>pn,getPresetById:()=>Ut,getPresetsByCategory:()=>Xm,loadAllObjectConfigs:()=>Rr,loadComponentSchemas:()=>Pr,loadEngineConfig:()=>jr,loadGamePromptConfig:()=>zs,loadObjectCentricConfig:()=>et,loadObjectConfig:()=>xt,loadSceneConfig:()=>Dr,rehydrateObject:()=>$s,removeConfigOverride:()=>Lr,resetToApplied:()=>gn,resetToOriginal:()=>Ir,setBootstrapDependencies:()=>Kw,setOverrideMode:()=>Rs,setupHotReload:()=>qs,setupLiveEditBridge:()=>rs,toLegacyFormat:()=>Ns,validateObjectConfig:()=>gi});module.exports=nm(l0);var ht={};function gr(e,t,i=!1){ht[e]||(ht[e]=[]),ht[e].push({fn:t,once:i})}function bs(e,t){if(ht[e]){if(!t){delete ht[e];return}ht[e]=ht[e].filter(i=>i.fn!==t)}}function mr(e,...t){let i=ht[e];if(i)for(let n of[...i])n.fn(...t),n.once&&bs(e,n.fn)}function be(e,t){gr(e,t,!0)}var ee=null,Ce=[],ui=null;function Pc(e){ee=e,Ce=[],ui!==null&&(clearTimeout(ui),ui=null)}function Rc(){var e,t,i;return{endpoint:(ee==null?void 0:ee.endpoint)||"",transport:(ee==null?void 0:ee.transport)||"beacon",batchSize:(e=ee==null?void 0:ee.batchSize)!=null?e:10,flushIntervalMs:(t=ee==null?void 0:ee.flushIntervalMs)!=null?t:300,maxQueue:(i=ee==null?void 0:ee.maxQueue)!=null?i:200,debug:!!(ee!=null&&ee.debug)}}async function Ic(e,t,i,n){let r=JSON.stringify(t);if(i==="beacon"&&typeof navigator!="undefined"&&typeof navigator.sendBeacon=="function")try{let a=navigator.sendBeacon(e,new Blob([r],{type:"application/json"}));n&&console.log("[handler.telemetry] beacon",a,t);return}catch(a){n&&console.warn("[handler.telemetry] beacon failed, fallback to fetch",a)}try{await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:r,keepalive:!0}),n&&console.log("[handler.telemetry] fetch",t)}catch(a){n&&console.warn("[handler.telemetry] fetch failed",a)}}function ys(e,t){let i=Rc();if(t&&i.endpoint){if(Ce.push(e),Ce.length>i.maxQueue&&(Ce=Ce.slice(Ce.length-i.maxQueue)),Ce.length>=i.batchSize){Mc();return}ui===null&&(ui=window.setTimeout(()=>{ui=null,Mc()},i.flushIntervalMs))}}async function Mc(){let e=Rc();if(!e.endpoint||Ce.length===0)return;let t=Ce.splice(0,e.batchSize);await Ic(e.endpoint,{events:t},e.transport,e.debug),Ce.length>0&&await Ic(e.endpoint,{events:Ce.splice(0,e.batchSize)},e.transport,e.debug)}function jc(e){return Math.max(0,Math.min(1,e))}function rm(e){let t=String(e!=null?e:"power2.out");if(t==="linear")return i=>i;if(t==="sine.inOut")return i=>.5-Math.cos(Math.PI*i)/2;if(t==="power2.out"||t==="easeOutQuad")return i=>1-(1-i)*(1-i);if(t.startsWith("back.out")){let i=t.match(/back\.out\(([\d.]+)\)/),n=i?Number(i[1]):1.8;return r=>1+(n+1)*Math.pow(r-1,3)+n*Math.pow(r-1,2)}return i=>1-(1-i)*(1-i)}function sn(){return typeof performance!="undefined"&&performance.now?performance.now():Date.now()}function am(e,t){let i=e==null?void 0:e[t];return typeof i=="number"?i:0}function Dc(e,t,i){try{e[t]=i}catch{}}function sm(e){let t=e==null?void 0:e.scale;if(!t)return null;let i=typeof t.x=="number"?t.x:1,n=typeof t.y=="number"?t.y:1;return{x:i,y:n}}function zc(e,t){let i=e==null?void 0:e.scale;if(i)try{typeof i.set=="function"?i.set(t.x,t.y):(typeof i.x=="number"&&(i.x=t.x),typeof i.y=="number"&&(i.y=t.y))}catch{}}function Nc(e,t){let i=sm(e);if(!i)return{from:null,to:null};let n=null,r=null;return typeof t.scale=="number"?(n=t.scale,r=t.scale):t.scale&&typeof t.scale=="object"&&(typeof t.scale.x=="number"&&(n=t.scale.x),typeof t.scale.y=="number"&&(r=t.scale.y)),typeof t.scaleX=="number"&&(n=t.scaleX),typeof t.scaleY=="number"&&(r=t.scaleY),n===null&&r===null?{from:null,to:null}:{from:{x:i.x,y:i.y},to:{x:n!=null?n:i.x,y:r!=null?r:i.y}}}function Bc(){let e=new Set,t=new WeakMap,i=null,n=()=>{if(i!=null)return;i=requestAnimationFrame(()=>{i=null,o(),e.size>0&&n()})},r=d=>{var p;e.add(d);let u=(p=t.get(d.target))!=null?p:new Set;u.add(d),t.set(d.target,u),n()},a=d=>{e.delete(d);let u=t.get(d.target);u&&(u.delete(d),u.size===0&&t.delete(d.target))},s=d=>{d.killed||(d.killed=!0,a(d))},o=()=>{var u,p;let d=sn();for(let f of Array.from(e)){if(f.killed||f.paused)continue;let g=d-f.startMs-f.delayMs;if(g<0)continue;let h=f.durationMs>0?g/f.durationMs:1,m=jc(h),b=f.repeat>=0?f.repeat+1:1,y=f.repeat>0?Math.min(Math.floor(h),b-1):0;if(f.repeat>0&&h>=1){let w=h-y;m=jc(w)}let v=f.ease(m);f.yoyo&&y%2===1&&(v=1-v);for(let w of f.props)Dc(f.target,w.key,w.from+(w.to-w.from)*v);f.scaleFrom&&f.scaleTo&&zc(f.target,{x:f.scaleFrom.x+(f.scaleTo.x-f.scaleFrom.x)*v,y:f.scaleFrom.y+(f.scaleTo.y-f.scaleFrom.y)*v});try{(u=f.onUpdate)==null||u.call(f)}catch{}if(h>=b){s(f);try{(p=f.onComplete)==null||p.call(f)}catch{}}}},l=(d,u,p)=>{var w;let f=Math.max(0,(typeof u.duration=="number"?u.duration:.5)*1e3),g=Math.max(0,(typeof u.delay=="number"?u.delay:0)*1e3+((w=p==null?void 0:p.delayMsOverride)!=null?w:0)),h=rm(u.ease),m=typeof u.repeat=="number"?Math.max(0,u.repeat|0):0,b=u.yoyo===!0,y=new Set(["duration","delay","ease","repeat","yoyo","onUpdate","onComplete","scale","scaleX","scaleY"]),v=[];for(let E of Object.keys(u)){if(y.has(E))continue;let A=u[E];typeof A=="number"&&v.push({key:E,from:am(d,E),to:A})}let x=Nc(d,u);return{target:d,startMs:sn(),delayMs:g,durationMs:f,ease:h,props:v,scaleFrom:x.from,scaleTo:x.to,repeat:m,yoyo:b,onUpdate:typeof u.onUpdate=="function"?u.onUpdate:void 0,onComplete:typeof u.onComplete=="function"?u.onComplete:void 0,killed:!1,paused:!1,pauseAtMs:null}},c={to(d,u){let p=l(d,u);return r(p),{kill:()=>s(p),pause:()=>{p.paused||(p.paused=!0,p.pauseAtMs=sn())},resume:()=>{var h;if(!p.paused)return;let f=(h=p.pauseAtMs)!=null?h:sn(),g=sn()-f;p.startMs+=g,p.paused=!1,p.pauseAtMs=null},isActive:()=>!p.killed&&!p.paused}},fromTo(d,u,p){return c.set(d,u),c.to(d,p)},set(d,u){if(!d||!u)return;for(let f of Object.keys(u)){let g=u[f];f==="scale"||f==="scaleX"||f==="scaleY"||typeof g=="number"&&Dc(d,f,g)}let p=Nc(d,u);p.to&&zc(d,p.to)},killTweensOf(d){let u=t.get(d);if(u)for(let p of Array.from(u))s(p)},timeline(d={}){let u=[],p=0,f=!1,g=[],h=y=>{if(typeof y=="number")return Math.max(0,y*1e3);let v=typeof y=="string"?y.trim():"";return v.startsWith("+=")?p+Math.max(0,Number(v.slice(2))*1e3||0):v?Math.max(0,Number(v)*1e3||0):p},m=y=>{u.push(y);let v=Math.max(0,(typeof y.vars.duration=="number"?y.vars.duration:.5)*1e3);p=Math.max(p,y.atMs+v)},b={to(y,v,x){return m({kind:"to",target:y,vars:v,atMs:h(x)}),b},fromTo(y,v,x,w){return m({kind:"fromTo",target:y,vars:x,from:v,atMs:h(w)}),b},play(){var y,v;if(f)return b;f=!0,g=[];for(let x of u)x.kind==="fromTo"&&c.set(x.target,(y=x.from)!=null?y:{}),g.push(c.to(x.target,{...x.vars,delay:x.atMs/1e3+((v=x.vars.delay)!=null?v:0)}));return b},pause(){for(let y of g)y.pause();return b},kill(){for(let y of g)y.kill();g=[],f=!1}};return d.paused||b.play(),b}};return c}function Fc(){if(typeof window=="undefined")return;let e=window;if(!e.gsap)try{e.gsap=Bc()}catch{}}var $c={name:"handler-playable-sdk",version:"0.3.34",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",sharp:"^0.34.5"}};var ye=0,lm=ye++,Hc=ye++,Uc=ye++,qc=ye++,Gc=ye++,Wc=ye++,Vc=ye++,Yc=ye++,Kc=ye++,Xc=ye++,Zc=ye++,Jc=ye++,K=lm;function Qc(){return K===Hc}function ed(){return K===Uc}function td(){return K===qc}function id(){return K===Gc}function pi(){return K===Wc}function fi(){return K===Vc}function nd(){return K===Yc}function rd(){return K===Kc}function ad(){return K===Xc}function vs(){return K===Zc}function xs(){return K===Jc}function sd(){let e=typeof AD_PROTOCOL!="undefined"?AD_PROTOCOL:"none",t=typeof AD_NETWORK!="undefined"?AD_NETWORK:"web_embed";if(e==="mraid")try{mraid.getState(),K=Hc;return}catch{}else if(e==="dapi")try{dapi.isReady(),K=Uc;return}catch{}if(t==="facebook")try{typeof FbPlayableAd!="undefined"&&(K=qc)}catch{}else if(t==="google")try{typeof ExitApi!="undefined"&&(K=Gc)}catch{}else if(t==="mintegral")window.gameReady&&(K=Wc);else if(t==="tapjoy")window.TJ_API&&(K=Vc);else if(t==="tiktok")window.openAppStore&&(K=Yc);else if(t==="smadex")try{window.smxTracking&&(K=Kc)}catch{}else if(t==="snapchat")try{window.ScPlayableAd&&(K=Xc)}catch{}else t==="vungle"?K=Zc:(e==="nucleo"||t==="nucleo")&&(K=Jc)}var br=di(require("lottie-web"),1),ws=br.default;typeof window!="undefined"&&(window.lottie=br.default,window.__baseLottie=br.default);var cm=require("pixi.js");var _s=require("pixi.js");var dm=null;function Es(e){dm=e}yr();Ss();var on=require("pixi.js");yr();var mm=typeof __BUILD_MODE__!="undefined"?__BUILD_MODE__:"undefined",ks=mm;if(typeof window!="undefined")try{let e=new XMLHttpRequest;if(e.open("GET","./build-settings.json",!1),e.send(),e.status===200&&e.responseText){let t=JSON.parse(e.responseText);t!=null&&t.buildMode&&(ks=t.buildMode,console.log(`[ObjectFactory] Build mode overridden by settings: ${ks}`))}}catch{}var mt=class{static async create(t,i,n){var l,c,d,u,p,f,g;console.log(`[ObjectFactory] create() called for: ${t}, __BUILD_MODE__: ${ks}`);let r=(l=i==null?void 0:i.render)==null?void 0:l.asset;if(!r){console.log(`[ObjectFactory] No asset definition for: ${t}, returning empty container`);let h=new on.Container;return this.applyTransform(h,i==null?void 0:i.transform),h}let a=(c=i==null?void 0:i.identity)==null?void 0:c.id;console.log(`[ObjectFactory] Calling AssetLoader.load() for: ${t}, configId: ${a}, type: ${r.type}, path: ${r.path}`);let s=await Bt.load(t,r,n,a);console.log(`[ObjectFactory] AssetLoader.load() completed for: ${t}, rawAsset type: ${(d=s==null?void 0:s.constructor)==null?void 0:d.name}`);let o;if(r.type==="image")console.log("[ObjectFactory] Creating Sprite from texture:",s,"for object:",t),o=new on.Sprite(s),console.log("[ObjectFactory] Created object:",o,"type:",(u=o==null?void 0:o.constructor)==null?void 0:u.name),this.applyTransform(o,i==null?void 0:i.transform);else if(r.type==="json")if(console.log("[ObjectFactory] JSON asset for",t,"rawAsset type:",(p=s==null?void 0:s.constructor)==null?void 0:p.name,s),s&&(((f=s.constructor)==null?void 0:f.name)==="Container"||s instanceof on.Container)){console.warn("[ObjectFactory] JSON asset is Container (from cache), reloading JSON directly");let h=[r.path,`/assets/${r.path}`,`assets/${r.path}`,`../assets/${r.path}`],m=!1;for(let b of h)try{let y=await fetch(b);if(y.ok){o=await y.json(),console.log("[ObjectFactory] Reloaded JSON directly from:",b,"type:",(g=o==null?void 0:o.constructor)==null?void 0:g.name),m=!0;break}}catch{continue}m||(console.error("[ObjectFactory] Failed to reload JSON from any path"),o=s)}else o=s;else o=s,o&&typeof o=="object"&&("x"in o||"position"in o)&&this.applyTransform(o,i==null?void 0:i.transform);return o}static applyTransform(t,i){var n,r,a,s;!i||!t||(i.position&&("x"in t&&"y"in t?(t.x=(n=i.position.x)!=null?n:0,t.y=(r=i.position.y)!=null?r:0):"position"in t&&t.position&&t.position.set((a=i.position.x)!=null?a:0,(s=i.position.y)!=null?s:0)),i.scale!==void 0&&"scale"in t&&t.scale&&(typeof t.scale=="object"&&"set"in t.scale?t.scale.set(i.scale):t.scale=i.scale),i.rotation!==void 0&&"rotation"in t&&(t.rotation=i.rotation),i.anchor&&"anchor"in t&&t.anchor&&Array.isArray(i.anchor)&&("set"in t.anchor?t.anchor.set(i.anchor[0],i.anchor[1]):(t.anchor.x=i.anchor[0],t.anchor.y=i.anchor[1])))}};var ln=class{constructor(){this.config=null}init(t){this.config=t}get(t){if(!this.config)throw new Error("RuntimeObjectRegistry not initialized. Call init() first.");return this.config.objects.get(t)}getAllIds(){if(!this.config)throw new Error("RuntimeObjectRegistry not initialized. Call init() first.");return Array.from(this.config.objects.keys())}has(t){return this.config?this.config.objects.has(t):!1}};var vm=di(require("pixi.js"),1);typeof window!="undefined"&&(window.__basePixi=vm);hi();var vr=require("pixi.js");hi();var Is=class{constructor(){this.instanceCache=new Map;this.readyPromise=null;this.app=null;this.registry=new ln}init(t,i){this.registry.init(t),this.app=i}updateConfig(t){this.registry.init(t),this.instanceCache.clear(),this.readyPromise=null}async ready(){this.readyPromise&&await this.readyPromise;let i=this.registry.getAllIds().filter(r=>!this.instanceCache.has(r));if(i.length===0)return;let n=async r=>{r.length&&(console.log("[Assets] Loading objects:",r),await Promise.all(r.map(async a=>{var o;let s=this.registry.get(a);if(!s){console.warn("[Assets] No config found for object:",a);return}try{let l=await mt.create(a,s,this.app);this.instanceCache.set(a,l),console.log("[Assets] Loaded object:",a,(o=l==null?void 0:l.constructor)==null?void 0:o.name)}catch(l){console.error("[Assets] Failed to load object:",a,l)}})))};return this.readyPromise=(async()=>{await n(i);let r=this.registry.getAllIds().filter(a=>!this.instanceCache.has(a));r.length>0&&(console.warn("[Assets] Retrying missing assets:",r),await n(r)),console.log("[Assets] Ready. Cached objects:",Array.from(this.instanceCache.keys()))})(),this.readyPromise}resetScene(){this.instanceCache.clear(),this.readyPromise=null}async reloadObject(t){let i=this.registry.get(t);if(i){let n=await mt.create(t,i,this.app);this.instanceCache.set(t,n)}}get(t){return this.instanceCache.get(t)}},xm=new Is,wm=new Proxy(xm,{get(e,t){if(t in e&&typeof e[t]=="function")return e[t].bind(e);if(e.get(t))return e.get(t)}});hi();var pd=require("pixi.js"),Ze={width:400,height:600,designWidth:400,scaleFactor:1},wr={scale:1,position:1},Ps=[];function Em(e,t,i,n,r,a,s){Ps.push({element:e,originalScale:a,positionHelper:t,heightPercent:r}),t(e,i,n,r,a,s,!1)}function Sm(){Ps.forEach(({element:e,originalScale:t,positionHelper:i,heightPercent:n})=>{let r=t*Ze.scaleFactor;i(e,Ze.width,Ze.height,n,r,!0,!1)})}function Ms(e,t){console.log(`[SCREEN] updateScreenState called: ${e}x${t}`),Ze.width=e,Ze.height=t,Ze.scaleFactor=Math.min(e/Ze.designWidth,1.15),wr.scale=Ze.scaleFactor,wr.position=1,console.log(`[SCREEN] Global multipliers - scale: ${wr.scale.toFixed(3)}`),Sm()}var dn={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 Am(e,t,i){let n=dn[e];n&&n[t]!==void 0&&(n[t]=i,console.log(`Updated ${e}.${t} = ${i}`))}function Cm(){return dn}var Tm={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 xr(e,t){return typeof e=="number"&&Number.isFinite(e)?e:t}function _r(e,t={x:.5,y:.5}){var i;if(Array.isArray(e))return{x:xr(e[0],t.x),y:xr(e[1],t.y)};if(e&&typeof e=="object"){let n=e;return{x:xr(n.x,t.x),y:xr(n.y,t.y)}}if(typeof e=="string"){let n=e.trim().toLowerCase();return(i=Tm[n])!=null?i:t}return t}function fd(e,t,i,n={}){var f,g,h,m,b,y;let r=_r(i),a=(f=n.inset)!=null?f:{},s=(g=n.padding)!=null?g:{x:0,y:0},o=((h=a.left)!=null?h:0)+s.x,l=((m=a.right)!=null?m:0)+s.x,c=((b=a.top)!=null?b:0)+s.y,d=((y=a.bottom)!=null?y:0)+s.y,u=Math.max(0,e-o-l),p=Math.max(0,t-c-d);return{x:o+u*r.x,y:c+p*r.y}}function hd(e,t,i,n={}){var h,m,b,y,v,x;let r=(h=n.inset)!=null?h:{},a=(m=n.padding)!=null?m:{x:0,y:0},s=((b=r.left)!=null?b:0)+a.x,o=((y=r.right)!=null?y:0)+a.x,l=((v=r.top)!=null?v:0)+a.y,c=((x=r.bottom)!=null?x:0)+a.y,d=Math.max(0,e-s-o),u=Math.max(0,t-l-c),p=_r(i,{x:.5,y:.5}),f=Math.min(Math.max(p.x,0),1),g=Math.min(Math.max(p.y,0),1);return{x:s+d*f,y:l+u*g}}if(typeof window!="undefined"){let e=window.innerWidth,t=window.innerHeight,i=()=>{let n=window.innerWidth,r=window.innerHeight;(n!==e||r!==t)&&(e=n,t=r,Ms(n,r))};window.addEventListener("resize",i),window.addEventListener("orientationchange",()=>{setTimeout(i,100)}),window.mraid&&(window.mraid.addEventListener("viewableChange",i),window.mraid.addEventListener("sizeChange",i)),Ms(window.innerWidth,window.innerHeight),window.updateDebugConfig=Am,window.getDebugConfig=Cm,window.copyConfig=Nm,window.applyConfig=cn,window.applyConfigForRatio=Bm,window.positionAtBottom=gd,window.positionAtTop=Om,window.positionAtCenter=Im,window.positionAtLeft=Mm,window.positionAtRight=Pm,window.positionAtBottomLeft=Rm,window.positionAtBottomRight=jm,window.positionAtTopLeft=Dm,window.positionAtTopRight=zm,window.applyPositionContract=Lm,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 Er(e,t,i=0){return e*t+i}function Sr(e,t,i=0){return e*(1-t)+i}function Ar(e,t,i=0){return e*t+i}function Cr(e,t,i=0){return e*(1-t)+i}function ve(e,t=0){return e/2+t}function km(e,t){return e*t}function Lm(e,t,i,n){var s,o,l,c,d,u,p,f,g,h,m,b,y,v,x,w,E,A,_,T;let r=0,a=0;switch(n.type){case"top":r=ve(t,(o=(s=n.offset)==null?void 0:s.x)!=null?o:0),a=Er(i,n.percent,(c=(l=n.offset)==null?void 0:l.y)!=null?c:0);break;case"bottom":r=ve(t,(u=(d=n.offset)==null?void 0:d.x)!=null?u:0),a=Sr(i,n.percent,(f=(p=n.offset)==null?void 0:p.y)!=null?f:0);break;case"left":r=Ar(t,n.percent,(h=(g=n.offset)==null?void 0:g.x)!=null?h:0),a=ve(i,(b=(m=n.offset)==null?void 0:m.y)!=null?b:0);break;case"right":r=Cr(t,n.percent,(v=(y=n.offset)==null?void 0:y.x)!=null?v:0),a=ve(i,(w=(x=n.offset)==null?void 0:x.y)!=null?w:0);break;case"center":r=ve(t,(A=(E=n.offset)==null?void 0:E.x)!=null?A:0),a=ve(i,(T=(_=n.offset)==null?void 0:_.y)!=null?T:0);break}e.position?e.position.set(r,a):(e.x=r,e.y=a),n.scale!==void 0&&n.scale!==1&&e.scale&&(typeof e.scale.set=="function"?e.scale.set(n.scale,n.scale):(e.scale.x=n.scale,e.scale.y=n.scale))}function gd(e,t,i,n=.2,r=1,a=!0,s=!1){let o=km(i,n),l=Sr(i,n/2);Je(e,ve(t),l);let c=a?r*Ze.scaleFactor:r;Qe(e,c),s&&!Ps.find(d=>d.element===e)&&Em(e,gd,t,i,n,r,a)}function Om(e,t,i,n=.1,r=1){Je(e,ve(t),Er(i,n)),Qe(e,r)}function Im(e,t,i,n=0,r=0,a=1){Je(e,ve(t,n),ve(i,r)),Qe(e,a)}function Mm(e,t,i,n=.1,r=1){Je(e,Ar(t,n),ve(i)),Qe(e,r)}function Pm(e,t,i,n=.1,r=1){Je(e,Cr(t,n),ve(i)),Qe(e,r)}function Rm(e,t,i,n=.05,r=.05,a=1){Je(e,Ar(t,r),Sr(i,n)),Qe(e,a)}function jm(e,t,i,n=.05,r=.05,a=1){Je(e,Cr(t,r),Sr(i,n)),Qe(e,a)}function Dm(e,t,i,n=.05,r=.05,a=1){Je(e,Ar(t,r),Er(i,n)),Qe(e,a)}function zm(e,t,i,n=.05,r=.05,a=1){Je(e,Cr(t,r),Er(i,n)),Qe(e,a)}function Je(e,t,i){e&&e.position?typeof e.position.set=="function"?e.position.set(t,i):(e.position.x=t,e.position.y=i):e&&(e.x=t,e.y=i)}function Qe(e,t){t!==1&&e&&e.scale&&(typeof e.scale.set=="function"?e.scale.set(t,t):e.scale.x!==void 0&&e.scale.y!==void 0&&(e.scale.x=t,e.scale.y=t))}var Ft={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 Nm(e){return e&&Ft[e]?JSON.parse(JSON.stringify(Ft[e])):JSON.parse(JSON.stringify(dn))}function cn(e){Object.keys(e).forEach(t=>{let i=t;dn[i]&&e[i]&&Object.assign(dn[i],e[i])}),console.log("Config applied:",e)}function Bm(e,t){let i=e/t;i>1.6?(cn(Ft.wide),console.log("Applied WIDE config for ratio:",i)):i<.7?(cn(Ft.tall),console.log("Applied TALL config for ratio:",i)):i>.8&&i<1.2?(cn(Ft.square),console.log("Applied SQUARE config for ratio:",i)):(cn(Ft.default),console.log("Applied DEFAULT config for ratio:",i))}if(typeof window!="undefined"){let e=window;e.configPresets=Ft,e.resolveAnchorVec2=e.resolveAnchorVec2||_r,e.resolveScreenAnchorPoint=e.resolveScreenAnchorPoint||fd,e.resolveScreenRatioPoint=e.resolveScreenRatioPoint||hd}zr();function te(e,t){let i=(r,a)=>a===0?r:i(a,r%a),n=i(e,t);return`${e/n}:${t/n}`}var D_=[{id:"iphone-15-pro-max",label:"iPhone 15 Pro Max",width:430,height:932,category:"iphone",ratio:te(430,932)},{id:"iphone-15-pro",label:"iPhone 15 Pro",width:393,height:852,category:"iphone",ratio:te(393,852)},{id:"iphone-15",label:"iPhone 15",width:393,height:852,category:"iphone",ratio:te(393,852)},{id:"iphone-14",label:"iPhone 14",width:390,height:844,category:"iphone",ratio:te(390,844)},{id:"iphone-se",label:"iPhone SE",width:375,height:667,category:"iphone",ratio:te(375,667)},{id:"iphone-12-mini",label:"iPhone 12 Mini",width:360,height:780,category:"iphone",ratio:te(360,780)}],z_=[{id:"pixel-8-pro",label:"Pixel 8 Pro",width:448,height:998,category:"android",ratio:te(448,998)},{id:"pixel-8",label:"Pixel 8",width:412,height:915,category:"android",ratio:te(412,915)},{id:"samsung-s24-ultra",label:"Samsung S24 Ultra",width:412,height:915,category:"android",ratio:te(412,915)},{id:"samsung-s24",label:"Samsung S24",width:360,height:780,category:"android",ratio:te(360,780)},{id:"samsung-a54",label:"Samsung A54",width:412,height:915,category:"android",ratio:te(412,915)},{id:"oneplus-12",label:"OnePlus 12",width:412,height:915,category:"android",ratio:te(412,915)}],N_=[{id:"ipad-pro-12",label:'iPad Pro 12.9"',width:1024,height:1366,category:"tablet",ratio:te(1024,1366)},{id:"ipad-pro-11",label:'iPad Pro 11"',width:834,height:1194,category:"tablet",ratio:te(834,1194)},{id:"ipad-air",label:"iPad Air",width:820,height:1180,category:"tablet",ratio:te(820,1180)},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"tablet",ratio:te(768,1024)},{id:"samsung-tab-s9",label:"Samsung Tab S9",width:800,height:1280,category:"tablet",ratio:te(800,1280)}],Gs=[{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:te(390,844),mraidScale:.7},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"playable",ratio:te(768,1024),mraidScale:.7}];var Ws=[...Gs],Vs=[{category:"playable",label:"Playable Ad",devices:Gs}],Nr=Gs[0];function Ut(e){return Ws.find(t=>t.id===e)||Nr}function Xm(e){return Ws.filter(t=>t.category===e)}var Br=class{constructor(){this.root=null;this.listContainer=null;this.searchInput=null;this.selectedId=null;this.options=null;this.retryTimer=null;this.screenFilter="all"}getScreenFilterStorageKey(){return`handler_preview_screen_filter::${typeof window!="undefined"&&window.__HANDLER_PROJECT_ID||"default"}`}render(){return`
48
48
  <div class="scene-panel scene-objects panel-accent-teal" data-panel="scene-objects" style="left:16px; top:72px;">
49
49
  <div class="scene-panel-header" data-panel-handle>
50
50
  <div class="panel-title">
package/dist/index.css CHANGED
@@ -3384,6 +3384,128 @@
3384
3384
  filter: grayscale(1);
3385
3385
  opacity: 0.5;
3386
3386
  }
3387
+ /* Version Management Section */
3388
+ .version-management-section {
3389
+ margin-top: 16px;
3390
+ padding: 12px;
3391
+ background: rgba(30, 35, 45, 0.5);
3392
+ border: 1px solid var(--ui-border);
3393
+ border-radius: 10px;
3394
+ }
3395
+
3396
+ .version-header {
3397
+ margin-bottom: 12px;
3398
+ }
3399
+
3400
+ .version-label {
3401
+ font-size: 11px;
3402
+ font-weight: 700;
3403
+ text-transform: uppercase;
3404
+ letter-spacing: 0.05em;
3405
+ color: var(--ui-accent);
3406
+ }
3407
+
3408
+ .version-controls {
3409
+ display: flex;
3410
+ flex-direction: column;
3411
+ gap: 12px;
3412
+ }
3413
+
3414
+ .version-current {
3415
+ display: flex;
3416
+ align-items: center;
3417
+ gap: 8px;
3418
+ }
3419
+
3420
+ .version-current label {
3421
+ font-size: 12px;
3422
+ color: var(--ui-text);
3423
+ min-width: 110px;
3424
+ font-weight: 600;
3425
+ }
3426
+
3427
+ .version-dropdown {
3428
+ flex: 1;
3429
+ padding: 8px 10px;
3430
+ border: 1px solid var(--ui-border);
3431
+ border-radius: 6px;
3432
+ background: var(--ui-surface);
3433
+ color: var(--ui-text);
3434
+ font-size: 12px;
3435
+ cursor: pointer;
3436
+ transition: border-color var(--ui-duration-fast);
3437
+ }
3438
+
3439
+ .version-dropdown:hover {
3440
+ border-color: var(--ui-accent);
3441
+ }
3442
+
3443
+ .version-dropdown:focus {
3444
+ outline: none;
3445
+ border-color: var(--ui-accent);
3446
+ box-shadow: 0 0 0 2px rgba(61, 214, 198, 0.2);
3447
+ }
3448
+
3449
+ .persistence-btn {
3450
+ padding: 10px 16px;
3451
+ background: var(--ui-surface);
3452
+ color: var(--ui-text);
3453
+ border: 1px solid var(--ui-border);
3454
+ border-radius: 8px;
3455
+ font-size: 11px;
3456
+ font-weight: 700;
3457
+ cursor: pointer;
3458
+ transition: all var(--ui-duration-fast);
3459
+ }
3460
+
3461
+ .persistence-btn:hover:not(:disabled) {
3462
+ background: rgba(61, 214, 198, 0.1);
3463
+ border-color: var(--ui-accent);
3464
+ }
3465
+
3466
+ .persistence-btn:disabled {
3467
+ opacity: 0.5;
3468
+ cursor: not-allowed;
3469
+ }
3470
+
3471
+ /* Developer-Only Section */
3472
+ .dev-only-section {
3473
+ margin-top: 16px;
3474
+ padding: 12px;
3475
+ background: rgba(255, 165, 0, 0.08);
3476
+ border: 1px solid rgba(255, 165, 0, 0.3);
3477
+ border-radius: 8px;
3478
+ }
3479
+
3480
+ .dev-warning {
3481
+ font-size: 11px;
3482
+ color: #ff8c00;
3483
+ font-weight: 700;
3484
+ margin-bottom: 8px;
3485
+ text-transform: uppercase;
3486
+ letter-spacing: 0.05em;
3487
+ }
3488
+
3489
+ .persistence-btn.danger-action {
3490
+ background: #dc3545;
3491
+ border-color: #dc3545;
3492
+ color: white;
3493
+ width: 100%;
3494
+ }
3495
+
3496
+ .persistence-btn.danger-action:hover:not(:disabled) {
3497
+ background: #c82333;
3498
+ border-color: #c82333;
3499
+ box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
3500
+ }
3501
+
3502
+ .dev-hint {
3503
+ margin-top: 8px;
3504
+ font-size: 10px;
3505
+ color: var(--ui-muted);
3506
+ font-style: italic;
3507
+ line-height: 1.4;
3508
+ }
3387
3509
 
3388
3510
 
3389
3511
  /* ========== 08-inspector.css ========== */
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-UAQZO7QB.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-Q7FPWOA3.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-PHSE57CN.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-Q7FPWOA3.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};
@@ -44,7 +44,7 @@
44
44
  <button class="debug-btn primary" data-modal-apply>Apply</button>
45
45
  </div>
46
46
  </div>
47
- `,this.modal=n}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 l=o.target.dataset.tab;l&&this.switchTab(l)})});let n=this.modal.querySelector("[data-ai-generate]");n==null||n.addEventListener("click",()=>{this.openAiEditor("generate")});let r=this.modal.querySelector("[data-ai-edit]");r==null||r.addEventListener("click",()=>{this.openAiEditor("edit")});let a=this.modal.querySelector("[data-modal-apply]");a==null||a.addEventListener("click",()=>{this.apply()}),this.modal.addEventListener("click",s=>{s.target===this.modal&&this.close()})}switchTab(t){if(!this.modal)return;this.modal.querySelectorAll("[data-tab]").forEach(r=>{r.classList.toggle("active",r.getAttribute("data-tab")===t)}),this.modal.querySelectorAll("[data-tab-panel]").forEach(r=>{r.classList.toggle("active",r.getAttribute("data-tab-panel")===t)})}openAiEditor(t){let i=window.__openAiEditor;if(typeof i!="function"){alert("AI Editor not available. Please check your setup.");return}let n="";t==="edit"&&this.currentAsset?n=`Edit this image: ${this.currentObjectId}`:n=`Create an image for: ${this.currentObjectId}`,i(this.currentObjectId||"unknown",n,this.currentAsset,{path:this.currentPath,onApply:r=>{this.onApplyCallback&&this.onApplyCallback(r),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 $v={};rl($v,{AssetCache:()=>Be,AssetLoader:()=>xt,AssetSystem:()=>Qr,AssetTextures:()=>wt,Assets:()=>jf,BaseSystem:()=>Oi,GameEngine:()=>Jr,GameObject:()=>Dn,GameObjectManager:()=>ki,ObjectFactory:()=>_t,Renderer:()=>jn,RuntimeObjectRegistry:()=>Ii,Transform:()=>Rn,applyScreenAnchor:()=>ia,basePixi:()=>If,clearResponsiveElements:()=>zf,createPixiBase:()=>Xr,getRegisteredFontIds:()=>Tf,globalResponsiveMultipliers:()=>Nn,initAssetTextures:()=>Ur,initAssets:()=>Df,layout:()=>Bf,playLottieOverlay:()=>Lf,registerFont:()=>Cf,registerType:()=>$r,resolveAnchorVec2:()=>Bn,resolveFont:()=>Sf,resolveFontWeight:()=>Af,resolveScreenAnchorPoint:()=>Mi,resolveScreenRatioPoint:()=>Pi,runInitSequence:()=>Ff,setLottieInstance:()=>qr,spawnSceneFromConfig:()=>Pf,updateScreenState:()=>ta});module.exports=Wf($v);var Ef=require("pixi.js");var st={};function Gn(e,t,i=!1){st[e]||(st[e]=[]),st[e].push({fn:t,once:i})}function ca(e,t){if(st[e]){if(!t){delete st[e];return}st[e]=st[e].filter(i=>i.fn!==t)}}function Wn(e,...t){let i=st[e];if(i)for(let n of[...i])n.fn(...t),n.once&&ca(e,n.fn)}function ge(e,t){Gn(e,t,!0)}var X=null,Ee=[],qt=null;function ll(e){X=e,Ee=[],qt!==null&&(clearTimeout(qt),qt=null)}function cl(){var e,t,i;return{endpoint:(X==null?void 0:X.endpoint)||"",transport:(X==null?void 0:X.transport)||"beacon",batchSize:(e=X==null?void 0:X.batchSize)!=null?e:10,flushIntervalMs:(t=X==null?void 0:X.flushIntervalMs)!=null?t:300,maxQueue:(i=X==null?void 0:X.maxQueue)!=null?i:200,debug:!!(X!=null&&X.debug)}}async function sl(e,t,i,n){let r=JSON.stringify(t);if(i==="beacon"&&typeof navigator!="undefined"&&typeof navigator.sendBeacon=="function")try{let a=navigator.sendBeacon(e,new Blob([r],{type:"application/json"}));n&&console.log("[handler.telemetry] beacon",a,t);return}catch(a){n&&console.warn("[handler.telemetry] beacon failed, fallback to fetch",a)}try{await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:r,keepalive:!0}),n&&console.log("[handler.telemetry] fetch",t)}catch(a){n&&console.warn("[handler.telemetry] fetch failed",a)}}function da(e,t){let i=cl();if(t&&i.endpoint){if(Ee.push(e),Ee.length>i.maxQueue&&(Ee=Ee.slice(Ee.length-i.maxQueue)),Ee.length>=i.batchSize){ol();return}qt===null&&(qt=window.setTimeout(()=>{qt=null,ol()},i.flushIntervalMs))}}async function ol(){let e=cl();if(!e.endpoint||Ee.length===0)return;let t=Ee.splice(0,e.batchSize);await sl(e.endpoint,{events:t},e.transport,e.debug),Ee.length>0&&await sl(e.endpoint,{events:Ee.splice(0,e.batchSize)},e.transport,e.debug)}function dl(e){return Math.max(0,Math.min(1,e))}function Vf(e){let t=String(e!=null?e:"power2.out");if(t==="linear")return i=>i;if(t==="sine.inOut")return i=>.5-Math.cos(Math.PI*i)/2;if(t==="power2.out"||t==="easeOutQuad")return i=>1-(1-i)*(1-i);if(t.startsWith("back.out")){let i=t.match(/back\.out\(([\d.]+)\)/),n=i?Number(i[1]):1.8;return r=>1+(n+1)*Math.pow(r-1,3)+n*Math.pow(r-1,2)}return i=>1-(1-i)*(1-i)}function Hi(){return typeof performance!="undefined"&&performance.now?performance.now():Date.now()}function Yf(e,t){let i=e==null?void 0:e[t];return typeof i=="number"?i:0}function ul(e,t,i){try{e[t]=i}catch{}}function Kf(e){let t=e==null?void 0:e.scale;if(!t)return null;let i=typeof t.x=="number"?t.x:1,n=typeof t.y=="number"?t.y:1;return{x:i,y:n}}function pl(e,t){let i=e==null?void 0:e.scale;if(i)try{typeof i.set=="function"?i.set(t.x,t.y):(typeof i.x=="number"&&(i.x=t.x),typeof i.y=="number"&&(i.y=t.y))}catch{}}function fl(e,t){let i=Kf(e);if(!i)return{from:null,to:null};let n=null,r=null;return typeof t.scale=="number"?(n=t.scale,r=t.scale):t.scale&&typeof t.scale=="object"&&(typeof t.scale.x=="number"&&(n=t.scale.x),typeof t.scale.y=="number"&&(r=t.scale.y)),typeof t.scaleX=="number"&&(n=t.scaleX),typeof t.scaleY=="number"&&(r=t.scaleY),n===null&&r===null?{from:null,to:null}:{from:{x:i.x,y:i.y},to:{x:n!=null?n:i.x,y:r!=null?r:i.y}}}function hl(){let e=new Set,t=new WeakMap,i=null,n=()=>{if(i!=null)return;i=requestAnimationFrame(()=>{i=null,o(),e.size>0&&n()})},r=c=>{var u;e.add(c);let f=(u=t.get(c.target))!=null?u:new Set;f.add(c),t.set(c.target,f),n()},a=c=>{e.delete(c);let f=t.get(c.target);f&&(f.delete(c),f.size===0&&t.delete(c.target))},s=c=>{c.killed||(c.killed=!0,a(c))},o=()=>{var f,u;let c=Hi();for(let p of Array.from(e)){if(p.killed||p.paused)continue;let v=c-p.startMs-p.delayMs;if(v<0)continue;let m=p.durationMs>0?v/p.durationMs:1,w=dl(m),g=p.repeat>=0?p.repeat+1:1,h=p.repeat>0?Math.min(Math.floor(m),g-1):0;if(p.repeat>0&&m>=1){let b=m-h;w=dl(b)}let x=p.ease(w);p.yoyo&&h%2===1&&(x=1-x);for(let b of p.props)ul(p.target,b.key,b.from+(b.to-b.from)*x);p.scaleFrom&&p.scaleTo&&pl(p.target,{x:p.scaleFrom.x+(p.scaleTo.x-p.scaleFrom.x)*x,y:p.scaleFrom.y+(p.scaleTo.y-p.scaleFrom.y)*x});try{(f=p.onUpdate)==null||f.call(p)}catch{}if(m>=g){s(p);try{(u=p.onComplete)==null||u.call(p)}catch{}}}},d=(c,f,u)=>{var b;let p=Math.max(0,(typeof f.duration=="number"?f.duration:.5)*1e3),v=Math.max(0,(typeof f.delay=="number"?f.delay:0)*1e3+((b=u==null?void 0:u.delayMsOverride)!=null?b:0)),m=Vf(f.ease),w=typeof f.repeat=="number"?Math.max(0,f.repeat|0):0,g=f.yoyo===!0,h=new Set(["duration","delay","ease","repeat","yoyo","onUpdate","onComplete","scale","scaleX","scaleY"]),x=[];for(let C of Object.keys(f)){if(h.has(C))continue;let S=f[C];typeof S=="number"&&x.push({key:C,from:Yf(c,C),to:S})}let y=fl(c,f);return{target:c,startMs:Hi(),delayMs:v,durationMs:p,ease:m,props:x,scaleFrom:y.from,scaleTo:y.to,repeat:w,yoyo:g,onUpdate:typeof f.onUpdate=="function"?f.onUpdate:void 0,onComplete:typeof f.onComplete=="function"?f.onComplete:void 0,killed:!1,paused:!1,pauseAtMs:null}},l={to(c,f){let u=d(c,f);return r(u),{kill:()=>s(u),pause:()=>{u.paused||(u.paused=!0,u.pauseAtMs=Hi())},resume:()=>{var m;if(!u.paused)return;let p=(m=u.pauseAtMs)!=null?m:Hi(),v=Hi()-p;u.startMs+=v,u.paused=!1,u.pauseAtMs=null},isActive:()=>!u.killed&&!u.paused}},fromTo(c,f,u){return l.set(c,f),l.to(c,u)},set(c,f){if(!c||!f)return;for(let p of Object.keys(f)){let v=f[p];p==="scale"||p==="scaleX"||p==="scaleY"||typeof v=="number"&&ul(c,p,v)}let u=fl(c,f);u.to&&pl(c,u.to)},killTweensOf(c){let f=t.get(c);if(f)for(let u of Array.from(f))s(u)},timeline(c={}){let f=[],u=0,p=!1,v=[],m=h=>{if(typeof h=="number")return Math.max(0,h*1e3);let x=typeof h=="string"?h.trim():"";return x.startsWith("+=")?u+Math.max(0,Number(x.slice(2))*1e3||0):x?Math.max(0,Number(x)*1e3||0):u},w=h=>{f.push(h);let x=Math.max(0,(typeof h.vars.duration=="number"?h.vars.duration:.5)*1e3);u=Math.max(u,h.atMs+x)},g={to(h,x,y){return w({kind:"to",target:h,vars:x,atMs:m(y)}),g},fromTo(h,x,y,b){return w({kind:"fromTo",target:h,vars:y,from:x,atMs:m(b)}),g},play(){var h,x;if(p)return g;p=!0,v=[];for(let y of f)y.kind==="fromTo"&&l.set(y.target,(h=y.from)!=null?h:{}),v.push(l.to(y.target,{...y.vars,delay:y.atMs/1e3+((x=y.vars.delay)!=null?x:0)}));return g},pause(){for(let h of v)h.pause();return g},kill(){for(let h of v)h.kill();v=[],p=!1}};return c.paused||g.play(),g}};return l}function gl(){if(typeof window=="undefined")return;let e=window;if(!e.gsap)try{e.gsap=hl()}catch{}}var ml={name:"handler-playable-sdk",version:"0.3.32",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",sharp:"^0.34.5"}};var me=0,Zf=me++,bl=me++,yl=me++,vl=me++,xl=me++,wl=me++,_l=me++,El=me++,Sl=me++,Al=me++,Cl=me++,Tl=me++,q=Zf;function kl(){return q===bl}function Ll(){return q===yl}function Ol(){return q===vl}function Il(){return q===xl}function Gt(){return q===wl}function Wt(){return q===_l}function Ml(){return q===El}function Pl(){return q===Sl}function Rl(){return q===Al}function ua(){return q===Cl}function pa(){return q===Tl}function jl(){let e=typeof AD_PROTOCOL!="undefined"?AD_PROTOCOL:"none",t=typeof AD_NETWORK!="undefined"?AD_NETWORK:"web_embed";if(e==="mraid")try{mraid.getState(),q=bl;return}catch{}else if(e==="dapi")try{dapi.isReady(),q=yl;return}catch{}if(t==="facebook")try{typeof FbPlayableAd!="undefined"&&(q=vl)}catch{}else if(t==="google")try{typeof ExitApi!="undefined"&&(q=xl)}catch{}else if(t==="mintegral")window.gameReady&&(q=wl);else if(t==="tapjoy")window.TJ_API&&(q=_l);else if(t==="tiktok")window.openAppStore&&(q=El);else if(t==="smadex")try{window.smxTracking&&(q=Sl)}catch{}else if(t==="snapchat")try{window.ScPlayableAd&&(q=Al)}catch{}else t==="vungle"?q=Cl:(e==="nucleo"||t==="nucleo")&&(q=Tl)}var Vn=qn(require("lottie-web"),1),Dl=Vn.default;typeof window!="undefined"&&(window.lottie=Vn.default,window.__baseLottie=Vn.default);ga();function Z(e,t){let i=(r,a)=>a===0?r:i(a,r%a),n=i(e,t);return`${e/n}:${t/n}`}var xx=[{id:"iphone-15-pro-max",label:"iPhone 15 Pro Max",width:430,height:932,category:"iphone",ratio:Z(430,932)},{id:"iphone-15-pro",label:"iPhone 15 Pro",width:393,height:852,category:"iphone",ratio:Z(393,852)},{id:"iphone-15",label:"iPhone 15",width:393,height:852,category:"iphone",ratio:Z(393,852)},{id:"iphone-14",label:"iPhone 14",width:390,height:844,category:"iphone",ratio:Z(390,844)},{id:"iphone-se",label:"iPhone SE",width:375,height:667,category:"iphone",ratio:Z(375,667)},{id:"iphone-12-mini",label:"iPhone 12 Mini",width:360,height:780,category:"iphone",ratio:Z(360,780)}],wx=[{id:"pixel-8-pro",label:"Pixel 8 Pro",width:448,height:998,category:"android",ratio:Z(448,998)},{id:"pixel-8",label:"Pixel 8",width:412,height:915,category:"android",ratio:Z(412,915)},{id:"samsung-s24-ultra",label:"Samsung S24 Ultra",width:412,height:915,category:"android",ratio:Z(412,915)},{id:"samsung-s24",label:"Samsung S24",width:360,height:780,category:"android",ratio:Z(360,780)},{id:"samsung-a54",label:"Samsung A54",width:412,height:915,category:"android",ratio:Z(412,915)},{id:"oneplus-12",label:"OnePlus 12",width:412,height:915,category:"android",ratio:Z(412,915)}],_x=[{id:"ipad-pro-12",label:'iPad Pro 12.9"',width:1024,height:1366,category:"tablet",ratio:Z(1024,1366)},{id:"ipad-pro-11",label:'iPad Pro 11"',width:834,height:1194,category:"tablet",ratio:Z(834,1194)},{id:"ipad-air",label:"iPad Air",width:820,height:1180,category:"tablet",ratio:Z(820,1180)},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"tablet",ratio:Z(768,1024)},{id:"samsung-tab-s9",label:"Samsung Tab S9",width:800,height:1280,category:"tablet",ratio:Z(800,1280)}],Fl=[{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:Z(390,844),mraidScale:.7},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"playable",ratio:Z(768,1024),mraidScale:.7}];var Ex=[...Fl];var ah=Fl[0];ot();var qy=qn(Jp(),1);function $y(e){return new Promise((t,i)=>{let n=new FileReader;n.onerror=()=>i(new Error("FileReader failed")),n.onload=()=>t(String(n.result||"")),n.readAsDataURL(e)})}function Hy(e){var r;let[t,i]=e.split(","),n=t==null?void 0:t.match(/data:(.*?);base64/);return{base64:i!=null?i:"",mimeType:(r=n==null?void 0:n[1])!=null?r:"image/png"}}async function Uy(e){return await new Promise(t=>{let i=new Image;i.onload=()=>t({width:i.naturalWidth||i.width,height:i.naturalHeight||i.height}),i.onerror=()=>t(null),i.src=e})}async function ao(e){var t,i;try{console.log("[ImageUtils] Fetching image data from URL:",e);let n=await fetch(e);if(!n.ok)return console.warn("[ImageUtils] Fetch failed with status:",n.status,e),null;let r=await n.blob();console.log("[ImageUtils] Blob received, size:",r.size,"type:",r.type);let a=await $y(r),s=await Uy(a),o=Hy(a);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:a,width:(t=s==null?void 0:s.width)!=null?t:0,height:(i=s==null?void 0:s.height)!=null?i:0}}catch(n){return console.error("[ImageUtils] Error fetching image data:",n),null}}async function Br(e,t=30){try{console.log("[ImageUtils] Removing background color...");let i=await new Promise((f,u)=>{let p=new Image;p.onload=()=>f(p),p.onerror=()=>u(new Error("Failed to load image")),p.src=e}),n=document.createElement("canvas");n.width=i.width,n.height=i.height;let r=n.getContext("2d");if(!r)return console.error("[ImageUtils] Failed to get canvas context"),e;r.drawImage(i,0,0);let a=r.getImageData(0,0,n.width,n.height),s=a.data,d=[{name:"top-left",offset:0},{name:"top-right",offset:(n.width-1)*4},{name:"bottom-left",offset:(n.height-1)*n.width*4},{name:"bottom-right",offset:((n.height-1)*n.width+(n.width-1))*4}].map(f=>({r:s[f.offset],g:s[f.offset+1],b:s[f.offset+2]})),l=0;for(let f=0;f<s.length;f+=4){let u=s[f],p=s[f+1],v=s[f+2],m=!1;for(let w of d)if(Math.sqrt(Math.pow(u-w.r,2)+Math.pow(p-w.g,2)+Math.pow(v-w.b,2))<t){m=!0;break}m&&(s[f+3]=0,l++)}return console.log(`[ImageUtils] Removed background from ${l} pixels (4-corner sampling, tolerance: ${t})`),r.putImageData(a,0,0),n.toDataURL("image/png")}catch(i){return console.error("[ImageUtils] Error removing background:",i),e}}var Qp=require("@google/genai");async function so(e,t,i=[],n={}){var r,a,s,o,d,l,c;try{if(!(e!=null&&e.trim()))throw new Error("Gemini API key is required");if(!(t!=null&&t.trim()))throw new Error("Prompt is required");for(let g=0;g<i.length;g++){let h=i[g];if(!h.base64||!h.mimeType)throw new Error(`Image ${g+1} is missing required data`);if(h.base64.length<1e3&&console.warn(`Image ${g+1} data appears very small, may be corrupted`),!h.mimeType.startsWith("image/"))throw new Error(`Image ${g+1} has invalid MIME type: ${h.mimeType}`)}let f=new Qp.GoogleGenAI({apiKey:e}),u="gemini-2.5-flash",p=[t];i.length>0&&i.forEach((g,h)=>{p.push({inlineData:{data:g.base64,mimeType:g.mimeType}}),console.log(`[Gemini] Added image ${h+1}: ${g.mimeType}, size: ${Math.round(g.base64.length/1024)}KB`)}),console.log(`[Gemini] Making request with ${i.length} images and prompt length: ${t.length}`);let v=await f.models.generateContent({model:u,contents:p}),m="",w=(s=(a=(r=v.candidates)==null?void 0:r[0])==null?void 0:a.content)==null?void 0:s.parts;if(w)for(let g of w)g.text&&(m+=g.text);if(!m.trim())throw new Error("Empty response from Gemini API");return console.log(`[Gemini] Response received, length: ${m.length}`),m}catch(f){throw console.error("[Gemini] API error:",f),(o=f.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=f.message)!=null&&d.includes("API_KEY_INVALID")?new Error("Invalid Gemini API key. Please check your API key configuration."):(l=f.message)!=null&&l.includes("QUOTA_EXCEEDED")?new Error("Gemini API quota exceeded. Please try again later or check your billing."):(c=f.message)!=null&&c.includes("SAFETY")?new Error("Content was flagged by Gemini safety filters. Please try with different images."):f}}var ef=require("@google/genai");async function Fr(e,t,i=[],n={}){try{console.info("[GEMINI-REAL-SDK] Initializing GoogleGenAI...");let r=new ef.GoogleGenAI({apiKey:e}),a=[{text:t}];i.length>0&&i.forEach((o,d)=>{console.info(`[GEMINI-REAL-SDK] Adding image part ${d}`),a.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 r.models.generateContent({model:"gemini-2.5-flash-image",contents:a});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,l=o.inlineData.mimeType||"image/png";return console.info("[GEMINI-REAL-SDK] Found inline image data in response"),`data:${l};base64,${d}`}throw new Error("Gemini 2.5 Flash Image returned no image data.")}catch(r){throw console.error("[GEMINI-REAL-SDK] Error in generateImageWithGemini25Flash:",JSON.stringify(r,Object.getOwnPropertyNames(r),2)),r}}var Xy=require("pixi.js");An();ot();var of=require("pixi.js");var Zy=require("pixi.js");ot();function rv(e){return new Promise((t,i)=>{let n=new FileReader;n.onerror=()=>i(new Error("FileReader failed")),n.onload=()=>t(String(n.result||"")),n.readAsDataURL(e)})}function av(e){var r;let[t,i]=e.split(","),n=t==null?void 0:t.match(/data:(.*?);base64/);return{base64:i!=null?i:"",mimeType:(r=n==null?void 0:n[1])!=null?r:"image/png"}}function sv(e){return`
47
+ `,this.modal=n}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 l=o.target.dataset.tab;l&&this.switchTab(l)})});let n=this.modal.querySelector("[data-ai-generate]");n==null||n.addEventListener("click",()=>{this.openAiEditor("generate")});let r=this.modal.querySelector("[data-ai-edit]");r==null||r.addEventListener("click",()=>{this.openAiEditor("edit")});let a=this.modal.querySelector("[data-modal-apply]");a==null||a.addEventListener("click",()=>{this.apply()}),this.modal.addEventListener("click",s=>{s.target===this.modal&&this.close()})}switchTab(t){if(!this.modal)return;this.modal.querySelectorAll("[data-tab]").forEach(r=>{r.classList.toggle("active",r.getAttribute("data-tab")===t)}),this.modal.querySelectorAll("[data-tab-panel]").forEach(r=>{r.classList.toggle("active",r.getAttribute("data-tab-panel")===t)})}openAiEditor(t){let i=window.__openAiEditor;if(typeof i!="function"){alert("AI Editor not available. Please check your setup.");return}let n="";t==="edit"&&this.currentAsset?n=`Edit this image: ${this.currentObjectId}`:n=`Create an image for: ${this.currentObjectId}`,i(this.currentObjectId||"unknown",n,this.currentAsset,{path:this.currentPath,onApply:r=>{this.onApplyCallback&&this.onApplyCallback(r),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 $v={};rl($v,{AssetCache:()=>Be,AssetLoader:()=>xt,AssetSystem:()=>Qr,AssetTextures:()=>wt,Assets:()=>jf,BaseSystem:()=>Oi,GameEngine:()=>Jr,GameObject:()=>Dn,GameObjectManager:()=>ki,ObjectFactory:()=>_t,Renderer:()=>jn,RuntimeObjectRegistry:()=>Ii,Transform:()=>Rn,applyScreenAnchor:()=>ia,basePixi:()=>If,clearResponsiveElements:()=>zf,createPixiBase:()=>Xr,getRegisteredFontIds:()=>Tf,globalResponsiveMultipliers:()=>Nn,initAssetTextures:()=>Ur,initAssets:()=>Df,layout:()=>Bf,playLottieOverlay:()=>Lf,registerFont:()=>Cf,registerType:()=>$r,resolveAnchorVec2:()=>Bn,resolveFont:()=>Sf,resolveFontWeight:()=>Af,resolveScreenAnchorPoint:()=>Mi,resolveScreenRatioPoint:()=>Pi,runInitSequence:()=>Ff,setLottieInstance:()=>qr,spawnSceneFromConfig:()=>Pf,updateScreenState:()=>ta});module.exports=Wf($v);var Ef=require("pixi.js");var st={};function Gn(e,t,i=!1){st[e]||(st[e]=[]),st[e].push({fn:t,once:i})}function ca(e,t){if(st[e]){if(!t){delete st[e];return}st[e]=st[e].filter(i=>i.fn!==t)}}function Wn(e,...t){let i=st[e];if(i)for(let n of[...i])n.fn(...t),n.once&&ca(e,n.fn)}function ge(e,t){Gn(e,t,!0)}var X=null,Ee=[],qt=null;function ll(e){X=e,Ee=[],qt!==null&&(clearTimeout(qt),qt=null)}function cl(){var e,t,i;return{endpoint:(X==null?void 0:X.endpoint)||"",transport:(X==null?void 0:X.transport)||"beacon",batchSize:(e=X==null?void 0:X.batchSize)!=null?e:10,flushIntervalMs:(t=X==null?void 0:X.flushIntervalMs)!=null?t:300,maxQueue:(i=X==null?void 0:X.maxQueue)!=null?i:200,debug:!!(X!=null&&X.debug)}}async function sl(e,t,i,n){let r=JSON.stringify(t);if(i==="beacon"&&typeof navigator!="undefined"&&typeof navigator.sendBeacon=="function")try{let a=navigator.sendBeacon(e,new Blob([r],{type:"application/json"}));n&&console.log("[handler.telemetry] beacon",a,t);return}catch(a){n&&console.warn("[handler.telemetry] beacon failed, fallback to fetch",a)}try{await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:r,keepalive:!0}),n&&console.log("[handler.telemetry] fetch",t)}catch(a){n&&console.warn("[handler.telemetry] fetch failed",a)}}function da(e,t){let i=cl();if(t&&i.endpoint){if(Ee.push(e),Ee.length>i.maxQueue&&(Ee=Ee.slice(Ee.length-i.maxQueue)),Ee.length>=i.batchSize){ol();return}qt===null&&(qt=window.setTimeout(()=>{qt=null,ol()},i.flushIntervalMs))}}async function ol(){let e=cl();if(!e.endpoint||Ee.length===0)return;let t=Ee.splice(0,e.batchSize);await sl(e.endpoint,{events:t},e.transport,e.debug),Ee.length>0&&await sl(e.endpoint,{events:Ee.splice(0,e.batchSize)},e.transport,e.debug)}function dl(e){return Math.max(0,Math.min(1,e))}function Vf(e){let t=String(e!=null?e:"power2.out");if(t==="linear")return i=>i;if(t==="sine.inOut")return i=>.5-Math.cos(Math.PI*i)/2;if(t==="power2.out"||t==="easeOutQuad")return i=>1-(1-i)*(1-i);if(t.startsWith("back.out")){let i=t.match(/back\.out\(([\d.]+)\)/),n=i?Number(i[1]):1.8;return r=>1+(n+1)*Math.pow(r-1,3)+n*Math.pow(r-1,2)}return i=>1-(1-i)*(1-i)}function Hi(){return typeof performance!="undefined"&&performance.now?performance.now():Date.now()}function Yf(e,t){let i=e==null?void 0:e[t];return typeof i=="number"?i:0}function ul(e,t,i){try{e[t]=i}catch{}}function Kf(e){let t=e==null?void 0:e.scale;if(!t)return null;let i=typeof t.x=="number"?t.x:1,n=typeof t.y=="number"?t.y:1;return{x:i,y:n}}function pl(e,t){let i=e==null?void 0:e.scale;if(i)try{typeof i.set=="function"?i.set(t.x,t.y):(typeof i.x=="number"&&(i.x=t.x),typeof i.y=="number"&&(i.y=t.y))}catch{}}function fl(e,t){let i=Kf(e);if(!i)return{from:null,to:null};let n=null,r=null;return typeof t.scale=="number"?(n=t.scale,r=t.scale):t.scale&&typeof t.scale=="object"&&(typeof t.scale.x=="number"&&(n=t.scale.x),typeof t.scale.y=="number"&&(r=t.scale.y)),typeof t.scaleX=="number"&&(n=t.scaleX),typeof t.scaleY=="number"&&(r=t.scaleY),n===null&&r===null?{from:null,to:null}:{from:{x:i.x,y:i.y},to:{x:n!=null?n:i.x,y:r!=null?r:i.y}}}function hl(){let e=new Set,t=new WeakMap,i=null,n=()=>{if(i!=null)return;i=requestAnimationFrame(()=>{i=null,o(),e.size>0&&n()})},r=c=>{var u;e.add(c);let f=(u=t.get(c.target))!=null?u:new Set;f.add(c),t.set(c.target,f),n()},a=c=>{e.delete(c);let f=t.get(c.target);f&&(f.delete(c),f.size===0&&t.delete(c.target))},s=c=>{c.killed||(c.killed=!0,a(c))},o=()=>{var f,u;let c=Hi();for(let p of Array.from(e)){if(p.killed||p.paused)continue;let v=c-p.startMs-p.delayMs;if(v<0)continue;let m=p.durationMs>0?v/p.durationMs:1,w=dl(m),g=p.repeat>=0?p.repeat+1:1,h=p.repeat>0?Math.min(Math.floor(m),g-1):0;if(p.repeat>0&&m>=1){let b=m-h;w=dl(b)}let x=p.ease(w);p.yoyo&&h%2===1&&(x=1-x);for(let b of p.props)ul(p.target,b.key,b.from+(b.to-b.from)*x);p.scaleFrom&&p.scaleTo&&pl(p.target,{x:p.scaleFrom.x+(p.scaleTo.x-p.scaleFrom.x)*x,y:p.scaleFrom.y+(p.scaleTo.y-p.scaleFrom.y)*x});try{(f=p.onUpdate)==null||f.call(p)}catch{}if(m>=g){s(p);try{(u=p.onComplete)==null||u.call(p)}catch{}}}},d=(c,f,u)=>{var b;let p=Math.max(0,(typeof f.duration=="number"?f.duration:.5)*1e3),v=Math.max(0,(typeof f.delay=="number"?f.delay:0)*1e3+((b=u==null?void 0:u.delayMsOverride)!=null?b:0)),m=Vf(f.ease),w=typeof f.repeat=="number"?Math.max(0,f.repeat|0):0,g=f.yoyo===!0,h=new Set(["duration","delay","ease","repeat","yoyo","onUpdate","onComplete","scale","scaleX","scaleY"]),x=[];for(let C of Object.keys(f)){if(h.has(C))continue;let S=f[C];typeof S=="number"&&x.push({key:C,from:Yf(c,C),to:S})}let y=fl(c,f);return{target:c,startMs:Hi(),delayMs:v,durationMs:p,ease:m,props:x,scaleFrom:y.from,scaleTo:y.to,repeat:w,yoyo:g,onUpdate:typeof f.onUpdate=="function"?f.onUpdate:void 0,onComplete:typeof f.onComplete=="function"?f.onComplete:void 0,killed:!1,paused:!1,pauseAtMs:null}},l={to(c,f){let u=d(c,f);return r(u),{kill:()=>s(u),pause:()=>{u.paused||(u.paused=!0,u.pauseAtMs=Hi())},resume:()=>{var m;if(!u.paused)return;let p=(m=u.pauseAtMs)!=null?m:Hi(),v=Hi()-p;u.startMs+=v,u.paused=!1,u.pauseAtMs=null},isActive:()=>!u.killed&&!u.paused}},fromTo(c,f,u){return l.set(c,f),l.to(c,u)},set(c,f){if(!c||!f)return;for(let p of Object.keys(f)){let v=f[p];p==="scale"||p==="scaleX"||p==="scaleY"||typeof v=="number"&&ul(c,p,v)}let u=fl(c,f);u.to&&pl(c,u.to)},killTweensOf(c){let f=t.get(c);if(f)for(let u of Array.from(f))s(u)},timeline(c={}){let f=[],u=0,p=!1,v=[],m=h=>{if(typeof h=="number")return Math.max(0,h*1e3);let x=typeof h=="string"?h.trim():"";return x.startsWith("+=")?u+Math.max(0,Number(x.slice(2))*1e3||0):x?Math.max(0,Number(x)*1e3||0):u},w=h=>{f.push(h);let x=Math.max(0,(typeof h.vars.duration=="number"?h.vars.duration:.5)*1e3);u=Math.max(u,h.atMs+x)},g={to(h,x,y){return w({kind:"to",target:h,vars:x,atMs:m(y)}),g},fromTo(h,x,y,b){return w({kind:"fromTo",target:h,vars:y,from:x,atMs:m(b)}),g},play(){var h,x;if(p)return g;p=!0,v=[];for(let y of f)y.kind==="fromTo"&&l.set(y.target,(h=y.from)!=null?h:{}),v.push(l.to(y.target,{...y.vars,delay:y.atMs/1e3+((x=y.vars.delay)!=null?x:0)}));return g},pause(){for(let h of v)h.pause();return g},kill(){for(let h of v)h.kill();v=[],p=!1}};return c.paused||g.play(),g}};return l}function gl(){if(typeof window=="undefined")return;let e=window;if(!e.gsap)try{e.gsap=hl()}catch{}}var ml={name:"handler-playable-sdk",version:"0.3.34",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",sharp:"^0.34.5"}};var me=0,Zf=me++,bl=me++,yl=me++,vl=me++,xl=me++,wl=me++,_l=me++,El=me++,Sl=me++,Al=me++,Cl=me++,Tl=me++,q=Zf;function kl(){return q===bl}function Ll(){return q===yl}function Ol(){return q===vl}function Il(){return q===xl}function Gt(){return q===wl}function Wt(){return q===_l}function Ml(){return q===El}function Pl(){return q===Sl}function Rl(){return q===Al}function ua(){return q===Cl}function pa(){return q===Tl}function jl(){let e=typeof AD_PROTOCOL!="undefined"?AD_PROTOCOL:"none",t=typeof AD_NETWORK!="undefined"?AD_NETWORK:"web_embed";if(e==="mraid")try{mraid.getState(),q=bl;return}catch{}else if(e==="dapi")try{dapi.isReady(),q=yl;return}catch{}if(t==="facebook")try{typeof FbPlayableAd!="undefined"&&(q=vl)}catch{}else if(t==="google")try{typeof ExitApi!="undefined"&&(q=xl)}catch{}else if(t==="mintegral")window.gameReady&&(q=wl);else if(t==="tapjoy")window.TJ_API&&(q=_l);else if(t==="tiktok")window.openAppStore&&(q=El);else if(t==="smadex")try{window.smxTracking&&(q=Sl)}catch{}else if(t==="snapchat")try{window.ScPlayableAd&&(q=Al)}catch{}else t==="vungle"?q=Cl:(e==="nucleo"||t==="nucleo")&&(q=Tl)}var Vn=qn(require("lottie-web"),1),Dl=Vn.default;typeof window!="undefined"&&(window.lottie=Vn.default,window.__baseLottie=Vn.default);ga();function Z(e,t){let i=(r,a)=>a===0?r:i(a,r%a),n=i(e,t);return`${e/n}:${t/n}`}var xx=[{id:"iphone-15-pro-max",label:"iPhone 15 Pro Max",width:430,height:932,category:"iphone",ratio:Z(430,932)},{id:"iphone-15-pro",label:"iPhone 15 Pro",width:393,height:852,category:"iphone",ratio:Z(393,852)},{id:"iphone-15",label:"iPhone 15",width:393,height:852,category:"iphone",ratio:Z(393,852)},{id:"iphone-14",label:"iPhone 14",width:390,height:844,category:"iphone",ratio:Z(390,844)},{id:"iphone-se",label:"iPhone SE",width:375,height:667,category:"iphone",ratio:Z(375,667)},{id:"iphone-12-mini",label:"iPhone 12 Mini",width:360,height:780,category:"iphone",ratio:Z(360,780)}],wx=[{id:"pixel-8-pro",label:"Pixel 8 Pro",width:448,height:998,category:"android",ratio:Z(448,998)},{id:"pixel-8",label:"Pixel 8",width:412,height:915,category:"android",ratio:Z(412,915)},{id:"samsung-s24-ultra",label:"Samsung S24 Ultra",width:412,height:915,category:"android",ratio:Z(412,915)},{id:"samsung-s24",label:"Samsung S24",width:360,height:780,category:"android",ratio:Z(360,780)},{id:"samsung-a54",label:"Samsung A54",width:412,height:915,category:"android",ratio:Z(412,915)},{id:"oneplus-12",label:"OnePlus 12",width:412,height:915,category:"android",ratio:Z(412,915)}],_x=[{id:"ipad-pro-12",label:'iPad Pro 12.9"',width:1024,height:1366,category:"tablet",ratio:Z(1024,1366)},{id:"ipad-pro-11",label:'iPad Pro 11"',width:834,height:1194,category:"tablet",ratio:Z(834,1194)},{id:"ipad-air",label:"iPad Air",width:820,height:1180,category:"tablet",ratio:Z(820,1180)},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"tablet",ratio:Z(768,1024)},{id:"samsung-tab-s9",label:"Samsung Tab S9",width:800,height:1280,category:"tablet",ratio:Z(800,1280)}],Fl=[{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:Z(390,844),mraidScale:.7},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"playable",ratio:Z(768,1024),mraidScale:.7}];var Ex=[...Fl];var ah=Fl[0];ot();var qy=qn(Jp(),1);function $y(e){return new Promise((t,i)=>{let n=new FileReader;n.onerror=()=>i(new Error("FileReader failed")),n.onload=()=>t(String(n.result||"")),n.readAsDataURL(e)})}function Hy(e){var r;let[t,i]=e.split(","),n=t==null?void 0:t.match(/data:(.*?);base64/);return{base64:i!=null?i:"",mimeType:(r=n==null?void 0:n[1])!=null?r:"image/png"}}async function Uy(e){return await new Promise(t=>{let i=new Image;i.onload=()=>t({width:i.naturalWidth||i.width,height:i.naturalHeight||i.height}),i.onerror=()=>t(null),i.src=e})}async function ao(e){var t,i;try{console.log("[ImageUtils] Fetching image data from URL:",e);let n=await fetch(e);if(!n.ok)return console.warn("[ImageUtils] Fetch failed with status:",n.status,e),null;let r=await n.blob();console.log("[ImageUtils] Blob received, size:",r.size,"type:",r.type);let a=await $y(r),s=await Uy(a),o=Hy(a);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:a,width:(t=s==null?void 0:s.width)!=null?t:0,height:(i=s==null?void 0:s.height)!=null?i:0}}catch(n){return console.error("[ImageUtils] Error fetching image data:",n),null}}async function Br(e,t=30){try{console.log("[ImageUtils] Removing background color...");let i=await new Promise((f,u)=>{let p=new Image;p.onload=()=>f(p),p.onerror=()=>u(new Error("Failed to load image")),p.src=e}),n=document.createElement("canvas");n.width=i.width,n.height=i.height;let r=n.getContext("2d");if(!r)return console.error("[ImageUtils] Failed to get canvas context"),e;r.drawImage(i,0,0);let a=r.getImageData(0,0,n.width,n.height),s=a.data,d=[{name:"top-left",offset:0},{name:"top-right",offset:(n.width-1)*4},{name:"bottom-left",offset:(n.height-1)*n.width*4},{name:"bottom-right",offset:((n.height-1)*n.width+(n.width-1))*4}].map(f=>({r:s[f.offset],g:s[f.offset+1],b:s[f.offset+2]})),l=0;for(let f=0;f<s.length;f+=4){let u=s[f],p=s[f+1],v=s[f+2],m=!1;for(let w of d)if(Math.sqrt(Math.pow(u-w.r,2)+Math.pow(p-w.g,2)+Math.pow(v-w.b,2))<t){m=!0;break}m&&(s[f+3]=0,l++)}return console.log(`[ImageUtils] Removed background from ${l} pixels (4-corner sampling, tolerance: ${t})`),r.putImageData(a,0,0),n.toDataURL("image/png")}catch(i){return console.error("[ImageUtils] Error removing background:",i),e}}var Qp=require("@google/genai");async function so(e,t,i=[],n={}){var r,a,s,o,d,l,c;try{if(!(e!=null&&e.trim()))throw new Error("Gemini API key is required");if(!(t!=null&&t.trim()))throw new Error("Prompt is required");for(let g=0;g<i.length;g++){let h=i[g];if(!h.base64||!h.mimeType)throw new Error(`Image ${g+1} is missing required data`);if(h.base64.length<1e3&&console.warn(`Image ${g+1} data appears very small, may be corrupted`),!h.mimeType.startsWith("image/"))throw new Error(`Image ${g+1} has invalid MIME type: ${h.mimeType}`)}let f=new Qp.GoogleGenAI({apiKey:e}),u="gemini-2.5-flash",p=[t];i.length>0&&i.forEach((g,h)=>{p.push({inlineData:{data:g.base64,mimeType:g.mimeType}}),console.log(`[Gemini] Added image ${h+1}: ${g.mimeType}, size: ${Math.round(g.base64.length/1024)}KB`)}),console.log(`[Gemini] Making request with ${i.length} images and prompt length: ${t.length}`);let v=await f.models.generateContent({model:u,contents:p}),m="",w=(s=(a=(r=v.candidates)==null?void 0:r[0])==null?void 0:a.content)==null?void 0:s.parts;if(w)for(let g of w)g.text&&(m+=g.text);if(!m.trim())throw new Error("Empty response from Gemini API");return console.log(`[Gemini] Response received, length: ${m.length}`),m}catch(f){throw console.error("[Gemini] API error:",f),(o=f.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=f.message)!=null&&d.includes("API_KEY_INVALID")?new Error("Invalid Gemini API key. Please check your API key configuration."):(l=f.message)!=null&&l.includes("QUOTA_EXCEEDED")?new Error("Gemini API quota exceeded. Please try again later or check your billing."):(c=f.message)!=null&&c.includes("SAFETY")?new Error("Content was flagged by Gemini safety filters. Please try with different images."):f}}var ef=require("@google/genai");async function Fr(e,t,i=[],n={}){try{console.info("[GEMINI-REAL-SDK] Initializing GoogleGenAI...");let r=new ef.GoogleGenAI({apiKey:e}),a=[{text:t}];i.length>0&&i.forEach((o,d)=>{console.info(`[GEMINI-REAL-SDK] Adding image part ${d}`),a.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 r.models.generateContent({model:"gemini-2.5-flash-image",contents:a});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,l=o.inlineData.mimeType||"image/png";return console.info("[GEMINI-REAL-SDK] Found inline image data in response"),`data:${l};base64,${d}`}throw new Error("Gemini 2.5 Flash Image returned no image data.")}catch(r){throw console.error("[GEMINI-REAL-SDK] Error in generateImageWithGemini25Flash:",JSON.stringify(r,Object.getOwnPropertyNames(r),2)),r}}var Xy=require("pixi.js");An();ot();var of=require("pixi.js");var Zy=require("pixi.js");ot();function rv(e){return new Promise((t,i)=>{let n=new FileReader;n.onerror=()=>i(new Error("FileReader failed")),n.onload=()=>t(String(n.result||"")),n.readAsDataURL(e)})}function av(e){var r;let[t,i]=e.split(","),n=t==null?void 0:t.match(/data:(.*?);base64/);return{base64:i!=null?i:"",mimeType:(r=n==null?void 0:n[1])!=null?r:"image/png"}}function sv(e){return`
48
48
  Analyze these screenshots of a brand or game and extract its "Brand DNA".
49
49
 
50
50
  Provide a concise summary (2-3 sentences) covering:
@@ -3384,6 +3384,128 @@
3384
3384
  filter: grayscale(1);
3385
3385
  opacity: 0.5;
3386
3386
  }
3387
+ /* Version Management Section */
3388
+ .version-management-section {
3389
+ margin-top: 16px;
3390
+ padding: 12px;
3391
+ background: rgba(30, 35, 45, 0.5);
3392
+ border: 1px solid var(--ui-border);
3393
+ border-radius: 10px;
3394
+ }
3395
+
3396
+ .version-header {
3397
+ margin-bottom: 12px;
3398
+ }
3399
+
3400
+ .version-label {
3401
+ font-size: 11px;
3402
+ font-weight: 700;
3403
+ text-transform: uppercase;
3404
+ letter-spacing: 0.05em;
3405
+ color: var(--ui-accent);
3406
+ }
3407
+
3408
+ .version-controls {
3409
+ display: flex;
3410
+ flex-direction: column;
3411
+ gap: 12px;
3412
+ }
3413
+
3414
+ .version-current {
3415
+ display: flex;
3416
+ align-items: center;
3417
+ gap: 8px;
3418
+ }
3419
+
3420
+ .version-current label {
3421
+ font-size: 12px;
3422
+ color: var(--ui-text);
3423
+ min-width: 110px;
3424
+ font-weight: 600;
3425
+ }
3426
+
3427
+ .version-dropdown {
3428
+ flex: 1;
3429
+ padding: 8px 10px;
3430
+ border: 1px solid var(--ui-border);
3431
+ border-radius: 6px;
3432
+ background: var(--ui-surface);
3433
+ color: var(--ui-text);
3434
+ font-size: 12px;
3435
+ cursor: pointer;
3436
+ transition: border-color var(--ui-duration-fast);
3437
+ }
3438
+
3439
+ .version-dropdown:hover {
3440
+ border-color: var(--ui-accent);
3441
+ }
3442
+
3443
+ .version-dropdown:focus {
3444
+ outline: none;
3445
+ border-color: var(--ui-accent);
3446
+ box-shadow: 0 0 0 2px rgba(61, 214, 198, 0.2);
3447
+ }
3448
+
3449
+ .persistence-btn {
3450
+ padding: 10px 16px;
3451
+ background: var(--ui-surface);
3452
+ color: var(--ui-text);
3453
+ border: 1px solid var(--ui-border);
3454
+ border-radius: 8px;
3455
+ font-size: 11px;
3456
+ font-weight: 700;
3457
+ cursor: pointer;
3458
+ transition: all var(--ui-duration-fast);
3459
+ }
3460
+
3461
+ .persistence-btn:hover:not(:disabled) {
3462
+ background: rgba(61, 214, 198, 0.1);
3463
+ border-color: var(--ui-accent);
3464
+ }
3465
+
3466
+ .persistence-btn:disabled {
3467
+ opacity: 0.5;
3468
+ cursor: not-allowed;
3469
+ }
3470
+
3471
+ /* Developer-Only Section */
3472
+ .dev-only-section {
3473
+ margin-top: 16px;
3474
+ padding: 12px;
3475
+ background: rgba(255, 165, 0, 0.08);
3476
+ border: 1px solid rgba(255, 165, 0, 0.3);
3477
+ border-radius: 8px;
3478
+ }
3479
+
3480
+ .dev-warning {
3481
+ font-size: 11px;
3482
+ color: #ff8c00;
3483
+ font-weight: 700;
3484
+ margin-bottom: 8px;
3485
+ text-transform: uppercase;
3486
+ letter-spacing: 0.05em;
3487
+ }
3488
+
3489
+ .persistence-btn.danger-action {
3490
+ background: #dc3545;
3491
+ border-color: #dc3545;
3492
+ color: white;
3493
+ width: 100%;
3494
+ }
3495
+
3496
+ .persistence-btn.danger-action:hover:not(:disabled) {
3497
+ background: #c82333;
3498
+ border-color: #c82333;
3499
+ box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
3500
+ }
3501
+
3502
+ .dev-hint {
3503
+ margin-top: 8px;
3504
+ font-size: 10px;
3505
+ color: var(--ui-muted);
3506
+ font-style: italic;
3507
+ line-height: 1.4;
3508
+ }
3387
3509
 
3388
3510
 
3389
3511
  /* ========== 08-inspector.css ========== */
@@ -1 +1 @@
1
- function a0_0x770f(_0x335d36,_0x4e8802){_0x335d36=_0x335d36-(0x1cf2+0x85e+-0x23a8);var _0x3e0d33=a0_0x2f8c();var _0x3905b0=_0x3e0d33[_0x335d36];if(a0_0x770f['gNTylH']===undefined){var _0x4c46fc=function(_0x449727){var _0x462cf3='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0x19860c='',_0x492a20='',_0x51fe07=_0x19860c+_0x4c46fc;for(var _0x3a2f71=-0x2*0xf+-0x20fa+0x2118,_0x3ccf4d,_0x2c0216,_0x23cfff=0x55*-0x26+-0x25*-0x55+0x1*0x55;_0x2c0216=_0x449727['charAt'](_0x23cfff++);~_0x2c0216&&(_0x3ccf4d=_0x3a2f71%(0x1b19+0xe4c+0x1*-0x2961)?_0x3ccf4d*(0x1f9a+-0x1*0x1c99+-0x2c1)+_0x2c0216:_0x2c0216,_0x3a2f71++%(-0x2503+-0x218a+0x4691))?_0x19860c+=_0x51fe07['charCodeAt'](_0x23cfff+(-0x242+-0x23f5+0x2641))-(0x1175+-0x1cc7+-0x2*-0x5ae)!==-0x30c+-0x1a20+-0x1*-0x1d2c?String['fromCharCode'](0x1fd*-0x10+-0x1*-0x1198+-0x30b*-0x5&_0x3ccf4d>>(-(-0x28*0x31+-0x178f+0x1*0x1f39)*_0x3a2f71&-0x655*-0x1+-0x2596+0x1f47)):_0x3a2f71:0x1911+0x91*-0x18+-0xb*0x10b){_0x2c0216=_0x462cf3['indexOf'](_0x2c0216);}for(var _0x54a4c0=-0x6a5+0x1*0xca+0x5db*0x1,_0x2e286f=_0x19860c['length'];_0x54a4c0<_0x2e286f;_0x54a4c0++){_0x492a20+='%'+('00'+_0x19860c['charCodeAt'](_0x54a4c0)['toString'](0x7c6+0xb*0x7a+-0xcf4))['slice'](-(0x117f+0x186b+-0x29e8));}return decodeURIComponent(_0x492a20);};var _0x29071a=function(_0x5ee3d7,_0xd8834f){var _0x1a3bba=[],_0x41e64a=0x198f+0x2*-0xb59+-0x2dd,_0x123851,_0x2a803e='';_0x5ee3d7=_0x4c46fc(_0x5ee3d7);var _0x9ccb08;for(_0x9ccb08=0x2176+0x17b5+-0x392b;_0x9ccb08<0x1*0x1cb7+0x40c+-0x1fc3;_0x9ccb08++){_0x1a3bba[_0x9ccb08]=_0x9ccb08;}for(_0x9ccb08=0x9*0x1c5+0x1*0x2255+0x1*-0x3242;_0x9ccb08<0x6e5+-0x5e*-0x1+-0x643;_0x9ccb08++){_0x41e64a=(_0x41e64a+_0x1a3bba[_0x9ccb08]+_0xd8834f['charCodeAt'](_0x9ccb08%_0xd8834f['length']))%(0x1*0x1424+-0x18f8+0x175*0x4),_0x123851=_0x1a3bba[_0x9ccb08],_0x1a3bba[_0x9ccb08]=_0x1a3bba[_0x41e64a],_0x1a3bba[_0x41e64a]=_0x123851;}_0x9ccb08=0xe*0x55+-0x1*-0xb2f+-0x7*0x243,_0x41e64a=0x13*0xef+-0x482+-0xd3b;for(var _0x18f575=0x1875+-0x179b+-0xda*0x1;_0x18f575<_0x5ee3d7['length'];_0x18f575++){_0x9ccb08=(_0x9ccb08+(-0x21d2+0x619+0x1fb*0xe))%(0x111e+-0x163b+-0x1*-0x61d),_0x41e64a=(_0x41e64a+_0x1a3bba[_0x9ccb08])%(0x1334*-0x1+0x127d+0x1b7),_0x123851=_0x1a3bba[_0x9ccb08],_0x1a3bba[_0x9ccb08]=_0x1a3bba[_0x41e64a],_0x1a3bba[_0x41e64a]=_0x123851,_0x2a803e+=String['fromCharCode'](_0x5ee3d7['charCodeAt'](_0x18f575)^_0x1a3bba[(_0x1a3bba[_0x9ccb08]+_0x1a3bba[_0x41e64a])%(0x120d*0x1+0x8a9*-0x3+0x8ee)]);}return _0x2a803e;};a0_0x770f['DIpMUG']=_0x29071a,a0_0x770f['qHanbL']={},a0_0x770f['gNTylH']=!![];}var _0x562283=_0x3e0d33[-0x1*0xb29+0x233f+0x1816*-0x1],_0x37f08a=_0x335d36+_0x562283,_0x5f563a=a0_0x770f['qHanbL'][_0x37f08a];if(!_0x5f563a){if(a0_0x770f['IwebMg']===undefined){var _0x8001d0=function(_0x2d4ed5){this['pYEjBt']=_0x2d4ed5,this['MECNvs']=[-0x33b*0x6+0x1c37+-0x2*0x46a,0xc7*0x2+0x2337+-0x24c5,0x22b*-0x1+-0xbb*0x1b+0x15e4],this['NnjeTq']=function(){return'newState';},this['gTCCsL']='\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*',this['DXkcoi']='[\x27|\x22].+[\x27|\x22];?\x20*}';};_0x8001d0['prototype']['kFFoBV']=function(){var _0x28fd62=new RegExp(this['gTCCsL']+this['DXkcoi']),_0x26e1d9=_0x28fd62['test'](this['NnjeTq']['toString']())?--this['MECNvs'][0x11e4+-0x705+0x1a*-0x6b]:--this['MECNvs'][-0x4dc+-0x3*0x4b+0x5bd];return this['HkXnWs'](_0x26e1d9);},_0x8001d0['prototype']['HkXnWs']=function(_0x218dbd){if(!Boolean(~_0x218dbd))return _0x218dbd;return this['ZnYOMd'](this['pYEjBt']);},_0x8001d0['prototype']['ZnYOMd']=function(_0x2be454){for(var _0x55bb21=0x4*0x346+-0x268*0x10+0x32d*0x8,_0x2849aa=this['MECNvs']['length'];_0x55bb21<_0x2849aa;_0x55bb21++){this['MECNvs']['push'](Math['round'](Math['random']())),_0x2849aa=this['MECNvs']['length'];}return _0x2be454(this['MECNvs'][0x134*-0x12+0x1065*-0x1+-0x3*-0xcaf]);},new _0x8001d0(a0_0x770f)['kFFoBV'](),a0_0x770f['IwebMg']=!![];}_0x3905b0=a0_0x770f['DIpMUG'](_0x3905b0,_0x4e8802),a0_0x770f['qHanbL'][_0x37f08a]=_0x3905b0;}else _0x3905b0=_0x5f563a;return _0x3905b0;}(function(_0x514cf1,_0x59b787){var a0_0x507d3a={_0x22e346:0xd7,_0x313973:0xd3,_0x3e65a4:0xcf,_0x3e0952:'oq5J',_0xe603a8:0xd1,_0x1a1d67:0xd7,_0x5016fd:0xd6,_0xff0d3f:'Rv#B',_0x5227c9:0x1a8,_0x42e134:0x1b4,_0x5aed6a:0x19f,_0x2c8d9a:0x199,_0x2e5a17:'^V^x',_0x2f49ed:0x84,_0x5741ce:0x8e,_0xbaa3c0:'Cy5B',_0x12e41d:0x80,_0x37c1d3:0x7d,_0x47966e:0x89,_0x39d5e0:'ugVK',_0x3447db:0x82,_0x20abb8:0x7d,_0x2c9434:0x8b,_0x26513a:0x75,_0x23e63d:0x1a6,_0x224d3c:0x1a7,_0x3b8798:0x193,_0x17ca4d:0x19a,_0x46fbc1:'Rv#B',_0x130f51:'VvlQ',_0x38b14f:0x80,_0x5c8090:0x7f,_0x259687:0x77},a0_0x32f63b={_0x1c81da:0x28a},a0_0x5a8d52={_0x107f67:0x23e};function _0xbe9e33(_0x52d410,_0xb9cc84,_0x5eb9f4,_0x599169,_0x27ec22){return a0_0x770f(_0x599169- -0x13,_0x27ec22);}var _0x55f91b=_0x514cf1();function _0x17b442(_0x236c40,_0x1e7ff1,_0x174ef2,_0x3f4739,_0x4c0d8d){return a0_0x770f(_0x1e7ff1- -a0_0x5a8d52._0x107f67,_0x236c40);}function _0x448b3b(_0x516ce4,_0x51d11d,_0x216f1f,_0x1554a9,_0xdbaed3){return a0_0x770f(_0x516ce4- -a0_0x32f63b._0x1c81da,_0xdbaed3);}while(!![]){try{var _0x56235b=-parseInt(_0x448b3b(-a0_0x507d3a._0x22e346,-a0_0x507d3a._0x313973,-a0_0x507d3a._0x3e65a4,-0xd3,a0_0x507d3a._0x3e0952))/(-0x4dc+-0x3*0x4b+0x5be)+parseInt(_0x448b3b(-a0_0x507d3a._0xe603a8,-a0_0x507d3a._0x1a1d67,-a0_0x507d3a._0x5016fd,-0xcf,a0_0x507d3a._0xff0d3f))/(0x4*0x346+-0x268*0x10+0xcb5*0x2)+parseInt(_0xbe9e33(a0_0x507d3a._0x5227c9,0x1af,a0_0x507d3a._0x42e134,0x1ac,'^me^'))/(0x134*-0x12+0x1065*-0x1+-0x8*-0x4c2)+-parseInt(_0xbe9e33(0x197,0x196,a0_0x507d3a._0x5aed6a,a0_0x507d3a._0x2c8d9a,'^V^x'))/(0x1*0x303+0x1945*0x1+0x1c44*-0x1)*(parseInt(_0x17b442(a0_0x507d3a._0x2e5a17,-a0_0x507d3a._0x2f49ed,-0x7c,-0x78,-a0_0x507d3a._0x5741ce))/(-0xb*0x7f+0x224*0x8+0x7*-0x1aa))+-parseInt(_0x17b442(a0_0x507d3a._0xbaa3c0,-0x8a,-a0_0x507d3a._0x12e41d,-a0_0x507d3a._0x37c1d3,-a0_0x507d3a._0x47966e))/(-0x1*0x304+-0x35*0x2f+0xcc5)+-parseInt(_0x17b442(a0_0x507d3a._0x39d5e0,-a0_0x507d3a._0x3447db,-a0_0x507d3a._0x20abb8,-a0_0x507d3a._0x2c9434,-a0_0x507d3a._0x26513a))/(0xeec+-0x1825+0x940)*(-parseInt(_0xbe9e33(a0_0x507d3a._0x23e63d,a0_0x507d3a._0x224d3c,a0_0x507d3a._0x3b8798,a0_0x507d3a._0x17ca4d,a0_0x507d3a._0x46fbc1))/(-0x2084+-0x1f3+0x227f))+-parseInt(_0x17b442(a0_0x507d3a._0x130f51,-a0_0x507d3a._0x38b14f,-a0_0x507d3a._0x5c8090,-a0_0x507d3a._0x259687,-0x86))/(-0x31c+0x1f2b*0x1+0x22*-0xd3);if(_0x56235b===_0x59b787)break;else _0x55f91b['push'](_0x55f91b['shift']());}catch(_0x145ff2){_0x55f91b['push'](_0x55f91b['shift']());}}}(a0_0x2f8c,-0x1d0a*0x9d+-0x9a8a6*-0x1+-0x12810*-0x11));var a0_0x1ba729=(function(){var _0x3d5689=!![];return function(_0x4fb936,_0x3f9fbb){var a0_0x47009e={_0xee6082:0x1d9,_0x4aaf5f:'ugVK',_0x3a2945:0x1e6,_0x1cf759:0x1cc,_0x189bfb:0x1e0},_0x5a1a7e=_0x3d5689?function(){var a0_0x2157cd={_0x2baa7a:0x399};function _0x15deb8(_0x2ab945,_0x82d86b,_0x5edcbc,_0x4e4311,_0x1b2202){return a0_0x770f(_0x2ab945- -a0_0x2157cd._0x2baa7a,_0x82d86b);}if(_0x3f9fbb){var _0x2c86dc=_0x3f9fbb[_0x15deb8(-a0_0x47009e._0xee6082,a0_0x47009e._0x4aaf5f,-a0_0x47009e._0x3a2945,-a0_0x47009e._0x1cf759,-a0_0x47009e._0x189bfb)](_0x4fb936,arguments);return _0x3f9fbb=null,_0x2c86dc;}}:function(){};return _0x3d5689=![],_0x5a1a7e;};}()),a0_0xfaca3c=a0_0x1ba729(this,function(){var a0_0x20a2fa={_0x40b573:0x1f2,_0x17f798:0x1eb,_0xe0e01c:0x1e1,_0x40c45d:0x1e4,_0x13c7cd:'mEt5',_0x2504d5:0x1f7,_0x2175c2:0x1f0,_0x16ad84:0x1f6,_0x2dda22:'kv7]',_0x4d2eb7:0x475,_0x455c34:0x482,_0x1c818f:0x47c,_0x3728bd:'uAP&',_0x400ca5:'P11R',_0x405262:0x0,_0x1cb43d:0x12,_0xd979a9:0xa,_0x3cf648:0x1a,_0x194a47:0xf,_0x2f832c:'2&&y',_0xd74443:0x10,_0x499459:0xe,_0x1e5b96:0x9,_0x488dd9:0x46c,_0x4a1adf:0x46a,_0x28903c:0x477,_0x43c81b:'VvlQ',_0x55cc4d:0x4,_0x281eea:'@#T!',_0x2810c0:0xa},a0_0x216748={_0x9b0429:0x1bc},a0_0x3365c1={_0x5b6aac:0x2c1},a0_0x5c2200={_0x26d8eb:0x39a},_0x56e841={};_0x56e841['QzurR']=_0x2f78d9(-a0_0x20a2fa._0x40b573,-a0_0x20a2fa._0x17f798,-a0_0x20a2fa._0xe0e01c,-a0_0x20a2fa._0x40c45d,a0_0x20a2fa._0x13c7cd)+')+)+)'+'+$';function _0x2f78d9(_0x1db1ac,_0x219b08,_0x97b80d,_0x401f52,_0x459ff3){return a0_0x770f(_0x219b08- -a0_0x5c2200._0x26d8eb,_0x459ff3);}function _0x23b394(_0x414a19,_0x4fb2d5,_0x4b25dd,_0x3a5012,_0x3e1e2b){return a0_0x770f(_0x4fb2d5-a0_0x3365c1._0x5b6aac,_0x3e1e2b);}var _0x1faabc=_0x56e841;function _0x508a3c(_0x2e508f,_0x5e4dd3,_0x35edc5,_0x53eae2,_0x267fdd){return a0_0x770f(_0x2e508f- -a0_0x216748._0x9b0429,_0x5e4dd3);}return a0_0xfaca3c['toStr'+'ing']()[_0x2f78d9(-a0_0x20a2fa._0x2504d5,-a0_0x20a2fa._0x2175c2,-a0_0x20a2fa._0x16ad84,-0x1f1,a0_0x20a2fa._0x2dda22)+'h'](_0x1faabc[_0x23b394(a0_0x20a2fa._0x4d2eb7,a0_0x20a2fa._0x455c34,0x486,a0_0x20a2fa._0x1c818f,a0_0x20a2fa._0x3728bd)])['toStr'+_0x508a3c(-0x6,a0_0x20a2fa._0x400ca5,a0_0x20a2fa._0x405262,-a0_0x20a2fa._0x1cb43d,-a0_0x20a2fa._0xd979a9)]()[_0x508a3c(-0xe,'Y*pK',-a0_0x20a2fa._0x3cf648,-a0_0x20a2fa._0x194a47,-0x15)+_0x508a3c(-a0_0x20a2fa._0xd979a9,a0_0x20a2fa._0x2f832c,-a0_0x20a2fa._0xd74443,-a0_0x20a2fa._0x499459,-a0_0x20a2fa._0x1e5b96)+'r'](a0_0xfaca3c)[_0x23b394(0x465,a0_0x20a2fa._0x488dd9,a0_0x20a2fa._0x4a1adf,a0_0x20a2fa._0x28903c,a0_0x20a2fa._0x43c81b)+'h'](_0x1faabc[_0x508a3c(-a0_0x20a2fa._0x55cc4d,a0_0x20a2fa._0x281eea,-a0_0x20a2fa._0x2810c0,-0xc,-0x7)]);});a0_0xfaca3c();import{A as a0_0x22fbd1,B as a0_0x5886b3,C as a0_0x4c9fd9,D as a0_0x2203ac,b as a0_0x29d19a,c as a0_0x431964,d as a0_0x52bc88,e as a0_0x34a0a3,f as a0_0x557a0d,g as a0_0x335c44,h as a0_0x6974ee,i as a0_0xcc0a68,j as a0_0x43209f,k as a0_0x599782,l as a0_0x46d42d,m as a0_0x3fb3f4,n as a0_0x5ddf20,o as a0_0x354ca5,p as a0_0x319540,q as a0_0x319275,r as a0_0x381aa9,s as a0_0x3022c2,t as a0_0xe251d,u as a0_0x3dc5b8,v as a0_0x93d5fc,w as a0_0x2cf9b1,x as a0_0x4844f4,y as a0_0x113667,z as a0_0x48dc7b}from'../chunk-UAQZO7QB.js';import{a as a0_0x374fe5,b as a0_0x2c198a,c as a0_0x3be97b,d as a0_0x4caf86,e as a0_0x355c41}from'../chunk-I5OOVR5U.js';import'../chunk-LV4HGC5G.js';import'../chunk-ZLL42OOV.js';import'../chunk-E6WJCS24.js';function a0_0x2f8c(){var _0x3abe88=['WRa6WOZcVSoCWRFdImkToHqVjcS','W4ZcLrNdH8ks','WQvlkSk7W7ldUgtdGsJdNmk6WRG7','smoRdJCxmtX5lG','fuBdLSo3hGBcT8o1qmk6yCkVW6m','tSkvW70RAXBdGa','ig4NW4ddSCkfcq','WOxcUSooW4ldI0BcUhtdKs4NqSo6','WOWlW77cVmoSdx/cNCo/W4jzW6RdSa','gmk9W54vzG','WR8GWPKRW40','kCkzwKvwWQ7cSmkYW4vtW7O','W4tdGtlcSLfciCo2WQW','WR4kW7DAWOa','W4tdQmkBWOtcMq','tSoKc3Pyit9GdSoWEq','WQbpjSk7W7pdTgJdVa/dQmk0WPOo','WOPimCk6lW','ySkAWQfedq','WQvnj8k5W7hdSgZdNsNdGCkcWRqM','aCo7WRCSi8k5ECk4WQLwbZJdRq','W5CbWRBcMCkq','fKddM8oXfa7dGCoXE8k4smkv','W6OgW5PNWRNdUCkGv8kKzrxdT8kN','WPrbW6pdN8omWOZcVsBdHZ/cRCoGdq','lMhdMq'];a0_0x2f8c=function(){return _0x3abe88;};return a0_0x2f8c();}import'../chunk-Q7FPWOA3.js';export{a0_0x374fe5 as AssetCache,a0_0x3be97b as AssetLoader,a0_0x3dc5b8 as AssetSystem,a0_0x4caf86 as AssetTextures,a0_0x3022c2 as Assets,a0_0x354ca5 as BaseSystem,a0_0x5ddf20 as GameEngine,a0_0x34a0a3 as GameObject,a0_0x557a0d as GameObjectManager,a0_0x3fb3f4 as ObjectFactory,a0_0x52bc88 as Renderer,a0_0x319540 as RuntimeObjectRegistry,a0_0x431964 as Transform,a0_0x5886b3 as applyScreenAnchor,a0_0x319275 as basePixi,a0_0x2cf9b1 as clearResponsiveElements,a0_0x29d19a as createPixiBase,a0_0x43209f as getRegisteredFontIds,a0_0x93d5fc as globalResponsiveMultipliers,a0_0x355c41 as initAssetTextures,a0_0xe251d as initAssets,a0_0x4c9fd9 as layout,a0_0x46d42d as playLottieOverlay,a0_0xcc0a68 as registerFont,a0_0x2c198a as registerType,a0_0x113667 as resolveAnchorVec2,a0_0x335c44 as resolveFont,a0_0x6974ee as resolveFontWeight,a0_0x48dc7b as resolveScreenAnchorPoint,a0_0x22fbd1 as resolveScreenRatioPoint,a0_0x2203ac as runInitSequence,a0_0x599782 as setLottieInstance,a0_0x381aa9 as spawnSceneFromConfig,a0_0x4844f4 as updateScreenState};
1
+ (function(_0x26366e,_0xc3317f){var a0_0x479d1e={_0x532403:0x2c7,_0x2c5df7:0x2c0,_0x123754:0x2c1,_0x3bd804:'jI0x',_0x459ae8:0x2c3,_0xf18db5:'$%zn',_0xa8d143:0x2ce,_0x2d1cee:0x7,_0x1014d2:0x3,_0x44cc21:0xe,_0x943903:0x4,_0x238e5:'K)IL',_0x3111b4:0x4d,_0x2e58b5:0x4f,_0x338488:0x52,_0x2b5aab:0x4d,_0x163ad6:'K)IL',_0x44f2c1:0x2cc,_0x93236a:'oY2s',_0x44eb2b:0x2b8,_0x3ecbf4:0x2b4,_0x161265:0x2a7,_0x5e33f6:0x2be,_0x5551e4:0x5,_0x49d697:0x3,_0x2dcf5d:0x6,_0x533200:0xb,_0x5de12a:'Iliy',_0x49f93c:0x2c9,_0x20d973:0x2c9,_0x191464:0x2c5,_0x47ce14:'x#yx',_0x39f59b:0x2d2,_0x58a1ac:0x4,_0x4cbe7c:0x15,_0x44a1e4:0x4,_0x43575a:0x13,_0x206873:0x10,_0x8b6047:0x12,_0x228147:0x19,_0x2831b4:0x1f,_0x1f3837:0xa},a0_0x2fbaaf={_0x4d887d:0xbe},a0_0xd80d53={_0x52e2be:0x1fc};function _0x45773e(_0x5e8d26,_0x5850dd,_0x1f19a0,_0x57d5f1,_0x2f43d2){return a0_0x1818(_0x5e8d26- -a0_0xd80d53._0x52e2be,_0x2f43d2);}function _0x23b51c(_0x27a11d,_0x3ec4e3,_0x34567d,_0x33053a,_0x3a08cf){return a0_0x1818(_0x3ec4e3-a0_0x2fbaaf._0x4d887d,_0x33053a);}function _0x50cb4f(_0x364e2a,_0x3d7f7e,_0x1087a3,_0x537d64,_0x2f31f3){return a0_0x1818(_0x364e2a- -0x239,_0x2f31f3);}var _0x3666af=_0x26366e();while(!![]){try{var _0x3ba4d4=parseInt(_0x23b51c(a0_0x479d1e._0x532403,a0_0x479d1e._0x2c5df7,a0_0x479d1e._0x123754,a0_0x479d1e._0x3bd804,0x2bb))/(0x1124+0x14e9+-0x260c)+-parseInt(_0x23b51c(a0_0x479d1e._0x123754,a0_0x479d1e._0x459ae8,0x2c1,a0_0x479d1e._0xf18db5,a0_0x479d1e._0xa8d143))/(-0x4e2*-0x1+0xf1a+-0x9fd*0x2)*(parseInt(_0x45773e(-a0_0x479d1e._0x2d1cee,-a0_0x479d1e._0x1014d2,-a0_0x479d1e._0x44cc21,-a0_0x479d1e._0x943903,a0_0x479d1e._0x238e5))/(0x21df*0x1+0x232*-0xb+-0x9b6))+-parseInt(_0x50cb4f(-a0_0x479d1e._0x3111b4,-a0_0x479d1e._0x2e58b5,-a0_0x479d1e._0x338488,-a0_0x479d1e._0x2b5aab,a0_0x479d1e._0x163ad6))/(-0x2622+0x2f7*0xc+-0xe*-0x2f)*(-parseInt(_0x23b51c(a0_0x479d1e._0x123754,a0_0x479d1e._0x123754,a0_0x479d1e._0x44f2c1,a0_0x479d1e._0x93236a,0x2c6))/(-0x24e+0x1*-0x2410+0x13d*0x1f))+-parseInt(_0x23b51c(a0_0x479d1e._0x44eb2b,a0_0x479d1e._0x3ecbf4,a0_0x479d1e._0x161265,'K)IL',a0_0x479d1e._0x5e33f6))/(-0x2435+0x797+0x1ca4)*(parseInt(_0x45773e(a0_0x479d1e._0x5551e4,-a0_0x479d1e._0x49d697,-a0_0x479d1e._0x2dcf5d,-a0_0x479d1e._0x533200,a0_0x479d1e._0x5de12a))/(0x258b+0x187c+0x40*-0xf8))+parseInt(_0x23b51c(a0_0x479d1e._0x49f93c,a0_0x479d1e._0x20d973,a0_0x479d1e._0x191464,a0_0x479d1e._0x47ce14,a0_0x479d1e._0x39f59b))/(0x1921+0x2401+0x365*-0x12)+parseInt(_0x45773e(a0_0x479d1e._0x58a1ac,a0_0x479d1e._0x4cbe7c,-a0_0x479d1e._0x44a1e4,a0_0x479d1e._0x43575a,'SZe8'))/(0xe*0x2a9+0x11*0x1f7+-0x469c)+parseInt(_0x45773e(a0_0x479d1e._0x206873,a0_0x479d1e._0x8b6047,a0_0x479d1e._0x2d1cee,0x11,'UWHz'))/(-0x8*-0x156+0x32*0x96+0x27f2*-0x1)*(-parseInt(_0x45773e(0xe,a0_0x479d1e._0x228147,a0_0x479d1e._0x2831b4,a0_0x479d1e._0x1f3837,a0_0x479d1e._0x3bd804))/(0x1a34+0x210f+-0x3b38));if(_0x3ba4d4===_0xc3317f)break;else _0x3666af['push'](_0x3666af['shift']());}catch(_0xbfd046){_0x3666af['push'](_0x3666af['shift']());}}}(a0_0x4988,-0x5c11c+-0x9f843*-0x1+0x5b625));var a0_0x3251b3=(function(){var _0x4b2b8f=!![];return function(_0x3fd23c,_0x2d58aa){var a0_0x3f43a7={_0x3ed074:0x536,_0x44f0e6:0x535,_0xfa4a8f:0x542,_0xa7a07b:'x#yx'},_0x4cb33e=_0x4b2b8f?function(){var a0_0x3ec8ed={_0x2cd213:0x33d};function _0x1d510e(_0x24904f,_0x505c09,_0x410e3d,_0x4d1fbc,_0x5c1878){return a0_0x1818(_0x24904f-a0_0x3ec8ed._0x2cd213,_0x5c1878);}if(_0x2d58aa){var _0x53ea67=_0x2d58aa[_0x1d510e(a0_0x3f43a7._0x3ed074,a0_0x3f43a7._0x44f0e6,a0_0x3f43a7._0xfa4a8f,0x536,a0_0x3f43a7._0xa7a07b)](_0x3fd23c,arguments);return _0x2d58aa=null,_0x53ea67;}}:function(){};return _0x4b2b8f=![],_0x4cb33e;};}()),a0_0x2ff353=a0_0x3251b3(this,function(){var a0_0x9fc8d0={_0x49e780:'*cDq',_0x3d736b:0x12f,_0x5d0787:0x12a,_0x54d8f3:'Qi6M',_0x370e38:0x12e,_0x35d00c:0x134,_0x59a664:0x3a9,_0xccfc7c:0x3ba,_0x4c2373:'*cDq',_0x1ac39d:'d2nr',_0x22457a:0x109,_0x4adda5:0x118,_0xdda257:0x113,_0x466c32:0x10b,_0x3a6500:0x3ac,_0x4b40f1:0x3a1,_0x59844b:'Yy))',_0x687bb8:0x3b7,_0x3a82dc:0x391,_0x3560d6:0x39e,_0x3908ce:0x390,_0x2c6a73:'Yf0a',_0x3d7082:0x397,_0x134585:'x#yx',_0x58e1fe:0x3a8,_0x1f648b:0x3a0,_0x3ec16c:0x3a5,_0x535f59:'p&Ok',_0x52683c:0x116,_0x1dcba3:0x134,_0x6acbfb:0x15,_0x40bf17:0xf,_0xed98ba:0x9,_0x3b1a99:0x8,_0x7f341b:'t^PR',_0x5c3eff:0x123,_0x3e5ece:0x121,_0x20b8fd:0x11e,_0x5262f9:0x12b,_0x100568:'oY2s',_0xd63ebe:0x125,_0x3e0e4f:0x11d,_0x544833:0x117},a0_0x4e4df0={_0x18c1bc:0xd9},a0_0x2874b4={_0x4b2dc:0x1a3},_0x55ad6c={};_0x55ad6c[_0x1e08f2(a0_0x9fc8d0._0x49e780,0x140,a0_0x9fc8d0._0x3d736b,a0_0x9fc8d0._0x5d0787,0x128)]=_0x1e08f2(a0_0x9fc8d0._0x54d8f3,0x12f,a0_0x9fc8d0._0x370e38,0x133,a0_0x9fc8d0._0x35d00c)+_0x138edf(a0_0x9fc8d0._0x59a664,a0_0x9fc8d0._0xccfc7c,a0_0x9fc8d0._0x59a664,a0_0x9fc8d0._0x4c2373,0x3ad)+'+$';function _0x138edf(_0x5f18e4,_0x440b15,_0x4f1e6a,_0x2702e6,_0x5bfebc){return a0_0x1818(_0x5f18e4-a0_0x2874b4._0x4b2dc,_0x2702e6);}var _0x4abc1f=_0x55ad6c;function _0x1e08f2(_0x1e8819,_0x3358be,_0x48337a,_0x20f6f7,_0x22a405){return a0_0x1818(_0x48337a- -a0_0x4e4df0._0x18c1bc,_0x1e8819);}function _0x5a8478(_0x911853,_0x29f61c,_0x84cea5,_0x37a818,_0x4ece27){return a0_0x1818(_0x37a818- -0x1f4,_0x29f61c);}return a0_0x2ff353[_0x1e08f2(a0_0x9fc8d0._0x1ac39d,a0_0x9fc8d0._0x22457a,a0_0x9fc8d0._0x4adda5,a0_0x9fc8d0._0xdda257,a0_0x9fc8d0._0x466c32)+_0x138edf(a0_0x9fc8d0._0x3a6500,a0_0x9fc8d0._0x4b40f1,0x3b2,a0_0x9fc8d0._0x59844b,a0_0x9fc8d0._0x687bb8)]()[_0x138edf(a0_0x9fc8d0._0x3a82dc,a0_0x9fc8d0._0x3560d6,a0_0x9fc8d0._0x3908ce,a0_0x9fc8d0._0x2c6a73,a0_0x9fc8d0._0x3d7082)+'h'](_0x4abc1f[_0x138edf(a0_0x9fc8d0._0x3d7082,0x38e,0x396,a0_0x9fc8d0._0x134585,a0_0x9fc8d0._0x58e1fe)])[_0x138edf(a0_0x9fc8d0._0x1f648b,0x3a8,a0_0x9fc8d0._0x3ec16c,'AXqT',0x395)+_0x1e08f2(a0_0x9fc8d0._0x535f59,a0_0x9fc8d0._0x52683c,0x123,a0_0x9fc8d0._0x370e38,a0_0x9fc8d0._0x1dcba3)]()['const'+_0x5a8478(-a0_0x9fc8d0._0x6acbfb,'!$T^',-a0_0x9fc8d0._0x40bf17,-a0_0x9fc8d0._0xed98ba,a0_0x9fc8d0._0x3b1a99)+'r'](a0_0x2ff353)[_0x1e08f2(a0_0x9fc8d0._0x7f341b,a0_0x9fc8d0._0x5c3eff,a0_0x9fc8d0._0x3e5ece,a0_0x9fc8d0._0x20b8fd,a0_0x9fc8d0._0x5262f9)+'h'](_0x4abc1f[_0x1e08f2(a0_0x9fc8d0._0x100568,a0_0x9fc8d0._0xd63ebe,0x119,a0_0x9fc8d0._0x3e0e4f,a0_0x9fc8d0._0x544833)]);});a0_0x2ff353();import{A as a0_0x335542,B as a0_0x41d6ce,C as a0_0x37c4c7,D as a0_0x7a0e2a,b as a0_0x16d828,c as a0_0x7647d6,d as a0_0xd99b1d,e as a0_0x5cfa2a,f as a0_0x25377d,g as a0_0x264254,h as a0_0x18cd23,i as a0_0x5b0986,j as a0_0x303dad,k as a0_0x16871d,l as a0_0x150361,m as a0_0x5974fb,n as a0_0x395f79,o as a0_0x4b0916,p as a0_0x9c99f1,q as a0_0x38beab,r as a0_0x408192,s as a0_0x2d45a9,t as a0_0x2366ff,u as a0_0x252e64,v as a0_0x3a0442,w as a0_0x230268,x as a0_0x1bd979,y as a0_0x52aac6,z as a0_0x235bca}from'../chunk-PHSE57CN.js';function a0_0x1818(_0x2cdfc6,_0x3acde2){_0x2cdfc6=_0x2cdfc6-(0x1*-0x2ee+0x7f*-0x28+0x18b1);var _0xb66ae6=a0_0x4988();var _0x4eddde=_0xb66ae6[_0x2cdfc6];if(a0_0x1818['wUlJZJ']===undefined){var _0x33cfc2=function(_0x151f2e){var _0x22bd97='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0xc40ec7='',_0x5d8283='',_0x4d92ea=_0xc40ec7+_0x33cfc2;for(var _0xe59661=0x21f1*0x1+-0x1*0x62a+-0x1bc7,_0xee6636,_0x488c28,_0x4497cd=-0x84*-0x25+0x6*-0x2a7+-0x32a;_0x488c28=_0x151f2e['charAt'](_0x4497cd++);~_0x488c28&&(_0xee6636=_0xe59661%(-0xe9f+-0x84*0x8+0x12c3)?_0xee6636*(-0x2*-0x2de+-0x1*0x1e95+-0x19*-0x101)+_0x488c28:_0x488c28,_0xe59661++%(-0x4dc+0x1*0x2344+-0xa*0x30a))?_0xc40ec7+=_0x4d92ea['charCodeAt'](_0x4497cd+(0x7*0x283+-0x2677*-0x1+0x2*-0x1c01))-(0x25f0*-0x1+0x1172+0x1488)!==0x91*0x1+0x15f9+-0x168a?String['fromCharCode'](-0x30d*-0x1+0x2*-0x1220+0x2232&_0xee6636>>(-(0x115a*0x1+0x1b8*0x9+0x4*-0x834)*_0xe59661&-0x241c+0x43*0x20+0x2*0xde1)):_0xe59661:0x2*-0x995+0x23c4+0x19*-0xaa){_0x488c28=_0x22bd97['indexOf'](_0x488c28);}for(var _0x4e5c09=-0xa*-0x27b+0x1a1e+0x4*-0xcbb,_0x5ba241=_0xc40ec7['length'];_0x4e5c09<_0x5ba241;_0x4e5c09++){_0x5d8283+='%'+('00'+_0xc40ec7['charCodeAt'](_0x4e5c09)['toString'](0x2fc+0xedf+-0x11cb))['slice'](-(-0x2*0x1082+-0x1bee+0x3cf4));}return decodeURIComponent(_0x5d8283);};var _0x38f3b3=function(_0x17b6b2,_0x2473aa){var _0x3eb58d=[],_0x53679c=0x2384+0x74+0x2*-0x11fc,_0x5d24e3,_0x5874ca='';_0x17b6b2=_0x33cfc2(_0x17b6b2);var _0x31dddf;for(_0x31dddf=0x8*0x2cd+-0x1f0e+0x8a6;_0x31dddf<-0x89c+0x876+-0x6*-0x31;_0x31dddf++){_0x3eb58d[_0x31dddf]=_0x31dddf;}for(_0x31dddf=0x1e30+-0x3d*0x2+0x2*-0xedb;_0x31dddf<0x2a0*-0xe+0x1*0x17c5+-0x3*-0x4a9;_0x31dddf++){_0x53679c=(_0x53679c+_0x3eb58d[_0x31dddf]+_0x2473aa['charCodeAt'](_0x31dddf%_0x2473aa['length']))%(0x17b*0xd+-0x236e+-0x1*-0x112f),_0x5d24e3=_0x3eb58d[_0x31dddf],_0x3eb58d[_0x31dddf]=_0x3eb58d[_0x53679c],_0x3eb58d[_0x53679c]=_0x5d24e3;}_0x31dddf=-0x1*-0x1ba6+-0x300+-0x18a6,_0x53679c=0x25a1+-0x3*-0x313+-0xf9e*0x3;for(var _0x3ee460=0x1260+-0x1fb*0x13+0x1341;_0x3ee460<_0x17b6b2['length'];_0x3ee460++){_0x31dddf=(_0x31dddf+(-0xb5*-0x2e+0xf29*0x1+-0x2fae))%(0xb*-0x2bc+0x47d+0x1a97*0x1),_0x53679c=(_0x53679c+_0x3eb58d[_0x31dddf])%(0x1*-0x10d7+-0x17dd+0x4*0xa6d),_0x5d24e3=_0x3eb58d[_0x31dddf],_0x3eb58d[_0x31dddf]=_0x3eb58d[_0x53679c],_0x3eb58d[_0x53679c]=_0x5d24e3,_0x5874ca+=String['fromCharCode'](_0x17b6b2['charCodeAt'](_0x3ee460)^_0x3eb58d[(_0x3eb58d[_0x31dddf]+_0x3eb58d[_0x53679c])%(0x1*-0x1b7+-0x1baf+-0xa22*-0x3)]);}return _0x5874ca;};a0_0x1818['futrtm']=_0x38f3b3,a0_0x1818['mNQkMz']={},a0_0x1818['wUlJZJ']=!![];}var _0x56df54=_0xb66ae6[-0x49*0x7f+-0x1d2d+0x14*0x345],_0x4fa8a0=_0x2cdfc6+_0x56df54,_0x37f2a6=a0_0x1818['mNQkMz'][_0x4fa8a0];if(!_0x37f2a6){if(a0_0x1818['hUhBGB']===undefined){var _0x46fec2=function(_0x41e630){this['iFgVEt']=_0x41e630,this['jiANpm']=[0x6b1+-0x20f8+-0x4*-0x692,-0x704+0x8*-0xfc+0xee4*0x1,-0x3*0xccb+-0xb81+0x9fa*0x5],this['JEsgqb']=function(){return'newState';},this['SaKgtD']='\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*',this['vOwYct']='[\x27|\x22].+[\x27|\x22];?\x20*}';};_0x46fec2['prototype']['xRpXAb']=function(){var _0xf7b8b4=new RegExp(this['SaKgtD']+this['vOwYct']),_0x3cbb52=_0xf7b8b4['test'](this['JEsgqb']['toString']())?--this['jiANpm'][0x1124+0x14e9+-0x260c]:--this['jiANpm'][-0x4e2*-0x1+0xf1a+-0x4ff*0x4];return this['MseudU'](_0x3cbb52);},_0x46fec2['prototype']['MseudU']=function(_0x53727d){if(!Boolean(~_0x53727d))return _0x53727d;return this['IRjOXC'](this['iFgVEt']);},_0x46fec2['prototype']['IRjOXC']=function(_0x3ca60f){for(var _0x2750a4=0x21df*0x1+0x232*-0xb+-0x9b9,_0x5351b0=this['jiANpm']['length'];_0x2750a4<_0x5351b0;_0x2750a4++){this['jiANpm']['push'](Math['round'](Math['random']())),_0x5351b0=this['jiANpm']['length'];}return _0x3ca60f(this['jiANpm'][-0x2622+0x2f7*0xc+-0x6*-0x6d]);},new _0x46fec2(a0_0x1818)['xRpXAb'](),a0_0x1818['hUhBGB']=!![];}_0x4eddde=a0_0x1818['futrtm'](_0x4eddde,_0x3acde2),a0_0x1818['mNQkMz'][_0x4fa8a0]=_0x4eddde;}else _0x4eddde=_0x37f2a6;return _0x4eddde;}import{a as a0_0x5487ed,b as a0_0x2f1b54,c as a0_0x13e33a,d as a0_0x53ec0b,e as a0_0x176855}from'../chunk-I5OOVR5U.js';import'../chunk-LV4HGC5G.js';import'../chunk-ZLL42OOV.js';import'../chunk-E6WJCS24.js';import'../chunk-Q7FPWOA3.js';function a0_0x4988(){var _0x310103=['D8ofv8oPDW','WRWwDmk9W4pcHLfAt8k6sfnw','W6T5v0DTEY8','nLJdU8kwcq','WQfwWQTJCG','W5H3ieGHWOG/W7f+x0xdIwW','W4VdGwbxWOK','W4r7WR9Pe8knWPJdNmoJW5TGeSkt','W4jZW4SywmosW7NdNG','W4tdUSoofWtdU1hdMW','WQ3cUWKZW71Lu8kjWQbtWRvZWQC','W73dU0fPWRy','k23cPKxdIa','xgpcJCkKASk0emoO','rG4m','W71lhSo6WOK','WPjJWRSHfKxdPCkmcL3cHmoRW7G','owGbW5DifSkwWPqvdeu0W7y','uerjW5yVpN/dOCkCW5dcLCoTW50','qLVcUSkXsmofW4RcGSkShsBcTG','WO9DiCk5W49pq8kNWQNcGSoPW6C','W4uUW4OeamosiCo2W4tdNM/cPd4','beZdJCoew8oKW6K','W5ztWPxdLqdcUKm','WPFcIZ8NWRW','WRZdL8oKr8ow','W6NdQKDEW5m','zwZcRq','WOfyjCk6W4PofSkcWPJcVCoUW6VdRW','WQNcUqG2W7DKv8kYWPDZWR1NWRi','W6lcS1ddRmkVjmo3yW','Fb5BEsK','W4eTW4qqzmotW6C','kZX4WPTnkWxdOCoZF8kLW5y'];a0_0x4988=function(){return _0x310103;};return a0_0x4988();}export{a0_0x5487ed as AssetCache,a0_0x13e33a as AssetLoader,a0_0x252e64 as AssetSystem,a0_0x53ec0b as AssetTextures,a0_0x2d45a9 as Assets,a0_0x4b0916 as BaseSystem,a0_0x395f79 as GameEngine,a0_0x5cfa2a as GameObject,a0_0x25377d as GameObjectManager,a0_0x5974fb as ObjectFactory,a0_0xd99b1d as Renderer,a0_0x9c99f1 as RuntimeObjectRegistry,a0_0x7647d6 as Transform,a0_0x41d6ce as applyScreenAnchor,a0_0x38beab as basePixi,a0_0x230268 as clearResponsiveElements,a0_0x16d828 as createPixiBase,a0_0x303dad as getRegisteredFontIds,a0_0x3a0442 as globalResponsiveMultipliers,a0_0x176855 as initAssetTextures,a0_0x2366ff as initAssets,a0_0x37c4c7 as layout,a0_0x150361 as playLottieOverlay,a0_0x5b0986 as registerFont,a0_0x2f1b54 as registerType,a0_0x52aac6 as resolveAnchorVec2,a0_0x264254 as resolveFont,a0_0x18cd23 as resolveFontWeight,a0_0x235bca as resolveScreenAnchorPoint,a0_0x335542 as resolveScreenRatioPoint,a0_0x7a0e2a as runInitSequence,a0_0x16871d as setLottieInstance,a0_0x408192 as spawnSceneFromConfig,a0_0x1bd979 as updateScreenState};